@aistrike-dev/ui-shell-dev 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as ee,U as te,V as ne,W as b,X as x,Y as S,Z as C,_ as re,a as w,at as T,b as E,c as D,ct as O,d as ie,dt as k,et as A,f as j,ft as M,g as N,h as P,i as F,it as ae,j as I,k as oe,l as L,lt as R,m as z,mt as B,n as se,nt as V,o as H,ot as ce,p as U,pt as W,q as G,r as le,rt as K,s as ue,st as de,t as fe,tt as pe,u as me,ut as q,v as he,w as ge,x as _e,y as ve,z as ye}from"./index-04Lk--D-.js";function be(e){return R(`MuiSlider`,e)}var J=O(`MuiSlider`,`root.active.colorPrimary.colorSecondary.colorError.colorInfo.colorSuccess.colorWarning.disabled.dragging.focusVisible.mark.markActive.marked.markLabel.markLabelActive.rail.sizeSmall.thumb.track.trackInverted.trackFalse.valueLabel.valueLabelOpen.valueLabelCircle.valueLabelLabel.vertical`.split(`.`));function xe(e){return R(`MuiToggleButton`,e)}var Y=O(`MuiToggleButton`,[`root`,`disabled`,`selected`,`standard`,`primary`,`secondary`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`fullWidth`]),Se={border:0,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`};function Ce(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}var X=B(W(),1),we=2,Te=[],Ee={};function De(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Oe(e,t){return e-t}function ke(e,t,n=-1){let{index:r}=e.reduce((e,n,r)=>{let i=Math.abs(t-n);return e==null||i<=e.distance?{distance:i,index:r}:e},null)??Ee;return r==null?r:n>=0&&e[n]===e[r]?n:r}function Ae(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function je(e,t,n){return(e-t)*100/(n-t)}function Me(e,t,n){return(n-t)*e+t}function Ne(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function Pe(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Ne(t)))}function Fe(e,t,n){let r=e.slice();return r[n]=t,r.sort(Oe)}function Ie(e,t,n,r){let i=C(e.current),a=ne(i);if(!re(e.current,a)||Number(a?.getAttribute(`data-index`))!==t){let n=e.current?.querySelector(`[type="range"][data-index="${t}"]`);n!=null&&(r==null?n.focus({preventScroll:!0}):n.focus({preventScroll:!0,focusVisible:r}))}n&&n(t)}function Le(e,t){return typeof e==`number`&&typeof t==`number`?e===t:typeof e==`object`&&typeof t==`object`&&Ce(e,t)}var Re={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},ze=e=>e;function Be(t){let{"aria-labelledby":n,defaultValue:r,disabled:i=!1,disableSwap:a=!1,isRtl:o=!1,marks:s=!1,max:c=100,min:u=0,name:d,onChange:f,onChangeCommitted:p,orientation:m=`horizontal`,rootRef:h,scale:g=ze,step:v=1,shiftStep:y=10,tabIndex:ee,value:te}=t,b=X.useRef(void 0),x=X.useRef(null),[S,w]=X.useState(-1),[E,D]=X.useState(-1),[O,ie]=X.useState(!1),k=X.useRef(0),A=X.useRef(-1),j=X.useRef(!1),M=X.useRef(-1),N=_(()=>{x.current!=null&&(cancelAnimationFrame(x.current),x.current=null)}),P=X.useRef(null),[F,ae]=l({controlled:te,default:r??u,name:`Slider`}),I=_((e,t,n)=>{let r=`nativeEvent`in e?e.nativeEvent:e,i=new r.constructor(r.type,r);Object.defineProperty(i,"target",{writable:!0,value:{value:t,name:d}}),P.current=t,f?.(i,t,n)}),L=Array.isArray(F),R=X.useMemo(()=>{if(typeof F==`number`)return[T(F,u,c)];if(F==null)return[u];let e=F.slice().sort(Oe);for(let t=0;t<e.length;t+=1){let n=e[t];e[t]=n==null?u:T(n,u,c)}return e},[F,u,c]),z=X.useMemo(()=>{if(s===!0&&v!=null){let e=Array(Math.floor((c-u)/v)+1);for(let t=0;t<e.length;t+=1)e[t]={value:u+v*t};return e}return Array.isArray(s)?s:Te},[s,v,u,c]),B=X.useMemo(()=>{let e=Array(z.length);for(let t=0;t<z.length;t+=1)e[t]=z[t].value;return e},[z]),[se,V]=X.useState(-1),H=X.useRef(null),U=e(h,H),W=e=>t=>{let n=Number(t.currentTarget.getAttribute(`data-index`));oe(t.target)&&V(n),D(n),e?.onFocus?.(t)},G=e=>t=>{oe(t.target)||V(-1),D(-1),e?.onBlur?.(t)},le=(e,t)=>{let n=Number(e.currentTarget.getAttribute(`data-index`)),r=R[n],i=B.indexOf(r),o=t;if(z&&v==null){let e=B[B.length-1];o=o>=e?e:o<=B[0]?B[0]:o<r?B[i-1]:B[i+1]}if(o=T(o,u,c),L){a&&(o=T(o,R[n-1]||-1/0,R[n+1]||1/0));let e=o;o=Fe(R,o,n);let t=n;a||(t=o.indexOf(e)),Ie(H,t)}ae(o),V(n),f&&!Le(o,F)&&I(e,o,n),p&&p(e,P.current??o)},K=e=>t=>{if([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`].includes(t.key)){t.preventDefault();let e=Number(t.currentTarget.getAttribute(`data-index`)),n=R[e],r=null;if(v!=null){let e=t.shiftKey?y:v;switch(t.key){case`ArrowUp`:r=De(n,e,1,u,c);break;case`ArrowRight`:r=De(n,e,o?-1:1,u,c);break;case`ArrowDown`:r=De(n,e,-1,u,c);break;case`ArrowLeft`:r=De(n,e,o?1:-1,u,c);break;case`PageUp`:r=De(n,y,1,u,c);break;case`PageDown`:r=De(n,y,-1,u,c);break;case`Home`:r=u;break;case`End`:r=c}}else if(z){let e=B[B.length-1],i=B.indexOf(n),a=[o?`ArrowRight`:`ArrowLeft`,`ArrowDown`,`PageDown`,`Home`],s=[o?`ArrowLeft`:`ArrowRight`,`ArrowUp`,`PageUp`,`End`];a.includes(t.key)?r=i===0?B[0]:B[i-1]:s.includes(t.key)&&(r=i===B.length-1?e:B[i+1])}r!=null&&le(t,r)}e?.onKeyDown?.(t)};ce(()=>{let e=ne(C(H.current));i&&re(H.current,e)&&e!=null&&`blur`in e&&e.blur()},[i]),i&&S!==-1&&w(-1),i&&se!==-1&&V(-1);let ue=e=>t=>{e.onChange?.(t),le(t,t.currentTarget.valueAsNumber)},de=X.useRef(void 0),fe=m;o&&m===`horizontal`&&(fe+=`-reverse`);let pe=e=>{let{current:t}=H;if(!t)return null;let{width:n,height:r,bottom:i,left:o}=t.getBoundingClientRect(),s;s=fe.startsWith(`vertical`)?(i-e.y)/r:(e.x-o)/n,fe.includes(`-reverse`)&&(s=1-s);let l;if(l=Me(s,u,c),v)l=Pe(l,v,u);else{let e=ke(B,l);l=B[e]}l=T(l,u,c);let d=0;if(L){let e=de.current!==-1;d=e?de.current:ke(R,l,A.current),a&&(l=T(l,R[d-1]||-1/0,R[d+1]||1/0));let t=l;l=Fe(R,l,d),a&&e||(d=l.indexOf(t),de.current=d)}return{newValue:l,activeIndex:d}},me=_(e=>{if(`pointerId`in e&&e.pointerId!==M.current)return;let t=Ae(e,b);if(!t)return;if(k.current+=1,e.type===`pointermove`&&e.buttons===0){q(e);return}let n=pe(t);n&&(Ie(H,n.activeIndex,w,!1),A.current=n.activeIndex,ae(n.newValue),!O&&k.current>we&&ie(!0),f&&!Le(n.newValue,F)&&I(e,n.newValue,n.activeIndex))}),q=_(e=>{if(`pointerId`in e&&e.pointerId!==M.current)return;let t=Ae(e,b);if(ie(!1),!t)return;let n=pe(t);w(-1),e.type===`touchend`&&D(-1),n&&p&&p(e,P.current??n.newValue),`pointerType`in e&&H.current?.hasPointerCapture(e.pointerId)&&H.current.releasePointerCapture(e.pointerId),b.current=void 0,M.current=-1,ge()}),he=_(e=>{if(i)return;if(j.current){j.current=!1;let t=e.changedTouches[0];t!=null&&(b.current=t.identifier);return}let t=e.changedTouches[0];t!=null&&(b.current=t.identifier);let n=Ae(e,b);if(n!==!1){de.current=-1;let t=pe(n);t&&(Ie(H,t.activeIndex,w,!1),A.current=t.activeIndex,ae(t.newValue),f&&!Le(t.newValue,F)&&I(e,t.newValue,t.activeIndex))}k.current=0;let r=C(H.current);r.addEventListener(`touchmove`,me,{passive:!0}),r.addEventListener(`touchend`,q,{passive:!0})}),ge=X.useCallback(()=>{let e=C(H.current);e.removeEventListener(`pointermove`,me),e.removeEventListener(`pointerup`,q),e.removeEventListener(`touchmove`,me),e.removeEventListener(`touchend`,q)},[q,me]);X.useEffect(()=>{let e=H.current;if(e)return e.addEventListener(`touchstart`,he,{passive:!0}),()=>{e.removeEventListener(`touchstart`,he),N(),ge()}},[ge,he,N]),X.useEffect(()=>{i&&(ge(),N())},[i,ge,N]);let ve=e=>t=>{if(e.onPointerDown?.(t),t.pointerType===`touch`&&(j.current=!0),i||t.defaultPrevented||t.button!==0)return;let n=Ae(t,b);if(n!==!1){de.current=-1;let e=pe(n);if(e){let n=H.current?.querySelector(`input[type="range"][data-index="${e.activeIndex}"]`),r=C(H.current),i=n!=null&&n===ne(r);w(e.activeIndex),A.current=e.activeIndex,i?t.preventDefault():(N(),x.current=requestAnimationFrame(()=>{x.current=null,Ie(H,e.activeIndex,void 0,!1)})),ae(e.newValue),f&&!Le(e.newValue,F)&&I(t,e.newValue,e.activeIndex)}}k.current=0,M.current=t.pointerId;let r=C(H.current);try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}r.addEventListener(`pointermove`,me,{passive:!0}),r.addEventListener(`pointerup`,q)},ye=je(L?R[0]:u,u,c),be=je(R[R.length-1],u,c)-ye,J=(e=Ee)=>{let t=_e(e),n={onPointerDown:ve(t)},r={...t,...n};return{...e,ref:U,...r}},xe=e=>t=>{e.onMouseOver?.(t);let n=Number(t.currentTarget.getAttribute(`data-index`));D(n)},Y=e=>t=>{e.onMouseLeave?.(t),D(-1)},Ce=(e=Ee)=>{let t=_e(e),n={onMouseOver:xe(t),onMouseLeave:Y(t)};return{...e,...t,...n}},Ne=e=>{let t;return L?S===e?t=2:A.current===e&&(t=1):S===e&&(t=1),{pointerEvents:S!==-1&&S!==e?`none`:void 0,zIndex:t}},Be;return m===`vertical`&&(Be=o?`vertical-rl`:`vertical-lr`),{active:S,axis:fe,axisProps:Re,dragging:O,focusedThumbIndex:se,getHiddenInputProps:(e=Ee)=>{let r=_e(e),a={onChange:ue(r),onFocus:W(r),onBlur:G(r),onKeyDown:K(r)},s={...r,...a};return{tabIndex:ee,"aria-labelledby":n,"aria-orientation":m,"aria-valuemax":g(c),"aria-valuemin":g(u),name:d,type:`range`,min:t.min,max:t.max,step:t.step===null&&t.marks?`any`:t.step??void 0,disabled:i,...e,...s,style:{...Se,direction:o?`rtl`:`ltr`,width:`100%`,height:`100%`,writingMode:Be}}},getRootProps:J,getThumbProps:Ce,marks:z,open:E,range:L,rootRef:U,trackLeap:be,trackOffset:ye,values:R,getThumbStyle:Ne}}var Z=k(),Ve=e=>{let{open:t}=e;return{offset:q(t&&J.valueLabelOpen),circle:J.valueLabelCircle,label:J.valueLabelLabel}};function He(e){let{children:t,className:n,value:r}=e,i=Ve(e);return t?X.cloneElement(t,{className:t.props.className},(0,Z.jsxs)(X.Fragment,{children:[t.props.children,(0,Z.jsx)(`span`,{className:q(i.offset,n),"aria-hidden":!0,children:(0,Z.jsx)(`span`,{className:i.circle,children:(0,Z.jsx)(`span`,{className:i.label,children:r})})})]})):null}function Ue(e){return e}var We=u(`span`,{name:`MuiSlider`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${s(n.color)}`],n.size!==`medium`&&t[`size${s(n.size)}`],n.marked&&t.marked,n.orientation===`vertical`&&t.vertical,n.track===`inverted`&&t.trackInverted,n.track===!1&&t.trackFalse]}})(G(({theme:e})=>({borderRadius:12,boxSizing:`content-box`,display:`inline-block`,position:`relative`,cursor:`pointer`,touchAction:`none`,WebkitTapHighlightColor:`transparent`,"@media print":{colorAdjust:`exact`},[`&.${J.disabled}`]:{pointerEvents:`none`,cursor:`default`,color:(e.vars||e).palette.grey[400]},[`&.${J.dragging}`]:{[`& .${J.thumb}, & .${J.track}`]:{transition:`none`}},variants:[...Object.entries(e.palette).filter(g()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:`horizontal`},style:{height:4,width:`100%`,padding:`13px 0`,"@media (pointer: coarse)":{padding:`20px 0`}}},{props:{orientation:`horizontal`,size:`small`},style:{height:2}},{props:{orientation:`horizontal`,marked:!0},style:{marginBottom:20}},{props:{orientation:`vertical`},style:{height:`100%`,width:4,padding:`0 13px`,"@media (pointer: coarse)":{padding:`0 20px`}}},{props:{orientation:`vertical`,size:`small`},style:{width:2}},{props:{orientation:`vertical`,marked:!0},style:{marginRight:44}}]}))),Ge=u(`span`,{name:`MuiSlider`,slot:`Rail`})({display:`block`,position:`absolute`,borderRadius:`inherit`,backgroundColor:`currentColor`,opacity:.38,"@media (forced-colors: active)":{border:`1px solid transparent`,boxSizing:`border-box`},variants:[{props:{orientation:`horizontal`},style:{width:`100%`,height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{height:`100%`,width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:`inverted`},style:{opacity:1}}]}),Ke=u(`span`,{name:`MuiSlider`,slot:`Track`})(G(({theme:e})=>({display:`block`,position:`absolute`,borderRadius:`inherit`,border:`1px solid currentColor`,backgroundColor:`currentColor`,...n(e,[`left`,`width`,`bottom`,`height`],{duration:e.transitions.duration.shortest}),variants:[{props:{size:`small`},style:{"@media (forced-colors: none)":{border:`none`}}},{props:{orientation:`horizontal`},style:{height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:!1},style:{display:`none`}},...Object.entries(e.palette).filter(g()).map(([t])=>({props:{color:t,track:`inverted`},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles(`dark`,{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles(`dark`,{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),qe=u(`span`,{name:`MuiSlider`,slot:`Thumb`})(G(({theme:e})=>({position:`absolute`,width:20,height:20,boxSizing:`border-box`,borderRadius:`50%`,outline:0,backgroundColor:`currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,...n(e,[`box-shadow`,`left`,`bottom`],{duration:e.transitions.duration.shortest}),"@media (forced-colors: active)":{border:`1px solid ButtonBorder`},"&::before":{position:`absolute`,content:`""`,borderRadius:`inherit`,width:`100%`,height:`100%`,boxShadow:(e.vars||e).shadows[2]},"&::after":{position:`absolute`,content:`""`,borderRadius:`50%`,width:42,height:42,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`},[`&.${J.disabled}`]:{"&:hover":{boxShadow:`none`}},...e.focusVisible&&{[`&.${J.focusVisible}`]:{...V,...e.focusVisible}},variants:[{props:{size:`small`},style:{width:12,height:12,"&::before":{boxShadow:`none`}}},{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-50%, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 50%)`}},...Object.entries(e.palette).filter(g()).map(([t])=>({props:{color:t},style:{"&:hover":{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:`none`}},...!e.focusVisible&&{[`&.${J.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:`none`}}},[`&.${J.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),Je=u(He,{name:`MuiSlider`,slot:`ValueLabel`})(G(({theme:e})=>({zIndex:1,whiteSpace:`nowrap`,...e.typography.body2,fontWeight:500,...n(e,[`transform`],{duration:e.transitions.duration.shortest}),position:`absolute`,backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0.25rem 0.75rem`,variants:[{props:{orientation:`horizontal`},style:{transform:`translateY(-100%) scale(0)`,top:`-10px`,transformOrigin:`bottom center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, 50%) rotate(45deg)`,backgroundColor:`inherit`,bottom:0,left:`50%`},[`&.${J.valueLabelOpen}`]:{transform:`translateY(-100%) scale(1)`}}},{props:{orientation:`vertical`},style:{transform:`translateY(-50%) scale(0)`,right:`30px`,top:`50%`,transformOrigin:`right center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, -50%) rotate(45deg)`,backgroundColor:`inherit`,right:-8,top:`50%`},[`&.${J.valueLabelOpen}`]:{transform:`translateY(-50%) scale(1)`}}},{props:{size:`small`},style:{fontSize:e.typography.pxToRem(12),padding:`0.25rem 0.5rem`}},{props:{orientation:`vertical`,size:`small`},style:{right:`20px`}}]}))),Ye=u(`span`,{name:`MuiSlider`,slot:`Mark`,shouldForwardProp:e=>S(e)&&e!==`markActive`,overridesResolver:(e,t)=>{let{markActive:n}=e;return[t.mark,n&&t.markActive]}})(G(({theme:e})=>({position:`absolute`,width:2,height:2,borderRadius:1,backgroundColor:`currentColor`,variants:[{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-1px, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 1px)`}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),Xe=u(`span`,{name:`MuiSlider`,slot:`MarkLabel`,shouldForwardProp:e=>S(e)&&e!==`markLabelActive`})(G(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:`absolute`,whiteSpace:`nowrap`,variants:[{props:{orientation:`horizontal`},style:{top:30,transform:`translateX(-50%)`,"@media (pointer: coarse)":{top:40}}},{props:{orientation:`vertical`},style:{left:36,transform:`translateY(50%)`,"@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),Ze=e=>{let{disabled:t,dragging:n,marked:r,orientation:i,track:a,classes:o,color:c,size:l}=e,u={root:[`root`,t&&`disabled`,n&&`dragging`,r&&`marked`,i===`vertical`&&`vertical`,a===`inverted`&&`trackInverted`,a===!1&&`trackFalse`,c&&`color${s(c)}`,l&&`size${s(l)}`],rail:[`rail`],track:[`track`],mark:[`mark`],markActive:[`markActive`],markLabel:[`markLabel`],markLabelActive:[`markLabelActive`],valueLabel:[`valueLabel`],thumb:[`thumb`,t&&`disabled`],active:[`active`],disabled:[`disabled`],focusVisible:[`focusVisible`]};return K(u,be,o)},Qe=({children:e})=>e,$e=X.forwardRef(function(e,t){let n=d({props:e,name:`MuiSlider`}),r=ae(),{"aria-label":i,"aria-valuetext":a,"aria-labelledby":o,color:s=`primary`,classes:c,className:l,disableSwap:u=!1,disabled:f=!1,getAriaLabel:p,getAriaValueText:m,marks:h=!1,max:g=100,min:_=0,name:v,onChange:y,onChangeCommitted:ee,orientation:te=`horizontal`,shiftStep:ne=10,size:b=`medium`,step:x=1,scale:S=Ue,slotProps:C={},slots:re={},tabIndex:w,track:T=`normal`,value:D,valueLabelDisplay:O=`off`,valueLabelFormat:ie=Ue,...k}=n,j={...n,isRtl:r,max:g,min:_,classes:c,disabled:f,disableSwap:u,orientation:te,marks:h,color:s,size:b,step:x,shiftStep:ne,scale:S,track:T,valueLabelDisplay:O,valueLabelFormat:ie},{axisProps:M,getRootProps:N,getHiddenInputProps:P,getThumbProps:F,open:I,active:oe,axis:L,focusedThumbIndex:R,range:z,dragging:B,marks:se,values:V,trackOffset:H,trackLeap:ce,getThumbStyle:U}=Be({...j,rootRef:t});j.marked=se.length>0&&se.some(e=>e.label),j.dragging=B,j.focusedThumbIndex=R;let W=Ze(j),G={slots:re,slotProps:C},[le,K]=E(`root`,{elementType:We,getSlotProps:N,externalForwardedProps:{...G,...k},ownerState:j,className:[W.root,l]}),[ue,de]=E(`rail`,{elementType:Ge,externalForwardedProps:G,ownerState:j,className:W.rail}),[fe,pe]=E(`track`,{elementType:Ke,externalForwardedProps:G,additionalProps:{style:{...M[L].offset(H),...M[L].leap(ce)}},ownerState:j,className:W.track}),[me,he]=E(`thumb`,{elementType:qe,getSlotProps:F,externalForwardedProps:G,ownerState:j,className:W.thumb}),[ge,_e]=E(`valueLabel`,{elementType:Je,externalForwardedProps:G,ownerState:j,className:W.valueLabel}),[ve,ye]=E(`mark`,{elementType:Ye,externalForwardedProps:G,ownerState:j,className:W.mark}),[be,J]=E(`markLabel`,{elementType:Xe,externalForwardedProps:G,ownerState:j,className:W.markLabel}),[xe,Y]=E(`input`,{elementType:`input`,getSlotProps:P,externalForwardedProps:G,ownerState:j});return(0,Z.jsxs)(le,{...K,children:[(0,Z.jsx)(ue,{...de}),(0,Z.jsx)(fe,{...pe}),se.filter(e=>e.value>=_&&e.value<=g).map((e,t)=>{let n=je(e.value,_,g),r=M[L].offset(n),i;return i=T===!1?V.includes(e.value):T===`normal`&&(z?e.value>=V[0]&&e.value<=V[V.length-1]:e.value<=V[0])||T===`inverted`&&(z?e.value<=V[0]||e.value>=V[V.length-1]:e.value>=V[0]),(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsx)(ve,{"data-index":t,...ye,...!A(ve)&&{markActive:i},style:{...r,...ye.style},className:q(ye.className,i&&W.markActive)}),e.label==null?null:(0,Z.jsx)(be,{"aria-hidden":!0,"data-index":t,...J,...!A(be)&&{markLabelActive:i},style:{...r,...J.style},className:q(W.markLabel,J.className,i&&W.markLabelActive),children:e.label})]},t)}),V.map((e,t)=>{let n=je(e,_,g),r=M[L].offset(n),s=O===`off`?Qe:ge;return(0,Z.jsx)(s,{...!A(s)&&{valueLabelFormat:ie,valueLabelDisplay:O,value:typeof ie==`function`?ie(S(e),t):ie,index:t,open:I===t||oe===t||O===`on`,disabled:f},..._e,children:(0,Z.jsx)(me,{"data-index":t,...he,className:q(W.thumb,he.className,oe===t&&W.active,R===t&&W.focusVisible),style:{...r,...U(t),...he.style},children:(0,Z.jsx)(xe,{"data-index":t,"aria-label":p?p(t):i,"aria-valuenow":S(e),"aria-labelledby":o,"aria-valuetext":m?m(S(e),t):a,value:V[t],...Y})})},t)})]})}),et=X.createContext({}),tt=X.createContext(void 0);function nt(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}function rt(e,t){let{children:n,disabled:r=!1,selected:i=!1,value:a}=e,o=ee(),s=y({id:a,ref:t,disabled:r,selected:i}),c=o.getItemMap().size===0&&i?0:s.tabIndex;return X.cloneElement(X.Children.only(n),{...s,tabIndex:n.props.tabIndex??c})}var it=X.forwardRef(rt),at=e=>{let{classes:t,fullWidth:n,selected:r,disabled:i,size:a,color:o}=e,c={root:[`root`,r&&`selected`,i&&`disabled`,n&&`fullWidth`,`size${s(a)}`,o]};return K(c,xe,t)},ot=u(a,{name:`MuiToggleButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`size${s(n.size)}`]]}})(G(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${Y.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:`none`,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},variants:[{props:{color:`standard`},style:{[`&.${Y.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(g()).map(([t])=>({props:{color:t},style:{[`&.${Y.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:`100%`}},{props:{size:`small`},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),st=X.forwardRef(function(e,t){let{value:n,isRovingTabIndex:r,...i}=X.useContext(et),a=X.useContext(tt),o=de({...i,selected:nt(e.value,n)},e),s=d({props:o,name:`MuiToggleButton`}),{children:c,className:l,color:u=`standard`,disabled:f=!1,disableFocusRipple:p=!1,fullWidth:m=!1,onChange:h,onClick:g,selected:_,size:v=`medium`,value:y,...ee}=s,te={...s,color:u,disabled:f,disableFocusRipple:p,fullWidth:m,size:v},ne=at(te),b=e=>{g&&(g(e,y),e.defaultPrevented)||h&&h(e,y)},x=a||``,S=(0,Z.jsx)(ot,{className:q(i.className,ne.root,l,x),internalNativeButton:!0,disabled:f,focusRipple:!p,ref:r?void 0:t,onClick:b,onChange:h,value:y,ownerState:te,"aria-pressed":_,...ee,children:c});return r?(0,Z.jsx)(it,{disabled:f,selected:_,ref:t,value:y,children:S}):S});function ct(e){return X.Children.toArray(e).filter(e=>X.isValidElement(e))}function lt(e){return R(`MuiToggleButtonGroup`,e)}var Q=O(`MuiToggleButtonGroup`,[`root`,`selected`,`horizontal`,`vertical`,`disabled`,`grouped`,`fullWidth`,`firstButton`,`lastButton`,`middleButton`]),ut=e=>{let{classes:t,orientation:n,fullWidth:r,disabled:i}=e;return K({root:[`root`,n,r&&`fullWidth`],grouped:[`grouped`,i&&`disabled`],firstButton:[`firstButton`],lastButton:[`lastButton`],middleButton:[`middleButton`]},lt,t)},dt=u(`div`,{name:`MuiToggleButtonGroup`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Q.grouped}`]:t.grouped},{[`& .${Q.firstButton}`]:t.firstButton},{[`& .${Q.lastButton}`]:t.lastButton},{[`& .${Q.middleButton}`]:t.middleButton},t.root,n.orientation===`vertical`&&t.vertical,n.fullWidth&&t.fullWidth]}})(G(({theme:e})=>({display:`inline-flex`,borderRadius:(e.vars||e).shape.borderRadius,...e.focusVisible&&{[`& .${Q.grouped}.${i.focusVisible}`]:{zIndex:1}},variants:[{props:{orientation:`vertical`},style:{flexDirection:`column`,[`& .${Q.grouped}`]:{[`&.${Q.selected} + .${Q.grouped}.${Q.selected}`]:{borderTop:0,marginTop:0}},[`& .${Q.firstButton},& .${Q.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Q.lastButton},& .${Q.middleButton}`]:{marginTop:-1,borderTop:`1px solid transparent`,borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Q.lastButton}.${Y.disabled},& .${Q.middleButton}.${Y.disabled}`]:{borderTop:`1px solid transparent`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{orientation:`horizontal`},style:{[`& .${Q.grouped}`]:{[`&.${Q.selected} + .${Q.grouped}.${Q.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Q.firstButton},& .${Q.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Q.lastButton},& .${Q.middleButton}`]:{marginLeft:-1,borderLeft:`1px solid transparent`,borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Q.lastButton}.${Y.disabled},& .${Q.middleButton}.${Y.disabled}`]:{borderLeft:`1px solid transparent`}}}]}))),ft=X.forwardRef(function(e,t){let n=d({props:e,name:`MuiToggleButtonGroup`}),{children:i,className:a,color:o=`standard`,disabled:s=!1,exclusive:c=!1,fullWidth:l=!1,onChange:u,orientation:f=`horizontal`,size:p=`medium`,value:m,...h}=n,g={...n,disabled:s,fullWidth:l,orientation:f,size:p},_=ut(g),v=ae(),y=X.useCallback((e,t)=>{if(!u)return;let n=m&&m.indexOf(t),r;m&&n>=0?(r=m.slice(),r.splice(n,1)):r=m?m.concat(t):[t],u(e,r)},[u,m]),ee=X.useCallback((e,t)=>{u&&u(e,m===t?null:t)},[u,m]),te=X.useMemo(()=>({className:_.grouped,onChange:c?ee:y,value:m,size:p,fullWidth:l,color:o,disabled:s,isRovingTabIndex:!0}),[_.grouped,c,ee,y,m,p,l,o,s]),ne=ct(i),b=ne.length,x=e=>{let t=e===0,n=e===b-1;return t&&n?``:t?_.firstButton:n?_.lastButton:_.middleButton},S=r({orientation:f,isRtl:v}),C=S.getContainerProps(t,h.onFocus,h.onKeyDown);return(0,Z.jsx)(dt,{role:`group`,className:q(_.root,a),ownerState:g,...h,...C,children:(0,Z.jsx)(ge.Provider,{value:S,children:(0,Z.jsx)(et.Provider,{value:te,children:ne.map((e,t)=>(0,Z.jsx)(tt.Provider,{value:x(t),children:e},t))})})})});function pt(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function mt(e,t,n,r={},i=()=>{}){let{ease:a=pt,duration:o=300}=r,s=null,c=t[e],l=!1,u=()=>{l=!0},d=r=>{if(l){i(Error(`Animation cancelled`));return}s===null&&(s=r);let u=Math.min(1,(r-s)/o);if(t[e]=a(u)*(n-c)+c,u>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return c===n?(i(Error(`Element already at target position`)),u):(requestAnimationFrame(d),u)}var ht={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`,pointerEvents:`none`};function gt(e){let{onChange:t,...n}=e,r=X.useRef(),i=X.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return te(()=>{let e=v(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=f(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),X.useEffect(()=>{a(),t(r.current)},[t]),(0,Z.jsx)(`div`,{style:ht,...n,ref:i})}var _t=ye((0,Z.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),vt=ye((0,Z.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function yt(e){return R(`MuiTabScrollButton`,e)}var bt=O(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),xt=e=>{let{classes:t,orientation:n,disabled:r}=e;return K({root:[`root`,n,r&&`disabled`]},yt,t)},St=u(a,{name:`MuiTabScrollButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${bt.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),Ct=X.forwardRef(function(e,t){let n=d({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,{nativeButton:u,...f}=l,p=ae(),m={isRtl:p,...n},h=xt(m),g=i.StartScrollButtonIcon??_t,_=i.EndScrollButtonIcon??vt,v=he({elementType:g,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:m}),y=he({elementType:_,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:m});return(0,Z.jsx)(St,{component:`div`,className:q(h.root,r),ref:t,role:null,ownerState:m,tabIndex:null,...f,style:{...f.style,...s===`vertical`&&{"--TabScrollButton-svgRotate":`rotate(${p?-90:90}deg)`}},children:o===`left`?(0,Z.jsx)(g,{...v}):(0,Z.jsx)(_,{...y})})});function wt(e){return R(`MuiTabs`,e)}var Tt=O(`MuiTabs`,[`root`,`vertical`,`list`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),Et=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return K({root:[`root`,t&&`vertical`],scroller:[`scroller`,n&&`fixed`,r&&`hideScrollbar`,i&&`scrollableX`,a&&`scrollableY`],list:[`list`,t&&`vertical`,o&&`centered`],indicator:[`indicator`],scrollButtons:[`scrollButtons`,s&&`scrollButtonsHideMobile`],scrollableX:[i&&`scrollableX`],hideScrollbar:[r&&`hideScrollbar`]},wt,c)},Dt=u(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Tt.scrollButtons}`]:t.scrollButtons},{[`& .${Tt.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(G(({theme:e})=>({overflow:`hidden`,minHeight:48,WebkitOverflowScrolling:`touch`,display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${Tt.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),Ot=u(`div`,{name:`MuiTabs`,slot:`Scroller`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:`relative`,display:`inline-block`,flex:`1 1 auto`,whiteSpace:`nowrap`,variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:`hidden`,width:`100%`}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:`auto`,overflowY:`hidden`}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:`auto`,overflowX:`hidden`}}]}),kt=u(`div`,{name:`MuiTabs`,slot:`List`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,n.centered&&t.centered]}})({display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.centered,style:{justifyContent:`center`}}]}),At=u(`span`,{name:`MuiTabs`,slot:`Indicator`})(G(({theme:e})=>({position:`absolute`,height:2,bottom:0,width:`100%`,...n(e),variants:[{props:{indicatorColor:`primary`},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:`secondary`},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:`100%`,width:2,right:0}}]}))),jt=u(gt)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),Mt={},Nt=X.forwardRef(function(e,t){let n=d({props:e,name:`MuiTabs`}),i=x(),a=ae(),s=h(i.motion.reducedMotion,!1),{"aria-label":l,"aria-labelledby":u,action:p,centered:m=!1,children:g,className:_,component:y=`div`,allowScrollButtonsMobile:ee=!1,indicatorColor:te=`primary`,onChange:S,orientation:C=`horizontal`,scrollButtons:w=`auto`,selectionFollowsFocus:T,slots:D={},slotProps:O={},textColor:ie=`primary`,value:k,variant:A=`standard`,visibleScrollbar:j=!1,...M}=n,N=A===`scrollable`,P=C===`vertical`,F=P?`scrollTop`:`scrollLeft`,I=P?`top`:`left`,oe=P?`bottom`:`right`,L=P?`clientHeight`:`clientWidth`,R=P?`height`:`width`,z={...n,component:y,allowScrollButtonsMobile:ee,indicatorColor:te,orientation:C,vertical:P,scrollButtons:w,textColor:ie,variant:A,visibleScrollbar:j,fixed:!N,hideScrollbar:N&&!j,scrollableX:N&&!P,scrollableY:N&&P,centered:m&&!N,scrollButtonsHideMobile:!ee},B=Et(z),se=he({elementType:D.startScrollButtonIcon,externalSlotProps:O.startScrollButtonIcon,ownerState:z}),V=he({elementType:D.endScrollButtonIcon,externalSlotProps:O.endScrollButtonIcon,ownerState:z}),[H,ce]=X.useState(!1),[U,W]=X.useState(Mt),[G,le]=X.useState(!1),[K,ue]=X.useState(!1),[de,fe]=X.useState(!1),pe=k===!1?null:k,[me,_e]=X.useState(!1),[ve,ye]=X.useState({overflow:`hidden`,scrollbarWidth:0}),be=new Map,J=X.useRef(null),xe=X.useRef(null),Y={slots:D,slotProps:O},Se=()=>{let e=J.current,t;if(e){let n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let n;if(e&&k!==!1){let e=xe.current.children;if(e.length>0){let t=e[be.get(k)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},Ce=o(()=>{let{tabsMeta:e,tabMeta:t}=Se(),n=0,r;P?(r=`top`,t&&e&&(n=t.top-e.top+e.scrollTop)):(r=a?`right`:`left`,t&&e&&(n=(a?-1:1)*(t[r]-e[r]+e.scrollLeft)));let i={[r]:n,[R]:t?t[R]:0};if(typeof U[r]!=`number`||typeof U[R]!=`number`)W(i);else{let e=Math.abs(U[r]-i[r]),t=Math.abs(U[R]-i[R]);(e>=1||t>=1)&&W(i)}}),we=(e,{animation:t=!0}={})=>{t&&!s.shouldReduceMotion?mt(F,J.current,e,{duration:i.transitions.duration.standard}):J.current[F]=e},Te=e=>{let t=J.current[F];t+=P?e:e*(a?-1:1),we(t)},Ee=()=>{let e=J.current[L],t=0,n=Array.from(xe.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[L]>e){r===0&&(t=e);break}t+=i[L]}return t},De=()=>{Te(-1*Ee())},Oe=()=>{Te(Ee())},[ke,{onChange:Ae,...je}]=E(`scrollbar`,{className:q(B.scrollableX,B.hideScrollbar),elementType:jt,shouldForwardComponentProp:!0,externalForwardedProps:Y,ownerState:z}),Me=X.useCallback(e=>{Ae?.(e),ye({overflow:null,scrollbarWidth:e})},[Ae]),[Ne,Pe]=E(`scrollButtons`,{className:B.scrollButtons,elementType:Ct,externalForwardedProps:Y,ownerState:z,additionalProps:{orientation:C,slots:{StartScrollButtonIcon:D.startScrollButtonIcon,EndScrollButtonIcon:D.endScrollButtonIcon},slotProps:{startScrollButtonIcon:se,endScrollButtonIcon:V}}}),Fe=()=>{let e={};e.scrollbarSizeListener=N?(0,Z.jsx)(ke,{...je,onChange:Me}):null;let t=N&&(w===`auto`&&(G||K)||w===!0);return e.scrollButtonStart=t?(0,Z.jsx)(Ne,{direction:a?`right`:`left`,onClick:De,disabled:!G,...Pe}):null,e.scrollButtonEnd=t?(0,Z.jsx)(Ne,{direction:a?`left`:`right`,onClick:Oe,disabled:!K,...Pe}):null,e},Ie=o(e=>{let{tabsMeta:t,tabMeta:n}=Se();if(n&&t){if(n[I]<t[I]){let r=t[F]+(n[I]-t[I]);we(r,{animation:e})}else if(n[oe]>t[oe]){let r=t[F]+(n[oe]-t[oe]);we(r,{animation:e})}}}),Le=o(()=>{N&&w!==!1&&fe(!de)});X.useEffect(()=>{let e=v(()=>{J.current&&Ce()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Le()},r=f(J.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(xe.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(xe.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[Ce,Le]),X.useEffect(()=>{let e=Array.from(xe.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&N&&w!==!1){let n=e[0],r=e[t-1],i={root:J.current,threshold:.99},a=new IntersectionObserver(e=>{le(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{ue(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[N,w,de,g?.length]),X.useEffect(()=>{ce(!0)},[]),X.useEffect(()=>{Ce()}),X.useEffect(()=>{Ie(Mt!==U)},[Ie,U]),X.useImperativeHandle(p,()=>({updateIndicator:Ce,updateScrollButtons:Le}),[Ce,Le]);let[Re,ze]=E(`indicator`,{className:B.indicator,elementType:At,externalForwardedProps:Y,ownerState:z,additionalProps:{style:U}}),Be=(0,Z.jsx)(Re,{...ze}),Ve=r({activeItemId:me?void 0:pe,orientation:C,isRtl:a}),He=Ve.getContainerProps(),Ue=X.Children.toArray(g).filter(X.isValidElement).map((e,t)=>{let n=e.props.value===void 0?t:e.props.value;return be.set(n,t),{child:e,index:t,childValue:n}}).map(({child:e,childValue:t})=>{let n=t===k;return X.cloneElement(e,{fullWidth:A===`fullWidth`,indicator:n&&!H&&Be,selected:n,selectionFollowsFocus:T,onChange:S,textColor:ie,value:t})}),We=Fe(),[Ge,Ke]=E(`root`,{ref:t,className:q(B.root,_),elementType:Dt,externalForwardedProps:{...Y,...M,component:y},ownerState:z}),[qe,Je]=E(`scroller`,{ref:J,className:B.scroller,elementType:Ot,externalForwardedProps:Y,ownerState:z,additionalProps:{style:{overflow:ve.overflow,[P?`margin${a?`Left`:`Right`}`:`marginBottom`]:j?void 0:-ve.scrollbarWidth}}}),Ye=b(He.ref,xe),Xe=e=>{let t=xe.current;ne(c(t))?.getAttribute(`role`)===`tab`&&He.onKeyDown(e)},[Ze,Qe]=E(`list`,{ref:Ye,className:B.list,elementType:kt,externalForwardedProps:Y,ownerState:z,getSlotProps:e=>({...e,onBlur:t=>{re(t.currentTarget,t.relatedTarget)||_e(!1),e.onBlur?.(t)},onKeyDown:t=>{Xe(t),e.onKeyDown?.(t)},onFocus:t=>{_e(!0),He.onFocus(t),e.onFocus?.(t)}})});return(0,Z.jsxs)(Ge,{...Ke,children:[We.scrollButtonStart,We.scrollbarSizeListener,(0,Z.jsxs)(qe,{...Je,children:[(0,Z.jsx)(Ze,{"aria-label":l,"aria-labelledby":u,"aria-orientation":C===`vertical`?`vertical`:null,role:`tablist`,...Qe,children:(0,Z.jsx)(ge.Provider,{value:Ve,children:Ue})}),H&&Be]}),We.scrollButtonEnd]})});function Pt(e){return R(`MuiTab`,e)}var $=O(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`icon`]),Ft=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:c,disabled:l}=e,u={root:[`root`,a&&o&&`labelIcon`,`textColor${s(n)}`,r&&`fullWidth`,i&&`wrapped`,c&&`selected`,l&&`disabled`],icon:[`icon`]};return K(u,Pt,t)},It=u(a,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${s(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${$.icon}`]:t.icon}]}})(G(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:`relative`,minHeight:48,flexShrink:0,padding:`12px 16px`,overflow:`hidden`,whiteSpace:`normal`,textAlign:`center`,lineHeight:1.25,...e.focusVisible&&pe(3),variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition===`top`||e.iconPosition===`bottom`),style:{flexDirection:`column`}},{props:({ownerState:e})=>e.label&&e.iconPosition!==`top`&&e.iconPosition!==`bottom`,style:{flexDirection:`row`}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`top`,style:{[`& > .${$.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${$.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${$.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${$.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${$.selected}`]:{opacity:1},...e.focusVisible&&{[`&.${i.focusVisible}`]:{opacity:1}},[`&.${$.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${$.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${$.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${$.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${$.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:`none`}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Lt=X.forwardRef(function(e,t){let n=d({props:e,name:`MuiTab`}),{className:r,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:o,icon:s,iconPosition:c=`top`,indicator:l,label:u,onChange:f,onClick:p,onFocus:m,selected:h,selectionFollowsFocus:g,textColor:_=`inherit`,value:v,wrapped:te=!1,...ne}=n,b=ee(),x=y({id:v,ref:t,disabled:i,selected:h}),S=b.getItemMap().size===0&&h?0:x.tabIndex,C={...n,disabled:i,disableFocusRipple:a,selected:h,icon:!!s,iconPosition:c,label:!!u,fullWidth:o,textColor:_,wrapped:te},re=Ft(C),w=s&&u&&X.isValidElement(s)?X.cloneElement(s,{className:q(re.icon,s.props.className)}):s;return(0,Z.jsxs)(It,{internalNativeButton:!0,focusRipple:!a,className:q(re.root,r),ref:x.ref,role:`tab`,"aria-selected":h,disabled:i,onClick:e=>{!h&&f&&f(e,v),p&&p(e)},onFocus:e=>{g&&!h&&f&&f(e,v),m&&m(e)},tabIndex:S,ownerState:C,...ne,children:[c===`top`||c===`start`?(0,Z.jsxs)(X.Fragment,{children:[w,u]}):(0,Z.jsxs)(X.Fragment,{children:[u,w]}),l]})}),Rt=[{id:`theme`,label:`Theme`}],zt=`themePreset`,Bt=`custom`,Vt={accent:`themeAccent`,fields:[`groundC1`,`groundC2`,`groundC3`,`groundC4`,`groundC5`],line:`groundLine`},Ht=w.find(e=>e.id===F.dark);if(Ht===void 0)throw Error(`The Design Lab needs the default dark theme`);var Ut=[`top left`,`top right`,`bottom left`,`middle, the darkest in dark`,`bottom right`],Wt=[{id:zt,kind:`choice`,group:`theme`,label:`Theme`,default:Ht.id,question:`A theme for its mode, as the user menu sets it. Choosing one also switches to its mode; editing a colour below makes the colours your own.`,options:[...w.map(e=>({value:e.id,label:`${e.mode===`dark`?`Dark`:`Light`} · ${e.label}`})),{value:Bt,label:`Custom`}],sets:Object.fromEntries(w.map(e=>[e.id,{[Vt.accent]:e.colors.accent,...Object.fromEntries(Vt.fields.map((t,n)=>[t,e.colors.fields[n]??``])),[Vt.line]:e.colors.line}]))},{id:Vt.accent,kind:`color`,group:`theme`,label:`Accent`,default:Ht.colors.accent,customises:zt,question:`Buttons, links, focus and selection. Octopus deepens or lifts it per role until it passes AA.`},...Vt.fields.map((e,t)=>({id:e,kind:`color`,group:`theme`,label:`Field ${t+1}`,default:Ht.colors.fields[t]??`#000000`,customises:zt,question:`The colour field at the ${Ut[t]??``}. Deepened (dark) or lightened (light) if the chrome over it would not stay legible.`})),{id:Vt.line,kind:`color`,group:`theme`,label:`Lines`,default:Ht.colors.line,customises:zt,question:`The colour of the ground's lines.`},{id:`themeFade`,kind:`slider`,group:`theme`,label:`Switch fade`,cssVar:le,min:0,max:1e3,step:50,unit:`ms`,default:Number.parseInt(se,10),question:`How long a change of theme or mode crossfades, the whole page at once. 0 swaps it in a single frame.`}],Gt=/^#[0-9a-f]{6}$/i;function Kt(e,t){let n=e[t];return typeof n==`string`&&Gt.test(n)?n.toUpperCase():null}function qt(e){let t=H(e[zt]);if(t!==void 0)return{kind:`theme`,theme:t};let n=Kt(e,Vt.accent),r=Vt.fields.map(t=>Kt(e,t)),i=Kt(e,Vt.line);return n===null||i===null||r.some(e=>e===null)?{kind:`none`}:{kind:`custom`,colors:{accent:n,fields:r,line:i}}}var Jt=`aistrike.lab`;function Yt(e){return Object.fromEntries(e.map(e=>[e.id,e.default]))}var Xt=/^#[0-9a-f]{6}$/i,Zt=`custom`;function Qt(e,t){switch(e.kind){case`slider`:return typeof t==`number`&&Number.isFinite(t)&&t>=e.min&&t<=e.max;case`color`:return typeof t==`string`&&Xt.test(t);default:return typeof t==`string`&&e.options.some(e=>e.value===t)}}function $t(e,t){let n=typeof e==`object`&&e&&!Array.isArray(e)?e:{};return Object.fromEntries(t.map(e=>{let t=n[e.id];return[e.id,Qt(e,t)?t:e.default]}))}function en(e,t){let n={...e};for(let e of t){if(e.kind!==`choice`||e.sets===void 0)continue;let t=e.sets[String(n[e.id])];!(t===void 0||Object.entries(t).every(([e,t])=>n[e]===t))&&Qt(e,Zt)&&(n[e.id]=Zt)}return n}function tn(e,t=localStorage){try{return en($t(JSON.parse(t.getItem(`aistrike.lab`)??`null`),e),e)}catch{return Yt(e)}}function nn(e,t=localStorage){try{t.setItem(Jt,JSON.stringify(e))}catch{}}function rn(e,t,n=document.documentElement){for(let r of t){let t=e[r.id]??r.default;r.kind===`choice`?r.attr!==void 0&&n.setAttribute(r.attr,String(t)):r.cssVar!==void 0&&(t===r.default?n.style.removeProperty(r.cssVar):n.style.setProperty(r.cssVar,`${t}${r.kind===`slider`?r.unit:``}`))}}var an=e=>e.kind===`choice`&&e.viewing===!0;function on(e,t){let n=$t(e,t);return{lockedAt:new Date().toISOString(),values:n,changed:t.filter(e=>!an(e)&&n[e.id]!==e.default).map(e=>e.id)}}function sn(e,t,n){if(e.kind!==`choice`||typeof t!=`string`)return{};let r={};for(let[i,a]of Object.entries(e.sets?.[t]??{})){let e=n.get(i);e!==void 0&&Qt(e,a)&&(r[i]=a)}return r}function cn(e,t){if(e.kind===`choice`||e.customises===void 0)return;let n=t.get(e.customises);return n!==void 0&&Qt(n,Zt)?n.id:void 0}function ln(e){let{controls:t}=e,n=e.root??document.documentElement,r=e.storage??localStorage,i=new Map(t.map(e=>[e.id,e])),a=L(tn(t,r));rn(a.get(),t,n);let o=e=>{rn(e,t,n),nn(e,r),a.set(e)};return{store:a,set(e,t){let n=i.get(e);if(n===void 0||!Qt(n,t))return;let r={...a.get(),[e]:t,...sn(n,t,i)},s=cn(n,i);s!==void 0&&(r[s]=Zt),o(r)},reset(){let e=t.filter(an).map(e=>[e.id,a.get()[e.id]??e.default]);o({...Yt(t),...Object.fromEntries(e)})}}}var un=`/api/lab/decisions`;function dn({control:e,value:t,onChange:n}){return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`},children:[(0,Z.jsx)(m,{variant:`subtitle2`,component:`span`,children:e.label}),(0,Z.jsx)(m,{variant:`caption`,component:`span`,sx:{fontVariantNumeric:`tabular-nums`},children:`${t}${e.unit}`})]}),(0,Z.jsx)(m,{variant:`caption`,component:`p`,sx:{m:0,color:`var(--ds-text-quiet)`},children:e.question}),(0,Z.jsx)($e,{size:`small`,"aria-label":e.label,min:e.min,max:e.max,step:e.step,value:t,onChange:(...[,t])=>n(Array.isArray(t)?t[0]??e.default:t)})]})}var fn=1250,pn=4,mn=`aria-label`,hn=/^#[0-9a-f]{6}$/i;function gn({control:e}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(m,{variant:`subtitle2`,component:`span`,children:e.label}),(0,Z.jsx)(m,{variant:`caption`,component:`p`,sx:{m:0,mb:.75,color:`var(--ds-text-quiet)`},children:e.question})]})}function _n({control:e,value:t,onChange:n}){return e.options.length>pn?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(gn,{control:e}),(0,Z.jsx)(P,{fullWidth:!0,size:`small`,value:t,onChange:e=>n(e.target.value),SelectDisplayProps:{[mn]:e.label},children:e.options.map(e=>(0,Z.jsx)(ve,{value:e.value,children:e.label},e.value))})]}):(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(m,{variant:`subtitle2`,component:`span`,children:e.label}),(0,Z.jsx)(m,{variant:`caption`,component:`p`,sx:{m:0,mb:.75,color:`var(--ds-text-quiet)`},children:e.question}),(0,Z.jsx)(ft,{exclusive:!0,fullWidth:!0,size:`small`,"aria-label":e.label,value:t,onChange:(...[,e])=>{e!==null&&n(e)},children:e.options.map(e=>(0,Z.jsx)(st,{value:e.value,sx:{textTransform:`none`,py:.25},children:e.label},e.value))})]})}function vn({control:e,value:t,onChange:n}){let[r,i]=(0,X.useState)(t),[a,o]=(0,X.useState)(t);t!==a&&(o(t),i(t));let s=e=>{i(e),hn.test(e)&&n(e)};return(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(gn,{control:e}),(0,Z.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`},children:[(0,Z.jsx)(`input`,{type:`color`,"aria-label":`${e.label} swatch`,value:(hn.test(r)?r:t).toLowerCase(),onChange:e=>s(e.target.value),style:{width:36,height:28,padding:0,border:`none`,background:`none`,cursor:`pointer`,flexShrink:0}}),(0,Z.jsx)(z,{fullWidth:!0,size:`small`,value:r,onChange:e=>s(e.target.value),slotProps:{htmlInput:{[mn]:e.label,spellCheck:!1,maxLength:7}}})]})]})}function yn({control:e,value:t,onChange:n}){switch(e.kind){case`slider`:return(0,Z.jsx)(dn,{control:e,value:Number(t),onChange:n});case`color`:return(0,Z.jsx)(vn,{control:e,value:String(t),onChange:n});default:return(0,Z.jsx)(_n,{control:e,value:String(t),onChange:n})}}function bn({lab:e,controls:n,fetch:r=fetch}){let i=me(e.store,e=>e),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(null),d=(0,X.useRef)(null),f=(0,X.useRef)(null);(0,X.useEffect)(()=>{let e=e=>{f.current!==null&&u({left:Math.max(0,e.clientX-f.current.dx),top:Math.max(0,e.clientY-f.current.dy)})},t=()=>{f.current=null};return addEventListener(`pointermove`,e),addEventListener(`pointerup`,t),()=>{removeEventListener(`pointermove`,e),removeEventListener(`pointerup`,t)}},[]);let h=e=>{if(e.button!==0||e.target.closest(`button`)!==null)return;let t=d.current?.getBoundingClientRect();f.current={dx:e.clientX-(t?.left??0),dy:e.clientY-(t?.top??0)}},g=Rt.filter(e=>n.some(t=>t.group===e.id)),[_,v]=(0,X.useState)(null),y=g.find(e=>e.id===_)?.id??g[0]?.id,ee=async()=>{let e=on(i,n);try{let t=await r(un,{method:`POST`,headers:[[`content-type`,`application/json`]],body:JSON.stringify(e)});if(!t.ok){c(`Not saved: the lab server answered ${t.status}.`);return}let n=e.changed.length;c(`Locked ${n} decision${n===1?``:`s`} at ${new Date(e.lockedAt).toLocaleTimeString()}.`)}catch(e){c(`Not saved: ${e instanceof Error?e.message:String(e)}.`)}};return a?(0,Z.jsxs)(j,{ref:d,rung:`raised`,component:`section`,"aria-label":`Design Lab`,style:l===null?{left:100,bottom:14}:{left:l.left,top:l.top},sx:{position:`fixed`,zIndex:fn,width:320,maxHeight:`calc(100vh - 110px)`,display:`flex`,flexDirection:`column`,borderRadius:M(p.card),boxShadow:`var(--ds-shadow-agent)`},children:[(0,Z.jsxs)(`div`,{onPointerDown:h,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`10px 8px 6px 16px`,cursor:`move`,touchAction:`none`,userSelect:`none`},children:[(0,Z.jsx)(m,{variant:`subtitle1`,component:`h2`,children:`Design Lab`}),(0,Z.jsx)(U,{size:`small`,label:`Close Design Lab`,icon:(0,Z.jsx)(I,{}),onClick:()=>o(!1)})]}),(0,Z.jsx)(`div`,{style:{padding:`0 12px 8px`},children:(0,Z.jsx)(Nt,{value:y??!1,"aria-label":`Control groups`,onChange:(...[,e])=>v(e),children:g.map(e=>(0,Z.jsx)(Lt,{value:e.id,label:e.label},e.id))})}),(0,Z.jsx)(`div`,{role:`tabpanel`,"aria-label":g.find(e=>e.id===y)?.label,style:{overflowY:`auto`,padding:`4px 16px 12px`,display:`grid`,gap:14},children:n.filter(e=>e.group===y).map(t=>(0,Z.jsx)(yn,{control:t,value:i[t.id]??t.default,onChange:n=>e.set(t.id,n)},t.id))}),(0,Z.jsxs)(`div`,{style:{padding:`10px 16px 12px`,display:`grid`,gap:8,borderTop:`1px solid var(--ds-separator)`},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,gap:8,justifyContent:`flex-end`},children:[(0,Z.jsx)(N,{variant:`ghost`,size:`small`,onClick:()=>e.reset(),children:`Reset`}),(0,Z.jsx)(N,{variant:`primary`,size:`small`,onClick:()=>{ee().catch(()=>void 0)},children:`Lock in`})]}),(0,Z.jsx)(m,{variant:`caption`,role:`status`,sx:{minHeight:16,color:`var(--ds-text-quiet)`},children:s})]})]}):(0,Z.jsx)(`div`,{style:{position:`fixed`,left:100,bottom:14,zIndex:fn},children:(0,Z.jsx)(N,{variant:`secondary`,size:`small`,startIcon:(0,Z.jsx)(t,{}),"aria-label":`Open Design Lab`,onClick:()=>o(!0),children:`Design Lab`})})}var xn;function Sn(){return xn??=ln({controls:Wt}),xn}function Cn(e,t){let n=JSON.stringify(qt(e.store.get()));return e.store.subscribe(()=>{let r=qt(e.store.get()),i=JSON.stringify(r);i!==n&&(n=i,r.kind===`theme`?(t.set(fe[r.theme.mode],r.theme.id),t.remove(ue),t.set(D,r.theme.mode)):r.kind===`custom`&&t.set(ue,r.colors))})}function wn(){let e=Sn(),t=ie();return(0,X.useEffect)(()=>Cn(e,t),[e,t]),(0,Z.jsx)(bn,{lab:e,controls:Wt})}export{wn as default,Cn as followLabTheme,Sn as getLab};