@purpurds/modal 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/modal.cjs.js CHANGED
@@ -1,66 +1,70 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),c=require("react"),xe=require("react-dom");function Et(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const _=Et(c);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},O.apply(null,arguments)}function I(e,n,{checkForDefaultPrevented:t=!0}={}){return function(a){if(e==null||e(a),t===!1||!a.defaultPrevented)return n==null?void 0:n(a)}}function wt(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function He(...e){return n=>e.forEach(t=>wt(t,n))}function V(...e){return c.useCallback(He(...e),e)}function xt(e,n=[]){let t=[];function o(r,u){const i=c.createContext(u),l=t.length;t=[...t,u];function f(d){const{scope:v,children:h,...E}=d,s=(v==null?void 0:v[e][l])||i,m=c.useMemo(()=>E,Object.values(E));return c.createElement(s.Provider,{value:m},h)}function p(d,v){const h=(v==null?void 0:v[e][l])||i,E=c.useContext(h);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${d}\` must be used within \`${r}\``)}return f.displayName=r+"Provider",[f,p]}const a=()=>{const r=t.map(u=>c.createContext(u));return function(i){const l=(i==null?void 0:i[e])||r;return c.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return a.scopeName=e,[o,St(a,...n)]}function St(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const u=o.reduce((i,{useScope:l,scopeName:f})=>{const d=l(r)[`__scope${f}`];return{...i,...d}},{});return c.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return t.scopeName=n.scopeName,t}const _e=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Ct=_.useId||(()=>{});let Ot=0;function le(e){const[n,t]=_.useState(Ct());return _e(()=>{e||t(o=>o??String(Ot++))},[e]),e||(n?`radix-${n}`:"")}function F(e){const n=c.useRef(e);return c.useEffect(()=>{n.current=e}),c.useMemo(()=>(...t)=>{var o;return(o=n.current)===null||o===void 0?void 0:o.call(n,...t)},[])}function Pt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,a]=Nt({defaultProp:n,onChange:t}),r=e!==void 0,u=r?e:o,i=F(t),l=c.useCallback(f=>{if(r){const d=typeof f=="function"?f(e):f;d!==e&&i(d)}else a(f)},[r,e,a,i]);return[u,l]}function Nt({defaultProp:e,onChange:n}){const t=c.useState(e),[o]=t,a=c.useRef(o),r=F(n);return c.useEffect(()=>{a.current!==o&&(r(o),a.current=o)},[o,a,r]),t}const Se=c.forwardRef((e,n)=>{const{children:t,...o}=e,a=c.Children.toArray(t),r=a.find(Rt);if(r){const u=r.props.children,i=a.map(l=>l===r?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:l);return c.createElement(be,O({},o,{ref:n}),c.isValidElement(u)?c.cloneElement(u,void 0,i):null)}return c.createElement(be,O({},o,{ref:n}),t)});Se.displayName="Slot";const be=c.forwardRef((e,n)=>{const{children:t,...o}=e;return c.isValidElement(t)?c.cloneElement(t,{...Tt(o,t.props),ref:n?He(n,t.ref):t.ref}):c.Children.count(t)>1?c.Children.only(null):null});be.displayName="SlotClone";const At=({children:e})=>c.createElement(c.Fragment,null,e);function Rt(e){return c.isValidElement(e)&&e.type===At}function Tt(e,n){const t={...n};for(const o in n){const a=e[o],r=n[o];/^on[A-Z]/.test(o)?a&&r?t[o]=(...i)=>{r(...i),a(...i)}:a&&(t[o]=a):o==="style"?t[o]={...a,...r}:o==="className"&&(t[o]=[a,r].filter(Boolean).join(" "))}return{...e,...t}}const Dt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],M=Dt.reduce((e,n)=>{const t=c.forwardRef((o,a)=>{const{asChild:r,...u}=o,i=r?Se:n;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(i,O({},u,{ref:a}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function jt(e,n){e&&xe.flushSync(()=>e.dispatchEvent(n))}function It(e,n=globalThis==null?void 0:globalThis.document){const t=F(e);c.useEffect(()=>{const o=a=>{a.key==="Escape"&&t(a)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[t,n])}const $e="dismissableLayer.update",Mt="dismissableLayer.pointerDownOutside",Lt="dismissableLayer.focusOutside";let Pe;const kt=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ft=c.forwardRef((e,n)=>{var t;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:u,onInteractOutside:i,onDismiss:l,...f}=e,p=c.useContext(kt),[d,v]=c.useState(null),h=(t=d==null?void 0:d.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,E]=c.useState({}),s=V(n,w=>v(w)),m=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),S=m.indexOf(b),y=d?m.indexOf(d):-1,$=p.layersWithOutsidePointerEventsDisabled.size>0,x=y>=S,L=qt(w=>{const A=w.target,Z=[...p.branches].some(R=>R.contains(A));!x||Z||(r==null||r(w),i==null||i(w),w.defaultPrevented||l==null||l())},h),N=Bt(w=>{const A=w.target;[...p.branches].some(R=>R.contains(A))||(u==null||u(w),i==null||i(w),w.defaultPrevented||l==null||l())},h);return It(w=>{y===p.layers.size-1&&(a==null||a(w),!w.defaultPrevented&&l&&(w.preventDefault(),l()))},h),c.useEffect(()=>{if(d)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Pe=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),Ne(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Pe)}},[d,h,o,p]),c.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),Ne())},[d,p]),c.useEffect(()=>{const w=()=>E({});return document.addEventListener($e,w),()=>document.removeEventListener($e,w)},[]),c.createElement(M.div,O({},f,{ref:s,style:{pointerEvents:$?x?"auto":"none":void 0,...e.style},onFocusCapture:I(e.onFocusCapture,N.onFocusCapture),onBlurCapture:I(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,L.onPointerDownCapture)}))});function qt(e,n=globalThis==null?void 0:globalThis.document){const t=F(e),o=c.useRef(!1),a=c.useRef(()=>{});return c.useEffect(()=>{const r=i=>{if(i.target&&!o.current){let f=function(){Ke(Mt,t,l,{discrete:!0})};const l={originalEvent:i};i.pointerType==="touch"?(n.removeEventListener("click",a.current),a.current=f,n.addEventListener("click",a.current,{once:!0})):f()}else n.removeEventListener("click",a.current);o.current=!1},u=window.setTimeout(()=>{n.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",r),n.removeEventListener("click",a.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function Bt(e,n=globalThis==null?void 0:globalThis.document){const t=F(e),o=c.useRef(!1);return c.useEffect(()=>{const a=r=>{r.target&&!o.current&&Ke(Lt,t,{originalEvent:r},{discrete:!1})};return n.addEventListener("focusin",a),()=>n.removeEventListener("focusin",a)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ne(){const e=new CustomEvent($e);document.dispatchEvent(e)}function Ke(e,n,t,{discrete:o}){const a=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&a.addEventListener(e,n,{once:!0}),o?jt(a,r):a.dispatchEvent(r)}const de="focusScope.autoFocusOnMount",fe="focusScope.autoFocusOnUnmount",Ae={bubbles:!1,cancelable:!0},Ut=c.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:r,...u}=e,[i,l]=c.useState(null),f=F(a),p=F(r),d=c.useRef(null),v=V(n,s=>l(s)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let s=function(y){if(h.paused||!i)return;const $=y.target;i.contains($)?d.current=$:j(d.current,{select:!0})},m=function(y){if(h.paused||!i)return;const $=y.relatedTarget;$!==null&&(i.contains($)||j(d.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const x of y)x.removedNodes.length>0&&j(i)};document.addEventListener("focusin",s),document.addEventListener("focusout",m);const S=new MutationObserver(b);return i&&S.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",m),S.disconnect()}}},[o,i,h.paused]),c.useEffect(()=>{if(i){Te.add(h);const s=document.activeElement;if(!i.contains(s)){const b=new CustomEvent(de,Ae);i.addEventListener(de,f),i.dispatchEvent(b),b.defaultPrevented||(Wt(Xt(Xe(i)),{select:!0}),document.activeElement===s&&j(i))}return()=>{i.removeEventListener(de,f),setTimeout(()=>{const b=new CustomEvent(fe,Ae);i.addEventListener(fe,p),i.dispatchEvent(b),b.defaultPrevented||j(s??document.body,{select:!0}),i.removeEventListener(fe,p),Te.remove(h)},0)}}},[i,f,p,h]);const E=c.useCallback(s=>{if(!t&&!o||h.paused)return;const m=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,b=document.activeElement;if(m&&b){const S=s.currentTarget,[y,$]=zt(S);y&&$?!s.shiftKey&&b===$?(s.preventDefault(),t&&j(y,{select:!0})):s.shiftKey&&b===y&&(s.preventDefault(),t&&j($,{select:!0})):b===S&&s.preventDefault()}},[t,o,h.paused]);return c.createElement(M.div,O({tabIndex:-1},u,{ref:v,onKeyDown:E}))});function Wt(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(j(o,{select:n}),document.activeElement!==t)return}function zt(e){const n=Xe(e),t=Re(n,e),o=Re(n.reverse(),e);return[t,o]}function Xe(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function Re(e,n){for(const t of e)if(!Vt(t,{upTo:n}))return t}function Vt(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ht(e){return e instanceof HTMLInputElement&&"select"in e}function j(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&Ht(e)&&n&&e.select()}}const Te=Kt();function Kt(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=De(e,n),e.unshift(n)},remove(n){var t;e=De(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function De(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Xt(e){return e.filter(n=>n.tagName!=="A")}const Gt=c.forwardRef((e,n)=>{var t;const{container:o=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...a}=e;return o?xe.createPortal(c.createElement(M.div,O({},a,{ref:n})),o):null});function Yt(e,n){return c.useReducer((t,o)=>{const a=n[t][o];return a??t},e)}const ie=e=>{const{present:n,children:t}=e,o=Zt(n),a=typeof t=="function"?t({present:o.isPresent}):c.Children.only(t),r=V(o.ref,a.ref);return typeof t=="function"||o.isPresent?c.cloneElement(a,{ref:r}):null};ie.displayName="Presence";function Zt(e){const[n,t]=c.useState(),o=c.useRef({}),a=c.useRef(e),r=c.useRef("none"),u=e?"mounted":"unmounted",[i,l]=Yt(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const f=Q(o.current);r.current=i==="mounted"?f:"none"},[i]),_e(()=>{const f=o.current,p=a.current;if(p!==e){const v=r.current,h=Q(f);e?l("MOUNT"):h==="none"||(f==null?void 0:f.display)==="none"?l("UNMOUNT"):l(p&&v!==h?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),_e(()=>{if(n){const f=d=>{const h=Q(o.current).includes(d.animationName);d.target===n&&h&&xe.flushSync(()=>l("ANIMATION_END"))},p=d=>{d.target===n&&(r.current=Q(o.current))};return n.addEventListener("animationstart",p),n.addEventListener("animationcancel",f),n.addEventListener("animationend",f),()=>{n.removeEventListener("animationstart",p),n.removeEventListener("animationcancel",f),n.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(f=>{f&&(o.current=getComputedStyle(f)),t(f)},[])}}function Q(e){return(e==null?void 0:e.animationName)||"none"}let pe=0;function Qt(){c.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!==null&&e!==void 0?e:je()),document.body.insertAdjacentElement("beforeend",(n=t[1])!==null&&n!==void 0?n:je()),pe++,()=>{pe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),pe--}},[])}function je(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var D=function(){return D=Object.assign||function(n){for(var t,o=1,a=arguments.length;o<a;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},D.apply(this,arguments)};function Ge(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t}function Jt(e,n,t){if(t||arguments.length===2)for(var o=0,a=n.length,r;o<a;o++)(r||!(o in n))&&(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var ae="right-scroll-bar-position",ue="width-before-scroll-bar",en="with-scroll-bars-hidden",tn="--removed-body-scroll-bar-size";function ve(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function nn(e,n){var t=c.useState(function(){return{value:e,callback:n,facade:{get current(){return t.value},set current(o){var a=t.value;a!==o&&(t.value=o,t.callback(o,a))}}}})[0];return t.callback=n,t.facade}var rn=typeof window<"u"?_.useLayoutEffect:_.useEffect,Ie=new WeakMap;function on(e,n){var t=nn(null,function(o){return e.forEach(function(a){return ve(a,o)})});return rn(function(){var o=Ie.get(t);if(o){var a=new Set(o),r=new Set(e),u=t.current;a.forEach(function(i){r.has(i)||ve(i,null)}),r.forEach(function(i){a.has(i)||ve(i,u)})}Ie.set(t,e)},[e]),t}function an(e){return e}function un(e,n){n===void 0&&(n=an);var t=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(r){var u=n(r,o);return t.push(u),function(){t=t.filter(function(i){return i!==u})}},assignSyncMedium:function(r){for(o=!0;t.length;){var u=t;t=[],u.forEach(r)}t={push:function(i){return r(i)},filter:function(){return t}}},assignMedium:function(r){o=!0;var u=[];if(t.length){var i=t;t=[],i.forEach(r),u=t}var l=function(){var p=u;u=[],p.forEach(r)},f=function(){return Promise.resolve().then(l)};f(),t={push:function(p){u.push(p),f()},filter:function(p){return u=u.filter(p),t}}}};return a}function cn(e){e===void 0&&(e={});var n=un(null);return n.options=D({async:!0,ssr:!1},e),n}var Ye=function(e){var n=e.sideCar,t=Ge(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,D({},t))};Ye.isSideCarExport=!0;function sn(e,n){return e.useMedium(n),Ye}var Ze=cn(),he=function(){},ce=_.forwardRef(function(e,n){var t=_.useRef(null),o=_.useState({onScrollCapture:he,onWheelCapture:he,onTouchMoveCapture:he}),a=o[0],r=o[1],u=e.forwardProps,i=e.children,l=e.className,f=e.removeScrollBar,p=e.enabled,d=e.shards,v=e.sideCar,h=e.noIsolation,E=e.inert,s=e.allowPinchZoom,m=e.as,b=m===void 0?"div":m,S=Ge(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),y=v,$=on([t,n]),x=D(D({},S),a);return _.createElement(_.Fragment,null,p&&_.createElement(y,{sideCar:Ze,removeScrollBar:f,shards:d,noIsolation:h,inert:E,setCallbacks:r,allowPinchZoom:!!s,lockRef:t}),u?_.cloneElement(_.Children.only(i),D(D({},x),{ref:$})):_.createElement(b,D({},x,{className:l,ref:$}),i))});ce.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ce.classNames={fullWidth:ue,zeroRight:ae};var ln=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=ln();return n&&e.setAttribute("nonce",n),e}function fn(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function pn(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var vn=function(){var e=0,n=null;return{add:function(t){e==0&&(n=dn())&&(fn(n,t),pn(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},hn=function(){var e=vn();return function(n,t){_.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},Qe=function(){var e=hn(),n=function(t){var o=t.styles,a=t.dynamic;return e(o,a),null};return n},mn={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},gn=function(e){var n=window.getComputedStyle(document.body),t=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],a=n[e==="padding"?"paddingRight":"marginRight"];return[me(t),me(o),me(a)]},_n=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mn;var n=gn(e),t=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-t+n[2]-n[0])}},bn=Qe(),W="data-scroll-locked",$n=function(e,n,t,o){var a=e.left,r=e.top,u=e.right,i=e.gap;return t===void 0&&(t="margin"),`
2
- .`.concat(en,` {
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),O=require("react"),Ke=require("react-dom");function Xe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=Xe(O),qt=Xe(Ke);function I(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Pe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ye(...e){return t=>{let r=!1;const o=e.map(a=>{const n=Pe(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():Pe(e[a],null)}}}}function W(...e){return s.useCallback(Ye(...e),e)}function Ut(e,t){const r=s.createContext(t),o=n=>{const{children:i,...u}=n,f=s.useMemo(()=>u,Object.values(u));return c.jsx(r.Provider,{value:f,children:i})};o.displayName=e+"Provider";function a(n){const i=s.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,a]}function Vt(e,t=[]){let r=[];function o(n,i){const u=s.createContext(i),f=r.length;r=[...r,i];const l=v=>{var _;const{scope:h,children:g,...w}=v,d=((_=h==null?void 0:h[e])==null?void 0:_[f])||u,m=s.useMemo(()=>w,Object.values(w));return c.jsx(d.Provider,{value:m,children:g})};l.displayName=n+"Provider";function p(v,h){var d;const g=((d=h==null?void 0:h[e])==null?void 0:d[f])||u,w=s.useContext(g);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${v}\` must be used within \`${n}\``)}return[l,p]}const a=()=>{const n=r.map(i=>s.createContext(i));return function(u){const f=(u==null?void 0:u[e])||n;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return a.scopeName=e,[o,zt(a,...t)]}function zt(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){const i=o.reduce((u,{useScope:f,scopeName:l})=>{const v=f(n)[`__scope${l}`];return{...u,...v}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var ae=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},Ht=s.useId||(()=>{}),Gt=0;function le(e){const[t,r]=s.useState(Ht());return ae(()=>{e||r(o=>o??String(Gt++))},[e]),e||(t?`radix-${t}`:"")}function k(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function Kt({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,a]=Xt({defaultProp:t,onChange:r}),n=e!==void 0,i=n?e:o,u=k(r),f=s.useCallback(l=>{if(n){const v=typeof l=="function"?l(e):l;v!==e&&u(v)}else a(l)},[n,e,a,u]);return[i,f]}function Xt({defaultProp:e,onChange:t}){const r=s.useState(e),[o]=r,a=s.useRef(o),n=k(t);return s.useEffect(()=>{a.current!==o&&(n(o),a.current=o)},[o,a,n]),r}var Ee=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(Zt);if(n){const i=n.props.children,u=a.map(f=>f===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:f);return c.jsx(_e,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(_e,{...o,ref:t,children:r})});Ee.displayName="Slot";var _e=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=Jt(r),n=Qt(o,r.props);return r.type!==s.Fragment&&(n.ref=t?Ye(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});_e.displayName="SlotClone";var Yt=({children:e})=>c.jsx(c.Fragment,{children:e});function Zt(e){return s.isValidElement(e)&&e.type===Yt}function Qt(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...u)=>{n(...u),a(...u)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function Jt(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var er=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],T=er.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?Ee:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tr(e,t){e&&qt.flushSync(()=>e.dispatchEvent(t))}function rr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e);s.useEffect(()=>{const o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var nr="DismissableLayer",ye="dismissableLayer.update",or="dismissableLayer.pointerDownOutside",ar="dismissableLayer.focusOutside",Re,Ze=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:n,onInteractOutside:i,onDismiss:u,...f}=e,l=s.useContext(Ze),[p,v]=s.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=s.useState({}),w=W(t,y=>v(y)),d=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=d.indexOf(m),S=p?d.indexOf(p):-1,E=l.layersWithOutsidePointerEventsDisabled.size>0,b=S>=_,x=sr(y=>{const A=y.target,P=[...l.branches].some(z=>z.contains(A));!b||P||(a==null||a(y),i==null||i(y),y.defaultPrevented||u==null||u())},h),R=cr(y=>{const A=y.target;[...l.branches].some(z=>z.contains(A))||(n==null||n(y),i==null||i(y),y.defaultPrevented||u==null||u())},h);return rr(y=>{S===l.layers.size-1&&(o==null||o(y),!y.defaultPrevented&&u&&(y.preventDefault(),u()))},h),s.useEffect(()=>{if(p)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Re=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(p)),l.layers.add(p),Ae(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Re)}},[p,h,r,l]),s.useEffect(()=>()=>{p&&(l.layers.delete(p),l.layersWithOutsidePointerEventsDisabled.delete(p),Ae())},[p,l]),s.useEffect(()=>{const y=()=>g({});return document.addEventListener(ye,y),()=>document.removeEventListener(ye,y)},[]),c.jsx(T.div,{...f,ref:w,style:{pointerEvents:E?b?"auto":"none":void 0,...e.style},onFocusCapture:I(e.onFocusCapture,R.onFocusCapture),onBlurCapture:I(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,x.onPointerDownCapture)})});Qe.displayName=nr;var ir="DismissableLayerBranch",ur=s.forwardRef((e,t)=>{const r=s.useContext(Ze),o=s.useRef(null),a=W(t,o);return s.useEffect(()=>{const n=o.current;if(n)return r.branches.add(n),()=>{r.branches.delete(n)}},[r.branches]),c.jsx(T.div,{...e,ref:a})});ur.displayName=ir;function sr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e),o=s.useRef(!1),a=s.useRef(()=>{});return s.useEffect(()=>{const n=u=>{if(u.target&&!o.current){let f=function(){Je(or,r,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",n),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function cr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e),o=s.useRef(!1);return s.useEffect(()=>{const a=n=>{n.target&&!o.current&&Je(ar,r,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ae(){const e=new CustomEvent(ye);document.dispatchEvent(e)}function Je(e,t,r,{discrete:o}){const a=r.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?tr(a,n):a.dispatchEvent(n)}var de="focusScope.autoFocusOnMount",fe="focusScope.autoFocusOnUnmount",je={bubbles:!1,cancelable:!0},lr="FocusScope",et=s.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:n,...i}=e,[u,f]=s.useState(null),l=k(a),p=k(n),v=s.useRef(null),h=W(t,d=>f(d)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let d=function(E){if(g.paused||!u)return;const b=E.target;u.contains(b)?v.current=b:M(v.current,{select:!0})},m=function(E){if(g.paused||!u)return;const b=E.relatedTarget;b!==null&&(u.contains(b)||M(v.current,{select:!0}))},_=function(E){if(document.activeElement===document.body)for(const x of E)x.removedNodes.length>0&&M(u)};document.addEventListener("focusin",d),document.addEventListener("focusout",m);const S=new MutationObserver(_);return u&&S.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",m),S.disconnect()}}},[o,u,g.paused]),s.useEffect(()=>{if(u){Te.add(g);const d=document.activeElement;if(!u.contains(d)){const _=new CustomEvent(de,je);u.addEventListener(de,l),u.dispatchEvent(_),_.defaultPrevented||(dr(mr(tt(u)),{select:!0}),document.activeElement===d&&M(u))}return()=>{u.removeEventListener(de,l),setTimeout(()=>{const _=new CustomEvent(fe,je);u.addEventListener(fe,p),u.dispatchEvent(_),_.defaultPrevented||M(d??document.body,{select:!0}),u.removeEventListener(fe,p),Te.remove(g)},0)}}},[u,l,p,g]);const w=s.useCallback(d=>{if(!r&&!o||g.paused)return;const m=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,_=document.activeElement;if(m&&_){const S=d.currentTarget,[E,b]=fr(S);E&&b?!d.shiftKey&&_===b?(d.preventDefault(),r&&M(E,{select:!0})):d.shiftKey&&_===E&&(d.preventDefault(),r&&M(b,{select:!0})):_===S&&d.preventDefault()}},[r,o,g.paused]);return c.jsx(T.div,{tabIndex:-1,...i,ref:h,onKeyDown:w})});et.displayName=lr;function dr(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(M(o,{select:t}),document.activeElement!==r)return}function fr(e){const t=tt(e),r=De(t,e),o=De(t.reverse(),e);return[r,o]}function tt(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function De(e,t){for(const r of e)if(!pr(r,{upTo:t}))return r}function pr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vr(e){return e instanceof HTMLInputElement&&"select"in e}function M(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&vr(e)&&t&&e.select()}}var Te=hr();function hr(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Me(e,t),e.unshift(t)},remove(t){var r;e=Me(e,t),(r=e[0])==null||r.resume()}}}function Me(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function mr(e){return e.filter(t=>t.tagName!=="A")}var gr="Portal",rt=s.forwardRef((e,t)=>{var u;const{container:r,...o}=e,[a,n]=s.useState(!1);ae(()=>n(!0),[]);const i=r||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return i?Ke.createPortal(c.jsx(T.div,{...o,ref:t}),i):null});rt.displayName=gr;function _r(e,t){return s.useReducer((r,o)=>t[r][o]??r,e)}var ue=e=>{const{present:t,children:r}=e,o=yr(t),a=typeof r=="function"?r({present:o.isPresent}):s.Children.only(r),n=W(o.ref,br(a));return typeof r=="function"||o.isPresent?s.cloneElement(a,{ref:n}):null};ue.displayName="Presence";function yr(e){const[t,r]=s.useState(),o=s.useRef({}),a=s.useRef(e),n=s.useRef("none"),i=e?"mounted":"unmounted",[u,f]=_r(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const l=Y(o.current);n.current=u==="mounted"?l:"none"},[u]),ae(()=>{const l=o.current,p=a.current;if(p!==e){const h=n.current,g=Y(l);e?f("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?f("UNMOUNT"):f(p&&h!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),ae(()=>{if(t){let l;const p=t.ownerDocument.defaultView??window,v=g=>{const d=Y(o.current).includes(g.animationName);if(g.target===t&&d&&(f("ANIMATION_END"),!a.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=g=>{g.target===t&&(n.current=Y(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{p.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(l=>{l&&(o.current=getComputedStyle(l)),r(l)},[])}}function Y(e){return(e==null?void 0:e.animationName)||"none"}function br(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pe=0;function wr(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ie()),document.body.insertAdjacentElement("beforeend",e[1]??Ie()),pe++,()=>{pe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pe--}},[])}function Ie(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var D=function(){return D=Object.assign||function(t){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},D.apply(this,arguments)};function nt(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(r[o[a]]=e[o[a]]);return r}function Er(e,t,r){if(r||arguments.length===2)for(var o=0,a=t.length,n;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var ne="right-scroll-bar-position",oe="width-before-scroll-bar",xr="with-scroll-bars-hidden",Sr="--removed-body-scroll-bar-size";function ve(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cr(e,t){var r=O.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var Nr=typeof window<"u"?s.useLayoutEffect:s.useEffect,Le=new WeakMap;function Or(e,t){var r=Cr(null,function(o){return e.forEach(function(a){return ve(a,o)})});return Nr(function(){var o=Le.get(r);if(o){var a=new Set(o),n=new Set(e),i=r.current;a.forEach(function(u){n.has(u)||ve(u,null)}),n.forEach(function(u){a.has(u)||ve(u,i)})}Le.set(r,e)},[e]),r}function Pr(e){return e}function Rr(e,t){t===void 0&&(t=Pr);var r=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(n){var i=t(n,o);return r.push(i),function(){r=r.filter(function(u){return u!==i})}},assignSyncMedium:function(n){for(o=!0;r.length;){var i=r;r=[],i.forEach(n)}r={push:function(u){return n(u)},filter:function(){return r}}},assignMedium:function(n){o=!0;var i=[];if(r.length){var u=r;r=[],u.forEach(n),i=r}var f=function(){var p=i;i=[],p.forEach(n)},l=function(){return Promise.resolve().then(f)};l(),r={push:function(p){i.push(p),l()},filter:function(p){return i=i.filter(p),r}}}};return a}function Ar(e){e===void 0&&(e={});var t=Rr(null);return t.options=D({async:!0,ssr:!1},e),t}var ot=function(e){var t=e.sideCar,r=nt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return s.createElement(o,D({},r))};ot.isSideCarExport=!0;function jr(e,t){return e.useMedium(t),ot}var at=Ar(),he=function(){},se=s.forwardRef(function(e,t){var r=s.useRef(null),o=s.useState({onScrollCapture:he,onWheelCapture:he,onTouchMoveCapture:he}),a=o[0],n=o[1],i=e.forwardProps,u=e.children,f=e.className,l=e.removeScrollBar,p=e.enabled,v=e.shards,h=e.sideCar,g=e.noIsolation,w=e.inert,d=e.allowPinchZoom,m=e.as,_=m===void 0?"div":m,S=e.gapMode,E=nt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,x=Or([r,t]),R=D(D({},E),a);return s.createElement(s.Fragment,null,p&&s.createElement(b,{sideCar:at,removeScrollBar:l,shards:v,noIsolation:g,inert:w,setCallbacks:n,allowPinchZoom:!!d,lockRef:r,gapMode:S}),i?s.cloneElement(s.Children.only(u),D(D({},R),{ref:x})):s.createElement(_,D({},R,{className:f,ref:x}),u))});se.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};se.classNames={fullWidth:oe,zeroRight:ne};var Dr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Tr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Dr();return t&&e.setAttribute("nonce",t),e}function Mr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ir(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lr=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Tr())&&(Mr(t,r),Ir(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$r=function(){var e=Lr();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},it=function(){var e=$r(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t},kr={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},Fr=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[me(r),me(o),me(a)]},Wr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kr;var t=Fr(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},Br=it(),V="data-scroll-locked",qr=function(e,t,r,o){var a=e.left,n=e.top,i=e.right,u=e.gap;return r===void 0&&(r="margin"),`
2
+ .`.concat(xr,` {
3
3
  overflow: hidden `).concat(o,`;
4
- padding-right: `).concat(i,"px ").concat(o,`;
4
+ padding-right: `).concat(u,"px ").concat(o,`;
5
5
  }
6
- body[`).concat(W,`] {
6
+ body[`).concat(V,`] {
7
7
  overflow: hidden `).concat(o,`;
8
8
  overscroll-behavior: contain;
9
- `).concat([n&&"position: relative ".concat(o,";"),t==="margin"&&`
9
+ `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
10
10
  padding-left: `.concat(a,`px;
11
- padding-top: `).concat(r,`px;
12
- padding-right: `).concat(u,`px;
11
+ padding-top: `).concat(n,`px;
12
+ padding-right: `).concat(i,`px;
13
13
  margin-left:0;
14
14
  margin-top:0;
15
- margin-right: `).concat(i,"px ").concat(o,`;
16
- `),t==="padding"&&"padding-right: ".concat(i,"px ").concat(o,";")].filter(Boolean).join(""),`
15
+ margin-right: `).concat(u,"px ").concat(o,`;
16
+ `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),`
17
17
  }
18
18
 
19
- .`).concat(ae,` {
20
- right: `).concat(i,"px ").concat(o,`;
19
+ .`).concat(ne,` {
20
+ right: `).concat(u,"px ").concat(o,`;
21
21
  }
22
22
 
23
- .`).concat(ue,` {
24
- margin-right: `).concat(i,"px ").concat(o,`;
23
+ .`).concat(oe,` {
24
+ margin-right: `).concat(u,"px ").concat(o,`;
25
25
  }
26
26
 
27
- .`).concat(ae," .").concat(ae,` {
27
+ .`).concat(ne," .").concat(ne,` {
28
28
  right: 0 `).concat(o,`;
29
29
  }
30
30
 
31
- .`).concat(ue," .").concat(ue,` {
31
+ .`).concat(oe," .").concat(oe,` {
32
32
  margin-right: 0 `).concat(o,`;
33
33
  }
34
34
 
35
- body[`).concat(W,`] {
36
- `).concat(tn,": ").concat(i,`px;
35
+ body[`).concat(V,`] {
36
+ `).concat(Sr,": ").concat(u,`px;
37
37
  }
38
- `)},Me=function(){var e=parseInt(document.body.getAttribute(W)||"0",10);return isFinite(e)?e:0},yn=function(){_.useEffect(function(){return document.body.setAttribute(W,(Me()+1).toString()),function(){var e=Me()-1;e<=0?document.body.removeAttribute(W):document.body.setAttribute(W,e.toString())}},[])},En=function(e){var n=e.noRelative,t=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;yn();var r=_.useMemo(function(){return _n(a)},[a]);return _.createElement(bn,{styles:$n(r,!n,a,t?"":"!important")})},ye=!1;if(typeof window<"u")try{var J=Object.defineProperty({},"passive",{get:function(){return ye=!0,!0}});window.addEventListener("test",J,J),window.removeEventListener("test",J,J)}catch{ye=!1}var q=ye?{passive:!1}:!1,wn=function(e){return e.tagName==="TEXTAREA"},Je=function(e,n){var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!wn(e)&&t[n]==="visible")},xn=function(e){return Je(e,"overflowY")},Sn=function(e){return Je(e,"overflowX")},Le=function(e,n){var t=n;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var o=et(e,t);if(o){var a=tt(e,t),r=a[1],u=a[2];if(r>u)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},Cn=function(e){var n=e.scrollTop,t=e.scrollHeight,o=e.clientHeight;return[n,t,o]},On=function(e){var n=e.scrollLeft,t=e.scrollWidth,o=e.clientWidth;return[n,t,o]},et=function(e,n){return e==="v"?xn(n):Sn(n)},tt=function(e,n){return e==="v"?Cn(n):On(n)},Pn=function(e,n){return e==="h"&&n==="rtl"?-1:1},Nn=function(e,n,t,o,a){var r=Pn(e,window.getComputedStyle(n).direction),u=r*o,i=t.target,l=n.contains(i),f=!1,p=u>0,d=0,v=0;do{var h=tt(e,i),E=h[0],s=h[1],m=h[2],b=s-m-r*E;(E||b)&&et(e,i)&&(d+=b,v+=E),i=i.parentNode}while(!l&&i!==document.body||l&&(n.contains(i)||n===i));return(p&&d===0||!p&&v===0)&&(f=!0),f},ee=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ke=function(e){return[e.deltaX,e.deltaY]},Fe=function(e){return e&&"current"in e?e.current:e},An=function(e,n){return e[0]===n[0]&&e[1]===n[1]},Rn=function(e){return`
38
+ `)},$e=function(){var e=parseInt(document.body.getAttribute(V)||"0",10);return isFinite(e)?e:0},Ur=function(){s.useEffect(function(){return document.body.setAttribute(V,($e()+1).toString()),function(){var e=$e()-1;e<=0?document.body.removeAttribute(V):document.body.setAttribute(V,e.toString())}},[])},Vr=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;Ur();var n=s.useMemo(function(){return Wr(a)},[a]);return s.createElement(Br,{styles:qr(n,!t,a,r?"":"!important")})},be=!1;if(typeof window<"u")try{var Z=Object.defineProperty({},"passive",{get:function(){return be=!0,!0}});window.addEventListener("test",Z,Z),window.removeEventListener("test",Z,Z)}catch{be=!1}var B=be?{passive:!1}:!1,zr=function(e){return e.tagName==="TEXTAREA"},ut=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!zr(e)&&r[t]==="visible")},Hr=function(e){return ut(e,"overflowY")},Gr=function(e){return ut(e,"overflowX")},ke=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=st(e,o);if(a){var n=ct(e,o),i=n[1],u=n[2];if(i>u)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},Kr=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},Xr=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},st=function(e,t){return e==="v"?Hr(t):Gr(t)},ct=function(e,t){return e==="v"?Kr(t):Xr(t)},Yr=function(e,t){return e==="h"&&t==="rtl"?-1:1},Zr=function(e,t,r,o,a){var n=Yr(e,window.getComputedStyle(t).direction),i=n*o,u=r.target,f=t.contains(u),l=!1,p=i>0,v=0,h=0;do{var g=ct(e,u),w=g[0],d=g[1],m=g[2],_=d-m-n*w;(w||_)&&st(e,u)&&(v+=_,h+=w),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(v)<1||!p&&Math.abs(h)<1)&&(l=!0),l},Q=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fe=function(e){return[e.deltaX,e.deltaY]},We=function(e){return e&&"current"in e?e.current:e},Qr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jr=function(e){return`
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},Tn=0,B=[];function Dn(e){var n=_.useRef([]),t=_.useRef([0,0]),o=_.useRef(),a=_.useState(Tn++)[0],r=_.useState(function(){return Qe()})[0],u=_.useRef(e);_.useEffect(function(){u.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var s=Jt([e.lockRef.current],(e.shards||[]).map(Fe),!0).filter(Boolean);return s.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),s.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=_.useCallback(function(s,m){if("touches"in s&&s.touches.length===2)return!u.current.allowPinchZoom;var b=ee(s),S=t.current,y="deltaX"in s?s.deltaX:S[0]-b[0],$="deltaY"in s?s.deltaY:S[1]-b[1],x,L=s.target,N=Math.abs(y)>Math.abs($)?"h":"v";if("touches"in s&&N==="h"&&L.type==="range")return!1;var w=Le(N,L);if(!w)return!0;if(w?x=N:(x=N==="v"?"h":"v",w=Le(N,L)),!w)return!1;if(!o.current&&"changedTouches"in s&&(y||$)&&(o.current=x),!x)return!0;var A=o.current||x;return Nn(A,m,s,A==="h"?y:$)},[]),l=_.useCallback(function(s){var m=s;if(!(!B.length||B[B.length-1]!==r)){var b="deltaY"in m?ke(m):ee(m),S=n.current.filter(function(x){return x.name===m.type&&x.target===m.target&&An(x.delta,b)})[0];if(S&&S.should){m.cancelable&&m.preventDefault();return}if(!S){var y=(u.current.shards||[]).map(Fe).filter(Boolean).filter(function(x){return x.contains(m.target)}),$=y.length>0?i(m,y[0]):!u.current.noIsolation;$&&m.cancelable&&m.preventDefault()}}},[]),f=_.useCallback(function(s,m,b,S){var y={name:s,delta:m,target:b,should:S};n.current.push(y),setTimeout(function(){n.current=n.current.filter(function($){return $!==y})},1)},[]),p=_.useCallback(function(s){t.current=ee(s),o.current=void 0},[]),d=_.useCallback(function(s){f(s.type,ke(s),s.target,i(s,e.lockRef.current))},[]),v=_.useCallback(function(s){f(s.type,ee(s),s.target,i(s,e.lockRef.current))},[]);_.useEffect(function(){return B.push(r),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",l,q),document.addEventListener("touchmove",l,q),document.addEventListener("touchstart",p,q),function(){B=B.filter(function(s){return s!==r}),document.removeEventListener("wheel",l,q),document.removeEventListener("touchmove",l,q),document.removeEventListener("touchstart",p,q)}},[]);var h=e.removeScrollBar,E=e.inert;return _.createElement(_.Fragment,null,E?_.createElement(r,{styles:Rn(a)}):null,h?_.createElement(En,{gapMode:"margin"}):null)}const jn=sn(Ze,Dn);var nt=_.forwardRef(function(e,n){return _.createElement(ce,D({},e,{ref:n,sideCar:jn}))});nt.classNames=ce.classNames;var In=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},U=new WeakMap,te=new WeakMap,ne={},ge=0,rt=function(e){return e&&(e.host||rt(e.parentNode))},Mn=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=rt(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},Ln=function(e,n,t,o){var a=Mn(n,Array.isArray(e)?e:[e]);ne[t]||(ne[t]=new WeakMap);var r=ne[t],u=[],i=new Set,l=new Set(a),f=function(d){!d||i.has(d)||(i.add(d),f(d.parentNode))};a.forEach(f);var p=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(v){if(i.has(v))p(v);else try{var h=v.getAttribute(o),E=h!==null&&h!=="false",s=(U.get(v)||0)+1,m=(r.get(v)||0)+1;U.set(v,s),r.set(v,m),u.push(v),s===1&&E&&te.set(v,!0),m===1&&v.setAttribute(t,"true"),E||v.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",v,b)}})};return p(n),i.clear(),ge++,function(){u.forEach(function(d){var v=U.get(d)-1,h=r.get(d)-1;U.set(d,v),r.set(d,h),v||(te.has(d)||d.removeAttribute(o),te.delete(d)),h||d.removeAttribute(t)}),ge--,ge||(U=new WeakMap,U=new WeakMap,te=new WeakMap,ne={})}},kn=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=In(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live]"))),Ln(o,a,t,"aria-hidden")):function(){return null}};const ot="Dialog",[at,oo]=xt(ot),[Fn,T]=at(ot),qn=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:a,onOpenChange:r,modal:u=!0}=e,i=c.useRef(null),l=c.useRef(null),[f=!1,p]=Pt({prop:o,defaultProp:a,onChange:r});return c.createElement(Fn,{scope:n,triggerRef:i,contentRef:l,contentId:le(),titleId:le(),descriptionId:le(),open:f,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(d=>!d),[p]),modal:u},t)},Bn="DialogTrigger",Un=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(Bn,t),r=V(n,a.triggerRef);return c.createElement(M.button,O({type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ce(a.open)},o,{ref:r,onClick:I(e.onClick,a.onOpenToggle)}))}),ut="DialogPortal",[Wn,it]=at(ut,{forceMount:void 0}),zn=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:a}=e,r=T(ut,n);return c.createElement(Wn,{scope:n,forceMount:t},c.Children.map(o,u=>c.createElement(ie,{present:t||r.open},c.createElement(Gt,{asChild:!0,container:a},u))))},Ee="DialogOverlay",Vn=c.forwardRef((e,n)=>{const t=it(Ee,e.__scopeDialog),{forceMount:o=t.forceMount,...a}=e,r=T(Ee,e.__scopeDialog);return r.modal?c.createElement(ie,{present:o||r.open},c.createElement(Hn,O({},a,{ref:n}))):null}),Hn=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(Ee,t);return c.createElement(nt,{as:Se,allowPinchZoom:!0,shards:[a.contentRef]},c.createElement(M.div,O({"data-state":Ce(a.open)},o,{ref:n,style:{pointerEvents:"auto",...o.style}})))}),Y="DialogContent",Kn=c.forwardRef((e,n)=>{const t=it(Y,e.__scopeDialog),{forceMount:o=t.forceMount,...a}=e,r=T(Y,e.__scopeDialog);return c.createElement(ie,{present:o||r.open},r.modal?c.createElement(Xn,O({},a,{ref:n})):c.createElement(Gn,O({},a,{ref:n})))}),Xn=c.forwardRef((e,n)=>{const t=T(Y,e.__scopeDialog),o=c.useRef(null),a=V(n,t.contentRef,o);return c.useEffect(()=>{const r=o.current;if(r)return kn(r)},[]),c.createElement(ct,O({},e,{ref:a,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,r=>{var u;r.preventDefault(),(u=t.triggerRef.current)===null||u===void 0||u.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,r=>{const u=r.detail.originalEvent,i=u.button===0&&u.ctrlKey===!0;(u.button===2||i)&&r.preventDefault()}),onFocusOutside:I(e.onFocusOutside,r=>r.preventDefault())}))}),Gn=c.forwardRef((e,n)=>{const t=T(Y,e.__scopeDialog),o=c.useRef(!1),a=c.useRef(!1);return c.createElement(ct,O({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var u;if((u=e.onCloseAutoFocus)===null||u===void 0||u.call(e,r),!r.defaultPrevented){var i;o.current||(i=t.triggerRef.current)===null||i===void 0||i.focus(),r.preventDefault()}o.current=!1,a.current=!1},onInteractOutside:r=>{var u,i;(u=e.onInteractOutside)===null||u===void 0||u.call(e,r),r.defaultPrevented||(o.current=!0,r.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=r.target;((i=t.triggerRef.current)===null||i===void 0?void 0:i.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&a.current&&r.preventDefault()}}))}),ct=c.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:r,...u}=e,i=T(Y,t),l=c.useRef(null),f=V(n,l);return Qt(),c.createElement(c.Fragment,null,c.createElement(Ut,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:r},c.createElement(Ft,O({role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Ce(i.open)},u,{ref:f,onDismiss:()=>i.onOpenChange(!1)}))),!1)}),Yn="DialogTitle",Zn=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(Yn,t);return c.createElement(M.h2,O({id:a.titleId},o,{ref:n}))}),Qn="DialogDescription",Jn=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(Qn,t);return c.createElement(M.p,O({id:a.descriptionId},o,{ref:n}))}),er="DialogClose",tr=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,a=T(er,t);return c.createElement(M.button,O({type:"button"},o,{ref:n,onClick:I(e.onClick,()=>a.onOpenChange(!1))}))});function Ce(e){return e?"open":"closed"}const nr=qn,rr=Un,or=zn,ar=Vn,ur=Kn,ir=Zn,qe=Jn,cr=tr,sr={XS:"xs",SM:"sm",MD:"md",LG:"lg"};function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var st={exports:{}};/*!
41
+ `)},en=0,q=[];function tn(e){var t=s.useRef([]),r=s.useRef([0,0]),o=s.useRef(),a=s.useState(en++)[0],n=s.useState(it)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var d=Er([e.lockRef.current],(e.shards||[]).map(We),!0).filter(Boolean);return d.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),d.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(d,m){if("touches"in d&&d.touches.length===2||d.type==="wheel"&&d.ctrlKey)return!i.current.allowPinchZoom;var _=Q(d),S=r.current,E="deltaX"in d?d.deltaX:S[0]-_[0],b="deltaY"in d?d.deltaY:S[1]-_[1],x,R=d.target,y=Math.abs(E)>Math.abs(b)?"h":"v";if("touches"in d&&y==="h"&&R.type==="range")return!1;var A=ke(y,R);if(!A)return!0;if(A?x=y:(x=y==="v"?"h":"v",A=ke(y,R)),!A)return!1;if(!o.current&&"changedTouches"in d&&(E||b)&&(o.current=x),!x)return!0;var P=o.current||x;return Zr(P,m,d,P==="h"?E:b)},[]),f=s.useCallback(function(d){var m=d;if(!(!q.length||q[q.length-1]!==n)){var _="deltaY"in m?Fe(m):Q(m),S=t.current.filter(function(x){return x.name===m.type&&(x.target===m.target||m.target===x.shadowParent)&&Qr(x.delta,_)})[0];if(S&&S.should){m.cancelable&&m.preventDefault();return}if(!S){var E=(i.current.shards||[]).map(We).filter(Boolean).filter(function(x){return x.contains(m.target)}),b=E.length>0?u(m,E[0]):!i.current.noIsolation;b&&m.cancelable&&m.preventDefault()}}},[]),l=s.useCallback(function(d,m,_,S){var E={name:d,delta:m,target:_,should:S,shadowParent:rn(_)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(b){return b!==E})},1)},[]),p=s.useCallback(function(d){r.current=Q(d),o.current=void 0},[]),v=s.useCallback(function(d){l(d.type,Fe(d),d.target,u(d,e.lockRef.current))},[]),h=s.useCallback(function(d){l(d.type,Q(d),d.target,u(d,e.lockRef.current))},[]);s.useEffect(function(){return q.push(n),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:h}),document.addEventListener("wheel",f,B),document.addEventListener("touchmove",f,B),document.addEventListener("touchstart",p,B),function(){q=q.filter(function(d){return d!==n}),document.removeEventListener("wheel",f,B),document.removeEventListener("touchmove",f,B),document.removeEventListener("touchstart",p,B)}},[]);var g=e.removeScrollBar,w=e.inert;return s.createElement(s.Fragment,null,w?s.createElement(n,{styles:Jr(a)}):null,g?s.createElement(Vr,{gapMode:e.gapMode}):null)}function rn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nn=jr(at,tn);var lt=s.forwardRef(function(e,t){return s.createElement(se,D({},e,{ref:t,sideCar:nn}))});lt.classNames=se.classNames;var on=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},U=new WeakMap,J=new WeakMap,ee={},ge=0,dt=function(e){return e&&(e.host||dt(e.parentNode))},an=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=dt(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},un=function(e,t,r,o){var a=an(t,Array.isArray(e)?e:[e]);ee[r]||(ee[r]=new WeakMap);var n=ee[r],i=[],u=new Set,f=new Set(a),l=function(v){!v||u.has(v)||(u.add(v),l(v.parentNode))};a.forEach(l);var p=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(h){if(u.has(h))p(h);else try{var g=h.getAttribute(o),w=g!==null&&g!=="false",d=(U.get(h)||0)+1,m=(n.get(h)||0)+1;U.set(h,d),n.set(h,m),i.push(h),d===1&&w&&J.set(h,!0),m===1&&h.setAttribute(r,"true"),w||h.setAttribute(o,"true")}catch(_){console.error("aria-hidden: cannot operate on ",h,_)}})};return p(t),u.clear(),ge++,function(){i.forEach(function(v){var h=U.get(v)-1,g=n.get(v)-1;U.set(v,h),n.set(v,g),h||(J.has(v)||v.removeAttribute(o),J.delete(v)),g||v.removeAttribute(r)}),ge--,ge||(U=new WeakMap,U=new WeakMap,J=new WeakMap,ee={})}},sn=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=on(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live]"))),un(o,a,r,"aria-hidden")):function(){return null}},xe="Dialog",[ft,bo]=Vt(xe),[cn,j]=ft(xe),pt=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:n,modal:i=!0}=e,u=s.useRef(null),f=s.useRef(null),[l=!1,p]=Kt({prop:o,defaultProp:a,onChange:n});return c.jsx(cn,{scope:t,triggerRef:u,contentRef:f,contentId:le(),titleId:le(),descriptionId:le(),open:l,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(v=>!v),[p]),modal:i,children:r})};pt.displayName=xe;var vt="DialogTrigger",ht=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(vt,r),n=W(t,a.triggerRef);return c.jsx(T.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ne(a.open),...o,ref:n,onClick:I(e.onClick,a.onOpenToggle)})});ht.displayName=vt;var Se="DialogPortal",[ln,mt]=ft(Se,{forceMount:void 0}),gt=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,n=j(Se,t);return c.jsx(ln,{scope:t,forceMount:r,children:s.Children.map(o,i=>c.jsx(ue,{present:r||n.open,children:c.jsx(rt,{asChild:!0,container:a,children:i})}))})};gt.displayName=Se;var ie="DialogOverlay",_t=s.forwardRef((e,t)=>{const r=mt(ie,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=j(ie,e.__scopeDialog);return n.modal?c.jsx(ue,{present:o||n.open,children:c.jsx(dn,{...a,ref:t})}):null});_t.displayName=ie;var dn=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(ie,r);return c.jsx(lt,{as:Ee,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(T.div,{"data-state":Ne(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),F="DialogContent",yt=s.forwardRef((e,t)=>{const r=mt(F,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=j(F,e.__scopeDialog);return c.jsx(ue,{present:o||n.open,children:n.modal?c.jsx(fn,{...a,ref:t}):c.jsx(pn,{...a,ref:t})})});yt.displayName=F;var fn=s.forwardRef((e,t)=>{const r=j(F,e.__scopeDialog),o=s.useRef(null),a=W(t,r.contentRef,o);return s.useEffect(()=>{const n=o.current;if(n)return sn(n)},[]),c.jsx(bt,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,n=>{var i;n.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,n=>{const i=n.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0;(i.button===2||u)&&n.preventDefault()}),onFocusOutside:I(e.onFocusOutside,n=>n.preventDefault())})}),pn=s.forwardRef((e,t)=>{const r=j(F,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return c.jsx(bt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var i,u;(i=e.onCloseAutoFocus)==null||i.call(e,n),n.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),n.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:n=>{var f,l;(f=e.onInteractOutside)==null||f.call(e,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=n.target;((l=r.triggerRef.current)==null?void 0:l.contains(i))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),bt=s.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:n,...i}=e,u=j(F,r),f=s.useRef(null),l=W(t,f);return wr(),c.jsxs(c.Fragment,{children:[c.jsx(et,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:n,children:c.jsx(Qe,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Ne(u.open),...i,ref:l,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(vn,{titleId:u.titleId}),c.jsx(mn,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Ce="DialogTitle",wt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(Ce,r);return c.jsx(T.h2,{id:a.titleId,...o,ref:t})});wt.displayName=Ce;var Et="DialogDescription",xt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(Et,r);return c.jsx(T.p,{id:a.descriptionId,...o,ref:t})});xt.displayName=Et;var St="DialogClose",Ct=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=j(St,r);return c.jsx(T.button,{type:"button",...o,ref:t,onClick:I(e.onClick,()=>a.onOpenChange(!1))})});Ct.displayName=St;function Ne(e){return e?"open":"closed"}var Nt="DialogTitleWarning",[wo,Ot]=Ut(Nt,{contentName:F,titleName:Ce,docsSlug:"dialog"}),vn=({titleId:e})=>{const t=Ot(Nt),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},hn="DialogDescriptionWarning",mn=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ot(hn).contentName}}.`;return s.useEffect(()=>{var n;const a=(n=e.current)==null?void 0:n.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},gn=pt,_n=ht,yn=gt,bn=_t,wn=yt,En=wt,Be=xt,xn=Ct;const Sn={XS:"xs",SM:"sm",MD:"md",LG:"lg"};function Cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pt={exports:{}};/*!
42
46
  Copyright (c) 2018 Jed Watson.
