@metron-labs/quote-react 0.1.68 → 0.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- import{a as Ua,b as $}from"./chunk-SQE76S5B.js";var Om=Ua(We=>{"use strict";function Lc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<wl(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Da(e){return e.length===0?null:e[0]}function _l(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,i=e.length,n=i>>>1;r<n;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>wl(l,a))c<i&&0>wl(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<i&&0>wl(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function wl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}We.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(qm=performance,We.unstable_now=function(){return qm.now()}):(Dc=Date,Em=Dc.now(),We.unstable_now=function(){return Dc.now()-Em});var qm,Dc,Em,Za=[],br=[],_0=1,pa=null,Dt=3,Hc=!1,Wn=!1,eo=!1,Qc=!1,zm=typeof setTimeout=="function"?setTimeout:null,Rm=typeof clearTimeout=="function"?clearTimeout:null,Mm=typeof setImmediate<"u"?setImmediate:null;function yl(e){for(var t=Da(br);t!==null;){if(t.callback===null)_l(br);else if(t.startTime<=e)_l(br),t.sortIndex=t.expirationTime,Lc(Za,t);else break;t=Da(br)}}function Gc(e){if(eo=!1,yl(e),!Wn)if(Da(Za)!==null)Wn=!0,Oi||(Oi=!0,Di());else{var t=Da(br);t!==null&&jc(Gc,t.startTime-e)}}var Oi=!1,to=-1,Am=5,Um=-1;function Dm(){return Qc?!0:!(We.unstable_now()-Um<Am)}function Oc(){if(Qc=!1,Oi){var e=We.unstable_now();Um=e;var t=!0;try{e:{Wn=!1,eo&&(eo=!1,Rm(to),to=-1),Hc=!0;var a=Dt;try{t:{for(yl(e),pa=Da(Za);pa!==null&&!(pa.expirationTime>e&&Dm());){var r=pa.callback;if(typeof r=="function"){pa.callback=null,Dt=pa.priorityLevel;var i=r(pa.expirationTime<=e);if(e=We.unstable_now(),typeof i=="function"){pa.callback=i,yl(e),t=!0;break t}pa===Da(Za)&&_l(Za),yl(e)}else _l(Za);pa=Da(Za)}if(pa!==null)t=!0;else{var n=Da(br);n!==null&&jc(Gc,n.startTime-e),t=!1}}break e}finally{pa=null,Dt=a,Hc=!1}t=void 0}}finally{t?Di():Oi=!1}}}var Di;typeof Mm=="function"?Di=function(){Mm(Oc)}:typeof MessageChannel<"u"?(Bc=new MessageChannel,Tm=Bc.port2,Bc.port1.onmessage=Oc,Di=function(){Tm.postMessage(null)}):Di=function(){zm(Oc,0)};var Bc,Tm;function jc(e,t){to=zm(function(){e(We.unstable_now())},t)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(e){e.callback=null};We.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Am=0<e?Math.floor(1e3/e):5};We.unstable_getCurrentPriorityLevel=function(){return Dt};We.unstable_next=function(e){switch(Dt){case 1:case 2:case 3:var t=3;break;default:t=Dt}var a=Dt;Dt=t;try{return e()}finally{Dt=a}};We.unstable_requestPaint=function(){Qc=!0};We.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Dt;Dt=e;try{return t()}finally{Dt=a}};We.unstable_scheduleCallback=function(e,t,a){var r=We.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:_0++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,Lc(br,e),Da(Za)===null&&e===Da(br)&&(eo?(Rm(to),to=-1):eo=!0,jc(Gc,a-r))):(e.sortIndex=i,Lc(Za,e),Wn||Hc||(Wn=!0,Oi||(Oi=!0,Di()))),e};We.unstable_shouldYield=Dm;We.unstable_wrapCallback=function(e){var t=Dt;return function(){var a=Dt;Dt=t;try{return e.apply(this,arguments)}finally{Dt=a}}}});var Lm=Ua((Yx,Bm)=>{"use strict";Bm.exports=Om()});var Pm=Ua(pe=>{"use strict";var Vc=Symbol.for("react.transitional.element"),x0=Symbol.for("react.portal"),k0=Symbol.for("react.fragment"),S0=Symbol.for("react.strict_mode"),N0=Symbol.for("react.profiler"),C0=Symbol.for("react.consumer"),q0=Symbol.for("react.context"),E0=Symbol.for("react.forward_ref"),M0=Symbol.for("react.suspense"),T0=Symbol.for("react.memo"),Ym=Symbol.for("react.lazy"),z0=Symbol.for("react.activity"),Hm=Symbol.iterator;function R0(e){return e===null||typeof e!="object"?null:(e=Hm&&e[Hm]||e["@@iterator"],typeof e=="function"?e:null)}var $m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vm=Object.assign,Xm={};function Li(e,t,a){this.props=e,this.context=t,this.refs=Xm,this.updater=a||$m}Li.prototype.isReactComponent={};Li.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Li.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zm(){}Zm.prototype=Li.prototype;function Xc(e,t,a){this.props=e,this.context=t,this.refs=Xm,this.updater=a||$m}var Zc=Xc.prototype=new Zm;Zc.constructor=Xc;Vm(Zc,Li.prototype);Zc.isPureReactComponent=!0;var Qm=Array.isArray;function $c(){}var Ke={H:null,A:null,T:null,S:null},Km=Object.prototype.hasOwnProperty;function Kc(e,t,a){var r=a.ref;return{$$typeof:Vc,type:e,key:t,ref:r!==void 0?r:null,props:a}}function A0(e,t){return Kc(e.type,t,e.props)}function Pc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vc}function U0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Gm=/\/+/g;function Yc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U0(""+e.key):t.toString(36)}function D0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then($c,$c):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Bi(e,t,a,r,i){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Vc:case x0:o=!0;break;case Ym:return o=e._init,Bi(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+Yc(e,0):r,Qm(i)?(a="",o!=null&&(a=o.replace(Gm,"$&/")+"/"),Bi(i,t,a,"",function(p){return p})):i!=null&&(Pc(i)&&(i=A0(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Gm,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(Qm(e))for(var c=0;c<e.length;c++)r=e[c],n=l+Yc(r,c),o+=Bi(r,t,a,n,i);else if(c=R0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,n=l+Yc(r,c++),o+=Bi(r,t,a,n,i);else if(n==="object"){if(typeof e.then=="function")return Bi(D0(e),t,a,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function xl(e,t,a){if(e==null)return e;var r=[],i=0;return Bi(e,r,"","",function(n){return t.call(a,n,i++)}),r}function O0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var jm=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},B0={map:xl,forEach:function(e,t,a){xl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return xl(e,function(){t++}),t},toArray:function(e){return xl(e,function(t){return t})||[]},only:function(e){if(!Pc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Activity=z0;pe.Children=B0;pe.Component=Li;pe.Fragment=k0;pe.Profiler=N0;pe.PureComponent=Xc;pe.StrictMode=S0;pe.Suspense=M0;pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ke;pe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ke.H.useMemoCache(e)}};pe.cache=function(e){return function(){return e.apply(null,arguments)}};pe.cacheSignal=function(){return null};pe.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Vm({},e.props),i=e.key;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)!Km.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(r[n]=t[n]);var n=arguments.length-2;if(n===1)r.children=a;else if(1<n){for(var o=Array(n),l=0;l<n;l++)o[l]=arguments[l+2];r.children=o}return Kc(e.type,i,r)};pe.createContext=function(e){return e={$$typeof:q0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:C0,_context:e},e};pe.createElement=function(e,t,a){var r,i={},n=null;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)Km.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return Kc(e,n,i)};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:E0,render:e}};pe.isValidElement=Pc;pe.lazy=function(e){return{$$typeof:Ym,_payload:{_status:-1,_result:e},_init:O0}};pe.memo=function(e,t){return{$$typeof:T0,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=Ke.T,a={};Ke.T=a;try{var r=e(),i=Ke.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then($c,jm)}catch(n){jm(n)}finally{t!==null&&a.types!==null&&(t.types=a.types),Ke.T=t}};pe.unstable_useCacheRefresh=function(){return Ke.H.useCacheRefresh()};pe.use=function(e){return Ke.H.use(e)};pe.useActionState=function(e,t,a){return Ke.H.useActionState(e,t,a)};pe.useCallback=function(e,t){return Ke.H.useCallback(e,t)};pe.useContext=function(e){return Ke.H.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e,t){return Ke.H.useDeferredValue(e,t)};pe.useEffect=function(e,t){return Ke.H.useEffect(e,t)};pe.useEffectEvent=function(e){return Ke.H.useEffectEvent(e)};pe.useId=function(){return Ke.H.useId()};pe.useImperativeHandle=function(e,t,a){return Ke.H.useImperativeHandle(e,t,a)};pe.useInsertionEffect=function(e,t){return Ke.H.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return Ke.H.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return Ke.H.useMemo(e,t)};pe.useOptimistic=function(e,t){return Ke.H.useOptimistic(e,t)};pe.useReducer=function(e,t,a){return Ke.H.useReducer(e,t,a)};pe.useRef=function(e){return Ke.H.useRef(e)};pe.useState=function(e){return Ke.H.useState(e)};pe.useSyncExternalStore=function(e,t,a){return Ke.H.useSyncExternalStore(e,t,a)};pe.useTransition=function(){return Ke.H.useTransition()};pe.version="19.2.3"});var He=Ua((Vx,Jm)=>{"use strict";Jm.exports=Pm()});var Fm=Ua(Lt=>{"use strict";var L0=He();function Im(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function vr(){}var Bt={d:{f:vr,r:function(){throw Error(Im(522))},D:vr,C:vr,L:vr,m:vr,X:vr,S:vr,M:vr},p:0,findDOMNode:null},H0=Symbol.for("react.portal");function Q0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var ao=L0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function kl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Lt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Im(299));return Q0(e,t,null,a)};Lt.flushSync=function(e){var t=ao.T,a=Bt.p;try{if(ao.T=null,Bt.p=2,e)return e()}finally{ao.T=t,Bt.p=a,Bt.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Bt.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Bt.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Bt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:n}):a==="script"&&Bt.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=kl(t.as,t.crossOrigin);Bt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Bt.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin);Bt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=kl(t.as,t.crossOrigin);Bt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Bt.d.m(e)};Lt.requestFormReset=function(e){Bt.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,a){return ao.H.useFormState(e,t,a)};Lt.useFormStatus=function(){return ao.H.useHostTransitionStatus()};Lt.version="19.2.3"});var tf=Ua((Zx,ef)=>{"use strict";function Wm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wm)}catch(e){console.error(e)}}Wm(),ef.exports=Fm()});var fv=Ua(Ks=>{"use strict";var gt=Lm(),Eh=He(),G0=tf();function Q(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Mh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Th(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function zh(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function af(e){if(Yo(e)!==e)throw Error(Q(188))}function j0(e){var t=e.alternate;if(!t){if(t=Yo(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var n=i.alternate;if(n===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===n.child){for(n=i.child;n;){if(n===a)return af(i),e;if(n===r)return af(i),t;n=n.sibling}throw Error(Q(188))}if(a.return!==r.return)a=i,r=n;else{for(var o=!1,l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o){for(l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o)throw Error(Q(189))}}if(a.alternate!==r)throw Error(Q(190))}if(a.tag!==3)throw Error(Q(188));return a.stateNode.current===a?e:t}function Rh(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Rh(e),t!==null)return t;e=e.sibling}return null}var Ie=Object.assign,Y0=Symbol.for("react.element"),Sl=Symbol.for("react.transitional.element"),uo=Symbol.for("react.portal"),$i=Symbol.for("react.fragment"),Ah=Symbol.for("react.strict_mode"),Mu=Symbol.for("react.profiler"),Uh=Symbol.for("react.consumer"),tr=Symbol.for("react.context"),Sp=Symbol.for("react.forward_ref"),Tu=Symbol.for("react.suspense"),zu=Symbol.for("react.suspense_list"),Np=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),Ru=Symbol.for("react.activity"),$0=Symbol.for("react.memo_cache_sentinel"),rf=Symbol.iterator;function ro(e){return e===null||typeof e!="object"?null:(e=rf&&e[rf]||e["@@iterator"],typeof e=="function"?e:null)}var V0=Symbol.for("react.client.reference");function Au(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $i:return"Fragment";case Mu:return"Profiler";case Ah:return"StrictMode";case Tu:return"Suspense";case zu:return"SuspenseList";case Ru:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case uo:return"Portal";case tr:return e.displayName||"Context";case Uh:return(e._context.displayName||"Context")+".Consumer";case Sp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Np:return t=e.displayName||null,t!==null?t:Au(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return Au(e(t))}catch{}}return null}var po=Array.isArray,se=Eh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ue=G0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ai={pending:!1,data:null,method:null,action:null},Uu=[],Vi=-1;function Qa(e){return{current:e}}function kt(e){0>Vi||(e.current=Uu[Vi],Uu[Vi]=null,Vi--)}function Xe(e,t){Vi++,Uu[Vi]=e.current,e.current=t}var Ha=Qa(null),Mo=Qa(null),Tr=Qa(null),rs=Qa(null);function is(e,t){switch(Xe(Tr,t),Xe(Mo,e),Xe(Ha,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ph(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ph(t),e=ev(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}kt(Ha),Xe(Ha,e)}function un(){kt(Ha),kt(Mo),kt(Tr)}function Du(e){e.memoizedState!==null&&Xe(rs,e);var t=Ha.current,a=ev(t,e.type);t!==a&&(Xe(Mo,e),Xe(Ha,a))}function ns(e){Mo.current===e&&(kt(Ha),kt(Mo)),rs.current===e&&(kt(rs),Qo._currentValue=ai)}var Jc,nf;function Fr(e){if(Jc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Jc=t&&t[1]||"",nf=-1<a.stack.indexOf(`
1
+ import{a as Aa,b as $}from"./chunk-SQE76S5B.js";var Om=Aa(We=>{"use strict";function Bc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<vl(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Ua(e){return e.length===0?null:e[0]}function _l(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,i=e.length,n=i>>>1;r<n;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>vl(l,a))c<i&&0>vl(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<i&&0>vl(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function vl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}We.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(qm=performance,We.unstable_now=function(){return qm.now()}):(Uc=Date,Em=Uc.now(),We.unstable_now=function(){return Uc.now()-Em});var qm,Uc,Em,Za=[],gr=[],_0=1,ua=null,Dt=3,Lc=!1,Wn=!1,eo=!1,Hc=!1,zm=typeof setTimeout=="function"?setTimeout:null,Rm=typeof clearTimeout=="function"?clearTimeout:null,Mm=typeof setImmediate<"u"?setImmediate:null;function yl(e){for(var t=Ua(gr);t!==null;){if(t.callback===null)_l(gr);else if(t.startTime<=e)_l(gr),t.sortIndex=t.expirationTime,Bc(Za,t);else break;t=Ua(gr)}}function Qc(e){if(eo=!1,yl(e),!Wn)if(Ua(Za)!==null)Wn=!0,Di||(Di=!0,Ui());else{var t=Ua(gr);t!==null&&Gc(Qc,t.startTime-e)}}var Di=!1,to=-1,Am=5,Um=-1;function Dm(){return Hc?!0:!(We.unstable_now()-Um<Am)}function Dc(){if(Hc=!1,Di){var e=We.unstable_now();Um=e;var t=!0;try{e:{Wn=!1,eo&&(eo=!1,Rm(to),to=-1),Lc=!0;var a=Dt;try{t:{for(yl(e),ua=Ua(Za);ua!==null&&!(ua.expirationTime>e&&Dm());){var r=ua.callback;if(typeof r=="function"){ua.callback=null,Dt=ua.priorityLevel;var i=r(ua.expirationTime<=e);if(e=We.unstable_now(),typeof i=="function"){ua.callback=i,yl(e),t=!0;break t}ua===Ua(Za)&&_l(Za),yl(e)}else _l(Za);ua=Ua(Za)}if(ua!==null)t=!0;else{var n=Ua(gr);n!==null&&Gc(Qc,n.startTime-e),t=!1}}break e}finally{ua=null,Dt=a,Lc=!1}t=void 0}}finally{t?Ui():Di=!1}}}var Ui;typeof Mm=="function"?Ui=function(){Mm(Dc)}:typeof MessageChannel<"u"?(Oc=new MessageChannel,Tm=Oc.port2,Oc.port1.onmessage=Dc,Ui=function(){Tm.postMessage(null)}):Ui=function(){zm(Dc,0)};var Oc,Tm;function Gc(e,t){to=zm(function(){e(We.unstable_now())},t)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(e){e.callback=null};We.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Am=0<e?Math.floor(1e3/e):5};We.unstable_getCurrentPriorityLevel=function(){return Dt};We.unstable_next=function(e){switch(Dt){case 1:case 2:case 3:var t=3;break;default:t=Dt}var a=Dt;Dt=t;try{return e()}finally{Dt=a}};We.unstable_requestPaint=function(){Hc=!0};We.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Dt;Dt=e;try{return t()}finally{Dt=a}};We.unstable_scheduleCallback=function(e,t,a){var r=We.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:_0++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,Bc(gr,e),Ua(Za)===null&&e===Ua(gr)&&(eo?(Rm(to),to=-1):eo=!0,Gc(Qc,a-r))):(e.sortIndex=i,Bc(Za,e),Wn||Lc||(Wn=!0,Di||(Di=!0,Ui()))),e};We.unstable_shouldYield=Dm;We.unstable_wrapCallback=function(e){var t=Dt;return function(){var a=Dt;Dt=t;try{return e.apply(this,arguments)}finally{Dt=a}}}});var Lm=Aa((Gx,Bm)=>{"use strict";Bm.exports=Om()});var Pm=Aa(pe=>{"use strict";var $c=Symbol.for("react.transitional.element"),x0=Symbol.for("react.portal"),k0=Symbol.for("react.fragment"),S0=Symbol.for("react.strict_mode"),N0=Symbol.for("react.profiler"),C0=Symbol.for("react.consumer"),q0=Symbol.for("react.context"),E0=Symbol.for("react.forward_ref"),M0=Symbol.for("react.suspense"),T0=Symbol.for("react.memo"),Ym=Symbol.for("react.lazy"),z0=Symbol.for("react.activity"),Hm=Symbol.iterator;function R0(e){return e===null||typeof e!="object"?null:(e=Hm&&e[Hm]||e["@@iterator"],typeof e=="function"?e:null)}var $m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vm=Object.assign,Xm={};function Bi(e,t,a){this.props=e,this.context=t,this.refs=Xm,this.updater=a||$m}Bi.prototype.isReactComponent={};Bi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zm(){}Zm.prototype=Bi.prototype;function Vc(e,t,a){this.props=e,this.context=t,this.refs=Xm,this.updater=a||$m}var Xc=Vc.prototype=new Zm;Xc.constructor=Vc;Vm(Xc,Bi.prototype);Xc.isPureReactComponent=!0;var Qm=Array.isArray;function Yc(){}var Ke={H:null,A:null,T:null,S:null},Km=Object.prototype.hasOwnProperty;function Zc(e,t,a){var r=a.ref;return{$$typeof:$c,type:e,key:t,ref:r!==void 0?r:null,props:a}}function A0(e,t){return Zc(e.type,t,e.props)}function Kc(e){return typeof e=="object"&&e!==null&&e.$$typeof===$c}function U0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Gm=/\/+/g;function jc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U0(""+e.key):t.toString(36)}function D0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Yc,Yc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Oi(e,t,a,r,i){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case $c:case x0:o=!0;break;case Ym:return o=e._init,Oi(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+jc(e,0):r,Qm(i)?(a="",o!=null&&(a=o.replace(Gm,"$&/")+"/"),Oi(i,t,a,"",function(p){return p})):i!=null&&(Kc(i)&&(i=A0(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Gm,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(Qm(e))for(var c=0;c<e.length;c++)r=e[c],n=l+jc(r,c),o+=Oi(r,t,a,n,i);else if(c=R0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,n=l+jc(r,c++),o+=Oi(r,t,a,n,i);else if(n==="object"){if(typeof e.then=="function")return Oi(D0(e),t,a,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function xl(e,t,a){if(e==null)return e;var r=[],i=0;return Oi(e,r,"","",function(n){return t.call(a,n,i++)}),r}function O0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var jm=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},B0={map:xl,forEach:function(e,t,a){xl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return xl(e,function(){t++}),t},toArray:function(e){return xl(e,function(t){return t})||[]},only:function(e){if(!Kc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Activity=z0;pe.Children=B0;pe.Component=Bi;pe.Fragment=k0;pe.Profiler=N0;pe.PureComponent=Vc;pe.StrictMode=S0;pe.Suspense=M0;pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ke;pe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ke.H.useMemoCache(e)}};pe.cache=function(e){return function(){return e.apply(null,arguments)}};pe.cacheSignal=function(){return null};pe.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Vm({},e.props),i=e.key;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)!Km.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(r[n]=t[n]);var n=arguments.length-2;if(n===1)r.children=a;else if(1<n){for(var o=Array(n),l=0;l<n;l++)o[l]=arguments[l+2];r.children=o}return Zc(e.type,i,r)};pe.createContext=function(e){return e={$$typeof:q0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:C0,_context:e},e};pe.createElement=function(e,t,a){var r,i={},n=null;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)Km.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return Zc(e,n,i)};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:E0,render:e}};pe.isValidElement=Kc;pe.lazy=function(e){return{$$typeof:Ym,_payload:{_status:-1,_result:e},_init:O0}};pe.memo=function(e,t){return{$$typeof:T0,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=Ke.T,a={};Ke.T=a;try{var r=e(),i=Ke.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Yc,jm)}catch(n){jm(n)}finally{t!==null&&a.types!==null&&(t.types=a.types),Ke.T=t}};pe.unstable_useCacheRefresh=function(){return Ke.H.useCacheRefresh()};pe.use=function(e){return Ke.H.use(e)};pe.useActionState=function(e,t,a){return Ke.H.useActionState(e,t,a)};pe.useCallback=function(e,t){return Ke.H.useCallback(e,t)};pe.useContext=function(e){return Ke.H.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e,t){return Ke.H.useDeferredValue(e,t)};pe.useEffect=function(e,t){return Ke.H.useEffect(e,t)};pe.useEffectEvent=function(e){return Ke.H.useEffectEvent(e)};pe.useId=function(){return Ke.H.useId()};pe.useImperativeHandle=function(e,t,a){return Ke.H.useImperativeHandle(e,t,a)};pe.useInsertionEffect=function(e,t){return Ke.H.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return Ke.H.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return Ke.H.useMemo(e,t)};pe.useOptimistic=function(e,t){return Ke.H.useOptimistic(e,t)};pe.useReducer=function(e,t,a){return Ke.H.useReducer(e,t,a)};pe.useRef=function(e){return Ke.H.useRef(e)};pe.useState=function(e){return Ke.H.useState(e)};pe.useSyncExternalStore=function(e,t,a){return Ke.H.useSyncExternalStore(e,t,a)};pe.useTransition=function(){return Ke.H.useTransition()};pe.version="19.2.3"});var He=Aa((Yx,Jm)=>{"use strict";Jm.exports=Pm()});var Fm=Aa(Lt=>{"use strict";var L0=He();function Im(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function br(){}var Bt={d:{f:br,r:function(){throw Error(Im(522))},D:br,C:br,L:br,m:br,X:br,S:br,M:br},p:0,findDOMNode:null},H0=Symbol.for("react.portal");function Q0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var ao=L0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function kl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Lt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Im(299));return Q0(e,t,null,a)};Lt.flushSync=function(e){var t=ao.T,a=Bt.p;try{if(ao.T=null,Bt.p=2,e)return e()}finally{ao.T=t,Bt.p=a,Bt.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Bt.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Bt.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Bt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:n}):a==="script"&&Bt.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=kl(t.as,t.crossOrigin);Bt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Bt.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin);Bt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=kl(t.as,t.crossOrigin);Bt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Bt.d.m(e)};Lt.requestFormReset=function(e){Bt.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,a){return ao.H.useFormState(e,t,a)};Lt.useFormStatus=function(){return ao.H.useHostTransitionStatus()};Lt.version="19.2.3"});var tf=Aa((Vx,ef)=>{"use strict";function Wm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wm)}catch(e){console.error(e)}}Wm(),ef.exports=Fm()});var fw=Aa(Ks=>{"use strict";var gt=Lm(),Eh=He(),G0=tf();function Q(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Mh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Th(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function zh(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function af(e){if(Yo(e)!==e)throw Error(Q(188))}function j0(e){var t=e.alternate;if(!t){if(t=Yo(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var n=i.alternate;if(n===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===n.child){for(n=i.child;n;){if(n===a)return af(i),e;if(n===r)return af(i),t;n=n.sibling}throw Error(Q(188))}if(a.return!==r.return)a=i,r=n;else{for(var o=!1,l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o){for(l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o)throw Error(Q(189))}}if(a.alternate!==r)throw Error(Q(190))}if(a.tag!==3)throw Error(Q(188));return a.stateNode.current===a?e:t}function Rh(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Rh(e),t!==null)return t;e=e.sibling}return null}var Ie=Object.assign,Y0=Symbol.for("react.element"),Sl=Symbol.for("react.transitional.element"),uo=Symbol.for("react.portal"),Yi=Symbol.for("react.fragment"),Ah=Symbol.for("react.strict_mode"),Eu=Symbol.for("react.profiler"),Uh=Symbol.for("react.consumer"),tr=Symbol.for("react.context"),kp=Symbol.for("react.forward_ref"),Mu=Symbol.for("react.suspense"),Tu=Symbol.for("react.suspense_list"),Sp=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),zu=Symbol.for("react.activity"),$0=Symbol.for("react.memo_cache_sentinel"),rf=Symbol.iterator;function ro(e){return e===null||typeof e!="object"?null:(e=rf&&e[rf]||e["@@iterator"],typeof e=="function"?e:null)}var V0=Symbol.for("react.client.reference");function Ru(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Yi:return"Fragment";case Eu:return"Profiler";case Ah:return"StrictMode";case Mu:return"Suspense";case Tu:return"SuspenseList";case zu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case uo:return"Portal";case tr:return e.displayName||"Context";case Uh:return(e._context.displayName||"Context")+".Consumer";case kp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sp:return t=e.displayName||null,t!==null?t:Ru(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return Ru(e(t))}catch{}}return null}var po=Array.isArray,se=Eh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ue=G0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ai={pending:!1,data:null,method:null,action:null},Au=[],$i=-1;function Ha(e){return{current:e}}function kt(e){0>$i||(e.current=Au[$i],Au[$i]=null,$i--)}function Xe(e,t){$i++,Au[$i]=e.current,e.current=t}var La=Ha(null),Mo=Ha(null),Mr=Ha(null),rs=Ha(null);function is(e,t){switch(Xe(Mr,t),Xe(Mo,e),Xe(La,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ph(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ph(t),e=ew(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}kt(La),Xe(La,e)}function cn(){kt(La),kt(Mo),kt(Mr)}function Uu(e){e.memoizedState!==null&&Xe(rs,e);var t=La.current,a=ew(t,e.type);t!==a&&(Xe(Mo,e),Xe(La,a))}function ns(e){Mo.current===e&&(kt(La),kt(Mo)),rs.current===e&&(kt(rs),Qo._currentValue=ai)}var Pc,nf;function Fr(e){if(Pc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Pc=t&&t[1]||"",nf=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Jc+e+nf}var Ic=!1;function Fc(e,t){if(!e||Ic)return"";Ic=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var g=function(){throw Error()};if(Object.defineProperty(g.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(g,[])}catch(b){var d=b}Reflect.construct(e,[],g)}else{try{g.call()}catch(b){d=b}e.call(g.prototype)}}else{try{throw Error()}catch(b){d=b}(g=e())&&typeof g.catch=="function"&&g.catch(function(){})}}catch(b){if(b&&d&&typeof b.stack=="string")return[b.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=r.DetermineComponentFrameRoot(),o=n[0],l=n[1];if(o&&l){var c=o.split(`
3
+ `+Pc+e+nf}var Jc=!1;function Ic(e,t){if(!e||Jc)return"";Jc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var g=function(){throw Error()};if(Object.defineProperty(g.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(g,[])}catch(b){var d=b}Reflect.construct(e,[],g)}else{try{g.call()}catch(b){d=b}e.call(g.prototype)}}else{try{throw Error()}catch(b){d=b}(g=e())&&typeof g.catch=="function"&&g.catch(function(){})}}catch(b){if(b&&d&&typeof b.stack=="string")return[b.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=r.DetermineComponentFrameRoot(),o=n[0],l=n[1];if(o&&l){var c=o.split(`
4
4
  `),p=l.split(`
5
5
  `);for(i=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;i<p.length&&!p[i].includes("DetermineComponentFrameRoot");)i++;if(r===c.length||i===p.length)for(r=c.length-1,i=p.length-1;1<=r&&0<=i&&c[r]!==p[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==p[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==p[i]){var m=`
6
- `+c[r].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=r&&0<=i);break}}}finally{Ic=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fr(a):""}function X0(e,t){switch(e.tag){case 26:case 27:case 5:return Fr(e.type);case 16:return Fr("Lazy");case 13:return e.child!==t&&t!==null?Fr("Suspense Fallback"):Fr("Suspense");case 19:return Fr("SuspenseList");case 0:case 15:return Fc(e.type,!1);case 11:return Fc(e.type.render,!1);case 1:return Fc(e.type,!0);case 31:return Fr("Activity");default:return""}}function of(e){try{var t="",a=null;do t+=X0(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
6
+ `+c[r].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=r&&0<=i);break}}}finally{Jc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fr(a):""}function X0(e,t){switch(e.tag){case 26:case 27:case 5:return Fr(e.type);case 16:return Fr("Lazy");case 13:return e.child!==t&&t!==null?Fr("Suspense Fallback"):Fr("Suspense");case 19:return Fr("SuspenseList");case 0:case 15:return Ic(e.type,!1);case 11:return Ic(e.type.render,!1);case 1:return Ic(e.type,!0);case 31:return Fr("Activity");default:return""}}function of(e){try{var t="",a=null;do t+=X0(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
7
  Error generating stack: `+r.message+`
8
- `+r.stack}}var Ou=Object.prototype.hasOwnProperty,Cp=gt.unstable_scheduleCallback,Wc=gt.unstable_cancelCallback,Z0=gt.unstable_shouldYield,K0=gt.unstable_requestPaint,na=gt.unstable_now,P0=gt.unstable_getCurrentPriorityLevel,Dh=gt.unstable_ImmediatePriority,Oh=gt.unstable_UserBlockingPriority,os=gt.unstable_NormalPriority,J0=gt.unstable_LowPriority,Bh=gt.unstable_IdlePriority,I0=gt.log,F0=gt.unstable_setDisableYieldValue,$o=null,oa=null;function Nr(e){if(typeof I0=="function"&&F0(e),oa&&typeof oa.setStrictMode=="function")try{oa.setStrictMode($o,e)}catch{}}var la=Math.clz32?Math.clz32:ty,W0=Math.log,ey=Math.LN2;function ty(e){return e>>>=0,e===0?32:31-(W0(e)/ey|0)|0}var Nl=256,Cl=262144,ql=4194304;function Wr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Rs(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~n,r!==0?i=Wr(r):(o&=l,o!==0?i=Wr(o):a||(a=l&~e,a!==0&&(i=Wr(a))))):(l=r&~n,l!==0?i=Wr(l):o!==0?i=Wr(o):a||(a=r&~e,a!==0&&(i=Wr(a)))),i===0?0:t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:i}function Vo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ay(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lh(){var e=ql;return ql<<=1,(ql&62914560)===0&&(ql=4194304),e}function eu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Xo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ry(e,t,a,r,i,n){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,p=e.hiddenUpdates;for(a=o&~a;0<a;){var m=31-la(a),g=1<<m;l[m]=0,c[m]=-1;var d=p[m];if(d!==null)for(p[m]=null,m=0;m<d.length;m++){var b=d[m];b!==null&&(b.lane&=-536870913)}a&=~g}r!==0&&Hh(e,r,0),n!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function Hh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-la(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Qh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-la(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function Gh(e,t){var a=t&-t;return a=(a&42)!==0?1:qp(a),(a&(e.suspendedLanes|t))!==0?0:a}function qp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ep(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jh(){var e=Ue.p;return e!==0?e:(e=window.event,e===void 0?32:pv(e.type))}function lf(e,t){var a=Ue.p;try{return Ue.p=e,t()}finally{Ue.p=a}}var Yr=Math.random().toString(36).slice(2),Et="__reactFiber$"+Yr,Pt="__reactProps$"+Yr,_n="__reactContainer$"+Yr,Bu="__reactEvents$"+Yr,iy="__reactListeners$"+Yr,ny="__reactHandles$"+Yr,sf="__reactResources$"+Yr,Zo="__reactMarker$"+Yr;function Mp(e){delete e[Et],delete e[Pt],delete e[Bu],delete e[iy],delete e[ny]}function Xi(e){var t=e[Et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[_n]||a[Et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=gh(e);e!==null;){if(a=e[Et])return a;e=gh(e)}return t}e=a,a=e.parentNode}return null}function xn(e){if(e=e[Et]||e[_n]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Q(33))}function an(e){var t=e[sf];return t||(t=e[sf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[Zo]=!0}var Yh=new Set,$h={};function di(e,t){pn(e,t),pn(e+"Capture",t)}function pn(e,t){for($h[e]=t,e=0;e<t.length;e++)Yh.add(t[e])}var oy=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cf={},uf={};function ly(e){return Ou.call(uf,e)?!0:Ou.call(cf,e)?!1:oy.test(e)?uf[e]=!0:(cf[e]=!0,!1)}function jl(e,t,a){if(ly(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function El(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Ka(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function ma(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sy(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lu(e){if(!e._valueTracker){var t=Vh(e)?"checked":"value";e._valueTracker=sy(e,t,""+e[t])}}function Xh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Vh(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function ls(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var cy=/[\n"\\]/g;function ga(e){return e.replace(cy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hu(e,t,a,r,i,n,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ma(t)):e.value!==""+ma(t)&&(e.value=""+ma(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Qu(e,o,ma(t)):a!=null?Qu(e,o,ma(a)):r!=null&&e.removeAttribute("value"),i==null&&n!=null&&(e.defaultChecked=!!n),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ma(l):e.removeAttribute("name")}function Zh(e,t,a,r,i,n,o,l){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Lu(e);return}a=a!=null?""+ma(a):"",t=t!=null?""+ma(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Lu(e)}function Qu(e,t,a){t==="number"&&ls(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function rn(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+ma(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kh(e,t,a){if(t!=null&&(t=""+ma(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ma(a):""}function Ph(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(Q(92));if(po(r)){if(1<r.length)throw Error(Q(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=ma(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Lu(e)}function dn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var uy=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function pf(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||uy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Jh(e,t,a){if(t!=null&&typeof t!="object")throw Error(Q(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&pf(e,i,r)}else for(var n in t)t.hasOwnProperty(n)&&pf(e,n,t[n])}function Tp(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var py=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yl(e){return dy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ar(){}var Gu=null;function zp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zi=null,nn=null;function df(e){var t=xn(e);if(t&&(e=t.stateNode)){var a=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ga(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var i=r[Pt]||null;if(!i)throw Error(Q(90));Hu(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Xh(r)}break e;case"textarea":Kh(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&rn(e,!!a.multiple,t,!1)}}}var tu=!1;function Ih(e,t,a){if(tu)return e(t,a);tu=!0;try{var r=e(t);return r}finally{if(tu=!1,(Zi!==null||nn!==null)&&($s(),Zi&&(t=Zi,e=nn,nn=Zi=null,df(t),e)))for(t=0;t<e.length;t++)df(e[t])}}function To(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Pt]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(Q(231,t,typeof a));return a}var lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ju=!1;if(lr)try{Hi={},Object.defineProperty(Hi,"passive",{get:function(){ju=!0}}),window.addEventListener("test",Hi,Hi),window.removeEventListener("test",Hi,Hi)}catch{ju=!1}var Hi,Cr=null,Rp=null,$l=null;function Fh(){if($l)return $l;var e,t=Rp,a=t.length,r,i="value"in Cr?Cr.value:Cr.textContent,n=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[n-r];r++);return $l=i.slice(e,1<r?1-r:void 0)}function Vl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ml(){return!0}function mf(){return!1}function Jt(e){function t(a,r,i,n,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Ml:mf,this.isPropagationStopped=mf,this}return Ie(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ml)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},As=Jt(mi),Ko=Ie({},mi,{view:0,detail:0}),my=Jt(Ko),au,ru,io,Us=Ie({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ap,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==io&&(io&&e.type==="mousemove"?(au=e.screenX-io.screenX,ru=e.screenY-io.screenY):ru=au=0,io=e),au)},movementY:function(e){return"movementY"in e?e.movementY:ru}}),ff=Jt(Us),fy=Ie({},Us,{dataTransfer:0}),hy=Jt(fy),gy=Ie({},Ko,{relatedTarget:0}),iu=Jt(gy),by=Ie({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),vy=Jt(by),wy=Ie({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yy=Jt(wy),_y=Ie({},mi,{data:0}),hf=Jt(_y),xy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ky={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ny(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Sy[e])?!!t[e]:!1}function Ap(){return Ny}var Cy=Ie({},Ko,{key:function(e){if(e.key){var t=xy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ky[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ap,charCode:function(e){return e.type==="keypress"?Vl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=Jt(Cy),Ey=Ie({},Us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gf=Jt(Ey),My=Ie({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ap}),Ty=Jt(My),zy=Ie({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ry=Jt(zy),Ay=Ie({},Us,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Uy=Jt(Ay),Dy=Ie({},mi,{newState:0,oldState:0}),Oy=Jt(Dy),By=[9,13,27,32],Up=lr&&"CompositionEvent"in window,go=null;lr&&"documentMode"in document&&(go=document.documentMode);var Ly=lr&&"TextEvent"in window&&!go,Wh=lr&&(!Up||go&&8<go&&11>=go),bf=" ",vf=!1;function eg(e,t){switch(e){case"keyup":return By.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ki=!1;function Hy(e,t){switch(e){case"compositionend":return tg(t);case"keypress":return t.which!==32?null:(vf=!0,bf);case"textInput":return e=t.data,e===bf&&vf?null:e;default:return null}}function Qy(e,t){if(Ki)return e==="compositionend"||!Up&&eg(e,t)?(e=Fh(),$l=Rp=Cr=null,Ki=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wh&&t.locale!=="ko"?null:t.data;default:return null}}var Gy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gy[e.type]:t==="textarea"}function ag(e,t,a,r){Zi?nn?nn.push(r):nn=[r]:Zi=r,t=Ns(t,"onChange"),0<t.length&&(a=new As("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var bo=null,zo=null;function jy(e){Ib(e,0)}function Ds(e){var t=mo(e);if(Xh(t))return e}function yf(e,t){if(e==="change")return t}var rg=!1;lr&&(lr?(zl="oninput"in document,zl||(nu=document.createElement("div"),nu.setAttribute("oninput","return;"),zl=typeof nu.oninput=="function"),Tl=zl):Tl=!1,rg=Tl&&(!document.documentMode||9<document.documentMode));var Tl,zl,nu;function _f(){bo&&(bo.detachEvent("onpropertychange",ig),zo=bo=null)}function ig(e){if(e.propertyName==="value"&&Ds(zo)){var t=[];ag(t,zo,e,zp(e)),Ih(jy,t)}}function Yy(e,t,a){e==="focusin"?(_f(),bo=t,zo=a,bo.attachEvent("onpropertychange",ig)):e==="focusout"&&_f()}function $y(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ds(zo)}function Vy(e,t){if(e==="click")return Ds(t)}function Xy(e,t){if(e==="input"||e==="change")return Ds(t)}function Zy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ca=typeof Object.is=="function"?Object.is:Zy;function Ro(e,t){if(ca(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var i=a[r];if(!Ou.call(t,i)||!ca(e[i],t[i]))return!1}return!0}function xf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kf(e,t){var a=xf(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=xf(a)}}function ng(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ng(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function og(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ls(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ls(e.document)}return t}function Dp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ky=lr&&"documentMode"in document&&11>=document.documentMode,Pi=null,Yu=null,vo=null,$u=!1;function Sf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;$u||Pi==null||Pi!==ls(r)||(r=Pi,"selectionStart"in r&&Dp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),vo&&Ro(vo,r)||(vo=r,r=Ns(Yu,"onSelect"),0<r.length&&(t=new As("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Pi)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ji={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},ou={},lg={};lr&&(lg=document.createElement("div").style,"AnimationEvent"in window||(delete Ji.animationend.animation,delete Ji.animationiteration.animation,delete Ji.animationstart.animation),"TransitionEvent"in window||delete Ji.transitionend.transition);function fi(e){if(ou[e])return ou[e];if(!Ji[e])return e;var t=Ji[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in lg)return ou[e]=t[a];return e}var sg=fi("animationend"),cg=fi("animationiteration"),ug=fi("animationstart"),Py=fi("transitionrun"),Jy=fi("transitionstart"),Iy=fi("transitioncancel"),pg=fi("transitionend"),dg=new Map,Vu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Vu.push("scrollEnd");function Ta(e,t){dg.set(e,t),di(t,[e])}var ss=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},da=[],Ii=0,Op=0;function Os(){for(var e=Ii,t=Op=Ii=0;t<e;){var a=da[t];da[t++]=null;var r=da[t];da[t++]=null;var i=da[t];da[t++]=null;var n=da[t];if(da[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}n!==0&&mg(a,i,n)}}function Bs(e,t,a,r){da[Ii++]=e,da[Ii++]=t,da[Ii++]=a,da[Ii++]=r,Op|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Bp(e,t,a,r){return Bs(e,t,a,r),cs(e)}function hi(e,t){return Bs(e,null,null,t),cs(e)}function mg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,n=e.return;n!==null;)n.childLanes|=a,r=n.alternate,r!==null&&(r.childLanes|=a),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(i=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,i&&t!==null&&(i=31-la(a),e=n.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),n):null}function cs(e){if(50<qo)throw qo=0,dp=null,Error(Q(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Fi={};function Fy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(e,t,a,r){return new Fy(e,t,a,r)}function Lp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ir(e,t){var a=e.alternate;return a===null?(a=ra(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function fg(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Xl(e,t,a,r,i,n){var o=0;if(r=e,typeof e=="function")Lp(e)&&(o=1);else if(typeof e=="string")o=t_(e,a,Ha.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ru:return e=ra(31,a,t,i),e.elementType=Ru,e.lanes=n,e;case $i:return ri(a.children,i,n,t);case Ah:o=8,i|=24;break;case Mu:return e=ra(12,a,t,i|2),e.elementType=Mu,e.lanes=n,e;case Tu:return e=ra(13,a,t,i),e.elementType=Tu,e.lanes=n,e;case zu:return e=ra(19,a,t,i),e.elementType=zu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tr:o=10;break e;case Uh:o=9;break e;case Sp:o=11;break e;case Np:o=14;break e;case wr:o=16,r=null;break e}o=29,a=Error(Q(130,e===null?"null":typeof e,"")),r=null}return t=ra(o,a,t,i),t.elementType=e,t.type=r,t.lanes=n,t}function ri(e,t,a,r){return e=ra(7,e,r,t),e.lanes=a,e}function lu(e,t,a){return e=ra(6,e,null,t),e.lanes=a,e}function hg(e){var t=ra(18,null,null,0);return t.stateNode=e,t}function su(e,t,a){return t=ra(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nf=new WeakMap;function ba(e,t){if(typeof e=="object"&&e!==null){var a=Nf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:of(t)},Nf.set(e,t),t)}return{value:e,source:t,stack:of(t)}}var Wi=[],en=0,us=null,Ao=0,fa=[],ha=0,Hr=null,Oa=1,Ba="";function Wa(e,t){Wi[en++]=Ao,Wi[en++]=us,us=e,Ao=t}function gg(e,t,a){fa[ha++]=Oa,fa[ha++]=Ba,fa[ha++]=Hr,Hr=e;var r=Oa;e=Ba;var i=32-la(r)-1;r&=~(1<<i),a+=1;var n=32-la(t)+i;if(30<n){var o=i-i%5;n=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Oa=1<<32-la(t)+i|a<<i|r,Ba=n+e}else Oa=1<<n|a<<i|r,Ba=e}function Hp(e){e.return!==null&&(Wa(e,1),gg(e,1,0))}function Qp(e){for(;e===us;)us=Wi[--en],Wi[en]=null,Ao=Wi[--en],Wi[en]=null;for(;e===Hr;)Hr=fa[--ha],fa[ha]=null,Ba=fa[--ha],fa[ha]=null,Oa=fa[--ha],fa[ha]=null}function bg(e,t){fa[ha++]=Oa,fa[ha++]=Ba,fa[ha++]=Hr,Oa=t.id,Ba=t.overflow,Hr=e}var Mt=null,Je=null,Ce=!1,zr=null,va=!1,Xu=Error(Q(519));function Qr(e){var t=Error(Q(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(ba(t,e)),Xu}function Cf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Pt]=r,a){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(a=0;a<Lo.length;a++)ye(Lo[a],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),Zh(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("invalid",t),Ph(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Wb(t.textContent,a)?(r.popover!=null&&(ye("beforetoggle",t),ye("toggle",t)),r.onScroll!=null&&ye("scroll",t),r.onScrollEnd!=null&&ye("scrollend",t),r.onClick!=null&&(t.onclick=ar),t=!0):t=!1,t||Qr(e,!0)}function qf(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:Mt=Mt.return}}function Qi(e){if(e!==Mt)return!1;if(!Ce)return qf(e),Ce=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||bp(e.type,e.memoizedProps)),a=!a),a&&Je&&Qr(e),qf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));Je=hh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));Je=hh(e)}else t===27?(t=Je,$r(e.type)?(e=_p,_p=null,Je=e):Je=t):Je=Mt?ya(e.stateNode.nextSibling):null;return!0}function li(){Je=Mt=null,Ce=!1}function cu(){var e=zr;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),zr=null),e}function Uo(e){zr===null?zr=[e]:zr.push(e)}var Zu=Qa(null),gi=null,rr=null;function _r(e,t,a){Xe(Zu,t._currentValue),t._currentValue=a}function nr(e){e._currentValue=Zu.current,kt(Zu)}function Ku(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Pu(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var n=i.dependencies;if(n!==null){var o=i.child;n=n.firstContext;e:for(;n!==null;){var l=n;n=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Ku(n.return,a,e),r||(o=null);break e}n=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(Q(341));o.lanes|=a,n=o.alternate,n!==null&&(n.lanes|=a),Ku(o,a,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function kn(e,t,a,r){e=null;for(var i=t,n=!1;i!==null;){if(!n){if((i.flags&524288)!==0)n=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(Q(387));if(o=o.memoizedProps,o!==null){var l=i.type;ca(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===rs.current){if(o=i.alternate,o===null)throw Error(Q(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Qo):e=[Qo])}i=i.return}e!==null&&Pu(t,e,a,r),t.flags|=262144}function ps(e){for(e=e.firstContext;e!==null;){if(!ca(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function si(e){gi=e,rr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return vg(gi,e)}function Rl(e,t){return gi===null&&si(e),vg(e,t)}function vg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},rr===null){if(e===null)throw Error(Q(308));rr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rr=rr.next=t;return a}var Wy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},e1=gt.unstable_scheduleCallback,t1=gt.unstable_NormalPriority,dt={$$typeof:tr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gp(){return{controller:new Wy,data:new Map,refCount:0}}function Po(e){e.refCount--,e.refCount===0&&e1(t1,function(){e.controller.abort()})}var wo=null,Ju=0,mn=0,on=null;function a1(e,t){if(wo===null){var a=wo=[];Ju=0,mn=dd(),on={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Ju++,t.then(Ef,Ef),t}function Ef(){if(--Ju===0&&wo!==null){on!==null&&(on.status="fulfilled");var e=wo;wo=null,mn=0,on=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function r1(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var Mf=se.S;se.S=function(e,t){Rb=na(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&a1(e,t),Mf!==null&&Mf(e,t)};var ii=Qa(null);function jp(){var e=ii.current;return e!==null?e:$e.pooledCache}function Zl(e,t){t===null?Xe(ii,ii.current):Xe(ii,t.pool)}function wg(){var e=jp();return e===null?null:{parent:dt._currentValue,pool:e}}var Sn=Error(Q(460)),Yp=Error(Q(474)),Ls=Error(Q(542)),ds={then:function(){}};function Tf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ar,ar),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e;default:if(typeof t.status=="string")t.then(ar,ar);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(Q(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e}throw ni=t,Sn}}function ei(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ni=a,Sn):a}}var ni=null;function zf(){if(ni===null)throw Error(Q(459));var e=ni;return ni=null,e}function Rf(e){if(e===Sn||e===Ls)throw Error(Q(483))}var ln=null,Do=0;function Al(e){var t=Do;return Do+=1,ln===null&&(ln=[]),yg(ln,e,t)}function no(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ul(e,t){throw t.$$typeof===Y0?Error(Q(525)):(e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _g(e){function t(f,u){if(e){var h=f.deletions;h===null?(f.deletions=[u],f.flags|=16):h.push(u)}}function a(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function r(f){for(var u=new Map;f!==null;)f.key!==null?u.set(f.key,f):u.set(f.index,f),f=f.sibling;return u}function i(f,u){return f=ir(f,u),f.index=0,f.sibling=null,f}function n(f,u,h){return f.index=h,e?(h=f.alternate,h!==null?(h=h.index,h<u?(f.flags|=67108866,u):h):(f.flags|=67108866,u)):(f.flags|=1048576,u)}function o(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function l(f,u,h,w){return u===null||u.tag!==6?(u=lu(h,f.mode,w),u.return=f,u):(u=i(u,h),u.return=f,u)}function c(f,u,h,w){var S=h.type;return S===$i?m(f,u,h.props.children,w,h.key):u!==null&&(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&ei(S)===u.type)?(u=i(u,h.props),no(u,h),u.return=f,u):(u=Xl(h.type,h.key,h.props,null,f.mode,w),no(u,h),u.return=f,u)}function p(f,u,h,w){return u===null||u.tag!==4||u.stateNode.containerInfo!==h.containerInfo||u.stateNode.implementation!==h.implementation?(u=su(h,f.mode,w),u.return=f,u):(u=i(u,h.children||[]),u.return=f,u)}function m(f,u,h,w,S){return u===null||u.tag!==7?(u=ri(h,f.mode,w,S),u.return=f,u):(u=i(u,h),u.return=f,u)}function g(f,u,h){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=lu(""+u,f.mode,h),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Sl:return h=Xl(u.type,u.key,u.props,null,f.mode,h),no(h,u),h.return=f,h;case uo:return u=su(u,f.mode,h),u.return=f,u;case wr:return u=ei(u),g(f,u,h)}if(po(u)||ro(u))return u=ri(u,f.mode,h,null),u.return=f,u;if(typeof u.then=="function")return g(f,Al(u),h);if(u.$$typeof===tr)return g(f,Rl(f,u),h);Ul(f,u)}return null}function d(f,u,h,w){var S=u!==null?u.key:null;if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return S!==null?null:l(f,u,""+h,w);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Sl:return h.key===S?c(f,u,h,w):null;case uo:return h.key===S?p(f,u,h,w):null;case wr:return h=ei(h),d(f,u,h,w)}if(po(h)||ro(h))return S!==null?null:m(f,u,h,w,null);if(typeof h.then=="function")return d(f,u,Al(h),w);if(h.$$typeof===tr)return d(f,u,Rl(f,h),w);Ul(f,h)}return null}function b(f,u,h,w,S){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return f=f.get(h)||null,l(u,f,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sl:return f=f.get(w.key===null?h:w.key)||null,c(u,f,w,S);case uo:return f=f.get(w.key===null?h:w.key)||null,p(u,f,w,S);case wr:return w=ei(w),b(f,u,h,w,S)}if(po(w)||ro(w))return f=f.get(h)||null,m(u,f,w,S,null);if(typeof w.then=="function")return b(f,u,h,Al(w),S);if(w.$$typeof===tr)return b(f,u,h,Rl(u,w),S);Ul(u,w)}return null}function v(f,u,h,w){for(var S=null,z=null,A=u,U=u=0,R=null;A!==null&&U<h.length;U++){A.index>U?(R=A,A=null):R=A.sibling;var H=d(f,A,h[U],w);if(H===null){A===null&&(A=R);break}e&&A&&H.alternate===null&&t(f,A),u=n(H,u,U),z===null?S=H:z.sibling=H,z=H,A=R}if(U===h.length)return a(f,A),Ce&&Wa(f,U),S;if(A===null){for(;U<h.length;U++)A=g(f,h[U],w),A!==null&&(u=n(A,u,U),z===null?S=A:z.sibling=A,z=A);return Ce&&Wa(f,U),S}for(A=r(A);U<h.length;U++)R=b(A,f,U,h[U],w),R!==null&&(e&&R.alternate!==null&&A.delete(R.key===null?U:R.key),u=n(R,u,U),z===null?S=R:z.sibling=R,z=R);return e&&A.forEach(function(oe){return t(f,oe)}),Ce&&Wa(f,U),S}function E(f,u,h,w){if(h==null)throw Error(Q(151));for(var S=null,z=null,A=u,U=u=0,R=null,H=h.next();A!==null&&!H.done;U++,H=h.next()){A.index>U?(R=A,A=null):R=A.sibling;var oe=d(f,A,H.value,w);if(oe===null){A===null&&(A=R);break}e&&A&&oe.alternate===null&&t(f,A),u=n(oe,u,U),z===null?S=oe:z.sibling=oe,z=oe,A=R}if(H.done)return a(f,A),Ce&&Wa(f,U),S;if(A===null){for(;!H.done;U++,H=h.next())H=g(f,H.value,w),H!==null&&(u=n(H,u,U),z===null?S=H:z.sibling=H,z=H);return Ce&&Wa(f,U),S}for(A=r(A);!H.done;U++,H=h.next())H=b(A,f,U,H.value,w),H!==null&&(e&&H.alternate!==null&&A.delete(H.key===null?U:H.key),u=n(H,u,U),z===null?S=H:z.sibling=H,z=H);return e&&A.forEach(function(Te){return t(f,Te)}),Ce&&Wa(f,U),S}function O(f,u,h,w){if(typeof h=="object"&&h!==null&&h.type===$i&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Sl:e:{for(var S=h.key;u!==null;){if(u.key===S){if(S=h.type,S===$i){if(u.tag===7){a(f,u.sibling),w=i(u,h.props.children),w.return=f,f=w;break e}}else if(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&ei(S)===u.type){a(f,u.sibling),w=i(u,h.props),no(w,h),w.return=f,f=w;break e}a(f,u);break}else t(f,u);u=u.sibling}h.type===$i?(w=ri(h.props.children,f.mode,w,h.key),w.return=f,f=w):(w=Xl(h.type,h.key,h.props,null,f.mode,w),no(w,h),w.return=f,f=w)}return o(f);case uo:e:{for(S=h.key;u!==null;){if(u.key===S)if(u.tag===4&&u.stateNode.containerInfo===h.containerInfo&&u.stateNode.implementation===h.implementation){a(f,u.sibling),w=i(u,h.children||[]),w.return=f,f=w;break e}else{a(f,u);break}else t(f,u);u=u.sibling}w=su(h,f.mode,w),w.return=f,f=w}return o(f);case wr:return h=ei(h),O(f,u,h,w)}if(po(h))return v(f,u,h,w);if(ro(h)){if(S=ro(h),typeof S!="function")throw Error(Q(150));return h=S.call(h),E(f,u,h,w)}if(typeof h.then=="function")return O(f,u,Al(h),w);if(h.$$typeof===tr)return O(f,u,Rl(f,h),w);Ul(f,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,u!==null&&u.tag===6?(a(f,u.sibling),w=i(u,h),w.return=f,f=w):(a(f,u),w=lu(h,f.mode,w),w.return=f,f=w),o(f)):a(f,u)}return function(f,u,h,w){try{Do=0;var S=O(f,u,h,w);return ln=null,S}catch(A){if(A===Sn||A===Ls)throw A;var z=ra(29,A,null,f.mode);return z.lanes=w,z.return=f,z}}}var ci=_g(!0),xg=_g(!1),yr=!1;function $p(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Iu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Rr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ar(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ae&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=cs(e),mg(e,null,a),t}return Bs(e,r,t,a),cs(e)}function yo(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qh(e,a)}}function uu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?i=n=o:n=n.next=o,a=a.next}while(a!==null);n===null?i=n=t:n=n.next=t}else i=n=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:n,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Fu=!1;function _o(){if(Fu){var e=on;if(e!==null)throw e}}function xo(e,t,a,r){Fu=!1;var i=e.updateQueue;yr=!1;var n=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?n=p:o.next=p,o=c;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==o&&(l===null?m.firstBaseUpdate=p:l.next=p,m.lastBaseUpdate=c))}if(n!==null){var g=i.baseState;o=0,m=p=c=null,l=n;do{var d=l.lane&-536870913,b=d!==l.lane;if(b?(Se&d)===d:(r&d)===d){d!==0&&d===mn&&(Fu=!0),m!==null&&(m=m.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var v=e,E=l;d=t;var O=a;switch(E.tag){case 1:if(v=E.payload,typeof v=="function"){g=v.call(O,g,d);break e}g=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=E.payload,d=typeof v=="function"?v.call(O,g,d):v,d==null)break e;g=Ie({},g,d);break e;case 2:yr=!0}}d=l.callback,d!==null&&(e.flags|=64,b&&(e.flags|=8192),b=i.callbacks,b===null?i.callbacks=[d]:b.push(d))}else b={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(p=m=b,c=g):m=m.next=b,o|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);m===null&&(c=g),i.baseState=c,i.firstBaseUpdate=p,i.lastBaseUpdate=m,n===null&&(i.shared.lanes=0),jr|=o,e.lanes=o,e.memoizedState=g}}function kg(e,t){if(typeof e!="function")throw Error(Q(191,e));e.call(t)}function Sg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)kg(a[e],t)}var fn=Qa(null),ms=Qa(0);function Af(e,t){e=pr,Xe(ms,e),Xe(fn,t),pr=e|t.baseLanes}function Wu(){Xe(ms,pr),Xe(fn,fn.current)}function Vp(){pr=ms.current,kt(fn),kt(ms)}var ua=Qa(null),wa=null;function xr(e){var t=e.alternate;Xe(lt,lt.current&1),Xe(ua,e),wa===null&&(t===null||fn.current!==null||t.memoizedState!==null)&&(wa=e)}function ep(e){Xe(lt,lt.current),Xe(ua,e),wa===null&&(wa=e)}function Ng(e){e.tag===22?(Xe(lt,lt.current),Xe(ua,e),wa===null&&(wa=e)):kr(e)}function kr(){Xe(lt,lt.current),Xe(ua,ua.current)}function aa(e){kt(ua),wa===e&&(wa=null),kt(lt)}var lt=Qa(0);function fs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||wp(a)||yp(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sr=0,me=null,Ge=null,ut=null,hs=!1,sn=!1,ui=!1,gs=0,Oo=0,cn=null,i1=0;function it(){throw Error(Q(321))}function Xp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ca(e[a],t[a]))return!1;return!0}function Zp(e,t,a,r,i,n){return sr=n,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,se.H=e===null||e.memoizedState===null?ab:id,ui=!1,n=a(r,i),ui=!1,sn&&(n=qg(t,a,r,i)),Cg(e),n}function Cg(e){se.H=Bo;var t=Ge!==null&&Ge.next!==null;if(sr=0,ut=Ge=me=null,hs=!1,Oo=0,cn=null,t)throw Error(Q(300));e===null||mt||(e=e.dependencies,e!==null&&ps(e)&&(mt=!0))}function qg(e,t,a,r){me=e;var i=0;do{if(sn&&(cn=null),Oo=0,sn=!1,25<=i)throw Error(Q(301));if(i+=1,ut=Ge=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}se.H=rb,n=t(a,r)}while(sn);return n}function n1(){var e=se.H,t=e.useState()[0];return t=typeof t.then=="function"?Jo(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(me.flags|=1024),t}function Kp(){var e=gs!==0;return gs=0,e}function Pp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Jp(e){if(hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hs=!1}sr=0,ut=Ge=me=null,sn=!1,Oo=gs=0,cn=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?me.memoizedState=ut=e:ut=ut.next=e,ut}function st(){if(Ge===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=ut===null?me.memoizedState:ut.next;if(t!==null)ut=t,Ge=e;else{if(e===null)throw me.alternate===null?Error(Q(467)):Error(Q(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},ut===null?me.memoizedState=ut=e:ut=ut.next=e}return ut}function Hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(e){var t=Oo;return Oo+=1,cn===null&&(cn=[]),e=yg(cn,e,t),t=me,(ut===null?t.memoizedState:ut.next)===null&&(t=t.alternate,se.H=t===null||t.memoizedState===null?ab:id),e}function Qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jo(e);if(e.$$typeof===tr)return Tt(e)}throw Error(Q(438,String(e)))}function Ip(e){var t=null,a=me.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=me.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Hs(),me.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=$0;return t.index++,a}function cr(e,t){return typeof t=="function"?t(e):t}function Kl(e){var t=st();return Fp(t,Ge,e)}function Fp(e,t,a){var r=e.queue;if(r===null)throw Error(Q(311));r.lastRenderedReducer=a;var i=e.baseQueue,n=r.pending;if(n!==null){if(i!==null){var o=i.next;i.next=n.next,n.next=o}t.baseQueue=i=n,r.pending=null}if(n=e.baseState,i===null)e.memoizedState=n;else{t=i.next;var l=o=null,c=null,p=t,m=!1;do{var g=p.lane&-536870913;if(g!==p.lane?(Se&g)===g:(sr&g)===g){var d=p.revertLane;if(d===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),g===mn&&(m=!0);else if((sr&d)===d){p=p.next,d===mn&&(m=!0);continue}else g={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=g,o=n):c=c.next=g,me.lanes|=d,jr|=d;g=p.action,ui&&a(n,g),n=p.hasEagerState?p.eagerState:a(n,g)}else d={lane:g,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=d,o=n):c=c.next=d,me.lanes|=g,jr|=g;p=p.next}while(p!==null&&p!==t);if(c===null?o=n:c.next=l,!ca(n,e.memoizedState)&&(mt=!0,m&&(a=on,a!==null)))throw a;e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function pu(e){var t=st(),a=t.queue;if(a===null)throw Error(Q(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,n=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do n=e(n,o.action),o=o.next;while(o!==i);ca(n,t.memoizedState)||(mt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function Eg(e,t,a){var r=me,i=st(),n=Ce;if(n){if(a===void 0)throw Error(Q(407));a=a()}else a=t();var o=!ca((Ge||i).memoizedState,a);if(o&&(i.memoizedState=a,mt=!0),i=i.queue,Wp(zg.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||ut!==null&&ut.memoizedState.tag&1){if(r.flags|=2048,hn(9,{destroy:void 0},Tg.bind(null,r,i,a,t),null),$e===null)throw Error(Q(349));n||(sr&127)!==0||Mg(r,t,a)}return a}function Mg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=me.updateQueue,t===null?(t=Hs(),me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Tg(e,t,a,r){t.value=a,t.getSnapshot=r,Rg(t)&&Ag(e)}function zg(e,t,a){return a(function(){Rg(t)&&Ag(e)})}function Rg(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ca(e,a)}catch{return!0}}function Ag(e){var t=hi(e,2);t!==null&&Kt(t,e,2)}function tp(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),ui){Nr(!0);try{a()}finally{Nr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:e},t}function Ug(e,t,a,r){return e.baseState=a,Fp(e,Ge,typeof r=="function"?r:cr)}function o1(e,t,a,r,i){if(js(e))throw Error(Q(485));if(e=t.action,e!==null){var n={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};se.T!==null?a(!0):n.isTransition=!1,r(n),a=t.pending,a===null?(n.next=t.pending=n,Dg(t,n)):(n.next=a.next,t.pending=a.next=n)}}function Dg(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var n=se.T,o={};se.T=o;try{var l=a(i,r),c=se.S;c!==null&&c(o,l),Uf(e,t,l)}catch(p){ap(e,t,p)}finally{n!==null&&o.types!==null&&(n.types=o.types),se.T=n}}else try{n=a(i,r),Uf(e,t,n)}catch(p){ap(e,t,p)}}function Uf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Df(e,t,r)},function(r){return ap(e,t,r)}):Df(e,t,a)}function Df(e,t,a){t.status="fulfilled",t.value=a,Og(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Dg(e,a)))}function ap(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Og(t),t=t.next;while(t!==r)}e.action=null}function Og(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bg(e,t){return t}function Of(e,t){if(Ce){var a=$e.formState;if(a!==null){e:{var r=me;if(Ce){if(Je){t:{for(var i=Je,n=va;i.nodeType!==8;){if(!n){i=null;break t}if(i=ya(i.nextSibling),i===null){i=null;break t}}n=i.data,i=n==="F!"||n==="F"?i:null}if(i){Je=ya(i.nextSibling),r=i.data==="F!";break e}}Qr(r)}r=!1}r&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bg,lastRenderedState:t},a.queue=r,a=Wg.bind(null,me,r),r.dispatch=a,r=tp(!1),n=rd.bind(null,me,!1,r.queue),r=Ht(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=o1.bind(null,me,i,n,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function Bf(e){var t=st();return Lg(t,Ge,e)}function Lg(e,t,a){if(t=Fp(e,t,Bg)[0],e=Kl(cr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Jo(t)}catch(o){throw o===Sn?Ls:o}else r=t;t=st();var i=t.queue,n=i.dispatch;return a!==t.memoizedState&&(me.flags|=2048,hn(9,{destroy:void 0},l1.bind(null,i,a),null)),[r,n,e]}function l1(e,t){e.action=t}function Lf(e){var t=st(),a=Ge;if(a!==null)return Lg(t,a,e);st(),t=t.memoizedState,a=st();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function hn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=me.updateQueue,t===null&&(t=Hs(),me.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Hg(){return st().memoizedState}function Pl(e,t,a,r){var i=Ht();me.flags|=e,i.memoizedState=hn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Gs(e,t,a,r){var i=st();r=r===void 0?null:r;var n=i.memoizedState.inst;Ge!==null&&r!==null&&Xp(r,Ge.memoizedState.deps)?i.memoizedState=hn(t,n,a,r):(me.flags|=e,i.memoizedState=hn(1|t,n,a,r))}function Hf(e,t){Pl(8390656,8,e,t)}function Wp(e,t){Gs(2048,8,e,t)}function s1(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Hs(),me.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Qg(e){var t=st().memoizedState;return s1({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(Q(440));return t.impl.apply(void 0,arguments)}}function Gg(e,t){return Gs(4,2,e,t)}function jg(e,t){return Gs(4,4,e,t)}function Yg(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $g(e,t,a){a=a!=null?a.concat([e]):null,Gs(4,4,Yg.bind(null,t,e),a)}function ed(){}function Vg(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Xp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Xg(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Xp(t,r[1]))return r[0];if(r=e(),ui){Nr(!0);try{e()}finally{Nr(!1)}}return a.memoizedState=[r,t],r}function td(e,t,a){return a===void 0||(sr&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Ub(),me.lanes|=e,jr|=e,a)}function Zg(e,t,a,r){return ca(a,t)?a:fn.current!==null?(e=td(e,a,r),ca(e,t)||(mt=!0),e):(sr&42)===0||(sr&1073741824)!==0&&(Se&261930)===0?(mt=!0,e.memoizedState=a):(e=Ub(),me.lanes|=e,jr|=e,t)}function Kg(e,t,a,r,i){var n=Ue.p;Ue.p=n!==0&&8>n?n:8;var o=se.T,l={};se.T=l,rd(e,!1,t,a);try{var c=i(),p=se.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var m=r1(c,r);ko(e,t,m,sa(e))}else ko(e,t,r,sa(e))}catch(g){ko(e,t,{then:function(){},status:"rejected",reason:g},sa())}finally{Ue.p=n,o!==null&&l.types!==null&&(o.types=l.types),se.T=o}}function c1(){}function rp(e,t,a,r){if(e.tag!==5)throw Error(Q(476));var i=Pg(e).queue;Kg(e,i,t,ai,a===null?c1:function(){return Jg(e),a(r)})}function Pg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ai,baseState:ai,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:ai},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jg(e){var t=Pg(e);t.next===null&&(t=e.alternate.memoizedState),ko(e,t.next.queue,{},sa())}function ad(){return Tt(Qo)}function Ig(){return st().memoizedState}function Fg(){return st().memoizedState}function u1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=sa();e=Rr(a);var r=Ar(t,e,a);r!==null&&(Kt(r,t,a),yo(r,t,a)),t={cache:Gp()},e.payload=t;return}t=t.return}}function p1(e,t,a){var r=sa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},js(e)?eb(t,a):(a=Bp(e,t,a,r),a!==null&&(Kt(a,e,r),tb(a,t,r)))}function Wg(e,t,a){var r=sa();ko(e,t,a,r)}function ko(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(js(e))eb(t,i);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,a);if(i.hasEagerState=!0,i.eagerState=l,ca(l,o))return Bs(e,t,i,0),$e===null&&Os(),!1}catch{}if(a=Bp(e,t,i,r),a!==null)return Kt(a,e,r),tb(a,t,r),!0}return!1}function rd(e,t,a,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(Q(479))}else t=Bp(e,a,r,2),t!==null&&Kt(t,e,2)}function js(e){var t=e.alternate;return e===me||t!==null&&t===me}function eb(e,t){sn=hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function tb(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qh(e,a)}}var Bo={readContext:Tt,use:Qs,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};Bo.useEffectEvent=it;var ab={readContext:Tt,use:Qs,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Hf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Pl(4194308,4,Yg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Pl(4194308,4,e,t)},useInsertionEffect:function(e,t){Pl(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var r=e();if(ui){Nr(!0);try{e()}finally{Nr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ht();if(a!==void 0){var i=a(t);if(ui){Nr(!0);try{a(t)}finally{Nr(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=p1.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=tp(e);var t=e.queue,a=Wg.bind(null,me,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:ed,useDeferredValue:function(e,t){var a=Ht();return td(a,e,t)},useTransition:function(){var e=tp(!1);return e=Kg.bind(null,me,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=me,i=Ht();if(Ce){if(a===void 0)throw Error(Q(407));a=a()}else{if(a=t(),$e===null)throw Error(Q(349));(Se&127)!==0||Mg(r,t,a)}i.memoizedState=a;var n={value:a,getSnapshot:t};return i.queue=n,Hf(zg.bind(null,r,n,e),[e]),r.flags|=2048,hn(9,{destroy:void 0},Tg.bind(null,r,n,a,t),null),a},useId:function(){var e=Ht(),t=$e.identifierPrefix;if(Ce){var a=Ba,r=Oa;a=(r&~(1<<32-la(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=i1++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ad,useFormState:Of,useActionState:Of,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=rd.bind(null,me,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ip,useCacheRefresh:function(){return Ht().memoizedState=u1.bind(null,me)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((Ae&2)!==0)throw Error(Q(440));return a.impl.apply(void 0,arguments)}}},id={readContext:Tt,use:Qs,useCallback:Vg,useContext:Tt,useEffect:Wp,useImperativeHandle:$g,useInsertionEffect:Gg,useLayoutEffect:jg,useMemo:Xg,useReducer:Kl,useRef:Hg,useState:function(){return Kl(cr)},useDebugValue:ed,useDeferredValue:function(e,t){var a=st();return Zg(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Kl(cr)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Eg,useId:Ig,useHostTransitionStatus:ad,useFormState:Bf,useActionState:Bf,useOptimistic:function(e,t){var a=st();return Ug(a,Ge,e,t)},useMemoCache:Ip,useCacheRefresh:Fg};id.useEffectEvent=Qg;var rb={readContext:Tt,use:Qs,useCallback:Vg,useContext:Tt,useEffect:Wp,useImperativeHandle:$g,useInsertionEffect:Gg,useLayoutEffect:jg,useMemo:Xg,useReducer:pu,useRef:Hg,useState:function(){return pu(cr)},useDebugValue:ed,useDeferredValue:function(e,t){var a=st();return Ge===null?td(a,e,t):Zg(a,Ge.memoizedState,e,t)},useTransition:function(){var e=pu(cr)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Eg,useId:Ig,useHostTransitionStatus:ad,useFormState:Lf,useActionState:Lf,useOptimistic:function(e,t){var a=st();return Ge!==null?Ug(a,Ge,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ip,useCacheRefresh:Fg};rb.useEffectEvent=Qg;function du(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ie({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ip={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=sa(),i=Rr(r);i.payload=t,a!=null&&(i.callback=a),t=Ar(e,i,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=sa(),i=Rr(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Ar(e,i,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=sa(),r=Rr(a);r.tag=2,t!=null&&(r.callback=t),t=Ar(e,r,a),t!==null&&(Kt(t,e,a),yo(t,e,a))}};function Qf(e,t,a,r,i,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,o):t.prototype&&t.prototype.isPureReactComponent?!Ro(a,r)||!Ro(i,n):!0}function Gf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&ip.enqueueReplaceState(t,t.state,null)}function pi(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=Ie({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function ib(e){ss(e)}function nb(e){console.error(e)}function ob(e){ss(e)}function bs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function jf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function np(e,t,a){return a=Rr(a),a.tag=3,a.payload={element:null},a.callback=function(){bs(e,t)},a}function lb(e){return e=Rr(e),e.tag=3,e}function sb(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){jf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){jf(t,a,r),typeof i!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function d1(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&kn(t,a,i,!0),a=ua.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?xs():a.alternate===null&&nt===0&&(nt=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===ds?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),ku(e,r,i)),!1;case 22:return a.flags|=65536,r===ds?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),ku(e,r,i)),!1}throw Error(Q(435,a.tag))}return ku(e,r,i),xs(),!1}if(Ce)return t=ua.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Xu&&(e=Error(Q(422),{cause:r}),Uo(ba(e,a)))):(r!==Xu&&(t=Error(Q(423),{cause:r}),Uo(ba(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ba(r,a),i=np(e.stateNode,r,i),uu(e,i),nt!==4&&(nt=2)),!1;var n=Error(Q(520),{cause:r});if(n=ba(n,a),Co===null?Co=[n]:Co.push(n),nt!==4&&(nt=2),t===null)return!0;r=ba(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=np(a.stateNode,r,e),uu(a,e),!1;case 1:if(t=a.type,n=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Ur===null||!Ur.has(n))))return a.flags|=65536,i&=-i,a.lanes|=i,i=lb(i),sb(i,e,a,r),uu(a,i),!1}a=a.return}while(a!==null);return!1}var nd=Error(Q(461)),mt=!1;function qt(e,t,a,r){t.child=e===null?xg(t,null,a,r):ci(t,e.child,a,r)}function Yf(e,t,a,r,i){a=a.render;var n=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return si(t),r=Zp(e,t,a,o,n,i),l=Kp(),e!==null&&!mt?(Pp(e,t,i),ur(e,t,i)):(Ce&&l&&Hp(t),t.flags|=1,qt(e,t,r,i),t.child)}function $f(e,t,a,r,i){if(e===null){var n=a.type;return typeof n=="function"&&!Lp(n)&&n.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=n,cb(e,t,n,r,i)):(e=Xl(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!od(e,i)){var o=n.memoizedProps;if(a=a.compare,a=a!==null?a:Ro,a(o,r)&&e.ref===t.ref)return ur(e,t,i)}return t.flags|=1,e=ir(n,r),e.ref=t.ref,e.return=t,t.child=e}function cb(e,t,a,r,i){if(e!==null){var n=e.memoizedProps;if(Ro(n,r)&&e.ref===t.ref)if(mt=!1,t.pendingProps=r=n,od(e,i))(e.flags&131072)!==0&&(mt=!0);else return t.lanes=e.lanes,ur(e,t,i)}return op(e,t,a,r,i)}function ub(e,t,a,r){var i=r.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~n}else r=0,t.child=null;return Vf(e,t,n,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(t,n!==null?n.cachePool:null),n!==null?Af(t,n):Wu(),Ng(t);else return r=t.lanes=536870912,Vf(e,t,n!==null?n.baseLanes|a:a,a,r)}else n!==null?(Zl(t,n.cachePool),Af(t,n),kr(t),t.memoizedState=null):(e!==null&&Zl(t,null),Wu(),kr(t));return qt(e,t,i,a),t.child}function fo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vf(e,t,a,r,i){var n=jp();return n=n===null?null:{parent:dt._currentValue,pool:n},t.memoizedState={baseLanes:a,cachePool:n},e!==null&&Zl(t,null),Wu(),Ng(t),e!==null&&kn(e,t,r,!0),t.childLanes=i,null}function Jl(e,t){return t=vs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xf(e,t,a){return ci(t,e.child,null,a),e=Jl(t,t.pendingProps),e.flags|=2,aa(t),t.memoizedState=null,e}function m1(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(r.mode==="hidden")return e=Jl(t,r),t.lanes=536870912,fo(null,e);if(ep(t),(e=Je)?(e=av(e,va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Oa,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=hg(e),a.return=t,t.child=a,Mt=t,Je=null)):e=null,e===null)throw Qr(t);return t.lanes=536870912,null}return Jl(t,r)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(ep(t),i)if(t.flags&256)t.flags&=-257,t=Xf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(Q(558));else if(mt||kn(e,t,a,!1),i=(a&e.childLanes)!==0,mt||i){if(r=$e,r!==null&&(o=Gh(r,a),o!==0&&o!==n.retryLane))throw n.retryLane=o,hi(e,o),Kt(r,e,o),nd;xs(),t=Xf(e,t,a)}else e=n.treeContext,Je=ya(o.nextSibling),Mt=t,Ce=!0,zr=null,va=!1,e!==null&&bg(t,e),t=Jl(t,r),t.flags|=4096;return t}return e=ir(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Il(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(Q(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function op(e,t,a,r,i){return si(t),a=Zp(e,t,a,r,void 0,i),r=Kp(),e!==null&&!mt?(Pp(e,t,i),ur(e,t,i)):(Ce&&r&&Hp(t),t.flags|=1,qt(e,t,a,i),t.child)}function Zf(e,t,a,r,i,n){return si(t),t.updateQueue=null,a=qg(t,r,a,i),Cg(e),r=Kp(),e!==null&&!mt?(Pp(e,t,n),ur(e,t,n)):(Ce&&r&&Hp(t),t.flags|=1,qt(e,t,a,n),t.child)}function Kf(e,t,a,r,i){if(si(t),t.stateNode===null){var n=Fi,o=a.contextType;typeof o=="object"&&o!==null&&(n=Tt(o)),n=new a(r,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ip,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=r,n.state=t.memoizedState,n.refs={},$p(t),o=a.contextType,n.context=typeof o=="object"&&o!==null?Tt(o):Fi,n.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(du(t,a,o,r),n.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&ip.enqueueReplaceState(n,n.state,null),xo(t,r,n,i),_o(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){n=t.stateNode;var l=t.memoizedProps,c=pi(a,l);n.props=c;var p=n.context,m=a.contextType;o=Fi,typeof m=="object"&&m!==null&&(o=Tt(m));var g=a.getDerivedStateFromProps;m=typeof g=="function"||typeof n.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,m||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l||p!==o)&&Gf(t,n,r,o),yr=!1;var d=t.memoizedState;n.state=d,xo(t,r,n,i),_o(),p=t.memoizedState,l||d!==p||yr?(typeof g=="function"&&(du(t,a,g,r),p=t.memoizedState),(c=yr||Qf(t,a,c,r,d,p,o))?(m||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),n.props=r,n.state=p,n.context=o,r=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{n=t.stateNode,Iu(e,t),o=t.memoizedProps,m=pi(a,o),n.props=m,g=t.pendingProps,d=n.context,p=a.contextType,c=Fi,typeof p=="object"&&p!==null&&(c=Tt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==g||d!==c)&&Gf(t,n,r,c),yr=!1,d=t.memoizedState,n.state=d,xo(t,r,n,i),_o();var b=t.memoizedState;o!==g||d!==b||yr||e!==null&&e.dependencies!==null&&ps(e.dependencies)?(typeof l=="function"&&(du(t,a,l,r),b=t.memoizedState),(m=yr||Qf(t,a,m,r,d,b,c)||e!==null&&e.dependencies!==null&&ps(e.dependencies))?(p||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(r,b,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(r,b,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),n.props=r,n.state=b,n.context=c,r=m):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return n=r,Il(e,t),r=(t.flags&128)!==0,n||r?(n=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&r?(t.child=ci(t,e.child,null,i),t.child=ci(t,null,a,i)):qt(e,t,a,i),t.memoizedState=n.state,e=t.child):e=ur(e,t,i),e}function Pf(e,t,a,r){return li(),t.flags|=256,qt(e,t,a,r),t.child}var mu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fu(e){return{baseLanes:e,cachePool:wg()}}function hu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ia),e}function pb(e,t,a){var r=t.pendingProps,i=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ce){if(i?xr(t):kr(t),(e=Je)?(e=av(e,va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Oa,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=hg(e),a.return=t,t.child=a,Mt=t,Je=null)):e=null,e===null)throw Qr(t);return yp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(kr(t),i=t.mode,l=vs({mode:"hidden",children:l},i),r=ri(r,i,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=fu(a),r.childLanes=hu(e,o,a),t.memoizedState=mu,fo(null,r)):(xr(t),lp(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(n)t.flags&256?(xr(t),t.flags&=-257,t=gu(e,t,a)):t.memoizedState!==null?(kr(t),t.child=e.child,t.flags|=128,t=null):(kr(t),l=r.fallback,i=t.mode,r=vs({mode:"visible",children:r.children},i),l=ri(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ci(t,e.child,null,a),r=t.child,r.memoizedState=fu(a),r.childLanes=hu(e,o,a),t.memoizedState=mu,t=fo(null,r));else if(xr(t),yp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(Q(419)),r.stack="",r.digest=o,Uo({value:r,source:null,stack:null}),t=gu(e,t,a)}else if(mt||kn(e,t,a,!1),o=(a&e.childLanes)!==0,mt||o){if(o=$e,o!==null&&(r=Gh(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Kt(o,e,r),nd;wp(l)||xs(),t=gu(e,t,a)}else wp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Je=ya(l.nextSibling),Mt=t,Ce=!0,zr=null,va=!1,e!==null&&bg(t,e),t=lp(t,r.children),t.flags|=4096);return t}return i?(kr(t),l=r.fallback,i=t.mode,c=e.child,p=c.sibling,r=ir(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=ir(p,l):(l=ri(l,i,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,fo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=fu(a):(i=l.cachePool,i!==null?(c=dt._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=wg(),l={baseLanes:l.baseLanes|a,cachePool:i}),r.memoizedState=l,r.childLanes=hu(e,o,a),t.memoizedState=mu,fo(e.child,r)):(xr(t),a=e.child,e=a.sibling,a=ir(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function lp(e,t){return t=vs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vs(e,t){return e=ra(22,e,null,t),e.lanes=0,e}function gu(e,t,a){return ci(t,e.child,null,a),e=lp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ku(e.return,t,a)}function bu(e,t,a,r,i,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=n)}function db(e,t,a){var r=t.pendingProps,i=r.revealOrder,n=r.tail;r=r.children;var o=lt.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Xe(lt,o),qt(e,t,r,a),r=Ce?Ao:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jf(e,a,t);else if(e.tag===19)Jf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&fs(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),bu(t,!1,i,a,n,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fs(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}bu(t,!0,a,null,n,r);break;case"together":bu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function ur(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),jr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(kn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,a=ir(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ir(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function od(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ps(e)))}function f1(e,t,a){switch(t.tag){case 3:is(t,t.stateNode.containerInfo),_r(t,dt,e.memoizedState.cache),li();break;case 27:case 5:Du(t);break;case 4:is(t,t.stateNode.containerInfo);break;case 10:_r(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ep(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(xr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?pb(e,t,a):(xr(t),e=ur(e,t,a),e!==null?e.sibling:null);xr(t);break;case 19:var i=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(kn(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return db(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Xe(lt,lt.current),r)break;return null;case 22:return t.lanes=0,ub(e,t,a,t.pendingProps);case 24:_r(t,dt,e.memoizedState.cache)}return ur(e,t,a)}function mb(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)mt=!0;else{if(!od(e,a)&&(t.flags&128)===0)return mt=!1,f1(e,t,a);mt=(e.flags&131072)!==0}else mt=!1,Ce&&(t.flags&1048576)!==0&&gg(t,Ao,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Lp(e)?(r=pi(e,r),t.tag=1,t=Kf(null,t,e,r,a)):(t.tag=0,t=op(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===Sp){t.tag=11,t=Yf(null,t,e,r,a);break e}else if(i===Np){t.tag=14,t=$f(null,t,e,r,a);break e}}throw t=Au(e)||e,Error(Q(306,t,""))}}return t;case 0:return op(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=pi(r,t.pendingProps),Kf(e,t,r,i,a);case 3:e:{if(is(t,t.stateNode.containerInfo),e===null)throw Error(Q(387));r=t.pendingProps;var n=t.memoizedState;i=n.element,Iu(e,t),xo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,_r(t,dt,r),r!==n.cache&&Pu(t,[dt],a,!0),_o(),r=o.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Pf(e,t,r,a);break e}else if(r!==i){i=ba(Error(Q(424)),t),Uo(i),t=Pf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Je=ya(e.firstChild),Mt=t,Ce=!0,zr=null,va=!0,a=xg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(li(),r===i){t=ur(e,t,a);break e}qt(e,t,r,a)}t=t.child}return t;case 26:return Il(e,t),e===null?(a=vh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ce||(a=t.type,e=t.pendingProps,r=Cs(Tr.current).createElement(a),r[Et]=t,r[Pt]=e,zt(r,a,e),xt(r),t.stateNode=r):t.memoizedState=vh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Du(t),e===null&&Ce&&(r=t.stateNode=rv(t.type,t.pendingProps,Tr.current),Mt=t,va=!0,i=Je,$r(t.type)?(_p=i,Je=ya(r.firstChild)):Je=i),qt(e,t,t.pendingProps.children,a),Il(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((i=r=Je)&&(r=j1(r,t.type,t.pendingProps,va),r!==null?(t.stateNode=r,Mt=t,Je=ya(r.firstChild),va=!1,i=!0):i=!1),i||Qr(t)),Du(t),i=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,r=n.children,bp(i,n)?r=null:o!==null&&bp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Zp(e,t,n1,null,null,a),Qo._currentValue=i),Il(e,t),qt(e,t,r,a),t.child;case 6:return e===null&&Ce&&((e=a=Je)&&(a=Y1(a,t.pendingProps,va),a!==null?(t.stateNode=a,Mt=t,Je=null,e=!0):e=!1),e||Qr(t)),null;case 13:return pb(e,t,a);case 4:return is(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,a):qt(e,t,r,a),t.child;case 11:return Yf(e,t,t.type,t.pendingProps,a);case 7:return qt(e,t,t.pendingProps,a),t.child;case 8:return qt(e,t,t.pendingProps.children,a),t.child;case 12:return qt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,_r(t,t.type,r.value),qt(e,t,r.children,a),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,si(t),i=Tt(i),r=r(i),t.flags|=1,qt(e,t,r,a),t.child;case 14:return $f(e,t,t.type,t.pendingProps,a);case 15:return cb(e,t,t.type,t.pendingProps,a);case 19:return db(e,t,a);case 31:return m1(e,t,a);case 22:return ub(e,t,a,t.pendingProps);case 24:return si(t),r=Tt(dt),e===null?(i=jp(),i===null&&(i=$e,n=Gp(),i.pooledCache=n,n.refCount++,n!==null&&(i.pooledCacheLanes|=a),i=n),t.memoizedState={parent:r,cache:i},$p(t),_r(t,dt,i)):((e.lanes&a)!==0&&(Iu(e,t),xo(t,null,null,a),_o()),i=e.memoizedState,n=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),_r(t,dt,r)):(r=n.cache,_r(t,dt,r),r!==i.cache&&Pu(t,[dt],a,!0))),qt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(Q(156,t.tag))}function Pa(e){e.flags|=4}function vu(e,t,a,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Bb())e.flags|=8192;else throw ni=ds,Yp}else e.flags&=-16777217}function If(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ov(t))if(Bb())e.flags|=8192;else throw ni=ds,Yp}function Dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Lh():536870912,e.lanes|=t,gn|=t)}function oo(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function h1(e,t,a){var r=t.pendingProps;switch(Qp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),nr(dt),un(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Qi(t)?Pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,cu())),Pe(t),null;case 26:var i=t.type,n=t.memoizedState;return e===null?(Pa(t),n!==null?(Pe(t),If(t,n)):(Pe(t),vu(t,i,null,r,a))):n?n!==e.memoizedState?(Pa(t),Pe(t),If(t,n)):(Pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Pa(t),Pe(t),vu(t,i,e,r,a)),null;case 27:if(ns(t),a=Tr.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Pe(t),null}e=Ha.current,Qi(t)?Cf(t,e):(e=rv(i,r,a),t.stateNode=e,Pa(t))}return Pe(t),null;case 5:if(ns(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Pe(t),null}if(n=Ha.current,Qi(t))Cf(t,n);else{var o=Cs(Tr.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?n.multiple=!0:r.size&&(n.size=r.size);break;default:n=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}n[Et]=t,n[Pt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(zt(n,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Pa(t)}}return Pe(t),vu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(e=Tr.current,Qi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Mt,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Et]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Wb(e.nodeValue,a)),e||Qr(t,!0)}else e=Cs(e).createTextNode(r),e[Et]=t,t.stateNode=e}return Pe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Qi(t),a!==null){if(e===null){if(!r)throw Error(Q(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(557));e[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else a=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(aa(t),t):(aa(t),null);if((t.flags&128)!==0)throw Error(Q(558))}return Pe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Q(317));i[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),i=!1}else i=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(aa(t),t):(aa(t),null)}return aa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Dl(t,t.updateQueue),Pe(t),null);case 4:return un(),e===null&&md(t.stateNode.containerInfo),Pe(t),null;case 10:return nr(t.type),Pe(t),null;case 19:if(kt(lt),r=t.memoizedState,r===null)return Pe(t),null;if(i=(t.flags&128)!==0,n=r.rendering,n===null)if(i)oo(r,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=fs(e),n!==null){for(t.flags|=128,oo(r,!1),e=n.updateQueue,t.updateQueue=e,Dl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)fg(a,e),a=a.sibling;return Xe(lt,lt.current&1|2),Ce&&Wa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&na()>ys&&(t.flags|=128,i=!0,oo(r,!1),t.lanes=4194304)}else{if(!i)if(e=fs(n),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Dl(t,e),oo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!n.alternate&&!Ce)return Pe(t),null}else 2*na()-r.renderingStartTime>ys&&a!==536870912&&(t.flags|=128,i=!0,oo(r,!1),t.lanes=4194304);r.isBackwards?(n.sibling=t.child,t.child=n):(e=r.last,e!==null?e.sibling=n:t.child=n,r.last=n)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=na(),e.sibling=null,a=lt.current,Xe(lt,i?a&1|2:a&1),Ce&&Wa(t,r.treeForkCount),e):(Pe(t),null);case 22:case 23:return aa(t),Vp(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),a=t.updateQueue,a!==null&&Dl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&kt(ii),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),nr(dt),Pe(t),null;case 25:return null;case 30:return null}throw Error(Q(156,t.tag))}function g1(e,t){switch(Qp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(dt),un(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ns(t),null;case 31:if(t.memoizedState!==null){if(aa(t),t.alternate===null)throw Error(Q(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(lt),null;case 4:return un(),null;case 10:return nr(t.type),null;case 22:case 23:return aa(t),Vp(),e!==null&&kt(ii),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return nr(dt),null;case 25:return null;default:return null}}function fb(e,t){switch(Qp(t),t.tag){case 3:nr(dt),un();break;case 26:case 27:case 5:ns(t);break;case 4:un();break;case 31:t.memoizedState!==null&&aa(t);break;case 13:aa(t);break;case 19:kt(lt);break;case 10:nr(t.type);break;case 22:case 23:aa(t),Vp(),e!==null&&kt(ii);break;case 24:nr(dt)}}function Io(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var n=a.create,o=a.inst;r=n(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){Be(t,t.return,l)}}function Gr(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var c=a,p=l;try{p()}catch(m){Be(i,c,m)}}}r=r.next}while(r!==n)}}catch(m){Be(t,t.return,m)}}function hb(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Sg(t,a)}catch(r){Be(e,e.return,r)}}}function gb(e,t,a){a.props=pi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Be(e,t,r)}}function So(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(i){Be(e,t,i)}}function La(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){Be(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Be(e,t,i)}else a.current=null}function bb(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(i){Be(e,e.return,i)}}function wu(e,t,a){try{var r=e.stateNode;O1(r,e.type,a,t),r[Pt]=t}catch(i){Be(e,e.return,i)}}function vb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$r(e.type)||e.tag===4}function yu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&$r(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sp(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ar));else if(r!==4&&(r===27&&$r(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(sp(e,t,a),e=e.sibling;e!==null;)sp(e,t,a),e=e.sibling}function ws(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&$r(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ws(e,t,a),e=e.sibling;e!==null;)ws(e,t,a),e=e.sibling}function wb(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,r,a),t[Et]=e,t[Pt]=a}catch(n){Be(e,e.return,n)}}var er=!1,pt=!1,_u=!1,Ff=typeof WeakSet=="function"?WeakSet:Set,_t=null;function b1(e,t){if(e=e.containerInfo,hp=Ts,e=og(e),Dp(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var i=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,m=0,g=e,d=null;t:for(;;){for(var b;g!==a||i!==0&&g.nodeType!==3||(l=o+i),g!==n||r!==0&&g.nodeType!==3||(c=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(b=g.firstChild)!==null;)d=g,g=b;for(;;){if(g===e)break t;if(d===a&&++p===i&&(l=o),d===n&&++m===r&&(c=o),(b=g.nextSibling)!==null)break;g=d,d=g.parentNode}g=b}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(gp={focusedElem:e,selectionRange:a},Ts=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,n=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,a=t,i=n.memoizedProps,n=n.memoizedState,r=a.stateNode;try{var v=pi(a.type,i);e=r.getSnapshotBeforeUpdate(v,n),r.__reactInternalSnapshotBeforeUpdate=e}catch(E){Be(a,a.return,E)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)vp(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(Q(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function yb(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a),r&4&&Io(5,a);break;case 1:if(Ia(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Be(a,a.return,o)}else{var i=pi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Be(a,a.return,o)}}r&64&&hb(a),r&512&&So(a,a.return);break;case 3:if(Ia(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Sg(e,t)}catch(o){Be(a,a.return,o)}}break;case 27:t===null&&r&4&&wb(a);case 26:case 5:Ia(e,a),t===null&&r&4&&bb(a),r&512&&So(a,a.return);break;case 12:Ia(e,a);break;case 31:Ia(e,a),r&4&&kb(e,a);break;case 13:Ia(e,a),r&4&&Sb(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=C1.bind(null,a),$1(e,a))));break;case 22:if(r=a.memoizedState!==null||er,!r){t=t!==null&&t.memoizedState!==null||pt,i=er;var n=pt;er=r,(pt=t)&&!n?Fa(e,a,(a.subtreeFlags&8772)!==0):Ia(e,a),er=i,pt=n}break;case 30:break;default:Ia(e,a)}}function _b(e){var t=e.alternate;t!==null&&(e.alternate=null,_b(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mp(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,Xt=!1;function Ja(e,t,a){for(a=a.child;a!==null;)xb(e,t,a),a=a.sibling}function xb(e,t,a){if(oa&&typeof oa.onCommitFiberUnmount=="function")try{oa.onCommitFiberUnmount($o,a)}catch{}switch(a.tag){case 26:pt||La(a,t),Ja(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:pt||La(a,t);var r=et,i=Xt;$r(a.type)&&(et=a.stateNode,Xt=!1),Ja(e,t,a),Eo(a.stateNode),et=r,Xt=i;break;case 5:pt||La(a,t);case 6:if(r=et,i=Xt,et=null,Ja(e,t,a),et=r,Xt=i,et!==null)if(Xt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(a.stateNode)}catch(n){Be(a,t,n)}else try{et.removeChild(a.stateNode)}catch(n){Be(a,t,n)}break;case 18:et!==null&&(Xt?(e=et,mh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),yn(e)):mh(et,a.stateNode));break;case 4:r=et,i=Xt,et=a.stateNode.containerInfo,Xt=!0,Ja(e,t,a),et=r,Xt=i;break;case 0:case 11:case 14:case 15:Gr(2,a,t),pt||Gr(4,a,t),Ja(e,t,a);break;case 1:pt||(La(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&gb(a,t,r)),Ja(e,t,a);break;case 21:Ja(e,t,a);break;case 22:pt=(r=pt)||a.memoizedState!==null,Ja(e,t,a),pt=r;break;default:Ja(e,t,a)}}function kb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{yn(e)}catch(a){Be(t,t.return,a)}}}function Sb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yn(e)}catch(a){Be(t,t.return,a)}}function v1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ff),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ff),t;default:throw Error(Q(435,e.tag))}}function Ol(e,t){var a=v1(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=q1.bind(null,e,r);r.then(i,i)}})}function $t(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r],n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if($r(l.type)){et=l.stateNode,Xt=!1;break e}break;case 5:et=l.stateNode,Xt=!1;break e;case 3:case 4:et=l.stateNode.containerInfo,Xt=!0;break e}l=l.return}if(et===null)throw Error(Q(160));xb(n,o,i),et=null,Xt=!1,n=i.alternate,n!==null&&(n.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nb(t,e),t=t.sibling}var Ma=null;function Nb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$t(t,e),Vt(e),r&4&&(Gr(3,e,e.return),Io(3,e),Gr(5,e,e.return));break;case 1:$t(t,e),Vt(e),r&512&&(pt||a===null||La(a,a.return)),r&64&&er&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var i=Ma;if($t(t,e),Vt(e),r&512&&(pt||a===null||La(a,a.return)),r&4){var n=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":n=i.getElementsByTagName("title")[0],(!n||n[Zo]||n[Et]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=i.createElement(r),i.head.insertBefore(n,i.querySelector("head > title"))),zt(n,r,a),n[Et]=e,xt(n),r=n;break e;case"link":var o=yh("link","href",i).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(n=o[l],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;case"meta":if(o=yh("meta","content",i).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(n=o[l],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;default:throw Error(Q(468,r))}n[Et]=e,xt(n),r=n}e.stateNode=r}else _h(i,e.type,e.stateNode);else e.stateNode=wh(i,r,e.memoizedProps);else n!==r?(n===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):n.count--,r===null?_h(i,e.type,e.stateNode):wh(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&wu(e,e.memoizedProps,a.memoizedProps)}break;case 27:$t(t,e),Vt(e),r&512&&(pt||a===null||La(a,a.return)),a!==null&&r&4&&wu(e,e.memoizedProps,a.memoizedProps);break;case 5:if($t(t,e),Vt(e),r&512&&(pt||a===null||La(a,a.return)),e.flags&32){i=e.stateNode;try{dn(i,"")}catch(v){Be(e,e.return,v)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,wu(e,i,a!==null?a.memoizedProps:i)),r&1024&&(_u=!0);break;case 6:if($t(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(Q(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(v){Be(e,e.return,v)}}break;case 3:if(es=null,i=Ma,Ma=qs(t.containerInfo),$t(t,e),Ma=i,Vt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{yn(t.containerInfo)}catch(v){Be(e,e.return,v)}_u&&(_u=!1,Cb(e));break;case 4:r=Ma,Ma=qs(e.stateNode.containerInfo),$t(t,e),Vt(e),Ma=r;break;case 12:$t(t,e),Vt(e);break;case 31:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 13:$t(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ys=na()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 22:i=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=er,m=pt;if(er=p||i,pt=m||c,$t(t,e),pt=m,er=p,Vt(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||c||er||pt||ti(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(n=c.stateNode,i)o=n.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var g=c.memoizedProps.style,d=g!=null&&g.hasOwnProperty("display")?g.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(v){Be(c,c.return,v)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(v){Be(c,c.return,v)}}}else if(t.tag===18){if(a===null){c=t;try{var b=c.stateNode;i?fh(b,!0):fh(c.stateNode,!1)}catch(v){Be(c,c.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ol(e,a))));break;case 19:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 30:break;case 21:break;default:$t(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(vb(r)){a=r;break}r=r.return}if(a==null)throw Error(Q(160));switch(a.tag){case 27:var i=a.stateNode,n=yu(e);ws(e,n,i);break;case 5:var o=a.stateNode;a.flags&32&&(dn(o,""),a.flags&=-33);var l=yu(e);ws(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=yu(e);sp(e,p,c);break;default:throw Error(Q(161))}}catch(m){Be(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cb(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yb(e,t.alternate,t),t=t.sibling}function ti(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gr(4,t,t.return),ti(t);break;case 1:La(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&gb(t,t.return,a),ti(t);break;case 27:Eo(t.stateNode);case 26:case 5:La(t,t.return),ti(t);break;case 22:t.memoizedState===null&&ti(t);break;case 30:ti(t);break;default:ti(t)}e=e.sibling}}function Fa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,n=t,o=n.flags;switch(n.tag){case 0:case 11:case 15:Fa(i,n,a),Io(4,n);break;case 1:if(Fa(i,n,a),r=n,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(p){Be(r,r.return,p)}if(r=n,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)kg(c[i],l)}catch(p){Be(r,r.return,p)}}a&&o&64&&hb(n),So(n,n.return);break;case 27:wb(n);case 26:case 5:Fa(i,n,a),a&&r===null&&o&4&&bb(n),So(n,n.return);break;case 12:Fa(i,n,a);break;case 31:Fa(i,n,a),a&&o&4&&kb(i,n);break;case 13:Fa(i,n,a),a&&o&4&&Sb(i,n);break;case 22:n.memoizedState===null&&Fa(i,n,a),So(n,n.return);break;case 30:break;default:Fa(i,n,a)}t=t.sibling}}function ld(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Po(a))}function sd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Po(e))}function Ea(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qb(e,t,a,r),t=t.sibling}function qb(e,t,a,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ea(e,t,a,r),i&2048&&Io(9,t);break;case 1:Ea(e,t,a,r);break;case 3:Ea(e,t,a,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Po(e)));break;case 12:if(i&2048){Ea(e,t,a,r),e=t.stateNode;try{var n=t.memoizedProps,o=n.id,l=n.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Be(t,t.return,c)}}else Ea(e,t,a,r);break;case 31:Ea(e,t,a,r);break;case 13:Ea(e,t,a,r);break;case 23:break;case 22:n=t.stateNode,o=t.alternate,t.memoizedState!==null?n._visibility&2?Ea(e,t,a,r):No(e,t):n._visibility&2?Ea(e,t,a,r):(n._visibility|=2,ji(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&ld(o,t);break;case 24:Ea(e,t,a,r),i&2048&&sd(t.alternate,t);break;default:Ea(e,t,a,r)}}function ji(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:ji(n,o,l,c,i),Io(8,o);break;case 23:break;case 22:var m=o.stateNode;o.memoizedState!==null?m._visibility&2?ji(n,o,l,c,i):No(n,o):(m._visibility|=2,ji(n,o,l,c,i)),i&&p&2048&&ld(o.alternate,o);break;case 24:ji(n,o,l,c,i),i&&p&2048&&sd(o.alternate,o);break;default:ji(n,o,l,c,i)}t=t.sibling}}function No(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:No(a,r),i&2048&&ld(r.alternate,r);break;case 24:No(a,r),i&2048&&sd(r.alternate,r);break;default:No(a,r)}t=t.sibling}}var ho=8192;function Gi(e,t,a){if(e.subtreeFlags&ho)for(e=e.child;e!==null;)Eb(e,t,a),e=e.sibling}function Eb(e,t,a){switch(e.tag){case 26:Gi(e,t,a),e.flags&ho&&e.memoizedState!==null&&a_(a,Ma,e.memoizedState,e.memoizedProps);break;case 5:Gi(e,t,a);break;case 3:case 4:var r=Ma;Ma=qs(e.stateNode.containerInfo),Gi(e,t,a),Ma=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,Gi(e,t,a),ho=r):Gi(e,t,a));break;default:Gi(e,t,a)}}function Mb(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];_t=r,zb(r,e)}Mb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tb(e),e=e.sibling}function Tb(e){switch(e.tag){case 0:case 11:case 15:lo(e),e.flags&2048&&Gr(9,e,e.return);break;case 3:lo(e);break;case 12:lo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):lo(e);break;default:lo(e)}}function Fl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];_t=r,zb(r,e)}Mb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gr(8,t,t.return),Fl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function zb(e,t){for(;_t!==null;){var a=_t;switch(a.tag){case 0:case 11:case 15:Gr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Po(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,_t=r;else e:for(a=e;_t!==null;){r=_t;var i=r.sibling,n=r.return;if(_b(r),r===a){_t=null;break e}if(i!==null){i.return=n,_t=i;break e}_t=n}}}var w1={getCacheForType:function(e){var t=Tt(dt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(dt).controller.signal}},y1=typeof WeakMap=="function"?WeakMap:Map,Ae=0,$e=null,_e=null,Se=0,Oe=0,ta=null,qr=!1,Nn=!1,cd=!1,pr=0,nt=0,jr=0,oi=0,ud=0,ia=0,gn=0,Co=null,Zt=null,cp=!1,Ys=0,Rb=0,ys=1/0,_s=null,Ur=null,ht=0,Dr=null,bn=null,or=0,up=0,pp=null,Ab=null,qo=0,dp=null;function sa(){return(Ae&2)!==0&&Se!==0?Se&-Se:se.T!==null?dd():jh()}function Ub(){if(ia===0)if((Se&536870912)===0||Ce){var e=Cl;Cl<<=1,(Cl&3932160)===0&&(Cl=262144),ia=e}else ia=536870912;return e=ua.current,e!==null&&(e.flags|=32),ia}function Kt(e,t,a){(e===$e&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)&&(vn(e,0),Er(e,Se,ia,!1)),Xo(e,a),((Ae&2)===0||e!==$e)&&(e===$e&&((Ae&2)===0&&(oi|=a),nt===4&&Er(e,Se,ia,!1)),Ga(e))}function Db(e,t,a){if((Ae&6)!==0)throw Error(Q(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Vo(e,t),i=r?k1(e,t):xu(e,t,!0),n=r;do{if(i===0){Nn&&!r&&Er(e,t,0,!1);break}else{if(a=e.current.alternate,n&&!_1(a)){i=xu(e,t,!1),n=!1;continue}if(i===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;i=Co;var c=l.current.memoizedState.isDehydrated;if(c&&(vn(l,o).flags|=256),o=xu(l,o,!1),o!==2){if(cd&&!c){l.errorRecoveryDisabledLanes|=n,oi|=n,i=4;break e}n=Zt,Zt=i,n!==null&&(Zt===null?Zt=n:Zt.push.apply(Zt,n))}i=o}if(n=!1,i!==2)continue}}if(i===1){vn(e,0),Er(e,t,0,!0);break}e:{switch(r=e,n=i,n){case 0:case 1:throw Error(Q(345));case 4:if((t&4194048)!==t)break;case 6:Er(r,t,ia,!qr);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(Q(329))}if((t&62914560)===t&&(i=Ys+300-na(),10<i)){if(Er(r,t,ia,!qr),Rs(r,0,!0)!==0)break e;or=t,r.timeoutHandle=tv(Wf.bind(null,r,a,Zt,_s,cp,t,ia,oi,gn,qr,n,"Throttled",-0,0),i);break e}Wf(r,a,Zt,_s,cp,t,ia,oi,gn,qr,n,null,-0,0)}}break}while(!0);Ga(e)}function Wf(e,t,a,r,i,n,o,l,c,p,m,g,d,b){if(e.timeoutHandle=-1,g=t.subtreeFlags,g&8192||(g&16785408)===16785408){g={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ar},Eb(t,n,g);var v=(n&62914560)===n?Ys-na():(n&4194048)===n?Rb-na():0;if(v=r_(g,v),v!==null){or=n,e.cancelPendingCommit=v(th.bind(null,e,t,n,a,r,i,o,l,c,m,g,null,d,b)),Er(e,n,o,!p);return}}th(e,t,n,a,r,i,o,l,c)}function _1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var i=a[r],n=i.getSnapshot;i=i.value;try{if(!ca(n(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Er(e,t,a,r){t&=~ud,t&=~oi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var n=31-la(i),o=1<<n;r[n]=-1,i&=~o}a!==0&&Hh(e,a,t)}function $s(){return(Ae&6)===0?(Fo(0,!1),!1):!0}function pd(){if(_e!==null){if(Oe===0)var e=_e.return;else e=_e,rr=gi=null,Jp(e),ln=null,Do=0,e=_e;for(;e!==null;)fb(e.alternate,e),e=e.return;_e=null}}function vn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,H1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),or=0,pd(),$e=e,_e=a=ir(e.current,null),Se=t,Oe=0,ta=null,qr=!1,Nn=Vo(e,t),cd=!1,gn=ia=ud=oi=jr=nt=0,Zt=Co=null,cp=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-la(r),n=1<<i;t|=e[i],r&=~n}return pr=t,Os(),a}function Ob(e,t){me=null,se.H=Bo,t===Sn||t===Ls?(t=zf(),Oe=3):t===Yp?(t=zf(),Oe=4):Oe=t===nd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,_e===null&&(nt=1,bs(e,ba(t,e.current)))}function Bb(){var e=ua.current;return e===null?!0:(Se&4194048)===Se?wa===null:(Se&62914560)===Se||(Se&536870912)!==0?e===wa:!1}function Lb(){var e=se.H;return se.H=Bo,e===null?Bo:e}function Hb(){var e=se.A;return se.A=w1,e}function xs(){nt=4,qr||(Se&4194048)!==Se&&ua.current!==null||(Nn=!0),(jr&134217727)===0&&(oi&134217727)===0||$e===null||Er($e,Se,ia,!1)}function xu(e,t,a){var r=Ae;Ae|=2;var i=Lb(),n=Hb();($e!==e||Se!==t)&&(_s=null,vn(e,t)),t=!1;var o=nt;e:do try{if(Oe!==0&&_e!==null){var l=_e,c=ta;switch(Oe){case 8:pd(),o=6;break e;case 3:case 2:case 9:case 6:ua.current===null&&(t=!0);var p=Oe;if(Oe=0,ta=null,tn(e,l,c,p),a&&Nn){o=0;break e}break;default:p=Oe,Oe=0,ta=null,tn(e,l,c,p)}}x1(),o=nt;break}catch(m){Ob(e,m)}while(!0);return t&&e.shellSuspendCounter++,rr=gi=null,Ae=r,se.H=i,se.A=n,_e===null&&($e=null,Se=0,Os()),o}function x1(){for(;_e!==null;)Qb(_e)}function k1(e,t){var a=Ae;Ae|=2;var r=Lb(),i=Hb();$e!==e||Se!==t?(_s=null,ys=na()+500,vn(e,t)):Nn=Vo(e,t);e:do try{if(Oe!==0&&_e!==null){t=_e;var n=ta;t:switch(Oe){case 1:Oe=0,ta=null,tn(e,t,n,1);break;case 2:case 9:if(Tf(n)){Oe=0,ta=null,eh(t);break}t=function(){Oe!==2&&Oe!==9||$e!==e||(Oe=7),Ga(e)},n.then(t,t);break e;case 3:Oe=7;break e;case 4:Oe=5;break e;case 7:Tf(n)?(Oe=0,ta=null,eh(t)):(Oe=0,ta=null,tn(e,t,n,7));break;case 5:var o=null;switch(_e.tag){case 26:o=_e.memoizedState;case 5:case 27:var l=_e;if(o?ov(o):l.stateNode.complete){Oe=0,ta=null;var c=l.sibling;if(c!==null)_e=c;else{var p=l.return;p!==null?(_e=p,Vs(p)):_e=null}break t}}Oe=0,ta=null,tn(e,t,n,5);break;case 6:Oe=0,ta=null,tn(e,t,n,6);break;case 8:pd(),nt=6;break e;default:throw Error(Q(462))}}S1();break}catch(m){Ob(e,m)}while(!0);return rr=gi=null,se.H=r,se.A=i,Ae=a,_e!==null?0:($e=null,Se=0,Os(),nt)}function S1(){for(;_e!==null&&!Z0();)Qb(_e)}function Qb(e){var t=mb(e.alternate,e,pr);e.memoizedProps=e.pendingProps,t===null?Vs(e):_e=t}function eh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Zf(a,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=Zf(a,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Jp(t);default:fb(a,t),t=_e=fg(t,pr),t=mb(a,t,pr)}e.memoizedProps=e.pendingProps,t===null?Vs(e):_e=t}function tn(e,t,a,r){rr=gi=null,Jp(t),ln=null,Do=0;var i=t.return;try{if(d1(e,i,t,a,Se)){nt=1,bs(e,ba(a,e.current)),_e=null;return}}catch(n){if(i!==null)throw _e=i,n;nt=1,bs(e,ba(a,e.current)),_e=null;return}t.flags&32768?(Ce||r===1?e=!0:Nn||(Se&536870912)!==0?e=!1:(qr=e=!0,(r===2||r===9||r===3||r===6)&&(r=ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gb(t,e)):Vs(t)}function Vs(e){var t=e;do{if((t.flags&32768)!==0){Gb(t,qr);return}e=t.return;var a=h1(t.alternate,t,pr);if(a!==null){_e=a;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);nt===0&&(nt=5)}function Gb(e,t){do{var a=g1(e.alternate,e);if(a!==null){a.flags&=32767,_e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=a}while(e!==null);nt=6,_e=null}function th(e,t,a,r,i,n,o,l,c){e.cancelPendingCommit=null;do Xs();while(ht!==0);if((Ae&6)!==0)throw Error(Q(327));if(t!==null){if(t===e.current)throw Error(Q(177));if(n=t.lanes|t.childLanes,n|=Op,ry(e,a,n,o,l,c),e===$e&&(_e=$e=null,Se=0),bn=t,Dr=e,or=a,up=n,pp=i,Ab=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E1(os,function(){return Xb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=se.T,se.T=null,i=Ue.p,Ue.p=2,o=Ae,Ae|=4;try{b1(e,t,a)}finally{Ae=o,Ue.p=i,se.T=r}}ht=1,jb(),Yb(),$b()}}function jb(){if(ht===1){ht=0;var e=Dr,t=bn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=se.T,se.T=null;var r=Ue.p;Ue.p=2;var i=Ae;Ae|=4;try{Nb(t,e);var n=gp,o=og(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&ng(l.ownerDocument.documentElement,l)){if(c!==null&&Dp(l)){var p=c.start,m=c.end;if(m===void 0&&(m=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(m,l.value.length);else{var g=l.ownerDocument||document,d=g&&g.defaultView||window;if(d.getSelection){var b=d.getSelection(),v=l.textContent.length,E=Math.min(c.start,v),O=c.end===void 0?E:Math.min(c.end,v);!b.extend&&E>O&&(o=O,O=E,E=o);var f=kf(l,E),u=kf(l,O);if(f&&u&&(b.rangeCount!==1||b.anchorNode!==f.node||b.anchorOffset!==f.offset||b.focusNode!==u.node||b.focusOffset!==u.offset)){var h=g.createRange();h.setStart(f.node,f.offset),b.removeAllRanges(),E>O?(b.addRange(h),b.extend(u.node,u.offset)):(h.setEnd(u.node,u.offset),b.addRange(h))}}}}for(g=[],b=l;b=b.parentNode;)b.nodeType===1&&g.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<g.length;l++){var w=g[l];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Ts=!!hp,gp=hp=null}finally{Ae=i,Ue.p=r,se.T=a}}e.current=t,ht=2}}function Yb(){if(ht===2){ht=0;var e=Dr,t=bn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=se.T,se.T=null;var r=Ue.p;Ue.p=2;var i=Ae;Ae|=4;try{yb(e,t.alternate,t)}finally{Ae=i,Ue.p=r,se.T=a}}ht=3}}function $b(){if(ht===4||ht===3){ht=0,K0();var e=Dr,t=bn,a=or,r=Ab;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ht=5:(ht=0,bn=Dr=null,Vb(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ur=null),Ep(a),t=t.stateNode,oa&&typeof oa.onCommitFiberRoot=="function")try{oa.onCommitFiberRoot($o,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=se.T,i=Ue.p,Ue.p=2,se.T=null;try{for(var n=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];n(l.value,{componentStack:l.stack})}}finally{se.T=t,Ue.p=i}}(or&3)!==0&&Xs(),Ga(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===dp?qo++:(qo=0,dp=e):qo=0,Fo(0,!1)}}function Vb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Po(t)))}function Xs(){return jb(),Yb(),$b(),Xb()}function Xb(){if(ht!==5)return!1;var e=Dr,t=up;up=0;var a=Ep(or),r=se.T,i=Ue.p;try{Ue.p=32>a?32:a,se.T=null,a=pp,pp=null;var n=Dr,o=or;if(ht=0,bn=Dr=null,or=0,(Ae&6)!==0)throw Error(Q(331));var l=Ae;if(Ae|=4,Tb(n.current),qb(n,n.current,o,a),Ae=l,Fo(0,!1),oa&&typeof oa.onPostCommitFiberRoot=="function")try{oa.onPostCommitFiberRoot($o,n)}catch{}return!0}finally{Ue.p=i,se.T=r,Vb(e,t)}}function ah(e,t,a){t=ba(a,t),t=np(e.stateNode,t,2),e=Ar(e,t,2),e!==null&&(Xo(e,2),Ga(e))}function Be(e,t,a){if(e.tag===3)ah(e,e,a);else for(;t!==null;){if(t.tag===3){ah(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ur===null||!Ur.has(r))){e=ba(a,e),a=lb(2),r=Ar(t,a,2),r!==null&&(sb(a,r,t,e),Xo(r,2),Ga(r));break}}t=t.return}}function ku(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new y1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(cd=!0,i.add(a),e=N1.bind(null,e,t,a),t.then(e,e))}function N1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(Se&a)===a&&(nt===4||nt===3&&(Se&62914560)===Se&&300>na()-Ys?(Ae&2)===0&&vn(e,0):ud|=a,gn===Se&&(gn=0)),Ga(e)}function Zb(e,t){t===0&&(t=Lh()),e=hi(e,t),e!==null&&(Xo(e,t),Ga(e))}function C1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Zb(e,a)}function q1(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(Q(314))}r!==null&&r.delete(t),Zb(e,a)}function E1(e,t){return Cp(e,t)}var ks=null,Yi=null,mp=!1,Ss=!1,Su=!1,Mr=0;function Ga(e){e!==Yi&&e.next===null&&(Yi===null?ks=Yi=e:Yi=Yi.next=e),Ss=!0,mp||(mp=!0,T1())}function Fo(e,t){if(!Su&&Ss){Su=!0;do for(var a=!1,r=ks;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var n=0;else{var o=r.suspendedLanes,l=r.pingedLanes;n=(1<<31-la(42|e)+1)-1,n&=i&~(o&~l),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,rh(r,n))}else n=Se,n=Rs(r,r===$e?n:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(n&3)===0||Vo(r,n)||(a=!0,rh(r,n));r=r.next}while(a);Su=!1}}function M1(){Kb()}function Kb(){Ss=mp=!1;var e=0;Mr!==0&&L1()&&(e=Mr);for(var t=na(),a=null,r=ks;r!==null;){var i=r.next,n=Pb(r,t);n===0?(r.next=null,a===null?ks=i:a.next=i,i===null&&(Yi=a)):(a=r,(e!==0||(n&3)!==0)&&(Ss=!0)),r=i}ht!==0&&ht!==5||Fo(e,!1),Mr!==0&&(Mr=0)}function Pb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-la(n),l=1<<o,c=i[o];c===-1?((l&a)===0||(l&r)!==0)&&(i[o]=ay(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}if(t=$e,a=Se,a=Rs(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Wc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Vo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Wc(r),Ep(a)){case 2:case 8:a=Oh;break;case 32:a=os;break;case 268435456:a=Bh;break;default:a=os}return r=Jb.bind(null,e),a=Cp(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Wc(r),e.callbackPriority=2,e.callbackNode=null,2}function Jb(e,t){if(ht!==0&&ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Xs()&&e.callbackNode!==a)return null;var r=Se;return r=Rs(e,e===$e?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Db(e,r,t),Pb(e,na()),e.callbackNode!=null&&e.callbackNode===a?Jb.bind(null,e):null)}function rh(e,t){if(Xs())return null;Db(e,t,!0)}function T1(){Q1(function(){(Ae&6)!==0?Cp(Dh,M1):Kb()})}function dd(){if(Mr===0){var e=mn;e===0&&(e=Nl,Nl<<=1,(Nl&261888)===0&&(Nl=256)),Mr=e}return Mr}function ih(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yl(""+e)}function nh(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function z1(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var n=ih((i[Pt]||null).action),o=r.submitter;o&&(t=(t=o[Pt]||null)?ih(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var l=new As("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Mr!==0){var c=o?nh(i,o):new FormData(i);rp(a,{pending:!0,data:c,method:i.method,action:n},null,c)}}else typeof n=="function"&&(l.preventDefault(),c=o?nh(i,o):new FormData(i),rp(a,{pending:!0,data:c,method:i.method,action:n},n,c))},currentTarget:i}]})}}for(Bl=0;Bl<Vu.length;Bl++)Ll=Vu[Bl],oh=Ll.toLowerCase(),lh=Ll[0].toUpperCase()+Ll.slice(1),Ta(oh,"on"+lh);var Ll,oh,lh,Bl;Ta(sg,"onAnimationEnd");Ta(cg,"onAnimationIteration");Ta(ug,"onAnimationStart");Ta("dblclick","onDoubleClick");Ta("focusin","onFocus");Ta("focusout","onBlur");Ta(Py,"onTransitionRun");Ta(Jy,"onTransitionStart");Ta(Iy,"onTransitionCancel");Ta(pg,"onTransitionEnd");pn("onMouseEnter",["mouseout","mouseover"]);pn("onMouseLeave",["mouseout","mouseover"]);pn("onPointerEnter",["pointerout","pointerover"]);pn("onPointerLeave",["pointerout","pointerover"]);di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));di("onBeforeInput",["compositionend","keypress","textInput","paste"]);di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),R1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lo));function Ib(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,p=l.currentTarget;if(l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(m){ss(m)}i.currentTarget=null,n=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(m){ss(m)}i.currentTarget=null,n=c}}}}function ye(e,t){var a=t[Bu];a===void 0&&(a=t[Bu]=new Set);var r=e+"__bubble";a.has(r)||(Fb(t,e,2,!1),a.add(r))}function Nu(e,t,a){var r=0;t&&(r|=4),Fb(a,e,r,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function md(e){if(!e[Hl]){e[Hl]=!0,Yh.forEach(function(a){a!=="selectionchange"&&(R1.has(a)||Nu(a,!1,e),Nu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,Nu("selectionchange",!1,t))}}function Fb(e,t,a,r){switch(pv(t)){case 2:var i=o_;break;case 8:i=l_;break;default:i=bd}a=i.bind(null,t,a,e),i=void 0,!ju||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function Cu(e,t,a,r,i){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=Xi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=n=o;continue e}l=l.parentNode}}r=r.return}Ih(function(){var p=n,m=zp(a),g=[];e:{var d=dg.get(e);if(d!==void 0){var b=As,v=e;switch(e){case"keypress":if(Vl(a)===0)break e;case"keydown":case"keyup":b=qy;break;case"focusin":v="focus",b=iu;break;case"focusout":v="blur",b=iu;break;case"beforeblur":case"afterblur":b=iu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=ff;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=hy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=Ty;break;case sg:case cg:case ug:b=vy;break;case pg:b=Ry;break;case"scroll":case"scrollend":b=my;break;case"wheel":b=Uy;break;case"copy":case"cut":case"paste":b=yy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=gf;break;case"toggle":case"beforetoggle":b=Oy}var E=(t&4)!==0,O=!E&&(e==="scroll"||e==="scrollend"),f=E?d!==null?d+"Capture":null:d;E=[];for(var u=p,h;u!==null;){var w=u;if(h=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||h===null||f===null||(w=To(u,f),w!=null&&E.push(Ho(u,w,h))),O)break;u=u.return}0<E.length&&(d=new b(d,v,null,a,m),g.push({event:d,listeners:E}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",d&&a!==Gu&&(v=a.relatedTarget||a.fromElement)&&(Xi(v)||v[_n]))break e;if((b||d)&&(d=m.window===m?m:(d=m.ownerDocument)?d.defaultView||d.parentWindow:window,b?(v=a.relatedTarget||a.toElement,b=p,v=v?Xi(v):null,v!==null&&(O=Yo(v),E=v.tag,v!==O||E!==5&&E!==27&&E!==6)&&(v=null)):(b=null,v=p),b!==v)){if(E=ff,w="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(E=gf,w="onPointerLeave",f="onPointerEnter",u="pointer"),O=b==null?d:mo(b),h=v==null?d:mo(v),d=new E(w,u+"leave",b,a,m),d.target=O,d.relatedTarget=h,w=null,Xi(m)===p&&(E=new E(f,u+"enter",v,a,m),E.target=h,E.relatedTarget=O,w=E),O=w,b&&v)t:{for(E=A1,f=b,u=v,h=0,w=f;w;w=E(w))h++;w=0;for(var S=u;S;S=E(S))w++;for(;0<h-w;)f=E(f),h--;for(;0<w-h;)u=E(u),w--;for(;h--;){if(f===u||u!==null&&f===u.alternate){E=f;break t}f=E(f),u=E(u)}E=null}else E=null;b!==null&&sh(g,d,b,E,!1),v!==null&&O!==null&&sh(g,O,v,E,!0)}}e:{if(d=p?mo(p):window,b=d.nodeName&&d.nodeName.toLowerCase(),b==="select"||b==="input"&&d.type==="file")var z=yf;else if(wf(d))if(rg)z=Xy;else{z=$y;var A=Yy}else b=d.nodeName,!b||b.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?p&&Tp(p.elementType)&&(z=yf):z=Vy;if(z&&(z=z(e,p))){ag(g,z,a,m);break e}A&&A(e,d,p),e==="focusout"&&p&&d.type==="number"&&p.memoizedProps.value!=null&&Qu(d,"number",d.value)}switch(A=p?mo(p):window,e){case"focusin":(wf(A)||A.contentEditable==="true")&&(Pi=A,Yu=p,vo=null);break;case"focusout":vo=Yu=Pi=null;break;case"mousedown":$u=!0;break;case"contextmenu":case"mouseup":case"dragend":$u=!1,Sf(g,a,m);break;case"selectionchange":if(Ky)break;case"keydown":case"keyup":Sf(g,a,m)}var U;if(Up)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Ki?eg(e,a)&&(R="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(R="onCompositionStart");R&&(Wh&&a.locale!=="ko"&&(Ki||R!=="onCompositionStart"?R==="onCompositionEnd"&&Ki&&(U=Fh()):(Cr=m,Rp="value"in Cr?Cr.value:Cr.textContent,Ki=!0)),A=Ns(p,R),0<A.length&&(R=new hf(R,e,null,a,m),g.push({event:R,listeners:A}),U?R.data=U:(U=tg(a),U!==null&&(R.data=U)))),(U=Ly?Hy(e,a):Qy(e,a))&&(R=Ns(p,"onBeforeInput"),0<R.length&&(A=new hf("onBeforeInput","beforeinput",null,a,m),g.push({event:A,listeners:R}),A.data=U)),z1(g,e,p,a,m)}Ib(g,t)})}function Ho(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ns(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,n=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||n===null||(i=To(e,a),i!=null&&r.unshift(Ho(e,i,n)),i=To(e,t),i!=null&&r.push(Ho(e,i,n))),e.tag===3)return r;e=e.return}return[]}function A1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sh(e,t,a,r,i){for(var n=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,p=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||p===null||(c=p,i?(p=To(a,n),p!=null&&o.unshift(Ho(a,p,c))):i||(p=To(a,n),p!=null&&o.push(Ho(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var U1=/\r\n?/g,D1=/\u0000|\uFFFD/g;function ch(e){return(typeof e=="string"?e:""+e).replace(U1,`
9
- `).replace(D1,"")}function Wb(e,t){return t=ch(t),ch(e)===t}function Qe(e,t,a,r,i,n){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||dn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&dn(e,""+r);break;case"className":El(e,"class",r);break;case"tabIndex":El(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":El(e,a,r);break;case"style":Jh(e,r,n);break;case"data":if(t!=="object"){El(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Yl(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(a==="formAction"?(t!=="input"&&Qe(e,t,"name",i.name,i,null),Qe(e,t,"formEncType",i.formEncType,i,null),Qe(e,t,"formMethod",i.formMethod,i,null),Qe(e,t,"formTarget",i.formTarget,i,null)):(Qe(e,t,"encType",i.encType,i,null),Qe(e,t,"method",i.method,i,null),Qe(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Yl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=ar);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Q(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(Q(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Yl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":ye("beforetoggle",e),ye("toggle",e),jl(e,"popover",r);break;case"xlinkActuate":Ka(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ka(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ka(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ka(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ka(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ka(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":jl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=py.get(a)||a,jl(e,a,r))}}function fp(e,t,a,r,i,n){switch(a){case"style":Jh(e,r,n);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Q(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(Q(60));e.innerHTML=a}}break;case"children":typeof r=="string"?dn(e,r):(typeof r=="number"||typeof r=="bigint")&&dn(e,""+r);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ar);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$h.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),n=e[Pt]||null,n=n!=null?n[a]:null,typeof n=="function"&&e.removeEventListener(t,n,i),typeof r=="function")){typeof n!="function"&&n!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,i);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):jl(e,a,r)}}}function zt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("load",e);var r=!1,i=!1,n;for(n in a)if(a.hasOwnProperty(n)){var o=a[n];if(o!=null)switch(n){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Q(137,t));default:Qe(e,t,n,o,a,null)}}i&&Qe(e,t,"srcSet",a.srcSet,a,null),r&&Qe(e,t,"src",a.src,a,null);return;case"input":ye("invalid",e);var l=n=o=i=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var m=a[r];if(m!=null)switch(r){case"name":i=m;break;case"type":o=m;break;case"checked":c=m;break;case"defaultChecked":p=m;break;case"value":n=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(Q(137,t));break;default:Qe(e,t,r,m,a,null)}}Zh(e,n,l,c,p,o,i,!1);return;case"select":ye("invalid",e),r=o=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Qe(e,t,i,l,a,null)}t=n,a=o,e.multiple=!!r,t!=null?rn(e,!!r,t,!1):a!=null&&rn(e,!!r,a,!0);return;case"textarea":ye("invalid",e),n=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Q(91));break;default:Qe(e,t,o,l,a,null)}Ph(e,r,i,n);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Qe(e,t,c,r,a,null));return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(r=0;r<Lo.length;r++)ye(Lo[r],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(p in a)if(a.hasOwnProperty(p)&&(r=a[p],r!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(Q(137,t));default:Qe(e,t,p,r,a,null)}return;default:if(Tp(t)){for(m in a)a.hasOwnProperty(m)&&(r=a[m],r!==void 0&&fp(e,t,m,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&Qe(e,t,l,r,a,null))}function O1(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,n=null,o=null,l=null,c=null,p=null,m=null;for(b in a){var g=a[b];if(a.hasOwnProperty(b)&&g!=null)switch(b){case"checked":break;case"value":break;case"defaultValue":c=g;default:r.hasOwnProperty(b)||Qe(e,t,b,null,r,g)}}for(var d in r){var b=r[d];if(g=a[d],r.hasOwnProperty(d)&&(b!=null||g!=null))switch(d){case"type":n=b;break;case"name":i=b;break;case"checked":p=b;break;case"defaultChecked":m=b;break;case"value":o=b;break;case"defaultValue":l=b;break;case"children":case"dangerouslySetInnerHTML":if(b!=null)throw Error(Q(137,t));break;default:b!==g&&Qe(e,t,d,b,r,g)}}Hu(e,o,l,c,p,m,n,i);return;case"select":b=o=l=d=null;for(n in a)if(c=a[n],a.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":b=c;default:r.hasOwnProperty(n)||Qe(e,t,n,null,r,c)}for(i in r)if(n=r[i],c=a[i],r.hasOwnProperty(i)&&(n!=null||c!=null))switch(i){case"value":d=n;break;case"defaultValue":l=n;break;case"multiple":o=n;default:n!==c&&Qe(e,t,i,n,r,c)}t=l,a=o,r=b,d!=null?rn(e,!!a,d,!1):!!r!=!!a&&(t!=null?rn(e,!!a,t,!0):rn(e,!!a,a?[]:"",!1));return;case"textarea":b=d=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Qe(e,t,l,null,r,i)}for(o in r)if(i=r[o],n=a[o],r.hasOwnProperty(o)&&(i!=null||n!=null))switch(o){case"value":d=i;break;case"defaultValue":b=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(Q(91));break;default:i!==n&&Qe(e,t,o,i,r,n)}Kh(e,d,b);return;case"option":for(var v in a)d=a[v],a.hasOwnProperty(v)&&d!=null&&!r.hasOwnProperty(v)&&(v==="selected"?e.selected=!1:Qe(e,t,v,null,r,d));for(c in r)d=r[c],b=a[c],r.hasOwnProperty(c)&&d!==b&&(d!=null||b!=null)&&(c==="selected"?e.selected=d&&typeof d!="function"&&typeof d!="symbol":Qe(e,t,c,d,r,b));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var E in a)d=a[E],a.hasOwnProperty(E)&&d!=null&&!r.hasOwnProperty(E)&&Qe(e,t,E,null,r,d);for(p in r)if(d=r[p],b=a[p],r.hasOwnProperty(p)&&d!==b&&(d!=null||b!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(Q(137,t));break;default:Qe(e,t,p,d,r,b)}return;default:if(Tp(t)){for(var O in a)d=a[O],a.hasOwnProperty(O)&&d!==void 0&&!r.hasOwnProperty(O)&&fp(e,t,O,void 0,r,d);for(m in r)d=r[m],b=a[m],!r.hasOwnProperty(m)||d===b||d===void 0&&b===void 0||fp(e,t,m,d,r,b);return}}for(var f in a)d=a[f],a.hasOwnProperty(f)&&d!=null&&!r.hasOwnProperty(f)&&Qe(e,t,f,null,r,d);for(g in r)d=r[g],b=a[g],!r.hasOwnProperty(g)||d===b||d==null&&b==null||Qe(e,t,g,d,r,b)}function uh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],n=i.transferSize,o=i.initiatorType,l=i.duration;if(n&&l&&uh(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var m=c.transferSize,g=c.initiatorType;m&&uh(g)&&(c=c.responseEnd,o+=m*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(n+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var hp=null,gp=null;function Cs(e){return e.nodeType===9?e:e.ownerDocument}function ph(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ev(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function bp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qu=null;function L1(){var e=window.event;return e&&e.type==="popstate"?e===qu?!1:(qu=e,!0):(qu=null,!1)}var tv=typeof setTimeout=="function"?setTimeout:void 0,H1=typeof clearTimeout=="function"?clearTimeout:void 0,dh=typeof Promise=="function"?Promise:void 0,Q1=typeof queueMicrotask=="function"?queueMicrotask:typeof dh<"u"?function(e){return dh.resolve(null).then(e).catch(G1)}:tv;function G1(e){setTimeout(function(){throw e})}function $r(e){return e==="head"}function mh(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),yn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Eo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Eo(a);for(var n=a.firstChild;n;){var o=n.nextSibling,l=n.nodeName;n[Zo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&n.rel.toLowerCase()==="stylesheet"||a.removeChild(n),n=o}}else a==="body"&&Eo(e.ownerDocument.body);a=i}while(a);yn(t)}function fh(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function vp(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":vp(a),Mp(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function j1(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Zo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=ya(e.nextSibling),e===null)break}return null}function Y1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ya(e.nextSibling),e===null))return null;return e}function av(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ya(e.nextSibling),e===null))return null;return e}function wp(e){return e.data==="$?"||e.data==="$~"}function yp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ya(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var _p=null;function hh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ya(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function gh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function rv(e,t,a){switch(t=Cs(a),e){case"html":if(e=t.documentElement,!e)throw Error(Q(452));return e;case"head":if(e=t.head,!e)throw Error(Q(453));return e;case"body":if(e=t.body,!e)throw Error(Q(454));return e;default:throw Error(Q(451))}}function Eo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mp(e)}var _a=new Map,bh=new Set;function qs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=Ue.d;Ue.d={f:V1,r:X1,D:Z1,C:K1,L:P1,m:J1,X:F1,S:I1,M:W1};function V1(){var e=dr.f(),t=$s();return e||t}function X1(e){var t=xn(e);t!==null&&t.tag===5&&t.type==="form"?Jg(t):dr.r(e)}var Cn=typeof document>"u"?null:document;function iv(e,t,a){var r=Cn;if(r&&typeof t=="string"&&t){var i=ga(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),bh.has(i)||(bh.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),zt(t,"link",e),xt(t),r.head.appendChild(t)))}}function Z1(e){dr.D(e),iv("dns-prefetch",e,null)}function K1(e,t){dr.C(e,t),iv("preconnect",e,t)}function P1(e,t,a){dr.L(e,t,a);var r=Cn;if(r&&e&&t){var i='link[rel="preload"][as="'+ga(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ga(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ga(a.imageSizes)+'"]')):i+='[href="'+ga(e)+'"]';var n=i;switch(t){case"style":n=wn(e);break;case"script":n=qn(e)}_a.has(n)||(e=Ie({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),_a.set(n,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Wo(n))||t==="script"&&r.querySelector(el(n))||(t=r.createElement("link"),zt(t,"link",e),xt(t),r.head.appendChild(t)))}}function J1(e,t){dr.m(e,t);var a=Cn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ga(r)+'"][href="'+ga(e)+'"]',n=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=qn(e)}if(!_a.has(n)&&(e=Ie({rel:"modulepreload",href:e},t),_a.set(n,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(el(n)))return}r=a.createElement("link"),zt(r,"link",e),xt(r),a.head.appendChild(r)}}}function I1(e,t,a){dr.S(e,t,a);var r=Cn;if(r&&e){var i=an(r).hoistableStyles,n=wn(e);t=t||"default";var o=i.get(n);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Wo(n)))l.loading=5;else{e=Ie({rel:"stylesheet",href:e,"data-precedence":t},a),(a=_a.get(n))&&fd(e,a);var c=o=r.createElement("link");xt(c),zt(c,"link",e),c._p=new Promise(function(p,m){c.onload=p,c.onerror=m}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Wl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(n,o)}}}function F1(e,t){dr.X(e,t);var a=Cn;if(a&&e){var r=an(a).hoistableScripts,i=qn(e),n=r.get(i);n||(n=a.querySelector(el(i)),n||(e=Ie({src:e,async:!0},t),(t=_a.get(i))&&hd(e,t),n=a.createElement("script"),xt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function W1(e,t){dr.M(e,t);var a=Cn;if(a&&e){var r=an(a).hoistableScripts,i=qn(e),n=r.get(i);n||(n=a.querySelector(el(i)),n||(e=Ie({src:e,async:!0,type:"module"},t),(t=_a.get(i))&&hd(e,t),n=a.createElement("script"),xt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function vh(e,t,a,r){var i=(i=Tr.current)?qs(i):null;if(!i)throw Error(Q(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=wn(a.href),a=an(i).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=wn(a.href);var n=an(i).hoistableStyles,o=n.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=i.querySelector(Wo(e)))&&!n._p&&(o.instance=n,o.state.loading=5),_a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_a.set(e,a),n||e_(i,e,a,o.state))),t&&r===null)throw Error(Q(528,""));return o}if(t&&r!==null)throw Error(Q(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=qn(a),a=an(i).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(Q(444,e))}}function wn(e){return'href="'+ga(e)+'"'}function Wo(e){return'link[rel="stylesheet"]['+e+"]"}function nv(e){return Ie({},e,{"data-precedence":e.precedence,precedence:null})}function e_(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),zt(t,"link",a),xt(t),e.head.appendChild(t))}function qn(e){return'[src="'+ga(e)+'"]'}function el(e){return"script[async]"+e}function wh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ga(a.href)+'"]');if(r)return t.instance=r,xt(r),r;var i=Ie({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),xt(r),zt(r,"style",i),Wl(r,a.precedence,e),t.instance=r;case"stylesheet":i=wn(a.href);var n=e.querySelector(Wo(i));if(n)return t.state.loading|=4,t.instance=n,xt(n),n;r=nv(a),(i=_a.get(i))&&fd(r,i),n=(e.ownerDocument||e).createElement("link"),xt(n);var o=n;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),t.state.loading|=4,Wl(n,a.precedence,e),t.instance=n;case"script":return n=qn(a.src),(i=e.querySelector(el(n)))?(t.instance=i,xt(i),i):(r=a,(i=_a.get(n))&&(r=Ie({},a),hd(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),xt(i),zt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(Q(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Wl(r,a.precedence,e));return t.instance}function Wl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,n=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)n=l;else if(n!==i)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function fd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var es=null;function yh(e,t,a){if(es===null){var r=new Map,i=es=new Map;i.set(a,r)}else i=es,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var n=a[i];if(!(n[Zo]||n[Et]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(n):r.set(o,[n])}}return r}function _h(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function t_(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ov(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a_(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=wn(r.href),n=t.querySelector(Wo(i));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Es.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=n,xt(n);return}n=t.ownerDocument||t,r=nv(r),(i=_a.get(i))&&fd(r,i),n=n.createElement("link"),xt(n);var o=n;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),a.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Es.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Eu=0;function r_(e,t){return e.stylesheets&&e.count===0&&ts(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&Eu===0&&(Eu=62500*B1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Eu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ts(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ms=null;function ts(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ms=new Map,t.forEach(i_,e),Ms=null,Es.call(e))}function i_(e,t){if(!(t.state.loading&4)){var a=Ms.get(e);if(a)var r=a.get(null);else{a=new Map,Ms.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<i.length;n++){var o=i[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),n=a.get(o)||r,n===r&&a.set(null,i),a.set(o,i),this.count++,r=Es.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),n?n.parentNode.insertBefore(i,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qo={$$typeof:tr,Provider:null,Consumer:null,_currentValue:ai,_currentValue2:ai,_threadCount:0};function n_(e,t,a,r,i,n,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=eu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eu(0),this.hiddenUpdates=eu(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function lv(e,t,a,r,i,n,o,l,c,p,m,g){return e=new n_(e,t,a,o,c,p,m,g,l),t=1,n===!0&&(t|=24),n=ra(3,null,null,t),e.current=n,n.stateNode=e,t=Gp(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:r,isDehydrated:a,cache:t},$p(n),e}function sv(e){return e?(e=Fi,e):Fi}function cv(e,t,a,r,i,n){i=sv(i),r.context===null?r.context=i:r.pendingContext=i,r=Rr(t),r.payload={element:a},n=n===void 0?null:n,n!==null&&(r.callback=n),a=Ar(e,r,t),a!==null&&(Kt(a,e,t),yo(a,e,t))}function xh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function gd(e,t){xh(e,t),(e=e.alternate)&&xh(e,t)}function uv(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Kt(t,e,67108864),gd(e,67108864)}}function kh(e){if(e.tag===13||e.tag===31){var t=sa();t=qp(t);var a=hi(e,t);a!==null&&Kt(a,e,t),gd(e,t)}}var Ts=!0;function o_(e,t,a,r){var i=se.T;se.T=null;var n=Ue.p;try{Ue.p=2,bd(e,t,a,r)}finally{Ue.p=n,se.T=i}}function l_(e,t,a,r){var i=se.T;se.T=null;var n=Ue.p;try{Ue.p=8,bd(e,t,a,r)}finally{Ue.p=n,se.T=i}}function bd(e,t,a,r){if(Ts){var i=xp(r);if(i===null)Cu(e,t,r,zs,a),Sh(e,r);else if(c_(i,e,t,a,r))r.stopPropagation();else if(Sh(e,r),t&4&&-1<s_.indexOf(e)){for(;i!==null;){var n=xn(i);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=Wr(n.pendingLanes);if(o!==0){var l=n;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-la(o);l.entanglements[1]|=c,o&=~c}Ga(n),(Ae&6)===0&&(ys=na()+500,Fo(0,!1))}}break;case 31:case 13:l=hi(n,2),l!==null&&Kt(l,n,2),$s(),gd(n,2)}if(n=xp(r),n===null&&Cu(e,t,r,zs,a),n===i)break;i=n}i!==null&&r.stopPropagation()}else Cu(e,t,r,null,a)}}function xp(e){return e=zp(e),vd(e)}var zs=null;function vd(e){if(zs=null,e=Xi(e),e!==null){var t=Yo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Th(t),e!==null)return e;e=null}else if(a===31){if(e=zh(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zs=e,null}function pv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(P0()){case Dh:return 2;case Oh:return 8;case os:case J0:return 32;case Bh:return 268435456;default:return 32}default:return 32}}var kp=!1,Or=null,Br=null,Lr=null,Go=new Map,jo=new Map,Sr=[],s_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Sh(e,t){switch(e){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Br=null;break;case"mouseover":case"mouseout":Lr=null;break;case"pointerover":case"pointerout":Go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jo.delete(t.pointerId)}}function so(e,t,a,r,i,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[i]},t!==null&&(t=xn(t),t!==null&&uv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function c_(e,t,a,r,i){switch(t){case"focusin":return Or=so(Or,e,t,a,r,i),!0;case"dragenter":return Br=so(Br,e,t,a,r,i),!0;case"mouseover":return Lr=so(Lr,e,t,a,r,i),!0;case"pointerover":var n=i.pointerId;return Go.set(n,so(Go.get(n)||null,e,t,a,r,i)),!0;case"gotpointercapture":return n=i.pointerId,jo.set(n,so(jo.get(n)||null,e,t,a,r,i)),!0}return!1}function dv(e){var t=Xi(e.target);if(t!==null){var a=Yo(t);if(a!==null){if(t=a.tag,t===13){if(t=Th(a),t!==null){e.blockedOn=t,lf(e.priority,function(){kh(a)});return}}else if(t===31){if(t=zh(a),t!==null){e.blockedOn=t,lf(e.priority,function(){kh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function as(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=xp(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Gu=r,a.target.dispatchEvent(r),Gu=null}else return t=xn(a),t!==null&&uv(t),e.blockedOn=a,!1;t.shift()}return!0}function Nh(e,t,a){as(e)&&a.delete(t)}function u_(){kp=!1,Or!==null&&as(Or)&&(Or=null),Br!==null&&as(Br)&&(Br=null),Lr!==null&&as(Lr)&&(Lr=null),Go.forEach(Nh),jo.forEach(Nh)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,kp||(kp=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,u_)))}var Gl=null;function Ch(e){Gl!==e&&(Gl=e,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,function(){Gl===e&&(Gl=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(vd(r||a)===null)continue;break}var n=xn(a);n!==null&&(e.splice(t,3),t-=3,rp(n,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function yn(e){function t(c){return Ql(c,e)}Or!==null&&Ql(Or,e),Br!==null&&Ql(Br,e),Lr!==null&&Ql(Lr,e),Go.forEach(t),jo.forEach(t);for(var a=0;a<Sr.length;a++){var r=Sr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sr.length&&(a=Sr[0],a.blockedOn===null);)dv(a),a.blockedOn===null&&Sr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],n=a[r+1],o=i[Pt]||null;if(typeof n=="function")o||Ch(a);else if(o){var l=null;if(n&&n.hasAttribute("formAction")){if(i=n,o=n[Pt]||null)l=o.formAction;else if(vd(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),Ch(a)}}}function mv(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function wd(e){this._internalRoot=e}Zs.prototype.render=wd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));var a=t.current,r=sa();cv(a,r,e,t,null,null)};Zs.prototype.unmount=wd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cv(e.current,2,null,e,null,null),$s(),t[_n]=null}};function Zs(e){this._internalRoot=e}Zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=jh();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Sr.length&&t!==0&&t<Sr[a].priority;a++);Sr.splice(a,0,e),a===0&&dv(e)}};var qh=Eh.version;if(qh!=="19.2.3")throw Error(Q(527,qh,"19.2.3"));Ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=j0(t),e=e!==null?Rh(e):null,e=e===null?null:e.stateNode,e};var p_={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(co=__REACT_DEVTOOLS_GLOBAL_HOOK__,!co.isDisabled&&co.supportsFiber))try{$o=co.inject(p_),oa=co}catch{}var co;Ks.createRoot=function(e,t){if(!Mh(e))throw Error(Q(299));var a=!1,r="",i=ib,n=nb,o=ob;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=lv(e,1,!1,null,null,a,r,null,i,n,o,mv),e[_n]=t.current,md(e),new wd(t)};Ks.hydrateRoot=function(e,t,a){if(!Mh(e))throw Error(Q(299));var r=!1,i="",n=ib,o=nb,l=ob,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=lv(e,1,!0,t,a??null,r,i,c,n,o,l,mv),t.context=sv(null),a=t.current,r=sa(),r=qp(r),i=Rr(r),i.callback=null,Ar(a,i,r),a=r,t.current.lanes=a,Xo(t,a),Ga(t),e[_n]=t.current,md(e),new Zs(t)};Ks.version="19.2.3"});var bv=Ua((Px,gv)=>{"use strict";function hv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hv)}catch(e){console.error(e)}}hv(),gv.exports=fv()});var dw=Ua(Fs=>{"use strict";var __=Symbol.for("react.transitional.element"),x_=Symbol.for("react.fragment");function pw(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:__,type:e,key:r,ref:t!==void 0?t:null,props:a}}Fs.Fragment=x_;Fs.jsx=pw;Fs.jsxs=pw});var F=Ua((k2,mw)=>{"use strict";mw.exports=dw()});var u0=$(bv());var vv=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles\r
8
+ `+r.stack}}var Du=Object.prototype.hasOwnProperty,Np=gt.unstable_scheduleCallback,Fc=gt.unstable_cancelCallback,Z0=gt.unstable_shouldYield,K0=gt.unstable_requestPaint,ia=gt.unstable_now,P0=gt.unstable_getCurrentPriorityLevel,Dh=gt.unstable_ImmediatePriority,Oh=gt.unstable_UserBlockingPriority,os=gt.unstable_NormalPriority,J0=gt.unstable_LowPriority,Bh=gt.unstable_IdlePriority,I0=gt.log,F0=gt.unstable_setDisableYieldValue,$o=null,na=null;function Sr(e){if(typeof I0=="function"&&F0(e),na&&typeof na.setStrictMode=="function")try{na.setStrictMode($o,e)}catch{}}var oa=Math.clz32?Math.clz32:ty,W0=Math.log,ey=Math.LN2;function ty(e){return e>>>=0,e===0?32:31-(W0(e)/ey|0)|0}var Nl=256,Cl=262144,ql=4194304;function Wr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Rs(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~n,r!==0?i=Wr(r):(o&=l,o!==0?i=Wr(o):a||(a=l&~e,a!==0&&(i=Wr(a))))):(l=r&~n,l!==0?i=Wr(l):o!==0?i=Wr(o):a||(a=r&~e,a!==0&&(i=Wr(a)))),i===0?0:t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:i}function Vo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ay(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lh(){var e=ql;return ql<<=1,(ql&62914560)===0&&(ql=4194304),e}function Wc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Xo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ry(e,t,a,r,i,n){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,p=e.hiddenUpdates;for(a=o&~a;0<a;){var m=31-oa(a),g=1<<m;l[m]=0,c[m]=-1;var d=p[m];if(d!==null)for(p[m]=null,m=0;m<d.length;m++){var b=d[m];b!==null&&(b.lane&=-536870913)}a&=~g}r!==0&&Hh(e,r,0),n!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function Hh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-oa(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Qh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-oa(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function Gh(e,t){var a=t&-t;return a=(a&42)!==0?1:Cp(a),(a&(e.suspendedLanes|t))!==0?0:a}function Cp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function qp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jh(){var e=Ue.p;return e!==0?e:(e=window.event,e===void 0?32:pw(e.type))}function lf(e,t){var a=Ue.p;try{return Ue.p=e,t()}finally{Ue.p=a}}var jr=Math.random().toString(36).slice(2),Et="__reactFiber$"+jr,Pt="__reactProps$"+jr,yn="__reactContainer$"+jr,Ou="__reactEvents$"+jr,iy="__reactListeners$"+jr,ny="__reactHandles$"+jr,sf="__reactResources$"+jr,Zo="__reactMarker$"+jr;function Ep(e){delete e[Et],delete e[Pt],delete e[Ou],delete e[iy],delete e[ny]}function Vi(e){var t=e[Et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[yn]||a[Et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=gh(e);e!==null;){if(a=e[Et])return a;e=gh(e)}return t}e=a,a=e.parentNode}return null}function _n(e){if(e=e[Et]||e[yn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Q(33))}function tn(e){var t=e[sf];return t||(t=e[sf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[Zo]=!0}var Yh=new Set,$h={};function di(e,t){un(e,t),un(e+"Capture",t)}function un(e,t){for($h[e]=t,e=0;e<t.length;e++)Yh.add(t[e])}var oy=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cf={},uf={};function ly(e){return Du.call(uf,e)?!0:Du.call(cf,e)?!1:oy.test(e)?uf[e]=!0:(cf[e]=!0,!1)}function jl(e,t,a){if(ly(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function El(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Ka(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sy(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bu(e){if(!e._valueTracker){var t=Vh(e)?"checked":"value";e._valueTracker=sy(e,t,""+e[t])}}function Xh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Vh(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function ls(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var cy=/[\n"\\]/g;function ha(e){return e.replace(cy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Lu(e,t,a,r,i,n,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Hu(e,o,da(t)):a!=null?Hu(e,o,da(a)):r!=null&&e.removeAttribute("value"),i==null&&n!=null&&(e.defaultChecked=!!n),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+da(l):e.removeAttribute("name")}function Zh(e,t,a,r,i,n,o,l){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Bu(e);return}a=a!=null?""+da(a):"",t=t!=null?""+da(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Bu(e)}function Hu(e,t,a){t==="number"&&ls(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function an(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+da(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kh(e,t,a){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+da(a):""}function Ph(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(Q(92));if(po(r)){if(1<r.length)throw Error(Q(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=da(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Bu(e)}function pn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var uy=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function pf(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||uy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Jh(e,t,a){if(t!=null&&typeof t!="object")throw Error(Q(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&pf(e,i,r)}else for(var n in t)t.hasOwnProperty(n)&&pf(e,n,t[n])}function Mp(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var py=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yl(e){return dy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ar(){}var Qu=null;function Tp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xi=null,rn=null;function df(e){var t=_n(e);if(t&&(e=t.stateNode)){var a=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Lu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ha(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var i=r[Pt]||null;if(!i)throw Error(Q(90));Lu(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Xh(r)}break e;case"textarea":Kh(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&an(e,!!a.multiple,t,!1)}}}var eu=!1;function Ih(e,t,a){if(eu)return e(t,a);eu=!0;try{var r=e(t);return r}finally{if(eu=!1,(Xi!==null||rn!==null)&&($s(),Xi&&(t=Xi,e=rn,rn=Xi=null,df(t),e)))for(t=0;t<e.length;t++)df(e[t])}}function To(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Pt]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(Q(231,t,typeof a));return a}var lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(lr)try{Li={},Object.defineProperty(Li,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Gu=!1}var Li,Nr=null,zp=null,$l=null;function Fh(){if($l)return $l;var e,t=zp,a=t.length,r,i="value"in Nr?Nr.value:Nr.textContent,n=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[n-r];r++);return $l=i.slice(e,1<r?1-r:void 0)}function Vl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ml(){return!0}function mf(){return!1}function Jt(e){function t(a,r,i,n,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Ml:mf,this.isPropagationStopped=mf,this}return Ie(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ml)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},As=Jt(mi),Ko=Ie({},mi,{view:0,detail:0}),my=Jt(Ko),tu,au,io,Us=Ie({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==io&&(io&&e.type==="mousemove"?(tu=e.screenX-io.screenX,au=e.screenY-io.screenY):au=tu=0,io=e),tu)},movementY:function(e){return"movementY"in e?e.movementY:au}}),ff=Jt(Us),fy=Ie({},Us,{dataTransfer:0}),hy=Jt(fy),gy=Ie({},Ko,{relatedTarget:0}),ru=Jt(gy),by=Ie({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),wy=Jt(by),vy=Ie({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yy=Jt(vy),_y=Ie({},mi,{data:0}),hf=Jt(_y),xy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ky={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ny(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Sy[e])?!!t[e]:!1}function Rp(){return Ny}var Cy=Ie({},Ko,{key:function(e){if(e.key){var t=xy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ky[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rp,charCode:function(e){return e.type==="keypress"?Vl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=Jt(Cy),Ey=Ie({},Us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gf=Jt(Ey),My=Ie({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rp}),Ty=Jt(My),zy=Ie({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ry=Jt(zy),Ay=Ie({},Us,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Uy=Jt(Ay),Dy=Ie({},mi,{newState:0,oldState:0}),Oy=Jt(Dy),By=[9,13,27,32],Ap=lr&&"CompositionEvent"in window,go=null;lr&&"documentMode"in document&&(go=document.documentMode);var Ly=lr&&"TextEvent"in window&&!go,Wh=lr&&(!Ap||go&&8<go&&11>=go),bf=" ",wf=!1;function eg(e,t){switch(e){case"keyup":return By.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zi=!1;function Hy(e,t){switch(e){case"compositionend":return tg(t);case"keypress":return t.which!==32?null:(wf=!0,bf);case"textInput":return e=t.data,e===bf&&wf?null:e;default:return null}}function Qy(e,t){if(Zi)return e==="compositionend"||!Ap&&eg(e,t)?(e=Fh(),$l=zp=Nr=null,Zi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wh&&t.locale!=="ko"?null:t.data;default:return null}}var Gy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function vf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gy[e.type]:t==="textarea"}function ag(e,t,a,r){Xi?rn?rn.push(r):rn=[r]:Xi=r,t=Ns(t,"onChange"),0<t.length&&(a=new As("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var bo=null,zo=null;function jy(e){Ib(e,0)}function Ds(e){var t=mo(e);if(Xh(t))return e}function yf(e,t){if(e==="change")return t}var rg=!1;lr&&(lr?(zl="oninput"in document,zl||(iu=document.createElement("div"),iu.setAttribute("oninput","return;"),zl=typeof iu.oninput=="function"),Tl=zl):Tl=!1,rg=Tl&&(!document.documentMode||9<document.documentMode));var Tl,zl,iu;function _f(){bo&&(bo.detachEvent("onpropertychange",ig),zo=bo=null)}function ig(e){if(e.propertyName==="value"&&Ds(zo)){var t=[];ag(t,zo,e,Tp(e)),Ih(jy,t)}}function Yy(e,t,a){e==="focusin"?(_f(),bo=t,zo=a,bo.attachEvent("onpropertychange",ig)):e==="focusout"&&_f()}function $y(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ds(zo)}function Vy(e,t){if(e==="click")return Ds(t)}function Xy(e,t){if(e==="input"||e==="change")return Ds(t)}function Zy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sa=typeof Object.is=="function"?Object.is:Zy;function Ro(e,t){if(sa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var i=a[r];if(!Du.call(t,i)||!sa(e[i],t[i]))return!1}return!0}function xf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kf(e,t){var a=xf(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=xf(a)}}function ng(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ng(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function og(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ls(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ls(e.document)}return t}function Up(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ky=lr&&"documentMode"in document&&11>=document.documentMode,Ki=null,ju=null,wo=null,Yu=!1;function Sf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Yu||Ki==null||Ki!==ls(r)||(r=Ki,"selectionStart"in r&&Up(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wo&&Ro(wo,r)||(wo=r,r=Ns(ju,"onSelect"),0<r.length&&(t=new As("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Ki)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pi={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},nu={},lg={};lr&&(lg=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function fi(e){if(nu[e])return nu[e];if(!Pi[e])return e;var t=Pi[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in lg)return nu[e]=t[a];return e}var sg=fi("animationend"),cg=fi("animationiteration"),ug=fi("animationstart"),Py=fi("transitionrun"),Jy=fi("transitionstart"),Iy=fi("transitioncancel"),pg=fi("transitionend"),dg=new Map,$u="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$u.push("scrollEnd");function Ma(e,t){dg.set(e,t),di(t,[e])}var ss=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},pa=[],Ji=0,Dp=0;function Os(){for(var e=Ji,t=Dp=Ji=0;t<e;){var a=pa[t];pa[t++]=null;var r=pa[t];pa[t++]=null;var i=pa[t];pa[t++]=null;var n=pa[t];if(pa[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}n!==0&&mg(a,i,n)}}function Bs(e,t,a,r){pa[Ji++]=e,pa[Ji++]=t,pa[Ji++]=a,pa[Ji++]=r,Dp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Op(e,t,a,r){return Bs(e,t,a,r),cs(e)}function hi(e,t){return Bs(e,null,null,t),cs(e)}function mg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,n=e.return;n!==null;)n.childLanes|=a,r=n.alternate,r!==null&&(r.childLanes|=a),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(i=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,i&&t!==null&&(i=31-oa(a),e=n.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),n):null}function cs(e){if(50<qo)throw qo=0,pp=null,Error(Q(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ii={};function Fy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function aa(e,t,a,r){return new Fy(e,t,a,r)}function Bp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ir(e,t){var a=e.alternate;return a===null?(a=aa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function fg(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Xl(e,t,a,r,i,n){var o=0;if(r=e,typeof e=="function")Bp(e)&&(o=1);else if(typeof e=="string")o=t_(e,a,La.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case zu:return e=aa(31,a,t,i),e.elementType=zu,e.lanes=n,e;case Yi:return ri(a.children,i,n,t);case Ah:o=8,i|=24;break;case Eu:return e=aa(12,a,t,i|2),e.elementType=Eu,e.lanes=n,e;case Mu:return e=aa(13,a,t,i),e.elementType=Mu,e.lanes=n,e;case Tu:return e=aa(19,a,t,i),e.elementType=Tu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tr:o=10;break e;case Uh:o=9;break e;case kp:o=11;break e;case Sp:o=14;break e;case wr:o=16,r=null;break e}o=29,a=Error(Q(130,e===null?"null":typeof e,"")),r=null}return t=aa(o,a,t,i),t.elementType=e,t.type=r,t.lanes=n,t}function ri(e,t,a,r){return e=aa(7,e,r,t),e.lanes=a,e}function ou(e,t,a){return e=aa(6,e,null,t),e.lanes=a,e}function hg(e){var t=aa(18,null,null,0);return t.stateNode=e,t}function lu(e,t,a){return t=aa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nf=new WeakMap;function ga(e,t){if(typeof e=="object"&&e!==null){var a=Nf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:of(t)},Nf.set(e,t),t)}return{value:e,source:t,stack:of(t)}}var Fi=[],Wi=0,us=null,Ao=0,ma=[],fa=0,Lr=null,Da=1,Oa="";function Wa(e,t){Fi[Wi++]=Ao,Fi[Wi++]=us,us=e,Ao=t}function gg(e,t,a){ma[fa++]=Da,ma[fa++]=Oa,ma[fa++]=Lr,Lr=e;var r=Da;e=Oa;var i=32-oa(r)-1;r&=~(1<<i),a+=1;var n=32-oa(t)+i;if(30<n){var o=i-i%5;n=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Da=1<<32-oa(t)+i|a<<i|r,Oa=n+e}else Da=1<<n|a<<i|r,Oa=e}function Lp(e){e.return!==null&&(Wa(e,1),gg(e,1,0))}function Hp(e){for(;e===us;)us=Fi[--Wi],Fi[Wi]=null,Ao=Fi[--Wi],Fi[Wi]=null;for(;e===Lr;)Lr=ma[--fa],ma[fa]=null,Oa=ma[--fa],ma[fa]=null,Da=ma[--fa],ma[fa]=null}function bg(e,t){ma[fa++]=Da,ma[fa++]=Oa,ma[fa++]=Lr,Da=t.id,Oa=t.overflow,Lr=e}var Mt=null,Je=null,Ce=!1,Tr=null,ba=!1,Vu=Error(Q(519));function Hr(e){var t=Error(Q(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(ga(t,e)),Vu}function Cf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Pt]=r,a){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(a=0;a<Lo.length;a++)ye(Lo[a],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),Zh(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("invalid",t),Ph(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Wb(t.textContent,a)?(r.popover!=null&&(ye("beforetoggle",t),ye("toggle",t)),r.onScroll!=null&&ye("scroll",t),r.onScrollEnd!=null&&ye("scrollend",t),r.onClick!=null&&(t.onclick=ar),t=!0):t=!1,t||Hr(e,!0)}function qf(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:Mt=Mt.return}}function Hi(e){if(e!==Mt)return!1;if(!Ce)return qf(e),Ce=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||gp(e.type,e.memoizedProps)),a=!a),a&&Je&&Hr(e),qf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));Je=hh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));Je=hh(e)}else t===27?(t=Je,Yr(e.type)?(e=yp,yp=null,Je=e):Je=t):Je=Mt?va(e.stateNode.nextSibling):null;return!0}function li(){Je=Mt=null,Ce=!1}function su(){var e=Tr;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),Tr=null),e}function Uo(e){Tr===null?Tr=[e]:Tr.push(e)}var Xu=Ha(null),gi=null,rr=null;function yr(e,t,a){Xe(Xu,t._currentValue),t._currentValue=a}function nr(e){e._currentValue=Xu.current,kt(Xu)}function Zu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Ku(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var n=i.dependencies;if(n!==null){var o=i.child;n=n.firstContext;e:for(;n!==null;){var l=n;n=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Zu(n.return,a,e),r||(o=null);break e}n=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(Q(341));o.lanes|=a,n=o.alternate,n!==null&&(n.lanes|=a),Zu(o,a,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function xn(e,t,a,r){e=null;for(var i=t,n=!1;i!==null;){if(!n){if((i.flags&524288)!==0)n=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(Q(387));if(o=o.memoizedProps,o!==null){var l=i.type;sa(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===rs.current){if(o=i.alternate,o===null)throw Error(Q(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Qo):e=[Qo])}i=i.return}e!==null&&Ku(t,e,a,r),t.flags|=262144}function ps(e){for(e=e.firstContext;e!==null;){if(!sa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function si(e){gi=e,rr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return wg(gi,e)}function Rl(e,t){return gi===null&&si(e),wg(e,t)}function wg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},rr===null){if(e===null)throw Error(Q(308));rr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rr=rr.next=t;return a}var Wy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},e1=gt.unstable_scheduleCallback,t1=gt.unstable_NormalPriority,ut={$$typeof:tr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qp(){return{controller:new Wy,data:new Map,refCount:0}}function Po(e){e.refCount--,e.refCount===0&&e1(t1,function(){e.controller.abort()})}var vo=null,Pu=0,dn=0,nn=null;function a1(e,t){if(vo===null){var a=vo=[];Pu=0,dn=pd(),nn={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Pu++,t.then(Ef,Ef),t}function Ef(){if(--Pu===0&&vo!==null){nn!==null&&(nn.status="fulfilled");var e=vo;vo=null,dn=0,nn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function r1(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var Mf=se.S;se.S=function(e,t){Rb=ia(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&a1(e,t),Mf!==null&&Mf(e,t)};var ii=Ha(null);function Gp(){var e=ii.current;return e!==null?e:$e.pooledCache}function Zl(e,t){t===null?Xe(ii,ii.current):Xe(ii,t.pool)}function vg(){var e=Gp();return e===null?null:{parent:ut._currentValue,pool:e}}var kn=Error(Q(460)),jp=Error(Q(474)),Ls=Error(Q(542)),ds={then:function(){}};function Tf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ar,ar),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e;default:if(typeof t.status=="string")t.then(ar,ar);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(Q(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e}throw ni=t,kn}}function ei(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ni=a,kn):a}}var ni=null;function zf(){if(ni===null)throw Error(Q(459));var e=ni;return ni=null,e}function Rf(e){if(e===kn||e===Ls)throw Error(Q(483))}var on=null,Do=0;function Al(e){var t=Do;return Do+=1,on===null&&(on=[]),yg(on,e,t)}function no(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ul(e,t){throw t.$$typeof===Y0?Error(Q(525)):(e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _g(e){function t(f,u){if(e){var h=f.deletions;h===null?(f.deletions=[u],f.flags|=16):h.push(u)}}function a(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function r(f){for(var u=new Map;f!==null;)f.key!==null?u.set(f.key,f):u.set(f.index,f),f=f.sibling;return u}function i(f,u){return f=ir(f,u),f.index=0,f.sibling=null,f}function n(f,u,h){return f.index=h,e?(h=f.alternate,h!==null?(h=h.index,h<u?(f.flags|=67108866,u):h):(f.flags|=67108866,u)):(f.flags|=1048576,u)}function o(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function l(f,u,h,w){return u===null||u.tag!==6?(u=ou(h,f.mode,w),u.return=f,u):(u=i(u,h),u.return=f,u)}function c(f,u,h,w){var k=h.type;return k===Yi?m(f,u,h.props.children,w,h.key):u!==null&&(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===wr&&ei(k)===u.type)?(u=i(u,h.props),no(u,h),u.return=f,u):(u=Xl(h.type,h.key,h.props,null,f.mode,w),no(u,h),u.return=f,u)}function p(f,u,h,w){return u===null||u.tag!==4||u.stateNode.containerInfo!==h.containerInfo||u.stateNode.implementation!==h.implementation?(u=lu(h,f.mode,w),u.return=f,u):(u=i(u,h.children||[]),u.return=f,u)}function m(f,u,h,w,k){return u===null||u.tag!==7?(u=ri(h,f.mode,w,k),u.return=f,u):(u=i(u,h),u.return=f,u)}function g(f,u,h){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=ou(""+u,f.mode,h),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Sl:return h=Xl(u.type,u.key,u.props,null,f.mode,h),no(h,u),h.return=f,h;case uo:return u=lu(u,f.mode,h),u.return=f,u;case wr:return u=ei(u),g(f,u,h)}if(po(u)||ro(u))return u=ri(u,f.mode,h,null),u.return=f,u;if(typeof u.then=="function")return g(f,Al(u),h);if(u.$$typeof===tr)return g(f,Rl(f,u),h);Ul(f,u)}return null}function d(f,u,h,w){var k=u!==null?u.key:null;if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return k!==null?null:l(f,u,""+h,w);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Sl:return h.key===k?c(f,u,h,w):null;case uo:return h.key===k?p(f,u,h,w):null;case wr:return h=ei(h),d(f,u,h,w)}if(po(h)||ro(h))return k!==null?null:m(f,u,h,w,null);if(typeof h.then=="function")return d(f,u,Al(h),w);if(h.$$typeof===tr)return d(f,u,Rl(f,h),w);Ul(f,h)}return null}function b(f,u,h,w,k){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return f=f.get(h)||null,l(u,f,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sl:return f=f.get(w.key===null?h:w.key)||null,c(u,f,w,k);case uo:return f=f.get(w.key===null?h:w.key)||null,p(u,f,w,k);case wr:return w=ei(w),b(f,u,h,w,k)}if(po(w)||ro(w))return f=f.get(h)||null,m(u,f,w,k,null);if(typeof w.then=="function")return b(f,u,h,Al(w),k);if(w.$$typeof===tr)return b(f,u,h,Rl(u,w),k);Ul(u,w)}return null}function v(f,u,h,w){for(var k=null,z=null,A=u,U=u=0,R=null;A!==null&&U<h.length;U++){A.index>U?(R=A,A=null):R=A.sibling;var H=d(f,A,h[U],w);if(H===null){A===null&&(A=R);break}e&&A&&H.alternate===null&&t(f,A),u=n(H,u,U),z===null?k=H:z.sibling=H,z=H,A=R}if(U===h.length)return a(f,A),Ce&&Wa(f,U),k;if(A===null){for(;U<h.length;U++)A=g(f,h[U],w),A!==null&&(u=n(A,u,U),z===null?k=A:z.sibling=A,z=A);return Ce&&Wa(f,U),k}for(A=r(A);U<h.length;U++)R=b(A,f,U,h[U],w),R!==null&&(e&&R.alternate!==null&&A.delete(R.key===null?U:R.key),u=n(R,u,U),z===null?k=R:z.sibling=R,z=R);return e&&A.forEach(function(oe){return t(f,oe)}),Ce&&Wa(f,U),k}function E(f,u,h,w){if(h==null)throw Error(Q(151));for(var k=null,z=null,A=u,U=u=0,R=null,H=h.next();A!==null&&!H.done;U++,H=h.next()){A.index>U?(R=A,A=null):R=A.sibling;var oe=d(f,A,H.value,w);if(oe===null){A===null&&(A=R);break}e&&A&&oe.alternate===null&&t(f,A),u=n(oe,u,U),z===null?k=oe:z.sibling=oe,z=oe,A=R}if(H.done)return a(f,A),Ce&&Wa(f,U),k;if(A===null){for(;!H.done;U++,H=h.next())H=g(f,H.value,w),H!==null&&(u=n(H,u,U),z===null?k=H:z.sibling=H,z=H);return Ce&&Wa(f,U),k}for(A=r(A);!H.done;U++,H=h.next())H=b(A,f,U,H.value,w),H!==null&&(e&&H.alternate!==null&&A.delete(H.key===null?U:H.key),u=n(H,u,U),z===null?k=H:z.sibling=H,z=H);return e&&A.forEach(function(Te){return t(f,Te)}),Ce&&Wa(f,U),k}function O(f,u,h,w){if(typeof h=="object"&&h!==null&&h.type===Yi&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Sl:e:{for(var k=h.key;u!==null;){if(u.key===k){if(k=h.type,k===Yi){if(u.tag===7){a(f,u.sibling),w=i(u,h.props.children),w.return=f,f=w;break e}}else if(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===wr&&ei(k)===u.type){a(f,u.sibling),w=i(u,h.props),no(w,h),w.return=f,f=w;break e}a(f,u);break}else t(f,u);u=u.sibling}h.type===Yi?(w=ri(h.props.children,f.mode,w,h.key),w.return=f,f=w):(w=Xl(h.type,h.key,h.props,null,f.mode,w),no(w,h),w.return=f,f=w)}return o(f);case uo:e:{for(k=h.key;u!==null;){if(u.key===k)if(u.tag===4&&u.stateNode.containerInfo===h.containerInfo&&u.stateNode.implementation===h.implementation){a(f,u.sibling),w=i(u,h.children||[]),w.return=f,f=w;break e}else{a(f,u);break}else t(f,u);u=u.sibling}w=lu(h,f.mode,w),w.return=f,f=w}return o(f);case wr:return h=ei(h),O(f,u,h,w)}if(po(h))return v(f,u,h,w);if(ro(h)){if(k=ro(h),typeof k!="function")throw Error(Q(150));return h=k.call(h),E(f,u,h,w)}if(typeof h.then=="function")return O(f,u,Al(h),w);if(h.$$typeof===tr)return O(f,u,Rl(f,h),w);Ul(f,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,u!==null&&u.tag===6?(a(f,u.sibling),w=i(u,h),w.return=f,f=w):(a(f,u),w=ou(h,f.mode,w),w.return=f,f=w),o(f)):a(f,u)}return function(f,u,h,w){try{Do=0;var k=O(f,u,h,w);return on=null,k}catch(A){if(A===kn||A===Ls)throw A;var z=aa(29,A,null,f.mode);return z.lanes=w,z.return=f,z}}}var ci=_g(!0),xg=_g(!1),vr=!1;function Yp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ju(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function zr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ae&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=cs(e),mg(e,null,a),t}return Bs(e,r,t,a),cs(e)}function yo(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qh(e,a)}}function cu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?i=n=o:n=n.next=o,a=a.next}while(a!==null);n===null?i=n=t:n=n.next=t}else i=n=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:n,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Iu=!1;function _o(){if(Iu){var e=nn;if(e!==null)throw e}}function xo(e,t,a,r){Iu=!1;var i=e.updateQueue;vr=!1;var n=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?n=p:o.next=p,o=c;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==o&&(l===null?m.firstBaseUpdate=p:l.next=p,m.lastBaseUpdate=c))}if(n!==null){var g=i.baseState;o=0,m=p=c=null,l=n;do{var d=l.lane&-536870913,b=d!==l.lane;if(b?(Se&d)===d:(r&d)===d){d!==0&&d===dn&&(Iu=!0),m!==null&&(m=m.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var v=e,E=l;d=t;var O=a;switch(E.tag){case 1:if(v=E.payload,typeof v=="function"){g=v.call(O,g,d);break e}g=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=E.payload,d=typeof v=="function"?v.call(O,g,d):v,d==null)break e;g=Ie({},g,d);break e;case 2:vr=!0}}d=l.callback,d!==null&&(e.flags|=64,b&&(e.flags|=8192),b=i.callbacks,b===null?i.callbacks=[d]:b.push(d))}else b={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(p=m=b,c=g):m=m.next=b,o|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);m===null&&(c=g),i.baseState=c,i.firstBaseUpdate=p,i.lastBaseUpdate=m,n===null&&(i.shared.lanes=0),Gr|=o,e.lanes=o,e.memoizedState=g}}function kg(e,t){if(typeof e!="function")throw Error(Q(191,e));e.call(t)}function Sg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)kg(a[e],t)}var mn=Ha(null),ms=Ha(0);function Af(e,t){e=pr,Xe(ms,e),Xe(mn,t),pr=e|t.baseLanes}function Fu(){Xe(ms,pr),Xe(mn,mn.current)}function $p(){pr=ms.current,kt(mn),kt(ms)}var ca=Ha(null),wa=null;function _r(e){var t=e.alternate;Xe(ot,ot.current&1),Xe(ca,e),wa===null&&(t===null||mn.current!==null||t.memoizedState!==null)&&(wa=e)}function Wu(e){Xe(ot,ot.current),Xe(ca,e),wa===null&&(wa=e)}function Ng(e){e.tag===22?(Xe(ot,ot.current),Xe(ca,e),wa===null&&(wa=e)):xr(e)}function xr(){Xe(ot,ot.current),Xe(ca,ca.current)}function ta(e){kt(ca),wa===e&&(wa=null),kt(ot)}var ot=Ha(0);function fs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||wp(a)||vp(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sr=0,me=null,Ge=null,st=null,hs=!1,ln=!1,ui=!1,gs=0,Oo=0,sn=null,i1=0;function rt(){throw Error(Q(321))}function Vp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!sa(e[a],t[a]))return!1;return!0}function Xp(e,t,a,r,i,n){return sr=n,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,se.H=e===null||e.memoizedState===null?ab:rd,ui=!1,n=a(r,i),ui=!1,ln&&(n=qg(t,a,r,i)),Cg(e),n}function Cg(e){se.H=Bo;var t=Ge!==null&&Ge.next!==null;if(sr=0,st=Ge=me=null,hs=!1,Oo=0,sn=null,t)throw Error(Q(300));e===null||pt||(e=e.dependencies,e!==null&&ps(e)&&(pt=!0))}function qg(e,t,a,r){me=e;var i=0;do{if(ln&&(sn=null),Oo=0,ln=!1,25<=i)throw Error(Q(301));if(i+=1,st=Ge=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}se.H=rb,n=t(a,r)}while(ln);return n}function n1(){var e=se.H,t=e.useState()[0];return t=typeof t.then=="function"?Jo(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(me.flags|=1024),t}function Zp(){var e=gs!==0;return gs=0,e}function Kp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Pp(e){if(hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hs=!1}sr=0,st=Ge=me=null,ln=!1,Oo=gs=0,sn=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?me.memoizedState=st=e:st=st.next=e,st}function lt(){if(Ge===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=st===null?me.memoizedState:st.next;if(t!==null)st=t,Ge=e;else{if(e===null)throw me.alternate===null?Error(Q(467)):Error(Q(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},st===null?me.memoizedState=st=e:st=st.next=e}return st}function Hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(e){var t=Oo;return Oo+=1,sn===null&&(sn=[]),e=yg(sn,e,t),t=me,(st===null?t.memoizedState:st.next)===null&&(t=t.alternate,se.H=t===null||t.memoizedState===null?ab:rd),e}function Qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jo(e);if(e.$$typeof===tr)return Tt(e)}throw Error(Q(438,String(e)))}function Jp(e){var t=null,a=me.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=me.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Hs(),me.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=$0;return t.index++,a}function cr(e,t){return typeof t=="function"?t(e):t}function Kl(e){var t=lt();return Ip(t,Ge,e)}function Ip(e,t,a){var r=e.queue;if(r===null)throw Error(Q(311));r.lastRenderedReducer=a;var i=e.baseQueue,n=r.pending;if(n!==null){if(i!==null){var o=i.next;i.next=n.next,n.next=o}t.baseQueue=i=n,r.pending=null}if(n=e.baseState,i===null)e.memoizedState=n;else{t=i.next;var l=o=null,c=null,p=t,m=!1;do{var g=p.lane&-536870913;if(g!==p.lane?(Se&g)===g:(sr&g)===g){var d=p.revertLane;if(d===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),g===dn&&(m=!0);else if((sr&d)===d){p=p.next,d===dn&&(m=!0);continue}else g={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=g,o=n):c=c.next=g,me.lanes|=d,Gr|=d;g=p.action,ui&&a(n,g),n=p.hasEagerState?p.eagerState:a(n,g)}else d={lane:g,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=d,o=n):c=c.next=d,me.lanes|=g,Gr|=g;p=p.next}while(p!==null&&p!==t);if(c===null?o=n:c.next=l,!sa(n,e.memoizedState)&&(pt=!0,m&&(a=nn,a!==null)))throw a;e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function uu(e){var t=lt(),a=t.queue;if(a===null)throw Error(Q(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,n=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do n=e(n,o.action),o=o.next;while(o!==i);sa(n,t.memoizedState)||(pt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function Eg(e,t,a){var r=me,i=lt(),n=Ce;if(n){if(a===void 0)throw Error(Q(407));a=a()}else a=t();var o=!sa((Ge||i).memoizedState,a);if(o&&(i.memoizedState=a,pt=!0),i=i.queue,Fp(zg.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||st!==null&&st.memoizedState.tag&1){if(r.flags|=2048,fn(9,{destroy:void 0},Tg.bind(null,r,i,a,t),null),$e===null)throw Error(Q(349));n||(sr&127)!==0||Mg(r,t,a)}return a}function Mg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=me.updateQueue,t===null?(t=Hs(),me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Tg(e,t,a,r){t.value=a,t.getSnapshot=r,Rg(t)&&Ag(e)}function zg(e,t,a){return a(function(){Rg(t)&&Ag(e)})}function Rg(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!sa(e,a)}catch{return!0}}function Ag(e){var t=hi(e,2);t!==null&&Kt(t,e,2)}function ep(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),ui){Sr(!0);try{a()}finally{Sr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:e},t}function Ug(e,t,a,r){return e.baseState=a,Ip(e,Ge,typeof r=="function"?r:cr)}function o1(e,t,a,r,i){if(js(e))throw Error(Q(485));if(e=t.action,e!==null){var n={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};se.T!==null?a(!0):n.isTransition=!1,r(n),a=t.pending,a===null?(n.next=t.pending=n,Dg(t,n)):(n.next=a.next,t.pending=a.next=n)}}function Dg(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var n=se.T,o={};se.T=o;try{var l=a(i,r),c=se.S;c!==null&&c(o,l),Uf(e,t,l)}catch(p){tp(e,t,p)}finally{n!==null&&o.types!==null&&(n.types=o.types),se.T=n}}else try{n=a(i,r),Uf(e,t,n)}catch(p){tp(e,t,p)}}function Uf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Df(e,t,r)},function(r){return tp(e,t,r)}):Df(e,t,a)}function Df(e,t,a){t.status="fulfilled",t.value=a,Og(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Dg(e,a)))}function tp(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Og(t),t=t.next;while(t!==r)}e.action=null}function Og(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bg(e,t){return t}function Of(e,t){if(Ce){var a=$e.formState;if(a!==null){e:{var r=me;if(Ce){if(Je){t:{for(var i=Je,n=ba;i.nodeType!==8;){if(!n){i=null;break t}if(i=va(i.nextSibling),i===null){i=null;break t}}n=i.data,i=n==="F!"||n==="F"?i:null}if(i){Je=va(i.nextSibling),r=i.data==="F!";break e}}Hr(r)}r=!1}r&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bg,lastRenderedState:t},a.queue=r,a=Wg.bind(null,me,r),r.dispatch=a,r=ep(!1),n=ad.bind(null,me,!1,r.queue),r=Ht(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=o1.bind(null,me,i,n,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function Bf(e){var t=lt();return Lg(t,Ge,e)}function Lg(e,t,a){if(t=Ip(e,t,Bg)[0],e=Kl(cr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Jo(t)}catch(o){throw o===kn?Ls:o}else r=t;t=lt();var i=t.queue,n=i.dispatch;return a!==t.memoizedState&&(me.flags|=2048,fn(9,{destroy:void 0},l1.bind(null,i,a),null)),[r,n,e]}function l1(e,t){e.action=t}function Lf(e){var t=lt(),a=Ge;if(a!==null)return Lg(t,a,e);lt(),t=t.memoizedState,a=lt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function fn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=me.updateQueue,t===null&&(t=Hs(),me.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Hg(){return lt().memoizedState}function Pl(e,t,a,r){var i=Ht();me.flags|=e,i.memoizedState=fn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Gs(e,t,a,r){var i=lt();r=r===void 0?null:r;var n=i.memoizedState.inst;Ge!==null&&r!==null&&Vp(r,Ge.memoizedState.deps)?i.memoizedState=fn(t,n,a,r):(me.flags|=e,i.memoizedState=fn(1|t,n,a,r))}function Hf(e,t){Pl(8390656,8,e,t)}function Fp(e,t){Gs(2048,8,e,t)}function s1(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Hs(),me.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Qg(e){var t=lt().memoizedState;return s1({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(Q(440));return t.impl.apply(void 0,arguments)}}function Gg(e,t){return Gs(4,2,e,t)}function jg(e,t){return Gs(4,4,e,t)}function Yg(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $g(e,t,a){a=a!=null?a.concat([e]):null,Gs(4,4,Yg.bind(null,t,e),a)}function Wp(){}function Vg(e,t){var a=lt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Vp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Xg(e,t){var a=lt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Vp(t,r[1]))return r[0];if(r=e(),ui){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r}function ed(e,t,a){return a===void 0||(sr&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Ub(),me.lanes|=e,Gr|=e,a)}function Zg(e,t,a,r){return sa(a,t)?a:mn.current!==null?(e=ed(e,a,r),sa(e,t)||(pt=!0),e):(sr&42)===0||(sr&1073741824)!==0&&(Se&261930)===0?(pt=!0,e.memoizedState=a):(e=Ub(),me.lanes|=e,Gr|=e,t)}function Kg(e,t,a,r,i){var n=Ue.p;Ue.p=n!==0&&8>n?n:8;var o=se.T,l={};se.T=l,ad(e,!1,t,a);try{var c=i(),p=se.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var m=r1(c,r);ko(e,t,m,la(e))}else ko(e,t,r,la(e))}catch(g){ko(e,t,{then:function(){},status:"rejected",reason:g},la())}finally{Ue.p=n,o!==null&&l.types!==null&&(o.types=l.types),se.T=o}}function c1(){}function ap(e,t,a,r){if(e.tag!==5)throw Error(Q(476));var i=Pg(e).queue;Kg(e,i,t,ai,a===null?c1:function(){return Jg(e),a(r)})}function Pg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ai,baseState:ai,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:ai},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jg(e){var t=Pg(e);t.next===null&&(t=e.alternate.memoizedState),ko(e,t.next.queue,{},la())}function td(){return Tt(Qo)}function Ig(){return lt().memoizedState}function Fg(){return lt().memoizedState}function u1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=la();e=zr(a);var r=Rr(t,e,a);r!==null&&(Kt(r,t,a),yo(r,t,a)),t={cache:Qp()},e.payload=t;return}t=t.return}}function p1(e,t,a){var r=la();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},js(e)?eb(t,a):(a=Op(e,t,a,r),a!==null&&(Kt(a,e,r),tb(a,t,r)))}function Wg(e,t,a){var r=la();ko(e,t,a,r)}function ko(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(js(e))eb(t,i);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,a);if(i.hasEagerState=!0,i.eagerState=l,sa(l,o))return Bs(e,t,i,0),$e===null&&Os(),!1}catch{}if(a=Op(e,t,i,r),a!==null)return Kt(a,e,r),tb(a,t,r),!0}return!1}function ad(e,t,a,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(Q(479))}else t=Op(e,a,r,2),t!==null&&Kt(t,e,2)}function js(e){var t=e.alternate;return e===me||t!==null&&t===me}function eb(e,t){ln=hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function tb(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qh(e,a)}}var Bo={readContext:Tt,use:Qs,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};Bo.useEffectEvent=rt;var ab={readContext:Tt,use:Qs,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Hf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Pl(4194308,4,Yg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Pl(4194308,4,e,t)},useInsertionEffect:function(e,t){Pl(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var r=e();if(ui){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ht();if(a!==void 0){var i=a(t);if(ui){Sr(!0);try{a(t)}finally{Sr(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=p1.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=ep(e);var t=e.queue,a=Wg.bind(null,me,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Wp,useDeferredValue:function(e,t){var a=Ht();return ed(a,e,t)},useTransition:function(){var e=ep(!1);return e=Kg.bind(null,me,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=me,i=Ht();if(Ce){if(a===void 0)throw Error(Q(407));a=a()}else{if(a=t(),$e===null)throw Error(Q(349));(Se&127)!==0||Mg(r,t,a)}i.memoizedState=a;var n={value:a,getSnapshot:t};return i.queue=n,Hf(zg.bind(null,r,n,e),[e]),r.flags|=2048,fn(9,{destroy:void 0},Tg.bind(null,r,n,a,t),null),a},useId:function(){var e=Ht(),t=$e.identifierPrefix;if(Ce){var a=Oa,r=Da;a=(r&~(1<<32-oa(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=i1++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:td,useFormState:Of,useActionState:Of,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ad.bind(null,me,!0,a),a.dispatch=t,[e,t]},useMemoCache:Jp,useCacheRefresh:function(){return Ht().memoizedState=u1.bind(null,me)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((Ae&2)!==0)throw Error(Q(440));return a.impl.apply(void 0,arguments)}}},rd={readContext:Tt,use:Qs,useCallback:Vg,useContext:Tt,useEffect:Fp,useImperativeHandle:$g,useInsertionEffect:Gg,useLayoutEffect:jg,useMemo:Xg,useReducer:Kl,useRef:Hg,useState:function(){return Kl(cr)},useDebugValue:Wp,useDeferredValue:function(e,t){var a=lt();return Zg(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Kl(cr)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Eg,useId:Ig,useHostTransitionStatus:td,useFormState:Bf,useActionState:Bf,useOptimistic:function(e,t){var a=lt();return Ug(a,Ge,e,t)},useMemoCache:Jp,useCacheRefresh:Fg};rd.useEffectEvent=Qg;var rb={readContext:Tt,use:Qs,useCallback:Vg,useContext:Tt,useEffect:Fp,useImperativeHandle:$g,useInsertionEffect:Gg,useLayoutEffect:jg,useMemo:Xg,useReducer:uu,useRef:Hg,useState:function(){return uu(cr)},useDebugValue:Wp,useDeferredValue:function(e,t){var a=lt();return Ge===null?ed(a,e,t):Zg(a,Ge.memoizedState,e,t)},useTransition:function(){var e=uu(cr)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Eg,useId:Ig,useHostTransitionStatus:td,useFormState:Lf,useActionState:Lf,useOptimistic:function(e,t){var a=lt();return Ge!==null?Ug(a,Ge,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Jp,useCacheRefresh:Fg};rb.useEffectEvent=Qg;function pu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ie({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var rp={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=la(),i=zr(r);i.payload=t,a!=null&&(i.callback=a),t=Rr(e,i,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=la(),i=zr(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Rr(e,i,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=la(),r=zr(a);r.tag=2,t!=null&&(r.callback=t),t=Rr(e,r,a),t!==null&&(Kt(t,e,a),yo(t,e,a))}};function Qf(e,t,a,r,i,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,o):t.prototype&&t.prototype.isPureReactComponent?!Ro(a,r)||!Ro(i,n):!0}function Gf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&rp.enqueueReplaceState(t,t.state,null)}function pi(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=Ie({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function ib(e){ss(e)}function nb(e){console.error(e)}function ob(e){ss(e)}function bs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function jf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function ip(e,t,a){return a=zr(a),a.tag=3,a.payload={element:null},a.callback=function(){bs(e,t)},a}function lb(e){return e=zr(e),e.tag=3,e}function sb(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){jf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){jf(t,a,r),typeof i!="function"&&(Ar===null?Ar=new Set([this]):Ar.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function d1(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&xn(t,a,i,!0),a=ca.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?xs():a.alternate===null&&it===0&&(it=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===ds?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),xu(e,r,i)),!1;case 22:return a.flags|=65536,r===ds?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),xu(e,r,i)),!1}throw Error(Q(435,a.tag))}return xu(e,r,i),xs(),!1}if(Ce)return t=ca.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Vu&&(e=Error(Q(422),{cause:r}),Uo(ga(e,a)))):(r!==Vu&&(t=Error(Q(423),{cause:r}),Uo(ga(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ga(r,a),i=ip(e.stateNode,r,i),cu(e,i),it!==4&&(it=2)),!1;var n=Error(Q(520),{cause:r});if(n=ga(n,a),Co===null?Co=[n]:Co.push(n),it!==4&&(it=2),t===null)return!0;r=ga(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=ip(a.stateNode,r,e),cu(a,e),!1;case 1:if(t=a.type,n=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Ar===null||!Ar.has(n))))return a.flags|=65536,i&=-i,a.lanes|=i,i=lb(i),sb(i,e,a,r),cu(a,i),!1}a=a.return}while(a!==null);return!1}var id=Error(Q(461)),pt=!1;function qt(e,t,a,r){t.child=e===null?xg(t,null,a,r):ci(t,e.child,a,r)}function Yf(e,t,a,r,i){a=a.render;var n=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return si(t),r=Xp(e,t,a,o,n,i),l=Zp(),e!==null&&!pt?(Kp(e,t,i),ur(e,t,i)):(Ce&&l&&Lp(t),t.flags|=1,qt(e,t,r,i),t.child)}function $f(e,t,a,r,i){if(e===null){var n=a.type;return typeof n=="function"&&!Bp(n)&&n.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=n,cb(e,t,n,r,i)):(e=Xl(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!nd(e,i)){var o=n.memoizedProps;if(a=a.compare,a=a!==null?a:Ro,a(o,r)&&e.ref===t.ref)return ur(e,t,i)}return t.flags|=1,e=ir(n,r),e.ref=t.ref,e.return=t,t.child=e}function cb(e,t,a,r,i){if(e!==null){var n=e.memoizedProps;if(Ro(n,r)&&e.ref===t.ref)if(pt=!1,t.pendingProps=r=n,nd(e,i))(e.flags&131072)!==0&&(pt=!0);else return t.lanes=e.lanes,ur(e,t,i)}return np(e,t,a,r,i)}function ub(e,t,a,r){var i=r.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~n}else r=0,t.child=null;return Vf(e,t,n,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(t,n!==null?n.cachePool:null),n!==null?Af(t,n):Fu(),Ng(t);else return r=t.lanes=536870912,Vf(e,t,n!==null?n.baseLanes|a:a,a,r)}else n!==null?(Zl(t,n.cachePool),Af(t,n),xr(t),t.memoizedState=null):(e!==null&&Zl(t,null),Fu(),xr(t));return qt(e,t,i,a),t.child}function fo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vf(e,t,a,r,i){var n=Gp();return n=n===null?null:{parent:ut._currentValue,pool:n},t.memoizedState={baseLanes:a,cachePool:n},e!==null&&Zl(t,null),Fu(),Ng(t),e!==null&&xn(e,t,r,!0),t.childLanes=i,null}function Jl(e,t){return t=ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xf(e,t,a){return ci(t,e.child,null,a),e=Jl(t,t.pendingProps),e.flags|=2,ta(t),t.memoizedState=null,e}function m1(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(r.mode==="hidden")return e=Jl(t,r),t.lanes=536870912,fo(null,e);if(Wu(t),(e=Je)?(e=aw(e,ba),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Lr!==null?{id:Da,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=hg(e),a.return=t,t.child=a,Mt=t,Je=null)):e=null,e===null)throw Hr(t);return t.lanes=536870912,null}return Jl(t,r)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Wu(t),i)if(t.flags&256)t.flags&=-257,t=Xf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(Q(558));else if(pt||xn(e,t,a,!1),i=(a&e.childLanes)!==0,pt||i){if(r=$e,r!==null&&(o=Gh(r,a),o!==0&&o!==n.retryLane))throw n.retryLane=o,hi(e,o),Kt(r,e,o),id;xs(),t=Xf(e,t,a)}else e=n.treeContext,Je=va(o.nextSibling),Mt=t,Ce=!0,Tr=null,ba=!1,e!==null&&bg(t,e),t=Jl(t,r),t.flags|=4096;return t}return e=ir(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Il(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(Q(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function np(e,t,a,r,i){return si(t),a=Xp(e,t,a,r,void 0,i),r=Zp(),e!==null&&!pt?(Kp(e,t,i),ur(e,t,i)):(Ce&&r&&Lp(t),t.flags|=1,qt(e,t,a,i),t.child)}function Zf(e,t,a,r,i,n){return si(t),t.updateQueue=null,a=qg(t,r,a,i),Cg(e),r=Zp(),e!==null&&!pt?(Kp(e,t,n),ur(e,t,n)):(Ce&&r&&Lp(t),t.flags|=1,qt(e,t,a,n),t.child)}function Kf(e,t,a,r,i){if(si(t),t.stateNode===null){var n=Ii,o=a.contextType;typeof o=="object"&&o!==null&&(n=Tt(o)),n=new a(r,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=rp,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=r,n.state=t.memoizedState,n.refs={},Yp(t),o=a.contextType,n.context=typeof o=="object"&&o!==null?Tt(o):Ii,n.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(pu(t,a,o,r),n.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&rp.enqueueReplaceState(n,n.state,null),xo(t,r,n,i),_o(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){n=t.stateNode;var l=t.memoizedProps,c=pi(a,l);n.props=c;var p=n.context,m=a.contextType;o=Ii,typeof m=="object"&&m!==null&&(o=Tt(m));var g=a.getDerivedStateFromProps;m=typeof g=="function"||typeof n.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,m||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l||p!==o)&&Gf(t,n,r,o),vr=!1;var d=t.memoizedState;n.state=d,xo(t,r,n,i),_o(),p=t.memoizedState,l||d!==p||vr?(typeof g=="function"&&(pu(t,a,g,r),p=t.memoizedState),(c=vr||Qf(t,a,c,r,d,p,o))?(m||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),n.props=r,n.state=p,n.context=o,r=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{n=t.stateNode,Ju(e,t),o=t.memoizedProps,m=pi(a,o),n.props=m,g=t.pendingProps,d=n.context,p=a.contextType,c=Ii,typeof p=="object"&&p!==null&&(c=Tt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==g||d!==c)&&Gf(t,n,r,c),vr=!1,d=t.memoizedState,n.state=d,xo(t,r,n,i),_o();var b=t.memoizedState;o!==g||d!==b||vr||e!==null&&e.dependencies!==null&&ps(e.dependencies)?(typeof l=="function"&&(pu(t,a,l,r),b=t.memoizedState),(m=vr||Qf(t,a,m,r,d,b,c)||e!==null&&e.dependencies!==null&&ps(e.dependencies))?(p||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(r,b,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(r,b,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),n.props=r,n.state=b,n.context=c,r=m):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return n=r,Il(e,t),r=(t.flags&128)!==0,n||r?(n=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&r?(t.child=ci(t,e.child,null,i),t.child=ci(t,null,a,i)):qt(e,t,a,i),t.memoizedState=n.state,e=t.child):e=ur(e,t,i),e}function Pf(e,t,a,r){return li(),t.flags|=256,qt(e,t,a,r),t.child}var du={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mu(e){return{baseLanes:e,cachePool:vg()}}function fu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ra),e}function pb(e,t,a){var r=t.pendingProps,i=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ce){if(i?_r(t):xr(t),(e=Je)?(e=aw(e,ba),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Lr!==null?{id:Da,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=hg(e),a.return=t,t.child=a,Mt=t,Je=null)):e=null,e===null)throw Hr(t);return vp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(xr(t),i=t.mode,l=ws({mode:"hidden",children:l},i),r=ri(r,i,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=mu(a),r.childLanes=fu(e,o,a),t.memoizedState=du,fo(null,r)):(_r(t),op(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(n)t.flags&256?(_r(t),t.flags&=-257,t=hu(e,t,a)):t.memoizedState!==null?(xr(t),t.child=e.child,t.flags|=128,t=null):(xr(t),l=r.fallback,i=t.mode,r=ws({mode:"visible",children:r.children},i),l=ri(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ci(t,e.child,null,a),r=t.child,r.memoizedState=mu(a),r.childLanes=fu(e,o,a),t.memoizedState=du,t=fo(null,r));else if(_r(t),vp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(Q(419)),r.stack="",r.digest=o,Uo({value:r,source:null,stack:null}),t=hu(e,t,a)}else if(pt||xn(e,t,a,!1),o=(a&e.childLanes)!==0,pt||o){if(o=$e,o!==null&&(r=Gh(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Kt(o,e,r),id;wp(l)||xs(),t=hu(e,t,a)}else wp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Je=va(l.nextSibling),Mt=t,Ce=!0,Tr=null,ba=!1,e!==null&&bg(t,e),t=op(t,r.children),t.flags|=4096);return t}return i?(xr(t),l=r.fallback,i=t.mode,c=e.child,p=c.sibling,r=ir(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=ir(p,l):(l=ri(l,i,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,fo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=mu(a):(i=l.cachePool,i!==null?(c=ut._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=vg(),l={baseLanes:l.baseLanes|a,cachePool:i}),r.memoizedState=l,r.childLanes=fu(e,o,a),t.memoizedState=du,fo(e.child,r)):(_r(t),a=e.child,e=a.sibling,a=ir(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function op(e,t){return t=ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ws(e,t){return e=aa(22,e,null,t),e.lanes=0,e}function hu(e,t,a){return ci(t,e.child,null,a),e=op(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zu(e.return,t,a)}function gu(e,t,a,r,i,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=n)}function db(e,t,a){var r=t.pendingProps,i=r.revealOrder,n=r.tail;r=r.children;var o=ot.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Xe(ot,o),qt(e,t,r,a),r=Ce?Ao:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jf(e,a,t);else if(e.tag===19)Jf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&fs(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),gu(t,!1,i,a,n,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fs(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}gu(t,!0,a,null,n,r);break;case"together":gu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function ur(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Gr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(xn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,a=ir(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ir(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function nd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ps(e)))}function f1(e,t,a){switch(t.tag){case 3:is(t,t.stateNode.containerInfo),yr(t,ut,e.memoizedState.cache),li();break;case 27:case 5:Uu(t);break;case 4:is(t,t.stateNode.containerInfo);break;case 10:yr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(_r(t),t.flags|=128,null):(a&t.child.childLanes)!==0?pb(e,t,a):(_r(t),e=ur(e,t,a),e!==null?e.sibling:null);_r(t);break;case 19:var i=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(xn(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return db(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Xe(ot,ot.current),r)break;return null;case 22:return t.lanes=0,ub(e,t,a,t.pendingProps);case 24:yr(t,ut,e.memoizedState.cache)}return ur(e,t,a)}function mb(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)pt=!0;else{if(!nd(e,a)&&(t.flags&128)===0)return pt=!1,f1(e,t,a);pt=(e.flags&131072)!==0}else pt=!1,Ce&&(t.flags&1048576)!==0&&gg(t,Ao,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Bp(e)?(r=pi(e,r),t.tag=1,t=Kf(null,t,e,r,a)):(t.tag=0,t=np(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===kp){t.tag=11,t=Yf(null,t,e,r,a);break e}else if(i===Sp){t.tag=14,t=$f(null,t,e,r,a);break e}}throw t=Ru(e)||e,Error(Q(306,t,""))}}return t;case 0:return np(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=pi(r,t.pendingProps),Kf(e,t,r,i,a);case 3:e:{if(is(t,t.stateNode.containerInfo),e===null)throw Error(Q(387));r=t.pendingProps;var n=t.memoizedState;i=n.element,Ju(e,t),xo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,yr(t,ut,r),r!==n.cache&&Ku(t,[ut],a,!0),_o(),r=o.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Pf(e,t,r,a);break e}else if(r!==i){i=ga(Error(Q(424)),t),Uo(i),t=Pf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Je=va(e.firstChild),Mt=t,Ce=!0,Tr=null,ba=!0,a=xg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(li(),r===i){t=ur(e,t,a);break e}qt(e,t,r,a)}t=t.child}return t;case 26:return Il(e,t),e===null?(a=wh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ce||(a=t.type,e=t.pendingProps,r=Cs(Mr.current).createElement(a),r[Et]=t,r[Pt]=e,zt(r,a,e),xt(r),t.stateNode=r):t.memoizedState=wh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Uu(t),e===null&&Ce&&(r=t.stateNode=rw(t.type,t.pendingProps,Mr.current),Mt=t,ba=!0,i=Je,Yr(t.type)?(yp=i,Je=va(r.firstChild)):Je=i),qt(e,t,t.pendingProps.children,a),Il(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((i=r=Je)&&(r=j1(r,t.type,t.pendingProps,ba),r!==null?(t.stateNode=r,Mt=t,Je=va(r.firstChild),ba=!1,i=!0):i=!1),i||Hr(t)),Uu(t),i=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,r=n.children,gp(i,n)?r=null:o!==null&&gp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Xp(e,t,n1,null,null,a),Qo._currentValue=i),Il(e,t),qt(e,t,r,a),t.child;case 6:return e===null&&Ce&&((e=a=Je)&&(a=Y1(a,t.pendingProps,ba),a!==null?(t.stateNode=a,Mt=t,Je=null,e=!0):e=!1),e||Hr(t)),null;case 13:return pb(e,t,a);case 4:return is(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,a):qt(e,t,r,a),t.child;case 11:return Yf(e,t,t.type,t.pendingProps,a);case 7:return qt(e,t,t.pendingProps,a),t.child;case 8:return qt(e,t,t.pendingProps.children,a),t.child;case 12:return qt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,yr(t,t.type,r.value),qt(e,t,r.children,a),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,si(t),i=Tt(i),r=r(i),t.flags|=1,qt(e,t,r,a),t.child;case 14:return $f(e,t,t.type,t.pendingProps,a);case 15:return cb(e,t,t.type,t.pendingProps,a);case 19:return db(e,t,a);case 31:return m1(e,t,a);case 22:return ub(e,t,a,t.pendingProps);case 24:return si(t),r=Tt(ut),e===null?(i=Gp(),i===null&&(i=$e,n=Qp(),i.pooledCache=n,n.refCount++,n!==null&&(i.pooledCacheLanes|=a),i=n),t.memoizedState={parent:r,cache:i},Yp(t),yr(t,ut,i)):((e.lanes&a)!==0&&(Ju(e,t),xo(t,null,null,a),_o()),i=e.memoizedState,n=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),yr(t,ut,r)):(r=n.cache,yr(t,ut,r),r!==i.cache&&Ku(t,[ut],a,!0))),qt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(Q(156,t.tag))}function Pa(e){e.flags|=4}function bu(e,t,a,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Bb())e.flags|=8192;else throw ni=ds,jp}else e.flags&=-16777217}function If(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ow(t))if(Bb())e.flags|=8192;else throw ni=ds,jp}function Dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Lh():536870912,e.lanes|=t,hn|=t)}function oo(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function h1(e,t,a){var r=t.pendingProps;switch(Hp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),nr(ut),cn(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,su())),Pe(t),null;case 26:var i=t.type,n=t.memoizedState;return e===null?(Pa(t),n!==null?(Pe(t),If(t,n)):(Pe(t),bu(t,i,null,r,a))):n?n!==e.memoizedState?(Pa(t),Pe(t),If(t,n)):(Pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Pa(t),Pe(t),bu(t,i,e,r,a)),null;case 27:if(ns(t),a=Mr.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Pe(t),null}e=La.current,Hi(t)?Cf(t,e):(e=rw(i,r,a),t.stateNode=e,Pa(t))}return Pe(t),null;case 5:if(ns(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Pe(t),null}if(n=La.current,Hi(t))Cf(t,n);else{var o=Cs(Mr.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?n.multiple=!0:r.size&&(n.size=r.size);break;default:n=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}n[Et]=t,n[Pt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(zt(n,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Pa(t)}}return Pe(t),bu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(e=Mr.current,Hi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Mt,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Et]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Wb(e.nodeValue,a)),e||Hr(t,!0)}else e=Cs(e).createTextNode(r),e[Et]=t,t.stateNode=e}return Pe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),a!==null){if(e===null){if(!r)throw Error(Q(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(557));e[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else a=su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ta(t),t):(ta(t),null);if((t.flags&128)!==0)throw Error(Q(558))}return Pe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Q(317));i[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),i=!1}else i=su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ta(t),t):(ta(t),null)}return ta(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Dl(t,t.updateQueue),Pe(t),null);case 4:return cn(),e===null&&dd(t.stateNode.containerInfo),Pe(t),null;case 10:return nr(t.type),Pe(t),null;case 19:if(kt(ot),r=t.memoizedState,r===null)return Pe(t),null;if(i=(t.flags&128)!==0,n=r.rendering,n===null)if(i)oo(r,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=fs(e),n!==null){for(t.flags|=128,oo(r,!1),e=n.updateQueue,t.updateQueue=e,Dl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)fg(a,e),a=a.sibling;return Xe(ot,ot.current&1|2),Ce&&Wa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ia()>ys&&(t.flags|=128,i=!0,oo(r,!1),t.lanes=4194304)}else{if(!i)if(e=fs(n),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Dl(t,e),oo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!n.alternate&&!Ce)return Pe(t),null}else 2*ia()-r.renderingStartTime>ys&&a!==536870912&&(t.flags|=128,i=!0,oo(r,!1),t.lanes=4194304);r.isBackwards?(n.sibling=t.child,t.child=n):(e=r.last,e!==null?e.sibling=n:t.child=n,r.last=n)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ia(),e.sibling=null,a=ot.current,Xe(ot,i?a&1|2:a&1),Ce&&Wa(t,r.treeForkCount),e):(Pe(t),null);case 22:case 23:return ta(t),$p(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),a=t.updateQueue,a!==null&&Dl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&kt(ii),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),nr(ut),Pe(t),null;case 25:return null;case 30:return null}throw Error(Q(156,t.tag))}function g1(e,t){switch(Hp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(ut),cn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ns(t),null;case 31:if(t.memoizedState!==null){if(ta(t),t.alternate===null)throw Error(Q(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ta(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(ot),null;case 4:return cn(),null;case 10:return nr(t.type),null;case 22:case 23:return ta(t),$p(),e!==null&&kt(ii),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return nr(ut),null;case 25:return null;default:return null}}function fb(e,t){switch(Hp(t),t.tag){case 3:nr(ut),cn();break;case 26:case 27:case 5:ns(t);break;case 4:cn();break;case 31:t.memoizedState!==null&&ta(t);break;case 13:ta(t);break;case 19:kt(ot);break;case 10:nr(t.type);break;case 22:case 23:ta(t),$p(),e!==null&&kt(ii);break;case 24:nr(ut)}}function Io(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var n=a.create,o=a.inst;r=n(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){Be(t,t.return,l)}}function Qr(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var c=a,p=l;try{p()}catch(m){Be(i,c,m)}}}r=r.next}while(r!==n)}}catch(m){Be(t,t.return,m)}}function hb(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Sg(t,a)}catch(r){Be(e,e.return,r)}}}function gb(e,t,a){a.props=pi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Be(e,t,r)}}function So(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(i){Be(e,t,i)}}function Ba(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){Be(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Be(e,t,i)}else a.current=null}function bb(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(i){Be(e,e.return,i)}}function wu(e,t,a){try{var r=e.stateNode;O1(r,e.type,a,t),r[Pt]=t}catch(i){Be(e,e.return,i)}}function wb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Yr(e.type)||e.tag===4}function vu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Yr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lp(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ar));else if(r!==4&&(r===27&&Yr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(lp(e,t,a),e=e.sibling;e!==null;)lp(e,t,a),e=e.sibling}function vs(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Yr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(vs(e,t,a),e=e.sibling;e!==null;)vs(e,t,a),e=e.sibling}function vb(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,r,a),t[Et]=e,t[Pt]=a}catch(n){Be(e,e.return,n)}}var er=!1,ct=!1,yu=!1,Ff=typeof WeakSet=="function"?WeakSet:Set,_t=null;function b1(e,t){if(e=e.containerInfo,fp=Ts,e=og(e),Up(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var i=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,m=0,g=e,d=null;t:for(;;){for(var b;g!==a||i!==0&&g.nodeType!==3||(l=o+i),g!==n||r!==0&&g.nodeType!==3||(c=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(b=g.firstChild)!==null;)d=g,g=b;for(;;){if(g===e)break t;if(d===a&&++p===i&&(l=o),d===n&&++m===r&&(c=o),(b=g.nextSibling)!==null)break;g=d,d=g.parentNode}g=b}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(hp={focusedElem:e,selectionRange:a},Ts=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,n=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,a=t,i=n.memoizedProps,n=n.memoizedState,r=a.stateNode;try{var v=pi(a.type,i);e=r.getSnapshotBeforeUpdate(v,n),r.__reactInternalSnapshotBeforeUpdate=e}catch(E){Be(a,a.return,E)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)bp(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(Q(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function yb(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a),r&4&&Io(5,a);break;case 1:if(Ia(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Be(a,a.return,o)}else{var i=pi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Be(a,a.return,o)}}r&64&&hb(a),r&512&&So(a,a.return);break;case 3:if(Ia(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Sg(e,t)}catch(o){Be(a,a.return,o)}}break;case 27:t===null&&r&4&&vb(a);case 26:case 5:Ia(e,a),t===null&&r&4&&bb(a),r&512&&So(a,a.return);break;case 12:Ia(e,a);break;case 31:Ia(e,a),r&4&&kb(e,a);break;case 13:Ia(e,a),r&4&&Sb(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=C1.bind(null,a),$1(e,a))));break;case 22:if(r=a.memoizedState!==null||er,!r){t=t!==null&&t.memoizedState!==null||ct,i=er;var n=ct;er=r,(ct=t)&&!n?Fa(e,a,(a.subtreeFlags&8772)!==0):Ia(e,a),er=i,ct=n}break;case 30:break;default:Ia(e,a)}}function _b(e){var t=e.alternate;t!==null&&(e.alternate=null,_b(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ep(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,Xt=!1;function Ja(e,t,a){for(a=a.child;a!==null;)xb(e,t,a),a=a.sibling}function xb(e,t,a){if(na&&typeof na.onCommitFiberUnmount=="function")try{na.onCommitFiberUnmount($o,a)}catch{}switch(a.tag){case 26:ct||Ba(a,t),Ja(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ct||Ba(a,t);var r=et,i=Xt;Yr(a.type)&&(et=a.stateNode,Xt=!1),Ja(e,t,a),Eo(a.stateNode),et=r,Xt=i;break;case 5:ct||Ba(a,t);case 6:if(r=et,i=Xt,et=null,Ja(e,t,a),et=r,Xt=i,et!==null)if(Xt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(a.stateNode)}catch(n){Be(a,t,n)}else try{et.removeChild(a.stateNode)}catch(n){Be(a,t,n)}break;case 18:et!==null&&(Xt?(e=et,mh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),vn(e)):mh(et,a.stateNode));break;case 4:r=et,i=Xt,et=a.stateNode.containerInfo,Xt=!0,Ja(e,t,a),et=r,Xt=i;break;case 0:case 11:case 14:case 15:Qr(2,a,t),ct||Qr(4,a,t),Ja(e,t,a);break;case 1:ct||(Ba(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&gb(a,t,r)),Ja(e,t,a);break;case 21:Ja(e,t,a);break;case 22:ct=(r=ct)||a.memoizedState!==null,Ja(e,t,a),ct=r;break;default:Ja(e,t,a)}}function kb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vn(e)}catch(a){Be(t,t.return,a)}}}function Sb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vn(e)}catch(a){Be(t,t.return,a)}}function w1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ff),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ff),t;default:throw Error(Q(435,e.tag))}}function Ol(e,t){var a=w1(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=q1.bind(null,e,r);r.then(i,i)}})}function $t(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r],n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Yr(l.type)){et=l.stateNode,Xt=!1;break e}break;case 5:et=l.stateNode,Xt=!1;break e;case 3:case 4:et=l.stateNode.containerInfo,Xt=!0;break e}l=l.return}if(et===null)throw Error(Q(160));xb(n,o,i),et=null,Xt=!1,n=i.alternate,n!==null&&(n.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nb(t,e),t=t.sibling}var Ea=null;function Nb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$t(t,e),Vt(e),r&4&&(Qr(3,e,e.return),Io(3,e),Qr(5,e,e.return));break;case 1:$t(t,e),Vt(e),r&512&&(ct||a===null||Ba(a,a.return)),r&64&&er&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var i=Ea;if($t(t,e),Vt(e),r&512&&(ct||a===null||Ba(a,a.return)),r&4){var n=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":n=i.getElementsByTagName("title")[0],(!n||n[Zo]||n[Et]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=i.createElement(r),i.head.insertBefore(n,i.querySelector("head > title"))),zt(n,r,a),n[Et]=e,xt(n),r=n;break e;case"link":var o=yh("link","href",i).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(n=o[l],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;case"meta":if(o=yh("meta","content",i).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(n=o[l],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;default:throw Error(Q(468,r))}n[Et]=e,xt(n),r=n}e.stateNode=r}else _h(i,e.type,e.stateNode);else e.stateNode=vh(i,r,e.memoizedProps);else n!==r?(n===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):n.count--,r===null?_h(i,e.type,e.stateNode):vh(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&wu(e,e.memoizedProps,a.memoizedProps)}break;case 27:$t(t,e),Vt(e),r&512&&(ct||a===null||Ba(a,a.return)),a!==null&&r&4&&wu(e,e.memoizedProps,a.memoizedProps);break;case 5:if($t(t,e),Vt(e),r&512&&(ct||a===null||Ba(a,a.return)),e.flags&32){i=e.stateNode;try{pn(i,"")}catch(v){Be(e,e.return,v)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,wu(e,i,a!==null?a.memoizedProps:i)),r&1024&&(yu=!0);break;case 6:if($t(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(Q(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(v){Be(e,e.return,v)}}break;case 3:if(es=null,i=Ea,Ea=qs(t.containerInfo),$t(t,e),Ea=i,Vt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{vn(t.containerInfo)}catch(v){Be(e,e.return,v)}yu&&(yu=!1,Cb(e));break;case 4:r=Ea,Ea=qs(e.stateNode.containerInfo),$t(t,e),Vt(e),Ea=r;break;case 12:$t(t,e),Vt(e);break;case 31:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 13:$t(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ys=ia()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 22:i=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=er,m=ct;if(er=p||i,ct=m||c,$t(t,e),ct=m,er=p,Vt(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||c||er||ct||ti(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(n=c.stateNode,i)o=n.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var g=c.memoizedProps.style,d=g!=null&&g.hasOwnProperty("display")?g.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(v){Be(c,c.return,v)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(v){Be(c,c.return,v)}}}else if(t.tag===18){if(a===null){c=t;try{var b=c.stateNode;i?fh(b,!0):fh(c.stateNode,!1)}catch(v){Be(c,c.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ol(e,a))));break;case 19:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 30:break;case 21:break;default:$t(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(wb(r)){a=r;break}r=r.return}if(a==null)throw Error(Q(160));switch(a.tag){case 27:var i=a.stateNode,n=vu(e);vs(e,n,i);break;case 5:var o=a.stateNode;a.flags&32&&(pn(o,""),a.flags&=-33);var l=vu(e);vs(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=vu(e);lp(e,p,c);break;default:throw Error(Q(161))}}catch(m){Be(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cb(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yb(e,t.alternate,t),t=t.sibling}function ti(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qr(4,t,t.return),ti(t);break;case 1:Ba(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&gb(t,t.return,a),ti(t);break;case 27:Eo(t.stateNode);case 26:case 5:Ba(t,t.return),ti(t);break;case 22:t.memoizedState===null&&ti(t);break;case 30:ti(t);break;default:ti(t)}e=e.sibling}}function Fa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,n=t,o=n.flags;switch(n.tag){case 0:case 11:case 15:Fa(i,n,a),Io(4,n);break;case 1:if(Fa(i,n,a),r=n,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(p){Be(r,r.return,p)}if(r=n,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)kg(c[i],l)}catch(p){Be(r,r.return,p)}}a&&o&64&&hb(n),So(n,n.return);break;case 27:vb(n);case 26:case 5:Fa(i,n,a),a&&r===null&&o&4&&bb(n),So(n,n.return);break;case 12:Fa(i,n,a);break;case 31:Fa(i,n,a),a&&o&4&&kb(i,n);break;case 13:Fa(i,n,a),a&&o&4&&Sb(i,n);break;case 22:n.memoizedState===null&&Fa(i,n,a),So(n,n.return);break;case 30:break;default:Fa(i,n,a)}t=t.sibling}}function od(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Po(a))}function ld(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Po(e))}function qa(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qb(e,t,a,r),t=t.sibling}function qb(e,t,a,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:qa(e,t,a,r),i&2048&&Io(9,t);break;case 1:qa(e,t,a,r);break;case 3:qa(e,t,a,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Po(e)));break;case 12:if(i&2048){qa(e,t,a,r),e=t.stateNode;try{var n=t.memoizedProps,o=n.id,l=n.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Be(t,t.return,c)}}else qa(e,t,a,r);break;case 31:qa(e,t,a,r);break;case 13:qa(e,t,a,r);break;case 23:break;case 22:n=t.stateNode,o=t.alternate,t.memoizedState!==null?n._visibility&2?qa(e,t,a,r):No(e,t):n._visibility&2?qa(e,t,a,r):(n._visibility|=2,Gi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&od(o,t);break;case 24:qa(e,t,a,r),i&2048&&ld(t.alternate,t);break;default:qa(e,t,a,r)}}function Gi(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Gi(n,o,l,c,i),Io(8,o);break;case 23:break;case 22:var m=o.stateNode;o.memoizedState!==null?m._visibility&2?Gi(n,o,l,c,i):No(n,o):(m._visibility|=2,Gi(n,o,l,c,i)),i&&p&2048&&od(o.alternate,o);break;case 24:Gi(n,o,l,c,i),i&&p&2048&&ld(o.alternate,o);break;default:Gi(n,o,l,c,i)}t=t.sibling}}function No(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:No(a,r),i&2048&&od(r.alternate,r);break;case 24:No(a,r),i&2048&&ld(r.alternate,r);break;default:No(a,r)}t=t.sibling}}var ho=8192;function Qi(e,t,a){if(e.subtreeFlags&ho)for(e=e.child;e!==null;)Eb(e,t,a),e=e.sibling}function Eb(e,t,a){switch(e.tag){case 26:Qi(e,t,a),e.flags&ho&&e.memoizedState!==null&&a_(a,Ea,e.memoizedState,e.memoizedProps);break;case 5:Qi(e,t,a);break;case 3:case 4:var r=Ea;Ea=qs(e.stateNode.containerInfo),Qi(e,t,a),Ea=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,Qi(e,t,a),ho=r):Qi(e,t,a));break;default:Qi(e,t,a)}}function Mb(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];_t=r,zb(r,e)}Mb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tb(e),e=e.sibling}function Tb(e){switch(e.tag){case 0:case 11:case 15:lo(e),e.flags&2048&&Qr(9,e,e.return);break;case 3:lo(e);break;case 12:lo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):lo(e);break;default:lo(e)}}function Fl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];_t=r,zb(r,e)}Mb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qr(8,t,t.return),Fl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function zb(e,t){for(;_t!==null;){var a=_t;switch(a.tag){case 0:case 11:case 15:Qr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Po(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,_t=r;else e:for(a=e;_t!==null;){r=_t;var i=r.sibling,n=r.return;if(_b(r),r===a){_t=null;break e}if(i!==null){i.return=n,_t=i;break e}_t=n}}}var v1={getCacheForType:function(e){var t=Tt(ut),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(ut).controller.signal}},y1=typeof WeakMap=="function"?WeakMap:Map,Ae=0,$e=null,_e=null,Se=0,Oe=0,ea=null,Cr=!1,Sn=!1,sd=!1,pr=0,it=0,Gr=0,oi=0,cd=0,ra=0,hn=0,Co=null,Zt=null,sp=!1,Ys=0,Rb=0,ys=1/0,_s=null,Ar=null,ht=0,Ur=null,gn=null,or=0,cp=0,up=null,Ab=null,qo=0,pp=null;function la(){return(Ae&2)!==0&&Se!==0?Se&-Se:se.T!==null?pd():jh()}function Ub(){if(ra===0)if((Se&536870912)===0||Ce){var e=Cl;Cl<<=1,(Cl&3932160)===0&&(Cl=262144),ra=e}else ra=536870912;return e=ca.current,e!==null&&(e.flags|=32),ra}function Kt(e,t,a){(e===$e&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)&&(bn(e,0),qr(e,Se,ra,!1)),Xo(e,a),((Ae&2)===0||e!==$e)&&(e===$e&&((Ae&2)===0&&(oi|=a),it===4&&qr(e,Se,ra,!1)),Qa(e))}function Db(e,t,a){if((Ae&6)!==0)throw Error(Q(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Vo(e,t),i=r?k1(e,t):_u(e,t,!0),n=r;do{if(i===0){Sn&&!r&&qr(e,t,0,!1);break}else{if(a=e.current.alternate,n&&!_1(a)){i=_u(e,t,!1),n=!1;continue}if(i===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;i=Co;var c=l.current.memoizedState.isDehydrated;if(c&&(bn(l,o).flags|=256),o=_u(l,o,!1),o!==2){if(sd&&!c){l.errorRecoveryDisabledLanes|=n,oi|=n,i=4;break e}n=Zt,Zt=i,n!==null&&(Zt===null?Zt=n:Zt.push.apply(Zt,n))}i=o}if(n=!1,i!==2)continue}}if(i===1){bn(e,0),qr(e,t,0,!0);break}e:{switch(r=e,n=i,n){case 0:case 1:throw Error(Q(345));case 4:if((t&4194048)!==t)break;case 6:qr(r,t,ra,!Cr);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(Q(329))}if((t&62914560)===t&&(i=Ys+300-ia(),10<i)){if(qr(r,t,ra,!Cr),Rs(r,0,!0)!==0)break e;or=t,r.timeoutHandle=tw(Wf.bind(null,r,a,Zt,_s,sp,t,ra,oi,hn,Cr,n,"Throttled",-0,0),i);break e}Wf(r,a,Zt,_s,sp,t,ra,oi,hn,Cr,n,null,-0,0)}}break}while(!0);Qa(e)}function Wf(e,t,a,r,i,n,o,l,c,p,m,g,d,b){if(e.timeoutHandle=-1,g=t.subtreeFlags,g&8192||(g&16785408)===16785408){g={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ar},Eb(t,n,g);var v=(n&62914560)===n?Ys-ia():(n&4194048)===n?Rb-ia():0;if(v=r_(g,v),v!==null){or=n,e.cancelPendingCommit=v(th.bind(null,e,t,n,a,r,i,o,l,c,m,g,null,d,b)),qr(e,n,o,!p);return}}th(e,t,n,a,r,i,o,l,c)}function _1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var i=a[r],n=i.getSnapshot;i=i.value;try{if(!sa(n(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qr(e,t,a,r){t&=~cd,t&=~oi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var n=31-oa(i),o=1<<n;r[n]=-1,i&=~o}a!==0&&Hh(e,a,t)}function $s(){return(Ae&6)===0?(Fo(0,!1),!1):!0}function ud(){if(_e!==null){if(Oe===0)var e=_e.return;else e=_e,rr=gi=null,Pp(e),on=null,Do=0,e=_e;for(;e!==null;)fb(e.alternate,e),e=e.return;_e=null}}function bn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,H1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),or=0,ud(),$e=e,_e=a=ir(e.current,null),Se=t,Oe=0,ea=null,Cr=!1,Sn=Vo(e,t),sd=!1,hn=ra=cd=oi=Gr=it=0,Zt=Co=null,sp=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-oa(r),n=1<<i;t|=e[i],r&=~n}return pr=t,Os(),a}function Ob(e,t){me=null,se.H=Bo,t===kn||t===Ls?(t=zf(),Oe=3):t===jp?(t=zf(),Oe=4):Oe=t===id?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ea=t,_e===null&&(it=1,bs(e,ga(t,e.current)))}function Bb(){var e=ca.current;return e===null?!0:(Se&4194048)===Se?wa===null:(Se&62914560)===Se||(Se&536870912)!==0?e===wa:!1}function Lb(){var e=se.H;return se.H=Bo,e===null?Bo:e}function Hb(){var e=se.A;return se.A=v1,e}function xs(){it=4,Cr||(Se&4194048)!==Se&&ca.current!==null||(Sn=!0),(Gr&134217727)===0&&(oi&134217727)===0||$e===null||qr($e,Se,ra,!1)}function _u(e,t,a){var r=Ae;Ae|=2;var i=Lb(),n=Hb();($e!==e||Se!==t)&&(_s=null,bn(e,t)),t=!1;var o=it;e:do try{if(Oe!==0&&_e!==null){var l=_e,c=ea;switch(Oe){case 8:ud(),o=6;break e;case 3:case 2:case 9:case 6:ca.current===null&&(t=!0);var p=Oe;if(Oe=0,ea=null,en(e,l,c,p),a&&Sn){o=0;break e}break;default:p=Oe,Oe=0,ea=null,en(e,l,c,p)}}x1(),o=it;break}catch(m){Ob(e,m)}while(!0);return t&&e.shellSuspendCounter++,rr=gi=null,Ae=r,se.H=i,se.A=n,_e===null&&($e=null,Se=0,Os()),o}function x1(){for(;_e!==null;)Qb(_e)}function k1(e,t){var a=Ae;Ae|=2;var r=Lb(),i=Hb();$e!==e||Se!==t?(_s=null,ys=ia()+500,bn(e,t)):Sn=Vo(e,t);e:do try{if(Oe!==0&&_e!==null){t=_e;var n=ea;t:switch(Oe){case 1:Oe=0,ea=null,en(e,t,n,1);break;case 2:case 9:if(Tf(n)){Oe=0,ea=null,eh(t);break}t=function(){Oe!==2&&Oe!==9||$e!==e||(Oe=7),Qa(e)},n.then(t,t);break e;case 3:Oe=7;break e;case 4:Oe=5;break e;case 7:Tf(n)?(Oe=0,ea=null,eh(t)):(Oe=0,ea=null,en(e,t,n,7));break;case 5:var o=null;switch(_e.tag){case 26:o=_e.memoizedState;case 5:case 27:var l=_e;if(o?ow(o):l.stateNode.complete){Oe=0,ea=null;var c=l.sibling;if(c!==null)_e=c;else{var p=l.return;p!==null?(_e=p,Vs(p)):_e=null}break t}}Oe=0,ea=null,en(e,t,n,5);break;case 6:Oe=0,ea=null,en(e,t,n,6);break;case 8:ud(),it=6;break e;default:throw Error(Q(462))}}S1();break}catch(m){Ob(e,m)}while(!0);return rr=gi=null,se.H=r,se.A=i,Ae=a,_e!==null?0:($e=null,Se=0,Os(),it)}function S1(){for(;_e!==null&&!Z0();)Qb(_e)}function Qb(e){var t=mb(e.alternate,e,pr);e.memoizedProps=e.pendingProps,t===null?Vs(e):_e=t}function eh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Zf(a,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=Zf(a,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Pp(t);default:fb(a,t),t=_e=fg(t,pr),t=mb(a,t,pr)}e.memoizedProps=e.pendingProps,t===null?Vs(e):_e=t}function en(e,t,a,r){rr=gi=null,Pp(t),on=null,Do=0;var i=t.return;try{if(d1(e,i,t,a,Se)){it=1,bs(e,ga(a,e.current)),_e=null;return}}catch(n){if(i!==null)throw _e=i,n;it=1,bs(e,ga(a,e.current)),_e=null;return}t.flags&32768?(Ce||r===1?e=!0:Sn||(Se&536870912)!==0?e=!1:(Cr=e=!0,(r===2||r===9||r===3||r===6)&&(r=ca.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gb(t,e)):Vs(t)}function Vs(e){var t=e;do{if((t.flags&32768)!==0){Gb(t,Cr);return}e=t.return;var a=h1(t.alternate,t,pr);if(a!==null){_e=a;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);it===0&&(it=5)}function Gb(e,t){do{var a=g1(e.alternate,e);if(a!==null){a.flags&=32767,_e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=a}while(e!==null);it=6,_e=null}function th(e,t,a,r,i,n,o,l,c){e.cancelPendingCommit=null;do Xs();while(ht!==0);if((Ae&6)!==0)throw Error(Q(327));if(t!==null){if(t===e.current)throw Error(Q(177));if(n=t.lanes|t.childLanes,n|=Dp,ry(e,a,n,o,l,c),e===$e&&(_e=$e=null,Se=0),gn=t,Ur=e,or=a,cp=n,up=i,Ab=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E1(os,function(){return Xb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=se.T,se.T=null,i=Ue.p,Ue.p=2,o=Ae,Ae|=4;try{b1(e,t,a)}finally{Ae=o,Ue.p=i,se.T=r}}ht=1,jb(),Yb(),$b()}}function jb(){if(ht===1){ht=0;var e=Ur,t=gn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=se.T,se.T=null;var r=Ue.p;Ue.p=2;var i=Ae;Ae|=4;try{Nb(t,e);var n=hp,o=og(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&ng(l.ownerDocument.documentElement,l)){if(c!==null&&Up(l)){var p=c.start,m=c.end;if(m===void 0&&(m=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(m,l.value.length);else{var g=l.ownerDocument||document,d=g&&g.defaultView||window;if(d.getSelection){var b=d.getSelection(),v=l.textContent.length,E=Math.min(c.start,v),O=c.end===void 0?E:Math.min(c.end,v);!b.extend&&E>O&&(o=O,O=E,E=o);var f=kf(l,E),u=kf(l,O);if(f&&u&&(b.rangeCount!==1||b.anchorNode!==f.node||b.anchorOffset!==f.offset||b.focusNode!==u.node||b.focusOffset!==u.offset)){var h=g.createRange();h.setStart(f.node,f.offset),b.removeAllRanges(),E>O?(b.addRange(h),b.extend(u.node,u.offset)):(h.setEnd(u.node,u.offset),b.addRange(h))}}}}for(g=[],b=l;b=b.parentNode;)b.nodeType===1&&g.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<g.length;l++){var w=g[l];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Ts=!!fp,hp=fp=null}finally{Ae=i,Ue.p=r,se.T=a}}e.current=t,ht=2}}function Yb(){if(ht===2){ht=0;var e=Ur,t=gn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=se.T,se.T=null;var r=Ue.p;Ue.p=2;var i=Ae;Ae|=4;try{yb(e,t.alternate,t)}finally{Ae=i,Ue.p=r,se.T=a}}ht=3}}function $b(){if(ht===4||ht===3){ht=0,K0();var e=Ur,t=gn,a=or,r=Ab;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ht=5:(ht=0,gn=Ur=null,Vb(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ar=null),qp(a),t=t.stateNode,na&&typeof na.onCommitFiberRoot=="function")try{na.onCommitFiberRoot($o,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=se.T,i=Ue.p,Ue.p=2,se.T=null;try{for(var n=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];n(l.value,{componentStack:l.stack})}}finally{se.T=t,Ue.p=i}}(or&3)!==0&&Xs(),Qa(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===pp?qo++:(qo=0,pp=e):qo=0,Fo(0,!1)}}function Vb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Po(t)))}function Xs(){return jb(),Yb(),$b(),Xb()}function Xb(){if(ht!==5)return!1;var e=Ur,t=cp;cp=0;var a=qp(or),r=se.T,i=Ue.p;try{Ue.p=32>a?32:a,se.T=null,a=up,up=null;var n=Ur,o=or;if(ht=0,gn=Ur=null,or=0,(Ae&6)!==0)throw Error(Q(331));var l=Ae;if(Ae|=4,Tb(n.current),qb(n,n.current,o,a),Ae=l,Fo(0,!1),na&&typeof na.onPostCommitFiberRoot=="function")try{na.onPostCommitFiberRoot($o,n)}catch{}return!0}finally{Ue.p=i,se.T=r,Vb(e,t)}}function ah(e,t,a){t=ga(a,t),t=ip(e.stateNode,t,2),e=Rr(e,t,2),e!==null&&(Xo(e,2),Qa(e))}function Be(e,t,a){if(e.tag===3)ah(e,e,a);else for(;t!==null;){if(t.tag===3){ah(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ar===null||!Ar.has(r))){e=ga(a,e),a=lb(2),r=Rr(t,a,2),r!==null&&(sb(a,r,t,e),Xo(r,2),Qa(r));break}}t=t.return}}function xu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new y1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(sd=!0,i.add(a),e=N1.bind(null,e,t,a),t.then(e,e))}function N1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(Se&a)===a&&(it===4||it===3&&(Se&62914560)===Se&&300>ia()-Ys?(Ae&2)===0&&bn(e,0):cd|=a,hn===Se&&(hn=0)),Qa(e)}function Zb(e,t){t===0&&(t=Lh()),e=hi(e,t),e!==null&&(Xo(e,t),Qa(e))}function C1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Zb(e,a)}function q1(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(Q(314))}r!==null&&r.delete(t),Zb(e,a)}function E1(e,t){return Np(e,t)}var ks=null,ji=null,dp=!1,Ss=!1,ku=!1,Er=0;function Qa(e){e!==ji&&e.next===null&&(ji===null?ks=ji=e:ji=ji.next=e),Ss=!0,dp||(dp=!0,T1())}function Fo(e,t){if(!ku&&Ss){ku=!0;do for(var a=!1,r=ks;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var n=0;else{var o=r.suspendedLanes,l=r.pingedLanes;n=(1<<31-oa(42|e)+1)-1,n&=i&~(o&~l),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,rh(r,n))}else n=Se,n=Rs(r,r===$e?n:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(n&3)===0||Vo(r,n)||(a=!0,rh(r,n));r=r.next}while(a);ku=!1}}function M1(){Kb()}function Kb(){Ss=dp=!1;var e=0;Er!==0&&L1()&&(e=Er);for(var t=ia(),a=null,r=ks;r!==null;){var i=r.next,n=Pb(r,t);n===0?(r.next=null,a===null?ks=i:a.next=i,i===null&&(ji=a)):(a=r,(e!==0||(n&3)!==0)&&(Ss=!0)),r=i}ht!==0&&ht!==5||Fo(e,!1),Er!==0&&(Er=0)}function Pb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-oa(n),l=1<<o,c=i[o];c===-1?((l&a)===0||(l&r)!==0)&&(i[o]=ay(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}if(t=$e,a=Se,a=Rs(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Fc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Vo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Fc(r),qp(a)){case 2:case 8:a=Oh;break;case 32:a=os;break;case 268435456:a=Bh;break;default:a=os}return r=Jb.bind(null,e),a=Np(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Fc(r),e.callbackPriority=2,e.callbackNode=null,2}function Jb(e,t){if(ht!==0&&ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Xs()&&e.callbackNode!==a)return null;var r=Se;return r=Rs(e,e===$e?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Db(e,r,t),Pb(e,ia()),e.callbackNode!=null&&e.callbackNode===a?Jb.bind(null,e):null)}function rh(e,t){if(Xs())return null;Db(e,t,!0)}function T1(){Q1(function(){(Ae&6)!==0?Np(Dh,M1):Kb()})}function pd(){if(Er===0){var e=dn;e===0&&(e=Nl,Nl<<=1,(Nl&261888)===0&&(Nl=256)),Er=e}return Er}function ih(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yl(""+e)}function nh(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function z1(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var n=ih((i[Pt]||null).action),o=r.submitter;o&&(t=(t=o[Pt]||null)?ih(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var l=new As("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Er!==0){var c=o?nh(i,o):new FormData(i);ap(a,{pending:!0,data:c,method:i.method,action:n},null,c)}}else typeof n=="function"&&(l.preventDefault(),c=o?nh(i,o):new FormData(i),ap(a,{pending:!0,data:c,method:i.method,action:n},n,c))},currentTarget:i}]})}}for(Bl=0;Bl<$u.length;Bl++)Ll=$u[Bl],oh=Ll.toLowerCase(),lh=Ll[0].toUpperCase()+Ll.slice(1),Ma(oh,"on"+lh);var Ll,oh,lh,Bl;Ma(sg,"onAnimationEnd");Ma(cg,"onAnimationIteration");Ma(ug,"onAnimationStart");Ma("dblclick","onDoubleClick");Ma("focusin","onFocus");Ma("focusout","onBlur");Ma(Py,"onTransitionRun");Ma(Jy,"onTransitionStart");Ma(Iy,"onTransitionCancel");Ma(pg,"onTransitionEnd");un("onMouseEnter",["mouseout","mouseover"]);un("onMouseLeave",["mouseout","mouseover"]);un("onPointerEnter",["pointerout","pointerover"]);un("onPointerLeave",["pointerout","pointerover"]);di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));di("onBeforeInput",["compositionend","keypress","textInput","paste"]);di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),R1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lo));function Ib(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,p=l.currentTarget;if(l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(m){ss(m)}i.currentTarget=null,n=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(m){ss(m)}i.currentTarget=null,n=c}}}}function ye(e,t){var a=t[Ou];a===void 0&&(a=t[Ou]=new Set);var r=e+"__bubble";a.has(r)||(Fb(t,e,2,!1),a.add(r))}function Su(e,t,a){var r=0;t&&(r|=4),Fb(a,e,r,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function dd(e){if(!e[Hl]){e[Hl]=!0,Yh.forEach(function(a){a!=="selectionchange"&&(R1.has(a)||Su(a,!1,e),Su(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,Su("selectionchange",!1,t))}}function Fb(e,t,a,r){switch(pw(t)){case 2:var i=o_;break;case 8:i=l_;break;default:i=gd}a=i.bind(null,t,a,e),i=void 0,!Gu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function Nu(e,t,a,r,i){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=Vi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=n=o;continue e}l=l.parentNode}}r=r.return}Ih(function(){var p=n,m=Tp(a),g=[];e:{var d=dg.get(e);if(d!==void 0){var b=As,v=e;switch(e){case"keypress":if(Vl(a)===0)break e;case"keydown":case"keyup":b=qy;break;case"focusin":v="focus",b=ru;break;case"focusout":v="blur",b=ru;break;case"beforeblur":case"afterblur":b=ru;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=ff;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=hy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=Ty;break;case sg:case cg:case ug:b=wy;break;case pg:b=Ry;break;case"scroll":case"scrollend":b=my;break;case"wheel":b=Uy;break;case"copy":case"cut":case"paste":b=yy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=gf;break;case"toggle":case"beforetoggle":b=Oy}var E=(t&4)!==0,O=!E&&(e==="scroll"||e==="scrollend"),f=E?d!==null?d+"Capture":null:d;E=[];for(var u=p,h;u!==null;){var w=u;if(h=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||h===null||f===null||(w=To(u,f),w!=null&&E.push(Ho(u,w,h))),O)break;u=u.return}0<E.length&&(d=new b(d,v,null,a,m),g.push({event:d,listeners:E}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",d&&a!==Qu&&(v=a.relatedTarget||a.fromElement)&&(Vi(v)||v[yn]))break e;if((b||d)&&(d=m.window===m?m:(d=m.ownerDocument)?d.defaultView||d.parentWindow:window,b?(v=a.relatedTarget||a.toElement,b=p,v=v?Vi(v):null,v!==null&&(O=Yo(v),E=v.tag,v!==O||E!==5&&E!==27&&E!==6)&&(v=null)):(b=null,v=p),b!==v)){if(E=ff,w="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(E=gf,w="onPointerLeave",f="onPointerEnter",u="pointer"),O=b==null?d:mo(b),h=v==null?d:mo(v),d=new E(w,u+"leave",b,a,m),d.target=O,d.relatedTarget=h,w=null,Vi(m)===p&&(E=new E(f,u+"enter",v,a,m),E.target=h,E.relatedTarget=O,w=E),O=w,b&&v)t:{for(E=A1,f=b,u=v,h=0,w=f;w;w=E(w))h++;w=0;for(var k=u;k;k=E(k))w++;for(;0<h-w;)f=E(f),h--;for(;0<w-h;)u=E(u),w--;for(;h--;){if(f===u||u!==null&&f===u.alternate){E=f;break t}f=E(f),u=E(u)}E=null}else E=null;b!==null&&sh(g,d,b,E,!1),v!==null&&O!==null&&sh(g,O,v,E,!0)}}e:{if(d=p?mo(p):window,b=d.nodeName&&d.nodeName.toLowerCase(),b==="select"||b==="input"&&d.type==="file")var z=yf;else if(vf(d))if(rg)z=Xy;else{z=$y;var A=Yy}else b=d.nodeName,!b||b.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?p&&Mp(p.elementType)&&(z=yf):z=Vy;if(z&&(z=z(e,p))){ag(g,z,a,m);break e}A&&A(e,d,p),e==="focusout"&&p&&d.type==="number"&&p.memoizedProps.value!=null&&Hu(d,"number",d.value)}switch(A=p?mo(p):window,e){case"focusin":(vf(A)||A.contentEditable==="true")&&(Ki=A,ju=p,wo=null);break;case"focusout":wo=ju=Ki=null;break;case"mousedown":Yu=!0;break;case"contextmenu":case"mouseup":case"dragend":Yu=!1,Sf(g,a,m);break;case"selectionchange":if(Ky)break;case"keydown":case"keyup":Sf(g,a,m)}var U;if(Ap)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Zi?eg(e,a)&&(R="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(R="onCompositionStart");R&&(Wh&&a.locale!=="ko"&&(Zi||R!=="onCompositionStart"?R==="onCompositionEnd"&&Zi&&(U=Fh()):(Nr=m,zp="value"in Nr?Nr.value:Nr.textContent,Zi=!0)),A=Ns(p,R),0<A.length&&(R=new hf(R,e,null,a,m),g.push({event:R,listeners:A}),U?R.data=U:(U=tg(a),U!==null&&(R.data=U)))),(U=Ly?Hy(e,a):Qy(e,a))&&(R=Ns(p,"onBeforeInput"),0<R.length&&(A=new hf("onBeforeInput","beforeinput",null,a,m),g.push({event:A,listeners:R}),A.data=U)),z1(g,e,p,a,m)}Ib(g,t)})}function Ho(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ns(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,n=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||n===null||(i=To(e,a),i!=null&&r.unshift(Ho(e,i,n)),i=To(e,t),i!=null&&r.push(Ho(e,i,n))),e.tag===3)return r;e=e.return}return[]}function A1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sh(e,t,a,r,i){for(var n=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,p=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||p===null||(c=p,i?(p=To(a,n),p!=null&&o.unshift(Ho(a,p,c))):i||(p=To(a,n),p!=null&&o.push(Ho(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var U1=/\r\n?/g,D1=/\u0000|\uFFFD/g;function ch(e){return(typeof e=="string"?e:""+e).replace(U1,`
9
+ `).replace(D1,"")}function Wb(e,t){return t=ch(t),ch(e)===t}function Qe(e,t,a,r,i,n){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||pn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&pn(e,""+r);break;case"className":El(e,"class",r);break;case"tabIndex":El(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":El(e,a,r);break;case"style":Jh(e,r,n);break;case"data":if(t!=="object"){El(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Yl(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(a==="formAction"?(t!=="input"&&Qe(e,t,"name",i.name,i,null),Qe(e,t,"formEncType",i.formEncType,i,null),Qe(e,t,"formMethod",i.formMethod,i,null),Qe(e,t,"formTarget",i.formTarget,i,null)):(Qe(e,t,"encType",i.encType,i,null),Qe(e,t,"method",i.method,i,null),Qe(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Yl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=ar);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Q(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(Q(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Yl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":ye("beforetoggle",e),ye("toggle",e),jl(e,"popover",r);break;case"xlinkActuate":Ka(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ka(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ka(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ka(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ka(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ka(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":jl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=py.get(a)||a,jl(e,a,r))}}function mp(e,t,a,r,i,n){switch(a){case"style":Jh(e,r,n);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Q(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(Q(60));e.innerHTML=a}}break;case"children":typeof r=="string"?pn(e,r):(typeof r=="number"||typeof r=="bigint")&&pn(e,""+r);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ar);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$h.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),n=e[Pt]||null,n=n!=null?n[a]:null,typeof n=="function"&&e.removeEventListener(t,n,i),typeof r=="function")){typeof n!="function"&&n!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,i);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):jl(e,a,r)}}}function zt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("load",e);var r=!1,i=!1,n;for(n in a)if(a.hasOwnProperty(n)){var o=a[n];if(o!=null)switch(n){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Q(137,t));default:Qe(e,t,n,o,a,null)}}i&&Qe(e,t,"srcSet",a.srcSet,a,null),r&&Qe(e,t,"src",a.src,a,null);return;case"input":ye("invalid",e);var l=n=o=i=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var m=a[r];if(m!=null)switch(r){case"name":i=m;break;case"type":o=m;break;case"checked":c=m;break;case"defaultChecked":p=m;break;case"value":n=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(Q(137,t));break;default:Qe(e,t,r,m,a,null)}}Zh(e,n,l,c,p,o,i,!1);return;case"select":ye("invalid",e),r=o=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Qe(e,t,i,l,a,null)}t=n,a=o,e.multiple=!!r,t!=null?an(e,!!r,t,!1):a!=null&&an(e,!!r,a,!0);return;case"textarea":ye("invalid",e),n=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Q(91));break;default:Qe(e,t,o,l,a,null)}Ph(e,r,i,n);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Qe(e,t,c,r,a,null));return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(r=0;r<Lo.length;r++)ye(Lo[r],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(p in a)if(a.hasOwnProperty(p)&&(r=a[p],r!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(Q(137,t));default:Qe(e,t,p,r,a,null)}return;default:if(Mp(t)){for(m in a)a.hasOwnProperty(m)&&(r=a[m],r!==void 0&&mp(e,t,m,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&Qe(e,t,l,r,a,null))}function O1(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,n=null,o=null,l=null,c=null,p=null,m=null;for(b in a){var g=a[b];if(a.hasOwnProperty(b)&&g!=null)switch(b){case"checked":break;case"value":break;case"defaultValue":c=g;default:r.hasOwnProperty(b)||Qe(e,t,b,null,r,g)}}for(var d in r){var b=r[d];if(g=a[d],r.hasOwnProperty(d)&&(b!=null||g!=null))switch(d){case"type":n=b;break;case"name":i=b;break;case"checked":p=b;break;case"defaultChecked":m=b;break;case"value":o=b;break;case"defaultValue":l=b;break;case"children":case"dangerouslySetInnerHTML":if(b!=null)throw Error(Q(137,t));break;default:b!==g&&Qe(e,t,d,b,r,g)}}Lu(e,o,l,c,p,m,n,i);return;case"select":b=o=l=d=null;for(n in a)if(c=a[n],a.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":b=c;default:r.hasOwnProperty(n)||Qe(e,t,n,null,r,c)}for(i in r)if(n=r[i],c=a[i],r.hasOwnProperty(i)&&(n!=null||c!=null))switch(i){case"value":d=n;break;case"defaultValue":l=n;break;case"multiple":o=n;default:n!==c&&Qe(e,t,i,n,r,c)}t=l,a=o,r=b,d!=null?an(e,!!a,d,!1):!!r!=!!a&&(t!=null?an(e,!!a,t,!0):an(e,!!a,a?[]:"",!1));return;case"textarea":b=d=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Qe(e,t,l,null,r,i)}for(o in r)if(i=r[o],n=a[o],r.hasOwnProperty(o)&&(i!=null||n!=null))switch(o){case"value":d=i;break;case"defaultValue":b=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(Q(91));break;default:i!==n&&Qe(e,t,o,i,r,n)}Kh(e,d,b);return;case"option":for(var v in a)d=a[v],a.hasOwnProperty(v)&&d!=null&&!r.hasOwnProperty(v)&&(v==="selected"?e.selected=!1:Qe(e,t,v,null,r,d));for(c in r)d=r[c],b=a[c],r.hasOwnProperty(c)&&d!==b&&(d!=null||b!=null)&&(c==="selected"?e.selected=d&&typeof d!="function"&&typeof d!="symbol":Qe(e,t,c,d,r,b));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var E in a)d=a[E],a.hasOwnProperty(E)&&d!=null&&!r.hasOwnProperty(E)&&Qe(e,t,E,null,r,d);for(p in r)if(d=r[p],b=a[p],r.hasOwnProperty(p)&&d!==b&&(d!=null||b!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(Q(137,t));break;default:Qe(e,t,p,d,r,b)}return;default:if(Mp(t)){for(var O in a)d=a[O],a.hasOwnProperty(O)&&d!==void 0&&!r.hasOwnProperty(O)&&mp(e,t,O,void 0,r,d);for(m in r)d=r[m],b=a[m],!r.hasOwnProperty(m)||d===b||d===void 0&&b===void 0||mp(e,t,m,d,r,b);return}}for(var f in a)d=a[f],a.hasOwnProperty(f)&&d!=null&&!r.hasOwnProperty(f)&&Qe(e,t,f,null,r,d);for(g in r)d=r[g],b=a[g],!r.hasOwnProperty(g)||d===b||d==null&&b==null||Qe(e,t,g,d,r,b)}function uh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],n=i.transferSize,o=i.initiatorType,l=i.duration;if(n&&l&&uh(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var m=c.transferSize,g=c.initiatorType;m&&uh(g)&&(c=c.responseEnd,o+=m*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(n+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var fp=null,hp=null;function Cs(e){return e.nodeType===9?e:e.ownerDocument}function ph(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ew(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function gp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cu=null;function L1(){var e=window.event;return e&&e.type==="popstate"?e===Cu?!1:(Cu=e,!0):(Cu=null,!1)}var tw=typeof setTimeout=="function"?setTimeout:void 0,H1=typeof clearTimeout=="function"?clearTimeout:void 0,dh=typeof Promise=="function"?Promise:void 0,Q1=typeof queueMicrotask=="function"?queueMicrotask:typeof dh<"u"?function(e){return dh.resolve(null).then(e).catch(G1)}:tw;function G1(e){setTimeout(function(){throw e})}function Yr(e){return e==="head"}function mh(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),vn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Eo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Eo(a);for(var n=a.firstChild;n;){var o=n.nextSibling,l=n.nodeName;n[Zo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&n.rel.toLowerCase()==="stylesheet"||a.removeChild(n),n=o}}else a==="body"&&Eo(e.ownerDocument.body);a=i}while(a);vn(t)}function fh(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function bp(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":bp(a),Ep(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function j1(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Zo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=va(e.nextSibling),e===null)break}return null}function Y1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=va(e.nextSibling),e===null))return null;return e}function aw(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=va(e.nextSibling),e===null))return null;return e}function wp(e){return e.data==="$?"||e.data==="$~"}function vp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function va(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var yp=null;function hh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return va(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function gh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function rw(e,t,a){switch(t=Cs(a),e){case"html":if(e=t.documentElement,!e)throw Error(Q(452));return e;case"head":if(e=t.head,!e)throw Error(Q(453));return e;case"body":if(e=t.body,!e)throw Error(Q(454));return e;default:throw Error(Q(451))}}function Eo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ep(e)}var ya=new Map,bh=new Set;function qs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=Ue.d;Ue.d={f:V1,r:X1,D:Z1,C:K1,L:P1,m:J1,X:F1,S:I1,M:W1};function V1(){var e=dr.f(),t=$s();return e||t}function X1(e){var t=_n(e);t!==null&&t.tag===5&&t.type==="form"?Jg(t):dr.r(e)}var Nn=typeof document>"u"?null:document;function iw(e,t,a){var r=Nn;if(r&&typeof t=="string"&&t){var i=ha(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),bh.has(i)||(bh.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),zt(t,"link",e),xt(t),r.head.appendChild(t)))}}function Z1(e){dr.D(e),iw("dns-prefetch",e,null)}function K1(e,t){dr.C(e,t),iw("preconnect",e,t)}function P1(e,t,a){dr.L(e,t,a);var r=Nn;if(r&&e&&t){var i='link[rel="preload"][as="'+ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ha(a.imageSizes)+'"]')):i+='[href="'+ha(e)+'"]';var n=i;switch(t){case"style":n=wn(e);break;case"script":n=Cn(e)}ya.has(n)||(e=Ie({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ya.set(n,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Wo(n))||t==="script"&&r.querySelector(el(n))||(t=r.createElement("link"),zt(t,"link",e),xt(t),r.head.appendChild(t)))}}function J1(e,t){dr.m(e,t);var a=Nn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ha(r)+'"][href="'+ha(e)+'"]',n=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Cn(e)}if(!ya.has(n)&&(e=Ie({rel:"modulepreload",href:e},t),ya.set(n,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(el(n)))return}r=a.createElement("link"),zt(r,"link",e),xt(r),a.head.appendChild(r)}}}function I1(e,t,a){dr.S(e,t,a);var r=Nn;if(r&&e){var i=tn(r).hoistableStyles,n=wn(e);t=t||"default";var o=i.get(n);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Wo(n)))l.loading=5;else{e=Ie({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ya.get(n))&&md(e,a);var c=o=r.createElement("link");xt(c),zt(c,"link",e),c._p=new Promise(function(p,m){c.onload=p,c.onerror=m}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Wl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(n,o)}}}function F1(e,t){dr.X(e,t);var a=Nn;if(a&&e){var r=tn(a).hoistableScripts,i=Cn(e),n=r.get(i);n||(n=a.querySelector(el(i)),n||(e=Ie({src:e,async:!0},t),(t=ya.get(i))&&fd(e,t),n=a.createElement("script"),xt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function W1(e,t){dr.M(e,t);var a=Nn;if(a&&e){var r=tn(a).hoistableScripts,i=Cn(e),n=r.get(i);n||(n=a.querySelector(el(i)),n||(e=Ie({src:e,async:!0,type:"module"},t),(t=ya.get(i))&&fd(e,t),n=a.createElement("script"),xt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function wh(e,t,a,r){var i=(i=Mr.current)?qs(i):null;if(!i)throw Error(Q(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=wn(a.href),a=tn(i).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=wn(a.href);var n=tn(i).hoistableStyles,o=n.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=i.querySelector(Wo(e)))&&!n._p&&(o.instance=n,o.state.loading=5),ya.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ya.set(e,a),n||e_(i,e,a,o.state))),t&&r===null)throw Error(Q(528,""));return o}if(t&&r!==null)throw Error(Q(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Cn(a),a=tn(i).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(Q(444,e))}}function wn(e){return'href="'+ha(e)+'"'}function Wo(e){return'link[rel="stylesheet"]['+e+"]"}function nw(e){return Ie({},e,{"data-precedence":e.precedence,precedence:null})}function e_(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),zt(t,"link",a),xt(t),e.head.appendChild(t))}function Cn(e){return'[src="'+ha(e)+'"]'}function el(e){return"script[async]"+e}function vh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ha(a.href)+'"]');if(r)return t.instance=r,xt(r),r;var i=Ie({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),xt(r),zt(r,"style",i),Wl(r,a.precedence,e),t.instance=r;case"stylesheet":i=wn(a.href);var n=e.querySelector(Wo(i));if(n)return t.state.loading|=4,t.instance=n,xt(n),n;r=nw(a),(i=ya.get(i))&&md(r,i),n=(e.ownerDocument||e).createElement("link"),xt(n);var o=n;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),t.state.loading|=4,Wl(n,a.precedence,e),t.instance=n;case"script":return n=Cn(a.src),(i=e.querySelector(el(n)))?(t.instance=i,xt(i),i):(r=a,(i=ya.get(n))&&(r=Ie({},a),fd(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),xt(i),zt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(Q(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Wl(r,a.precedence,e));return t.instance}function Wl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,n=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)n=l;else if(n!==i)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function fd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var es=null;function yh(e,t,a){if(es===null){var r=new Map,i=es=new Map;i.set(a,r)}else i=es,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var n=a[i];if(!(n[Zo]||n[Et]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(n):r.set(o,[n])}}return r}function _h(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function t_(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ow(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a_(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=wn(r.href),n=t.querySelector(Wo(i));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Es.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=n,xt(n);return}n=t.ownerDocument||t,r=nw(r),(i=ya.get(i))&&md(r,i),n=n.createElement("link"),xt(n);var o=n;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),a.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Es.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var qu=0;function r_(e,t){return e.stylesheets&&e.count===0&&ts(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&qu===0&&(qu=62500*B1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>qu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ts(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ms=null;function ts(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ms=new Map,t.forEach(i_,e),Ms=null,Es.call(e))}function i_(e,t){if(!(t.state.loading&4)){var a=Ms.get(e);if(a)var r=a.get(null);else{a=new Map,Ms.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<i.length;n++){var o=i[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),n=a.get(o)||r,n===r&&a.set(null,i),a.set(o,i),this.count++,r=Es.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),n?n.parentNode.insertBefore(i,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qo={$$typeof:tr,Provider:null,Consumer:null,_currentValue:ai,_currentValue2:ai,_threadCount:0};function n_(e,t,a,r,i,n,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Wc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wc(0),this.hiddenUpdates=Wc(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function lw(e,t,a,r,i,n,o,l,c,p,m,g){return e=new n_(e,t,a,o,c,p,m,g,l),t=1,n===!0&&(t|=24),n=aa(3,null,null,t),e.current=n,n.stateNode=e,t=Qp(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:r,isDehydrated:a,cache:t},Yp(n),e}function sw(e){return e?(e=Ii,e):Ii}function cw(e,t,a,r,i,n){i=sw(i),r.context===null?r.context=i:r.pendingContext=i,r=zr(t),r.payload={element:a},n=n===void 0?null:n,n!==null&&(r.callback=n),a=Rr(e,r,t),a!==null&&(Kt(a,e,t),yo(a,e,t))}function xh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function hd(e,t){xh(e,t),(e=e.alternate)&&xh(e,t)}function uw(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Kt(t,e,67108864),hd(e,67108864)}}function kh(e){if(e.tag===13||e.tag===31){var t=la();t=Cp(t);var a=hi(e,t);a!==null&&Kt(a,e,t),hd(e,t)}}var Ts=!0;function o_(e,t,a,r){var i=se.T;se.T=null;var n=Ue.p;try{Ue.p=2,gd(e,t,a,r)}finally{Ue.p=n,se.T=i}}function l_(e,t,a,r){var i=se.T;se.T=null;var n=Ue.p;try{Ue.p=8,gd(e,t,a,r)}finally{Ue.p=n,se.T=i}}function gd(e,t,a,r){if(Ts){var i=_p(r);if(i===null)Nu(e,t,r,zs,a),Sh(e,r);else if(c_(i,e,t,a,r))r.stopPropagation();else if(Sh(e,r),t&4&&-1<s_.indexOf(e)){for(;i!==null;){var n=_n(i);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=Wr(n.pendingLanes);if(o!==0){var l=n;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-oa(o);l.entanglements[1]|=c,o&=~c}Qa(n),(Ae&6)===0&&(ys=ia()+500,Fo(0,!1))}}break;case 31:case 13:l=hi(n,2),l!==null&&Kt(l,n,2),$s(),hd(n,2)}if(n=_p(r),n===null&&Nu(e,t,r,zs,a),n===i)break;i=n}i!==null&&r.stopPropagation()}else Nu(e,t,r,null,a)}}function _p(e){return e=Tp(e),bd(e)}var zs=null;function bd(e){if(zs=null,e=Vi(e),e!==null){var t=Yo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Th(t),e!==null)return e;e=null}else if(a===31){if(e=zh(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zs=e,null}function pw(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(P0()){case Dh:return 2;case Oh:return 8;case os:case J0:return 32;case Bh:return 268435456;default:return 32}default:return 32}}var xp=!1,Dr=null,Or=null,Br=null,Go=new Map,jo=new Map,kr=[],s_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Sh(e,t){switch(e){case"focusin":case"focusout":Dr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Br=null;break;case"pointerover":case"pointerout":Go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jo.delete(t.pointerId)}}function so(e,t,a,r,i,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[i]},t!==null&&(t=_n(t),t!==null&&uw(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function c_(e,t,a,r,i){switch(t){case"focusin":return Dr=so(Dr,e,t,a,r,i),!0;case"dragenter":return Or=so(Or,e,t,a,r,i),!0;case"mouseover":return Br=so(Br,e,t,a,r,i),!0;case"pointerover":var n=i.pointerId;return Go.set(n,so(Go.get(n)||null,e,t,a,r,i)),!0;case"gotpointercapture":return n=i.pointerId,jo.set(n,so(jo.get(n)||null,e,t,a,r,i)),!0}return!1}function dw(e){var t=Vi(e.target);if(t!==null){var a=Yo(t);if(a!==null){if(t=a.tag,t===13){if(t=Th(a),t!==null){e.blockedOn=t,lf(e.priority,function(){kh(a)});return}}else if(t===31){if(t=zh(a),t!==null){e.blockedOn=t,lf(e.priority,function(){kh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function as(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=_p(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Qu=r,a.target.dispatchEvent(r),Qu=null}else return t=_n(a),t!==null&&uw(t),e.blockedOn=a,!1;t.shift()}return!0}function Nh(e,t,a){as(e)&&a.delete(t)}function u_(){xp=!1,Dr!==null&&as(Dr)&&(Dr=null),Or!==null&&as(Or)&&(Or=null),Br!==null&&as(Br)&&(Br=null),Go.forEach(Nh),jo.forEach(Nh)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,xp||(xp=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,u_)))}var Gl=null;function Ch(e){Gl!==e&&(Gl=e,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,function(){Gl===e&&(Gl=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(bd(r||a)===null)continue;break}var n=_n(a);n!==null&&(e.splice(t,3),t-=3,ap(n,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function vn(e){function t(c){return Ql(c,e)}Dr!==null&&Ql(Dr,e),Or!==null&&Ql(Or,e),Br!==null&&Ql(Br,e),Go.forEach(t),jo.forEach(t);for(var a=0;a<kr.length;a++){var r=kr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kr.length&&(a=kr[0],a.blockedOn===null);)dw(a),a.blockedOn===null&&kr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],n=a[r+1],o=i[Pt]||null;if(typeof n=="function")o||Ch(a);else if(o){var l=null;if(n&&n.hasAttribute("formAction")){if(i=n,o=n[Pt]||null)l=o.formAction;else if(bd(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),Ch(a)}}}function mw(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function wd(e){this._internalRoot=e}Zs.prototype.render=wd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));var a=t.current,r=la();cw(a,r,e,t,null,null)};Zs.prototype.unmount=wd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cw(e.current,2,null,e,null,null),$s(),t[yn]=null}};function Zs(e){this._internalRoot=e}Zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=jh();e={blockedOn:null,target:e,priority:t};for(var a=0;a<kr.length&&t!==0&&t<kr[a].priority;a++);kr.splice(a,0,e),a===0&&dw(e)}};var qh=Eh.version;if(qh!=="19.2.3")throw Error(Q(527,qh,"19.2.3"));Ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=j0(t),e=e!==null?Rh(e):null,e=e===null?null:e.stateNode,e};var p_={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(co=__REACT_DEVTOOLS_GLOBAL_HOOK__,!co.isDisabled&&co.supportsFiber))try{$o=co.inject(p_),na=co}catch{}var co;Ks.createRoot=function(e,t){if(!Mh(e))throw Error(Q(299));var a=!1,r="",i=ib,n=nb,o=ob;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=lw(e,1,!1,null,null,a,r,null,i,n,o,mw),e[yn]=t.current,dd(e),new wd(t)};Ks.hydrateRoot=function(e,t,a){if(!Mh(e))throw Error(Q(299));var r=!1,i="",n=ib,o=nb,l=ob,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=lw(e,1,!0,t,a??null,r,i,c,n,o,l,mw),t.context=sw(null),a=t.current,r=la(),r=Cp(r),i=zr(r),i.callback=null,Rr(a,i,r),a=r,t.current.lanes=a,Xo(t,a),Qa(t),e[yn]=t.current,dd(e),new Zs(t)};Ks.version="19.2.3"});var bw=Aa((Zx,gw)=>{"use strict";function hw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hw)}catch(e){console.error(e)}}hw(),gw.exports=fw()});var dv=Aa(Fs=>{"use strict";var __=Symbol.for("react.transitional.element"),x_=Symbol.for("react.fragment");function pv(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:__,type:e,key:r,ref:t!==void 0?t:null,props:a}}Fs.Fragment=x_;Fs.jsx=pv;Fs.jsxs=pv});var F=Aa((_2,mv)=>{"use strict";mv.exports=dv()});var u0=$(bw());var ww=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles\r
10
10
  the host page. Start new selectors with :where(.app-wrapper), which scopes without\r
11
11
  adding specificity, or with .app-wrapper for rules on the root itself. */\r
12
12
  \r
@@ -6967,13 +6967,13 @@ Error generating stack: `+r.message+`
6967
6967
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);\r
6968
6968
  }\r
6969
6969
  }\r
6970
- `;var De=$(He());var Ps={};function wv(e){Ps={...e,client:e.client?.trim().toUpperCase()||void 0}}function Ot(){return Ps}function yd(){return!!Ps.apiBaseUrl}var m_=e=>e.replace(/\/$/,"");function za(e){let t=Ps.apiBaseUrl;return t?`${m_(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var En=$(He());var f_="metron:step",h_="metron_step",tl=(0,En.createContext)(()=>{}),Mn=()=>(0,En.useContext)(tl);function Js(e,t){return(0,En.useCallback)((a,r={})=>{let i=Ot(),n=i.analytics??"all";if(n==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(f_,{detail:o,bubbles:!0,composed:!0})),i.onEvent?.(o);let l=window.dataLayer;n==="all"&&Array.isArray(l)&&l.push({event:h_,...o})},[e,t])}var yv="boq-session-id",_v="x-boq-session";function xv(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(yv);return e||(e=crypto.randomUUID(),window.localStorage.setItem(yv,e)),e}catch{return crypto.randomUUID()}}var g_="x-boq-client";function Is(){return Ot().client}function Tn(){let{client:e,apiKey:t}=Ot();return yd()?t?{Authorization:`Bearer ${t}`}:{}:e?{[g_]:e}:{}}function bi(){return{...yd()?{}:{[_v]:xv()},...Tn()}}function b_(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function ja(e){return b_(await e.json().catch(()=>({})))}var kv=9e4;async function Sv(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),kv),i;try{i=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${kv/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let n=await ja(i);if(!i.ok||n?.error){let o=n;throw new Error(o.detail??o.message??o.error??`Server error ${i.status}`)}return n}function Nv(e,t,a=!0){let r=new FormData;return r.append("file",e),t?.length&&r.append("provided_lines_json",JSON.stringify(t)),a||r.append("archive_source","false"),Sv(za("/api/schedule"),{method:"POST",body:r,headers:bi()})}function Cv(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return Sv(za(`/api/schedule/${e}${a}`),{headers:Tn()})}function qv(e,t,a,r){let i=!1,n=null,o=performance.now();return{promise:new Promise((p,m)=>{let g=async()=>{if(!i)try{let d=await e();if(i)return;if(d.status==="completed"||d.status==="failed"){console.log(`[pollJob:${r??"job"}] ${d.status} (${Math.round(performance.now()-o)}ms)`),p(d);return}a?.(),n=setTimeout(g,t)}catch(d){i||m(d)}};n=setTimeout(g,t)}),cancel:()=>{i=!0,n&&(clearTimeout(n),n=null)}}}var St=$(He());var Ev=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var Mv=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var Tv=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var zv=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var Rv=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var Av=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var Uv=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var Dv=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var Ov=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var Bv=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var Lv=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var Hv=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var Qv=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var Gv=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var jv=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var Yv=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var $v=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var Vv=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var Xv=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var Zv=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var Kv=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var Pv=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var Jv=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Iv=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Fv=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var Wv=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var ew=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var tw=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var aw=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var rw=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var iw=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var nw=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var ow=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Me=e=>typeof e=="string"?e:e.src,v_={"/decking/boards/diagonal.webp":Me(Ev),"/decking/boards/no-border.webp":Me(Mv),"/decking/boards/picture-frame.webp":Me(Tv),"/decking/boards/straight.webp":Me(zv),"/fencing/gates/no-gate.webp":Me(Rv),"/fencing/gates/single-gate.webp":Me(Av),"/fencing/gravel-board.webp":Me(Uv),"/fencing/height/0.9.webp":Me(Dv),"/fencing/height/1.2.webp":Me(Ov),"/fencing/height/1.5.webp":Me(Bv),"/fencing/height/1.8.webp":Me(Lv),"/fencing/no-gravel-board.webp":Me(Hv),"/quick-order/paste-list.webp":Me(Qv),"/quick-order/photo-list.webp":Me(Gv),"/quick-order/upload-file.webp":Me(jv),"/schedule-products/building-sand.webp":Me(Yv),"/schedule-products/drywall-screws.webp":Me($v),"/schedule-products/loft-insulation-roll.webp":Me(Vv),"/schedule-products/red-multi-stock-bricks.webp":Me(Xv),"/schedule-products/scrim-tape.webp":Me(Zv),"/schedule-products/wall-ties.webp":Me(Kv),"/tool-images/architrave.webp":Me(Pv),"/tool-images/brick-block.webp":Me(Jv),"/tool-images/concrete-aggregate.webp":Me(Iv),"/tool-images/decking.webp":Me(Fv),"/tool-images/fencing.webp":Me(Wv),"/tool-images/insulation.webp":Me(ew),"/tool-images/paint.webp":Me(tw),"/tool-images/paving.webp":Me(aw),"/tool-images/plasterboard.webp":Me(rw),"/tool-images/skirting.webp":Me(iw),"/tool-images/timber.webp":Me(nw),"/tool-images/truss.webp":Me(ow)};function It(e){return v_[e]??e}var zn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var sw=(e,t)=>zn[t].some(a=>e.toLowerCase().endsWith(a)),Rn=e=>e.type.startsWith("image/")||sw(e.name,"photo"),w_=e=>Rn(e)||sw(e.name,"schedule"),lw=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function _d(e,t=5242880){return w_(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${lw(e.size)} - the limit is ${lw(t)}.`:null:`Please upload a list or image file (${[...zn.schedule,...zn.photo].join(", ")}).`}var y_=e=>e.split(`
6971
- `).map(t=>t.trim()).filter(Boolean);function cw(e){let t=y_(e);if(t.length>500)return`That's ${t.length} lines - the limit is 500. Split the list and match it in parts.`;if(e.length>5e4)return`That's ${e.length.toLocaleString("en-GB")} characters - the limit is ${5e4.toLocaleString("en-GB")}. Split the list and match it in parts.`;let a=t.findIndex(r=>r.length>500);return a>=0?`Line ${a+1} is ${t[a].length} characters - keep each item on its own line (max 500).`:null}async function uw(e){if(e.size<=5242880)return e;let t;try{t=await createImageBitmap(e)}catch{return e}let a=Math.min(1,2e3/Math.max(t.width,t.height)),r=document.createElement("canvas");r.width=Math.round(t.width*a),r.height=Math.round(t.height*a);let i=r.getContext("2d");if(!i)return e;i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),i.drawImage(t,0,0,r.width,r.height),t.close();let n=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!n||n.size>=e.size?e:new File([n],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var Vr=$(He());var ec=$(He()),Ws=$(F()),k_=[4,5,4],xd=4e3;function vi(){let[e,t]=(0,ec.useState)(0);(0,ec.useEffect)(()=>{let r=setInterval(()=>t(i=>i+1),xd);return()=>clearInterval(r)},[]);let a=0;return(0,Ws.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:k_.map((r,i)=>(0,Ws.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(n,o)=>(0,Ws.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},i))},e)}var al=$(F()),tc=["Measuring twice, quoting once","Counting bricks so you don't have to","Haggling with the price of timber","Adding a bit extra for the skip","Double-checking nobody ordered too much sand","Rounding up, obviously","Making sure the numbers add up better than the last lot did","Checking if copper pipe is still worth its weight in gold","Squeezing a bit more accuracy out of the numbers","Totting it all up on the back of a fag packet, digitally","Making sure the quote is tighter than your tolerances","Nearly there, unlike most site schedules","Working out if it'll all fit on one pallet","Double-checking the VAT, because someone has to","Giving the calculator a proper workout","Making sure nothing's out of stock before you get excited"];function fw(e){let t=[...e];for(let a=t.length-1;a>0;a--){let r=Math.floor(Math.random()*(a+1));[t[a],t[r]]=[t[r],t[a]]}return t}function hw(){let e=(0,Vr.useRef)(0),t=(0,Vr.useRef)(fw(tc.map((o,l)=>l))),[a,r]=(0,Vr.useState)(tc[t.current[0]]),[i,n]=(0,Vr.useState)(!0);return(0,Vr.useEffect)(()=>{let o=setInterval(()=>{n(!1),window.setTimeout(()=>{e.current++,e.current>=t.current.length&&(t.current=fw(tc.map((l,c)=>c)),e.current=0),r(tc[t.current[e.current]]),n(!0)},600)},xd);return()=>clearInterval(o)},[]),(0,al.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,al.jsx)(vi,{}),(0,al.jsx)("p",{className:`banter-message${i?" is-visible":""}`,children:a})]})}var ac=$(He());function rl(e,t){let a=(0,ac.useRef)(t);a.current=t,(0,ac.useEffect)(()=>{if(!e)return;let r=i=>{i.key!=="Escape"||i.defaultPrevented||i.isComposing||(i.preventDefault(),a.current())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}var kd={"#quote-entry":"entry","#matched-products":"results","#quote-request":"basket"},gw=!1,ic="",Sd=!1,bw=()=>window.navigation,rc=-1;function S_(){if(Sd)return-1;let e=bw()?.currentEntry?.index;return e==null||rc<0||e===rc?0:e<rc?-1:1}function N_(e){let t=new URL(ic||window.location.href),a=new URL(window.location.href);if(ic=a.href,t.pathname!==a.pathname||t.search!==a.search||!(t.hash in kd)&&!(a.hash in kd))return;let r=t.href===a.href?S_():0;if(r){e.stopImmediatePropagation(),window.history.go(r);return}Sd=!1;let i=e.state;Object.defineProperty(e,"state",{value:null}),setTimeout(()=>{if(window.location.href!==a.href)return;let n=kd[a.hash],o=n&&i?.turbo?{boqQuoteStage:n}:i;JSON.stringify(window.history.state)!==JSON.stringify(o)&&window.history.replaceState(o,"",a.href)})}function vw(){gw||typeof window>"u"||(gw=!0,ic=window.location.href,window.addEventListener("popstate",N_,{capture:!0}),bw()?.addEventListener("currententrychange",e=>{rc=e.from?.index??-1}))}function An(e,t,a){window.history[e](t,"",a),ic=window.location.href}function nc(){Sd=!0,window.history.back()}var Nd=$(F());function Qt(){return(0,Nd.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Nd.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Cd=$(F());function il(){return(0,Cd.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Cd.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var P=$(F()),C_=[...zn.schedule,...zn.photo].join(","),q_={paste:[{title:"Paste List",desc:"Paste your material list straight from a spreadsheet or document."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}],upload:[{title:"Upload File",desc:"Upload a photo, spreadsheet, Word document or PDF."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}]},Un="#quote-entry",oc="metron-quick-quote-entry";function qd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a,draft:r,onSubmitDraft:i,onCancelMatch:n}){let o=(0,St.useRef)(null),l=Mn(),c=(0,St.useRef)(0),p=(0,St.useRef)(0),[m,g]=(0,St.useState)(()=>r&&typeof window<"u"&&window.location.hash===Un?r.tab:null),[d,b]=(0,St.useState)(r?.text??""),[v,E]=(0,St.useState)(r?.file??null),[O,f]=(0,St.useState)(""),[u,h]=(0,St.useState)(!1),[w,S]=(0,St.useState)(!1),[z,A]=(0,St.useState)(null),U=d.split(`
6972
- `).filter(Z=>Z.trim()).length,R=cw(d),H=m==="paste"?!!d:!!v;(0,St.useEffect)(()=>{if(!v||!Rn(v)){A(null);return}let Z=URL.createObjectURL(v);return A(Z),()=>URL.revokeObjectURL(Z)},[v]);let oe=(0,St.useRef)(m??r?.tab??null);m&&(oe.current=m),(0,St.useEffect)(()=>{if(r||window.location.hash!==Un)return;let Z=null;try{Z=JSON.parse(window.sessionStorage.getItem(oc)??"null")}catch{}if(!Z?.tab){let ge=new URL(window.location.href);ge.hash="",An("replaceState",window.history.state,ge);return}oe.current=Z.tab,g(Z.tab),b(Z.text??"")},[]),(0,St.useEffect)(()=>{if(m)try{window.sessionStorage.setItem(oc,JSON.stringify({tab:m,text:d}))}catch{}},[m,d]),(0,St.useEffect)(()=>{let Z=()=>{if(window.location.hash===Un)return g(oe.current);g(null),p.current++,h(!1),n?.()};return window.addEventListener("popstate",Z),()=>window.removeEventListener("popstate",Z)},[]);let Te=Z=>{l("method_selected",{method:Z}),g(Z),a(null);let ge=window.location.hash;if(ge===Un)return;let Re=new URL(window.location.href);Re.hash=Un,An(ge==="#matched-products"||ge==="#quote-request"?"replaceState":"pushState",{boqQuoteStage:"entry"},Re)},je=()=>{g(null),a(null),window.location.hash===Un&&nc()};rl(!!m&&!u,je);let Ve=Z=>{if(!Z?.length)return;if(Z.length>1)return f("Please choose one file at a time.");let ge=Z[0],Re=_d(ge,Rn(ge)?1/0:void 0);if(Re)return f(Re);f(""),E(ge)},Ne=async Z=>{m==="paste"&&E(null),m==="upload"&&b(""),m&&i?.({tab:m,text:m==="paste"?d:"",file:m==="upload"?v:null});let ge=++p.current;h(!0);try{await Z()}finally{ge===p.current&&h(!1)}},ve=()=>{if(v)return l("list_submitted",{method:Rn(v)?"photo":"upload"}),Ne(async()=>{if(!Rn(v))return t(v);try{let Z=await uw(v),ge=_d(Z);if(ge)throw new Error(ge);await t(Z)}catch(Z){l("error",{stage:"photo"}),f(Z?.message||"Failed to process image upload")}})},le=Z=>Z.dataTransfer.types.includes("Files"),Fe=Z=>{le(Z)&&(Z.preventDefault(),c.current+=1,S(!0))},Ee=Z=>{le(Z)&&(c.current-=1,c.current<=0&&(c.current=0,S(!1)))},Nt=Z=>{le(Z)&&(Z.preventDefault(),c.current=0,S(!1),Ve(Z.dataTransfer.files),Te("upload"))};return(0,P.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:Fe,onDragOver:Z=>le(Z)&&Z.preventDefault(),onDragLeave:Ee,onDrop:Nt,children:[w&&(0,P.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,P.jsxs)("div",{className:"quick-order-card",children:[(0,P.jsxs)("div",{className:"quick-order-alt",children:[(0,P.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,P.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,P.jsx)("p",{className:"quick-order-alt-intro",children:"Upload a file or type a list of items and quantities. We'll match them to our products and help you build a quote."})]}),(0,P.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,P.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${m==="paste"?" entry-option-card--active":""}`,onClick:()=>Te("paste"),children:[(0,P.jsxs)("span",{className:"entry-option-content",children:[(0,P.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,P.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,P.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,P.jsx)("img",{className:"fill-img",src:It("/quick-order/paste-list.webp"),alt:""})})]}),(0,P.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${m==="upload"?" entry-option-card--active":""}`,onClick:()=>Te("upload"),children:[(0,P.jsxs)("span",{className:"entry-option-content",children:[(0,P.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,P.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,P.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,P.jsx)("img",{className:"fill-img",src:It("/quick-order/photo-list.webp"),alt:""})})]})]})]}),m&&(0,P.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!H&&je(),children:(0,P.jsxs)("section",{className:`quick-order-workflow-modal${u?" quick-order-workflow-modal--matching":""}`,onClick:Z=>Z.stopPropagation(),children:[(0,P.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,P.jsx)("h2",{id:"quick-order-workflow-title",children:m==="paste"?"Type or paste a list":"Upload a file"}),(0,P.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:je,"aria-label":"Close",children:(0,P.jsx)(il,{})})]}),(0,P.jsxs)("div",{className:"quick-order-panel",children:[(0,P.jsxs)("div",{className:"quick-order-body","aria-hidden":u,children:[(0,P.jsx)("div",{className:"quick-order-body-main",children:m==="paste"?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
6970
+ `;var De=$(He());var Ps={};function vw(e){Ps={...e,client:e.client?.trim().toUpperCase()||void 0}}function Ot(){return Ps}function vd(){return!!Ps.apiBaseUrl}var m_=e=>e.replace(/\/$/,"");function Ta(e){let t=Ps.apiBaseUrl;return t?`${m_(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var qn=$(He());var f_="metron:step",h_="metron_step",tl=(0,qn.createContext)(()=>{}),En=()=>(0,qn.useContext)(tl);function Js(e,t){return(0,qn.useCallback)((a,r={})=>{let i=Ot(),n=i.analytics??"all";if(n==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(f_,{detail:o,bubbles:!0,composed:!0})),i.onEvent?.(o);let l=window.dataLayer;n==="all"&&Array.isArray(l)&&l.push({event:h_,...o})},[e,t])}var yw="boq-session-id",_w="x-boq-session";function xw(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(yw);return e||(e=crypto.randomUUID(),window.localStorage.setItem(yw,e)),e}catch{return crypto.randomUUID()}}var g_="x-boq-client";function Is(){return Ot().client}function Mn(){let{client:e,apiKey:t}=Ot();return vd()?t?{Authorization:`Bearer ${t}`}:{}:e?{[g_]:e}:{}}function bi(){return{...vd()?{}:{[_w]:xw()},...Mn()}}function b_(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Ga(e){return b_(await e.json().catch(()=>({})))}var kw=9e4;async function Sw(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),kw),i;try{i=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${kw/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let n=await Ga(i);if(!i.ok||n?.error){let o=n;throw new Error(o.detail??o.message??o.error??`Server error ${i.status}`)}return n}function Nw(e,t,a=!0){let r=new FormData;return r.append("file",e),t?.length&&r.append("provided_lines_json",JSON.stringify(t)),a||r.append("archive_source","false"),Sw(Ta("/api/schedule"),{method:"POST",body:r,headers:bi()})}function Cw(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return Sw(Ta(`/api/schedule/${e}${a}`),{headers:Mn()})}function qw(e,t,a,r){let i=!1,n=null,o=performance.now();return{promise:new Promise((p,m)=>{let g=async()=>{if(!i)try{let d=await e();if(i)return;if(d.status==="completed"||d.status==="failed"){console.log(`[pollJob:${r??"job"}] ${d.status} (${Math.round(performance.now()-o)}ms)`),p(d);return}a?.(),n=setTimeout(g,t)}catch(d){i||m(d)}};n=setTimeout(g,t)}),cancel:()=>{i=!0,n&&(clearTimeout(n),n=null)}}}var St=$(He());var Ew=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var Mw=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var Tw=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var zw=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var Rw=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var Aw=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var Uw=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var Dw=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var Ow=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var Bw=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var Lw=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var Hw=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var Qw=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var Gw=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var jw=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var Yw=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var $w=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var Vw=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var Xw=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var Zw=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var Kw=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var Pw=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var Jw=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Iw=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Fw=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var Ww=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var ev=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var tv=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var av=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var rv=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var iv=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var nv=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var ov=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Me=e=>typeof e=="string"?e:e.src,w_={"/decking/boards/diagonal.webp":Me(Ew),"/decking/boards/no-border.webp":Me(Mw),"/decking/boards/picture-frame.webp":Me(Tw),"/decking/boards/straight.webp":Me(zw),"/fencing/gates/no-gate.webp":Me(Rw),"/fencing/gates/single-gate.webp":Me(Aw),"/fencing/gravel-board.webp":Me(Uw),"/fencing/height/0.9.webp":Me(Dw),"/fencing/height/1.2.webp":Me(Ow),"/fencing/height/1.5.webp":Me(Bw),"/fencing/height/1.8.webp":Me(Lw),"/fencing/no-gravel-board.webp":Me(Hw),"/quick-order/paste-list.webp":Me(Qw),"/quick-order/photo-list.webp":Me(Gw),"/quick-order/upload-file.webp":Me(jw),"/schedule-products/building-sand.webp":Me(Yw),"/schedule-products/drywall-screws.webp":Me($w),"/schedule-products/loft-insulation-roll.webp":Me(Vw),"/schedule-products/red-multi-stock-bricks.webp":Me(Xw),"/schedule-products/scrim-tape.webp":Me(Zw),"/schedule-products/wall-ties.webp":Me(Kw),"/tool-images/architrave.webp":Me(Pw),"/tool-images/brick-block.webp":Me(Jw),"/tool-images/concrete-aggregate.webp":Me(Iw),"/tool-images/decking.webp":Me(Fw),"/tool-images/fencing.webp":Me(Ww),"/tool-images/insulation.webp":Me(ev),"/tool-images/paint.webp":Me(tv),"/tool-images/paving.webp":Me(av),"/tool-images/plasterboard.webp":Me(rv),"/tool-images/skirting.webp":Me(iv),"/tool-images/timber.webp":Me(nv),"/tool-images/truss.webp":Me(ov)};function It(e){return w_[e]??e}var Tn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var sv=(e,t)=>Tn[t].some(a=>e.toLowerCase().endsWith(a)),zn=e=>e.type.startsWith("image/")||sv(e.name,"photo"),v_=e=>zn(e)||sv(e.name,"schedule"),lv=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function yd(e,t=5242880){return v_(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${lv(e.size)} - the limit is ${lv(t)}.`:null:`Please upload a list or image file (${[...Tn.schedule,...Tn.photo].join(", ")}).`}var y_=e=>e.split(`
6971
+ `).map(t=>t.trim()).filter(Boolean);function cv(e){let t=y_(e);if(t.length>500)return`That's ${t.length} lines - the limit is 500. Split the list and match it in parts.`;if(e.length>5e4)return`That's ${e.length.toLocaleString("en-GB")} characters - the limit is ${5e4.toLocaleString("en-GB")}. Split the list and match it in parts.`;let a=t.findIndex(r=>r.length>500);return a>=0?`Line ${a+1} is ${t[a].length} characters - keep each item on its own line (max 500).`:null}async function uv(e){if(e.size<=5242880)return e;let t;try{t=await createImageBitmap(e)}catch{return e}let a=Math.min(1,2e3/Math.max(t.width,t.height)),r=document.createElement("canvas");r.width=Math.round(t.width*a),r.height=Math.round(t.height*a);let i=r.getContext("2d");if(!i)return e;i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),i.drawImage(t,0,0,r.width,r.height),t.close();let n=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!n||n.size>=e.size?e:new File([n],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var $r=$(He());var ec=$(He()),Ws=$(F()),k_=[4,5,4],_d=4e3;function wi(){let[e,t]=(0,ec.useState)(0);(0,ec.useEffect)(()=>{let r=setInterval(()=>t(i=>i+1),_d);return()=>clearInterval(r)},[]);let a=0;return(0,Ws.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:k_.map((r,i)=>(0,Ws.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(n,o)=>(0,Ws.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},i))},e)}var al=$(F()),tc=["Measuring twice, quoting once","Counting bricks so you don't have to","Haggling with the price of timber","Adding a bit extra for the skip","Double-checking nobody ordered too much sand","Rounding up, obviously","Making sure the numbers add up better than the last lot did","Checking if copper pipe is still worth its weight in gold","Squeezing a bit more accuracy out of the numbers","Totting it all up on the back of a fag packet, digitally","Making sure the quote is tighter than your tolerances","Nearly there, unlike most site schedules","Working out if it'll all fit on one pallet","Double-checking the VAT, because someone has to","Giving the calculator a proper workout","Making sure nothing's out of stock before you get excited"];function fv(e){let t=[...e];for(let a=t.length-1;a>0;a--){let r=Math.floor(Math.random()*(a+1));[t[a],t[r]]=[t[r],t[a]]}return t}function hv(){let e=(0,$r.useRef)(0),t=(0,$r.useRef)(fv(tc.map((o,l)=>l))),[a,r]=(0,$r.useState)(tc[t.current[0]]),[i,n]=(0,$r.useState)(!0);return(0,$r.useEffect)(()=>{let o=setInterval(()=>{n(!1),window.setTimeout(()=>{e.current++,e.current>=t.current.length&&(t.current=fv(tc.map((l,c)=>c)),e.current=0),r(tc[t.current[e.current]]),n(!0)},600)},_d);return()=>clearInterval(o)},[]),(0,al.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,al.jsx)(wi,{}),(0,al.jsx)("p",{className:`banter-message${i?" is-visible":""}`,children:a})]})}var ac=$(He());function rl(e,t){let a=(0,ac.useRef)(t);a.current=t,(0,ac.useEffect)(()=>{if(!e)return;let r=i=>{i.key!=="Escape"||i.defaultPrevented||i.isComposing||(i.preventDefault(),a.current())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}var xd={"#quote-entry":"entry","#matched-products":"results","#quote-request":"basket"},gv=!1,ic="",kd=!1,bv=()=>window.navigation,rc=-1;function S_(){if(kd)return-1;let e=bv()?.currentEntry?.index;return e==null||rc<0||e===rc?0:e<rc?-1:1}function N_(e){let t=new URL(ic||window.location.href),a=new URL(window.location.href);if(ic=a.href,t.pathname!==a.pathname||t.search!==a.search||!(t.hash in xd)&&!(a.hash in xd))return;let r=t.href===a.href?S_():0;if(r){e.stopImmediatePropagation(),window.history.go(r);return}kd=!1;let i=e.state;Object.defineProperty(e,"state",{value:null}),setTimeout(()=>{if(window.location.href!==a.href)return;let n=xd[a.hash],o=n&&i?.turbo?{boqQuoteStage:n}:i;JSON.stringify(window.history.state)!==JSON.stringify(o)&&window.history.replaceState(o,"",a.href)})}function wv(){gv||typeof window>"u"||(gv=!0,ic=window.location.href,window.addEventListener("popstate",N_,{capture:!0}),bv()?.addEventListener("currententrychange",e=>{rc=e.from?.index??-1}))}function Rn(e,t,a){window.history[e](t,"",a),ic=window.location.href}function nc(){kd=!0,window.history.back()}var Sd=$(F());function Qt(){return(0,Sd.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Sd.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Nd=$(F());function il(){return(0,Nd.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Nd.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var J=$(F()),C_=[...Tn.schedule,...Tn.photo].join(","),q_={paste:[{title:"Paste List",desc:"Paste your material list straight from a spreadsheet or document."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}],upload:[{title:"Upload File",desc:"Upload a photo, spreadsheet, Word document or PDF."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}]},An="#quote-entry",oc="metron-quick-quote-entry";function Cd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a,draft:r,onSubmitDraft:i,onCancelMatch:n}){let o=(0,St.useRef)(null),l=En(),c=(0,St.useRef)(0),p=(0,St.useRef)(0),[m,g]=(0,St.useState)(()=>r&&typeof window<"u"&&window.location.hash===An?r.tab:null),[d,b]=(0,St.useState)(r?.text??""),[v,E]=(0,St.useState)(r?.file??null),[O,f]=(0,St.useState)(""),[u,h]=(0,St.useState)(!1),[w,k]=(0,St.useState)(!1),[z,A]=(0,St.useState)(null),U=d.split(`
6972
+ `).filter(Z=>Z.trim()).length,R=cv(d),H=m==="paste"?!!d:!!v;(0,St.useEffect)(()=>{if(!v||!zn(v)){A(null);return}let Z=URL.createObjectURL(v);return A(Z),()=>URL.revokeObjectURL(Z)},[v]);let oe=(0,St.useRef)(m??r?.tab??null);m&&(oe.current=m),(0,St.useEffect)(()=>{if(r||window.location.hash!==An)return;let Z=null;try{Z=JSON.parse(window.sessionStorage.getItem(oc)??"null")}catch{}if(!Z?.tab){let ge=new URL(window.location.href);ge.hash="",Rn("replaceState",window.history.state,ge);return}oe.current=Z.tab,g(Z.tab),b(Z.text??"")},[]),(0,St.useEffect)(()=>{if(m)try{window.sessionStorage.setItem(oc,JSON.stringify({tab:m,text:d}))}catch{}},[m,d]),(0,St.useEffect)(()=>{let Z=()=>{if(window.location.hash===An)return g(oe.current);g(null),p.current++,h(!1),n?.()};return window.addEventListener("popstate",Z),()=>window.removeEventListener("popstate",Z)},[]);let Te=Z=>{l("method_selected",{method:Z}),g(Z),a(null);let ge=window.location.hash;if(ge===An)return;let Re=new URL(window.location.href);Re.hash=An,Rn(ge==="#matched-products"||ge==="#quote-request"?"replaceState":"pushState",{boqQuoteStage:"entry"},Re)},je=()=>{g(null),a(null),window.location.hash===An&&nc()};rl(!!m&&!u,je);let Ve=Z=>{if(!Z?.length)return;if(Z.length>1)return f("Please choose one file at a time.");let ge=Z[0],Re=yd(ge,zn(ge)?1/0:void 0);if(Re)return f(Re);f(""),E(ge)},Ne=async Z=>{m==="paste"&&E(null),m==="upload"&&b(""),m&&i?.({tab:m,text:m==="paste"?d:"",file:m==="upload"?v:null});let ge=++p.current;h(!0);try{await Z()}finally{ge===p.current&&h(!1)}},we=()=>{if(v)return l("list_submitted",{method:zn(v)?"photo":"upload"}),Ne(async()=>{if(!zn(v))return t(v);try{let Z=await uv(v),ge=yd(Z);if(ge)throw new Error(ge);await t(Z)}catch(Z){l("error",{stage:"photo"}),f(Z?.message||"Failed to process image upload")}})},le=Z=>Z.dataTransfer.types.includes("Files"),Fe=Z=>{le(Z)&&(Z.preventDefault(),c.current+=1,k(!0))},Ee=Z=>{le(Z)&&(c.current-=1,c.current<=0&&(c.current=0,k(!1)))},Nt=Z=>{le(Z)&&(Z.preventDefault(),c.current=0,k(!1),Ve(Z.dataTransfer.files),Te("upload"))};return(0,J.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:Fe,onDragOver:Z=>le(Z)&&Z.preventDefault(),onDragLeave:Ee,onDrop:Nt,children:[w&&(0,J.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,J.jsxs)("div",{className:"quick-order-card",children:[(0,J.jsxs)("div",{className:"quick-order-alt",children:[(0,J.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,J.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,J.jsx)("p",{className:"quick-order-alt-intro",children:"Upload a file or type a list of items and quantities. We'll match them to our products and help you build a quote."})]}),(0,J.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,J.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${m==="paste"?" entry-option-card--active":""}`,onClick:()=>Te("paste"),children:[(0,J.jsxs)("span",{className:"entry-option-content",children:[(0,J.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,J.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,J.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,J.jsx)("img",{className:"fill-img",src:It("/quick-order/paste-list.webp"),alt:""})})]}),(0,J.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${m==="upload"?" entry-option-card--active":""}`,onClick:()=>Te("upload"),children:[(0,J.jsxs)("span",{className:"entry-option-content",children:[(0,J.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,J.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,J.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,J.jsx)("img",{className:"fill-img",src:It("/quick-order/photo-list.webp"),alt:""})})]})]})]}),m&&(0,J.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!H&&je(),children:(0,J.jsxs)("section",{className:`quick-order-workflow-modal${u?" quick-order-workflow-modal--matching":""}`,onClick:Z=>Z.stopPropagation(),children:[(0,J.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,J.jsx)("h2",{id:"quick-order-workflow-title",children:m==="paste"?"Type or paste a list":"Upload a file"}),(0,J.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:je,"aria-label":"Close",children:(0,J.jsx)(il,{})})]}),(0,J.jsxs)("div",{className:"quick-order-panel",children:[(0,J.jsxs)("div",{className:"quick-order-body","aria-hidden":u,children:[(0,J.jsx)("div",{className:"quick-order-body-main",children:m==="paste"?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
6973
6973
  insulated plasterboard 50mm
6974
- C24 timber 4.8m`,value:d,onChange:Z=>b(Z.target.value),"aria-label":"Paste schedule line items"}),R&&(0,P.jsxs)("div",{className:"error-box",role:"alert",children:[(0,P.jsx)("strong",{children:"Error:"})," ",R]}),(0,P.jsxs)("div",{className:"quick-order-hint",children:[(0,P.jsx)("strong",{children:"Tip:"}),'\xA0Paste one line per item. Include a count, e.g. "x10", to help us find the right stock and pricing.']}),(0,P.jsx)("div",{className:"quick-order-actions",children:(0,P.jsxs)("button",{type:"button",className:"cta-btn",disabled:!U||!!R,onClick:()=>{l("list_submitted",{method:"paste",lines:U}),Ne(()=>e(d))},"aria-label":"Match pasted lines",children:[(0,P.jsx)("span",{children:"Match line items"}),(0,P.jsx)("span",{className:"arrow",children:(0,P.jsx)(Qt,{})})]})})]}):(0,P.jsxs)(P.Fragment,{children:[O&&(0,P.jsxs)("div",{className:"error-box",role:"alert",children:[(0,P.jsx)("strong",{children:"Error:"})," ",O]}),(0,P.jsxs)("div",{className:`upload-zone${v?" has-file":""}`,onClick:()=>o.current?.click(),onDragOver:Z=>Z.preventDefault(),onDrop:Nt,role:"button",tabIndex:0,onKeyDown:Z=>(Z.key==="Enter"||Z.key===" ")&&o.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[z?(0,P.jsx)("img",{src:z,alt:v?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,P.jsx)("div",{className:"upload-zone-icon",children:(0,P.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,P.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,P.jsx)("polyline",{points:"14,2 14,8 20,8"}),(0,P.jsx)("polyline",{points:"9,15 11,17 15,13"})]})}),v?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"upload-zone-subtext",children:v.name}),(0,P.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:Z=>{Z.stopPropagation(),E(null),f(""),o.current&&(o.current.value="")},children:"Remove"})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,P.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,P.jsx)("input",{ref:o,type:"file",accept:C_,className:"visually-hidden",onChange:Z=>Ve(Z.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,P.jsx)("div",{className:"quick-order-actions",children:(0,P.jsxs)("button",{type:"button",className:"cta-btn",disabled:!v,onClick:()=>{ve()},"aria-label":"Match uploaded items",children:[(0,P.jsx)("span",{children:"Match items"}),(0,P.jsx)("span",{className:"arrow",children:(0,P.jsx)(Qt,{})})]})})]})}),(0,P.jsx)("aside",{className:"quick-order-sidebar",children:q_[m].map((Z,ge)=>(0,P.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,P.jsx)("span",{className:"quick-order-step-dot",children:ge+1}),(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{className:"quick-order-step-title",children:Z.title}),(0,P.jsx)("div",{className:"quick-order-step-desc",children:Z.desc})]})]},Z.title))})]}),u&&(0,P.jsx)("div",{className:"quick-order-matching-overlay",children:(0,P.jsx)(hw,{})})]})]})})]})]})}var Rt=$(He()),yw=$(F());function Dn(e){return JSON.stringify([e.productId,e.qty,e.unit,e.linkedContext??[]])}function E_(e,t){let a={...e,[t.lineId]:t};for(let[r,i]of Object.entries(a)){if(!i.linkedContext)continue;let n=i.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=n?.line_id?a[n.line_id]:void 0;if(!(!n||!o||n.product_id===o.productId&&n.description===o.description)){if(i.conversionType!=="basket_line_unit"){a[r]={...i,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...i,qty:0,sellUnitsOverride:null,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var Ed=(0,Rt.createContext)(null);function lc({children:e,onOpenBasket:t}){let[a,r]=(0,Rt.useState)({}),i=(0,Rt.useCallback)(d=>{r(b=>E_(b,d))},[]),n=(0,Rt.useCallback)(d=>{r(b=>{let v={...b};for(let E of d)v[E.lineId]=E;return v})},[]),o=(0,Rt.useCallback)(d=>{r(b=>{let v={...b};return delete v[d],v})},[]),l=(0,Rt.useCallback)((d,b)=>{r(v=>v[d]?{...v,[d]:{...v[d],qty:b,sellUnitsOverride:null}}:v)},[]),c=(0,Rt.useCallback)((d,b)=>{r(v=>v[d]?{...v,[d]:{...v[d],sellUnitsOverride:b}}:v)},[]),p=(0,Rt.useCallback)(d=>{r(b=>{let v=!1,E={...b};for(let[O,f]of Object.entries(d))E[O]&&(E[O]={...E[O],...f},v=!0);return v?E:b})},[]),m=(0,Rt.useCallback)(()=>r({}),[]),g=(0,Rt.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:i,addManyToCart:n,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:m,openBasket:t??(()=>{})}),[a,i,n,o,l,c,p,m,t]);return(0,yw.jsx)(Ed.Provider,{value:g,children:e})}function On(){let e=(0,Rt.useContext)(Ed);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function ww(){return(0,Rt.useContext)(Ed)}var ft=$(He());function wi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function ot(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}var Nw=e=>(e??"").trim().toLowerCase(),M_={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",piece:"each",pieces:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Md=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),_w=new Set(["box","bag","pack","pallet","roll","set","tub"]),Td=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,zd=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,mr=e=>{let t=Nw(e);return M_[t]??t},rt=(e,t)=>{let a=mr(e),r=mr(t);return a.length>0&&a===r},xw=(e,t)=>{let a=Nw(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},T_=e=>(e??"").split(",").map(t=>mr(t)).filter(Boolean),z_=(e,t)=>{let a=T_(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||rt(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||rt(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||rt(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},kw=(e,t)=>rt(t,"pallet")?e.itemsPerPallet??null:rt(t,"pack")?e.itemsPerPack??null:rt(t,"box")?e.itemsPerBox??null:null,Sw=(e,t)=>{let a=t==="volume"?/(\d+(?:[.,]\d+)?)\s*(ml|l|ltr|ltrs|litres?|liters?)\b/i:/(\d+(?:[.,]\d+)?)\s*(kg|kgs|tonnes?)\b/i,r=e.description.match(a);if(!r)return null;let i=Number.parseFloat(r[1].replace(",","."));if(!Number.isFinite(i)||i<=0)return null;let n=r[2].toLowerCase();return t==="volume"?{ml:n==="ml"?i:i*1e3}:{g:n.startsWith("tonne")?i*1e6:i*1e3}},R_=["volume_from_description","same_unit_volume"],A_=["weight_from_description","mass_from_pack","same_unit_mass"],U_=(e,t,a)=>{if(!rt(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!rt(r[3],a))return null;let i=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(i)&&i>0?i:null};function sc(e,t){let a=e.map(r=>Ft(r,t).lineTotal);return a.some(r=>r==null)?null:a.reduce((r,i)=>r+(i??0),0)}function Ft(e,t){let a=e.qty,r=mr(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=mr(e.unit)||(a>0&&Md.has(r)?r:"-"),n=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?Md.has(r)?Math.ceil(e.sellUnitsOverride):e.sellUnitsOverride:null,p=R=>({requestedAmount:a,requestedUnit:i,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${R} Order quantity set to ${c} ${r}.`:R,costingMode:"review"});if(!Number.isFinite(a)||a<=0)return p("Quantity needs confirmation.");let m=Td(a,i),g=zd(a,i),d=rt(i,r)?null:m!=null&&!R_.includes(e.conversionType??"")?Sw(e,"volume"):g!=null&&!A_.includes(e.conversionType??"")?Sw(e,"weight"):null,b=d?.ml!=null?m:g,v=d?.ml??d?.g??null;if(b!=null&&v!=null){let R=mr(e.uoi)||r,H=d?.ml!=null?`${v/1e3} l`:`${v/1e3} kg`,oe=l?c:Math.ceil(b*(1+o)/v-1e-9);return{requestedAmount:a,requestedUnit:i,salesUnitSize:1,sellUnit:R,calculatedSellUnits:oe,requiredSellUnits:oe,unitPrice:e.price,lineTotal:e.price!=null?e.price*oe:null,calculation:`${a} ${i}${o>0?` x ${1+o}`:""} / ${H} per ${R} (from product description) = ${oe} ${R}`,costingMode:"derived"}}if(i==="sales_unit"){let R=mr(e.uoi)||r,H=l?c:xw(a*(1+o),e.roundingRule??"round_up_each");return{requestedAmount:a,requestedUnit:R,salesUnitSize:1,sellUnit:R,calculatedSellUnits:H,requiredSellUnits:H,unitPrice:e.price,lineTotal:e.price!=null?e.price*H:null,calculation:`${a} ${R}${o>0?` x ${1+o}`:""} = ${H} ${R}`,costingMode:"direct"}}if(!z_(e,i))return p("Requested unit is not supported by this catalogue conversion.");let E=null,O="review",f=e.roundingRule,u=`Quantity review required, initial request needed ${a} ${i}.`,h=1+o,w=U_(e,i,r),S=e.unitConversions?.find(R=>rt(R.requestUom,i));if(!!e.saleUnit&&(rt(i,r)||!!S||rt(i,"each")&&!_w.has(r)))if(rt(i,r))E=a*h/n,O="direct",u=`${a} ${i}${o>0?` x ${h}`:""}`;else if(S){E=a*h/S.quantityPerSaleUnit,O="derived";let R=1/S.quantityPerSaleUnit,H=Math.round(R);u=rt(r,"each")&&S.quantityPerSaleUnit<1&&Math.abs(R-H)<1e-9?`${a} ${i}${o>0?` x ${h}`:""} x ${H} per ${i}`:`${a} ${i}${o>0?` x ${h}`:""} / ${S.quantityPerSaleUnit} ${i} per ${r}`}else rt(i,"each")&&!_w.has(r)&&(E=a*h/n,O="derived",u=`${a} ${r}${o>0?` x ${h}`:""}`);else if(rt(i,r)&&n>0)E=a*h/n,O="direct",u=o>0?`${a} ${i} x ${h} / ${n} ${r} per sell unit`:`${a} ${i} / ${n} ${r} per sell unit`;else if(rt(i,"each")&&n>0&&Md.has(r))E=a*h/n,O="derived",u=o>0?`${a} each x ${h} / ${n} each per ${r}`:`${a} each / ${n} each per ${r}`;else if(kw(e,i)!=null&&n>0){let R=kw(e,i)??0;E=a*R*h/n,O="derived";let H=`${a} ${i} x ${R} each${o>0?` x ${h}`:""}`;u=n===1&&rt(r,"each")?H:`${H} / ${n} each per ${r}`}else if(w!=null)E=a*h/w,O="derived",f??(f="round_up_each"),u=`${a} m2 x ${h} / ${w} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")n>0&&(E=a*h/n,O="derived",u=`${a} ${i}${o>0?` x ${h}`:""} / ${n} ${i} per ${r}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${i}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let R=e.coverageQty??e.derivedCoverageM2??null;rt(i,"m2")&&R!=null&&R>0&&(E=a*h/R,O="derived",u=`${a} m2 x ${h} / ${R} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let R=e.coverageQty??null;rt(i,"m2")&&R!=null&&R>0?(E=a/R,O="derived",u=`${a} m2 / ${R} m2 per sell unit`):rt(i,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&n>0&&(E=a*e.itemsPerM2*h/n,O="derived",u=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${h} / ${n}`)}else if(e.conversionType==="length_from_dims"){let R=e.coverageQty??e.derivedLengthM??null;rt(i,"m")&&R!=null&&R>0&&(E=a*h/R,O="derived",u=`${a} m x ${h} / ${R} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let R=Td(a,i),H=Td(e.coverageQty??0,mr(e.coverageUom));R!=null&&H!=null&&H>0&&(E=R*h/H,O="derived",u=`${a} ${i} x ${h} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"||e.conversionType==="mass_from_pack"){let R=mr((e.coverageUom??"").split(" ")[0]),H=zd(a,i),oe=zd(e.coverageQty??0,R);H!=null&&oe!=null&&oe>0&&(E=H*h/oe,O="derived",u=`${a} ${i} x ${h} / ${e.coverageQty} ${R} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let R=e.coverageQty??null;rt(i,"m3")&&R!=null&&R>0&&(E=a/R,O="derived",u=`${a} m3 / ${R} m3 per ${r}`)}}if(E==null||!Number.isFinite(E)||E<0)return p(`Quantity review required, initial request needed ${a} ${i}.`);let A=xw(E,f),U=l?c:A;return{requestedAmount:a,requestedUnit:i,salesUnitSize:n,sellUnit:r,calculatedSellUnits:A,requiredSellUnits:U,unitPrice:e.price,lineTotal:e.price!=null&&U!=null?e.price*U:null,calculation:l?`${u} = ${A} ${r} (manually set to ${U})`:`${u} = ${U} ${r}`,costingMode:O}}var nl=$(F());function Rd({unit:e}){return(0,nl.jsx)(nl.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,nl.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Cw=$(F());function D_(e,t){return t===1||/^m\d*$/i.test(e)?e:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function xa(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?D_(r,t):r}function ka(e,t){let a=xa(e,t);return a?(0,Cw.jsx)(Rd,{unit:a}):null}function ol(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=xa(a[1]);return r?`per ${r}`:""}var qw=()=>import("./xlsx-K4MOA2QM.js"),sl=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Technical classification","Include in quote","Approval required","Approval type","Missing information","Adjudicator confidence","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],O_=sl.indexOf("Line total");function B_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.decision?.include_in_quote===!0&&e.decision.approval_required===!0?"Approval required":e.decision?.include_in_quote===!0?"Quoted":e.decision?.technical_classification==="no_suitable_candidate"?"No suitable candidate":(e.best,"No match")}async function Ew(e){let t=await qw(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),i=[sl],n=0;for(let c of e){let{item:p,best:m,qty:g,band:d,unmatchable:b,decision:v}=c,E=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),O=!b&&m?.price!=null?m.price*g:null;O!=null&&(n+=O),i.push([p.source_line_id,p.line_id,p.description_original||"(no description)",E,g,p.unit,p.procurement_intent||"-",p.procurement_aliases.join(", "),p.build_up_type,p.layer_count,p.total_required_thickness_mm,p.installation_clues.join(", "),p.system_clues.join(", "),p.component_requirements.join(", "),v?.technical_classification??"",v?.include_in_quote==null?"":v.include_in_quote?"yes":"no",v?.approval_required==null?"":v.approval_required?"yes":"no",v?.approval_type??"",v?.missing_information.join(", ")??"",v?.confidence??"",v?.reason??"",b?"-":m?.product_id??v?.selected_candidate_id??"-",b?"-":m?.description??"-",b?"-":m?.price_basis??"-",b?null:m?.price??null,O,b?"-":d,B_(c)])}i.push(Array(sl.length).fill(null));let o=Array(sl.length).fill(null);o[0]="Estimated total",o[O_]=n,i.push(o),i.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(sl.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(i);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var ll=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Mw(e,t){let a=await qw(),r=a.utils.book_new(),i=new Date().toISOString().slice(0,10),n=t?[["Account",t.name+" ("+t.id+")"],[],ll]:[ll],o=0;for(let p of e){let m=Ft(p),g=m.lineTotal;g!=null&&(o+=g),n.push([p.productId,p.description,m.costingMode,m.requestedAmount,xa(m.requestedUnit),m.salesUnitSize,xa(m.sellUnit),m.requiredSellUnits,m.unitPrice,g])}n.push(Array(ll.length).fill(null));let l=Array(ll.length).fill(null);l[0]="Estimated total",l[ll.length-1]=o,n.push(l);let c=a.utils.aoa_to_sheet(n);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${i}.xlsx`:`basket-${i}.xlsx`)}var Ad=$(F());function Xr(){return(0,Ad.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ad.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ud=$(F());function yi(){return(0,Ud.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,Ud.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var _i=$(F());function Dd(){return(0,_i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,_i.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,_i.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,_i.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,_i.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var Ya=$(F());function Od(e){return(0,Ya.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,Ya.jsx)("rect",{width:"640",height:"420",fill:"#fbf1cf"}),(0,Ya.jsx)("rect",{x:"88",y:"78",width:"432",height:"264",rx:"16",fill:"#f0c43f"}),(0,Ya.jsx)("rect",{x:"120",y:"110",width:"368",height:"200",rx:"10",fill:"#ffd95e"}),(0,Ya.jsxs)("g",{stroke:"#e2b12e",strokeWidth:"8",opacity:"0.75",children:[(0,Ya.jsx)("line",{x1:"140",y1:"140",x2:"468",y2:"140"}),(0,Ya.jsx)("line",{x1:"140",y1:"190",x2:"468",y2:"190"}),(0,Ya.jsx)("line",{x1:"140",y1:"240",x2:"468",y2:"240"})]})]})}var Zr=$(F());function Bd(e){return(0,Zr.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,Zr.jsx)("rect",{width:"640",height:"420",fill:"#edf1f5"}),(0,Zr.jsx)("rect",{x:"132",y:"108",width:"376",height:"204",rx:"18",fill:"#d5dde6"}),(0,Zr.jsx)("rect",{x:"168",y:"144",width:"304",height:"24",rx:"12",fill:"#9aa6b2"}),(0,Zr.jsx)("rect",{x:"168",y:"188",width:"250",height:"24",rx:"12",fill:"#aab5c0"}),(0,Zr.jsx)("rect",{x:"168",y:"232",width:"220",height:"24",rx:"12",fill:"#aab5c0"})]})}var Ld=$(F()),L_=[{match:["building sand"],path:"/schedule-products/building-sand.webp"},{match:["drywall screw"],path:"/schedule-products/drywall-screws.webp"},{match:["scrim"],path:"/schedule-products/scrim-tape.webp"},{match:["loft insulation","loft roll"],path:"/schedule-products/loft-insulation-roll.webp"},{match:["wall tie"],path:"/schedule-products/wall-ties.webp"},{match:["red multi","multi stock","brick"],path:"/schedule-products/red-multi-stock-bricks.webp"}];function Ra({description:e,photoUrl:t,className:a,width:r,height:i}){let n=(e||"").toLowerCase(),o=L_.find(p=>p.match.some(m=>n.includes(m))),l=t||o&&It(o.path);if(l)return(0,Ld.jsx)("img",{className:a,src:l,alt:"",width:r,height:i});let c=n.includes("insulation")?Od:Bd;return(0,Ld.jsx)(c,{className:a,width:r,height:i})}var M=$(F()),Tw=.2,cl=10,zw="Enter a valid email address so we can send your quote.",H_=(e,t)=>{let a=`${t.requestedAmount} ${xa(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${xa(t.sellUnit,t.requiredSellUnits??0)}`,i=e.unitConversions?.find(n=>n.requestUom===t.requestedUnit);return i&&i.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/i.quantityPerSaleUnit)} ${xa(t.sellUnit,2)} per ${xa(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},Q_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${xa(e.sellUnit,1)}.`;function ul({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:i,onBack:n,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,ft.useId)(),m=Mn(),g=!c&&Is()==="QZA6-MRA4",d=!c,b=Object.values(e),v=(0,ft.useRef)(new Map),[E,O]=(0,ft.useState)(""),[f,u]=(0,ft.useState)(!1),[h,w]=(0,ft.useState)(!1),[S,z]=(0,ft.useState)(""),[A,U]=(0,ft.useState)({}),[R,H]=(0,ft.useState)({}),[oe,Te]=(0,ft.useState)(1),[je,Ve]=(0,ft.useState)({}),[Ne,ve]=(0,ft.useState)(!1),[le,Fe]=(0,ft.useState)("0"),[Ee,Nt]=(0,ft.useState)({});(0,ft.useEffect)(()=>{if(!r)return;for(let D of Object.values(e))Ft(D).requiredSellUnits!=null&&v.current.delete(D.lineId);let _=Object.values(e).filter(D=>{if(D.productId==="-"||Ft(D).requiredSellUnits!=null)return!1;let V=Dn(D);return v.current.get(D.lineId)===V?!1:(v.current.set(D.lineId,V),!0)});if(_.length===0)return;let q=new Map(_.map(D=>[D.lineId,Dn(D)]));Nt(D=>({...D,...Object.fromEntries(q)})),fetch(za("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Tn()},body:JSON.stringify({lines:_.map(D=>({line_id:D.lineId,product_id:D.productId,requested_description:D.requestedDescription??D.description,requested_qty:D.qty,requested_uom:D.unit||null,linked_context:D.linkedContext??[],selected_description:D.description,selected_uoi:D.uoi,selected_uoi_count:D.uoiCount,selected_conversion:{sales_uom_normalised:D.salesUomNormalised,conversion_type:D.conversionType,sales_unit_size:D.salesUnitSize,sales_unit_size_uom:D.salesUnitSizeUom,coverage_qty:D.coverageQty,coverage_uom:D.coverageUom}}))})}).then(D=>D.ok?ja(D):null).then(D=>{let V={},N=new Map(_.map(L=>[L.lineId,Dn(L)]));for(let L of D?.data?.items??D?.items??[]){let X=L?.conversion;!X||typeof L?.line_id!="string"||v.current.get(L.line_id)!==N.get(L.line_id)||(V[L.line_id]={conversionConfidence:X.conversion_confidence,conversionNotes:X.conversion_notes,...Number.isFinite(X.suggested_order_qty)&&X.suggested_order_qty>0?{sellUnitsOverride:X.suggested_order_qty}:{}})}Object.keys(V).length>0&&r(V)}).catch(D=>console.error("Catalogue conversion resolution failed",D)).finally(()=>{Nt(D=>{let V={...D};for(let[N,L]of q)V[N]===L&&delete V[N];return V})})},[e,r]);function Z(_){U(q=>{let D={...q};return delete D[_],D})}function ge(_,q){let D=parseFloat(q);!isNaN(D)&&D>=0&&t(_,Math.min(D,1e5)),Z(_)}function Re(_,q,D){t(_,Math.min(1e5,Math.max(0,q+D))),Z(_)}function bt(_){H(q=>{let D={...q};return delete D[_],D})}function jt(_,q){let D=parseFloat(q);!isNaN(D)&&D>=0&&a(_,Math.min(D,1e5)),bt(_)}function Ct(_,q,D){a(_,Math.min(1e5,Math.max(0,q+D))),bt(_)}async function vt(){if(be.some(({pricing:q})=>q.lineTotal==null)){z(g?"Confirm the highlighted quantities before requesting a quote.":"Confirm the highlighted quantities before sending your basket.");return}let _=E.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(_)){z(zw);return}z(""),w(!0);try{let q=await fetch(za("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Tn()},body:JSON.stringify({email:_,items:be.map(({item:D,pricing:V})=>{let N=V.requiredSellUnits??V.requestedAmount,L=V.requiredSellUnits!=null?V.sellUnit:V.requestedUnit;return{product_id:D.productId,description:D.description,quantity:N,unit:xa(L,N),unit_price:V.requiredSellUnits!=null?V.unitPrice:null,line_total:V.lineTotal}})})});if(!q.ok){let D=await ja(q);console.error("Quote request failed",q.status,D?.message),z(q.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}T!=null&&m("quote_requested",{items:be.length,total:Math.round(T*100)/100}),u(!0),l?.(),window.scrollTo(0,0)}catch{z("Your request couldn't be sent. Check your connection and try again.")}finally{w(!1)}}let be=b.map(_=>({item:_,pricing:Ft(_,{wasteFactorEnabled:Ne,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100})})),de=sc(b,{wasteFactorEnabled:Ne,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100}),tt=de==null?null:de*Tw,T=de==null?null:de*(1+Tw),G=be.filter(({pricing:_})=>_.lineTotal==null).length,ie=Object.keys(Ee).length,ce=!!r&&b.some(_=>{if(_.productId==="-"||Ft(_).requiredSellUnits!=null)return!1;let q=Dn(_);return v.current.get(_.lineId)!==q||Ee[_.lineId]===q}),we=(0,ft.useRef)({items:be.length,...T==null?{}:{total:Math.round(T*100)/100}});(0,ft.useEffect)(()=>{m("basket_viewed",we.current)},[m]);let Ye=Math.max(1,Math.ceil(be.length/cl)),qe=Math.min(oe,Ye),k=be.slice((qe-1)*cl,qe*cl);return f?(0,M.jsx)("div",{className:"wizard-step entry-stage",children:(0,M.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,M.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,M.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,M.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,M.jsx)("h1",{children:g?"Quote requested":"Basket sent"}),g?(0,M.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,M.jsx)("strong",{children:E.trim()}),", usually within one working day."]}):(0,M.jsxs)("p",{children:["You're all done. We'll email ",(0,M.jsx)("strong",{children:E.trim()})," to confirm prices, availability and delivery, usually within one working day."]}),(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,M.jsx)("span",{children:g?"Start a new quote":"Start a new basket"})}),(0,M.jsx)("p",{className:"quote-request-sent-note",children:g?"Nothing is charged until you approve the quote.":"Nothing is charged until you approve the order."})]})}):!c&&b.length===0?(0,M.jsx)("div",{className:"wizard-step entry-stage",children:(0,M.jsxs)("div",{className:"quote-request-sent",children:[(0,M.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,M.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,M.jsx)("path",{d:"M3 9h18l-2 11H5z"}),(0,M.jsx)("path",{d:"M8 9l4-6 4 6"})]})}),(0,M.jsx)("h1",{children:g?"Your quote request is empty":"Your basket is empty"}),(0,M.jsx)("p",{children:g?"Start again with your list to build your quote.":"Start again with your list to fill your basket."}),(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,M.jsx)("span",{children:"Back to start"})})]})}):(0,M.jsx)("div",{className:`wizard-step entry-stage${g?" basket-layout--qza6-mra4":""}`,children:(0,M.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,M.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,M.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,M.jsxs)("div",{className:"basket-hero-copy",children:[g&&(0,M.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:n,children:[(0,M.jsx)(Xr,{}),(0,M.jsx)("span",{children:"Back to results"})]}),(0,M.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,M.jsx)("h1",{children:c?"Your Selection":g?"Request a quote":"Your Basket"}),c&&(0,M.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,M.jsx)("strong",{children:b.length})," ",b.length===1?"item":"items"]})]}),(0,M.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":g?"Check your items and quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary, then send us your basket."})]})]}),(0,M.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:ce?(0,M.jsxs)("div",{className:"basket-resolving",role:"status","aria-label":"Calculating order quantities",children:[(0,M.jsx)("span",{className:"basket-resolving-wheel","aria-hidden":"true"}),(0,M.jsx)("span",{children:"Calculating your quantities\u2026"})]}):b.length===0?(0,M.jsxs)("div",{className:"quick-order-history-empty",children:[(0,M.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:"\u{1F4CB}"}),(0,M.jsx)("p",{children:"Your selection is empty."}),(0,M.jsx)("p",{className:"basket-empty-hint",children:"Go back to your results and add quoted items."}),(0,M.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,M.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:n,"aria-label":"Back to results",children:(0,M.jsx)("span",{children:"Back to Results"})})})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("div",{className:"basket-layout",children:[(0,M.jsxs)("div",{className:"basket-main",children:[(0,M.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":g?"Quote request items":"Basket items",children:k.map(({item:_,pricing:q})=>{let D=A[_.lineId]??String(q.requestedAmount),V=q.requestedUnit===q.sellUnit||q.costingMode==="review",N=q.requiredSellUnits==null||q.requestedAmount!==q.requiredSellUnits||q.requestedUnit!==q.sellUnit;return(0,M.jsxs)("article",{className:"basket-card",children:[(0,M.jsxs)("div",{className:"basket-card-top",children:[(0,M.jsx)(Ra,{className:"basket-card-thumb",description:_.description,photoUrl:_.pdpPhotoUrl,width:48,height:48}),(0,M.jsxs)("div",{className:"basket-card-info",children:[(0,M.jsx)("div",{className:"bom-component-name",children:_.description}),N&&q.costingMode!=="review"&&(0,M.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Ve(L=>({...L,[_.lineId]:!L[_.lineId]})),"aria-expanded":!!je[_.lineId],children:["How we calculated this",(0,M.jsx)("span",{className:`basket-calc-toggle-chevron${je[_.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("div",{className:"basket-card-actions",children:(0,M.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>i(_.lineId),"aria-label":`Remove ${_.description}`,children:(0,M.jsx)(Dd,{})})})]}),c&&(0,M.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,M.jsxs)("dl",{className:"results-detail-grid",children:[(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Conversion type"}),(0,M.jsx)("dd",{children:_.conversionType??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Conversion confidence"}),(0,M.jsx)("dd",{children:_.conversionConfidence??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Sales unit"}),(0,M.jsx)("dd",{children:_.salesUnitSize!=null?(0,M.jsxs)(M.Fragment,{children:[_.salesUnitSize," ",ka(_.salesUnitSizeUom,_.salesUnitSize)]}):"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Coverage"}),(0,M.jsx)("dd",{children:_.coverageQty!=null?(0,M.jsxs)(M.Fragment,{children:[_.coverageQty," ",ka(_.coverageUom,_.coverageQty)]}):"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Waste factor"}),(0,M.jsx)("dd",{children:_.wasteFactorDefault??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Rounding rule"}),(0,M.jsx)("dd",{children:_.roundingRule??"-"})]})]}),_.conversionNotes&&(0,M.jsx)("p",{className:"results-rerank-note",children:_.conversionNotes})]}),q.costingMode==="review"?(0,M.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,M.jsx)("strong",{children:Ee[_.lineId]===Dn(_)?"Calculating order quantity\u2026":"Quantity needs confirmation."})," ",Q_(q)]}):N&&je[_.lineId]?(0,M.jsx)("p",{className:"basket-calc-text",children:H_(_,q)}):null,(0,M.jsxs)("div",{className:"basket-card-stats",children:[(0,M.jsxs)("div",{className:"basket-stat",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsxs)("div",{className:"basket-qty-field",children:[(0,M.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:D,disabled:V,onChange:L=>U(X=>({...X,[_.lineId]:L.target.value})),onBlur:L=>ge(_.lineId,L.target.value),onKeyDown:L=>{L.key==="Enter"&&L.target.blur()},"aria-label":`${_.description} requested quantity`}),(0,M.jsxs)("div",{className:"basket-qty-arrows",children:[(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:V,onClick:()=>Re(_.lineId,parseFloat(D)||0,1),"aria-label":`Increase ${_.description} quantity`,children:(0,M.jsx)(yi,{})}),(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:V,onClick:()=>Re(_.lineId,parseFloat(D)||0,-1),"aria-label":`Decrease ${_.description} quantity`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("span",{className:"basket-metric-unit",children:ka(q.requestedUnit,parseFloat(D)||0)})]})]}),(0,M.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsxs)("div",{className:"basket-qty-field",children:[(0,M.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:R[_.lineId]??String(q.requiredSellUnits??""),onChange:L=>H(X=>({...X,[_.lineId]:L.target.value})),onBlur:L=>jt(_.lineId,L.target.value),onKeyDown:L=>{L.key==="Enter"&&L.target.blur()},"aria-label":`${_.description} order quantity`}),(0,M.jsxs)("div",{className:"basket-qty-arrows",children:[(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>Ct(_.lineId,parseFloat(R[_.lineId]??String(q.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${_.description} order quantity`,children:(0,M.jsx)(yi,{})}),(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>Ct(_.lineId,parseFloat(R[_.lineId]??String(q.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${_.description} order quantity`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("span",{className:"basket-metric-unit",children:ka(q.sellUnit,parseFloat(R[_.lineId]??String(q.requiredSellUnits??"0"))||0)})]})]}),(0,M.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsx)("strong",{children:q.lineTotal!=null?ot(q.lineTotal):"-"}),q.lineTotal!=null&&(0,M.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},_.lineId)})}),Ye>1&&(0,M.jsxs)("div",{className:"results-pagination",children:[(0,M.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(qe-1)*cl+1,"\u2013",Math.min(qe*cl,be.length)," of ",be.length]}),(0,M.jsxs)("div",{className:"results-pagination-controls",children:[(0,M.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Te(qe-1),disabled:qe===1,children:"Previous"}),(0,M.jsxs)("span",{className:"results-pagination-page",children:["Page ",qe," of ",Ye]}),(0,M.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Te(qe+1),disabled:qe===Ye,children:"Next"})]})]})]}),(0,M.jsxs)("aside",{className:"basket-sidebar",children:[(0,M.jsx)("div",{className:"basket-sidebar-title",children:g?"Quote request summary":"Order summary"}),(0,M.jsxs)("div",{className:"basket-sidebar-row",children:[(0,M.jsx)("span",{children:g?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,M.jsx)("span",{children:de==null?"To confirm":ot(de)})]}),(0,M.jsxs)("div",{className:"basket-sidebar-row",children:[(0,M.jsx)("span",{children:"VAT (20%)"}),(0,M.jsx)("span",{children:tt==null?"To confirm":ot(tt)})]}),(0,M.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,M.jsx)("span",{children:g?"List price (inc.\xA0VAT)":"Total"}),(0,M.jsx)("span",{children:T==null?"To confirm":ot(T)})]}),!g&&(0,M.jsx)("div",{className:"basket-summary-waste",children:(0,M.jsxs)("div",{className:"basket-waste-control",children:[(0,M.jsxs)("label",{className:"basket-global-waste",children:[(0,M.jsx)("input",{type:"checkbox",checked:Ne,onChange:_=>ve(_.target.checked)}),(0,M.jsx)("span",{children:"Add waste factor"})]}),(0,M.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,M.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:le,onChange:_=>Fe(_.target.value),disabled:!Ne,"aria-label":"Waste factor percent"}),(0,M.jsx)("span",{children:"%"})]})]})}),(0,M.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:g?"Enter email for your sharper quote":d?"Your email":"Your reference (optional)"}),(0,M.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:E,onChange:_=>{O(_.target.value),d&&z("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&S===zw,"aria-describedby":d&&S?`${p}-basket-reference-error`:void 0}),d&&S&&(0,M.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:S}),d?(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{vt()},disabled:h||G>0||ie>0,"aria-busy":h,children:(0,M.jsx)("span",{children:h?"Sending\u2026":g?"Request our best quote":"Send basket"})}):(0,M.jsx)("button",{className:"cta-btn",onClick:()=>{m("downloaded",{type:"basket",items:b.length}),Mw(b)},"aria-label":"Download selection",children:(0,M.jsx)("span",{children:"Download Quote"})}),(0,M.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,M.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),g?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":d?"Sending your basket isn't an order. We'll confirm prices, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,M.jsx)("div",{className:"btn-row results-actions",children:(0,M.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:n,"aria-label":"Back to results",children:[(0,M.jsx)(Xr,{}),(0,M.jsx)("span",{children:"Back to results"})]})})]})})]})})}var xe=$(He());function Bn(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty,linkedContext:t.linkedContext}}var xi=$(F());function Qd(){return(0,xi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,xi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,xi.jsx)("path",{d:"M21 3v5h-5"}),(0,xi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,xi.jsx)("path",{d:"M3 21v-5h5"})]})}var s=$(F()),jd="__none__",pl=24,G_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function Dw(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var j_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function Y_(e,t){if(t!==jd){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id)}}function Rw(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function $_(e){return e?e.replace(/_/g," "):"not stated"}function V_({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function Hn(e,t){if(e==null)return"-";let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Yd(e){return e&&e.length>0?e.join(" x "):"-"}function X_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Ln(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Kr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}function Z_(e,t){return t>0||e==null?null:ot(e)}var Aw=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function K_(e){let t=new Map;return[...new Set(e.filter(fr).map(r=>r.linked_group_id))].forEach((r,i)=>{let n=i%26;t.set(r,{token:String.fromCharCode(65+n),bubbleStyle:Aw[i%Aw.length]})}),t}function fr(e){return!1}function Qn(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function Gd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function P_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,6),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let i=new Map(e.map(o=>[o.product_id,o])),n=r.map(o=>i.get(o)).filter(o=>o!=null);if(a&&!n.some(o=>o.product_id===a)){let o=i.get(a);o&&n.unshift(o)}return[...new Map(n.map(o=>[o.product_id,o])).values()].slice(0,6)}function cc(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function uc(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function J_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:i}){let n=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-n.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:uc(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:i})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:uc(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:uc(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:n.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:uc(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",n.length," of ",t.length," LLM calls."]})]})]})}function I_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,i)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:Yd(r.measurements_mm)}),(0,s.jsx)("td",{children:ol(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${i}`))})]})]},`${t.query}-${a}`))]})}function Uw({item:e,result:t}){let a=t?.retrieval_debug.map(i=>i.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Ln(e.procurement_aliases)],["Retrieval queries",Ln(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",Yd(e.attrs.measurements_mm)],["Stock length",X_(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",Ln(e.installation_clues)],["System clues",Ln(e.system_clues)],["Component requirements",Ln(e.component_requirements)],["Linked group",Qn(e)||"-"],["Flags",Ln(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([i,n])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:i}),(0,s.jsx)("dd",{children:n})]},i))})]})}function F_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function W_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,i])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:i})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function ex({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:i=!1,linkedGroupMeta:n}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"No automatic match:":`AI review (${t.confidence??"confidence not stated"}):`;return i?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),fr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Qn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(Uw,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Uw,{item:e,result:a}),r&&(0,s.jsx)(F_,{item:e}),r&&(0,s.jsx)(W_,{result:a}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),fr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Qn(e)]}):null]}),r&&(0,s.jsx)(I_,{queries:a?.retrieval_debug??[]})]})}function tx({item:e,candidates:t,result:a,decision:r,unmatchable:i,selectedProductId:n,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:m=!1,debugEnabled:g=!1,forceReviewNote:d=!1,linkedGroupMeta:b}){let v=m||o==="detailed",E=g&&o==="detailed",O=v||d?(0,s.jsx)(ex,{item:e,decision:r,result:a,showRetrievalDebug:E,reviewOnly:d&&!v,linkedGroupMeta:b}):null;if(i)return(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let f=p||m||o==="detailed"?t:P_(t,a,n);return(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:f.map((u,h)=>{let w=u.product_id===n;return(0,s.jsxs)("tr",{className:w?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:u.description}),(0,s.jsx)("div",{className:"results-row-meta",children:u.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:Yd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Hn(u.price,u.price_basis)}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(u.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(V_,{band:Dw(u.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(u.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:w?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:w,onChange:()=>{w?c?.():l(u)},"aria-label":w?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${h}`)})})]})]})}function $d({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:i,onGoToBasket:n,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:m=!1}){let g=!m&&Is()==="QZA6-MRA4",d=g?"quote":"basket",{results:b,lineItems:v,parseReport:E,timings:O}=e,[f,u]=(0,xe.useState)({}),h=Mn(),[w,S]=(0,xe.useState)({}),[z,A]=(0,xe.useState)({}),[U,R]=(0,xe.useState)(""),[H,oe]=(0,xe.useState)(null),[Te,je]=(0,xe.useState)(1),Ve=Ot().debug===!0,[Ne,ve]=(0,xe.useState)("simple"),[le,Fe]=(0,xe.useState)(m?"list":"tile"),[Ee,Nt]=(0,xe.useState)(!1),[Z,ge]=(0,xe.useState)(null),[Re,bt]=(0,xe.useState)(""),[jt,Ct]=(0,xe.useState)([]),[vt,be]=(0,xe.useState)(!1),[de,tt]=(0,xe.useState)(null),[T,G]=(0,xe.useState)(!1),[ie,ce]=(0,xe.useState)(null),we=(0,xe.useRef)(null),[Ye,qe]=(0,xe.useState)(new Set),[k,_]=(0,xe.useState)(new Set),[q,D]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{je(1)},[U,H,le]);let V=new Map(b.map(x=>[x.line_id,x])),N=K_(v),L=v.map(x=>{let j=V.get(x.line_id),fe=j?.decision,ct=j_(x),Ze=f[x.line_id],ea=Y_(j,Ze),Ui=a[x.line_id],w0=Ze===jd?void 0:w[x.line_id]??(Ui&&Ui.productId!==ea?.product_id?Rw(Ui):ea),Cm=ct?void 0:w0,y0=x.qty??0;return{item:x,result:j,decision:fe,unmatchable:ct,best:Cm,qty:y0,band:Dw(Cm?.scores?.overall)}}),ue=L.some(x=>!x.unmatchable&&!x.best&&!k.has(x.item.line_id))?null:sc(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),ke=0;for(let x of L){if(x.unmatchable||x.decision?.include_in_quote!==!0||!x.best)continue;let j=a[x.item.line_id];(!j||Ft(j).lineTotal==null)&&(ke+=1)}ke>0&&(ue=null);let wt=Z_(ue,ke),at=x=>!x.unmatchable&&!x.best&&x.decision?.technical_classification!=="no_suitable_candidate"&&cc(x.result).length>0,Ut=x=>x.best??cc(x.result)[0],Jr=L.filter(x=>!x.unmatchable&&!x.best).filter(x=>!k.has(x.item.line_id)),Mc=L.filter(x=>k.has(x.item.line_id)),Yt=L;if(U.trim()){let x=U.trim().toLowerCase();Yt=Yt.filter(j=>j.item.description_original?.toLowerCase().includes(x)||Ut(j)?.description?.toLowerCase().includes(x))}if(H){let x=H==="asc"?1:-1;Yt=[...Yt].sort((j,fe)=>x*(j.item.description_original||"").localeCompare(fe.item.description_original||""))}let gr=Math.max(1,Math.ceil(Yt.length/pl)),yt=Math.min(Te,gr),zi=Yt.slice((yt-1)*pl,yt*pl),vm=zi.filter(x=>!x.unmatchable&&x.best),Qx=zi.filter(x=>at(x)),Tc=zi.filter(x=>!x.unmatchable&&(x.best||at(x))),wm=zi.filter(x=>x.unmatchable||!x.best&&!at(x)),J=Z?L.find(x=>x.item.line_id===Z)??null:null,d0=!m&&!c&&!J&&Jr.length>0,Kn=(0,xe.useRef)(null),Pn=()=>{let x=we.current;if(!x)return;let{top:j,left:fe,width:ct,height:Ze}=x.getBoundingClientRect(),Ui=x.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;ce({top:j,left:fe,width:Ui?Ui-fe:ct,height:Ze})};(0,xe.useEffect)(()=>(window.addEventListener("scroll",Pn,!0),window.addEventListener("resize",Pn),()=>{window.removeEventListener("scroll",Pn,!0),window.removeEventListener("resize",Pn)})),(0,xe.useEffect)(()=>{let x=j=>{Kn.current&&!j.composedPath().includes(Kn.current)&&Kn.current.removeAttribute("open")};return document.addEventListener("click",x),()=>document.removeEventListener("click",x)},[]);let Ri=x=>{ge(x),bt("")},m0=()=>{if(!Z)return;let x=a[Z];if(x){u(j=>({...j,[Z]:x.productId})),S(j=>({...j,[Z]:Rw(x)}));return}u(j=>{let fe={...j};return delete fe[Z],fe}),S(j=>{let fe={...j};return delete fe[Z],fe})},Xa=(x=!1)=>{let j=Z?a[Z]:void 0;!x&&j&&J?.best&&j.productId!==J.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(x||m0(),ge(null),D(!1))};rl(T,()=>G(!1)),rl(!!J&&!T,()=>Xa());let f0=x=>{if(qe(j=>new Set(j).add(x)),Jr.some(j=>j.item.line_id!==x)){Xa(!0);return}p(),Xa(!0)},h0=x=>{if(zc(x),_(j=>new Set(j).add(x)),Jr.some(j=>j.item.line_id!==x)){Xa(!0);return}p(),Xa(!0)},g0=()=>{_(x=>new Set([...x,...Jr.map(j=>j.item.line_id)])),p()},ym=()=>{J?.best&&(xm(J.item.line_id,J.best),r(Jn(J)),q?f0(J.item.line_id):Xa(!0))},_m=wm.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Require Matching"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:wm.map(x=>{let{item:j,qty:fe}=x;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>Ri(j.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Kr(j,v)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},j.line_id)})})]}):null,zc=x=>{u(j=>({...j,[x]:jd})),S(j=>({...j,[x]:void 0})),A(j=>({...j,[x]:void 0})),i(x)},Rc=(x,j)=>{u(fe=>({...fe,[x]:j.product_id})),S(fe=>({...fe,[x]:j}))},xm=(x,j)=>{j.method==="catalogue_search"&&A(fe=>({...fe,[x]:j}))};function Gx(){h("downloaded",{type:"schedule",lines:L.length}),Ew(L.map(({item:x,best:j,qty:fe,band:ct,unmatchable:Ze,decision:ea})=>({item:x,best:j,qty:fe,band:ct,unmatchable:Ze,decision:ea})))}function Jn(x){let j=x.best??cc(x.result)[0];return Bn(j,{lineId:x.item.line_id,description:x.item.description_original,unit:x.item.unit,qty:x.qty,linkedContext:x.item.linked_group_role==="dependent"&&x.item.linked_group_id?v.filter(fe=>fe.linked_group_id===x.item.linked_group_id&&fe.linked_group_role==="anchor").slice(0,1).map(fe=>{let ct=a[fe.line_id];return{line_id:fe.line_id,product_id:ct?.productId??null,measurements_mm:ct?.measurementsMm??fe.attrs.measurements_mm,description:ct?.description??fe.description_original,qty:fe.qty,unit:fe.unit,role:"anchor"}}):void 0})}(0,xe.useEffect)(()=>{if(!o){for(let x of L)!x.unmatchable&&x.best&&r(Jn(x));l()}},[o]),(0,xe.useEffect)(()=>{if(!Z){Ct([]),tt(null),be(!1);return}let x=Re.trim();if(!x){Ct([]),tt(null),be(!1);return}let j=!1,fe=window.setTimeout(async()=>{try{be(!0),tt(null);let ct=await fetch(za(`/api/catalogue/search?q=${encodeURIComponent(x)}`),{headers:bi()}),Ze=await ja(ct);if(!ct.ok)throw new Error(Ze?.error||Ze?.message||"Failed to search catalogue");j||Ct(Array.isArray(Ze?.items)?Ze.items:[])}catch(ct){j||(Ct([]),tt(ct?.message||"Failed to search catalogue"))}finally{j||be(!1)}},250);return()=>{j=!0,window.clearTimeout(fe)}},[Re,Z]);let Ac=Object.keys(a).length,qa=Re.trim(),Uc=cc(J?.result),bl=J?.decision?.technical_classification==="no_suitable_candidate"||!!J&&!J.best,km=J?.decision?.technical_classification!=null,Sm=J?.decision?.reason??(bl?"No catalogue candidate found. Refine the request or search the catalogue.":null),b0=jt.map(x=>({product_id:x.product_id,description:x.description,source_list:x.source_list,price:x.price,price_basis:x.price_basis,uoi_count:x.uoi_count??null,uoi:x.uoi,pdp_photo_url:x.pdp_photo_url??null,conversion:x.conversion,measurements_mm:x.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),In=qa?b0:Uc,Ai=J?z[J.item.line_id]:void 0,Fn=!qa&&Ai&&!In.some(x=>x.product_id===Ai.product_id)?[...In,Ai]:In,Nm=(()=>{let x=Fn.slice(0,qa?12:6);return qa||!Ai||x.some(j=>j.product_id===Ai.product_id)?x:[...x,Ai]})(),vl=!!J?.best&&a[J.item.line_id]?.productId===J.best.product_id,v0=!!J?.best&&!!a[J.item.line_id]&&!vl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${m?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${m?"":" quick-order-hero--customer"}`,children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:wt??"Review quantities"})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",g?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:n,disabled:Ac===0,"aria-label":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:g?"View Quote":"View Basket"}),wt!=null&&(0,s.jsx)("strong",{children:wt})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Ve&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":Ee,onClick:()=>Nt(x=>!x),children:Ee?"Hide timings":"Show timings"})}),Ve&&Ee&&(0,s.jsx)(J_,{...O}),!g&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!J&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:0},children:(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:U,onChange:x=>R(x.target.value),"aria-label":"Search line items"}),!m&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${le==="tile"?" is-active":""}`,"aria-pressed":le==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>Fe("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${le==="list"?" is-active":""}`,"aria-pressed":le==="list","aria-label":"List view",title:"List view",onClick:()=>Fe("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),Ve&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ve(x=>x==="simple"?"detailed":"simple"),children:Ne==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Kn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:G_.map(x=>{let j=H===x.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${j?" is-active":""}`,onClick:()=>{oe(j?null:x.dir),Kn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:j?"\u2713":""}),x.label]},x.dir)})})]})]})})}),le==="tile"||J?(0,s.jsxs)(s.Fragment,{children:[J?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Xa(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:x=>x.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Xa(),"aria-label":"Close product options",children:(0,s.jsx)(il,{})}),(0,s.jsx)("div",{className:"results-review-page",children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>Xa(),children:[(0,s.jsx)(Xr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Ve&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ve(x=>x==="simple"?"detailed":"simple"),children:Ne==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:Re,onChange:x=>bt(x.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>zc(J.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)(Ra,{className:"fill-img results-review-page__image",description:Ut(J)?.description||J.item.description_original,photoUrl:Ut(J)?.pdp_photo_url})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Kr(J.item,v)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[wi(J.qty)," ",ka(J.item.unit,J.qty)]}),J.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:J.best.description}),J.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Hn(J.best.price,J.best.price_basis)}):null]}):Ut(J)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:Ut(J)?.description}),Ut(J)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Hn(Ut(J)?.price??null,Ut(J)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),fr(J.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(Gd,{meta:N.get(J.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Qn(J.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[J.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[J.item.line_id]?i(J.item.line_id):(J.best&&xm(J.item.line_id,J.best),r(Jn(J)))},disabled:!J.best,"aria-label":a[J.item.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[J.item.line_id]?"\u2713 Added":m?"+ Add to selection":`Add to ${d}`})})]})]}),vt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!vt&&de?(0,s.jsx)("div",{className:"results-empty-card",children:de}):null,!vt&&!de&&qa&&In.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!vt&&!de?(0,s.jsx)(tx,{item:J.item,candidates:In,result:J.result,decision:J.decision,unmatchable:J.unmatchable,selectedProductId:J.best?.product_id??null,detailMode:Ne,linkedGroupMeta:fr(J.item)?N.get(J.item.linked_group_id):void 0,onPick:x=>Rc(J.item.line_id,x),onClear:()=>zc(J.item.line_id),showAll:m||Ve||qa.length>0,internal:m,debugEnabled:Ve,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Kr(J.item,v)||"Original request"})]}),Sm?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:bl?"No automatic match:":"AI review:"})," ",Sm]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:bl?Uc.length>0?"Choose a product":"No suitable product found":km?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:bl?Uc.length>0?"No product was selected automatically. Review these related options before adding one.":"Search the catalogue to choose an alternative.":km?`Select the option you want to add to your ${d}.`:"Search the catalogue to choose a product."})]})}),!qa&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Nm.map(x=>{let j=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${j?" is-selected":""}`,onClick:()=>Rc(J.item.line_id,x),"aria-pressed":j,children:[(0,s.jsx)(Ra,{className:"customer-review-option__image",description:x.description,photoUrl:x.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${Hn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:j?"Selected":"Choose"})]},x.product_id)})}):null,Fn.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:Re,onChange:x=>bt(x.target.value),"aria-label":"Search catalogue"})]}),qa&&vt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,qa&&!vt&&de?(0,s.jsx)("div",{className:"results-empty-card",children:de}):null,qa&&!vt&&!de&&Fn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,qa&&!vt&&!de&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Nm.map(x=>{let j=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${j?" is-selected":""}`,onClick:()=>Rc(J.item.line_id,x),"aria-pressed":j,children:[(0,s.jsx)(Ra,{className:"customer-review-option__image",description:x.description,photoUrl:x.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${Hn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:j?"Selected":"Choose"})]},x.product_id)})}):null]}),J.best?v0?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{ym()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>i(J.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${d}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${vl?" cta-btn-secondary":""}`,onClick:()=>{vl?i(J.item.line_id):ym()},children:(0,s.jsx)("span",{children:vl?`Remove from ${d}`:`Add selected product to ${d}`})}):null,q?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>h0(J.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[Yt.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Tc.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:Tc.map(x=>{let{item:j,best:fe,qty:ct}=x,Ze=Ut(x),ea=!fe&&at(x);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>Ri(j.line_id),"aria-label":`Review match for ${Kr(j,v)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[ea||fr(j)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[fr(j)?(0,s.jsx)(Gd,{meta:N.get(j.linked_group_id)}):(0,s.jsx)("span",{}),ea?(0,s.jsx)("span",{style:{padding:"6px 10px",borderRadius:999,background:"#fef3c7",color:"#92400e",fontSize:12,fontWeight:700,lineHeight:1},children:"Partially matched"}):null]}):null,(0,s.jsx)(Ra,{className:"fill-img results-tile-card__image",description:Ze?.description||j.description_original,photoUrl:Ze?.pdp_photo_url})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Ze?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Ze.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Ze?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:ea?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Kr(j,v)}),fr(j)?(0,s.jsx)("div",{className:"results-row-meta",children:Qn(j)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[m&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ri(j.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[j.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[j.line_id]?i(j.line_id):r(Jn(x))},disabled:!Ze,"aria-label":a[j.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[j.line_id]?"\u2713 Added":m?"+ Add":`Add to ${d}`})]})]},j.line_id)})})}):null,_m]})]}):(0,s.jsxs)(s.Fragment,{children:[ie&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:ie,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),Ne==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),Ne==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:m?"Selection":g?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[Yt.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:Ne==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Tc.map(x=>{let{item:j,result:fe,decision:ct,best:Ze}=x;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>Ri(j.line_id),onMouseEnter:ea=>{we.current=ea.currentTarget,Pn()},onMouseLeave:()=>{we.current=null,ce(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Kr(j,v)}),fr(j)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(Gd,{meta:N.get(j.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Qn(j)})]}):null]}),(0,s.jsx)("td",{children:Ze?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Ze.description,children:Ze.description}),Ne==="detailed"&&ct?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[$_(ct.technical_classification),ct.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Ze?.price!=null?Hn(Ze.price,Ze.price_basis):"-"}),Ne==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[j.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:ea=>{ea.stopPropagation(),a[j.line_id]?i(j.line_id):r(Jn(x))},"aria-label":a[j.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[j.line_id]?"\u2713 Added":m?"+ Add":`Add to ${d}`})})]},j.line_id)})]})]})}),_m]}),!J&&gr>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(yt-1)*pl+1,"\u2013",Math.min(yt*pl,Yt.length)," of ",Yt.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>je(yt-1),disabled:yt===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",yt," of ",gr]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>je(yt+1),disabled:yt===gr,children:"Next"})]})]}),(E.itemCount!=null||E.headingCount!=null||E.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[E.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.itemCount})," items parsed"]}),E.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.headingCount})," headings"]}),E.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!J&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:()=>G(!0),"aria-label":"Start over",children:[(0,s.jsx)(Qd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:n,disabled:Ac===0,"aria-label":m?"View selection":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[m?"View Selection":g?"View Quote":"View Basket"," (",Ac,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})]})]}),d0&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:Jr.map(x=>{let j=Ye.has(x.item.line_id),fe=at(x);return(0,s.jsx)("div",{className:`review-gate-item${j?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{D(!0),Ri(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Kr(x.item,v)}),(0,s.jsx)("span",{children:x.decision?.reason||(fe?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:j?"Choice made":"Choose a product"})]})},x.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:g0,children:"Skip all"}),Mc.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),Mc.map(x=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{_(j=>{let fe=new Set(j);return fe.delete(x.item.line_id),fe}),D(!0),Ri(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Kr(x.item,v)}),(0,s.jsx)("span",{children:`Not added to your ${d}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},x.item.line_id))]}):null]})}),T&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",g?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>G(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{G(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var Sa=$(F()),Vd="metron-quick-quote",ax=1440*60*1e3;function pc(e){return(0,Sa.jsx)(lc,{children:(0,Sa.jsx)(rx,{...e})})}function rx({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,i]=(0,De.useState)("entry"),[n,o]=(0,De.useState)(null),[l,c]=(0,De.useState)(""),p=(0,De.useRef)(null),m=(0,De.useRef)(0),[g,d]=(0,De.useState)(0),[b,v]=(0,De.useState)(null),[E,O]=(0,De.useState)(!1),{cart:f,addToCart:u,addManyToCart:h,removeFromCart:w,updateCartQty:S,updateCartSellUnits:z,updateCartConversions:A,clearCart:U}=On(),[R,H]=(0,De.useState)(!1),[oe,Te]=(0,De.useState)(null),je=()=>{Te(null);try{window.sessionStorage.removeItem(oc)}catch{}},Ve=(0,De.useRef)(null),Ne=Js("quick-quote",Ve);(0,De.useEffect)(()=>{Ne("viewed")},[Ne]);let[ve,le]=(0,De.useState)(!1);(0,De.useEffect)(()=>{vw();let be=window.location.hash,de=null;try{de=JSON.parse(window.sessionStorage.getItem(Vd)??"null")}catch{}if(de&&!(Date.now()-(de.savedAt??0)<ax)&&(de=null),de?.scheduleResult)o("schedule"),v(de.scheduleResult),O(de.reviewGateComplete),H(de.cartSeeded),h(Object.values(de.cart)),be==="#quote-request"?i("basket"):be==="#matched-products"&&i("results");else if(be==="#matched-products"||be==="#quote-request"){let tt=new URL(window.location.href);tt.hash="",An("replaceState",window.history.state,tt)}le(!0)},[]),(0,De.useEffect)(()=>{if(ve)try{b?window.sessionStorage.setItem(Vd,JSON.stringify({savedAt:Date.now(),scheduleResult:b,reviewGateComplete:E,cartSeeded:R,cart:f})):window.sessionStorage.removeItem(Vd)}catch{}},[ve,b,E,R,f]);let Fe=(0,De.useCallback)(be=>{if(typeof window>"u")return;let de=new URL(window.location.href);de.hash=be==="basket"?"quote-request":"matched-products";let tt=be==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");An(tt?"replaceState":"pushState",{boqQuoteStage:be},de)},[]),Ee=(0,De.useRef)(!1);(0,De.useEffect)(()=>{let be=()=>{Ee.current=!1;let de=window.location.hash;de==="#quote-request"?i("basket"):de==="#matched-products"&&b?(o("schedule"),i("results")):i("entry")};return window.addEventListener("popstate",be),()=>window.removeEventListener("popstate",be)},[b]);let Nt=(0,De.useCallback)(()=>{Fe("basket"),i("basket")},[Fe]),Z=(0,De.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(Ee.current)return;Ee.current=!0,nc();return}i(b?"results":"entry")},[b]),ge=(0,De.useRef)(r);(0,De.useEffect)(()=>{ge.current!==r&&(ge.current=r,window.scrollTo(0,0))},[r]);let Re=()=>{i("entry"),o(null),c(""),d(0),v(null),O(!1),U(),H(!1),je()},bt=(0,De.useCallback)(async(be,de,tt=!0)=>{let T=++m.current;c(""),d(0);let G=0,ie=()=>{G=Math.min(G+1,3),d(G)};try{let{jobId:ce}=await Nv(be,de,tt);if(T!==m.current)return;let{promise:we,cancel:Ye}=qv(()=>Cv(ce),5e3,ie,"schedule");p.current=Ye;let qe=await we;if(qe.status==="failed"||!qe.result)throw new Error(qe.error||"Failed to process schedule");let k=qe.result.lineItems.length,_=qe.result.results.filter(q=>q.candidates.length>0).length;Ne("results_shown",{lines:k,matched:_,unmatched:k-_}),U(),H(!1),O(!1),v(qe.result),Fe("results"),i("results")}catch(ce){if(T!==m.current)return;Ne("error",{stage:"matching"}),c(ce?.message||"Failed to process schedule"),i("entry")}finally{T===m.current&&(p.current?.(),p.current=null)}},[Fe,Ne,U]),jt=(0,De.useCallback)(()=>{m.current++,p.current?.(),p.current=null},[]),Ct=(0,De.useCallback)(async(be,de,tt=!0)=>{if(!be.trim())return;o("schedule");let T=new File([be],"pasted-schedule.txt",{type:"text/plain"});await bt(T,de,tt)},[bt]),vt=(0,De.useCallback)(async be=>{o("schedule"),await bt(be)},[bt]);return(0,Sa.jsx)(tl.Provider,{value:Ne,children:(0,Sa.jsx)("div",{ref:Ve,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:Ot().theme,children:(0,Sa.jsxs)("main",{className:"main-content",children:[l&&(0,Sa.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Sa.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Sa.jsx)(qd,{onPasteSchedule:Ct,onUploadSchedule:vt,onEntryModeChange:o,draft:oe,onSubmitDraft:Te,onCancelMatch:jt}),r==="results"&&n==="schedule"&&b&&(0,Sa.jsx)($d,{scheduleResult:b,onStartOver:Re,cart:f,onAddToCart:u,onRemoveFromCart:w,onGoToBasket:Nt,cartSeeded:R,onCartSeeded:()=>H(!0),reviewGateComplete:E,onReviewGateComplete:()=>O(!0),internal:a}),r==="basket"&&(0,Sa.jsx)(ul,{cart:f,onUpdateQty:S,onUpdateSellUnits:z,onResolveConversions:A,onRemove:w,onBack:Z,onStartNewQuote:Re,onQuoteRequested:()=>{v(null),O(!1),H(!1),U(),je()},internal:a})]})})})}var Va=$(He());var Si=$(He());var Ow={"NZ4Y-ZMSQ":{"brick-block":{"brick-common":"105499","brick-engineering-red":"1654","brick-engineering-blue":"1723",block:"501","mortar-cement":"1762 cement","mortar-sand":"564 building sand"},skirting:{"skirting-chamfered":"1525","skirting-ogee":"135 primed mdf ogee","skirting-pencil-round":"892","skirting-torus":"1941"},architrave:{"architrave-ogee":"134 primed mdf ogee","architrave-pencil-round":"1896","architrave-square-edge":"118 primed mdf square","architrave-torus":"1531"},plasterboard:{standard:"1647",moisture:"11 moisture plasterboard",fire:"14 fire plasterboard",sound:"1769",screws:"131160",tape:"1766",adhesive:"108439"},paint:{"paint-emulsion":"157217"},"concrete-aggregate":{cement:"1762 cement","sharp-sand":"563",gravel:"571",mot:"569"},insulation:{"insulation-floor":"152187","insulation-ground":"442","insulation-wall":"147","insulation-roof":"442","insulation-loft":"152180"},timber:{studs:"1213",joists:"208",battens:"1729"},fencing:{"panels-boundary-0.9":"66 lap fence panel","panels-boundary-1.2":"1450","panels-boundary-1.5":"1449","panels-boundary-1.8":"1448","panels-skyline-1.8":"1475","concrete-intermediate-8":"40197","concrete-end-8":"40198","timber-post-6":"141411","timber-post-8":"1709",postcrete:"12142","gate-boundary":"1984","gate-skyline":"40002","gravel-boards":"40200"},decking:{"boards-summit":"24322",joists:"208",screws:"131079"},paving:{"surface-council":"1669","surface-raj":"12363","surface-brindle":"304","surface-charcoal":"296","surface-pea":"431","sub-base":"569",bedding:"563"}}};function dl(e,t){let a=Ow[Ot().client??""]?.[e];if(!a)return null;let r=e==="plasterboard"&&t.key==="board"?t.label.split(" ")[0].toLowerCase():t.key;return a[r]??null}function ki(e,t){let a=Ow[Ot().client??""]?.[e];return!a||t in a}function Bw(e,t){let a=t.map(r=>{let i=dl(e,r);return i?{key:r.key,productId:i.split(" ")[0],search:i,qty:r.qty,unit:r.unit}:null});return a.length>0&&a.every(Boolean)?a:null}var ee=$(F()),Lw=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],dc=e=>Number.parseFloat(e)||0,Hw=(e,t)=>dc(e)*(t==="m"?1:.3048),Xd=(e,t)=>dc(e.quantity)*(2*Hw(e.height,t)+Hw(e.width,t)),ix=()=>({quantity:"1",width:"",height:""});function nx({profile:e}){return(0,ee.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,ee.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,ee.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function Zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Si.useState)("m"),[n,o]=(0,Si.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,Si.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,m]=(0,Si.useState)([]),[g,d]=(0,Si.useState)("ogee"),[b,v]=(0,Si.useState)("2.4"),E=(S,z,A)=>{S(U=>({...U,[z]:A}))},O=Xd(n,r)+Xd(l,r)+p.reduce((S,z)=>S+Xd(z,r),0),f=dc(b)>0?Math.ceil(O/dc(b)):0,u=Lw.find(S=>S.id===g)?.label??"",h=[{key:`architrave-${g}`,label:`Architrave (${u})`,qty:O,unit:"m",query:`${u} architrave`,category:"architrave"}],w=(S,z,A,U)=>(0,ee.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,ee.jsx)("span",{children:S}),(0,ee.jsx)("input",{"aria-label":`${S} quantity`,type:"number",min:"0",step:"1",value:z.quantity,onChange:R=>A("quantity",R.target.value)}),(0,ee.jsx)("input",{"aria-label":`${S} width`,type:"number",min:"0",step:"0.01",value:z.width,onChange:R=>A("width",R.target.value)}),(0,ee.jsx)("input",{"aria-label":`${S} height`,type:"number",min:"0",step:"0.01",value:z.height,onChange:R=>A("height",R.target.value)}),U?(0,ee.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:U,children:"Remove"}):null]});return(0,ee.jsx)(ee.Fragment,{children:(0,ee.jsxs)("div",{className:"truss-estimator",children:[(0,ee.jsxs)("div",{className:"quick-order-hero",children:[(0,ee.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ee.jsx)("h1",{children:"Architrave Calculator"}),(0,ee.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,ee.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,ee.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,ee.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,ee.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,ee.jsx)("span",{children:"Units"}),(0,ee.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ee.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metres"}),(0,ee.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Feet"})]})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,ee.jsx)("span",{children:"Opening"}),(0,ee.jsx)("span",{children:"Qty"}),(0,ee.jsxs)("span",{children:["Width (",r,")"]}),(0,ee.jsxs)("span",{children:["Height (",r,")"]}),(0,ee.jsx)("span",{})]}),w("Single doors",n,(S,z)=>E(o,S,z)),w("Double doors",l,(S,z)=>E(c,S,z)),p.map((S,z)=>w(`Alternative door ${z+1}`,S,(A,U)=>m(R=>R.map((H,oe)=>oe===z?{...H,[A]:U}:H)),()=>m(A=>A.filter((U,R)=>R!==z)))),(0,ee.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>m(S=>[...S,ix()]),children:"+ Add alternative-sized door"})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,ee.jsx)("div",{className:"architrave-calculator__profiles",children:Lw.filter(S=>ki("architrave",`architrave-${S.id}`)).map(S=>(0,ee.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g===S.id?" is-selected":""}`,onClick:()=>d(S.id),children:[(0,ee.jsx)(nx,{profile:S.id}),(0,ee.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,ee.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,ee.jsx)("div",{className:"architrave-calculator__options",children:(0,ee.jsxs)("label",{className:"truss-estimator__field",children:[(0,ee.jsx)("span",{children:"Board length (m)"}),(0,ee.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ee.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Architrave needed"}),(0,ee.jsxs)("strong",{children:[O.toFixed(2)," m"]})]}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Board lengths"}),(0,ee.jsx)("strong",{children:f})]})]})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,ee.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ee.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(h),disabled:O<=0,children:a})]})]})]})})}var Ni=$(He()),ae=$(F()),Qw=60,Gw=10,ox=.02,lx=.012,jw=1,Yw=4,sx=1.33,cx=1440,ux=1600,Gn=e=>Number.parseFloat(e)||0,px=(e,t=2)=>e.toFixed(t);function Kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ni.useState)("brick"),[n,o]=(0,Ni.useState)("engineering-red"),[l,c]=(0,Ni.useState)("metric"),[p,m]=(0,Ni.useState)(""),[g,d]=(0,Ni.useState)(""),[b,v]=(0,Ni.useState)(!0),E=l==="metric"?Gn(p)*Gn(g):Gn(p)*Gn(g)*.092903,f=E*(r==="brick"?Qw:Gw),u=Math.ceil(f),w=E*(r==="brick"?ox:lx)*sx/(jw+Yw),S=Math.ceil(w*jw*cx),z=Math.ceil(w*Yw*ux),A=l==="metric"?E:E*10.7639,U=[{key:r==="brick"?`brick-${n}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[n]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...b?[{key:"mortar-cement",label:"General purpose cement",qty:S,unit:"kg",query:"general purpose cement",category:"cement"},{key:"mortar-sand",label:"Building sand",qty:z,unit:"kg",query:"building sand",category:"aggregate"}]:[]],R=H=>{if(H===l)return;let oe=H==="imperial"?3.28084:.3048;m((Gn(p)*oe).toFixed(2)),d((Gn(g)*oe).toFixed(2)),c(H)};return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{className:"truss-estimator",children:[(0,ae.jsxs)("div",{className:"quick-order-hero",children:[(0,ae.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ae.jsx)("h1",{children:"Brick and Block Calculator"}),(0,ae.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus the cement and sand for the mortar."}),(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([H,oe])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===H?" is-selected":""}`,onClick:()=>i(H),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:oe}),(0,ae.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",H==="brick"?Qw:Gw," per m\xB2"]})]},H))})]}),r==="brick"&&(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([H,oe,Te])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n===H?" is-selected":""}`,onClick:()=>o(H),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:oe}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:Te})]},H))})]}),(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,ae.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ae.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>R("metric"),children:"Metric"}),(0,ae.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>R("imperial"),children:"Imperial"})]}),(0,ae.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:H=>m(H.target.value)})]}),(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:H=>d(H.target.value)})]})]})]}),(0,ae.jsx)("div",{className:"brick-calculator__options",children:(0,ae.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,ae.jsx)("input",{type:"checkbox",checked:b,onChange:H=>v(H.target.checked)}),(0,ae.jsx)("span",{children:"Include mortar (cement and building sand, mixed 1:4)"})]})}),(0,ae.jsxs)("div",{className:"brick-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Wall area"}),(0,ae.jsxs)("strong",{children:[px(A)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,ae.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),b?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Cement"}),(0,ae.jsxs)("strong",{children:[S," kg"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Building sand"}),(0,ae.jsxs)("strong",{children:[z," kg"]})]})]}):null]}),(0,ae.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar is a general purpose 1:4 cement and sand mix; quantities are approximate, so confirm the specification before ordering."})]}),(0,ae.jsxs)("div",{className:"brick-calculator__actions",children:[(0,ae.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ae.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(U),disabled:E<=0,children:a})]})]})]})})}var Ci=$(He()),W=$(F()),dx=1.54,mx=1440,Pd=e=>Number.parseFloat(e)||0,Pr={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,query:"MOT type 1"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,query:"sharp sand"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,query:"20mm gravel"}};function Jd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ci.useState)("m"),[n,o]=(0,Ci.useState)(""),[l,c]=(0,Ci.useState)(""),[p,m]=(0,Ci.useState)(""),[g,d]=(0,Ci.useState)("concrete"),[b,v]=(0,Ci.useState)("mot"),E=r==="m"?1:.3048,O=Pd(n)*E*Pd(l)*E*Pd(p)*(r==="m"?.01:.0254),f=Pr[b],u=O*dx/7,h=u*mx,w=u*2,S=u*4,z=(U,R)=>Math.ceil(U*R*1e3),A=g==="concrete"?[{key:"cement",label:"General purpose cement",qty:Math.ceil(h),unit:"kg",query:"general purpose cement"},{key:"sharp-sand",label:"Sharp sand",qty:z(w,Pr["sharp-sand"].density),unit:"kg",query:Pr["sharp-sand"].query},{key:"gravel",label:"20mm gravel",qty:z(S,Pr.gravel.density),unit:"kg",query:Pr.gravel.query}]:[{key:b,label:f.label,qty:z(O,f.density),unit:"kg",query:f.query}];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)("div",{className:"truss-estimator",children:[(0,W.jsxs)("div",{className:"quick-order-hero",children:[(0,W.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,W.jsx)("h1",{children:"Concrete and Aggregate Calculator"}),(0,W.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,W.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,W.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,W.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator works out the materials and adds them to your basket."}),(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,W.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g==="concrete"?" is-selected":""}`,onClick:()=>d("concrete"),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g==="aggregate"?" is-selected":""}`,onClick:()=>d("aggregate"),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),g==="aggregate"&&(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,W.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Pr).map(U=>(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===U?" is-selected":""}`,onClick:()=>v(U),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:Pr[U].label}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:Pr[U].blurb})]},U))})]}),(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,W.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,W.jsx)("span",{children:"Units"}),(0,W.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,W.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metric"}),(0,W.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Imperial"})]})]}),(0,W.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsxs)("span",{children:["Length (",r,")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:U=>o(U.target.value)})]}),(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsxs)("span",{children:["Width (",r,")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:U=>c(U.target.value)})]})]}),(0,W.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,W.jsxs)("span",{children:["Depth (",r==="m"?"cm":"inches",")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.1",value:p,onChange:U=>m(U.target.value)})]})]}),(0,W.jsxs)("div",{className:"materials-calculator__totals",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,W.jsx)("div",{className:"materials-calculator__result-grid",children:g==="concrete"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Cement"}),(0,W.jsxs)("strong",{children:[h.toFixed(0)," kg"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Sharp sand"}),(0,W.jsxs)("strong",{children:[w.toFixed(2)," m\xB3"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"20mm aggregate"}),(0,W.jsxs)("strong",{children:[S.toFixed(2)," m\xB3"]})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:f.label}),(0,W.jsxs)("strong",{children:[O.toFixed(2)," m\xB3"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Approx. weight"}),(0,W.jsxs)("strong",{children:[(O*f.density).toFixed(2)," t"]})]}),(0,W.jsx)("div",{})]})}),(0,W.jsx)("p",{className:"materials-calculator__note",children:g==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),(0,W.jsxs)("div",{className:"materials-calculator__actions",children:[(0,W.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,W.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(A),disabled:O<=0,children:a})]})]})]})})}var $a=$(He());var B=$(F()),jn=12,Yn=8,mc=.56,$w=.21,Aa={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},qi=["range","grid","pictureFrame","substructure"],fx={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},fc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),hc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),hx=(e,t,a,r)=>{let i=fc(e,t,a),n=fc(e,t,r),o=fc(a,r,e),l=fc(a,r,t);return i===0&&hc(e,t,a)||n===0&&hc(e,t,r)||o===0&&hc(a,r,e)||l===0&&hc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},Id=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let i=e[(r+1)%e.length];for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&hx(e[r],i,e[n],e[(n+1)%e.length]))return!0}return!1};function Fd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,$a.useState)(0),[n,o]=(0,$a.useState)(fx),[l,c]=(0,$a.useState)(1),[p,m]=(0,$a.useState)({x:0,y:0}),[g,d]=(0,$a.useState)(null),b=(0,$a.useRef)(null),v=(0,$a.useRef)(null),E=(0,$a.useRef)(null),O=qi[r],f=n.range?Aa.ranges[n.range]:null,u=jn/l,h=Yn/l,w=(jn-u)/2,S=(Yn-h)/2,z=Math.max(-jn,Math.min(jn*2-u,w+p.x)),A=Math.max(-Yn,Math.min(Yn*2-h,S+p.y)),U=Number.parseFloat(n.quickLengthM),R=Number.parseFloat(n.quickWidthM),H=U>0&&R>0,oe=T=>Math.abs(T.reduce((G,ie,ce)=>{let we=T[(ce+1)%T.length];return G+ie.x*we.y-we.x*ie.y},0))/2,Te=(T,G)=>Math.hypot(G.x-T.x,G.y-T.y),je=n.isOutlineClosed?oe(n.points):0,Ve=n.isOutlineClosed?n.points.reduce((T,G,ie)=>T+Te(G,n.points[(ie+1)%n.points.length]),0):0,Ne=n.isOutlineClosed?n.points.reduce((T,G,ie)=>T+(n.wallSegments.has(ie)?0:Te(G,n.points[(ie+1)%n.points.length])),0):0,ve=n.points.reduce((T,G)=>({x:T.x+G.x/n.points.length,y:T.y+G.y/n.points.length}),{x:0,y:0}),le=n.points.length>1?(()=>{let T=n.points[0],G=n.points[1],ie=Te(T,G),ce=ie?-(G.y-T.y)/ie:0,we=ie?(G.x-T.x)/ie:0,Ye=(T.x+G.x)/2,qe=(T.y+G.y)/2,k=ce*(Ye-ve.x)+we*(qe-ve.y)>=0?1:-1;return{x:Ye+ce*mc*k,y:qe+we*mc*k}})():null,Ee=(()=>{let T=n.range?Aa.ranges[n.range]:Aa.ranges.meridian,G=n.deckSizeMode==="quick"?U*R:je,ie=n.deckSizeMode==="quick"?2*(U+R):Ne,ce=n.direction==="diagonal"?Aa.wastage.diagonal:Aa.wastage.straight,we=n.pictureFrame==="yes"?Aa.pictureFrame.extraWastage:0,qe=G/(T.boardWidthM+Aa.boardGapM)/T.boardLengthM,k=Math.ceil(qe*(1+ce+we)),_=Math.ceil(G*30*(1+ce+we)/200),q=Aa.joist.spacingOptions.find(N=>N.id===n.joistSpacing)??Aa.joist.spacingOptions[1],D=G/q.spacingM,V=Math.ceil(D);return{range:T,area:G,boardCount:k,screwBoxes:_,joistMetres:V,spacing:q}})(),Nt=Ee?[{key:`boards-${n.range??"meridian"}`,label:`Deck boards (${Ee.range.label})`,qty:Math.round(Ee.boardCount*Ee.range.boardLengthM*100)/100,unit:"m",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:Ee.joistMetres,unit:"m",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:Ee.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],Z=()=>O==="range"?!!n.range:O==="grid"?n.deckSizeMode==="quick"?H:n.isOutlineClosed&&je>0:O==="pictureFrame"?!!n.pictureFrame&&!!n.direction:O==="substructure"?!!n.joistSpacing:!0,ge=r===qi.length-1?a:"Next",Re=(T,G,ie=!1)=>{let ce=E.current?.getBoundingClientRect();if(!ce)return null;let we=ie?1:.25;return{x:Math.round(Math.max(z,Math.min(z+u,z+(T-ce.left)/ce.width*u))/we)*we,y:Math.round(Math.max(A,Math.min(A+h,A+(G-ce.top)/ce.height*h))/we)*we}},bt=T=>{if(n.isOutlineClosed){let ie=T.target;if(ie!==T.currentTarget&&!ie.classList.contains("deck-outline__grid"))return;v.current={startX:T.clientX,startY:T.clientY,startViewX:z,startViewY:A},T.currentTarget.setPointerCapture(T.pointerId);return}if(n.drawMode!=="outline")return;let G=Re(T.clientX,T.clientY,!0);G&&(d(null),o(ie=>{let ce=[...ie.points,G];return Id(ce,!1)?{...ie,drawError:"Edges cannot cross. Choose another corner."}:{...ie,points:ce,drawError:""}}))},jt=(T,G)=>{if(!n.isOutlineClosed){T.stopPropagation(),G===0&&n.points.length>=3&&o(ie=>({...ie,isOutlineClosed:!0,drawMode:"edges"}));return}T.stopPropagation(),b.current=G,T.currentTarget.setPointerCapture(T.pointerId)},Ct=T=>{if(v.current){let ce=E.current?.getBoundingClientRect();if(!ce)return;let we=v.current,Ye=we.startViewX-(T.clientX-we.startX)/ce.width*u,qe=we.startViewY-(T.clientY-we.startY)/ce.height*h;m({x:Ye-w,y:qe-S});return}!n.isOutlineClosed&&n.drawMode==="outline"&&d(Re(T.clientX,T.clientY,!0));let G=b.current;if(G===null)return;let ie=Re(T.clientX,T.clientY);ie&&o(ce=>{let we=ce.points.map((Ye,qe)=>qe===G?ie:Ye);return Id(we,!0)?{...ce,drawError:"Edges cannot cross. Move the corner to a different position."}:{...ce,points:we,drawError:""}})},vt=T=>{v.current=null,b.current=null,T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId)},be=T=>{o(G=>{let ie=new Set(G.wallSegments);return ie.has(T)?ie.delete(T):ie.add(T),{...G,wallSegments:ie}})},de=()=>{r===0?e():i(T=>T-1)},tt=()=>{Z()&&(r===qi.length-1?t?.(Nt):i(T=>T+1))};return(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)("div",{className:"truss-estimator",children:[(0,B.jsxs)("div",{className:"quick-order-hero",children:[(0,B.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,B.jsx)("h1",{children:"Decking Calculator"}),(0,B.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,B.jsxs)("div",{className:"truss-estimator__card",children:[(0,B.jsxs)("div",{className:"truss-estimator__body",children:[O==="range"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Aa.ranges).filter(([T])=>ki("decking",`boards-${T}`)).map(([T,G])=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===T?" is-selected":""}`,onClick:()=>o(ie=>({...ie,range:T})),children:[(0,B.jsx)("div",{className:"truss-estimator__option-title",children:G.label}),(0,B.jsx)("div",{className:"truss-estimator__option-copy",children:G.blurb}),(0,B.jsxs)("div",{className:"truss-estimator__option-copy",children:[G.boardLengthM,"m boards"]})]},T))})]}):null,O==="grid"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,B.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,B.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(T=>({...T,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,B.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(T=>({...T,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),n.deckSizeMode==="quick"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,B.jsxs)("label",{className:"truss-estimator__field",children:[(0,B.jsx)("span",{children:"Length (m)"}),(0,B.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickLengthM,onChange:T=>o(G=>({...G,quickLengthM:T.target.value}))})]}),(0,B.jsxs)("label",{className:"truss-estimator__field",children:[(0,B.jsx)("span",{children:"Width (m)"}),(0,B.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickWidthM,onChange:T=>o(G=>({...G,quickWidthM:T.target.value}))})]})]}),(0,B.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),H?(0,B.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,B.jsxs)("div",{children:[(U*R).toFixed(2)," m\xB2 deck"]}),(0,B.jsxs)("div",{children:[(2*(U+R)).toFixed(2)," m perimeter"]})]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,B.jsxs)("div",{className:"deck-outline__toolbar",children:[n.isOutlineClosed?(0,B.jsxs)("div",{className:"deck-outline__summary",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Deck area"}),(0,B.jsxs)("strong",{children:[je.toFixed(2)," m\xB2"]})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Perimeter"}),(0,B.jsxs)("strong",{children:[Ve.toFixed(2)," m"]})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Wall edges"}),(0,B.jsx)("strong",{children:n.wallSegments.size>0?n.wallSegments.size:"None"})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Visible edge"}),(0,B.jsxs)("strong",{children:[Ne.toFixed(2)," m"]})]})]}):null,(0,B.jsxs)("div",{className:"deck-outline__actions",children:[(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(T=>({...T,points:T.points.slice(0,-1)})),disabled:n.points.length===0||n.isOutlineClosed,children:"Undo"}),(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d(null),o(T=>({...T,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:n.points.length===0,children:"Clear"}),(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(T=>({...T,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,B.jsx)("div",{className:"deck-editor-layout",children:(0,B.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,B.jsxs)("div",{className:"deck-outline",children:[(0,B.jsxs)("svg",{ref:E,className:`deck-outline__canvas${n.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${z} ${A} ${u} ${h}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:bt,onPointerMove:Ct,onPointerUp:vt,onPointerLeave:()=>{d(null),v.current||(b.current=null)},children:[(0,B.jsx)("defs",{children:(0,B.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,B.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,B.jsx)("rect",{x:-jn,y:-Yn,width:jn*3,height:Yn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),n.points.length>1?(0,B.jsx)("polyline",{className:"deck-outline__preview",points:n.points.map(T=>`${T.x},${T.y}`).join(" ")}):null,n.isOutlineClosed?(0,B.jsx)("polygon",{className:"deck-outline__shape",points:n.points.map(T=>`${T.x},${T.y}`).join(" "),stroke:"none"}):null,n.points.length>1?n.points.slice(0,n.isOutlineClosed?void 0:-1).map((T,G)=>{let ie=n.points[n.isOutlineClosed?(G+1)%n.points.length:G+1],ce=Te(T,ie),we=ce?-(ie.y-T.y)/ce:0,Ye=ce?(ie.x-T.x)/ce:0,qe=(T.x+ie.x)/2,k=(T.y+ie.y)/2,_=we*(qe-ve.x)+Ye*(k-ve.y)>=0?1:-1,q=qe+we*mc*_,D=k+Ye*mc*_;return(0,B.jsxs)("g",{children:[(0,B.jsx)("line",{className:"deck-outline__edge-hit",x1:T.x,y1:T.y,x2:ie.x,y2:ie.y,onClick:n.isOutlineClosed?()=>be(G):void 0}),(0,B.jsx)("line",{className:`deck-outline__edge${n.wallSegments.has(G)?" is-wall":""}`,x1:T.x,y1:T.y,x2:ie.x,y2:ie.y,pointerEvents:"none"}),(0,B.jsxs)("text",{className:`deck-outline__edge-label${n.wallSegments.has(G)?" is-wall":""}`,x:q,y:D,textAnchor:"middle",dominantBaseline:"central",fontSize:$w/l,children:[ce.toFixed(2)," m"]})]},`segment-${G}`)}):null,!n.isOutlineClosed&&n.points.length>0&&g?(()=>{let T=n.points[n.points.length-1],G=Te(T,g);if(!G)return null;let ie=-(g.y-T.y)/G,ce=(g.x-T.x)/G,we=(T.x+g.x)/2,Ye=(T.y+g.y)/2;return(0,B.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,B.jsx)("line",{x1:T.x,y1:T.y,x2:g.x,y2:g.y}),(0,B.jsxs)("text",{x:we+ie*.34,y:Ye+ce*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:$w/l,children:[G.toFixed(2)," m"]})]})})():null,n.points.map((T,G)=>(0,B.jsx)("circle",{className:"deck-outline__point",cx:T.x,cy:T.y,r:"0.13",onPointerDown:ie=>jt(ie,G)},`point-${G}`))]}),(0,B.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,B.jsx)("button",{type:"button",onClick:()=>c(T=>Math.max(.5,T-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,B.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,B.jsx)("button",{type:"button",onClick:()=>c(T=>Math.min(1,T+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),n.isOutlineClosed&&n.wallSegments.size===0&&le?(0,B.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(le.x-z)/u*100}%`,top:`${(le.y-A)/h*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!n.isOutlineClosed&&n.points.length>=3?(0,B.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(T=>Id(T.points,!0)?{...T,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...T,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,B.jsxs)("div",{className:"deck-outline__supporting",children:[(0,B.jsx)("div",{className:"truss-estimator__grid-hint",children:n.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),n.drawError?(0,B.jsx)("div",{className:"deck-outline__error",role:"alert",children:n.drawError}):null]})]})})]})]}):null,O==="pictureFrame"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(T=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.pictureFrame===T.id?" is-selected":""}`,onClick:()=>o(G=>({...G,pictureFrame:T.id})),children:[(0,B.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(T.img),alt:""}),(0,B.jsx)("span",{children:T.label})]},T.id))}),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(T=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.direction===T.id?" is-selected":""}`,onClick:()=>o(G=>({...G,direction:T.id})),children:[(0,B.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(T.img),alt:""}),(0,B.jsx)("span",{children:T.label})]},T.id))})]})]}):null,O==="substructure"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Aa.joist.spacingOptions.map(T=>(0,B.jsx)("button",{type:"button",className:`truss-estimator__option-card${n.joistSpacing===T.id?" is-selected":""}`,onClick:()=>o(G=>({...G,joistSpacing:T.id})),children:(0,B.jsx)("div",{className:"truss-estimator__option-title",children:T.label})},T.id))})]}):null]}),(0,B.jsxs)("div",{className:"truss-estimator__nav",children:[(0,B.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:de,children:"Back"}),(0,B.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:tt,disabled:!Z(),children:[(0,B.jsx)("span",{children:ge}),(0,B.jsx)("span",{className:"arrow",children:(0,B.jsx)(Qt,{})})]})]})]})]})})}var Ca=$(He());var Y=$(F()),Vw=12,Xw=30,$n=12,Vn=8,Zw=.56,Na={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Ei=["range","height","gate","posts"],Wd=e=>Number(e)<=1.2?"6":"8",Kw=(e,t)=>ki("fencing",`panels-${e??"boundary"}-${t}`),Pw=(e,t)=>!t||ki("fencing",e==="concrete"?`concrete-intermediate-${Wd(t)}`:`timber-post-${Wd(t)}`),gx={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},gc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),bc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),bx=(e,t,a,r)=>{let i=gc(e,t,a),n=gc(e,t,r),o=gc(a,r,e),l=gc(a,r,t);return i===0&&bc(e,t,a)||n===0&&bc(e,t,r)||o===0&&bc(a,r,e)||l===0&&bc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},vc=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&bx(e[r],e[(r+1)%e.length],e[i],e[(i+1)%e.length]))return!0;return!1};function em({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ca.useState)(0),[n,o]=(0,Ca.useState)(gx),l=(0,Ca.useRef)(null),c=(0,Ca.useRef)(null),[p,m]=(0,Ca.useState)(1),[g,d]=(0,Ca.useState)({x:0,y:0}),[b,v]=(0,Ca.useState)(null),E=(0,Ca.useRef)(null),O=(0,Ca.useRef)(null),f=(0,Ca.useRef)(null),u=Ei[r],h=n.range?Na.ranges[n.range]:null,w=$n/p,S=Vn/p,z=($n-w)/2,A=(Vn-S)/2,U=Math.max(-$n,Math.min($n*2-w,z+g.x)),R=Math.max(-Vn,Math.min(Vn*2-S,A+g.y)),H=n.boundaryPoints.reduce((k,_)=>({x:k.x+_.x/Math.max(1,n.boundaryPoints.length),y:k.y+_.y/Math.max(1,n.boundaryPoints.length)}),{x:0,y:0}),oe=k=>{let _=new Set,q=[];return k.forEach(D=>{let[V,N]=D.split(",").map(Number),L=[{key:`H,${V},${N}`,type:"H",x:V,y:N},{key:`H,${V},${N+1}`,type:"H",x:V,y:N+1},{key:`V,${V},${N}`,type:"V",x:V,y:N},{key:`V,${V+1},${N}`,type:"V",x:V+1,y:N}],X=[!k.has(`${V},${N-1}`),!k.has(`${V},${N+1}`),!k.has(`${V-1},${N}`),!k.has(`${V+1},${N}`)];L.forEach((ue,ke)=>{X[ke]&&!_.has(ue.key)&&(_.add(ue.key),q.push(ue))})}),q},Te=(k,_)=>oe(k).filter(q=>!_.has(q.key)),je=(k,_)=>Te(k,_).length,Ve=(k,_)=>{let q={};Te(k,_).forEach(V=>{var N,L,X,ue;V.type==="H"?((q[N=`${V.x},${V.y}`]||(q[N]=[])).push("H"),(q[L=`${V.x+1},${V.y}`]||(q[L]=[])).push("H")):((q[X=`${V.x},${V.y}`]||(q[X]=[])).push("V"),(q[ue=`${V.x},${V.y+1}`]||(q[ue]=[])).push("V"))});let D=0;return Object.values(q).forEach(V=>{(V.length===1||V.length===2&&V[0]!==V[1]||V.length>=3)&&(D+=1)}),D},ve=(()=>{let k=n.range?Na.ranges[n.range]:Na.ranges.boundary,_=n.height??"1.8",q=n.boundaryMode==="quick"?Math.max(0,Number.parseFloat(n.quickLengthM)||0):n.boundaryClosed?n.boundaryPoints.slice(0,-1).reduce((Yt,gr,yt)=>Yt+(n.excludedBoundaryEdges.has(yt)?0:Math.hypot(n.boundaryPoints[yt+1].x-gr.x,n.boundaryPoints[yt+1].y-gr.y)),0):0,D=n.gateType&&n.gateType!=="none"?Number.parseFloat(n.gateWidthM)||Na.gate[n.gateType].widthDefault:0,V=Math.max(0,q-D),N=V>0?Math.ceil(V/k.panelWidthM):0,L=n.boundaryPoints.length>2&&n.boundaryPoints[0].x===n.boundaryPoints[n.boundaryPoints.length-1].x&&n.boundaryPoints[0].y===n.boundaryPoints[n.boundaryPoints.length-1].y,X=n.boundaryMode==="quick"?V>0?2:0:n.boundaryClosed?n.boundaryPoints.slice(0,L?-1:void 0).reduce((Yt,gr,yt)=>{let zi=yt>0&&!n.excludedBoundaryEdges.has(yt-1),vm=yt<n.boundaryPoints.length-1&&!n.excludedBoundaryEdges.has(yt);return Yt+(zi||vm?1:0)},0):0,ue=V>0?Math.ceil(V/k.panelWidthM)+1:0,ke=Math.max(0,ue-X),wt=n.mountingType?Na.mounting[n.mountingType]:Na.mounting.concrete,at=n.gateType&&n.gateType!=="none"?2:0,Ut=ke+X+at,bm=n.mountingType==="postcrete"?Ut*Na.mounting.postcrete.bagsPerPost:0,Jr=n.gravelBoard==="yes"?N:0;return{range:k,height:_,totalEdgeM:q,fencedLengthM:V,gateWidthM:D,panelsCount:N,cornerPostCount:X,intermediatePostCount:ke,gatePostCount:at,totalPostCount:Ut,bagsCount:bm,gravelCount:Jr,capCount:Ut,mounting:wt}})(),le=n.gateType&&n.gateType!=="none"?Na.gate[n.gateType].label:null,Fe=Wd(ve.height),Ee=ve?[{key:`panels-${n.range??"boundary"}-${ve.height}`,label:`${ve.range.label} panels (${ve.height}m)`,qty:ve.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...n.mountingType==="concrete"?[{key:`concrete-intermediate-${Fe}`,label:"Intermediate concrete posts",qty:ve.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${Fe}`,label:"End and corner concrete posts",qty:ve.cornerPostCount+ve.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${Fe}`,label:"Timber fence posts",qty:ve.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:ve.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...le?[{key:`gate-${n.range??"boundary"}`,label:n.range==="skyline"?"Single feather edge gate":"Single lap gate",qty:1,unit:"each",query:n.range==="skyline"?"feather edge gate":"lap gate",category:"fencing"}]:[],...ve.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:ve.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],Nt=()=>{if(u==="range"){let k=n.boundaryMode==="quick"?(Number.parseFloat(n.quickLengthM)||0)>0:n.boundaryClosed&&n.boundaryPoints.length>=2;return!!n.range&&k}return u==="height"?!!n.height&&!!n.gravelBoard:u==="gate"?!!n.gateType&&(n.gateType==="none"||n.gateWidthM.trim()!==""):u==="posts"?!!n.mountingType:!0},Z=r===Ei.length-1?a:"Next",ge=k=>{o(_=>{let q=k(new Set(_.grid)),D=new Set([..._.excludedEdges].filter(V=>oe(q).some(N=>N.key===V)));return{..._,grid:q,excludedEdges:D}})},Re=(k,_,q)=>{ge(D=>{let V=`${k},${_}`;return q?D.add(V):D.delete(V),D})},bt=(k,_,q,D,V)=>{let N=k,L=_,X=Math.abs(q-k),ue=k<q?1:-1,ke=-Math.abs(D-_),wt=_<D?1:-1,at=X+ke;for(;Re(N,L,V),!(N===q&&L===D);){let Ut=2*at;Ut>=ke&&(at+=ke,N+=ue),Ut<=X&&(at+=X,L+=wt)}},jt=(k,_)=>{let q=c.current?.getBoundingClientRect();if(!q)return null;let D=Math.floor((k-q.left)/Xw),V=Math.floor((_-q.top)/Xw);return D<0||V<0||D>=Vw||V>=Vw?null:{x:D,y:V}},Ct=k=>{if(n.gridMode!=="draw")return;let _=jt(k.clientX,k.clientY);if(!_)return;k.preventDefault();let q=`${_.x},${_.y}`,D=!n.grid.has(q);l.current={active:!0,paintValue:D,lastX:_.x,lastY:_.y},k.currentTarget.setPointerCapture(k.pointerId),Re(_.x,_.y,D)},vt=k=>{let _=l.current;if(!_?.active)return;let q=jt(k.clientX,k.clientY);q&&(q.x===_.lastX&&q.y===_.lastY||(bt(_.lastX,_.lastY,q.x,q.y,_.paintValue),l.current={..._,lastX:q.x,lastY:q.y}))},be=k=>{l.current?.active&&(l.current=null,k.currentTarget.releasePointerCapture(k.pointerId))},de=(k,_,q=!1)=>{let D=f.current?.getBoundingClientRect();if(!D)return null;let V=q?1:.25;return{x:Math.round(Math.max(U,Math.min(U+w,U+(k-D.left)/D.width*w))/V)*V,y:Math.round(Math.max(R,Math.min(R+S,R+(_-D.top)/D.height*S))/V)*V}},tt=k=>{if(n.boundaryClosed){let q=k.target;if(q!==k.currentTarget&&!q.classList.contains("fence-boundary__grid"))return;O.current={startX:k.clientX,startY:k.clientY,startViewX:U,startViewY:R},k.currentTarget.setPointerCapture(k.pointerId);return}let _=de(k.clientX,k.clientY,!0);_&&(v(null),o(q=>{let D=[...q.boundaryPoints,_];return vc(D,!1)?{...q}:{...q,boundaryPoints:D}}))},T=(k,_)=>{if(k.stopPropagation(),!n.boundaryClosed){if(_!==0||n.boundaryPoints.length<3)return;o(q=>vc(q.boundaryPoints,!0)?q:{...q,boundaryPoints:[...q.boundaryPoints,q.boundaryPoints[0]],boundaryClosed:!0});return}E.current=_,k.currentTarget.setPointerCapture(k.pointerId)},G=k=>{if(O.current){let q=f.current?.getBoundingClientRect();if(!q)return;let D=O.current,V=D.startViewX-(k.clientX-D.startX)/q.width*w,N=D.startViewY-(k.clientY-D.startY)/q.height*S;d({x:V-z,y:N-A});return}if(n.boundaryClosed||v(de(k.clientX,k.clientY,!0)),E.current===null)return;let _=de(k.clientX,k.clientY);_&&o(q=>{let D=q.boundaryPoints.length>2&&q.boundaryPoints[0].x===q.boundaryPoints[q.boundaryPoints.length-1].x&&q.boundaryPoints[0].y===q.boundaryPoints[q.boundaryPoints.length-1].y,V=q.boundaryPoints.map((N,L)=>{let X=L===E.current,ue=D&&E.current===0&&L===q.boundaryPoints.length-1;return X||ue?_:N});return vc(V,!1)?q:{...q,boundaryPoints:V}})},ie=k=>{O.current=null,E.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},ce=k=>{o(_=>{let q=new Set(_.excludedBoundaryEdges);return q.has(k)?q.delete(k):q.add(k),{..._,excludedBoundaryEdges:q}})},we=()=>{r===0?e():i(k=>k-1)},Ye=()=>{Nt()&&(r===Ei.length-1?t?.(Ee):i(k=>k+1))},qe=oe(n.grid);return(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)("div",{className:"truss-estimator",children:[(0,Y.jsxs)("div",{className:"quick-order-hero",children:[(0,Y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Y.jsx)("h1",{children:"Fencing Calculator"}),(0,Y.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,Y.jsxs)("div",{className:"truss-estimator__card",children:[(0,Y.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Na.ranges).map(([k,_])=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===k?" is-selected":""}`,onClick:()=>o(q=>({...q,range:k,height:q.height&&Kw(k,q.height)?q.height:null})),children:[(0,Y.jsx)("div",{className:"truss-estimator__option-title",children:_.label}),(0,Y.jsx)("div",{className:"truss-estimator__option-copy",children:_.blurb})]},k))})]}):null,u==="range"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,Y.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,Y.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"quick"})),children:"Quick estimate"}),(0,Y.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"draw"})),children:"Draw your boundary"})]}),n.boundaryMode==="quick"?(0,Y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,Y.jsx)("span",{children:"Total fence length (m)"}),(0,Y.jsx)("input",{type:"number",min:"0",step:"0.1",value:n.quickLengthM,onChange:k=>o(_=>({..._,quickLengthM:k.target.value}))})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"fence-boundary__toolbar",children:(0,Y.jsxs)("div",{className:"fence-boundary__actions",children:[(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,boundaryPoints:k.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:n.boundaryPoints.length===0||n.boundaryClosed,children:"Undo"}),(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d({x:0,y:0}),v(null),o(k=>({...k,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:n.boundaryPoints.length===0,children:"Clear"}),(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,Y.jsxs)("div",{className:"fence-boundary",children:[(0,Y.jsxs)("svg",{ref:f,className:`fence-boundary__canvas${n.boundaryClosed?" is-pan-mode":""}`,viewBox:`${U} ${R} ${w} ${S}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:tt,onPointerMove:G,onPointerUp:ie,onPointerLeave:()=>{v(null),O.current||(E.current=null)},children:[(0,Y.jsx)("defs",{children:(0,Y.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,Y.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,Y.jsx)("rect",{x:-$n,y:-Vn,width:$n*3,height:Vn*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),n.boundaryPoints.length>1?(0,Y.jsx)("polyline",{className:"fence-boundary__preview",points:n.boundaryPoints.map(k=>`${k.x},${k.y}`).join(" ")}):null,n.boundaryPoints.length>1?n.boundaryPoints.slice(0,-1).map((k,_)=>{let q=n.boundaryPoints[_+1],D=Math.hypot(q.x-k.x,q.y-k.y),V=D?-(q.y-k.y)/D:0,N=D?(q.x-k.x)/D:0,L=(k.x+q.x)/2,X=(k.y+q.y)/2,ue=V*(L-H.x)+N*(X-H.y)>=0?1:-1,ke=L+V*Zw*ue,wt=X+N*Zw*ue;return(0,Y.jsxs)("g",{children:[(0,Y.jsx)("line",{className:"fence-boundary__edge-hit",x1:k.x,y1:k.y,x2:q.x,y2:q.y,onClick:n.boundaryClosed?()=>ce(_):void 0}),(0,Y.jsx)("line",{className:`fence-boundary__edge${n.excludedBoundaryEdges.has(_)?" is-excluded":""}`,x1:k.x,y1:k.y,x2:q.x,y2:q.y,pointerEvents:"none"}),(0,Y.jsxs)("text",{className:`fence-boundary__edge-label${n.excludedBoundaryEdges.has(_)?" is-excluded":""}`,x:ke,y:wt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[D.toFixed(2)," m"]})]},`fence-edge-${_}`)}):null,!n.boundaryClosed&&n.boundaryPoints.length>0&&b?(()=>{let k=n.boundaryPoints[n.boundaryPoints.length-1],_=Math.hypot(b.x-k.x,b.y-k.y);if(!_)return null;let q=-(b.y-k.y)/_,D=(b.x-k.x)/_,V=(k.x+b.x)/2,N=(k.y+b.y)/2;return(0,Y.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,Y.jsx)("line",{x1:k.x,y1:k.y,x2:b.x,y2:b.y}),(0,Y.jsxs)("text",{x:V+q*.34,y:N+D*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[_.toFixed(2)," m"]})]})})():null,n.boundaryPoints.map((k,_)=>_>0&&_===n.boundaryPoints.length-1&&k.x===n.boundaryPoints[0]?.x&&k.y===n.boundaryPoints[0]?.y?null:(0,Y.jsx)("circle",{className:`fence-boundary__point${!n.boundaryClosed&&_===0&&n.boundaryPoints.length>=3?" is-close-target":""}`,cx:k.x,cy:k.y,r:"0.13",onPointerDown:q=>T(q,_)},`fence-point-${_}`))]}),(0,Y.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,Y.jsx)("button",{type:"button",onClick:()=>m(k=>Math.max(.5,k-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,Y.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,Y.jsx)("button",{type:"button",onClick:()=>m(k=>Math.min(1,k+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!n.boundaryClosed&&n.boundaryPoints.length>=2?(0,Y.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(k=>vc(k.boundaryPoints,!1)?k:{...k,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,Y.jsx)("div",{className:"truss-estimator__grid-hint",children:n.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,Y.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,Y.jsx)("div",{children:n.boundaryMode==="quick"?`${(Number.parseFloat(n.quickLengthM)||0).toFixed(2)} m fence line`:`${ve.totalEdgeM.toFixed(2)} m fence line`}),n.boundaryMode==="draw"&&n.boundaryClosed?(0,Y.jsxs)("div",{children:[ve.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Na.heights.filter(k=>Kw(n.range,k)).map(k=>(0,Y.jsx)("button",{type:"button",className:`truss-estimator__visual-card${n.height===k?" is-selected":""}`,onClick:()=>o(_=>({..._,height:k,mountingType:_.mountingType&&Pw(_.mountingType,k)?_.mountingType:null})),children:(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:It(`/fencing/height/${k}.webp`),alt:""})},k))}),(0,Y.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(k=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.gravelBoard===k.id?" is-selected":""}`,onClick:()=>o(_=>({..._,gravelBoard:k.id})),children:[(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(k.img),alt:""}),(0,Y.jsx)("span",{children:k.label})]},k.id))})]}):null,u==="gate"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(k=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${n.gateType===k.id?" is-selected":""}`,onClick:()=>o(_=>({..._,gateType:k.id,gateWidthM:k.id==="none"?"":String(Na.gate[k.id].widthDefault)})),children:[(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(k.img),alt:""}),(0,Y.jsx)("span",{children:k.label})]},k.id))}),n.gateType&&n.gateType!=="none"?(0,Y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,Y.jsx)("span",{children:"Gate width (m)"}),(0,Y.jsx)("input",{type:"text",inputMode:"decimal",value:n.gateWidthM,onChange:k=>o(_=>({..._,gateWidthM:k.target.value}))})]}):null]}):null,u==="posts"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Na.mounting).filter(([k])=>Pw(k,n.height)).map(([k,_])=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.mountingType===k?" is-selected":""}`,onClick:()=>o(q=>({...q,mountingType:k})),children:[(0,Y.jsx)("div",{className:"truss-estimator__option-title",children:_.label}),(0,Y.jsx)("div",{className:"truss-estimator__option-copy",children:_.blurb})]},k))})]}):null]}),(0,Y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,Y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:we,children:"Back"}),(0,Y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:Ye,disabled:!Nt(),children:[(0,Y.jsx)("span",{children:Z}),(0,Y.jsx)("span",{className:"arrow",children:(0,Y.jsx)(Qt,{})})]})]})]})]})})}var wc=$(He()),he=$(F()),Jw={floor:{label:"Floor between rooms",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36},ground:{label:"Ground floor",product:"Rigid PIR insulation board",thickness:"100mm",coverage:2.88},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89}};function tm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,wc.useState)("floor"),[n,o]=(0,wc.useState)(""),[l,c]=(0,wc.useState)(""),p=Number.parseFloat(n)*Number.parseFloat(l)||0,m=Jw[r],g=Math.ceil(p/m.coverage),d=[{key:`insulation-${r}`,label:`${m.product} ${m.thickness}`,qty:Math.round(p*100)/100,unit:"m2",query:m.product,category:"insulation"}],b=Object.entries(Jw);return(0,he.jsx)(he.Fragment,{children:(0,he.jsxs)("div",{className:"truss-estimator",children:[(0,he.jsxs)("div",{className:"quick-order-hero",children:[(0,he.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,he.jsx)("h1",{children:"Insulation Calculator"}),(0,he.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,he.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,he.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,he.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,he.jsxs)("div",{className:"materials-calculator__section",children:[(0,he.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,he.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:b.map(([v,E])=>(0,he.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>i(v),children:[(0,he.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,he.jsxs)("div",{className:"truss-estimator__option-copy",children:[E.product,", ",E.thickness]})]},v))})]}),(0,he.jsxs)("div",{className:"materials-calculator__section",children:[(0,he.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,he.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,he.jsxs)("label",{className:"truss-estimator__field",children:[(0,he.jsx)("span",{children:"Length (m)"}),(0,he.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:v=>o(v.target.value)})]}),(0,he.jsxs)("label",{className:"truss-estimator__field",children:[(0,he.jsx)("span",{children:"Width (m)"}),(0,he.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]})]}),(0,he.jsxs)("div",{className:"materials-calculator__totals",children:[(0,he.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,he.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,he.jsxs)("div",{children:[(0,he.jsx)("span",{children:"Insulated area"}),(0,he.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,he.jsxs)("div",{children:[(0,he.jsx)("span",{children:m.product}),(0,he.jsxs)("strong",{children:[g," packs"]})]})]}),(0,he.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,he.jsxs)("div",{className:"materials-calculator__actions",children:[(0,he.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,he.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(d),disabled:p<=0,children:a})]})]})]})})}var Xn=$(He());var K=$(F()),vx=10,wx=1.9*.762,yx=1.9*1.524,yc=()=>({height:"",width:""}),_c=e=>Number.parseFloat(e)||0,Iw=({height:e,width:t})=>_c(e)*_c(t);function am({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Xn.useState)([yc()]),[n,o]=(0,Xn.useState)([yc()]),[l,c]=(0,Xn.useState)("0"),[p,m]=(0,Xn.useState)("0"),[g,d]=(0,Xn.useState)(1),b=r.reduce((S,z)=>S+Iw(z),0),v=n.reduce((S,z)=>S+Iw(z),0),E=_c(l)*wx+_c(p)*yx,O=Math.max(0,b-v-E),f=O*g/vx,u={key:"paint-emulsion",label:"Matt emulsion, brilliant white",qty:Math.round(f*10)/10,unit:"litres",query:"matt emulsion brilliant white"},h=dl("paint",u)!=null,w=(S,z,A,U)=>{S(R=>R.map((H,oe)=>oe===z?{...H,[A]:U}:H))};return(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)("div",{className:"truss-estimator",children:[(0,K.jsxs)("div",{className:"quick-order-hero",children:[(0,K.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,K.jsx)("h1",{children:"Paint Calculator"}),(0,K.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,K.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,K.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,K.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,K.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,K.jsx)("span",{}),(0,K.jsx)("span",{children:"Height (m)"}),(0,K.jsx)("span",{children:"Width (m)"}),(0,K.jsx)("span",{})]}),r.map((S,z)=>(0,K.jsxs)("div",{className:"paint-calculator__row",children:[(0,K.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",z+1]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,K.jsx)("input",{"aria-label":`Wall ${z+1} height in metres`,type:"number",min:"0",step:"0.01",value:S.height,onChange:A=>w(i,z,"height",A.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,K.jsx)("input",{"aria-label":`Wall ${z+1} width in metres`,type:"number",min:"0",step:"0.01",value:S.width,onChange:A=>w(i,z,"width",A.target.value)})]}),r.length>1?(0,K.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(A=>A.filter((U,R)=>R!==z)),children:"Remove"}):null]},`wall-${z}`)),(0,K.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(S=>[...S,yc()]),children:"+ Add another wall"})]}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,K.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,K.jsx)("span",{}),(0,K.jsx)("span",{children:"Height (m)"}),(0,K.jsx)("span",{children:"Width (m)"}),(0,K.jsx)("span",{})]}),n.map((S,z)=>(0,K.jsxs)("div",{className:"paint-calculator__row",children:[(0,K.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",z+1]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,K.jsx)("input",{"aria-label":`Area ${z+1} height in metres`,type:"number",min:"0",step:"0.01",value:S.height,onChange:A=>w(o,z,"height",A.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,K.jsx)("input",{"aria-label":`Area ${z+1} width in metres`,type:"number",min:"0",step:"0.01",value:S.width,onChange:A=>w(o,z,"width",A.target.value)})]}),n.length>1?(0,K.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>o(A=>A.filter((U,R)=>R!==z)),children:"Remove"}):null]},`excluded-${z}`)),(0,K.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>o(S=>[...S,yc()]),children:"+ Add another area"})]}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,K.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Doors"}),(0,K.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:S=>c(S.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Double doors"}),(0,K.jsx)("input",{type:"number",min:"0",step:"1",value:p,onChange:S=>m(S.target.value)})]})]}),(0,K.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Number of coats"}),(0,K.jsxs)("select",{value:g,onChange:S=>d(Number(S.target.value)),children:[(0,K.jsx)("option",{value:"1",children:"1 coat"}),(0,K.jsx)("option",{value:"2",children:"2 coats"}),(0,K.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,K.jsxs)("div",{className:"paint-calculator__totals",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,K.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Paintable area"}),(0,K.jsxs)("strong",{children:[O.toFixed(2)," m\xB2"]})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Coverage"}),(0,K.jsxs)("strong",{children:[g," ",g===1?"coat":"coats"]})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Paint required"}),(0,K.jsxs)("strong",{children:[f.toFixed(1)," litres"]})]})]}),(0,K.jsx)("p",{className:"paint-calculator__note",children:h?"Based on paint coverage of 10 m\xB2 per litre. Ordered as brilliant white matt emulsion, rounded up to whole tins.":"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,K.jsxs)("div",{className:"paint-calculator__actions",children:[(0,K.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),h?(0,K.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.([u]),disabled:f<=0,children:a}):(0,K.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var hr=$(He()),te=$(F()),xc=e=>Number.parseFloat(e)||0,rm={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function im({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,hr.useState)("paving"),[n,o]=(0,hr.useState)("council"),[l,c]=(0,hr.useState)(""),[p,m]=(0,hr.useState)(""),[g,d]=(0,hr.useState)("100"),[b,v]=(0,hr.useState)("50"),[E,O]=(0,hr.useState)(!0),[f,u]=(0,hr.useState)(!0),h=xc(l)*xc(p),w=h,S=h*(xc(g)/1e3),z=h*.04,A=h*(xc(b)/1e3),U=Math.ceil(w/.36),R=Math.ceil(w/.1),H=Math.ceil(S*1700/800),oe=Math.ceil(z*1600/800),Te=Math.ceil(A*1600/800),je=r==="paving"?{qty:U,unit:"each"}:r==="block"?{qty:w,unit:"m2"}:{qty:Te,unit:"bag"},Ve={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],Ne=[{key:`surface-${n}`,label:rm[r].find(le=>le.id===n)?.label??"Surface material",qty:je.qty,unit:je.unit,query:Ve,category:"landscaping"},...E?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:H,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...f?[{key:"bedding",label:"Sharp sand bedding",qty:oe,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,te.jsx)(te.Fragment,{children:(0,te.jsxs)("div",{className:"truss-estimator",children:[(0,te.jsxs)("div",{className:"quick-order-hero",children:[(0,te.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,te.jsx)("h1",{children:"Paving and Driveway Calculator"}),(0,te.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,te.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,te.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,te.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,te.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([le,Fe,Ee])=>(0,te.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===le?" is-selected":""}`,onClick:()=>{i(le),o(rm[le][0].id)},children:[(0,te.jsx)("div",{className:"truss-estimator__option-title",children:Fe}),(0,te.jsx)("div",{className:"truss-estimator__option-copy",children:Ee})]},le))}),(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Finish"}),(0,te.jsx)("select",{value:n,onChange:le=>o(le.target.value),children:rm[r].map(le=>(0,te.jsx)("option",{value:le.id,children:le.label},le.id))})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,te.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Length (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:le=>c(le.target.value)})]}),(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Width (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:le=>m(le.target.value)})]})]}),r==="gravel"&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Gravel depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:le=>v(le.target.value)})]}),E&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Sub-base depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:g,onChange:le=>d(le.target.value)})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:E,onChange:le=>O(le.target.checked)}),(0,te.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:f,onChange:le=>u(le.target.checked)}),(0,te.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__totals",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,te.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Surface area"}),(0,te.jsxs)("strong",{children:[h.toFixed(2)," m\xB2"]})]}),(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,te.jsx)("strong",{children:r==="paving"?`${U} slabs`:r==="block"?`${w.toFixed(2)} m\xB2`:`${Te} bulk bags`})]}),E&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"MOT Type 1"}),(0,te.jsxs)("strong",{children:[H," bulk bags"]})]}),f&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Sharp sand"}),(0,te.jsxs)("strong",{children:[oe," bulk bags"]})]})]}),(0,te.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,te.jsxs)("div",{className:"materials-calculator__actions",children:[(0,te.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,te.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(Ne),disabled:h<=0,children:a})]})]})]})})}var ml=$(He()),re=$(F()),_x=2.88,Fw=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],Ww=()=>({length:"",height:""}),nm=e=>Number.parseFloat(e)||0;function om({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ml.useState)([Ww()]),[n,o]=(0,ml.useState)(""),[l,c]=(0,ml.useState)("standard"),[p,m]=(0,ml.useState)("screws"),g=r.reduce((z,A)=>z+nm(A.length)*nm(A.height),0),d=Math.max(0,g-nm(n)),b=Math.ceil(d/_x),v=Math.ceil(d*12),E=Math.ceil(v/1e3),O=Math.ceil(d*1.2),f=Math.ceil(O/90),u=Math.ceil(d/3.5),h=Fw.find(z=>z.id===l)?.label??"Standard",w=[{key:"board",label:`${h} plasterboard`,qty:b,unit:"sheet",query:`${h} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:E,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:u,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:f,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],S=(z,A,U)=>{i(R=>R.map((H,oe)=>oe===z?{...H,[A]:U}:H))};return(0,re.jsx)(re.Fragment,{children:(0,re.jsxs)("div",{className:"truss-estimator",children:[(0,re.jsxs)("div",{className:"quick-order-hero",children:[(0,re.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,re.jsx)("h1",{children:"Plasterboard and Drylining Calculator"}),(0,re.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,re.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,re.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,re.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,re.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Fw.map(z=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===z.id?" is-selected":""}`,onClick:()=>c(z.id),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:z.label}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:z.blurb})]},z.id))})]}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,re.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([z,A,U])=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===z?" is-selected":""}`,onClick:()=>m(z),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:A}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:U})]},z))})]}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,re.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,re.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,re.jsx)("span",{children:"Surface"}),(0,re.jsx)("span",{children:"Length (m)"}),(0,re.jsx)("span",{children:"Height (m)"}),(0,re.jsx)("span",{})]}),r.map((z,A)=>(0,re.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,re.jsxs)("span",{children:["Surface ",A+1]}),(0,re.jsx)("input",{"aria-label":`Surface ${A+1} length`,type:"number",min:"0",step:"0.01",value:z.length,onChange:U=>S(A,"length",U.target.value)}),(0,re.jsx)("input",{"aria-label":`Surface ${A+1} height`,type:"number",min:"0",step:"0.01",value:z.height,onChange:U=>S(A,"height",U.target.value)}),r.length>1?(0,re.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(U=>U.filter((R,H)=>H!==A)),children:"Remove"}):null]},`surface-${A}`)),(0,re.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(z=>[...z,Ww()]),children:"+ Add another surface"}),(0,re.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,re.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,re.jsx)("small",{children:"optional"})]}),(0,re.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:z=>o(z.target.value)})]})]}),(0,re.jsxs)("div",{className:"materials-calculator__totals",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,re.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Board area"}),(0,re.jsxs)("strong",{children:[d.toFixed(2)," m\xB2"]})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,re.jsx)("strong",{children:b})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,re.jsx)("strong",{children:p==="screws"?`${v} (${E} boxes)`:`${u} bags`})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Joint tape"}),(0,re.jsxs)("strong",{children:[O," m (",f," rolls)"]})]})]}),(0,re.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,re.jsxs)("div",{className:"materials-calculator__actions",children:[(0,re.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,re.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(w),disabled:d<=0,children:a})]})]})]})})}var fl=$(He());var y=$(F()),At={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},kc=["range","pitchAndDimensions","quantityAndGirders","bracing"],xx={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function kx({degrees:e}){let a=e*Math.PI/180,i=82-Math.min(58,38*Math.tan(a));return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("polygon",{points:`12,82 88,82 50,${i}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function Sx({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",i="#d3d8de",n="#7c8494",o=(m,g,d,b,v=8,E)=>{let O=d-m,f=b-g,u=Math.hypot(O,f)||1,h=-f/u,w=O/u,S=v*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:m,y1:g,x2:d,y2:b,stroke:a,strokeWidth:v+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:m,y1:g,x2:d,y2:b,stroke:t,strokeWidth:v,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:m-h*S,y1:g-w*S,x2:d-h*S,y2:b-w*S,stroke:r,strokeWidth:Math.max(1.5,v*.24),strokeLinecap:"round",opacity:"0.9"})]},E)},l=(m,g,d)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:m-7.5,y:g-5.5,width:"15",height:"11",rx:"2",fill:i,stroke:n,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:m-4,cy:g-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m+4,cy:g-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m-4,cy:g+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m+4,cy:g+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m,cy:g,r:"1",fill:n})]},d),c=(m,g)=>(0,y.jsx)("rect",{x:m-9,y:"110",width:"18",height:"10",fill:a},g),p=(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,y.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,y.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,y.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function Nx({enabled:e}){return(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,y.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,y.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function e0({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,y.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,y.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function lm({onBack:e}){let[t,a]=(0,fl.useState)(0),[r,i]=(0,fl.useState)(xx),[n,o]=(0,fl.useState)(!1),[l,c]=(0,fl.useState)(!1),p=()=>{let f=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return f<=0||!u?0:Math.ceil(f*1e3/u)+1},g=(()=>{let f=r.range?At.ranges[r.range]:At.ranges.standard,u=r.pitch??"22.5",h=At.pitchMultipliers[u],w=(Number.parseFloat(r.spanMM)||0)/1e3,z=(Number.parseFloat(r.overhangMM)||0)>At.overhang.thresholdMM,A=p(),U=A+r.girderCount,R=Number.parseFloat(r.roofLengthM)||0,H=r.treatment?At.treatment[r.treatment]:At.treatment.untreated,oe=At.estimate.ranges[r.range??"standard"],Te=oe.supplyAt8m*Math.max(.7,w/8)*h*(1+H.surchargePct)+(z?At.overhang.surchargePerTruss:0),je=A*Te,Ve=r.girderCount*Te*At.estimate.girderMultiplier,Ne=r.bracing==="yes"?R*At.estimate.bracingPerMetre:0,ve=je+Ve+Ne+At.estimate.delivery,le=At.estimate.design+A*oe.installPerTruss+r.girderCount*40,Fe=ve+le,Ee=Fe*.2;return{range:f,count:A,girderCount:r.girderCount,overhangApplies:z,overhangUnits:U,roofLengthM:R,treatment:H,trussSupply:je,bracingMaterials:Ne,delivery:At.estimate.delivery,labour:le,subtotal:Fe,vat:Ee,total:Fe+Ee}})(),d=()=>{let f=kc[t];return f==="range"?!!r.range:f==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":f==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:f==="bracing"?!!r.bracing&&!!r.treatment:!0},b=t===kc.length-1?"View truss request":"Next",v=()=>{n?o(!1):t===0?e():a(f=>f-1)},E=()=>{d()&&(t===kc.length-1?(c(!1),o(!0)):a(f=>f+1))},O=()=>{let f=kc[t];return f==="range"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(At.ranges).map(([u,h])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>i(w=>({...w,range:u})),children:[(0,y.jsx)(Sx,{type:u}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:h.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:h.blurb})]})]},u))})]}):f==="pitchAndDimensions"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,y.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Span (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>i(h=>({...h,spanMM:u.target.value}))})]}),(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Overhang (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>i(h=>({...h,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",At.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:At.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>i(h=>({...h,pitch:u})),children:[(0,y.jsx)(kx,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):f==="quantityAndGirders"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,y.jsx)("span",{children:"Roof length (m)"}),(0,y.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>i(h=>({...h,roofLengthM:u.target.value}))})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:At.centresOptions.map(u=>(0,y.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>i(h=>({...h,centres:u})),children:(0,y.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,y.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,y.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,y.jsx)("span",{children:r.girderCount}),(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):f==="bracing"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>i(h=>({...h,bracing:u.id})),children:[(0,y.jsx)(Nx,{enabled:u.id==="yes"}),(0,y.jsx)("span",{children:u.label})]},u.id))}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,y.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(e0,{treated:!1}),(0,y.jsx)("span",{children:"Untreated"})]}),(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(e0,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return n?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Your truss estimate"}),(0,y.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,y.jsxs)("div",{className:"truss-request__heading",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,y.jsxs)("h2",{children:[g.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[g.count,(0,y.jsx)("span",{children:"trusses"})]})]}),(0,y.jsxs)("div",{className:"truss-request__grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Span"}),(0,y.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Roof length"}),(0,y.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Pitch"}),(0,y.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Centres"}),(0,y.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Overhang"}),(0,y.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Treatment"}),(0,y.jsx)("strong",{children:g.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:g.girderCount||"None"})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing pack"}),(0,y.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,y.jsxs)("div",{className:"truss-request__price",children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,y.jsxs)("div",{className:"truss-request__price-grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Truss supply allowance"}),(0,y.jsx)("strong",{children:ot(g.trussSupply)})]}),g.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:ot(g.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:ot(g.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:ot(g.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:ot(g.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:ot(g.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:ot(g.total)})]})]}),(0,y.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,y.jsxs)("div",{className:"truss-request__notice",children:[(0,y.jsx)("strong",{children:"Before ordering"}),(0,y.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:v,children:"Back to calculator"}),(0,y.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,y.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Roof Truss Calculator"}),(0,y.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card",children:[(0,y.jsx)("div",{className:"truss-estimator__body",children:O()}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:v,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:E,disabled:!d(),children:[(0,y.jsx)("span",{children:b}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Qt,{})})]})]})]})]})})}var Mi=$(He()),I=$(F()),r0=e=>Number.parseFloat(e)||0,Sc=(e,t)=>r0(e)*(t==="m"?1:.3048),t0=()=>({length:"",width:""}),a0=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function Cx({profile:e}){return(0,I.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,I.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,I.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function sm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Mi.useState)("total"),[n,o]=(0,Mi.useState)("m"),[l,c]=(0,Mi.useState)(""),[p,m]=(0,Mi.useState)([t0()]),[g,d]=(0,Mi.useState)(""),[b,v]=(0,Mi.useState)("chamfered"),E="4.4",O=r==="total"?Sc(l,n):p.reduce((S,z)=>S+2*(Sc(z.length,n)+Sc(z.width,n)),0),f=Math.max(0,O-Sc(g,n)),u=Math.ceil(f/r0(E)),h=[{key:`skirting-${b}`,label:`${a0.find(S=>S.id===b)?.label} skirting board`,qty:f,unit:"m",query:"skirting board",category:"skirting"}],w=(S,z,A)=>{m(U=>U.map((R,H)=>H===S?{...R,[z]:A}:R))};return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)("div",{className:"truss-estimator",children:[(0,I.jsxs)("div",{className:"quick-order-hero",children:[(0,I.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,I.jsx)("h1",{children:"Skirting Board Calculator"}),(0,I.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,I.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,I.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,I.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,I.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>i("total"),children:"Total length"}),(0,I.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>i("rooms"),children:"Room by room"})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,I.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,I.jsx)("span",{children:"Units"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,I.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,I.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Total skirting length (",n,")"]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:S=>c(S.target.value)})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,I.jsx)("span",{children:"Room"}),(0,I.jsxs)("span",{children:["Length (",n,")"]}),(0,I.jsxs)("span",{children:["Width (",n,")"]}),(0,I.jsx)("span",{})]}),p.map((S,z)=>(0,I.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,I.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",z+1]}),(0,I.jsx)("input",{"aria-label":`Room ${z+1} length in ${n}`,type:"number",min:"0",step:"0.01",value:S.length,onChange:A=>w(z,"length",A.target.value)}),(0,I.jsx)("input",{"aria-label":`Room ${z+1} width in ${n}`,type:"number",min:"0",step:"0.01",value:S.width,onChange:A=>w(z,"width",A.target.value)}),p.length>1?(0,I.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>m(A=>A.filter((U,R)=>R!==z)),children:"Remove"}):null]},`room-${z}`)),(0,I.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>m(S=>[...S,t0()]),children:"+ Add another room"})]}),(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Openings and doorways to deduct (",n,") ",(0,I.jsx)("small",{children:"optional"})]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:S=>d(S.target.value)})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.4m white-primed MDF boards."}),(0,I.jsx)("div",{className:"architrave-calculator__profiles",children:a0.map(S=>(0,I.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===S.id?" is-selected":""}`,onClick:()=>v(S.id),children:[(0,I.jsx)(Cx,{profile:S.id}),(0,I.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,I.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,I.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,I.jsxs)("label",{className:"truss-estimator__field",children:[(0,I.jsx)("span",{children:"Board length"}),(0,I.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,I.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Net skirting"}),(0,I.jsxs)("strong",{children:[f.toFixed(2)," m"]})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Board lengths"}),(0,I.jsx)("strong",{children:u})]})]}),(0,I.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,I.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,I.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(h),disabled:f<=0,children:a})]})]})]})})}var Zn=$(He()),ne=$(F()),hl=e=>Number.parseFloat(e)||0;function cm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Zn.useState)("studs"),[n,o]=(0,Zn.useState)(""),[l,c]=(0,Zn.useState)(""),[p,m]=(0,Zn.useState)("600"),[g,d]=(0,Zn.useState)("2.4"),b=n&&l&&p?Math.ceil(hl(l)/(hl(p)/1e3))+1:0,v=b*hl(n),E=hl(g)>0?Math.ceil(v/hl(g)):0,O=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:v,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],f={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},h={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)("div",{className:"truss-estimator",children:[(0,ne.jsxs)("div",{className:"quick-order-hero",children:[(0,ne.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ne.jsx)("h1",{children:"Timber Calculator"}),(0,ne.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,ne.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ne.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,ne.jsxs)("p",{className:"truss-estimator__step-sub",children:[h.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,ne.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(f).map(w=>(0,ne.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>i(w),children:[(0,ne.jsx)("div",{className:"truss-estimator__option-title",children:f[w][0]}),(0,ne.jsx)("div",{className:"truss-estimator__option-copy",children:f[w][1]})]},w))})]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[h.member," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:w=>o(w.target.value)})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[h.overall," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Centres (mm)"}),(0,ne.jsxs)("select",{value:p,onChange:w=>m(w.target.value),children:[(0,ne.jsx)("option",{value:"300",children:"300 mm"}),(0,ne.jsx)("option",{value:"400",children:"400 mm"}),(0,ne.jsx)("option",{value:"450",children:"450 mm"}),(0,ne.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Stock length (m)"}),(0,ne.jsxs)("select",{value:g,onChange:w=>d(w.target.value),children:[(0,ne.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,ne.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,ne.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,ne.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ne.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:h.count}),(0,ne.jsx)("strong",{children:b})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:"Linear metres"}),(0,ne.jsxs)("strong",{children:[v.toFixed(2)," m"]})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsxs)("span",{children:[g," m lengths"]}),(0,ne.jsx)("strong",{children:E})]})]}),(0,ne.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,ne.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ne.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ne.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(O),disabled:v<=0,children:a})]})]})]})})}var um=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:lm},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:em},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Fd},{id:"brick-block",title:"Brick and Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Kd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:am},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:sm},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:Zd},{id:"concrete-aggregate",title:"Concrete and Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:Jd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:om},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:tm},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:cm},{id:"paving",title:"Paving and Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:im}];var pm=$(He());var qx=new Set(["bag","box","roll","pack"]),Ex=new Set(["each","bag","box","roll","pack","tub"]);function gl(e,t){let r=(t?.conversion?.request_uoms_supported??"").split(",").map(o=>o.trim().toLowerCase()).includes("sales_unit");if(e==="each"){let o=(t?.uoi_count??1)===1&&(t?.conversion?.sales_unit_size??1)===1;return r&&o?"sales_unit":e}if(!qx.has(e))return e;if(r)return"sales_unit";let i=t?.uoi;return i!=null&&Ex.has(i.toLowerCase())&&(t?.uoi_count??1)===1?i:e}var i0=new Map;function Mx(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function Ti(e,t,a=12,r){let i=`${Ot().client??""}||${e}||${t??""}||${a}||${r??""}`,n=i0.get(i);if(n)return n;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(za(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await ja(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let p=Array.isArray(c?.items)?c.items.map(Mx):[];return i0.set(i,p),p}async function n0(e,t,a){return await Promise.all(e.map(async i=>{try{let n=a?dl(a,i):null,[o,l]=await Promise.all([n?Ti(n,void 0,void 0,t).then(p=>p.find(m=>m.product_id===n.split(" ")[0]),()=>{}):void 0,Ti(i.query,i.category,void 0,t)]),c=o?[o,...l.filter(p=>p.product_id!==o.product_id)]:l;return{requirement:i,candidates:c}}catch{return{requirement:i,candidates:[]}}}))}async function o0(){let e=await fetch(za("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await ja(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var Wt=$(F()),Tx=1500;function l0(e){let{addManyToCart:t,clearCart:a,openBasket:r}=On(),[i,n]=(0,pm.useState)(!1),[o,l]=(0,pm.useState)(null);return{adding:i,basketError:o,addToBasket:async(p,m)=>{let g=Date.now();n(!0),l(null);try{let d=await Promise.all(p.filter(v=>v.qty>0).map(async v=>{let E=(await Ti(v.search)).find(O=>O.product_id===v.productId);if(!E)throw new Error("A selected product is no longer available in this catalogue.");return Bn(E,{lineId:`${e}:${v.key}`,description:E.description,unit:gl(v.unit??"each",E),qty:v.qty,calculatorWasteIncluded:m})})),b=Tx-(Date.now()-g);b>0&&await new Promise(v=>window.setTimeout(v,b)),a(),t(d),r()}catch(d){l(d instanceof Error?d.message:"Could not add the products to your basket.")}finally{n(!1)}}}}function s0({toolTitle:e}){return(0,Wt.jsx)(Wt.Fragment,{children:(0,Wt.jsxs)("div",{className:"truss-estimator",children:[(0,Wt.jsxs)("div",{className:"quick-order-hero",children:[(0,Wt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Wt.jsx)("h1",{children:"Your Materials"}),(0,Wt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Wt.jsx)("div",{className:"truss-estimator__card",children:(0,Wt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Wt.jsx)(vi,{}),(0,Wt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Cc=$(He());var Le=$(He());var C=$(F()),zx=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],dm={wasteFactorEnabled:!0},Rx=3e3,c0=null;function Nc(e,t){let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Ax(e){return e&&e.length>0?e.join(" x "):"-"}function mm({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:i}){let n=ww(),o=`${e}~${t.map(N=>`${N.key}|${N.query}|${N.category??""}|${N.qty}`).join("~")}`,l=o!==c0,[c,p]=(0,Le.useState)(null),[m,g]=(0,Le.useState)([]),[d,b]=(0,Le.useState)(l),[v,E]=(0,Le.useState)(null),[O,f]=(0,Le.useState)("tile"),[u,h]=(0,Le.useState)(null),[w,S]=(0,Le.useState)(""),[z,A]=(0,Le.useState)(null),[U,R]=(0,Le.useState)(""),[H,oe]=(0,Le.useState)([]),[Te,je]=(0,Le.useState)(new Set),[Ve,Ne]=(0,Le.useState)(null),[ve,le]=(0,Le.useState)(""),[Fe,Ee]=(0,Le.useState)([]),Nt=(0,Le.useRef)(null),Z=(0,Le.useRef)(!1),ge=N=>`${e}:${N}`,Re=N=>Bn(N.chosen,{lineId:ge(N.requirement.key),description:N.requirement.label,unit:gl(N.requirement.unit,N.chosen),qty:N.requirement.qty}),bt=(0,Le.useMemo)(()=>t.map(N=>`${N.key}|${N.query}|${N.category??""}`).join("~"),[t]);(0,Le.useEffect)(()=>{let N=!1;return o0().then(L=>{N||p(L.itemCount>0)}).catch(()=>{N||p(!1)}),()=>{N=!0}},[]),(0,Le.useEffect)(()=>{if(!a||!c)return;let N=!1,L;l&&b(!0),E(null);let X=Date.now();return(async()=>{let ue=null;try{ue=(await n0(t,void 0,e)).map(({requirement:wt,candidates:at})=>({requirement:wt,candidates:at,chosen:at[0]??null}))}catch(ke){N||E(ke instanceof Error?ke.message:"Could not load products")}if(!N){if(c0=o,l){let ke=Rx-(Date.now()-X);ke>0&&await new Promise(wt=>{L=window.setTimeout(wt,ke)})}N||(ue&&(g(ue),!Z.current&&n&&(Z.current=!0,n.addManyToCart(ue.filter(ke=>ke.chosen).map(Re)))),b(!1))}})(),()=>{N=!0,window.clearTimeout(L)}},[a,c,bt]),(0,Le.useEffect)(()=>{if(!z)return;let N=U.trim();if(!N){oe([]);return}let L=!1,X=window.setTimeout(()=>{Ti(N).then(ue=>{L||oe(ue)}).catch(()=>{L||oe([])})},250);return()=>{L=!0,window.clearTimeout(X)}},[z,U]),(0,Le.useEffect)(()=>{if(!Ve)return;let N=ve.trim();if(!N){Ee([]);return}let L=!1,X=window.setTimeout(()=>{Ti(N).then(ue=>{L||Ee(ue)}).catch(()=>{L||Ee([])})},250);return()=>{L=!0,window.clearTimeout(X)}},[Ve,ve]);let jt=(0,Le.useMemo)(()=>{let N=w.trim().toLowerCase(),L=N?m.filter(X=>X.requirement.label.toLowerCase().includes(N)||(X.chosen?.description??"").toLowerCase().includes(N)||(X.chosen?.product_id??"").toLowerCase().includes(N)):m;return u?[...L].sort((X,ue)=>{let ke=X.requirement.label.localeCompare(ue.requirement.label);return u==="asc"?ke:-ke}):L},[m,w,u]),Ct=jt.filter(N=>N.chosen),vt=jt.filter(N=>!N.chosen),be=m.filter(N=>N.chosen),de=be.filter(N=>N.chosen?.price==null).length,tt=be.reduce((N,L)=>N+(Ft(Re(L),dm).lineTotal??0),0);if((0,Le.useEffect)(()=>{i?.(tt)},[tt,i]),!a||c===!1)return null;let T=n?be.filter(N=>n.cart[ge(N.requirement.key)]).length:0,G=Ve?m.find(N=>N.requirement.key===Ve)??null:null,ce=ve.trim()?Fe:G?.candidates??[],we=N=>{let L=z===N.requirement.key;A(L?null:N.requirement.key),R(L?"":N.requirement.query)},Ye=(N,L)=>{let X=m.find(ue=>ue.requirement.key===N);g(ue=>ue.map(ke=>ke.requirement.key===N?{...ke,chosen:L}:ke)),n&&X&&n.cart[ge(N)]&&n.addToCart(Re({...X,chosen:L})),A(null),R("")},qe=N=>{g(L=>L.map(X=>X.requirement.key===N?{...X,chosen:null}:X)),n?.cart[ge(N)]&&n.removeFromCart(ge(N))},k=N=>{Ne(N.requirement.key),le(""),Ee([])},_=()=>{Ne(null),le(""),Ee([])},q=N=>{if(!n)return;let L=ge(N.requirement.key);n.cart[L]?n.removeFromCart(L):n.addToCart(Re(N))},D=N=>{je(L=>{let X=new Set(L);return X.has(N)?X.delete(N):X.add(N),X})},V=N=>{let L=H.length>0?H:N.candidates;return(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",value:U,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:X=>R(X.target.value),"aria-label":`Search a product for ${N.requirement.label}`}),(0,C.jsxs)("div",{className:"estimator-products__options",children:[L.map(X=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${X.product_id===N.chosen?.product_id?" is-selected":""}`,onClick:()=>Ye(N.requirement.key,X),children:[(0,C.jsx)("span",{children:X.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${ot(X.price)}`]})]},X.product_id)),L.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,C.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!d&&(0,C.jsxs)("div",{className:"estimator-products__head",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Matched Products"}),(0,C.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!G&&(0,C.jsx)("div",{className:"results-summary estimator-products__toolbar",children:(0,C.jsxs)("div",{className:"estimator-products__controls",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:w,onChange:N=>S(N.target.value),"aria-label":"Search matched products"}),(0,C.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${O==="tile"?" is-active":""}`,"aria-pressed":O==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>f("tile"),children:(0,C.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,C.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${O==="list"?" is-active":""}`,"aria-pressed":O==="list","aria-label":"List view",title:"List view",onClick:()=>f("list"),children:(0,C.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,C.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,C.jsxs)("details",{ref:Nt,style:{position:"relative"},children:[(0,C.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,C.jsx)("div",{className:"sort-menu-panel",children:zx.map(N=>{let L=u===N.dir;return(0,C.jsxs)("button",{type:"button",className:`sort-menu-item${L?" is-active":""}`,onClick:()=>{h(L?null:N.dir),Nt.current?.removeAttribute("open")},children:[(0,C.jsx)("span",{className:"sort-menu-item__check",children:L?"\u2713":""}),N.label]},N.dir)})})]})]})})]}),G&&(0,C.jsxs)("div",{className:"results-review-page",children:[(0,C.jsxs)("div",{className:"results-review-page__top",children:[(0,C.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:_,children:[(0,C.jsx)(Xr,{}),"Back to results"]}),(0,C.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,C.jsx)("div",{className:"results-review-searchbar",children:(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:ve,onChange:N=>le(N.target.value),"aria-label":`Search a product for ${G.requirement.label}`})}),G.chosen&&(0,C.jsx)("div",{className:"results-candidate-actions",children:(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qe(G.requirement.key),children:"Clear selected product"})})]})]}),(0,C.jsxs)("div",{className:"results-review-page__hero",children:[(0,C.jsx)("div",{className:"results-review-page__image-wrap",children:(0,C.jsx)(Ra,{className:"fill-img results-review-page__image",description:G.chosen?.description||G.requirement.label,photoUrl:G.chosen?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-review-page__summary",children:[(0,C.jsx)("h2",{children:G.requirement.label}),(0,C.jsxs)("p",{className:"results-review-page__meta",children:[wi(G.requirement.qty)," ",ka(G.requirement.unit,G.requirement.qty)]}),G.chosen?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"results-review-page__product",children:G.chosen.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[G.chosen.product_id,G.chosen.price!=null?` \xB7 ${Nc(G.chosen.price,G.chosen.price_basis)}`:""]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,C.jsx)("div",{className:"results-review-page__actions",children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${n?.cart[ge(G.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(G),disabled:!G.chosen||!n,children:n?.cart[ge(G.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),ce.length===0?(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,C.jsxs)("table",{className:"score-breakdown-table",children:[(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("th",{children:"Product"}),(0,C.jsx)("th",{children:"Dims (mm)"}),(0,C.jsx)("th",{children:"Price"}),(0,C.jsx)("th",{"aria-label":"Actions"})]})}),(0,C.jsx)("tbody",{children:ce.map(N=>{let L=N.product_id===G.chosen?.product_id;return(0,C.jsxs)("tr",{className:L?"score-breakdown-row--best":"",children:[(0,C.jsxs)("td",{children:[(0,C.jsx)("div",{children:N.description}),(0,C.jsx)("div",{className:"results-row-meta",children:N.product_id})]}),(0,C.jsx)("td",{children:(0,C.jsx)("span",{className:"unit-badge",children:Ax(N.measurements_mm)})}),(0,C.jsx)("td",{children:N.price!=null?Nc(N.price,N.price_basis):"-"}),(0,C.jsx)("td",{children:(0,C.jsxs)("label",{className:"switch-toggle",title:L?"Currently selected":"Use this candidate",children:[(0,C.jsx)("input",{type:"checkbox",checked:L,onChange:()=>{L?qe(G.requirement.key):Ye(G.requirement.key,N)},"aria-label":L?`${N.description} selected`:`Use ${N.description}`}),(0,C.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},N.product_id)})})]})]}),!G&&d&&(0,C.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,C.jsx)(vi,{}),(0,C.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!G&&v&&(0,C.jsx)("p",{className:"results-empty-hint estimator-products__error",children:v}),!G&&!d&&!v&&jt.length===0&&m.length>0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!G&&!d&&!v&&O==="tile"&&Ct.length>0&&(0,C.jsx)("div",{className:"results-tile-grid",children:Ct.map(N=>{let{requirement:L,chosen:X}=N,ue=X?Ft(Re(N),dm):null,ke=n?!!n.cart[ge(L.key)]:!1;return(0,C.jsxs)("article",{className:"results-tile-card",children:[(0,C.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>k(N),"aria-label":`Review match for ${L.label}`,children:[(0,C.jsx)("div",{className:"results-tile-card__media",children:(0,C.jsx)(Ra,{className:"fill-img results-tile-card__image",description:X?.description||L.label,photoUrl:X?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-tile-card__body",children:[X?(0,C.jsxs)("div",{className:"results-tile-card__heading",children:[(0,C.jsx)("div",{className:"results-tile-card__title",children:X.description}),(0,C.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,C.jsx)("span",{children:X.product_id}),X.price!=null?(0,C.jsx)("span",{children:Nc(X.price,X.price_basis)}):null]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,C.jsxs)("div",{className:"results-tile-card__match",children:[(0,C.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,C.jsx)("div",{className:"results-tile-card__match-name",children:L.label}),(0,C.jsxs)("div",{className:"results-tile-card__meta",children:[wi(L.qty)," ",ka(L.unit,L.qty)]}),ue?.requiredSellUnits!=null?(0,C.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",ue.requiredSellUnits," ",ue.sellUnit,ue.lineTotal!=null?` \xB7 ${ot(ue.lineTotal)}`:""]}):X?(0,C.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,C.jsxs)("div",{className:"results-tile-card__actions",children:[(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>k(N),children:"Review"}),(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(N),disabled:!X||!n,children:ke?"\u2713 Added":"+ Add"})]})]},L.key)})}),!G&&!d&&!v&&O==="list"&&Ct.length>0&&(0,C.jsx)("div",{className:"bom-table-wrap",children:(0,C.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,C.jsxs)("colgroup",{children:[(0,C.jsx)("col",{style:{width:"56px"}}),(0,C.jsx)("col",{className:"col-item"}),(0,C.jsx)("col",{style:{width:"90px"}}),(0,C.jsx)("col",{style:{width:"80px"}}),(0,C.jsx)("col",{style:{width:"220px"}}),(0,C.jsx)("col",{style:{width:"110px"}})]}),(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{className:"bom-col-header",children:[(0,C.jsx)("th",{"aria-label":"Expand"}),(0,C.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,C.jsx)("tbody",{children:Ct.map(N=>{let{requirement:L,chosen:X}=N,ue=X?Ft(Re(N),dm):null,ke=n?!!n.cart[ge(L.key)]:!1,wt=Te.has(L.key);return(0,C.jsxs)(Le.Fragment,{children:[(0,C.jsxs)("tr",{className:"bom-row",children:[(0,C.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,C.jsx)("button",{type:"button",className:"link-btn",onClick:()=>D(L.key),"aria-expanded":wt,"aria-label":wt?"Collapse product options":"Expand product options",children:wt?"\u25BE":"\u25B8"})}),(0,C.jsxs)("td",{style:{paddingLeft:0},children:[(0,C.jsx)("div",{className:"bom-component-name",children:L.label}),ue?.requiredSellUnits!=null&&(0,C.jsxs)("div",{className:"results-row-meta",children:["Order ",ue.requiredSellUnits," ",ue.sellUnit,ue.lineTotal!=null?` \xB7 ${ot(ue.lineTotal)}`:""]})]}),(0,C.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:wi(L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:ka(L.unit,L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:X?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"bom-component-name",children:X.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${Nc(X.price,X.price_basis)}`]})]}):(0,C.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,C.jsx)("td",{style:{textAlign:"center"},children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(N),disabled:!X||!n,children:ke?"\u2713 Added":"+ Add"})})]}),wt&&(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:z===L.key?V(N):(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsxs)("div",{className:"estimator-products__options",children:[N.candidates.map(at=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${at.product_id===X?.product_id?" is-selected":""}`,onClick:()=>Ye(L.key,at),children:[(0,C.jsx)("span",{children:at.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[at.product_id,at.price!=null&&` \xB7 ${ot(at.price)}`]})]},at.product_id)),N.candidates.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(N),children:"Search the catalogue"})]})})})]},L.key)})})]})}),!G&&!d&&!v&&vt.length>0&&(0,C.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Require Matching"}),(0,C.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,C.jsx)("div",{className:"results-unmatched-list",children:vt.map(N=>(0,C.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>k(N),children:[(0,C.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,C.jsx)("span",{className:"results-unmatched-card__title",children:N.requirement.label}),(0,C.jsxs)("span",{className:"results-row-meta",children:[wi(N.requirement.qty)," ",ka(N.requirement.unit,N.requirement.qty)]})]}),(0,C.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},N.requirement.key))})]}),!d&&!v&&m.length>0&&(0,C.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,C.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!G&&!d&&!v&&(r||T>0)&&(0,C.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,C.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),T>0&&n&&(0,C.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:n.openBasket,children:[(0,C.jsxs)("span",{children:["View Basket (",T,")"]}),(0,C.jsx)("span",{className:"arrow",children:(0,C.jsx)(Qt,{})})]})]})]})}var Gt=$(F());function fm({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[i,n]=(0,Cc.useState)(0),o=(0,Cc.useCallback)(l=>n(l),[]);return(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)("div",{className:"truss-estimator",children:[(0,Gt.jsxs)("div",{className:"quick-order-hero",children:[(0,Gt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Gt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Gt.jsx)("h1",{children:"Your Materials"}),i>0&&(0,Gt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Gt.jsx)("strong",{children:ot(i)})," Est. total"]})]}),(0,Gt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Gt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Gt.jsx)(mm,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var ze=$(F());function qc(e){let[t,a]=(0,Va.useState)(!1);return(0,ze.jsx)(lc,{onOpenBasket:()=>a(!0),children:(0,ze.jsx)(Ux,{...e,showBasket:t,onShowBasket:a})})}function Ux({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:i}){let[n,o]=(0,Va.useState)(null),[l,c]=(0,Va.useState)(null),p=um.find(U=>U.id===n),{cart:m,updateCartQty:g,updateCartSellUnits:d,updateCartConversions:b,removeFromCart:v,clearCart:E}=On(),{adding:O,basketError:f,addToBasket:u}=l0(p?.title??"calculator"),h=(0,Va.useRef)(null),w=Js("estimating-tools",h);(0,Va.useEffect)(()=>{w("viewed")},[w]);let S=r?"basket":O?"adding":l?"review":n??"list",z=(0,Va.useRef)(S);(0,Va.useEffect)(()=>{z.current!==S&&(z.current=S,window.scrollTo(0,0))},[S]);let A=U=>{if(!p)return;w("estimate_completed",{calculator:p.id,lines:U.length});let R=Bw(p.id,U);R?u(R,U[0]?.calculatorWasteIncluded??!1):c(U)};return(0,ze.jsx)(tl.Provider,{value:w,children:(0,ze.jsx)("div",{ref:h,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${a?"":" estimating-tools--customer"}`,style:Ot().theme,children:(0,ze.jsx)("main",{className:"main-content",children:r?(0,ze.jsx)(ul,{cart:m,onUpdateQty:g,onUpdateSellUnits:d,onResolveConversions:b,onRemove:v,onBack:()=>i(!1),onStartNewQuote:()=>{E(),o(null),c(null),i(!1)},internal:a}):O&&p?(0,ze.jsx)(s0,{toolTitle:p.title}):p?(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)("div",{hidden:l!==null,children:(0,ze.jsx)(p.Component,{onBack:()=>o(null),onReview:A})}),f&&(0,ze.jsx)("p",{className:"results-empty-hint estimator-products__error",children:f}),l!==null&&(0,ze.jsx)(fm,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,ze.jsx)(ze.Fragment,{children:(0,ze.jsxs)("div",{className:"quick-order-card",children:[(0,ze.jsxs)("div",{className:"quick-order-hero",children:[(0,ze.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,ze.jsx)("h1",{children:"Estimating Tools"}),(0,ze.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,ze.jsxs)("div",{className:"quick-order-alt",children:[(0,ze.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,ze.jsx)("div",{className:"estimator-tools-grid",children:um.map(U=>(0,ze.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{w("calculator_selected",{calculator:U.id}),o(U.id),c(null)},children:[(0,ze.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,ze.jsx)("img",{className:"fill-img estimator-tool-card__image",src:It(U.imageUrl),alt:""})}),(0,ze.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,ze.jsx)("span",{className:"estimator-tool-card__title",children:U.title}),(0,ze.jsx)("span",{className:"estimator-tool-card__desc",children:U.desc})]})]},U.id))})]})]})})})})})}var Ec=$(F());function hm({config:e,children:t}){return wv(e),(0,Ec.jsx)(Ec.Fragment,{children:t})}var gm=$(F()),Dx="https://api.metronlabs.ai",Ox=["client","api-key","api-url","theme","hide-header","analytics"],Bx=["all","events-only","none"];function p0(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.68",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let i=document.createElement("div"),n=document.createElement("style");n.textContent=`:host { display: block; }
6974
+ C24 timber 4.8m`,value:d,onChange:Z=>b(Z.target.value),"aria-label":"Paste schedule line items"}),R&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",R]}),(0,J.jsxs)("div",{className:"quick-order-hint",children:[(0,J.jsx)("strong",{children:"Tip:"}),'\xA0Paste one line per item. Include a count, e.g. "x10", to help us find the right stock and pricing.']}),(0,J.jsx)("div",{className:"quick-order-actions",children:(0,J.jsxs)("button",{type:"button",className:"cta-btn",disabled:!U||!!R,onClick:()=>{l("list_submitted",{method:"paste",lines:U}),Ne(()=>e(d))},"aria-label":"Match pasted lines",children:[(0,J.jsx)("span",{children:"Match line items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Qt,{})})]})})]}):(0,J.jsxs)(J.Fragment,{children:[O&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",O]}),(0,J.jsxs)("div",{className:`upload-zone${v?" has-file":""}`,onClick:()=>o.current?.click(),onDragOver:Z=>Z.preventDefault(),onDrop:Nt,role:"button",tabIndex:0,onKeyDown:Z=>(Z.key==="Enter"||Z.key===" ")&&o.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[z?(0,J.jsx)("img",{src:z,alt:v?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,J.jsx)("div",{className:"upload-zone-icon",children:(0,J.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,J.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,J.jsx)("polyline",{points:"14,2 14,8 20,8"}),(0,J.jsx)("polyline",{points:"9,15 11,17 15,13"})]})}),v?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("div",{className:"upload-zone-subtext",children:v.name}),(0,J.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:Z=>{Z.stopPropagation(),E(null),f(""),o.current&&(o.current.value="")},children:"Remove"})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,J.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,J.jsx)("input",{ref:o,type:"file",accept:C_,className:"visually-hidden",onChange:Z=>Ve(Z.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,J.jsx)("div",{className:"quick-order-actions",children:(0,J.jsxs)("button",{type:"button",className:"cta-btn",disabled:!v,onClick:()=>{we()},"aria-label":"Match uploaded items",children:[(0,J.jsx)("span",{children:"Match items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Qt,{})})]})})]})}),(0,J.jsx)("aside",{className:"quick-order-sidebar",children:q_[m].map((Z,ge)=>(0,J.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,J.jsx)("span",{className:"quick-order-step-dot",children:ge+1}),(0,J.jsxs)("div",{children:[(0,J.jsx)("div",{className:"quick-order-step-title",children:Z.title}),(0,J.jsx)("div",{className:"quick-order-step-desc",children:Z.desc})]})]},Z.title))})]}),u&&(0,J.jsx)("div",{className:"quick-order-matching-overlay",children:(0,J.jsx)(hv,{})})]})]})})]})]})}var Rt=$(He()),yv=$(F());function Un(e){return JSON.stringify([e.productId,e.qty,e.unit,e.linkedContext??[]])}function E_(e,t){let a={...e,[t.lineId]:t};for(let[r,i]of Object.entries(a)){if(!i.linkedContext)continue;let n=i.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=n?.line_id?a[n.line_id]:void 0;if(!(!n||!o||n.product_id===o.productId&&n.description===o.description)){if(i.conversionType!=="basket_line_unit"){a[r]={...i,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...i,qty:0,sellUnitsOverride:null,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var qd=(0,Rt.createContext)(null);function lc({children:e,onOpenBasket:t}){let[a,r]=(0,Rt.useState)({}),i=(0,Rt.useCallback)(d=>{r(b=>E_(b,d))},[]),n=(0,Rt.useCallback)(d=>{r(b=>{let v={...b};for(let E of d)v[E.lineId]=E;return v})},[]),o=(0,Rt.useCallback)(d=>{r(b=>{let v={...b};return delete v[d],v})},[]),l=(0,Rt.useCallback)((d,b)=>{r(v=>v[d]?{...v,[d]:{...v[d],qty:b,sellUnitsOverride:null}}:v)},[]),c=(0,Rt.useCallback)((d,b)=>{r(v=>v[d]?{...v,[d]:{...v[d],sellUnitsOverride:b}}:v)},[]),p=(0,Rt.useCallback)(d=>{r(b=>{let v=!1,E={...b};for(let[O,f]of Object.entries(d))E[O]&&(E[O]={...E[O],...f},v=!0);return v?E:b})},[]),m=(0,Rt.useCallback)(()=>r({}),[]),g=(0,Rt.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:i,addManyToCart:n,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:m,openBasket:t??(()=>{})}),[a,i,n,o,l,c,p,m,t]);return(0,yv.jsx)(qd.Provider,{value:g,children:e})}function Dn(){let e=(0,Rt.useContext)(qd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function vv(){return(0,Rt.useContext)(qd)}var dt=$(He());function vi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function nt(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}var Nv=e=>(e??"").trim().toLowerCase(),M_={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",piece:"each",pieces:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Ed=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),_v=new Set(["box","bag","pack","pallet","roll","set","tub"]),Md=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Td=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,mr=e=>{let t=Nv(e);return M_[t]??t},at=(e,t)=>{let a=mr(e),r=mr(t);return a.length>0&&a===r},xv=(e,t)=>{let a=Nv(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},T_=e=>(e??"").split(",").map(t=>mr(t)).filter(Boolean),z_=(e,t)=>{let a=T_(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||at(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||at(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||at(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},kv=(e,t)=>at(t,"pallet")?e.itemsPerPallet??null:at(t,"pack")?e.itemsPerPack??null:at(t,"box")?e.itemsPerBox??null:null,Sv=(e,t)=>{let a=t==="volume"?/(\d+(?:[.,]\d+)?)\s*(ml|l|ltr|ltrs|litres?|liters?)\b/i:/(\d+(?:[.,]\d+)?)\s*(kg|kgs|tonnes?)\b/i,r=e.description.match(a);if(!r)return null;let i=Number.parseFloat(r[1].replace(",","."));if(!Number.isFinite(i)||i<=0)return null;let n=r[2].toLowerCase();return t==="volume"?{ml:n==="ml"?i:i*1e3}:{g:n.startsWith("tonne")?i*1e6:i*1e3}},R_=["volume_from_description","same_unit_volume"],A_=["weight_from_description","mass_from_pack","same_unit_mass"],U_=(e,t,a)=>{if(!at(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!at(r[3],a))return null;let i=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(i)&&i>0?i:null};function sc(e,t){let a=e.map(r=>Ft(r,t).lineTotal);return a.some(r=>r==null)?null:a.reduce((r,i)=>r+(i??0),0)}function Ft(e,t){let a=e.qty,r=mr(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=mr(e.unit)||(a>0&&Ed.has(r)?r:"-"),n=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?Ed.has(r)?Math.ceil(e.sellUnitsOverride):e.sellUnitsOverride:null,p=R=>({requestedAmount:a,requestedUnit:i,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${R} Order quantity set to ${c} ${r}.`:R,costingMode:"review"});if(!Number.isFinite(a)||a<=0)return p("Quantity needs confirmation.");let m=Md(a,i),g=Td(a,i),d=at(i,r)?null:m!=null&&!R_.includes(e.conversionType??"")?Sv(e,"volume"):g!=null&&!A_.includes(e.conversionType??"")?Sv(e,"weight"):null,b=d?.ml!=null?m:g,v=d?.ml??d?.g??null;if(b!=null&&v!=null){let R=mr(e.uoi)||r,H=d?.ml!=null?`${v/1e3} l`:`${v/1e3} kg`,oe=l?c:Math.ceil(b*(1+o)/v-1e-9);return{requestedAmount:a,requestedUnit:i,salesUnitSize:1,sellUnit:R,calculatedSellUnits:oe,requiredSellUnits:oe,unitPrice:e.price,lineTotal:e.price!=null?e.price*oe:null,calculation:`${a} ${i}${o>0?` x ${1+o}`:""} / ${H} per ${R} (from product description) = ${oe} ${R}`,costingMode:"derived"}}if(i==="sales_unit"){let R=mr(e.uoi)||r,H=l?c:xv(a*(1+o),e.roundingRule??"round_up_each");return{requestedAmount:a,requestedUnit:R,salesUnitSize:1,sellUnit:R,calculatedSellUnits:H,requiredSellUnits:H,unitPrice:e.price,lineTotal:e.price!=null?e.price*H:null,calculation:`${a} ${R}${o>0?` x ${1+o}`:""} = ${H} ${R}`,costingMode:"direct"}}if(!z_(e,i))return p("Requested unit is not supported by this catalogue conversion.");let E=null,O="review",f=e.roundingRule,u=`Quantity review required, initial request needed ${a} ${i}.`,h=1+o,w=U_(e,i,r),k=e.unitConversions?.find(R=>at(R.requestUom,i));if(!!e.saleUnit&&(at(i,r)||!!k||at(i,"each")&&!_v.has(r)))if(at(i,r))E=a*h/n,O="direct",u=`${a} ${i}${o>0?` x ${h}`:""}`;else if(k){E=a*h/k.quantityPerSaleUnit,O="derived";let R=1/k.quantityPerSaleUnit,H=Math.round(R);u=at(r,"each")&&k.quantityPerSaleUnit<1&&Math.abs(R-H)<1e-9?`${a} ${i}${o>0?` x ${h}`:""} x ${H} per ${i}`:`${a} ${i}${o>0?` x ${h}`:""} / ${k.quantityPerSaleUnit} ${i} per ${r}`}else at(i,"each")&&!_v.has(r)&&(E=a*h/n,O="derived",u=`${a} ${r}${o>0?` x ${h}`:""}`);else if(at(i,r)&&n>0)E=a*h/n,O="direct",u=o>0?`${a} ${i} x ${h} / ${n} ${r} per sell unit`:`${a} ${i} / ${n} ${r} per sell unit`;else if(at(i,"each")&&n>0&&Ed.has(r))E=a*h/n,O="derived",u=o>0?`${a} each x ${h} / ${n} each per ${r}`:`${a} each / ${n} each per ${r}`;else if(kv(e,i)!=null&&n>0){let R=kv(e,i)??0;E=a*R*h/n,O="derived";let H=`${a} ${i} x ${R} each${o>0?` x ${h}`:""}`;u=n===1&&at(r,"each")?H:`${H} / ${n} each per ${r}`}else if(w!=null)E=a*h/w,O="derived",f??(f="round_up_each"),u=`${a} m2 x ${h} / ${w} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")n>0&&(E=a*h/n,O="derived",u=`${a} ${i}${o>0?` x ${h}`:""} / ${n} ${i} per ${r}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${i}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let R=e.coverageQty??e.derivedCoverageM2??null;at(i,"m2")&&R!=null&&R>0&&(E=a*h/R,O="derived",u=`${a} m2 x ${h} / ${R} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let R=e.coverageQty??null;at(i,"m2")&&R!=null&&R>0?(E=a/R,O="derived",u=`${a} m2 / ${R} m2 per sell unit`):at(i,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&n>0&&(E=a*e.itemsPerM2*h/n,O="derived",u=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${h} / ${n}`)}else if(e.conversionType==="length_from_dims"){let R=e.coverageQty??e.derivedLengthM??null;at(i,"m")&&R!=null&&R>0&&(E=a*h/R,O="derived",u=`${a} m x ${h} / ${R} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let R=Md(a,i),H=Md(e.coverageQty??0,mr(e.coverageUom));R!=null&&H!=null&&H>0&&(E=R*h/H,O="derived",u=`${a} ${i} x ${h} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"||e.conversionType==="mass_from_pack"){let R=mr((e.coverageUom??"").split(" ")[0]),H=Td(a,i),oe=Td(e.coverageQty??0,R);H!=null&&oe!=null&&oe>0&&(E=H*h/oe,O="derived",u=`${a} ${i} x ${h} / ${e.coverageQty} ${R} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let R=e.coverageQty??null;at(i,"m3")&&R!=null&&R>0&&(E=a/R,O="derived",u=`${a} m3 / ${R} m3 per ${r}`)}}if(E==null||!Number.isFinite(E)||E<0)return p(`Quantity review required, initial request needed ${a} ${i}.`);let A=xv(E,f),U=l?c:A;return{requestedAmount:a,requestedUnit:i,salesUnitSize:n,sellUnit:r,calculatedSellUnits:A,requiredSellUnits:U,unitPrice:e.price,lineTotal:e.price!=null&&U!=null?e.price*U:null,calculation:l?`${u} = ${A} ${r} (manually set to ${U})`:`${u} = ${U} ${r}`,costingMode:O}}var nl=$(F());function zd({unit:e}){return(0,nl.jsx)(nl.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,nl.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Cv=$(F());function D_(e,t){return t===1||/^m\d*$/i.test(e)?e:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function _a(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?D_(r,t):r}function xa(e,t){let a=_a(e,t);return a?(0,Cv.jsx)(zd,{unit:a}):null}function ol(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=_a(a[1]);return r?`per ${r}`:""}var qv=()=>import("./xlsx-K4MOA2QM.js"),sl=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Review required","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],O_=sl.indexOf("Line total");function B_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.best?"Selected":"Needs review"}async function Ev(e){let t=await qv(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),i=[sl],n=0;for(let c of e){let{item:p,best:m,qty:g,band:d,unmatchable:b,decision:v}=c,E=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),O=!b&&m?.price!=null?m.price*g:null;O!=null&&(n+=O),i.push([p.source_line_id,p.line_id,p.description_original||"(no description)",E,g,p.unit,p.procurement_intent||"-",p.procurement_aliases.join(", "),p.build_up_type,p.layer_count,p.total_required_thickness_mm,p.installation_clues.join(", "),p.system_clues.join(", "),p.component_requirements.join(", "),m?"no":"yes",v?.reason??"",b?"-":m?.product_id??v?.selected_candidate_id??"-",b?"-":m?.description??"-",b?"-":m?.price_basis??"-",b?null:m?.price??null,O,b?"-":d,B_(c)])}i.push(Array(sl.length).fill(null));let o=Array(sl.length).fill(null);o[0]="Estimated total",o[O_]=n,i.push(o),i.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(sl.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(i);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var ll=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Mv(e,t){let a=await qv(),r=a.utils.book_new(),i=new Date().toISOString().slice(0,10),n=t?[["Account",t.name+" ("+t.id+")"],[],ll]:[ll],o=0;for(let p of e){let m=Ft(p),g=m.lineTotal;g!=null&&(o+=g),n.push([p.productId,p.description,m.costingMode,m.requestedAmount,_a(m.requestedUnit),m.salesUnitSize,_a(m.sellUnit),m.requiredSellUnits,m.unitPrice,g])}n.push(Array(ll.length).fill(null));let l=Array(ll.length).fill(null);l[0]="Estimated total",l[ll.length-1]=o,n.push(l);let c=a.utils.aoa_to_sheet(n);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${i}.xlsx`:`basket-${i}.xlsx`)}var Rd=$(F());function Vr(){return(0,Rd.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Rd.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ad=$(F());function yi(){return(0,Ad.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,Ad.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var _i=$(F());function Ud(){return(0,_i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,_i.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,_i.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,_i.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,_i.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var ja=$(F());function Dd(e){return(0,ja.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,ja.jsx)("rect",{width:"640",height:"420",fill:"#fbf1cf"}),(0,ja.jsx)("rect",{x:"88",y:"78",width:"432",height:"264",rx:"16",fill:"#f0c43f"}),(0,ja.jsx)("rect",{x:"120",y:"110",width:"368",height:"200",rx:"10",fill:"#ffd95e"}),(0,ja.jsxs)("g",{stroke:"#e2b12e",strokeWidth:"8",opacity:"0.75",children:[(0,ja.jsx)("line",{x1:"140",y1:"140",x2:"468",y2:"140"}),(0,ja.jsx)("line",{x1:"140",y1:"190",x2:"468",y2:"190"}),(0,ja.jsx)("line",{x1:"140",y1:"240",x2:"468",y2:"240"})]})]})}var Xr=$(F());function Od(e){return(0,Xr.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,Xr.jsx)("rect",{width:"640",height:"420",fill:"#edf1f5"}),(0,Xr.jsx)("rect",{x:"132",y:"108",width:"376",height:"204",rx:"18",fill:"#d5dde6"}),(0,Xr.jsx)("rect",{x:"168",y:"144",width:"304",height:"24",rx:"12",fill:"#9aa6b2"}),(0,Xr.jsx)("rect",{x:"168",y:"188",width:"250",height:"24",rx:"12",fill:"#aab5c0"}),(0,Xr.jsx)("rect",{x:"168",y:"232",width:"220",height:"24",rx:"12",fill:"#aab5c0"})]})}var Bd=$(F()),L_=[{match:["building sand"],path:"/schedule-products/building-sand.webp"},{match:["drywall screw"],path:"/schedule-products/drywall-screws.webp"},{match:["scrim"],path:"/schedule-products/scrim-tape.webp"},{match:["loft insulation","loft roll"],path:"/schedule-products/loft-insulation-roll.webp"},{match:["wall tie"],path:"/schedule-products/wall-ties.webp"},{match:["red multi","multi stock","brick"],path:"/schedule-products/red-multi-stock-bricks.webp"}];function za({description:e,photoUrl:t,className:a,width:r,height:i}){let n=(e||"").toLowerCase(),o=L_.find(p=>p.match.some(m=>n.includes(m))),l=t||o&&It(o.path);if(l)return(0,Bd.jsx)("img",{className:a,src:l,alt:"",width:r,height:i});let c=n.includes("insulation")?Dd:Od;return(0,Bd.jsx)(c,{className:a,width:r,height:i})}var M=$(F()),Tv=.2,cl=10,zv="Enter a valid email address so we can send your quote.",H_=(e,t)=>{let a=`${t.requestedAmount} ${_a(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${_a(t.sellUnit,t.requiredSellUnits??0)}`,i=e.unitConversions?.find(n=>n.requestUom===t.requestedUnit);return i&&i.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/i.quantityPerSaleUnit)} ${_a(t.sellUnit,2)} per ${_a(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},Q_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${_a(e.sellUnit,1)}.`;function ul({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:i,onBack:n,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,dt.useId)(),m=En(),g=!c&&Is()==="QZA6-MRA4",d=!c,b=Object.values(e),v=(0,dt.useRef)(new Map),[E,O]=(0,dt.useState)(""),[f,u]=(0,dt.useState)(!1),[h,w]=(0,dt.useState)(!1),[k,z]=(0,dt.useState)(""),[A,U]=(0,dt.useState)({}),[R,H]=(0,dt.useState)({}),[oe,Te]=(0,dt.useState)(1),[je,Ve]=(0,dt.useState)({}),[Ne,we]=(0,dt.useState)(!1),[le,Fe]=(0,dt.useState)("0"),[Ee,Nt]=(0,dt.useState)({});(0,dt.useEffect)(()=>{if(!r)return;for(let D of Object.values(e))Ft(D).requiredSellUnits!=null&&v.current.delete(D.lineId);let _=Object.values(e).filter(D=>{if(D.productId==="-"||Ft(D).requiredSellUnits!=null)return!1;let V=Un(D);return v.current.get(D.lineId)===V?!1:(v.current.set(D.lineId,V),!0)});if(_.length===0)return;let q=new Map(_.map(D=>[D.lineId,Un(D)]));Nt(D=>({...D,...Object.fromEntries(q)})),fetch(Ta("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Mn()},body:JSON.stringify({lines:_.map(D=>({line_id:D.lineId,product_id:D.productId,requested_description:D.requestedDescription??D.description,requested_qty:D.qty,requested_uom:D.unit||null,linked_context:D.linkedContext??[],selected_description:D.description,selected_uoi:D.uoi,selected_uoi_count:D.uoiCount,selected_conversion:{sales_uom_normalised:D.salesUomNormalised,conversion_type:D.conversionType,sales_unit_size:D.salesUnitSize,sales_unit_size_uom:D.salesUnitSizeUom,coverage_qty:D.coverageQty,coverage_uom:D.coverageUom}}))})}).then(D=>D.ok?Ga(D):null).then(D=>{let V={},N=new Map(_.map(L=>[L.lineId,Un(L)]));for(let L of D?.data?.items??D?.items??[]){let X=L?.conversion;!X||typeof L?.line_id!="string"||v.current.get(L.line_id)!==N.get(L.line_id)||(V[L.line_id]={conversionConfidence:X.conversion_confidence,conversionNotes:X.conversion_notes,...Number.isFinite(X.suggested_order_qty)&&X.suggested_order_qty>0?{sellUnitsOverride:X.suggested_order_qty}:{}})}Object.keys(V).length>0&&r(V)}).catch(D=>console.error("Catalogue conversion resolution failed",D)).finally(()=>{Nt(D=>{let V={...D};for(let[N,L]of q)V[N]===L&&delete V[N];return V})})},[e,r]);function Z(_){U(q=>{let D={...q};return delete D[_],D})}function ge(_,q){let D=parseFloat(q);!isNaN(D)&&D>=0&&t(_,Math.min(D,1e5)),Z(_)}function Re(_,q,D){t(_,Math.min(1e5,Math.max(0,q+D))),Z(_)}function bt(_){H(q=>{let D={...q};return delete D[_],D})}function jt(_,q){let D=parseFloat(q);!isNaN(D)&&D>=0&&a(_,Math.min(D,1e5)),bt(_)}function Ct(_,q,D){a(_,Math.min(1e5,Math.max(0,q+D))),bt(_)}async function wt(){if(be.some(({pricing:q})=>q.lineTotal==null)){z(g?"Confirm the highlighted quantities before requesting a quote.":"Confirm the highlighted quantities before sending your basket.");return}let _=E.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(_)){z(zv);return}z(""),w(!0);try{let q=await fetch(Ta("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Mn()},body:JSON.stringify({email:_,items:be.map(({item:D,pricing:V})=>{let N=V.requiredSellUnits??V.requestedAmount,L=V.requiredSellUnits!=null?V.sellUnit:V.requestedUnit;return{product_id:D.productId,description:D.description,quantity:N,unit:_a(L,N),unit_price:V.requiredSellUnits!=null?V.unitPrice:null,line_total:V.lineTotal}})})});if(!q.ok){let D=await Ga(q);console.error("Quote request failed",q.status,D?.message),z(q.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}T!=null&&m("quote_requested",{items:be.length,total:Math.round(T*100)/100}),u(!0),l?.(),window.scrollTo(0,0)}catch{z("Your request couldn't be sent. Check your connection and try again.")}finally{w(!1)}}let be=b.map(_=>({item:_,pricing:Ft(_,{wasteFactorEnabled:Ne,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100})})),de=sc(b,{wasteFactorEnabled:Ne,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100}),tt=de==null?null:de*Tv,T=de==null?null:de*(1+Tv),G=be.filter(({pricing:_})=>_.lineTotal==null).length,ie=Object.keys(Ee).length,ce=!!r&&b.some(_=>{if(_.productId==="-"||Ft(_).requiredSellUnits!=null)return!1;let q=Un(_);return v.current.get(_.lineId)!==q||Ee[_.lineId]===q}),ve=(0,dt.useRef)({items:be.length,...T==null?{}:{total:Math.round(T*100)/100}});(0,dt.useEffect)(()=>{m("basket_viewed",ve.current)},[m]);let Ye=Math.max(1,Math.ceil(be.length/cl)),qe=Math.min(oe,Ye),x=be.slice((qe-1)*cl,qe*cl);return f?(0,M.jsx)("div",{className:"wizard-step entry-stage",children:(0,M.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,M.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,M.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,M.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,M.jsx)("h1",{children:g?"Quote requested":"Basket sent"}),g?(0,M.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,M.jsx)("strong",{children:E.trim()}),", usually within one working day."]}):(0,M.jsxs)("p",{children:["You're all done. We'll email ",(0,M.jsx)("strong",{children:E.trim()})," to confirm prices, availability and delivery, usually within one working day."]}),(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,M.jsx)("span",{children:g?"Start a new quote":"Start a new basket"})}),(0,M.jsx)("p",{className:"quote-request-sent-note",children:g?"Nothing is charged until you approve the quote.":"Nothing is charged until you approve the order."})]})}):!c&&b.length===0?(0,M.jsx)("div",{className:"wizard-step entry-stage",children:(0,M.jsxs)("div",{className:"quote-request-sent",children:[(0,M.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,M.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,M.jsx)("path",{d:"M3 9h18l-2 11H5z"}),(0,M.jsx)("path",{d:"M8 9l4-6 4 6"})]})}),(0,M.jsx)("h1",{children:g?"Your quote request is empty":"Your basket is empty"}),(0,M.jsx)("p",{children:g?"Start again with your list to build your quote.":"Start again with your list to fill your basket."}),(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,M.jsx)("span",{children:"Back to start"})})]})}):(0,M.jsx)("div",{className:`wizard-step entry-stage${g?" basket-layout--qza6-mra4":""}`,children:(0,M.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,M.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,M.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,M.jsxs)("div",{className:"basket-hero-copy",children:[g&&(0,M.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:n,children:[(0,M.jsx)(Vr,{}),(0,M.jsx)("span",{children:"Back to results"})]}),(0,M.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,M.jsx)("h1",{children:c?"Your Selection":g?"Request a quote":"Your Basket"}),c&&(0,M.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,M.jsx)("strong",{children:b.length})," ",b.length===1?"item":"items"]})]}),(0,M.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":g?"Check your items and quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary, then send us your basket."})]})]}),(0,M.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:ce?(0,M.jsxs)("div",{className:"basket-resolving",role:"status","aria-label":"Calculating order quantities",children:[(0,M.jsx)("span",{className:"basket-resolving-wheel","aria-hidden":"true"}),(0,M.jsx)("span",{children:"Calculating your quantities\u2026"})]}):b.length===0?(0,M.jsxs)("div",{className:"quick-order-history-empty",children:[(0,M.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:"\u{1F4CB}"}),(0,M.jsx)("p",{children:"Your selection is empty."}),(0,M.jsx)("p",{className:"basket-empty-hint",children:"Go back to your results and add quoted items."}),(0,M.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,M.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:n,"aria-label":"Back to results",children:(0,M.jsx)("span",{children:"Back to Results"})})})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("div",{className:"basket-layout",children:[(0,M.jsxs)("div",{className:"basket-main",children:[(0,M.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":g?"Quote request items":"Basket items",children:x.map(({item:_,pricing:q})=>{let D=A[_.lineId]??String(q.requestedAmount),V=q.requestedUnit===q.sellUnit||q.costingMode==="review",N=q.requiredSellUnits==null||q.requestedAmount!==q.requiredSellUnits||q.requestedUnit!==q.sellUnit;return(0,M.jsxs)("article",{className:"basket-card",children:[(0,M.jsxs)("div",{className:"basket-card-top",children:[(0,M.jsx)(za,{className:"basket-card-thumb",description:_.description,photoUrl:_.pdpPhotoUrl,width:48,height:48}),(0,M.jsxs)("div",{className:"basket-card-info",children:[(0,M.jsx)("div",{className:"bom-component-name",children:_.description}),N&&q.costingMode!=="review"&&(0,M.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Ve(L=>({...L,[_.lineId]:!L[_.lineId]})),"aria-expanded":!!je[_.lineId],children:["How we calculated this",(0,M.jsx)("span",{className:`basket-calc-toggle-chevron${je[_.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("div",{className:"basket-card-actions",children:(0,M.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>i(_.lineId),"aria-label":`Remove ${_.description}`,children:(0,M.jsx)(Ud,{})})})]}),c&&(0,M.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,M.jsxs)("dl",{className:"results-detail-grid",children:[(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Conversion type"}),(0,M.jsx)("dd",{children:_.conversionType??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Conversion confidence"}),(0,M.jsx)("dd",{children:_.conversionConfidence??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Sales unit"}),(0,M.jsx)("dd",{children:_.salesUnitSize!=null?(0,M.jsxs)(M.Fragment,{children:[_.salesUnitSize," ",xa(_.salesUnitSizeUom,_.salesUnitSize)]}):"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Coverage"}),(0,M.jsx)("dd",{children:_.coverageQty!=null?(0,M.jsxs)(M.Fragment,{children:[_.coverageQty," ",xa(_.coverageUom,_.coverageQty)]}):"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Waste factor"}),(0,M.jsx)("dd",{children:_.wasteFactorDefault??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Rounding rule"}),(0,M.jsx)("dd",{children:_.roundingRule??"-"})]})]}),_.conversionNotes&&(0,M.jsx)("p",{className:"results-rerank-note",children:_.conversionNotes})]}),q.costingMode==="review"?(0,M.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,M.jsx)("strong",{children:Ee[_.lineId]===Un(_)?"Calculating order quantity\u2026":"Quantity needs confirmation."})," ",Q_(q)]}):N&&je[_.lineId]?(0,M.jsx)("p",{className:"basket-calc-text",children:H_(_,q)}):null,(0,M.jsxs)("div",{className:"basket-card-stats",children:[(0,M.jsxs)("div",{className:"basket-stat",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsxs)("div",{className:"basket-qty-field",children:[(0,M.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:D,disabled:V,onChange:L=>U(X=>({...X,[_.lineId]:L.target.value})),onBlur:L=>ge(_.lineId,L.target.value),onKeyDown:L=>{L.key==="Enter"&&L.target.blur()},"aria-label":`${_.description} requested quantity`}),(0,M.jsxs)("div",{className:"basket-qty-arrows",children:[(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:V,onClick:()=>Re(_.lineId,parseFloat(D)||0,1),"aria-label":`Increase ${_.description} quantity`,children:(0,M.jsx)(yi,{})}),(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:V,onClick:()=>Re(_.lineId,parseFloat(D)||0,-1),"aria-label":`Decrease ${_.description} quantity`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("span",{className:"basket-metric-unit",children:xa(q.requestedUnit,parseFloat(D)||0)})]})]}),(0,M.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsxs)("div",{className:"basket-qty-field",children:[(0,M.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:R[_.lineId]??String(q.requiredSellUnits??""),onChange:L=>H(X=>({...X,[_.lineId]:L.target.value})),onBlur:L=>jt(_.lineId,L.target.value),onKeyDown:L=>{L.key==="Enter"&&L.target.blur()},"aria-label":`${_.description} order quantity`}),(0,M.jsxs)("div",{className:"basket-qty-arrows",children:[(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>Ct(_.lineId,parseFloat(R[_.lineId]??String(q.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${_.description} order quantity`,children:(0,M.jsx)(yi,{})}),(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>Ct(_.lineId,parseFloat(R[_.lineId]??String(q.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${_.description} order quantity`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("span",{className:"basket-metric-unit",children:xa(q.sellUnit,parseFloat(R[_.lineId]??String(q.requiredSellUnits??"0"))||0)})]})]}),(0,M.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsx)("strong",{children:q.lineTotal!=null?nt(q.lineTotal):"-"}),q.lineTotal!=null&&(0,M.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},_.lineId)})}),Ye>1&&(0,M.jsxs)("div",{className:"results-pagination",children:[(0,M.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(qe-1)*cl+1,"\u2013",Math.min(qe*cl,be.length)," of ",be.length]}),(0,M.jsxs)("div",{className:"results-pagination-controls",children:[(0,M.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Te(qe-1),disabled:qe===1,children:"Previous"}),(0,M.jsxs)("span",{className:"results-pagination-page",children:["Page ",qe," of ",Ye]}),(0,M.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Te(qe+1),disabled:qe===Ye,children:"Next"})]})]})]}),(0,M.jsxs)("aside",{className:"basket-sidebar",children:[(0,M.jsx)("div",{className:"basket-sidebar-title",children:g?"Quote request summary":"Order summary"}),(0,M.jsxs)("div",{className:"basket-sidebar-row",children:[(0,M.jsx)("span",{children:g?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,M.jsx)("span",{children:de==null?"To confirm":nt(de)})]}),(0,M.jsxs)("div",{className:"basket-sidebar-row",children:[(0,M.jsx)("span",{children:"VAT (20%)"}),(0,M.jsx)("span",{children:tt==null?"To confirm":nt(tt)})]}),(0,M.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,M.jsx)("span",{children:g?"List price (inc.\xA0VAT)":"Total"}),(0,M.jsx)("span",{children:T==null?"To confirm":nt(T)})]}),!g&&(0,M.jsx)("div",{className:"basket-summary-waste",children:(0,M.jsxs)("div",{className:"basket-waste-control",children:[(0,M.jsxs)("label",{className:"basket-global-waste",children:[(0,M.jsx)("input",{type:"checkbox",checked:Ne,onChange:_=>we(_.target.checked)}),(0,M.jsx)("span",{children:"Add waste factor"})]}),(0,M.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,M.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:le,onChange:_=>Fe(_.target.value),disabled:!Ne,"aria-label":"Waste factor percent"}),(0,M.jsx)("span",{children:"%"})]})]})}),(0,M.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:g?"Enter email for your sharper quote":d?"Your email":"Your reference (optional)"}),(0,M.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:E,onChange:_=>{O(_.target.value),d&&z("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&k===zv,"aria-describedby":d&&k?`${p}-basket-reference-error`:void 0}),d&&k&&(0,M.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:k}),d?(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{wt()},disabled:h||G>0||ie>0,"aria-busy":h,children:(0,M.jsx)("span",{children:h?"Sending\u2026":g?"Request our best quote":"Send basket"})}):(0,M.jsx)("button",{className:"cta-btn",onClick:()=>{m("downloaded",{type:"basket",items:b.length}),Mv(b)},"aria-label":"Download selection",children:(0,M.jsx)("span",{children:"Download Quote"})}),(0,M.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,M.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),g?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":d?"Sending your basket isn't an order. We'll confirm prices, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,M.jsx)("div",{className:"btn-row results-actions",children:(0,M.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:n,"aria-label":"Back to results",children:[(0,M.jsx)(Vr,{}),(0,M.jsx)("span",{children:"Back to results"})]})})]})})]})})}var xe=$(He());function On(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty,linkedContext:t.linkedContext}}var xi=$(F());function Hd(){return(0,xi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,xi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,xi.jsx)("path",{d:"M21 3v5h-5"}),(0,xi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,xi.jsx)("path",{d:"M3 21v-5h5"})]})}var s=$(F()),jd="__none__",pl=24,G_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function Dv(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var j_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function Y_(e,t){if(t!==jd){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id)}}function Rv(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function $_({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function Ln(e,t){if(e==null)return"-";let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Yd(e){return e&&e.length>0?e.join(" x "):"-"}function V_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Bn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Zr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}function X_(e,t){return t>0||e==null?null:nt(e)}var Av=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function Z_(e){let t=new Map;return[...new Set(e.filter(Kr).map(r=>r.linked_group_id))].forEach((r,i)=>{let n=i%26;t.set(r,{token:String.fromCharCode(65+n),bubbleStyle:Av[i%Av.length]})}),t}function Kr(e){return!1}function Hn(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function Qd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function K_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[],i=new Map(e.map(c=>[c.product_id,c])),n=r.length>0?r.map(c=>i.get(c)).filter(c=>c!=null):e.slice(0,6),o=a?i.get(a):void 0,l=o?[o,...n.filter(({product_id:c})=>c!==o.product_id)]:n;return[...new Map(l.map(c=>[c.product_id,c])).values()].slice(0,6)}function Gd(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function cc(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function P_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:i}){let n=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-n.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:cc(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:i})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:cc(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:cc(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:n.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:cc(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",n.length," of ",t.length," LLM calls."]})]})]})}function J_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,i)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:Yd(r.measurements_mm)}),(0,s.jsx)("td",{children:ol(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${i}`))})]})]},`${t.query}-${a}`))]})}function Uv({item:e,result:t}){let a=t?.retrieval_debug.map(i=>i.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Bn(e.procurement_aliases)],["Retrieval queries",Bn(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",Yd(e.attrs.measurements_mm)],["Stock length",V_(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",Bn(e.installation_clues)],["System clues",Bn(e.system_clues)],["Component requirements",Bn(e.component_requirements)],["Linked group",Hn(e)||"-"],["Flags",Bn(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([i,n])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:i}),(0,s.jsx)("dd",{children:n})]},i))})]})}function I_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function F_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,i])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:i})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function W_({item:e,decision:t,selectedProductId:a,result:r,showRetrievalDebug:i,reviewOnly:n=!1,linkedGroupMeta:o}){if(!t)return null;let l=a==null?"Needs review:":"Selected:";return n?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:l}),"\xA0",t.reason]}),Kr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",o?`Link ${o.token} - `:"",Hn(e)]}):null]}):null:!t.reason&&!i?(0,s.jsx)(Uv,{item:e,result:r}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Uv,{item:e,result:r}),i&&(0,s.jsx)(I_,{item:e}),i&&(0,s.jsx)(F_,{result:r}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:l}),"\xA0",t.reason]}),Kr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",o?`Link ${o.token} - `:"",Hn(e)]}):null]}),i&&(0,s.jsx)(J_,{queries:r?.retrieval_debug??[]})]})}function ex({item:e,candidates:t,result:a,decision:r,unmatchable:i,selectedProductId:n,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:m=!1,debugEnabled:g=!1,forceReviewNote:d=!1,linkedGroupMeta:b}){let v=m||o==="detailed",E=g&&o==="detailed",O=v||d?(0,s.jsx)(W_,{item:e,decision:r,selectedProductId:n,result:a,showRetrievalDebug:E,reviewOnly:d&&!v,linkedGroupMeta:b}):null;if(i)return(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let f=p||m||o==="detailed"?t:K_(t,a,n);return(0,s.jsxs)(s.Fragment,{children:[O,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:f.map((u,h)=>{let w=u.product_id===n;return(0,s.jsxs)("tr",{className:w?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:u.description}),(0,s.jsx)("div",{className:"results-row-meta",children:u.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:Yd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Ln(u.price,u.price_basis)}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(u.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)($_,{band:Dv(u.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(u.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:w?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:w,onChange:()=>{w?c?.():l(u)},"aria-label":w?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${h}`)})})]})]})}function $d({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:i,onGoToBasket:n,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:m=!1}){let g=!m&&Is()==="QZA6-MRA4",d=g?"quote":"basket",{results:b,lineItems:v,parseReport:E,timings:O}=e,[f,u]=(0,xe.useState)({}),h=En(),[w,k]=(0,xe.useState)({}),[z,A]=(0,xe.useState)({}),[U,R]=(0,xe.useState)(""),[H,oe]=(0,xe.useState)(null),[Te,je]=(0,xe.useState)(1),Ve=Ot().debug===!0,[Ne,we]=(0,xe.useState)("simple"),[le,Fe]=(0,xe.useState)(m?"list":"tile"),[Ee,Nt]=(0,xe.useState)(!1),[Z,ge]=(0,xe.useState)(null),[Re,bt]=(0,xe.useState)(""),[jt,Ct]=(0,xe.useState)([]),[wt,be]=(0,xe.useState)(!1),[de,tt]=(0,xe.useState)(null),[T,G]=(0,xe.useState)(!1),[ie,ce]=(0,xe.useState)(null),ve=(0,xe.useRef)(null),[Ye,qe]=(0,xe.useState)(new Set),[x,_]=(0,xe.useState)(new Set),[q,D]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{je(1)},[U,H,le]);let V=new Map(b.map(S=>[S.line_id,S])),N=Z_(v),L=v.map(S=>{let j=V.get(S.line_id),fe=j?.decision,ft=j_(S),Ze=f[S.line_id],Xa=Y_(j,Ze),Ai=a[S.line_id],v0=Ze===jd?void 0:w[S.line_id]??(Ai&&Ai.productId!==Xa?.product_id?Rv(Ai):Xa),Cm=ft?void 0:v0,y0=S.qty??0;return{item:S,result:j,decision:fe,unmatchable:ft,best:Cm,qty:y0,band:Dv(Cm?.scores?.overall)}}),ue=L.some(S=>!S.unmatchable&&!S.best&&!x.has(S.item.line_id))?null:sc(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),ke=0;for(let S of L){if(S.unmatchable||!S.best)continue;let j=a[S.item.line_id];(!j||Ft(j).lineTotal==null)&&(ke+=1)}ke>0&&(ue=null);let vt=X_(ue,ke),mt=S=>!S.unmatchable&&!S.best&&Gd(S.result).length>0,Ut=S=>S.best??Gd(S.result)[0],Jr=L.filter(S=>!S.unmatchable&&!S.best).filter(S=>!x.has(S.item.line_id)),Ec=L.filter(S=>x.has(S.item.line_id)),Yt=L;if(U.trim()){let S=U.trim().toLowerCase();Yt=Yt.filter(j=>j.item.description_original?.toLowerCase().includes(S)||Ut(j)?.description?.toLowerCase().includes(S))}if(H){let S=H==="asc"?1:-1;Yt=[...Yt].sort((j,fe)=>S*(j.item.description_original||"").localeCompare(fe.item.description_original||""))}let hr=Math.max(1,Math.ceil(Yt.length/pl)),yt=Math.min(Te,hr),Zn=Yt.slice((yt-1)*pl,yt*pl),wm=Zn.filter(S=>!S.unmatchable&&S.best),Mc=Zn.filter(S=>!S.unmatchable&&S.best),vm=Zn.filter(S=>S.unmatchable||!S.best),P=Z?L.find(S=>S.item.line_id===Z)??null:null,d0=!m&&!c&&!P&&Jr.length>0,Kn=(0,xe.useRef)(null),Pn=()=>{let S=ve.current;if(!S)return;let{top:j,left:fe,width:ft,height:Ze}=S.getBoundingClientRect(),Ai=S.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;ce({top:j,left:fe,width:Ai?Ai-fe:ft,height:Ze})};(0,xe.useEffect)(()=>(window.addEventListener("scroll",Pn,!0),window.addEventListener("resize",Pn),()=>{window.removeEventListener("scroll",Pn,!0),window.removeEventListener("resize",Pn)})),(0,xe.useEffect)(()=>{let S=j=>{Kn.current&&!j.composedPath().includes(Kn.current)&&Kn.current.removeAttribute("open")};return document.addEventListener("click",S),()=>document.removeEventListener("click",S)},[]);let zi=S=>{ge(S),bt("")},m0=()=>{if(!Z)return;let S=a[Z];if(S){u(j=>({...j,[Z]:S.productId})),k(j=>({...j,[Z]:Rv(S)}));return}u(j=>{let fe={...j};return delete fe[Z],fe}),k(j=>{let fe={...j};return delete fe[Z],fe})},Va=(S=!1)=>{let j=Z?a[Z]:void 0;!S&&j&&P?.best&&j.productId!==P.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(S||m0(),ge(null),D(!1))};rl(T,()=>G(!1)),rl(!!P&&!T,()=>Va());let f0=S=>{if(qe(j=>new Set(j).add(S)),Jr.some(j=>j.item.line_id!==S)){Va(!0);return}p(),Va(!0)},h0=S=>{if(Tc(S),_(j=>new Set(j).add(S)),Jr.some(j=>j.item.line_id!==S)){Va(!0);return}p(),Va(!0)},g0=()=>{_(S=>new Set([...S,...Jr.map(j=>j.item.line_id)])),p()},ym=()=>{P?.best&&(xm(P.item.line_id,P.best),r(Jn(P)),q?f0(P.item.line_id):Va(!0))},_m=vm.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items needing review",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Needs review"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:vm.map(S=>{let{item:j,qty:fe}=S;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>zi(j.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Zr(j,v)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},j.line_id)})})]}):null,Tc=S=>{u(j=>({...j,[S]:jd})),k(j=>({...j,[S]:void 0})),A(j=>({...j,[S]:void 0})),i(S)},zc=(S,j)=>{u(fe=>({...fe,[S]:j.product_id})),k(fe=>({...fe,[S]:j}))},xm=(S,j)=>{j.method==="catalogue_search"&&A(fe=>({...fe,[S]:j}))};function Hx(){h("downloaded",{type:"schedule",lines:L.length}),Ev(L.map(({item:S,best:j,qty:fe,band:ft,unmatchable:Ze,decision:Xa})=>({item:S,best:j,qty:fe,band:ft,unmatchable:Ze,decision:Xa})))}function Jn(S){let j=S.best;if(!j)throw new Error("Cannot add a line item without a selected product.");return On(j,{lineId:S.item.line_id,description:S.item.description_original,unit:S.item.unit,qty:S.qty,linkedContext:S.item.linked_group_role==="dependent"&&S.item.linked_group_id?v.filter(fe=>fe.linked_group_id===S.item.linked_group_id&&fe.linked_group_role==="anchor").slice(0,1).map(fe=>{let ft=a[fe.line_id];return{line_id:fe.line_id,product_id:ft?.productId??null,measurements_mm:ft?.measurementsMm??fe.attrs.measurements_mm,description:ft?.description??fe.description_original,qty:fe.qty,unit:fe.unit,role:"anchor"}}):void 0})}(0,xe.useEffect)(()=>{if(!o){for(let S of L)!S.unmatchable&&S.best&&r(Jn(S));l()}},[o]),(0,xe.useEffect)(()=>{if(!Z){Ct([]),tt(null),be(!1);return}let S=Re.trim();if(!S){Ct([]),tt(null),be(!1);return}let j=!1,fe=window.setTimeout(async()=>{try{be(!0),tt(null);let ft=await fetch(Ta(`/api/catalogue/search?q=${encodeURIComponent(S)}`),{headers:bi()}),Ze=await Ga(ft);if(!ft.ok)throw new Error(Ze?.error||Ze?.message||"Failed to search catalogue");j||Ct(Array.isArray(Ze?.items)?Ze.items:[])}catch(ft){j||(Ct([]),tt(ft?.message||"Failed to search catalogue"))}finally{j||be(!1)}},250);return()=>{j=!0,window.clearTimeout(fe)}},[Re,Z]);let Rc=Object.keys(a).length,Ca=Re.trim(),Ac=Gd(P?.result),bl=!!P&&!P.best&&(P.result?.candidates.length===0||P.result?.rerank?.selectedCandidateId===null),km=P?.result?.rerank!=null,Sm=P?.decision?.reason??(bl?"No catalogue candidate found. Refine the request or search the catalogue.":null),b0=jt.map(S=>({product_id:S.product_id,description:S.description,source_list:S.source_list,price:S.price,price_basis:S.price_basis,uoi_count:S.uoi_count??null,uoi:S.uoi,pdp_photo_url:S.pdp_photo_url??null,conversion:S.conversion,measurements_mm:S.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),In=Ca?b0:Ac,Ri=P?z[P.item.line_id]:void 0,Fn=!Ca&&Ri&&!In.some(S=>S.product_id===Ri.product_id)?[...In,Ri]:In,Nm=(()=>{let S=Fn.slice(0,Ca?12:6);return Ca||!Ri||S.some(j=>j.product_id===Ri.product_id)?S:[...S,Ri]})(),wl=!!P?.best&&a[P.item.line_id]?.productId===P.best.product_id,w0=!!P?.best&&!!a[P.item.line_id]&&!wl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${m?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${m?"":" quick-order-hero--customer"}`,children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:vt??"Review quantities"})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",g?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:n,disabled:Rc===0,"aria-label":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:g?"View Quote":"View Basket"}),vt!=null&&(0,s.jsx)("strong",{children:vt})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Ve&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":Ee,onClick:()=>Nt(S=>!S),children:Ee?"Hide timings":"Show timings"})}),Ve&&Ee&&(0,s.jsx)(P_,{...O}),!g&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!P&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:0},children:(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:U,onChange:S=>R(S.target.value),"aria-label":"Search line items"}),!m&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${le==="tile"?" is-active":""}`,"aria-pressed":le==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>Fe("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${le==="list"?" is-active":""}`,"aria-pressed":le==="list","aria-label":"List view",title:"List view",onClick:()=>Fe("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),Ve&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(S=>S==="simple"?"detailed":"simple"),children:Ne==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Kn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:G_.map(S=>{let j=H===S.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${j?" is-active":""}`,onClick:()=>{oe(j?null:S.dir),Kn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:j?"\u2713":""}),S.label]},S.dir)})})]})]})})}),le==="tile"||P?(0,s.jsxs)(s.Fragment,{children:[P?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Va(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:S=>S.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Va(),"aria-label":"Close product options",children:(0,s.jsx)(il,{})}),(0,s.jsx)("div",{className:"results-review-page",children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>Va(),children:[(0,s.jsx)(Vr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Ve&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(S=>S==="simple"?"detailed":"simple"),children:Ne==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:Re,onChange:S=>bt(S.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Tc(P.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)(za,{className:"fill-img results-review-page__image",description:Ut(P)?.description||P.item.description_original,photoUrl:Ut(P)?.pdp_photo_url})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Zr(P.item,v)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[vi(P.qty)," ",xa(P.item.unit,P.qty)]}),P.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:P.best.description}),P.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Ln(P.best.price,P.best.price_basis)}):null]}):Ut(P)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:Ut(P)?.description}),Ut(P)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Ln(Ut(P)?.price??null,Ut(P)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),Kr(P.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(Qd,{meta:N.get(P.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Hn(P.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[P.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[P.item.line_id]?i(P.item.line_id):(P.best&&xm(P.item.line_id,P.best),r(Jn(P)))},disabled:!P.best,"aria-label":a[P.item.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[P.item.line_id]?"\u2713 Added":m?"+ Add to selection":`Add to ${d}`})})]})]}),wt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!wt&&de?(0,s.jsx)("div",{className:"results-empty-card",children:de}):null,!wt&&!de&&Ca&&In.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!wt&&!de?(0,s.jsx)(ex,{item:P.item,candidates:In,result:P.result,decision:P.decision,unmatchable:P.unmatchable,selectedProductId:P.best?.product_id??null,detailMode:Ne,linkedGroupMeta:Kr(P.item)?N.get(P.item.linked_group_id):void 0,onPick:S=>zc(P.item.line_id,S),onClear:()=>Tc(P.item.line_id),showAll:m||Ve||Ca.length>0,internal:m,debugEnabled:Ve,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Zr(P.item,v)||"Original request"})]}),Sm?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:bl?"No automatic match:":"AI review:"})," ",Sm]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:bl?Ac.length>0?"Choose a product":"No suitable product found":km?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:bl?Ac.length>0?"No product was selected automatically. Review these related options before adding one.":"Search the catalogue to choose an alternative.":km?`Select the option you want to add to your ${d}.`:"Search the catalogue to choose a product."})]})}),!Ca&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Nm.map(S=>{let j=S.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${j?" is-selected":""}`,onClick:()=>zc(P.item.line_id,S),"aria-pressed":j,children:[(0,s.jsx)(za,{className:"customer-review-option__image",description:S.description,photoUrl:S.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:S.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:S.price!=null?`\xA3${Ln(S.price,S.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:j?"Selected":"Choose"})]},S.product_id)})}):null,Fn.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:Re,onChange:S=>bt(S.target.value),"aria-label":"Search catalogue"})]}),Ca&&wt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Ca&&!wt&&de?(0,s.jsx)("div",{className:"results-empty-card",children:de}):null,Ca&&!wt&&!de&&Fn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Ca&&!wt&&!de&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Nm.map(S=>{let j=S.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${j?" is-selected":""}`,onClick:()=>zc(P.item.line_id,S),"aria-pressed":j,children:[(0,s.jsx)(za,{className:"customer-review-option__image",description:S.description,photoUrl:S.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:S.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:S.price!=null?`\xA3${Ln(S.price,S.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:j?"Selected":"Choose"})]},S.product_id)})}):null]}),P.best?w0?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{ym()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>i(P.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${d}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${wl?" cta-btn-secondary":""}`,onClick:()=>{wl?i(P.item.line_id):ym()},children:(0,s.jsx)("span",{children:wl?`Remove from ${d}`:`Add selected product to ${d}`})}):null,q?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>h0(P.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[Yt.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Mc.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:Mc.map(S=>{let{item:j,best:fe,qty:ft}=S,Ze=Ut(S);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>zi(j.line_id),"aria-label":`Review match for ${Zr(j,v)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[Kr(j)?(0,s.jsx)("div",{className:"results-tile-card__badges",children:(0,s.jsx)(Qd,{meta:N.get(j.linked_group_id)})}):null,(0,s.jsx)(za,{className:"fill-img results-tile-card__image",description:Ze?.description||j.description_original,photoUrl:Ze?.pdp_photo_url})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Ze?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Ze.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Ze?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Zr(j,v)}),Kr(j)?(0,s.jsx)("div",{className:"results-row-meta",children:Hn(j)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[m&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>zi(j.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[j.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[j.line_id]?i(j.line_id):r(Jn(S))},disabled:!fe,"aria-label":a[j.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[j.line_id]?"\u2713 Added":m?"+ Add":`Add to ${d}`})]})]},j.line_id)})})}):null,_m]})]}):(0,s.jsxs)(s.Fragment,{children:[ie&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:ie,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),Ne==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),Ne==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:m?"Selection":g?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[Yt.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:Ne==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Mc.map(S=>{let{item:j,result:fe,decision:ft,best:Ze}=S;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>zi(j.line_id),onMouseEnter:Xa=>{ve.current=Xa.currentTarget,Pn()},onMouseLeave:()=>{ve.current=null,ce(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Zr(j,v)}),Kr(j)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(Qd,{meta:N.get(j.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Hn(j)})]}):null]}),(0,s.jsx)("td",{children:Ze?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Ze.description,children:Ze.description}),Ne==="detailed"&&ft&&(0,s.jsx)("div",{className:"results-row-meta",children:ft.selected_candidate_id===Ze.product_id?"Automatically selected":"Selected"})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Ze?.price!=null?Ln(Ze.price,Ze.price_basis):"-"}),Ne==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[j.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:Xa=>{Xa.stopPropagation(),a[j.line_id]?i(j.line_id):r(Jn(S))},"aria-label":a[j.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[j.line_id]?"\u2713 Added":m?"+ Add":`Add to ${d}`})})]},j.line_id)})]})]})}),_m]}),!P&&hr>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(yt-1)*pl+1,"\u2013",Math.min(yt*pl,Yt.length)," of ",Yt.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>je(yt-1),disabled:yt===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",yt," of ",hr]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>je(yt+1),disabled:yt===hr,children:"Next"})]})]}),(E.itemCount!=null||E.headingCount!=null||E.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[E.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.itemCount})," items parsed"]}),E.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.headingCount})," headings"]}),E.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!P&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:()=>G(!0),"aria-label":"Start over",children:[(0,s.jsx)(Hd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:n,disabled:Rc===0,"aria-label":m?"View selection":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[m?"View Selection":g?"View Quote":"View Basket"," (",Rc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})]})]}),d0&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:Jr.map(S=>{let j=Ye.has(S.item.line_id),fe=mt(S);return(0,s.jsx)("div",{className:`review-gate-item${j?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{D(!0),zi(S.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Zr(S.item,v)}),(0,s.jsx)("span",{children:S.decision?.reason||(fe?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:j?"Choice made":"Choose a product"})]})},S.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:g0,children:"Skip all"}),Ec.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),Ec.map(S=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{_(j=>{let fe=new Set(j);return fe.delete(S.item.line_id),fe}),D(!0),zi(S.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Zr(S.item,v)}),(0,s.jsx)("span",{children:`Not added to your ${d}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},S.item.line_id))]}):null]})}),T&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",g?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>G(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{G(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var ka=$(F()),Vd="metron-quick-quote",tx=1440*60*1e3;function uc(e){return(0,ka.jsx)(lc,{children:(0,ka.jsx)(ax,{...e})})}function ax({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,i]=(0,De.useState)("entry"),[n,o]=(0,De.useState)(null),[l,c]=(0,De.useState)(""),p=(0,De.useRef)(null),m=(0,De.useRef)(0),[g,d]=(0,De.useState)(0),[b,v]=(0,De.useState)(null),[E,O]=(0,De.useState)(!1),{cart:f,addToCart:u,addManyToCart:h,removeFromCart:w,updateCartQty:k,updateCartSellUnits:z,updateCartConversions:A,clearCart:U}=Dn(),[R,H]=(0,De.useState)(!1),[oe,Te]=(0,De.useState)(null),je=()=>{Te(null);try{window.sessionStorage.removeItem(oc)}catch{}},Ve=(0,De.useRef)(null),Ne=Js("quick-quote",Ve);(0,De.useEffect)(()=>{Ne("viewed")},[Ne]);let[we,le]=(0,De.useState)(!1);(0,De.useEffect)(()=>{wv();let be=window.location.hash,de=null;try{de=JSON.parse(window.sessionStorage.getItem(Vd)??"null")}catch{}if(de&&!(Date.now()-(de.savedAt??0)<tx)&&(de=null),de?.scheduleResult)o("schedule"),v(de.scheduleResult),O(de.reviewGateComplete),H(de.cartSeeded),h(Object.values(de.cart)),be==="#quote-request"?i("basket"):be==="#matched-products"&&i("results");else if(be==="#matched-products"||be==="#quote-request"){let tt=new URL(window.location.href);tt.hash="",Rn("replaceState",window.history.state,tt)}le(!0)},[]),(0,De.useEffect)(()=>{if(we)try{b?window.sessionStorage.setItem(Vd,JSON.stringify({savedAt:Date.now(),scheduleResult:b,reviewGateComplete:E,cartSeeded:R,cart:f})):window.sessionStorage.removeItem(Vd)}catch{}},[we,b,E,R,f]);let Fe=(0,De.useCallback)(be=>{if(typeof window>"u")return;let de=new URL(window.location.href);de.hash=be==="basket"?"quote-request":"matched-products";let tt=be==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");Rn(tt?"replaceState":"pushState",{boqQuoteStage:be},de)},[]),Ee=(0,De.useRef)(!1);(0,De.useEffect)(()=>{let be=()=>{Ee.current=!1;let de=window.location.hash;de==="#quote-request"?i("basket"):de==="#matched-products"&&b?(o("schedule"),i("results")):i("entry")};return window.addEventListener("popstate",be),()=>window.removeEventListener("popstate",be)},[b]);let Nt=(0,De.useCallback)(()=>{Fe("basket"),i("basket")},[Fe]),Z=(0,De.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(Ee.current)return;Ee.current=!0,nc();return}i(b?"results":"entry")},[b]),ge=(0,De.useRef)(r);(0,De.useEffect)(()=>{ge.current!==r&&(ge.current=r,window.scrollTo(0,0))},[r]);let Re=()=>{i("entry"),o(null),c(""),d(0),v(null),O(!1),U(),H(!1),je()},bt=(0,De.useCallback)(async(be,de,tt=!0)=>{let T=++m.current;c(""),d(0);let G=0,ie=()=>{G=Math.min(G+1,3),d(G)};try{let{jobId:ce}=await Nw(be,de,tt);if(T!==m.current)return;let{promise:ve,cancel:Ye}=qw(()=>Cw(ce),5e3,ie,"schedule");p.current=Ye;let qe=await ve;if(qe.status==="failed"||!qe.result)throw new Error(qe.error||"Failed to process schedule");let x=qe.result.lineItems.length,_=qe.result.results.filter(q=>q.candidates.length>0).length;Ne("results_shown",{lines:x,matched:_,unmatched:x-_}),U(),H(!1),O(!1),v(qe.result),Fe("results"),i("results")}catch(ce){if(T!==m.current)return;Ne("error",{stage:"matching"}),c(ce?.message||"Failed to process schedule"),i("entry")}finally{T===m.current&&(p.current?.(),p.current=null)}},[Fe,Ne,U]),jt=(0,De.useCallback)(()=>{m.current++,p.current?.(),p.current=null},[]),Ct=(0,De.useCallback)(async(be,de,tt=!0)=>{if(!be.trim())return;o("schedule");let T=new File([be],"pasted-schedule.txt",{type:"text/plain"});await bt(T,de,tt)},[bt]),wt=(0,De.useCallback)(async be=>{o("schedule"),await bt(be)},[bt]);return(0,ka.jsx)(tl.Provider,{value:Ne,children:(0,ka.jsx)("div",{ref:Ve,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:Ot().theme,children:(0,ka.jsxs)("main",{className:"main-content",children:[l&&(0,ka.jsxs)("div",{className:"error-box",role:"alert",children:[(0,ka.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,ka.jsx)(Cd,{onPasteSchedule:Ct,onUploadSchedule:wt,onEntryModeChange:o,draft:oe,onSubmitDraft:Te,onCancelMatch:jt}),r==="results"&&n==="schedule"&&b&&(0,ka.jsx)($d,{scheduleResult:b,onStartOver:Re,cart:f,onAddToCart:u,onRemoveFromCart:w,onGoToBasket:Nt,cartSeeded:R,onCartSeeded:()=>H(!0),reviewGateComplete:E,onReviewGateComplete:()=>O(!0),internal:a}),r==="basket"&&(0,ka.jsx)(ul,{cart:f,onUpdateQty:k,onUpdateSellUnits:z,onResolveConversions:A,onRemove:w,onBack:Z,onStartNewQuote:Re,onQuoteRequested:()=>{v(null),O(!1),H(!1),U(),je()},internal:a})]})})})}var $a=$(He());var Si=$(He());var Ov={"NZ4Y-ZMSQ":{"brick-block":{"brick-common":"105499","brick-engineering-red":"1654","brick-engineering-blue":"1723",block:"501","mortar-cement":"1762 cement","mortar-sand":"564 building sand"},skirting:{"skirting-chamfered":"1525","skirting-ogee":"135 primed mdf ogee","skirting-pencil-round":"892","skirting-torus":"1941"},architrave:{"architrave-ogee":"134 primed mdf ogee","architrave-pencil-round":"1896","architrave-square-edge":"118 primed mdf square","architrave-torus":"1531"},plasterboard:{standard:"1647",moisture:"11 moisture plasterboard",fire:"14 fire plasterboard",sound:"1769",screws:"131160",tape:"1766",adhesive:"108439"},paint:{"paint-emulsion":"157217"},"concrete-aggregate":{cement:"1762 cement","sharp-sand":"563",gravel:"571",mot:"569"},insulation:{"insulation-floor":"152187","insulation-ground":"442","insulation-wall":"147","insulation-roof":"442","insulation-loft":"152180"},timber:{studs:"1213",joists:"208",battens:"1729"},fencing:{"panels-boundary-0.9":"66 lap fence panel","panels-boundary-1.2":"1450","panels-boundary-1.5":"1449","panels-boundary-1.8":"1448","panels-skyline-1.8":"1475","concrete-intermediate-8":"40197","concrete-end-8":"40198","timber-post-6":"141411","timber-post-8":"1709",postcrete:"12142","gate-boundary":"1984","gate-skyline":"40002","gravel-boards":"40200"},decking:{"boards-summit":"24322",joists:"208",screws:"131079"},paving:{"surface-council":"1669","surface-raj":"12363","surface-brindle":"304","surface-charcoal":"296","surface-pea":"431","sub-base":"569",bedding:"563"}}};function dl(e,t){let a=Ov[Ot().client??""]?.[e];if(!a)return null;let r=e==="plasterboard"&&t.key==="board"?t.label.split(" ")[0].toLowerCase():t.key;return a[r]??null}function ki(e,t){let a=Ov[Ot().client??""]?.[e];return!a||t in a}function Bv(e,t){let a=t.map(r=>{let i=dl(e,r);return i?{key:r.key,productId:i.split(" ")[0],search:i,qty:r.qty,unit:r.unit}:null});return a.length>0&&a.every(Boolean)?a:null}var ee=$(F()),Lv=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],pc=e=>Number.parseFloat(e)||0,Hv=(e,t)=>pc(e)*(t==="m"?1:.3048),Xd=(e,t)=>pc(e.quantity)*(2*Hv(e.height,t)+Hv(e.width,t)),rx=()=>({quantity:"1",width:"",height:""});function ix({profile:e}){return(0,ee.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,ee.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,ee.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function Zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Si.useState)("m"),[n,o]=(0,Si.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,Si.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,m]=(0,Si.useState)([]),[g,d]=(0,Si.useState)("ogee"),[b,v]=(0,Si.useState)("2.4"),E=(k,z,A)=>{k(U=>({...U,[z]:A}))},O=Xd(n,r)+Xd(l,r)+p.reduce((k,z)=>k+Xd(z,r),0),f=pc(b)>0?Math.ceil(O/pc(b)):0,u=Lv.find(k=>k.id===g)?.label??"",h=[{key:`architrave-${g}`,label:`Architrave (${u})`,qty:O,unit:"m",query:`${u} architrave`,category:"architrave"}],w=(k,z,A,U)=>(0,ee.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,ee.jsx)("span",{children:k}),(0,ee.jsx)("input",{"aria-label":`${k} quantity`,type:"number",min:"0",step:"1",value:z.quantity,onChange:R=>A("quantity",R.target.value)}),(0,ee.jsx)("input",{"aria-label":`${k} width`,type:"number",min:"0",step:"0.01",value:z.width,onChange:R=>A("width",R.target.value)}),(0,ee.jsx)("input",{"aria-label":`${k} height`,type:"number",min:"0",step:"0.01",value:z.height,onChange:R=>A("height",R.target.value)}),U?(0,ee.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:U,children:"Remove"}):null]});return(0,ee.jsx)(ee.Fragment,{children:(0,ee.jsxs)("div",{className:"truss-estimator",children:[(0,ee.jsxs)("div",{className:"quick-order-hero",children:[(0,ee.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ee.jsx)("h1",{children:"Architrave Calculator"}),(0,ee.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,ee.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,ee.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,ee.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,ee.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,ee.jsx)("span",{children:"Units"}),(0,ee.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ee.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metres"}),(0,ee.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Feet"})]})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,ee.jsx)("span",{children:"Opening"}),(0,ee.jsx)("span",{children:"Qty"}),(0,ee.jsxs)("span",{children:["Width (",r,")"]}),(0,ee.jsxs)("span",{children:["Height (",r,")"]}),(0,ee.jsx)("span",{})]}),w("Single doors",n,(k,z)=>E(o,k,z)),w("Double doors",l,(k,z)=>E(c,k,z)),p.map((k,z)=>w(`Alternative door ${z+1}`,k,(A,U)=>m(R=>R.map((H,oe)=>oe===z?{...H,[A]:U}:H)),()=>m(A=>A.filter((U,R)=>R!==z)))),(0,ee.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>m(k=>[...k,rx()]),children:"+ Add alternative-sized door"})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,ee.jsx)("div",{className:"architrave-calculator__profiles",children:Lv.filter(k=>ki("architrave",`architrave-${k.id}`)).map(k=>(0,ee.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g===k.id?" is-selected":""}`,onClick:()=>d(k.id),children:[(0,ee.jsx)(ix,{profile:k.id}),(0,ee.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,ee.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.id))})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,ee.jsx)("div",{className:"architrave-calculator__options",children:(0,ee.jsxs)("label",{className:"truss-estimator__field",children:[(0,ee.jsx)("span",{children:"Board length (m)"}),(0,ee.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ee.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Architrave needed"}),(0,ee.jsxs)("strong",{children:[O.toFixed(2)," m"]})]}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Board lengths"}),(0,ee.jsx)("strong",{children:f})]})]})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,ee.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ee.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(h),disabled:O<=0,children:a})]})]})]})})}var Ni=$(He()),ae=$(F()),Qv=60,Gv=10,nx=.02,ox=.012,jv=1,Yv=4,lx=1.33,sx=1440,cx=1600,Qn=e=>Number.parseFloat(e)||0,ux=(e,t=2)=>e.toFixed(t);function Kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ni.useState)("brick"),[n,o]=(0,Ni.useState)("engineering-red"),[l,c]=(0,Ni.useState)("metric"),[p,m]=(0,Ni.useState)(""),[g,d]=(0,Ni.useState)(""),[b,v]=(0,Ni.useState)(!0),E=l==="metric"?Qn(p)*Qn(g):Qn(p)*Qn(g)*.092903,f=E*(r==="brick"?Qv:Gv),u=Math.ceil(f),w=E*(r==="brick"?nx:ox)*lx/(jv+Yv),k=Math.ceil(w*jv*sx),z=Math.ceil(w*Yv*cx),A=l==="metric"?E:E*10.7639,U=[{key:r==="brick"?`brick-${n}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[n]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...b?[{key:"mortar-cement",label:"General purpose cement",qty:k,unit:"kg",query:"general purpose cement",category:"cement"},{key:"mortar-sand",label:"Building sand",qty:z,unit:"kg",query:"building sand",category:"aggregate"}]:[]],R=H=>{if(H===l)return;let oe=H==="imperial"?3.28084:.3048;m((Qn(p)*oe).toFixed(2)),d((Qn(g)*oe).toFixed(2)),c(H)};return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{className:"truss-estimator",children:[(0,ae.jsxs)("div",{className:"quick-order-hero",children:[(0,ae.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ae.jsx)("h1",{children:"Brick and Block Calculator"}),(0,ae.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus the cement and sand for the mortar."}),(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([H,oe])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===H?" is-selected":""}`,onClick:()=>i(H),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:oe}),(0,ae.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",H==="brick"?Qv:Gv," per m\xB2"]})]},H))})]}),r==="brick"&&(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([H,oe,Te])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n===H?" is-selected":""}`,onClick:()=>o(H),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:oe}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:Te})]},H))})]}),(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,ae.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ae.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>R("metric"),children:"Metric"}),(0,ae.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>R("imperial"),children:"Imperial"})]}),(0,ae.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:H=>m(H.target.value)})]}),(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:H=>d(H.target.value)})]})]})]}),(0,ae.jsx)("div",{className:"brick-calculator__options",children:(0,ae.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,ae.jsx)("input",{type:"checkbox",checked:b,onChange:H=>v(H.target.checked)}),(0,ae.jsx)("span",{children:"Include mortar (cement and building sand, mixed 1:4)"})]})}),(0,ae.jsxs)("div",{className:"brick-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Wall area"}),(0,ae.jsxs)("strong",{children:[ux(A)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,ae.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),b?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Cement"}),(0,ae.jsxs)("strong",{children:[k," kg"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Building sand"}),(0,ae.jsxs)("strong",{children:[z," kg"]})]})]}):null]}),(0,ae.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar is a general purpose 1:4 cement and sand mix; quantities are approximate, so confirm the specification before ordering."})]}),(0,ae.jsxs)("div",{className:"brick-calculator__actions",children:[(0,ae.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ae.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(U),disabled:E<=0,children:a})]})]})]})})}var Ci=$(He()),W=$(F()),px=1.54,dx=1440,Pd=e=>Number.parseFloat(e)||0,Pr={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,query:"MOT type 1"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,query:"sharp sand"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,query:"20mm gravel"}};function Jd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ci.useState)("m"),[n,o]=(0,Ci.useState)(""),[l,c]=(0,Ci.useState)(""),[p,m]=(0,Ci.useState)(""),[g,d]=(0,Ci.useState)("concrete"),[b,v]=(0,Ci.useState)("mot"),E=r==="m"?1:.3048,O=Pd(n)*E*Pd(l)*E*Pd(p)*(r==="m"?.01:.0254),f=Pr[b],u=O*px/7,h=u*dx,w=u*2,k=u*4,z=(U,R)=>Math.ceil(U*R*1e3),A=g==="concrete"?[{key:"cement",label:"General purpose cement",qty:Math.ceil(h),unit:"kg",query:"general purpose cement"},{key:"sharp-sand",label:"Sharp sand",qty:z(w,Pr["sharp-sand"].density),unit:"kg",query:Pr["sharp-sand"].query},{key:"gravel",label:"20mm gravel",qty:z(k,Pr.gravel.density),unit:"kg",query:Pr.gravel.query}]:[{key:b,label:f.label,qty:z(O,f.density),unit:"kg",query:f.query}];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)("div",{className:"truss-estimator",children:[(0,W.jsxs)("div",{className:"quick-order-hero",children:[(0,W.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,W.jsx)("h1",{children:"Concrete and Aggregate Calculator"}),(0,W.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,W.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,W.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,W.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator works out the materials and adds them to your basket."}),(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,W.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g==="concrete"?" is-selected":""}`,onClick:()=>d("concrete"),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g==="aggregate"?" is-selected":""}`,onClick:()=>d("aggregate"),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),g==="aggregate"&&(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,W.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Pr).map(U=>(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===U?" is-selected":""}`,onClick:()=>v(U),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:Pr[U].label}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:Pr[U].blurb})]},U))})]}),(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,W.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,W.jsx)("span",{children:"Units"}),(0,W.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,W.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metric"}),(0,W.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Imperial"})]})]}),(0,W.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsxs)("span",{children:["Length (",r,")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:U=>o(U.target.value)})]}),(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsxs)("span",{children:["Width (",r,")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:U=>c(U.target.value)})]})]}),(0,W.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,W.jsxs)("span",{children:["Depth (",r==="m"?"cm":"inches",")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.1",value:p,onChange:U=>m(U.target.value)})]})]}),(0,W.jsxs)("div",{className:"materials-calculator__totals",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,W.jsx)("div",{className:"materials-calculator__result-grid",children:g==="concrete"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Cement"}),(0,W.jsxs)("strong",{children:[h.toFixed(0)," kg"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Sharp sand"}),(0,W.jsxs)("strong",{children:[w.toFixed(2)," m\xB3"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"20mm aggregate"}),(0,W.jsxs)("strong",{children:[k.toFixed(2)," m\xB3"]})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:f.label}),(0,W.jsxs)("strong",{children:[O.toFixed(2)," m\xB3"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Approx. weight"}),(0,W.jsxs)("strong",{children:[(O*f.density).toFixed(2)," t"]})]}),(0,W.jsx)("div",{})]})}),(0,W.jsx)("p",{className:"materials-calculator__note",children:g==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),(0,W.jsxs)("div",{className:"materials-calculator__actions",children:[(0,W.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,W.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(A),disabled:O<=0,children:a})]})]})]})})}var Ya=$(He());var B=$(F()),Gn=12,jn=8,dc=.56,$v=.21,Ra={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},qi=["range","grid","pictureFrame","substructure"],mx={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},mc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),fc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),fx=(e,t,a,r)=>{let i=mc(e,t,a),n=mc(e,t,r),o=mc(a,r,e),l=mc(a,r,t);return i===0&&fc(e,t,a)||n===0&&fc(e,t,r)||o===0&&fc(a,r,e)||l===0&&fc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},Id=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let i=e[(r+1)%e.length];for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&fx(e[r],i,e[n],e[(n+1)%e.length]))return!0}return!1};function Fd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ya.useState)(0),[n,o]=(0,Ya.useState)(mx),[l,c]=(0,Ya.useState)(1),[p,m]=(0,Ya.useState)({x:0,y:0}),[g,d]=(0,Ya.useState)(null),b=(0,Ya.useRef)(null),v=(0,Ya.useRef)(null),E=(0,Ya.useRef)(null),O=qi[r],f=n.range?Ra.ranges[n.range]:null,u=Gn/l,h=jn/l,w=(Gn-u)/2,k=(jn-h)/2,z=Math.max(-Gn,Math.min(Gn*2-u,w+p.x)),A=Math.max(-jn,Math.min(jn*2-h,k+p.y)),U=Number.parseFloat(n.quickLengthM),R=Number.parseFloat(n.quickWidthM),H=U>0&&R>0,oe=T=>Math.abs(T.reduce((G,ie,ce)=>{let ve=T[(ce+1)%T.length];return G+ie.x*ve.y-ve.x*ie.y},0))/2,Te=(T,G)=>Math.hypot(G.x-T.x,G.y-T.y),je=n.isOutlineClosed?oe(n.points):0,Ve=n.isOutlineClosed?n.points.reduce((T,G,ie)=>T+Te(G,n.points[(ie+1)%n.points.length]),0):0,Ne=n.isOutlineClosed?n.points.reduce((T,G,ie)=>T+(n.wallSegments.has(ie)?0:Te(G,n.points[(ie+1)%n.points.length])),0):0,we=n.points.reduce((T,G)=>({x:T.x+G.x/n.points.length,y:T.y+G.y/n.points.length}),{x:0,y:0}),le=n.points.length>1?(()=>{let T=n.points[0],G=n.points[1],ie=Te(T,G),ce=ie?-(G.y-T.y)/ie:0,ve=ie?(G.x-T.x)/ie:0,Ye=(T.x+G.x)/2,qe=(T.y+G.y)/2,x=ce*(Ye-we.x)+ve*(qe-we.y)>=0?1:-1;return{x:Ye+ce*dc*x,y:qe+ve*dc*x}})():null,Ee=(()=>{let T=n.range?Ra.ranges[n.range]:Ra.ranges.meridian,G=n.deckSizeMode==="quick"?U*R:je,ie=n.deckSizeMode==="quick"?2*(U+R):Ne,ce=n.direction==="diagonal"?Ra.wastage.diagonal:Ra.wastage.straight,ve=n.pictureFrame==="yes"?Ra.pictureFrame.extraWastage:0,qe=G/(T.boardWidthM+Ra.boardGapM)/T.boardLengthM,x=Math.ceil(qe*(1+ce+ve)),_=Math.ceil(G*30*(1+ce+ve)/200),q=Ra.joist.spacingOptions.find(N=>N.id===n.joistSpacing)??Ra.joist.spacingOptions[1],D=G/q.spacingM,V=Math.ceil(D);return{range:T,area:G,boardCount:x,screwBoxes:_,joistMetres:V,spacing:q}})(),Nt=Ee?[{key:`boards-${n.range??"meridian"}`,label:`Deck boards (${Ee.range.label})`,qty:Math.round(Ee.boardCount*Ee.range.boardLengthM*100)/100,unit:"m",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:Ee.joistMetres,unit:"m",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:Ee.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],Z=()=>O==="range"?!!n.range:O==="grid"?n.deckSizeMode==="quick"?H:n.isOutlineClosed&&je>0:O==="pictureFrame"?!!n.pictureFrame&&!!n.direction:O==="substructure"?!!n.joistSpacing:!0,ge=r===qi.length-1?a:"Next",Re=(T,G,ie=!1)=>{let ce=E.current?.getBoundingClientRect();if(!ce)return null;let ve=ie?1:.25;return{x:Math.round(Math.max(z,Math.min(z+u,z+(T-ce.left)/ce.width*u))/ve)*ve,y:Math.round(Math.max(A,Math.min(A+h,A+(G-ce.top)/ce.height*h))/ve)*ve}},bt=T=>{if(n.isOutlineClosed){let ie=T.target;if(ie!==T.currentTarget&&!ie.classList.contains("deck-outline__grid"))return;v.current={startX:T.clientX,startY:T.clientY,startViewX:z,startViewY:A},T.currentTarget.setPointerCapture(T.pointerId);return}if(n.drawMode!=="outline")return;let G=Re(T.clientX,T.clientY,!0);G&&(d(null),o(ie=>{let ce=[...ie.points,G];return Id(ce,!1)?{...ie,drawError:"Edges cannot cross. Choose another corner."}:{...ie,points:ce,drawError:""}}))},jt=(T,G)=>{if(!n.isOutlineClosed){T.stopPropagation(),G===0&&n.points.length>=3&&o(ie=>({...ie,isOutlineClosed:!0,drawMode:"edges"}));return}T.stopPropagation(),b.current=G,T.currentTarget.setPointerCapture(T.pointerId)},Ct=T=>{if(v.current){let ce=E.current?.getBoundingClientRect();if(!ce)return;let ve=v.current,Ye=ve.startViewX-(T.clientX-ve.startX)/ce.width*u,qe=ve.startViewY-(T.clientY-ve.startY)/ce.height*h;m({x:Ye-w,y:qe-k});return}!n.isOutlineClosed&&n.drawMode==="outline"&&d(Re(T.clientX,T.clientY,!0));let G=b.current;if(G===null)return;let ie=Re(T.clientX,T.clientY);ie&&o(ce=>{let ve=ce.points.map((Ye,qe)=>qe===G?ie:Ye);return Id(ve,!0)?{...ce,drawError:"Edges cannot cross. Move the corner to a different position."}:{...ce,points:ve,drawError:""}})},wt=T=>{v.current=null,b.current=null,T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId)},be=T=>{o(G=>{let ie=new Set(G.wallSegments);return ie.has(T)?ie.delete(T):ie.add(T),{...G,wallSegments:ie}})},de=()=>{r===0?e():i(T=>T-1)},tt=()=>{Z()&&(r===qi.length-1?t?.(Nt):i(T=>T+1))};return(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)("div",{className:"truss-estimator",children:[(0,B.jsxs)("div",{className:"quick-order-hero",children:[(0,B.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,B.jsx)("h1",{children:"Decking Calculator"}),(0,B.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,B.jsxs)("div",{className:"truss-estimator__card",children:[(0,B.jsxs)("div",{className:"truss-estimator__body",children:[O==="range"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Ra.ranges).filter(([T])=>ki("decking",`boards-${T}`)).map(([T,G])=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===T?" is-selected":""}`,onClick:()=>o(ie=>({...ie,range:T})),children:[(0,B.jsx)("div",{className:"truss-estimator__option-title",children:G.label}),(0,B.jsx)("div",{className:"truss-estimator__option-copy",children:G.blurb}),(0,B.jsxs)("div",{className:"truss-estimator__option-copy",children:[G.boardLengthM,"m boards"]})]},T))})]}):null,O==="grid"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,B.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,B.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(T=>({...T,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,B.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(T=>({...T,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),n.deckSizeMode==="quick"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,B.jsxs)("label",{className:"truss-estimator__field",children:[(0,B.jsx)("span",{children:"Length (m)"}),(0,B.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickLengthM,onChange:T=>o(G=>({...G,quickLengthM:T.target.value}))})]}),(0,B.jsxs)("label",{className:"truss-estimator__field",children:[(0,B.jsx)("span",{children:"Width (m)"}),(0,B.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickWidthM,onChange:T=>o(G=>({...G,quickWidthM:T.target.value}))})]})]}),(0,B.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),H?(0,B.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,B.jsxs)("div",{children:[(U*R).toFixed(2)," m\xB2 deck"]}),(0,B.jsxs)("div",{children:[(2*(U+R)).toFixed(2)," m perimeter"]})]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,B.jsxs)("div",{className:"deck-outline__toolbar",children:[n.isOutlineClosed?(0,B.jsxs)("div",{className:"deck-outline__summary",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Deck area"}),(0,B.jsxs)("strong",{children:[je.toFixed(2)," m\xB2"]})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Perimeter"}),(0,B.jsxs)("strong",{children:[Ve.toFixed(2)," m"]})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Wall edges"}),(0,B.jsx)("strong",{children:n.wallSegments.size>0?n.wallSegments.size:"None"})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Visible edge"}),(0,B.jsxs)("strong",{children:[Ne.toFixed(2)," m"]})]})]}):null,(0,B.jsxs)("div",{className:"deck-outline__actions",children:[(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(T=>({...T,points:T.points.slice(0,-1)})),disabled:n.points.length===0||n.isOutlineClosed,children:"Undo"}),(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d(null),o(T=>({...T,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:n.points.length===0,children:"Clear"}),(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(T=>({...T,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,B.jsx)("div",{className:"deck-editor-layout",children:(0,B.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,B.jsxs)("div",{className:"deck-outline",children:[(0,B.jsxs)("svg",{ref:E,className:`deck-outline__canvas${n.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${z} ${A} ${u} ${h}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:bt,onPointerMove:Ct,onPointerUp:wt,onPointerLeave:()=>{d(null),v.current||(b.current=null)},children:[(0,B.jsx)("defs",{children:(0,B.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,B.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,B.jsx)("rect",{x:-Gn,y:-jn,width:Gn*3,height:jn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),n.points.length>1?(0,B.jsx)("polyline",{className:"deck-outline__preview",points:n.points.map(T=>`${T.x},${T.y}`).join(" ")}):null,n.isOutlineClosed?(0,B.jsx)("polygon",{className:"deck-outline__shape",points:n.points.map(T=>`${T.x},${T.y}`).join(" "),stroke:"none"}):null,n.points.length>1?n.points.slice(0,n.isOutlineClosed?void 0:-1).map((T,G)=>{let ie=n.points[n.isOutlineClosed?(G+1)%n.points.length:G+1],ce=Te(T,ie),ve=ce?-(ie.y-T.y)/ce:0,Ye=ce?(ie.x-T.x)/ce:0,qe=(T.x+ie.x)/2,x=(T.y+ie.y)/2,_=ve*(qe-we.x)+Ye*(x-we.y)>=0?1:-1,q=qe+ve*dc*_,D=x+Ye*dc*_;return(0,B.jsxs)("g",{children:[(0,B.jsx)("line",{className:"deck-outline__edge-hit",x1:T.x,y1:T.y,x2:ie.x,y2:ie.y,onClick:n.isOutlineClosed?()=>be(G):void 0}),(0,B.jsx)("line",{className:`deck-outline__edge${n.wallSegments.has(G)?" is-wall":""}`,x1:T.x,y1:T.y,x2:ie.x,y2:ie.y,pointerEvents:"none"}),(0,B.jsxs)("text",{className:`deck-outline__edge-label${n.wallSegments.has(G)?" is-wall":""}`,x:q,y:D,textAnchor:"middle",dominantBaseline:"central",fontSize:$v/l,children:[ce.toFixed(2)," m"]})]},`segment-${G}`)}):null,!n.isOutlineClosed&&n.points.length>0&&g?(()=>{let T=n.points[n.points.length-1],G=Te(T,g);if(!G)return null;let ie=-(g.y-T.y)/G,ce=(g.x-T.x)/G,ve=(T.x+g.x)/2,Ye=(T.y+g.y)/2;return(0,B.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,B.jsx)("line",{x1:T.x,y1:T.y,x2:g.x,y2:g.y}),(0,B.jsxs)("text",{x:ve+ie*.34,y:Ye+ce*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:$v/l,children:[G.toFixed(2)," m"]})]})})():null,n.points.map((T,G)=>(0,B.jsx)("circle",{className:"deck-outline__point",cx:T.x,cy:T.y,r:"0.13",onPointerDown:ie=>jt(ie,G)},`point-${G}`))]}),(0,B.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,B.jsx)("button",{type:"button",onClick:()=>c(T=>Math.max(.5,T-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,B.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,B.jsx)("button",{type:"button",onClick:()=>c(T=>Math.min(1,T+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),n.isOutlineClosed&&n.wallSegments.size===0&&le?(0,B.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(le.x-z)/u*100}%`,top:`${(le.y-A)/h*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!n.isOutlineClosed&&n.points.length>=3?(0,B.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(T=>Id(T.points,!0)?{...T,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...T,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,B.jsxs)("div",{className:"deck-outline__supporting",children:[(0,B.jsx)("div",{className:"truss-estimator__grid-hint",children:n.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),n.drawError?(0,B.jsx)("div",{className:"deck-outline__error",role:"alert",children:n.drawError}):null]})]})})]})]}):null,O==="pictureFrame"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(T=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.pictureFrame===T.id?" is-selected":""}`,onClick:()=>o(G=>({...G,pictureFrame:T.id})),children:[(0,B.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(T.img),alt:""}),(0,B.jsx)("span",{children:T.label})]},T.id))}),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(T=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.direction===T.id?" is-selected":""}`,onClick:()=>o(G=>({...G,direction:T.id})),children:[(0,B.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(T.img),alt:""}),(0,B.jsx)("span",{children:T.label})]},T.id))})]})]}):null,O==="substructure"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Ra.joist.spacingOptions.map(T=>(0,B.jsx)("button",{type:"button",className:`truss-estimator__option-card${n.joistSpacing===T.id?" is-selected":""}`,onClick:()=>o(G=>({...G,joistSpacing:T.id})),children:(0,B.jsx)("div",{className:"truss-estimator__option-title",children:T.label})},T.id))})]}):null]}),(0,B.jsxs)("div",{className:"truss-estimator__nav",children:[(0,B.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:de,children:"Back"}),(0,B.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:tt,disabled:!Z(),children:[(0,B.jsx)("span",{children:ge}),(0,B.jsx)("span",{className:"arrow",children:(0,B.jsx)(Qt,{})})]})]})]})]})})}var Na=$(He());var Y=$(F()),Vv=12,Xv=30,Yn=12,$n=8,Zv=.56,Sa={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Ei=["range","height","gate","posts"],Wd=e=>Number(e)<=1.2?"6":"8",Kv=(e,t)=>ki("fencing",`panels-${e??"boundary"}-${t}`),Pv=(e,t)=>!t||ki("fencing",e==="concrete"?`concrete-intermediate-${Wd(t)}`:`timber-post-${Wd(t)}`),hx={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},hc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),gc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),gx=(e,t,a,r)=>{let i=hc(e,t,a),n=hc(e,t,r),o=hc(a,r,e),l=hc(a,r,t);return i===0&&gc(e,t,a)||n===0&&gc(e,t,r)||o===0&&gc(a,r,e)||l===0&&gc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},bc=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&gx(e[r],e[(r+1)%e.length],e[i],e[(i+1)%e.length]))return!0;return!1};function em({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Na.useState)(0),[n,o]=(0,Na.useState)(hx),l=(0,Na.useRef)(null),c=(0,Na.useRef)(null),[p,m]=(0,Na.useState)(1),[g,d]=(0,Na.useState)({x:0,y:0}),[b,v]=(0,Na.useState)(null),E=(0,Na.useRef)(null),O=(0,Na.useRef)(null),f=(0,Na.useRef)(null),u=Ei[r],h=n.range?Sa.ranges[n.range]:null,w=Yn/p,k=$n/p,z=(Yn-w)/2,A=($n-k)/2,U=Math.max(-Yn,Math.min(Yn*2-w,z+g.x)),R=Math.max(-$n,Math.min($n*2-k,A+g.y)),H=n.boundaryPoints.reduce((x,_)=>({x:x.x+_.x/Math.max(1,n.boundaryPoints.length),y:x.y+_.y/Math.max(1,n.boundaryPoints.length)}),{x:0,y:0}),oe=x=>{let _=new Set,q=[];return x.forEach(D=>{let[V,N]=D.split(",").map(Number),L=[{key:`H,${V},${N}`,type:"H",x:V,y:N},{key:`H,${V},${N+1}`,type:"H",x:V,y:N+1},{key:`V,${V},${N}`,type:"V",x:V,y:N},{key:`V,${V+1},${N}`,type:"V",x:V+1,y:N}],X=[!x.has(`${V},${N-1}`),!x.has(`${V},${N+1}`),!x.has(`${V-1},${N}`),!x.has(`${V+1},${N}`)];L.forEach((ue,ke)=>{X[ke]&&!_.has(ue.key)&&(_.add(ue.key),q.push(ue))})}),q},Te=(x,_)=>oe(x).filter(q=>!_.has(q.key)),je=(x,_)=>Te(x,_).length,Ve=(x,_)=>{let q={};Te(x,_).forEach(V=>{var N,L,X,ue;V.type==="H"?((q[N=`${V.x},${V.y}`]||(q[N]=[])).push("H"),(q[L=`${V.x+1},${V.y}`]||(q[L]=[])).push("H")):((q[X=`${V.x},${V.y}`]||(q[X]=[])).push("V"),(q[ue=`${V.x},${V.y+1}`]||(q[ue]=[])).push("V"))});let D=0;return Object.values(q).forEach(V=>{(V.length===1||V.length===2&&V[0]!==V[1]||V.length>=3)&&(D+=1)}),D},we=(()=>{let x=n.range?Sa.ranges[n.range]:Sa.ranges.boundary,_=n.height??"1.8",q=n.boundaryMode==="quick"?Math.max(0,Number.parseFloat(n.quickLengthM)||0):n.boundaryClosed?n.boundaryPoints.slice(0,-1).reduce((Yt,hr,yt)=>Yt+(n.excludedBoundaryEdges.has(yt)?0:Math.hypot(n.boundaryPoints[yt+1].x-hr.x,n.boundaryPoints[yt+1].y-hr.y)),0):0,D=n.gateType&&n.gateType!=="none"?Number.parseFloat(n.gateWidthM)||Sa.gate[n.gateType].widthDefault:0,V=Math.max(0,q-D),N=V>0?Math.ceil(V/x.panelWidthM):0,L=n.boundaryPoints.length>2&&n.boundaryPoints[0].x===n.boundaryPoints[n.boundaryPoints.length-1].x&&n.boundaryPoints[0].y===n.boundaryPoints[n.boundaryPoints.length-1].y,X=n.boundaryMode==="quick"?V>0?2:0:n.boundaryClosed?n.boundaryPoints.slice(0,L?-1:void 0).reduce((Yt,hr,yt)=>{let Zn=yt>0&&!n.excludedBoundaryEdges.has(yt-1),wm=yt<n.boundaryPoints.length-1&&!n.excludedBoundaryEdges.has(yt);return Yt+(Zn||wm?1:0)},0):0,ue=V>0?Math.ceil(V/x.panelWidthM)+1:0,ke=Math.max(0,ue-X),vt=n.mountingType?Sa.mounting[n.mountingType]:Sa.mounting.concrete,mt=n.gateType&&n.gateType!=="none"?2:0,Ut=ke+X+mt,bm=n.mountingType==="postcrete"?Ut*Sa.mounting.postcrete.bagsPerPost:0,Jr=n.gravelBoard==="yes"?N:0;return{range:x,height:_,totalEdgeM:q,fencedLengthM:V,gateWidthM:D,panelsCount:N,cornerPostCount:X,intermediatePostCount:ke,gatePostCount:mt,totalPostCount:Ut,bagsCount:bm,gravelCount:Jr,capCount:Ut,mounting:vt}})(),le=n.gateType&&n.gateType!=="none"?Sa.gate[n.gateType].label:null,Fe=Wd(we.height),Ee=we?[{key:`panels-${n.range??"boundary"}-${we.height}`,label:`${we.range.label} panels (${we.height}m)`,qty:we.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...n.mountingType==="concrete"?[{key:`concrete-intermediate-${Fe}`,label:"Intermediate concrete posts",qty:we.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${Fe}`,label:"End and corner concrete posts",qty:we.cornerPostCount+we.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${Fe}`,label:"Timber fence posts",qty:we.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:we.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...le?[{key:`gate-${n.range??"boundary"}`,label:n.range==="skyline"?"Single feather edge gate":"Single lap gate",qty:1,unit:"each",query:n.range==="skyline"?"feather edge gate":"lap gate",category:"fencing"}]:[],...we.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:we.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],Nt=()=>{if(u==="range"){let x=n.boundaryMode==="quick"?(Number.parseFloat(n.quickLengthM)||0)>0:n.boundaryClosed&&n.boundaryPoints.length>=2;return!!n.range&&x}return u==="height"?!!n.height&&!!n.gravelBoard:u==="gate"?!!n.gateType&&(n.gateType==="none"||n.gateWidthM.trim()!==""):u==="posts"?!!n.mountingType:!0},Z=r===Ei.length-1?a:"Next",ge=x=>{o(_=>{let q=x(new Set(_.grid)),D=new Set([..._.excludedEdges].filter(V=>oe(q).some(N=>N.key===V)));return{..._,grid:q,excludedEdges:D}})},Re=(x,_,q)=>{ge(D=>{let V=`${x},${_}`;return q?D.add(V):D.delete(V),D})},bt=(x,_,q,D,V)=>{let N=x,L=_,X=Math.abs(q-x),ue=x<q?1:-1,ke=-Math.abs(D-_),vt=_<D?1:-1,mt=X+ke;for(;Re(N,L,V),!(N===q&&L===D);){let Ut=2*mt;Ut>=ke&&(mt+=ke,N+=ue),Ut<=X&&(mt+=X,L+=vt)}},jt=(x,_)=>{let q=c.current?.getBoundingClientRect();if(!q)return null;let D=Math.floor((x-q.left)/Xv),V=Math.floor((_-q.top)/Xv);return D<0||V<0||D>=Vv||V>=Vv?null:{x:D,y:V}},Ct=x=>{if(n.gridMode!=="draw")return;let _=jt(x.clientX,x.clientY);if(!_)return;x.preventDefault();let q=`${_.x},${_.y}`,D=!n.grid.has(q);l.current={active:!0,paintValue:D,lastX:_.x,lastY:_.y},x.currentTarget.setPointerCapture(x.pointerId),Re(_.x,_.y,D)},wt=x=>{let _=l.current;if(!_?.active)return;let q=jt(x.clientX,x.clientY);q&&(q.x===_.lastX&&q.y===_.lastY||(bt(_.lastX,_.lastY,q.x,q.y,_.paintValue),l.current={..._,lastX:q.x,lastY:q.y}))},be=x=>{l.current?.active&&(l.current=null,x.currentTarget.releasePointerCapture(x.pointerId))},de=(x,_,q=!1)=>{let D=f.current?.getBoundingClientRect();if(!D)return null;let V=q?1:.25;return{x:Math.round(Math.max(U,Math.min(U+w,U+(x-D.left)/D.width*w))/V)*V,y:Math.round(Math.max(R,Math.min(R+k,R+(_-D.top)/D.height*k))/V)*V}},tt=x=>{if(n.boundaryClosed){let q=x.target;if(q!==x.currentTarget&&!q.classList.contains("fence-boundary__grid"))return;O.current={startX:x.clientX,startY:x.clientY,startViewX:U,startViewY:R},x.currentTarget.setPointerCapture(x.pointerId);return}let _=de(x.clientX,x.clientY,!0);_&&(v(null),o(q=>{let D=[...q.boundaryPoints,_];return bc(D,!1)?{...q}:{...q,boundaryPoints:D}}))},T=(x,_)=>{if(x.stopPropagation(),!n.boundaryClosed){if(_!==0||n.boundaryPoints.length<3)return;o(q=>bc(q.boundaryPoints,!0)?q:{...q,boundaryPoints:[...q.boundaryPoints,q.boundaryPoints[0]],boundaryClosed:!0});return}E.current=_,x.currentTarget.setPointerCapture(x.pointerId)},G=x=>{if(O.current){let q=f.current?.getBoundingClientRect();if(!q)return;let D=O.current,V=D.startViewX-(x.clientX-D.startX)/q.width*w,N=D.startViewY-(x.clientY-D.startY)/q.height*k;d({x:V-z,y:N-A});return}if(n.boundaryClosed||v(de(x.clientX,x.clientY,!0)),E.current===null)return;let _=de(x.clientX,x.clientY);_&&o(q=>{let D=q.boundaryPoints.length>2&&q.boundaryPoints[0].x===q.boundaryPoints[q.boundaryPoints.length-1].x&&q.boundaryPoints[0].y===q.boundaryPoints[q.boundaryPoints.length-1].y,V=q.boundaryPoints.map((N,L)=>{let X=L===E.current,ue=D&&E.current===0&&L===q.boundaryPoints.length-1;return X||ue?_:N});return bc(V,!1)?q:{...q,boundaryPoints:V}})},ie=x=>{O.current=null,E.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId)},ce=x=>{o(_=>{let q=new Set(_.excludedBoundaryEdges);return q.has(x)?q.delete(x):q.add(x),{..._,excludedBoundaryEdges:q}})},ve=()=>{r===0?e():i(x=>x-1)},Ye=()=>{Nt()&&(r===Ei.length-1?t?.(Ee):i(x=>x+1))},qe=oe(n.grid);return(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)("div",{className:"truss-estimator",children:[(0,Y.jsxs)("div",{className:"quick-order-hero",children:[(0,Y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Y.jsx)("h1",{children:"Fencing Calculator"}),(0,Y.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,Y.jsxs)("div",{className:"truss-estimator__card",children:[(0,Y.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.ranges).map(([x,_])=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===x?" is-selected":""}`,onClick:()=>o(q=>({...q,range:x,height:q.height&&Kv(x,q.height)?q.height:null})),children:[(0,Y.jsx)("div",{className:"truss-estimator__option-title",children:_.label}),(0,Y.jsx)("div",{className:"truss-estimator__option-copy",children:_.blurb})]},x))})]}):null,u==="range"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,Y.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,Y.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"quick"})),children:"Quick estimate"}),(0,Y.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"draw"})),children:"Draw your boundary"})]}),n.boundaryMode==="quick"?(0,Y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,Y.jsx)("span",{children:"Total fence length (m)"}),(0,Y.jsx)("input",{type:"number",min:"0",step:"0.1",value:n.quickLengthM,onChange:x=>o(_=>({..._,quickLengthM:x.target.value}))})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"fence-boundary__toolbar",children:(0,Y.jsxs)("div",{className:"fence-boundary__actions",children:[(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(x=>({...x,boundaryPoints:x.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:n.boundaryPoints.length===0||n.boundaryClosed,children:"Undo"}),(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d({x:0,y:0}),v(null),o(x=>({...x,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:n.boundaryPoints.length===0,children:"Clear"}),(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(x=>({...x,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,Y.jsxs)("div",{className:"fence-boundary",children:[(0,Y.jsxs)("svg",{ref:f,className:`fence-boundary__canvas${n.boundaryClosed?" is-pan-mode":""}`,viewBox:`${U} ${R} ${w} ${k}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:tt,onPointerMove:G,onPointerUp:ie,onPointerLeave:()=>{v(null),O.current||(E.current=null)},children:[(0,Y.jsx)("defs",{children:(0,Y.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,Y.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,Y.jsx)("rect",{x:-Yn,y:-$n,width:Yn*3,height:$n*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),n.boundaryPoints.length>1?(0,Y.jsx)("polyline",{className:"fence-boundary__preview",points:n.boundaryPoints.map(x=>`${x.x},${x.y}`).join(" ")}):null,n.boundaryPoints.length>1?n.boundaryPoints.slice(0,-1).map((x,_)=>{let q=n.boundaryPoints[_+1],D=Math.hypot(q.x-x.x,q.y-x.y),V=D?-(q.y-x.y)/D:0,N=D?(q.x-x.x)/D:0,L=(x.x+q.x)/2,X=(x.y+q.y)/2,ue=V*(L-H.x)+N*(X-H.y)>=0?1:-1,ke=L+V*Zv*ue,vt=X+N*Zv*ue;return(0,Y.jsxs)("g",{children:[(0,Y.jsx)("line",{className:"fence-boundary__edge-hit",x1:x.x,y1:x.y,x2:q.x,y2:q.y,onClick:n.boundaryClosed?()=>ce(_):void 0}),(0,Y.jsx)("line",{className:`fence-boundary__edge${n.excludedBoundaryEdges.has(_)?" is-excluded":""}`,x1:x.x,y1:x.y,x2:q.x,y2:q.y,pointerEvents:"none"}),(0,Y.jsxs)("text",{className:`fence-boundary__edge-label${n.excludedBoundaryEdges.has(_)?" is-excluded":""}`,x:ke,y:vt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[D.toFixed(2)," m"]})]},`fence-edge-${_}`)}):null,!n.boundaryClosed&&n.boundaryPoints.length>0&&b?(()=>{let x=n.boundaryPoints[n.boundaryPoints.length-1],_=Math.hypot(b.x-x.x,b.y-x.y);if(!_)return null;let q=-(b.y-x.y)/_,D=(b.x-x.x)/_,V=(x.x+b.x)/2,N=(x.y+b.y)/2;return(0,Y.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,Y.jsx)("line",{x1:x.x,y1:x.y,x2:b.x,y2:b.y}),(0,Y.jsxs)("text",{x:V+q*.34,y:N+D*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[_.toFixed(2)," m"]})]})})():null,n.boundaryPoints.map((x,_)=>_>0&&_===n.boundaryPoints.length-1&&x.x===n.boundaryPoints[0]?.x&&x.y===n.boundaryPoints[0]?.y?null:(0,Y.jsx)("circle",{className:`fence-boundary__point${!n.boundaryClosed&&_===0&&n.boundaryPoints.length>=3?" is-close-target":""}`,cx:x.x,cy:x.y,r:"0.13",onPointerDown:q=>T(q,_)},`fence-point-${_}`))]}),(0,Y.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,Y.jsx)("button",{type:"button",onClick:()=>m(x=>Math.max(.5,x-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,Y.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,Y.jsx)("button",{type:"button",onClick:()=>m(x=>Math.min(1,x+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!n.boundaryClosed&&n.boundaryPoints.length>=2?(0,Y.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(x=>bc(x.boundaryPoints,!1)?x:{...x,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,Y.jsx)("div",{className:"truss-estimator__grid-hint",children:n.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,Y.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,Y.jsx)("div",{children:n.boundaryMode==="quick"?`${(Number.parseFloat(n.quickLengthM)||0).toFixed(2)} m fence line`:`${we.totalEdgeM.toFixed(2)} m fence line`}),n.boundaryMode==="draw"&&n.boundaryClosed?(0,Y.jsxs)("div",{children:[we.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Sa.heights.filter(x=>Kv(n.range,x)).map(x=>(0,Y.jsx)("button",{type:"button",className:`truss-estimator__visual-card${n.height===x?" is-selected":""}`,onClick:()=>o(_=>({..._,height:x,mountingType:_.mountingType&&Pv(_.mountingType,x)?_.mountingType:null})),children:(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:It(`/fencing/height/${x}.webp`),alt:""})},x))}),(0,Y.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(x=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.gravelBoard===x.id?" is-selected":""}`,onClick:()=>o(_=>({..._,gravelBoard:x.id})),children:[(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(x.img),alt:""}),(0,Y.jsx)("span",{children:x.label})]},x.id))})]}):null,u==="gate"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(x=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${n.gateType===x.id?" is-selected":""}`,onClick:()=>o(_=>({..._,gateType:x.id,gateWidthM:x.id==="none"?"":String(Sa.gate[x.id].widthDefault)})),children:[(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(x.img),alt:""}),(0,Y.jsx)("span",{children:x.label})]},x.id))}),n.gateType&&n.gateType!=="none"?(0,Y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,Y.jsx)("span",{children:"Gate width (m)"}),(0,Y.jsx)("input",{type:"text",inputMode:"decimal",value:n.gateWidthM,onChange:x=>o(_=>({..._,gateWidthM:x.target.value}))})]}):null]}):null,u==="posts"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.mounting).filter(([x])=>Pv(x,n.height)).map(([x,_])=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.mountingType===x?" is-selected":""}`,onClick:()=>o(q=>({...q,mountingType:x})),children:[(0,Y.jsx)("div",{className:"truss-estimator__option-title",children:_.label}),(0,Y.jsx)("div",{className:"truss-estimator__option-copy",children:_.blurb})]},x))})]}):null]}),(0,Y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,Y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ve,children:"Back"}),(0,Y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:Ye,disabled:!Nt(),children:[(0,Y.jsx)("span",{children:Z}),(0,Y.jsx)("span",{className:"arrow",children:(0,Y.jsx)(Qt,{})})]})]})]})]})})}var wc=$(He()),he=$(F()),Jv={floor:{label:"Floor between rooms",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36},ground:{label:"Ground floor",product:"Rigid PIR insulation board",thickness:"100mm",coverage:2.88},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89}};function tm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,wc.useState)("floor"),[n,o]=(0,wc.useState)(""),[l,c]=(0,wc.useState)(""),p=Number.parseFloat(n)*Number.parseFloat(l)||0,m=Jv[r],g=Math.ceil(p/m.coverage),d=[{key:`insulation-${r}`,label:`${m.product} ${m.thickness}`,qty:Math.round(p*100)/100,unit:"m2",query:m.product,category:"insulation"}],b=Object.entries(Jv);return(0,he.jsx)(he.Fragment,{children:(0,he.jsxs)("div",{className:"truss-estimator",children:[(0,he.jsxs)("div",{className:"quick-order-hero",children:[(0,he.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,he.jsx)("h1",{children:"Insulation Calculator"}),(0,he.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,he.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,he.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,he.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,he.jsxs)("div",{className:"materials-calculator__section",children:[(0,he.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,he.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:b.map(([v,E])=>(0,he.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>i(v),children:[(0,he.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,he.jsxs)("div",{className:"truss-estimator__option-copy",children:[E.product,", ",E.thickness]})]},v))})]}),(0,he.jsxs)("div",{className:"materials-calculator__section",children:[(0,he.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,he.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,he.jsxs)("label",{className:"truss-estimator__field",children:[(0,he.jsx)("span",{children:"Length (m)"}),(0,he.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:v=>o(v.target.value)})]}),(0,he.jsxs)("label",{className:"truss-estimator__field",children:[(0,he.jsx)("span",{children:"Width (m)"}),(0,he.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]})]}),(0,he.jsxs)("div",{className:"materials-calculator__totals",children:[(0,he.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,he.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,he.jsxs)("div",{children:[(0,he.jsx)("span",{children:"Insulated area"}),(0,he.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,he.jsxs)("div",{children:[(0,he.jsx)("span",{children:m.product}),(0,he.jsxs)("strong",{children:[g," packs"]})]})]}),(0,he.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,he.jsxs)("div",{className:"materials-calculator__actions",children:[(0,he.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,he.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(d),disabled:p<=0,children:a})]})]})]})})}var Vn=$(He());var K=$(F()),bx=10,wx=1.9*.762,vx=1.9*1.524,vc=()=>({height:"",width:""}),yc=e=>Number.parseFloat(e)||0,Iv=({height:e,width:t})=>yc(e)*yc(t);function am({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Vn.useState)([vc()]),[n,o]=(0,Vn.useState)([vc()]),[l,c]=(0,Vn.useState)("0"),[p,m]=(0,Vn.useState)("0"),[g,d]=(0,Vn.useState)(1),b=r.reduce((k,z)=>k+Iv(z),0),v=n.reduce((k,z)=>k+Iv(z),0),E=yc(l)*wx+yc(p)*vx,O=Math.max(0,b-v-E),f=O*g/bx,u={key:"paint-emulsion",label:"Matt emulsion, brilliant white",qty:Math.round(f*10)/10,unit:"litres",query:"matt emulsion brilliant white"},h=dl("paint",u)!=null,w=(k,z,A,U)=>{k(R=>R.map((H,oe)=>oe===z?{...H,[A]:U}:H))};return(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)("div",{className:"truss-estimator",children:[(0,K.jsxs)("div",{className:"quick-order-hero",children:[(0,K.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,K.jsx)("h1",{children:"Paint Calculator"}),(0,K.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,K.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,K.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,K.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,K.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,K.jsx)("span",{}),(0,K.jsx)("span",{children:"Height (m)"}),(0,K.jsx)("span",{children:"Width (m)"}),(0,K.jsx)("span",{})]}),r.map((k,z)=>(0,K.jsxs)("div",{className:"paint-calculator__row",children:[(0,K.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",z+1]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,K.jsx)("input",{"aria-label":`Wall ${z+1} height in metres`,type:"number",min:"0",step:"0.01",value:k.height,onChange:A=>w(i,z,"height",A.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,K.jsx)("input",{"aria-label":`Wall ${z+1} width in metres`,type:"number",min:"0",step:"0.01",value:k.width,onChange:A=>w(i,z,"width",A.target.value)})]}),r.length>1?(0,K.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(A=>A.filter((U,R)=>R!==z)),children:"Remove"}):null]},`wall-${z}`)),(0,K.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(k=>[...k,vc()]),children:"+ Add another wall"})]}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,K.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,K.jsx)("span",{}),(0,K.jsx)("span",{children:"Height (m)"}),(0,K.jsx)("span",{children:"Width (m)"}),(0,K.jsx)("span",{})]}),n.map((k,z)=>(0,K.jsxs)("div",{className:"paint-calculator__row",children:[(0,K.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",z+1]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,K.jsx)("input",{"aria-label":`Area ${z+1} height in metres`,type:"number",min:"0",step:"0.01",value:k.height,onChange:A=>w(o,z,"height",A.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,K.jsx)("input",{"aria-label":`Area ${z+1} width in metres`,type:"number",min:"0",step:"0.01",value:k.width,onChange:A=>w(o,z,"width",A.target.value)})]}),n.length>1?(0,K.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>o(A=>A.filter((U,R)=>R!==z)),children:"Remove"}):null]},`excluded-${z}`)),(0,K.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>o(k=>[...k,vc()]),children:"+ Add another area"})]}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,K.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Doors"}),(0,K.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:k=>c(k.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Double doors"}),(0,K.jsx)("input",{type:"number",min:"0",step:"1",value:p,onChange:k=>m(k.target.value)})]})]}),(0,K.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Number of coats"}),(0,K.jsxs)("select",{value:g,onChange:k=>d(Number(k.target.value)),children:[(0,K.jsx)("option",{value:"1",children:"1 coat"}),(0,K.jsx)("option",{value:"2",children:"2 coats"}),(0,K.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,K.jsxs)("div",{className:"paint-calculator__totals",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,K.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Paintable area"}),(0,K.jsxs)("strong",{children:[O.toFixed(2)," m\xB2"]})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Coverage"}),(0,K.jsxs)("strong",{children:[g," ",g===1?"coat":"coats"]})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Paint required"}),(0,K.jsxs)("strong",{children:[f.toFixed(1)," litres"]})]})]}),(0,K.jsx)("p",{className:"paint-calculator__note",children:h?"Based on paint coverage of 10 m\xB2 per litre. Ordered as brilliant white matt emulsion, rounded up to whole tins.":"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,K.jsxs)("div",{className:"paint-calculator__actions",children:[(0,K.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),h?(0,K.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.([u]),disabled:f<=0,children:a}):(0,K.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var fr=$(He()),te=$(F()),_c=e=>Number.parseFloat(e)||0,rm={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function im({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,fr.useState)("paving"),[n,o]=(0,fr.useState)("council"),[l,c]=(0,fr.useState)(""),[p,m]=(0,fr.useState)(""),[g,d]=(0,fr.useState)("100"),[b,v]=(0,fr.useState)("50"),[E,O]=(0,fr.useState)(!0),[f,u]=(0,fr.useState)(!0),h=_c(l)*_c(p),w=h,k=h*(_c(g)/1e3),z=h*.04,A=h*(_c(b)/1e3),U=Math.ceil(w/.36),R=Math.ceil(w/.1),H=Math.ceil(k*1700/800),oe=Math.ceil(z*1600/800),Te=Math.ceil(A*1600/800),je=r==="paving"?{qty:U,unit:"each"}:r==="block"?{qty:w,unit:"m2"}:{qty:Te,unit:"bag"},Ve={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],Ne=[{key:`surface-${n}`,label:rm[r].find(le=>le.id===n)?.label??"Surface material",qty:je.qty,unit:je.unit,query:Ve,category:"landscaping"},...E?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:H,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...f?[{key:"bedding",label:"Sharp sand bedding",qty:oe,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,te.jsx)(te.Fragment,{children:(0,te.jsxs)("div",{className:"truss-estimator",children:[(0,te.jsxs)("div",{className:"quick-order-hero",children:[(0,te.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,te.jsx)("h1",{children:"Paving and Driveway Calculator"}),(0,te.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,te.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,te.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,te.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,te.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([le,Fe,Ee])=>(0,te.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===le?" is-selected":""}`,onClick:()=>{i(le),o(rm[le][0].id)},children:[(0,te.jsx)("div",{className:"truss-estimator__option-title",children:Fe}),(0,te.jsx)("div",{className:"truss-estimator__option-copy",children:Ee})]},le))}),(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Finish"}),(0,te.jsx)("select",{value:n,onChange:le=>o(le.target.value),children:rm[r].map(le=>(0,te.jsx)("option",{value:le.id,children:le.label},le.id))})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,te.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Length (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:le=>c(le.target.value)})]}),(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Width (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:le=>m(le.target.value)})]})]}),r==="gravel"&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Gravel depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:le=>v(le.target.value)})]}),E&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Sub-base depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:g,onChange:le=>d(le.target.value)})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:E,onChange:le=>O(le.target.checked)}),(0,te.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:f,onChange:le=>u(le.target.checked)}),(0,te.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__totals",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,te.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Surface area"}),(0,te.jsxs)("strong",{children:[h.toFixed(2)," m\xB2"]})]}),(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,te.jsx)("strong",{children:r==="paving"?`${U} slabs`:r==="block"?`${w.toFixed(2)} m\xB2`:`${Te} bulk bags`})]}),E&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"MOT Type 1"}),(0,te.jsxs)("strong",{children:[H," bulk bags"]})]}),f&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Sharp sand"}),(0,te.jsxs)("strong",{children:[oe," bulk bags"]})]})]}),(0,te.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,te.jsxs)("div",{className:"materials-calculator__actions",children:[(0,te.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,te.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(Ne),disabled:h<=0,children:a})]})]})]})})}var ml=$(He()),re=$(F()),yx=2.88,Fv=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],Wv=()=>({length:"",height:""}),nm=e=>Number.parseFloat(e)||0;function om({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ml.useState)([Wv()]),[n,o]=(0,ml.useState)(""),[l,c]=(0,ml.useState)("standard"),[p,m]=(0,ml.useState)("screws"),g=r.reduce((z,A)=>z+nm(A.length)*nm(A.height),0),d=Math.max(0,g-nm(n)),b=Math.ceil(d/yx),v=Math.ceil(d*12),E=Math.ceil(v/1e3),O=Math.ceil(d*1.2),f=Math.ceil(O/90),u=Math.ceil(d/3.5),h=Fv.find(z=>z.id===l)?.label??"Standard",w=[{key:"board",label:`${h} plasterboard`,qty:b,unit:"sheet",query:`${h} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:E,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:u,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:f,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],k=(z,A,U)=>{i(R=>R.map((H,oe)=>oe===z?{...H,[A]:U}:H))};return(0,re.jsx)(re.Fragment,{children:(0,re.jsxs)("div",{className:"truss-estimator",children:[(0,re.jsxs)("div",{className:"quick-order-hero",children:[(0,re.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,re.jsx)("h1",{children:"Plasterboard and Drylining Calculator"}),(0,re.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,re.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,re.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,re.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,re.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Fv.map(z=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===z.id?" is-selected":""}`,onClick:()=>c(z.id),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:z.label}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:z.blurb})]},z.id))})]}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,re.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([z,A,U])=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===z?" is-selected":""}`,onClick:()=>m(z),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:A}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:U})]},z))})]}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,re.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,re.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,re.jsx)("span",{children:"Surface"}),(0,re.jsx)("span",{children:"Length (m)"}),(0,re.jsx)("span",{children:"Height (m)"}),(0,re.jsx)("span",{})]}),r.map((z,A)=>(0,re.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,re.jsxs)("span",{children:["Surface ",A+1]}),(0,re.jsx)("input",{"aria-label":`Surface ${A+1} length`,type:"number",min:"0",step:"0.01",value:z.length,onChange:U=>k(A,"length",U.target.value)}),(0,re.jsx)("input",{"aria-label":`Surface ${A+1} height`,type:"number",min:"0",step:"0.01",value:z.height,onChange:U=>k(A,"height",U.target.value)}),r.length>1?(0,re.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(U=>U.filter((R,H)=>H!==A)),children:"Remove"}):null]},`surface-${A}`)),(0,re.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(z=>[...z,Wv()]),children:"+ Add another surface"}),(0,re.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,re.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,re.jsx)("small",{children:"optional"})]}),(0,re.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:z=>o(z.target.value)})]})]}),(0,re.jsxs)("div",{className:"materials-calculator__totals",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,re.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Board area"}),(0,re.jsxs)("strong",{children:[d.toFixed(2)," m\xB2"]})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,re.jsx)("strong",{children:b})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,re.jsx)("strong",{children:p==="screws"?`${v} (${E} boxes)`:`${u} bags`})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Joint tape"}),(0,re.jsxs)("strong",{children:[O," m (",f," rolls)"]})]})]}),(0,re.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,re.jsxs)("div",{className:"materials-calculator__actions",children:[(0,re.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,re.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(w),disabled:d<=0,children:a})]})]})]})})}var fl=$(He());var y=$(F()),At={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},xc=["range","pitchAndDimensions","quantityAndGirders","bracing"],_x={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function xx({degrees:e}){let a=e*Math.PI/180,i=82-Math.min(58,38*Math.tan(a));return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("polygon",{points:`12,82 88,82 50,${i}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function kx({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",i="#d3d8de",n="#7c8494",o=(m,g,d,b,v=8,E)=>{let O=d-m,f=b-g,u=Math.hypot(O,f)||1,h=-f/u,w=O/u,k=v*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:m,y1:g,x2:d,y2:b,stroke:a,strokeWidth:v+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:m,y1:g,x2:d,y2:b,stroke:t,strokeWidth:v,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:m-h*k,y1:g-w*k,x2:d-h*k,y2:b-w*k,stroke:r,strokeWidth:Math.max(1.5,v*.24),strokeLinecap:"round",opacity:"0.9"})]},E)},l=(m,g,d)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:m-7.5,y:g-5.5,width:"15",height:"11",rx:"2",fill:i,stroke:n,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:m-4,cy:g-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m+4,cy:g-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m-4,cy:g+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m+4,cy:g+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m,cy:g,r:"1",fill:n})]},d),c=(m,g)=>(0,y.jsx)("rect",{x:m-9,y:"110",width:"18",height:"10",fill:a},g),p=(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,y.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,y.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,y.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function Sx({enabled:e}){return(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,y.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,y.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function e0({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,y.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,y.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function lm({onBack:e}){let[t,a]=(0,fl.useState)(0),[r,i]=(0,fl.useState)(_x),[n,o]=(0,fl.useState)(!1),[l,c]=(0,fl.useState)(!1),p=()=>{let f=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return f<=0||!u?0:Math.ceil(f*1e3/u)+1},g=(()=>{let f=r.range?At.ranges[r.range]:At.ranges.standard,u=r.pitch??"22.5",h=At.pitchMultipliers[u],w=(Number.parseFloat(r.spanMM)||0)/1e3,z=(Number.parseFloat(r.overhangMM)||0)>At.overhang.thresholdMM,A=p(),U=A+r.girderCount,R=Number.parseFloat(r.roofLengthM)||0,H=r.treatment?At.treatment[r.treatment]:At.treatment.untreated,oe=At.estimate.ranges[r.range??"standard"],Te=oe.supplyAt8m*Math.max(.7,w/8)*h*(1+H.surchargePct)+(z?At.overhang.surchargePerTruss:0),je=A*Te,Ve=r.girderCount*Te*At.estimate.girderMultiplier,Ne=r.bracing==="yes"?R*At.estimate.bracingPerMetre:0,we=je+Ve+Ne+At.estimate.delivery,le=At.estimate.design+A*oe.installPerTruss+r.girderCount*40,Fe=we+le,Ee=Fe*.2;return{range:f,count:A,girderCount:r.girderCount,overhangApplies:z,overhangUnits:U,roofLengthM:R,treatment:H,trussSupply:je,bracingMaterials:Ne,delivery:At.estimate.delivery,labour:le,subtotal:Fe,vat:Ee,total:Fe+Ee}})(),d=()=>{let f=xc[t];return f==="range"?!!r.range:f==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":f==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:f==="bracing"?!!r.bracing&&!!r.treatment:!0},b=t===xc.length-1?"View truss request":"Next",v=()=>{n?o(!1):t===0?e():a(f=>f-1)},E=()=>{d()&&(t===xc.length-1?(c(!1),o(!0)):a(f=>f+1))},O=()=>{let f=xc[t];return f==="range"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(At.ranges).map(([u,h])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>i(w=>({...w,range:u})),children:[(0,y.jsx)(kx,{type:u}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:h.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:h.blurb})]})]},u))})]}):f==="pitchAndDimensions"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,y.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Span (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>i(h=>({...h,spanMM:u.target.value}))})]}),(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Overhang (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>i(h=>({...h,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",At.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:At.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>i(h=>({...h,pitch:u})),children:[(0,y.jsx)(xx,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):f==="quantityAndGirders"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,y.jsx)("span",{children:"Roof length (m)"}),(0,y.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>i(h=>({...h,roofLengthM:u.target.value}))})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:At.centresOptions.map(u=>(0,y.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>i(h=>({...h,centres:u})),children:(0,y.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,y.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,y.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,y.jsx)("span",{children:r.girderCount}),(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):f==="bracing"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>i(h=>({...h,bracing:u.id})),children:[(0,y.jsx)(Sx,{enabled:u.id==="yes"}),(0,y.jsx)("span",{children:u.label})]},u.id))}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,y.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(e0,{treated:!1}),(0,y.jsx)("span",{children:"Untreated"})]}),(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(e0,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return n?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Your truss estimate"}),(0,y.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,y.jsxs)("div",{className:"truss-request__heading",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,y.jsxs)("h2",{children:[g.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[g.count,(0,y.jsx)("span",{children:"trusses"})]})]}),(0,y.jsxs)("div",{className:"truss-request__grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Span"}),(0,y.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Roof length"}),(0,y.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Pitch"}),(0,y.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Centres"}),(0,y.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Overhang"}),(0,y.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Treatment"}),(0,y.jsx)("strong",{children:g.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:g.girderCount||"None"})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing pack"}),(0,y.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,y.jsxs)("div",{className:"truss-request__price",children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,y.jsxs)("div",{className:"truss-request__price-grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Truss supply allowance"}),(0,y.jsx)("strong",{children:nt(g.trussSupply)})]}),g.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:nt(g.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:nt(g.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:nt(g.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:nt(g.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:nt(g.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:nt(g.total)})]})]}),(0,y.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,y.jsxs)("div",{className:"truss-request__notice",children:[(0,y.jsx)("strong",{children:"Before ordering"}),(0,y.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:v,children:"Back to calculator"}),(0,y.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,y.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Roof Truss Calculator"}),(0,y.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card",children:[(0,y.jsx)("div",{className:"truss-estimator__body",children:O()}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:v,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:E,disabled:!d(),children:[(0,y.jsx)("span",{children:b}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Qt,{})})]})]})]})]})})}var Mi=$(He()),I=$(F()),r0=e=>Number.parseFloat(e)||0,kc=(e,t)=>r0(e)*(t==="m"?1:.3048),t0=()=>({length:"",width:""}),a0=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function Nx({profile:e}){return(0,I.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,I.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,I.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function sm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Mi.useState)("total"),[n,o]=(0,Mi.useState)("m"),[l,c]=(0,Mi.useState)(""),[p,m]=(0,Mi.useState)([t0()]),[g,d]=(0,Mi.useState)(""),[b,v]=(0,Mi.useState)("chamfered"),E="4.4",O=r==="total"?kc(l,n):p.reduce((k,z)=>k+2*(kc(z.length,n)+kc(z.width,n)),0),f=Math.max(0,O-kc(g,n)),u=Math.ceil(f/r0(E)),h=[{key:`skirting-${b}`,label:`${a0.find(k=>k.id===b)?.label} skirting board`,qty:f,unit:"m",query:"skirting board",category:"skirting"}],w=(k,z,A)=>{m(U=>U.map((R,H)=>H===k?{...R,[z]:A}:R))};return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)("div",{className:"truss-estimator",children:[(0,I.jsxs)("div",{className:"quick-order-hero",children:[(0,I.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,I.jsx)("h1",{children:"Skirting Board Calculator"}),(0,I.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,I.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,I.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,I.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,I.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>i("total"),children:"Total length"}),(0,I.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>i("rooms"),children:"Room by room"})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,I.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,I.jsx)("span",{children:"Units"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,I.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,I.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Total skirting length (",n,")"]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:k=>c(k.target.value)})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,I.jsx)("span",{children:"Room"}),(0,I.jsxs)("span",{children:["Length (",n,")"]}),(0,I.jsxs)("span",{children:["Width (",n,")"]}),(0,I.jsx)("span",{})]}),p.map((k,z)=>(0,I.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,I.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",z+1]}),(0,I.jsx)("input",{"aria-label":`Room ${z+1} length in ${n}`,type:"number",min:"0",step:"0.01",value:k.length,onChange:A=>w(z,"length",A.target.value)}),(0,I.jsx)("input",{"aria-label":`Room ${z+1} width in ${n}`,type:"number",min:"0",step:"0.01",value:k.width,onChange:A=>w(z,"width",A.target.value)}),p.length>1?(0,I.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>m(A=>A.filter((U,R)=>R!==z)),children:"Remove"}):null]},`room-${z}`)),(0,I.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>m(k=>[...k,t0()]),children:"+ Add another room"})]}),(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Openings and doorways to deduct (",n,") ",(0,I.jsx)("small",{children:"optional"})]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:k=>d(k.target.value)})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.4m white-primed MDF boards."}),(0,I.jsx)("div",{className:"architrave-calculator__profiles",children:a0.map(k=>(0,I.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===k.id?" is-selected":""}`,onClick:()=>v(k.id),children:[(0,I.jsx)(Nx,{profile:k.id}),(0,I.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,I.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.id))})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,I.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,I.jsxs)("label",{className:"truss-estimator__field",children:[(0,I.jsx)("span",{children:"Board length"}),(0,I.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,I.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Net skirting"}),(0,I.jsxs)("strong",{children:[f.toFixed(2)," m"]})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Board lengths"}),(0,I.jsx)("strong",{children:u})]})]}),(0,I.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,I.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,I.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(h),disabled:f<=0,children:a})]})]})]})})}var Xn=$(He()),ne=$(F()),hl=e=>Number.parseFloat(e)||0;function cm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Xn.useState)("studs"),[n,o]=(0,Xn.useState)(""),[l,c]=(0,Xn.useState)(""),[p,m]=(0,Xn.useState)("600"),[g,d]=(0,Xn.useState)("2.4"),b=n&&l&&p?Math.ceil(hl(l)/(hl(p)/1e3))+1:0,v=b*hl(n),E=hl(g)>0?Math.ceil(v/hl(g)):0,O=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:v,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],f={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},h={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)("div",{className:"truss-estimator",children:[(0,ne.jsxs)("div",{className:"quick-order-hero",children:[(0,ne.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ne.jsx)("h1",{children:"Timber Calculator"}),(0,ne.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,ne.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ne.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,ne.jsxs)("p",{className:"truss-estimator__step-sub",children:[h.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,ne.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(f).map(w=>(0,ne.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>i(w),children:[(0,ne.jsx)("div",{className:"truss-estimator__option-title",children:f[w][0]}),(0,ne.jsx)("div",{className:"truss-estimator__option-copy",children:f[w][1]})]},w))})]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[h.member," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:w=>o(w.target.value)})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[h.overall," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Centres (mm)"}),(0,ne.jsxs)("select",{value:p,onChange:w=>m(w.target.value),children:[(0,ne.jsx)("option",{value:"300",children:"300 mm"}),(0,ne.jsx)("option",{value:"400",children:"400 mm"}),(0,ne.jsx)("option",{value:"450",children:"450 mm"}),(0,ne.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Stock length (m)"}),(0,ne.jsxs)("select",{value:g,onChange:w=>d(w.target.value),children:[(0,ne.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,ne.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,ne.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,ne.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ne.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:h.count}),(0,ne.jsx)("strong",{children:b})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:"Linear metres"}),(0,ne.jsxs)("strong",{children:[v.toFixed(2)," m"]})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsxs)("span",{children:[g," m lengths"]}),(0,ne.jsx)("strong",{children:E})]})]}),(0,ne.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,ne.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ne.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ne.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(O),disabled:v<=0,children:a})]})]})]})})}var um=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:lm},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:em},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Fd},{id:"brick-block",title:"Brick and Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Kd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:am},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:sm},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:Zd},{id:"concrete-aggregate",title:"Concrete and Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:Jd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:om},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:tm},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:cm},{id:"paving",title:"Paving and Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:im}];var pm=$(He());var Cx=new Set(["bag","box","roll","pack"]),qx=new Set(["each","bag","box","roll","pack","tub"]);function gl(e,t){let r=(t?.conversion?.request_uoms_supported??"").split(",").map(o=>o.trim().toLowerCase()).includes("sales_unit");if(e==="each"){let o=(t?.uoi_count??1)===1&&(t?.conversion?.sales_unit_size??1)===1;return r&&o?"sales_unit":e}if(!Cx.has(e))return e;if(r)return"sales_unit";let i=t?.uoi;return i!=null&&qx.has(i.toLowerCase())&&(t?.uoi_count??1)===1?i:e}var i0=new Map;function Ex(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function Ti(e,t,a=12,r){let i=`${Ot().client??""}||${e}||${t??""}||${a}||${r??""}`,n=i0.get(i);if(n)return n;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Ta(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await Ga(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let p=Array.isArray(c?.items)?c.items.map(Ex):[];return i0.set(i,p),p}async function n0(e,t,a){return await Promise.all(e.map(async i=>{try{let n=a?dl(a,i):null,[o,l]=await Promise.all([n?Ti(n,void 0,void 0,t).then(p=>p.find(m=>m.product_id===n.split(" ")[0]),()=>{}):void 0,Ti(i.query,i.category,void 0,t)]),c=o?[o,...l.filter(p=>p.product_id!==o.product_id)]:l;return{requirement:i,candidates:c}}catch{return{requirement:i,candidates:[]}}}))}async function o0(){let e=await fetch(Ta("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Ga(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var Wt=$(F()),Mx=1500;function l0(e){let{addManyToCart:t,clearCart:a,openBasket:r}=Dn(),[i,n]=(0,pm.useState)(!1),[o,l]=(0,pm.useState)(null);return{adding:i,basketError:o,addToBasket:async(p,m)=>{let g=Date.now();n(!0),l(null);try{let d=await Promise.all(p.filter(v=>v.qty>0).map(async v=>{let E=(await Ti(v.search)).find(O=>O.product_id===v.productId);if(!E)throw new Error("A selected product is no longer available in this catalogue.");return On(E,{lineId:`${e}:${v.key}`,description:E.description,unit:gl(v.unit??"each",E),qty:v.qty,calculatorWasteIncluded:m})})),b=Mx-(Date.now()-g);b>0&&await new Promise(v=>window.setTimeout(v,b)),a(),t(d),r()}catch(d){l(d instanceof Error?d.message:"Could not add the products to your basket.")}finally{n(!1)}}}}function s0({toolTitle:e}){return(0,Wt.jsx)(Wt.Fragment,{children:(0,Wt.jsxs)("div",{className:"truss-estimator",children:[(0,Wt.jsxs)("div",{className:"quick-order-hero",children:[(0,Wt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Wt.jsx)("h1",{children:"Your Materials"}),(0,Wt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Wt.jsx)("div",{className:"truss-estimator__card",children:(0,Wt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Wt.jsx)(wi,{}),(0,Wt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Nc=$(He());var Le=$(He());var C=$(F()),Tx=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],dm={wasteFactorEnabled:!0},zx=3e3,c0=null;function Sc(e,t){let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Rx(e){return e&&e.length>0?e.join(" x "):"-"}function mm({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:i}){let n=vv(),o=`${e}~${t.map(N=>`${N.key}|${N.query}|${N.category??""}|${N.qty}`).join("~")}`,l=o!==c0,[c,p]=(0,Le.useState)(null),[m,g]=(0,Le.useState)([]),[d,b]=(0,Le.useState)(l),[v,E]=(0,Le.useState)(null),[O,f]=(0,Le.useState)("tile"),[u,h]=(0,Le.useState)(null),[w,k]=(0,Le.useState)(""),[z,A]=(0,Le.useState)(null),[U,R]=(0,Le.useState)(""),[H,oe]=(0,Le.useState)([]),[Te,je]=(0,Le.useState)(new Set),[Ve,Ne]=(0,Le.useState)(null),[we,le]=(0,Le.useState)(""),[Fe,Ee]=(0,Le.useState)([]),Nt=(0,Le.useRef)(null),Z=(0,Le.useRef)(!1),ge=N=>`${e}:${N}`,Re=N=>On(N.chosen,{lineId:ge(N.requirement.key),description:N.requirement.label,unit:gl(N.requirement.unit,N.chosen),qty:N.requirement.qty}),bt=(0,Le.useMemo)(()=>t.map(N=>`${N.key}|${N.query}|${N.category??""}`).join("~"),[t]);(0,Le.useEffect)(()=>{let N=!1;return o0().then(L=>{N||p(L.itemCount>0)}).catch(()=>{N||p(!1)}),()=>{N=!0}},[]),(0,Le.useEffect)(()=>{if(!a||!c)return;let N=!1,L;l&&b(!0),E(null);let X=Date.now();return(async()=>{let ue=null;try{ue=(await n0(t,void 0,e)).map(({requirement:vt,candidates:mt})=>({requirement:vt,candidates:mt,chosen:mt[0]??null}))}catch(ke){N||E(ke instanceof Error?ke.message:"Could not load products")}if(!N){if(c0=o,l){let ke=zx-(Date.now()-X);ke>0&&await new Promise(vt=>{L=window.setTimeout(vt,ke)})}N||(ue&&(g(ue),!Z.current&&n&&(Z.current=!0,n.addManyToCart(ue.filter(ke=>ke.chosen).map(Re)))),b(!1))}})(),()=>{N=!0,window.clearTimeout(L)}},[a,c,bt]),(0,Le.useEffect)(()=>{if(!z)return;let N=U.trim();if(!N){oe([]);return}let L=!1,X=window.setTimeout(()=>{Ti(N).then(ue=>{L||oe(ue)}).catch(()=>{L||oe([])})},250);return()=>{L=!0,window.clearTimeout(X)}},[z,U]),(0,Le.useEffect)(()=>{if(!Ve)return;let N=we.trim();if(!N){Ee([]);return}let L=!1,X=window.setTimeout(()=>{Ti(N).then(ue=>{L||Ee(ue)}).catch(()=>{L||Ee([])})},250);return()=>{L=!0,window.clearTimeout(X)}},[Ve,we]);let jt=(0,Le.useMemo)(()=>{let N=w.trim().toLowerCase(),L=N?m.filter(X=>X.requirement.label.toLowerCase().includes(N)||(X.chosen?.description??"").toLowerCase().includes(N)||(X.chosen?.product_id??"").toLowerCase().includes(N)):m;return u?[...L].sort((X,ue)=>{let ke=X.requirement.label.localeCompare(ue.requirement.label);return u==="asc"?ke:-ke}):L},[m,w,u]),Ct=jt.filter(N=>N.chosen),wt=jt.filter(N=>!N.chosen),be=m.filter(N=>N.chosen),de=be.filter(N=>N.chosen?.price==null).length,tt=be.reduce((N,L)=>N+(Ft(Re(L),dm).lineTotal??0),0);if((0,Le.useEffect)(()=>{i?.(tt)},[tt,i]),!a||c===!1)return null;let T=n?be.filter(N=>n.cart[ge(N.requirement.key)]).length:0,G=Ve?m.find(N=>N.requirement.key===Ve)??null:null,ce=we.trim()?Fe:G?.candidates??[],ve=N=>{let L=z===N.requirement.key;A(L?null:N.requirement.key),R(L?"":N.requirement.query)},Ye=(N,L)=>{let X=m.find(ue=>ue.requirement.key===N);g(ue=>ue.map(ke=>ke.requirement.key===N?{...ke,chosen:L}:ke)),n&&X&&n.cart[ge(N)]&&n.addToCart(Re({...X,chosen:L})),A(null),R("")},qe=N=>{g(L=>L.map(X=>X.requirement.key===N?{...X,chosen:null}:X)),n?.cart[ge(N)]&&n.removeFromCart(ge(N))},x=N=>{Ne(N.requirement.key),le(""),Ee([])},_=()=>{Ne(null),le(""),Ee([])},q=N=>{if(!n)return;let L=ge(N.requirement.key);n.cart[L]?n.removeFromCart(L):n.addToCart(Re(N))},D=N=>{je(L=>{let X=new Set(L);return X.has(N)?X.delete(N):X.add(N),X})},V=N=>{let L=H.length>0?H:N.candidates;return(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",value:U,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:X=>R(X.target.value),"aria-label":`Search a product for ${N.requirement.label}`}),(0,C.jsxs)("div",{className:"estimator-products__options",children:[L.map(X=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${X.product_id===N.chosen?.product_id?" is-selected":""}`,onClick:()=>Ye(N.requirement.key,X),children:[(0,C.jsx)("span",{children:X.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${nt(X.price)}`]})]},X.product_id)),L.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,C.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!d&&(0,C.jsxs)("div",{className:"estimator-products__head",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Matched Products"}),(0,C.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!G&&(0,C.jsx)("div",{className:"results-summary estimator-products__toolbar",children:(0,C.jsxs)("div",{className:"estimator-products__controls",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:w,onChange:N=>k(N.target.value),"aria-label":"Search matched products"}),(0,C.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${O==="tile"?" is-active":""}`,"aria-pressed":O==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>f("tile"),children:(0,C.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,C.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${O==="list"?" is-active":""}`,"aria-pressed":O==="list","aria-label":"List view",title:"List view",onClick:()=>f("list"),children:(0,C.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,C.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,C.jsxs)("details",{ref:Nt,style:{position:"relative"},children:[(0,C.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,C.jsx)("div",{className:"sort-menu-panel",children:Tx.map(N=>{let L=u===N.dir;return(0,C.jsxs)("button",{type:"button",className:`sort-menu-item${L?" is-active":""}`,onClick:()=>{h(L?null:N.dir),Nt.current?.removeAttribute("open")},children:[(0,C.jsx)("span",{className:"sort-menu-item__check",children:L?"\u2713":""}),N.label]},N.dir)})})]})]})})]}),G&&(0,C.jsxs)("div",{className:"results-review-page",children:[(0,C.jsxs)("div",{className:"results-review-page__top",children:[(0,C.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:_,children:[(0,C.jsx)(Vr,{}),"Back to results"]}),(0,C.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,C.jsx)("div",{className:"results-review-searchbar",children:(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:we,onChange:N=>le(N.target.value),"aria-label":`Search a product for ${G.requirement.label}`})}),G.chosen&&(0,C.jsx)("div",{className:"results-candidate-actions",children:(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qe(G.requirement.key),children:"Clear selected product"})})]})]}),(0,C.jsxs)("div",{className:"results-review-page__hero",children:[(0,C.jsx)("div",{className:"results-review-page__image-wrap",children:(0,C.jsx)(za,{className:"fill-img results-review-page__image",description:G.chosen?.description||G.requirement.label,photoUrl:G.chosen?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-review-page__summary",children:[(0,C.jsx)("h2",{children:G.requirement.label}),(0,C.jsxs)("p",{className:"results-review-page__meta",children:[vi(G.requirement.qty)," ",xa(G.requirement.unit,G.requirement.qty)]}),G.chosen?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"results-review-page__product",children:G.chosen.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[G.chosen.product_id,G.chosen.price!=null?` \xB7 ${Sc(G.chosen.price,G.chosen.price_basis)}`:""]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,C.jsx)("div",{className:"results-review-page__actions",children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${n?.cart[ge(G.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(G),disabled:!G.chosen||!n,children:n?.cart[ge(G.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),ce.length===0?(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,C.jsxs)("table",{className:"score-breakdown-table",children:[(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("th",{children:"Product"}),(0,C.jsx)("th",{children:"Dims (mm)"}),(0,C.jsx)("th",{children:"Price"}),(0,C.jsx)("th",{"aria-label":"Actions"})]})}),(0,C.jsx)("tbody",{children:ce.map(N=>{let L=N.product_id===G.chosen?.product_id;return(0,C.jsxs)("tr",{className:L?"score-breakdown-row--best":"",children:[(0,C.jsxs)("td",{children:[(0,C.jsx)("div",{children:N.description}),(0,C.jsx)("div",{className:"results-row-meta",children:N.product_id})]}),(0,C.jsx)("td",{children:(0,C.jsx)("span",{className:"unit-badge",children:Rx(N.measurements_mm)})}),(0,C.jsx)("td",{children:N.price!=null?Sc(N.price,N.price_basis):"-"}),(0,C.jsx)("td",{children:(0,C.jsxs)("label",{className:"switch-toggle",title:L?"Currently selected":"Use this candidate",children:[(0,C.jsx)("input",{type:"checkbox",checked:L,onChange:()=>{L?qe(G.requirement.key):Ye(G.requirement.key,N)},"aria-label":L?`${N.description} selected`:`Use ${N.description}`}),(0,C.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},N.product_id)})})]})]}),!G&&d&&(0,C.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,C.jsx)(wi,{}),(0,C.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!G&&v&&(0,C.jsx)("p",{className:"results-empty-hint estimator-products__error",children:v}),!G&&!d&&!v&&jt.length===0&&m.length>0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!G&&!d&&!v&&O==="tile"&&Ct.length>0&&(0,C.jsx)("div",{className:"results-tile-grid",children:Ct.map(N=>{let{requirement:L,chosen:X}=N,ue=X?Ft(Re(N),dm):null,ke=n?!!n.cart[ge(L.key)]:!1;return(0,C.jsxs)("article",{className:"results-tile-card",children:[(0,C.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>x(N),"aria-label":`Review match for ${L.label}`,children:[(0,C.jsx)("div",{className:"results-tile-card__media",children:(0,C.jsx)(za,{className:"fill-img results-tile-card__image",description:X?.description||L.label,photoUrl:X?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-tile-card__body",children:[X?(0,C.jsxs)("div",{className:"results-tile-card__heading",children:[(0,C.jsx)("div",{className:"results-tile-card__title",children:X.description}),(0,C.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,C.jsx)("span",{children:X.product_id}),X.price!=null?(0,C.jsx)("span",{children:Sc(X.price,X.price_basis)}):null]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,C.jsxs)("div",{className:"results-tile-card__match",children:[(0,C.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,C.jsx)("div",{className:"results-tile-card__match-name",children:L.label}),(0,C.jsxs)("div",{className:"results-tile-card__meta",children:[vi(L.qty)," ",xa(L.unit,L.qty)]}),ue?.requiredSellUnits!=null?(0,C.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",ue.requiredSellUnits," ",ue.sellUnit,ue.lineTotal!=null?` \xB7 ${nt(ue.lineTotal)}`:""]}):X?(0,C.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,C.jsxs)("div",{className:"results-tile-card__actions",children:[(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>x(N),children:"Review"}),(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(N),disabled:!X||!n,children:ke?"\u2713 Added":"+ Add"})]})]},L.key)})}),!G&&!d&&!v&&O==="list"&&Ct.length>0&&(0,C.jsx)("div",{className:"bom-table-wrap",children:(0,C.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,C.jsxs)("colgroup",{children:[(0,C.jsx)("col",{style:{width:"56px"}}),(0,C.jsx)("col",{className:"col-item"}),(0,C.jsx)("col",{style:{width:"90px"}}),(0,C.jsx)("col",{style:{width:"80px"}}),(0,C.jsx)("col",{style:{width:"220px"}}),(0,C.jsx)("col",{style:{width:"110px"}})]}),(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{className:"bom-col-header",children:[(0,C.jsx)("th",{"aria-label":"Expand"}),(0,C.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,C.jsx)("tbody",{children:Ct.map(N=>{let{requirement:L,chosen:X}=N,ue=X?Ft(Re(N),dm):null,ke=n?!!n.cart[ge(L.key)]:!1,vt=Te.has(L.key);return(0,C.jsxs)(Le.Fragment,{children:[(0,C.jsxs)("tr",{className:"bom-row",children:[(0,C.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,C.jsx)("button",{type:"button",className:"link-btn",onClick:()=>D(L.key),"aria-expanded":vt,"aria-label":vt?"Collapse product options":"Expand product options",children:vt?"\u25BE":"\u25B8"})}),(0,C.jsxs)("td",{style:{paddingLeft:0},children:[(0,C.jsx)("div",{className:"bom-component-name",children:L.label}),ue?.requiredSellUnits!=null&&(0,C.jsxs)("div",{className:"results-row-meta",children:["Order ",ue.requiredSellUnits," ",ue.sellUnit,ue.lineTotal!=null?` \xB7 ${nt(ue.lineTotal)}`:""]})]}),(0,C.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:vi(L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:xa(L.unit,L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:X?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"bom-component-name",children:X.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${Sc(X.price,X.price_basis)}`]})]}):(0,C.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,C.jsx)("td",{style:{textAlign:"center"},children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(N),disabled:!X||!n,children:ke?"\u2713 Added":"+ Add"})})]}),vt&&(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:z===L.key?V(N):(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsxs)("div",{className:"estimator-products__options",children:[N.candidates.map(mt=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${mt.product_id===X?.product_id?" is-selected":""}`,onClick:()=>Ye(L.key,mt),children:[(0,C.jsx)("span",{children:mt.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[mt.product_id,mt.price!=null&&` \xB7 ${nt(mt.price)}`]})]},mt.product_id)),N.candidates.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ve(N),children:"Search the catalogue"})]})})})]},L.key)})})]})}),!G&&!d&&!v&&wt.length>0&&(0,C.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Require Matching"}),(0,C.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,C.jsx)("div",{className:"results-unmatched-list",children:wt.map(N=>(0,C.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>x(N),children:[(0,C.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,C.jsx)("span",{className:"results-unmatched-card__title",children:N.requirement.label}),(0,C.jsxs)("span",{className:"results-row-meta",children:[vi(N.requirement.qty)," ",xa(N.requirement.unit,N.requirement.qty)]})]}),(0,C.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},N.requirement.key))})]}),!d&&!v&&m.length>0&&(0,C.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,C.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!G&&!d&&!v&&(r||T>0)&&(0,C.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,C.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),T>0&&n&&(0,C.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:n.openBasket,children:[(0,C.jsxs)("span",{children:["View Basket (",T,")"]}),(0,C.jsx)("span",{className:"arrow",children:(0,C.jsx)(Qt,{})})]})]})]})}var Gt=$(F());function fm({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[i,n]=(0,Nc.useState)(0),o=(0,Nc.useCallback)(l=>n(l),[]);return(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)("div",{className:"truss-estimator",children:[(0,Gt.jsxs)("div",{className:"quick-order-hero",children:[(0,Gt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Gt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Gt.jsx)("h1",{children:"Your Materials"}),i>0&&(0,Gt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Gt.jsx)("strong",{children:nt(i)})," Est. total"]})]}),(0,Gt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Gt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Gt.jsx)(mm,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var ze=$(F());function Cc(e){let[t,a]=(0,$a.useState)(!1);return(0,ze.jsx)(lc,{onOpenBasket:()=>a(!0),children:(0,ze.jsx)(Ax,{...e,showBasket:t,onShowBasket:a})})}function Ax({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:i}){let[n,o]=(0,$a.useState)(null),[l,c]=(0,$a.useState)(null),p=um.find(U=>U.id===n),{cart:m,updateCartQty:g,updateCartSellUnits:d,updateCartConversions:b,removeFromCart:v,clearCart:E}=Dn(),{adding:O,basketError:f,addToBasket:u}=l0(p?.title??"calculator"),h=(0,$a.useRef)(null),w=Js("estimating-tools",h);(0,$a.useEffect)(()=>{w("viewed")},[w]);let k=r?"basket":O?"adding":l?"review":n??"list",z=(0,$a.useRef)(k);(0,$a.useEffect)(()=>{z.current!==k&&(z.current=k,window.scrollTo(0,0))},[k]);let A=U=>{if(!p)return;w("estimate_completed",{calculator:p.id,lines:U.length});let R=Bv(p.id,U);R?u(R,U[0]?.calculatorWasteIncluded??!1):c(U)};return(0,ze.jsx)(tl.Provider,{value:w,children:(0,ze.jsx)("div",{ref:h,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${a?"":" estimating-tools--customer"}`,style:Ot().theme,children:(0,ze.jsx)("main",{className:"main-content",children:r?(0,ze.jsx)(ul,{cart:m,onUpdateQty:g,onUpdateSellUnits:d,onResolveConversions:b,onRemove:v,onBack:()=>i(!1),onStartNewQuote:()=>{E(),o(null),c(null),i(!1)},internal:a}):O&&p?(0,ze.jsx)(s0,{toolTitle:p.title}):p?(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)("div",{hidden:l!==null,children:(0,ze.jsx)(p.Component,{onBack:()=>o(null),onReview:A})}),f&&(0,ze.jsx)("p",{className:"results-empty-hint estimator-products__error",children:f}),l!==null&&(0,ze.jsx)(fm,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,ze.jsx)(ze.Fragment,{children:(0,ze.jsxs)("div",{className:"quick-order-card",children:[(0,ze.jsxs)("div",{className:"quick-order-hero",children:[(0,ze.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,ze.jsx)("h1",{children:"Estimating Tools"}),(0,ze.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,ze.jsxs)("div",{className:"quick-order-alt",children:[(0,ze.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,ze.jsx)("div",{className:"estimator-tools-grid",children:um.map(U=>(0,ze.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{w("calculator_selected",{calculator:U.id}),o(U.id),c(null)},children:[(0,ze.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,ze.jsx)("img",{className:"fill-img estimator-tool-card__image",src:It(U.imageUrl),alt:""})}),(0,ze.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,ze.jsx)("span",{className:"estimator-tool-card__title",children:U.title}),(0,ze.jsx)("span",{className:"estimator-tool-card__desc",children:U.desc})]})]},U.id))})]})]})})})})})}var qc=$(F());function hm({config:e,children:t}){return vw(e),(0,qc.jsx)(qc.Fragment,{children:t})}var gm=$(F()),Ux="https://api.metronlabs.ai",Dx=["client","api-key","api-url","theme","hide-header","analytics"],Ox=["all","events-only","none"];function p0(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.70",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let i=document.createElement("div"),n=document.createElement("style");n.textContent=`:host { display: block; }
6975
6975
  :host > div { all: initial; display: block; }
6976
- ${vv}`,this.shadowRoot.replaceChildren(n,i),this.root=(0,u0.createRoot)(i)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let i=this.getAttribute("client")??void 0,n=this.getAttribute("api-key")??void 0;(!i||!n)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||Dx,client:i,apiKey:n,theme:Hx(e,this.getAttribute("theme")),analytics:Lx(this.getAttribute("analytics"))};this.root.render((0,gm.jsx)(hm,{config:o,children:(0,gm.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=Ox,a))}function Lx(e){return Bx.find(t=>t===e)??"all"}function Hx(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}p0("metron-labs-quick-quote",pc);p0("metron-labs-estimating-tools",qc);
6976
+ ${ww}`,this.shadowRoot.replaceChildren(n,i),this.root=(0,u0.createRoot)(i)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let i=this.getAttribute("client")??void 0,n=this.getAttribute("api-key")??void 0;(!i||!n)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||Ux,client:i,apiKey:n,theme:Lx(e,this.getAttribute("theme")),analytics:Bx(this.getAttribute("analytics"))};this.root.render((0,gm.jsx)(hm,{config:o,children:(0,gm.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=Dx,a))}function Bx(e){return Ox.find(t=>t===e)??"all"}function Lx(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}p0("metron-labs-quick-quote",uc);p0("metron-labs-estimating-tools",Cc);
6977
6977
  /*! Bundled license information:
6978
6978
 
6979
6979
  scheduler/cjs/scheduler.production.js: