File "Tabs-1.0.13-f71c8d5c.js"

Full Path: /home/vantageo/public_html/wp-admin/.wp-cli/wp-content/plugins/wp-data-access/assets/dist/Tabs-1.0.13-f71c8d5c.js
File size: 15.53 KB
MIME-type: text/plain
Charset: utf-8

import{g as ft,e as pt,s as j,S as Pt,z as Lt,_ as b,u as ht,a as rt,c as L,b as St,o as Zt,K as ut}from"./iconBase-1.0.13-98e06aa9.js";import{r as d,j as S}from"./main-1.0.13.js";import{ad as Nt,N as lt,ae as te,aa as ee}from"./main-1.0.13-4cbe632d.js";import{d as $t,o as kt}from"./Menu-1.0.13-2a06ef00.js";import{c as Ft}from"./Close-1.0.13-b137ce2f.js";let U;function At(){if(U)return U;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),U="reverse",t.scrollLeft>0?U="default":(t.scrollLeft=1,t.scrollLeft===0&&(U="negative")),document.body.removeChild(t),U}function oe(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch(At()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function le(t){return pt("MuiTab",t)}const re=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),O=re,ne=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],se=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:s,icon:c,label:h,selected:p,disabled:u}=t,x={root:["root",c&&h&&"labelIcon",`textColor${Lt(r)}`,a&&"fullWidth",s&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(x,le,e)},ae=j(Pt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Lt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${O.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${O.selected}`]:{opacity:1},[`&.${O.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${O.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${O.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${O.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${O.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),ie=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTab"}),{className:s,disabled:c=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:x="top",indicator:B,label:y,onChange:v,onClick:w,onFocus:N,selected:T,selectionFollowsFocus:g,textColor:H="inherit",value:M,wrapped:nt=!1}=a,D=rt(a,ne),Y=b({},a,{disabled:c,disableFocusRipple:h,selected:T,icon:!!u,iconPosition:x,label:!!y,fullWidth:p,textColor:H,wrapped:nt}),X=se(Y),$=u&&y&&d.isValidElement(u)?d.cloneElement(u,{className:L(X.iconWrapper,u.props.className)}):u,J=R=>{!T&&v&&v(R,M),w&&w(R)},_=R=>{g&&!T&&v&&v(R,M),N&&N(R)};return S.jsxs(ae,b({focusRipple:!h,className:L(X.root,s),ref:r,role:"tab","aria-selected":T,disabled:c,onClick:J,onFocus:_,ownerState:Y,tabIndex:T?0:-1},D,{children:[x==="top"||x==="start"?S.jsxs(d.Fragment,{children:[$,y]}):S.jsxs(d.Fragment,{children:[y,$]}),B]}))}),Oe=ie,ce=Ft(S.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),de=Ft(S.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function ue(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function be(t,e,r,a={},s=()=>{}){const{ease:c=ue,duration:h=300}=a;let p=null;const u=e[t];let x=!1;const B=()=>{x=!0},y=v=>{if(x){s(new Error("Animation cancelled"));return}p===null&&(p=v);const w=Math.min(1,(v-p)/h);if(e[t]=c(w)*(r-u)+u,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return u===r?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const fe=["onChange"],pe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function he(t){const{onChange:e}=t,r=rt(t,fe),a=d.useRef(),s=d.useRef(null),c=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return Zt(()=>{const h=$t(()=>{const u=a.current;c(),u!==a.current&&e(a.current)}),p=kt(s.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),d.useEffect(()=>{c(),e(a.current)},[e]),S.jsx("div",b({style:pe,ref:s},r))}function Se(t){return pt("MuiTabScrollButton",t)}const ve=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),me=ve,xe=["className","slots","slotProps","direction","orientation","disabled"],ge=t=>{const{classes:e,orientation:r,disabled:a}=t;return St({root:["root",r,a&&"disabled"]},Se,e)},ye=j(Pt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${me.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),Ce=d.forwardRef(function(e,r){var a,s;const c=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:x}=c,B=rt(c,xe),y=Nt(),v=b({isRtl:y},c),w=ge(v),N=(a=p.StartScrollButtonIcon)!=null?a:ce,T=(s=p.EndScrollButtonIcon)!=null?s:de,g=lt({elementType:N,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v}),H=lt({elementType:T,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v});return S.jsx(ye,b({component:"div",className:L(w.root,h),ref:r,role:null,ownerState:v,tabIndex:null},B,{children:x==="left"?S.jsx(N,b({},g)):S.jsx(T,b({},H))}))}),Be=Ce;function we(t){return pt("MuiTabs",t)}const Te=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),bt=Te,Ie=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,zt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,s=r(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const c=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||c)s=r(t,s);else{s.focus();return}}},Ee=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:s,scrollableY:c,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",s&&"scrollableX",c&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},we,u)},Me=j("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Re=j("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),ze=j("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),We=j("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Pe=j(he)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Wt={},Le=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTabs"}),s=te(),c=Nt(),{"aria-label":h,"aria-labelledby":p,action:u,centered:x=!1,children:B,className:y,component:v="div",allowScrollButtonsMobile:w=!1,indicatorColor:N="primary",onChange:T,orientation:g="horizontal",ScrollButtonComponent:H=Be,scrollButtons:M="auto",selectionFollowsFocus:nt,slots:D={},slotProps:Y={},TabIndicatorProps:X={},TabScrollButtonProps:$={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=a,Ot=rt(a,Ie),I=R==="scrollable",C=g==="vertical",K=C?"scrollTop":"scrollLeft",Q=C?"top":"left",Z=C?"bottom":"right",at=C?"clientHeight":"clientWidth",V=C?"height":"width",k=b({},a,{component:v,allowScrollButtonsMobile:w,indicatorColor:N,orientation:g,vertical:C,scrollButtons:M,textColor:J,variant:R,visibleScrollbar:st,fixed:!I,hideScrollbar:I&&!st,scrollableX:I&&!C,scrollableY:I&&C,centered:x&&!I,scrollButtonsHideMobile:!w}),W=Ee(k),jt=lt({elementType:D.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:k}),Ht=lt({elementType:D.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:k}),[vt,Dt]=d.useState(!1),[F,mt]=d.useState(Wt),[xt,Xt]=d.useState(!1),[gt,_t]=d.useState(!1),[yt,Ut]=d.useState(!1),[Ct,Yt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Bt=new Map,z=d.useRef(null),A=d.useRef(null),wt=()=>{const o=z.current;let l;if(o){const n=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:oe(o,c?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let i;if(o&&_!==!1){const n=A.current.children;if(n.length>0){const f=n[Bt.get(_)];i=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let i=0,n;if(C)n="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(n=c?"right":"left",l&&o){const m=c?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(c?-1:1)*(l[n]-o[n]+m)}const f={[n]:i,[V]:l?l[V]:0};if(isNaN(F[n])||isNaN(F[V]))mt(f);else{const m=Math.abs(F[n]-f[n]),E=Math.abs(F[V]-f[V]);(m>=1||E>=1)&&mt(f)}}),it=(o,{animation:l=!0}={})=>{l?be(K,z.current,o,{duration:s.transitions.duration.standard}):z.current[K]=o},Tt=o=>{let l=z.current[K];C?l+=o:(l+=o*(c?-1:1),l*=c&&At()==="reverse"?-1:1),it(l)},It=()=>{const o=z.current[at];let l=0;const i=Array.from(A.current.children);for(let n=0;n<i.length;n+=1){const f=i[n];if(l+f[at]>o){n===0&&(l=o);break}l+=f[at]}return l},Kt=()=>{Tt(-1*It())},Vt=()=>{Tt(It())},qt=d.useCallback(o=>{Yt({overflow:null,scrollbarWidth:o})},[]),Gt=()=>{const o={};o.scrollbarSizeListener=I?S.jsx(Pe,{onChange:qt,className:L(W.scrollableX,W.hideScrollbar)}):null;const i=I&&(M==="auto"&&(xt||gt)||M===!0);return o.scrollButtonStart=i?S.jsx(H,b({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:jt},orientation:g,direction:c?"right":"left",onClick:Kt,disabled:!xt},$,{className:L(W.scrollButtons,$.className)})):null,o.scrollButtonEnd=i?S.jsx(H,b({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:c?"left":"right",onClick:Vt,disabled:!gt},$,{className:L(W.scrollButtons,$.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:i}=wt();if(!(!i||!l)){if(i[Q]<l[Q]){const n=l[K]+(i[Q]-l[Q]);it(n,{animation:o})}else if(i[Z]>l[Z]){const n=l[K]+(i[Z]-l[Z]);it(n,{animation:o})}}}),tt=ut(()=>{I&&M!==!1&&Ut(!yt)});d.useEffect(()=>{const o=$t(()=>{z.current&&q()});let l;const i=m=>{m.forEach(E=>{E.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),E.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},n=kt(z.current);n.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(A.current.children).forEach(m=>{l.observe(m)})),typeof MutationObserver<"u"&&(f=new MutationObserver(i),f.observe(A.current,{childList:!0})),()=>{var m,E;o.clear(),n.removeEventListener("resize",o),(m=f)==null||m.disconnect(),(E=l)==null||E.disconnect()}},[q,tt]),d.useEffect(()=>{const o=Array.from(A.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&I&&M!==!1){const i=o[0],n=o[l-1],f={root:z.current,threshold:.99},m=dt=>{Xt(!dt[0].isIntersecting)},E=new IntersectionObserver(m,f);E.observe(i);const G=dt=>{_t(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(n),()=>{E.disconnect(),P.disconnect()}}},[I,M,yt,B==null?void 0:B.length]),d.useEffect(()=>{Dt(!0)},[]),d.useEffect(()=>{q()}),d.useEffect(()=>{Et(Wt!==F)},[Et,F]),d.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=S.jsx(We,b({},X,{className:L(W.indicator,X.className),ownerState:k,style:b({},F,X.style)}));let et=0;const Jt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Bt.set(l,et);const i=l===_;return et+=1,d.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:i&&!vt&&Mt,selected:i,selectionFollowsFocus:nt,onChange:T,textColor:J,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=A.current,i=ee(l).activeElement;if(i.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",m=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&c&&(f="ArrowRight",m="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,i,zt);break;case m:o.preventDefault(),ot(l,i,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,zt);break}},ct=Gt();return S.jsxs(Me,b({className:L(W.root,y),ownerState:k,ref:r,as:v},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,S.jsxs(Re,{className:W.scroller,ownerState:k,style:{overflow:Ct.overflow,[C?`margin${c?"Left":"Right"}`:"marginBottom"]:st?void 0:-Ct.scrollbarWidth},ref:z,children:[S.jsx(ze,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:k,onKeyDown:Qt,ref:A,role:"tablist",children:Jt}),vt&&Mt]}),ct.scrollButtonEnd]}))}),je=Le;export{Oe as T,je as a,bt as t};