@townco/gui-template 0.1.13 → 0.1.14
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/assets/{acp-sdk-CrAUv_2m.js → acp-sdk-BiGbXeF1.js} +1 -1
- package/dist/assets/{icons-Dn0pjvgj.js → icons-BtPq83UA.js} +1 -1
- package/dist/assets/{index-9OV0HYRI.js → index-BQ9Vy_PH.js} +2 -2
- package/dist/assets/{markdown-CwEbCfit.js → markdown-DP5OEpQP.js} +1 -1
- package/dist/assets/{radix-BPjk4-Jl.js → radix-C1pEulHa.js} +1 -1
- package/dist/assets/react-DWDN8s0r.js +49 -0
- package/dist/assets/vendor-BxtqxsLB.js +48 -0
- package/dist/index.html +7 -7
- package/package.json +3 -3
- package/dist/assets/react-CIcriR6k.js +0 -61
- package/dist/assets/vendor--IKG6KWl.js +0 -48
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as s,R as st,j as l,a as pe,b as at,c as zo,d as it}from"./react-CIcriR6k.js";import{h as ct,i as Yo,j as Xo,k as qo,m as Zo,p as Jo,q as Qo,t as er,v as tr,w as nr}from"./vendor--IKG6KWl.js";function Pt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function be(...e){return t=>{let n=!1;const o=e.map(r=>{const a=Pt(r,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():Pt(e[r],null)}}}}function M(...e){return s.useCallback(be(...e),e)}var or=Symbol.for("react.lazy"),_e=st[" use ".trim().toString()];function rr(e){return typeof e=="object"&&e!==null&&"then"in e}function Lt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===or&&"_payload"in e&&rr(e._payload)}function kt(e){const t=sr(e),n=s.forwardRef((o,r)=>{let{children:a,...c}=o;Lt(a)&&typeof _e=="function"&&(a=_e(a._payload));const i=s.Children.toArray(a),u=i.find(ir);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}var qa=kt("Slot");function sr(e){const t=s.forwardRef((n,o)=>{let{children:r,...a}=n;if(Lt(r)&&typeof _e=="function"&&(r=_e(r._payload)),s.isValidElement(r)){const c=lr(r),i=cr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ar=Symbol("radix.slottable");function ir(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ar}function cr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function lr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function E(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function ur(e,t){const n=s.createContext(t),o=a=>{const{children:c,...i}=a,u=s.useMemo(()=>i,Object.values(i));return l.jsx(n.Provider,{value:u,children:c})};o.displayName=e+"Provider";function r(a){const c=s.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function le(e,t=[]){let n=[];function o(a,c){const i=s.createContext(c),u=n.length;n=[...n,c];const d=p=>{const{scope:v,children:y,...C}=p,m=v?.[e]?.[u]||i,h=s.useMemo(()=>C,Object.values(C));return l.jsx(m.Provider,{value:h,children:y})};d.displayName=a+"Provider";function f(p,v){const y=v?.[e]?.[u]||i,C=s.useContext(y);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=n.map(c=>s.createContext(c));return function(i){const u=i?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return r.scopeName=e,[o,dr(r,...t)]}function dr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const c=o.reduce((i,{useScope:u,scopeName:d})=>{const p=u(a)[`__scope${d}`];return{...i,...p}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function xe(e){const t=fr(e),n=s.forwardRef((o,r)=>{const{children:a,...c}=o,i=s.Children.toArray(a),u=i.find(mr);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function fr(e){const t=s.forwardRef((n,o)=>{const{children:r,...a}=n;if(s.isValidElement(r)){const c=hr(r),i=vr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pr=Symbol("radix.slottable");function mr(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pr}function vr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function hr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lt(e){const t=e+"CollectionProvider",[n,o]=le(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:h,children:x}=m,g=pe.useRef(null),w=pe.useRef(new Map).current;return l.jsx(r,{scope:h,itemMap:w,collectionRef:g,children:x})};c.displayName=t;const i=e+"CollectionSlot",u=xe(i),d=pe.forwardRef((m,h)=>{const{scope:x,children:g}=m,w=a(i,x),R=M(h,w.collectionRef);return l.jsx(u,{ref:R,children:g})});d.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",v=xe(f),y=pe.forwardRef((m,h)=>{const{scope:x,children:g,...w}=m,R=pe.useRef(null),T=M(h,R),F=a(f,x);return pe.useEffect(()=>(F.itemMap.set(R,{ref:R,...w}),()=>void F.itemMap.delete(R))),l.jsx(v,{[p]:"",ref:T,children:g})});y.displayName=f;function C(m){const h=a(e+"CollectionConsumer",m);return pe.useCallback(()=>{const g=h.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((F,I)=>w.indexOf(F.ref.current)-w.indexOf(I.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:c,Slot:d,ItemSlot:y},C,o]}var U=globalThis?.document?s.useLayoutEffect:()=>{},gr=st[" useId ".trim().toString()]||(()=>{}),xr=0;function De(e){const[t,n]=s.useState(gr());return U(()=>{n(o=>o??String(xr++))},[e]),t?`radix-${t}`:""}var wr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],P=wr.reduce((e,t)=>{const n=xe(`Primitive.${t}`),o=s.forwardRef((r,a)=>{const{asChild:c,...i}=r,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...i,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function $t(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ae(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>t.current?.(...n),[])}var yr=st[" useInsertionEffect ".trim().toString()]||U;function Bt({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,c]=Cr({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,o])}const d=s.useCallback(f=>{if(i){const p=Sr(f)?f(e):f;p!==e&&c.current?.(p)}else a(f)},[i,e,a,c]);return[u,d]}function Cr({defaultProp:e,onChange:t}){const[n,o]=s.useState(e),r=s.useRef(n),a=s.useRef(t);return yr(()=>{a.current=t},[t]),s.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}function Sr(e){return typeof e=="function"}var Er=s.createContext(void 0);function Ut(e){const t=s.useContext(Er);return e||t||"ltr"}var ze="rovingFocusGroup.onEntryFocus",br={bubbles:!1,cancelable:!0},Re="RovingFocusGroup",[Ze,Kt,Rr]=lt(Re),[Ir,Oe]=le(Re,[Rr]),[Pr,_r]=Ir(Re),Wt=s.forwardRef((e,t)=>l.jsx(Ze.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ze.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Mr,{...e,ref:t})})}));Wt.displayName=Re;var Mr=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,v=s.useRef(null),y=M(t,v),C=Ut(a),[m,h]=Bt({prop:c,defaultProp:i??null,onChange:u,caller:Re}),[x,g]=s.useState(!1),w=ae(d),R=Kt(n),T=s.useRef(!1),[F,I]=s.useState(0);return s.useEffect(()=>{const _=v.current;if(_)return _.addEventListener(ze,w),()=>_.removeEventListener(ze,w)},[w]),l.jsx(Pr,{scope:n,orientation:o,dir:C,loop:r,currentTabStopId:m,onItemFocus:s.useCallback(_=>h(_),[h]),onItemShiftTab:s.useCallback(()=>g(!0),[]),onFocusableItemAdd:s.useCallback(()=>I(_=>_+1),[]),onFocusableItemRemove:s.useCallback(()=>I(_=>_-1),[]),children:l.jsx(P.div,{tabIndex:x||F===0?-1:0,"data-orientation":o,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{T.current=!0}),onFocus:E(e.onFocus,_=>{const $=!T.current;if(_.target===_.currentTarget&&$&&!x){const L=new CustomEvent(ze,br);if(_.currentTarget.dispatchEvent(L),!L.defaultPrevented){const B=R().filter(k=>k.focusable),K=B.find(k=>k.active),W=B.find(k=>k.id===m),H=[K,W,...B].filter(Boolean).map(k=>k.ref.current);Ht(H,f)}}T.current=!1}),onBlur:E(e.onBlur,()=>g(!1))})})}),Gt="RovingFocusGroupItem",Vt=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:a,children:c,...i}=e,u=De(),d=a||u,f=_r(Gt,n),p=f.currentTabStopId===d,v=Kt(n),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:m}=f;return s.useEffect(()=>{if(o)return y(),()=>C()},[o,y,C]),l.jsx(Ze.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:l.jsx(P.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:E(e.onMouseDown,h=>{o?f.onItemFocus(d):h.preventDefault()}),onFocus:E(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:E(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const x=Ar(h,f.orientation,f.dir);if(x!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=v().filter(R=>R.focusable).map(R=>R.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const R=w.indexOf(h.currentTarget);w=f.loop?Dr(w,R+1):w.slice(R+1)}setTimeout(()=>Ht(w))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:m!=null}):c})})});Vt.displayName=Gt;var Tr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ar(e,t,n){const o=Nr(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Tr[o]}function Ht(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Dr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var zt=Wt,Yt=Vt;function Or(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var ie=e=>{const{present:t,children:n}=e,o=jr(t),r=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),a=M(o.ref,Fr(r));return typeof n=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};ie.displayName="Presence";function jr(e){const[t,n]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),c=e?"mounted":"unmounted",[i,u]=Or(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=Pe(o.current);a.current=i==="mounted"?d:"none"},[i]),U(()=>{const d=o.current,f=r.current;if(f!==e){const v=a.current,y=Pe(d);e?u("MOUNT"):y==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&v!==y?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),U(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=y=>{const m=Pe(o.current).includes(CSS.escape(y.animationName));if(y.target===t&&m&&(u("ANIMATION_END"),!r.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},v=y=>{y.target===t&&(a.current=Pe(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:s.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function Pe(e){return e?.animationName||"none"}function Fr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var je="Tabs",[Lr]=le(je,[Oe]),Xt=Oe(),[kr,ut]=Lr(je),qt=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:c="horizontal",dir:i,activationMode:u="automatic",...d}=e,f=Ut(i),[p,v]=Bt({prop:o,onChange:r,defaultProp:a??"",caller:je});return l.jsx(kr,{scope:n,baseId:De(),value:p,onValueChange:v,orientation:c,dir:f,activationMode:u,children:l.jsx(P.div,{dir:f,"data-orientation":c,...d,ref:t})})});qt.displayName=je;var Zt="TabsList",Jt=s.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=ut(Zt,n),c=Xt(n);return l.jsx(zt,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:o,children:l.jsx(P.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});Jt.displayName=Zt;var Qt="TabsTrigger",en=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,c=ut(Qt,n),i=Xt(n),u=on(c.baseId,o),d=rn(c.baseId,o),f=o===c.value;return l.jsx(Yt,{asChild:!0,...i,focusable:!r,active:f,children:l.jsx(P.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...a,ref:t,onMouseDown:E(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?c.onValueChange(o):p.preventDefault()}),onKeyDown:E(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(o)}),onFocus:E(e.onFocus,()=>{const p=c.activationMode!=="manual";!f&&!r&&p&&c.onValueChange(o)})})})});en.displayName=Qt;var tn="TabsContent",nn=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:a,...c}=e,i=ut(tn,n),u=on(i.baseId,o),d=rn(i.baseId,o),f=o===i.value,p=s.useRef(f);return s.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),l.jsx(ie,{present:r||f,children:({present:v})=>l.jsx(P.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});nn.displayName=tn;function on(e,t){return`${e}-trigger-${t}`}function rn(e,t){return`${e}-content-${t}`}var Za=qt,Ja=Jt,Qa=en,ei=nn;function $r(e,t=globalThis?.document){const n=ae(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Br="DismissableLayer",Je="dismissableLayer.update",Ur="dismissableLayer.pointerDownOutside",Kr="dismissableLayer.focusOutside",_t,sn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:c,onDismiss:i,...u}=e,d=s.useContext(sn),[f,p]=s.useState(null),v=f?.ownerDocument??globalThis?.document,[,y]=s.useState({}),C=M(t,I=>p(I)),m=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(h),g=f?m.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,R=g>=x,T=Vr(I=>{const _=I.target,$=[...d.branches].some(L=>L.contains(_));!R||$||(r?.(I),c?.(I),I.defaultPrevented||i?.())},v),F=Hr(I=>{const _=I.target;[...d.branches].some(L=>L.contains(_))||(a?.(I),c?.(I),I.defaultPrevented||i?.())},v);return $r(I=>{g===d.layers.size-1&&(o?.(I),!I.defaultPrevented&&i&&(I.preventDefault(),i()))},v),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_t=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Mt(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=_t)}},[f,v,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Mt())},[f,d]),s.useEffect(()=>{const I=()=>y({});return document.addEventListener(Je,I),()=>document.removeEventListener(Je,I)},[]),l.jsx(P.div,{...u,ref:C,style:{pointerEvents:w?R?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,F.onFocusCapture),onBlurCapture:E(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,T.onPointerDownCapture)})});Fe.displayName=Br;var Wr="DismissableLayerBranch",Gr=s.forwardRef((e,t)=>{const n=s.useContext(sn),o=s.useRef(null),r=M(t,o);return s.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(P.div,{...e,ref:r})});Gr.displayName=Wr;function Vr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=i=>{if(i.target&&!o.current){let u=function(){an(Ur,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Hr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&an(Kr,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Mt(){const e=new CustomEvent(Je);document.dispatchEvent(e)}function an(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?$t(r,a):r.dispatchEvent(a)}var Ye="focusScope.autoFocusOnMount",Xe="focusScope.autoFocusOnUnmount",Tt={bubbles:!1,cancelable:!0},zr="FocusScope",Le=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...c}=e,[i,u]=s.useState(null),d=ae(r),f=ae(a),p=s.useRef(null),v=M(t,m=>u(m)),y=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let m=function(w){if(y.paused||!i)return;const R=w.target;i.contains(R)?p.current=R:ce(p.current,{select:!0})},h=function(w){if(y.paused||!i)return;const R=w.relatedTarget;R!==null&&(i.contains(R)||ce(p.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&ce(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",h);const g=new MutationObserver(x);return i&&g.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",h),g.disconnect()}}},[o,i,y.paused]),s.useEffect(()=>{if(i){At.add(y);const m=document.activeElement;if(!i.contains(m)){const x=new CustomEvent(Ye,Tt);i.addEventListener(Ye,d),i.dispatchEvent(x),x.defaultPrevented||(Yr(Qr(cn(i)),{select:!0}),document.activeElement===m&&ce(i))}return()=>{i.removeEventListener(Ye,d),setTimeout(()=>{const x=new CustomEvent(Xe,Tt);i.addEventListener(Xe,f),i.dispatchEvent(x),x.defaultPrevented||ce(m??document.body,{select:!0}),i.removeEventListener(Xe,f),At.remove(y)},0)}}},[i,d,f,y]);const C=s.useCallback(m=>{if(!n&&!o||y.paused)return;const h=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(h&&x){const g=m.currentTarget,[w,R]=Xr(g);w&&R?!m.shiftKey&&x===R?(m.preventDefault(),n&&ce(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&ce(R,{select:!0})):x===g&&m.preventDefault()}},[n,o,y.paused]);return l.jsx(P.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})});Le.displayName=zr;function Yr(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ce(o,{select:t}),document.activeElement!==n)return}function Xr(e){const t=cn(e),n=Nt(t,e),o=Nt(t.reverse(),e);return[n,o]}function cn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nt(e,t){for(const n of e)if(!qr(n,{upTo:t}))return n}function qr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Zr(e){return e instanceof HTMLInputElement&&"select"in e}function ce(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zr(e)&&t&&e.select()}}var At=Jr();function Jr(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Dt(e,t),e.unshift(t)},remove(t){e=Dt(e,t),e[0]?.resume()}}}function Dt(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Qr(e){return e.filter(t=>t.tagName!=="A")}var es="Portal",ke=s.forwardRef((e,t)=>{const{container:n,...o}=e,[r,a]=s.useState(!1);U(()=>a(!0),[]);const c=n||r&&globalThis?.document?.body;return c?zo.createPortal(l.jsx(P.div,{...o,ref:t}),c):null});ke.displayName=es;var qe=0;function dt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ot()),document.body.insertAdjacentElement("beforeend",e[1]??Ot()),qe++,()=>{qe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qe--}},[])}function Ot(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ln="Dialog",[un]=le(ln),[ti,oe]=un(ln),dn="DialogTrigger",ts=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(dn,n),a=M(t,r.triggerRef);return l.jsx(P.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":mt(r.open),...o,ref:a,onClick:E(e.onClick,r.onOpenToggle)})});ts.displayName=dn;var ft="DialogPortal",[ns,fn]=un(ft,{forceMount:void 0}),pn=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=oe(ft,t);return l.jsx(ns,{scope:t,forceMount:n,children:s.Children.map(o,c=>l.jsx(ie,{present:n||a.open,children:l.jsx(ke,{asChild:!0,container:r,children:c})}))})};pn.displayName=ft;var Me="DialogOverlay",mn=s.forwardRef((e,t)=>{const n=fn(Me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(Me,e.__scopeDialog);return a.modal?l.jsx(ie,{present:o||a.open,children:l.jsx(rs,{...r,ref:t})}):null});mn.displayName=Me;var os=xe("DialogOverlay.RemoveScroll"),rs=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(Me,n);return l.jsx(it,{as:os,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(P.div,{"data-state":mt(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),me="DialogContent",vn=s.forwardRef((e,t)=>{const n=fn(me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(me,e.__scopeDialog);return l.jsx(ie,{present:o||a.open,children:a.modal?l.jsx(ss,{...r,ref:t}):l.jsx(as,{...r,ref:t})})});vn.displayName=me;var ss=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(null),r=M(t,n.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return ct(a)},[]),l.jsx(hn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&a.preventDefault()}),onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault())})}),as=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return l.jsx(hn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=a.target;n.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),hn=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...c}=e,i=oe(me,n),u=s.useRef(null),d=M(t,u);return dt(),l.jsxs(l.Fragment,{children:[l.jsx(Le,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:l.jsx(Fe,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":mt(i.open),...c,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(is,{titleId:i.titleId}),l.jsx(ls,{contentRef:u,descriptionId:i.descriptionId})]})]})}),pt="DialogTitle",gn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(pt,n);return l.jsx(P.h2,{id:r.titleId,...o,ref:t})});gn.displayName=pt;var xn="DialogDescription",wn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(xn,n);return l.jsx(P.p,{id:r.descriptionId,...o,ref:t})});wn.displayName=xn;var yn="DialogClose",Cn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(yn,n);return l.jsx(P.button,{type:"button",...o,ref:t,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Cn.displayName=yn;function mt(e){return e?"open":"closed"}var Sn="DialogTitleWarning",[ni,En]=ur(Sn,{contentName:me,titleName:pt,docsSlug:"dialog"}),is=({titleId:e})=>{const t=En(Sn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1
|
+
import{r as s,R as st,j as l,a as pe,b as at,c as zo,d as it}from"./react-DWDN8s0r.js";import{h as ct,i as Yo,j as Xo,k as qo,m as Zo,p as Jo,q as Qo,t as er,v as tr,w as nr}from"./vendor-BxtqxsLB.js";function Pt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function be(...e){return t=>{let n=!1;const o=e.map(r=>{const a=Pt(r,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():Pt(e[r],null)}}}}function M(...e){return s.useCallback(be(...e),e)}var or=Symbol.for("react.lazy"),_e=st[" use ".trim().toString()];function rr(e){return typeof e=="object"&&e!==null&&"then"in e}function Lt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===or&&"_payload"in e&&rr(e._payload)}function kt(e){const t=sr(e),n=s.forwardRef((o,r)=>{let{children:a,...c}=o;Lt(a)&&typeof _e=="function"&&(a=_e(a._payload));const i=s.Children.toArray(a),u=i.find(ir);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}var qa=kt("Slot");function sr(e){const t=s.forwardRef((n,o)=>{let{children:r,...a}=n;if(Lt(r)&&typeof _e=="function"&&(r=_e(r._payload)),s.isValidElement(r)){const c=lr(r),i=cr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ar=Symbol("radix.slottable");function ir(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ar}function cr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function lr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function E(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function ur(e,t){const n=s.createContext(t),o=a=>{const{children:c,...i}=a,u=s.useMemo(()=>i,Object.values(i));return l.jsx(n.Provider,{value:u,children:c})};o.displayName=e+"Provider";function r(a){const c=s.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function le(e,t=[]){let n=[];function o(a,c){const i=s.createContext(c),u=n.length;n=[...n,c];const d=p=>{const{scope:v,children:y,...C}=p,m=v?.[e]?.[u]||i,h=s.useMemo(()=>C,Object.values(C));return l.jsx(m.Provider,{value:h,children:y})};d.displayName=a+"Provider";function f(p,v){const y=v?.[e]?.[u]||i,C=s.useContext(y);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=n.map(c=>s.createContext(c));return function(i){const u=i?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return r.scopeName=e,[o,dr(r,...t)]}function dr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const c=o.reduce((i,{useScope:u,scopeName:d})=>{const p=u(a)[`__scope${d}`];return{...i,...p}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function xe(e){const t=fr(e),n=s.forwardRef((o,r)=>{const{children:a,...c}=o,i=s.Children.toArray(a),u=i.find(mr);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function fr(e){const t=s.forwardRef((n,o)=>{const{children:r,...a}=n;if(s.isValidElement(r)){const c=hr(r),i=vr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pr=Symbol("radix.slottable");function mr(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pr}function vr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function hr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lt(e){const t=e+"CollectionProvider",[n,o]=le(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:h,children:x}=m,g=pe.useRef(null),w=pe.useRef(new Map).current;return l.jsx(r,{scope:h,itemMap:w,collectionRef:g,children:x})};c.displayName=t;const i=e+"CollectionSlot",u=xe(i),d=pe.forwardRef((m,h)=>{const{scope:x,children:g}=m,w=a(i,x),R=M(h,w.collectionRef);return l.jsx(u,{ref:R,children:g})});d.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",v=xe(f),y=pe.forwardRef((m,h)=>{const{scope:x,children:g,...w}=m,R=pe.useRef(null),T=M(h,R),F=a(f,x);return pe.useEffect(()=>(F.itemMap.set(R,{ref:R,...w}),()=>void F.itemMap.delete(R))),l.jsx(v,{[p]:"",ref:T,children:g})});y.displayName=f;function C(m){const h=a(e+"CollectionConsumer",m);return pe.useCallback(()=>{const g=h.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((F,I)=>w.indexOf(F.ref.current)-w.indexOf(I.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:c,Slot:d,ItemSlot:y},C,o]}var U=globalThis?.document?s.useLayoutEffect:()=>{},gr=st[" useId ".trim().toString()]||(()=>{}),xr=0;function De(e){const[t,n]=s.useState(gr());return U(()=>{n(o=>o??String(xr++))},[e]),t?`radix-${t}`:""}var wr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],P=wr.reduce((e,t)=>{const n=xe(`Primitive.${t}`),o=s.forwardRef((r,a)=>{const{asChild:c,...i}=r,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...i,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function $t(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ae(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>t.current?.(...n),[])}var yr=st[" useInsertionEffect ".trim().toString()]||U;function Bt({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,c]=Cr({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,o])}const d=s.useCallback(f=>{if(i){const p=Sr(f)?f(e):f;p!==e&&c.current?.(p)}else a(f)},[i,e,a,c]);return[u,d]}function Cr({defaultProp:e,onChange:t}){const[n,o]=s.useState(e),r=s.useRef(n),a=s.useRef(t);return yr(()=>{a.current=t},[t]),s.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}function Sr(e){return typeof e=="function"}var Er=s.createContext(void 0);function Ut(e){const t=s.useContext(Er);return e||t||"ltr"}var ze="rovingFocusGroup.onEntryFocus",br={bubbles:!1,cancelable:!0},Re="RovingFocusGroup",[Ze,Kt,Rr]=lt(Re),[Ir,Oe]=le(Re,[Rr]),[Pr,_r]=Ir(Re),Wt=s.forwardRef((e,t)=>l.jsx(Ze.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ze.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Mr,{...e,ref:t})})}));Wt.displayName=Re;var Mr=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,v=s.useRef(null),y=M(t,v),C=Ut(a),[m,h]=Bt({prop:c,defaultProp:i??null,onChange:u,caller:Re}),[x,g]=s.useState(!1),w=ae(d),R=Kt(n),T=s.useRef(!1),[F,I]=s.useState(0);return s.useEffect(()=>{const _=v.current;if(_)return _.addEventListener(ze,w),()=>_.removeEventListener(ze,w)},[w]),l.jsx(Pr,{scope:n,orientation:o,dir:C,loop:r,currentTabStopId:m,onItemFocus:s.useCallback(_=>h(_),[h]),onItemShiftTab:s.useCallback(()=>g(!0),[]),onFocusableItemAdd:s.useCallback(()=>I(_=>_+1),[]),onFocusableItemRemove:s.useCallback(()=>I(_=>_-1),[]),children:l.jsx(P.div,{tabIndex:x||F===0?-1:0,"data-orientation":o,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{T.current=!0}),onFocus:E(e.onFocus,_=>{const $=!T.current;if(_.target===_.currentTarget&&$&&!x){const L=new CustomEvent(ze,br);if(_.currentTarget.dispatchEvent(L),!L.defaultPrevented){const B=R().filter(k=>k.focusable),K=B.find(k=>k.active),W=B.find(k=>k.id===m),H=[K,W,...B].filter(Boolean).map(k=>k.ref.current);Ht(H,f)}}T.current=!1}),onBlur:E(e.onBlur,()=>g(!1))})})}),Gt="RovingFocusGroupItem",Vt=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:a,children:c,...i}=e,u=De(),d=a||u,f=_r(Gt,n),p=f.currentTabStopId===d,v=Kt(n),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:m}=f;return s.useEffect(()=>{if(o)return y(),()=>C()},[o,y,C]),l.jsx(Ze.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:l.jsx(P.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:E(e.onMouseDown,h=>{o?f.onItemFocus(d):h.preventDefault()}),onFocus:E(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:E(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const x=Ar(h,f.orientation,f.dir);if(x!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=v().filter(R=>R.focusable).map(R=>R.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const R=w.indexOf(h.currentTarget);w=f.loop?Dr(w,R+1):w.slice(R+1)}setTimeout(()=>Ht(w))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:m!=null}):c})})});Vt.displayName=Gt;var Tr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ar(e,t,n){const o=Nr(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Tr[o]}function Ht(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Dr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var zt=Wt,Yt=Vt;function Or(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var ie=e=>{const{present:t,children:n}=e,o=jr(t),r=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),a=M(o.ref,Fr(r));return typeof n=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};ie.displayName="Presence";function jr(e){const[t,n]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),c=e?"mounted":"unmounted",[i,u]=Or(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=Pe(o.current);a.current=i==="mounted"?d:"none"},[i]),U(()=>{const d=o.current,f=r.current;if(f!==e){const v=a.current,y=Pe(d);e?u("MOUNT"):y==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&v!==y?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),U(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=y=>{const m=Pe(o.current).includes(CSS.escape(y.animationName));if(y.target===t&&m&&(u("ANIMATION_END"),!r.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},v=y=>{y.target===t&&(a.current=Pe(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:s.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function Pe(e){return e?.animationName||"none"}function Fr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var je="Tabs",[Lr]=le(je,[Oe]),Xt=Oe(),[kr,ut]=Lr(je),qt=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:c="horizontal",dir:i,activationMode:u="automatic",...d}=e,f=Ut(i),[p,v]=Bt({prop:o,onChange:r,defaultProp:a??"",caller:je});return l.jsx(kr,{scope:n,baseId:De(),value:p,onValueChange:v,orientation:c,dir:f,activationMode:u,children:l.jsx(P.div,{dir:f,"data-orientation":c,...d,ref:t})})});qt.displayName=je;var Zt="TabsList",Jt=s.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=ut(Zt,n),c=Xt(n);return l.jsx(zt,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:o,children:l.jsx(P.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});Jt.displayName=Zt;var Qt="TabsTrigger",en=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,c=ut(Qt,n),i=Xt(n),u=on(c.baseId,o),d=rn(c.baseId,o),f=o===c.value;return l.jsx(Yt,{asChild:!0,...i,focusable:!r,active:f,children:l.jsx(P.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...a,ref:t,onMouseDown:E(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?c.onValueChange(o):p.preventDefault()}),onKeyDown:E(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(o)}),onFocus:E(e.onFocus,()=>{const p=c.activationMode!=="manual";!f&&!r&&p&&c.onValueChange(o)})})})});en.displayName=Qt;var tn="TabsContent",nn=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:a,...c}=e,i=ut(tn,n),u=on(i.baseId,o),d=rn(i.baseId,o),f=o===i.value,p=s.useRef(f);return s.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),l.jsx(ie,{present:r||f,children:({present:v})=>l.jsx(P.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});nn.displayName=tn;function on(e,t){return`${e}-trigger-${t}`}function rn(e,t){return`${e}-content-${t}`}var Za=qt,Ja=Jt,Qa=en,ei=nn;function $r(e,t=globalThis?.document){const n=ae(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Br="DismissableLayer",Je="dismissableLayer.update",Ur="dismissableLayer.pointerDownOutside",Kr="dismissableLayer.focusOutside",_t,sn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:c,onDismiss:i,...u}=e,d=s.useContext(sn),[f,p]=s.useState(null),v=f?.ownerDocument??globalThis?.document,[,y]=s.useState({}),C=M(t,I=>p(I)),m=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(h),g=f?m.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,R=g>=x,T=Vr(I=>{const _=I.target,$=[...d.branches].some(L=>L.contains(_));!R||$||(r?.(I),c?.(I),I.defaultPrevented||i?.())},v),F=Hr(I=>{const _=I.target;[...d.branches].some(L=>L.contains(_))||(a?.(I),c?.(I),I.defaultPrevented||i?.())},v);return $r(I=>{g===d.layers.size-1&&(o?.(I),!I.defaultPrevented&&i&&(I.preventDefault(),i()))},v),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_t=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Mt(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=_t)}},[f,v,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Mt())},[f,d]),s.useEffect(()=>{const I=()=>y({});return document.addEventListener(Je,I),()=>document.removeEventListener(Je,I)},[]),l.jsx(P.div,{...u,ref:C,style:{pointerEvents:w?R?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,F.onFocusCapture),onBlurCapture:E(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,T.onPointerDownCapture)})});Fe.displayName=Br;var Wr="DismissableLayerBranch",Gr=s.forwardRef((e,t)=>{const n=s.useContext(sn),o=s.useRef(null),r=M(t,o);return s.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(P.div,{...e,ref:r})});Gr.displayName=Wr;function Vr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=i=>{if(i.target&&!o.current){let u=function(){an(Ur,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Hr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&an(Kr,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Mt(){const e=new CustomEvent(Je);document.dispatchEvent(e)}function an(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?$t(r,a):r.dispatchEvent(a)}var Ye="focusScope.autoFocusOnMount",Xe="focusScope.autoFocusOnUnmount",Tt={bubbles:!1,cancelable:!0},zr="FocusScope",Le=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...c}=e,[i,u]=s.useState(null),d=ae(r),f=ae(a),p=s.useRef(null),v=M(t,m=>u(m)),y=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let m=function(w){if(y.paused||!i)return;const R=w.target;i.contains(R)?p.current=R:ce(p.current,{select:!0})},h=function(w){if(y.paused||!i)return;const R=w.relatedTarget;R!==null&&(i.contains(R)||ce(p.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&ce(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",h);const g=new MutationObserver(x);return i&&g.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",h),g.disconnect()}}},[o,i,y.paused]),s.useEffect(()=>{if(i){At.add(y);const m=document.activeElement;if(!i.contains(m)){const x=new CustomEvent(Ye,Tt);i.addEventListener(Ye,d),i.dispatchEvent(x),x.defaultPrevented||(Yr(Qr(cn(i)),{select:!0}),document.activeElement===m&&ce(i))}return()=>{i.removeEventListener(Ye,d),setTimeout(()=>{const x=new CustomEvent(Xe,Tt);i.addEventListener(Xe,f),i.dispatchEvent(x),x.defaultPrevented||ce(m??document.body,{select:!0}),i.removeEventListener(Xe,f),At.remove(y)},0)}}},[i,d,f,y]);const C=s.useCallback(m=>{if(!n&&!o||y.paused)return;const h=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(h&&x){const g=m.currentTarget,[w,R]=Xr(g);w&&R?!m.shiftKey&&x===R?(m.preventDefault(),n&&ce(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&ce(R,{select:!0})):x===g&&m.preventDefault()}},[n,o,y.paused]);return l.jsx(P.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})});Le.displayName=zr;function Yr(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ce(o,{select:t}),document.activeElement!==n)return}function Xr(e){const t=cn(e),n=Nt(t,e),o=Nt(t.reverse(),e);return[n,o]}function cn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nt(e,t){for(const n of e)if(!qr(n,{upTo:t}))return n}function qr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Zr(e){return e instanceof HTMLInputElement&&"select"in e}function ce(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zr(e)&&t&&e.select()}}var At=Jr();function Jr(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Dt(e,t),e.unshift(t)},remove(t){e=Dt(e,t),e[0]?.resume()}}}function Dt(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Qr(e){return e.filter(t=>t.tagName!=="A")}var es="Portal",ke=s.forwardRef((e,t)=>{const{container:n,...o}=e,[r,a]=s.useState(!1);U(()=>a(!0),[]);const c=n||r&&globalThis?.document?.body;return c?zo.createPortal(l.jsx(P.div,{...o,ref:t}),c):null});ke.displayName=es;var qe=0;function dt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ot()),document.body.insertAdjacentElement("beforeend",e[1]??Ot()),qe++,()=>{qe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qe--}},[])}function Ot(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ln="Dialog",[un]=le(ln),[ti,oe]=un(ln),dn="DialogTrigger",ts=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(dn,n),a=M(t,r.triggerRef);return l.jsx(P.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":mt(r.open),...o,ref:a,onClick:E(e.onClick,r.onOpenToggle)})});ts.displayName=dn;var ft="DialogPortal",[ns,fn]=un(ft,{forceMount:void 0}),pn=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=oe(ft,t);return l.jsx(ns,{scope:t,forceMount:n,children:s.Children.map(o,c=>l.jsx(ie,{present:n||a.open,children:l.jsx(ke,{asChild:!0,container:r,children:c})}))})};pn.displayName=ft;var Me="DialogOverlay",mn=s.forwardRef((e,t)=>{const n=fn(Me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(Me,e.__scopeDialog);return a.modal?l.jsx(ie,{present:o||a.open,children:l.jsx(rs,{...r,ref:t})}):null});mn.displayName=Me;var os=xe("DialogOverlay.RemoveScroll"),rs=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(Me,n);return l.jsx(it,{as:os,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(P.div,{"data-state":mt(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),me="DialogContent",vn=s.forwardRef((e,t)=>{const n=fn(me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(me,e.__scopeDialog);return l.jsx(ie,{present:o||a.open,children:a.modal?l.jsx(ss,{...r,ref:t}):l.jsx(as,{...r,ref:t})})});vn.displayName=me;var ss=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(null),r=M(t,n.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return ct(a)},[]),l.jsx(hn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&a.preventDefault()}),onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault())})}),as=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return l.jsx(hn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=a.target;n.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),hn=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...c}=e,i=oe(me,n),u=s.useRef(null),d=M(t,u);return dt(),l.jsxs(l.Fragment,{children:[l.jsx(Le,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:l.jsx(Fe,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":mt(i.open),...c,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(is,{titleId:i.titleId}),l.jsx(ls,{contentRef:u,descriptionId:i.descriptionId})]})]})}),pt="DialogTitle",gn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(pt,n);return l.jsx(P.h2,{id:r.titleId,...o,ref:t})});gn.displayName=pt;var xn="DialogDescription",wn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(xn,n);return l.jsx(P.p,{id:r.descriptionId,...o,ref:t})});wn.displayName=xn;var yn="DialogClose",Cn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(yn,n);return l.jsx(P.button,{type:"button",...o,ref:t,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Cn.displayName=yn;function mt(e){return e?"open":"closed"}var Sn="DialogTitleWarning",[ni,En]=ur(Sn,{contentName:me,titleName:pt,docsSlug:"dialog"}),is=({titleId:e})=>{const t=En(Sn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
4
|
|