@sps-woodland/tabs 8.51.2 → 8.52.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/README.md +1 -24
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3071 -10
- package/lib/index.umd.cjs +9 -3
- package/lib/style.css +1 -1
- package/lib/tab/Tab.css.d.ts +11 -0
- package/lib/tab/Tab.d.ts +9 -0
- package/lib/tab-panel/TabPanel.d.ts +8 -0
- package/lib/tabs/Tabs.css.d.ts +29 -0
- package/lib/tabs/Tabs.d.ts +5 -0
- package/package.json +19 -6
- package/vite.config.mjs +13 -6
package/lib/index.umd.cjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@sps-woodland/core/tabs"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core/tabs","@spscommerce/utils"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.Tabs={},e.tabs,e.utils))})(this,(function(e,t,s){"use strict";const a={"Tabbed Navigation":{components:[t.Tabs],examples:{basic:{label:"Basic Navigation Tabs",description:s.code`
|
|
1
|
+
(function(G,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom"),require("@sps-woodland/core"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@sps-woodland/core","@spscommerce/utils"],d):(G=typeof globalThis<"u"?globalThis:G||self,d(G.Tabs={},G.React,G.reactDom,G.core,G.utils))})(this,(function(G,d,st,U,ot){"use strict";function br(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const F=br(d);class lt{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let r=l=>{if(this.keyMap.set(l.key,l),l.childNodes&&l.type==="section")for(let c of l.childNodes)r(c)};for(let l of e)r(l);let n=null,i=0,o=0;for(let[l,c]of this.keyMap)n?(n.nextKey=l,c.prevKey=n.key):(this.firstKey=l,c.prevKey=void 0),c.type==="item"&&(c.index=i++),(c.type==="section"||c.type==="item")&&o++,n=c,n.nextKey=void 0;this._size=o,this.lastKey=n?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let r=this.keyMap.get(e);return r?r.prevKey??null:null}getKeyAfter(e){let r=this.keyMap.get(e);return r?r.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const r=[...this.getKeys()];return this.getItem(r[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}}class Y extends Set{constructor(e,r,n){super(e),e instanceof Y?(this.anchorKey=r??e.anchorKey,this.currentKey=n??e.currentKey):(this.anchorKey=r??null,this.currentKey=n??null)}}const yr=typeof document<"u"?d.useInsertionEffect??d.useLayoutEffect:()=>{};function at(t,e,r){let[n,i]=d.useState(t||e),o=d.useRef(n),l=d.useRef(t!==void 0),c=t!==void 0;d.useEffect(()=>{let $=l.current;$!==c&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${$?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}.`),l.current=c},[c]);let u=c?t:n;yr(()=>{o.current=u});let[,y]=d.useReducer(()=>({}),{}),g=d.useCallback(($,...v)=>{let m=typeof $=="function"?$(o.current):$;Object.is(o.current,m)||(o.current=m,i(m),y(),r?.(m,...v))},[r]);return[u,g]}function gr(t,e){if(t.size!==e.size)return!1;for(let r of t)if(!e.has(r))return!1;return!0}function $r(t){let{selectionMode:e="none",disallowEmptySelection:r=!1,allowDuplicateSelectionEvents:n,selectionBehavior:i="toggle",disabledBehavior:o="all"}=t,l=d.useRef(!1),[,c]=d.useState(!1),u=d.useRef(null),y=d.useRef(null),[,g]=d.useState(null),$=d.useMemo(()=>ct(t.selectedKeys),[t.selectedKeys]),v=d.useMemo(()=>ct(t.defaultSelectedKeys,new Y),[t.defaultSelectedKeys]),[m,D]=at($,v,t.onSelectionChange),M=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[K,L]=d.useState(i);i==="replace"&&K==="toggle"&&typeof m=="object"&&m.size===0&&L("replace");let _=d.useRef(i);return d.useEffect(()=>{i!==_.current&&(L(i),_.current=i)},[i]),{selectionMode:e,disallowEmptySelection:r,selectionBehavior:K,setSelectionBehavior:L,get isFocused(){return l.current},setFocused(x){l.current=x,c(x)},get focusedKey(){return u.current},get childFocusStrategy(){return y.current},setFocusedKey(x,S="first"){u.current=x,y.current=S,g(x)},selectedKeys:m,setSelectedKeys(x){(n||!gr(x,m))&&D(x)},disabledKeys:M,disabledBehavior:o}}function ct(t,e){return t?t==="all"?"all":new Y(t):e}function vr(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function mr(t){return Sr(t)}function Sr(t,e){for(let r of t)return r}function Ie(t,e,r){if(e.parentKey===r.parentKey)return e.index-r.index;let n=[...ut(t,e),e],i=[...ut(t,r),r],o=n.slice(0,i.length).findIndex((l,c)=>l!==i[c]);return o!==-1?(e=n[o],r=i[o],e.index-r.index):n.findIndex(l=>l===r)>=0?1:(i.findIndex(l=>l===e)>=0,-1)}function ut(t,e){let r=[],n=e;for(;n?.parentKey!=null;)n=t.getItem(n.parentKey),n&&r.unshift(n);return r}class Me{constructor(e,r,n){this.collection=e,this.state=r,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null,this.fullCollection=n?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,r){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,r)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let r=this.getKey(e);return r==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(r):this.state.selectedKeys.has(r)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),r=this.state.selectedKeys;return this._isSelectAll=e.every(n=>r.has(n)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let n=this.collection.getItem(r);(!e||n&&Ie(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let n=this.collection.getItem(r);(!e||n&&Ie(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let r=this.getKey(e);if(r==null)return;let n;if(this.state.selectedKeys==="all")n=new Y([r],r,r);else{let i=this.state.selectedKeys,o=i.anchorKey??r;n=new Y(i,o,r);for(let l of this.getKeyRange(o,i.currentKey??r))n.delete(l);for(let l of this.getKeyRange(r,o))this.canSelectItem(l)&&n.add(l)}this.state.setSelectedKeys(n)}getKeyRange(e,r){let n=this.collection.getItem(e),i=this.collection.getItem(r);return n&&i?Ie(this.collection,n,i)<=0?this.getKeyRangeInternal(e,r):this.getKeyRangeInternal(r,e):[]}getKeyRangeInternal(e,r){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,r);let n=[],i=e;for(;i!=null;){let o=this.collection.getItem(i);if(o&&(o.type==="item"||o.type==="cell"&&this.allowsCellSelection)&&n.push(i),i===r)return n;i=this.collection.getKeyAfter(i)}return[]}getKey(e){let r=this.collection.getItem(e);if(!r||r.type==="cell"&&this.allowsCellSelection)return e;for(;r&&r.type!=="item"&&r.parentKey!=null;)r=this.collection.getItem(r.parentKey);return!r||r.type!=="item"?null:r.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let r=this.getKey(e);if(r==null)return;let n=new Y(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);n.has(r)?n.delete(r):this.canSelectItem(r)&&(n.add(r),n.anchorKey=r,n.currentKey=r),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode==="none")return;let r=this.getKey(e);if(r==null)return;let n=this.canSelectItem(r)?new Y([r],r,r):new Y;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode==="none")return;let r=new Y;for(let n of e){let i=this.getKey(n);if(i!=null&&(r.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(r)}getSelectAllKeys(){let e=this.fullCollection??this.collection,r=[],n=i=>{for(;i!=null;){if(this.canSelectItemIn(i,e)){let o=e.getItem(i);o?.type==="item"&&r.push(i),o?.hasChildNodes&&(this.allowsCellSelection||o.type!=="item")&&n(mr(vr(o,e))?.key??null)}i=e.getKeyAfter(i)}};return n(e.getFirstKey()),r}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Y)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,r){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||r&&(r.pointerType==="touch"||r.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let r=this.selectedKeys;if(e.size!==r.size)return!1;for(let n of e)if(!r.has(n))return!1;for(let n of r)if(!e.has(n))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,r){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let n=r.getItem(e);return!(!n||n?.props?.isDisabled||n.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled)}isLink(e){return!!this.collection.getItem(e)?.props?.href}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(e){return new Me(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class wr{build(e,r){return this.context=r,dt(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:r,items:n}=e;if(d.isValidElement(r)&&r.type===d.Fragment)yield*this.iterateCollection({children:r.props.children,items:n});else if(typeof r=="function"){if(!n)throw new Error("props.children was a function but props.items is missing");let i=0;for(let o of n)yield*this.getFullNode({value:o,index:i},{renderer:r}),i++}else{let i=[];d.Children.forEach(r,l=>{l&&i.push(l)});let o=0;for(let l of i){let c=this.getFullNode({element:l,index:o},{});for(let u of c)o++,yield u}}}getKey(e,r,n,i){if(e.key!=null)return e.key;if(r.type==="cell"&&r.key!=null)return`${i}${r.key}`;let o=r.value;if(o!=null){let l=o.key??o.id;if(l==null)throw new Error("No key found for item");return l}return i?`${i}.${r.index}`:`$.${r.index}`}getChildState(e,r){return{renderer:r.renderer||e.renderer}}*getFullNode(e,r,n,i){if(d.isValidElement(e.element)&&e.element.type===d.Fragment){let u=[];d.Children.forEach(e.element.props.children,g=>{u.push(g)});let y=e.index??0;for(const g of u)yield*this.getFullNode({element:g,index:y++},r,n,i);return}let o=e.element;if(!o&&e.value&&r&&r.renderer){let u=this.cache.get(e.value);if(u&&(!u.shouldInvalidate||!u.shouldInvalidate(this.context))){u.index=e.index,u.parentKey=i?i.key:null,yield u;return}o=r.renderer(e.value)}if(d.isValidElement(o)){let u=o.type;if(typeof u!="function"&&typeof u.getCollectionNode!="function"){let v=o.type;throw new Error(`Unknown element <${v}> in collection.`)}let y=u.getCollectionNode(o.props,this.context),g=e.index??0,$=y.next();for(;!$.done&&$.value;){let v=$.value;e.index=g;let m=v.key??null;m==null&&(m=v.element?null:this.getKey(o,e,r,n));let M=[...this.getFullNode({...v,key:m,index:g,wrapper:Er(e.wrapper,v.wrapper)},this.getChildState(r,v),n?`${n}${o.key}`:o.key,i)];for(let K of M){if(K.value=v.value??e.value??null,K.value&&this.cache.set(K.value,K),e.type&&K.type!==e.type)throw new Error(`Unsupported type <${Fe(K.type)}> in <${Fe(i?.type??"unknown parent type")}>. Only <${Fe(e.type)}> is supported.`);g++,yield K}$=y.next(M)}return}if(e.key==null||e.type==null)return;let l=this,c={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:e.value??null,level:(i?.level??0)+(i?.type==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:dt(function*(){if(!e.hasChildNodes||!e.childNodes)return;let u=0;for(let y of e.childNodes()){y.key!=null&&(y.key=`${c.key}${y.key}`);let g=l.getFullNode({...y,index:u},l.getChildState(r,y),c.key,c);for(let $ of g)u++,yield $}})};yield c}constructor(){this.cache=new WeakMap}}function dt(t){let e=[],r=null;return{*[Symbol.iterator](){for(let n of e)yield n;r||(r=t());for(let n of r)e.push(n),yield n}}}function Er(t,e){if(t&&e)return r=>t(e(r));if(t)return t;if(e)return e}function Fe(t){return t[0].toUpperCase()+t.slice(1)}function Tr(t,e,r){let n=d.useMemo(()=>new wr,[]),{children:i,items:o,collection:l}=t;return d.useMemo(()=>{if(l)return l;let u=n.build({children:i,items:o},r);return e(u)},[n,i,o,l,r,e])}function Kr(t){let{filter:e,layoutDelegate:r}=t,n=$r(t),i=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=d.useCallback(y=>e?new lt(e(y)):new lt(y),[e]),l=d.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),c=Tr(t,o,l),u=d.useMemo(()=>new Me(c,n,{layoutDelegate:r}),[c,n,r]);return _r(c,u),{collection:c,disabledKeys:i,selectionManager:u}}function _r(t,e){const r=d.useRef(null);d.useEffect(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&r.current){let n=r.current.getKeyAfter(e.focusedKey),i=null;for(;n!=null;){let o=t.getItem(n);if(o&&o.type==="item"&&!e.isDisabled(n)){i=n;break}n=r.current.getKeyAfter(n)}if(i==null)for(n=r.current.getKeyBefore(e.focusedKey);n!=null;){let o=t.getItem(n);if(o&&o.type==="item"&&!e.isDisabled(n)){i=n;break}n=r.current.getKeyBefore(n)}e.setFocusedKey(i)}r.current=t},[t,e])}function Pr(t){let[e,r]=at(t.selectedKey,t.defaultSelectedKey??null,t.onSelectionChange),n=d.useMemo(()=>e!=null?[e]:[],[e]),{collection:i,disabledKeys:o,selectionManager:l}=Kr({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:n,onSelectionChange:u=>{if(u==="all")return;let y=u.values().next().value??null;y===e&&t.onSelectionChange&&t.onSelectionChange(y),r(y)}}),c=e!=null?i.getItem(e):null;return{collection:i,disabledKeys:o,selectionManager:l,selectedKey:e,setSelectedKey:r,selectedItem:c}}function kr(t){let e=Pr({...t,onSelectionChange:t.onSelectionChange?l=>{l!=null&&t.onSelectionChange?.(l)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:t.defaultSelectedKey??ft(t.collection,t.disabledKeys?new Set(t.disabledKeys):new Set)??void 0}),{selectionManager:r,collection:n,selectedKey:i}=e,o=d.useRef(i);return d.useEffect(()=>{let l=i;t.selectedKey==null&&(r.isEmpty||l==null||!n.getItem(l))&&(l=ft(n,e.disabledKeys),l!=null&&r.setSelectedKeys([l])),(l!=null&&r.focusedKey==null||!r.isFocused&&l!==o.current)&&r.setFocusedKey(l),o.current=l}),{...e,isDisabled:t.isDisabled||!1}}function ft(t,e){let r=null;if(t){for(r=t.getFirstKey();r!=null&&(e.has(r)||t.getItem(r)?.props?.isDisabled)&&r!==t.getLastKey();)r=t.getKeyAfter(r);r!=null&&(e.has(r)||t.getItem(r)?.props?.isDisabled)&&r===t.getLastKey()&&(r=t.getFirstKey())}return r}const xr=new Set(["id"]),Cr=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Lr=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Ir=new Set(["dir","lang","hidden","inert","translate"]),pt=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),Mr=/^(data-.*)$/;function Fr(t,e={}){let{labelable:r,isLink:n,global:i,events:o=i,propNames:l}=e,c={};for(const u in t)Object.prototype.hasOwnProperty.call(t,u)&&(xr.has(u)||r&&Cr.has(u)||n&&Lr.has(u)||i&&Ir.has(u)||o&&(pt.has(u)||u.endsWith("Capture")&&pt.has(u.slice(0,-7)))||l?.has(u)||Mr.test(u))&&(c[u]=t[u]);return c}const ht=new WeakMap;function ye(t,e,r){if(!t)return"";typeof e=="string"&&(e=e.replace(/\s+/g,""));let n=ht.get(t);return process.env.NODE_ENV!=="production"&&!n&&console.error("There is no tab id, please check if you have rendered the tab panel before the tab list."),`${n}-${r}-${e}`}function De(...t){return(...e)=>{for(let r of t)typeof r=="function"&&r(...e)}}const Q=typeof document<"u"?d.useLayoutEffect:()=>{},ge={prefix:String(Math.round(Math.random()*1e10)),current:0},bt=d.createContext(ge),Dr=d.createContext(!1);let Nr=!!(typeof window<"u"&&window.document&&window.document.createElement),Ne=new WeakMap;function Or(t=!1){let e=d.useContext(bt),r=d.useRef(null);if(r.current===null&&!t){let n=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(n){let i=Ne.get(n);i==null?Ne.set(n,{id:e.current,state:n.memoizedState}):n.memoizedState!==i.state&&(e.current=i.id,Ne.delete(n))}r.current=++e.current}return r.current}function Ar(t){let e=d.useContext(bt);e===ge&&!Nr&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=Or(!!t),n=e===ge&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${e.prefix}`;return t||`${n}-${r}`}function Br(t){let e=d.useId(),[r]=d.useState(yt()),n=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${ge.prefix}`;return t||`${n}-${e}`}const zr=typeof d.useId=="function"?Br:Ar;function Rr(){return!1}function Wr(){return!0}function Ur(t){return()=>{}}function yt(){return typeof d.useSyncExternalStore=="function"?d.useSyncExternalStore(Ur,Rr,Wr):d.useContext(Dr)}let Vr=!!(typeof window<"u"&&window.document&&window.document.createElement),se=new Map,ae;typeof FinalizationRegistry<"u"&&(ae=new FinalizationRegistry(t=>{se.delete(t)}));function $e(t){let[e,r]=d.useState(t),n=d.useRef(null),i=zr(e),o=d.useRef(null);if(ae&&ae.register(o,i),Vr){const l=se.get(i);l&&!l.includes(n)?l.push(n):se.set(i,[n])}return Q(()=>{let l=i;return()=>{ae&&ae.unregister(o),se.delete(l)}},[i]),d.useEffect(()=>{let l=n.current;return l&&r(l),()=>{l&&(n.current=null)}}),i}function Hr(t,e){if(t===e)return t;let r=se.get(t);if(r)return r.forEach(i=>i.current=e),e;let n=se.get(e);return n?(n.forEach(i=>i.current=t),t):e}function jr(...t){return t.length===1&&t[0]?t[0]:e=>{let r=!1;const n=t.map(i=>{const o=gt(i,e);return r||=typeof o=="function",o});if(r)return()=>{n.forEach((i,o)=>{typeof i=="function"?i():gt(t[o],null)})}}}function gt(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function $t(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=$t(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Gr(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=$t(t))&&(n&&(n+=" "),n+=e);return n}function V(...t){let e={...t[0]};for(let r=1;r<t.length;r++){let n=t[r];for(let i in n){let o=e[i],l=n[i];typeof o=="function"&&typeof l=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?e[i]=De(o,l):(i==="className"||i==="UNSAFE_className")&&typeof o=="string"&&typeof l=="string"?e[i]=Gr(o,l):i==="id"&&o&&l?e.id=Hr(o,l):i==="ref"&&o&&l?e.ref=jr(o,l):e[i]=l!==void 0?l:o}}return e}function q(t){if(Yr())t.focus({preventScroll:!0});else{let e=Xr(t);t.focus(),qr(e)}}let ve=null;function Yr(){if(ve==null){ve=!1;try{document.createElement("div").focus({get preventScroll(){return ve=!0,!0}})}catch{}}return ve}function Xr(t){let e=t.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==n;)(e.offsetHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)&&r.push({element:e,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),e=e.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}function qr(t){for(let{element:e,scrollTop:r,scrollLeft:n}of t)e.scrollTop=r,e.scrollLeft=n}const B=t=>t?.ownerDocument??document,H=t=>t&&"window"in t&&t.window===t?t:B(t).defaultView||window;function Jr(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function Zr(t){return Jr(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}let Qr=!1;function me(){return Qr}function k(t,e){if(!me())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let r=e;for(;r!==null;){if(r===t)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:Zr(r)?r=r.host:r=r.parentNode}return!1}const X=(t=document)=>{if(!me())return t.activeElement;let e=t.activeElement;for(;e&&"shadowRoot"in e&&e.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e};function w(t){if(me()&&t.target instanceof Element&&t.target.shadowRoot){if("composedPath"in t)return t.composedPath()[0]??null;if("composedPath"in t.nativeEvent)return t.nativeEvent.composedPath()[0]??null}return t.target}function vt(t){if(!t)return!1;let e=t.getRootNode(),r=H(t);if(!(e instanceof r.Document||e instanceof r.ShadowRoot))return!1;let n=e.activeElement;return n!=null&&t.contains(n)}const en=typeof Element<"u"&&"checkVisibility"in Element.prototype;function tn(t){const e=H(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:r,visibility:n}=t.style,i=r!=="none"&&n!=="hidden"&&n!=="collapse";if(i){const{getComputedStyle:o}=t.ownerDocument.defaultView;let{display:l,visibility:c}=o(t);i=l!=="none"&&c!=="hidden"&&c!=="collapse"}return i}function rn(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function Oe(t,e){return en?t.checkVisibility({visibilityProperty:!0})&&!t.closest("[data-react-aria-prevent-focus]"):t.nodeName!=="#comment"&&tn(t)&&rn(t,e)&&(!t.parentElement||Oe(t.parentElement,t))}const Ae=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],nn=Ae.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Ae.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const sn=Ae.join(':not([hidden]):not([tabindex="-1"]),');function mt(t,e){return t.matches(nn)&&!wt(t)&&(e?.skipVisibilityCheck||Oe(t))}function St(t){return t.matches(sn)&&Oe(t)&&!wt(t)}function wt(t){let e=t;for(;e!=null;){if(e instanceof e.ownerDocument.defaultView.HTMLElement&&e.inert)return!0;e=e.parentElement}return!1}function Et(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function on(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function ln(t){let e=d.useRef({isFocused:!1,observer:null});return Q(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]),d.useCallback(r=>{let n=w(r);if(n instanceof HTMLButtonElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement){e.current.isFocused=!0;let i=n,o=l=>{if(e.current.isFocused=!1,i.disabled){let c=Et(l);t?.(c)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",o,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){e.current.observer?.disconnect();let l=i===X()?null:X();i.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[t])}let Se=!1;function Tt(t){for(;t&&!mt(t,{skipVisibilityCheck:!0});)t=t.parentElement;let e=H(t),r=e.document.activeElement;if(!r||r===t)return;Se=!0;let n=!1,i=g=>{(w(g)===r||n)&&g.stopImmediatePropagation()},o=g=>{(w(g)===r||n)&&(g.stopImmediatePropagation(),!t&&!n&&(n=!0,q(r),u()))},l=g=>{(w(g)===t||n)&&g.stopImmediatePropagation()},c=g=>{(w(g)===t||n)&&(g.stopImmediatePropagation(),n||(n=!0,q(r),u()))};e.addEventListener("blur",i,!0),e.addEventListener("focusout",o,!0),e.addEventListener("focusin",c,!0),e.addEventListener("focus",l,!0);let u=()=>{cancelAnimationFrame(y),e.removeEventListener("blur",i,!0),e.removeEventListener("focusout",o,!0),e.removeEventListener("focusin",c,!0),e.removeEventListener("focus",l,!0),Se=!1,n=!1},y=requestAnimationFrame(u);return u}function we(t){if(typeof window>"u"||window.navigator==null)return!1;let e=window.navigator.userAgentData?.brands;return Array.isArray(e)&&e.some(r=>t.test(r.brand))||t.test(window.navigator.userAgent)}function Be(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function J(t){if(process.env.NODE_ENV==="test")return t;let e=null;return()=>(e==null&&(e=t()),e)}const re=J(function(){return Be(/^Mac/i)}),an=J(function(){return Be(/^iPhone/i)}),Kt=J(function(){return Be(/^iPad/i)||re()&&navigator.maxTouchPoints>1}),Ee=J(function(){return an()||Kt()}),cn=J(function(){return re()||Ee()}),un=J(function(){return we(/AppleWebKit/i)&&!dn()}),dn=J(function(){return we(/Chrome/i)}),_t=J(function(){return we(/Android/i)}),fn=J(function(){return we(/Firefox/i)});function ze(t){return t.pointerType===""&&t.isTrusted?!0:_t()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function pn(t){return!_t()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}const hn=d.createContext({isNative:!0,open:yn,useHref:t=>t});function Re(){return d.useContext(hn)}function Z(t,e,r=!0){let{metaKey:n,ctrlKey:i,altKey:o,shiftKey:l}=e;fn()&&window.event?.type?.startsWith("key")&&t.target==="_blank"&&(re()?n=!0:i=!0);let c=un()&&re()&&!Kt()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:i,altKey:o,shiftKey:l}):new MouseEvent("click",{metaKey:n,ctrlKey:i,altKey:o,shiftKey:l,detail:1,bubbles:!0,cancelable:!0});Z.isOpening=r,q(t),t.dispatchEvent(c),Z.isOpening=!1}Z.isOpening=!1;function bn(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let r=document.createElement("a");r.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(r.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(r.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(r.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(r.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(r.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(r),e(r),t.removeChild(r)}}function yn(t,e){bn(t,r=>Z(r,e))}function gn(t){const r=Re().useHref(t?.href??"");return{href:t?.href?r:void 0,target:t?.target,rel:t?.rel,download:t?.download,ping:t?.ping,referrerPolicy:t?.referrerPolicy}}let ce=null;const $n=new Set;let ue=new Map,ne=!1,We=!1;function Ue(t,e){for(let r of $n)r(t,e)}function vn(t){return!(t.metaKey||!re()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Te(t){ne=!0,!Z.isOpening&&vn(t)&&(ce="keyboard",Ue("keyboard",t))}function j(t){ce="pointer","pointerType"in t&&t.pointerType,(t.type==="mousedown"||t.type==="pointerdown")&&(ne=!0,Ue("pointer",t))}function Pt(t){!Z.isOpening&&ze(t)&&(ne=!0,ce="virtual")}function kt(t){let e=H(w(t)),r=B(w(t));w(t)===e||w(t)===r||Se||!t.isTrusted||(!ne&&!We&&(ce="virtual",Ue("virtual",t)),ne=!1,We=!1)}function xt(){Se||(ne=!1,We=!0)}function Ct(t){if(typeof window>"u"||typeof document>"u")return;const e=H(t),r=B(t);if(ue.get(e))return;let n=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){ne=!0,n.apply(this,arguments)},r.addEventListener("keydown",Te,!0),r.addEventListener("keyup",Te,!0),r.addEventListener("click",Pt,!0),e.addEventListener("focus",kt,!0),e.addEventListener("blur",xt,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",j,!0),r.addEventListener("pointermove",j,!0),r.addEventListener("pointerup",j,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",j,!0),r.addEventListener("mousemove",j,!0),r.addEventListener("mouseup",j,!0)),e.addEventListener("beforeunload",()=>{Lt(t)},{once:!0}),ue.set(e,{focus:n})}const Lt=(t,e)=>{const r=H(t),n=B(t);e&&n.removeEventListener("DOMContentLoaded",e),ue.has(r)&&(r.HTMLElement.prototype.focus=ue.get(r).focus,n.removeEventListener("keydown",Te,!0),n.removeEventListener("keyup",Te,!0),n.removeEventListener("click",Pt,!0),r.removeEventListener("focus",kt,!0),r.removeEventListener("blur",xt,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",j,!0),n.removeEventListener("pointermove",j,!0),n.removeEventListener("pointerup",j,!0)):process.env.NODE_ENV==="test"&&(n.removeEventListener("mousedown",j,!0),n.removeEventListener("mousemove",j,!0),n.removeEventListener("mouseup",j,!0)),ue.delete(r))};function mn(t){const e=B(t);let r;return e.readyState!=="loading"?Ct(t):(r=()=>{Ct(t)},e.addEventListener("DOMContentLoaded",r)),()=>Lt(t,r)}typeof document<"u"&&mn();function Ve(){return ce}let ee=new Map,He=new Set;function It(){if(typeof window>"u")return;function t(n){return"propertyName"in n}let e=n=>{let i=w(n);if(!t(n)||!i)return;let o=ee.get(i);o||(o=new Set,ee.set(i,o),i.addEventListener("transitioncancel",r,{once:!0})),o.add(n.propertyName)},r=n=>{let i=w(n);if(!t(n)||!i)return;let o=ee.get(i);if(o&&(o.delete(n.propertyName),o.size===0&&(i.removeEventListener("transitioncancel",r),ee.delete(i)),ee.size===0)){for(let l of He)l();He.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?It():document.addEventListener("DOMContentLoaded",It));function Sn(){for(const[t]of ee)"isConnected"in t&&!t.isConnected&&ee.delete(t)}function Mt(t){requestAnimationFrame(()=>{Sn(),ee.size===0?t():He.add(t)})}function Ke(t){if(!t.isConnected)return;const e=B(t);if(Ve()==="virtual"){let r=X(e);Mt(()=>{const n=X(e);(n===r||n===e.body)&&t.isConnected&&q(t)})}else q(t)}function wn(t){let{isDisabled:e,onFocus:r,onBlur:n,onFocusChange:i}=t;const o=d.useCallback(u=>{if(w(u)===u.currentTarget)return n&&n(u),i&&i(!1),!0},[n,i]),l=ln(o),c=d.useCallback(u=>{let y=w(u);const g=B(y),$=g?X(g):X();y===u.currentTarget&&y===$&&(r&&r(u),i&&i(!0),l(u))},[i,r,l]);return{focusProps:{onFocus:!e&&(r||i||n)?c:void 0,onBlur:!e&&(n||i)?o:void 0}}}function Ft(t){if(!t)return;let e=!0;return r=>{let n={...r,preventDefault(){r.preventDefault()},isDefaultPrevented(){return r.isDefaultPrevented()},stopPropagation(){e&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):e=!0},continuePropagation(){e=!1},isPropagationStopped(){return e}};t(n),e&&r.stopPropagation()}}function En(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:Ft(t.onKeyDown),onKeyUp:Ft(t.onKeyUp)}}}function Dt(t,e){Q(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}let Tn=d.createContext(null);function Kn(t){let e=d.useContext(Tn)||{};Dt(e,t);let{ref:r,...n}=e;return n}function _n(t,e){let{focusProps:r}=wn(t),{keyboardProps:n}=En(t),i=V(r,n),o=Kn(e),l=t.isDisabled?{}:o,c=d.useRef(t.autoFocus);d.useEffect(()=>{c.current&&e.current&&Ke(e.current),c.current=!1},[e]);let u=t.excludeFromTabOrder?-1:0;return t.isDisabled&&(u=void 0),{focusableProps:V({...i,tabIndex:u},l)}}function je(t){return cn()?t.altKey:t.ctrlKey}function Ge(t,e){let r=`[data-key="${CSS.escape(String(e))}"]`,n=t.current?.dataset.collection;return n&&(r=`[data-collection="${CSS.escape(n)}"]${r}`),t.current?.querySelector(r)}const Nt=new WeakMap;function Pn(t){let e=$e();return Nt.set(t,e),e}function kn(t){return Nt.get(t)}function oe(t){return re()?t.metaKey:t.ctrlKey}function Ot(t){let e=Cn(B(t));e!==t&&(e&&xn(e,t),t&&At(t,e))}function xn(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function At(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function Cn(t){let e=X(t),r=e?.getAttribute("aria-activedescendant");return r&&t.getElementById(r)||e}let le="default",Ye="",_e=new WeakMap;function Bt(t){if(Ee()){if(le==="default"){const e=B(t);Ye=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}le="disabled"}else if(t instanceof HTMLElement||t instanceof SVGElement){let e="userSelect"in t.style?"userSelect":"webkitUserSelect";_e.set(t,t.style[e]),t.style[e]="none"}}function Xe(t){if(Ee()){if(le!=="disabled")return;le="restoring",setTimeout(()=>{Mt(()=>{if(le==="restoring"){const e=B(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=Ye||""),Ye="",le="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&_e.has(t)){let e=_e.get(t),r="userSelect"in t.style?"userSelect":"webkitUserSelect";t.style[r]==="none"&&(t.style[r]=e),t.getAttribute("style")===""&&t.removeAttribute("style"),_e.delete(t)}}function zt(t){return t?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let qe=new WeakMap;function Ln(t){let e=t??(typeof document<"u"?document:void 0);if(!e)return zt(e);if(qe.has(e))return qe.get(e);let r=e.querySelector('meta[property="csp-nonce"]'),n=r&&r instanceof H(r).HTMLMetaElement&&(r.nonce||r.content)||zt(e)||void 0;return n!==void 0&&qe.set(e,n),n}const Rt=d.createContext({register:()=>{}});Rt.displayName="PressResponderContext";const In=d.useInsertionEffect??Q;function Pe(t){const e=d.useRef(null);return In(()=>{e.current=t},[t]),d.useCallback((...r)=>{const n=e.current;return n?.(...r)},[])}function Wt(){let t=d.useRef(new Map),e=d.useCallback((i,o,l,c)=>{let u=c?.once?(...y)=>{t.current.delete(l),l(...y)}:l;t.current.set(l,{type:o,eventTarget:i,fn:u,options:c}),i.addEventListener(o,u,c)},[]),r=d.useCallback((i,o,l,c)=>{let u=t.current.get(l)?.fn||l;i.removeEventListener(o,u,c),t.current.delete(l)},[]),n=d.useCallback(()=>{t.current.forEach((i,o)=>{r(i.eventTarget,i.type,o,i.options)})},[r]);return d.useEffect(()=>n,[n]),{addGlobalListener:e,removeGlobalListener:r,removeAllGlobalListeners:n}}function Mn(t){let e=d.useContext(Rt);if(e){let{register:r,ref:n,...i}=e;t=V(i,t),r()}return Dt(e,t.ref),t}class ke{#e;constructor(e,r,n,i){this.#e=!0;const l=(i?.target??n.currentTarget)?.getBoundingClientRect();let c,u=0,y,g=null;n.clientX!=null&&n.clientY!=null&&(y=n.clientX,g=n.clientY),l&&(y!=null&&g!=null?(c=y-l.left,u=g-l.top):(c=l.width/2,u=l.height/2)),this.type=e,this.pointerType=r,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=c,this.y=u,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const Ut=Symbol("linkClicked"),Vt="react-aria-pressable-style",Ht="data-react-aria-pressable";function jt(t){let{onPress:e,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:o,onClick:l,isDisabled:c,isPressed:u,preventFocusOnPress:y,shouldCancelOnPointerExit:g,allowTextSelectionOnPress:$,ref:v,...m}=Mn(t),[D,M]=d.useState(!1),K=d.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:L,removeAllGlobalListeners:_}=Wt(),x=d.useCallback((s,h)=>{let b=K.current;if(c||b.didFirePressStart)return!1;let p=!0;if(b.isTriggeringEvent=!0,n){let T=new ke("pressstart",h,s);n(T),p=T.shouldStopPropagation}return r&&r(!0),b.isTriggeringEvent=!1,b.didFirePressStart=!0,M(!0),p},[c,n,r]),S=d.useCallback((s,h,b=!0)=>{let p=K.current;if(!p.didFirePressStart)return!1;p.didFirePressStart=!1,p.isTriggeringEvent=!0;let T=!0;if(i){let a=new ke("pressend",h,s);i(a),T=a.shouldStopPropagation}if(r&&r(!1),M(!1),e&&b&&!c){let a=new ke("press",h,s);e(a),T&&=a.shouldStopPropagation}return p.isTriggeringEvent=!1,T},[c,i,r,e]),P=Pe(S),O=d.useCallback((s,h)=>{let b=K.current;if(c)return!1;if(o){b.isTriggeringEvent=!0;let p=new ke("pressup",h,s);return o(p),b.isTriggeringEvent=!1,p.shouldStopPropagation}return!0},[c,o]),I=Pe(O),A=d.useCallback(s=>{let h=K.current;if(h.isPressed&&h.target){h.didFirePressStart&&h.pointerType!=null&&S(ie(h.target,s),h.pointerType,!1),h.isPressed=!1,h.isOverTarget=!1,h.activePointerId=null,h.pointerType=null,_(),$||Xe(h.target);for(let b of h.disposables)b();h.disposables=[]}},[$,_,S]),C=Pe(A),R=d.useCallback(s=>{g&&A(s)},[g,A]),W=d.useCallback(s=>{c||l?.(s)},[c,l]),z=d.useCallback((s,h)=>{if(!c&&l){let b=new MouseEvent("click",s);on(b,h),l(Et(b))}},[c,l]),N=d.useMemo(()=>{let s=K.current,h={onKeyDown(p){if(Ze(p.nativeEvent,p.currentTarget)&&k(p.currentTarget,w(p))){Xt(w(p),p.key)&&p.preventDefault();let T=!0;!s.isPressed&&!p.repeat&&(s.target=p.currentTarget,s.isPressed=!0,s.pointerType="keyboard",T=x(p,"keyboard"));let a=p.currentTarget,f=E=>{Ze(E,a)&&!E.repeat&&k(a,w(E))&&s.target&&I(ie(s.target,E),"keyboard")};L(B(p.currentTarget),"keyup",De(f,b),!0),T&&p.stopPropagation(),p.metaKey&&re()&&s.metaKeyEvents?.set(p.key,p.nativeEvent)}else p.key==="Meta"&&(s.metaKeyEvents=new Map)},onClick(p){if(!(p&&!k(p.currentTarget,w(p)))&&p&&p.button===0&&!s.isTriggeringEvent&&!Z.isOpening){let T=!0;if(c&&p.preventDefault(),!s.ignoreEmulatedMouseEvents&&!s.isPressed&&(s.pointerType==="virtual"||ze(p.nativeEvent))){let a=x(p,"virtual"),f=I(p,"virtual"),E=P(p,"virtual");W(p),T=a&&f&&E}else if(s.isPressed&&s.pointerType!=="keyboard"){let a=s.pointerType||p.nativeEvent.pointerType||"virtual",f=I(ie(p.currentTarget,p),a),E=P(ie(p.currentTarget,p),a,!0);T=f&&E,s.isOverTarget=!1,W(p),C(p)}s.ignoreEmulatedMouseEvents=!1,T&&p.stopPropagation()}}},b=p=>{if(s.isPressed&&s.target&&Ze(p,s.target)){Xt(w(p),p.key)&&p.preventDefault();let T=w(p),a=k(s.target,T);P(ie(s.target,p),"keyboard",a),a&&z(p,s.target),_(),p.key!=="Enter"&&Je(s.target)&&k(s.target,T)&&!p[Ut]&&(p[Ut]=!0,Z(s.target,p,!1)),s.isPressed=!1,s.metaKeyEvents?.delete(p.key)}else if(p.key==="Meta"&&s.metaKeyEvents?.size){let T=s.metaKeyEvents;s.metaKeyEvents=void 0;for(let a of T.values())s.target?.dispatchEvent(new KeyboardEvent("keyup",a))}};if(typeof PointerEvent<"u"){h.onPointerDown=a=>{if(a.button!==0||!k(a.currentTarget,w(a)))return;if(pn(a.nativeEvent)){s.pointerType="virtual";return}s.pointerType=a.pointerType;let f=!0;if(!s.isPressed){s.isPressed=!0,s.isOverTarget=!0,s.activePointerId=a.pointerId,s.target=a.currentTarget,$||Bt(s.target),f=x(a,s.pointerType);let E=w(a);"releasePointerCapture"in E&&("hasPointerCapture"in E?E.hasPointerCapture(a.pointerId)&&E.releasePointerCapture(a.pointerId):E.releasePointerCapture(a.pointerId)),L(B(a.currentTarget),"pointerup",p,!1),L(B(a.currentTarget),"pointercancel",T,!1)}f&&a.stopPropagation()},h.onMouseDown=a=>{if(k(a.currentTarget,w(a))&&a.button===0){if(y){let f=Tt(a.target);f&&s.disposables.push(f)}a.stopPropagation()}},h.onPointerUp=a=>{!k(a.currentTarget,w(a))||s.pointerType==="virtual"||a.button===0&&!s.isPressed&&I(a,s.pointerType||a.pointerType)},h.onPointerEnter=a=>{a.pointerId===s.activePointerId&&s.target&&!s.isOverTarget&&s.pointerType!=null&&(s.isOverTarget=!0,x(ie(s.target,a),s.pointerType))},h.onPointerLeave=a=>{a.pointerId===s.activePointerId&&s.target&&s.isOverTarget&&s.pointerType!=null&&(s.isOverTarget=!1,P(ie(s.target,a),s.pointerType,!1),R(a))};let p=a=>{if(a.pointerId===s.activePointerId&&s.isPressed&&a.button===0&&s.target){if(k(s.target,w(a))&&s.pointerType!=null){let f=!1,E=setTimeout(()=>{s.isPressed&&s.target instanceof HTMLElement&&(f?C(a):(q(s.target),s.target.click()))},80);L(a.currentTarget,"click",()=>f=!0,!0),s.disposables.push(()=>clearTimeout(E))}else C(a);s.isOverTarget=!1}},T=a=>{C(a)};h.onDragStart=a=>{k(a.currentTarget,w(a))&&C(a)}}else if(process.env.NODE_ENV==="test"){h.onMouseDown=a=>{if(a.button!==0||!k(a.currentTarget,w(a)))return;if(s.ignoreEmulatedMouseEvents){a.stopPropagation();return}if(s.isPressed=!0,s.isOverTarget=!0,s.target=a.currentTarget,s.pointerType=ze(a.nativeEvent)?"virtual":"mouse",st.flushSync(()=>x(a,s.pointerType))&&a.stopPropagation(),y){let E=Tt(a.target);E&&s.disposables.push(E)}L(B(a.currentTarget),"mouseup",p,!1)},h.onMouseEnter=a=>{if(!k(a.currentTarget,w(a)))return;let f=!0;s.isPressed&&!s.ignoreEmulatedMouseEvents&&s.pointerType!=null&&(s.isOverTarget=!0,f=x(a,s.pointerType)),f&&a.stopPropagation()},h.onMouseLeave=a=>{if(!k(a.currentTarget,w(a)))return;let f=!0;s.isPressed&&!s.ignoreEmulatedMouseEvents&&s.pointerType!=null&&(s.isOverTarget=!1,f=P(a,s.pointerType,!1),R(a)),f&&a.stopPropagation()},h.onMouseUp=a=>{k(a.currentTarget,w(a))&&!s.ignoreEmulatedMouseEvents&&a.button===0&&!s.isPressed&&I(a,s.pointerType||"mouse")};let p=a=>{if(a.button===0){if(s.ignoreEmulatedMouseEvents){s.ignoreEmulatedMouseEvents=!1;return}s.target&&k(s.target,w(a))&&s.pointerType!=null||C(a),s.isOverTarget=!1}};h.onTouchStart=a=>{if(!k(a.currentTarget,w(a)))return;let f=Fn(a.nativeEvent);if(!f)return;s.activePointerId=f.identifier,s.ignoreEmulatedMouseEvents=!0,s.isOverTarget=!0,s.isPressed=!0,s.target=a.currentTarget,s.pointerType="touch",$||Bt(s.target),x(te(s.target,a),s.pointerType)&&a.stopPropagation(),L(H(a.currentTarget),"scroll",T,!0)},h.onTouchMove=a=>{if(!k(a.currentTarget,w(a)))return;if(!s.isPressed){a.stopPropagation();return}let f=Gt(a.nativeEvent,s.activePointerId),E=!0;f&&Yt(f,a.currentTarget)?!s.isOverTarget&&s.pointerType!=null&&(s.isOverTarget=!0,E=x(te(s.target,a),s.pointerType)):s.isOverTarget&&s.pointerType!=null&&(s.isOverTarget=!1,E=P(te(s.target,a),s.pointerType,!1),R(te(s.target,a))),E&&a.stopPropagation()},h.onTouchEnd=a=>{if(!k(a.currentTarget,w(a)))return;if(!s.isPressed){a.stopPropagation();return}let f=Gt(a.nativeEvent,s.activePointerId),E=!0;f&&Yt(f,a.currentTarget)&&s.pointerType!=null?(I(te(s.target,a),s.pointerType),E=P(te(s.target,a),s.pointerType),z(a.nativeEvent,s.target)):s.isOverTarget&&s.pointerType!=null&&(E=P(te(s.target,a),s.pointerType,!1)),E&&a.stopPropagation(),s.isPressed=!1,s.activePointerId=null,s.isOverTarget=!1,s.ignoreEmulatedMouseEvents=!0,s.target&&!$&&Xe(s.target),_()},h.onTouchCancel=a=>{k(a.currentTarget,w(a))&&(a.stopPropagation(),s.isPressed&&C(te(s.target,a)))};let T=a=>{s.isPressed&&k(w(a),s.target)&&C({currentTarget:s.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};h.onDragStart=a=>{k(a.currentTarget,w(a))&&C(a)}}return h},[L,c,y,_,$,R,x,W,z]);return d.useEffect(()=>{if(!v||process.env.NODE_ENV==="test")return;const s=B(v.current);if(!s||!s.head||s.getElementById(Vt))return;const h=s.createElement("style");h.id=Vt;let b=Ln(s);b&&(h.nonce=b),h.textContent=`
|
|
2
|
+
@layer {
|
|
3
|
+
[${Ht}] {
|
|
4
|
+
touch-action: pan-x pan-y pinch-zoom;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
`.trim(),s.head.prepend(h)},[v]),d.useEffect(()=>{let s=K.current;return()=>{$||Xe(s.target??void 0);for(let h of s.disposables)h();s.disposables=[]}},[$]),{isPressed:u||D,pressProps:V(m,N,{[Ht]:!0})}}function Je(t){return t.tagName==="A"&&t.hasAttribute("href")}function Ze(t,e){const{key:r,code:n}=t,i=e,o=i.getAttribute("role");return(r==="Enter"||r===" "||r==="Spacebar"||n==="Space")&&!(i instanceof H(i).HTMLInputElement&&!qt(i,r)||i instanceof H(i).HTMLTextAreaElement||i.isContentEditable)&&!((o==="link"||!o&&Je(i))&&r!=="Enter")}function Fn(t){const{targetTouches:e}=t;return e.length>0?e[0]:null}function Gt(t,e){const r=t.changedTouches;for(let n=0;n<r.length;n++){const i=r[n];if(i.identifier===e)return i}return null}function te(t,e){let r=0,n=0;return e.targetTouches&&e.targetTouches.length===1&&(r=e.targetTouches[0].clientX,n=e.targetTouches[0].clientY),{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:r,clientY:n}}function ie(t,e){let r=e.clientX,n=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:r,clientY:n,key:e.key}}function Dn(t){let e=0,r=0;return t.width!==void 0?e=t.width/2:t.radiusX!==void 0&&(e=t.radiusX),t.height!==void 0?r=t.height/2:t.radiusY!==void 0&&(r=t.radiusY),{top:t.clientY-r,right:t.clientX+e,bottom:t.clientY+r,left:t.clientX-e}}function Nn(t,e){return!(t.left>e.right||e.left>t.right||t.top>e.bottom||e.top>t.bottom)}function Yt(t,e){let r=e.getBoundingClientRect(),n=Dn(t);return Nn(r,n)}function On(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!Je(t)}function Xt(t,e){return t instanceof HTMLInputElement?!qt(t,e):On(t)}const An=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function qt(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":An.has(t.type)}let Bn=0;const Qe=new Map;function zn(t){let[e,r]=d.useState();return Q(()=>{if(!t)return;let n=Qe.get(t);if(n)r(n.element.id);else{let i=`react-aria-description-${Bn++}`;r(i);let o=document.createElement("div");o.id=i,o.style.display="none",o.textContent=t,document.body.appendChild(o),n={refCount:0,element:o},Qe.set(t,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),Qe.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}const Rn=500;function Wn(t){let{isDisabled:e,onLongPressStart:r,onLongPressEnd:n,onLongPress:i,threshold:o=Rn,accessibilityDescription:l}=t;const c=d.useRef(void 0);let{addGlobalListener:u,removeGlobalListener:y}=Wt(),{pressProps:g}=jt({isDisabled:e,onPressStart(v){if(v.continuePropagation(),(v.pointerType==="mouse"||v.pointerType==="touch")&&(r&&r({...v,type:"longpressstart"}),c.current=setTimeout(()=>{v.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),B(v.target).activeElement!==v.target&&q(v.target),i&&i({...v,type:"longpress"}),c.current=void 0},o),v.pointerType==="touch")){let m=M=>{M.preventDefault()},D=H(v.target);u(v.target,"contextmenu",m,{once:!0}),u(D,"pointerup",()=>{setTimeout(()=>{y(v.target,"contextmenu",m)},30)},{once:!0})}},onPressEnd(v){c.current&&clearTimeout(c.current),n&&(v.pointerType==="mouse"||v.pointerType==="touch")&&n({...v,type:"longpressend"})}}),$=zn(i&&!e?l:void 0);return{longPressProps:V(g,$)}}function Un(t){let{id:e,selectionManager:r,key:n,ref:i,shouldSelectOnPressUp:o,shouldUseVirtualFocus:l,focus:c,isDisabled:u,onAction:y,allowsDifferentPressOrigin:g,linkBehavior:$="action"}=t,v=Re();e=$e(e);let m=f=>{if(f.pointerType==="keyboard"&&je(f))r.toggleSelection(n);else{if(r.selectionMode==="none")return;if(r.isLink(n)){if($==="selection"&&i.current){let E=r.getItemProps(n);v.open(i.current,f,E.href,E.routerOptions),r.setSelectedKeys(r.selectedKeys);return}else if($==="override"||$==="none")return}r.selectionMode==="single"?r.isSelected(n)&&!r.disallowEmptySelection?r.toggleSelection(n):r.replaceSelection(n):f&&f.shiftKey?r.extendSelection(n):r.selectionBehavior==="toggle"||f&&(oe(f)||f.pointerType==="touch"||f.pointerType==="virtual")?r.toggleSelection(n):r.replaceSelection(n)}};d.useEffect(()=>{n===r.focusedKey&&r.isFocused&&(l?Ot(i.current):c?c():X()!==i.current&&i.current&&Ke(i.current))},[i,n,r.focusedKey,r.childFocusStrategy,r.isFocused,l]),u=u||r.isDisabled(n);let D={};!l&&!u?D={tabIndex:n===r.focusedKey?0:-1,onFocus(f){w(f)===i.current&&r.setFocusedKey(n)}}:u&&(D.onMouseDown=f=>{f.preventDefault()}),d.useEffect(()=>{u&&r.focusedKey===n&&r.setFocusedKey(null)},[r,u,n]);let M=r.isLink(n)&&$==="override",K=y&&t.UNSTABLE_itemBehavior==="action",L=r.isLink(n)&&$!=="selection"&&$!=="none",_=!u&&r.canSelectItem(n)&&!M&&!K,x=(y||L)&&!u,S=x&&(r.selectionBehavior==="replace"?!_:!_||r.isEmpty),P=x&&_&&r.selectionBehavior==="replace",O=S||P,I=d.useRef(null),A=O&&_,C=d.useRef(!1),R=d.useRef(!1),W=r.getItemProps(n),z=f=>{y&&(y(),i.current?.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),L&&i.current&&v.open(i.current,f,W.href,W.routerOptions)},N={ref:i};if(o?(N.onPressStart=f=>{I.current=f.pointerType,C.current=A,f.pointerType==="keyboard"&&(!O||Zt(f.key))&&m(f)},g?(N.onPressUp=S?void 0:f=>{f.pointerType==="mouse"&&_&&m(f)},N.onPress=S?z:f=>{f.pointerType!=="keyboard"&&f.pointerType!=="mouse"&&_&&m(f)}):N.onPress=f=>{if(S||P&&f.pointerType!=="mouse"){if(f.pointerType==="keyboard"&&!Jt(f.key))return;z(f)}else f.pointerType!=="keyboard"&&_&&m(f)}):(N.onPressStart=f=>{I.current=f.pointerType,C.current=A,R.current=S,_&&(f.pointerType==="mouse"&&!S||f.pointerType==="keyboard"&&(!x||Zt(f.key)))&&m(f)},N.onPress=f=>{(f.pointerType==="touch"||f.pointerType==="pen"||f.pointerType==="virtual"||f.pointerType==="keyboard"&&O&&Jt(f.key)||f.pointerType==="mouse"&&R.current)&&(O?z(f):_&&m(f))}),D["data-collection"]=kn(r.collection),D["data-key"]=n,N.preventFocusOnPress=l,l&&(N=V(N,{onPressStart(f){f.pointerType!=="touch"&&(r.setFocused(!0),r.setFocusedKey(n))},onPress(f){f.pointerType==="touch"&&(r.setFocused(!0),r.setFocusedKey(n))}})),W)for(let f of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])W[f]&&(N[f]=De(N[f],W[f]));let{pressProps:s,isPressed:h}=jt(N),b=P?f=>{I.current==="mouse"&&(f.stopPropagation(),f.preventDefault(),z(f))}:void 0,{longPressProps:p}=Wn({isDisabled:!A,onLongPress(f){f.pointerType==="touch"&&(m(f),r.setSelectionBehavior("toggle"))}}),T=f=>{I.current==="touch"&&C.current&&f.preventDefault()},a=$!=="none"&&r.isLink(n)?f=>{Z.isOpening||f.preventDefault()}:void 0;return{itemProps:V(D,_||S||l&&!u?s:{},A?p:{},{onDoubleClick:b,onDragStartCapture:T,onClick:a,id:e},l?{onMouseDown:f=>f.preventDefault()}:void 0),isPressed:h,isSelected:r.isSelected(n),isFocused:r.isFocused&&r.focusedKey===n,isDisabled:u,allowsSelection:_,hasAction:O}}function Jt(t){return t==="Enter"}function Zt(t){return t===" "}function Vn(t,e,r){let{key:n,isDisabled:i,shouldSelectOnPressUp:o}=t,{selectionManager:l,selectedKey:c}=e,u=n===c,y=i||e.isDisabled||e.selectionManager.isDisabled(n),g=e.collection.getItem(n),{itemProps:$,isPressed:v}=Un({selectionManager:l,key:n,ref:r,isDisabled:y,shouldSelectOnPressUp:o??g?.props.href!=null,linkBehavior:"selection"}),m=ye(e,n,"tab"),D=ye(e,n,"tabpanel"),{tabIndex:M}=$,K=Fr(g?.props,{labelable:!0});delete K.id;let L=gn(g?.props),{focusableProps:_}=_n({...g?.props,isDisabled:y},r);return{tabProps:V(K,_,L,$,{id:m,"aria-selected":u,"aria-disabled":y||void 0,"aria-controls":u?D:void 0,tabIndex:y?void 0:M,role:"tab"}),isSelected:u,isDisabled:y,isPressed:v}}class Hn{constructor(e,r,n,i){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=l=>{if(l.nodeType===Node.ELEMENT_NODE){const c=l.shadowRoot;if(c){const u=this._doc.createTreeWalker(c,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(u),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(l);if(this.filter?.acceptNode)return this.filter.acceptNode(l);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=r,this.filter=i??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=r,this._walkerStack.unshift(e.createTreeWalker(r,n,this._acceptNode));const o=r.shadowRoot;if(o){const l=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(l)}}get currentNode(){return this._currentNode}set currentNode(e){if(!k(this.root,e))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const r=[];let n=e,i=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const l=n,c=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});r.push(c),c.currentNode=i,this._currentSetFor.add(c),n=i=l.host}else n=n.parentNode;const o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});r.push(o),o.currentNode=i,this._currentSetFor.add(o),this._walkerStack=r}get doc(){return this._doc}firstChild(){let e=this.currentNode,r=this.nextNode();return k(e,r)?(r&&(this.currentNode=r),r):(this.currentNode=e,null)}lastChild(){let r=this._walkerStack[0].lastChild();return r&&(this.currentNode=r),r}nextNode(){const e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let n;if(typeof this.filter=="function"?n=this.filter(e):this.filter?.acceptNode&&(n=this.filter.acceptNode(e)),n===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let i=this.nextNode();return i&&(this.currentNode=i),i}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){const e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null;return null}const r=e.previousNode();if(r){if(r.shadowRoot){let i;if(typeof this.filter=="function"?i=this.filter(r):this.filter?.acceptNode&&(i=this.filter.acceptNode(r)),i===NodeFilter.FILTER_ACCEPT)return r&&(this.currentNode=r),r;let o=this.lastChild();return o&&(this.currentNode=o),o}return r&&(this.currentNode=r),r}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function jn(t,e,r,n){return me()?new Hn(t,e,r,n):t.createTreeWalker(e,r,n)}function Gn(t){if(!t.form)return Array.from(B(t).querySelectorAll(`input[type="radio"][name="${CSS.escape(t.name)}"]`)).filter(n=>!n.form);const e=t.form.elements.namedItem(t.name);let r=H(t);return e instanceof r.RadioNodeList?Array.from(e).filter(n=>n instanceof r.HTMLInputElement):e instanceof r.HTMLInputElement?[e]:[]}function Yn(t){if(t.checked)return!0;const e=Gn(t);return e.length>0&&!e.some(r=>r.checked)}function Qt(t,e){return!t||!e?!1:e.some(r=>k(r,t))}function er(t,e,r){let n=e?.tabbable?St:mt,i=t?.nodeType===Node.ELEMENT_NODE?t:null,o=B(i),l=jn(o,t||o,NodeFilter.SHOW_ELEMENT,{acceptNode(c){return k(e?.from,c)||e?.tabbable&&c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(!Yn(c)||l.currentNode.tagName==="INPUT"&&l.currentNode.type==="radio"&&l.currentNode.name===c.name)?NodeFilter.FILTER_REJECT:n(c)&&(!r||Qt(c,r))&&(!e?.accept||e.accept(c))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e?.from&&(l.currentNode=e.from),l}class et{constructor(){this.fastMap=new Map,this.root=new tr({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,r,n){let i=this.fastMap.get(r??null);if(!i)return;let o=new tr({scopeRef:e});i.addChild(o),o.parent=i,this.fastMap.set(e,o),n&&(o.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let r=this.fastMap.get(e);if(!r)return;let n=r.parent;for(let o of this.traverse())o!==r&&r.nodeToRestore&&o.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&Qt(o.nodeToRestore,r.scopeRef.current)&&(o.nodeToRestore=r.nodeToRestore);let i=r.children;n&&(n.removeChild(r),i.size>0&&i.forEach(o=>n&&n.addChild(o))),this.fastMap.delete(r.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let r of e.children)yield*this.traverse(r)}clone(){let e=new et;for(let r of this.traverse())e.addTreeNode(r.scopeRef,r.parent?.scopeRef??null,r.nodeToRestore);return e}}class tr{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}new et;function Xn(t,e){let r=e?.isDisabled,[n,i]=d.useState(!1);return Q(()=>{if(t?.current&&!r){let o=()=>{if(t.current){let c=er(t.current,{tabbable:!0});i(!!c.nextNode())}};o();let l=new MutationObserver(o);return l.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{l.disconnect()}}}),r?!1:n}function rr(t,e){let{id:r,"aria-label":n,"aria-labelledby":i}=t;return r=$e(r),i&&n?i=[...new Set([r,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!n&&!i&&e&&(n=e),{id:r,"aria-label":n,"aria-labelledby":i}}function qn(t,e,r){let n=Xn(r)?void 0:0;const i=ye(e,t.id??e?.selectedKey,"tabpanel"),o=rr({...t,id:i,"aria-labelledby":ye(e,e?.selectedKey,"tab")});return{tabPanelProps:V(o,{tabIndex:n,role:"tabpanel","aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]})}}class Jn{constructor(e,r,n,i=new Set){this.collection=e,this.flipDirection=r==="rtl"&&n==="horizontal",this.disabledKeys=i,this.tabDirection=n==="horizontal"}getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){return this.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled}getFirstKey(){let e=this.collection.getFirstKey();return e!=null&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return e!=null&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){let r=e;do r=this.collection.getKeyAfter(r),r==null&&(r=this.collection.getFirstKey());while(r!=null&&this.isDisabled(r));return r}getPreviousKey(e){let r=e;do r=this.collection.getKeyBefore(r),r==null&&(r=this.collection.getLastKey());while(r!=null&&this.isDisabled(r));return r}}const Zn=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Qn=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function ei(t){if(Intl.Locale){let r=new Intl.Locale(t).maximize(),n=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(n)return n.direction==="rtl";if(r.script)return Zn.has(r.script)}let e=t.split("-")[0];return Qn.has(e)}const nr=Symbol.for("react-aria.i18n.locale");function ir(){let t=typeof window<"u"&&window[nr]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:ei(t)?"rtl":"ltr"}}let tt=ir(),de=new Set;function sr(){tt=ir();for(let t of de)t(tt)}function ti(){let t=yt(),[e,r]=d.useState(tt);return d.useEffect(()=>(de.size===0&&window.addEventListener("languagechange",sr),de.add(r),()=>{de.delete(r),de.size===0&&window.removeEventListener("languagechange",sr)}),[]),t?{locale:typeof window<"u"&&window[nr]||"en-US",direction:"ltr"}:e}const ri=d.createContext(null);function or(){let t=ti();return d.useContext(ri)||t}const ni="react-aria-clear-focus",ii="react-aria-focus";function si(t,e){if(!t)return!1;let r=window.getComputedStyle(t),n=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return t===n&&r.overflow!=="hidden"&&(i=!0),i&&e&&(i=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),i}function lr(t,e){let r=[],n=document.scrollingElement||document.documentElement;do si(t,e)&&r.push(t),t=t.parentElement;while(t&&t!==n);return r}function rt(t,e,r={}){let{block:n="nearest",inline:i="nearest"}=r;if(t===e)return;let o=t.scrollTop,l=t.scrollLeft,c=e.getBoundingClientRect(),u=t.getBoundingClientRect(),y=window.getComputedStyle(e),g=window.getComputedStyle(t),$=document.scrollingElement||document.documentElement,v=t===$?0:u.top,m=t===$?t.clientHeight:u.bottom,D=t===$?0:u.left,M=t===$?t.clientWidth:u.right,K=parseInt(y.scrollMarginTop,10)||0,L=parseInt(y.scrollMarginBottom,10)||0,_=parseInt(y.scrollMarginLeft,10)||0,x=parseInt(y.scrollMarginRight,10)||0,S=parseInt(g.scrollPaddingTop,10)||0,P=parseInt(g.scrollPaddingBottom,10)||0,O=parseInt(g.scrollPaddingLeft,10)||0,I=parseInt(g.scrollPaddingRight,10)||0,A=parseInt(g.borderTopWidth,10)||0,C=parseInt(g.borderBottomWidth,10)||0,R=parseInt(g.borderLeftWidth,10)||0,W=parseInt(g.borderRightWidth,10)||0,z=c.top-K,N=c.bottom+L,s=c.left-_,h=c.right+x,b=t===$?0:R+W,p=t===$?0:A+C,T=t.offsetWidth-t.clientWidth-b,a=t.offsetHeight-t.clientHeight-p,f=v+A+S,E=m-C-P-a,fe=D+R+O,pe=M-W-I;g.direction==="rtl"&&!Ee()?fe+=T:pe-=T;let Ce=z<f||N>E,Le=s<fe||h>pe;if(Ce&&n==="start")o+=z-f;else if(Ce&&n==="center")o+=(z+N)/2-(f+E)/2;else if(Ce&&n==="end")o+=N-E;else if(Ce&&n==="nearest"){let he=z-f,be=N-E;o+=Math.abs(he)<=Math.abs(be)?he:be}if(Le&&i==="start")l+=s-fe;else if(Le&&i==="center")l+=(s+h)/2-(fe+pe)/2;else if(Le&&i==="end")l+=h-pe;else if(Le&&i==="nearest"){let he=s-fe,be=h-pe;l+=Math.abs(he)<=Math.abs(be)?he:be}if(process.env.NODE_ENV==="test"){t.scrollLeft=l,t.scrollTop=o;return}t.scrollTo({left:l,top:o})}function ar(t,e={}){let{containingElement:r}=e;if(t&&t.isConnected){let n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let{left:o,top:l}=t.getBoundingClientRect(),c=lr(t,!0);for(let g of c)rt(g,t);let{left:u,top:y}=t.getBoundingClientRect();if(Math.abs(o-u)>1||Math.abs(l-y)>1){c=r?lr(r,!0):[];for(let g of c)rt(g,r,{block:"center",inline:"center"})}}else{let{left:o,top:l}=t.getBoundingClientRect();t?.scrollIntoView?.({block:"nearest"});let{left:c,top:u}=t.getBoundingClientRect();(Math.abs(o-c)>1||Math.abs(l-u)>1)&&(r?.scrollIntoView?.({block:"center",inline:"center"}),t.scrollIntoView?.({block:"nearest"}))}}}function xe(t,e,r,n){let i=Pe(r),o=r==null;d.useEffect(()=>{if(o||!t.current)return;let l=t.current;return l.addEventListener(e,i,n),()=>{l.removeEventListener(e,i,n)}},[t,e,n,o])}const oi=1e3;function li(t){let{keyboardDelegate:e,selectionManager:r,onTypeSelect:n}=t,i=d.useRef({search:"",timeout:void 0}).current,o=l=>{let c=ai(l.key);if(!(!c||l.ctrlKey||l.metaKey||!k(l.currentTarget,w(l))||i.search.length===0&&c===" ")){if(c===" "&&i.search.trim().length>0&&(l.preventDefault(),"continuePropagation"in l||l.stopPropagation()),i.search+=c,e.getKeyForSearch!=null){let u=e.getKeyForSearch(i.search,r.focusedKey);u==null&&(u=e.getKeyForSearch(i.search)),u!=null&&(r.setFocusedKey(u),n&&n(u))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},oi)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?o:void 0}}}function ai(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function cr(t,e){const r=d.useRef(!0),n=d.useRef(null);Q(()=>(r.current=!0,()=>{r.current=!1}),[]),Q(()=>{r.current?r.current=!1:(!n.current||e.some((i,o)=>!Object.is(i,n[o])))&&t(),n.current=e},e)}function ci(t){let{selectionManager:e,keyboardDelegate:r,ref:n,autoFocus:i=!1,shouldFocusWrap:o=!1,disallowEmptySelection:l=!1,disallowSelectAll:c=!1,escapeKeyBehavior:u="clearSelection",selectOnFocus:y=e.selectionBehavior==="replace",disallowTypeAhead:g=!1,shouldUseVirtualFocus:$,allowsTabNavigation:v=!1,scrollRef:m=n,linkBehavior:D="action"}=t,{direction:M}=or(),K=Re(),L=s=>{if(s.altKey&&s.key==="Tab"&&s.preventDefault(),!n.current||!k(n.current,w(s)))return;const h=(b,p)=>{if(b!=null){if(e.isLink(b)&&D==="selection"&&y&&!je(s)){st.flushSync(()=>{e.setFocusedKey(b,p)});let T=Ge(n,b),a=e.getItemProps(b);T&&K.open(T,s,a.href,a.routerOptions);return}if(e.setFocusedKey(b,p),e.isLink(b)&&D==="override")return;s.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(b):y&&!je(s)&&e.replaceSelection(b)}};switch(s.key){case"ArrowDown":if(r.getKeyBelow){let b=e.focusedKey!=null?r.getKeyBelow?.(e.focusedKey):r.getFirstKey?.();b==null&&o&&(b=r.getFirstKey?.(e.focusedKey)),b!=null&&(s.preventDefault(),h(b))}break;case"ArrowUp":if(r.getKeyAbove){let b=e.focusedKey!=null?r.getKeyAbove?.(e.focusedKey):r.getLastKey?.();b==null&&o&&(b=r.getLastKey?.(e.focusedKey)),b!=null&&(s.preventDefault(),h(b))}break;case"ArrowLeft":if(r.getKeyLeftOf){let b=e.focusedKey!=null?r.getKeyLeftOf?.(e.focusedKey):r.getFirstKey?.();b==null&&o&&(b=M==="rtl"?r.getFirstKey?.(e.focusedKey):r.getLastKey?.(e.focusedKey)),b!=null&&(s.preventDefault(),h(b,M==="rtl"?"first":"last"))}break;case"ArrowRight":if(r.getKeyRightOf){let b=e.focusedKey!=null?r.getKeyRightOf?.(e.focusedKey):r.getFirstKey?.();b==null&&o&&(b=M==="rtl"?r.getLastKey?.(e.focusedKey):r.getFirstKey?.(e.focusedKey)),b!=null&&(s.preventDefault(),h(b,M==="rtl"?"last":"first"))}break;case"Home":if(r.getFirstKey){if(e.focusedKey===null&&s.shiftKey)return;s.preventDefault();let b=r.getFirstKey(e.focusedKey,oe(s));e.setFocusedKey(b),b!=null&&(oe(s)&&s.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(b):y&&e.replaceSelection(b))}break;case"End":if(r.getLastKey){if(e.focusedKey===null&&s.shiftKey)return;s.preventDefault();let b=r.getLastKey(e.focusedKey,oe(s));e.setFocusedKey(b),b!=null&&(oe(s)&&s.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(b):y&&e.replaceSelection(b))}break;case"PageDown":if(r.getKeyPageBelow&&e.focusedKey!=null){let b=r.getKeyPageBelow(e.focusedKey);b!=null&&(s.preventDefault(),h(b))}break;case"PageUp":if(r.getKeyPageAbove&&e.focusedKey!=null){let b=r.getKeyPageAbove(e.focusedKey);b!=null&&(s.preventDefault(),h(b))}break;case"a":oe(s)&&e.selectionMode==="multiple"&&c!==!0&&(s.preventDefault(),e.selectAll());break;case"Escape":u==="clearSelection"&&!l&&e.selectedKeys.size!==0&&(s.stopPropagation(),s.preventDefault(),e.clearSelection());break;case"Tab":if(!v){if(s.shiftKey)n.current.focus();else{let b=er(n.current,{tabbable:!0}),p,T;do T=b.lastChild(),T&&(p=T);while(T);let a=X();p&&(!vt(p)||a&&!St(a))&&q(p)}break}}},_=d.useRef({top:0,left:0});xe(m,"scroll",()=>{_.current={top:m.current?.scrollTop??0,left:m.current?.scrollLeft??0}});let x=s=>{if(e.isFocused){k(s.currentTarget,w(s))||e.setFocused(!1);return}if(k(s.currentTarget,w(s))){if(e.setFocused(!0),e.focusedKey==null){let h=p=>{p!=null&&(e.setFocusedKey(p),y&&!e.isSelected(p)&&e.replaceSelection(p))},b=s.relatedTarget;b&&s.currentTarget.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?h(e.lastSelectedKey??r.getLastKey?.()):h(e.firstSelectedKey??r.getFirstKey?.())}else m.current&&(m.current.scrollTop=_.current.top,m.current.scrollLeft=_.current.left);if(e.focusedKey!=null&&m.current){let h=Ge(n,e.focusedKey);h instanceof HTMLElement&&(!vt(h)&&!$&&q(h),Ve()==="keyboard"&&ar(h,{containingElement:n.current}))}}},S=s=>{k(s.currentTarget,s.relatedTarget)||e.setFocused(!1)},P=d.useRef(!1);xe(n,ii,$?s=>{let{detail:h}=s;s.stopPropagation(),e.setFocused(!0),h?.focusStrategy==="first"&&(P.current=!0)}:void 0),cr(()=>{if(P.current){let s=r.getFirstKey?.()??null;if(s==null){let h=X();Ot(n.current),At(h,null),e.collection.size>0&&(P.current=!1)}else e.setFocusedKey(s),P.current=!1}},[e.collection]),cr(()=>{e.collection.size>0&&(P.current=!1)},[e.focusedKey]),xe(n,ni,$?s=>{s.stopPropagation(),e.setFocused(!1),s.detail?.clearFocusKey&&e.setFocusedKey(null)}:void 0);const O=d.useRef(i),I=d.useRef(!1);d.useEffect(()=>{if(O.current){let s=null;i==="first"&&(s=r.getFirstKey?.()??null),i==="last"&&(s=r.getLastKey?.()??null);let h=e.selectedKeys;if(h.size){for(let b of h)if(e.canSelectItem(b)){s=b;break}}e.setFocused(!0),e.setFocusedKey(s),s==null&&!$&&n.current&&Ke(n.current),e.collection.size>0&&(O.current=!1,I.current=!0)}});let A=d.useRef(e.focusedKey),C=d.useRef(null);d.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==A.current||I.current)&&m.current&&n.current){let s=Ve(),h=Ge(n,e.focusedKey);if(!(h instanceof HTMLElement))return;(s==="keyboard"||I.current)&&(C.current&&cancelAnimationFrame(C.current),C.current=requestAnimationFrame(()=>{m.current&&(rt(m.current,h),s!=="virtual"&&ar(h,{containingElement:n.current}))}))}!$&&e.isFocused&&e.focusedKey==null&&A.current!=null&&n.current&&Ke(n.current),A.current=e.focusedKey,I.current=!1}),d.useEffect(()=>()=>{C.current&&cancelAnimationFrame(C.current)},[]),xe(n,"react-aria-focus-scope-restore",s=>{s.preventDefault(),e.setFocused(!0)});let R={onKeyDown:L,onFocus:x,onBlur:S,onMouseDown(s){m.current===w(s)&&s.preventDefault()}},{typeSelectProps:W}=li({keyboardDelegate:r,selectionManager:e});g||(R=V(W,R));let z;$||(z=e.focusedKey==null?0:-1);let N=Pn(e.collection);return{collectionProps:V(R,{tabIndex:z,"data-collection":N})}}function ui(t,e,r){let{orientation:n="horizontal",keyboardActivation:i="automatic"}=t,{collection:o,selectionManager:l,disabledKeys:c}=e,{direction:u}=or(),y=d.useMemo(()=>new Jn(o,u,n,c),[o,c,n,u]),{collectionProps:g}=ci({ref:r,selectionManager:l,keyboardDelegate:y,selectOnFocus:i==="automatic",disallowEmptySelection:!0,scrollRef:r,linkBehavior:"selection"}),$=$e();ht.set(e,$);let v=rr({...t,id:$});return{tabListProps:{...V(g,v),role:"tablist","aria-orientation":n,tabIndex:void 0}}}function di(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ur(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function dr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ur(Object(r),!0).forEach(function(n){di(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ur(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var fi=(t,e,r)=>{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},nt=t=>e=>{var r=t.defaultClassName,n=dr(dr({},t.defaultVariants),e);for(var i in n){var o,l=(o=n[i])!==null&&o!==void 0?o:t.defaultVariants[i];if(l!=null){var c=l;typeof c=="boolean"&&(c=c===!0?"true":"false");var u=t.variantClassNames[i][c];u&&(r+=" "+u)}}for(var[y,g]of t.compoundVariants)fi(y,n,t.defaultVariants)&&(r+=" "+g);return r},pi=nt({defaultClassName:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz0",variantClassNames:{context:{container:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz1",navigation:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz2"},active:{true:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz3",false:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz4"},disabled:{true:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz5",false:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz6"}},defaultVariants:{},compoundVariants:[[{context:"container",active:!0},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz7"],[{context:"container",active:!1},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz8"],[{context:"container",active:!1,disabled:!1},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz9"],[{context:"navigation",active:!0},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzza"],[{context:"navigation",active:!1},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzb"],[{context:"navigation",active:!1,disabled:!1},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzc"],[{context:"navigation",active:!1,disabled:!0},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzd"]]}),hi=nt({defaultClassName:"",variantClassNames:{active:{true:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzze",false:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzf"},disabled:{true:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzg",false:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzh"},context:{navigation:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzi",container:"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzj"}},defaultVariants:{},compoundVariants:[[{context:"navigation",active:!0},"pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzk"]]});function fr({context:t,item:e,state:r,...n}){const{key:i}=e,o=F.useRef(null),{tabProps:l}=Vn({key:i},r,o),c=r.selectedKey===i,u=r.disabledKeys.has(i),y=U.modChildren(e.rendered,g=>g.type.displayName==="SpsTag"||U.Metadata.isWoodlandComponent(g.type)&&U.Metadata.get(g.type).name==="Tag"?[{className:U.cl(g.props.className,hi({active:c,disabled:u,context:t}))}]:[{}]);return F.createElement("div",{...l,ref:o,className:pi({active:c,disabled:u,context:t}),...n},y)}U.Metadata.set(fr,{name:"Tab"});function pr({context:t,"data-testid":e,state:r,...n}){const i=F.useRef(null),{tabPanelProps:o}=qn(n,r,i),l=t==="container"?U.Content:"div";return F.createElement(l,{...o,ref:i,"data-testid":e},r.selectedItem?r.selectedItem.props.children:null)}U.Metadata.set(pr,{name:"TabPanel"});var bi=39,yi="pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er1",hr="pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er2",gi="pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er3",$i="pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er4",vi=nt({defaultClassName:"pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er5 pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er0",variantClassNames:{context:{container:"pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er6",navigation:"pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er7"}},defaultVariants:{},compoundVariants:[]});const mi=.75;function it({className:t,context:e="navigation","data-testid":r,selectedKey:n,defaultSelectedKey:i,...o}){const l={...o,selectedKey:n??void 0,defaultSelectedKey:i??void 0},c=kr(l),u=F.useRef(null),{tabListProps:y}=ui(l,c,u),g=U.useChildTestIdAttrBuilder({"data-testid":r}),$=e==="container",[v,m]=F.useState(!1),[D,M]=F.useState(!1),K=F.useCallback(()=>{const S=u.current;if(!S)return;const P=S.scrollWidth-S.clientWidth;m(S.scrollLeft>1),M(P-S.scrollLeft>1)},[]);F.useEffect(()=>{const S=u.current;if(!S)return;K(),S.addEventListener("scroll",K,{passive:!0});const P=new ResizeObserver(K);return P.observe(S),()=>{S.removeEventListener("scroll",K),P.disconnect()}},[K]);const L=S=>{const P=u.current;if(!P)return;const O=P.clientWidth*mi;P.scrollBy({left:S==="left"?-O:O,behavior:"smooth"})},_=F.useCallback(()=>{const S=u.current;if(!S)return;const P=S.querySelector('[aria-selected="true"]');if(!P)return;const O=S.getBoundingClientRect(),I=P.getBoundingClientRect(),A=bi,C=S.scrollLeft>1,R=S.scrollWidth-S.clientWidth-S.scrollLeft>1,W=O.left+(C?A:0),z=O.right-(R?A:0);I.left<W?S.scrollBy({left:I.left-(O.left+A),behavior:"smooth"}):I.right>z&&S.scrollBy({left:I.right-(O.right-A),behavior:"smooth"})},[]);F.useEffect(()=>{_()},[c.selectedKey,_]);const x=()=>{requestAnimationFrame(()=>_())};return F.createElement(F.Fragment,null,F.createElement("div",{className:yi,"data-testid":r},$&&v&&F.createElement("button",{"aria-label":"Show previous tabs",title:"Show previous tabs",className:U.cl(hr,gi),"data-side":"left",onClick:()=>L("left"),type:"button"},F.createElement(U.Icon,{icon:"chevron-left",size:"sm","aria-hidden":"true"})),F.createElement("div",{...y,ref:u,className:U.cl(vi({context:e}),t),onClickCapture:x},[...c.collection].map(S=>F.createElement(fr,{key:S.key,item:S,state:c,context:e,...g(`tab-${String(S.key)}`)}))),$&&D&&F.createElement("button",{"aria-label":"Show more tabs",title:"Show more tabs",className:U.cl(hr,$i),onClick:()=>L("right"),type:"button"},F.createElement(U.Icon,{icon:"chevron-right",size:"sm","aria-hidden":"true"}))),F.createElement(pr,{key:c.selectedItem?c.selectedItem.key:null,state:c,context:e,...g("tab-panel")}))}U.Metadata.set(it,{name:"Tabs"});const Si={"Tabbed Navigation":{components:[it],examples:{basic:{label:"Basic Navigation Tabs",description:ot.code`
|
|
2
8
|
<p>Navigation tabs</p>
|
|
3
|
-
`,examples:{basic:{react:
|
|
9
|
+
`,examples:{basic:{react:ot.code`
|
|
4
10
|
import { Item } from "@react-stately/collections";
|
|
5
11
|
import { Box, Icon } from "@sps-woodland/core";
|
|
6
12
|
import { Tabs } from "@sps-woodland/tabs";
|
|
@@ -61,4 +67,4 @@
|
|
|
61
67
|
</Tabs>
|
|
62
68
|
)
|
|
63
69
|
}
|
|
64
|
-
`}}}}}};
|
|
70
|
+
`}}}}}};G.MANIFEST=Si,G.Tabs=it,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz0{align-items:center;border-top-width:.0625rem;border-right-width:.0625rem;border-style:solid;cursor:pointer;display:flex;font-size:.75rem;font-weight:600;line-height:.875rem;padding:.5rem 1rem;white-space:nowrap}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz1{border-bottom-width:0;border-left-width:.0625rem;border-top-left-radius:.25rem;border-top-right-radius:.25rem;color:#717779;margin-bottom:-1px}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz2{border-bottom-width:.0625rem;border-left-width:0}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz2:first-child{border-left-width:.0625rem;border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz2:last-child{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz5{cursor:not-allowed}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz7{background-color:#fff;border-color:#d2d4d4;color:#1f282c}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz8{border-color:transparent}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz9:hover{background-color:#f3f4f4;border-color:#d2d4d4;box-shadow:0 -.0625rem #d2d4d4 inset}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzza{background-color:#007db8;border-color:#007db8;color:#fff}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzb{background-color:#fff;border-color:#d2d4d4;color:#4b5356}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzc:hover{background-color:#f3f4f4}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzd{color:#717779}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzzk{background-color:#fff!important;color:#4b5356!important}.pkg_sps-woodland_tabs__version_8_52_0__hash_kz6kzz0 svg{margin-bottom:0}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er0{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er0::-webkit-scrollbar{display:none}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er1{position:relative}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er2{position:absolute;bottom:1px;z-index:1;display:flex;align-items:center;height:34px;width:32px;background-color:#e9e9ea;justify-content:center;border:none;padding:0;cursor:pointer}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er2:focus{outline:none}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er2:after{content:"";position:absolute;display:block;height:34px;width:8px}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er3{left:0}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er3:after{background:linear-gradient(to right,#e9e9eaff,transparent);right:-7px}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er4{right:0}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er4:after{background:linear-gradient(to left,#e9e9eaff,transparent);left:-7px}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er6{background-color:#e9e9ea;border-bottom-color:#d2d4d4;border-bottom-style:solid;border-bottom-width:.0625rem;border-top-left-radius:.25rem;border-top-right-radius:.25rem;padding-top:1rem;padding-left:1rem;padding-right:1rem}.pkg_sps-woodland_tabs__version_8_52_0__hash_fy26er7{margin-bottom:1rem}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecipeVariants } from "@vanilla-extract/recipes";
|
|
2
|
+
import type { VariantDefinitions, RecipeVariant, BooleanRecipeVariant } from "@sps-woodland/core";
|
|
3
|
+
interface TabVariantDefinitions extends VariantDefinitions {
|
|
4
|
+
context: RecipeVariant<"container" | "navigation">;
|
|
5
|
+
active: BooleanRecipeVariant;
|
|
6
|
+
disabled: BooleanRecipeVariant;
|
|
7
|
+
}
|
|
8
|
+
export declare const tab: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<TabVariantDefinitions>;
|
|
9
|
+
export type TabVariants = NonNullable<RecipeVariants<typeof tab>>;
|
|
10
|
+
export declare const tabTag: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<TabVariantDefinitions>;
|
|
11
|
+
export {};
|
package/lib/tab/Tab.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TabListState } from "@react-stately/tabs";
|
|
2
|
+
import type { Node } from "@react-types/shared";
|
|
3
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import type { TabsVariants } from "../tabs/Tabs.css";
|
|
6
|
+
export declare function Tab<T>({ context, item, state, ...rest }: ComponentProps<TabsVariants & {
|
|
7
|
+
item: Node<T>;
|
|
8
|
+
state: TabListState<T>;
|
|
9
|
+
}, HTMLDivElement>): React.ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TabListState } from "@react-stately/tabs";
|
|
2
|
+
import type { AriaTabPanelProps } from "@react-types/tabs";
|
|
3
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import type { TabsVariants } from "../tabs/Tabs.css";
|
|
6
|
+
export declare function TabPanel<T>({ context, "data-testid": dataTestId, state, ...rest }: AriaTabPanelProps & ComponentProps<TabsVariants & {
|
|
7
|
+
state: TabListState<T>;
|
|
8
|
+
}, HTMLDivElement>): React.ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RecipeVariants } from "@vanilla-extract/recipes";
|
|
2
|
+
export declare const SCROLL_BUTTON_WIDTH_PX = 32;
|
|
3
|
+
export declare const SCROLL_BUTTON_HEIGHT_PX = 34;
|
|
4
|
+
export declare const SCROLL_BUTTON_FADE_WIDTH_PX = 8;
|
|
5
|
+
export declare const SCROLL_BUTTON_FADE_OVERHANG_PX: number;
|
|
6
|
+
export declare const SCROLL_BUTTON_VISUAL_FOOTPRINT_PX: number;
|
|
7
|
+
export declare const tabsScrollWrapper: string;
|
|
8
|
+
export declare const tabsScrollButton: string;
|
|
9
|
+
export declare const tabsScrollButtonLeft: string;
|
|
10
|
+
export declare const tabsScrollButtonRight: string;
|
|
11
|
+
export declare const tabs: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
12
|
+
context: {
|
|
13
|
+
container: {
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
borderBottomColor: string;
|
|
16
|
+
borderBottomStyle: any;
|
|
17
|
+
borderBottomWidth: string;
|
|
18
|
+
borderTopLeftRadius: string;
|
|
19
|
+
borderTopRightRadius: string;
|
|
20
|
+
paddingTop: string;
|
|
21
|
+
paddingLeft: string;
|
|
22
|
+
paddingRight: string;
|
|
23
|
+
};
|
|
24
|
+
navigation: {
|
|
25
|
+
marginBottom: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export type TabsVariants = RecipeVariants<typeof tabs>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { TabListProps } from "@react-types/tabs";
|
|
3
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
4
|
+
import type { TabsVariants } from "./Tabs.css";
|
|
5
|
+
export declare function Tabs({ className, context, "data-testid": dataTestId, selectedKey, defaultSelectedKey, ...rest }: TabListProps<Record<string, unknown>> & ComponentProps<TabsVariants, HTMLDivElement>): React.ReactElement;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/tabs",
|
|
3
3
|
"description": "SPS Woodland Design System tabs component",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.52.0",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/tabs",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"import": "./lib/index.js",
|
|
18
18
|
"default": "./lib/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./style.css": "./lib/style.css",
|
|
21
20
|
"./lib/style.css": {
|
|
22
21
|
"import": "./lib/style.css",
|
|
23
22
|
"require": "./lib/style.css"
|
|
@@ -27,22 +26,36 @@
|
|
|
27
26
|
"access": "public"
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|
|
29
|
+
"@react-stately/collections": "^3.0.0",
|
|
30
30
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
31
31
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
32
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
33
|
-
"@sps-woodland/core": "8.
|
|
33
|
+
"@sps-woodland/core": "8.52.0",
|
|
34
|
+
"@sps-woodland/tokens": "8.52.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
37
|
+
"@react-stately/collections": "3.12.10",
|
|
38
|
+
"@react-types/shared": "3.34.0",
|
|
39
|
+
"@react-types/tabs": "3.4.0",
|
|
36
40
|
"@spscommerce/utils": "9.0.3",
|
|
41
|
+
"@types/react": "16.14.35",
|
|
42
|
+
"@vanilla-extract/css": "1.17.4",
|
|
43
|
+
"@vanilla-extract/recipes": "0.2.5",
|
|
44
|
+
"@vanilla-extract/sprinkles": "1.5.1",
|
|
37
45
|
"react": "16.14.0",
|
|
38
46
|
"react-dom": "16.14.0",
|
|
39
|
-
"@sps-woodland/core": "8.
|
|
47
|
+
"@sps-woodland/core": "8.52.0",
|
|
48
|
+
"@sps-woodland/tokens": "8.52.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@react-aria/tabs": "3.12.0",
|
|
52
|
+
"@react-stately/tabs": "3.9.0",
|
|
53
|
+
"@sps-woodland/buttons": "8.52.0"
|
|
40
54
|
},
|
|
41
55
|
"scripts": {
|
|
42
|
-
"build": "pnpm run build:js && pnpm run build:types
|
|
56
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
43
57
|
"build:js": "vite build",
|
|
44
58
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
45
|
-
"build:css": "cp ../core/lib/tabs/style.css lib/style.css 2>/dev/null || echo 'tabs style.css not found, skipping'",
|
|
46
59
|
"watch": "vite build --watch",
|
|
47
60
|
"clean": "git clean -fdX",
|
|
48
61
|
"pub": "node ../../../scripts/publish-package.mjs"
|
package/vite.config.mjs
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
2
3
|
import { defineConfig } from "vite";
|
|
4
|
+
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
|
|
3
5
|
import pkg from "./package.json";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
// No vanilla-extract needed - CSS is provided by the core package.
|
|
7
|
-
|
|
8
|
-
const peerDeps = pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [];
|
|
7
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
9
8
|
|
|
10
9
|
export default defineConfig({
|
|
10
|
+
plugins: [
|
|
11
|
+
vanillaExtractPlugin(
|
|
12
|
+
getVanillaExtractPluginProps({
|
|
13
|
+
packageName: pkg.name,
|
|
14
|
+
packageVersion,
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
],
|
|
11
18
|
build: {
|
|
12
19
|
lib: {
|
|
13
20
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
14
21
|
name: "Tabs",
|
|
15
22
|
fileName: "index",
|
|
23
|
+
cssFileName: "style",
|
|
16
24
|
},
|
|
17
25
|
outDir: path.resolve(__dirname, "./lib"),
|
|
18
26
|
emptyOutDir: false,
|
|
19
27
|
rollupOptions: {
|
|
20
|
-
|
|
21
|
-
external: (id) => !id.endsWith(".css") && peerDeps.some((dep) => id === dep || id.startsWith(dep + "/")),
|
|
28
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
22
29
|
},
|
|
23
30
|
},
|
|
24
31
|
});
|