@purpurds/modal 3.0.0

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.
@@ -0,0 +1,66 @@
1
+ System.register(["react","react-dom","react/jsx-runtime"],function(Rt,bo){"use strict";var G,re,te,_,be,Be,g,P,N,B,C,D,j,Y,oe,We,b,$e,Ue,He,F;return{setters:[v=>{G=v.useCallback,re=v.createContext,te=v.useMemo,_=v.createElement,be=v.useContext,Be=v.useLayoutEffect,g=v,P=v.useRef,N=v.useEffect,B=v.useState,C=v.forwardRef,D=v.Children,j=v.isValidElement,Y=v.cloneElement,oe=v.Fragment,We=v.useReducer,b=v.default},v=>{$e=v.flushSync,Ue=v.default},v=>{He=v.jsxs,F=v.jsx}],execute:function(){function v(){return v=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},v.apply(this,arguments)}function W(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 It(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Ge(...e){return n=>e.forEach(t=>It(t,n))}function q(...e){return G(Ge(...e),e)}function Lt(e,n=[]){let t=[];function o(r,c){const i=re(c),l=t.length;t=[...t,c];function d(s){const{scope:m,children:f,...w}=s,u=(m==null?void 0:m[e][l])||i,h=te(()=>w,Object.values(w));return _(u.Provider,{value:h},f)}function p(s,m){const f=(m==null?void 0:m[e][l])||i,w=be(f);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${s}\` must be used within \`${r}\``)}return d.displayName=r+"Provider",[d,p]}const a=()=>{const r=t.map(c=>re(c));return function(i){const l=(i==null?void 0:i[e])||r;return te(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return a.scopeName=e,[o,Mt(a,...n)]}function Mt(...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 c=o.reduce((i,{useScope:l,scopeName:d})=>{const s=l(r)[`__scope${d}`];return{...i,...s}},{});return te(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return t.scopeName=n.scopeName,t}const ye=globalThis!=null&&globalThis.document?Be:()=>{},Ft=g.useId||(()=>{});let kt=0;function Ee(e){const[n,t]=g.useState(Ft());return ye(()=>{e||t(o=>o??String(kt++))},[e]),e||(n?`radix-${n}`:"")}function V(e){const n=P(e);return N(()=>{n.current=e}),te(()=>(...t)=>{var o;return(o=n.current)===null||o===void 0?void 0:o.call(n,...t)},[])}function jt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,a]=Bt({defaultProp:n,onChange:t}),r=e!==void 0,c=r?e:o,i=V(t),l=G(d=>{if(r){const s=typeof d=="function"?d(e):d;s!==e&&i(s)}else a(d)},[r,e,a,i]);return[c,l]}function Bt({defaultProp:e,onChange:n}){const t=B(e),[o]=t,a=P(o),r=V(n);return N(()=>{a.current!==o&&(r(o),a.current=o)},[o,a,r]),t}const we=C((e,n)=>{const{children:t,...o}=e,a=D.toArray(t),r=a.find(Ut);if(r){const c=r.props.children,i=a.map(l=>l===r?D.count(c)>1?D.only(null):j(c)?c.props.children:null:l);return _(Se,v({},o,{ref:n}),j(c)?Y(c,void 0,i):null)}return _(Se,v({},o,{ref:n}),t)});we.displayName="Slot";const Se=C((e,n)=>{const{children:t,...o}=e;return j(t)?Y(t,{...Ht(o,t.props),ref:n?Ge(n,t.ref):t.ref}):D.count(t)>1?D.only(null):null});Se.displayName="SlotClone";const Wt=({children:e})=>_(oe,null,e);function Ut(e){return j(e)&&e.type===Wt}function Ht(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 U=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,n)=>{const t=C((o,a)=>{const{asChild:r,...c}=o,i=r?we:n;return N(()=>{window[Symbol.for("radix-ui")]=!0},[]),_(i,v({},c,{ref:a}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function Gt(e,n){e&&$e(()=>e.dispatchEvent(n))}function Vt(e,n=globalThis==null?void 0:globalThis.document){const t=V(e);N(()=>{const o=a=>{a.key==="Escape"&&t(a)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[t,n])}const Ce="dismissableLayer.update",Kt="dismissableLayer.pointerDownOutside",zt="dismissableLayer.focusOutside";let Ve;const Xt=re({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yt=C((e,n)=>{var t;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:i,onDismiss:l,...d}=e,p=be(Xt),[s,m]=B(null),f=(t=s==null?void 0:s.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,w]=B({}),u=q(n,S=>m(S)),h=Array.from(p.layers),[$]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),O=h.indexOf($),y=s?h.indexOf(s):-1,E=p.layersWithOutsidePointerEventsDisabled.size>0,x=y>=O,X=qt(S=>{const M=S.target,_e=[...p.branches].some(I=>I.contains(M));!x||_e||(r==null||r(S),i==null||i(S),S.defaultPrevented||l==null||l())},f),T=Zt(S=>{const M=S.target;[...p.branches].some(I=>I.contains(M))||(c==null||c(S),i==null||i(S),S.defaultPrevented||l==null||l())},f);return Vt(S=>{y===p.layers.size-1&&(a==null||a(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},f),N(()=>{if(s)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Ve=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(s)),p.layers.add(s),Ke(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ve)}},[s,f,o,p]),N(()=>()=>{s&&(p.layers.delete(s),p.layersWithOutsidePointerEventsDisabled.delete(s),Ke())},[s,p]),N(()=>{const S=()=>w({});return document.addEventListener(Ce,S),()=>document.removeEventListener(Ce,S)},[]),_(U.div,v({},d,{ref:u,style:{pointerEvents:E?x?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,T.onFocusCapture),onBlurCapture:W(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,X.onPointerDownCapture)}))});function qt(e,n=globalThis==null?void 0:globalThis.document){const t=V(e),o=P(!1),a=P(()=>{});return N(()=>{const r=i=>{if(i.target&&!o.current){let d=function(){ze(Kt,t,l,{discrete:!0})};const l={originalEvent:i};i.pointerType==="touch"?(n.removeEventListener("click",a.current),a.current=d,n.addEventListener("click",a.current,{once:!0})):d()}else n.removeEventListener("click",a.current);o.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",r),n.removeEventListener("click",a.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function Zt(e,n=globalThis==null?void 0:globalThis.document){const t=V(e),o=P(!1);return N(()=>{const a=r=>{r.target&&!o.current&&ze(zt,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 Ke(){const e=new CustomEvent(Ce);document.dispatchEvent(e)}function ze(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?Gt(a,r):a.dispatchEvent(r)}const xe="focusScope.autoFocusOnMount",Oe="focusScope.autoFocusOnUnmount",Xe={bubbles:!1,cancelable:!0},Qt=C((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:r,...c}=e,[i,l]=B(null),d=V(a),p=V(r),s=P(null),m=q(n,u=>l(u)),f=P({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N(()=>{if(o){let u=function(y){if(f.paused||!i)return;const E=y.target;i.contains(E)?s.current=E:H(s.current,{select:!0})},h=function(y){if(f.paused||!i)return;const E=y.relatedTarget;E!==null&&(i.contains(E)||H(s.current,{select:!0}))},$=function(y){if(document.activeElement===document.body)for(const x of y)x.removedNodes.length>0&&H(i)};document.addEventListener("focusin",u),document.addEventListener("focusout",h);const O=new MutationObserver($);return i&&O.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",h),O.disconnect()}}},[o,i,f.paused]),N(()=>{if(i){Ze.add(f);const u=document.activeElement;if(!i.contains(u)){const $=new CustomEvent(xe,Xe);i.addEventListener(xe,d),i.dispatchEvent($),$.defaultPrevented||(Jt(on(Ye(i)),{select:!0}),document.activeElement===u&&H(i))}return()=>{i.removeEventListener(xe,d),setTimeout(()=>{const $=new CustomEvent(Oe,Xe);i.addEventListener(Oe,p),i.dispatchEvent($),$.defaultPrevented||H(u??document.body,{select:!0}),i.removeEventListener(Oe,p),Ze.remove(f)},0)}}},[i,d,p,f]);const w=G(u=>{if(!t&&!o||f.paused)return;const h=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,$=document.activeElement;if(h&&$){const O=u.currentTarget,[y,E]=en(O);y&&E?!u.shiftKey&&$===E?(u.preventDefault(),t&&H(y,{select:!0})):u.shiftKey&&$===y&&(u.preventDefault(),t&&H(E,{select:!0})):$===O&&u.preventDefault()}},[t,o,f.paused]);return _(U.div,v({tabIndex:-1},c,{ref:m,onKeyDown:w}))});function Jt(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(H(o,{select:n}),document.activeElement!==t)return}function en(e){const n=Ye(e),t=qe(n,e),o=qe(n.reverse(),e);return[t,o]}function Ye(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 qe(e,n){for(const t of e)if(!tn(t,{upTo:n}))return t}function tn(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 nn(e){return e instanceof HTMLInputElement&&"select"in e}function H(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&nn(e)&&n&&e.select()}}const Ze=rn();function rn(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=Qe(e,n),e.unshift(n)},remove(n){var t;e=Qe(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function Qe(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function on(e){return e.filter(n=>n.tagName!=="A")}const an=C((e,n)=>{var t;const{container:o=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...a}=e;return o?Ue.createPortal(_(U.div,v({},a,{ref:n})),o):null});function cn(e,n){return We((t,o)=>{const a=n[t][o];return a??t},e)}const ae=e=>{const{present:n,children:t}=e,o=un(n),a=typeof t=="function"?t({present:o.isPresent}):D.only(t),r=q(o.ref,a.ref);return typeof t=="function"||o.isPresent?Y(a,{ref:r}):null};ae.displayName="Presence";function un(e){const[n,t]=B(),o=P({}),a=P(e),r=P("none"),c=e?"mounted":"unmounted",[i,l]=cn(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N(()=>{const d=ce(o.current);r.current=i==="mounted"?d:"none"},[i]),ye(()=>{const d=o.current,p=a.current;if(p!==e){const m=r.current,f=ce(d);e?l("MOUNT"):f==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(p&&m!==f?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),ye(()=>{if(n){const d=s=>{const f=ce(o.current).includes(s.animationName);s.target===n&&f&&$e(()=>l("ANIMATION_END"))},p=s=>{s.target===n&&(r.current=ce(o.current))};return n.addEventListener("animationstart",p),n.addEventListener("animationcancel",d),n.addEventListener("animationend",d),()=>{n.removeEventListener("animationstart",p),n.removeEventListener("animationcancel",d),n.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:G(d=>{d&&(o.current=getComputedStyle(d)),t(d)},[])}}function ce(e){return(e==null?void 0:e.animationName)||"none"}let Pe=0;function sn(){N(()=>{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 k=function(){return k=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},k.apply(this,arguments)};function et(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 ln(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))}typeof SuppressedError=="function"&&SuppressedError;var ie="right-scroll-bar-position",ue="width-before-scroll-bar",dn="with-scroll-bars-hidden",pn="--removed-body-scroll-bar-size";function fn(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function vn(e,n){var t=B(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}function hn(e,n){return vn(n||null,function(t){return e.forEach(function(o){return fn(o,t)})})}function mn(e){return e}function gn(e,n){n===void 0&&(n=mn);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 c=n(r,o);return t.push(c),function(){t=t.filter(function(i){return i!==c})}},assignSyncMedium:function(r){for(o=!0;t.length;){var c=t;t=[],c.forEach(r)}t={push:function(i){return r(i)},filter:function(){return t}}},assignMedium:function(r){o=!0;var c=[];if(t.length){var i=t;t=[],i.forEach(r),c=t}var l=function(){var p=c;c=[],p.forEach(r)},d=function(){return Promise.resolve().then(l)};d(),t={push:function(p){c.push(p),d()},filter:function(p){return c=c.filter(p),t}}}};return a}function _n(e){e===void 0&&(e={});var n=gn(null);return n.options=k({async:!0,ssr:!1},e),n}var tt=function(e){var n=e.sideCar,t=et(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 g.createElement(o,k({},t))};tt.isSideCarExport=!0;function bn(e,n){return e.useMedium(n),tt}var nt=_n(),Ne=function(){},se=g.forwardRef(function(e,n){var t=g.useRef(null),o=g.useState({onScrollCapture:Ne,onWheelCapture:Ne,onTouchMoveCapture:Ne}),a=o[0],r=o[1],c=e.forwardProps,i=e.children,l=e.className,d=e.removeScrollBar,p=e.enabled,s=e.shards,m=e.sideCar,f=e.noIsolation,w=e.inert,u=e.allowPinchZoom,h=e.as,$=h===void 0?"div":h,O=et(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),y=m,E=hn([t,n]),x=k(k({},O),a);return g.createElement(g.Fragment,null,p&&g.createElement(y,{sideCar:nt,removeScrollBar:d,shards:s,noIsolation:f,inert:w,setCallbacks:r,allowPinchZoom:!!u,lockRef:t}),c?g.cloneElement(g.Children.only(i),k(k({},x),{ref:E})):g.createElement($,k({},x,{className:l,ref:E}),i))});se.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},se.classNames={fullWidth:ue,zeroRight:ie};var rt,$n=function(){if(rt)return rt;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=$n();return n&&e.setAttribute("nonce",n),e}function En(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function wn(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var Sn=function(){var e=0,n=null;return{add:function(t){e==0&&(n=yn())&&(En(n,t),wn(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},Cn=function(){var e=Sn();return function(n,t){g.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},ot=function(){var e=Cn(),n=function(t){var o=t.styles,a=t.dynamic;return e(o,a),null};return n},xn={left:0,top:0,right:0,gap:0},Ae=function(e){return parseInt(e||"",10)||0},On=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[Ae(t),Ae(o),Ae(a)]},Pn=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xn;var n=On(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])}},Nn=ot(),An=function(e,n,t,o){var a=e.left,r=e.top,c=e.right,i=e.gap;return t===void 0&&(t="margin"),`
2
+ .`.concat(dn,` {
3
+ overflow: hidden `).concat(o,`;
4
+ padding-right: `).concat(i,"px ").concat(o,`;
5
+ }
6
+ body {
7
+ overflow: hidden `).concat(o,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([n&&"position: relative ".concat(o,";"),t==="margin"&&`
10
+ padding-left: `.concat(a,`px;
11
+ padding-top: `).concat(r,`px;
12
+ padding-right: `).concat(c,`px;
13
+ margin-left:0;
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(""),`
17
+ }
18
+
19
+ .`).concat(ie,` {
20
+ right: `).concat(i,"px ").concat(o,`;
21
+ }
22
+
23
+ .`).concat(ue,` {
24
+ margin-right: `).concat(i,"px ").concat(o,`;
25
+ }
26
+
27
+ .`).concat(ie," .").concat(ie,` {
28
+ right: 0 `).concat(o,`;
29
+ }
30
+
31
+ .`).concat(ue," .").concat(ue,` {
32
+ margin-right: 0 `).concat(o,`;
33
+ }
34
+
35
+ body {
36
+ `).concat(pn,": ").concat(i,`px;
37
+ }
38
+ `)},Tn=function(e){var n=e.noRelative,t=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o,r=g.useMemo(function(){return Pn(a)},[a]);return g.createElement(Nn,{styles:An(r,!n,a,t?"":"!important")})},Te=!1;if(typeof window<"u")try{var le=Object.defineProperty({},"passive",{get:function(){return Te=!0,!0}});window.addEventListener("test",le,le),window.removeEventListener("test",le,le)}catch{Te=!1}var Z=Te?{passive:!1}:!1,Dn=function(e){return e.tagName==="TEXTAREA"},at=function(e,n){var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!Dn(e)&&t[n]==="visible")},Rn=function(e){return at(e,"overflowY")},In=function(e){return at(e,"overflowX")},ct=function(e,n){var t=n;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var o=it(e,t);if(o){var a=ut(e,t),r=a[1],c=a[2];if(r>c)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},Ln=function(e){var n=e.scrollTop,t=e.scrollHeight,o=e.clientHeight;return[n,t,o]},Mn=function(e){var n=e.scrollLeft,t=e.scrollWidth,o=e.clientWidth;return[n,t,o]},it=function(e,n){return e==="v"?Rn(n):In(n)},ut=function(e,n){return e==="v"?Ln(n):Mn(n)},Fn=function(e,n){return e==="h"&&n==="rtl"?-1:1},kn=function(e,n,t,o,a){var r=Fn(e,window.getComputedStyle(n).direction),c=r*o,i=t.target,l=n.contains(i),d=!1,p=c>0,s=0,m=0;do{var f=ut(e,i),w=f[0],u=f[1],h=f[2],$=u-h-r*w;(w||$)&&it(e,i)&&(s+=$,m+=w),i=i.parentNode}while(!l&&i!==document.body||l&&(n.contains(i)||n===i));return(p&&(a&&s===0||!a&&c>s)||!p&&(a&&m===0||!a&&-c>m))&&(d=!0),d},de=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},st=function(e){return[e.deltaX,e.deltaY]},lt=function(e){return e&&"current"in e?e.current:e},jn=function(e,n){return e[0]===n[0]&&e[1]===n[1]},Bn=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},Wn=0,Q=[];function Un(e){var n=g.useRef([]),t=g.useRef([0,0]),o=g.useRef(),a=g.useState(Wn++)[0],r=g.useState(function(){return ot()})[0],c=g.useRef(e);g.useEffect(function(){c.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var u=ln([e.lockRef.current],(e.shards||[]).map(lt),!0).filter(Boolean);return u.forEach(function(h){return h.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),u.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=g.useCallback(function(u,h){if("touches"in u&&u.touches.length===2)return!c.current.allowPinchZoom;var $=de(u),O=t.current,y="deltaX"in u?u.deltaX:O[0]-$[0],E="deltaY"in u?u.deltaY:O[1]-$[1],x,X=u.target,T=Math.abs(y)>Math.abs(E)?"h":"v";if("touches"in u&&T==="h"&&X.type==="range")return!1;var S=ct(T,X);if(!S)return!0;if(S?x=T:(x=T==="v"?"h":"v",S=ct(T,X)),!S)return!1;if(!o.current&&"changedTouches"in u&&(y||E)&&(o.current=x),!x)return!0;var M=o.current||x;return kn(M,h,u,M==="h"?y:E,!0)},[]),l=g.useCallback(function(u){var h=u;if(!(!Q.length||Q[Q.length-1]!==r)){var $="deltaY"in h?st(h):de(h),O=n.current.filter(function(x){return x.name===h.type&&x.target===h.target&&jn(x.delta,$)})[0];if(O&&O.should){h.cancelable&&h.preventDefault();return}if(!O){var y=(c.current.shards||[]).map(lt).filter(Boolean).filter(function(x){return x.contains(h.target)}),E=y.length>0?i(h,y[0]):!c.current.noIsolation;E&&h.cancelable&&h.preventDefault()}}},[]),d=g.useCallback(function(u,h,$,O){var y={name:u,delta:h,target:$,should:O};n.current.push(y),setTimeout(function(){n.current=n.current.filter(function(E){return E!==y})},1)},[]),p=g.useCallback(function(u){t.current=de(u),o.current=void 0},[]),s=g.useCallback(function(u){d(u.type,st(u),u.target,i(u,e.lockRef.current))},[]),m=g.useCallback(function(u){d(u.type,de(u),u.target,i(u,e.lockRef.current))},[]);g.useEffect(function(){return Q.push(r),e.setCallbacks({onScrollCapture:s,onWheelCapture:s,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Z),document.addEventListener("touchmove",l,Z),document.addEventListener("touchstart",p,Z),function(){Q=Q.filter(function(u){return u!==r}),document.removeEventListener("wheel",l,Z),document.removeEventListener("touchmove",l,Z),document.removeEventListener("touchstart",p,Z)}},[]);var f=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(r,{styles:Bn(a)}):null,f?g.createElement(Tn,{gapMode:"margin"}):null)}const Hn=bn(nt,Un);var dt=g.forwardRef(function(e,n){return g.createElement(se,k({},e,{ref:n,sideCar:Hn}))});dt.classNames=se.classNames;const Gn=dt;var Vn=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},J=new WeakMap,pe=new WeakMap,fe={},De=0,pt=function(e){return e&&(e.host||pt(e.parentNode))},Kn=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=pt(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})},zn=function(e,n,t,o){var a=Kn(n,Array.isArray(e)?e:[e]);fe[t]||(fe[t]=new WeakMap);var r=fe[t],c=[],i=new Set,l=new Set(a),d=function(s){!s||i.has(s)||(i.add(s),d(s.parentNode))};a.forEach(d);var p=function(s){!s||l.has(s)||Array.prototype.forEach.call(s.children,function(m){if(i.has(m))p(m);else{var f=m.getAttribute(o),w=f!==null&&f!=="false",u=(J.get(m)||0)+1,h=(r.get(m)||0)+1;J.set(m,u),r.set(m,h),c.push(m),u===1&&w&&pe.set(m,!0),h===1&&m.setAttribute(t,"true"),w||m.setAttribute(o,"true")}})};return p(n),i.clear(),De++,function(){c.forEach(function(s){var m=J.get(s)-1,f=r.get(s)-1;J.set(s,m),r.set(s,f),m||(pe.has(s)||s.removeAttribute(o),pe.delete(s)),f||s.removeAttribute(t)}),De--,De||(J=new WeakMap,J=new WeakMap,pe=new WeakMap,fe={})}},Xn=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=n||Vn(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live]"))),zn(o,a,t,"aria-hidden")):function(){return null}};const ft="Dialog",[vt,yo]=Lt(ft),[Yn,L]=vt(ft),qn=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:a,onOpenChange:r,modal:c=!0}=e,i=P(null),l=P(null),[d=!1,p]=jt({prop:o,defaultProp:a,onChange:r});return _(Yn,{scope:n,triggerRef:i,contentRef:l,contentId:Ee(),titleId:Ee(),descriptionId:Ee(),open:d,onOpenChange:p,onOpenToggle:G(()=>p(s=>!s),[p]),modal:c},t)},Zn="DialogTrigger",Qn=C((e,n)=>{const{__scopeDialog:t,...o}=e,a=L(Zn,t),r=q(n,a.triggerRef);return _(U.button,v({type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ie(a.open)},o,{ref:r,onClick:W(e.onClick,a.onOpenToggle)}))}),ht="DialogPortal",[Jn,mt]=vt(ht,{forceMount:void 0}),er=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:a}=e,r=L(ht,n);return _(Jn,{scope:n,forceMount:t},D.map(o,c=>_(ae,{present:t||r.open},_(an,{asChild:!0,container:a},c))))},Re="DialogOverlay",tr=C((e,n)=>{const t=mt(Re,e.__scopeDialog),{forceMount:o=t.forceMount,...a}=e,r=L(Re,e.__scopeDialog);return r.modal?_(ae,{present:o||r.open},_(nr,v({},a,{ref:n}))):null}),nr=C((e,n)=>{const{__scopeDialog:t,...o}=e,a=L(Re,t);return _(Gn,{as:we,allowPinchZoom:!0,shards:[a.contentRef]},_(U.div,v({"data-state":Ie(a.open)},o,{ref:n,style:{pointerEvents:"auto",...o.style}})))}),ne="DialogContent",rr=C((e,n)=>{const t=mt(ne,e.__scopeDialog),{forceMount:o=t.forceMount,...a}=e,r=L(ne,e.__scopeDialog);return _(ae,{present:o||r.open},r.modal?_(or,v({},a,{ref:n})):_(ar,v({},a,{ref:n})))}),or=C((e,n)=>{const t=L(ne,e.__scopeDialog),o=P(null),a=q(n,t.contentRef,o);return N(()=>{const r=o.current;if(r)return Xn(r)},[]),_(gt,v({},e,{ref:a,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,r=>{var c;r.preventDefault(),(c=t.triggerRef.current)===null||c===void 0||c.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,r=>{const c=r.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&r.preventDefault()}),onFocusOutside:W(e.onFocusOutside,r=>r.preventDefault())}))}),ar=C((e,n)=>{const t=L(ne,e.__scopeDialog),o=P(!1),a=P(!1);return _(gt,v({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var c;if((c=e.onCloseAutoFocus)===null||c===void 0||c.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 c,i;(c=e.onInteractOutside)===null||c===void 0||c.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()}}))}),gt=C((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:r,...c}=e,i=L(ne,t),l=P(null),d=q(n,l);return sn(),_(oe,null,_(Qt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:r},_(Yt,v({role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Ie(i.open)},c,{ref:d,onDismiss:()=>i.onOpenChange(!1)}))),!1)}),cr="DialogTitle",ir=C((e,n)=>{const{__scopeDialog:t,...o}=e,a=L(cr,t);return _(U.h2,v({id:a.titleId},o,{ref:n}))}),ur="DialogDescription",sr=C((e,n)=>{const{__scopeDialog:t,...o}=e,a=L(ur,t);return _(U.p,v({id:a.descriptionId},o,{ref:n}))}),lr="DialogClose",dr=C((e,n)=>{const{__scopeDialog:t,...o}=e,a=L(lr,t);return _(U.button,v({type:"button"},o,{ref:n,onClick:W(e.onClick,()=>a.onOpenChange(!1))}))});function Ie(e){return e?"open":"closed"}const pr=qn,fr=Qn,vr=er,hr=tr,mr=rr,gr=ir,_t=sr,_r=dr,bt={SM:"sm",MD:"md",LG:"lg"};function br(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $t={exports:{}};/*!
42
+ Copyright (c) 2018 Jed Watson.
43
+ Licensed under the MIT License (MIT), see
44
+ http://jedwatson.github.io/classnames
45
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];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 c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($t);var $r=$t.exports;const yt=br($r),yr="_rotate_7s2g1_1",Er="_dash_7s2g1_1",ve={"purpur-spinner":"_purpur-spinner_7s2g1_1",rotate:yr,"purpur-spinner--xxs":"_purpur-spinner--xxs_7s2g1_4","purpur-spinner--xs":"_purpur-spinner--xs_7s2g1_8","purpur-spinner--sm":"_purpur-spinner--sm_7s2g1_12","purpur-spinner--md":"_purpur-spinner--md_7s2g1_16","purpur-spinner--lg":"_purpur-spinner--lg_7s2g1_20","purpur-spinner__circle":"_purpur-spinner__circle_7s2g1_24",dash:Er,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_7s2g1_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_7s2g1_36","purpur-spinner__circle--negative-disabled":"_purpur-spinner__circle--negative-disabled_7s2g1_39"},he="purpur-spinner",wr={PRIMARY:"primary",DISABLED:"disabled",NEGATIVE:"negative",NEGATIVE_DISABLED:"negative-disabled"},Sr={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},Cr=({["data-testid"]:e,size:n=Sr.SM,variant:t=wr.PRIMARY,...o})=>F("div",{className:yt([ve[he],ve[`${he}--${n}`]]),"data-testid":e,...o,children:F("svg",{viewBox:"0 0 50 50",children:F("circle",{className:yt(ve[`${he}__circle`],ve[`${he}__circle--${t}`]),cx:"25",cy:"25",r:"20"})})});function xr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et={exports:{}};/*!
46
+ Copyright (c) 2018 Jed Watson.
47
+ Licensed under the MIT License (MIT), see
48
+ http://jedwatson.github.io/classnames
49
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];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 c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(Et);var Or=Et.exports;const Pr=xr(Or),K={"purpur-button":"_purpur-button_1fna2_1","purpur-button--sm":"_purpur-button--sm_1fna2_33","purpur-button--icon-only":"_purpur-button--icon-only_1fna2_36","purpur-button--md":"_purpur-button--md_1fna2_39","purpur-button--lg":"_purpur-button--lg_1fna2_45","purpur-button--full-width":"_purpur-button--full-width_1fna2_51","purpur-button--primary":"_purpur-button--primary_1fna2_54","purpur-button--disabled":"_purpur-button--disabled_1fna2_58","purpur-button--primary-negative":"_purpur-button--primary-negative_1fna2_64","purpur-button--secondary":"_purpur-button--secondary_1fna2_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_1fna2_87","purpur-button--expressive":"_purpur-button--expressive_1fna2_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_1fna2_108","purpur-button--negative":"_purpur-button--negative_1fna2_120","purpur-button--destructive":"_purpur-button--destructive_1fna2_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_1fna2_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_1fna2_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_1fna2_160","purpur-button--text-negative":"_purpur-button--text-negative_1fna2_175","purpur-button--text":"_purpur-button--text_1fna2_175"},z="purpur-button",Nr=({children:e,className:n,["data-testid"]:t,disabled:o=!1,fullWidth:a=!1,iconOnly:r,loading:c=!1,onClick:i,size:l=bt.MD,variant:d,type:p="button",...s},m)=>{if(r&&d==="destructive")return null;const f=Pr([K[z],K[`${z}--${d}`],K[`${z}--${l}`]],{[K[`${z}--icon-only`]]:r,[K[`${z}--negative`]]:d.endsWith("negative"),[K[`${z}--full-width`]]:a,[K[`${z}--disabled`]]:o||c},n),w=h=>{o||c?h.preventDefault():i&&i(h)},u=()=>d.endsWith("negative")?"negative-disabled":"disabled";return He("button",{className:f,"data-testid":t,type:p,ref:m,"aria-disabled":s["aria-disabled"]||o||c,onClick:w,...s,children:[c&&F(Cr,{size:l===bt.LG?"xs":"xxs",variant:u()})," ",e]})},Le=C(Nr);Le.displayName="Button";function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wt={exports:{}};/*!
50
+ Copyright (c) 2018 Jed Watson.
51
+ Licensed under the MIT License (MIT), see
52
+ http://jedwatson.github.io/classnames
53
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];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 c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(wt);var Tr=wt.exports;const Dr=Ar(Tr),Me={"purpur-heading":"_purpur-heading_2c2y0_1","purpur-heading--hyphens":"_purpur-heading--hyphens_2c2y0_8","purpur-heading--subsection-100":"_purpur-heading--subsection-100_2c2y0_11","purpur-heading--title-100":"_purpur-heading--title-100_2c2y0_17","purpur-heading--title-200":"_purpur-heading--title-200_2c2y0_23","purpur-heading--title-300":"_purpur-heading--title-300_2c2y0_29","purpur-heading--title-400":"_purpur-heading--title-400_2c2y0_35","purpur-heading--title-500":"_purpur-heading--title-500_2c2y0_41","purpur-heading--title-600":"_purpur-heading--title-600_2c2y0_47","purpur-heading--title-700":"_purpur-heading--title-700_2c2y0_53","purpur-heading--display-25":"_purpur-heading--display-25_2c2y0_59","purpur-heading--display-50":"_purpur-heading--display-50_2c2y0_65","purpur-heading--display-100":"_purpur-heading--display-100_2c2y0_71","purpur-heading--display-200":"_purpur-heading--display-200_2c2y0_77"},Rr={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},Fe="purpur-heading",Ir=({["data-testid"]:e,children:n,className:t="",enableHyphenation:o=!1,tag:a,variant:r=Rr.TITLE100,...c})=>{const i=a,l=Dr([t,Me[Fe],Me[`${Fe}--${r}`],{[Me[`${Fe}--hyphens`]]:o}]);return F(i,{...c,className:l,"data-testid":e,children:n})};function Lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var St={exports:{}};/*!
54
+ Copyright (c) 2018 Jed Watson.
55
+ Licensed under the MIT License (MIT), see
56
+ http://jedwatson.github.io/classnames
57
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];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 c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,this&&this[i]||i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(St);var Mr=St.exports;const Fr=Lr(Mr),kr={"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"},jr={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"},Ct=e=>F(Vr,{...e,svg:jr});Ct.displayName="IconClose";const Br=Fr.bind(kr),xt="purpur-icon",Wr="md",Ur=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),Hr=({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 ${Ur(t)}>${o}${e}</svg>`},Gr=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),Vr=({["data-testid"]:e,svg:n,allyTitle:t,className:o="",size:a=Wr,...r})=>{const c=Hr({content:Gr(n.svg),title:t}),i=Br(o,xt,`${xt}--${a}`);return F("span",{"aria-label":t,className:i,"data-testid":e,dangerouslySetInnerHTML:{__html:c},...r})};function Kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ot={exports:{}};/*!
58
+ Copyright (c) 2018 Jed Watson.
59
+ Licensed under the MIT License (MIT), see
60
+ http://jedwatson.github.io/classnames
61
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];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 c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(Ot);var zr=Ot.exports;const Xr=Kr(zr),me={"purpur-paragraph":"_purpur-paragraph_hwaj6_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_hwaj6_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_hwaj6_10","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_hwaj6_13","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_hwaj6_19","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_hwaj6_26","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_hwaj6_33","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_hwaj6_39","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_hwaj6_45","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_hwaj6_51","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_hwaj6_57","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_hwaj6_64","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_hwaj6_71"},Yr={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"},ge="purpur-paragraph",qr=({["data-testid"]:e,children:n,className:t="",disabled:o,enableHyphenation:a=!1,variant:r=Yr.PARAGRAPH100,...c})=>{const i=Xr([t,me[ge],me[`${ge}--${r}`],{[me[`${ge}--hyphens`]]:a,[me[`${ge}--disabled`]]:o}]);return F("p",{...c,className:i,"data-testid":e,children:n})};function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ee.apply(this,arguments)}function Zr(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Qr(...e){return n=>e.forEach(t=>Zr(t,n))}const Pt=C((e,n)=>{const{children:t,...o}=e,a=D.toArray(t),r=a.find(eo);if(r){const c=r.props.children,i=a.map(l=>l===r?D.count(c)>1?D.only(null):j(c)?c.props.children:null:l);return _(ke,ee({},o,{ref:n}),j(c)?Y(c,void 0,i):null)}return _(ke,ee({},o,{ref:n}),t)});Pt.displayName="Slot";const ke=C((e,n)=>{const{children:t,...o}=e;return j(t)?Y(t,{...to(o,t.props),ref:n?Qr(n,t.ref):t.ref}):D.count(t)>1?D.only(null):null});ke.displayName="SlotClone";const Jr=({children:e})=>_(oe,null,e);function eo(e){return j(e)&&e.type===Jr}function to(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]=(...c)=>{r(...c),a(...c)}:a&&(t[o]=a):o==="style"?t[o]={...a,...r}:o==="className"&&(t[o]=[a,r].filter(Boolean).join(" "))}return{...e,...t}}const no=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ro=no.reduce((e,n)=>{const t=C((o,a)=>{const{asChild:r,...c}=o,i=r?Pt:n;return N(()=>{window[Symbol.for("radix-ui")]=!0},[]),_(i,ee({},c,{ref:a}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),oo=C((e,n)=>_(ro.span,ee({},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}}))),ao=oo,co=({asChild:e,children:n,className:t="",["data-testid"]:o})=>F(ao,{asChild:e,"data-testid":o,className:t,children:n}),io="600px";function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nt={exports:{}};/*!
62
+ Copyright (c) 2018 Jed Watson.
63
+ Licensed under the MIT License (MIT), see
64
+ http://jedwatson.github.io/classnames
65
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];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 c="";for(var i in r)n.call(r,i)&&r[i]&&(c=a(c,this&&this[i]||i));return c}function a(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(Nt);var so=Nt.exports;const lo=uo(so),po={"purpur-modal-content":"_purpur-modal-content_1fnes_1",fadeIn:"_fadeIn_1fnes_1","purpur-modal-content__overlay":"_purpur-modal-content__overlay_1fnes_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1fnes_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1fnes_48","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1fnes_59","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1fnes_68","purpur-modal-content__header":"_purpur-modal-content__header_1fnes_91","purpur-modal-content__title":"_purpur-modal-content__title_1fnes_104","purpur-modal-content__description":"_purpur-modal-content__description_1fnes_107","purpur-modal-content__body":"_purpur-modal-content__body_1fnes_110","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1fnes_120","purpur-modal-content__actions":"_purpur-modal-content__actions_1fnes_133","purpur-modal-content__button":"_purpur-modal-content__button_1fnes_145","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1fnes_156","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1fnes_156","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1fnes_194"},At=e=>e.showCloseButton===!0,R=lo.bind(po),A="purpur-modal-content",fo=C(({["data-testid"]:e,actions:n,children:t,className:o,description:a,disableCloseOnClickOutside:r,hideDescription:c,image:i,primaryActionVariant:l="primary",stickyButtons:d=!0,title:p,...s},m)=>{const{closeButtonAllyLabel:f,showCloseButton:w,...u}=s,[h,$]=B(!1),O=P(null),y=P(null),E=P(null),x=P(null),X=R([A,{[`${A}--with-image`]:!!i},{[`${A}--overflow`]:h},{[`${A}--sticky-footer`]:d},o]),T=I=>e?`${e} ${I}`:void 0,S=I=>{r&&I.preventDefault()},M=G(()=>{if(!O.current||!y.current||!E.current||!x.current)return;const I=window.innerWidth<parseInt(io),mo=window.getComputedStyle(I?O.current:E.current,null),go=parseFloat(mo.getPropertyValue("height")),_o=I?y.current.offsetHeight:x.current.offsetHeight;$(go<_o)},[]),_e=I=>{r&&!w&&I.preventDefault()};return N(()=>(window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)}),[]),b.createElement(vr,null,b.createElement(hr,{className:R(`${A}__overlay`)}),b.createElement(mr,{...u,className:X,"data-testid":e,ref:m,...!a&&{"aria-describedby":void 0},onPointerDownOutside:S,onOpenAutoFocus:M,onEscapeKeyDown:_e},b.createElement("div",{ref:O,className:R(`${A}__wrapper`)},At(s)&&f&&i&&b.createElement(Tt,{allyLabel:f,hasImage:!0,"data-testid":T("close-button")}),b.createElement("div",{ref:y,className:R(`${A}__wrapper-inner`)},b.createElement("div",{className:R(`${A}__header`)},At(s)&&f&&!i&&b.createElement(Tt,{allyLabel:f,"data-testid":T("close-button")}),b.createElement(gr,{asChild:!0,className:R(`${A}__title`),"data-testid":T("title")},b.createElement(Ir,{tag:"h2",variant:"title-200"},p))),i&&b.createElement("div",{className:R(`${A}__image-wrapper`),"data-testid":T("image")},i),b.createElement("div",{ref:E,className:R(`${A}__body`)},b.createElement("div",{ref:x,className:R(`${A}__body-inner`)},a&&b.createElement(b.Fragment,null,c?b.createElement(co,{asChild:!0},b.createElement(_t,{"data-testid":T("description")},a)):b.createElement(_t,{asChild:!0,className:R(`${A}__description`),"data-testid":T("description")},b.createElement(qr,{variant:"paragraph-100"},a))),b.createElement("div",null,t),!d&&b.createElement(Dt,{actions:n,primaryActionVariant:l}))))),d&&b.createElement(Dt,{actions:n,primaryActionVariant:l})))}),Tt=({allyLabel:e,hasImage:n,["data-testid"]:t})=>b.createElement(_r,{asChild:!0},b.createElement(Le,{variant:n?"primary-negative":"tertiary-purple",size:"sm",iconOnly:!0,"aria-label":e,className:R(`${A}__close-button`),"data-testid":t},b.createElement(Ct,null))),vo=3,Dt=({actions:e,primaryActionVariant:n})=>{const t=[n,"secondary","text"];return e&&e.length>0?b.createElement("div",{className:R(`${A}__actions`),"data-testid":"modal actions"},e.slice(0,vo).map(({label:o,onClick:a},r)=>b.createElement(Le,{key:o,"data-testid":"modal actions button",variant:t[r]||"",onClick:a,className:R(`${A}__button`)},o))):null},ho=C(({["data-testid"]:e,children:n,className:t,...o},a)=>b.createElement(fr,{asChild:!0,ref:a,"data-testid":e,className:t,...o},n)),je=Rt("Modal",({["data-testid"]:e,children:n,open:t,onOpenChange:o})=>b.createElement(pr,{open:t,onOpenChange:o,"data-testid":e},n));je.Trigger=ho,je.Content=fo,je.displayName="Modal"}}});
66
+ //# sourceMappingURL=modal.system.js.map