@orderingstack/front-components-product-configurator 0.0.0 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,19 +1,19 @@
1
- "use strict";var Gi=Object.defineProperty,Ki=Object.defineProperties;var Ji=Object.getOwnPropertyDescriptors;var Mr=Object.getOwnPropertySymbols;var Xi=Object.prototype.hasOwnProperty,Yi=Object.prototype.propertyIsEnumerable;var Ur=(e,t,r)=>t in e?Gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ue=(e,t)=>{for(var r in t||(t={}))Xi.call(t,r)&&Ur(e,r,t[r]);if(Mr)for(var r of Mr(t))Yi.call(t,r)&&Ur(e,r,t[r]);return e},Xe=(e,t)=>Ki(e,Ji(t));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var O=require("react"),Vr=require("react-spring"),Qi=require("react-dom");function Zi(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}function ea(e,t){return t.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in e)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(e)}var he=Zi(O);var mt=e=>e.type==="checkbox",tt=e=>e instanceof Date,fe=e=>e==null;const Jn=e=>typeof e=="object";var ie=e=>!fe(e)&&!Array.isArray(e)&&Jn(e)&&!tt(e),ta=e=>ie(e)&&e.target?mt(e.target)?e.target.checked:e.target.value:e,ra=e=>e.substring(0,e.search(/.\d/))||e,na=(e,t)=>[...e].some(r=>ra(t)===r),Wt=e=>e.filter(Boolean),ne=e=>e===void 0,T=(e,t,r)=>{if(!t||!ie(e))return r;const n=Wt(t.split(/[,[\].]+?/)).reduce((i,a)=>fe(i)?i:i[a],e);return ne(n)||n===e?ne(e[t])?r:e[t]:n};const $r={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},be={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Re={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};var zt=(e,t)=>{const r=Object.assign({},e);return delete r[t],r};const Xn=he.default.createContext(null),yt=()=>he.default.useContext(Xn),ia=e=>he.default.createElement(Xn.Provider,{value:zt(e,"children")},e.children);var aa=(e,t,r,n=!0)=>{const i={};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t[o]!==be.all&&(t[o]=!n||be.all),r&&(r[o]=!0),e[o]}});return i},ge=e=>ie(e)&&!Object.keys(e).length,oa=(e,t,r)=>{const n=zt(e,"name");return ge(n)||Object.keys(n).length>=Object.keys(t).length||Object.keys(n).find(i=>t[i]===(!r||be.all))},ir=e=>Array.isArray(e)?e:[e];function sa(e){const t=he.default.useRef(e);t.current=e,he.default.useEffect(()=>{const r=i=>{i&&i.unsubscribe()},n=!e.disabled&&t.current.subject.subscribe({next:t.current.callback});return()=>r(n)},[e.disabled])}var Ce=e=>typeof e=="string",ua=(e,t,r,n)=>{const i=Array.isArray(e);return Ce(e)?(n&&t.watch.add(e),T(r,e)):i?e.map(a=>(n&&t.watch.add(a),T(r,a))):(n&&(t.watchAll=!0),r)},Gt=e=>typeof e=="function",Yn=e=>{for(const t in e)if(Gt(e[t]))return!0;return!1},la=(e,t,r,n,i)=>t?Object.assign(Object.assign({},r[e]),{types:Object.assign(Object.assign({},r[e]&&r[e].types?r[e].types:{}),{[n]:i||!0})}):{},Er=e=>/^\w*$/.test(e),Qn=e=>Wt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Z(e,t,r){let n=-1;const i=Er(t)?[t]:Qn(t),a=i.length,o=a-1;for(;++n<a;){const s=i[n];let u=r;if(n!==o){const c=e[s];u=ie(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}e[s]=u,e=e[s]}return e}const pr=(e,t,r)=>{for(const n of r||Object.keys(e)){const i=T(e,n);if(i){const a=i._f,o=zt(i,"_f");if(a&&t(a.name)){if(a.ref.focus&&ne(a.ref.focus()))break;if(a.refs){a.refs[0].focus();break}}else ie(o)&&pr(o,t)}}};var Hr=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));function et(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(r||ie(e)){t=r?[]:{};for(const n in e){if(Gt(e[n])){t=e;break}t[n]=et(e[n])}}else return e;return t}function ar(){let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}}var jt=e=>fe(e)||!Jn(e);function rt(e,t){if(jt(e)||jt(t))return e===t;if(tt(e)&&tt(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const a=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=t[i];if(tt(a)&&tt(o)||ie(a)&&ie(o)||Array.isArray(a)&&Array.isArray(o)?!rt(a,o):a!==o)return!1}}return!0}var Br=e=>({isOnSubmit:!e||e===be.onSubmit,isOnBlur:e===be.onBlur,isOnChange:e===be.onChange,isOnAll:e===be.all,isOnTouch:e===be.onTouched}),gt=e=>typeof e=="boolean",kr=e=>e.type==="file",vr=e=>e instanceof HTMLElement,Zn=e=>e.type==="select-multiple",Nr=e=>e.type==="radio",ca=e=>Nr(e)||mt(e),qr=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined",or=e=>vr(e)&&e.isConnected;function fa(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=ne(e)?n++:e[t[n++]];return e}function le(e,t){const r=Er(t)?[t]:Qn(t),n=r.length==1?e:fa(e,r),i=r[r.length-1];let a;n&&delete n[i];for(let o=0;o<r.slice(0,-1).length;o++){let s=-1,u;const c=r.slice(0,-(o+1)),f=c.length-1;for(o>0&&(a=e);++s<c.length;){const l=c[s];u=u?u[l]:e[l],f===s&&(ie(u)&&ge(u)||Array.isArray(u)&&!u.filter(d=>ie(d)&&!ge(d)||gt(d)).length)&&(a?delete a[l]:delete e[l]),a=u}}return e}function Ft(e,t={}){const r=Array.isArray(e);if(ie(e)||r)for(const n in e)Array.isArray(e[n])||ie(e[n])&&!Yn(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Ft(e[n],t[n])):fe(e[n])||(t[n]=!0);return t}function ei(e,t,r){const n=Array.isArray(e);if(ie(e)||n)for(const i in e)Array.isArray(e[i])||ie(e[i])&&!Yn(e[i])?ne(t)||jt(r[i])?r[i]=Array.isArray(e[i])?Ft(e[i],[]):Object.assign({},Ft(e[i])):ei(e[i],fe(t)?{}:t[i],r[i]):r[i]=!rt(e[i],t[i]);return r}var Wr=(e,t)=>ei(e,t,Ft(t));const zr={value:!1,isValid:!1},Gr={value:!0,isValid:!0};var ti=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ne(e[0].attributes.value)?ne(e[0].value)||e[0].value===""?Gr:{value:e[0].value,isValid:!0}:Gr:zr}return zr},ri=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ne(e)?e:t?e===""?NaN:+e:r&&Ce(e)?new Date(e):n?n(e):e;const Kr={isValid:!1,value:null};var ni=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Kr):Kr;function sr(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return kr(t)?t.files:Nr(t)?ni(e.refs).value:Zn(t)?[...t.selectedOptions].map(({value:r})=>r):mt(t)?ti(e.refs).value:ri(ne(t.value)?e.ref.value:t.value,e)}var da=(e,t,r,n)=>{const i={};for(const a of e){const o=T(t,a);o&&Z(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Tt=e=>e instanceof RegExp,it=e=>ne(e)?void 0:Tt(e)?e.source:ie(e)?Tt(e.value)?e.value.source:e.value:e,ga=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Jr(e,t,r){const n=T(e,r);if(n||Er(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=T(t,a),s=T(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};i.pop()}return{name:r}}var ha=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,pa=(e,t)=>!Wt(T(e,t)).length&&le(e,t),Rt=e=>Ce(e)||he.default.isValidElement(e);function Xr(e,t,r="validate"){if(Rt(e)||Array.isArray(e)&&e.every(Rt)||gt(e)&&!e)return{type:r,message:Rt(e)?e:"",ref:t}}var Ye=e=>ie(e)&&!Tt(e)?e:{value:e,message:""},Yr=async(e,t,r,n)=>{const{ref:i,refs:a,required:o,maxLength:s,minLength:u,min:c,max:f,pattern:l,validate:d,name:g,valueAsNumber:h,mount:b,disabled:w}=e._f;if(!b||w)return{};const m=a?a[0]:i,N=L=>{n&&m.reportValidity&&(m.setCustomValidity(gt(L)?"":L||" "),m.reportValidity())},E={},k=Nr(i),M=mt(i),I=k||M,j=(h||kr(i))&&!i.value||t===""||Array.isArray(t)&&!t.length,V=la.bind(null,g,r,E),B=(L,A,q,H=Re.maxLength,v=Re.minLength)=>{const P=L?A:q;E[g]=Object.assign({type:L?H:v,message:P,ref:i},V(L?H:v,P))};if(o&&(!I&&(j||fe(t))||gt(t)&&!t||M&&!ti(a).isValid||k&&!ni(a).isValid)){const{value:L,message:A}=Rt(o)?{value:!!o,message:o}:Ye(o);if(L&&(E[g]=Object.assign({type:Re.required,message:A,ref:m},V(Re.required,A)),!r))return N(A),E}if(!j&&(!fe(c)||!fe(f))){let L,A;const q=Ye(f),H=Ye(c);if(isNaN(t)){const v=i.valueAsDate||new Date(t);Ce(q.value)&&(L=v>new Date(q.value)),Ce(H.value)&&(A=v<new Date(H.value))}else{const v=i.valueAsNumber||+t;fe(q.value)||(L=v>q.value),fe(H.value)||(A=v<H.value)}if((L||A)&&(B(!!L,q.message,H.message,Re.max,Re.min),!r))return N(E[g].message),E}if((s||u)&&!j&&Ce(t)){const L=Ye(s),A=Ye(u),q=!fe(L.value)&&t.length>L.value,H=!fe(A.value)&&t.length<A.value;if((q||H)&&(B(q,L.message,A.message),!r))return N(E[g].message),E}if(l&&!j&&Ce(t)){const{value:L,message:A}=Ye(l);if(Tt(L)&&!t.match(L)&&(E[g]=Object.assign({type:Re.pattern,message:A,ref:i},V(Re.pattern,A)),!r))return N(A),E}if(d){if(Gt(d)){const L=await d(t),A=Xr(L,m);if(A&&(E[g]=Object.assign(Object.assign({},A),V(Re.validate,A.message)),!r))return N(A.message),E}else if(ie(d)){let L={};for(const A in d){if(!ge(L)&&!r)break;const q=Xr(await d[A](t),m,A);q&&(L=Object.assign(Object.assign({},q),V(A,q.message)),N(q.message),r&&(E[g]=L))}if(!ge(L)&&(E[g]=Object.assign({ref:m},L),!r))return E}}return N(!0),E};const va={mode:be.onSubmit,reValidateMode:be.onChange,shouldFocusError:!0};function ma(e={}){let t=Object.assign(Object.assign({},va),e),r={isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}},n={},i=t.defaultValues||{},a=t.shouldUnregister?{}:et(i),o={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0,f={};const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={watch:ar(),array:ar(),state:ar()},g=Br(t.mode),h=Br(t.reValidateMode),b=t.criteriaMode===be.all,w=(p,y)=>(...x)=>{clearTimeout(c),c=window.setTimeout(()=>p(...x),y)},m=async p=>{let y=!1;return l.isValid&&(y=t.resolver?ge((await j()).errors):await B(n,!0),!p&&y!==r.isValid&&(r.isValid=y,d.state.next({isValid:y}))),y},N=(p,y=[],x,R,F=!0,C=!0)=>{if(R&&x){if(o.action=!0,C&&Array.isArray(T(n,p))){const _=x(T(n,p),R.argA,R.argB);F&&Z(n,p,_)}if(l.errors&&C&&Array.isArray(T(r.errors,p))){const _=x(T(r.errors,p),R.argA,R.argB);F&&Z(r.errors,p,_),pa(r.errors,p)}if(l.touchedFields&&Array.isArray(T(r.touchedFields,p))){const _=x(T(r.touchedFields,p),R.argA,R.argB);F&&Z(r.touchedFields,p,_)}l.dirtyFields&&(r.dirtyFields=Wr(i,a)),d.state.next({isDirty:A(p,y),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Z(a,p,y)},E=(p,y)=>(Z(r.errors,p,y),d.state.next({errors:r.errors})),k=(p,y,x,R)=>{const F=T(n,p);if(F){const C=T(a,p,ne(x)?T(i,p):x);ne(C)||R&&R.defaultChecked||y?Z(a,p,y?C:sr(F._f)):v(p,C),o.mount&&m()}},M=(p,y,x,R,F)=>{let C=!1;const _={name:p},K=T(r.touchedFields,p);if(l.isDirty){const Fe=r.isDirty;r.isDirty=_.isDirty=A(),C=Fe!==_.isDirty}if(l.dirtyFields&&(!x||R)){const Fe=T(r.dirtyFields,p);rt(T(i,p),y)?le(r.dirtyFields,p):Z(r.dirtyFields,p,!0),_.dirtyFields=r.dirtyFields,C=C||Fe!==T(r.dirtyFields,p)}return x&&!K&&(Z(r.touchedFields,p,x),_.touchedFields=r.touchedFields,C=C||l.touchedFields&&K!==x),C&&F&&d.state.next(_),C?_:{}},I=async(p,y,x,R,F)=>{const C=T(r.errors,y),_=l.isValid&&r.isValid!==x;if(e.delayError&&R?(u=u||w(E,e.delayError),u(y,R)):(clearTimeout(c),R?Z(r.errors,y,R):le(r.errors,y)),((R?!rt(C,R):C)||!ge(F)||_)&&!p){const K=Object.assign(Object.assign(Object.assign({},F),_?{isValid:x}:{}),{errors:r.errors,name:y});r=Object.assign(Object.assign({},r),K),d.state.next(K)}f[y]--,l.isValidating&&!Object.values(f).some(K=>K)&&(d.state.next({isValidating:!1}),f={})},j=async p=>t.resolver?await t.resolver(Object.assign({},a),t.context,da(p||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation)):{},V=async p=>{const{errors:y}=await j();if(p)for(const x of p){const R=T(y,x);R?Z(r.errors,x,R):le(r.errors,x)}else r.errors=y;return y},B=async(p,y,x={valid:!0})=>{for(const R in p){const F=p[R];if(F){const C=F._f,_=zt(F,"_f");if(C){const K=await Yr(F,T(a,C.name),b,t.shouldUseNativeValidation);if(K[C.name]&&(x.valid=!1,y))break;y||(K[C.name]?Z(r.errors,C.name,K[C.name]):le(r.errors,C.name))}_&&await B(_,y,x)}}return x.valid},L=()=>{for(const p of s.unMount){const y=T(n,p);y&&(y._f.refs?y._f.refs.every(x=>!or(x)):!or(y._f.ref))&&re(p)}s.unMount=new Set},A=(p,y)=>(p&&y&&Z(a,p,y),!rt($(),i)),q=(p,y,x)=>{const R=Object.assign({},o.mount?a:ne(y)?i:Ce(p)?{[p]:y}:y);return ua(p,s,R,x)},H=p=>Wt(T(o.mount?a:i,p,e.shouldUnregister?T(i,p,[]):[])),v=(p,y,x={})=>{const R=T(n,p);let F=y;if(R){const C=R._f;C&&(!C.disabled&&Z(a,p,ri(y,C)),F=qr&&vr(C.ref)&&fe(y)?"":y,Zn(C.ref)?[...C.ref.options].forEach(_=>_.selected=F.includes(_.value)):C.refs?mt(C.ref)?C.refs.length>1?C.refs.forEach(_=>_.checked=Array.isArray(F)?!!F.find(K=>K===_.value):F===_.value):C.refs[0]&&(C.refs[0].checked=!!F):C.refs.forEach(_=>_.checked=_.value===F):kr(C.ref)?C.ref.value="":(C.ref.value=F,C.ref.type||d.watch.next({name:p})))}(x.shouldDirty||x.shouldTouch)&&M(p,F,x.shouldTouch,x.shouldDirty,!0),x.shouldValidate&&G(p)},P=(p,y,x)=>{for(const R in y){const F=y[R],C=`${p}.${R}`,_=T(n,C);(s.array.has(p)||!jt(F)||_&&!_._f)&&!tt(F)?P(C,F,x):v(C,F,x)}},D=(p,y,x={})=>{const R=T(n,p),F=s.array.has(p),C=et(y);Z(a,p,C),F?(d.array.next({name:p,values:a}),(l.isDirty||l.dirtyFields)&&x.shouldDirty&&(r.dirtyFields=Wr(i,a),d.state.next({name:p,dirtyFields:r.dirtyFields,isDirty:A(p,C)}))):R&&!R._f&&!fe(C)?P(p,C,x):v(p,C,x),Hr(p,s)&&d.state.next({}),d.watch.next({name:p})},z=async p=>{const y=p.target;let x=y.name;const R=T(n,x);if(R){let F,C;const _=y.type?sr(R._f):ta(p),K=p.type===$r.BLUR||p.type===$r.FOCUS_OUT,Fe=!ga(R._f)&&!t.resolver&&!T(r.errors,x)&&!R._f.deps||ha(K,T(r.touchedFields,x),r.isSubmitted,h,g),Pt=Hr(x,s,K);Z(a,x,_),K?R._f.onBlur&&R._f.onBlur(p):R._f.onChange&&R._f.onChange(p);const nr=M(x,_,K,!1),Wi=!ge(nr)||Pt;if(!K&&d.watch.next({name:x,type:p.type}),Fe)return Wi&&d.state.next(Object.assign({name:x},Pt?{}:nr));if(!K&&Pt&&d.state.next({}),f[x]=(f[x],1),d.state.next({isValidating:!0}),t.resolver){const{errors:_r}=await j([x]),zi=Jr(r.errors,n,x),Ir=Jr(_r,n,zi.name||x);F=Ir.error,x=Ir.name,C=ge(_r)}else F=(await Yr(R,T(a,x),b,t.shouldUseNativeValidation))[x],C=await m(!0);R._f.deps&&G(R._f.deps),I(!1,x,C,F,nr)}},G=async(p,y={})=>{let x,R;const F=ir(p);if(d.state.next({isValidating:!0}),t.resolver){const C=await V(ne(p)?p:F);x=ge(C),R=p?!F.some(_=>T(C,_)):x}else p?(R=(await Promise.all(F.map(async C=>{const _=T(n,C);return await B(_&&_._f?{[C]:_}:_)}))).every(Boolean),!(!R&&!r.isValid)&&m()):R=x=await B(n);return d.state.next(Object.assign(Object.assign(Object.assign({},!Ce(p)||l.isValid&&x!==r.isValid?{}:{name:p}),t.resolver?{isValid:x}:{}),{errors:r.errors,isValidating:!1})),y.shouldFocus&&!R&&pr(n,C=>T(r.errors,C),p?F:s.mount),R},$=p=>{const y=Object.assign(Object.assign({},i),o.mount?a:{});return ne(p)?y:Ce(p)?T(y,p):p.map(x=>T(y,x))},ee=(p,y)=>({invalid:!!T((y||r).errors,p),isDirty:!!T((y||r).dirtyFields,p),isTouched:!!T((y||r).touchedFields,p),error:T((y||r).errors,p)}),U=p=>{p?ir(p).forEach(y=>le(r.errors,y)):r.errors={},d.state.next({errors:r.errors})},X=(p,y,x)=>{const R=(T(n,p,{_f:{}})._f||{}).ref;Z(r.errors,p,Object.assign(Object.assign({},y),{ref:R})),d.state.next({name:p,errors:r.errors,isValid:!1}),x&&x.shouldFocus&&R&&R.focus&&R.focus()},se=(p,y)=>Gt(p)?d.watch.subscribe({next:x=>p(q(void 0,y),x)}):q(p,y,!0),re=(p,y={})=>{for(const x of p?ir(p):s.mount)s.mount.delete(x),s.array.delete(x),T(n,x)&&(y.keepValue||(le(n,x),le(a,x)),!y.keepError&&le(r.errors,x),!y.keepDirty&&le(r.dirtyFields,x),!y.keepTouched&&le(r.touchedFields,x),!t.shouldUnregister&&!y.keepDefaultValue&&le(i,x));d.watch.next({}),d.state.next(Object.assign(Object.assign({},r),y.keepDirty?{isDirty:A()}:{})),!y.keepIsValid&&m()},J=(p,y={})=>{let x=T(n,p);const R=gt(y.disabled);return Z(n,p,{_f:Object.assign(Object.assign(Object.assign({},x&&x._f?x._f:{ref:{name:p}}),{name:p,mount:!0}),y)}),s.mount.add(p),x?R&&Z(a,p,y.disabled?void 0:T(a,p,sr(x._f))):k(p,!0,y.value),Object.assign(Object.assign(Object.assign({},R?{disabled:y.disabled}:{}),t.shouldUseNativeValidation?{required:!!y.required,min:it(y.min),max:it(y.max),minLength:it(y.minLength),maxLength:it(y.maxLength),pattern:it(y.pattern)}:{}),{name:p,onChange:z,onBlur:z,ref:F=>{if(F){J(p,y),x=T(n,p);const C=ne(F.value)&&F.querySelectorAll&&F.querySelectorAll("input,select,textarea")[0]||F,_=ca(C),K=x._f.refs||[];if(_?K.find(Fe=>Fe===C):C===x._f.ref)return;Z(n,p,{_f:Object.assign(Object.assign({},x._f),_?{refs:K.concat(C).filter(or),ref:{type:C.type,name:p}}:{ref:C})}),k(p,!1,void 0,C)}else x=T(n,p,{}),x._f&&(x._f.mount=!1),(t.shouldUnregister||y.shouldUnregister)&&!(na(s.array,p)&&o.action)&&s.unMount.add(p)}})};return{control:{register:J,unregister:re,getFieldState:ee,_executeSchema:j,_getWatch:q,_getDirty:A,_updateValid:m,_removeUnmounted:L,_updateFieldArray:N,_getFieldArray:H,_subjects:d,_proxyFormState:l,get _fields(){return n},get _formValues(){return a},get _stateFlags(){return o},set _stateFlags(p){o=p},get _defaultValues(){return i},get _names(){return s},set _names(p){s=p},get _formState(){return r},set _formState(p){r=p},get _options(){return t},set _options(p){t=Object.assign(Object.assign({},t),p)}},trigger:G,register:J,handleSubmit:(p,y)=>async x=>{x&&(x.preventDefault&&x.preventDefault(),x.persist&&x.persist());let R=!0,F=et(a);d.state.next({isSubmitting:!0});try{if(t.resolver){const{errors:C,values:_}=await j();r.errors=C,F=_}else await B(n);ge(r.errors)&&Object.keys(r.errors).every(C=>T(F,C))?(d.state.next({errors:{},isSubmitting:!0}),await p(F,x)):(y&&await y(Object.assign({},r.errors),x),t.shouldFocusError&&pr(n,C=>T(r.errors,C),s.mount))}catch(C){throw R=!1,C}finally{r.isSubmitted=!0,d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ge(r.errors)&&R,submitCount:r.submitCount+1,errors:r.errors})}},watch:se,setValue:D,getValues:$,reset:(p,y={})=>{const x=p||i,R=et(x),F=p&&!ge(p)?R:i;if(y.keepDefaultValues||(i=x),!y.keepValues){if(qr&&ne(p))for(const C of s.mount){const _=T(n,C);if(_&&_._f){const K=Array.isArray(_._f.refs)?_._f.refs[0]:_._f.ref;try{vr(K)&&K.closest("form").reset();break}catch{}}}a=e.shouldUnregister?y.keepDefaultValues?et(i):{}:R,n={},d.array.next({values:F}),d.watch.next({values:F})}s={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!y.keepIsValid,o.watch=!!e.shouldUnregister,d.state.next({submitCount:y.keepSubmitCount?r.submitCount:0,isDirty:y.keepDirty?r.isDirty:y.keepDefaultValues?!rt(p,i):!1,isSubmitted:y.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:y.keepDirty?r.dirtyFields:y.keepDefaultValues&&p?Object.entries(p).reduce((C,[_,K])=>Object.assign(Object.assign({},C),{[_]:K!==T(i,_)}),{}):{},touchedFields:y.keepTouched?r.touchedFields:{},errors:y.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:(p,y={})=>{T(n,p)&&(ne(y.defaultValue)?D(p,T(i,p)):(D(p,y.defaultValue),Z(i,p,y.defaultValue)),y.keepTouched||le(r.touchedFields,p),y.keepDirty||(le(r.dirtyFields,p),r.isDirty=y.defaultValue?A(p,T(i,p)):A()),y.keepError||(le(r.errors,p),l.isValid&&m()),d.state.next(Object.assign({},r)))},clearErrors:U,unregister:re,setError:X,setFocus:(p,y={})=>{const x=T(n,p)._f,R=x.refs?x.refs[0]:x.ref;y.shouldSelect?R.select():R.focus()},getFieldState:ee}}function ya(e={}){const t=he.default.useRef(),[r,n]=he.default.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}});t.current?t.current.control._options=e:t.current=Object.assign(Object.assign({},ma(e)),{formState:r});const i=t.current.control,a=he.default.useCallback(o=>{oa(o,i._proxyFormState,!0)&&(i._formState=Object.assign(Object.assign({},i._formState),o),n(Object.assign({},i._formState)))},[i]);return sa({subject:i._subjects.state,callback:a}),he.default.useEffect(()=>{i._stateFlags.mount||(i._proxyFormState.isValid&&i._updateValid(),i._stateFlags.mount=!0),i._stateFlags.watch&&(i._stateFlags.watch=!1,i._subjects.state.next({})),i._removeUnmounted()}),t.current.formState=aa(r,i._proxyFormState),t.current}var ii=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(ii||{}),Ge=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(Ge||{}),Oe=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(Oe||{});const Lr=(e,t,r)=>{const n=t[e];let i=0,a=0;if(n)for(let[o,s]of Object.entries(n))parseInt(s)>0&&(i+=1,a+=Number(s));else r&&r.forEach(o=>{if(t[o.selCtx])for(let[s,u]of Object.entries(t[o.selCtx]))parseInt(u)>0&&(i+=1,a+=Number(u))});return[i,a]};function Ie(e){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(e)}function Le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var At=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ba(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function me(e,t,r){return t&&Qr(e.prototype,t),r&&Qr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zr(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 en(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zr(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var mr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},ai,Oa=he.default.createContext();function wa(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mr=en(en({},mr),e)}function Sa(){return mr}var xa=function(){function e(){ve(this,e),this.usedNamespaces={}}return me(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 Pa(e){ai=e}function Ca(){return ai}var Ea={type:"3rdParty",init:function(t){wa(t.options.react),Pa(t)}};function ka(){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 tn={};function yr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&tn[t[0]]||(typeof t[0]=="string"&&(tn[t[0]]=new Date),ka.apply(void 0,t))}function rn(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 Na(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return yr("i18n.languages were undefined or empty",t.languages),!0;var 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||o(n,e)&&(!i||o(a,e)))}function oi(e){if(Array.isArray(e))return e}function La(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function nn(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 si(e,t){if(!!e){if(typeof e=="string")return nn(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 nn(e,t)}}function ui(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ra(e,t){return oi(e)||La(e,t)||si(e,t)||ui()}function an(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 ur(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?an(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):an(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function li(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=O.useContext(Oa)||{},i=n.i18n,a=n.defaultNS,o=r||i||Ca();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new xa),!o){yr("You will need to pass in an i18next instance by using initReactI18next");var s=function(j){return Array.isArray(j)?j[j.length-1]:j},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&yr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=ur(ur(ur({},Sa()),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 Na(I,o,c)});function h(){return o.getFixedT(null,c.nsMode==="fallback"?d:d[0],l)}var b=O.useState(h),w=Ra(b,2),m=w[0],N=w[1],E=O.useRef(!0);O.useEffect(function(){var I=c.bindI18n,j=c.bindI18nStore;E.current=!0,!g&&!f&&rn(o,d,function(){E.current&&N(h)});function V(){E.current&&N(h)}return I&&o&&o.on(I,V),j&&o&&o.store.on(j,V),function(){E.current=!1,I&&o&&I.split(" ").forEach(function(B){return o.off(B,V)}),j&&o&&j.split(" ").forEach(function(B){return o.store.off(B,V)})}},[o,d.join()]);var k=O.useRef(!0);O.useEffect(function(){E.current&&!k.current&&N(h),k.current=!1},[o]);var M=[m,o,g];if(M.t=m,M.i18n=o,M.ready=g,g||!g&&!f)return M;throw new Promise(function(I){rn(o,d,function(){I()})})}const Aa=(e,t)=>{const{selCtx:r,attrs:n={}}=e,{qtyMin:i,qtyMax:a}=n,{t:o}=li(),[s,u]=Lr(r,t,e.items),{status:c,information:f}=ja(i,a,u,o);return{chosenQtyCnt:u,qtyMin:i,qtyMax:a,walidationStatus:c,informationText:f}},ja=(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=Oe.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Oe.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=Oe.IGNORE),r>=o&&r<=s&&(a=Oe.OK),{information:i,status:a}},Fa=(e,t)=>{const{selCtx:r,attrs:n={}}=e,{selMin:i,selMax:a}=n,{t:o}=li(),[s,u]=Lr(r,t,e.items),{status:c,information:f}=Ta(i,a,s,o);return{chosenSelCnt:s,selMin:i,selMax:a,walidationStatus:c,informationText:f}},Ta=(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=Oe.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Oe.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Oe.IGNORE),o===1&&o===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Oe.OK),{information:i,status:a}},Da=(e,t,r)=>{if(e==="selected"||e==="filter")return[];if(r[t]===e)return[r];let n=fi(e,t,r.items);return(n==null?void 0:n.length)||(n=ci(e,t,r.items),n.length===0),n},ci=(e,t,r)=>{let n=_a(r),i=fi(e,t,n);return(i==null?void 0:i.length)?i:(n==null?void 0:n.length)?ci(e,t,n):[]},_a=e=>{let t=[];return Array.isArray(e)&&(t=e.map(r=>{if(Array.isArray(r==null?void 0:r.items))return r.items}).filter(r=>r!==void 0)),t.flat(1)},fi=(e,t,r)=>{let n=[];return Array.isArray(r)&&(n=r.filter(i=>{if(i&&i[t]===e)return!0})),n},Ia=(e,t,r,n)=>{const i=Da(t,r,n),a=Ma(e,i);return a.length?(a.length>1,a[0]):null},Ma=(e,t)=>{let r=[];return Array.isArray(t)&&t.length&&(r=t.map(n=>Ua(e,n))),r},Ua=(e,t)=>{if(t.id===e)return t;const r=Va(e,t.items);return r.length?(r.length>1&&console.error(`More than one ${e} in context ${t.id}`),r[0]):null},Va=(e,t)=>t.filter(n=>{if(n&&n.id===e)return!0}),di=(e,t)=>{let r=0;for(let[n,i]of Object.entries(e))if(i){for(let[a,o]of Object.entries(i))if(o){const s=Ia(a,n,ii.SELECT,t);s&&(s==null?void 0:s.price)&&(r+=parseFloat(s.price)*o)}}return r};var Kt={exports:{}},bt={};/*
1
+ "use strict";var Vi=Object.defineProperty,Ui=Object.defineProperties;var Hi=Object.getOwnPropertyDescriptors;var Fr=Object.getOwnPropertySymbols;var Bi=Object.prototype.hasOwnProperty,Wi=Object.prototype.propertyIsEnumerable;var Ar=(e,r,t)=>r in e?Vi(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ue=(e,r)=>{for(var t in r||(r={}))Bi.call(r,t)&&Ar(e,t,r[t]);if(Fr)for(var t of Fr(r))Wi.call(r,t)&&Ar(e,t,r[t]);return e},Qe=(e,r)=>Ui(e,Hi(r));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var y=require("react"),Rr=require("react-spring"),zi=require("react-dom");function qi(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var he=qi(y);var vt=e=>e.type==="checkbox",et=e=>e instanceof Date,fe=e=>e==null;const Hn=e=>typeof e=="object";var ae=e=>!fe(e)&&!Array.isArray(e)&&Hn(e)&&!et(e),Gi=e=>ae(e)&&e.target?vt(e.target)?e.target.checked:e.target.value:e,Ki=e=>e.substring(0,e.search(/.\d/))||e,Qi=(e,r)=>[...e].some(t=>Ki(r)===t),Vt=e=>e.filter(Boolean),ie=e=>e===void 0,j=(e,r,t)=>{if(!r||!ae(e))return t;const i=Vt(r.split(/[,[\].]+?/)).reduce((n,a)=>fe(n)?n:n[a],e);return ie(i)||i===e?ie(e[r])?t:e[r]:i};const Tr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},be={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},je={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};var Ut=(e,r)=>{const t=Object.assign({},e);return delete t[r],t};const Bn=he.default.createContext(null),mt=()=>he.default.useContext(Bn),Ji=e=>he.default.createElement(Bn.Provider,{value:Ut(e,"children")},e.children);var Yi=(e,r,t,i=!0)=>{const n={};for(const a in e)Object.defineProperty(n,a,{get:()=>{const o=a;return r[o]!==be.all&&(r[o]=!i||be.all),t&&(t[o]=!0),e[o]}});return n},ge=e=>ae(e)&&!Object.keys(e).length,Zi=(e,r,t)=>{const i=Ut(e,"name");return ge(i)||Object.keys(i).length>=Object.keys(r).length||Object.keys(i).find(n=>r[n]===(!t||be.all))},er=e=>Array.isArray(e)?e:[e];function Xi(e){const r=he.default.useRef(e);r.current=e,he.default.useEffect(()=>{const t=n=>{n&&n.unsubscribe()},i=!e.disabled&&r.current.subject.subscribe({next:r.current.callback});return()=>t(i)},[e.disabled])}var Pe=e=>typeof e=="string",ea=(e,r,t,i)=>{const n=Array.isArray(e);return Pe(e)?(i&&r.watch.add(e),j(t,e)):n?e.map(a=>(i&&r.watch.add(a),j(t,a))):(i&&(r.watchAll=!0),t)},Ht=e=>typeof e=="function",Wn=e=>{for(const r in e)if(Ht(e[r]))return!0;return!1},ta=(e,r,t,i,n)=>r?Object.assign(Object.assign({},t[e]),{types:Object.assign(Object.assign({},t[e]&&t[e].types?t[e].types:{}),{[i]:n||!0})}):{},yr=e=>/^\w*$/.test(e),zn=e=>Vt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Z(e,r,t){let i=-1;const n=yr(r)?[r]:zn(r),a=n.length,o=a-1;for(;++i<a;){const s=n[i];let u=t;if(i!==o){const c=e[s];u=ae(c)||Array.isArray(c)?c:isNaN(+n[i+1])?{}:[]}e[s]=u,e=e[s]}return e}const dr=(e,r,t)=>{for(const i of t||Object.keys(e)){const n=j(e,i);if(n){const a=n._f,o=Ut(n,"_f");if(a&&r(a.name)){if(a.ref.focus&&ie(a.ref.focus()))break;if(a.refs){a.refs[0].focus();break}}else ae(o)&&dr(o,r)}}};var Mr=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));function Xe(e){let r;const t=Array.isArray(e);if(e instanceof Date)r=new Date(e);else if(e instanceof Set)r=new Set(e);else if(t||ae(e)){r=t?[]:{};for(const i in e){if(Ht(e[i])){r=e;break}r[i]=Xe(e[i])}}else return e;return r}function tr(){let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}}var jt=e=>fe(e)||!Hn(e);function tt(e,r){if(jt(e)||jt(r))return e===r;if(et(e)&&et(r))return e.getTime()===r.getTime();const t=Object.keys(e),i=Object.keys(r);if(t.length!==i.length)return!1;for(const n of t){const a=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const o=r[n];if(et(a)&&et(o)||ae(a)&&ae(o)||Array.isArray(a)&&Array.isArray(o)?!tt(a,o):a!==o)return!1}}return!0}var Dr=e=>({isOnSubmit:!e||e===be.onSubmit,isOnBlur:e===be.onBlur,isOnChange:e===be.onChange,isOnAll:e===be.all,isOnTouch:e===be.onTouched}),gt=e=>typeof e=="boolean",br=e=>e.type==="file",gr=e=>e instanceof HTMLElement,qn=e=>e.type==="select-multiple",Or=e=>e.type==="radio",ra=e=>Or(e)||vt(e),Ir=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined",rr=e=>gr(e)&&e.isConnected;function na(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=ie(e)?i++:e[r[i++]];return e}function le(e,r){const t=yr(r)?[r]:zn(r),i=t.length==1?e:na(e,t),n=t[t.length-1];let a;i&&delete i[n];for(let o=0;o<t.slice(0,-1).length;o++){let s=-1,u;const c=t.slice(0,-(o+1)),f=c.length-1;for(o>0&&(a=e);++s<c.length;){const l=c[s];u=u?u[l]:e[l],f===s&&(ae(u)&&ge(u)||Array.isArray(u)&&!u.filter(d=>ae(d)&&!ge(d)||gt(d)).length)&&(a?delete a[l]:delete e[l]),a=u}}return e}function Ft(e,r={}){const t=Array.isArray(e);if(ae(e)||t)for(const i in e)Array.isArray(e[i])||ae(e[i])&&!Wn(e[i])?(r[i]=Array.isArray(e[i])?[]:{},Ft(e[i],r[i])):fe(e[i])||(r[i]=!0);return r}function Gn(e,r,t){const i=Array.isArray(e);if(ae(e)||i)for(const n in e)Array.isArray(e[n])||ae(e[n])&&!Wn(e[n])?ie(r)||jt(t[n])?t[n]=Array.isArray(e[n])?Ft(e[n],[]):Object.assign({},Ft(e[n])):Gn(e[n],fe(r)?{}:r[n],t[n]):t[n]=!tt(e[n],r[n]);return t}var _r=(e,r)=>Gn(e,r,Ft(r));const $r={value:!1,isValid:!1},Vr={value:!0,isValid:!0};var Kn=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ie(e[0].attributes.value)?ie(e[0].value)||e[0].value===""?Vr:{value:e[0].value,isValid:!0}:Vr:$r}return $r},Qn=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>ie(e)?e:r?e===""?NaN:+e:t&&Pe(e)?new Date(e):i?i(e):e;const Ur={isValid:!1,value:null};var Jn=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,Ur):Ur;function nr(e){const r=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):r.disabled))return br(r)?r.files:Or(r)?Jn(e.refs).value:qn(r)?[...r.selectedOptions].map(({value:t})=>t):vt(r)?Kn(e.refs).value:Qn(ie(r.value)?e.ref.value:r.value,e)}var ia=(e,r,t,i)=>{const n={};for(const a of e){const o=j(r,a);o&&Z(n,a,o._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},At=e=>e instanceof RegExp,it=e=>ie(e)?void 0:At(e)?e.source:ae(e)?At(e.value)?e.value.source:e.value:e,aa=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Hr(e,r,t){const i=j(e,t);if(i||yr(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),o=j(r,a),s=j(e,a);if(o&&!Array.isArray(o)&&t!==a)return{name:t};if(s&&s.type)return{name:a,error:s};n.pop()}return{name:t}}var oa=(e,r,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(r||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,sa=(e,r)=>!Vt(j(e,r)).length&&le(e,r),Et=e=>Pe(e)||he.default.isValidElement(e);function Br(e,r,t="validate"){if(Et(e)||Array.isArray(e)&&e.every(Et)||gt(e)&&!e)return{type:t,message:Et(e)?e:"",ref:r}}var Je=e=>ae(e)&&!At(e)?e:{value:e,message:""},Wr=async(e,r,t,i)=>{const{ref:n,refs:a,required:o,maxLength:s,minLength:u,min:c,max:f,pattern:l,validate:d,name:g,valueAsNumber:p,mount:O,disabled:w}=e._f;if(!O||w)return{};const v=a?a[0]:n,P=E=>{i&&v.reportValidity&&(v.setCustomValidity(gt(E)?"":E||" "),v.reportValidity())},C={},N=Or(n),M=vt(n),R=N||M,T=(p||br(n))&&!n.value||r===""||Array.isArray(r)&&!r.length,$=ta.bind(null,g,t,C),D=(E,F,_,B=je.maxLength,U=je.minLength)=>{const Y=E?F:_;C[g]=Object.assign({type:E?B:U,message:Y,ref:n},$(E?B:U,Y))};if(o&&(!R&&(T||fe(r))||gt(r)&&!r||M&&!Kn(a).isValid||N&&!Jn(a).isValid)){const{value:E,message:F}=Et(o)?{value:!!o,message:o}:Je(o);if(E&&(C[g]=Object.assign({type:je.required,message:F,ref:v},$(je.required,F)),!t))return P(F),C}if(!T&&(!fe(c)||!fe(f))){let E,F;const _=Je(f),B=Je(c);if(isNaN(r)){const U=n.valueAsDate||new Date(r);Pe(_.value)&&(E=U>new Date(_.value)),Pe(B.value)&&(F=U<new Date(B.value))}else{const U=n.valueAsNumber||+r;fe(_.value)||(E=U>_.value),fe(B.value)||(F=U<B.value)}if((E||F)&&(D(!!E,_.message,B.message,je.max,je.min),!t))return P(C[g].message),C}if((s||u)&&!T&&Pe(r)){const E=Je(s),F=Je(u),_=!fe(E.value)&&r.length>E.value,B=!fe(F.value)&&r.length<F.value;if((_||B)&&(D(_,E.message,F.message),!t))return P(C[g].message),C}if(l&&!T&&Pe(r)){const{value:E,message:F}=Je(l);if(At(E)&&!r.match(E)&&(C[g]=Object.assign({type:je.pattern,message:F,ref:n},$(je.pattern,F)),!t))return P(F),C}if(d){if(Ht(d)){const E=await d(r),F=Br(E,v);if(F&&(C[g]=Object.assign(Object.assign({},F),$(je.validate,F.message)),!t))return P(F.message),C}else if(ae(d)){let E={};for(const F in d){if(!ge(E)&&!t)break;const _=Br(await d[F](r),v,F);_&&(E=Object.assign(Object.assign({},_),$(F,_.message)),P(_.message),t&&(C[g]=E))}if(!ge(E)&&(C[g]=Object.assign({ref:v},E),!t))return C}}return P(!0),C};const ua={mode:be.onSubmit,reValidateMode:be.onChange,shouldFocusError:!0};function la(e={}){let r=Object.assign(Object.assign({},ua),e),t={isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}},i={},n=r.defaultValues||{},a=r.shouldUnregister?{}:Xe(n),o={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0,f={};const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={watch:tr(),array:tr(),state:tr()},g=Dr(r.mode),p=Dr(r.reValidateMode),O=r.criteriaMode===be.all,w=(h,m)=>(...S)=>{clearTimeout(c),c=window.setTimeout(()=>h(...S),m)},v=async h=>{let m=!1;return l.isValid&&(m=r.resolver?ge((await T()).errors):await D(i,!0),!h&&m!==t.isValid&&(t.isValid=m,d.state.next({isValid:m}))),m},P=(h,m=[],S,k,L=!0,x=!0)=>{if(k&&S){if(o.action=!0,x&&Array.isArray(j(i,h))){const A=S(j(i,h),k.argA,k.argB);L&&Z(i,h,A)}if(l.errors&&x&&Array.isArray(j(t.errors,h))){const A=S(j(t.errors,h),k.argA,k.argB);L&&Z(t.errors,h,A),sa(t.errors,h)}if(l.touchedFields&&Array.isArray(j(t.touchedFields,h))){const A=S(j(t.touchedFields,h),k.argA,k.argB);L&&Z(t.touchedFields,h,A)}l.dirtyFields&&(t.dirtyFields=_r(n,a)),d.state.next({isDirty:F(h,m),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else Z(a,h,m)},C=(h,m)=>(Z(t.errors,h,m),d.state.next({errors:t.errors})),N=(h,m,S,k)=>{const L=j(i,h);if(L){const x=j(a,h,ie(S)?j(n,h):S);ie(x)||k&&k.defaultChecked||m?Z(a,h,m?x:nr(L._f)):U(h,x),o.mount&&v()}},M=(h,m,S,k,L)=>{let x=!1;const A={name:h},z=j(t.touchedFields,h);if(l.isDirty){const Re=t.isDirty;t.isDirty=A.isDirty=F(),x=Re!==A.isDirty}if(l.dirtyFields&&(!S||k)){const Re=j(t.dirtyFields,h);tt(j(n,h),m)?le(t.dirtyFields,h):Z(t.dirtyFields,h,!0),A.dirtyFields=t.dirtyFields,x=x||Re!==j(t.dirtyFields,h)}return S&&!z&&(Z(t.touchedFields,h,S),A.touchedFields=t.touchedFields,x=x||l.touchedFields&&z!==S),x&&L&&d.state.next(A),x?A:{}},R=async(h,m,S,k,L)=>{const x=j(t.errors,m),A=l.isValid&&t.isValid!==S;if(e.delayError&&k?(u=u||w(C,e.delayError),u(m,k)):(clearTimeout(c),k?Z(t.errors,m,k):le(t.errors,m)),((k?!tt(x,k):x)||!ge(L)||A)&&!h){const z=Object.assign(Object.assign(Object.assign({},L),A?{isValid:S}:{}),{errors:t.errors,name:m});t=Object.assign(Object.assign({},t),z),d.state.next(z)}f[m]--,l.isValidating&&!Object.values(f).some(z=>z)&&(d.state.next({isValidating:!1}),f={})},T=async h=>r.resolver?await r.resolver(Object.assign({},a),r.context,ia(h||s.mount,i,r.criteriaMode,r.shouldUseNativeValidation)):{},$=async h=>{const{errors:m}=await T();if(h)for(const S of h){const k=j(m,S);k?Z(t.errors,S,k):le(t.errors,S)}else t.errors=m;return m},D=async(h,m,S={valid:!0})=>{for(const k in h){const L=h[k];if(L){const x=L._f,A=Ut(L,"_f");if(x){const z=await Wr(L,j(a,x.name),O,r.shouldUseNativeValidation);if(z[x.name]&&(S.valid=!1,m))break;m||(z[x.name]?Z(t.errors,x.name,z[x.name]):le(t.errors,x.name))}A&&await D(A,m,S)}}return S.valid},E=()=>{for(const h of s.unMount){const m=j(i,h);m&&(m._f.refs?m._f.refs.every(S=>!rr(S)):!rr(m._f.ref))&&J(h)}s.unMount=new Set},F=(h,m)=>(h&&m&&Z(a,h,m),!tt(ee(),n)),_=(h,m,S)=>{const k=Object.assign({},o.mount?a:ie(m)?n:Pe(h)?{[h]:m}:m);return ea(h,s,k,S)},B=h=>Vt(j(o.mount?a:n,h,e.shouldUnregister?j(n,h,[]):[])),U=(h,m,S={})=>{const k=j(i,h);let L=m;if(k){const x=k._f;x&&(!x.disabled&&Z(a,h,Qn(m,x)),L=Ir&&gr(x.ref)&&fe(m)?"":m,qn(x.ref)?[...x.ref.options].forEach(A=>A.selected=L.includes(A.value)):x.refs?vt(x.ref)?x.refs.length>1?x.refs.forEach(A=>A.checked=Array.isArray(L)?!!L.find(z=>z===A.value):L===A.value):x.refs[0]&&(x.refs[0].checked=!!L):x.refs.forEach(A=>A.checked=A.value===L):br(x.ref)?x.ref.value="":(x.ref.value=L,x.ref.type||d.watch.next({name:h})))}(S.shouldDirty||S.shouldTouch)&&M(h,L,S.shouldTouch,S.shouldDirty,!0),S.shouldValidate&&Q(h)},Y=(h,m,S)=>{for(const k in m){const L=m[k],x=`${h}.${k}`,A=j(i,x);(s.array.has(h)||!jt(L)||A&&!A._f)&&!et(L)?Y(x,L,S):U(x,L,S)}},X=(h,m,S={})=>{const k=j(i,h),L=s.array.has(h),x=Xe(m);Z(a,h,x),L?(d.array.next({name:h,values:a}),(l.isDirty||l.dirtyFields)&&S.shouldDirty&&(t.dirtyFields=_r(n,a),d.state.next({name:h,dirtyFields:t.dirtyFields,isDirty:F(h,x)}))):k&&!k._f&&!fe(x)?Y(h,x,S):U(h,x,S),Mr(h,s)&&d.state.next({}),d.watch.next({name:h})},W=async h=>{const m=h.target;let S=m.name;const k=j(i,S);if(k){let L,x;const A=m.type?nr(k._f):Gi(h),z=h.type===Tr.BLUR||h.type===Tr.FOCUS_OUT,Re=!aa(k._f)&&!r.resolver&&!j(t.errors,S)&&!k._f.deps||oa(z,j(t.touchedFields,S),t.isSubmitted,p,g),wt=Mr(S,s,z);Z(a,S,A),z?k._f.onBlur&&k._f.onBlur(h):k._f.onChange&&k._f.onChange(h);const Xt=M(S,A,z,!1),_i=!ge(Xt)||wt;if(!z&&d.watch.next({name:S,type:h.type}),Re)return _i&&d.state.next(Object.assign({name:S},wt?{}:Xt));if(!z&&wt&&d.state.next({}),f[S]=(f[S],1),d.state.next({isValidating:!0}),r.resolver){const{errors:Lr}=await T([S]),$i=Hr(t.errors,i,S),jr=Hr(Lr,i,$i.name||S);L=jr.error,S=jr.name,x=ge(Lr)}else L=(await Wr(k,j(a,S),O,r.shouldUseNativeValidation))[S],x=await v(!0);k._f.deps&&Q(k._f.deps),R(!1,S,x,L,Xt)}},Q=async(h,m={})=>{let S,k;const L=er(h);if(d.state.next({isValidating:!0}),r.resolver){const x=await $(ie(h)?h:L);S=ge(x),k=h?!L.some(A=>j(x,A)):S}else h?(k=(await Promise.all(L.map(async x=>{const A=j(i,x);return await D(A&&A._f?{[x]:A}:A)}))).every(Boolean),!(!k&&!t.isValid)&&v()):k=S=await D(i);return d.state.next(Object.assign(Object.assign(Object.assign({},!Pe(h)||l.isValid&&S!==t.isValid?{}:{name:h}),r.resolver?{isValid:S}:{}),{errors:t.errors,isValidating:!1})),m.shouldFocus&&!k&&dr(i,x=>j(t.errors,x),h?L:s.mount),k},ee=h=>{const m=Object.assign(Object.assign({},n),o.mount?a:{});return ie(h)?m:Pe(h)?j(m,h):h.map(S=>j(m,S))},te=(h,m)=>({invalid:!!j((m||t).errors,h),isDirty:!!j((m||t).dirtyFields,h),isTouched:!!j((m||t).touchedFields,h),error:j((m||t).errors,h)}),I=h=>{h?er(h).forEach(m=>le(t.errors,m)):t.errors={},d.state.next({errors:t.errors})},H=(h,m,S)=>{const k=(j(i,h,{_f:{}})._f||{}).ref;Z(t.errors,h,Object.assign(Object.assign({},m),{ref:k})),d.state.next({name:h,errors:t.errors,isValid:!1}),S&&S.shouldFocus&&k&&k.focus&&k.focus()},ne=(h,m)=>Ht(h)?d.watch.subscribe({next:S=>h(_(void 0,m),S)}):_(h,m,!0),J=(h,m={})=>{for(const S of h?er(h):s.mount)s.mount.delete(S),s.array.delete(S),j(i,S)&&(m.keepValue||(le(i,S),le(a,S)),!m.keepError&&le(t.errors,S),!m.keepDirty&&le(t.dirtyFields,S),!m.keepTouched&&le(t.touchedFields,S),!r.shouldUnregister&&!m.keepDefaultValue&&le(n,S));d.watch.next({}),d.state.next(Object.assign(Object.assign({},t),m.keepDirty?{isDirty:F()}:{})),!m.keepIsValid&&v()},q=(h,m={})=>{let S=j(i,h);const k=gt(m.disabled);return Z(i,h,{_f:Object.assign(Object.assign(Object.assign({},S&&S._f?S._f:{ref:{name:h}}),{name:h,mount:!0}),m)}),s.mount.add(h),S?k&&Z(a,h,m.disabled?void 0:j(a,h,nr(S._f))):N(h,!0,m.value),Object.assign(Object.assign(Object.assign({},k?{disabled:m.disabled}:{}),r.shouldUseNativeValidation?{required:!!m.required,min:it(m.min),max:it(m.max),minLength:it(m.minLength),maxLength:it(m.maxLength),pattern:it(m.pattern)}:{}),{name:h,onChange:W,onBlur:W,ref:L=>{if(L){q(h,m),S=j(i,h);const x=ie(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,A=ra(x),z=S._f.refs||[];if(A?z.find(Re=>Re===x):x===S._f.ref)return;Z(i,h,{_f:Object.assign(Object.assign({},S._f),A?{refs:z.concat(x).filter(rr),ref:{type:x.type,name:h}}:{ref:x})}),N(h,!1,void 0,x)}else S=j(i,h,{}),S._f&&(S._f.mount=!1),(r.shouldUnregister||m.shouldUnregister)&&!(Qi(s.array,h)&&o.action)&&s.unMount.add(h)}})};return{control:{register:q,unregister:J,getFieldState:te,_executeSchema:T,_getWatch:_,_getDirty:F,_updateValid:v,_removeUnmounted:E,_updateFieldArray:P,_getFieldArray:B,_subjects:d,_proxyFormState:l,get _fields(){return i},get _formValues(){return a},get _stateFlags(){return o},set _stateFlags(h){o=h},get _defaultValues(){return n},get _names(){return s},set _names(h){s=h},get _formState(){return t},set _formState(h){t=h},get _options(){return r},set _options(h){r=Object.assign(Object.assign({},r),h)}},trigger:Q,register:q,handleSubmit:(h,m)=>async S=>{S&&(S.preventDefault&&S.preventDefault(),S.persist&&S.persist());let k=!0,L=Xe(a);d.state.next({isSubmitting:!0});try{if(r.resolver){const{errors:x,values:A}=await T();t.errors=x,L=A}else await D(i);ge(t.errors)&&Object.keys(t.errors).every(x=>j(L,x))?(d.state.next({errors:{},isSubmitting:!0}),await h(L,S)):(m&&await m(Object.assign({},t.errors),S),r.shouldFocusError&&dr(i,x=>j(t.errors,x),s.mount))}catch(x){throw k=!1,x}finally{t.isSubmitted=!0,d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ge(t.errors)&&k,submitCount:t.submitCount+1,errors:t.errors})}},watch:ne,setValue:X,getValues:ee,reset:(h,m={})=>{const S=h||n,k=Xe(S),L=h&&!ge(h)?k:n;if(m.keepDefaultValues||(n=S),!m.keepValues){if(Ir&&ie(h))for(const x of s.mount){const A=j(i,x);if(A&&A._f){const z=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;try{gr(z)&&z.closest("form").reset();break}catch{}}}a=e.shouldUnregister?m.keepDefaultValues?Xe(n):{}:k,i={},d.array.next({values:L}),d.watch.next({values:L})}s={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!m.keepIsValid,o.watch=!!e.shouldUnregister,d.state.next({submitCount:m.keepSubmitCount?t.submitCount:0,isDirty:m.keepDirty?t.isDirty:m.keepDefaultValues?!tt(h,n):!1,isSubmitted:m.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:m.keepDirty?t.dirtyFields:m.keepDefaultValues&&h?Object.entries(h).reduce((x,[A,z])=>Object.assign(Object.assign({},x),{[A]:z!==j(n,A)}),{}):{},touchedFields:m.keepTouched?t.touchedFields:{},errors:m.keepErrors?t.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:(h,m={})=>{j(i,h)&&(ie(m.defaultValue)?X(h,j(n,h)):(X(h,m.defaultValue),Z(n,h,m.defaultValue)),m.keepTouched||le(t.touchedFields,h),m.keepDirty||(le(t.dirtyFields,h),t.isDirty=m.defaultValue?F(h,j(n,h)):F()),m.keepError||(le(t.errors,h),l.isValid&&v()),d.state.next(Object.assign({},t)))},clearErrors:I,unregister:J,setError:H,setFocus:(h,m={})=>{const S=j(i,h)._f,k=S.refs?S.refs[0]:S.ref;m.shouldSelect?k.select():k.focus()},getFieldState:te}}function ca(e={}){const r=he.default.useRef(),[t,i]=he.default.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}});r.current?r.current.control._options=e:r.current=Object.assign(Object.assign({},la(e)),{formState:t});const n=r.current.control,a=he.default.useCallback(o=>{Zi(o,n._proxyFormState,!0)&&(n._formState=Object.assign(Object.assign({},n._formState),o),i(Object.assign({},n._formState)))},[n]);return Xi({subject:n._subjects.state,callback:a}),he.default.useEffect(()=>{n._stateFlags.mount||(n._proxyFormState.isValid&&n._updateValid(),n._stateFlags.mount=!0),n._stateFlags.watch&&(n._stateFlags.watch=!1,n._subjects.state.next({})),n._removeUnmounted()}),r.current.formState=Yi(t,n._proxyFormState),r.current}function Ie(e){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ie(e)}function Le(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ve(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function zr(e,r){for(var t=0;t<r.length;t++){var i=r[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function me(e,r,t){return r&&zr(e.prototype,r),t&&zr(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qr(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Gr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qr(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var hr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},Yn,fa=he.default.createContext();function da(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hr=Gr(Gr({},hr),e)}function ga(){return hr}var ha=function(){function e(){ve(this,e),this.usedNamespaces={}}return me(e,[{key:"addUsedNamespaces",value:function(t){var i=this;t.forEach(function(n){i.usedNamespaces[n]||(i.usedNamespaces[n]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function pa(e){Yn=e}function va(){return Yn}var ma={type:"3rdParty",init:function(r){da(r.options.react),pa(r)}};function ya(){if(console&&console.warn){for(var e,r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];typeof t[0]=="string"&&(t[0]="react-i18next:: ".concat(t[0])),(e=console).warn.apply(e,t)}}var Kr={};function pr(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];typeof r[0]=="string"&&Kr[r[0]]||(typeof r[0]=="string"&&(Kr[r[0]]=new Date),ya.apply(void 0,r))}function Qr(e,r,t){e.loadNamespaces(r,function(){if(e.isInitialized)t();else{var i=function n(){setTimeout(function(){e.off("initialized",n)},0),t()};e.on("initialized",i)}})}function ba(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!r.languages||!r.languages.length)return pr("i18n.languages were undefined or empty",r.languages),!0;var i=r.languages[0],n=r.options?r.options.fallbackLng:!1,a=r.languages[r.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var o=function(u,c){var f=r.services.backendConnector.state["".concat(u,"|").concat(c)];return f===-1||f===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!o(r.isLanguageChangingTo,e)?!1:!!(r.hasResourceBundle(i,e)||!r.services.backendConnector.backend||o(i,e)&&(!n||o(a,e)))}function Zn(e){if(Array.isArray(e))return e}function Oa(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var i=[],n=!0,a=!1,o,s;try{for(t=t.call(e);!(n=(o=t.next()).done)&&(i.push(o.value),!(r&&i.length===r));n=!0);}catch(u){a=!0,s=u}finally{try{!n&&t.return!=null&&t.return()}finally{if(a)throw s}}return i}}function Jr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function Xn(e,r){if(!!e){if(typeof e=="string")return Jr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Jr(e,r)}}function ei(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sa(e,r){return Zn(e)||Oa(e,r)||Xn(e,r)||ei()}function Yr(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ir(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Yr(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Bt(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.i18n,i=y.useContext(fa)||{},n=i.i18n,a=i.defaultNS,o=t||n||va();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new ha),!o){pr("You will need to pass in an i18next instance by using initReactI18next");var s=function(T){return Array.isArray(T)?T[T.length-1]:T},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&pr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=ir(ir(ir({},ga()),o.options.react),r),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(R){return ba(R,o,c)});function p(){return o.getFixedT(null,c.nsMode==="fallback"?d:d[0],l)}var O=y.useState(p),w=Sa(O,2),v=w[0],P=w[1],C=y.useRef(!0);y.useEffect(function(){var R=c.bindI18n,T=c.bindI18nStore;C.current=!0,!g&&!f&&Qr(o,d,function(){C.current&&P(p)});function $(){C.current&&P(p)}return R&&o&&o.on(R,$),T&&o&&o.store.on(T,$),function(){C.current=!1,R&&o&&R.split(" ").forEach(function(D){return o.off(D,$)}),T&&o&&T.split(" ").forEach(function(D){return o.store.off(D,$)})}},[o,d.join()]);var N=y.useRef(!0);y.useEffect(function(){C.current&&!N.current&&P(p),N.current=!1},[o]);var M=[v,o,g];if(M.t=v,M.i18n=o,M.ready=g,g||!g&&!f)return M;throw new Promise(function(R){Qr(o,d,function(){R()})})}function _e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vr(e,r){return vr=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},vr(e,r)}function Wt(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&vr(e,r)}function yt(e,r){if(r&&(Ie(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _e(e)}function Ee(e){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ee(e)}function wa(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xa(e){return Zn(e)||wa(e)||Xn(e)||ei()}function Zr(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Xr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Zr(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var Ca={type:"logger",log:function(r){this.output("log",r)},warn:function(r){this.output("warn",r)},error:function(r){this.output("error",r)},output:function(r,t){console&&console[r]&&console[r].apply(console,t)}},Pa=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.init(r,t)}return me(e,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||Ca,this.options=i,this.debug=i.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,i,n,a){return a&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[i](t))}},{key:"create",value:function(t){return new e(this.logger,Xr(Xr({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}(),Ne=new Pa,He=function(){function e(){ve(this,e),this.observers={}}return me(e,[{key:"on",value:function(t,i){var n=this;return t.split(" ").forEach(function(a){n.observers[a]=n.observers[a]||[],n.observers[a].push(i)}),this}},{key:"off",value:function(t,i){if(!!this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(function(n){return n!==i})}}},{key:"emit",value:function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];if(this.observers[t]){var o=[].concat(this.observers[t]);o.forEach(function(u){u.apply(void 0,n)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[t].concat(n))})}}}]),e}();function at(){var e,r,t=new Promise(function(i,n){e=i,r=n});return t.resolve=e,t.reject=r,t}function en(e){return e==null?"":""+e}function Na(e,r,t){e.forEach(function(i){r[i]&&(t[i]=r[i])})}function Sr(e,r,t){function i(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function n(){return!e||typeof e=="string"}for(var a=typeof r!="string"?[].concat(r):r.split(".");a.length>1;){if(n())return{};var o=i(a.shift());!e[o]&&t&&(e[o]=new t),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={}}return n()?{}:{obj:e,k:i(a.shift())}}function tn(e,r,t){var i=Sr(e,r,Object),n=i.obj,a=i.k;n[a]=t}function ka(e,r,t,i){var n=Sr(e,r,Object),a=n.obj,o=n.k;a[o]=a[o]||[],i&&(a[o]=a[o].concat(t)),i||a[o].push(t)}function Rt(e,r){var t=Sr(e,r),i=t.obj,n=t.k;if(!!i)return i[n]}function rn(e,r,t){var i=Rt(e,t);return i!==void 0?i:Rt(r,t)}function ti(e,r,t){for(var i in r)i!=="__proto__"&&i!=="constructor"&&(i in e?typeof e[i]=="string"||e[i]instanceof String||typeof r[i]=="string"||r[i]instanceof String?t&&(e[i]=r[i]):ti(e[i],r[i],t):e[i]=r[i]);return e}function Ye(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Ea={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function La(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(r){return Ea[r]}):e}var zt=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ja=[" ",",","?","!",";"];function Fa(e,r,t){r=r||"",t=t||"";var i=ja.filter(function(s){return r.indexOf(s)<0&&t.indexOf(s)<0});if(i.length===0)return!0;var n=new RegExp("(".concat(i.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),a=!n.test(e);if(!a){var o=e.indexOf(t);o>0&&!n.test(e.substring(0,o))&&(a=!0)}return a}function nn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function xt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?nn(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Aa(e){var r=Ra();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Ra(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ri(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[r])return e[r];for(var i=r.split(t),n=e,a=0;a<i.length;++a){if(!n||typeof n[i[a]]=="string"&&a+1<i.length)return;if(n[i[a]]===void 0){for(var o=2,s=i.slice(a,a+o).join(t),u=n[s];u===void 0&&i.length>a+o;)o++,s=i.slice(a,a+o).join(t),u=n[s];if(u===void 0)return;if(r.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var c=i.slice(a+o).join(t);return c?ri(u,c,t):void 0}n=n[i[a]]}return n}}var Ta=function(e){Wt(t,e);var r=Aa(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return ve(this,t),n=r.call(this),zt&&He.call(_e(n)),n.data=i||{},n.options=a,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return me(t,[{key:"addNamespaces",value:function(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}},{key:"removeNamespaces",value:function(n){var a=this.options.ns.indexOf(n);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(n,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,c=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,f=[n,a];o&&typeof o!="string"&&(f=f.concat(o)),o&&typeof o=="string"&&(f=f.concat(u?o.split(u):o)),n.indexOf(".")>-1&&(f=n.split("."));var l=Rt(this.data,f);return l||!c||typeof o!="string"?l:ri(this.data&&this.data[n]&&this.data[n][a],o,u)}},{key:"addResource",value:function(n,a,o,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var f=[n,a];o&&(f=f.concat(c?o.split(c):o)),n.indexOf(".")>-1&&(f=n.split("."),s=a,a=f[1]),this.addNamespaces(a),tn(this.data,f,s),u.silent||this.emit("added",n,a,o,s)}},{key:"addResources",value:function(n,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in o)(typeof o[u]=="string"||Object.prototype.toString.apply(o[u])==="[object Array]")&&this.addResource(n,a,u,o[u],{silent:!0});s.silent||this.emit("added",n,a,o)}},{key:"addResourceBundle",value:function(n,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[n,a];n.indexOf(".")>-1&&(f=n.split("."),s=o,o=a,a=f[1]),this.addNamespaces(a);var l=Rt(this.data,f)||{};s?ti(l,o,u):l=xt(xt({},l),o),tn(this.data,f,l),c.silent||this.emit("added",n,a,o)}},{key:"removeResourceBundle",value:function(n,a){this.hasResourceBundle(n,a)&&delete this.data[n][a],this.removeNamespaces(a),this.emit("removed",n,a)}},{key:"hasResourceBundle",value:function(n,a){return this.getResource(n,a)!==void 0}},{key:"getResourceBundle",value:function(n,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?xt(xt({},{}),this.getResource(n,a)):this.getResource(n,a)}},{key:"getDataByLanguage",value:function(n){return this.data[n]}},{key:"hasLanguageSomeTranslations",value:function(n){var a=this.getDataByLanguage(n),o=a&&Object.keys(a)||[];return!!o.find(function(s){return a[s]&&Object.keys(a[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(He),ni={processors:{},addPostProcessor:function(r){this.processors[r.name]=r},handle:function(r,t,i,n,a){var o=this;return r.forEach(function(s){o.processors[s]&&(t=o.processors[s].process(t,i,n,a))}),t}};function an(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function de(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?an(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):an(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ma(e){var r=Da();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Da(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var on={},sn=function(e){Wt(t,e);var r=Ma(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ve(this,t),n=r.call(this),zt&&He.call(_e(n)),Na(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,_e(n)),n.options=a,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=Ne.create("translator"),n}return me(t,[{key:"changeLanguage",value:function(n){n&&(this.language=n)}},{key:"exists",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;var o=this.resolve(n,a);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(n,a){var o=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ns||this.options.defaultNS||[],c=o&&n.indexOf(o)>-1,f=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!Fa(n,o,s);if(c&&!f){var l=n.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:n,namespaces:u};var d=n.split(o);(o!==s||o===s&&this.options.ns.indexOf(d[0])>-1)&&(u=d.shift()),n=d.join(s)}return typeof u=="string"&&(u=[u]),{key:n,namespaces:u}}},{key:"translate",value:function(n,a,o){var s=this;if(Ie(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);var u=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=this.extractFromKey(n[n.length-1],a),f=c.key,l=c.namespaces,d=l[l.length-1],g=a.lng||this.language,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(p){var O=a.nsSeparator||this.options.nsSeparator;return d+O+f}return f}var w=this.resolve(n,a),v=w&&w.res,P=w&&w.usedKey||f,C=w&&w.exactUsedKey||f,N=Object.prototype.toString.apply(v),M=["[object Number]","[object Function]","[object RegExp]"],R=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,$=typeof v!="string"&&typeof v!="boolean"&&typeof v!="number";if(T&&v&&$&&M.indexOf(N)<0&&!(typeof R=="string"&&N==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(P,v,de(de({},a),{},{ns:l})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(u){var D=N==="[object Array]",E=D?[]:{},F=D?C:P;for(var _ in v)if(Object.prototype.hasOwnProperty.call(v,_)){var B="".concat(F).concat(u).concat(_);E[_]=this.translate(B,de(de({},a),{joinArrays:!1,ns:l})),E[_]===B&&(E[_]=v[_])}v=E}}else if(T&&typeof R=="string"&&N==="[object Array]")v=v.join(R),v&&(v=this.extendTranslation(v,n,a,o));else{var U=!1,Y=!1,X=a.count!==void 0&&typeof a.count!="string",W=t.hasDefaultValue(a),Q=X?this.pluralResolver.getSuffix(g,a.count,a):"",ee=a["defaultValue".concat(Q)]||a.defaultValue;!this.isValidLookup(v)&&W&&(U=!0,v=ee),this.isValidLookup(v)||(Y=!0,v=f);var te=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,I=te&&Y?void 0:v,H=W&&ee!==v&&this.options.updateMissing;if(Y||U||H){if(this.logger.log(H?"updateKey":"missingKey",g,d,f,H?ee:v),u){var ne=this.resolve(f,de(de({},a),{},{keySeparator:!1}));ne&&ne.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var J=[],q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(var Ae=0;Ae<q.length;Ae++)J.push(q[Ae]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(a.lng||this.language):J.push(a.lng||this.language);var Zt=function(We,h,m){var S=W&&m!==v?m:I;s.options.missingKeyHandler?s.options.missingKeyHandler(We,d,h,S,H,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(We,d,h,S,H,a),s.emit("missingKey",We,d,h,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&X?J.forEach(function(St){s.pluralResolver.getSuffixes(St).forEach(function(We){Zt([St],f+We,a["defaultValue".concat(We)]||ee)})}):Zt(J,f,ee))}v=this.extendTranslation(v,n,a,w,o),Y&&v===f&&this.options.appendNamespaceToMissingKey&&(v="".concat(d,":").concat(f)),(Y||U)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?v=this.options.parseMissingKeyHandler(f,U?v:void 0):v=this.options.parseMissingKeyHandler(v))}return v}},{key:"extendTranslation",value:function(n,a,o,s,u){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)n=this.i18nFormat.parse(n,o,s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(de(de({},o),{interpolation:de(de({},this.options.interpolation),o.interpolation)}));var f=typeof n=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),l;if(f){var d=n.match(this.interpolator.nestingRegexp);l=d&&d.length}var g=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(g=de(de({},this.options.interpolation.defaultVariables),g)),n=this.interpolator.interpolate(n,g,o.lng||this.language,o),f){var p=n.match(this.interpolator.nestingRegexp),O=p&&p.length;l<O&&(o.nest=!1)}o.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var P=arguments.length,C=new Array(P),N=0;N<P;N++)C[N]=arguments[N];return u&&u[0]===C[0]&&!o.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(C[0]," in key: ").concat(a[0])),null):c.translate.apply(c,C.concat([a]))},o)),o.interpolation&&this.interpolator.reset()}var w=o.postProcess||this.options.postProcess,v=typeof w=="string"?[w]:w;return n!=null&&v&&v.length&&o.applyPostProcessor!==!1&&(n=ni.handle(v,n,a,this.options&&this.options.postProcessPassResolved?de({i18nResolved:s},o):o,this)),n}},{key:"resolve",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,u,c,f,l;return typeof n=="string"&&(n=[n]),n.forEach(function(d){if(!a.isValidLookup(s)){var g=a.extractFromKey(d,o),p=g.key;u=p;var O=g.namespaces;a.options.fallbackNS&&(O=O.concat(a.options.fallbackNS));var w=o.count!==void 0&&typeof o.count!="string",v=w&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),P=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",C=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);O.forEach(function(N){a.isValidLookup(s)||(l=N,!on["".concat(C[0],"-").concat(N)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(on["".concat(C[0],"-").concat(N)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(C.join(", "),`" won't get resolved as namespace "`).concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(function(M){if(!a.isValidLookup(s)){f=M;var R=[p];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(R,p,M,N,o);else{var T;w&&(T=a.pluralResolver.getSuffix(M,o.count,o));var $="_zero";if(w&&(R.push(p+T),v&&R.push(p+$)),P){var D="".concat(p).concat(a.options.contextSeparator).concat(o.context);R.push(D),w&&(R.push(D+T),v&&R.push(D+$))}}for(var E;E=R.pop();)a.isValidLookup(s)||(c=E,s=a.getResource(M,N,E,o))}}))})}}),{res:s,usedKey:u,exactUsedKey:c,usedLng:f,usedNS:l}}},{key:"isValidLookup",value:function(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}},{key:"getResource",value:function(n,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,a,o,s):this.resourceStore.getResource(n,a,o,s)}}],[{key:"hasDefaultValue",value:function(n){var a="defaultValue";for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&a===o.substring(0,a.length)&&n[o]!==void 0)return!0;return!1}}]),t}(He);function ar(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ia=function(){function e(r){ve(this,e),this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ne.create("languageUtils")}return me(e,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var i=t.split("-");return this.formatLanguageCode(i[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(a){return a.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=ar(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=ar(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=ar(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var i=this;if(!t)return null;var n;return t.forEach(function(a){if(!n){var o=i.formatLanguageCode(a);(!i.options.supportedLngs||i.isSupportedCode(o))&&(n=o)}}),!n&&this.options.supportedLngs&&t.forEach(function(a){if(!n){var o=i.getLanguagePartFromCode(a);if(i.isSupportedCode(o))return n=o;n=i.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}},{key:"getFallbackCodes",value:function(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];var n=t[i];return n||(n=t[this.getScriptPartFromCode(i)]),n||(n=t[this.formatLanguageCode(i)]),n||(n=t[this.getLanguagePartFromCode(i)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,i){var n=this,a=this.getFallbackCodes(i||this.options.fallbackLng||[],t),o=[],s=function(c){!c||(n.isSupportedCode(c)?o.push(c):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):typeof t=="string"&&s(this.formatLanguageCode(t)),a.forEach(function(u){o.indexOf(u)<0&&s(n.formatLanguageCode(u))}),o}}]),e}(),_a=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$a={1:function(r){return Number(r>1)},2:function(r){return Number(r!=1)},3:function(r){return 0},4:function(r){return Number(r%10==1&&r%100!=11?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2)},5:function(r){return Number(r==0?0:r==1?1:r==2?2:r%100>=3&&r%100<=10?3:r%100>=11?4:5)},6:function(r){return Number(r==1?0:r>=2&&r<=4?1:2)},7:function(r){return Number(r==1?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2)},8:function(r){return Number(r==1?0:r==2?1:r!=8&&r!=11?2:3)},9:function(r){return Number(r>=2)},10:function(r){return Number(r==1?0:r==2?1:r<7?2:r<11?3:4)},11:function(r){return Number(r==1||r==11?0:r==2||r==12?1:r>2&&r<20?2:3)},12:function(r){return Number(r%10!=1||r%100==11)},13:function(r){return Number(r!==0)},14:function(r){return Number(r==1?0:r==2?1:r==3?2:3)},15:function(r){return Number(r%10==1&&r%100!=11?0:r%10>=2&&(r%100<10||r%100>=20)?1:2)},16:function(r){return Number(r%10==1&&r%100!=11?0:r!==0?1:2)},17:function(r){return Number(r==1||r%10==1&&r%100!=11?0:1)},18:function(r){return Number(r==0?0:r==1?1:2)},19:function(r){return Number(r==1?0:r==0||r%100>1&&r%100<11?1:r%100>10&&r%100<20?2:3)},20:function(r){return Number(r==1?0:r==0||r%100>0&&r%100<20?1:2)},21:function(r){return Number(r%100==1?1:r%100==2?2:r%100==3||r%100==4?3:0)},22:function(r){return Number(r==1?0:r==2?1:(r<0||r>10)&&r%10==0?2:3)}},Va=["v1","v2","v3"],un={zero:0,one:1,two:2,few:3,many:4,other:5};function Ua(){var e={};return _a.forEach(function(r){r.lngs.forEach(function(t){e[t]={numbers:r.nr,plurals:$a[r.fc]}})}),e}var Ha=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.languageUtils=r,this.options=t,this.logger=Ne.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Ua()}return me(e,[{key:"addRule",value:function(t,i){this.rules[t]=i}},{key:"getRule",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(t,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(function(a){return"".concat(i).concat(a)})}},{key:"getSuffixes",value:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(t,n);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(o,s){return un[o]-un[s]}).map(function(o){return"".concat(i.options.prepend).concat(o)}):a.numbers.map(function(o){return i.getSuffix(t,o,n)}):[]}},{key:"getSuffix",value:function(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(t,n);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(i)):this.getSuffixRetroCompatible(a,i):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,i){var n=this,a=t.noAbs?t.plurals(i):t.plurals(Math.abs(i)),o=t.numbers[a];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!Va.includes(this.options.compatibilityJSON)}}]),e}();function ln(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ye(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ln(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ln(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var Ba=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=Ne.create("interpolator"),this.options=r,this.format=r.interpolation&&r.interpolation.format||function(t){return t},this.init(r)}return me(e,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var i=t.interpolation;this.escape=i.escape!==void 0?i.escape:La,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Ye(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Ye(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?Ye(i.nestingPrefix):i.nestingPrefixEscaped||Ye("$t("),this.nestingSuffix=i.nestingSuffix?Ye(i.nestingSuffix):i.nestingSuffixEscaped||Ye(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var i="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(i,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,i,n,a){var o=this,s,u,c,f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(w){return w.replace(/\$/g,"$$$$")}var d=function(v){if(v.indexOf(o.formatSeparator)<0){var P=rn(i,f,v);return o.alwaysFormat?o.format(P,void 0,n,ye(ye(ye({},a),i),{},{interpolationkey:v})):P}var C=v.split(o.formatSeparator),N=C.shift().trim(),M=C.join(o.formatSeparator).trim();return o.format(rn(i,f,N),M,n,ye(ye(ye({},a),i),{},{interpolationkey:N}))};this.resetRegExp();var g=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,O=[{regex:this.regexpUnescape,safeValue:function(v){return l(v)}},{regex:this.regexp,safeValue:function(v){return o.escapeValue?l(o.escape(v)):l(v)}}];return O.forEach(function(w){for(c=0;s=w.regex.exec(t);){var v=s[1].trim();if(u=d(v),u===void 0)if(typeof g=="function"){var P=g(t,s,a);u=typeof P=="string"?P:""}else if(a&&a.hasOwnProperty(v))u="";else if(p){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(v," for interpolating ").concat(t)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=en(u));var C=w.safeValue(u);if(t=t.replace(s[0],C),p?(w.regex.lastIndex+=C.length,w.regex.lastIndex-=s[0].length):w.regex.lastIndex=0,c++,c>=o.maxReplaces)break}}),t}},{key:"nest",value:function(t,i){var n=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=ye({},a);u.applyPostProcessor=!1,delete u.defaultValue;function c(g,p){var O=this.nestingOptionsSeparator;if(g.indexOf(O)<0)return g;var w=g.split(new RegExp("".concat(O,"[ ]*{"))),v="{".concat(w[1]);g=w[0],v=this.interpolate(v,u),v=v.replace(/'/g,'"');try{u=JSON.parse(v),p&&(u=ye(ye({},p),u))}catch(P){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),P),"".concat(g).concat(O).concat(v)}return delete u.defaultValue,g}for(;o=this.nestingRegexp.exec(t);){var f=[],l=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var d=o[1].split(this.formatSeparator).map(function(g){return g.trim()});o[1]=d.shift(),f=d,l=!0}if(s=i(c.call(this,o[1].trim(),u),u),s&&o[0]===t&&typeof s!="string")return s;typeof s!="string"&&(s=en(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),s=""),l&&(s=f.reduce(function(g,p){return n.format(g,p,a.lng,ye(ye({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}]),e}();function cn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Te(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?cn(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Wa(e){var r=e.toLowerCase().trim(),t={};if(e.indexOf("(")>-1){var i=e.split("(");r=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);if(r==="currency"&&n.indexOf(":")<0)t.currency||(t.currency=n.trim());else if(r==="relativetime"&&n.indexOf(":")<0)t.range||(t.range=n.trim());else{var a=n.split(";");a.forEach(function(o){if(!!o){var s=o.split(":"),u=xa(s),c=u[0],f=u.slice(1),l=f.join(":");l.trim()==="false"&&(t[c.trim()]=!1),l.trim()==="true"&&(t[c.trim()]=!0),isNaN(l.trim())||(t[c.trim()]=parseInt(l.trim(),10)),t[c.trim()]||(t[c.trim()]=l.trim())}})}}return{formatName:r,formatOptions:t}}var za=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=Ne.create("formatter"),this.options=r,this.formats={number:function(i,n,a){return new Intl.NumberFormat(n,a).format(i)},currency:function(i,n,a){return new Intl.NumberFormat(n,Te(Te({},a),{},{style:"currency"})).format(i)},datetime:function(i,n,a){return new Intl.DateTimeFormat(n,Te({},a)).format(i)},relativetime:function(i,n,a){return new Intl.RelativeTimeFormat(n,Te({},a)).format(i,a.range||"day")},list:function(i,n,a){return new Intl.ListFormat(n,Te({},a)).format(i)}},this.init(r)}return me(e,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},n=i.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(t,i){this.formats[t.toLowerCase().trim()]=i}},{key:"format",value:function(t,i,n,a){var o=this,s=i.split(this.formatSeparator),u=s.reduce(function(c,f){var l=Wa(f),d=l.formatName,g=l.formatOptions;if(o.formats[d]){var p=c;try{var O=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},w=O.locale||O.lng||a.locale||a.lng||n;p=o.formats[d](c,w,Te(Te(Te({},g),a),O))}catch(v){o.logger.warn(v)}return p}else o.logger.warn("there was no format function for ".concat(d));return c},t);return u}}]),e}();function fn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function dn(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?fn(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function qa(e){var r=Ga();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Ga(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ka(e,r){for(var t=e.indexOf(r);t!==-1;)e.splice(t,1),t=e.indexOf(r)}var Qa=function(e){Wt(t,e);var r=qa(t);function t(i,n,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return ve(this,t),o=r.call(this),zt&&He.call(_e(o)),o.backend=i,o.store=n,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=Ne.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return me(t,[{key:"queueLoad",value:function(n,a,o,s){var u=this,c=[],f=[],l=[],d=[];return n.forEach(function(g){var p=!0;a.forEach(function(O){var w="".concat(g,"|").concat(O);!o.reload&&u.store.hasResourceBundle(g,O)?u.state[w]=2:u.state[w]<0||(u.state[w]===1?f.indexOf(w)<0&&f.push(w):(u.state[w]=1,p=!1,f.indexOf(w)<0&&f.push(w),c.indexOf(w)<0&&c.push(w),d.indexOf(O)<0&&d.push(O)))}),p||l.push(g)}),(c.length||f.length)&&this.queue.push({pending:f,loaded:{},errors:[],callback:s}),{toLoad:c,pending:f,toLoadLanguages:l,toLoadNamespaces:d}}},{key:"loaded",value:function(n,a,o){var s=n.split("|"),u=s[0],c=s[1];a&&this.emit("failedLoading",u,c,a),o&&this.store.addResourceBundle(u,c,o),this.state[n]=a?-1:2;var f={};this.queue.forEach(function(l){ka(l.loaded,[u],c),Ka(l.pending,n),a&&l.errors.push(a),l.pending.length===0&&!l.done&&(Object.keys(l.loaded).forEach(function(d){f[d]||(f[d]=[]),l.loaded[d].length&&l.loaded[d].forEach(function(g){f[d].indexOf(g)<0&&f[d].push(g)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(l){return!l.done})}},{key:"read",value:function(n,a,o){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,f=arguments.length>5?arguments[5]:void 0;return n.length?this.backend[o](n,a,function(l,d){if(l&&d&&u<5){setTimeout(function(){s.read.call(s,n,a,o,u+1,c*2,f)},c);return}f(l,d)}):f(null,{})}},{key:"prepareLoading",value:function(n,a){var o=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof a=="string"&&(a=[a]);var c=this.queueLoad(n,a,s,u);if(!c.toLoad.length)return c.pending.length||u(),null;c.toLoad.forEach(function(f){o.loadOne(f)})}},{key:"load",value:function(n,a,o){this.prepareLoading(n,a,{},o)}},{key:"reload",value:function(n,a,o){this.prepareLoading(n,a,{reload:!0},o)}},{key:"loadOne",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=n.split("|"),u=s[0],c=s[1];this.read(u,c,"read",void 0,void 0,function(f,l){f&&a.logger.warn("".concat(o,"loading namespace ").concat(c," for language ").concat(u," failed"),f),!f&&l&&a.logger.log("".concat(o,"loaded namespace ").concat(c," for language ").concat(u),l),a.loaded(n,f,l)})}},{key:"saveMissing",value:function(n,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(n,a,o,s,null,dn(dn({},c),{},{isUpdate:u})),!(!n||!n[0])&&this.store.addResource(n[0],a,o,s))}}]),t}(He);function Ja(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(r){var t={};if(Ie(r[1])==="object"&&(t=r[1]),typeof r[1]=="string"&&(t.defaultValue=r[1]),typeof r[2]=="string"&&(t.tDescription=r[2]),Ie(r[2])==="object"||Ie(r[3])==="object"){var i=r[3]||r[2];Object.keys(i).forEach(function(n){t[n]=i[n]})}return t},interpolation:{escapeValue:!0,format:function(r,t,i,n){return r},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function gn(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function hn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function xe(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?hn(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ya(e){var r=Za();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Za(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ct(){}function Xa(e){var r=Object.getOwnPropertyNames(Object.getPrototypeOf(e));r.forEach(function(t){typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}var Tt=function(e){Wt(t,e);var r=Ya(t);function t(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(ve(this,t),i=r.call(this),zt&&He.call(_e(i)),i.options=gn(n),i.services={},i.logger=Ne,i.modules={external:[]},Xa(_e(i)),a&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,a),yt(i,_e(i));setTimeout(function(){i.init(n,a)},0)}return i}return me(t,[{key:"init",value:function(){var n=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(o=a,a={}),!a.defaultNS&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var s=Ja();this.options=xe(xe(xe({},s),this.options),gn(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=xe(xe({},s.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function u(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?Ne.init(u(this.modules.logger),this.options):Ne.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=za);var f=new Ia(this.options);this.store=new Ta(this.options.resources,this.options);var l=this.services;l.logger=Ne,l.resourceStore=this.store,l.languageUtils=f,l.pluralResolver=new Ha(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(l.formatter=u(c),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new Ba(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Qa(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(v){for(var P=arguments.length,C=new Array(P>1?P-1:0),N=1;N<P;N++)C[N-1]=arguments[N];n.emit.apply(n,[v].concat(C))}),this.modules.languageDetector&&(l.languageDetector=u(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=u(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new sn(this.services,this.options),this.translator.on("*",function(v){for(var P=arguments.length,C=new Array(P>1?P-1:0),N=1;N<P;N++)C[N-1]=arguments[N];n.emit.apply(n,[v].concat(C))}),this.modules.external.forEach(function(v){v.init&&v.init(n)})}if(this.format=this.options.interpolation.format,o||(o=Ct),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var g=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];g.forEach(function(v){n[v]=function(){var P;return(P=n.store)[v].apply(P,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(v){n[v]=function(){var P;return(P=n.store)[v].apply(P,arguments),n}});var O=at(),w=function(){var P=function(N,M){n.isInitialized&&!n.initializedStoreOnce&&n.logger.warn("init: i18next is already initialized. You should call init just once!"),n.isInitialized=!0,n.options.isClone||n.logger.log("initialized",n.options),n.emit("initialized",n.options),O.resolve(M),o(N,M)};if(n.languages&&n.options.compatibilityAPI!=="v1"&&!n.isInitialized)return P(null,n.t.bind(n));n.changeLanguage(n.options.lng,P)};return this.options.resources||!this.options.initImmediate?w():setTimeout(w,0),O}},{key:"loadResources",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,s=o,u=typeof n=="string"?n:this.language;if(typeof n=="function"&&(s=n),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var c=[],f=function(g){if(!!g){var p=a.services.languageUtils.toResolveHierarchy(g);p.forEach(function(O){c.indexOf(O)<0&&c.push(O)})}};if(u)f(u);else{var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach(function(d){return f(d)})}this.options.preload&&this.options.preload.forEach(function(d){return f(d)}),this.services.backendConnector.load(c,this.options.ns,s)}else s(null)}},{key:"reloadResources",value:function(n,a,o){var s=at();return n||(n=this.languages),a||(a=this.options.ns),o||(o=Ct),this.services.backendConnector.reload(n,a,function(u){s.resolve(),o(u)}),s}},{key:"use",value:function(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&ni.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}},{key:"changeLanguage",value:function(n,a){var o=this;this.isLanguageChangingTo=n;var s=at();this.emit("languageChanging",n);var u=function(d){if(o.language=d,o.languages=o.services.languageUtils.toResolveHierarchy(d),o.resolvedLanguage=void 0,!(["cimode","dev"].indexOf(d)>-1))for(var g=0;g<o.languages.length;g++){var p=o.languages[g];if(!(["cimode","dev"].indexOf(p)>-1)&&o.store.hasLanguageSomeTranslations(p)){o.resolvedLanguage=p;break}}},c=function(d,g){g?(u(g),o.translator.changeLanguage(g),o.isLanguageChangingTo=void 0,o.emit("languageChanged",g),o.logger.log("languageChanged",g)):o.isLanguageChangingTo=void 0,s.resolve(function(){return o.t.apply(o,arguments)}),a&&a(d,function(){return o.t.apply(o,arguments)})},f=function(d){!n&&!d&&o.services.languageDetector&&(d=[]);var g=typeof d=="string"?d:o.services.languageUtils.getBestMatchFromCodes(d);g&&(o.language||u(g),o.translator.language||o.translator.changeLanguage(g),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(g)),o.loadResources(g,function(p){c(p,g)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(f):f(n),s}},{key:"getFixedT",value:function(n,a,o){var s=this,u=function c(f,l){var d;if(Ie(l)!=="object"){for(var g=arguments.length,p=new Array(g>2?g-2:0),O=2;O<g;O++)p[O-2]=arguments[O];d=s.options.overloadTranslationOptionHandler([f,l].concat(p))}else d=xe({},l);d.lng=d.lng||c.lng,d.lngs=d.lngs||c.lngs,d.ns=d.ns||c.ns;var w=s.options.keySeparator||".",v=o?"".concat(o).concat(w).concat(f):f;return s.t(v,d)};return typeof n=="string"?u.lng=n:u.lngs=n,u.ns=a,u.keyPrefix=o,u}},{key:"t",value:function(){var n;return this.translator&&(n=this.translator).translate.apply(n,arguments)}},{key:"exists",value:function(){var n;return this.translator&&(n=this.translator).exists.apply(n,arguments)}},{key:"setDefaultNamespace",value:function(n){this.options.defaultNS=n}},{key:"hasLoadedNamespace",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var f=function(g,p){var O=a.services.backendConnector.state["".concat(g,"|").concat(p)];return O===-1||O===2};if(o.precheck){var l=o.precheck(this,f);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,n)||!this.services.backendConnector.backend||f(s,n)&&(!u||f(c,n)))}},{key:"loadNamespaces",value:function(n,a){var o=this,s=at();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach(function(u){o.options.ns.indexOf(u)<0&&o.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),a&&a(u)}),s):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(n,a){var o=at();typeof n=="string"&&(n=[n]);var s=this.options.preload||[],u=n.filter(function(c){return s.indexOf(c)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(c){o.resolve(),a&&a(c)}),o):(a&&a(),Promise.resolve())}},{key:"dir",value:function(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var n=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,s=xe(xe(xe({},this.options),a),{isClone:!0}),u=new t(s),c=["store","services","language"];return c.forEach(function(f){u[f]=n[f]}),u.services=xe({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new sn(u.services,u.options),u.translator.on("*",function(f){for(var l=arguments.length,d=new Array(l>1?l-1:0),g=1;g<l;g++)d[g-1]=arguments[g];u.emit.apply(u,[f].concat(d))}),u.init(s,o),u.translator.options=u.options,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}(He);Le(Tt,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Tt(e,r)});var oe=Tt.createInstance();oe.createInstance=Tt.createInstance;oe.createInstance;oe.init;oe.loadResources;oe.reloadResources;oe.use;oe.changeLanguage;oe.getFixedT;oe.t;oe.exists;oe.setDefaultNamespace;oe.hasLoadedNamespace;oe.loadNamespaces;oe.loadLanguages;var ii=[],eo=ii.forEach,to=ii.slice;function ro(e){return eo.call(to.call(arguments,1),function(r){if(r)for(var t in r)e[t]===void 0&&(e[t]=r[t])}),e}var pn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,no=function(r,t,i){var n=i||{};n.path=n.path||"/";var a=encodeURIComponent(t),o=r+"="+a;if(n.maxAge>0){var s=n.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(n.domain){if(!pn.test(n.domain))throw new TypeError("option domain is invalid");o+="; Domain="+n.domain}if(n.path){if(!pn.test(n.path))throw new TypeError("option path is invalid");o+="; Path="+n.path}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(o+="; HttpOnly"),n.secure&&(o+="; Secure"),n.sameSite){var u=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.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},vn={create:function(r,t,i,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+i*60*1e3)),n&&(a.domain=n),document.cookie=no(r,encodeURIComponent(t),a)},read:function(r){for(var t=r+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var a=i[n];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},remove:function(r){this.create(r,"",-1)}},io={name:"cookie",lookup:function(r){var t;if(r.lookupCookie&&typeof document!="undefined"){var i=vn.read(r.lookupCookie);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupCookie&&typeof document!="undefined"&&vn.create(t.lookupCookie,r,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},ao={name:"querystring",lookup:function(r){var t;if(typeof window!="undefined")for(var i=window.location.search.substring(1),n=i.split("&"),a=0;a<n.length;a++){var o=n[a].indexOf("=");if(o>0){var s=n[a].substring(0,o);s===r.lookupQuerystring&&(t=n[a].substring(o+1))}}return t}},ot=null,mn=function(){if(ot!==null)return ot;try{ot=window!=="undefined"&&window.localStorage!==null;var r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{ot=!1}return ot},oo={name:"localStorage",lookup:function(r){var t;if(r.lookupLocalStorage&&mn()){var i=window.localStorage.getItem(r.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupLocalStorage&&mn()&&window.localStorage.setItem(t.lookupLocalStorage,r)}},st=null,yn=function(){if(st!==null)return st;try{st=window!=="undefined"&&window.sessionStorage!==null;var r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{st=!1}return st},so={name:"sessionStorage",lookup:function(r){var t;if(r.lookupSessionStorage&&yn()){var i=window.sessionStorage.getItem(r.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupSessionStorage&&yn()&&window.sessionStorage.setItem(t.lookupSessionStorage,r)}},uo={name:"navigator",lookup:function(r){var t=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var i=0;i<navigator.languages.length;i++)t.push(navigator.languages[i]);navigator.userLanguage&&t.push(navigator.userLanguage),navigator.language&&t.push(navigator.language)}return t.length>0?t:void 0}},lo={name:"htmlTag",lookup:function(r){var t,i=r.htmlTag||(typeof document!="undefined"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(t=i.getAttribute("lang")),t}},co={name:"path",lookup:function(r){var t;if(typeof window!="undefined"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof r.lookupFromPathIndex=="number"){if(typeof i[r.lookupFromPathIndex]!="string")return;t=i[r.lookupFromPathIndex].replace("/","")}else t=i[0].replace("/","")}return t}},fo={name:"subdomain",lookup:function(r){var t;if(typeof window!="undefined"){var i=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);i instanceof Array&&(typeof r.lookupFromSubdomainIndex=="number"?t=i[r.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):t=i[0].replace("http://","").replace("https://","").replace(".",""))}return t}};function go(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ai=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.type="languageDetector",this.detectors={},this.init(r,t)}return me(e,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=ro(i,this.options||{},go()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(io),this.addDetector(ao),this.addDetector(oo),this.addDetector(so),this.addDetector(uo),this.addDetector(lo),this.addDetector(co),this.addDetector(fo)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var i=this;t||(t=this.options.order);var n=[];return t.forEach(function(a){if(i.detectors[a]){var o=i.detectors[a].lookup(i.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(t,i){var n=this;i||(i=this.options.caches),!!i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach(function(a){n.detectors[a]&&n.detectors[a].cacheUserLanguage(t,n.options)}))}}]),e}();ai.type="languageDetector";const ho={"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"},po={"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"},vo={"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"},mo={"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"};oe.use(ai).use(ma).init({resources:{pl:{translation:ho},en:{translation:po},de:{translation:vo},cs:{translation:mo}}});var oi=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(oi||{}),qe=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(qe||{}),Oe=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(Oe||{});const wr=(e,r,t)=>{const i=r[e];let n=0,a=0;if(i)for(let[o,s]of Object.entries(i))parseInt(s)>0&&(n+=1,a+=Number(s));else t&&t.forEach(o=>{if(r[o.selCtx])for(let[s,u]of Object.entries(r[o.selCtx]))parseInt(u)>0&&(n+=1,a+=Number(u))});return[n,a]},yo=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{qtyMin:n,qtyMax:a}=i,{t:o}=Bt(),[s,u]=wr(t,r,e.items),{status:c,information:f}=bo(n,a,u,o);return{chosenQtyCnt:u,qtyMin:n,qtyMax:a,walidationStatus:c,informationText:f}},bo=(e,r,t,i)=>{let n="",a="";const o=Number(e),s=Number(r);return o>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>t&&(a=Oe.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<t&&(a=Oe.TOO_MUCH)),o>=0||s>=0&&t<o?(n=`${i("OS.ProductConfigurator.Quantity.Message.Max")}${n}`,n+=` ${i("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?n=`${i("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(n="",a=Oe.IGNORE),t>=o&&t<=s&&(a=Oe.OK),{information:n,status:a}},Oo=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{selMin:n,selMax:a}=i,{t:o}=Bt(),[s,u]=wr(t,r,e.items),{status:c,information:f}=So(n,a,s,o);return{chosenSelCnt:s,selMin:n,selMax:a,walidationStatus:c,informationText:f}},So=(e,r,t,i)=>{let n="",a="";const o=parseInt(e||"-1"),s=parseInt(r||"-1");return o>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>t&&(a=Oe.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<t&&(a=Oe.TOO_MUCH)),o>=0||s>=0?(n=`${i("OS.ProductConfigurator.Selected.Message.Choose")}${n}`,n+=` ${i("OS.ProductConfigurator.Selected.Message.Options")}`):(n="",a=Oe.IGNORE),o===1&&s===1&&(n=`${i("OS.ProductConfigurator.Selected.Message.OneOption")}`),t>=o&&t<=s&&(a=Oe.OK),{information:n,status:a}},wo=(e,r,t)=>{if(e==="selected"||e==="filter")return[];if(t[r]===e)return[t];let i=ui(e,r,t.items);return(i==null?void 0:i.length)||(i=si(e,r,t.items),i.length===0),i},si=(e,r,t)=>{const i=xo(t),n=ui(e,r,i);return(n==null?void 0:n.length)?n:(i==null?void 0:i.length)?si(e,r,i):[]},xo=e=>{let r=[];return Array.isArray(e)&&(r=e.map(t=>{if(Array.isArray(t==null?void 0:t.items))return t.items}).filter(t=>t!==void 0)),r.flat(1)},ui=(e,r,t)=>{let i=[];return Array.isArray(t)&&(i=t.filter(n=>{if(n&&n[r]===e)return!0})),i},Co=(e,r,t,i)=>{const n=wo(r,t,i),a=Po(e,n).filter(o=>o!==null&&typeof o!="undefined");return a.length?a[0]:null},Po=(e,r)=>{let t=[];return Array.isArray(r)&&r.length&&(t=r.map(i=>No(e,i))),t},No=(e,r)=>{if(r.id===e)return r;let t=ci(e,r.items);return t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):(t=li(e,r.items),t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):null)},li=(e,r)=>{const t=ko(r),i=ci(e,t);return(i==null?void 0:i.length)?i:(t==null?void 0:t.length)?li(e,t):[]},ko=e=>{let r=[];return Array.isArray(e)&&(r=e.map(t=>{if(Array.isArray(t==null?void 0:t.items))return t.items}).filter(t=>t!==void 0)),r.flat(1)},ci=(e,r)=>Array.isArray(r)?r.filter(i=>{if(i&&i.id===e)return!0}):[],xr=(e,r)=>{let t=0;for(const[i,n]of Object.entries(e))if(n){for(const[a,o]of Object.entries(n))if(o){const s=Co(a,i,oi.SELECT,r);s&&(s==null?void 0:s.price)&&(t+=parseFloat(s.price)*o)}}return t};var qt={exports:{}},bt={};/*
3
3
  object-assign
4
4
  (c) Sindre Sorhus
5
5
  @license MIT
6
- */var on=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable;function Ba(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function qa(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}qa();/** @license React v17.0.2
6
+ */var bn=Object.getOwnPropertySymbols,Eo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable;function jo(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Fo(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var i=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(a){n[a]=a}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Fo();/** @license React v17.0.2
7
7
  * react-jsx-runtime.production.min.js
8
8
  *
9
9
  * Copyright (c) Facebook, Inc. and its affiliates.
10
10
  *
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
- */var Wa=he.default,gi=60103;bt.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var sn=Symbol.for;gi=sn("react.element"),bt.Fragment=sn("react.fragment")}var za=Wa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ga=Object.prototype.hasOwnProperty,Ka={key:!0,ref:!0,__self:!0,__source:!0};function hi(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)Ga.call(t,n)&&!Ka.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:gi,type:e,key:a,ref:o,props:i,_owner:za.current}}bt.jsx=hi;bt.jsxs=hi;Kt.exports=bt;const S=Kt.exports.jsx,W=Kt.exports.jsxs,Ot=Kt.exports.Fragment;function un(e){const{isOkk:t,isErr:r,info:n}=e;return W("p",{className:`${t?"text-green-600":r&&"text-red-600"} ml-1 flex`,children:[t&&Ja,r&&Xa,n]})}const Ja=S("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:S("polyline",{points:"20 6 9 17 4 12"})}),Xa=S("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:S("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 Ya={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Qa={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 dt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dt=function(t){return typeof t}:dt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(e)}function ln(e){return Za(e)||eo(e)||to(e)||ro()}function Za(e){if(Array.isArray(e))return e}function eo(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function to(e,t){if(!!e){if(typeof e=="string")return cn(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 cn(e,t)}}function cn(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 ro(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var no={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=ln(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=ln(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function pi(e){return!isNaN(parseInt(e))&&isFinite(e)}function io(e){return pi(e)&&e<=100&&e>=0}function ao(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function fn(e){return e%2===0}function dn(e){return pi(e)&&!Number.isInteger(e)}function oo(){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 at(e){return Math.abs(e)%1===.5}function so(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),uo(i,t.headers),i.send()})}function uo(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 ft(e){return typeof e=="undefined"}function vi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(dt(n[1])==="object"){var i=vi(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function lo(e){return Boolean(e)&&(dt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function mi(){var e=function(n,i){var a=function(u){return Math.pow(10,oo(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 at(n)&&fn(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return at(n)?fn(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return at(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return at(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return at(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 dn(n)||dn(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 co=mi();function fo(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!ft(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return ft(this.getMatches().find(n))?0:this.getMatches()[co.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 ft(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ft(this.getMatches().find(function(n){return n===","}))}}}function go(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 so(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(lo(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return vi(o)[t(e.propertyPath,{from:i,to:a})]})}}}function ht(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function ho(e){ht(io(e),"You must provide a numeric value between 0 and 100.",RangeError)}function po(e){ht(ao(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function lr(e){ht(Number.isInteger(e),"You must provide an integer.",TypeError)}var Y=mi(),vo=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;lr(n),lr(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,c=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),l=function(h){var b=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},h),Object.assign({},{locale:this.locale},h));return Object.assign(e({amount:b.amount,currency:b.currency,precision:b.precision}),{locale:b.locale})},d=function(h){ht(this.hasSameCurrency(h),"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(h){return l.call(this,{locale:h})},getPrecision:function(){return a},convertPrecision:function(h){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;lr(h);var w=this.getPrecision(),m=h>w,N=m?Y.multiply:Y.divide,E=m?[h,w]:[w,h],k=Math.pow(10,Y.subtract.apply(Y,E));return l.call(this,{amount:Y.round(N(this.getAmount(),k),b),precision:h})},add:function(h){d.call(this,h);var b=e.normalizePrecision([this,h]);return l.call(this,{amount:Y.add(b[0].getAmount(),b[1].getAmount()),precision:b[0].getPrecision()})},subtract:function(h){d.call(this,h);var b=e.normalizePrecision([this,h]);return l.call(this,{amount:Y.subtract(b[0].getAmount(),b[1].getAmount()),precision:b[0].getPrecision()})},multiply:function(h){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:Y.round(Y.multiply(this.getAmount(),h),b)})},divide:function(h){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:Y.round(Y.divide(this.getAmount(),h),b)})},percentage:function(h){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return ho(h),this.multiply(Y.divide(h,100),b)},allocate:function(h){var b=this;po(h);for(var w=h.reduce(function(k,M){return Y.add(k,M)}),m=this.getAmount(),N=h.map(function(k){var M=Math.floor(Y.divide(Y.multiply(b.getAmount(),k),w));return m=Y.subtract(m,M),l.call(b,{amount:M})}),E=0;m>0;)h[E]>0&&(N[E]=N[E].add(l.call(this,{amount:1})),m=Y.subtract(m,1)),E+=1;return N},convert:function(h){var b=this,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=w.endpoint,N=m===void 0?f.endpoint:m,E=w.propertyPath,k=E===void 0?f.propertyPath||"rates.{{to}}":E,M=w.headers,I=M===void 0?f.headers:M,j=w.roundingMode,V=j===void 0?u:j,B=Object.assign({},{endpoint:N,propertyPath:k,headers:I,roundingMode:V});return go(B).getExchangeRate(this.getCurrency(),h).then(function(L){return ht(!ft(L),'No rate was found for the destination currency "'.concat(h,'".'),TypeError),l.call(b,{amount:Y.round(Y.multiply(b.getAmount(),parseFloat(L)),B.roundingMode),currency:h})})},equalsTo:function(h){return this.hasSameAmount(h)&&this.hasSameCurrency(h)},lessThan:function(h){d.call(this,h);var b=e.normalizePrecision([this,h]);return b[0].getAmount()<b[1].getAmount()},lessThanOrEqual:function(h){d.call(this,h);var b=e.normalizePrecision([this,h]);return b[0].getAmount()<=b[1].getAmount()},greaterThan:function(h){d.call(this,h);var b=e.normalizePrecision([this,h]);return b[0].getAmount()>b[1].getAmount()},greaterThanOrEqual:function(h){d.call(this,h);var b=e.normalizePrecision([this,h]);return b[0].getAmount()>=b[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Y.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return Y.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(h){return this.getCurrency()===h.getCurrency()},hasSameAmount:function(h){var b=e.normalizePrecision([this,h]);return b[0].getAmount()===b[1].getAmount()},toFormat:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=fo(h);return this.toRoundedUnit(w.getMinimumFractionDigits(),b).toLocaleString(this.getLocale(),{currencyDisplay:w.getCurrencyDisplay(),useGrouping:w.getUseGrouping(),minimumFractionDigits:w.getMinimumFractionDigits(),style:w.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Y.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(h){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=Math.pow(10,h);return Y.divide(Y.round(Y.multiply(this.toUnit(),w),b),w)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},mo=Object.assign(vo,Ya,Qa,no);const br=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":mo({amount:Math.floor(n),currency:t}).toFormat("0,0.00")},yo=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=br(`${r*n}`);return n<parseFloat(t)&&(i=!0,a=`${br(`${t}`)}`),{displayPriceFrom:i,formattedEndPrice:a}};function Jt(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:a="0.00"}=e,o=parseFloat(a),s=t>o?t:a,u=br(`${s}`);return!t&&i===!1?null:r?W("span",{className:"",children:["\xA0",`+${u}`]}):t<o?W("span",{className:"",children:["\xA0",`od ${u}`]}):S("span",{className:"",children:u})}const bo=(e,t,r)=>e==="1"&&t==="1"&&!r?"radio":r?"counter":"checkbox",Oo=e=>{const t=document.getElementById(e);t?t.scrollIntoView({behavior:"smooth"}):console.warn(`Error: scrollToId: id: ${e} not found in html structure`)},yi=e=>`group--${e}`;function wo(e){let t;const r=new Set,n=(c,f)=>{const l=typeof c=="function"?c(t):c;if(l!==t){const d=t;t=f?l:Object.assign({},t,l),r.forEach(g=>g(t,d))}},i=()=>t,a=(c,f=i,l=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=f(t);function g(){const h=f(t);if(!l(d,h)){const b=d;c(d=h,b)}}return r.add(g),()=>r.delete(g)},u={setState:n,getState:i,subscribe:(c,f,l)=>f||l?a(c,f,l):(r.add(c),()=>r.delete(c)),destroy:()=>r.clear()};return t=e(n,i,u),u}const So=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),gn=So?O.useEffect:O.useLayoutEffect;function xo(e){const t=typeof e=="function"?wo(e):e,r=(n=t.getState,i=Object.is)=>{const[,a]=O.useReducer(w=>w+1,0),o=t.getState(),s=O.useRef(o),u=O.useRef(n),c=O.useRef(i),f=O.useRef(!1),l=O.useRef();l.current===void 0&&(l.current=n(o));let d,g=!1;(s.current!==o||u.current!==n||c.current!==i||f.current)&&(d=n(o),g=!i(l.current,d)),gn(()=>{g&&(l.current=d),s.current=o,u.current=n,c.current=i,f.current=!1});const h=O.useRef(o);gn(()=>{const w=()=>{try{const N=t.getState(),E=u.current(N);c.current(l.current,E)||(s.current=N,l.current=E,a())}catch{f.current=!0,a()}},m=t.subscribe(w);return t.getState()!==h.current&&w(),m},[]);const b=g?d:l.current;return O.useDebugValue(b),b};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[r,t];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},r}const Po=(e,t)=>({filter:{},unseenGroupsByFilter:[],setInitialFilter:r=>{e(()=>({filter:ue({},r),unseenGroupsByFilter:[]}))},setFilter:(r,n)=>{e(({filter:i})=>({filter:Xe(ue({},i),{[r]:ue(ue({},i[r]),n)})}))},validateFilter:(r,n)=>{const i=t().filter;return r&&i[n]?Object.keys(i[n]).filter(o=>Object.keys(r).includes(o)&&r[o].includes(i[n][o])):[]},uncheckFilteredProducts:(r,n,i,a,o)=>{t().initialSelectedState;const s=u=>{r&&Object.keys(r).length>0&&i.length===0&&u.forEach(c=>{const{selCtx:f,id:l,items:d=[]}=c;o(`selected.${f}.${l}`,!1),d.length>0&&s(d)})};s(n)},checkFilteredProducts:(r,n,i,a,o)=>{const s=t().initialSelectedState,u=c=>{r&&Object.keys(r).length>0&&i.length!==0&&c.forEach(f=>{var b;const{selCtx:l,id:d,items:g=[]}=f,h=(b=s[l])==null?void 0:b[d];h&&o(`selected.${l}.${d}`,h.toString()),g.length>0&&u(g)})};u(n)}}),Co=(e,t)=>({initialSelectedState:{},mainProductCount:1,setInitialSelectedState:r=>{e(()=>({initialSelectedState:r,mainProductCount:1}))},increaseCount:()=>{e(({mainProductCount:r})=>({mainProductCount:r+1}))},decreaseCount:()=>{e(({mainProductCount:r})=>({mainProductCount:r-1}))}}),Eo=(e,t)=>({groupsValidation:{},isOnSubmitted:!1,setInitialValidate:()=>{e(()=>({groupsValidation:{},isOnSubmitted:!1}))},setGroupsValidation:(r,n,i,a,o,s,u,c)=>{((i==null?void 0:i.qtyMax)||(i==null?void 0:i.selMax))&&e(({groupsValidation:f})=>({groupsValidation:Xe(ue({},f),{[n]:{parentContext:r,disableAddCounter:a===Number(i==null?void 0:i.qtyMax),disableInput:o===Number(i==null?void 0:i.selMax),parentKind:s,nestedLvl:u,isValid:a>=(Number(i==null?void 0:i.qtyMin)||0)&&o>=(Number(i==null?void 0:i.selMin)||0),isPassedFiltering:c,debug:{qtyCnt:a,selCnt:o,productAttrs:i,productSelCtx:n}}})}))},getParentsCtxValidation:(r,n)=>{const i=t().groupsValidation,a=t().getParentsCtxValidation;let o=!1;const s=i[i[r].parentContext];return Object.keys(i).map(u=>{s?o=s[n]:o=!1,s&&!s[n]&&s.parentKind!==Ge.PRODUCT&&a(u,n)}),o},getCtxValidation:(r,n)=>{const i=t().groupsValidation;return i[r]?i[r][n]:!1},validateSingleProductQty:(r,n)=>r&&n?Number(r)===Number(n):!1,isAddDisabled:(r,n,i)=>{const a=t().groupsValidation;return a&&a[r]&&a[r].parentKind!==Ge.PRODUCT?t().getCtxValidation(r,"disableAddCounter")||t().getParentsCtxValidation(r,"disableAddCounter")||t().validateSingleProductQty(n,i):t().getCtxValidation(r,"disableAddCounter")||t().validateSingleProductQty(n,i)},isInputDisabled:r=>{const n=t().groupsValidation;return n&&n[r]&&n[r].parentKind!==Ge.PRODUCT&&t().getParentsCtxValidation(r,"disableInput")||t().getCtxValidation(r,"disableInput")},setIsOnSubmittedOnTrue:()=>{console.log("isOnSubmitted"),e(()=>({isOnSubmitted:!0}))},getInvalidContextNames:()=>{var i;const r=t().groupsValidation,n=[];for(let[a,o]of Object.entries(r))r[a].isValid===!1&&r[a].isPassedFiltering===!0&&(console.log("inValidGroup debug"),console.log((i=r[a])==null?void 0:i.debug),n.push(a));return n}}),te=xo((e,t)=>ue(ue(ue({},Po(e,t)),Co(e)),Eo(e,t))),ko=(e,t)=>{const r=O.useRef(!1);O.useEffect(()=>{r.current?e():r.current=!0},t)},No=e=>{const{productItem:t,selected:r,parentCtx:n,nestedLvl:i,parentKind:a}=e,{walidationStatus:o,informationText:s}=Fa(t,r),{walidationStatus:u,informationText:c}=Aa(t,r),{watch:f,setValue:l}=yt(),[d,g]=O.useState([]),[h,b]=O.useState(!0),{items:w,selCtx:m,attrs:N={},details:E={},filter:k,fltCtx:M}=t,{name:I,description:j}=E.literals,V=te(U=>U.filter),B=te(U=>U.validateFilter),L=te(U=>U.uncheckFilteredProducts),A=te(U=>U.checkFilteredProducts);ko(()=>{const U=B(k,M);L(k,w,U,f,l),A(k,w,U,f,l),g(U)},[V]);const q=te(U=>U.setGroupsValidation),H=te(U=>U.isOnSubmitted),[v,P]=Lr(t.selCtx,r,w),D=k&&Object.keys(k).length>0&&d.length===0;q(n,m,N,P,v,a,i,!D);const z=o===Oe.OK,G=u===Oe.OK,$=!z&&H&&!!s,ee=!G&&H&&!!c;return D?null:W("div",{className:"pt-1 mb-3 configuration-group",id:yi(m),children:[W("div",{className:"flex text-xl font-semibold",children:[S("p",{className:"",children:I}),I&&W(Ot,{children:[S("div",{className:"ml-auto",children:S(Jt,{price:di(r,t)})}),S("svg",{className:`w-8 h-8 ml-2 text-black ${!h&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>b(U=>!U),children:S("polyline",{points:"18 15 12 9 6 15"})})]})]}),S("p",{children:j}),S("div",{className:"flex",children:W("div",{children:[S(un,{isOkk:z,isErr:$,info:s}),S(un,{isOkk:G,isErr:ee,info:c})]})}),h&&S(Rr,{productItems:w,nestedLvl:i+1,context:t})]})};function bi(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a}=e;return W("div",{className:"flex flex-row items-center justify-center p-1 product-quantity",children:[S("button",{type:"button",className:"quantity-button small ng-star-inserted",onClick:n,disabled:i,children:W("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:[S("path",{stroke:"none",d:"M0 0h24v24H0z"}),S("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),S("span",{"_ngcontent-ggu-c74":"",className:"font-semibold product-quantity-value",children:t}),S("button",{className:"quantity-button small",type:"button",onClick:r,disabled:a,children:W("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:[S("path",{stroke:"none",d:"M0 0h24v24H0z"}),S("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),S("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Oi(e){const{productName:t,price:r,size:n="lg",description:i="",productId:a,selCtx:o,register:s,handleOnChange:u,children:c,isDisabled:f=!1,imgSrc:l=""}=e,d=`${o}---${a}`;return W("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white ${f&&"opacity-50"}`,children:[S("input",Xe(ue({type:"checkbox",className:`checkbox-${n} mr-4`,id:d},s(`selected.${o}.${a}`,{onChange:g=>{u(g)}})),{disabled:f,value:"1"})),l&&S("div",{className:"mr-2",style:{maxHeight:"6rem",width:"4rem"},children:S("img",{alt:"1 kawa\u0142ek kurczaka Kentucky",src:l})}),S("label",{htmlFor:d,className:"flex items-center justify-between w-full",children:W("div",{className:"relative",children:[S("p",{className:"w-full text-lg font-semibold",children:t}),S("p",{className:"text-sm font-thin",children:i})]})}),S("div",{className:"ml-auto",children:c}),S("label",{htmlFor:d,children:S(Jt,{price:parseFloat(r),addPlusBefore:!0})})]})}function wi(e){const{productName:t,price:r,size:n="lg",description:i="",productId:a,selCtx:o,register:s,handleOnChange:u,checked:c,children:f,isDisabled:l,readOnly:d=!1,imgSrc:g=""}=e,h=`${o}---${a}`;return W("div",{className:`flex items-center justify-between p-2 pl-3 mt-1 mb-1 bg-white rounded-lg ${l&&"opacity-50"}`,children:[S("input",Xe(ue({type:"radio",className:`radio-${n} mr-4`,id:h},s(`radio.${o}`,{onChange:b=>{u(b)}})),{value:a,checked:c,disabled:l,readOnly:d})),g&&S("div",{className:"flex w-20 mr-2 max-h-30",children:S("img",{alt:"Product image",className:"h-auto max-w-full",src:g})}),S("label",{htmlFor:h,className:"flex items-center justify-between w-full",children:W("div",{className:"relative",children:[S("p",{className:"w-full text-lg font-semibold",children:t}),S("p",{className:"text-sm font-thin",children:i})]})}),S("div",{className:"ml-auto",children:f}),S("label",{htmlFor:h,children:S(Jt,{price:parseFloat(r),addPlusBefore:!0})})]})}const Lo=e=>{const{productName:t,state:r,items:n,price:i,size:a="lg",description:o="",productId:s,selCtx:u,handleOnChangeCheckBox:c,handleOnChangeRadio:f,productAttrs:l,contextAttrs:d,checked:g}=e,{register:h,setValue:b,watch:w}=yt(),m=w(`selected.${u}.${s}`),N=te(L=>L.isAddDisabled),E=te(L=>L.isInputDisabled),k=()=>{b(`selected.${u}.${s}`,Number(m)+1)},M=()=>{b(`selected.${u}.${s}`,Number(m)-1)},I=Number(m)===0||!m,j=S(bi,{value:m?Number(m):0,add:k,subtract:M,disabledSubtract:I,disabledAdd:N(u,m,l==null?void 0:l.qtyMax)}),{selMin:V="",selMax:B=""}=d;return S("div",{children:V==="1"&&B==="1"?S(wi,{description:o,productName:t,price:i,productId:s,selCtx:u,state:r,items:n,register:h,handleOnChange:f,checked:g,isDisabled:!1,children:j}):S(Oi,{description:o,productName:t,price:i,productId:s,selCtx:u,state:r,items:n,register:h,handleOnChange:c,isDisabled:E(u)&&!m||N(u,m,l==null?void 0:l.qtyMax)&&!m,children:j})})},hn=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},pn=(e,t,r)=>{const n=t(`selected.${e}`);r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},vn=(e,t,r,n,i)=>{const{target:{checked:a}}=n,{selected:o={}}=i;if(a){hn(o,e);const s=u=>{!Array.isArray(u)||u.map(c=>{if(c.state&&"selected"in c.state){const{state:{selected:f}}=c;hn(f,e)}Array.isArray(c.items)&&s(c.items)})};s(r)}else{Object.keys(o).forEach(u=>{pn(u,t,e)});const s=u=>{!Array.isArray(u)||u.map(c=>{const{selCtx:f}=c;t(`selected.${f}`)&&pn(f,t,e),s(c.items)})};s(r)}},Ro=e=>{const{productItem:t,contextAttrs:r,selected:n,nestedLvl:i}=e,{register:a,watch:o,setValue:s,getValues:u}=yt(),{items:c,id:f,selCtx:l,state:d={},attrs:g={},emit:h={},fltCtx:b,details:{media:w=[],literals:m}}=t,{name:N,description:E}=m,k=te(H=>H.isInputDisabled),M=te(H=>H.setFilter),I=n[l]&&n[l][t.id],j=w.find(H=>H.name==="MAIN_IMG")||w[0]||{},V=H=>{vn(s,u,c,H,d)},B=H=>{vn(s,u,c,H,d);const{target:v}=H,P=v.name,D=v.defaultValue,z="selected."+P.replace("radio.","");s(z,{[D]:"1"})},L=o(`selected.${l}.${f}`);O.useEffect(()=>{L&&Object.keys(h).length!==0&&M(b,h)},[L]);const A=Vr.useTransition(Array.isArray(t.items)&&t.items.length>0&&L,{from:{opacity:0,transform:"translateY(-200px)"},enter:{opacity:1,transform:"translateY(0)"}});return t?W(Ot,{children:[(()=>{switch(bo(r==null?void 0:r.selMin,r==null?void 0:r.selMax,r==null?void 0:r.allowMultiple)){case"counter":return S(Lo,{description:E,productName:N,price:t==null?void 0:t.price,productId:f,selCtx:l,state:d,items:c,handleOnChangeCheckBox:V,handleOnChangeRadio:B,checked:!!I,contextAttrs:r,productAttrs:g});case"radio":return S(wi,{description:E,productName:N,price:t==null?void 0:t.price,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:B,checked:!!I,isDisabled:!1,imgSrc:(j==null?void 0:j.url)||""});case"checkbox":return S(Oi,{description:E,productName:N,price:t==null?void 0:t.price,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:V,isDisabled:k(l)&&!L,imgSrc:(j==null?void 0:j.url)||""});default:return null}})(),A((H,v)=>v&&S(Vr.animated.div,{className:`border-l-[2px] border-gray-400 ${i>1&&"ml-4 pl-4"}`,style:H,children:S(Rr,{productItems:c,nestedLvl:i+1,context:t})},i+1))]}):null};function Ao(e){var f;const{productItem:t,nestedLvl:r,context:{attrs:n={},selCtx:i,kind:a}}=e,{kind:o}=t,{getValues:s}=yt(),{selected:u={}}=s();if(((f=t==null?void 0:t.attrs)==null?void 0:f.hidden)===!0)return null;switch(o){case Ge.OPTIONS:case Ge.CONFIG:return S(No,{productItem:t,parentCtx:i,selected:u,nestedLvl:r,parentKind:a});case Ge.PRODUCT:return S(Ro,{productItem:t,selected:u,nestedLvl:r,contextAttrs:n});default:return null}}function Rr(e){const{productItems:t,nestedLvl:r=1,context:n}=e;return S("div",{children:t.map(i=>S(Ao,{productItem:i,nestedLvl:r,context:n},`${n.id}--${i.id}`))})}const jo=e=>{let t=JSON.parse(JSON.stringify(e));for(let[r,n]of Object.entries(t))if(n){const i=t[r];for(let[a,o]of Object.entries(i))o===!1&&delete i[a];Object.keys(i).length===0&&delete t[r]}else delete t[r];return t},Fo=()=>{const{watch:e}=yt(),t=e("selected");return console.log(t),W("div",{className:"flex flex-col items-center py-4",children:[S("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(r=>S("div",{children:Object.values(t[r]).filter(n=>n).length>0&&W(Ot,{children:[W("p",{className:"text-lg font-semibold",children:[r,":"]}),Object.keys(t[r]).map(n=>S(he.default.Fragment,{children:t[r][n]&&W("p",{children:[n,":",t[r][n].toString()]})},n))]})},r))]})};function mn(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1}=e,a=te(u=>u.mainProductCount),o=te(u=>u.increaseCount),s=te(u=>u.decreaseCount);return W("div",{className:"flex items-center justify-around w-full h-16 px-4 ",children:[r&&W("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:[W("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:[S("path",{stroke:"none",d:"M0 0h24v24H0z"}),S("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),S("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),S("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),S("span",{children:"WR\xD3\u0106"})]}),S("div",{className:"px-3",children:S(bi,{value:a,add:o,subtract:s,disabledSubtract:a===1})}),W("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 sm:w-3/5 hover:bg-green-800",style:{opacity:`${i?"0.4":"1"}`},disabled:i,children:[W("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:[S("circle",{cx:"9",cy:"21",r:"1"})," ",S("circle",{cx:"20",cy:"21",r:"1"}),S("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?S("span",{children:`od ${t}`}):S("span",{children:`DODAJ ${t}`})]})]})}const Ct=640,Si=e=>{const{isModal:t=!1}=e,[r,n]=O.useState(window.innerWidth),[i,a]=O.useState(window.innerWidth<=Ct),[o,s]=O.useState(window.innerWidth>Ct&&!t);function u(){n(window.innerWidth)}return O.useEffect(()=>(window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}),[]),O.useEffect(()=>{s(window.innerWidth>Ct&&!t),a(window.innerWidth<=Ct)},[r,e]),{isSm:o,isMobile:i,width:r}};function xi(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=xi(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ot(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=xi(t))&&(n&&(n+=" "),n+=r);return n}function To(e){var M,I;const{product:t,handleAddToBasket:r,isModal:n,handleGoBack:i,showDebugState:a=!1}=e,{state:{selected:o={}}={},price:s,minPrice:u="0"}=t,c=ya({defaultValues:{selected:o}}),{handleSubmit:f,getValues:l}=c,d=te(j=>j.setIsOnSubmittedOnTrue),g=te(j=>j.mainProductCount),h=te(j=>j.getInvalidContextNames),b=te(j=>j.filter),w=parseFloat(s)+di(l("selected"),t),{displayPriceFrom:m,formattedEndPrice:N}=yo(w,u,g),E=j=>{d();const V=h();V.length?(Oo(yi(V[0])),console.log(V)):(console.log(l("selected")),r({price:w/g,quantity:g,selected:jo(l("selected")),filter:b}))},{isSm:k}=Si({isModal:n});return S(ia,Xe(ue({},c),{children:W("form",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},onSubmit:f(E),children:[W("div",{className:ot("form-body flex flex-col items-start w-full stretch relative",k&&"sm:flex-row-reverse sm:pb-0"),style:{height:"calc(100% - 64px)",overflowY:`${n?"scroll":"visible"}`},children:[W("div",{className:ot("w-full px-4",k&&"sm:top-0 sm:sticky sm:w-2/5"),children:[t.details.media&&t.details.media[0].url&&S("img",{className:ot("max-h-[250px] mt-2 mb-6 mx-auto",k&&"max-h-[450px]"),alt:t.details.literals.name,src:(M=t.details)==null?void 0:M.media[0].url}),S("div",{className:ot(!a&&"hidden"),children:S(Fo,{})})]}),W("div",{className:ot("w-full",k&&"sm:w-3/5"),children:[W("div",{className:"items-center w-full p-4",children:[W("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[W("span",{className:"",children:[t.details.literals.name," "]}),S(Jt,{price:w,minPrice:u})]}),S("span",{className:"text-gray-600",children:(I=t.details.literals)==null?void 0:I.description})]}),S("div",{className:`items-center justify-center w-full px-4 bg-gray-100 product-configuration ${(t==null?void 0:t.items)&&"py-2"}`,children:(t==null?void 0:t.items)&&S(Rr,{productItems:t.items,context:t})}),k&&S("div",{className:"mb-2 -mt-5 bg-gray-100",children:S(mn,{finalPrice:N,handleGoBack:i,displayPriceFrom:m})})]})]}),!k&&S("div",{className:"h-16 sm:h-0"}),!k&&S("div",{className:"fixed bottom-0 w-full h-16 bg-white submitRowMobile",children:S(mn,{handleGoBack:i,finalPrice:N,displayPriceFrom:m})})]})}))}function Se(){return Se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Se.apply(this,arguments)}function Je(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Do(e,t){if(!!e){if(typeof e=="string")return yn(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 yn(e,t)}}function yn(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 we(e,t){var r;if(typeof Symbol=="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(r=Do(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return r=e[Symbol.iterator](),r.next.bind(r)}function ke(e,t){if(e in t){for(var r=t[e],n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return typeof r=="function"?r.apply(void 0,i):r}var o=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map(function(s){return'"'+s+'"'}).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(o,ke),o}var Me;(function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"})(Me||(Me={}));var pe;(function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"})(pe||(pe={}));function qe(e){var t=e.props,r=e.slot,n=e.defaultTag,i=e.features,a=e.visible,o=a===void 0?!0:a,s=e.name;if(o)return Et(t,r,n,s);var u=i!=null?i:Me.None;if(u&Me.Static){var c=t.static,f=c===void 0?!1:c,l=Je(t,["static"]);if(f)return Et(l,r,n,s)}if(u&Me.RenderStrategy){var d,g=t.unmount,h=g===void 0?!0:g,b=Je(t,["unmount"]),w=h?pe.Unmount:pe.Hidden;return ke(w,(d={},d[pe.Unmount]=function(){return null},d[pe.Hidden]=function(){return Et(Se({},b,{hidden:!0,style:{display:"none"}}),r,n,s)},d))}return Et(t,r,n,s)}function Et(e,t,r,n){var i;t===void 0&&(t={});var a=cr(e,["unmount","static"]),o=a.as,s=o===void 0?r:o,u=a.children,c=a.refName,f=c===void 0?"ref":c,l=Je(a,["as","children","refName"]),d=e.ref!==void 0?(i={},i[f]=e.ref,i):{},g=typeof u=="function"?u(t):u;if(l.className&&typeof l.className=="function"&&(l.className=l.className(t)),s===O.Fragment&&Object.keys(l).length>0){if(!O.isValidElement(g)||Array.isArray(g)&&g.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(l).map(function(h){return" - "+h}).join(`
16
- `),"","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(function(h){return" - "+h}).join(`
13
+ */var Ao=he.default,fi=60103;bt.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var On=Symbol.for;fi=On("react.element"),bt.Fragment=On("react.fragment")}var Ro=Ao.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,To=Object.prototype.hasOwnProperty,Mo={key:!0,ref:!0,__self:!0,__source:!0};function di(e,r,t){var i,n={},a=null,o=null;t!==void 0&&(a=""+t),r.key!==void 0&&(a=""+r.key),r.ref!==void 0&&(o=r.ref);for(i in r)To.call(r,i)&&!Mo.hasOwnProperty(i)&&(n[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps,r)n[i]===void 0&&(n[i]=r[i]);return{$$typeof:fi,type:e,key:a,ref:o,props:n,_owner:Ro.current}}bt.jsx=di;bt.jsxs=di;qt.exports=bt;const b=qt.exports.jsx,V=qt.exports.jsxs,nt=qt.exports.Fragment;function Sn(e){const{isOkk:r,isErr:t,info:i}=e;return V("p",{className:`${r?"text-green-600":t&&"text-red-600"} ml-1 flex`,children:[r&&Do,t&&Io,i]})}const Do=b("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:b("polyline",{points:"20 6 9 17 4 12"})}),Io=b("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:b("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 _o={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},$o={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 dt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dt=function(r){return typeof r}:dt=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},dt(e)}function wn(e){return Vo(e)||Uo(e)||Ho(e)||Bo()}function Vo(e){if(Array.isArray(e))return e}function Uo(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function Ho(e,r){if(!!e){if(typeof e=="string")return xn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xn(e,r)}}function xn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function Bo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Wo={normalizePrecision:function(r){var t=r.reduce(function(i,n){return Math.max(i.getPrecision(),n.getPrecision())});return r.map(function(i){return i.getPrecision()!==t?i.convertPrecision(t):i})},minimum:function(r){var t=wn(r),i=t[0],n=t.slice(1),a=i;return n.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(r){var t=wn(r),i=t[0],n=t.slice(1),a=i;return n.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function gi(e){return!isNaN(parseInt(e))&&isFinite(e)}function zo(e){return gi(e)&&e<=100&&e>=0}function qo(e){return e.length>0&&e.every(function(r){return r>=0})&&e.some(function(r){return r>0})}function Cn(e){return e%2===0}function Pn(e){return gi(e)&&!Number.isInteger(e)}function Go(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=e.toString();if(r.indexOf("e-")>0)return parseInt(r.split("e-")[1]);var t=r.split(".")[1];return t?t.length:0}function ut(e){return Math.abs(e)%1===.5}function Ko(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,i){var n=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){n.readyState===4&&(n.status>=200&&n.status<400?t(JSON.parse(n.responseText)):i(new Error(n.statusText)))},onerror:function(){i(new Error("Network error"))}});n.open("GET",e,!0),Qo(n,r.headers),n.send()})}function Qo(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in r)e.setRequestHeader(t,r[t]);return e}function ft(e){return typeof e=="undefined"}function hi(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(e).forEach(function(i){if(dt(i[1])==="object"){var n=hi(i[1]);Object.entries(n).forEach(function(a){t[i[0]+r+a[0]]=a[1]})}else t[i[0]]=i[1]}),t}function Jo(e){return Boolean(e)&&(dt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function pi(){var e=function(i,n){var a=function(u){return Math.pow(10,Go(u))},o=Math.max(a(i),a(n));return Math.round(i*o)*Math.round(n*o)/(o*o)},r={HALF_ODD:function(i){var n=Math.round(i);return ut(i)&&Cn(n)?n-1:n},HALF_EVEN:function(i){var n=Math.round(i);return ut(i)?Cn(n)?n:n-1:n},HALF_UP:function(i){return Math.round(i)},HALF_DOWN:function(i){return ut(i)?Math.floor(i):Math.round(i)},HALF_TOWARDS_ZERO:function(i){return ut(i)?Math.sign(i)*Math.floor(Math.abs(i)):Math.round(i)},HALF_AWAY_FROM_ZERO:function(i){return ut(i)?Math.sign(i)*Math.ceil(Math.abs(i)):Math.round(i)},DOWN:function(i){return Math.floor(i)}};return{add:function(i,n){return i+n},subtract:function(i,n){return i-n},multiply:function(i,n){return Pn(i)||Pn(n)?e(i,n):i*n},divide:function(i,n){return i/n},modulo:function(i,n){return i%n},round:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return r[n](i)}}}var Yo=pi();function Zo(e){var r=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return r!==null?r.slice(1).filter(function(i){return!ft(i)}):[]},getMinimumFractionDigits:function(){var i=function(a){return a==="."};return ft(this.getMatches().find(i))?0:this.getMatches()[Yo.add(this.getMatches().findIndex(i),1)].split("").length},getCurrencyDisplay:function(){var i={USD:"code",dollar:"name",$:"symbol"};return i[this.getMatches().find(function(n){return n==="USD"||n==="dollar"||n==="$"})]},getStyle:function(){return ft(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ft(this.getMatches().find(function(i){return i===","}))}}}function Xo(e){var r=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)n=n.replace("{{".concat(o,"}}"),a[o]);return n},t=function(n,a){return Ko(r(e.endpoint,{from:n,to:a}),{headers:e.headers})};return{getExchangeRate:function(n,a){return(Jo(e.endpoint)?e.endpoint:t(n,a)).then(function(o){return hi(o)[r(e.propertyPath,{from:n,to:a})]})}}}function ht(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new t(r)}function es(e){ht(zo(e),"You must provide a numeric value between 0 and 100.",RangeError)}function ts(e){ht(qo(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function or(e){ht(Number.isInteger(e),"You must provide an integer.",TypeError)}var G=pi(),rs=function e(r){var t=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},r),i=t.amount,n=t.currency,a=t.precision;or(i),or(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,c=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),l=function(p){var O=Object.assign({},Object.assign({},{amount:i,currency:n,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:O.amount,currency:O.currency,precision:O.precision}),{locale:O.locale})},d=function(p){ht(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return i},getCurrency:function(){return n},getLocale:function(){return this.locale||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;or(p);var w=this.getPrecision(),v=p>w,P=v?G.multiply:G.divide,C=v?[p,w]:[w,p],N=Math.pow(10,G.subtract.apply(G,C));return l.call(this,{amount:G.round(P(this.getAmount(),N),O),precision:p})},add:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return l.call(this,{amount:G.add(O[0].getAmount(),O[1].getAmount()),precision:O[0].getPrecision()})},subtract:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return l.call(this,{amount:G.subtract(O[0].getAmount(),O[1].getAmount()),precision:O[0].getPrecision()})},multiply:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:G.round(G.multiply(this.getAmount(),p),O)})},divide:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:G.round(G.divide(this.getAmount(),p),O)})},percentage:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return es(p),this.multiply(G.divide(p,100),O)},allocate:function(p){var O=this;ts(p);for(var w=p.reduce(function(N,M){return G.add(N,M)}),v=this.getAmount(),P=p.map(function(N){var M=Math.floor(G.divide(G.multiply(O.getAmount(),N),w));return v=G.subtract(v,M),l.call(O,{amount:M})}),C=0;v>0;)p[C]>0&&(P[C]=P[C].add(l.call(this,{amount:1})),v=G.subtract(v,1)),C+=1;return P},convert:function(p){var O=this,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=w.endpoint,P=v===void 0?f.endpoint:v,C=w.propertyPath,N=C===void 0?f.propertyPath||"rates.{{to}}":C,M=w.headers,R=M===void 0?f.headers:M,T=w.roundingMode,$=T===void 0?u:T,D=Object.assign({},{endpoint:P,propertyPath:N,headers:R,roundingMode:$});return Xo(D).getExchangeRate(this.getCurrency(),p).then(function(E){return ht(!ft(E),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(O,{amount:G.round(G.multiply(O.getAmount(),parseFloat(E)),D.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()<O[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()<=O[1].getAmount()},greaterThan:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()>O[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()>=O[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return G.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return G.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var O=e.normalizePrecision([this,p]);return O[0].getAmount()===O[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=Zo(p);return this.toRoundedUnit(w.getMinimumFractionDigits(),O).toLocaleString(this.getLocale(),{currencyDisplay:w.getCurrencyDisplay(),useGrouping:w.getUseGrouping(),minimumFractionDigits:w.getMinimumFractionDigits(),style:w.getStyle(),currency:this.getCurrency()})},toUnit:function(){return G.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=Math.pow(10,p);return G.divide(G.round(G.multiply(this.toUnit(),w),O),w)},toObject:function(){return{amount:i,currency:n,precision:a}},toJSON:function(){return this.toObject()}}},ns=Object.assign(rs,_o,$o,Wo);const Lt=(e,r="PLN")=>{e=e.toString();const t=e.replace(",","."),i=Number(t)*100;return isNaN(i)?"0.00":ns({amount:Math.floor(i),currency:r}).toFormat("0,0.00")},is=(e,r,t=1)=>{const i=parseFloat(e.toString());let n=!1,a=Lt(`${t*i}`);const o=`${Lt(`${a}`)}`;return i<parseFloat(r)&&(n=!0,a=`${Lt(`${r}`)}`),{displayPriceFrom:n,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Gt(e){const{price:r,addPlusBefore:t=!1,size:i="md",showIfPriceZero:n=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=r>s?r:a,c=Lt(`${u}`);return!r&&n===!1?null:t?V("span",{style:{visibility:`${!r&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${c}`]}):r<s?V("span",{className:"",children:["\xA0",`od ${c}`]}):b("span",{className:"",children:c})}const as=(e,r,t)=>e==="1"&&r==="1"&&!t?"radio":t?"counter":"checkbox",os=e=>{const r=document.getElementById(e);r?r.scrollIntoView({behavior:"smooth"}):console.warn(`Error: scrollToId: id: ${e} not found in html structure`)},vi=e=>`group--${e}`;function ss(e){let r;const t=new Set,i=(c,f)=>{const l=typeof c=="function"?c(r):c;if(l!==r){const d=r;r=f?l:Object.assign({},r,l),t.forEach(g=>g(r,d))}},n=()=>r,a=(c,f=n,l=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=f(r);function g(){const p=f(r);if(!l(d,p)){const O=d;c(d=p,O)}}return t.add(g),()=>t.delete(g)},u={setState:i,getState:n,subscribe:(c,f,l)=>f||l?a(c,f,l):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return r=e(i,n,u),u}const us=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Nn=us?y.useEffect:y.useLayoutEffect;function ls(e){const r=typeof e=="function"?ss(e):e,t=(i=r.getState,n=Object.is)=>{const[,a]=y.useReducer(w=>w+1,0),o=r.getState(),s=y.useRef(o),u=y.useRef(i),c=y.useRef(n),f=y.useRef(!1),l=y.useRef();l.current===void 0&&(l.current=i(o));let d,g=!1;(s.current!==o||u.current!==i||c.current!==n||f.current)&&(d=i(o),g=!n(l.current,d)),Nn(()=>{g&&(l.current=d),s.current=o,u.current=i,c.current=n,f.current=!1});const p=y.useRef(o);Nn(()=>{const w=()=>{try{const P=r.getState(),C=u.current(P);c.current(l.current,C)||(s.current=P,l.current=C,a())}catch{f.current=!0,a()}},v=r.subscribe(w);return r.getState()!==p.current&&w(),v},[]);const O=g?d:l.current;return y.useDebugValue(O),O};return Object.assign(t,r),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,r];return{next(){const n=i.length<=0;return{value:i.shift(),done:n}}}},t}const cs=(e,r)=>({filter:{},unseenGroupsByFilter:[],setInitialFilter:t=>{e(()=>({filter:ue({},t),unseenGroupsByFilter:[]}))},setFilter:(t,i)=>{e(({filter:n})=>({filter:Qe(ue({},n),{[t]:ue(ue({},n[t]),i)})}))},validateFilter:(t,i)=>{const n=r().filter;return t&&n[i]?Object.keys(n[i]).filter(o=>Object.keys(t).includes(o)&&t[o].includes(n[i][o])):[]},uncheckFilteredProducts:(t,i,n,a,o)=>{r().initialSelectedState;const s=u=>{t&&Object.keys(t).length>0&&n.length===0&&u.forEach(c=>{const{selCtx:f,id:l,items:d=[]}=c;o(`selected.${f}.${l}`,!1),d.length>0&&s(d)})};s(i)},checkFilteredProducts:(t,i,n,a,o)=>{const s=r().initialSelectedState,u=c=>{t&&Object.keys(t).length>0&&n.length!==0&&c.forEach(f=>{var O;const{selCtx:l,id:d,items:g=[]}=f,p=(O=s[l])==null?void 0:O[d];p&&o(`selected.${l}.${d}`,p.toString()),g.length>0&&u(g)})};u(i)}}),fs=(e,r)=>({initialSelectedState:{},mainProductCount:1,setInitialSelectedState:t=>{e(()=>({initialSelectedState:t,mainProductCount:1}))},increaseCount:()=>{e(({mainProductCount:t})=>({mainProductCount:t+1}))},decreaseCount:()=>{e(({mainProductCount:t})=>({mainProductCount:t-1}))}}),ds=(e,r)=>({groupsValidation:{},isOnSubmitted:!1,setInitialValidate:()=>{e(()=>({groupsValidation:{},isOnSubmitted:!1}))},setGroupsValidation:(t,i,n,a,o,s,u,c)=>{((n==null?void 0:n.qtyMax)||(n==null?void 0:n.selMax))&&e(({groupsValidation:f})=>({groupsValidation:Qe(ue({},f),{[i]:{parentContext:t,disableAddCounter:a===Number(n==null?void 0:n.qtyMax),disableInput:o===Number(n==null?void 0:n.selMax),parentKind:s,nestedLvl:u,isValid:a>=(Number(n==null?void 0:n.qtyMin)||0)&&o>=(Number(n==null?void 0:n.selMin)||0),isPassedFiltering:c,debug:{qtyCnt:a,selCnt:o,productAttrs:n,productSelCtx:i}}})}))},getParentsCtxValidation:(t,i)=>{const n=r().groupsValidation,a=r().getParentsCtxValidation;let o=!1;const s=n[t].parentContext,u=n[s];return Object.keys(n).map(c=>{u?o=Boolean(u==null?void 0:u[i]):o=!1,u&&!u[i]&&u.parentKind!==qe.PRODUCT&&t!==t&&a(c,i)}),o},getCtxValidation:(t,i)=>{const n=r().groupsValidation;return n[t]?n[t][i]:!1},validateSingleProductQty:(t,i)=>t&&i?Number(t)===Number(i):!1,isAddDisabled:(t,i,n)=>{const a=r().groupsValidation;return a&&a[t]&&a[t].parentKind!==qe.PRODUCT?r().getCtxValidation(t,"disableAddCounter")||r().getParentsCtxValidation(t,"disableAddCounter")||r().validateSingleProductQty(i,n):r().getCtxValidation(t,"disableAddCounter")||r().validateSingleProductQty(i,n)},isInputDisabled:t=>{const i=r().groupsValidation;return i&&i[t]&&i[t].parentKind!==qe.PRODUCT&&r().getParentsCtxValidation(t,"disableInput")||r().getCtxValidation(t,"disableInput")},setIsOnSubmittedOnTrue:()=>{console.log("isOnSubmitted"),e(()=>({isOnSubmitted:!0}))},getInvalidContextNames:()=>{var n;const t=r().groupsValidation,i=[];for(const[a,o]of Object.entries(t))t[a].isValid===!1&&t[a].isPassedFiltering===!0&&(console.log("inValidGroup debug"),console.log((n=t[a])==null?void 0:n.debug),i.push(a));return i}}),re=ls((e,r)=>ue(ue(ue({},cs(e,r)),fs(e)),ds(e,r))),gs=e=>{const{productItem:r,selected:t,parentCtx:i,nestedLvl:n,parentKind:a}=e,{walidationStatus:o,informationText:s}=Oo(r,t),{walidationStatus:u,informationText:c}=yo(r,t),{watch:f,setValue:l}=mt(),[d,g]=y.useState([]),[p,O]=y.useState(!0),{items:w,selCtx:v,attrs:P={},details:C={},filter:N,fltCtx:M}=r,{name:R,description:T}=C.literals,$=re(I=>I.filter),D=re(I=>I.validateFilter),E=re(I=>I.uncheckFilteredProducts),F=re(I=>I.checkFilteredProducts);y.useEffect(()=>{const I=D(N,M);E(N,w,I,f,l),F(N,w,I,f,l),g(I)},[$]);const _=re(I=>I.setGroupsValidation),B=re(I=>I.isOnSubmitted),[U,Y]=wr(r.selCtx,t,w),X=N&&Object.keys(N).length>0&&d.length===0;_(i,v,P,Y,U,a,n,!X);const W=o===Oe.OK,Q=u===Oe.OK,ee=!W&&B&&!!s,te=!Q&&B&&!!c;return X?null:V("div",{className:"pt-1 mb-3 configuration-group",id:vi(v),children:[V("div",{className:"flex text-xl font-semibold",children:[b("p",{className:"",children:R}),R&&R!==" "&&V(nt,{children:[b("div",{className:"ml-auto",children:b(Gt,{price:xr(t,r)})}),b("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!p&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>O(I=>!I),children:b("polyline",{points:"18 15 12 9 6 15"})})]})]}),b("p",{className:`${T&&"mb-2"}`,children:T}),b("div",{className:"flex",children:V("div",{children:[b(Sn,{isOkk:W,isErr:ee,info:s}),b(Sn,{isOkk:Q,isErr:te,info:c})]})}),p&&b(Cr,{productItems:w,nestedLvl:n+1,context:r})]})};function mi(e){const{value:r=0,add:t,subtract:i,disabledSubtract:n,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:[b("button",{type:"button",className:"quantity-button small",onClick:i,disabled:n,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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),b("span",{className:"font-semibold text-gray-700 product-quantity-value",children:r}),b("button",{className:"quantity-button small",type:"button",onClick:t,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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function yi(e){const{productName:r,price:t,size:i="lg",description:n="",productId:a,selCtx:o,register:s,handleOnChange:u,children:c,isDisabled:f=!1,imgSrc:l=""}=e,d=`${o}---${a}`;return V("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${f&&"opacity-50"}`,children:[b("input",Qe(ue({type:"checkbox",className:`simple-checkbox checkbox-${i} mr-4`,id:d},s(`selected.${o}.${a}`,{onChange:g=>{u(g)}})),{disabled:f,value:"1"})),l&&b("div",{className:"flex mr-2 w-20 max-h-24",children:b("img",{alt:"Product image",className:"max-w-full h-auto",src:l})}),b("label",{htmlFor:d,className:"flex justify-between items-center w-full",children:V("div",{className:"relative",children:[b("p",{className:"w-full text-lg font-semibold",children:r}),b("p",{className:"text-sm text-gray-600",children:n})]})}),b("div",{className:"ml-auto",children:c}),b("label",{htmlFor:d,children:b(Gt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}function bi(e){const{productName:r,price:t,size:i="lg",description:n="",productId:a,selCtx:o,register:s,handleOnChange:u,checked:c,children:f,isDisabled:l,readOnly:d=!1,imgSrc:g=""}=e,p=`${o}---${a}`;return V("div",{className:`flex items-center justify-between p-2 pl-3 mt-1 mb-1 bg-white rounded-xl border-2 border-gray-200 ${l&&"opacity-50"}`,children:[b("input",Qe(ue({type:"radio",className:`simple-radio radio-${i} mr-4`,id:p},s(`radio.${o}`,{onChange:O=>{u(O)}})),{value:a,checked:c,disabled:l,readOnly:d})),g&&b("div",{className:"flex mr-2 w-20 max-h-24",children:b("img",{alt:"Product image",className:"max-w-full h-auto",src:g})}),b("label",{htmlFor:p,className:"flex justify-between items-center w-full",children:V("div",{className:"relative",children:[b("p",{className:"w-full text-lg font-semibold",children:r}),b("p",{className:"text-sm text-gray-600",children:n})]})}),b("div",{className:"ml-auto",children:f}),b("label",{htmlFor:p,children:b(Gt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}const hs=e=>{const{productName:r,state:t,items:i,price:n,size:a="lg",description:o="",productId:s,selCtx:u,handleOnChangeCheckBox:c,handleOnChangeRadio:f,productAttrs:l,contextAttrs:d,checked:g}=e,{register:p,setValue:O,watch:w}=mt(),v=w(`selected.${u}.${s}`);let P=0;v&&!isNaN(v)&&(P=Number(v));const C=re(F=>F.isAddDisabled),N=re(F=>F.isInputDisabled),M=()=>{O(`selected.${u}.${s}`,`${P+1}`)},R=()=>{O(`selected.${u}.${s}`,`${P-1}`)},T=Number(v)===0||!v,$=b(mi,{value:P,add:M,subtract:R,disabledSubtract:T,disabledAdd:C(u,v,l==null?void 0:l.qtyMax)||N(u)&&!v}),{selMin:D="",selMax:E=""}=d;return b("div",{children:D==="1"&&E==="1"?b(bi,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:p,handleOnChange:f,checked:g,isDisabled:!1,children:$}):b(yi,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:p,handleOnChange:c,isDisabled:N(u)&&!v||C(u,v,l==null?void 0:l.qtyMax)&&!v,children:$})})},kn=(e,r)=>{Object.keys(e).forEach(t=>{r(`selected.${t}`,e[t])})},En=(e,r,t)=>{const i=r(`selected.${e}`);t(`selected.${e}`,Object.keys(i).reduce((n,a)=>(n[a]=!1,n),{}))},Ln=(e,r,t,i,n)=>{const{target:{checked:a}}=i,{selected:o={}}=n;if(a){kn(o,e);const s=u=>{!Array.isArray(u)||u.map(c=>{if(c.state&&"selected"in c.state){const{state:{selected:f}}=c;kn(f,e)}Array.isArray(c.items)&&s(c.items)})};s(t)}else{Object.keys(o).forEach(u=>{En(u,r,e)});const s=u=>{!Array.isArray(u)||u.map(c=>{const{selCtx:f}=c;r(`selected.${f}`)&&En(f,r,e),s(c.items)})};s(t)}},ps=e=>{const{attrs:r}=e;if(r)return r;{const t=["selMin","selMax","qtyMin","qtyMax","vital","allowMultiple","hidden"],i={};return Object.keys(e).forEach(n=>{t.includes(n)&&(i[n]=e[n])}),i}},vs=e=>{var X;const{productItem:r,contextAttrs:t,selected:i,nestedLvl:n}=e,{register:a,watch:o,setValue:s,getValues:u}=mt(),{items:c,id:f,selCtx:l,state:d={},attrs:g={},emit:p={},fltCtx:O,details:{media:w=[],literals:v},price:P=""}=r,C=ps(r),{name:N,description:M}=v,R=re(W=>W.isInputDisabled),T=re(W=>W.setFilter),$=i[l]&&i[l][r.id]&&Number(i[l][r.id])>0,D=w.find(W=>W.name==="MAIN_IMG")||w[0]||{},E=W=>{Ln(s,u,c,W,d)},F=W=>{Ln(s,u,c,W,d);const{target:Q}=W,ee=Q.name,te=Q.defaultValue,I="selected."+ee.replace("radio.","");s(I,{[te]:"1"})},_=o(`selected.${l}.${f}`);y.useEffect(()=>{_&&Object.keys(p).length!==0&&T(O,p)},[_]);const B=Rr.useTransition(Array.isArray(r.items)&&r.items.length>0&&_,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});if(!r)return null;let U=P;return(!U||parseFloat(U||"1")===0)&&((X=r==null?void 0:r.state)==null?void 0:X.selected)&&(U=`${xr(r.state.selected,r)||"0"}`),V(nt,{children:[(()=>{switch(as(t==null?void 0:t.selMin,t==null?void 0:t.selMax,t==null?void 0:t.allowMultiple)){case"counter":return b(hs,{description:M,productName:N,price:U,productId:f,selCtx:l,state:d,items:c,handleOnChangeCheckBox:E,handleOnChangeRadio:F,checked:!!$,contextAttrs:t,productAttrs:C});case"radio":return b(bi,{description:M,productName:N,price:U,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:F,checked:!!$,isDisabled:!1,imgSrc:(D==null?void 0:D.url)||""});case"checkbox":return b(yi,{description:M,productName:N,price:U,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:E,isDisabled:R(l)&&!_,imgSrc:(D==null?void 0:D.url)||""});default:return null}})(),B((W,Q)=>Q&&b(Rr.animated.div,{className:`border-l-[2px] border-gray-300 ${n>1&&"ml-4 pl-4"}`,style:W,children:b(Cr,{productItems:c,nestedLvl:n+1,context:r})},n+1))]})};function ms(e){var f,l;const{productItem:r,nestedLvl:t,context:{attrs:i={},selCtx:n,kind:a}}=e,{kind:o}=r,{getValues:s}=mt(),{selected:u={}}=s();if(((f=r==null?void 0:r.attrs)==null?void 0:f.hidden)===!0||((l=r==null?void 0:r._)==null?void 0:l.hidden)==="true")return null;switch(o){case qe.OPTIONS:case qe.CONFIG:return b(gs,{productItem:r,parentCtx:n,selected:u,nestedLvl:t,parentKind:a});case qe.PRODUCT:return b(vs,{productItem:r,selected:u,nestedLvl:t,contextAttrs:i});default:return null}}const sr=99,jn=3;function Cr(e){const{productItems:r,nestedLvl:t=1,context:i}=e,n=i.kind!=="3e/product",[a,o]=y.useState(n?jn:sr),{t:s}=Bt(),u=()=>{o(sr)},c=()=>{o(jn)};return b("div",{children:r.map((f,l)=>{if(l<a)return V("div",{children:[b(ms,{productItem:f,nestedLvl:t,context:i},`${i.id}--${f.id}--${l}`),a===sr&&n&&r.length===l+1&&Fn(s("OS.ProductConfigurator.ShowLess"),c,!1)]},`${i.id}--${f.id}--${l}`);if(l===a)return Fn(s("OS.ProductConfigurator.ShowMore"),u,!0)})})}const Fn=(e,r,t)=>b("div",{className:"flex justify-center w-full",children:V("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:r,children:[e,V("svg",{className:`-mr-2 w-7 h-7 ${!t&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",b("polyline",{points:"7 7 12 12 17 7"})," ",b("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),ys=["id","selCtx","fltCtx"],Oi=".",Si="#dot",bs=e=>e.replaceAll(Oi,Si),Os=e=>e.replaceAll(Si,Oi),Ss=(e,r)=>wi(e,r,bs),ws=(e,r)=>wi(e,r,Os),wi=(e,r,t)=>{let i=r;if(ys.includes(e)&&(typeof r=="string"||r instanceof String)&&(i=t(r)),e==="selected"||e==="filter"){console.log({key:e,value:r});const n=JSON.stringify(r),a=t(n);i=JSON.parse(a),console.log({key:e,resValue:i})}return i},xi=(e,r)=>(Object.keys(e).forEach(t=>{const i=e[t];e[t]=r(t,i),typeof i=="object"&&i!==null&&xi(i,r)}),e),xs=e=>{const r=JSON.parse(JSON.stringify(e));for(const[t,i]of Object.entries(r))if(i){const n=r[t];for(const[a,o]of Object.entries(n))o===!1&&delete n[a];Object.keys(n).length===0&&delete r[t]}else delete r[t];return r},Cs=e=>ws("selected",e),Ps=()=>{const{watch:e}=mt(),r=e("selected");return console.log(r),V("div",{className:"flex flex-col items-center py-4",children:[b("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(r).map(t=>b("div",{children:Object.values(r[t]).filter(i=>i).length>0&&V(nt,{children:[V("p",{className:"text-lg font-semibold",children:[t,":"]}),Object.keys(r[t]).map(i=>b(he.default.Fragment,{children:r[t][i]&&V("p",{children:[i,":",r[t][i].toString()]})},i))]})},t))]})};function An(e){const{finalPrice:r,isBackIcon:t=!0,handleGoBack:i,displayPriceFrom:n=!1}=e,{t:a}=Bt(),o=re(c=>c.mainProductCount),s=re(c=>c.increaseCount),u=re(c=>c.decreaseCount);return V("div",{className:"flex justify-around items-center px-4 w-full h-16",children:[t&&V("button",{className:"inline-flex items-center py-1 px-2 font-bold text-red-600 hover:bg-red-200 rounded border-2 border-red-600 border-solid",onClick:i,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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),b("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),b("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),b("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Back")}`})]}),b("div",{className:"px-3",children:b(mi,{value:o,add:s,subtract:u,disabledSubtract:o===1,size:"lg"})}),V("button",{type:"submit",className:"flex justify-center items-center py-1 px-2 w-2/4 font-bold text-white bg-green-600 hover:bg-green-800 rounded border-2 border-green-600 border-solid sm:w-3/5",style:{opacity:`${n?"0.4":"1"}`},disabled:n,children:[V("svg",{className:"mr-2 w-5 h-5 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b("circle",{cx:"9",cy:"21",r:"1"})," ",b("circle",{cx:"20",cy:"21",r:"1"}),b("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),n?b("span",{children:`${a("OS.ProductConfigurator.Selected.Message.From")} ${r}`}):b("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Add")} ${r}`})]})]})}const Pt=640,Ci=e=>{const{isModal:r=!1}=e,[t,i]=y.useState(window.innerWidth),[n,a]=y.useState(window.innerHeight),[o,s]=y.useState(window.innerWidth<=Pt),[u,c]=y.useState(window.innerWidth>Pt&&!r);function f(){i(window.innerWidth),a(window.innerHeight)}return y.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),y.useEffect(()=>{c(window.innerWidth>Pt&&!r),s(window.innerWidth<=Pt)},[t,e,r]),{isSm:u,isMobile:o,width:t,windowHeight:n}};function Pi(e){var r,t,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=Pi(e[r]))&&(i&&(i+=" "),i+=t);else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function lt(){for(var e=0,r,t,i="";e<arguments.length;)(r=arguments[e++])&&(t=Pi(r))&&(i&&(i+=" "),i+=t);return i}function Ns(e){var Q,ee,te,I;const{product:r,handleAddToBasket:t,isModal:i,handleGoBack:n,showDebugState:a=!1}=e,{state:{selected:o={}}={},price:s,minPrice:u="0"}=r,c=ca({defaultValues:{selected:o}}),{handleSubmit:f,getValues:l}=c,d=re(H=>H.setIsOnSubmittedOnTrue),[g,p]=y.useState("auto"),O=re(H=>H.mainProductCount),w=re(H=>H.getInvalidContextNames),v=re(H=>H.filter),P=parseFloat(s)+xr(l("selected"),r),{displayPriceFrom:C,formattedEndPrice:N}=is(P,u,O),M=H=>{d();const ne=w();if(ne.length)os(vi(ne[0])),console.log(ne);else{console.log(l("selected"));const J=Cs(xs(l("selected")));console.log("decodedCleanedSelected: ",J),t({price:P/O,quantity:O,selected:J,filter:v})}},R=y.useRef(),T=y.useRef(),{isSm:$,isMobile:D,windowHeight:E}=Ci({isModal:i}),F=V(nt,{children:[V("div",{className:lt("px-4 w-full",$&&"sm:sticky sm:top-0 sm:w-2/5"),ref:R,children:[r.details.media&&r.details.media[0].url&&b("img",{className:lt("mx-auto mt-2 mb-6 max-h-[250px]",$&&"max-h-[450px]"),alt:r.details.literals.name,src:(Q=r.details)==null?void 0:Q.media[0].url}),b("div",{className:lt(!a&&"hidden"),children:b(Ps,{})})]}),V("div",{className:lt("w-full",$&&"sm:w-3/5"),ref:T,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:[r.details.literals.name," "]}),b(Gt,{price:P,minPrice:u})]}),b("span",{className:"text-gray-600",children:(ee=r.details.literals)==null?void 0:ee.description})]}),V("div",{className:`items-center justify-center w-full px-4 product-configuration ${(r==null?void 0:r.items)&&"py-2 bg-gray-100"}`,children:[(r==null?void 0:r.items)&&b(Cr,{productItems:r.items,context:r}),b("div",{className:"sm:h-[64px]"})]}),$&&b("div",{className:"-mt-5 mb-2 bg-gray-100",children:b(An,{finalPrice:N,isBackIcon:!1,handleGoBack:n,displayPriceFrom:C})})]})]}),_=(te=R==null?void 0:R.current)==null?void 0:te.clientHeight,B=(I=T==null?void 0:T.current)==null?void 0:I.clientHeight,U=_+B;console.log(`modalContentHeight ${U} h1:${_} h1:${B}`),U>window.innerHeight*.7||isNaN(U)?g==="auto"&&p("80vh"):g!=="auto"&&p("auto");const Y=`${E-64-56}px`,X=!$,W={"--mobile-submit-row-top":`${E-64-80}px`};return b(Ji,Qe(ue({},c),{children:V("form",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},onSubmit:f(M),children:[b("div",{className:lt("flex relative flex-col items-start w-full form-body stretch",!X&&"sm:flex-row-reverse sm:pb-0",!D&&"mobile-scrollbar"),style:{height:`${D?Y:g}`,minHeight:"50vh",overflowY:`${i?"scroll":"visible"}`},children:F}),X&&b("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${D?"submit-row-mobile":"submit-row"}`,style:W,children:b(An,{handleGoBack:n,finalPrice:N,isBackIcon:!1})})]})}))}function we(){return we=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},we.apply(this,arguments)}function Ke(e,r){if(e==null)return{};var t={},i=Object.keys(e),n,a;for(a=0;a<i.length;a++)n=i[a],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function ks(e,r){if(!!e){if(typeof e=="string")return Rn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rn(e,r)}}function Rn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function Se(e,r){var t;if(typeof Symbol=="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(t=ks(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return t=e[Symbol.iterator](),t.next.bind(t)}function ke(e,r){if(e in r){for(var t=r[e],i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];return typeof t=="function"?t.apply(void 0,n):t}var o=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(r).map(function(s){return'"'+s+'"'}).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(o,ke),o}var $e;(function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"})($e||($e={}));var pe;(function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"})(pe||(pe={}));function Be(e){var r=e.props,t=e.slot,i=e.defaultTag,n=e.features,a=e.visible,o=a===void 0?!0:a,s=e.name;if(o)return Nt(r,t,i,s);var u=n!=null?n:$e.None;if(u&$e.Static){var c=r.static,f=c===void 0?!1:c,l=Ke(r,["static"]);if(f)return Nt(l,t,i,s)}if(u&$e.RenderStrategy){var d,g=r.unmount,p=g===void 0?!0:g,O=Ke(r,["unmount"]),w=p?pe.Unmount:pe.Hidden;return ke(w,(d={},d[pe.Unmount]=function(){return null},d[pe.Hidden]=function(){return Nt(we({},O,{hidden:!0,style:{display:"none"}}),t,i,s)},d))}return Nt(r,t,i,s)}function Nt(e,r,t,i){var n;r===void 0&&(r={});var a=ur(e,["unmount","static"]),o=a.as,s=o===void 0?t:o,u=a.children,c=a.refName,f=c===void 0?"ref":c,l=Ke(a,["as","children","refName"]),d=e.ref!==void 0?(n={},n[f]=e.ref,n):{},g=typeof u=="function"?u(r):u;if(l.className&&typeof l.className=="function"&&(l.className=l.className(r)),s===y.Fragment&&Object.keys(l).length>0){if(!y.isValidElement(g)||Array.isArray(g)&&g.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <"+i+' /> is rendering a "Fragment".',"However we need to passthrough the following props:",Object.keys(l).map(function(p){return" - "+p}).join(`
16
+ `),"","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(function(p){return" - "+p}).join(`
17
17
  `)].join(`
18
- `));return O.cloneElement(g,Object.assign({},_o(Io(cr(l,["ref"])),g.props,["onClick"]),d))}return O.createElement(s,Object.assign({},cr(l,["ref"]),s!==O.Fragment&&d),g)}function _o(e,t,r){for(var n=Object.assign({},e),i=function(){var u=o.value;if(e[u]!==void 0&&t[u]!==void 0){var c;Object.assign(n,(c={},c[u]=function(f){f.defaultPrevented||e[u](f),f.defaultPrevented||t[u](f)},c))}},a=we(r),o;!(o=a()).done;)i();return n}function Pi(e){var t;return Object.assign(O.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Io(e){var t=Object.assign({},e);for(var r in t)t[r]===void 0&&delete t[r];return t}function cr(e,t){t===void 0&&(t=[]);for(var r=Object.assign({},e),n=we(t),i;!(i=n()).done;){var a=i.value;a in r&&delete r[a]}return r}var Ue=typeof window!="undefined"?O.useLayoutEffect:O.useEffect,fr={serverHandoffComplete:!1};function Xt(){var e=O.useState(fr.serverHandoffComplete),t=e[0],r=e[1];return O.useEffect(function(){t!==!0&&r(!0)},[t]),O.useEffect(function(){fr.serverHandoffComplete===!1&&(fr.serverHandoffComplete=!0)},[]),t}var Ci=O.createContext(!1);function Mo(){return O.useContext(Ci)}function bn(e){return S(Ci.Provider,{value:e.force,children:e.children})}function Uo(){var e=Mo(),t=O.useContext(Ei),r=O.useState(function(){if(!e&&t!==null||typeof window=="undefined")return null;var a=document.getElementById("headlessui-portal-root");if(a)return a;var o=document.createElement("div");return o.setAttribute("id","headlessui-portal-root"),document.body.appendChild(o)}),n=r[0],i=r[1];return O.useEffect(function(){n!==null&&(document.body.contains(n)||document.body.appendChild(n))},[n]),O.useEffect(function(){e||t!==null&&i(t.current)},[t,i,e]),n}var Vo=O.Fragment;function Or(e){var t=e,r=Uo(),n=O.useState(function(){return typeof window=="undefined"?null:document.createElement("div")}),i=n[0],a=Xt();return Ue(function(){if(!!r&&!!i)return r.appendChild(i),function(){if(!!r&&!!i&&(r.removeChild(i),r.childNodes.length<=0)){var o;(o=r.parentElement)==null||o.removeChild(r)}}},[r,i]),a?!r||!i?null:Qi.createPortal(qe({props:t,defaultTag:Vo,name:"Portal"}),i):null}var $o=O.Fragment,Ei=O.createContext(null);function Ho(e){var t=e.target,r=Je(e,["target"]);return S(Ei.Provider,{value:t,children:qe({props:r,defaultTag:$o,name:"Popover.Group"})})}Or.Group=Ho;function ki(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=O.useRef(t);return O.useEffect(function(){n.current=t},[t]),O.useCallback(function(i){for(var a=we(n.current),o;!(o=a()).done;){var s=o.value;s!=null&&(typeof s=="function"?s(i):s.current=i)}},[n])}var Dt;(function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",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"})(Dt||(Dt={}));function Bo(e){for(var t,r,n=e.parentElement,i=null;n&&!(n instanceof HTMLFieldSetElement);)n instanceof HTMLLegendElement&&(i=n),n=n.parentElement;var a=(t=((r=n)==null?void 0:r.getAttribute("disabled"))==="")!=null?t:!1;return a&&qo(i)?!1:a}function qo(e){if(!e)return!1;for(var t=e.previousElementSibling;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var Wo=0;function On(){return++Wo}function wt(){var e=Xt(),t=O.useState(e?On:null),r=t[0],n=t[1];return Ue(function(){r===null&&n(On())},[r]),r!=null?""+r:void 0}function _t(e,t,r){var n=O.useRef(t);n.current=t,O.useEffect(function(){function i(a){n.current.call(window,a)}return window.addEventListener(e,i,r),function(){return window.removeEventListener(e,i,r)}},[e,r])}var zo=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(function(e){return e+":not([tabindex='-1'])"}).join(","),ae;(function(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"})(ae||(ae={}));var _e;(function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"})(_e||(_e={}));var It;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(It||(It={}));function Go(e){return e===void 0&&(e=document.body),e==null?[]:Array.from(e.querySelectorAll(zo))}var wn;(function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"})(wn||(wn={}));function st(e){e==null||e.focus({preventScroll:!0})}function Sn(e,t){var r=Array.isArray(e)?e.slice().sort(function(d,g){var h=d.compareDocumentPosition(g);return h&Node.DOCUMENT_POSITION_FOLLOWING?-1:h&Node.DOCUMENT_POSITION_PRECEDING?1:0}):Go(e),n=document.activeElement,i=function(){if(t&(ae.First|ae.Next))return It.Next;if(t&(ae.Previous|ae.Last))return It.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=function(){if(t&ae.First)return 0;if(t&ae.Previous)return Math.max(0,r.indexOf(n))-1;if(t&ae.Next)return Math.max(0,r.indexOf(n))+1;if(t&ae.Last)return r.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),o=t&ae.NoScroll?{preventScroll:!0}:{},s=0,u=r.length,c=void 0;do{var f;if(s>=u||s+u<=0)return _e.Error;var l=a+s;if(t&ae.WrapAround)l=(l+u)%u;else{if(l<0)return _e.Underflow;if(l>=u)return _e.Overflow}c=r[l],(f=c)==null||f.focus(o),s+=i}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),_e.Success}function Ni(){var e=O.useRef(!1);return O.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e}var Pe;(function(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"})(Pe||(Pe={}));function Ko(e,t,r){t===void 0&&(t=Pe.All);var n=r===void 0?{}:r,i=n.initialFocus,a=n.containers,o=O.useRef(typeof window!="undefined"?document.activeElement:null),s=O.useRef(null),u=Ni(),c=Boolean(t&Pe.RestoreFocus),f=Boolean(t&Pe.InitialFocus);O.useEffect(function(){!c||(o.current=document.activeElement)},[c]),O.useEffect(function(){if(!!c)return function(){st(o.current),o.current=null}},[c]),O.useEffect(function(){if(!!f&&!!e.current){var l=document.activeElement;if(i==null?void 0:i.current){if((i==null?void 0:i.current)===l){s.current=l;return}}else if(e.current.contains(l)){s.current=l;return}(i==null?void 0:i.current)?st(i.current):Sn(e.current,ae.First)===_e.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=document.activeElement}},[e,i,f]),_t("keydown",function(l){!(t&Pe.TabLock)||!e.current||l.key===Dt.Tab&&(l.preventDefault(),Sn(e.current,(l.shiftKey?ae.Previous:ae.Next)|ae.WrapAround)===_e.Success&&(s.current=document.activeElement))}),_t("focus",function(l){if(!!(t&Pe.FocusLock)){var d=new Set(a==null?void 0:a.current);if(d.add(e),!!d.size){var g=s.current;if(!!g&&!!u.current){var h=l.target;h&&h instanceof HTMLElement?Jo(d,h)?(s.current=h,st(h)):(l.preventDefault(),l.stopPropagation(),st(g)):st(s.current)}}}},!0)}function Jo(e,t){for(var r=we(e),n;!(n=r()).done;){var i,a=n.value;if((i=a.current)==null?void 0:i.contains(t))return!0}return!1}var Qe=new Set,De=new Map;function xn(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Pn(e){var t=De.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Xo(e,t){t===void 0&&(t=!0),Ue(function(){if(!!t&&!!e.current){var r=e.current;Qe.add(r);for(var n=we(De.keys()),i;!(i=n()).done;){var a=i.value;a.contains(r)&&(Pn(a),De.delete(a))}return document.querySelectorAll("body > *").forEach(function(o){if(o instanceof HTMLElement){for(var s=we(Qe),u;!(u=s()).done;){var c=u.value;if(o.contains(c))return}Qe.size===1&&(De.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),xn(o))}}),function(){if(Qe.delete(r),Qe.size>0)document.querySelectorAll("body > *").forEach(function(c){if(c instanceof HTMLElement&&!De.has(c)){for(var f=we(Qe),l;!(l=f()).done;){var d=l.value;if(c.contains(d))return}De.set(c,{"aria-hidden":c.getAttribute("aria-hidden"),inert:c.inert}),xn(c)}});else for(var o=we(De.keys()),s;!(s=o()).done;){var u=s.value;Pn(u),De.delete(u)}}}},[t])}var Li=O.createContext(null);function Ri(){var e=O.useContext(Li);if(e===null){var t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ri),t}return e}function Yo(){var e=O.useState([]),t=e[0],r=e[1];return[t.length>0?t.join(" "):void 0,O.useMemo(function(){return function(i){var a=O.useCallback(function(s){return r(function(u){return[].concat(u,[s])}),function(){return r(function(u){var c=u.slice(),f=c.indexOf(s);return f!==-1&&c.splice(f,1),c})}},[]),o=O.useMemo(function(){return{register:a,slot:i.slot,name:i.name,props:i.props}},[a,i.slot,i.name,i.props]);return S(Li.Provider,{value:o,children:i.children})}},[r])]}var Qo="p";function Zo(e){var t=Ri(),r="headlessui-description-"+wt();Ue(function(){return t.register(r)},[r,t.register]);var n=e,i=Se({},t.props,{id:r});return qe({props:Se({},n,i),slot:t.slot||{},defaultTag:Qo,name:t.name||"Description"})}var Ar=O.createContext(null);Ar.displayName="OpenClosedContext";var Ae;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(Ae||(Ae={}));function jr(){return O.useContext(Ar)}function es(e){var t=e.value,r=e.children;return S(Ar.Provider,{value:t,children:r})}var Fr=O.createContext(function(){});Fr.displayName="StackContext";var nt;(function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"})(nt||(nt={}));function ts(){return O.useContext(Fr)}function rs(e){var t=e.children,r=e.onUpdate,n=e.type,i=e.element,a=ts(),o=O.useCallback(function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];r==null||r.apply(void 0,u),a.apply(void 0,u)},[a,r]);return Ue(function(){return o(nt.Add,n,i),function(){return o(nt.Remove,n,i)}},[o,n,i]),S(Fr.Provider,{value:o,children:t})}var dr,ce;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(ce||(ce={}));var Mt;(function(e){e[e.SetTitleId=0]="SetTitleId"})(Mt||(Mt={}));var ns=(dr={},dr[Mt.SetTitleId]=function(e,t){return e.titleId===t.id?e:Se({},e,{titleId:t.id})},dr),Ut=O.createContext(null);Ut.displayName="DialogContext";function Tr(e){var t=O.useContext(Ut);if(t===null){var r=new Error("<"+e+" /> is missing a parent <"+pt.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Tr),r}return t}function is(e,t){return ke(t.type,ns,e,t)}var as="div",os=Me.RenderStrategy|Me.Static,ss=Pi(function(t,r){var n=t.open,i=t.onClose,a=t.initialFocus,o=Je(t,["open","onClose","initialFocus"]),s=O.useState(0),u=s[0],c=s[1],f=jr();if(n===void 0&&f!==null){var l;n=ke(f,(l={},l[Ae.Open]=!0,l[Ae.Closed]=!1,l))}var d=O.useRef(new Set),g=O.useRef(null),h=ki(g,r),b=t.hasOwnProperty("open")||f!==null,w=t.hasOwnProperty("onClose");if(!b&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!b)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof n!="boolean")throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+n);if(typeof i!="function")throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+i);var m=n?ce.Open:ce.Closed,N=function(){return f!==null?f===Ae.Open:m===ce.Open}(),E=O.useReducer(is,{titleId:null,descriptionId:null}),k=E[0],M=E[1],I=O.useCallback(function(){return i(!1)},[i]),j=O.useCallback(function(U){return M({type:Mt.SetTitleId,id:U})},[M]),V=Xt(),B=V&&m===ce.Open,L=u>1,A=O.useContext(Ut)!==null,q=L?"parent":"leaf";Ko(g,B?ke(q,{parent:Pe.RestoreFocus,leaf:Pe.All}):Pe.None,{initialFocus:a,containers:d}),Xo(g,L?B:!1),_t("mousedown",function(U){var X,se=U.target;m===ce.Open&&(L||((X=g.current)==null?void 0:X.contains(se))||I())}),_t("keydown",function(U){U.key===Dt.Escape&&m===ce.Open&&(L||(U.preventDefault(),U.stopPropagation(),I()))}),O.useEffect(function(){if(m===ce.Open&&!A){var U=document.documentElement.style.overflow,X=document.documentElement.style.paddingRight,se=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=se+"px",function(){document.documentElement.style.overflow=U,document.documentElement.style.paddingRight=X}}},[m,A]),O.useEffect(function(){if(m===ce.Open&&!!g.current){var U=new IntersectionObserver(function(X){for(var se=we(X),re;!(re=se()).done;){var J=re.value;J.boundingClientRect.x===0&&J.boundingClientRect.y===0&&J.boundingClientRect.width===0&&J.boundingClientRect.height===0&&I()}});return U.observe(g.current),function(){return U.disconnect()}}},[m,g,I]);var H=Yo(),v=H[0],P=H[1],D="headlessui-dialog-"+wt(),z=O.useMemo(function(){return[{dialogState:m,close:I,setTitleId:j},k]},[m,k,I,j]),G=O.useMemo(function(){return{open:m===ce.Open}},[m]),$={ref:h,id:D,role:"dialog","aria-modal":m===ce.Open?!0:void 0,"aria-labelledby":k.titleId,"aria-describedby":v,onClick:function(X){X.stopPropagation()}},ee=o;return S(rs,{type:"Dialog",element:g,onUpdate:O.useCallback(function(U,X,se){var re;X==="Dialog"&&ke(U,(re={},re[nt.Add]=function(){d.current.add(se),c(function(J){return J+1})},re[nt.Remove]=function(){d.current.add(se),c(function(J){return J-1})},re))},[]),children:S(bn,{force:!0,children:S(Or,{children:S(Ut.Provider,{value:z,children:S(Or.Group,{target:g,children:S(bn,{force:!1,children:S(P,{slot:G,name:"Dialog.Description",children:qe({props:Se({},ee,$),slot:G,defaultTag:as,features:os,visible:N,name:"Dialog"})})})})})})})})}),us="div",ls=Pi(function e(t,r){var n=Tr([pt.displayName,e.name].join(".")),i=n[0],a=i.dialogState,o=i.close,s=ki(r),u="headlessui-dialog-overlay-"+wt(),c=O.useCallback(function(g){if(g.target===g.currentTarget){if(Bo(g.currentTarget))return g.preventDefault();g.preventDefault(),g.stopPropagation(),o()}},[o]),f=O.useMemo(function(){return{open:a===ce.Open}},[a]),l={ref:s,id:u,"aria-hidden":!0,onClick:c},d=t;return qe({props:Se({},d,l),slot:f,defaultTag:us,name:"Dialog.Overlay"})}),cs="h2";function Ai(e){var t=Tr([pt.displayName,Ai.name].join(".")),r=t[0],n=r.dialogState,i=r.setTitleId,a="headlessui-dialog-title-"+wt();O.useEffect(function(){return i(a),function(){return i(null)}},[a,i]);var o=O.useMemo(function(){return{open:n===ce.Open}},[n]),s={id:a},u=e;return qe({props:Se({},u,s),slot:o,defaultTag:cs,name:"Dialog.Title"})}var pt=Object.assign(ss,{Overlay:ls,Title:Ai,Description:Zo});function ji(){var e=[],t={requestAnimationFrame:function(r){function n(){return r.apply(this,arguments)}return n.toString=function(){return r.toString()},n}(function(){var r=requestAnimationFrame.apply(void 0,arguments);t.add(function(){return cancelAnimationFrame(r)})}),nextFrame:function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];t.requestAnimationFrame(function(){t.requestAnimationFrame.apply(t,i)})},setTimeout:function(r){function n(){return r.apply(this,arguments)}return n.toString=function(){return r.toString()},n}(function(){var r=setTimeout.apply(void 0,arguments);t.add(function(){return clearTimeout(r)})}),add:function(n){e.push(n)},dispose:function(){for(var n=we(e.splice(0)),i;!(i=n()).done;){var a=i.value;a()}}};return t}function fs(){var e=O.useRef(!0);return O.useEffect(function(){e.current=!1},[]),e.current}function ds(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}function gr(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e&&n.length>0&&(t=e.classList).add.apply(t,n)}function kt(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e&&n.length>0&&(t=e.classList).remove.apply(t,n)}var Ve;(function(e){e.Finished="finished",e.Cancelled="cancelled"})(Ve||(Ve={}));function gs(e,t){var r=ji();if(!e)return r.dispose;var n=getComputedStyle(e),i=n.transitionDuration,a=n.transitionDelay,o=[i,a].map(function(c){var f=c.split(",").filter(Boolean).map(function(g){return g.includes("ms")?parseFloat(g):parseFloat(g)*1e3}).sort(function(g,h){return h-g}),l=f[0],d=l===void 0?0:l;return d}),s=o[0],u=o[1];return s!==0?r.setTimeout(function(){t(Ve.Finished)},s+u):t(Ve.Finished),r.add(function(){return t(Ve.Cancelled)}),r.dispose}function Cn(e,t,r,n,i,a){var o=ji(),s=a!==void 0?ds(a):function(){};return kt.apply(void 0,[e].concat(i)),gr.apply(void 0,[e].concat(t,r)),o.nextFrame(function(){kt.apply(void 0,[e].concat(r)),gr.apply(void 0,[e].concat(n)),o.add(gs(e,function(u){return kt.apply(void 0,[e].concat(n,t)),gr.apply(void 0,[e].concat(i)),s(u)}))}),o.add(function(){return kt.apply(void 0,[e].concat(t,r,n,i))}),o.add(function(){return s(Ve.Cancelled)}),o.dispose}function ze(e){return e===void 0&&(e=""),O.useMemo(function(){return e.split(" ").filter(function(t){return t.trim().length>1})},[e])}var Yt=O.createContext(null);Yt.displayName="TransitionContext";var Q;(function(e){e.Visible="visible",e.Hidden="hidden"})(Q||(Q={}));function hs(){var e=O.useContext(Yt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function ps(){var e=O.useContext(Qt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}var Qt=O.createContext(null);Qt.displayName="NestingContext";function Zt(e){return"children"in e?Zt(e.children):e.current.filter(function(t){var r=t.state;return r===Q.Visible}).length>0}function Fi(e){var t=O.useRef(e),r=O.useRef([]),n=Ni();O.useEffect(function(){t.current=e},[e]);var i=O.useCallback(function(o,s){var u;s===void 0&&(s=pe.Hidden);var c=r.current.findIndex(function(f){var l=f.id;return l===o});c!==-1&&(ke(s,(u={},u[pe.Unmount]=function(){r.current.splice(c,1)},u[pe.Hidden]=function(){r.current[c].state=Q.Hidden},u)),!Zt(r)&&n.current&&(t.current==null||t.current()))},[t,n,r]),a=O.useCallback(function(o){var s=r.current.find(function(u){var c=u.id;return c===o});return s?s.state!==Q.Visible&&(s.state=Q.Visible):r.current.push({id:o,state:Q.Visible}),function(){return i(o,pe.Unmount)}},[r,i]);return O.useMemo(function(){return{children:r,register:a,unregister:i}},[a,i,r])}function vs(){}var ms=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function En(e){for(var t={},r=we(ms),n;!(n=r()).done;){var i,a=n.value;t[a]=(i=e[a])!=null?i:vs}return t}function ys(e){var t=O.useRef(En(e));return O.useEffect(function(){t.current=En(e)},[e]),t}var bs="div",Ti=Me.RenderStrategy;function Di(e){var t,r=e.beforeEnter,n=e.afterEnter,i=e.beforeLeave,a=e.afterLeave,o=e.enter,s=e.enterFrom,u=e.enterTo,c=e.entered,f=e.leave,l=e.leaveFrom,d=e.leaveTo,g=Je(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"]),h=O.useRef(null),b=O.useState(Q.Visible),w=b[0],m=b[1],N=g.unmount?pe.Unmount:pe.Hidden,E=hs(),k=E.show,M=E.appear,I=E.initial,j=ps(),V=j.register,B=j.unregister,L=wt(),A=O.useRef(!1),q=Fi(function(){A.current||(m(Q.Hidden),B(L),ee.current.afterLeave())});Ue(function(){if(!!L)return V(L)},[V,L]),Ue(function(){var J;if(N===pe.Hidden&&!!L){if(k&&w!==Q.Visible){m(Q.Visible);return}ke(w,(J={},J[Q.Hidden]=function(){return B(L)},J[Q.Visible]=function(){return V(L)},J))}},[w,L,V,B,k,N]);var H=ze(o),v=ze(s),P=ze(u),D=ze(c),z=ze(f),G=ze(l),$=ze(d),ee=ys({beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:a}),U=Xt();O.useEffect(function(){if(U&&w===Q.Visible&&h.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[h,w,U]);var X=I&&!M;Ue(function(){var J=h.current;if(!!J&&!X)return A.current=!0,k&&ee.current.beforeEnter(),k||ee.current.beforeLeave(),k?Cn(J,H,v,P,D,function(je){A.current=!1,je===Ve.Finished&&ee.current.afterEnter()}):Cn(J,z,G,$,D,function(je){A.current=!1,je===Ve.Finished&&(Zt(q)||(m(Q.Hidden),B(L),ee.current.afterLeave()))})},[ee,L,A,B,q,h,X,k,H,v,P,z,G,$]);var se={ref:h},re=g;return S(Qt.Provider,{value:q,children:S(es,{value:ke(w,(t={},t[Q.Visible]=Ae.Open,t[Q.Hidden]=Ae.Closed,t)),children:qe({props:Se({},re,se),defaultTag:bs,features:Ti,visible:w===Q.Visible,name:"Transition.Child"})})})}function Ke(e){var t=e.show,r=e.appear,n=r===void 0?!1:r,i=e.unmount,a=Je(e,["show","appear","unmount"]),o=jr();if(t===void 0&&o!==null){var s;t=ke(o,(s={},s[Ae.Open]=!0,s[Ae.Closed]=!1,s))}if(![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var u=O.useState(t?Q.Visible:Q.Hidden),c=u[0],f=u[1],l=Fi(function(){f(Q.Hidden)}),d=fs(),g=O.useMemo(function(){return{show:t,appear:n||!d,initial:d}},[t,n,d]);O.useEffect(function(){t?f(Q.Visible):Zt(l)||f(Q.Hidden)},[t,l]);var h={unmount:i};return S(Qt.Provider,{value:l,children:S(Yt.Provider,{value:g,children:qe({props:Se({},h,{as:O.Fragment,children:S(Di,ue({},Object.assign({},h,a)))}),defaultTag:O.Fragment,features:Ti,visible:c===Q.Visible,name:"Transition"})})})}Ke.Child=function(t){var r=O.useContext(Yt)!==null,n=jr()!==null;return!r&&n?S(Ke,ue({},Object.assign({},t))):S(Di,ue({},Object.assign({},t)))};Ke.Root=Ke;function Os(e){const{children:t,isModalOpen:r,handleCloseModal:n}=e;return Si({isModal:!0}),S(Ot,{children:S(Ke,{appear:!0,show:r,as:O.Fragment,children:S(pt,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",onClose:n,children:W("div",{className:"min-h-screen text-center sm:px-4",children:[S(Ke.Child,{as:O.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:S(pt.Overlay,{className:"fixed inset-0"})}),S("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),S(Ke.Child,{as:O.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:W("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all transform bg-white sm:shadow-xl h-[100vh] sm:min-h-[50vh] sm:max-h-[90vh] w-full sm:w-[640px]",children:[S("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:S("div",{className:"",children:W("svg",{className:"w-8 h-8 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:n,children:[S("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",S("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",S("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",S("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),S("div",{className:"w-full",style:{height:"calc(100% - 56px)"},children:t})]})})]})})})})}function $e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wr(e,t){return wr=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},wr(e,t)}function er(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wr(e,t)}function St(e,t){if(t&&(Ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $e(e)}function Ne(e){return Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ne(e)}function ws(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ss(e){return oi(e)||ws(e)||si(e)||ui()}function kn(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 Nn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kn(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var xs={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,r){console&&console[t]&&console[t].apply(console,r)}},Ps=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.init(t,r)}return me(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=r||xs,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(r){this.debug=r}},{key:"log",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(r,n,i,a){return a&&!this.debug?null:(typeof r[0]=="string"&&(r[0]="".concat(i).concat(this.prefix," ").concat(r[0])),this.logger[n](r))}},{key:"create",value:function(r){return new e(this.logger,Nn(Nn({},{prefix:"".concat(this.prefix,":").concat(r,":")}),this.options))}}]),e}(),Ee=new Ps,He=function(){function e(){ve(this,e),this.observers={}}return me(e,[{key:"on",value:function(r,n){var i=this;return r.split(" ").forEach(function(a){i.observers[a]=i.observers[a]||[],i.observers[a].push(n)}),this}},{key:"off",value:function(r,n){if(!!this.observers[r]){if(!n){delete this.observers[r];return}this.observers[r]=this.observers[r].filter(function(i){return i!==n})}}},{key:"emit",value:function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(this.observers[r]){var o=[].concat(this.observers[r]);o.forEach(function(u){u.apply(void 0,i)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[r].concat(i))})}}}]),e}();function ut(){var e,t,r=new Promise(function(n,i){e=n,t=i});return r.resolve=e,r.reject=t,r}function Ln(e){return e==null?"":""+e}function Cs(e,t,r){e.forEach(function(n){t[n]&&(r[n]=t[n])})}function Dr(e,t,r){function n(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var a=typeof t!="string"?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=n(a.shift());!e[o]&&r&&(e[o]=new r),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={}}return i()?{}:{obj:e,k:n(a.shift())}}function Rn(e,t,r){var n=Dr(e,t,Object),i=n.obj,a=n.k;i[a]=r}function Es(e,t,r,n){var i=Dr(e,t,Object),a=i.obj,o=i.k;a[o]=a[o]||[],n&&(a[o]=a[o].concat(r)),n||a[o].push(r)}function Vt(e,t){var r=Dr(e,t),n=r.obj,i=r.k;if(!!n)return n[i]}function An(e,t,r){var n=Vt(e,r);return n!==void 0?n:Vt(t,r)}function _i(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):_i(e[n],t[n],r):e[n]=t[n]);return e}function Ze(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ks={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Ns(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return ks[t]}):e}var tr=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Ls=[" ",",","?","!",";"];function Rs(e,t,r){t=t||"",r=r||"";var n=Ls.filter(function(s){return t.indexOf(s)<0&&r.indexOf(s)<0});if(n.length===0)return!0;var i=new RegExp("(".concat(n.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),a=!i.test(e);if(!a){var o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a}function jn(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 Nt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jn(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function As(e){var t=js();return function(){var n=Ne(e),i;if(t){var a=Ne(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return St(this,i)}}function js(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ii(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var n=t.split(r),i=e,a=0;a<n.length;++a){if(!i||typeof i[n[a]]=="string"&&a+1<n.length)return;if(i[n[a]]===void 0){for(var o=2,s=n.slice(a,a+o).join(r),u=i[s];u===void 0&&n.length>a+o;)o++,s=n.slice(a,a+o).join(r),u=i[s];if(u===void 0)return;if(t.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var c=n.slice(a+o).join(r);return c?Ii(u,c,r):void 0}i=i[n[a]]}return i}}var Fs=function(e){er(r,e);var t=As(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return ve(this,r),i=t.call(this),tr&&He.call($e(i)),i.data=n||{},i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return me(r,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var a=this.options.ns.indexOf(i);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(i,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,c=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,f=[i,a];o&&typeof o!="string"&&(f=f.concat(o)),o&&typeof o=="string"&&(f=f.concat(u?o.split(u):o)),i.indexOf(".")>-1&&(f=i.split("."));var l=Vt(this.data,f);return l||!c||typeof o!="string"?l:Ii(this.data&&this.data[i]&&this.data[i][a],o,u)}},{key:"addResource",value:function(i,a,o,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var f=[i,a];o&&(f=f.concat(c?o.split(c):o)),i.indexOf(".")>-1&&(f=i.split("."),s=a,a=f[1]),this.addNamespaces(a),Rn(this.data,f,s),u.silent||this.emit("added",i,a,o,s)}},{key:"addResources",value:function(i,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in o)(typeof o[u]=="string"||Object.prototype.toString.apply(o[u])==="[object Array]")&&this.addResource(i,a,u,o[u],{silent:!0});s.silent||this.emit("added",i,a,o)}},{key:"addResourceBundle",value:function(i,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[i,a];i.indexOf(".")>-1&&(f=i.split("."),s=o,o=a,a=f[1]),this.addNamespaces(a);var l=Vt(this.data,f)||{};s?_i(l,o,u):l=Nt(Nt({},l),o),Rn(this.data,f,l),c.silent||this.emit("added",i,a,o)}},{key:"removeResourceBundle",value:function(i,a){this.hasResourceBundle(i,a)&&delete this.data[i][a],this.removeNamespaces(a),this.emit("removed",i,a)}},{key:"hasResourceBundle",value:function(i,a){return this.getResource(i,a)!==void 0}},{key:"getResourceBundle",value:function(i,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Nt(Nt({},{}),this.getResource(i,a)):this.getResource(i,a)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var a=this.getDataByLanguage(i),o=a&&Object.keys(a)||[];return!!o.find(function(s){return a[s]&&Object.keys(a[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(He),Mi={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,r,n,i,a){var o=this;return t.forEach(function(s){o.processors[s]&&(r=o.processors[s].process(r,n,i,a))}),r}};function Fn(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 de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fn(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ts(e){var t=Ds();return function(){var n=Ne(e),i;if(t){var a=Ne(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return St(this,i)}}function Ds(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Tn={},Dn=function(e){er(r,e);var t=Ts(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ve(this,r),i=t.call(this),tr&&He.call($e(i)),Cs(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,$e(i)),i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Ee.create("translator"),i}return me(r,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var o=this.resolve(i,a);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(i,a){var o=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ns||this.options.defaultNS||[],c=o&&i.indexOf(o)>-1,f=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!Rs(i,o,s);if(c&&!f){var l=i.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:i,namespaces:u};var d=i.split(o);(o!==s||o===s&&this.options.ns.indexOf(d[0])>-1)&&(u=d.shift()),i=d.join(s)}return typeof u=="string"&&(u=[u]),{key:i,namespaces:u}}},{key:"translate",value:function(i,a,o){var s=this;if(Ie(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var u=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=this.extractFromKey(i[i.length-1],a),f=c.key,l=c.namespaces,d=l[l.length-1],g=a.lng||this.language,h=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(h){var b=a.nsSeparator||this.options.nsSeparator;return d+b+f}return f}var w=this.resolve(i,a),m=w&&w.res,N=w&&w.usedKey||f,E=w&&w.exactUsedKey||f,k=Object.prototype.toString.apply(m),M=["[object Number]","[object Function]","[object RegExp]"],I=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,V=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if(j&&m&&V&&M.indexOf(k)<0&&!(typeof I=="string"&&k==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,m,de(de({},a),{},{ns:l})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(u){var B=k==="[object Array]",L=B?[]:{},A=B?E:N;for(var q in m)if(Object.prototype.hasOwnProperty.call(m,q)){var H="".concat(A).concat(u).concat(q);L[q]=this.translate(H,de(de({},a),{joinArrays:!1,ns:l})),L[q]===H&&(L[q]=m[q])}m=L}}else if(j&&typeof I=="string"&&k==="[object Array]")m=m.join(I),m&&(m=this.extendTranslation(m,i,a,o));else{var v=!1,P=!1,D=a.count!==void 0&&typeof a.count!="string",z=r.hasDefaultValue(a),G=D?this.pluralResolver.getSuffix(g,a.count,a):"",$=a["defaultValue".concat(G)]||a.defaultValue;!this.isValidLookup(m)&&z&&(v=!0,m=$),this.isValidLookup(m)||(P=!0,m=f);var ee=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,U=ee&&P?void 0:m,X=z&&$!==m&&this.options.updateMissing;if(P||v||X){if(this.logger.log(X?"updateKey":"missingKey",g,d,f,X?$:m),u){var se=this.resolve(f,de(de({},a),{},{keySeparator:!1}));se&&se.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var re=[],J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(var je=0;je<J.length;je++)re.push(J[je]);else this.options.saveMissingTo==="all"?re=this.languageUtils.toResolveHierarchy(a.lng||this.language):re.push(a.lng||this.language);var rr=function(We,p,y){var x=z&&y!==m?y:U;s.options.missingKeyHandler?s.options.missingKeyHandler(We,d,p,x,X,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(We,d,p,x,X,a),s.emit("missingKey",We,d,p,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?re.forEach(function(xt){s.pluralResolver.getSuffixes(xt).forEach(function(We){rr([xt],f+We,a["defaultValue".concat(We)]||$)})}):rr(re,f,$))}m=this.extendTranslation(m,i,a,w,o),P&&m===f&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(f)),(P||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(f,v?m:void 0):m=this.options.parseMissingKeyHandler(m))}return m}},{key:"extendTranslation",value:function(i,a,o,s,u){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,o,s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(de(de({},o),{interpolation:de(de({},this.options.interpolation),o.interpolation)}));var f=typeof i=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),l;if(f){var d=i.match(this.interpolator.nestingRegexp);l=d&&d.length}var g=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(g=de(de({},this.options.interpolation.defaultVariables),g)),i=this.interpolator.interpolate(i,g,o.lng||this.language,o),f){var h=i.match(this.interpolator.nestingRegexp),b=h&&h.length;l<b&&(o.nest=!1)}o.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var N=arguments.length,E=new Array(N),k=0;k<N;k++)E[k]=arguments[k];return u&&u[0]===E[0]&&!o.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(E[0]," in key: ").concat(a[0])),null):c.translate.apply(c,E.concat([a]))},o)),o.interpolation&&this.interpolator.reset()}var w=o.postProcess||this.options.postProcess,m=typeof w=="string"?[w]:w;return i!=null&&m&&m.length&&o.applyPostProcessor!==!1&&(i=Mi.handle(m,i,a,this.options&&this.options.postProcessPassResolved?de({i18nResolved:s},o):o,this)),i}},{key:"resolve",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,u,c,f,l;return typeof i=="string"&&(i=[i]),i.forEach(function(d){if(!a.isValidLookup(s)){var g=a.extractFromKey(d,o),h=g.key;u=h;var b=g.namespaces;a.options.fallbackNS&&(b=b.concat(a.options.fallbackNS));var w=o.count!==void 0&&typeof o.count!="string",m=w&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),N=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",E=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);b.forEach(function(k){a.isValidLookup(s)||(l=k,!Tn["".concat(E[0],"-").concat(k)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(Tn["".concat(E[0],"-").concat(k)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(E.join(", "),`" won't get resolved as namespace "`).concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(function(M){if(!a.isValidLookup(s)){f=M;var I=[h];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(I,h,M,k,o);else{var j;w&&(j=a.pluralResolver.getSuffix(M,o.count,o));var V="_zero";if(w&&(I.push(h+j),m&&I.push(h+V)),N){var B="".concat(h).concat(a.options.contextSeparator).concat(o.context);I.push(B),w&&(I.push(B+j),m&&I.push(B+V))}}for(var L;L=I.pop();)a.isValidLookup(s)||(c=L,s=a.getResource(M,k,L,o))}}))})}}),{res:s,usedKey:u,exactUsedKey:c,usedLng:f,usedNS:l}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,a,o,s):this.resourceStore.getResource(i,a,o,s)}}],[{key:"hasDefaultValue",value:function(i){var a="defaultValue";for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&a===o.substring(0,a.length)&&i[o]!==void 0)return!0;return!1}}]),r}(He);function hr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _s=function(){function e(t){ve(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ee.create("languageUtils")}return me(e,[{key:"getScriptPartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return null;var n=r.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return r;var n=r.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(r){if(typeof r=="string"&&r.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=r.split("-");return this.options.lowerCaseLng?i=i.map(function(a){return a.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=hr(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=hr(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=hr(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}},{key:"isSupportedCode",value:function(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}},{key:"getBestMatchFromCodes",value:function(r){var n=this;if(!r)return null;var i;return r.forEach(function(a){if(!i){var o=n.formatLanguageCode(a);(!n.options.supportedLngs||n.isSupportedCode(o))&&(i=o)}}),!i&&this.options.supportedLngs&&r.forEach(function(a){if(!i){var o=n.getLanguagePartFromCode(a);if(n.isSupportedCode(o))return i=o;i=n.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(r,n){if(!r)return[];if(typeof r=="function"&&(r=r(n)),typeof r=="string"&&(r=[r]),Object.prototype.toString.apply(r)==="[object Array]")return r;if(!n)return r.default||[];var i=r[n];return i||(i=r[this.getScriptPartFromCode(n)]),i||(i=r[this.formatLanguageCode(n)]),i||(i=r[this.getLanguagePartFromCode(n)]),i||(i=r.default),i||[]}},{key:"toResolveHierarchy",value:function(r,n){var i=this,a=this.getFallbackCodes(n||this.options.fallbackLng||[],r),o=[],s=function(c){!c||(i.isSupportedCode(c)?o.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof r=="string"&&r.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(r))):typeof r=="string"&&s(this.formatLanguageCode(r)),a.forEach(function(u){o.indexOf(u)<0&&s(i.formatLanguageCode(u))}),o}}]),e}(),Is=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Ms={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Us=["v1","v2","v3"],_n={zero:0,one:1,two:2,few:3,many:4,other:5};function Vs(){var e={};return Is.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:Ms[t.fc]}})}),e}var $s=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.languageUtils=t,this.options=r,this.logger=Ee.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Vs()}return me(e,[{key:"addRule",value:function(r,n){this.rules[r]=n}},{key:"getRule",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(r,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[r]||this.rules[this.languageUtils.getLanguagePartFromCode(r)]}},{key:"needsPlural",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(r,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(r,i).map(function(a){return"".concat(n).concat(a)})}},{key:"getSuffixes",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(r,i);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(o,s){return _n[o]-_n[s]}).map(function(o){return"".concat(n.options.prepend).concat(o)}):a.numbers.map(function(o){return n.getSuffix(r,o,i)}):[]}},{key:"getSuffix",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(r,i);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(n)):this.getSuffixRetroCompatible(a,n):(this.logger.warn("no plural rule found for: ".concat(r)),"")}},{key:"getSuffixRetroCompatible",value:function(r,n){var i=this,a=r.noAbs?r.plurals(n):r.plurals(Math.abs(n)),o=r.numbers[a];this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var s=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1?s():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!Us.includes(this.options.compatibilityJSON)}}]),e}();function In(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 ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?In(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):In(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Hs=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=Ee.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return me(e,[{key:"init",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r.interpolation||(r.interpolation={escapeValue:!0});var n=r.interpolation;this.escape=n.escape!==void 0?n.escape:Ns,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Ze(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Ze(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Ze(n.nestingPrefix):n.nestingPrefixEscaped||Ze("$t("),this.nestingSuffix=n.nestingSuffix?Ze(n.nestingSuffix):n.nestingSuffixEscaped||Ze(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var r="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(r,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(r,n,i,a){var o=this,s,u,c,f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(w){return w.replace(/\$/g,"$$$$")}var d=function(m){if(m.indexOf(o.formatSeparator)<0){var N=An(n,f,m);return o.alwaysFormat?o.format(N,void 0,i,ye(ye(ye({},a),n),{},{interpolationkey:m})):N}var E=m.split(o.formatSeparator),k=E.shift().trim(),M=E.join(o.formatSeparator).trim();return o.format(An(n,f,k),M,i,ye(ye(ye({},a),n),{},{interpolationkey:k}))};this.resetRegExp();var g=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,h=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:function(m){return l(m)}},{regex:this.regexp,safeValue:function(m){return o.escapeValue?l(o.escape(m)):l(m)}}];return b.forEach(function(w){for(c=0;s=w.regex.exec(r);){var m=s[1].trim();if(u=d(m),u===void 0)if(typeof g=="function"){var N=g(r,s,a);u=typeof N=="string"?N:""}else if(a&&a.hasOwnProperty(m))u="";else if(h){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(m," for interpolating ").concat(r)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=Ln(u));var E=w.safeValue(u);if(r=r.replace(s[0],E),h?(w.regex.lastIndex+=E.length,w.regex.lastIndex-=s[0].length):w.regex.lastIndex=0,c++,c>=o.maxReplaces)break}}),r}},{key:"nest",value:function(r,n){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=ye({},a);u.applyPostProcessor=!1,delete u.defaultValue;function c(g,h){var b=this.nestingOptionsSeparator;if(g.indexOf(b)<0)return g;var w=g.split(new RegExp("".concat(b,"[ ]*{"))),m="{".concat(w[1]);g=w[0],m=this.interpolate(m,u),m=m.replace(/'/g,'"');try{u=JSON.parse(m),h&&(u=ye(ye({},h),u))}catch(N){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),N),"".concat(g).concat(b).concat(m)}return delete u.defaultValue,g}for(;o=this.nestingRegexp.exec(r);){var f=[],l=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var d=o[1].split(this.formatSeparator).map(function(g){return g.trim()});o[1]=d.shift(),f=d,l=!0}if(s=n(c.call(this,o[1].trim(),u),u),s&&o[0]===r&&typeof s!="string")return s;typeof s!="string"&&(s=Ln(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(r)),s=""),l&&(s=f.reduce(function(g,h){return i.format(g,h,a.lng,ye(ye({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),r=r.replace(o[0],s),this.regexp.lastIndex=0}return r}}]),e}();function Mn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mn(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bs(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);if(t==="currency"&&i.indexOf(":")<0)r.currency||(r.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)r.range||(r.range=i.trim());else{var a=i.split(";");a.forEach(function(o){if(!!o){var s=o.split(":"),u=Ss(s),c=u[0],f=u.slice(1),l=f.join(":");l.trim()==="false"&&(r[c.trim()]=!1),l.trim()==="true"&&(r[c.trim()]=!0),isNaN(l.trim())||(r[c.trim()]=parseInt(l.trim(),10)),r[c.trim()]||(r[c.trim()]=l.trim())}})}}return{formatName:t,formatOptions:r}}var qs=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=Ee.create("formatter"),this.options=t,this.formats={number:function(n,i,a){return new Intl.NumberFormat(i,a).format(n)},currency:function(n,i,a){return new Intl.NumberFormat(i,Te(Te({},a),{},{style:"currency"})).format(n)},datetime:function(n,i,a){return new Intl.DateTimeFormat(i,Te({},a)).format(n)},relativetime:function(n,i,a){return new Intl.RelativeTimeFormat(i,Te({},a)).format(n,a.range||"day")},list:function(n,i,a){return new Intl.ListFormat(i,Te({},a)).format(n)}},this.init(t)}return me(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(r,n){this.formats[r.toLowerCase().trim()]=n}},{key:"format",value:function(r,n,i,a){var o=this,s=n.split(this.formatSeparator),u=s.reduce(function(c,f){var l=Bs(f),d=l.formatName,g=l.formatOptions;if(o.formats[d]){var h=c;try{var b=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},w=b.locale||b.lng||a.locale||a.lng||i;h=o.formats[d](c,w,Te(Te(Te({},g),a),b))}catch(m){o.logger.warn(m)}return h}else o.logger.warn("there was no format function for ".concat(d));return c},r);return u}}]),e}();function Un(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 Vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Un(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Un(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ws(e){var t=zs();return function(){var n=Ne(e),i;if(t){var a=Ne(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return St(this,i)}}function zs(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gs(e,t){for(var r=e.indexOf(t);r!==-1;)e.splice(r,1),r=e.indexOf(t)}var Ks=function(e){er(r,e);var t=Ws(r);function r(n,i,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return ve(this,r),o=t.call(this),tr&&He.call($e(o)),o.backend=n,o.store=i,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=Ee.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return me(r,[{key:"queueLoad",value:function(i,a,o,s){var u=this,c=[],f=[],l=[],d=[];return i.forEach(function(g){var h=!0;a.forEach(function(b){var w="".concat(g,"|").concat(b);!o.reload&&u.store.hasResourceBundle(g,b)?u.state[w]=2:u.state[w]<0||(u.state[w]===1?f.indexOf(w)<0&&f.push(w):(u.state[w]=1,h=!1,f.indexOf(w)<0&&f.push(w),c.indexOf(w)<0&&c.push(w),d.indexOf(b)<0&&d.push(b)))}),h||l.push(g)}),(c.length||f.length)&&this.queue.push({pending:f,loaded:{},errors:[],callback:s}),{toLoad:c,pending:f,toLoadLanguages:l,toLoadNamespaces:d}}},{key:"loaded",value:function(i,a,o){var s=i.split("|"),u=s[0],c=s[1];a&&this.emit("failedLoading",u,c,a),o&&this.store.addResourceBundle(u,c,o),this.state[i]=a?-1:2;var f={};this.queue.forEach(function(l){Es(l.loaded,[u],c),Gs(l.pending,i),a&&l.errors.push(a),l.pending.length===0&&!l.done&&(Object.keys(l.loaded).forEach(function(d){f[d]||(f[d]=[]),l.loaded[d].length&&l.loaded[d].forEach(function(g){f[d].indexOf(g)<0&&f[d].push(g)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(l){return!l.done})}},{key:"read",value:function(i,a,o){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,f=arguments.length>5?arguments[5]:void 0;return i.length?this.backend[o](i,a,function(l,d){if(l&&d&&u<5){setTimeout(function(){s.read.call(s,i,a,o,u+1,c*2,f)},c);return}f(l,d)}):f(null,{})}},{key:"prepareLoading",value:function(i,a){var o=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof a=="string"&&(a=[a]);var c=this.queueLoad(i,a,s,u);if(!c.toLoad.length)return c.pending.length||u(),null;c.toLoad.forEach(function(f){o.loadOne(f)})}},{key:"load",value:function(i,a,o){this.prepareLoading(i,a,{},o)}},{key:"reload",value:function(i,a,o){this.prepareLoading(i,a,{reload:!0},o)}},{key:"loadOne",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),u=s[0],c=s[1];this.read(u,c,"read",void 0,void 0,function(f,l){f&&a.logger.warn("".concat(o,"loading namespace ").concat(c," for language ").concat(u," failed"),f),!f&&l&&a.logger.log("".concat(o,"loaded namespace ").concat(c," for language ").concat(u),l),a.loaded(i,f,l)})}},{key:"saveMissing",value:function(i,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(i,a,o,s,null,Vn(Vn({},c),{},{isUpdate:u})),!(!i||!i[0])&&this.store.addResource(i[0],a,o,s))}}]),r}(He);function Js(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var r={};if(Ie(t[1])==="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),Ie(t[2])==="object"||Ie(t[3])==="object"){var n=t[3]||t[2];Object.keys(n).forEach(function(i){r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:function(t,r,n,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function $n(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Hn(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 xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hn(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xs(e){var t=Ys();return function(){var n=Ne(e),i;if(t){var a=Ne(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return St(this,i)}}function Ys(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lt(){}function Qs(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}var $t=function(e){er(r,e);var t=Xs(r);function r(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(ve(this,r),n=t.call(this),tr&&He.call($e(n)),n.options=$n(i),n.services={},n.logger=Ee,n.modules={external:[]},Qs($e(n)),a&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,a),St(n,$e(n));setTimeout(function(){n.init(i,a)},0)}return n}return me(r,[{key:"init",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(o=a,a={}),!a.defaultNS&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var s=Js();this.options=xe(xe(xe({},s),this.options),$n(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=xe(xe({},s.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function u(m){return m?typeof m=="function"?new m:m:null}if(!this.options.isClone){this.modules.logger?Ee.init(u(this.modules.logger),this.options):Ee.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=qs);var f=new _s(this.options);this.store=new Fs(this.options.resources,this.options);var l=this.services;l.logger=Ee,l.resourceStore=this.store,l.languageUtils=f,l.pluralResolver=new $s(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(l.formatter=u(c),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new Hs(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Ks(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(m){for(var N=arguments.length,E=new Array(N>1?N-1:0),k=1;k<N;k++)E[k-1]=arguments[k];i.emit.apply(i,[m].concat(E))}),this.modules.languageDetector&&(l.languageDetector=u(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=u(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new Dn(this.services,this.options),this.translator.on("*",function(m){for(var N=arguments.length,E=new Array(N>1?N-1:0),k=1;k<N;k++)E[k-1]=arguments[k];i.emit.apply(i,[m].concat(E))}),this.modules.external.forEach(function(m){m.init&&m.init(i)})}if(this.format=this.options.interpolation.format,o||(o=Lt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var g=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];g.forEach(function(m){i[m]=function(){var N;return(N=i.store)[m].apply(N,arguments)}});var h=["addResource","addResources","addResourceBundle","removeResourceBundle"];h.forEach(function(m){i[m]=function(){var N;return(N=i.store)[m].apply(N,arguments),i}});var b=ut(),w=function(){var N=function(k,M){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),b.resolve(M),o(k,M)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return N(null,i.t.bind(i));i.changeLanguage(i.options.lng,N)};return this.options.resources||!this.options.initImmediate?w():setTimeout(w,0),b}},{key:"loadResources",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt,s=o,u=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var c=[],f=function(g){if(!!g){var h=a.services.languageUtils.toResolveHierarchy(g);h.forEach(function(b){c.indexOf(b)<0&&c.push(b)})}};if(u)f(u);else{var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach(function(d){return f(d)})}this.options.preload&&this.options.preload.forEach(function(d){return f(d)}),this.services.backendConnector.load(c,this.options.ns,s)}else s(null)}},{key:"reloadResources",value:function(i,a,o){var s=ut();return i||(i=this.languages),a||(a=this.options.ns),o||(o=Lt),this.services.backendConnector.reload(i,a,function(u){s.resolve(),o(u)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Mi.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"changeLanguage",value:function(i,a){var o=this;this.isLanguageChangingTo=i;var s=ut();this.emit("languageChanging",i);var u=function(d){if(o.language=d,o.languages=o.services.languageUtils.toResolveHierarchy(d),o.resolvedLanguage=void 0,!(["cimode","dev"].indexOf(d)>-1))for(var g=0;g<o.languages.length;g++){var h=o.languages[g];if(!(["cimode","dev"].indexOf(h)>-1)&&o.store.hasLanguageSomeTranslations(h)){o.resolvedLanguage=h;break}}},c=function(d,g){g?(u(g),o.translator.changeLanguage(g),o.isLanguageChangingTo=void 0,o.emit("languageChanged",g),o.logger.log("languageChanged",g)):o.isLanguageChangingTo=void 0,s.resolve(function(){return o.t.apply(o,arguments)}),a&&a(d,function(){return o.t.apply(o,arguments)})},f=function(d){!i&&!d&&o.services.languageDetector&&(d=[]);var g=typeof d=="string"?d:o.services.languageUtils.getBestMatchFromCodes(d);g&&(o.language||u(g),o.translator.language||o.translator.changeLanguage(g),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(g)),o.loadResources(g,function(h){c(h,g)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(f):f(i),s}},{key:"getFixedT",value:function(i,a,o){var s=this,u=function c(f,l){var d;if(Ie(l)!=="object"){for(var g=arguments.length,h=new Array(g>2?g-2:0),b=2;b<g;b++)h[b-2]=arguments[b];d=s.options.overloadTranslationOptionHandler([f,l].concat(h))}else d=xe({},l);d.lng=d.lng||c.lng,d.lngs=d.lngs||c.lngs,d.ns=d.ns||c.ns;var w=s.options.keySeparator||".",m=o?"".concat(o).concat(w).concat(f):f;return s.t(m,d)};return typeof i=="string"?u.lng=i:u.lngs=i,u.ns=a,u.keyPrefix=o,u}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var f=function(g,h){var b=a.services.backendConnector.state["".concat(g,"|").concat(h)];return b===-1||b===2};if(o.precheck){var l=o.precheck(this,f);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||f(s,i)&&(!u||f(c,i)))}},{key:"loadNamespaces",value:function(i,a){var o=this,s=ut();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(u){o.options.ns.indexOf(u)<0&&o.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),a&&a(u)}),s):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(i,a){var o=ut();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],u=i.filter(function(c){return s.indexOf(c)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(c){o.resolve(),a&&a(c)}),o):(a&&a(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt,s=xe(xe(xe({},this.options),a),{isClone:!0}),u=new r(s),c=["store","services","language"];return c.forEach(function(f){u[f]=i[f]}),u.services=xe({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new Dn(u.services,u.options),u.translator.on("*",function(f){for(var l=arguments.length,d=new Array(l>1?l-1:0),g=1;g<l;g++)d[g-1]=arguments[g];u.emit.apply(u,[f].concat(d))}),u.init(s,o),u.translator.options=u.options,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(He);Le($t,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new $t(e,t)});var oe=$t.createInstance();oe.createInstance=$t.createInstance;oe.createInstance;oe.init;oe.loadResources;oe.reloadResources;oe.use;oe.changeLanguage;oe.getFixedT;oe.t;oe.exists;oe.setDefaultNamespace;oe.hasLoadedNamespace;oe.loadNamespaces;oe.loadLanguages;var Ui=[],Zs=Ui.forEach,eu=Ui.slice;function tu(e){return Zs.call(eu.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Bn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ru=function(t,r,n){var i=n||{};i.path=i.path||"/";var a=encodeURIComponent(r),o=t+"="+a;if(i.maxAge>0){var s=i.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(i.domain){if(!Bn.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!Bn.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+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},qn={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=ru(t,encodeURIComponent(r),a)},read:function(t){for(var r=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)}},nu={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=qn.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&qn.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},iu={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined")for(var n=window.location.search.substring(1),i=n.split("&"),a=0;a<i.length;a++){var o=i[a].indexOf("=");if(o>0){var s=i[a].substring(0,o);s===t.lookupQuerystring&&(r=i[a].substring(o+1))}}return r}},lt=null,Wn=function(){if(lt!==null)return lt;try{lt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{lt=!1}return lt},au={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Wn()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Wn()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},ct=null,zn=function(){if(ct!==null)return ct;try{ct=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{ct=!1}return ct},ou={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&zn()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&zn()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},su={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}},uu={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}},lu={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}},cu={name:"subdomain",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);n instanceof Array&&(typeof t.lookupFromSubdomainIndex=="number"?r=n[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):r=n[0].replace("http://","").replace("https://","").replace(".",""))}return r}};function fu(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Vi=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return me(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=tu(n,this.options||{},fu()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(nu),this.addDetector(iu),this.addDetector(au),this.addDetector(ou),this.addDetector(su),this.addDetector(uu),this.addDetector(lu),this.addDetector(cu)}},{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}();Vi.type="languageDetector";function Sr(e){return Sr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sr(e)}var $i=[],du=$i.forEach,gu=$i.slice;function xr(e){return du.call(gu.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}function Hi(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest=="undefined"?"undefined":Sr(XMLHttpRequest))==="object"}function hu(e){return!!e&&typeof e.then=="function"}function pu(e){return hu(e)?e:Promise.resolve(e)}var Ht={exports:{}},Pr={exports:{}};(function(e,t){var r=typeof self!="undefined"?self:At,n=function(){function a(){this.fetch=!1,this.DOMException=r.DOMException}return a.prototype=r,new a}();(function(a){(function(o){var s={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(v){return v&&DataView.prototype.isPrototypeOf(v)}if(s.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(v){return v&&c.indexOf(Object.prototype.toString.call(v))>-1};function l(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function d(v){return typeof v!="string"&&(v=String(v)),v}function g(v){var P={next:function(){var D=v.shift();return{done:D===void 0,value:D}}};return s.iterable&&(P[Symbol.iterator]=function(){return P}),P}function h(v){this.map={},v instanceof h?v.forEach(function(P,D){this.append(D,P)},this):Array.isArray(v)?v.forEach(function(P){this.append(P[0],P[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(P){this.append(P,v[P])},this)}h.prototype.append=function(v,P){v=l(v),P=d(P);var D=this.map[v];this.map[v]=D?D+", "+P:P},h.prototype.delete=function(v){delete this.map[l(v)]},h.prototype.get=function(v){return v=l(v),this.has(v)?this.map[v]:null},h.prototype.has=function(v){return this.map.hasOwnProperty(l(v))},h.prototype.set=function(v,P){this.map[l(v)]=d(P)},h.prototype.forEach=function(v,P){for(var D in this.map)this.map.hasOwnProperty(D)&&v.call(P,this.map[D],D,this)},h.prototype.keys=function(){var v=[];return this.forEach(function(P,D){v.push(D)}),g(v)},h.prototype.values=function(){var v=[];return this.forEach(function(P){v.push(P)}),g(v)},h.prototype.entries=function(){var v=[];return this.forEach(function(P,D){v.push([D,P])}),g(v)},s.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);function b(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function w(v){return new Promise(function(P,D){v.onload=function(){P(v.result)},v.onerror=function(){D(v.error)}})}function m(v){var P=new FileReader,D=w(P);return P.readAsArrayBuffer(v),D}function N(v){var P=new FileReader,D=w(P);return P.readAsText(v),D}function E(v){for(var P=new Uint8Array(v),D=new Array(P.length),z=0;z<P.length;z++)D[z]=String.fromCharCode(P[z]);return D.join("")}function k(v){if(v.slice)return v.slice(0);var P=new Uint8Array(v.byteLength);return P.set(new Uint8Array(v)),P.buffer}function M(){return this.bodyUsed=!1,this._initBody=function(v){this._bodyInit=v,v?typeof v=="string"?this._bodyText=v:s.blob&&Blob.prototype.isPrototypeOf(v)?this._bodyBlob=v:s.formData&&FormData.prototype.isPrototypeOf(v)?this._bodyFormData=v:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)?this._bodyText=v.toString():s.arrayBuffer&&s.blob&&u(v)?(this._bodyArrayBuffer=k(v.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(v)||f(v))?this._bodyArrayBuffer=k(v):this._bodyText=v=Object.prototype.toString.call(v):this._bodyText="",this.headers.get("content-type")||(typeof v=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var v=b(this);if(v)return v;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?b(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var v=b(this);if(v)return v;if(this._bodyBlob)return N(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(B)}),this.json=function(){return this.text().then(JSON.parse)},this}var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function j(v){var P=v.toUpperCase();return I.indexOf(P)>-1?P:v}function V(v,P){P=P||{};var D=P.body;if(v instanceof V){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,P.headers||(this.headers=new h(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!D&&v._bodyInit!=null&&(D=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new h(P.headers)),this.method=j(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}V.prototype.clone=function(){return new V(this,{body:this._bodyInit})};function B(v){var P=new FormData;return v.trim().split("&").forEach(function(D){if(D){var z=D.split("="),G=z.shift().replace(/\+/g," "),$=z.join("=").replace(/\+/g," ");P.append(decodeURIComponent(G),decodeURIComponent($))}}),P}function L(v){var P=new h,D=v.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(z){var G=z.split(":"),$=G.shift().trim();if($){var ee=G.join(":").trim();P.append($,ee)}}),P}M.call(V.prototype);function A(v,P){P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in P?P.statusText:"OK",this.headers=new h(P.headers),this.url=P.url||"",this._initBody(v)}M.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},A.error=function(){var v=new A(null,{status:0,statusText:""});return v.type="error",v};var q=[301,302,303,307,308];A.redirect=function(v,P){if(q.indexOf(P)===-1)throw new RangeError("Invalid status code");return new A(null,{status:P,headers:{location:v}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(P,D){this.message=P,this.name=D;var z=Error(P);this.stack=z.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function H(v,P){return new Promise(function(D,z){var G=new V(v,P);if(G.signal&&G.signal.aborted)return z(new o.DOMException("Aborted","AbortError"));var $=new XMLHttpRequest;function ee(){$.abort()}$.onload=function(){var U={status:$.status,statusText:$.statusText,headers:L($.getAllResponseHeaders()||"")};U.url="responseURL"in $?$.responseURL:U.headers.get("X-Request-URL");var X="response"in $?$.response:$.responseText;D(new A(X,U))},$.onerror=function(){z(new TypeError("Network request failed"))},$.ontimeout=function(){z(new TypeError("Network request failed"))},$.onabort=function(){z(new o.DOMException("Aborted","AbortError"))},$.open(G.method,G.url,!0),G.credentials==="include"?$.withCredentials=!0:G.credentials==="omit"&&($.withCredentials=!1),"responseType"in $&&s.blob&&($.responseType="blob"),G.headers.forEach(function(U,X){$.setRequestHeader(X,U)}),G.signal&&(G.signal.addEventListener("abort",ee),$.onreadystatechange=function(){$.readyState===4&&G.signal.removeEventListener("abort",ee)}),$.send(typeof G._bodyInit=="undefined"?null:G._bodyInit)})}return H.polyfill=!0,a.fetch||(a.fetch=H,a.Headers=h,a.Request=V,a.Response=A),o.Headers=h,o.Request=V,o.Response=A,o.fetch=H,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(Pr,Pr.exports);(function(e,t){var r;if(typeof fetch=="function"&&(typeof At!="undefined"&&At.fetch?r=At.fetch:typeof window!="undefined"&&window.fetch&&(r=window.fetch)),typeof ba!="undefined"&&(typeof window=="undefined"||typeof window.document=="undefined")){var n=r||Pr.exports;n.default&&(n=n.default),t.default=n,e.exports=t.default}})(Ht,Ht.exports);var Bi=Ht.exports,Gn=Object.freeze(ea({__proto__:null,[Symbol.toStringTag]:"Module",default:Bi},[Ht.exports]));function Bt(e){return Bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(e)}var Be;typeof fetch=="function"&&(typeof global!="undefined"&&global.fetch?Be=global.fetch:typeof window!="undefined"&&window.fetch&&(Be=window.fetch));var vt;Hi&&(typeof global!="undefined"&&global.XMLHttpRequest?vt=global.XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest&&(vt=window.XMLHttpRequest));var qt;typeof ActiveXObject=="function"&&(typeof global!="undefined"&&global.ActiveXObject?qt=global.ActiveXObject:typeof window!="undefined"&&window.ActiveXObject&&(qt=window.ActiveXObject));!Be&&Gn&&!vt&&!qt&&(Be=Bi||Gn);typeof Be!="function"&&(Be=void 0);var Cr=function(t,r){if(r&&Bt(r)==="object"){var n="";for(var i in r)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(r[i]);if(!n)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+n.slice(1)}return t},vu=function(t,r,n,i){t.queryStringParams&&(r=Cr(r,t.queryStringParams));var a=xr({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);n&&(a["Content-Type"]="application/json"),Be(r,xr({method:n?"POST":"GET",body:n?t.stringify(n):void 0,headers:a},typeof t.requestOptions=="function"?t.requestOptions(n):t.requestOptions)).then(function(o){if(!o.ok)return i(o.statusText||"Error",{status:o.status});o.text().then(function(s){i(null,{status:o.status,data:s})}).catch(i)}).catch(i)},mu=function(t,r,n,i){n&&Bt(n)==="object"&&(n=Cr("",n).slice(1)),t.queryStringParams&&(r=Cr(r,t.queryStringParams));try{var a;vt?a=new vt:a=new qt("MSXML2.XMLHTTP.3.0"),a.open(n?"POST":"GET",r,1),t.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.withCredentials=!!t.withCredentials,n&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.overrideMimeType&&a.overrideMimeType("application/json");var o=t.customHeaders;if(o=typeof o=="function"?o():o,o)for(var s in o)a.setRequestHeader(s,o[s]);a.onreadystatechange=function(){a.readyState>3&&i(a.status>=400?a.statusText:null,{status:a.status,data:a.responseText})},a.send(n)}catch(u){console&&console.log(u)}},yu=function(t,r,n,i){if(typeof n=="function"&&(i=n,n=void 0),i=i||function(){},Be)return vu(t,r,n,i);if(Hi||typeof ActiveXObject=="function")return mu(t,r,n,i)};function bu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ou(e,t,r){return t&&Kn(e.prototype,t),r&&Kn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Su=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(r){return JSON.parse(r)},stringify:JSON.stringify,parsePayload:function(r,n,i){return wu({},n,i||"")},request:yu,reloadInterval:typeof window!="undefined"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},qi=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};bu(this,e),this.services=t,this.options=r,this.allOptions=n,this.type="backend",this.init(t,r,n)}return Ou(e,[{key:"init",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=xr(i,this.options||{},Su()),this.allOptions=a,this.services&&this.options.reloadInterval&&setInterval(function(){return n.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(r,n,i){this._readAny(r,r,n,n,i)}},{key:"read",value:function(r,n,i){this._readAny([r],r,[n],n,i)}},{key:"_readAny",value:function(r,n,i,a,o){var s=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(r,i)),u=pu(u),u.then(function(c){var f=s.services.interpolator.interpolate(c,{lng:r.join("+"),ns:i.join("+")});s.loadUrl(f,o,n,a)})}},{key:"loadUrl",value:function(r,n,i,a){var o=this;this.options.request(this.options,r,void 0,function(s,u){if(u&&(u.status>=500&&u.status<600||!u.status))return n("failed loading "+r+"; status code: "+u.status,!0);if(u&&u.status>=400&&u.status<500)return n("failed loading "+r+"; status code: "+u.status,!1);if(!u&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return n("failed loading "+r+": "+s.message,!0);if(s)return n(s,!1);var c,f;try{typeof u.data=="string"?c=o.options.parse(u.data,i,a):c=u.data}catch{f="failed parsing "+r+" to json"}if(f)return n(f,!1);n(null,c)})}},{key:"create",value:function(r,n,i,a,o){var s=this;if(!!this.options.addPath){typeof r=="string"&&(r=[r]);var u=this.options.parsePayload(n,i,a),c=0,f=[],l=[];r.forEach(function(d){var g=s.options.addPath;typeof s.options.addPath=="function"&&(g=s.options.addPath(d,n));var h=s.services.interpolator.interpolate(g,{lng:d,ns:n});s.options.request(s.options,h,u,function(b,w){c+=1,f.push(b),l.push(w),c===r.length&&o&&o(f,l)})})}}},{key:"reload",value:function(){var r=this,n=this.services,i=n.backendConnector,a=n.languageUtils,o=n.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var u=[],c=function(l){var d=a.toResolveHierarchy(l);d.forEach(function(g){u.indexOf(g)<0&&u.push(g)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(f){return c(f)}),u.forEach(function(f){r.allOptions.ns.forEach(function(l){i.read(f,l,"read",null,null,function(d,g){d&&o.warn("loading namespace ".concat(l," for language ").concat(f," failed"),d),!d&&g&&o.log("loaded namespace ".concat(l," for language ").concat(f),g),i.loaded("".concat(f,"|").concat(l),d,g)})})})}}}]),e}();qi.type="backend";const xu=e=>oe.use(Ea).use(Vi).use(qi).init({supportedLngs:["en","pl","cz","de"],fallbackLng:"en",detection:{order:["localStorage","htmlTag","cookie","navigator","path","subdomain"],caches:["localStorage"]},backend:{loadPath:e},react:{useSuspense:!1}});xu("/locales/{{lng}}.json");function Pu(e){const{product:t,primaryColor:r,lang:n="pl",handleAddToBasket:i,handleGoBack:a,isModal:o=!1,isModalOpen:s=!0,showDebugState:u=!1,handleCloseModal:c=()=>alert("ERROR: handleCloseModal not implemented")}=e,f=te(w=>w.setInitialFilter),l=te(w=>w.setInitialSelectedState),d=te(w=>w.setInitialValidate),{state:{filter:g={},selected:h={}}={}}=t;O.useEffect(()=>{console.log("cleared"),d(),f(g),l(h),oe.changeLanguage(n)},[t]),O.useEffect(()=>{r&&document.documentElement.style.setProperty("--color-primary",r)},[]);const b=S(To,{product:t,handleAddToBasket:i,handleGoBack:a,isModal:o,showDebugState:u});return S(Ot,{children:o===!0?S(Os,{isModalOpen:s,handleCloseModal:c,children:b}):b})}exports.ProductConfigurator=Pu;
18
+ `));return y.cloneElement(g,Object.assign({},Es(Ls(ur(l,["ref"])),g.props,["onClick"]),d))}return y.createElement(s,Object.assign({},ur(l,["ref"]),s!==y.Fragment&&d),g)}function Es(e,r,t){for(var i=Object.assign({},e),n=function(){var u=o.value;if(e[u]!==void 0&&r[u]!==void 0){var c;Object.assign(i,(c={},c[u]=function(f){f.defaultPrevented||e[u](f),f.defaultPrevented||r[u](f)},c))}},a=Se(t),o;!(o=a()).done;)n();return i}function Ni(e){var r;return Object.assign(y.forwardRef(e),{displayName:(r=e.displayName)!=null?r:e.name})}function Ls(e){var r=Object.assign({},e);for(var t in r)r[t]===void 0&&delete r[t];return r}function ur(e,r){r===void 0&&(r=[]);for(var t=Object.assign({},e),i=Se(r),n;!(n=i()).done;){var a=n.value;a in t&&delete t[a]}return t}var Ve=typeof window!="undefined"?y.useLayoutEffect:y.useEffect,lr={serverHandoffComplete:!1};function Kt(){var e=y.useState(lr.serverHandoffComplete),r=e[0],t=e[1];return y.useEffect(function(){r!==!0&&t(!0)},[r]),y.useEffect(function(){lr.serverHandoffComplete===!1&&(lr.serverHandoffComplete=!0)},[]),r}var ki=y.createContext(!1);function js(){return y.useContext(ki)}function Tn(e){return b(ki.Provider,{value:e.force,children:e.children})}function Fs(){var e=js(),r=y.useContext(Ei),t=y.useState(function(){if(!e&&r!==null||typeof window=="undefined")return null;var a=document.getElementById("headlessui-portal-root");if(a)return a;var o=document.createElement("div");return o.setAttribute("id","headlessui-portal-root"),document.body.appendChild(o)}),i=t[0],n=t[1];return y.useEffect(function(){i!==null&&(document.body.contains(i)||document.body.appendChild(i))},[i]),y.useEffect(function(){e||r!==null&&n(r.current)},[r,n,e]),i}var As=y.Fragment;function mr(e){var r=e,t=Fs(),i=y.useState(function(){return typeof window=="undefined"?null:document.createElement("div")}),n=i[0],a=Kt();return Ve(function(){if(!!t&&!!n)return t.appendChild(n),function(){if(!!t&&!!n&&(t.removeChild(n),t.childNodes.length<=0)){var o;(o=t.parentElement)==null||o.removeChild(t)}}},[t,n]),a?!t||!n?null:zi.createPortal(Be({props:r,defaultTag:As,name:"Portal"}),n):null}var Rs=y.Fragment,Ei=y.createContext(null);function Ts(e){var r=e.target,t=Ke(e,["target"]);return b(Ei.Provider,{value:r,children:Be({props:t,defaultTag:Rs,name:"Popover.Group"})})}mr.Group=Ts;function Li(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var i=y.useRef(r);return y.useEffect(function(){i.current=r},[r]),y.useCallback(function(n){for(var a=Se(i.current),o;!(o=a()).done;){var s=o.value;s!=null&&(typeof s=="function"?s(n):s.current=n)}},[i])}var Mt;(function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",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"})(Mt||(Mt={}));function Ms(e){for(var r,t,i=e.parentElement,n=null;i&&!(i instanceof HTMLFieldSetElement);)i instanceof HTMLLegendElement&&(n=i),i=i.parentElement;var a=(r=((t=i)==null?void 0:t.getAttribute("disabled"))==="")!=null?r:!1;return a&&Ds(n)?!1:a}function Ds(e){if(!e)return!1;for(var r=e.previousElementSibling;r!==null;){if(r instanceof HTMLLegendElement)return!1;r=r.previousElementSibling}return!0}var Is=0;function Mn(){return++Is}function Ot(){var e=Kt(),r=y.useState(e?Mn:null),t=r[0],i=r[1];return Ve(function(){t===null&&i(Mn())},[t]),t!=null?""+t:void 0}function Dt(e,r,t){var i=y.useRef(r);i.current=r,y.useEffect(function(){function n(a){i.current.call(window,a)}return window.addEventListener(e,n,t),function(){return window.removeEventListener(e,n,t)}},[e,t])}var _s=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(function(e){return e+":not([tabindex='-1'])"}).join(","),se;(function(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"})(se||(se={}));var De;(function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"})(De||(De={}));var It;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(It||(It={}));function $s(e){return e===void 0&&(e=document.body),e==null?[]:Array.from(e.querySelectorAll(_s))}var Dn;(function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"})(Dn||(Dn={}));function ct(e){e==null||e.focus({preventScroll:!0})}function In(e,r){var t=Array.isArray(e)?e.slice().sort(function(d,g){var p=d.compareDocumentPosition(g);return p&Node.DOCUMENT_POSITION_FOLLOWING?-1:p&Node.DOCUMENT_POSITION_PRECEDING?1:0}):$s(e),i=document.activeElement,n=function(){if(r&(se.First|se.Next))return It.Next;if(r&(se.Previous|se.Last))return It.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=function(){if(r&se.First)return 0;if(r&se.Previous)return Math.max(0,t.indexOf(i))-1;if(r&se.Next)return Math.max(0,t.indexOf(i))+1;if(r&se.Last)return t.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),o=r&se.NoScroll?{preventScroll:!0}:{},s=0,u=t.length,c=void 0;do{var f;if(s>=u||s+u<=0)return De.Error;var l=a+s;if(r&se.WrapAround)l=(l+u)%u;else{if(l<0)return De.Underflow;if(l>=u)return De.Overflow}c=t[l],(f=c)==null||f.focus(o),s+=n}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),De.Success}function ji(){var e=y.useRef(!1);return y.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e}var Ce;(function(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"})(Ce||(Ce={}));function Vs(e,r,t){r===void 0&&(r=Ce.All);var i=t===void 0?{}:t,n=i.initialFocus,a=i.containers,o=y.useRef(typeof window!="undefined"?document.activeElement:null),s=y.useRef(null),u=ji(),c=Boolean(r&Ce.RestoreFocus),f=Boolean(r&Ce.InitialFocus);y.useEffect(function(){!c||(o.current=document.activeElement)},[c]),y.useEffect(function(){if(!!c)return function(){ct(o.current),o.current=null}},[c]),y.useEffect(function(){if(!!f&&!!e.current){var l=document.activeElement;if(n==null?void 0:n.current){if((n==null?void 0:n.current)===l){s.current=l;return}}else if(e.current.contains(l)){s.current=l;return}(n==null?void 0:n.current)?ct(n.current):In(e.current,se.First)===De.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=document.activeElement}},[e,n,f]),Dt("keydown",function(l){!(r&Ce.TabLock)||!e.current||l.key===Mt.Tab&&(l.preventDefault(),In(e.current,(l.shiftKey?se.Previous:se.Next)|se.WrapAround)===De.Success&&(s.current=document.activeElement))}),Dt("focus",function(l){if(!!(r&Ce.FocusLock)){var d=new Set(a==null?void 0:a.current);if(d.add(e),!!d.size){var g=s.current;if(!!g&&!!u.current){var p=l.target;p&&p instanceof HTMLElement?Us(d,p)?(s.current=p,ct(p)):(l.preventDefault(),l.stopPropagation(),ct(g)):ct(s.current)}}}},!0)}function Us(e,r){for(var t=Se(e),i;!(i=t()).done;){var n,a=i.value;if((n=a.current)==null?void 0:n.contains(r))return!0}return!1}var Ze=new Set,Me=new Map;function _n(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function $n(e){var r=Me.get(e);!r||(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert)}function Hs(e,r){r===void 0&&(r=!0),Ve(function(){if(!!r&&!!e.current){var t=e.current;Ze.add(t);for(var i=Se(Me.keys()),n;!(n=i()).done;){var a=n.value;a.contains(t)&&($n(a),Me.delete(a))}return document.querySelectorAll("body > *").forEach(function(o){if(o instanceof HTMLElement){for(var s=Se(Ze),u;!(u=s()).done;){var c=u.value;if(o.contains(c))return}Ze.size===1&&(Me.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),_n(o))}}),function(){if(Ze.delete(t),Ze.size>0)document.querySelectorAll("body > *").forEach(function(c){if(c instanceof HTMLElement&&!Me.has(c)){for(var f=Se(Ze),l;!(l=f()).done;){var d=l.value;if(c.contains(d))return}Me.set(c,{"aria-hidden":c.getAttribute("aria-hidden"),inert:c.inert}),_n(c)}});else for(var o=Se(Me.keys()),s;!(s=o()).done;){var u=s.value;$n(u),Me.delete(u)}}}},[r])}var Fi=y.createContext(null);function Ai(){var e=y.useContext(Fi);if(e===null){var r=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Ai),r}return e}function Bs(){var e=y.useState([]),r=e[0],t=e[1];return[r.length>0?r.join(" "):void 0,y.useMemo(function(){return function(n){var a=y.useCallback(function(s){return t(function(u){return[].concat(u,[s])}),function(){return t(function(u){var c=u.slice(),f=c.indexOf(s);return f!==-1&&c.splice(f,1),c})}},[]),o=y.useMemo(function(){return{register:a,slot:n.slot,name:n.name,props:n.props}},[a,n.slot,n.name,n.props]);return b(Fi.Provider,{value:o,children:n.children})}},[t])]}var Ws="p";function zs(e){var r=Ai(),t="headlessui-description-"+Ot();Ve(function(){return r.register(t)},[t,r.register]);var i=e,n=we({},r.props,{id:t});return Be({props:we({},i,n),slot:r.slot||{},defaultTag:Ws,name:r.name||"Description"})}var Pr=y.createContext(null);Pr.displayName="OpenClosedContext";var Fe;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(Fe||(Fe={}));function Nr(){return y.useContext(Pr)}function qs(e){var r=e.value,t=e.children;return b(Pr.Provider,{value:r,children:t})}var kr=y.createContext(function(){});kr.displayName="StackContext";var rt;(function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"})(rt||(rt={}));function Gs(){return y.useContext(kr)}function Ks(e){var r=e.children,t=e.onUpdate,i=e.type,n=e.element,a=Gs(),o=y.useCallback(function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];t==null||t.apply(void 0,u),a.apply(void 0,u)},[a,t]);return Ve(function(){return o(rt.Add,i,n),function(){return o(rt.Remove,i,n)}},[o,i,n]),b(kr.Provider,{value:o,children:r})}var cr,ce;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(ce||(ce={}));var _t;(function(e){e[e.SetTitleId=0]="SetTitleId"})(_t||(_t={}));var Qs=(cr={},cr[_t.SetTitleId]=function(e,r){return e.titleId===r.id?e:we({},e,{titleId:r.id})},cr),$t=y.createContext(null);$t.displayName="DialogContext";function Er(e){var r=y.useContext($t);if(r===null){var t=new Error("<"+e+" /> is missing a parent <"+pt.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Er),t}return r}function Js(e,r){return ke(r.type,Qs,e,r)}var Ys="div",Zs=$e.RenderStrategy|$e.Static,Xs=Ni(function(r,t){var i=r.open,n=r.onClose,a=r.initialFocus,o=Ke(r,["open","onClose","initialFocus"]),s=y.useState(0),u=s[0],c=s[1],f=Nr();if(i===void 0&&f!==null){var l;i=ke(f,(l={},l[Fe.Open]=!0,l[Fe.Closed]=!1,l))}var d=y.useRef(new Set),g=y.useRef(null),p=Li(g,t),O=r.hasOwnProperty("open")||f!==null,w=r.hasOwnProperty("onClose");if(!O&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!O)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)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 n!="function")throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+n);var v=i?ce.Open:ce.Closed,P=function(){return f!==null?f===Fe.Open:v===ce.Open}(),C=y.useReducer(Js,{titleId:null,descriptionId:null}),N=C[0],M=C[1],R=y.useCallback(function(){return n(!1)},[n]),T=y.useCallback(function(I){return M({type:_t.SetTitleId,id:I})},[M]),$=Kt(),D=$&&v===ce.Open,E=u>1,F=y.useContext($t)!==null,_=E?"parent":"leaf";Vs(g,D?ke(_,{parent:Ce.RestoreFocus,leaf:Ce.All}):Ce.None,{initialFocus:a,containers:d}),Hs(g,E?D:!1),Dt("mousedown",function(I){var H,ne=I.target;v===ce.Open&&(E||((H=g.current)==null?void 0:H.contains(ne))||R())}),Dt("keydown",function(I){I.key===Mt.Escape&&v===ce.Open&&(E||(I.preventDefault(),I.stopPropagation(),R()))}),y.useEffect(function(){if(v===ce.Open&&!F){var I=document.documentElement.style.overflow,H=document.documentElement.style.paddingRight,ne=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=ne+"px",function(){document.documentElement.style.overflow=I,document.documentElement.style.paddingRight=H}}},[v,F]),y.useEffect(function(){if(v===ce.Open&&!!g.current){var I=new IntersectionObserver(function(H){for(var ne=Se(H),J;!(J=ne()).done;){var q=J.value;q.boundingClientRect.x===0&&q.boundingClientRect.y===0&&q.boundingClientRect.width===0&&q.boundingClientRect.height===0&&R()}});return I.observe(g.current),function(){return I.disconnect()}}},[v,g,R]);var B=Bs(),U=B[0],Y=B[1],X="headlessui-dialog-"+Ot(),W=y.useMemo(function(){return[{dialogState:v,close:R,setTitleId:T},N]},[v,N,R,T]),Q=y.useMemo(function(){return{open:v===ce.Open}},[v]),ee={ref:p,id:X,role:"dialog","aria-modal":v===ce.Open?!0:void 0,"aria-labelledby":N.titleId,"aria-describedby":U,onClick:function(H){H.stopPropagation()}},te=o;return b(Ks,{type:"Dialog",element:g,onUpdate:y.useCallback(function(I,H,ne){var J;H==="Dialog"&&ke(I,(J={},J[rt.Add]=function(){d.current.add(ne),c(function(q){return q+1})},J[rt.Remove]=function(){d.current.add(ne),c(function(q){return q-1})},J))},[]),children:b(Tn,{force:!0,children:b(mr,{children:b($t.Provider,{value:W,children:b(mr.Group,{target:g,children:b(Tn,{force:!1,children:b(Y,{slot:Q,name:"Dialog.Description",children:Be({props:we({},te,ee),slot:Q,defaultTag:Ys,features:Zs,visible:P,name:"Dialog"})})})})})})})})}),eu="div",tu=Ni(function e(r,t){var i=Er([pt.displayName,e.name].join(".")),n=i[0],a=n.dialogState,o=n.close,s=Li(t),u="headlessui-dialog-overlay-"+Ot(),c=y.useCallback(function(g){if(g.target===g.currentTarget){if(Ms(g.currentTarget))return g.preventDefault();g.preventDefault(),g.stopPropagation(),o()}},[o]),f=y.useMemo(function(){return{open:a===ce.Open}},[a]),l={ref:s,id:u,"aria-hidden":!0,onClick:c},d=r;return Be({props:we({},d,l),slot:f,defaultTag:eu,name:"Dialog.Overlay"})}),ru="h2";function Ri(e){var r=Er([pt.displayName,Ri.name].join(".")),t=r[0],i=t.dialogState,n=t.setTitleId,a="headlessui-dialog-title-"+Ot();y.useEffect(function(){return n(a),function(){return n(null)}},[a,n]);var o=y.useMemo(function(){return{open:i===ce.Open}},[i]),s={id:a},u=e;return Be({props:we({},u,s),slot:o,defaultTag:ru,name:"Dialog.Title"})}var pt=Object.assign(Xs,{Overlay:tu,Title:Ri,Description:zs});function Ti(){var e=[],r={requestAnimationFrame:function(t){function i(){return t.apply(this,arguments)}return i.toString=function(){return t.toString()},i}(function(){var t=requestAnimationFrame.apply(void 0,arguments);r.add(function(){return cancelAnimationFrame(t)})}),nextFrame:function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];r.requestAnimationFrame(function(){r.requestAnimationFrame.apply(r,n)})},setTimeout:function(t){function i(){return t.apply(this,arguments)}return i.toString=function(){return t.toString()},i}(function(){var t=setTimeout.apply(void 0,arguments);r.add(function(){return clearTimeout(t)})}),add:function(i){e.push(i)},dispose:function(){for(var i=Se(e.splice(0)),n;!(n=i()).done;){var a=n.value;a()}}};return r}function nu(){var e=y.useRef(!0);return y.useEffect(function(){e.current=!1},[]),e.current}function iu(e){var r={called:!1};return function(){if(!r.called)return r.called=!0,e.apply(void 0,arguments)}}function fr(e){for(var r,t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];e&&i.length>0&&(r=e.classList).add.apply(r,i)}function kt(e){for(var r,t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];e&&i.length>0&&(r=e.classList).remove.apply(r,i)}var Ue;(function(e){e.Finished="finished",e.Cancelled="cancelled"})(Ue||(Ue={}));function au(e,r){var t=Ti();if(!e)return t.dispose;var i=getComputedStyle(e),n=i.transitionDuration,a=i.transitionDelay,o=[n,a].map(function(c){var f=c.split(",").filter(Boolean).map(function(g){return g.includes("ms")?parseFloat(g):parseFloat(g)*1e3}).sort(function(g,p){return p-g}),l=f[0],d=l===void 0?0:l;return d}),s=o[0],u=o[1];return s!==0?t.setTimeout(function(){r(Ue.Finished)},s+u):r(Ue.Finished),t.add(function(){return r(Ue.Cancelled)}),t.dispose}function Vn(e,r,t,i,n,a){var o=Ti(),s=a!==void 0?iu(a):function(){};return kt.apply(void 0,[e].concat(n)),fr.apply(void 0,[e].concat(r,t)),o.nextFrame(function(){kt.apply(void 0,[e].concat(t)),fr.apply(void 0,[e].concat(i)),o.add(au(e,function(u){return kt.apply(void 0,[e].concat(i,r)),fr.apply(void 0,[e].concat(n)),s(u)}))}),o.add(function(){return kt.apply(void 0,[e].concat(r,t,i,n))}),o.add(function(){return s(Ue.Cancelled)}),o.dispose}function ze(e){return e===void 0&&(e=""),y.useMemo(function(){return e.split(" ").filter(function(r){return r.trim().length>1})},[e])}var Qt=y.createContext(null);Qt.displayName="TransitionContext";var K;(function(e){e.Visible="visible",e.Hidden="hidden"})(K||(K={}));function ou(){var e=y.useContext(Qt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function su(){var e=y.useContext(Jt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}var Jt=y.createContext(null);Jt.displayName="NestingContext";function Yt(e){return"children"in e?Yt(e.children):e.current.filter(function(r){var t=r.state;return t===K.Visible}).length>0}function Mi(e){var r=y.useRef(e),t=y.useRef([]),i=ji();y.useEffect(function(){r.current=e},[e]);var n=y.useCallback(function(o,s){var u;s===void 0&&(s=pe.Hidden);var c=t.current.findIndex(function(f){var l=f.id;return l===o});c!==-1&&(ke(s,(u={},u[pe.Unmount]=function(){t.current.splice(c,1)},u[pe.Hidden]=function(){t.current[c].state=K.Hidden},u)),!Yt(t)&&i.current&&(r.current==null||r.current()))},[r,i,t]),a=y.useCallback(function(o){var s=t.current.find(function(u){var c=u.id;return c===o});return s?s.state!==K.Visible&&(s.state=K.Visible):t.current.push({id:o,state:K.Visible}),function(){return n(o,pe.Unmount)}},[t,n]);return y.useMemo(function(){return{children:t,register:a,unregister:n}},[a,n,t])}function uu(){}var lu=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Un(e){for(var r={},t=Se(lu),i;!(i=t()).done;){var n,a=i.value;r[a]=(n=e[a])!=null?n:uu}return r}function cu(e){var r=y.useRef(Un(e));return y.useEffect(function(){r.current=Un(e)},[e]),r}var fu="div",Di=$e.RenderStrategy;function Ii(e){var r,t=e.beforeEnter,i=e.afterEnter,n=e.beforeLeave,a=e.afterLeave,o=e.enter,s=e.enterFrom,u=e.enterTo,c=e.entered,f=e.leave,l=e.leaveFrom,d=e.leaveTo,g=Ke(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"]),p=y.useRef(null),O=y.useState(K.Visible),w=O[0],v=O[1],P=g.unmount?pe.Unmount:pe.Hidden,C=ou(),N=C.show,M=C.appear,R=C.initial,T=su(),$=T.register,D=T.unregister,E=Ot(),F=y.useRef(!1),_=Mi(function(){F.current||(v(K.Hidden),D(E),te.current.afterLeave())});Ve(function(){if(!!E)return $(E)},[$,E]),Ve(function(){var q;if(P===pe.Hidden&&!!E){if(N&&w!==K.Visible){v(K.Visible);return}ke(w,(q={},q[K.Hidden]=function(){return D(E)},q[K.Visible]=function(){return $(E)},q))}},[w,E,$,D,N,P]);var B=ze(o),U=ze(s),Y=ze(u),X=ze(c),W=ze(f),Q=ze(l),ee=ze(d),te=cu({beforeEnter:t,afterEnter:i,beforeLeave:n,afterLeave:a}),I=Kt();y.useEffect(function(){if(I&&w===K.Visible&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,w,I]);var H=R&&!M;Ve(function(){var q=p.current;if(!!q&&!H)return F.current=!0,N&&te.current.beforeEnter(),N||te.current.beforeLeave(),N?Vn(q,B,U,Y,X,function(Ae){F.current=!1,Ae===Ue.Finished&&te.current.afterEnter()}):Vn(q,W,Q,ee,X,function(Ae){F.current=!1,Ae===Ue.Finished&&(Yt(_)||(v(K.Hidden),D(E),te.current.afterLeave()))})},[te,E,F,D,_,p,H,N,B,U,Y,W,Q,ee]);var ne={ref:p},J=g;return b(Jt.Provider,{value:_,children:b(qs,{value:ke(w,(r={},r[K.Visible]=Fe.Open,r[K.Hidden]=Fe.Closed,r)),children:Be({props:we({},J,ne),defaultTag:fu,features:Di,visible:w===K.Visible,name:"Transition.Child"})})})}function Ge(e){var r=e.show,t=e.appear,i=t===void 0?!1:t,n=e.unmount,a=Ke(e,["show","appear","unmount"]),o=Nr();if(r===void 0&&o!==null){var s;r=ke(o,(s={},s[Fe.Open]=!0,s[Fe.Closed]=!1,s))}if(![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var u=y.useState(r?K.Visible:K.Hidden),c=u[0],f=u[1],l=Mi(function(){f(K.Hidden)}),d=nu(),g=y.useMemo(function(){return{show:r,appear:i||!d,initial:d}},[r,i,d]);y.useEffect(function(){r?f(K.Visible):Yt(l)||f(K.Hidden)},[r,l]);var p={unmount:n};return b(Jt.Provider,{value:l,children:b(Qt.Provider,{value:g,children:Be({props:we({},p,{as:y.Fragment,children:b(Ii,ue({},Object.assign({},p,a)))}),defaultTag:y.Fragment,features:Di,visible:c===K.Visible,name:"Transition"})})})}Ge.Child=function(r){var t=y.useContext(Qt)!==null,i=Nr()!==null;return!t&&i?b(Ge,ue({},Object.assign({},r))):b(Ii,ue({},Object.assign({},r)))};Ge.Root=Ge;function du(e){const{children:r,isModalOpen:t,handleCloseModal:i}=e,{isMobile:n}=Ci({isModal:!0});return b(nt,{children:b(Ge,{appear:!0,show:t,as:y.Fragment,children:b(pt,{as:"div",className:"overflow-y-auto fixed inset-0 z-10",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:i,children:V("div",{className:"min-h-screen text-center sm:px-4",children:[b(Ge.Child,{as:y.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:b(pt.Overlay,{className:"fixed inset-0"})}),b("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),b(Ge.Child,{as:y.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 transform bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[b("div",{className:"flex sticky top-0 z-10 items-center px-3 w-full h-14 text-lg font-medium leading-6 text-gray-900 bg-white modal-header",children:b("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:i,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",b("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",b("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),b("div",{className:"w-full",style:{height:`${n?"calc(100% - 56px)":"auto"}`},children:r})]})})]})})})})}function gu(e){const{product:r,primaryColor:t,lang:i="en",handleAddToBasket:n,handleGoBack:a,isModal:o=!1,isModalOpen:s=!0,showDebugState:u=!1,handleCloseModal:c=()=>alert("ERROR: handleCloseModal not implemented")}=e,f=re(v=>v.setInitialFilter),l=re(v=>v.setInitialSelectedState),d=re(v=>v.setInitialValidate),g=xi(r,Ss),{state:{filter:p={},selected:O={}}={}}=g;y.useEffect(()=>{console.log("cleared"),d(),f(p),l(O),oe.changeLanguage(i)},[r]),y.useEffect(()=>{console.log("lang: ",i),oe.changeLanguage(i)},[i]),y.useEffect(()=>{t&&document.documentElement.style.setProperty("--color-primary",t)},[t]);const w=b(Ns,{product:g,handleAddToBasket:n,handleGoBack:a,isModal:o,showDebugState:u});return b(nt,{children:o===!0?b(du,{isModalOpen:s,handleCloseModal:c,children:w}):w})}exports.ProductConfigurator=gu;
19
19
  //# sourceMappingURL=index.cjs.js.map