UNPKG

ladle-inject-custom-addons

Version:
57 lines (49 loc) 42.3 kB
import*as s from"react";import*as ht from"react-dom";function Ne(){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 Ke(e,t,n){return n={path:t,exports:{},require:function(o,r){return sn(o,r??n.path)}},e(n,n.exports),n.exports}function sn(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}function yt(){throw new Error("setTimeout has not been defined")}function pt(){throw new Error("clearTimeout has not been defined")}var K=yt,z=pt,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 gt(e){if(K===setTimeout)return setTimeout(e,0);if((K===yt||!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 an(e){if(z===clearTimeout)return clearTimeout(e);if((z===pt||!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,pe=-1;function un(){!ie||!V||(ie=!1,V.length?q=V.concat(q):pe=-1,q.length&&bt())}function bt(){if(ie)return;let e=gt(un);ie=!0;let t=q.length;for(;t;){for(V=q,q=[];++pe<t;)V&&V[pe].run();pe=-1,t=q.length}V=null,ie=!1,an(e)}function ln(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 vt(e,t)),q.length===1&&!ie&&gt(bt)}function vt(e,t){this.fun=e,this.array=t}vt.prototype.run=function(){this.fun.apply(null,this.array)};var fn="browser",dn="browser",mn=!0,hn=[],yn="",pn={},gn={},bn={};function U(){}var vn=U,wn=U,En=U,Tn=U,Sn=U,Cn=U,On=U;function Pn(e){throw new Error("process.binding is not supported")}function Rn(){return"/"}function kn(e){throw new Error("process.chdir is not supported")}function An(){return 0}var ne=ce.performance||{},Fn=ne.now||ne.mozNow||ne.msNow||ne.oNow||ne.webkitNow||function(){return new Date().getTime()};function xn(e){let t=Fn.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 _n=new Date;function Dn(){return(new Date-_n)/1e3}var ot={nextTick:ln,title:fn,browser:mn,env:{NODE_ENV:"development"},argv:hn,version:yn,versions:pn,on:vn,addListener:wn,once:En,off:Tn,removeListener:Sn,removeAllListeners:Cn,emit:On,binding:Pn,cwd:Rn,chdir:kn,umask:An,hrtime:xn,platform:dn,release:gn,config:bn,uptime:Dn},In=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},Ln=Et()?s.useLayoutEffect:s.useEffect,rt={},wt=U;{let e=typeof ot<"u"?ot:{env:{NODE_ENV:"development"}},t=e.env;wt=function(o){rt[o]||(rt[o]=!0)}}function Mn(e,t){if(e!=null)if(Bn(e))e(t);else try{e.current=t}catch{throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function Et(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Oe(e){return s.forwardRef(e)}function Nn(e){return Et()?e?e.ownerDocument:document:null}function Bn(e){return!!(e&&{}.toString.call(e)=="[object Function]")}function jn(e){return typeof e=="string"}var Tt=U;Tt=function(t){let n=s.useRef(t);s.useEffect(function(){return void(n.current=t)},[t]),s.useEffect(function(){return wt(n.current)},[])};function $n(){let e=s.useState(Object.create(null)),t=e[1];return s.useCallback(function(){t(Object.create(null))},[])}function Wn(){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){Mn(r,o)})}},[].concat(t))}function ge(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}}var St=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=$n();return Ln(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?ht.createPortal(n,c.current):s.createElement("span",{ref:i})};St.displayName="Portal";function Yn(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 Un=Ke(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 Fe=m.$$typeof;switch(Fe){case o:var me=m.type;switch(me){case p:case y:case i:case u:case c:case R:return me;default:var nt=me&&me.$$typeof;switch(nt){case f:case g:case b:case h:case l:return nt;default:return Fe}}case r:return Fe}}}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 Ae(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 tn(m){return k(m)===h}function nn(m){return k(m)===r}function on(m){return k(m)===u}function rn(m){return k(m)===c}function cn(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=Ae,t.isForwardRef=G,t.isFragment=J,t.isLazy=de,t.isMemo=tn,t.isPortal=nn,t.isProfiler=on,t.isStrictMode=rn,t.isSuspense=cn,t.isValidElementType=N,t.typeOf=k})()}),Ct=Ke(function(e){e.exports=Un}),Hn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Q=Hn,Be=function(){};Ot=Q,we={},Pt=Function.call.bind(Object.prototype.hasOwnProperty),Be=function(e){let t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}};var Ot,we,Pt;function Rt(e,t,n,o,r){for(let c in e)if(Pt(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,Ot)}catch(u){i=u}if(i&&!(i instanceof Error)&&Be((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 we)){we[i.message]=!0;let u=r?r():"";Be("Failed "+n+" type: "+i.message+(u??""))}}}Rt.resetWarningCache=function(){we={}};var ct=Rt,Gn=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 he(){return null}var qn=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(he)}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(!Ct.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."),he;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(Gn(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."),he;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+"."),he}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=In({},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=ct,c.resetWarningCache=ct.resetWarningCache,c.PropTypes=c,c},P=Ke(function(e){{let t=Ct,n=!0;e.exports=qn(t.isElement,n)}}),je="data-focus-lock",kt="data-focus-lock-disabled",Zn="data-no-focus-lock",Kn="data-autofocus-inside";function zn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Xn(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 At(e,t){return Xn(t,function(n){return e.forEach(function(o){return zn(o,n)})})}var xe={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};P.node;var Ee=function(){return Ee=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},Ee.apply(this,arguments)};function Qn(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 Ft(e){return e}function xt(e,t){t===void 0&&(t=Ft);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 ze(e,t){return t===void 0&&(t=Ft),xt(e,t)}function _t(e){e===void 0&&(e={});let t=xt(null);return t.options=Ee({async:!0,ssr:!1},e),t}var Dt=function(e){let t=e.sideCar,n=Qn(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,Ee({},n))};Dt.isSideCarExport=!0;function Vn(e,t){return e.useMedium(t),Dt}var It=ze({},function(e){let t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),Lt=ze(),Jn=ze(),eo=_t({async:!0}),to=[],Pe=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?to: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&&It.useMedium(G)},[]),C=Lt.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=Ne((o={},o[kt]=y&&"disabled",o[je]=L,o),Y),B=g!==!0,$=B&&g!=="tail",Ae=At([n,A]);return s.createElement(s.Fragment,null,B&&[s.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:y?-1:0,style:xe}),s.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:y?-1:1,style:xe})],!y&&s.createElement(j,{id:w,sideCar:eo,observed:i,disabled:y,persistentFocus:R,crossFrame:_,autoFocus:h,whiteList:x,shards:N,onActivation:E,onDeactivation:O,returnFocus:S}),s.createElement(W,Ne({ref:Ae},F,{className:M,onBlur:C,onFocus:T}),p),$&&s.createElement("div",{"data-focus-guard":!0,tabIndex:y?-1:0,style:xe}))});Pe.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};Pe.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 $e(e,t){return $e=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},$e(e,t)}function no(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$e(e,t)}function oo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ro(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){no(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 oo(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},We=function(e){return Array.isArray(e)?e:[e]},co=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)})},Mt=function(e){return e.parentNode?Mt(e.parentNode):e},Xe=function(e){return We(e).filter(Boolean).reduce(function(n,o){let r=o.getAttribute(je);return n.push.apply(n,r?co(X(Mt(o).querySelectorAll("["+je+'="'+r+'"]:not(['+kt+'="disabled"])'))):[o]),n},[])},io=function(e){return!e||!e.getPropertyValue?!1:e.getPropertyValue("display")==="none"||e.getPropertyValue("visibility")==="hidden"},Nt=function(e){return!e||e===document||e&&e.nodeType===Node.DOCUMENT_NODE||!io(window.getComputedStyle(e,null))&&Nt(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode)},so=function(e){return!((e.tagName==="INPUT"||e.tagName==="BUTTON")&&(e.type==="hidden"||e.disabled))},Qe=function(e){return!!(e&&e.dataset&&e.dataset.focusGuard)},Te=function(e){return!Qe(e)},ao=function(e){return!!e},uo=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},Bt=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(uo)},lo=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ye=lo.join(","),fo=Ye+", [data-focus-guard]",Ve=function(e,t){return e.reduce(function(n,o){return n.concat(X(o.querySelectorAll(t?fo:Ye)),o.parentNode?X(o.parentNode.querySelectorAll(Ye)).filter(function(r){return r===o}):[])},[])},mo=function(e){let t=e.querySelectorAll("["+Kn+"]");return X(t).map(function(n){return Ve([n])}).reduce(function(n,o){return n.concat(o)},[])},Je=function(e){return X(e).filter(function(t){return Nt(t)}).filter(function(t){return so(t)})},Ue=function(e,t){return Bt(Je(Ve(e,t)),!0,t)},it=function(e){return Bt(Je(Ve(e)),!1)},ho=function(e){return Je(mo(e))},He=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&He(e.parentNode,t),t},_e=function(e,t){let n=He(e),o=He(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(o.indexOf(i)>=0)return i}return!1},jt=function(e,t,n){let o=We(e),r=We(t),i=o[0],c=!1;return r.filter(Boolean).forEach(function(u){c=_e(c||u,u)||c,n.filter(Boolean).forEach(function(l){let f=_e(i,l);f&&(!c||f.contains(c)?c=f:c=_e(f,c))})}),c},yo=function(e){return e.reduce(function(t,n){return t.concat(ho(n))},[])},po=function(e){let t=Xe(e).filter(Te),n=jt(e,e,t),o=Ue([n],!0),r=Ue(t).filter(function(i){let c=i.node;return Te(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:Qe(c)}})},go=function(e){return e===document.activeElement},bo=function(e){return!!X(e.querySelectorAll("iframe")).some(function(t){return go(t)})},$t=function(e){let t=document&&document.activeElement;return!t||t.dataset&&t.dataset.focusGuard?!1:Xe(e).reduce(function(n,o){return n||o.contains(t)||bo(o)},!1)},vo=function(){return document&&X(document.querySelectorAll("["+Zn+"]")).some(function(e){return e.contains(document.activeElement)})},Wt=function(e){return e.tagName==="INPUT"&&e.type==="radio"},wo=function(e,t){return t.filter(Wt).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},et=function(e,t){return Wt(e)&&e.name?wo(e,t):e},Eo=function(e){let t=new Set;return e.forEach(function(n){return t.add(et(n,e))}),e.filter(function(n){return t.has(n)})},st=function(e){return e[0]&&e.length>1?et(e[0],e):e[0]},at=function(e,t){return e.length>1?e.indexOf(et(e[t],e)):t},Yt="NEW_FOCUS",To=function(e,t,n,o){let r=e.length,i=e[0],c=e[r-1],u=Qe(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),_=Eo(t),h=_.indexOf(n)-(o?_.indexOf(o):l),b=at(e,0),L=at(e,r-1);if(l===-1||p===-1)return Yt;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},So=function(e){return function(t){return t.autofocus||t.dataset&&!!t.dataset.autofocus||e.indexOf(t)>=0}},Co=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(ao)},Oo=function(e,t){let n=document&&document.activeElement,o=Xe(e).filter(Te),r=jt(n||e,e,o),i=it(o),c=Ue(o).filter(function(y){let g=y.node;return Te(g)});if(!c[0]&&(c=i,!c[0]))return;let u=it([r]).map(function(y){return y.node}),l=Co(u,c),f=l.map(function(y){return y.node}),p=To(f,u,n,t);if(p===Yt){let y=i.map(function(g){return g.node}).filter(So(yo(o)));return{node:y&&y.length?st(y):st(f)}}return p===void 0?p:l[p]},Po=function(e){e.focus(),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},De=0,Ie=!1,Ut=function(e,t){let n=Oo(e,t);if(!Ie&&n){if(De>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ie=!0,setTimeout(function(){Ie=!1},1);return}De++,Po(n.node),De--}};function Ht(e){let t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Ro=function(){return document&&document.activeElement===document.body},ko=function(){return Ro()||vo()},se=null,re=null,ae=null,le=!1,Ao=function(){return!0},Fo=function(t){return(se.whiteList||Ao)(t)},xo=function(t,n){ae={observerNode:t,portaledElement:n}},_o=function(t){return ae&&ae.portaledElement===t};function ut(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 Do=function(t){return t&&"current"in t?t.current:t},Io=function(t){return t?!!le:le==="meanwhile"},Se=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(Do).filter(Boolean));if((!f||Fo(f))&&(r||Io(u)||!ko()||!re&&i)&&(l&&!($t(p)||_o(f))&&(document&&!re&&f&&!i?(f.blur&&f.blur(),document.body.focus()):(t=Ut(p,re),ae={})),le=!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")}),ut(R,g.length,1,g),ut(R,-1,-1,g))}}}return t},Gt=function(t){Se()&&t&&(t.stopPropagation(),t.preventDefault())},tt=function(){return Ht(Se)},Lo=function(t){let n=t.target,o=t.currentTarget;o.contains(n)||xo(o,n)},Mo=function(){return null};P.node.isRequired;var qt=function(){le="just",setTimeout(function(){le="meanwhile"},0)},No=function(){document.addEventListener("focusin",Gt,!0),document.addEventListener("focusout",tt),window.addEventListener("blur",qt)},Bo=function(){document.removeEventListener("focusin",Gt,!0),document.removeEventListener("focusout",tt),window.removeEventListener("blur",qt)};function jo(e){return e.filter(function(t){return!t.disabled})}function $o(e){let t=e.slice(-1)[0];t&&!se&&No();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(),Se(),Ht(Se)):(Bo(),re=null)}It.assignSyncMedium(Lo);Lt.assignMedium(tt);Jn.assignMedium(function(e){return e({moveFocusInside:Ut,focusInside:$t})});var Wo=ro(jo,$o)(Mo),Zt=s.forwardRef(function(t,n){return s.createElement(Pe,Ne({sideCar:Wo,ref:n},t))}),Kt=Pe.propTypes||{};Kt.sideCar;var Yo=Yn(Kt,["sideCar"]);Zt.propTypes=Yo;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 Uo(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 be="right-scroll-bar-position",ve="width-before-scroll-bar",Ho="with-scroll-bars-hidden",Go="--removed-body-scroll-bar-size",zt=_t(),Le=function(){},Re=s.forwardRef(function(e,t){let n=s.useRef(null),o=s.useState({onScrollCapture:Le,onWheelCapture:Le,onTouchMoveCapture:Le}),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=Uo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=g,D=At([n,t]),N=ue({},M,r);return s.createElement(s.Fragment,null,p&&s.createElement(x,{sideCar:zt,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))});Re.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Re.classNames={fullWidth:ve,zeroRight:be};var qo=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zo(){if(!document)return null;let e=document.createElement("style");e.type="text/css";let t=qo();return t&&e.setAttribute("nonce",t),e}function Ko(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zo(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var Xo=function(){let e=0,t=null;return{add:function(n){e==0&&(t=Zo())&&(Ko(t,n),zo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Qo=function(){let e=Xo();return function(t){s.useEffect(function(){return e.add(t),function(){e.remove()}},[])}},Xt=function(){let e=Qo();return function(n){let o=n.styles;return e(o),null}},Vo={left:0,top:0,right:0,gap:0},Me=function(e){return parseInt(e||"",10)||0},Jo=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[Me(n),Me(o),Me(r)]},lt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Vo;let t=Jo(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])}},er=Xt(),tr=function(e,t,n,o){let r=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),` .`+Ho+` { 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("")+` } .`+be+` { right: `+u+"px "+o+`; } .`+ve+` { margin-right: `+u+"px "+o+`; } .`+be+" ."+be+` { right: 0 `+o+`; } .`+ve+" ."+ve+` { margin-right: 0 `+o+`; } body { `+Go+": "+u+`px; } `},nr=function(e){let t=s.useState(lt(e.gapMode)),n=t[0],o=t[1];s.useEffect(function(){o(lt(e.gapMode))},[e.gapMode]);let r=e.noRelative,i=e.noImportant,c=e.gapMode;return s.createElement(er,{styles:tr(n,!r,c===void 0?"margin":c,i?"":"!important")})},or=function(e){let t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},rr=function(e){let t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},ft=function(e,t){let n=t;do{if(Qt(e,n)){let r=Vt(e,n),i=r[1],c=r[2];if(i>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},cr=function(e){let t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},ir=function(e){let t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Qt=function(e,t){return e==="v"?or(t):rr(t)},Vt=function(e,t){return e==="v"?cr(t):ir(t)},sr=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=Vt(e,c),R=g[0],_=g[1],h=g[2],b=_-h-R;(R||b)&&Qt(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},Ge=!1;if(typeof window<"u")try{let e=Object.defineProperty({},"passive",{get:function(){return Ge=!0,!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{Ge=!1}var ee=Ge?{passive:!1}:!1,ye=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dt=function(e){return[e.deltaX,e.deltaY]},mt=function(e){return e&&"current"in e?e.current:e},ar=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ur=function(e){return` .block-interactivity-`+e+` {pointer-events: none;} .allow-interactivity-`+e+` {pointer-events: all;} `},lr=0,te=[];function fr(e){let t=s.useRef([]),n=s.useRef([0,0]),o=s.useRef(),r=s.useState(lr++)[0],i=s.useState(function(){return Xt()})[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(mt)).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=ye(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=ft(W,k);if(!I)return!0;if(I?N=W:(N=W==="v"?"h":"v",I=ft(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 sr(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?dt(b):ye(b),M=t.current.filter(function(x){return x.name===b.type&&x.target===b.target&&ar(x.delta,L)})[0];if(M&&M.should){b.preventDefault();return}if(!M){let x=(c.current.shards||[]).map(mt).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=ye(h),o.current=void 0},[]),y=s.useCallback(function(h){f(h.type,dt(h),h.target,u(h,e.lockRef.current))},[]),g=s.useCallback(function(h){f(h.type,ye(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:ur(r)}):null,R?s.createElement(nr,{gapMode:"margin"}):null)}var dr=Vn(zt,fr),Jt=s.forwardRef(function(e,t){return s.createElement(Re,ue({},e,{ref:t,sideCar:dr}))});Jt.classNames=Re.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 ke(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 en={allowPinchZoom:P.bool,dangerouslyBypassFocusLock:P.bool,dangerouslyBypassScrollLock:P.bool,initialFocusRef:function(){return null},onDismiss:P.func},fe=Oe(function(t,n){let o=t.as,r=o===void 0?"div":o,i=t.isOpen,c=i===void 0?!0:i,u=ke(t,["as","isOpen"]);return Tt("dialog"),s.useEffect(function(){c?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame(function(){window.__REACH_DISABLE_TOOLTIPS=!1})},[c]),c?s.createElement(St,{"data-reach-dialog-wrapper":""},s.createElement(mr,H({ref:n,as:r},u))):null});fe.displayName="DialogOverlay",fe.propTypes=H({},en,{isOpen:P.bool});var mr=Oe(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=ke(t,["allowPinchZoom","as","dangerouslyBypassFocusLock","dangerouslyBypassScrollLock","initialFocusRef","onClick","onDismiss","onKeyDown","onMouseDown","unstable_lockFocusAcrossFrames"]),x=s.useRef(null),D=s.useRef(null),N=Wn(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?hr(D.current):void 0},[]),s.createElement(Zt,{autoFocus:!0,returnFocus:!0,onActivation:k,disabled:u,crossFrame:L},s.createElement(Jt,{allowPinchZoom:o,enabled:!f},s.createElement(i,H({},M,{ref:N,"data-reach-dialog-overlay":"",onClick:ge(y,W),onKeyDown:ge(_,I),onMouseDown:ge(h,Y)}))))});fe.displayName="DialogOverlay",fe.propTypes=H({},en);var qe=Oe(function(t,n){let o=t.as,r=o===void 0?"div":o,i=t.onClick;t.onKeyDown;let c=ke(t,["as","onClick","onKeyDown"]);return s.createElement(r,H({"aria-modal":"true",role:"dialog",tabIndex:-1},c,{ref:n,"data-reach-dialog-content":"",onClick:ge(i,function(u){u.stopPropagation()})}))});qe.displayName="DialogContent",qe.propTypes={"aria-label":Ce,"aria-labelledby":Ce};var Ze=Oe(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=ke(t,["allowPinchZoom","initialFocusRef","isOpen","onDismiss"]);return s.createElement(fe,{allowPinchZoom:r,initialFocusRef:i,isOpen:c,onDismiss:l},s.createElement(qe,H({ref:n},f)))});Ze.displayName="Dialog",Ze.propTypes={isOpen:P.bool,onDismiss:P.func,"aria-label":Ce,"aria-labelledby":Ce};function hr(e){let t=[],n=[],o=Nn(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 Ce(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&&!jn(e[t])?new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected `string`, received `"+(Array.isArray(r)?"array":typeof r)+"`."):null}var yr=Ze;export{Ze as Dialog,qe as DialogContent,fe as DialogOverlay,yr as default}; /*! ***************************************************************************** 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. ***************************************************************************** */