@smwb/ui-react 2.5.0 → 2.6.0
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/assets/styles/less/components/confirmDialog/confirmDialog.entry.css +1 -0
- package/dist/assets/styles/less/components/fileDrop/fileDrop.entry.css +1 -0
- package/dist/assets/styles/less/components/fileInput/fileInput.entry.css +1 -0
- package/dist/assets/styles/less/components/floatingWindow/floatingWindow.entry.css +1 -0
- package/dist/components/dataDisplay/chat/chat.d.ts +1 -1
- package/dist/components/dataDisplay/chat/chat.js.map +1 -1
- package/dist/components/dataDisplay/chat/useChatFileUpload.d.ts +16 -4
- package/dist/components/dataDisplay/chat/useChatFileUpload.js +38 -29
- package/dist/components/dataDisplay/chat/useChatFileUpload.js.map +1 -1
- package/dist/components/feedBack/confirmDialog/confirmDialog.d.ts +27 -0
- package/dist/components/feedBack/confirmDialog/confirmDialog.js +49 -0
- package/dist/components/feedBack/confirmDialog/confirmDialog.js.map +1 -0
- package/dist/components/feedBack/confirmDialog/index.d.ts +2 -0
- package/dist/components/inputs/fileDrop/countPreview.js +15 -0
- package/dist/components/inputs/fileDrop/countPreview.js.map +1 -0
- package/dist/components/inputs/fileDrop/fileDrop.d.ts +1 -1
- package/dist/components/inputs/fileDrop/fileDrop.js +60 -0
- package/dist/components/inputs/fileDrop/fileDrop.js.map +1 -0
- package/dist/components/inputs/fileDrop/index.d.ts +9 -0
- package/dist/components/inputs/fileDrop/preview.js +41 -0
- package/dist/components/inputs/fileDrop/preview.js.map +1 -0
- package/dist/components/inputs/fileDrop/previewWrapper.js +27 -0
- package/dist/components/inputs/fileDrop/previewWrapper.js.map +1 -0
- package/dist/components/inputs/fileDrop/utils.js +7 -0
- package/dist/components/inputs/fileDrop/utils.js.map +1 -0
- package/dist/components/inputs/fileInput/fileInput.d.ts +1 -1
- package/dist/components/inputs/fileInput/fileInput.js +35 -0
- package/dist/components/inputs/fileInput/fileInput.js.map +1 -0
- package/dist/components/inputs/fileInput/index.d.ts +2 -0
- package/dist/components/layout/floatingWindow/floatingWindow.d.ts +92 -0
- package/dist/components/layout/floatingWindow/floatingWindow.js +311 -0
- package/dist/components/layout/floatingWindow/floatingWindow.js.map +1 -0
- package/dist/components/layout/floatingWindow/index.d.ts +2 -0
- package/dist/headless/components/dataDisplay/chat/chat.js.map +1 -1
- package/dist/headless/components/dataDisplay/chat/useChatFileUpload.js +38 -29
- package/dist/headless/components/dataDisplay/chat/useChatFileUpload.js.map +1 -1
- package/dist/headless/components/feedBack/confirmDialog/confirmDialog.js +48 -0
- package/dist/headless/components/feedBack/confirmDialog/confirmDialog.js.map +1 -0
- package/dist/headless/components/inputs/fileDrop/countPreview.js +15 -0
- package/dist/headless/components/inputs/fileDrop/countPreview.js.map +1 -0
- package/dist/headless/components/inputs/fileDrop/fileDrop.js +59 -0
- package/dist/headless/components/inputs/fileDrop/fileDrop.js.map +1 -0
- package/dist/headless/components/inputs/fileDrop/preview.js +41 -0
- package/dist/headless/components/inputs/fileDrop/preview.js.map +1 -0
- package/dist/headless/components/inputs/fileDrop/previewWrapper.js +27 -0
- package/dist/headless/components/inputs/fileDrop/previewWrapper.js.map +1 -0
- package/dist/headless/components/inputs/fileDrop/utils.js +7 -0
- package/dist/headless/components/inputs/fileDrop/utils.js.map +1 -0
- package/dist/headless/components/inputs/fileInput/fileInput.js +34 -0
- package/dist/headless/components/inputs/fileInput/fileInput.js.map +1 -0
- package/dist/headless/components/layout/floatingWindow/floatingWindow.js +310 -0
- package/dist/headless/components/layout/floatingWindow/floatingWindow.js.map +1 -0
- package/dist/headless/hooks/useDropzone.js +47 -0
- package/dist/headless/hooks/useDropzone.js.map +1 -0
- package/dist/headless/index.js +277 -259
- package/dist/headless/index.js.map +1 -1
- package/dist/hooks/useDropzone.d.ts +44 -0
- package/dist/hooks/useDropzone.js +47 -0
- package/dist/hooks/useDropzone.js.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +277 -259
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),fe=require("@floating-ui/react"),ye=require("./config-BZIXwGpc.js"),s=require("react/jsx-runtime"),j=require("clsx"),yt=require("react-transition-group/Transition"),Ce=require("react-dom"),He=require("react-transition-group"),la=require("react-dropzone"),Xt=require("rifm"),Ys=require("uuid");class ca{constructor(t){this.cbs=[],this._value=t}setValue(t){if(this.value!==t){this._value=t;for(const n of this.cbs)n(t)}}get value(){return this._value}subscribe(t){return this.cbs.push(t),()=>{this.cbs=this.cbs.filter(n=>n!==t)}}}function ua(e){const[t,n]=i.useState(e.value);return i.useEffect(()=>(n(e.value),e.subscribe(n)),[e]),t}const _e=typeof window=="undefined"?i.useEffect:i.useLayoutEffect;var Ks=(e=>(e.dark="dark",e.light="light",e))(Ks||{});const pt="smui-theme",Ye=new ca("light"),da=()=>{const e=ua(Ye),t=i.useRef(!0);_e(()=>{const a=localStorage.getItem(pt);if(t.current)if(t.current=!1,a)Ye.setValue(a),document.documentElement.dataset.theme=a;else{const r=window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";a!==e&&Ye.setValue(r),localStorage.setItem(pt,r),document.documentElement.dataset.theme=r}},[e]);const n=function(a){if(a.storageArea===localStorage){const r=localStorage.getItem(pt);document.documentElement.dataset.theme=r,Ye.setValue(r)}};return i.useEffect(()=>(window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)),[]),{theme:e,setTheme:a=>{localStorage.setItem(pt,a),Ye.setValue.bind(Ye)(a),document.documentElement.dataset.theme=a}}};function Fe({value:e,defaultValue:t,onChange:n}){const a=e!==void 0,[r,c]=i.useState(t),o=a?e:r,l=i.useRef(o);l.current=o;const d=i.useRef(n);d.current=n;const u=i.useCallback(m=>{var f;const h=l.current,b=typeof m=="function"?m(h):m;a||c(b),(f=d.current)==null||f.call(d,b)},[a]);return[o,u]}function mt(e,t="smwb"){const n=i.useId();return e!=null?e:`${t}-${n.replace(/[:]/g,"")}`}const ma='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function fa(e,{active:t,restoreFocus:n=!0,autoFocus:a=!0}){const r=i.useRef(null);i.useEffect(()=>{if(!t)return;const c=e.current;if(!c)return;r.current=document.activeElement;const o=()=>Array.from(c.querySelectorAll(ma)).filter(d=>d.offsetParent!==null||d===document.activeElement);if(a){const d=o()[0];(d!=null?d:c).focus({preventScroll:!0})}const l=d=>{if(d.key!=="Tab")return;const u=o();if(u.length===0){d.preventDefault();return}const m=u[0],h=u[u.length-1],b=document.activeElement;d.shiftKey&&b===m?(d.preventDefault(),h.focus()):!d.shiftKey&&b===h?(d.preventDefault(),m.focus()):c.contains(b)||(d.preventDefault(),m.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),n&&r.current&&r.current.focus({preventScroll:!0})}},[t,a,n,e])}function ha({count:e,activeIndex:t,onMove:n,orientation:a="horizontal",loop:r=!0,isDisabled:c}){return i.useCallback(o=>{if(e===0)return;const l=a==="horizontal"||a==="both",d=a==="vertical"||a==="both",u=l&&o.key==="ArrowRight"||d&&o.key==="ArrowDown",m=l&&o.key==="ArrowLeft"||d&&o.key==="ArrowUp";let h=null;if(u?h=t+1:m?h=t-1:o.key==="Home"?h=0:o.key==="End"&&(h=e-1),h===null)return;const b=f=>r?(f+e)%e:Math.max(0,Math.min(e-1,f));if(h=b(h),c){let f=0;const w=u||o.key==="Home"?1:-1;for(;c(h)&&f<e;)h=b(h+w),f+=1;if(c(h))return}o.preventDefault(),n(h)},[e,t,n,a,r,c])}function Wt({itemCount:e,itemHeight:t,viewportHeight:n,overscan:a=4}){const[r,c]=i.useState(0),o=i.useCallback(l=>{c(l.currentTarget.scrollTop)},[]);return i.useMemo(()=>{const l=t>0?t:1,d=Math.ceil(n/l),u=Math.max(0,Math.floor(r/l)-a),m=Math.min(e,u+d+a*2);return{startIndex:u,endIndex:m,totalHeight:e*l,offsetY:u*l,onScroll:o}},[e,t,n,a,r,o])}function Je(e){if(e==="auto"||e==="auto-start"||e==="auto-end"){const t=e==="auto-start"?"start":e==="auto-end"?"end":null;return{autoMiddleware:fe.autoPlacement({alignment:t})}}return{placement:e}}const ms=4,Ct=8;function jt(e,t){return t!=null&&t.length?[...t,fe.flip(),fe.shift({padding:Ct})]:e.autoMiddleware?[fe.offset(ms),fe.shift({padding:Ct}),e.autoMiddleware]:[fe.offset(ms),fe.flip(),fe.shift({padding:Ct})]}const ba="bottom-start",wa=4,pa=8,_a=({x:e,y:t})=>({x:e,y:t,top:t,left:e,right:e,bottom:t,width:0,height:0});function ga(e={}){const{placement:t=ba,offsetPx:n=wa,openDelay:a=0,closeDelay:r=0,middleware:c}=e,[o,l]=i.useState(!1),d=i.useRef({x:0,y:0}),u=i.useRef({x:0,y:0}),m=i.useRef(null),h=i.useRef(null),b=i.useRef(null),f=Je(t),w=i.useMemo(()=>[fe.offset({mainAxis:n,crossAxis:n}),...f.autoMiddleware?[f.autoMiddleware]:[fe.flip()],fe.shift({padding:pa}),...c!=null?c:[]],[n,f.autoMiddleware,c]),{refs:p,floatingStyles:_,update:v}=fe.useFloating({open:o,placement:f.placement,whileElementsMounted:fe.autoUpdate,middleware:w}),g=i.useMemo(()=>({getBoundingClientRect:()=>_a(u.current)}),[]),x=i.useCallback(()=>{h.current!==null&&(clearTimeout(h.current),h.current=null),b.current!==null&&(clearTimeout(b.current),b.current=null)},[]);i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{var M;o&&(p.setPositionReference((M=m.current)!=null?M:g),v())},[o,p,v,g]);const T=i.useCallback(()=>{m.current===null&&(u.current=d.current)},[]),y=i.useCallback(()=>{x(),T(),l(!0)},[x,T]),C=i.useCallback(()=>{if(x(),a<=0){T(),l(!0);return}h.current=setTimeout(()=>{T(),l(!0)},a)},[x,T,a]),R=i.useCallback(()=>{if(x(),r<=0){l(!1);return}b.current=setTimeout(()=>l(!1),r)},[x,r]),k=i.useCallback(()=>{x(),l(!1)},[x]),N=i.useCallback(M=>{m.current=null,u.current=M},[]),S=i.useCallback(M=>{m.current=M},[]),E=i.useCallback(M=>{d.current={x:M.clientX,y:M.clientY},C()},[C]),D=i.useCallback(M=>{d.current={x:M.clientX,y:M.clientY}},[]),I=i.useCallback(M=>({onPointerEnter:F=>{var A;(A=M==null?void 0:M.onPointerEnter)==null||A.call(M,F),E(F)},onPointerMove:F=>{var A;(A=M==null?void 0:M.onPointerMove)==null||A.call(M,F),D(F)},onPointerLeave:F=>{var A;(A=M==null?void 0:M.onPointerLeave)==null||A.call(M,F),R()}}),[E,D,R]),z=i.useCallback(()=>{x(),l(!0)},[x]),$=i.useCallback(M=>({ref:p.setFloating,style:{..._,...M==null?void 0:M.style},onPointerEnter:z,onPointerLeave:R}),[p,_,z,R]);return{open:o,getReferenceProps:I,getFloatingProps:$,setAnchorEl:S,setVirtualAnchor:N,openNow:y,scheduleOpen:C,scheduleClose:R,close:k}}const Ut=i.createContext(null);function xa({source:e,icons:t,children:n}){i.useMemo(()=>{t&&ye.registerIcons(t)},[t]);const a=i.useMemo(()=>({source:e}),[e]);return s.jsx(Ut.Provider,{value:a,children:n})}const fs=()=>ye.getIconConfig().source;function Xs(e){var a;const t=i.useContext(Ut),n=i.useSyncExternalStore(ye.subscribeIcons,fs,fs);return(a=e!=null?e:t==null?void 0:t.source)!=null?a:n}const va=["primary","secondary","error","success","warning","info","disabled"],hs=new Set;function ya(e){!ye.getIconConfig().warnOnMissing||hs.has(e)||(hs.add(e),console.warn(`[smwb] Icon "${e}" is not registered. Register it (import { ${e} } from "@smwb/ui-react/icons") or use source="auto" to fall back to Material Symbols.`))}const W=i.forwardRef(function({className:t,weight:n=400,fill:a=0,size:r=20,grade:c=100,name:o,color:l="inherit",title:d,source:u,...m},h){var R,k;const b=Xs(u),f=typeof o=="string"?o:null,w=()=>{var N;return f===null?null:(N=ye.getIcon(f))!=null?N:null},p=i.useSyncExternalStore(ye.subscribeIcons,w,w),_=typeof o=="object"?o:p,v=typeof o=="string"?o:o.name,g=b==="google"?"google":_?"smwb":b==="smwb"?"missing":"google";g==="missing"&&ya(v);const x=d===void 0,T=l&&va.includes(l)?`smwb-icon_color-${l}`:null,y=typeof r=="number"?`${r}px`:r,C=Math.round(Math.min(3,Math.max(1,n/200))*100)/100;return s.jsx("span",{...m,ref:h,"data-testid":"icon","data-icon-source":g,role:x?void 0:"img","aria-hidden":x?!0:void 0,"aria-label":d,title:d,style:{...m.style,...g==="google"?{fontVariationSettings:`'FILL' ${a}, 'wght' ${n}, 'GRAD' ${c}, 'opsz' 48`}:null},className:j("smwb-icon__wrapper",T,t),children:g==="google"?s.jsx("span",{className:"material-symbols-outlined",style:{fontSize:y},children:v}):s.jsx("svg",{className:"smwb-icon__svg",viewBox:(R=_==null?void 0:_.viewBox)!=null?R:"0 0 24 24",style:{width:y,height:y},fill:"none",stroke:"currentColor",strokeWidth:C,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:(k=_==null?void 0:_.body)!=null?k:""}})})}),Ee=i.forwardRef(function({actionRef:t,className:n,classes:a,center:r,style:c,duration:o=600,color:l,...d},u){const[m,h]=i.useState([]),b=i.useRef(0);return i.useImperativeHandle(t,()=>({onRipple(f){const p=f.currentTarget.getBoundingClientRect(),_=Math.max(p.width,p.height),v=_/2;let g,x;r?(g=p.width>p.height?0:p.width/2-v,x=p.height>p.width?0:p.height/2-v):(g=f.clientX-p.left-v,x=f.clientY-p.top-v),h([...m,s.jsx("span",{className:j("smwb-ripple__child",a==null?void 0:a.child),style:{...c,left:g,top:x,width:_,height:_,backgroundColor:l!=null?l:c==null?void 0:c.backgroundColor},...d},b.current)]),b.current+=1,setTimeout(()=>{h(T=>T.slice(1))},o)}}),[d,r,m,a==null?void 0:a.child,c,o,l]),s.jsx("span",{ref:u,className:j("smwb-ripple",n,a==null?void 0:a.ripple),"data-testid":"ripple","aria-hidden":"true",children:m})});function Ws(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ge(...e){return i.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Ws(n,t)})},e)}function ja(e){const t=parseFloat(e);return!isNaN(t)&&isFinite(t)}function bs(e){return typeof e=="string"&&e[e.length-1]==="%"&&ja(e.substring(0,e.length-1))}function St(e,t){t===0&&(e!=null&&e.style)&&(e.style.display="none")}function ka(e,t){t===0&&(e!=null&&e.style)&&(e.style.display="")}const Na={animating:"rah-animating",animatingUp:"rah-animating--up",animatingDown:"rah-animating--down",animatingToHeightZero:"rah-animating--to-height-zero",animatingToHeightAuto:"rah-animating--to-height-auto",animatingToHeightSpecific:"rah-animating--to-height-specific",static:"rah-static",staticHeightZero:"rah-static--height-zero",staticHeightAuto:"rah-static--height-auto",staticHeightSpecific:"rah-static--height-specific"};function ws(e,t){return j({[e.static]:!0,[e.staticHeightZero]:t===0,[e.staticHeightSpecific]:typeof t=="number"&&t>0,[e.staticHeightAuto]:t==="auto"})}const Ra=i.forwardRef(function({animateOpacity:t=!1,animationStateClasses:n={},applyInlineTransitions:a=!0,children:r,className:c="",contentClassName:o,delay:l=0,duration:d=300,easing:u="ease",height:m,onHeightAnimationEnd:h,onHeightAnimationStart:b,style:f,...w},p){const _=i.useRef(m),v=i.useRef(null),g=i.useRef(null),x=ge(p,g),T=i.useRef(),y=i.useRef(),C=i.useRef({...Na,...n}),R=l,k=d;let N=m,S="visible";typeof N=="number"?(N=typeof m!="number"||m<0?0:m,S="hidden"):bs(N)&&(N=m==="0%"?0:m,S="hidden");const[E,D]=i.useState(N),[I,z]=i.useState(S),[$,M]=i.useState(!1),[F,A]=i.useState(ws(C.current,m));i.useEffect(()=>{St(v.current,E)},[]),i.useEffect(()=>{if(m!==_.current&&v.current){ka(v.current,_.current),v.current.style.overflow="hidden";const Z=v.current.offsetHeight;v.current.style.overflow="";const te=k+R;let L,B,K="hidden",ee;const U=_.current==="auto";typeof m=="number"?(L=m<0?0:m,B=L):bs(m)?(L=m==="0%"?0:m,B=L):(L=Z,B="auto",K=void 0),U&&(B=L,L=Z);const se=j({[C.current.animating]:!0,[C.current.animatingUp]:_.current==="auto"||m<_.current,[C.current.animatingDown]:m==="auto"||m>_.current,[C.current.animatingToHeightZero]:B===0,[C.current.animatingToHeightAuto]:B==="auto",[C.current.animatingToHeightSpecific]:typeof B=="number"&&B>0}),de=ws(C.current,B);D(L),z("hidden"),M(!U),A(se),clearTimeout(y.current),clearTimeout(T.current),U?(ee=!0,y.current=setTimeout(()=>{D(B),z(K),M(ee),b==null||b(B)},50),T.current=setTimeout(()=>{M(!1),A(de),St(v.current,B),h==null||h(B)},te)):(b==null||b(L),y.current=setTimeout(()=>{D(B),z(K),M(!1),A(de),m!=="auto"&&St(v.current,L),h==null||h(L)},te))}return _.current=m,()=>{clearTimeout(y.current),clearTimeout(T.current)}},[m]);const X={...f,height:E,overflow:I||(f==null?void 0:f.overflow)};$&&a&&(X.transition=`height ${k}ms ${u} ${R}ms`,f!=null&&f.transition&&(X.transition=`${f.transition}, ${X.transition}`),X.WebkitTransition=X.transition);const ne={};t&&(ne.transition=`opacity ${k}ms ${u} ${R}ms`,ne.WebkitTransition=ne.transition,E===0&&(ne.opacity=0));const ce=typeof w["aria-hidden"]!="undefined"?w["aria-hidden"]:m===0;return s.jsx("div",{...w,ref:x,"aria-hidden":ce,className:`${F} ${c}`,style:X,children:s.jsx("div",{className:o,style:ne,ref:v,children:r})})}),Ca=i.forwardRef(function({className:t,title:n,isOpenByDefault:a=!1,open:r,disabled:c,icon:o,id:l,children:d,startAdornment:u,noIcon:m,onToggleClick:h,onChange:b},f){const w=r!==void 0,[p,_]=i.useState(a),v=w?!!r:p,g=mt(l),x=`${g}-content`,T=`${g}-header`,y=j("smwb-accordion__arrow-icon",{"smwb-accordion__arrow-icon_opened":v}),C=R=>{if(c)return;const k=!v;w||_(k),b==null||b(k),h==null||h(R)};return s.jsxs("div",{ref:f,className:j("smwb-accordion",{"smwb-disabled":c},t),"data-testid":"accordion",children:[s.jsxs("button",{id:T,className:"smwb-accordion__header",onClick:C,type:"button",disabled:c,"aria-expanded":v,"aria-controls":d?x:void 0,children:[u==null?void 0:u(v),s.jsx("span",{className:"smwb-accordion__title",children:n}),!m&&(o!=null?o:s.jsx(W,{className:y,name:"expand_more",size:24}))]}),d&&s.jsx("div",{id:x,role:"region","aria-labelledby":T,children:s.jsx(Ra,{height:v?"auto":0,animateOpacity:!0,duration:300,className:"smwb-accordion__content",children:d})})]})}),Me=i.forwardRef(function(t,n){const{label:a,variant:r="contained",icon:c,iconProps:o={},href:l,className:d,disabled:u,children:m,onMouseDown:h,fullWidth:b,rippleCenter:f,disableRipple:w,size:p="medium",colorTheme:_="primary",color:v,...g}=t,x=v!=null?v:_,T=i.useRef(null),y=S=>{h==null||h(S)},C=S=>{var E;u||(E=T.current)==null||E.onRipple(S)},R=j("smwb-button",`smwb-${r}`,`smwb-${p}`,x==="primary"?"smwb-primary":`smwb-button_color-${x}`,d,{"smwb-disabled":u,"smwb-full-width":b}),k=!w&&s.jsx(Ee,{actionRef:T,center:f}),N=typeof c=="string"?s.jsx(W,{...o,name:c}):c;return l?s.jsxs("a",{"data-testid":"button-link",ref:n,className:R,href:l,target:"_blank",rel:"noreferrer",onMouseDown:y,onPointerDown:C,...g,children:[c&&N,a||m,k]}):s.jsxs("button",{"data-testid":"button",ref:n,className:R,onMouseDown:y,onPointerDown:C,disabled:!!u,...g,children:[c&&N,a||m,k]})}),Sa={expandRow:"Expand to full row",collapseRow:"Collapse to grid",expandFullscreen:"Expand to fullscreen",closeFullscreen:"Close fullscreen",placeholder:"Panel is open in fullscreen",placeholderClose:"Close"},ps=(e,t)=>typeof e=="function"?e(t):e,Ta=(e,t)=>typeof e=="function"?e(t):e,Ma=i.forwardRef(function({className:t,header:n,mode:a,defaultMode:r="tile",onModeChange:c,disableExpand:o=!1,noControls:l=!1,renderControls:d,closeOnOutsideClick:u=!0,closeOnEsc:m=!0,labels:h,children:b},f){const[w,p]=Fe({value:a,defaultValue:r,onChange:c}),_={...Sa,...h},[v,g]=i.useState();_e(()=>{g(document.body)},[]);const x=o?"tile":w,T=x==="row",y=x==="fullscreen",C=()=>p(I=>I==="row"?"tile":"row"),R=()=>p("fullscreen"),k=()=>p("tile"),N=I=>({mode:x,isFullscreen:I,isFullRow:I?!1:T,setMode:p,toggleRow:C,openFullscreen:R,closeFullscreen:k,labels:_}),S=I=>I?s.jsx(Me,{type:"button",variant:"outlined",size:"small","aria-label":_.closeFullscreen,title:_.closeFullscreen,onClick:k,"data-testid":"expansion-panel-close",icon:s.jsx(W,{name:"close",size:18})}):s.jsxs(s.Fragment,{children:[s.jsx(Me,{type:"button",variant:"outlined",size:"small","aria-pressed":T,"aria-label":T?_.collapseRow:_.expandRow,title:T?_.collapseRow:_.expandRow,onClick:C,"data-testid":"expansion-panel-row",icon:s.jsx(W,{name:T?"grid_view":"table_rows",size:18})}),s.jsx(Me,{type:"button",variant:"outlined",size:"small","aria-label":_.expandFullscreen,title:_.expandFullscreen,onClick:R,"data-testid":"expansion-panel-fullscreen",icon:s.jsx(W,{name:"open_in_full",size:18})})]}),E=I=>{if(o||l)return null;const z=d?Ta(d,N(I)):S(I);return z?s.jsx("div",{className:"smwb-expansion-panel__controls",children:z}):null};i.useEffect(()=>{if(!y)return;const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[y]),i.useEffect(()=>{if(!y||!m)return;const I=z=>{z.key==="Escape"&&p("tile")};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[y,m,p]);const D=s.jsxs("div",{ref:f,className:j("smwb-expansion-panel",{"smwb-expansion-panel_row":T},t),"data-testid":"expansion-panel",children:[s.jsxs("div",{className:"smwb-expansion-panel__head",children:[s.jsx("div",{className:"smwb-expansion-panel__header",children:n}),E(!1)]}),s.jsx("div",{className:"smwb-expansion-panel__body",children:ps(b,{mode:x,isFullscreen:!1,isFullRow:T})})]});return!y||!v?D:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"smwb-expansion-panel__placeholder","data-testid":"expansion-panel-placeholder",children:[s.jsx("span",{children:_.placeholder}),s.jsx(Me,{type:"button",variant:"outlined",size:"small",label:_.placeholderClose,onClick:()=>p("tile")})]}),Ce.createPortal(s.jsx("div",{className:"smwb-expansion-panel__overlay smwb-dark",role:"dialog","aria-modal":"true","data-testid":"expansion-panel-overlay",onClick:u?I=>{I.target===I.currentTarget&&p("tile")}:void 0,children:s.jsxs("div",{className:"smwb-expansion-panel__dialog",children:[s.jsxs("div",{className:"smwb-expansion-panel__head",children:[s.jsx("div",{className:"smwb-expansion-panel__header",children:n}),E(!0)]}),s.jsx("div",{className:"smwb-expansion-panel__body smwb-expansion-panel__body_fullscreen",children:ps(b,{mode:x,isFullscreen:!0,isFullRow:!1})})]})}),v)]})});function Ge({className:e,children:t,disabled:n,edge:a,color:r="default",onMouseDown:c,...o}){const l=i.useRef(null),d=m=>{c==null||c(m)},u=m=>{var h;n||(h=l.current)==null||h.onRipple(m)};return s.jsxs("button",{type:"button",className:j("smwb-chat-icon-button",a==="start"&&"smwb-chat-icon-button_edge-start",a==="end"&&"smwb-chat-icon-button_edge-end",r==="primary"&&"smwb-chat-icon-button_primary",n&&"smwb-chat-icon-button_disabled",e),disabled:n,onMouseDown:d,onPointerDown:u,...o,children:[t,n?null:s.jsx(Ee,{actionRef:l,center:!0})]})}const Us=i.forwardRef(function({children:t,className:n,onMouseDown:a,variant:r="default",size:c="medium",color:o="primary",type:l="button",...d},u){const m=i.useRef(null),h=f=>{a==null||a(f)},b=f=>{var w;(w=m.current)==null||w.onRipple(f)};return s.jsxs("button",{ref:u,type:l,className:j("smwb-fab",`smwb-${r}`,`smwb-${c}`,`smwb-fab_color-${o}`,n),onMouseDown:h,onPointerDown:b,...d,children:[t,s.jsx(Ee,{actionRef:m})]})});function _s(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Da(e){return e&&(_s(e.value)&&e.value!==""||_s(e.defaultValue)&&e.defaultValue!=="")}function Ot({position:e,variant:t,children:n,className:a,disablePointerEvents:r,inline:c}){const o=j("smwb-text-field__adornment",a,e==="start"&&"smwb-text-field__adornment--start",e==="end"&&"smwb-text-field__adornment--end",r&&"smwb-text-field__adornment--disable-pointer",!c&&t==="filled"&&"smwb-text-field__adornment--filled",typeof n=="string"&&"smwb-text-field__adornment--text");return s.jsx("span",{className:o,children:n})}function Oe({label:e,helperText:t=s.jsx(s.Fragment,{children:" "}),variant:n,disabled:a,className:r,error:c,fullWidth:o,isFilledState:l,isFocused:d,htmlFor:u,shrink:m,children:h,onHolderMouseDown:b,startAdornment:f,endAdornment:w,inline:p,..._}){const v=n==="filled",g=e&&(l||d||m),x=j(r,"smwb-text-field",{"smwb-text-field--filled":!p&&v,"smwb-text-field--inline":p,"smwb-text-field--focused":!p&&d,"smwb-text-field--error":c,"smwb-text-field--disabled":a,"smwb-text-field--full-width":o}),T=j("smwb-text-field__label",{"smwb-text-field__label--shrink":g}),y=j("smwb-text-field__notched",{"smwb-text-field__notched--with-label":e,"smwb-text-field__notched--active":g});return s.jsxs("div",{className:x,..._,"data-testid":"text-field",children:[!p&&e&&s.jsx("label",{className:T,htmlFor:u||"",children:e}),s.jsxs("div",{className:"smwb-text-field__input-holder",onMouseDown:b,children:[f&&s.jsx(Ot,{variant:n,inline:!!p,position:"start",children:f}),h,w&&s.jsx(Ot,{position:"end",children:w}),!p&&n==="outlined"&&s.jsx("fieldset",{className:y,children:s.jsx("legend",{children:e?s.jsx("span",{children:e}):s.jsx("span",{className:"smwb-notranslate",children:""})})})]}),!p&&t&&s.jsx("p",{className:"smwb-text-field__helper-line",children:s.jsx("span",{className:"smwb-text-field__helper-text",children:t})})]})}const Be=i.forwardRef(function(t,n){const{label:a,helperText:r,variant:c="outlined",size:o="medium",required:l,className:d,disabled:u,value:m,defaultValue:h,onChange:b,onFocus:f,onBlur:w,error:p,name:_,type:v="text",readOnly:g,placeholder:x,fullWidth:T,id:y,startAdornment:C,endAdornment:R,inline:k,autoComplete:N,inputMode:S,...E}=t,[D,I]=i.useState(!1),[z,$]=i.useState(!1),{current:M}=i.useRef(m!=null),F=i.useRef(null),A=ge(n,F),X=L=>{if(u){L.stopPropagation();return}f==null||f(L),I(!0)},ne=L=>{if(!M){const B=L.target||F.current;G({value:B.value})}w==null||w(L,t),I(!1)},G=i.useCallback(L=>{const B=!!Da(L);$(K=>K===B?K:B)},[]),ce=L=>{if(!M){const B=L.target||F.current;G({value:B.value})}b==null||b(L,t)},Z=L=>{F.current&&L.currentTarget===L.target&&(L.preventDefault(),F.current.focus())};i.useEffect(()=>{u&&D&&I(!1)},[u,D]),i.useEffect(()=>{M||G(F.current)}),_e(()=>{M&&G({value:m})},[m,M,G]);const te=j("smwb-text-field__input",(!a||k)&&"smwb-text-field__input--show-placeholder",C&&"smwb-text-field__input--adornment-start",R&&"smwb-text-field__input--adornment-end",k&&"smwb-text-field__input--inline");return s.jsx(Oe,{label:a,helperText:r,variant:c,disabled:u,className:j(d,o!=="medium"&&`smwb-text-field_size-${o}`),error:p,fullWidth:T,isFilledState:z,isFocused:D,htmlFor:y,shrink:!!C,onHolderMouseDown:Z,startAdornment:C,endAdornment:R,inline:k,...E,children:s.jsx("input",{type:v,defaultValue:h,name:_,readOnly:g,required:l,"aria-invalid":p||void 0,"aria-required":l||void 0,placeholder:x,disabled:u,value:m,className:te,ref:A,onChange:ce,onFocus:X,onBlur:ne,id:y,autoComplete:N,inputMode:S})})}),Gs=["pending","sent","delivered","read"],qs={pending:"progress_activity",sent:"check",delivered:"done_all",read:"done_all"},Zs={pending:"В обработке",sent:"Отправлено",delivered:"Доставлено",read:"Прочитано"},Gt=["floating","fullHeight","fullscreen"],Js=10;function qt(e){return Gs.includes(e)}function Qs(e,t){const n=t==null?void 0:t[e];if(n)return n;if(qt(e))return qs[e]}function en(e){return qt(e)?Zs[e]:String(e)}function tn(e){var t;return(t=e.mimeType)!=null&&t.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name)}function sn(e){if(!e)return"";const t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?String(e):new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(t)}function Zt(e){return e==null?["floating"]:e.length===0?[]:Gt.filter(t=>e.includes(t))}function gs(e,t){var n;return t&&t!=="closed"&&e.includes(t)?t:(n=e[0])!=null?n:"floating"}function nn(e,t){return Zt(e).filter(n=>n!=="closed"&&n!==t)}function Ea(e){return e.showCloseButton===!1?!1:e.showCloseButton===!0||e.overlayContext&&e.floatingTrigger&&!e.embedded&&(e.effectiveLayout==="floating"||e.effectiveLayout==="fullHeight")?!0:!!(e.floatingTrigger&&!e.embedded&&e.effectiveLayout==="floating")}function an(e,t={}){if(e.key!=="Enter")return!1;const{shiftEnterNewline:n=!0,ctrlEnterNewline:a=!0}=t,r=e.ctrlKey||e.metaKey;return!!(n&&e.shiftKey&&!r||a&&r&&!e.shiftKey)}function Tt(e){e.stopPropagation()}function Ia(e,t,n){var o,l;const a=(o=e.selectionStart)!=null?o:t.length,r=(l=e.selectionEnd)!=null?l:t.length,c=`${t.slice(0,a)}
|
|
2
|
-
${t.slice(r)}`;n(c),requestAnimationFrame(()=>{e.selectionStart=a+1,e.selectionEnd=a+1})}function rn({className:e,onSendMessage:t,placeholder:n="message",disabled:a=!1,sendAriaLabel:r="Send message",shiftEnterNewline:c=!0,ctrlEnterNewline:o=!0,fileUpload:l=!1,attachInputId:d,onAttachClick:u,attachAriaLabel:m="Attach file"}){const[h,b]=i.useState(""),[f,w]=i.useState(!1),p=i.useId(),_=i.useRef(null),v=c||o,g=!!t&&h.trim().length>0&&!a,x=l&&!!(d||u),T=()=>{if(!t)return;const S=h.trim();!S||a||(t(S),b(""))},y=S=>{if(an(S,{shiftEnterNewline:c,ctrlEnterNewline:o})){S.currentTarget instanceof HTMLTextAreaElement&&(S.preventDefault(),Ia(S.currentTarget,h,b));return}S.key==="Enter"&&(S.preventDefault(),T())},C=j("smwb-chat-icon-button","smwb-chat-icon-button_edge-start",a&&"smwb-chat-icon-button_disabled"),R=x?d?s.jsx("label",{htmlFor:a?void 0:d,className:C,"aria-label":m,"aria-disabled":a||void 0,"data-testid":"chat-composer-attach",onMouseDown:Tt,children:s.jsx(W,{name:"attach_file",size:24})}):s.jsx(Ge,{edge:"start","aria-label":m,"data-testid":"chat-composer-attach",disabled:a,onClick:u,onMouseDown:Tt,children:s.jsx(W,{name:"attach_file",size:24})}):null,k=t?s.jsx(Ge,{edge:"end",color:"primary","aria-label":r,"data-testid":"chat-composer-send",disabled:!g,onClick:T,onMouseDown:Tt,children:s.jsx(W,{name:"send",size:24})}):null;if(x&&!t)return s.jsx("div",{className:j("smwb-chat-composer","smwb-chat-composer_attach-only",e),"data-testid":"chat-composer",children:R});if(!v)return s.jsx(Be,{className:j("smwb-chat-composer",e),"data-testid":"chat-composer",fullWidth:!0,value:h,disabled:a,placeholder:n,onChange:S=>b(S.target.value),startAdornment:R,endAdornment:k,onKeyDown:y});const N=S=>{_.current&&S.currentTarget===S.target&&(S.preventDefault(),_.current.focus())};return s.jsx(Oe,{className:j("smwb-chat-composer",e),"data-testid":"chat-composer",fullWidth:!0,disabled:a,isFilledState:h.length>0,isFocused:f,htmlFor:p,shrink:!!R,onHolderMouseDown:N,startAdornment:R,endAdornment:k,children:s.jsx("textarea",{id:p,ref:_,className:j("smwb-text-field__input","smwb-chat-composer__input","smwb-text-field__input--show-placeholder",R&&"smwb-text-field__input--adornment-start",k&&"smwb-text-field__input--adornment-end"),value:h,disabled:a,placeholder:n,rows:1,onChange:S=>b(S.target.value),onFocus:()=>w(!0),onBlur:()=>w(!1),onKeyDown:y})})}const Aa={floating:"picture_in_picture",fullHeight:"fit_screen",fullscreen:"open_in_full"},$a={floating:"Floating window",fullHeight:"Full height",fullscreen:"Fullscreen"};function on({className:e,title:t,subtitle:n,actions:a,layout:r,allowedLayouts:c=["floating"],onLayoutChange:o,onClose:l}){const d=nn(c,r),u=!!o&&d.length>0;return s.jsxs("div",{className:j("smwb-chat-header",e),"data-testid":"chat-header",children:[s.jsxs("div",{className:"smwb-chat-header__main",children:[t?s.jsx("div",{className:"smwb-chat-header__title",children:t}):null,n?s.jsx("div",{className:"smwb-chat-header__subtitle",children:n}):null]}),s.jsxs("div",{className:"smwb-chat-header__actions",children:[a,u?d.map(m=>s.jsx(Ge,{"aria-pressed":r===m,"aria-label":$a[m],"data-testid":`chat-layout-${m}`,onClick:()=>o==null?void 0:o(m),children:s.jsx(W,{name:Aa[m],size:18})},m)):null,l?s.jsx(Ge,{"aria-label":"Close chat","data-testid":"chat-close",onClick:l,children:s.jsx(W,{name:"close",size:18})}):null]})]})}const Fa={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",caption:"span",overline:"span",button:"span"},qe=i.forwardRef(function({variant:t="body1",color:n="inherit",align:a,gutterBottom:r,noWrap:c,component:o,className:l,children:d,...u},m){const h=o!=null?o:Fa[t];return s.jsx(h,{ref:m,className:j("smwb-typography",`smwb-typography_${t}`,n!=="inherit"&&`smwb-typography_color-${n}`,a&&`smwb-typography_align-${a}`,{"smwb-typography_gutter":r,"smwb-typography_nowrap":c},l),...u,children:d})});function ln({attachment:e,className:t}){const[n,a]=i.useState(!1),[r,c]=i.useState(),o=i.useRef(null);return _e(()=>{c(document.body)},[]),e.url?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:j("smwb-chat-attachment-image",t),onClick:()=>a(!0),"data-testid":"chat-attachment-image","aria-label":e.name,children:s.jsx("img",{src:e.url,alt:e.name,className:"smwb-chat-attachment-image__img"})}),r?Ce.createPortal(s.jsx(He.CSSTransition,{in:n,timeout:150,mountOnEnter:!0,unmountOnExit:!0,nodeRef:o,classNames:{enterActive:"smwb-chat-attachment-image__overlay_enter-active",enterDone:"smwb-chat-attachment-image__overlay_enter-done"},children:s.jsx("div",{ref:o,className:"smwb-chat-attachment-image__overlay smwb-dark",role:"dialog","aria-modal":"true","aria-label":e.name,"data-testid":"chat-attachment-image-overlay",onClick:()=>a(!1),children:s.jsx("img",{src:e.url,alt:e.name,className:"smwb-chat-attachment-image__overlay-img",onClick:l=>l.stopPropagation()})})}),r):null]}):null}function cn({attachments:e,className:t,enabled:n=!0}){return!n||!(e!=null&&e.length)?null:s.jsx("div",{className:j("smwb-chat-attachments",t),"data-testid":"chat-attachments",children:e.map(a=>tn(a)?s.jsx(ln,{attachment:a},a.id):s.jsx("a",{className:"smwb-chat-attachments__file",href:a.url,download:a.name,target:"_blank",rel:"noreferrer","data-testid":"chat-attachment-file",children:a.name},a.id))})}const xs=e=>typeof e=="string",Jt=i.forwardRef(function({className:t,src:n,alt:a,size:r="medium",variant:c="circular",color:o,style:l,imgProps:d,children:u,...m},h){const[b,f]=i.useState(!1),w=!!n&&!b,p=j("smwb-avatar",`smwb-avatar_${c}`,xs(r)?`smwb-avatar_${r}`:null,t),_={...l,...xs(r)?{}:{width:r,height:r,fontSize:r/2.5},...o&&!w?{backgroundColor:o}:{}};return s.jsx("div",{ref:h,...m,"data-testid":"avatar",className:p,style:_,children:w?s.jsx("img",{...d,className:j("smwb-avatar__img",d==null?void 0:d.className),src:n,alt:a,onError:v=>{var g;f(!0),(g=d==null?void 0:d.onError)==null||g.call(d,v)}}):s.jsx("span",{className:"smwb-avatar__fallback",role:"img","aria-label":a,children:u})})}),La=i.forwardRef(function({className:t,max:n=5,total:a,onSurplusClick:r,children:c,...o},l){const d=i.Children.toArray(c).filter(i.isValidElement),u=a!=null?a:d.length,m=Math.max(n,1),h=d.slice(0,m),b=u-h.length;return s.jsxs("div",{ref:l,...o,"data-testid":"avatar-group",className:j("smwb-avatar-group",t),children:[b>0?s.jsx(Jt,{className:"smwb-avatar-group__surplus",onClick:r,style:r?{cursor:"pointer"}:void 0,children:`+${b}`}):null,h]})});function Bt({author:e,enabled:t=!0,className:n}){var a,r;return t?s.jsx("div",{className:j("smwb-chat-message__avatar",n),"data-testid":"chat-message-avatar",children:s.jsx(Jt,{src:e==null?void 0:e.avatarSrc,alt:(a=e==null?void 0:e.avatarAlt)!=null?a:e==null?void 0:e.name,size:"small",children:(r=e==null?void 0:e.name)==null?void 0:r.slice(0,1)})}):null}function un({className:e,message:t,status:n,statusIcons:a,renderStatus:r}){if(r){const d=r({message:t,status:n});if(d!=null)return s.jsx("span",{className:j("smwb-chat-message__status",`smwb-chat-message__status_${n}`,e),"data-testid":"chat-message-status",children:d})}const c=Qs(n,a);if(!c)return null;const o=en(n),l=n==="read";return s.jsx("span",{className:j("smwb-chat-message__status",`smwb-chat-message__status_${n}`,e),"data-testid":"chat-message-status","aria-label":o,title:o,children:s.jsx(W,{name:c,size:14,fill:l?1:0})})}function Qt({className:e,align:t,message:n,author:a,text:r,attachments:c,timestamp:o,status:l,showAvatars:d=!1,showAttachments:u=!1,showStatus:m=!1,statusIcons:h,renderStatus:b,bubbleClassName:f}){const w=sn(o),p=l!=null?l:n.status,_=m&&t==="end"&&p;return s.jsxs("div",{className:j("smwb-chat-message",`smwb-chat-message_${t}`,e),"data-testid":`chat-message-${t}`,children:[t==="start"?s.jsx(Bt,{author:a,enabled:d}):null,s.jsxs("div",{className:"smwb-chat-message__content",children:[a!=null&&a.name?s.jsx(qe,{variant:"caption",className:"smwb-chat-message__author",children:a.name}):null,s.jsxs("div",{className:j("smwb-chat-message__bubble",f),children:[r?s.jsx("div",{className:"smwb-chat-message__text",children:r}):null,s.jsx(cn,{attachments:c,enabled:u})]}),w||_?s.jsxs("div",{className:"smwb-chat-message__meta","data-testid":"chat-message-meta",children:[w?s.jsx(qe,{variant:"caption",className:"smwb-chat-message__time",children:w}):null,_?s.jsx(un,{message:n,status:p,statusIcons:h,renderStatus:b}):null]}):null]}),t==="end"?s.jsx(Bt,{author:a,enabled:d}):null]})}function dn({message:e,showAvatars:t,showAttachments:n,className:a}){return s.jsx(Qt,{className:a,align:"start",message:e,author:e.author,text:e.text,attachments:e.attachments,timestamp:e.timestamp,showAvatars:t,showAttachments:n,bubbleClassName:"smwb-chat-message__bubble_incoming"})}function mn({message:e,showAvatars:t,showAttachments:n,showStatus:a,statusIcons:r,renderStatus:c,className:o}){return s.jsx(Qt,{className:o,align:"end",message:e,author:e.author,text:e.text,attachments:e.attachments,timestamp:e.timestamp,status:e.status,showAvatars:t,showAttachments:n,showStatus:a,statusIcons:r,renderStatus:c,bubbleClassName:"smwb-chat-message__bubble_outgoing"})}function fn({message:e,className:t}){var a;const n=(a=e.content)!=null?a:e.text;return n?s.jsx("div",{className:j("smwb-chat-message-system",t),"data-testid":"chat-message-system",children:s.jsx(qe,{variant:"caption",children:n})}):null}function hn({message:e,showAvatars:t,showAttachments:n,showStatus:a,statusIcons:r,renderStatus:c,className:o,renderMessage:l}){var u;const d={showAvatars:t,showAttachments:n,showStatus:a,statusIcons:r,renderStatus:c};if(l)return s.jsx("div",{className:j("smwb-chat-message-item",o),children:l(e,d)});switch(e.variant){case"outgoing":return s.jsx(mn,{message:e,showAvatars:t,showAttachments:n,showStatus:a,statusIcons:r,renderStatus:c,className:o});case"system":return s.jsx(fn,{message:e,className:o});case"custom":return s.jsx("div",{className:j("smwb-chat-message-item","smwb-chat-message-item_custom",o),"data-testid":"chat-message-custom",children:(u=e.content)!=null?u:e.text});case"incoming":default:return s.jsx(dn,{message:e,showAvatars:t,showAttachments:n,className:o})}}const vs=e=>typeof e=="number"?`${e}px`:e,it=i.forwardRef(function({className:t,variant:n="text",width:a,height:r,animation:c="pulse",count:o=1,animationDelay:l,component:d="span",style:u,...m},h){const b=j("smwb-skeleton",`smwb-skeleton_${n}`,c===!1?"smwb-skeleton_no-animation":`smwb-skeleton_${c}`,t),f=d,w=p=>{const _={...u,width:vs(a),height:vs(r),...l?{animationDelay:`${p*l}ms`}:{}};return s.jsx(f,{ref:o===1?h:void 0,...o===1?m:{},"data-testid":"skeleton","aria-hidden":"true",className:b,style:_},p)};return o===1?w(0):s.jsx("span",{ref:h,...m,className:"smwb-skeleton__group","aria-hidden":"true",children:Array.from({length:o},(p,_)=>w(_))})});function bn({className:e,align:t="start",showAvatar:n=!1,lines:a=2}){const r=t==="start"?"72%":"64%";return s.jsxs("div",{className:j("smwb-chat-message",`smwb-chat-message_${t}`,"smwb-chat-message-skeleton",e),"data-testid":"chat-message-skeleton","aria-hidden":"true",children:[t==="start"&&n?s.jsx(it,{variant:"circular",width:32,height:32}):null,s.jsx("div",{className:"smwb-chat-message__content",children:s.jsxs("div",{className:"smwb-chat-message-skeleton__bubble",children:[s.jsx(it,{variant:"rounded",width:r,height:14}),a>1?s.jsx(it,{variant:"rounded",width:"48%",height:14}):null]})}),t==="end"&&n?s.jsx(it,{variant:"circular",width:32,height:32}):null]})}function wn({containerRef:e,onLoadMore:t,hasMore:n=!1,loading:a=!1,rootMargin:r="80px"}){const c=i.useRef(null),o=i.useRef(a);return o.current=a,i.useEffect(()=>{const l=e.current,d=c.current;if(!l||!d||!n||!t||typeof IntersectionObserver=="undefined")return;const u=new IntersectionObserver(m=>{m.some(h=>h.isIntersecting)&&!o.current&&t()},{root:l,rootMargin:r,threshold:0});return u.observe(d),()=>u.disconnect()},[e,n,t,r]),{sentinelRef:c}}function pn(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function Pt(e){e.scrollTop=e.scrollHeight}function _n({containerRef:e,messages:t,threshold:n=24}){const a=i.useRef(!0),r=i.useRef(0),c=i.useRef(),o=i.useRef();i.useEffect(()=>{const l=e.current;if(!l)return;const d=()=>{a.current=pn(l,n)};return d(),l.addEventListener("scroll",d,{passive:!0}),()=>l.removeEventListener("scroll",d)},[e,n]),_e(()=>{var f,w;const l=e.current;if(!l)return;const d=r.current,u=c.current,m=o.current,h=(f=t[0])==null?void 0:f.id,b=(w=t[t.length-1])==null?void 0:w.id;if(u===void 0)Pt(l),a.current=!0;else{const p=h!==void 0&&h!==u&&b===m,_=b!==void 0&&b!==m;p&&d>0?l.scrollTop+=l.scrollHeight-d:_&&a.current&&Pt(l)}r.current=l.scrollHeight,c.current=h,o.current=b},[e,t])}function gn({className:e,messages:t,showAvatars:n,showAttachments:a,showStatus:r,statusIcons:c,renderStatus:o,onLoadMore:l,hasMore:d=!1,loading:u=!1,loadingMore:m=!1,loadingSkeletonCount:h=3,renderMessage:b}){const f=i.useRef(null),{sentinelRef:w}=wn({containerRef:f,onLoadMore:l,hasMore:d,loading:m||u});_n({containerRef:f,messages:t});const p=u||m,_=v=>v%2===0?"start":"end";return s.jsxs("div",{ref:f,className:j("smwb-chat-messages",e),"data-testid":"chat-messages",children:[s.jsx("div",{ref:w,className:"smwb-chat-messages__sentinel","data-testid":"chat-messages-sentinel"}),p?s.jsx("div",{className:"smwb-chat-messages__skeletons","data-testid":"chat-messages-skeletons","aria-busy":"true","aria-label":"Loading messages",children:Array.from({length:h},(v,g)=>s.jsx(bn,{align:_(g),showAvatar:n,lines:g%2===0?2:1},g))}):null,u?null:t.map(v=>s.jsx(hn,{message:v,showAvatars:n,showAttachments:a,showStatus:r,statusIcons:c,renderStatus:o,renderMessage:b},v.id))]})}function xn({className:e,layout:t,anchor:n="bottom-right",themeMode:a="inherit",embedded:r=!1,overlayContext:c=!1,header:o,footer:l,children:d,fileDropzoneRootProps:u,fileDropzoneActive:m=!1}){const[h,b]=i.useState();if(_e(()=>{b(document.body)},[]),i.useEffect(()=>{if(t!=="fullscreen")return;const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=_}},[t]),t==="closed")return null;const{className:f,...w}=u!=null?u:{},p=s.jsxs("div",{...w,className:j("smwb-chat-shell",`smwb-chat-shell_${t}`,!r&&`smwb-chat-shell_${n}`,{"smwb-dark":a==="dark","smwb-chat-shell_embedded":r,"smwb-chat-shell_overlay-context":c,"smwb-chat-dropzone_active":m},f,e),"data-testid":"chat-shell","data-layout":t,children:[o?s.jsx("div",{className:"smwb-chat-shell__header",children:o}):null,s.jsx("div",{className:"smwb-chat-shell__body",children:d}),l?s.jsx("div",{className:"smwb-chat-shell__footer",children:l}):null]});return t==="fullscreen"&&h?Ce.createPortal(p,h):p}function vn(e){return e==null?Js:Math.max(1,e)}function yn({enabled:e=!1,accept:t,maxFiles:n,onUploadFiles:a,disabled:r=!1}){const c=vn(n),o=e&&!!a&&!r,{getRootProps:l,getInputProps:d,open:u,isDragActive:m,inputRef:h}=la.useDropzone({accept:t,maxFiles:c,multiple:c>1,disabled:!o,noClick:!0,noKeyboard:!0,useFsAccessApi:!1,onDropAccepted:f=>{a&&a(f)}});return{enabled:o,maxFiles:c,getRootProps:l,getInputProps:d,open:()=>{u==null||u()},inputRef:h,isDragActive:m}}function zt({className:e,messages:t,showAvatars:n=!1,showAttachments:a=!1,headerTitle:r,headerSubtitle:c,headerActions:o,footer:l,children:d,anchor:u="bottom-right",themeMode:m="inherit",allowedLayouts:h,layout:b,defaultLayout:f,onLayoutChange:w,open:p,defaultOpen:_=!1,onOpenChange:v,floatingTrigger:g=!1,triggerIcon:x,triggerLabel:T,onLoadMore:y,hasMore:C,onSendMessage:R,composerPlaceholder:k="message",composerDisabled:N,composerShiftEnterNewline:S=!0,composerCtrlEnterNewline:E=!0,fileUpload:D=!1,onUploadFiles:I,fileUploadAccept:z,fileUploadMaxFiles:$,attachAriaLabel:M,loading:F,loadingMore:A,loadingSkeletonCount:X,renderMessage:ne,embedded:G=!1,overlayContext:ce=!1,showStatus:Z=!1,statusIcons:te,renderStatus:L,showCloseButton:B}){var Te;const K=i.useMemo(()=>Zt(h!=null?h:Gt),[h]),[ee,U]=Fe({value:p,defaultValue:_,onChange:v}),[se,de]=Fe({value:b,defaultValue:gs(K,f),onChange:w}),ie=G?"fullHeight":g?ee?se:"closed":se,xe=()=>{U(!0),se==="closed"&&de(gs(K,f))},Q=()=>{U(!1)},me=Y=>{U(!0),de(Y)},{enabled:J,getRootProps:be,getInputProps:O,isDragActive:V}=yn({enabled:D,accept:z,maxFiles:$,onUploadFiles:I,disabled:N}),oe=i.useId(),ae=!!R||J,P=J?s.jsx("input",{...O({id:oe}),"data-testid":"chat-file-input"}):null,re=(Te=l!=null?l:d)!=null?Te:ae?s.jsxs(s.Fragment,{children:[P,s.jsx(rn,{onSendMessage:R,placeholder:k,disabled:N,shiftEnterNewline:S,ctrlEnterNewline:E,fileUpload:J,attachInputId:J?oe:void 0,attachAriaLabel:M})]}):void 0,ke=s.jsx(gn,{messages:t,showAvatars:n,showAttachments:a,showStatus:Z,statusIcons:te,renderStatus:L,onLoadMore:y,hasMore:C,loading:F,loadingMore:A,loadingSkeletonCount:X,renderMessage:ne}),Ne=J?be():void 0,Se=Ea({floatingTrigger:g,embedded:G,overlayContext:ce,effectiveLayout:ie,showCloseButton:B});return s.jsxs("div",{className:j("smwb-chat",!G&&`smwb-chat_${u}`,G&&"smwb-chat_embedded",ce&&"smwb-chat_overlay-context",e),"data-testid":"chat",children:[g&&!G&&!ee?s.jsx(Us,{className:"smwb-chat__trigger","aria-label":T!=null?T:"Open chat","data-testid":"chat-trigger",onClick:xe,children:x!=null?x:s.jsx(W,{name:"chat",size:24})}):null,s.jsx(xn,{layout:ie,anchor:u,themeMode:m,embedded:G,overlayContext:ce,fileDropzoneRootProps:Ne,fileDropzoneActive:J&&V,header:s.jsx(on,{title:r,subtitle:c,actions:o,layout:ie==="closed"?se:ie,allowedLayouts:K,onLayoutChange:me,onClose:Se?Q:void 0}),footer:re,children:ke})]})}const Oa=e=>typeof e=="number"?`${e}px`:e,Ba=e=>e==="left"?"bottom-left":"bottom-right";function Pa({className:e,contentClassName:t,chatClassName:n,side:a="right",chatWidth:r=400,collapsed:c,defaultCollapsed:o=!1,onCollapsedChange:l,collapseAriaLabel:d="Collapse chat panel",expandAriaLabel:u="Expand chat panel",floatingAnchor:m,chat:h,children:b,style:f,...w}){const[p,_]=Fe({value:c,defaultValue:o,onChange:l}),[v,g]=Fe({defaultValue:!1});i.useEffect(()=>{p||g(!1)},[p,g]);const x=m!=null?m:Ba(a),T=a==="left"?"dock_to_left":"dock_to_right",y=a==="left"?"left_panel_close":"right_panel_close",C=s.jsx(Ge,{"aria-label":d,"data-testid":"chat-layout-collapse",onClick:()=>_(!0),children:s.jsx(W,{name:y,size:18})}),R=s.jsx(Ge,{"aria-label":u,"data-testid":"chat-layout-expand",onClick:()=>_(!1),children:s.jsx(W,{name:T,size:18})}),k=s.jsxs(s.Fragment,{children:[h.headerActions,C]}),N=s.jsxs(s.Fragment,{children:[h.headerActions,R]}),S={"--smwb-chat-layout-w":Oa(r)};if(p)return s.jsxs("div",{className:j("smwb-chat-layout","smwb-chat-layout_collapsed",e),style:{...S,...f},"data-testid":"chat-layout","data-collapsed":"true",...w,children:[s.jsx("div",{className:j("smwb-chat-layout__content",t),"data-testid":"chat-layout-content",children:b}),s.jsx(zt,{...h,className:n,floatingTrigger:!0,anchor:x,allowedLayouts:["floating"],layout:"floating",open:v,onOpenChange:g,headerActions:N})]});const E=s.jsx("aside",{className:"smwb-chat-layout__panel","data-testid":"chat-layout-panel",children:s.jsx(zt,{...h,className:n,embedded:!0,allowedLayouts:[],headerActions:k})});return s.jsxs("div",{className:j("smwb-chat-layout",`smwb-chat-layout_${a}`,e),style:{...S,...f},"data-testid":"chat-layout","data-collapsed":"false",...w,children:[a==="left"?E:null,s.jsx("div",{className:j("smwb-chat-layout__content",t),"data-testid":"chat-layout-content",children:b}),a==="right"?E:null]})}const za=i.forwardRef(function({className:t,color:n="primary",badgeContent:a,variant:r="outside",vertical:c="top",horizontal:o="right",max:l,showZero:d=!1,badgeAriaLabel:u,children:m,...h},b){const f=a===0||a==="0",w=(a==null||f&&!d)===!0;let p=a;typeof a=="number"&&l!==void 0&&a>l&&(p=`${l}+`);const _=j("smwb-badge",`smwb-badge_${n}`,`smwb-badge_${r}`,`smwb-badge_${r}_${c}`,`smwb-badge_${r}_${c}_${o}`,t,{"smwb-badge_no-content":w});return s.jsxs("span",{className:"smwb-badge__wrapper","data-testid":"badge",children:[m,s.jsx("span",{ref:b,className:_,"aria-label":u,...h,children:w?null:p})]})}),Va=i.forwardRef(function({className:t,variant:n="elevated",children:a,disabled:r,title:c,footer:o,onClick:l,onKeyDown:d,...u},m){const h=!!l&&!r,b=f=>{d==null||d(f),h&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l==null||l(f))};return s.jsxs("div",{ref:m,"data-testid":"card",className:j("smwb-card",`smwb-card_${n}`,t,{card_disabled:r,"smwb-card_interactive":h}),role:h?"button":void 0,tabIndex:h?0:void 0,"aria-disabled":r||void 0,onClick:h?l:void 0,onKeyDown:b,...u,children:[c&&s.jsx("div",{className:"smwb-card__title",children:c}),a,o&&s.jsx("div",{className:"smwb-card__footer",children:o})]})}),es=i.forwardRef(function({label:t,className:n,deleteIcon:a,icon:r,onDelete:c,onMouseDown:o,onDeleteMouseDown:l,asLink:d,href:u,target:m="_blank",selected:h,variant:b="filled",size:f="medium",color:w="default",disabled:p=!1,onClick:_,deleteAriaLabel:v="Remove",...g},x){const T=i.useRef(null),y=D=>{o==null||o(D)},C=D=>{var I;p||(I=T.current)==null||I.onRipple(D)},R=D=>{l==null||l(D),D.stopPropagation()},k=j("smwb-chip",`smwb-${b}`,`smwb-chip_size-${f}`,w!=="default"&&`smwb-chip_color-${w}`,n,{"smwb-disabled":p,"smwb-selected":h}),N=!!c&&s.jsx("button",{type:"button",className:"smwb-chip__delete-icon","aria-label":v,disabled:p,onClick:c,onMouseDown:R,children:a||s.jsx(W,{name:"cancel",size:18,fill:1})}),S=s.jsxs(s.Fragment,{children:[r&&s.jsx("span",{className:"smwb-chip__icon",children:r}),s.jsx("span",{className:"smwb-chip__label",children:t}),N,s.jsx(Ee,{actionRef:T})]});if(d&&u)return s.jsx("a",{ref:x,"data-testid":"chip-link",className:k,href:u,onMouseDown:y,onPointerDown:C,target:m,rel:"noreferrer",...g,children:S});const E=!!_&&!p;return s.jsx("span",{ref:x,"data-testid":"chip",className:k,role:E?"button":void 0,tabIndex:E?0:void 0,"aria-disabled":p||void 0,onClick:E?_:void 0,onKeyDown:E?D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),_==null||_())}:void 0,onMouseDown:y,onPointerDown:C,...g,children:S})});function Ha({options:e,value:t,multiple:n,onChange:a,size:r="medium",color:c="primary",disabled:o,className:l,...d}){const u=()=>t==null?[]:Array.isArray(t)?t:[t],m=b=>u().includes(b),h=b=>{if(n){const f=u(),w=f.includes(b)?f.filter(p=>p!==b):[...f,b];a==null||a(w)}else a==null||a(b)};return s.jsx("div",{...d,role:"group",className:j("smwb-chip-group",l),children:e.map(b=>s.jsx(es,{label:b.label,icon:b.icon,size:r,color:c,selected:m(b.value),variant:m(b.value)?"filled":"outlined",disabled:!!(o||b.disabled),onClick:()=>h(b.value)},b.value))})}const jn=i.forwardRef(function({src:t,alt:n,fallback:a,lazy:r=!0,aspectRatio:c,className:o,onError:l,...d},u){const[m,h]=i.useState(!1),[b,f]=i.useState(!r),w=i.useRef(null),p=ge(u,w);i.useEffect(()=>{if(!r||b)return;const g=w.current;if(!g)return;if(typeof IntersectionObserver=="undefined"){f(!0);return}const x=new IntersectionObserver(T=>{T.some(y=>y.isIntersecting)&&(f(!0),x.disconnect())});return x.observe(g),()=>x.disconnect()},[r,b]);const _=m||!t,v=g=>{h(!0),l==null||l(g)};return s.jsxs("span",{className:j("smwb-lazy-image",o,{"smwb-lazy-image--empty":_}),style:c!=null?{aspectRatio:String(c)}:void 0,children:[_&&a?s.jsx("span",{className:"smwb-lazy-image__fallback",children:a}):null,_?null:s.jsx("img",{...d,ref:p,className:"smwb-lazy-image__img",src:b?t:void 0,alt:n!=null?n:"",loading:r?"lazy":void 0,decoding:"async",onError:v})]})}),Ya=i.forwardRef(function({src:t,caption:n,selected:a,onSelect:r,fallback:c,hoverPreview:o,topStart:l,topEnd:d,lazy:u=!0,disabled:m,hoverDelay:h=350,className:b,...f},w){const p=i.useRef(null),_=ge(w,p),[v,g]=i.useState(null),x=i.useRef(null),T=()=>{x.current&&(clearTimeout(x.current),x.current=null)},y=()=>{o==null||m||(T(),x.current=setTimeout(()=>{var S;const N=(S=p.current)==null?void 0:S.getBoundingClientRect();N&&g({top:N.top,left:N.right+8})},h))},C=()=>{T(),g(null)};i.useEffect(()=>T,[]);const R=!!r&&!m,k=N=>{R&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),r==null||r())};return s.jsxs("div",{...f,ref:_,className:j("smwb-thumb-card",b,{"smwb-thumb-card--selected":a,"smwb-thumb-card--disabled":m,"smwb-thumb-card--interactive":R}),role:R?"button":void 0,tabIndex:R?0:void 0,"aria-pressed":r?a!=null?a:!1:void 0,"aria-disabled":m||void 0,onClick:R?()=>r==null?void 0:r():void 0,onKeyDown:k,onMouseEnter:y,onMouseLeave:C,children:[s.jsxs("div",{className:"smwb-thumb-card__media",children:[s.jsx(jn,{src:t,lazy:u,fallback:c}),l?s.jsx("div",{className:"smwb-thumb-card__slot smwb-thumb-card__slot--start",children:l}):null,d?s.jsx("div",{className:"smwb-thumb-card__slot smwb-thumb-card__slot--end",children:d}):null]}),n?s.jsx("div",{className:"smwb-thumb-card__caption",children:n}):null,v&&typeof document!="undefined"?Ce.createPortal(s.jsx("div",{className:"smwb-thumb-card__preview",style:{position:"fixed",top:v.top,left:v.left},children:typeof o=="string"?s.jsx("img",{src:o,alt:""}):o}),document.body):null]})});function Ka({items:e,renderItem:t,minColumn:n=160,rowHeight:a,gap:r=8,overscan:c=2,loading:o,loadingCount:l=12,emptyLabel:d,className:u,style:m}){const h=i.useRef(null),[b,f]=i.useState(0),[w,p]=i.useState(0),[_,v]=i.useState(!1);i.useEffect(()=>{const k=h.current;if(!k||typeof ResizeObserver=="undefined")return;const N=new ResizeObserver(()=>{f(k.clientWidth),p(k.clientHeight),v(!0)});return N.observe(k),()=>N.disconnect()},[]);const g=i.useMemo(()=>b<=0?1:Math.max(1,Math.floor((b+r)/(n+r))),[b,r,n]),x=Math.ceil(e.length/g),T=Wt({itemCount:x,itemHeight:a+r,viewportHeight:w||1,overscan:c}),y={display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr))`,gap:r,gridAutoRows:a},C={display:"grid",gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`,gap:r,height:a,marginBottom:r};let R;return o?R=s.jsx("div",{className:"smwb-asset-grid__plain",style:y,children:Array.from({length:l}).map((k,N)=>s.jsx("div",{className:"smwb-asset-grid__skeleton",style:{height:a}},N))}):e.length===0?R=s.jsx("div",{className:"smwb-asset-grid__empty",children:d}):_?R=s.jsx("div",{className:"smwb-asset-grid__sizer",style:{height:T.totalHeight,position:"relative"},children:s.jsx("div",{className:"smwb-asset-grid__band",style:{position:"absolute",top:0,left:0,right:0,transform:`translateY(${T.offsetY}px)`},children:Array.from({length:Math.max(0,T.endIndex-T.startIndex)}).map((k,N)=>{const S=T.startIndex+N;return s.jsx("div",{className:"smwb-asset-grid__row",style:C,children:Array.from({length:g}).map((E,D)=>{const I=S*g+D;return I<e.length?s.jsx(i.Fragment,{children:t(e[I],I)},D):null})},S)})})}):R=s.jsx("div",{className:"smwb-asset-grid__plain",style:y,children:e.map((k,N)=>s.jsx(i.Fragment,{children:t(k,N)},N))}),s.jsx("div",{ref:h,className:j("smwb-asset-grid",u),style:m,onScroll:T.onScroll,children:R})}const kn="data-smwb-overlay-layer",Xa=()=>typeof document=="undefined"?[]:Array.from(document.querySelectorAll(`[${kn}]`)),Wa=(e,t)=>typeof e.composedPath!="function"?!1:e.composedPath().some(n=>n instanceof Element&&n.hasAttribute(kn)&&!n.contains(t)),Nn=e=>{if(!e)return!0;const t=Xa(),n=t[t.length-1];return!n||n===e||n.contains(e)||e.contains(n)},Ua=i.forwardRef(function({children:t,onClose:n,open:a,className:r,animation:c="fade",backdrop:o="dark",size:l="large",closeOnOutsideClick:d=!0,asForm:u=!1,disableAppearAnimation:m=!1,role:h="dialog",closeOnEsc:b=!0,...f},w){const[p,_]=i.useState(),v=i.useRef(null),g=i.useRef(null),x=ge(w,g);if(_e(()=>{_(document.body)},[]),i.useEffect(()=>{if(!a||!b||!n)return;const y=C=>{C.key==="Escape"&&Nn(v.current)&&n()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[a,b,n]),!p)return s.jsx(s.Fragment,{});const T=u?"form":"div";return Ce.createPortal(s.jsx(He.CSSTransition,{timeout:{appear:225,enter:225,exit:150},in:a,classNames:{appear:"smwb-modal__overlay-appear",appearActive:"smwb-modal__overlay-appear-active",appearDone:"smwb-modal__overlay-appear-done",enter:"smwb-modal__overlay-enter",enterActive:"smwb-modal__overlay-enter-active",enterDone:"smwb-modal__overlay-enter-done",exit:"smwb-modal__overlay-exit",exitActive:"smwb-modal__overlay-exit-active"},appear:!m,mountOnEnter:!0,unmountOnExit:!0,nodeRef:v,children:s.jsx("div",{ref:v,"data-smwb-overlay-layer":"",className:j("smwb-modal__overlay",`smwb-${o}`,`smwb-${l}`),onClick:d&&n?n:void 0,children:s.jsx(T,{ref:x,className:j("smwb-modal",`smwb-${l}`,`smwb-${c}`,r),onClick:y=>y.stopPropagation(),role:h,"aria-modal":"true",...f,children:t})})}),p)});function Ga({className:e,children:t}){return s.jsx("div",{className:j("smwb-modal__header",e),children:t})}function qa({className:e,children:t}){return s.jsx("div",{className:j("smwb-modal__content",e),children:t})}function Za({className:e,children:t}){return s.jsx("div",{className:j("smwb-modal__footer",e),children:t})}const Ke=Object.assign(Ua,{Footer:Za,Header:Ga,Content:qa});function Ja(e,t){const n=Math.floor(e/t);return e%t===0?n-1:n}function ys(e,t,n,a){const r=Ja(n,t);return e===n+t?0:a||e<t&&e!==0?r:e===0?n%t===0?r:r-1:t>0?Math.floor(e/t)-1:0}function Rn(e){return!(e instanceof Event)}function xt(e){return Rn(e)&&e.nativeEvent instanceof MouseEvent||e instanceof MouseEvent}function ts(e){return window.TouchEvent&&(Rn(e)&&e.nativeEvent instanceof TouchEvent||e instanceof TouchEvent)}function Mt(e){return xt(e)?e.clientX:ts(e)?e.changedTouches[0].clientX:0}function js(e){return xt(e)?e.clientY:ts(e)?e.changedTouches[0].clientY:0}function ks(e){const t=e.target;(t.tagName==="A"||t.tagName==="IMG")&&e.preventDefault()}function Qa(e){return{width:`${Cn(e)}%`}}function Cn(e){return 100/e}function er(e,t){return e<=0||t===0?1:e>t?t:e}function tr(e,t,n){return Math.min(Math.max(e,t),n)}function Dt(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function sr(e){if(e!=null)return String(e)}function nr(e,t){if(e<=0||t===0)return 0;const n=t-1;return e>n?n:e}function De(e){const t=i.useRef(e);return _e(()=>{t.current=e}),i.useCallback((...n)=>(0,t.current)(...n),[])}const ar={isPressed:!1,startX:0,startY:0,lastX:0,lastT:0,axis:null,dragged:!1},Ns=8,rr=.4,ir=i.forwardRef(function({slidesToShow:t=3,startSlide:n=0,children:a,className:r,showNavigation:c=!0,showArrows:o,arrowsSize:l=30,navigationClassName:d,onSlideChange:u,navigationDotRenderer:m,"aria-label":h="Carousel",autoplay:b=!1,autoplayInterval:f=4e3,pauseOnHover:w=!0,cellHeight:p,aspectRatio:_,gap:v,maxWidth:g,enableFullscreen:x=!1},T){const y=i.Children.count(a),C=er(t,y),R=nr(n,y),k=o&&y>1,N=Math.max(0,y-C),[S,E]=i.useState(R),[D,I]=i.useState({animation:void 0}),[z,$]=i.useState(0),[M,F]=i.useState(!1),[A,X]=i.useState(null),[ne,G]=i.useState(0),[ce,Z]=i.useState(!1),te=i.useRef(null),L=i.useRef(null),B=ge(T,L),K=i.useRef(null),[ee,U]=i.useState(!1),se=i.useRef({...ar});_e(()=>{I(H=>({...H,animation:!1}))},[C]),_e(()=>{E(R),u==null||u(R),D.animation!==void 0&&I(H=>({...H,animation:!0}))},[R]);const de=H=>{Object.assign(se.current,H)},ie=()=>typeof performance!="undefined"?performance.now():Date.now(),xe=H=>{const q=tr(H,0,N);E(q),I(he=>({...he,animation:!0})),u==null||u(q)},Q=H=>{X(q=>q===null?q:(q+H+y)%y)},me=i.useRef(null),J=H=>{K.current&&(K.current.removeEventListener(H?"mousemove":"touchmove",O),K.current.removeEventListener(H?"mouseup":"touchend",V),H&&K.current.removeEventListener("mouseleave",V))},be=De(H=>{if(!K.current)return;const q=xt(H);if(q&&H.button!==0)return;H.stopPropagation();const he=Mt(H),we=js(H);de({isPressed:!0,startX:he,startY:we,lastX:he,lastT:ie(),axis:null,dragged:!1}),K.current.addEventListener(q?"mousemove":"touchmove",O,{passive:!1}),K.current.addEventListener(q?"mouseup":"touchend",V),q&&K.current.addEventListener("mouseleave",V)}),O=De(H=>{if(!te.current||!se.current.isPressed)return;if(ts(H)&&H.touches.length>1)return V(H);const q=Mt(H),he=js(H),we=q-se.current.startX,ve=he-se.current.startY;if(se.current.axis===null){if(Math.abs(we)<Ns&&Math.abs(ve)<Ns)return;const Ae=Math.abs(we)>=Math.abs(ve)?"x":"y";if(de({axis:Ae,dragged:!0}),Ae==="y")return V(H);y>1&&F(!0)}if(se.current.axis==="x"){if(H.preventDefault(),H.stopPropagation(),y>1){const Ae=S<=0,$e=S>=N,Pe=Ae&&we>0||$e&&we<0?we*.35:we;$(Pe)}se.current.lastX=q,se.current.lastT=ie()}}),V=De(H=>{if(!se.current.isPressed)return;const q=xt(H);J(q);const{axis:he,dragged:we,startX:ve,lastX:Ae,lastT:$e}=se.current;if(de({isPressed:!1}),F(!1),he==="x"&&we&&y>1&&te.current){const Pe=Mt(H),bt=Pe-ve,st=te.current.offsetWidth/C,wt=$e?(Pe-Ae)/Math.max(1,ie()-$e):0;let nt=st>0?Math.round(-bt/st):0;nt===0&&Math.abs(wt)>rr&&(nt=wt<0?1:-1),xe(S+nt)}$(0)}),oe=H=>()=>{se.current.dragged||x&&X(H)},ae=H=>()=>xe(H),P=H=>{const q=C===1,he=q?y:Math.ceil(y/C),we=S+C,ve=y-C<=S,$e=(ys(we,C,y,ve)+H+he)%he;return q?$e:$e*C},re=()=>{if(!c)return s.jsx(s.Fragment,{});const H=y-C<=S,q=C===1,he=q?y:Math.ceil(y/C),we=[];for(let ve=0;ve<he;ve++){let Ae=ve,$e=S;if(!q){const wt=ve===he-1,nt=S+C;Ae=wt?y-C:ve*C,$e=ys(nt,C,y,H)}const Pe=$e===ve,bt=ae(Ae);let st=s.jsx("div",{className:j("smwb-carousel__navigation__dot",Pe&&"current"),onClick:bt},ve);m&&(st=m(ve,Pe,bt)),we.push(st)}return s.jsx("div",{className:j("smwb-carousel__navigation",d),children:we})},le=()=>{const H=S>N?N:S;return Cn(C)*H},ke=i.useId(),Ne=Qa(C),Te={transform:`translateX(calc(-${le()}% + ${z}px))`,transition:M||D.animation===void 0?"none":D.animation?"transform 500ms cubic-bezier(.1, 0, .25, 1)":"none"},Y={},ue=Dt(p),je=sr(_),Ie=Dt(v),Le=Dt(g);if(ue&&(Y["--smwb-carousel-cell-height"]=ue),je&&(Y["--smwb-carousel-aspect-ratio"]=je),Ie&&(Y["--smwb-carousel-gap"]=Ie),Le&&(Y["--smwb-carousel-max-width"]=Le),i.useEffect(()=>{Array.isArray(a)||console.error("SMWB Material: The `children` prop was passed invalidly. It should contain an array of elements.")},[a]),i.useEffect(()=>{if(!b||y<=1||w&&ee||A!==null)return;const H=window.setInterval(()=>{ae(P(1))()},f);return()=>window.clearInterval(H)},[b,f,w,ee,y,S,C,A]),i.useEffect(()=>{if(A===null||y<=1)return;const H=q=>{q.key==="ArrowLeft"?Q(-1):q.key==="ArrowRight"&&Q(1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[A,y]),!Array.isArray(a))return s.jsx(s.Fragment,{});const ht=a,tt=H=>{var q,he;me.current=(he=(q=H.touches[0])==null?void 0:q.clientX)!=null?he:null},Rt=H=>{var he,we;if(me.current===null||y<=1)return;const q=((we=(he=H.touches[0])==null?void 0:he.clientX)!=null?we:me.current)-me.current;Z(!0),G(q)},ia=H=>{var we,ve;const q=me.current;if(me.current=null,Z(!1),G(0),q===null||y<=1)return;const he=((ve=(we=H.changedTouches[0])==null?void 0:we.clientX)!=null?ve:q)-q;Math.abs(he)>40&&Q(he<0?1:-1)},oa={transform:`translateX(calc(-${(A!=null?A:0)*100}% + ${ne}px))`,transition:ce?"none":"transform 350ms cubic-bezier(.22, .61, .36, 1)"};return s.jsxs("div",{className:j("smwb-carousel",r),"data-testid":"carousel",ref:B,role:"region","aria-roledescription":"carousel","aria-label":h,style:Y,onMouseEnter:w?()=>U(!0):void 0,onMouseLeave:w?()=>U(!1):void 0,children:[s.jsxs("div",{className:j("smwb-carousel__inner"),ref:te,children:[k&&s.jsx(W,{name:"chevron_left",size:l,className:j("smwb-carousel__arrow","smwb-carousel__arrow_prev"),style:{top:`calc(50% - ${l/2}px)`,left:-l/2},onClick:()=>ae(P(-1))()}),s.jsx("div",{ref:K,className:"smwb-carousel__track",onMouseDown:be,onTouchStart:be,onDragStart:ks,onDragEnd:ks,children:s.jsx("div",{className:"smwb-carousel__layer",style:Te,children:i.Children.map(a,(H,q)=>s.jsx("div",{id:`${ke}${q}`,className:"smwb-carousel__slide",style:Ne,children:s.jsx("div",{className:j("smwb-carousel__slide-inner",x&&"smwb-carousel__slide-inner_clickable"),onClick:x?oe(q):void 0,children:H})},q))})}),k&&s.jsx(W,{name:"chevron_right",size:l,className:j("smwb-carousel__arrow","smwb-carousel__arrow_next"),style:{top:`calc(50% - ${l/2}px)`,right:-l/2},onClick:()=>ae(P(1))()})]}),re(),x&&s.jsx(Ke,{open:A!==null,size:"fullscreen",backdrop:"darkBlured",className:"smwb-carousel__fullscreen",onClose:()=>X(null),"aria-label":"Image viewer",children:A!==null&&s.jsxs("div",{className:"smwb-carousel__fullscreen-content",children:[y>1&&s.jsx(W,{name:"chevron_left",size:40,className:j("smwb-carousel__fullscreen-arrow","smwb-carousel__fullscreen-arrow_prev"),onClick:()=>Q(-1)}),s.jsx("div",{className:"smwb-carousel__fullscreen-stage",onTouchStart:tt,onTouchMove:Rt,onTouchEnd:ia,children:s.jsx("div",{className:"smwb-carousel__fullscreen-track",style:oa,children:ht.map((H,q)=>s.jsx("div",{className:"smwb-carousel__fullscreen-slide","aria-hidden":q!==A,children:H},q))})}),y>1&&s.jsx(W,{name:"chevron_right",size:40,className:j("smwb-carousel__fullscreen-arrow","smwb-carousel__fullscreen-arrow_next"),onClick:()=>Q(1)}),s.jsx(W,{name:"close",size:32,className:"smwb-carousel__fullscreen-close",onClick:()=>X(null)})]})})]})}),or=()=>{const[e,t]=i.useState(!1),n=i.useCallback(()=>{t(!1)},[]),a=i.useCallback(()=>{t(!0)},[]);return{onClose:n,onOpen:a,isOpen:e}},Sn=i.createContext({rowsHeight:0}),lr=({className:e,src:t,rounded:n,itemBarContent:a,cols:r=1,rows:c=1,itemBarPlacement:o="bottom",alt:l="image"})=>{const{isOpen:d,onClose:u,onOpen:m}=or(),{rowsHeight:h,variant:b}=i.useContext(Sn);i.useEffect(()=>{d?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[d]);const f={height:h?`${h*c}px`:"",gridRowEnd:`span ${c}`,gridColumnEnd:`span ${r}`};return s.jsxs(s.Fragment,{children:[s.jsx("li",{"data-testid":"images-list-item",className:j("smwb-gallery__list__item",e,"smwb-gallery-item",`smwb-${b}`),onClick:m,style:f,children:s.jsxs("div",{className:"smwb-gallery-item__inner",children:[s.jsx("div",{className:"smwb-gallery-item__img-wrapper",children:s.jsx("img",{src:t,alt:l||"image",className:j("smwb-gallery-item__img",{"smwb-rounded":n})})}),a&&s.jsx("div",{className:j("smwb-gallery-item__bar",e,`smwb-${o}`,{"smwb-rounded":n}),children:a})]})}),s.jsx(Tn,{src:t,onClose:u,isOpen:d})]})},cr=i.forwardRef(function({className:t,children:n,gap:a=4,cols:r=3,rowsHeight:c=0,variant:o="default","aria-label":l,id:d},u){return s.jsx(Sn.Provider,{value:{rowsHeight:c,variant:o},children:s.jsx("div",{className:j("smwb-gallery",t),"data-testid":"images-list",ref:u,id:d,children:s.jsx("ul",{"aria-label":l,className:j("smwb-gallery__list",`smwb-${o}`),style:{"--cols-count":r,"--gap":`${a}px`},children:n})})})}),Tn=({src:e,onClose:t,isOpen:n})=>{const a=i.useRef(null);return Ce.createPortal(s.jsx(He.CSSTransition,{timeout:100,in:n,classNames:{enterActive:"smwb-image-modal__overlay-enter-active",enterDone:"smwb-image-modal__overlay-enter-done"},mountOnEnter:!0,unmountOnExit:!0,nodeRef:a,children:s.jsx("div",{className:"smwb-image-modal__overlay",onClick:t,ref:a,children:s.jsx("div",{className:"smwb-image-modal",onClick:r=>r.stopPropagation(),children:s.jsx("img",{src:e,alt:"",className:"smwb-image-modal__img"})})})}),document.body)},ur=i.forwardRef(function({className:t,children:n,disabled:a,selected:r,dense:c,divider:o,startAdornment:l,endAdornment:d,onClick:u},m){const h=!!u&&!a;return s.jsxs("li",{ref:m,role:"listitem",tabIndex:h?0:void 0,"aria-disabled":a||void 0,"aria-selected":r||void 0,onClick:a?void 0:u,onKeyDown:h?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),u==null||u(b))}:void 0,className:j("smwb-list__item",t,{"smwb-disabled":a,"smwb-selected":r,"smwb-list__item_dense":c,"smwb-list__item_divider":o}),"data-testid":"list-item",children:[s.jsx("span",{className:"smwb-list__item__start",children:l}),s.jsx("span",{className:"smwb-list__item__main",children:n}),s.jsx("span",{className:"smwb-list__item__end",children:d})]})}),dr=i.forwardRef(function({className:t,dense:n,subheader:a,children:r,...c},o){return s.jsxs("ul",{ref:o,"data-testid":"list",role:"list",className:j("smwb-list",{"smwb-list_dense":n},t),...c,children:[a?s.jsx("li",{className:"smwb-list__subheader",children:a}):null,r]})}),Mn=({limit:e,page:t,totalCount:n,onPrev:a,onNext:r,limitOptions:c,onLimitChange:o,hasNextPage:l})=>{const d=typeof n=="undefined",u=d?!l:t===Math.ceil(n/e),m=w=>{o&&o(+w.target.value)},h=()=>{a==null||a()},b=()=>{r==null||r()},f=()=>{const w=t*e-e,p=t*e;return`${w}–${p}`+(d?"":` of ${n}`)};return s.jsx("div",{className:"smwb-table__pagination",children:s.jsxs("div",{className:"smwb-table__pagination__controls",children:[c&&c.length>1&&s.jsxs("div",{className:"smwb-table__pagination__rows",children:[s.jsx("span",{children:"Rows per page"}),s.jsx("select",{id:"rows",className:"smwb-table__pagination__select",onChange:m,value:e,children:c.map(w=>s.jsx("option",{value:w,className:j("smwb-select-option",{selected:w===e}),children:w},w))})]}),s.jsx("div",{className:"smwb-table__pagination__current-count",children:f()}),s.jsxs("div",{className:"smwb-table__pagination__buttons",children:[s.jsx("button",{className:"smwb-table__pagination__control",onClick:h,disabled:t===1,children:s.jsx(W,{name:"chevron_left",size:24,weight:600})}),s.jsx("span",{className:"smwb-table__pagination__page",children:t}),s.jsx("button",{className:"smwb-table__pagination__control",onClick:b,disabled:u,children:s.jsx(W,{name:"chevron_right",size:24,weight:600})})]})]})})},mr=i.forwardRef(({className:e,dense:t,hovered:n,children:a,paginationSettings:r,isLoading:c,stickyHeader:o,caption:l,...d},u)=>s.jsxs("div",{ref:u,className:j("smwb-table__wrapper",e,{"smwb-table__wrapper_loading":c}),...d,children:[s.jsx("div",{className:j("smwb-table__container",{"smwb-withPagination":!!r}),children:s.jsxs("table",{className:j("smwb-table",{"smwb-dense":t,"smwb-hovered":n,"smwb-table_sticky-header":o}),children:[l!=null&&s.jsx("caption",{className:"smwb-table__caption",children:l}),a]})}),!!r&&s.jsx(Mn,{...r})]})),fr=({children:e,className:t,...n})=>s.jsx("tbody",{...n,className:j("smwb-table__body",t),children:e}),hr=({children:e,cellAlign:t="left",className:n,...a})=>s.jsx("td",{...a,className:j("smwb-table__cell",n),align:t||"left",children:e}),br=({children:e,className:t,...n})=>s.jsx("thead",{...n,className:j("smwb-table__head",t),children:e}),wr=({children:e,className:t,cellAlign:n="left",isSortedByAsc:a,isSortedByDesc:r,sortable:c,sortDirection:o,onSort:l,...d})=>{const u=o!==void 0?o:a?"asc":r?"desc":!1,m=c?u==="asc"?"ascending":u==="desc"?"descending":"none":void 0,h=u==="asc"?"expand_more":u==="desc"?"expand_less":"",b=f=>{c&&l&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l())};return s.jsx("th",{...d,"aria-sort":m,className:j("smwb-table__cell","smwb-head-cell",t,{[`smwb-align_${n}`]:!!n,"smwb-head-cell_sortable":c}),children:s.jsxs("span",{className:"smwb-head-cell__content",onClick:c?l:void 0,onKeyDown:c?b:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,children:[e,s.jsx(W,{name:h,size:18,weight:800})]})})},pr=({children:e,className:t,selected:n,expanded:a,...r})=>s.jsx("tr",{"data-testid":"table-row",className:j("smwb-table__row",t,{"smwb-table__row_selected":n,"smwb-table__row_expanded":a}),"aria-selected":n!=null?n:void 0,"aria-expanded":a!=null?a:void 0,...r,children:e}),_r=i.forwardRef(function({className:t,listIcon:n="draft",nodeIcon:a={closed:"folder",opened:"folder_open"},data:r=[],expanded:c,defaultExpanded:o=[],onExpandedChange:l,selected:d,defaultSelected:u=[],onSelectedChange:m,selectable:h=!1,checkboxes:b=!1,renderLabel:f,loadChildren:w,...p},_){const[v,g]=i.useState({}),[x,T]=i.useState([]),[y,C]=Fe({value:c,defaultValue:o,onChange:l}),R=i.useRef(),[k,N]=Fe({value:d,defaultValue:u,onChange:M=>{const F=R.current;R.current=void 0,m==null||m(M,F)}}),S=M=>{C(F=>F.includes(M)?F.filter(A=>A!==M):[...F,M])},E=(M,F)=>{C(A=>{const X=A.includes(M);return F&&!X?[...A,M]:!F&&X?A.filter(ne=>ne!==M):A})},D=M=>{R.current={id:M,selected:!k.includes(M)},N(F=>F.includes(M)?F.filter(A=>A!==M):[...F,M])},I=(M,F)=>{!w||v[F]||M.children&&M.children.length>0||(T(A=>A.includes(F)?A:[...A,F]),w(M,F).then(A=>{g(X=>({...X,[F]:A}))}).finally(()=>{T(A=>A.filter(X=>X!==F))}))},z=(M,F)=>{var K,ee;const A=(K=M.id)!=null?K:F,X=(ee=M.children)!=null?ee:v[A],ne=!!w&&(M.hasChildren||!!v[A]),G=!!X&&X.length>0||ne,ce=y.includes(A),Z=k.includes(A),te=x.includes(A),L=()=>{G&&(ce||I(M,A),S(A)),h&&D(A)},B=U=>{U.key==="Enter"||U.key===" "?(U.preventDefault(),L()):U.key==="ArrowRight"&&G?(I(M,A),E(A,!0)):U.key==="ArrowLeft"&&G&&E(A,!1)};return s.jsxs("div",{className:j("smwb-tree__node",{"smwb-tree__node_selected":Z}),role:"treeitem","aria-expanded":G?ce:void 0,"aria-selected":h||b?Z:void 0,children:[s.jsxs("span",{className:"smwb-tree__node__content",onClick:L,onKeyDown:B,tabIndex:0,role:"button",children:[b&&s.jsx("input",{type:"checkbox",className:"smwb-tree__node__checkbox",checked:Z,onClick:U=>U.stopPropagation(),onChange:()=>D(A),"aria-label":M.label}),s.jsxs("span",{className:"smwb-tree__node__label",children:[G&&ce?s.jsx(W,{name:a==null?void 0:a.opened,fill:1,size:20}):G?s.jsx(W,{name:a==null?void 0:a.closed,fill:1,size:20}):s.jsx(W,{name:n,size:20}),f?f(M,A):M.label]})]}),G&&ce&&s.jsx("div",{role:"group",children:te&&!X?s.jsx("div",{className:"smwb-tree__node__loading",role:"status",children:"Загрузка…"}):X==null?void 0:X.map((U,se)=>z(U,`${F}.${se}`))})]},A)},$=i.useMemo(()=>r.map((M,F)=>z(M,`${F}`)),[r,y,k,h,b,n,a,f,v,x]);return s.jsx("div",{"data-testid":"tree-view",...p,ref:_,role:"tree",className:j("smwb-tree",t),children:$.map((M,F)=>s.jsx("div",{className:"smwb-tree__wrapper",role:"presentation",children:M},F))})});function Rs(e){return e.substring(2).toLowerCase()}function gr(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function Qe({children:e,disableReactTree:t=!1,mouseEvent:n="onMouseUp",onClickAway:a,touchEvent:r="onTouchEnd",enabled:c=!0}){const o=i.useRef(!1),l=i.useRef(null),d=i.useRef(!1),u=i.useRef(!1);i.useEffect(()=>(setTimeout(()=>{d.current=!0},0),()=>{d.current=!1}),[]);const m=ge(e.ref,l),h=De(w=>{const p=u.current;if(u.current=!1,!c||!d.current||!l.current||"clientX"in w&&gr(w,document))return;if(o.current){o.current=!1;return}let _;if(w.composedPath)_=w.composedPath().indexOf(l.current)>-1;else{const v=w.target;_=!document.documentElement.contains(v)||l.current.contains(v)}if(!_&&(t||!p)){if(Wa(w,l.current))return;a(w)}}),b=w=>p=>{u.current=!0;const _=e.props[w];_&&_(p)},f={ref:m};return r!==!1&&(f[r]=b(r)),i.useEffect(()=>{if(r!==!1){const w=Rs(r),p=()=>{o.current=!0};return document.addEventListener(w,h),document.addEventListener("touchmove",p),()=>{document.removeEventListener(w,h),document.removeEventListener("touchmove",p)}}},[h,r]),n!==!1&&(f[n]=b(n)),i.useEffect(()=>{if(n!==!1){const w=Rs(n);return document.addEventListener(w,h),()=>{document.removeEventListener(w,h)}}},[h,n]),s.jsx(s.Fragment,{children:i.cloneElement(e,f)})}const Dn=i.forwardRef(({className:e,children:t,type:n,severity:a,variant:r="filled",onClose:c,closeAriaLabel:o="Close",...l},d)=>{const u=a!=null?a:n,m=j("smwb-message",`smwb-message_${r}`,e,{[`smwb-message_${u}`]:!!u});return s.jsxs("div",{"data-testid":"message",role:"alert","aria-live":u==="error"?"assertive":"polite",...l,className:m,ref:d,children:[t,c&&s.jsx("button",{className:"smwb-message__close-btn",onClick:c,"aria-label":o,type:"button",children:s.jsx(W,{name:"close",weight:1e3})})]})}),xr=({children:e})=>s.jsx("div",{className:"smwb-message__header",children:e}),vr=Object.assign(Dn,{Header:xr});function yr({open:e,title:t,nameLabel:n,name:a,onNameChange:r,previewSrc:c,onCapture:o,captureLabel:l,busy:d,confirmLabel:u,cancelLabel:m,onConfirm:h,onClose:b,children:f,className:w}){const p=r!==void 0||a!==void 0;return s.jsxs(Ke,{open:e,onClose:b,size:"small",children:[s.jsx(Ke.Header,{children:t!=null?t:"Save"}),s.jsx(Ke.Content,{children:s.jsxs("div",{className:j("smwb-save-asset-dialog__body",w),children:[p?s.jsx(Be,{label:n!=null?n:"Name",value:a!=null?a:"",disabled:!!d,onChange:_=>r==null?void 0:r(_.currentTarget.value)}):null,c?s.jsx("div",{className:"smwb-save-asset-dialog__preview",children:s.jsx("img",{src:c,alt:""})}):null,o?s.jsx(Me,{variant:"outlined",size:"small",disabled:!!d,onClick:()=>o(),label:l!=null?l:"Capture preview"}):null,f]})}),s.jsxs(Ke.Footer,{children:[s.jsx(Me,{variant:"text",disabled:!!d,onClick:()=>b(),label:m!=null?m:"Cancel"}),s.jsx(Me,{variant:"contained",disabled:!!d,onClick:()=>h(),label:u!=null?u:"Save"})]})]})}const En=i.forwardRef(function({type:t,variant:n,className:a,progressValue:r=0,color:c="primary",size:o="medium",id:l,...d},u){const m={role:"progressbar","aria-label":d["aria-label"],id:l,...t==="determinate"?{"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100}:{}},h=c!=="primary"?`smwb-indicator_color-${c}`:null;return n==="circular"?s.jsx("div",{ref:u,className:j("smwb-indicator_circular",`smwb-${t}`,h,`smwb-indicator_size-${o}`,a),...m,children:t==="determinate"?s.jsx(In,{progressValue:r}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"smwb-indicator_circular__thumb"}),s.jsx("div",{}),s.jsx("div",{}),s.jsx("div",{})]})}):s.jsx("div",{ref:u,className:j("smwb-indicator_linear",`smwb-${t}`,h,a),...m,children:s.jsx("div",{className:"smwb-indicator_linear__thumb",style:t==="determinate"?{width:`${r}%`}:{}})})});function In({progressValue:e=0}){const t=i.useRef(null);return i.useEffect(()=>{var a;if(!t.current||!t.current.r)return;const n=(a=t.current)==null?void 0:a.r.baseVal.value;if(n&&t.current){const r=2*Math.PI*n;t.current.style.strokeDasharray=`${r} ${r}`,t.current.style.strokeDashoffset=`${r}`;const c=r-e/100*r;t.current.style.strokeDashoffset=`${c}`}},[t,e]),s.jsx("svg",{className:"smwb-indicator_circular__svg",children:s.jsx("circle",{className:"smwb-indicator_circular__circle",cx:"24",cy:"24",r:"22",ref:t})})}function jr(){const[e,t]=i.useState(null);return _e(()=>{const n=document.createElement("div");return n.id=`snackbar-portal-${Ys.v4()}`,document.body.prepend(n),t(n),()=>{document.body.removeChild(n)}},[]),{snackbarDomRoot:e}}function kr({snack:e,position:t,variant:n,className:a,component:r,autoClose:c,autoCloseTime:o,snackRest:l,onSnackRemove:d,onClose:u}){var h,b,f,w,p;const m=i.useRef(null);return s.jsx(He.CSSTransition,{appear:!0,timeout:125,classNames:{appear:"smwb-snackbar-enter",appearActive:"smwb-snackbar-enter-active",appearDone:"smwb-snackbar-enter-done",enter:"smwb-snackbar-enter",enterActive:"smwb-snackbar-enter-active",enterDone:"smwb-snackbar-enter-done",exitActive:"smwb-snackbar-exit-active"},unmountOnExit:!0,in:!0,nodeRef:m,children:s.jsx(Rr,{ref:m,component:(h=e.component)!=null?h:r,message:e.message,position:(b=e.position)!=null?b:t,variant:(f=e.variant)!=null?f:n,onClick:d(e.id),className:j(a,e.className),isAutoClose:(w=e.autoClose)!=null?w:c,autoCloseTime:(p=e.autoCloseTime)!=null?p:o,onClose:u(e.id),...l})})}const An=i.createContext({addSnackbar:()=>"",clearAllSnackbars:()=>{},clearFirstSnackbar:()=>{},clearLastSnackbar:()=>{},clearByIdSnackbar:()=>{}});function Nr(e){const{position:t="top-right",variant:n="dark",className:a,autoClose:r=!0,autoCloseTime:c=5e3,closeOnClick:o=!0,onClick:l,component:d="div",children:u,...m}=e,[h,b]=i.useState([]),{snackbarDomRoot:f}=jr(),w=i.useCallback(R=>{const{key:k,...N}=R,S=k!=null?k:Ys.v4(),E={id:S,...N};return b(D=>{const I=D.findIndex($=>$.id===S);if(I===-1)return[...D,E];const z=[...D];return z[I]=E,z}),S},[]),p=()=>{b([])},_=()=>{b(R=>R.slice(1))},v=()=>{b(R=>R.slice(0,-1))},g=R=>{b(k=>k.filter(N=>N.id!==R))},x=R=>k=>{l==null||l(k),o&&g(R)},T=R=>()=>{g(R)},y=h.reduce((R,k)=>{var S,E;const N=(S=k.position)!=null?S:t;return R[N]=[...(E=R[N])!=null?E:[],k],R},{}),C=Object.keys(y).map(R=>{const k=y[R];return s.jsx(He.TransitionGroup,{className:j("smwb-snackbars",`smwb-${R}`),"data-testid":`snackbars-${R}`,appear:!0,children:k.map(N=>s.jsx(kr,{snack:N,position:t,variant:n,className:a,component:d,autoClose:r,autoCloseTime:c,snackRest:m,onSnackRemove:x,onClose:T},N.id))},R)});return s.jsxs(An.Provider,{value:{addSnackbar:w,clearAllSnackbars:p,clearFirstSnackbar:_,clearLastSnackbar:v,clearByIdSnackbar:g},children:[u,f&&Ce.createPortal(C,f)]})}const Rr=i.forwardRef(function({className:t,message:n,variant:a="dark",position:r="top-right",onClick:c,component:o="div",isAutoClose:l,autoCloseTime:d,onClose:u,action:m,...h},b){const f=i.useRef(),w=De(()=>{!u||!l||!d||(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{u()},d))});i.useEffect(()=>(w(),()=>{f.current&&clearTimeout(f.current)}),[w]);const p=o;return s.jsxs(p,{ref:b,className:j("smwb-snackbar",t,`smwb-${a}`,`smwb-${r}`),onClick:c,role:"alert","aria-live":a==="danger"?"assertive":"polite","aria-atomic":"true",...h,children:[s.jsx("div",{className:"smwb-snackbar__body",children:n}),m!=null?s.jsx("div",{className:"smwb-snackbar__action",children:m}):null]})});function Cr(){return i.useContext(An)}const Sr=i.forwardRef(function({className:t,children:n,placement:a="top",offset:r={offsetX:0,offsetY:0},message:c,open:o,trigger:l="hover",openDelay:d=0,closeDelay:u=0},m){var E,D;const h=Je(a),[b,f]=i.useState(!1),[w,p]=i.useState(!1),_=i.useRef(null),v=i.useRef(null),g=i.useCallback(()=>{_.current!==null&&(clearTimeout(_.current),_.current=null),v.current!==null&&(clearTimeout(v.current),v.current=null)},[]);i.useEffect(()=>()=>g(),[g]);const x=i.useCallback(()=>{if(g(),d<=0){f(!0);return}_.current=setTimeout(()=>f(!0),d)},[g,d]),T=i.useCallback(()=>{if(g(),u<=0){f(!1);return}v.current=setTimeout(()=>f(!1),u)},[g,u]),{refs:y,floatingStyles:C}=fe.useFloating({placement:h.placement,whileElementsMounted:fe.autoUpdate,middleware:[fe.offset({mainAxis:(E=r==null?void 0:r.offsetY)!=null?E:0,crossAxis:(D=r==null?void 0:r.offsetX)!=null?D:0}),...h.autoMiddleware?[h.autoMiddleware]:[]]}),R=l==="manual"?o===!0:l==="click"?w:b,k=l==="hover"?x:void 0,N=l==="hover"?T:void 0,S=l==="click"?()=>{p(I=>!I)}:void 0;return s.jsxs("div",{className:"smwb-tooltip__wrapper",role:"tooltip",ref:m,children:[s.jsx("div",{className:"smwb-tooltip__ref",ref:y.setReference,onPointerEnter:k,onPointerLeave:N,onClick:S,children:n}),R&&s.jsx("div",{ref:y.setFloating,className:j("smwb-tooltip",t),style:C,children:c})]})}),Tr=i.forwardRef(function(t,n){const{className:a,children:r,variant:c="contained",size:o="medium",orientation:l="horizontal",colorTheme:d="primary",color:u,fullWidth:m=!1,disabled:h=!1,...b}=t;return s.jsx("div",{ref:n,className:j("smwb-button-group",a,`smwb-${l}`,`smwb-${c}`,m&&"smwb-full-width",h),role:"group","data-testid":"button-group",...b,children:i.Children.map(r,f=>{var p,_,v,g,x,T;const w=f;return i.cloneElement(w,{className:"smwb-button-group__grouped",fullWidth:l==="vertical"||((p=w.props.fullWidth)!=null?p:m),variant:(_=w.props.variant)!=null?_:c,size:(v=w.props.size)!=null?v:o,disabled:(g=w.props.disabled)!=null?g:h,colorTheme:(x=w.props.colorTheme)!=null?x:d,color:(T=w.props.color)!=null?T:u})})})}),Mr=i.forwardRef(function(t,n){const{label:a,disabled:r,readOnly:c,required:o,name:l,id:d,indeterminate:u,className:m,size:h="medium",color:b="primary",onChange:f,helperText:w,error:p,..._}=t,v=mt(d),g=x=>{if(c){x.preventDefault();return}f==null||f(x,x.target.checked,t)};return s.jsx(Oe,{helperText:w,disabled:r,error:p,className:"smwb-text-field-checkbox",children:s.jsxs("label",{htmlFor:v,className:j("smwb-checkbox__wrapper",`smwb-checkbox_size-${h}`,`smwb-checkbox_color-${b}`,m,{"smwb-disabled":r,"smwb-readonly":c,"smwb-indeterminate":u}),children:[s.jsx("input",{type:"checkbox",id:v,name:l,className:"smwb-checkbox__input",disabled:r,readOnly:c,required:o,"aria-invalid":p||void 0,"aria-required":o||void 0,ref:n,..._,onChange:g}),s.jsx("span",{className:j("smwb-checkbox__btn",{"smwb-indeterminate":u}),children:u?s.jsx(W,{name:"remove",size:18,className:"smwb-checkbox__icon",weight:700}):s.jsx(W,{name:"check",size:17,className:"smwb-checkbox__icon",weight:700})}),a&&s.jsx("span",{className:"smwb-checkbox__label",children:a})]})})});function Ve({className:e,children:t,onMouseDown:n,disabled:a,size:r="medium",edge:c,...o}){const l=i.useRef(null),d=h=>{n==null||n(h)},u=h=>{var b;a||(b=l.current)==null||b.onRipple(h)},m=j("smwb-date-picker__icon-button",e,{"smwb-date-picker__icon-button--small":r==="small","smwb-date-picker__icon-button--edge-start":c==="start","smwb-date-picker__icon-button--edge-end":c==="end","smwb-date-picker__icon-button--disabled":a});return s.jsxs("button",{onMouseDown:d,onPointerDown:u,type:"button",className:m,disabled:a,...o,children:[t,!a&&s.jsx(Ee,{actionRef:l,center:!0})]})}function Vt({label:e,onLeftIconClick:t,onRightIconClick:n,onLabelClick:a,disabled:r,active:c,hiddenSwitches:o,dataToggleId:l,...d}){const u=j("smwb-date-picker__switch",{"smwb-date-picker__switch--hidden":o});return s.jsxs("div",{className:"smwb-date-picker__action",...d,children:[s.jsx("div",{className:u,children:s.jsx(Ve,{size:"small",onClick:r?void 0:t,children:s.jsx(W,{name:"keyboard_arrow_left",weight:500,size:24})})}),s.jsxs("div",{className:j("smwb-date-picker__action-label",{"smwb-date-picker__action-label--disabled":r,"smwb-date-picker__action-label--active":c}),"data-testid":l,onClick:r?void 0:a,children:[s.jsx("span",{className:"smwb-date-picker__action-text",children:e}),s.jsx(W,{name:"arrow_drop_down",weight:500,size:20})]}),s.jsx("div",{className:u,children:s.jsx(Ve,{size:"small",onClick:r?void 0:n,children:s.jsx(W,{name:"keyboard_arrow_right",weight:500,size:24})})})]})}const Xe=/yyyy|MM|dd/g;function Dr(e){const t=[];let n;for(Xe.lastIndex=0;(n=Xe.exec(e))!==null;)t.push(n[0]);return t}function Cs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Er(e){let t="^",n=0,a;for(Xe.lastIndex=0;(a=Xe.exec(e))!==null;)t+=Cs(e.slice(n,a.index)),t+=a[0]==="yyyy"?"(\\d{4})":"(\\d{2})",n=Xe.lastIndex;return t+=Cs(e.slice(n)),t+="$",new RegExp(t)}function Ir(e,t,n){if(t<1||t>12||n<1)return!1;const a=new Date(e,t-1,n);return a.getFullYear()===e&&a.getMonth()===t-1&&a.getDate()===n}function Ar(e,t){const n=e.getFullYear(),a=e.getMonth()+1,r=e.getDate();return t.replace(Xe,c=>c==="yyyy"?String(n).padStart(4,"0"):c==="MM"?String(a).padStart(2,"0"):String(r).padStart(2,"0"))}function $n(e,t){const n=Dr(t);if(n.length!==3||!n.includes("yyyy")||!n.includes("MM")||!n.includes("dd"))return;const a=Er(t).exec(e);if(!a)return;let r,c,o;if(n.forEach((l,d)=>{const u=Number(a[d+1]);if(l==="yyyy"){r=u;return}if(l==="MM"){c=u;return}o=u}),!(r===void 0||c===void 0||o===void 0)&&Ir(r,c,o))return new Date(r,c-1,o)}function $r(e,t){return $n(e,t)!==void 0}function ss(e,t=0){t=t%7;const n=new Date(e),a=n.getDay(),r=(a<t?7:0)+a-t;return new Date(n.setDate(n.getDate()-r))}function Fn(e,t=0){const n=new Date(ss(e,t));return new Date(n.setDate(n.getDate()+6))}function Fr(e,t){const n=[],a=new Date(e),c=new Date(t).getTime(),o=a;for(o.setHours(0,0,0,0);o.getTime()<=c;)n.push(new Date(o.getTime())),o.setDate(o.getDate()+1),o.setHours(0,0,0,0);return n}const Lr=(e,t,n)=>{const a=new Intl.DateTimeFormat(n,{weekday:"narrow"});return Fr(ss(e,t),Fn(e,t)).map(r=>a.format(r))};function Ln(e){const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),1)}function On(e){return Bn(new Date(e.getFullYear(),e.getMonth()+1,0))}function lt(e,t){return new Date(e)<new Date(t)}function Et(e,t){return lt(t,e)}function Or(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}const Br=(e,t)=>{const n=ss(Ln(e),t),a=Fn(On(e),t);let r=0,c=n;const o=[];let l=null;for(;lt(c,a);){const d=Math.floor(r/7);o[d]=o[d]||[];const u=c.getDay();l!==u&&(l=u,o[d].push(c),r+=1),c=Or(c,1)}return o};function Pr(e,t){return Ln(t)<=e&&e<=On(t)}function Ht(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Bn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}function _t(e,t){return Ht(e).getTime()===Ht(t).getTime()}function Pn(e,t){return ns(e,e.getMonth()+t)}function zr(e,t){return as(e,e.getFullYear()+t)}function at(e){return Bn(e)}function rt(e){return Ht(e)}function zn(e){const t=[],n=new Intl.DateTimeFormat(e,{month:"long"});for(let a=0;a<12;a++)t.push({label:n.format(Pn(new Date("1970-01-01"),a)),value:a});return t}function ns(e,t){const n=new Date(e);return n.setMonth(t),n}function Vn(e,t){const n=[];for(let a=e-t;a<=e+t;a++)n.push({label:String(a).padStart(4,"0"),value:a});return n}function as(e,t){const n=new Date(e);return n.setFullYear(t),n}function Vr(e,t){return new Intl.DateTimeFormat(t,{month:"short"}).format(e)}function Hr(e,t){return new Intl.DateTimeFormat(t,{year:"numeric"}).format(e)}function ct(e,t){return Re(e)?t?Ar(e,t):new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric"}).format(e):""}function rs(e){if(e)return e;const t={year:"yyyy",month:"MM",day:"dd"};return new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric"}).formatToParts(new Date("1970-01-01")).map(r=>t[r.type]||r.value).join("")}const Yt=/\d/gi,Yr=/[a-zA-Z]/g;function Kr(e){return e?e.replace(Yr,"_"):new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric"}).format(new Date("1970-01-01")).replace(Yt,"_")}function Hn(e){return t=>{let n=0;return t.split("").map((a,r)=>{if(Yt.lastIndex=0,n>e.length-1)return"";const c=e[n],o=e[n+1],l=Yt.test(a)?a:"",d=c==="_"?l:c+l;return n+=d.length,r===t.length-1&&o&&o!=="_"?d?d+o:"":d}).join("")}}function Ss(e,t){return $r(e,t)}function Ts(e,t){const n=$n(e,t);return n||new Date(Number.NaN)}function Re(e){return Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function is({viewValue:e,openView:t,onChange:n,onMonthLabelClick:a,onYearLabelClick:r,locale:c}){const o=i.useCallback(u=>()=>{n==null||n(Pn(e,u))},[n,e]),l=i.useCallback(u=>()=>{n==null||n(zr(e,u))},[n,e]),d=t===pe.months||t===pe.years;return s.jsxs("div",{className:"smwb-date-picker__header",children:[s.jsx(Vt,{label:Vr(e,c),onLeftIconClick:o(-1),onRightIconClick:o(1),onLabelClick:a,disabled:t===pe.years,active:t===pe.months,hiddenSwitches:d,dataToggleId:"date-picker-months-toggle"}),s.jsx(Vt,{label:Hr(e,c),onLeftIconClick:l(-1),onRightIconClick:l(1),onLabelClick:r,disabled:t===pe.months,active:t===pe.years,hiddenSwitches:d,dataToggleId:"date-picker-years-toggle"})]})}const Xr=i.memo(function({className:t,children:n,onMouseDown:a,onChange:r,active:c,current:o,hidden:l,outside:d,disabled:u,inRange:m,day:h,...b}){const f=i.useRef(null),w=i.useCallback(g=>{a==null||a(g)},[a]),p=i.useCallback(g=>{var x;u||(x=f.current)==null||x.onRipple(g)},[u]),_=i.useCallback(()=>{u||r==null||r(void 0,h)},[r,h,u]);if(l)return s.jsx("span",{className:"smwb-date-picker__day-hidden"});const v=j("smwb-date-picker__day",t,{"smwb-date-picker__day--active":!u&&c,"smwb-date-picker__day--current":o&&!c,"smwb-date-picker__day--outside":!u&&d,"smwb-date-picker__day--disabled":u,"smwb-date-picker__day--in-range":!u&&m});return s.jsxs("button",{className:v,type:"button",onMouseDown:w,onPointerDown:p,onClick:_,disabled:u,...b,children:[n,!u&&s.jsx(Ee,{actionRef:f,center:!0})]})});function os({viewValue:e,value:t,showDaysOutsideMonth:n,onChange:a,disablePast:r,disableFuture:c,weekStartsOn:o=0,minDate:l,maxDate:d,isDateDisabled:u,locale:m,range:h,rangeStart:b,rangeEnd:f}){const[w]=i.useState(new Date),p=i.useMemo(()=>Lr(w,o,m),[w,o,m]),_=i.useMemo(()=>Br(e,o),[e,o]),v=i.useCallback(y=>h?Re(b)&&_t(y,b)||Re(f)&&_t(y,f):Re(t)?_t(y,t):!1,[t,h,b,f]),g=i.useCallback(y=>!h||!Re(b)||!Re(f)?!1:Et(rt(y),rt(b))&<(at(y),at(f)),[h,b,f]),x=i.useCallback(y=>{let C=!1;return r&&(C=lt(at(y),w)),c&&(C=C||Et(rt(y),w)),l&<(at(y),rt(l))&&(C=!0),d&&Et(rt(y),at(d))&&(C=!0),u!=null&&u(y)&&(C=!0),C},[r,c,w,l,d,u]),T=i.useMemo(()=>p.map((y,C)=>s.jsx("span",{className:"smwb-date-picker__week-day",children:y.toString()},C)),[p]);return s.jsxs("div",{className:"smwb-date-picker__days",children:[s.jsx("div",{className:"smwb-date-picker__week-days",children:T}),s.jsx("div",{className:"smwb-date-picker__month",children:_.map((y,C)=>s.jsx("div",{className:"smwb-date-picker__week",children:y.map(R=>{const k=!Pr(R,e);return s.jsx(Xr,{day:R,current:_t(R,w),active:v(R),inRange:g(R),hidden:!n&&k,outside:k,onChange:a,disabled:x(R),children:R.getDate()},R.toISOString())})},C))})]})}const et=i.createContext({dense:!1,variant:"floating",onClose:()=>null});function kt(){return i.useContext(et)}const Ze=i.forwardRef(function(t,n){const{children:a,className:r,disabled:c,selected:o,onClick:l,onMouseDown:d,href:u,linkElement:m,linkProps:h,value:b,optionRenderer:f,...w}=t,{dense:p}=i.useContext(et),_=i.useRef(null),v=C=>{if(c){u&&C.preventDefault();return}l==null||l(C)},g=C=>{c||d==null||d(C)},x=C=>{var R;(R=_.current)==null||R.onRipple(C)};let T;if(u){const C=m!=null?m:"a";T=s.jsxs(C,{className:"smwb-menu__item-inner",href:u,...h,children:[a,s.jsx("span",{className:"smwb-menu__item__helper-text"})]})}else T=s.jsx("span",{className:"smwb-menu__item-inner",children:a});const y=j("smwb-menu__item",r,{"smwb-menu__item--dense":p,"smwb-menu__item--disabled":c,"smwb-menu__item--selected":o});return f?f(t):s.jsxs("li",{role:"menuitem",ref:n,className:y,tabIndex:c?void 0:0,onClick:v,"data-value":b,onMouseDown:g,onPointerDown:x,...w,children:[T,s.jsx(Ee,{actionRef:_})]})}),ls=i.forwardRef(function(t,n){const{children:a,className:r,edge:c,...o}=t,{dense:l}=i.useContext(et),d=j("smwb-menu__icon",r,{"smwb-menu__icon--dense":l,"smwb-menu__icon--start":c==="start","smwb-menu__icon--end":c==="end"});return s.jsx("span",{ref:n,className:d,...o,children:a})}),cs=i.forwardRef(function(t,n){const{children:a,className:r,inset:c=!1,...o}=t,{dense:l}=i.useContext(et),d=j("smwb-menu__text",r,{"smwb-menu__text--inset":c,"smwb-menu__text--dense":l});return s.jsx("span",{ref:n,className:d,...o,children:a})}),Yn=i.forwardRef(function(t,n){const{className:a,...r}=t,{variant:c}=kt();return s.jsx("li",{ref:n,className:j("smwb-menu__divider",a,c==="static"&&"smwb-menu__divider--vertical"),...r})}),Kn=i.forwardRef(function(t,n){const{children:a,className:r,...c}=t,{variant:o,onClose:l}=kt(),d=u=>{var b,f,w,p;const m=Array.from(u.currentTarget.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));if(m.length===0)return;const h=m.indexOf(document.activeElement);u.key==="ArrowDown"?(u.preventDefault(),(b=m[(h+1+m.length)%m.length])==null||b.focus()):u.key==="ArrowUp"?(u.preventDefault(),(f=m[(h-1+m.length)%m.length])==null||f.focus()):u.key==="Home"?(u.preventDefault(),(w=m[0])==null||w.focus()):u.key==="End"?(u.preventDefault(),(p=m[m.length-1])==null||p.focus()):u.key==="Escape"&&l()};return s.jsx("div",{ref:n,className:j("smwb-menu",r,`smwb-menu--${o}`),...c,children:s.jsx("ul",{className:j("smwb-menu__list",`smwb-menu__list--${o}`),role:"menu","aria-orientation":"vertical",onKeyDown:d,children:a})})});function Wr(e,t){return jt(e,t)}const Ur=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),Gr={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},Xn=i.forwardRef(function(t,n){const{anchorElement:a,isOpen:r,onClose:c,placement:o="bottom-start",middleware:l,style:d,...u}=t,[m,h]=i.useState(null),b=i.useRef(null),f=Je(o),{refs:w,floatingStyles:p}=fe.useFloating({open:!!r,placement:f.placement,whileElementsMounted:fe.autoUpdate,elements:{reference:a!=null?a:null},middleware:Wr(f,l)}),_=ge(n,b,h,w.setFloating),v=g=>{if(!r||!c||!m)return;const x=g.target;m.contains(x)||a!=null&&a.contains(x)||c==null||c()};return s.jsx(yt,{nodeRef:b,in:!!r,timeout:150,unmountOnExit:!0,children:g=>s.jsx(Qe,{onClickAway:v,children:s.jsx(Kn,{ref:_,style:{...p,...d,...Ur(150),...Gr[g]},...u})})})}),qr=i.forwardRef(function e(t,n){const{children:a,toggleElement:r,placement:c="right-start",onClose:o,openOnHover:l,...d}=t,[u,m]=i.useState(!1),[h,b]=i.useState(null),f=kt(),w=[fe.offset(({placement:x})=>{switch(x){case"right-start":case"left-start":return{crossAxis:-8,mainAxis:0};case"right-end":case"left-end":return{crossAxis:8,mainAxis:0};default:return{crossAxis:0,mainAxis:0}}})],p=x=>{x.button===0&&m(T=>!T)},_=()=>{m(!1),o==null||o()},v=x=>{x.key==="ArrowRight"||x.key==="Enter"||x.key===" "?(x.preventDefault(),m(!0)):(x.key==="ArrowLeft"||x.key==="Escape")&&m(!1)},g=i.cloneElement(r,{ref:b,onClick:p,onKeyDown:v,onMouseEnter:l?()=>m(!0):void 0,"aria-haspopup":"menu","aria-expanded":u,selected:u});return s.jsxs(et.Provider,{value:{...f,variant:"floating"},children:[g,s.jsx(Xn,{ref:n,...d,placement:c,isOpen:u,onClose:_,anchorElement:h,middleware:w,children:i.Children.map(a,x=>{if(!i.isValidElement(x))return null;if(x.type===e)return x;const T=x;return i.cloneElement(T,{onClick:y=>{var C,R;(R=(C=T.props).onClick)==null||R.call(C,y),_(),f.onClose()}})})})]})}),Zr=i.forwardRef(function(t,n){const{variant:a}=kt();if(a==="static"){const{anchorElement:r,isOpen:c,onClose:o,placement:l,middleware:d,...u}=t;return s.jsx(Kn,{ref:n,...u})}return s.jsx(Xn,{ref:n,...t})}),Nt=i.forwardRef(function(t,n){const{dense:a=!1,variant:r="floating",onClose:c,...o}=t,l=()=>{c==null||c()};return s.jsx(et.Provider,{value:{dense:a,variant:r,onClose:l},children:s.jsx(Zr,{ref:n,onClose:c,...o})})});function dt({value:e,items:t,onChange:n}){const a=i.useRef(null),r=i.useRef(null);_e(()=>{if(a.current&&r.current){const l=(a.current.offsetHeight-r.current.offsetHeight)/2;a.current.scrollTop=r.current.offsetTop-l}});const c=i.useCallback(l=>()=>{n==null||n(l)},[n]),o=i.useCallback(l=>d=>{e===l&&(r.current=d)},[e]);return s.jsx("div",{className:"smwb-date-picker__overflow",ref:a,"data-testid":"date-picker-list",children:s.jsx("ul",{className:"smwb-date-picker__list",children:t.map(({label:l,value:d})=>{const u=e===d;return s.jsxs(Ze,{selected:u,onClick:c(d),ref:o(d),children:[u&&s.jsx(ls,{children:s.jsx(W,{name:"check",weight:500,size:24})}),s.jsx(cs,{className:"smwb-date-picker__list-item",inset:!u,children:l})]},d)})})})}const Jr=rs();function Wn({value:e,onChange:t,onBlur:n,format:a}){const r=i.useMemo(()=>a?rs(a):Jr,[a]),[c,o]=i.useState(ct(e,a)),l=i.useMemo(()=>Kr(a),[a]),d=i.useMemo(()=>Hn(l),[l]),u=i.useRef(void 0);i.useEffect(()=>{const w=e!==u.current;u.current=e,w&&o(ct(e,a))},[e,a]);const m=w=>{o(w),t&&(Ss(w,r)?t(void 0,Ts(w,r)):w===""&&t(void 0))},h=i.useCallback(()=>{var w,p,_,v;n&&(Ss((p=(w=u.current)==null?void 0:w.toString())!=null?p:"",r)?n(void 0,Ts((v=(_=u.current)==null?void 0:_.toString())!=null?v:"",r)):u.current===""&&n(void 0),o(ct(e,a)))},[n,e,a,r]),b=Xt.useRifm({value:c,onChange:m,format:d}),f=r.toLowerCase();return{...b,onBlur:h,placeholder:f}}function Qr(e){e.stopPropagation()}const Un=i.forwardRef(function(t,n){const{value:a,onChange:r,onBlur:c,onToggle:o,disabled:l,disableCalendar:d,calendarIcon:u,format:m,...h}=t,b=Wn({value:a,onChange:r,onBlur:c,format:m});return s.jsx(Be,{ref:n,...b,type:"tel",endAdornment:!d&&s.jsx(Ve,{edge:"end",onClick:o,onMouseDown:Qr,disabled:!!l,"data-testid":"date-picker-icon-button",children:u||s.jsx(W,{name:"calendar_today",fill:1,weight:500,size:24})}),disabled:!!l,...h})});var pe=(e=>(e.days="days",e.months="months",e.years="years",e))(pe||{});const ei=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),ti={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},si=i.forwardRef(function(t,n){const{value:a,onChange:r,showDaysOutsideMonth:c,disablePast:o,disableFuture:l,weekStartsOn:d=1,placement:u="bottom-start",disabled:m,disableCalendar:h,calendarAriaLabel:b="Choose date",minDate:f,maxDate:w,isDateDisabled:p,locale:_,format:v,range:g,rangeValue:x,onRangeChange:T,calendarIcon:y,onBlur:C,...R}=t,k=i.useMemo(()=>a===void 0?void 0:new Date(a),[a]),N=x!==void 0,[S,E]=i.useState([void 0,void 0]),D=N&&x?x:S,[I,z]=i.useState(()=>Re(k)?k:new Date),[$,M]=i.useState("days"),[F,A]=i.useState(!1),X=i.useRef(null),ne=i.useRef(null),G=Je(u),{refs:ce,floatingStyles:Z}=fe.useFloating({open:F,placement:G.placement,whileElementsMounted:fe.autoUpdate,middleware:jt(G)}),te=ge(X,ce.setReference,n),L=ge(ne,ce.setFloating);_e(()=>{m||z(Re(k)?k:new Date)},[k,m]);const B=i.useCallback(O=>{z(O)},[]),K=i.useCallback(()=>{M($==="months"?"days":"months")},[$]),ee=i.useCallback(()=>{M($==="years"?"days":"years")},[$]),U=i.useCallback(O=>{z(ns(I,O)),M("days")},[I]),se=i.useCallback(O=>{z(as(I,O)),M("days")},[I]),de=i.useCallback((O,V)=>{if(g){if(!V)return;const[oe,ae]=D;let P;!oe||oe&&ae?P=[V,void 0]:P=Re(oe)&&V.getTime()<oe.getTime()?[V,oe]:[oe,V],N||E(P),T==null||T(P),P[0]&&P[1]&&A(!1);return}r==null||r(O,V,t),A(!1)},[r,t,g,D,N,T]),ie=i.useCallback(()=>{m||A(O=>!O)},[m]),xe=i.useCallback(O=>{var oe,ae;const V=O.target;(oe=ne.current)!=null&&oe.contains(V)||(ae=X.current)!=null&&ae.contains(V)||A(!1)},[]),Q=i.useMemo(()=>zn(_),[_]),me=i.useMemo(()=>Vn(new Date().getFullYear(),100),[]);let J=null;switch($){case"days":J=s.jsx(os,{viewValue:I,value:k,showDaysOutsideMonth:c,onChange:de,disablePast:o,disableFuture:l,weekStartsOn:d,minDate:f,maxDate:w,isDateDisabled:p,locale:_,range:g,rangeStart:D[0],rangeEnd:D[1]});break;case"months":J=s.jsx(dt,{value:I.getMonth(),items:Q,onChange:U});break;case"years":J=s.jsx(dt,{value:I.getFullYear(),items:me,onChange:se});break}const be=g&&(D[0]||D[1])?`${ct(D[0],v)} – ${ct(D[1],v)}`:"";return s.jsxs(s.Fragment,{children:[g?s.jsx(Be,{ref:te,value:be,readOnly:!0,onChange:()=>{},disabled:!!m,placeholder:v?`${v} – ${v}`:void 0,endAdornment:!h&&s.jsx(Ve,{edge:"end",onClick:ie,disabled:!!m,"data-testid":"date-picker-icon-button",children:y||s.jsx(W,{name:"calendar_today",fill:1,weight:500,size:24})}),...R}):s.jsx(Un,{ref:te,value:k,onChange:r,onBlur:C,onToggle:ie,disabled:m,disableCalendar:h,format:v,calendarIcon:y,...R}),Ce.createPortal(s.jsx(yt,{nodeRef:ne,in:F&&!m&&!h,timeout:150,mountOnEnter:!0,unmountOnExit:!0,children:O=>s.jsx(Qe,{onClickAway:xe,children:s.jsx("div",{ref:L,className:"smwb-date-picker",style:{...Z,...ei(150),...ti[O]},"data-testid":"date-picker","data-smwb-overlay-layer":"",role:"dialog","aria-modal":"false","aria-label":b,children:s.jsxs("div",{className:"smwb-date-picker__inner",children:[s.jsx(is,{viewValue:I,locale:_,openView:$,onChange:B,onMonthLabelClick:K,onYearLabelClick:ee}),s.jsx("div",{className:"smwb-date-picker__body",children:J})]})})})}),document.body)]})}),We=/yyyy|MM|dd|HH|mm|ss/g;function ni(e){const t=[];let n;for(We.lastIndex=0;(n=We.exec(e))!==null;)t.push(n[0]);return t}function Ms(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ai(e){let t="^",n=0,a;for(We.lastIndex=0;(a=We.exec(e))!==null;)t+=Ms(e.slice(n,a.index)),t+=a[0]==="yyyy"?"(\\d{4})":"(\\d{2})",n=We.lastIndex;return t+=Ms(e.slice(n)),t+="$",new RegExp(t)}function ri(e,t,n){if(t<1||t>12||n<1)return!1;const a=new Date(e,t-1,n);return a.getFullYear()===e&&a.getMonth()===t-1&&a.getDate()===n}function ii(e,t,n){return e>=0&&e<=23&&t>=0&&t<=59&&n>=0&&n<=59}function oi(e,t){const n=e.getFullYear(),a=e.getMonth()+1,r=e.getDate(),c=e.getHours(),o=e.getMinutes(),l=e.getSeconds();return t.replace(We,d=>d==="yyyy"?String(n).padStart(4,"0"):d==="MM"?String(a).padStart(2,"0"):d==="dd"?String(r).padStart(2,"0"):d==="HH"?String(c).padStart(2,"0"):d==="mm"?String(o).padStart(2,"0"):String(l).padStart(2,"0"))}function Gn(e,t){const n=ni(t);if(!n.includes("yyyy")||!n.includes("MM")||!n.includes("dd")||!n.includes("HH")||!n.includes("mm"))return;const a=ai(t).exec(e);if(!a)return;let r,c,o,l,d,u=0;if(n.forEach((m,h)=>{const b=Number(a[h+1]);if(m==="yyyy"){r=b;return}if(m==="MM"){c=b;return}if(m==="dd"){o=b;return}if(m==="HH"){l=b;return}if(m==="mm"){d=b;return}u=b}),!(r===void 0||c===void 0||o===void 0||l===void 0||d===void 0)&&!(!ri(r,c,o)||!ii(l,d,u)))return new Date(r,c-1,o,l,d,u)}function It(e,t){return Gn(e,t)!==void 0}const li=/[a-zA-Z]/g;function ot(e,t){return!e||Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e)?"":t?oi(e,t):new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(e)}function vt(e){return e||`${rs()} HH:mm`}function ci(e){return vt(e).replace(li,"_")}function Ds(e,t){const n=Gn(e,t);return n||new Date(Number.NaN)}function qn({value:e,onChange:t,onBlur:n,format:a}){const r=i.useMemo(()=>vt(a),[a]),[c,o]=i.useState(ot(e,a)),l=i.useMemo(()=>ci(a),[a]),d=i.useMemo(()=>Hn(l),[l]),u=i.useRef(void 0);i.useEffect(()=>{const f=e!==u.current;u.current=e,f&&o(ot(e,a))},[e,a]);const m=f=>{o(f),t&&(It(f,r)?t(void 0,Ds(f,r)):f===""&&t(void 0))},h=i.useCallback(()=>{if(!n)return;const f=u.current;f instanceof Date&&It(ot(f,a),r)?n(void 0,f):typeof f=="string"&&It(f,r)?n(void 0,Ds(f,r)):(f===void 0||f==="")&&n(void 0),o(ot(e,a))},[n,e,a,r]);return{...Xt.useRifm({value:c,onChange:m,format:d}),onBlur:h,placeholder:vt(a).toLowerCase()}}function ui(e){e.stopPropagation()}const Zn=i.forwardRef(function(t,n){const{value:a,onChange:r,onBlur:c,onToggle:o,disabled:l,disableCalendar:d,calendarIcon:u,format:m,...h}=t,b=qn({value:a,onChange:r,onBlur:c,format:m});return s.jsx(Be,{ref:n,...b,type:"tel",endAdornment:!d&&s.jsx(Ve,{edge:"end",onClick:o,onMouseDown:ui,disabled:!!l,"data-testid":"date-time-picker-icon-button",children:u||s.jsx(W,{name:"event",fill:1,weight:500,size:24})}),disabled:!!l,...h})});function At({value:e,items:t,onChange:n}){const a=i.useRef(null),r=i.useRef(null);_e(()=>{if(a.current&&r.current){const l=(a.current.offsetHeight-r.current.offsetHeight)/2;a.current.scrollTop=r.current.offsetTop-l}});const c=i.useCallback(l=>()=>{n==null||n(l)},[n]),o=i.useCallback(l=>d=>{e===l&&(r.current=d)},[e]);return s.jsx("div",{className:"smwb-time-picker__overflow",ref:a,"data-testid":"time-picker-list",children:s.jsx("ul",{className:"smwb-time-picker__list",children:t.map(({label:l,value:d})=>{const u=e===d;return s.jsx("li",{ref:o(d),className:j("smwb-time-picker__item",{"smwb-time-picker__item--selected":u}),onClick:c(d),children:l},d)})})})}const Ue=/HH|mm|ss/g;function Jn(e){const t=[];let n;for(Ue.lastIndex=0;(n=Ue.exec(e))!==null;)t.push(n[0]);return t}function Es(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function di(e){let t="^",n=0,a;for(Ue.lastIndex=0;(a=Ue.exec(e))!==null;)t+=Es(e.slice(n,a.index)),t+="(\\d{2})",n=Ue.lastIndex;return t+=Es(e.slice(n)),t+="$",new RegExp(t)}function mi(e,t,n){return e>=0&&e<=23&&t>=0&&t<=59&&n>=0&&n<=59}function fi(e){return Jn(e).includes("ss")}function hi(e,t){const n=e.getHours(),a=e.getMinutes(),r=e.getSeconds();return t.replace(Ue,c=>c==="HH"?String(n).padStart(2,"0"):c==="mm"?String(a).padStart(2,"0"):String(r).padStart(2,"0"))}function Qn(e,t){const n=Jn(t);if(!n.includes("HH")||!n.includes("mm"))return;const a=di(t).exec(e);if(!a)return;let r,c,o=0;if(n.forEach((d,u)=>{const m=Number(a[u+1]);if(d==="HH"){r=m;return}if(d==="mm"){c=m;return}o=m}),r===void 0||c===void 0||!mi(r,c,o))return;const l=new Date;return new Date(l.getFullYear(),l.getMonth(),l.getDate(),r,c,o)}function bi(e,t){return Qn(e,t)!==void 0}const Is=/\d/gi,wi=/[a-zA-Z]/g,ft="HH:mm";function pi(){return Array.from({length:24},(e,t)=>({value:t,label:String(t).padStart(2,"0")}))}function _i(){return Array.from({length:60},(e,t)=>({value:t,label:String(t).padStart(2,"0")}))}function gi(){return Array.from({length:60},(e,t)=>({value:t,label:String(t).padStart(2,"0")}))}function $t(e,t,n,a){const r=new Date(e);return r.setHours(t,n,a,0),r}function gt(e,t){return ze(e)?hi(e,t!=null?t:ft):""}function us(e){return e!=null?e:ft}function xi(e){return us(e).replace(wi,"_")}function vi(e){return t=>{let n=0;return t.split("").map((a,r)=>{if(Is.lastIndex=0,n>e.length-1)return"";const c=e[n],o=e[n+1],l=Is.test(a)?a:"",d=c==="_"?l:c+l;return n+=d.length,r===t.length-1&&o&&o!=="_"?d?d+o:"":d}).join("")}}function Ft(e,t){return bi(e,t)}function As(e,t){const n=Qn(e,t);return n||new Date(Number.NaN)}function ze(e){return Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function yi(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),0)}function ji(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),0)}function ds({value:e,format:t,onChange:n,onComplete:a}){const r=i.useMemo(()=>ze(e)?e:new Date,[e]),c=t!=null?t:ft,o=fi(c),l=i.useMemo(()=>pi(),[]),d=i.useMemo(()=>_i(),[]),u=i.useMemo(()=>gi(),[]),m=i.useCallback(f=>{n($t(r,f,r.getMinutes(),r.getSeconds()))},[r,n]),h=i.useCallback(f=>{n($t(r,r.getHours(),f,r.getSeconds())),o||a==null||a()},[r,n,a,o]),b=i.useCallback(f=>{n($t(r,r.getHours(),r.getMinutes(),f)),a==null||a()},[r,n,a]);return s.jsxs("div",{className:"smwb-time-picker__columns","data-testid":"time-picker-columns",children:[s.jsx("div",{className:"smwb-time-picker__column",children:s.jsx(At,{value:r.getHours(),items:l,onChange:m})}),s.jsx("div",{className:"smwb-time-picker__column",children:s.jsx(At,{value:r.getMinutes(),items:d,onChange:h})}),o&&s.jsx("div",{className:"smwb-time-picker__column",children:s.jsx(At,{value:r.getSeconds(),items:u,onChange:b})})]})}const ki=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),Ni={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},Ri=i.forwardRef(function(t,n){const{value:a,onChange:r,showDaysOutsideMonth:c,disablePast:o,disableFuture:l,weekStartsOn:d=1,placement:u="bottom-start",disabled:m,disableCalendar:h,calendarAriaLabel:b="Choose date and time",minDate:f,maxDate:w,isDateDisabled:p,locale:_,format:v,timeFormat:g,calendarIcon:x,onBlur:T,...y}=t,C=i.useMemo(()=>a===void 0?void 0:new Date(a),[a]),[R,k]=i.useState(()=>Re(C)||ze(C)?C:new Date),[N,S]=i.useState(pe.days),[E,D]=i.useState(!1),I=i.useRef(null),z=i.useRef(null),$=Je(u),{refs:M,floatingStyles:F}=fe.useFloating({open:E,placement:$.placement,whileElementsMounted:fe.autoUpdate,middleware:jt($)}),A=ge(I,M.setReference,n),X=ge(z,M.setFloating);_e(()=>{m||k(Re(C)||ze(C)?C:new Date)},[C,m]);const ne=i.useCallback(Q=>{k(Q)},[]),G=i.useCallback(()=>{S(N===pe.months?pe.days:pe.months)},[N]),ce=i.useCallback(()=>{S(N===pe.years?pe.days:pe.years)},[N]),Z=i.useCallback(Q=>{k(ns(R,Q)),S(pe.days)},[R]),te=i.useCallback(Q=>{k(as(R,Q)),S(pe.days)},[R]),L=i.useCallback(Q=>{k(Q),r==null||r(void 0,Q,t)},[r,t]),B=i.useCallback((Q,me)=>{if(!me)return;const J=ze(C)?C:R;L(ji(me,J))},[L,C,R]),K=i.useCallback(Q=>{const me=Re(C)?C:R;L(yi(me,Q))},[L,C,R]),ee=i.useCallback(()=>{m||D(Q=>!Q)},[m]),U=i.useCallback(Q=>{var J,be;const me=Q.target;(J=z.current)!=null&&J.contains(me)||(be=I.current)!=null&&be.contains(me)||D(!1)},[]),se=i.useMemo(()=>g||(v!=null&&v.includes("HH:mm:ss")?"HH:mm:ss":ft),[v,g]),de=i.useMemo(()=>zn(_),[_]),ie=i.useMemo(()=>Vn(new Date().getFullYear(),100),[]);let xe=null;switch(N){case pe.days:xe=s.jsx(os,{viewValue:R,value:C,showDaysOutsideMonth:c,onChange:B,disablePast:o,disableFuture:l,weekStartsOn:d,minDate:f,maxDate:w,isDateDisabled:p,locale:_});break;case pe.months:xe=s.jsx(dt,{value:R.getMonth(),items:de,onChange:Z});break;case pe.years:xe=s.jsx(dt,{value:R.getFullYear(),items:ie,onChange:te});break}return s.jsxs(s.Fragment,{children:[s.jsx(Zn,{ref:A,value:C,onChange:r,onBlur:T,onToggle:ee,disabled:m,disableCalendar:h,format:v,calendarIcon:x,...y}),Ce.createPortal(s.jsx(yt,{nodeRef:z,in:E&&!m&&!h,timeout:150,mountOnEnter:!0,unmountOnExit:!0,children:Q=>s.jsx(Qe,{onClickAway:U,children:s.jsx("div",{ref:X,className:"smwb-date-picker smwb-date-time-picker",style:{...F,...ki(150),...Ni[Q]},"data-testid":"date-time-picker","data-smwb-overlay-layer":"",role:"dialog","aria-modal":"false","aria-label":b,children:s.jsxs("div",{className:"smwb-date-picker__inner smwb-date-time-picker__inner",children:[s.jsx(is,{viewValue:R,locale:_,openView:N,onChange:ne,onMonthLabelClick:G,onYearLabelClick:ce}),s.jsxs("div",{className:"smwb-date-time-picker__content",children:[s.jsx("div",{className:"smwb-date-picker__body smwb-date-time-picker__body",children:xe}),s.jsx(ds,{value:R,format:se,onChange:K})]})]})})})}),document.body)]})}),Ci=us();function ea({value:e,onChange:t,onBlur:n,format:a}){const r=i.useMemo(()=>us(a),[a]),[c,o]=i.useState(gt(e,a)),l=i.useMemo(()=>xi(a),[a]),d=i.useMemo(()=>vi(l),[l]),u=i.useRef(void 0);i.useEffect(()=>{const f=e!==u.current;u.current=e,f&&o(gt(e,a))},[e,a]);const m=f=>{o(f),t&&(Ft(f,r)?t(void 0,As(f,r)):f===""&&t(void 0))},h=i.useCallback(()=>{if(!n)return;const f=u.current;f instanceof Date&&Ft(gt(f,a),r)?n(void 0,f):typeof f=="string"&&Ft(f,r)?n(void 0,As(f,r)):(f===void 0||f==="")&&n(void 0),o(gt(e,a))},[n,e,a,r]);return{...Xt.useRifm({value:c,onChange:m,format:d}),onBlur:h,placeholder:(a!=null?a:Ci).toLowerCase()}}function Si(e){e.stopPropagation()}const ta=i.forwardRef(function(t,n){const{value:a,onChange:r,onBlur:c,onToggle:o,disabled:l,disableClock:d,clockIcon:u,format:m,...h}=t,b=ea({value:a,onChange:r,onBlur:c,format:m});return s.jsx(Be,{ref:n,...b,type:"tel",endAdornment:!d&&s.jsx(Ve,{edge:"end",onClick:o,onMouseDown:Si,disabled:!!l,"data-testid":"time-picker-icon-button",children:u||s.jsx(W,{name:"schedule",fill:1,weight:500,size:24})}),disabled:!!l,...h})}),Ti=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),Mi={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},Di=i.forwardRef(function(t,n){const{value:a,onChange:r,placement:c="bottom-start",disabled:o,disableClock:l,clockAriaLabel:d="Choose time",format:u,onBlur:m,...h}=t,b=i.useMemo(()=>a===void 0?void 0:new Date(a),[a]),[f,w]=i.useState(()=>ze(b)?b:new Date),[p,_]=i.useState(!1),v=i.useRef(null),g=i.useRef(null),x=Je(c),{refs:T,floatingStyles:y}=fe.useFloating({open:p,placement:x.placement,whileElementsMounted:fe.autoUpdate,middleware:jt(x)}),C=ge(v,T.setReference,n),R=ge(g,T.setFloating);_e(()=>{o||w(ze(b)?b:new Date)},[b,o]);const k=i.useCallback(()=>{o||_(D=>!D)},[o]),N=i.useCallback(D=>{var z,$;const I=D.target;(z=g.current)!=null&&z.contains(I)||($=v.current)!=null&&$.contains(I)||_(!1)},[]),S=i.useCallback(D=>{w(D),r==null||r(void 0,D,t)},[r,t]),E=i.useCallback(()=>{_(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ta,{ref:C,value:b,onChange:r,onBlur:m,onToggle:k,disabled:o,disableClock:l,format:u,...h}),Ce.createPortal(s.jsx(yt,{nodeRef:g,in:p&&!o&&!l,timeout:150,mountOnEnter:!0,unmountOnExit:!0,children:D=>s.jsx(Qe,{onClickAway:N,children:s.jsx("div",{ref:R,className:"smwb-date-picker smwb-time-picker",style:{...y,...Ti(150),...Mi[D]},"data-testid":"time-picker","data-smwb-overlay-layer":"",role:"dialog","aria-modal":"false","aria-label":d,children:s.jsx("div",{className:"smwb-date-picker__inner",children:s.jsx(ds,{value:f,format:u,onChange:S,onComplete:E})})})})}),document.body)]})}),Ei=i.forwardRef(function(t,n){const{label:a,disabled:r,readOnly:c,required:o,name:l,id:d,size:u="medium",color:m="primary",helperText:h,error:b,onChange:f,className:w,...p}=t,_=mt(d),v=g=>{if(c){g.preventDefault();return}f==null||f(g,t.value!==void 0?t.value:g.target.checked,t)};return s.jsx(Oe,{helperText:h,disabled:r,error:b,className:"smwb-text-field-checkbox",children:s.jsxs("label",{htmlFor:_,className:j("smwb-radio",`smwb-radio_size-${u}`,`smwb-radio_color-${m}`,{"smwb-disabled":r,"smwb-readonly":c}),children:[s.jsxs("span",{className:"smwb-radio__wrapper",children:[s.jsx("input",{id:_,name:l,disabled:r,readOnly:c,required:o,"aria-invalid":b||void 0,"aria-required":o||void 0,className:j("smwb-radio__input",w),type:"radio","data-testid":"radio",ref:n,...p,onChange:v}),s.jsx("span",{className:j("smwb-radio__btn",{"smwb-disabled":r})}),s.jsx("span",{className:j("smwb-radio__bg",{"smwb-disabled":r})})]}),a&&s.jsx("span",{className:"smwb-radio__label",children:a})]})})}),Ii=i.forwardRef(function({className:t,value:n,defaultValue:a=0,max:r=5,precision:c=1,readOnly:o=!1,disabled:l=!1,size:d=28,icon:u,emptyIcon:m,name:h,color:b="primary",error:f,helperText:w,id:p,onChange:_},v){const g=n!==void 0,[x,T]=i.useState(a),[y,C]=i.useState(null),R=n!==void 0?n:x,k=y!=null?y:R,N=!o&&!l,S=(M,F)=>{if(c===1)return F+1;const{left:A,width:X}=M.currentTarget.getBoundingClientRect(),ne=M.clientX-A<X/2;return F+(ne?.5:1)},E=(M,F)=>{if(!N)return;const A=S(M,F);g||T(A),_==null||_(A)},D=u!=null?u:s.jsx(W,{name:"star",fill:1,size:d}),I=m!=null?m:s.jsx(W,{name:"star",size:d}),z=M=>{const F=Math.max(0,Math.min(r,M));g||T(F),_==null||_(F)},$=M=>{N&&(M.key==="ArrowRight"||M.key==="ArrowUp"?(M.preventDefault(),z(R+c)):M.key==="ArrowLeft"||M.key==="ArrowDown"?(M.preventDefault(),z(R-c)):M.key==="Home"?(M.preventDefault(),z(0)):M.key==="End"&&(M.preventDefault(),z(r)))};return s.jsxs("span",{ref:v,id:p,className:j("smwb-rating",{"smwb-rating_readonly":o,"smwb-rating_disabled":l,"smwb-rating_error":f},b!=="primary"&&`smwb-rating_color-${b}`,t),"data-testid":"rating",role:"img","aria-label":`${R} of ${r}`,tabIndex:N?0:void 0,onKeyDown:N?$:void 0,children:[Array.from({length:r},(M,F)=>{const A=Math.max(0,Math.min(1,k-F));return s.jsxs("span",{className:"smwb-rating__item",style:{width:d,height:d,cursor:N?"pointer":"default"},onClick:X=>E(X,F),onMouseMove:N&&c===.5?X=>C(S(X,F)):N?()=>C(F+1):void 0,onMouseLeave:N?()=>C(null):void 0,children:[s.jsx("span",{className:"smwb-rating__icon smwb-rating__icon_empty",children:I}),s.jsx("span",{className:"smwb-rating__icon smwb-rating__icon_filled",style:{width:`${A*100}%`},children:D})]},F)}),h?s.jsx("input",{type:"hidden",name:h,value:R,readOnly:!0}):null,w!=null&&w!==!1?s.jsx("span",{className:j("smwb-rating__helper",f&&"smwb-rating__helper_error"),children:w}):null]})});function Ai({menuMaxHeight:e,menuMiddleware:t,search:n,onSearchInputChange:a,items:r,searchValue:c,isOpen:o,onClose:l,anchorElementRef:d,value:u,onItemClick:m,isLoading:h,optionRenderer:b,menuNoItemsMessage:f,container:w=document.body,createOption:p,virtualized:_,itemHeight:v=40}){const g=Array.isArray(u)?u:[u],x=r.some($=>!!$.group);let T;const y=!!_&&!x&&!h&&r.length>0,C=e||240,{startIndex:R,endIndex:k,totalHeight:N,offsetY:S,onScroll:E}=Wt({itemCount:y?r.length:0,itemHeight:v,viewportHeight:C}),D=$=>{var F;const M=[];return x&&$.group!==T&&(T=$.group,M.push(s.jsx("li",{className:"smwb-select-field__group-label",role:"presentation",children:$.group},`group-${(F=$.group)!=null?F:"ungrouped"}`))),M.push(s.jsxs(Ze,{value:$.value,disabled:$.disabled,selected:!!g.find(A=>A===$.value),onClick:A=>{$.disabled||m(A,$)},optionRenderer:b,children:[$.text,$.helperText?s.jsx("span",{className:"smwb-select-field__option__helper-text",children:$.helperText}):null]},$.key||$.value)),M},[I,z]=i.useState();return i.useEffect(()=>{o&&d.current&&z(d.current.clientWidth)},[d,o]),i.useEffect(()=>{const $=M=>{o&&M.key==="Escape"&&l()};return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$)}},[o,l]),Ce.createPortal(s.jsxs(Nt,{isOpen:o,onClose:l,anchorElement:d.current,middleware:t,"data-smwb-overlay-layer":"",style:{minWidth:I,maxHeight:e||void 0,overflowY:e?"auto":void 0},children:[n&&s.jsxs(s.Fragment,{children:[s.jsx("li",{className:"smwb-select-field__menu-search",children:s.jsx(Be,{className:"smwb-select-field__menu-search-input",type:"text",placeholder:"Найти...",value:c,onChange:($,M)=>a==null?void 0:a($,M.value),fullWidth:!0})}),s.jsx(Yn,{})]}),h?s.jsx("div",{className:"smwb-select-field__menu-loading",children:s.jsx(En,{type:"indeterminate",variant:"circular",className:"smwb-select-field__menu__loader"})}):y?s.jsx("li",{role:"presentation",className:"smwb-select-field__virtual-viewport",children:s.jsx("div",{className:"smwb-select-field__virtual-scroller",style:{maxHeight:C,overflowY:"auto"},onScroll:E,children:s.jsx("div",{style:{height:N,position:"relative"},children:s.jsx("ul",{role:"presentation",className:"smwb-select-field__virtual-list",style:{transform:`translateY(${S}px)`,listStyle:"none",margin:0,padding:0},children:r.slice(R,k).map($=>D($))})})})}):r.length?r.map($=>D($)):p?null:s.jsx("li",{className:"smwb-select-field__empty-items",children:f||"Опций не найдено."}),p?s.jsx(Ze,{value:"__create__",onClick:$=>p.onCreate($),className:"smwb-select-field__create-option",children:p.text},"__create__"):null]}),w)}const $i=e=>s.jsx(W,{name:"arrow_drop_down",...e}),Fi=e=>s.jsx(W,{name:"close",size:20,...e});function $s(e){e.preventDefault(),e.stopPropagation()}const Li=i.forwardRef(function(t,n){const{className:a,value:r,defaultValue:c,onChange:o,disabled:l,readOnly:d,name:u,multiple:m,menuMaxHeight:h,menuMiddleware:b,menuNoItemsMessage:f,menuContainer:w,search:p,chips:_,isFocused:v,error:g,items:x,label:T,variant:y="outlined",fullWidth:C,helperText:R,onSearch:k,resetSearch:N,isLoading:S,inline:E,endAdornment:D,hideSelectArrowIcon:I,optionRenderer:z,clearable:$,creatable:M,onCreate:F,virtualized:A,itemHeight:X,"aria-label":ne,id:G,...ce}=t,[Z,te]=i.useState(!1),[L,B]=i.useState(c),[K,ee]=i.useState(()=>{const Y=r!=null?r:c;if(Array.isArray(Y))return x.filter(je=>Y.includes(je.value));const ue=Y==null?void 0:x.find(je=>je.value===Y);return ue?[ue]:[]}),[U,se]=i.useState(""),{current:de}=i.useRef(r!=null),ie=i.useRef(null),xe=ge(n,ie),Q=i.useRef(null),me=i.useRef(null),J=de?r:L,be=i.useMemo(()=>v||Z,[v,Z]),O=Y=>{var ue;Y.button===0&&(Y.preventDefault(),(ue=ie.current)==null||ue.focus(),te(!Z))},V=()=>{var Y;te(!1),(Y=ie.current)==null||Y.focus()},oe=()=>{var Y;p===!0&&((Y=me.current)==null||Y.focus())},ae=Y=>{d||[" ","ArrowUp","ArrowDown","Enter"].includes(Y.key)&&(Y.preventDefault(),te(!Z))};i.useEffect(()=>{(!be||p==="menu"&&!Z)&&(se(""),N==null||N())},[be,p,Z,N]),i.useEffect(()=>{if(Array.isArray(J))ee(x.filter(Y=>J.includes(Y.value)));else if(J==null||J==="")ee([]);else{const Y=x.find(ue=>ue.value===J);ee(Y?[Y]:[])}},[J,x]),_e(()=>{Q.current&&(Q.current.scrollLeft=Q.current.scrollWidth)},[J]);const P=(Y,ue)=>{o==null||o(Y,{...t,value:ue,name:u||void 0}),B(ue)},re=(Y,ue)=>{var Le;let je,Ie;if(m){const ht=Array.isArray(J)?J:[J].filter(Boolean);je=ht.slice(),Ie=K.slice();const tt=ht.findIndex(Rt=>Rt===ue.value);tt===-1?(je.push(ue.value),Ie.push(ue)):(je.splice(tt,1),Ie.splice(tt,1))}else je=J===ue.value?"":ue.value,Ie=[ue];U&&se(""),m||(te(!1),(Le=ie.current)==null||Le.focus()),ee(Ie),P(Y,je)},le=Y=>{se(Y.target.value),k==null||k(Y),Z||te(!0)},ke=Y=>ue=>{if(Array.isArray(J)){const je=J.filter(Le=>Y!==Le);P(ue,je);const Ie=K.filter(Le=>Le.value!==Y);ee(Ie)}},Ne=Y=>{P(Y,[]),ee([])};let Se;const Te=j("smwb-select-field",a,{"smwb-select-field--filled":y==="filled"&&T,"smwb-select-field--disabled":l,"smwb-select-field--search":p,"smwb-select-field--inline":E});return _?Se=K.map(({key:Y,value:ue,text:je})=>s.jsx(es,{label:je,onDelete:ke(ue),onDeleteMouseDown:$s},Y||ue)):Se=K.map(Y=>Y.text).join(", "),s.jsxs(s.Fragment,{children:[s.jsx(Oe,{label:T,helperText:R,variant:y,disabled:l,className:a,error:g,fullWidth:C,isFilledState:!!K.length||!!U,isFocused:be,inline:E,...ce,children:s.jsxs("span",{ref:xe,id:G,className:Te,tabIndex:l?void 0:0,role:"button","aria-haspopup":"listbox","aria-expanded":Z,"aria-disabled":l||void 0,"aria-label":ne,onMouseDown:l||d?void 0:O,onFocus:oe,onKeyDown:ae,"data-testid":"select-field",children:[s.jsxs("span",{className:"smwb-select-field__search-wrapper",ref:Q,children:[Se&&s.jsx("span",{className:"smwb-select-field__values",children:Se}),p&&typeof p=="boolean"&&!d&&s.jsxs("span",{className:"smwb-select-field__search",children:[s.jsx("span",{className:"smwb-select-field__search-text",children:U}),s.jsx("input",{className:"smwb-select-field__search-input",ref:me,type:"text",value:U,onChange:le,onMouseDown:Y=>{Y.stopPropagation(),te(!0)},onKeyDown:Y=>{Y.stopPropagation()},"data-testid":"search-input"})]})]}),s.jsxs("span",{className:"smwb-select-field__actions",children:[(Array.isArray(J)&&J.length>0||$&&K.length>0)&&!l&&s.jsx(Fi,{onClick:Ne,onMouseDown:$s,className:j("smwb-select-field__icon","smwb-select-field__icon--close"),"aria-label":"Clear selection",role:"button"}),D,!I&&s.jsx($i,{className:j("smwb-select-field__icon","smwb-select-field__icon--arrow",{"smwb-select-field__icon--opened":Z,"smwb-select-field__icon--focused":be,"smwb-select-field__icon--error":g})})]})]})}),s.jsx(Ai,{anchorElementRef:ie,menuMaxHeight:h,menuMiddleware:b,search:p==="menu",onSearchInputChange:le,optionRenderer:z,items:k?x:U?x.filter(Y=>Y.text.search(new RegExp(U,"i"))!==-1):x,searchValue:U,isOpen:Z,onClose:V,onItemClick:re,value:J,isLoading:S,menuNoItemsMessage:f,container:w,virtualized:A,itemHeight:X,createOption:M&&U&&!x.some(Y=>Y.text.toLowerCase()===String(U).toLowerCase())?{text:`Создать "${U}"`,onCreate:Y=>{F==null||F(String(U),Y),se(""),te(!1)}}:void 0})]})});function ut(e,t,n){return(e-t)/(n-t)*100}function Oi(e){return(`${e}`.split(".")[1]||"").length}function Fs(e,t,n){return Math.max(t,Math.min(e,n))}function Ls(e,t=1){const n=Math.pow(10,t);return Math.round(e*n)/n}function Bi(e,t,n,a){if(a==null||a<=0)return Fs(e,t,n);const r=Oi(a),c=Ls(Math.round((e-t)/a)*a,r),o=Ls(Math.floor((n-t)/a)*a,r);return t+Fs(c,0,o)}function Kt(e,t,n,a={}){const r=(e-t[0])/(t[1]-t[0])*(n[1]-n[0])+n[0];return Bi(r,n[0],n[1],a.step)}function sa(e){return e instanceof MouseEvent?e.clientX:e instanceof TouchEvent?e.changedTouches[0].clientX:0}function na(e){return e instanceof MouseEvent?e.clientY:e instanceof TouchEvent?e.changedTouches[0].clientY:0}function aa(e,t,n,a){if(!e)return[];if(Array.isArray(e))return e;const r=a&&a>0?a:(n-t)/10,c=[];for(let o=t;o<=n+1e-9;o+=r)c.push({value:Math.round(o*1e6)/1e6});return c}const Pi=i.forwardRef(function(t,n){const{defaultValue:a,value:r,onChange:c,min:o=0,max:l=100,name:d,disabled:u=!1,className:m,step:h,label:b,helperText:f,error:w,size:p="medium",color:_="primary",orientation:v="horizontal",marks:g,getAriaValueText:x,"aria-label":T,range:y,variant:C,valueField:R,withTicks:k,...N}=t,S=v==="vertical",E=O=>{var P,re,le,ke;const V=Array.isArray(O)?O:[o,l],oe=Math.min((P=V[0])!=null?P:o,(re=V[1])!=null?re:l),ae=Math.max((le=V[0])!=null?le:o,(ke=V[1])!=null?ke:l);return[oe,ae]},D=r!==void 0,[I,z]=i.useState(()=>E(a)),$=D?E(r):I,M=i.useRef(null),F=ge(n,M),A=i.useRef(0),X=i.useRef(!1),ne=aa(g,o,l,h),G=O=>{var ae;const V=(ae=M.current)==null?void 0:ae.getBoundingClientRect();if(!V)return o;if(S){const P=(typeof O.clientY=="number"?O.clientY:na(O))-V.top;return Kt(V.height-P,[0,V.height],[o,l],{step:h})}const oe=(typeof O.clientX=="number"?O.clientX:sa(O))-V.left;return Kt(oe,[0,V.width],[o,l],{step:h})},ce=(O,V)=>{const oe=Math.min(O[0],O[1]),ae=Math.max(O[0],O[1]),P=[Math.max(o,oe),Math.min(l,ae)];D||z(P),c==null||c(V,P,t)},Z=(O,V)=>{const oe=A.current,ae=[$[0],$[1]];ae[oe]=Math.max(o,Math.min(l,O)),ce(ae,V)},te=O=>{A.current=Math.abs(O-$[0])<=Math.abs(O-$[1])?0:1},L=De(O=>{X.current&&(O.preventDefault(),Z(G(O),O))}),B=De(()=>{X.current=!1,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",B),document.removeEventListener("touchmove",L),document.removeEventListener("touchend",B)}),K=O=>{if(u||O.button!==0)return;const V=G(O);te(V),X.current=!0,Z(V,O),document.addEventListener("mousemove",L),document.addEventListener("mouseup",B)},ee=O=>{if(u)return;const V=G(O);te(V),X.current=!0,Z(V,O),document.addEventListener("touchmove",L),document.addEventListener("touchend",B)};_e(()=>{const O=M.current;if(O)return O.addEventListener("touchstart",ee),()=>O.removeEventListener("touchstart",ee)});const U=O=>V=>{if(u)return;const oe=h&&h>0?h:1;let ae=null;V.key==="ArrowLeft"||V.key==="ArrowDown"?ae=$[O]-oe:V.key==="ArrowRight"||V.key==="ArrowUp"?ae=$[O]+oe:V.key==="Home"?ae=o:V.key==="End"&&(ae=l),ae!==null&&(V.preventDefault(),A.current=O,Z(ae,V))},se=j("smwb-slider","smwb-slider--range",m,{"smwb-slider--disabled":u,"smwb-slider--vertical":S},p!=="medium"&&`smwb-slider_size-${p}`,_!=="primary"&&`smwb-slider_color-${_}`),de=ut($[0],o,l),ie=ut($[1],o,l),xe=`${Math.min(de,ie)}%`,Q=`${Math.abs(ie-de)}%`,me=S?{bottom:`${de}%`}:{left:`${de}%`},J=S?{bottom:`${ie}%`}:{left:`${ie}%`},be=S?{bottom:xe,height:Q}:{left:xe,width:Q};return s.jsx(Oe,{label:b,helperText:f,disabled:u,error:w,fullWidth:!0,shrink:!0,children:s.jsx("div",{className:"smwb-slider__container",children:s.jsxs("span",{ref:F,onMouseDown:K,className:se,...N,children:[ne.length>0&&s.jsx("span",{className:"smwb-slider__marks","aria-hidden":"true",children:ne.map(O=>{const V=`${ut(O.value,o,l)}%`;return s.jsx("span",{className:"smwb-slider__mark",style:S?{bottom:V}:{left:V},children:O.label!=null&&s.jsx("span",{className:"smwb-slider__mark-label",children:O.label})},O.value)})}),s.jsx("span",{className:"smwb-slider__rail"}),s.jsx("span",{className:"smwb-slider__track",style:be}),[0,1].map(O=>s.jsx("span",{className:j("smwb-slider__thumb",`smwb-slider__thumb--${O===0?"start":"end"}`),style:O===0?me:J,children:s.jsx("input",{"data-testid":`slider-input-${O}`,className:"smwb-slider__input",type:"range",min:o,max:l,step:h,name:d?`${d}[${O}]`:void 0,value:$[O],disabled:u,onChange:()=>{},onKeyDown:U(O),tabIndex:u?-1:0,"aria-label":T?`${T} ${O===0?"minimum":"maximum"}`:void 0,"aria-orientation":v,"aria-valuenow":$[O],"aria-valuemin":O===0?o:$[0],"aria-valuemax":O===0?$[1]:l,"aria-valuetext":x?x($[O]):void 0,"aria-disabled":u||void 0})},O))]})})})}),zi=i.forwardRef(function(t,n){const{defaultValue:a,value:r,onChange:c,min:o=0,max:l=100,name:d,disabled:u=!1,className:m,step:h,variant:b="continuous",valueField:f,withTicks:w,label:p,helperText:_,error:v,size:g="medium",color:x="primary",orientation:T="horizontal",marks:y,range:C,getAriaValueText:R,"aria-label":k,...N}=t,S=typeof a=="number"?a:void 0,E=typeof r=="number"?r:void 0,D=T==="vertical",[I,z]=i.useState(S!=null?S:o),[$,M]=i.useState(!1),[F,A]=i.useState(!1),[X,ne]=i.useState(!1),G=i.useRef(null),ce=ge(n,G),Z=i.useRef(!1),te=E!==void 0,L=b==="discrete",B=te?E:I,K=(P,re)=>{P<o||P>l||(te||z(P),c==null||c(re,P,t))},ee=(P,re)=>Kt(P,[0,re],[o,l],{step:h}),U=P=>{if(u||P.button!==0)return;Z.current=!0;const re=G.current,le=re==null?void 0:re.getBoundingClientRect();if(le){const ke=D?le.height-(P.clientY-le.top):P.clientX-le.left,Ne=ee(ke,D?le.height:le.width);F||A(!0),K(Ne,P)}document.addEventListener("mousemove",de),document.addEventListener("mouseup",ie)},se=P=>{var ke;if(u)return;Z.current=!0;const re=G.current,le=re==null?void 0:re.getBoundingClientRect();if(le){const Ne=(ke=P.changedTouches)==null?void 0:ke[0],Se=D?le.height-(Ne.clientY-le.top):Ne.clientX-le.left,Te=ee(Se,D?le.height:le.width);F||A(!0),K(Te,P)}document.addEventListener("touchmove",de),document.addEventListener("touchend",ie)},de=De(P=>{if(Z.current){const re=G.current,le=re==null?void 0:re.getBoundingClientRect();if(le){const ke=sa(P),Ne=na(P),Se=D?le.height-(Ne-le.top):ke-le.left,Te=ee(Se,D?le.height:le.width);if(F||A(!0),B===Te)return;$||M(!0),K(Te,P)}}}),ie=De(()=>{Z.current=!1,$&&M(!1),F&&A(!1),xe()}),xe=()=>{document.removeEventListener("mousemove",de),document.removeEventListener("mouseup",ie),document.removeEventListener("touchmove",de),document.removeEventListener("touchend",ie)},Q=P=>{!X||u||((P.key==="ArrowLeft"||P.key==="ArrowDown")&&K(B-(h||1),P),(P.key==="ArrowRight"||P.key==="ArrowUp")&&K(B+(h||1),P))},me=()=>{ne(!1),document.removeEventListener("keydown",Q)};_e(()=>{if(G.current)return G.current.addEventListener("touchstart",se),()=>{var P;(P=G.current)==null||P.removeEventListener("touchstart",se)}}),_e(()=>{var P,re;u&&((P=G.current)!=null&&P.contains(document.activeElement))&&((re=document.activeElement)==null||re.blur())},[u]);const J=j("smwb-slider",m,{"smwb-slider--disabled":u,"smwb-slider--dragging":$,"smwb-slider--discrete":L,"smwb-slider--vertical":D},g!=="medium"&&`smwb-slider_size-${g}`,x!=="primary"&&`smwb-slider_color-${x}`),be=`${ut(B,o,l)}%`,O=D?{height:be}:{width:be},V=D?{bottom:be}:{left:be},oe=()=>Array(Math.round(l/(h||1))+1).fill(1),ae=aa(y,o,l,h);return s.jsx(Oe,{label:p,helperText:_,disabled:u,error:v,fullWidth:!0,shrink:!0,children:s.jsxs("div",{className:"smwb-slider__container",children:[s.jsxs("span",{onKeyDown:Q,ref:ce,onMouseDown:U,className:J,tabIndex:u?-1:0,onFocus:()=>ne(!0),onBlur:me,...N,children:[w&&s.jsx("span",{className:"smwb-slider__ticks",style:{gap:`${h}`},children:oe().map((P,re)=>s.jsx("span",{className:"smwb-slider__tick"},re))}),ae.length>0&&s.jsx("span",{className:"smwb-slider__marks","aria-hidden":"true",children:ae.map(P=>{const re=`${ut(P.value,o,l)}%`;return s.jsx("span",{className:"smwb-slider__mark",style:D?{bottom:re}:{left:re},children:P.label!=null&&s.jsx("span",{className:"smwb-slider__mark-label",children:P.label})},P.value)})}),s.jsx("span",{className:"smwb-slider__rail"}),s.jsx("span",{className:"smwb-slider__track",style:O}),s.jsxs("span",{className:j("smwb-slider__thumb",{"smwb-slider__thumb--active":F,"smwb-slider__thumb--discrete":L}),style:V,children:[L&&s.jsx("span",{className:"smwb-slider__thumb-tooltip",children:Math.round(B)}),s.jsx("input",{"data-testid":"slider-input",className:"smwb-slider__input",type:"range",min:o,max:l,name:d,value:B,readOnly:!0,"aria-label":k,"aria-orientation":T,"aria-valuenow":B,"aria-valuemin":o,"aria-valuemax":l,"aria-valuetext":R?R(B):void 0,"aria-disabled":u||void 0})]})]}),f&&L&&s.jsx(Be,{type:"number",value:B,onChange:P=>K(+P.target.value,P),variant:"filled",helperText:null})]})})}),ra=i.forwardRef(function(t,n){return t.range===!0||Array.isArray(t.value)||Array.isArray(t.defaultValue)?s.jsx(Pi,{ref:n,...t}):s.jsx(zi,{ref:n,...t})});function Vi(e,t){return typeof e=="function"?e(t):Array.isArray(t)?`${t[0]} – ${t[1]}`:t==null?"":String(t)}function Hi({readout:e,endAdornment:t,onReset:n,resetLabel:a,label:r,className:c,...o}){const l=e!==void 0&&e!==!1,d=r!=null||l||t!=null||n!=null;return s.jsxs("div",{className:j("smwb-value-slider",c),children:[d?s.jsxs("div",{className:"smwb-value-slider__header",children:[r!=null?s.jsx("span",{className:"smwb-value-slider__label",children:r}):null,s.jsx("span",{className:"smwb-value-slider__spacer"}),l?s.jsx("span",{className:"smwb-value-slider__readout",children:Vi(e,o.value)}):null,t,n!=null?s.jsx("button",{type:"button",className:"smwb-value-slider__reset","aria-label":a!=null?a:"Reset",disabled:!!o.disabled,onClick:()=>n(),children:s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7M3 4v4h4",strokeLinecap:"round",strokeLinejoin:"round"})})}):null]}):null,s.jsx(ra,{...o})]})}const Yi=i.forwardRef(function(t,n){const{disabled:a,readOnly:r,required:c,checked:o,className:l,id:d,label:u,labelPlacement:m,size:h="medium",color:b="primary",helperText:f,error:w,...p}=t,_=mt(d),v=g=>{var x;if(r){g.preventDefault();return}(x=t.onChange)==null||x.call(t,g,g.target.checked,t)};return s.jsx(Oe,{helperText:f,disabled:a,error:w,className:"smwb-text-field-checkbox",children:s.jsxs("span",{className:j("smwb-toggle__wrapper",m&&`smwb-toggle__wrapper_label-${m}`),children:[u?s.jsx("label",{htmlFor:_,className:"smwb-toggle__label",children:u}):null,s.jsxs("label",{className:j("smwb-toggle",`smwb-toggle_size-${h}`,`smwb-toggle_color-${b}`,l,{"smwb-disabled":a,"smwb-readonly":r}),children:[s.jsx("input",{type:"checkbox",id:_,className:"smwb-toggle__checkbox","aria-checked":o,"aria-invalid":w||void 0,"aria-required":c||void 0,role:"switch",checked:o,disabled:a,readOnly:r,required:c,ref:n,...p,onChange:v}),s.jsx("span",{className:"smwb-toggle__track"}),s.jsx("span",{className:"smwb-toggle__thumb"})]})]})})}),Ki=i.forwardRef(function({className:t,...n},a){return s.jsx("div",{ref:a,"data-testid":"grid",className:j("smwb-grid",t),...n})}),Xi=["wrap","nowrap","wrap-reverse"],Wi=["flex-start","center","flex-end","space-between","space-around","space-evenly"],Ui=["flex-start","center","flex-end","stretch","baseline"],Gi=["row","row-reverse","column","column-reverse"],qi=i.forwardRef(function({className:t,justifyContent:n,alignItems:a,direction:r,wrap:c,spacing:o,...l},d){const u=n&&Wi.includes(n)&&n!=="flex-start",m=a&&Ui.includes(a)&&a!=="flex-start",h=r&&Gi.includes(r)&&r!=="row",b=c&&Xi.includes(c)&&c!=="wrap",f=j("smwb-grid__row",t,{[`smwb-grid__row--spacing-${o}`]:o,[`smwb-grid__row--justifyContent-${n}`]:u,[`smwb-grid__row--alignItems-${a}`]:m,[`smwb-grid__row--direction-${r}`]:h,[`smwb-grid__row--${c}`]:b});return s.jsx("div",{ref:d,"data-testid":"grid-row",className:f,...l})}),Zi=e=>e===void 0?{}:typeof e=="boolean"?{"smwb-grid__column--hidden":e}:Object.keys(e).reduce((t,n)=>(t[`smwb-grid__column--hidden-${n}`]=e[n]===!0,t[`smwb-grid__column--visible-${n}`]=e[n]===!1,t),{}),Ji=i.forwardRef(function({className:t,xs:n,sm:a,md:r,lg:c,xl:o,xsOffset:l,smOffset:d,mdOffset:u,lgOffset:m,xlOffset:h,hidden:b,...f},w){const p=j("smwb-grid__column",t,{[`smwb-grid__column--xs-${n}`]:n,[`smwb-grid__column--sm-${a}`]:a,[`smwb-grid__column--md-${r}`]:r,[`smwb-grid__column--lg-${c}`]:c,[`smwb-grid__column--xl-${o}`]:o,[`smwb-grid__column--xs-offset-${l}`]:l,[`smwb-grid__column--sm-offset-${d}`]:d,[`smwb-grid__column--md-offset-${u}`]:u,[`smwb-grid__column--lg-offset-${m}`]:m,[`smwb-grid__column--xl-offset-${h}`]:h,...Zi(b)});return s.jsx("div",{ref:w,className:p,"data-testid":"grid-col",...f})}),Qi=i.forwardRef(function({className:t,maxWidth:n="lg",disableGutters:a=!1,...r},c){const o=j("smwb-container",{[`smwb-container--${n}`]:n!==!1,"smwb-container--gutterless":a},t);return s.jsx("div",{ref:c,"data-testid":"grid-container",className:o,...r})}),eo={default:void 0,primary:"var(--smui-primaryColor)",secondary:"var(--smui-secondaryColor)",error:"var(--smui-errorColor)",success:"var(--smui-successColor)",warning:"var(--smui-warningColor)",info:"var(--smui-infoColor)"},to=i.forwardRef(function({className:t,orientation:n="horizontal",variant:a="fullWidth",textAlign:r="center",color:c="default",thickness:o,flexItem:l,style:d,children:u,...m},h){const b=u!=null&&u!==!1,f=eo[c],w=typeof o=="number"?`${o}px`:o,p={...d,...f?{borderColor:f}:{},...w?n==="vertical"?{borderLeftWidth:w}:{borderBottomWidth:w}:{}},_=j("smwb-divider",`smwb-divider_${n}`,`smwb-divider_${a}`,{"smwb-divider_with-text":b&&n==="horizontal",[`smwb-divider_align-${r}`]:b&&n==="horizontal","smwb-divider_flex-item":l},t);return s.jsx("div",{...m,ref:h,"data-testid":"divider",role:"separator","aria-orientation":n,className:_,style:p,children:b&&n==="horizontal"?s.jsx("span",{className:"smwb-divider__text",children:u}):null})});function so(e,t){let n=0,a,r;const c=(l,d)=>{n=l,e(...d)},o=(...l)=>{const d=Date.now(),u=t-(d-n);r=l,u<=0||u>t?(a!==void 0&&(clearTimeout(a),a=void 0),c(d,l)):a===void 0&&(a=setTimeout(()=>{a=void 0,r!==void 0&&c(Date.now(),r)},u))};return o.cancel=()=>{a!==void 0&&(clearTimeout(a),a=void 0),n=0,r=void 0},o}const Os=(e,t)=>!e&&t?100-t:e||50,no=i.forwardRef(function({className:t,orientation:n="horizontal",sizeFirst:a,sizeSecond:r,children:c,onSizeChange:o,keyboardStep:l=5,resizerAriaLabel:d="Resize panels"},u){const m=i.useRef(null),h=ge(u,m),[b,f]=i.useState(Os(a,r)),[w,p]=i.useState(null),[_,v]=i.useState(!1);i.useEffect(()=>{f(Os(a,r))},[a,r]);const g=i.Children.toArray(c);if(g.length>2)throw new Error("Allowed not more than 2 children");const x=()=>{p(m.current),v(!0)},T=i.useMemo(()=>so(N=>{if(!_)return;const S=m.current;if(!S||S!==w)return;const E=S.getBoundingClientRect(),D=n==="vertical"?E.height:E.width,I=n==="vertical"?N.clientY-E.top:N.clientX-E.left,z=Math.max(5,Math.min(D-5,I));f(z/D*100)},1e3/60),[_,w,n]),y=i.useCallback(()=>{p(null),v(!1),document.body.removeEventListener("pointerup",y),document.body.removeEventListener("pointermove",T)},[T]);i.useEffect(()=>{o==null||o(b)},[b,o]);const C=N=>{const S=n==="vertical"?"ArrowUp":"ArrowLeft",E=n==="vertical"?"ArrowDown":"ArrowRight";N.key===S?(N.preventDefault(),f(D=>Math.max(0,D-l))):N.key===E?(N.preventDefault(),f(D=>Math.min(100,D+l))):N.key==="Home"?(N.preventDefault(),f(0)):N.key==="End"&&(N.preventDefault(),f(100))},R=n==="vertical"?{height:`${100-b}%`}:{width:`${100-b}%`},k=n==="vertical"?{height:`${b}%`}:{width:`${b}%`};return i.useEffect(()=>(_?(document.body.addEventListener("pointerup",y),document.body.addEventListener("pointermove",T),document.body.style.cursor=n==="horizontal"?"e-resize":"n-resize"):document.body.style.cursor="default",()=>{document.body.removeEventListener("pointerup",y),document.body.removeEventListener("pointermove",T)}),[T,y,_,n]),s.jsxs("div",{className:j("smwb-screen-divider__wrapper",`smwb-${n}`,t),ref:h,"data-testid":"screen-divider",children:[s.jsx("div",{className:j("smwb-screen-divider__first",`smwb-${n}`),style:k,children:g[0]||""}),s.jsx("span",{className:"smwb-screen-divider__resizer",onPointerDown:x,draggable:!1,role:"separator","aria-orientation":n==="vertical"?"horizontal":"vertical","aria-valuenow":Math.round(b),"aria-valuemin":0,"aria-valuemax":100,"aria-label":d,tabIndex:0,onKeyDown:C}),s.jsx("div",{className:j("smwb-screen-divider__second",`smwb-${n}`),style:R,children:g[1]||""})]})}),ao=i.forwardRef(function({isOpen:t,onClose:n,variant:a="default",children:r,placement:c="bottom",disableOutsideClick:o,closeOnEsc:l=!0,...d},u){const[m,h]=i.useState(null),b=i.useRef(null);i.useEffect(()=>{if(!t||!l||!n)return;const p=_=>{_.key==="Escape"&&Nn(b.current)&&n()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,l,n]);const f=()=>{h(m==="expanded"?"small":m?null:"expanded")},w=()=>{n==null||n(),h(null)};return Ce.createPortal(s.jsx(He.CSSTransition,{in:t,timeout:70,mountOnEnter:!0,unmountOnExit:!0,classNames:{enterDone:"smwb-entered"},appear:!0,nodeRef:b,children:a==="default"?s.jsx("div",{className:j(o?"smwb-sheet__overlay":"smwb-sheet__default"),ref:b,"data-smwb-overlay-layer":"",children:s.jsx(Bs,{ref:u,onClose:n,handleSizeButton:f,handleClose:w,isOpen:t,mode:m,placement:c,variant:a,...d,children:r})}):s.jsx("div",{className:j("smwb-sheet__overlay","smwb-dark",`smwb-${c}`,`smwb-sheet_${a}`),ref:b,"data-smwb-overlay-layer":"",children:s.jsx(Qe,{onClickAway:()=>!o&&w(),children:s.jsx(Bs,{ref:u,onClose:n,handleSizeButton:f,handleClose:w,isOpen:t,mode:m,placement:c,variant:a,...d,children:r})})})}),document.body)}),ro=e=>e==="bottom"||e==="top",Bs=i.forwardRef(function(t,n){const{isOpen:a,placement:r,className:c,mode:o,size:l="60%",variant:d,onClose:u,withSizeToggle:m=!0,hideHeaderActions:h=!1,reverseHeaderActions:b=!1,resizable:f=!1,minSize:w=80,maxSize:p,resizeStep:_=24,resizeHandleAriaLabel:v="Resize sheet",onResize:g,style:x,handleClose:T,handleSizeButton:y,children:C,...R}=t,k=!h&&(!!u||m),N=[];m&&N.push(s.jsx(Me,{variant:"outlined",size:"small",onClick:y,children:s.jsx(W,{name:"open_in_full"})},"size")),u&&N.push(s.jsx(Me,{variant:"outlined",size:"small",onClick:T,children:s.jsx(W,{name:"close"})},"close")),b&&N.reverse();const S=i.useRef(null),E=i.useRef(null),D=ge(n,S,E),[I,z]=i.useState(null),$=ro(r),M=i.useCallback(L=>{const B=$?window.innerHeight:window.innerWidth,K=p!=null?p:B;return Math.max(w,Math.min(K,L))},[$,p,w]),F=i.useCallback(()=>{var B;const L=(B=E.current)==null?void 0:B.getBoundingClientRect();return L?$?L.height:L.width:w},[$,w]),A=i.useCallback(L=>{const B=M(L);z(B),g==null||g(B)},[M,g]),X=i.useRef(null),ne=i.useCallback(L=>{var B,K;L.preventDefault(),X.current={start:$?L.clientY:L.clientX,size:F()};try{(K=(B=L.currentTarget).setPointerCapture)==null||K.call(B,L.pointerId)}catch{}},[$,F]),G=i.useCallback(L=>{const B=X.current;if(!B)return;const ee=($?L.clientY:L.clientX)-B.start,U=r==="bottom"||r==="right"?-ee:ee;A(B.size+U)},[$,r,A]),ce=i.useCallback(L=>{var B,K,ee,U;X.current=null,(K=(B=L.currentTarget).hasPointerCapture)!=null&&K.call(B,L.pointerId)&&((U=(ee=L.currentTarget).releasePointerCapture)==null||U.call(ee,L.pointerId))},[]),Z=i.useCallback(L=>{const B=I!=null?I:F(),K=p!=null?p:$?window.innerHeight:window.innerWidth,ee=r==="bottom"?"ArrowUp":r==="top"?"ArrowDown":r==="left"?"ArrowRight":"ArrowLeft",U=r==="bottom"?"ArrowDown":r==="top"?"ArrowUp":r==="left"?"ArrowLeft":"ArrowRight";L.key===ee?(L.preventDefault(),A(B+_)):L.key===U?(L.preventDefault(),A(B-_)):L.key==="Home"?(L.preventDefault(),A(w)):L.key==="End"&&(L.preventDefault(),A(K))},[I,F,$,r,A,_,w,p]);i.useEffect(()=>{var L;if(!a){z(null);return}(L=E.current)==null||L.focus()},[a]);const te=f&&I!==null?{...$?{height:I}:{width:I},transition:"none"}:{};return s.jsx(He.CSSTransition,{in:a,timeout:120,appear:!0,classNames:{enterDone:"smwb-sheet_entered"},nodeRef:S,children:s.jsxs("div",{ref:D,"data-testid":"sheet",tabIndex:-1,role:"dialog","aria-modal":d==="modal"||void 0,...R,className:j("smwb-sheet",c,`smwb-sheet_${d}`,`smwb-${r}`,{"smwb-expanded":o==="expanded","smwb-small":o==="small","smwb-sheet_resizable":f}),style:{"--sizeProp":l,...te,...x},children:[f&&s.jsx("div",{className:"smwb-sheet__drag-handle","data-testid":"sheet-drag-handle",role:"separator",tabIndex:0,"aria-orientation":$?"horizontal":"vertical","aria-label":v,"aria-valuemin":w,"aria-valuemax":Math.round(p!=null?p:$?window.innerHeight:window.innerWidth),"aria-valuenow":Math.round(I!=null?I:F()),onPointerDown:ne,onPointerMove:G,onPointerUp:ce,onPointerCancel:ce,onKeyDown:Z,children:s.jsx("span",{className:"smwb-sheet__drag-handle-bar"})}),k&&s.jsx("div",{className:"smwb-sheet__header",children:N}),a&&o!=="small"&&s.jsx("div",{className:"smwb-sheet__inner",children:C})]})})}),Ps=e=>e==="start"||e==="end"?`flex-${e}`:e,io=e=>typeof e=="number"?`calc(var(--smui-spacing-unit, 4px) * ${e})`:e==="none"?"0":`var(--smui-space-${e})`,oo=i.forwardRef(function({direction:t="column",spacing:n="md",align:a,justify:r,wrap:c,divider:o,className:l,style:d,children:u,...m},h){const b=i.Children.toArray(u).filter(i.isValidElement);return s.jsx("div",{ref:h,"data-testid":"stack",className:j("smwb-stack",l),style:{display:"flex",flexDirection:t,flexWrap:c?"wrap":void 0,alignItems:Ps(a),justifyContent:Ps(r),gap:io(n),...d},...m,children:o?b.map((f,w)=>s.jsxs(i.Fragment,{children:[w>0?s.jsx("div",{className:"smwb-stack__divider",children:o}):null,f]},w)):u})}),lo=i.forwardRef(function({maxWidth:t="lg",disableGutters:n=!1,component:a,className:r,children:c,...o},l){const d=a!=null?a:"main";return s.jsx(d,{ref:l,"data-testid":"page",className:j("smwb-page",`smwb-page_max-${t}`,{"smwb-page_gutterless":n},r),...o,children:s.jsx("div",{className:"smwb-page__inner",children:c})})}),co=i.forwardRef(function({title:t,subtitle:n,breadcrumbs:a,actions:r,divider:c=!1,className:o,...l},d){return s.jsxs("header",{ref:d,"data-testid":"page-header",className:j("smwb-page-header",{"smwb-page-header_divider":c},o),...l,children:[a?s.jsx("div",{className:"smwb-page-header__breadcrumbs",children:a}):null,s.jsxs("div",{className:"smwb-page-header__row",children:[s.jsxs("div",{className:"smwb-page-header__titles",children:[typeof t=="string"?s.jsx(qe,{variant:"h4",component:"h1",className:"smwb-page-header__title",children:t}):s.jsx("div",{className:"smwb-page-header__title",children:t}),n?s.jsx(qe,{variant:"body2",color:"textSecondary",className:"smwb-page-header__subtitle",children:n}):null]}),r?s.jsx("div",{className:"smwb-page-header__actions",children:r}):null]})]})}),zs=e=>typeof e=="number"?`${e}px`:e,uo=i.forwardRef(function({header:t,sidebar:n,footer:a,sidebarWidth:r=260,sidebarCollapsed:c,defaultSidebarCollapsed:o=!1,onSidebarCollapsedChange:l,collapsible:d=!1,collapseToggle:u,collapseToggleAriaLabel:m="Toggle navigation",sidebarCollapsedWidth:h=72,stickyHeader:b=!0,className:f,style:w,children:p,..._},v){const[g,x]=Fe({value:c,defaultValue:o,onChange:l}),T=i.useId(),y={"--smui-app-sidebar-w":zs(g?h:r)};return s.jsxs("div",{ref:v,"data-testid":"app-layout",className:j("smwb-app-layout",{"smwb-app-layout_sticky-header":b,"smwb-app-layout_collapsed":g},f),style:{...y,...w},..._,children:[t?s.jsx("div",{className:"smwb-app-layout__header",children:t}):null,s.jsxs("div",{className:"smwb-app-layout__body",children:[n?s.jsxs("aside",{id:T,className:"smwb-app-layout__sidebar",children:[d?s.jsx("div",{className:"smwb-app-layout__collapse",children:u!=null?u:s.jsx("button",{type:"button",className:"smwb-app-layout__collapse-btn","aria-label":m,"aria-expanded":!g,"aria-controls":T,onClick:()=>x(!g),children:s.jsx(W,{name:g?"chevron_right":"chevron_left",size:20})})}):null,n]}):null,s.jsxs("div",{className:"smwb-app-layout__content",children:[p,a?s.jsx("div",{className:"smwb-app-layout__footer",children:a}):null]})]})]})}),mo=i.forwardRef(function({className:t,children:n,dense:a,position:r="static",placement:c="top",leftContent:o,midContent:l,midContentAlign:d="middle",rightContent:u,title:m,color:h="default",...b},f){const w=c==="top"?"header":"footer";return s.jsx(w,{ref:f,className:j("smwb-appbar",t,`smwb-${r}`,`smwb-${c}`,{"smwb-dense":a},h!=="default"&&`smwb-appbar_color-${h}`),"data-testid":"app-bar",...b,children:n||s.jsxs("div",{className:"smwb-appbar__inner",children:[s.jsxs("div",{className:"smwb-appbar__left",children:[m&&s.jsx("div",{className:"smwb-appbar__left__title",children:m}),o]}),s.jsx("div",{className:j("smwb-appbar__mid",`smwb-${d}`),children:l}),s.jsx("div",{className:"smwb-appbar__right",children:u})]})})}),fo=i.forwardRef(function({className:t,separator:n="/",maxItems:a=8,itemsBeforeCollapse:r=1,itemsAfterCollapse:c=1,expanded:o,onExpand:l,expandLabel:d="Show path",children:u,...m},h){const b=o!==void 0,[f,w]=i.useState(!1),p=b?!!o:f,_=i.Children.toArray(u).filter(i.isValidElement),v=!p&&_.length>a&&r+c<_.length,g=()=>{l==null||l(),b||w(!0)},x=v?[..._.slice(0,r),s.jsx("button",{type:"button",className:"smwb-breadcrumbs__expand","aria-label":d,onClick:g,children:"…"},"smwb-breadcrumbs-expand"),..._.slice(_.length-c)]:_;return s.jsx("nav",{...m,ref:h,"data-testid":"breadcrumbs","aria-label":"breadcrumb",className:j("smwb-breadcrumbs",t),children:s.jsx("ol",{className:"smwb-breadcrumbs__list",children:x.map((T,y)=>s.jsxs(i.Fragment,{children:[s.jsx("li",{className:"smwb-breadcrumbs__item",children:T}),y<x.length-1?s.jsx("li",{className:"smwb-breadcrumbs__separator","aria-hidden":"true",children:n}):null]},y))})})}),Lt=(e,t)=>Array.from({length:Math.max(t-e+1,0)},(n,a)=>e+a),ho=(e,t,n,a)=>{const r=Lt(1,Math.min(a,e)),c=Lt(Math.max(e-a+1,a+1),e),o=Math.max(Math.min(t-n,e-a-n*2-1),a+2),l=Math.min(Math.max(t+n,a+n*2+2),c.length>0?c[0]-2:e-1);return[...r,...o>a+2?["start-ellipsis"]:a+1<e-a?[a+1]:[],...Lt(o,l),...l<e-a-1?["end-ellipsis"]:e-a>a?[e-a]:[],...c]},bo=i.forwardRef(function({className:t,count:n,page:a,siblingCount:r=1,boundaryCount:c=1,size:o="medium",variant:l="filled",shape:d="circular",color:u="default",disabled:m=!1,showFirstButton:h=!1,showLastButton:b=!1,hidePrevButton:f=!1,hideNextButton:w=!1,onChange:p,..._},v){const g=i.useRef(null),x=ge(v,g),T=k=>{m||k===a||k<1||k>n||p==null||p(k)},y=k=>{var D,I,z;if(!["ArrowLeft","ArrowRight","Home","End"].includes(k.key))return;const N=Array.from((I=(D=g.current)==null?void 0:D.querySelectorAll("button.smwb-pagination__item:not(:disabled)"))!=null?I:[]);if(N.length===0)return;const S=N.indexOf(document.activeElement);let E=S;k.key==="ArrowRight"?E=Math.min(S+1,N.length-1):k.key==="ArrowLeft"?E=Math.max(S-1,0):k.key==="Home"?E=0:k.key==="End"&&(E=N.length-1),k.preventDefault(),(z=N[E])==null||z.focus()},C=ho(n,a,r,c),R=(k,N,S,E,D)=>D?null:s.jsx("li",{children:s.jsx("button",{type:"button",className:"smwb-pagination__item smwb-pagination__nav","aria-label":N,disabled:m||S<1||S>n,onClick:()=>T(S),children:s.jsx(W,{name:E,size:o==="small"?16:18})})},k);return s.jsx("nav",{..._,ref:x,"data-testid":"pagination","aria-label":"pagination",className:j("smwb-pagination",`smwb-pagination_${o}`,`smwb-pagination_${l}`,`smwb-pagination_shape-${d}`,u!=="default"&&`smwb-pagination_color-${u}`,{"smwb-pagination_disabled":m},t),children:s.jsxs("ul",{className:"smwb-pagination__list",onKeyDown:y,children:[R("first","First page",1,"first_page",!h),R("prev","Previous page",a-1,"chevron_left",f),C.map((k,N)=>typeof k=="number"?s.jsx("li",{children:s.jsx("button",{type:"button",className:j("smwb-pagination__item",{"smwb-pagination__item_selected":k===a}),"aria-current":k===a?"page":void 0,disabled:m,onClick:()=>T(k),children:k})},k):s.jsx("li",{className:"smwb-pagination__ellipsis","aria-hidden":"true",children:"…"},`${k}-${N}`)),R("next","Next page",a+1,"chevron_right",w),R("last","Last page",n,"last_page",!b)]})})}),wo=i.forwardRef(function({className:t,steps:n,activeStep:a,orientation:r="horizontal",alternativeLabel:c=!1,onStepClick:o,...l},d){return s.jsx("div",{...l,ref:d,"data-testid":"stepper",className:j("smwb-stepper",`smwb-stepper_${r}`,{"smwb-stepper_alt-label":c&&r==="horizontal"},t),children:n.map((u,m)=>{var _;const h=m<a,b=m===a,f=m===n.length-1,w=!!o&&!u.disabled,p=v=>{w&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),o==null||o(m))};return s.jsxs(i.Fragment,{children:[s.jsxs("div",{className:j("smwb-stepper__step",{"smwb-stepper__step_active":b,"smwb-stepper__step_completed":h,"smwb-stepper__step_error":u.error,"smwb-stepper__step_disabled":u.disabled,"smwb-stepper__step_clickable":w}),"aria-current":b?"step":void 0,"aria-disabled":u.disabled||void 0,role:w?"button":void 0,tabIndex:w?0:void 0,onClick:w?()=>o==null?void 0:o(m):void 0,onKeyDown:w?p:void 0,children:[s.jsx("div",{className:"smwb-stepper__icon","aria-hidden":"true",children:(_=u.icon)!=null?_:h?s.jsx(W,{name:"check",size:16}):s.jsx("span",{children:m+1})}),s.jsxs("div",{className:"smwb-stepper__text",children:[s.jsx("span",{className:"smwb-stepper__label",children:u.label}),u.optional?s.jsx("span",{className:"smwb-stepper__optional",children:u.optional}):null,u.description&&r==="vertical"?s.jsx("span",{className:"smwb-stepper__description",children:u.description}):null]})]}),f?null:s.jsx("div",{className:"smwb-stepper__connector","aria-hidden":"true"})]},m)})})});function po({items:e,icon:t="more_vert",placement:n,"aria-label":a,disabled:r,className:c}){const o=i.useRef(null),[l,d]=i.useState(!1),u=()=>d(!1);return s.jsxs("span",{className:j("smwb-overflow-menu",c),children:[s.jsx(Me,{ref:o,variant:"text",size:"small",icon:t,"aria-label":a!=null?a:"More actions","aria-haspopup":"menu",disabled:!!r,onClick:()=>d(m=>!m)}),s.jsx(Nt,{isOpen:l,onClose:u,anchorElement:o.current,...n?{placement:n}:{},children:e.map(m=>s.jsxs(Ze,{className:j({"smwb-overflow-menu__item--danger":m.danger}),disabled:m.disabled,onClick:()=>{var h;m.disabled||((h=m.onSelect)==null||h.call(m),u())},children:[m.icon?typeof m.icon=="string"?s.jsx(W,{name:m.icon}):m.icon:null,m.label]},m.id))})]})}const _o=i.forwardRef(function({className:t,variant:n="default",menuItems:a,activeItem:r,defaultActiveItem:c=null,onActiveItemChange:o,collapsible:l=!1,collapsed:d,defaultCollapsed:u=!1,onCollapsedChange:m,collapseToggleAriaLabel:h="Toggle navigation",...b},f){const w=r!==void 0,[p,_]=i.useState(c),v=w?r:p,[g,x]=Fe({value:d,defaultValue:u,onChange:m}),T=l&&g?"compactMini":n;return s.jsxs("aside",{ref:f,className:j("smwb-sidebar",t,`smwb-${T}`,{"smwb-sidebar_collapsible":l,"smwb-sidebar_collapsed":l&&g}),role:"menubar",...b,children:[l&&s.jsx("div",{className:"smwb-sidebar__collapse",children:s.jsx("button",{type:"button",className:"smwb-sidebar__collapse-btn","aria-label":h,"aria-expanded":!g,onClick:()=>x(!g),children:s.jsx(W,{name:g?"chevron_right":"chevron_left",size:20})})}),s.jsx("nav",{className:"smwb-sidebar__nav",children:a&&(a==null?void 0:a.map((y,C)=>s.jsx(go,{as:y.as,isActive:v===C,onClick:R=>{var k;w||_(C),o==null||o(C),(k=y.onClick)==null||k.call(y,R)},icon:y.icon,title:y.title,href:y.href,variant:T},C)))})]})});function go({isActive:e,icon:t,title:n,as:a="div",href:r,onMouseDown:c,variant:o,...l}){const d=i.useRef(null),u=f=>{c==null||c(f)},m=f=>{var w;(w=d.current)==null||w.onRipple(f)},h=s.jsx(Ee,{actionRef:d}),b=a;return s.jsxs(b,{href:r,role:"menuitem",className:j("sidebar__nav__item","smwb-nav-item",o,{active:e}),onMouseDown:u,onPointerDown:m,...l,children:[t&&s.jsx("span",{className:"smwb-nav-item__icon",children:t}),n&&s.jsx("span",{className:"smwb-nav-item__title",children:n}),h]})}const xo=i.forwardRef(function({className:t,menuItems:n=[],visibleCount:a=4,activeItem:r,defaultActiveItem:c=null,onActiveItemChange:o,overflowMenuAriaLabel:l="More navigation",...d},u){const m=r!==void 0,[h,b]=i.useState(c),f=m?r:h,[w,p]=i.useState(!1),[_,v]=i.useState(null),g=Math.max(0,a),x=i.useMemo(()=>n.slice(0,g),[n,g]),T=i.useMemo(()=>n.slice(g),[n,g]),y=T.length>0,C=y&&f!==null&&f>=g,R=E=>{m||b(E),o==null||o(E)},k=(E,D)=>I=>{R(E),D==null||D(I)},N=()=>{p(E=>!E)},S=()=>{p(!1)};return s.jsxs("nav",{ref:u,className:j("smwb-bottom-bar",t),role:"navigation",...d,children:[s.jsxs("div",{className:"smwb-bottom-bar__nav",role:"menubar",children:[x.map((E,D)=>s.jsx(Vs,{as:E.as,isActive:f===D,onClick:k(D,E.onClick),icon:E.icon,title:E.title,href:E.href},D)),y&&s.jsx(Vs,{ref:v,isActive:C,onClick:N,icon:s.jsx(W,{name:"menu",size:24}),"aria-label":l,"aria-haspopup":"menu","aria-expanded":w})]}),y&&s.jsx(Nt,{isOpen:w,onClose:S,anchorElement:_,placement:"top",dense:!0,children:T.map((E,D)=>{const I=g+D;return s.jsxs(Ze,{selected:f===I,href:E.href,onClick:z=>{var $;R(I),($=E.onClick)==null||$.call(E,z),S()},children:[E.icon?s.jsx(ls,{children:E.icon}):null,s.jsx(cs,{inset:!E.icon,children:E.title})]},I)})})]})}),Vs=i.forwardRef(function({isActive:t,icon:n,title:a,as:r="div",href:c,onMouseDown:o,...l},d){const u=i.useRef(null),m=f=>{o==null||o(f)},h=f=>{var w;(w=u.current)==null||w.onRipple(f)},b=r;return s.jsxs(b,{ref:d,href:c,role:"menuitem",className:j("smwb-bottom-bar__item",{"smwb-bottom-bar__item_active":t}),onMouseDown:m,onPointerDown:h,...l,children:[n&&s.jsx("span",{className:"smwb-bottom-bar__item-icon",children:n}),a?s.jsx("span",{className:"smwb-bottom-bar__item-title",children:a}):null,s.jsx(Ee,{actionRef:u})]})});function vo(e,t){let n;const a=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return a.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},a}const yo=i.forwardRef(function(t,n){const{className:a,label:r,isActive:c=!1,contentRef:o,icon:l,stacked:d=!1,tag:u,disabled:m,onMouseDown:h,...b}=t,f=i.useRef(null),w=g=>{h==null||h(g)},p=g=>{var x;(x=f.current)==null||x.onRipple(g)},_=u!=null?u:u||"button",v=j("smwb-tab",a,{"smwb-tab--active":c,"smwb-tab--stacked":d,"smwb-tab--disabled":m});return s.jsxs(_,{ref:n,className:v,onMouseDown:w,onPointerDown:p,role:"tab","aria-selected":c,"aria-disabled":m||void 0,tabIndex:c?0:-1,disabled:_==="button"?m:void 0,...b,children:[s.jsxs("span",{className:"smwb-tab__content",ref:o,children:[l&&s.jsx("span",{className:"smwb-tab__icon",children:l}),r&&s.jsx("span",{className:"smwb-tab__text-label",children:r})]}),s.jsx(Ee,{actionRef:f,classes:{child:"tab__ripple-child"}})]})}),jo=e=>(1+Math.sin(Math.PI*e-Math.PI/2))/2;function ko(e,t,n,a={},r=()=>{}){const{ease:c=jo,duration:o=300}=a;let l=null;const d=e[t];let u=!1;const m=()=>{u=!0},h=b=>{if(u){r(new Error("Animation cancelled"));return}l===null&&(l=b);const f=Math.min(1,(b-l)/o);if(e[t]=c(f)*(n-d)+d,f>=1){requestAnimationFrame(()=>{r(null)});return}requestAnimationFrame(h)};return d===n?(r(new Error("Element already at target position")),m):(requestAnimationFrame(h),m)}const Hs={root:{},content:{}},No=i.forwardRef(function(t,n){const{className:a,children:r,onChange:c,value:o,indicatorContent:l=!1,scrollable:d=!1,"aria-label":u,...m}=t,[h,b]=i.useState(!1),[f,w]=i.useState(Hs),p=i.useRef(null),_=i.useRef(null),v=i.useRef([]),g=40,x=()=>{const k=p.current;let N;if(k){const D=k.getBoundingClientRect();N={clientWidth:k.clientWidth,scrollLeft:k.scrollLeft,scrollTop:k.scrollTop,scrollWidth:k.scrollWidth,top:D.top,bottom:D.bottom,left:D.left,right:D.right}}let S=null,E=null;if(_.current||console.error("tabListRef.current is undefined"),k&&_.current){const D=_.current.children;if(D.length>0){const I=D[o];S=I?I.getBoundingClientRect():null,l&&(E=v.current[o]?v.current[o].getBoundingClientRect():null)}}return{tabsMeta:N,tabMeta:S,tabContentMeta:E}},T=De(()=>{const{tabsMeta:k,tabMeta:N,tabContentMeta:S}=x();let E=0;N&&k&&(E=1*(N.left-k.left+k.scrollLeft));const D={root:{left:E,width:N?N.width:0}};if(l&&S&&(D.content={width:S.width}),isNaN(f.root.left)||isNaN(f.root.width))w(D);else{const I=Math.abs(f.root.left-D.root.left),z=Math.abs(f.root.width-D.root.width);(I>=1||z>=1)&&w(D)}}),y=(k,{animation:N=!0}={})=>{p.current&&(N?ko(p.current,"scrollLeft",k,{duration:300}):p.current.scrollLeft=k)},C=De(k=>{const{tabsMeta:N,tabMeta:S}=x();if(!(!S||!N)){if(S.left<N.left){const E=N.scrollLeft+(S.left-N.left);y(E-g,{animation:k})}else if(S.right>N.right){const E=N.scrollLeft+(S.right-N.right);y(E+g,{animation:k})}}});i.useEffect(()=>{b(!0)},[]),i.useEffect(()=>{T()}),i.useEffect(()=>{var E,D;const k=vo(()=>{p.current&&T()},166);if(!p.current||!p.current.ownerDocument.defaultView){console.error("tabsRef.current.ownerDocument.defaultView is undefined");return}const N=p.current.ownerDocument.defaultView;N.addEventListener("resize",k);let S;return typeof ResizeObserver!="undefined"&&(S=new ResizeObserver(k),Array.from((D=(E=_.current)==null?void 0:E.children)!=null?D:[]).forEach(I=>{S.observe(I)})),()=>{k.cancel(),N.removeEventListener("resize",k),S&&S.disconnect()}},[T]),i.useEffect(()=>{C(Hs!==f)},[C,f]);const R=i.Children.map(r,(k,N)=>i.cloneElement(k,{isActive:o===N,onClick:S=>{c(S,N)},...l&&{contentRef:S=>{const{contentRef:E}=k.props;v.current.push(S),E&&Ws(E,S)}}}));return s.jsx("div",{className:j("smwb-tabs",a),role:"tabpanel",ref:n,...m,children:s.jsxs("div",{className:j("smwb-tabs__scroller",{"smwb-tabs__scroller--scrollable":d}),ref:p,children:[s.jsx("div",{className:"smwb-tabs__scroll-area",ref:_,role:"tablist","aria-label":u,children:R}),h&&s.jsx("span",{className:"smwb-tabs__indicator",style:f.root,children:s.jsx("span",{className:"smwb-tabs__indicator-content",style:f.content})})]})})});exports.clearIcons=ye.clearIcons;exports.configureIcons=ye.configureIcons;exports.getIcon=ye.getIcon;exports.getIconConfig=ye.getIconConfig;exports.getIconVersion=ye.getIconVersion;exports.hasIcon=ye.hasIcon;exports.listIcons=ye.listIcons;exports.normalizeIconName=ye.normalizeIconName;exports.registerIcons=ye.registerIcons;exports.resetIconConfig=ye.resetIconConfig;exports.subscribeIcons=ye.subscribeIcons;exports.unregisterIcons=ye.unregisterIcons;exports.Accordion=Ca;exports.AppBar=mo;exports.AppLayout=uo;exports.AssetGrid=Ka;exports.Avatar=Jt;exports.AvatarGroup=La;exports.Badge=za;exports.BottomBar=xo;exports.Breadcrumbs=fo;exports.Button=Me;exports.ButtonGroup=Tr;exports.CHAT_DEFAULT_FILE_UPLOAD_MAX_FILES=Js;exports.CHAT_EXPAND_LAYOUTS=Gt;exports.CHAT_MESSAGE_DELIVERY_STATUSES=Gs;exports.CHAT_MESSAGE_STATUS_ICONS=qs;exports.CHAT_MESSAGE_STATUS_LABELS=Zs;exports.Card=Va;exports.Carousel=ir;exports.Chat=zt;exports.ChatAttachmentImage=ln;exports.ChatAttachments=cn;exports.ChatComposer=rn;exports.ChatHeader=on;exports.ChatLayout=Pa;exports.ChatMessageAvatar=Bt;exports.ChatMessageBubble=Qt;exports.ChatMessageIncoming=dn;exports.ChatMessageItem=hn;exports.ChatMessageOutgoing=mn;exports.ChatMessageSkeleton=bn;exports.ChatMessageStatus=un;exports.ChatMessageSystem=fn;exports.ChatMessages=gn;exports.ChatShell=xn;exports.Checkbox=Mr;exports.Chip=es;exports.ChipGroup=Ha;exports.CircularProgress=In;exports.ClickAwayListener=Qe;exports.Column=Ji;exports.Container=Qi;exports.DEFAULT_TIME_FORMAT=ft;exports.DataPickerDays=os;exports.DataPickerHeader=is;exports.DataPickerInput=Un;exports.DatePicker=si;exports.DatePickerActionLabel=Vt;exports.DatePickerIconButton=Ve;exports.DatePickerList=dt;exports.DateTimePicker=Ri;exports.DateTimePickerInput=Zn;exports.Divider=to;exports.ExpansionPanel=Ma;exports.FloatingButton=Us;exports.Grid=Ki;exports.Icon=W;exports.IconContext=Ut;exports.IconProvider=xa;exports.ImagesList=cr;exports.ImagesListItem=lr;exports.ImagesListItemModal=Tn;exports.LazyImage=jn;exports.List=dr;exports.ListItem=ur;exports.Menu=Nt;exports.MenuDivider=Yn;exports.MenuItem=Ze;exports.MenuItemIcon=ls;exports.MenuItemText=cs;exports.MenuSubmenu=qr;exports.Message=vr;exports.MessageContainer=Dn;exports.Modal=Ke;exports.OpenView=pe;exports.OverflowMenu=po;exports.Page=lo;exports.PageHeader=co;exports.Pagination=bo;exports.ProgressIndicator=En;exports.RadioButton=Ei;exports.Rating=Ii;exports.Ripple=Ee;exports.Row=qi;exports.SaveAssetDialog=yr;exports.ScreenDivider=no;exports.SelectField=Li;exports.Sheet=ao;exports.Sidebar=_o;exports.Skeleton=it;exports.Slider=ra;exports.SnackbarProvider=Nr;exports.Stack=oo;exports.Stepper=wo;exports.Tab=yo;exports.Table=mr;exports.TableBody=fr;exports.TableCell=hr;exports.TableHead=br;exports.TableHeadCell=wr;exports.TablePagination=Mn;exports.TableRow=pr;exports.Tabs=No;exports.TextField=Be;exports.TextFieldAdornment=Ot;exports.TextFieldWrapper=Oe;exports.Theme=Ks;exports.ThumbCard=Ya;exports.TimePicker=Di;exports.TimePickerColumns=ds;exports.TimePickerInput=ta;exports.Toggle=Yi;exports.Tooltip=Sr;exports.TreeView=_r;exports.Typography=qe;exports.ValueSlider=Hi;exports.formatChatTimestamp=sn;exports.getChatLayoutActions=nn;exports.getCurrentDateTimeFormat=vt;exports.getDisplayDateTime=ot;exports.isChatMessageDeliveryStatus=qt;exports.isImageAttachment=tn;exports.isScrolledToBottom=pn;exports.resolveAllowedLayouts=Zt;exports.resolveChatFileUploadMaxFiles=vn;exports.resolveChatMessageStatusIcon=Qs;exports.resolveChatMessageStatusLabel=en;exports.scrollChatToBottom=Pt;exports.shouldComposerNewlineOnEnter=an;exports.useChatFileUpload=yn;exports.useChatInfiniteScroll=wn;exports.useChatStickToBottom=_n;exports.useControllableState=Fe;exports.useDateInput=Wn;exports.useDateTimeInput=qn;exports.useFocusTrap=fa;exports.useHoverPopover=ga;exports.useIconSource=Xs;exports.useId=mt;exports.useRovingTabIndex=ha;exports.useSnackbar=Cr;exports.useTheme=da;exports.useTimeInput=ea;exports.useVirtualList=Wt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),ye=require("@floating-ui/react"),Me=require("./config-BZIXwGpc.js"),s=require("react/jsx-runtime"),y=require("clsx"),Rt=require("react-transition-group/Transition"),Fe=require("react-dom"),Ue=require("react-transition-group"),Zt=require("rifm"),Gs=require("uuid");class wr{constructor(t){this.cbs=[],this._value=t}setValue(t){if(this.value!==t){this._value=t;for(const n of this.cbs)n(t)}}get value(){return this._value}subscribe(t){return this.cbs.push(t),()=>{this.cbs=this.cbs.filter(n=>n!==t)}}}function pr(e){const[t,n]=i.useState(e.value);return i.useEffect(()=>(n(e.value),e.subscribe(n)),[e]),t}const ke=typeof window=="undefined"?i.useEffect:i.useLayoutEffect;var qs=(e=>(e.dark="dark",e.light="light",e))(qs||{});const vt="smui-theme",Ze=new wr("light"),_r=()=>{const e=pr(Ze),t=i.useRef(!0);ke(()=>{const r=localStorage.getItem(vt);if(t.current)if(t.current=!1,r)Ze.setValue(r),document.documentElement.dataset.theme=r;else{const a=window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";r!==e&&Ze.setValue(a),localStorage.setItem(vt,a),document.documentElement.dataset.theme=a}},[e]);const n=function(r){if(r.storageArea===localStorage){const a=localStorage.getItem(vt);document.documentElement.dataset.theme=a,Ze.setValue(a)}};return i.useEffect(()=>(window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)),[]),{theme:e,setTheme:r=>{localStorage.setItem(vt,r),Ze.setValue.bind(Ze)(r),document.documentElement.dataset.theme=r}}};function $e({value:e,defaultValue:t,onChange:n}){const r=e!==void 0,[a,u]=i.useState(t),o=r?e:a,l=i.useRef(o);l.current=o;const d=i.useRef(n);d.current=n;const c=i.useCallback(m=>{var f;const h=l.current,b=typeof m=="function"?m(h):m;r||u(b),(f=d.current)==null||f.call(d,b)},[r]);return[o,c]}function pt(e,t="smwb"){const n=i.useId();return e!=null?e:`${t}-${n.replace(/[:]/g,"")}`}const gr='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function xr(e,{active:t,restoreFocus:n=!0,autoFocus:r=!0}){const a=i.useRef(null);i.useEffect(()=>{if(!t)return;const u=e.current;if(!u)return;a.current=document.activeElement;const o=()=>Array.from(u.querySelectorAll(gr)).filter(d=>d.offsetParent!==null||d===document.activeElement);if(r){const d=o()[0];(d!=null?d:u).focus({preventScroll:!0})}const l=d=>{if(d.key!=="Tab")return;const c=o();if(c.length===0){d.preventDefault();return}const m=c[0],h=c[c.length-1],b=document.activeElement;d.shiftKey&&b===m?(d.preventDefault(),h.focus()):!d.shiftKey&&b===h?(d.preventDefault(),m.focus()):u.contains(b)||(d.preventDefault(),m.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),n&&a.current&&a.current.focus({preventScroll:!0})}},[t,r,n,e])}function vr({count:e,activeIndex:t,onMove:n,orientation:r="horizontal",loop:a=!0,isDisabled:u}){return i.useCallback(o=>{if(e===0)return;const l=r==="horizontal"||r==="both",d=r==="vertical"||r==="both",c=l&&o.key==="ArrowRight"||d&&o.key==="ArrowDown",m=l&&o.key==="ArrowLeft"||d&&o.key==="ArrowUp";let h=null;if(c?h=t+1:m?h=t-1:o.key==="Home"?h=0:o.key==="End"&&(h=e-1),h===null)return;const b=f=>a?(f+e)%e:Math.max(0,Math.min(e-1,f));if(h=b(h),u){let f=0;const w=c||o.key==="Home"?1:-1;for(;u(h)&&f<e;)h=b(h+w),f+=1;if(u(h))return}o.preventDefault(),n(h)},[e,t,n,r,a,u])}function Jt({itemCount:e,itemHeight:t,viewportHeight:n,overscan:r=4}){const[a,u]=i.useState(0),o=i.useCallback(l=>{u(l.currentTarget.scrollTop)},[]);return i.useMemo(()=>{const l=t>0?t:1,d=Math.ceil(n/l),c=Math.max(0,Math.floor(a/l)-r),m=Math.min(e,c+d+r*2);return{startIndex:c,endIndex:m,totalHeight:e*l,offsetY:c*l,onScroll:o}},[e,t,n,r,a,o])}function rt(e){if(e==="auto"||e==="auto-start"||e==="auto-end"){const t=e==="auto-start"?"start":e==="auto-end"?"end":null;return{autoMiddleware:ye.autoPlacement({alignment:t})}}return{placement:e}}const ps=4,Et=8;function Ct(e,t){return t!=null&&t.length?[...t,ye.flip(),ye.shift({padding:Et})]:e.autoMiddleware?[ye.offset(ps),ye.shift({padding:Et}),e.autoMiddleware]:[ye.offset(ps),ye.flip(),ye.shift({padding:Et})]}const yr="bottom-start",jr=4,kr=8,Nr=({x:e,y:t})=>({x:e,y:t,top:t,left:e,right:e,bottom:t,width:0,height:0});function Rr(e={}){const{placement:t=yr,offsetPx:n=jr,openDelay:r=0,closeDelay:a=0,middleware:u}=e,[o,l]=i.useState(!1),d=i.useRef({x:0,y:0}),c=i.useRef({x:0,y:0}),m=i.useRef(null),h=i.useRef(null),b=i.useRef(null),f=rt(t),w=i.useMemo(()=>[ye.offset({mainAxis:n,crossAxis:n}),...f.autoMiddleware?[f.autoMiddleware]:[ye.flip()],ye.shift({padding:kr}),...u!=null?u:[]],[n,f.autoMiddleware,u]),{refs:p,floatingStyles:_,update:x}=ye.useFloating({open:o,placement:f.placement,whileElementsMounted:ye.autoUpdate,middleware:w}),g=i.useMemo(()=>({getBoundingClientRect:()=>Nr(c.current)}),[]),v=i.useCallback(()=>{h.current!==null&&(clearTimeout(h.current),h.current=null),b.current!==null&&(clearTimeout(b.current),b.current=null)},[]);i.useEffect(()=>()=>v(),[v]),i.useEffect(()=>{var D;o&&(p.setPositionReference((D=m.current)!=null?D:g),x())},[o,p,x,g]);const S=i.useCallback(()=>{m.current===null&&(c.current=d.current)},[]),j=i.useCallback(()=>{v(),S(),l(!0)},[v,S]),C=i.useCallback(()=>{if(v(),r<=0){S(),l(!0);return}h.current=setTimeout(()=>{S(),l(!0)},r)},[v,S,r]),R=i.useCallback(()=>{if(v(),a<=0){l(!1);return}b.current=setTimeout(()=>l(!1),a)},[v,a]),k=i.useCallback(()=>{v(),l(!1)},[v]),N=i.useCallback(D=>{m.current=null,c.current=D},[]),M=i.useCallback(D=>{m.current=D},[]),E=i.useCallback(D=>{d.current={x:D.clientX,y:D.clientY},C()},[C]),T=i.useCallback(D=>{d.current={x:D.clientX,y:D.clientY}},[]),I=i.useCallback(D=>({onPointerEnter:F=>{var A;(A=D==null?void 0:D.onPointerEnter)==null||A.call(D,F),E(F)},onPointerMove:F=>{var A;(A=D==null?void 0:D.onPointerMove)==null||A.call(D,F),T(F)},onPointerLeave:F=>{var A;(A=D==null?void 0:D.onPointerLeave)==null||A.call(D,F),R()}}),[E,T,R]),Y=i.useCallback(()=>{v(),l(!0)},[v]),$=i.useCallback(D=>({ref:p.setFloating,style:{..._,...D==null?void 0:D.style},onPointerEnter:Y,onPointerLeave:R}),[p,_,Y,R]);return{open:o,getReferenceProps:I,getFloatingProps:$,setAnchorEl:M,setVirtualAnchor:N,openNow:j,scheduleOpen:C,scheduleClose:R,close:k}}function Cr(e){if(e)return typeof e=="string"?e:Object.entries(e).flatMap(([t,n])=>[t,...n]).join(",")}function St(e={}){const t=i.useRef(null),[n,r]=i.useState(!1),a=i.useRef(e);a.current=e;const u=i.useCallback(()=>{var c;a.current.disabled||(c=t.current)==null||c.click()},[]),o=i.useCallback((c,m)=>{if(!c)return;const{maxFiles:h,onDrop:b,onDropAccepted:f}=a.current;let w=Array.from(c);h&&h>0&&(w=w.slice(0,h)),b==null||b(w,m),f==null||f(w,m)},[]),l=i.useCallback(()=>({onClick:()=>u(),onDragOver:c=>{c.preventDefault(),a.current.disabled||r(!0)},onDragLeave:()=>r(!1),onDrop:c=>{var m,h;c.preventDefault(),r(!1),a.current.disabled||o((h=(m=c.dataTransfer)==null?void 0:m.files)!=null?h:null,c)}}),[o,u]),d=i.useCallback(()=>({type:"file",multiple:a.current.multiple,accept:Cr(a.current.accept),disabled:a.current.disabled,style:{display:"none"},ref:t,onChange:c=>o(c.currentTarget.files,c)}),[o]);return{getRootProps:l,getInputProps:d,inputRef:t,isDragActive:n,open:u}}const Qt=i.createContext(null);function Sr({source:e,icons:t,children:n}){i.useMemo(()=>{t&&Me.registerIcons(t)},[t]);const r=i.useMemo(()=>({source:e}),[e]);return s.jsx(Qt.Provider,{value:r,children:n})}const _s=()=>Me.getIconConfig().source;function Zs(e){var r;const t=i.useContext(Qt),n=i.useSyncExternalStore(Me.subscribeIcons,_s,_s);return(r=e!=null?e:t==null?void 0:t.source)!=null?r:n}const Mr=["primary","secondary","error","success","warning","info","disabled"],gs=new Set;function Dr(e){!Me.getIconConfig().warnOnMissing||gs.has(e)||(gs.add(e),console.warn(`[smwb] Icon "${e}" is not registered. Register it (import { ${e} } from "@smwb/ui-react/icons") or use source="auto" to fall back to Material Symbols.`))}const G=i.forwardRef(function({className:t,weight:n=400,fill:r=0,size:a=20,grade:u=100,name:o,color:l="inherit",title:d,source:c,...m},h){var R,k;const b=Zs(c),f=typeof o=="string"?o:null,w=()=>{var N;return f===null?null:(N=Me.getIcon(f))!=null?N:null},p=i.useSyncExternalStore(Me.subscribeIcons,w,w),_=typeof o=="object"?o:p,x=typeof o=="string"?o:o.name,g=b==="google"?"google":_?"smwb":b==="smwb"?"missing":"google";g==="missing"&&Dr(x);const v=d===void 0,S=l&&Mr.includes(l)?`smwb-icon_color-${l}`:null,j=typeof a=="number"?`${a}px`:a,C=Math.round(Math.min(3,Math.max(1,n/200))*100)/100;return s.jsx("span",{...m,ref:h,"data-testid":"icon","data-icon-source":g,role:v?void 0:"img","aria-hidden":v?!0:void 0,"aria-label":d,title:d,style:{...m.style,...g==="google"?{fontVariationSettings:`'FILL' ${r}, 'wght' ${n}, 'GRAD' ${u}, 'opsz' 48`}:null},className:y("smwb-icon__wrapper",S,t),children:g==="google"?s.jsx("span",{className:"material-symbols-outlined",style:{fontSize:j},children:x}):s.jsx("svg",{className:"smwb-icon__svg",viewBox:(R=_==null?void 0:_.viewBox)!=null?R:"0 0 24 24",style:{width:j,height:j},fill:"none",stroke:"currentColor",strokeWidth:C,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:(k=_==null?void 0:_.body)!=null?k:""}})})}),Be=i.forwardRef(function({actionRef:t,className:n,classes:r,center:a,style:u,duration:o=600,color:l,...d},c){const[m,h]=i.useState([]),b=i.useRef(0);return i.useImperativeHandle(t,()=>({onRipple(f){const p=f.currentTarget.getBoundingClientRect(),_=Math.max(p.width,p.height),x=_/2;let g,v;a?(g=p.width>p.height?0:p.width/2-x,v=p.height>p.width?0:p.height/2-x):(g=f.clientX-p.left-x,v=f.clientY-p.top-x),h([...m,s.jsx("span",{className:y("smwb-ripple__child",r==null?void 0:r.child),style:{...u,left:g,top:v,width:_,height:_,backgroundColor:l!=null?l:u==null?void 0:u.backgroundColor},...d},b.current)]),b.current+=1,setTimeout(()=>{h(S=>S.slice(1))},o)}}),[d,a,m,r==null?void 0:r.child,u,o,l]),s.jsx("span",{ref:c,className:y("smwb-ripple",n,r==null?void 0:r.ripple),"data-testid":"ripple","aria-hidden":"true",children:m})});function Js(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Ne(...e){return i.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Js(n,t)})},e)}function Tr(e){const t=parseFloat(e);return!isNaN(t)&&isFinite(t)}function xs(e){return typeof e=="string"&&e[e.length-1]==="%"&&Tr(e.substring(0,e.length-1))}function It(e,t){t===0&&(e!=null&&e.style)&&(e.style.display="none")}function Er(e,t){t===0&&(e!=null&&e.style)&&(e.style.display="")}const Ir={animating:"rah-animating",animatingUp:"rah-animating--up",animatingDown:"rah-animating--down",animatingToHeightZero:"rah-animating--to-height-zero",animatingToHeightAuto:"rah-animating--to-height-auto",animatingToHeightSpecific:"rah-animating--to-height-specific",static:"rah-static",staticHeightZero:"rah-static--height-zero",staticHeightAuto:"rah-static--height-auto",staticHeightSpecific:"rah-static--height-specific"};function vs(e,t){return y({[e.static]:!0,[e.staticHeightZero]:t===0,[e.staticHeightSpecific]:typeof t=="number"&&t>0,[e.staticHeightAuto]:t==="auto"})}const Ar=i.forwardRef(function({animateOpacity:t=!1,animationStateClasses:n={},applyInlineTransitions:r=!0,children:a,className:u="",contentClassName:o,delay:l=0,duration:d=300,easing:c="ease",height:m,onHeightAnimationEnd:h,onHeightAnimationStart:b,style:f,...w},p){const _=i.useRef(m),x=i.useRef(null),g=i.useRef(null),v=Ne(p,g),S=i.useRef(),j=i.useRef(),C=i.useRef({...Ir,...n}),R=l,k=d;let N=m,M="visible";typeof N=="number"?(N=typeof m!="number"||m<0?0:m,M="hidden"):xs(N)&&(N=m==="0%"?0:m,M="hidden");const[E,T]=i.useState(N),[I,Y]=i.useState(M),[$,D]=i.useState(!1),[F,A]=i.useState(vs(C.current,m));i.useEffect(()=>{It(x.current,E)},[]),i.useEffect(()=>{if(m!==_.current&&x.current){Er(x.current,_.current),x.current.style.overflow="hidden";const ee=x.current.offsetHeight;x.current.style.overflow="";const ae=k+R;let L,B,U="hidden",te;const q=_.current==="auto";typeof m=="number"?(L=m<0?0:m,B=L):xs(m)?(L=m==="0%"?0:m,B=L):(L=ee,B="auto",U=void 0),q&&(B=L,L=ee);const ie=y({[C.current.animating]:!0,[C.current.animatingUp]:_.current==="auto"||m<_.current,[C.current.animatingDown]:m==="auto"||m>_.current,[C.current.animatingToHeightZero]:B===0,[C.current.animatingToHeightAuto]:B==="auto",[C.current.animatingToHeightSpecific]:typeof B=="number"&&B>0}),ce=vs(C.current,B);T(L),Y("hidden"),D(!q),A(ie),clearTimeout(j.current),clearTimeout(S.current),q?(te=!0,j.current=setTimeout(()=>{T(B),Y(U),D(te),b==null||b(B)},50),S.current=setTimeout(()=>{D(!1),A(ce),It(x.current,B),h==null||h(B)},ae)):(b==null||b(L),j.current=setTimeout(()=>{T(B),Y(U),D(!1),A(ce),m!=="auto"&&It(x.current,L),h==null||h(L)},ae))}return _.current=m,()=>{clearTimeout(j.current),clearTimeout(S.current)}},[m]);const W={...f,height:E,overflow:I||(f==null?void 0:f.overflow)};$&&r&&(W.transition=`height ${k}ms ${c} ${R}ms`,f!=null&&f.transition&&(W.transition=`${f.transition}, ${W.transition}`),W.WebkitTransition=W.transition);const oe={};t&&(oe.transition=`opacity ${k}ms ${c} ${R}ms`,oe.WebkitTransition=oe.transition,E===0&&(oe.opacity=0));const he=typeof w["aria-hidden"]!="undefined"?w["aria-hidden"]:m===0;return s.jsx("div",{...w,ref:v,"aria-hidden":he,className:`${F} ${u}`,style:W,children:s.jsx("div",{className:o,style:oe,ref:x,children:a})})}),$r=i.forwardRef(function({className:t,title:n,isOpenByDefault:r=!1,open:a,disabled:u,icon:o,id:l,children:d,startAdornment:c,noIcon:m,onToggleClick:h,onChange:b},f){const w=a!==void 0,[p,_]=i.useState(r),x=w?!!a:p,g=pt(l),v=`${g}-content`,S=`${g}-header`,j=y("smwb-accordion__arrow-icon",{"smwb-accordion__arrow-icon_opened":x}),C=R=>{if(u)return;const k=!x;w||_(k),b==null||b(k),h==null||h(R)};return s.jsxs("div",{ref:f,className:y("smwb-accordion",{"smwb-disabled":u},t),"data-testid":"accordion",children:[s.jsxs("button",{id:S,className:"smwb-accordion__header",onClick:C,type:"button",disabled:u,"aria-expanded":x,"aria-controls":d?v:void 0,children:[c==null?void 0:c(x),s.jsx("span",{className:"smwb-accordion__title",children:n}),!m&&(o!=null?o:s.jsx(G,{className:j,name:"expand_more",size:24}))]}),d&&s.jsx("div",{id:v,role:"region","aria-labelledby":S,children:s.jsx(Ar,{height:x?"auto":0,animateOpacity:!0,duration:300,className:"smwb-accordion__content",children:d})})]})}),Ae=i.forwardRef(function(t,n){const{label:r,variant:a="contained",icon:u,iconProps:o={},href:l,className:d,disabled:c,children:m,onMouseDown:h,fullWidth:b,rippleCenter:f,disableRipple:w,size:p="medium",colorTheme:_="primary",color:x,...g}=t,v=x!=null?x:_,S=i.useRef(null),j=M=>{h==null||h(M)},C=M=>{var E;c||(E=S.current)==null||E.onRipple(M)},R=y("smwb-button",`smwb-${a}`,`smwb-${p}`,v==="primary"?"smwb-primary":`smwb-button_color-${v}`,d,{"smwb-disabled":c,"smwb-full-width":b}),k=!w&&s.jsx(Be,{actionRef:S,center:f}),N=typeof u=="string"?s.jsx(G,{...o,name:u}):u;return l?s.jsxs("a",{"data-testid":"button-link",ref:n,className:R,href:l,target:"_blank",rel:"noreferrer",onMouseDown:j,onPointerDown:C,...g,children:[u&&N,r||m,k]}):s.jsxs("button",{"data-testid":"button",ref:n,className:R,onMouseDown:j,onPointerDown:C,disabled:!!c,...g,children:[u&&N,r||m,k]})}),Fr={expandRow:"Expand to full row",collapseRow:"Collapse to grid",expandFullscreen:"Expand to fullscreen",closeFullscreen:"Close fullscreen",placeholder:"Panel is open in fullscreen",placeholderClose:"Close"},ys=(e,t)=>typeof e=="function"?e(t):e,Lr=(e,t)=>typeof e=="function"?e(t):e,Pr=i.forwardRef(function({className:t,header:n,mode:r,defaultMode:a="tile",onModeChange:u,disableExpand:o=!1,noControls:l=!1,renderControls:d,closeOnOutsideClick:c=!0,closeOnEsc:m=!0,labels:h,children:b},f){const[w,p]=$e({value:r,defaultValue:a,onChange:u}),_={...Fr,...h},[x,g]=i.useState();ke(()=>{g(document.body)},[]);const v=o?"tile":w,S=v==="row",j=v==="fullscreen",C=()=>p(I=>I==="row"?"tile":"row"),R=()=>p("fullscreen"),k=()=>p("tile"),N=I=>({mode:v,isFullscreen:I,isFullRow:I?!1:S,setMode:p,toggleRow:C,openFullscreen:R,closeFullscreen:k,labels:_}),M=I=>I?s.jsx(Ae,{type:"button",variant:"outlined",size:"small","aria-label":_.closeFullscreen,title:_.closeFullscreen,onClick:k,"data-testid":"expansion-panel-close",icon:s.jsx(G,{name:"close",size:18})}):s.jsxs(s.Fragment,{children:[s.jsx(Ae,{type:"button",variant:"outlined",size:"small","aria-pressed":S,"aria-label":S?_.collapseRow:_.expandRow,title:S?_.collapseRow:_.expandRow,onClick:C,"data-testid":"expansion-panel-row",icon:s.jsx(G,{name:S?"grid_view":"table_rows",size:18})}),s.jsx(Ae,{type:"button",variant:"outlined",size:"small","aria-label":_.expandFullscreen,title:_.expandFullscreen,onClick:R,"data-testid":"expansion-panel-fullscreen",icon:s.jsx(G,{name:"open_in_full",size:18})})]}),E=I=>{if(o||l)return null;const Y=d?Lr(d,N(I)):M(I);return Y?s.jsx("div",{className:"smwb-expansion-panel__controls",children:Y}):null};i.useEffect(()=>{if(!j)return;const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[j]),i.useEffect(()=>{if(!j||!m)return;const I=Y=>{Y.key==="Escape"&&p("tile")};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[j,m,p]);const T=s.jsxs("div",{ref:f,className:y("smwb-expansion-panel",{"smwb-expansion-panel_row":S},t),"data-testid":"expansion-panel",children:[s.jsxs("div",{className:"smwb-expansion-panel__head",children:[s.jsx("div",{className:"smwb-expansion-panel__header",children:n}),E(!1)]}),s.jsx("div",{className:"smwb-expansion-panel__body",children:ys(b,{mode:v,isFullscreen:!1,isFullRow:S})})]});return!j||!x?T:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"smwb-expansion-panel__placeholder","data-testid":"expansion-panel-placeholder",children:[s.jsx("span",{children:_.placeholder}),s.jsx(Ae,{type:"button",variant:"outlined",size:"small",label:_.placeholderClose,onClick:()=>p("tile")})]}),Fe.createPortal(s.jsx("div",{className:"smwb-expansion-panel__overlay smwb-dark",role:"dialog","aria-modal":"true","data-testid":"expansion-panel-overlay",onClick:c?I=>{I.target===I.currentTarget&&p("tile")}:void 0,children:s.jsxs("div",{className:"smwb-expansion-panel__dialog",children:[s.jsxs("div",{className:"smwb-expansion-panel__head",children:[s.jsx("div",{className:"smwb-expansion-panel__header",children:n}),E(!0)]}),s.jsx("div",{className:"smwb-expansion-panel__body smwb-expansion-panel__body_fullscreen",children:ys(b,{mode:v,isFullscreen:!0,isFullRow:!1})})]})}),x)]})});function st({className:e,children:t,disabled:n,edge:r,color:a="default",onMouseDown:u,...o}){const l=i.useRef(null),d=m=>{u==null||u(m)},c=m=>{var h;n||(h=l.current)==null||h.onRipple(m)};return s.jsxs("button",{type:"button",className:y("smwb-chat-icon-button",r==="start"&&"smwb-chat-icon-button_edge-start",r==="end"&&"smwb-chat-icon-button_edge-end",a==="primary"&&"smwb-chat-icon-button_primary",n&&"smwb-chat-icon-button_disabled",e),disabled:n,onMouseDown:d,onPointerDown:c,...o,children:[t,n?null:s.jsx(Be,{actionRef:l,center:!0})]})}const Mt=i.forwardRef(function({children:t,className:n,onMouseDown:r,variant:a="default",size:u="medium",color:o="primary",type:l="button",...d},c){const m=i.useRef(null),h=f=>{r==null||r(f)},b=f=>{var w;(w=m.current)==null||w.onRipple(f)};return s.jsxs("button",{ref:c,type:l,className:y("smwb-fab",`smwb-${a}`,`smwb-${u}`,`smwb-fab_color-${o}`,n),onMouseDown:h,onPointerDown:b,...d,children:[t,s.jsx(Be,{actionRef:m})]})});function js(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Or(e){return e&&(js(e.value)&&e.value!==""||js(e.defaultValue)&&e.defaultValue!=="")}function Vt({position:e,variant:t,children:n,className:r,disablePointerEvents:a,inline:u}){const o=y("smwb-text-field__adornment",r,e==="start"&&"smwb-text-field__adornment--start",e==="end"&&"smwb-text-field__adornment--end",a&&"smwb-text-field__adornment--disable-pointer",!u&&t==="filled"&&"smwb-text-field__adornment--filled",typeof n=="string"&&"smwb-text-field__adornment--text");return s.jsx("span",{className:o,children:n})}function Ye({label:e,helperText:t=s.jsx(s.Fragment,{children:" "}),variant:n,disabled:r,className:a,error:u,fullWidth:o,isFilledState:l,isFocused:d,htmlFor:c,shrink:m,children:h,onHolderMouseDown:b,startAdornment:f,endAdornment:w,inline:p,..._}){const x=n==="filled",g=e&&(l||d||m),v=y(a,"smwb-text-field",{"smwb-text-field--filled":!p&&x,"smwb-text-field--inline":p,"smwb-text-field--focused":!p&&d,"smwb-text-field--error":u,"smwb-text-field--disabled":r,"smwb-text-field--full-width":o}),S=y("smwb-text-field__label",{"smwb-text-field__label--shrink":g}),j=y("smwb-text-field__notched",{"smwb-text-field__notched--with-label":e,"smwb-text-field__notched--active":g});return s.jsxs("div",{className:v,..._,"data-testid":"text-field",children:[!p&&e&&s.jsx("label",{className:S,htmlFor:c||"",children:e}),s.jsxs("div",{className:"smwb-text-field__input-holder",onMouseDown:b,children:[f&&s.jsx(Vt,{variant:n,inline:!!p,position:"start",children:f}),h,w&&s.jsx(Vt,{position:"end",children:w}),!p&&n==="outlined"&&s.jsx("fieldset",{className:j,children:s.jsx("legend",{children:e?s.jsx("span",{children:e}):s.jsx("span",{className:"smwb-notranslate",children:""})})})]}),!p&&t&&s.jsx("p",{className:"smwb-text-field__helper-line",children:s.jsx("span",{className:"smwb-text-field__helper-text",children:t})})]})}const Ke=i.forwardRef(function(t,n){const{label:r,helperText:a,variant:u="outlined",size:o="medium",required:l,className:d,disabled:c,value:m,defaultValue:h,onChange:b,onFocus:f,onBlur:w,error:p,name:_,type:x="text",readOnly:g,placeholder:v,fullWidth:S,id:j,startAdornment:C,endAdornment:R,inline:k,autoComplete:N,inputMode:M,...E}=t,[T,I]=i.useState(!1),[Y,$]=i.useState(!1),{current:D}=i.useRef(m!=null),F=i.useRef(null),A=Ne(n,F),W=L=>{if(c){L.stopPropagation();return}f==null||f(L),I(!0)},oe=L=>{if(!D){const B=L.target||F.current;Z({value:B.value})}w==null||w(L,t),I(!1)},Z=i.useCallback(L=>{const B=!!Or(L);$(U=>U===B?U:B)},[]),he=L=>{if(!D){const B=L.target||F.current;Z({value:B.value})}b==null||b(L,t)},ee=L=>{F.current&&L.currentTarget===L.target&&(L.preventDefault(),F.current.focus())};i.useEffect(()=>{c&&T&&I(!1)},[c,T]),i.useEffect(()=>{D||Z(F.current)}),ke(()=>{D&&Z({value:m})},[m,D,Z]);const ae=y("smwb-text-field__input",(!r||k)&&"smwb-text-field__input--show-placeholder",C&&"smwb-text-field__input--adornment-start",R&&"smwb-text-field__input--adornment-end",k&&"smwb-text-field__input--inline");return s.jsx(Ye,{label:r,helperText:a,variant:u,disabled:c,className:y(d,o!=="medium"&&`smwb-text-field_size-${o}`),error:p,fullWidth:S,isFilledState:Y,isFocused:T,htmlFor:j,shrink:!!C,onHolderMouseDown:ee,startAdornment:C,endAdornment:R,inline:k,...E,children:s.jsx("input",{type:x,defaultValue:h,name:_,readOnly:g,required:l,"aria-invalid":p||void 0,"aria-required":l||void 0,placeholder:v,disabled:c,value:m,className:ae,ref:A,onChange:he,onFocus:W,onBlur:oe,id:j,autoComplete:N,inputMode:M})})}),Qs=["pending","sent","delivered","read"],en={pending:"progress_activity",sent:"check",delivered:"done_all",read:"done_all"},tn={pending:"В обработке",sent:"Отправлено",delivered:"Доставлено",read:"Прочитано"},es=["floating","fullHeight","fullscreen"],sn=10;function ts(e){return Qs.includes(e)}function nn(e,t){const n=t==null?void 0:t[e];if(n)return n;if(ts(e))return en[e]}function rn(e){return ts(e)?tn[e]:String(e)}function an(e){var t;return(t=e.mimeType)!=null&&t.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name)}function on(e){if(!e)return"";const t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?String(e):new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(t)}function ss(e){return e==null?["floating"]:e.length===0?[]:es.filter(t=>e.includes(t))}function ks(e,t){var n;return t&&t!=="closed"&&e.includes(t)?t:(n=e[0])!=null?n:"floating"}function ln(e,t){return ss(e).filter(n=>n!=="closed"&&n!==t)}function zr(e){return e.showCloseButton===!1?!1:e.showCloseButton===!0||e.overlayContext&&e.floatingTrigger&&!e.embedded&&(e.effectiveLayout==="floating"||e.effectiveLayout==="fullHeight")?!0:!!(e.floatingTrigger&&!e.embedded&&e.effectiveLayout==="floating")}function cn(e,t={}){if(e.key!=="Enter")return!1;const{shiftEnterNewline:n=!0,ctrlEnterNewline:r=!0}=t,a=e.ctrlKey||e.metaKey;return!!(n&&e.shiftKey&&!a||r&&a&&!e.shiftKey)}function At(e){e.stopPropagation()}function Br(e,t,n){var o,l;const r=(o=e.selectionStart)!=null?o:t.length,a=(l=e.selectionEnd)!=null?l:t.length,u=`${t.slice(0,r)}
|
|
2
|
+
${t.slice(a)}`;n(u),requestAnimationFrame(()=>{e.selectionStart=r+1,e.selectionEnd=r+1})}function un({className:e,onSendMessage:t,placeholder:n="message",disabled:r=!1,sendAriaLabel:a="Send message",shiftEnterNewline:u=!0,ctrlEnterNewline:o=!0,fileUpload:l=!1,attachInputId:d,onAttachClick:c,attachAriaLabel:m="Attach file"}){const[h,b]=i.useState(""),[f,w]=i.useState(!1),p=i.useId(),_=i.useRef(null),x=u||o,g=!!t&&h.trim().length>0&&!r,v=l&&!!(d||c),S=()=>{if(!t)return;const M=h.trim();!M||r||(t(M),b(""))},j=M=>{if(cn(M,{shiftEnterNewline:u,ctrlEnterNewline:o})){M.currentTarget instanceof HTMLTextAreaElement&&(M.preventDefault(),Br(M.currentTarget,h,b));return}M.key==="Enter"&&(M.preventDefault(),S())},C=y("smwb-chat-icon-button","smwb-chat-icon-button_edge-start",r&&"smwb-chat-icon-button_disabled"),R=v?d?s.jsx("label",{htmlFor:r?void 0:d,className:C,"aria-label":m,"aria-disabled":r||void 0,"data-testid":"chat-composer-attach",onMouseDown:At,children:s.jsx(G,{name:"attach_file",size:24})}):s.jsx(st,{edge:"start","aria-label":m,"data-testid":"chat-composer-attach",disabled:r,onClick:c,onMouseDown:At,children:s.jsx(G,{name:"attach_file",size:24})}):null,k=t?s.jsx(st,{edge:"end",color:"primary","aria-label":a,"data-testid":"chat-composer-send",disabled:!g,onClick:S,onMouseDown:At,children:s.jsx(G,{name:"send",size:24})}):null;if(v&&!t)return s.jsx("div",{className:y("smwb-chat-composer","smwb-chat-composer_attach-only",e),"data-testid":"chat-composer",children:R});if(!x)return s.jsx(Ke,{className:y("smwb-chat-composer",e),"data-testid":"chat-composer",fullWidth:!0,value:h,disabled:r,placeholder:n,onChange:M=>b(M.target.value),startAdornment:R,endAdornment:k,onKeyDown:j});const N=M=>{_.current&&M.currentTarget===M.target&&(M.preventDefault(),_.current.focus())};return s.jsx(Ye,{className:y("smwb-chat-composer",e),"data-testid":"chat-composer",fullWidth:!0,disabled:r,isFilledState:h.length>0,isFocused:f,htmlFor:p,shrink:!!R,onHolderMouseDown:N,startAdornment:R,endAdornment:k,children:s.jsx("textarea",{id:p,ref:_,className:y("smwb-text-field__input","smwb-chat-composer__input","smwb-text-field__input--show-placeholder",R&&"smwb-text-field__input--adornment-start",k&&"smwb-text-field__input--adornment-end"),value:h,disabled:r,placeholder:n,rows:1,onChange:M=>b(M.target.value),onFocus:()=>w(!0),onBlur:()=>w(!1),onKeyDown:j})})}const Hr={floating:"picture_in_picture",fullHeight:"fit_screen",fullscreen:"open_in_full"},Vr={floating:"Floating window",fullHeight:"Full height",fullscreen:"Fullscreen"};function dn({className:e,title:t,subtitle:n,actions:r,layout:a,allowedLayouts:u=["floating"],onLayoutChange:o,onClose:l}){const d=ln(u,a),c=!!o&&d.length>0;return s.jsxs("div",{className:y("smwb-chat-header",e),"data-testid":"chat-header",children:[s.jsxs("div",{className:"smwb-chat-header__main",children:[t?s.jsx("div",{className:"smwb-chat-header__title",children:t}):null,n?s.jsx("div",{className:"smwb-chat-header__subtitle",children:n}):null]}),s.jsxs("div",{className:"smwb-chat-header__actions",children:[r,c?d.map(m=>s.jsx(st,{"aria-pressed":a===m,"aria-label":Vr[m],"data-testid":`chat-layout-${m}`,onClick:()=>o==null?void 0:o(m),children:s.jsx(G,{name:Hr[m],size:18})},m)):null,l?s.jsx(st,{"aria-label":"Close chat","data-testid":"chat-close",onClick:l,children:s.jsx(G,{name:"close",size:18})}):null]})]})}const Yr={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",caption:"span",overline:"span",button:"span"},Xe=i.forwardRef(function({variant:t="body1",color:n="inherit",align:r,gutterBottom:a,noWrap:u,component:o,className:l,children:d,...c},m){const h=o!=null?o:Yr[t];return s.jsx(h,{ref:m,className:y("smwb-typography",`smwb-typography_${t}`,n!=="inherit"&&`smwb-typography_color-${n}`,r&&`smwb-typography_align-${r}`,{"smwb-typography_gutter":a,"smwb-typography_nowrap":u},l),...c,children:d})});function mn({attachment:e,className:t}){const[n,r]=i.useState(!1),[a,u]=i.useState(),o=i.useRef(null);return ke(()=>{u(document.body)},[]),e.url?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:y("smwb-chat-attachment-image",t),onClick:()=>r(!0),"data-testid":"chat-attachment-image","aria-label":e.name,children:s.jsx("img",{src:e.url,alt:e.name,className:"smwb-chat-attachment-image__img"})}),a?Fe.createPortal(s.jsx(Ue.CSSTransition,{in:n,timeout:150,mountOnEnter:!0,unmountOnExit:!0,nodeRef:o,classNames:{enterActive:"smwb-chat-attachment-image__overlay_enter-active",enterDone:"smwb-chat-attachment-image__overlay_enter-done"},children:s.jsx("div",{ref:o,className:"smwb-chat-attachment-image__overlay smwb-dark",role:"dialog","aria-modal":"true","aria-label":e.name,"data-testid":"chat-attachment-image-overlay",onClick:()=>r(!1),children:s.jsx("img",{src:e.url,alt:e.name,className:"smwb-chat-attachment-image__overlay-img",onClick:l=>l.stopPropagation()})})}),a):null]}):null}function fn({attachments:e,className:t,enabled:n=!0}){return!n||!(e!=null&&e.length)?null:s.jsx("div",{className:y("smwb-chat-attachments",t),"data-testid":"chat-attachments",children:e.map(r=>an(r)?s.jsx(mn,{attachment:r},r.id):s.jsx("a",{className:"smwb-chat-attachments__file",href:r.url,download:r.name,target:"_blank",rel:"noreferrer","data-testid":"chat-attachment-file",children:r.name},r.id))})}const Ns=e=>typeof e=="string",ns=i.forwardRef(function({className:t,src:n,alt:r,size:a="medium",variant:u="circular",color:o,style:l,imgProps:d,children:c,...m},h){const[b,f]=i.useState(!1),w=!!n&&!b,p=y("smwb-avatar",`smwb-avatar_${u}`,Ns(a)?`smwb-avatar_${a}`:null,t),_={...l,...Ns(a)?{}:{width:a,height:a,fontSize:a/2.5},...o&&!w?{backgroundColor:o}:{}};return s.jsx("div",{ref:h,...m,"data-testid":"avatar",className:p,style:_,children:w?s.jsx("img",{...d,className:y("smwb-avatar__img",d==null?void 0:d.className),src:n,alt:r,onError:x=>{var g;f(!0),(g=d==null?void 0:d.onError)==null||g.call(d,x)}}):s.jsx("span",{className:"smwb-avatar__fallback",role:"img","aria-label":r,children:c})})}),Kr=i.forwardRef(function({className:t,max:n=5,total:r,onSurplusClick:a,children:u,...o},l){const d=i.Children.toArray(u).filter(i.isValidElement),c=r!=null?r:d.length,m=Math.max(n,1),h=d.slice(0,m),b=c-h.length;return s.jsxs("div",{ref:l,...o,"data-testid":"avatar-group",className:y("smwb-avatar-group",t),children:[b>0?s.jsx(ns,{className:"smwb-avatar-group__surplus",onClick:a,style:a?{cursor:"pointer"}:void 0,children:`+${b}`}):null,h]})});function Yt({author:e,enabled:t=!0,className:n}){var r,a;return t?s.jsx("div",{className:y("smwb-chat-message__avatar",n),"data-testid":"chat-message-avatar",children:s.jsx(ns,{src:e==null?void 0:e.avatarSrc,alt:(r=e==null?void 0:e.avatarAlt)!=null?r:e==null?void 0:e.name,size:"small",children:(a=e==null?void 0:e.name)==null?void 0:a.slice(0,1)})}):null}function hn({className:e,message:t,status:n,statusIcons:r,renderStatus:a}){if(a){const d=a({message:t,status:n});if(d!=null)return s.jsx("span",{className:y("smwb-chat-message__status",`smwb-chat-message__status_${n}`,e),"data-testid":"chat-message-status",children:d})}const u=nn(n,r);if(!u)return null;const o=rn(n),l=n==="read";return s.jsx("span",{className:y("smwb-chat-message__status",`smwb-chat-message__status_${n}`,e),"data-testid":"chat-message-status","aria-label":o,title:o,children:s.jsx(G,{name:u,size:14,fill:l?1:0})})}function rs({className:e,align:t,message:n,author:r,text:a,attachments:u,timestamp:o,status:l,showAvatars:d=!1,showAttachments:c=!1,showStatus:m=!1,statusIcons:h,renderStatus:b,bubbleClassName:f}){const w=on(o),p=l!=null?l:n.status,_=m&&t==="end"&&p;return s.jsxs("div",{className:y("smwb-chat-message",`smwb-chat-message_${t}`,e),"data-testid":`chat-message-${t}`,children:[t==="start"?s.jsx(Yt,{author:r,enabled:d}):null,s.jsxs("div",{className:"smwb-chat-message__content",children:[r!=null&&r.name?s.jsx(Xe,{variant:"caption",className:"smwb-chat-message__author",children:r.name}):null,s.jsxs("div",{className:y("smwb-chat-message__bubble",f),children:[a?s.jsx("div",{className:"smwb-chat-message__text",children:a}):null,s.jsx(fn,{attachments:u,enabled:c})]}),w||_?s.jsxs("div",{className:"smwb-chat-message__meta","data-testid":"chat-message-meta",children:[w?s.jsx(Xe,{variant:"caption",className:"smwb-chat-message__time",children:w}):null,_?s.jsx(hn,{message:n,status:p,statusIcons:h,renderStatus:b}):null]}):null]}),t==="end"?s.jsx(Yt,{author:r,enabled:d}):null]})}function bn({message:e,showAvatars:t,showAttachments:n,className:r}){return s.jsx(rs,{className:r,align:"start",message:e,author:e.author,text:e.text,attachments:e.attachments,timestamp:e.timestamp,showAvatars:t,showAttachments:n,bubbleClassName:"smwb-chat-message__bubble_incoming"})}function wn({message:e,showAvatars:t,showAttachments:n,showStatus:r,statusIcons:a,renderStatus:u,className:o}){return s.jsx(rs,{className:o,align:"end",message:e,author:e.author,text:e.text,attachments:e.attachments,timestamp:e.timestamp,status:e.status,showAvatars:t,showAttachments:n,showStatus:r,statusIcons:a,renderStatus:u,bubbleClassName:"smwb-chat-message__bubble_outgoing"})}function pn({message:e,className:t}){var r;const n=(r=e.content)!=null?r:e.text;return n?s.jsx("div",{className:y("smwb-chat-message-system",t),"data-testid":"chat-message-system",children:s.jsx(Xe,{variant:"caption",children:n})}):null}function _n({message:e,showAvatars:t,showAttachments:n,showStatus:r,statusIcons:a,renderStatus:u,className:o,renderMessage:l}){var c;const d={showAvatars:t,showAttachments:n,showStatus:r,statusIcons:a,renderStatus:u};if(l)return s.jsx("div",{className:y("smwb-chat-message-item",o),children:l(e,d)});switch(e.variant){case"outgoing":return s.jsx(wn,{message:e,showAvatars:t,showAttachments:n,showStatus:r,statusIcons:a,renderStatus:u,className:o});case"system":return s.jsx(pn,{message:e,className:o});case"custom":return s.jsx("div",{className:y("smwb-chat-message-item","smwb-chat-message-item_custom",o),"data-testid":"chat-message-custom",children:(c=e.content)!=null?c:e.text});case"incoming":default:return s.jsx(bn,{message:e,showAvatars:t,showAttachments:n,className:o})}}const Rs=e=>typeof e=="number"?`${e}px`:e,dt=i.forwardRef(function({className:t,variant:n="text",width:r,height:a,animation:u="pulse",count:o=1,animationDelay:l,component:d="span",style:c,...m},h){const b=y("smwb-skeleton",`smwb-skeleton_${n}`,u===!1?"smwb-skeleton_no-animation":`smwb-skeleton_${u}`,t),f=d,w=p=>{const _={...c,width:Rs(r),height:Rs(a),...l?{animationDelay:`${p*l}ms`}:{}};return s.jsx(f,{ref:o===1?h:void 0,...o===1?m:{},"data-testid":"skeleton","aria-hidden":"true",className:b,style:_},p)};return o===1?w(0):s.jsx("span",{ref:h,...m,className:"smwb-skeleton__group","aria-hidden":"true",children:Array.from({length:o},(p,_)=>w(_))})});function gn({className:e,align:t="start",showAvatar:n=!1,lines:r=2}){const a=t==="start"?"72%":"64%";return s.jsxs("div",{className:y("smwb-chat-message",`smwb-chat-message_${t}`,"smwb-chat-message-skeleton",e),"data-testid":"chat-message-skeleton","aria-hidden":"true",children:[t==="start"&&n?s.jsx(dt,{variant:"circular",width:32,height:32}):null,s.jsx("div",{className:"smwb-chat-message__content",children:s.jsxs("div",{className:"smwb-chat-message-skeleton__bubble",children:[s.jsx(dt,{variant:"rounded",width:a,height:14}),r>1?s.jsx(dt,{variant:"rounded",width:"48%",height:14}):null]})}),t==="end"&&n?s.jsx(dt,{variant:"circular",width:32,height:32}):null]})}function xn({containerRef:e,onLoadMore:t,hasMore:n=!1,loading:r=!1,rootMargin:a="80px"}){const u=i.useRef(null),o=i.useRef(r);return o.current=r,i.useEffect(()=>{const l=e.current,d=u.current;if(!l||!d||!n||!t||typeof IntersectionObserver=="undefined")return;const c=new IntersectionObserver(m=>{m.some(h=>h.isIntersecting)&&!o.current&&t()},{root:l,rootMargin:a,threshold:0});return c.observe(d),()=>c.disconnect()},[e,n,t,a]),{sentinelRef:u}}function vn(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function Kt(e){e.scrollTop=e.scrollHeight}function yn({containerRef:e,messages:t,threshold:n=24}){const r=i.useRef(!0),a=i.useRef(0),u=i.useRef(),o=i.useRef();i.useEffect(()=>{const l=e.current;if(!l)return;const d=()=>{r.current=vn(l,n)};return d(),l.addEventListener("scroll",d,{passive:!0}),()=>l.removeEventListener("scroll",d)},[e,n]),ke(()=>{var f,w;const l=e.current;if(!l)return;const d=a.current,c=u.current,m=o.current,h=(f=t[0])==null?void 0:f.id,b=(w=t[t.length-1])==null?void 0:w.id;if(c===void 0)Kt(l),r.current=!0;else{const p=h!==void 0&&h!==c&&b===m,_=b!==void 0&&b!==m;p&&d>0?l.scrollTop+=l.scrollHeight-d:_&&r.current&&Kt(l)}a.current=l.scrollHeight,u.current=h,o.current=b},[e,t])}function jn({className:e,messages:t,showAvatars:n,showAttachments:r,showStatus:a,statusIcons:u,renderStatus:o,onLoadMore:l,hasMore:d=!1,loading:c=!1,loadingMore:m=!1,loadingSkeletonCount:h=3,renderMessage:b}){const f=i.useRef(null),{sentinelRef:w}=xn({containerRef:f,onLoadMore:l,hasMore:d,loading:m||c});yn({containerRef:f,messages:t});const p=c||m,_=x=>x%2===0?"start":"end";return s.jsxs("div",{ref:f,className:y("smwb-chat-messages",e),"data-testid":"chat-messages",children:[s.jsx("div",{ref:w,className:"smwb-chat-messages__sentinel","data-testid":"chat-messages-sentinel"}),p?s.jsx("div",{className:"smwb-chat-messages__skeletons","data-testid":"chat-messages-skeletons","aria-busy":"true","aria-label":"Loading messages",children:Array.from({length:h},(x,g)=>s.jsx(gn,{align:_(g),showAvatar:n,lines:g%2===0?2:1},g))}):null,c?null:t.map(x=>s.jsx(_n,{message:x,showAvatars:n,showAttachments:r,showStatus:a,statusIcons:u,renderStatus:o,renderMessage:b},x.id))]})}function kn({className:e,layout:t,anchor:n="bottom-right",themeMode:r="inherit",embedded:a=!1,overlayContext:u=!1,header:o,footer:l,children:d,fileDropzoneRootProps:c,fileDropzoneActive:m=!1}){const[h,b]=i.useState();if(ke(()=>{b(document.body)},[]),i.useEffect(()=>{if(t!=="fullscreen")return;const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=_}},[t]),t==="closed")return null;const{className:f,...w}=c!=null?c:{},p=s.jsxs("div",{...w,className:y("smwb-chat-shell",`smwb-chat-shell_${t}`,!a&&`smwb-chat-shell_${n}`,{"smwb-dark":r==="dark","smwb-chat-shell_embedded":a,"smwb-chat-shell_overlay-context":u,"smwb-chat-dropzone_active":m},f,e),"data-testid":"chat-shell","data-layout":t,children:[o?s.jsx("div",{className:"smwb-chat-shell__header",children:o}):null,s.jsx("div",{className:"smwb-chat-shell__body",children:d}),l?s.jsx("div",{className:"smwb-chat-shell__footer",children:l}):null]});return t==="fullscreen"&&h?Fe.createPortal(p,h):p}function Nn(e){return e==null?sn:Math.max(1,e)}function Rn({enabled:e=!1,accept:t,maxFiles:n,onUploadFiles:r,disabled:a=!1}){const u=Nn(n),o=e&&!!r&&!a,{getRootProps:l,getInputProps:d,open:c,isDragActive:m,inputRef:h}=St({accept:t,maxFiles:u,multiple:u>1,disabled:!o,onDropAccepted:p=>{r&&r(p)}});return{enabled:o,maxFiles:u,getRootProps:()=>{const{onClick:p,..._}=l();return _},getInputProps:p=>({...d(),...p!=null?p:{}}),open:()=>{c()},inputRef:h,isDragActive:m}}function Xt({className:e,messages:t,showAvatars:n=!1,showAttachments:r=!1,headerTitle:a,headerSubtitle:u,headerActions:o,footer:l,children:d,anchor:c="bottom-right",themeMode:m="inherit",allowedLayouts:h,layout:b,defaultLayout:f,onLayoutChange:w,open:p,defaultOpen:_=!1,onOpenChange:x,floatingTrigger:g=!1,triggerIcon:v,triggerLabel:S,onLoadMore:j,hasMore:C,onSendMessage:R,composerPlaceholder:k="message",composerDisabled:N,composerShiftEnterNewline:M=!0,composerCtrlEnterNewline:E=!0,fileUpload:T=!1,onUploadFiles:I,fileUploadAccept:Y,fileUploadMaxFiles:$,attachAriaLabel:D,loading:F,loadingMore:A,loadingSkeletonCount:W,renderMessage:oe,embedded:Z=!1,overlayContext:he=!1,showStatus:ee=!1,statusIcons:ae,renderStatus:L,showCloseButton:B}){var Te;const U=i.useMemo(()=>ss(h!=null?h:es),[h]),[te,q]=$e({value:p,defaultValue:_,onChange:x}),[ie,ce]=$e({value:b,defaultValue:ks(U,f),onChange:w}),ue=Z?"fullHeight":g?te?ie:"closed":ie,_e=()=>{q(!0),ie==="closed"&&ce(ks(U,f))},se=()=>{q(!1)},be=X=>{q(!0),ce(X)},{enabled:Q,getRootProps:fe,getInputProps:P,isDragActive:K}=Rn({enabled:T,accept:Y,maxFiles:$,onUploadFiles:I,disabled:N}),de=i.useId(),ne=!!R||Q,H=Q?s.jsx("input",{...P({id:de}),"data-testid":"chat-file-input"}):null,le=(Te=l!=null?l:d)!=null?Te:ne?s.jsxs(s.Fragment,{children:[H,s.jsx(un,{onSendMessage:R,placeholder:k,disabled:N,shiftEnterNewline:M,ctrlEnterNewline:E,fileUpload:Q,attachInputId:Q?de:void 0,attachAriaLabel:D})]}):void 0,Re=s.jsx(jn,{messages:t,showAvatars:n,showAttachments:r,showStatus:ee,statusIcons:ae,renderStatus:L,onLoadMore:j,hasMore:C,loading:F,loadingMore:A,loadingSkeletonCount:W,renderMessage:oe}),De=Q?fe():void 0,Ee=zr({floatingTrigger:g,embedded:Z,overlayContext:he,effectiveLayout:ue,showCloseButton:B});return s.jsxs("div",{className:y("smwb-chat",!Z&&`smwb-chat_${c}`,Z&&"smwb-chat_embedded",he&&"smwb-chat_overlay-context",e),"data-testid":"chat",children:[g&&!Z&&!te?s.jsx(Mt,{className:"smwb-chat__trigger","aria-label":S!=null?S:"Open chat","data-testid":"chat-trigger",onClick:_e,children:v!=null?v:s.jsx(G,{name:"chat",size:24})}):null,s.jsx(kn,{layout:ue,anchor:c,themeMode:m,embedded:Z,overlayContext:he,fileDropzoneRootProps:De,fileDropzoneActive:Q&&K,header:s.jsx(dn,{title:a,subtitle:u,actions:o,layout:ue==="closed"?ie:ue,allowedLayouts:U,onLayoutChange:be,onClose:Ee?se:void 0}),footer:le,children:Re})]})}const Xr=e=>typeof e=="number"?`${e}px`:e,Ur=e=>e==="left"?"bottom-left":"bottom-right";function Wr({className:e,contentClassName:t,chatClassName:n,side:r="right",chatWidth:a=400,collapsed:u,defaultCollapsed:o=!1,onCollapsedChange:l,collapseAriaLabel:d="Collapse chat panel",expandAriaLabel:c="Expand chat panel",floatingAnchor:m,chat:h,children:b,style:f,...w}){const[p,_]=$e({value:u,defaultValue:o,onChange:l}),[x,g]=$e({defaultValue:!1});i.useEffect(()=>{p||g(!1)},[p,g]);const v=m!=null?m:Ur(r),S=r==="left"?"dock_to_left":"dock_to_right",j=r==="left"?"left_panel_close":"right_panel_close",C=s.jsx(st,{"aria-label":d,"data-testid":"chat-layout-collapse",onClick:()=>_(!0),children:s.jsx(G,{name:j,size:18})}),R=s.jsx(st,{"aria-label":c,"data-testid":"chat-layout-expand",onClick:()=>_(!1),children:s.jsx(G,{name:S,size:18})}),k=s.jsxs(s.Fragment,{children:[h.headerActions,C]}),N=s.jsxs(s.Fragment,{children:[h.headerActions,R]}),M={"--smwb-chat-layout-w":Xr(a)};if(p)return s.jsxs("div",{className:y("smwb-chat-layout","smwb-chat-layout_collapsed",e),style:{...M,...f},"data-testid":"chat-layout","data-collapsed":"true",...w,children:[s.jsx("div",{className:y("smwb-chat-layout__content",t),"data-testid":"chat-layout-content",children:b}),s.jsx(Xt,{...h,className:n,floatingTrigger:!0,anchor:v,allowedLayouts:["floating"],layout:"floating",open:x,onOpenChange:g,headerActions:N})]});const E=s.jsx("aside",{className:"smwb-chat-layout__panel","data-testid":"chat-layout-panel",children:s.jsx(Xt,{...h,className:n,embedded:!0,allowedLayouts:[],headerActions:k})});return s.jsxs("div",{className:y("smwb-chat-layout",`smwb-chat-layout_${r}`,e),style:{...M,...f},"data-testid":"chat-layout","data-collapsed":"false",...w,children:[r==="left"?E:null,s.jsx("div",{className:y("smwb-chat-layout__content",t),"data-testid":"chat-layout-content",children:b}),r==="right"?E:null]})}const Gr=i.forwardRef(function({className:t,color:n="primary",badgeContent:r,variant:a="outside",vertical:u="top",horizontal:o="right",max:l,showZero:d=!1,badgeAriaLabel:c,children:m,...h},b){const f=r===0||r==="0",w=(r==null||f&&!d)===!0;let p=r;typeof r=="number"&&l!==void 0&&r>l&&(p=`${l}+`);const _=y("smwb-badge",`smwb-badge_${n}`,`smwb-badge_${a}`,`smwb-badge_${a}_${u}`,`smwb-badge_${a}_${u}_${o}`,t,{"smwb-badge_no-content":w});return s.jsxs("span",{className:"smwb-badge__wrapper","data-testid":"badge",children:[m,s.jsx("span",{ref:b,className:_,"aria-label":c,...h,children:w?null:p})]})}),qr=i.forwardRef(function({className:t,variant:n="elevated",children:r,disabled:a,title:u,footer:o,onClick:l,onKeyDown:d,...c},m){const h=!!l&&!a,b=f=>{d==null||d(f),h&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l==null||l(f))};return s.jsxs("div",{ref:m,"data-testid":"card",className:y("smwb-card",`smwb-card_${n}`,t,{card_disabled:a,"smwb-card_interactive":h}),role:h?"button":void 0,tabIndex:h?0:void 0,"aria-disabled":a||void 0,onClick:h?l:void 0,onKeyDown:b,...c,children:[u&&s.jsx("div",{className:"smwb-card__title",children:u}),r,o&&s.jsx("div",{className:"smwb-card__footer",children:o})]})}),as=i.forwardRef(function({label:t,className:n,deleteIcon:r,icon:a,onDelete:u,onMouseDown:o,onDeleteMouseDown:l,asLink:d,href:c,target:m="_blank",selected:h,variant:b="filled",size:f="medium",color:w="default",disabled:p=!1,onClick:_,deleteAriaLabel:x="Remove",...g},v){const S=i.useRef(null),j=T=>{o==null||o(T)},C=T=>{var I;p||(I=S.current)==null||I.onRipple(T)},R=T=>{l==null||l(T),T.stopPropagation()},k=y("smwb-chip",`smwb-${b}`,`smwb-chip_size-${f}`,w!=="default"&&`smwb-chip_color-${w}`,n,{"smwb-disabled":p,"smwb-selected":h}),N=!!u&&s.jsx("button",{type:"button",className:"smwb-chip__delete-icon","aria-label":x,disabled:p,onClick:u,onMouseDown:R,children:r||s.jsx(G,{name:"cancel",size:18,fill:1})}),M=s.jsxs(s.Fragment,{children:[a&&s.jsx("span",{className:"smwb-chip__icon",children:a}),s.jsx("span",{className:"smwb-chip__label",children:t}),N,s.jsx(Be,{actionRef:S})]});if(d&&c)return s.jsx("a",{ref:v,"data-testid":"chip-link",className:k,href:c,onMouseDown:j,onPointerDown:C,target:m,rel:"noreferrer",...g,children:M});const E=!!_&&!p;return s.jsx("span",{ref:v,"data-testid":"chip",className:k,role:E?"button":void 0,tabIndex:E?0:void 0,"aria-disabled":p||void 0,onClick:E?_:void 0,onKeyDown:E?T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),_==null||_())}:void 0,onMouseDown:j,onPointerDown:C,...g,children:M})});function Zr({options:e,value:t,multiple:n,onChange:r,size:a="medium",color:u="primary",disabled:o,className:l,...d}){const c=()=>t==null?[]:Array.isArray(t)?t:[t],m=b=>c().includes(b),h=b=>{if(n){const f=c(),w=f.includes(b)?f.filter(p=>p!==b):[...f,b];r==null||r(w)}else r==null||r(b)};return s.jsx("div",{...d,role:"group",className:y("smwb-chip-group",l),children:e.map(b=>s.jsx(as,{label:b.label,icon:b.icon,size:a,color:u,selected:m(b.value),variant:m(b.value)?"filled":"outlined",disabled:!!(o||b.disabled),onClick:()=>h(b.value)},b.value))})}const Cn=i.forwardRef(function({src:t,alt:n,fallback:r,lazy:a=!0,aspectRatio:u,className:o,onError:l,...d},c){const[m,h]=i.useState(!1),[b,f]=i.useState(!a),w=i.useRef(null),p=Ne(c,w);i.useEffect(()=>{if(!a||b)return;const g=w.current;if(!g)return;if(typeof IntersectionObserver=="undefined"){f(!0);return}const v=new IntersectionObserver(S=>{S.some(j=>j.isIntersecting)&&(f(!0),v.disconnect())});return v.observe(g),()=>v.disconnect()},[a,b]);const _=m||!t,x=g=>{h(!0),l==null||l(g)};return s.jsxs("span",{className:y("smwb-lazy-image",o,{"smwb-lazy-image--empty":_}),style:u!=null?{aspectRatio:String(u)}:void 0,children:[_&&r?s.jsx("span",{className:"smwb-lazy-image__fallback",children:r}):null,_?null:s.jsx("img",{...d,ref:p,className:"smwb-lazy-image__img",src:b?t:void 0,alt:n!=null?n:"",loading:a?"lazy":void 0,decoding:"async",onError:x})]})}),Jr=i.forwardRef(function({src:t,caption:n,selected:r,onSelect:a,fallback:u,hoverPreview:o,topStart:l,topEnd:d,lazy:c=!0,disabled:m,hoverDelay:h=350,className:b,...f},w){const p=i.useRef(null),_=Ne(w,p),[x,g]=i.useState(null),v=i.useRef(null),S=()=>{v.current&&(clearTimeout(v.current),v.current=null)},j=()=>{o==null||m||(S(),v.current=setTimeout(()=>{var M;const N=(M=p.current)==null?void 0:M.getBoundingClientRect();N&&g({top:N.top,left:N.right+8})},h))},C=()=>{S(),g(null)};i.useEffect(()=>S,[]);const R=!!a&&!m,k=N=>{R&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),a==null||a())};return s.jsxs("div",{...f,ref:_,className:y("smwb-thumb-card",b,{"smwb-thumb-card--selected":r,"smwb-thumb-card--disabled":m,"smwb-thumb-card--interactive":R}),role:R?"button":void 0,tabIndex:R?0:void 0,"aria-pressed":a?r!=null?r:!1:void 0,"aria-disabled":m||void 0,onClick:R?()=>a==null?void 0:a():void 0,onKeyDown:k,onMouseEnter:j,onMouseLeave:C,children:[s.jsxs("div",{className:"smwb-thumb-card__media",children:[s.jsx(Cn,{src:t,lazy:c,fallback:u}),l?s.jsx("div",{className:"smwb-thumb-card__slot smwb-thumb-card__slot--start",children:l}):null,d?s.jsx("div",{className:"smwb-thumb-card__slot smwb-thumb-card__slot--end",children:d}):null]}),n?s.jsx("div",{className:"smwb-thumb-card__caption",children:n}):null,x&&typeof document!="undefined"?Fe.createPortal(s.jsx("div",{className:"smwb-thumb-card__preview",style:{position:"fixed",top:x.top,left:x.left},children:typeof o=="string"?s.jsx("img",{src:o,alt:""}):o}),document.body):null]})});function Qr({items:e,renderItem:t,minColumn:n=160,rowHeight:r,gap:a=8,overscan:u=2,loading:o,loadingCount:l=12,emptyLabel:d,className:c,style:m}){const h=i.useRef(null),[b,f]=i.useState(0),[w,p]=i.useState(0),[_,x]=i.useState(!1);i.useEffect(()=>{const k=h.current;if(!k||typeof ResizeObserver=="undefined")return;const N=new ResizeObserver(()=>{f(k.clientWidth),p(k.clientHeight),x(!0)});return N.observe(k),()=>N.disconnect()},[]);const g=i.useMemo(()=>b<=0?1:Math.max(1,Math.floor((b+a)/(n+a))),[b,a,n]),v=Math.ceil(e.length/g),S=Jt({itemCount:v,itemHeight:r+a,viewportHeight:w||1,overscan:u}),j={display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr))`,gap:a,gridAutoRows:r},C={display:"grid",gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`,gap:a,height:r,marginBottom:a};let R;return o?R=s.jsx("div",{className:"smwb-asset-grid__plain",style:j,children:Array.from({length:l}).map((k,N)=>s.jsx("div",{className:"smwb-asset-grid__skeleton",style:{height:r}},N))}):e.length===0?R=s.jsx("div",{className:"smwb-asset-grid__empty",children:d}):_?R=s.jsx("div",{className:"smwb-asset-grid__sizer",style:{height:S.totalHeight,position:"relative"},children:s.jsx("div",{className:"smwb-asset-grid__band",style:{position:"absolute",top:0,left:0,right:0,transform:`translateY(${S.offsetY}px)`},children:Array.from({length:Math.max(0,S.endIndex-S.startIndex)}).map((k,N)=>{const M=S.startIndex+N;return s.jsx("div",{className:"smwb-asset-grid__row",style:C,children:Array.from({length:g}).map((E,T)=>{const I=M*g+T;return I<e.length?s.jsx(i.Fragment,{children:t(e[I],I)},T):null})},M)})})}):R=s.jsx("div",{className:"smwb-asset-grid__plain",style:j,children:e.map((k,N)=>s.jsx(i.Fragment,{children:t(k,N)},N))}),s.jsx("div",{ref:h,className:y("smwb-asset-grid",c),style:m,onScroll:S.onScroll,children:R})}const Sn="data-smwb-overlay-layer",ea=()=>typeof document=="undefined"?[]:Array.from(document.querySelectorAll(`[${Sn}]`)),ta=(e,t)=>typeof e.composedPath!="function"?!1:e.composedPath().some(n=>n instanceof Element&&n.hasAttribute(Sn)&&!n.contains(t)),Mn=e=>{if(!e)return!0;const t=ea(),n=t[t.length-1];return!n||n===e||n.contains(e)||e.contains(n)},sa=i.forwardRef(function({children:t,onClose:n,open:r,className:a,animation:u="fade",backdrop:o="dark",size:l="large",closeOnOutsideClick:d=!0,asForm:c=!1,disableAppearAnimation:m=!1,role:h="dialog",closeOnEsc:b=!0,...f},w){const[p,_]=i.useState(),x=i.useRef(null),g=i.useRef(null),v=Ne(w,g);if(ke(()=>{_(document.body)},[]),i.useEffect(()=>{if(!r||!b||!n)return;const j=C=>{C.key==="Escape"&&Mn(x.current)&&n()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[r,b,n]),!p)return s.jsx(s.Fragment,{});const S=c?"form":"div";return Fe.createPortal(s.jsx(Ue.CSSTransition,{timeout:{appear:225,enter:225,exit:150},in:r,classNames:{appear:"smwb-modal__overlay-appear",appearActive:"smwb-modal__overlay-appear-active",appearDone:"smwb-modal__overlay-appear-done",enter:"smwb-modal__overlay-enter",enterActive:"smwb-modal__overlay-enter-active",enterDone:"smwb-modal__overlay-enter-done",exit:"smwb-modal__overlay-exit",exitActive:"smwb-modal__overlay-exit-active"},appear:!m,mountOnEnter:!0,unmountOnExit:!0,nodeRef:x,children:s.jsx("div",{ref:x,"data-smwb-overlay-layer":"",className:y("smwb-modal__overlay",`smwb-${o}`,`smwb-${l}`),onClick:d&&n?n:void 0,children:s.jsx(S,{ref:v,className:y("smwb-modal",`smwb-${l}`,`smwb-${u}`,a),onClick:j=>j.stopPropagation(),role:h,"aria-modal":"true",...f,children:t})})}),p)});function na({className:e,children:t}){return s.jsx("div",{className:y("smwb-modal__header",e),children:t})}function ra({className:e,children:t}){return s.jsx("div",{className:y("smwb-modal__content",e),children:t})}function aa({className:e,children:t}){return s.jsx("div",{className:y("smwb-modal__footer",e),children:t})}const Ve=Object.assign(sa,{Footer:aa,Header:na,Content:ra});function ia(e,t){const n=Math.floor(e/t);return e%t===0?n-1:n}function Cs(e,t,n,r){const a=ia(n,t);return e===n+t?0:r||e<t&&e!==0?a:e===0?n%t===0?a:a-1:t>0?Math.floor(e/t)-1:0}function Dn(e){return!(e instanceof Event)}function kt(e){return Dn(e)&&e.nativeEvent instanceof MouseEvent||e instanceof MouseEvent}function is(e){return window.TouchEvent&&(Dn(e)&&e.nativeEvent instanceof TouchEvent||e instanceof TouchEvent)}function $t(e){return kt(e)?e.clientX:is(e)?e.changedTouches[0].clientX:0}function Ss(e){return kt(e)?e.clientY:is(e)?e.changedTouches[0].clientY:0}function Ms(e){const t=e.target;(t.tagName==="A"||t.tagName==="IMG")&&e.preventDefault()}function oa(e){return{width:`${Tn(e)}%`}}function Tn(e){return 100/e}function la(e,t){return e<=0||t===0?1:e>t?t:e}function ca(e,t,n){return Math.min(Math.max(e,t),n)}function Ft(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function ua(e){if(e!=null)return String(e)}function da(e,t){if(e<=0||t===0)return 0;const n=t-1;return e>n?n:e}function ze(e){const t=i.useRef(e);return ke(()=>{t.current=e}),i.useCallback((...n)=>(0,t.current)(...n),[])}const ma={isPressed:!1,startX:0,startY:0,lastX:0,lastT:0,axis:null,dragged:!1},Ds=8,fa=.4,ha=i.forwardRef(function({slidesToShow:t=3,startSlide:n=0,children:r,className:a,showNavigation:u=!0,showArrows:o,arrowsSize:l=30,navigationClassName:d,onSlideChange:c,navigationDotRenderer:m,"aria-label":h="Carousel",autoplay:b=!1,autoplayInterval:f=4e3,pauseOnHover:w=!0,cellHeight:p,aspectRatio:_,gap:x,maxWidth:g,enableFullscreen:v=!1},S){const j=i.Children.count(r),C=la(t,j),R=da(n,j),k=o&&j>1,N=Math.max(0,j-C),[M,E]=i.useState(R),[T,I]=i.useState({animation:void 0}),[Y,$]=i.useState(0),[D,F]=i.useState(!1),[A,W]=i.useState(null),[oe,Z]=i.useState(0),[he,ee]=i.useState(!1),ae=i.useRef(null),L=i.useRef(null),B=Ne(S,L),U=i.useRef(null),[te,q]=i.useState(!1),ie=i.useRef({...ma});ke(()=>{I(O=>({...O,animation:!1}))},[C]),ke(()=>{E(R),c==null||c(R),T.animation!==void 0&&I(O=>({...O,animation:!0}))},[R]);const ce=O=>{Object.assign(ie.current,O)},ue=()=>typeof performance!="undefined"?performance.now():Date.now(),_e=O=>{const J=ca(O,0,N);E(J),I(pe=>({...pe,animation:!0})),c==null||c(J)},se=O=>{W(J=>J===null?J:(J+O+j)%j)},be=i.useRef(null),Q=O=>{U.current&&(U.current.removeEventListener(O?"mousemove":"touchmove",P),U.current.removeEventListener(O?"mouseup":"touchend",K),O&&U.current.removeEventListener("mouseleave",K))},fe=ze(O=>{if(!U.current)return;const J=kt(O);if(J&&O.button!==0)return;O.stopPropagation();const pe=$t(O),ve=Ss(O);ce({isPressed:!0,startX:pe,startY:ve,lastX:pe,lastT:ue(),axis:null,dragged:!1}),U.current.addEventListener(J?"mousemove":"touchmove",P,{passive:!1}),U.current.addEventListener(J?"mouseup":"touchend",K),J&&U.current.addEventListener("mouseleave",K)}),P=ze(O=>{if(!ae.current||!ie.current.isPressed)return;if(is(O)&&O.touches.length>1)return K(O);const J=$t(O),pe=Ss(O),ve=J-ie.current.startX,je=pe-ie.current.startY;if(ie.current.axis===null){if(Math.abs(ve)<Ds&&Math.abs(je)<Ds)return;const Ie=Math.abs(ve)>=Math.abs(je)?"x":"y";if(ce({axis:Ie,dragged:!0}),Ie==="y")return K(O);j>1&&F(!0)}if(ie.current.axis==="x"){if(O.preventDefault(),O.stopPropagation(),j>1){const Ie=M<=0,He=M>=N,We=Ie&&ve>0||He&&ve<0?ve*.35:ve;$(We)}ie.current.lastX=J,ie.current.lastT=ue()}}),K=ze(O=>{if(!ie.current.isPressed)return;const J=kt(O);Q(J);const{axis:pe,dragged:ve,startX:je,lastX:Ie,lastT:He}=ie.current;if(ce({isPressed:!1}),F(!1),pe==="x"&&ve&&j>1&&ae.current){const We=$t(O),gt=We-je,ot=ae.current.offsetWidth/C,xt=He?(We-Ie)/Math.max(1,ue()-He):0;let lt=ot>0?Math.round(-gt/ot):0;lt===0&&Math.abs(xt)>fa&&(lt=xt<0?1:-1),_e(M+lt)}$(0)}),de=O=>()=>{ie.current.dragged||v&&W(O)},ne=O=>()=>_e(O),H=O=>{const J=C===1,pe=J?j:Math.ceil(j/C),ve=M+C,je=j-C<=M,He=(Cs(ve,C,j,je)+O+pe)%pe;return J?He:He*C},le=()=>{if(!u)return s.jsx(s.Fragment,{});const O=j-C<=M,J=C===1,pe=J?j:Math.ceil(j/C),ve=[];for(let je=0;je<pe;je++){let Ie=je,He=M;if(!J){const xt=je===pe-1,lt=M+C;Ie=xt?j-C:je*C,He=Cs(lt,C,j,O)}const We=He===je,gt=ne(Ie);let ot=s.jsx("div",{className:y("smwb-carousel__navigation__dot",We&&"current"),onClick:gt},je);m&&(ot=m(je,We,gt)),ve.push(ot)}return s.jsx("div",{className:y("smwb-carousel__navigation",d),children:ve})},me=()=>{const O=M>N?N:M;return Tn(C)*O},Re=i.useId(),De=oa(C),Te={transform:`translateX(calc(-${me()}% + ${Y}px))`,transition:D||T.animation===void 0?"none":T.animation?"transform 500ms cubic-bezier(.1, 0, .25, 1)":"none"},X={},we=Ft(p),Se=ua(_),Le=Ft(x),Oe=Ft(g);if(we&&(X["--smwb-carousel-cell-height"]=we),Se&&(X["--smwb-carousel-aspect-ratio"]=Se),Le&&(X["--smwb-carousel-gap"]=Le),Oe&&(X["--smwb-carousel-max-width"]=Oe),i.useEffect(()=>{Array.isArray(r)||console.error("SMWB Material: The `children` prop was passed invalidly. It should contain an array of elements.")},[r]),i.useEffect(()=>{if(!b||j<=1||w&&te||A!==null)return;const O=window.setInterval(()=>{ne(H(1))()},f);return()=>window.clearInterval(O)},[b,f,w,te,j,M,C,A]),i.useEffect(()=>{if(A===null||j<=1)return;const O=J=>{J.key==="ArrowLeft"?se(-1):J.key==="ArrowRight"&&se(1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[A,j]),!Array.isArray(r))return s.jsx(s.Fragment,{});const z=r,V=O=>{var J,pe;be.current=(pe=(J=O.touches[0])==null?void 0:J.clientX)!=null?pe:null},re=O=>{var pe,ve;if(be.current===null||j<=1)return;const J=((ve=(pe=O.touches[0])==null?void 0:pe.clientX)!=null?ve:be.current)-be.current;ee(!0),Z(J)},xe=O=>{var ve,je;const J=be.current;if(be.current=null,ee(!1),Z(0),J===null||j<=1)return;const pe=((je=(ve=O.changedTouches[0])==null?void 0:ve.clientX)!=null?je:J)-J;Math.abs(pe)>40&&se(pe<0?1:-1)},ge={transform:`translateX(calc(-${(A!=null?A:0)*100}% + ${oe}px))`,transition:he?"none":"transform 350ms cubic-bezier(.22, .61, .36, 1)"};return s.jsxs("div",{className:y("smwb-carousel",a),"data-testid":"carousel",ref:B,role:"region","aria-roledescription":"carousel","aria-label":h,style:X,onMouseEnter:w?()=>q(!0):void 0,onMouseLeave:w?()=>q(!1):void 0,children:[s.jsxs("div",{className:y("smwb-carousel__inner"),ref:ae,children:[k&&s.jsx(G,{name:"chevron_left",size:l,className:y("smwb-carousel__arrow","smwb-carousel__arrow_prev"),style:{top:`calc(50% - ${l/2}px)`,left:-l/2},onClick:()=>ne(H(-1))()}),s.jsx("div",{ref:U,className:"smwb-carousel__track",onMouseDown:fe,onTouchStart:fe,onDragStart:Ms,onDragEnd:Ms,children:s.jsx("div",{className:"smwb-carousel__layer",style:Te,children:i.Children.map(r,(O,J)=>s.jsx("div",{id:`${Re}${J}`,className:"smwb-carousel__slide",style:De,children:s.jsx("div",{className:y("smwb-carousel__slide-inner",v&&"smwb-carousel__slide-inner_clickable"),onClick:v?de(J):void 0,children:O})},J))})}),k&&s.jsx(G,{name:"chevron_right",size:l,className:y("smwb-carousel__arrow","smwb-carousel__arrow_next"),style:{top:`calc(50% - ${l/2}px)`,right:-l/2},onClick:()=>ne(H(1))()})]}),le(),v&&s.jsx(Ve,{open:A!==null,size:"fullscreen",backdrop:"darkBlured",className:"smwb-carousel__fullscreen",onClose:()=>W(null),"aria-label":"Image viewer",children:A!==null&&s.jsxs("div",{className:"smwb-carousel__fullscreen-content",children:[j>1&&s.jsx(G,{name:"chevron_left",size:40,className:y("smwb-carousel__fullscreen-arrow","smwb-carousel__fullscreen-arrow_prev"),onClick:()=>se(-1)}),s.jsx("div",{className:"smwb-carousel__fullscreen-stage",onTouchStart:V,onTouchMove:re,onTouchEnd:xe,children:s.jsx("div",{className:"smwb-carousel__fullscreen-track",style:ge,children:z.map((O,J)=>s.jsx("div",{className:"smwb-carousel__fullscreen-slide","aria-hidden":J!==A,children:O},J))})}),j>1&&s.jsx(G,{name:"chevron_right",size:40,className:y("smwb-carousel__fullscreen-arrow","smwb-carousel__fullscreen-arrow_next"),onClick:()=>se(1)}),s.jsx(G,{name:"close",size:32,className:"smwb-carousel__fullscreen-close",onClick:()=>W(null)})]})})]})}),ba=()=>{const[e,t]=i.useState(!1),n=i.useCallback(()=>{t(!1)},[]),r=i.useCallback(()=>{t(!0)},[]);return{onClose:n,onOpen:r,isOpen:e}},En=i.createContext({rowsHeight:0}),In=({className:e,src:t,rounded:n,itemBarContent:r,cols:a=1,rows:u=1,itemBarPlacement:o="bottom",alt:l="image"})=>{const{isOpen:d,onClose:c,onOpen:m}=ba(),{rowsHeight:h,variant:b}=i.useContext(En);i.useEffect(()=>{d?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[d]);const f={height:h?`${h*u}px`:"",gridRowEnd:`span ${u}`,gridColumnEnd:`span ${a}`};return s.jsxs(s.Fragment,{children:[s.jsx("li",{"data-testid":"images-list-item",className:y("smwb-gallery__list__item",e,"smwb-gallery-item",`smwb-${b}`),onClick:m,style:f,children:s.jsxs("div",{className:"smwb-gallery-item__inner",children:[s.jsx("div",{className:"smwb-gallery-item__img-wrapper",children:s.jsx("img",{src:t,alt:l||"image",className:y("smwb-gallery-item__img",{"smwb-rounded":n})})}),r&&s.jsx("div",{className:y("smwb-gallery-item__bar",e,`smwb-${o}`,{"smwb-rounded":n}),children:r})]})}),s.jsx($n,{src:t,onClose:c,isOpen:d})]})},An=i.forwardRef(function({className:t,children:n,gap:r=4,cols:a=3,rowsHeight:u=0,variant:o="default","aria-label":l,id:d},c){return s.jsx(En.Provider,{value:{rowsHeight:u,variant:o},children:s.jsx("div",{className:y("smwb-gallery",t),"data-testid":"images-list",ref:c,id:d,children:s.jsx("ul",{"aria-label":l,className:y("smwb-gallery__list",`smwb-${o}`),style:{"--cols-count":a,"--gap":`${r}px`},children:n})})})}),$n=({src:e,onClose:t,isOpen:n})=>{const r=i.useRef(null);return Fe.createPortal(s.jsx(Ue.CSSTransition,{timeout:100,in:n,classNames:{enterActive:"smwb-image-modal__overlay-enter-active",enterDone:"smwb-image-modal__overlay-enter-done"},mountOnEnter:!0,unmountOnExit:!0,nodeRef:r,children:s.jsx("div",{className:"smwb-image-modal__overlay",onClick:t,ref:r,children:s.jsx("div",{className:"smwb-image-modal",onClick:a=>a.stopPropagation(),children:s.jsx("img",{src:e,alt:"",className:"smwb-image-modal__img"})})})}),document.body)},wa=i.forwardRef(function({className:t,children:n,disabled:r,selected:a,dense:u,divider:o,startAdornment:l,endAdornment:d,onClick:c},m){const h=!!c&&!r;return s.jsxs("li",{ref:m,role:"listitem",tabIndex:h?0:void 0,"aria-disabled":r||void 0,"aria-selected":a||void 0,onClick:r?void 0:c,onKeyDown:h?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),c==null||c(b))}:void 0,className:y("smwb-list__item",t,{"smwb-disabled":r,"smwb-selected":a,"smwb-list__item_dense":u,"smwb-list__item_divider":o}),"data-testid":"list-item",children:[s.jsx("span",{className:"smwb-list__item__start",children:l}),s.jsx("span",{className:"smwb-list__item__main",children:n}),s.jsx("span",{className:"smwb-list__item__end",children:d})]})}),pa=i.forwardRef(function({className:t,dense:n,subheader:r,children:a,...u},o){return s.jsxs("ul",{ref:o,"data-testid":"list",role:"list",className:y("smwb-list",{"smwb-list_dense":n},t),...u,children:[r?s.jsx("li",{className:"smwb-list__subheader",children:r}):null,a]})}),Fn=({limit:e,page:t,totalCount:n,onPrev:r,onNext:a,limitOptions:u,onLimitChange:o,hasNextPage:l})=>{const d=typeof n=="undefined",c=d?!l:t===Math.ceil(n/e),m=w=>{o&&o(+w.target.value)},h=()=>{r==null||r()},b=()=>{a==null||a()},f=()=>{const w=t*e-e,p=t*e;return`${w}–${p}`+(d?"":` of ${n}`)};return s.jsx("div",{className:"smwb-table__pagination",children:s.jsxs("div",{className:"smwb-table__pagination__controls",children:[u&&u.length>1&&s.jsxs("div",{className:"smwb-table__pagination__rows",children:[s.jsx("span",{children:"Rows per page"}),s.jsx("select",{id:"rows",className:"smwb-table__pagination__select",onChange:m,value:e,children:u.map(w=>s.jsx("option",{value:w,className:y("smwb-select-option",{selected:w===e}),children:w},w))})]}),s.jsx("div",{className:"smwb-table__pagination__current-count",children:f()}),s.jsxs("div",{className:"smwb-table__pagination__buttons",children:[s.jsx("button",{className:"smwb-table__pagination__control",onClick:h,disabled:t===1,children:s.jsx(G,{name:"chevron_left",size:24,weight:600})}),s.jsx("span",{className:"smwb-table__pagination__page",children:t}),s.jsx("button",{className:"smwb-table__pagination__control",onClick:b,disabled:c,children:s.jsx(G,{name:"chevron_right",size:24,weight:600})})]})]})})},_a=i.forwardRef(({className:e,dense:t,hovered:n,children:r,paginationSettings:a,isLoading:u,stickyHeader:o,caption:l,...d},c)=>s.jsxs("div",{ref:c,className:y("smwb-table__wrapper",e,{"smwb-table__wrapper_loading":u}),...d,children:[s.jsx("div",{className:y("smwb-table__container",{"smwb-withPagination":!!a}),children:s.jsxs("table",{className:y("smwb-table",{"smwb-dense":t,"smwb-hovered":n,"smwb-table_sticky-header":o}),children:[l!=null&&s.jsx("caption",{className:"smwb-table__caption",children:l}),r]})}),!!a&&s.jsx(Fn,{...a})]})),ga=({children:e,className:t,...n})=>s.jsx("tbody",{...n,className:y("smwb-table__body",t),children:e}),xa=({children:e,cellAlign:t="left",className:n,...r})=>s.jsx("td",{...r,className:y("smwb-table__cell",n),align:t||"left",children:e}),va=({children:e,className:t,...n})=>s.jsx("thead",{...n,className:y("smwb-table__head",t),children:e}),ya=({children:e,className:t,cellAlign:n="left",isSortedByAsc:r,isSortedByDesc:a,sortable:u,sortDirection:o,onSort:l,...d})=>{const c=o!==void 0?o:r?"asc":a?"desc":!1,m=u?c==="asc"?"ascending":c==="desc"?"descending":"none":void 0,h=c==="asc"?"expand_more":c==="desc"?"expand_less":"",b=f=>{u&&l&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l())};return s.jsx("th",{...d,"aria-sort":m,className:y("smwb-table__cell","smwb-head-cell",t,{[`smwb-align_${n}`]:!!n,"smwb-head-cell_sortable":u}),children:s.jsxs("span",{className:"smwb-head-cell__content",onClick:u?l:void 0,onKeyDown:u?b:void 0,role:u?"button":void 0,tabIndex:u?0:void 0,children:[e,s.jsx(G,{name:h,size:18,weight:800})]})})},ja=({children:e,className:t,selected:n,expanded:r,...a})=>s.jsx("tr",{"data-testid":"table-row",className:y("smwb-table__row",t,{"smwb-table__row_selected":n,"smwb-table__row_expanded":r}),"aria-selected":n!=null?n:void 0,"aria-expanded":r!=null?r:void 0,...a,children:e}),ka=i.forwardRef(function({className:t,listIcon:n="draft",nodeIcon:r={closed:"folder",opened:"folder_open"},data:a=[],expanded:u,defaultExpanded:o=[],onExpandedChange:l,selected:d,defaultSelected:c=[],onSelectedChange:m,selectable:h=!1,checkboxes:b=!1,renderLabel:f,loadChildren:w,...p},_){const[x,g]=i.useState({}),[v,S]=i.useState([]),[j,C]=$e({value:u,defaultValue:o,onChange:l}),R=i.useRef(),[k,N]=$e({value:d,defaultValue:c,onChange:D=>{const F=R.current;R.current=void 0,m==null||m(D,F)}}),M=D=>{C(F=>F.includes(D)?F.filter(A=>A!==D):[...F,D])},E=(D,F)=>{C(A=>{const W=A.includes(D);return F&&!W?[...A,D]:!F&&W?A.filter(oe=>oe!==D):A})},T=D=>{R.current={id:D,selected:!k.includes(D)},N(F=>F.includes(D)?F.filter(A=>A!==D):[...F,D])},I=(D,F)=>{!w||x[F]||D.children&&D.children.length>0||(S(A=>A.includes(F)?A:[...A,F]),w(D,F).then(A=>{g(W=>({...W,[F]:A}))}).finally(()=>{S(A=>A.filter(W=>W!==F))}))},Y=(D,F)=>{var U,te;const A=(U=D.id)!=null?U:F,W=(te=D.children)!=null?te:x[A],oe=!!w&&(D.hasChildren||!!x[A]),Z=!!W&&W.length>0||oe,he=j.includes(A),ee=k.includes(A),ae=v.includes(A),L=()=>{Z&&(he||I(D,A),M(A)),h&&T(A)},B=q=>{q.key==="Enter"||q.key===" "?(q.preventDefault(),L()):q.key==="ArrowRight"&&Z?(I(D,A),E(A,!0)):q.key==="ArrowLeft"&&Z&&E(A,!1)};return s.jsxs("div",{className:y("smwb-tree__node",{"smwb-tree__node_selected":ee}),role:"treeitem","aria-expanded":Z?he:void 0,"aria-selected":h||b?ee:void 0,children:[s.jsxs("span",{className:"smwb-tree__node__content",onClick:L,onKeyDown:B,tabIndex:0,role:"button",children:[b&&s.jsx("input",{type:"checkbox",className:"smwb-tree__node__checkbox",checked:ee,onClick:q=>q.stopPropagation(),onChange:()=>T(A),"aria-label":D.label}),s.jsxs("span",{className:"smwb-tree__node__label",children:[Z&&he?s.jsx(G,{name:r==null?void 0:r.opened,fill:1,size:20}):Z?s.jsx(G,{name:r==null?void 0:r.closed,fill:1,size:20}):s.jsx(G,{name:n,size:20}),f?f(D,A):D.label]})]}),Z&&he&&s.jsx("div",{role:"group",children:ae&&!W?s.jsx("div",{className:"smwb-tree__node__loading",role:"status",children:"Загрузка…"}):W==null?void 0:W.map((q,ie)=>Y(q,`${F}.${ie}`))})]},A)},$=i.useMemo(()=>a.map((D,F)=>Y(D,`${F}`)),[a,j,k,h,b,n,r,f,x,v]);return s.jsx("div",{"data-testid":"tree-view",...p,ref:_,role:"tree",className:y("smwb-tree",t),children:$.map((D,F)=>s.jsx("div",{className:"smwb-tree__wrapper",role:"presentation",children:D},F))})});function Ts(e){return e.substring(2).toLowerCase()}function Na(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function at({children:e,disableReactTree:t=!1,mouseEvent:n="onMouseUp",onClickAway:r,touchEvent:a="onTouchEnd",enabled:u=!0}){const o=i.useRef(!1),l=i.useRef(null),d=i.useRef(!1),c=i.useRef(!1);i.useEffect(()=>(setTimeout(()=>{d.current=!0},0),()=>{d.current=!1}),[]);const m=Ne(e.ref,l),h=ze(w=>{const p=c.current;if(c.current=!1,!u||!d.current||!l.current||"clientX"in w&&Na(w,document))return;if(o.current){o.current=!1;return}let _;if(w.composedPath)_=w.composedPath().indexOf(l.current)>-1;else{const x=w.target;_=!document.documentElement.contains(x)||l.current.contains(x)}if(!_&&(t||!p)){if(ta(w,l.current))return;r(w)}}),b=w=>p=>{c.current=!0;const _=e.props[w];_&&_(p)},f={ref:m};return a!==!1&&(f[a]=b(a)),i.useEffect(()=>{if(a!==!1){const w=Ts(a),p=()=>{o.current=!0};return document.addEventListener(w,h),document.addEventListener("touchmove",p),()=>{document.removeEventListener(w,h),document.removeEventListener("touchmove",p)}}},[h,a]),n!==!1&&(f[n]=b(n)),i.useEffect(()=>{if(n!==!1){const w=Ts(n);return document.addEventListener(w,h),()=>{document.removeEventListener(w,h)}}},[h,n]),s.jsx(s.Fragment,{children:i.cloneElement(e,f)})}const Ln=i.forwardRef(({className:e,children:t,type:n,severity:r,variant:a="filled",onClose:u,closeAriaLabel:o="Close",...l},d)=>{const c=r!=null?r:n,m=y("smwb-message",`smwb-message_${a}`,e,{[`smwb-message_${c}`]:!!c});return s.jsxs("div",{"data-testid":"message",role:"alert","aria-live":c==="error"?"assertive":"polite",...l,className:m,ref:d,children:[t,u&&s.jsx("button",{className:"smwb-message__close-btn",onClick:u,"aria-label":o,type:"button",children:s.jsx(G,{name:"close",weight:1e3})})]})}),Ra=({children:e})=>s.jsx("div",{className:"smwb-message__header",children:e}),Ca=Object.assign(Ln,{Header:Ra});function Sa({open:e,title:t,nameLabel:n,name:r,onNameChange:a,previewSrc:u,onCapture:o,captureLabel:l,busy:d,confirmLabel:c,cancelLabel:m,onConfirm:h,onClose:b,children:f,className:w}){const p=a!==void 0||r!==void 0;return s.jsxs(Ve,{open:e,onClose:b,size:"small",children:[s.jsx(Ve.Header,{children:t!=null?t:"Save"}),s.jsx(Ve.Content,{children:s.jsxs("div",{className:y("smwb-save-asset-dialog__body",w),children:[p?s.jsx(Ke,{label:n!=null?n:"Name",value:r!=null?r:"",disabled:!!d,onChange:_=>a==null?void 0:a(_.currentTarget.value)}):null,u?s.jsx("div",{className:"smwb-save-asset-dialog__preview",children:s.jsx("img",{src:u,alt:""})}):null,o?s.jsx(Ae,{variant:"outlined",size:"small",disabled:!!d,onClick:()=>o(),label:l!=null?l:"Capture preview"}):null,f]})}),s.jsxs(Ve.Footer,{children:[s.jsx(Ae,{variant:"text",disabled:!!d,onClick:()=>b(),label:m!=null?m:"Cancel"}),s.jsx(Ae,{variant:"contained",disabled:!!d,onClick:()=>h(),label:c!=null?c:"Save"})]})]})}const Pn=i.forwardRef(function({type:t,variant:n,className:r,progressValue:a=0,color:u="primary",size:o="medium",id:l,...d},c){const m={role:"progressbar","aria-label":d["aria-label"],id:l,...t==="determinate"?{"aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100}:{}},h=u!=="primary"?`smwb-indicator_color-${u}`:null;return n==="circular"?s.jsx("div",{ref:c,className:y("smwb-indicator_circular",`smwb-${t}`,h,`smwb-indicator_size-${o}`,r),...m,children:t==="determinate"?s.jsx(On,{progressValue:a}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"smwb-indicator_circular__thumb"}),s.jsx("div",{}),s.jsx("div",{}),s.jsx("div",{})]})}):s.jsx("div",{ref:c,className:y("smwb-indicator_linear",`smwb-${t}`,h,r),...m,children:s.jsx("div",{className:"smwb-indicator_linear__thumb",style:t==="determinate"?{width:`${a}%`}:{}})})});function On({progressValue:e=0}){const t=i.useRef(null);return i.useEffect(()=>{var r;if(!t.current||!t.current.r)return;const n=(r=t.current)==null?void 0:r.r.baseVal.value;if(n&&t.current){const a=2*Math.PI*n;t.current.style.strokeDasharray=`${a} ${a}`,t.current.style.strokeDashoffset=`${a}`;const u=a-e/100*a;t.current.style.strokeDashoffset=`${u}`}},[t,e]),s.jsx("svg",{className:"smwb-indicator_circular__svg",children:s.jsx("circle",{className:"smwb-indicator_circular__circle",cx:"24",cy:"24",r:"22",ref:t})})}function Ma(e){const{open:t,title:n,subject:r,message:a,confirmLabel:u,cancelLabel:o,danger:l,busy:d,onConfirm:c,onCancel:m,className:h}=e,b=i.useId(),f=i.useId(),w=[r?b:"",a?f:""].filter(Boolean).join(" ");return s.jsxs(Ve,{open:t,onClose:m,size:"small",role:"alertdialog",backdrop:"dark",closeOnEsc:!d,closeOnOutsideClick:!d,"aria-label":n,...w?{"aria-describedby":w}:{},children:[s.jsx(Ve.Header,{children:n}),s.jsx(Ve.Content,{children:s.jsxs("div",{className:y("smwb-confirm-dialog__body",h),children:[r?s.jsx(Xe,{id:b,variant:"body2",color:"textPrimary",component:"span",children:r}):null,a?s.jsx(Xe,{id:f,variant:"caption",color:"textSecondary",component:"span",children:a}):null]})}),s.jsxs(Ve.Footer,{children:[s.jsx(Ae,{variant:"text",size:"small",disabled:!!d,onClick:m,label:o!=null?o:"Cancel"}),s.jsx(Ae,{variant:"contained",size:"small",color:l?"error":"primary",disabled:!!d,onClick:c,label:u})]})]})}function Da(){const[e,t]=i.useState(null);return ke(()=>{const n=document.createElement("div");return n.id=`snackbar-portal-${Gs.v4()}`,document.body.prepend(n),t(n),()=>{document.body.removeChild(n)}},[]),{snackbarDomRoot:e}}function Ta({snack:e,position:t,variant:n,className:r,component:a,autoClose:u,autoCloseTime:o,snackRest:l,onSnackRemove:d,onClose:c}){var h,b,f,w,p;const m=i.useRef(null);return s.jsx(Ue.CSSTransition,{appear:!0,timeout:125,classNames:{appear:"smwb-snackbar-enter",appearActive:"smwb-snackbar-enter-active",appearDone:"smwb-snackbar-enter-done",enter:"smwb-snackbar-enter",enterActive:"smwb-snackbar-enter-active",enterDone:"smwb-snackbar-enter-done",exitActive:"smwb-snackbar-exit-active"},unmountOnExit:!0,in:!0,nodeRef:m,children:s.jsx(Ia,{ref:m,component:(h=e.component)!=null?h:a,message:e.message,position:(b=e.position)!=null?b:t,variant:(f=e.variant)!=null?f:n,onClick:d(e.id),className:y(r,e.className),isAutoClose:(w=e.autoClose)!=null?w:u,autoCloseTime:(p=e.autoCloseTime)!=null?p:o,onClose:c(e.id),...l})})}const zn=i.createContext({addSnackbar:()=>"",clearAllSnackbars:()=>{},clearFirstSnackbar:()=>{},clearLastSnackbar:()=>{},clearByIdSnackbar:()=>{}});function Ea(e){const{position:t="top-right",variant:n="dark",className:r,autoClose:a=!0,autoCloseTime:u=5e3,closeOnClick:o=!0,onClick:l,component:d="div",children:c,...m}=e,[h,b]=i.useState([]),{snackbarDomRoot:f}=Da(),w=i.useCallback(R=>{const{key:k,...N}=R,M=k!=null?k:Gs.v4(),E={id:M,...N};return b(T=>{const I=T.findIndex($=>$.id===M);if(I===-1)return[...T,E];const Y=[...T];return Y[I]=E,Y}),M},[]),p=()=>{b([])},_=()=>{b(R=>R.slice(1))},x=()=>{b(R=>R.slice(0,-1))},g=R=>{b(k=>k.filter(N=>N.id!==R))},v=R=>k=>{l==null||l(k),o&&g(R)},S=R=>()=>{g(R)},j=h.reduce((R,k)=>{var M,E;const N=(M=k.position)!=null?M:t;return R[N]=[...(E=R[N])!=null?E:[],k],R},{}),C=Object.keys(j).map(R=>{const k=j[R];return s.jsx(Ue.TransitionGroup,{className:y("smwb-snackbars",`smwb-${R}`),"data-testid":`snackbars-${R}`,appear:!0,children:k.map(N=>s.jsx(Ta,{snack:N,position:t,variant:n,className:r,component:d,autoClose:a,autoCloseTime:u,snackRest:m,onSnackRemove:v,onClose:S},N.id))},R)});return s.jsxs(zn.Provider,{value:{addSnackbar:w,clearAllSnackbars:p,clearFirstSnackbar:_,clearLastSnackbar:x,clearByIdSnackbar:g},children:[c,f&&Fe.createPortal(C,f)]})}const Ia=i.forwardRef(function({className:t,message:n,variant:r="dark",position:a="top-right",onClick:u,component:o="div",isAutoClose:l,autoCloseTime:d,onClose:c,action:m,...h},b){const f=i.useRef(),w=ze(()=>{!c||!l||!d||(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c()},d))});i.useEffect(()=>(w(),()=>{f.current&&clearTimeout(f.current)}),[w]);const p=o;return s.jsxs(p,{ref:b,className:y("smwb-snackbar",t,`smwb-${r}`,`smwb-${a}`),onClick:u,role:"alert","aria-live":r==="danger"?"assertive":"polite","aria-atomic":"true",...h,children:[s.jsx("div",{className:"smwb-snackbar__body",children:n}),m!=null?s.jsx("div",{className:"smwb-snackbar__action",children:m}):null]})});function Aa(){return i.useContext(zn)}const $a=i.forwardRef(function({className:t,children:n,placement:r="top",offset:a={offsetX:0,offsetY:0},message:u,open:o,trigger:l="hover",openDelay:d=0,closeDelay:c=0},m){var E,T;const h=rt(r),[b,f]=i.useState(!1),[w,p]=i.useState(!1),_=i.useRef(null),x=i.useRef(null),g=i.useCallback(()=>{_.current!==null&&(clearTimeout(_.current),_.current=null),x.current!==null&&(clearTimeout(x.current),x.current=null)},[]);i.useEffect(()=>()=>g(),[g]);const v=i.useCallback(()=>{if(g(),d<=0){f(!0);return}_.current=setTimeout(()=>f(!0),d)},[g,d]),S=i.useCallback(()=>{if(g(),c<=0){f(!1);return}x.current=setTimeout(()=>f(!1),c)},[g,c]),{refs:j,floatingStyles:C}=ye.useFloating({placement:h.placement,whileElementsMounted:ye.autoUpdate,middleware:[ye.offset({mainAxis:(E=a==null?void 0:a.offsetY)!=null?E:0,crossAxis:(T=a==null?void 0:a.offsetX)!=null?T:0}),...h.autoMiddleware?[h.autoMiddleware]:[]]}),R=l==="manual"?o===!0:l==="click"?w:b,k=l==="hover"?v:void 0,N=l==="hover"?S:void 0,M=l==="click"?()=>{p(I=>!I)}:void 0;return s.jsxs("div",{className:"smwb-tooltip__wrapper",role:"tooltip",ref:m,children:[s.jsx("div",{className:"smwb-tooltip__ref",ref:j.setReference,onPointerEnter:k,onPointerLeave:N,onClick:M,children:n}),R&&s.jsx("div",{ref:j.setFloating,className:y("smwb-tooltip",t),style:C,children:u})]})}),Fa=i.forwardRef(function(t,n){const{className:r,children:a,variant:u="contained",size:o="medium",orientation:l="horizontal",colorTheme:d="primary",color:c,fullWidth:m=!1,disabled:h=!1,...b}=t;return s.jsx("div",{ref:n,className:y("smwb-button-group",r,`smwb-${l}`,`smwb-${u}`,m&&"smwb-full-width",h),role:"group","data-testid":"button-group",...b,children:i.Children.map(a,f=>{var p,_,x,g,v,S;const w=f;return i.cloneElement(w,{className:"smwb-button-group__grouped",fullWidth:l==="vertical"||((p=w.props.fullWidth)!=null?p:m),variant:(_=w.props.variant)!=null?_:u,size:(x=w.props.size)!=null?x:o,disabled:(g=w.props.disabled)!=null?g:h,colorTheme:(v=w.props.colorTheme)!=null?v:d,color:(S=w.props.color)!=null?S:c})})})}),La=i.forwardRef(function(t,n){const{label:r,disabled:a,readOnly:u,required:o,name:l,id:d,indeterminate:c,className:m,size:h="medium",color:b="primary",onChange:f,helperText:w,error:p,..._}=t,x=pt(d),g=v=>{if(u){v.preventDefault();return}f==null||f(v,v.target.checked,t)};return s.jsx(Ye,{helperText:w,disabled:a,error:p,className:"smwb-text-field-checkbox",children:s.jsxs("label",{htmlFor:x,className:y("smwb-checkbox__wrapper",`smwb-checkbox_size-${h}`,`smwb-checkbox_color-${b}`,m,{"smwb-disabled":a,"smwb-readonly":u,"smwb-indeterminate":c}),children:[s.jsx("input",{type:"checkbox",id:x,name:l,className:"smwb-checkbox__input",disabled:a,readOnly:u,required:o,"aria-invalid":p||void 0,"aria-required":o||void 0,ref:n,..._,onChange:g}),s.jsx("span",{className:y("smwb-checkbox__btn",{"smwb-indeterminate":c}),children:c?s.jsx(G,{name:"remove",size:18,className:"smwb-checkbox__icon",weight:700}):s.jsx(G,{name:"check",size:17,className:"smwb-checkbox__icon",weight:700})}),r&&s.jsx("span",{className:"smwb-checkbox__label",children:r})]})})});function qe({className:e,children:t,onMouseDown:n,disabled:r,size:a="medium",edge:u,...o}){const l=i.useRef(null),d=h=>{n==null||n(h)},c=h=>{var b;r||(b=l.current)==null||b.onRipple(h)},m=y("smwb-date-picker__icon-button",e,{"smwb-date-picker__icon-button--small":a==="small","smwb-date-picker__icon-button--edge-start":u==="start","smwb-date-picker__icon-button--edge-end":u==="end","smwb-date-picker__icon-button--disabled":r});return s.jsxs("button",{onMouseDown:d,onPointerDown:c,type:"button",className:m,disabled:r,...o,children:[t,!r&&s.jsx(Be,{actionRef:l,center:!0})]})}function Ut({label:e,onLeftIconClick:t,onRightIconClick:n,onLabelClick:r,disabled:a,active:u,hiddenSwitches:o,dataToggleId:l,...d}){const c=y("smwb-date-picker__switch",{"smwb-date-picker__switch--hidden":o});return s.jsxs("div",{className:"smwb-date-picker__action",...d,children:[s.jsx("div",{className:c,children:s.jsx(qe,{size:"small",onClick:a?void 0:t,children:s.jsx(G,{name:"keyboard_arrow_left",weight:500,size:24})})}),s.jsxs("div",{className:y("smwb-date-picker__action-label",{"smwb-date-picker__action-label--disabled":a,"smwb-date-picker__action-label--active":u}),"data-testid":l,onClick:a?void 0:r,children:[s.jsx("span",{className:"smwb-date-picker__action-text",children:e}),s.jsx(G,{name:"arrow_drop_down",weight:500,size:20})]}),s.jsx("div",{className:c,children:s.jsx(qe,{size:"small",onClick:a?void 0:n,children:s.jsx(G,{name:"keyboard_arrow_right",weight:500,size:24})})})]})}const Qe=/yyyy|MM|dd/g;function Pa(e){const t=[];let n;for(Qe.lastIndex=0;(n=Qe.exec(e))!==null;)t.push(n[0]);return t}function Es(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oa(e){let t="^",n=0,r;for(Qe.lastIndex=0;(r=Qe.exec(e))!==null;)t+=Es(e.slice(n,r.index)),t+=r[0]==="yyyy"?"(\\d{4})":"(\\d{2})",n=Qe.lastIndex;return t+=Es(e.slice(n)),t+="$",new RegExp(t)}function za(e,t,n){if(t<1||t>12||n<1)return!1;const r=new Date(e,t-1,n);return r.getFullYear()===e&&r.getMonth()===t-1&&r.getDate()===n}function Ba(e,t){const n=e.getFullYear(),r=e.getMonth()+1,a=e.getDate();return t.replace(Qe,u=>u==="yyyy"?String(n).padStart(4,"0"):u==="MM"?String(r).padStart(2,"0"):String(a).padStart(2,"0"))}function Bn(e,t){const n=Pa(t);if(n.length!==3||!n.includes("yyyy")||!n.includes("MM")||!n.includes("dd"))return;const r=Oa(t).exec(e);if(!r)return;let a,u,o;if(n.forEach((l,d)=>{const c=Number(r[d+1]);if(l==="yyyy"){a=c;return}if(l==="MM"){u=c;return}o=c}),!(a===void 0||u===void 0||o===void 0)&&za(a,u,o))return new Date(a,u-1,o)}function Ha(e,t){return Bn(e,t)!==void 0}function os(e,t=0){t=t%7;const n=new Date(e),r=n.getDay(),a=(r<t?7:0)+r-t;return new Date(n.setDate(n.getDate()-a))}function Hn(e,t=0){const n=new Date(os(e,t));return new Date(n.setDate(n.getDate()+6))}function Va(e,t){const n=[],r=new Date(e),u=new Date(t).getTime(),o=r;for(o.setHours(0,0,0,0);o.getTime()<=u;)n.push(new Date(o.getTime())),o.setDate(o.getDate()+1),o.setHours(0,0,0,0);return n}const Ya=(e,t,n)=>{const r=new Intl.DateTimeFormat(n,{weekday:"narrow"});return Va(os(e,t),Hn(e,t)).map(a=>r.format(a))};function Vn(e){const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),1)}function Yn(e){return Kn(new Date(e.getFullYear(),e.getMonth()+1,0))}function ft(e,t){return new Date(e)<new Date(t)}function Lt(e,t){return ft(t,e)}function Ka(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}const Xa=(e,t)=>{const n=os(Vn(e),t),r=Hn(Yn(e),t);let a=0,u=n;const o=[];let l=null;for(;ft(u,r);){const d=Math.floor(a/7);o[d]=o[d]||[];const c=u.getDay();l!==c&&(l=c,o[d].push(u),a+=1),u=Ka(u,1)}return o};function Ua(e,t){return Vn(t)<=e&&e<=Yn(t)}function Wt(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Kn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}function yt(e,t){return Wt(e).getTime()===Wt(t).getTime()}function Xn(e,t){return ls(e,e.getMonth()+t)}function Wa(e,t){return cs(e,e.getFullYear()+t)}function ct(e){return Kn(e)}function ut(e){return Wt(e)}function Un(e){const t=[],n=new Intl.DateTimeFormat(e,{month:"long"});for(let r=0;r<12;r++)t.push({label:n.format(Xn(new Date("1970-01-01"),r)),value:r});return t}function ls(e,t){const n=new Date(e);return n.setMonth(t),n}function Wn(e,t){const n=[];for(let r=e-t;r<=e+t;r++)n.push({label:String(r).padStart(4,"0"),value:r});return n}function cs(e,t){const n=new Date(e);return n.setFullYear(t),n}function Ga(e,t){return new Intl.DateTimeFormat(t,{month:"short"}).format(e)}function qa(e,t){return new Intl.DateTimeFormat(t,{year:"numeric"}).format(e)}function ht(e,t){return Pe(e)?t?Ba(e,t):new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric"}).format(e):""}function us(e){if(e)return e;const t={year:"yyyy",month:"MM",day:"dd"};return new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric"}).formatToParts(new Date("1970-01-01")).map(a=>t[a.type]||a.value).join("")}const Gt=/\d/gi,Za=/[a-zA-Z]/g;function Ja(e){return e?e.replace(Za,"_"):new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric"}).format(new Date("1970-01-01")).replace(Gt,"_")}function Gn(e){return t=>{let n=0;return t.split("").map((r,a)=>{if(Gt.lastIndex=0,n>e.length-1)return"";const u=e[n],o=e[n+1],l=Gt.test(r)?r:"",d=u==="_"?l:u+l;return n+=d.length,a===t.length-1&&o&&o!=="_"?d?d+o:"":d}).join("")}}function Is(e,t){return Ha(e,t)}function As(e,t){const n=Bn(e,t);return n||new Date(Number.NaN)}function Pe(e){return Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function ds({viewValue:e,openView:t,onChange:n,onMonthLabelClick:r,onYearLabelClick:a,locale:u}){const o=i.useCallback(c=>()=>{n==null||n(Xn(e,c))},[n,e]),l=i.useCallback(c=>()=>{n==null||n(Wa(e,c))},[n,e]),d=t===Ce.months||t===Ce.years;return s.jsxs("div",{className:"smwb-date-picker__header",children:[s.jsx(Ut,{label:Ga(e,u),onLeftIconClick:o(-1),onRightIconClick:o(1),onLabelClick:r,disabled:t===Ce.years,active:t===Ce.months,hiddenSwitches:d,dataToggleId:"date-picker-months-toggle"}),s.jsx(Ut,{label:qa(e,u),onLeftIconClick:l(-1),onRightIconClick:l(1),onLabelClick:a,disabled:t===Ce.months,active:t===Ce.years,hiddenSwitches:d,dataToggleId:"date-picker-years-toggle"})]})}const Qa=i.memo(function({className:t,children:n,onMouseDown:r,onChange:a,active:u,current:o,hidden:l,outside:d,disabled:c,inRange:m,day:h,...b}){const f=i.useRef(null),w=i.useCallback(g=>{r==null||r(g)},[r]),p=i.useCallback(g=>{var v;c||(v=f.current)==null||v.onRipple(g)},[c]),_=i.useCallback(()=>{c||a==null||a(void 0,h)},[a,h,c]);if(l)return s.jsx("span",{className:"smwb-date-picker__day-hidden"});const x=y("smwb-date-picker__day",t,{"smwb-date-picker__day--active":!c&&u,"smwb-date-picker__day--current":o&&!u,"smwb-date-picker__day--outside":!c&&d,"smwb-date-picker__day--disabled":c,"smwb-date-picker__day--in-range":!c&&m});return s.jsxs("button",{className:x,type:"button",onMouseDown:w,onPointerDown:p,onClick:_,disabled:c,...b,children:[n,!c&&s.jsx(Be,{actionRef:f,center:!0})]})});function ms({viewValue:e,value:t,showDaysOutsideMonth:n,onChange:r,disablePast:a,disableFuture:u,weekStartsOn:o=0,minDate:l,maxDate:d,isDateDisabled:c,locale:m,range:h,rangeStart:b,rangeEnd:f}){const[w]=i.useState(new Date),p=i.useMemo(()=>Ya(w,o,m),[w,o,m]),_=i.useMemo(()=>Xa(e,o),[e,o]),x=i.useCallback(j=>h?Pe(b)&&yt(j,b)||Pe(f)&&yt(j,f):Pe(t)?yt(j,t):!1,[t,h,b,f]),g=i.useCallback(j=>!h||!Pe(b)||!Pe(f)?!1:Lt(ut(j),ut(b))&&ft(ct(j),ct(f)),[h,b,f]),v=i.useCallback(j=>{let C=!1;return a&&(C=ft(ct(j),w)),u&&(C=C||Lt(ut(j),w)),l&&ft(ct(j),ut(l))&&(C=!0),d&&Lt(ut(j),ct(d))&&(C=!0),c!=null&&c(j)&&(C=!0),C},[a,u,w,l,d,c]),S=i.useMemo(()=>p.map((j,C)=>s.jsx("span",{className:"smwb-date-picker__week-day",children:j.toString()},C)),[p]);return s.jsxs("div",{className:"smwb-date-picker__days",children:[s.jsx("div",{className:"smwb-date-picker__week-days",children:S}),s.jsx("div",{className:"smwb-date-picker__month",children:_.map((j,C)=>s.jsx("div",{className:"smwb-date-picker__week",children:j.map(R=>{const k=!Ua(R,e);return s.jsx(Qa,{day:R,current:yt(R,w),active:x(R),inRange:g(R),hidden:!n&&k,outside:k,onChange:r,disabled:v(R),children:R.getDate()},R.toISOString())})},C))})]})}const it=i.createContext({dense:!1,variant:"floating",onClose:()=>null});function Dt(){return i.useContext(it)}const nt=i.forwardRef(function(t,n){const{children:r,className:a,disabled:u,selected:o,onClick:l,onMouseDown:d,href:c,linkElement:m,linkProps:h,value:b,optionRenderer:f,...w}=t,{dense:p}=i.useContext(it),_=i.useRef(null),x=C=>{if(u){c&&C.preventDefault();return}l==null||l(C)},g=C=>{u||d==null||d(C)},v=C=>{var R;(R=_.current)==null||R.onRipple(C)};let S;if(c){const C=m!=null?m:"a";S=s.jsxs(C,{className:"smwb-menu__item-inner",href:c,...h,children:[r,s.jsx("span",{className:"smwb-menu__item__helper-text"})]})}else S=s.jsx("span",{className:"smwb-menu__item-inner",children:r});const j=y("smwb-menu__item",a,{"smwb-menu__item--dense":p,"smwb-menu__item--disabled":u,"smwb-menu__item--selected":o});return f?f(t):s.jsxs("li",{role:"menuitem",ref:n,className:j,tabIndex:u?void 0:0,onClick:x,"data-value":b,onMouseDown:g,onPointerDown:v,...w,children:[S,s.jsx(Be,{actionRef:_})]})}),fs=i.forwardRef(function(t,n){const{children:r,className:a,edge:u,...o}=t,{dense:l}=i.useContext(it),d=y("smwb-menu__icon",a,{"smwb-menu__icon--dense":l,"smwb-menu__icon--start":u==="start","smwb-menu__icon--end":u==="end"});return s.jsx("span",{ref:n,className:d,...o,children:r})}),hs=i.forwardRef(function(t,n){const{children:r,className:a,inset:u=!1,...o}=t,{dense:l}=i.useContext(it),d=y("smwb-menu__text",a,{"smwb-menu__text--inset":u,"smwb-menu__text--dense":l});return s.jsx("span",{ref:n,className:d,...o,children:r})}),qn=i.forwardRef(function(t,n){const{className:r,...a}=t,{variant:u}=Dt();return s.jsx("li",{ref:n,className:y("smwb-menu__divider",r,u==="static"&&"smwb-menu__divider--vertical"),...a})}),Zn=i.forwardRef(function(t,n){const{children:r,className:a,...u}=t,{variant:o,onClose:l}=Dt(),d=c=>{var b,f,w,p;const m=Array.from(c.currentTarget.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));if(m.length===0)return;const h=m.indexOf(document.activeElement);c.key==="ArrowDown"?(c.preventDefault(),(b=m[(h+1+m.length)%m.length])==null||b.focus()):c.key==="ArrowUp"?(c.preventDefault(),(f=m[(h-1+m.length)%m.length])==null||f.focus()):c.key==="Home"?(c.preventDefault(),(w=m[0])==null||w.focus()):c.key==="End"?(c.preventDefault(),(p=m[m.length-1])==null||p.focus()):c.key==="Escape"&&l()};return s.jsx("div",{ref:n,className:y("smwb-menu",a,`smwb-menu--${o}`),...u,children:s.jsx("ul",{className:y("smwb-menu__list",`smwb-menu__list--${o}`),role:"menu","aria-orientation":"vertical",onKeyDown:d,children:r})})});function ei(e,t){return Ct(e,t)}const ti=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),si={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},Jn=i.forwardRef(function(t,n){const{anchorElement:r,isOpen:a,onClose:u,placement:o="bottom-start",middleware:l,style:d,...c}=t,[m,h]=i.useState(null),b=i.useRef(null),f=rt(o),{refs:w,floatingStyles:p}=ye.useFloating({open:!!a,placement:f.placement,whileElementsMounted:ye.autoUpdate,elements:{reference:r!=null?r:null},middleware:ei(f,l)}),_=Ne(n,b,h,w.setFloating),x=g=>{if(!a||!u||!m)return;const v=g.target;m.contains(v)||r!=null&&r.contains(v)||u==null||u()};return s.jsx(Rt,{nodeRef:b,in:!!a,timeout:150,unmountOnExit:!0,children:g=>s.jsx(at,{onClickAway:x,children:s.jsx(Zn,{ref:_,style:{...p,...d,...ti(150),...si[g]},...c})})})}),ni=i.forwardRef(function e(t,n){const{children:r,toggleElement:a,placement:u="right-start",onClose:o,openOnHover:l,...d}=t,[c,m]=i.useState(!1),[h,b]=i.useState(null),f=Dt(),w=[ye.offset(({placement:v})=>{switch(v){case"right-start":case"left-start":return{crossAxis:-8,mainAxis:0};case"right-end":case"left-end":return{crossAxis:8,mainAxis:0};default:return{crossAxis:0,mainAxis:0}}})],p=v=>{v.button===0&&m(S=>!S)},_=()=>{m(!1),o==null||o()},x=v=>{v.key==="ArrowRight"||v.key==="Enter"||v.key===" "?(v.preventDefault(),m(!0)):(v.key==="ArrowLeft"||v.key==="Escape")&&m(!1)},g=i.cloneElement(a,{ref:b,onClick:p,onKeyDown:x,onMouseEnter:l?()=>m(!0):void 0,"aria-haspopup":"menu","aria-expanded":c,selected:c});return s.jsxs(it.Provider,{value:{...f,variant:"floating"},children:[g,s.jsx(Jn,{ref:n,...d,placement:u,isOpen:c,onClose:_,anchorElement:h,middleware:w,children:i.Children.map(r,v=>{if(!i.isValidElement(v))return null;if(v.type===e)return v;const S=v;return i.cloneElement(S,{onClick:j=>{var C,R;(R=(C=S.props).onClick)==null||R.call(C,j),_(),f.onClose()}})})})]})}),ri=i.forwardRef(function(t,n){const{variant:r}=Dt();if(r==="static"){const{anchorElement:a,isOpen:u,onClose:o,placement:l,middleware:d,...c}=t;return s.jsx(Zn,{ref:n,...c})}return s.jsx(Jn,{ref:n,...t})}),Tt=i.forwardRef(function(t,n){const{dense:r=!1,variant:a="floating",onClose:u,...o}=t,l=()=>{u==null||u()};return s.jsx(it.Provider,{value:{dense:r,variant:a,onClose:l},children:s.jsx(ri,{ref:n,onClose:u,...o})})});function wt({value:e,items:t,onChange:n}){const r=i.useRef(null),a=i.useRef(null);ke(()=>{if(r.current&&a.current){const l=(r.current.offsetHeight-a.current.offsetHeight)/2;r.current.scrollTop=a.current.offsetTop-l}});const u=i.useCallback(l=>()=>{n==null||n(l)},[n]),o=i.useCallback(l=>d=>{e===l&&(a.current=d)},[e]);return s.jsx("div",{className:"smwb-date-picker__overflow",ref:r,"data-testid":"date-picker-list",children:s.jsx("ul",{className:"smwb-date-picker__list",children:t.map(({label:l,value:d})=>{const c=e===d;return s.jsxs(nt,{selected:c,onClick:u(d),ref:o(d),children:[c&&s.jsx(fs,{children:s.jsx(G,{name:"check",weight:500,size:24})}),s.jsx(hs,{className:"smwb-date-picker__list-item",inset:!c,children:l})]},d)})})})}const ai=us();function Qn({value:e,onChange:t,onBlur:n,format:r}){const a=i.useMemo(()=>r?us(r):ai,[r]),[u,o]=i.useState(ht(e,r)),l=i.useMemo(()=>Ja(r),[r]),d=i.useMemo(()=>Gn(l),[l]),c=i.useRef(void 0);i.useEffect(()=>{const w=e!==c.current;c.current=e,w&&o(ht(e,r))},[e,r]);const m=w=>{o(w),t&&(Is(w,a)?t(void 0,As(w,a)):w===""&&t(void 0))},h=i.useCallback(()=>{var w,p,_,x;n&&(Is((p=(w=c.current)==null?void 0:w.toString())!=null?p:"",a)?n(void 0,As((x=(_=c.current)==null?void 0:_.toString())!=null?x:"",a)):c.current===""&&n(void 0),o(ht(e,r)))},[n,e,r,a]),b=Zt.useRifm({value:u,onChange:m,format:d}),f=a.toLowerCase();return{...b,onBlur:h,placeholder:f}}function ii(e){e.stopPropagation()}const er=i.forwardRef(function(t,n){const{value:r,onChange:a,onBlur:u,onToggle:o,disabled:l,disableCalendar:d,calendarIcon:c,format:m,...h}=t,b=Qn({value:r,onChange:a,onBlur:u,format:m});return s.jsx(Ke,{ref:n,...b,type:"tel",endAdornment:!d&&s.jsx(qe,{edge:"end",onClick:o,onMouseDown:ii,disabled:!!l,"data-testid":"date-picker-icon-button",children:c||s.jsx(G,{name:"calendar_today",fill:1,weight:500,size:24})}),disabled:!!l,...h})});var Ce=(e=>(e.days="days",e.months="months",e.years="years",e))(Ce||{});const oi=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),li={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},ci=i.forwardRef(function(t,n){const{value:r,onChange:a,showDaysOutsideMonth:u,disablePast:o,disableFuture:l,weekStartsOn:d=1,placement:c="bottom-start",disabled:m,disableCalendar:h,calendarAriaLabel:b="Choose date",minDate:f,maxDate:w,isDateDisabled:p,locale:_,format:x,range:g,rangeValue:v,onRangeChange:S,calendarIcon:j,onBlur:C,...R}=t,k=i.useMemo(()=>r===void 0?void 0:new Date(r),[r]),N=v!==void 0,[M,E]=i.useState([void 0,void 0]),T=N&&v?v:M,[I,Y]=i.useState(()=>Pe(k)?k:new Date),[$,D]=i.useState("days"),[F,A]=i.useState(!1),W=i.useRef(null),oe=i.useRef(null),Z=rt(c),{refs:he,floatingStyles:ee}=ye.useFloating({open:F,placement:Z.placement,whileElementsMounted:ye.autoUpdate,middleware:Ct(Z)}),ae=Ne(W,he.setReference,n),L=Ne(oe,he.setFloating);ke(()=>{m||Y(Pe(k)?k:new Date)},[k,m]);const B=i.useCallback(P=>{Y(P)},[]),U=i.useCallback(()=>{D($==="months"?"days":"months")},[$]),te=i.useCallback(()=>{D($==="years"?"days":"years")},[$]),q=i.useCallback(P=>{Y(ls(I,P)),D("days")},[I]),ie=i.useCallback(P=>{Y(cs(I,P)),D("days")},[I]),ce=i.useCallback((P,K)=>{if(g){if(!K)return;const[de,ne]=T;let H;!de||de&&ne?H=[K,void 0]:H=Pe(de)&&K.getTime()<de.getTime()?[K,de]:[de,K],N||E(H),S==null||S(H),H[0]&&H[1]&&A(!1);return}a==null||a(P,K,t),A(!1)},[a,t,g,T,N,S]),ue=i.useCallback(()=>{m||A(P=>!P)},[m]),_e=i.useCallback(P=>{var de,ne;const K=P.target;(de=oe.current)!=null&&de.contains(K)||(ne=W.current)!=null&&ne.contains(K)||A(!1)},[]),se=i.useMemo(()=>Un(_),[_]),be=i.useMemo(()=>Wn(new Date().getFullYear(),100),[]);let Q=null;switch($){case"days":Q=s.jsx(ms,{viewValue:I,value:k,showDaysOutsideMonth:u,onChange:ce,disablePast:o,disableFuture:l,weekStartsOn:d,minDate:f,maxDate:w,isDateDisabled:p,locale:_,range:g,rangeStart:T[0],rangeEnd:T[1]});break;case"months":Q=s.jsx(wt,{value:I.getMonth(),items:se,onChange:q});break;case"years":Q=s.jsx(wt,{value:I.getFullYear(),items:be,onChange:ie});break}const fe=g&&(T[0]||T[1])?`${ht(T[0],x)} – ${ht(T[1],x)}`:"";return s.jsxs(s.Fragment,{children:[g?s.jsx(Ke,{ref:ae,value:fe,readOnly:!0,onChange:()=>{},disabled:!!m,placeholder:x?`${x} – ${x}`:void 0,endAdornment:!h&&s.jsx(qe,{edge:"end",onClick:ue,disabled:!!m,"data-testid":"date-picker-icon-button",children:j||s.jsx(G,{name:"calendar_today",fill:1,weight:500,size:24})}),...R}):s.jsx(er,{ref:ae,value:k,onChange:a,onBlur:C,onToggle:ue,disabled:m,disableCalendar:h,format:x,calendarIcon:j,...R}),Fe.createPortal(s.jsx(Rt,{nodeRef:oe,in:F&&!m&&!h,timeout:150,mountOnEnter:!0,unmountOnExit:!0,children:P=>s.jsx(at,{onClickAway:_e,children:s.jsx("div",{ref:L,className:"smwb-date-picker",style:{...ee,...oi(150),...li[P]},"data-testid":"date-picker","data-smwb-overlay-layer":"",role:"dialog","aria-modal":"false","aria-label":b,children:s.jsxs("div",{className:"smwb-date-picker__inner",children:[s.jsx(ds,{viewValue:I,locale:_,openView:$,onChange:B,onMonthLabelClick:U,onYearLabelClick:te}),s.jsx("div",{className:"smwb-date-picker__body",children:Q})]})})})}),document.body)]})}),et=/yyyy|MM|dd|HH|mm|ss/g;function ui(e){const t=[];let n;for(et.lastIndex=0;(n=et.exec(e))!==null;)t.push(n[0]);return t}function $s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function di(e){let t="^",n=0,r;for(et.lastIndex=0;(r=et.exec(e))!==null;)t+=$s(e.slice(n,r.index)),t+=r[0]==="yyyy"?"(\\d{4})":"(\\d{2})",n=et.lastIndex;return t+=$s(e.slice(n)),t+="$",new RegExp(t)}function mi(e,t,n){if(t<1||t>12||n<1)return!1;const r=new Date(e,t-1,n);return r.getFullYear()===e&&r.getMonth()===t-1&&r.getDate()===n}function fi(e,t,n){return e>=0&&e<=23&&t>=0&&t<=59&&n>=0&&n<=59}function hi(e,t){const n=e.getFullYear(),r=e.getMonth()+1,a=e.getDate(),u=e.getHours(),o=e.getMinutes(),l=e.getSeconds();return t.replace(et,d=>d==="yyyy"?String(n).padStart(4,"0"):d==="MM"?String(r).padStart(2,"0"):d==="dd"?String(a).padStart(2,"0"):d==="HH"?String(u).padStart(2,"0"):d==="mm"?String(o).padStart(2,"0"):String(l).padStart(2,"0"))}function tr(e,t){const n=ui(t);if(!n.includes("yyyy")||!n.includes("MM")||!n.includes("dd")||!n.includes("HH")||!n.includes("mm"))return;const r=di(t).exec(e);if(!r)return;let a,u,o,l,d,c=0;if(n.forEach((m,h)=>{const b=Number(r[h+1]);if(m==="yyyy"){a=b;return}if(m==="MM"){u=b;return}if(m==="dd"){o=b;return}if(m==="HH"){l=b;return}if(m==="mm"){d=b;return}c=b}),!(a===void 0||u===void 0||o===void 0||l===void 0||d===void 0)&&!(!mi(a,u,o)||!fi(l,d,c)))return new Date(a,u-1,o,l,d,c)}function Pt(e,t){return tr(e,t)!==void 0}const bi=/[a-zA-Z]/g;function mt(e,t){return!e||Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e)?"":t?hi(e,t):new Intl.DateTimeFormat(void 0,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(e)}function Nt(e){return e||`${us()} HH:mm`}function wi(e){return Nt(e).replace(bi,"_")}function Fs(e,t){const n=tr(e,t);return n||new Date(Number.NaN)}function sr({value:e,onChange:t,onBlur:n,format:r}){const a=i.useMemo(()=>Nt(r),[r]),[u,o]=i.useState(mt(e,r)),l=i.useMemo(()=>wi(r),[r]),d=i.useMemo(()=>Gn(l),[l]),c=i.useRef(void 0);i.useEffect(()=>{const f=e!==c.current;c.current=e,f&&o(mt(e,r))},[e,r]);const m=f=>{o(f),t&&(Pt(f,a)?t(void 0,Fs(f,a)):f===""&&t(void 0))},h=i.useCallback(()=>{if(!n)return;const f=c.current;f instanceof Date&&Pt(mt(f,r),a)?n(void 0,f):typeof f=="string"&&Pt(f,a)?n(void 0,Fs(f,a)):(f===void 0||f==="")&&n(void 0),o(mt(e,r))},[n,e,r,a]);return{...Zt.useRifm({value:u,onChange:m,format:d}),onBlur:h,placeholder:Nt(r).toLowerCase()}}function pi(e){e.stopPropagation()}const nr=i.forwardRef(function(t,n){const{value:r,onChange:a,onBlur:u,onToggle:o,disabled:l,disableCalendar:d,calendarIcon:c,format:m,...h}=t,b=sr({value:r,onChange:a,onBlur:u,format:m});return s.jsx(Ke,{ref:n,...b,type:"tel",endAdornment:!d&&s.jsx(qe,{edge:"end",onClick:o,onMouseDown:pi,disabled:!!l,"data-testid":"date-time-picker-icon-button",children:c||s.jsx(G,{name:"event",fill:1,weight:500,size:24})}),disabled:!!l,...h})});function Ot({value:e,items:t,onChange:n}){const r=i.useRef(null),a=i.useRef(null);ke(()=>{if(r.current&&a.current){const l=(r.current.offsetHeight-a.current.offsetHeight)/2;r.current.scrollTop=a.current.offsetTop-l}});const u=i.useCallback(l=>()=>{n==null||n(l)},[n]),o=i.useCallback(l=>d=>{e===l&&(a.current=d)},[e]);return s.jsx("div",{className:"smwb-time-picker__overflow",ref:r,"data-testid":"time-picker-list",children:s.jsx("ul",{className:"smwb-time-picker__list",children:t.map(({label:l,value:d})=>{const c=e===d;return s.jsx("li",{ref:o(d),className:y("smwb-time-picker__item",{"smwb-time-picker__item--selected":c}),onClick:u(d),children:l},d)})})})}const tt=/HH|mm|ss/g;function rr(e){const t=[];let n;for(tt.lastIndex=0;(n=tt.exec(e))!==null;)t.push(n[0]);return t}function Ls(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _i(e){let t="^",n=0,r;for(tt.lastIndex=0;(r=tt.exec(e))!==null;)t+=Ls(e.slice(n,r.index)),t+="(\\d{2})",n=tt.lastIndex;return t+=Ls(e.slice(n)),t+="$",new RegExp(t)}function gi(e,t,n){return e>=0&&e<=23&&t>=0&&t<=59&&n>=0&&n<=59}function xi(e){return rr(e).includes("ss")}function vi(e,t){const n=e.getHours(),r=e.getMinutes(),a=e.getSeconds();return t.replace(tt,u=>u==="HH"?String(n).padStart(2,"0"):u==="mm"?String(r).padStart(2,"0"):String(a).padStart(2,"0"))}function ar(e,t){const n=rr(t);if(!n.includes("HH")||!n.includes("mm"))return;const r=_i(t).exec(e);if(!r)return;let a,u,o=0;if(n.forEach((d,c)=>{const m=Number(r[c+1]);if(d==="HH"){a=m;return}if(d==="mm"){u=m;return}o=m}),a===void 0||u===void 0||!gi(a,u,o))return;const l=new Date;return new Date(l.getFullYear(),l.getMonth(),l.getDate(),a,u,o)}function yi(e,t){return ar(e,t)!==void 0}const Ps=/\d/gi,ji=/[a-zA-Z]/g,_t="HH:mm";function ki(){return Array.from({length:24},(e,t)=>({value:t,label:String(t).padStart(2,"0")}))}function Ni(){return Array.from({length:60},(e,t)=>({value:t,label:String(t).padStart(2,"0")}))}function Ri(){return Array.from({length:60},(e,t)=>({value:t,label:String(t).padStart(2,"0")}))}function zt(e,t,n,r){const a=new Date(e);return a.setHours(t,n,r,0),a}function jt(e,t){return Ge(e)?vi(e,t!=null?t:_t):""}function bs(e){return e!=null?e:_t}function Ci(e){return bs(e).replace(ji,"_")}function Si(e){return t=>{let n=0;return t.split("").map((r,a)=>{if(Ps.lastIndex=0,n>e.length-1)return"";const u=e[n],o=e[n+1],l=Ps.test(r)?r:"",d=u==="_"?l:u+l;return n+=d.length,a===t.length-1&&o&&o!=="_"?d?d+o:"":d}).join("")}}function Bt(e,t){return yi(e,t)}function Os(e,t){const n=ar(e,t);return n||new Date(Number.NaN)}function Ge(e){return Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function Mi(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),0)}function Di(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),0)}function ws({value:e,format:t,onChange:n,onComplete:r}){const a=i.useMemo(()=>Ge(e)?e:new Date,[e]),u=t!=null?t:_t,o=xi(u),l=i.useMemo(()=>ki(),[]),d=i.useMemo(()=>Ni(),[]),c=i.useMemo(()=>Ri(),[]),m=i.useCallback(f=>{n(zt(a,f,a.getMinutes(),a.getSeconds()))},[a,n]),h=i.useCallback(f=>{n(zt(a,a.getHours(),f,a.getSeconds())),o||r==null||r()},[a,n,r,o]),b=i.useCallback(f=>{n(zt(a,a.getHours(),a.getMinutes(),f)),r==null||r()},[a,n,r]);return s.jsxs("div",{className:"smwb-time-picker__columns","data-testid":"time-picker-columns",children:[s.jsx("div",{className:"smwb-time-picker__column",children:s.jsx(Ot,{value:a.getHours(),items:l,onChange:m})}),s.jsx("div",{className:"smwb-time-picker__column",children:s.jsx(Ot,{value:a.getMinutes(),items:d,onChange:h})}),o&&s.jsx("div",{className:"smwb-time-picker__column",children:s.jsx(Ot,{value:a.getSeconds(),items:c,onChange:b})})]})}const Ti=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),Ei={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},Ii=i.forwardRef(function(t,n){const{value:r,onChange:a,showDaysOutsideMonth:u,disablePast:o,disableFuture:l,weekStartsOn:d=1,placement:c="bottom-start",disabled:m,disableCalendar:h,calendarAriaLabel:b="Choose date and time",minDate:f,maxDate:w,isDateDisabled:p,locale:_,format:x,timeFormat:g,calendarIcon:v,onBlur:S,...j}=t,C=i.useMemo(()=>r===void 0?void 0:new Date(r),[r]),[R,k]=i.useState(()=>Pe(C)||Ge(C)?C:new Date),[N,M]=i.useState(Ce.days),[E,T]=i.useState(!1),I=i.useRef(null),Y=i.useRef(null),$=rt(c),{refs:D,floatingStyles:F}=ye.useFloating({open:E,placement:$.placement,whileElementsMounted:ye.autoUpdate,middleware:Ct($)}),A=Ne(I,D.setReference,n),W=Ne(Y,D.setFloating);ke(()=>{m||k(Pe(C)||Ge(C)?C:new Date)},[C,m]);const oe=i.useCallback(se=>{k(se)},[]),Z=i.useCallback(()=>{M(N===Ce.months?Ce.days:Ce.months)},[N]),he=i.useCallback(()=>{M(N===Ce.years?Ce.days:Ce.years)},[N]),ee=i.useCallback(se=>{k(ls(R,se)),M(Ce.days)},[R]),ae=i.useCallback(se=>{k(cs(R,se)),M(Ce.days)},[R]),L=i.useCallback(se=>{k(se),a==null||a(void 0,se,t)},[a,t]),B=i.useCallback((se,be)=>{if(!be)return;const Q=Ge(C)?C:R;L(Di(be,Q))},[L,C,R]),U=i.useCallback(se=>{const be=Pe(C)?C:R;L(Mi(be,se))},[L,C,R]),te=i.useCallback(()=>{m||T(se=>!se)},[m]),q=i.useCallback(se=>{var Q,fe;const be=se.target;(Q=Y.current)!=null&&Q.contains(be)||(fe=I.current)!=null&&fe.contains(be)||T(!1)},[]),ie=i.useMemo(()=>g||(x!=null&&x.includes("HH:mm:ss")?"HH:mm:ss":_t),[x,g]),ce=i.useMemo(()=>Un(_),[_]),ue=i.useMemo(()=>Wn(new Date().getFullYear(),100),[]);let _e=null;switch(N){case Ce.days:_e=s.jsx(ms,{viewValue:R,value:C,showDaysOutsideMonth:u,onChange:B,disablePast:o,disableFuture:l,weekStartsOn:d,minDate:f,maxDate:w,isDateDisabled:p,locale:_});break;case Ce.months:_e=s.jsx(wt,{value:R.getMonth(),items:ce,onChange:ee});break;case Ce.years:_e=s.jsx(wt,{value:R.getFullYear(),items:ue,onChange:ae});break}return s.jsxs(s.Fragment,{children:[s.jsx(nr,{ref:A,value:C,onChange:a,onBlur:S,onToggle:te,disabled:m,disableCalendar:h,format:x,calendarIcon:v,...j}),Fe.createPortal(s.jsx(Rt,{nodeRef:Y,in:E&&!m&&!h,timeout:150,mountOnEnter:!0,unmountOnExit:!0,children:se=>s.jsx(at,{onClickAway:q,children:s.jsx("div",{ref:W,className:"smwb-date-picker smwb-date-time-picker",style:{...F,...Ti(150),...Ei[se]},"data-testid":"date-time-picker","data-smwb-overlay-layer":"",role:"dialog","aria-modal":"false","aria-label":b,children:s.jsxs("div",{className:"smwb-date-picker__inner smwb-date-time-picker__inner",children:[s.jsx(ds,{viewValue:R,locale:_,openView:N,onChange:oe,onMonthLabelClick:Z,onYearLabelClick:he}),s.jsxs("div",{className:"smwb-date-time-picker__content",children:[s.jsx("div",{className:"smwb-date-picker__body smwb-date-time-picker__body",children:_e}),s.jsx(ws,{value:R,format:ie,onChange:U})]})]})})})}),document.body)]})}),Ai=bs();function ir({value:e,onChange:t,onBlur:n,format:r}){const a=i.useMemo(()=>bs(r),[r]),[u,o]=i.useState(jt(e,r)),l=i.useMemo(()=>Ci(r),[r]),d=i.useMemo(()=>Si(l),[l]),c=i.useRef(void 0);i.useEffect(()=>{const f=e!==c.current;c.current=e,f&&o(jt(e,r))},[e,r]);const m=f=>{o(f),t&&(Bt(f,a)?t(void 0,Os(f,a)):f===""&&t(void 0))},h=i.useCallback(()=>{if(!n)return;const f=c.current;f instanceof Date&&Bt(jt(f,r),a)?n(void 0,f):typeof f=="string"&&Bt(f,a)?n(void 0,Os(f,a)):(f===void 0||f==="")&&n(void 0),o(jt(e,r))},[n,e,r,a]);return{...Zt.useRifm({value:u,onChange:m,format:d}),onBlur:h,placeholder:(r!=null?r:Ai).toLowerCase()}}function $i(e){e.stopPropagation()}const or=i.forwardRef(function(t,n){const{value:r,onChange:a,onBlur:u,onToggle:o,disabled:l,disableClock:d,clockIcon:c,format:m,...h}=t,b=ir({value:r,onChange:a,onBlur:u,format:m});return s.jsx(Ke,{ref:n,...b,type:"tel",endAdornment:!d&&s.jsx(qe,{edge:"end",onClick:o,onMouseDown:$i,disabled:!!l,"data-testid":"time-picker-icon-button",children:c||s.jsx(G,{name:"schedule",fill:1,weight:500,size:24})}),disabled:!!l,...h})}),Fi=e=>({transition:`opacity ${e}ms ease-in-out`,opacity:0}),Li={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0}},Pi=i.forwardRef(function(t,n){const{value:r,onChange:a,placement:u="bottom-start",disabled:o,disableClock:l,clockAriaLabel:d="Choose time",format:c,onBlur:m,...h}=t,b=i.useMemo(()=>r===void 0?void 0:new Date(r),[r]),[f,w]=i.useState(()=>Ge(b)?b:new Date),[p,_]=i.useState(!1),x=i.useRef(null),g=i.useRef(null),v=rt(u),{refs:S,floatingStyles:j}=ye.useFloating({open:p,placement:v.placement,whileElementsMounted:ye.autoUpdate,middleware:Ct(v)}),C=Ne(x,S.setReference,n),R=Ne(g,S.setFloating);ke(()=>{o||w(Ge(b)?b:new Date)},[b,o]);const k=i.useCallback(()=>{o||_(T=>!T)},[o]),N=i.useCallback(T=>{var Y,$;const I=T.target;(Y=g.current)!=null&&Y.contains(I)||($=x.current)!=null&&$.contains(I)||_(!1)},[]),M=i.useCallback(T=>{w(T),a==null||a(void 0,T,t)},[a,t]),E=i.useCallback(()=>{_(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(or,{ref:C,value:b,onChange:a,onBlur:m,onToggle:k,disabled:o,disableClock:l,format:c,...h}),Fe.createPortal(s.jsx(Rt,{nodeRef:g,in:p&&!o&&!l,timeout:150,mountOnEnter:!0,unmountOnExit:!0,children:T=>s.jsx(at,{onClickAway:N,children:s.jsx("div",{ref:R,className:"smwb-date-picker smwb-time-picker",style:{...j,...Fi(150),...Li[T]},"data-testid":"time-picker","data-smwb-overlay-layer":"",role:"dialog","aria-modal":"false","aria-label":d,children:s.jsx("div",{className:"smwb-date-picker__inner",children:s.jsx(ws,{value:f,format:c,onChange:M,onComplete:E})})})})}),document.body)]})});function lr(e){return/^image\/(png|jpeg)$/.test(e.type)}function cr(e){const{files:t,handleRemoveAll:n,previewCols:r,galleryItemSize:a,previewClassName:u}=e,o=y("smwb-file-drop__preview",u);return s.jsxs("div",{className:o,children:[s.jsx(Mt,{onClick:n,className:"smwb-file-drop__preview-button",children:s.jsx(G,{name:"delete",size:28})}),s.jsx(An,{className:"smwb-file-drop__preview-gallery",cols:r,rowsHeight:a,children:t.map(l=>{const d=lr(l)?URL.createObjectURL(l):null;return d?s.jsx(In,{className:"smwb-file-drop__preview-gallery-image",src:d,rows:1,cols:1,itemBarContent:l.name},l.name):s.jsx("div",{className:"smwb-file-drop__preview-gallery-file",style:{width:`${a-4}px`},children:l.name},l.name)})})]})}function ur({handleRemoveAll:e,filesLength:t,previewClassName:n,text:r}){const a=y("smwb-file-drop__preview",n);return s.jsxs("div",{className:a,children:[s.jsx(Mt,{onClick:e,className:"smwb-file-drop__preview-button",children:s.jsx(G,{name:"delete",size:28})}),s.jsx("div",{className:"smwb-file-drop__preview-count",children:`${r||"uploaded files:"} ${t}`})]})}function dr(e){const{previewCols:t,preview:n,galleryItemSize:r,handleRemoveAll:a,files:u,previewClassName:o}=e;return s.jsx(s.Fragment,{children:n?s.jsx(cr,{files:u,handleRemoveAll:a,previewCols:t,galleryItemSize:r,previewClassName:o}):s.jsx(ur,{filesLength:u.length,handleRemoveAll:a,previewClassName:o})})}const Oi=i.forwardRef(function(t,n){const{preview:r,previewCols:a=3,galleryItemSize:u=100,onDrop:o,label:l="",className:d,previewClassName:c,disabled:m,error:h,...b}=t,[f,w]=i.useState([]),p=S=>{w(j=>[...j,...S]),o(S)},{getRootProps:_,getInputProps:x}=St({onDrop:p,disabled:m,...b}),g=()=>{w([])},v=y("smwb-file-drop",{"smwb-disabled":m,"smwb-error":!!h},d);return s.jsxs("div",{ref:n,className:v,"data-testid":"file-drop",children:[f.length>0?s.jsx(dr,{preview:r,files:f,handleRemoveAll:g,previewCols:a,galleryItemSize:u,previewClassName:c}):s.jsxs("div",{className:"smwb-file-drop__input",role:"button",tabIndex:m?-1:0,"aria-disabled":m||void 0,"aria-label":l||"Upload files",..._(),children:[s.jsx("div",{className:"smwb-file-drop__input-text",children:l}),s.jsx("input",{...x()})]}),h?s.jsx("span",{className:"smwb-file-drop__error",role:"alert",children:h}):null]})}),zi=i.forwardRef(function(t,n){const{label:r,onClick:a,onFilesSelected:u,className:o,buttonClassName:l,disabled:d,error:c,...m}=t,{getRootProps:h,getInputProps:b}=St({...m,disabled:d,onDropAccepted:(w,p)=>{var _;u==null||u(w),(_=m.onDropAccepted)==null||_.call(m,w,p)}}),f=w=>{a==null||a(w)};return s.jsxs("div",{ref:n,className:y("smwb-file-input",{"smwb-disabled":d},o),"data-testid":"file-input",...h(),children:[s.jsx("button",{type:"button",className:y(l),disabled:d,onClick:f,children:r}),s.jsx("input",{...b()}),c?s.jsx("span",{className:"smwb-file-input__error",role:"alert",children:c}):null]})}),Bi=i.forwardRef(function(t,n){const{label:r,disabled:a,readOnly:u,required:o,name:l,id:d,size:c="medium",color:m="primary",helperText:h,error:b,onChange:f,className:w,...p}=t,_=pt(d),x=g=>{if(u){g.preventDefault();return}f==null||f(g,t.value!==void 0?t.value:g.target.checked,t)};return s.jsx(Ye,{helperText:h,disabled:a,error:b,className:"smwb-text-field-checkbox",children:s.jsxs("label",{htmlFor:_,className:y("smwb-radio",`smwb-radio_size-${c}`,`smwb-radio_color-${m}`,{"smwb-disabled":a,"smwb-readonly":u}),children:[s.jsxs("span",{className:"smwb-radio__wrapper",children:[s.jsx("input",{id:_,name:l,disabled:a,readOnly:u,required:o,"aria-invalid":b||void 0,"aria-required":o||void 0,className:y("smwb-radio__input",w),type:"radio","data-testid":"radio",ref:n,...p,onChange:x}),s.jsx("span",{className:y("smwb-radio__btn",{"smwb-disabled":a})}),s.jsx("span",{className:y("smwb-radio__bg",{"smwb-disabled":a})})]}),r&&s.jsx("span",{className:"smwb-radio__label",children:r})]})})}),Hi=i.forwardRef(function({className:t,value:n,defaultValue:r=0,max:a=5,precision:u=1,readOnly:o=!1,disabled:l=!1,size:d=28,icon:c,emptyIcon:m,name:h,color:b="primary",error:f,helperText:w,id:p,onChange:_},x){const g=n!==void 0,[v,S]=i.useState(r),[j,C]=i.useState(null),R=n!==void 0?n:v,k=j!=null?j:R,N=!o&&!l,M=(D,F)=>{if(u===1)return F+1;const{left:A,width:W}=D.currentTarget.getBoundingClientRect(),oe=D.clientX-A<W/2;return F+(oe?.5:1)},E=(D,F)=>{if(!N)return;const A=M(D,F);g||S(A),_==null||_(A)},T=c!=null?c:s.jsx(G,{name:"star",fill:1,size:d}),I=m!=null?m:s.jsx(G,{name:"star",size:d}),Y=D=>{const F=Math.max(0,Math.min(a,D));g||S(F),_==null||_(F)},$=D=>{N&&(D.key==="ArrowRight"||D.key==="ArrowUp"?(D.preventDefault(),Y(R+u)):D.key==="ArrowLeft"||D.key==="ArrowDown"?(D.preventDefault(),Y(R-u)):D.key==="Home"?(D.preventDefault(),Y(0)):D.key==="End"&&(D.preventDefault(),Y(a)))};return s.jsxs("span",{ref:x,id:p,className:y("smwb-rating",{"smwb-rating_readonly":o,"smwb-rating_disabled":l,"smwb-rating_error":f},b!=="primary"&&`smwb-rating_color-${b}`,t),"data-testid":"rating",role:"img","aria-label":`${R} of ${a}`,tabIndex:N?0:void 0,onKeyDown:N?$:void 0,children:[Array.from({length:a},(D,F)=>{const A=Math.max(0,Math.min(1,k-F));return s.jsxs("span",{className:"smwb-rating__item",style:{width:d,height:d,cursor:N?"pointer":"default"},onClick:W=>E(W,F),onMouseMove:N&&u===.5?W=>C(M(W,F)):N?()=>C(F+1):void 0,onMouseLeave:N?()=>C(null):void 0,children:[s.jsx("span",{className:"smwb-rating__icon smwb-rating__icon_empty",children:I}),s.jsx("span",{className:"smwb-rating__icon smwb-rating__icon_filled",style:{width:`${A*100}%`},children:T})]},F)}),h?s.jsx("input",{type:"hidden",name:h,value:R,readOnly:!0}):null,w!=null&&w!==!1?s.jsx("span",{className:y("smwb-rating__helper",f&&"smwb-rating__helper_error"),children:w}):null]})});function Vi({menuMaxHeight:e,menuMiddleware:t,search:n,onSearchInputChange:r,items:a,searchValue:u,isOpen:o,onClose:l,anchorElementRef:d,value:c,onItemClick:m,isLoading:h,optionRenderer:b,menuNoItemsMessage:f,container:w=document.body,createOption:p,virtualized:_,itemHeight:x=40}){const g=Array.isArray(c)?c:[c],v=a.some($=>!!$.group);let S;const j=!!_&&!v&&!h&&a.length>0,C=e||240,{startIndex:R,endIndex:k,totalHeight:N,offsetY:M,onScroll:E}=Jt({itemCount:j?a.length:0,itemHeight:x,viewportHeight:C}),T=$=>{var F;const D=[];return v&&$.group!==S&&(S=$.group,D.push(s.jsx("li",{className:"smwb-select-field__group-label",role:"presentation",children:$.group},`group-${(F=$.group)!=null?F:"ungrouped"}`))),D.push(s.jsxs(nt,{value:$.value,disabled:$.disabled,selected:!!g.find(A=>A===$.value),onClick:A=>{$.disabled||m(A,$)},optionRenderer:b,children:[$.text,$.helperText?s.jsx("span",{className:"smwb-select-field__option__helper-text",children:$.helperText}):null]},$.key||$.value)),D},[I,Y]=i.useState();return i.useEffect(()=>{o&&d.current&&Y(d.current.clientWidth)},[d,o]),i.useEffect(()=>{const $=D=>{o&&D.key==="Escape"&&l()};return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$)}},[o,l]),Fe.createPortal(s.jsxs(Tt,{isOpen:o,onClose:l,anchorElement:d.current,middleware:t,"data-smwb-overlay-layer":"",style:{minWidth:I,maxHeight:e||void 0,overflowY:e?"auto":void 0},children:[n&&s.jsxs(s.Fragment,{children:[s.jsx("li",{className:"smwb-select-field__menu-search",children:s.jsx(Ke,{className:"smwb-select-field__menu-search-input",type:"text",placeholder:"Найти...",value:u,onChange:($,D)=>r==null?void 0:r($,D.value),fullWidth:!0})}),s.jsx(qn,{})]}),h?s.jsx("div",{className:"smwb-select-field__menu-loading",children:s.jsx(Pn,{type:"indeterminate",variant:"circular",className:"smwb-select-field__menu__loader"})}):j?s.jsx("li",{role:"presentation",className:"smwb-select-field__virtual-viewport",children:s.jsx("div",{className:"smwb-select-field__virtual-scroller",style:{maxHeight:C,overflowY:"auto"},onScroll:E,children:s.jsx("div",{style:{height:N,position:"relative"},children:s.jsx("ul",{role:"presentation",className:"smwb-select-field__virtual-list",style:{transform:`translateY(${M}px)`,listStyle:"none",margin:0,padding:0},children:a.slice(R,k).map($=>T($))})})})}):a.length?a.map($=>T($)):p?null:s.jsx("li",{className:"smwb-select-field__empty-items",children:f||"Опций не найдено."}),p?s.jsx(nt,{value:"__create__",onClick:$=>p.onCreate($),className:"smwb-select-field__create-option",children:p.text},"__create__"):null]}),w)}const Yi=e=>s.jsx(G,{name:"arrow_drop_down",...e}),Ki=e=>s.jsx(G,{name:"close",size:20,...e});function zs(e){e.preventDefault(),e.stopPropagation()}const Xi=i.forwardRef(function(t,n){const{className:r,value:a,defaultValue:u,onChange:o,disabled:l,readOnly:d,name:c,multiple:m,menuMaxHeight:h,menuMiddleware:b,menuNoItemsMessage:f,menuContainer:w,search:p,chips:_,isFocused:x,error:g,items:v,label:S,variant:j="outlined",fullWidth:C,helperText:R,onSearch:k,resetSearch:N,isLoading:M,inline:E,endAdornment:T,hideSelectArrowIcon:I,optionRenderer:Y,clearable:$,creatable:D,onCreate:F,virtualized:A,itemHeight:W,"aria-label":oe,id:Z,...he}=t,[ee,ae]=i.useState(!1),[L,B]=i.useState(u),[U,te]=i.useState(()=>{const X=a!=null?a:u;if(Array.isArray(X))return v.filter(Se=>X.includes(Se.value));const we=X==null?void 0:v.find(Se=>Se.value===X);return we?[we]:[]}),[q,ie]=i.useState(""),{current:ce}=i.useRef(a!=null),ue=i.useRef(null),_e=Ne(n,ue),se=i.useRef(null),be=i.useRef(null),Q=ce?a:L,fe=i.useMemo(()=>x||ee,[x,ee]),P=X=>{var we;X.button===0&&(X.preventDefault(),(we=ue.current)==null||we.focus(),ae(!ee))},K=()=>{var X;ae(!1),(X=ue.current)==null||X.focus()},de=()=>{var X;p===!0&&((X=be.current)==null||X.focus())},ne=X=>{d||[" ","ArrowUp","ArrowDown","Enter"].includes(X.key)&&(X.preventDefault(),ae(!ee))};i.useEffect(()=>{(!fe||p==="menu"&&!ee)&&(ie(""),N==null||N())},[fe,p,ee,N]),i.useEffect(()=>{if(Array.isArray(Q))te(v.filter(X=>Q.includes(X.value)));else if(Q==null||Q==="")te([]);else{const X=v.find(we=>we.value===Q);te(X?[X]:[])}},[Q,v]),ke(()=>{se.current&&(se.current.scrollLeft=se.current.scrollWidth)},[Q]);const H=(X,we)=>{o==null||o(X,{...t,value:we,name:c||void 0}),B(we)},le=(X,we)=>{var Oe;let Se,Le;if(m){const z=Array.isArray(Q)?Q:[Q].filter(Boolean);Se=z.slice(),Le=U.slice();const V=z.findIndex(re=>re===we.value);V===-1?(Se.push(we.value),Le.push(we)):(Se.splice(V,1),Le.splice(V,1))}else Se=Q===we.value?"":we.value,Le=[we];q&&ie(""),m||(ae(!1),(Oe=ue.current)==null||Oe.focus()),te(Le),H(X,Se)},me=X=>{ie(X.target.value),k==null||k(X),ee||ae(!0)},Re=X=>we=>{if(Array.isArray(Q)){const Se=Q.filter(Oe=>X!==Oe);H(we,Se);const Le=U.filter(Oe=>Oe.value!==X);te(Le)}},De=X=>{H(X,[]),te([])};let Ee;const Te=y("smwb-select-field",r,{"smwb-select-field--filled":j==="filled"&&S,"smwb-select-field--disabled":l,"smwb-select-field--search":p,"smwb-select-field--inline":E});return _?Ee=U.map(({key:X,value:we,text:Se})=>s.jsx(as,{label:Se,onDelete:Re(we),onDeleteMouseDown:zs},X||we)):Ee=U.map(X=>X.text).join(", "),s.jsxs(s.Fragment,{children:[s.jsx(Ye,{label:S,helperText:R,variant:j,disabled:l,className:r,error:g,fullWidth:C,isFilledState:!!U.length||!!q,isFocused:fe,inline:E,...he,children:s.jsxs("span",{ref:_e,id:Z,className:Te,tabIndex:l?void 0:0,role:"button","aria-haspopup":"listbox","aria-expanded":ee,"aria-disabled":l||void 0,"aria-label":oe,onMouseDown:l||d?void 0:P,onFocus:de,onKeyDown:ne,"data-testid":"select-field",children:[s.jsxs("span",{className:"smwb-select-field__search-wrapper",ref:se,children:[Ee&&s.jsx("span",{className:"smwb-select-field__values",children:Ee}),p&&typeof p=="boolean"&&!d&&s.jsxs("span",{className:"smwb-select-field__search",children:[s.jsx("span",{className:"smwb-select-field__search-text",children:q}),s.jsx("input",{className:"smwb-select-field__search-input",ref:be,type:"text",value:q,onChange:me,onMouseDown:X=>{X.stopPropagation(),ae(!0)},onKeyDown:X=>{X.stopPropagation()},"data-testid":"search-input"})]})]}),s.jsxs("span",{className:"smwb-select-field__actions",children:[(Array.isArray(Q)&&Q.length>0||$&&U.length>0)&&!l&&s.jsx(Ki,{onClick:De,onMouseDown:zs,className:y("smwb-select-field__icon","smwb-select-field__icon--close"),"aria-label":"Clear selection",role:"button"}),T,!I&&s.jsx(Yi,{className:y("smwb-select-field__icon","smwb-select-field__icon--arrow",{"smwb-select-field__icon--opened":ee,"smwb-select-field__icon--focused":fe,"smwb-select-field__icon--error":g})})]})]})}),s.jsx(Vi,{anchorElementRef:ue,menuMaxHeight:h,menuMiddleware:b,search:p==="menu",onSearchInputChange:me,optionRenderer:Y,items:k?v:q?v.filter(X=>X.text.search(new RegExp(q,"i"))!==-1):v,searchValue:q,isOpen:ee,onClose:K,onItemClick:le,value:Q,isLoading:M,menuNoItemsMessage:f,container:w,virtualized:A,itemHeight:W,createOption:D&&q&&!v.some(X=>X.text.toLowerCase()===String(q).toLowerCase())?{text:`Создать "${q}"`,onCreate:X=>{F==null||F(String(q),X),ie(""),ae(!1)}}:void 0})]})});function bt(e,t,n){return(e-t)/(n-t)*100}function Ui(e){return(`${e}`.split(".")[1]||"").length}function Bs(e,t,n){return Math.max(t,Math.min(e,n))}function Hs(e,t=1){const n=Math.pow(10,t);return Math.round(e*n)/n}function Wi(e,t,n,r){if(r==null||r<=0)return Bs(e,t,n);const a=Ui(r),u=Hs(Math.round((e-t)/r)*r,a),o=Hs(Math.floor((n-t)/r)*r,a);return t+Bs(u,0,o)}function qt(e,t,n,r={}){const a=(e-t[0])/(t[1]-t[0])*(n[1]-n[0])+n[0];return Wi(a,n[0],n[1],r.step)}function mr(e){return e instanceof MouseEvent?e.clientX:e instanceof TouchEvent?e.changedTouches[0].clientX:0}function fr(e){return e instanceof MouseEvent?e.clientY:e instanceof TouchEvent?e.changedTouches[0].clientY:0}function hr(e,t,n,r){if(!e)return[];if(Array.isArray(e))return e;const a=r&&r>0?r:(n-t)/10,u=[];for(let o=t;o<=n+1e-9;o+=a)u.push({value:Math.round(o*1e6)/1e6});return u}const Gi=i.forwardRef(function(t,n){const{defaultValue:r,value:a,onChange:u,min:o=0,max:l=100,name:d,disabled:c=!1,className:m,step:h,label:b,helperText:f,error:w,size:p="medium",color:_="primary",orientation:x="horizontal",marks:g,getAriaValueText:v,"aria-label":S,range:j,variant:C,valueField:R,withTicks:k,...N}=t,M=x==="vertical",E=P=>{var H,le,me,Re;const K=Array.isArray(P)?P:[o,l],de=Math.min((H=K[0])!=null?H:o,(le=K[1])!=null?le:l),ne=Math.max((me=K[0])!=null?me:o,(Re=K[1])!=null?Re:l);return[de,ne]},T=a!==void 0,[I,Y]=i.useState(()=>E(r)),$=T?E(a):I,D=i.useRef(null),F=Ne(n,D),A=i.useRef(0),W=i.useRef(!1),oe=hr(g,o,l,h),Z=P=>{var ne;const K=(ne=D.current)==null?void 0:ne.getBoundingClientRect();if(!K)return o;if(M){const H=(typeof P.clientY=="number"?P.clientY:fr(P))-K.top;return qt(K.height-H,[0,K.height],[o,l],{step:h})}const de=(typeof P.clientX=="number"?P.clientX:mr(P))-K.left;return qt(de,[0,K.width],[o,l],{step:h})},he=(P,K)=>{const de=Math.min(P[0],P[1]),ne=Math.max(P[0],P[1]),H=[Math.max(o,de),Math.min(l,ne)];T||Y(H),u==null||u(K,H,t)},ee=(P,K)=>{const de=A.current,ne=[$[0],$[1]];ne[de]=Math.max(o,Math.min(l,P)),he(ne,K)},ae=P=>{A.current=Math.abs(P-$[0])<=Math.abs(P-$[1])?0:1},L=ze(P=>{W.current&&(P.preventDefault(),ee(Z(P),P))}),B=ze(()=>{W.current=!1,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",B),document.removeEventListener("touchmove",L),document.removeEventListener("touchend",B)}),U=P=>{if(c||P.button!==0)return;const K=Z(P);ae(K),W.current=!0,ee(K,P),document.addEventListener("mousemove",L),document.addEventListener("mouseup",B)},te=P=>{if(c)return;const K=Z(P);ae(K),W.current=!0,ee(K,P),document.addEventListener("touchmove",L),document.addEventListener("touchend",B)};ke(()=>{const P=D.current;if(P)return P.addEventListener("touchstart",te),()=>P.removeEventListener("touchstart",te)});const q=P=>K=>{if(c)return;const de=h&&h>0?h:1;let ne=null;K.key==="ArrowLeft"||K.key==="ArrowDown"?ne=$[P]-de:K.key==="ArrowRight"||K.key==="ArrowUp"?ne=$[P]+de:K.key==="Home"?ne=o:K.key==="End"&&(ne=l),ne!==null&&(K.preventDefault(),A.current=P,ee(ne,K))},ie=y("smwb-slider","smwb-slider--range",m,{"smwb-slider--disabled":c,"smwb-slider--vertical":M},p!=="medium"&&`smwb-slider_size-${p}`,_!=="primary"&&`smwb-slider_color-${_}`),ce=bt($[0],o,l),ue=bt($[1],o,l),_e=`${Math.min(ce,ue)}%`,se=`${Math.abs(ue-ce)}%`,be=M?{bottom:`${ce}%`}:{left:`${ce}%`},Q=M?{bottom:`${ue}%`}:{left:`${ue}%`},fe=M?{bottom:_e,height:se}:{left:_e,width:se};return s.jsx(Ye,{label:b,helperText:f,disabled:c,error:w,fullWidth:!0,shrink:!0,children:s.jsx("div",{className:"smwb-slider__container",children:s.jsxs("span",{ref:F,onMouseDown:U,className:ie,...N,children:[oe.length>0&&s.jsx("span",{className:"smwb-slider__marks","aria-hidden":"true",children:oe.map(P=>{const K=`${bt(P.value,o,l)}%`;return s.jsx("span",{className:"smwb-slider__mark",style:M?{bottom:K}:{left:K},children:P.label!=null&&s.jsx("span",{className:"smwb-slider__mark-label",children:P.label})},P.value)})}),s.jsx("span",{className:"smwb-slider__rail"}),s.jsx("span",{className:"smwb-slider__track",style:fe}),[0,1].map(P=>s.jsx("span",{className:y("smwb-slider__thumb",`smwb-slider__thumb--${P===0?"start":"end"}`),style:P===0?be:Q,children:s.jsx("input",{"data-testid":`slider-input-${P}`,className:"smwb-slider__input",type:"range",min:o,max:l,step:h,name:d?`${d}[${P}]`:void 0,value:$[P],disabled:c,onChange:()=>{},onKeyDown:q(P),tabIndex:c?-1:0,"aria-label":S?`${S} ${P===0?"minimum":"maximum"}`:void 0,"aria-orientation":x,"aria-valuenow":$[P],"aria-valuemin":P===0?o:$[0],"aria-valuemax":P===0?$[1]:l,"aria-valuetext":v?v($[P]):void 0,"aria-disabled":c||void 0})},P))]})})})}),qi=i.forwardRef(function(t,n){const{defaultValue:r,value:a,onChange:u,min:o=0,max:l=100,name:d,disabled:c=!1,className:m,step:h,variant:b="continuous",valueField:f,withTicks:w,label:p,helperText:_,error:x,size:g="medium",color:v="primary",orientation:S="horizontal",marks:j,range:C,getAriaValueText:R,"aria-label":k,...N}=t,M=typeof r=="number"?r:void 0,E=typeof a=="number"?a:void 0,T=S==="vertical",[I,Y]=i.useState(M!=null?M:o),[$,D]=i.useState(!1),[F,A]=i.useState(!1),[W,oe]=i.useState(!1),Z=i.useRef(null),he=Ne(n,Z),ee=i.useRef(!1),ae=E!==void 0,L=b==="discrete",B=ae?E:I,U=(H,le)=>{H<o||H>l||(ae||Y(H),u==null||u(le,H,t))},te=(H,le)=>qt(H,[0,le],[o,l],{step:h}),q=H=>{if(c||H.button!==0)return;ee.current=!0;const le=Z.current,me=le==null?void 0:le.getBoundingClientRect();if(me){const Re=T?me.height-(H.clientY-me.top):H.clientX-me.left,De=te(Re,T?me.height:me.width);F||A(!0),U(De,H)}document.addEventListener("mousemove",ce),document.addEventListener("mouseup",ue)},ie=H=>{var Re;if(c)return;ee.current=!0;const le=Z.current,me=le==null?void 0:le.getBoundingClientRect();if(me){const De=(Re=H.changedTouches)==null?void 0:Re[0],Ee=T?me.height-(De.clientY-me.top):De.clientX-me.left,Te=te(Ee,T?me.height:me.width);F||A(!0),U(Te,H)}document.addEventListener("touchmove",ce),document.addEventListener("touchend",ue)},ce=ze(H=>{if(ee.current){const le=Z.current,me=le==null?void 0:le.getBoundingClientRect();if(me){const Re=mr(H),De=fr(H),Ee=T?me.height-(De-me.top):Re-me.left,Te=te(Ee,T?me.height:me.width);if(F||A(!0),B===Te)return;$||D(!0),U(Te,H)}}}),ue=ze(()=>{ee.current=!1,$&&D(!1),F&&A(!1),_e()}),_e=()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",ue),document.removeEventListener("touchmove",ce),document.removeEventListener("touchend",ue)},se=H=>{!W||c||((H.key==="ArrowLeft"||H.key==="ArrowDown")&&U(B-(h||1),H),(H.key==="ArrowRight"||H.key==="ArrowUp")&&U(B+(h||1),H))},be=()=>{oe(!1),document.removeEventListener("keydown",se)};ke(()=>{if(Z.current)return Z.current.addEventListener("touchstart",ie),()=>{var H;(H=Z.current)==null||H.removeEventListener("touchstart",ie)}}),ke(()=>{var H,le;c&&((H=Z.current)!=null&&H.contains(document.activeElement))&&((le=document.activeElement)==null||le.blur())},[c]);const Q=y("smwb-slider",m,{"smwb-slider--disabled":c,"smwb-slider--dragging":$,"smwb-slider--discrete":L,"smwb-slider--vertical":T},g!=="medium"&&`smwb-slider_size-${g}`,v!=="primary"&&`smwb-slider_color-${v}`),fe=`${bt(B,o,l)}%`,P=T?{height:fe}:{width:fe},K=T?{bottom:fe}:{left:fe},de=()=>Array(Math.round(l/(h||1))+1).fill(1),ne=hr(j,o,l,h);return s.jsx(Ye,{label:p,helperText:_,disabled:c,error:x,fullWidth:!0,shrink:!0,children:s.jsxs("div",{className:"smwb-slider__container",children:[s.jsxs("span",{onKeyDown:se,ref:he,onMouseDown:q,className:Q,tabIndex:c?-1:0,onFocus:()=>oe(!0),onBlur:be,...N,children:[w&&s.jsx("span",{className:"smwb-slider__ticks",style:{gap:`${h}`},children:de().map((H,le)=>s.jsx("span",{className:"smwb-slider__tick"},le))}),ne.length>0&&s.jsx("span",{className:"smwb-slider__marks","aria-hidden":"true",children:ne.map(H=>{const le=`${bt(H.value,o,l)}%`;return s.jsx("span",{className:"smwb-slider__mark",style:T?{bottom:le}:{left:le},children:H.label!=null&&s.jsx("span",{className:"smwb-slider__mark-label",children:H.label})},H.value)})}),s.jsx("span",{className:"smwb-slider__rail"}),s.jsx("span",{className:"smwb-slider__track",style:P}),s.jsxs("span",{className:y("smwb-slider__thumb",{"smwb-slider__thumb--active":F,"smwb-slider__thumb--discrete":L}),style:K,children:[L&&s.jsx("span",{className:"smwb-slider__thumb-tooltip",children:Math.round(B)}),s.jsx("input",{"data-testid":"slider-input",className:"smwb-slider__input",type:"range",min:o,max:l,name:d,value:B,readOnly:!0,"aria-label":k,"aria-orientation":S,"aria-valuenow":B,"aria-valuemin":o,"aria-valuemax":l,"aria-valuetext":R?R(B):void 0,"aria-disabled":c||void 0})]})]}),f&&L&&s.jsx(Ke,{type:"number",value:B,onChange:H=>U(+H.target.value,H),variant:"filled",helperText:null})]})})}),br=i.forwardRef(function(t,n){return t.range===!0||Array.isArray(t.value)||Array.isArray(t.defaultValue)?s.jsx(Gi,{ref:n,...t}):s.jsx(qi,{ref:n,...t})});function Zi(e,t){return typeof e=="function"?e(t):Array.isArray(t)?`${t[0]} – ${t[1]}`:t==null?"":String(t)}function Ji({readout:e,endAdornment:t,onReset:n,resetLabel:r,label:a,className:u,...o}){const l=e!==void 0&&e!==!1,d=a!=null||l||t!=null||n!=null;return s.jsxs("div",{className:y("smwb-value-slider",u),children:[d?s.jsxs("div",{className:"smwb-value-slider__header",children:[a!=null?s.jsx("span",{className:"smwb-value-slider__label",children:a}):null,s.jsx("span",{className:"smwb-value-slider__spacer"}),l?s.jsx("span",{className:"smwb-value-slider__readout",children:Zi(e,o.value)}):null,t,n!=null?s.jsx("button",{type:"button",className:"smwb-value-slider__reset","aria-label":r!=null?r:"Reset",disabled:!!o.disabled,onClick:()=>n(),children:s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7M3 4v4h4",strokeLinecap:"round",strokeLinejoin:"round"})})}):null]}):null,s.jsx(br,{...o})]})}const Qi=i.forwardRef(function(t,n){const{disabled:r,readOnly:a,required:u,checked:o,className:l,id:d,label:c,labelPlacement:m,size:h="medium",color:b="primary",helperText:f,error:w,...p}=t,_=pt(d),x=g=>{var v;if(a){g.preventDefault();return}(v=t.onChange)==null||v.call(t,g,g.target.checked,t)};return s.jsx(Ye,{helperText:f,disabled:r,error:w,className:"smwb-text-field-checkbox",children:s.jsxs("span",{className:y("smwb-toggle__wrapper",m&&`smwb-toggle__wrapper_label-${m}`),children:[c?s.jsx("label",{htmlFor:_,className:"smwb-toggle__label",children:c}):null,s.jsxs("label",{className:y("smwb-toggle",`smwb-toggle_size-${h}`,`smwb-toggle_color-${b}`,l,{"smwb-disabled":r,"smwb-readonly":a}),children:[s.jsx("input",{type:"checkbox",id:_,className:"smwb-toggle__checkbox","aria-checked":o,"aria-invalid":w||void 0,"aria-required":u||void 0,role:"switch",checked:o,disabled:r,readOnly:a,required:u,ref:n,...p,onChange:x}),s.jsx("span",{className:"smwb-toggle__track"}),s.jsx("span",{className:"smwb-toggle__thumb"})]})]})})}),eo=i.forwardRef(function({className:t,...n},r){return s.jsx("div",{ref:r,"data-testid":"grid",className:y("smwb-grid",t),...n})}),to=["wrap","nowrap","wrap-reverse"],so=["flex-start","center","flex-end","space-between","space-around","space-evenly"],no=["flex-start","center","flex-end","stretch","baseline"],ro=["row","row-reverse","column","column-reverse"],ao=i.forwardRef(function({className:t,justifyContent:n,alignItems:r,direction:a,wrap:u,spacing:o,...l},d){const c=n&&so.includes(n)&&n!=="flex-start",m=r&&no.includes(r)&&r!=="flex-start",h=a&&ro.includes(a)&&a!=="row",b=u&&to.includes(u)&&u!=="wrap",f=y("smwb-grid__row",t,{[`smwb-grid__row--spacing-${o}`]:o,[`smwb-grid__row--justifyContent-${n}`]:c,[`smwb-grid__row--alignItems-${r}`]:m,[`smwb-grid__row--direction-${a}`]:h,[`smwb-grid__row--${u}`]:b});return s.jsx("div",{ref:d,"data-testid":"grid-row",className:f,...l})}),io=e=>e===void 0?{}:typeof e=="boolean"?{"smwb-grid__column--hidden":e}:Object.keys(e).reduce((t,n)=>(t[`smwb-grid__column--hidden-${n}`]=e[n]===!0,t[`smwb-grid__column--visible-${n}`]=e[n]===!1,t),{}),oo=i.forwardRef(function({className:t,xs:n,sm:r,md:a,lg:u,xl:o,xsOffset:l,smOffset:d,mdOffset:c,lgOffset:m,xlOffset:h,hidden:b,...f},w){const p=y("smwb-grid__column",t,{[`smwb-grid__column--xs-${n}`]:n,[`smwb-grid__column--sm-${r}`]:r,[`smwb-grid__column--md-${a}`]:a,[`smwb-grid__column--lg-${u}`]:u,[`smwb-grid__column--xl-${o}`]:o,[`smwb-grid__column--xs-offset-${l}`]:l,[`smwb-grid__column--sm-offset-${d}`]:d,[`smwb-grid__column--md-offset-${c}`]:c,[`smwb-grid__column--lg-offset-${m}`]:m,[`smwb-grid__column--xl-offset-${h}`]:h,...io(b)});return s.jsx("div",{ref:w,className:p,"data-testid":"grid-col",...f})}),lo=i.forwardRef(function({className:t,maxWidth:n="lg",disableGutters:r=!1,...a},u){const o=y("smwb-container",{[`smwb-container--${n}`]:n!==!1,"smwb-container--gutterless":r},t);return s.jsx("div",{ref:u,"data-testid":"grid-container",className:o,...a})}),co={default:void 0,primary:"var(--smui-primaryColor)",secondary:"var(--smui-secondaryColor)",error:"var(--smui-errorColor)",success:"var(--smui-successColor)",warning:"var(--smui-warningColor)",info:"var(--smui-infoColor)"},uo=i.forwardRef(function({className:t,orientation:n="horizontal",variant:r="fullWidth",textAlign:a="center",color:u="default",thickness:o,flexItem:l,style:d,children:c,...m},h){const b=c!=null&&c!==!1,f=co[u],w=typeof o=="number"?`${o}px`:o,p={...d,...f?{borderColor:f}:{},...w?n==="vertical"?{borderLeftWidth:w}:{borderBottomWidth:w}:{}},_=y("smwb-divider",`smwb-divider_${n}`,`smwb-divider_${r}`,{"smwb-divider_with-text":b&&n==="horizontal",[`smwb-divider_align-${a}`]:b&&n==="horizontal","smwb-divider_flex-item":l},t);return s.jsx("div",{...m,ref:h,"data-testid":"divider",role:"separator","aria-orientation":n,className:_,style:p,children:b&&n==="horizontal"?s.jsx("span",{className:"smwb-divider__text",children:c}):null})});function mo(e,t){let n=0,r,a;const u=(l,d)=>{n=l,e(...d)},o=(...l)=>{const d=Date.now(),c=t-(d-n);a=l,c<=0||c>t?(r!==void 0&&(clearTimeout(r),r=void 0),u(d,l)):r===void 0&&(r=setTimeout(()=>{r=void 0,a!==void 0&&u(Date.now(),a)},c))};return o.cancel=()=>{r!==void 0&&(clearTimeout(r),r=void 0),n=0,a=void 0},o}const Vs=(e,t)=>!e&&t?100-t:e||50,fo=i.forwardRef(function({className:t,orientation:n="horizontal",sizeFirst:r,sizeSecond:a,children:u,onSizeChange:o,keyboardStep:l=5,resizerAriaLabel:d="Resize panels"},c){const m=i.useRef(null),h=Ne(c,m),[b,f]=i.useState(Vs(r,a)),[w,p]=i.useState(null),[_,x]=i.useState(!1);i.useEffect(()=>{f(Vs(r,a))},[r,a]);const g=i.Children.toArray(u);if(g.length>2)throw new Error("Allowed not more than 2 children");const v=()=>{p(m.current),x(!0)},S=i.useMemo(()=>mo(N=>{if(!_)return;const M=m.current;if(!M||M!==w)return;const E=M.getBoundingClientRect(),T=n==="vertical"?E.height:E.width,I=n==="vertical"?N.clientY-E.top:N.clientX-E.left,Y=Math.max(5,Math.min(T-5,I));f(Y/T*100)},1e3/60),[_,w,n]),j=i.useCallback(()=>{p(null),x(!1),document.body.removeEventListener("pointerup",j),document.body.removeEventListener("pointermove",S)},[S]);i.useEffect(()=>{o==null||o(b)},[b,o]);const C=N=>{const M=n==="vertical"?"ArrowUp":"ArrowLeft",E=n==="vertical"?"ArrowDown":"ArrowRight";N.key===M?(N.preventDefault(),f(T=>Math.max(0,T-l))):N.key===E?(N.preventDefault(),f(T=>Math.min(100,T+l))):N.key==="Home"?(N.preventDefault(),f(0)):N.key==="End"&&(N.preventDefault(),f(100))},R=n==="vertical"?{height:`${100-b}%`}:{width:`${100-b}%`},k=n==="vertical"?{height:`${b}%`}:{width:`${b}%`};return i.useEffect(()=>(_?(document.body.addEventListener("pointerup",j),document.body.addEventListener("pointermove",S),document.body.style.cursor=n==="horizontal"?"e-resize":"n-resize"):document.body.style.cursor="default",()=>{document.body.removeEventListener("pointerup",j),document.body.removeEventListener("pointermove",S)}),[S,j,_,n]),s.jsxs("div",{className:y("smwb-screen-divider__wrapper",`smwb-${n}`,t),ref:h,"data-testid":"screen-divider",children:[s.jsx("div",{className:y("smwb-screen-divider__first",`smwb-${n}`),style:k,children:g[0]||""}),s.jsx("span",{className:"smwb-screen-divider__resizer",onPointerDown:v,draggable:!1,role:"separator","aria-orientation":n==="vertical"?"horizontal":"vertical","aria-valuenow":Math.round(b),"aria-valuemin":0,"aria-valuemax":100,"aria-label":d,tabIndex:0,onKeyDown:C}),s.jsx("div",{className:y("smwb-screen-divider__second",`smwb-${n}`),style:R,children:g[1]||""})]})}),ho=i.forwardRef(function({isOpen:t,onClose:n,variant:r="default",children:a,placement:u="bottom",disableOutsideClick:o,closeOnEsc:l=!0,...d},c){const[m,h]=i.useState(null),b=i.useRef(null);i.useEffect(()=>{if(!t||!l||!n)return;const p=_=>{_.key==="Escape"&&Mn(b.current)&&n()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,l,n]);const f=()=>{h(m==="expanded"?"small":m?null:"expanded")},w=()=>{n==null||n(),h(null)};return Fe.createPortal(s.jsx(Ue.CSSTransition,{in:t,timeout:70,mountOnEnter:!0,unmountOnExit:!0,classNames:{enterDone:"smwb-entered"},appear:!0,nodeRef:b,children:r==="default"?s.jsx("div",{className:y(o?"smwb-sheet__overlay":"smwb-sheet__default"),ref:b,"data-smwb-overlay-layer":"",children:s.jsx(Ys,{ref:c,onClose:n,handleSizeButton:f,handleClose:w,isOpen:t,mode:m,placement:u,variant:r,...d,children:a})}):s.jsx("div",{className:y("smwb-sheet__overlay","smwb-dark",`smwb-${u}`,`smwb-sheet_${r}`),ref:b,"data-smwb-overlay-layer":"",children:s.jsx(at,{onClickAway:()=>!o&&w(),children:s.jsx(Ys,{ref:c,onClose:n,handleSizeButton:f,handleClose:w,isOpen:t,mode:m,placement:u,variant:r,...d,children:a})})})}),document.body)}),bo=e=>e==="bottom"||e==="top",Ys=i.forwardRef(function(t,n){const{isOpen:r,placement:a,className:u,mode:o,size:l="60%",variant:d,onClose:c,withSizeToggle:m=!0,hideHeaderActions:h=!1,reverseHeaderActions:b=!1,resizable:f=!1,minSize:w=80,maxSize:p,resizeStep:_=24,resizeHandleAriaLabel:x="Resize sheet",onResize:g,style:v,handleClose:S,handleSizeButton:j,children:C,...R}=t,k=!h&&(!!c||m),N=[];m&&N.push(s.jsx(Ae,{variant:"outlined",size:"small",onClick:j,children:s.jsx(G,{name:"open_in_full"})},"size")),c&&N.push(s.jsx(Ae,{variant:"outlined",size:"small",onClick:S,children:s.jsx(G,{name:"close"})},"close")),b&&N.reverse();const M=i.useRef(null),E=i.useRef(null),T=Ne(n,M,E),[I,Y]=i.useState(null),$=bo(a),D=i.useCallback(L=>{const B=$?window.innerHeight:window.innerWidth,U=p!=null?p:B;return Math.max(w,Math.min(U,L))},[$,p,w]),F=i.useCallback(()=>{var B;const L=(B=E.current)==null?void 0:B.getBoundingClientRect();return L?$?L.height:L.width:w},[$,w]),A=i.useCallback(L=>{const B=D(L);Y(B),g==null||g(B)},[D,g]),W=i.useRef(null),oe=i.useCallback(L=>{var B,U;L.preventDefault(),W.current={start:$?L.clientY:L.clientX,size:F()};try{(U=(B=L.currentTarget).setPointerCapture)==null||U.call(B,L.pointerId)}catch{}},[$,F]),Z=i.useCallback(L=>{const B=W.current;if(!B)return;const te=($?L.clientY:L.clientX)-B.start,q=a==="bottom"||a==="right"?-te:te;A(B.size+q)},[$,a,A]),he=i.useCallback(L=>{var B,U,te,q;W.current=null,(U=(B=L.currentTarget).hasPointerCapture)!=null&&U.call(B,L.pointerId)&&((q=(te=L.currentTarget).releasePointerCapture)==null||q.call(te,L.pointerId))},[]),ee=i.useCallback(L=>{const B=I!=null?I:F(),U=p!=null?p:$?window.innerHeight:window.innerWidth,te=a==="bottom"?"ArrowUp":a==="top"?"ArrowDown":a==="left"?"ArrowRight":"ArrowLeft",q=a==="bottom"?"ArrowDown":a==="top"?"ArrowUp":a==="left"?"ArrowLeft":"ArrowRight";L.key===te?(L.preventDefault(),A(B+_)):L.key===q?(L.preventDefault(),A(B-_)):L.key==="Home"?(L.preventDefault(),A(w)):L.key==="End"&&(L.preventDefault(),A(U))},[I,F,$,a,A,_,w,p]);i.useEffect(()=>{var L;if(!r){Y(null);return}(L=E.current)==null||L.focus()},[r]);const ae=f&&I!==null?{...$?{height:I}:{width:I},transition:"none"}:{};return s.jsx(Ue.CSSTransition,{in:r,timeout:120,appear:!0,classNames:{enterDone:"smwb-sheet_entered"},nodeRef:M,children:s.jsxs("div",{ref:T,"data-testid":"sheet",tabIndex:-1,role:"dialog","aria-modal":d==="modal"||void 0,...R,className:y("smwb-sheet",u,`smwb-sheet_${d}`,`smwb-${a}`,{"smwb-expanded":o==="expanded","smwb-small":o==="small","smwb-sheet_resizable":f}),style:{"--sizeProp":l,...ae,...v},children:[f&&s.jsx("div",{className:"smwb-sheet__drag-handle","data-testid":"sheet-drag-handle",role:"separator",tabIndex:0,"aria-orientation":$?"horizontal":"vertical","aria-label":x,"aria-valuemin":w,"aria-valuemax":Math.round(p!=null?p:$?window.innerHeight:window.innerWidth),"aria-valuenow":Math.round(I!=null?I:F()),onPointerDown:oe,onPointerMove:Z,onPointerUp:he,onPointerCancel:he,onKeyDown:ee,children:s.jsx("span",{className:"smwb-sheet__drag-handle-bar"})}),k&&s.jsx("div",{className:"smwb-sheet__header",children:N}),r&&o!=="small"&&s.jsx("div",{className:"smwb-sheet__inner",children:C})]})})}),wo={n:{dx:0,dy:1,dw:0,dh:-1},s:{dx:0,dy:0,dw:0,dh:1},e:{dx:0,dy:0,dw:1,dh:0},w:{dx:1,dy:0,dw:-1,dh:0},ne:{dx:0,dy:1,dw:1,dh:-1},nw:{dx:1,dy:1,dw:-1,dh:-1},se:{dx:0,dy:0,dw:1,dh:1},sw:{dx:1,dy:0,dw:-1,dh:1}},po=["n","s","e","w","ne","nw","se","sw"],Je=()=>typeof window=="undefined"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight},_o={x:24,y:24},go={width:360,height:420},xo=i.forwardRef(function(t,n){const{open:r,title:a,headerActions:u,position:o,defaultPosition:l=_o,onPositionChange:d,onMoveEnd:c,size:m,defaultSize:h=go,onResize:b,onResizeEnd:f,minWidth:w=200,minHeight:p=120,maxWidth:_,maxHeight:x,keepVisible:g=56,moveStep:v=24,resizeStep:S=24,zIndex:j,onActivate:C,collapsed:R,defaultCollapsed:k=!1,onCollapsedChange:N,collapsible:M=!0,movable:E=!0,resizable:T=!0,closeOnEsc:I=!1,onClose:Y,moveHandleAriaLabel:$="Move window",resizeHandleAriaLabel:D="Resize window",closeAriaLabel:F="Close window",collapseAriaLabel:A="Collapse window",expandAriaLabel:W="Expand window",className:oe,style:Z,children:he,...ee}=t,[ae,L]=i.useState(),B=i.useRef(null),U=Ne(n,B),te=i.useId();ke(()=>{L(document.body)},[]);const[q,ie]=$e({value:o,defaultValue:l,onChange:d}),[ce,ue]=$e({value:m,defaultValue:h,onChange:b}),[_e,se]=$e({value:R,defaultValue:k,onChange:N}),be=i.useCallback((z,V)=>{const re=_!=null?_:V.width,xe=x!=null?x:V.height,ge=Math.max(w,Math.min(re,z.width)),O=Math.max(p,Math.min(xe,z.height)),J=Math.min(g,ge),pe=Math.max(J-ge,Math.min(V.width-J,z.x)),ve=Math.max(0,Math.min(Math.max(0,V.height-J),z.y));return{x:pe,y:ve,width:ge,height:O}},[g,x,_,p,w]),Q=be({x:q.x,y:q.y,width:ce.width,height:ce.height},Je()),fe=i.useRef(Q);fe.current=Q;const P=i.useCallback(z=>{const V=be(z,Je());(V.x!==q.x||V.y!==q.y)&&ie({x:V.x,y:V.y}),(V.width!==ce.width||V.height!==ce.height)&&ue({width:V.width,height:V.height})},[be,q.x,q.y,ie,ue,ce.height,ce.width]),K=i.useRef(P);K.current=P,i.useEffect(()=>{if(!r)return;const z=()=>K.current(fe.current);return window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[r]),i.useEffect(()=>{if(!r||!I||!Y)return;const z=V=>{if(V.key!=="Escape")return;const re=B.current;!re||!re.contains(document.activeElement)||Y()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[I,Y,r]);const de=i.useCallback(()=>{C==null||C();const z=B.current;z&&!z.contains(document.activeElement)&&z.focus({preventScroll:!0})},[C]),ne=i.useRef(null),H=z=>{var re,xe,ge;if(!E||(re=z.target)!=null&&re.closest("button,[data-no-drag]"))return;z.preventDefault();const V=fe.current;ne.current={px:z.clientX,py:z.clientY,x:V.x,y:V.y};try{(ge=(xe=z.currentTarget).setPointerCapture)==null||ge.call(xe,z.pointerId)}catch{}},le=z=>{const V=ne.current;V&&P({...fe.current,x:V.x+z.clientX-V.px,y:V.y+z.clientY-V.py})},me=z=>{var V,re,xe,ge;if(ne.current){ne.current=null;const O=fe.current;c==null||c({x:O.x,y:O.y})}(re=(V=z.currentTarget).hasPointerCapture)!=null&&re.call(V,z.pointerId)&&((ge=(xe=z.currentTarget).releasePointerCapture)==null||ge.call(xe,z.pointerId))},Re=i.useRef(null),De=(z,V)=>{var re,xe;V.preventDefault(),V.stopPropagation(),Re.current={dir:z,px:V.clientX,py:V.clientY,rect:fe.current},de();try{(xe=(re=V.currentTarget).setPointerCapture)==null||xe.call(re,V.pointerId)}catch{}},Ee=z=>{const V=Re.current;if(!V)return;const re=wo[V.dir],xe=z.clientX-V.px,ge=z.clientY-V.py,O=V.rect,J=Je(),pe=_!=null?_:J.width,ve=x!=null?x:J.height,je=Math.min(pe,Math.max(w,O.width+re.dw*xe)),Ie=Math.min(ve,Math.max(p,O.height+re.dh*ge));P({x:re.dx?O.x+O.width-je:O.x,y:re.dy?O.y+O.height-Ie:O.y,width:je,height:Ie})},Te=z=>{var V,re,xe,ge;if(Re.current){Re.current=null;const O=fe.current;f==null||f({width:O.width,height:O.height})}(re=(V=z.currentTarget).hasPointerCapture)!=null&&re.call(V,z.pointerId)&&((ge=(xe=z.currentTarget).releasePointerCapture)==null||ge.call(xe,z.pointerId))},X=(z,V)=>{const re=be(V,Je());z?f==null||f({width:re.width,height:re.height}):c==null||c({x:re.x,y:re.y})},we=z=>{const V=fe.current,re=z.shiftKey?S:v,ge={ArrowLeft:[-re,0],ArrowRight:[re,0],ArrowUp:[0,-re],ArrowDown:[0,re]}[z.key];if(!ge)return;z.preventDefault();const O=z.shiftKey?{...V,width:V.width+ge[0],height:V.height+ge[1]}:{...V,x:V.x+ge[0],y:V.y+ge[1]};P(O),X(z.shiftKey,O)},Se=z=>{const V=fe.current,re=Je();let xe;if(z.key==="ArrowLeft"||z.key==="ArrowRight"){z.preventDefault();const ge=z.key==="ArrowRight"?1:-1;xe={...V,width:V.width+ge*S}}else if(z.key==="ArrowUp"||z.key==="ArrowDown"){z.preventDefault();const ge=z.key==="ArrowDown"?1:-1;xe={...V,height:V.height+ge*S}}else if(z.key==="Home")z.preventDefault(),xe={...V,width:w,height:p};else if(z.key==="End")z.preventDefault(),xe={...V,width:_!=null?_:re.width,height:x!=null?x:re.height};else return;P(xe),X(!0,xe)},Le=()=>se(z=>!z);if(!ae)return s.jsx(s.Fragment,{});const Oe={left:`${Q.x}px`,top:`${Q.y}px`,width:`${Q.width}px`,..._e?{}:{height:`${Q.height}px`},...j===void 0?{}:{zIndex:j},...Z!=null?Z:{}};return Fe.createPortal(s.jsx(Ue.CSSTransition,{in:r,timeout:120,mountOnEnter:!0,unmountOnExit:!0,appear:!0,classNames:{enterDone:"smwb-floating-window_entered"},nodeRef:B,children:s.jsxs("div",{...ee,ref:U,"data-testid":"floating-window",role:"dialog",tabIndex:-1,"aria-labelledby":a?te:void 0,className:y("smwb-floating-window",oe,{"smwb-collapsed":_e}),style:Oe,onPointerDown:de,children:[s.jsxs("div",{className:"smwb-floating-window__header","data-testid":"floating-window-header",onPointerDown:H,onPointerMove:le,onPointerUp:me,onPointerCancel:me,children:[s.jsx("span",{className:"smwb-floating-window__grip","data-testid":"floating-window-move",role:"button",tabIndex:0,"aria-label":$,onKeyDown:we,children:s.jsx(G,{name:"drag_indicator"})}),a?s.jsx("span",{className:"smwb-floating-window__title",id:te,children:a}):null,s.jsxs("div",{className:"smwb-floating-window__actions","data-no-drag":!0,children:[u,M?s.jsx("button",{type:"button",className:"smwb-floating-window__action","data-testid":"floating-window-collapse","aria-label":_e?W:A,"aria-expanded":!_e,onClick:Le,children:s.jsx(G,{name:_e?"open_in_full":"close_fullscreen"})}):null,Y?s.jsx("button",{type:"button",className:"smwb-floating-window__action","data-testid":"floating-window-close","aria-label":F,onClick:Y,children:s.jsx(G,{name:"close"})}):null]})]}),_e?null:s.jsx("div",{className:"smwb-floating-window__body","data-testid":"floating-window-body",children:he}),T&&!_e?po.map(z=>s.jsx("div",{className:y("smwb-floating-window__resize",`smwb-floating-window__resize_${z}`),"data-testid":`floating-window-resize-${z}`,...z==="se"?{role:"separator",tabIndex:0,"aria-label":D,"aria-valuemin":w,"aria-valuemax":Math.round(_!=null?_:Je().width),"aria-valuenow":Math.round(Q.width),onKeyDown:Se}:{"aria-hidden":!0,tabIndex:-1},onPointerDown:V=>De(z,V),onPointerMove:Ee,onPointerUp:Te,onPointerCancel:Te},z)):null]})}),ae)}),Ks=e=>e==="start"||e==="end"?`flex-${e}`:e,vo=e=>typeof e=="number"?`calc(var(--smui-spacing-unit, 4px) * ${e})`:e==="none"?"0":`var(--smui-space-${e})`,yo=i.forwardRef(function({direction:t="column",spacing:n="md",align:r,justify:a,wrap:u,divider:o,className:l,style:d,children:c,...m},h){const b=i.Children.toArray(c).filter(i.isValidElement);return s.jsx("div",{ref:h,"data-testid":"stack",className:y("smwb-stack",l),style:{display:"flex",flexDirection:t,flexWrap:u?"wrap":void 0,alignItems:Ks(r),justifyContent:Ks(a),gap:vo(n),...d},...m,children:o?b.map((f,w)=>s.jsxs(i.Fragment,{children:[w>0?s.jsx("div",{className:"smwb-stack__divider",children:o}):null,f]},w)):c})}),jo=i.forwardRef(function({maxWidth:t="lg",disableGutters:n=!1,component:r,className:a,children:u,...o},l){const d=r!=null?r:"main";return s.jsx(d,{ref:l,"data-testid":"page",className:y("smwb-page",`smwb-page_max-${t}`,{"smwb-page_gutterless":n},a),...o,children:s.jsx("div",{className:"smwb-page__inner",children:u})})}),ko=i.forwardRef(function({title:t,subtitle:n,breadcrumbs:r,actions:a,divider:u=!1,className:o,...l},d){return s.jsxs("header",{ref:d,"data-testid":"page-header",className:y("smwb-page-header",{"smwb-page-header_divider":u},o),...l,children:[r?s.jsx("div",{className:"smwb-page-header__breadcrumbs",children:r}):null,s.jsxs("div",{className:"smwb-page-header__row",children:[s.jsxs("div",{className:"smwb-page-header__titles",children:[typeof t=="string"?s.jsx(Xe,{variant:"h4",component:"h1",className:"smwb-page-header__title",children:t}):s.jsx("div",{className:"smwb-page-header__title",children:t}),n?s.jsx(Xe,{variant:"body2",color:"textSecondary",className:"smwb-page-header__subtitle",children:n}):null]}),a?s.jsx("div",{className:"smwb-page-header__actions",children:a}):null]})]})}),Xs=e=>typeof e=="number"?`${e}px`:e,No=i.forwardRef(function({header:t,sidebar:n,footer:r,sidebarWidth:a=260,sidebarCollapsed:u,defaultSidebarCollapsed:o=!1,onSidebarCollapsedChange:l,collapsible:d=!1,collapseToggle:c,collapseToggleAriaLabel:m="Toggle navigation",sidebarCollapsedWidth:h=72,stickyHeader:b=!0,className:f,style:w,children:p,..._},x){const[g,v]=$e({value:u,defaultValue:o,onChange:l}),S=i.useId(),j={"--smui-app-sidebar-w":Xs(g?h:a)};return s.jsxs("div",{ref:x,"data-testid":"app-layout",className:y("smwb-app-layout",{"smwb-app-layout_sticky-header":b,"smwb-app-layout_collapsed":g},f),style:{...j,...w},..._,children:[t?s.jsx("div",{className:"smwb-app-layout__header",children:t}):null,s.jsxs("div",{className:"smwb-app-layout__body",children:[n?s.jsxs("aside",{id:S,className:"smwb-app-layout__sidebar",children:[d?s.jsx("div",{className:"smwb-app-layout__collapse",children:c!=null?c:s.jsx("button",{type:"button",className:"smwb-app-layout__collapse-btn","aria-label":m,"aria-expanded":!g,"aria-controls":S,onClick:()=>v(!g),children:s.jsx(G,{name:g?"chevron_right":"chevron_left",size:20})})}):null,n]}):null,s.jsxs("div",{className:"smwb-app-layout__content",children:[p,r?s.jsx("div",{className:"smwb-app-layout__footer",children:r}):null]})]})]})}),Ro=i.forwardRef(function({className:t,children:n,dense:r,position:a="static",placement:u="top",leftContent:o,midContent:l,midContentAlign:d="middle",rightContent:c,title:m,color:h="default",...b},f){const w=u==="top"?"header":"footer";return s.jsx(w,{ref:f,className:y("smwb-appbar",t,`smwb-${a}`,`smwb-${u}`,{"smwb-dense":r},h!=="default"&&`smwb-appbar_color-${h}`),"data-testid":"app-bar",...b,children:n||s.jsxs("div",{className:"smwb-appbar__inner",children:[s.jsxs("div",{className:"smwb-appbar__left",children:[m&&s.jsx("div",{className:"smwb-appbar__left__title",children:m}),o]}),s.jsx("div",{className:y("smwb-appbar__mid",`smwb-${d}`),children:l}),s.jsx("div",{className:"smwb-appbar__right",children:c})]})})}),Co=i.forwardRef(function({className:t,separator:n="/",maxItems:r=8,itemsBeforeCollapse:a=1,itemsAfterCollapse:u=1,expanded:o,onExpand:l,expandLabel:d="Show path",children:c,...m},h){const b=o!==void 0,[f,w]=i.useState(!1),p=b?!!o:f,_=i.Children.toArray(c).filter(i.isValidElement),x=!p&&_.length>r&&a+u<_.length,g=()=>{l==null||l(),b||w(!0)},v=x?[..._.slice(0,a),s.jsx("button",{type:"button",className:"smwb-breadcrumbs__expand","aria-label":d,onClick:g,children:"…"},"smwb-breadcrumbs-expand"),..._.slice(_.length-u)]:_;return s.jsx("nav",{...m,ref:h,"data-testid":"breadcrumbs","aria-label":"breadcrumb",className:y("smwb-breadcrumbs",t),children:s.jsx("ol",{className:"smwb-breadcrumbs__list",children:v.map((S,j)=>s.jsxs(i.Fragment,{children:[s.jsx("li",{className:"smwb-breadcrumbs__item",children:S}),j<v.length-1?s.jsx("li",{className:"smwb-breadcrumbs__separator","aria-hidden":"true",children:n}):null]},j))})})}),Ht=(e,t)=>Array.from({length:Math.max(t-e+1,0)},(n,r)=>e+r),So=(e,t,n,r)=>{const a=Ht(1,Math.min(r,e)),u=Ht(Math.max(e-r+1,r+1),e),o=Math.max(Math.min(t-n,e-r-n*2-1),r+2),l=Math.min(Math.max(t+n,r+n*2+2),u.length>0?u[0]-2:e-1);return[...a,...o>r+2?["start-ellipsis"]:r+1<e-r?[r+1]:[],...Ht(o,l),...l<e-r-1?["end-ellipsis"]:e-r>r?[e-r]:[],...u]},Mo=i.forwardRef(function({className:t,count:n,page:r,siblingCount:a=1,boundaryCount:u=1,size:o="medium",variant:l="filled",shape:d="circular",color:c="default",disabled:m=!1,showFirstButton:h=!1,showLastButton:b=!1,hidePrevButton:f=!1,hideNextButton:w=!1,onChange:p,..._},x){const g=i.useRef(null),v=Ne(x,g),S=k=>{m||k===r||k<1||k>n||p==null||p(k)},j=k=>{var T,I,Y;if(!["ArrowLeft","ArrowRight","Home","End"].includes(k.key))return;const N=Array.from((I=(T=g.current)==null?void 0:T.querySelectorAll("button.smwb-pagination__item:not(:disabled)"))!=null?I:[]);if(N.length===0)return;const M=N.indexOf(document.activeElement);let E=M;k.key==="ArrowRight"?E=Math.min(M+1,N.length-1):k.key==="ArrowLeft"?E=Math.max(M-1,0):k.key==="Home"?E=0:k.key==="End"&&(E=N.length-1),k.preventDefault(),(Y=N[E])==null||Y.focus()},C=So(n,r,a,u),R=(k,N,M,E,T)=>T?null:s.jsx("li",{children:s.jsx("button",{type:"button",className:"smwb-pagination__item smwb-pagination__nav","aria-label":N,disabled:m||M<1||M>n,onClick:()=>S(M),children:s.jsx(G,{name:E,size:o==="small"?16:18})})},k);return s.jsx("nav",{..._,ref:v,"data-testid":"pagination","aria-label":"pagination",className:y("smwb-pagination",`smwb-pagination_${o}`,`smwb-pagination_${l}`,`smwb-pagination_shape-${d}`,c!=="default"&&`smwb-pagination_color-${c}`,{"smwb-pagination_disabled":m},t),children:s.jsxs("ul",{className:"smwb-pagination__list",onKeyDown:j,children:[R("first","First page",1,"first_page",!h),R("prev","Previous page",r-1,"chevron_left",f),C.map((k,N)=>typeof k=="number"?s.jsx("li",{children:s.jsx("button",{type:"button",className:y("smwb-pagination__item",{"smwb-pagination__item_selected":k===r}),"aria-current":k===r?"page":void 0,disabled:m,onClick:()=>S(k),children:k})},k):s.jsx("li",{className:"smwb-pagination__ellipsis","aria-hidden":"true",children:"…"},`${k}-${N}`)),R("next","Next page",r+1,"chevron_right",w),R("last","Last page",n,"last_page",!b)]})})}),Do=i.forwardRef(function({className:t,steps:n,activeStep:r,orientation:a="horizontal",alternativeLabel:u=!1,onStepClick:o,...l},d){return s.jsx("div",{...l,ref:d,"data-testid":"stepper",className:y("smwb-stepper",`smwb-stepper_${a}`,{"smwb-stepper_alt-label":u&&a==="horizontal"},t),children:n.map((c,m)=>{var _;const h=m<r,b=m===r,f=m===n.length-1,w=!!o&&!c.disabled,p=x=>{w&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),o==null||o(m))};return s.jsxs(i.Fragment,{children:[s.jsxs("div",{className:y("smwb-stepper__step",{"smwb-stepper__step_active":b,"smwb-stepper__step_completed":h,"smwb-stepper__step_error":c.error,"smwb-stepper__step_disabled":c.disabled,"smwb-stepper__step_clickable":w}),"aria-current":b?"step":void 0,"aria-disabled":c.disabled||void 0,role:w?"button":void 0,tabIndex:w?0:void 0,onClick:w?()=>o==null?void 0:o(m):void 0,onKeyDown:w?p:void 0,children:[s.jsx("div",{className:"smwb-stepper__icon","aria-hidden":"true",children:(_=c.icon)!=null?_:h?s.jsx(G,{name:"check",size:16}):s.jsx("span",{children:m+1})}),s.jsxs("div",{className:"smwb-stepper__text",children:[s.jsx("span",{className:"smwb-stepper__label",children:c.label}),c.optional?s.jsx("span",{className:"smwb-stepper__optional",children:c.optional}):null,c.description&&a==="vertical"?s.jsx("span",{className:"smwb-stepper__description",children:c.description}):null]})]}),f?null:s.jsx("div",{className:"smwb-stepper__connector","aria-hidden":"true"})]},m)})})});function To({items:e,icon:t="more_vert",placement:n,"aria-label":r,disabled:a,className:u}){const o=i.useRef(null),[l,d]=i.useState(!1),c=()=>d(!1);return s.jsxs("span",{className:y("smwb-overflow-menu",u),children:[s.jsx(Ae,{ref:o,variant:"text",size:"small",icon:t,"aria-label":r!=null?r:"More actions","aria-haspopup":"menu",disabled:!!a,onClick:()=>d(m=>!m)}),s.jsx(Tt,{isOpen:l,onClose:c,anchorElement:o.current,...n?{placement:n}:{},children:e.map(m=>s.jsxs(nt,{className:y({"smwb-overflow-menu__item--danger":m.danger}),disabled:m.disabled,onClick:()=>{var h;m.disabled||((h=m.onSelect)==null||h.call(m),c())},children:[m.icon?typeof m.icon=="string"?s.jsx(G,{name:m.icon}):m.icon:null,m.label]},m.id))})]})}const Eo=i.forwardRef(function({className:t,variant:n="default",menuItems:r,activeItem:a,defaultActiveItem:u=null,onActiveItemChange:o,collapsible:l=!1,collapsed:d,defaultCollapsed:c=!1,onCollapsedChange:m,collapseToggleAriaLabel:h="Toggle navigation",...b},f){const w=a!==void 0,[p,_]=i.useState(u),x=w?a:p,[g,v]=$e({value:d,defaultValue:c,onChange:m}),S=l&&g?"compactMini":n;return s.jsxs("aside",{ref:f,className:y("smwb-sidebar",t,`smwb-${S}`,{"smwb-sidebar_collapsible":l,"smwb-sidebar_collapsed":l&&g}),role:"menubar",...b,children:[l&&s.jsx("div",{className:"smwb-sidebar__collapse",children:s.jsx("button",{type:"button",className:"smwb-sidebar__collapse-btn","aria-label":h,"aria-expanded":!g,onClick:()=>v(!g),children:s.jsx(G,{name:g?"chevron_right":"chevron_left",size:20})})}),s.jsx("nav",{className:"smwb-sidebar__nav",children:r&&(r==null?void 0:r.map((j,C)=>s.jsx(Io,{as:j.as,isActive:x===C,onClick:R=>{var k;w||_(C),o==null||o(C),(k=j.onClick)==null||k.call(j,R)},icon:j.icon,title:j.title,href:j.href,variant:S},C)))})]})});function Io({isActive:e,icon:t,title:n,as:r="div",href:a,onMouseDown:u,variant:o,...l}){const d=i.useRef(null),c=f=>{u==null||u(f)},m=f=>{var w;(w=d.current)==null||w.onRipple(f)},h=s.jsx(Be,{actionRef:d}),b=r;return s.jsxs(b,{href:a,role:"menuitem",className:y("sidebar__nav__item","smwb-nav-item",o,{active:e}),onMouseDown:c,onPointerDown:m,...l,children:[t&&s.jsx("span",{className:"smwb-nav-item__icon",children:t}),n&&s.jsx("span",{className:"smwb-nav-item__title",children:n}),h]})}const Ao=i.forwardRef(function({className:t,menuItems:n=[],visibleCount:r=4,activeItem:a,defaultActiveItem:u=null,onActiveItemChange:o,overflowMenuAriaLabel:l="More navigation",...d},c){const m=a!==void 0,[h,b]=i.useState(u),f=m?a:h,[w,p]=i.useState(!1),[_,x]=i.useState(null),g=Math.max(0,r),v=i.useMemo(()=>n.slice(0,g),[n,g]),S=i.useMemo(()=>n.slice(g),[n,g]),j=S.length>0,C=j&&f!==null&&f>=g,R=E=>{m||b(E),o==null||o(E)},k=(E,T)=>I=>{R(E),T==null||T(I)},N=()=>{p(E=>!E)},M=()=>{p(!1)};return s.jsxs("nav",{ref:c,className:y("smwb-bottom-bar",t),role:"navigation",...d,children:[s.jsxs("div",{className:"smwb-bottom-bar__nav",role:"menubar",children:[v.map((E,T)=>s.jsx(Us,{as:E.as,isActive:f===T,onClick:k(T,E.onClick),icon:E.icon,title:E.title,href:E.href},T)),j&&s.jsx(Us,{ref:x,isActive:C,onClick:N,icon:s.jsx(G,{name:"menu",size:24}),"aria-label":l,"aria-haspopup":"menu","aria-expanded":w})]}),j&&s.jsx(Tt,{isOpen:w,onClose:M,anchorElement:_,placement:"top",dense:!0,children:S.map((E,T)=>{const I=g+T;return s.jsxs(nt,{selected:f===I,href:E.href,onClick:Y=>{var $;R(I),($=E.onClick)==null||$.call(E,Y),M()},children:[E.icon?s.jsx(fs,{children:E.icon}):null,s.jsx(hs,{inset:!E.icon,children:E.title})]},I)})})]})}),Us=i.forwardRef(function({isActive:t,icon:n,title:r,as:a="div",href:u,onMouseDown:o,...l},d){const c=i.useRef(null),m=f=>{o==null||o(f)},h=f=>{var w;(w=c.current)==null||w.onRipple(f)},b=a;return s.jsxs(b,{ref:d,href:u,role:"menuitem",className:y("smwb-bottom-bar__item",{"smwb-bottom-bar__item_active":t}),onMouseDown:m,onPointerDown:h,...l,children:[n&&s.jsx("span",{className:"smwb-bottom-bar__item-icon",children:n}),r?s.jsx("span",{className:"smwb-bottom-bar__item-title",children:r}):null,s.jsx(Be,{actionRef:c})]})});function $o(e,t){let n;const r=(...a)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...a)},t)};return r.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},r}const Fo=i.forwardRef(function(t,n){const{className:r,label:a,isActive:u=!1,contentRef:o,icon:l,stacked:d=!1,tag:c,disabled:m,onMouseDown:h,...b}=t,f=i.useRef(null),w=g=>{h==null||h(g)},p=g=>{var v;(v=f.current)==null||v.onRipple(g)},_=c!=null?c:c||"button",x=y("smwb-tab",r,{"smwb-tab--active":u,"smwb-tab--stacked":d,"smwb-tab--disabled":m});return s.jsxs(_,{ref:n,className:x,onMouseDown:w,onPointerDown:p,role:"tab","aria-selected":u,"aria-disabled":m||void 0,tabIndex:u?0:-1,disabled:_==="button"?m:void 0,...b,children:[s.jsxs("span",{className:"smwb-tab__content",ref:o,children:[l&&s.jsx("span",{className:"smwb-tab__icon",children:l}),a&&s.jsx("span",{className:"smwb-tab__text-label",children:a})]}),s.jsx(Be,{actionRef:f,classes:{child:"tab__ripple-child"}})]})}),Lo=e=>(1+Math.sin(Math.PI*e-Math.PI/2))/2;function Po(e,t,n,r={},a=()=>{}){const{ease:u=Lo,duration:o=300}=r;let l=null;const d=e[t];let c=!1;const m=()=>{c=!0},h=b=>{if(c){a(new Error("Animation cancelled"));return}l===null&&(l=b);const f=Math.min(1,(b-l)/o);if(e[t]=u(f)*(n-d)+d,f>=1){requestAnimationFrame(()=>{a(null)});return}requestAnimationFrame(h)};return d===n?(a(new Error("Element already at target position")),m):(requestAnimationFrame(h),m)}const Ws={root:{},content:{}},Oo=i.forwardRef(function(t,n){const{className:r,children:a,onChange:u,value:o,indicatorContent:l=!1,scrollable:d=!1,"aria-label":c,...m}=t,[h,b]=i.useState(!1),[f,w]=i.useState(Ws),p=i.useRef(null),_=i.useRef(null),x=i.useRef([]),g=40,v=()=>{const k=p.current;let N;if(k){const T=k.getBoundingClientRect();N={clientWidth:k.clientWidth,scrollLeft:k.scrollLeft,scrollTop:k.scrollTop,scrollWidth:k.scrollWidth,top:T.top,bottom:T.bottom,left:T.left,right:T.right}}let M=null,E=null;if(_.current||console.error("tabListRef.current is undefined"),k&&_.current){const T=_.current.children;if(T.length>0){const I=T[o];M=I?I.getBoundingClientRect():null,l&&(E=x.current[o]?x.current[o].getBoundingClientRect():null)}}return{tabsMeta:N,tabMeta:M,tabContentMeta:E}},S=ze(()=>{const{tabsMeta:k,tabMeta:N,tabContentMeta:M}=v();let E=0;N&&k&&(E=1*(N.left-k.left+k.scrollLeft));const T={root:{left:E,width:N?N.width:0}};if(l&&M&&(T.content={width:M.width}),isNaN(f.root.left)||isNaN(f.root.width))w(T);else{const I=Math.abs(f.root.left-T.root.left),Y=Math.abs(f.root.width-T.root.width);(I>=1||Y>=1)&&w(T)}}),j=(k,{animation:N=!0}={})=>{p.current&&(N?Po(p.current,"scrollLeft",k,{duration:300}):p.current.scrollLeft=k)},C=ze(k=>{const{tabsMeta:N,tabMeta:M}=v();if(!(!M||!N)){if(M.left<N.left){const E=N.scrollLeft+(M.left-N.left);j(E-g,{animation:k})}else if(M.right>N.right){const E=N.scrollLeft+(M.right-N.right);j(E+g,{animation:k})}}});i.useEffect(()=>{b(!0)},[]),i.useEffect(()=>{S()}),i.useEffect(()=>{var E,T;const k=$o(()=>{p.current&&S()},166);if(!p.current||!p.current.ownerDocument.defaultView){console.error("tabsRef.current.ownerDocument.defaultView is undefined");return}const N=p.current.ownerDocument.defaultView;N.addEventListener("resize",k);let M;return typeof ResizeObserver!="undefined"&&(M=new ResizeObserver(k),Array.from((T=(E=_.current)==null?void 0:E.children)!=null?T:[]).forEach(I=>{M.observe(I)})),()=>{k.cancel(),N.removeEventListener("resize",k),M&&M.disconnect()}},[S]),i.useEffect(()=>{C(Ws!==f)},[C,f]);const R=i.Children.map(a,(k,N)=>i.cloneElement(k,{isActive:o===N,onClick:M=>{u(M,N)},...l&&{contentRef:M=>{const{contentRef:E}=k.props;x.current.push(M),E&&Js(E,M)}}}));return s.jsx("div",{className:y("smwb-tabs",r),role:"tabpanel",ref:n,...m,children:s.jsxs("div",{className:y("smwb-tabs__scroller",{"smwb-tabs__scroller--scrollable":d}),ref:p,children:[s.jsx("div",{className:"smwb-tabs__scroll-area",ref:_,role:"tablist","aria-label":c,children:R}),h&&s.jsx("span",{className:"smwb-tabs__indicator",style:f.root,children:s.jsx("span",{className:"smwb-tabs__indicator-content",style:f.content})})]})})});exports.clearIcons=Me.clearIcons;exports.configureIcons=Me.configureIcons;exports.getIcon=Me.getIcon;exports.getIconConfig=Me.getIconConfig;exports.getIconVersion=Me.getIconVersion;exports.hasIcon=Me.hasIcon;exports.listIcons=Me.listIcons;exports.normalizeIconName=Me.normalizeIconName;exports.registerIcons=Me.registerIcons;exports.resetIconConfig=Me.resetIconConfig;exports.subscribeIcons=Me.subscribeIcons;exports.unregisterIcons=Me.unregisterIcons;exports.Accordion=$r;exports.AppBar=Ro;exports.AppLayout=No;exports.AssetGrid=Qr;exports.Avatar=ns;exports.AvatarGroup=Kr;exports.Badge=Gr;exports.BottomBar=Ao;exports.Breadcrumbs=Co;exports.Button=Ae;exports.ButtonGroup=Fa;exports.CHAT_DEFAULT_FILE_UPLOAD_MAX_FILES=sn;exports.CHAT_EXPAND_LAYOUTS=es;exports.CHAT_MESSAGE_DELIVERY_STATUSES=Qs;exports.CHAT_MESSAGE_STATUS_ICONS=en;exports.CHAT_MESSAGE_STATUS_LABELS=tn;exports.Card=qr;exports.Carousel=ha;exports.Chat=Xt;exports.ChatAttachmentImage=mn;exports.ChatAttachments=fn;exports.ChatComposer=un;exports.ChatHeader=dn;exports.ChatLayout=Wr;exports.ChatMessageAvatar=Yt;exports.ChatMessageBubble=rs;exports.ChatMessageIncoming=bn;exports.ChatMessageItem=_n;exports.ChatMessageOutgoing=wn;exports.ChatMessageSkeleton=gn;exports.ChatMessageStatus=hn;exports.ChatMessageSystem=pn;exports.ChatMessages=jn;exports.ChatShell=kn;exports.Checkbox=La;exports.Chip=as;exports.ChipGroup=Zr;exports.CircularProgress=On;exports.ClickAwayListener=at;exports.Column=oo;exports.ConfirmDialog=Ma;exports.Container=lo;exports.CountPreview=ur;exports.DEFAULT_TIME_FORMAT=_t;exports.DataPickerDays=ms;exports.DataPickerHeader=ds;exports.DataPickerInput=er;exports.DatePicker=ci;exports.DatePickerActionLabel=Ut;exports.DatePickerIconButton=qe;exports.DatePickerList=wt;exports.DateTimePicker=Ii;exports.DateTimePickerInput=nr;exports.Divider=uo;exports.ExpansionPanel=Pr;exports.FileDrop=Oi;exports.FileInput=zi;exports.FloatingButton=Mt;exports.FloatingWindow=xo;exports.Grid=eo;exports.Icon=G;exports.IconContext=Qt;exports.IconProvider=Sr;exports.ImagesList=An;exports.ImagesListItem=In;exports.ImagesListItemModal=$n;exports.LazyImage=Cn;exports.List=pa;exports.ListItem=wa;exports.Menu=Tt;exports.MenuDivider=qn;exports.MenuItem=nt;exports.MenuItemIcon=fs;exports.MenuItemText=hs;exports.MenuSubmenu=ni;exports.Message=Ca;exports.MessageContainer=Ln;exports.Modal=Ve;exports.OpenView=Ce;exports.OverflowMenu=To;exports.Page=jo;exports.PageHeader=ko;exports.Pagination=Mo;exports.Preview=cr;exports.PreviewWrapper=dr;exports.ProgressIndicator=Pn;exports.RadioButton=Bi;exports.Rating=Hi;exports.Ripple=Be;exports.Row=ao;exports.SaveAssetDialog=Sa;exports.ScreenDivider=fo;exports.SelectField=Xi;exports.Sheet=ho;exports.Sidebar=Eo;exports.Skeleton=dt;exports.Slider=br;exports.SnackbarProvider=Ea;exports.Stack=yo;exports.Stepper=Do;exports.Tab=Fo;exports.Table=_a;exports.TableBody=ga;exports.TableCell=xa;exports.TableHead=va;exports.TableHeadCell=ya;exports.TablePagination=Fn;exports.TableRow=ja;exports.Tabs=Oo;exports.TextField=Ke;exports.TextFieldAdornment=Vt;exports.TextFieldWrapper=Ye;exports.Theme=qs;exports.ThumbCard=Jr;exports.TimePicker=Pi;exports.TimePickerColumns=ws;exports.TimePickerInput=or;exports.Toggle=Qi;exports.Tooltip=$a;exports.TreeView=ka;exports.Typography=Xe;exports.ValueSlider=Ji;exports.formatChatTimestamp=on;exports.getChatLayoutActions=ln;exports.getCurrentDateTimeFormat=Nt;exports.getDisplayDateTime=mt;exports.isChatMessageDeliveryStatus=ts;exports.isImageAttachment=an;exports.isImageFile=lr;exports.isScrolledToBottom=vn;exports.resolveAllowedLayouts=ss;exports.resolveChatFileUploadMaxFiles=Nn;exports.resolveChatMessageStatusIcon=nn;exports.resolveChatMessageStatusLabel=rn;exports.scrollChatToBottom=Kt;exports.shouldComposerNewlineOnEnter=cn;exports.useChatFileUpload=Rn;exports.useChatInfiniteScroll=xn;exports.useChatStickToBottom=yn;exports.useControllableState=$e;exports.useDateInput=Qn;exports.useDateTimeInput=sr;exports.useDropzone=St;exports.useFocusTrap=xr;exports.useHoverPopover=Rr;exports.useIconSource=Zs;exports.useId=pt;exports.useRovingTabIndex=vr;exports.useSnackbar=Aa;exports.useTheme=_r;exports.useTimeInput=ir;exports.useVirtualList=Jt;
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|