@metron-labs/quote-react 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/embed/quote.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{a as Ra,b as Y}from"./chunk-SQE76S5B.js";var cm=Ra(at=>{"use strict";function xc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,n=e[r];if(0<ul(n,t))e[r]=t,e[a]=n,a=r;else break e}}function Ua(e){return e.length===0?null:e[0]}function dl(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,n=e.length,i=n>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>ul(l,a))c<n&&0>ul(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<n&&0>ul(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function ul(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}at.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(em=performance,at.unstable_now=function(){return em.now()}):(wc=Date,tm=wc.now(),at.unstable_now=function(){return wc.now()-tm});var em,wc,tm,Xa=[],vr=[],Hw=1,ua=null,At=3,kc=!1,Xn=!1,$n=!1,Nc=!1,im=typeof setTimeout=="function"?setTimeout:null,nm=typeof clearTimeout=="function"?clearTimeout:null,am=typeof setImmediate<"u"?setImmediate:null;function pl(e){for(var t=Ua(vr);t!==null;){if(t.callback===null)dl(vr);else if(t.startTime<=e)dl(vr),t.sortIndex=t.expirationTime,xc(Xa,t);else break;t=Ua(vr)}}function Sc(e){if($n=!1,pl(e),!Xn)if(Ua(Xa)!==null)Xn=!0,Ri||(Ri=!0,Ai());else{var t=Ua(vr);t!==null&&Cc(Sc,t.startTime-e)}}var Ri=!1,Zn=-1,om=5,lm=-1;function sm(){return Nc?!0:!(at.unstable_now()-lm<om)}function yc(){if(Nc=!1,Ri){var e=at.unstable_now();lm=e;var t=!0;try{e:{Xn=!1,$n&&($n=!1,nm(Zn),Zn=-1),kc=!0;var a=At;try{t:{for(pl(e),ua=Ua(Xa);ua!==null&&!(ua.expirationTime>e&&sm());){var r=ua.callback;if(typeof r=="function"){ua.callback=null,At=ua.priorityLevel;var n=r(ua.expirationTime<=e);if(e=at.unstable_now(),typeof n=="function"){ua.callback=n,pl(e),t=!0;break t}ua===Ua(Xa)&&dl(Xa),pl(e)}else dl(Xa);ua=Ua(Xa)}if(ua!==null)t=!0;else{var i=Ua(vr);i!==null&&Cc(Sc,i.startTime-e),t=!1}}break e}finally{ua=null,At=a,kc=!1}t=void 0}}finally{t?Ai():Ri=!1}}}var Ai;typeof am=="function"?Ai=function(){am(yc)}:typeof MessageChannel<"u"?(_c=new MessageChannel,rm=_c.port2,_c.port1.onmessage=yc,Ai=function(){rm.postMessage(null)}):Ai=function(){im(yc,0)};var _c,rm;function Cc(e,t){Zn=im(function(){e(at.unstable_now())},t)}at.unstable_IdlePriority=5;at.unstable_ImmediatePriority=1;at.unstable_LowPriority=4;at.unstable_NormalPriority=3;at.unstable_Profiling=null;at.unstable_UserBlockingPriority=2;at.unstable_cancelCallback=function(e){e.callback=null};at.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"):om=0<e?Math.floor(1e3/e):5};at.unstable_getCurrentPriorityLevel=function(){return At};at.unstable_next=function(e){switch(At){case 1:case 2:case 3:var t=3;break;default:t=At}var a=At;At=t;try{return e()}finally{At=a}};at.unstable_requestPaint=function(){Nc=!0};at.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=At;At=e;try{return t()}finally{At=a}};at.unstable_scheduleCallback=function(e,t,a){var r=at.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 n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,e={id:Hw++,callback:t,priorityLevel:e,startTime:a,expirationTime:n,sortIndex:-1},a>r?(e.sortIndex=a,xc(vr,e),Ua(Xa)===null&&e===Ua(vr)&&($n?(nm(Zn),Zn=-1):$n=!0,Cc(Sc,a-r))):(e.sortIndex=n,xc(Xa,e),Xn||kc||(Xn=!0,Ri||(Ri=!0,Ai()))),e};at.unstable_shouldYield=sm;at.unstable_wrapCallback=function(e){var t=At;return function(){var a=At;At=t;try{return e.apply(this,arguments)}finally{At=a}}}});var pm=Ra((rx,um)=>{"use strict";um.exports=cm()});var xm=Ra(ge=>{"use strict";var Mc=Symbol.for("react.transitional.element"),jw=Symbol.for("react.portal"),Qw=Symbol.for("react.fragment"),Gw=Symbol.for("react.strict_mode"),Yw=Symbol.for("react.profiler"),Vw=Symbol.for("react.consumer"),Xw=Symbol.for("react.context"),$w=Symbol.for("react.forward_ref"),Zw=Symbol.for("react.suspense"),Kw=Symbol.for("react.memo"),hm=Symbol.for("react.lazy"),Jw=Symbol.for("react.activity"),dm=Symbol.iterator;function Pw(e){return e===null||typeof e!="object"?null:(e=dm&&e[dm]||e["@@iterator"],typeof e=="function"?e:null)}var bm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vm=Object.assign,wm={};function Di(e,t,a){this.props=e,this.context=t,this.refs=wm,this.updater=a||bm}Di.prototype.isReactComponent={};Di.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")};Di.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ym(){}ym.prototype=Di.prototype;function Tc(e,t,a){this.props=e,this.context=t,this.refs=wm,this.updater=a||bm}var zc=Tc.prototype=new ym;zc.constructor=Tc;vm(zc,Di.prototype);zc.isPureReactComponent=!0;var mm=Array.isArray;function Ec(){}var Pe={H:null,A:null,T:null,S:null},_m=Object.prototype.hasOwnProperty;function Ac(e,t,a){var r=a.ref;return{$$typeof:Mc,type:e,key:t,ref:r!==void 0?r:null,props:a}}function Fw(e,t){return Ac(e.type,t,e.props)}function Rc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mc}function Iw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var fm=/\/+/g;function qc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Iw(""+e.key):t.toString(36)}function Ww(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ec,Ec):(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 Ui(e,t,a,r,n){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Mc:case jw:o=!0;break;case hm:return o=e._init,Ui(o(e._payload),t,a,r,n)}}if(o)return n=n(e),o=r===""?"."+qc(e,0):r,mm(n)?(a="",o!=null&&(a=o.replace(fm,"$&/")+"/"),Ui(n,t,a,"",function(p){return p})):n!=null&&(Rc(n)&&(n=Fw(n,a+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(fm,"$&/")+"/")+o)),t.push(n)),1;o=0;var l=r===""?".":r+":";if(mm(e))for(var c=0;c<e.length;c++)r=e[c],i=l+qc(r,c),o+=Ui(r,t,a,i,n);else if(c=Pw(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,i=l+qc(r,c++),o+=Ui(r,t,a,i,n);else if(i==="object"){if(typeof e.then=="function")return Ui(Ww(e),t,a,r,n);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 ml(e,t,a){if(e==null)return e;var r=[],n=0;return Ui(e,r,"","",function(i){return t.call(a,i,n++)}),r}function e0(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 gm=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)},t0={map:ml,forEach:function(e,t,a){ml(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return ml(e,function(){t++}),t},toArray:function(e){return ml(e,function(t){return t})||[]},only:function(e){if(!Rc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Activity=Jw;ge.Children=t0;ge.Component=Di;ge.Fragment=Qw;ge.Profiler=Yw;ge.PureComponent=Tc;ge.StrictMode=Gw;ge.Suspense=Zw;ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pe;ge.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Pe.H.useMemoCache(e)}};ge.cache=function(e){return function(){return e.apply(null,arguments)}};ge.cacheSignal=function(){return null};ge.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),n=e.key;if(t!=null)for(i in t.key!==void 0&&(n=""+t.key),t)!_m.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];r.children=o}return Ac(e.type,n,r)};ge.createContext=function(e){return e={$$typeof:Xw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Vw,_context:e},e};ge.createElement=function(e,t,a){var r,n={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)_m.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=t[r]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];n.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)n[r]===void 0&&(n[r]=o[r]);return Ac(e,i,n)};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:$w,render:e}};ge.isValidElement=Rc;ge.lazy=function(e){return{$$typeof:hm,_payload:{_status:-1,_result:e},_init:e0}};ge.memo=function(e,t){return{$$typeof:Kw,type:e,compare:t===void 0?null:t}};ge.startTransition=function(e){var t=Pe.T,a={};Pe.T=a;try{var r=e(),n=Pe.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Ec,gm)}catch(i){gm(i)}finally{t!==null&&a.types!==null&&(t.types=a.types),Pe.T=t}};ge.unstable_useCacheRefresh=function(){return Pe.H.useCacheRefresh()};ge.use=function(e){return Pe.H.use(e)};ge.useActionState=function(e,t,a){return Pe.H.useActionState(e,t,a)};ge.useCallback=function(e,t){return Pe.H.useCallback(e,t)};ge.useContext=function(e){return Pe.H.useContext(e)};ge.useDebugValue=function(){};ge.useDeferredValue=function(e,t){return Pe.H.useDeferredValue(e,t)};ge.useEffect=function(e,t){return Pe.H.useEffect(e,t)};ge.useEffectEvent=function(e){return Pe.H.useEffectEvent(e)};ge.useId=function(){return Pe.H.useId()};ge.useImperativeHandle=function(e,t,a){return Pe.H.useImperativeHandle(e,t,a)};ge.useInsertionEffect=function(e,t){return Pe.H.useInsertionEffect(e,t)};ge.useLayoutEffect=function(e,t){return Pe.H.useLayoutEffect(e,t)};ge.useMemo=function(e,t){return Pe.H.useMemo(e,t)};ge.useOptimistic=function(e,t){return Pe.H.useOptimistic(e,t)};ge.useReducer=function(e,t,a){return Pe.H.useReducer(e,t,a)};ge.useRef=function(e){return Pe.H.useRef(e)};ge.useState=function(e){return Pe.H.useState(e)};ge.useSyncExternalStore=function(e,t,a){return Pe.H.useSyncExternalStore(e,t,a)};ge.useTransition=function(){return Pe.H.useTransition()};ge.version="19.2.3"});var Xe=Ra((nx,km)=>{"use strict";km.exports=xm()});var Sm=Ra(Ut=>{"use strict";var a0=Xe();function Nm(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 wr(){}var Rt={d:{f:wr,r:function(){throw Error(Nm(522))},D:wr,C:wr,L:wr,m:wr,X:wr,S:wr,M:wr},p:0,findDOMNode:null},r0=Symbol.for("react.portal");function i0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var Kn=a0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function fl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Rt;Ut.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(Nm(299));return i0(e,t,null,a)};Ut.flushSync=function(e){var t=Kn.T,a=Rt.p;try{if(Kn.T=null,Rt.p=2,e)return e()}finally{Kn.T=t,Rt.p=a,Rt.d.f()}};Ut.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Rt.d.C(e,t))};Ut.prefetchDNS=function(e){typeof e=="string"&&Rt.d.D(e)};Ut.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=fl(a,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Rt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:i}):a==="script"&&Rt.d.X(e,{crossOrigin:r,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Ut.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=fl(t.as,t.crossOrigin);Rt.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&&Rt.d.M(e)};Ut.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=fl(a,t.crossOrigin);Rt.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})}};Ut.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=fl(t.as,t.crossOrigin);Rt.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 Rt.d.m(e)};Ut.requestFormReset=function(e){Rt.d.r(e)};Ut.unstable_batchedUpdates=function(e,t){return e(t)};Ut.useFormState=function(e,t,a){return Kn.H.useFormState(e,t,a)};Ut.useFormStatus=function(){return Kn.H.useHostTransitionStatus()};Ut.version="19.2.3"});var Em=Ra((lx,qm)=>{"use strict";function Cm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Cm)}catch(e){console.error(e)}}Cm(),qm.exports=Sm()});var Qb=Ra(Hs=>{"use strict";var vt=pm(),tg=Xe(),n0=Em();function B(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 ag(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Do(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 rg(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 ig(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 Mm(e){if(Do(e)!==e)throw Error(B(188))}function o0(e){var t=e.alternate;if(!t){if(t=Do(e),t===null)throw Error(B(188));return t!==e?null:e}for(var a=e,r=t;;){var n=a.return;if(n===null)break;var i=n.alternate;if(i===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===a)return Mm(n),e;if(i===r)return Mm(n),t;i=i.sibling}throw Error(B(188))}if(a.return!==r.return)a=n,r=i;else{for(var o=!1,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){for(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)throw Error(B(189))}}if(a.alternate!==r)throw Error(B(190))}if(a.tag!==3)throw Error(B(188));return a.stateNode.current===a?e:t}function ng(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=ng(e),t!==null)return t;e=e.sibling}return null}var We=Object.assign,l0=Symbol.for("react.element"),gl=Symbol.for("react.transitional.element"),ao=Symbol.for("react.portal"),Qi=Symbol.for("react.fragment"),og=Symbol.for("react.strict_mode"),mu=Symbol.for("react.profiler"),lg=Symbol.for("react.consumer"),Wa=Symbol.for("react.context"),sp=Symbol.for("react.forward_ref"),fu=Symbol.for("react.suspense"),gu=Symbol.for("react.suspense_list"),cp=Symbol.for("react.memo"),yr=Symbol.for("react.lazy"),hu=Symbol.for("react.activity"),s0=Symbol.for("react.memo_cache_sentinel"),Tm=Symbol.iterator;function Jn(e){return e===null||typeof e!="object"?null:(e=Tm&&e[Tm]||e["@@iterator"],typeof e=="function"?e:null)}var c0=Symbol.for("react.client.reference");function bu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===c0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qi:return"Fragment";case mu:return"Profiler";case og:return"StrictMode";case fu:return"Suspense";case gu:return"SuspenseList";case hu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ao:return"Portal";case Wa:return e.displayName||"Context";case lg: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 cp:return t=e.displayName||null,t!==null?t:bu(e.type)||"Memo";case yr:t=e._payload,e=e._init;try{return bu(e(t))}catch{}}return null}var ro=Array.isArray,de=tg.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,De=n0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ii={pending:!1,data:null,method:null,action:null},vu=[],Gi=-1;function Ha(e){return{current:e}}function xt(e){0>Gi||(e.current=vu[Gi],vu[Gi]=null,Gi--)}function Ke(e,t){Gi++,vu[Gi]=e.current,e.current=t}var La=Ha(null),_o=Ha(null),zr=Ha(null),Kl=Ha(null);function Jl(e,t){switch(Ke(zr,t),Ke(_o,e),Ke(La,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lf(t),e=qb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}xt(La),Ke(La,e)}function ln(){xt(La),xt(_o),xt(zr)}function wu(e){e.memoizedState!==null&&Ke(Kl,e);var t=La.current,a=qb(t,e.type);t!==a&&(Ke(_o,e),Ke(La,a))}function Pl(e){_o.current===e&&(xt(La),xt(_o)),Kl.current===e&&(xt(Kl),Ao._currentValue=ii)}var Uc,zm;function ei(e){if(Uc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Uc=t&&t[1]||"",zm=-1<a.stack.indexOf(`
|
|
1
|
+
import{a as Ra,b as Y}from"./chunk-SQE76S5B.js";var cm=Ra(at=>{"use strict";function xc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,n=e[r];if(0<ul(n,t))e[r]=t,e[a]=n,a=r;else break e}}function Ua(e){return e.length===0?null:e[0]}function dl(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,n=e.length,i=n>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>ul(l,a))c<n&&0>ul(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<n&&0>ul(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function ul(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}at.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(em=performance,at.unstable_now=function(){return em.now()}):(wc=Date,tm=wc.now(),at.unstable_now=function(){return wc.now()-tm});var em,wc,tm,Xa=[],vr=[],Hw=1,pa=null,At=3,kc=!1,Xn=!1,$n=!1,Nc=!1,im=typeof setTimeout=="function"?setTimeout:null,nm=typeof clearTimeout=="function"?clearTimeout:null,am=typeof setImmediate<"u"?setImmediate:null;function pl(e){for(var t=Ua(vr);t!==null;){if(t.callback===null)dl(vr);else if(t.startTime<=e)dl(vr),t.sortIndex=t.expirationTime,xc(Xa,t);else break;t=Ua(vr)}}function Sc(e){if($n=!1,pl(e),!Xn)if(Ua(Xa)!==null)Xn=!0,Ri||(Ri=!0,Ai());else{var t=Ua(vr);t!==null&&Cc(Sc,t.startTime-e)}}var Ri=!1,Zn=-1,om=5,lm=-1;function sm(){return Nc?!0:!(at.unstable_now()-lm<om)}function yc(){if(Nc=!1,Ri){var e=at.unstable_now();lm=e;var t=!0;try{e:{Xn=!1,$n&&($n=!1,nm(Zn),Zn=-1),kc=!0;var a=At;try{t:{for(pl(e),pa=Ua(Xa);pa!==null&&!(pa.expirationTime>e&&sm());){var r=pa.callback;if(typeof r=="function"){pa.callback=null,At=pa.priorityLevel;var n=r(pa.expirationTime<=e);if(e=at.unstable_now(),typeof n=="function"){pa.callback=n,pl(e),t=!0;break t}pa===Ua(Xa)&&dl(Xa),pl(e)}else dl(Xa);pa=Ua(Xa)}if(pa!==null)t=!0;else{var i=Ua(vr);i!==null&&Cc(Sc,i.startTime-e),t=!1}}break e}finally{pa=null,At=a,kc=!1}t=void 0}}finally{t?Ai():Ri=!1}}}var Ai;typeof am=="function"?Ai=function(){am(yc)}:typeof MessageChannel<"u"?(_c=new MessageChannel,rm=_c.port2,_c.port1.onmessage=yc,Ai=function(){rm.postMessage(null)}):Ai=function(){im(yc,0)};var _c,rm;function Cc(e,t){Zn=im(function(){e(at.unstable_now())},t)}at.unstable_IdlePriority=5;at.unstable_ImmediatePriority=1;at.unstable_LowPriority=4;at.unstable_NormalPriority=3;at.unstable_Profiling=null;at.unstable_UserBlockingPriority=2;at.unstable_cancelCallback=function(e){e.callback=null};at.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"):om=0<e?Math.floor(1e3/e):5};at.unstable_getCurrentPriorityLevel=function(){return At};at.unstable_next=function(e){switch(At){case 1:case 2:case 3:var t=3;break;default:t=At}var a=At;At=t;try{return e()}finally{At=a}};at.unstable_requestPaint=function(){Nc=!0};at.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=At;At=e;try{return t()}finally{At=a}};at.unstable_scheduleCallback=function(e,t,a){var r=at.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 n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,e={id:Hw++,callback:t,priorityLevel:e,startTime:a,expirationTime:n,sortIndex:-1},a>r?(e.sortIndex=a,xc(vr,e),Ua(Xa)===null&&e===Ua(vr)&&($n?(nm(Zn),Zn=-1):$n=!0,Cc(Sc,a-r))):(e.sortIndex=n,xc(Xa,e),Xn||kc||(Xn=!0,Ri||(Ri=!0,Ai()))),e};at.unstable_shouldYield=sm;at.unstable_wrapCallback=function(e){var t=At;return function(){var a=At;At=t;try{return e.apply(this,arguments)}finally{At=a}}}});var pm=Ra((rx,um)=>{"use strict";um.exports=cm()});var xm=Ra(ge=>{"use strict";var Mc=Symbol.for("react.transitional.element"),jw=Symbol.for("react.portal"),Qw=Symbol.for("react.fragment"),Gw=Symbol.for("react.strict_mode"),Yw=Symbol.for("react.profiler"),Vw=Symbol.for("react.consumer"),Xw=Symbol.for("react.context"),$w=Symbol.for("react.forward_ref"),Zw=Symbol.for("react.suspense"),Kw=Symbol.for("react.memo"),hm=Symbol.for("react.lazy"),Jw=Symbol.for("react.activity"),dm=Symbol.iterator;function Pw(e){return e===null||typeof e!="object"?null:(e=dm&&e[dm]||e["@@iterator"],typeof e=="function"?e:null)}var bm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vm=Object.assign,wm={};function Di(e,t,a){this.props=e,this.context=t,this.refs=wm,this.updater=a||bm}Di.prototype.isReactComponent={};Di.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")};Di.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ym(){}ym.prototype=Di.prototype;function Tc(e,t,a){this.props=e,this.context=t,this.refs=wm,this.updater=a||bm}var zc=Tc.prototype=new ym;zc.constructor=Tc;vm(zc,Di.prototype);zc.isPureReactComponent=!0;var mm=Array.isArray;function Ec(){}var Pe={H:null,A:null,T:null,S:null},_m=Object.prototype.hasOwnProperty;function Ac(e,t,a){var r=a.ref;return{$$typeof:Mc,type:e,key:t,ref:r!==void 0?r:null,props:a}}function Fw(e,t){return Ac(e.type,t,e.props)}function Rc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mc}function Iw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var fm=/\/+/g;function qc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Iw(""+e.key):t.toString(36)}function Ww(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ec,Ec):(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 Ui(e,t,a,r,n){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Mc:case jw:o=!0;break;case hm:return o=e._init,Ui(o(e._payload),t,a,r,n)}}if(o)return n=n(e),o=r===""?"."+qc(e,0):r,mm(n)?(a="",o!=null&&(a=o.replace(fm,"$&/")+"/"),Ui(n,t,a,"",function(p){return p})):n!=null&&(Rc(n)&&(n=Fw(n,a+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(fm,"$&/")+"/")+o)),t.push(n)),1;o=0;var l=r===""?".":r+":";if(mm(e))for(var c=0;c<e.length;c++)r=e[c],i=l+qc(r,c),o+=Ui(r,t,a,i,n);else if(c=Pw(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,i=l+qc(r,c++),o+=Ui(r,t,a,i,n);else if(i==="object"){if(typeof e.then=="function")return Ui(Ww(e),t,a,r,n);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 ml(e,t,a){if(e==null)return e;var r=[],n=0;return Ui(e,r,"","",function(i){return t.call(a,i,n++)}),r}function e0(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 gm=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)},t0={map:ml,forEach:function(e,t,a){ml(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return ml(e,function(){t++}),t},toArray:function(e){return ml(e,function(t){return t})||[]},only:function(e){if(!Rc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Activity=Jw;ge.Children=t0;ge.Component=Di;ge.Fragment=Qw;ge.Profiler=Yw;ge.PureComponent=Tc;ge.StrictMode=Gw;ge.Suspense=Zw;ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pe;ge.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Pe.H.useMemoCache(e)}};ge.cache=function(e){return function(){return e.apply(null,arguments)}};ge.cacheSignal=function(){return null};ge.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),n=e.key;if(t!=null)for(i in t.key!==void 0&&(n=""+t.key),t)!_m.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];r.children=o}return Ac(e.type,n,r)};ge.createContext=function(e){return e={$$typeof:Xw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Vw,_context:e},e};ge.createElement=function(e,t,a){var r,n={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)_m.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=t[r]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];n.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)n[r]===void 0&&(n[r]=o[r]);return Ac(e,i,n)};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:$w,render:e}};ge.isValidElement=Rc;ge.lazy=function(e){return{$$typeof:hm,_payload:{_status:-1,_result:e},_init:e0}};ge.memo=function(e,t){return{$$typeof:Kw,type:e,compare:t===void 0?null:t}};ge.startTransition=function(e){var t=Pe.T,a={};Pe.T=a;try{var r=e(),n=Pe.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Ec,gm)}catch(i){gm(i)}finally{t!==null&&a.types!==null&&(t.types=a.types),Pe.T=t}};ge.unstable_useCacheRefresh=function(){return Pe.H.useCacheRefresh()};ge.use=function(e){return Pe.H.use(e)};ge.useActionState=function(e,t,a){return Pe.H.useActionState(e,t,a)};ge.useCallback=function(e,t){return Pe.H.useCallback(e,t)};ge.useContext=function(e){return Pe.H.useContext(e)};ge.useDebugValue=function(){};ge.useDeferredValue=function(e,t){return Pe.H.useDeferredValue(e,t)};ge.useEffect=function(e,t){return Pe.H.useEffect(e,t)};ge.useEffectEvent=function(e){return Pe.H.useEffectEvent(e)};ge.useId=function(){return Pe.H.useId()};ge.useImperativeHandle=function(e,t,a){return Pe.H.useImperativeHandle(e,t,a)};ge.useInsertionEffect=function(e,t){return Pe.H.useInsertionEffect(e,t)};ge.useLayoutEffect=function(e,t){return Pe.H.useLayoutEffect(e,t)};ge.useMemo=function(e,t){return Pe.H.useMemo(e,t)};ge.useOptimistic=function(e,t){return Pe.H.useOptimistic(e,t)};ge.useReducer=function(e,t,a){return Pe.H.useReducer(e,t,a)};ge.useRef=function(e){return Pe.H.useRef(e)};ge.useState=function(e){return Pe.H.useState(e)};ge.useSyncExternalStore=function(e,t,a){return Pe.H.useSyncExternalStore(e,t,a)};ge.useTransition=function(){return Pe.H.useTransition()};ge.version="19.2.3"});var Xe=Ra((nx,km)=>{"use strict";km.exports=xm()});var Sm=Ra(Ut=>{"use strict";var a0=Xe();function Nm(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 wr(){}var Rt={d:{f:wr,r:function(){throw Error(Nm(522))},D:wr,C:wr,L:wr,m:wr,X:wr,S:wr,M:wr},p:0,findDOMNode:null},r0=Symbol.for("react.portal");function i0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var Kn=a0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function fl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Rt;Ut.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(Nm(299));return i0(e,t,null,a)};Ut.flushSync=function(e){var t=Kn.T,a=Rt.p;try{if(Kn.T=null,Rt.p=2,e)return e()}finally{Kn.T=t,Rt.p=a,Rt.d.f()}};Ut.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Rt.d.C(e,t))};Ut.prefetchDNS=function(e){typeof e=="string"&&Rt.d.D(e)};Ut.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=fl(a,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Rt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:i}):a==="script"&&Rt.d.X(e,{crossOrigin:r,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Ut.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=fl(t.as,t.crossOrigin);Rt.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&&Rt.d.M(e)};Ut.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=fl(a,t.crossOrigin);Rt.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})}};Ut.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=fl(t.as,t.crossOrigin);Rt.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 Rt.d.m(e)};Ut.requestFormReset=function(e){Rt.d.r(e)};Ut.unstable_batchedUpdates=function(e,t){return e(t)};Ut.useFormState=function(e,t,a){return Kn.H.useFormState(e,t,a)};Ut.useFormStatus=function(){return Kn.H.useHostTransitionStatus()};Ut.version="19.2.3"});var Em=Ra((lx,qm)=>{"use strict";function Cm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Cm)}catch(e){console.error(e)}}Cm(),qm.exports=Sm()});var Qb=Ra(Hs=>{"use strict";var vt=pm(),tg=Xe(),n0=Em();function B(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 ag(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Do(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 rg(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 ig(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 Mm(e){if(Do(e)!==e)throw Error(B(188))}function o0(e){var t=e.alternate;if(!t){if(t=Do(e),t===null)throw Error(B(188));return t!==e?null:e}for(var a=e,r=t;;){var n=a.return;if(n===null)break;var i=n.alternate;if(i===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===a)return Mm(n),e;if(i===r)return Mm(n),t;i=i.sibling}throw Error(B(188))}if(a.return!==r.return)a=n,r=i;else{for(var o=!1,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){for(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)throw Error(B(189))}}if(a.alternate!==r)throw Error(B(190))}if(a.tag!==3)throw Error(B(188));return a.stateNode.current===a?e:t}function ng(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=ng(e),t!==null)return t;e=e.sibling}return null}var We=Object.assign,l0=Symbol.for("react.element"),gl=Symbol.for("react.transitional.element"),ao=Symbol.for("react.portal"),Qi=Symbol.for("react.fragment"),og=Symbol.for("react.strict_mode"),mu=Symbol.for("react.profiler"),lg=Symbol.for("react.consumer"),Wa=Symbol.for("react.context"),sp=Symbol.for("react.forward_ref"),fu=Symbol.for("react.suspense"),gu=Symbol.for("react.suspense_list"),cp=Symbol.for("react.memo"),yr=Symbol.for("react.lazy"),hu=Symbol.for("react.activity"),s0=Symbol.for("react.memo_cache_sentinel"),Tm=Symbol.iterator;function Jn(e){return e===null||typeof e!="object"?null:(e=Tm&&e[Tm]||e["@@iterator"],typeof e=="function"?e:null)}var c0=Symbol.for("react.client.reference");function bu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===c0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qi:return"Fragment";case mu:return"Profiler";case og:return"StrictMode";case fu:return"Suspense";case gu:return"SuspenseList";case hu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ao:return"Portal";case Wa:return e.displayName||"Context";case lg: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 cp:return t=e.displayName||null,t!==null?t:bu(e.type)||"Memo";case yr:t=e._payload,e=e._init;try{return bu(e(t))}catch{}}return null}var ro=Array.isArray,de=tg.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,De=n0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ii={pending:!1,data:null,method:null,action:null},vu=[],Gi=-1;function Ha(e){return{current:e}}function xt(e){0>Gi||(e.current=vu[Gi],vu[Gi]=null,Gi--)}function Ke(e,t){Gi++,vu[Gi]=e.current,e.current=t}var La=Ha(null),_o=Ha(null),zr=Ha(null),Kl=Ha(null);function Jl(e,t){switch(Ke(zr,t),Ke(_o,e),Ke(La,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lf(t),e=qb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}xt(La),Ke(La,e)}function ln(){xt(La),xt(_o),xt(zr)}function wu(e){e.memoizedState!==null&&Ke(Kl,e);var t=La.current,a=qb(t,e.type);t!==a&&(Ke(_o,e),Ke(La,a))}function Pl(e){_o.current===e&&(xt(La),xt(_o)),Kl.current===e&&(xt(Kl),Ao._currentValue=ii)}var Uc,zm;function ei(e){if(Uc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Uc=t&&t[1]||"",zm=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+Uc+e+zm}var Dc=!1;function Bc(e,t){if(!e||Dc)return"";Dc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var b=function(){throw Error()};if(Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(h){var d=h}Reflect.construct(e,[],b)}else{try{b.call()}catch(h){d=h}e.call(b.prototype)}}else{try{throw Error()}catch(h){d=h}(b=e())&&typeof b.catch=="function"&&b.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
|
|
4
4
|
`),p=l.split(`
|
|
5
5
|
`);for(n=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;n<p.length&&!p[n].includes("DetermineComponentFrameRoot");)n++;if(r===c.length||n===p.length)for(r=c.length-1,n=p.length-1;1<=r&&0<=n&&c[r]!==p[n];)n--;for(;1<=r&&0<=n;r--,n--)if(c[r]!==p[n]){if(r!==1||n!==1)do if(r--,n--,0>n||c[r]!==p[n]){var f=`
|
|
6
6
|
`+c[r].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=r&&0<=n);break}}}finally{Dc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ei(a):""}function u0(e,t){switch(e.tag){case 26:case 27:case 5:return ei(e.type);case 16:return ei("Lazy");case 13:return e.child!==t&&t!==null?ei("Suspense Fallback"):ei("Suspense");case 19:return ei("SuspenseList");case 0:case 15:return Bc(e.type,!1);case 11:return Bc(e.type.render,!1);case 1:return Bc(e.type,!0);case 31:return ei("Activity");default:return""}}function Am(e){try{var t="",a=null;do t+=u0(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 yu=Object.prototype.hasOwnProperty,up=vt.unstable_scheduleCallback,Oc=vt.unstable_cancelCallback,p0=vt.unstable_shouldYield,d0=vt.unstable_requestPaint,ra=vt.unstable_now,m0=vt.unstable_getCurrentPriorityLevel,sg=vt.unstable_ImmediatePriority,cg=vt.unstable_UserBlockingPriority,Fl=vt.unstable_NormalPriority,f0=vt.unstable_LowPriority,ug=vt.unstable_IdlePriority,g0=vt.log,h0=vt.unstable_setDisableYieldValue,Bo=null,ia=null;function Cr(e){if(typeof g0=="function"&&h0(e),ia&&typeof ia.setStrictMode=="function")try{ia.setStrictMode(Bo,e)}catch{}}var na=Math.clz32?Math.clz32:w0,b0=Math.log,v0=Math.LN2;function w0(e){return e>>>=0,e===0?32:31-(b0(e)/v0|0)|0}var hl=256,bl=262144,vl=4194304;function ti(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 ks(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~i,r!==0?n=ti(r):(o&=l,o!==0?n=ti(o):a||(a=l&~e,a!==0&&(n=ti(a))))):(l=r&~i,l!==0?n=ti(l):o!==0?n=ti(o):a||(a=r&~e,a!==0&&(n=ti(a)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:n}function Oo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function y0(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 pg(){var e=vl;return vl<<=1,(vl&62914560)===0&&(vl=4194304),e}function Lc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Lo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _0(e,t,a,r,n,i){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 f=31-na(a),b=1<<f;l[f]=0,c[f]=-1;var d=p[f];if(d!==null)for(p[f]=null,f=0;f<d.length;f++){var h=d[f];h!==null&&(h.lane&=-536870913)}a&=~b}r!==0&&dg(e,r,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function dg(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-na(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function mg(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-na(a),n=1<<r;n&t|e[r]&t&&(e[r]|=t),a&=~n}}function fg(e,t){var a=t&-t;return a=(a&42)!==0?1:pp(a),(a&(e.suspendedLanes|t))!==0?0:a}function pp(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 dp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gg(){var e=De.p;return e!==0?e:(e=window.event,e===void 0?32:Lb(e.type))}function Rm(e,t){var a=De.p;try{return De.p=e,t()}finally{De.p=a}}var Vr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Vr,Xt="__reactProps$"+Vr,vn="__reactContainer$"+Vr,_u="__reactEvents$"+Vr,x0="__reactListeners$"+Vr,k0="__reactHandles$"+Vr,Um="__reactResources$"+Vr,Ho="__reactMarker$"+Vr;function mp(e){delete e[Nt],delete e[Xt],delete e[_u],delete e[x0],delete e[k0]}function Yi(e){var t=e[Nt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[vn]||a[Nt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Yf(e);e!==null;){if(a=e[Nt])return a;e=Yf(e)}return t}e=a,a=e.parentNode}return null}function wn(e){if(e=e[Nt]||e[vn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function io(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(B(33))}function Wi(e){var t=e[Um];return t||(t=e[Um]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function _t(e){e[Ho]=!0}var hg=new Set,bg={};function fi(e,t){sn(e,t),sn(e+"Capture",t)}function sn(e,t){for(bg[e]=t,e=0;e<t.length;e++)hg.add(t[e])}var N0=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]*$"),Dm={},Bm={};function S0(e){return yu.call(Bm,e)?!0:yu.call(Dm,e)?!1:N0.test(e)?Bm[e]=!0:(Dm[e]=!0,!1)}function Rl(e,t,a){if(S0(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 wl(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 $a(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 vg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function C0(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 n=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){a=""+o,i.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 xu(e){if(!e._valueTracker){var t=vg(e)?"checked":"value";e._valueTracker=C0(e,t,""+e[t])}}function wg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=vg(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Il(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 q0=/[\n"\\]/g;function ga(e){return e.replace(q0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ku(e,t,a,r,n,i,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?Nu(e,o,da(t)):a!=null?Nu(e,o,da(a)):r!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+da(l):e.removeAttribute("name")}function yg(e,t,a,r,n,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){xu(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??n,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),xu(e)}function Nu(e,t,a){t==="number"&&Il(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function en(e,t,a,r){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t["$"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty("$"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&r&&(e[a].defaultSelected=!0)}else{for(a=""+da(a),t=null,n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,r&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function _g(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 xg(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(B(92));if(ro(r)){if(1<r.length)throw Error(B(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),xu(e)}function cn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var E0=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 Om(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||E0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function kg(e,t,a){if(t!=null&&typeof t!="object")throw Error(B(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 n in t)r=t[n],t.hasOwnProperty(n)&&a[n]!==r&&Om(e,n,r)}else for(var i in t)t.hasOwnProperty(i)&&Om(e,i,t[i])}function fp(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 M0=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"]]),T0=/^[\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 Ul(e){return T0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function er(){}var Su=null;function gp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vi=null,tn=null;function Lm(e){var t=wn(e);if(t&&(e=t.stateNode)){var a=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ku(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 n=r[Xt]||null;if(!n)throw Error(B(90));ku(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&wg(r)}break e;case"textarea":_g(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&en(e,!!a.multiple,t,!1)}}}var Hc=!1;function Ng(e,t,a){if(Hc)return e(t,a);Hc=!0;try{var r=e(t);return r}finally{if(Hc=!1,(Vi!==null||tn!==null)&&(Ds(),Vi&&(t=Vi,e=tn,tn=Vi=null,Lm(t),e)))for(t=0;t<e.length;t++)Lm(e[t])}}function xo(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Xt]||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(B(231,t,typeof a));return a}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cu=!1;if(nr)try{Bi={},Object.defineProperty(Bi,"passive",{get:function(){Cu=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{Cu=!1}var Bi,qr=null,hp=null,Dl=null;function Sg(){if(Dl)return Dl;var e,t=hp,a=t.length,r,n="value"in qr?qr.value:qr.textContent,i=n.length;for(e=0;e<a&&t[e]===n[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===n[i-r];r++);return Dl=n.slice(e,1<r?1-r:void 0)}function Bl(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 yl(){return!0}function Hm(){return!1}function $t(e){function t(a,r,n,i,o){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?yl:Hm,this.isPropagationStopped=Hm,this}return We(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=yl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=yl)},persist:function(){},isPersistent:yl}),t}var gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ns=$t(gi),jo=We({},gi,{view:0,detail:0}),z0=$t(jo),jc,Qc,Pn,Ss=We({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bp,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!==Pn&&(Pn&&e.type==="mousemove"?(jc=e.screenX-Pn.screenX,Qc=e.screenY-Pn.screenY):Qc=jc=0,Pn=e),jc)},movementY:function(e){return"movementY"in e?e.movementY:Qc}}),jm=$t(Ss),A0=We({},Ss,{dataTransfer:0}),R0=$t(A0),U0=We({},jo,{relatedTarget:0}),Gc=$t(U0),D0=We({},gi,{animationName:0,elapsedTime:0,pseudoElement:0}),B0=$t(D0),O0=We({},gi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),L0=$t(O0),H0=We({},gi,{data:0}),Qm=$t(H0),j0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q0={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"},G0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G0[e])?!!t[e]:!1}function bp(){return Y0}var V0=We({},jo,{key:function(e){if(e.key){var t=j0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Q0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bp,charCode:function(e){return e.type==="keypress"?Bl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),X0=$t(V0),$0=We({},Ss,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gm=$t($0),Z0=We({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bp}),K0=$t(Z0),J0=We({},gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),P0=$t(J0),F0=We({},Ss,{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}),I0=$t(F0),W0=We({},gi,{newState:0,oldState:0}),ey=$t(W0),ty=[9,13,27,32],vp=nr&&"CompositionEvent"in window,lo=null;nr&&"documentMode"in document&&(lo=document.documentMode);var ay=nr&&"TextEvent"in window&&!lo,Cg=nr&&(!vp||lo&&8<lo&&11>=lo),Ym=" ",Vm=!1;function qg(e,t){switch(e){case"keyup":return ty.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xi=!1;function ry(e,t){switch(e){case"compositionend":return Eg(t);case"keypress":return t.which!==32?null:(Vm=!0,Ym);case"textInput":return e=t.data,e===Ym&&Vm?null:e;default:return null}}function iy(e,t){if(Xi)return e==="compositionend"||!vp&&qg(e,t)?(e=Sg(),Dl=hp=qr=null,Xi=!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 Cg&&t.locale!=="ko"?null:t.data;default:return null}}var ny={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 Xm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ny[e.type]:t==="textarea"}function Mg(e,t,a,r){Vi?tn?tn.push(r):tn=[r]:Vi=r,t=hs(t,"onChange"),0<t.length&&(a=new Ns("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var so=null,ko=null;function oy(e){Nb(e,0)}function Cs(e){var t=io(e);if(wg(t))return e}function $m(e,t){if(e==="change")return t}var Tg=!1;nr&&(nr?(xl="oninput"in document,xl||(Yc=document.createElement("div"),Yc.setAttribute("oninput","return;"),xl=typeof Yc.oninput=="function"),_l=xl):_l=!1,Tg=_l&&(!document.documentMode||9<document.documentMode));var _l,xl,Yc;function Zm(){so&&(so.detachEvent("onpropertychange",zg),ko=so=null)}function zg(e){if(e.propertyName==="value"&&Cs(ko)){var t=[];Mg(t,ko,e,gp(e)),Ng(oy,t)}}function ly(e,t,a){e==="focusin"?(Zm(),so=t,ko=a,so.attachEvent("onpropertychange",zg)):e==="focusout"&&Zm()}function sy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cs(ko)}function cy(e,t){if(e==="click")return Cs(t)}function uy(e,t){if(e==="input"||e==="change")return Cs(t)}function py(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var la=typeof Object.is=="function"?Object.is:py;function No(e,t){if(la(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 n=a[r];if(!yu.call(t,n)||!la(e[n],t[n]))return!1}return!0}function Km(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jm(e,t){var a=Km(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=Km(a)}}function Ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Il(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=Il(e.document)}return t}function wp(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 dy=nr&&"documentMode"in document&&11>=document.documentMode,$i=null,qu=null,co=null,Eu=!1;function Pm(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Eu||$i==null||$i!==Il(r)||(r=$i,"selectionStart"in r&&wp(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}),co&&No(co,r)||(co=r,r=hs(qu,"onSelect"),0<r.length&&(t=new Ns("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=$i)))}function Wr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Zi={animationend:Wr("Animation","AnimationEnd"),animationiteration:Wr("Animation","AnimationIteration"),animationstart:Wr("Animation","AnimationStart"),transitionrun:Wr("Transition","TransitionRun"),transitionstart:Wr("Transition","TransitionStart"),transitioncancel:Wr("Transition","TransitionCancel"),transitionend:Wr("Transition","TransitionEnd")},Vc={},Ug={};nr&&(Ug=document.createElement("div").style,"AnimationEvent"in window||(delete Zi.animationend.animation,delete Zi.animationiteration.animation,delete Zi.animationstart.animation),"TransitionEvent"in window||delete Zi.transitionend.transition);function hi(e){if(Vc[e])return Vc[e];if(!Zi[e])return e;var t=Zi[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Ug)return Vc[e]=t[a];return e}var Dg=hi("animationend"),Bg=hi("animationiteration"),Og=hi("animationstart"),my=hi("transitionrun"),fy=hi("transitionstart"),gy=hi("transitioncancel"),Lg=hi("transitionend"),Hg=new Map,Mu="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(" ");Mu.push("scrollEnd");function za(e,t){Hg.set(e,t),fi(t,[e])}var Wl=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=[],Ki=0,yp=0;function qs(){for(var e=Ki,t=yp=Ki=0;t<e;){var a=pa[t];pa[t++]=null;var r=pa[t];pa[t++]=null;var n=pa[t];pa[t++]=null;var i=pa[t];if(pa[t++]=null,r!==null&&n!==null){var o=r.pending;o===null?n.next=n:(n.next=o.next,o.next=n),r.pending=n}i!==0&&jg(a,n,i)}}function Es(e,t,a,r){pa[Ki++]=e,pa[Ki++]=t,pa[Ki++]=a,pa[Ki++]=r,yp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function _p(e,t,a,r){return Es(e,t,a,r),es(e)}function bi(e,t){return Es(e,null,null,t),es(e)}function jg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var n=!1,i=e.return;i!==null;)i.childLanes|=a,r=i.alternate,r!==null&&(r.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-na(a),e=i.hiddenUpdates,r=e[n],r===null?e[n]=[t]:r.push(t),t.lane=a|536870912),i):null}function es(e){if(50<wo)throw wo=0,Pu=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ji={};function hy(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 ta(e,t,a,r){return new hy(e,t,a,r)}function xp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ar(e,t){var a=e.alternate;return a===null?(a=ta(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 Qg(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 Ol(e,t,a,r,n,i){var o=0;if(r=e,typeof e=="function")xp(e)&&(o=1);else if(typeof e=="string")o=w1(e,a,La.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case hu:return e=ta(31,a,t,n),e.elementType=hu,e.lanes=i,e;case Qi:return ni(a.children,n,i,t);case og:o=8,n|=24;break;case mu:return e=ta(12,a,t,n|2),e.elementType=mu,e.lanes=i,e;case fu:return e=ta(13,a,t,n),e.elementType=fu,e.lanes=i,e;case gu:return e=ta(19,a,t,n),e.elementType=gu,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wa:o=10;break e;case lg:o=9;break e;case sp:o=11;break e;case cp:o=14;break e;case yr:o=16,r=null;break e}o=29,a=Error(B(130,e===null?"null":typeof e,"")),r=null}return t=ta(o,a,t,n),t.elementType=e,t.type=r,t.lanes=i,t}function ni(e,t,a,r){return e=ta(7,e,r,t),e.lanes=a,e}function Xc(e,t,a){return e=ta(6,e,null,t),e.lanes=a,e}function Gg(e){var t=ta(18,null,null,0);return t.stateNode=e,t}function $c(e,t,a){return t=ta(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fm=new WeakMap;function ha(e,t){if(typeof e=="object"&&e!==null){var a=Fm.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Am(t)},Fm.set(e,t),t)}return{value:e,source:t,stack:Am(t)}}var Pi=[],Fi=0,ts=null,So=0,ma=[],fa=0,jr=null,Da=1,Ba="";function Fa(e,t){Pi[Fi++]=So,Pi[Fi++]=ts,ts=e,So=t}function Yg(e,t,a){ma[fa++]=Da,ma[fa++]=Ba,ma[fa++]=jr,jr=e;var r=Da;e=Ba;var n=32-na(r)-1;r&=~(1<<n),a+=1;var i=32-na(t)+n;if(30<i){var o=n-n%5;i=(r&(1<<o)-1).toString(32),r>>=o,n-=o,Da=1<<32-na(t)+n|a<<n|r,Ba=i+e}else Da=1<<i|a<<n|r,Ba=e}function kp(e){e.return!==null&&(Fa(e,1),Yg(e,1,0))}function Np(e){for(;e===ts;)ts=Pi[--Fi],Pi[Fi]=null,So=Pi[--Fi],Pi[Fi]=null;for(;e===jr;)jr=ma[--fa],ma[fa]=null,Ba=ma[--fa],ma[fa]=null,Da=ma[--fa],ma[fa]=null}function Vg(e,t){ma[fa++]=Da,ma[fa++]=Ba,ma[fa++]=jr,Da=t.id,Ba=t.overflow,jr=e}var St=null,Ie=null,Ee=!1,Ar=null,ba=!1,Tu=Error(B(519));function Qr(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(ha(t,e)),Tu}function Im(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Nt]=e,t[Xt]=r,a){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(a=0;a<To.length;a++)ke(To[a],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),yg(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),xg(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||Cb(t.textContent,a)?(r.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),r.onScroll!=null&&ke("scroll",t),r.onScrollEnd!=null&&ke("scrollend",t),r.onClick!=null&&(t.onclick=er),t=!0):t=!1,t||Qr(e,!0)}function Wm(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:St=St.return}}function Oi(e){if(e!==St)return!1;if(!Ee)return Wm(e),Ee=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||tp(e.type,e.memoizedProps)),a=!a),a&&Ie&&Qr(e),Wm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));Ie=Gf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));Ie=Gf(e)}else t===27?(t=Ie,Xr(e.type)?(e=np,np=null,Ie=e):Ie=t):Ie=St?wa(e.stateNode.nextSibling):null;return!0}function ci(){Ie=St=null,Ee=!1}function Zc(){var e=Ar;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),Ar=null),e}function Co(e){Ar===null?Ar=[e]:Ar.push(e)}var zu=Ha(null),vi=null,tr=null;function xr(e,t,a){Ke(zu,t._currentValue),t._currentValue=a}function rr(e){e._currentValue=zu.current,xt(zu)}function Au(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 Ru(e,t,a,r){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var o=n.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=n;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=a,l=i.alternate,l!==null&&(l.lanes|=a),Au(i.return,a,e),r||(o=null);break e}i=l.next}}else if(n.tag===18){if(o=n.return,o===null)throw Error(B(341));o.lanes|=a,i=o.alternate,i!==null&&(i.lanes|=a),Au(o,a,e),o=null}else o=n.child;if(o!==null)o.return=n;else for(o=n;o!==null;){if(o===e){o=null;break}if(n=o.sibling,n!==null){n.return=o.return,o=n;break}o=o.return}n=o}}function yn(e,t,a,r){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var o=n.alternate;if(o===null)throw Error(B(387));if(o=o.memoizedProps,o!==null){var l=n.type;la(n.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(n===Kl.current){if(o=n.alternate,o===null)throw Error(B(387));o.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Ao):e=[Ao])}n=n.return}e!==null&&Ru(t,e,a,r),t.flags|=262144}function as(e){for(e=e.firstContext;e!==null;){if(!la(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ui(e){vi=e,tr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Xg(vi,e)}function kl(e,t){return vi===null&&ui(e),Xg(e,t)}function Xg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},tr===null){if(e===null)throw Error(B(308));tr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else tr=tr.next=t;return a}var by=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()})}},vy=vt.unstable_scheduleCallback,wy=vt.unstable_NormalPriority,gt={$$typeof:Wa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sp(){return{controller:new by,data:new Map,refCount:0}}function Qo(e){e.refCount--,e.refCount===0&&vy(wy,function(){e.controller.abort()})}var uo=null,Uu=0,un=0,an=null;function yy(e,t){if(uo===null){var a=uo=[];Uu=0,un=Pp(),an={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Uu++,t.then(ef,ef),t}function ef(){if(--Uu===0&&uo!==null){an!==null&&(an.status="fulfilled");var e=uo;uo=null,un=0,an=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _y(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var tf=de.S;de.S=function(e,t){nb=ra(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&yy(e,t),tf!==null&&tf(e,t)};var oi=Ha(null);function Cp(){var e=oi.current;return e!==null?e:$e.pooledCache}function Ll(e,t){t===null?Ke(oi,oi.current):Ke(oi,t.pool)}function $g(){var e=Cp();return e===null?null:{parent:gt._currentValue,pool:e}}var _n=Error(B(460)),qp=Error(B(474)),Ms=Error(B(542)),rs={then:function(){}};function af(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(er,er),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nf(e),e;default:if(typeof t.status=="string")t.then(er,er);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(B(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=r}},function(r){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nf(e),e}throw li=t,_n}}function ai(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(li=a,_n):a}}var li=null;function rf(){if(li===null)throw Error(B(459));var e=li;return li=null,e}function nf(e){if(e===_n||e===Ms)throw Error(B(483))}var rn=null,qo=0;function Nl(e){var t=qo;return qo+=1,rn===null&&(rn=[]),Zg(rn,e,t)}function Fn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Sl(e,t){throw t.$$typeof===l0?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Kg(e){function t(m,u){if(e){var g=m.deletions;g===null?(m.deletions=[u],m.flags|=16):g.push(u)}}function a(m,u){if(!e)return null;for(;u!==null;)t(m,u),u=u.sibling;return null}function r(m){for(var u=new Map;m!==null;)m.key!==null?u.set(m.key,m):u.set(m.index,m),m=m.sibling;return u}function n(m,u){return m=ar(m,u),m.index=0,m.sibling=null,m}function i(m,u,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<u?(m.flags|=67108866,u):g):(m.flags|=67108866,u)):(m.flags|=1048576,u)}function o(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function l(m,u,g,v){return u===null||u.tag!==6?(u=Xc(g,m.mode,v),u.return=m,u):(u=n(u,g),u.return=m,u)}function c(m,u,g,v){var N=g.type;return N===Qi?f(m,u,g.props.children,v,g.key):u!==null&&(u.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===yr&&ai(N)===u.type)?(u=n(u,g.props),Fn(u,g),u.return=m,u):(u=Ol(g.type,g.key,g.props,null,m.mode,v),Fn(u,g),u.return=m,u)}function p(m,u,g,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=$c(g,m.mode,v),u.return=m,u):(u=n(u,g.children||[]),u.return=m,u)}function f(m,u,g,v,N){return u===null||u.tag!==7?(u=ni(g,m.mode,v,N),u.return=m,u):(u=n(u,g),u.return=m,u)}function b(m,u,g){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=Xc(""+u,m.mode,g),u.return=m,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case gl:return g=Ol(u.type,u.key,u.props,null,m.mode,g),Fn(g,u),g.return=m,g;case ao:return u=$c(u,m.mode,g),u.return=m,u;case yr:return u=ai(u),b(m,u,g)}if(ro(u)||Jn(u))return u=ni(u,m.mode,g,null),u.return=m,u;if(typeof u.then=="function")return b(m,Nl(u),g);if(u.$$typeof===Wa)return b(m,kl(m,u),g);Sl(m,u)}return null}function d(m,u,g,v){var N=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return N!==null?null:l(m,u,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case gl:return g.key===N?c(m,u,g,v):null;case ao:return g.key===N?p(m,u,g,v):null;case yr:return g=ai(g),d(m,u,g,v)}if(ro(g)||Jn(g))return N!==null?null:f(m,u,g,v,null);if(typeof g.then=="function")return d(m,u,Nl(g),v);if(g.$$typeof===Wa)return d(m,u,kl(m,g),v);Sl(m,g)}return null}function h(m,u,g,v,N){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return m=m.get(g)||null,l(u,m,""+v,N);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case gl:return m=m.get(v.key===null?g:v.key)||null,c(u,m,v,N);case ao:return m=m.get(v.key===null?g:v.key)||null,p(u,m,v,N);case yr:return v=ai(v),h(m,u,g,v,N)}if(ro(v)||Jn(v))return m=m.get(g)||null,f(u,m,v,N,null);if(typeof v.then=="function")return h(m,u,g,Nl(v),N);if(v.$$typeof===Wa)return h(m,u,g,kl(u,v),N);Sl(u,v)}return null}function w(m,u,g,v){for(var N=null,A=null,T=u,z=u=0,Q=null;T!==null&&z<g.length;z++){T.index>z?(Q=T,T=null):Q=T.sibling;var K=d(m,T,g[z],v);if(K===null){T===null&&(T=Q);break}e&&T&&K.alternate===null&&t(m,T),u=i(K,u,z),A===null?N=K:A.sibling=K,A=K,T=Q}if(z===g.length)return a(m,T),Ee&&Fa(m,z),N;if(T===null){for(;z<g.length;z++)T=b(m,g[z],v),T!==null&&(u=i(T,u,z),A===null?N=T:A.sibling=T,A=T);return Ee&&Fa(m,z),N}for(T=r(T);z<g.length;z++)Q=h(T,m,z,g[z],v),Q!==null&&(e&&Q.alternate!==null&&T.delete(Q.key===null?z:Q.key),u=i(Q,u,z),A===null?N=Q:A.sibling=Q,A=Q);return e&&T.forEach(function(fe){return t(m,fe)}),Ee&&Fa(m,z),N}function M(m,u,g,v){if(g==null)throw Error(B(151));for(var N=null,A=null,T=u,z=u=0,Q=null,K=g.next();T!==null&&!K.done;z++,K=g.next()){T.index>z?(Q=T,T=null):Q=T.sibling;var fe=d(m,T,K.value,v);if(fe===null){T===null&&(T=Q);break}e&&T&&fe.alternate===null&&t(m,T),u=i(fe,u,z),A===null?N=fe:A.sibling=fe,A=fe,T=Q}if(K.done)return a(m,T),Ee&&Fa(m,z),N;if(T===null){for(;!K.done;z++,K=g.next())K=b(m,K.value,v),K!==null&&(u=i(K,u,z),A===null?N=K:A.sibling=K,A=K);return Ee&&Fa(m,z),N}for(T=r(T);!K.done;z++,K=g.next())K=h(T,m,z,K.value,v),K!==null&&(e&&K.alternate!==null&&T.delete(K.key===null?z:K.key),u=i(K,u,z),A===null?N=K:A.sibling=K,A=K);return e&&T.forEach(function(Te){return t(m,Te)}),Ee&&Fa(m,z),N}function D(m,u,g,v){if(typeof g=="object"&&g!==null&&g.type===Qi&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case gl:e:{for(var N=g.key;u!==null;){if(u.key===N){if(N=g.type,N===Qi){if(u.tag===7){a(m,u.sibling),v=n(u,g.props.children),v.return=m,m=v;break e}}else if(u.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===yr&&ai(N)===u.type){a(m,u.sibling),v=n(u,g.props),Fn(v,g),v.return=m,m=v;break e}a(m,u);break}else t(m,u);u=u.sibling}g.type===Qi?(v=ni(g.props.children,m.mode,v,g.key),v.return=m,m=v):(v=Ol(g.type,g.key,g.props,null,m.mode,v),Fn(v,g),v.return=m,m=v)}return o(m);case ao:e:{for(N=g.key;u!==null;){if(u.key===N)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){a(m,u.sibling),v=n(u,g.children||[]),v.return=m,m=v;break e}else{a(m,u);break}else t(m,u);u=u.sibling}v=$c(g,m.mode,v),v.return=m,m=v}return o(m);case yr:return g=ai(g),D(m,u,g,v)}if(ro(g))return w(m,u,g,v);if(Jn(g)){if(N=Jn(g),typeof N!="function")throw Error(B(150));return g=N.call(g),M(m,u,g,v)}if(typeof g.then=="function")return D(m,u,Nl(g),v);if(g.$$typeof===Wa)return D(m,u,kl(m,g),v);Sl(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,u!==null&&u.tag===6?(a(m,u.sibling),v=n(u,g),v.return=m,m=v):(a(m,u),v=Xc(g,m.mode,v),v.return=m,m=v),o(m)):a(m,u)}return function(m,u,g,v){try{qo=0;var N=D(m,u,g,v);return rn=null,N}catch(T){if(T===_n||T===Ms)throw T;var A=ta(29,T,null,m.mode);return A.lanes=v,A.return=m,A}}}var pi=Kg(!0),Jg=Kg(!1),_r=!1;function Ep(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Du(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 Ur(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ue&2)!==0){var n=r.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),r.pending=t,t=es(e),jg(e,null,a),t}return Es(e,r,t,a),es(e)}function po(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,mg(e,a)}}function Kc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?n=i=o:i=i.next=o,a=a.next}while(a!==null);i===null?n=i=t:i=i.next=t}else n=i=t;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:i,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 Bu=!1;function mo(){if(Bu){var e=an;if(e!==null)throw e}}function fo(e,t,a,r){Bu=!1;var n=e.updateQueue;_r=!1;var i=n.firstBaseUpdate,o=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?i=p:o.next=p,o=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=p:l.next=p,f.lastBaseUpdate=c))}if(i!==null){var b=n.baseState;o=0,f=p=c=null,l=i;do{var d=l.lane&-536870913,h=d!==l.lane;if(h?(qe&d)===d:(r&d)===d){d!==0&&d===un&&(Bu=!0),f!==null&&(f=f.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var w=e,M=l;d=t;var D=a;switch(M.tag){case 1:if(w=M.payload,typeof w=="function"){b=w.call(D,b,d);break e}b=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=M.payload,d=typeof w=="function"?w.call(D,b,d):w,d==null)break e;b=We({},b,d);break e;case 2:_r=!0}}d=l.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=n.callbacks,h===null?n.callbacks=[d]:h.push(d))}else h={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(p=f=h,c=b):f=f.next=h,o|=d;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;h=l,l=h.next,h.next=null,n.lastBaseUpdate=h,n.shared.pending=null}}while(!0);f===null&&(c=b),n.baseState=c,n.firstBaseUpdate=p,n.lastBaseUpdate=f,i===null&&(n.shared.lanes=0),Yr|=o,e.lanes=o,e.memoizedState=b}}function Pg(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function Fg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Pg(a[e],t)}var pn=Ha(null),is=Ha(0);function of(e,t){e=cr,Ke(is,e),Ke(pn,t),cr=e|t.baseLanes}function Ou(){Ke(is,cr),Ke(pn,pn.current)}function Mp(){cr=is.current,xt(pn),xt(is)}var sa=Ha(null),va=null;function kr(e){var t=e.alternate;Ke(ut,ut.current&1),Ke(sa,e),va===null&&(t===null||pn.current!==null||t.memoizedState!==null)&&(va=e)}function Lu(e){Ke(ut,ut.current),Ke(sa,e),va===null&&(va=e)}function Ig(e){e.tag===22?(Ke(ut,ut.current),Ke(sa,e),va===null&&(va=e)):Nr(e)}function Nr(){Ke(ut,ut.current),Ke(sa,sa.current)}function ea(e){xt(sa),va===e&&(va=null),xt(ut)}var ut=Ha(0);function ns(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||rp(a)||ip(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 or=0,he=null,Ge=null,mt=null,os=!1,nn=!1,di=!1,ls=0,Eo=0,on=null,xy=0;function ot(){throw Error(B(321))}function Tp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!la(e[a],t[a]))return!1;return!0}function zp(e,t,a,r,n,i){return or=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,de.H=e===null||e.memoizedState===null?Mh:Gp,di=!1,i=a(r,n),di=!1,nn&&(i=eh(t,a,r,n)),Wg(e),i}function Wg(e){de.H=Mo;var t=Ge!==null&&Ge.next!==null;if(or=0,mt=Ge=he=null,os=!1,Eo=0,on=null,t)throw Error(B(300));e===null||ht||(e=e.dependencies,e!==null&&as(e)&&(ht=!0))}function eh(e,t,a,r){he=e;var n=0;do{if(nn&&(on=null),Eo=0,nn=!1,25<=n)throw Error(B(301));if(n+=1,mt=Ge=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}de.H=Th,i=t(a,r)}while(nn);return i}function ky(){var e=de.H,t=e.useState()[0];return t=typeof t.then=="function"?Go(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(he.flags|=1024),t}function Ap(){var e=ls!==0;return ls=0,e}function Rp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Up(e){if(os){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}os=!1}or=0,mt=Ge=he=null,nn=!1,Eo=ls=0,on=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?he.memoizedState=mt=e:mt=mt.next=e,mt}function pt(){if(Ge===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=mt===null?he.memoizedState:mt.next;if(t!==null)mt=t,Ge=e;else{if(e===null)throw he.alternate===null?Error(B(467)):Error(B(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},mt===null?he.memoizedState=mt=e:mt=mt.next=e}return mt}function Ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Go(e){var t=Eo;return Eo+=1,on===null&&(on=[]),e=Zg(on,e,t),t=he,(mt===null?t.memoizedState:mt.next)===null&&(t=t.alternate,de.H=t===null||t.memoizedState===null?Mh:Gp),e}function zs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Go(e);if(e.$$typeof===Wa)return Ct(e)}throw Error(B(438,String(e)))}function Dp(e){var t=null,a=he.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=he.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ts(),he.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]=s0;return t.index++,a}function lr(e,t){return typeof t=="function"?t(e):t}function Hl(e){var t=pt();return Bp(t,Ge,e)}function Bp(e,t,a){var r=e.queue;if(r===null)throw Error(B(311));r.lastRenderedReducer=a;var n=e.baseQueue,i=r.pending;if(i!==null){if(n!==null){var o=n.next;n.next=i.next,i.next=o}t.baseQueue=n=i,r.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var l=o=null,c=null,p=t,f=!1;do{var b=p.lane&-536870913;if(b!==p.lane?(qe&b)===b:(or&b)===b){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}),b===un&&(f=!0);else if((or&d)===d){p=p.next,d===un&&(f=!0);continue}else b={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=b,o=i):c=c.next=b,he.lanes|=d,Yr|=d;b=p.action,di&&a(i,b),i=p.hasEagerState?p.eagerState:a(i,b)}else d={lane:b,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=d,o=i):c=c.next=d,he.lanes|=b,Yr|=b;p=p.next}while(p!==null&&p!==t);if(c===null?o=i:c.next=l,!la(i,e.memoizedState)&&(ht=!0,f&&(a=an,a!==null)))throw a;e.memoizedState=i,e.baseState=o,e.baseQueue=c,r.lastRenderedState=i}return n===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Jc(e){var t=pt(),a=t.queue;if(a===null)throw Error(B(311));a.lastRenderedReducer=e;var r=a.dispatch,n=a.pending,i=t.memoizedState;if(n!==null){a.pending=null;var o=n=n.next;do i=e(i,o.action),o=o.next;while(o!==n);la(i,t.memoizedState)||(ht=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,r]}function th(e,t,a){var r=he,n=pt(),i=Ee;if(i){if(a===void 0)throw Error(B(407));a=a()}else a=t();var o=!la((Ge||n).memoizedState,a);if(o&&(n.memoizedState=a,ht=!0),n=n.queue,Op(ih.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||mt!==null&&mt.memoizedState.tag&1){if(r.flags|=2048,dn(9,{destroy:void 0},rh.bind(null,r,n,a,t),null),$e===null)throw Error(B(349));i||(or&127)!==0||ah(r,t,a)}return a}function ah(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=Ts(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function rh(e,t,a,r){t.value=a,t.getSnapshot=r,nh(t)&&oh(e)}function ih(e,t,a){return a(function(){nh(t)&&oh(e)})}function nh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!la(e,a)}catch{return!0}}function oh(e){var t=bi(e,2);t!==null&&Vt(t,e,2)}function Hu(e){var t=Dt();if(typeof e=="function"){var a=e;if(e=a(),di){Cr(!0);try{a()}finally{Cr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t}function lh(e,t,a,r){return e.baseState=a,Bp(e,Ge,typeof r=="function"?r:lr)}function Ny(e,t,a,r,n){if(Rs(e))throw Error(B(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};de.T!==null?a(!0):i.isTransition=!1,r(i),a=t.pending,a===null?(i.next=t.pending=i,sh(t,i)):(i.next=a.next,t.pending=a.next=i)}}function sh(e,t){var a=t.action,r=t.payload,n=e.state;if(t.isTransition){var i=de.T,o={};de.T=o;try{var l=a(n,r),c=de.S;c!==null&&c(o,l),lf(e,t,l)}catch(p){ju(e,t,p)}finally{i!==null&&o.types!==null&&(i.types=o.types),de.T=i}}else try{i=a(n,r),lf(e,t,i)}catch(p){ju(e,t,p)}}function lf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){sf(e,t,r)},function(r){return ju(e,t,r)}):sf(e,t,a)}function sf(e,t,a){t.status="fulfilled",t.value=a,ch(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,sh(e,a)))}function ju(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,ch(t),t=t.next;while(t!==r)}e.action=null}function ch(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function uh(e,t){return t}function cf(e,t){if(Ee){var a=$e.formState;if(a!==null){e:{var r=he;if(Ee){if(Ie){t:{for(var n=Ie,i=ba;n.nodeType!==8;){if(!i){n=null;break t}if(n=wa(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Ie=wa(n.nextSibling),r=n.data==="F!";break e}}Qr(r)}r=!1}r&&(t=a[0])}}return a=Dt(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uh,lastRenderedState:t},a.queue=r,a=Ch.bind(null,he,r),r.dispatch=a,r=Hu(!1),i=Qp.bind(null,he,!1,r.queue),r=Dt(),n={state:t,dispatch:null,action:e,pending:null},r.queue=n,a=Ny.bind(null,he,n,i,a),n.dispatch=a,r.memoizedState=e,[t,a,!1]}function uf(e){var t=pt();return ph(t,Ge,e)}function ph(e,t,a){if(t=Bp(e,t,uh)[0],e=Hl(lr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Go(t)}catch(o){throw o===_n?Ms:o}else r=t;t=pt();var n=t.queue,i=n.dispatch;return a!==t.memoizedState&&(he.flags|=2048,dn(9,{destroy:void 0},Sy.bind(null,n,a),null)),[r,i,e]}function Sy(e,t){e.action=t}function pf(e){var t=pt(),a=Ge;if(a!==null)return ph(t,a,e);pt(),t=t.memoizedState,a=pt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function dn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=he.updateQueue,t===null&&(t=Ts(),he.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 dh(){return pt().memoizedState}function jl(e,t,a,r){var n=Dt();he.flags|=e,n.memoizedState=dn(1|t,{destroy:void 0},a,r===void 0?null:r)}function As(e,t,a,r){var n=pt();r=r===void 0?null:r;var i=n.memoizedState.inst;Ge!==null&&r!==null&&Tp(r,Ge.memoizedState.deps)?n.memoizedState=dn(t,i,a,r):(he.flags|=e,n.memoizedState=dn(1|t,i,a,r))}function df(e,t){jl(8390656,8,e,t)}function Op(e,t){As(2048,8,e,t)}function Cy(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=Ts(),he.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function mh(e){var t=pt().memoizedState;return Cy({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function fh(e,t){return As(4,2,e,t)}function gh(e,t){return As(4,4,e,t)}function hh(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 bh(e,t,a){a=a!=null?a.concat([e]):null,As(4,4,hh.bind(null,t,e),a)}function Lp(){}function vh(e,t){var a=pt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Tp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function wh(e,t){var a=pt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Tp(t,r[1]))return r[0];if(r=e(),di){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r}function Hp(e,t,a){return a===void 0||(or&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=lb(),he.lanes|=e,Yr|=e,a)}function yh(e,t,a,r){return la(a,t)?a:pn.current!==null?(e=Hp(e,a,r),la(e,t)||(ht=!0),e):(or&42)===0||(or&1073741824)!==0&&(qe&261930)===0?(ht=!0,e.memoizedState=a):(e=lb(),he.lanes|=e,Yr|=e,t)}function _h(e,t,a,r,n){var i=De.p;De.p=i!==0&&8>i?i:8;var o=de.T,l={};de.T=l,Qp(e,!1,t,a);try{var c=n(),p=de.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=_y(c,r);go(e,t,f,oa(e))}else go(e,t,r,oa(e))}catch(b){go(e,t,{then:function(){},status:"rejected",reason:b},oa())}finally{De.p=i,o!==null&&l.types!==null&&(o.types=l.types),de.T=o}}function qy(){}function Qu(e,t,a,r){if(e.tag!==5)throw Error(B(476));var n=xh(e).queue;_h(e,n,t,ii,a===null?qy:function(){return kh(e),a(r)})}function xh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ii,baseState:ii,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:ii},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function kh(e){var t=xh(e);t.next===null&&(t=e.alternate.memoizedState),go(e,t.next.queue,{},oa())}function jp(){return Ct(Ao)}function Nh(){return pt().memoizedState}function Sh(){return pt().memoizedState}function Ey(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=oa();e=Rr(a);var r=Ur(t,e,a);r!==null&&(Vt(r,t,a),po(r,t,a)),t={cache:Sp()},e.payload=t;return}t=t.return}}function My(e,t,a){var r=oa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Rs(e)?qh(t,a):(a=_p(e,t,a,r),a!==null&&(Vt(a,e,r),Eh(a,t,r)))}function Ch(e,t,a){var r=oa();go(e,t,a,r)}function go(e,t,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))qh(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,a);if(n.hasEagerState=!0,n.eagerState=l,la(l,o))return Es(e,t,n,0),$e===null&&qs(),!1}catch{}if(a=_p(e,t,n,r),a!==null)return Vt(a,e,r),Eh(a,t,r),!0}return!1}function Qp(e,t,a,r){if(r={lane:2,revertLane:Pp(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(B(479))}else t=_p(e,a,r,2),t!==null&&Vt(t,e,2)}function Rs(e){var t=e.alternate;return e===he||t!==null&&t===he}function qh(e,t){nn=os=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Eh(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,mg(e,a)}}var Mo={readContext:Ct,use:zs,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Mo.useEffectEvent=ot;var Mh={readContext:Ct,use:zs,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:df,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,jl(4194308,4,hh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return jl(4194308,4,e,t)},useInsertionEffect:function(e,t){jl(4,2,e,t)},useMemo:function(e,t){var a=Dt();t=t===void 0?null:t;var r=e();if(di){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Dt();if(a!==void 0){var n=a(t);if(di){Cr(!0);try{a(t)}finally{Cr(!1)}}}else n=t;return r.memoizedState=r.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=My.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Hu(e);var t=e.queue,a=Ch.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Lp,useDeferredValue:function(e,t){var a=Dt();return Hp(a,e,t)},useTransition:function(){var e=Hu(!1);return e=_h.bind(null,he,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=he,n=Dt();if(Ee){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),$e===null)throw Error(B(349));(qe&127)!==0||ah(r,t,a)}n.memoizedState=a;var i={value:a,getSnapshot:t};return n.queue=i,df(ih.bind(null,r,i,e),[e]),r.flags|=2048,dn(9,{destroy:void 0},rh.bind(null,r,i,a,t),null),a},useId:function(){var e=Dt(),t=$e.identifierPrefix;if(Ee){var a=Ba,r=Da;a=(r&~(1<<32-na(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ls++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=xy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:jp,useFormState:cf,useActionState:cf,useOptimistic:function(e){var t=Dt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Qp.bind(null,he,!0,a),a.dispatch=t,[e,t]},useMemoCache:Dp,useCacheRefresh:function(){return Dt().memoizedState=Ey.bind(null,he)},useEffectEvent:function(e){var t=Dt(),a={impl:e};return t.memoizedState=a,function(){if((Ue&2)!==0)throw Error(B(440));return a.impl.apply(void 0,arguments)}}},Gp={readContext:Ct,use:zs,useCallback:vh,useContext:Ct,useEffect:Op,useImperativeHandle:bh,useInsertionEffect:fh,useLayoutEffect:gh,useMemo:wh,useReducer:Hl,useRef:dh,useState:function(){return Hl(lr)},useDebugValue:Lp,useDeferredValue:function(e,t){var a=pt();return yh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Hl(lr)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Go(e),t]},useSyncExternalStore:th,useId:Nh,useHostTransitionStatus:jp,useFormState:uf,useActionState:uf,useOptimistic:function(e,t){var a=pt();return lh(a,Ge,e,t)},useMemoCache:Dp,useCacheRefresh:Sh};Gp.useEffectEvent=mh;var Th={readContext:Ct,use:zs,useCallback:vh,useContext:Ct,useEffect:Op,useImperativeHandle:bh,useInsertionEffect:fh,useLayoutEffect:gh,useMemo:wh,useReducer:Jc,useRef:dh,useState:function(){return Jc(lr)},useDebugValue:Lp,useDeferredValue:function(e,t){var a=pt();return Ge===null?Hp(a,e,t):yh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Jc(lr)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Go(e),t]},useSyncExternalStore:th,useId:Nh,useHostTransitionStatus:jp,useFormState:pf,useActionState:pf,useOptimistic:function(e,t){var a=pt();return Ge!==null?lh(a,Ge,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Dp,useCacheRefresh:Sh};Th.useEffectEvent=mh;function Pc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:We({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Gu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=oa(),n=Rr(r);n.payload=t,a!=null&&(n.callback=a),t=Ur(e,n,r),t!==null&&(Vt(t,e,r),po(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=oa(),n=Rr(r);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Ur(e,n,r),t!==null&&(Vt(t,e,r),po(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=oa(),r=Rr(a);r.tag=2,t!=null&&(r.callback=t),t=Ur(e,r,a),t!==null&&(Vt(t,e,a),po(t,e,a))}};function mf(e,t,a,r,n,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!No(a,r)||!No(n,i):!0}function ff(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&&Gu.enqueueReplaceState(t,t.state,null)}function mi(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=We({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function zh(e){Wl(e)}function Ah(e){console.error(e)}function Rh(e){Wl(e)}function ss(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function gf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Yu(e,t,a){return a=Rr(a),a.tag=3,a.payload={element:null},a.callback=function(){ss(e,t)},a}function Uh(e){return e=Rr(e),e.tag=3,e}function Dh(e,t,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var i=r.value;e.payload=function(){return n(i)},e.callback=function(){gf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){gf(t,a,r),typeof n!="function"&&(Dr===null?Dr=new Set([this]):Dr.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Ty(e,t,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&yn(t,a,n,!0),a=sa.current,a!==null){switch(a.tag){case 31:case 13:return va===null?ms():a.alternate===null&<===0&&(lt=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),lu(e,r,n)),!1;case 22:return a.flags|=65536,r===rs?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)),lu(e,r,n)),!1}throw Error(B(435,a.tag))}return lu(e,r,n),ms(),!1}if(Ee)return t=sa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,r!==Tu&&(e=Error(B(422),{cause:r}),Co(ha(e,a)))):(r!==Tu&&(t=Error(B(423),{cause:r}),Co(ha(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,r=ha(r,a),n=Yu(e.stateNode,r,n),Kc(e,n),lt!==4&&(lt=2)),!1;var i=Error(B(520),{cause:r});if(i=ha(i,a),vo===null?vo=[i]:vo.push(i),lt!==4&&(lt=2),t===null)return!0;r=ha(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=Yu(a.stateNode,r,e),Kc(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Dr===null||!Dr.has(i))))return a.flags|=65536,n&=-n,a.lanes|=n,n=Uh(n),Dh(n,e,a,r),Kc(a,n),!1}a=a.return}while(a!==null);return!1}var Yp=Error(B(461)),ht=!1;function kt(e,t,a,r){t.child=e===null?Jg(t,null,a,r):pi(t,e.child,a,r)}function hf(e,t,a,r,n){a=a.render;var i=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return ui(t),r=zp(e,t,a,o,i,n),l=Ap(),e!==null&&!ht?(Rp(e,t,n),sr(e,t,n)):(Ee&&l&&kp(t),t.flags|=1,kt(e,t,r,n),t.child)}function bf(e,t,a,r,n){if(e===null){var i=a.type;return typeof i=="function"&&!xp(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Bh(e,t,i,r,n)):(e=Ol(a.type,null,r,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Vp(e,n)){var o=i.memoizedProps;if(a=a.compare,a=a!==null?a:No,a(o,r)&&e.ref===t.ref)return sr(e,t,n)}return t.flags|=1,e=ar(i,r),e.ref=t.ref,e.return=t,t.child=e}function Bh(e,t,a,r,n){if(e!==null){var i=e.memoizedProps;if(No(i,r)&&e.ref===t.ref)if(ht=!1,t.pendingProps=r=i,Vp(e,n))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,sr(e,t,n)}return Vu(e,t,a,r,n)}function Oh(e,t,a,r){var n=r.children,i=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(i=i!==null?i.baseLanes|a:a,e!==null){for(r=t.child=e.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~i}else r=0,t.child=null;return vf(e,t,i,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ll(t,i!==null?i.cachePool:null),i!==null?of(t,i):Ou(),Ig(t);else return r=t.lanes=536870912,vf(e,t,i!==null?i.baseLanes|a:a,a,r)}else i!==null?(Ll(t,i.cachePool),of(t,i),Nr(t),t.memoizedState=null):(e!==null&&Ll(t,null),Ou(),Nr(t));return kt(e,t,n,a),t.child}function no(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,n){var i=Cp();return i=i===null?null:{parent:gt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Ll(t,null),Ou(),Ig(t),e!==null&&yn(e,t,r,!0),t.childLanes=n,null}function Ql(e,t){return t=cs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wf(e,t,a){return pi(t,e.child,null,a),e=Ql(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function zy(e,t,a){var r=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(r.mode==="hidden")return e=Ql(t,r),t.lanes=536870912,no(null,e);if(Lu(t),(e=Ie)?(e=Mb(e,ba),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Gg(e),a.return=t,t.child=a,St=t,Ie=null)):e=null,e===null)throw Qr(t);return t.lanes=536870912,null}return Ql(t,r)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(Lu(t),n)if(t.flags&256)t.flags&=-257,t=wf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(ht||yn(e,t,a,!1),n=(a&e.childLanes)!==0,ht||n){if(r=$e,r!==null&&(o=fg(r,a),o!==0&&o!==i.retryLane))throw i.retryLane=o,bi(e,o),Vt(r,e,o),Yp;ms(),t=wf(e,t,a)}else e=i.treeContext,Ie=wa(o.nextSibling),St=t,Ee=!0,Ar=null,ba=!1,e!==null&&Vg(t,e),t=Ql(t,r),t.flags|=4096;return t}return e=ar(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gl(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(B(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Vu(e,t,a,r,n){return ui(t),a=zp(e,t,a,r,void 0,n),r=Ap(),e!==null&&!ht?(Rp(e,t,n),sr(e,t,n)):(Ee&&r&&kp(t),t.flags|=1,kt(e,t,a,n),t.child)}function yf(e,t,a,r,n,i){return ui(t),t.updateQueue=null,a=eh(t,r,a,n),Wg(e),r=Ap(),e!==null&&!ht?(Rp(e,t,i),sr(e,t,i)):(Ee&&r&&kp(t),t.flags|=1,kt(e,t,a,i),t.child)}function _f(e,t,a,r,n){if(ui(t),t.stateNode===null){var i=Ji,o=a.contextType;typeof o=="object"&&o!==null&&(i=Ct(o)),i=new a(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Gu,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},Ep(t),o=a.contextType,i.context=typeof o=="object"&&o!==null?Ct(o):Ji,i.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(Pc(t,a,o,r),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&Gu.enqueueReplaceState(i,i.state,null),fo(t,r,i,n),mo(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=mi(a,l);i.props=c;var p=i.context,f=a.contextType;o=Ji,typeof f=="object"&&f!==null&&(o=Ct(f));var b=a.getDerivedStateFromProps;f=typeof b=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||p!==o)&&ff(t,i,r,o),_r=!1;var d=t.memoizedState;i.state=d,fo(t,r,i,n),mo(),p=t.memoizedState,l||d!==p||_r?(typeof b=="function"&&(Pc(t,a,b,r),p=t.memoizedState),(c=_r||mf(t,a,c,r,d,p,o))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=o,r=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Du(e,t),o=t.memoizedProps,f=mi(a,o),i.props=f,b=t.pendingProps,d=i.context,p=a.contextType,c=Ji,typeof p=="object"&&p!==null&&(c=Ct(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==b||d!==c)&&ff(t,i,r,c),_r=!1,d=t.memoizedState,i.state=d,fo(t,r,i,n),mo();var h=t.memoizedState;o!==b||d!==h||_r||e!==null&&e.dependencies!==null&&as(e.dependencies)?(typeof l=="function"&&(Pc(t,a,l,r),h=t.memoizedState),(f=_r||mf(t,a,f,r,d,h,c)||e!==null&&e.dependencies!==null&&as(e.dependencies))?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,h,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,h,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=c,r=f):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,Gl(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=pi(t,e.child,null,n),t.child=pi(t,null,a,n)):kt(e,t,a,n),t.memoizedState=i.state,e=t.child):e=sr(e,t,n),e}function xf(e,t,a,r){return ci(),t.flags|=256,kt(e,t,a,r),t.child}var Fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ic(e){return{baseLanes:e,cachePool:$g()}}function Wc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=aa),e}function Lh(e,t,a){var r=t.pendingProps,n=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(ut.current&2)!==0),o&&(n=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(n?kr(t):Nr(t),(e=Ie)?(e=Mb(e,ba),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Gg(e),a.return=t,t.child=a,St=t,Ie=null)):e=null,e===null)throw Qr(t);return ip(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,n?(Nr(t),n=t.mode,l=cs({mode:"hidden",children:l},n),r=ni(r,n,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=Ic(a),r.childLanes=Wc(e,o,a),t.memoizedState=Fc,no(null,r)):(kr(t),Xu(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(kr(t),t.flags&=-257,t=eu(e,t,a)):t.memoizedState!==null?(Nr(t),t.child=e.child,t.flags|=128,t=null):(Nr(t),l=r.fallback,n=t.mode,r=cs({mode:"visible",children:r.children},n),l=ni(l,n,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,pi(t,e.child,null,a),r=t.child,r.memoizedState=Ic(a),r.childLanes=Wc(e,o,a),t.memoizedState=Fc,t=no(null,r));else if(kr(t),ip(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(B(419)),r.stack="",r.digest=o,Co({value:r,source:null,stack:null}),t=eu(e,t,a)}else if(ht||yn(e,t,a,!1),o=(a&e.childLanes)!==0,ht||o){if(o=$e,o!==null&&(r=fg(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,bi(e,r),Vt(o,e,r),Yp;rp(l)||ms(),t=eu(e,t,a)}else rp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Ie=wa(l.nextSibling),St=t,Ee=!0,Ar=null,ba=!1,e!==null&&Vg(t,e),t=Xu(t,r.children),t.flags|=4096);return t}return n?(Nr(t),l=r.fallback,n=t.mode,c=e.child,p=c.sibling,r=ar(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=ar(p,l):(l=ni(l,n,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,no(null,r),r=t.child,l=e.child.memoizedState,l===null?l=Ic(a):(n=l.cachePool,n!==null?(c=gt._currentValue,n=n.parent!==c?{parent:c,pool:c}:n):n=$g(),l={baseLanes:l.baseLanes|a,cachePool:n}),r.memoizedState=l,r.childLanes=Wc(e,o,a),t.memoizedState=Fc,no(e.child,r)):(kr(t),a=e.child,e=a.sibling,a=ar(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 Xu(e,t){return t=cs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function cs(e,t){return e=ta(22,e,null,t),e.lanes=0,e}function eu(e,t,a){return pi(t,e.child,null,a),e=Xu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Au(e.return,t,a)}function tu(e,t,a,r,n,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=n,o.treeForkCount=i)}function Hh(e,t,a){var r=t.pendingProps,n=r.revealOrder,i=r.tail;r=r.children;var o=ut.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Ke(ut,o),kt(e,t,r,a),r=Ee?So:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kf(e,a,t);else if(e.tag===19)kf(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(n){case"forwards":for(a=t.child,n=null;a!==null;)e=a.alternate,e!==null&&ns(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),tu(t,!1,n,a,i,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&ns(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}tu(t,!0,a,null,i,r);break;case"together":tu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Yr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(yn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,a=ar(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ar(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Vp(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&as(e)))}function Ay(e,t,a){switch(t.tag){case 3:Jl(t,t.stateNode.containerInfo),xr(t,gt,e.memoizedState.cache),ci();break;case 27:case 5:wu(t);break;case 4:Jl(t,t.stateNode.containerInfo);break;case 10:xr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(kr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Lh(e,t,a):(kr(t),e=sr(e,t,a),e!==null?e.sibling:null);kr(t);break;case 19:var n=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(yn(e,t,a,!1),r=(a&t.childLanes)!==0),n){if(r)return Hh(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Ke(ut,ut.current),r)break;return null;case 22:return t.lanes=0,Oh(e,t,a,t.pendingProps);case 24:xr(t,gt,e.memoizedState.cache)}return sr(e,t,a)}function jh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!Vp(e,a)&&(t.flags&128)===0)return ht=!1,Ay(e,t,a);ht=(e.flags&131072)!==0}else ht=!1,Ee&&(t.flags&1048576)!==0&&Yg(t,So,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ai(t.elementType),t.type=e,typeof e=="function")xp(e)?(r=mi(e,r),t.tag=1,t=_f(null,t,e,r,a)):(t.tag=0,t=Vu(null,t,e,r,a));else{if(e!=null){var n=e.$$typeof;if(n===sp){t.tag=11,t=hf(null,t,e,r,a);break e}else if(n===cp){t.tag=14,t=bf(null,t,e,r,a);break e}}throw t=bu(e)||e,Error(B(306,t,""))}}return t;case 0:return Vu(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,n=mi(r,t.pendingProps),_f(e,t,r,n,a);case 3:e:{if(Jl(t,t.stateNode.containerInfo),e===null)throw Error(B(387));r=t.pendingProps;var i=t.memoizedState;n=i.element,Du(e,t),fo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,xr(t,gt,r),r!==i.cache&&Ru(t,[gt],a,!0),mo(),r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=xf(e,t,r,a);break e}else if(r!==n){n=ha(Error(B(424)),t),Co(n),t=xf(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,Ie=wa(e.firstChild),St=t,Ee=!0,Ar=null,ba=!0,a=Jg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ci(),r===n){t=sr(e,t,a);break e}kt(e,t,r,a)}t=t.child}return t;case 26:return Gl(e,t),e===null?(a=Xf(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ee||(a=t.type,e=t.pendingProps,r=bs(zr.current).createElement(a),r[Nt]=t,r[Xt]=e,qt(r,a,e),_t(r),t.stateNode=r):t.memoizedState=Xf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return wu(t),e===null&&Ee&&(r=t.stateNode=Tb(t.type,t.pendingProps,zr.current),St=t,ba=!0,n=Ie,Xr(t.type)?(np=n,Ie=wa(r.firstChild)):Ie=n),kt(e,t,t.pendingProps.children,a),Gl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((n=r=Ie)&&(r=o1(r,t.type,t.pendingProps,ba),r!==null?(t.stateNode=r,St=t,Ie=wa(r.firstChild),ba=!1,n=!0):n=!1),n||Qr(t)),wu(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,r=i.children,tp(n,i)?r=null:o!==null&&tp(n,o)&&(t.flags|=32),t.memoizedState!==null&&(n=zp(e,t,ky,null,null,a),Ao._currentValue=n),Gl(e,t),kt(e,t,r,a),t.child;case 6:return e===null&&Ee&&((e=a=Ie)&&(a=l1(a,t.pendingProps,ba),a!==null?(t.stateNode=a,St=t,Ie=null,e=!0):e=!1),e||Qr(t)),null;case 13:return Lh(e,t,a);case 4:return Jl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pi(t,null,r,a):kt(e,t,r,a),t.child;case 11:return hf(e,t,t.type,t.pendingProps,a);case 7:return kt(e,t,t.pendingProps,a),t.child;case 8:return kt(e,t,t.pendingProps.children,a),t.child;case 12:return kt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,xr(t,t.type,r.value),kt(e,t,r.children,a),t.child;case 9:return n=t.type._context,r=t.pendingProps.children,ui(t),n=Ct(n),r=r(n),t.flags|=1,kt(e,t,r,a),t.child;case 14:return bf(e,t,t.type,t.pendingProps,a);case 15:return Bh(e,t,t.type,t.pendingProps,a);case 19:return Hh(e,t,a);case 31:return zy(e,t,a);case 22:return Oh(e,t,a,t.pendingProps);case 24:return ui(t),r=Ct(gt),e===null?(n=Cp(),n===null&&(n=$e,i=Sp(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=a),n=i),t.memoizedState={parent:r,cache:n},Ep(t),xr(t,gt,n)):((e.lanes&a)!==0&&(Du(e,t),fo(t,null,null,a),mo()),n=e.memoizedState,i=t.memoizedState,n.parent!==r?(n={parent:r,cache:r},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),xr(t,gt,r)):(r=i.cache,xr(t,gt,r),r!==n.cache&&Ru(t,[gt],a,!0))),kt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function Za(e){e.flags|=4}function au(e,t,a,r,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(ub())e.flags|=8192;else throw li=rs,qp}else e.flags&=-16777217}function Nf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rb(t))if(ub())e.flags|=8192;else throw li=rs,qp}function Cl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?pg():536870912,e.lanes|=t,mn|=t)}function In(e,t){if(!Ee)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 Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Ry(e,t,a){var r=t.pendingProps;switch(Np(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),rr(gt),ln(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?Za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zc())),Fe(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Za(t),i!==null?(Fe(t),Nf(t,i)):(Fe(t),au(t,n,null,r,a))):i?i!==e.memoizedState?(Za(t),Fe(t),Nf(t,i)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Za(t),Fe(t),au(t,n,e,r,a)),null;case 27:if(Pl(t),a=zr.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Fe(t),null}e=La.current,Oi(t)?Im(t,e):(e=Tb(n,r,a),t.stateNode=e,Za(t))}return Fe(t),null;case 5:if(Pl(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Fe(t),null}if(i=La.current,Oi(t))Im(t,i);else{var o=bs(zr.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?o.createElement(n,{is:r.is}):o.createElement(n)}}i[Nt]=t,i[Xt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.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=i;e:switch(qt(i,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Za(t)}}return Fe(t),au(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(e=zr.current,Oi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,n=St,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Cb(e.nodeValue,a)),e||Qr(t,!0)}else e=bs(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return Fe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Oi(t),a!==null){if(e===null){if(!r)throw Error(B(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(557));e[Nt]=t}else ci(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else a=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(B(558))}return Fe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Oi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(B(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(B(317));n[Nt]=t}else ci(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),n=!1}else n=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==n&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Cl(t,t.updateQueue),Fe(t),null);case 4:return ln(),e===null&&Fp(t.stateNode.containerInfo),Fe(t),null;case 10:return rr(t.type),Fe(t),null;case 19:if(xt(ut),r=t.memoizedState,r===null)return Fe(t),null;if(n=(t.flags&128)!==0,i=r.rendering,i===null)if(n)In(r,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=ns(e),i!==null){for(t.flags|=128,In(r,!1),e=i.updateQueue,t.updateQueue=e,Cl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Qg(a,e),a=a.sibling;return Ke(ut,ut.current&1|2),Ee&&Fa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ra()>ps&&(t.flags|=128,n=!0,In(r,!1),t.lanes=4194304)}else{if(!n)if(e=ns(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Cl(t,e),In(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Ee)return Fe(t),null}else 2*ra()-r.renderingStartTime>ps&&a!==536870912&&(t.flags|=128,n=!0,In(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ra(),e.sibling=null,a=ut.current,Ke(ut,n?a&1|2:a&1),Ee&&Fa(t,r.treeForkCount),e):(Fe(t),null);case 22:case 23:return ea(t),Mp(),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&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),a=t.updateQueue,a!==null&&Cl(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&&xt(oi),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),rr(gt),Fe(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function Uy(e,t){switch(Np(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rr(gt),ln(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pl(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(B(340));ci()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));ci()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(ut),null;case 4:return ln(),null;case 10:return rr(t.type),null;case 22:case 23:return ea(t),Mp(),e!==null&&xt(oi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return rr(gt),null;case 25:return null;default:return null}}function Qh(e,t){switch(Np(t),t.tag){case 3:rr(gt),ln();break;case 26:case 27:case 5:Pl(t);break;case 4:ln();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:xt(ut);break;case 10:rr(t.type);break;case 22:case 23:ea(t),Mp(),e!==null&&xt(oi);break;case 24:rr(gt)}}function Yo(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&e)===e){r=void 0;var i=a.create,o=a.inst;r=i(),o.destroy=r}a=a.next}while(a!==n)}}catch(l){Oe(t,t.return,l)}}function Gr(e,t,a){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var i=n.next;r=i;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,n=t;var c=a,p=l;try{p()}catch(f){Oe(n,c,f)}}}r=r.next}while(r!==i)}}catch(f){Oe(t,t.return,f)}}function Gh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Fg(t,a)}catch(r){Oe(e,e.return,r)}}}function Yh(e,t,a){a.props=mi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Oe(e,t,r)}}function ho(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(n){Oe(e,t,n)}}function Oa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Oe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Oe(e,t,n)}else a.current=null}function Vh(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(n){Oe(e,e.return,n)}}function ru(e,t,a){try{var r=e.stateNode;e1(r,e.type,a,t),r[Xt]=t}catch(n){Oe(e,e.return,n)}}function Xh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xr(e.type)||e.tag===4}function iu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xh(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&&Xr(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 $u(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=er));else if(r!==4&&(r===27&&Xr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for($u(e,t,a),e=e.sibling;e!==null;)$u(e,t,a),e=e.sibling}function us(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&&Xr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(us(e,t,a),e=e.sibling;e!==null;)us(e,t,a),e=e.sibling}function $h(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);qt(t,r,a),t[Nt]=e,t[Xt]=a}catch(i){Oe(e,e.return,i)}}var Ia=!1,ft=!1,nu=!1,Sf=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Dy(e,t){if(e=e.containerInfo,Wu=_s,e=Rg(e),wp(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 n=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,f=0,b=e,d=null;t:for(;;){for(var h;b!==a||n!==0&&b.nodeType!==3||(l=o+n),b!==i||r!==0&&b.nodeType!==3||(c=o+r),b.nodeType===3&&(o+=b.nodeValue.length),(h=b.firstChild)!==null;)d=b,b=h;for(;;){if(b===e)break t;if(d===a&&++p===n&&(l=o),d===i&&++f===r&&(c=o),(h=b.nextSibling)!==null)break;b=d,d=b.parentNode}b=h}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(ep={focusedElem:e,selectionRange:a},_s=!1,yt=t;yt!==null;)if(t=yt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,yt=e;else for(;yt!==null;){switch(t=yt,i=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++)n=e[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,n=i.memoizedProps,i=i.memoizedState,r=a.stateNode;try{var w=mi(a.type,n);e=r.getSnapshotBeforeUpdate(w,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(M){Oe(a,a.return,M)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)ap(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ap(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(B(163))}if(e=t.sibling,e!==null){e.return=t.return,yt=e;break}yt=t.return}}function Zh(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ja(e,a),r&4&&Yo(5,a);break;case 1:if(Ja(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Oe(a,a.return,o)}else{var n=mi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Oe(a,a.return,o)}}r&64&&Gh(a),r&512&&ho(a,a.return);break;case 3:if(Ja(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{Fg(e,t)}catch(o){Oe(a,a.return,o)}}break;case 27:t===null&&r&4&&$h(a);case 26:case 5:Ja(e,a),t===null&&r&4&&Vh(a),r&512&&ho(a,a.return);break;case 12:Ja(e,a);break;case 31:Ja(e,a),r&4&&Ph(e,a);break;case 13:Ja(e,a),r&4&&Fh(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Vy.bind(null,a),s1(e,a))));break;case 22:if(r=a.memoizedState!==null||Ia,!r){t=t!==null&&t.memoizedState!==null||ft,n=Ia;var i=ft;Ia=r,(ft=t)&&!i?Pa(e,a,(a.subtreeFlags&8772)!==0):Ja(e,a),Ia=n,ft=i}break;case 30:break;default:Ja(e,a)}}function Kh(e){var t=e.alternate;t!==null&&(e.alternate=null,Kh(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 rt=null,Gt=!1;function Ka(e,t,a){for(a=a.child;a!==null;)Jh(e,t,a),a=a.sibling}function Jh(e,t,a){if(ia&&typeof ia.onCommitFiberUnmount=="function")try{ia.onCommitFiberUnmount(Bo,a)}catch{}switch(a.tag){case 26:ft||Oa(a,t),Ka(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ft||Oa(a,t);var r=rt,n=Gt;Xr(a.type)&&(rt=a.stateNode,Gt=!1),Ka(e,t,a),yo(a.stateNode),rt=r,Gt=n;break;case 5:ft||Oa(a,t);case 6:if(r=rt,n=Gt,rt=null,Ka(e,t,a),rt=r,Gt=n,rt!==null)if(Gt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(a.stateNode)}catch(i){Oe(a,t,i)}else try{rt.removeChild(a.stateNode)}catch(i){Oe(a,t,i)}break;case 18:rt!==null&&(Gt?(e=rt,jf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),bn(e)):jf(rt,a.stateNode));break;case 4:r=rt,n=Gt,rt=a.stateNode.containerInfo,Gt=!0,Ka(e,t,a),rt=r,Gt=n;break;case 0:case 11:case 14:case 15:Gr(2,a,t),ft||Gr(4,a,t),Ka(e,t,a);break;case 1:ft||(Oa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Yh(a,t,r)),Ka(e,t,a);break;case 21:Ka(e,t,a);break;case 22:ft=(r=ft)||a.memoizedState!==null,Ka(e,t,a),ft=r;break;default:Ka(e,t,a)}}function Ph(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bn(e)}catch(a){Oe(t,t.return,a)}}}function Fh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bn(e)}catch(a){Oe(t,t.return,a)}}function By(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sf),t;default:throw Error(B(435,e.tag))}}function ql(e,t){var a=By(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var n=Xy.bind(null,e,r);r.then(n,n)}})}function jt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Xr(l.type)){rt=l.stateNode,Gt=!1;break e}break;case 5:rt=l.stateNode,Gt=!1;break e;case 3:case 4:rt=l.stateNode.containerInfo,Gt=!0;break e}l=l.return}if(rt===null)throw Error(B(160));Jh(i,o,n),rt=null,Gt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ih(t,e),t=t.sibling}var Ta=null;function Ih(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jt(t,e),Qt(e),r&4&&(Gr(3,e,e.return),Yo(3,e),Gr(5,e,e.return));break;case 1:jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),r&64&&Ia&&(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 n=Ta;if(jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),r&4){var i=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,n=n.ownerDocument||n;t:switch(r){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Ho]||i[Nt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(r),n.head.insertBefore(i,n.querySelector("head > title"))),qt(i,r,a),i[Nt]=e,_t(i),r=i;break e;case"link":var o=Zf("link","href",n).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;case"meta":if(o=Zf("meta","content",n).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;default:throw Error(B(468,r))}i[Nt]=e,_t(i),r=i}e.stateNode=r}else Kf(n,e.type,e.stateNode);else e.stateNode=$f(n,r,e.memoizedProps);else i!==r?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,r===null?Kf(n,e.type,e.stateNode):$f(n,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ru(e,e.memoizedProps,a.memoizedProps)}break;case 27:jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),a!==null&&r&4&&ru(e,e.memoizedProps,a.memoizedProps);break;case 5:if(jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),e.flags&32){n=e.stateNode;try{cn(n,"")}catch(w){Oe(e,e.return,w)}}r&4&&e.stateNode!=null&&(n=e.memoizedProps,ru(e,n,a!==null?a.memoizedProps:n)),r&1024&&(nu=!0);break;case 6:if(jt(t,e),Qt(e),r&4){if(e.stateNode===null)throw Error(B(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(w){Oe(e,e.return,w)}}break;case 3:if(Xl=null,n=Ta,Ta=vs(t.containerInfo),jt(t,e),Ta=n,Qt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(w){Oe(e,e.return,w)}nu&&(nu=!1,Wh(e));break;case 4:r=Ta,Ta=vs(e.stateNode.containerInfo),jt(t,e),Qt(e),Ta=r;break;case 12:jt(t,e),Qt(e);break;case 31:jt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ql(e,r)));break;case 13:jt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Us=ra()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ql(e,r)));break;case 22:n=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=Ia,f=ft;if(Ia=p||n,ft=f||c,jt(t,e),ft=f,Ia=p,Qt(e),r&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||c||Ia||ft||ri(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(i=c.stateNode,n)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var b=c.memoizedProps.style,d=b!=null&&b.hasOwnProperty("display")?b.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(w){Oe(c,c.return,w)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=n?"":c.memoizedProps}catch(w){Oe(c,c.return,w)}}}else if(t.tag===18){if(a===null){c=t;try{var h=c.stateNode;n?Qf(h,!0):Qf(c.stateNode,!1)}catch(w){Oe(c,c.return,w)}}}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,ql(e,a))));break;case 19:jt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ql(e,r)));break;case 30:break;case 21:break;default:jt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Xh(r)){a=r;break}r=r.return}if(a==null)throw Error(B(160));switch(a.tag){case 27:var n=a.stateNode,i=iu(e);us(e,i,n);break;case 5:var o=a.stateNode;a.flags&32&&(cn(o,""),a.flags&=-33);var l=iu(e);us(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=iu(e);$u(e,p,c);break;default:throw Error(B(161))}}catch(f){Oe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zh(e,t.alternate,t),t=t.sibling}function ri(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),ri(t);break;case 1:Oa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Yh(t,t.return,a),ri(t);break;case 27:yo(t.stateNode);case 26:case 5:Oa(t,t.return),ri(t);break;case 22:t.memoizedState===null&&ri(t);break;case 30:ri(t);break;default:ri(t)}e=e.sibling}}function Pa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,n=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Pa(n,i,a),Yo(4,i);break;case 1:if(Pa(n,i,a),r=i,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(p){Oe(r,r.return,p)}if(r=i,n=r.updateQueue,n!==null){var l=r.stateNode;try{var c=n.shared.hiddenCallbacks;if(c!==null)for(n.shared.hiddenCallbacks=null,n=0;n<c.length;n++)Pg(c[n],l)}catch(p){Oe(r,r.return,p)}}a&&o&64&&Gh(i),ho(i,i.return);break;case 27:$h(i);case 26:case 5:Pa(n,i,a),a&&r===null&&o&4&&Vh(i),ho(i,i.return);break;case 12:Pa(n,i,a);break;case 31:Pa(n,i,a),a&&o&4&&Ph(n,i);break;case 13:Pa(n,i,a),a&&o&4&&Fh(n,i);break;case 22:i.memoizedState===null&&Pa(n,i,a),ho(i,i.return);break;case 30:break;default:Pa(n,i,a)}t=t.sibling}}function Xp(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&&Qo(a))}function $p(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qo(e))}function Ma(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)eb(e,t,a,r),t=t.sibling}function eb(e,t,a,r){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ma(e,t,a,r),n&2048&&Yo(9,t);break;case 1:Ma(e,t,a,r);break;case 3:Ma(e,t,a,r),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qo(e)));break;case 12:if(n&2048){Ma(e,t,a,r),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Oe(t,t.return,c)}}else Ma(e,t,a,r);break;case 31:Ma(e,t,a,r);break;case 13:Ma(e,t,a,r);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Ma(e,t,a,r):bo(e,t):i._visibility&2?Ma(e,t,a,r):(i._visibility|=2,Hi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Xp(o,t);break;case 24:Ma(e,t,a,r),n&2048&&$p(t.alternate,t);break;default:Ma(e,t,a,r)}}function Hi(e,t,a,r,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Hi(i,o,l,c,n),Yo(8,o);break;case 23:break;case 22:var f=o.stateNode;o.memoizedState!==null?f._visibility&2?Hi(i,o,l,c,n):bo(i,o):(f._visibility|=2,Hi(i,o,l,c,n)),n&&p&2048&&Xp(o.alternate,o);break;case 24:Hi(i,o,l,c,n),n&&p&2048&&$p(o.alternate,o);break;default:Hi(i,o,l,c,n)}t=t.sibling}}function bo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,n=r.flags;switch(r.tag){case 22:bo(a,r),n&2048&&Xp(r.alternate,r);break;case 24:bo(a,r),n&2048&&$p(r.alternate,r);break;default:bo(a,r)}t=t.sibling}}var oo=8192;function Li(e,t,a){if(e.subtreeFlags&oo)for(e=e.child;e!==null;)tb(e,t,a),e=e.sibling}function tb(e,t,a){switch(e.tag){case 26:Li(e,t,a),e.flags&oo&&e.memoizedState!==null&&y1(a,Ta,e.memoizedState,e.memoizedProps);break;case 5:Li(e,t,a);break;case 3:case 4:var r=Ta;Ta=vs(e.stateNode.containerInfo),Li(e,t,a),Ta=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=oo,oo=16777216,Li(e,t,a),oo=r):Li(e,t,a));break;default:Li(e,t,a)}}function ab(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 Wn(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];yt=r,ib(r,e)}ab(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rb(e),e=e.sibling}function rb(e){switch(e.tag){case 0:case 11:case 15:Wn(e),e.flags&2048&&Gr(9,e,e.return);break;case 3:Wn(e);break;case 12:Wn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yl(e)):Wn(e);break;default:Wn(e)}}function Yl(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];yt=r,ib(r,e)}ab(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gr(8,t,t.return),Yl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Yl(t));break;default:Yl(t)}e=e.sibling}}function ib(e,t){for(;yt!==null;){var a=yt;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:Qo(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,yt=r;else e:for(a=e;yt!==null;){r=yt;var n=r.sibling,i=r.return;if(Kh(r),r===a){yt=null;break e}if(n!==null){n.return=i,yt=n;break e}yt=i}}}var Oy={getCacheForType:function(e){var t=Ct(gt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ct(gt).controller.signal}},Ly=typeof WeakMap=="function"?WeakMap:Map,Ue=0,$e=null,Ne=null,qe=0,Be=0,Wt=null,Er=!1,xn=!1,Zp=!1,cr=0,lt=0,Yr=0,si=0,Kp=0,aa=0,mn=0,vo=null,Yt=null,Zu=!1,Us=0,nb=0,ps=1/0,ds=null,Dr=null,bt=0,Br=null,fn=null,ir=0,Ku=0,Ju=null,ob=null,wo=0,Pu=null;function oa(){return(Ue&2)!==0&&qe!==0?qe&-qe:de.T!==null?Pp():gg()}function lb(){if(aa===0)if((qe&536870912)===0||Ee){var e=bl;bl<<=1,(bl&3932160)===0&&(bl=262144),aa=e}else aa=536870912;return e=sa.current,e!==null&&(e.flags|=32),aa}function Vt(e,t,a){(e===$e&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(gn(e,0),Mr(e,qe,aa,!1)),Lo(e,a),((Ue&2)===0||e!==$e)&&(e===$e&&((Ue&2)===0&&(si|=a),lt===4&&Mr(e,qe,aa,!1)),ja(e))}function sb(e,t,a){if((Ue&6)!==0)throw Error(B(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Oo(e,t),n=r?Qy(e,t):ou(e,t,!0),i=r;do{if(n===0){xn&&!r&&Mr(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Hy(a)){n=ou(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)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;n=vo;var c=l.current.memoizedState.isDehydrated;if(c&&(gn(l,o).flags|=256),o=ou(l,o,!1),o!==2){if(Zp&&!c){l.errorRecoveryDisabledLanes|=i,si|=i,n=4;break e}i=Yt,Yt=n,i!==null&&(Yt===null?Yt=i:Yt.push.apply(Yt,i))}n=o}if(i=!1,n!==2)continue}}if(n===1){gn(e,0),Mr(e,t,0,!0);break}e:{switch(r=e,i=n,i){case 0:case 1:throw Error(B(345));case 4:if((t&4194048)!==t)break;case 6:Mr(r,t,aa,!Er);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(n=Us+300-ra(),10<n)){if(Mr(r,t,aa,!Er),ks(r,0,!0)!==0)break e;ir=t,r.timeoutHandle=Eb(Cf.bind(null,r,a,Yt,ds,Zu,t,aa,si,mn,Er,i,"Throttled",-0,0),n);break e}Cf(r,a,Yt,ds,Zu,t,aa,si,mn,Er,i,null,-0,0)}}break}while(!0);ja(e)}function Cf(e,t,a,r,n,i,o,l,c,p,f,b,d,h){if(e.timeoutHandle=-1,b=t.subtreeFlags,b&8192||(b&16785408)===16785408){b={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:er},tb(t,i,b);var w=(i&62914560)===i?Us-ra():(i&4194048)===i?nb-ra():0;if(w=_1(b,w),w!==null){ir=i,e.cancelPendingCommit=w(Ef.bind(null,e,t,i,a,r,n,o,l,c,f,b,null,d,h)),Mr(e,i,o,!p);return}}Ef(e,t,i,a,r,n,o,l,c)}function Hy(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 n=a[r],i=n.getSnapshot;n=n.value;try{if(!la(i(),n))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 Mr(e,t,a,r){t&=~Kp,t&=~si,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var n=t;0<n;){var i=31-na(n),o=1<<i;r[i]=-1,n&=~o}a!==0&&dg(e,a,t)}function Ds(){return(Ue&6)===0?(Vo(0,!1),!1):!0}function Jp(){if(Ne!==null){if(Be===0)var e=Ne.return;else e=Ne,tr=vi=null,Up(e),rn=null,qo=0,e=Ne;for(;e!==null;)Qh(e.alternate,e),e=e.return;Ne=null}}function gn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,r1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ir=0,Jp(),$e=e,Ne=a=ar(e.current,null),qe=t,Be=0,Wt=null,Er=!1,xn=Oo(e,t),Zp=!1,mn=aa=Kp=si=Yr=lt=0,Yt=vo=null,Zu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var n=31-na(r),i=1<<n;t|=e[n],r&=~i}return cr=t,qs(),a}function cb(e,t){he=null,de.H=Mo,t===_n||t===Ms?(t=rf(),Be=3):t===qp?(t=rf(),Be=4):Be=t===Yp?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,Ne===null&&(lt=1,ss(e,ha(t,e.current)))}function ub(){var e=sa.current;return e===null?!0:(qe&4194048)===qe?va===null:(qe&62914560)===qe||(qe&536870912)!==0?e===va:!1}function pb(){var e=de.H;return de.H=Mo,e===null?Mo:e}function db(){var e=de.A;return de.A=Oy,e}function ms(){lt=4,Er||(qe&4194048)!==qe&&sa.current!==null||(xn=!0),(Yr&134217727)===0&&(si&134217727)===0||$e===null||Mr($e,qe,aa,!1)}function ou(e,t,a){var r=Ue;Ue|=2;var n=pb(),i=db();($e!==e||qe!==t)&&(ds=null,gn(e,t)),t=!1;var o=lt;e:do try{if(Be!==0&&Ne!==null){var l=Ne,c=Wt;switch(Be){case 8:Jp(),o=6;break e;case 3:case 2:case 9:case 6:sa.current===null&&(t=!0);var p=Be;if(Be=0,Wt=null,Ii(e,l,c,p),a&&xn){o=0;break e}break;default:p=Be,Be=0,Wt=null,Ii(e,l,c,p)}}jy(),o=lt;break}catch(f){cb(e,f)}while(!0);return t&&e.shellSuspendCounter++,tr=vi=null,Ue=r,de.H=n,de.A=i,Ne===null&&($e=null,qe=0,qs()),o}function jy(){for(;Ne!==null;)mb(Ne)}function Qy(e,t){var a=Ue;Ue|=2;var r=pb(),n=db();$e!==e||qe!==t?(ds=null,ps=ra()+500,gn(e,t)):xn=Oo(e,t);e:do try{if(Be!==0&&Ne!==null){t=Ne;var i=Wt;t:switch(Be){case 1:Be=0,Wt=null,Ii(e,t,i,1);break;case 2:case 9:if(af(i)){Be=0,Wt=null,qf(t);break}t=function(){Be!==2&&Be!==9||$e!==e||(Be=7),ja(e)},i.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:af(i)?(Be=0,Wt=null,qf(t)):(Be=0,Wt=null,Ii(e,t,i,7));break;case 5:var o=null;switch(Ne.tag){case 26:o=Ne.memoizedState;case 5:case 27:var l=Ne;if(o?Rb(o):l.stateNode.complete){Be=0,Wt=null;var c=l.sibling;if(c!==null)Ne=c;else{var p=l.return;p!==null?(Ne=p,Bs(p)):Ne=null}break t}}Be=0,Wt=null,Ii(e,t,i,5);break;case 6:Be=0,Wt=null,Ii(e,t,i,6);break;case 8:Jp(),lt=6;break e;default:throw Error(B(462))}}Gy();break}catch(f){cb(e,f)}while(!0);return tr=vi=null,de.H=r,de.A=n,Ue=a,Ne!==null?0:($e=null,qe=0,qs(),lt)}function Gy(){for(;Ne!==null&&!p0();)mb(Ne)}function mb(e){var t=jh(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?Bs(e):Ne=t}function qf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=yf(a,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=yf(a,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Up(t);default:Qh(a,t),t=Ne=Qg(t,cr),t=jh(a,t,cr)}e.memoizedProps=e.pendingProps,t===null?Bs(e):Ne=t}function Ii(e,t,a,r){tr=vi=null,Up(t),rn=null,qo=0;var n=t.return;try{if(Ty(e,n,t,a,qe)){lt=1,ss(e,ha(a,e.current)),Ne=null;return}}catch(i){if(n!==null)throw Ne=n,i;lt=1,ss(e,ha(a,e.current)),Ne=null;return}t.flags&32768?(Ee||r===1?e=!0:xn||(qe&536870912)!==0?e=!1:(Er=e=!0,(r===2||r===9||r===3||r===6)&&(r=sa.current,r!==null&&r.tag===13&&(r.flags|=16384))),fb(t,e)):Bs(t)}function Bs(e){var t=e;do{if((t.flags&32768)!==0){fb(t,Er);return}e=t.return;var a=Ry(t.alternate,t,cr);if(a!==null){Ne=a;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);lt===0&&(lt=5)}function fb(e,t){do{var a=Uy(e.alternate,e);if(a!==null){a.flags&=32767,Ne=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=a}while(e!==null);lt=6,Ne=null}function Ef(e,t,a,r,n,i,o,l,c){e.cancelPendingCommit=null;do Os();while(bt!==0);if((Ue&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));if(i=t.lanes|t.childLanes,i|=yp,_0(e,a,i,o,l,c),e===$e&&(Ne=$e=null,qe=0),fn=t,Br=e,ir=a,Ku=i,Ju=n,ob=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$y(Fl,function(){return wb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=de.T,de.T=null,n=De.p,De.p=2,o=Ue,Ue|=4;try{Dy(e,t,a)}finally{Ue=o,De.p=n,de.T=r}}bt=1,gb(),hb(),bb()}}function gb(){if(bt===1){bt=0;var e=Br,t=fn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=de.T,de.T=null;var r=De.p;De.p=2;var n=Ue;Ue|=4;try{Ih(t,e);var i=ep,o=Rg(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&Ag(l.ownerDocument.documentElement,l)){if(c!==null&&wp(l)){var p=c.start,f=c.end;if(f===void 0&&(f=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(f,l.value.length);else{var b=l.ownerDocument||document,d=b&&b.defaultView||window;if(d.getSelection){var h=d.getSelection(),w=l.textContent.length,M=Math.min(c.start,w),D=c.end===void 0?M:Math.min(c.end,w);!h.extend&&M>D&&(o=D,D=M,M=o);var m=Jm(l,M),u=Jm(l,D);if(m&&u&&(h.rangeCount!==1||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==u.node||h.focusOffset!==u.offset)){var g=b.createRange();g.setStart(m.node,m.offset),h.removeAllRanges(),M>D?(h.addRange(g),h.extend(u.node,u.offset)):(g.setEnd(u.node,u.offset),h.addRange(g))}}}}for(b=[],h=l;h=h.parentNode;)h.nodeType===1&&b.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<b.length;l++){var v=b[l];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}_s=!!Wu,ep=Wu=null}finally{Ue=n,De.p=r,de.T=a}}e.current=t,bt=2}}function hb(){if(bt===2){bt=0;var e=Br,t=fn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=de.T,de.T=null;var r=De.p;De.p=2;var n=Ue;Ue|=4;try{Zh(e,t.alternate,t)}finally{Ue=n,De.p=r,de.T=a}}bt=3}}function bb(){if(bt===4||bt===3){bt=0,d0();var e=Br,t=fn,a=ir,r=ob;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?bt=5:(bt=0,fn=Br=null,vb(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Dr=null),dp(a),t=t.stateNode,ia&&typeof ia.onCommitFiberRoot=="function")try{ia.onCommitFiberRoot(Bo,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=de.T,n=De.p,De.p=2,de.T=null;try{for(var i=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];i(l.value,{componentStack:l.stack})}}finally{de.T=t,De.p=n}}(ir&3)!==0&&Os(),ja(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===Pu?wo++:(wo=0,Pu=e):wo=0,Vo(0,!1)}}function vb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qo(t)))}function Os(){return gb(),hb(),bb(),wb()}function wb(){if(bt!==5)return!1;var e=Br,t=Ku;Ku=0;var a=dp(ir),r=de.T,n=De.p;try{De.p=32>a?32:a,de.T=null,a=Ju,Ju=null;var i=Br,o=ir;if(bt=0,fn=Br=null,ir=0,(Ue&6)!==0)throw Error(B(331));var l=Ue;if(Ue|=4,rb(i.current),eb(i,i.current,o,a),Ue=l,Vo(0,!1),ia&&typeof ia.onPostCommitFiberRoot=="function")try{ia.onPostCommitFiberRoot(Bo,i)}catch{}return!0}finally{De.p=n,de.T=r,vb(e,t)}}function Mf(e,t,a){t=ha(a,t),t=Yu(e.stateNode,t,2),e=Ur(e,t,2),e!==null&&(Lo(e,2),ja(e))}function Oe(e,t,a){if(e.tag===3)Mf(e,e,a);else for(;t!==null;){if(t.tag===3){Mf(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dr===null||!Dr.has(r))){e=ha(a,e),a=Uh(2),r=Ur(t,a,2),r!==null&&(Dh(a,r,t,e),Lo(r,2),ja(r));break}}t=t.return}}function lu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Ly;var n=new Set;r.set(t,n)}else n=r.get(t),n===void 0&&(n=new Set,r.set(t,n));n.has(a)||(Zp=!0,n.add(a),e=Yy.bind(null,e,t,a),t.then(e,e))}function Yy(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(qe&a)===a&&(lt===4||lt===3&&(qe&62914560)===qe&&300>ra()-Us?(Ue&2)===0&&gn(e,0):Kp|=a,mn===qe&&(mn=0)),ja(e)}function yb(e,t){t===0&&(t=pg()),e=bi(e,t),e!==null&&(Lo(e,t),ja(e))}function Vy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),yb(e,a)}function Xy(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(B(314))}r!==null&&r.delete(t),yb(e,a)}function $y(e,t){return up(e,t)}var fs=null,ji=null,Fu=!1,gs=!1,su=!1,Tr=0;function ja(e){e!==ji&&e.next===null&&(ji===null?fs=ji=e:ji=ji.next=e),gs=!0,Fu||(Fu=!0,Ky())}function Vo(e,t){if(!su&&gs){su=!0;do for(var a=!1,r=fs;r!==null;){if(!t)if(e!==0){var n=r.pendingLanes;if(n===0)var i=0;else{var o=r.suspendedLanes,l=r.pingedLanes;i=(1<<31-na(42|e)+1)-1,i&=n&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Tf(r,i))}else i=qe,i=ks(r,r===$e?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||Oo(r,i)||(a=!0,Tf(r,i));r=r.next}while(a);su=!1}}function Zy(){_b()}function _b(){gs=Fu=!1;var e=0;Tr!==0&&a1()&&(e=Tr);for(var t=ra(),a=null,r=fs;r!==null;){var n=r.next,i=xb(r,t);i===0?(r.next=null,a===null?fs=n:a.next=n,n===null&&(ji=a)):(a=r,(e!==0||(i&3)!==0)&&(gs=!0)),r=n}bt!==0&&bt!==5||Vo(e,!1),Tr!==0&&(Tr=0)}function xb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-na(i),l=1<<o,c=n[o];c===-1?((l&a)===0||(l&r)!==0)&&(n[o]=y0(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=$e,a=qe,a=ks(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Oo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Oc(r),dp(a)){case 2:case 8:a=cg;break;case 32:a=Fl;break;case 268435456:a=ug;break;default:a=Fl}return r=kb.bind(null,e),a=up(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Oc(r),e.callbackPriority=2,e.callbackNode=null,2}function kb(e,t){if(bt!==0&&bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Os()&&e.callbackNode!==a)return null;var r=qe;return r=ks(e,e===$e?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(sb(e,r,t),xb(e,ra()),e.callbackNode!=null&&e.callbackNode===a?kb.bind(null,e):null)}function Tf(e,t){if(Os())return null;sb(e,t,!0)}function Ky(){i1(function(){(Ue&6)!==0?up(sg,Zy):_b()})}function Pp(){if(Tr===0){var e=un;e===0&&(e=hl,hl<<=1,(hl&261888)===0&&(hl=256)),Tr=e}return Tr}function zf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ul(""+e)}function Af(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 Jy(e,t,a,r,n){if(t==="submit"&&a&&a.stateNode===n){var i=zf((n[Xt]||null).action),o=r.submitter;o&&(t=(t=o[Xt]||null)?zf(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new Ns("action","action",null,r,n);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tr!==0){var c=o?Af(n,o):new FormData(n);Qu(a,{pending:!0,data:c,method:n.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?Af(n,o):new FormData(n),Qu(a,{pending:!0,data:c,method:n.method,action:i},i,c))},currentTarget:n}]})}}for(El=0;El<Mu.length;El++)Ml=Mu[El],Rf=Ml.toLowerCase(),Uf=Ml[0].toUpperCase()+Ml.slice(1),za(Rf,"on"+Uf);var Ml,Rf,Uf,El;za(Dg,"onAnimationEnd");za(Bg,"onAnimationIteration");za(Og,"onAnimationStart");za("dblclick","onDoubleClick");za("focusin","onFocus");za("focusout","onBlur");za(my,"onTransitionRun");za(fy,"onTransitionStart");za(gy,"onTransitionCancel");za(Lg,"onTransitionEnd");sn("onMouseEnter",["mouseout","mouseover"]);sn("onMouseLeave",["mouseout","mouseover"]);sn("onPointerEnter",["pointerout","pointerover"]);sn("onPointerLeave",["pointerout","pointerover"]);fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fi("onBeforeInput",["compositionend","keypress","textInput","paste"]);fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),Py=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(To));function Nb(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],n=r.event;r=r.listeners;e:{var i=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!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=p;try{i(n)}catch(f){Wl(f)}n.currentTarget=null,i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=p;try{i(n)}catch(f){Wl(f)}n.currentTarget=null,i=c}}}}function ke(e,t){var a=t[_u];a===void 0&&(a=t[_u]=new Set);var r=e+"__bubble";a.has(r)||(Sb(t,e,2,!1),a.add(r))}function cu(e,t,a){var r=0;t&&(r|=4),Sb(a,e,r,t)}var Tl="_reactListening"+Math.random().toString(36).slice(2);function Fp(e){if(!e[Tl]){e[Tl]=!0,hg.forEach(function(a){a!=="selectionchange"&&(Py.has(a)||cu(a,!1,e),cu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tl]||(t[Tl]=!0,cu("selectionchange",!1,t))}}function Sb(e,t,a,r){switch(Lb(t)){case 2:var n=N1;break;case 8:n=S1;break;default:n=td}a=n.bind(null,t,a,e),n=void 0,!Cu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),r?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function uu(e,t,a,r,n){var i=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===n)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===n)return;o=o.return}for(;l!==null;){if(o=Yi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=i=o;continue e}l=l.parentNode}}r=r.return}Ng(function(){var p=i,f=gp(a),b=[];e:{var d=Hg.get(e);if(d!==void 0){var h=Ns,w=e;switch(e){case"keypress":if(Bl(a)===0)break e;case"keydown":case"keyup":h=X0;break;case"focusin":w="focus",h=Gc;break;case"focusout":w="blur",h=Gc;break;case"beforeblur":case"afterblur":h=Gc;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":h=jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=R0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=K0;break;case Dg:case Bg:case Og:h=B0;break;case Lg:h=P0;break;case"scroll":case"scrollend":h=z0;break;case"wheel":h=I0;break;case"copy":case"cut":case"paste":h=L0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Gm;break;case"toggle":case"beforetoggle":h=ey}var M=(t&4)!==0,D=!M&&(e==="scroll"||e==="scrollend"),m=M?d!==null?d+"Capture":null:d;M=[];for(var u=p,g;u!==null;){var v=u;if(g=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||g===null||m===null||(v=xo(u,m),v!=null&&M.push(zo(u,v,g))),D)break;u=u.return}0<M.length&&(d=new h(d,w,null,a,f),b.push({event:d,listeners:M}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&a!==Su&&(w=a.relatedTarget||a.fromElement)&&(Yi(w)||w[vn]))break e;if((h||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,h?(w=a.relatedTarget||a.toElement,h=p,w=w?Yi(w):null,w!==null&&(D=Do(w),M=w.tag,w!==D||M!==5&&M!==27&&M!==6)&&(w=null)):(h=null,w=p),h!==w)){if(M=jm,v="onMouseLeave",m="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(M=Gm,v="onPointerLeave",m="onPointerEnter",u="pointer"),D=h==null?d:io(h),g=w==null?d:io(w),d=new M(v,u+"leave",h,a,f),d.target=D,d.relatedTarget=g,v=null,Yi(f)===p&&(M=new M(m,u+"enter",w,a,f),M.target=g,M.relatedTarget=D,v=M),D=v,h&&w)t:{for(M=Fy,m=h,u=w,g=0,v=m;v;v=M(v))g++;v=0;for(var N=u;N;N=M(N))v++;for(;0<g-v;)m=M(m),g--;for(;0<v-g;)u=M(u),v--;for(;g--;){if(m===u||u!==null&&m===u.alternate){M=m;break t}m=M(m),u=M(u)}M=null}else M=null;h!==null&&Df(b,d,h,M,!1),w!==null&&D!==null&&Df(b,D,w,M,!0)}}e:{if(d=p?io(p):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var A=$m;else if(Xm(d))if(Tg)A=uy;else{A=sy;var T=ly}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?p&&fp(p.elementType)&&(A=$m):A=cy;if(A&&(A=A(e,p))){Mg(b,A,a,f);break e}T&&T(e,d,p),e==="focusout"&&p&&d.type==="number"&&p.memoizedProps.value!=null&&Nu(d,"number",d.value)}switch(T=p?io(p):window,e){case"focusin":(Xm(T)||T.contentEditable==="true")&&($i=T,qu=p,co=null);break;case"focusout":co=qu=$i=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,Pm(b,a,f);break;case"selectionchange":if(dy)break;case"keydown":case"keyup":Pm(b,a,f)}var z;if(vp)e:{switch(e){case"compositionstart":var Q="onCompositionStart";break e;case"compositionend":Q="onCompositionEnd";break e;case"compositionupdate":Q="onCompositionUpdate";break e}Q=void 0}else Xi?qg(e,a)&&(Q="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Q="onCompositionStart");Q&&(Cg&&a.locale!=="ko"&&(Xi||Q!=="onCompositionStart"?Q==="onCompositionEnd"&&Xi&&(z=Sg()):(qr=f,hp="value"in qr?qr.value:qr.textContent,Xi=!0)),T=hs(p,Q),0<T.length&&(Q=new Qm(Q,e,null,a,f),b.push({event:Q,listeners:T}),z?Q.data=z:(z=Eg(a),z!==null&&(Q.data=z)))),(z=ay?ry(e,a):iy(e,a))&&(Q=hs(p,"onBeforeInput"),0<Q.length&&(T=new Qm("onBeforeInput","beforeinput",null,a,f),b.push({event:T,listeners:Q}),T.data=z)),Jy(b,e,p,a,f)}Nb(b,t)})}function zo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function hs(e,t){for(var a=t+"Capture",r=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=xo(e,a),n!=null&&r.unshift(zo(e,n,i)),n=xo(e,t),n!=null&&r.push(zo(e,n,i))),e.tag===3)return r;e=e.return}return[]}function Fy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Df(e,t,a,r,n){for(var i=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,n?(p=xo(a,i),p!=null&&o.unshift(zo(a,p,c))):n||(p=xo(a,i),p!=null&&o.push(zo(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var Iy=/\r\n?/g,Wy=/\u0000|\uFFFD/g;function Bf(e){return(typeof e=="string"?e:""+e).replace(Iy,`
|
|
9
|
-
`).replace(Wy,"")}function Cb(e,t){return t=Bf(t),Bf(e)===t}function Qe(e,t,a,r,n,i){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||cn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&cn(e,""+r);break;case"className":wl(e,"class",r);break;case"tabIndex":wl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":wl(e,a,r);break;case"style":kg(e,r,i);break;case"data":if(t!=="object"){wl(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=Ul(""+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 i=="function"&&(a==="formAction"?(t!=="input"&&Qe(e,t,"name",n.name,n,null),Qe(e,t,"formEncType",n.formEncType,n,null),Qe(e,t,"formMethod",n.formMethod,n,null),Qe(e,t,"formTarget",n.formTarget,n,null)):(Qe(e,t,"encType",n.encType,n,null),Qe(e,t,"method",n.method,n,null),Qe(e,t,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ul(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=er);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(B(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=Ul(""+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":ke("beforetoggle",e),ke("toggle",e),Rl(e,"popover",r);break;case"xlinkActuate":$a(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":$a(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":$a(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":$a(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":$a(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":$a(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":$a(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":$a(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":$a(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Rl(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=M0.get(a)||a,Rl(e,a,r))}}function Iu(e,t,a,r,n,i){switch(a){case"style":kg(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(B(60));e.innerHTML=a}}break;case"children":typeof r=="string"?cn(e,r):(typeof r=="number"||typeof r=="bigint")&&cn(e,""+r);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"onClick":r!=null&&(e.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),t=a.slice(2,n?a.length-7:void 0),i=e[Xt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof r=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,n);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Rl(e,a,r)}}}function qt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var r=!1,n=!1,i;for(i in a)if(a.hasOwnProperty(i)){var o=a[i];if(o!=null)switch(i){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(B(137,t));default:Qe(e,t,i,o,a,null)}}n&&Qe(e,t,"srcSet",a.srcSet,a,null),r&&Qe(e,t,"src",a.src,a,null);return;case"input":ke("invalid",e);var l=i=o=n=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var f=a[r];if(f!=null)switch(r){case"name":n=f;break;case"type":o=f;break;case"checked":c=f;break;case"defaultChecked":p=f;break;case"value":i=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(B(137,t));break;default:Qe(e,t,r,f,a,null)}}yg(e,i,l,c,p,o,n,!1);return;case"select":ke("invalid",e),r=o=i=null;for(n in a)if(a.hasOwnProperty(n)&&(l=a[n],l!=null))switch(n){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Qe(e,t,n,l,a,null)}t=i,a=o,e.multiple=!!r,t!=null?en(e,!!r,t,!1):a!=null&&en(e,!!r,a,!0);return;case"textarea":ke("invalid",e),i=n=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":n=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(B(91));break;default:Qe(e,t,o,l,a,null)}xg(e,r,n,i);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":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(r=0;r<To.length;r++)ke(To[r],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(B(137,t));default:Qe(e,t,p,r,a,null)}return;default:if(fp(t)){for(f in a)a.hasOwnProperty(f)&&(r=a[f],r!==void 0&&Iu(e,t,f,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 e1(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 n=null,i=null,o=null,l=null,c=null,p=null,f=null;for(h in a){var b=a[h];if(a.hasOwnProperty(h)&&b!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":c=b;default:r.hasOwnProperty(h)||Qe(e,t,h,null,r,b)}}for(var d in r){var h=r[d];if(b=a[d],r.hasOwnProperty(d)&&(h!=null||b!=null))switch(d){case"type":i=h;break;case"name":n=h;break;case"checked":p=h;break;case"defaultChecked":f=h;break;case"value":o=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(B(137,t));break;default:h!==b&&Qe(e,t,d,h,r,b)}}ku(e,o,l,c,p,f,i,n);return;case"select":h=o=l=d=null;for(i in a)if(c=a[i],a.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":h=c;default:r.hasOwnProperty(i)||Qe(e,t,i,null,r,c)}for(n in r)if(i=r[n],c=a[n],r.hasOwnProperty(n)&&(i!=null||c!=null))switch(n){case"value":d=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&Qe(e,t,n,i,r,c)}t=l,a=o,r=h,d!=null?en(e,!!a,d,!1):!!r!=!!a&&(t!=null?en(e,!!a,t,!0):en(e,!!a,a?[]:"",!1));return;case"textarea":h=d=null;for(l in a)if(n=a[l],a.hasOwnProperty(l)&&n!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Qe(e,t,l,null,r,n)}for(o in r)if(n=r[o],i=a[o],r.hasOwnProperty(o)&&(n!=null||i!=null))switch(o){case"value":d=n;break;case"defaultValue":h=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(B(91));break;default:n!==i&&Qe(e,t,o,n,r,i)}_g(e,d,h);return;case"option":for(var w in a)d=a[w],a.hasOwnProperty(w)&&d!=null&&!r.hasOwnProperty(w)&&(w==="selected"?e.selected=!1:Qe(e,t,w,null,r,d));for(c in r)d=r[c],h=a[c],r.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null)&&(c==="selected"?e.selected=d&&typeof d!="function"&&typeof d!="symbol":Qe(e,t,c,d,r,h));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 M in a)d=a[M],a.hasOwnProperty(M)&&d!=null&&!r.hasOwnProperty(M)&&Qe(e,t,M,null,r,d);for(p in r)if(d=r[p],h=a[p],r.hasOwnProperty(p)&&d!==h&&(d!=null||h!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(B(137,t));break;default:Qe(e,t,p,d,r,h)}return;default:if(fp(t)){for(var D in a)d=a[D],a.hasOwnProperty(D)&&d!==void 0&&!r.hasOwnProperty(D)&&Iu(e,t,D,void 0,r,d);for(f in r)d=r[f],h=a[f],!r.hasOwnProperty(f)||d===h||d===void 0&&h===void 0||Iu(e,t,f,d,r,h);return}}for(var m in a)d=a[m],a.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&Qe(e,t,m,null,r,d);for(b in r)d=r[b],h=a[b],!r.hasOwnProperty(b)||d===h||d==null&&h==null||Qe(e,t,b,d,r,h)}function Of(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function t1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],i=n.transferSize,o=n.initiatorType,l=n.duration;if(i&&l&&Of(o)){for(o=0,l=n.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var f=c.transferSize,b=c.initiatorType;f&&Of(b)&&(c=c.responseEnd,o+=f*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(i+o)/(n.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 Wu=null,ep=null;function bs(e){return e.nodeType===9?e:e.ownerDocument}function Lf(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 qb(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 tp(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 pu=null;function a1(){var e=window.event;return e&&e.type==="popstate"?e===pu?!1:(pu=e,!0):(pu=null,!1)}var Eb=typeof setTimeout=="function"?setTimeout:void 0,r1=typeof clearTimeout=="function"?clearTimeout:void 0,Hf=typeof Promise=="function"?Promise:void 0,i1=typeof queueMicrotask=="function"?queueMicrotask:typeof Hf<"u"?function(e){return Hf.resolve(null).then(e).catch(n1)}:Eb;function n1(e){setTimeout(function(){throw e})}function Xr(e){return e==="head"}function jf(e,t){var a=t,r=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(n),bn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")yo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,yo(a);for(var i=a.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[Ho]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=o}}else a==="body"&&yo(e.ownerDocument.body);a=n}while(a);bn(t)}function Qf(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 ap(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":ap(a),mp(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function o1(e,t,a,r){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ho])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=wa(e.nextSibling),e===null)break}return null}function l1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=wa(e.nextSibling),e===null))return null;return e}function Mb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=wa(e.nextSibling),e===null))return null;return e}function rp(e){return e.data==="$?"||e.data==="$~"}function ip(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function s1(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 wa(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 np=null;function Gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return wa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Yf(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 Tb(e,t,a){switch(t=bs(a),e){case"html":if(e=t.documentElement,!e)throw Error(B(452));return e;case"head":if(e=t.head,!e)throw Error(B(453));return e;case"body":if(e=t.body,!e)throw Error(B(454));return e;default:throw Error(B(451))}}function yo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mp(e)}var ya=new Map,Vf=new Set;function vs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ur=De.d;De.d={f:c1,r:u1,D:p1,C:d1,L:m1,m:f1,X:h1,S:g1,M:b1};function c1(){var e=ur.f(),t=Ds();return e||t}function u1(e){var t=wn(e);t!==null&&t.tag===5&&t.type==="form"?kh(t):ur.r(e)}var kn=typeof document>"u"?null:document;function zb(e,t,a){var r=kn;if(r&&typeof t=="string"&&t){var n=ga(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),Vf.has(n)||(Vf.add(n),e={rel:e,crossOrigin:a,href:t},r.querySelector(n)===null&&(t=r.createElement("link"),qt(t,"link",e),_t(t),r.head.appendChild(t)))}}function p1(e){ur.D(e),zb("dns-prefetch",e,null)}function d1(e,t){ur.C(e,t),zb("preconnect",e,t)}function m1(e,t,a){ur.L(e,t,a);var r=kn;if(r&&e&&t){var n='link[rel="preload"][as="'+ga(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+ga(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+ga(a.imageSizes)+'"]')):n+='[href="'+ga(e)+'"]';var i=n;switch(t){case"style":i=hn(e);break;case"script":i=Nn(e)}ya.has(i)||(e=We({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ya.set(i,e),r.querySelector(n)!==null||t==="style"&&r.querySelector(Xo(i))||t==="script"&&r.querySelector($o(i))||(t=r.createElement("link"),qt(t,"link",e),_t(t),r.head.appendChild(t)))}}function f1(e,t){ur.m(e,t);var a=kn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+ga(r)+'"][href="'+ga(e)+'"]',i=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Nn(e)}if(!ya.has(i)&&(e=We({rel:"modulepreload",href:e},t),ya.set(i,e),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($o(i)))return}r=a.createElement("link"),qt(r,"link",e),_t(r),a.head.appendChild(r)}}}function g1(e,t,a){ur.S(e,t,a);var r=kn;if(r&&e){var n=Wi(r).hoistableStyles,i=hn(e);t=t||"default";var o=n.get(i);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Xo(i)))l.loading=5;else{e=We({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ya.get(i))&&Ip(e,a);var c=o=r.createElement("link");_t(c),qt(c,"link",e),c._p=new Promise(function(p,f){c.onload=p,c.onerror=f}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Vl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},n.set(i,o)}}}function h1(e,t){ur.X(e,t);var a=kn;if(a&&e){var r=Wi(a).hoistableScripts,n=Nn(e),i=r.get(n);i||(i=a.querySelector($o(n)),i||(e=We({src:e,async:!0},t),(t=ya.get(n))&&Wp(e,t),i=a.createElement("script"),_t(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function b1(e,t){ur.M(e,t);var a=kn;if(a&&e){var r=Wi(a).hoistableScripts,n=Nn(e),i=r.get(n);i||(i=a.querySelector($o(n)),i||(e=We({src:e,async:!0,type:"module"},t),(t=ya.get(n))&&Wp(e,t),i=a.createElement("script"),_t(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function Xf(e,t,a,r){var n=(n=zr.current)?vs(n):null;if(!n)throw Error(B(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=hn(a.href),a=Wi(n).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=hn(a.href);var i=Wi(n).hoistableStyles,o=i.get(e);if(o||(n=n.ownerDocument||n,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=n.querySelector(Xo(e)))&&!i._p&&(o.instance=i,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),i||v1(n,e,a,o.state))),t&&r===null)throw Error(B(528,""));return o}if(t&&r!==null)throw Error(B(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Nn(a),a=Wi(n).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(B(444,e))}}function hn(e){return'href="'+ga(e)+'"'}function Xo(e){return'link[rel="stylesheet"]['+e+"]"}function Ab(e){return We({},e,{"data-precedence":e.precedence,precedence:null})}function v1(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}),qt(t,"link",a),_t(t),e.head.appendChild(t))}function Nn(e){return'[src="'+ga(e)+'"]'}function $o(e){return"script[async]"+e}function $f(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,_t(r),r;var n=We({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),_t(r),qt(r,"style",n),Vl(r,a.precedence,e),t.instance=r;case"stylesheet":n=hn(a.href);var i=e.querySelector(Xo(n));if(i)return t.state.loading|=4,t.instance=i,_t(i),i;r=Ab(a),(n=ya.get(n))&&Ip(r,n),i=(e.ownerDocument||e).createElement("link"),_t(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),t.state.loading|=4,Vl(i,a.precedence,e),t.instance=i;case"script":return i=Nn(a.src),(n=e.querySelector($o(i)))?(t.instance=n,_t(n),n):(r=a,(n=ya.get(i))&&(r=We({},a),Wp(r,n)),e=e.ownerDocument||e,n=e.createElement("script"),_t(n),qt(n,"link",r),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(B(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Vl(r,a.precedence,e));return t.instance}function Vl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,i=n,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)i=l;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ip(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xl=null;function Zf(e,t,a){if(Xl===null){var r=new Map,n=Xl=new Map;n.set(a,r)}else n=Xl,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),n=0;n<a.length;n++){var i=a[n];if(!(i[Ho]||i[Nt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(i):r.set(o,[i])}}return r}function Kf(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function w1(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 Rb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function y1(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 n=hn(r.href),i=t.querySelector(Xo(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ws.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,_t(i);return}i=t.ownerDocument||t,r=Ab(r),(n=ya.get(n))&&Ip(r,n),i=i.createElement("link"),_t(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ws.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var du=0;function _1(e,t){return e.stylesheets&&e.count===0&&$l(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&$l(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&du===0&&(du=62500*t1());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$l(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>du?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function ws(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$l(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ys=null;function $l(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ys=new Map,t.forEach(x1,e),ys=null,ws.call(e))}function x1(e,t){if(!(t.state.loading&4)){var a=ys.get(e);if(a)var r=a.get(null);else{a=new Map,ys.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var o=n[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}n=t.instance,o=n.getAttribute("data-precedence"),i=a.get(o)||r,i===r&&a.set(null,n),a.set(o,n),this.count++,r=ws.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Ao={$$typeof:Wa,Provider:null,Consumer:null,_currentValue:ii,_currentValue2:ii,_threadCount:0};function k1(e,t,a,r,n,i,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=Lc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lc(0),this.hiddenUpdates=Lc(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Ub(e,t,a,r,n,i,o,l,c,p,f,b){return e=new k1(e,t,a,o,c,p,f,b,l),t=1,i===!0&&(t|=24),i=ta(3,null,null,t),e.current=i,i.stateNode=e,t=Sp(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:a,cache:t},Ep(i),e}function Db(e){return e?(e=Ji,e):Ji}function Bb(e,t,a,r,n,i){n=Db(n),r.context===null?r.context=n:r.pendingContext=n,r=Rr(t),r.payload={element:a},i=i===void 0?null:i,i!==null&&(r.callback=i),a=Ur(e,r,t),a!==null&&(Vt(a,e,t),po(a,e,t))}function Jf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ed(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function Ob(e){if(e.tag===13||e.tag===31){var t=bi(e,67108864);t!==null&&Vt(t,e,67108864),ed(e,67108864)}}function Pf(e){if(e.tag===13||e.tag===31){var t=oa();t=pp(t);var a=bi(e,t);a!==null&&Vt(a,e,t),ed(e,t)}}var _s=!0;function N1(e,t,a,r){var n=de.T;de.T=null;var i=De.p;try{De.p=2,td(e,t,a,r)}finally{De.p=i,de.T=n}}function S1(e,t,a,r){var n=de.T;de.T=null;var i=De.p;try{De.p=8,td(e,t,a,r)}finally{De.p=i,de.T=n}}function td(e,t,a,r){if(_s){var n=op(r);if(n===null)uu(e,t,r,xs,a),Ff(e,r);else if(q1(n,e,t,a,r))r.stopPropagation();else if(Ff(e,r),t&4&&-1<C1.indexOf(e)){for(;n!==null;){var i=wn(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=ti(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-na(o);l.entanglements[1]|=c,o&=~c}ja(i),(Ue&6)===0&&(ps=ra()+500,Vo(0,!1))}}break;case 31:case 13:l=bi(i,2),l!==null&&Vt(l,i,2),Ds(),ed(i,2)}if(i=op(r),i===null&&uu(e,t,r,xs,a),i===n)break;n=i}n!==null&&r.stopPropagation()}else uu(e,t,r,null,a)}}function op(e){return e=gp(e),ad(e)}var xs=null;function ad(e){if(xs=null,e=Yi(e),e!==null){var t=Do(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=rg(t),e!==null)return e;e=null}else if(a===31){if(e=ig(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 xs=e,null}function Lb(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(m0()){case sg:return 2;case cg:return 8;case Fl:case f0:return 32;case ug:return 268435456;default:return 32}default:return 32}}var lp=!1,Or=null,Lr=null,Hr=null,Ro=new Map,Uo=new Map,Sr=[],C1="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 Ff(e,t){switch(e){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":Ro.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(t.pointerId)}}function eo(e,t,a,r,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:i,targetContainers:[n]},t!==null&&(t=wn(t),t!==null&&Ob(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function q1(e,t,a,r,n){switch(t){case"focusin":return Or=eo(Or,e,t,a,r,n),!0;case"dragenter":return Lr=eo(Lr,e,t,a,r,n),!0;case"mouseover":return Hr=eo(Hr,e,t,a,r,n),!0;case"pointerover":var i=n.pointerId;return Ro.set(i,eo(Ro.get(i)||null,e,t,a,r,n)),!0;case"gotpointercapture":return i=n.pointerId,Uo.set(i,eo(Uo.get(i)||null,e,t,a,r,n)),!0}return!1}function Hb(e){var t=Yi(e.target);if(t!==null){var a=Do(t);if(a!==null){if(t=a.tag,t===13){if(t=rg(a),t!==null){e.blockedOn=t,Rm(e.priority,function(){Pf(a)});return}}else if(t===31){if(t=ig(a),t!==null){e.blockedOn=t,Rm(e.priority,function(){Pf(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 Zl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=op(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Su=r,a.target.dispatchEvent(r),Su=null}else return t=wn(a),t!==null&&Ob(t),e.blockedOn=a,!1;t.shift()}return!0}function If(e,t,a){Zl(e)&&a.delete(t)}function E1(){lp=!1,Or!==null&&Zl(Or)&&(Or=null),Lr!==null&&Zl(Lr)&&(Lr=null),Hr!==null&&Zl(Hr)&&(Hr=null),Ro.forEach(If),Uo.forEach(If)}function zl(e,t){e.blockedOn===t&&(e.blockedOn=null,lp||(lp=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,E1)))}var Al=null;function Wf(e){Al!==e&&(Al=e,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,function(){Al===e&&(Al=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],n=e[t+2];if(typeof r!="function"){if(ad(r||a)===null)continue;break}var i=wn(a);i!==null&&(e.splice(t,3),t-=3,Qu(i,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function bn(e){function t(c){return zl(c,e)}Or!==null&&zl(Or,e),Lr!==null&&zl(Lr,e),Hr!==null&&zl(Hr,e),Ro.forEach(t),Uo.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);)Hb(a),a.blockedOn===null&&Sr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],i=a[r+1],o=n[Xt]||null;if(typeof i=="function")o||Wf(a);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(n=i,o=i[Xt]||null)l=o.formAction;else if(ad(n)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),Wf(a)}}}function jb(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return n=o})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,n=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),n!==null&&(n(),n=null)}}}function rd(e){this._internalRoot=e}Ls.prototype.render=rd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var a=t.current,r=oa();Bb(a,r,e,t,null,null)};Ls.prototype.unmount=rd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bb(e.current,2,null,e,null,null),Ds(),t[vn]=null}};function Ls(e){this._internalRoot=e}Ls.prototype.unstable_scheduleHydration=function(e){if(e){var t=gg();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&&Hb(e)}};var eg=tg.version;if(eg!=="19.2.3")throw Error(B(527,eg,"19.2.3"));De.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=o0(t),e=e!==null?ng(e):null,e=e===null?null:e.stateNode,e};var M1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(to=__REACT_DEVTOOLS_GLOBAL_HOOK__,!to.isDisabled&&to.supportsFiber))try{Bo=to.inject(M1),ia=to}catch{}var to;Hs.createRoot=function(e,t){if(!ag(e))throw Error(B(299));var a=!1,r="",n=zh,i=Ah,o=Rh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ub(e,1,!1,null,null,a,r,null,n,i,o,jb),e[vn]=t.current,Fp(e),new rd(t)};Hs.hydrateRoot=function(e,t,a){if(!ag(e))throw Error(B(299));var r=!1,n="",i=zh,o=Ah,l=Rh,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Ub(e,1,!0,t,a??null,r,n,c,i,o,l,jb),t.context=Db(null),a=t.current,r=oa(),r=pp(r),n=Rr(r),n.callback=null,Ur(a,n,r),a=r,t.current.lanes=a,Lo(t,a),ja(t),e[vn]=t.current,Fp(e),new Ls(t)};Hs.version="19.2.3"});var Vb=Ra((cx,Yb)=>{"use strict";function Gb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gb)}catch(e){console.error(e)}}Gb(),Yb.exports=Qb()});var Dv=Ra(Ys=>{"use strict";var O1=Symbol.for("react.transitional.element"),L1=Symbol.for("react.fragment");function Uv(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 n in t)n!=="key"&&(a[n]=t[n])}else a=t;return t=a.ref,{$$typeof:O1,type:e,key:r,ref:t!==void 0?t:null,props:a}}Ys.Fragment=L1;Ys.jsx=Uv;Ys.jsxs=Uv});var te=Ra((Bk,Bv)=>{"use strict";Bv.exports=Dv()});var Ew=Y(Vb());var Xb=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles\r
|
|
8
|
+
`+r.stack}}var yu=Object.prototype.hasOwnProperty,up=vt.unstable_scheduleCallback,Oc=vt.unstable_cancelCallback,p0=vt.unstable_shouldYield,d0=vt.unstable_requestPaint,ra=vt.unstable_now,m0=vt.unstable_getCurrentPriorityLevel,sg=vt.unstable_ImmediatePriority,cg=vt.unstable_UserBlockingPriority,Fl=vt.unstable_NormalPriority,f0=vt.unstable_LowPriority,ug=vt.unstable_IdlePriority,g0=vt.log,h0=vt.unstable_setDisableYieldValue,Bo=null,ia=null;function Cr(e){if(typeof g0=="function"&&h0(e),ia&&typeof ia.setStrictMode=="function")try{ia.setStrictMode(Bo,e)}catch{}}var na=Math.clz32?Math.clz32:w0,b0=Math.log,v0=Math.LN2;function w0(e){return e>>>=0,e===0?32:31-(b0(e)/v0|0)|0}var hl=256,bl=262144,vl=4194304;function ti(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 ks(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~i,r!==0?n=ti(r):(o&=l,o!==0?n=ti(o):a||(a=l&~e,a!==0&&(n=ti(a))))):(l=r&~i,l!==0?n=ti(l):o!==0?n=ti(o):a||(a=r&~e,a!==0&&(n=ti(a)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:n}function Oo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function y0(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 pg(){var e=vl;return vl<<=1,(vl&62914560)===0&&(vl=4194304),e}function Lc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Lo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _0(e,t,a,r,n,i){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 f=31-na(a),b=1<<f;l[f]=0,c[f]=-1;var d=p[f];if(d!==null)for(p[f]=null,f=0;f<d.length;f++){var h=d[f];h!==null&&(h.lane&=-536870913)}a&=~b}r!==0&&dg(e,r,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function dg(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-na(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function mg(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-na(a),n=1<<r;n&t|e[r]&t&&(e[r]|=t),a&=~n}}function fg(e,t){var a=t&-t;return a=(a&42)!==0?1:pp(a),(a&(e.suspendedLanes|t))!==0?0:a}function pp(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 dp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gg(){var e=De.p;return e!==0?e:(e=window.event,e===void 0?32:Lb(e.type))}function Rm(e,t){var a=De.p;try{return De.p=e,t()}finally{De.p=a}}var Vr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Vr,Xt="__reactProps$"+Vr,vn="__reactContainer$"+Vr,_u="__reactEvents$"+Vr,x0="__reactListeners$"+Vr,k0="__reactHandles$"+Vr,Um="__reactResources$"+Vr,Ho="__reactMarker$"+Vr;function mp(e){delete e[Nt],delete e[Xt],delete e[_u],delete e[x0],delete e[k0]}function Yi(e){var t=e[Nt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[vn]||a[Nt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Yf(e);e!==null;){if(a=e[Nt])return a;e=Yf(e)}return t}e=a,a=e.parentNode}return null}function wn(e){if(e=e[Nt]||e[vn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function io(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(B(33))}function Wi(e){var t=e[Um];return t||(t=e[Um]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function _t(e){e[Ho]=!0}var hg=new Set,bg={};function fi(e,t){sn(e,t),sn(e+"Capture",t)}function sn(e,t){for(bg[e]=t,e=0;e<t.length;e++)hg.add(t[e])}var N0=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]*$"),Dm={},Bm={};function S0(e){return yu.call(Bm,e)?!0:yu.call(Dm,e)?!1:N0.test(e)?Bm[e]=!0:(Dm[e]=!0,!1)}function Rl(e,t,a){if(S0(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 wl(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 $a(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 vg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function C0(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 n=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){a=""+o,i.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 xu(e){if(!e._valueTracker){var t=vg(e)?"checked":"value";e._valueTracker=C0(e,t,""+e[t])}}function wg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=vg(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Il(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 q0=/[\n"\\]/g;function ha(e){return e.replace(q0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ku(e,t,a,r,n,i,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?Nu(e,o,ma(t)):a!=null?Nu(e,o,ma(a)):r!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ma(l):e.removeAttribute("name")}function yg(e,t,a,r,n,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){xu(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??n,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),xu(e)}function Nu(e,t,a){t==="number"&&Il(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function en(e,t,a,r){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t["$"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty("$"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&r&&(e[a].defaultSelected=!0)}else{for(a=""+ma(a),t=null,n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,r&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function _g(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 xg(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(B(92));if(ro(r)){if(1<r.length)throw Error(B(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),xu(e)}function cn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var E0=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 Om(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||E0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function kg(e,t,a){if(t!=null&&typeof t!="object")throw Error(B(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 n in t)r=t[n],t.hasOwnProperty(n)&&a[n]!==r&&Om(e,n,r)}else for(var i in t)t.hasOwnProperty(i)&&Om(e,i,t[i])}function fp(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 M0=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"]]),T0=/^[\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 Ul(e){return T0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function er(){}var Su=null;function gp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vi=null,tn=null;function Lm(e){var t=wn(e);if(t&&(e=t.stateNode)){var a=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ku(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 n=r[Xt]||null;if(!n)throw Error(B(90));ku(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&wg(r)}break e;case"textarea":_g(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&en(e,!!a.multiple,t,!1)}}}var Hc=!1;function Ng(e,t,a){if(Hc)return e(t,a);Hc=!0;try{var r=e(t);return r}finally{if(Hc=!1,(Vi!==null||tn!==null)&&(Ds(),Vi&&(t=Vi,e=tn,tn=Vi=null,Lm(t),e)))for(t=0;t<e.length;t++)Lm(e[t])}}function xo(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Xt]||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(B(231,t,typeof a));return a}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cu=!1;if(nr)try{Bi={},Object.defineProperty(Bi,"passive",{get:function(){Cu=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{Cu=!1}var Bi,qr=null,hp=null,Dl=null;function Sg(){if(Dl)return Dl;var e,t=hp,a=t.length,r,n="value"in qr?qr.value:qr.textContent,i=n.length;for(e=0;e<a&&t[e]===n[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===n[i-r];r++);return Dl=n.slice(e,1<r?1-r:void 0)}function Bl(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 yl(){return!0}function Hm(){return!1}function $t(e){function t(a,r,n,i,o){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?yl:Hm,this.isPropagationStopped=Hm,this}return We(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=yl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=yl)},persist:function(){},isPersistent:yl}),t}var gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ns=$t(gi),jo=We({},gi,{view:0,detail:0}),z0=$t(jo),jc,Qc,Pn,Ss=We({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bp,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!==Pn&&(Pn&&e.type==="mousemove"?(jc=e.screenX-Pn.screenX,Qc=e.screenY-Pn.screenY):Qc=jc=0,Pn=e),jc)},movementY:function(e){return"movementY"in e?e.movementY:Qc}}),jm=$t(Ss),A0=We({},Ss,{dataTransfer:0}),R0=$t(A0),U0=We({},jo,{relatedTarget:0}),Gc=$t(U0),D0=We({},gi,{animationName:0,elapsedTime:0,pseudoElement:0}),B0=$t(D0),O0=We({},gi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),L0=$t(O0),H0=We({},gi,{data:0}),Qm=$t(H0),j0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q0={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"},G0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G0[e])?!!t[e]:!1}function bp(){return Y0}var V0=We({},jo,{key:function(e){if(e.key){var t=j0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Q0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bp,charCode:function(e){return e.type==="keypress"?Bl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),X0=$t(V0),$0=We({},Ss,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gm=$t($0),Z0=We({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bp}),K0=$t(Z0),J0=We({},gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),P0=$t(J0),F0=We({},Ss,{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}),I0=$t(F0),W0=We({},gi,{newState:0,oldState:0}),ey=$t(W0),ty=[9,13,27,32],vp=nr&&"CompositionEvent"in window,lo=null;nr&&"documentMode"in document&&(lo=document.documentMode);var ay=nr&&"TextEvent"in window&&!lo,Cg=nr&&(!vp||lo&&8<lo&&11>=lo),Ym=" ",Vm=!1;function qg(e,t){switch(e){case"keyup":return ty.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xi=!1;function ry(e,t){switch(e){case"compositionend":return Eg(t);case"keypress":return t.which!==32?null:(Vm=!0,Ym);case"textInput":return e=t.data,e===Ym&&Vm?null:e;default:return null}}function iy(e,t){if(Xi)return e==="compositionend"||!vp&&qg(e,t)?(e=Sg(),Dl=hp=qr=null,Xi=!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 Cg&&t.locale!=="ko"?null:t.data;default:return null}}var ny={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 Xm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ny[e.type]:t==="textarea"}function Mg(e,t,a,r){Vi?tn?tn.push(r):tn=[r]:Vi=r,t=hs(t,"onChange"),0<t.length&&(a=new Ns("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var so=null,ko=null;function oy(e){Nb(e,0)}function Cs(e){var t=io(e);if(wg(t))return e}function $m(e,t){if(e==="change")return t}var Tg=!1;nr&&(nr?(xl="oninput"in document,xl||(Yc=document.createElement("div"),Yc.setAttribute("oninput","return;"),xl=typeof Yc.oninput=="function"),_l=xl):_l=!1,Tg=_l&&(!document.documentMode||9<document.documentMode));var _l,xl,Yc;function Zm(){so&&(so.detachEvent("onpropertychange",zg),ko=so=null)}function zg(e){if(e.propertyName==="value"&&Cs(ko)){var t=[];Mg(t,ko,e,gp(e)),Ng(oy,t)}}function ly(e,t,a){e==="focusin"?(Zm(),so=t,ko=a,so.attachEvent("onpropertychange",zg)):e==="focusout"&&Zm()}function sy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cs(ko)}function cy(e,t){if(e==="click")return Cs(t)}function uy(e,t){if(e==="input"||e==="change")return Cs(t)}function py(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var la=typeof Object.is=="function"?Object.is:py;function No(e,t){if(la(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 n=a[r];if(!yu.call(t,n)||!la(e[n],t[n]))return!1}return!0}function Km(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jm(e,t){var a=Km(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=Km(a)}}function Ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Il(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=Il(e.document)}return t}function wp(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 dy=nr&&"documentMode"in document&&11>=document.documentMode,$i=null,qu=null,co=null,Eu=!1;function Pm(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Eu||$i==null||$i!==Il(r)||(r=$i,"selectionStart"in r&&wp(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}),co&&No(co,r)||(co=r,r=hs(qu,"onSelect"),0<r.length&&(t=new Ns("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=$i)))}function Wr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Zi={animationend:Wr("Animation","AnimationEnd"),animationiteration:Wr("Animation","AnimationIteration"),animationstart:Wr("Animation","AnimationStart"),transitionrun:Wr("Transition","TransitionRun"),transitionstart:Wr("Transition","TransitionStart"),transitioncancel:Wr("Transition","TransitionCancel"),transitionend:Wr("Transition","TransitionEnd")},Vc={},Ug={};nr&&(Ug=document.createElement("div").style,"AnimationEvent"in window||(delete Zi.animationend.animation,delete Zi.animationiteration.animation,delete Zi.animationstart.animation),"TransitionEvent"in window||delete Zi.transitionend.transition);function hi(e){if(Vc[e])return Vc[e];if(!Zi[e])return e;var t=Zi[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Ug)return Vc[e]=t[a];return e}var Dg=hi("animationend"),Bg=hi("animationiteration"),Og=hi("animationstart"),my=hi("transitionrun"),fy=hi("transitionstart"),gy=hi("transitioncancel"),Lg=hi("transitionend"),Hg=new Map,Mu="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(" ");Mu.push("scrollEnd");function Aa(e,t){Hg.set(e,t),fi(t,[e])}var Wl=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=[],Ki=0,yp=0;function qs(){for(var e=Ki,t=yp=Ki=0;t<e;){var a=da[t];da[t++]=null;var r=da[t];da[t++]=null;var n=da[t];da[t++]=null;var i=da[t];if(da[t++]=null,r!==null&&n!==null){var o=r.pending;o===null?n.next=n:(n.next=o.next,o.next=n),r.pending=n}i!==0&&jg(a,n,i)}}function Es(e,t,a,r){da[Ki++]=e,da[Ki++]=t,da[Ki++]=a,da[Ki++]=r,yp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function _p(e,t,a,r){return Es(e,t,a,r),es(e)}function bi(e,t){return Es(e,null,null,t),es(e)}function jg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var n=!1,i=e.return;i!==null;)i.childLanes|=a,r=i.alternate,r!==null&&(r.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-na(a),e=i.hiddenUpdates,r=e[n],r===null?e[n]=[t]:r.push(t),t.lane=a|536870912),i):null}function es(e){if(50<wo)throw wo=0,Pu=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ji={};function hy(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 ta(e,t,a,r){return new hy(e,t,a,r)}function xp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ar(e,t){var a=e.alternate;return a===null?(a=ta(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 Qg(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 Ol(e,t,a,r,n,i){var o=0;if(r=e,typeof e=="function")xp(e)&&(o=1);else if(typeof e=="string")o=w1(e,a,La.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case hu:return e=ta(31,a,t,n),e.elementType=hu,e.lanes=i,e;case Qi:return ni(a.children,n,i,t);case og:o=8,n|=24;break;case mu:return e=ta(12,a,t,n|2),e.elementType=mu,e.lanes=i,e;case fu:return e=ta(13,a,t,n),e.elementType=fu,e.lanes=i,e;case gu:return e=ta(19,a,t,n),e.elementType=gu,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wa:o=10;break e;case lg:o=9;break e;case sp:o=11;break e;case cp:o=14;break e;case yr:o=16,r=null;break e}o=29,a=Error(B(130,e===null?"null":typeof e,"")),r=null}return t=ta(o,a,t,n),t.elementType=e,t.type=r,t.lanes=i,t}function ni(e,t,a,r){return e=ta(7,e,r,t),e.lanes=a,e}function Xc(e,t,a){return e=ta(6,e,null,t),e.lanes=a,e}function Gg(e){var t=ta(18,null,null,0);return t.stateNode=e,t}function $c(e,t,a){return t=ta(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fm=new WeakMap;function ba(e,t){if(typeof e=="object"&&e!==null){var a=Fm.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Am(t)},Fm.set(e,t),t)}return{value:e,source:t,stack:Am(t)}}var Pi=[],Fi=0,ts=null,So=0,fa=[],ga=0,jr=null,Da=1,Ba="";function Fa(e,t){Pi[Fi++]=So,Pi[Fi++]=ts,ts=e,So=t}function Yg(e,t,a){fa[ga++]=Da,fa[ga++]=Ba,fa[ga++]=jr,jr=e;var r=Da;e=Ba;var n=32-na(r)-1;r&=~(1<<n),a+=1;var i=32-na(t)+n;if(30<i){var o=n-n%5;i=(r&(1<<o)-1).toString(32),r>>=o,n-=o,Da=1<<32-na(t)+n|a<<n|r,Ba=i+e}else Da=1<<i|a<<n|r,Ba=e}function kp(e){e.return!==null&&(Fa(e,1),Yg(e,1,0))}function Np(e){for(;e===ts;)ts=Pi[--Fi],Pi[Fi]=null,So=Pi[--Fi],Pi[Fi]=null;for(;e===jr;)jr=fa[--ga],fa[ga]=null,Ba=fa[--ga],fa[ga]=null,Da=fa[--ga],fa[ga]=null}function Vg(e,t){fa[ga++]=Da,fa[ga++]=Ba,fa[ga++]=jr,Da=t.id,Ba=t.overflow,jr=e}var St=null,Ie=null,Ee=!1,Ar=null,va=!1,Tu=Error(B(519));function Qr(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(ba(t,e)),Tu}function Im(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Nt]=e,t[Xt]=r,a){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(a=0;a<To.length;a++)ke(To[a],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),yg(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),xg(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||Cb(t.textContent,a)?(r.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),r.onScroll!=null&&ke("scroll",t),r.onScrollEnd!=null&&ke("scrollend",t),r.onClick!=null&&(t.onclick=er),t=!0):t=!1,t||Qr(e,!0)}function Wm(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:St=St.return}}function Oi(e){if(e!==St)return!1;if(!Ee)return Wm(e),Ee=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||tp(e.type,e.memoizedProps)),a=!a),a&&Ie&&Qr(e),Wm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));Ie=Gf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));Ie=Gf(e)}else t===27?(t=Ie,Xr(e.type)?(e=np,np=null,Ie=e):Ie=t):Ie=St?ya(e.stateNode.nextSibling):null;return!0}function ci(){Ie=St=null,Ee=!1}function Zc(){var e=Ar;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),Ar=null),e}function Co(e){Ar===null?Ar=[e]:Ar.push(e)}var zu=Ha(null),vi=null,tr=null;function xr(e,t,a){Ke(zu,t._currentValue),t._currentValue=a}function rr(e){e._currentValue=zu.current,xt(zu)}function Au(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 Ru(e,t,a,r){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var o=n.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=n;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=a,l=i.alternate,l!==null&&(l.lanes|=a),Au(i.return,a,e),r||(o=null);break e}i=l.next}}else if(n.tag===18){if(o=n.return,o===null)throw Error(B(341));o.lanes|=a,i=o.alternate,i!==null&&(i.lanes|=a),Au(o,a,e),o=null}else o=n.child;if(o!==null)o.return=n;else for(o=n;o!==null;){if(o===e){o=null;break}if(n=o.sibling,n!==null){n.return=o.return,o=n;break}o=o.return}n=o}}function yn(e,t,a,r){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var o=n.alternate;if(o===null)throw Error(B(387));if(o=o.memoizedProps,o!==null){var l=n.type;la(n.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(n===Kl.current){if(o=n.alternate,o===null)throw Error(B(387));o.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Ao):e=[Ao])}n=n.return}e!==null&&Ru(t,e,a,r),t.flags|=262144}function as(e){for(e=e.firstContext;e!==null;){if(!la(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ui(e){vi=e,tr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Xg(vi,e)}function kl(e,t){return vi===null&&ui(e),Xg(e,t)}function Xg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},tr===null){if(e===null)throw Error(B(308));tr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else tr=tr.next=t;return a}var by=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()})}},vy=vt.unstable_scheduleCallback,wy=vt.unstable_NormalPriority,gt={$$typeof:Wa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sp(){return{controller:new by,data:new Map,refCount:0}}function Qo(e){e.refCount--,e.refCount===0&&vy(wy,function(){e.controller.abort()})}var uo=null,Uu=0,un=0,an=null;function yy(e,t){if(uo===null){var a=uo=[];Uu=0,un=Pp(),an={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Uu++,t.then(ef,ef),t}function ef(){if(--Uu===0&&uo!==null){an!==null&&(an.status="fulfilled");var e=uo;uo=null,un=0,an=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _y(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var tf=de.S;de.S=function(e,t){nb=ra(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&yy(e,t),tf!==null&&tf(e,t)};var oi=Ha(null);function Cp(){var e=oi.current;return e!==null?e:$e.pooledCache}function Ll(e,t){t===null?Ke(oi,oi.current):Ke(oi,t.pool)}function $g(){var e=Cp();return e===null?null:{parent:gt._currentValue,pool:e}}var _n=Error(B(460)),qp=Error(B(474)),Ms=Error(B(542)),rs={then:function(){}};function af(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(er,er),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nf(e),e;default:if(typeof t.status=="string")t.then(er,er);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(B(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=r}},function(r){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nf(e),e}throw li=t,_n}}function ai(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(li=a,_n):a}}var li=null;function rf(){if(li===null)throw Error(B(459));var e=li;return li=null,e}function nf(e){if(e===_n||e===Ms)throw Error(B(483))}var rn=null,qo=0;function Nl(e){var t=qo;return qo+=1,rn===null&&(rn=[]),Zg(rn,e,t)}function Fn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Sl(e,t){throw t.$$typeof===l0?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Kg(e){function t(m,u){if(e){var g=m.deletions;g===null?(m.deletions=[u],m.flags|=16):g.push(u)}}function a(m,u){if(!e)return null;for(;u!==null;)t(m,u),u=u.sibling;return null}function r(m){for(var u=new Map;m!==null;)m.key!==null?u.set(m.key,m):u.set(m.index,m),m=m.sibling;return u}function n(m,u){return m=ar(m,u),m.index=0,m.sibling=null,m}function i(m,u,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<u?(m.flags|=67108866,u):g):(m.flags|=67108866,u)):(m.flags|=1048576,u)}function o(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function l(m,u,g,v){return u===null||u.tag!==6?(u=Xc(g,m.mode,v),u.return=m,u):(u=n(u,g),u.return=m,u)}function c(m,u,g,v){var N=g.type;return N===Qi?f(m,u,g.props.children,v,g.key):u!==null&&(u.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===yr&&ai(N)===u.type)?(u=n(u,g.props),Fn(u,g),u.return=m,u):(u=Ol(g.type,g.key,g.props,null,m.mode,v),Fn(u,g),u.return=m,u)}function p(m,u,g,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=$c(g,m.mode,v),u.return=m,u):(u=n(u,g.children||[]),u.return=m,u)}function f(m,u,g,v,N){return u===null||u.tag!==7?(u=ni(g,m.mode,v,N),u.return=m,u):(u=n(u,g),u.return=m,u)}function b(m,u,g){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=Xc(""+u,m.mode,g),u.return=m,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case gl:return g=Ol(u.type,u.key,u.props,null,m.mode,g),Fn(g,u),g.return=m,g;case ao:return u=$c(u,m.mode,g),u.return=m,u;case yr:return u=ai(u),b(m,u,g)}if(ro(u)||Jn(u))return u=ni(u,m.mode,g,null),u.return=m,u;if(typeof u.then=="function")return b(m,Nl(u),g);if(u.$$typeof===Wa)return b(m,kl(m,u),g);Sl(m,u)}return null}function d(m,u,g,v){var N=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return N!==null?null:l(m,u,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case gl:return g.key===N?c(m,u,g,v):null;case ao:return g.key===N?p(m,u,g,v):null;case yr:return g=ai(g),d(m,u,g,v)}if(ro(g)||Jn(g))return N!==null?null:f(m,u,g,v,null);if(typeof g.then=="function")return d(m,u,Nl(g),v);if(g.$$typeof===Wa)return d(m,u,kl(m,g),v);Sl(m,g)}return null}function h(m,u,g,v,N){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return m=m.get(g)||null,l(u,m,""+v,N);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case gl:return m=m.get(v.key===null?g:v.key)||null,c(u,m,v,N);case ao:return m=m.get(v.key===null?g:v.key)||null,p(u,m,v,N);case yr:return v=ai(v),h(m,u,g,v,N)}if(ro(v)||Jn(v))return m=m.get(g)||null,f(u,m,v,N,null);if(typeof v.then=="function")return h(m,u,g,Nl(v),N);if(v.$$typeof===Wa)return h(m,u,g,kl(u,v),N);Sl(u,v)}return null}function w(m,u,g,v){for(var N=null,A=null,T=u,z=u=0,Q=null;T!==null&&z<g.length;z++){T.index>z?(Q=T,T=null):Q=T.sibling;var K=d(m,T,g[z],v);if(K===null){T===null&&(T=Q);break}e&&T&&K.alternate===null&&t(m,T),u=i(K,u,z),A===null?N=K:A.sibling=K,A=K,T=Q}if(z===g.length)return a(m,T),Ee&&Fa(m,z),N;if(T===null){for(;z<g.length;z++)T=b(m,g[z],v),T!==null&&(u=i(T,u,z),A===null?N=T:A.sibling=T,A=T);return Ee&&Fa(m,z),N}for(T=r(T);z<g.length;z++)Q=h(T,m,z,g[z],v),Q!==null&&(e&&Q.alternate!==null&&T.delete(Q.key===null?z:Q.key),u=i(Q,u,z),A===null?N=Q:A.sibling=Q,A=Q);return e&&T.forEach(function(fe){return t(m,fe)}),Ee&&Fa(m,z),N}function M(m,u,g,v){if(g==null)throw Error(B(151));for(var N=null,A=null,T=u,z=u=0,Q=null,K=g.next();T!==null&&!K.done;z++,K=g.next()){T.index>z?(Q=T,T=null):Q=T.sibling;var fe=d(m,T,K.value,v);if(fe===null){T===null&&(T=Q);break}e&&T&&fe.alternate===null&&t(m,T),u=i(fe,u,z),A===null?N=fe:A.sibling=fe,A=fe,T=Q}if(K.done)return a(m,T),Ee&&Fa(m,z),N;if(T===null){for(;!K.done;z++,K=g.next())K=b(m,K.value,v),K!==null&&(u=i(K,u,z),A===null?N=K:A.sibling=K,A=K);return Ee&&Fa(m,z),N}for(T=r(T);!K.done;z++,K=g.next())K=h(T,m,z,K.value,v),K!==null&&(e&&K.alternate!==null&&T.delete(K.key===null?z:K.key),u=i(K,u,z),A===null?N=K:A.sibling=K,A=K);return e&&T.forEach(function(Te){return t(m,Te)}),Ee&&Fa(m,z),N}function D(m,u,g,v){if(typeof g=="object"&&g!==null&&g.type===Qi&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case gl:e:{for(var N=g.key;u!==null;){if(u.key===N){if(N=g.type,N===Qi){if(u.tag===7){a(m,u.sibling),v=n(u,g.props.children),v.return=m,m=v;break e}}else if(u.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===yr&&ai(N)===u.type){a(m,u.sibling),v=n(u,g.props),Fn(v,g),v.return=m,m=v;break e}a(m,u);break}else t(m,u);u=u.sibling}g.type===Qi?(v=ni(g.props.children,m.mode,v,g.key),v.return=m,m=v):(v=Ol(g.type,g.key,g.props,null,m.mode,v),Fn(v,g),v.return=m,m=v)}return o(m);case ao:e:{for(N=g.key;u!==null;){if(u.key===N)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){a(m,u.sibling),v=n(u,g.children||[]),v.return=m,m=v;break e}else{a(m,u);break}else t(m,u);u=u.sibling}v=$c(g,m.mode,v),v.return=m,m=v}return o(m);case yr:return g=ai(g),D(m,u,g,v)}if(ro(g))return w(m,u,g,v);if(Jn(g)){if(N=Jn(g),typeof N!="function")throw Error(B(150));return g=N.call(g),M(m,u,g,v)}if(typeof g.then=="function")return D(m,u,Nl(g),v);if(g.$$typeof===Wa)return D(m,u,kl(m,g),v);Sl(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,u!==null&&u.tag===6?(a(m,u.sibling),v=n(u,g),v.return=m,m=v):(a(m,u),v=Xc(g,m.mode,v),v.return=m,m=v),o(m)):a(m,u)}return function(m,u,g,v){try{qo=0;var N=D(m,u,g,v);return rn=null,N}catch(T){if(T===_n||T===Ms)throw T;var A=ta(29,T,null,m.mode);return A.lanes=v,A.return=m,A}}}var pi=Kg(!0),Jg=Kg(!1),_r=!1;function Ep(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Du(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 Ur(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ue&2)!==0){var n=r.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),r.pending=t,t=es(e),jg(e,null,a),t}return Es(e,r,t,a),es(e)}function po(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,mg(e,a)}}function Kc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?n=i=o:i=i.next=o,a=a.next}while(a!==null);i===null?n=i=t:i=i.next=t}else n=i=t;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:i,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 Bu=!1;function mo(){if(Bu){var e=an;if(e!==null)throw e}}function fo(e,t,a,r){Bu=!1;var n=e.updateQueue;_r=!1;var i=n.firstBaseUpdate,o=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?i=p:o.next=p,o=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=p:l.next=p,f.lastBaseUpdate=c))}if(i!==null){var b=n.baseState;o=0,f=p=c=null,l=i;do{var d=l.lane&-536870913,h=d!==l.lane;if(h?(qe&d)===d:(r&d)===d){d!==0&&d===un&&(Bu=!0),f!==null&&(f=f.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var w=e,M=l;d=t;var D=a;switch(M.tag){case 1:if(w=M.payload,typeof w=="function"){b=w.call(D,b,d);break e}b=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=M.payload,d=typeof w=="function"?w.call(D,b,d):w,d==null)break e;b=We({},b,d);break e;case 2:_r=!0}}d=l.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=n.callbacks,h===null?n.callbacks=[d]:h.push(d))}else h={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(p=f=h,c=b):f=f.next=h,o|=d;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;h=l,l=h.next,h.next=null,n.lastBaseUpdate=h,n.shared.pending=null}}while(!0);f===null&&(c=b),n.baseState=c,n.firstBaseUpdate=p,n.lastBaseUpdate=f,i===null&&(n.shared.lanes=0),Yr|=o,e.lanes=o,e.memoizedState=b}}function Pg(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function Fg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Pg(a[e],t)}var pn=Ha(null),is=Ha(0);function of(e,t){e=cr,Ke(is,e),Ke(pn,t),cr=e|t.baseLanes}function Ou(){Ke(is,cr),Ke(pn,pn.current)}function Mp(){cr=is.current,xt(pn),xt(is)}var sa=Ha(null),wa=null;function kr(e){var t=e.alternate;Ke(ut,ut.current&1),Ke(sa,e),wa===null&&(t===null||pn.current!==null||t.memoizedState!==null)&&(wa=e)}function Lu(e){Ke(ut,ut.current),Ke(sa,e),wa===null&&(wa=e)}function Ig(e){e.tag===22?(Ke(ut,ut.current),Ke(sa,e),wa===null&&(wa=e)):Nr(e)}function Nr(){Ke(ut,ut.current),Ke(sa,sa.current)}function ea(e){xt(sa),wa===e&&(wa=null),xt(ut)}var ut=Ha(0);function ns(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||rp(a)||ip(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 or=0,he=null,Ge=null,mt=null,os=!1,nn=!1,di=!1,ls=0,Eo=0,on=null,xy=0;function ot(){throw Error(B(321))}function Tp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!la(e[a],t[a]))return!1;return!0}function zp(e,t,a,r,n,i){return or=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,de.H=e===null||e.memoizedState===null?Mh:Gp,di=!1,i=a(r,n),di=!1,nn&&(i=eh(t,a,r,n)),Wg(e),i}function Wg(e){de.H=Mo;var t=Ge!==null&&Ge.next!==null;if(or=0,mt=Ge=he=null,os=!1,Eo=0,on=null,t)throw Error(B(300));e===null||ht||(e=e.dependencies,e!==null&&as(e)&&(ht=!0))}function eh(e,t,a,r){he=e;var n=0;do{if(nn&&(on=null),Eo=0,nn=!1,25<=n)throw Error(B(301));if(n+=1,mt=Ge=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}de.H=Th,i=t(a,r)}while(nn);return i}function ky(){var e=de.H,t=e.useState()[0];return t=typeof t.then=="function"?Go(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(he.flags|=1024),t}function Ap(){var e=ls!==0;return ls=0,e}function Rp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Up(e){if(os){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}os=!1}or=0,mt=Ge=he=null,nn=!1,Eo=ls=0,on=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?he.memoizedState=mt=e:mt=mt.next=e,mt}function pt(){if(Ge===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=mt===null?he.memoizedState:mt.next;if(t!==null)mt=t,Ge=e;else{if(e===null)throw he.alternate===null?Error(B(467)):Error(B(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},mt===null?he.memoizedState=mt=e:mt=mt.next=e}return mt}function Ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Go(e){var t=Eo;return Eo+=1,on===null&&(on=[]),e=Zg(on,e,t),t=he,(mt===null?t.memoizedState:mt.next)===null&&(t=t.alternate,de.H=t===null||t.memoizedState===null?Mh:Gp),e}function zs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Go(e);if(e.$$typeof===Wa)return Ct(e)}throw Error(B(438,String(e)))}function Dp(e){var t=null,a=he.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=he.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ts(),he.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]=s0;return t.index++,a}function lr(e,t){return typeof t=="function"?t(e):t}function Hl(e){var t=pt();return Bp(t,Ge,e)}function Bp(e,t,a){var r=e.queue;if(r===null)throw Error(B(311));r.lastRenderedReducer=a;var n=e.baseQueue,i=r.pending;if(i!==null){if(n!==null){var o=n.next;n.next=i.next,i.next=o}t.baseQueue=n=i,r.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var l=o=null,c=null,p=t,f=!1;do{var b=p.lane&-536870913;if(b!==p.lane?(qe&b)===b:(or&b)===b){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}),b===un&&(f=!0);else if((or&d)===d){p=p.next,d===un&&(f=!0);continue}else b={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=b,o=i):c=c.next=b,he.lanes|=d,Yr|=d;b=p.action,di&&a(i,b),i=p.hasEagerState?p.eagerState:a(i,b)}else d={lane:b,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=d,o=i):c=c.next=d,he.lanes|=b,Yr|=b;p=p.next}while(p!==null&&p!==t);if(c===null?o=i:c.next=l,!la(i,e.memoizedState)&&(ht=!0,f&&(a=an,a!==null)))throw a;e.memoizedState=i,e.baseState=o,e.baseQueue=c,r.lastRenderedState=i}return n===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Jc(e){var t=pt(),a=t.queue;if(a===null)throw Error(B(311));a.lastRenderedReducer=e;var r=a.dispatch,n=a.pending,i=t.memoizedState;if(n!==null){a.pending=null;var o=n=n.next;do i=e(i,o.action),o=o.next;while(o!==n);la(i,t.memoizedState)||(ht=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,r]}function th(e,t,a){var r=he,n=pt(),i=Ee;if(i){if(a===void 0)throw Error(B(407));a=a()}else a=t();var o=!la((Ge||n).memoizedState,a);if(o&&(n.memoizedState=a,ht=!0),n=n.queue,Op(ih.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||mt!==null&&mt.memoizedState.tag&1){if(r.flags|=2048,dn(9,{destroy:void 0},rh.bind(null,r,n,a,t),null),$e===null)throw Error(B(349));i||(or&127)!==0||ah(r,t,a)}return a}function ah(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=Ts(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function rh(e,t,a,r){t.value=a,t.getSnapshot=r,nh(t)&&oh(e)}function ih(e,t,a){return a(function(){nh(t)&&oh(e)})}function nh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!la(e,a)}catch{return!0}}function oh(e){var t=bi(e,2);t!==null&&Vt(t,e,2)}function Hu(e){var t=Dt();if(typeof e=="function"){var a=e;if(e=a(),di){Cr(!0);try{a()}finally{Cr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t}function lh(e,t,a,r){return e.baseState=a,Bp(e,Ge,typeof r=="function"?r:lr)}function Ny(e,t,a,r,n){if(Rs(e))throw Error(B(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};de.T!==null?a(!0):i.isTransition=!1,r(i),a=t.pending,a===null?(i.next=t.pending=i,sh(t,i)):(i.next=a.next,t.pending=a.next=i)}}function sh(e,t){var a=t.action,r=t.payload,n=e.state;if(t.isTransition){var i=de.T,o={};de.T=o;try{var l=a(n,r),c=de.S;c!==null&&c(o,l),lf(e,t,l)}catch(p){ju(e,t,p)}finally{i!==null&&o.types!==null&&(i.types=o.types),de.T=i}}else try{i=a(n,r),lf(e,t,i)}catch(p){ju(e,t,p)}}function lf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){sf(e,t,r)},function(r){return ju(e,t,r)}):sf(e,t,a)}function sf(e,t,a){t.status="fulfilled",t.value=a,ch(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,sh(e,a)))}function ju(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,ch(t),t=t.next;while(t!==r)}e.action=null}function ch(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function uh(e,t){return t}function cf(e,t){if(Ee){var a=$e.formState;if(a!==null){e:{var r=he;if(Ee){if(Ie){t:{for(var n=Ie,i=va;n.nodeType!==8;){if(!i){n=null;break t}if(n=ya(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Ie=ya(n.nextSibling),r=n.data==="F!";break e}}Qr(r)}r=!1}r&&(t=a[0])}}return a=Dt(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uh,lastRenderedState:t},a.queue=r,a=Ch.bind(null,he,r),r.dispatch=a,r=Hu(!1),i=Qp.bind(null,he,!1,r.queue),r=Dt(),n={state:t,dispatch:null,action:e,pending:null},r.queue=n,a=Ny.bind(null,he,n,i,a),n.dispatch=a,r.memoizedState=e,[t,a,!1]}function uf(e){var t=pt();return ph(t,Ge,e)}function ph(e,t,a){if(t=Bp(e,t,uh)[0],e=Hl(lr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Go(t)}catch(o){throw o===_n?Ms:o}else r=t;t=pt();var n=t.queue,i=n.dispatch;return a!==t.memoizedState&&(he.flags|=2048,dn(9,{destroy:void 0},Sy.bind(null,n,a),null)),[r,i,e]}function Sy(e,t){e.action=t}function pf(e){var t=pt(),a=Ge;if(a!==null)return ph(t,a,e);pt(),t=t.memoizedState,a=pt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function dn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=he.updateQueue,t===null&&(t=Ts(),he.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 dh(){return pt().memoizedState}function jl(e,t,a,r){var n=Dt();he.flags|=e,n.memoizedState=dn(1|t,{destroy:void 0},a,r===void 0?null:r)}function As(e,t,a,r){var n=pt();r=r===void 0?null:r;var i=n.memoizedState.inst;Ge!==null&&r!==null&&Tp(r,Ge.memoizedState.deps)?n.memoizedState=dn(t,i,a,r):(he.flags|=e,n.memoizedState=dn(1|t,i,a,r))}function df(e,t){jl(8390656,8,e,t)}function Op(e,t){As(2048,8,e,t)}function Cy(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=Ts(),he.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function mh(e){var t=pt().memoizedState;return Cy({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function fh(e,t){return As(4,2,e,t)}function gh(e,t){return As(4,4,e,t)}function hh(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 bh(e,t,a){a=a!=null?a.concat([e]):null,As(4,4,hh.bind(null,t,e),a)}function Lp(){}function vh(e,t){var a=pt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Tp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function wh(e,t){var a=pt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Tp(t,r[1]))return r[0];if(r=e(),di){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r}function Hp(e,t,a){return a===void 0||(or&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=lb(),he.lanes|=e,Yr|=e,a)}function yh(e,t,a,r){return la(a,t)?a:pn.current!==null?(e=Hp(e,a,r),la(e,t)||(ht=!0),e):(or&42)===0||(or&1073741824)!==0&&(qe&261930)===0?(ht=!0,e.memoizedState=a):(e=lb(),he.lanes|=e,Yr|=e,t)}function _h(e,t,a,r,n){var i=De.p;De.p=i!==0&&8>i?i:8;var o=de.T,l={};de.T=l,Qp(e,!1,t,a);try{var c=n(),p=de.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=_y(c,r);go(e,t,f,oa(e))}else go(e,t,r,oa(e))}catch(b){go(e,t,{then:function(){},status:"rejected",reason:b},oa())}finally{De.p=i,o!==null&&l.types!==null&&(o.types=l.types),de.T=o}}function qy(){}function Qu(e,t,a,r){if(e.tag!==5)throw Error(B(476));var n=xh(e).queue;_h(e,n,t,ii,a===null?qy:function(){return kh(e),a(r)})}function xh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ii,baseState:ii,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:ii},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function kh(e){var t=xh(e);t.next===null&&(t=e.alternate.memoizedState),go(e,t.next.queue,{},oa())}function jp(){return Ct(Ao)}function Nh(){return pt().memoizedState}function Sh(){return pt().memoizedState}function Ey(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=oa();e=Rr(a);var r=Ur(t,e,a);r!==null&&(Vt(r,t,a),po(r,t,a)),t={cache:Sp()},e.payload=t;return}t=t.return}}function My(e,t,a){var r=oa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Rs(e)?qh(t,a):(a=_p(e,t,a,r),a!==null&&(Vt(a,e,r),Eh(a,t,r)))}function Ch(e,t,a){var r=oa();go(e,t,a,r)}function go(e,t,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))qh(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,a);if(n.hasEagerState=!0,n.eagerState=l,la(l,o))return Es(e,t,n,0),$e===null&&qs(),!1}catch{}if(a=_p(e,t,n,r),a!==null)return Vt(a,e,r),Eh(a,t,r),!0}return!1}function Qp(e,t,a,r){if(r={lane:2,revertLane:Pp(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(B(479))}else t=_p(e,a,r,2),t!==null&&Vt(t,e,2)}function Rs(e){var t=e.alternate;return e===he||t!==null&&t===he}function qh(e,t){nn=os=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Eh(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,mg(e,a)}}var Mo={readContext:Ct,use:zs,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Mo.useEffectEvent=ot;var Mh={readContext:Ct,use:zs,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:df,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,jl(4194308,4,hh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return jl(4194308,4,e,t)},useInsertionEffect:function(e,t){jl(4,2,e,t)},useMemo:function(e,t){var a=Dt();t=t===void 0?null:t;var r=e();if(di){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Dt();if(a!==void 0){var n=a(t);if(di){Cr(!0);try{a(t)}finally{Cr(!1)}}}else n=t;return r.memoizedState=r.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=My.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Hu(e);var t=e.queue,a=Ch.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Lp,useDeferredValue:function(e,t){var a=Dt();return Hp(a,e,t)},useTransition:function(){var e=Hu(!1);return e=_h.bind(null,he,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=he,n=Dt();if(Ee){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),$e===null)throw Error(B(349));(qe&127)!==0||ah(r,t,a)}n.memoizedState=a;var i={value:a,getSnapshot:t};return n.queue=i,df(ih.bind(null,r,i,e),[e]),r.flags|=2048,dn(9,{destroy:void 0},rh.bind(null,r,i,a,t),null),a},useId:function(){var e=Dt(),t=$e.identifierPrefix;if(Ee){var a=Ba,r=Da;a=(r&~(1<<32-na(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ls++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=xy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:jp,useFormState:cf,useActionState:cf,useOptimistic:function(e){var t=Dt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Qp.bind(null,he,!0,a),a.dispatch=t,[e,t]},useMemoCache:Dp,useCacheRefresh:function(){return Dt().memoizedState=Ey.bind(null,he)},useEffectEvent:function(e){var t=Dt(),a={impl:e};return t.memoizedState=a,function(){if((Ue&2)!==0)throw Error(B(440));return a.impl.apply(void 0,arguments)}}},Gp={readContext:Ct,use:zs,useCallback:vh,useContext:Ct,useEffect:Op,useImperativeHandle:bh,useInsertionEffect:fh,useLayoutEffect:gh,useMemo:wh,useReducer:Hl,useRef:dh,useState:function(){return Hl(lr)},useDebugValue:Lp,useDeferredValue:function(e,t){var a=pt();return yh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Hl(lr)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Go(e),t]},useSyncExternalStore:th,useId:Nh,useHostTransitionStatus:jp,useFormState:uf,useActionState:uf,useOptimistic:function(e,t){var a=pt();return lh(a,Ge,e,t)},useMemoCache:Dp,useCacheRefresh:Sh};Gp.useEffectEvent=mh;var Th={readContext:Ct,use:zs,useCallback:vh,useContext:Ct,useEffect:Op,useImperativeHandle:bh,useInsertionEffect:fh,useLayoutEffect:gh,useMemo:wh,useReducer:Jc,useRef:dh,useState:function(){return Jc(lr)},useDebugValue:Lp,useDeferredValue:function(e,t){var a=pt();return Ge===null?Hp(a,e,t):yh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Jc(lr)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Go(e),t]},useSyncExternalStore:th,useId:Nh,useHostTransitionStatus:jp,useFormState:pf,useActionState:pf,useOptimistic:function(e,t){var a=pt();return Ge!==null?lh(a,Ge,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Dp,useCacheRefresh:Sh};Th.useEffectEvent=mh;function Pc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:We({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Gu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=oa(),n=Rr(r);n.payload=t,a!=null&&(n.callback=a),t=Ur(e,n,r),t!==null&&(Vt(t,e,r),po(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=oa(),n=Rr(r);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Ur(e,n,r),t!==null&&(Vt(t,e,r),po(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=oa(),r=Rr(a);r.tag=2,t!=null&&(r.callback=t),t=Ur(e,r,a),t!==null&&(Vt(t,e,a),po(t,e,a))}};function mf(e,t,a,r,n,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!No(a,r)||!No(n,i):!0}function ff(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&&Gu.enqueueReplaceState(t,t.state,null)}function mi(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=We({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function zh(e){Wl(e)}function Ah(e){console.error(e)}function Rh(e){Wl(e)}function ss(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function gf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Yu(e,t,a){return a=Rr(a),a.tag=3,a.payload={element:null},a.callback=function(){ss(e,t)},a}function Uh(e){return e=Rr(e),e.tag=3,e}function Dh(e,t,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var i=r.value;e.payload=function(){return n(i)},e.callback=function(){gf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){gf(t,a,r),typeof n!="function"&&(Dr===null?Dr=new Set([this]):Dr.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Ty(e,t,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&yn(t,a,n,!0),a=sa.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?ms():a.alternate===null&<===0&&(lt=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),lu(e,r,n)),!1;case 22:return a.flags|=65536,r===rs?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)),lu(e,r,n)),!1}throw Error(B(435,a.tag))}return lu(e,r,n),ms(),!1}if(Ee)return t=sa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,r!==Tu&&(e=Error(B(422),{cause:r}),Co(ba(e,a)))):(r!==Tu&&(t=Error(B(423),{cause:r}),Co(ba(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,r=ba(r,a),n=Yu(e.stateNode,r,n),Kc(e,n),lt!==4&&(lt=2)),!1;var i=Error(B(520),{cause:r});if(i=ba(i,a),vo===null?vo=[i]:vo.push(i),lt!==4&&(lt=2),t===null)return!0;r=ba(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=Yu(a.stateNode,r,e),Kc(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Dr===null||!Dr.has(i))))return a.flags|=65536,n&=-n,a.lanes|=n,n=Uh(n),Dh(n,e,a,r),Kc(a,n),!1}a=a.return}while(a!==null);return!1}var Yp=Error(B(461)),ht=!1;function kt(e,t,a,r){t.child=e===null?Jg(t,null,a,r):pi(t,e.child,a,r)}function hf(e,t,a,r,n){a=a.render;var i=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return ui(t),r=zp(e,t,a,o,i,n),l=Ap(),e!==null&&!ht?(Rp(e,t,n),sr(e,t,n)):(Ee&&l&&kp(t),t.flags|=1,kt(e,t,r,n),t.child)}function bf(e,t,a,r,n){if(e===null){var i=a.type;return typeof i=="function"&&!xp(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Bh(e,t,i,r,n)):(e=Ol(a.type,null,r,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Vp(e,n)){var o=i.memoizedProps;if(a=a.compare,a=a!==null?a:No,a(o,r)&&e.ref===t.ref)return sr(e,t,n)}return t.flags|=1,e=ar(i,r),e.ref=t.ref,e.return=t,t.child=e}function Bh(e,t,a,r,n){if(e!==null){var i=e.memoizedProps;if(No(i,r)&&e.ref===t.ref)if(ht=!1,t.pendingProps=r=i,Vp(e,n))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,sr(e,t,n)}return Vu(e,t,a,r,n)}function Oh(e,t,a,r){var n=r.children,i=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(i=i!==null?i.baseLanes|a:a,e!==null){for(r=t.child=e.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~i}else r=0,t.child=null;return vf(e,t,i,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ll(t,i!==null?i.cachePool:null),i!==null?of(t,i):Ou(),Ig(t);else return r=t.lanes=536870912,vf(e,t,i!==null?i.baseLanes|a:a,a,r)}else i!==null?(Ll(t,i.cachePool),of(t,i),Nr(t),t.memoizedState=null):(e!==null&&Ll(t,null),Ou(),Nr(t));return kt(e,t,n,a),t.child}function no(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,n){var i=Cp();return i=i===null?null:{parent:gt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Ll(t,null),Ou(),Ig(t),e!==null&&yn(e,t,r,!0),t.childLanes=n,null}function Ql(e,t){return t=cs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wf(e,t,a){return pi(t,e.child,null,a),e=Ql(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function zy(e,t,a){var r=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(r.mode==="hidden")return e=Ql(t,r),t.lanes=536870912,no(null,e);if(Lu(t),(e=Ie)?(e=Mb(e,va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Gg(e),a.return=t,t.child=a,St=t,Ie=null)):e=null,e===null)throw Qr(t);return t.lanes=536870912,null}return Ql(t,r)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(Lu(t),n)if(t.flags&256)t.flags&=-257,t=wf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(ht||yn(e,t,a,!1),n=(a&e.childLanes)!==0,ht||n){if(r=$e,r!==null&&(o=fg(r,a),o!==0&&o!==i.retryLane))throw i.retryLane=o,bi(e,o),Vt(r,e,o),Yp;ms(),t=wf(e,t,a)}else e=i.treeContext,Ie=ya(o.nextSibling),St=t,Ee=!0,Ar=null,va=!1,e!==null&&Vg(t,e),t=Ql(t,r),t.flags|=4096;return t}return e=ar(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gl(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(B(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Vu(e,t,a,r,n){return ui(t),a=zp(e,t,a,r,void 0,n),r=Ap(),e!==null&&!ht?(Rp(e,t,n),sr(e,t,n)):(Ee&&r&&kp(t),t.flags|=1,kt(e,t,a,n),t.child)}function yf(e,t,a,r,n,i){return ui(t),t.updateQueue=null,a=eh(t,r,a,n),Wg(e),r=Ap(),e!==null&&!ht?(Rp(e,t,i),sr(e,t,i)):(Ee&&r&&kp(t),t.flags|=1,kt(e,t,a,i),t.child)}function _f(e,t,a,r,n){if(ui(t),t.stateNode===null){var i=Ji,o=a.contextType;typeof o=="object"&&o!==null&&(i=Ct(o)),i=new a(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Gu,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},Ep(t),o=a.contextType,i.context=typeof o=="object"&&o!==null?Ct(o):Ji,i.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(Pc(t,a,o,r),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&Gu.enqueueReplaceState(i,i.state,null),fo(t,r,i,n),mo(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=mi(a,l);i.props=c;var p=i.context,f=a.contextType;o=Ji,typeof f=="object"&&f!==null&&(o=Ct(f));var b=a.getDerivedStateFromProps;f=typeof b=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||p!==o)&&ff(t,i,r,o),_r=!1;var d=t.memoizedState;i.state=d,fo(t,r,i,n),mo(),p=t.memoizedState,l||d!==p||_r?(typeof b=="function"&&(Pc(t,a,b,r),p=t.memoizedState),(c=_r||mf(t,a,c,r,d,p,o))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=o,r=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Du(e,t),o=t.memoizedProps,f=mi(a,o),i.props=f,b=t.pendingProps,d=i.context,p=a.contextType,c=Ji,typeof p=="object"&&p!==null&&(c=Ct(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==b||d!==c)&&ff(t,i,r,c),_r=!1,d=t.memoizedState,i.state=d,fo(t,r,i,n),mo();var h=t.memoizedState;o!==b||d!==h||_r||e!==null&&e.dependencies!==null&&as(e.dependencies)?(typeof l=="function"&&(Pc(t,a,l,r),h=t.memoizedState),(f=_r||mf(t,a,f,r,d,h,c)||e!==null&&e.dependencies!==null&&as(e.dependencies))?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,h,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,h,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=c,r=f):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,Gl(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=pi(t,e.child,null,n),t.child=pi(t,null,a,n)):kt(e,t,a,n),t.memoizedState=i.state,e=t.child):e=sr(e,t,n),e}function xf(e,t,a,r){return ci(),t.flags|=256,kt(e,t,a,r),t.child}var Fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ic(e){return{baseLanes:e,cachePool:$g()}}function Wc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=aa),e}function Lh(e,t,a){var r=t.pendingProps,n=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(ut.current&2)!==0),o&&(n=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(n?kr(t):Nr(t),(e=Ie)?(e=Mb(e,va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Gg(e),a.return=t,t.child=a,St=t,Ie=null)):e=null,e===null)throw Qr(t);return ip(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,n?(Nr(t),n=t.mode,l=cs({mode:"hidden",children:l},n),r=ni(r,n,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=Ic(a),r.childLanes=Wc(e,o,a),t.memoizedState=Fc,no(null,r)):(kr(t),Xu(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(kr(t),t.flags&=-257,t=eu(e,t,a)):t.memoizedState!==null?(Nr(t),t.child=e.child,t.flags|=128,t=null):(Nr(t),l=r.fallback,n=t.mode,r=cs({mode:"visible",children:r.children},n),l=ni(l,n,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,pi(t,e.child,null,a),r=t.child,r.memoizedState=Ic(a),r.childLanes=Wc(e,o,a),t.memoizedState=Fc,t=no(null,r));else if(kr(t),ip(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(B(419)),r.stack="",r.digest=o,Co({value:r,source:null,stack:null}),t=eu(e,t,a)}else if(ht||yn(e,t,a,!1),o=(a&e.childLanes)!==0,ht||o){if(o=$e,o!==null&&(r=fg(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,bi(e,r),Vt(o,e,r),Yp;rp(l)||ms(),t=eu(e,t,a)}else rp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Ie=ya(l.nextSibling),St=t,Ee=!0,Ar=null,va=!1,e!==null&&Vg(t,e),t=Xu(t,r.children),t.flags|=4096);return t}return n?(Nr(t),l=r.fallback,n=t.mode,c=e.child,p=c.sibling,r=ar(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=ar(p,l):(l=ni(l,n,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,no(null,r),r=t.child,l=e.child.memoizedState,l===null?l=Ic(a):(n=l.cachePool,n!==null?(c=gt._currentValue,n=n.parent!==c?{parent:c,pool:c}:n):n=$g(),l={baseLanes:l.baseLanes|a,cachePool:n}),r.memoizedState=l,r.childLanes=Wc(e,o,a),t.memoizedState=Fc,no(e.child,r)):(kr(t),a=e.child,e=a.sibling,a=ar(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 Xu(e,t){return t=cs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function cs(e,t){return e=ta(22,e,null,t),e.lanes=0,e}function eu(e,t,a){return pi(t,e.child,null,a),e=Xu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Au(e.return,t,a)}function tu(e,t,a,r,n,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=n,o.treeForkCount=i)}function Hh(e,t,a){var r=t.pendingProps,n=r.revealOrder,i=r.tail;r=r.children;var o=ut.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Ke(ut,o),kt(e,t,r,a),r=Ee?So:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kf(e,a,t);else if(e.tag===19)kf(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(n){case"forwards":for(a=t.child,n=null;a!==null;)e=a.alternate,e!==null&&ns(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),tu(t,!1,n,a,i,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&ns(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}tu(t,!0,a,null,i,r);break;case"together":tu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Yr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(yn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,a=ar(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ar(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Vp(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&as(e)))}function Ay(e,t,a){switch(t.tag){case 3:Jl(t,t.stateNode.containerInfo),xr(t,gt,e.memoizedState.cache),ci();break;case 27:case 5:wu(t);break;case 4:Jl(t,t.stateNode.containerInfo);break;case 10:xr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(kr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Lh(e,t,a):(kr(t),e=sr(e,t,a),e!==null?e.sibling:null);kr(t);break;case 19:var n=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(yn(e,t,a,!1),r=(a&t.childLanes)!==0),n){if(r)return Hh(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Ke(ut,ut.current),r)break;return null;case 22:return t.lanes=0,Oh(e,t,a,t.pendingProps);case 24:xr(t,gt,e.memoizedState.cache)}return sr(e,t,a)}function jh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!Vp(e,a)&&(t.flags&128)===0)return ht=!1,Ay(e,t,a);ht=(e.flags&131072)!==0}else ht=!1,Ee&&(t.flags&1048576)!==0&&Yg(t,So,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ai(t.elementType),t.type=e,typeof e=="function")xp(e)?(r=mi(e,r),t.tag=1,t=_f(null,t,e,r,a)):(t.tag=0,t=Vu(null,t,e,r,a));else{if(e!=null){var n=e.$$typeof;if(n===sp){t.tag=11,t=hf(null,t,e,r,a);break e}else if(n===cp){t.tag=14,t=bf(null,t,e,r,a);break e}}throw t=bu(e)||e,Error(B(306,t,""))}}return t;case 0:return Vu(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,n=mi(r,t.pendingProps),_f(e,t,r,n,a);case 3:e:{if(Jl(t,t.stateNode.containerInfo),e===null)throw Error(B(387));r=t.pendingProps;var i=t.memoizedState;n=i.element,Du(e,t),fo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,xr(t,gt,r),r!==i.cache&&Ru(t,[gt],a,!0),mo(),r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=xf(e,t,r,a);break e}else if(r!==n){n=ba(Error(B(424)),t),Co(n),t=xf(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,Ie=ya(e.firstChild),St=t,Ee=!0,Ar=null,va=!0,a=Jg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ci(),r===n){t=sr(e,t,a);break e}kt(e,t,r,a)}t=t.child}return t;case 26:return Gl(e,t),e===null?(a=Xf(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ee||(a=t.type,e=t.pendingProps,r=bs(zr.current).createElement(a),r[Nt]=t,r[Xt]=e,qt(r,a,e),_t(r),t.stateNode=r):t.memoizedState=Xf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return wu(t),e===null&&Ee&&(r=t.stateNode=Tb(t.type,t.pendingProps,zr.current),St=t,va=!0,n=Ie,Xr(t.type)?(np=n,Ie=ya(r.firstChild)):Ie=n),kt(e,t,t.pendingProps.children,a),Gl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((n=r=Ie)&&(r=o1(r,t.type,t.pendingProps,va),r!==null?(t.stateNode=r,St=t,Ie=ya(r.firstChild),va=!1,n=!0):n=!1),n||Qr(t)),wu(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,r=i.children,tp(n,i)?r=null:o!==null&&tp(n,o)&&(t.flags|=32),t.memoizedState!==null&&(n=zp(e,t,ky,null,null,a),Ao._currentValue=n),Gl(e,t),kt(e,t,r,a),t.child;case 6:return e===null&&Ee&&((e=a=Ie)&&(a=l1(a,t.pendingProps,va),a!==null?(t.stateNode=a,St=t,Ie=null,e=!0):e=!1),e||Qr(t)),null;case 13:return Lh(e,t,a);case 4:return Jl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pi(t,null,r,a):kt(e,t,r,a),t.child;case 11:return hf(e,t,t.type,t.pendingProps,a);case 7:return kt(e,t,t.pendingProps,a),t.child;case 8:return kt(e,t,t.pendingProps.children,a),t.child;case 12:return kt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,xr(t,t.type,r.value),kt(e,t,r.children,a),t.child;case 9:return n=t.type._context,r=t.pendingProps.children,ui(t),n=Ct(n),r=r(n),t.flags|=1,kt(e,t,r,a),t.child;case 14:return bf(e,t,t.type,t.pendingProps,a);case 15:return Bh(e,t,t.type,t.pendingProps,a);case 19:return Hh(e,t,a);case 31:return zy(e,t,a);case 22:return Oh(e,t,a,t.pendingProps);case 24:return ui(t),r=Ct(gt),e===null?(n=Cp(),n===null&&(n=$e,i=Sp(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=a),n=i),t.memoizedState={parent:r,cache:n},Ep(t),xr(t,gt,n)):((e.lanes&a)!==0&&(Du(e,t),fo(t,null,null,a),mo()),n=e.memoizedState,i=t.memoizedState,n.parent!==r?(n={parent:r,cache:r},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),xr(t,gt,r)):(r=i.cache,xr(t,gt,r),r!==n.cache&&Ru(t,[gt],a,!0))),kt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function Za(e){e.flags|=4}function au(e,t,a,r,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(ub())e.flags|=8192;else throw li=rs,qp}else e.flags&=-16777217}function Nf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rb(t))if(ub())e.flags|=8192;else throw li=rs,qp}function Cl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?pg():536870912,e.lanes|=t,mn|=t)}function In(e,t){if(!Ee)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 Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Ry(e,t,a){var r=t.pendingProps;switch(Np(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),rr(gt),ln(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?Za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zc())),Fe(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Za(t),i!==null?(Fe(t),Nf(t,i)):(Fe(t),au(t,n,null,r,a))):i?i!==e.memoizedState?(Za(t),Fe(t),Nf(t,i)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Za(t),Fe(t),au(t,n,e,r,a)),null;case 27:if(Pl(t),a=zr.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Fe(t),null}e=La.current,Oi(t)?Im(t,e):(e=Tb(n,r,a),t.stateNode=e,Za(t))}return Fe(t),null;case 5:if(Pl(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Fe(t),null}if(i=La.current,Oi(t))Im(t,i);else{var o=bs(zr.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?o.createElement(n,{is:r.is}):o.createElement(n)}}i[Nt]=t,i[Xt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.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=i;e:switch(qt(i,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Za(t)}}return Fe(t),au(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(e=zr.current,Oi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,n=St,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Cb(e.nodeValue,a)),e||Qr(t,!0)}else e=bs(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return Fe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Oi(t),a!==null){if(e===null){if(!r)throw Error(B(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(557));e[Nt]=t}else ci(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else a=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(B(558))}return Fe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Oi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(B(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(B(317));n[Nt]=t}else ci(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),n=!1}else n=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==n&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Cl(t,t.updateQueue),Fe(t),null);case 4:return ln(),e===null&&Fp(t.stateNode.containerInfo),Fe(t),null;case 10:return rr(t.type),Fe(t),null;case 19:if(xt(ut),r=t.memoizedState,r===null)return Fe(t),null;if(n=(t.flags&128)!==0,i=r.rendering,i===null)if(n)In(r,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=ns(e),i!==null){for(t.flags|=128,In(r,!1),e=i.updateQueue,t.updateQueue=e,Cl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Qg(a,e),a=a.sibling;return Ke(ut,ut.current&1|2),Ee&&Fa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ra()>ps&&(t.flags|=128,n=!0,In(r,!1),t.lanes=4194304)}else{if(!n)if(e=ns(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Cl(t,e),In(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Ee)return Fe(t),null}else 2*ra()-r.renderingStartTime>ps&&a!==536870912&&(t.flags|=128,n=!0,In(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ra(),e.sibling=null,a=ut.current,Ke(ut,n?a&1|2:a&1),Ee&&Fa(t,r.treeForkCount),e):(Fe(t),null);case 22:case 23:return ea(t),Mp(),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&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),a=t.updateQueue,a!==null&&Cl(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&&xt(oi),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),rr(gt),Fe(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function Uy(e,t){switch(Np(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rr(gt),ln(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pl(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(B(340));ci()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));ci()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(ut),null;case 4:return ln(),null;case 10:return rr(t.type),null;case 22:case 23:return ea(t),Mp(),e!==null&&xt(oi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return rr(gt),null;case 25:return null;default:return null}}function Qh(e,t){switch(Np(t),t.tag){case 3:rr(gt),ln();break;case 26:case 27:case 5:Pl(t);break;case 4:ln();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:xt(ut);break;case 10:rr(t.type);break;case 22:case 23:ea(t),Mp(),e!==null&&xt(oi);break;case 24:rr(gt)}}function Yo(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&e)===e){r=void 0;var i=a.create,o=a.inst;r=i(),o.destroy=r}a=a.next}while(a!==n)}}catch(l){Oe(t,t.return,l)}}function Gr(e,t,a){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var i=n.next;r=i;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,n=t;var c=a,p=l;try{p()}catch(f){Oe(n,c,f)}}}r=r.next}while(r!==i)}}catch(f){Oe(t,t.return,f)}}function Gh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Fg(t,a)}catch(r){Oe(e,e.return,r)}}}function Yh(e,t,a){a.props=mi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Oe(e,t,r)}}function ho(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(n){Oe(e,t,n)}}function Oa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Oe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Oe(e,t,n)}else a.current=null}function Vh(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(n){Oe(e,e.return,n)}}function ru(e,t,a){try{var r=e.stateNode;e1(r,e.type,a,t),r[Xt]=t}catch(n){Oe(e,e.return,n)}}function Xh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xr(e.type)||e.tag===4}function iu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xh(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&&Xr(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 $u(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=er));else if(r!==4&&(r===27&&Xr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for($u(e,t,a),e=e.sibling;e!==null;)$u(e,t,a),e=e.sibling}function us(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&&Xr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(us(e,t,a),e=e.sibling;e!==null;)us(e,t,a),e=e.sibling}function $h(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);qt(t,r,a),t[Nt]=e,t[Xt]=a}catch(i){Oe(e,e.return,i)}}var Ia=!1,ft=!1,nu=!1,Sf=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Dy(e,t){if(e=e.containerInfo,Wu=_s,e=Rg(e),wp(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 n=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,f=0,b=e,d=null;t:for(;;){for(var h;b!==a||n!==0&&b.nodeType!==3||(l=o+n),b!==i||r!==0&&b.nodeType!==3||(c=o+r),b.nodeType===3&&(o+=b.nodeValue.length),(h=b.firstChild)!==null;)d=b,b=h;for(;;){if(b===e)break t;if(d===a&&++p===n&&(l=o),d===i&&++f===r&&(c=o),(h=b.nextSibling)!==null)break;b=d,d=b.parentNode}b=h}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(ep={focusedElem:e,selectionRange:a},_s=!1,yt=t;yt!==null;)if(t=yt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,yt=e;else for(;yt!==null;){switch(t=yt,i=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++)n=e[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,n=i.memoizedProps,i=i.memoizedState,r=a.stateNode;try{var w=mi(a.type,n);e=r.getSnapshotBeforeUpdate(w,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(M){Oe(a,a.return,M)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)ap(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ap(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(B(163))}if(e=t.sibling,e!==null){e.return=t.return,yt=e;break}yt=t.return}}function Zh(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ja(e,a),r&4&&Yo(5,a);break;case 1:if(Ja(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Oe(a,a.return,o)}else{var n=mi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Oe(a,a.return,o)}}r&64&&Gh(a),r&512&&ho(a,a.return);break;case 3:if(Ja(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{Fg(e,t)}catch(o){Oe(a,a.return,o)}}break;case 27:t===null&&r&4&&$h(a);case 26:case 5:Ja(e,a),t===null&&r&4&&Vh(a),r&512&&ho(a,a.return);break;case 12:Ja(e,a);break;case 31:Ja(e,a),r&4&&Ph(e,a);break;case 13:Ja(e,a),r&4&&Fh(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Vy.bind(null,a),s1(e,a))));break;case 22:if(r=a.memoizedState!==null||Ia,!r){t=t!==null&&t.memoizedState!==null||ft,n=Ia;var i=ft;Ia=r,(ft=t)&&!i?Pa(e,a,(a.subtreeFlags&8772)!==0):Ja(e,a),Ia=n,ft=i}break;case 30:break;default:Ja(e,a)}}function Kh(e){var t=e.alternate;t!==null&&(e.alternate=null,Kh(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 rt=null,Gt=!1;function Ka(e,t,a){for(a=a.child;a!==null;)Jh(e,t,a),a=a.sibling}function Jh(e,t,a){if(ia&&typeof ia.onCommitFiberUnmount=="function")try{ia.onCommitFiberUnmount(Bo,a)}catch{}switch(a.tag){case 26:ft||Oa(a,t),Ka(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ft||Oa(a,t);var r=rt,n=Gt;Xr(a.type)&&(rt=a.stateNode,Gt=!1),Ka(e,t,a),yo(a.stateNode),rt=r,Gt=n;break;case 5:ft||Oa(a,t);case 6:if(r=rt,n=Gt,rt=null,Ka(e,t,a),rt=r,Gt=n,rt!==null)if(Gt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(a.stateNode)}catch(i){Oe(a,t,i)}else try{rt.removeChild(a.stateNode)}catch(i){Oe(a,t,i)}break;case 18:rt!==null&&(Gt?(e=rt,jf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),bn(e)):jf(rt,a.stateNode));break;case 4:r=rt,n=Gt,rt=a.stateNode.containerInfo,Gt=!0,Ka(e,t,a),rt=r,Gt=n;break;case 0:case 11:case 14:case 15:Gr(2,a,t),ft||Gr(4,a,t),Ka(e,t,a);break;case 1:ft||(Oa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Yh(a,t,r)),Ka(e,t,a);break;case 21:Ka(e,t,a);break;case 22:ft=(r=ft)||a.memoizedState!==null,Ka(e,t,a),ft=r;break;default:Ka(e,t,a)}}function Ph(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bn(e)}catch(a){Oe(t,t.return,a)}}}function Fh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bn(e)}catch(a){Oe(t,t.return,a)}}function By(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sf),t;default:throw Error(B(435,e.tag))}}function ql(e,t){var a=By(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var n=Xy.bind(null,e,r);r.then(n,n)}})}function jt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Xr(l.type)){rt=l.stateNode,Gt=!1;break e}break;case 5:rt=l.stateNode,Gt=!1;break e;case 3:case 4:rt=l.stateNode.containerInfo,Gt=!0;break e}l=l.return}if(rt===null)throw Error(B(160));Jh(i,o,n),rt=null,Gt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ih(t,e),t=t.sibling}var za=null;function Ih(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jt(t,e),Qt(e),r&4&&(Gr(3,e,e.return),Yo(3,e),Gr(5,e,e.return));break;case 1:jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),r&64&&Ia&&(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 n=za;if(jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),r&4){var i=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,n=n.ownerDocument||n;t:switch(r){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Ho]||i[Nt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(r),n.head.insertBefore(i,n.querySelector("head > title"))),qt(i,r,a),i[Nt]=e,_t(i),r=i;break e;case"link":var o=Zf("link","href",n).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;case"meta":if(o=Zf("meta","content",n).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;default:throw Error(B(468,r))}i[Nt]=e,_t(i),r=i}e.stateNode=r}else Kf(n,e.type,e.stateNode);else e.stateNode=$f(n,r,e.memoizedProps);else i!==r?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,r===null?Kf(n,e.type,e.stateNode):$f(n,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ru(e,e.memoizedProps,a.memoizedProps)}break;case 27:jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),a!==null&&r&4&&ru(e,e.memoizedProps,a.memoizedProps);break;case 5:if(jt(t,e),Qt(e),r&512&&(ft||a===null||Oa(a,a.return)),e.flags&32){n=e.stateNode;try{cn(n,"")}catch(w){Oe(e,e.return,w)}}r&4&&e.stateNode!=null&&(n=e.memoizedProps,ru(e,n,a!==null?a.memoizedProps:n)),r&1024&&(nu=!0);break;case 6:if(jt(t,e),Qt(e),r&4){if(e.stateNode===null)throw Error(B(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(w){Oe(e,e.return,w)}}break;case 3:if(Xl=null,n=za,za=vs(t.containerInfo),jt(t,e),za=n,Qt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(w){Oe(e,e.return,w)}nu&&(nu=!1,Wh(e));break;case 4:r=za,za=vs(e.stateNode.containerInfo),jt(t,e),Qt(e),za=r;break;case 12:jt(t,e),Qt(e);break;case 31:jt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ql(e,r)));break;case 13:jt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Us=ra()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ql(e,r)));break;case 22:n=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=Ia,f=ft;if(Ia=p||n,ft=f||c,jt(t,e),ft=f,Ia=p,Qt(e),r&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||c||Ia||ft||ri(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(i=c.stateNode,n)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var b=c.memoizedProps.style,d=b!=null&&b.hasOwnProperty("display")?b.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(w){Oe(c,c.return,w)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=n?"":c.memoizedProps}catch(w){Oe(c,c.return,w)}}}else if(t.tag===18){if(a===null){c=t;try{var h=c.stateNode;n?Qf(h,!0):Qf(c.stateNode,!1)}catch(w){Oe(c,c.return,w)}}}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,ql(e,a))));break;case 19:jt(t,e),Qt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ql(e,r)));break;case 30:break;case 21:break;default:jt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Xh(r)){a=r;break}r=r.return}if(a==null)throw Error(B(160));switch(a.tag){case 27:var n=a.stateNode,i=iu(e);us(e,i,n);break;case 5:var o=a.stateNode;a.flags&32&&(cn(o,""),a.flags&=-33);var l=iu(e);us(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=iu(e);$u(e,p,c);break;default:throw Error(B(161))}}catch(f){Oe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zh(e,t.alternate,t),t=t.sibling}function ri(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),ri(t);break;case 1:Oa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Yh(t,t.return,a),ri(t);break;case 27:yo(t.stateNode);case 26:case 5:Oa(t,t.return),ri(t);break;case 22:t.memoizedState===null&&ri(t);break;case 30:ri(t);break;default:ri(t)}e=e.sibling}}function Pa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,n=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Pa(n,i,a),Yo(4,i);break;case 1:if(Pa(n,i,a),r=i,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(p){Oe(r,r.return,p)}if(r=i,n=r.updateQueue,n!==null){var l=r.stateNode;try{var c=n.shared.hiddenCallbacks;if(c!==null)for(n.shared.hiddenCallbacks=null,n=0;n<c.length;n++)Pg(c[n],l)}catch(p){Oe(r,r.return,p)}}a&&o&64&&Gh(i),ho(i,i.return);break;case 27:$h(i);case 26:case 5:Pa(n,i,a),a&&r===null&&o&4&&Vh(i),ho(i,i.return);break;case 12:Pa(n,i,a);break;case 31:Pa(n,i,a),a&&o&4&&Ph(n,i);break;case 13:Pa(n,i,a),a&&o&4&&Fh(n,i);break;case 22:i.memoizedState===null&&Pa(n,i,a),ho(i,i.return);break;case 30:break;default:Pa(n,i,a)}t=t.sibling}}function Xp(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&&Qo(a))}function $p(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qo(e))}function Ta(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)eb(e,t,a,r),t=t.sibling}function eb(e,t,a,r){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ta(e,t,a,r),n&2048&&Yo(9,t);break;case 1:Ta(e,t,a,r);break;case 3:Ta(e,t,a,r),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qo(e)));break;case 12:if(n&2048){Ta(e,t,a,r),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Oe(t,t.return,c)}}else Ta(e,t,a,r);break;case 31:Ta(e,t,a,r);break;case 13:Ta(e,t,a,r);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Ta(e,t,a,r):bo(e,t):i._visibility&2?Ta(e,t,a,r):(i._visibility|=2,Hi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Xp(o,t);break;case 24:Ta(e,t,a,r),n&2048&&$p(t.alternate,t);break;default:Ta(e,t,a,r)}}function Hi(e,t,a,r,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Hi(i,o,l,c,n),Yo(8,o);break;case 23:break;case 22:var f=o.stateNode;o.memoizedState!==null?f._visibility&2?Hi(i,o,l,c,n):bo(i,o):(f._visibility|=2,Hi(i,o,l,c,n)),n&&p&2048&&Xp(o.alternate,o);break;case 24:Hi(i,o,l,c,n),n&&p&2048&&$p(o.alternate,o);break;default:Hi(i,o,l,c,n)}t=t.sibling}}function bo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,n=r.flags;switch(r.tag){case 22:bo(a,r),n&2048&&Xp(r.alternate,r);break;case 24:bo(a,r),n&2048&&$p(r.alternate,r);break;default:bo(a,r)}t=t.sibling}}var oo=8192;function Li(e,t,a){if(e.subtreeFlags&oo)for(e=e.child;e!==null;)tb(e,t,a),e=e.sibling}function tb(e,t,a){switch(e.tag){case 26:Li(e,t,a),e.flags&oo&&e.memoizedState!==null&&y1(a,za,e.memoizedState,e.memoizedProps);break;case 5:Li(e,t,a);break;case 3:case 4:var r=za;za=vs(e.stateNode.containerInfo),Li(e,t,a),za=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=oo,oo=16777216,Li(e,t,a),oo=r):Li(e,t,a));break;default:Li(e,t,a)}}function ab(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 Wn(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];yt=r,ib(r,e)}ab(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rb(e),e=e.sibling}function rb(e){switch(e.tag){case 0:case 11:case 15:Wn(e),e.flags&2048&&Gr(9,e,e.return);break;case 3:Wn(e);break;case 12:Wn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yl(e)):Wn(e);break;default:Wn(e)}}function Yl(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];yt=r,ib(r,e)}ab(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gr(8,t,t.return),Yl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Yl(t));break;default:Yl(t)}e=e.sibling}}function ib(e,t){for(;yt!==null;){var a=yt;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:Qo(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,yt=r;else e:for(a=e;yt!==null;){r=yt;var n=r.sibling,i=r.return;if(Kh(r),r===a){yt=null;break e}if(n!==null){n.return=i,yt=n;break e}yt=i}}}var Oy={getCacheForType:function(e){var t=Ct(gt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ct(gt).controller.signal}},Ly=typeof WeakMap=="function"?WeakMap:Map,Ue=0,$e=null,Ne=null,qe=0,Be=0,Wt=null,Er=!1,xn=!1,Zp=!1,cr=0,lt=0,Yr=0,si=0,Kp=0,aa=0,mn=0,vo=null,Yt=null,Zu=!1,Us=0,nb=0,ps=1/0,ds=null,Dr=null,bt=0,Br=null,fn=null,ir=0,Ku=0,Ju=null,ob=null,wo=0,Pu=null;function oa(){return(Ue&2)!==0&&qe!==0?qe&-qe:de.T!==null?Pp():gg()}function lb(){if(aa===0)if((qe&536870912)===0||Ee){var e=bl;bl<<=1,(bl&3932160)===0&&(bl=262144),aa=e}else aa=536870912;return e=sa.current,e!==null&&(e.flags|=32),aa}function Vt(e,t,a){(e===$e&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(gn(e,0),Mr(e,qe,aa,!1)),Lo(e,a),((Ue&2)===0||e!==$e)&&(e===$e&&((Ue&2)===0&&(si|=a),lt===4&&Mr(e,qe,aa,!1)),ja(e))}function sb(e,t,a){if((Ue&6)!==0)throw Error(B(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Oo(e,t),n=r?Qy(e,t):ou(e,t,!0),i=r;do{if(n===0){xn&&!r&&Mr(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Hy(a)){n=ou(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)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;n=vo;var c=l.current.memoizedState.isDehydrated;if(c&&(gn(l,o).flags|=256),o=ou(l,o,!1),o!==2){if(Zp&&!c){l.errorRecoveryDisabledLanes|=i,si|=i,n=4;break e}i=Yt,Yt=n,i!==null&&(Yt===null?Yt=i:Yt.push.apply(Yt,i))}n=o}if(i=!1,n!==2)continue}}if(n===1){gn(e,0),Mr(e,t,0,!0);break}e:{switch(r=e,i=n,i){case 0:case 1:throw Error(B(345));case 4:if((t&4194048)!==t)break;case 6:Mr(r,t,aa,!Er);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(n=Us+300-ra(),10<n)){if(Mr(r,t,aa,!Er),ks(r,0,!0)!==0)break e;ir=t,r.timeoutHandle=Eb(Cf.bind(null,r,a,Yt,ds,Zu,t,aa,si,mn,Er,i,"Throttled",-0,0),n);break e}Cf(r,a,Yt,ds,Zu,t,aa,si,mn,Er,i,null,-0,0)}}break}while(!0);ja(e)}function Cf(e,t,a,r,n,i,o,l,c,p,f,b,d,h){if(e.timeoutHandle=-1,b=t.subtreeFlags,b&8192||(b&16785408)===16785408){b={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:er},tb(t,i,b);var w=(i&62914560)===i?Us-ra():(i&4194048)===i?nb-ra():0;if(w=_1(b,w),w!==null){ir=i,e.cancelPendingCommit=w(Ef.bind(null,e,t,i,a,r,n,o,l,c,f,b,null,d,h)),Mr(e,i,o,!p);return}}Ef(e,t,i,a,r,n,o,l,c)}function Hy(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 n=a[r],i=n.getSnapshot;n=n.value;try{if(!la(i(),n))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 Mr(e,t,a,r){t&=~Kp,t&=~si,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var n=t;0<n;){var i=31-na(n),o=1<<i;r[i]=-1,n&=~o}a!==0&&dg(e,a,t)}function Ds(){return(Ue&6)===0?(Vo(0,!1),!1):!0}function Jp(){if(Ne!==null){if(Be===0)var e=Ne.return;else e=Ne,tr=vi=null,Up(e),rn=null,qo=0,e=Ne;for(;e!==null;)Qh(e.alternate,e),e=e.return;Ne=null}}function gn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,r1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ir=0,Jp(),$e=e,Ne=a=ar(e.current,null),qe=t,Be=0,Wt=null,Er=!1,xn=Oo(e,t),Zp=!1,mn=aa=Kp=si=Yr=lt=0,Yt=vo=null,Zu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var n=31-na(r),i=1<<n;t|=e[n],r&=~i}return cr=t,qs(),a}function cb(e,t){he=null,de.H=Mo,t===_n||t===Ms?(t=rf(),Be=3):t===qp?(t=rf(),Be=4):Be=t===Yp?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,Ne===null&&(lt=1,ss(e,ba(t,e.current)))}function ub(){var e=sa.current;return e===null?!0:(qe&4194048)===qe?wa===null:(qe&62914560)===qe||(qe&536870912)!==0?e===wa:!1}function pb(){var e=de.H;return de.H=Mo,e===null?Mo:e}function db(){var e=de.A;return de.A=Oy,e}function ms(){lt=4,Er||(qe&4194048)!==qe&&sa.current!==null||(xn=!0),(Yr&134217727)===0&&(si&134217727)===0||$e===null||Mr($e,qe,aa,!1)}function ou(e,t,a){var r=Ue;Ue|=2;var n=pb(),i=db();($e!==e||qe!==t)&&(ds=null,gn(e,t)),t=!1;var o=lt;e:do try{if(Be!==0&&Ne!==null){var l=Ne,c=Wt;switch(Be){case 8:Jp(),o=6;break e;case 3:case 2:case 9:case 6:sa.current===null&&(t=!0);var p=Be;if(Be=0,Wt=null,Ii(e,l,c,p),a&&xn){o=0;break e}break;default:p=Be,Be=0,Wt=null,Ii(e,l,c,p)}}jy(),o=lt;break}catch(f){cb(e,f)}while(!0);return t&&e.shellSuspendCounter++,tr=vi=null,Ue=r,de.H=n,de.A=i,Ne===null&&($e=null,qe=0,qs()),o}function jy(){for(;Ne!==null;)mb(Ne)}function Qy(e,t){var a=Ue;Ue|=2;var r=pb(),n=db();$e!==e||qe!==t?(ds=null,ps=ra()+500,gn(e,t)):xn=Oo(e,t);e:do try{if(Be!==0&&Ne!==null){t=Ne;var i=Wt;t:switch(Be){case 1:Be=0,Wt=null,Ii(e,t,i,1);break;case 2:case 9:if(af(i)){Be=0,Wt=null,qf(t);break}t=function(){Be!==2&&Be!==9||$e!==e||(Be=7),ja(e)},i.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:af(i)?(Be=0,Wt=null,qf(t)):(Be=0,Wt=null,Ii(e,t,i,7));break;case 5:var o=null;switch(Ne.tag){case 26:o=Ne.memoizedState;case 5:case 27:var l=Ne;if(o?Rb(o):l.stateNode.complete){Be=0,Wt=null;var c=l.sibling;if(c!==null)Ne=c;else{var p=l.return;p!==null?(Ne=p,Bs(p)):Ne=null}break t}}Be=0,Wt=null,Ii(e,t,i,5);break;case 6:Be=0,Wt=null,Ii(e,t,i,6);break;case 8:Jp(),lt=6;break e;default:throw Error(B(462))}}Gy();break}catch(f){cb(e,f)}while(!0);return tr=vi=null,de.H=r,de.A=n,Ue=a,Ne!==null?0:($e=null,qe=0,qs(),lt)}function Gy(){for(;Ne!==null&&!p0();)mb(Ne)}function mb(e){var t=jh(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?Bs(e):Ne=t}function qf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=yf(a,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=yf(a,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Up(t);default:Qh(a,t),t=Ne=Qg(t,cr),t=jh(a,t,cr)}e.memoizedProps=e.pendingProps,t===null?Bs(e):Ne=t}function Ii(e,t,a,r){tr=vi=null,Up(t),rn=null,qo=0;var n=t.return;try{if(Ty(e,n,t,a,qe)){lt=1,ss(e,ba(a,e.current)),Ne=null;return}}catch(i){if(n!==null)throw Ne=n,i;lt=1,ss(e,ba(a,e.current)),Ne=null;return}t.flags&32768?(Ee||r===1?e=!0:xn||(qe&536870912)!==0?e=!1:(Er=e=!0,(r===2||r===9||r===3||r===6)&&(r=sa.current,r!==null&&r.tag===13&&(r.flags|=16384))),fb(t,e)):Bs(t)}function Bs(e){var t=e;do{if((t.flags&32768)!==0){fb(t,Er);return}e=t.return;var a=Ry(t.alternate,t,cr);if(a!==null){Ne=a;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);lt===0&&(lt=5)}function fb(e,t){do{var a=Uy(e.alternate,e);if(a!==null){a.flags&=32767,Ne=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=a}while(e!==null);lt=6,Ne=null}function Ef(e,t,a,r,n,i,o,l,c){e.cancelPendingCommit=null;do Os();while(bt!==0);if((Ue&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));if(i=t.lanes|t.childLanes,i|=yp,_0(e,a,i,o,l,c),e===$e&&(Ne=$e=null,qe=0),fn=t,Br=e,ir=a,Ku=i,Ju=n,ob=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$y(Fl,function(){return wb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=de.T,de.T=null,n=De.p,De.p=2,o=Ue,Ue|=4;try{Dy(e,t,a)}finally{Ue=o,De.p=n,de.T=r}}bt=1,gb(),hb(),bb()}}function gb(){if(bt===1){bt=0;var e=Br,t=fn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=de.T,de.T=null;var r=De.p;De.p=2;var n=Ue;Ue|=4;try{Ih(t,e);var i=ep,o=Rg(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&Ag(l.ownerDocument.documentElement,l)){if(c!==null&&wp(l)){var p=c.start,f=c.end;if(f===void 0&&(f=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(f,l.value.length);else{var b=l.ownerDocument||document,d=b&&b.defaultView||window;if(d.getSelection){var h=d.getSelection(),w=l.textContent.length,M=Math.min(c.start,w),D=c.end===void 0?M:Math.min(c.end,w);!h.extend&&M>D&&(o=D,D=M,M=o);var m=Jm(l,M),u=Jm(l,D);if(m&&u&&(h.rangeCount!==1||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==u.node||h.focusOffset!==u.offset)){var g=b.createRange();g.setStart(m.node,m.offset),h.removeAllRanges(),M>D?(h.addRange(g),h.extend(u.node,u.offset)):(g.setEnd(u.node,u.offset),h.addRange(g))}}}}for(b=[],h=l;h=h.parentNode;)h.nodeType===1&&b.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<b.length;l++){var v=b[l];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}_s=!!Wu,ep=Wu=null}finally{Ue=n,De.p=r,de.T=a}}e.current=t,bt=2}}function hb(){if(bt===2){bt=0;var e=Br,t=fn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=de.T,de.T=null;var r=De.p;De.p=2;var n=Ue;Ue|=4;try{Zh(e,t.alternate,t)}finally{Ue=n,De.p=r,de.T=a}}bt=3}}function bb(){if(bt===4||bt===3){bt=0,d0();var e=Br,t=fn,a=ir,r=ob;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?bt=5:(bt=0,fn=Br=null,vb(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Dr=null),dp(a),t=t.stateNode,ia&&typeof ia.onCommitFiberRoot=="function")try{ia.onCommitFiberRoot(Bo,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=de.T,n=De.p,De.p=2,de.T=null;try{for(var i=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];i(l.value,{componentStack:l.stack})}}finally{de.T=t,De.p=n}}(ir&3)!==0&&Os(),ja(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===Pu?wo++:(wo=0,Pu=e):wo=0,Vo(0,!1)}}function vb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qo(t)))}function Os(){return gb(),hb(),bb(),wb()}function wb(){if(bt!==5)return!1;var e=Br,t=Ku;Ku=0;var a=dp(ir),r=de.T,n=De.p;try{De.p=32>a?32:a,de.T=null,a=Ju,Ju=null;var i=Br,o=ir;if(bt=0,fn=Br=null,ir=0,(Ue&6)!==0)throw Error(B(331));var l=Ue;if(Ue|=4,rb(i.current),eb(i,i.current,o,a),Ue=l,Vo(0,!1),ia&&typeof ia.onPostCommitFiberRoot=="function")try{ia.onPostCommitFiberRoot(Bo,i)}catch{}return!0}finally{De.p=n,de.T=r,vb(e,t)}}function Mf(e,t,a){t=ba(a,t),t=Yu(e.stateNode,t,2),e=Ur(e,t,2),e!==null&&(Lo(e,2),ja(e))}function Oe(e,t,a){if(e.tag===3)Mf(e,e,a);else for(;t!==null;){if(t.tag===3){Mf(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dr===null||!Dr.has(r))){e=ba(a,e),a=Uh(2),r=Ur(t,a,2),r!==null&&(Dh(a,r,t,e),Lo(r,2),ja(r));break}}t=t.return}}function lu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Ly;var n=new Set;r.set(t,n)}else n=r.get(t),n===void 0&&(n=new Set,r.set(t,n));n.has(a)||(Zp=!0,n.add(a),e=Yy.bind(null,e,t,a),t.then(e,e))}function Yy(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(qe&a)===a&&(lt===4||lt===3&&(qe&62914560)===qe&&300>ra()-Us?(Ue&2)===0&&gn(e,0):Kp|=a,mn===qe&&(mn=0)),ja(e)}function yb(e,t){t===0&&(t=pg()),e=bi(e,t),e!==null&&(Lo(e,t),ja(e))}function Vy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),yb(e,a)}function Xy(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(B(314))}r!==null&&r.delete(t),yb(e,a)}function $y(e,t){return up(e,t)}var fs=null,ji=null,Fu=!1,gs=!1,su=!1,Tr=0;function ja(e){e!==ji&&e.next===null&&(ji===null?fs=ji=e:ji=ji.next=e),gs=!0,Fu||(Fu=!0,Ky())}function Vo(e,t){if(!su&&gs){su=!0;do for(var a=!1,r=fs;r!==null;){if(!t)if(e!==0){var n=r.pendingLanes;if(n===0)var i=0;else{var o=r.suspendedLanes,l=r.pingedLanes;i=(1<<31-na(42|e)+1)-1,i&=n&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Tf(r,i))}else i=qe,i=ks(r,r===$e?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||Oo(r,i)||(a=!0,Tf(r,i));r=r.next}while(a);su=!1}}function Zy(){_b()}function _b(){gs=Fu=!1;var e=0;Tr!==0&&a1()&&(e=Tr);for(var t=ra(),a=null,r=fs;r!==null;){var n=r.next,i=xb(r,t);i===0?(r.next=null,a===null?fs=n:a.next=n,n===null&&(ji=a)):(a=r,(e!==0||(i&3)!==0)&&(gs=!0)),r=n}bt!==0&&bt!==5||Vo(e,!1),Tr!==0&&(Tr=0)}function xb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-na(i),l=1<<o,c=n[o];c===-1?((l&a)===0||(l&r)!==0)&&(n[o]=y0(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=$e,a=qe,a=ks(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Oo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Oc(r),dp(a)){case 2:case 8:a=cg;break;case 32:a=Fl;break;case 268435456:a=ug;break;default:a=Fl}return r=kb.bind(null,e),a=up(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Oc(r),e.callbackPriority=2,e.callbackNode=null,2}function kb(e,t){if(bt!==0&&bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Os()&&e.callbackNode!==a)return null;var r=qe;return r=ks(e,e===$e?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(sb(e,r,t),xb(e,ra()),e.callbackNode!=null&&e.callbackNode===a?kb.bind(null,e):null)}function Tf(e,t){if(Os())return null;sb(e,t,!0)}function Ky(){i1(function(){(Ue&6)!==0?up(sg,Zy):_b()})}function Pp(){if(Tr===0){var e=un;e===0&&(e=hl,hl<<=1,(hl&261888)===0&&(hl=256)),Tr=e}return Tr}function zf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ul(""+e)}function Af(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 Jy(e,t,a,r,n){if(t==="submit"&&a&&a.stateNode===n){var i=zf((n[Xt]||null).action),o=r.submitter;o&&(t=(t=o[Xt]||null)?zf(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new Ns("action","action",null,r,n);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tr!==0){var c=o?Af(n,o):new FormData(n);Qu(a,{pending:!0,data:c,method:n.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?Af(n,o):new FormData(n),Qu(a,{pending:!0,data:c,method:n.method,action:i},i,c))},currentTarget:n}]})}}for(El=0;El<Mu.length;El++)Ml=Mu[El],Rf=Ml.toLowerCase(),Uf=Ml[0].toUpperCase()+Ml.slice(1),Aa(Rf,"on"+Uf);var Ml,Rf,Uf,El;Aa(Dg,"onAnimationEnd");Aa(Bg,"onAnimationIteration");Aa(Og,"onAnimationStart");Aa("dblclick","onDoubleClick");Aa("focusin","onFocus");Aa("focusout","onBlur");Aa(my,"onTransitionRun");Aa(fy,"onTransitionStart");Aa(gy,"onTransitionCancel");Aa(Lg,"onTransitionEnd");sn("onMouseEnter",["mouseout","mouseover"]);sn("onMouseLeave",["mouseout","mouseover"]);sn("onPointerEnter",["pointerout","pointerover"]);sn("onPointerLeave",["pointerout","pointerover"]);fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fi("onBeforeInput",["compositionend","keypress","textInput","paste"]);fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),Py=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(To));function Nb(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],n=r.event;r=r.listeners;e:{var i=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!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=p;try{i(n)}catch(f){Wl(f)}n.currentTarget=null,i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=p;try{i(n)}catch(f){Wl(f)}n.currentTarget=null,i=c}}}}function ke(e,t){var a=t[_u];a===void 0&&(a=t[_u]=new Set);var r=e+"__bubble";a.has(r)||(Sb(t,e,2,!1),a.add(r))}function cu(e,t,a){var r=0;t&&(r|=4),Sb(a,e,r,t)}var Tl="_reactListening"+Math.random().toString(36).slice(2);function Fp(e){if(!e[Tl]){e[Tl]=!0,hg.forEach(function(a){a!=="selectionchange"&&(Py.has(a)||cu(a,!1,e),cu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tl]||(t[Tl]=!0,cu("selectionchange",!1,t))}}function Sb(e,t,a,r){switch(Lb(t)){case 2:var n=N1;break;case 8:n=S1;break;default:n=td}a=n.bind(null,t,a,e),n=void 0,!Cu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),r?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function uu(e,t,a,r,n){var i=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===n)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===n)return;o=o.return}for(;l!==null;){if(o=Yi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=i=o;continue e}l=l.parentNode}}r=r.return}Ng(function(){var p=i,f=gp(a),b=[];e:{var d=Hg.get(e);if(d!==void 0){var h=Ns,w=e;switch(e){case"keypress":if(Bl(a)===0)break e;case"keydown":case"keyup":h=X0;break;case"focusin":w="focus",h=Gc;break;case"focusout":w="blur",h=Gc;break;case"beforeblur":case"afterblur":h=Gc;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":h=jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=R0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=K0;break;case Dg:case Bg:case Og:h=B0;break;case Lg:h=P0;break;case"scroll":case"scrollend":h=z0;break;case"wheel":h=I0;break;case"copy":case"cut":case"paste":h=L0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Gm;break;case"toggle":case"beforetoggle":h=ey}var M=(t&4)!==0,D=!M&&(e==="scroll"||e==="scrollend"),m=M?d!==null?d+"Capture":null:d;M=[];for(var u=p,g;u!==null;){var v=u;if(g=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||g===null||m===null||(v=xo(u,m),v!=null&&M.push(zo(u,v,g))),D)break;u=u.return}0<M.length&&(d=new h(d,w,null,a,f),b.push({event:d,listeners:M}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&a!==Su&&(w=a.relatedTarget||a.fromElement)&&(Yi(w)||w[vn]))break e;if((h||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,h?(w=a.relatedTarget||a.toElement,h=p,w=w?Yi(w):null,w!==null&&(D=Do(w),M=w.tag,w!==D||M!==5&&M!==27&&M!==6)&&(w=null)):(h=null,w=p),h!==w)){if(M=jm,v="onMouseLeave",m="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(M=Gm,v="onPointerLeave",m="onPointerEnter",u="pointer"),D=h==null?d:io(h),g=w==null?d:io(w),d=new M(v,u+"leave",h,a,f),d.target=D,d.relatedTarget=g,v=null,Yi(f)===p&&(M=new M(m,u+"enter",w,a,f),M.target=g,M.relatedTarget=D,v=M),D=v,h&&w)t:{for(M=Fy,m=h,u=w,g=0,v=m;v;v=M(v))g++;v=0;for(var N=u;N;N=M(N))v++;for(;0<g-v;)m=M(m),g--;for(;0<v-g;)u=M(u),v--;for(;g--;){if(m===u||u!==null&&m===u.alternate){M=m;break t}m=M(m),u=M(u)}M=null}else M=null;h!==null&&Df(b,d,h,M,!1),w!==null&&D!==null&&Df(b,D,w,M,!0)}}e:{if(d=p?io(p):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var A=$m;else if(Xm(d))if(Tg)A=uy;else{A=sy;var T=ly}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?p&&fp(p.elementType)&&(A=$m):A=cy;if(A&&(A=A(e,p))){Mg(b,A,a,f);break e}T&&T(e,d,p),e==="focusout"&&p&&d.type==="number"&&p.memoizedProps.value!=null&&Nu(d,"number",d.value)}switch(T=p?io(p):window,e){case"focusin":(Xm(T)||T.contentEditable==="true")&&($i=T,qu=p,co=null);break;case"focusout":co=qu=$i=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,Pm(b,a,f);break;case"selectionchange":if(dy)break;case"keydown":case"keyup":Pm(b,a,f)}var z;if(vp)e:{switch(e){case"compositionstart":var Q="onCompositionStart";break e;case"compositionend":Q="onCompositionEnd";break e;case"compositionupdate":Q="onCompositionUpdate";break e}Q=void 0}else Xi?qg(e,a)&&(Q="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Q="onCompositionStart");Q&&(Cg&&a.locale!=="ko"&&(Xi||Q!=="onCompositionStart"?Q==="onCompositionEnd"&&Xi&&(z=Sg()):(qr=f,hp="value"in qr?qr.value:qr.textContent,Xi=!0)),T=hs(p,Q),0<T.length&&(Q=new Qm(Q,e,null,a,f),b.push({event:Q,listeners:T}),z?Q.data=z:(z=Eg(a),z!==null&&(Q.data=z)))),(z=ay?ry(e,a):iy(e,a))&&(Q=hs(p,"onBeforeInput"),0<Q.length&&(T=new Qm("onBeforeInput","beforeinput",null,a,f),b.push({event:T,listeners:Q}),T.data=z)),Jy(b,e,p,a,f)}Nb(b,t)})}function zo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function hs(e,t){for(var a=t+"Capture",r=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=xo(e,a),n!=null&&r.unshift(zo(e,n,i)),n=xo(e,t),n!=null&&r.push(zo(e,n,i))),e.tag===3)return r;e=e.return}return[]}function Fy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Df(e,t,a,r,n){for(var i=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,n?(p=xo(a,i),p!=null&&o.unshift(zo(a,p,c))):n||(p=xo(a,i),p!=null&&o.push(zo(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var Iy=/\r\n?/g,Wy=/\u0000|\uFFFD/g;function Bf(e){return(typeof e=="string"?e:""+e).replace(Iy,`
|
|
9
|
+
`).replace(Wy,"")}function Cb(e,t){return t=Bf(t),Bf(e)===t}function Qe(e,t,a,r,n,i){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||cn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&cn(e,""+r);break;case"className":wl(e,"class",r);break;case"tabIndex":wl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":wl(e,a,r);break;case"style":kg(e,r,i);break;case"data":if(t!=="object"){wl(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=Ul(""+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 i=="function"&&(a==="formAction"?(t!=="input"&&Qe(e,t,"name",n.name,n,null),Qe(e,t,"formEncType",n.formEncType,n,null),Qe(e,t,"formMethod",n.formMethod,n,null),Qe(e,t,"formTarget",n.formTarget,n,null)):(Qe(e,t,"encType",n.encType,n,null),Qe(e,t,"method",n.method,n,null),Qe(e,t,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ul(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=er);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(B(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=Ul(""+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":ke("beforetoggle",e),ke("toggle",e),Rl(e,"popover",r);break;case"xlinkActuate":$a(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":$a(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":$a(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":$a(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":$a(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":$a(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":$a(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":$a(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":$a(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Rl(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=M0.get(a)||a,Rl(e,a,r))}}function Iu(e,t,a,r,n,i){switch(a){case"style":kg(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(B(60));e.innerHTML=a}}break;case"children":typeof r=="string"?cn(e,r):(typeof r=="number"||typeof r=="bigint")&&cn(e,""+r);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"onClick":r!=null&&(e.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),t=a.slice(2,n?a.length-7:void 0),i=e[Xt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof r=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,n);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Rl(e,a,r)}}}function qt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var r=!1,n=!1,i;for(i in a)if(a.hasOwnProperty(i)){var o=a[i];if(o!=null)switch(i){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(B(137,t));default:Qe(e,t,i,o,a,null)}}n&&Qe(e,t,"srcSet",a.srcSet,a,null),r&&Qe(e,t,"src",a.src,a,null);return;case"input":ke("invalid",e);var l=i=o=n=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var f=a[r];if(f!=null)switch(r){case"name":n=f;break;case"type":o=f;break;case"checked":c=f;break;case"defaultChecked":p=f;break;case"value":i=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(B(137,t));break;default:Qe(e,t,r,f,a,null)}}yg(e,i,l,c,p,o,n,!1);return;case"select":ke("invalid",e),r=o=i=null;for(n in a)if(a.hasOwnProperty(n)&&(l=a[n],l!=null))switch(n){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Qe(e,t,n,l,a,null)}t=i,a=o,e.multiple=!!r,t!=null?en(e,!!r,t,!1):a!=null&&en(e,!!r,a,!0);return;case"textarea":ke("invalid",e),i=n=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":n=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(B(91));break;default:Qe(e,t,o,l,a,null)}xg(e,r,n,i);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":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(r=0;r<To.length;r++)ke(To[r],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(B(137,t));default:Qe(e,t,p,r,a,null)}return;default:if(fp(t)){for(f in a)a.hasOwnProperty(f)&&(r=a[f],r!==void 0&&Iu(e,t,f,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 e1(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 n=null,i=null,o=null,l=null,c=null,p=null,f=null;for(h in a){var b=a[h];if(a.hasOwnProperty(h)&&b!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":c=b;default:r.hasOwnProperty(h)||Qe(e,t,h,null,r,b)}}for(var d in r){var h=r[d];if(b=a[d],r.hasOwnProperty(d)&&(h!=null||b!=null))switch(d){case"type":i=h;break;case"name":n=h;break;case"checked":p=h;break;case"defaultChecked":f=h;break;case"value":o=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(B(137,t));break;default:h!==b&&Qe(e,t,d,h,r,b)}}ku(e,o,l,c,p,f,i,n);return;case"select":h=o=l=d=null;for(i in a)if(c=a[i],a.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":h=c;default:r.hasOwnProperty(i)||Qe(e,t,i,null,r,c)}for(n in r)if(i=r[n],c=a[n],r.hasOwnProperty(n)&&(i!=null||c!=null))switch(n){case"value":d=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&Qe(e,t,n,i,r,c)}t=l,a=o,r=h,d!=null?en(e,!!a,d,!1):!!r!=!!a&&(t!=null?en(e,!!a,t,!0):en(e,!!a,a?[]:"",!1));return;case"textarea":h=d=null;for(l in a)if(n=a[l],a.hasOwnProperty(l)&&n!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Qe(e,t,l,null,r,n)}for(o in r)if(n=r[o],i=a[o],r.hasOwnProperty(o)&&(n!=null||i!=null))switch(o){case"value":d=n;break;case"defaultValue":h=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(B(91));break;default:n!==i&&Qe(e,t,o,n,r,i)}_g(e,d,h);return;case"option":for(var w in a)d=a[w],a.hasOwnProperty(w)&&d!=null&&!r.hasOwnProperty(w)&&(w==="selected"?e.selected=!1:Qe(e,t,w,null,r,d));for(c in r)d=r[c],h=a[c],r.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null)&&(c==="selected"?e.selected=d&&typeof d!="function"&&typeof d!="symbol":Qe(e,t,c,d,r,h));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 M in a)d=a[M],a.hasOwnProperty(M)&&d!=null&&!r.hasOwnProperty(M)&&Qe(e,t,M,null,r,d);for(p in r)if(d=r[p],h=a[p],r.hasOwnProperty(p)&&d!==h&&(d!=null||h!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(B(137,t));break;default:Qe(e,t,p,d,r,h)}return;default:if(fp(t)){for(var D in a)d=a[D],a.hasOwnProperty(D)&&d!==void 0&&!r.hasOwnProperty(D)&&Iu(e,t,D,void 0,r,d);for(f in r)d=r[f],h=a[f],!r.hasOwnProperty(f)||d===h||d===void 0&&h===void 0||Iu(e,t,f,d,r,h);return}}for(var m in a)d=a[m],a.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&Qe(e,t,m,null,r,d);for(b in r)d=r[b],h=a[b],!r.hasOwnProperty(b)||d===h||d==null&&h==null||Qe(e,t,b,d,r,h)}function Of(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function t1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],i=n.transferSize,o=n.initiatorType,l=n.duration;if(i&&l&&Of(o)){for(o=0,l=n.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var f=c.transferSize,b=c.initiatorType;f&&Of(b)&&(c=c.responseEnd,o+=f*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(i+o)/(n.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 Wu=null,ep=null;function bs(e){return e.nodeType===9?e:e.ownerDocument}function Lf(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 qb(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 tp(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 pu=null;function a1(){var e=window.event;return e&&e.type==="popstate"?e===pu?!1:(pu=e,!0):(pu=null,!1)}var Eb=typeof setTimeout=="function"?setTimeout:void 0,r1=typeof clearTimeout=="function"?clearTimeout:void 0,Hf=typeof Promise=="function"?Promise:void 0,i1=typeof queueMicrotask=="function"?queueMicrotask:typeof Hf<"u"?function(e){return Hf.resolve(null).then(e).catch(n1)}:Eb;function n1(e){setTimeout(function(){throw e})}function Xr(e){return e==="head"}function jf(e,t){var a=t,r=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(n),bn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")yo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,yo(a);for(var i=a.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[Ho]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=o}}else a==="body"&&yo(e.ownerDocument.body);a=n}while(a);bn(t)}function Qf(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 ap(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":ap(a),mp(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function o1(e,t,a,r){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ho])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ya(e.nextSibling),e===null)break}return null}function l1(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 Mb(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 rp(e){return e.data==="$?"||e.data==="$~"}function ip(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function s1(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 np=null;function Gf(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 Yf(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 Tb(e,t,a){switch(t=bs(a),e){case"html":if(e=t.documentElement,!e)throw Error(B(452));return e;case"head":if(e=t.head,!e)throw Error(B(453));return e;case"body":if(e=t.body,!e)throw Error(B(454));return e;default:throw Error(B(451))}}function yo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mp(e)}var _a=new Map,Vf=new Set;function vs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ur=De.d;De.d={f:c1,r:u1,D:p1,C:d1,L:m1,m:f1,X:h1,S:g1,M:b1};function c1(){var e=ur.f(),t=Ds();return e||t}function u1(e){var t=wn(e);t!==null&&t.tag===5&&t.type==="form"?kh(t):ur.r(e)}var kn=typeof document>"u"?null:document;function zb(e,t,a){var r=kn;if(r&&typeof t=="string"&&t){var n=ha(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),Vf.has(n)||(Vf.add(n),e={rel:e,crossOrigin:a,href:t},r.querySelector(n)===null&&(t=r.createElement("link"),qt(t,"link",e),_t(t),r.head.appendChild(t)))}}function p1(e){ur.D(e),zb("dns-prefetch",e,null)}function d1(e,t){ur.C(e,t),zb("preconnect",e,t)}function m1(e,t,a){ur.L(e,t,a);var r=kn;if(r&&e&&t){var n='link[rel="preload"][as="'+ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+ha(a.imageSizes)+'"]')):n+='[href="'+ha(e)+'"]';var i=n;switch(t){case"style":i=hn(e);break;case"script":i=Nn(e)}_a.has(i)||(e=We({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),_a.set(i,e),r.querySelector(n)!==null||t==="style"&&r.querySelector(Xo(i))||t==="script"&&r.querySelector($o(i))||(t=r.createElement("link"),qt(t,"link",e),_t(t),r.head.appendChild(t)))}}function f1(e,t){ur.m(e,t);var a=kn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+ha(r)+'"][href="'+ha(e)+'"]',i=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Nn(e)}if(!_a.has(i)&&(e=We({rel:"modulepreload",href:e},t),_a.set(i,e),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($o(i)))return}r=a.createElement("link"),qt(r,"link",e),_t(r),a.head.appendChild(r)}}}function g1(e,t,a){ur.S(e,t,a);var r=kn;if(r&&e){var n=Wi(r).hoistableStyles,i=hn(e);t=t||"default";var o=n.get(i);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Xo(i)))l.loading=5;else{e=We({rel:"stylesheet",href:e,"data-precedence":t},a),(a=_a.get(i))&&Ip(e,a);var c=o=r.createElement("link");_t(c),qt(c,"link",e),c._p=new Promise(function(p,f){c.onload=p,c.onerror=f}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Vl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},n.set(i,o)}}}function h1(e,t){ur.X(e,t);var a=kn;if(a&&e){var r=Wi(a).hoistableScripts,n=Nn(e),i=r.get(n);i||(i=a.querySelector($o(n)),i||(e=We({src:e,async:!0},t),(t=_a.get(n))&&Wp(e,t),i=a.createElement("script"),_t(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function b1(e,t){ur.M(e,t);var a=kn;if(a&&e){var r=Wi(a).hoistableScripts,n=Nn(e),i=r.get(n);i||(i=a.querySelector($o(n)),i||(e=We({src:e,async:!0,type:"module"},t),(t=_a.get(n))&&Wp(e,t),i=a.createElement("script"),_t(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function Xf(e,t,a,r){var n=(n=zr.current)?vs(n):null;if(!n)throw Error(B(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=hn(a.href),a=Wi(n).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=hn(a.href);var i=Wi(n).hoistableStyles,o=i.get(e);if(o||(n=n.ownerDocument||n,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=n.querySelector(Xo(e)))&&!i._p&&(o.instance=i,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),i||v1(n,e,a,o.state))),t&&r===null)throw Error(B(528,""));return o}if(t&&r!==null)throw Error(B(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Nn(a),a=Wi(n).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(B(444,e))}}function hn(e){return'href="'+ha(e)+'"'}function Xo(e){return'link[rel="stylesheet"]['+e+"]"}function Ab(e){return We({},e,{"data-precedence":e.precedence,precedence:null})}function v1(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}),qt(t,"link",a),_t(t),e.head.appendChild(t))}function Nn(e){return'[src="'+ha(e)+'"]'}function $o(e){return"script[async]"+e}function $f(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,_t(r),r;var n=We({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),_t(r),qt(r,"style",n),Vl(r,a.precedence,e),t.instance=r;case"stylesheet":n=hn(a.href);var i=e.querySelector(Xo(n));if(i)return t.state.loading|=4,t.instance=i,_t(i),i;r=Ab(a),(n=_a.get(n))&&Ip(r,n),i=(e.ownerDocument||e).createElement("link"),_t(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),t.state.loading|=4,Vl(i,a.precedence,e),t.instance=i;case"script":return i=Nn(a.src),(n=e.querySelector($o(i)))?(t.instance=n,_t(n),n):(r=a,(n=_a.get(i))&&(r=We({},a),Wp(r,n)),e=e.ownerDocument||e,n=e.createElement("script"),_t(n),qt(n,"link",r),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(B(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Vl(r,a.precedence,e));return t.instance}function Vl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,i=n,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)i=l;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ip(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xl=null;function Zf(e,t,a){if(Xl===null){var r=new Map,n=Xl=new Map;n.set(a,r)}else n=Xl,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),n=0;n<a.length;n++){var i=a[n];if(!(i[Ho]||i[Nt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(i):r.set(o,[i])}}return r}function Kf(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function w1(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 Rb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function y1(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 n=hn(r.href),i=t.querySelector(Xo(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ws.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,_t(i);return}i=t.ownerDocument||t,r=Ab(r),(n=_a.get(n))&&Ip(r,n),i=i.createElement("link"),_t(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ws.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var du=0;function _1(e,t){return e.stylesheets&&e.count===0&&$l(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&$l(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&du===0&&(du=62500*t1());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$l(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>du?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function ws(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$l(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ys=null;function $l(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ys=new Map,t.forEach(x1,e),ys=null,ws.call(e))}function x1(e,t){if(!(t.state.loading&4)){var a=ys.get(e);if(a)var r=a.get(null);else{a=new Map,ys.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var o=n[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}n=t.instance,o=n.getAttribute("data-precedence"),i=a.get(o)||r,i===r&&a.set(null,n),a.set(o,n),this.count++,r=ws.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Ao={$$typeof:Wa,Provider:null,Consumer:null,_currentValue:ii,_currentValue2:ii,_threadCount:0};function k1(e,t,a,r,n,i,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=Lc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lc(0),this.hiddenUpdates=Lc(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Ub(e,t,a,r,n,i,o,l,c,p,f,b){return e=new k1(e,t,a,o,c,p,f,b,l),t=1,i===!0&&(t|=24),i=ta(3,null,null,t),e.current=i,i.stateNode=e,t=Sp(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:a,cache:t},Ep(i),e}function Db(e){return e?(e=Ji,e):Ji}function Bb(e,t,a,r,n,i){n=Db(n),r.context===null?r.context=n:r.pendingContext=n,r=Rr(t),r.payload={element:a},i=i===void 0?null:i,i!==null&&(r.callback=i),a=Ur(e,r,t),a!==null&&(Vt(a,e,t),po(a,e,t))}function Jf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ed(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function Ob(e){if(e.tag===13||e.tag===31){var t=bi(e,67108864);t!==null&&Vt(t,e,67108864),ed(e,67108864)}}function Pf(e){if(e.tag===13||e.tag===31){var t=oa();t=pp(t);var a=bi(e,t);a!==null&&Vt(a,e,t),ed(e,t)}}var _s=!0;function N1(e,t,a,r){var n=de.T;de.T=null;var i=De.p;try{De.p=2,td(e,t,a,r)}finally{De.p=i,de.T=n}}function S1(e,t,a,r){var n=de.T;de.T=null;var i=De.p;try{De.p=8,td(e,t,a,r)}finally{De.p=i,de.T=n}}function td(e,t,a,r){if(_s){var n=op(r);if(n===null)uu(e,t,r,xs,a),Ff(e,r);else if(q1(n,e,t,a,r))r.stopPropagation();else if(Ff(e,r),t&4&&-1<C1.indexOf(e)){for(;n!==null;){var i=wn(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=ti(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-na(o);l.entanglements[1]|=c,o&=~c}ja(i),(Ue&6)===0&&(ps=ra()+500,Vo(0,!1))}}break;case 31:case 13:l=bi(i,2),l!==null&&Vt(l,i,2),Ds(),ed(i,2)}if(i=op(r),i===null&&uu(e,t,r,xs,a),i===n)break;n=i}n!==null&&r.stopPropagation()}else uu(e,t,r,null,a)}}function op(e){return e=gp(e),ad(e)}var xs=null;function ad(e){if(xs=null,e=Yi(e),e!==null){var t=Do(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=rg(t),e!==null)return e;e=null}else if(a===31){if(e=ig(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 xs=e,null}function Lb(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(m0()){case sg:return 2;case cg:return 8;case Fl:case f0:return 32;case ug:return 268435456;default:return 32}default:return 32}}var lp=!1,Or=null,Lr=null,Hr=null,Ro=new Map,Uo=new Map,Sr=[],C1="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 Ff(e,t){switch(e){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":Ro.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(t.pointerId)}}function eo(e,t,a,r,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:i,targetContainers:[n]},t!==null&&(t=wn(t),t!==null&&Ob(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function q1(e,t,a,r,n){switch(t){case"focusin":return Or=eo(Or,e,t,a,r,n),!0;case"dragenter":return Lr=eo(Lr,e,t,a,r,n),!0;case"mouseover":return Hr=eo(Hr,e,t,a,r,n),!0;case"pointerover":var i=n.pointerId;return Ro.set(i,eo(Ro.get(i)||null,e,t,a,r,n)),!0;case"gotpointercapture":return i=n.pointerId,Uo.set(i,eo(Uo.get(i)||null,e,t,a,r,n)),!0}return!1}function Hb(e){var t=Yi(e.target);if(t!==null){var a=Do(t);if(a!==null){if(t=a.tag,t===13){if(t=rg(a),t!==null){e.blockedOn=t,Rm(e.priority,function(){Pf(a)});return}}else if(t===31){if(t=ig(a),t!==null){e.blockedOn=t,Rm(e.priority,function(){Pf(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 Zl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=op(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Su=r,a.target.dispatchEvent(r),Su=null}else return t=wn(a),t!==null&&Ob(t),e.blockedOn=a,!1;t.shift()}return!0}function If(e,t,a){Zl(e)&&a.delete(t)}function E1(){lp=!1,Or!==null&&Zl(Or)&&(Or=null),Lr!==null&&Zl(Lr)&&(Lr=null),Hr!==null&&Zl(Hr)&&(Hr=null),Ro.forEach(If),Uo.forEach(If)}function zl(e,t){e.blockedOn===t&&(e.blockedOn=null,lp||(lp=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,E1)))}var Al=null;function Wf(e){Al!==e&&(Al=e,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,function(){Al===e&&(Al=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],n=e[t+2];if(typeof r!="function"){if(ad(r||a)===null)continue;break}var i=wn(a);i!==null&&(e.splice(t,3),t-=3,Qu(i,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function bn(e){function t(c){return zl(c,e)}Or!==null&&zl(Or,e),Lr!==null&&zl(Lr,e),Hr!==null&&zl(Hr,e),Ro.forEach(t),Uo.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);)Hb(a),a.blockedOn===null&&Sr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],i=a[r+1],o=n[Xt]||null;if(typeof i=="function")o||Wf(a);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(n=i,o=i[Xt]||null)l=o.formAction;else if(ad(n)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),Wf(a)}}}function jb(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return n=o})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,n=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),n!==null&&(n(),n=null)}}}function rd(e){this._internalRoot=e}Ls.prototype.render=rd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var a=t.current,r=oa();Bb(a,r,e,t,null,null)};Ls.prototype.unmount=rd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bb(e.current,2,null,e,null,null),Ds(),t[vn]=null}};function Ls(e){this._internalRoot=e}Ls.prototype.unstable_scheduleHydration=function(e){if(e){var t=gg();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&&Hb(e)}};var eg=tg.version;if(eg!=="19.2.3")throw Error(B(527,eg,"19.2.3"));De.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=o0(t),e=e!==null?ng(e):null,e=e===null?null:e.stateNode,e};var M1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(to=__REACT_DEVTOOLS_GLOBAL_HOOK__,!to.isDisabled&&to.supportsFiber))try{Bo=to.inject(M1),ia=to}catch{}var to;Hs.createRoot=function(e,t){if(!ag(e))throw Error(B(299));var a=!1,r="",n=zh,i=Ah,o=Rh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ub(e,1,!1,null,null,a,r,null,n,i,o,jb),e[vn]=t.current,Fp(e),new rd(t)};Hs.hydrateRoot=function(e,t,a){if(!ag(e))throw Error(B(299));var r=!1,n="",i=zh,o=Ah,l=Rh,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Ub(e,1,!0,t,a??null,r,n,c,i,o,l,jb),t.context=Db(null),a=t.current,r=oa(),r=pp(r),n=Rr(r),n.callback=null,Ur(a,n,r),a=r,t.current.lanes=a,Lo(t,a),ja(t),e[vn]=t.current,Fp(e),new Ls(t)};Hs.version="19.2.3"});var Vb=Ra((cx,Yb)=>{"use strict";function Gb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gb)}catch(e){console.error(e)}}Gb(),Yb.exports=Qb()});var Dv=Ra(Ys=>{"use strict";var O1=Symbol.for("react.transitional.element"),L1=Symbol.for("react.fragment");function Uv(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 n in t)n!=="key"&&(a[n]=t[n])}else a=t;return t=a.ref,{$$typeof:O1,type:e,key:r,ref:t!==void 0?t:null,props:a}}Ys.Fragment=L1;Ys.jsx=Uv;Ys.jsxs=Uv});var ae=Ra((Bk,Bv)=>{"use strict";Bv.exports=Dv()});var Ew=Y(Vb());var Xb=`/* 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
|
|
@@ -6754,11 +6754,11 @@ Error generating stack: `+r.message+`
|
|
|
6754
6754
|
width: 100%;\r
|
|
6755
6755
|
height: 100%;\r
|
|
6756
6756
|
}\r
|
|
6757
|
-
`;var Je=Y(Xe());var js={};function $b(e){js=e}function pr(){return js}function id(){return!!js.apiBaseUrl}var z1=e=>e.replace(/\/$/,"");function Bt(e){let t=js.apiBaseUrl;return t?`${z1(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var Sn=Y(Xe());var A1="metron:step",R1="metron_step",Zo=(0,Sn.createContext)(()=>{}),Cn=()=>(0,Sn.useContext)(Zo);function Qs(e,t){return(0,Sn.useCallback)((a,r={})=>{let n=pr(),i=n.analytics??"all";if(i==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(A1,{detail:o,bubbles:!0,composed:!0})),n.onEvent?.(o);let l=window.dataLayer;i==="all"&&Array.isArray(l)&&l.push({event:R1,...o})},[e,t])}var Zb="boq-session-id",Kb="x-boq-session";function Jb(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(Zb);return e||(e=crypto.randomUUID(),window.localStorage.setItem(Zb,e)),e}catch{return crypto.randomUUID()}}var U1="x-boq-client";function Gs(){return pr().client}function Qa(){let{client:e,apiKey:t}=pr();return id()?t?{Authorization:`Bearer ${t}`}:{}:e?{[U1]:e}:{}}function wi(){return{...id()?{}:{[Kb]:Jb()},...Qa()}}function D1(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Zt(e){return D1(await e.json().catch(()=>({})))}var Pb=9e4;async function Fb(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),Pb),n;try{n=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${Pb/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let i=await Zt(n);if(!n.ok||i?.error){let o=i;throw new Error(o.detail??o.message??o.error??`Server error ${n.status}`)}return i}function Ib(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"),Fb(Bt("/api/schedule"),{method:"POST",body:r,headers:wi()})}function Wb(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return Fb(Bt(`/api/schedule/${e}${a}`),{headers:Qa()})}function ev(e,t,a,r){let n=!1,i=null,o=performance.now();return{promise:new Promise((p,f)=>{let b=async()=>{if(!n)try{let d=await e();if(n)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?.(),i=setTimeout(b,t)}catch(d){n||f(d)}};i=setTimeout(b,t)}),cancel:()=>{n=!0,i&&(clearTimeout(i),i=null)}}}var ca=Y(Xe());var tv=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var av=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var rv=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var iv=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var nv=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var ov=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var lv=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var sv=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var cv=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var uv=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var pv=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var dv=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var mv=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var fv=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var gv=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var hv=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var bv=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 wv=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var yv=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var _v=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var xv=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var kv=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Nv=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Sv=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var Cv=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var qv=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var Ev=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var Mv=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var Tv=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var zv=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var Av=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var Rv=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Ae=e=>typeof e=="string"?e:e.src,B1={"/decking/boards/diagonal.webp":Ae(tv),"/decking/boards/no-border.webp":Ae(av),"/decking/boards/picture-frame.webp":Ae(rv),"/decking/boards/straight.webp":Ae(iv),"/fencing/gates/no-gate.webp":Ae(nv),"/fencing/gates/single-gate.webp":Ae(ov),"/fencing/gravel-board.webp":Ae(lv),"/fencing/height/0.9.webp":Ae(sv),"/fencing/height/1.2.webp":Ae(cv),"/fencing/height/1.5.webp":Ae(uv),"/fencing/height/1.8.webp":Ae(pv),"/fencing/no-gravel-board.webp":Ae(dv),"/quick-order/paste-list.webp":Ae(mv),"/quick-order/photo-list.webp":Ae(fv),"/quick-order/upload-file.webp":Ae(gv),"/schedule-products/building-sand.webp":Ae(hv),"/schedule-products/drywall-screws.webp":Ae(bv),"/schedule-products/loft-insulation-roll.webp":Ae(vv),"/schedule-products/red-multi-stock-bricks.webp":Ae(wv),"/schedule-products/scrim-tape.webp":Ae(yv),"/schedule-products/wall-ties.webp":Ae(_v),"/tool-images/architrave.webp":Ae(xv),"/tool-images/brick-block.webp":Ae(kv),"/tool-images/concrete-aggregate.webp":Ae(Nv),"/tool-images/decking.webp":Ae(Sv),"/tool-images/fencing.webp":Ae(Cv),"/tool-images/insulation.webp":Ae(qv),"/tool-images/paint.webp":Ae(Ev),"/tool-images/paving.webp":Ae(Mv),"/tool-images/plasterboard.webp":Ae(Tv),"/tool-images/skirting.webp":Ae(zv),"/tool-images/timber.webp":Ae(Av),"/tool-images/truss.webp":Ae(Rv)};function Kt(e){return B1[e]??e}var nd=Y(
|
|
6758
|
-
`).map(t=>t.trim()).filter(Boolean);function Hv(e){let t=j1(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 jv(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 n=r.getContext("2d");if(!n)return e;n.fillStyle="#fff",n.fillRect(0,0,r.width,r.height),n.drawImage(t,0,0,r.width,r.height),t.close();let i=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!i||i.size>=e.size?e:new File([i],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var $r=Y(Xe());var Xs=Y(Xe()),Vs=Y(
|
|
6759
|
-
`).filter(G=>G.trim()).length,N=Hv(o),A=r==="paste"?!!o:!!c;(0,ca.useEffect)(()=>{if(!c||!En(c)){m(null);return}let G=URL.createObjectURL(c);return m(G),()=>URL.revokeObjectURL(G)},[c]);let T=G=>{i("method_selected",{method:G}),n(G),a(null)},z=()=>{n(null),a(null)},Q=G=>{if(!G?.length)return;if(G.length>1)return b("Please choose one file at a time.");let ce=G[0],xe=ld(ce,En(ce)?1/0:void 0);if(xe)return b(xe);b(""),p(ce)},K=async G=>{h(!0);try{await G()}finally{h(!1)}},fe=async G=>{try{let ce=await jv(G),xe=ld(ce);if(xe)throw new Error(xe);let ye=new FormData;ye.append("file",ce);let
|
|
6757
|
+
`;var Je=Y(Xe());var js={};function $b(e){js=e}function pr(){return js}function id(){return!!js.apiBaseUrl}var z1=e=>e.replace(/\/$/,"");function Bt(e){let t=js.apiBaseUrl;return t?`${z1(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var Sn=Y(Xe());var A1="metron:step",R1="metron_step",Zo=(0,Sn.createContext)(()=>{}),Cn=()=>(0,Sn.useContext)(Zo);function Qs(e,t){return(0,Sn.useCallback)((a,r={})=>{let n=pr(),i=n.analytics??"all";if(i==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(A1,{detail:o,bubbles:!0,composed:!0})),n.onEvent?.(o);let l=window.dataLayer;i==="all"&&Array.isArray(l)&&l.push({event:R1,...o})},[e,t])}var Zb="boq-session-id",Kb="x-boq-session";function Jb(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(Zb);return e||(e=crypto.randomUUID(),window.localStorage.setItem(Zb,e)),e}catch{return crypto.randomUUID()}}var U1="x-boq-client";function Gs(){return pr().client}function Qa(){let{client:e,apiKey:t}=pr();return id()?t?{Authorization:`Bearer ${t}`}:{}:e?{[U1]:e}:{}}function wi(){return{...id()?{}:{[Kb]:Jb()},...Qa()}}function D1(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Zt(e){return D1(await e.json().catch(()=>({})))}var Pb=9e4;async function Fb(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),Pb),n;try{n=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${Pb/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let i=await Zt(n);if(!n.ok||i?.error){let o=i;throw new Error(o.detail??o.message??o.error??`Server error ${n.status}`)}return i}function Ib(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"),Fb(Bt("/api/schedule"),{method:"POST",body:r,headers:wi()})}function Wb(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return Fb(Bt(`/api/schedule/${e}${a}`),{headers:Qa()})}function ev(e,t,a,r){let n=!1,i=null,o=performance.now();return{promise:new Promise((p,f)=>{let b=async()=>{if(!n)try{let d=await e();if(n)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?.(),i=setTimeout(b,t)}catch(d){n||f(d)}};i=setTimeout(b,t)}),cancel:()=>{n=!0,i&&(clearTimeout(i),i=null)}}}var ca=Y(Xe());var tv=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var av=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var rv=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var iv=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var nv=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var ov=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var lv=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var sv=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var cv=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var uv=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var pv=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var dv=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var mv=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var fv=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var gv=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var hv=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var bv=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 wv=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var yv=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var _v=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var xv=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var kv=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Nv=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Sv=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var Cv=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var qv=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var Ev=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var Mv=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var Tv=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var zv=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var Av=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var Rv=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Ae=e=>typeof e=="string"?e:e.src,B1={"/decking/boards/diagonal.webp":Ae(tv),"/decking/boards/no-border.webp":Ae(av),"/decking/boards/picture-frame.webp":Ae(rv),"/decking/boards/straight.webp":Ae(iv),"/fencing/gates/no-gate.webp":Ae(nv),"/fencing/gates/single-gate.webp":Ae(ov),"/fencing/gravel-board.webp":Ae(lv),"/fencing/height/0.9.webp":Ae(sv),"/fencing/height/1.2.webp":Ae(cv),"/fencing/height/1.5.webp":Ae(uv),"/fencing/height/1.8.webp":Ae(pv),"/fencing/no-gravel-board.webp":Ae(dv),"/quick-order/paste-list.webp":Ae(mv),"/quick-order/photo-list.webp":Ae(fv),"/quick-order/upload-file.webp":Ae(gv),"/schedule-products/building-sand.webp":Ae(hv),"/schedule-products/drywall-screws.webp":Ae(bv),"/schedule-products/loft-insulation-roll.webp":Ae(vv),"/schedule-products/red-multi-stock-bricks.webp":Ae(wv),"/schedule-products/scrim-tape.webp":Ae(yv),"/schedule-products/wall-ties.webp":Ae(_v),"/tool-images/architrave.webp":Ae(xv),"/tool-images/brick-block.webp":Ae(kv),"/tool-images/concrete-aggregate.webp":Ae(Nv),"/tool-images/decking.webp":Ae(Sv),"/tool-images/fencing.webp":Ae(Cv),"/tool-images/insulation.webp":Ae(qv),"/tool-images/paint.webp":Ae(Ev),"/tool-images/paving.webp":Ae(Mv),"/tool-images/plasterboard.webp":Ae(Tv),"/tool-images/skirting.webp":Ae(zv),"/tool-images/timber.webp":Ae(Av),"/tool-images/truss.webp":Ae(Rv)};function Kt(e){return B1[e]??e}var nd=Y(ae());function Ot(){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 od=Y(ae());function Ko(){return(0,od.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,od.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var qn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var Lv=(e,t)=>qn[t].some(a=>e.toLowerCase().endsWith(a)),En=e=>e.type.startsWith("image/")||Lv(e.name,"photo"),H1=e=>En(e)||Lv(e.name,"schedule"),Ov=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function ld(e,t=5242880){return H1(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${Ov(e.size)} - the limit is ${Ov(t)}.`:null:`Please upload a list or image file (${[...qn.schedule,...qn.photo].join(", ")}).`}var j1=e=>e.split(`
|
|
6758
|
+
`).map(t=>t.trim()).filter(Boolean);function Hv(e){let t=j1(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 jv(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 n=r.getContext("2d");if(!n)return e;n.fillStyle="#fff",n.fillRect(0,0,r.width,r.height),n.drawImage(t,0,0,r.width,r.height),t.close();let i=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!i||i.size>=e.size?e:new File([i],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var $r=Y(Xe());var Xs=Y(Xe()),Vs=Y(ae()),Q1=[4,5,4],sd=4e3;function dr(){let[e,t]=(0,Xs.useState)(0);(0,Xs.useEffect)(()=>{let r=setInterval(()=>t(n=>n+1),sd);return()=>clearInterval(r)},[]);let a=0;return(0,Vs.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:Q1.map((r,n)=>(0,Vs.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(i,o)=>(0,Vs.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},n))},e)}var Jo=Y(ae()),$s=["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 Qv(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 Gv(){let e=(0,$r.useRef)(Qv($s.map((o,l)=>l))),t=(0,$r.useRef)(0),[a,r]=(0,$r.useState)($s[e.current[0]]),[n,i]=(0,$r.useState)(!0);return(0,$r.useEffect)(()=>{let o=setInterval(()=>{i(!1),window.setTimeout(()=>{t.current++,t.current>=e.current.length&&(e.current=Qv($s.map((l,c)=>c)),t.current=0),r($s[e.current[t.current]]),i(!0)},600)},sd);return()=>clearInterval(o)},[]),(0,Jo.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,Jo.jsx)(dr,{}),(0,Jo.jsx)("p",{className:`banter-message${n?" is-visible":""}`,children:a})]})}var J=Y(ae()),G1=[...qn.schedule,...qn.photo].join(","),Y1={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."}]};function cd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a}){let[r,n]=(0,ca.useState)(null),i=Cn(),[o,l]=(0,ca.useState)(""),[c,p]=(0,ca.useState)(null),[f,b]=(0,ca.useState)(""),[d,h]=(0,ca.useState)(!1),[w,M]=(0,ca.useState)(!1),[D,m]=(0,ca.useState)(null),u=(0,ca.useRef)(0),g=(0,ca.useRef)(null),v=o.split(`
|
|
6759
|
+
`).filter(G=>G.trim()).length,N=Hv(o),A=r==="paste"?!!o:!!c;(0,ca.useEffect)(()=>{if(!c||!En(c)){m(null);return}let G=URL.createObjectURL(c);return m(G),()=>URL.revokeObjectURL(G)},[c]);let T=G=>{i("method_selected",{method:G}),n(G),a(null)},z=()=>{n(null),a(null)},Q=G=>{if(!G?.length)return;if(G.length>1)return b("Please choose one file at a time.");let ce=G[0],xe=ld(ce,En(ce)?1/0:void 0);if(xe)return b(xe);b(""),p(ce)},K=async G=>{h(!0);try{await G()}finally{h(!1)}},fe=async G=>{try{let ce=await jv(G),xe=ld(ce);if(xe)throw new Error(xe);let ye=new FormData;ye.append("file",ce);let ee=await fetch(Bt("/api/schedule/extract-photo"),{method:"POST",body:ye,headers:Qa()}),se=await Zt(ee);if(!ee.ok)throw new Error(se?.error||se?.message||"Failed to extract line items from image");let Me=typeof se?.text=="string"?se.text.trim():"";if(!Me)throw new Error("No line items were extracted from this image.");let _e=Array.isArray(se?.lines)?se.lines.filter(et=>!!(et&&typeof et=="object"&&typeof et.text=="string")):void 0;await e(Me,_e,!1)}catch(ce){i("error",{stage:"photo"}),b(ce?.message||"Failed to extract line items from image")}},Te=()=>{if(c)return i("list_submitted",{method:En(c)?"photo":"upload"}),K(()=>En(c)?fe(c):t(c))},Ye=G=>G.dataTransfer.types.includes("Files"),Ve=G=>{Ye(G)&&(G.preventDefault(),u.current+=1,M(!0))},it=G=>{Ye(G)&&(u.current-=1,u.current<=0&&(u.current=0,M(!1)))},pe=G=>{Ye(G)&&(G.preventDefault(),u.current=0,M(!1),Q(G.dataTransfer.files),T("upload"))};return(0,J.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:Ve,onDragOver:G=>Ye(G)&&G.preventDefault(),onDragLeave:it,onDrop:pe,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${r==="paste"?" entry-option-card--active":""}`,onClick:()=>T("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:Kt("/quick-order/paste-list.webp"),alt:""})})]}),(0,J.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${r==="upload"?" entry-option-card--active":""}`,onClick:()=>T("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:Kt("/quick-order/photo-list.webp"),alt:""})})]})]})]}),r&&(0,J.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!A&&z(),children:(0,J.jsxs)("section",{className:`quick-order-workflow-modal${d?" quick-order-workflow-modal--matching":""}`,onClick:G=>G.stopPropagation(),children:[(0,J.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,J.jsx)("h2",{id:"quick-order-workflow-title",children:r==="paste"?"Type or paste a list":"Upload a file"}),(0,J.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:z,"aria-label":"Close",children:(0,J.jsx)(Ko,{})})]}),(0,J.jsxs)("div",{className:"quick-order-panel",children:[(0,J.jsxs)("div",{className:"quick-order-body","aria-hidden":d,children:[(0,J.jsx)("div",{className:"quick-order-body-main",children:r==="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.
|
|
6760
6760
|
insulated plasterboard 50mm
|
|
6761
|
-
C24 timber 4.8m`,value:o,onChange:G=>l(G.target.value),"aria-label":"Paste schedule line items"}),N&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",N]}),(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:!v||!!N,onClick:()=>{i("list_submitted",{method:"paste",lines:v}),K(()=>e(o))},"aria-label":"Match pasted lines",children:[(0,J.jsx)("span",{children:"Match line items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Ot,{})})]})})]}):(0,J.jsxs)(J.Fragment,{children:[f&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",f]}),(0,J.jsxs)("div",{className:`upload-zone${c?" has-file":""}`,onClick:()=>g.current?.click(),onDragOver:G=>G.preventDefault(),onDrop:pe,role:"button",tabIndex:0,onKeyDown:G=>(G.key==="Enter"||G.key===" ")&&g.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[D?(0,J.jsx)("img",{src:D,alt:c?.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"})]})}),c?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("div",{className:"upload-zone-subtext",children:c.name}),(0,J.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:G=>{G.stopPropagation(),p(null),b(""),g.current&&(g.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:g,type:"file",accept:G1,className:"visually-hidden",onChange:G=>Q(G.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:!c,onClick:()=>{Te()},"aria-label":"Match uploaded items",children:[(0,J.jsx)("span",{children:"Match items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Ot,{})})]})})]})}),(0,J.jsx)("aside",{className:"quick-order-sidebar",children:Y1[r].map((G,ce)=>(0,J.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,J.jsx)("span",{className:"quick-order-step-dot",children:ce+1}),(0,J.jsxs)("div",{children:[(0,J.jsx)("div",{className:"quick-order-step-title",children:G.title}),(0,J.jsx)("div",{className:"quick-order-step-desc",children:G.desc})]})]},G.title))})]}),d&&(0,J.jsx)("div",{className:"quick-order-matching-overlay",children:(0,J.jsx)(Gv,{})})]})]})})]})]})}var we=Y(Xe());var ud=Y(
|
|
6761
|
+
C24 timber 4.8m`,value:o,onChange:G=>l(G.target.value),"aria-label":"Paste schedule line items"}),N&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",N]}),(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:!v||!!N,onClick:()=>{i("list_submitted",{method:"paste",lines:v}),K(()=>e(o))},"aria-label":"Match pasted lines",children:[(0,J.jsx)("span",{children:"Match line items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Ot,{})})]})})]}):(0,J.jsxs)(J.Fragment,{children:[f&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",f]}),(0,J.jsxs)("div",{className:`upload-zone${c?" has-file":""}`,onClick:()=>g.current?.click(),onDragOver:G=>G.preventDefault(),onDrop:pe,role:"button",tabIndex:0,onKeyDown:G=>(G.key==="Enter"||G.key===" ")&&g.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[D?(0,J.jsx)("img",{src:D,alt:c?.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"})]})}),c?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("div",{className:"upload-zone-subtext",children:c.name}),(0,J.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:G=>{G.stopPropagation(),p(null),b(""),g.current&&(g.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:g,type:"file",accept:G1,className:"visually-hidden",onChange:G=>Q(G.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:!c,onClick:()=>{Te()},"aria-label":"Match uploaded items",children:[(0,J.jsx)("span",{children:"Match items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Ot,{})})]})})]})}),(0,J.jsx)("aside",{className:"quick-order-sidebar",children:Y1[r].map((G,ce)=>(0,J.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,J.jsx)("span",{className:"quick-order-step-dot",children:ce+1}),(0,J.jsxs)("div",{children:[(0,J.jsx)("div",{className:"quick-order-step-title",children:G.title}),(0,J.jsx)("div",{className:"quick-order-step-desc",children:G.desc})]})]},G.title))})]}),d&&(0,J.jsx)("div",{className:"quick-order-matching-overlay",children:(0,J.jsx)(Gv,{})})]})]})})]})]})}var we=Y(Xe());var ud=Y(ae());function Zr(){return(0,ud.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ud.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var yi=Y(ae());function pd(){return(0,yi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,yi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,yi.jsx)("path",{d:"M21 3v5h-5"}),(0,yi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,yi.jsx)("path",{d:"M3 21v-5h5"})]})}var Po=Y(ae());function dd({unit:e}){return(0,Po.jsx)(Po.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,Po.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Yv=Y(ae());function V1(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?V1(r,t):r}function ka(e,t){let a=xa(e,t);return a?(0,Yv.jsx)(dd,{unit:a}):null}function Fo(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}`:""}function _i(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})}`}function Vv(e){return`data:image/svg+xml;utf8,${encodeURIComponent(e)}`}var X1=[{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 Ga(e,t,a){if(a)return a;let r=(e||"").toLowerCase(),n=X1.find(i=>i.match.some(o=>r.includes(o)));return n?Kt(n.path):r.includes("insulation")?Vv(`
|
|
6762
6762
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 420">
|
|
6763
6763
|
<rect width="640" height="420" fill="#fbf1cf"/>
|
|
6764
6764
|
<rect x="88" y="78" width="432" height="264" rx="16" fill="#f0c43f"/>
|
|
@@ -6777,7 +6777,7 @@ C24 timber 4.8m`,value:o,onChange:G=>l(G.target.value),"aria-label":"Paste sched
|
|
|
6777
6777
|
<rect x="168" y="188" width="250" height="24" rx="12" fill="#aab5c0"/>
|
|
6778
6778
|
<rect x="168" y="232" width="220" height="24" rx="12" fill="#aab5c0"/>
|
|
6779
6779
|
</svg>
|
|
6780
|
-
`)}function Kr(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}}var Jv=e=>(e??"").trim().toLowerCase(),$1={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",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Z1=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),Xv=new Set(["box","bag","pack","pallet","roll","set","tub"]),$v=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Zv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,xi=e=>{let t=Jv(e);return $1[t]??t},st=(e,t)=>{let a=xi(e),r=xi(t);return a.length>0&&a===r},K1=(e,t)=>{let a=Jv(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},J1=e=>(e??"").split(",").map(t=>xi(t)).filter(Boolean),P1=(e,t)=>{let a=J1(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||st(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||st(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||st(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},Kv=(e,t)=>st(t,"pallet")?e.itemsPerPallet??null:st(t,"pack")?e.itemsPerPack??null:st(t,"box")?e.itemsPerBox??null:null,F1=(e,t,a)=>{if(!st(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||!st(r[3],a))return null;let n=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(n)&&n>0?n:null};function Aa(e,t){let a=e.qty,r=xi(e.unit)||"-",n=xi(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=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?e.sellUnitsOverride??null:null,p=v=>({requestedAmount:a,requestedUnit:r,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:n,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${v} Manually set to ${c} ${n}.`:v,costingMode:"review"});if(!P1(e,r))return p("Requested unit is not supported by this catalogue conversion.");let f=null,b="review",d=e.roundingRule,h=`Quantity review required, initial request needed ${a} ${r}.`,w=1+o,M=F1(e,r,n),D=e.unitConversions?.find(v=>st(v.requestUom,r));if(!!e.saleUnit&&(st(r,n)||!!D||st(r,"each")&&!Xv.has(n)))if(st(r,n))f=a*w/i,b="direct",h=`${a} ${r}${o>0?` x ${w}`:""}`;else if(D){f=a*w/D.quantityPerSaleUnit,b="derived";let v=1/D.quantityPerSaleUnit,N=Math.round(v);h=st(n,"each")&&D.quantityPerSaleUnit<1&&Math.abs(v-N)<1e-9?`${a} ${r}${o>0?` x ${w}`:""} x ${N} per ${r}`:`${a} ${r}${o>0?` x ${w}`:""} / ${D.quantityPerSaleUnit} ${r} per ${n}`}else st(r,"each")&&!Xv.has(n)&&(f=a*w/i,b="derived",h=`${a} ${n}${o>0?` x ${w}`:""}`);else if(st(r,n)&&i>0)f=a*w/i,b="direct",h=o>0?`${a} ${r} x ${w} / ${i} ${n} per sell unit`:`${a} ${r} / ${i} ${n} per sell unit`;else if(st(r,"each")&&i>0&&Z1.has(n))f=a*w/i,b="derived",h=o>0?`${a} each x ${w} / ${i} each per ${n}`:`${a} each / ${i} each per ${n}`;else if(Kv(e,r)!=null&&i>0){let v=Kv(e,r)??0;f=a*v*w/i,b="derived";let N=`${a} ${r} x ${v} each${o>0?` x ${w}`:""}`;h=i===1&&st(n,"each")?N:`${N} / ${i} each per ${n}`}else if(M!=null)f=a*w/M,b="derived",d??(d="round_up_each"),h=`${a} m2 x ${w} / ${M} m2 per ${n} (from product description)`;else if(e.conversionType==="basket_line_unit")i>0&&(f=a*w/i,b="derived",h=`${a} ${r}${o>0?` x ${w}`:""} / ${i} ${r} per ${n}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${r}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let v=e.coverageQty??e.derivedCoverageM2??null;st(r,"m2")&&v!=null&&v>0&&(f=a*w/v,b="derived",h=`${a} m2 x ${w} / ${v} m2 per ${n}`)}else if(e.conversionType==="count_per_area"){let v=e.coverageQty??null;st(r,"m2")&&v!=null&&v>0?(f=a/v,b="derived",h=`${a} m2 / ${v} m2 per sell unit`):st(r,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&i>0&&(f=a*e.itemsPerM2*w/i,b="derived",h=`${a} m2 x ${e.itemsPerM2} ${n}/m2 x ${w} / ${i}`)}else if(e.conversionType==="length_from_dims"){let v=e.coverageQty??e.derivedLengthM??null;st(r,"m")&&v!=null&&v>0&&(f=a*w/v,b="derived",h=`${a} m x ${w} / ${v} m per ${n}`)}else if(e.conversionType==="volume_from_description"){let v=$v(a,r),N=$v(e.coverageQty??0,xi(e.coverageUom));v!=null&&N!=null&&N>0&&(f=v*w/N,b="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="weight_from_description"){let v=Zv(a,r),N=Zv(e.coverageQty??0,xi(e.coverageUom));v!=null&&N!=null&&N>0&&(f=v*w/N,b="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="same_unit_volume"){let v=e.coverageQty??null;st(r,"m3")&&v!=null&&v>0&&(f=a/v,b="derived",h=`${a} m3 / ${v} m3 per ${n}`)}}if(f==null||!Number.isFinite(f)||f<0)return p(`Quantity review required, initial request needed ${a} ${r}.`);let u=K1(f,d),g=l?e.sellUnitsOverride??null:u;return{requestedAmount:a,requestedUnit:r,salesUnitSize:i,sellUnit:n,calculatedSellUnits:u,requiredSellUnits:g,unitPrice:e.price,lineTotal:e.price!=null&&g!=null?e.price*g:null,calculation:l?`${h} = ${u} ${n} (manually set to ${g})`:`${h} = ${g} ${n}`,costingMode:b}}var Pv=()=>import("./xlsx-K4MOA2QM.js"),Wo=["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"],I1=Wo.indexOf("Line total");function W1(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 Fv(e){let t=await Pv(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),n=[Wo],i=0;for(let c of e){let{item:p,best:f,qty:b,band:d,unmatchable:h,decision:w}=c,M=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),D=!h&&f?.price!=null?f.price*b:null;D!=null&&(i+=D),n.push([p.source_line_id,p.line_id,p.description_original||"(no description)",M,b,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(", "),w?.technical_classification??"",w?.include_in_quote==null?"":w.include_in_quote?"yes":"no",w?.approval_required==null?"":w.approval_required?"yes":"no",w?.approval_type??"",w?.missing_information.join(", ")??"",w?.confidence??"",w?.reason??"",h?"-":f?.product_id??w?.selected_candidate_id??"-",h?"-":f?.description??"-",h?"-":f?.price_basis??"-",h?null:f?.price??null,D,h?"-":d,W1(c)])}n.push(Array(Wo.length).fill(null));let o=Array(Wo.length).fill(null);o[0]="Estimated total",o[I1]=i,n.push(o),n.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(Wo.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(n);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 Io=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Iv(e,t){let a=await Pv(),r=a.utils.book_new(),n=new Date().toISOString().slice(0,10),i=t?[["Account",t.name+" ("+t.id+")"],[],Io]:[Io],o=0;for(let p of e){let f=Aa(p),b=f.lineTotal;b!=null&&(o+=b),i.push([p.productId,p.description,f.costingMode,f.requestedAmount,_a(f.requestedUnit),f.salesUnitSize,_a(f.sellUnit),f.requiredSellUnits,f.unitPrice,b])}i.push(Array(Io.length).fill(null));let l=Array(Io.length).fill(null);l[0]="Estimated total",l[Io.length-1]=o,i.push(l);let c=a.utils.aoa_to_sheet(i);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}-${n}.xlsx`:`basket-${n}.xlsx`)}var s=Y(te()),fd="__none__",el=24,e_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function aw(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var t_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function a_(e,t){if(t!==fd){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);if(e?.decision?.technical_classification!=="no_suitable_candidate")return e?.candidates?.[0]}}function Wv(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 r_(e,t){let a={...e,qty:t.qty,sellUnitsOverride:t.sellUnitsOverride??null};return t.productId!==e.productId||t.conversionType!=="basket_line_unit"?a:{...a,saleUnit:t.saleUnit,saleUnitQuantity:t.saleUnitQuantity,unitConversions:t.unitConversions,conversionType:t.conversionType,requestUomsSupported:t.requestUomsSupported,salesUomNormalised:t.salesUomNormalised,salesUnitSize:t.salesUnitSize,salesUnitSizeUom:t.salesUnitSizeUom,coverageQty:t.coverageQty,coverageUom:t.coverageUom,itemsPerPallet:t.itemsPerPallet,itemsPerPack:t.itemsPerPack,itemsPerBox:t.itemsPerBox,itemsPerM2:t.itemsPerM2,wasteFactorDefault:t.wasteFactorDefault,roundingRule:t.roundingRule,derivedCoverageM2:t.derivedCoverageM2,derivedLengthM:t.derivedLengthM,quoteQtyFormulaType:t.quoteQtyFormulaType,conversionConfidence:t.conversionConfidence,conversionNotes:t.conversionNotes}}function i_(e){return e?e.replace(/_/g," "):"not stated"}function n_({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 Tn(e,t){if(e==null)return"-";let a=Fo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function gd(e){return e&&e.length>0?e.join(" x "):"-"}function o_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Mn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Jr(e,t){return e.customer_display_label?.trim()||e.description_original||"(no description)"}var ew=[{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 l_(e){let t=new Map;return[...new Set(e.filter(mr).map(r=>r.linked_group_id))].forEach((r,n)=>{let i=n%26;t.set(r,{token:String.fromCharCode(65+i),bubbleStyle:ew[n%ew.length]})}),t}function mr(e){return!1}function zn(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 md({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function s_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,5),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let n=new Map(e.map(o=>[o.product_id,o])),i=r.map(o=>n.get(o)).filter(o=>o!=null);if(a&&!i.some(o=>o.product_id===a)){let o=n.get(a);o&&i.unshift(o)}return[...new Map(i.map(o=>[o.product_id,o])).values()].slice(0,5)}function Zs(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 Ks(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 c_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:n}){let i=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-i.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:Ks(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:n})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Ks(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:Ks(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:i.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Ks(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",i.length," of ",t.length," LLM calls."]})]})]})}function u_({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,n)=>(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:gd(r.measurements_mm)}),(0,s.jsx)("td",{children:Fo(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${n}`))})]})]},`${t.query}-${a}`))]})}function tw({item:e,result:t}){let a=t?.retrieval_debug.map(n=>n.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Mn(e.procurement_aliases)],["Retrieval queries",Mn(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)",gd(e.attrs.measurements_mm)],["Stock length",o_(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",Mn(e.installation_clues)],["System clues",Mn(e.system_clues)],["Component requirements",Mn(e.component_requirements)],["Linked group",zn(e)||"-"],["Flags",Mn(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(([n,i])=>(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:n}),(0,s.jsx)("dd",{children:i})]},n))})]})}function p_({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)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(we.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 d_({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||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];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,n])=>(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:n})]},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 m_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:n=!1,linkedGroupMeta:i}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"Exact match not found:":`AI review (${t.confidence??"confidence not stated"}):`;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:o}),"\xA0",t.reason]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",zn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(tw,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tw,{item:e,result:a}),r&&(0,s.jsx)(p_,{item:e}),r&&(0,s.jsx)(d_,{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]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",zn(e)]}):null]}),r&&(0,s.jsx)(u_,{queries:a?.retrieval_debug??[]})]})}function f_({item:e,candidates:t,result:a,decision:r,unmatchable:n,selectedProductId:i,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:f=!1,debugEnabled:b=!1,forceReviewNote:d=!1,linkedGroupMeta:h}){let w=f||o==="detailed",M=b&&o==="detailed",D=w||d?(0,s.jsx)(m_,{item:e,decision:r,result:a,showRetrievalDebug:M,reviewOnly:d&&!w,linkedGroupMeta:h}):null;if(n)return(0,s.jsxs)(s.Fragment,{children:[D,(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:[D,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let m=p||f||o==="detailed"?t:s_(t,a,i);return(0,s.jsxs)(s.Fragment,{children:[D,(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"}),M&&(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:m.map((u,g)=>{let v=u.product_id===i;return(0,s.jsxs)("tr",{className:v?"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:gd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Tn(u.price,u.price_basis)}),M&&(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)(n_,{band:aw(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:v?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:()=>{v?c?.():l(u)},"aria-label":v?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${g}`)})})]})]})}function hd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:n,onGoToBasket:i,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:f=!1}){let b=!f&&Gs()==="QZA6-MRA4",d=b?"quote":"basket",{results:h,lineItems:w,parseReport:M,timings:D}=e,[m,u]=(0,we.useState)({}),g=Cn(),[v,N]=(0,we.useState)({}),[A,T]=(0,we.useState)({}),[z,Q]=(0,we.useState)(""),[K,fe]=(0,we.useState)(null),[Te,Ye]=(0,we.useState)(1),[Ve,it]=(0,we.useState)(!1);(0,we.useEffect)(()=>{it(new URLSearchParams(window.location.search).get("debug")==="1")},[]);let[pe,G]=(0,we.useState)("simple"),[ce,xe]=(0,we.useState)(f?"list":"tile"),[ye,re]=(0,we.useState)(!1),[se,Me]=(0,we.useState)(null),[_e,et]=(0,we.useState)(""),[Ht,Tt]=(0,we.useState)([]),[tt,ct]=(0,we.useState)(!1),[He,E]=(0,we.useState)(null),[x,R]=(0,we.useState)(!1),[I,ue]=(0,we.useState)(null),ve=(0,we.useRef)(null),[Se,k]=(0,we.useState)(new Set),[j,O]=(0,we.useState)(new Set),[ne,W]=(0,we.useState)(!1);(0,we.useEffect)(()=>{Ye(1)},[z,K,ce]);let C=new Map(h.map(_=>[_.line_id,_])),V=l_(w),X=w.map(_=>{let L=C.get(_.line_id),ze=L?.decision,zt=t_(_),Ze=m[_.line_id],It=a_(L,Ze),zi=a[_.line_id],Ow=Ze===fd?void 0:v[_.line_id]??(zi&&zi.productId!==It?.product_id?Wv(zi):It),Wd=zt?void 0:Ow,Lw=_.qty??0;return{item:_,result:L,decision:ze,unmatchable:zt,best:Wd,qty:Lw,band:aw(Wd?.scores?.overall)}}),me=0,Ce=0;for(let _ of X)_.unmatchable||_.decision?.include_in_quote!==!0||!_.best||(_.best.price!=null?me+=_.best.price*_.qty:Ce+=1);let dt=_=>!_.unmatchable&&!_.best&&_.decision?.technical_classification!=="no_suitable_candidate"&&Zs(_.result).length>0,je=_=>_.best??Zs(_.result)[0],Ir=X.filter(_=>!_.unmatchable&&!_.best).filter(_=>!j.has(_.item.line_id)),ll=X.filter(_=>j.has(_.item.line_id)),qa=X;if(z.trim()){let _=z.trim().toLowerCase();qa=qa.filter(L=>L.item.description_original?.toLowerCase().includes(_)||je(L)?.description?.toLowerCase().includes(_))}if(K){let _=K==="asc"?1:-1;qa=[...qa].sort((L,ze)=>_*(L.item.description_original||"").localeCompare(ze.item.description_original||""))}let hr=Math.max(1,Math.ceil(qa.length/el)),Pt=Math.min(Te,hr),Ft=qa.slice((Pt-1)*el,Pt*el),Yd=Ft.filter(_=>!_.unmatchable&&_.best),Vd=Ft.filter(_=>dt(_)),gc=Ft.filter(_=>!_.unmatchable&&(_.best||dt(_))),Xd=Ft.filter(_=>_.unmatchable||!_.best&&!dt(_)),P=se?X.find(_=>_.item.line_id===se)??null:null,Tw=!f&&!c&&!P&&Ir.length>0,Qn=(0,we.useRef)(null),Gn=()=>{let _=ve.current;if(!_)return;let{top:L,left:ze,width:zt,height:Ze}=_.getBoundingClientRect(),zi=_.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;ue({top:L,left:ze,width:zi?zi-ze:zt,height:Ze})};(0,we.useEffect)(()=>(window.addEventListener("scroll",Gn,!0),window.addEventListener("resize",Gn),()=>{window.removeEventListener("scroll",Gn,!0),window.removeEventListener("resize",Gn)})),(0,we.useEffect)(()=>{let _=L=>{Qn.current&&!L.composedPath().includes(Qn.current)&&Qn.current.removeAttribute("open")};return document.addEventListener("click",_),()=>document.removeEventListener("click",_)},[]);let Ei=_=>{Me(_),et("")},zw=()=>{if(!se)return;let _=a[se];if(_){u(L=>({...L,[se]:_.productId})),N(L=>({...L,[se]:Wv(_)}));return}u(L=>{let ze={...L};return delete ze[se],ze}),N(L=>{let ze={...L};return delete ze[se],ze})},br=(_=!1)=>{let L=se?a[se]:void 0;!_&&L&&P?.best&&L.productId!==P.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(_||zw(),Me(null),W(!1))},Aw=_=>{if(k(L=>new Set(L).add(_)),Ir.some(L=>L.item.line_id!==_)){br(!0);return}p(),br(!0)},Rw=_=>{if(hc(_),O(L=>new Set(L).add(_)),Ir.some(L=>L.item.line_id!==_)){br(!0);return}p(),br(!0)},Uw=()=>{O(_=>new Set([..._,...Ir.map(L=>L.item.line_id)])),p()},$d=()=>{P?.best&&(Kd(P.item.line_id,P.best),r(Mi(P)),ne?Aw(P.item.line_id):br(!0))},Zd=Xd.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:Xd.map(_=>{let{item:L,qty:ze}=_;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>Ei(L.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Jr(L,w)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},L.line_id)})})]}):null,hc=_=>{u(L=>({...L,[_]:fd})),N(L=>({...L,[_]:void 0})),T(L=>({...L,[_]:void 0})),n(_)},bc=(_,L)=>{u(ze=>({...ze,[_]:L.product_id})),N(ze=>({...ze,[_]:L}))},Kd=(_,L)=>{L.method==="catalogue_search"&&T(ze=>({...ze,[_]:L}))};function tx(){g("downloaded",{type:"schedule",lines:X.length}),Fv(X.map(({item:_,best:L,qty:ze,band:zt,unmatchable:Ze,decision:It})=>({item:_,best:L,qty:ze,band:zt,unmatchable:Ze,decision:It})))}function Mi(_){let L=_.best??Zs(_.result)[0];return Kr(L,{lineId:_.item.line_id,description:_.item.description_original,unit:_.item.unit,qty:_.qty})}(0,we.useEffect)(()=>{if(!o){for(let _ of X)!_.unmatchable&&_.best&&r(Mi(_));l()}},[o]),(0,we.useEffect)(()=>{for(let _ of X){let L=a[_.item.line_id];if(!L)continue;let ze=Mi(_);r(r_(ze,L))}},[e]),(0,we.useEffect)(()=>{if(!se){Tt([]),E(null),ct(!1);return}let _=_e.trim();if(!_){Tt([]),E(null),ct(!1);return}let L=!1,ze=window.setTimeout(async()=>{try{ct(!0),E(null);let zt=await fetch(Bt(`/api/catalogue/search?q=${encodeURIComponent(_)}`),{headers:wi()}),Ze=await Zt(zt);if(!zt.ok)throw new Error(Ze?.error||Ze?.message||"Failed to search catalogue");L||Tt(Array.isArray(Ze?.items)?Ze.items:[])}catch(zt){L||(Tt([]),E(zt?.message||"Failed to search catalogue"))}finally{L||ct(!1)}},250);return()=>{L=!0,window.clearTimeout(ze)}},[_e,se]);let vc=Object.keys(a).length,Ea=_e.trim(),Jd=Zs(P?.result),sl=P?.decision?.technical_classification==="no_suitable_candidate"||!!P&&!P.best,Pd=P?.decision?.technical_classification!=null,Fd=P?.decision?.reason??(sl?"No catalogue candidate found. Refine the request or search the catalogue.":null),Dw=Ht.map(_=>({product_id:_.product_id,description:_.description,source_list:_.source_list,price:_.price,price_basis:_.price_basis,uoi_count:_.uoi_count??null,uoi:_.uoi,pdp_photo_url:_.pdp_photo_url??null,conversion:_.conversion,measurements_mm:_.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),Yn=Ea?Dw:Jd,Ti=P?A[P.item.line_id]:void 0,Vn=!Ea&&Ti&&!Yn.some(_=>_.product_id===Ti.product_id)?[...Yn,Ti]:Yn,Id=(()=>{let _=Vn.slice(0,Ea?12:3);return Ea||!Ti||_.some(L=>L.product_id===Ti.product_id)?_:[..._,Ti]})(),cl=!!P?.best&&a[P.item.line_id]?.productId===P.best.product_id,Bw=!!P?.best&&!!a[P.item.line_id]&&!cl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${f?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${f?"":" quick-order-hero--customer"}`,children:f?(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:nt(me)})," 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 ",b?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:i,"aria-label":b?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:b?"View Quote":"View Basket"}),(0,s.jsx)("strong",{children:nt(me)})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ot,{})})]})]})}),(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":ye,onClick:()=>re(_=>!_),children:ye?"Hide timings":"Show timings"})}),Ve&&ye&&(0,s.jsx)(c_,{...D}),!b&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!P&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[Ce>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:Ce})," need pricing"]}),(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:z,onChange:_=>Q(_.target.value),"aria-label":"Search line items"}),!f&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${ce==="tile"?" is-active":""}`,"aria-pressed":ce==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>xe("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${ce==="list"?" is-active":""}`,"aria-pressed":ce==="list","aria-label":"List view",title:"List view",onClick:()=>xe("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:()=>G(_=>_==="simple"?"detailed":"simple"),children:pe==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Qn,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:e_.map(_=>{let L=K===_.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${L?" is-active":""}`,onClick:()=>{fe(L?null:_.dir),Qn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:L?"\u2713":""}),_.label]},_.dir)})})]})]})]})}),ce==="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:()=>br(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:_=>_.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>br(),"aria-label":"Close product options",children:(0,s.jsx)(Ko,{})}),(0,s.jsx)("div",{className:"results-review-page",children:f?(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:()=>br(),children:[(0,s.jsx)(Zr,{}),"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:()=>G(_=>_==="simple"?"detailed":"simple"),children:pe==="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:_e,onChange:_=>et(_.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:()=>hc(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)("img",{className:"fill-img results-review-page__image",src:Ga(je(P)?.description||P.item.description_original,je(P)?.product_id,je(P)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Jr(P.item,w)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[_i(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:Tn(P.best.price,P.best.price_basis)}):null]}):je(P)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:je(P)?.description}),je(P)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Tn(je(P)?.price??null,je(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."}),mr(P.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(md,{meta:V.get(P.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:zn(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]?n(P.item.line_id):(P.best&&Kd(P.item.line_id,P.best),r(Mi(P)))},disabled:!P.best,"aria-label":a[P.item.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[P.item.line_id]?"\u2713 Added":f?"+ Add to selection":`Add to ${d}`})})]})]}),tt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!tt&&He?(0,s.jsx)("div",{className:"results-empty-card",children:He}):null,!tt&&!He&&Ea&&Yn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!tt&&!He?(0,s.jsx)(f_,{item:P.item,candidates:Yn,result:P.result,decision:P.decision,unmatchable:P.unmatchable,selectedProductId:P.best?.product_id??null,detailMode:pe,linkedGroupMeta:mr(P.item)?V.get(P.item.linked_group_id):void 0,onPick:_=>bc(P.item.line_id,_),onClear:()=>hc(P.item.line_id),showAll:f||Ve||Ea.length>0,internal:f,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:Jr(P.item,w)||"Original request"})]}),Fd?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:sl?"Exact match not found:":"AI review:"})," ",Fd]}):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:sl?"We couldn't find a suitable product":Pd?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:sl?Jd.length>0?"These AI-reviewed alternatives may be useful, but need approval.":"Search the catalogue to choose an alternative.":Pd?`Select the option you want to add to your ${d}.`:"Search the catalogue to choose a product."})]})}),!Ea&&Vn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Id.map(_=>{let L=_.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${L?" is-selected":""}`,onClick:()=>bc(P.item.line_id,_),"aria-pressed":L,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Tn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:L?"Selected":"Choose"})]},_.product_id)})}):null,Vn.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:_e,onChange:_=>et(_.target.value),"aria-label":"Search catalogue"})]}),Ea&&tt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Ea&&!tt&&He?(0,s.jsx)("div",{className:"results-empty-card",children:He}):null,Ea&&!tt&&!He&&Vn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Ea&&!tt&&!He&&Vn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Id.map(_=>{let L=_.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${L?" is-selected":""}`,onClick:()=>bc(P.item.line_id,_),"aria-pressed":L,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Tn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:L?"Selected":"Choose"})]},_.product_id)})}):null]}),P.best?Bw?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{$d()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>n(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${cl?" cta-btn-secondary":""}`,onClick:()=>{cl?n(P.item.line_id):$d()},children:(0,s.jsx)("span",{children:cl?`Remove from ${d}`:`Add selected product to ${d}`})}):null,ne?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>Rw(P.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[qa.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,gc.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:gc.map(_=>{let{item:L,best:ze,qty:zt}=_,Ze=je(_),It=!ze&&dt(_);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>Ei(L.line_id),"aria-label":`Review match for ${Jr(L,w)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[It||mr(L)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[mr(L)?(0,s.jsx)(md,{meta:V.get(L.linked_group_id)}):(0,s.jsx)("span",{}),It?(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)("img",{className:"fill-img results-tile-card__image",src:Ga(Ze?.description||L.description_original,Ze?.product_id,Ze?.pdp_photo_url),alt:""})]}),(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:It?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Jr(L,w)}),mr(L)?(0,s.jsx)("div",{className:"results-row-meta",children:zn(L)}):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:[f&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ei(L.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[L.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[L.line_id]?n(L.line_id):r(Mi(_))},disabled:!Ze,"aria-label":a[L.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[L.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})]})]},L.line_id)})})}):null,Zd]})]}):(0,s.jsxs)(s.Fragment,{children:[I&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:I,"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"}}),pe==="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"}),pe==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:f?"Selection":b?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[qa.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:pe==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),gc.map(_=>{let{item:L,result:ze,decision:zt,best:Ze}=_;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>Ei(L.line_id),onMouseEnter:It=>{ve.current=It.currentTarget,Gn()},onMouseLeave:()=>{ve.current=null,ue(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Jr(L,w)}),mr(L)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(md,{meta:V.get(L.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:zn(L)})]}):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}),pe==="detailed"&&zt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[i_(zt.technical_classification),zt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Ze?.price!=null?Tn(Ze.price,Ze.price_basis):"-"}),pe==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[L.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:It=>{It.stopPropagation(),a[L.line_id]?n(L.line_id):r(Mi(_))},"aria-label":a[L.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[L.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})})]},L.line_id)})]})]})}),Zd]}),!P&&hr>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Pt-1)*el+1,"\u2013",Math.min(Pt*el,qa.length)," of ",qa.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ye(Pt-1),disabled:Pt===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",Pt," of ",hr]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ye(Pt+1),disabled:Pt===hr,children:"Next"})]})]}),(M.itemCount!=null||M.headingCount!=null||M.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[M.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:M.itemCount})," items parsed"]}),M.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:M.headingCount})," headings"]}),M.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:M.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:(vc>0,"0 1 30%"),gap:10,justifyContent:"center"},onClick:()=>R(!0),"aria-label":"Start over",children:[(0,s.jsx)(pd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),vc>0&&(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:i,"aria-label":f?"View selection":b?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[f?"View Selection":b?"View Quote":"View Basket"," (",vc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ot,{})})]})]})]})]}),Tw&&(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:Ir.map(_=>{let L=Se.has(_.item.line_id),ze=dt(_);return(0,s.jsx)("div",{className:`review-gate-item${L?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{W(!0),Ei(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(_.item,w)}),(0,s.jsx)("span",{children:_.decision?.reason||(ze?"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:L?"Choice made":"Choose a product"})]})},_.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:Uw,children:"Skip all"}),ll.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),ll.map(_=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{O(L=>{let ze=new Set(L);return ze.delete(_.item.line_id),ze}),W(!0),Ei(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(_.item,w)}),(0,s.jsx)("span",{children:`Not added to your ${d}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},_.item.line_id))]}):null]})}),x&&(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 ",b?"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:()=>R(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{R(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var wt=Y(Xe());var q=Y(te()),g_=.2,tl=10,rw="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)}`,n=e.unitConversions?.find(i=>i.requestUom===t.requestedUnit);return n&&n.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/n.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}`},b_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${_a(e.sellUnit,1)}.`;function v_(){return(0,q.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,q.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,q.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,q.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function al(){return(0,q.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,q.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function rl({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:n,onBack:i,onStartNewQuote:o,internal:l=!1}){let c=(0,wt.useId)(),p=!l&&Gs()==="QZA6-MRA4",f=Object.values(e),[b,d]=(0,wt.useState)(""),[h,w]=(0,wt.useState)(!1),[M,D]=(0,wt.useState)(!1),m=Cn(),[u,g]=(0,wt.useState)(""),[v,N]=(0,wt.useState)({}),[A,T]=(0,wt.useState)({}),[z,Q]=(0,wt.useState)(1),[K,fe]=(0,wt.useState)({}),[Te,Ye]=(0,wt.useState)(!1),[Ve,it]=(0,wt.useState)("0"),pe=(0,wt.useRef)(new Set);(0,wt.useEffect)(()=>{if(!r)return;let x=Object.values(e).filter(R=>R.productId!=="-"&&Aa(R).requiredSellUnits==null&&!pe.current.has(R.lineId));x.length!==0&&(x.forEach(R=>pe.current.add(R.lineId)),fetch(Bt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Qa()},body:JSON.stringify({lines:x.map(R=>({line_id:R.lineId,product_id:R.productId,requested_description:R.requestedDescription??R.description,requested_qty:R.qty,requested_uom:R.unit,selected_description:R.description,selected_uoi:R.uoi,selected_uoi_count:R.uoiCount,selected_conversion:{sales_uom_normalised:R.salesUomNormalised,conversion_type:R.conversionType,sales_unit_size:R.salesUnitSize,sales_unit_size_uom:R.salesUnitSizeUom,coverage_qty:R.coverageQty,coverage_uom:R.coverageUom}}))})}).then(R=>R.ok?Zt(R):null).then(R=>{let I={};for(let ue of R?.data?.items??R?.items??[]){let ve=ue?.conversion;!ve||typeof ue?.line_id!="string"||(I[ue.line_id]={conversionType:ve.conversion_type,requestUomsSupported:ve.request_uoms_supported,salesUomNormalised:ve.sales_uom_normalised,salesUnitSize:ve.sales_unit_size,salesUnitSizeUom:ve.sales_unit_size_uom,coverageQty:ve.coverage_qty,coverageUom:ve.coverage_uom,roundingRule:ve.rounding_rule,conversionConfidence:ve.conversion_confidence,conversionNotes:ve.conversion_notes})}Object.keys(I).length>0&&r(I)}).catch(()=>{}))},[e,r]);function G(x){N(R=>{let I={...R};return delete I[x],I})}function ce(x,R){let I=parseFloat(R);!isNaN(I)&&I>=0&&t(x,I),G(x)}function xe(x,R,I){t(x,Math.max(0,R+I)),G(x)}function ye(x){T(R=>{let I={...R};return delete I[x],I})}function re(x,R){let I=parseFloat(R);!isNaN(I)&&I>=0&&a(x,I),ye(x)}function se(x,R,I){a(x,Math.max(0,R+I)),ye(x)}async function Me(){let x=b.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x)){g(rw);return}g(""),D(!0);try{let R=await fetch(Bt("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Qa()},body:JSON.stringify({email:x,items:_e.map(({item:I,pricing:ue})=>{let ve=ue.requiredSellUnits??ue.requestedAmount,Se=ue.requiredSellUnits!=null?ue.sellUnit:ue.requestedUnit;return{product_id:I.productId,description:I.description,quantity:ve,unit:_a(Se,ve),unit_price:ue.requiredSellUnits!=null?ue.unitPrice:null,line_total:ue.lineTotal}})})});if(!R.ok){let I=await Zt(R);console.error("Quote request failed",R.status,I?.message),g(R.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}m("quote_requested",{items:_e.length,total:Math.round(Tt*100)/100}),w(!0),window.scrollTo(0,0)}catch{g("Your request couldn't be sent. Check your connection and try again.")}finally{D(!1)}}let _e=f.map(x=>({item:x,pricing:Aa(x,{wasteFactorEnabled:Te,wasteFactorOverride:Math.max(0,Number.parseFloat(Ve)||0)/100})})),et=_e.reduce((x,R)=>x+(R.pricing.lineTotal??0),0),Ht=et*g_,Tt=et+Ht,tt=(0,wt.useRef)({items:_e.length,total:Math.round(Tt*100)/100});(0,wt.useEffect)(()=>{m("basket_viewed",tt.current)},[m]);let ct=Math.max(1,Math.ceil(_e.length/tl)),He=Math.min(z,ct),E=_e.slice((He-1)*tl,He*tl);return h?(0,q.jsx)("div",{className:"wizard-step entry-stage",children:(0,q.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,q.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,q.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,q.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,q.jsx)("h1",{children:"Quote requested"}),(0,q.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,q.jsx)("strong",{children:b.trim()}),", usually within one working day."]}),(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,q.jsx)("span",{children:"Start a new quote"})}),(0,q.jsx)("p",{className:"quote-request-sent-note",children:"Nothing is charged until you approve the quote."})]})}):(0,q.jsx)("div",{className:`wizard-step entry-stage${p?" basket-layout--qza6-mra4":""}`,children:(0,q.jsxs)("div",{className:`quick-order-card${l?"":" quick-order-card--customer"}`,children:[(0,q.jsxs)("div",{className:`quick-order-hero${l?"":" quick-order-hero--customer"}`,children:[l&&(0,q.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,q.jsxs)("div",{className:"basket-hero-copy",children:[p&&(0,q.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:i,children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]}),(0,q.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,q.jsx)("h1",{children:l?"Your Selection":p?"Request a quote":"Your Basket"}),l&&(0,q.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,q.jsx)("strong",{children:f.length})," ",f.length===1?"item":"items"]})]}),(0,q.jsx)("p",{children:l?"Review the items you've added before exporting them for review.":p?"Check your items & quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary before you buy."})]})]}),(0,q.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:f.length===0?(0,q.jsxs)("div",{className:"quick-order-history-empty",children:[(0,q.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:l?"\u{1F4CB}":"\u{1F9FA}"}),(0,q.jsx)("p",{children:l?"Your selection is empty.":p?"Your quote request is empty.":"Your basket is empty."}),(0,q.jsx)("p",{className:"basket-empty-hint",children:p?"Go back to your results and add items for your quote.":"Go back to your results and add quoted items."}),(0,q.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,q.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:i,"aria-label":"Back to results",children:(0,q.jsx)("span",{children:"Back to Results"})})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"basket-layout",children:[(0,q.jsxs)("div",{className:"basket-main",children:[(0,q.jsx)("div",{className:"basket-list","aria-label":l?"Selection items":p?"Quote request items":"Basket items",children:E.map(({item:x,pricing:R})=>{let I=v[x.lineId]??String(R.requestedAmount),ue=R.requestedUnit===R.sellUnit||R.costingMode==="review",ve=R.requiredSellUnits==null||R.requestedAmount!==R.requiredSellUnits||R.requestedUnit!==R.sellUnit;return(0,q.jsxs)("article",{className:"basket-card",children:[(0,q.jsxs)("div",{className:"basket-card-top",children:[(0,q.jsx)("img",{className:"basket-card-thumb",src:Ga(x.description,x.productId,x.pdpPhotoUrl),alt:"",width:48,height:48}),(0,q.jsxs)("div",{className:"basket-card-info",children:[(0,q.jsx)("div",{className:"bom-component-name",children:x.description}),ve&&R.costingMode!=="review"&&(0,q.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>fe(Se=>({...Se,[x.lineId]:!Se[x.lineId]})),"aria-expanded":!!K[x.lineId],children:["How we calculated this",(0,q.jsx)("span",{className:`basket-calc-toggle-chevron${K[x.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,q.jsx)(al,{})})]})]}),(0,q.jsx)("div",{className:"basket-card-actions",children:(0,q.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>n(x.lineId),"aria-label":`Remove ${x.description}`,children:(0,q.jsx)(v_,{})})})]}),l&&(0,q.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,q.jsxs)("dl",{className:"results-detail-grid",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion type"}),(0,q.jsx)("dd",{children:x.conversionType??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion confidence"}),(0,q.jsx)("dd",{children:x.conversionConfidence??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Sales unit"}),(0,q.jsx)("dd",{children:x.salesUnitSize!=null?(0,q.jsxs)(q.Fragment,{children:[x.salesUnitSize," ",xa(x.salesUnitSizeUom,x.salesUnitSize)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Coverage"}),(0,q.jsx)("dd",{children:x.coverageQty!=null?(0,q.jsxs)(q.Fragment,{children:[x.coverageQty," ",xa(x.coverageUom,x.coverageQty)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Waste factor"}),(0,q.jsx)("dd",{children:x.wasteFactorDefault??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Rounding rule"}),(0,q.jsx)("dd",{children:x.roundingRule??"-"})]})]}),x.conversionNotes&&(0,q.jsx)("p",{className:"results-rerank-note",children:x.conversionNotes})]}),R.costingMode==="review"?(0,q.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,q.jsx)("strong",{children:"Quantity needs confirmation."})," ",b_(R)]}):ve&&K[x.lineId]?(0,q.jsx)("p",{className:"basket-calc-text",children:h_(x,R)}):null,(0,q.jsxs)("div",{className:"basket-card-stats",children:[(0,q.jsxs)("div",{className:"basket-stat",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:I,disabled:ue,onChange:Se=>N(k=>({...k,[x.lineId]:Se.target.value})),onBlur:Se=>ce(x.lineId,Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&Se.target.blur()},"aria-label":`${x.description} requested quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:ue,onClick:()=>xe(x.lineId,parseFloat(I)||0,1),"aria-label":`Increase ${x.description} quantity`,children:(0,q.jsx)(al,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:ue,onClick:()=>xe(x.lineId,parseFloat(I)||0,-1),"aria-label":`Decrease ${x.description} quantity`,children:(0,q.jsx)(al,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:xa(R.requestedUnit,parseFloat(I)||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:A[x.lineId]??String(R.requiredSellUnits??""),onChange:Se=>T(k=>({...k,[x.lineId]:Se.target.value})),onBlur:Se=>re(x.lineId,Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&Se.target.blur()},"aria-label":`${x.description} order quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>se(x.lineId,parseFloat(A[x.lineId]??String(R.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${x.description} order quantity`,children:(0,q.jsx)(al,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>se(x.lineId,parseFloat(A[x.lineId]??String(R.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${x.description} order quantity`,children:(0,q.jsx)(al,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:xa(R.sellUnit,parseFloat(A[x.lineId]??String(R.requiredSellUnits??"0"))||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsx)("strong",{children:R.lineTotal!=null?nt(R.lineTotal):"-"}),R.lineTotal!=null&&(0,q.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},x.lineId)})}),ct>1&&(0,q.jsxs)("div",{className:"results-pagination",children:[(0,q.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(He-1)*tl+1,"\u2013",Math.min(He*tl,_e.length)," of ",_e.length]}),(0,q.jsxs)("div",{className:"results-pagination-controls",children:[(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Q(He-1),disabled:He===1,children:"Previous"}),(0,q.jsxs)("span",{className:"results-pagination-page",children:["Page ",He," of ",ct]}),(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Q(He+1),disabled:He===ct,children:"Next"})]})]})]}),(0,q.jsxs)("aside",{className:"basket-sidebar",children:[(0,q.jsx)("div",{className:"basket-sidebar-title",children:p?"Quote request summary":"Order summary"}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:p?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,q.jsx)("span",{children:nt(et)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:"VAT (20%)"}),(0,q.jsx)("span",{children:nt(Ht)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,q.jsx)("span",{children:p?"List price (inc. VAT)":"Total"}),(0,q.jsx)("span",{children:nt(Tt)})]}),!p&&(0,q.jsx)("div",{className:"basket-summary-waste",children:(0,q.jsxs)("div",{className:"basket-waste-control",children:[(0,q.jsxs)("label",{className:"basket-global-waste",children:[(0,q.jsx)("input",{type:"checkbox",checked:Te,onChange:x=>Ye(x.target.checked)}),(0,q.jsx)("span",{children:"Add waste factor"})]}),(0,q.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,q.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:Ve,onChange:x=>it(x.target.value),disabled:!Te,"aria-label":"Waste factor percent"}),(0,q.jsx)("span",{children:"%"})]})]})}),(0,q.jsx)("label",{htmlFor:`${c}-basket-reference`,className:"basket-sidebar-label",children:p?"Enter email for your sharper quote":"Your reference (optional)"}),(0,q.jsx)("input",{id:`${c}-basket-reference`,type:p?"email":"text",className:"basket-sidebar-input",value:b,onChange:x=>{d(x.target.value),p&&g("")},placeholder:p?"you@example.com":"PO number or job reference","aria-invalid":p&&u===rw,"aria-describedby":p&&u?`${c}-basket-reference-error`:void 0}),p&&u&&(0,q.jsx)("p",{id:`${c}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:u}),p?(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{Me()},disabled:M,"aria-busy":M,children:(0,q.jsx)("span",{children:M?"Sending\u2026":"Request our best quote"})}):(0,q.jsx)("button",{className:"cta-btn",onClick:()=>{m("downloaded",{type:"basket",items:f.length}),Iv(f)},"aria-label":l?"Download selection":"Download basket",children:(0,q.jsx)("span",{children:l?"Download Quote":"Buy Now"})}),(0,q.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,q.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),p?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,q.jsx)("div",{className:"btn-row results-actions",children:(0,q.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:i,"aria-label":"Back to results",children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]})})]})})]})})}var Et=Y(Xe()),iw=Y(te()),bd=(0,Et.createContext)(null);function Js({children:e,onOpenBasket:t}){let[a,r]=(0,Et.useState)({}),n=(0,Et.useCallback)(d=>{r(h=>({...h,[d.lineId]:d}))},[]),i=(0,Et.useCallback)(d=>{r(h=>{let w={...h};for(let M of d)w[M.lineId]=M;return w})},[]),o=(0,Et.useCallback)(d=>{r(h=>{let w={...h};return delete w[d],w})},[]),l=(0,Et.useCallback)((d,h)=>{r(w=>w[d]?{...w,[d]:{...w[d],qty:h,sellUnitsOverride:null}}:w)},[]),c=(0,Et.useCallback)((d,h)=>{r(w=>w[d]?{...w,[d]:{...w[d],sellUnitsOverride:h}}:w)},[]),p=(0,Et.useCallback)(d=>{r(h=>{let w=!1,M={...h};for(let[D,m]of Object.entries(d))M[D]&&(M[D]={...M[D],...m},w=!0);return w?M:h})},[]),f=(0,Et.useCallback)(()=>r({}),[]),b=(0,Et.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:n,addManyToCart:i,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:f,openBasket:t??(()=>{})}),[a,n,i,o,l,c,p,f,t]);return(0,iw.jsx)(bd.Provider,{value:b,children:e})}function An(){let e=(0,Et.useContext)(bd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function Ps(){return(0,Et.useContext)(bd)}var ka=Y(te());function Fs(e){return(0,ka.jsx)(Js,{children:(0,ka.jsx)(w_,{...e})})}function w_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,n]=(0,Je.useState)("entry"),[i,o]=(0,Je.useState)(null),[l,c]=(0,Je.useState)(""),p=(0,Je.useRef)(null),[f,b]=(0,Je.useState)(0),[d,h]=(0,Je.useState)(null),[w,M]=(0,Je.useState)(!1),{cart:D,addToCart:m,removeFromCart:u,updateCartQty:g,updateCartSellUnits:v,updateCartConversions:N,clearCart:A}=An(),[T,z]=(0,Je.useState)(!1),Q=(0,Je.useRef)(new Map),K=(0,Je.useRef)(null),fe=Qs("quick-quote",K);(0,Je.useEffect)(()=>{fe("viewed")},[fe]),(0,Je.useEffect)(()=>{let ye=Object.values(D).filter(re=>{if(re.productId==="-"||Aa(re).requiredSellUnits!=null)return!1;let se=`${re.productId}|${re.qty}|${re.unit}`;return Q.current.get(re.lineId)===se?!1:(Q.current.set(re.lineId,se),!0)});ye.length!==0&&fetch(Bt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Qa()},body:JSON.stringify({lines:ye.map(re=>({line_id:re.lineId,product_id:re.productId,requested_description:re.requestedDescription??re.description,requested_qty:re.qty,requested_uom:re.unit,selected_description:re.description,selected_uoi:re.uoi,selected_uoi_count:re.uoiCount,selected_conversion:{sales_uom_normalised:re.salesUomNormalised,conversion_type:re.conversionType,sales_unit_size:re.salesUnitSize,sales_unit_size_uom:re.salesUnitSizeUom,coverage_qty:re.coverageQty,coverage_uom:re.coverageUom}}))})}).then(re=>re.ok?Zt(re):null).then(re=>{let se={};for(let Me of re?.data?.items??re?.items??[]){let _e=Me?.conversion;!_e||typeof Me?.line_id!="string"||(se[Me.line_id]={conversionType:_e.conversion_type,requestUomsSupported:_e.request_uoms_supported,salesUomNormalised:_e.sales_uom_normalised,salesUnitSize:_e.sales_unit_size,salesUnitSizeUom:_e.sales_unit_size_uom,coverageQty:_e.coverage_qty,coverageUom:_e.coverage_uom,roundingRule:_e.rounding_rule,conversionConfidence:_e.conversion_confidence,conversionNotes:_e.conversion_notes})}Object.keys(se).length>0&&N(se)}).catch(()=>{})},[D,N]),(0,Je.useEffect)(()=>{if(window.location.hash!=="#matched-products"&&window.location.hash!=="#quote-request")return;let ye=new URL(window.location.href);ye.hash="",window.history.replaceState({...window.history.state??{},boqQuoteStage:"entry"},"",ye)},[]);let Te=(0,Je.useCallback)(ye=>{if(typeof window>"u")return;let re=new URL(window.location.href);re.hash=ye==="basket"?"quote-request":"matched-products";let se={...window.history.state??{},boqQuoteStage:ye};window.history.pushState(se,"",re)},[]);(0,Je.useEffect)(()=>{let ye=re=>{let se=re.state?.boqQuoteStage;n(se==="basket"?"basket":se==="results"&&d?"results":"entry")};return window.addEventListener("popstate",ye),()=>window.removeEventListener("popstate",ye)},[d]);let Ye=(0,Je.useCallback)(()=>{Te("basket"),n("basket")},[Te]),Ve=(0,Je.useCallback)(()=>{window.history.state?.boqQuoteStage==="basket"?window.history.back():n(d?"results":"entry")},[d]),it=(0,Je.useRef)(r);(0,Je.useEffect)(()=>{it.current!==r&&(it.current=r,window.scrollTo(0,0))},[r]);let pe=()=>{n("entry"),o(null),c(""),b(0),h(null),M(!1),A(),z(!1)},G=(0,Je.useCallback)(async(ye,re,se=!0)=>{c(""),b(0);let Me=0,_e=()=>{Me=Math.min(Me+1,3),b(Me)};try{let{jobId:et}=await Ib(ye,re,se),{promise:Ht,cancel:Tt}=ev(()=>Wb(et),5e3,_e,"schedule");p.current=Tt;let tt=await Ht;if(tt.status==="failed"||!tt.result)throw new Error(tt.error||"Failed to process schedule");let ct=tt.result.lineItems.length,He=tt.result.results.filter(E=>E.candidates.length>0).length;fe("results_shown",{lines:ct,matched:He,unmatched:ct-He}),M(!1),h(tt.result),Te("results"),n("results")}catch(et){fe("error",{stage:"matching"}),c(et?.message||"Failed to process schedule"),n("entry")}finally{p.current?.(),p.current=null}},[Te,fe]),ce=(0,Je.useCallback)(async(ye,re,se=!0)=>{let Me=ye.trim();if(!Me)return;o("schedule");let _e=new File([Me],"pasted-schedule.txt",{type:"text/plain"});await G(_e,re,se)},[G]),xe=(0,Je.useCallback)(async ye=>{o("schedule"),await G(ye)},[G]);return(0,ka.jsx)(Zo.Provider,{value:fe,children:(0,ka.jsx)("div",{ref:K,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:pr().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:ce,onUploadSchedule:xe,onEntryModeChange:o}),r==="results"&&i==="schedule"&&d&&(0,ka.jsx)(hd,{scheduleResult:d,onStartOver:pe,cart:D,onAddToCart:m,onRemoveFromCart:u,onGoToBasket:Ye,cartSeeded:T,onCartSeeded:()=>z(!0),reviewGateComplete:w,onReviewGateComplete:()=>M(!0),internal:a}),r==="basket"&&(0,ka.jsx)(rl,{cart:D,onUpdateQty:g,onUpdateSellUnits:v,onRemove:u,onBack:Ve,onStartNewQuote:pe,internal:a})]})})})}var Va=Y(Xe());var ki=Y(Xe()),ee=Y(te()),nw=[{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"}],Is=e=>Number.parseFloat(e)||0,ow=(e,t)=>Is(e)*(t==="m"?1:.3048),vd=(e,t)=>Is(e.quantity)*(2*ow(e.height,t)+ow(e.width,t)),y_=()=>({quantity:"1",width:"",height:""});function __({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 wd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,ki.useState)("m"),[i,o]=(0,ki.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,ki.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,f]=(0,ki.useState)([]),[b,d]=(0,ki.useState)("ogee"),[h,w]=(0,ki.useState)("2.4"),M=(N,A,T)=>{N(z=>({...z,[A]:T}))},D=vd(i,r)+vd(l,r)+p.reduce((N,A)=>N+vd(A,r),0),m=Is(h)>0?Math.ceil(D/Is(h)):0,u=nw.find(N=>N.id===b)?.label??"",g=[{key:`architrave-${b}`,label:`Architrave (${u})`,qty:D,unit:"m",query:`${u} architrave`,category:"architrave"}],v=(N,A,T,z)=>(0,ee.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,ee.jsx)("span",{children:N}),(0,ee.jsx)("input",{"aria-label":`${N} quantity`,type:"number",min:"0",step:"1",value:A.quantity,onChange:Q=>T("quantity",Q.target.value)}),(0,ee.jsx)("input",{"aria-label":`${N} width`,type:"number",min:"0",step:"0.01",value:A.width,onChange:Q=>T("width",Q.target.value)}),(0,ee.jsx)("input",{"aria-label":`${N} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:Q=>T("height",Q.target.value)}),z?(0,ee.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:z,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:()=>n("m"),children:"Metres"}),(0,ee.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>n("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",{})]}),v("Single doors",i,(N,A)=>M(o,N,A)),v("Double doors",l,(N,A)=>M(c,N,A)),p.map((N,A)=>v(`Alternative door ${A+1}`,N,(T,z)=>f(Q=>Q.map((K,fe)=>fe===A?{...K,[T]:z}:K)),()=>f(T=>T.filter((z,Q)=>Q!==A)))),(0,ee.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(N=>[...N,y_()]),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:nw.map(N=>(0,ee.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===N.id?" is-selected":""}`,onClick:()=>d(N.id),children:[(0,ee.jsx)(__,{profile:N.id}),(0,ee.jsx)("div",{className:"truss-estimator__option-title",children:N.label}),(0,ee.jsx)("div",{className:"truss-estimator__option-copy",children:N.blurb})]},N.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:[D.toFixed(2)," m"]})]}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Board lengths"}),(0,ee.jsx)("strong",{children:m})]})]})]}),(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?.(g),disabled:D<=0,children:a})]})]})]})})}var Ni=Y(Xe()),le=Y(te()),lw=60,sw=10,x_=.02,k_=.012,N_=.01,Rn=e=>Number.parseFloat(e)||0,S_=(e,t=2)=>e.toFixed(t);function yd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ni.useState)("brick"),[i,o]=(0,Ni.useState)("engineering-red"),[l,c]=(0,Ni.useState)("metric"),[p,f]=(0,Ni.useState)(""),[b,d]=(0,Ni.useState)(""),[h,w]=(0,Ni.useState)(!0),M=l==="metric"?Rn(p)*Rn(b):Rn(p)*Rn(b)*.092903,m=M*(r==="brick"?lw:sw),u=Math.ceil(m),g=M*(r==="brick"?x_:k_),v=Math.ceil(g/N_),N=l==="metric"?M:M*10.7639,A=[{key:r==="brick"?`brick-${i}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[i]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...h?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:v,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],T=z=>{if(z===l)return;let Q=z==="imperial"?3.28084:.3048;f((Rn(p)*Q).toFixed(2)),d((Rn(b)*Q).toFixed(2)),c(z)};return(0,le.jsx)(le.Fragment,{children:(0,le.jsxs)("div",{className:"truss-estimator",children:[(0,le.jsxs)("div",{className:"quick-order-hero",children:[(0,le.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,le.jsx)("h1",{children:"Brick & Block Calculator"}),(0,le.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,le.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,le.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,le.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,le.jsxs)("div",{className:"brick-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,le.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([z,Q])=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===z?" is-selected":""}`,onClick:()=>n(z),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,le.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",z==="brick"?lw:sw," per m\xB2"]})]},z))})]}),r==="brick"&&(0,le.jsxs)("div",{className:"brick-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,le.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(([z,Q,K])=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i===z?" is-selected":""}`,onClick:()=>o(z),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,le.jsx)("div",{className:"truss-estimator__option-copy",children:K})]},z))})]}),(0,le.jsxs)("div",{className:"brick-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,le.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,le.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>T("metric"),children:"Metric"}),(0,le.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>T("imperial"),children:"Imperial"})]}),(0,le.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:z=>f(z.target.value)})]}),(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:b,onChange:z=>d(z.target.value)})]})]})]}),(0,le.jsx)("div",{className:"brick-calculator__options",children:(0,le.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,le.jsx)("input",{type:"checkbox",checked:h,onChange:z=>w(z.target.checked)}),(0,le.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,le.jsxs)("div",{className:"brick-calculator__totals",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,le.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Wall area"}),(0,le.jsxs)("strong",{children:[S_(N)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,le.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),h?(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Ready-mixed mortar"}),(0,le.jsxs)("strong",{children:[v," x 20kg bags"]})]}):null]}),(0,le.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,le.jsxs)("div",{className:"brick-calculator__actions",children:[(0,le.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,le.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(A),disabled:M<=0,children:a})]})]})]})})}var fr=Y(Xe());var cw=new Map;function C_(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 Pr(e,t,a=12,r){let n=`${e}||${t??""}||${a}||${r??""}`,i=cw.get(n);if(i)return i;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Bt(`/api/catalogue/search?${o.toString()}`),{headers:wi()}),c=await Zt(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(C_):[];return cw.set(n,p),p}async function uw(e,t){return await Promise.all(e.map(async r=>{try{return{requirement:r,candidates:await Pr(r.query,r.category,void 0,t)}}catch{return{requirement:r,candidates:[]}}}))}async function pw(){let e=await fetch(Bt("/api/catalogue"),{headers:wi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Zt(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var $=Y(te()),q_=1.54,E_=1440,M_=25,_d=800,T_=1500,xd=e=>Number.parseFloat(e)||0,Un={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=Ps(),[n,i]=(0,fr.useState)("m"),[o,l]=(0,fr.useState)(""),[c,p]=(0,fr.useState)(""),[f,b]=(0,fr.useState)(""),[d,h]=(0,fr.useState)("concrete"),[w,M]=(0,fr.useState)("mot"),[D,m]=(0,fr.useState)(!1),[u,g]=(0,fr.useState)(null),v=n==="m"?1:.3048,N=xd(o)*v*xd(c)*v*xd(f)*(n==="m"?.01:.0254),A=Un[w],T=N*q_/7,z=T*E_,Q=T*2,K=T*4,fe=Math.ceil(z/M_),Te=Math.ceil(Q*Un["sharp-sand"].density*1e3/_d),Ye=Math.ceil(K*Un.gravel.density*1e3/_d),Ve=Math.ceil(N*A.density*1e3/_d),it=d==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:fe,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Te,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:Ye,productId:"6001004"}]:[{key:w,label:`${A.label} Bulk Bag (800kg)`,qty:Ve,productId:A.productId}],pe=()=>{if(t){t(it.map(ce=>({key:ce.key,label:ce.label,qty:ce.qty,unit:"each",query:ce.productId})));return}G()},G=async()=>{let ce=Date.now();m(!0),g(null);try{let xe=await Promise.all(it.map(async re=>{let se=(await Pr(re.productId)).find(Me=>Me.product_id===re.productId);if(!se)throw new Error(`${re.label} is no longer available in this catalogue.`);return Kr(se,{lineId:`concrete-aggregate:${re.key}`,description:re.label,unit:"bag",qty:re.qty})})),ye=T_-(Date.now()-ce);ye>0&&await new Promise(re=>window.setTimeout(re,ye)),r?.clearCart(),r?.addManyToCart(xe),r?.openBasket()}catch(xe){g(xe instanceof Error?xe.message:"Could not add the products to your basket.")}finally{m(!1)}};return D?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Your Materials"}),(0,$.jsx)("p",{children:"Calculating quantities from the Concrete & Aggregate Calculator."})]}),(0,$.jsx)("div",{className:"truss-estimator__card",children:(0,$.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,$.jsx)(dr,{}),(0,$.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Concrete & Aggregate Calculator"}),(0,$.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,$.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,$.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,$.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,$.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${d==="concrete"?" is-selected":""}`,onClick:()=>h("concrete"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${d==="aggregate"?" is-selected":""}`,onClick:()=>h("aggregate"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),d==="aggregate"&&(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,$.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Un).map(ce=>(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${w===ce?" is-selected":""}`,onClick:()=>M(ce),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:Un[ce].label}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:Un[ce].blurb})]},ce))})]}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,$.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,$.jsx)("span",{children:"Units"}),(0,$.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,$.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metric"}),(0,$.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Imperial"})]})]}),(0,$.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Length (",n,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:ce=>l(ce.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Width (",n,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:ce=>p(ce.target.value)})]})]}),(0,$.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,$.jsxs)("span",{children:["Depth (",n==="m"?"cm":"inches",")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.1",value:f,onChange:ce=>b(ce.target.value)})]})]}),(0,$.jsxs)("div",{className:"materials-calculator__totals",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,$.jsx)("div",{className:"materials-calculator__result-grid",children:d==="concrete"?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Cement"}),(0,$.jsxs)("strong",{children:[z.toFixed(0)," kg"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Sharp sand"}),(0,$.jsxs)("strong",{children:[Q.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"20mm aggregate"}),(0,$.jsxs)("strong",{children:[K.toFixed(2)," m\xB3"]})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:A.label}),(0,$.jsxs)("strong",{children:[N.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Approx. weight"}),(0,$.jsxs)("strong",{children:[(N*A.density).toFixed(2)," t"]})]}),(0,$.jsx)("div",{})]})}),(0,$.jsx)("p",{className:"materials-calculator__note",children:d==="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."})]}),u&&(0,$.jsx)("p",{className:"results-empty-hint estimator-products__error",children:u}),(0,$.jsxs)("div",{className:"materials-calculator__actions",children:[(0,$.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,$.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:pe,disabled:N<=0||D,children:D?"Adding products\u2026":a})]})]})]})})}var Ya=Y(Xe());var U=Y(te()),Dn=12,Bn=8,Ws=.56,dw=.21,Na={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:{lengthM:2.4,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}]}},Si=["range","grid","pictureFrame","substructure"],z_={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:""}},ec=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),tc=(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),A_=(e,t,a,r)=>{let n=ec(e,t,a),i=ec(e,t,r),o=ec(a,r,e),l=ec(a,r,t);return n===0&&tc(e,t,a)||i===0&&tc(e,t,r)||o===0&&tc(a,r,e)||l===0&&tc(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},Nd=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let n=e[(r+1)%e.length];for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&A_(e[r],n,e[i],e[(i+1)%e.length]))return!0}return!1};function Sd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ya.useState)(0),[i,o]=(0,Ya.useState)(z_),[l,c]=(0,Ya.useState)(1),[p,f]=(0,Ya.useState)({x:0,y:0}),[b,d]=(0,Ya.useState)(null),h=(0,Ya.useRef)(null),w=(0,Ya.useRef)(null),M=(0,Ya.useRef)(null),D=Si[r],m=i.range?Na.ranges[i.range]:null,u=Dn/l,g=Bn/l,v=(Dn-u)/2,N=(Bn-g)/2,A=Math.max(-Dn,Math.min(Dn*2-u,v+p.x)),T=Math.max(-Bn,Math.min(Bn*2-g,N+p.y)),z=Number.parseFloat(i.quickLengthM),Q=Number.parseFloat(i.quickWidthM),K=z>0&&Q>0,fe=E=>Math.abs(E.reduce((x,R,I)=>{let ue=E[(I+1)%E.length];return x+R.x*ue.y-ue.x*R.y},0))/2,Te=(E,x)=>Math.hypot(x.x-E.x,x.y-E.y),Ye=i.isOutlineClosed?fe(i.points):0,Ve=i.isOutlineClosed?i.points.reduce((E,x,R)=>E+Te(x,i.points[(R+1)%i.points.length]),0):0,it=i.isOutlineClosed?i.points.reduce((E,x,R)=>E+(i.wallSegments.has(R)?0:Te(x,i.points[(R+1)%i.points.length])),0):0,pe=i.points.reduce((E,x)=>({x:E.x+x.x/i.points.length,y:E.y+x.y/i.points.length}),{x:0,y:0}),G=i.points.length>1?(()=>{let E=i.points[0],x=i.points[1],R=Te(E,x),I=R?-(x.y-E.y)/R:0,ue=R?(x.x-E.x)/R:0,ve=(E.x+x.x)/2,Se=(E.y+x.y)/2,k=I*(ve-pe.x)+ue*(Se-pe.y)>=0?1:-1;return{x:ve+I*Ws*k,y:Se+ue*Ws*k}})():null,xe=(()=>{let E=i.range?Na.ranges[i.range]:Na.ranges.meridian,x=i.deckSizeMode==="quick"?z*Q:Ye,R=i.deckSizeMode==="quick"?2*(z+Q):it,I=i.direction==="diagonal"?Na.wastage.diagonal:Na.wastage.straight,ue=i.pictureFrame==="yes"?Na.pictureFrame.extraWastage:0,Se=x/(E.boardWidthM+Na.boardGapM)/E.boardLengthM,k=Math.ceil(Se*(1+I+ue)),j=Math.ceil(x*30*(1+I+ue)/200),O=Na.joist.spacingOptions.find(C=>C.id===i.joistSpacing)??Na.joist.spacingOptions[1],ne=x/O.spacingM,W=Math.ceil(ne/Na.joist.lengthM);return{range:E,area:x,boardCount:k,screwBoxes:j,joistLengthsNeeded:W,spacing:O}})(),ye=xe?[{key:`boards-${i.range??"meridian"}`,label:`Deck boards (${xe.range.label})`,qty:xe.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:xe.joistLengthsNeeded,unit:"each",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:xe.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],re=()=>D==="range"?!!i.range:D==="grid"?i.deckSizeMode==="quick"?K:i.isOutlineClosed&&Ye>0:D==="pictureFrame"?!!i.pictureFrame&&!!i.direction:D==="substructure"?!!i.joistSpacing:!0,se=r===Si.length-1?a:"Next",Me=(E,x,R=!1)=>{let I=M.current?.getBoundingClientRect();if(!I)return null;let ue=R?1:.25;return{x:Math.round(Math.max(A,Math.min(A+u,A+(E-I.left)/I.width*u))/ue)*ue,y:Math.round(Math.max(T,Math.min(T+g,T+(x-I.top)/I.height*g))/ue)*ue}},_e=E=>{if(i.isOutlineClosed){let R=E.target;if(R!==E.currentTarget&&!R.classList.contains("deck-outline__grid"))return;w.current={startX:E.clientX,startY:E.clientY,startViewX:A,startViewY:T},E.currentTarget.setPointerCapture(E.pointerId);return}if(i.drawMode!=="outline")return;let x=Me(E.clientX,E.clientY,!0);x&&(d(null),o(R=>{let I=[...R.points,x];return Nd(I,!1)?{...R,drawError:"Edges cannot cross. Choose another corner."}:{...R,points:I,drawError:""}}))},et=(E,x)=>{if(!i.isOutlineClosed){E.stopPropagation(),x===0&&i.points.length>=3&&o(R=>({...R,isOutlineClosed:!0,drawMode:"edges"}));return}E.stopPropagation(),h.current=x,E.currentTarget.setPointerCapture(E.pointerId)},Ht=E=>{if(w.current){let I=M.current?.getBoundingClientRect();if(!I)return;let ue=w.current,ve=ue.startViewX-(E.clientX-ue.startX)/I.width*u,Se=ue.startViewY-(E.clientY-ue.startY)/I.height*g;f({x:ve-v,y:Se-N});return}!i.isOutlineClosed&&i.drawMode==="outline"&&d(Me(E.clientX,E.clientY,!0));let x=h.current;if(x===null)return;let R=Me(E.clientX,E.clientY);R&&o(I=>{let ue=I.points.map((ve,Se)=>Se===x?R:ve);return Nd(ue,!0)?{...I,drawError:"Edges cannot cross. Move the corner to a different position."}:{...I,points:ue,drawError:""}})},Tt=E=>{w.current=null,h.current=null,E.currentTarget.hasPointerCapture(E.pointerId)&&E.currentTarget.releasePointerCapture(E.pointerId)},tt=E=>{o(x=>{let R=new Set(x.wallSegments);return R.has(E)?R.delete(E):R.add(E),{...x,wallSegments:R}})},ct=()=>{r===0?e():n(E=>E-1)},He=()=>{re()&&(r===Si.length-1?t?.(ye):n(E=>E+1))};return(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)("div",{className:"truss-estimator",children:[(0,U.jsxs)("div",{className:"quick-order-hero",children:[(0,U.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,U.jsx)("h1",{children:"Decking Calculator"}),(0,U.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,U.jsxs)("div",{className:"truss-estimator__card",children:[(0,U.jsxs)("div",{className:"truss-estimator__body",children:[D==="range"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Na.ranges).map(([E,x])=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===E?" is-selected":""}`,onClick:()=>o(R=>({...R,range:E})),children:[(0,U.jsx)("div",{className:"truss-estimator__option-title",children:x.label}),(0,U.jsx)("div",{className:"truss-estimator__option-copy",children:x.blurb}),(0,U.jsxs)("div",{className:"truss-estimator__option-copy",children:[x.boardLengthM,"m boards"]})]},E))})]}):null,D==="grid"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,U.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,U.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(E=>({...E,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(E=>({...E,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),i.deckSizeMode==="quick"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Length (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickLengthM,onChange:E=>o(x=>({...x,quickLengthM:E.target.value}))})]}),(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Width (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickWidthM,onChange:E=>o(x=>({...x,quickWidthM:E.target.value}))})]})]}),(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),K?(0,U.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,U.jsxs)("div",{children:[(z*Q).toFixed(2)," m\xB2 deck"]}),(0,U.jsxs)("div",{children:[(2*(z+Q)).toFixed(2)," m perimeter"]})]}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,U.jsxs)("div",{className:"deck-outline__toolbar",children:[i.isOutlineClosed?(0,U.jsxs)("div",{className:"deck-outline__summary",children:[(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Deck area"}),(0,U.jsxs)("strong",{children:[Ye.toFixed(2)," m\xB2"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Perimeter"}),(0,U.jsxs)("strong",{children:[Ve.toFixed(2)," m"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Wall edges"}),(0,U.jsx)("strong",{children:i.wallSegments.size>0?i.wallSegments.size:"None"})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Visible edge"}),(0,U.jsxs)("strong",{children:[it.toFixed(2)," m"]})]})]}):null,(0,U.jsxs)("div",{className:"deck-outline__actions",children:[(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(E=>({...E,points:E.points.slice(0,-1)})),disabled:i.points.length===0||i.isOutlineClosed,children:"Undo"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d(null),o(E=>({...E,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:i.points.length===0,children:"Clear"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(E=>({...E,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,U.jsx)("div",{className:"deck-editor-layout",children:(0,U.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,U.jsxs)("div",{className:"deck-outline",children:[(0,U.jsxs)("svg",{ref:M,className:`deck-outline__canvas${i.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${A} ${T} ${u} ${g}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:_e,onPointerMove:Ht,onPointerUp:Tt,onPointerLeave:()=>{d(null),w.current||(h.current=null)},children:[(0,U.jsx)("defs",{children:(0,U.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,U.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,U.jsx)("rect",{x:-Dn,y:-Bn,width:Dn*3,height:Bn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),i.points.length>1?(0,U.jsx)("polyline",{className:"deck-outline__preview",points:i.points.map(E=>`${E.x},${E.y}`).join(" ")}):null,i.isOutlineClosed?(0,U.jsx)("polygon",{className:"deck-outline__shape",points:i.points.map(E=>`${E.x},${E.y}`).join(" "),stroke:"none"}):null,i.points.length>1?i.points.slice(0,i.isOutlineClosed?void 0:-1).map((E,x)=>{let R=i.points[i.isOutlineClosed?(x+1)%i.points.length:x+1],I=Te(E,R),ue=I?-(R.y-E.y)/I:0,ve=I?(R.x-E.x)/I:0,Se=(E.x+R.x)/2,k=(E.y+R.y)/2,j=ue*(Se-pe.x)+ve*(k-pe.y)>=0?1:-1,O=Se+ue*Ws*j,ne=k+ve*Ws*j;return(0,U.jsxs)("g",{children:[(0,U.jsx)("line",{className:"deck-outline__edge-hit",x1:E.x,y1:E.y,x2:R.x,y2:R.y,onClick:i.isOutlineClosed?()=>tt(x):void 0}),(0,U.jsx)("line",{className:`deck-outline__edge${i.wallSegments.has(x)?" is-wall":""}`,x1:E.x,y1:E.y,x2:R.x,y2:R.y,pointerEvents:"none"}),(0,U.jsxs)("text",{className:`deck-outline__edge-label${i.wallSegments.has(x)?" is-wall":""}`,x:O,y:ne,textAnchor:"middle",dominantBaseline:"central",fontSize:dw/l,children:[I.toFixed(2)," m"]})]},`segment-${x}`)}):null,!i.isOutlineClosed&&i.points.length>0&&b?(()=>{let E=i.points[i.points.length-1],x=Te(E,b);if(!x)return null;let R=-(b.y-E.y)/x,I=(b.x-E.x)/x,ue=(E.x+b.x)/2,ve=(E.y+b.y)/2;return(0,U.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,U.jsx)("line",{x1:E.x,y1:E.y,x2:b.x,y2:b.y}),(0,U.jsxs)("text",{x:ue+R*.34,y:ve+I*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:dw/l,children:[x.toFixed(2)," m"]})]})})():null,i.points.map((E,x)=>(0,U.jsx)("circle",{className:"deck-outline__point",cx:E.x,cy:E.y,r:"0.13",onPointerDown:R=>et(R,x)},`point-${x}`))]}),(0,U.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,U.jsx)("button",{type:"button",onClick:()=>c(E=>Math.max(.5,E-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,U.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,U.jsx)("button",{type:"button",onClick:()=>c(E=>Math.min(1,E+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),i.isOutlineClosed&&i.wallSegments.size===0&&G?(0,U.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(G.x-A)/u*100}%`,top:`${(G.y-T)/g*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!i.isOutlineClosed&&i.points.length>=3?(0,U.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(E=>Nd(E.points,!0)?{...E,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...E,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,U.jsxs)("div",{className:"deck-outline__supporting",children:[(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:i.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),i.drawError?(0,U.jsx)("div",{className:"deck-outline__error",role:"alert",children:i.drawError}):null]})]})})]})]}):null,D==="pictureFrame"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,U.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,U.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(E=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.pictureFrame===E.id?" is-selected":""}`,onClick:()=>o(x=>({...x,pictureFrame:E.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:Kt(E.img),alt:""}),(0,U.jsx)("span",{children:E.label})]},E.id))}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,U.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(E=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.direction===E.id?" is-selected":""}`,onClick:()=>o(x=>({...x,direction:E.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:Kt(E.img),alt:""}),(0,U.jsx)("span",{children:E.label})]},E.id))})]})]}):null,D==="substructure"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,U.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,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Na.joist.spacingOptions.map(E=>(0,U.jsx)("button",{type:"button",className:`truss-estimator__option-card${i.joistSpacing===E.id?" is-selected":""}`,onClick:()=>o(x=>({...x,joistSpacing:E.id})),children:(0,U.jsx)("div",{className:"truss-estimator__option-title",children:E.label})},E.id))})]}):null]}),(0,U.jsxs)("div",{className:"truss-estimator__nav",children:[(0,U.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ct,children:"Back"}),(0,U.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:He,disabled:!re(),children:[(0,U.jsx)("span",{children:se}),(0,U.jsx)("span",{className:"arrow",children:(0,U.jsx)(Ot,{})})]})]})]})]})})}var Ca=Y(Xe());var H=Y(te()),mw=12,fw=30,On=12,Ln=8,gw=.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 lap 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}}},Ci=["range","height","gate","posts"],R_={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:""}},ac=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),rc=(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),U_=(e,t,a,r)=>{let n=ac(e,t,a),i=ac(e,t,r),o=ac(a,r,e),l=ac(a,r,t);return n===0&&rc(e,t,a)||i===0&&rc(e,t,r)||o===0&&rc(a,r,e)||l===0&&rc(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},ic=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&U_(e[r],e[(r+1)%e.length],e[n],e[(n+1)%e.length]))return!0;return!1};function Cd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ca.useState)(0),[i,o]=(0,Ca.useState)(R_),l=(0,Ca.useRef)(null),c=(0,Ca.useRef)(null),[p,f]=(0,Ca.useState)(1),[b,d]=(0,Ca.useState)({x:0,y:0}),[h,w]=(0,Ca.useState)(null),M=(0,Ca.useRef)(null),D=(0,Ca.useRef)(null),m=(0,Ca.useRef)(null),u=Ci[r],g=i.range?Sa.ranges[i.range]:null,v=On/p,N=Ln/p,A=(On-v)/2,T=(Ln-N)/2,z=Math.max(-On,Math.min(On*2-v,A+b.x)),Q=Math.max(-Ln,Math.min(Ln*2-N,T+b.y)),K=i.boundaryPoints.reduce((k,j)=>({x:k.x+j.x/Math.max(1,i.boundaryPoints.length),y:k.y+j.y/Math.max(1,i.boundaryPoints.length)}),{x:0,y:0}),fe=k=>{let j=new Set,O=[];return k.forEach(ne=>{let[W,C]=ne.split(",").map(Number),V=[{key:`H,${W},${C}`,type:"H",x:W,y:C},{key:`H,${W},${C+1}`,type:"H",x:W,y:C+1},{key:`V,${W},${C}`,type:"V",x:W,y:C},{key:`V,${W+1},${C}`,type:"V",x:W+1,y:C}],X=[!k.has(`${W},${C-1}`),!k.has(`${W},${C+1}`),!k.has(`${W-1},${C}`),!k.has(`${W+1},${C}`)];V.forEach((me,Ce)=>{X[Ce]&&!j.has(me.key)&&(j.add(me.key),O.push(me))})}),O},Te=(k,j)=>fe(k).filter(O=>!j.has(O.key)),Ye=(k,j)=>Te(k,j).length,Ve=(k,j)=>{let O={};Te(k,j).forEach(W=>{var C,V,X,me;W.type==="H"?((O[C=`${W.x},${W.y}`]||(O[C]=[])).push("H"),(O[V=`${W.x+1},${W.y}`]||(O[V]=[])).push("H")):((O[X=`${W.x},${W.y}`]||(O[X]=[])).push("V"),(O[me=`${W.x},${W.y+1}`]||(O[me]=[])).push("V"))});let ne=0;return Object.values(O).forEach(W=>{(W.length===1||W.length===2&&W[0]!==W[1]||W.length>=3)&&(ne+=1)}),ne},pe=(()=>{let k=i.range?Sa.ranges[i.range]:Sa.ranges.boundary,j=i.height??"1.8",O=i.boundaryMode==="quick"?Math.max(0,Number.parseFloat(i.quickLengthM)||0):i.boundaryClosed?i.boundaryPoints.slice(0,-1).reduce((hr,Pt,Ft)=>hr+(i.excludedBoundaryEdges.has(Ft)?0:Math.hypot(i.boundaryPoints[Ft+1].x-Pt.x,i.boundaryPoints[Ft+1].y-Pt.y)),0):0,ne=i.gateType&&i.gateType!=="none"?Number.parseFloat(i.gateWidthM)||Sa.gate[i.gateType].widthDefault:0,W=Math.max(0,O-ne),C=W>0?Math.ceil(W/k.panelWidthM):0,V=i.boundaryPoints.length>2&&i.boundaryPoints[0].x===i.boundaryPoints[i.boundaryPoints.length-1].x&&i.boundaryPoints[0].y===i.boundaryPoints[i.boundaryPoints.length-1].y,X=i.boundaryMode==="quick"?W>0?2:0:i.boundaryClosed?i.boundaryPoints.slice(0,V?-1:void 0).reduce((hr,Pt,Ft)=>{let Yd=Ft>0&&!i.excludedBoundaryEdges.has(Ft-1),Vd=Ft<i.boundaryPoints.length-1&&!i.excludedBoundaryEdges.has(Ft);return hr+(Yd||Vd?1:0)},0):0,me=W>0?Math.ceil(W/k.panelWidthM)+1:0,Ce=Math.max(0,me-X),dt=i.mountingType?Sa.mounting[i.mountingType]:Sa.mounting.concrete,je=i.gateType&&i.gateType!=="none"?2:0,Fr=Ce+X+je,Ir=i.mountingType==="postcrete"?Fr*Sa.mounting.postcrete.bagsPerPost:0,ll=i.gravelBoard==="yes"?C:0;return{range:k,height:j,totalEdgeM:O,fencedLengthM:W,gateWidthM:ne,panelsCount:C,cornerPostCount:X,intermediatePostCount:Ce,gatePostCount:je,totalPostCount:Fr,bagsCount:Ir,gravelCount:ll,capCount:Fr,mounting:dt}})(),G=i.gateType&&i.gateType!=="none"?Sa.gate[i.gateType].label:null,ce=Number(pe.height)<=1.2?"6":"8",xe=pe?[{key:`panels-${i.range??"boundary"}-${pe.height}`,label:`${pe.range.label} panels (${pe.height}m)`,qty:pe.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...i.mountingType==="concrete"?[{key:`concrete-intermediate-${ce}`,label:"Intermediate concrete posts",qty:pe.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ce}`,label:"End and corner concrete posts",qty:pe.cornerPostCount+pe.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ce}`,label:"Timber fence posts",qty:pe.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:pe.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...G?[{key:"gate",label:G,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...pe.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:pe.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],ye=()=>{if(u==="range"){let k=i.boundaryMode==="quick"?(Number.parseFloat(i.quickLengthM)||0)>0:i.boundaryClosed&&i.boundaryPoints.length>=2;return!!i.range&&k}return u==="height"?!!i.height&&!!i.gravelBoard:u==="gate"?!!i.gateType&&(i.gateType==="none"||i.gateWidthM.trim()!==""):u==="posts"?!!i.mountingType:!0},re=r===Ci.length-1?a:"Next",se=k=>{o(j=>{let O=k(new Set(j.grid)),ne=new Set([...j.excludedEdges].filter(W=>fe(O).some(C=>C.key===W)));return{...j,grid:O,excludedEdges:ne}})},Me=(k,j,O)=>{se(ne=>{let W=`${k},${j}`;return O?ne.add(W):ne.delete(W),ne})},_e=(k,j,O,ne,W)=>{let C=k,V=j,X=Math.abs(O-k),me=k<O?1:-1,Ce=-Math.abs(ne-j),dt=j<ne?1:-1,je=X+Ce;for(;Me(C,V,W),!(C===O&&V===ne);){let Fr=2*je;Fr>=Ce&&(je+=Ce,C+=me),Fr<=X&&(je+=X,V+=dt)}},et=(k,j)=>{let O=c.current?.getBoundingClientRect();if(!O)return null;let ne=Math.floor((k-O.left)/fw),W=Math.floor((j-O.top)/fw);return ne<0||W<0||ne>=mw||W>=mw?null:{x:ne,y:W}},Ht=k=>{if(i.gridMode!=="draw")return;let j=et(k.clientX,k.clientY);if(!j)return;k.preventDefault();let O=`${j.x},${j.y}`,ne=!i.grid.has(O);l.current={active:!0,paintValue:ne,lastX:j.x,lastY:j.y},k.currentTarget.setPointerCapture(k.pointerId),Me(j.x,j.y,ne)},Tt=k=>{let j=l.current;if(!j?.active)return;let O=et(k.clientX,k.clientY);O&&(O.x===j.lastX&&O.y===j.lastY||(_e(j.lastX,j.lastY,O.x,O.y,j.paintValue),l.current={...j,lastX:O.x,lastY:O.y}))},tt=k=>{l.current?.active&&(l.current=null,k.currentTarget.releasePointerCapture(k.pointerId))},ct=(k,j,O=!1)=>{let ne=m.current?.getBoundingClientRect();if(!ne)return null;let W=O?1:.25;return{x:Math.round(Math.max(z,Math.min(z+v,z+(k-ne.left)/ne.width*v))/W)*W,y:Math.round(Math.max(Q,Math.min(Q+N,Q+(j-ne.top)/ne.height*N))/W)*W}},He=k=>{if(i.boundaryClosed){let O=k.target;if(O!==k.currentTarget&&!O.classList.contains("fence-boundary__grid"))return;D.current={startX:k.clientX,startY:k.clientY,startViewX:z,startViewY:Q},k.currentTarget.setPointerCapture(k.pointerId);return}let j=ct(k.clientX,k.clientY,!0);j&&(w(null),o(O=>{let ne=[...O.boundaryPoints,j];return ic(ne,!1)?{...O}:{...O,boundaryPoints:ne}}))},E=(k,j)=>{if(k.stopPropagation(),!i.boundaryClosed){if(j!==0||i.boundaryPoints.length<3)return;o(O=>ic(O.boundaryPoints,!0)?O:{...O,boundaryPoints:[...O.boundaryPoints,O.boundaryPoints[0]],boundaryClosed:!0});return}M.current=j,k.currentTarget.setPointerCapture(k.pointerId)},x=k=>{if(D.current){let O=m.current?.getBoundingClientRect();if(!O)return;let ne=D.current,W=ne.startViewX-(k.clientX-ne.startX)/O.width*v,C=ne.startViewY-(k.clientY-ne.startY)/O.height*N;d({x:W-A,y:C-T});return}if(i.boundaryClosed||w(ct(k.clientX,k.clientY,!0)),M.current===null)return;let j=ct(k.clientX,k.clientY);j&&o(O=>{let ne=O.boundaryPoints.length>2&&O.boundaryPoints[0].x===O.boundaryPoints[O.boundaryPoints.length-1].x&&O.boundaryPoints[0].y===O.boundaryPoints[O.boundaryPoints.length-1].y,W=O.boundaryPoints.map((C,V)=>{let X=V===M.current,me=ne&&M.current===0&&V===O.boundaryPoints.length-1;return X||me?j:C});return ic(W,!1)?O:{...O,boundaryPoints:W}})},R=k=>{D.current=null,M.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},I=k=>{o(j=>{let O=new Set(j.excludedBoundaryEdges);return O.has(k)?O.delete(k):O.add(k),{...j,excludedBoundaryEdges:O}})},ue=()=>{r===0?e():n(k=>k-1)},ve=()=>{ye()&&(r===Ci.length-1?t?.(xe):n(k=>k+1))},Se=fe(i.grid);return(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)("div",{className:"truss-estimator",children:[(0,H.jsxs)("div",{className:"quick-order-hero",children:[(0,H.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,H.jsx)("h1",{children:"Fencing Calculator"}),(0,H.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,H.jsxs)("div",{className:"truss-estimator__card",children:[(0,H.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,H.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,H.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.ranges).map(([k,j])=>(0,H.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===k?" is-selected":""}`,onClick:()=>o(O=>({...O,range:k})),children:[(0,H.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,H.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},k))})]}):null,u==="range"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,H.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,H.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,H.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"quick"})),children:"Quick estimate"}),(0,H.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"draw"})),children:"Draw your boundary"})]}),i.boundaryMode==="quick"?(0,H.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,H.jsx)("span",{children:"Total fence length (m)"}),(0,H.jsx)("input",{type:"number",min:"0",step:"0.1",value:i.quickLengthM,onChange:k=>o(j=>({...j,quickLengthM:k.target.value}))})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{className:"fence-boundary__toolbar",children:(0,H.jsxs)("div",{className:"fence-boundary__actions",children:[(0,H.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,boundaryPoints:k.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:i.boundaryPoints.length===0||i.boundaryClosed,children:"Undo"}),(0,H.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d({x:0,y:0}),w(null),o(k=>({...k,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:i.boundaryPoints.length===0,children:"Clear"}),(0,H.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,H.jsxs)("div",{className:"fence-boundary",children:[(0,H.jsxs)("svg",{ref:m,className:`fence-boundary__canvas${i.boundaryClosed?" is-pan-mode":""}`,viewBox:`${z} ${Q} ${v} ${N}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:He,onPointerMove:x,onPointerUp:R,onPointerLeave:()=>{w(null),D.current||(M.current=null)},children:[(0,H.jsx)("defs",{children:(0,H.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,H.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,H.jsx)("rect",{x:-On,y:-Ln,width:On*3,height:Ln*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),i.boundaryPoints.length>1?(0,H.jsx)("polyline",{className:"fence-boundary__preview",points:i.boundaryPoints.map(k=>`${k.x},${k.y}`).join(" ")}):null,i.boundaryPoints.length>1?i.boundaryPoints.slice(0,-1).map((k,j)=>{let O=i.boundaryPoints[j+1],ne=Math.hypot(O.x-k.x,O.y-k.y),W=ne?-(O.y-k.y)/ne:0,C=ne?(O.x-k.x)/ne:0,V=(k.x+O.x)/2,X=(k.y+O.y)/2,me=W*(V-K.x)+C*(X-K.y)>=0?1:-1,Ce=V+W*gw*me,dt=X+C*gw*me;return(0,H.jsxs)("g",{children:[(0,H.jsx)("line",{className:"fence-boundary__edge-hit",x1:k.x,y1:k.y,x2:O.x,y2:O.y,onClick:i.boundaryClosed?()=>I(j):void 0}),(0,H.jsx)("line",{className:`fence-boundary__edge${i.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x1:k.x,y1:k.y,x2:O.x,y2:O.y,pointerEvents:"none"}),(0,H.jsxs)("text",{className:`fence-boundary__edge-label${i.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x:Ce,y:dt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[ne.toFixed(2)," m"]})]},`fence-edge-${j}`)}):null,!i.boundaryClosed&&i.boundaryPoints.length>0&&h?(()=>{let k=i.boundaryPoints[i.boundaryPoints.length-1],j=Math.hypot(h.x-k.x,h.y-k.y);if(!j)return null;let O=-(h.y-k.y)/j,ne=(h.x-k.x)/j,W=(k.x+h.x)/2,C=(k.y+h.y)/2;return(0,H.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,H.jsx)("line",{x1:k.x,y1:k.y,x2:h.x,y2:h.y}),(0,H.jsxs)("text",{x:W+O*.34,y:C+ne*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[j.toFixed(2)," m"]})]})})():null,i.boundaryPoints.map((k,j)=>j>0&&j===i.boundaryPoints.length-1&&k.x===i.boundaryPoints[0]?.x&&k.y===i.boundaryPoints[0]?.y?null:(0,H.jsx)("circle",{className:`fence-boundary__point${!i.boundaryClosed&&j===0&&i.boundaryPoints.length>=3?" is-close-target":""}`,cx:k.x,cy:k.y,r:"0.13",onPointerDown:O=>E(O,j)},`fence-point-${j}`))]}),(0,H.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,H.jsx)("button",{type:"button",onClick:()=>f(k=>Math.max(.5,k-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,H.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,H.jsx)("button",{type:"button",onClick:()=>f(k=>Math.min(1,k+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!i.boundaryClosed&&i.boundaryPoints.length>=2?(0,H.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(k=>ic(k.boundaryPoints,!1)?k:{...k,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,H.jsx)("div",{className:"truss-estimator__grid-hint",children:i.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,H.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,H.jsx)("div",{children:i.boundaryMode==="quick"?`${(Number.parseFloat(i.quickLengthM)||0).toFixed(2)} m fence line`:`${pe.totalEdgeM.toFixed(2)} m fence line`}),i.boundaryMode==="draw"&&i.boundaryClosed?(0,H.jsxs)("div",{children:[pe.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,H.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,H.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Sa.heights.map(k=>(0,H.jsx)("button",{type:"button",className:`truss-estimator__visual-card${i.height===k?" is-selected":""}`,onClick:()=>o(j=>({...j,height:k})),children:(0,H.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:Kt(`/fencing/height/${k}.webp`),alt:""})},k))}),(0,H.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,H.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,H.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.gravelBoard===k.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gravelBoard:k.id})),children:[(0,H.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Kt(k.img),alt:""}),(0,H.jsx)("span",{children:k.label})]},k.id))})]}):null,u==="gate"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,H.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,H.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,H.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${i.gateType===k.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gateType:k.id,gateWidthM:k.id==="none"?"":String(Sa.gate[k.id].widthDefault)})),children:[(0,H.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Kt(k.img),alt:""}),(0,H.jsx)("span",{children:k.label})]},k.id))}),i.gateType&&i.gateType!=="none"?(0,H.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,H.jsx)("span",{children:"Gate width (m)"}),(0,H.jsx)("input",{type:"text",inputMode:"decimal",value:i.gateWidthM,onChange:k=>o(j=>({...j,gateWidthM:k.target.value}))})]}):null]}):null,u==="posts"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,H.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,H.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.mounting).map(([k,j])=>(0,H.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.mountingType===k?" is-selected":""}`,onClick:()=>o(O=>({...O,mountingType:k})),children:[(0,H.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,H.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},k))})]}):null]}),(0,H.jsxs)("div",{className:"truss-estimator__nav",children:[(0,H.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ue,children:"Back"}),(0,H.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:ve,disabled:!ye(),children:[(0,H.jsx)("span",{children:re}),(0,H.jsx)("span",{className:"arrow",children:(0,H.jsx)(Ot,{})})]})]})]})]})})}var nc=Y(Xe()),be=Y(te()),hw={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack"},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll"}};function qd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,nc.useState)("floor"),[i,o]=(0,nc.useState)(""),[l,c]=(0,nc.useState)(""),p=Number.parseFloat(i)*Number.parseFloat(l)||0,f=hw[r],b=Math.ceil(p/f.coverage),d=[{key:`insulation-${r}`,label:`${f.product} ${f.thickness}`,qty:b,unit:f.salesUnit,query:f.product,category:"insulation"}],h=Object.entries(hw);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:h.map(([w,M])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>n(w),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:M.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[M.product,", ",M.thickness]})]},w))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:w=>o(w.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:f.product}),(0,be.jsxs)("strong",{children:[b," packs"]})]})]}),(0,be.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,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(d),disabled:p<=0,children:a})]})]})]})})}var Hn=Y(Xe()),Z=Y(te()),D_=10,B_=1.9*.762,O_=1.9*1.524,oc=()=>({height:"",width:""}),lc=e=>Number.parseFloat(e)||0,bw=({height:e,width:t})=>lc(e)*lc(t);function Ed({onBack:e}){let[t,a]=(0,Hn.useState)([oc()]),[r,n]=(0,Hn.useState)([oc()]),[i,o]=(0,Hn.useState)("0"),[l,c]=(0,Hn.useState)("0"),[p,f]=(0,Hn.useState)(1),b=t.reduce((m,u)=>m+bw(u),0),d=r.reduce((m,u)=>m+bw(u),0),h=lc(i)*B_+lc(l)*O_,w=Math.max(0,b-d-h),M=w*p/D_,D=(m,u,g,v)=>{m(N=>N.map((A,T)=>T===u?{...A,[g]:v}:A))};return(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)("div",{className:"truss-estimator",children:[(0,Z.jsxs)("div",{className:"quick-order-hero",children:[(0,Z.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Z.jsx)("h1",{children:"Paint Calculator"}),(0,Z.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,Z.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,Z.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,Z.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,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),t.map((m,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:m.height,onChange:g=>D(a,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:m.width,onChange:g=>D(a,u,"width",g.target.value)})]}),t.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(g=>g.filter((v,N)=>N!==u)),children:"Remove"}):null]},`wall-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(m=>[...m,oc()]),children:"+ Add another wall"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),r.map((m,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:m.height,onChange:g=>D(n,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:m.width,onChange:g=>D(n,u,"width",g.target.value)})]}),r.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(g=>g.filter((v,N)=>N!==u)),children:"Remove"}):null]},`excluded-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(m=>[...m,oc()]),children:"+ Add another area"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,Z.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,Z.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:i,onChange:m=>o(m.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Double doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:m=>c(m.target.value)})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,Z.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,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Number of coats"}),(0,Z.jsxs)("select",{value:p,onChange:m=>f(Number(m.target.value)),children:[(0,Z.jsx)("option",{value:"1",children:"1 coat"}),(0,Z.jsx)("option",{value:"2",children:"2 coats"}),(0,Z.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__totals",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,Z.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paintable area"}),(0,Z.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Coverage"}),(0,Z.jsxs)("strong",{children:[p," ",p===1?"coat":"coats"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paint required"}),(0,Z.jsxs)("strong",{children:[M.toFixed(1)," litres"]})]})]}),(0,Z.jsx)("p",{className:"paint-calculator__note",children:"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,Z.jsxs)("div",{className:"paint-calculator__actions",children:[(0,Z.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,Z.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var gr=Y(Xe()),ae=Y(te()),sc=e=>Number.parseFloat(e)||0,Md={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 Td({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,gr.useState)("paving"),[i,o]=(0,gr.useState)("council"),[l,c]=(0,gr.useState)(""),[p,f]=(0,gr.useState)(""),[b,d]=(0,gr.useState)("100"),[h,w]=(0,gr.useState)("50"),[M,D]=(0,gr.useState)(!0),[m,u]=(0,gr.useState)(!0),g=sc(l)*sc(p),v=g,N=g*(sc(b)/1e3),A=g*.04,T=g*(sc(h)/1e3),z=Math.ceil(v/.36),Q=Math.ceil(v/.1),K=Math.ceil(N*1700/800),fe=Math.ceil(A*1600/800),Te=Math.ceil(T*1600/800),Ye=r==="paving"?{qty:z,unit:"each"}:r==="block"?{qty:v,unit:"m2"}:{qty:Te,unit:"bag"},Ve={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],it=[{key:`surface-${i}`,label:Md[r].find(G=>G.id===i)?.label??"Surface material",qty:Ye.qty,unit:Ye.unit,query:Ve,category:"landscaping"},...M?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:K,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...m?[{key:"bedding",label:"Sharp sand bedding",qty:fe,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];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:"Paving & Driveway Calculator"}),(0,ae.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,ae.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,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,ae.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(([G,ce,xe])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===G?" is-selected":""}`,onClick:()=>{n(G),o(Md[G][0].id)},children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:ce}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:xe})]},G))}),(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ae.jsx)("span",{children:"Finish"}),(0,ae.jsx)("select",{value:i,onChange:G=>o(G.target.value),children:Md[r].map(G=>(0,ae.jsx)("option",{value:G.id,children:G.label},G.id))})]})]}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,ae.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsx)("span",{children:"Length (m)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:G=>c(G.target.value)})]}),(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsx)("span",{children:"Width (m)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:G=>f(G.target.value)})]})]}),r==="gravel"&&(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ae.jsx)("span",{children:"Gravel depth (mm)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:G=>w(G.target.value)})]}),M&&(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ae.jsx)("span",{children:"Sub-base depth (mm)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:G=>d(G.target.value)})]}),(0,ae.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ae.jsx)("input",{type:"checkbox",checked:M,onChange:G=>D(G.target.checked)}),(0,ae.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,ae.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ae.jsx)("input",{type:"checkbox",checked:m,onChange:G=>u(G.target.checked)}),(0,ae.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,ae.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Surface area"}),(0,ae.jsxs)("strong",{children:[g.toFixed(2)," m\xB2"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,ae.jsx)("strong",{children:r==="paving"?`${z} slabs`:r==="block"?`${v.toFixed(2)} m\xB2`:`${Te} bulk bags`})]}),M&&(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"MOT Type 1"}),(0,ae.jsxs)("strong",{children:[K," bulk bags"]})]}),m&&(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Sharp sand"}),(0,ae.jsxs)("strong",{children:[fe," bulk bags"]})]})]}),(0,ae.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,ae.jsxs)("div",{className:"materials-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?.(it),disabled:g<=0,children:a})]})]})]})})}var il=Y(Xe()),ie=Y(te()),L_=2.88,vw=[{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:""}),zd=e=>Number.parseFloat(e)||0;function Ad({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,il.useState)([ww()]),[i,o]=(0,il.useState)(""),[l,c]=(0,il.useState)("standard"),[p,f]=(0,il.useState)("screws"),b=r.reduce((A,T)=>A+zd(T.length)*zd(T.height),0),d=Math.max(0,b-zd(i)),h=Math.ceil(d/L_),w=Math.ceil(d*12),M=Math.ceil(w/1e3),D=Math.ceil(d*1.2),m=Math.ceil(D/90),u=Math.ceil(d/3.5),g=vw.find(A=>A.id===l)?.label??"Standard",v=[{key:"board",label:`${g} plasterboard`,qty:h,unit:"sheet",query:`${g} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:M,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:m,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],N=(A,T,z)=>{n(Q=>Q.map((K,fe)=>fe===A?{...K,[T]:z}:K))};return(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)("div",{className:"truss-estimator",children:[(0,ie.jsxs)("div",{className:"quick-order-hero",children:[(0,ie.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ie.jsx)("h1",{children:"Plasterboard & Drylining Calculator"}),(0,ie.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,ie.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ie.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,ie.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,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,ie.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:vw.map(A=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===A.id?" is-selected":""}`,onClick:()=>c(A.id),children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:A.label}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:A.blurb})]},A.id))})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,ie.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(([A,T,z])=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===A?" is-selected":""}`,onClick:()=>f(A),children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:T}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:z})]},A))})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,ie.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,ie.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,ie.jsx)("span",{children:"Surface"}),(0,ie.jsx)("span",{children:"Length (m)"}),(0,ie.jsx)("span",{children:"Height (m)"}),(0,ie.jsx)("span",{})]}),r.map((A,T)=>(0,ie.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,ie.jsxs)("span",{children:["Surface ",T+1]}),(0,ie.jsx)("input",{"aria-label":`Surface ${T+1} length`,type:"number",min:"0",step:"0.01",value:A.length,onChange:z=>N(T,"length",z.target.value)}),(0,ie.jsx)("input",{"aria-label":`Surface ${T+1} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:z=>N(T,"height",z.target.value)}),r.length>1?(0,ie.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(z=>z.filter((Q,K)=>K!==T)),children:"Remove"}):null]},`surface-${T}`)),(0,ie.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(A=>[...A,ww()]),children:"+ Add another surface"}),(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,ie.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,ie.jsx)("small",{children:"optional"})]}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:A=>o(A.target.value)})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ie.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Board area"}),(0,ie.jsxs)("strong",{children:[d.toFixed(2)," m\xB2"]})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,ie.jsx)("strong",{children:h})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,ie.jsx)("strong",{children:p==="screws"?`${w} (${M} boxes)`:`${u} bags`})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Joint tape"}),(0,ie.jsxs)("strong",{children:[D," m (",m," rolls)"]})]})]}),(0,ie.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,ie.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ie.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ie.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(v),disabled:d<=0,children:a})]})]})]})})}var nl=Y(Xe());var y=Y(te()),Mt={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}}}},cc=["range","pitchAndDimensions","quantityAndGirders","bracing"],H_={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function j_({degrees:e}){let a=e*Math.PI/180,n=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,${n}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function Q_({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",n="#d3d8de",i="#7c8494",o=(f,b,d,h,w=8,M)=>{let D=d-f,m=h-b,u=Math.hypot(D,m)||1,g=-m/u,v=D/u,N=w*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:f,y1:b,x2:d,y2:h,stroke:a,strokeWidth:w+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f,y1:b,x2:d,y2:h,stroke:t,strokeWidth:w,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f-g*N,y1:b-v*N,x2:d-g*N,y2:h-v*N,stroke:r,strokeWidth:Math.max(1.5,w*.24),strokeLinecap:"round",opacity:"0.9"})]},M)},l=(f,b,d)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:f-7.5,y:b-5.5,width:"15",height:"11",rx:"2",fill:n,stroke:i,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:f-4,cy:b-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:b-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f-4,cy:b+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:b+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f,cy:b,r:"1",fill:i})]},d),c=(f,b)=>(0,y.jsx)("rect",{x:f-9,y:"110",width:"18",height:"10",fill:a},b),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 G_({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 yw({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 Rd({onBack:e}){let[t,a]=(0,nl.useState)(0),[r,n]=(0,nl.useState)(H_),[i,o]=(0,nl.useState)(!1),[l,c]=(0,nl.useState)(!1),p=()=>{let m=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return m<=0||!u?0:Math.ceil(m*1e3/u)+1},b=(()=>{let m=r.range?Mt.ranges[r.range]:Mt.ranges.standard,u=r.pitch??"22.5",g=Mt.pitchMultipliers[u],v=(Number.parseFloat(r.spanMM)||0)/1e3,A=(Number.parseFloat(r.overhangMM)||0)>Mt.overhang.thresholdMM,T=p(),z=T+r.girderCount,Q=Number.parseFloat(r.roofLengthM)||0,K=r.treatment?Mt.treatment[r.treatment]:Mt.treatment.untreated,fe=Mt.estimate.ranges[r.range??"standard"],Te=fe.supplyAt8m*Math.max(.7,v/8)*g*(1+K.surchargePct)+(A?Mt.overhang.surchargePerTruss:0),Ye=T*Te,Ve=r.girderCount*Te*Mt.estimate.girderMultiplier,it=r.bracing==="yes"?Q*Mt.estimate.bracingPerMetre:0,pe=Ye+Ve+it+Mt.estimate.delivery,G=Mt.estimate.design+T*fe.installPerTruss+r.girderCount*40,ce=pe+G,xe=ce*.2;return{range:m,count:T,girderCount:r.girderCount,overhangApplies:A,overhangUnits:z,roofLengthM:Q,treatment:K,trussSupply:Ye,bracingMaterials:it,delivery:Mt.estimate.delivery,labour:G,subtotal:ce,vat:xe,total:ce+xe}})(),d=()=>{let m=cc[t];return m==="range"?!!r.range:m==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":m==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:m==="bracing"?!!r.bracing&&!!r.treatment:!0},h=t===cc.length-1?"View truss request":"Next",w=()=>{i?o(!1):t===0?e():a(m=>m-1)},M=()=>{d()&&(t===cc.length-1?(c(!1),o(!0)):a(m=>m+1))},D=()=>{let m=cc[t];return m==="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(Mt.ranges).map(([u,g])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>n(v=>({...v,range:u})),children:[(0,y.jsx)(Q_,{type:u}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:g.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:g.blurb})]})]},u))})]}):m==="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=>n(g=>({...g,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=>n(g=>({...g,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",Mt.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:Mt.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>n(g=>({...g,pitch:u})),children:[(0,y.jsx)(j_,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):m==="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=>n(g=>({...g,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:Mt.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:()=>n(g=>({...g,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:()=>n(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:()=>n(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):m==="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:()=>n(g=>({...g,bracing:u.id})),children:[(0,y.jsx)(G_,{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:()=>n(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(yw,{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:()=>n(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(yw,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return i?(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:[b.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[b.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:b.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:b.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(b.trussSupply)})]}),b.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:nt(b.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:nt(b.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:nt(b.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:nt(b.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:nt(b.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:nt(b.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:w,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:D()}),(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:w,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:M,disabled:!d(),children:[(0,y.jsx)("span",{children:h}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Ot,{})})]})]})]})]})})}var qi=Y(Xe()),F=Y(te()),kw=e=>Number.parseFloat(e)||0,uc=(e,t)=>kw(e)*(t==="m"?1:.3048),_w=()=>({length:"",width:""}),xw=[{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 Y_({profile:e}){return(0,F.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,F.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,F.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function Ud({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,qi.useState)("total"),[i,o]=(0,qi.useState)("m"),[l,c]=(0,qi.useState)(""),[p,f]=(0,qi.useState)([_w()]),[b,d]=(0,qi.useState)(""),[h,w]=(0,qi.useState)("chamfered"),M="4.2",D=r==="total"?uc(l,i):p.reduce((N,A)=>N+2*(uc(A.length,i)+uc(A.width,i)),0),m=Math.max(0,D-uc(b,i)),u=Math.ceil(m/kw(M)),g=[{key:`skirting-${h}`,label:`${xw.find(N=>N.id===h)?.label} skirting board`,qty:m,unit:"m",query:"skirting board",category:"skirting"}],v=(N,A,T)=>{f(z=>z.map((Q,K)=>K===N?{...Q,[A]:T}:Q))};return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)("div",{className:"truss-estimator",children:[(0,F.jsxs)("div",{className:"quick-order-hero",children:[(0,F.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,F.jsx)("h1",{children:"Skirting Board Calculator"}),(0,F.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,F.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,F.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,F.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>n("total"),children:"Total length"}),(0,F.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>n("rooms"),children:"Room by room"})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,F.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,F.jsx)("span",{children:"Units"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,F.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,F.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Total skirting length (",i,")"]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:N=>c(N.target.value)})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,F.jsx)("span",{children:"Room"}),(0,F.jsxs)("span",{children:["Length (",i,")"]}),(0,F.jsxs)("span",{children:["Width (",i,")"]}),(0,F.jsx)("span",{})]}),p.map((N,A)=>(0,F.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,F.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",A+1]}),(0,F.jsx)("input",{"aria-label":`Room ${A+1} length in ${i}`,type:"number",min:"0",step:"0.01",value:N.length,onChange:T=>v(A,"length",T.target.value)}),(0,F.jsx)("input",{"aria-label":`Room ${A+1} width in ${i}`,type:"number",min:"0",step:"0.01",value:N.width,onChange:T=>v(A,"width",T.target.value)}),p.length>1?(0,F.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>f(T=>T.filter((z,Q)=>Q!==A)),children:"Remove"}):null]},`room-${A}`)),(0,F.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(N=>[...N,_w()]),children:"+ Add another room"})]}),(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Openings and doorways to deduct (",i,") ",(0,F.jsx)("small",{children:"optional"})]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:b,onChange:N=>d(N.target.value)})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,F.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.2m white-primed MDF boards."}),(0,F.jsx)("div",{className:"architrave-calculator__profiles",children:xw.map(N=>(0,F.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===N.id?" is-selected":""}`,onClick:()=>w(N.id),children:[(0,F.jsx)(Y_,{profile:N.id}),(0,F.jsx)("div",{className:"truss-estimator__option-title",children:N.label}),(0,F.jsx)("div",{className:"truss-estimator__option-copy",children:N.blurb})]},N.id))})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,F.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,F.jsxs)("label",{className:"truss-estimator__field",children:[(0,F.jsx)("span",{children:"Board length"}),(0,F.jsx)("input",{value:"4.20 m",disabled:!0})]})}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,F.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Net skirting"}),(0,F.jsxs)("strong",{children:[m.toFixed(2)," m"]})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Board lengths"}),(0,F.jsx)("strong",{children:u})]})]}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,F.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,F.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:m<=0,children:a})]})]})]})})}var jn=Y(Xe()),oe=Y(te()),ol=e=>Number.parseFloat(e)||0;function Dd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,jn.useState)("studs"),[i,o]=(0,jn.useState)(""),[l,c]=(0,jn.useState)(""),[p,f]=(0,jn.useState)("600"),[b,d]=(0,jn.useState)("2.4"),h=i&&l&&p?Math.ceil(ol(l)/(ol(p)/1e3))+1:0,w=h*ol(i),M=ol(b)>0?Math.ceil(w/ol(b)):0,D=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:w,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],m={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"]},g={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,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)("div",{className:"truss-estimator",children:[(0,oe.jsxs)("div",{className:"quick-order-hero",children:[(0,oe.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,oe.jsx)("h1",{children:"Timber Calculator"}),(0,oe.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,oe.jsxs)("p",{className:"truss-estimator__step-sub",children:[g.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(m).map(v=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>n(v),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:m[v][0]}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:m[v][1]})]},v))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[g.member," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:v=>o(v.target.value)})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[g.overall," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Centres (mm)"}),(0,oe.jsxs)("select",{value:p,onChange:v=>f(v.target.value),children:[(0,oe.jsx)("option",{value:"300",children:"300 mm"}),(0,oe.jsx)("option",{value:"400",children:"400 mm"}),(0,oe.jsx)("option",{value:"450",children:"450 mm"}),(0,oe.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Stock length (m)"}),(0,oe.jsxs)("select",{value:b,onChange:v=>d(v.target.value),children:[(0,oe.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,oe.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,oe.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,oe.jsxs)("div",{className:"materials-calculator__totals",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,oe.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:g.count}),(0,oe.jsx)("strong",{children:h})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Linear metres"}),(0,oe.jsxs)("strong",{children:[w.toFixed(2)," m"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsxs)("span",{children:[b," m lengths"]}),(0,oe.jsx)("strong",{children:M})]})]}),(0,oe.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,oe.jsxs)("div",{className:"materials-calculator__actions",children:[(0,oe.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,oe.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(D),disabled:w<=0,children:a})]})]})]})})}var Bd=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Rd},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:Cd},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Sd},{id:"brick-block",title:"Brick & Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:yd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:Ed},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:Ud},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:wd},{id:"concrete-aggregate",title:"Concrete & Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:kd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Ad},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:qd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:Dd},{id:"paving",title:"Paving & Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Td}];var dc=Y(Xe());var Le=Y(Xe());var S=Y(te()),V_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],Od={wasteFactorEnabled:!0},X_=3e3,Nw=null;function pc(e,t){let a=Fo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function $_(e){return e&&e.length>0?e.join(" x "):"-"}function Ld({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:n}){let i=Ps(),o=`${e}~${t.map(C=>`${C.key}|${C.query}|${C.category??""}|${C.qty}`).join("~")}`,l=o!==Nw,[c,p]=(0,Le.useState)(null),[f,b]=(0,Le.useState)([]),[d,h]=(0,Le.useState)(l),[w,M]=(0,Le.useState)(null),[D,m]=(0,Le.useState)("tile"),[u,g]=(0,Le.useState)(null),[v,N]=(0,Le.useState)(""),[A,T]=(0,Le.useState)(null),[z,Q]=(0,Le.useState)(""),[K,fe]=(0,Le.useState)([]),[Te,Ye]=(0,Le.useState)(new Set),[Ve,it]=(0,Le.useState)(null),[pe,G]=(0,Le.useState)(""),[ce,xe]=(0,Le.useState)([]),ye=(0,Le.useRef)(null),re=(0,Le.useRef)(!1),se=C=>`${e}:${C}`,Me=C=>Kr(C.chosen,{lineId:se(C.requirement.key),description:C.requirement.label,unit:C.requirement.unit,qty:C.requirement.qty}),_e=(0,Le.useMemo)(()=>t.map(C=>`${C.key}|${C.query}|${C.category??""}`).join("~"),[t]);(0,Le.useEffect)(()=>{let C=!1;return pw().then(V=>{C||p(V.itemCount>0)}).catch(()=>{C||p(!1)}),()=>{C=!0}},[]),(0,Le.useEffect)(()=>{if(!a||!c)return;let C=!1,V;l&&h(!0),M(null);let X=Date.now();return(async()=>{let me=null;try{me=(await uw(t)).map(({requirement:dt,candidates:je})=>({requirement:dt,candidates:je,chosen:je[0]??null}))}catch(Ce){C||M(Ce instanceof Error?Ce.message:"Could not load products")}if(!C){if(Nw=o,l){let Ce=X_-(Date.now()-X);Ce>0&&await new Promise(dt=>{V=window.setTimeout(dt,Ce)})}C||(me&&(b(me),!re.current&&i&&(re.current=!0,i.addManyToCart(me.filter(Ce=>Ce.chosen).map(Me)))),h(!1))}})(),()=>{C=!0,window.clearTimeout(V)}},[a,c,_e]),(0,Le.useEffect)(()=>{if(!A)return;let C=z.trim();if(!C){fe([]);return}let V=!1,X=window.setTimeout(()=>{Pr(C).then(me=>{V||fe(me)}).catch(()=>{V||fe([])})},250);return()=>{V=!0,window.clearTimeout(X)}},[A,z]),(0,Le.useEffect)(()=>{if(!Ve)return;let C=pe.trim();if(!C){xe([]);return}let V=!1,X=window.setTimeout(()=>{Pr(C).then(me=>{V||xe(me)}).catch(()=>{V||xe([])})},250);return()=>{V=!0,window.clearTimeout(X)}},[Ve,pe]);let et=(0,Le.useMemo)(()=>{let C=v.trim().toLowerCase(),V=C?f.filter(X=>X.requirement.label.toLowerCase().includes(C)||(X.chosen?.description??"").toLowerCase().includes(C)||(X.chosen?.product_id??"").toLowerCase().includes(C)):f;return u?[...V].sort((X,me)=>{let Ce=X.requirement.label.localeCompare(me.requirement.label);return u==="asc"?Ce:-Ce}):V},[f,v,u]),Ht=et.filter(C=>C.chosen),Tt=et.filter(C=>!C.chosen),tt=f.filter(C=>C.chosen),ct=tt.filter(C=>C.chosen?.price==null).length,He=tt.reduce((C,V)=>C+(Aa(Me(V),Od).lineTotal??0),0);if((0,Le.useEffect)(()=>{n?.(He)},[He,n]),!a||c===!1)return null;let E=i?tt.filter(C=>i.cart[se(C.requirement.key)]).length:0,x=Ve?f.find(C=>C.requirement.key===Ve)??null:null,I=pe.trim()?ce:x?.candidates??[],ue=C=>{let V=A===C.requirement.key;T(V?null:C.requirement.key),Q(V?"":C.requirement.query)},ve=(C,V)=>{let X=f.find(me=>me.requirement.key===C);b(me=>me.map(Ce=>Ce.requirement.key===C?{...Ce,chosen:V}:Ce)),i&&X&&i.cart[se(C)]&&i.addToCart(Me({...X,chosen:V})),T(null),Q("")},Se=C=>{b(V=>V.map(X=>X.requirement.key===C?{...X,chosen:null}:X)),i?.cart[se(C)]&&i.removeFromCart(se(C))},k=C=>{it(C.requirement.key),G(""),xe([])},j=()=>{it(null),G(""),xe([])},O=C=>{if(!i)return;let V=se(C.requirement.key);i.cart[V]?i.removeFromCart(V):i.addToCart(Me(C))},ne=C=>{Ye(V=>{let X=new Set(V);return X.has(C)?X.delete(C):X.add(C),X})},W=C=>{let V=K.length>0?K:C.candidates;return(0,S.jsxs)("div",{className:"estimator-products__picker",children:[(0,S.jsx)("input",{type:"text",className:"results-search-input",value:z,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:X=>Q(X.target.value),"aria-label":`Search a product for ${C.requirement.label}`}),(0,S.jsxs)("div",{className:"estimator-products__options",children:[V.map(X=>(0,S.jsxs)("button",{type:"button",className:`estimator-products__option${X.product_id===C.chosen?.product_id?" is-selected":""}`,onClick:()=>ve(C.requirement.key,X),children:[(0,S.jsx)("span",{children:X.description}),(0,S.jsxs)("span",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${nt(X.price)}`]})]},X.product_id)),V.length===0&&(0,S.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,S.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!d&&(0,S.jsxs)("div",{className:"estimator-products__head",children:[(0,S.jsxs)("div",{className:"results-tile-section__head",children:[(0,S.jsx)("h3",{children:"Matched Products"}),(0,S.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!x&&(0,S.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[ct>0&&(0,S.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,S.jsx)("strong",{children:ct})," need pricing"]}),(0,S.jsxs)("div",{className:"estimator-products__controls",children:[(0,S.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:v,onChange:C=>N(C.target.value),"aria-label":"Search matched products"}),(0,S.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,S.jsx)("button",{type:"button",className:`results-view-toggle__btn${D==="tile"?" is-active":""}`,"aria-pressed":D==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>m("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${D==="list"?" is-active":""}`,"aria-pressed":D==="list","aria-label":"List view",title:"List view",onClick:()=>m("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"})]})})]}),(0,S.jsxs)("details",{ref:ye,style:{position:"relative"},children:[(0,S.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,S.jsx)("div",{className:"sort-menu-panel",children:V_.map(C=>{let V=u===C.dir;return(0,S.jsxs)("button",{type:"button",className:`sort-menu-item${V?" is-active":""}`,onClick:()=>{g(V?null:C.dir),ye.current?.removeAttribute("open")},children:[(0,S.jsx)("span",{className:"sort-menu-item__check",children:V?"\u2713":""}),C.label]},C.dir)})})]})]})]})]}),x&&(0,S.jsxs)("div",{className:"results-review-page",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:j,children:[(0,S.jsx)(Zr,{}),"Back to results"]}),(0,S.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(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:pe,onChange:C=>G(C.target.value),"aria-label":`Search a product for ${x.requirement.label}`})}),x.chosen&&(0,S.jsx)("div",{className:"results-candidate-actions",children:(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Se(x.requirement.key),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)("img",{className:"fill-img results-review-page__image",src:Ga(x.chosen?.description||x.requirement.label,x.chosen?.product_id,x.chosen?.pdp_photo_url),alt:""})}),(0,S.jsxs)("div",{className:"results-review-page__summary",children:[(0,S.jsx)("h2",{children:x.requirement.label}),(0,S.jsxs)("p",{className:"results-review-page__meta",children:[_i(x.requirement.qty)," ",xa(x.requirement.unit,x.requirement.qty)]}),x.chosen?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"results-review-page__product",children:x.chosen.description}),(0,S.jsxs)("div",{className:"results-row-meta",children:[x.chosen.product_id,x.chosen.price!=null?` \xB7 ${pc(x.chosen.price,x.chosen.price_basis)}`:""]})]}):(0,S.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,S.jsx)("div",{className:"results-review-page__actions",children:(0,S.jsx)("button",{type:"button",className:`bom-toolbar-btn${i?.cart[se(x.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>O(x),disabled:!x.chosen||!i,children:i?.cart[se(x.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),I.length===0?(0,S.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(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"}),(0,S.jsx)("th",{"aria-label":"Actions"})]})}),(0,S.jsx)("tbody",{children:I.map(C=>{let V=C.product_id===x.chosen?.product_id;return(0,S.jsxs)("tr",{className:V?"score-breakdown-row--best":"",children:[(0,S.jsxs)("td",{children:[(0,S.jsx)("div",{children:C.description}),(0,S.jsx)("div",{className:"results-row-meta",children:C.product_id})]}),(0,S.jsx)("td",{children:(0,S.jsx)("span",{className:"unit-badge",children:$_(C.measurements_mm)})}),(0,S.jsx)("td",{children:C.price!=null?pc(C.price,C.price_basis):"-"}),(0,S.jsx)("td",{children:(0,S.jsxs)("label",{className:"switch-toggle",title:V?"Currently selected":"Use this candidate",children:[(0,S.jsx)("input",{type:"checkbox",checked:V,onChange:()=>{V?Se(x.requirement.key):ve(x.requirement.key,C)},"aria-label":V?`${C.description} selected`:`Use ${C.description}`}),(0,S.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},C.product_id)})})]})]}),!x&&d&&(0,S.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,S.jsx)(dr,{}),(0,S.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!x&&w&&(0,S.jsx)("p",{className:"results-empty-hint estimator-products__error",children:w}),!x&&!d&&!w&&et.length===0&&f.length>0&&(0,S.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!x&&!d&&!w&&D==="tile"&&Ht.length>0&&(0,S.jsx)("div",{className:"results-tile-grid",children:Ht.map(C=>{let{requirement:V,chosen:X}=C,me=X?Aa(Me(C),Od):null,Ce=i?!!i.cart[se(V.key)]:!1;return(0,S.jsxs)("article",{className:"results-tile-card",children:[(0,S.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>k(C),"aria-label":`Review match for ${V.label}`,children:[(0,S.jsx)("div",{className:"results-tile-card__media",children:(0,S.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(X?.description||V.label,X?.product_id,X?.pdp_photo_url),alt:""})}),(0,S.jsxs)("div",{className:"results-tile-card__body",children:[X?(0,S.jsxs)("div",{className:"results-tile-card__heading",children:[(0,S.jsx)("div",{className:"results-tile-card__title",children:X.description}),(0,S.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,S.jsx)("span",{children:X.product_id}),X.price!=null?(0,S.jsx)("span",{children:pc(X.price,X.price_basis)}):null]})]}):(0,S.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,S.jsxs)("div",{className:"results-tile-card__match",children:[(0,S.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,S.jsx)("div",{className:"results-tile-card__match-name",children:V.label}),(0,S.jsxs)("div",{className:"results-tile-card__meta",children:[_i(V.qty)," ",xa(V.unit,V.qty)]}),me?.requiredSellUnits!=null?(0,S.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",me.requiredSellUnits," ",me.sellUnit,me.lineTotal!=null?` \xB7 ${nt(me.lineTotal)}`:""]}):X?(0,S.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,S.jsxs)("div",{className:"results-tile-card__actions",children:[(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>k(C),children:"Review"}),(0,S.jsx)("button",{type:"button",className:`bom-toolbar-btn${Ce?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>O(C),disabled:!X||!i,children:Ce?"\u2713 Added":"+ Add"})]})]},V.key)})}),!x&&!d&&!w&&D==="list"&&Ht.length>0&&(0,S.jsx)("div",{className:"bom-table-wrap",children:(0,S.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,S.jsxs)("colgroup",{children:[(0,S.jsx)("col",{style:{width:"56px"}}),(0,S.jsx)("col",{className:"col-item"}),(0,S.jsx)("col",{style:{width:"90px"}}),(0,S.jsx)("col",{style:{width:"80px"}}),(0,S.jsx)("col",{style:{width:"220px"}}),(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",{"aria-label":"Expand"}),(0,S.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,S.jsx)("tbody",{children:Ht.map(C=>{let{requirement:V,chosen:X}=C,me=X?Aa(Me(C),Od):null,Ce=i?!!i.cart[se(V.key)]:!1,dt=Te.has(V.key);return(0,S.jsxs)(Le.Fragment,{children:[(0,S.jsxs)("tr",{className:"bom-row",children:[(0,S.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,S.jsx)("button",{type:"button",className:"link-btn",onClick:()=>ne(V.key),"aria-expanded":dt,"aria-label":dt?"Collapse product options":"Expand product options",children:dt?"\u25BE":"\u25B8"})}),(0,S.jsxs)("td",{style:{paddingLeft:0},children:[(0,S.jsx)("div",{className:"bom-component-name",children:V.label}),me?.requiredSellUnits!=null&&(0,S.jsxs)("div",{className:"results-row-meta",children:["Order ",me.requiredSellUnits," ",me.sellUnit,me.lineTotal!=null?` \xB7 ${nt(me.lineTotal)}`:""]})]}),(0,S.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:_i(V.qty)}),(0,S.jsx)("td",{style:{textAlign:"center"},children:xa(V.unit,V.qty)}),(0,S.jsx)("td",{style:{textAlign:"center"},children:X?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"bom-component-name",children:X.description}),(0,S.jsxs)("div",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${pc(X.price,X.price_basis)}`]})]}):(0,S.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,S.jsx)("td",{style:{textAlign:"center"},children:(0,S.jsx)("button",{type:"button",className:`bom-toolbar-btn${Ce?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>O(C),disabled:!X||!i,children:Ce?"\u2713 Added":"+ Add"})})]}),dt&&(0,S.jsx)("tr",{children:(0,S.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:A===V.key?W(C):(0,S.jsxs)("div",{className:"estimator-products__picker",children:[(0,S.jsxs)("div",{className:"estimator-products__options",children:[C.candidates.map(je=>(0,S.jsxs)("button",{type:"button",className:`estimator-products__option${je.product_id===X?.product_id?" is-selected":""}`,onClick:()=>ve(V.key,je),children:[(0,S.jsx)("span",{children:je.description}),(0,S.jsxs)("span",{className:"results-row-meta",children:[je.product_id,je.price!=null&&` \xB7 ${nt(je.price)}`]})]},je.product_id)),C.candidates.length===0&&(0,S.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ue(C),children:"Search the catalogue"})]})})})]},V.key)})})]})}),!x&&!d&&!w&&Tt.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:Tt.map(C=>(0,S.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>k(C),children:[(0,S.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,S.jsx)("span",{className:"results-unmatched-card__title",children:C.requirement.label}),(0,S.jsxs)("span",{className:"results-row-meta",children:[_i(C.requirement.qty)," ",xa(C.requirement.unit,C.requirement.qty)]})]}),(0,S.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},C.requirement.key))})]}),!d&&!w&&f.length>0&&(0,S.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},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 procurement, especially any items flagged as medium or low confidence."})]}),!x&&!d&&!w&&(r||E>0)&&(0,S.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,S.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),E>0&&i&&(0,S.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:i.openBasket,children:[(0,S.jsxs)("span",{children:["View Basket (",E,")"]}),(0,S.jsx)("span",{className:"arrow",children:(0,S.jsx)(Ot,{})})]})]})]})}var Lt=Y(te());function Hd({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[n,i]=(0,dc.useState)(0),o=(0,dc.useCallback)(l=>i(l),[]);return(0,Lt.jsx)(Lt.Fragment,{children:(0,Lt.jsxs)("div",{className:"truss-estimator",children:[(0,Lt.jsxs)("div",{className:"quick-order-hero",children:[(0,Lt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Lt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Lt.jsx)("h1",{children:"Your Materials"}),n>0&&(0,Lt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Lt.jsx)("strong",{children:nt(n)})," Est. total"]})]}),(0,Lt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Lt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Lt.jsx)(Ld,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var Z_=(e,t)=>{let a=t.key,r={"brick-block":{"brick-common":"5001444","brick-engineering-red":"5002008","brick-engineering-blue":"5001439",block:"5003187",mortar:"6003088"},skirting:{"skirting-chamfered":"4006057","skirting-ogee":"4006045","skirting-pencil-round":"4006048","skirting-torus":"4006042"},architrave:{"architrave-ogee":"4006060","architrave-ovolo":"4006063","architrave-pencil-round":"4006061","architrave-square-edge":"4006062","architrave-torus":"4006059"},plasterboard:{board:"2001035",screws:"2006040",tape:"2007043",adhesive:"2004023"},insulation:{"insulation-floor":"3002110","insulation-wall":"3002012","insulation-roof":"3004047","insulation-loft":"3003046"},timber:{studs:"4001168",joists:"4001201",battens:"4001053"},fencing:{"panels-boundary-0.9":"4001268","panels-boundary-1.2":"4001269","panels-boundary-1.5":"4001270","panels-boundary-1.8":"4001271","panels-skyline-0.9":"4001264","panels-skyline-1.2":"4001265","panels-skyline-1.5":"4001266","panels-skyline-1.8":"4001267","concrete-intermediate-6":"4001290","concrete-intermediate-8":"4001291","concrete-end-6":"4001294","concrete-end-8":"4001295","timber-post-6":"4001242","timber-post-8":"4001243",postcrete:"6003008",gate:"4001630","gravel-boards":"4001284"},decking:{"boards-meridian":"4001251","boards-summit":"4001360",joists:"4001201",screws:"1001103"},paving:{"surface-council":"7003121","surface-raj":"7003003","surface-brindle":"4001621","surface-charcoal":"4001622","surface-pea":"6001004","sub-base":"6001007",bedding:"6001012"}};return e==="plasterboard"?{standard:"2001035",moisture:"2002039",fire:"2002087",sound:"2002044"}[t.label.split(" ")[0].toLowerCase()]??r[e]?.[a]??null:r[e]?.[a]??null};function Sw(e,t){if(e==="paint"||e==="concrete-aggregate")return null;let a=t.map(r=>{let n=Z_(e,r);return n?{key:r.key,productId:n,qty:r.qty,unit:r.unit}:null});return a.every(Boolean)?a:null}var jd=Y(Xe());var Jt=Y(te()),K_=1500;function Cw(e){let{addManyToCart:t,clearCart:a,openBasket:r}=An(),[n,i]=(0,jd.useState)(!1),[o,l]=(0,jd.useState)(null);return{adding:n,basketError:o,addToBasket:async(p,f)=>{let b=Date.now();i(!0),l(null);try{let d=await Promise.all(p.filter(w=>w.qty>0).map(async w=>{let M=(await Pr(w.productId)).find(D=>D.product_id===w.productId);if(!M)throw new Error("A selected product is no longer available in this catalogue.");return Kr(M,{lineId:`${e}:${w.key}`,description:M.description,unit:w.unit??"each",qty:w.qty,calculatorWasteIncluded:f})})),h=K_-(Date.now()-b);h>0&&await new Promise(w=>window.setTimeout(w,h)),a(),t(d),r()}catch(d){l(d instanceof Error?d.message:"Could not add the products to your basket.")}finally{i(!1)}}}}function qw({toolTitle:e}){return(0,Jt.jsx)(Jt.Fragment,{children:(0,Jt.jsxs)("div",{className:"truss-estimator",children:[(0,Jt.jsxs)("div",{className:"quick-order-hero",children:[(0,Jt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Jt.jsx)("h1",{children:"Your Materials"}),(0,Jt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Jt.jsx)("div",{className:"truss-estimator__card",children:(0,Jt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Jt.jsx)(dr,{}),(0,Jt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Re=Y(te());function mc(e){let[t,a]=(0,Va.useState)(!1);return(0,Re.jsx)(Js,{onOpenBasket:()=>a(!0),children:(0,Re.jsx)(J_,{...e,showBasket:t,onShowBasket:a})})}function J_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:n}){let[i,o]=(0,Va.useState)(null),[l,c]=(0,Va.useState)(null),p=Bd.find(z=>z.id===i),{cart:f,updateCartQty:b,updateCartSellUnits:d,updateCartConversions:h,removeFromCart:w,clearCart:M}=An(),{adding:D,basketError:m,addToBasket:u}=Cw(p?.title??"calculator"),g=(0,Va.useRef)(null),v=Qs("estimating-tools",g);(0,Va.useEffect)(()=>{v("viewed")},[v]);let N=r?"basket":D?"adding":l?"review":i??"list",A=(0,Va.useRef)(N);(0,Va.useEffect)(()=>{A.current!==N&&(A.current=N,window.scrollTo(0,0))},[N]);let T=z=>{if(!p)return;v("estimate_completed",{calculator:p.id,lines:z.length});let Q=Sw(p.id,z);Q?u(Q,z[0]?.calculatorWasteIncluded??!1):c(z)};return(0,Re.jsx)(Zo.Provider,{value:v,children:(0,Re.jsx)("div",{ref:g,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}`,style:pr().theme,children:(0,Re.jsx)("main",{className:"main-content",children:r?(0,Re.jsx)(rl,{cart:f,onUpdateQty:b,onUpdateSellUnits:d,onResolveConversions:h,onRemove:w,onBack:()=>n(!1),onStartNewQuote:()=>{M(),o(null),c(null),n(!1)},internal:a}):D&&p?(0,Re.jsx)(qw,{toolTitle:p.title}):p?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)("div",{hidden:l!==null,children:(0,Re.jsx)(p.Component,{onBack:()=>o(null),onReview:T})}),m&&(0,Re.jsx)("p",{className:"results-empty-hint estimator-products__error",children:m}),l!==null&&(0,Re.jsx)(Hd,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Re.jsx)(Re.Fragment,{children:(0,Re.jsxs)("div",{className:"quick-order-card",children:[(0,Re.jsxs)("div",{className:"quick-order-hero",children:[(0,Re.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Re.jsx)("h1",{children:"Estimating Tools"}),(0,Re.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Re.jsxs)("div",{className:"quick-order-alt",children:[(0,Re.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Re.jsx)("div",{className:"estimator-tools-grid",children:Bd.map(z=>(0,Re.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{v("calculator_selected",{calculator:z.id}),o(z.id),c(null)},children:[(0,Re.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Re.jsx)("img",{className:"fill-img estimator-tool-card__image",src:Kt(z.imageUrl),alt:""})}),(0,Re.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Re.jsx)("span",{className:"estimator-tool-card__title",children:z.title}),(0,Re.jsx)("span",{className:"estimator-tool-card__desc",children:z.desc})]})]},z.id))})]})]})})})})})}var fc=Y(te());function Qd({config:e,children:t}){return $b(e),(0,fc.jsx)(fc.Fragment,{children:t})}var Gd=Y(te()),P_="https://api.metronlabs.ai",F_=["client","api-key","api-url","theme","hide-header","analytics"],I_=["all","events-only","none"];function Mw(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.23",!this.root){let n=document.createElement("div"),i=document.createElement("style");i.textContent=`:host { display: block; }
|
|
6780
|
+
`)}function Kr(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}}var Jv=e=>(e??"").trim().toLowerCase(),$1={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",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Z1=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),Xv=new Set(["box","bag","pack","pallet","roll","set","tub"]),$v=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Zv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,xi=e=>{let t=Jv(e);return $1[t]??t},st=(e,t)=>{let a=xi(e),r=xi(t);return a.length>0&&a===r},K1=(e,t)=>{let a=Jv(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},J1=e=>(e??"").split(",").map(t=>xi(t)).filter(Boolean),P1=(e,t)=>{let a=J1(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||st(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||st(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||st(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},Kv=(e,t)=>st(t,"pallet")?e.itemsPerPallet??null:st(t,"pack")?e.itemsPerPack??null:st(t,"box")?e.itemsPerBox??null:null,F1=(e,t,a)=>{if(!st(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||!st(r[3],a))return null;let n=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(n)&&n>0?n:null};function ua(e,t){let a=e.qty,r=xi(e.unit)||"-",n=xi(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=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?e.sellUnitsOverride??null:null,p=v=>({requestedAmount:a,requestedUnit:r,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:n,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${v} Manually set to ${c} ${n}.`:v,costingMode:"review"});if(!P1(e,r))return p("Requested unit is not supported by this catalogue conversion.");let f=null,b="review",d=e.roundingRule,h=`Quantity review required, initial request needed ${a} ${r}.`,w=1+o,M=F1(e,r,n),D=e.unitConversions?.find(v=>st(v.requestUom,r));if(!!e.saleUnit&&(st(r,n)||!!D||st(r,"each")&&!Xv.has(n)))if(st(r,n))f=a*w/i,b="direct",h=`${a} ${r}${o>0?` x ${w}`:""}`;else if(D){f=a*w/D.quantityPerSaleUnit,b="derived";let v=1/D.quantityPerSaleUnit,N=Math.round(v);h=st(n,"each")&&D.quantityPerSaleUnit<1&&Math.abs(v-N)<1e-9?`${a} ${r}${o>0?` x ${w}`:""} x ${N} per ${r}`:`${a} ${r}${o>0?` x ${w}`:""} / ${D.quantityPerSaleUnit} ${r} per ${n}`}else st(r,"each")&&!Xv.has(n)&&(f=a*w/i,b="derived",h=`${a} ${n}${o>0?` x ${w}`:""}`);else if(st(r,n)&&i>0)f=a*w/i,b="direct",h=o>0?`${a} ${r} x ${w} / ${i} ${n} per sell unit`:`${a} ${r} / ${i} ${n} per sell unit`;else if(st(r,"each")&&i>0&&Z1.has(n))f=a*w/i,b="derived",h=o>0?`${a} each x ${w} / ${i} each per ${n}`:`${a} each / ${i} each per ${n}`;else if(Kv(e,r)!=null&&i>0){let v=Kv(e,r)??0;f=a*v*w/i,b="derived";let N=`${a} ${r} x ${v} each${o>0?` x ${w}`:""}`;h=i===1&&st(n,"each")?N:`${N} / ${i} each per ${n}`}else if(M!=null)f=a*w/M,b="derived",d??(d="round_up_each"),h=`${a} m2 x ${w} / ${M} m2 per ${n} (from product description)`;else if(e.conversionType==="basket_line_unit")i>0&&(f=a*w/i,b="derived",h=`${a} ${r}${o>0?` x ${w}`:""} / ${i} ${r} per ${n}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${r}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let v=e.coverageQty??e.derivedCoverageM2??null;st(r,"m2")&&v!=null&&v>0&&(f=a*w/v,b="derived",h=`${a} m2 x ${w} / ${v} m2 per ${n}`)}else if(e.conversionType==="count_per_area"){let v=e.coverageQty??null;st(r,"m2")&&v!=null&&v>0?(f=a/v,b="derived",h=`${a} m2 / ${v} m2 per sell unit`):st(r,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&i>0&&(f=a*e.itemsPerM2*w/i,b="derived",h=`${a} m2 x ${e.itemsPerM2} ${n}/m2 x ${w} / ${i}`)}else if(e.conversionType==="length_from_dims"){let v=e.coverageQty??e.derivedLengthM??null;st(r,"m")&&v!=null&&v>0&&(f=a*w/v,b="derived",h=`${a} m x ${w} / ${v} m per ${n}`)}else if(e.conversionType==="volume_from_description"){let v=$v(a,r),N=$v(e.coverageQty??0,xi(e.coverageUom));v!=null&&N!=null&&N>0&&(f=v*w/N,b="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="weight_from_description"){let v=Zv(a,r),N=Zv(e.coverageQty??0,xi(e.coverageUom));v!=null&&N!=null&&N>0&&(f=v*w/N,b="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="same_unit_volume"){let v=e.coverageQty??null;st(r,"m3")&&v!=null&&v>0&&(f=a/v,b="derived",h=`${a} m3 / ${v} m3 per ${n}`)}}if(f==null||!Number.isFinite(f)||f<0)return p(`Quantity review required, initial request needed ${a} ${r}.`);let u=K1(f,d),g=l?e.sellUnitsOverride??null:u;return{requestedAmount:a,requestedUnit:r,salesUnitSize:i,sellUnit:n,calculatedSellUnits:u,requiredSellUnits:g,unitPrice:e.price,lineTotal:e.price!=null&&g!=null?e.price*g:null,calculation:l?`${h} = ${u} ${n} (manually set to ${g})`:`${h} = ${g} ${n}`,costingMode:b}}var Pv=()=>import("./xlsx-K4MOA2QM.js"),Wo=["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"],I1=Wo.indexOf("Line total");function W1(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 Fv(e){let t=await Pv(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),n=[Wo],i=0;for(let c of e){let{item:p,best:f,qty:b,band:d,unmatchable:h,decision:w}=c,M=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),D=!h&&f?.price!=null?f.price*b:null;D!=null&&(i+=D),n.push([p.source_line_id,p.line_id,p.description_original||"(no description)",M,b,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(", "),w?.technical_classification??"",w?.include_in_quote==null?"":w.include_in_quote?"yes":"no",w?.approval_required==null?"":w.approval_required?"yes":"no",w?.approval_type??"",w?.missing_information.join(", ")??"",w?.confidence??"",w?.reason??"",h?"-":f?.product_id??w?.selected_candidate_id??"-",h?"-":f?.description??"-",h?"-":f?.price_basis??"-",h?null:f?.price??null,D,h?"-":d,W1(c)])}n.push(Array(Wo.length).fill(null));let o=Array(Wo.length).fill(null);o[0]="Estimated total",o[I1]=i,n.push(o),n.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(Wo.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(n);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 Io=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Iv(e,t){let a=await Pv(),r=a.utils.book_new(),n=new Date().toISOString().slice(0,10),i=t?[["Account",t.name+" ("+t.id+")"],[],Io]:[Io],o=0;for(let p of e){let f=ua(p),b=f.lineTotal;b!=null&&(o+=b),i.push([p.productId,p.description,f.costingMode,f.requestedAmount,xa(f.requestedUnit),f.salesUnitSize,xa(f.sellUnit),f.requiredSellUnits,f.unitPrice,b])}i.push(Array(Io.length).fill(null));let l=Array(Io.length).fill(null);l[0]="Estimated total",l[Io.length-1]=o,i.push(l);let c=a.utils.aoa_to_sheet(i);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}-${n}.xlsx`:`basket-${n}.xlsx`)}var s=Y(ae()),fd="__none__",el=24,e_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function aw(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var t_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function a_(e,t){if(t!==fd){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 Wv(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 r_(e,t){let a={...e,qty:t.qty,sellUnitsOverride:t.sellUnitsOverride??null};return t.productId!==e.productId||t.conversionType!=="basket_line_unit"?a:{...a,saleUnit:t.saleUnit,saleUnitQuantity:t.saleUnitQuantity,unitConversions:t.unitConversions,conversionType:t.conversionType,requestUomsSupported:t.requestUomsSupported,salesUomNormalised:t.salesUomNormalised,salesUnitSize:t.salesUnitSize,salesUnitSizeUom:t.salesUnitSizeUom,coverageQty:t.coverageQty,coverageUom:t.coverageUom,itemsPerPallet:t.itemsPerPallet,itemsPerPack:t.itemsPerPack,itemsPerBox:t.itemsPerBox,itemsPerM2:t.itemsPerM2,wasteFactorDefault:t.wasteFactorDefault,roundingRule:t.roundingRule,derivedCoverageM2:t.derivedCoverageM2,derivedLengthM:t.derivedLengthM,quoteQtyFormulaType:t.quoteQtyFormulaType,conversionConfidence:t.conversionConfidence,conversionNotes:t.conversionNotes}}function i_(e){return e?e.replace(/_/g," "):"not stated"}function n_({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 Tn(e,t){if(e==null)return"-";let a=Fo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function gd(e){return e&&e.length>0?e.join(" x "):"-"}function o_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Mn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Jr(e,t){return e.customer_display_label?.trim()||e.description_original||"(no description)"}var ew=[{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 l_(e){let t=new Map;return[...new Set(e.filter(mr).map(r=>r.linked_group_id))].forEach((r,n)=>{let i=n%26;t.set(r,{token:String.fromCharCode(65+i),bubbleStyle:ew[n%ew.length]})}),t}function mr(e){return!1}function zn(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 md({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function s_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,5),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let n=new Map(e.map(o=>[o.product_id,o])),i=r.map(o=>n.get(o)).filter(o=>o!=null);if(a&&!i.some(o=>o.product_id===a)){let o=n.get(a);o&&i.unshift(o)}return[...new Map(i.map(o=>[o.product_id,o])).values()].slice(0,5)}function Zs(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 Ks(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 c_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:n}){let i=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-i.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:Ks(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:n})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Ks(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:Ks(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:i.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Ks(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",i.length," of ",t.length," LLM calls."]})]})]})}function u_({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,n)=>(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:gd(r.measurements_mm)}),(0,s.jsx)("td",{children:Fo(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${n}`))})]})]},`${t.query}-${a}`))]})}function tw({item:e,result:t}){let a=t?.retrieval_debug.map(n=>n.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Mn(e.procurement_aliases)],["Retrieval queries",Mn(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)",gd(e.attrs.measurements_mm)],["Stock length",o_(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",Mn(e.installation_clues)],["System clues",Mn(e.system_clues)],["Component requirements",Mn(e.component_requirements)],["Linked group",zn(e)||"-"],["Flags",Mn(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(([n,i])=>(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:n}),(0,s.jsx)("dd",{children:i})]},n))})]})}function p_({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)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(we.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 d_({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||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];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,n])=>(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:n})]},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 m_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:n=!1,linkedGroupMeta:i}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"Exact match not found:":`AI review (${t.confidence??"confidence not stated"}):`;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:o}),"\xA0",t.reason]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",zn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(tw,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tw,{item:e,result:a}),r&&(0,s.jsx)(p_,{item:e}),r&&(0,s.jsx)(d_,{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]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",zn(e)]}):null]}),r&&(0,s.jsx)(u_,{queries:a?.retrieval_debug??[]})]})}function f_({item:e,candidates:t,result:a,decision:r,unmatchable:n,selectedProductId:i,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:f=!1,debugEnabled:b=!1,forceReviewNote:d=!1,linkedGroupMeta:h}){let w=f||o==="detailed",M=b&&o==="detailed",D=w||d?(0,s.jsx)(m_,{item:e,decision:r,result:a,showRetrievalDebug:M,reviewOnly:d&&!w,linkedGroupMeta:h}):null;if(n)return(0,s.jsxs)(s.Fragment,{children:[D,(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:[D,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let m=p||f||o==="detailed"?t:s_(t,a,i);return(0,s.jsxs)(s.Fragment,{children:[D,(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"}),M&&(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:m.map((u,g)=>{let v=u.product_id===i;return(0,s.jsxs)("tr",{className:v?"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:gd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Tn(u.price,u.price_basis)}),M&&(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)(n_,{band:aw(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:v?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:()=>{v?c?.():l(u)},"aria-label":v?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${g}`)})})]})]})}function hd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:n,onGoToBasket:i,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:f=!1}){let b=!f&&Gs()==="QZA6-MRA4",d=b?"quote":"basket",{results:h,lineItems:w,parseReport:M,timings:D}=e,[m,u]=(0,we.useState)({}),g=Cn(),[v,N]=(0,we.useState)({}),[A,T]=(0,we.useState)({}),[z,Q]=(0,we.useState)(""),[K,fe]=(0,we.useState)(null),[Te,Ye]=(0,we.useState)(1),[Ve,it]=(0,we.useState)(!1);(0,we.useEffect)(()=>{it(new URLSearchParams(window.location.search).get("debug")==="1")},[]);let[pe,G]=(0,we.useState)("simple"),[ce,xe]=(0,we.useState)(f?"list":"tile"),[ye,ee]=(0,we.useState)(!1),[se,Me]=(0,we.useState)(null),[_e,et]=(0,we.useState)(""),[Ht,Tt]=(0,we.useState)([]),[tt,ct]=(0,we.useState)(!1),[He,E]=(0,we.useState)(null),[x,R]=(0,we.useState)(!1),[I,ue]=(0,we.useState)(null),ve=(0,we.useRef)(null),[Se,k]=(0,we.useState)(new Set),[j,O]=(0,we.useState)(new Set),[ne,W]=(0,we.useState)(!1);(0,we.useEffect)(()=>{Ye(1)},[z,K,ce]);let C=new Map(h.map(_=>[_.line_id,_])),V=l_(w),X=w.map(_=>{let L=C.get(_.line_id),ze=L?.decision,zt=t_(_),Ze=m[_.line_id],It=a_(L,Ze),zi=a[_.line_id],Ow=Ze===fd?void 0:v[_.line_id]??(zi&&zi.productId!==It?.product_id?Wv(zi):It),Wd=zt?void 0:Ow,Lw=_.qty??0;return{item:_,result:L,decision:ze,unmatchable:zt,best:Wd,qty:Lw,band:aw(Wd?.scores?.overall)}}),me=0,Ce=0;for(let _ of X)_.unmatchable||_.decision?.include_in_quote!==!0||!_.best||(_.best.price!=null?me+=_.best.price*_.qty:Ce+=1);let dt=_=>!_.unmatchable&&!_.best&&_.decision?.technical_classification!=="no_suitable_candidate"&&Zs(_.result).length>0,je=_=>_.best??Zs(_.result)[0],Ir=X.filter(_=>!_.unmatchable&&!_.best).filter(_=>!j.has(_.item.line_id)),ll=X.filter(_=>j.has(_.item.line_id)),Ea=X;if(z.trim()){let _=z.trim().toLowerCase();Ea=Ea.filter(L=>L.item.description_original?.toLowerCase().includes(_)||je(L)?.description?.toLowerCase().includes(_))}if(K){let _=K==="asc"?1:-1;Ea=[...Ea].sort((L,ze)=>_*(L.item.description_original||"").localeCompare(ze.item.description_original||""))}let hr=Math.max(1,Math.ceil(Ea.length/el)),Pt=Math.min(Te,hr),Ft=Ea.slice((Pt-1)*el,Pt*el),Yd=Ft.filter(_=>!_.unmatchable&&_.best),Vd=Ft.filter(_=>dt(_)),gc=Ft.filter(_=>!_.unmatchable&&(_.best||dt(_))),Xd=Ft.filter(_=>_.unmatchable||!_.best&&!dt(_)),P=se?X.find(_=>_.item.line_id===se)??null:null,Tw=!f&&!c&&!P&&Ir.length>0,Qn=(0,we.useRef)(null),Gn=()=>{let _=ve.current;if(!_)return;let{top:L,left:ze,width:zt,height:Ze}=_.getBoundingClientRect(),zi=_.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;ue({top:L,left:ze,width:zi?zi-ze:zt,height:Ze})};(0,we.useEffect)(()=>(window.addEventListener("scroll",Gn,!0),window.addEventListener("resize",Gn),()=>{window.removeEventListener("scroll",Gn,!0),window.removeEventListener("resize",Gn)})),(0,we.useEffect)(()=>{let _=L=>{Qn.current&&!L.composedPath().includes(Qn.current)&&Qn.current.removeAttribute("open")};return document.addEventListener("click",_),()=>document.removeEventListener("click",_)},[]);let Ei=_=>{Me(_),et("")},zw=()=>{if(!se)return;let _=a[se];if(_){u(L=>({...L,[se]:_.productId})),N(L=>({...L,[se]:Wv(_)}));return}u(L=>{let ze={...L};return delete ze[se],ze}),N(L=>{let ze={...L};return delete ze[se],ze})},br=(_=!1)=>{let L=se?a[se]:void 0;!_&&L&&P?.best&&L.productId!==P.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(_||zw(),Me(null),W(!1))},Aw=_=>{if(k(L=>new Set(L).add(_)),Ir.some(L=>L.item.line_id!==_)){br(!0);return}p(),br(!0)},Rw=_=>{if(hc(_),O(L=>new Set(L).add(_)),Ir.some(L=>L.item.line_id!==_)){br(!0);return}p(),br(!0)},Uw=()=>{O(_=>new Set([..._,...Ir.map(L=>L.item.line_id)])),p()},$d=()=>{P?.best&&(Kd(P.item.line_id,P.best),r(Mi(P)),ne?Aw(P.item.line_id):br(!0))},Zd=Xd.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:Xd.map(_=>{let{item:L,qty:ze}=_;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>Ei(L.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Jr(L,w)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},L.line_id)})})]}):null,hc=_=>{u(L=>({...L,[_]:fd})),N(L=>({...L,[_]:void 0})),T(L=>({...L,[_]:void 0})),n(_)},bc=(_,L)=>{u(ze=>({...ze,[_]:L.product_id})),N(ze=>({...ze,[_]:L}))},Kd=(_,L)=>{L.method==="catalogue_search"&&T(ze=>({...ze,[_]:L}))};function tx(){g("downloaded",{type:"schedule",lines:X.length}),Fv(X.map(({item:_,best:L,qty:ze,band:zt,unmatchable:Ze,decision:It})=>({item:_,best:L,qty:ze,band:zt,unmatchable:Ze,decision:It})))}function Mi(_){let L=_.best??Zs(_.result)[0];return Kr(L,{lineId:_.item.line_id,description:_.item.description_original,unit:_.item.unit,qty:_.qty})}(0,we.useEffect)(()=>{if(!o){for(let _ of X)!_.unmatchable&&_.best&&r(Mi(_));l()}},[o]),(0,we.useEffect)(()=>{for(let _ of X){let L=a[_.item.line_id];if(!L)continue;let ze=Mi(_);r(r_(ze,L))}},[e]),(0,we.useEffect)(()=>{if(!se){Tt([]),E(null),ct(!1);return}let _=_e.trim();if(!_){Tt([]),E(null),ct(!1);return}let L=!1,ze=window.setTimeout(async()=>{try{ct(!0),E(null);let zt=await fetch(Bt(`/api/catalogue/search?q=${encodeURIComponent(_)}`),{headers:wi()}),Ze=await Zt(zt);if(!zt.ok)throw new Error(Ze?.error||Ze?.message||"Failed to search catalogue");L||Tt(Array.isArray(Ze?.items)?Ze.items:[])}catch(zt){L||(Tt([]),E(zt?.message||"Failed to search catalogue"))}finally{L||ct(!1)}},250);return()=>{L=!0,window.clearTimeout(ze)}},[_e,se]);let vc=Object.keys(a).length,Ma=_e.trim(),Jd=Zs(P?.result),sl=P?.decision?.technical_classification==="no_suitable_candidate"||!!P&&!P.best,Pd=P?.decision?.technical_classification!=null,Fd=P?.decision?.reason??(sl?"No catalogue candidate found. Refine the request or search the catalogue.":null),Dw=Ht.map(_=>({product_id:_.product_id,description:_.description,source_list:_.source_list,price:_.price,price_basis:_.price_basis,uoi_count:_.uoi_count??null,uoi:_.uoi,pdp_photo_url:_.pdp_photo_url??null,conversion:_.conversion,measurements_mm:_.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),Yn=Ma?Dw:Jd,Ti=P?A[P.item.line_id]:void 0,Vn=!Ma&&Ti&&!Yn.some(_=>_.product_id===Ti.product_id)?[...Yn,Ti]:Yn,Id=(()=>{let _=Vn.slice(0,Ma?12:3);return Ma||!Ti||_.some(L=>L.product_id===Ti.product_id)?_:[..._,Ti]})(),cl=!!P?.best&&a[P.item.line_id]?.productId===P.best.product_id,Bw=!!P?.best&&!!a[P.item.line_id]&&!cl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${f?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${f?"":" quick-order-hero--customer"}`,children:f?(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:nt(me)})," 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 ",b?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:i,"aria-label":b?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:b?"View Quote":"View Basket"}),(0,s.jsx)("strong",{children:nt(me)})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ot,{})})]})]})}),(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":ye,onClick:()=>ee(_=>!_),children:ye?"Hide timings":"Show timings"})}),Ve&&ye&&(0,s.jsx)(c_,{...D}),!b&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!P&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[Ce>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:Ce})," need pricing"]}),(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:z,onChange:_=>Q(_.target.value),"aria-label":"Search line items"}),!f&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${ce==="tile"?" is-active":""}`,"aria-pressed":ce==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>xe("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${ce==="list"?" is-active":""}`,"aria-pressed":ce==="list","aria-label":"List view",title:"List view",onClick:()=>xe("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:()=>G(_=>_==="simple"?"detailed":"simple"),children:pe==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Qn,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:e_.map(_=>{let L=K===_.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${L?" is-active":""}`,onClick:()=>{fe(L?null:_.dir),Qn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:L?"\u2713":""}),_.label]},_.dir)})})]})]})]})}),ce==="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:()=>br(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:_=>_.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>br(),"aria-label":"Close product options",children:(0,s.jsx)(Ko,{})}),(0,s.jsx)("div",{className:"results-review-page",children:f?(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:()=>br(),children:[(0,s.jsx)(Zr,{}),"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:()=>G(_=>_==="simple"?"detailed":"simple"),children:pe==="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:_e,onChange:_=>et(_.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:()=>hc(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)("img",{className:"fill-img results-review-page__image",src:Ga(je(P)?.description||P.item.description_original,je(P)?.product_id,je(P)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Jr(P.item,w)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[_i(P.qty)," ",ka(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:Tn(P.best.price,P.best.price_basis)}):null]}):je(P)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:je(P)?.description}),je(P)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Tn(je(P)?.price??null,je(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."}),mr(P.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(md,{meta:V.get(P.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:zn(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]?n(P.item.line_id):(P.best&&Kd(P.item.line_id,P.best),r(Mi(P)))},disabled:!P.best,"aria-label":a[P.item.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[P.item.line_id]?"\u2713 Added":f?"+ Add to selection":`Add to ${d}`})})]})]}),tt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!tt&&He?(0,s.jsx)("div",{className:"results-empty-card",children:He}):null,!tt&&!He&&Ma&&Yn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!tt&&!He?(0,s.jsx)(f_,{item:P.item,candidates:Yn,result:P.result,decision:P.decision,unmatchable:P.unmatchable,selectedProductId:P.best?.product_id??null,detailMode:pe,linkedGroupMeta:mr(P.item)?V.get(P.item.linked_group_id):void 0,onPick:_=>bc(P.item.line_id,_),onClear:()=>hc(P.item.line_id),showAll:f||Ve||Ma.length>0,internal:f,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:Jr(P.item,w)||"Original request"})]}),Fd?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:sl?"Exact match not found:":"AI review:"})," ",Fd]}):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:sl?"We couldn't find a suitable product":Pd?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:sl?Jd.length>0?"These AI-reviewed alternatives may be useful, but need approval.":"Search the catalogue to choose an alternative.":Pd?`Select the option you want to add to your ${d}.`:"Search the catalogue to choose a product."})]})}),!Ma&&Vn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Id.map(_=>{let L=_.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${L?" is-selected":""}`,onClick:()=>bc(P.item.line_id,_),"aria-pressed":L,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Tn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:L?"Selected":"Choose"})]},_.product_id)})}):null,Vn.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:_e,onChange:_=>et(_.target.value),"aria-label":"Search catalogue"})]}),Ma&&tt?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Ma&&!tt&&He?(0,s.jsx)("div",{className:"results-empty-card",children:He}):null,Ma&&!tt&&!He&&Vn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Ma&&!tt&&!He&&Vn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Id.map(_=>{let L=_.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${L?" is-selected":""}`,onClick:()=>bc(P.item.line_id,_),"aria-pressed":L,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Tn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:L?"Selected":"Choose"})]},_.product_id)})}):null]}),P.best?Bw?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{$d()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>n(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${cl?" cta-btn-secondary":""}`,onClick:()=>{cl?n(P.item.line_id):$d()},children:(0,s.jsx)("span",{children:cl?`Remove from ${d}`:`Add selected product to ${d}`})}):null,ne?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>Rw(P.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[Ea.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,gc.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:gc.map(_=>{let{item:L,best:ze,qty:zt}=_,Ze=je(_),It=!ze&&dt(_);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>Ei(L.line_id),"aria-label":`Review match for ${Jr(L,w)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[It||mr(L)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[mr(L)?(0,s.jsx)(md,{meta:V.get(L.linked_group_id)}):(0,s.jsx)("span",{}),It?(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)("img",{className:"fill-img results-tile-card__image",src:Ga(Ze?.description||L.description_original,Ze?.product_id,Ze?.pdp_photo_url),alt:""})]}),(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:It?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Jr(L,w)}),mr(L)?(0,s.jsx)("div",{className:"results-row-meta",children:zn(L)}):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:[f&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ei(L.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[L.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[L.line_id]?n(L.line_id):r(Mi(_))},disabled:!Ze,"aria-label":a[L.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[L.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})]})]},L.line_id)})})}):null,Zd]})]}):(0,s.jsxs)(s.Fragment,{children:[I&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:I,"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"}}),pe==="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"}),pe==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:f?"Selection":b?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[Ea.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:pe==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),gc.map(_=>{let{item:L,result:ze,decision:zt,best:Ze}=_;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>Ei(L.line_id),onMouseEnter:It=>{ve.current=It.currentTarget,Gn()},onMouseLeave:()=>{ve.current=null,ue(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Jr(L,w)}),mr(L)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(md,{meta:V.get(L.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:zn(L)})]}):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}),pe==="detailed"&&zt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[i_(zt.technical_classification),zt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Ze?.price!=null?Tn(Ze.price,Ze.price_basis):"-"}),pe==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[L.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:It=>{It.stopPropagation(),a[L.line_id]?n(L.line_id):r(Mi(_))},"aria-label":a[L.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[L.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})})]},L.line_id)})]})]})}),Zd]}),!P&&hr>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Pt-1)*el+1,"\u2013",Math.min(Pt*el,Ea.length)," of ",Ea.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ye(Pt-1),disabled:Pt===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",Pt," of ",hr]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ye(Pt+1),disabled:Pt===hr,children:"Next"})]})]}),(M.itemCount!=null||M.headingCount!=null||M.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[M.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:M.itemCount})," items parsed"]}),M.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:M.headingCount})," headings"]}),M.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:M.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:(vc>0,"0 1 30%"),gap:10,justifyContent:"center"},onClick:()=>R(!0),"aria-label":"Start over",children:[(0,s.jsx)(pd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),vc>0&&(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:i,"aria-label":f?"View selection":b?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[f?"View Selection":b?"View Quote":"View Basket"," (",vc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ot,{})})]})]})]})]}),Tw&&(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:Ir.map(_=>{let L=Se.has(_.item.line_id),ze=dt(_);return(0,s.jsx)("div",{className:`review-gate-item${L?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{W(!0),Ei(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(_.item,w)}),(0,s.jsx)("span",{children:_.decision?.reason||(ze?"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:L?"Choice made":"Choose a product"})]})},_.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:Uw,children:"Skip all"}),ll.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),ll.map(_=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{O(L=>{let ze=new Set(L);return ze.delete(_.item.line_id),ze}),W(!0),Ei(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(_.item,w)}),(0,s.jsx)("span",{children:`Not added to your ${d}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},_.item.line_id))]}):null]})}),x&&(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 ",b?"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:()=>R(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{R(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var wt=Y(Xe());var q=Y(ae()),g_=.2,tl=10,rw="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)}`,n=e.unitConversions?.find(i=>i.requestUom===t.requestedUnit);return n&&n.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/n.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}`},b_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${xa(e.sellUnit,1)}.`;function v_(){return(0,q.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,q.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,q.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,q.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function al(){return(0,q.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,q.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function rl({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:n,onBack:i,onStartNewQuote:o,internal:l=!1}){let c=(0,wt.useId)(),p=!l&&Gs()==="QZA6-MRA4",f=Object.values(e),[b,d]=(0,wt.useState)(""),[h,w]=(0,wt.useState)(!1),[M,D]=(0,wt.useState)(!1),m=Cn(),[u,g]=(0,wt.useState)(""),[v,N]=(0,wt.useState)({}),[A,T]=(0,wt.useState)({}),[z,Q]=(0,wt.useState)(1),[K,fe]=(0,wt.useState)({}),[Te,Ye]=(0,wt.useState)(!1),[Ve,it]=(0,wt.useState)("0"),pe=(0,wt.useRef)(new Set);(0,wt.useEffect)(()=>{if(!r)return;for(let R of Object.values(e))ua(R).requiredSellUnits!=null&&pe.current.delete(R.lineId);let x=Object.values(e).filter(R=>R.productId!=="-"&&ua(R).requiredSellUnits==null&&!pe.current.has(R.lineId));x.length!==0&&(x.forEach(R=>pe.current.add(R.lineId)),fetch(Bt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Qa()},body:JSON.stringify({lines:x.map(R=>({line_id:R.lineId,product_id:R.productId,requested_description:R.requestedDescription??R.description,requested_qty:R.qty,requested_uom:R.unit,selected_description:R.description,selected_uoi:R.uoi,selected_uoi_count:R.uoiCount,selected_conversion:{sales_uom_normalised:R.salesUomNormalised,conversion_type:R.conversionType,sales_unit_size:R.salesUnitSize,sales_unit_size_uom:R.salesUnitSizeUom,coverage_qty:R.coverageQty,coverage_uom:R.coverageUom}}))})}).then(R=>R.ok?Zt(R):null).then(R=>{let I={};for(let ue of R?.data?.items??R?.items??[]){let ve=ue?.conversion;!ve||typeof ue?.line_id!="string"||(I[ue.line_id]={conversionType:ve.conversion_type,requestUomsSupported:ve.request_uoms_supported,salesUomNormalised:ve.sales_uom_normalised,salesUnitSize:ve.sales_unit_size,salesUnitSizeUom:ve.sales_unit_size_uom,coverageQty:ve.coverage_qty,coverageUom:ve.coverage_uom,roundingRule:ve.rounding_rule,conversionConfidence:ve.conversion_confidence,conversionNotes:ve.conversion_notes})}Object.keys(I).length>0&&r(I)}).catch(()=>{}))},[e,r]);function G(x){N(R=>{let I={...R};return delete I[x],I})}function ce(x,R){let I=parseFloat(R);!isNaN(I)&&I>=0&&t(x,I),G(x)}function xe(x,R,I){t(x,Math.max(0,R+I)),G(x)}function ye(x){T(R=>{let I={...R};return delete I[x],I})}function ee(x,R){let I=parseFloat(R);!isNaN(I)&&I>=0&&a(x,I),ye(x)}function se(x,R,I){a(x,Math.max(0,R+I)),ye(x)}async function Me(){let x=b.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x)){g(rw);return}g(""),D(!0);try{let R=await fetch(Bt("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Qa()},body:JSON.stringify({email:x,items:_e.map(({item:I,pricing:ue})=>{let ve=ue.requiredSellUnits??ue.requestedAmount,Se=ue.requiredSellUnits!=null?ue.sellUnit:ue.requestedUnit;return{product_id:I.productId,description:I.description,quantity:ve,unit:xa(Se,ve),unit_price:ue.requiredSellUnits!=null?ue.unitPrice:null,line_total:ue.lineTotal}})})});if(!R.ok){let I=await Zt(R);console.error("Quote request failed",R.status,I?.message),g(R.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}m("quote_requested",{items:_e.length,total:Math.round(Tt*100)/100}),w(!0),window.scrollTo(0,0)}catch{g("Your request couldn't be sent. Check your connection and try again.")}finally{D(!1)}}let _e=f.map(x=>({item:x,pricing:ua(x,{wasteFactorEnabled:Te,wasteFactorOverride:Math.max(0,Number.parseFloat(Ve)||0)/100})})),et=_e.reduce((x,R)=>x+(R.pricing.lineTotal??0),0),Ht=et*g_,Tt=et+Ht,tt=(0,wt.useRef)({items:_e.length,total:Math.round(Tt*100)/100});(0,wt.useEffect)(()=>{m("basket_viewed",tt.current)},[m]);let ct=Math.max(1,Math.ceil(_e.length/tl)),He=Math.min(z,ct),E=_e.slice((He-1)*tl,He*tl);return h?(0,q.jsx)("div",{className:"wizard-step entry-stage",children:(0,q.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,q.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,q.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,q.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,q.jsx)("h1",{children:"Quote requested"}),(0,q.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,q.jsx)("strong",{children:b.trim()}),", usually within one working day."]}),(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,q.jsx)("span",{children:"Start a new quote"})}),(0,q.jsx)("p",{className:"quote-request-sent-note",children:"Nothing is charged until you approve the quote."})]})}):(0,q.jsx)("div",{className:`wizard-step entry-stage${p?" basket-layout--qza6-mra4":""}`,children:(0,q.jsxs)("div",{className:`quick-order-card${l?"":" quick-order-card--customer"}`,children:[(0,q.jsxs)("div",{className:`quick-order-hero${l?"":" quick-order-hero--customer"}`,children:[l&&(0,q.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,q.jsxs)("div",{className:"basket-hero-copy",children:[p&&(0,q.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:i,children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]}),(0,q.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,q.jsx)("h1",{children:l?"Your Selection":p?"Request a quote":"Your Basket"}),l&&(0,q.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,q.jsx)("strong",{children:f.length})," ",f.length===1?"item":"items"]})]}),(0,q.jsx)("p",{children:l?"Review the items you've added before exporting them for review.":p?"Check your items & quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary before you buy."})]})]}),(0,q.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:f.length===0?(0,q.jsxs)("div",{className:"quick-order-history-empty",children:[(0,q.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:l?"\u{1F4CB}":"\u{1F9FA}"}),(0,q.jsx)("p",{children:l?"Your selection is empty.":p?"Your quote request is empty.":"Your basket is empty."}),(0,q.jsx)("p",{className:"basket-empty-hint",children:p?"Go back to your results and add items for your quote.":"Go back to your results and add quoted items."}),(0,q.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,q.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:i,"aria-label":"Back to results",children:(0,q.jsx)("span",{children:"Back to Results"})})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"basket-layout",children:[(0,q.jsxs)("div",{className:"basket-main",children:[(0,q.jsx)("div",{className:"basket-list","aria-label":l?"Selection items":p?"Quote request items":"Basket items",children:E.map(({item:x,pricing:R})=>{let I=v[x.lineId]??String(R.requestedAmount),ue=R.requestedUnit===R.sellUnit||R.costingMode==="review",ve=R.requiredSellUnits==null||R.requestedAmount!==R.requiredSellUnits||R.requestedUnit!==R.sellUnit;return(0,q.jsxs)("article",{className:"basket-card",children:[(0,q.jsxs)("div",{className:"basket-card-top",children:[(0,q.jsx)("img",{className:"basket-card-thumb",src:Ga(x.description,x.productId,x.pdpPhotoUrl),alt:"",width:48,height:48}),(0,q.jsxs)("div",{className:"basket-card-info",children:[(0,q.jsx)("div",{className:"bom-component-name",children:x.description}),ve&&R.costingMode!=="review"&&(0,q.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>fe(Se=>({...Se,[x.lineId]:!Se[x.lineId]})),"aria-expanded":!!K[x.lineId],children:["How we calculated this",(0,q.jsx)("span",{className:`basket-calc-toggle-chevron${K[x.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,q.jsx)(al,{})})]})]}),(0,q.jsx)("div",{className:"basket-card-actions",children:(0,q.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>n(x.lineId),"aria-label":`Remove ${x.description}`,children:(0,q.jsx)(v_,{})})})]}),l&&(0,q.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,q.jsxs)("dl",{className:"results-detail-grid",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion type"}),(0,q.jsx)("dd",{children:x.conversionType??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion confidence"}),(0,q.jsx)("dd",{children:x.conversionConfidence??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Sales unit"}),(0,q.jsx)("dd",{children:x.salesUnitSize!=null?(0,q.jsxs)(q.Fragment,{children:[x.salesUnitSize," ",ka(x.salesUnitSizeUom,x.salesUnitSize)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Coverage"}),(0,q.jsx)("dd",{children:x.coverageQty!=null?(0,q.jsxs)(q.Fragment,{children:[x.coverageQty," ",ka(x.coverageUom,x.coverageQty)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Waste factor"}),(0,q.jsx)("dd",{children:x.wasteFactorDefault??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Rounding rule"}),(0,q.jsx)("dd",{children:x.roundingRule??"-"})]})]}),x.conversionNotes&&(0,q.jsx)("p",{className:"results-rerank-note",children:x.conversionNotes})]}),R.costingMode==="review"?(0,q.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,q.jsx)("strong",{children:"Quantity needs confirmation."})," ",b_(R)]}):ve&&K[x.lineId]?(0,q.jsx)("p",{className:"basket-calc-text",children:h_(x,R)}):null,(0,q.jsxs)("div",{className:"basket-card-stats",children:[(0,q.jsxs)("div",{className:"basket-stat",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:I,disabled:ue,onChange:Se=>N(k=>({...k,[x.lineId]:Se.target.value})),onBlur:Se=>ce(x.lineId,Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&Se.target.blur()},"aria-label":`${x.description} requested quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:ue,onClick:()=>xe(x.lineId,parseFloat(I)||0,1),"aria-label":`Increase ${x.description} quantity`,children:(0,q.jsx)(al,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:ue,onClick:()=>xe(x.lineId,parseFloat(I)||0,-1),"aria-label":`Decrease ${x.description} quantity`,children:(0,q.jsx)(al,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(R.requestedUnit,parseFloat(I)||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:A[x.lineId]??String(R.requiredSellUnits??""),onChange:Se=>T(k=>({...k,[x.lineId]:Se.target.value})),onBlur:Se=>ee(x.lineId,Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&Se.target.blur()},"aria-label":`${x.description} order quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>se(x.lineId,parseFloat(A[x.lineId]??String(R.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${x.description} order quantity`,children:(0,q.jsx)(al,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>se(x.lineId,parseFloat(A[x.lineId]??String(R.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${x.description} order quantity`,children:(0,q.jsx)(al,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(R.sellUnit,parseFloat(A[x.lineId]??String(R.requiredSellUnits??"0"))||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsx)("strong",{children:R.lineTotal!=null?nt(R.lineTotal):"-"}),R.lineTotal!=null&&(0,q.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},x.lineId)})}),ct>1&&(0,q.jsxs)("div",{className:"results-pagination",children:[(0,q.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(He-1)*tl+1,"\u2013",Math.min(He*tl,_e.length)," of ",_e.length]}),(0,q.jsxs)("div",{className:"results-pagination-controls",children:[(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Q(He-1),disabled:He===1,children:"Previous"}),(0,q.jsxs)("span",{className:"results-pagination-page",children:["Page ",He," of ",ct]}),(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Q(He+1),disabled:He===ct,children:"Next"})]})]})]}),(0,q.jsxs)("aside",{className:"basket-sidebar",children:[(0,q.jsx)("div",{className:"basket-sidebar-title",children:p?"Quote request summary":"Order summary"}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:p?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,q.jsx)("span",{children:nt(et)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:"VAT (20%)"}),(0,q.jsx)("span",{children:nt(Ht)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,q.jsx)("span",{children:p?"List price (inc. VAT)":"Total"}),(0,q.jsx)("span",{children:nt(Tt)})]}),!p&&(0,q.jsx)("div",{className:"basket-summary-waste",children:(0,q.jsxs)("div",{className:"basket-waste-control",children:[(0,q.jsxs)("label",{className:"basket-global-waste",children:[(0,q.jsx)("input",{type:"checkbox",checked:Te,onChange:x=>Ye(x.target.checked)}),(0,q.jsx)("span",{children:"Add waste factor"})]}),(0,q.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,q.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:Ve,onChange:x=>it(x.target.value),disabled:!Te,"aria-label":"Waste factor percent"}),(0,q.jsx)("span",{children:"%"})]})]})}),(0,q.jsx)("label",{htmlFor:`${c}-basket-reference`,className:"basket-sidebar-label",children:p?"Enter email for your sharper quote":"Your reference (optional)"}),(0,q.jsx)("input",{id:`${c}-basket-reference`,type:p?"email":"text",className:"basket-sidebar-input",value:b,onChange:x=>{d(x.target.value),p&&g("")},placeholder:p?"you@example.com":"PO number or job reference","aria-invalid":p&&u===rw,"aria-describedby":p&&u?`${c}-basket-reference-error`:void 0}),p&&u&&(0,q.jsx)("p",{id:`${c}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:u}),p?(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{Me()},disabled:M,"aria-busy":M,children:(0,q.jsx)("span",{children:M?"Sending\u2026":"Request our best quote"})}):(0,q.jsx)("button",{className:"cta-btn",onClick:()=>{m("downloaded",{type:"basket",items:f.length}),Iv(f)},"aria-label":l?"Download selection":"Download basket",children:(0,q.jsx)("span",{children:l?"Download Quote":"Buy Now"})}),(0,q.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,q.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),p?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,q.jsx)("div",{className:"btn-row results-actions",children:(0,q.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:i,"aria-label":"Back to results",children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]})})]})})]})})}var Et=Y(Xe()),iw=Y(ae()),bd=(0,Et.createContext)(null);function Js({children:e,onOpenBasket:t}){let[a,r]=(0,Et.useState)({}),n=(0,Et.useCallback)(d=>{r(h=>({...h,[d.lineId]:d}))},[]),i=(0,Et.useCallback)(d=>{r(h=>{let w={...h};for(let M of d)w[M.lineId]=M;return w})},[]),o=(0,Et.useCallback)(d=>{r(h=>{let w={...h};return delete w[d],w})},[]),l=(0,Et.useCallback)((d,h)=>{r(w=>w[d]?{...w,[d]:{...w[d],qty:h,sellUnitsOverride:null}}:w)},[]),c=(0,Et.useCallback)((d,h)=>{r(w=>w[d]?{...w,[d]:{...w[d],sellUnitsOverride:h}}:w)},[]),p=(0,Et.useCallback)(d=>{r(h=>{let w=!1,M={...h};for(let[D,m]of Object.entries(d))M[D]&&(M[D]={...M[D],...m},w=!0);return w?M:h})},[]),f=(0,Et.useCallback)(()=>r({}),[]),b=(0,Et.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:n,addManyToCart:i,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:f,openBasket:t??(()=>{})}),[a,n,i,o,l,c,p,f,t]);return(0,iw.jsx)(bd.Provider,{value:b,children:e})}function An(){let e=(0,Et.useContext)(bd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function Ps(){return(0,Et.useContext)(bd)}var Na=Y(ae());function Fs(e){return(0,Na.jsx)(Js,{children:(0,Na.jsx)(w_,{...e})})}function w_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,n]=(0,Je.useState)("entry"),[i,o]=(0,Je.useState)(null),[l,c]=(0,Je.useState)(""),p=(0,Je.useRef)(null),[f,b]=(0,Je.useState)(0),[d,h]=(0,Je.useState)(null),[w,M]=(0,Je.useState)(!1),{cart:D,addToCart:m,removeFromCart:u,updateCartQty:g,updateCartSellUnits:v,updateCartConversions:N,clearCart:A}=An(),[T,z]=(0,Je.useState)(!1),Q=(0,Je.useRef)(new Map),K=(0,Je.useRef)(null),fe=Qs("quick-quote",K);(0,Je.useEffect)(()=>{fe("viewed")},[fe]),(0,Je.useEffect)(()=>{for(let ee of Object.values(D))ua(ee).requiredSellUnits!=null&&Q.current.delete(ee.lineId);let ye=Object.values(D).filter(ee=>{if(ee.productId==="-"||ua(ee).requiredSellUnits!=null)return!1;let se=`${ee.productId}|${ee.qty}|${ee.unit}`;return Q.current.get(ee.lineId)===se?!1:(Q.current.set(ee.lineId,se),!0)});ye.length!==0&&fetch(Bt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Qa()},body:JSON.stringify({lines:ye.map(ee=>({line_id:ee.lineId,product_id:ee.productId,requested_description:ee.requestedDescription??ee.description,requested_qty:ee.qty,requested_uom:ee.unit,selected_description:ee.description,selected_uoi:ee.uoi,selected_uoi_count:ee.uoiCount,selected_conversion:{sales_uom_normalised:ee.salesUomNormalised,conversion_type:ee.conversionType,sales_unit_size:ee.salesUnitSize,sales_unit_size_uom:ee.salesUnitSizeUom,coverage_qty:ee.coverageQty,coverage_uom:ee.coverageUom}}))})}).then(ee=>ee.ok?Zt(ee):null).then(ee=>{let se={};for(let Me of ee?.data?.items??ee?.items??[]){let _e=Me?.conversion;!_e||typeof Me?.line_id!="string"||(se[Me.line_id]={conversionType:_e.conversion_type,requestUomsSupported:_e.request_uoms_supported,salesUomNormalised:_e.sales_uom_normalised,salesUnitSize:_e.sales_unit_size,salesUnitSizeUom:_e.sales_unit_size_uom,coverageQty:_e.coverage_qty,coverageUom:_e.coverage_uom,roundingRule:_e.rounding_rule,conversionConfidence:_e.conversion_confidence,conversionNotes:_e.conversion_notes})}Object.keys(se).length>0&&N(se)}).catch(()=>{})},[D,N]),(0,Je.useEffect)(()=>{if(window.location.hash!=="#matched-products"&&window.location.hash!=="#quote-request")return;let ye=new URL(window.location.href);ye.hash="",window.history.replaceState({...window.history.state??{},boqQuoteStage:"entry"},"",ye)},[]);let Te=(0,Je.useCallback)(ye=>{if(typeof window>"u")return;let ee=new URL(window.location.href);ee.hash=ye==="basket"?"quote-request":"matched-products";let se={...window.history.state??{},boqQuoteStage:ye};window.history.pushState(se,"",ee)},[]);(0,Je.useEffect)(()=>{let ye=ee=>{let se=ee.state?.boqQuoteStage;n(se==="basket"?"basket":se==="results"&&d?"results":"entry")};return window.addEventListener("popstate",ye),()=>window.removeEventListener("popstate",ye)},[d]);let Ye=(0,Je.useCallback)(()=>{Te("basket"),n("basket")},[Te]),Ve=(0,Je.useCallback)(()=>{window.history.state?.boqQuoteStage==="basket"?window.history.back():n(d?"results":"entry")},[d]),it=(0,Je.useRef)(r);(0,Je.useEffect)(()=>{it.current!==r&&(it.current=r,window.scrollTo(0,0))},[r]);let pe=()=>{n("entry"),o(null),c(""),b(0),h(null),M(!1),A(),z(!1)},G=(0,Je.useCallback)(async(ye,ee,se=!0)=>{c(""),b(0);let Me=0,_e=()=>{Me=Math.min(Me+1,3),b(Me)};try{let{jobId:et}=await Ib(ye,ee,se),{promise:Ht,cancel:Tt}=ev(()=>Wb(et),5e3,_e,"schedule");p.current=Tt;let tt=await Ht;if(tt.status==="failed"||!tt.result)throw new Error(tt.error||"Failed to process schedule");let ct=tt.result.lineItems.length,He=tt.result.results.filter(E=>E.candidates.length>0).length;fe("results_shown",{lines:ct,matched:He,unmatched:ct-He}),M(!1),h(tt.result),Te("results"),n("results")}catch(et){fe("error",{stage:"matching"}),c(et?.message||"Failed to process schedule"),n("entry")}finally{p.current?.(),p.current=null}},[Te,fe]),ce=(0,Je.useCallback)(async(ye,ee,se=!0)=>{let Me=ye.trim();if(!Me)return;o("schedule");let _e=new File([Me],"pasted-schedule.txt",{type:"text/plain"});await G(_e,ee,se)},[G]),xe=(0,Je.useCallback)(async ye=>{o("schedule"),await G(ye)},[G]);return(0,Na.jsx)(Zo.Provider,{value:fe,children:(0,Na.jsx)("div",{ref:K,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:pr().theme,children:(0,Na.jsxs)("main",{className:"main-content",children:[l&&(0,Na.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Na.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Na.jsx)(cd,{onPasteSchedule:ce,onUploadSchedule:xe,onEntryModeChange:o}),r==="results"&&i==="schedule"&&d&&(0,Na.jsx)(hd,{scheduleResult:d,onStartOver:pe,cart:D,onAddToCart:m,onRemoveFromCart:u,onGoToBasket:Ye,cartSeeded:T,onCartSeeded:()=>z(!0),reviewGateComplete:w,onReviewGateComplete:()=>M(!0),internal:a}),r==="basket"&&(0,Na.jsx)(rl,{cart:D,onUpdateQty:g,onUpdateSellUnits:v,onRemove:u,onBack:Ve,onStartNewQuote:pe,internal:a})]})})})}var Va=Y(Xe());var ki=Y(Xe()),te=Y(ae()),nw=[{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"}],Is=e=>Number.parseFloat(e)||0,ow=(e,t)=>Is(e)*(t==="m"?1:.3048),vd=(e,t)=>Is(e.quantity)*(2*ow(e.height,t)+ow(e.width,t)),y_=()=>({quantity:"1",width:"",height:""});function __({profile:e}){return(0,te.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,te.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,te.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function wd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,ki.useState)("m"),[i,o]=(0,ki.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,ki.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,f]=(0,ki.useState)([]),[b,d]=(0,ki.useState)("ogee"),[h,w]=(0,ki.useState)("2.4"),M=(N,A,T)=>{N(z=>({...z,[A]:T}))},D=vd(i,r)+vd(l,r)+p.reduce((N,A)=>N+vd(A,r),0),m=Is(h)>0?Math.ceil(D/Is(h)):0,u=nw.find(N=>N.id===b)?.label??"",g=[{key:`architrave-${b}`,label:`Architrave (${u})`,qty:D,unit:"m",query:`${u} architrave`,category:"architrave"}],v=(N,A,T,z)=>(0,te.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,te.jsx)("span",{children:N}),(0,te.jsx)("input",{"aria-label":`${N} quantity`,type:"number",min:"0",step:"1",value:A.quantity,onChange:Q=>T("quantity",Q.target.value)}),(0,te.jsx)("input",{"aria-label":`${N} width`,type:"number",min:"0",step:"0.01",value:A.width,onChange:Q=>T("width",Q.target.value)}),(0,te.jsx)("input",{"aria-label":`${N} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:Q=>T("height",Q.target.value)}),z?(0,te.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:z,children:"Remove"}):null]});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:"Architrave Calculator"}),(0,te.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,te.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,te.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,te.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,te.jsxs)("div",{className:"architrave-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,te.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,te.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,te.jsx)("span",{children:"Units"}),(0,te.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,te.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metres"}),(0,te.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Feet"})]})]}),(0,te.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,te.jsx)("span",{children:"Opening"}),(0,te.jsx)("span",{children:"Qty"}),(0,te.jsxs)("span",{children:["Width (",r,")"]}),(0,te.jsxs)("span",{children:["Height (",r,")"]}),(0,te.jsx)("span",{})]}),v("Single doors",i,(N,A)=>M(o,N,A)),v("Double doors",l,(N,A)=>M(c,N,A)),p.map((N,A)=>v(`Alternative door ${A+1}`,N,(T,z)=>f(Q=>Q.map((K,fe)=>fe===A?{...K,[T]:z}:K)),()=>f(T=>T.filter((z,Q)=>Q!==A)))),(0,te.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(N=>[...N,y_()]),children:"+ Add alternative-sized door"})]}),(0,te.jsxs)("div",{className:"architrave-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,te.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,te.jsx)("div",{className:"architrave-calculator__profiles",children:nw.map(N=>(0,te.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===N.id?" is-selected":""}`,onClick:()=>d(N.id),children:[(0,te.jsx)(__,{profile:N.id}),(0,te.jsx)("div",{className:"truss-estimator__option-title",children:N.label}),(0,te.jsx)("div",{className:"truss-estimator__option-copy",children:N.blurb})]},N.id))})]}),(0,te.jsxs)("div",{className:"architrave-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,te.jsx)("div",{className:"architrave-calculator__options",children:(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Board length (m)"}),(0,te.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,te.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,te.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,te.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Architrave needed"}),(0,te.jsxs)("strong",{children:[D.toFixed(2)," m"]})]}),(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Board lengths"}),(0,te.jsx)("strong",{children:m})]})]})]}),(0,te.jsxs)("div",{className:"architrave-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?.(g),disabled:D<=0,children:a})]})]})]})})}var Ni=Y(Xe()),le=Y(ae()),lw=60,sw=10,x_=.02,k_=.012,N_=.01,Rn=e=>Number.parseFloat(e)||0,S_=(e,t=2)=>e.toFixed(t);function yd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ni.useState)("brick"),[i,o]=(0,Ni.useState)("engineering-red"),[l,c]=(0,Ni.useState)("metric"),[p,f]=(0,Ni.useState)(""),[b,d]=(0,Ni.useState)(""),[h,w]=(0,Ni.useState)(!0),M=l==="metric"?Rn(p)*Rn(b):Rn(p)*Rn(b)*.092903,m=M*(r==="brick"?lw:sw),u=Math.ceil(m),g=M*(r==="brick"?x_:k_),v=Math.ceil(g/N_),N=l==="metric"?M:M*10.7639,A=[{key:r==="brick"?`brick-${i}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[i]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...h?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:v,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],T=z=>{if(z===l)return;let Q=z==="imperial"?3.28084:.3048;f((Rn(p)*Q).toFixed(2)),d((Rn(b)*Q).toFixed(2)),c(z)};return(0,le.jsx)(le.Fragment,{children:(0,le.jsxs)("div",{className:"truss-estimator",children:[(0,le.jsxs)("div",{className:"quick-order-hero",children:[(0,le.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,le.jsx)("h1",{children:"Brick & Block Calculator"}),(0,le.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,le.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,le.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,le.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,le.jsxs)("div",{className:"brick-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,le.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([z,Q])=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===z?" is-selected":""}`,onClick:()=>n(z),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,le.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",z==="brick"?lw:sw," per m\xB2"]})]},z))})]}),r==="brick"&&(0,le.jsxs)("div",{className:"brick-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,le.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(([z,Q,K])=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i===z?" is-selected":""}`,onClick:()=>o(z),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,le.jsx)("div",{className:"truss-estimator__option-copy",children:K})]},z))})]}),(0,le.jsxs)("div",{className:"brick-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,le.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,le.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>T("metric"),children:"Metric"}),(0,le.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>T("imperial"),children:"Imperial"})]}),(0,le.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:z=>f(z.target.value)})]}),(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:b,onChange:z=>d(z.target.value)})]})]})]}),(0,le.jsx)("div",{className:"brick-calculator__options",children:(0,le.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,le.jsx)("input",{type:"checkbox",checked:h,onChange:z=>w(z.target.checked)}),(0,le.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,le.jsxs)("div",{className:"brick-calculator__totals",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,le.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Wall area"}),(0,le.jsxs)("strong",{children:[S_(N)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,le.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),h?(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Ready-mixed mortar"}),(0,le.jsxs)("strong",{children:[v," x 20kg bags"]})]}):null]}),(0,le.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,le.jsxs)("div",{className:"brick-calculator__actions",children:[(0,le.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,le.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(A),disabled:M<=0,children:a})]})]})]})})}var fr=Y(Xe());var cw=new Map;function C_(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 Pr(e,t,a=12,r){let n=`${e}||${t??""}||${a}||${r??""}`,i=cw.get(n);if(i)return i;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Bt(`/api/catalogue/search?${o.toString()}`),{headers:wi()}),c=await Zt(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(C_):[];return cw.set(n,p),p}async function uw(e,t){return await Promise.all(e.map(async r=>{try{return{requirement:r,candidates:await Pr(r.query,r.category,void 0,t)}}catch{return{requirement:r,candidates:[]}}}))}async function pw(){let e=await fetch(Bt("/api/catalogue"),{headers:wi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Zt(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var $=Y(ae()),q_=1.54,E_=1440,M_=25,_d=800,T_=1500,xd=e=>Number.parseFloat(e)||0,Un={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=Ps(),[n,i]=(0,fr.useState)("m"),[o,l]=(0,fr.useState)(""),[c,p]=(0,fr.useState)(""),[f,b]=(0,fr.useState)(""),[d,h]=(0,fr.useState)("concrete"),[w,M]=(0,fr.useState)("mot"),[D,m]=(0,fr.useState)(!1),[u,g]=(0,fr.useState)(null),v=n==="m"?1:.3048,N=xd(o)*v*xd(c)*v*xd(f)*(n==="m"?.01:.0254),A=Un[w],T=N*q_/7,z=T*E_,Q=T*2,K=T*4,fe=Math.ceil(z/M_),Te=Math.ceil(Q*Un["sharp-sand"].density*1e3/_d),Ye=Math.ceil(K*Un.gravel.density*1e3/_d),Ve=Math.ceil(N*A.density*1e3/_d),it=d==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:fe,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Te,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:Ye,productId:"6001004"}]:[{key:w,label:`${A.label} Bulk Bag (800kg)`,qty:Ve,productId:A.productId}],pe=()=>{if(t){t(it.map(ce=>({key:ce.key,label:ce.label,qty:ce.qty,unit:"each",query:ce.productId})));return}G()},G=async()=>{let ce=Date.now();m(!0),g(null);try{let xe=await Promise.all(it.map(async ee=>{let se=(await Pr(ee.productId)).find(Me=>Me.product_id===ee.productId);if(!se)throw new Error(`${ee.label} is no longer available in this catalogue.`);return Kr(se,{lineId:`concrete-aggregate:${ee.key}`,description:ee.label,unit:"bag",qty:ee.qty})})),ye=T_-(Date.now()-ce);ye>0&&await new Promise(ee=>window.setTimeout(ee,ye)),r?.clearCart(),r?.addManyToCart(xe),r?.openBasket()}catch(xe){g(xe instanceof Error?xe.message:"Could not add the products to your basket.")}finally{m(!1)}};return D?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Your Materials"}),(0,$.jsx)("p",{children:"Calculating quantities from the Concrete & Aggregate Calculator."})]}),(0,$.jsx)("div",{className:"truss-estimator__card",children:(0,$.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,$.jsx)(dr,{}),(0,$.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Concrete & Aggregate Calculator"}),(0,$.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,$.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,$.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,$.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,$.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${d==="concrete"?" is-selected":""}`,onClick:()=>h("concrete"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${d==="aggregate"?" is-selected":""}`,onClick:()=>h("aggregate"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),d==="aggregate"&&(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,$.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Un).map(ce=>(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${w===ce?" is-selected":""}`,onClick:()=>M(ce),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:Un[ce].label}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:Un[ce].blurb})]},ce))})]}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,$.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,$.jsx)("span",{children:"Units"}),(0,$.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,$.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metric"}),(0,$.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Imperial"})]})]}),(0,$.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Length (",n,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:ce=>l(ce.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Width (",n,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:ce=>p(ce.target.value)})]})]}),(0,$.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,$.jsxs)("span",{children:["Depth (",n==="m"?"cm":"inches",")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.1",value:f,onChange:ce=>b(ce.target.value)})]})]}),(0,$.jsxs)("div",{className:"materials-calculator__totals",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,$.jsx)("div",{className:"materials-calculator__result-grid",children:d==="concrete"?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Cement"}),(0,$.jsxs)("strong",{children:[z.toFixed(0)," kg"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Sharp sand"}),(0,$.jsxs)("strong",{children:[Q.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"20mm aggregate"}),(0,$.jsxs)("strong",{children:[K.toFixed(2)," m\xB3"]})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:A.label}),(0,$.jsxs)("strong",{children:[N.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Approx. weight"}),(0,$.jsxs)("strong",{children:[(N*A.density).toFixed(2)," t"]})]}),(0,$.jsx)("div",{})]})}),(0,$.jsx)("p",{className:"materials-calculator__note",children:d==="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."})]}),u&&(0,$.jsx)("p",{className:"results-empty-hint estimator-products__error",children:u}),(0,$.jsxs)("div",{className:"materials-calculator__actions",children:[(0,$.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,$.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:pe,disabled:N<=0||D,children:D?"Adding products\u2026":a})]})]})]})})}var Ya=Y(Xe());var U=Y(ae()),Dn=12,Bn=8,Ws=.56,dw=.21,Sa={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:{lengthM:2.4,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}]}},Si=["range","grid","pictureFrame","substructure"],z_={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:""}},ec=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),tc=(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),A_=(e,t,a,r)=>{let n=ec(e,t,a),i=ec(e,t,r),o=ec(a,r,e),l=ec(a,r,t);return n===0&&tc(e,t,a)||i===0&&tc(e,t,r)||o===0&&tc(a,r,e)||l===0&&tc(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},Nd=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let n=e[(r+1)%e.length];for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&A_(e[r],n,e[i],e[(i+1)%e.length]))return!0}return!1};function Sd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ya.useState)(0),[i,o]=(0,Ya.useState)(z_),[l,c]=(0,Ya.useState)(1),[p,f]=(0,Ya.useState)({x:0,y:0}),[b,d]=(0,Ya.useState)(null),h=(0,Ya.useRef)(null),w=(0,Ya.useRef)(null),M=(0,Ya.useRef)(null),D=Si[r],m=i.range?Sa.ranges[i.range]:null,u=Dn/l,g=Bn/l,v=(Dn-u)/2,N=(Bn-g)/2,A=Math.max(-Dn,Math.min(Dn*2-u,v+p.x)),T=Math.max(-Bn,Math.min(Bn*2-g,N+p.y)),z=Number.parseFloat(i.quickLengthM),Q=Number.parseFloat(i.quickWidthM),K=z>0&&Q>0,fe=E=>Math.abs(E.reduce((x,R,I)=>{let ue=E[(I+1)%E.length];return x+R.x*ue.y-ue.x*R.y},0))/2,Te=(E,x)=>Math.hypot(x.x-E.x,x.y-E.y),Ye=i.isOutlineClosed?fe(i.points):0,Ve=i.isOutlineClosed?i.points.reduce((E,x,R)=>E+Te(x,i.points[(R+1)%i.points.length]),0):0,it=i.isOutlineClosed?i.points.reduce((E,x,R)=>E+(i.wallSegments.has(R)?0:Te(x,i.points[(R+1)%i.points.length])),0):0,pe=i.points.reduce((E,x)=>({x:E.x+x.x/i.points.length,y:E.y+x.y/i.points.length}),{x:0,y:0}),G=i.points.length>1?(()=>{let E=i.points[0],x=i.points[1],R=Te(E,x),I=R?-(x.y-E.y)/R:0,ue=R?(x.x-E.x)/R:0,ve=(E.x+x.x)/2,Se=(E.y+x.y)/2,k=I*(ve-pe.x)+ue*(Se-pe.y)>=0?1:-1;return{x:ve+I*Ws*k,y:Se+ue*Ws*k}})():null,xe=(()=>{let E=i.range?Sa.ranges[i.range]:Sa.ranges.meridian,x=i.deckSizeMode==="quick"?z*Q:Ye,R=i.deckSizeMode==="quick"?2*(z+Q):it,I=i.direction==="diagonal"?Sa.wastage.diagonal:Sa.wastage.straight,ue=i.pictureFrame==="yes"?Sa.pictureFrame.extraWastage:0,Se=x/(E.boardWidthM+Sa.boardGapM)/E.boardLengthM,k=Math.ceil(Se*(1+I+ue)),j=Math.ceil(x*30*(1+I+ue)/200),O=Sa.joist.spacingOptions.find(C=>C.id===i.joistSpacing)??Sa.joist.spacingOptions[1],ne=x/O.spacingM,W=Math.ceil(ne/Sa.joist.lengthM);return{range:E,area:x,boardCount:k,screwBoxes:j,joistLengthsNeeded:W,spacing:O}})(),ye=xe?[{key:`boards-${i.range??"meridian"}`,label:`Deck boards (${xe.range.label})`,qty:xe.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:xe.joistLengthsNeeded,unit:"each",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:xe.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],ee=()=>D==="range"?!!i.range:D==="grid"?i.deckSizeMode==="quick"?K:i.isOutlineClosed&&Ye>0:D==="pictureFrame"?!!i.pictureFrame&&!!i.direction:D==="substructure"?!!i.joistSpacing:!0,se=r===Si.length-1?a:"Next",Me=(E,x,R=!1)=>{let I=M.current?.getBoundingClientRect();if(!I)return null;let ue=R?1:.25;return{x:Math.round(Math.max(A,Math.min(A+u,A+(E-I.left)/I.width*u))/ue)*ue,y:Math.round(Math.max(T,Math.min(T+g,T+(x-I.top)/I.height*g))/ue)*ue}},_e=E=>{if(i.isOutlineClosed){let R=E.target;if(R!==E.currentTarget&&!R.classList.contains("deck-outline__grid"))return;w.current={startX:E.clientX,startY:E.clientY,startViewX:A,startViewY:T},E.currentTarget.setPointerCapture(E.pointerId);return}if(i.drawMode!=="outline")return;let x=Me(E.clientX,E.clientY,!0);x&&(d(null),o(R=>{let I=[...R.points,x];return Nd(I,!1)?{...R,drawError:"Edges cannot cross. Choose another corner."}:{...R,points:I,drawError:""}}))},et=(E,x)=>{if(!i.isOutlineClosed){E.stopPropagation(),x===0&&i.points.length>=3&&o(R=>({...R,isOutlineClosed:!0,drawMode:"edges"}));return}E.stopPropagation(),h.current=x,E.currentTarget.setPointerCapture(E.pointerId)},Ht=E=>{if(w.current){let I=M.current?.getBoundingClientRect();if(!I)return;let ue=w.current,ve=ue.startViewX-(E.clientX-ue.startX)/I.width*u,Se=ue.startViewY-(E.clientY-ue.startY)/I.height*g;f({x:ve-v,y:Se-N});return}!i.isOutlineClosed&&i.drawMode==="outline"&&d(Me(E.clientX,E.clientY,!0));let x=h.current;if(x===null)return;let R=Me(E.clientX,E.clientY);R&&o(I=>{let ue=I.points.map((ve,Se)=>Se===x?R:ve);return Nd(ue,!0)?{...I,drawError:"Edges cannot cross. Move the corner to a different position."}:{...I,points:ue,drawError:""}})},Tt=E=>{w.current=null,h.current=null,E.currentTarget.hasPointerCapture(E.pointerId)&&E.currentTarget.releasePointerCapture(E.pointerId)},tt=E=>{o(x=>{let R=new Set(x.wallSegments);return R.has(E)?R.delete(E):R.add(E),{...x,wallSegments:R}})},ct=()=>{r===0?e():n(E=>E-1)},He=()=>{ee()&&(r===Si.length-1?t?.(ye):n(E=>E+1))};return(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)("div",{className:"truss-estimator",children:[(0,U.jsxs)("div",{className:"quick-order-hero",children:[(0,U.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,U.jsx)("h1",{children:"Decking Calculator"}),(0,U.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,U.jsxs)("div",{className:"truss-estimator__card",children:[(0,U.jsxs)("div",{className:"truss-estimator__body",children:[D==="range"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.ranges).map(([E,x])=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===E?" is-selected":""}`,onClick:()=>o(R=>({...R,range:E})),children:[(0,U.jsx)("div",{className:"truss-estimator__option-title",children:x.label}),(0,U.jsx)("div",{className:"truss-estimator__option-copy",children:x.blurb}),(0,U.jsxs)("div",{className:"truss-estimator__option-copy",children:[x.boardLengthM,"m boards"]})]},E))})]}):null,D==="grid"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,U.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,U.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(E=>({...E,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(E=>({...E,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),i.deckSizeMode==="quick"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Length (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickLengthM,onChange:E=>o(x=>({...x,quickLengthM:E.target.value}))})]}),(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Width (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickWidthM,onChange:E=>o(x=>({...x,quickWidthM:E.target.value}))})]})]}),(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),K?(0,U.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,U.jsxs)("div",{children:[(z*Q).toFixed(2)," m\xB2 deck"]}),(0,U.jsxs)("div",{children:[(2*(z+Q)).toFixed(2)," m perimeter"]})]}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,U.jsxs)("div",{className:"deck-outline__toolbar",children:[i.isOutlineClosed?(0,U.jsxs)("div",{className:"deck-outline__summary",children:[(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Deck area"}),(0,U.jsxs)("strong",{children:[Ye.toFixed(2)," m\xB2"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Perimeter"}),(0,U.jsxs)("strong",{children:[Ve.toFixed(2)," m"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Wall edges"}),(0,U.jsx)("strong",{children:i.wallSegments.size>0?i.wallSegments.size:"None"})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Visible edge"}),(0,U.jsxs)("strong",{children:[it.toFixed(2)," m"]})]})]}):null,(0,U.jsxs)("div",{className:"deck-outline__actions",children:[(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(E=>({...E,points:E.points.slice(0,-1)})),disabled:i.points.length===0||i.isOutlineClosed,children:"Undo"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d(null),o(E=>({...E,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:i.points.length===0,children:"Clear"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(E=>({...E,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,U.jsx)("div",{className:"deck-editor-layout",children:(0,U.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,U.jsxs)("div",{className:"deck-outline",children:[(0,U.jsxs)("svg",{ref:M,className:`deck-outline__canvas${i.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${A} ${T} ${u} ${g}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:_e,onPointerMove:Ht,onPointerUp:Tt,onPointerLeave:()=>{d(null),w.current||(h.current=null)},children:[(0,U.jsx)("defs",{children:(0,U.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,U.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,U.jsx)("rect",{x:-Dn,y:-Bn,width:Dn*3,height:Bn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),i.points.length>1?(0,U.jsx)("polyline",{className:"deck-outline__preview",points:i.points.map(E=>`${E.x},${E.y}`).join(" ")}):null,i.isOutlineClosed?(0,U.jsx)("polygon",{className:"deck-outline__shape",points:i.points.map(E=>`${E.x},${E.y}`).join(" "),stroke:"none"}):null,i.points.length>1?i.points.slice(0,i.isOutlineClosed?void 0:-1).map((E,x)=>{let R=i.points[i.isOutlineClosed?(x+1)%i.points.length:x+1],I=Te(E,R),ue=I?-(R.y-E.y)/I:0,ve=I?(R.x-E.x)/I:0,Se=(E.x+R.x)/2,k=(E.y+R.y)/2,j=ue*(Se-pe.x)+ve*(k-pe.y)>=0?1:-1,O=Se+ue*Ws*j,ne=k+ve*Ws*j;return(0,U.jsxs)("g",{children:[(0,U.jsx)("line",{className:"deck-outline__edge-hit",x1:E.x,y1:E.y,x2:R.x,y2:R.y,onClick:i.isOutlineClosed?()=>tt(x):void 0}),(0,U.jsx)("line",{className:`deck-outline__edge${i.wallSegments.has(x)?" is-wall":""}`,x1:E.x,y1:E.y,x2:R.x,y2:R.y,pointerEvents:"none"}),(0,U.jsxs)("text",{className:`deck-outline__edge-label${i.wallSegments.has(x)?" is-wall":""}`,x:O,y:ne,textAnchor:"middle",dominantBaseline:"central",fontSize:dw/l,children:[I.toFixed(2)," m"]})]},`segment-${x}`)}):null,!i.isOutlineClosed&&i.points.length>0&&b?(()=>{let E=i.points[i.points.length-1],x=Te(E,b);if(!x)return null;let R=-(b.y-E.y)/x,I=(b.x-E.x)/x,ue=(E.x+b.x)/2,ve=(E.y+b.y)/2;return(0,U.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,U.jsx)("line",{x1:E.x,y1:E.y,x2:b.x,y2:b.y}),(0,U.jsxs)("text",{x:ue+R*.34,y:ve+I*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:dw/l,children:[x.toFixed(2)," m"]})]})})():null,i.points.map((E,x)=>(0,U.jsx)("circle",{className:"deck-outline__point",cx:E.x,cy:E.y,r:"0.13",onPointerDown:R=>et(R,x)},`point-${x}`))]}),(0,U.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,U.jsx)("button",{type:"button",onClick:()=>c(E=>Math.max(.5,E-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,U.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,U.jsx)("button",{type:"button",onClick:()=>c(E=>Math.min(1,E+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),i.isOutlineClosed&&i.wallSegments.size===0&&G?(0,U.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(G.x-A)/u*100}%`,top:`${(G.y-T)/g*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!i.isOutlineClosed&&i.points.length>=3?(0,U.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(E=>Nd(E.points,!0)?{...E,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...E,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,U.jsxs)("div",{className:"deck-outline__supporting",children:[(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:i.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),i.drawError?(0,U.jsx)("div",{className:"deck-outline__error",role:"alert",children:i.drawError}):null]})]})})]})]}):null,D==="pictureFrame"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,U.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,U.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(E=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.pictureFrame===E.id?" is-selected":""}`,onClick:()=>o(x=>({...x,pictureFrame:E.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:Kt(E.img),alt:""}),(0,U.jsx)("span",{children:E.label})]},E.id))}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,U.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(E=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.direction===E.id?" is-selected":""}`,onClick:()=>o(x=>({...x,direction:E.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:Kt(E.img),alt:""}),(0,U.jsx)("span",{children:E.label})]},E.id))})]})]}):null,D==="substructure"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,U.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,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Sa.joist.spacingOptions.map(E=>(0,U.jsx)("button",{type:"button",className:`truss-estimator__option-card${i.joistSpacing===E.id?" is-selected":""}`,onClick:()=>o(x=>({...x,joistSpacing:E.id})),children:(0,U.jsx)("div",{className:"truss-estimator__option-title",children:E.label})},E.id))})]}):null]}),(0,U.jsxs)("div",{className:"truss-estimator__nav",children:[(0,U.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ct,children:"Back"}),(0,U.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:He,disabled:!ee(),children:[(0,U.jsx)("span",{children:se}),(0,U.jsx)("span",{className:"arrow",children:(0,U.jsx)(Ot,{})})]})]})]})]})})}var qa=Y(Xe());var H=Y(ae()),mw=12,fw=30,On=12,Ln=8,gw=.56,Ca={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 lap 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}}},Ci=["range","height","gate","posts"],R_={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:""}},ac=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),rc=(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),U_=(e,t,a,r)=>{let n=ac(e,t,a),i=ac(e,t,r),o=ac(a,r,e),l=ac(a,r,t);return n===0&&rc(e,t,a)||i===0&&rc(e,t,r)||o===0&&rc(a,r,e)||l===0&&rc(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},ic=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&U_(e[r],e[(r+1)%e.length],e[n],e[(n+1)%e.length]))return!0;return!1};function Cd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,qa.useState)(0),[i,o]=(0,qa.useState)(R_),l=(0,qa.useRef)(null),c=(0,qa.useRef)(null),[p,f]=(0,qa.useState)(1),[b,d]=(0,qa.useState)({x:0,y:0}),[h,w]=(0,qa.useState)(null),M=(0,qa.useRef)(null),D=(0,qa.useRef)(null),m=(0,qa.useRef)(null),u=Ci[r],g=i.range?Ca.ranges[i.range]:null,v=On/p,N=Ln/p,A=(On-v)/2,T=(Ln-N)/2,z=Math.max(-On,Math.min(On*2-v,A+b.x)),Q=Math.max(-Ln,Math.min(Ln*2-N,T+b.y)),K=i.boundaryPoints.reduce((k,j)=>({x:k.x+j.x/Math.max(1,i.boundaryPoints.length),y:k.y+j.y/Math.max(1,i.boundaryPoints.length)}),{x:0,y:0}),fe=k=>{let j=new Set,O=[];return k.forEach(ne=>{let[W,C]=ne.split(",").map(Number),V=[{key:`H,${W},${C}`,type:"H",x:W,y:C},{key:`H,${W},${C+1}`,type:"H",x:W,y:C+1},{key:`V,${W},${C}`,type:"V",x:W,y:C},{key:`V,${W+1},${C}`,type:"V",x:W+1,y:C}],X=[!k.has(`${W},${C-1}`),!k.has(`${W},${C+1}`),!k.has(`${W-1},${C}`),!k.has(`${W+1},${C}`)];V.forEach((me,Ce)=>{X[Ce]&&!j.has(me.key)&&(j.add(me.key),O.push(me))})}),O},Te=(k,j)=>fe(k).filter(O=>!j.has(O.key)),Ye=(k,j)=>Te(k,j).length,Ve=(k,j)=>{let O={};Te(k,j).forEach(W=>{var C,V,X,me;W.type==="H"?((O[C=`${W.x},${W.y}`]||(O[C]=[])).push("H"),(O[V=`${W.x+1},${W.y}`]||(O[V]=[])).push("H")):((O[X=`${W.x},${W.y}`]||(O[X]=[])).push("V"),(O[me=`${W.x},${W.y+1}`]||(O[me]=[])).push("V"))});let ne=0;return Object.values(O).forEach(W=>{(W.length===1||W.length===2&&W[0]!==W[1]||W.length>=3)&&(ne+=1)}),ne},pe=(()=>{let k=i.range?Ca.ranges[i.range]:Ca.ranges.boundary,j=i.height??"1.8",O=i.boundaryMode==="quick"?Math.max(0,Number.parseFloat(i.quickLengthM)||0):i.boundaryClosed?i.boundaryPoints.slice(0,-1).reduce((hr,Pt,Ft)=>hr+(i.excludedBoundaryEdges.has(Ft)?0:Math.hypot(i.boundaryPoints[Ft+1].x-Pt.x,i.boundaryPoints[Ft+1].y-Pt.y)),0):0,ne=i.gateType&&i.gateType!=="none"?Number.parseFloat(i.gateWidthM)||Ca.gate[i.gateType].widthDefault:0,W=Math.max(0,O-ne),C=W>0?Math.ceil(W/k.panelWidthM):0,V=i.boundaryPoints.length>2&&i.boundaryPoints[0].x===i.boundaryPoints[i.boundaryPoints.length-1].x&&i.boundaryPoints[0].y===i.boundaryPoints[i.boundaryPoints.length-1].y,X=i.boundaryMode==="quick"?W>0?2:0:i.boundaryClosed?i.boundaryPoints.slice(0,V?-1:void 0).reduce((hr,Pt,Ft)=>{let Yd=Ft>0&&!i.excludedBoundaryEdges.has(Ft-1),Vd=Ft<i.boundaryPoints.length-1&&!i.excludedBoundaryEdges.has(Ft);return hr+(Yd||Vd?1:0)},0):0,me=W>0?Math.ceil(W/k.panelWidthM)+1:0,Ce=Math.max(0,me-X),dt=i.mountingType?Ca.mounting[i.mountingType]:Ca.mounting.concrete,je=i.gateType&&i.gateType!=="none"?2:0,Fr=Ce+X+je,Ir=i.mountingType==="postcrete"?Fr*Ca.mounting.postcrete.bagsPerPost:0,ll=i.gravelBoard==="yes"?C:0;return{range:k,height:j,totalEdgeM:O,fencedLengthM:W,gateWidthM:ne,panelsCount:C,cornerPostCount:X,intermediatePostCount:Ce,gatePostCount:je,totalPostCount:Fr,bagsCount:Ir,gravelCount:ll,capCount:Fr,mounting:dt}})(),G=i.gateType&&i.gateType!=="none"?Ca.gate[i.gateType].label:null,ce=Number(pe.height)<=1.2?"6":"8",xe=pe?[{key:`panels-${i.range??"boundary"}-${pe.height}`,label:`${pe.range.label} panels (${pe.height}m)`,qty:pe.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...i.mountingType==="concrete"?[{key:`concrete-intermediate-${ce}`,label:"Intermediate concrete posts",qty:pe.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ce}`,label:"End and corner concrete posts",qty:pe.cornerPostCount+pe.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ce}`,label:"Timber fence posts",qty:pe.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:pe.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...G?[{key:"gate",label:G,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...pe.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:pe.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],ye=()=>{if(u==="range"){let k=i.boundaryMode==="quick"?(Number.parseFloat(i.quickLengthM)||0)>0:i.boundaryClosed&&i.boundaryPoints.length>=2;return!!i.range&&k}return u==="height"?!!i.height&&!!i.gravelBoard:u==="gate"?!!i.gateType&&(i.gateType==="none"||i.gateWidthM.trim()!==""):u==="posts"?!!i.mountingType:!0},ee=r===Ci.length-1?a:"Next",se=k=>{o(j=>{let O=k(new Set(j.grid)),ne=new Set([...j.excludedEdges].filter(W=>fe(O).some(C=>C.key===W)));return{...j,grid:O,excludedEdges:ne}})},Me=(k,j,O)=>{se(ne=>{let W=`${k},${j}`;return O?ne.add(W):ne.delete(W),ne})},_e=(k,j,O,ne,W)=>{let C=k,V=j,X=Math.abs(O-k),me=k<O?1:-1,Ce=-Math.abs(ne-j),dt=j<ne?1:-1,je=X+Ce;for(;Me(C,V,W),!(C===O&&V===ne);){let Fr=2*je;Fr>=Ce&&(je+=Ce,C+=me),Fr<=X&&(je+=X,V+=dt)}},et=(k,j)=>{let O=c.current?.getBoundingClientRect();if(!O)return null;let ne=Math.floor((k-O.left)/fw),W=Math.floor((j-O.top)/fw);return ne<0||W<0||ne>=mw||W>=mw?null:{x:ne,y:W}},Ht=k=>{if(i.gridMode!=="draw")return;let j=et(k.clientX,k.clientY);if(!j)return;k.preventDefault();let O=`${j.x},${j.y}`,ne=!i.grid.has(O);l.current={active:!0,paintValue:ne,lastX:j.x,lastY:j.y},k.currentTarget.setPointerCapture(k.pointerId),Me(j.x,j.y,ne)},Tt=k=>{let j=l.current;if(!j?.active)return;let O=et(k.clientX,k.clientY);O&&(O.x===j.lastX&&O.y===j.lastY||(_e(j.lastX,j.lastY,O.x,O.y,j.paintValue),l.current={...j,lastX:O.x,lastY:O.y}))},tt=k=>{l.current?.active&&(l.current=null,k.currentTarget.releasePointerCapture(k.pointerId))},ct=(k,j,O=!1)=>{let ne=m.current?.getBoundingClientRect();if(!ne)return null;let W=O?1:.25;return{x:Math.round(Math.max(z,Math.min(z+v,z+(k-ne.left)/ne.width*v))/W)*W,y:Math.round(Math.max(Q,Math.min(Q+N,Q+(j-ne.top)/ne.height*N))/W)*W}},He=k=>{if(i.boundaryClosed){let O=k.target;if(O!==k.currentTarget&&!O.classList.contains("fence-boundary__grid"))return;D.current={startX:k.clientX,startY:k.clientY,startViewX:z,startViewY:Q},k.currentTarget.setPointerCapture(k.pointerId);return}let j=ct(k.clientX,k.clientY,!0);j&&(w(null),o(O=>{let ne=[...O.boundaryPoints,j];return ic(ne,!1)?{...O}:{...O,boundaryPoints:ne}}))},E=(k,j)=>{if(k.stopPropagation(),!i.boundaryClosed){if(j!==0||i.boundaryPoints.length<3)return;o(O=>ic(O.boundaryPoints,!0)?O:{...O,boundaryPoints:[...O.boundaryPoints,O.boundaryPoints[0]],boundaryClosed:!0});return}M.current=j,k.currentTarget.setPointerCapture(k.pointerId)},x=k=>{if(D.current){let O=m.current?.getBoundingClientRect();if(!O)return;let ne=D.current,W=ne.startViewX-(k.clientX-ne.startX)/O.width*v,C=ne.startViewY-(k.clientY-ne.startY)/O.height*N;d({x:W-A,y:C-T});return}if(i.boundaryClosed||w(ct(k.clientX,k.clientY,!0)),M.current===null)return;let j=ct(k.clientX,k.clientY);j&&o(O=>{let ne=O.boundaryPoints.length>2&&O.boundaryPoints[0].x===O.boundaryPoints[O.boundaryPoints.length-1].x&&O.boundaryPoints[0].y===O.boundaryPoints[O.boundaryPoints.length-1].y,W=O.boundaryPoints.map((C,V)=>{let X=V===M.current,me=ne&&M.current===0&&V===O.boundaryPoints.length-1;return X||me?j:C});return ic(W,!1)?O:{...O,boundaryPoints:W}})},R=k=>{D.current=null,M.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},I=k=>{o(j=>{let O=new Set(j.excludedBoundaryEdges);return O.has(k)?O.delete(k):O.add(k),{...j,excludedBoundaryEdges:O}})},ue=()=>{r===0?e():n(k=>k-1)},ve=()=>{ye()&&(r===Ci.length-1?t?.(xe):n(k=>k+1))},Se=fe(i.grid);return(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)("div",{className:"truss-estimator",children:[(0,H.jsxs)("div",{className:"quick-order-hero",children:[(0,H.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,H.jsx)("h1",{children:"Fencing Calculator"}),(0,H.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,H.jsxs)("div",{className:"truss-estimator__card",children:[(0,H.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,H.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,H.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Ca.ranges).map(([k,j])=>(0,H.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===k?" is-selected":""}`,onClick:()=>o(O=>({...O,range:k})),children:[(0,H.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,H.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},k))})]}):null,u==="range"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,H.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,H.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,H.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"quick"})),children:"Quick estimate"}),(0,H.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"draw"})),children:"Draw your boundary"})]}),i.boundaryMode==="quick"?(0,H.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,H.jsx)("span",{children:"Total fence length (m)"}),(0,H.jsx)("input",{type:"number",min:"0",step:"0.1",value:i.quickLengthM,onChange:k=>o(j=>({...j,quickLengthM:k.target.value}))})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{className:"fence-boundary__toolbar",children:(0,H.jsxs)("div",{className:"fence-boundary__actions",children:[(0,H.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,boundaryPoints:k.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:i.boundaryPoints.length===0||i.boundaryClosed,children:"Undo"}),(0,H.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d({x:0,y:0}),w(null),o(k=>({...k,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:i.boundaryPoints.length===0,children:"Clear"}),(0,H.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,H.jsxs)("div",{className:"fence-boundary",children:[(0,H.jsxs)("svg",{ref:m,className:`fence-boundary__canvas${i.boundaryClosed?" is-pan-mode":""}`,viewBox:`${z} ${Q} ${v} ${N}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:He,onPointerMove:x,onPointerUp:R,onPointerLeave:()=>{w(null),D.current||(M.current=null)},children:[(0,H.jsx)("defs",{children:(0,H.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,H.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,H.jsx)("rect",{x:-On,y:-Ln,width:On*3,height:Ln*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),i.boundaryPoints.length>1?(0,H.jsx)("polyline",{className:"fence-boundary__preview",points:i.boundaryPoints.map(k=>`${k.x},${k.y}`).join(" ")}):null,i.boundaryPoints.length>1?i.boundaryPoints.slice(0,-1).map((k,j)=>{let O=i.boundaryPoints[j+1],ne=Math.hypot(O.x-k.x,O.y-k.y),W=ne?-(O.y-k.y)/ne:0,C=ne?(O.x-k.x)/ne:0,V=(k.x+O.x)/2,X=(k.y+O.y)/2,me=W*(V-K.x)+C*(X-K.y)>=0?1:-1,Ce=V+W*gw*me,dt=X+C*gw*me;return(0,H.jsxs)("g",{children:[(0,H.jsx)("line",{className:"fence-boundary__edge-hit",x1:k.x,y1:k.y,x2:O.x,y2:O.y,onClick:i.boundaryClosed?()=>I(j):void 0}),(0,H.jsx)("line",{className:`fence-boundary__edge${i.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x1:k.x,y1:k.y,x2:O.x,y2:O.y,pointerEvents:"none"}),(0,H.jsxs)("text",{className:`fence-boundary__edge-label${i.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x:Ce,y:dt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[ne.toFixed(2)," m"]})]},`fence-edge-${j}`)}):null,!i.boundaryClosed&&i.boundaryPoints.length>0&&h?(()=>{let k=i.boundaryPoints[i.boundaryPoints.length-1],j=Math.hypot(h.x-k.x,h.y-k.y);if(!j)return null;let O=-(h.y-k.y)/j,ne=(h.x-k.x)/j,W=(k.x+h.x)/2,C=(k.y+h.y)/2;return(0,H.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,H.jsx)("line",{x1:k.x,y1:k.y,x2:h.x,y2:h.y}),(0,H.jsxs)("text",{x:W+O*.34,y:C+ne*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[j.toFixed(2)," m"]})]})})():null,i.boundaryPoints.map((k,j)=>j>0&&j===i.boundaryPoints.length-1&&k.x===i.boundaryPoints[0]?.x&&k.y===i.boundaryPoints[0]?.y?null:(0,H.jsx)("circle",{className:`fence-boundary__point${!i.boundaryClosed&&j===0&&i.boundaryPoints.length>=3?" is-close-target":""}`,cx:k.x,cy:k.y,r:"0.13",onPointerDown:O=>E(O,j)},`fence-point-${j}`))]}),(0,H.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,H.jsx)("button",{type:"button",onClick:()=>f(k=>Math.max(.5,k-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,H.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,H.jsx)("button",{type:"button",onClick:()=>f(k=>Math.min(1,k+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!i.boundaryClosed&&i.boundaryPoints.length>=2?(0,H.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(k=>ic(k.boundaryPoints,!1)?k:{...k,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,H.jsx)("div",{className:"truss-estimator__grid-hint",children:i.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,H.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,H.jsx)("div",{children:i.boundaryMode==="quick"?`${(Number.parseFloat(i.quickLengthM)||0).toFixed(2)} m fence line`:`${pe.totalEdgeM.toFixed(2)} m fence line`}),i.boundaryMode==="draw"&&i.boundaryClosed?(0,H.jsxs)("div",{children:[pe.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,H.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,H.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Ca.heights.map(k=>(0,H.jsx)("button",{type:"button",className:`truss-estimator__visual-card${i.height===k?" is-selected":""}`,onClick:()=>o(j=>({...j,height:k})),children:(0,H.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:Kt(`/fencing/height/${k}.webp`),alt:""})},k))}),(0,H.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,H.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,H.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.gravelBoard===k.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gravelBoard:k.id})),children:[(0,H.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Kt(k.img),alt:""}),(0,H.jsx)("span",{children:k.label})]},k.id))})]}):null,u==="gate"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,H.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,H.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,H.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${i.gateType===k.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gateType:k.id,gateWidthM:k.id==="none"?"":String(Ca.gate[k.id].widthDefault)})),children:[(0,H.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Kt(k.img),alt:""}),(0,H.jsx)("span",{children:k.label})]},k.id))}),i.gateType&&i.gateType!=="none"?(0,H.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,H.jsx)("span",{children:"Gate width (m)"}),(0,H.jsx)("input",{type:"text",inputMode:"decimal",value:i.gateWidthM,onChange:k=>o(j=>({...j,gateWidthM:k.target.value}))})]}):null]}):null,u==="posts"?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ci.length]}),(0,H.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,H.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,H.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Ca.mounting).map(([k,j])=>(0,H.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.mountingType===k?" is-selected":""}`,onClick:()=>o(O=>({...O,mountingType:k})),children:[(0,H.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,H.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},k))})]}):null]}),(0,H.jsxs)("div",{className:"truss-estimator__nav",children:[(0,H.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ue,children:"Back"}),(0,H.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:ve,disabled:!ye(),children:[(0,H.jsx)("span",{children:ee}),(0,H.jsx)("span",{className:"arrow",children:(0,H.jsx)(Ot,{})})]})]})]})]})})}var nc=Y(Xe()),be=Y(ae()),hw={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack"},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll"}};function qd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,nc.useState)("floor"),[i,o]=(0,nc.useState)(""),[l,c]=(0,nc.useState)(""),p=Number.parseFloat(i)*Number.parseFloat(l)||0,f=hw[r],b=Math.ceil(p/f.coverage),d=[{key:`insulation-${r}`,label:`${f.product} ${f.thickness}`,qty:b,unit:f.salesUnit,query:f.product,category:"insulation"}],h=Object.entries(hw);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:h.map(([w,M])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>n(w),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:M.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[M.product,", ",M.thickness]})]},w))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:w=>o(w.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:f.product}),(0,be.jsxs)("strong",{children:[b," packs"]})]})]}),(0,be.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,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(d),disabled:p<=0,children:a})]})]})]})})}var Hn=Y(Xe()),Z=Y(ae()),D_=10,B_=1.9*.762,O_=1.9*1.524,oc=()=>({height:"",width:""}),lc=e=>Number.parseFloat(e)||0,bw=({height:e,width:t})=>lc(e)*lc(t);function Ed({onBack:e}){let[t,a]=(0,Hn.useState)([oc()]),[r,n]=(0,Hn.useState)([oc()]),[i,o]=(0,Hn.useState)("0"),[l,c]=(0,Hn.useState)("0"),[p,f]=(0,Hn.useState)(1),b=t.reduce((m,u)=>m+bw(u),0),d=r.reduce((m,u)=>m+bw(u),0),h=lc(i)*B_+lc(l)*O_,w=Math.max(0,b-d-h),M=w*p/D_,D=(m,u,g,v)=>{m(N=>N.map((A,T)=>T===u?{...A,[g]:v}:A))};return(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)("div",{className:"truss-estimator",children:[(0,Z.jsxs)("div",{className:"quick-order-hero",children:[(0,Z.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Z.jsx)("h1",{children:"Paint Calculator"}),(0,Z.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,Z.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,Z.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,Z.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,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),t.map((m,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:m.height,onChange:g=>D(a,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:m.width,onChange:g=>D(a,u,"width",g.target.value)})]}),t.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(g=>g.filter((v,N)=>N!==u)),children:"Remove"}):null]},`wall-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(m=>[...m,oc()]),children:"+ Add another wall"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),r.map((m,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:m.height,onChange:g=>D(n,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:m.width,onChange:g=>D(n,u,"width",g.target.value)})]}),r.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(g=>g.filter((v,N)=>N!==u)),children:"Remove"}):null]},`excluded-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(m=>[...m,oc()]),children:"+ Add another area"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,Z.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,Z.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:i,onChange:m=>o(m.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Double doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:m=>c(m.target.value)})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,Z.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,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Number of coats"}),(0,Z.jsxs)("select",{value:p,onChange:m=>f(Number(m.target.value)),children:[(0,Z.jsx)("option",{value:"1",children:"1 coat"}),(0,Z.jsx)("option",{value:"2",children:"2 coats"}),(0,Z.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__totals",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,Z.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paintable area"}),(0,Z.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Coverage"}),(0,Z.jsxs)("strong",{children:[p," ",p===1?"coat":"coats"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paint required"}),(0,Z.jsxs)("strong",{children:[M.toFixed(1)," litres"]})]})]}),(0,Z.jsx)("p",{className:"paint-calculator__note",children:"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,Z.jsxs)("div",{className:"paint-calculator__actions",children:[(0,Z.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,Z.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var gr=Y(Xe()),re=Y(ae()),sc=e=>Number.parseFloat(e)||0,Md={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 Td({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,gr.useState)("paving"),[i,o]=(0,gr.useState)("council"),[l,c]=(0,gr.useState)(""),[p,f]=(0,gr.useState)(""),[b,d]=(0,gr.useState)("100"),[h,w]=(0,gr.useState)("50"),[M,D]=(0,gr.useState)(!0),[m,u]=(0,gr.useState)(!0),g=sc(l)*sc(p),v=g,N=g*(sc(b)/1e3),A=g*.04,T=g*(sc(h)/1e3),z=Math.ceil(v/.36),Q=Math.ceil(v/.1),K=Math.ceil(N*1700/800),fe=Math.ceil(A*1600/800),Te=Math.ceil(T*1600/800),Ye=r==="paving"?{qty:z,unit:"each"}:r==="block"?{qty:v,unit:"m2"}:{qty:Te,unit:"bag"},Ve={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],it=[{key:`surface-${i}`,label:Md[r].find(G=>G.id===i)?.label??"Surface material",qty:Ye.qty,unit:Ye.unit,query:Ve,category:"landscaping"},...M?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:K,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...m?[{key:"bedding",label:"Sharp sand bedding",qty:fe,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];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:"Paving & Driveway Calculator"}),(0,re.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,re.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,re.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,re.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,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,re.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(([G,ce,xe])=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===G?" is-selected":""}`,onClick:()=>{n(G),o(Md[G][0].id)},children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:ce}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:xe})]},G))}),(0,re.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,re.jsx)("span",{children:"Finish"}),(0,re.jsx)("select",{value:i,onChange:G=>o(G.target.value),children:Md[r].map(G=>(0,re.jsx)("option",{value:G.id,children:G.label},G.id))})]})]}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,re.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,re.jsxs)("label",{className:"truss-estimator__field",children:[(0,re.jsx)("span",{children:"Length (m)"}),(0,re.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:G=>c(G.target.value)})]}),(0,re.jsxs)("label",{className:"truss-estimator__field",children:[(0,re.jsx)("span",{children:"Width (m)"}),(0,re.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:G=>f(G.target.value)})]})]}),r==="gravel"&&(0,re.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,re.jsx)("span",{children:"Gravel depth (mm)"}),(0,re.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:G=>w(G.target.value)})]}),M&&(0,re.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,re.jsx)("span",{children:"Sub-base depth (mm)"}),(0,re.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:G=>d(G.target.value)})]}),(0,re.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,re.jsx)("input",{type:"checkbox",checked:M,onChange:G=>D(G.target.checked)}),(0,re.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,re.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,re.jsx)("input",{type:"checkbox",checked:m,onChange:G=>u(G.target.checked)}),(0,re.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(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:"Surface area"}),(0,re.jsxs)("strong",{children:[g.toFixed(2)," m\xB2"]})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,re.jsx)("strong",{children:r==="paving"?`${z} slabs`:r==="block"?`${v.toFixed(2)} m\xB2`:`${Te} bulk bags`})]}),M&&(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"MOT Type 1"}),(0,re.jsxs)("strong",{children:[K," bulk bags"]})]}),m&&(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Sharp sand"}),(0,re.jsxs)("strong",{children:[fe," bulk bags"]})]})]}),(0,re.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern 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?.(it),disabled:g<=0,children:a})]})]})]})})}var il=Y(Xe()),ie=Y(ae()),L_=2.88,vw=[{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:""}),zd=e=>Number.parseFloat(e)||0;function Ad({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,il.useState)([ww()]),[i,o]=(0,il.useState)(""),[l,c]=(0,il.useState)("standard"),[p,f]=(0,il.useState)("screws"),b=r.reduce((A,T)=>A+zd(T.length)*zd(T.height),0),d=Math.max(0,b-zd(i)),h=Math.ceil(d/L_),w=Math.ceil(d*12),M=Math.ceil(w/1e3),D=Math.ceil(d*1.2),m=Math.ceil(D/90),u=Math.ceil(d/3.5),g=vw.find(A=>A.id===l)?.label??"Standard",v=[{key:"board",label:`${g} plasterboard`,qty:h,unit:"sheet",query:`${g} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:M,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:m,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],N=(A,T,z)=>{n(Q=>Q.map((K,fe)=>fe===A?{...K,[T]:z}:K))};return(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)("div",{className:"truss-estimator",children:[(0,ie.jsxs)("div",{className:"quick-order-hero",children:[(0,ie.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ie.jsx)("h1",{children:"Plasterboard & Drylining Calculator"}),(0,ie.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,ie.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ie.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,ie.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,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,ie.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:vw.map(A=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===A.id?" is-selected":""}`,onClick:()=>c(A.id),children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:A.label}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:A.blurb})]},A.id))})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,ie.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(([A,T,z])=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===A?" is-selected":""}`,onClick:()=>f(A),children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:T}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:z})]},A))})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,ie.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,ie.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,ie.jsx)("span",{children:"Surface"}),(0,ie.jsx)("span",{children:"Length (m)"}),(0,ie.jsx)("span",{children:"Height (m)"}),(0,ie.jsx)("span",{})]}),r.map((A,T)=>(0,ie.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,ie.jsxs)("span",{children:["Surface ",T+1]}),(0,ie.jsx)("input",{"aria-label":`Surface ${T+1} length`,type:"number",min:"0",step:"0.01",value:A.length,onChange:z=>N(T,"length",z.target.value)}),(0,ie.jsx)("input",{"aria-label":`Surface ${T+1} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:z=>N(T,"height",z.target.value)}),r.length>1?(0,ie.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(z=>z.filter((Q,K)=>K!==T)),children:"Remove"}):null]},`surface-${T}`)),(0,ie.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(A=>[...A,ww()]),children:"+ Add another surface"}),(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,ie.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,ie.jsx)("small",{children:"optional"})]}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:A=>o(A.target.value)})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ie.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Board area"}),(0,ie.jsxs)("strong",{children:[d.toFixed(2)," m\xB2"]})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,ie.jsx)("strong",{children:h})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,ie.jsx)("strong",{children:p==="screws"?`${w} (${M} boxes)`:`${u} bags`})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Joint tape"}),(0,ie.jsxs)("strong",{children:[D," m (",m," rolls)"]})]})]}),(0,ie.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,ie.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ie.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ie.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(v),disabled:d<=0,children:a})]})]})]})})}var nl=Y(Xe());var y=Y(ae()),Mt={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}}}},cc=["range","pitchAndDimensions","quantityAndGirders","bracing"],H_={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function j_({degrees:e}){let a=e*Math.PI/180,n=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,${n}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function Q_({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",n="#d3d8de",i="#7c8494",o=(f,b,d,h,w=8,M)=>{let D=d-f,m=h-b,u=Math.hypot(D,m)||1,g=-m/u,v=D/u,N=w*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:f,y1:b,x2:d,y2:h,stroke:a,strokeWidth:w+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f,y1:b,x2:d,y2:h,stroke:t,strokeWidth:w,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f-g*N,y1:b-v*N,x2:d-g*N,y2:h-v*N,stroke:r,strokeWidth:Math.max(1.5,w*.24),strokeLinecap:"round",opacity:"0.9"})]},M)},l=(f,b,d)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:f-7.5,y:b-5.5,width:"15",height:"11",rx:"2",fill:n,stroke:i,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:f-4,cy:b-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:b-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f-4,cy:b+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:b+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f,cy:b,r:"1",fill:i})]},d),c=(f,b)=>(0,y.jsx)("rect",{x:f-9,y:"110",width:"18",height:"10",fill:a},b),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 G_({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 yw({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 Rd({onBack:e}){let[t,a]=(0,nl.useState)(0),[r,n]=(0,nl.useState)(H_),[i,o]=(0,nl.useState)(!1),[l,c]=(0,nl.useState)(!1),p=()=>{let m=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return m<=0||!u?0:Math.ceil(m*1e3/u)+1},b=(()=>{let m=r.range?Mt.ranges[r.range]:Mt.ranges.standard,u=r.pitch??"22.5",g=Mt.pitchMultipliers[u],v=(Number.parseFloat(r.spanMM)||0)/1e3,A=(Number.parseFloat(r.overhangMM)||0)>Mt.overhang.thresholdMM,T=p(),z=T+r.girderCount,Q=Number.parseFloat(r.roofLengthM)||0,K=r.treatment?Mt.treatment[r.treatment]:Mt.treatment.untreated,fe=Mt.estimate.ranges[r.range??"standard"],Te=fe.supplyAt8m*Math.max(.7,v/8)*g*(1+K.surchargePct)+(A?Mt.overhang.surchargePerTruss:0),Ye=T*Te,Ve=r.girderCount*Te*Mt.estimate.girderMultiplier,it=r.bracing==="yes"?Q*Mt.estimate.bracingPerMetre:0,pe=Ye+Ve+it+Mt.estimate.delivery,G=Mt.estimate.design+T*fe.installPerTruss+r.girderCount*40,ce=pe+G,xe=ce*.2;return{range:m,count:T,girderCount:r.girderCount,overhangApplies:A,overhangUnits:z,roofLengthM:Q,treatment:K,trussSupply:Ye,bracingMaterials:it,delivery:Mt.estimate.delivery,labour:G,subtotal:ce,vat:xe,total:ce+xe}})(),d=()=>{let m=cc[t];return m==="range"?!!r.range:m==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":m==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:m==="bracing"?!!r.bracing&&!!r.treatment:!0},h=t===cc.length-1?"View truss request":"Next",w=()=>{i?o(!1):t===0?e():a(m=>m-1)},M=()=>{d()&&(t===cc.length-1?(c(!1),o(!0)):a(m=>m+1))},D=()=>{let m=cc[t];return m==="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(Mt.ranges).map(([u,g])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>n(v=>({...v,range:u})),children:[(0,y.jsx)(Q_,{type:u}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:g.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:g.blurb})]})]},u))})]}):m==="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=>n(g=>({...g,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=>n(g=>({...g,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",Mt.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:Mt.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>n(g=>({...g,pitch:u})),children:[(0,y.jsx)(j_,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):m==="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=>n(g=>({...g,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:Mt.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:()=>n(g=>({...g,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:()=>n(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:()=>n(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):m==="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:()=>n(g=>({...g,bracing:u.id})),children:[(0,y.jsx)(G_,{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:()=>n(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(yw,{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:()=>n(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(yw,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return i?(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:[b.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[b.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:b.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:b.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(b.trussSupply)})]}),b.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:nt(b.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:nt(b.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:nt(b.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:nt(b.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:nt(b.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:nt(b.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:w,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:D()}),(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:w,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:M,disabled:!d(),children:[(0,y.jsx)("span",{children:h}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Ot,{})})]})]})]})]})})}var qi=Y(Xe()),F=Y(ae()),kw=e=>Number.parseFloat(e)||0,uc=(e,t)=>kw(e)*(t==="m"?1:.3048),_w=()=>({length:"",width:""}),xw=[{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 Y_({profile:e}){return(0,F.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,F.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,F.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function Ud({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,qi.useState)("total"),[i,o]=(0,qi.useState)("m"),[l,c]=(0,qi.useState)(""),[p,f]=(0,qi.useState)([_w()]),[b,d]=(0,qi.useState)(""),[h,w]=(0,qi.useState)("chamfered"),M="4.2",D=r==="total"?uc(l,i):p.reduce((N,A)=>N+2*(uc(A.length,i)+uc(A.width,i)),0),m=Math.max(0,D-uc(b,i)),u=Math.ceil(m/kw(M)),g=[{key:`skirting-${h}`,label:`${xw.find(N=>N.id===h)?.label} skirting board`,qty:m,unit:"m",query:"skirting board",category:"skirting"}],v=(N,A,T)=>{f(z=>z.map((Q,K)=>K===N?{...Q,[A]:T}:Q))};return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)("div",{className:"truss-estimator",children:[(0,F.jsxs)("div",{className:"quick-order-hero",children:[(0,F.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,F.jsx)("h1",{children:"Skirting Board Calculator"}),(0,F.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,F.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,F.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,F.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>n("total"),children:"Total length"}),(0,F.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>n("rooms"),children:"Room by room"})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,F.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,F.jsx)("span",{children:"Units"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,F.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,F.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Total skirting length (",i,")"]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:N=>c(N.target.value)})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,F.jsx)("span",{children:"Room"}),(0,F.jsxs)("span",{children:["Length (",i,")"]}),(0,F.jsxs)("span",{children:["Width (",i,")"]}),(0,F.jsx)("span",{})]}),p.map((N,A)=>(0,F.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,F.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",A+1]}),(0,F.jsx)("input",{"aria-label":`Room ${A+1} length in ${i}`,type:"number",min:"0",step:"0.01",value:N.length,onChange:T=>v(A,"length",T.target.value)}),(0,F.jsx)("input",{"aria-label":`Room ${A+1} width in ${i}`,type:"number",min:"0",step:"0.01",value:N.width,onChange:T=>v(A,"width",T.target.value)}),p.length>1?(0,F.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>f(T=>T.filter((z,Q)=>Q!==A)),children:"Remove"}):null]},`room-${A}`)),(0,F.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(N=>[...N,_w()]),children:"+ Add another room"})]}),(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Openings and doorways to deduct (",i,") ",(0,F.jsx)("small",{children:"optional"})]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:b,onChange:N=>d(N.target.value)})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,F.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.2m white-primed MDF boards."}),(0,F.jsx)("div",{className:"architrave-calculator__profiles",children:xw.map(N=>(0,F.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===N.id?" is-selected":""}`,onClick:()=>w(N.id),children:[(0,F.jsx)(Y_,{profile:N.id}),(0,F.jsx)("div",{className:"truss-estimator__option-title",children:N.label}),(0,F.jsx)("div",{className:"truss-estimator__option-copy",children:N.blurb})]},N.id))})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,F.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,F.jsxs)("label",{className:"truss-estimator__field",children:[(0,F.jsx)("span",{children:"Board length"}),(0,F.jsx)("input",{value:"4.20 m",disabled:!0})]})}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,F.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Net skirting"}),(0,F.jsxs)("strong",{children:[m.toFixed(2)," m"]})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Board lengths"}),(0,F.jsx)("strong",{children:u})]})]}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,F.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,F.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:m<=0,children:a})]})]})]})})}var jn=Y(Xe()),oe=Y(ae()),ol=e=>Number.parseFloat(e)||0;function Dd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,jn.useState)("studs"),[i,o]=(0,jn.useState)(""),[l,c]=(0,jn.useState)(""),[p,f]=(0,jn.useState)("600"),[b,d]=(0,jn.useState)("2.4"),h=i&&l&&p?Math.ceil(ol(l)/(ol(p)/1e3))+1:0,w=h*ol(i),M=ol(b)>0?Math.ceil(w/ol(b)):0,D=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:w,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],m={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"]},g={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,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)("div",{className:"truss-estimator",children:[(0,oe.jsxs)("div",{className:"quick-order-hero",children:[(0,oe.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,oe.jsx)("h1",{children:"Timber Calculator"}),(0,oe.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,oe.jsxs)("p",{className:"truss-estimator__step-sub",children:[g.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(m).map(v=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>n(v),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:m[v][0]}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:m[v][1]})]},v))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[g.member," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:v=>o(v.target.value)})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[g.overall," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Centres (mm)"}),(0,oe.jsxs)("select",{value:p,onChange:v=>f(v.target.value),children:[(0,oe.jsx)("option",{value:"300",children:"300 mm"}),(0,oe.jsx)("option",{value:"400",children:"400 mm"}),(0,oe.jsx)("option",{value:"450",children:"450 mm"}),(0,oe.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Stock length (m)"}),(0,oe.jsxs)("select",{value:b,onChange:v=>d(v.target.value),children:[(0,oe.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,oe.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,oe.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,oe.jsxs)("div",{className:"materials-calculator__totals",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,oe.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:g.count}),(0,oe.jsx)("strong",{children:h})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Linear metres"}),(0,oe.jsxs)("strong",{children:[w.toFixed(2)," m"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsxs)("span",{children:[b," m lengths"]}),(0,oe.jsx)("strong",{children:M})]})]}),(0,oe.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,oe.jsxs)("div",{className:"materials-calculator__actions",children:[(0,oe.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,oe.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(D),disabled:w<=0,children:a})]})]})]})})}var Bd=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Rd},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:Cd},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Sd},{id:"brick-block",title:"Brick & Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:yd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:Ed},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:Ud},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:wd},{id:"concrete-aggregate",title:"Concrete & Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:kd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Ad},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:qd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:Dd},{id:"paving",title:"Paving & Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Td}];var dc=Y(Xe());var Le=Y(Xe());var S=Y(ae()),V_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],Od={wasteFactorEnabled:!0},X_=3e3,Nw=null;function pc(e,t){let a=Fo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function $_(e){return e&&e.length>0?e.join(" x "):"-"}function Ld({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:n}){let i=Ps(),o=`${e}~${t.map(C=>`${C.key}|${C.query}|${C.category??""}|${C.qty}`).join("~")}`,l=o!==Nw,[c,p]=(0,Le.useState)(null),[f,b]=(0,Le.useState)([]),[d,h]=(0,Le.useState)(l),[w,M]=(0,Le.useState)(null),[D,m]=(0,Le.useState)("tile"),[u,g]=(0,Le.useState)(null),[v,N]=(0,Le.useState)(""),[A,T]=(0,Le.useState)(null),[z,Q]=(0,Le.useState)(""),[K,fe]=(0,Le.useState)([]),[Te,Ye]=(0,Le.useState)(new Set),[Ve,it]=(0,Le.useState)(null),[pe,G]=(0,Le.useState)(""),[ce,xe]=(0,Le.useState)([]),ye=(0,Le.useRef)(null),ee=(0,Le.useRef)(!1),se=C=>`${e}:${C}`,Me=C=>Kr(C.chosen,{lineId:se(C.requirement.key),description:C.requirement.label,unit:C.requirement.unit,qty:C.requirement.qty}),_e=(0,Le.useMemo)(()=>t.map(C=>`${C.key}|${C.query}|${C.category??""}`).join("~"),[t]);(0,Le.useEffect)(()=>{let C=!1;return pw().then(V=>{C||p(V.itemCount>0)}).catch(()=>{C||p(!1)}),()=>{C=!0}},[]),(0,Le.useEffect)(()=>{if(!a||!c)return;let C=!1,V;l&&h(!0),M(null);let X=Date.now();return(async()=>{let me=null;try{me=(await uw(t)).map(({requirement:dt,candidates:je})=>({requirement:dt,candidates:je,chosen:je[0]??null}))}catch(Ce){C||M(Ce instanceof Error?Ce.message:"Could not load products")}if(!C){if(Nw=o,l){let Ce=X_-(Date.now()-X);Ce>0&&await new Promise(dt=>{V=window.setTimeout(dt,Ce)})}C||(me&&(b(me),!ee.current&&i&&(ee.current=!0,i.addManyToCart(me.filter(Ce=>Ce.chosen).map(Me)))),h(!1))}})(),()=>{C=!0,window.clearTimeout(V)}},[a,c,_e]),(0,Le.useEffect)(()=>{if(!A)return;let C=z.trim();if(!C){fe([]);return}let V=!1,X=window.setTimeout(()=>{Pr(C).then(me=>{V||fe(me)}).catch(()=>{V||fe([])})},250);return()=>{V=!0,window.clearTimeout(X)}},[A,z]),(0,Le.useEffect)(()=>{if(!Ve)return;let C=pe.trim();if(!C){xe([]);return}let V=!1,X=window.setTimeout(()=>{Pr(C).then(me=>{V||xe(me)}).catch(()=>{V||xe([])})},250);return()=>{V=!0,window.clearTimeout(X)}},[Ve,pe]);let et=(0,Le.useMemo)(()=>{let C=v.trim().toLowerCase(),V=C?f.filter(X=>X.requirement.label.toLowerCase().includes(C)||(X.chosen?.description??"").toLowerCase().includes(C)||(X.chosen?.product_id??"").toLowerCase().includes(C)):f;return u?[...V].sort((X,me)=>{let Ce=X.requirement.label.localeCompare(me.requirement.label);return u==="asc"?Ce:-Ce}):V},[f,v,u]),Ht=et.filter(C=>C.chosen),Tt=et.filter(C=>!C.chosen),tt=f.filter(C=>C.chosen),ct=tt.filter(C=>C.chosen?.price==null).length,He=tt.reduce((C,V)=>C+(ua(Me(V),Od).lineTotal??0),0);if((0,Le.useEffect)(()=>{n?.(He)},[He,n]),!a||c===!1)return null;let E=i?tt.filter(C=>i.cart[se(C.requirement.key)]).length:0,x=Ve?f.find(C=>C.requirement.key===Ve)??null:null,I=pe.trim()?ce:x?.candidates??[],ue=C=>{let V=A===C.requirement.key;T(V?null:C.requirement.key),Q(V?"":C.requirement.query)},ve=(C,V)=>{let X=f.find(me=>me.requirement.key===C);b(me=>me.map(Ce=>Ce.requirement.key===C?{...Ce,chosen:V}:Ce)),i&&X&&i.cart[se(C)]&&i.addToCart(Me({...X,chosen:V})),T(null),Q("")},Se=C=>{b(V=>V.map(X=>X.requirement.key===C?{...X,chosen:null}:X)),i?.cart[se(C)]&&i.removeFromCart(se(C))},k=C=>{it(C.requirement.key),G(""),xe([])},j=()=>{it(null),G(""),xe([])},O=C=>{if(!i)return;let V=se(C.requirement.key);i.cart[V]?i.removeFromCart(V):i.addToCart(Me(C))},ne=C=>{Ye(V=>{let X=new Set(V);return X.has(C)?X.delete(C):X.add(C),X})},W=C=>{let V=K.length>0?K:C.candidates;return(0,S.jsxs)("div",{className:"estimator-products__picker",children:[(0,S.jsx)("input",{type:"text",className:"results-search-input",value:z,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:X=>Q(X.target.value),"aria-label":`Search a product for ${C.requirement.label}`}),(0,S.jsxs)("div",{className:"estimator-products__options",children:[V.map(X=>(0,S.jsxs)("button",{type:"button",className:`estimator-products__option${X.product_id===C.chosen?.product_id?" is-selected":""}`,onClick:()=>ve(C.requirement.key,X),children:[(0,S.jsx)("span",{children:X.description}),(0,S.jsxs)("span",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${nt(X.price)}`]})]},X.product_id)),V.length===0&&(0,S.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,S.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!d&&(0,S.jsxs)("div",{className:"estimator-products__head",children:[(0,S.jsxs)("div",{className:"results-tile-section__head",children:[(0,S.jsx)("h3",{children:"Matched Products"}),(0,S.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!x&&(0,S.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[ct>0&&(0,S.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,S.jsx)("strong",{children:ct})," need pricing"]}),(0,S.jsxs)("div",{className:"estimator-products__controls",children:[(0,S.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:v,onChange:C=>N(C.target.value),"aria-label":"Search matched products"}),(0,S.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,S.jsx)("button",{type:"button",className:`results-view-toggle__btn${D==="tile"?" is-active":""}`,"aria-pressed":D==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>m("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${D==="list"?" is-active":""}`,"aria-pressed":D==="list","aria-label":"List view",title:"List view",onClick:()=>m("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"})]})})]}),(0,S.jsxs)("details",{ref:ye,style:{position:"relative"},children:[(0,S.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,S.jsx)("div",{className:"sort-menu-panel",children:V_.map(C=>{let V=u===C.dir;return(0,S.jsxs)("button",{type:"button",className:`sort-menu-item${V?" is-active":""}`,onClick:()=>{g(V?null:C.dir),ye.current?.removeAttribute("open")},children:[(0,S.jsx)("span",{className:"sort-menu-item__check",children:V?"\u2713":""}),C.label]},C.dir)})})]})]})]})]}),x&&(0,S.jsxs)("div",{className:"results-review-page",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:j,children:[(0,S.jsx)(Zr,{}),"Back to results"]}),(0,S.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(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:pe,onChange:C=>G(C.target.value),"aria-label":`Search a product for ${x.requirement.label}`})}),x.chosen&&(0,S.jsx)("div",{className:"results-candidate-actions",children:(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Se(x.requirement.key),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)("img",{className:"fill-img results-review-page__image",src:Ga(x.chosen?.description||x.requirement.label,x.chosen?.product_id,x.chosen?.pdp_photo_url),alt:""})}),(0,S.jsxs)("div",{className:"results-review-page__summary",children:[(0,S.jsx)("h2",{children:x.requirement.label}),(0,S.jsxs)("p",{className:"results-review-page__meta",children:[_i(x.requirement.qty)," ",ka(x.requirement.unit,x.requirement.qty)]}),x.chosen?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"results-review-page__product",children:x.chosen.description}),(0,S.jsxs)("div",{className:"results-row-meta",children:[x.chosen.product_id,x.chosen.price!=null?` \xB7 ${pc(x.chosen.price,x.chosen.price_basis)}`:""]})]}):(0,S.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,S.jsx)("div",{className:"results-review-page__actions",children:(0,S.jsx)("button",{type:"button",className:`bom-toolbar-btn${i?.cart[se(x.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>O(x),disabled:!x.chosen||!i,children:i?.cart[se(x.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),I.length===0?(0,S.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(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"}),(0,S.jsx)("th",{"aria-label":"Actions"})]})}),(0,S.jsx)("tbody",{children:I.map(C=>{let V=C.product_id===x.chosen?.product_id;return(0,S.jsxs)("tr",{className:V?"score-breakdown-row--best":"",children:[(0,S.jsxs)("td",{children:[(0,S.jsx)("div",{children:C.description}),(0,S.jsx)("div",{className:"results-row-meta",children:C.product_id})]}),(0,S.jsx)("td",{children:(0,S.jsx)("span",{className:"unit-badge",children:$_(C.measurements_mm)})}),(0,S.jsx)("td",{children:C.price!=null?pc(C.price,C.price_basis):"-"}),(0,S.jsx)("td",{children:(0,S.jsxs)("label",{className:"switch-toggle",title:V?"Currently selected":"Use this candidate",children:[(0,S.jsx)("input",{type:"checkbox",checked:V,onChange:()=>{V?Se(x.requirement.key):ve(x.requirement.key,C)},"aria-label":V?`${C.description} selected`:`Use ${C.description}`}),(0,S.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},C.product_id)})})]})]}),!x&&d&&(0,S.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,S.jsx)(dr,{}),(0,S.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!x&&w&&(0,S.jsx)("p",{className:"results-empty-hint estimator-products__error",children:w}),!x&&!d&&!w&&et.length===0&&f.length>0&&(0,S.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!x&&!d&&!w&&D==="tile"&&Ht.length>0&&(0,S.jsx)("div",{className:"results-tile-grid",children:Ht.map(C=>{let{requirement:V,chosen:X}=C,me=X?ua(Me(C),Od):null,Ce=i?!!i.cart[se(V.key)]:!1;return(0,S.jsxs)("article",{className:"results-tile-card",children:[(0,S.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>k(C),"aria-label":`Review match for ${V.label}`,children:[(0,S.jsx)("div",{className:"results-tile-card__media",children:(0,S.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(X?.description||V.label,X?.product_id,X?.pdp_photo_url),alt:""})}),(0,S.jsxs)("div",{className:"results-tile-card__body",children:[X?(0,S.jsxs)("div",{className:"results-tile-card__heading",children:[(0,S.jsx)("div",{className:"results-tile-card__title",children:X.description}),(0,S.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,S.jsx)("span",{children:X.product_id}),X.price!=null?(0,S.jsx)("span",{children:pc(X.price,X.price_basis)}):null]})]}):(0,S.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,S.jsxs)("div",{className:"results-tile-card__match",children:[(0,S.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,S.jsx)("div",{className:"results-tile-card__match-name",children:V.label}),(0,S.jsxs)("div",{className:"results-tile-card__meta",children:[_i(V.qty)," ",ka(V.unit,V.qty)]}),me?.requiredSellUnits!=null?(0,S.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",me.requiredSellUnits," ",me.sellUnit,me.lineTotal!=null?` \xB7 ${nt(me.lineTotal)}`:""]}):X?(0,S.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,S.jsxs)("div",{className:"results-tile-card__actions",children:[(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>k(C),children:"Review"}),(0,S.jsx)("button",{type:"button",className:`bom-toolbar-btn${Ce?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>O(C),disabled:!X||!i,children:Ce?"\u2713 Added":"+ Add"})]})]},V.key)})}),!x&&!d&&!w&&D==="list"&&Ht.length>0&&(0,S.jsx)("div",{className:"bom-table-wrap",children:(0,S.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,S.jsxs)("colgroup",{children:[(0,S.jsx)("col",{style:{width:"56px"}}),(0,S.jsx)("col",{className:"col-item"}),(0,S.jsx)("col",{style:{width:"90px"}}),(0,S.jsx)("col",{style:{width:"80px"}}),(0,S.jsx)("col",{style:{width:"220px"}}),(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",{"aria-label":"Expand"}),(0,S.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,S.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,S.jsx)("tbody",{children:Ht.map(C=>{let{requirement:V,chosen:X}=C,me=X?ua(Me(C),Od):null,Ce=i?!!i.cart[se(V.key)]:!1,dt=Te.has(V.key);return(0,S.jsxs)(Le.Fragment,{children:[(0,S.jsxs)("tr",{className:"bom-row",children:[(0,S.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,S.jsx)("button",{type:"button",className:"link-btn",onClick:()=>ne(V.key),"aria-expanded":dt,"aria-label":dt?"Collapse product options":"Expand product options",children:dt?"\u25BE":"\u25B8"})}),(0,S.jsxs)("td",{style:{paddingLeft:0},children:[(0,S.jsx)("div",{className:"bom-component-name",children:V.label}),me?.requiredSellUnits!=null&&(0,S.jsxs)("div",{className:"results-row-meta",children:["Order ",me.requiredSellUnits," ",me.sellUnit,me.lineTotal!=null?` \xB7 ${nt(me.lineTotal)}`:""]})]}),(0,S.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:_i(V.qty)}),(0,S.jsx)("td",{style:{textAlign:"center"},children:ka(V.unit,V.qty)}),(0,S.jsx)("td",{style:{textAlign:"center"},children:X?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"bom-component-name",children:X.description}),(0,S.jsxs)("div",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${pc(X.price,X.price_basis)}`]})]}):(0,S.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,S.jsx)("td",{style:{textAlign:"center"},children:(0,S.jsx)("button",{type:"button",className:`bom-toolbar-btn${Ce?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>O(C),disabled:!X||!i,children:Ce?"\u2713 Added":"+ Add"})})]}),dt&&(0,S.jsx)("tr",{children:(0,S.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:A===V.key?W(C):(0,S.jsxs)("div",{className:"estimator-products__picker",children:[(0,S.jsxs)("div",{className:"estimator-products__options",children:[C.candidates.map(je=>(0,S.jsxs)("button",{type:"button",className:`estimator-products__option${je.product_id===X?.product_id?" is-selected":""}`,onClick:()=>ve(V.key,je),children:[(0,S.jsx)("span",{children:je.description}),(0,S.jsxs)("span",{className:"results-row-meta",children:[je.product_id,je.price!=null&&` \xB7 ${nt(je.price)}`]})]},je.product_id)),C.candidates.length===0&&(0,S.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ue(C),children:"Search the catalogue"})]})})})]},V.key)})})]})}),!x&&!d&&!w&&Tt.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:Tt.map(C=>(0,S.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>k(C),children:[(0,S.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,S.jsx)("span",{className:"results-unmatched-card__title",children:C.requirement.label}),(0,S.jsxs)("span",{className:"results-row-meta",children:[_i(C.requirement.qty)," ",ka(C.requirement.unit,C.requirement.qty)]})]}),(0,S.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},C.requirement.key))})]}),!d&&!w&&f.length>0&&(0,S.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},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 procurement, especially any items flagged as medium or low confidence."})]}),!x&&!d&&!w&&(r||E>0)&&(0,S.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,S.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),E>0&&i&&(0,S.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:i.openBasket,children:[(0,S.jsxs)("span",{children:["View Basket (",E,")"]}),(0,S.jsx)("span",{className:"arrow",children:(0,S.jsx)(Ot,{})})]})]})]})}var Lt=Y(ae());function Hd({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[n,i]=(0,dc.useState)(0),o=(0,dc.useCallback)(l=>i(l),[]);return(0,Lt.jsx)(Lt.Fragment,{children:(0,Lt.jsxs)("div",{className:"truss-estimator",children:[(0,Lt.jsxs)("div",{className:"quick-order-hero",children:[(0,Lt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Lt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Lt.jsx)("h1",{children:"Your Materials"}),n>0&&(0,Lt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Lt.jsx)("strong",{children:nt(n)})," Est. total"]})]}),(0,Lt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Lt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Lt.jsx)(Ld,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var Z_=(e,t)=>{let a=t.key,r={"brick-block":{"brick-common":"5001444","brick-engineering-red":"5002008","brick-engineering-blue":"5001439",block:"5003187",mortar:"6003088"},skirting:{"skirting-chamfered":"4006057","skirting-ogee":"4006045","skirting-pencil-round":"4006048","skirting-torus":"4006042"},architrave:{"architrave-ogee":"4006060","architrave-ovolo":"4006063","architrave-pencil-round":"4006061","architrave-square-edge":"4006062","architrave-torus":"4006059"},plasterboard:{board:"2001035",screws:"2006040",tape:"2007043",adhesive:"2004023"},insulation:{"insulation-floor":"3002110","insulation-wall":"3002012","insulation-roof":"3004047","insulation-loft":"3003046"},timber:{studs:"4001168",joists:"4001201",battens:"4001053"},fencing:{"panels-boundary-0.9":"4001268","panels-boundary-1.2":"4001269","panels-boundary-1.5":"4001270","panels-boundary-1.8":"4001271","panels-skyline-0.9":"4001264","panels-skyline-1.2":"4001265","panels-skyline-1.5":"4001266","panels-skyline-1.8":"4001267","concrete-intermediate-6":"4001290","concrete-intermediate-8":"4001291","concrete-end-6":"4001294","concrete-end-8":"4001295","timber-post-6":"4001242","timber-post-8":"4001243",postcrete:"6003008",gate:"4001630","gravel-boards":"4001284"},decking:{"boards-meridian":"4001251","boards-summit":"4001360",joists:"4001201",screws:"1001103"},paving:{"surface-council":"7003121","surface-raj":"7003003","surface-brindle":"4001621","surface-charcoal":"4001622","surface-pea":"6001004","sub-base":"6001007",bedding:"6001012"}};return e==="plasterboard"?{standard:"2001035",moisture:"2002039",fire:"2002087",sound:"2002044"}[t.label.split(" ")[0].toLowerCase()]??r[e]?.[a]??null:r[e]?.[a]??null};function Sw(e,t){if(e==="paint"||e==="concrete-aggregate")return null;let a=t.map(r=>{let n=Z_(e,r);return n?{key:r.key,productId:n,qty:r.qty,unit:r.unit}:null});return a.every(Boolean)?a:null}var jd=Y(Xe());var Jt=Y(ae()),K_=1500;function Cw(e){let{addManyToCart:t,clearCart:a,openBasket:r}=An(),[n,i]=(0,jd.useState)(!1),[o,l]=(0,jd.useState)(null);return{adding:n,basketError:o,addToBasket:async(p,f)=>{let b=Date.now();i(!0),l(null);try{let d=await Promise.all(p.filter(w=>w.qty>0).map(async w=>{let M=(await Pr(w.productId)).find(D=>D.product_id===w.productId);if(!M)throw new Error("A selected product is no longer available in this catalogue.");return Kr(M,{lineId:`${e}:${w.key}`,description:M.description,unit:w.unit??"each",qty:w.qty,calculatorWasteIncluded:f})})),h=K_-(Date.now()-b);h>0&&await new Promise(w=>window.setTimeout(w,h)),a(),t(d),r()}catch(d){l(d instanceof Error?d.message:"Could not add the products to your basket.")}finally{i(!1)}}}}function qw({toolTitle:e}){return(0,Jt.jsx)(Jt.Fragment,{children:(0,Jt.jsxs)("div",{className:"truss-estimator",children:[(0,Jt.jsxs)("div",{className:"quick-order-hero",children:[(0,Jt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Jt.jsx)("h1",{children:"Your Materials"}),(0,Jt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Jt.jsx)("div",{className:"truss-estimator__card",children:(0,Jt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Jt.jsx)(dr,{}),(0,Jt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Re=Y(ae());function mc(e){let[t,a]=(0,Va.useState)(!1);return(0,Re.jsx)(Js,{onOpenBasket:()=>a(!0),children:(0,Re.jsx)(J_,{...e,showBasket:t,onShowBasket:a})})}function J_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:n}){let[i,o]=(0,Va.useState)(null),[l,c]=(0,Va.useState)(null),p=Bd.find(z=>z.id===i),{cart:f,updateCartQty:b,updateCartSellUnits:d,updateCartConversions:h,removeFromCart:w,clearCart:M}=An(),{adding:D,basketError:m,addToBasket:u}=Cw(p?.title??"calculator"),g=(0,Va.useRef)(null),v=Qs("estimating-tools",g);(0,Va.useEffect)(()=>{v("viewed")},[v]);let N=r?"basket":D?"adding":l?"review":i??"list",A=(0,Va.useRef)(N);(0,Va.useEffect)(()=>{A.current!==N&&(A.current=N,window.scrollTo(0,0))},[N]);let T=z=>{if(!p)return;v("estimate_completed",{calculator:p.id,lines:z.length});let Q=Sw(p.id,z);Q?u(Q,z[0]?.calculatorWasteIncluded??!1):c(z)};return(0,Re.jsx)(Zo.Provider,{value:v,children:(0,Re.jsx)("div",{ref:g,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}`,style:pr().theme,children:(0,Re.jsx)("main",{className:"main-content",children:r?(0,Re.jsx)(rl,{cart:f,onUpdateQty:b,onUpdateSellUnits:d,onResolveConversions:h,onRemove:w,onBack:()=>n(!1),onStartNewQuote:()=>{M(),o(null),c(null),n(!1)},internal:a}):D&&p?(0,Re.jsx)(qw,{toolTitle:p.title}):p?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)("div",{hidden:l!==null,children:(0,Re.jsx)(p.Component,{onBack:()=>o(null),onReview:T})}),m&&(0,Re.jsx)("p",{className:"results-empty-hint estimator-products__error",children:m}),l!==null&&(0,Re.jsx)(Hd,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Re.jsx)(Re.Fragment,{children:(0,Re.jsxs)("div",{className:"quick-order-card",children:[(0,Re.jsxs)("div",{className:"quick-order-hero",children:[(0,Re.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Re.jsx)("h1",{children:"Estimating Tools"}),(0,Re.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Re.jsxs)("div",{className:"quick-order-alt",children:[(0,Re.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Re.jsx)("div",{className:"estimator-tools-grid",children:Bd.map(z=>(0,Re.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{v("calculator_selected",{calculator:z.id}),o(z.id),c(null)},children:[(0,Re.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Re.jsx)("img",{className:"fill-img estimator-tool-card__image",src:Kt(z.imageUrl),alt:""})}),(0,Re.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Re.jsx)("span",{className:"estimator-tool-card__title",children:z.title}),(0,Re.jsx)("span",{className:"estimator-tool-card__desc",children:z.desc})]})]},z.id))})]})]})})})})})}var fc=Y(ae());function Qd({config:e,children:t}){return $b(e),(0,fc.jsx)(fc.Fragment,{children:t})}var Gd=Y(ae()),P_="https://api.metronlabs.ai",F_=["client","api-key","api-url","theme","hide-header","analytics"],I_=["all","events-only","none"];function Mw(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.25",!this.root){let n=document.createElement("div"),i=document.createElement("style");i.textContent=`:host { display: block; }
|
|
6781
6781
|
:host > div { all: initial; display: block; }
|
|
6782
6782
|
${Xb}`,this.shadowRoot.replaceChildren(i,n),this.root=(0,Ew.createRoot)(n)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let n=this.getAttribute("client")??void 0,i=this.getAttribute("api-key")??void 0;(!n||!i)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||P_,client:n,apiKey:i,theme:ex(e,this.getAttribute("theme")),analytics:W_(this.getAttribute("analytics"))};this.root.render((0,Gd.jsx)(Qd,{config:o,children:(0,Gd.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=F_,a))}function W_(e){return I_.find(t=>t===e)??"all"}function ex(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}Mw("metron-labs-quick-quote",Fs);Mw("metron-labs-estimating-tools",mc);
|
|
6783
6783
|
/*! Bundled license information:
|