43
47
  Licensed under the MIT License (MIT), see
44
48
  http://jedwatson.github.io/classnames
45
- */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(r=a(r,o(i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var u="";for(var i in r)n.call(r,i)&&r[i]&&(u=a(u,i));return u}function a(r,u){return u?r?r+" "+u:r+u:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(st);var dr=st.exports;const Be=lr(dr),fr="_rotate_1xozj_1",pr="_dash_1xozj_1",H={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:fr,"purpur-spinner--xxs":"_purpur-spinner--xxs_1xozj_4","purpur-spinner--xs":"_purpur-spinner--xs_1xozj_8","purpur-spinner--sm":"_purpur-spinner--sm_1xozj_12","purpur-spinner--md":"_purpur-spinner--md_1xozj_16","purpur-spinner--lg":"_purpur-spinner--lg_1xozj_20","purpur-spinner__circle":"_purpur-spinner__circle_1xozj_24",dash:pr,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},K="purpur-spinner",vr={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},hr=({["data-testid"]:e,disabled:n=!1,negative:t=!1,size:o=vr.SM,...a})=>g.jsx("div",{className:Be([H[K],H[`${K}--${o}`]]),"data-testid":e,...a,children:g.jsx("svg",{viewBox:"0 0 50 50",children:g.jsx("circle",{className:Be(H[`${K}__circle`],{[H[`${K}__circle--disabled`]]:n,[H[`${K}__circle--negative`]]:t}),cx:"25",cy:"25",r:"20"})})});function mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lt={exports:{}};/*!
49
+ */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o(u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Pt);var Nn=Pt.exports;const qe=Cn(Nn),On="_rotate_1xozj_1",Pn="_dash_1xozj_1",H={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:On,"purpur-spinner--xxs":"_purpur-spinner--xxs_1xozj_4","purpur-spinner--xs":"_purpur-spinner--xs_1xozj_8","purpur-spinner--sm":"_purpur-spinner--sm_1xozj_12","purpur-spinner--md":"_purpur-spinner--md_1xozj_16","purpur-spinner--lg":"_purpur-spinner--lg_1xozj_20","purpur-spinner__circle":"_purpur-spinner__circle_1xozj_24",dash:Pn,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},G="purpur-spinner",Rn={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},An=({["data-testid"]:e,disabled:t=!1,negative:r=!1,size:o=Rn.SM,...a})=>c.jsx("div",{className:qe([H[G],H[`${G}--${o}`]]),"data-testid":e,...a,children:c.jsx("svg",{viewBox:"0 0 50 50",children:c.jsx("circle",{className:qe(H[`${G}__circle`],{[H[`${G}__circle--disabled`]]:t,[H[`${G}__circle--negative`]]:r}),cx:"25",cy:"25",r:"20"})})});function jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rt={exports:{}};/*!
46
50
  Copyright (c) 2018 Jed Watson.
47
51
  Licensed under the MIT License (MIT), see
48
52
  http://jedwatson.github.io/classnames
49
- */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(r=a(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var u="";for(var i in r)n.call(r,i)&&r[i]&&(u=a(u,this&&this[i]||i));return u}function a(r,u){return u?r?r+" "+u:r+u:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(lt);var gr=lt.exports;const _r=mr(gr),br={"purpur-button":"_purpur-button_w455q_1","purpur-button--xs":"_purpur-button--xs_w455q_33","purpur-button--icon-only":"_purpur-button--icon-only_w455q_36","purpur-button--sm":"_purpur-button--sm_w455q_39","purpur-button--md":"_purpur-button--md_w455q_45","purpur-button--lg":"_purpur-button--lg_w455q_51","purpur-button--full-width":"_purpur-button--full-width_w455q_57","purpur-button--primary":"_purpur-button--primary_w455q_60","purpur-button--disabled":"_purpur-button--disabled_w455q_64","purpur-button--primary-negative":"_purpur-button--primary-negative_w455q_70","purpur-button--secondary":"_purpur-button--secondary_w455q_82","purpur-button--secondary-negative":"_purpur-button--secondary-negative_w455q_93","purpur-button--expressive":"_purpur-button--expressive_w455q_104","purpur-button--expressive-negative":"_purpur-button--expressive-negative_w455q_114","purpur-button--negative":"_purpur-button--negative_w455q_126","purpur-button--destructive":"_purpur-button--destructive_w455q_133","purpur-button--destructive-negative":"_purpur-button--destructive-negative_w455q_143","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_w455q_153","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_w455q_166","purpur-button--text-negative":"_purpur-button--text-negative_w455q_181","purpur-button--text":"_purpur-button--text_w455q_181"},$r=_r.bind(br),k="purpur-button",yr=({children:e,className:n,["data-testid"]:t,disabled:o=!1,fullWidth:a=!1,iconOnly:r,loading:u=!1,negative:i=!1,onClick:l,size:f="md",variant:p,type:d="button",...v},h)=>{if(r&&p==="destructive")return null;const E=$r([k,`${k}--${i?`${p}-negative`:p}`,`${k}--${f}`],{[`${k}--icon-only`]:r,[`${k}--negative`]:i,[`${k}--full-width`]:a,[`${k}--disabled`]:o||u},n),s=b=>{o||u?b.preventDefault():l&&l(b)},m=!!v["aria-disabled"]||o||u;return g.jsxs("button",{className:E,"data-testid":t,type:d,ref:h,"aria-disabled":m,onClick:s,...v,children:[u&&g.jsx(hr,{size:f===sr.LG?"xs":"xxs",negative:i,disabled:m})," ",e]})},Oe=c.forwardRef(yr);Oe.displayName="Button";function Er(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dt={exports:{}};/*!
53
+ */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Rt);var Dn=Rt.exports;const Tn=jn(Dn),Mn={"purpur-button":"_purpur-button_w455q_1","purpur-button--xs":"_purpur-button--xs_w455q_33","purpur-button--icon-only":"_purpur-button--icon-only_w455q_36","purpur-button--sm":"_purpur-button--sm_w455q_39","purpur-button--md":"_purpur-button--md_w455q_45","purpur-button--lg":"_purpur-button--lg_w455q_51","purpur-button--full-width":"_purpur-button--full-width_w455q_57","purpur-button--primary":"_purpur-button--primary_w455q_60","purpur-button--disabled":"_purpur-button--disabled_w455q_64","purpur-button--primary-negative":"_purpur-button--primary-negative_w455q_70","purpur-button--secondary":"_purpur-button--secondary_w455q_82","purpur-button--secondary-negative":"_purpur-button--secondary-negative_w455q_93","purpur-button--expressive":"_purpur-button--expressive_w455q_104","purpur-button--expressive-negative":"_purpur-button--expressive-negative_w455q_114","purpur-button--negative":"_purpur-button--negative_w455q_126","purpur-button--destructive":"_purpur-button--destructive_w455q_133","purpur-button--destructive-negative":"_purpur-button--destructive-negative_w455q_143","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_w455q_153","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_w455q_166","purpur-button--text-negative":"_purpur-button--text-negative_w455q_181","purpur-button--text":"_purpur-button--text_w455q_181"},In=Tn.bind(Mn),$="purpur-button",Ln=({children:e,className:t,["data-testid"]:r,disabled:o=!1,fullWidth:a=!1,iconOnly:n,loading:i=!1,negative:u=!1,onClick:f,size:l="md",variant:p,type:v="button",...h},g)=>{if(n&&p==="destructive")return null;const w=In([$,`${$}--${u?`${p}-negative`:p}`,`${$}--${l}`],{[`${$}--icon-only`]:n,[`${$}--negative`]:u,[`${$}--full-width`]:a,[`${$}--disabled`]:o||i},t),d=_=>{o||i?_.preventDefault():f&&f(_)},m=!!h["aria-disabled"]||o||i;return c.jsxs("button",{className:w,"data-testid":r,type:v,ref:g,"aria-disabled":m,onClick:d,...h,children:[i&&c.jsx(An,{size:l===Sn.LG?"xs":"xxs",negative:u,disabled:m})," ",e]})},Oe=O.forwardRef(Ln);Oe.displayName="Button";function $n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var At={exports:{}};/*!
50
54
  Copyright (c) 2018 Jed Watson.
51
55
  Licensed under the MIT License (MIT), see
52
56
  http://jedwatson.github.io/classnames
53
- */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(r=a(r,o(i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var u="";for(var i in r)n.call(r,i)&&r[i]&&(u=a(u,i));return u}function a(r,u){return u?r?r+" "+u:r+u:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(dt);var wr=dt.exports;const xr=Er(wr),re={"purpur-heading":"_purpur-heading_k9fhq_1","purpur-heading--hyphens":"_purpur-heading--hyphens_k9fhq_8","purpur-heading--negative":"_purpur-heading--negative_k9fhq_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_k9fhq_14","purpur-heading--title-100":"_purpur-heading--title-100_k9fhq_20","purpur-heading--title-200":"_purpur-heading--title-200_k9fhq_26","purpur-heading--title-300":"_purpur-heading--title-300_k9fhq_32","purpur-heading--title-400":"_purpur-heading--title-400_k9fhq_38","purpur-heading--title-500":"_purpur-heading--title-500_k9fhq_44","purpur-heading--title-600":"_purpur-heading--title-600_k9fhq_50","purpur-heading--title-700":"_purpur-heading--title-700_k9fhq_56","purpur-heading--display-25":"_purpur-heading--display-25_k9fhq_62","purpur-heading--display-50":"_purpur-heading--display-50_k9fhq_68","purpur-heading--display-100":"_purpur-heading--display-100_k9fhq_74","purpur-heading--display-200":"_purpur-heading--display-200_k9fhq_80"},Sr={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},oe="purpur-heading",ft=({["data-testid"]:e,children:n,className:t="",enableHyphenation:o=!1,negative:a=!1,tag:r,variant:u=Sr.TITLE100,...i})=>{const l=r,f=xr([t,re[oe],re[`${oe}--${u}`],{[re[`${oe}--hyphens`]]:o,[re[`${oe}--negative`]]:a}]);return g.jsx(l,{...i,className:f,"data-testid":e,children:n})};ft.displayName="Heading";function Cr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pt={exports:{}};/*!
57
+ */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o(u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(At);var kn=At.exports;const Fn=$n(kn),te={"purpur-heading":"_purpur-heading_k9fhq_1","purpur-heading--hyphens":"_purpur-heading--hyphens_k9fhq_8","purpur-heading--negative":"_purpur-heading--negative_k9fhq_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_k9fhq_14","purpur-heading--title-100":"_purpur-heading--title-100_k9fhq_20","purpur-heading--title-200":"_purpur-heading--title-200_k9fhq_26","purpur-heading--title-300":"_purpur-heading--title-300_k9fhq_32","purpur-heading--title-400":"_purpur-heading--title-400_k9fhq_38","purpur-heading--title-500":"_purpur-heading--title-500_k9fhq_44","purpur-heading--title-600":"_purpur-heading--title-600_k9fhq_50","purpur-heading--title-700":"_purpur-heading--title-700_k9fhq_56","purpur-heading--display-25":"_purpur-heading--display-25_k9fhq_62","purpur-heading--display-50":"_purpur-heading--display-50_k9fhq_68","purpur-heading--display-100":"_purpur-heading--display-100_k9fhq_74","purpur-heading--display-200":"_purpur-heading--display-200_k9fhq_80"},Wn={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},re="purpur-heading",jt=({["data-testid"]:e,children:t,className:r="",enableHyphenation:o=!1,negative:a=!1,tag:n,variant:i=Wn.TITLE100,...u})=>{const f=n,l=Fn([r,te[re],te[`${re}--${i}`],{[te[`${re}--hyphens`]]:o,[te[`${re}--negative`]]:a}]);return c.jsx(f,{...u,className:l,"data-testid":e,children:t})};jt.displayName="Heading";function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dt={exports:{}};/*!
54
58
  Copyright (c) 2018 Jed Watson.
55
59
  Licensed under the MIT License (MIT), see
56
60
  http://jedwatson.github.io/classnames
57
- */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(r=a(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var u="";for(var i in r)n.call(r,i)&&r[i]&&(u=a(u,this&&this[i]||i));return u}function a(r,u){return u?r?r+" "+u:r+u:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(pt);var Or=pt.exports;const Pr=Cr(Or),Nr={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},Ar=Pr.bind(Nr),Ue="purpur-icon",Rr="md",Tr=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),Dr=({content:e="",title:n}={})=>{const t=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},n?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=n?`<title>${n}</title>`:"";return`<svg ${Tr(t)}>${o}${e}</svg>`},jr=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),vt=({["data-testid"]:e,svg:n,allyTitle:t,className:o,size:a=Rr,...r})=>{const u=Dr({content:jr(n.svg),title:t}),i=Ar(o,Ue,`${Ue}--${a}`);return g.jsx("span",{"aria-label":t,className:i,"data-testid":e,dangerouslySetInnerHTML:{__html:u},...r})};vt.displayName="Icon";const Ir={name:"close",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["close"],category:"utility"},ht=e=>g.jsx(vt,{...e,svg:Ir});ht.displayName="IconClose";function Mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mt={exports:{}};/*!
61
+ */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Dt);var qn=Dt.exports;const Un=Bn(qn),Vn={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},zn=Un.bind(Vn),Ue="purpur-icon",Hn="md",Gn=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),Kn=({content:e="",title:t}={})=>{const r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},t?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=t?`<title>${t}</title>`:"";return`<svg ${Gn(r)}>${o}${e}</svg>`},Xn=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),Tt=({["data-testid"]:e,svg:t,allyTitle:r,className:o,size:a=Hn,...n})=>{const i=Kn({content:Xn(t.svg),title:r}),u=zn(o,Ue,`${Ue}--${a}`);return c.jsx("span",{"aria-label":r,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:i},...n})};Tt.displayName="Icon";const Yn={name:"close",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["close"],category:"utility"},Mt=e=>c.jsx(Tt,{...e,svg:Yn});Mt.displayName="IconClose";function Zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var It={exports:{}};/*!
58
62
  Copyright (c) 2018 Jed Watson.
59
63
  Licensed under the MIT License (MIT), see
60
64
  http://jedwatson.github.io/classnames
61
- */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(r=a(r,o(i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var u="";for(var i in r)n.call(r,i)&&r[i]&&(u=a(u,i));return u}function a(r,u){return u?r?r+" "+u:r+u:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(mt);var Lr=mt.exports;const kr=Mr(Lr),X={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},Fr={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},G="purpur-paragraph",gt=({["data-testid"]:e,children:n,className:t,disabled:o,enableHyphenation:a=!1,negative:r=!1,variant:u=Fr.PARAGRAPH100,...i})=>{const l=kr([t,X[G],X[`${G}--${u}`],{[X[`${G}--hyphens`]]:a,[X[`${G}--disabled`]]:o,[X[`${G}--negative`]]:r}]);return g.jsx("p",{...i,className:l,"data-testid":e,children:n})};gt.displayName="Paragraph";function z(){return z=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},z.apply(null,arguments)}function qr(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Br(...e){return n=>e.forEach(t=>qr(t,n))}const _t=c.forwardRef((e,n)=>{const{children:t,...o}=e,a=c.Children.toArray(t),r=a.find(Wr);if(r){const u=r.props.children,i=a.map(l=>l===r?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:l);return c.createElement(we,z({},o,{ref:n}),c.isValidElement(u)?c.cloneElement(u,void 0,i):null)}return c.createElement(we,z({},o,{ref:n}),t)});_t.displayName="Slot";const we=c.forwardRef((e,n)=>{const{children:t,...o}=e;return c.isValidElement(t)?c.cloneElement(t,{...zr(o,t.props),ref:n?Br(n,t.ref):t.ref}):c.Children.count(t)>1?c.Children.only(null):null});we.displayName="SlotClone";const Ur=({children:e})=>c.createElement(c.Fragment,null,e);function Wr(e){return c.isValidElement(e)&&e.type===Ur}function zr(e,n){const t={...n};for(const o in n){const a=e[o],r=n[o];/^on[A-Z]/.test(o)?a&&r?t[o]=(...u)=>{r(...u),a(...u)}:a&&(t[o]=a):o==="style"?t[o]={...a,...r}:o==="className"&&(t[o]=[a,r].filter(Boolean).join(" "))}return{...e,...t}}const Vr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Hr=Vr.reduce((e,n)=>{const t=c.forwardRef((o,a)=>{const{asChild:r,...u}=o,i=r?_t:n;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(i,z({},u,{ref:a}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),Kr=c.forwardRef((e,n)=>c.createElement(Hr.span,z({},e,{ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),Xr=Kr,Gr=({asChild:e,children:n,className:t="",["data-testid"]:o})=>g.jsx(Xr,{asChild:e,"data-testid":o,className:t,children:n});function Yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bt={exports:{}};/*!
65
+ */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o(u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(It);var Qn=It.exports;const Jn=Zn(Qn),K={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},eo={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},X="purpur-paragraph",Lt=({["data-testid"]:e,children:t,className:r,disabled:o,enableHyphenation:a=!1,negative:n=!1,variant:i=eo.PARAGRAPH100,...u})=>{const f=Jn([r,K[X],K[`${X}--${i}`],{[K[`${X}--hyphens`]]:a,[K[`${X}--disabled`]]:o,[K[`${X}--negative`]]:n}]);return c.jsx("p",{...u,className:f,"data-testid":e,children:t})};Lt.displayName="Paragraph";function Ve(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function to(...e){return t=>{let r=!1;const o=e.map(a=>{const n=Ve(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():Ve(e[a],null)}}}}var $t=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(no);if(n){const i=n.props.children,u=a.map(f=>f===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:f);return c.jsx(we,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(we,{...o,ref:t,children:r})});$t.displayName="Slot";var we=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=ao(r),n=oo(o,r.props);return r.type!==s.Fragment&&(n.ref=t?to(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});we.displayName="SlotClone";var ro=({children:e})=>c.jsx(c.Fragment,{children:e});function no(e){return s.isValidElement(e)&&e.type===ro}function oo(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...i)=>{n(...i),a(...i)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function ao(e){var t,r;let o=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?e.ref:(o=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var io=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],uo=io.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?$t:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),so="VisuallyHidden",kt=s.forwardRef((e,t)=>c.jsx(uo.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));kt.displayName=so;var co=kt;const lo=({asChild:e,children:t,className:r="",["data-testid"]:o})=>c.jsx(co,{asChild:e,"data-testid":o,className:r,children:t});function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ft={exports:{}};/*!
62
66
  Copyright (c) 2018 Jed Watson.
63
67
  Licensed under the MIT License (MIT), see
64
68
  http://jedwatson.github.io/classnames
65
- */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(r=a(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var u="";for(var i in r)n.call(r,i)&&r[i]&&(u=a(u,this&&this[i]||i));return u}function a(r,u){return u?r?r+" "+u:r+u:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(bt);var Zr=bt.exports;const Qr=Yr(Zr),Jr="_fadeIn_1ifm3_1",eo={"purpur-modal-content":"_purpur-modal-content_1ifm3_1",fadeIn:Jr,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_1ifm3_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1ifm3_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1ifm3_48","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1ifm3_58","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1ifm3_62","purpur-modal-content__header":"_purpur-modal-content__header_1ifm3_85","purpur-modal-content__title":"_purpur-modal-content__title_1ifm3_98","purpur-modal-content__description":"_purpur-modal-content__description_1ifm3_101","purpur-modal-content__body":"_purpur-modal-content__body_1ifm3_104","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1ifm3_112","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_1ifm3_124","purpur-modal-content__actions-button":"_purpur-modal-content__actions-button_1ifm3_124","purpur-modal-content__notification":"_purpur-modal-content__notification_1ifm3_147","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1ifm3_150","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1ifm3_150","purpur-modal-content__actions":"_purpur-modal-content__actions_1ifm3_124","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_1ifm3_181","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1ifm3_191"},We=e=>e.showCloseButton===!0,P=Qr.bind(eo),C="purpur-modal-content",to=c.forwardRef(({["data-testid"]:e,actions:n,children:t,className:o,description:a,disableCloseOnClickOutside:r,hideDescription:u,image:i,primaryActionVariant:l="primary",stickyButtons:f=!0,title:p,notification:d=void 0,zIndex:v,...h},E)=>{const{closeButtonAllyLabel:s,showCloseButton:m,...b}=h,[S,y]=c.useState(!1),$=c.useRef(null),x=c.useRef(null),L=P([C,{[`${C}--with-image`]:!!i},{[`${C}--overflow`]:S},{[`${C}--sticky-footer`]:f},o]),N=R=>e?`${e} ${R}`:void 0,w=R=>{r&&R.preventDefault()},A=c.useCallback(()=>{if(!$.current||!x.current)return;const R=window.getComputedStyle($.current,null),$t=parseFloat(R.getPropertyValue("height")),yt=x.current.offsetHeight;y($t<yt)},[]),Z=R=>{r&&!m&&R.preventDefault()};return c.useEffect(()=>(window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[A]),c.useEffect(()=>{A()},[d,t,A]),g.jsxs(or,{children:[g.jsx(ar,{className:P(`${C}__overlay`),style:{zIndex:v}}),g.jsxs(ur,{...b,className:L,"data-testid":e,ref:E,...!a&&{"aria-describedby":void 0},onPointerDownOutside:w,onOpenAutoFocus:A,onEscapeKeyDown:Z,style:{zIndex:`calc(${v} + 1)`},children:[g.jsxs("div",{ref:$,className:P(`${C}__wrapper`),children:[We(h)&&s&&i&&g.jsx(ze,{allyLabel:s,hasImage:!0,"data-testid":N("close-button")}),g.jsxs("div",{ref:x,className:P(`${C}__wrapper-inner`),children:[g.jsxs("div",{className:P(`${C}__header`),children:[We(h)&&s&&!i&&g.jsx(ze,{allyLabel:s,"data-testid":N("close-button")}),g.jsx(ir,{asChild:!0,className:P(`${C}__title`),"data-testid":N("title"),children:g.jsx(ft,{tag:"h2",variant:"title-200",children:p})})]}),i&&g.jsx("div",{className:P(`${C}__image-wrapper`),"data-testid":N("image"),children:i}),g.jsx("div",{className:P(`${C}__body`),children:g.jsxs("div",{className:P(`${C}__body-inner`),children:[a&&u&&g.jsx(Gr,{asChild:!0,children:g.jsx(qe,{"data-testid":N("description"),children:a})}),a&&!u&&g.jsx(qe,{asChild:!0,className:P(`${C}__description`),"data-testid":N("description"),children:g.jsx(gt,{variant:"paragraph-100",children:a})}),g.jsx("div",{children:t}),!f&&g.jsx(Ve,{actions:n,primaryActionVariant:l,notification:d})]})})]})]}),f&&g.jsx(Ve,{actions:n,primaryActionVariant:l,notification:d})]})]})}),ze=({allyLabel:e,hasImage:n,["data-testid"]:t})=>g.jsx(cr,{asChild:!0,children:g.jsx(Oe,{variant:n?"primary":"tertiary-purple",negative:n,size:"sm",iconOnly:!0,"aria-label":e,className:P(`${C}__close-button`),"data-testid":t,children:g.jsx(ht,{})})}),no=3,Ve=({actions:e,primaryActionVariant:n,notification:t})=>{const o=c.useRef(null),a=[n,"secondary","text"];return c.useEffect(()=>{var r,u;t&&((u=(r=o==null?void 0:o.current)==null?void 0:r.scrollIntoView)==null||u.call(r,!1))},[t]),e&&e.length>0?g.jsxs("div",{className:P(`${C}__actions`),children:[g.jsx("div",{className:P(`${C}__actions-buttons`),"data-testid":"modal actions",children:e.slice(0,no).map(({label:r,onClick:u,disabled:i,loading:l,iconPosition:f="right",icon:p,...d},v)=>g.jsxs(Oe,{"data-testid":"modal actions button",variant:a[v]||"",onClick:u,disabled:i,loading:l,className:P(`${C}__actions-button`),...d,children:[f==="left"&&p&&p,r,f==="right"&&p&&p]},r))}),t&&g.jsx("div",{className:P(`${C}__notification`),ref:o,children:t}),g.jsx("span",{className:P(`${C}__actions-separator`)})]}):null},ro=c.forwardRef(({["data-testid"]:e,children:n,className:t,...o},a)=>g.jsx(rr,{asChild:!0,ref:a,"data-testid":e,className:t,...o,children:n})),se=({["data-testid"]:e,children:n,open:t,onOpenChange:o})=>g.jsx(nr,{open:t,onOpenChange:o,"data-testid":e,children:n});se.Trigger=ro;se.Content=to;se.displayName="Modal";exports.Modal=se;
69
+ */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ft);var po=Ft.exports;const vo=fo(po),ho="_fadeIn_1ifm3_1",mo={"purpur-modal-content":"_purpur-modal-content_1ifm3_1",fadeIn:ho,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_1ifm3_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1ifm3_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1ifm3_48","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1ifm3_58","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1ifm3_62","purpur-modal-content__header":"_purpur-modal-content__header_1ifm3_85","purpur-modal-content__title":"_purpur-modal-content__title_1ifm3_98","purpur-modal-content__description":"_purpur-modal-content__description_1ifm3_101","purpur-modal-content__body":"_purpur-modal-content__body_1ifm3_104","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1ifm3_112","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_1ifm3_124","purpur-modal-content__actions-button":"_purpur-modal-content__actions-button_1ifm3_124","purpur-modal-content__notification":"_purpur-modal-content__notification_1ifm3_147","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1ifm3_150","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1ifm3_150","purpur-modal-content__actions":"_purpur-modal-content__actions_1ifm3_124","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_1ifm3_181","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1ifm3_191"},ze=e=>e.showCloseButton===!0,N=vo.bind(mo),C="purpur-modal-content",go=O.forwardRef(({["data-testid"]:e,actions:t,children:r,className:o,description:a,disableCloseOnClickOutside:n,hideDescription:i,image:u,primaryActionVariant:f="primary",stickyButtons:l=!0,title:p,notification:v=void 0,zIndex:h,...g},w)=>{const{closeButtonAllyLabel:d,showCloseButton:m,..._}=g,[S,E]=O.useState(!1),b=O.useRef(null),x=O.useRef(null),R=N([C,{[`${C}--with-image`]:!!u},{[`${C}--overflow`]:S},{[`${C}--sticky-footer`]:l},o]),y=L=>e?`${e} ${L}`:void 0,A=L=>{n&&L.preventDefault()},P=O.useCallback(()=>{if(!b.current||!x.current)return;const L=window.getComputedStyle(b.current,null),Wt=parseFloat(L.getPropertyValue("height")),Bt=x.current.offsetHeight;E(Wt<Bt)},[]),z=L=>{n&&!m&&L.preventDefault()};return O.useEffect(()=>(window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)}),[P]),O.useEffect(()=>{P()},[v,r,P]),c.jsxs(yn,{children:[c.jsx(bn,{className:N(`${C}__overlay`),style:{zIndex:h}}),c.jsxs(wn,{..._,className:R,"data-testid":e,ref:w,...!a&&{"aria-describedby":void 0},onPointerDownOutside:A,onOpenAutoFocus:P,onEscapeKeyDown:z,style:{zIndex:`calc(${h} + 1)`},children:[c.jsxs("div",{ref:b,className:N(`${C}__wrapper`),children:[ze(g)&&d&&u&&c.jsx(He,{allyLabel:d,hasImage:!0,"data-testid":y("close-button")}),c.jsxs("div",{ref:x,className:N(`${C}__wrapper-inner`),children:[c.jsxs("div",{className:N(`${C}__header`),children:[ze(g)&&d&&!u&&c.jsx(He,{allyLabel:d,"data-testid":y("close-button")}),c.jsx(En,{asChild:!0,className:N(`${C}__title`),"data-testid":y("title"),children:c.jsx(jt,{tag:"h2",variant:"title-200",children:p})})]}),u&&c.jsx("div",{className:N(`${C}__image-wrapper`),"data-testid":y("image"),children:u}),c.jsx("div",{className:N(`${C}__body`),children:c.jsxs("div",{className:N(`${C}__body-inner`),children:[a&&i&&c.jsx(lo,{asChild:!0,children:c.jsx(Be,{"data-testid":y("description"),children:a})}),a&&!i&&c.jsx(Be,{asChild:!0,className:N(`${C}__description`),"data-testid":y("description"),children:c.jsx(Lt,{variant:"paragraph-100",children:a})}),c.jsx("div",{children:r}),!l&&c.jsx(Ge,{actions:t,primaryActionVariant:f,notification:v})]})})]})]}),l&&c.jsx(Ge,{actions:t,primaryActionVariant:f,notification:v})]})]})}),He=({allyLabel:e,hasImage:t,["data-testid"]:r})=>c.jsx(xn,{asChild:!0,children:c.jsx(Oe,{variant:t?"primary":"tertiary-purple",negative:t,size:"sm",iconOnly:!0,"aria-label":e,className:N(`${C}__close-button`),"data-testid":r,children:c.jsx(Mt,{})})}),_o=3,Ge=({actions:e,primaryActionVariant:t,notification:r})=>{const o=O.useRef(null),a=[t,"secondary","text"];return O.useEffect(()=>{var n,i;r&&((i=(n=o==null?void 0:o.current)==null?void 0:n.scrollIntoView)==null||i.call(n,!1))},[r]),e&&e.length>0?c.jsxs("div",{className:N(`${C}__actions`),children:[c.jsx("div",{className:N(`${C}__actions-buttons`),"data-testid":"modal actions",children:e.slice(0,_o).map(({label:n,onClick:i,disabled:u,loading:f,iconPosition:l="right",icon:p,...v},h)=>c.jsxs(Oe,{"data-testid":"modal actions button",variant:a[h]||"",onClick:i,disabled:u,loading:f,className:N(`${C}__actions-button`),...v,children:[l==="left"&&p&&p,n,l==="right"&&p&&p]},n))}),r&&c.jsx("div",{className:N(`${C}__notification`),ref:o,children:r}),c.jsx("span",{className:N(`${C}__actions-separator`)})]}):null},yo=O.forwardRef(({["data-testid"]:e,children:t,className:r,...o},a)=>c.jsx(_n,{asChild:!0,ref:a,"data-testid":e,className:r,...o,children:t})),ce=({["data-testid"]:e,children:t,open:r,onOpenChange:o})=>c.jsx(gn,{open:r,onOpenChange:o,"data-testid":e,children:t});ce.Trigger=yo;ce.Content=go;ce.displayName="Modal";exports.Modal=ce;
66
70
  //# sourceMappingURL=modal.cjs.js.map