ladle-inject-custom-addons
Version:
Adds a button to the Ladle addon bar
57 lines (49 loc) • 43 kB
JavaScript
;var ln=Object.create;var he=Object.defineProperty;var fn=Object.getOwnPropertyDescriptor;var dn=Object.getOwnPropertyNames;var mn=Object.getPrototypeOf,hn=Object.prototype.hasOwnProperty;var yn=(e,t)=>{for(var n in t)he(e,n,{get:t[n],enumerable:!0})},rt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of dn(t))!hn.call(e,r)&&r!==n&&he(e,r,{get:()=>t[r],enumerable:!(o=fn(t,r))||o.enumerable});return e};var ct=(e,t,n)=>(n=e!=null?ln(mn(e)):{},rt(t||!e||!e.__esModule?he(n,"default",{value:e,enumerable:!0}):n,e)),pn=e=>rt(he({},"__esModule",{value:!0}),e);var Pr={};yn(Pr,{Dialog:()=>Pe,DialogContent:()=>Oe,DialogOverlay:()=>le,default:()=>Or});module.exports=pn(Pr);var s=ct(require("react")),gt=ct(require("react-dom"));function $e(){return H=Object.assign||function(e){for(let t=1;t<arguments.length;t++){let n=arguments[t];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},H.apply(this,arguments)}function ze(e,t,n){return n={path:t,exports:{},require:function(o,r){return gn(o,r??n.path)}},e(n,n.exports),n.exports}function gn(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}function bt(){throw new Error("setTimeout has not been defined")}function vt(){throw new Error("clearTimeout has not been defined")}var K=bt,z=vt,ce;typeof window<"u"?ce=window:typeof self<"u"?ce=self:ce={};typeof ce.setTimeout=="function"&&(K=setTimeout);typeof ce.clearTimeout=="function"&&(z=clearTimeout);function wt(e){if(K===setTimeout)return setTimeout(e,0);if((K===bt||!K)&&setTimeout)return K=setTimeout,setTimeout(e,0);try{return K(e,0)}catch{try{return K.call(null,e,0)}catch{return K.call(this,e,0)}}}function bn(e){if(z===clearTimeout)return clearTimeout(e);if((z===vt||!z)&&clearTimeout)return z=clearTimeout,clearTimeout(e);try{return z(e)}catch{try{return z.call(null,e)}catch{return z.call(this,e)}}}var q=[],ie=!1,V,ge=-1;function vn(){!ie||!V||(ie=!1,V.length?q=V.concat(q):ge=-1,q.length&&Et())}function Et(){if(ie)return;let e=wt(vn);ie=!0;let t=q.length;for(;t;){for(V=q,q=[];++ge<t;)V&&V[ge].run();ge=-1,t=q.length}V=null,ie=!1,bn(e)}function wn(e){let t=new Array(arguments.length-1);if(arguments.length>1)for(let n=1;n<arguments.length;n++)t[n-1]=arguments[n];q.push(new Tt(e,t)),q.length===1&&!ie&&wt(Et)}function Tt(e,t){this.fun=e,this.array=t}Tt.prototype.run=function(){this.fun.apply(null,this.array)};var En="browser",Tn="browser",Sn=!0,Cn=[],On="",Pn={},Rn={},kn={};function U(){}var An=U,Fn=U,xn=U,_n=U,Dn=U,In=U,Ln=U;function Mn(e){throw new Error("process.binding is not supported")}function Nn(){return"/"}function Bn(e){throw new Error("process.chdir is not supported")}function jn(){return 0}var ne=ce.performance||{},$n=ne.now||ne.mozNow||ne.msNow||ne.oNow||ne.webkitNow||function(){return new Date().getTime()};function Wn(e){let t=$n.call(ne)*.001,n=Math.floor(t),o=Math.floor(t%1*1e9);return e&&(n=n-e[0],o=o-e[1],o<0&&(n--,o+=1e9)),[n,o]}var Yn=new Date;function Un(){return(new Date-Yn)/1e3}var it={nextTick:wn,title:En,browser:Sn,env:{NODE_ENV:"development"},argv:Cn,version:On,versions:Pn,on:An,addListener:Fn,once:xn,off:_n,removeListener:Dn,removeAllListeners:In,emit:Ln,binding:Mn,cwd:Nn,chdir:Bn,umask:jn,hrtime:Wn,platform:Tn,release:Rn,config:kn,uptime:Un},Hn=function(e,t){let n,o=toObject(e),r;for(let i=1;i<arguments.length;i++){n=Object(arguments[i]);for(let c in n)hasOwnProperty.call(n,c)&&(o[c]=n[c]);if(getOwnPropertySymbols){r=getOwnPropertySymbols(n);for(let c=0;c<r.length;c++)propIsEnumerable.call(n,r[c])&&(o[r[c]]=n[r[c]])}}return o},Gn=Ct()?s.useLayoutEffect:s.useEffect,st={},St=U;{let e=typeof it<"u"?it:{env:{NODE_ENV:"development"}},t=e.env;St=function(o){st[o]||(st[o]=!0)}}function qn(e,t){if(e!=null)if(Kn(e))e(t);else try{e.current=t}catch{throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function Ct(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ke(e){return s.forwardRef(e)}function Zn(e){return Ct()?e?e.ownerDocument:document:null}function Kn(e){return!!(e&&{}.toString.call(e)=="[object Function]")}function zn(e){return typeof e=="string"}var Ot=U;Ot=function(t){let n=s.useRef(t);s.useEffect(function(){return void(n.current=t)},[t]),s.useEffect(function(){return St(n.current)},[])};function Xn(){let e=s.useState(Object.create(null)),t=e[1];return s.useCallback(function(){t(Object.create(null))},[])}function Qn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(function(){return t.every(function(o){return o==null})?null:function(o){t.forEach(function(r){qn(r,o)})}},[].concat(t))}function be(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}}var Pt=function(t){let n=t.children,o=t.type,r=o===void 0?"reach-portal":o,i=s.useRef(null),c=s.useRef(null),u=Xn();return Gn(function(){if(!i.current)return;let l=i.current.ownerDocument;return c.current=l?.createElement(r),l.body.appendChild(c.current),u(),function(){c.current&&c.current.ownerDocument&&c.current.ownerDocument.body.removeChild(c.current)}},[r,u]),c.current?gt.createPortal(n,c.current):s.createElement("span",{ref:i})};Pt.displayName="Portal";function Vn(e,t){if(e==null)return{};let n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var Jn=ze(function(e,t){(function(){let n=typeof Symbol=="function"&&Symbol.for,o=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,c=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,y=n?Symbol.for("react.concurrent_mode"):60111,g=n?Symbol.for("react.forward_ref"):60112,R=n?Symbol.for("react.suspense"):60113,_=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,b=n?Symbol.for("react.lazy"):60116,L=n?Symbol.for("react.block"):60121,M=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,D=n?Symbol.for("react.scope"):60119;function N(m){return typeof m=="string"||typeof m=="function"||m===i||m===y||m===u||m===c||m===R||m===_||typeof m=="object"&&m!==null&&(m.$$typeof===b||m.$$typeof===h||m.$$typeof===l||m.$$typeof===f||m.$$typeof===g||m.$$typeof===M||m.$$typeof===x||m.$$typeof===D||m.$$typeof===L)}function k(m){if(typeof m=="object"&&m!==null){let De=m.$$typeof;switch(De){case o:var me=m.type;switch(me){case p:case y:case i:case u:case c:case R:return me;default:var ot=me&&me.$$typeof;switch(ot){case f:case g:case b:case h:case l:return ot;default:return De}}case r:return De}}}let W=p,I=y,Y=f,j=l,Z=o,a=g,d=i,v=b,w=h,E=r,O=u,S=c,T=R,C=!1;function A(m){return C||(C=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),F(m)||k(m)===p}function F(m){return k(m)===y}function B(m){return k(m)===f}function $(m){return k(m)===l}function _e(m){return typeof m=="object"&&m!==null&&m.$$typeof===o}function G(m){return k(m)===g}function J(m){return k(m)===i}function de(m){return k(m)===b}function rn(m){return k(m)===h}function cn(m){return k(m)===r}function sn(m){return k(m)===u}function an(m){return k(m)===c}function un(m){return k(m)===R}t.AsyncMode=W,t.ConcurrentMode=I,t.ContextConsumer=Y,t.ContextProvider=j,t.Element=Z,t.ForwardRef=a,t.Fragment=d,t.Lazy=v,t.Memo=w,t.Portal=E,t.Profiler=O,t.StrictMode=S,t.Suspense=T,t.isAsyncMode=A,t.isConcurrentMode=F,t.isContextConsumer=B,t.isContextProvider=$,t.isElement=_e,t.isForwardRef=G,t.isFragment=J,t.isLazy=de,t.isMemo=rn,t.isPortal=cn,t.isProfiler=sn,t.isStrictMode=an,t.isSuspense=un,t.isValidElementType=N,t.typeOf=k})()}),Rt=ze(function(e){e.exports=Jn}),eo="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Q=eo,We=function(){};kt=Q,Ee={},At=Function.call.bind(Object.prototype.hasOwnProperty),We=function(e){let t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}};var kt,Ee,At;function Ft(e,t,n,o,r){for(let c in e)if(At(e,c)){var i;try{if(typeof e[c]!="function"){let u=Error((o||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.");throw u.name="Invariant Violation",u}i=e[c](t,c,o,n,null,kt)}catch(u){i=u}if(i&&!(i instanceof Error)&&We((o||"React class")+": type specification of "+n+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in Ee)){Ee[i.message]=!0;let u=r?r():"";We("Failed "+n+" type: "+i.message+(u??""))}}}Ft.resetWarningCache=function(){Ee={}};var at=Ft,to=Function.call.bind(Object.prototype.hasOwnProperty),oe=function(){};oe=function(e){let t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}};function ye(){return null}var no=function(e,t){let n=typeof Symbol=="function"&&Symbol.iterator,o="@@iterator";function r(a){let d=a&&(n&&a[n]||a[o]);if(typeof d=="function")return d}let i="<<anonymous>>",c={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:y(),arrayOf:g,element:R(),elementType:_(),instanceOf:h,node:x(),objectOf:L,oneOf:b,oneOfType:M,shape:D,exact:N};function u(a,d){return a===d?a!==0||1/a===1/d:a!==a&&d!==d}function l(a){this.message=a,this.stack=""}l.prototype=Error.prototype;function f(a){var d={},v=0;function w(O,S,T,C,A,F,B){if(C=C||i,F=F||T,B!==Q){if(t){let $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(typeof console<"u"){let $=C+":"+T;!d[$]&&v<3&&(oe("You are manually calling a React.PropTypes validation function for the `"+F+"` prop on `"+C+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),d[$]=!0,v++)}}return S[T]==null?O?S[T]===null?new l("The "+A+" `"+F+"` is marked as required "+("in `"+C+"`, but its value is `null`.")):new l("The "+A+" `"+F+"` is marked as required in "+("`"+C+"`, but its value is `undefined`.")):null:a(S,T,C,A,F)}let E=w.bind(null,!1);return E.isRequired=w.bind(null,!0),E}function p(a){function d(v,w,E,O,S,T){let C=v[w];if(I(C)!==a){let F=Y(C);return new l("Invalid "+O+" `"+S+"` of type "+("`"+F+"` supplied to `"+E+"`, expected ")+("`"+a+"`."))}return null}return f(d)}function y(){return f(ye)}function g(a){function d(v,w,E,O,S){if(typeof a!="function")return new l("Property `"+S+"` of component `"+E+"` has invalid PropType notation inside arrayOf.");let T=v[w];if(!Array.isArray(T)){let C=I(T);return new l("Invalid "+O+" `"+S+"` of type "+("`"+C+"` supplied to `"+E+"`, expected an array."))}for(let C=0;C<T.length;C++){let A=a(T,C,E,O,S+"["+C+"]",Q);if(A instanceof Error)return A}return null}return f(d)}function R(){function a(d,v,w,E,O){let S=d[v];if(!e(S)){let T=I(S);return new l("Invalid "+E+" `"+O+"` of type "+("`"+T+"` supplied to `"+w+"`, expected a single ReactElement."))}return null}return f(a)}function _(){function a(d,v,w,E,O){let S=d[v];if(!Rt.isValidElementType(S)){let T=I(S);return new l("Invalid "+E+" `"+O+"` of type "+("`"+T+"` supplied to `"+w+"`, expected a single ReactElement type."))}return null}return f(a)}function h(a){function d(v,w,E,O,S){if(!(v[w]instanceof a)){let T=a.name||i,C=Z(v[w]);return new l("Invalid "+O+" `"+S+"` of type "+("`"+C+"` supplied to `"+E+"`, expected ")+("instance of `"+T+"`."))}return null}return f(d)}function b(a){if(!Array.isArray(a))return arguments.length>1?oe("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):oe("Invalid argument supplied to oneOf, expected an array."),ye;function d(v,w,E,O,S){let T=v[w];for(let A=0;A<a.length;A++)if(u(T,a[A]))return null;let C=JSON.stringify(a,function(F,B){return Y(B)==="symbol"?String(B):B});return new l("Invalid "+O+" `"+S+"` of value `"+String(T)+"` "+("supplied to `"+E+"`, expected one of "+C+"."))}return f(d)}function L(a){function d(v,w,E,O,S){if(typeof a!="function")return new l("Property `"+S+"` of component `"+E+"` has invalid PropType notation inside objectOf.");let T=v[w],C=I(T);if(C!=="object")return new l("Invalid "+O+" `"+S+"` of type "+("`"+C+"` supplied to `"+E+"`, expected an object."));for(let A in T)if(to(T,A)){let F=a(T,A,E,O,S+"."+A,Q);if(F instanceof Error)return F}return null}return f(d)}function M(a){if(!Array.isArray(a))return oe("Invalid argument supplied to oneOfType, expected an instance of array."),ye;for(let v=0;v<a.length;v++){let w=a[v];if(typeof w!="function")return oe("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+j(w)+" at index "+v+"."),ye}function d(v,w,E,O,S){for(let T=0;T<a.length;T++){let C=a[T];if(C(v,w,E,O,S,Q)==null)return null}return new l("Invalid "+O+" `"+S+"` supplied to "+("`"+E+"`."))}return f(d)}function x(){function a(d,v,w,E,O){return k(d[v])?null:new l("Invalid "+E+" `"+O+"` supplied to "+("`"+w+"`, expected a ReactNode."))}return f(a)}function D(a){function d(v,w,E,O,S){let T=v[w],C=I(T);if(C!=="object")return new l("Invalid "+O+" `"+S+"` of type `"+C+"` "+("supplied to `"+E+"`, expected `object`."));for(let A in a){let F=a[A];if(!F)continue;let B=F(T,A,E,O,S+"."+A,Q);if(B)return B}return null}return f(d)}function N(a){function d(v,w,E,O,S){let T=v[w],C=I(T);if(C!=="object")return new l("Invalid "+O+" `"+S+"` of type `"+C+"` "+("supplied to `"+E+"`, expected `object`."));let A=Hn({},v[w],a);for(let F in A){let B=a[F];if(!B)return new l("Invalid "+O+" `"+S+"` key `"+F+"` supplied to `"+E+"`.\nBad object: "+JSON.stringify(v[w],null," ")+`
Valid keys: `+JSON.stringify(Object.keys(a),null," "));let $=B(T,F,E,O,S+"."+F,Q);if($)return $}return null}return f(d)}function k(a){switch(typeof a){case"number":case"string":case"undefined":return!0;case"boolean":return!a;case"object":if(Array.isArray(a))return a.every(k);if(a===null||e(a))return!0;var d=r(a);if(d){let v=d.call(a),w;if(d!==a.entries){for(;!(w=v.next()).done;)if(!k(w.value))return!1}else for(;!(w=v.next()).done;){let E=w.value;if(E&&!k(E[1]))return!1}}else return!1;return!0;default:return!1}}function W(a,d){return a==="symbol"?!0:d?d["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&d instanceof Symbol:!1}function I(a){let d=typeof a;return Array.isArray(a)?"array":a instanceof RegExp?"object":W(d,a)?"symbol":d}function Y(a){if(typeof a>"u"||a===null)return""+a;let d=I(a);if(d==="object"){if(a instanceof Date)return"date";if(a instanceof RegExp)return"regexp"}return d}function j(a){let d=Y(a);switch(d){case"array":case"object":return"an "+d;case"boolean":case"date":case"regexp":return"a "+d;default:return d}}function Z(a){return!a.constructor||!a.constructor.name?i:a.constructor.name}return c.checkPropTypes=at,c.resetWarningCache=at.resetWarningCache,c.PropTypes=c,c},P=ze(function(e){{let t=Rt,n=!0;e.exports=no(t.isElement,n)}}),Ye="data-focus-lock",xt="data-focus-lock-disabled",oo="data-no-focus-lock",ro="data-autofocus-inside";function co(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function io(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){let r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}function _t(e,t){return io(t,function(n){return e.forEach(function(o){return co(o,n)})})}var Ie={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};P.node;var Te=function(){return Te=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Te.apply(this,arguments)};function so(e,t){let n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Dt(e){return e}function It(e,t){t===void 0&&(t=Dt);let n=[],o=!1;return{read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){let c=t(i,o);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(i){for(o=!0;n.length;){let c=n;n=[],c.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){o=!0;let c=[];if(n.length){let f=n;n=[],f.forEach(i),c=n}let u=function(){let f=c;c=[],f.forEach(i)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(f){c.push(f),l()},filter:function(f){return c=c.filter(f),n}}}}}function Xe(e,t){return t===void 0&&(t=Dt),It(e,t)}function Lt(e){e===void 0&&(e={});let t=It(null);return t.options=Te({async:!0,ssr:!1},e),t}var Mt=function(e){let t=e.sideCar,n=so(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");let o=t.read();if(!o)throw new Error("Sidecar medium not found");return s.createElement(o,Te({},n))};Mt.isSideCarExport=!0;function ao(e,t){return e.useMedium(t),Mt}var Nt=Xe({},function(e){let t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),Bt=Xe(),uo=Xe(),lo=Lt({async:!0}),fo=[],Ae=s.forwardRef(function(t,n){let o,r=s.useState(),i=r[0],c=r[1],u=s.useRef(),l=s.useRef(!1),f=s.useRef(null),p=t.children,y=t.disabled,g=t.noFocusGuards,R=t.persistentFocus,_=t.crossFrame,h=t.autoFocus,b=t.allowTextSelection,L=t.group,M=t.className,x=t.whiteList,D=t.shards,N=D===void 0?fo:D,k=t.as,W=k===void 0?"div":k,I=t.lockProps,Y=I===void 0?{}:I,j=t.sideCar,Z=t.returnFocus,a=t.onActivation,d=t.onDeactivation,v=s.useState({}),w=v[0],E=s.useCallback(function(){f.current=f.current||document&&document.activeElement,u.current&&a&&a(u.current),l.current=!0},[a]),O=s.useCallback(function(){l.current=!1,d&&d(u.current)},[d]),S=s.useCallback(function(G){let J=f.current;if(Z&&J&&J.focus){let de=typeof Z=="object"?Z:void 0;f.current=null,G?Promise.resolve().then(function(){return J.focus(de)}):J.focus(de)}},[Z]),T=s.useCallback(function(G){l.current&&Nt.useMedium(G)},[]),C=Bt.useMedium,A=s.useCallback(function(G){u.current!==G&&(u.current=G,c(G))},[]);typeof b<"u"&&console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"),s.useEffect(function(){u.current||console.error("FocusLock: could not obtain ref to internal node")},[]);let F=$e((o={},o[xt]=y&&"disabled",o[Ye]=L,o),Y),B=g!==!0,$=B&&g!=="tail",_e=_t([n,A]);return s.createElement(s.Fragment,null,B&&[s.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:y?-1:0,style:Ie}),s.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:y?-1:1,style:Ie})],!y&&s.createElement(j,{id:w,sideCar:lo,observed:i,disabled:y,persistentFocus:R,crossFrame:_,autoFocus:h,whiteList:x,shards:N,onActivation:E,onDeactivation:O,returnFocus:S}),s.createElement(W,$e({ref:_e},F,{className:M,onBlur:C,onFocus:T}),p),$&&s.createElement("div",{"data-focus-guard":!0,tabIndex:y?-1:0,style:Ie}))});Ae.propTypes={children:P.node,disabled:P.bool,returnFocus:P.oneOfType([P.bool,P.object]),noFocusGuards:P.bool,allowTextSelection:P.bool,autoFocus:P.bool,persistentFocus:P.bool,crossFrame:P.bool,group:P.string,className:P.string,whiteList:P.func,shards:P.arrayOf(P.any),as:P.oneOfType([P.string,P.func,P.object]),lockProps:P.object,onActivation:P.func,onDeactivation:P.func,sideCar:P.any.isRequired};Ae.defaultProps={children:void 0,disabled:!1,returnFocus:!1,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};function Ue(e,t){return Ue=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},Ue(e,t)}function mo(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ue(e,t)}function ho(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yo(e,t){{if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.")}function n(o){return o.displayName||o.name||"Component"}return function(r){if(typeof r!="function")throw new Error("Expected WrappedComponent to be a React component.");let i=[],c;function u(){c=e(i.map(function(f){return f.props})),t(c)}let l=function(f){mo(p,f);function p(){return f.apply(this,arguments)||this}p.peek=function(){return c};let y=p.prototype;return y.componentDidMount=function(){i.push(this),u()},y.componentDidUpdate=function(){u()},y.componentWillUnmount=function(){let R=i.indexOf(this);i.splice(R,1),u()},y.render=function(){return s.createElement(r,this.props)},p}(s.PureComponent);return ho(l,"displayName","SideEffect("+n(r)+")"),l}}var X=function(e){let t=Array(e.length);for(let n=0;n<e.length;++n)t[n]=e[n];return t},He=function(e){return Array.isArray(e)?e:[e]},po=function(e){let t=new Set,n=e.length;for(let o=0;o<n;o+=1)for(let r=o+1;r<n;r+=1){let i=e[o].compareDocumentPosition(e[r]);(i&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(r),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(o)}return e.filter(function(o,r){return!t.has(r)})},jt=function(e){return e.parentNode?jt(e.parentNode):e},Qe=function(e){return He(e).filter(Boolean).reduce(function(n,o){let r=o.getAttribute(Ye);return n.push.apply(n,r?po(X(jt(o).querySelectorAll("["+Ye+'="'+r+'"]:not(['+xt+'="disabled"])'))):[o]),n},[])},go=function(e){return!e||!e.getPropertyValue?!1:e.getPropertyValue("display")==="none"||e.getPropertyValue("visibility")==="hidden"},$t=function(e){return!e||e===document||e&&e.nodeType===Node.DOCUMENT_NODE||!go(window.getComputedStyle(e,null))&&$t(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode)},bo=function(e){return!((e.tagName==="INPUT"||e.tagName==="BUTTON")&&(e.type==="hidden"||e.disabled))},Ve=function(e){return!!(e&&e.dataset&&e.dataset.focusGuard)},Se=function(e){return!Ve(e)},vo=function(e){return!!e},wo=function(e,t){let n=e.tabIndex-t.tabIndex,o=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||o},Wt=function(e,t,n){return X(e).map(function(o,r){return{node:o,index:r,tabIndex:n&&o.tabIndex===-1?(o.dataset||{}).focusGuard?0:-1:o.tabIndex}}).filter(function(o){return!t||o.tabIndex>=0}).sort(wo)},Eo=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ge=Eo.join(","),To=Ge+", [data-focus-guard]",Je=function(e,t){return e.reduce(function(n,o){return n.concat(X(o.querySelectorAll(t?To:Ge)),o.parentNode?X(o.parentNode.querySelectorAll(Ge)).filter(function(r){return r===o}):[])},[])},So=function(e){let t=e.querySelectorAll("["+ro+"]");return X(t).map(function(n){return Je([n])}).reduce(function(n,o){return n.concat(o)},[])},et=function(e){return X(e).filter(function(t){return $t(t)}).filter(function(t){return bo(t)})},qe=function(e,t){return Wt(et(Je(e,t)),!0,t)},ut=function(e){return Wt(et(Je(e)),!1)},Co=function(e){return et(So(e))},Ze=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Ze(e.parentNode,t),t},Le=function(e,t){let n=Ze(e),o=Ze(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(o.indexOf(i)>=0)return i}return!1},Yt=function(e,t,n){let o=He(e),r=He(t),i=o[0],c=!1;return r.filter(Boolean).forEach(function(u){c=Le(c||u,u)||c,n.filter(Boolean).forEach(function(l){let f=Le(i,l);f&&(!c||f.contains(c)?c=f:c=Le(f,c))})}),c},Oo=function(e){return e.reduce(function(t,n){return t.concat(Co(n))},[])},Po=function(e){let t=Qe(e).filter(Se),n=Yt(e,e,t),o=qe([n],!0),r=qe(t).filter(function(i){let c=i.node;return Se(c)}).map(function(i){return i.node});return o.map(function(i){let c=i.node,u=i.index;return{node:c,index:u,lockItem:r.indexOf(c)>=0,guard:Ve(c)}})},Ro=function(e){return e===document.activeElement},ko=function(e){return!!X(e.querySelectorAll("iframe")).some(function(t){return Ro(t)})},Ut=function(e){let t=document&&document.activeElement;return!t||t.dataset&&t.dataset.focusGuard?!1:Qe(e).reduce(function(n,o){return n||o.contains(t)||ko(o)},!1)},Ao=function(){return document&&X(document.querySelectorAll("["+oo+"]")).some(function(e){return e.contains(document.activeElement)})},Ht=function(e){return e.tagName==="INPUT"&&e.type==="radio"},Fo=function(e,t){return t.filter(Ht).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},tt=function(e,t){return Ht(e)&&e.name?Fo(e,t):e},xo=function(e){let t=new Set;return e.forEach(function(n){return t.add(tt(n,e))}),e.filter(function(n){return t.has(n)})},lt=function(e){return e[0]&&e.length>1?tt(e[0],e):e[0]},ft=function(e,t){return e.length>1?e.indexOf(tt(e[t],e)):t},Gt="NEW_FOCUS",_o=function(e,t,n,o){let r=e.length,i=e[0],c=e[r-1],u=Ve(n);if(e.indexOf(n)>=0)return;let l=t.indexOf(n),f=o?t.indexOf(o):l,p=o?e.indexOf(o):-1,y=l-f,g=t.indexOf(i),R=t.indexOf(c),_=xo(t),h=_.indexOf(n)-(o?_.indexOf(o):l),b=ft(e,0),L=ft(e,r-1);if(l===-1||p===-1)return Gt;if(!y&&p>=0)return p;if(l<=g&&u&&Math.abs(y)>1)return L;if(l>=R&&u&&Math.abs(y)>1)return b;if(y&&Math.abs(h)>1)return p;if(l<=g)return L;if(l>R)return b;if(y)return Math.abs(y)>1?p:(r+p+y)%r},Do=function(e){return function(t){return t.autofocus||t.dataset&&!!t.dataset.autofocus||e.indexOf(t)>=0}},Io=function(e,t){let n=new Map;return t.forEach(function(o){return n.set(o.node,o)}),e.map(function(o){return n.get(o)}).filter(vo)},Lo=function(e,t){let n=document&&document.activeElement,o=Qe(e).filter(Se),r=Yt(n||e,e,o),i=ut(o),c=qe(o).filter(function(y){let g=y.node;return Se(g)});if(!c[0]&&(c=i,!c[0]))return;let u=ut([r]).map(function(y){return y.node}),l=Io(u,c),f=l.map(function(y){return y.node}),p=_o(f,u,n,t);if(p===Gt){let y=i.map(function(g){return g.node}).filter(Do(Oo(o)));return{node:y&&y.length?lt(y):lt(f)}}return p===void 0?p:l[p]},Mo=function(e){e.focus(),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},Me=0,Ne=!1,qt=function(e,t){let n=Lo(e,t);if(!Ne&&n){if(Me>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ne=!0,setTimeout(function(){Ne=!1},1);return}Me++,Mo(n.node),Me--}};function Zt(e){let t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var No=function(){return document&&document.activeElement===document.body},Bo=function(){return No()||Ao()},se=null,re=null,ae=null,fe=!1,jo=function(){return!0},$o=function(t){return(se.whiteList||jo)(t)},Wo=function(t,n){ae={observerNode:t,portaledElement:n}},Yo=function(t){return ae&&ae.portaledElement===t};function dt(e,t,n,o){let r=null,i=e;do{let c=o[i];if(c.guard)c.node.dataset.focusAutoGuard&&(r=c);else if(c.lockItem){if(i!==e)return;r=null}else break}while((i+=n)!==t);r&&(r.node.tabIndex=0)}var Uo=function(t){return t&&"current"in t?t.current:t},Ho=function(t){return t?!!fe:fe==="meanwhile"},Ce=function(){let t=!1;if(se){let n=se,o=n.observed,r=n.persistentFocus,i=n.autoFocus,c=n.shards,u=n.crossFrame,l=o||ae&&ae.portaledElement,f=document&&document.activeElement;if(l){let p=[l].concat(c.map(Uo).filter(Boolean));if((!f||$o(f))&&(r||Ho(u)||!Bo()||!re&&i)&&(l&&!(Ut(p)||Yo(f))&&(document&&!re&&f&&!i?(f.blur&&f.blur(),document.body.focus()):(t=qt(p,re),ae={})),fe=!1,re=document&&document.activeElement),document){let y=document&&document.activeElement,g=Po(p),R=g.map(function(_){return _.node}).indexOf(y);R>-1&&(g.filter(function(_){let h=_.guard,b=_.node;return h&&b.dataset.focusAutoGuard}).forEach(function(_){return _.node.removeAttribute("tabIndex")}),dt(R,g.length,1,g),dt(R,-1,-1,g))}}}return t},Kt=function(t){Ce()&&t&&(t.stopPropagation(),t.preventDefault())},nt=function(){return Zt(Ce)},Go=function(t){let n=t.target,o=t.currentTarget;o.contains(n)||Wo(o,n)},qo=function(){return null};P.node.isRequired;var zt=function(){fe="just",setTimeout(function(){fe="meanwhile"},0)},Zo=function(){document.addEventListener("focusin",Kt,!0),document.addEventListener("focusout",nt),window.addEventListener("blur",zt)},Ko=function(){document.removeEventListener("focusin",Kt,!0),document.removeEventListener("focusout",nt),window.removeEventListener("blur",zt)};function zo(e){return e.filter(function(t){return!t.disabled})}function Xo(e){let t=e.slice(-1)[0];t&&!se&&Zo();let n=se,o=n&&t&&t.id===n.id;se=t,n&&!o&&(n.onDeactivation(),e.filter(function(r){return r.id===n.id}).length||n.returnFocus(!t)),t?(re=null,(!o||n.observed!==t.observed)&&t.onActivation(),Ce(),Zt(Ce)):(Ko(),re=null)}Nt.assignSyncMedium(Go);Bt.assignMedium(nt);uo.assignMedium(function(e){return e({moveFocusInside:qt,focusInside:Ut})});var Qo=yo(zo,Xo)(qo),Xt=s.forwardRef(function(t,n){return s.createElement(Ae,$e({sideCar:Qo,ref:n},t))}),Qt=Ae.propTypes||{};Qt.sideCar;var Vo=Vn(Qt,["sideCar"]);Xt.propTypes=Vo;var ue=function(){return ue=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ue.apply(this,arguments)};function Jo(e,t){let n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}var ve="right-scroll-bar-position",we="width-before-scroll-bar",er="with-scroll-bars-hidden",tr="--removed-body-scroll-bar-size",Vt=Lt(),Be=function(){},Fe=s.forwardRef(function(e,t){let n=s.useRef(null),o=s.useState({onScrollCapture:Be,onWheelCapture:Be,onTouchMoveCapture:Be}),r=o[0],i=o[1],c=e.forwardProps,u=e.children,l=e.className,f=e.removeScrollBar,p=e.enabled,y=e.shards,g=e.sideCar,R=e.noIsolation,_=e.inert,h=e.allowPinchZoom,b=e.as,L=b===void 0?"div":b,M=Jo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=g,D=_t([n,t]),N=ue({},M,r);return s.createElement(s.Fragment,null,p&&s.createElement(x,{sideCar:Vt,removeScrollBar:f,shards:y,noIsolation:R,inert:_,setCallbacks:i,allowPinchZoom:!!h,lockRef:n}),c?s.cloneElement(s.Children.only(u),ue({},N,{ref:D})):s.createElement(L,ue({},N,{className:l,ref:D}),u))});Fe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fe.classNames={fullWidth:we,zeroRight:ve};var nr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function or(){if(!document)return null;let e=document.createElement("style");e.type="text/css";let t=nr();return t&&e.setAttribute("nonce",t),e}function rr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cr(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var ir=function(){let e=0,t=null;return{add:function(n){e==0&&(t=or())&&(rr(t,n),cr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sr=function(){let e=ir();return function(t){s.useEffect(function(){return e.add(t),function(){e.remove()}},[])}},Jt=function(){let e=sr();return function(n){let o=n.styles;return e(o),null}},ar={left:0,top:0,right:0,gap:0},je=function(e){return parseInt(e||"",10)||0},ur=function(e){let t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[je(n),je(o),je(r)]},mt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ar;let t=ur(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},lr=Jt(),fr=function(e,t,n,o){let r=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
.`+er+` {
overflow: hidden `+o+`;
padding-right: `+u+"px "+o+`;
}
body {
overflow: hidden `+o+`;
`+[t&&"position: relative "+o+";",n==="margin"&&`
padding-left: `+r+`px;
padding-top: `+i+`px;
padding-right: `+c+`px;
margin-left:0;
margin-top:0;
margin-right: `+u+"px "+o+`;
`,n==="padding"&&"padding-right: "+u+"px "+o+";"].filter(Boolean).join("")+`
}
.`+ve+` {
right: `+u+"px "+o+`;
}
.`+we+` {
margin-right: `+u+"px "+o+`;
}
.`+ve+" ."+ve+` {
right: 0 `+o+`;
}
.`+we+" ."+we+` {
margin-right: 0 `+o+`;
}
body {
`+tr+": "+u+`px;
}
`},dr=function(e){let t=s.useState(mt(e.gapMode)),n=t[0],o=t[1];s.useEffect(function(){o(mt(e.gapMode))},[e.gapMode]);let r=e.noRelative,i=e.noImportant,c=e.gapMode;return s.createElement(lr,{styles:fr(n,!r,c===void 0?"margin":c,i?"":"!important")})},mr=function(e){let t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},hr=function(e){let t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},ht=function(e,t){let n=t;do{if(en(e,n)){let r=tn(e,n),i=r[1],c=r[2];if(i>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},yr=function(e){let t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},pr=function(e){let t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},en=function(e,t){return e==="v"?mr(t):hr(t)},tn=function(e,t){return e==="v"?yr(t):pr(t)},gr=function(e,t,n,o,r){let i=o,c=n.target,u=t.contains(c),l=!1,f=i>0,p=0,y=0;do{let g=tn(e,c),R=g[0],_=g[1],h=g[2],b=_-h-R;(R||b)&&en(e,c)&&(p+=b,y+=R),c=c.parentNode}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&(r&&p===0||!r&&i>p)||!f&&(r&&y===0||!r&&-i>y))&&(l=!0),l},Ke=!1;if(typeof window<"u")try{let e=Object.defineProperty({},"passive",{get:function(){return Ke=!0,!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{Ke=!1}var ee=Ke?{passive:!1}:!1,pe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yt=function(e){return[e.deltaX,e.deltaY]},pt=function(e){return e&&"current"in e?e.current:e},br=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vr=function(e){return`
.block-interactivity-`+e+` {pointer-events: none;}
.allow-interactivity-`+e+` {pointer-events: all;}
`},wr=0,te=[];function Er(e){let t=s.useRef([]),n=s.useRef([0,0]),o=s.useRef(),r=s.useState(wr++)[0],i=s.useState(function(){return Jt()})[0],c=s.useRef(e);s.useEffect(function(){c.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-"+r);let h=[e.lockRef.current].concat((e.shards||[]).map(pt)).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-"+r)}),function(){document.body.classList.remove("block-interactivity-"+r),h.forEach(function(b){return b.classList.remove("allow-interactivity-"+r)})}}},[e.inert,e.lockRef.current,e.shards]);let u=s.useCallback(function(h,b){if("touches"in h&&h.touches.length===2)return!c.current.allowPinchZoom;let L=pe(h),M=n.current,x="deltaX"in h?h.deltaX:M[0]-L[0],D="deltaY"in h?h.deltaY:M[1]-L[1],N,k=h.target,W=Math.abs(x)>Math.abs(D)?"h":"v",I=ht(W,k);if(!I)return!0;if(I?N=W:(N=W==="v"?"h":"v",I=ht(W,k)),!I)return!1;if(!o.current&&"changedTouches"in h&&(x||D)&&(o.current=N),!N)return!0;let Y=o.current||N;return gr(Y,b,h,Y==="h"?x:D,!0)},[]),l=s.useCallback(function(h){let b=h;if(!te.length||te[te.length-1]!==i)return;let L="deltaY"in b?yt(b):pe(b),M=t.current.filter(function(x){return x.name===b.type&&x.target===b.target&&br(x.delta,L)})[0];if(M&&M.should){b.preventDefault();return}if(!M){let x=(c.current.shards||[]).map(pt).filter(Boolean).filter(function(N){return N.contains(b.target)});(x.length>0?u(b,x[0]):!c.current.noIsolation)&&b.preventDefault()}},[]),f=s.useCallback(function(h,b,L,M){let x={name:h,delta:b,target:L,should:M};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(D){return D!==x})},1)},[]),p=s.useCallback(function(h){n.current=pe(h),o.current=void 0},[]),y=s.useCallback(function(h){f(h.type,yt(h),h.target,u(h,e.lockRef.current))},[]),g=s.useCallback(function(h){f(h.type,pe(h),h.target,u(h,e.lockRef.current))},[]);s.useEffect(function(){return te.push(i),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:g}),document.addEventListener("wheel",l,ee),document.addEventListener("touchmove",l,ee),document.addEventListener("touchstart",p,ee),function(){te=te.filter(function(h){return h!==i}),document.removeEventListener("wheel",l,ee),document.removeEventListener("touchmove",l,ee),document.removeEventListener("touchstart",p,ee)}},[]);let R=e.removeScrollBar,_=e.inert;return s.createElement(s.Fragment,null,_?s.createElement(i,{styles:vr(r)}):null,R?s.createElement(dr,{gapMode:"margin"}):null)}var Tr=ao(Vt,Er),nn=s.forwardRef(function(e,t){return s.createElement(Fe,ue({},e,{ref:t,sideCar:Tr}))});nn.classNames=Fe.classNames;function H(){return H=Object.assign||function(e){for(let t=1;t<arguments.length;t++){let n=arguments[t];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},H.apply(this,arguments)}function xe(e,t){if(e==null)return{};let n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var on={allowPinchZoom:P.bool,dangerouslyBypassFocusLock:P.bool,dangerouslyBypassScrollLock:P.bool,initialFocusRef:function(){return null},onDismiss:P.func},le=ke(function(t,n){let o=t.as,r=o===void 0?"div":o,i=t.isOpen,c=i===void 0?!0:i,u=xe(t,["as","isOpen"]);return Ot("dialog"),s.useEffect(function(){c?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame(function(){window.__REACH_DISABLE_TOOLTIPS=!1})},[c]),c?s.createElement(Pt,{"data-reach-dialog-wrapper":""},s.createElement(Sr,H({ref:n,as:r},u))):null});le.displayName="DialogOverlay",le.propTypes=H({},on,{isOpen:P.bool});var Sr=ke(function(t,n){let o=t.allowPinchZoom,r=t.as,i=r===void 0?"div":r,c=t.dangerouslyBypassFocusLock,u=c===void 0?!1:c,l=t.dangerouslyBypassScrollLock,f=l===void 0?!1:l,p=t.initialFocusRef,y=t.onClick,g=t.onDismiss,R=g===void 0?U:g,_=t.onKeyDown,h=t.onMouseDown,b=t.unstable_lockFocusAcrossFrames,L=b===void 0?!0:b,M=xe(t,["allowPinchZoom","as","dangerouslyBypassFocusLock","dangerouslyBypassScrollLock","initialFocusRef","onClick","onDismiss","onKeyDown","onMouseDown","unstable_lockFocusAcrossFrames"]),x=s.useRef(null),D=s.useRef(null),N=Qn(D,n),k=s.useCallback(function(){p&&p.current&&p.current.focus()},[p]);function W(j){x.current===j.target&&(j.stopPropagation(),R(j))}function I(j){j.key==="Escape"&&(j.stopPropagation(),R(j))}function Y(j){x.current=j.target}return s.useEffect(function(){return D.current?Cr(D.current):void 0},[]),s.createElement(Xt,{autoFocus:!0,returnFocus:!0,onActivation:k,disabled:u,crossFrame:L},s.createElement(nn,{allowPinchZoom:o,enabled:!f},s.createElement(i,H({},M,{ref:N,"data-reach-dialog-overlay":"",onClick:be(y,W),onKeyDown:be(_,I),onMouseDown:be(h,Y)}))))});le.displayName="DialogOverlay",le.propTypes=H({},on);var Oe=ke(function(t,n){let o=t.as,r=o===void 0?"div":o,i=t.onClick;t.onKeyDown;let c=xe(t,["as","onClick","onKeyDown"]);return s.createElement(r,H({"aria-modal":"true",role:"dialog",tabIndex:-1},c,{ref:n,"data-reach-dialog-content":"",onClick:be(i,function(u){u.stopPropagation()})}))});Oe.displayName="DialogContent",Oe.propTypes={"aria-label":Re,"aria-labelledby":Re};var Pe=ke(function(t,n){let o=t.allowPinchZoom,r=o===void 0?!1:o,i=t.initialFocusRef,c=t.isOpen,u=t.onDismiss,l=u===void 0?U:u,f=xe(t,["allowPinchZoom","initialFocusRef","isOpen","onDismiss"]);return s.createElement(le,{allowPinchZoom:r,initialFocusRef:i,isOpen:c,onDismiss:l},s.createElement(Oe,H({ref:n},f)))});Pe.displayName="Dialog",Pe.propTypes={isOpen:P.bool,onDismiss:P.func,"aria-label":Re,"aria-labelledby":Re};function Cr(e){let t=[],n=[],o=Zn(e);return e?(Array.prototype.forEach.call(o.querySelectorAll("body > *"),function(r){let i,c,u=(i=e.parentNode)==null||(c=i.parentNode)==null?void 0:c.parentNode;if(r===u)return;let l=r.getAttribute("aria-hidden");l!==null&&l!=="false"||(t.push(l),n.push(r),r.setAttribute("aria-hidden","true"))}),function(){n.forEach(function(r,i){let c=t[i];c===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",c)})}):(console.warn("A ref has not yet been attached to a dialog node when attempting to call `createAriaHider`."),U)}function Re(e,t,n,o,r){let i=`
See https://www.w3.org/TR/wai-aria/#aria-label for details.`;return!e["aria-label"]&&!e["aria-labelledby"]?new Error("A <"+n+"> must have either an `aria-label` or `aria-labelledby` prop.\n "+i):e["aria-label"]&&e["aria-labelledby"]?new Error("You provided both `aria-label` and `aria-labelledby` props to a <"+n+">. If the a label for this component is visible on the screen, that label's component should be given a unique ID prop, and that ID should be passed as the `aria-labelledby` prop into <"+n+">. If the label cannot be determined programmatically from the content of the element, an alternative label should be provided as the `aria-label` prop, which will be used as an `aria-label` on the HTML tag."+i):e[t]!=null&&!zn(e[t])?new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected `string`, received `"+(Array.isArray(r)?"array":typeof r)+"`."):null}var Or=Pe;0&&(module.exports={Dialog,DialogContent,DialogOverlay});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */