@bikematrix/web-components 1.1.48 → 1.1.49
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/bm_core.es.js +10 -7
- package/dist/bm_core.js +3 -3
- package/dist/bm_core.umd.js +3 -3
- package/package.json +1 -1
package/dist/bm_core.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(Mr,fe){typeof exports=="object"&&typeof module<"u"?module.exports=fe():typeof define=="function"&&define.amd?define(fe):(Mr=typeof globalThis<"u"?globalThis:Mr||self,Mr.BikeMatrix=fe())})(this,function(){"use strict";var Mr,fe,Vc,qc,Tn,Jc,Uc,Ms,Kc,ea={},_c=[],o1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ro=Array.isArray;function Wr(n,e){for(var t in e)n[t]=e[t];return n}function $c(n){var e=n.parentNode;e&&e.removeChild(n)}function te(n,e,t){var r,i,o,l={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:l[o]=e[o];if(arguments.length>2&&(l.children=arguments.length>3?Mr.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(o in n.defaultProps)l[o]===void 0&&(l[o]=n.defaultProps[o]);return ta(n,l,r,i,null)}function ta(n,e,t,r,i){var o={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Vc,__i:-1,__u:0};return i==null&&fe.vnode!=null&&fe.vnode(o),o}function s1(){return{current:null}}function ie(n){return n.children}function pr(n,e){this.props=n,this.context=e}function si(n,e){if(e==null)return n.__?si(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?si(n):null}function ed(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return ed(n)}}function Ws(n){(!n.__d&&(n.__d=!0)&&Tn.push(n)&&!no.__r++||Jc!==fe.debounceRendering)&&((Jc=fe.debounceRendering)||Uc)(no)}function no(){var n,e,t,r,i,o,l,u,c;for(Tn.sort(Ms);n=Tn.shift();)n.__d&&(e=Tn.length,r=void 0,o=(i=(t=n).__v).__e,u=[],c=[],(l=t.__P)&&((r=Wr({},i)).__v=i.__v+1,fe.vnode&&fe.vnode(r),Zs(l,r,i,t.__n,l.ownerSVGElement!==void 0,32&i.__u?[o]:null,u,o??si(i),!!(32&i.__u),c),r.__v=i.__v,r.__.__k[r.__i]=r,od(u,r,c),r.__e!=o&&ed(r)),Tn.length>e&&Tn.sort(Ms));no.__r=0}function td(n,e,t,r,i,o,l,u,c,f,p){var h,b,m,P,x,A=r&&r.__k||_c,z=e.length;for(t.__d=c,l1(t,e,A),c=t.__d,h=0;h<z;h++)(m=t.__k[h])!=null&&typeof m!="boolean"&&typeof m!="function"&&(b=m.__i===-1?ea:A[m.__i]||ea,m.__i=h,Zs(n,m,b,i,o,l,u,c,f,p),P=m.__e,m.ref&&b.ref!=m.ref&&(b.ref&&Ys(b.ref,null,m),p.push(m.ref,m.__c||P,m)),x==null&&P!=null&&(x=P),65536&m.__u||b.__k===m.__k?c=rd(m,c,n):typeof m.type=="function"&&m.__d!==void 0?c=m.__d:P&&(c=P.nextSibling),m.__d=void 0,m.__u&=-196609);t.__d=c,t.__e=x}function l1(n,e,t){var r,i,o,l,u,c=e.length,f=t.length,p=f,h=0;for(n.__k=[],r=0;r<c;r++)l=r+h,(i=n.__k[r]=(i=e[r])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?ta(null,i,null,null,null):ro(i)?ta(ie,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?ta(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=n,i.__b=n.__b+1,u=u1(i,t,l,p),i.__i=u,o=null,u!==-1&&(p--,(o=t[u])&&(o.__u|=131072)),o==null||o.__v===null?(u==-1&&h--,typeof i.type!="function"&&(i.__u|=65536)):u!==l&&(u===l+1?h++:u>l?p>c-l?h+=u-l:h--:u<l?u==l-1&&(h=u-l):h=0,u!==r+h&&(i.__u|=65536))):(o=t[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==n.__d&&(n.__d=si(o)),Fs(o,o,!1),t[l]=null,p--);if(p)for(r=0;r<f;r++)(o=t[r])!=null&&!(131072&o.__u)&&(o.__e==n.__d&&(n.__d=si(o)),Fs(o,o))}function rd(n,e,t){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=rd(r[i],e,t));return e}n.__e!=e&&(t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Zr(n,e){return e=e||[],n==null||typeof n=="boolean"||(ro(n)?n.some(function(t){Zr(t,e)}):e.push(n)),e}function u1(n,e,t,r){var i=n.key,o=n.type,l=t-1,u=t+1,c=e[t];if(c===null||c&&i==c.key&&o===c.type&&!(131072&c.__u))return t;if(r>(c!=null&&!(131072&c.__u)?1:0))for(;l>=0||u<e.length;){if(l>=0){if((c=e[l])&&!(131072&c.__u)&&i==c.key&&o===c.type)return l;l--}if(u<e.length){if((c=e[u])&&!(131072&c.__u)&&i==c.key&&o===c.type)return u;u++}}return-1}function nd(n,e,t){e[0]==="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||o1.test(e)?t:t+"px"}function io(n,e,t,r,i){var o;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||nd(n.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||nd(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+o]=t,t?r?t.u=r.u:(t.u=Date.now(),n.addEventListener(e,o?ad:id,o)):n.removeEventListener(e,o?ad:id,o);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?n.removeAttribute(e):n.setAttribute(e,t))}}function id(n){if(this.l){var e=this.l[n.type+!1];if(n.t){if(n.t<=e.u)return}else n.t=Date.now();return e(fe.event?fe.event(n):n)}}function ad(n){if(this.l)return this.l[n.type+!0](fe.event?fe.event(n):n)}function Zs(n,e,t,r,i,o,l,u,c,f){var p,h,b,m,P,x,A,z,w,k,D,O,B,L,T,X=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(c=!!(32&t.__u),o=[u=e.__e=t.__e]),(p=fe.__b)&&p(e);e:if(typeof X=="function")try{if(z=e.props,w=(p=X.contextType)&&r[p.__c],k=p?w?w.props.value:p.__:r,t.__c?A=(h=e.__c=t.__c).__=h.__E:("prototype"in X&&X.prototype.render?e.__c=h=new X(z,k):(e.__c=h=new pr(z,k),h.constructor=X,h.render=d1),w&&w.sub(h),h.props=z,h.state||(h.state={}),h.context=k,h.__n=r,b=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),X.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Wr({},h.__s)),Wr(h.__s,X.getDerivedStateFromProps(z,h.__s))),m=h.props,P=h.state,h.__v=e,b)X.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(X.getDerivedStateFromProps==null&&z!==m&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(z,k),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(z,h.__s,k)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(h.props=z,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(Z){Z&&(Z.__=e)}),D=0;D<h._sb.length;D++)h.__h.push(h._sb[D]);h._sb=[],h.__h.length&&l.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(z,h.__s,k),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(m,P,x)})}if(h.context=k,h.props=z,h.__P=n,h.__e=!1,O=fe.__r,B=0,"prototype"in X&&X.prototype.render){for(h.state=h.__s,h.__d=!1,O&&O(e),p=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do h.__d=!1,O&&O(e),p=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++B<25);h.state=h.__s,h.getChildContext!=null&&(r=Wr(Wr({},r),h.getChildContext())),b||h.getSnapshotBeforeUpdate==null||(x=h.getSnapshotBeforeUpdate(m,P)),td(n,ro(T=p!=null&&p.type===ie&&p.key==null?p.props.children:p)?T:[T],e,t,r,i,o,l,u,c,f),h.base=e.__e,e.__u&=-161,h.__h.length&&l.push(h),A&&(h.__E=h.__=null)}catch(Z){e.__v=null,c||o!=null?(e.__e=u,e.__u|=c?160:32,o[o.indexOf(u)]=null):(e.__e=t.__e,e.__k=t.__k),fe.__e(Z,e,t)}else o==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=c1(t.__e,e,t,r,i,o,l,c,f);(p=fe.diffed)&&p(e)}function od(n,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)Ys(t[r],t[++r],t[++r]);fe.__c&&fe.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(o){o.call(i)})}catch(o){fe.__e(o,i.__v)}})}function c1(n,e,t,r,i,o,l,u,c){var f,p,h,b,m,P,x,A=t.props,z=e.props,w=e.type;if(w==="svg"&&(i=!0),o!=null){for(f=0;f<o.length;f++)if((m=o[f])&&"setAttribute"in m==!!w&&(w?m.localName===w:m.nodeType===3)){n=m,o[f]=null;break}}if(n==null){if(w===null)return document.createTextNode(z);n=i?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,z.is&&z),o=null,u=!1}if(w===null)A===z||u&&n.data===z||(n.data=z);else{if(o=o&&Mr.call(n.childNodes),A=t.props||ea,!u&&o!=null)for(A={},f=0;f<n.attributes.length;f++)A[(m=n.attributes[f]).name]=m.value;for(f in A)m=A[f],f=="children"||(f=="dangerouslySetInnerHTML"?h=m:f==="key"||f in z||io(n,f,null,m,i));for(f in z)m=z[f],f=="children"?b=m:f=="dangerouslySetInnerHTML"?p=m:f=="value"?P=m:f=="checked"?x=m:f==="key"||u&&typeof m!="function"||A[f]===m||io(n,f,m,A[f],i);if(p)u||h&&(p.__html===h.__html||p.__html===n.innerHTML)||(n.innerHTML=p.__html),e.__k=[];else if(h&&(n.innerHTML=""),td(n,ro(b)?b:[b],e,t,r,i&&w!=="foreignObject",o,l,o?o[0]:t.__k&&si(t,0),u,c),o!=null)for(f=o.length;f--;)o[f]!=null&&$c(o[f]);u||(f="value",P!==void 0&&(P!==n[f]||w==="progress"&&!P||w==="option"&&P!==A[f])&&io(n,f,P,A[f],!1),f="checked",x!==void 0&&x!==n[f]&&io(n,f,x,A[f],!1))}return n}function Ys(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(r){fe.__e(r,t)}}function Fs(n,e,t){var r,i;if(fe.unmount&&fe.unmount(n),(r=n.ref)&&(r.current&&r.current!==n.__e||Ys(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){fe.__e(o,e)}r.base=r.__P=null,n.__c=void 0}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&Fs(r[i],e,t||typeof n.type!="function");t||n.__e==null||$c(n.__e),n.__=n.__e=n.__d=void 0}function d1(n,e,t){return this.constructor(n,t)}function cn(n,e,t){var r,i,o,l;fe.__&&fe.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,o=[],l=[],Zs(e,n=(!r&&t||e).__k=te(ie,null,[n]),i||ea,ea,e.ownerSVGElement!==void 0,!r&&t?[t]:i?null:e.firstChild?Mr.call(e.childNodes):null,o,!r&&t?t:i?i.__e:e.firstChild,r,l),od(o,n,l)}function Ns(n,e){cn(n,e,Ns)}function Rs(n,e,t){var r,i,o,l,u=Wr({},n.props);for(o in n.type&&n.type.defaultProps&&(l=n.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?i=e[o]:u[o]=e[o]===void 0&&l!==void 0?l[o]:e[o];return arguments.length>2&&(u.children=arguments.length>3?Mr.call(arguments,2):t),ta(n.type,u,r||n.key,i||n.ref,null)}function ra(n,e){var t={__c:e="__cC"+Kc++,__:n,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&i.some(function(u){u.__e=!0,Ws(u)})},this.sub=function(l){i.push(l);var u=l.componentWillUnmount;l.componentWillUnmount=function(){i.splice(i.indexOf(l),1),u&&u.call(l)}}),r.children}};return t.Provider.__=t.Consumer.contextType=t}Mr=_c.slice,fe={__e:function(n,e,t,r){for(var i,o,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(n)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),l=i.__d),l)return i.__E=i}catch(u){n=u}throw n}},Vc=0,qc=function(n){return n!=null&&n.constructor==null},pr.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Wr({},this.state),typeof n=="function"&&(n=n(Wr({},t),this.props)),n&&Wr(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),Ws(this))},pr.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Ws(this))},pr.prototype.render=ie,Tn=[],Uc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ms=function(n,e){return n.__v.__b-e.__v.__b},no.__r=0,Kc=0;function Gs(){return(Gs=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n}).apply(this,arguments)}var f1=["context","children"];function p1(n){this.getChildContext=function(){return n.context};var e=n.children,t=function(r,i){if(r==null)return{};var o,l,u={},c=Object.keys(r);for(l=0;l<c.length;l++)i.indexOf(o=c[l])>=0||(u[o]=r[o]);return u}(n,f1);return Rs(e,t)}function h1(){var n=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(n),this._vdom=te(p1,Gs({},this._props,{context:n.detail.context}),function e(t,r){if(t.nodeType===3)return t.data;if(t.nodeType!==1)return null;var i=[],o={},l=0,u=t.attributes,c=t.childNodes;for(l=u.length;l--;)u[l].name!=="slot"&&(o[u[l].name]=u[l].value,o[sd(u[l].name)]=u[l].value);for(l=c.length;l--;){var f=e(c[l],null),p=c[l].slot;p?o[p]=te(ld,{name:p},f):i[l]=f}var h=r?te(ld,null,i):i;return te(r||t.nodeName.toLowerCase(),o,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ns:cn)(this._vdom,this._root)}function sd(n){return n.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function v1(n,e,t){if(this._vdom){var r={};r[n]=t=t??void 0,r[sd(n)]=t,this._vdom=Rs(this._vdom,r),cn(this._vdom,this._root)}}function g1(){cn(this._vdom=null,this._root)}function ld(n,e){var t=this;return te("slot",Gs({},n,{ref:function(r){r?(t.ref=r,t._listener||(t._listener=function(i){i.stopPropagation(),i.detail.context=e},r.addEventListener("_preact",t._listener))):t.ref.removeEventListener("_preact",t._listener)}}))}function b1(n,e,t,r){function i(){var o=Reflect.construct(HTMLElement,[],i);return o._vdomComponent=n,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=h1,i.prototype.attributeChangedCallback=v1,i.prototype.disconnectedCallback=g1,t=t||n.observedAttributes||Object.keys(n.propTypes||{}),i.observedAttributes=t,t.forEach(function(o){Object.defineProperty(i.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var u=typeof l;l!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(o,l)}})}),customElements.define(e||n.tagName||n.displayName||n.name,i)}var dn,Ze,Qs,ud,li=0,cd=[],ao=[],Qe=fe,dd=Qe.__b,fd=Qe.__r,pd=Qe.diffed,hd=Qe.__c,vd=Qe.unmount,gd=Qe.__;function ui(n,e){Qe.__h&&Qe.__h(Ze,n,li||e),li=0;var t=Ze.__H||(Ze.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({__V:ao}),t.__[n]}function K(n){return li=1,bd(wd,n)}function bd(n,e,t){var r=ui(dn++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):wd(void 0,e),function(u){var c=r.__N?r.__N[0]:r.__[0],f=r.t(c,u);c!==f&&(r.__N=[f,r.__[1]],r.__c.setState({}))}],r.__c=Ze,!Ze.u)){var i=function(u,c,f){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(b){return!!b.__c});if(p.every(function(b){return!b.__N}))return!o||o.call(this,u,c,f);var h=!1;return p.forEach(function(b){if(b.__N){var m=b.__[0];b.__=b.__N,b.__N=void 0,m!==b.__[0]&&(h=!0)}}),!(!h&&r.__c.props===u)&&(!o||o.call(this,u,c,f))};Ze.u=!0;var o=Ze.shouldComponentUpdate,l=Ze.componentWillUpdate;Ze.componentWillUpdate=function(u,c,f){if(this.__e){var p=o;o=void 0,i(u,c,f),o=p}l&&l.call(this,u,c,f)},Ze.shouldComponentUpdate=i}return r.__N||r.__}function oe(n,e){var t=ui(dn++,3);!Qe.__s&&Js(t.__H,e)&&(t.__=n,t.i=e,Ze.__H.__h.push(t))}function ci(n,e){var t=ui(dn++,4);!Qe.__s&&Js(t.__H,e)&&(t.__=n,t.i=e,Ze.__h.push(t))}function be(n){return li=5,zr(function(){return{current:n}},[])}function m1(n,e,t){li=6,ci(function(){return typeof n=="function"?(n(e()),function(){return n(null)}):n?(n.current=e(),function(){return n.current=null}):void 0},t==null?t:t.concat(n))}function zr(n,e){var t=ui(dn++,7);return Js(t.__H,e)?(t.__V=n(),t.i=e,t.__h=n,t.__V):t.__}function md(n,e){return li=8,zr(function(){return n},e)}function Vs(n){var e=Ze.context[n.__c],t=ui(dn++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(Ze)),e.props.value):n.__}function y1(n,e){Qe.useDebugValue&&Qe.useDebugValue(e?e(n):n)}function w1(){var n=ui(dn++,11);if(!n.__){for(var e=Ze.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);n.__="P"+t[0]+"-"+t[1]++}return n.__}function x1(){for(var n;n=cd.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(oo),n.__H.__h.forEach(qs),n.__H.__h=[]}catch(e){n.__H.__h=[],Qe.__e(e,n.__v)}}Qe.__b=function(n){Ze=null,dd&&dd(n)},Qe.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),gd&&gd(n,e)},Qe.__r=function(n){fd&&fd(n),dn=0;var e=(Ze=n.__c).__H;e&&(Qs===Ze?(e.__h=[],Ze.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=ao,t.__N=t.i=void 0})):(e.__h.forEach(oo),e.__h.forEach(qs),e.__h=[],dn=0)),Qs=Ze},Qe.diffed=function(n){pd&&pd(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(cd.push(e)!==1&&ud===Qe.requestAnimationFrame||((ud=Qe.requestAnimationFrame)||P1)(x1)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==ao&&(t.__=t.__V),t.i=void 0,t.__V=ao})),Qs=Ze=null},Qe.__c=function(n,e){e.some(function(t){try{t.__h.forEach(oo),t.__h=t.__h.filter(function(r){return!r.__||qs(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Qe.__e(r,t.__v)}}),hd&&hd(n,e)},Qe.unmount=function(n){vd&&vd(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{oo(r)}catch(i){e=i}}),t.__H=void 0,e&&Qe.__e(e,t.__v))};var yd=typeof requestAnimationFrame=="function";function P1(n){var e,t=function(){clearTimeout(r),yd&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);yd&&(e=requestAnimationFrame(t))}function oo(n){var e=Ze,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),Ze=e}function qs(n){var e=Ze;n.__c=n.__(),Ze=e}function Js(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function wd(n,e){return typeof e=="function"?e(n):e}function xd(n,e){for(var t in e)n[t]=e[t];return n}function Us(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function Ks(n,e){this.props=n,this.context=e}function k1(n,e){function t(i){var o=this.props.ref,l=o==i.ref;return!l&&o&&(o.call?o(null):o.current=null),e?!e(this.props,i)||!l:Us(this.props,i)}function r(i){return this.shouldComponentUpdate=t,te(n,i)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Ks.prototype=new pr).isPureReactComponent=!0,Ks.prototype.shouldComponentUpdate=function(n,e){return Us(this.props,n)||Us(this.state,e)};var Pd=fe.__b;fe.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Pd&&Pd(n)};var z1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function _s(n){function e(t){var r=xd({},t);return delete r.ref,n(r,t.ref||null)}return e.$$typeof=z1,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}var kd=function(n,e){return n==null?null:Zr(Zr(n).map(e))},C1={map:kd,forEach:kd,count:function(n){return n?Zr(n).length:0},only:function(n){var e=Zr(n);if(e.length!==1)throw"Children.only";return e[0]},toArray:Zr},A1=fe.__e;fe.__e=function(n,e,t,r){if(n.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}A1(n,e,t,r)};var zd=fe.unmount;function Cd(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=xd({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return Cd(r,e,t)})),n}function Ad(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return Ad(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function so(){this.__u=0,this.t=null,this.__b=null}function Hd(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function H1(n){var e,t,r;function i(o){if(e||(e=n()).then(function(l){t=l.default||l},function(l){r=l}),r)throw r;if(!t)throw e;return te(t,o)}return i.displayName="Lazy",i.__f=!0,i}function na(){this.u=null,this.o=null}fe.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),zd&&zd(n)},(so.prototype=new pr).__c=function(n,e){var t=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(t);var i=Hd(r.__v),o=!1,l=function(){o||(o=!0,t.__R=null,i?i(u):u())};t.__R=l;var u=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=Ad(c,c.__c.__P,c.__c.__O)}var f;for(r.setState({__a:r.__b=null});f=r.t.pop();)f.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(l,l)},so.prototype.componentWillUnmount=function(){this.t=[]},so.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Cd(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&te(ie,null,n.fallback);return i&&(i.__u&=-33),[te(ie,null,e.__a?null:n.children),i]};var Dd=function(n,e,t){if(++t[1]===t[0]&&n.o.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.o.size))for(t=n.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.u=t=t[2]}};function D1(n){return this.getChildContext=function(){return n.context},n.children}function O1(n){var e=this,t=n.i;e.componentWillUnmount=function(){cn(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),cn(te(D1,{context:e.context},n.__v),e.l)}function X1(n,e){var t=te(O1,{__v:n,i:e});return t.containerInfo=e,t}(na.prototype=new pr).__a=function(n){var e=this,t=Hd(e.__v),r=e.o.get(n);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),Dd(e,n,r)):i()};t?t(o):o()}},na.prototype.render=function(n){this.u=null,this.o=new Map;var e=Zr(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return n.children},na.prototype.componentDidUpdate=na.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(e,t){Dd(n,t,e)})};var Od=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,E1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,L1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,B1=/[A-Z0-9]/g,j1=typeof document<"u",T1=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};function I1(n,e,t){return e.__k==null&&(e.textContent=""),cn(n,e),typeof t=="function"&&t(),n?n.__c:null}function S1(n,e,t){return Ns(n,e),typeof t=="function"&&t(),n?n.__c:null}pr.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(pr.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var Xd=fe.event;function M1(){}function W1(){return this.cancelBubble}function Z1(){return this.defaultPrevented}fe.event=function(n){return Xd&&(n=Xd(n)),n.persist=M1,n.isPropagationStopped=W1,n.isDefaultPrevented=Z1,n.nativeEvent=n};var $s,Y1={enumerable:!1,configurable:!0,get:function(){return this.class}},Ed=fe.vnode;fe.vnode=function(n){typeof n.type=="string"&&function(e){var t=e.props,r=e.type,i={};for(var o in t){var l=t[o];if(!(o==="value"&&"defaultValue"in t&&l==null||j1&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var u=o.toLowerCase();o==="defaultValue"&&"value"in t&&t.value==null?o="value":o==="download"&&l===!0?l="":u==="translate"&&l==="no"?l=!1:u==="ondoubleclick"?o="ondblclick":u!=="onchange"||r!=="input"&&r!=="textarea"||T1(t.type)?u==="onfocus"?o="onfocusin":u==="onblur"?o="onfocusout":L1.test(o)?o=u:r.indexOf("-")===-1&&E1.test(o)?o=o.replace(B1,"-$&").toLowerCase():l===null&&(l=void 0):u=o="oninput",u==="oninput"&&i[o=u]&&(o="oninputCapture"),i[o]=l}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Zr(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=Zr(t.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",Y1)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(n),n.$$typeof=Od,Ed&&Ed(n)};var Ld=fe.__r;fe.__r=function(n){Ld&&Ld(n),$s=n.__c};var Bd=fe.diffed;fe.diffed=function(n){Bd&&Bd(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),$s=null};var F1={ReactCurrentDispatcher:{current:{readContext:function(n){return $s.__n[n.__c].props.value}}}};function N1(n){return te.bind(null,n)}function lo(n){return!!n&&n.$$typeof===Od}function R1(n){return lo(n)&&n.type===ie}function G1(n){return lo(n)?Rs.apply(null,arguments):n}function Q1(n){return!!n.__k&&(cn(null,n),!0)}function V1(n){return n&&(n.base||n.nodeType===1&&n)||null}var q1=function(n,e){return n(e)},J1=function(n,e){return n(e)},U1=ie;function jd(n){n()}function K1(n){return n}function _1(){return[!1,jd]}var $1=ci,eg=lo;function tg(n,e){var t=e(),r=K({h:{__:t,v:e}}),i=r[0].h,o=r[1];return ci(function(){i.__=t,i.v=e,el(i)&&o({h:i})},[n,t,e]),oe(function(){return el(i)&&o({h:i}),n(function(){el(i)&&o({h:i})})},[n]),t}function el(n){var e,t,r=n.v,i=n.__;try{var o=r();return!((e=i)===(t=o)&&(e!==0||1/e==1/t)||e!=e&&t!=t)}catch{return!0}}var it={useState:K,useId:w1,useReducer:bd,useEffect:oe,useLayoutEffect:ci,useInsertionEffect:$1,useTransition:_1,useDeferredValue:K1,useSyncExternalStore:tg,startTransition:jd,useRef:be,useImperativeHandle:m1,useMemo:zr,useCallback:md,useContext:Vs,useDebugValue:y1,version:"17.0.2",Children:C1,render:I1,hydrate:S1,unmountComponentAtNode:Q1,createPortal:X1,createElement:te,createContext:ra,createFactory:N1,cloneElement:G1,createRef:s1,Fragment:ie,isValidElement:lo,isElement:eg,isFragment:R1,findDOMNode:V1,Component:pr,PureComponent:Ks,memo:k1,forwardRef:_s,flushSync:J1,unstable_batchedUpdates:q1,StrictMode:U1,Suspense:so,SuspenseList:na,lazy:H1,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:F1},fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const ng=(...n)=>{console!=null&&console.warn&&(In(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),console.warn(...n))},Td={},tl=(...n)=>{In(n[0])&&Td[n[0]]||(In(n[0])&&(Td[n[0]]=new Date),ng(...n))},Id=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},Sd=(n,e,t)=>{n.loadNamespaces(e,Id(n,t))},Md=(n,e,t,r)=>{In(t)&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,Id(n,r))},ig=(n,e,t={})=>!e.languages||!e.languages.length?(tl("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(n,{lng:t.lng,precheck:(r,i)=>{var o;if(((o=t.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,n))return!1}}),In=n=>typeof n=="string",ag=n=>typeof n=="object"&&n!==null,og=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,sg={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},lg=n=>sg[n];let rl={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:n=>n.replace(og,lg)};const ug=(n={})=>{rl={...rl,...n}},cg=()=>rl;let Wd;const dg=n=>{Wd=n},di=()=>Wd,fg={type:"3rdParty",init(n){ug(n.options.react),dg(n)}},pg=ra();class hg{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const vg=(n,e)=>{const t=be();return oe(()=>{t.current=e?t.current:n},[n,e]),t.current},Zd=(n,e,t,r)=>n.getFixedT(e,t,r),gg=(n,e,t,r)=>md(Zd(n,e,t,r),[n,e,t,r]),De=(n,e={})=>{var D,O,B,L;const{i18n:t}=e,{i18n:r,defaultNS:i}=Vs(pg)||{},o=t||r||di();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new hg),!o){tl("You will need to pass in an i18next instance by using initReactI18next");const T=(Z,W)=>In(W)?W:ag(W)&&In(W.defaultValue)?W.defaultValue:Array.isArray(Z)?Z[Z.length-1]:Z,X=[T,{},!1];return X.t=T,X.i18n={},X.ready=!1,X}(D=o.options.react)!=null&&D.wait&&tl("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...cg(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=l;let f=n||i||((O=o.options)==null?void 0:O.defaultNS);f=In(f)?[f]:f||["translation"],(L=(B=o.reportNamespaces).addUsedNamespaces)==null||L.call(B,f);const p=(o.isInitialized||o.initializedStoreOnce)&&f.every(T=>ig(T,o,l)),h=gg(o,e.lng||null,l.nsMode==="fallback"?f:f[0],c),b=()=>h,m=()=>Zd(o,e.lng||null,l.nsMode==="fallback"?f:f[0],c),[P,x]=K(b);let A=f.join();e.lng&&(A=`${e.lng}${A}`);const z=vg(A),w=be(!0);oe(()=>{const{bindI18n:T,bindI18nStore:X}=l;w.current=!0,!p&&!u&&(e.lng?Md(o,e.lng,f,()=>{w.current&&x(m)}):Sd(o,f,()=>{w.current&&x(m)})),p&&z&&z!==A&&w.current&&x(m);const Z=()=>{w.current&&x(m)};return T&&(o==null||o.on(T,Z)),X&&(o==null||o.store.on(X,Z)),()=>{w.current=!1,o&&(T==null||T.split(" ").forEach(W=>o.off(W,Z))),X&&o&&X.split(" ").forEach(W=>o.store.off(W,Z))}},[o,A]),oe(()=>{w.current&&p&&x(b)},[o,c,p]);const k=[P,o,p];if(k.t=P,k.i18n=o,k.ready=p,p||!p&&!u)return k;throw new Promise(T=>{e.lng?Md(o,e.lng,f,()=>T()):Sd(o,f,()=>T())})};var bg=Symbol.for("preact-signals");function uo(){if(pn>1)pn--;else{for(var n,e=!1;ia!==void 0;){var t=ia;for(ia=void 0,nl++;t!==void 0;){var r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&Fd(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(nl=0,pn--,e)throw n}}function mg(n){if(pn>0)return n();pn++;try{return n()}finally{uo()}}var Be=void 0,ia=void 0,pn=0,nl=0,co=0;function Yd(n){if(Be!==void 0){var e=n.n;if(e===void 0||e.t!==Be)return e={i:0,S:n,p:Be.s,n:void 0,t:Be,e:void 0,x:void 0,r:e},Be.s!==void 0&&(Be.s.n=e),Be.s=e,n.n=e,32&Be.f&&n.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Be.s,e.n=void 0,Be.s.n=e,Be.s=e),e}}function ct(n){this.v=n,this.i=0,this.n=void 0,this.t=void 0}ct.prototype.brand=bg,ct.prototype.h=function(){return!0},ct.prototype.S=function(n){this.t!==n&&n.e===void 0&&(n.x=this.t,this.t!==void 0&&(this.t.e=n),this.t=n)},ct.prototype.U=function(n){if(this.t!==void 0){var e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t)}},ct.prototype.subscribe=function(n){var e=this;return al(function(){var t=e.value,r=Be;Be=void 0;try{n(t)}finally{Be=r}})},ct.prototype.valueOf=function(){return this.value},ct.prototype.toString=function(){return this.value+""},ct.prototype.toJSON=function(){return this.value},ct.prototype.peek=function(){var n=Be;Be=void 0;try{return this.value}finally{Be=n}},Object.defineProperty(ct.prototype,"value",{get:function(){var n=Yd(this);return n!==void 0&&(n.i=this.i),this.v},set:function(n){if(n!==this.v){if(nl>100)throw new Error("Cycle detected");this.v=n,this.i++,co++,pn++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{uo()}}}});function wt(n){return new ct(n)}function Fd(n){for(var e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Nd(n){for(var e=n.s;e!==void 0;e=e.n){var t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Rd(n){for(var e=n.s,t=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):t=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}n.s=t}function fi(n){ct.call(this,void 0),this.x=n,this.s=void 0,this.g=co-1,this.f=4}(fi.prototype=new ct).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===co))return!0;if(this.g=co,this.f|=1,this.i>0&&!Fd(this))return this.f&=-2,!0;var n=Be;try{Nd(this),Be=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Be=n,Rd(this),this.f&=-2,!0},fi.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ct.prototype.S.call(this,n)},fi.prototype.U=function(n){if(this.t!==void 0&&(ct.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},fi.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(fi.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=Yd(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}});function yg(n){return new fi(n)}function Gd(n){var e=n.u;if(n.u=void 0,typeof e=="function"){pn++;var t=Be;Be=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,il(n),r}finally{Be=t,uo()}}}function il(n){for(var e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Gd(n)}function wg(n){if(Be!==this)throw new Error("Out-of-order effect");Rd(this),Be=n,this.f&=-2,8&this.f&&il(this),uo()}function aa(n){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}aa.prototype.c=function(){var n=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},aa.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Gd(this),Nd(this),pn++;var n=Be;return Be=this,wg.bind(this,n)},aa.prototype.N=function(){2&this.f||(this.f|=2,this.o=ia,ia=this)},aa.prototype.d=function(){this.f|=8,1&this.f||il(this)};function al(n){var e=new aa(n);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}var ol;function pi(n,e){fe[n]=e.bind(null,fe[n]||function(){})}function fo(n){ol&&ol(),ol=n&&n.S()}function Qd(n){var e=this,t=n.data,r=Pg(t);r.value=t;var i=zr(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var l,u=e.__$u.S(),c=i.value;u(),qc(c)||((l=e.base)==null?void 0:l.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=c},yg(function(){var l=r.value.value;return l===0?0:l===!0?"":l||""})},[]);return i.value}Qd.displayName="_st",Object.defineProperties(ct.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Qd},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),pi("__b",function(n,e){if(typeof e.type=="string"){var t,r=e.props;for(var i in r)if(i!=="children"){var o=r[i];o instanceof ct&&(t||(e.__np=t={}),t[i]=o,r[i]=o.peek())}}n(e)}),pi("__r",function(n,e){fo();var t,r=e.__c;r&&(r.__$f&=-2,(t=r.__$u)===void 0&&(r.__$u=t=function(i){var o;return al(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),fo(t),n(e)}),pi("__e",function(n,e,t,r){fo(),n(e,t,r)}),pi("diffed",function(n,e){fo();var t;if(typeof e.type=="string"&&(t=e.__e)){var r=e.__np,i=e.props;if(r){var o=t.U;if(o)for(var l in o){var u=o[l];u!==void 0&&!(l in r)&&(u.d(),o[l]=void 0)}else t.U=o={};for(var c in r){var f=o[c],p=r[c];f===void 0?(f=xg(t,c,p,i),o[c]=f):f.o(p,i)}}}n(e)});function xg(n,e,t,r){var i=e in n&&n.ownerSVGElement===void 0,o=wt(t);return{o:function(l,u){o.value=l,r=u},d:al(function(){var l=o.value.value;r[e]!==l&&(r[e]=l,i?n[e]=l:l?n.setAttribute(e,l):n.removeAttribute(e))})}}pi("unmount",function(n,e){if(typeof e.type=="string"){var t=e.__e;if(t){var r=t.U;if(r){t.U=void 0;for(var i in r){var o=r[i];o&&o.d()}}}}else{var l=e.__c;if(l){var u=l.__$u;u&&(l.__$u=void 0,u.d())}}n(e)}),pi("__h",function(n,e,t,r){(r<3||r===9)&&(e.__$f|=2),n(e,t,r)}),pr.prototype.shouldComponentUpdate=function(n,e){var t=this.__$u;if(!(t&&t.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var r in e)return!0;for(var i in n)if(i!=="__source"&&n[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function Pg(n){return zr(function(){return wt(n)},[])}const sl=wt(!1),xe=wt(null),hi=wt([]),tr=wt(!1),vi=wt([]),hr=wt(!1),po=wt(null),ht=wt(null),ho=wt(!1),vo=wt(!0),oa=wt(!1),kg=()=>{mg(()=>{xe.value=null,hi.value=[],tr.value=!1,vi.value=[],hr.value=!1,po.value=null,ht.value=null,ho.value=!1,vo.value=!0,oa.value=!1})},ll="bm_currentBike",zg="v2",Cg="https://cdn.bikematrix.io",Vd={isShopify:!1,skuField:"sku",apiUrl:"https://api.bikematrix.io/proxy/v3/",apiKey:"",apiToken:"",currentCollectionHandle:"",categories:[],collections:[],pageType:"index",showHomePageCollection:!1,showSearchPageCollection:!1,designMode:!1,bikeSelectorBrands:"",productsCollections:{},isHomePage:!1,isSearchPage:!1,products:{},collectionUrl:"",compatiblityListCurrentPage:0,showCompatibleList:!0,sku:"",productCollections:[],logLevel:"none",virtualWorkshop:!0,internalLink:""},Sn=function(n){return new URL(n,Cg).toString()};function qd(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=qd(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Ag(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=qd(n))&&(r&&(r+=" "),r+=e);return r}const ul="-";function Hg(n){const e=Og(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;function i(l){const u=l.split(ul);return u[0]===""&&u.length!==1&&u.shift(),Jd(u,e)||Dg(l)}function o(l,u){const c=t[l]||[];return u&&r[l]?[...c,...r[l]]:c}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function Jd(n,e){var l;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),i=r?Jd(n.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=n.join(ul);return(l=e.validators.find(({validator:u})=>u(o)))==null?void 0:l.classGroupId}const Ud=/^\[(.+)\]$/;function Dg(n){if(Ud.test(n)){const e=Ud.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function Og(n){const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Eg(Object.entries(n.classGroups),t).forEach(([o,l])=>{cl(l,r,o,e)}),r}function cl(n,e,t,r){n.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Kd(e,i);o.classGroupId=t;return}if(typeof i=="function"){if(Xg(i)){cl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([o,l])=>{cl(l,Kd(e,o),t,r)})})}function Kd(n,e){let t=n;return e.split(ul).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function Xg(n){return n.isThemeGetter}function Eg(n,e){return e?n.map(([t,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,u])=>[e+l,u])):o);return[t,i]}):n}function Lg(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function i(o,l){t.set(o,l),e++,e>n&&(e=0,r=t,t=new Map)}return{get(o){let l=t.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return i(o,l),l},set(o,l){t.has(o)?t.set(o,l):i(o,l)}}}const _d="!";function Bg(n){const e=n.separator,t=e.length===1,r=e[0],i=e.length;return function(l){const u=[];let c=0,f=0,p;for(let x=0;x<l.length;x++){let A=l[x];if(c===0){if(A===r&&(t||l.slice(x,x+i)===e)){u.push(l.slice(f,x)),f=x+i;continue}if(A==="/"){p=x;continue}}A==="["?c++:A==="]"&&c--}const h=u.length===0?l:l.substring(f),b=h.startsWith(_d),m=b?h.substring(1):h,P=p&&p>f?p-f:void 0;return{modifiers:u,hasImportantModifier:b,baseClassName:m,maybePostfixModifierPosition:P}}}function jg(n){if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function Tg(n){return{cache:Lg(n.cacheSize),splitModifiers:Bg(n),...Hg(n)}}const Ig=/\s+/;function Sg(n,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return n.trim().split(Ig).map(l=>{const{modifiers:u,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:p}=t(l);let h=r(p?f.substring(0,p):f),b=!!p;if(!h){if(!p)return{isTailwindClass:!1,originalClassName:l};if(h=r(f),!h)return{isTailwindClass:!1,originalClassName:l};b=!1}const m=jg(u).join(":");return{isTailwindClass:!0,modifierId:c?m+_d:m,classGroupId:h,originalClassName:l,hasPostfixModifier:b}}).reverse().filter(l=>{if(!l.isTailwindClass)return!0;const{modifierId:u,classGroupId:c,hasPostfixModifier:f}=l,p=u+c;return o.has(p)?!1:(o.add(p),i(c,f).forEach(h=>o.add(u+h)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function Mg(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=$d(e))&&(r&&(r+=" "),r+=t);return r}function $d(n){if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=$d(n[r]))&&(t&&(t+=" "),t+=e);return t}function Wg(n,...e){let t,r,i,o=l;function l(c){const f=e.reduce((p,h)=>h(p),n());return t=Tg(f),r=t.cache.get,i=t.cache.set,o=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=Sg(c,t);return i(c,p),p}return function(){return o(Mg.apply(null,arguments))}}function Ye(n){const e=t=>t[n]||[];return e.isThemeGetter=!0,e}const ef=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zg=/^\d+\/\d+$/,Yg=new Set(["px","full","screen"]),Fg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ng=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Rg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Yr(n){return Mn(n)||Yg.has(n)||Zg.test(n)}function hn(n){return gi(n,"length",e3)}function Mn(n){return!!n&&!Number.isNaN(Number(n))}function go(n){return gi(n,"number",Mn)}function sa(n){return!!n&&Number.isInteger(Number(n))}function Vg(n){return n.endsWith("%")&&Mn(n.slice(0,-1))}function me(n){return ef.test(n)}function vn(n){return Fg.test(n)}const qg=new Set(["length","size","percentage"]);function Jg(n){return gi(n,qg,tf)}function Ug(n){return gi(n,"position",tf)}const Kg=new Set(["image","url"]);function _g(n){return gi(n,Kg,r3)}function $g(n){return gi(n,"",t3)}function la(){return!0}function gi(n,e,t){const r=ef.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function e3(n){return Ng.test(n)&&!Rg.test(n)}function tf(){return!1}function t3(n){return Gg.test(n)}function r3(n){return Qg.test(n)}function n3(){const n=Ye("colors"),e=Ye("spacing"),t=Ye("blur"),r=Ye("brightness"),i=Ye("borderColor"),o=Ye("borderRadius"),l=Ye("borderSpacing"),u=Ye("borderWidth"),c=Ye("contrast"),f=Ye("grayscale"),p=Ye("hueRotate"),h=Ye("invert"),b=Ye("gap"),m=Ye("gradientColorStops"),P=Ye("gradientColorStopPositions"),x=Ye("inset"),A=Ye("margin"),z=Ye("opacity"),w=Ye("padding"),k=Ye("saturate"),D=Ye("scale"),O=Ye("sepia"),B=Ye("skew"),L=Ye("space"),T=Ye("translate"),X=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",me,e],N=()=>[me,e],V=()=>["",Yr,hn],J=()=>["auto",Mn,me],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],F=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",me],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[Mn,go],ve=()=>[Mn,me];return{cacheSize:500,separator:":",theme:{colors:[la],spacing:[Yr,hn],blur:["none","",vn,me],brightness:le(),borderColor:[n],borderRadius:["none","","full",vn,me],borderSpacing:N(),borderWidth:V(),contrast:le(),grayscale:M(),hueRotate:ve(),invert:M(),gap:N(),gradientColorStops:[n],gradientColorStopPositions:[Vg,hn],inset:W(),margin:W(),opacity:le(),padding:N(),saturate:le(),scale:le(),sepia:M(),skew:ve(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[vn]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),me]}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sa,me]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",sa,me]}],"grid-cols":[{"grid-cols":[la]}],"col-start-end":[{col:["auto",{span:["full",sa,me]},me]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[la]}],"row-start-end":[{row:["auto",{span:[sa,me]},me]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[A]}],mx:[{mx:[A]}],my:[{my:[A]}],ms:[{ms:[A]}],me:[{me:[A]}],mt:[{mt:[A]}],mr:[{mr:[A]}],mb:[{mb:[A]}],ml:[{ml:[A]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,e]}],"min-w":[{"min-w":[me,e,"min","max","fit"]}],"max-w":[{"max-w":[me,e,"none","full","min","max","fit","prose",{screen:[vn]},vn]}],h:[{h:[me,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,e,"auto","min","max","fit"]}],"font-size":[{text:["base",vn,hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",go]}],"font-family":[{font:[la]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",Mn,go]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yr,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[z]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yr,hn]}],"underline-offset":[{"underline-offset":["auto",Yr,me]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[z]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),Ug]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_g]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[z]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[z]}],"divide-style":[{divide:U()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Yr,me]}],"outline-w":[{outline:[Yr,hn]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[z]}],"ring-offset-w":[{"ring-offset":[Yr,hn]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",vn,$g]}],"shadow-color":[{shadow:[la]}],opacity:[{opacity:[z]}],"mix-blend":[{"mix-blend":$()}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",vn,me]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[h]}],saturate:[{saturate:[k]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[z]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:ve()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:ve()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[D]}],"scale-x":[{"scale-x":[D]}],"scale-y":[{"scale-y":[D]}],rotate:[{rotate:[sa,me]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Yr,hn,go]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const i3=Wg(n3);function Pe(...n){return i3(Ag(n))}const a3={shopify:{bikeBrands:"bike/brands",bikeModels:"bike/models",framesSeries:"bike/frameSeries",bikeSpecs:"bike/bikeSpecBikes",bikeSpecYears:"bike/bikeSpecYears",bikeSpecSizes:"bike/bikeSpecSizes",bikeBrandProductCategories:"bike/bikeBrandProductCategories",checkSku:"compatibility/checkSku",checkSkus:"compatibility/checkSkus",checkSkusWithResults:"compatibility/checkSkusWithResults",bikeBom:"workshop/bikeBom",customBike:"workshop/addCustomBike",addComponent:"workshop/addComponent",findProducts:"workshop/findProducts",removeComponent:"workshop/removeComponent",revertComponent:"workshop/revertComponent",saveCustomBike:"workshop/saveCustomBike",updateCustomBike:"workshop/updateCustomBike",updateCustomBikeName:"workshop/updateCustomBikeName"},bikematrix:{bikeBrands:"GetBikeBrands",bikeModels:"GetBikeModels",framesSeries:"GetBikeFrameSeries",bikeSpecs:"GetBikeSpecBikes",bikeSpecYears:"GetBikeSpecYears",bikeSpecSizes:"GetBikeSpecSizes",bikeBrandProductCategories:"GetBikeBrandProductCategories",checkSku:"Compatibility_CheckSku",checkSkus:"Compatibility_CheckSkus",checkSkusWithResults:"Compatibility_CheckSkusWithResults",bikeBom:"GetBikeBillOfMaterials",customBike:"AddCustomBike",addComponent:"AddComponent",findProducts:"FindProducts",removeComponent:"RemoveComponent",revertComponent:"RevertComponent",saveCustomBike:"SaveCustomBike",updateCustomBike:"UpdateCustomBike",updateCustomBikeName:"UpdateCustomBikeName"}};class xt{constructor(e,t,r,i){this._apiUrl=i?window.location.origin+"/apps/proxy/api/":e,this._apiKey=t??"",this._apiToken=r??"",this._apiType=i?"shopify":"bikematrix"}getEndpoint(e){return a3[this._apiType][e]}async getBikeBrands(){const e=this.getEndpoint("bikeBrands"),t=await this.makeRequest(e);return t.success?{success:t.success,data:t.data}:{success:t.success,error:"error_generic GetBikeBrands",logError:t.error}}async getBikeModels(e){if(!e)return{success:!1,error:"error_generic"};const t=this.getEndpoint("bikeModels"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeModels",logError:r.error}}async getBikeFrameSeries(e){if(!e)return{error:"error_generic",success:!1};const t=this.getEndpoint("framesSeries"),r=await this.makeRequest(t,{params:{bikeModelId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeFrameSeries",logError:r.error}}async getBikeSpecs(e){if(!e)return{success:!1,error:"error_generic GetBikeSpecs"};const t=this.getEndpoint("bikeSpecs"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeSpecs",logError:r.error}}async getYears(e){if(!e)return{error:"error_generic GetBikeYears",success:!1};const t=this.getEndpoint("bikeSpecYears"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{error:"error_generic GetBikeYears",success:!1,logError:r.success}}async getFrameSizes(e,t,r){if(!e||!t)return{success:!1,error:"error_generic GetFrameSizes"};const i=this.getEndpoint("bikeSpecSizes"),o=await this.makeRequest(i,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetFrameSizes",logError:o.error}}async getBikes(e,t,r){if(e&&(t||r)){const i=this.getEndpoint("bikeSpecs"),o=await this.makeRequest(i,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetBikes",logError:o.error}}else return{success:!1,error:"error_generic GetBikes"}}async getBrandProductCategories(e){if(e){const t=this.getEndpoint("bikeBrandProductCategories"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:!0}:(console.error(r.error),{success:!1,error:"error_generic GetBrandProductCategories",logError:r.error})}else return{success:!1,error:"error_generic GetBrandProductCategories"}}async checkSkuCompatibility(e,t,r){if(e&&t){const i=this.getEndpoint("checkSku")+`/${e}/${t}/${r}`,o=await this.makeRequest(i);return o.success?{success:o.success,data:o.data}:{success:o.success,error:"error_generic CheckSkuCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkuCompatibility"}}async checkSkusCompatibility(e,t,r){if(e&&t){const i=this.getEndpoint("checkSkus")+`/${e}/${t}/${r}`,o=await this.makeRequest(i);return o.success?{data:o.data,success:o.success,logError:o.error}:{success:o.success,error:"error_generic CheckSkusCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkusCompatibility"}}async checkSkusCompatibilityWithResults(e,t,r,i={}){if(e&&t){const o=this.getEndpoint("checkSkusWithResults")+`/${e}/${r}`,l=await this.makeRequest(o,{body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"},...i});return l.success?{data:l.data,success:l.success}:{success:l.success,error:"error_compatiblelist",logError:l.error}}else return{success:!1,error:"error_compatiblelist"}}async getActiveSubscription(e){if(this._apiType!=="shopify"){e({activeSubscription:!0});return}var t="activeSubscription";const r=await this.makeRequest(t);if(!r.success){console.log(`getActiveSubscription Error: ${r.error}`);return}e(r.data)}async getBikeBom(e){if(!e)return{success:!1,error:"error_generic getBikeBom"};const t=this.getEndpoint("bikeBom"),r=await this.makeRequest(t,{params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_get_bike_bom",logError:r.error}}async addCustomBike(e){if(!e)return{success:!1,error:"error_generic addCustomBike"};const t=this.getEndpoint("customBike"),r=await this.makeRequest(t,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_add_custom_bike",logError:r.error}}async findProducts(e,t){if(!e)return{success:!1,error:"error_generic findProducts"};const r=this.getEndpoint("findProducts"),i=await this.makeRequest(r,{params:{search:e,productCategoryId:t,recordCount:20}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_find_products",logError:i.error}}async addComponent(e,t,r,i){if(!e||!t||!r||!i)return{success:!1,error:"error_generic addComponent"};const o=this.getEndpoint("addComponent"),l=await this.makeRequest(o,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,productId:r,bikeFieldName:i}});return l.success?{data:l.data,success:l.success}:{success:l.success,error:"error_add_component",logError:l.error}}async removeComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic removeComponent"};const i=this.getEndpoint("removeComponent"),o=await this.makeRequest(i,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_remove_component",logError:o.error}}async revertComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic revertComponent"};const i=this.getEndpoint("revertComponent"),o=await this.makeRequest(i,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_revert_component",logError:o.error}}async saveCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("saveCustomBike"),i=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,email:t}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_save_custom_bike",logError:i.error}}async updateCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("updateCustomBike"),i=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_update_custom_bike"}}async updateCustomBikeName(e,t){if(!e||!t)return{success:!1,error:"error_generic updateCustomBikeName"};const r=this.getEndpoint("updateCustomBikeName"),i=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,name:t}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_update_custom_bike_name",logError:i.error}}async makeRequest(e,t={}){const r=new URL(e,this._apiUrl),i={"Cache-Control":"no-cache",...this._apiKey&&{"bm-subscription-key":this._apiKey},...this._apiToken&&{"bm-app-token":this._apiToken}};typeof t.params=="object"&&(Object.keys(t.params).forEach(l=>{t.params[l]&&r.searchParams.set(l,t.params[l])}),delete t.params);let o;try{const l={...i,...t.headers||{}},u={...t,headers:l};t.signal&&(u.signal=t.signal);const c=await fetch(r,u),f=await c.json().catch(()=>{throw new Error("Request failed: "+(c.statusText||"Status"+c.status))});f.status===400||f.statusCode===404?o={success:!1,data:f}:o={success:!0,data:f}}catch(l){o={success:!1,error:l.message}}return o}}async function rf(n){var b;const{categories:e,collections:t,apiUrl:r,apiKey:i,apiToken:o,isShopify:l,logLevel:u}=window.BikeMatrix.getConfig(),c=JSON.parse(sessionStorage.getItem("bm_categories")||"null"),f=JSON.parse(localStorage.getItem(ll)||"null"),p=new xt(r,i,o,l);let h=[];if(u==="verbose"&&console.log("useCompatibleCollections sessionCollections",c),!c||!(c!=null&&c.collections)||!(c!=null&&c.collections.length)||(c==null?void 0:c.key)!==(f==null?void 0:f.key)){u==="verbose"&&console.log("useCompatibleCollections fetching new collections");const m=await p.getBrandProductCategories(n);if(u==="verbose"&&console.log("useCompatibleCollections bikeBrandProductCategories",m),!m.success)return console.log(m),u==="verbose"&&console.error(m.error),h={error:m.error},h;if(u==="verbose"&&(console.log("useCompatibleCollections categories",e),console.log("useCompatibleCollections collections",t)),((b=m.data)==null?void 0:b.length)>0){let P=e.filter(x=>{var A;return!!x.collection&&((A=m==null?void 0:m.data)==null?void 0:A.some(z=>z.product_Category.toLowerCase()===x.title.toLowerCase()))});u==="verbose"&&console.log("useCompatibleCollections availableCategories",P),h=P.map(x=>t.filter(z=>x.collection.split(",").map(w=>w.trim().toLowerCase()).includes(z.title.toLowerCase())).map(z=>({title:z.title,text_id:x.text_id,handle:z.handle,url:z.url}))).flat(),u==="verbose"&&console.log("useCompatibleCollections compatibleCollections",h),h=h==null?void 0:h.filter((x,A,z)=>A===z.findIndex(w=>w.title===x.title&&w.text_id===x.text_id&&w.handle===x.handle&&w.url===x.url))}sessionStorage.setItem("bm_categories",JSON.stringify({key:f==null?void 0:f.key,collections:h})),u==="verbose"&&console.log("useCompatibleCollections fetched collections",h)}else u==="verbose"&&console.log("useCompatibleCollections using session collections"),h=c.collections;return h}const nf=class to{constructor(){this.initialized=!1,this.currentBike=null,this.activeSubscription=null,this.components=[],this.config=Vd}async initialize(e){this.components=[],this.initialized&&this.cleanup(),e&&(this.config={...this.config,...e}),this.initializeConfig(),this.service=new xt(this.config.apiUrl,this.config.apiKey,this.config.apiToken,this.config.isShopify),this.initializeActiveSubscription(),localStorage.bm_currentBike&&(this.currentBike=JSON.parse(localStorage.bm_currentBike)),this.setupEventListeners(),this.registerComponents(),this.initialized=!0,sl.value=!0;const t=new Event("BM:Initialized");document.dispatchEvent(t),this.config.logLevel==="verbose"&&(console.log("BikeMatrix WebComponent Version: 1.1.48"),console.log("BikeMatrixCore initialized"))}static getInstance(){return to.instance||(to.instance=new to),to.instance}registerComponents(){const e=["bikematrix-bikeselector","bikematrix-productresult","bikematrix-collectionresult","bikematrix-compatibilitylabel","bikematrix-compatiblelist","bikematrix-bikeselectorbanner","bikematrix-variantselector"];this.components=[],e.forEach(t=>{const r=document.getElementsByTagName(t);Array.from(r).forEach(i=>{this.components.push(i)})}),this.config.logLevel==="verbose"&&console.log(`Registered ${this.components.length} components`)}resetComponents(){this.components.forEach(e=>{var t;try{const r=e.cloneNode(!1);e.querySelectorAll("template").forEach(o=>{r.appendChild(o.cloneNode(!0))}),(t=e.parentNode)==null||t.replaceChild(r,e)}catch{console.error("Error resetting component",e)}})}isInitialized(){return this.initialized}updateConfig(e){this.config={...this.config,...e},this.reload(!1)}cleanup(){this.removeEventListeners(),kg()}async destroy(){this.cleanup(),this.service=null,this.currentBike=null,this.activeSubscription=null,this.config={...Vd},this.initialized=!1,sl.value=!1,this.resetComponents()}refresh(){this.ChangeBike()}reset(){this.destroy(),this.initialize()}reload(e=!0){e&&this.initializeConfig(),this.refresh(),this.registerComponents(),this.resetComponents()}initializeConfig(){const e=document.querySelectorAll('script[type="application/json"][data-bikematrix-config]'),t=JSON.parse(sessionStorage.getItem("bm_diagnostics"));e.forEach(r=>{if(r!=null&&r.textContent)try{this.config={...this.config,...JSON.parse(r.textContent)}}catch{console.error("Invalid BikeMatrix configuration"),console.log("configScript ",r.textContent)}}),t!=null&&t.includes("verbose")&&(this.config.logLevel="verbose"),t!=null&&t.includes("virtualWorkshop")&&(this.config.virtualWorkshop=!0),t!=null&&t.includes("subscribtion")&&(this.activeSubscription=!0),t!=null&&t.includes("all")&&(this.config.logLevel="verbose",this.config.virtualWorkshop=!0,this.activeSubscription=!0),this.config.logLevel==="verbose"&&console.log("initializeConfig ",JSON.stringify(this.config,null,2))}initializeActiveSubscription(){const e=sessionStorage.getItem("bm_activeSubscription");if(this.config.logLevel==="verbose"&&(console.log("Not Shopify: ",!this.config.isShopify),console.log("Session Active Subscription: ",e),console.log("Design Mode: ",this.config.designMode)),!this.config.isShopify){this.activeSubscription=!0;return}this.activeSubscription=this.config.designMode||e==="true",e||this.service.getActiveSubscription(this.updateActiveSubscription.bind(this))}setupEventListeners(){document.addEventListener("BikeMatrix:RefreshCompatibleSkus",e=>{this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}),document.addEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus.bind(this)),document.addEventListener("BikeChanged",this.handleBikeChanged.bind(this))}removeEventListeners(){document.removeEventListener("BikeMatrix:RefreshCompatibleSkus",this.handleRefreshCompatibleSkus),document.removeEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus),document.removeEventListener("BikeChanged",this.handleBikeChanged)}async handleRefreshCompatibleSkus(e){this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}async handleBikeChanged(e){this.config.logLevel==="verbose"&&console.log("Listener BikeChanged..."),this.ChangeBike()}getConfig(){return this.config}getActiveSubscription(){return this.activeSubscription}getCurrentBike(){return this.currentBike}updateSku(e){const t=document.querySelector("bikematrix-productresult[data-sku]"),r=document.querySelector("bikematrix-variantselector[data-sku]");t&&t.setAttribute("data-sku",e),r&&r.setAttribute("data-sku",e),this.config.sku=e}ResetSelectedBikeIndicator(){var e,t;this.currentBike===null?(e=window.bm_selectBikeButton)==null||e.classList.remove("show-selected"):(t=window.bm_selectBikeButton)==null||t.classList.add("show-selected")}ChangeBike(){this.config.logLevel==="verbose"&&console.log("ChangeBike() Method Called"),!(tr.value===!0||hr.value===!0)&&(tr.value=!0,hr.value=!0,hi.value=[],vi.value=[],this.config.logLevel==="verbose"&&console.log("ChangeBike updateBikeSignal..."),this.updateBikeSignal().then(()=>{this.config.logLevel==="verbose"&&console.log("Bike Signal Updated: ",JSON.stringify(xe.value,null,2)),this.ResetSelectedBikeIndicator(),this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}))}async RefreshCompatibleSkus(){var t,r;const e=`${(t=xe.value)==null?void 0:t.key}:${this.config.currentCollectionHandle}:${zg}`;switch(this.config.pageType){case"collection":const i=!!xe.value&&!xe.value.compatibleCollections.error&&((r=xe.value.compatibleCollections)==null?void 0:r.find(o=>o.handle===this.config.currentCollectionHandle));this.config.logLevel==="verbose"&&console.log("Refresh Compatible SKUs. hasCompatibleCollection: ",i),this.config.logLevel==="verbose"&&console.log("showCompatibleList: ",this.config.showCompatibleList),i&&(await this.RefreshCollectionPageSkus(e),this.config.showCompatibleList&&await this.RefreshCollectionListSkus(e)),tr.value=!1,hr.value=!1;break;case"search":case"index":tr.value=!1,this.config.pageType==="index"&&this.config.showHomePageCollection||this.config.pageType==="search"&&this.config.showSearchPageCollection?await this.RefreshCollectionPageSkus(e):hr.value=!1;break;default:tr.value=!1,hr.value=!1;break}}async RefreshCollectionPageSkus(e){var l,u;let t=document.getElementsByTagName("bikematrix-collectionresult"),i=Array.from(t).map(c=>{const f=this.config.skuField==="barcode"?c.getAttribute("data-product-barcodes"):this.config.skuField==="metafield"?c.getAttribute("data-product-metafields"):c.getAttribute("data-product-skus")||"";return f==null?void 0:f.split(",").filter(p=>!!p)}).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection Page SKUs. SKUs: ",JSON.stringify(i),null,2);var o=((l=di())==null?void 0:l.language)||"en-GB";if(i){const c=await this.service.checkSkusCompatibilityWithResults((u=xe.value)==null?void 0:u.key,i,o);c.success?vi.value=c.data:(ho.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",c.logError))}else vi.value=[]}async RefreshCollectionListSkus(e){var i,o;var t=JSON.parse(sessionStorage.getItem(e));if(t)this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from Session: ",JSON.stringify(t),null,2),hi.value=t;else{const l=Object.values(this.config.products||{}).map(p=>p.skus).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(l),null,2);var r=((i=di())==null?void 0:i.language)||"en-GB";const u=new AbortController,c=u.signal,f=()=>u.abort();window.addEventListener("beforeunload",f);try{if(!((o=xe.value)!=null&&o.key))throw new Error("BikeSignal key is undefined");const p=await this.service.checkSkusCompatibilityWithResults(xe.value.key,l,r,{signal:c});if(this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(p)),c.aborted){this.config.logLevel==="verbose"&&console.log("function RefreshCompatibleSkus() operation aborted");return}p.success?(sessionStorage.setItem(e,JSON.stringify(p.data)),hi.value=p.data):(ho.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",p.logError))}catch(p){p.name==="AbortError"?console.log("function RefreshCompatibleSkus() fetch aborted"):console.error("function RefreshCompatibleSkus() fetch error",p)}finally{window.removeEventListener("beforeunload",f)}}}updateActiveSubscription(e){this.config.logLevel==="verbose"&&console.log("updateActiveSubscription data: ",e);const t=!!(e!=null&&e.activeSubscription);sessionStorage.setItem("bm_activeSubscription",JSON.stringify(t)),this.activeSubscription=t}async updateBikeSignal(){const e=localStorage.getItem(ll)||"null",t=JSON.parse(e);if(this.currentBike=t,t==null){xe.value=null;return}const r=await rf(t==null?void 0:t.brandId);!Array.isArray(r)&&r.error?(t.compatibleCollections=[],xe.value=t):(t.compatibleCollections=r,xe.value=t),this.config.logLevel==="verbose"&&console.log("Bike Changed: ",JSON.stringify(xe.value,null,2))}};nf.instance=null;let o3=nf;const ua=n=>te("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M1.53553 8.60658L5.07107 5.07104M5.07107 5.07104L8.6066 1.53551M5.07107 5.07104L8.6066 8.60658M5.07107 5.07104L1.53553 1.53551",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}));var s3=0;function g(n,e,t,r,i,o){var l,u,c={};for(u in e)u=="ref"?l=e[u]:c[u]=e[u];var f={type:n,props:c,key:t,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--s3,__i:-1,__u:0,__source:i,__self:o};if(typeof n=="function"&&(l=n.defaultProps))for(u in l)c[u]===void 0&&(c[u]=l[u]);return fe.vnode&&fe.vnode(f),f}function bi(){document.dispatchEvent(new Event("BmToggleModal"))}function l3({children:n}){return oe(()=>{var o;const e=document.body,t=document.getElementById("bm_selectBikeButton"),r=(o=document.getElementsByTagName("bikematrix-bikeselector"))==null?void 0:o[0],i=l=>{l.preventDefault(),e.classList.toggle("bm-modal-active"),r.classList.toggle("active"),oa.value=!oa.value};return document.addEventListener("BmToggleModal",i),t==null||t.addEventListener("click",i),()=>{document.removeEventListener("BmToggleModal",i),t==null||t.removeEventListener("click",i)}},[]),g(ie,{children:[g("div",{onClick:()=>{bi()},class:Pe("overlay","fixed cursor-pointer inset-0 z-[2147483645] bg-black/40 transition-all duration-500 sm:duration-200")}),g("div",{className:Pe("modal","fixed pointer-events-none inset-0 mx-auto justify-end z-[2147483646] flex flex-col items-center outline-none transition-all duration-500 sm:duration-200 ease-in-out","sm:justify-center"),children:g("div",{className:"flex sm:px-2 pointer-events-auto max-sm:max-h-[96%] sm:max-h-[90%] max-sm:h-[89vh] max-w-lg sm:max-w-[640px] flex-col items-center max-sm:flex-1 w-full bg-white rounded-t-3xl sm:rounded-xl shadow-[0px_-2px_10px_0px_rgba(0,0,0,0.04),0px_0px_0px_1px_rgba(0,0,0,0.06)]",children:[g("div",{className:"sm:hidden mx-auto mt-4 h-[6px] w-[100px] rounded-full bg-gray-400/50",onClick:bi}),g("div",{className:"sm:hidden h-[10px]"}),g("div",{className:"relative flex flex-col w-full sm:h-full max-sm:flex-none max-sm:grow",children:g("div",{class:"modal-content max-sm:absolute sm:h-full max-sm:inset-0 overflow-x-hidden overflow-y-auto px-8 sm:px-6",children:n})})]})})]})}const vr=n=>te("svg",{width:7,height:12,viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M1 11L6 6L1 1",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),u3=n=>te("svg",{width:31,height:31,viewBox:"0 0 31 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("circle",{cx:15.5,cy:15.5,r:15.5,fill:"#030712"}),te("path",{d:"M10.1974 17.1317L13.9955 20.4461L20.8639 10.8909",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),c3=n=>te("svg",{width:31,height:31,viewBox:"0 0 31 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("g",{clipPath:"url(#clip0_64_2)"},te("path",{d:"M30.5 15.5C30.5 23.7843 23.7843 30.5 15.5 30.5C7.21573 30.5 0.5 23.7843 0.5 15.5C0.5 7.21573 7.21573 0.5 15.5 0.5C23.7843 0.5 30.5 7.21573 30.5 15.5Z",fill:"white",stroke:"#D1D5DB"})),te("path",{d:"M23.983 11.132C23.9699 10.9806 23.8699 10.8506 23.727 10.7988C23.5837 10.7466 23.4233 10.7822 23.3155 10.8894L21.1098 13.0866L18.6647 12.3153L17.8905 9.87937L20.0961 7.68201C20.2041 7.57458 20.2393 7.41475 20.1873 7.27224C20.1348 7.12945 20.0046 7.02999 19.8524 7.01688C18.5129 6.9019 17.2004 7.37836 16.2514 8.32387C14.9518 9.61873 14.6076 11.5096 15.217 13.1213C15.1504 13.1773 15.0847 13.2365 15.0199 13.3004L7.65736 20.2216C7.65476 20.2241 7.6522 20.2268 7.64939 20.2293C6.78354 21.092 6.78354 22.4955 7.64939 23.3583C8.51539 24.2209 9.91396 24.2104 10.7797 23.3477C10.7834 23.3443 10.7868 23.3408 10.7902 23.3369L17.677 15.945C17.7398 15.8822 17.798 15.8165 17.853 15.749C19.4713 16.3573 21.3705 16.0152 22.6713 14.7195C23.62 13.7739 24.0986 12.4663 23.983 11.132ZM9.67019 22.4264C9.35113 22.7442 8.83439 22.744 8.51536 22.4264C8.19644 22.1089 8.19644 21.5937 8.51536 21.2761C8.83439 20.9585 9.35113 20.9585 9.67019 21.2761C9.98911 21.5937 9.98911 22.1089 9.67019 22.4264Z",fill:"black"}),te("defs",null,te("clipPath",{id:"clip0_64_2"},te("rect",{width:31,height:31,fill:"white"})))),d3=n=>te("svg",{width:31,height:31,viewBox:"0 0 46 46",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M2 24.0437V22.6518C4.30404 21.9559 5.82929 20.347 6.17596 18.244C6.45967 16.523 5.87584 14.7802 4.66788 13.505L5.50401 12.1672C6.3441 12.2632 7.12499 12.2938 7.83019 12.2273C8.91308 12.1253 10.0603 11.7686 10.8965 10.814C11.7162 9.87828 11.9364 8.70751 11.9455 7.65019C11.9509 7.01984 11.882 6.33439 11.7615 5.60532L13.1089 4.93163C14.6862 6.27858 16.5967 7.00972 18.5085 6.50659C20.496 5.98355 21.7104 4.35171 22.2287 2.32023L23.4959 2.17943C23.7105 2.84427 23.9686 3.45839 24.2803 4.0055C24.8609 5.02453 25.7009 5.93317 26.8959 6.37534C28.1054 6.8229 29.35 6.6716 30.4872 6.21488C31.2478 5.9094 32.0092 5.4502 32.771 4.87155L33.84 5.40607C33.3102 7.17682 33.6407 8.97473 34.9205 10.3525C36.2854 11.8219 38.3837 12.4206 40.6053 12.1884L41.4091 13.3137C40.1484 14.904 39.5422 16.7943 40.0082 18.6621C40.4975 20.623 42.0098 21.9631 44 22.6091V23.6937C42.0295 24.646 40.407 25.9295 39.9934 27.9032C39.7449 29.089 40.0083 30.2272 40.4663 31.2395C40.7549 31.8775 41.1444 32.5183 41.6038 33.1622L41.0881 34.0648C39.1096 33.5569 37.1545 33.7409 35.7252 35.1442C34.3293 36.5148 34.0136 38.5186 34.2755 40.5318L32.7931 41.4583C31.191 40.0523 29.3504 39.2822 27.3831 40.0414C26.2841 40.4655 25.451 41.2846 24.816 42.1501C24.4114 42.7016 24.0463 43.3278 23.7127 44H22.6585C22.1786 42.2318 21.2165 40.6691 19.4091 40.0247C17.4936 39.3418 15.3888 40.0023 13.3765 41.2022L11.9877 40.5078C12.4255 38.6858 12.158 36.865 10.7918 35.5311C9.4171 34.1889 7.44044 33.8741 5.42929 34.2133L4.6584 32.9799C6.03869 31.6871 6.93069 30.0087 6.40539 28.071C6.07607 26.8563 5.24467 25.9088 4.25062 25.2068C3.60737 24.7526 2.85005 24.3664 2 24.0437Z",stroke:"black",strokeWidth:4}),te("circle",{cx:23,cy:23,r:12,stroke:"black",strokeWidth:4}),te("path",{d:"M23 39.75C32.2508 39.75 39.75 32.2508 39.75 23C39.75 13.7492 32.2508 6.25 23 6.25C13.7492 6.25 6.25 13.7492 6.25 23C6.25 32.2508 13.7492 39.75 23 39.75Z",stroke:"black",strokeWidth:3.5})),f3=`.shared-icon{background-color:#fba157;padding:5px 10px;border-radius:8px;font-size:12px;display:flex;justify-content:center;align-items:center;color:#fff}
|
|
2
|
-
`,af=({text:n})=>g(ie,{children:[g("style",{type:"text/css",children:f3}),g("div",{className:"shared-icon",children:g("p",{className:"text",children:n||"Shared with you"})})]});function gr({spanner:n,selected:e,settings:t,simple:r,bike:i,compact:o,readOnly:l,onClick:u,shared:c,custom:f,noSymbol:p,...h}){var B;const b=(B=i.images)!=null&&B.length?i.images:[Sn("bike.png")],m=be(null),[P,x]=K(0),A=be(null);oe(()=>{const L=m==null?void 0:m.current;if(L){var T=new IntersectionObserver(function(X){var Z=X.reduce(function(W,N){return N.intersectionRatio>W.intersectionRatio?N:W});Z.intersectionRatio>0&&x(Number(Z.target.getAttribute("data-slide")))},{root:L,threshold:.8});return L.querySelectorAll("&>div").forEach(X=>{T.observe(X)}),()=>{T.disconnect()}}},[m]);function z(L){if(!m.current)return;const T=m.current.querySelectorAll("&>div")[L];m.current.scrollLeft=T.clientWidth*L}function w(){P!=0&&z(P-1)}function k(){P!=b.length-1&&z(P+1)}const D=(b==null?void 0:b.length)&&P!==b.length-1,O=(b==null?void 0:b.length)&&P!==0;return g("div",{class:Pe("rounded-xl select-none border py-4 relative",e?"border-gray-950":"border-gray-300"),...h,onClick:L=>{if(A.current&&!A.current.contains(L.target))u(L);else{L.preventDefault();return}},children:[!r&&g("p",{class:"text-gray-950 px-4 text-base font-normal font-nunito leading-tight ",children:o?g(ie,{children:l?`${i.bike_Brand} ${i.year} ${i.spec}`:i?`${i.brand} ${i.year} ${i.bikeSpec} ${i.variant?i.variant:""}`:""}):g(ie,{children:l?i.bike_Name:i.name})}),g("div",{class:"relative mt-2",children:[g("div",{ref:m,class:Pe("flex scroll-smooth snap-mandatory no-scrollbar h-32 snap-x space-x-2 relative overflow-x-auto","px-4"),"data-active-slide":P,children:[!l&&b.length&&b.map((L,T)=>g("div",{"data-slide":T,class:"w-full h-full snap-center flex items-center flex-none",children:g("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:L,alt:L})},T)),l&&g("div",{class:"w-full h-full snap-center flex items-center flex-none",children:g("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:`https://imagestore.bikematrix.io/${i.bike_Reference}/400-${i.bike_Thumbnail}`,alt:i.bike_Reference})})]}),g(ie,{children:[g("div",{onClick:w,class:Pe("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center left-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",O?"":"hidden"),children:g(vr,{class:"h-3 text-gray-500 -rotate-180"})}),g("div",{onClick:k,class:Pe("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center right-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",D?"":"hidden"),children:g(vr,{class:"h-3 text-gray-500 translate-x-px"})})]})]}),(b==null?void 0:b.length)>1&&g("div",{class:"space-x-2 flex items-center justify-center",children:b.map((L,T)=>g("div",{class:Pe("rounded-xl w-2 h-2 transition-all duration-300",T==P?" bg-gray-950 scale-125":" bg-gray-200")},T))}),(c||i.isShared)&&g("div",{className:"absolute left-4 bottom-4",children:g(af,{})}),(f||i.isCustom)&&g("div",{className:"absolute left-4 bottom-4",children:g(af,{text:"Custom"})}),g("div",{className:"spanner_wrapper absolute right-4 bottom-14 h-fit w-fit",ref:A,children:n&&e&&g(c3,{class:"cursor-pointer",onClick:L=>{L.preventDefault(),!(i!=null&&i.isCustom)&&!(i!=null&&i.isShared)?Oe("/workshop"):i!=null&&i.isShared?Oe("/read-only"):Oe("/bom")}})}),e&&!t?g(u3,{class:"absolute right-4 bottom-4 cursor-pointer"}):t?g(d3,{class:"absolute right-4 bottom-4 cursor-pointer",onClick:()=>Oe("/settings")}):l?g("span",{}):p?g("span",{}):g(ie,{children:g("span",{class:"border absolute right-4 bottom-4 rounded-full h-8 w-8 border-gray-300 bg-white/75"})})]})}function of(n,e){const t=()=>{try{const o=window.localStorage.getItem(n);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,i]=K(t);return oe(()=>{try{if(!r&&n==="bm_currentBike")window.localStorage.setItem(n,null);else if(!r)window.localStorage.removeItem(n);else{const o=JSON.stringify(r);window.localStorage.setItem(n,o)}}catch(o){console.error(o)}},[n,r]),[r,i,t]}function p3(n,e){const t=()=>{try{const o=window.sessionStorage.getItem(n);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,i]=K(t);return oe(()=>{try{if(!r)window.sessionStorage.removeItem(n);else{const o=JSON.stringify(r);window.sessionStorage.setItem(n,o)}}catch(o){console.error(o)}},[n,r]),[r,i,t]}const dl={brand:{options:[],value:null,error:null},model:{options:[],value:null,error:null},frameSeries:{options:[],value:null,error:null},year:{options:[],value:[],error:null},bikeSpec:{options:[],value:null,error:null},frameSize:{options:[],value:null,error:null},options:[],value:{}},sf=ra(void 0),h3=({children:n})=>{var $;const e=window.BikeMatrix.getConfig(),[t,r]=of(ll,null),[i,o]=of("bm_lounge",[]),l=new xt(e.apiUrl,e.apiKey,e.apiToken,e.isShopify),[u,c]=K(dl),f=be({}),[p,h]=K([]),[b,m]=K(!1),[P,x]=K(null);K(null),oe(()=>{(async()=>{if(t!=null&&t.brandId){const M=await rf(t==null?void 0:t.brandId);x(M)}})()},[t==null?void 0:t.brandId]);function A(F){c(M=>{var ee;return{...M,[F]:{options:[],value:(ee=dl[F])==null?void 0:ee.value}}})}function z(F,M){c(ee=>(ee[F].value=M,{...ee}))}const w=()=>{c(F=>{var M;return{...dl,brand:{options:((M=F.brand)==null?void 0:M.options)||[],error:F.brand.error||null}}})},k=F=>{r({...F}),o([...(i||[]).filter(M=>!!M.key&&M.key!==F.key),F])},D=F=>{(t==null?void 0:t.key)===F&&r(null),o([...(i||[]).filter(M=>!!M.key&&M.key!==F)])},O=()=>{e.logLevel==="verbose"&&console.log("Dispatch BikeChanged..."),document.dispatchEvent(new Event("BikeChanged",{bubbles:!0,composed:!0}))},B=()=>{setTimeout(()=>{w(),Oe("/")},500)},L=async()=>{const F=await l.getBikeBrands();F.success?(sessionStorage.setItem("bm_brands",JSON.stringify(F.data)),c(M=>(M.brand.options=F.data.map(ee=>({label:ee.bike_Brand,value:ee.bike_Brand_ID})),{...M}))):F.success||(c(M=>(M.brand.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},T=async()=>{const F=await l.getBikeModels(u.brand.value);F.success?c(M=>(M.model.options=F.data.map(ee=>({label:ee.model_Family,value:ee.model_Family_ID})),{...M})):F.success||(c(M=>(M.model.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},X=async()=>{const F=await l.getBikeFrameSeries(u.model.value);F.success?c(M=>{var le,ve;const ee=[];return M.frameSeries.options=F.data.reduce((pe,Re)=>{const Ie={label:Re.model_Spec,value:Re.model_Spec_ID};return ee.includes(Ie.value)||(ee.push(Ie.value),pe.push(Ie)),pe},[]),((le=M.frameSeries.options)==null?void 0:le.length)===1&&(M.frameSeries.value=(ve=M.frameSeries.options[0])==null?void 0:ve.value),{...M}}):F.success||(c(M=>(M.frameSeries.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},Z=async()=>{const F=await l.getBikeSpecs(u.frameSeries.value);if(F.success){const M=[],ee=[],le=[],ve=[];F.data.forEach(pe=>{var Bt,$e;const Re=pe.year+"-"+pe.spec.replace(/[^0-9a-zA-Z]/g,"")+(pe.bike_Variant?"-"+pe.bike_Variant.replace(/[^0-9a-zA-Z]/g,""):""),Ie={label:pe.spec,value:pe.spec};if(M.includes(Ie.value)||(M.push(Ie.value),le.push(Ie)),!ee.includes(Re)){ee.push(Re);const Vt={_key:Re,key:pe.bike_Key,name:pe.bike_Name,variant:pe.bike_Variant,brand:pe.bike_Brand,brandId:pe.bike_Brand_ID,model:pe.model_Family,modelId:pe.model_Family_ID,frameSeries:pe.model_Spec,frameSeriesId:pe.model_Spec_ID,bikeSpec:pe.spec,year:pe.year,images:[pe.bike_Thumbnail,...((Bt=pe==null?void 0:pe.bike_Images)==null?void 0:Bt.split(","))||[]].filter(qt=>!!qt).map(qt=>`https://imagestore.bikematrix.io/${pe.bike_Reference}/400-${qt}`)},jt=F.data.reduce((qt,at)=>(at.year==pe.year&&at.spec===pe.spec&&at.model_Spec===pe.model_Spec&&at.bike_Variant===pe.bike_Variant&&qt.push({key:at.bike_Key,name:at.bike_Name,variant:at.bike_Variant,sizeId:at.bike_Size_ID,size:at.bike_Size}),qt),[]);($e=jt==null?void 0:jt.filter(qt=>!!qt.sizeId))!=null&&$e.length&&(Vt.sizes=jt),ve.push(Vt)}f.current[u.frameSeries.value]=Array.from(new Set([...f.current[u.frameSeries.value]||[],pe.year]))}),c(pe=>(pe.bikeSpec.options=le,{...pe})),h(ve)}else F.success||(c(M=>(M.bikeSpec.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},W=async()=>{c(F=>{const M=f.current[F.frameSeries.value]||[];return F.year.options=M.map(ee=>({label:ee,value:ee})),{...F}})},N=async()=>{c(F=>{var M,ee,le;if(F.frameSize.options=(M=u==null?void 0:u.value)!=null&&M.sizes?u.value.sizes.filter(ve=>!!ve.size).map(ve=>({label:ve.size,value:ve.size})):[],((ee=F.frameSize.options)==null?void 0:ee.length)===1){const ve=(le=F.frameSize.options[0])==null?void 0:le.value;F.frameSize.value=ve,F.value.frameSize=ve}return{...F}})};oe(()=>(document.addEventListener("BmToggleModal",B),()=>{document.removeEventListener("BmToggleModal",B)}),[]);const[V,J]=p3("bm_diagnostics",[]),re=()=>{const M=new URLSearchParams(window.location.search).get("diagnostics");JSON.parse(sessionStorage.getItem("bm_diagnostics")).includes(M)||J([...V,M]),M===null&&J([])};oe(()=>{O(),re()},[t]),oe(()=>{sessionStorage.getItem("bm_brands")?c(F=>(F.brand.options=JSON.parse(sessionStorage.getItem("bm_brands")).map(M=>({label:M.bike_Brand,value:M.bike_Brand_ID})),{...F})):oa.value&&L()},[oa.value]),oe(()=>{u.brand.value&&(A("model"),A("frameSeries"),T())},[u.brand.value]),oe(()=>{u.model.value&&(A("frameSeries"),X())},[u.model.value]),oe(()=>{u.frameSeries.value&&(A("bikeSpec"),A("year"),h([]),Z().then(()=>{W()}))},[u.frameSeries.value]),oe(()=>{u.value._key&&(A("frameSize"),N())},[($=u.value)==null?void 0:$._key]),oe(()=>{u.frameSize.value&&c(F=>{var M,ee;return F.value={...F.value,...((ee=(M=F==null?void 0:F.value)==null?void 0:M.sizes)==null?void 0:ee.find(le=>u.frameSize.value==le.size))||{}},delete F.value.sizes,F})},[u.frameSize.value]);const U={bike:u,setBike:c,setBikeAttr:z,resetBike:w,results:p,loading:b,setLoading:m,compatibleCollections:P,currentBike:t,setCurrentBike:r,removeBike:D,saveBike:k,lounge:i};return g(sf.Provider,{value:U,children:n})},Ht=()=>{const n=Vs(sf);if(!n)throw new Error("useBikeState must be used within a BikeProvider");return n};function Fr(){const{t:n}=De(),t=window.BikeMatrix.getConfig(),[r,i]=K(null);return t.internalLink&&i(t.internalLink),g(ie,{children:[g("p",{class:"text-gray-600 max-w-sm mx-auto mt-4 text-center font-normal text-xs",children:n("bikeselector_home_footer_message")}),g("a",{href:r||"https://bikematrix.io/landed-it",target:"_blank",class:"text-gray-950 block underline mb-4 font-bold mt-4 text-center text-xs",children:n("bikematrix_poweredby")})]})}const v3=n=>te("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M16.983 4.13197C16.9699 3.98064 16.8699 3.85064 16.727 3.7988C16.5837 3.74665 16.4233 3.78215 16.3155 3.88937L14.1098 6.08655L11.6647 5.31527L10.8905 2.87937L13.0961 0.682011C13.2041 0.574581 13.2393 0.414746 13.1873 0.272238C13.1348 0.129446 13.0046 0.0299881 12.8524 0.0168782C11.5129 -0.0980992 10.2004 0.378357 9.25142 1.32387C7.95176 2.61873 7.60759 4.50961 8.21705 6.12135C8.15043 6.17726 8.08471 6.2365 8.01987 6.30039L0.65736 13.2216C0.654763 13.2241 0.652203 13.2268 0.649393 13.2293C-0.216464 14.092 -0.216464 15.4955 0.649393 16.3583C1.51539 17.2209 2.91396 17.2104 3.77967 16.3477C3.78341 16.3443 3.78682 16.3408 3.79024 16.3369L10.677 8.94505C10.7398 8.88222 10.798 8.8165 10.853 8.74903C12.4713 9.3573 14.3705 9.01524 15.6713 7.71952C16.62 6.77394 17.0986 5.46628 16.983 4.13197ZM2.67019 15.4264C2.35113 15.7442 1.83439 15.744 1.51536 15.4264C1.19644 15.1089 1.19644 14.5937 1.51536 14.2761C1.83439 13.9585 2.35113 13.9585 2.67019 14.2761C2.98911 14.5937 2.98911 15.1089 2.67019 15.4264Z",fill:"black"})),_={id:null,name:null,product_category_id:null,swap:!1,version_id:null,unsaved_changes:null,translation:null},ca={bike_Key:"",bike_Type:null,bike_Name:null,bike_Variant:null,bike_Reference:null,bike_Thumbnail:null,bike_Images:null,bike_Brand_ID:0,bike_Brand:null,model_Family_ID:0,model_Family:null,model_Spec_ID:0,model_Spec:null,spec:null,bike_Size_ID:null,bike_Size:null,year:0,original_Bike_Key:null,share_Bike_Key:null,owner_Email_Address:null,brake_Configuration:null,cockpit:{stem:_,handlebar:_,seat_Post:_,seat_Post_Clamp:_,dropper_Lever:_,lockout_Lever:_,grips:_,pedals:_,saddle:_},"frame_&_fork":{fork:_,rear_Shock:_,headseat:_},drivetrain:{chainguide:_,bottom_Bracket:_,crankset:_,largest_Chainring:_,second_Largest_Chainring:_,third_Largest_Chainring:_,chainring_Spider:_,chain:_,cassette:_,rear_Derailleur:_,front_Derailleur:_,shifter_RH:_,shifter_LH:_,shift_Brake_Combo_RH:_,shift_Brake_Combo_LH:_,brake_Lever_RH:_,brake_Lever_LH:_,shifter_Adapter_RH:_,shifter_Adapter_LH:_},brakes:{brake_Caliper_Front:_,brake_Caliper_Rear:_,brake_Pads_Front:_,brake_Pads_Rear:_,brake_Rotor_Front:_,brake_Rotor_Rear:_,brake_Adapter_Front:_,brake_Adapter_Rear:_},"wheels_&_tyres":{front_Wheel:_,front_Axle:_,rear_Wheel:_,rear_Axle:_,tyre_Front:_,tyre_Rear:_},is_E_Bike:null,eMotor_System_ID:null,eBattery_ID:null,eControl_Unit_ID:null,eCharger_ID:null,eInterconnects_ID:null},da={cockpit:{stem:_,handlebar:_,seat_Post:_,seat_Post_Clamp:_,dropper_Lever:_,lockout_Lever:_,grips:_,pedals:_,saddle:_},"frame_&_fork":{headset:_,fork:_,rear_Shock:_},drivetrain:{chainguide:_,bottom_Bracket:_,crankset:_,largest_Chainring:_,second_Largest_Chainring:_,third_Largest_Chainring:_,chainring_Spider:_,chain:_,cassette:_,rear_Derailleur:_,front_Derailleur:_,shifter_RH:_,shifter_LH:_,shift_Brake_Combo_RH:_,shift_Brake_Combo_LH:_,brake_Lever_RH:_,brake_Lever_LH:_,shifter_Adapter_RH:_,shifter_Adapter_LH:_},brakes:{brake_Caliper_Front:_,brake_Caliper_Rear:_,brake_Pads_Front:_,brake_Pads_Rear:_,brake_Rotor_Front:_,brake_Rotor_Rear:_,brake_Adapter_Front:_,brake_Adapter_Rear:_},"wheels_&_tyres":{front_Wheel:_,front_Axle:_,rear_Wheel:_,rear_Axle:_,tyre_Front:_,tyre_Rear:_}},Nr={headset:{},stem:{},handlebar:{},seat_Post:{},seat_Post_Clamp:{},dropper_Lever:{},lockout_Lever:{},grips:{},pedals:{},saddle:{},fork:{},rear_Shock:{},chainguide:{},bottom_Bracket:{},crankset:{},largest_Chainring:{},second_Largest_Chainring:{},third_Largest_Chainring:{},chainring_Spider:{},chain:{},cassette:{},rear_Derailleur:{},front_Derailleur:{},shifter_RH:{},shifter_LH:{},shift_Brake_Combo_RH:{},shift_Brake_Combo_LH:{},brake_Lever_RH:{},brake_Lever_LH:{},shifter_Adapter_RH:{},shifter_Adapter_LH:{},brake_Caliper_Front:{},brake_Caliper_Rear:{},brake_Pads_Front:{},brake_Pads_Rear:{},brake_Rotor_Front:{},brake_Rotor_Rear:{},brake_Adapter_Front:{},brake_Adapter_Rear:{},front_Wheel:{},front_Axle:{},rear_Wheel:{},rear_Axle:{},tyre_Front:{},tyre_Rear:{}},fl=(n,e)=>Object.keys(n).includes(e),mi=n=>(Object.keys(Nr).forEach(e=>{Object.keys(n).forEach(t=>{`${e}_ID`===t&&(Nr[e].id=n[t]),`${e}_Name`===t&&(Nr[e].name=n[t]),`${e}_Product_Category_ID`===t&&(Nr[e].product_category_id=n[t]),`${e}_Swap`===t&&(Nr[e].swap=n[t]),`${e}_Version_ID`===t&&(Nr[e].version_id=n[t]),`${e}_Unsaved_Changes`===t&&(Nr[e].unsaved_changes=n[t])})}),Object.keys(da).forEach(e=>{Object.keys(Nr).forEach(t=>{fl(da[e],t)&&(da[e][t]=Nr[t])})}),Object.keys(da).forEach(e=>{fl(ca,e)&&(ca[e]=da[e])}),Object.keys(n).forEach(e=>{fl(ca,e)&&(ca[e]=n[e])}),ca),lf=async n=>{var t;return{bikeSpec:n.spec,brand:n.bike_Brand,brandId:n.bike_Brand_ID,frameSeries:n.spec,frameSeriesId:n.model_Spec_ID,frameSize:n.bike_Size,images:[`https://imagestore.bikematrix.io/${n.bike_Reference}/400-${n.bike_Thumbnail}`],isCustom:n.bike_Type==="Custom_Bike",isShared:n.bike_Type==="Shared_Bike",key:n.bike_Type==="Shared_Bike"?n.share_Bike_Key:n.bike_Key,model:n.model_Family,modelId:n.model_Family_ID,name:n.bike_Name,size:n.bike_Size,sizeId:n.bike_Size_ID,variant:n.bike_Variant,year:n.year,_key:`${n.year}-${(t=n.spec)==null?void 0:t.replace(" ","")}`}};function g3(){const n=window.BikeMatrix.getConfig(),{bike:e,currentBike:t,setCurrentBike:r,lounge:i,removeBike:o,resetBike:l,saveBike:u}=Ht(),{t:c}=De(),{apiUrl:f,apiKey:p,apiToken:h,isShopify:b,virtualWorkshop:m}=window.BikeMatrix.getConfig();oe(()=>{ht.value=null},[]);const P=new xt(f,p,h,b),x=async()=>{const w=new URLSearchParams(window.location.search).get("bikematrixid"),k=sessionStorage.getItem("bm_passed_id");if(!(k&&k!==null&&w===k)&&(!k||w!==k)){const D=i.find(O=>O.key===w);D?(r(D),sessionStorage.setItem("bm_passed_id",w)):D||(await A(w),sessionStorage.setItem("bm_passed_id",w))}},A=async z=>{const w=await P.getBikeBom(z);if(!(w!=null&&w.success)){n.logLevel==="verbose"&&console.error(w.logError);return}const k=mi(w.data);e.value=await lf(k),u(e.value),r(e.value)};return x(),oe(()=>{i.map(z=>{z!=null&&z.isCustom&&(vo.value=!1)})},[i]),g(ie,{children:[i!=null&&i.length?i==null?void 0:i.filter(z=>!!z._key).map(z=>g("div",{class:"mb-4 relative",children:[g("p",{className:"opacity-0 absolute",children:z.key}),g("div",{onClick:()=>o(z.key),class:"w-7 h-7 z-10 -right-2 -top-2 flex items-center justify-center absolute bg-gray-200 text-gray-800 rounded-full",children:g(ua,{class:"h-3 w-3"})}),g(gr,{compact:!0,onClick:w=>{w.preventDefault(),r((t==null?void 0:t.key)===(z==null?void 0:z.key)?null:{...z})},bike:z,selected:(t==null?void 0:t.key)===(z==null?void 0:z.key),spanner:m,custom:z==null?void 0:z.isCustom})]},z.key)):g("div",{class:Pe("relative mb-4 z-10 "),children:[g("div",{class:"w-full p-4 relative rounded-xl bg-white border border-gray-300 mb-4",children:[g("span",{class:"block rounded-lg h-6 w-1/2 bg-gray-200"}),g("img",{class:"w-auto mx-auto h-auto max-h-36 opacity-30",src:Sn("bike.png")}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),g("div",{class:Pe("w-full relative bg-white border -z-10 border-b-0 border-gray-300 rounded-t-xl h-20 mb-4","after:bottom-0 after:-inset-x-px after:-top-6 after:bg-gradient-to-t after:absolute after:from-white after:to-transparent"),children:[g("span",{class:" absolute left-4 top-4 rounded-lg h-6 w-1/2 bg-gray-200"}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),g("div",{class:" text-gray-800 text-center flex -mt-5 z-20 justify-center",children:[c("bikeselector_home_empty"),g("br",{}),c("bikeselector_home_add_a_bike")]})]}),g("button",{onClick:z=>{z.preventDefault(),l(),Oe("/add")},class:Pe("duration-300 transition-colors sticky bottom-[128px] mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",i.length&&!(t!=null&&t.key)?"bg-gray-950 text-white":i.length?"bg-gray-200 text-gray-800":"bg-gray-950 text-white",!t&&"bottom-0",t&&m&&"bottom-[128px]",t&&!m&&"bottom-[72px]"),children:[c("bikeselector_home_add_btn"),g(ua,{class:"h-3 absolute [&>path]:stroke-[2px] right-5 justify-self-end rotate-45"})]}),!!(i!=null&&i.length)&&!!(t!=null&&t.key)&&m&&g("button",{onClick:z=>{z.preventDefault(),!(t!=null&&t.isCustom)&&!(t!=null&&t.isShared)?Oe("/workshop"):t!=null&&t.isCustom&&!(t!=null&&t.isShared)?Oe("/bom"):!(t!=null&&t.isCustom)&&(t!=null&&t.isShared)&&Oe("/read-only")},class:Pe("duration-300 sticky bottom-[72px] transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-200 text-gray-800"),children:[c("virtualworkshop_title"),g(v3,{class:"h-5 absolute right-5 justify-self-end"})]}),!!(i!=null&&i.length)&&!!(t!=null&&t.key)&&g("button",{onClick:z=>{z.preventDefault(),Oe("/browse")},class:Pe("duration-300 sticky bottom-4 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center",i.length?"bg-gray-950 text-white":"bg-gray-200 text-gray-800"),children:c("bikeselector_home_browse_btn")}),g(Fr,{})]})}const b3=n=>te("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("circle",{cx:10,cy:10,r:10,fill:"#030712"}),te("path",{d:"M6.57886 11.0526L9.02922 13.191L13.4604 7.02636",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),br=({messages:n,left:e,margin:t})=>{const{t:r}=De(),[i,o]=K(""),[l,u]=K("");return oe(()=>{n&&n.indexOf(" ")>=0&&(o(n.split(" ")[0]),u(n.split(" ")[1]))},[n]),g("div",{className:`flex h-4 w-auto ${e?"justify-start":"justify-center"} ${t?"mt-1":""}`,children:n&&g("p",{className:"message text-xs text-red-500",children:r(i||n,{endpoint_location:l})})})};function fa({type:n,title:e,placeholder:t,options:r=[],disabled:i=void 0,loading:o=!1,infoVisible:l=!1,children:u=void 0,error:c=null,...f}){const{t:p}=De(),h=m=>{switch(m){case"brand":return p("bikeselector_addbike_brand_desc");case"model":return p("bikeselector_addbike_model_desc");case"framespec":return p("bikeselector_addbike_framespec_desc");case"framesize":return p("bikeselector_size_framesize_desc");default:return""}},b=(m,P)=>m==="framesize"&&P==="One Size"?p("bikeselector_size_framesize_one_size"):P;return g(ie,{children:g("div",{class:"w-full flex flex-col space-y-2",children:[g("label",{class:"text-gray-800 font-bold text",children:e}),u&&g("div",{class:Pe("!my-0 overflow-hidden box-border transition-all duration-300",l?"max-h-screen":"h-0"),children:[g("p",{class:"text-gray-600 my-1 italic text-sm",children:h(n)}),g("div",{class:Pe("rounded-xl overflow-hidden my-0 relative py-1 h-32 bg-gray-100 w-full"),children:u})]}),g("div",{class:"w-full flex items-center relative",children:[g("select",{class:Pe("rounded-xl peer !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg bg-white placeholder:text-gray-700 text-gray-700","disabled:bg-gray-100 disabled:border-gray-200 disabled:text-gray-400",f.class),disabled:i,...f,children:[g("option",{value:"",selected:!f.value,disabled:!0,children:t}),r.map(m=>g("option",{value:m.value,disabled:m.disabled,children:b(n,m.label)}))]}),o?g("span",{class:"absolute block loader animate-spin right-4 w-5 h-5"}):f.value&&typeof i=="boolean"?g(b3,{class:"right-3 absolute w-5 pointer-events-none"}):g(vr,{class:"absolute h-3 text-gray-700 pointer-events-none rotate-90 right-5 peer-disabled:text-gray-400"})]}),c&&g(br,{messages:c,left:!0,margin:5})]})})}const uf=n=>te("svg",{width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("circle",{cx:12.5,cy:12.5,r:12,fill:"white",stroke:"black"}),te("path",{d:"M9 16.0711L12.5355 12.5355M12.5355 12.5355L16.0711 9M12.5355 12.5355L16.0711 16.0711M12.5355 12.5355L9 9",stroke:"black",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),m3=`.input_container{display:flex;flex-direction:column}.input_wrapper{width:100%;border-radius:12px;padding:12px;border:1px solid #d1d5db;display:flex;align-items:center;justify-content:space-between}.input_wrapper input{width:100%}
|
|
1
|
+
(function(Mr,fe){typeof exports=="object"&&typeof module<"u"?module.exports=fe():typeof define=="function"&&define.amd?define(fe):(Mr=typeof globalThis<"u"?globalThis:Mr||self,Mr.BikeMatrix=fe())})(this,function(){"use strict";var Mr,fe,Vc,qc,Tn,Jc,Uc,Ms,Kc,ea={},_c=[],o1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ro=Array.isArray;function Wr(n,e){for(var t in e)n[t]=e[t];return n}function $c(n){var e=n.parentNode;e&&e.removeChild(n)}function te(n,e,t){var r,i,o,l={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:l[o]=e[o];if(arguments.length>2&&(l.children=arguments.length>3?Mr.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(o in n.defaultProps)l[o]===void 0&&(l[o]=n.defaultProps[o]);return ta(n,l,r,i,null)}function ta(n,e,t,r,i){var o={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Vc,__i:-1,__u:0};return i==null&&fe.vnode!=null&&fe.vnode(o),o}function s1(){return{current:null}}function ie(n){return n.children}function pr(n,e){this.props=n,this.context=e}function si(n,e){if(e==null)return n.__?si(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?si(n):null}function ed(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return ed(n)}}function Ws(n){(!n.__d&&(n.__d=!0)&&Tn.push(n)&&!no.__r++||Jc!==fe.debounceRendering)&&((Jc=fe.debounceRendering)||Uc)(no)}function no(){var n,e,t,r,i,o,l,u,c;for(Tn.sort(Ms);n=Tn.shift();)n.__d&&(e=Tn.length,r=void 0,o=(i=(t=n).__v).__e,u=[],c=[],(l=t.__P)&&((r=Wr({},i)).__v=i.__v+1,fe.vnode&&fe.vnode(r),Zs(l,r,i,t.__n,l.ownerSVGElement!==void 0,32&i.__u?[o]:null,u,o??si(i),!!(32&i.__u),c),r.__v=i.__v,r.__.__k[r.__i]=r,od(u,r,c),r.__e!=o&&ed(r)),Tn.length>e&&Tn.sort(Ms));no.__r=0}function td(n,e,t,r,i,o,l,u,c,f,p){var h,b,m,P,x,A=r&&r.__k||_c,z=e.length;for(t.__d=c,l1(t,e,A),c=t.__d,h=0;h<z;h++)(m=t.__k[h])!=null&&typeof m!="boolean"&&typeof m!="function"&&(b=m.__i===-1?ea:A[m.__i]||ea,m.__i=h,Zs(n,m,b,i,o,l,u,c,f,p),P=m.__e,m.ref&&b.ref!=m.ref&&(b.ref&&Ys(b.ref,null,m),p.push(m.ref,m.__c||P,m)),x==null&&P!=null&&(x=P),65536&m.__u||b.__k===m.__k?c=rd(m,c,n):typeof m.type=="function"&&m.__d!==void 0?c=m.__d:P&&(c=P.nextSibling),m.__d=void 0,m.__u&=-196609);t.__d=c,t.__e=x}function l1(n,e,t){var r,i,o,l,u,c=e.length,f=t.length,p=f,h=0;for(n.__k=[],r=0;r<c;r++)l=r+h,(i=n.__k[r]=(i=e[r])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?ta(null,i,null,null,null):ro(i)?ta(ie,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?ta(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=n,i.__b=n.__b+1,u=u1(i,t,l,p),i.__i=u,o=null,u!==-1&&(p--,(o=t[u])&&(o.__u|=131072)),o==null||o.__v===null?(u==-1&&h--,typeof i.type!="function"&&(i.__u|=65536)):u!==l&&(u===l+1?h++:u>l?p>c-l?h+=u-l:h--:u<l?u==l-1&&(h=u-l):h=0,u!==r+h&&(i.__u|=65536))):(o=t[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==n.__d&&(n.__d=si(o)),Fs(o,o,!1),t[l]=null,p--);if(p)for(r=0;r<f;r++)(o=t[r])!=null&&!(131072&o.__u)&&(o.__e==n.__d&&(n.__d=si(o)),Fs(o,o))}function rd(n,e,t){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=rd(r[i],e,t));return e}n.__e!=e&&(t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Zr(n,e){return e=e||[],n==null||typeof n=="boolean"||(ro(n)?n.some(function(t){Zr(t,e)}):e.push(n)),e}function u1(n,e,t,r){var i=n.key,o=n.type,l=t-1,u=t+1,c=e[t];if(c===null||c&&i==c.key&&o===c.type&&!(131072&c.__u))return t;if(r>(c!=null&&!(131072&c.__u)?1:0))for(;l>=0||u<e.length;){if(l>=0){if((c=e[l])&&!(131072&c.__u)&&i==c.key&&o===c.type)return l;l--}if(u<e.length){if((c=e[u])&&!(131072&c.__u)&&i==c.key&&o===c.type)return u;u++}}return-1}function nd(n,e,t){e[0]==="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||o1.test(e)?t:t+"px"}function io(n,e,t,r,i){var o;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||nd(n.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||nd(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+o]=t,t?r?t.u=r.u:(t.u=Date.now(),n.addEventListener(e,o?ad:id,o)):n.removeEventListener(e,o?ad:id,o);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?n.removeAttribute(e):n.setAttribute(e,t))}}function id(n){if(this.l){var e=this.l[n.type+!1];if(n.t){if(n.t<=e.u)return}else n.t=Date.now();return e(fe.event?fe.event(n):n)}}function ad(n){if(this.l)return this.l[n.type+!0](fe.event?fe.event(n):n)}function Zs(n,e,t,r,i,o,l,u,c,f){var p,h,b,m,P,x,A,z,w,k,D,O,B,L,T,X=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(c=!!(32&t.__u),o=[u=e.__e=t.__e]),(p=fe.__b)&&p(e);e:if(typeof X=="function")try{if(z=e.props,w=(p=X.contextType)&&r[p.__c],k=p?w?w.props.value:p.__:r,t.__c?A=(h=e.__c=t.__c).__=h.__E:("prototype"in X&&X.prototype.render?e.__c=h=new X(z,k):(e.__c=h=new pr(z,k),h.constructor=X,h.render=d1),w&&w.sub(h),h.props=z,h.state||(h.state={}),h.context=k,h.__n=r,b=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),X.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Wr({},h.__s)),Wr(h.__s,X.getDerivedStateFromProps(z,h.__s))),m=h.props,P=h.state,h.__v=e,b)X.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(X.getDerivedStateFromProps==null&&z!==m&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(z,k),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(z,h.__s,k)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(h.props=z,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(Z){Z&&(Z.__=e)}),D=0;D<h._sb.length;D++)h.__h.push(h._sb[D]);h._sb=[],h.__h.length&&l.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(z,h.__s,k),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(m,P,x)})}if(h.context=k,h.props=z,h.__P=n,h.__e=!1,O=fe.__r,B=0,"prototype"in X&&X.prototype.render){for(h.state=h.__s,h.__d=!1,O&&O(e),p=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do h.__d=!1,O&&O(e),p=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++B<25);h.state=h.__s,h.getChildContext!=null&&(r=Wr(Wr({},r),h.getChildContext())),b||h.getSnapshotBeforeUpdate==null||(x=h.getSnapshotBeforeUpdate(m,P)),td(n,ro(T=p!=null&&p.type===ie&&p.key==null?p.props.children:p)?T:[T],e,t,r,i,o,l,u,c,f),h.base=e.__e,e.__u&=-161,h.__h.length&&l.push(h),A&&(h.__E=h.__=null)}catch(Z){e.__v=null,c||o!=null?(e.__e=u,e.__u|=c?160:32,o[o.indexOf(u)]=null):(e.__e=t.__e,e.__k=t.__k),fe.__e(Z,e,t)}else o==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=c1(t.__e,e,t,r,i,o,l,c,f);(p=fe.diffed)&&p(e)}function od(n,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)Ys(t[r],t[++r],t[++r]);fe.__c&&fe.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(o){o.call(i)})}catch(o){fe.__e(o,i.__v)}})}function c1(n,e,t,r,i,o,l,u,c){var f,p,h,b,m,P,x,A=t.props,z=e.props,w=e.type;if(w==="svg"&&(i=!0),o!=null){for(f=0;f<o.length;f++)if((m=o[f])&&"setAttribute"in m==!!w&&(w?m.localName===w:m.nodeType===3)){n=m,o[f]=null;break}}if(n==null){if(w===null)return document.createTextNode(z);n=i?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,z.is&&z),o=null,u=!1}if(w===null)A===z||u&&n.data===z||(n.data=z);else{if(o=o&&Mr.call(n.childNodes),A=t.props||ea,!u&&o!=null)for(A={},f=0;f<n.attributes.length;f++)A[(m=n.attributes[f]).name]=m.value;for(f in A)m=A[f],f=="children"||(f=="dangerouslySetInnerHTML"?h=m:f==="key"||f in z||io(n,f,null,m,i));for(f in z)m=z[f],f=="children"?b=m:f=="dangerouslySetInnerHTML"?p=m:f=="value"?P=m:f=="checked"?x=m:f==="key"||u&&typeof m!="function"||A[f]===m||io(n,f,m,A[f],i);if(p)u||h&&(p.__html===h.__html||p.__html===n.innerHTML)||(n.innerHTML=p.__html),e.__k=[];else if(h&&(n.innerHTML=""),td(n,ro(b)?b:[b],e,t,r,i&&w!=="foreignObject",o,l,o?o[0]:t.__k&&si(t,0),u,c),o!=null)for(f=o.length;f--;)o[f]!=null&&$c(o[f]);u||(f="value",P!==void 0&&(P!==n[f]||w==="progress"&&!P||w==="option"&&P!==A[f])&&io(n,f,P,A[f],!1),f="checked",x!==void 0&&x!==n[f]&&io(n,f,x,A[f],!1))}return n}function Ys(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(r){fe.__e(r,t)}}function Fs(n,e,t){var r,i;if(fe.unmount&&fe.unmount(n),(r=n.ref)&&(r.current&&r.current!==n.__e||Ys(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){fe.__e(o,e)}r.base=r.__P=null,n.__c=void 0}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&Fs(r[i],e,t||typeof n.type!="function");t||n.__e==null||$c(n.__e),n.__=n.__e=n.__d=void 0}function d1(n,e,t){return this.constructor(n,t)}function cn(n,e,t){var r,i,o,l;fe.__&&fe.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,o=[],l=[],Zs(e,n=(!r&&t||e).__k=te(ie,null,[n]),i||ea,ea,e.ownerSVGElement!==void 0,!r&&t?[t]:i?null:e.firstChild?Mr.call(e.childNodes):null,o,!r&&t?t:i?i.__e:e.firstChild,r,l),od(o,n,l)}function Ns(n,e){cn(n,e,Ns)}function Rs(n,e,t){var r,i,o,l,u=Wr({},n.props);for(o in n.type&&n.type.defaultProps&&(l=n.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?i=e[o]:u[o]=e[o]===void 0&&l!==void 0?l[o]:e[o];return arguments.length>2&&(u.children=arguments.length>3?Mr.call(arguments,2):t),ta(n.type,u,r||n.key,i||n.ref,null)}function ra(n,e){var t={__c:e="__cC"+Kc++,__:n,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&i.some(function(u){u.__e=!0,Ws(u)})},this.sub=function(l){i.push(l);var u=l.componentWillUnmount;l.componentWillUnmount=function(){i.splice(i.indexOf(l),1),u&&u.call(l)}}),r.children}};return t.Provider.__=t.Consumer.contextType=t}Mr=_c.slice,fe={__e:function(n,e,t,r){for(var i,o,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(n)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),l=i.__d),l)return i.__E=i}catch(u){n=u}throw n}},Vc=0,qc=function(n){return n!=null&&n.constructor==null},pr.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Wr({},this.state),typeof n=="function"&&(n=n(Wr({},t),this.props)),n&&Wr(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),Ws(this))},pr.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Ws(this))},pr.prototype.render=ie,Tn=[],Uc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ms=function(n,e){return n.__v.__b-e.__v.__b},no.__r=0,Kc=0;function Gs(){return(Gs=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n}).apply(this,arguments)}var f1=["context","children"];function p1(n){this.getChildContext=function(){return n.context};var e=n.children,t=function(r,i){if(r==null)return{};var o,l,u={},c=Object.keys(r);for(l=0;l<c.length;l++)i.indexOf(o=c[l])>=0||(u[o]=r[o]);return u}(n,f1);return Rs(e,t)}function h1(){var n=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(n),this._vdom=te(p1,Gs({},this._props,{context:n.detail.context}),function e(t,r){if(t.nodeType===3)return t.data;if(t.nodeType!==1)return null;var i=[],o={},l=0,u=t.attributes,c=t.childNodes;for(l=u.length;l--;)u[l].name!=="slot"&&(o[u[l].name]=u[l].value,o[sd(u[l].name)]=u[l].value);for(l=c.length;l--;){var f=e(c[l],null),p=c[l].slot;p?o[p]=te(ld,{name:p},f):i[l]=f}var h=r?te(ld,null,i):i;return te(r||t.nodeName.toLowerCase(),o,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ns:cn)(this._vdom,this._root)}function sd(n){return n.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function v1(n,e,t){if(this._vdom){var r={};r[n]=t=t??void 0,r[sd(n)]=t,this._vdom=Rs(this._vdom,r),cn(this._vdom,this._root)}}function g1(){cn(this._vdom=null,this._root)}function ld(n,e){var t=this;return te("slot",Gs({},n,{ref:function(r){r?(t.ref=r,t._listener||(t._listener=function(i){i.stopPropagation(),i.detail.context=e},r.addEventListener("_preact",t._listener))):t.ref.removeEventListener("_preact",t._listener)}}))}function b1(n,e,t,r){function i(){var o=Reflect.construct(HTMLElement,[],i);return o._vdomComponent=n,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=h1,i.prototype.attributeChangedCallback=v1,i.prototype.disconnectedCallback=g1,t=t||n.observedAttributes||Object.keys(n.propTypes||{}),i.observedAttributes=t,t.forEach(function(o){Object.defineProperty(i.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var u=typeof l;l!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(o,l)}})}),customElements.define(e||n.tagName||n.displayName||n.name,i)}var dn,Ze,Qs,ud,li=0,cd=[],ao=[],Qe=fe,dd=Qe.__b,fd=Qe.__r,pd=Qe.diffed,hd=Qe.__c,vd=Qe.unmount,gd=Qe.__;function ui(n,e){Qe.__h&&Qe.__h(Ze,n,li||e),li=0;var t=Ze.__H||(Ze.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({__V:ao}),t.__[n]}function K(n){return li=1,bd(wd,n)}function bd(n,e,t){var r=ui(dn++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):wd(void 0,e),function(u){var c=r.__N?r.__N[0]:r.__[0],f=r.t(c,u);c!==f&&(r.__N=[f,r.__[1]],r.__c.setState({}))}],r.__c=Ze,!Ze.u)){var i=function(u,c,f){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(b){return!!b.__c});if(p.every(function(b){return!b.__N}))return!o||o.call(this,u,c,f);var h=!1;return p.forEach(function(b){if(b.__N){var m=b.__[0];b.__=b.__N,b.__N=void 0,m!==b.__[0]&&(h=!0)}}),!(!h&&r.__c.props===u)&&(!o||o.call(this,u,c,f))};Ze.u=!0;var o=Ze.shouldComponentUpdate,l=Ze.componentWillUpdate;Ze.componentWillUpdate=function(u,c,f){if(this.__e){var p=o;o=void 0,i(u,c,f),o=p}l&&l.call(this,u,c,f)},Ze.shouldComponentUpdate=i}return r.__N||r.__}function oe(n,e){var t=ui(dn++,3);!Qe.__s&&Js(t.__H,e)&&(t.__=n,t.i=e,Ze.__H.__h.push(t))}function ci(n,e){var t=ui(dn++,4);!Qe.__s&&Js(t.__H,e)&&(t.__=n,t.i=e,Ze.__h.push(t))}function be(n){return li=5,zr(function(){return{current:n}},[])}function m1(n,e,t){li=6,ci(function(){return typeof n=="function"?(n(e()),function(){return n(null)}):n?(n.current=e(),function(){return n.current=null}):void 0},t==null?t:t.concat(n))}function zr(n,e){var t=ui(dn++,7);return Js(t.__H,e)?(t.__V=n(),t.i=e,t.__h=n,t.__V):t.__}function md(n,e){return li=8,zr(function(){return n},e)}function Vs(n){var e=Ze.context[n.__c],t=ui(dn++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(Ze)),e.props.value):n.__}function y1(n,e){Qe.useDebugValue&&Qe.useDebugValue(e?e(n):n)}function w1(){var n=ui(dn++,11);if(!n.__){for(var e=Ze.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);n.__="P"+t[0]+"-"+t[1]++}return n.__}function x1(){for(var n;n=cd.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(oo),n.__H.__h.forEach(qs),n.__H.__h=[]}catch(e){n.__H.__h=[],Qe.__e(e,n.__v)}}Qe.__b=function(n){Ze=null,dd&&dd(n)},Qe.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),gd&&gd(n,e)},Qe.__r=function(n){fd&&fd(n),dn=0;var e=(Ze=n.__c).__H;e&&(Qs===Ze?(e.__h=[],Ze.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=ao,t.__N=t.i=void 0})):(e.__h.forEach(oo),e.__h.forEach(qs),e.__h=[],dn=0)),Qs=Ze},Qe.diffed=function(n){pd&&pd(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(cd.push(e)!==1&&ud===Qe.requestAnimationFrame||((ud=Qe.requestAnimationFrame)||P1)(x1)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==ao&&(t.__=t.__V),t.i=void 0,t.__V=ao})),Qs=Ze=null},Qe.__c=function(n,e){e.some(function(t){try{t.__h.forEach(oo),t.__h=t.__h.filter(function(r){return!r.__||qs(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Qe.__e(r,t.__v)}}),hd&&hd(n,e)},Qe.unmount=function(n){vd&&vd(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{oo(r)}catch(i){e=i}}),t.__H=void 0,e&&Qe.__e(e,t.__v))};var yd=typeof requestAnimationFrame=="function";function P1(n){var e,t=function(){clearTimeout(r),yd&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);yd&&(e=requestAnimationFrame(t))}function oo(n){var e=Ze,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),Ze=e}function qs(n){var e=Ze;n.__c=n.__(),Ze=e}function Js(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function wd(n,e){return typeof e=="function"?e(n):e}function xd(n,e){for(var t in e)n[t]=e[t];return n}function Us(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function Ks(n,e){this.props=n,this.context=e}function k1(n,e){function t(i){var o=this.props.ref,l=o==i.ref;return!l&&o&&(o.call?o(null):o.current=null),e?!e(this.props,i)||!l:Us(this.props,i)}function r(i){return this.shouldComponentUpdate=t,te(n,i)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Ks.prototype=new pr).isPureReactComponent=!0,Ks.prototype.shouldComponentUpdate=function(n,e){return Us(this.props,n)||Us(this.state,e)};var Pd=fe.__b;fe.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Pd&&Pd(n)};var z1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function _s(n){function e(t){var r=xd({},t);return delete r.ref,n(r,t.ref||null)}return e.$$typeof=z1,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}var kd=function(n,e){return n==null?null:Zr(Zr(n).map(e))},C1={map:kd,forEach:kd,count:function(n){return n?Zr(n).length:0},only:function(n){var e=Zr(n);if(e.length!==1)throw"Children.only";return e[0]},toArray:Zr},A1=fe.__e;fe.__e=function(n,e,t,r){if(n.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}A1(n,e,t,r)};var zd=fe.unmount;function Cd(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=xd({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return Cd(r,e,t)})),n}function Ad(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return Ad(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function so(){this.__u=0,this.t=null,this.__b=null}function Hd(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function H1(n){var e,t,r;function i(o){if(e||(e=n()).then(function(l){t=l.default||l},function(l){r=l}),r)throw r;if(!t)throw e;return te(t,o)}return i.displayName="Lazy",i.__f=!0,i}function na(){this.u=null,this.o=null}fe.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),zd&&zd(n)},(so.prototype=new pr).__c=function(n,e){var t=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(t);var i=Hd(r.__v),o=!1,l=function(){o||(o=!0,t.__R=null,i?i(u):u())};t.__R=l;var u=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=Ad(c,c.__c.__P,c.__c.__O)}var f;for(r.setState({__a:r.__b=null});f=r.t.pop();)f.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(l,l)},so.prototype.componentWillUnmount=function(){this.t=[]},so.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Cd(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&te(ie,null,n.fallback);return i&&(i.__u&=-33),[te(ie,null,e.__a?null:n.children),i]};var Dd=function(n,e,t){if(++t[1]===t[0]&&n.o.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.o.size))for(t=n.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.u=t=t[2]}};function D1(n){return this.getChildContext=function(){return n.context},n.children}function O1(n){var e=this,t=n.i;e.componentWillUnmount=function(){cn(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),cn(te(D1,{context:e.context},n.__v),e.l)}function X1(n,e){var t=te(O1,{__v:n,i:e});return t.containerInfo=e,t}(na.prototype=new pr).__a=function(n){var e=this,t=Hd(e.__v),r=e.o.get(n);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),Dd(e,n,r)):i()};t?t(o):o()}},na.prototype.render=function(n){this.u=null,this.o=new Map;var e=Zr(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return n.children},na.prototype.componentDidUpdate=na.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(e,t){Dd(n,t,e)})};var Od=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,E1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,L1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,B1=/[A-Z0-9]/g,j1=typeof document<"u",T1=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};function I1(n,e,t){return e.__k==null&&(e.textContent=""),cn(n,e),typeof t=="function"&&t(),n?n.__c:null}function S1(n,e,t){return Ns(n,e),typeof t=="function"&&t(),n?n.__c:null}pr.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(pr.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var Xd=fe.event;function M1(){}function W1(){return this.cancelBubble}function Z1(){return this.defaultPrevented}fe.event=function(n){return Xd&&(n=Xd(n)),n.persist=M1,n.isPropagationStopped=W1,n.isDefaultPrevented=Z1,n.nativeEvent=n};var $s,Y1={enumerable:!1,configurable:!0,get:function(){return this.class}},Ed=fe.vnode;fe.vnode=function(n){typeof n.type=="string"&&function(e){var t=e.props,r=e.type,i={};for(var o in t){var l=t[o];if(!(o==="value"&&"defaultValue"in t&&l==null||j1&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var u=o.toLowerCase();o==="defaultValue"&&"value"in t&&t.value==null?o="value":o==="download"&&l===!0?l="":u==="translate"&&l==="no"?l=!1:u==="ondoubleclick"?o="ondblclick":u!=="onchange"||r!=="input"&&r!=="textarea"||T1(t.type)?u==="onfocus"?o="onfocusin":u==="onblur"?o="onfocusout":L1.test(o)?o=u:r.indexOf("-")===-1&&E1.test(o)?o=o.replace(B1,"-$&").toLowerCase():l===null&&(l=void 0):u=o="oninput",u==="oninput"&&i[o=u]&&(o="oninputCapture"),i[o]=l}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Zr(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=Zr(t.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",Y1)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(n),n.$$typeof=Od,Ed&&Ed(n)};var Ld=fe.__r;fe.__r=function(n){Ld&&Ld(n),$s=n.__c};var Bd=fe.diffed;fe.diffed=function(n){Bd&&Bd(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),$s=null};var F1={ReactCurrentDispatcher:{current:{readContext:function(n){return $s.__n[n.__c].props.value}}}};function N1(n){return te.bind(null,n)}function lo(n){return!!n&&n.$$typeof===Od}function R1(n){return lo(n)&&n.type===ie}function G1(n){return lo(n)?Rs.apply(null,arguments):n}function Q1(n){return!!n.__k&&(cn(null,n),!0)}function V1(n){return n&&(n.base||n.nodeType===1&&n)||null}var q1=function(n,e){return n(e)},J1=function(n,e){return n(e)},U1=ie;function jd(n){n()}function K1(n){return n}function _1(){return[!1,jd]}var $1=ci,eg=lo;function tg(n,e){var t=e(),r=K({h:{__:t,v:e}}),i=r[0].h,o=r[1];return ci(function(){i.__=t,i.v=e,el(i)&&o({h:i})},[n,t,e]),oe(function(){return el(i)&&o({h:i}),n(function(){el(i)&&o({h:i})})},[n]),t}function el(n){var e,t,r=n.v,i=n.__;try{var o=r();return!((e=i)===(t=o)&&(e!==0||1/e==1/t)||e!=e&&t!=t)}catch{return!0}}var it={useState:K,useId:w1,useReducer:bd,useEffect:oe,useLayoutEffect:ci,useInsertionEffect:$1,useTransition:_1,useDeferredValue:K1,useSyncExternalStore:tg,startTransition:jd,useRef:be,useImperativeHandle:m1,useMemo:zr,useCallback:md,useContext:Vs,useDebugValue:y1,version:"17.0.2",Children:C1,render:I1,hydrate:S1,unmountComponentAtNode:Q1,createPortal:X1,createElement:te,createContext:ra,createFactory:N1,cloneElement:G1,createRef:s1,Fragment:ie,isValidElement:lo,isElement:eg,isFragment:R1,findDOMNode:V1,Component:pr,PureComponent:Ks,memo:k1,forwardRef:_s,flushSync:J1,unstable_batchedUpdates:q1,StrictMode:U1,Suspense:so,SuspenseList:na,lazy:H1,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:F1},fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const ng=(...n)=>{console!=null&&console.warn&&(In(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),console.warn(...n))},Td={},tl=(...n)=>{In(n[0])&&Td[n[0]]||(In(n[0])&&(Td[n[0]]=new Date),ng(...n))},Id=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},Sd=(n,e,t)=>{n.loadNamespaces(e,Id(n,t))},Md=(n,e,t,r)=>{In(t)&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,Id(n,r))},ig=(n,e,t={})=>!e.languages||!e.languages.length?(tl("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(n,{lng:t.lng,precheck:(r,i)=>{var o;if(((o=t.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,n))return!1}}),In=n=>typeof n=="string",ag=n=>typeof n=="object"&&n!==null,og=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,sg={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},lg=n=>sg[n];let rl={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:n=>n.replace(og,lg)};const ug=(n={})=>{rl={...rl,...n}},cg=()=>rl;let Wd;const dg=n=>{Wd=n},di=()=>Wd,fg={type:"3rdParty",init(n){ug(n.options.react),dg(n)}},pg=ra();class hg{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const vg=(n,e)=>{const t=be();return oe(()=>{t.current=e?t.current:n},[n,e]),t.current},Zd=(n,e,t,r)=>n.getFixedT(e,t,r),gg=(n,e,t,r)=>md(Zd(n,e,t,r),[n,e,t,r]),De=(n,e={})=>{var D,O,B,L;const{i18n:t}=e,{i18n:r,defaultNS:i}=Vs(pg)||{},o=t||r||di();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new hg),!o){tl("You will need to pass in an i18next instance by using initReactI18next");const T=(Z,W)=>In(W)?W:ag(W)&&In(W.defaultValue)?W.defaultValue:Array.isArray(Z)?Z[Z.length-1]:Z,X=[T,{},!1];return X.t=T,X.i18n={},X.ready=!1,X}(D=o.options.react)!=null&&D.wait&&tl("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...cg(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=l;let f=n||i||((O=o.options)==null?void 0:O.defaultNS);f=In(f)?[f]:f||["translation"],(L=(B=o.reportNamespaces).addUsedNamespaces)==null||L.call(B,f);const p=(o.isInitialized||o.initializedStoreOnce)&&f.every(T=>ig(T,o,l)),h=gg(o,e.lng||null,l.nsMode==="fallback"?f:f[0],c),b=()=>h,m=()=>Zd(o,e.lng||null,l.nsMode==="fallback"?f:f[0],c),[P,x]=K(b);let A=f.join();e.lng&&(A=`${e.lng}${A}`);const z=vg(A),w=be(!0);oe(()=>{const{bindI18n:T,bindI18nStore:X}=l;w.current=!0,!p&&!u&&(e.lng?Md(o,e.lng,f,()=>{w.current&&x(m)}):Sd(o,f,()=>{w.current&&x(m)})),p&&z&&z!==A&&w.current&&x(m);const Z=()=>{w.current&&x(m)};return T&&(o==null||o.on(T,Z)),X&&(o==null||o.store.on(X,Z)),()=>{w.current=!1,o&&(T==null||T.split(" ").forEach(W=>o.off(W,Z))),X&&o&&X.split(" ").forEach(W=>o.store.off(W,Z))}},[o,A]),oe(()=>{w.current&&p&&x(b)},[o,c,p]);const k=[P,o,p];if(k.t=P,k.i18n=o,k.ready=p,p||!p&&!u)return k;throw new Promise(T=>{e.lng?Md(o,e.lng,f,()=>T()):Sd(o,f,()=>T())})};var bg=Symbol.for("preact-signals");function uo(){if(pn>1)pn--;else{for(var n,e=!1;ia!==void 0;){var t=ia;for(ia=void 0,nl++;t!==void 0;){var r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&Fd(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(nl=0,pn--,e)throw n}}function mg(n){if(pn>0)return n();pn++;try{return n()}finally{uo()}}var Be=void 0,ia=void 0,pn=0,nl=0,co=0;function Yd(n){if(Be!==void 0){var e=n.n;if(e===void 0||e.t!==Be)return e={i:0,S:n,p:Be.s,n:void 0,t:Be,e:void 0,x:void 0,r:e},Be.s!==void 0&&(Be.s.n=e),Be.s=e,n.n=e,32&Be.f&&n.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Be.s,e.n=void 0,Be.s.n=e,Be.s=e),e}}function ct(n){this.v=n,this.i=0,this.n=void 0,this.t=void 0}ct.prototype.brand=bg,ct.prototype.h=function(){return!0},ct.prototype.S=function(n){this.t!==n&&n.e===void 0&&(n.x=this.t,this.t!==void 0&&(this.t.e=n),this.t=n)},ct.prototype.U=function(n){if(this.t!==void 0){var e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t)}},ct.prototype.subscribe=function(n){var e=this;return al(function(){var t=e.value,r=Be;Be=void 0;try{n(t)}finally{Be=r}})},ct.prototype.valueOf=function(){return this.value},ct.prototype.toString=function(){return this.value+""},ct.prototype.toJSON=function(){return this.value},ct.prototype.peek=function(){var n=Be;Be=void 0;try{return this.value}finally{Be=n}},Object.defineProperty(ct.prototype,"value",{get:function(){var n=Yd(this);return n!==void 0&&(n.i=this.i),this.v},set:function(n){if(n!==this.v){if(nl>100)throw new Error("Cycle detected");this.v=n,this.i++,co++,pn++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{uo()}}}});function wt(n){return new ct(n)}function Fd(n){for(var e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Nd(n){for(var e=n.s;e!==void 0;e=e.n){var t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Rd(n){for(var e=n.s,t=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):t=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}n.s=t}function fi(n){ct.call(this,void 0),this.x=n,this.s=void 0,this.g=co-1,this.f=4}(fi.prototype=new ct).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===co))return!0;if(this.g=co,this.f|=1,this.i>0&&!Fd(this))return this.f&=-2,!0;var n=Be;try{Nd(this),Be=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Be=n,Rd(this),this.f&=-2,!0},fi.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ct.prototype.S.call(this,n)},fi.prototype.U=function(n){if(this.t!==void 0&&(ct.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},fi.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(fi.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=Yd(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}});function yg(n){return new fi(n)}function Gd(n){var e=n.u;if(n.u=void 0,typeof e=="function"){pn++;var t=Be;Be=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,il(n),r}finally{Be=t,uo()}}}function il(n){for(var e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Gd(n)}function wg(n){if(Be!==this)throw new Error("Out-of-order effect");Rd(this),Be=n,this.f&=-2,8&this.f&&il(this),uo()}function aa(n){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}aa.prototype.c=function(){var n=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},aa.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Gd(this),Nd(this),pn++;var n=Be;return Be=this,wg.bind(this,n)},aa.prototype.N=function(){2&this.f||(this.f|=2,this.o=ia,ia=this)},aa.prototype.d=function(){this.f|=8,1&this.f||il(this)};function al(n){var e=new aa(n);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}var ol;function pi(n,e){fe[n]=e.bind(null,fe[n]||function(){})}function fo(n){ol&&ol(),ol=n&&n.S()}function Qd(n){var e=this,t=n.data,r=Pg(t);r.value=t;var i=zr(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var l,u=e.__$u.S(),c=i.value;u(),qc(c)||((l=e.base)==null?void 0:l.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=c},yg(function(){var l=r.value.value;return l===0?0:l===!0?"":l||""})},[]);return i.value}Qd.displayName="_st",Object.defineProperties(ct.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Qd},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),pi("__b",function(n,e){if(typeof e.type=="string"){var t,r=e.props;for(var i in r)if(i!=="children"){var o=r[i];o instanceof ct&&(t||(e.__np=t={}),t[i]=o,r[i]=o.peek())}}n(e)}),pi("__r",function(n,e){fo();var t,r=e.__c;r&&(r.__$f&=-2,(t=r.__$u)===void 0&&(r.__$u=t=function(i){var o;return al(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),fo(t),n(e)}),pi("__e",function(n,e,t,r){fo(),n(e,t,r)}),pi("diffed",function(n,e){fo();var t;if(typeof e.type=="string"&&(t=e.__e)){var r=e.__np,i=e.props;if(r){var o=t.U;if(o)for(var l in o){var u=o[l];u!==void 0&&!(l in r)&&(u.d(),o[l]=void 0)}else t.U=o={};for(var c in r){var f=o[c],p=r[c];f===void 0?(f=xg(t,c,p,i),o[c]=f):f.o(p,i)}}}n(e)});function xg(n,e,t,r){var i=e in n&&n.ownerSVGElement===void 0,o=wt(t);return{o:function(l,u){o.value=l,r=u},d:al(function(){var l=o.value.value;r[e]!==l&&(r[e]=l,i?n[e]=l:l?n.setAttribute(e,l):n.removeAttribute(e))})}}pi("unmount",function(n,e){if(typeof e.type=="string"){var t=e.__e;if(t){var r=t.U;if(r){t.U=void 0;for(var i in r){var o=r[i];o&&o.d()}}}}else{var l=e.__c;if(l){var u=l.__$u;u&&(l.__$u=void 0,u.d())}}n(e)}),pi("__h",function(n,e,t,r){(r<3||r===9)&&(e.__$f|=2),n(e,t,r)}),pr.prototype.shouldComponentUpdate=function(n,e){var t=this.__$u;if(!(t&&t.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var r in e)return!0;for(var i in n)if(i!=="__source"&&n[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function Pg(n){return zr(function(){return wt(n)},[])}const sl=wt(!1),xe=wt(null),hi=wt([]),tr=wt(!1),vi=wt([]),hr=wt(!1),po=wt(null),ht=wt(null),ho=wt(!1),vo=wt(!0),oa=wt(!1),kg=()=>{mg(()=>{xe.value=null,hi.value=[],tr.value=!1,vi.value=[],hr.value=!1,po.value=null,ht.value=null,ho.value=!1,vo.value=!0,oa.value=!1})},ll="bm_currentBike",zg="v2",Cg="https://cdn.bikematrix.io",Vd={isShopify:!1,skuField:"sku",apiUrl:"https://api.bikematrix.io/proxy/v3/",apiKey:"",apiToken:"",currentCollectionHandle:"",categories:[],collections:[],pageType:"index",showHomePageCollection:!1,showSearchPageCollection:!1,designMode:!1,bikeSelectorBrands:"",productsCollections:{},isHomePage:!1,isSearchPage:!1,products:{},collectionUrl:"",compatiblityListCurrentPage:0,showCompatibleList:!0,sku:"",productCollections:[],logLevel:"none",virtualWorkshop:!0,internalLink:""},Sn=function(n){return new URL(n,Cg).toString()};function qd(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=qd(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Ag(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=qd(n))&&(r&&(r+=" "),r+=e);return r}const ul="-";function Hg(n){const e=Og(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;function i(l){const u=l.split(ul);return u[0]===""&&u.length!==1&&u.shift(),Jd(u,e)||Dg(l)}function o(l,u){const c=t[l]||[];return u&&r[l]?[...c,...r[l]]:c}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function Jd(n,e){var l;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),i=r?Jd(n.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=n.join(ul);return(l=e.validators.find(({validator:u})=>u(o)))==null?void 0:l.classGroupId}const Ud=/^\[(.+)\]$/;function Dg(n){if(Ud.test(n)){const e=Ud.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function Og(n){const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Eg(Object.entries(n.classGroups),t).forEach(([o,l])=>{cl(l,r,o,e)}),r}function cl(n,e,t,r){n.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Kd(e,i);o.classGroupId=t;return}if(typeof i=="function"){if(Xg(i)){cl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([o,l])=>{cl(l,Kd(e,o),t,r)})})}function Kd(n,e){let t=n;return e.split(ul).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function Xg(n){return n.isThemeGetter}function Eg(n,e){return e?n.map(([t,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,u])=>[e+l,u])):o);return[t,i]}):n}function Lg(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function i(o,l){t.set(o,l),e++,e>n&&(e=0,r=t,t=new Map)}return{get(o){let l=t.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return i(o,l),l},set(o,l){t.has(o)?t.set(o,l):i(o,l)}}}const _d="!";function Bg(n){const e=n.separator,t=e.length===1,r=e[0],i=e.length;return function(l){const u=[];let c=0,f=0,p;for(let x=0;x<l.length;x++){let A=l[x];if(c===0){if(A===r&&(t||l.slice(x,x+i)===e)){u.push(l.slice(f,x)),f=x+i;continue}if(A==="/"){p=x;continue}}A==="["?c++:A==="]"&&c--}const h=u.length===0?l:l.substring(f),b=h.startsWith(_d),m=b?h.substring(1):h,P=p&&p>f?p-f:void 0;return{modifiers:u,hasImportantModifier:b,baseClassName:m,maybePostfixModifierPosition:P}}}function jg(n){if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function Tg(n){return{cache:Lg(n.cacheSize),splitModifiers:Bg(n),...Hg(n)}}const Ig=/\s+/;function Sg(n,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return n.trim().split(Ig).map(l=>{const{modifiers:u,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:p}=t(l);let h=r(p?f.substring(0,p):f),b=!!p;if(!h){if(!p)return{isTailwindClass:!1,originalClassName:l};if(h=r(f),!h)return{isTailwindClass:!1,originalClassName:l};b=!1}const m=jg(u).join(":");return{isTailwindClass:!0,modifierId:c?m+_d:m,classGroupId:h,originalClassName:l,hasPostfixModifier:b}}).reverse().filter(l=>{if(!l.isTailwindClass)return!0;const{modifierId:u,classGroupId:c,hasPostfixModifier:f}=l,p=u+c;return o.has(p)?!1:(o.add(p),i(c,f).forEach(h=>o.add(u+h)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function Mg(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=$d(e))&&(r&&(r+=" "),r+=t);return r}function $d(n){if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=$d(n[r]))&&(t&&(t+=" "),t+=e);return t}function Wg(n,...e){let t,r,i,o=l;function l(c){const f=e.reduce((p,h)=>h(p),n());return t=Tg(f),r=t.cache.get,i=t.cache.set,o=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=Sg(c,t);return i(c,p),p}return function(){return o(Mg.apply(null,arguments))}}function Ye(n){const e=t=>t[n]||[];return e.isThemeGetter=!0,e}const ef=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zg=/^\d+\/\d+$/,Yg=new Set(["px","full","screen"]),Fg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ng=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Rg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Yr(n){return Mn(n)||Yg.has(n)||Zg.test(n)}function hn(n){return gi(n,"length",e3)}function Mn(n){return!!n&&!Number.isNaN(Number(n))}function go(n){return gi(n,"number",Mn)}function sa(n){return!!n&&Number.isInteger(Number(n))}function Vg(n){return n.endsWith("%")&&Mn(n.slice(0,-1))}function me(n){return ef.test(n)}function vn(n){return Fg.test(n)}const qg=new Set(["length","size","percentage"]);function Jg(n){return gi(n,qg,tf)}function Ug(n){return gi(n,"position",tf)}const Kg=new Set(["image","url"]);function _g(n){return gi(n,Kg,r3)}function $g(n){return gi(n,"",t3)}function la(){return!0}function gi(n,e,t){const r=ef.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function e3(n){return Ng.test(n)&&!Rg.test(n)}function tf(){return!1}function t3(n){return Gg.test(n)}function r3(n){return Qg.test(n)}function n3(){const n=Ye("colors"),e=Ye("spacing"),t=Ye("blur"),r=Ye("brightness"),i=Ye("borderColor"),o=Ye("borderRadius"),l=Ye("borderSpacing"),u=Ye("borderWidth"),c=Ye("contrast"),f=Ye("grayscale"),p=Ye("hueRotate"),h=Ye("invert"),b=Ye("gap"),m=Ye("gradientColorStops"),P=Ye("gradientColorStopPositions"),x=Ye("inset"),A=Ye("margin"),z=Ye("opacity"),w=Ye("padding"),k=Ye("saturate"),D=Ye("scale"),O=Ye("sepia"),B=Ye("skew"),L=Ye("space"),T=Ye("translate"),X=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",me,e],N=()=>[me,e],V=()=>["",Yr,hn],J=()=>["auto",Mn,me],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],F=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",me],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[Mn,go],ve=()=>[Mn,me];return{cacheSize:500,separator:":",theme:{colors:[la],spacing:[Yr,hn],blur:["none","",vn,me],brightness:le(),borderColor:[n],borderRadius:["none","","full",vn,me],borderSpacing:N(),borderWidth:V(),contrast:le(),grayscale:M(),hueRotate:ve(),invert:M(),gap:N(),gradientColorStops:[n],gradientColorStopPositions:[Vg,hn],inset:W(),margin:W(),opacity:le(),padding:N(),saturate:le(),scale:le(),sepia:M(),skew:ve(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[vn]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),me]}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sa,me]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",sa,me]}],"grid-cols":[{"grid-cols":[la]}],"col-start-end":[{col:["auto",{span:["full",sa,me]},me]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[la]}],"row-start-end":[{row:["auto",{span:[sa,me]},me]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[A]}],mx:[{mx:[A]}],my:[{my:[A]}],ms:[{ms:[A]}],me:[{me:[A]}],mt:[{mt:[A]}],mr:[{mr:[A]}],mb:[{mb:[A]}],ml:[{ml:[A]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,e]}],"min-w":[{"min-w":[me,e,"min","max","fit"]}],"max-w":[{"max-w":[me,e,"none","full","min","max","fit","prose",{screen:[vn]},vn]}],h:[{h:[me,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,e,"auto","min","max","fit"]}],"font-size":[{text:["base",vn,hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",go]}],"font-family":[{font:[la]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",Mn,go]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yr,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[z]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yr,hn]}],"underline-offset":[{"underline-offset":["auto",Yr,me]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[z]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),Ug]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_g]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[z]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[z]}],"divide-style":[{divide:U()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Yr,me]}],"outline-w":[{outline:[Yr,hn]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[z]}],"ring-offset-w":[{"ring-offset":[Yr,hn]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",vn,$g]}],"shadow-color":[{shadow:[la]}],opacity:[{opacity:[z]}],"mix-blend":[{"mix-blend":$()}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",vn,me]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[h]}],saturate:[{saturate:[k]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[z]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:ve()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:ve()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[D]}],"scale-x":[{"scale-x":[D]}],"scale-y":[{"scale-y":[D]}],rotate:[{rotate:[sa,me]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Yr,hn,go]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const i3=Wg(n3);function Pe(...n){return i3(Ag(n))}const a3={shopify:{bikeBrands:"bike/brands",bikeModels:"bike/models",framesSeries:"bike/frameSeries",bikeSpecs:"bike/bikeSpecBikes",bikeSpecYears:"bike/bikeSpecYears",bikeSpecSizes:"bike/bikeSpecSizes",bikeBrandProductCategories:"bike/bikeBrandProductCategories",checkSku:"compatibility/checkSku",checkSkus:"compatibility/checkSkus",checkSkusWithResults:"compatibility/checkSkusWithResults",bikeBom:"workshop/bikeBom",customBike:"workshop/addCustomBike",addComponent:"workshop/addComponent",findProducts:"workshop/findProducts",removeComponent:"workshop/removeComponent",revertComponent:"workshop/revertComponent",saveCustomBike:"workshop/saveCustomBike",updateCustomBike:"workshop/updateCustomBike",updateCustomBikeName:"workshop/updateCustomBikeName"},bikematrix:{bikeBrands:"GetBikeBrands",bikeModels:"GetBikeModels",framesSeries:"GetBikeFrameSeries",bikeSpecs:"GetBikeSpecBikes",bikeSpecYears:"GetBikeSpecYears",bikeSpecSizes:"GetBikeSpecSizes",bikeBrandProductCategories:"GetBikeBrandProductCategories",checkSku:"Compatibility_CheckSku",checkSkus:"Compatibility_CheckSkus",checkSkusWithResults:"Compatibility_CheckSkusWithResults",bikeBom:"GetBikeBillOfMaterials",customBike:"AddCustomBike",addComponent:"AddComponent",findProducts:"FindProducts",removeComponent:"RemoveComponent",revertComponent:"RevertComponent",saveCustomBike:"SaveCustomBike",updateCustomBike:"UpdateCustomBike",updateCustomBikeName:"UpdateCustomBikeName"}};class xt{constructor(e,t,r,i){this._apiUrl=i?window.location.origin+"/apps/proxy/api/":e,this._apiKey=t??"",this._apiToken=r??"",this._apiType=i?"shopify":"bikematrix"}getEndpoint(e){return a3[this._apiType][e]}async getBikeBrands(){const e=this.getEndpoint("bikeBrands"),t=await this.makeRequest(e);return t.success?{success:t.success,data:t.data}:{success:t.success,error:"error_generic GetBikeBrands",logError:t.error}}async getBikeModels(e){if(!e)return{success:!1,error:"error_generic"};const t=this.getEndpoint("bikeModels"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeModels",logError:r.error}}async getBikeFrameSeries(e){if(!e)return{error:"error_generic",success:!1};const t=this.getEndpoint("framesSeries"),r=await this.makeRequest(t,{params:{bikeModelId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeFrameSeries",logError:r.error}}async getBikeSpecs(e){if(!e)return{success:!1,error:"error_generic GetBikeSpecs"};const t=this.getEndpoint("bikeSpecs"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeSpecs",logError:r.error}}async getYears(e){if(!e)return{error:"error_generic GetBikeYears",success:!1};const t=this.getEndpoint("bikeSpecYears"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{error:"error_generic GetBikeYears",success:!1,logError:r.success}}async getFrameSizes(e,t,r){if(!e||!t)return{success:!1,error:"error_generic GetFrameSizes"};const i=this.getEndpoint("bikeSpecSizes"),o=await this.makeRequest(i,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetFrameSizes",logError:o.error}}async getBikes(e,t,r){if(e&&(t||r)){const i=this.getEndpoint("bikeSpecs"),o=await this.makeRequest(i,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetBikes",logError:o.error}}else return{success:!1,error:"error_generic GetBikes"}}async getBrandProductCategories(e){if(e){const t=this.getEndpoint("bikeBrandProductCategories"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:!0}:(console.error(r.error),{success:!1,error:"error_generic GetBrandProductCategories",logError:r.error})}else return{success:!1,error:"error_generic GetBrandProductCategories"}}async checkSkuCompatibility(e,t,r){if(e&&t){const i=this.getEndpoint("checkSku")+`/${e}/${t}/${r}`,o=await this.makeRequest(i);return o.success?{success:o.success,data:o.data}:{success:o.success,error:"error_generic CheckSkuCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkuCompatibility"}}async checkSkusCompatibility(e,t,r){if(e&&t){const i=this.getEndpoint("checkSkus")+`/${e}/${t}/${r}`,o=await this.makeRequest(i);return o.success?{data:o.data,success:o.success,logError:o.error}:{success:o.success,error:"error_generic CheckSkusCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkusCompatibility"}}async checkSkusCompatibilityWithResults(e,t,r,i={}){if(e&&t){const o=this.getEndpoint("checkSkusWithResults")+`/${e}/${r}`,l=await this.makeRequest(o,{body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"},...i});return l.success?{data:l.data,success:l.success}:{success:l.success,error:"error_compatiblelist",logError:l.error}}else return{success:!1,error:"error_compatiblelist"}}async getActiveSubscription(e){if(this._apiType!=="shopify"){e({activeSubscription:!0});return}var t="activeSubscription";const r=await this.makeRequest(t);if(!r.success){console.log(`getActiveSubscription Error: ${r.error}`);return}e(r.data)}async getBikeBom(e){if(!e)return{success:!1,error:"error_generic getBikeBom"};const t=this.getEndpoint("bikeBom"),r=await this.makeRequest(t,{params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_get_bike_bom",logError:r.error}}async addCustomBike(e){if(!e)return{success:!1,error:"error_generic addCustomBike"};const t=this.getEndpoint("customBike"),r=await this.makeRequest(t,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_add_custom_bike",logError:r.error}}async findProducts(e,t){if(!e)return{success:!1,error:"error_generic findProducts"};const r=this.getEndpoint("findProducts"),i=await this.makeRequest(r,{params:{search:e,productCategoryId:t,recordCount:20}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_find_products",logError:i.error}}async addComponent(e,t,r,i){if(!e||!t||!r||!i)return{success:!1,error:"error_generic addComponent"};const o=this.getEndpoint("addComponent"),l=await this.makeRequest(o,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,productId:r,bikeFieldName:i}});return l.success?{data:l.data,success:l.success}:{success:l.success,error:"error_add_component",logError:l.error}}async removeComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic removeComponent"};const i=this.getEndpoint("removeComponent"),o=await this.makeRequest(i,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_remove_component",logError:o.error}}async revertComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic revertComponent"};const i=this.getEndpoint("revertComponent"),o=await this.makeRequest(i,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_revert_component",logError:o.error}}async saveCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("saveCustomBike"),i=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,email:t}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_save_custom_bike",logError:i.error}}async updateCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("updateCustomBike"),i=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_update_custom_bike"}}async updateCustomBikeName(e,t){if(!e||!t)return{success:!1,error:"error_generic updateCustomBikeName"};const r=this.getEndpoint("updateCustomBikeName"),i=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,name:t}});return i.success?{data:i.data,success:i.success}:{success:i.success,error:"error_update_custom_bike_name",logError:i.error}}async makeRequest(e,t={}){const r=new URL(e,this._apiUrl),i={"Cache-Control":"no-cache",...this._apiKey&&{"bm-subscription-key":this._apiKey},...this._apiToken&&{"bm-app-token":this._apiToken}};typeof t.params=="object"&&(Object.keys(t.params).forEach(l=>{t.params[l]&&r.searchParams.set(l,t.params[l])}),delete t.params);let o;try{const l={...i,...t.headers||{}},u={...t,headers:l};t.signal&&(u.signal=t.signal);const c=await fetch(r,u),f=await c.json().catch(()=>{throw new Error("Request failed: "+(c.statusText||"Status"+c.status))});f.status===400||f.statusCode===404?o={success:!1,data:f}:o={success:!0,data:f}}catch(l){o={success:!1,error:l.message}}return o}}async function rf(n){var b;const{categories:e,collections:t,apiUrl:r,apiKey:i,apiToken:o,isShopify:l,logLevel:u}=window.BikeMatrix.getConfig(),c=JSON.parse(sessionStorage.getItem("bm_categories")||"null"),f=JSON.parse(localStorage.getItem(ll)||"null"),p=new xt(r,i,o,l);let h=[];if(u==="verbose"&&console.log("useCompatibleCollections sessionCollections",c),!c||!(c!=null&&c.collections)||!(c!=null&&c.collections.length)||(c==null?void 0:c.key)!==(f==null?void 0:f.key)){u==="verbose"&&console.log("useCompatibleCollections fetching new collections");const m=await p.getBrandProductCategories(n);if(u==="verbose"&&console.log("useCompatibleCollections bikeBrandProductCategories",m),!m.success)return console.log(m),u==="verbose"&&console.error(m.error),h={error:m.error},h;if(u==="verbose"&&(console.log("useCompatibleCollections categories",e),console.log("useCompatibleCollections collections",t)),((b=m.data)==null?void 0:b.length)>0){let P=e.filter(x=>{var A;return!!x.collection&&((A=m==null?void 0:m.data)==null?void 0:A.some(z=>z.product_Category.toLowerCase()===x.title.toLowerCase()))});u==="verbose"&&console.log("useCompatibleCollections availableCategories",P),h=P.map(x=>t.filter(z=>x.collection.split(",").map(w=>w.trim().toLowerCase()).includes(z.title.toLowerCase())).map(z=>({title:z.title,text_id:x.text_id,handle:z.handle,url:z.url}))).flat(),u==="verbose"&&console.log("useCompatibleCollections compatibleCollections",h),h=h==null?void 0:h.filter((x,A,z)=>A===z.findIndex(w=>w.title===x.title&&w.text_id===x.text_id&&w.handle===x.handle&&w.url===x.url))}sessionStorage.setItem("bm_categories",JSON.stringify({key:f==null?void 0:f.key,collections:h})),u==="verbose"&&console.log("useCompatibleCollections fetched collections",h)}else u==="verbose"&&console.log("useCompatibleCollections using session collections"),h=c.collections;return h}const nf=class to{constructor(){this.initialized=!1,this.currentBike=null,this.activeSubscription=null,this.components=[],this.config=Vd}async initialize(e){this.components=[],this.initialized&&this.cleanup(),e&&(this.config={...this.config,...e}),this.initializeConfig(),this.service=new xt(this.config.apiUrl,this.config.apiKey,this.config.apiToken,this.config.isShopify),this.initializeActiveSubscription(),localStorage.bm_currentBike&&(this.currentBike=JSON.parse(localStorage.bm_currentBike)),this.setupEventListeners(),this.registerComponents(),this.initialized=!0,sl.value=!0;const t=new Event("BM:Initialized");document.dispatchEvent(t),this.config.logLevel==="verbose"&&(console.log("BikeMatrix WebComponent Version: 1.1.49"),console.log("BikeMatrixCore initialized"))}static getInstance(){return to.instance||(to.instance=new to),to.instance}registerComponents(){const e=["bikematrix-bikeselector","bikematrix-productresult","bikematrix-collectionresult","bikematrix-compatibilitylabel","bikematrix-compatiblelist","bikematrix-bikeselectorbanner","bikematrix-variantselector"];this.components=[],e.forEach(t=>{const r=document.getElementsByTagName(t);Array.from(r).forEach(i=>{this.components.push(i)})}),this.config.logLevel==="verbose"&&console.log(`Registered ${this.components.length} components`)}resetComponents(){this.components.forEach(e=>{var t;try{const r=e.cloneNode(!1);e.querySelectorAll("template").forEach(o=>{r.appendChild(o.cloneNode(!0))}),(t=e.parentNode)==null||t.replaceChild(r,e)}catch{console.error("Error resetting component",e)}})}isInitialized(){return this.initialized}updateConfig(e){this.config={...this.config,...e},this.reload(!1)}cleanup(){this.removeEventListeners(),kg()}async destroy(){this.cleanup(),this.service=null,this.currentBike=null,this.activeSubscription=null,this.config={...Vd},this.initialized=!1,sl.value=!1,this.resetComponents()}refresh(){this.ChangeBike()}reset(){this.destroy(),this.initialize()}reload(e=!0){e&&this.initializeConfig(),this.refresh(),this.registerComponents(),this.resetComponents()}initializeConfig(){const e=document.querySelectorAll('script[type="application/json"][data-bikematrix-config]'),t=JSON.parse(sessionStorage.getItem("bm_diagnostics"));e.forEach(r=>{if(r!=null&&r.textContent)try{this.config={...this.config,...JSON.parse(r.textContent)}}catch{console.error("Invalid BikeMatrix configuration"),console.log("configScript ",r.textContent)}}),t!=null&&t.includes("verbose")&&(this.config.logLevel="verbose"),t!=null&&t.includes("virtualWorkshop")&&(this.config.virtualWorkshop=!0),t!=null&&t.includes("subscribtion")&&(this.activeSubscription=!0),t!=null&&t.includes("all")&&(this.config.logLevel="verbose",this.config.virtualWorkshop=!0,this.activeSubscription=!0),this.config.logLevel==="verbose"&&console.log("initializeConfig ",JSON.stringify(this.config,null,2))}initializeActiveSubscription(){const e=sessionStorage.getItem("bm_activeSubscription");if(this.config.logLevel==="verbose"&&(console.log("Not Shopify: ",!this.config.isShopify),console.log("Session Active Subscription: ",e),console.log("Design Mode: ",this.config.designMode)),!this.config.isShopify){this.activeSubscription=!0;return}this.activeSubscription=this.config.designMode||e==="true",e||this.service.getActiveSubscription(this.updateActiveSubscription.bind(this))}setupEventListeners(){document.addEventListener("BikeMatrix:RefreshCompatibleSkus",e=>{this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}),document.addEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus.bind(this)),document.addEventListener("BikeChanging",this.handleBikeChanging.bind(this))}removeEventListeners(){document.removeEventListener("BikeMatrix:RefreshCompatibleSkus",this.handleRefreshCompatibleSkus),document.removeEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus),document.removeEventListener("BikeChanging",this.handleBikeChanging)}async handleRefreshCompatibleSkus(e){this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}async handleBikeChanging(e){this.config.logLevel==="verbose"&&console.log("Listener BikeChanging (pre) ..."),this.ChangeBike()}getConfig(){return this.config}getActiveSubscription(){return this.activeSubscription}getCurrentBike(){return this.currentBike}updateSku(e){const t=document.querySelector("bikematrix-productresult[data-sku]"),r=document.querySelector("bikematrix-variantselector[data-sku]");t&&t.setAttribute("data-sku",e),r&&r.setAttribute("data-sku",e),this.config.sku=e}ResetSelectedBikeIndicator(){var e,t;this.currentBike===null?(e=window.bm_selectBikeButton)==null||e.classList.remove("show-selected"):(t=window.bm_selectBikeButton)==null||t.classList.add("show-selected")}ChangeBike(){this.config.logLevel==="verbose"&&console.log("ChangeBike() Method Called"),!(tr.value===!0||hr.value===!0)&&(tr.value=!0,hr.value=!0,hi.value=[],vi.value=[],this.config.logLevel==="verbose"&&console.log("ChangeBike updateBikeSignal..."),this.updateBikeSignal().then(()=>{this.config.logLevel==="verbose"&&console.log("Bike Signal Updated: ",JSON.stringify(xe.value,null,2)),this.ResetSelectedBikeIndicator(),this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0})),document.dispatchEvent(new Event("BikeChanged",{bubbles:!0,composed:!0}))})}))}async RefreshCompatibleSkus(){var t,r;const e=`${(t=xe.value)==null?void 0:t.key}:${this.config.currentCollectionHandle}:${zg}`;switch(this.config.pageType){case"collection":const i=!!xe.value&&!xe.value.compatibleCollections.error&&((r=xe.value.compatibleCollections)==null?void 0:r.find(o=>o.handle===this.config.currentCollectionHandle));this.config.logLevel==="verbose"&&console.log("Refresh Compatible SKUs. hasCompatibleCollection: ",i),this.config.logLevel==="verbose"&&console.log("showCompatibleList: ",this.config.showCompatibleList),i&&(await this.RefreshCollectionPageSkus(e),this.config.showCompatibleList&&await this.RefreshCollectionListSkus(e)),tr.value=!1,hr.value=!1;break;case"search":case"index":tr.value=!1,this.config.pageType==="index"&&this.config.showHomePageCollection||this.config.pageType==="search"&&this.config.showSearchPageCollection?await this.RefreshCollectionPageSkus(e):hr.value=!1;break;default:tr.value=!1,hr.value=!1;break}}async RefreshCollectionPageSkus(e){var l,u;let t=document.getElementsByTagName("bikematrix-collectionresult"),i=Array.from(t).map(c=>{const f=this.config.skuField==="barcode"?c.getAttribute("data-product-barcodes"):this.config.skuField==="metafield"?c.getAttribute("data-product-metafields"):c.getAttribute("data-product-skus")||"";return f==null?void 0:f.split(",").filter(p=>!!p)}).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection Page SKUs. SKUs: ",JSON.stringify(i),null,2);var o=((l=di())==null?void 0:l.language)||"en-GB";if(i){const c=await this.service.checkSkusCompatibilityWithResults((u=xe.value)==null?void 0:u.key,i,o);c.success?vi.value=c.data:(ho.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",c.logError))}else vi.value=[]}async RefreshCollectionListSkus(e){var i,o;var t=JSON.parse(sessionStorage.getItem(e));if(t)this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from Session: ",JSON.stringify(t),null,2),hi.value=t;else{const l=Object.values(this.config.products||{}).map(p=>p.skus).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(l),null,2);var r=((i=di())==null?void 0:i.language)||"en-GB";const u=new AbortController,c=u.signal,f=()=>u.abort();window.addEventListener("beforeunload",f);try{if(!((o=xe.value)!=null&&o.key))throw new Error("BikeSignal key is undefined");const p=await this.service.checkSkusCompatibilityWithResults(xe.value.key,l,r,{signal:c});if(this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(p)),c.aborted){this.config.logLevel==="verbose"&&console.log("function RefreshCompatibleSkus() operation aborted");return}p.success?(sessionStorage.setItem(e,JSON.stringify(p.data)),hi.value=p.data):(ho.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",p.logError))}catch(p){p.name==="AbortError"?console.log("function RefreshCompatibleSkus() fetch aborted"):console.error("function RefreshCompatibleSkus() fetch error",p)}finally{window.removeEventListener("beforeunload",f)}}}updateActiveSubscription(e){this.config.logLevel==="verbose"&&console.log("updateActiveSubscription data: ",e);const t=!!(e!=null&&e.activeSubscription);sessionStorage.setItem("bm_activeSubscription",JSON.stringify(t)),this.activeSubscription=t}async updateBikeSignal(){const e=localStorage.getItem(ll)||"null",t=JSON.parse(e);if(this.currentBike=t,t==null){xe.value=null;return}const r=await rf(t==null?void 0:t.brandId);!Array.isArray(r)&&r.error?(t.compatibleCollections=[],xe.value=t):(t.compatibleCollections=r,xe.value=t),this.config.logLevel==="verbose"&&console.log("Bike Changed: ",JSON.stringify(xe.value,null,2))}};nf.instance=null;let o3=nf;const ua=n=>te("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M1.53553 8.60658L5.07107 5.07104M5.07107 5.07104L8.6066 1.53551M5.07107 5.07104L8.6066 8.60658M5.07107 5.07104L1.53553 1.53551",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}));var s3=0;function g(n,e,t,r,i,o){var l,u,c={};for(u in e)u=="ref"?l=e[u]:c[u]=e[u];var f={type:n,props:c,key:t,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--s3,__i:-1,__u:0,__source:i,__self:o};if(typeof n=="function"&&(l=n.defaultProps))for(u in l)c[u]===void 0&&(c[u]=l[u]);return fe.vnode&&fe.vnode(f),f}function bi(){document.dispatchEvent(new Event("BmToggleModal"))}function l3({children:n}){return oe(()=>{var o;const e=document.body,t=document.getElementById("bm_selectBikeButton"),r=(o=document.getElementsByTagName("bikematrix-bikeselector"))==null?void 0:o[0],i=l=>{l.preventDefault(),e.classList.toggle("bm-modal-active"),r.classList.toggle("active"),oa.value=!oa.value};return document.addEventListener("BmToggleModal",i),t==null||t.addEventListener("click",i),()=>{document.removeEventListener("BmToggleModal",i),t==null||t.removeEventListener("click",i)}},[]),g(ie,{children:[g("div",{onClick:()=>{bi()},class:Pe("overlay","fixed cursor-pointer inset-0 z-[2147483645] bg-black/40 transition-all duration-500 sm:duration-200")}),g("div",{className:Pe("modal","fixed pointer-events-none inset-0 mx-auto justify-end z-[2147483646] flex flex-col items-center outline-none transition-all duration-500 sm:duration-200 ease-in-out","sm:justify-center"),children:g("div",{className:"flex sm:px-2 pointer-events-auto max-sm:max-h-[96%] sm:max-h-[90%] max-sm:h-[89vh] max-w-lg sm:max-w-[640px] flex-col items-center max-sm:flex-1 w-full bg-white rounded-t-3xl sm:rounded-xl shadow-[0px_-2px_10px_0px_rgba(0,0,0,0.04),0px_0px_0px_1px_rgba(0,0,0,0.06)]",children:[g("div",{className:"sm:hidden mx-auto mt-4 h-[6px] w-[100px] rounded-full bg-gray-400/50",onClick:bi}),g("div",{className:"sm:hidden h-[10px]"}),g("div",{className:"relative flex flex-col w-full sm:h-full max-sm:flex-none max-sm:grow",children:g("div",{class:"modal-content max-sm:absolute sm:h-full max-sm:inset-0 overflow-x-hidden overflow-y-auto px-8 sm:px-6",children:n})})]})})]})}const vr=n=>te("svg",{width:7,height:12,viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M1 11L6 6L1 1",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),u3=n=>te("svg",{width:31,height:31,viewBox:"0 0 31 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("circle",{cx:15.5,cy:15.5,r:15.5,fill:"#030712"}),te("path",{d:"M10.1974 17.1317L13.9955 20.4461L20.8639 10.8909",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),c3=n=>te("svg",{width:31,height:31,viewBox:"0 0 31 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("g",{clipPath:"url(#clip0_64_2)"},te("path",{d:"M30.5 15.5C30.5 23.7843 23.7843 30.5 15.5 30.5C7.21573 30.5 0.5 23.7843 0.5 15.5C0.5 7.21573 7.21573 0.5 15.5 0.5C23.7843 0.5 30.5 7.21573 30.5 15.5Z",fill:"white",stroke:"#D1D5DB"})),te("path",{d:"M23.983 11.132C23.9699 10.9806 23.8699 10.8506 23.727 10.7988C23.5837 10.7466 23.4233 10.7822 23.3155 10.8894L21.1098 13.0866L18.6647 12.3153L17.8905 9.87937L20.0961 7.68201C20.2041 7.57458 20.2393 7.41475 20.1873 7.27224C20.1348 7.12945 20.0046 7.02999 19.8524 7.01688C18.5129 6.9019 17.2004 7.37836 16.2514 8.32387C14.9518 9.61873 14.6076 11.5096 15.217 13.1213C15.1504 13.1773 15.0847 13.2365 15.0199 13.3004L7.65736 20.2216C7.65476 20.2241 7.6522 20.2268 7.64939 20.2293C6.78354 21.092 6.78354 22.4955 7.64939 23.3583C8.51539 24.2209 9.91396 24.2104 10.7797 23.3477C10.7834 23.3443 10.7868 23.3408 10.7902 23.3369L17.677 15.945C17.7398 15.8822 17.798 15.8165 17.853 15.749C19.4713 16.3573 21.3705 16.0152 22.6713 14.7195C23.62 13.7739 24.0986 12.4663 23.983 11.132ZM9.67019 22.4264C9.35113 22.7442 8.83439 22.744 8.51536 22.4264C8.19644 22.1089 8.19644 21.5937 8.51536 21.2761C8.83439 20.9585 9.35113 20.9585 9.67019 21.2761C9.98911 21.5937 9.98911 22.1089 9.67019 22.4264Z",fill:"black"}),te("defs",null,te("clipPath",{id:"clip0_64_2"},te("rect",{width:31,height:31,fill:"white"})))),d3=n=>te("svg",{width:31,height:31,viewBox:"0 0 46 46",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M2 24.0437V22.6518C4.30404 21.9559 5.82929 20.347 6.17596 18.244C6.45967 16.523 5.87584 14.7802 4.66788 13.505L5.50401 12.1672C6.3441 12.2632 7.12499 12.2938 7.83019 12.2273C8.91308 12.1253 10.0603 11.7686 10.8965 10.814C11.7162 9.87828 11.9364 8.70751 11.9455 7.65019C11.9509 7.01984 11.882 6.33439 11.7615 5.60532L13.1089 4.93163C14.6862 6.27858 16.5967 7.00972 18.5085 6.50659C20.496 5.98355 21.7104 4.35171 22.2287 2.32023L23.4959 2.17943C23.7105 2.84427 23.9686 3.45839 24.2803 4.0055C24.8609 5.02453 25.7009 5.93317 26.8959 6.37534C28.1054 6.8229 29.35 6.6716 30.4872 6.21488C31.2478 5.9094 32.0092 5.4502 32.771 4.87155L33.84 5.40607C33.3102 7.17682 33.6407 8.97473 34.9205 10.3525C36.2854 11.8219 38.3837 12.4206 40.6053 12.1884L41.4091 13.3137C40.1484 14.904 39.5422 16.7943 40.0082 18.6621C40.4975 20.623 42.0098 21.9631 44 22.6091V23.6937C42.0295 24.646 40.407 25.9295 39.9934 27.9032C39.7449 29.089 40.0083 30.2272 40.4663 31.2395C40.7549 31.8775 41.1444 32.5183 41.6038 33.1622L41.0881 34.0648C39.1096 33.5569 37.1545 33.7409 35.7252 35.1442C34.3293 36.5148 34.0136 38.5186 34.2755 40.5318L32.7931 41.4583C31.191 40.0523 29.3504 39.2822 27.3831 40.0414C26.2841 40.4655 25.451 41.2846 24.816 42.1501C24.4114 42.7016 24.0463 43.3278 23.7127 44H22.6585C22.1786 42.2318 21.2165 40.6691 19.4091 40.0247C17.4936 39.3418 15.3888 40.0023 13.3765 41.2022L11.9877 40.5078C12.4255 38.6858 12.158 36.865 10.7918 35.5311C9.4171 34.1889 7.44044 33.8741 5.42929 34.2133L4.6584 32.9799C6.03869 31.6871 6.93069 30.0087 6.40539 28.071C6.07607 26.8563 5.24467 25.9088 4.25062 25.2068C3.60737 24.7526 2.85005 24.3664 2 24.0437Z",stroke:"black",strokeWidth:4}),te("circle",{cx:23,cy:23,r:12,stroke:"black",strokeWidth:4}),te("path",{d:"M23 39.75C32.2508 39.75 39.75 32.2508 39.75 23C39.75 13.7492 32.2508 6.25 23 6.25C13.7492 6.25 6.25 13.7492 6.25 23C6.25 32.2508 13.7492 39.75 23 39.75Z",stroke:"black",strokeWidth:3.5})),f3=`.shared-icon{background-color:#fba157;padding:5px 10px;border-radius:8px;font-size:12px;display:flex;justify-content:center;align-items:center;color:#fff}
|
|
2
|
+
`,af=({text:n})=>g(ie,{children:[g("style",{type:"text/css",children:f3}),g("div",{className:"shared-icon",children:g("p",{className:"text",children:n||"Shared with you"})})]});function gr({spanner:n,selected:e,settings:t,simple:r,bike:i,compact:o,readOnly:l,onClick:u,shared:c,custom:f,noSymbol:p,...h}){var B;const b=(B=i.images)!=null&&B.length?i.images:[Sn("bike.png")],m=be(null),[P,x]=K(0),A=be(null);oe(()=>{const L=m==null?void 0:m.current;if(L){var T=new IntersectionObserver(function(X){var Z=X.reduce(function(W,N){return N.intersectionRatio>W.intersectionRatio?N:W});Z.intersectionRatio>0&&x(Number(Z.target.getAttribute("data-slide")))},{root:L,threshold:.8});return L.querySelectorAll("&>div").forEach(X=>{T.observe(X)}),()=>{T.disconnect()}}},[m]);function z(L){if(!m.current)return;const T=m.current.querySelectorAll("&>div")[L];m.current.scrollLeft=T.clientWidth*L}function w(){P!=0&&z(P-1)}function k(){P!=b.length-1&&z(P+1)}const D=(b==null?void 0:b.length)&&P!==b.length-1,O=(b==null?void 0:b.length)&&P!==0;return g("div",{class:Pe("rounded-xl select-none border py-4 relative",e?"border-gray-950":"border-gray-300"),...h,onClick:L=>{if(A.current&&!A.current.contains(L.target))u(L);else{L.preventDefault();return}},children:[!r&&g("p",{class:"text-gray-950 px-4 text-base font-normal font-nunito leading-tight ",children:o?g(ie,{children:l?`${i.bike_Brand} ${i.year} ${i.spec}`:i?`${i.brand} ${i.year} ${i.bikeSpec} ${i.variant?i.variant:""}`:""}):g(ie,{children:l?i.bike_Name:i.name})}),g("div",{class:"relative mt-2",children:[g("div",{ref:m,class:Pe("flex scroll-smooth snap-mandatory no-scrollbar h-32 snap-x space-x-2 relative overflow-x-auto","px-4"),"data-active-slide":P,children:[!l&&b.length&&b.map((L,T)=>g("div",{"data-slide":T,class:"w-full h-full snap-center flex items-center flex-none",children:g("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:L,alt:L})},T)),l&&g("div",{class:"w-full h-full snap-center flex items-center flex-none",children:g("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:`https://imagestore.bikematrix.io/${i.bike_Reference}/400-${i.bike_Thumbnail}`,alt:i.bike_Reference})})]}),g(ie,{children:[g("div",{onClick:w,class:Pe("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center left-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",O?"":"hidden"),children:g(vr,{class:"h-3 text-gray-500 -rotate-180"})}),g("div",{onClick:k,class:Pe("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center right-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",D?"":"hidden"),children:g(vr,{class:"h-3 text-gray-500 translate-x-px"})})]})]}),(b==null?void 0:b.length)>1&&g("div",{class:"space-x-2 flex items-center justify-center",children:b.map((L,T)=>g("div",{class:Pe("rounded-xl w-2 h-2 transition-all duration-300",T==P?" bg-gray-950 scale-125":" bg-gray-200")},T))}),(c||i.isShared)&&g("div",{className:"absolute left-4 bottom-4",children:g(af,{})}),(f||i.isCustom)&&g("div",{className:"absolute left-4 bottom-4",children:g(af,{text:"Custom"})}),g("div",{className:"spanner_wrapper absolute right-4 bottom-14 h-fit w-fit",ref:A,children:n&&e&&g(c3,{class:"cursor-pointer",onClick:L=>{L.preventDefault(),!(i!=null&&i.isCustom)&&!(i!=null&&i.isShared)?Oe("/workshop"):i!=null&&i.isShared?Oe("/read-only"):Oe("/bom")}})}),e&&!t?g(u3,{class:"absolute right-4 bottom-4 cursor-pointer"}):t?g(d3,{class:"absolute right-4 bottom-4 cursor-pointer",onClick:()=>Oe("/settings")}):l?g("span",{}):p?g("span",{}):g(ie,{children:g("span",{class:"border absolute right-4 bottom-4 rounded-full h-8 w-8 border-gray-300 bg-white/75"})})]})}function of(n,e){const t=()=>{try{const o=window.localStorage.getItem(n);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,i]=K(t);return oe(()=>{try{if(!r&&n==="bm_currentBike")window.localStorage.setItem(n,null);else if(!r)window.localStorage.removeItem(n);else{const o=JSON.stringify(r);window.localStorage.setItem(n,o)}}catch(o){console.error(o)}},[n,r]),[r,i,t]}function p3(n,e){const t=()=>{try{const o=window.sessionStorage.getItem(n);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,i]=K(t);return oe(()=>{try{if(!r)window.sessionStorage.removeItem(n);else{const o=JSON.stringify(r);window.sessionStorage.setItem(n,o)}}catch(o){console.error(o)}},[n,r]),[r,i,t]}const dl={brand:{options:[],value:null,error:null},model:{options:[],value:null,error:null},frameSeries:{options:[],value:null,error:null},year:{options:[],value:[],error:null},bikeSpec:{options:[],value:null,error:null},frameSize:{options:[],value:null,error:null},options:[],value:{}},sf=ra(void 0),h3=({children:n})=>{var $;const e=window.BikeMatrix.getConfig(),[t,r]=of(ll,null),[i,o]=of("bm_lounge",[]),l=new xt(e.apiUrl,e.apiKey,e.apiToken,e.isShopify),[u,c]=K(dl),f=be({}),[p,h]=K([]),[b,m]=K(!1),[P,x]=K(null);K(null),oe(()=>{(async()=>{if(t!=null&&t.brandId){const M=await rf(t==null?void 0:t.brandId);x(M)}})()},[t==null?void 0:t.brandId]);function A(F){c(M=>{var ee;return{...M,[F]:{options:[],value:(ee=dl[F])==null?void 0:ee.value}}})}function z(F,M){c(ee=>(ee[F].value=M,{...ee}))}const w=()=>{c(F=>{var M;return{...dl,brand:{options:((M=F.brand)==null?void 0:M.options)||[],error:F.brand.error||null}}})},k=F=>{r({...F}),o([...(i||[]).filter(M=>!!M.key&&M.key!==F.key),F])},D=F=>{(t==null?void 0:t.key)===F&&r(null),o([...(i||[]).filter(M=>!!M.key&&M.key!==F)])},O=()=>{e.logLevel==="verbose"&&console.log("Dispatch BikeChanging (pre-change)..."),document.dispatchEvent(new Event("BikeChanging",{bubbles:!0,composed:!0}))},B=()=>{setTimeout(()=>{w(),Oe("/")},500)},L=async()=>{const F=await l.getBikeBrands();F.success?(sessionStorage.setItem("bm_brands",JSON.stringify(F.data)),c(M=>(M.brand.options=F.data.map(ee=>({label:ee.bike_Brand,value:ee.bike_Brand_ID})),{...M}))):F.success||(c(M=>(M.brand.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},T=async()=>{const F=await l.getBikeModels(u.brand.value);F.success?c(M=>(M.model.options=F.data.map(ee=>({label:ee.model_Family,value:ee.model_Family_ID})),{...M})):F.success||(c(M=>(M.model.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},X=async()=>{const F=await l.getBikeFrameSeries(u.model.value);F.success?c(M=>{var le,ve;const ee=[];return M.frameSeries.options=F.data.reduce((pe,Re)=>{const Ie={label:Re.model_Spec,value:Re.model_Spec_ID};return ee.includes(Ie.value)||(ee.push(Ie.value),pe.push(Ie)),pe},[]),((le=M.frameSeries.options)==null?void 0:le.length)===1&&(M.frameSeries.value=(ve=M.frameSeries.options[0])==null?void 0:ve.value),{...M}}):F.success||(c(M=>(M.frameSeries.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},Z=async()=>{const F=await l.getBikeSpecs(u.frameSeries.value);if(F.success){const M=[],ee=[],le=[],ve=[];F.data.forEach(pe=>{var Bt,$e;const Re=pe.year+"-"+pe.spec.replace(/[^0-9a-zA-Z]/g,"")+(pe.bike_Variant?"-"+pe.bike_Variant.replace(/[^0-9a-zA-Z]/g,""):""),Ie={label:pe.spec,value:pe.spec};if(M.includes(Ie.value)||(M.push(Ie.value),le.push(Ie)),!ee.includes(Re)){ee.push(Re);const Vt={_key:Re,key:pe.bike_Key,name:pe.bike_Name,variant:pe.bike_Variant,brand:pe.bike_Brand,brandId:pe.bike_Brand_ID,model:pe.model_Family,modelId:pe.model_Family_ID,frameSeries:pe.model_Spec,frameSeriesId:pe.model_Spec_ID,bikeSpec:pe.spec,year:pe.year,images:[pe.bike_Thumbnail,...((Bt=pe==null?void 0:pe.bike_Images)==null?void 0:Bt.split(","))||[]].filter(qt=>!!qt).map(qt=>`https://imagestore.bikematrix.io/${pe.bike_Reference}/400-${qt}`)},jt=F.data.reduce((qt,at)=>(at.year==pe.year&&at.spec===pe.spec&&at.model_Spec===pe.model_Spec&&at.bike_Variant===pe.bike_Variant&&qt.push({key:at.bike_Key,name:at.bike_Name,variant:at.bike_Variant,sizeId:at.bike_Size_ID,size:at.bike_Size}),qt),[]);($e=jt==null?void 0:jt.filter(qt=>!!qt.sizeId))!=null&&$e.length&&(Vt.sizes=jt),ve.push(Vt)}f.current[u.frameSeries.value]=Array.from(new Set([...f.current[u.frameSeries.value]||[],pe.year]))}),c(pe=>(pe.bikeSpec.options=le,{...pe})),h(ve)}else F.success||(c(M=>(M.bikeSpec.error=F.error,{...M})),e.logLevel==="verbose"&&console.error(F.logError))},W=async()=>{c(F=>{const M=f.current[F.frameSeries.value]||[];return F.year.options=M.map(ee=>({label:ee,value:ee})),{...F}})},N=async()=>{c(F=>{var M,ee,le;if(F.frameSize.options=(M=u==null?void 0:u.value)!=null&&M.sizes?u.value.sizes.filter(ve=>!!ve.size).map(ve=>({label:ve.size,value:ve.size})):[],((ee=F.frameSize.options)==null?void 0:ee.length)===1){const ve=(le=F.frameSize.options[0])==null?void 0:le.value;F.frameSize.value=ve,F.value.frameSize=ve}return{...F}})};oe(()=>(document.addEventListener("BmToggleModal",B),()=>{document.removeEventListener("BmToggleModal",B)}),[]);const[V,J]=p3("bm_diagnostics",[]),re=()=>{const M=new URLSearchParams(window.location.search).get("diagnostics");JSON.parse(sessionStorage.getItem("bm_diagnostics")).includes(M)||J([...V,M]),M===null&&J([])};oe(()=>{O(),re()},[t]),oe(()=>{sessionStorage.getItem("bm_brands")?c(F=>(F.brand.options=JSON.parse(sessionStorage.getItem("bm_brands")).map(M=>({label:M.bike_Brand,value:M.bike_Brand_ID})),{...F})):oa.value&&L()},[oa.value]),oe(()=>{u.brand.value&&(A("model"),A("frameSeries"),T())},[u.brand.value]),oe(()=>{u.model.value&&(A("frameSeries"),X())},[u.model.value]),oe(()=>{u.frameSeries.value&&(A("bikeSpec"),A("year"),h([]),Z().then(()=>{W()}))},[u.frameSeries.value]),oe(()=>{u.value._key&&(A("frameSize"),N())},[($=u.value)==null?void 0:$._key]),oe(()=>{u.frameSize.value&&c(F=>{var M,ee;return F.value={...F.value,...((ee=(M=F==null?void 0:F.value)==null?void 0:M.sizes)==null?void 0:ee.find(le=>u.frameSize.value==le.size))||{}},delete F.value.sizes,F})},[u.frameSize.value]);const U={bike:u,setBike:c,setBikeAttr:z,resetBike:w,results:p,loading:b,setLoading:m,compatibleCollections:P,currentBike:t,setCurrentBike:r,removeBike:D,saveBike:k,lounge:i};return g(sf.Provider,{value:U,children:n})},Ht=()=>{const n=Vs(sf);if(!n)throw new Error("useBikeState must be used within a BikeProvider");return n};function Fr(){const{t:n}=De(),t=window.BikeMatrix.getConfig(),[r,i]=K(null);return t.internalLink&&i(t.internalLink),g(ie,{children:[g("p",{class:"text-gray-600 max-w-sm mx-auto mt-4 text-center font-normal text-xs",children:n("bikeselector_home_footer_message")}),g("a",{href:r||"https://bikematrix.io/landed-it",target:"_blank",class:"text-gray-950 block underline mb-4 font-bold mt-4 text-center text-xs",children:n("bikematrix_poweredby")})]})}const v3=n=>te("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("path",{d:"M16.983 4.13197C16.9699 3.98064 16.8699 3.85064 16.727 3.7988C16.5837 3.74665 16.4233 3.78215 16.3155 3.88937L14.1098 6.08655L11.6647 5.31527L10.8905 2.87937L13.0961 0.682011C13.2041 0.574581 13.2393 0.414746 13.1873 0.272238C13.1348 0.129446 13.0046 0.0299881 12.8524 0.0168782C11.5129 -0.0980992 10.2004 0.378357 9.25142 1.32387C7.95176 2.61873 7.60759 4.50961 8.21705 6.12135C8.15043 6.17726 8.08471 6.2365 8.01987 6.30039L0.65736 13.2216C0.654763 13.2241 0.652203 13.2268 0.649393 13.2293C-0.216464 14.092 -0.216464 15.4955 0.649393 16.3583C1.51539 17.2209 2.91396 17.2104 3.77967 16.3477C3.78341 16.3443 3.78682 16.3408 3.79024 16.3369L10.677 8.94505C10.7398 8.88222 10.798 8.8165 10.853 8.74903C12.4713 9.3573 14.3705 9.01524 15.6713 7.71952C16.62 6.77394 17.0986 5.46628 16.983 4.13197ZM2.67019 15.4264C2.35113 15.7442 1.83439 15.744 1.51536 15.4264C1.19644 15.1089 1.19644 14.5937 1.51536 14.2761C1.83439 13.9585 2.35113 13.9585 2.67019 14.2761C2.98911 14.5937 2.98911 15.1089 2.67019 15.4264Z",fill:"black"})),_={id:null,name:null,product_category_id:null,swap:!1,version_id:null,unsaved_changes:null,translation:null},ca={bike_Key:"",bike_Type:null,bike_Name:null,bike_Variant:null,bike_Reference:null,bike_Thumbnail:null,bike_Images:null,bike_Brand_ID:0,bike_Brand:null,model_Family_ID:0,model_Family:null,model_Spec_ID:0,model_Spec:null,spec:null,bike_Size_ID:null,bike_Size:null,year:0,original_Bike_Key:null,share_Bike_Key:null,owner_Email_Address:null,brake_Configuration:null,cockpit:{stem:_,handlebar:_,seat_Post:_,seat_Post_Clamp:_,dropper_Lever:_,lockout_Lever:_,grips:_,pedals:_,saddle:_},"frame_&_fork":{fork:_,rear_Shock:_,headseat:_},drivetrain:{chainguide:_,bottom_Bracket:_,crankset:_,largest_Chainring:_,second_Largest_Chainring:_,third_Largest_Chainring:_,chainring_Spider:_,chain:_,cassette:_,rear_Derailleur:_,front_Derailleur:_,shifter_RH:_,shifter_LH:_,shift_Brake_Combo_RH:_,shift_Brake_Combo_LH:_,brake_Lever_RH:_,brake_Lever_LH:_,shifter_Adapter_RH:_,shifter_Adapter_LH:_},brakes:{brake_Caliper_Front:_,brake_Caliper_Rear:_,brake_Pads_Front:_,brake_Pads_Rear:_,brake_Rotor_Front:_,brake_Rotor_Rear:_,brake_Adapter_Front:_,brake_Adapter_Rear:_},"wheels_&_tyres":{front_Wheel:_,front_Axle:_,rear_Wheel:_,rear_Axle:_,tyre_Front:_,tyre_Rear:_},is_E_Bike:null,eMotor_System_ID:null,eBattery_ID:null,eControl_Unit_ID:null,eCharger_ID:null,eInterconnects_ID:null},da={cockpit:{stem:_,handlebar:_,seat_Post:_,seat_Post_Clamp:_,dropper_Lever:_,lockout_Lever:_,grips:_,pedals:_,saddle:_},"frame_&_fork":{headset:_,fork:_,rear_Shock:_},drivetrain:{chainguide:_,bottom_Bracket:_,crankset:_,largest_Chainring:_,second_Largest_Chainring:_,third_Largest_Chainring:_,chainring_Spider:_,chain:_,cassette:_,rear_Derailleur:_,front_Derailleur:_,shifter_RH:_,shifter_LH:_,shift_Brake_Combo_RH:_,shift_Brake_Combo_LH:_,brake_Lever_RH:_,brake_Lever_LH:_,shifter_Adapter_RH:_,shifter_Adapter_LH:_},brakes:{brake_Caliper_Front:_,brake_Caliper_Rear:_,brake_Pads_Front:_,brake_Pads_Rear:_,brake_Rotor_Front:_,brake_Rotor_Rear:_,brake_Adapter_Front:_,brake_Adapter_Rear:_},"wheels_&_tyres":{front_Wheel:_,front_Axle:_,rear_Wheel:_,rear_Axle:_,tyre_Front:_,tyre_Rear:_}},Nr={headset:{},stem:{},handlebar:{},seat_Post:{},seat_Post_Clamp:{},dropper_Lever:{},lockout_Lever:{},grips:{},pedals:{},saddle:{},fork:{},rear_Shock:{},chainguide:{},bottom_Bracket:{},crankset:{},largest_Chainring:{},second_Largest_Chainring:{},third_Largest_Chainring:{},chainring_Spider:{},chain:{},cassette:{},rear_Derailleur:{},front_Derailleur:{},shifter_RH:{},shifter_LH:{},shift_Brake_Combo_RH:{},shift_Brake_Combo_LH:{},brake_Lever_RH:{},brake_Lever_LH:{},shifter_Adapter_RH:{},shifter_Adapter_LH:{},brake_Caliper_Front:{},brake_Caliper_Rear:{},brake_Pads_Front:{},brake_Pads_Rear:{},brake_Rotor_Front:{},brake_Rotor_Rear:{},brake_Adapter_Front:{},brake_Adapter_Rear:{},front_Wheel:{},front_Axle:{},rear_Wheel:{},rear_Axle:{},tyre_Front:{},tyre_Rear:{}},fl=(n,e)=>Object.keys(n).includes(e),mi=n=>(Object.keys(Nr).forEach(e=>{Object.keys(n).forEach(t=>{`${e}_ID`===t&&(Nr[e].id=n[t]),`${e}_Name`===t&&(Nr[e].name=n[t]),`${e}_Product_Category_ID`===t&&(Nr[e].product_category_id=n[t]),`${e}_Swap`===t&&(Nr[e].swap=n[t]),`${e}_Version_ID`===t&&(Nr[e].version_id=n[t]),`${e}_Unsaved_Changes`===t&&(Nr[e].unsaved_changes=n[t])})}),Object.keys(da).forEach(e=>{Object.keys(Nr).forEach(t=>{fl(da[e],t)&&(da[e][t]=Nr[t])})}),Object.keys(da).forEach(e=>{fl(ca,e)&&(ca[e]=da[e])}),Object.keys(n).forEach(e=>{fl(ca,e)&&(ca[e]=n[e])}),ca),lf=async n=>{var t;return{bikeSpec:n.spec,brand:n.bike_Brand,brandId:n.bike_Brand_ID,frameSeries:n.spec,frameSeriesId:n.model_Spec_ID,frameSize:n.bike_Size,images:[`https://imagestore.bikematrix.io/${n.bike_Reference}/400-${n.bike_Thumbnail}`],isCustom:n.bike_Type==="Custom_Bike",isShared:n.bike_Type==="Shared_Bike",key:n.bike_Type==="Shared_Bike"?n.share_Bike_Key:n.bike_Key,model:n.model_Family,modelId:n.model_Family_ID,name:n.bike_Name,size:n.bike_Size,sizeId:n.bike_Size_ID,variant:n.bike_Variant,year:n.year,_key:`${n.year}-${(t=n.spec)==null?void 0:t.replace(" ","")}`}};function g3(){const n=window.BikeMatrix.getConfig(),{bike:e,currentBike:t,setCurrentBike:r,lounge:i,removeBike:o,resetBike:l,saveBike:u}=Ht(),{t:c}=De(),{apiUrl:f,apiKey:p,apiToken:h,isShopify:b,virtualWorkshop:m}=window.BikeMatrix.getConfig();oe(()=>{ht.value=null},[]);const P=new xt(f,p,h,b),x=async()=>{const w=new URLSearchParams(window.location.search).get("bikematrixid"),k=sessionStorage.getItem("bm_passed_id");if(!(k&&k!==null&&w===k)&&(!k||w!==k)){const D=i.find(O=>O.key===w);D?(r(D),sessionStorage.setItem("bm_passed_id",w)):D||(await A(w),sessionStorage.setItem("bm_passed_id",w))}},A=async z=>{const w=await P.getBikeBom(z);if(!(w!=null&&w.success)){n.logLevel==="verbose"&&console.error(w.logError);return}const k=mi(w.data);e.value=await lf(k),u(e.value),r(e.value)};return x(),oe(()=>{i.map(z=>{z!=null&&z.isCustom&&(vo.value=!1)})},[i]),g(ie,{children:[i!=null&&i.length?i==null?void 0:i.filter(z=>!!z._key).map(z=>g("div",{class:"mb-4 relative",children:[g("p",{className:"opacity-0 absolute",children:z.key}),g("div",{onClick:()=>o(z.key),class:"w-7 h-7 z-10 -right-2 -top-2 flex items-center justify-center absolute bg-gray-200 text-gray-800 rounded-full",children:g(ua,{class:"h-3 w-3"})}),g(gr,{compact:!0,onClick:w=>{w.preventDefault(),r((t==null?void 0:t.key)===(z==null?void 0:z.key)?null:{...z})},bike:z,selected:(t==null?void 0:t.key)===(z==null?void 0:z.key),spanner:m,custom:z==null?void 0:z.isCustom})]},z.key)):g("div",{class:Pe("relative mb-4 z-10 "),children:[g("div",{class:"w-full p-4 relative rounded-xl bg-white border border-gray-300 mb-4",children:[g("span",{class:"block rounded-lg h-6 w-1/2 bg-gray-200"}),g("img",{class:"w-auto mx-auto h-auto max-h-36 opacity-30",src:Sn("bike.png")}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),g("div",{class:Pe("w-full relative bg-white border -z-10 border-b-0 border-gray-300 rounded-t-xl h-20 mb-4","after:bottom-0 after:-inset-x-px after:-top-6 after:bg-gradient-to-t after:absolute after:from-white after:to-transparent"),children:[g("span",{class:" absolute left-4 top-4 rounded-lg h-6 w-1/2 bg-gray-200"}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),g("div",{class:" text-gray-800 text-center flex -mt-5 z-20 justify-center",children:[c("bikeselector_home_empty"),g("br",{}),c("bikeselector_home_add_a_bike")]})]}),g("button",{onClick:z=>{z.preventDefault(),l(),Oe("/add")},class:Pe("duration-300 transition-colors sticky bottom-[128px] mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",i.length&&!(t!=null&&t.key)?"bg-gray-950 text-white":i.length?"bg-gray-200 text-gray-800":"bg-gray-950 text-white",!t&&"bottom-0",t&&m&&"bottom-[128px]",t&&!m&&"bottom-[72px]"),children:[c("bikeselector_home_add_btn"),g(ua,{class:"h-3 absolute [&>path]:stroke-[2px] right-5 justify-self-end rotate-45"})]}),!!(i!=null&&i.length)&&!!(t!=null&&t.key)&&m&&g("button",{onClick:z=>{z.preventDefault(),!(t!=null&&t.isCustom)&&!(t!=null&&t.isShared)?Oe("/workshop"):t!=null&&t.isCustom&&!(t!=null&&t.isShared)?Oe("/bom"):!(t!=null&&t.isCustom)&&(t!=null&&t.isShared)&&Oe("/read-only")},class:Pe("duration-300 sticky bottom-[72px] transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-200 text-gray-800"),children:[c("virtualworkshop_title"),g(v3,{class:"h-5 absolute right-5 justify-self-end"})]}),!!(i!=null&&i.length)&&!!(t!=null&&t.key)&&g("button",{onClick:z=>{z.preventDefault(),Oe("/browse")},class:Pe("duration-300 sticky bottom-4 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center",i.length?"bg-gray-950 text-white":"bg-gray-200 text-gray-800"),children:c("bikeselector_home_browse_btn")}),g(Fr,{})]})}const b3=n=>te("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("circle",{cx:10,cy:10,r:10,fill:"#030712"}),te("path",{d:"M6.57886 11.0526L9.02922 13.191L13.4604 7.02636",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),br=({messages:n,left:e,margin:t})=>{const{t:r}=De(),[i,o]=K(""),[l,u]=K("");return oe(()=>{n&&n.indexOf(" ")>=0&&(o(n.split(" ")[0]),u(n.split(" ")[1]))},[n]),g("div",{className:`flex h-4 w-auto ${e?"justify-start":"justify-center"} ${t?"mt-1":""}`,children:n&&g("p",{className:"message text-xs text-red-500",children:r(i||n,{endpoint_location:l})})})};function fa({type:n,title:e,placeholder:t,options:r=[],disabled:i=void 0,loading:o=!1,infoVisible:l=!1,children:u=void 0,error:c=null,...f}){const{t:p}=De(),h=m=>{switch(m){case"brand":return p("bikeselector_addbike_brand_desc");case"model":return p("bikeselector_addbike_model_desc");case"framespec":return p("bikeselector_addbike_framespec_desc");case"framesize":return p("bikeselector_size_framesize_desc");default:return""}},b=(m,P)=>m==="framesize"&&P==="One Size"?p("bikeselector_size_framesize_one_size"):P;return g(ie,{children:g("div",{class:"w-full flex flex-col space-y-2",children:[g("label",{class:"text-gray-800 font-bold text",children:e}),u&&g("div",{class:Pe("!my-0 overflow-hidden box-border transition-all duration-300",l?"max-h-screen":"h-0"),children:[g("p",{class:"text-gray-600 my-1 italic text-sm",children:h(n)}),g("div",{class:Pe("rounded-xl overflow-hidden my-0 relative py-1 h-32 bg-gray-100 w-full"),children:u})]}),g("div",{class:"w-full flex items-center relative",children:[g("select",{class:Pe("rounded-xl peer !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg bg-white placeholder:text-gray-700 text-gray-700","disabled:bg-gray-100 disabled:border-gray-200 disabled:text-gray-400",f.class),disabled:i,...f,children:[g("option",{value:"",selected:!f.value,disabled:!0,children:t}),r.map(m=>g("option",{value:m.value,disabled:m.disabled,children:b(n,m.label)}))]}),o?g("span",{class:"absolute block loader animate-spin right-4 w-5 h-5"}):f.value&&typeof i=="boolean"?g(b3,{class:"right-3 absolute w-5 pointer-events-none"}):g(vr,{class:"absolute h-3 text-gray-700 pointer-events-none rotate-90 right-5 peer-disabled:text-gray-400"})]}),c&&g(br,{messages:c,left:!0,margin:5})]})})}const uf=n=>te("svg",{width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},te("circle",{cx:12.5,cy:12.5,r:12,fill:"white",stroke:"black"}),te("path",{d:"M9 16.0711L12.5355 12.5355M12.5355 12.5355L16.0711 9M12.5355 12.5355L16.0711 16.0711M12.5355 12.5355L9 9",stroke:"black",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),m3=`.input_container{display:flex;flex-direction:column}.input_wrapper{width:100%;border-radius:12px;padding:12px;border:1px solid #d1d5db;display:flex;align-items:center;justify-content:space-between}.input_wrapper input{width:100%}
|
|
3
3
|
`,cf=({value:n,setValue:e,placeholder:t,type:r,error:i,submitInput:o,label:l,instructions:u})=>g(ie,{children:[g("style",{type:"text/css",children:m3}),g("div",{className:"input_container",children:[l&&g("label",{class:"text-gray-800 font-bold text",children:l}),u&&g("label",{class:"text-gray-600 my-1 italic text-sm",children:u}),g("div",{className:"input_wrapper",children:[g("input",{placeholder:t,value:n,onChange:c=>e(c.currentTarget.value),type:r,onKeyDown:c=>{c.key==="Enter"&&o()}}),g(uf,{height:20,width:20,onClick:()=>e(""),className:"cursor-pointer"})]}),g(br,{messages:i})]})]}),y3=`.lds-ring{display:inline-block;position:relative;width:24px;height:24px}.lds-ring div{box-sizing:border-box;display:block;position:absolute;width:19px;height:19px;margin:2px;border:2px solid #c4cdd5;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#c4cdd5 transparent transparent transparent}.lds-ring div:nth-child(1){animation-delay:-.45s}.lds-ring div:nth-child(2){animation-delay:-.3s}.lds-ring div:nth-child(3){animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
4
|
-
`;function Rr({isLoading:n,colour:e}){return g(ie,{children:[g("style",{type:"text/css",children:y3}),g("div",{class:"lds-ring",id:"bm-loading-spinner",style:{display:n?"inline-block":"none"},children:[g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}})]})]})}const Cr=({onClick:n,primary:e,text:t,loading:r,disabled:i,sticky:o,children:l,active:u=!0,noMargin:c=!1})=>g("button",{onClick:f=>{!i&&!r&&(f.preventDefault(),n())},class:Pe("duration-300 bottom-4 transition-colors rounded-xl p-3 w-full flex justify-center items-center",`${e&&u?"bg-gray-950 text-white":e&&!u?"bg-gray-200 text-gray-400 ":"bg-gray-200 text-gray-800"} ${o&&"sticky"} ${!c&&"mt-4"}`),style:{cursor:i?"not-allowed":"pointer",opacity:i?.5:1},children:r?g(Rr,{isLoading:r,colour:e?"#fff":"#000"}):g(ie,{children:[g("span",{className:l?"ml-auto":"",children:t}),l]})});function w3(){const n=window.BikeMatrix.getConfig(),{bike:e,setBikeAttr:t}=Ht(),{brand:r,model:i,frameSeries:o}=e,{t:l}=De(),[u,c]=K([]),[f,p]=K(!1),h=new xt(n.apiUrl,n.apiKey,n.apiToken,n.isShopify),[b,m]=K(null),[P,x]=K(""),A=r.value,z=r.value&&i.value;oe(()=>{const k=n.bikeSelectorBrands?n.bikeSelectorBrands.split(",").filter(D=>D!==""):[];if(k.length>0&&r.options.length>0){let D=[];r.options.forEach(O=>{k.includes(O.value.toString().trim())&&D.push(O)}),c(D)}else r.options.length>0&&c(r.options)},[n.bikeSelectorBrands,r.options]);const w=async()=>{p(!0);const k=await h.getBikeBom(P);if(!(k!=null&&k.success)){n.logLevel==="verbose"&&console.error(k.logError),p(!1),m(k.error);return}if(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(P)){const O=await h.getBikeBom(P),B=mi(O.data);ht.value=B,e.value=await lf(B),p(!1),Oe("/confirm")}else m("error_get_bike_bom"),p(!1)};return g(ie,{children:[g("div",{class:"space-y-5 relative w-full flex flex-col",children:[g(fa,{type:"brand",title:l("bikeselector_addbike_brand_label"),placeholder:l("bikeselector_addbike_brand_select"),value:r.value,options:u,onChange:k=>{t("brand",k.target.value)},loading:!r.options.length&&!r.error,disabled:!r.options.length||r.error,info:!0,infoVisible:!r.value,error:r.error,children:g("img",{src:Sn("info-brand.svg"),class:"w-full h-full"})}),g(fa,{type:"model",title:l("bikeselector_addbike_model_label"),placeholder:l("bikeselector_addbike_model_select"),value:i.value,options:i.options,onChange:k=>{t("model",k.target.value)},loading:A&&!i.options.length&&!i.error,disabled:!A||!i.options.length,info:!0,infoVisible:A&&!i.value,error:i.error,children:g("img",{src:Sn("info-model.svg"),class:"w-full h-full"})}),g(fa,{type:"framespec",title:l("bikeselector_addbike_framespec_label"),placeholder:l("bikeselector_addbike_framespec_select"),value:o.value,loading:z&&!o.options.length&&!o.error,options:o.options,onChange:k=>{t("frameSeries",k.target.value)},disabled:!z||!o.options.length||o.error,info:!0,infoVisible:z&&!o.value,error:o.error,children:g("img",{src:Sn("info-frameseries.svg"),class:"w-full h-full"})}),n.virtualWorkshop&&g(ie,{children:[g("div",{className:"flex justify-center items-center gap-2",children:[g("div",{className:"bg-gray-300 h-[1px] w-full"}),g("p",{className:" font-semibold text-sm",children:l("bikeselector_or")}),g("div",{className:"bg-gray-300 h-[1px] w-full"})]}),g(cf,{value:P,setValue:k=>x(k),label:"Bike Matrix ID",placeholder:l("virtualworkshop_add_by_id"),type:"text",instructions:l("virtualworkshop_bm_id_text")})]})]}),g(br,{messages:b}),g(Cr,{noMargin:!0,primary:!0,text:l("bikeselector_addbike_find_btn"),onClick:()=>{r.value&&i.value&&o.value?Oe("/search"):P&&w()},active:r.value&&i.value&&o.value||P,loading:f,children:g(vr,{class:"h-3 ml-auto justify-self-end"})})]})}function x3(){var P,x,A,z;const{bike:n,setBike:e,setBikeAttr:t,results:r,loading:i}=Ht(),{year:o,bikeSpec:l}=n,{t:u}=De(),[c,f]=[n.value,w=>e(k=>({...k,value:w}))],p=zr(()=>{const w=r==null?void 0:r.filter(k=>{var O;let D=!0;return l.value&&(D=k.bikeSpec===l.value),D&&o.value.length&&(D=(O=o.value)==null?void 0:O.includes(k.year)),D});return w.some(k=>k._key==c._key)||f({}),w},[r,l.value,o.value]),h=zr(()=>l.value?r.filter(k=>l.value==k.bikeSpec).map(k=>k.year):o.options.map(k=>k.value),[l.value]),b=zr(()=>{var k;if(!((k=o.value)!=null&&k.length))return l.options;const w=r.filter(D=>{var O;return(O=o.value)==null?void 0:O.includes(D.year)}).map(D=>D.bikeSpec);return l.options.map(D=>({...D,disabled:!w.includes(D.value)}))},[l.options,o.value]),m=w=>w===0?u("bikeselector_search_no_bikes_found"):w===1?u("bikeselector_search_one_bike_found"):u("bikeselector_search_number_bikes_found",{number_found:w});return g(ie,{children:[g("div",{class:"space-y-3 mb-6 relative w-full flex flex-col",children:[(n.bikeSpec.error||n.frameSize.error||n.year.error)&&g(br,{messages:n.bikeSpec.error||n.frameSize.error||n.year.error}),g(fa,{type:"bikespec",title:u("bikeselector_search_bikespec_label"),placeholder:u("bikeselector_search_bikespec_select"),value:l.value,options:[{label:u("bikeselector_search_bikespec_select_all"),value:""},...b],onChange:w=>{t("bikeSpec",w.target.value)},disabled:!((P=l.options)!=null&&P.length)||n.bikeSpec.error,loading:!((x=l.options)!=null&&x.length)&&!n.bikeSpec.error}),g("div",{class:"w-full flex flex-col space-y-2",children:[g("label",{class:"text-gray-800 font-bold text",children:u("bikeselector_search_year_label")}),g("div",{class:Pe("flex space-x-2 overflow-x-auto","-mx-8 w-[calc(100%_+_64px)] px-8 no-scrollbar"),children:(A=o.options)!=null&&A.length?(z=o.options)==null?void 0:z.map(w=>{var O;const k=l.value&&!h.includes(w.value),D=(O=o.value)==null?void 0:O.includes(w.value);return g("div",{onClick:()=>{k||t("year",D?o.value.filter(B=>B!==w.value):[...o.value,w.value])},class:Pe("rounded-full cursor-pointer items-center flex border py-2 px-4",D?"pr-3 bg-gray-950 border-gray-950 text-white":"border-gray-300 text-gray-700 ",k&&"hidden"),children:[w.label,D&&g(ua,{class:"w-3 h-3 ml-2"})]})}):Array(2).fill(0).map((w,k)=>g("div",{class:"rounded-full items-center flex border py-2 bg-gray-100 px-4 bg-100 border-gray-300 animate-pulse",children:g("span",{class:"rounded-lg bg-gray-100 w-9 h-5"})},k))})]}),g("div",{class:Pe("text-nowrap font-medium w-full flex","[&>span]:text-gray-500 [&>span]:font-normal"),children:[i?g(ie,{children:u("bikeselector_search_searching")}):g(ie,{children:m(p.length)})," ",(r==null?void 0:r.length)>0&&g(ie,{children:[g("span",{children:"("}),g("span",{class:"whitespace-nowrap overflow-hidden text-ellipsis truncate",children:[r[0].brand," ",r[0].frameSeries]}),g("span",{children:")"})]})]}),g("div",{class:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:p!=null&&p.length&&!i?p.map((w,k)=>g(gr,{"data-key":w._key,bike:w,selected:w._key===c._key,onClick:D=>{D.preventDefault(),f(w)},compact:!0},w._key)):Array(i?2:1).fill(0).map((w,k)=>g("div",{class:Pe("w-full relative rounded-xl h-40 bg-white border border-gray-200 ",i&&"animate-pulse"),children:[g("span",{class:" absolute left-4 top-4 rounded-lg h-6 w-1/2 bg-gray-200"}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-200"})]},k))})]}),g("button",{onClick:w=>{var k,D;if(w.preventDefault(),c._key){const O=(k=this.base.querySelector(`[data-key="${c._key}"] [data-active-slide]`))==null?void 0:k.getAttribute("data-active-slide"),L=[(D=this.base.querySelector(`[data-key="${c._key}"] [data-slide="${O}"] img`))==null?void 0:D.src].filter(T=>!!T);L!=null&&L.length&&e(T=>(T.value={...T.value||{},images:L},{...T})),Oe("/size")}},class:Pe("duration-300 transition-colors sticky bottom-6 mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",c._key?"bg-gray-950 text-white":"bg-gray-200 text-gray-400 "),children:[g("span",{class:"ml-auto",children:u("bikeselector_search_confirm_btn")})," ",g(vr,{class:"h-3 ml-auto justify-self-end"})]})]})}function P3(){var o,l;const{bike:n,setBikeAttr:e,setBike:t}=Ht(),{frameSize:r}=n,{t:i}=De();return oe(()=>{var u;(u=r.options)!=null&&u.length||Oe("/confirm")},[]),g(ie,{children:[g(gr,{bike:n.value,selected:!0,compact:!0}),g("div",{class:" mt-4 mb-6 relative w-full flex flex-col",children:g(fa,{type:"framesize",instruction:!0,title:i("bikeselector_size_framesize_label"),placeholder:i("bikeselector_size_framesize_select"),value:r.value,options:r.options,onChange:u=>{e("frameSize",u.target.value),t(c=>{var f;return c.value.frameSize=((f=r.options.find(p=>p.value==u.target.value))==null?void 0:f.label)||"",c})},selected:!0,info:!0,infoVisible:!0,disabled:!((o=r.options)!=null&&o.length),loading:!((l=r.options)!=null&&l.length),children:g("img",{src:Sn("info-size.svg"),class:"w-full h-full"})})}),g("button",{onClick:u=>{u.preventDefault(),r.value&&Oe("/confirm")},class:Pe("duration-300 transition-colors sticky bottom-10 mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",r.value?"bg-gray-950 text-white":"bg-gray-200 text-gray-400 "),children:[g("span",{class:"ml-auto",children:i("bikeselector_size_confirm_btn")})," ",g(vr,{class:"h-3 ml-auto justify-self-end"})]})]})}const Ar=wt({title:"",step:0,back:""});function k3({children:n}){const{t:e}=De();return g(ie,{children:[g("div",{class:"relative flex items-center justify-center w-full h-10 my-5 sm:mt-8",children:[!!Ar.value.back&&g("div",{onClick:()=>Oe(Ar.value.back),class:" w-10 h-10 absolute left-0 rounded-xl self-start border-gray-200 border items-center justify-center flex",children:g(vr,{class:"h-3 text-gray-500 -translate-x-px -rotate-180"})}),g("h2",{class:"text-xl font-bold",style:{maxWidth:"70%",textAlign:"center"},children:e(Ar.value.title)})]}),n,typeof Ar.value.step<"u"&&g("div",{class:"space-x-2 my-6 flex items-center justify-center",children:[0,1,2,3].map(t=>g("div",{class:Pe("rounded-xl h-2 transition-all duration-300",t==Ar.value.step?"w-6 bg-gray-950":"w-2 bg-gray-200")},t))})]})}function z3(){const{bike:n,saveBike:e}=Ht(),{brand:t,model:r,frameSeries:i,frameSize:o,year:l,bikeSpec:u}=n.value,{t:c}=De(),f=ht.value;return oe(()=>{!o&&!f?Ar.value.back="/search":f&&(Ar.value.back="/add")},[]),g(ie,{children:[g(gr,{bike:n.value,selected:!0,compact:!0}),g("div",{class:" space-y-4 mt-4 mb-6 relative w-full flex flex-col",children:[{title:c("bikeselector_confirm_brandmodelframespec_label"),value:[t,r,i].join(", "),path:"/add"},{title:c("bikeselector_confirm_yearbikespec_label"),value:[l,u].join(", "),path:"/search"},{title:c("bikeselector_confirm_framesize_label"),value:o,path:"/size"}].filter(p=>!!p.value).map(p=>g("div",{class:"w-full flex flex-col space-y-2",children:[g("label",{class:"text-gray-800 font-bold",children:p.title}),g("div",{onClick:()=>Oe(p.path),class:"w-full flex items-center relative cursor-pointer",children:[g("div",{class:Pe("rounded-xl peer whitespace-nowrap truncate !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg placeholder:text-gray-700 text-gray-700"),children:p.value}),g(vr,{class:"absolute h-3 text-gray-700 pointer-events-none right-4 peer-disabled:text-gray-400"})]})]},p.path))}),g("button",{onClick:p=>{p.preventDefault(),e(n.value),Oe("/browse")},class:Pe("duration-300 transition-colors sticky bottom-10 mt-auto rounded-xl p-3 w-full flex justify-center items-center","bg-gray-950 text-white"),children:c("bikeselector_confirm_confirm_btn")}),g("p",{class:"text-gray-600 -mb-3 mt-2 text-center font-normal text-xs",children:c("bikeselector_confirm_notyourride_msg")})]})}function C3(){const{currentBike:n,compatibleCollections:e}=Ht(),[t,r]=K(!0),[i,o]=K(),{t:l}=De(),u=()=>{if(e.length>0){let c=[];e.map(f=>{c.some(p=>p.text_id===f.text_id)||c.push(f)}),o(c)}};return oe(()=>{u()},[e]),oe(()=>{i&&r(!1)},[i]),g(ie,{children:[g(gr,{bike:n,selected:!0}),!!(i!=null&&i.length)&&!e.error&&g(ie,{children:[g("p",{class:"text-gray-800 mt-4 font-bold",children:l("bikeselector_browse_products_label")}),g("div",{class:"gap-3 mt-2 mb-6 relative w-full flex flex-wrap",children:i.map(c=>g("a",{href:c.url,class:"group flex items-center relative cursor-pointer",children:[g("div",{class:Pe("rounded-xl peer whitespace-nowrap truncate !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg placeholder:text-gray-700 text-gray-950","group-disabled:bg-gray-100 group-disabled:border-gray-200 group-disabled:text-gray-400"),children:l(c.text_id)}),g(vr,{class:"absolute h-3 pointer-events-none right-4 group-disabled:text-gray-400 text-gray-950"})]},c.text_id))})]}),g("div",{style:{width:"100%",display:"flex",justifyContent:"center",marginTop:"1rem"},children:g(Rr,{isLoading:t,colour:"#000"})}),e&&(e==null?void 0:e.error)&&g(br,{messages:e.error,left:!0,margin:20}),g("button",{onClick:c=>{c.preventDefault(),bi()},class:Pe("duration-300 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-950 text-white"),children:l("bikeselector_browse_shop_btn")}),g("button",{onClick:c=>{c.preventDefault(),Oe("/")},class:Pe("duration-300 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-200 text-gray-800"),children:l("bikeselector_browse_back_btn")}),g(Fr,{})]})}const yi=()=>g("div",{class:"w-full p-4 relative rounded-xl bg-white border border-gray-300 mb-4",children:[g("span",{class:"block rounded-lg h-6 w-1/2 bg-gray-200"}),g("img",{class:"w-auto mx-auto h-auto max-h-36 opacity-30",src:Sn("bike.png")}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]});function A3(){const{t:n}=De(),t=window.BikeMatrix.getConfig(),{currentBike:r,setCurrentBike:i,compatibleCollections:o}=Ht(),l=new xt(t.apiUrl,t.apiKey,t.apiToken,t.isShopify),[u,c]=K(!1),[f,p]=K(null),{saveBike:h}=Ht(),b=async()=>{c(!0);const m=await l.addCustomBike(r.key);if(m.success){const P=await l.getBikeBom(m==null?void 0:m.data);if(!P.success){p(P.error),c(!1),t.logLevel==="verbose"&&console.error(P.logError);return}const x=mi(P.data);ht.value=x;const A={...r,key:x.bike_Key,isCustom:!0,shareId:x.share_Bike_Key};h(A),i(A),c(!1),Oe("/bom")}else{p(m.error),c(!1),t.logLevel==="verbose"&&console.error(m.logError);return}};return g(ie,{children:[g("div",{style:{marginBottom:"1rem"},children:[r?g(gr,{bike:r,noSymbol:!0,compact:!0}):g(yi,{}),g("div",{class:" text-gray-800 text-center flex z-20 justify-center font-bold mt-6",children:!o.error&&o.length>1?n("virtualworkshop_intro_text"):n("virtualworkshop_do_not_pass")})]}),g(br,{messages:f||o.error}),g(Cr,{text:!o.error&&o.length>1?n("virtualworkshop_enter_button"):n("bikeselector_browse_back_btn"),onClick:!o.error&&o.length>1?()=>b():()=>Oe("/"),loading:u,primary:!0}),g(Fr,{})]})}const H3=`.overflowing{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;justify-content:flex-start}.flexend{justify-content:flex-end}
|
|
4
|
+
`;function Rr({isLoading:n,colour:e}){return g(ie,{children:[g("style",{type:"text/css",children:y3}),g("div",{class:"lds-ring",id:"bm-loading-spinner",style:{display:n?"inline-block":"none"},children:[g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),g("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}})]})]})}const Cr=({onClick:n,primary:e,text:t,loading:r,disabled:i,sticky:o,children:l,active:u=!0,noMargin:c=!1})=>g("button",{onClick:f=>{!i&&!r&&(f.preventDefault(),n())},class:Pe("duration-300 bottom-4 transition-colors rounded-xl p-3 w-full flex justify-center items-center",`${e&&u?"bg-gray-950 text-white":e&&!u?"bg-gray-200 text-gray-400 ":"bg-gray-200 text-gray-800"} ${o&&"sticky"} ${!c&&"mt-4"}`),style:{cursor:i?"not-allowed":"pointer",opacity:i?.5:1},children:r?g(Rr,{isLoading:r,colour:e?"#fff":"#000"}):g(ie,{children:[g("span",{className:l?"ml-auto":"",children:t}),l]})});function w3(){const n=window.BikeMatrix.getConfig(),{bike:e,setBikeAttr:t}=Ht(),{brand:r,model:i,frameSeries:o}=e,{t:l}=De(),[u,c]=K([]),[f,p]=K(!1),h=new xt(n.apiUrl,n.apiKey,n.apiToken,n.isShopify),[b,m]=K(null),[P,x]=K(""),A=r.value,z=r.value&&i.value;oe(()=>{const k=n.bikeSelectorBrands?n.bikeSelectorBrands.split(",").filter(D=>D!==""):[];if(k.length>0&&r.options.length>0){let D=[];r.options.forEach(O=>{k.includes(O.value.toString().trim())&&D.push(O)}),c(D)}else r.options.length>0&&c(r.options)},[n.bikeSelectorBrands,r.options]);const w=async()=>{p(!0);const k=await h.getBikeBom(P);if(!(k!=null&&k.success)){n.logLevel==="verbose"&&console.error(k.logError),p(!1),m(k.error);return}if(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(P)){const O=await h.getBikeBom(P),B=mi(O.data);ht.value=B,e.value=await lf(B),p(!1),Oe("/confirm")}else m("error_get_bike_bom"),p(!1)};return g(ie,{children:[g("div",{class:"space-y-5 relative w-full flex flex-col",children:[g(fa,{type:"brand",title:l("bikeselector_addbike_brand_label"),placeholder:l("bikeselector_addbike_brand_select"),value:r.value,options:u,onChange:k=>{t("brand",k.target.value)},loading:!r.options.length&&!r.error,disabled:!r.options.length||r.error,info:!0,infoVisible:!r.value,error:r.error,children:g("img",{src:Sn("info-brand.svg"),class:"w-full h-full"})}),g(fa,{type:"model",title:l("bikeselector_addbike_model_label"),placeholder:l("bikeselector_addbike_model_select"),value:i.value,options:i.options,onChange:k=>{t("model",k.target.value)},loading:A&&!i.options.length&&!i.error,disabled:!A||!i.options.length,info:!0,infoVisible:A&&!i.value,error:i.error,children:g("img",{src:Sn("info-model.svg"),class:"w-full h-full"})}),g(fa,{type:"framespec",title:l("bikeselector_addbike_framespec_label"),placeholder:l("bikeselector_addbike_framespec_select"),value:o.value,loading:z&&!o.options.length&&!o.error,options:o.options,onChange:k=>{t("frameSeries",k.target.value)},disabled:!z||!o.options.length||o.error,info:!0,infoVisible:z&&!o.value,error:o.error,children:g("img",{src:Sn("info-frameseries.svg"),class:"w-full h-full"})}),n.virtualWorkshop&&g(ie,{children:[g("div",{className:"flex justify-center items-center gap-2",children:[g("div",{className:"bg-gray-300 h-[1px] w-full"}),g("p",{className:" font-semibold text-sm",children:l("bikeselector_or")}),g("div",{className:"bg-gray-300 h-[1px] w-full"})]}),g(cf,{value:P,setValue:k=>x(k),label:"Bike Matrix ID",placeholder:l("virtualworkshop_add_by_id"),type:"text",instructions:l("virtualworkshop_bm_id_text")})]})]}),g(br,{messages:b}),g(Cr,{noMargin:!0,primary:!0,text:l("bikeselector_addbike_find_btn"),onClick:()=>{r.value&&i.value&&o.value?Oe("/search"):P&&w()},active:r.value&&i.value&&o.value||P,loading:f,children:g(vr,{class:"h-3 ml-auto justify-self-end"})})]})}function x3(){var P,x,A,z;const{bike:n,setBike:e,setBikeAttr:t,results:r,loading:i}=Ht(),{year:o,bikeSpec:l}=n,{t:u}=De(),[c,f]=[n.value,w=>e(k=>({...k,value:w}))],p=zr(()=>{const w=r==null?void 0:r.filter(k=>{var O;let D=!0;return l.value&&(D=k.bikeSpec===l.value),D&&o.value.length&&(D=(O=o.value)==null?void 0:O.includes(k.year)),D});return w.some(k=>k._key==c._key)||f({}),w},[r,l.value,o.value]),h=zr(()=>l.value?r.filter(k=>l.value==k.bikeSpec).map(k=>k.year):o.options.map(k=>k.value),[l.value]),b=zr(()=>{var k;if(!((k=o.value)!=null&&k.length))return l.options;const w=r.filter(D=>{var O;return(O=o.value)==null?void 0:O.includes(D.year)}).map(D=>D.bikeSpec);return l.options.map(D=>({...D,disabled:!w.includes(D.value)}))},[l.options,o.value]),m=w=>w===0?u("bikeselector_search_no_bikes_found"):w===1?u("bikeselector_search_one_bike_found"):u("bikeselector_search_number_bikes_found",{number_found:w});return g(ie,{children:[g("div",{class:"space-y-3 mb-6 relative w-full flex flex-col",children:[(n.bikeSpec.error||n.frameSize.error||n.year.error)&&g(br,{messages:n.bikeSpec.error||n.frameSize.error||n.year.error}),g(fa,{type:"bikespec",title:u("bikeselector_search_bikespec_label"),placeholder:u("bikeselector_search_bikespec_select"),value:l.value,options:[{label:u("bikeselector_search_bikespec_select_all"),value:""},...b],onChange:w=>{t("bikeSpec",w.target.value)},disabled:!((P=l.options)!=null&&P.length)||n.bikeSpec.error,loading:!((x=l.options)!=null&&x.length)&&!n.bikeSpec.error}),g("div",{class:"w-full flex flex-col space-y-2",children:[g("label",{class:"text-gray-800 font-bold text",children:u("bikeselector_search_year_label")}),g("div",{class:Pe("flex space-x-2 overflow-x-auto","-mx-8 w-[calc(100%_+_64px)] px-8 no-scrollbar"),children:(A=o.options)!=null&&A.length?(z=o.options)==null?void 0:z.map(w=>{var O;const k=l.value&&!h.includes(w.value),D=(O=o.value)==null?void 0:O.includes(w.value);return g("div",{onClick:()=>{k||t("year",D?o.value.filter(B=>B!==w.value):[...o.value,w.value])},class:Pe("rounded-full cursor-pointer items-center flex border py-2 px-4",D?"pr-3 bg-gray-950 border-gray-950 text-white":"border-gray-300 text-gray-700 ",k&&"hidden"),children:[w.label,D&&g(ua,{class:"w-3 h-3 ml-2"})]})}):Array(2).fill(0).map((w,k)=>g("div",{class:"rounded-full items-center flex border py-2 bg-gray-100 px-4 bg-100 border-gray-300 animate-pulse",children:g("span",{class:"rounded-lg bg-gray-100 w-9 h-5"})},k))})]}),g("div",{class:Pe("text-nowrap font-medium w-full flex","[&>span]:text-gray-500 [&>span]:font-normal"),children:[i?g(ie,{children:u("bikeselector_search_searching")}):g(ie,{children:m(p.length)})," ",(r==null?void 0:r.length)>0&&g(ie,{children:[g("span",{children:"("}),g("span",{class:"whitespace-nowrap overflow-hidden text-ellipsis truncate",children:[r[0].brand," ",r[0].frameSeries]}),g("span",{children:")"})]})]}),g("div",{class:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:p!=null&&p.length&&!i?p.map((w,k)=>g(gr,{"data-key":w._key,bike:w,selected:w._key===c._key,onClick:D=>{D.preventDefault(),f(w)},compact:!0},w._key)):Array(i?2:1).fill(0).map((w,k)=>g("div",{class:Pe("w-full relative rounded-xl h-40 bg-white border border-gray-200 ",i&&"animate-pulse"),children:[g("span",{class:" absolute left-4 top-4 rounded-lg h-6 w-1/2 bg-gray-200"}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-200"})]},k))})]}),g("button",{onClick:w=>{var k,D;if(w.preventDefault(),c._key){const O=(k=this.base.querySelector(`[data-key="${c._key}"] [data-active-slide]`))==null?void 0:k.getAttribute("data-active-slide"),L=[(D=this.base.querySelector(`[data-key="${c._key}"] [data-slide="${O}"] img`))==null?void 0:D.src].filter(T=>!!T);L!=null&&L.length&&e(T=>(T.value={...T.value||{},images:L},{...T})),Oe("/size")}},class:Pe("duration-300 transition-colors sticky bottom-6 mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",c._key?"bg-gray-950 text-white":"bg-gray-200 text-gray-400 "),children:[g("span",{class:"ml-auto",children:u("bikeselector_search_confirm_btn")})," ",g(vr,{class:"h-3 ml-auto justify-self-end"})]})]})}function P3(){var o,l;const{bike:n,setBikeAttr:e,setBike:t}=Ht(),{frameSize:r}=n,{t:i}=De();return oe(()=>{var u;(u=r.options)!=null&&u.length||Oe("/confirm")},[]),g(ie,{children:[g(gr,{bike:n.value,selected:!0,compact:!0}),g("div",{class:" mt-4 mb-6 relative w-full flex flex-col",children:g(fa,{type:"framesize",instruction:!0,title:i("bikeselector_size_framesize_label"),placeholder:i("bikeselector_size_framesize_select"),value:r.value,options:r.options,onChange:u=>{e("frameSize",u.target.value),t(c=>{var f;return c.value.frameSize=((f=r.options.find(p=>p.value==u.target.value))==null?void 0:f.label)||"",c})},selected:!0,info:!0,infoVisible:!0,disabled:!((o=r.options)!=null&&o.length),loading:!((l=r.options)!=null&&l.length),children:g("img",{src:Sn("info-size.svg"),class:"w-full h-full"})})}),g("button",{onClick:u=>{u.preventDefault(),r.value&&Oe("/confirm")},class:Pe("duration-300 transition-colors sticky bottom-10 mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",r.value?"bg-gray-950 text-white":"bg-gray-200 text-gray-400 "),children:[g("span",{class:"ml-auto",children:i("bikeselector_size_confirm_btn")})," ",g(vr,{class:"h-3 ml-auto justify-self-end"})]})]})}const Ar=wt({title:"",step:0,back:""});function k3({children:n}){const{t:e}=De();return g(ie,{children:[g("div",{class:"relative flex items-center justify-center w-full h-10 my-5 sm:mt-8",children:[!!Ar.value.back&&g("div",{onClick:()=>Oe(Ar.value.back),class:" w-10 h-10 absolute left-0 rounded-xl self-start border-gray-200 border items-center justify-center flex",children:g(vr,{class:"h-3 text-gray-500 -translate-x-px -rotate-180"})}),g("h2",{class:"text-xl font-bold",style:{maxWidth:"70%",textAlign:"center"},children:e(Ar.value.title)})]}),n,typeof Ar.value.step<"u"&&g("div",{class:"space-x-2 my-6 flex items-center justify-center",children:[0,1,2,3].map(t=>g("div",{class:Pe("rounded-xl h-2 transition-all duration-300",t==Ar.value.step?"w-6 bg-gray-950":"w-2 bg-gray-200")},t))})]})}function z3(){const{bike:n,saveBike:e}=Ht(),{brand:t,model:r,frameSeries:i,frameSize:o,year:l,bikeSpec:u}=n.value,{t:c}=De(),f=ht.value;return oe(()=>{!o&&!f?Ar.value.back="/search":f&&(Ar.value.back="/add")},[]),g(ie,{children:[g(gr,{bike:n.value,selected:!0,compact:!0}),g("div",{class:" space-y-4 mt-4 mb-6 relative w-full flex flex-col",children:[{title:c("bikeselector_confirm_brandmodelframespec_label"),value:[t,r,i].join(", "),path:"/add"},{title:c("bikeselector_confirm_yearbikespec_label"),value:[l,u].join(", "),path:"/search"},{title:c("bikeselector_confirm_framesize_label"),value:o,path:"/size"}].filter(p=>!!p.value).map(p=>g("div",{class:"w-full flex flex-col space-y-2",children:[g("label",{class:"text-gray-800 font-bold",children:p.title}),g("div",{onClick:()=>Oe(p.path),class:"w-full flex items-center relative cursor-pointer",children:[g("div",{class:Pe("rounded-xl peer whitespace-nowrap truncate !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg placeholder:text-gray-700 text-gray-700"),children:p.value}),g(vr,{class:"absolute h-3 text-gray-700 pointer-events-none right-4 peer-disabled:text-gray-400"})]})]},p.path))}),g("button",{onClick:p=>{p.preventDefault(),e(n.value),Oe("/browse")},class:Pe("duration-300 transition-colors sticky bottom-10 mt-auto rounded-xl p-3 w-full flex justify-center items-center","bg-gray-950 text-white"),children:c("bikeselector_confirm_confirm_btn")}),g("p",{class:"text-gray-600 -mb-3 mt-2 text-center font-normal text-xs",children:c("bikeselector_confirm_notyourride_msg")})]})}function C3(){const{currentBike:n,compatibleCollections:e}=Ht(),[t,r]=K(!0),[i,o]=K(),{t:l}=De(),u=()=>{if(e&&e.length>0){let c=[];e.map(f=>{c.some(p=>p.text_id===f.text_id)||c.push(f)}),o(c)}};return oe(()=>{u()},[e]),oe(()=>{i&&r(!1)},[i]),g(ie,{children:[g(gr,{bike:n,selected:!0}),!!(i!=null&&i.length)&&!e.error&&g(ie,{children:[g("p",{class:"text-gray-800 mt-4 font-bold",children:l("bikeselector_browse_products_label")}),g("div",{class:"gap-3 mt-2 mb-6 relative w-full flex flex-wrap",children:i.map(c=>g("a",{href:c.url,class:"group flex items-center relative cursor-pointer",children:[g("div",{class:Pe("rounded-xl peer whitespace-nowrap truncate !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg placeholder:text-gray-700 text-gray-950","group-disabled:bg-gray-100 group-disabled:border-gray-200 group-disabled:text-gray-400"),children:l(c.text_id)}),g(vr,{class:"absolute h-3 pointer-events-none right-4 group-disabled:text-gray-400 text-gray-950"})]},c.text_id))})]}),g("div",{style:{width:"100%",display:"flex",justifyContent:"center",marginTop:"1rem"},children:g(Rr,{isLoading:t,colour:"#000"})}),e&&(e==null?void 0:e.error)&&g(br,{messages:e.error,left:!0,margin:20}),g("button",{onClick:c=>{c.preventDefault(),bi()},class:Pe("duration-300 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-950 text-white"),children:l("bikeselector_browse_shop_btn")}),g("button",{onClick:c=>{c.preventDefault(),Oe("/")},class:Pe("duration-300 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-200 text-gray-800"),children:l("bikeselector_browse_back_btn")}),g(Fr,{})]})}const yi=()=>g("div",{class:"w-full p-4 relative rounded-xl bg-white border border-gray-300 mb-4",children:[g("span",{class:"block rounded-lg h-6 w-1/2 bg-gray-200"}),g("img",{class:"w-auto mx-auto h-auto max-h-36 opacity-30",src:Sn("bike.png")}),g("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]});function A3(){const{t:n}=De(),t=window.BikeMatrix.getConfig(),{currentBike:r,setCurrentBike:i,compatibleCollections:o}=Ht(),l=new xt(t.apiUrl,t.apiKey,t.apiToken,t.isShopify),[u,c]=K(!1),[f,p]=K(null),{saveBike:h}=Ht(),b=async()=>{c(!0);const m=await l.addCustomBike(r.key);if(m.success){const P=await l.getBikeBom(m==null?void 0:m.data);if(!P.success){p(P.error),c(!1),t.logLevel==="verbose"&&console.error(P.logError);return}const x=mi(P.data);ht.value=x;const A={...r,key:x.bike_Key,isCustom:!0,shareId:x.share_Bike_Key};h(A),i(A),c(!1),Oe("/bom")}else{p(m.error),c(!1),t.logLevel==="verbose"&&console.error(m.logError);return}};return g(ie,{children:[g("div",{style:{marginBottom:"1rem"},children:[r?g(gr,{bike:r,noSymbol:!0,compact:!0}):g(yi,{}),g("div",{class:" text-gray-800 text-center flex z-20 justify-center font-bold mt-6",children:!o.error&&o.length>1?n("virtualworkshop_intro_text"):n("virtualworkshop_do_not_pass")})]}),g(br,{messages:f||o.error}),g(Cr,{text:!o.error&&o.length>1?n("virtualworkshop_enter_button"):n("bikeselector_browse_back_btn"),onClick:!o.error&&o.length>1?()=>b():()=>Oe("/"),loading:u,primary:!0}),g(Fr,{})]})}const H3=`.overflowing{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;justify-content:flex-start}.flexend{justify-content:flex-end}
|
|
5
5
|
`,Gr=({paragraph:n,subheader:e,header:t,text:r,small:i,left:o,bold:l,capitalize:u,nowrap:c,flexend:f})=>g(ie,{children:[g("style",{type:"text/css",children:H3}),t?g("h2",{class:"text-xl font-bold",children:r}):e?g("h4",{className:`text-gray-800 text-center flex z-20 justify-center font-bold ${u?"capitalize":""}`,children:r}):g("p",{class:`text-gray-800 flex z-20 ${i?"text-sm":""} ${o?"text-start justify-start":"text-center justify-center"} ${l?"font-bold":""} ${u?"capitalize":""} ${c?"overflowing":""} ${f?"flexend":""}`,children:r})]}),D3=`.background-alert-wrapper{opacity:0;position:absolute;height:100%;width:100%;display:none;top:0;left:0;pointer-events:none}.alert-wrapper{position:absolute;z-index:200;width:calc(100% + 16px);height:100%;background-color:#0003;top:0;left:-8px;border-radius:12px;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none}.alert{width:80%;padding:2rem;border-radius:12px;background-color:#fff;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:300}.text-wrapper{display:flex;flex-direction:column;align-items:center;gap:1rem}.button-wrapper{display:flex;gap:1rem;width:100%;margin-top:1rem}
|
|
6
6
|
`;function Qr(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function df(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*!
|
|
7
7
|
* GSAP 3.12.7
|