@purpurds/modal 5.34.4 → 6.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.
- package/dist/LICENSE.txt +5 -5
- package/dist/modal.cjs.js +7 -7
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.es.js +35 -41
- package/dist/modal.es.js.map +1 -1
- package/package.json +9 -9
- package/src/modal-content.tsx +1 -1
- package/src/modal.stories.tsx +2 -1
package/dist/LICENSE.txt
CHANGED
|
@@ -423,35 +423,35 @@ Homepage: https://radix-ui.com/primitives
|
|
|
423
423
|
---
|
|
424
424
|
|
|
425
425
|
Name: @purpurds/button
|
|
426
|
-
Version: 5.
|
|
426
|
+
Version: 5.35.0
|
|
427
427
|
License: AGPL-3.0-only
|
|
428
428
|
Private: false
|
|
429
429
|
|
|
430
430
|
---
|
|
431
431
|
|
|
432
432
|
Name: @purpurds/heading
|
|
433
|
-
Version: 5.
|
|
433
|
+
Version: 5.35.0
|
|
434
434
|
License: AGPL-3.0-only
|
|
435
435
|
Private: false
|
|
436
436
|
|
|
437
437
|
---
|
|
438
438
|
|
|
439
439
|
Name: @purpurds/icon
|
|
440
|
-
Version: 5.
|
|
440
|
+
Version: 5.35.0
|
|
441
441
|
License: AGPL-3.0-only
|
|
442
442
|
Private: false
|
|
443
443
|
|
|
444
444
|
---
|
|
445
445
|
|
|
446
446
|
Name: @purpurds/paragraph
|
|
447
|
-
Version: 5.
|
|
447
|
+
Version: 5.35.0
|
|
448
448
|
License: AGPL-3.0-only
|
|
449
449
|
Private: false
|
|
450
450
|
|
|
451
451
|
---
|
|
452
452
|
|
|
453
453
|
Name: @purpurds/visually-hidden
|
|
454
|
-
Version: 5.
|
|
454
|
+
Version: 5.35.0
|
|
455
455
|
License: AGPL-3.0-only
|
|
456
456
|
Private: false
|
|
457
457
|
|
package/dist/modal.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 Nt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,a]=Pt({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 Pt({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"],L=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",Lt="dismissableLayer.pointerDownOutside",Mt="dismissableLayer.focusOutside";let Ne;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,M=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),P=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&&(Ne=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),Pe(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ne)}},[d,h,o,p]),c.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),Pe())},[d,p]),c.useEffect(()=>{const w=()=>E({});return document.addEventListener($e,w),()=>document.removeEventListener($e,w)},[]),c.createElement(L.div,O({},f,{ref:s,style:{pointerEvents:$?x?"auto":"none":void 0,...e.style},onFocusCapture:I(e.onFocusCapture,P.onFocusCapture),onBlurCapture:I(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,M.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(){Xe(Lt,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&&Xe(Mt,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 Pe(){const e=new CustomEvent($e);document.dispatchEvent(e)}function Xe(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(Kt(Ke(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(L.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=Ke(e),t=Re(n,e),o=Re(n.reverse(),e);return[t,o]}function Ke(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=Xt();function Xt(){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 Kt(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(L.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"),`
|
|
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
2
|
.`.concat(en,` {
|
|
3
3
|
overflow: hidden `).concat(o,`;
|
|
4
4
|
padding-right: `).concat(i,"px ").concat(o,`;
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
body[`).concat(W,`] {
|
|
36
36
|
`).concat(tn,": ").concat(i,`px;
|
|
37
37
|
}
|
|
38
|
-
`)},
|
|
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`
|
|
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,
|
|
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:{}};/*!
|
|
42
42
|
Copyright (c) 2018 Jed Watson.
|
|
43
43
|
Licensed under the MIT License (MIT), see
|
|
44
44
|
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"},
|
|
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:{}};/*!
|
|
46
46
|
Copyright (c) 2018 Jed Watson.
|
|
47
47
|
Licensed under the MIT License (MIT), see
|
|
48
48
|
http://jedwatson.github.io/classnames
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
Copyright (c) 2018 Jed Watson.
|
|
55
55
|
Licensed under the MIT License (MIT), see
|
|
56
56
|
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
|
|
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:{}};/*!
|
|
58
58
|
Copyright (c) 2018 Jed Watson.
|
|
59
59
|
Licensed under the MIT License (MIT), see
|
|
60
60
|
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
|
|
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:{}};/*!
|
|
62
62
|
Copyright (c) 2018 Jed Watson.
|
|
63
63
|
Licensed under the MIT License (MIT), see
|
|
64
64
|
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,
|
|
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;
|
|
66
66
|
//# sourceMappingURL=modal.cjs.js.map
|