| 1 |
import{j as v}from"./tanstack-1.0.83-vdxW-z_W.js";import{u as Q}from"./useScreenSize-1.0.83-BAIpyMOX.js";import{l as Z,h as V}from"./lib-1.0.83-DP604-fF.js";import{u as _}from"./hooks-1.0.83-C3p88FIk.js";import{r as m}from"./redux-1.0.83-C_HljLTP.js";import{g as tt,e as rt,u as et,f as W,h as B,i as T,j as ot,m as U,r as nt}from"./CircularProgress-1.0.83-C7us6xSc.js";import{u as it}from"./ThemeProvider-1.0.83-BLxCoVxO.js";import{u as X,a as at,P as st}from"./ButtonBase-1.0.83-CG1HAKKR.js";import{T as pt,g as ct,a as Y,r as lt}from"./Portal-1.0.83-Dhvo44f3.js";import{d as dt}from"./Menu-1.0.83-C2Cup-2w.js";import{o as F,M as ft}from"./Modal-1.0.83-Bk90O4XZ.js";import"./vendor-1.0.83-CN03Eozo.js";import"./utils-1.0.83-DdPZyaQg.js";import"./Typography-1.0.83-RUNWFUSq.js";import"./useEnhancedEffect-1.0.83-CUAS28ZG.js";import"./index-1.0.83-D4QXebr0.js";import"./iconBase-1.0.83-eqXDJKXP.js";import"./isHostComponent-1.0.83-DVu5iVWx.js";function ut(r,t,n){const e=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),g=F(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const a=g.getComputedStyle(t);l=a.getPropertyValue("-webkit-transform")||a.getPropertyValue("transform")}let f=0,d=0;if(l&&l!=="none"&&typeof l=="string"){const a=l.split("(")[1].split(")")[0].split(",");f=parseInt(a[4],10),d=parseInt(a[5],10)}return r==="left"?i?`translateX(${i.right+f-e.left}px)`:`translateX(${g.innerWidth+f-e.left}px)`:r==="right"?i?`translateX(-${e.right-i.left-f}px)`:`translateX(-${e.left+e.width-f}px)`:r==="up"?i?`translateY(${i.bottom+d-e.top}px)`:`translateY(${g.innerHeight+d-e.top}px)`:i?`translateY(-${e.top-i.top+e.height-d}px)`:`translateY(-${e.top+e.height-d}px)`}function mt(r){return typeof r=="function"?r():r}function M(r,t,n){const e=mt(n),i=ut(r,t,e);i&&(t.style.webkitTransform=i,t.style.transform=i)}const ht=m.forwardRef(function(t,n){const e=X(),i={enter:e.transitions.easing.easeOut,exit:e.transitions.easing.sharp},g={enter:e.transitions.duration.enteringScreen,exit:e.transitions.duration.leavingScreen},{addEndListener:l,appear:f=!0,children:d,container:a,direction:c="down",easing:b=i,in:h,onEnter:z,onEntered:L,onEntering:$,onExit:y,onExited:D,onExiting:j,style:P,timeout:k=g,TransitionComponent:E=pt,...R}=t,s=m.useRef(null),I=at(ct(d),s,n),x=o=>p=>{o&&(p===void 0?o(s.current):o(s.current,p))},w=x((o,p)=>{M(c,o,a),lt(o),z&&z(o,p)}),u=x((o,p)=>{const C=Y({timeout:k,style:P,easing:b},{mode:"enter"});o.style.webkitTransition=e.transitions.create("-webkit-transform",{...C}),o.style.transition=e.transitions.create("transform",{...C}),o.style.webkitTransform="none",o.style.transform="none",$&&$(o,p)}),A=x(L),S=x(j),G=x(o=>{const p=Y({timeout:k,style:P,easing:b},{mode:"exit"});o.style.webkitTransition=e.transitions.create("-webkit-transform",p),o.style.transition=e.transitions.create("transform",p),M(c,o,a),y&&y(o)}),J=x(o=>{o.style.webkitTransition="",o.style.transition="",D&&D(o)}),K=o=>{l&&l(s.current,o)},N=m.useCallback(()=>{s.current&&M(c,s.current,a)},[c,a]);return m.useEffect(()=>{if(h||c==="down"||c==="right")return;const o=dt(()=>{s.current&&M(c,s.current,a)}),p=F(s.current);return p.addEventListener("resize",o),()=>{o.clear(),p.removeEventListener("resize",o)}},[c,h,a]),m.useEffect(()=>{h||N()},[h,N]),v.jsx(E,{nodeRef:s,onEnter:w,onEntered:A,onEntering:u,onExit:G,onExited:J,onExiting:S,addEndListener:K,appear:f,in:h,timeout:k,...R,children:(o,{ownerState:p,...C})=>m.cloneElement(d,{ref:I,style:{visibility:o==="exited"&&!h?"hidden":void 0,...P,...d.props.style},...C})})});function gt(r){return tt("MuiDrawer",r)}rt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const O=(r,t)=>{const{ownerState:n}=r;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,t.modal]},xt=r=>{const{classes:t,anchor:n,variant:e}=r,i={root:["root",`anchor${T(n)}`],docked:[(e==="permanent"||e==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${T(n)}`,e!=="temporary"&&`paperAnchorDocked${T(n)}`]};return ot(i,gt,t)},wt=W(ft,{name:"MuiDrawer",slot:"Root",overridesResolver:O})(U(({theme:r})=>({zIndex:(r.vars||r).zIndex.drawer}))),H=W("div",{shouldForwardProp:nt,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:O})({flex:"0 0 auto"}),vt=W(st,{name:"MuiDrawer",slot:"Paper",overridesResolver:(r,t)=>{const{ownerState:n}=r;return[t.paper,t[`paperAnchor${T(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${T(n.anchor)}`]]}})(U(({theme:r})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(r.vars||r).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(r.vars||r).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(r.vars||r).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(r.vars||r).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(r.vars||r).palette.divider}`}}]}))),q={left:"right",right:"left",top:"down",bottom:"up"};function yt(r){return["left","right"].includes(r)}function kt({direction:r},t){return r==="rtl"&&yt(t)?q[t]:t}const Et=m.forwardRef(function(t,n){const e=et({props:t,name:"MuiDrawer"}),i=X(),g=it(),l={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:f="left",BackdropProps:d,children:a,className:c,elevation:b=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:z,...L}={},onClose:$,open:y=!1,PaperProps:D={},SlideProps:j,TransitionComponent:P=ht,transitionDuration:k=l,variant:E="temporary",...R}=e,s=m.useRef(!1);m.useEffect(()=>{s.current=!0},[]);const I=kt({direction:g?"rtl":"ltr"},f),w={...e,anchor:f,elevation:b,open:y,variant:E,...R},u=xt(w),A=v.jsx(vt,{elevation:E==="temporary"?b:0,square:!0,...D,className:B(u.paper,D.className),ownerState:w,children:a});if(E==="permanent")return v.jsx(H,{className:B(u.root,u.docked,c),ownerState:w,ref:n,...R,children:A});const S=v.jsx(P,{in:y,direction:q[I],timeout:k,appear:s.current,...j,children:A});return E==="persistent"?v.jsx(H,{className:B(u.root,u.docked,c),ownerState:w,ref:n,...R,children:S}):v.jsx(wt,{BackdropProps:{...d,...z,transitionDuration:k},className:B(u.root,u.modal,c),open:y,ownerState:w,onClose:$,hideBackdrop:h,ref:n,...R,...L,children:S})}),Rt=()=>{const r=_(t=>t.ui.drawer.anchor);return Z.debug(r),r},Ht=({closeDrawer:r,children:t})=>{const n=Rt(),e=Q();return v.jsx(Et,{id:"pp-setting-drawer-root",anchor:n,open:!0,ModalProps:{onClose:()=>{r()}},PaperProps:{sx:{minWidth:"min(600px, 100vw)",maxWidth:"95vw",width:"min(600px, 100vw)",borderTop:"4px solid #f4f7f9",borderBottom:"4px solid #f4f7f9",boxSizing:"border-box",...e.width>600&&n===V.LEFT&&{resize:"horizontal",overflow:"auto",borderRight:"4px solid #f4f7f9"},...e.width>600&&n===V.RIGHT&&{resize:"horizontal",overflow:"auto",borderLeft:"4px solid #f4f7f9",direction:"rtl","& *":{direction:"initial"}}},id:"pp-setting-drawer"},hideBackdrop:!1,sx:{"& .MuiBackdrop-root":{opacity:"0.2 !important"}},children:t})};export{Ht as default}; |