sqlmesh 0.181.2.dev15__py3-none-any.whl → 0.181.2.dev16__py3-none-any.whl

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.
Files changed (53) hide show
  1. sqlmesh/_version.py +2 -2
  2. {sqlmesh-0.181.2.dev15.dist-info → sqlmesh-0.181.2.dev16.dist-info}/METADATA +1 -1
  3. {sqlmesh-0.181.2.dev15.dist-info → sqlmesh-0.181.2.dev16.dist-info}/RECORD +49 -49
  4. web/client/dist/assets/{Audits-Dt3QUYCw.js → Audits-CpTpRWJS.js} +1 -1
  5. web/client/dist/assets/{Banner-NSDMTUuS.js → Banner-DoiNAKye.js} +1 -1
  6. web/client/dist/assets/{ChevronDownIcon-PDbmvmYa.js → ChevronDownIcon-BEGYfY2e.js} +1 -1
  7. web/client/dist/assets/{ChevronRightIcon-e7qtOZnd.js → ChevronRightIcon-DukIeKXy.js} +1 -1
  8. web/client/dist/assets/{Content-UwEUgKuG.js → Content-C_JUq1Do.js} +1 -1
  9. web/client/dist/assets/{Content-BlU-e5xI.js → Content-CfmwrKKm.js} +1 -1
  10. web/client/dist/assets/{Data-DEoVdKU8.js → Data-ChAnh4ni.js} +1 -1
  11. web/client/dist/assets/{DataCatalog-CgZ0v9q7.js → DataCatalog-DWoqDoha.js} +7 -7
  12. web/client/dist/assets/{Editor-BRHZhM5n.js → Editor-CUljCEXi.js} +1 -1
  13. web/client/dist/assets/{Editor-Dch_R4cm.js → Editor-ClszqJ2I.js} +1 -1
  14. web/client/dist/assets/{Errors-DH-4Ne3K.js → Errors-Fuw_f-1a.js} +1 -1
  15. web/client/dist/assets/{FileExplorer-T0Rm9zhJ.js → FileExplorer-CXZ9Q150.js} +1 -1
  16. web/client/dist/assets/{Footer-1h_XqoQ5.js → Footer-BFLq78dA.js} +1 -1
  17. web/client/dist/assets/{Header-DxWr0vca.js → Header-BEK5IMP9.js} +1 -1
  18. web/client/dist/assets/Input-tR0WpVuK.js +41 -0
  19. web/client/dist/assets/Lineage-CpFxhla3.js +1 -0
  20. web/client/dist/assets/{ListboxShow-DT2Vq8H-.js → ListboxShow-C9Uz0VvV.js} +1 -1
  21. web/client/dist/assets/ModelLineage-bdWk08Ab.js +1 -0
  22. web/client/dist/assets/{Models-7gFwDtX4.js → Models-BU-MA8yO.js} +1 -1
  23. web/client/dist/assets/{Page-CxGA6pbl.js → Page-DwNrMCBx.js} +1 -1
  24. web/client/dist/assets/{Plan-0rJvdSbW.js → Plan-CrjOn4QG.js} +1 -1
  25. web/client/dist/assets/{PlusCircleIcon-D6THv_ZD.js → PlusCircleIcon-C1VPxB8A.js} +1 -1
  26. web/client/dist/assets/{ReportErrors-BcdDXnmw.js → ReportErrors-BcmrRxbG.js} +1 -1
  27. web/client/dist/assets/{Root-PD0OqcHQ.js → Root-BzyY-jcn.js} +1 -1
  28. web/client/dist/assets/{SearchList-k4ylxX-x.js → SearchList-wEGQkxPR.js} +1 -1
  29. web/client/dist/assets/{SelectEnvironment-BsRoqhGW.js → SelectEnvironment-LGhN0dhR.js} +1 -1
  30. web/client/dist/assets/{SourceList-DsSkJAMU.js → SourceList-DHZ9-QtW.js} +1 -1
  31. web/client/dist/assets/{SourceListItem-Bt7Bfyt2.js → SourceListItem-CzN9ypEP.js} +1 -1
  32. web/client/dist/assets/{SplitPane-DWWdLh3i.js → SplitPane-Djy_uJgV.js} +1 -1
  33. web/client/dist/assets/{Tests-Cq9jRmAp.js → Tests-DXoZpfR7.js} +1 -1
  34. web/client/dist/assets/{Welcome-BrOApqHN.js → Welcome-DREQuVRP.js} +1 -1
  35. web/client/dist/assets/{context-YFUfJm57.js → context-C8brTRBZ.js} +2 -2
  36. web/client/dist/assets/{context-DH7g-F8j.js → context-CKu1HxT0.js} +1 -1
  37. web/client/dist/assets/{editor-BKhlmwRX.js → editor-D_hgjDRq.js} +1 -1
  38. web/client/dist/assets/{file-DahECWZX.js → file-CyBkQGGI.js} +1 -1
  39. web/client/dist/assets/{help-CeInptNb.js → help-BcOVbjKP.js} +1 -1
  40. web/client/dist/assets/{index-BafGN4in.js → index-CYAA3nVF.js} +1 -1
  41. web/client/dist/assets/index-RJnYVUFY.js +4 -0
  42. web/client/dist/assets/{plan-BX1iXHwl.js → plan-BaiSs9Um.js} +1 -1
  43. web/client/dist/assets/{project-Bag2J0QC.js → project-vqNomsgg.js} +1 -1
  44. web/client/dist/assets/{transition-BlPPv2uy.js → transition-CtNxN7ku.js} +1 -1
  45. web/client/dist/index.html +1 -1
  46. web/client/dist/assets/Input-CLgDkIXg.js +0 -41
  47. web/client/dist/assets/Lineage-UyUAWe1z.js +0 -1
  48. web/client/dist/assets/ModelLineage-E21kqsuu.js +0 -1
  49. web/client/dist/assets/index-CAWWTpIH.js +0 -4
  50. {sqlmesh-0.181.2.dev15.dist-info → sqlmesh-0.181.2.dev16.dist-info}/WHEEL +0 -0
  51. {sqlmesh-0.181.2.dev15.dist-info → sqlmesh-0.181.2.dev16.dist-info}/entry_points.txt +0 -0
  52. {sqlmesh-0.181.2.dev15.dist-info → sqlmesh-0.181.2.dev16.dist-info}/licenses/LICENSE +0 -0
  53. {sqlmesh-0.181.2.dev15.dist-info → sqlmesh-0.181.2.dev16.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,4 @@
1
+ import{r as x,ac as C}from"./index-CYAA3nVF.js";function p(r,l,e){let s=e.initialDeps??[],t;function n(){var i,o,a,c;let h;e.key&&((i=e.debug)!=null&&i.call(e))&&(h=Date.now());const u=r();if(!(u.length!==s.length||u.some((m,f)=>s[f]!==m)))return t;s=u;let v;if(e.key&&((o=e.debug)!=null&&o.call(e))&&(v=Date.now()),t=l(...u),e.key&&((a=e.debug)!=null&&a.call(e))){const m=Math.round((Date.now()-h)*100)/100,f=Math.round((Date.now()-v)*100)/100,S=f/16,b=(g,O)=>{for(g=String(g);g.length<O;)g=" "+g;return g};console.info(`%c⏱ ${b(f,5)} /${b(m,5)} ms`,`
2
+ font-size: .6rem;
3
+ font-weight: bold;
4
+ color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(c=e==null?void 0:e.onChange)==null||c.call(e,t),t}return n.updateDeps=i=>{s=i},n}function M(r,l){if(r===void 0)throw new Error("Unexpected undefined");return r}const T=(r,l)=>Math.abs(r-l)<=1,R=(r,l,e)=>{let s;return function(...t){r.clearTimeout(s),s=r.setTimeout(()=>l.apply(this,t),e)}},y=r=>{const{offsetWidth:l,offsetHeight:e}=r;return{width:l,height:e}},_=r=>r,A=r=>{const l=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),s=[];for(let t=l;t<=e;t++)s.push(t);return s},D=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;const t=i=>{const{width:o,height:a}=i;l({width:Math.round(o),height:Math.round(a)})};if(t(y(e)),!s.ResizeObserver)return()=>{};const n=new s.ResizeObserver(i=>{const o=()=>{const a=i[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){t({width:c.inlineSize,height:c.blockSize});return}}t(y(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(e,{box:"border-box"}),()=>{n.unobserve(e)}},w={passive:!0},I=typeof window>"u"?!0:"onscrollend"in window,k=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;let t=0;const n=r.options.useScrollendEvent&&I?()=>{}:R(s,()=>{l(t,!1)},r.options.isScrollingResetDelay),i=h=>()=>{const{horizontal:u,isRtl:d}=r.options;t=u?e.scrollLeft*(d&&-1||1):e.scrollTop,n(),l(t,h)},o=i(!0),a=i(!1);a(),e.addEventListener("scroll",o,w);const c=r.options.useScrollendEvent&&I;return c&&e.addEventListener("scrollend",a,w),()=>{e.removeEventListener("scroll",o),c&&e.removeEventListener("scrollend",a)}},F=(r,l,e)=>{if(l!=null&&l.borderBoxSize){const s=l.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},W=(r,{adjustments:l=0,behavior:e},s)=>{var t,n;const i=r+l;(n=(t=s.scrollElement)==null?void 0:t.scrollTo)==null||n.call(t,{[s.options.horizontal?"left":"top"]:i,behavior:e})};class j{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(t=>{t.forEach(n=>{const i=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var t;(t=s())==null||t.disconnect(),e=null},observe:t=>{var n;return(n=s())==null?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n;return(n=s())==null?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,t])=>{typeof t>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:_,rangeExtractor:A,onChange:()=>{},measureElement:F,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,t;(t=(s=this.options).onChange)==null||t.call(s,this,e)},this.maybeNotify=p(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const t=new Map,n=new Map;for(let i=s-1;i>=0;i--){const o=e[i];if(t.has(o.lane))continue;const a=n.get(o.lane);if(a==null||o.end>a.end?n.set(o.lane,o):o.end<a.end&&t.set(o.lane,!0),t.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((i,o)=>i.end===o.end?i.index-o.index:i.end-o.end)[0]:void 0},this.getMeasurementOptions=p(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,s,t,n,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i}),{key:!1}),this.getMeasurements=p(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,a);for(let h=a;h<e;h++){const u=n(h),d=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h),v=d?d.end+this.options.gap:s+t,m=o.get(u),f=typeof m=="number"?m:this.options.estimateSize(h),S=v+f,b=d?d.lane:h%this.options.lanes;c[h]={index:h,start:v,size:f,end:S,key:u,lane:b}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=p(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,t,n)=>this.range=e.length>0&&s>0?L({measurements:e,outerSize:s,scrollOffset:t,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=p(()=>{let e=null,s=null;const t=this.calculateRange();return t&&(e=t.startIndex,s=t.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,t,n,i)=>n===null||i===null?[]:e({startIndex:n,endIndex:i,overscan:s,count:t}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,t=e.getAttribute(s);return t?parseInt(t,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(e,s)=>{const t=this.indexFromElement(e),n=this.measurementsCache[t];if(!n)return;const i=n.key,o=this.elementsCache.get(i);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(t,this.options.measureElement(e,s,this))},this.resizeItem=(e,s)=>{const t=this.measurementsCache[e];if(!t)return;const n=this.itemSizeCache.get(t.key)??t.size,i=s-n;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(t,i,this):t.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(t.index),this.itemSizeCache=new Map(this.itemSizeCache.set(t.key,s)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((s,t)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=p(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const t=[];for(let n=0,i=e.length;n<i;n++){const o=e[n],a=s[o];t.push(a)}return t},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return M(s[z(0,s.length-1,t=>M(s[t]).start,e)])},this.getOffsetForAlignment=(e,s,t=0)=>{const n=this.getSize(),i=this.getScrollOffset();s==="auto"&&(s=e>=i+n?"end":"start"),s==="center"?e+=(t-n)/2:s==="end"&&(e-=n);const o=this.getTotalSize()-n;return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const t=this.measurementsCache[e];if(!t)return;const n=this.getSize(),i=this.getScrollOffset();if(s==="auto")if(t.end>=i+n-this.options.scrollPaddingEnd)s="end";else if(t.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];const o=s==="end"?t.end+this.options.scrollPaddingEnd:t.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,s,t.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:s="start",behavior:t}={})=>{this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,s),{adjustments:void 0,behavior:t})},this.scrollToIndex=(e,{align:s="auto",behavior:t}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(e,s);if(!n)return;const[i,o]=n;this._scrollToOffset(i,{adjustments:void 0,behavior:t}),t!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){const[c]=M(this.getOffsetForIndex(e,o)),h=this.getScrollOffset();T(c,h)||this.scrollToIndex(e,{align:o,behavior:t})}else this.scrollToIndex(e,{align:o,behavior:t})}))},this.scrollBy=(e,{behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let t;if(s.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=((e=s[s.length-1])==null?void 0:e.end)??0;else{const n=Array(this.options.lanes).fill(null);let i=s.length-1;for(;i>=0&&n.some(o=>o===null);){const o=s[i];n[o.lane]===null&&(n[o.lane]=o.end),i--}t=Math.max(...n.filter(o=>o!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:t})=>{this.options.scrollToFn(e,{behavior:t,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(l)}}const z=(r,l,e,s)=>{for(;r<=l;){const t=(r+l)/2|0,n=e(t);if(n<s)r=t+1;else if(n>s)l=t-1;else return t}return r>0?r-1:0};function L({measurements:r,outerSize:l,scrollOffset:e,lanes:s}){const t=r.length-1,n=a=>r[a].start;if(r.length<=s)return{startIndex:0,endIndex:t};let i=z(0,t,n,e),o=i;if(s===1)for(;o<t&&r[o].end<e+l;)o++;else if(s>1){const a=Array(s).fill(0);for(;o<t&&a.some(h=>h<e+l);){const h=r[o];a[h.lane]=h.end,o++}const c=Array(s).fill(e+l);for(;i>=0&&c.some(h=>h>=e);){const h=r[i];c[h.lane]=h.start,i--}i=Math.max(0,i-i%s),o=Math.min(t,o+(s-1-o%s))}return{startIndex:i,endIndex:o}}const E=typeof document<"u"?x.useLayoutEffect:x.useEffect;function P(r){const l=x.useReducer(()=>({}),{})[1],e={...r,onChange:(t,n)=>{var i;n?C.flushSync(l):l(),(i=r.onChange)==null||i.call(r,t,n)}},[s]=x.useState(()=>new j(e));return s.setOptions(e),E(()=>s._didMount(),[]),E(()=>s._willUpdate()),s}function V(r){return P({observeElementRect:D,observeElementOffset:k,scrollToFn:W,...r})}export{V as u};
@@ -1 +1 @@
1
- var N=Object.defineProperty;var D=(u,r,t)=>r in u?N(u,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[r]=t;var a=(u,r,t)=>D(u,typeof r!="symbol"?r+"":r,t);import{a0 as F,s as I,b as f,w as l,g as R,C as w,D as v,i as p,h as V,a1 as x}from"./index-BafGN4in.js";const s={Done:"done",Run:"run",Running:"running",RunningTask:"running-task",ApplyVirtual:"apply-virtual",ApplyBackfill:"apply-backfill",ApplyChangesAndBackfill:"apply-changes-and-backfill",ApplyMetadata:"apply-metadata",Applying:"applying",Cancelling:"cancelling"};class O extends F{constructor(t){super(t!=null&&t.isModel?t.initial:{...t,value:(t==null?void 0:t.value)??s.Run});a(this,"_value");this._value=(t==null?void 0:t.value)??this.initial.value}get value(){return this._value}get isRun(){return this.value===s.Run}get isDone(){return this.value===s.Done}get isApplyVirtual(){return this.value===s.ApplyVirtual}get isApplyBackfill(){return this.value===s.ApplyBackfill}get isApplyChangesAndBackfill(){return this.value===s.ApplyChangesAndBackfill}get isApplyMetadata(){return this.value===s.ApplyMetadata}get isApply(){return this.isApplyVirtual||this.isApplyBackfill||this.isApplyChangesAndBackfill||this.isApplyMetadata}get isCancelling(){return this.value===s.Cancelling}get isApplying(){return this.value===s.Applying}get isRunning(){return I([s.Running,s.RunningTask],this.value)}get isRunningTask(){return this.value===s.RunningTask}get isProcessing(){return this.isRunning||this.isApplying||this.isCancelling}get isIdle(){return f(this.isProcessing)}displayStatus(t){return this.isCancelling?"Cancelling Plan...":this.isApplying?"Applying Plan...":this.isRunning&&l(t.hasChanges)?"Getting Changes...":this.isRunning&&l(t.hasBackfills)?"Getting Backfills...":this.isRunning?"Checking Plan...":this.isRunningTask?"Running Task...":"Plan"}static getActionDisplayName(t,e=[],i="Plan"){if(!e.includes(t.value))return i;let n;switch(t.value){case s.Done:n="Done";break;case s.Running:n="Running...";break;case s.RunningTask:n="Running Task...";break;case s.Applying:n="Applying...";break;case s.Cancelling:n="Cancelling...";break;case s.Run:n="Plan";break;case s.ApplyChangesAndBackfill:n="Apply Changes And Backfill";break;case s.ApplyVirtual:n="Apply Virtual Update";break;case s.ApplyBackfill:n="Apply And Backfill";break;case s.ApplyMetadata:n="Apply Metadata";break;default:n=i;break}return n}static getPlanAction({planOverview:t,planApply:e,planCancel:i}){const n=t.isRunning,c=e.isRunning,h=i.isRunning,d=e.isFinished&&t.isFinished||i.isFinished;return i.isEmpty&&e.isEmpty&&t.isEmpty?s.Run:h?s.Cancelling:c?s.Applying:n?s.Running:d?s.Done:t.isVirtualUpdate?s.ApplyVirtual:t.isMetadataUpdate?s.ApplyMetadata:t.isBackfillUpdate?s.ApplyBackfill:t.isChangesAndBackfillUpdate?s.ApplyChangesAndBackfill:s.Done}}class U extends F{constructor(t){super(t==null?void 0:t.initial);a(this,"_current");a(this,"_isFetching",!1);this._current=t==null?void 0:t._current,this._isFetching=(t==null?void 0:t._isFetching)??!1}get current(){return this._current}get environment(){var t;return(t=this.current)==null?void 0:t.environment}get meta(){var t;return(t=this.current)==null?void 0:t.meta}get plan_options(){var t;return(t=this.current)==null?void 0:t.plan_options}get start(){var t;return(t=this.current)==null?void 0:t.start}get end(){var t;return(t=this.current)==null?void 0:t.end}get duration(){var t;return((t=this==null?void 0:this.meta)==null?void 0:t.duration)??-1}get isFinished(){var t,e,i,n;return R((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)!==w.init&&f(this.isFetching)}get isRunning(){var t,e,i,n;return v((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)===w.init||this.isFetching}get isSuccessful(){var t,e;return this.isFinished&&((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.status)===w.success}get isFailed(){var t,e,i;return this.isFinished&&(l((t=this.current)==null?void 0:t.meta)||((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.fail)}get isEmpty(){return l(this.current)}get isFetching(){return this._isFetching}set isFetching(t){this._isFetching=t}reset(){this._current=void 0}}class o extends F{constructor(t){var e,i;super(t);a(this,"name");a(this,"view_name");a(this,"node_type");a(this,"change_category");a(this,"diff");a(this,"indirect");a(this,"batches");a(this,"direct");a(this,"completed");a(this,"end");a(this,"interval");a(this,"start");a(this,"total");this.name=encodeURI(this.initial.name),this.view_name=encodeURI(this.initial.view_name),this.node_type=this.initial.node_type,this.change_category=this.initial.change_category,this.diff=this.initial.diff,this.batches=this.initial.batches,this.interval=this.initial.interval,this.start=this.initial.start,this.total=this.initial.total,this.completed=this.initial.completed,this.end=this.initial.end,this.indirect=(e=this.initial.indirect)==null?void 0:e.map(n=>new o(n)),this.direct=(i=this.initial.direct)==null?void 0:i.map(n=>new o(n))}get nodeType(){return this.node_type}get viewName(){return this.view_name}get displayName(){return decodeURI(this.name)}get displayViewName(){return decodeURI(this.view_name)}get changeCategory(){return this.change_category}}class k extends U{constructor(t){super(t);a(this,"_last");a(this,"_planOverview");a(this,"_lastPlanOverview");p(t)&&t.isModel&&(this._current=t._current,this._last=t._last,this._planOverview=t._planOverview,this._lastPlanOverview=t._lastPlanOverview)}get current(){return this._current??this._last}get environment(){var t,e;return((t=this._last)==null?void 0:t.environment)??((e=this._current)==null?void 0:e.environment)}get meta(){var t,e;return((t=this._last)==null?void 0:t.meta)??((e=this._current)==null?void 0:e.meta)}get plan_options(){var t,e;return((t=this._last)==null?void 0:t.plan_options)??((e=this._current)==null?void 0:e.plan_options)}get start(){var t,e;return((t=this._last)==null?void 0:t.start)??((e=this._current)==null?void 0:e.start)}get end(){var t,e;return((t=this._last)==null?void 0:t.end)??((e=this._current)==null?void 0:e.end)}get overview(){return this._lastPlanOverview??this._planOverview}get backfills(){var t;return((t=this.overview)==null?void 0:t.backfills)??[]}get added(){var t;return((t=this.overview)==null?void 0:t.added)??[]}get removed(){var t;return((t=this.overview)==null?void 0:t.removed)??[]}get direct(){var t;return((t=this.overview)==null?void 0:t.direct)??[]}get indirect(){var t;return((t=this.overview)==null?void 0:t.indirect)??[]}get metadata(){var t;return((t=this.overview)==null?void 0:t.metadata)??[]}get tasks(){var e,i,n,c;const t=((i=(e=this._last)==null?void 0:e.backfill)==null?void 0:i.tasks)??((c=(n=this._current)==null?void 0:n.backfill)==null?void 0:c.tasks)??{};return Object.entries(t??{}).reduce((h,[d,_])=>(h[encodeURI(d)]=new o(_),h),{})}get queue(){var t,e;return((e=(t=this.stageBackfill)==null?void 0:t.queue)==null?void 0:e.map(i=>this.tasks[encodeURI(i)]).filter(Boolean))??[]}get stageValidation(){var t;return(t=this.overview)==null?void 0:t.stageValidation}get stageChanges(){var t;return(t=this.overview)==null?void 0:t.stageChanges}get stageBackfills(){var t;return(t=this.overview)==null?void 0:t.stageBackfills}get stageCreation(){var t,e;return((t=this._last)==null?void 0:t.creation)??((e=this._current)==null?void 0:e.creation)}get stageRestate(){var t,e;return((t=this._last)==null?void 0:t.restate)??((e=this._current)==null?void 0:e.restate)}get stageBackfill(){var t,e;return((t=this._last)==null?void 0:t.backfill)??((e=this._current)==null?void 0:e.backfill)}get stagePromote(){var t,e;return((t=this._last)==null?void 0:t.promote)??((e=this._current)==null?void 0:e.promote)}get shouldShowEvaluation(){return this.isFailed||p(this.stageCreation)||p(this.stageBackfill)||p(this.stagePromote)}get evaluationStart(){var t,e,i,n,c,h;return((e=(t=this.stageCreation)==null?void 0:t.meta)==null?void 0:e.start)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.start)??((h=(c=this.stagePromote)==null?void 0:c.meta)==null?void 0:h.start)}get evaluationEnd(){var t,e,i,n,c,h;return((e=(t=this.stagePromote)==null?void 0:t.meta)==null?void 0:e.end)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.end)??((h=(c=this.stageCreation)==null?void 0:c.meta)==null?void 0:h.end)}update(t,e){var m,y,A,g,M,T,E;const{creation:i,restate:n,backfill:c,promote:h,meta:d,environment:_}=t,B=l(d)||l(_)?void 0:t;if(l(B)){this._current=void 0;return}l(this._current)&&(this._current=t),this._current.start=t.start,this._current.end=t.end,this._current.meta=t.meta,this._current.environment=t.environment,this._current.plan_options=t.plan_options,p(i)&&(l(this._current.creation)||v((m=this._current.creation.meta)==null?void 0:m.done))&&(this._current.creation=i),p(n)&&(l(this._current.restate)||v((y=this._current.restate.meta)==null?void 0:y.done))&&(this._current.restate=n),p(c)&&(l(this._current.backfill)||v((A=this._current.backfill.meta)==null?void 0:A.done))&&(this._current.backfill=c),p(h)&&(l(this._current.promote)||v((g=this._current.promote.meta)==null?void 0:g.done))&&(this._current.promote=h),R((T=(M=this.current)==null?void 0:M.meta)==null?void 0:T.done)&&l(this._last)?(this._last=this._current,this._lastPlanOverview=this._planOverview,this._current=void 0,this._planOverview=void 0):this._planOverview=p(d)&&p(_)?e==null?void 0:e.clone():void 0,this.isFetching=f((E=t.meta)==null?void 0:E.done)}reset(){this._current=void 0,this._planOverview=void 0}clear(){this._current=void 0,this._last=void 0,this._planOverview=void 0,this._lastPlanOverview=void 0}clone(){var e;const t=new k;return p(this.current)&&t.update(structuredClone(this.current),(e=this.overview)==null?void 0:e.clone()),t}}class b extends U{get cancel(){var r;return(r=this._current)==null?void 0:r.cancel}get isCancelling(){var r,t,e,i;return v((t=(r=this.current)==null?void 0:r.meta)==null?void 0:t.done)&&((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.init||this.isFetching}update(r){var t;this._current=r,this.isFetching=f((t=r.meta)==null?void 0:t.done)}}class C extends U{constructor(t){super(t);a(this,"_added",[]);a(this,"_removed",[]);a(this,"_direct",[]);a(this,"_indirect",[]);a(this,"_metadata",[]);a(this,"_backfills",[]);p(t)&&t.isModel&&(this._added=t.added,this._removed=t.removed,this._direct=t.direct,this._indirect=t.indirect,this._metadata=t.metadata,this._backfills=t.backfills)}get stageValidation(){var t;return(t=this._current)==null?void 0:t.validation}get stageChanges(){var t;return(t=this._current)==null?void 0:t.changes}get stageBackfills(){var t;return(t=this._current)==null?void 0:t.backfills}get validation(){var t;return(t=this._current)==null?void 0:t.validation}get hasChanges(){var d;if(l((d=this._current)==null?void 0:d.changes))return;const{added:t,removed:e,modified:i}=this._current.changes??{};if([t,e,i].every(l))return;const{direct:n,indirect:c,metadata:h}=i??{};return[t,e,n,c,h].some(V)}get changes(){var t;return(t=this._current)==null?void 0:t.changes}get hasBackfills(){var t,e,i;return l((e=(t=this._current)==null?void 0:t.backfills)==null?void 0:e.models)?void 0:V((i=this._current.backfills)==null?void 0:i.models)}get hasUpdates(){return R(this.hasChanges)||R(this.hasBackfills)}get backfills(){return this._backfills}get added(){return this._added}get removed(){return this._removed}get direct(){return this._direct}get indirect(){return this._indirect}get metadata(){return this._metadata}get isVirtualUpdate(){return p(this.hasChanges)&&l(this.hasBackfills)||!!this.hasChanges&&this.skipBackfill}get isMetadataUpdate(){var t;return!!((t=this.metadata)!=null&&t.length)&&l(this.hasBackfills)}get isBackfillUpdate(){return v(this.hasChanges)&&!!this.hasBackfills&&f(this.skipBackfill)}get isChangesAndBackfillUpdate(){return!!this.hasChanges&&!!this.hasBackfills&&f(this.skipBackfill)}get isLatest(){return this.isFinished&&l(this.hasChanges)&&(l(this.hasBackfills)||this.skipBackfill)}get skipTests(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_tests)??!1}get skipBackfill(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_backfill)??!1}update(t){var c,h,d,_,P,B,m,y,A;this._current=t,this.isFetching=f((c=t.meta)==null?void 0:c.done);const e=((h=this._current)==null?void 0:h.changes)??{},i=(e==null?void 0:e.modified)??{},n=((d=this._current)==null?void 0:d.backfills)??{};this._added=((_=e.added)==null?void 0:_.map(g=>new o(g)))??[],this._removed=((P=e.removed)==null?void 0:P.map(g=>new o(g)))??[],this._direct=((B=i.direct)==null?void 0:B.map(g=>new o(g)))??[],this._indirect=((m=i.indirect)==null?void 0:m.map(g=>new o(g)))??[],this._metadata=((y=i.metadata)==null?void 0:y.map(g=>new o(g)))??[],this._backfills=((A=n.models)==null?void 0:A.map(g=>new o(g)))??[]}clone(){const t=new C;return p(this.current)&&t.update(structuredClone(this.current)),t}}const G=x((u,r)=>({planAction:new O,planOverview:new C,planApply:new k,planCancel:new b,setPlanAction:t=>{u(()=>({planAction:new O(t)}))},setPlanApply:t=>{u(()=>({planApply:new k(t)}))},setPlanOverview:t=>{u(()=>({planOverview:new C(t)}))},setPlanCancel:t=>{u(()=>({planCancel:new b(t)}))},resetPlanTrackers:()=>{const t=r();t.planApply.reset(),t.planCancel.reset(),t.planOverview.reset(),u(()=>({planApply:new k(t.planApply),planCancel:new b(t.planCancel),planOverview:new C(t.planOverview)}))},resetPlanCancel:()=>{const t=r();t.planCancel.reset(),u(()=>({planCancel:new b(t.planCancel)}))},clearPlanApply:()=>{const t=r();t.planApply.clear(),u(()=>({planApply:new k(t.planApply)}))}}));export{s as E,C as M,O as a,G as u};
1
+ var N=Object.defineProperty;var D=(u,r,t)=>r in u?N(u,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[r]=t;var a=(u,r,t)=>D(u,typeof r!="symbol"?r+"":r,t);import{a0 as F,s as I,b as f,w as l,g as R,C as w,D as v,i as p,h as V,a1 as x}from"./index-CYAA3nVF.js";const s={Done:"done",Run:"run",Running:"running",RunningTask:"running-task",ApplyVirtual:"apply-virtual",ApplyBackfill:"apply-backfill",ApplyChangesAndBackfill:"apply-changes-and-backfill",ApplyMetadata:"apply-metadata",Applying:"applying",Cancelling:"cancelling"};class O extends F{constructor(t){super(t!=null&&t.isModel?t.initial:{...t,value:(t==null?void 0:t.value)??s.Run});a(this,"_value");this._value=(t==null?void 0:t.value)??this.initial.value}get value(){return this._value}get isRun(){return this.value===s.Run}get isDone(){return this.value===s.Done}get isApplyVirtual(){return this.value===s.ApplyVirtual}get isApplyBackfill(){return this.value===s.ApplyBackfill}get isApplyChangesAndBackfill(){return this.value===s.ApplyChangesAndBackfill}get isApplyMetadata(){return this.value===s.ApplyMetadata}get isApply(){return this.isApplyVirtual||this.isApplyBackfill||this.isApplyChangesAndBackfill||this.isApplyMetadata}get isCancelling(){return this.value===s.Cancelling}get isApplying(){return this.value===s.Applying}get isRunning(){return I([s.Running,s.RunningTask],this.value)}get isRunningTask(){return this.value===s.RunningTask}get isProcessing(){return this.isRunning||this.isApplying||this.isCancelling}get isIdle(){return f(this.isProcessing)}displayStatus(t){return this.isCancelling?"Cancelling Plan...":this.isApplying?"Applying Plan...":this.isRunning&&l(t.hasChanges)?"Getting Changes...":this.isRunning&&l(t.hasBackfills)?"Getting Backfills...":this.isRunning?"Checking Plan...":this.isRunningTask?"Running Task...":"Plan"}static getActionDisplayName(t,e=[],i="Plan"){if(!e.includes(t.value))return i;let n;switch(t.value){case s.Done:n="Done";break;case s.Running:n="Running...";break;case s.RunningTask:n="Running Task...";break;case s.Applying:n="Applying...";break;case s.Cancelling:n="Cancelling...";break;case s.Run:n="Plan";break;case s.ApplyChangesAndBackfill:n="Apply Changes And Backfill";break;case s.ApplyVirtual:n="Apply Virtual Update";break;case s.ApplyBackfill:n="Apply And Backfill";break;case s.ApplyMetadata:n="Apply Metadata";break;default:n=i;break}return n}static getPlanAction({planOverview:t,planApply:e,planCancel:i}){const n=t.isRunning,c=e.isRunning,h=i.isRunning,d=e.isFinished&&t.isFinished||i.isFinished;return i.isEmpty&&e.isEmpty&&t.isEmpty?s.Run:h?s.Cancelling:c?s.Applying:n?s.Running:d?s.Done:t.isVirtualUpdate?s.ApplyVirtual:t.isMetadataUpdate?s.ApplyMetadata:t.isBackfillUpdate?s.ApplyBackfill:t.isChangesAndBackfillUpdate?s.ApplyChangesAndBackfill:s.Done}}class U extends F{constructor(t){super(t==null?void 0:t.initial);a(this,"_current");a(this,"_isFetching",!1);this._current=t==null?void 0:t._current,this._isFetching=(t==null?void 0:t._isFetching)??!1}get current(){return this._current}get environment(){var t;return(t=this.current)==null?void 0:t.environment}get meta(){var t;return(t=this.current)==null?void 0:t.meta}get plan_options(){var t;return(t=this.current)==null?void 0:t.plan_options}get start(){var t;return(t=this.current)==null?void 0:t.start}get end(){var t;return(t=this.current)==null?void 0:t.end}get duration(){var t;return((t=this==null?void 0:this.meta)==null?void 0:t.duration)??-1}get isFinished(){var t,e,i,n;return R((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)!==w.init&&f(this.isFetching)}get isRunning(){var t,e,i,n;return v((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)===w.init||this.isFetching}get isSuccessful(){var t,e;return this.isFinished&&((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.status)===w.success}get isFailed(){var t,e,i;return this.isFinished&&(l((t=this.current)==null?void 0:t.meta)||((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.fail)}get isEmpty(){return l(this.current)}get isFetching(){return this._isFetching}set isFetching(t){this._isFetching=t}reset(){this._current=void 0}}class o extends F{constructor(t){var e,i;super(t);a(this,"name");a(this,"view_name");a(this,"node_type");a(this,"change_category");a(this,"diff");a(this,"indirect");a(this,"batches");a(this,"direct");a(this,"completed");a(this,"end");a(this,"interval");a(this,"start");a(this,"total");this.name=encodeURI(this.initial.name),this.view_name=encodeURI(this.initial.view_name),this.node_type=this.initial.node_type,this.change_category=this.initial.change_category,this.diff=this.initial.diff,this.batches=this.initial.batches,this.interval=this.initial.interval,this.start=this.initial.start,this.total=this.initial.total,this.completed=this.initial.completed,this.end=this.initial.end,this.indirect=(e=this.initial.indirect)==null?void 0:e.map(n=>new o(n)),this.direct=(i=this.initial.direct)==null?void 0:i.map(n=>new o(n))}get nodeType(){return this.node_type}get viewName(){return this.view_name}get displayName(){return decodeURI(this.name)}get displayViewName(){return decodeURI(this.view_name)}get changeCategory(){return this.change_category}}class k extends U{constructor(t){super(t);a(this,"_last");a(this,"_planOverview");a(this,"_lastPlanOverview");p(t)&&t.isModel&&(this._current=t._current,this._last=t._last,this._planOverview=t._planOverview,this._lastPlanOverview=t._lastPlanOverview)}get current(){return this._current??this._last}get environment(){var t,e;return((t=this._last)==null?void 0:t.environment)??((e=this._current)==null?void 0:e.environment)}get meta(){var t,e;return((t=this._last)==null?void 0:t.meta)??((e=this._current)==null?void 0:e.meta)}get plan_options(){var t,e;return((t=this._last)==null?void 0:t.plan_options)??((e=this._current)==null?void 0:e.plan_options)}get start(){var t,e;return((t=this._last)==null?void 0:t.start)??((e=this._current)==null?void 0:e.start)}get end(){var t,e;return((t=this._last)==null?void 0:t.end)??((e=this._current)==null?void 0:e.end)}get overview(){return this._lastPlanOverview??this._planOverview}get backfills(){var t;return((t=this.overview)==null?void 0:t.backfills)??[]}get added(){var t;return((t=this.overview)==null?void 0:t.added)??[]}get removed(){var t;return((t=this.overview)==null?void 0:t.removed)??[]}get direct(){var t;return((t=this.overview)==null?void 0:t.direct)??[]}get indirect(){var t;return((t=this.overview)==null?void 0:t.indirect)??[]}get metadata(){var t;return((t=this.overview)==null?void 0:t.metadata)??[]}get tasks(){var e,i,n,c;const t=((i=(e=this._last)==null?void 0:e.backfill)==null?void 0:i.tasks)??((c=(n=this._current)==null?void 0:n.backfill)==null?void 0:c.tasks)??{};return Object.entries(t??{}).reduce((h,[d,_])=>(h[encodeURI(d)]=new o(_),h),{})}get queue(){var t,e;return((e=(t=this.stageBackfill)==null?void 0:t.queue)==null?void 0:e.map(i=>this.tasks[encodeURI(i)]).filter(Boolean))??[]}get stageValidation(){var t;return(t=this.overview)==null?void 0:t.stageValidation}get stageChanges(){var t;return(t=this.overview)==null?void 0:t.stageChanges}get stageBackfills(){var t;return(t=this.overview)==null?void 0:t.stageBackfills}get stageCreation(){var t,e;return((t=this._last)==null?void 0:t.creation)??((e=this._current)==null?void 0:e.creation)}get stageRestate(){var t,e;return((t=this._last)==null?void 0:t.restate)??((e=this._current)==null?void 0:e.restate)}get stageBackfill(){var t,e;return((t=this._last)==null?void 0:t.backfill)??((e=this._current)==null?void 0:e.backfill)}get stagePromote(){var t,e;return((t=this._last)==null?void 0:t.promote)??((e=this._current)==null?void 0:e.promote)}get shouldShowEvaluation(){return this.isFailed||p(this.stageCreation)||p(this.stageBackfill)||p(this.stagePromote)}get evaluationStart(){var t,e,i,n,c,h;return((e=(t=this.stageCreation)==null?void 0:t.meta)==null?void 0:e.start)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.start)??((h=(c=this.stagePromote)==null?void 0:c.meta)==null?void 0:h.start)}get evaluationEnd(){var t,e,i,n,c,h;return((e=(t=this.stagePromote)==null?void 0:t.meta)==null?void 0:e.end)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.end)??((h=(c=this.stageCreation)==null?void 0:c.meta)==null?void 0:h.end)}update(t,e){var m,y,A,g,M,T,E;const{creation:i,restate:n,backfill:c,promote:h,meta:d,environment:_}=t,B=l(d)||l(_)?void 0:t;if(l(B)){this._current=void 0;return}l(this._current)&&(this._current=t),this._current.start=t.start,this._current.end=t.end,this._current.meta=t.meta,this._current.environment=t.environment,this._current.plan_options=t.plan_options,p(i)&&(l(this._current.creation)||v((m=this._current.creation.meta)==null?void 0:m.done))&&(this._current.creation=i),p(n)&&(l(this._current.restate)||v((y=this._current.restate.meta)==null?void 0:y.done))&&(this._current.restate=n),p(c)&&(l(this._current.backfill)||v((A=this._current.backfill.meta)==null?void 0:A.done))&&(this._current.backfill=c),p(h)&&(l(this._current.promote)||v((g=this._current.promote.meta)==null?void 0:g.done))&&(this._current.promote=h),R((T=(M=this.current)==null?void 0:M.meta)==null?void 0:T.done)&&l(this._last)?(this._last=this._current,this._lastPlanOverview=this._planOverview,this._current=void 0,this._planOverview=void 0):this._planOverview=p(d)&&p(_)?e==null?void 0:e.clone():void 0,this.isFetching=f((E=t.meta)==null?void 0:E.done)}reset(){this._current=void 0,this._planOverview=void 0}clear(){this._current=void 0,this._last=void 0,this._planOverview=void 0,this._lastPlanOverview=void 0}clone(){var e;const t=new k;return p(this.current)&&t.update(structuredClone(this.current),(e=this.overview)==null?void 0:e.clone()),t}}class b extends U{get cancel(){var r;return(r=this._current)==null?void 0:r.cancel}get isCancelling(){var r,t,e,i;return v((t=(r=this.current)==null?void 0:r.meta)==null?void 0:t.done)&&((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.init||this.isFetching}update(r){var t;this._current=r,this.isFetching=f((t=r.meta)==null?void 0:t.done)}}class C extends U{constructor(t){super(t);a(this,"_added",[]);a(this,"_removed",[]);a(this,"_direct",[]);a(this,"_indirect",[]);a(this,"_metadata",[]);a(this,"_backfills",[]);p(t)&&t.isModel&&(this._added=t.added,this._removed=t.removed,this._direct=t.direct,this._indirect=t.indirect,this._metadata=t.metadata,this._backfills=t.backfills)}get stageValidation(){var t;return(t=this._current)==null?void 0:t.validation}get stageChanges(){var t;return(t=this._current)==null?void 0:t.changes}get stageBackfills(){var t;return(t=this._current)==null?void 0:t.backfills}get validation(){var t;return(t=this._current)==null?void 0:t.validation}get hasChanges(){var d;if(l((d=this._current)==null?void 0:d.changes))return;const{added:t,removed:e,modified:i}=this._current.changes??{};if([t,e,i].every(l))return;const{direct:n,indirect:c,metadata:h}=i??{};return[t,e,n,c,h].some(V)}get changes(){var t;return(t=this._current)==null?void 0:t.changes}get hasBackfills(){var t,e,i;return l((e=(t=this._current)==null?void 0:t.backfills)==null?void 0:e.models)?void 0:V((i=this._current.backfills)==null?void 0:i.models)}get hasUpdates(){return R(this.hasChanges)||R(this.hasBackfills)}get backfills(){return this._backfills}get added(){return this._added}get removed(){return this._removed}get direct(){return this._direct}get indirect(){return this._indirect}get metadata(){return this._metadata}get isVirtualUpdate(){return p(this.hasChanges)&&l(this.hasBackfills)||!!this.hasChanges&&this.skipBackfill}get isMetadataUpdate(){var t;return!!((t=this.metadata)!=null&&t.length)&&l(this.hasBackfills)}get isBackfillUpdate(){return v(this.hasChanges)&&!!this.hasBackfills&&f(this.skipBackfill)}get isChangesAndBackfillUpdate(){return!!this.hasChanges&&!!this.hasBackfills&&f(this.skipBackfill)}get isLatest(){return this.isFinished&&l(this.hasChanges)&&(l(this.hasBackfills)||this.skipBackfill)}get skipTests(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_tests)??!1}get skipBackfill(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_backfill)??!1}update(t){var c,h,d,_,P,B,m,y,A;this._current=t,this.isFetching=f((c=t.meta)==null?void 0:c.done);const e=((h=this._current)==null?void 0:h.changes)??{},i=(e==null?void 0:e.modified)??{},n=((d=this._current)==null?void 0:d.backfills)??{};this._added=((_=e.added)==null?void 0:_.map(g=>new o(g)))??[],this._removed=((P=e.removed)==null?void 0:P.map(g=>new o(g)))??[],this._direct=((B=i.direct)==null?void 0:B.map(g=>new o(g)))??[],this._indirect=((m=i.indirect)==null?void 0:m.map(g=>new o(g)))??[],this._metadata=((y=i.metadata)==null?void 0:y.map(g=>new o(g)))??[],this._backfills=((A=n.models)==null?void 0:A.map(g=>new o(g)))??[]}clone(){const t=new C;return p(this.current)&&t.update(structuredClone(this.current)),t}}const G=x((u,r)=>({planAction:new O,planOverview:new C,planApply:new k,planCancel:new b,setPlanAction:t=>{u(()=>({planAction:new O(t)}))},setPlanApply:t=>{u(()=>({planApply:new k(t)}))},setPlanOverview:t=>{u(()=>({planOverview:new C(t)}))},setPlanCancel:t=>{u(()=>({planCancel:new b(t)}))},resetPlanTrackers:()=>{const t=r();t.planApply.reset(),t.planCancel.reset(),t.planOverview.reset(),u(()=>({planApply:new k(t.planApply),planCancel:new b(t.planCancel),planOverview:new C(t.planOverview)}))},resetPlanCancel:()=>{const t=r();t.planCancel.reset(),u(()=>({planCancel:new b(t.planCancel)}))},clearPlanApply:()=>{const t=r();t.planApply.clear(),u(()=>({planApply:new k(t.planApply)}))}}));export{s as E,C as M,O as a,G as u};
@@ -1 +1 @@
1
- var n=Object.defineProperty;var d=(i,t,e)=>t in i?n(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var c=(i,t,e)=>d(i,typeof t!="symbol"?t+"":t,e);import{a,M as f}from"./file-DahECWZX.js";import{b as p,a1 as u}from"./index-BafGN4in.js";class h extends a{constructor(e,s){super(e!=null&&e.isModel?e.initial:{...e,directories:(e==null?void 0:e.directories)??[],files:(e==null?void 0:e.files)??[]},s);c(this,"_isOpen",!1);c(this,"directories",[]);c(this,"files",[]);c(this,"syncStateOpen");e!=null&&e.isModel?(this.directories=e.directories,this.files=e.files):this.update({files:this.initial.files,directories:this.initial.directories})}get level(){var e;return(((e=this.parent)==null?void 0:e.level)??-1)+1}get isChanged(){return this.name!==this.initial.name||this.files.some(e=>e.isChanged)||this.directories.some(e=>e.isChanged)}get isEmpty(){return this.directories.length===0&&this.files.length===0}get withFiles(){return this.files.length>0}get withDirectories(){return this.directories.length>0}get isNotEmpty(){return this.withFiles||this.withDirectories}get artifacts(){return this.directories.concat(this.files)}get allDirectories(){return this.directories.concat(this.directories.map(e=>e.allDirectories).flat(100))}get allFiles(){return this.files.concat(this.allDirectories.map(e=>e.files).flat(100))}get allVisibleArtifacts(){return this.directories.map(e=>e.isOpened?[e,e.allVisibleArtifacts]:[e]).flat(100).concat(this.isOpened?this.files:[])}get allArtifacts(){return this.directories.map(e=>[e,e.allArtifacts]).flat(100).concat(this.files)}get isOpened(){return this._isOpen}get isClosed(){return p(this._isOpen)}get isModels(){return this.path.startsWith("models")}get isTests(){return this.path.startsWith("tests")}open(){var e;this._isOpen=!0,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}close(){var e;this._isOpen=!1,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}toggle(){this.isOpened?this.close():this.open()}expand(){this.open(),this.directories.forEach(e=>{e.expand()})}collapse(){this.close(),this.directories.forEach(e=>{e.collapse()})}containsName(e){return this.artifacts.some(s=>s.name===e)}hasFile(e){return this.allFiles.includes(e)}hasDirectory(e){return this.allDirectories.includes(e)}addFile(e){this.files.push(e),e.parent=this}addDirectory(e){this.directories.push(e),e.parent=this}removeFile(e){this.files=this.files.filter(s=>s!==e)}removeDirectory(e){this.directories=this.directories.filter(s=>s!==e)}update({files:e=[],directories:s=[]}){this.files=[],this.directories=[],s.forEach(r=>{this.addDirectory(new h(r,this))}),e.forEach(r=>{this.addFile(new f(r,this))})}}const O=u((i,t)=>({tests:void 0,project:new h,selectedFile:void 0,files:new Map,activeRange:[],setTests(e){i(()=>({tests:e}))},setActiveRange(e){const s=t();i(()=>({activeRange:s.project.allVisibleArtifacts.filter(r=>o(r,e??s.activeRange))}))},inActiveRange(e){const s=t();return o(e,s.activeRange)},setProject(e){i(()=>({project:e}))},setFiles(e){const s=t();s.files.clear(),i(()=>({files:new Map(e.reduce((r,l)=>r.set(l.id,l),s.files))}))},setSelectedFile(e){i(()=>({selectedFile:e}))},findArtifactByPath(e){const s=t();return a.findArtifactByPath(s.project,e)},refreshFiles(e){const s=t();s.setFiles(e??s.project.allFiles)}}));function o(i,t){return t.includes(i)}export{h as M,O as u};
1
+ var n=Object.defineProperty;var d=(i,t,e)=>t in i?n(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var c=(i,t,e)=>d(i,typeof t!="symbol"?t+"":t,e);import{a,M as f}from"./file-CyBkQGGI.js";import{b as p,a1 as u}from"./index-CYAA3nVF.js";class h extends a{constructor(e,s){super(e!=null&&e.isModel?e.initial:{...e,directories:(e==null?void 0:e.directories)??[],files:(e==null?void 0:e.files)??[]},s);c(this,"_isOpen",!1);c(this,"directories",[]);c(this,"files",[]);c(this,"syncStateOpen");e!=null&&e.isModel?(this.directories=e.directories,this.files=e.files):this.update({files:this.initial.files,directories:this.initial.directories})}get level(){var e;return(((e=this.parent)==null?void 0:e.level)??-1)+1}get isChanged(){return this.name!==this.initial.name||this.files.some(e=>e.isChanged)||this.directories.some(e=>e.isChanged)}get isEmpty(){return this.directories.length===0&&this.files.length===0}get withFiles(){return this.files.length>0}get withDirectories(){return this.directories.length>0}get isNotEmpty(){return this.withFiles||this.withDirectories}get artifacts(){return this.directories.concat(this.files)}get allDirectories(){return this.directories.concat(this.directories.map(e=>e.allDirectories).flat(100))}get allFiles(){return this.files.concat(this.allDirectories.map(e=>e.files).flat(100))}get allVisibleArtifacts(){return this.directories.map(e=>e.isOpened?[e,e.allVisibleArtifacts]:[e]).flat(100).concat(this.isOpened?this.files:[])}get allArtifacts(){return this.directories.map(e=>[e,e.allArtifacts]).flat(100).concat(this.files)}get isOpened(){return this._isOpen}get isClosed(){return p(this._isOpen)}get isModels(){return this.path.startsWith("models")}get isTests(){return this.path.startsWith("tests")}open(){var e;this._isOpen=!0,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}close(){var e;this._isOpen=!1,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}toggle(){this.isOpened?this.close():this.open()}expand(){this.open(),this.directories.forEach(e=>{e.expand()})}collapse(){this.close(),this.directories.forEach(e=>{e.collapse()})}containsName(e){return this.artifacts.some(s=>s.name===e)}hasFile(e){return this.allFiles.includes(e)}hasDirectory(e){return this.allDirectories.includes(e)}addFile(e){this.files.push(e),e.parent=this}addDirectory(e){this.directories.push(e),e.parent=this}removeFile(e){this.files=this.files.filter(s=>s!==e)}removeDirectory(e){this.directories=this.directories.filter(s=>s!==e)}update({files:e=[],directories:s=[]}){this.files=[],this.directories=[],s.forEach(r=>{this.addDirectory(new h(r,this))}),e.forEach(r=>{this.addFile(new f(r,this))})}}const O=u((i,t)=>({tests:void 0,project:new h,selectedFile:void 0,files:new Map,activeRange:[],setTests(e){i(()=>({tests:e}))},setActiveRange(e){const s=t();i(()=>({activeRange:s.project.allVisibleArtifacts.filter(r=>o(r,e??s.activeRange))}))},inActiveRange(e){const s=t();return o(e,s.activeRange)},setProject(e){i(()=>({project:e}))},setFiles(e){const s=t();s.files.clear(),i(()=>({files:new Map(e.reduce((r,l)=>r.set(l.id,l),s.files))}))},setSelectedFile(e){i(()=>({selectedFile:e}))},findArtifactByPath(e){const s=t();return a.findArtifactByPath(s.project,e)},refreshFiles(e){const s=t();s.setFiles(e??s.project.allFiles)}}));function o(i,t){return t.includes(i)}export{h as M,O as u};
@@ -1,4 +1,4 @@
1
- import{r as l,R as E,f as De,ac as ot}from"./index-BafGN4in.js";var lt=Object.defineProperty,ut=(e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t,n)=>(ut(e,typeof t!="symbol"?t+"":t,n),n);let at=class{constructor(){Se(this,"current",this.detect()),Se(this,"handoffState","pending"),Se(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},W=new at,B=(e,t)=>{W.isServer?l.useEffect(e,t):l.useLayoutEffect(e,t)};function j(e){let t=l.useRef(e);return B(()=>{t.current=e},[e]),t}let P=function(e){let t=j(e);return E.useCallback((...n)=>t.current(...n),[t])};function Ue(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function le(){let e=[],t={addEventListener(n,r,u,a){return n.addEventListener(r,u,a),t.add(()=>n.removeEventListener(r,u,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ue(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,u){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:u}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=le();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let u of e.splice(r,1))u()}},dispose(){for(let n of e.splice(0))n()}};return t}function qe(){let[e]=l.useState(le);return l.useEffect(()=>()=>e.dispose(),[e]),e}function it(){let e=typeof document>"u";return"useSyncExternalStore"in De?(t=>t.useSyncExternalStore)(De)(()=>()=>{},()=>!1,()=>!e):!1}function ve(){let e=it(),[t,n]=l.useState(W.isHandoffComplete);return t&&W.isHandoffComplete===!1&&n(!1),l.useEffect(()=>{t!==!0&&n(!0)},[t]),l.useEffect(()=>W.handoff(),[]),e?!1:t}var He;let ne=(He=E.useId)!=null?He:function(){let e=ve(),[t,n]=E.useState(e?()=>W.nextId():null);return B(()=>{t===null&&n(W.nextId())},[t]),t!=null?""+t:void 0};function I(e,t,...n){if(e in t){let u=t[e];return typeof u=="function"?u(...n):u}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(u=>`"${u}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,I),r}function me(e){return W.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Fe=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var K=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(K||{}),fe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fe||{}),st=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(st||{});function se(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Fe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ce=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ce||{});function Oe(e,t=0){var n;return e===((n=me(e))==null?void 0:n.body)?!1:I(t,{0(){return e.matches(Fe)},1(){let r=e;for(;r!==null;){if(r.matches(Fe))return!0;r=r.parentElement}return!1}})}function $n(e){let t=me(e);le().nextFrame(()=>{t&&!Oe(t.activeElement,0)&&dt(e)})}var ct=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ct||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function dt(e){e==null||e.focus({preventScroll:!0})}let ft=["textarea","input"].join(",");function pt(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ft))!=null?n:!1}function vt(e,t=n=>n){return e.slice().sort((n,r)=>{let u=t(n),a=t(r);if(u===null||a===null)return 0;let o=u.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Fn(e,t){return J(se(),t,{relativeTo:e})}function J(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:u=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?vt(e):e:se(e);u.length>0&&o.length>1&&(o=o.filter(b=>!u.includes(b))),r=r??a.activeElement;let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=t&32?{preventScroll:!0}:{},s=0,d=o.length,f;do{if(s>=d||s+d<=0)return 0;let b=i+s;if(t&16)b=(b+d)%d;else{if(b<0)return 3;if(b>=d)return 1}f=o[b],f==null||f.focus(p),s+=c}while(f!==a.activeElement);return t&6&&pt(f)&&f.select(),2}function mt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ht(){return/Android/gi.test(window.navigator.userAgent)}function gt(){return mt()||ht()}function ce(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return document.addEventListener(e,u,n),()=>document.removeEventListener(e,u,n)},[e,n])}function Ge(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return window.addEventListener(e,u,n),()=>window.removeEventListener(e,u,n)},[e,n])}function bt(e,t,n=!0){let r=l.useRef(!1);l.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function u(o,c){if(!r.current||o.defaultPrevented)return;let i=c(o);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let p=function s(d){return typeof d=="function"?s(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(let s of p){if(s===null)continue;let d=s instanceof HTMLElement?s:s.current;if(d!=null&&d.contains(i)||o.composed&&o.composedPath().includes(d))return}return!Oe(i,Ce.Loose)&&i.tabIndex!==-1&&o.preventDefault(),t(o,i)}let a=l.useRef(null);ce("pointerdown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("mousedown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("click",o=>{gt()||a.current&&(u(o,()=>a.current),a.current=null)},!0),ce("touchend",o=>u(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Ge("blur",o=>u(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ue(...e){return l.useMemo(()=>me(...e),[...e])}function je(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Et(e,t){let[n,r]=l.useState(()=>je(e));return B(()=>{r(je(e))},[e.type,e.as]),B(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Ke=Symbol();function Ve(e,t=!0){return Object.assign(e,{[Ke]:t})}function U(...e){let t=l.useRef(e);l.useEffect(()=>{t.current=e},[e]);let n=P(r=>{for(let u of t.current)u!=null&&(typeof u=="function"?u(r):u.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Ke]))?void 0:n}function pe(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var re=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(re||{}),Z=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Z||{});function q({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:u,visible:a=!0,name:o,mergeRefs:c}){c=c??Pt;let i=We(t,e);if(a)return de(i,n,r,o,c);let p=u??0;if(p&2){let{static:s=!1,...d}=i;if(s)return de(d,n,r,o,c)}if(p&1){let{unmount:s=!0,...d}=i;return I(s?0:1,{0(){return null},1(){return de({...d,hidden:!0,style:{display:"none"}},n,r,o,c)}})}return de(i,n,r,o,c)}function de(e,t={},n,r,u){let{as:a=n,children:o,refName:c="ref",...i}=we(e,["unmount","static"]),p=e.ref!==void 0?{[c]:e.ref}:{},s=typeof o=="function"?o(t):o;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t));let d={};if(t){let f=!1,b=[];for(let[g,m]of Object.entries(t))typeof m=="boolean"&&(f=!0),m===!0&&b.push(g);f&&(d["data-headlessui-state"]=b.join(" "))}if(a===l.Fragment&&Object.keys(Be(i)).length>0){if(!l.isValidElement(s)||Array.isArray(s)&&s.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(i).map(m=>` - ${m}`).join(`
1
+ import{r as l,R as E,f as De,ac as ot}from"./index-CYAA3nVF.js";var lt=Object.defineProperty,ut=(e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t,n)=>(ut(e,typeof t!="symbol"?t+"":t,n),n);let at=class{constructor(){Se(this,"current",this.detect()),Se(this,"handoffState","pending"),Se(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},W=new at,B=(e,t)=>{W.isServer?l.useEffect(e,t):l.useLayoutEffect(e,t)};function j(e){let t=l.useRef(e);return B(()=>{t.current=e},[e]),t}let P=function(e){let t=j(e);return E.useCallback((...n)=>t.current(...n),[t])};function Ue(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function le(){let e=[],t={addEventListener(n,r,u,a){return n.addEventListener(r,u,a),t.add(()=>n.removeEventListener(r,u,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ue(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,u){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:u}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=le();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let u of e.splice(r,1))u()}},dispose(){for(let n of e.splice(0))n()}};return t}function qe(){let[e]=l.useState(le);return l.useEffect(()=>()=>e.dispose(),[e]),e}function it(){let e=typeof document>"u";return"useSyncExternalStore"in De?(t=>t.useSyncExternalStore)(De)(()=>()=>{},()=>!1,()=>!e):!1}function ve(){let e=it(),[t,n]=l.useState(W.isHandoffComplete);return t&&W.isHandoffComplete===!1&&n(!1),l.useEffect(()=>{t!==!0&&n(!0)},[t]),l.useEffect(()=>W.handoff(),[]),e?!1:t}var He;let ne=(He=E.useId)!=null?He:function(){let e=ve(),[t,n]=E.useState(e?()=>W.nextId():null);return B(()=>{t===null&&n(W.nextId())},[t]),t!=null?""+t:void 0};function I(e,t,...n){if(e in t){let u=t[e];return typeof u=="function"?u(...n):u}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(u=>`"${u}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,I),r}function me(e){return W.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Fe=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var K=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(K||{}),fe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fe||{}),st=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(st||{});function se(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Fe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ce=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ce||{});function Oe(e,t=0){var n;return e===((n=me(e))==null?void 0:n.body)?!1:I(t,{0(){return e.matches(Fe)},1(){let r=e;for(;r!==null;){if(r.matches(Fe))return!0;r=r.parentElement}return!1}})}function $n(e){let t=me(e);le().nextFrame(()=>{t&&!Oe(t.activeElement,0)&&dt(e)})}var ct=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ct||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function dt(e){e==null||e.focus({preventScroll:!0})}let ft=["textarea","input"].join(",");function pt(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ft))!=null?n:!1}function vt(e,t=n=>n){return e.slice().sort((n,r)=>{let u=t(n),a=t(r);if(u===null||a===null)return 0;let o=u.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Fn(e,t){return J(se(),t,{relativeTo:e})}function J(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:u=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?vt(e):e:se(e);u.length>0&&o.length>1&&(o=o.filter(b=>!u.includes(b))),r=r??a.activeElement;let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=t&32?{preventScroll:!0}:{},s=0,d=o.length,f;do{if(s>=d||s+d<=0)return 0;let b=i+s;if(t&16)b=(b+d)%d;else{if(b<0)return 3;if(b>=d)return 1}f=o[b],f==null||f.focus(p),s+=c}while(f!==a.activeElement);return t&6&&pt(f)&&f.select(),2}function mt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ht(){return/Android/gi.test(window.navigator.userAgent)}function gt(){return mt()||ht()}function ce(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return document.addEventListener(e,u,n),()=>document.removeEventListener(e,u,n)},[e,n])}function Ge(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return window.addEventListener(e,u,n),()=>window.removeEventListener(e,u,n)},[e,n])}function bt(e,t,n=!0){let r=l.useRef(!1);l.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function u(o,c){if(!r.current||o.defaultPrevented)return;let i=c(o);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let p=function s(d){return typeof d=="function"?s(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(let s of p){if(s===null)continue;let d=s instanceof HTMLElement?s:s.current;if(d!=null&&d.contains(i)||o.composed&&o.composedPath().includes(d))return}return!Oe(i,Ce.Loose)&&i.tabIndex!==-1&&o.preventDefault(),t(o,i)}let a=l.useRef(null);ce("pointerdown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("mousedown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("click",o=>{gt()||a.current&&(u(o,()=>a.current),a.current=null)},!0),ce("touchend",o=>u(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Ge("blur",o=>u(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ue(...e){return l.useMemo(()=>me(...e),[...e])}function je(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Et(e,t){let[n,r]=l.useState(()=>je(e));return B(()=>{r(je(e))},[e.type,e.as]),B(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Ke=Symbol();function Ve(e,t=!0){return Object.assign(e,{[Ke]:t})}function U(...e){let t=l.useRef(e);l.useEffect(()=>{t.current=e},[e]);let n=P(r=>{for(let u of t.current)u!=null&&(typeof u=="function"?u(r):u.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Ke]))?void 0:n}function pe(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var re=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(re||{}),Z=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Z||{});function q({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:u,visible:a=!0,name:o,mergeRefs:c}){c=c??Pt;let i=We(t,e);if(a)return de(i,n,r,o,c);let p=u??0;if(p&2){let{static:s=!1,...d}=i;if(s)return de(d,n,r,o,c)}if(p&1){let{unmount:s=!0,...d}=i;return I(s?0:1,{0(){return null},1(){return de({...d,hidden:!0,style:{display:"none"}},n,r,o,c)}})}return de(i,n,r,o,c)}function de(e,t={},n,r,u){let{as:a=n,children:o,refName:c="ref",...i}=we(e,["unmount","static"]),p=e.ref!==void 0?{[c]:e.ref}:{},s=typeof o=="function"?o(t):o;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t));let d={};if(t){let f=!1,b=[];for(let[g,m]of Object.entries(t))typeof m=="boolean"&&(f=!0),m===!0&&b.push(g);f&&(d["data-headlessui-state"]=b.join(" "))}if(a===l.Fragment&&Object.keys(Be(i)).length>0){if(!l.isValidElement(s)||Array.isArray(s)&&s.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(i).map(m=>` - ${m}`).join(`
2
2
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(m=>` - ${m}`).join(`
3
3
  `)].join(`
4
4
  `));let f=s.props,b=typeof(f==null?void 0:f.className)=="function"?(...m)=>pe(f==null?void 0:f.className(...m),i.className):pe(f==null?void 0:f.className,i.className),g=b?{className:b}:{};return l.cloneElement(s,Object.assign({},We(s.props,Be(we(i,["ref"]))),d,p,{ref:u(s.ref,p.ref)},g))}return l.createElement(a,Object.assign({},we(i,["ref"]),a!==l.Fragment&&p,a!==l.Fragment&&d),s)}function yt(){let e=l.useRef([]),t=l.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Pt(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function We(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let u in r)u.startsWith("on")&&typeof r[u]=="function"?(n[u]!=null||(n[u]=[]),n[u].push(r[u])):t[u]=r[u];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](u,...a){let o=n[r];for(let c of o){if((u instanceof Event||(u==null?void 0:u.nativeEvent)instanceof Event)&&u.defaultPrevented)return;c(u,...a)}}});return t}function _(e){var t;return Object.assign(l.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Be(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function we(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let St="div";var oe=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(oe||{});function wt(e,t){var n;let{features:r=1,...u}=e,a={ref:t,"aria-hidden":(r&2)===2?!0:(n=u["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return q({ourProps:a,theirProps:u,slot:{},defaultTag:St,name:"Hidden"})}let ie=_(wt),Ie=l.createContext(null);Ie.displayName="OpenClosedContext";var k=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(k||{});function he(){return l.useContext(Ie)}function ze({value:e,children:t}){return E.createElement(Ie.Provider,{value:e},t)}function Ye(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Tt(n)?!1:r}function Tt(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var X=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(X||{});function $t(e,t,n,r){let u=j(n);l.useEffect(()=>{e=e??window;function a(o){u.current(o)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}function Re(){let e=l.useRef(!1);return B(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ft(e){let t=P(e),n=l.useRef(!1);l.useEffect(()=>(n.current=!1,()=>{n.current=!0,Ue(()=>{n.current&&t()})}),[t])}var V=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(V||{});function Qe(){let e=l.useRef(0);return Ge("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}let Xe=l.createContext(!1);function xt(){return l.useContext(Xe)}function xn(e){return E.createElement(Xe.Provider,{value:e.force},e.children)}function Nt(e){let t=xt(),n=l.useContext(Je),r=ue(e),[u,a]=l.useState(()=>{if(!t&&n!==null||W.isServer)return null;let o=r==null?void 0:r.getElementById("headlessui-portal-root");if(o)return o;if(r===null)return null;let c=r.createElement("div");return c.setAttribute("id","headlessui-portal-root"),r.body.appendChild(c)});return l.useEffect(()=>{u!==null&&(r!=null&&r.body.contains(u)||r==null||r.body.appendChild(u))},[u,r]),l.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),u}let Ct=l.Fragment;function Ot(e,t){let n=e,r=l.useRef(null),u=U(Ve(s=>{r.current=s}),t),a=ue(r),o=Nt(r),[c]=l.useState(()=>{var s;return W.isServer?null:(s=a==null?void 0:a.createElement("div"))!=null?s:null}),i=l.useContext(xe),p=ve();return B(()=>{!o||!c||o.contains(c)||(c.setAttribute("data-headlessui-portal",""),o.appendChild(c))},[o,c]),B(()=>{if(c&&i)return i.register(c)},[i,c]),Ft(()=>{var s;!o||!c||(c instanceof Node&&o.contains(c)&&o.removeChild(c),o.childNodes.length<=0&&((s=o.parentElement)==null||s.removeChild(o)))}),p?!o||!c?null:ot.createPortal(q({ourProps:{ref:u},theirProps:n,defaultTag:Ct,name:"Portal"}),c):null}let It=l.Fragment,Je=l.createContext(null);function Rt(e,t){let{target:n,...r}=e,u={ref:U(t)};return E.createElement(Je.Provider,{value:n},q({ourProps:u,theirProps:r,defaultTag:It,name:"Popover.Group"}))}let xe=l.createContext(null);function Mt(){let e=l.useContext(xe),t=l.useRef([]),n=P(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=P(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),u=l.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,l.useMemo(()=>function({children:a}){return E.createElement(xe.Provider,{value:u},a)},[u])]}let Lt=_(Ot),kt=_(Rt),Nn=Object.assign(Lt,{Group:kt});function At({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let u=l.useRef((r=n==null?void 0:n.current)!=null?r:null),a=ue(u),o=P(()=>{var c,i,p;let s=[];for(let d of e)d!==null&&(d instanceof HTMLElement?s.push(d):"current"in d&&d.current instanceof HTMLElement&&s.push(d.current));if(t!=null&&t.current)for(let d of t.current)s.push(d);for(let d of(c=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?c:[])d!==document.body&&d!==document.head&&d instanceof HTMLElement&&d.id!=="headlessui-portal-root"&&(d.contains(u.current)||d.contains((p=(i=u.current)==null?void 0:i.getRootNode())==null?void 0:p.host)||s.some(f=>d.contains(f))||s.push(d));return s});return{resolveContainers:o,contains:P(c=>o().some(i=>i.contains(c))),mainTreeNodeRef:u,MainTreeNode:l.useMemo(()=>function(){return n!=null?null:E.createElement(ie,{features:oe.Hidden,ref:u})},[u,n])}}function Dt(){let e=l.useRef(null);return{mainTreeNodeRef:e,MainTreeNode:l.useMemo(()=>function(){return E.createElement(ie,{features:oe.Hidden,ref:e})},[e])}}var Ht=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ht||{}),jt=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(jt||{});let Bt={0:e=>{let t={...e,popoverState:I(e.popoverState,{0:1,1:0})};return t.popoverState===0&&(t.__demoMode=!1),t},1(e){return e.popoverState===1?e:{...e,popoverState:1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Me=l.createContext(null);Me.displayName="PopoverContext";function ge(e){let t=l.useContext(Me);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ge),n}return t}let Le=l.createContext(null);Le.displayName="PopoverAPIContext";function ke(e){let t=l.useContext(Le);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ke),n}return t}let Ae=l.createContext(null);Ae.displayName="PopoverGroupContext";function Ze(){return l.useContext(Ae)}let be=l.createContext(null);be.displayName="PopoverPanelContext";function _t(){return l.useContext(be)}function Ut(e,t){return I(t.type,Bt,e,t)}let qt="div";function Gt(e,t){var n;let{__demoMode:r=!1,...u}=e,a=l.useRef(null),o=U(t,Ve(y=>{a.current=y})),c=l.useRef([]),i=l.useReducer(Ut,{__demoMode:r,popoverState:r?0:1,buttons:c,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:l.createRef(),afterPanelSentinel:l.createRef()}),[{popoverState:p,button:s,buttonId:d,panel:f,panelId:b,beforePanelSentinel:g,afterPanelSentinel:m},v]=i,S=ue((n=a.current)!=null?n:s),x=l.useMemo(()=>{if(!s||!f)return!1;for(let H of document.querySelectorAll("body > *"))if(Number(H==null?void 0:H.contains(s))^Number(H==null?void 0:H.contains(f)))return!0;let y=se(),L=y.indexOf(s),te=(L+y.length-1)%y.length,ee=(L+1)%y.length,G=y[te],ae=y[ee];return!f.contains(G)&&!f.contains(ae)},[s,f]),T=j(d),R=j(b),A=l.useMemo(()=>({buttonId:T,panelId:R,close:()=>v({type:1})}),[T,R,v]),C=Ze(),D=C==null?void 0:C.registerPopover,$=P(()=>{var y;return(y=C==null?void 0:C.isFocusWithinPopoverGroup())!=null?y:(S==null?void 0:S.activeElement)&&((s==null?void 0:s.contains(S.activeElement))||(f==null?void 0:f.contains(S.activeElement)))});l.useEffect(()=>D==null?void 0:D(A),[D,A]);let[N,F]=Mt(),h=At({mainTreeNodeRef:C==null?void 0:C.mainTreeNodeRef,portals:N,defaultContainers:[s,f]});$t(S==null?void 0:S.defaultView,"focus",y=>{var L,te,ee,G;y.target!==window&&y.target instanceof HTMLElement&&p===0&&($()||s&&f&&(h.contains(y.target)||(te=(L=g.current)==null?void 0:L.contains)!=null&&te.call(L,y.target)||(G=(ee=m.current)==null?void 0:ee.contains)!=null&&G.call(ee,y.target)||v({type:1})))},!0),bt(h.resolveContainers,(y,L)=>{v({type:1}),Oe(L,Ce.Loose)||(y.preventDefault(),s==null||s.focus())},p===0);let w=P(y=>{v({type:1});let L=y?y instanceof HTMLElement?y:"current"in y&&y.current instanceof HTMLElement?y.current:s:s;L==null||L.focus()}),O=l.useMemo(()=>({close:w,isPortalled:x}),[w,x]),M=l.useMemo(()=>({open:p===0,close:w}),[p,w]),z={ref:o};return E.createElement(be.Provider,{value:null},E.createElement(Me.Provider,{value:i},E.createElement(Le.Provider,{value:O},E.createElement(ze,{value:I(p,{0:k.Open,1:k.Closed})},E.createElement(F,null,q({ourProps:z,theirProps:u,slot:M,defaultTag:qt,name:"Popover"}),E.createElement(h.MainTreeNode,null))))))}let Kt="button";function Vt(e,t){let n=ne(),{id:r=`headlessui-popover-button-${n}`,...u}=e,[a,o]=ge("Popover.Button"),{isPortalled:c}=ke("Popover.Button"),i=l.useRef(null),p=`headlessui-focus-sentinel-${ne()}`,s=Ze(),d=s==null?void 0:s.closeOthers,f=_t()!==null;l.useEffect(()=>{if(!f)return o({type:3,buttonId:r}),()=>{o({type:3,buttonId:null})}},[f,r,o]);let[b]=l.useState(()=>Symbol()),g=U(i,t,f?null:h=>{if(h)a.buttons.current.push(b);else{let w=a.buttons.current.indexOf(b);w!==-1&&a.buttons.current.splice(w,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),h&&o({type:2,button:h})}),m=U(i,t),v=ue(i),S=P(h=>{var w,O,M;if(f){if(a.popoverState===1)return;switch(h.key){case X.Space:case X.Enter:h.preventDefault(),(O=(w=h.target).click)==null||O.call(w),o({type:1}),(M=a.button)==null||M.focus();break}}else switch(h.key){case X.Space:case X.Enter:h.preventDefault(),h.stopPropagation(),a.popoverState===1&&(d==null||d(a.buttonId)),o({type:0});break;case X.Escape:if(a.popoverState!==0)return d==null?void 0:d(a.buttonId);if(!i.current||v!=null&&v.activeElement&&!i.current.contains(v.activeElement))return;h.preventDefault(),h.stopPropagation(),o({type:1});break}}),x=P(h=>{f||h.key===X.Space&&h.preventDefault()}),T=P(h=>{var w,O;Ye(h.currentTarget)||e.disabled||(f?(o({type:1}),(w=a.button)==null||w.focus()):(h.preventDefault(),h.stopPropagation(),a.popoverState===1&&(d==null||d(a.buttonId)),o({type:0}),(O=a.button)==null||O.focus()))}),R=P(h=>{h.preventDefault(),h.stopPropagation()}),A=a.popoverState===0,C=l.useMemo(()=>({open:A}),[A]),D=Et(e,i),$=f?{ref:m,type:D,onKeyDown:S,onClick:T}:{ref:g,id:a.buttonId,type:D,"aria-expanded":a.popoverState===0,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:S,onKeyUp:x,onClick:T,onMouseDown:R},N=Qe(),F=P(()=>{let h=a.panel;if(!h)return;function w(){I(N.current,{[V.Forwards]:()=>J(h,K.First),[V.Backwards]:()=>J(h,K.Last)})===fe.Error&&J(se().filter(O=>O.dataset.headlessuiFocusGuard!=="true"),I(N.current,{[V.Forwards]:K.Next,[V.Backwards]:K.Previous}),{relativeTo:a.button})}w()});return E.createElement(E.Fragment,null,q({ourProps:$,theirProps:u,slot:C,defaultTag:Kt,name:"Popover.Button"}),A&&!f&&c&&E.createElement(ie,{id:p,features:oe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:F}))}let Wt="div",zt=re.RenderStrategy|re.Static;function Yt(e,t){let n=ne(),{id:r=`headlessui-popover-overlay-${n}`,...u}=e,[{popoverState:a},o]=ge("Popover.Overlay"),c=U(t),i=he(),p=i!==null?(i&k.Open)===k.Open:a===0,s=P(f=>{if(Ye(f.currentTarget))return f.preventDefault();o({type:1})}),d=l.useMemo(()=>({open:a===0}),[a]);return q({ourProps:{ref:c,id:r,"aria-hidden":!0,onClick:s},theirProps:u,slot:d,defaultTag:Wt,features:zt,visible:p,name:"Popover.Overlay"})}let Qt="div",Xt=re.RenderStrategy|re.Static;function Jt(e,t){let n=ne(),{id:r=`headlessui-popover-panel-${n}`,focus:u=!1,...a}=e,[o,c]=ge("Popover.Panel"),{close:i,isPortalled:p}=ke("Popover.Panel"),s=`headlessui-focus-sentinel-before-${ne()}`,d=`headlessui-focus-sentinel-after-${ne()}`,f=l.useRef(null),b=U(f,t,$=>{c({type:4,panel:$})}),g=ue(f),m=yt();B(()=>(c({type:5,panelId:r}),()=>{c({type:5,panelId:null})}),[r,c]);let v=he(),S=v!==null?(v&k.Open)===k.Open:o.popoverState===0,x=P($=>{var N;switch($.key){case X.Escape:if(o.popoverState!==0||!f.current||g!=null&&g.activeElement&&!f.current.contains(g.activeElement))return;$.preventDefault(),$.stopPropagation(),c({type:1}),(N=o.button)==null||N.focus();break}});l.useEffect(()=>{var $;e.static||o.popoverState===1&&(($=e.unmount)==null||$)&&c({type:4,panel:null})},[o.popoverState,e.unmount,e.static,c]),l.useEffect(()=>{if(o.__demoMode||!u||o.popoverState!==0||!f.current)return;let $=g==null?void 0:g.activeElement;f.current.contains($)||J(f.current,K.First)},[o.__demoMode,u,f,o.popoverState]);let T=l.useMemo(()=>({open:o.popoverState===0,close:i}),[o,i]),R={ref:b,id:r,onKeyDown:x,onBlur:u&&o.popoverState===0?$=>{var N,F,h,w,O;let M=$.relatedTarget;M&&f.current&&((N=f.current)!=null&&N.contains(M)||(c({type:1}),((h=(F=o.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&h.call(F,M)||(O=(w=o.afterPanelSentinel.current)==null?void 0:w.contains)!=null&&O.call(w,M))&&M.focus({preventScroll:!0})))}:void 0,tabIndex:-1},A=Qe(),C=P(()=>{let $=f.current;if(!$)return;function N(){I(A.current,{[V.Forwards]:()=>{var F;J($,K.First)===fe.Error&&((F=o.afterPanelSentinel.current)==null||F.focus())},[V.Backwards]:()=>{var F;(F=o.button)==null||F.focus({preventScroll:!0})}})}N()}),D=P(()=>{let $=f.current;if(!$)return;function N(){I(A.current,{[V.Forwards]:()=>{var F;if(!o.button)return;let h=se(),w=h.indexOf(o.button),O=h.slice(0,w+1),M=[...h.slice(w+1),...O];for(let z of M.slice())if(z.dataset.headlessuiFocusGuard==="true"||(F=o.panel)!=null&&F.contains(z)){let y=M.indexOf(z);y!==-1&&M.splice(y,1)}J(M,K.First,{sorted:!1})},[V.Backwards]:()=>{var F;J($,K.Previous)===fe.Error&&((F=o.button)==null||F.focus())}})}N()});return E.createElement(be.Provider,{value:r},S&&p&&E.createElement(ie,{id:s,ref:o.beforePanelSentinel,features:oe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:C}),q({mergeRefs:m,ourProps:R,theirProps:a,slot:T,defaultTag:Qt,features:Xt,visible:S,name:"Popover.Panel"}),S&&p&&E.createElement(ie,{id:d,ref:o.afterPanelSentinel,features:oe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:D}))}let Zt="div";function en(e,t){let n=l.useRef(null),r=U(n,t),[u,a]=l.useState([]),o=Dt(),c=P(m=>{a(v=>{let S=v.indexOf(m);if(S!==-1){let x=v.slice();return x.splice(S,1),x}return v})}),i=P(m=>(a(v=>[...v,m]),()=>c(m))),p=P(()=>{var m;let v=me(n);if(!v)return!1;let S=v.activeElement;return(m=n.current)!=null&&m.contains(S)?!0:u.some(x=>{var T,R;return((T=v.getElementById(x.buttonId.current))==null?void 0:T.contains(S))||((R=v.getElementById(x.panelId.current))==null?void 0:R.contains(S))})}),s=P(m=>{for(let v of u)v.buttonId.current!==m&&v.close()}),d=l.useMemo(()=>({registerPopover:i,unregisterPopover:c,isFocusWithinPopoverGroup:p,closeOthers:s,mainTreeNodeRef:o.mainTreeNodeRef}),[i,c,p,s,o.mainTreeNodeRef]),f=l.useMemo(()=>({}),[]),b=e,g={ref:r};return E.createElement(Ae.Provider,{value:d},q({ourProps:g,theirProps:b,slot:f,defaultTag:Zt,name:"Popover.Group"}),E.createElement(o.MainTreeNode,null))}let tn=_(Gt),nn=_(Vt),rn=_(Yt),on=_(Jt),ln=_(en),Cn=Object.assign(tn,{Button:nn,Overlay:rn,Panel:on,Group:ln});function un(e=0){let[t,n]=l.useState(e),r=Re(),u=l.useCallback(i=>{r.current&&n(p=>p|i)},[t,r]),a=l.useCallback(i=>!!(t&i),[t]),o=l.useCallback(i=>{r.current&&n(p=>p&~i)},[n,r]),c=l.useCallback(i=>{r.current&&n(p=>p^i)},[n]);return{flags:t,addFlag:u,hasFlag:a,removeFlag:o,toggleFlag:c}}function an(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Te(e,...t){e&&t.length>0&&e.classList.add(...t)}function $e(e,...t){e&&t.length>0&&e.classList.remove(...t)}function sn(e,t){let n=le();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:u}=getComputedStyle(e),[a,o]=[r,u].map(i=>{let[p=0]=i.split(",").filter(Boolean).map(s=>s.includes("ms")?parseFloat(s):parseFloat(s)*1e3).sort((s,d)=>d-s);return p}),c=a+o;if(c!==0){n.group(p=>{p.setTimeout(()=>{t(),p.dispose()},c),p.addEventListener(e,"transitionrun",s=>{s.target===s.currentTarget&&p.dispose()})});let i=n.addEventListener(e,"transitionend",p=>{p.target===p.currentTarget&&(t(),i())})}else t();return n.add(()=>t()),n.dispose}function cn(e,t,n,r){let u=n?"enter":"leave",a=le(),o=r!==void 0?an(r):()=>{};u==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let c=I(u,{enter:()=>t.enter,leave:()=>t.leave}),i=I(u,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),p=I(u,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return $e(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Te(e,...t.base,...c,...p),a.nextFrame(()=>{$e(e,...t.base,...c,...p),Te(e,...t.base,...c,...i),sn(e,()=>($e(e,...t.base,...c),Te(e,...t.base,...t.entered),o()))}),a.dispose}function dn({immediate:e,container:t,direction:n,classes:r,onStart:u,onStop:a}){let o=Re(),c=qe(),i=j(n);B(()=>{e&&(i.current="enter")},[e]),B(()=>{let p=le();c.add(p.dispose);let s=t.current;if(s&&i.current!=="idle"&&o.current)return p.dispose(),u.current(i.current),p.add(cn(s,r.current,i.current==="enter",()=>{p.dispose(),a.current(i.current)})),p.dispose},[n])}function Q(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Ee=l.createContext(null);Ee.displayName="TransitionContext";var fn=(e=>(e.Visible="visible",e.Hidden="hidden",e))(fn||{});function pn(){let e=l.useContext(Ee);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function vn(){let e=l.useContext(ye);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let ye=l.createContext(null);ye.displayName="NestingContext";function Pe(e){return"children"in e?Pe(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function et(e,t){let n=j(e),r=l.useRef([]),u=Re(),a=qe(),o=P((b,g=Z.Hidden)=>{let m=r.current.findIndex(({el:v})=>v===b);m!==-1&&(I(g,{[Z.Unmount](){r.current.splice(m,1)},[Z.Hidden](){r.current[m].state="hidden"}}),a.microTask(()=>{var v;!Pe(r)&&u.current&&((v=n.current)==null||v.call(n))}))}),c=P(b=>{let g=r.current.find(({el:m})=>m===b);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:b,state:"visible"}),()=>o(b,Z.Unmount)}),i=l.useRef([]),p=l.useRef(Promise.resolve()),s=l.useRef({enter:[],leave:[],idle:[]}),d=P((b,g,m)=>{i.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([v])=>v!==b)),t==null||t.chains.current[g].push([b,new Promise(v=>{i.current.push(v)})]),t==null||t.chains.current[g].push([b,new Promise(v=>{Promise.all(s.current[g].map(([S,x])=>x)).then(()=>v())})]),g==="enter"?p.current=p.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(g)):m(g)}),f=P((b,g,m)=>{Promise.all(s.current[g].splice(0).map(([v,S])=>S)).then(()=>{var v;(v=i.current.shift())==null||v()}).then(()=>m(g))});return l.useMemo(()=>({children:r,register:c,unregister:o,onStart:d,onStop:f,wait:p,chains:s}),[c,o,r,d,f,s,p])}function mn(){}let hn=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function _e(e){var t;let n={};for(let r of hn)n[r]=(t=e[r])!=null?t:mn;return n}function gn(e){let t=l.useRef(_e(e));return l.useEffect(()=>{t.current=_e(e)},[e]),t}let bn="div",tt=re.RenderStrategy;function En(e,t){var n,r;let{beforeEnter:u,afterEnter:a,beforeLeave:o,afterLeave:c,enter:i,enterFrom:p,enterTo:s,entered:d,leave:f,leaveFrom:b,leaveTo:g,...m}=e,v=l.useRef(null),S=U(v,t),x=(n=m.unmount)==null||n?Z.Unmount:Z.Hidden,{show:T,appear:R,initial:A}=pn(),[C,D]=l.useState(T?"visible":"hidden"),$=vn(),{register:N,unregister:F}=$;l.useEffect(()=>N(v),[N,v]),l.useEffect(()=>{if(x===Z.Hidden&&v.current){if(T&&C!=="visible"){D("visible");return}return I(C,{hidden:()=>F(v),visible:()=>N(v)})}},[C,v,N,F,T,x]);let h=j({base:Q(m.className),enter:Q(i),enterFrom:Q(p),enterTo:Q(s),entered:Q(d),leave:Q(f),leaveFrom:Q(b),leaveTo:Q(g)}),w=gn({beforeEnter:u,afterEnter:a,beforeLeave:o,afterLeave:c}),O=ve();l.useEffect(()=>{if(O&&C==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,C,O]);let M=A&&!R,z=R&&T&&A,y=!O||M?"idle":T?"enter":"leave",L=un(0),te=P(Y=>I(Y,{enter:()=>{L.addFlag(k.Opening),w.current.beforeEnter()},leave:()=>{L.addFlag(k.Closing),w.current.beforeLeave()},idle:()=>{}})),ee=P(Y=>I(Y,{enter:()=>{L.removeFlag(k.Opening),w.current.afterEnter()},leave:()=>{L.removeFlag(k.Closing),w.current.afterLeave()},idle:()=>{}})),G=et(()=>{D("hidden"),F(v)},$),ae=l.useRef(!1);dn({immediate:z,container:v,classes:h,direction:y,onStart:j(Y=>{ae.current=!0,G.onStart(v,Y,te)}),onStop:j(Y=>{ae.current=!1,G.onStop(v,Y,ee),Y==="leave"&&!Pe(G)&&(D("hidden"),F(v))})});let H=m,rt={ref:S};return z?H={...H,className:pe(m.className,...h.current.enter,...h.current.enterFrom)}:ae.current&&(H.className=pe(m.className,(r=v.current)==null?void 0:r.className),H.className===""&&delete H.className),E.createElement(ye.Provider,{value:G},E.createElement(ze,{value:I(C,{visible:k.Open,hidden:k.Closed})|L.flags},q({ourProps:rt,theirProps:H,defaultTag:bn,features:tt,visible:C==="visible",name:"Transition.Child"})))}function yn(e,t){let{show:n,appear:r=!1,unmount:u=!0,...a}=e,o=l.useRef(null),c=U(o,t);ve();let i=he();if(n===void 0&&i!==null&&(n=(i&k.Open)===k.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[p,s]=l.useState(n?"visible":"hidden"),d=et(()=>{s("hidden")}),[f,b]=l.useState(!0),g=l.useRef([n]);B(()=>{f!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),b(!1))},[g,n]);let m=l.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);l.useEffect(()=>{if(n)s("visible");else if(!Pe(d))s("hidden");else{let T=o.current;if(!T)return;let R=T.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&s("hidden")}},[n,d]);let v={unmount:u},S=P(()=>{var T;f&&b(!1),(T=e.beforeEnter)==null||T.call(e)}),x=P(()=>{var T;f&&b(!1),(T=e.beforeLeave)==null||T.call(e)});return E.createElement(ye.Provider,{value:d},E.createElement(Ee.Provider,{value:m},q({ourProps:{...v,as:l.Fragment,children:E.createElement(nt,{ref:c,...v,...a,beforeEnter:S,beforeLeave:x})},theirProps:{},defaultTag:l.Fragment,features:tt,visible:p==="visible",name:"Transition"})))}function Pn(e,t){let n=l.useContext(Ee)!==null,r=he()!==null;return E.createElement(E.Fragment,null,!n&&r?E.createElement(Ne,{ref:t,...e}):E.createElement(nt,{ref:t,...e}))}let Ne=_(yn),nt=_(En),Sn=_(Pn),On=Object.assign(Ne,{Child:Sn,Root:Ne});export{Ye as A,Cn as B,q as C,On as D,$t as E,Be as F,me as G,ze as H,ne as I,Oe as J,Ce as K,$n as L,K as M,fe as N,J as O,vt as P,un as Q,j as R,Ve as S,Et as T,_ as U,yt as V,Fn as _,Qe as a,ie as b,oe as c,Ft as d,dt as e,Re as f,mt as g,le as h,B as i,he as j,k,ve as l,Mt as m,ue as n,P as o,qe as p,At as q,bt as r,V as s,Ue as t,I as u,xn as v,Nn as w,re as x,U as y,X as z};
@@ -231,7 +231,7 @@
231
231
  type="font/woff2"
232
232
  crossorigin="anonymous"
233
233
  />
234
- <script type="module" crossorigin src="/assets/index-BafGN4in.js"></script>
234
+ <script type="module" crossorigin src="/assets/index-CYAA3nVF.js"></script>
235
235
 
236
236
  </head>
237
237
 
@@ -1,41 +0,0 @@
1
- import{r as c,R as J,j,b as Jn,c as ve,ac as ot,f as eo,ad as to,af as he,ae as pn,ag as no,m as ee,i as Bt}from"./index-BafGN4in.js";function oo({title:e,titleId:t,...n},o){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},n),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const ro=c.forwardRef(oo);function co({title:e,titleId:t,...n},o){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},n),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const io=c.forwardRef(co);function so({title:e,titleId:t,...n},o){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},n),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const ao=c.forwardRef(so);function lo({title:e,titleId:t,...n},o){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},n),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z",clipRule:"evenodd"}))}const uo=c.forwardRef(lo);function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},T.apply(null,arguments)}const fo=J.forwardRef(function({type:t="text",value:n,placeholder:o,className:r,disabled:i=!1,autoFocus:a=!1,onInput:s,onKeyDown:l},u){return n=n??"",j.jsx("input",{ref:u,className:ve("placeholder:text-neutral-300 dark:placeholder:text-neutral-700",i&&"opacity-50 cursor-not-allowed",r),type:t,value:n,placeholder:o,disabled:i,autoFocus:a,readOnly:Jn(!!s),onInput:s,onKeyDown:l})});function Wt(e,[t,n]){return Math.min(n,Math.max(t,e))}function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Ot(e,t=[]){let n=[];function o(i,a){const s=c.createContext(a),l=n.length;n=[...n,a];function u(d){const{scope:w,children:m,...h}=d,f=(w==null?void 0:w[e][l])||s,v=c.useMemo(()=>h,Object.values(h));return c.createElement(f.Provider,{value:v},m)}function p(d,w){const m=(w==null?void 0:w[e][l])||s,h=c.useContext(m);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,p]}const r=()=>{const i=n.map(a=>c.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[o,po(r,...t)]}function po(...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(i){const a=o.reduce((s,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...s,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function mo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function mn(...e){return t=>e.forEach(n=>mo(n,t))}function K(...e){return c.useCallback(mn(...e),e)}const Be=c.forwardRef((e,t)=>{const{children:n,...o}=e,r=c.Children.toArray(n),i=r.find(vo);if(i){const a=i.props.children,s=r.map(l=>l===i?c.Children.count(a)>1?c.Children.only(null):c.isValidElement(a)?a.props.children:null:l);return c.createElement(bt,T({},o,{ref:t}),c.isValidElement(a)?c.cloneElement(a,void 0,s):null)}return c.createElement(bt,T({},o,{ref:t}),n)});Be.displayName="Slot";const bt=c.forwardRef((e,t)=>{const{children:n,...o}=e;return c.isValidElement(n)?c.cloneElement(n,{...go(o,n.props),ref:t?mn(t,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});bt.displayName="SlotClone";const ho=({children:e})=>c.createElement(c.Fragment,null,e);function vo(e){return c.isValidElement(e)&&e.type===ho}function go(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{i(...s),r(...s)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function wo(e){const t=e+"CollectionProvider",[n,o]=Ot(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:h,children:f}=m,v=J.useRef(null),g=J.useRef(new Map).current;return J.createElement(r,{scope:h,itemMap:g,collectionRef:v},f)},s=e+"CollectionSlot",l=J.forwardRef((m,h)=>{const{scope:f,children:v}=m,g=i(s,f),x=K(h,g.collectionRef);return J.createElement(Be,{ref:x},v)}),u=e+"CollectionItemSlot",p="data-radix-collection-item",d=J.forwardRef((m,h)=>{const{scope:f,children:v,...g}=m,x=J.useRef(null),$=K(h,x),b=i(u,f);return J.useEffect(()=>(b.itemMap.set(x,{ref:x,...g}),()=>void b.itemMap.delete(x))),J.createElement(Be,{[p]:"",ref:$},v)});function w(m){const h=i(e+"CollectionConsumer",m);return J.useCallback(()=>{const v=h.collectionRef.current;if(!v)return[];const g=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((b,y)=>g.indexOf(b.ref.current)-g.indexOf(y.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},w,o]}const xo=c.createContext(void 0);function $o(e){const t=c.useContext(xo);return e||t||"ltr"}const bo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Z=bo.reduce((e,t)=>{const n=c.forwardRef((o,r)=>{const{asChild:i,...a}=o,s=i?Be:t;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(s,T({},a,{ref:r}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yo(e,t){e&&ot.flushSync(()=>e.dispatchEvent(t))}function ue(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var o;return(o=t.current)===null||o===void 0?void 0:o.call(t,...n)},[])}function Eo(e,t=globalThis==null?void 0:globalThis.document){const n=ue(e);c.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o),()=>t.removeEventListener("keydown",o)},[n,t])}const yt="dismissableLayer.update",So="dismissableLayer.pointerDownOutside",Co="dismissableLayer.focusOutside";let Ht;const Po=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ro=c.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,p=c.useContext(Po),[d,w]=c.useState(null),m=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=c.useState({}),f=K(t,E=>w(E)),v=Array.from(p.layers),[g]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(g),$=d?v.indexOf(d):-1,b=p.layersWithOutsidePointerEventsDisabled.size>0,y=$>=x,P=To(E=>{const O=E.target,F=[...p.branches].some(I=>I.contains(O));!y||F||(i==null||i(E),s==null||s(E),E.defaultPrevented||l==null||l())},m),S=Oo(E=>{const O=E.target;[...p.branches].some(I=>I.contains(O))||(a==null||a(E),s==null||s(E),E.defaultPrevented||l==null||l())},m);return Eo(E=>{$===p.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},m),c.useEffect(()=>{if(d)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Ht=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),Vt(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ht)}},[d,m,o,p]),c.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),Vt())},[d,p]),c.useEffect(()=>{const E=()=>h({});return document.addEventListener(yt,E),()=>document.removeEventListener(yt,E)},[]),c.createElement(Z.div,T({},u,{ref:f,style:{pointerEvents:b?y?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,S.onFocusCapture),onBlurCapture:U(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,P.onPointerDownCapture)}))});function To(e,t=globalThis==null?void 0:globalThis.document){const n=ue(e),o=c.useRef(!1),r=c.useRef(()=>{});return c.useEffect(()=>{const i=s=>{if(s.target&&!o.current){let u=function(){hn(So,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Oo(e,t=globalThis==null?void 0:globalThis.document){const n=ue(e),o=c.useRef(!1);return c.useEffect(()=>{const r=i=>{i.target&&!o.current&&hn(Co,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Vt(){const e=new CustomEvent(yt);document.dispatchEvent(e)}function hn(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?yo(r,i):r.dispatchEvent(i)}let ft=0;function Ao(){c.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:jt()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:jt()),ft++,()=>{ft===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),ft--}},[])}function jt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const pt="focusScope.autoFocusOnMount",mt="focusScope.autoFocusOnUnmount",Ut={bubbles:!1,cancelable:!0},Do=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...a}=e,[s,l]=c.useState(null),u=ue(r),p=ue(i),d=c.useRef(null),w=K(t,f=>l(f)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let f=function($){if(m.paused||!s)return;const b=$.target;s.contains(b)?d.current=b:me(d.current,{select:!0})},v=function($){if(m.paused||!s)return;const b=$.relatedTarget;b!==null&&(s.contains(b)||me(d.current,{select:!0}))},g=function($){const b=document.activeElement;for(const y of $)y.removedNodes.length>0&&(s!=null&&s.contains(b)||me(s))};document.addEventListener("focusin",f),document.addEventListener("focusout",v);const x=new MutationObserver(g);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",v),x.disconnect()}}},[o,s,m.paused]),c.useEffect(()=>{if(s){Kt.add(m);const f=document.activeElement;if(!s.contains(f)){const g=new CustomEvent(pt,Ut);s.addEventListener(pt,u),s.dispatchEvent(g),g.defaultPrevented||(_o(Lo(vn(s)),{select:!0}),document.activeElement===f&&me(s))}return()=>{s.removeEventListener(pt,u),setTimeout(()=>{const g=new CustomEvent(mt,Ut);s.addEventListener(mt,p),s.dispatchEvent(g),g.defaultPrevented||me(f??document.body,{select:!0}),s.removeEventListener(mt,p),Kt.remove(m)},0)}}},[s,u,p,m]);const h=c.useCallback(f=>{if(!n&&!o||m.paused)return;const v=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,g=document.activeElement;if(v&&g){const x=f.currentTarget,[$,b]=Io(x);$&&b?!f.shiftKey&&g===b?(f.preventDefault(),n&&me($,{select:!0})):f.shiftKey&&g===$&&(f.preventDefault(),n&&me(b,{select:!0})):g===x&&f.preventDefault()}},[n,o,m.paused]);return c.createElement(Z.div,T({tabIndex:-1},a,{ref:w,onKeyDown:h}))});function _o(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(me(o,{select:t}),document.activeElement!==n)return}function Io(e){const t=vn(e),n=zt(t,e),o=zt(t.reverse(),e);return[n,o]}function vn(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 zt(e,t){for(const n of e)if(!No(n,{upTo:t}))return n}function No(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 Mo(e){return e instanceof HTMLInputElement&&"select"in e}function me(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Mo(e)&&t&&e.select()}}const Kt=ko();function ko(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Yt(e,t),e.unshift(t)},remove(t){var n;e=Yt(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Yt(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Lo(e){return e.filter(t=>t.tagName!=="A")}const te=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Fo=eo.useId||(()=>{});let Bo=0;function gn(e){const[t,n]=c.useState(Fo());return te(()=>{n(o=>o??String(Bo++))},[e]),e||(t?`radix-${t}`:"")}const Wo=["top","right","bottom","left"],ge=Math.min,G=Math.max,Je=Math.round,Ue=Math.floor,ie=e=>({x:e,y:e}),Ho={left:"right",right:"left",bottom:"top",top:"bottom"},Vo={start:"end",end:"start"};function Et(e,t,n){return G(e,ge(t,n))}function de(e,t){return typeof e=="function"?e(t):e}function fe(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function At(e){return e==="x"?"y":"x"}function Dt(e){return e==="y"?"height":"width"}function we(e){return["top","bottom"].includes(fe(e))?"y":"x"}function _t(e){return At(we(e))}function jo(e,t,n){n===void 0&&(n=!1);const o=_e(e),r=_t(e),i=Dt(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=et(a)),[a,et(a)]}function Uo(e){const t=et(e);return[St(e),t,St(t)]}function St(e){return e.replace(/start|end/g,t=>Vo[t])}function zo(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:a;default:return[]}}function Ko(e,t,n,o){const r=_e(e);let i=zo(fe(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(St)))),i}function et(e){return e.replace(/left|right|bottom|top/g,t=>Ho[t])}function Yo(e){return{top:0,right:0,bottom:0,left:0,...e}}function wn(e){return typeof e!="number"?Yo(e):{top:e,right:e,bottom:e,left:e}}function tt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Xt(e,t,n){let{reference:o,floating:r}=e;const i=we(t),a=_t(t),s=Dt(a),l=fe(t),u=i==="y",p=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,w=o[s]/2-r[s]/2;let m;switch(l){case"top":m={x:p,y:o.y-r.height};break;case"bottom":m={x:p,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-r.width,y:d};break;default:m={x:o.x,y:o.y}}switch(_e(t)){case"start":m[a]-=w*(n&&u?-1:1);break;case"end":m[a]+=w*(n&&u?-1:1);break}return m}const Xo=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:d}=Xt(u,o,l),w=o,m={},h=0;for(let f=0;f<s.length;f++){const{name:v,fn:g}=s[f],{x,y:$,data:b,reset:y}=await g({x:p,y:d,initialPlacement:o,placement:w,strategy:r,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});p=x??p,d=$??d,m={...m,[v]:{...m[v],...b}},y&&h<=50&&(h++,typeof y=="object"&&(y.placement&&(w=y.placement),y.rects&&(u=y.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):y.rects),{x:p,y:d}=Xt(u,w,l)),f=-1)}return{x:p,y:d,placement:w,strategy:r,middlewareData:m}};async function We(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:w=!1,padding:m=0}=de(t,e),h=wn(m),v=s[w?d==="floating"?"reference":"floating":d],g=tt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:p,strategy:l})),x=d==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,$=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),b=await(i.isElement==null?void 0:i.isElement($))?await(i.getScale==null?void 0:i.getScale($))||{x:1,y:1}:{x:1,y:1},y=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:$,strategy:l}):x);return{top:(g.top-y.top+h.top)/b.y,bottom:(y.bottom-g.bottom+h.bottom)/b.y,left:(g.left-y.left+h.left)/b.x,right:(y.right-g.right+h.right)/b.x}}const Zo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:p=0}=de(e,t)||{};if(u==null)return{};const d=wn(p),w={x:n,y:o},m=_t(r),h=Dt(m),f=await a.getDimensions(u),v=m==="y",g=v?"top":"left",x=v?"bottom":"right",$=v?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[m]-w[m]-i.floating[h],y=w[m]-i.reference[m],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let S=P?P[$]:0;(!S||!await(a.isElement==null?void 0:a.isElement(P)))&&(S=s.floating[$]||i.floating[h]);const E=b/2-y/2,O=S/2-f[h]/2-1,F=ge(d[g],O),I=ge(d[x],O),B=F,A=S-f[h]-I,D=S/2-f[h]/2+E,N=Et(B,D,A),_=!l.arrow&&_e(r)!=null&&D!==N&&i.reference[h]/2-(D<B?F:I)-f[h]/2<0,W=_?D<B?D-B:D-A:0;return{[m]:w[m]+W,data:{[m]:N,centerOffset:D-N-W,..._&&{alignmentOffset:W}},reset:_}}}),qo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:w,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...v}=de(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=fe(r),x=we(s),$=fe(s)===s,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),y=w||($||!f?[et(s)]:Uo(s)),P=h!=="none";!w&&P&&y.push(...Ko(s,f,h,b));const S=[s,...y],E=await We(t,v),O=[];let F=((o=i.flip)==null?void 0:o.overflows)||[];if(p&&O.push(E[g]),d){const D=jo(r,a,b);O.push(E[D[0]],E[D[1]])}if(F=[...F,{placement:r,overflows:O}],!O.every(D=>D<=0)){var I,B;const D=(((I=i.flip)==null?void 0:I.index)||0)+1,N=S[D];if(N)return{data:{index:D,overflows:F},reset:{placement:N}};let _=(B=F.filter(W=>W.overflows[0]<=0).sort((W,R)=>W.overflows[1]-R.overflows[1])[0])==null?void 0:B.placement;if(!_)switch(m){case"bestFit":{var A;const W=(A=F.filter(R=>{if(P){const V=we(R.placement);return V===x||V==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(V=>V>0).reduce((V,z)=>V+z,0)]).sort((R,V)=>R[1]-V[1])[0])==null?void 0:A[0];W&&(_=W);break}case"initialPlacement":_=s;break}if(r!==_)return{reset:{placement:_}}}return{}}}};function Zt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return Wo.some(t=>e[t]>=0)}const Go=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=de(e,t);switch(o){case"referenceHidden":{const i=await We(t,{...r,elementContext:"reference"}),a=Zt(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:qt(a)}}}case"escaped":{const i=await We(t,{...r,altBoundary:!0}),a=Zt(i,n.floating);return{data:{escapedOffsets:a,escaped:qt(a)}}}default:return{}}}}};async function Qo(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=fe(n),s=_e(n),l=we(n)==="y",u=["left","top"].includes(a)?-1:1,p=i&&l?-1:1,d=de(t,e);let{mainAxis:w,crossAxis:m,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(m=s==="end"?h*-1:h),l?{x:m*p,y:w*u}:{x:w*u,y:m*p}}const Jo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,l=await Qo(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},er=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:g,y:x}=v;return{x:g,y:x}}},...l}=de(e,t),u={x:n,y:o},p=await We(t,l),d=we(fe(r)),w=At(d);let m=u[w],h=u[d];if(i){const v=w==="y"?"top":"left",g=w==="y"?"bottom":"right",x=m+p[v],$=m-p[g];m=Et(x,m,$)}if(a){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",x=h+p[v],$=h-p[g];h=Et(x,h,$)}const f=s.fn({...t,[w]:m,[d]:h});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[w]:i,[d]:a}}}}}},tr=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=de(e,t),p={x:n,y:o},d=we(r),w=At(d);let m=p[w],h=p[d];const f=de(s,t),v=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const $=w==="y"?"height":"width",b=i.reference[w]-i.floating[$]+v.mainAxis,y=i.reference[w]+i.reference[$]-v.mainAxis;m<b?m=b:m>y&&(m=y)}if(u){var g,x;const $=w==="y"?"width":"height",b=["top","left"].includes(fe(r)),y=i.reference[d]-i.floating[$]+(b&&((g=a.offset)==null?void 0:g[d])||0)+(b?0:v.crossAxis),P=i.reference[d]+i.reference[$]+(b?0:((x=a.offset)==null?void 0:x[d])||0)-(b?v.crossAxis:0);h<y?h=y:h>P&&(h=P)}return{[w]:m,[d]:h}}}},nr=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...u}=de(e,t),p=await We(t,u),d=fe(r),w=_e(r),m=we(r)==="y",{width:h,height:f}=i.floating;let v,g;d==="top"||d==="bottom"?(v=d,g=w===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,v=w==="end"?"top":"bottom");const x=f-p.top-p.bottom,$=h-p.left-p.right,b=ge(f-p[v],x),y=ge(h-p[g],$),P=!t.middlewareData.shift;let S=b,E=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=$),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=x),P&&!w){const F=G(p.left,0),I=G(p.right,0),B=G(p.top,0),A=G(p.bottom,0);m?E=h-2*(F!==0||I!==0?F+I:G(p.left,p.right)):S=f-2*(B!==0||A!==0?B+A:G(p.top,p.bottom))}await l({...t,availableWidth:E,availableHeight:S});const O=await a.getDimensions(s.floating);return h!==O.width||f!==O.height?{reset:{rects:!0}}:{}}}};function rt(){return typeof window<"u"}function Ie(e){return xn(e)?(e.nodeName||"").toLowerCase():"#document"}function Q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ae(e){var t;return(t=(xn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xn(e){return rt()?e instanceof Node||e instanceof Q(e).Node:!1}function re(e){return rt()?e instanceof Element||e instanceof Q(e).Element:!1}function se(e){return rt()?e instanceof HTMLElement||e instanceof Q(e).HTMLElement:!1}function Gt(e){return!rt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Q(e).ShadowRoot}function Ve(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function or(e){return["table","td","th"].includes(Ie(e))}function ct(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function It(e){const t=Nt(),n=re(e)?ce(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function rr(e){let t=xe(e);for(;se(t)&&!Ae(t);){if(It(t))return t;if(ct(t))return null;t=xe(t)}return null}function Nt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ae(e){return["html","body","#document"].includes(Ie(e))}function ce(e){return Q(e).getComputedStyle(e)}function it(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xe(e){if(Ie(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||ae(e);return Gt(t)?t.host:t}function $n(e){const t=xe(e);return Ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:se(t)&&Ve(t)?t:$n(t)}function He(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=$n(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=Q(r);if(i){const s=Ct(a);return t.concat(a,a.visualViewport||[],Ve(r)?r:[],s&&n?He(s):[])}return t.concat(r,He(r,[],n))}function Ct(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bn(e){const t=ce(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=se(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=Je(n)!==i||Je(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function Mt(e){return re(e)?e:e.contextElement}function Te(e){const t=Mt(e);if(!se(t))return ie(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=bn(t);let a=(i?Je(n.width):n.width)/o,s=(i?Je(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const cr=ie(0);function yn(e){const t=Q(e);return!Nt()||!t.visualViewport?cr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ir(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Q(e)?!1:t}function $e(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Mt(e);let a=ie(1);t&&(o?re(o)&&(a=Te(o)):a=Te(e));const s=ir(i,n,o)?yn(i):ie(0);let l=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,p=r.width/a.x,d=r.height/a.y;if(i){const w=Q(i),m=o&&re(o)?Q(o):o;let h=w,f=Ct(h);for(;f&&o&&m!==h;){const v=Te(f),g=f.getBoundingClientRect(),x=ce(f),$=g.left+(f.clientLeft+parseFloat(x.paddingLeft))*v.x,b=g.top+(f.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,u*=v.y,p*=v.x,d*=v.y,l+=$,u+=b,h=Q(f),f=Ct(h)}}return tt({width:p,height:d,x:l,y:u})}function kt(e,t){const n=it(e).scrollLeft;return t?t.left+n:$e(ae(e)).left+n}function En(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-(n?0:kt(e,o)),i=o.top+t.scrollTop;return{x:r,y:i}}function sr(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=ae(o),s=t?ct(t.floating):!1;if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=ie(1);const p=ie(0),d=se(o);if((d||!d&&!i)&&((Ie(o)!=="body"||Ve(a))&&(l=it(o)),se(o))){const m=$e(o);u=Te(o),p.x=m.x+o.clientLeft,p.y=m.y+o.clientTop}const w=a&&!d&&!i?En(a,l,!0):ie(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+p.x+w.x,y:n.y*u.y-l.scrollTop*u.y+p.y+w.y}}function ar(e){return Array.from(e.getClientRects())}function lr(e){const t=ae(e),n=it(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+kt(e);const s=-n.scrollTop;return ce(o).direction==="rtl"&&(a+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}function ur(e,t){const n=Q(e),o=ae(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const u=Nt();(!u||u&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:s,y:l}}function dr(e,t){const n=$e(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=se(e)?Te(e):ie(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=r*i.x,u=o*i.y;return{width:a,height:s,x:l,y:u}}function Qt(e,t,n){let o;if(t==="viewport")o=ur(e,n);else if(t==="document")o=lr(ae(e));else if(re(t))o=dr(t,n);else{const r=yn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return tt(o)}function Sn(e,t){const n=xe(e);return n===t||!re(n)||Ae(n)?!1:ce(n).position==="fixed"||Sn(n,t)}function fr(e,t){const n=t.get(e);if(n)return n;let o=He(e,[],!1).filter(s=>re(s)&&Ie(s)!=="body"),r=null;const i=ce(e).position==="fixed";let a=i?xe(e):e;for(;re(a)&&!Ae(a);){const s=ce(a),l=It(a);!l&&s.position==="fixed"&&(r=null),(i?!l&&!r:!l&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Ve(a)&&!l&&Sn(e,a))?o=o.filter(p=>p!==a):r=s,a=xe(a)}return t.set(e,o),o}function pr(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?ct(t)?[]:fr(t,this._c):[].concat(n),o],s=a[0],l=a.reduce((u,p)=>{const d=Qt(t,p,r);return u.top=G(d.top,u.top),u.right=ge(d.right,u.right),u.bottom=ge(d.bottom,u.bottom),u.left=G(d.left,u.left),u},Qt(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mr(e){const{width:t,height:n}=bn(e);return{width:t,height:n}}function hr(e,t,n){const o=se(t),r=ae(t),i=n==="fixed",a=$e(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=ie(0);if(o||!o&&!i)if((Ie(t)!=="body"||Ve(r))&&(s=it(t)),o){const w=$e(t,!0,i,t);l.x=w.x+t.clientLeft,l.y=w.y+t.clientTop}else r&&(l.x=kt(r));const u=r&&!o&&!i?En(r,s):ie(0),p=a.left+s.scrollLeft-l.x-u.x,d=a.top+s.scrollTop-l.y-u.y;return{x:p,y:d,width:a.width,height:a.height}}function ht(e){return ce(e).position==="static"}function Jt(e,t){if(!se(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ae(e)===n&&(n=n.ownerDocument.body),n}function Cn(e,t){const n=Q(e);if(ct(e))return n;if(!se(e)){let r=xe(e);for(;r&&!Ae(r);){if(re(r)&&!ht(r))return r;r=xe(r)}return n}let o=Jt(e,t);for(;o&&or(o)&&ht(o);)o=Jt(o,t);return o&&Ae(o)&&ht(o)&&!It(o)?n:o||rr(e)||n}const vr=async function(e){const t=this.getOffsetParent||Cn,n=this.getDimensions,o=await n(e.floating);return{reference:hr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function gr(e){return ce(e).direction==="rtl"}const wr={convertOffsetParentRelativeRectToViewportRelativeRect:sr,getDocumentElement:ae,getClippingRect:pr,getOffsetParent:Cn,getElementRects:vr,getClientRects:ar,getDimensions:mr,getScale:Te,isElement:re,isRTL:gr};function Pn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xr(e,t){let n=null,o;const r=ae(e);function i(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:p,top:d,width:w,height:m}=u;if(s||t(),!w||!m)return;const h=Ue(d),f=Ue(r.clientWidth-(p+w)),v=Ue(r.clientHeight-(d+m)),g=Ue(p),$={rootMargin:-h+"px "+-f+"px "+-v+"px "+-g+"px",threshold:G(0,ge(1,l))||1};let b=!0;function y(P){const S=P[0].intersectionRatio;if(S!==l){if(!b)return a();S?a(!1,S):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!Pn(u,e.getBoundingClientRect())&&a(),b=!1}try{n=new IntersectionObserver(y,{...$,root:r.ownerDocument})}catch{n=new IntersectionObserver(y,$)}n.observe(e)}return a(!0),i}function $r(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=Mt(e),p=r||i?[...u?He(u):[],...He(t)]:[];p.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&s?xr(u,n):null;let w=-1,m=null;a&&(m=new ResizeObserver(g=>{let[x]=g;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var $;($=m)==null||$.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let h,f=l?$e(e):null;l&&v();function v(){const g=$e(e);f&&!Pn(f,g)&&n(),f=g,h=requestAnimationFrame(v)}return n(),()=>{var g;p.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d==null||d(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(h)}}const br=Jo,yr=er,Er=qo,Sr=nr,Cr=Go,en=Zo,Pr=tr,Rr=(e,t,n)=>{const o=new Map,r={platform:wr,...n},i={...r.platform,_c:o};return Xo(e,t,{...r,platform:i})};var qe=typeof document<"u"?c.useLayoutEffect:c.useEffect;function nt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!nt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!nt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Rn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tn(e,t){const n=Rn(e);return Math.round(t*n)/n}function vt(e){const t=c.useRef(e);return qe(()=>{t.current=e}),t}function Tr(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[p,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,m]=c.useState(o);nt(w,o)||m(o);const[h,f]=c.useState(null),[v,g]=c.useState(null),x=c.useCallback(R=>{R!==P.current&&(P.current=R,f(R))},[]),$=c.useCallback(R=>{R!==S.current&&(S.current=R,g(R))},[]),b=i||h,y=a||v,P=c.useRef(null),S=c.useRef(null),E=c.useRef(p),O=l!=null,F=vt(l),I=vt(r),B=vt(u),A=c.useCallback(()=>{if(!P.current||!S.current)return;const R={placement:t,strategy:n,middleware:w};I.current&&(R.platform=I.current),Rr(P.current,S.current,R).then(V=>{const z={...V,isPositioned:B.current!==!1};D.current&&!nt(E.current,z)&&(E.current=z,ot.flushSync(()=>{d(z)}))})},[w,t,n,I,B]);qe(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const D=c.useRef(!1);qe(()=>(D.current=!0,()=>{D.current=!1}),[]),qe(()=>{if(b&&(P.current=b),y&&(S.current=y),b&&y){if(F.current)return F.current(b,y,A);A()}},[b,y,A,F,O]);const N=c.useMemo(()=>({reference:P,floating:S,setReference:x,setFloating:$}),[x,$]),_=c.useMemo(()=>({reference:b,floating:y}),[b,y]),W=c.useMemo(()=>{const R={position:n,left:0,top:0};if(!_.floating)return R;const V=tn(_.floating,p.x),z=tn(_.floating,p.y);return s?{...R,transform:"translate("+V+"px, "+z+"px)",...Rn(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:z}},[n,s,_.floating,p.x,p.y]);return c.useMemo(()=>({...p,update:A,refs:N,elements:_,floatingStyles:W}),[p,A,N,_,W])}const Or=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?en({element:o.current,padding:r}).fn(n):{}:o?en({element:o,padding:r}).fn(n):{}}}},Ar=(e,t)=>({...br(e),options:[e,t]}),Dr=(e,t)=>({...yr(e),options:[e,t]}),_r=(e,t)=>({...Pr(e),options:[e,t]}),Ir=(e,t)=>({...Er(e),options:[e,t]}),Nr=(e,t)=>({...Sr(e),options:[e,t]}),Mr=(e,t)=>({...Cr(e),options:[e,t]}),kr=(e,t)=>({...Or(e),options:[e,t]});function Lr(e){const[t,n]=c.useState(void 0);return te(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}const Tn="Popper",[On,An]=Ot(Tn),[Fr,Dn]=On(Tn),Br=e=>{const{__scopePopper:t,children:n}=e,[o,r]=c.useState(null);return c.createElement(Fr,{scope:t,anchor:o,onAnchorChange:r},n)},Wr="PopperAnchor",Hr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Dn(Wr,n),a=c.useRef(null),s=K(t,a);return c.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||a.current)}),o?null:c.createElement(Z.div,T({},r,{ref:s}))}),_n="PopperContent",[Vr,_i]=On(_n),jr=c.forwardRef((e,t)=>{var n,o,r,i,a,s,l,u;const{__scopePopper:p,side:d="bottom",sideOffset:w=0,align:m="center",alignOffset:h=0,arrowPadding:f=0,collisionBoundary:v=[],collisionPadding:g=0,sticky:x="partial",hideWhenDetached:$=!1,avoidCollisions:b=!0,onPlaced:y,...P}=e,S=Dn(_n,p),[E,O]=c.useState(null),F=K(t,X=>O(X)),[I,B]=c.useState(null),A=Lr(I),D=(n=A==null?void 0:A.width)!==null&&n!==void 0?n:0,N=(o=A==null?void 0:A.height)!==null&&o!==void 0?o:0,_=d+(m!=="center"?"-"+m:""),W=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},R=Array.isArray(v)?v:[v],V=R.length>0,z={padding:W,boundary:R.filter(Ur),altBoundary:V},{refs:Ee,floatingStyles:Se,placement:Me,isPositioned:ne,middlewareData:oe}=Tr({strategy:"fixed",placement:_,whileElementsMounted:$r,elements:{reference:S.anchor},middleware:[Ar({mainAxis:w+N,alignmentAxis:h}),b&&Dr({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?_r():void 0,...z}),b&&Ir({...z}),Nr({...z,apply:({elements:X,rects:ke,availableWidth:Le,availableHeight:Fe})=>{const{width:Gn,height:Qn}=ke.reference,je=X.floating.style;je.setProperty("--radix-popper-available-width",`${Le}px`),je.setProperty("--radix-popper-available-height",`${Fe}px`),je.setProperty("--radix-popper-anchor-width",`${Gn}px`),je.setProperty("--radix-popper-anchor-height",`${Qn}px`)}}),I&&kr({element:I,padding:f}),zr({arrowWidth:D,arrowHeight:N}),$&&Mr({strategy:"referenceHidden"})]}),[pe,C]=In(Me),M=ue(y);te(()=>{ne&&(M==null||M())},[ne,M]);const Y=(r=oe.arrow)===null||r===void 0?void 0:r.x,H=(i=oe.arrow)===null||i===void 0?void 0:i.y,k=((a=oe.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[L,q]=c.useState();return te(()=>{E&&q(window.getComputedStyle(E).zIndex)},[E]),c.createElement("div",{ref:Ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...Se,transform:ne?Se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:L,"--radix-popper-transform-origin":[(s=oe.transformOrigin)===null||s===void 0?void 0:s.x,(l=oe.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},c.createElement(Vr,{scope:p,placedSide:pe,onArrowChange:B,arrowX:Y,arrowY:H,shouldHideArrow:k},c.createElement(Z.div,T({"data-side":pe,"data-align":C},P,{ref:F,style:{...P.style,animation:ne?void 0:"none",opacity:(u=oe.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function Ur(e){return e!==null}const zr=e=>({name:"transformOrigin",options:e,fn(t){var n,o,r,i,a;const{placement:s,rects:l,middlewareData:u}=t,d=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,w=d?0:e.arrowWidth,m=d?0:e.arrowHeight,[h,f]=In(s),v={start:"0%",center:"50%",end:"100%"}[f],g=((o=(r=u.arrow)===null||r===void 0?void 0:r.x)!==null&&o!==void 0?o:0)+w/2,x=((i=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+m/2;let $="",b="";return h==="bottom"?($=d?v:`${g}px`,b=`${-m}px`):h==="top"?($=d?v:`${g}px`,b=`${l.floating.height+m}px`):h==="right"?($=`${-m}px`,b=d?v:`${x}px`):h==="left"&&($=`${l.floating.width+m}px`,b=d?v:`${x}px`),{data:{x:$,y:b}}}});function In(e){const[t,n="center"]=e.split("-");return[t,n]}const Kr=Br,Yr=Hr,Xr=jr,Zr=c.forwardRef((e,t)=>{var n;const{container:o=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...r}=e;return o?to.createPortal(c.createElement(Z.div,T({},r,{ref:t})),o):null});function nn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=qr({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:o,s=ue(n),l=c.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&s(d)}else r(u)},[i,e,r,s]);return[a,l]}function qr({defaultProp:e,onChange:t}){const n=c.useState(e),[o]=n,r=c.useRef(o),i=ue(t);return c.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}function Gr(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Qr(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jr(...e){return t=>e.forEach(n=>Qr(n,t))}const Nn=c.forwardRef((e,t)=>{const{children:n,...o}=e,r=c.Children.toArray(n),i=r.find(tc);if(i){const a=i.props.children,s=r.map(l=>l===i?c.Children.count(a)>1?c.Children.only(null):c.isValidElement(a)?a.props.children:null:l);return c.createElement(Pt,T({},o,{ref:t}),c.isValidElement(a)?c.cloneElement(a,void 0,s):null)}return c.createElement(Pt,T({},o,{ref:t}),n)});Nn.displayName="Slot";const Pt=c.forwardRef((e,t)=>{const{children:n,...o}=e;return c.isValidElement(n)?c.cloneElement(n,{...nc(o,n.props),ref:t?Jr(t,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});Pt.displayName="SlotClone";const ec=({children:e})=>c.createElement(c.Fragment,null,e);function tc(e){return c.isValidElement(e)&&e.type===ec}function nc(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{i(...s),r(...s)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}const oc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],rc=oc.reduce((e,t)=>{const n=c.forwardRef((o,r)=>{const{asChild:i,...a}=o,s=i?Nn:t;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(s,T({},a,{ref:r}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),cc=c.forwardRef((e,t)=>c.createElement(rc.span,T({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));var ic=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ce=new WeakMap,ze=new WeakMap,Ke={},gt=0,Mn=function(e){return e&&(e.host||Mn(e.parentNode))},sc=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Mn(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ac=function(e,t,n,o){var r=sc(t,Array.isArray(e)?e:[e]);Ke[n]||(Ke[n]=new WeakMap);var i=Ke[n],a=[],s=new Set,l=new Set(r),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};r.forEach(u);var p=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(w){if(s.has(w))p(w);else try{var m=w.getAttribute(o),h=m!==null&&m!=="false",f=(Ce.get(w)||0)+1,v=(i.get(w)||0)+1;Ce.set(w,f),i.set(w,v),a.push(w),f===1&&h&&ze.set(w,!0),v===1&&w.setAttribute(n,"true"),h||w.setAttribute(o,"true")}catch(g){console.error("aria-hidden: cannot operate on ",w,g)}})};return p(t),s.clear(),gt++,function(){a.forEach(function(d){var w=Ce.get(d)-1,m=i.get(d)-1;Ce.set(d,w),i.set(d,m),w||(ze.has(d)||d.removeAttribute(o),ze.delete(d)),m||d.removeAttribute(n)}),gt--,gt||(Ce=new WeakMap,Ce=new WeakMap,ze=new WeakMap,Ke={})}},lc=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=ic(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),ac(o,r,n,"aria-hidden")):function(){return null}},Ge="right-scroll-bar-position",Qe="width-before-scroll-bar",uc="with-scroll-bars-hidden",dc="--removed-body-scroll-bar-size";function wt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fc(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var pc=typeof window<"u"?c.useLayoutEffect:c.useEffect,on=new WeakMap;function mc(e,t){var n=fc(null,function(o){return e.forEach(function(r){return wt(r,o)})});return pc(function(){var o=on.get(n);if(o){var r=new Set(o),i=new Set(e),a=n.current;r.forEach(function(s){i.has(s)||wt(s,null)}),i.forEach(function(s){r.has(s)||wt(s,a)})}on.set(n,e)},[e]),n}function hc(e){return e}function vc(e,t){t===void 0&&(t=hc);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,o);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(o=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){o=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var p=a;a=[],p.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(p){a.push(p),u()},filter:function(p){return a=a.filter(p),n}}}};return r}function gc(e){e===void 0&&(e={});var t=vc(null);return t.options=he({async:!0,ssr:!1},e),t}var kn=function(e){var t=e.sideCar,n=pn(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return c.createElement(o,he({},n))};kn.isSideCarExport=!0;function wc(e,t){return e.useMedium(t),kn}var Ln=gc(),xt=function(){},st=c.forwardRef(function(e,t){var n=c.useRef(null),o=c.useState({onScrollCapture:xt,onWheelCapture:xt,onTouchMoveCapture:xt}),r=o[0],i=o[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,p=e.enabled,d=e.shards,w=e.sideCar,m=e.noIsolation,h=e.inert,f=e.allowPinchZoom,v=e.as,g=v===void 0?"div":v,x=pn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),$=w,b=mc([n,t]),y=he(he({},x),r);return c.createElement(c.Fragment,null,p&&c.createElement($,{sideCar:Ln,removeScrollBar:u,shards:d,noIsolation:m,inert:h,setCallbacks:i,allowPinchZoom:!!f,lockRef:n}),a?c.cloneElement(c.Children.only(s),he(he({},y),{ref:b})):c.createElement(g,he({},y,{className:l,ref:b}),s))});st.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};st.classNames={fullWidth:Qe,zeroRight:Ge};var xc=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $c(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xc();return t&&e.setAttribute("nonce",t),e}function bc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function yc(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ec=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$c())&&(bc(t,n),yc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Sc=function(){var e=Ec();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fn=function(){var e=Sc(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Cc={left:0,top:0,right:0,gap:0},$t=function(e){return parseInt(e||"",10)||0},Pc=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[$t(n),$t(o),$t(r)]},Rc=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cc;var t=Pc(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Tc=Fn(),Oe="data-scroll-locked",Oc=function(e,t,n,o){var r=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
2
- .`.concat(uc,` {
3
- overflow: hidden `).concat(o,`;
4
- padding-right: `).concat(s,"px ").concat(o,`;
5
- }
6
- body[`).concat(Oe,`] {
7
- overflow: hidden `).concat(o,`;
8
- overscroll-behavior: contain;
9
- `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
10
- padding-left: `.concat(r,`px;
11
- padding-top: `).concat(i,`px;
12
- padding-right: `).concat(a,`px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: `).concat(s,"px ").concat(o,`;
16
- `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),`
17
- }
18
-
19
- .`).concat(Ge,` {
20
- right: `).concat(s,"px ").concat(o,`;
21
- }
22
-
23
- .`).concat(Qe,` {
24
- margin-right: `).concat(s,"px ").concat(o,`;
25
- }
26
-
27
- .`).concat(Ge," .").concat(Ge,` {
28
- right: 0 `).concat(o,`;
29
- }
30
-
31
- .`).concat(Qe," .").concat(Qe,` {
32
- margin-right: 0 `).concat(o,`;
33
- }
34
-
35
- body[`).concat(Oe,`] {
36
- `).concat(dc,": ").concat(s,`px;
37
- }
38
- `)},rn=function(){var e=parseInt(document.body.getAttribute(Oe)||"0",10);return isFinite(e)?e:0},Ac=function(){c.useEffect(function(){return document.body.setAttribute(Oe,(rn()+1).toString()),function(){var e=rn()-1;e<=0?document.body.removeAttribute(Oe):document.body.setAttribute(Oe,e.toString())}},[])},Dc=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Ac();var i=c.useMemo(function(){return Rc(r)},[r]);return c.createElement(Tc,{styles:Oc(i,!t,r,n?"":"!important")})},Rt=!1;if(typeof window<"u")try{var Ye=Object.defineProperty({},"passive",{get:function(){return Rt=!0,!0}});window.addEventListener("test",Ye,Ye),window.removeEventListener("test",Ye,Ye)}catch{Rt=!1}var Pe=Rt?{passive:!1}:!1,_c=function(e){return e.tagName==="TEXTAREA"},Bn=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_c(e)&&n[t]==="visible")},Ic=function(e){return Bn(e,"overflowY")},Nc=function(e){return Bn(e,"overflowX")},cn=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Wn(e,n);if(o){var r=Hn(e,n),i=r[1],a=r[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Mc=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},kc=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Wn=function(e,t){return e==="v"?Ic(t):Nc(t)},Hn=function(e,t){return e==="v"?Mc(t):kc(t)},Lc=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fc=function(e,t,n,o,r){var i=Lc(e,window.getComputedStyle(t).direction),a=i*o,s=n.target,l=t.contains(s),u=!1,p=a>0,d=0,w=0;do{var m=Hn(e,s),h=m[0],f=m[1],v=m[2],g=f-v-i*h;(h||g)&&Wn(e,s)&&(d+=g,w+=h),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(p&&d===0||!p&&w===0)&&(u=!0),u},Xe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sn=function(e){return[e.deltaX,e.deltaY]},an=function(e){return e&&"current"in e?e.current:e},Bc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wc=function(e){return`
39
- .block-interactivity-`.concat(e,` {pointer-events: none;}
40
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},Hc=0,Re=[];function Vc(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(Hc++)[0],i=c.useState(function(){return Fn()})[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var f=no([e.lockRef.current],(e.shards||[]).map(an),!0).filter(Boolean);return f.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),f.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(f,v){if("touches"in f&&f.touches.length===2)return!a.current.allowPinchZoom;var g=Xe(f),x=n.current,$="deltaX"in f?f.deltaX:x[0]-g[0],b="deltaY"in f?f.deltaY:x[1]-g[1],y,P=f.target,S=Math.abs($)>Math.abs(b)?"h":"v";if("touches"in f&&S==="h"&&P.type==="range")return!1;var E=cn(S,P);if(!E)return!0;if(E?y=S:(y=S==="v"?"h":"v",E=cn(S,P)),!E)return!1;if(!o.current&&"changedTouches"in f&&($||b)&&(o.current=y),!y)return!0;var O=o.current||y;return Fc(O,v,f,O==="h"?$:b)},[]),l=c.useCallback(function(f){var v=f;if(!(!Re.length||Re[Re.length-1]!==i)){var g="deltaY"in v?sn(v):Xe(v),x=t.current.filter(function(y){return y.name===v.type&&y.target===v.target&&Bc(y.delta,g)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var $=(a.current.shards||[]).map(an).filter(Boolean).filter(function(y){return y.contains(v.target)}),b=$.length>0?s(v,$[0]):!a.current.noIsolation;b&&v.cancelable&&v.preventDefault()}}},[]),u=c.useCallback(function(f,v,g,x){var $={name:f,delta:v,target:g,should:x};t.current.push($),setTimeout(function(){t.current=t.current.filter(function(b){return b!==$})},1)},[]),p=c.useCallback(function(f){n.current=Xe(f),o.current=void 0},[]),d=c.useCallback(function(f){u(f.type,sn(f),f.target,s(f,e.lockRef.current))},[]),w=c.useCallback(function(f){u(f.type,Xe(f),f.target,s(f,e.lockRef.current))},[]);c.useEffect(function(){return Re.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:w}),document.addEventListener("wheel",l,Pe),document.addEventListener("touchmove",l,Pe),document.addEventListener("touchstart",p,Pe),function(){Re=Re.filter(function(f){return f!==i}),document.removeEventListener("wheel",l,Pe),document.removeEventListener("touchmove",l,Pe),document.removeEventListener("touchstart",p,Pe)}},[]);var m=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(i,{styles:Wc(r)}):null,m?c.createElement(Dc,{gapMode:"margin"}):null)}const jc=wc(Ln,Vc);var Vn=c.forwardRef(function(e,t){return c.createElement(st,he({},e,{ref:t,sideCar:jc}))});Vn.classNames=st.classNames;const Uc=[" ","Enter","ArrowUp","ArrowDown"],zc=[" ","Enter"],at="Select",[lt,ut,Kc]=wo(at),[Ne,Ii]=Ot(at,[Kc,An]),Lt=An(),[Yc,be]=Ne(at),[Xc,Zc]=Ne(at),qc=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:u,name:p,autoComplete:d,disabled:w,required:m}=e,h=Lt(t),[f,v]=c.useState(null),[g,x]=c.useState(null),[$,b]=c.useState(!1),y=$o(u),[P=!1,S]=nn({prop:o,defaultProp:r,onChange:i}),[E,O]=nn({prop:a,defaultProp:s,onChange:l}),F=c.useRef(null),I=f?!!f.closest("form"):!0,[B,A]=c.useState(new Set),D=Array.from(B).map(N=>N.props.value).join(";");return c.createElement(Kr,h,c.createElement(Yc,{required:m,scope:t,trigger:f,onTriggerChange:v,valueNode:g,onValueNodeChange:x,valueNodeHasChildren:$,onValueNodeHasChildrenChange:b,contentId:gn(),value:E,onValueChange:O,open:P,onOpenChange:S,dir:y,triggerPointerDownPosRef:F,disabled:w},c.createElement(lt.Provider,{scope:t},c.createElement(Xc,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(N=>{A(_=>new Set(_).add(N))},[]),onNativeOptionRemove:c.useCallback(N=>{A(_=>{const W=new Set(_);return W.delete(N),W})},[])},n)),I?c.createElement(Kn,{key:D,"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:d,value:E,onChange:N=>O(N.target.value),disabled:w},E===void 0?c.createElement("option",{value:""}):null,Array.from(B)):null))},Gc="SelectTrigger",Qc=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=Lt(n),a=be(Gc,n),s=a.disabled||o,l=K(t,a.onTriggerChange),u=ut(n),[p,d,w]=Yn(h=>{const f=u().filter(x=>!x.disabled),v=f.find(x=>x.value===a.value),g=Xn(f,h,v);g!==void 0&&a.onValueChange(g.value)}),m=()=>{s||(a.onOpenChange(!0),w())};return c.createElement(Yr,T({asChild:!0},i),c.createElement(Z.button,T({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":a.value===void 0?"":void 0},r,{ref:l,onClick:U(r.onClick,h=>{h.currentTarget.focus()}),onPointerDown:U(r.onPointerDown,h=>{const f=h.target;f.hasPointerCapture(h.pointerId)&&f.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(m(),a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault())}),onKeyDown:U(r.onKeyDown,h=>{const f=p.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&d(h.key),!(f&&h.key===" ")&&Uc.includes(h.key)&&(m(),h.preventDefault())})})))}),Jc="SelectValue",ei=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:a,...s}=e,l=be(Jc,n),{onValueNodeHasChildrenChange:u}=l,p=i!==void 0,d=K(t,l.onValueNodeChange);return te(()=>{u(p)},[u,p]),c.createElement(Z.span,T({},s,{ref:d,style:{pointerEvents:"none"}}),l.value===void 0&&a!==void 0?a:i)}),ti=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return c.createElement(Z.span,T({"aria-hidden":!0},r,{ref:t}),o||"▼")}),ni=e=>c.createElement(Zr,T({asChild:!0},e)),De="SelectContent",oi=c.forwardRef((e,t)=>{const n=be(De,e.__scopeSelect),[o,r]=c.useState();if(te(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?ot.createPortal(c.createElement(jn,{scope:e.__scopeSelect},c.createElement(lt.Slot,{scope:e.__scopeSelect},c.createElement("div",null,e.children))),i):null}return c.createElement(ri,T({},e,{ref:t}))}),le=10,[jn,ye]=Ne(De),ri=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:p,arrowPadding:d,collisionBoundary:w,collisionPadding:m,sticky:h,hideWhenDetached:f,avoidCollisions:v,...g}=e,x=be(De,n),[$,b]=c.useState(null),[y,P]=c.useState(null),S=K(t,C=>b(C)),[E,O]=c.useState(null),[F,I]=c.useState(null),B=ut(n),[A,D]=c.useState(!1),N=c.useRef(!1);c.useEffect(()=>{if($)return lc($)},[$]),Ao();const _=c.useCallback(C=>{const[M,...Y]=B().map(L=>L.ref.current),[H]=Y.slice(-1),k=document.activeElement;for(const L of C)if(L===k||(L==null||L.scrollIntoView({block:"nearest"}),L===M&&y&&(y.scrollTop=0),L===H&&y&&(y.scrollTop=y.scrollHeight),L==null||L.focus(),document.activeElement!==k))return},[B,y]),W=c.useCallback(()=>_([E,$]),[_,E,$]);c.useEffect(()=>{A&&W()},[A,W]);const{onOpenChange:R,triggerPointerDownPosRef:V}=x;c.useEffect(()=>{if($){let C={x:0,y:0};const M=H=>{var k,L,q,X;C={x:Math.abs(Math.round(H.pageX)-((k=(L=V.current)===null||L===void 0?void 0:L.x)!==null&&k!==void 0?k:0)),y:Math.abs(Math.round(H.pageY)-((q=(X=V.current)===null||X===void 0?void 0:X.y)!==null&&q!==void 0?q:0))}},Y=H=>{C.x<=10&&C.y<=10?H.preventDefault():$.contains(H.target)||R(!1),document.removeEventListener("pointermove",M),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",M),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",Y,{capture:!0})}}},[$,R,V]),c.useEffect(()=>{const C=()=>R(!1);return window.addEventListener("blur",C),window.addEventListener("resize",C),()=>{window.removeEventListener("blur",C),window.removeEventListener("resize",C)}},[R]);const[z,Ee]=Yn(C=>{const M=B().filter(k=>!k.disabled),Y=M.find(k=>k.ref.current===document.activeElement),H=Xn(M,C,Y);H&&setTimeout(()=>H.ref.current.focus())}),Se=c.useCallback((C,M,Y)=>{const H=!N.current&&!Y;(x.value!==void 0&&x.value===M||H)&&(O(C),H&&(N.current=!0))},[x.value]),Me=c.useCallback(()=>$==null?void 0:$.focus(),[$]),ne=c.useCallback((C,M,Y)=>{const H=!N.current&&!Y;(x.value!==void 0&&x.value===M||H)&&I(C)},[x.value]),oe=o==="popper"?ln:ci,pe=oe===ln?{side:s,sideOffset:l,align:u,alignOffset:p,arrowPadding:d,collisionBoundary:w,collisionPadding:m,sticky:h,hideWhenDetached:f,avoidCollisions:v}:{};return c.createElement(jn,{scope:n,content:$,viewport:y,onViewportChange:P,itemRefCallback:Se,selectedItem:E,onItemLeave:Me,itemTextRefCallback:ne,focusSelectedItem:W,selectedItemText:F,position:o,isPositioned:A,searchRef:z},c.createElement(Vn,{as:Be,allowPinchZoom:!0},c.createElement(Do,{asChild:!0,trapped:x.open,onMountAutoFocus:C=>{C.preventDefault()},onUnmountAutoFocus:U(r,C=>{var M;(M=x.trigger)===null||M===void 0||M.focus({preventScroll:!0}),C.preventDefault()})},c.createElement(Ro,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:C=>C.preventDefault(),onDismiss:()=>x.onOpenChange(!1)},c.createElement(oe,T({role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:C=>C.preventDefault()},g,pe,{onPlaced:()=>D(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:U(g.onKeyDown,C=>{const M=C.ctrlKey||C.altKey||C.metaKey;if(C.key==="Tab"&&C.preventDefault(),!M&&C.key.length===1&&Ee(C.key),["ArrowUp","ArrowDown","Home","End"].includes(C.key)){let H=B().filter(k=>!k.disabled).map(k=>k.ref.current);if(["ArrowUp","End"].includes(C.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(C.key)){const k=C.target,L=H.indexOf(k);H=H.slice(L+1)}setTimeout(()=>_(H)),C.preventDefault()}})}))))))}),ci=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=be(De,n),a=ye(De,n),[s,l]=c.useState(null),[u,p]=c.useState(null),d=K(t,S=>p(S)),w=ut(n),m=c.useRef(!1),h=c.useRef(!0),{viewport:f,selectedItem:v,selectedItemText:g,focusSelectedItem:x}=a,$=c.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&f&&v&&g){const S=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),F=g.getBoundingClientRect();if(i.dir!=="rtl"){const k=F.left-E.left,L=O.left-k,q=S.left-L,X=S.width+q,ke=Math.max(X,E.width),Le=window.innerWidth-le,Fe=Wt(L,[le,Le-ke]);s.style.minWidth=X+"px",s.style.left=Fe+"px"}else{const k=E.right-F.right,L=window.innerWidth-O.right-k,q=window.innerWidth-S.right-L,X=S.width+q,ke=Math.max(X,E.width),Le=window.innerWidth-le,Fe=Wt(L,[le,Le-ke]);s.style.minWidth=X+"px",s.style.right=Fe+"px"}const I=w(),B=window.innerHeight-le*2,A=f.scrollHeight,D=window.getComputedStyle(u),N=parseInt(D.borderTopWidth,10),_=parseInt(D.paddingTop,10),W=parseInt(D.borderBottomWidth,10),R=parseInt(D.paddingBottom,10),V=N+_+A+R+W,z=Math.min(v.offsetHeight*5,V),Ee=window.getComputedStyle(f),Se=parseInt(Ee.paddingTop,10),Me=parseInt(Ee.paddingBottom,10),ne=S.top+S.height/2-le,oe=B-ne,pe=v.offsetHeight/2,C=v.offsetTop+pe,M=N+_+C,Y=V-M;if(M<=ne){const k=v===I[I.length-1].ref.current;s.style.bottom="0px";const L=u.clientHeight-f.offsetTop-f.offsetHeight,q=Math.max(oe,pe+(k?Me:0)+L+W),X=M+q;s.style.height=X+"px"}else{const k=v===I[0].ref.current;s.style.top="0px";const q=Math.max(ne,N+f.offsetTop+(k?Se:0)+pe)+Y;s.style.height=q+"px",f.scrollTop=M-ne+f.offsetTop}s.style.margin=`${le}px 0`,s.style.minHeight=z+"px",s.style.maxHeight=B+"px",o==null||o(),requestAnimationFrame(()=>m.current=!0)}},[w,i.trigger,i.valueNode,s,u,f,v,g,i.dir,o]);te(()=>$(),[$]);const[b,y]=c.useState();te(()=>{u&&y(window.getComputedStyle(u).zIndex)},[u]);const P=c.useCallback(S=>{S&&h.current===!0&&($(),x==null||x(),h.current=!1)},[$,x]);return c.createElement(ii,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:P},c.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b}},c.createElement(Z.div,T({},r,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}}))))}),ln=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=le,...i}=e,a=Lt(n);return c.createElement(Xr,T({},a,i,{ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[ii,Ft]=Ne(De,{}),un="SelectViewport",si=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ye(un,n),i=Ft(un,n),a=K(t,r.onViewportChange),s=c.useRef(0);return c.createElement(c.Fragment,null,c.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),c.createElement(lt.Slot,{scope:n},c.createElement(Z.div,T({"data-radix-select-viewport":"",role:"presentation"},o,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...o.style},onScroll:U(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:d}=i;if(d!=null&&d.current&&p){const w=Math.abs(s.current-u.scrollTop);if(w>0){const m=window.innerHeight-le*2,h=parseFloat(p.style.minHeight),f=parseFloat(p.style.height),v=Math.max(h,f);if(v<m){const g=v+w,x=Math.min(m,g),$=g-x;p.style.height=x+"px",p.style.bottom==="0px"&&(u.scrollTop=$>0?$:0,p.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),ai="SelectGroup",[Ni,Mi]=Ne(ai),Tt="SelectItem",[li,Un]=Ne(Tt),ui=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...a}=e,s=be(Tt,n),l=ye(Tt,n),u=s.value===o,[p,d]=c.useState(i??""),[w,m]=c.useState(!1),h=K(t,g=>{var x;return(x=l.itemRefCallback)===null||x===void 0?void 0:x.call(l,g,o,r)}),f=gn(),v=()=>{r||(s.onValueChange(o),s.onOpenChange(!1))};return c.createElement(li,{scope:n,value:o,disabled:r,textId:f,isSelected:u,onItemTextChange:c.useCallback(g=>{d(x=>{var $;return x||(($=g==null?void 0:g.textContent)!==null&&$!==void 0?$:"").trim()})},[])},c.createElement(lt.ItemSlot,{scope:n,value:o,disabled:r,textValue:p},c.createElement(Z.div,T({role:"option","aria-labelledby":f,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1},a,{ref:h,onFocus:U(a.onFocus,()=>m(!0)),onBlur:U(a.onBlur,()=>m(!1)),onPointerUp:U(a.onPointerUp,v),onPointerMove:U(a.onPointerMove,g=>{if(r){var x;(x=l.onItemLeave)===null||x===void 0||x.call(l)}else g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(a.onPointerLeave,g=>{if(g.currentTarget===document.activeElement){var x;(x=l.onItemLeave)===null||x===void 0||x.call(l)}}),onKeyDown:U(a.onKeyDown,g=>{var x;((x=l.searchRef)===null||x===void 0?void 0:x.current)!==""&&g.key===" "||(zc.includes(g.key)&&v(),g.key===" "&&g.preventDefault())})}))))}),Ze="SelectItemText",di=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,a=be(Ze,n),s=ye(Ze,n),l=Un(Ze,n),u=Zc(Ze,n),[p,d]=c.useState(null),w=K(t,g=>d(g),l.onItemTextChange,g=>{var x;return(x=s.itemTextRefCallback)===null||x===void 0?void 0:x.call(s,g,l.value,l.disabled)}),m=p==null?void 0:p.textContent,h=c.useMemo(()=>c.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},m),[l.disabled,l.value,m]),{onNativeOptionAdd:f,onNativeOptionRemove:v}=u;return te(()=>(f(h),()=>v(h)),[f,v,h]),c.createElement(c.Fragment,null,c.createElement(Z.span,T({id:l.textId},i,{ref:w})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ot.createPortal(i.children,a.valueNode):null)}),fi="SelectItemIndicator",pi=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Un(fi,n).isSelected?c.createElement(Z.span,T({"aria-hidden":!0},o,{ref:t})):null}),dn="SelectScrollUpButton",mi=c.forwardRef((e,t)=>{const n=ye(dn,e.__scopeSelect),o=Ft(dn,e.__scopeSelect),[r,i]=c.useState(!1),a=K(t,o.onScrollButtonChange);return te(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=s.scrollTop>0;i(u)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?c.createElement(zn,T({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),fn="SelectScrollDownButton",hi=c.forwardRef((e,t)=>{const n=ye(fn,e.__scopeSelect),o=Ft(fn,e.__scopeSelect),[r,i]=c.useState(!1),a=K(t,o.onScrollButtonChange);return te(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=s.scrollHeight-s.clientHeight,p=Math.ceil(s.scrollTop)<u;i(p)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?c.createElement(zn,T({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),zn=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=ye("SelectScrollButton",n),a=c.useRef(null),s=ut(n),l=c.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),te(()=>{var u;const p=s().find(d=>d.ref.current===document.activeElement);p==null||(u=p.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[s]),c.createElement(Z.div,T({"aria-hidden":!0},r,{ref:t,style:{flexShrink:0,...r.style},onPointerDown:U(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:U(r.onPointerMove,()=>{var u;(u=i.onItemLeave)===null||u===void 0||u.call(i),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:U(r.onPointerLeave,()=>{l()})}))}),Kn=c.forwardRef((e,t)=>{const{value:n,...o}=e,r=c.useRef(null),i=K(t,r),a=Gr(n);return c.useEffect(()=>{const s=r.current,l=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&p){const d=new Event("change",{bubbles:!0});p.call(s,n),s.dispatchEvent(d)}},[a,n]),c.createElement(cc,{asChild:!0},c.createElement("select",T({},o,{ref:i,defaultValue:n})))});Kn.displayName="BubbleSelect";function Yn(e){const t=ue(e),n=c.useRef(""),o=c.useRef(0),r=c.useCallback(a=>{const s=n.current+a;t(s),function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),i=c.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function Xn(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=vi(e,Math.max(i,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function vi(e,t){return e.map((n,o)=>e[(t+o)%e.length])}const gi=qc,wi=Qc,xi=ei,$i=ti,bi=ni,yi=oi,Ei=si,Si=ui,Ci=di,Pi=pi,Ri=mi,Ti=hi,Oi=J.forwardRef(function({list:t=[],required:n=!1,disabled:o=!1,autoFocus:r=!1,size:i=ee.md,name:a,value:s="default",className:l,onChange:u},p){const d=t.find(w=>w.value===s)??t[0]??{value:s};return o=o||t.length<2,j.jsxs(gi,{name:a,value:d.value,disabled:o,required:n,onValueChange:u,children:[j.jsxs(wi,{ref:p,className:ve(l,o&&"opacity-50 cursor-not-allowed"),autoFocus:r,children:[j.jsx(xi,{}),j.jsx($i,{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-1",children:j.jsx(ao,{className:"w-4","aria-hidden":"true"})})]}),j.jsx(bi,{className:"z-50",children:j.jsxs(yi,{className:ve("overflow-auto rounded-md bg-theme p-1 shadow-2xl border-2 border-neutral-200 dark:border-neutral-700 ring-opacity-5 focus:outline-none",i===ee.sm&&"text-xs",i===ee.md&&"text-sm",i===ee.lg&&"text-sm"),children:[j.jsx(Ri,{className:"flex items-center justify-center h-3 cursor-default",children:j.jsx(uo,{className:"w-4","aria-hidden":"true"})}),j.jsx(Ei,{className:"p-1",children:t.map(({text:w,value:m})=>j.jsx(Ai,{value:m,children:w},m))}),j.jsx(Ti,{className:"flex items-center justify-center h-3 cursor-default",children:j.jsx(io,{className:"w-4","aria-hidden":"true"})})]})})]})});function Ai({disabled:e=!1,value:t,children:n,className:o}){return j.jsxs(Si,{value:t,className:ve("leading-none rounded-md flex items-center h-[25px] pr-[35px] pl-[25px] relative select-none data-[disabled]:pointer-events-none data-[highlighted]:outline-none data-[highlighted]:bg-brand-500 data-[highlighted]:text-brand-100",e&&"opacity-50 cursor-not-allowed",o),children:[j.jsx(Ci,{children:n}),j.jsx(Pi,{className:"absolute left-0 w-4 inline-flex items-center justify-center",children:j.jsx(ro,{})})]})}function dt({label:e,info:t,size:n=ee.md,className:o,children:r,disabled:i=!1,required:a=!1,autoFocus:s=!1}){const l=ve("text-left relative block bg-theme-lighter border-neutral-200 dark:border-neutral-700","focus:outline-none focus:border-secondary-500","ring-secondary-300 ring-opacity-60 ring-offset ring-offset-secondary-100",n===ee.sm&&"px-2 py-0.5 text-xs leading-4 border-2 focus:ring-2 rounded-[0.25rem] min-w-[7rem]",n===ee.md&&"px-3 py-2 text-sm leading-4 border-2 focus:ring-4 rounded-md min-w-[10rem]",n===ee.lg&&"px-3 py-2 text-sm leading-6 border-2 focus:ring-4 rounded-md min-w-[10rem]");return j.jsxs("div",{className:ve("inline-block relative m-1 text-left",i&&"opacity-50 cursor-not-allowed",o),children:[Bt(e)&&j.jsx(Zn,{size:n,children:e}),typeof r=="function"?r({disabled:i,required:a,autoFocus:s,size:n,className:l}):r,Bt(t)&&j.jsx(qn,{children:t})]})}function Zn({htmlFor:e,className:t,children:n,size:o=ee.md}){return j.jsx("label",{htmlFor:e,className:ve("block mb-1 px-2 text-sm whitespace-nowrap",o===ee.sm&&"text-xs",o===ee.md&&"text-sm",o===ee.lg&&"text-md",t),children:n})}function qn({className:e,children:t}){return j.jsx("small",{className:ve("block text-xs mt-1 px-3 text-neutral-400 dark:text-neutral-600",e),children:t})}dt.Label=Zn;dt.Info=qn;dt.Textfield=fo;dt.Selector=Oi;export{ao as F,dt as I,Dc as R,T as _,Nr as a,kr as b,$r as c,gc as d,mc as e,Ir as f,Qe as g,Mr as h,Fn as i,wc as j,lc as k,_r as l,uo as m,io as n,Ar as o,ro as p,Dr as s,Tr as u,Ge as z};
@@ -1 +0,0 @@
1
- import{t as u,U as c,a as m,w as a,j as s,e as f}from"./index-BafGN4in.js";import{L as g}from"./context-YFUfJm57.js";import x from"./ModelLineage-E21kqsuu.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./Input-CLgDkIXg.js";import"./editor-BKhlmwRX.js";import"./file-DahECWZX.js";import"./project-Bag2J0QC.js";import"./help-6Q7f7fjd.js";import"./SourceList-DsSkJAMU.js";import"./index-CAWWTpIH.js";import"./transition-BlPPv2uy.js";import"./ListboxShow-DT2Vq8H-.js";import"./SearchList-k4ylxX-x.js";function I(){const l=u(),{modelName:t}=c(),i=m(e=>e.models),o=m(e=>e.lastSelectedModel),r=a(t)||t===(o==null?void 0:o.name)?o:i.get(encodeURI(t));function d(e){const n=i.get(e);a(n)||l(f.LineageModels+"/"+n.name)}function p(e){console.log(e==null?void 0:e.message)}return s.jsx("div",{className:"flex overflow-hidden w-full h-full",children:s.jsx(g,{showColumns:!0,handleClickModel:d,handleError:p,children:s.jsx(x,{model:r})})})}export{I as default};
@@ -1 +0,0 @@
1
- import{r as o,R as a,j as e,c as R,B as Q,m as O,n as ee,aC as ie,h as ce,w as B,b as _,i as $,W as de,Z as me,aD as ue,v as he,L as te,S as se,F as q,I as pe}from"./index-BafGN4in.js";import{d as fe,e as ne,s as ae,f as G,P as oe,h as P,b as F,i as ge,E as V,R as we,j as xe,k as ve,l as be,m as X,n as Y,o as J,p as Ne,q as ye,r as je,t as Ee}from"./context-YFUfJm57.js";import{W as Ce}from"./editor-BKhlmwRX.js";import{F as Me,L as Se}from"./ListboxShow-DT2Vq8H-.js";import{S as ke}from"./SearchList-k4ylxX-x.js";import{n as ze}from"./Input-CLgDkIXg.js";import{B as T}from"./transition-BlPPv2uy.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./file-DahECWZX.js";import"./project-Bag2J0QC.js";import"./help-6Q7f7fjd.js";import"./SourceList-DsSkJAMU.js";import"./index-CAWWTpIH.js";function Le({title:t,titleId:s,...n},c){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:c,"aria-labelledby":s},n),t?o.createElement("title",{id:s},t):null,o.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"}))}const Ae=o.forwardRef(Le);function Be(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},a.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function Ie(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},a.createElement("path",{d:"M0 0h32v4.2H0z"}))}function He(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},a.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function Re(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},a.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function De(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},a.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const D=({children:t,className:s,...n})=>a.createElement("button",{type:"button",className:P(["react-flow__controls-button",s]),...n},t);D.displayName="ControlButton";const _e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),le=({style:t,showZoom:s=!0,showFitView:n=!0,showInteractive:c=!0,fitViewOptions:u,onZoomIn:l,onZoomOut:r,onFitView:h,onInteractiveChange:p,className:f,children:i,position:N="bottom-left"})=>{const g=fe(),[M,E]=o.useState(!1),{isInteractive:w,minZoomReached:x,maxZoomReached:d}=ne(_e,ae),{zoomIn:v,zoomOut:j,fitView:m}=G();if(o.useEffect(()=>{E(!0)},[]),!M)return null;const z=()=>{v(),l==null||l()},C=()=>{j(),r==null||r()},k=()=>{m(u),h==null||h()},b=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),p==null||p(!w)};return a.createElement(oe,{className:P(["react-flow__controls",f]),position:N,style:t,"data-testid":"rf__controls"},s&&a.createElement(a.Fragment,null,a.createElement(D,{onClick:z,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:d},a.createElement(Be,null)),a.createElement(D,{onClick:C,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:x},a.createElement(Ie,null))),n&&a.createElement(D,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view"},a.createElement(He,null)),c&&a.createElement(D,{className:"react-flow__controls-interactive",onClick:b,title:"toggle interactivity","aria-label":"toggle interactivity"},w?a.createElement(De,null):a.createElement(Re,null)),i)};le.displayName="Controls";var Fe=o.memo(le),S;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(S||(S={}));function $e({color:t,dimensions:s,lineWidth:n}){return a.createElement("path",{stroke:t,strokeWidth:n,d:`M${s[0]/2} 0 V${s[1]} M0 ${s[1]/2} H${s[0]}`})}function We({color:t,radius:s}){return a.createElement("circle",{cx:s,cy:s,r:s,fill:t})}const Ue={[S.Dots]:"#91919a",[S.Lines]:"#eee",[S.Cross]:"#e2e2e2"},Ve={[S.Dots]:1,[S.Lines]:1,[S.Cross]:6},Te=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function re({id:t,variant:s=S.Dots,gap:n=20,size:c,lineWidth:u=1,offset:l=2,color:r,style:h,className:p}){const f=o.useRef(null),{transform:i,patternId:N}=ne(Te,ae),g=r||Ue[s],M=c||Ve[s],E=s===S.Dots,w=s===S.Cross,x=Array.isArray(n)?n:[n,n],d=[x[0]*i[2]||1,x[1]*i[2]||1],v=M*i[2],j=w?[v,v]:d,m=E?[v/l,v/l]:[j[0]/l,j[1]/l];return a.createElement("svg",{className:P(["react-flow__background",p]),style:{...h,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:f,"data-testid":"rf__background"},a.createElement("pattern",{id:N+t,x:i[0]%d[0],y:i[1]%d[1],width:d[0],height:d[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${m[0]},-${m[1]})`},E?a.createElement(We,{color:g,radius:v/l}):a.createElement($e,{dimensions:j,color:g,lineWidth:u})),a.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N+t})`}))}re.displayName="Background";var Oe=o.memo(re);function Ge({handleSelect:t}){const{models:s,lineage:n,mainNode:c,connectedNodes:u}=F(),[l,r]=o.useState(!1),[h,p]=o.useState([]),[f,i]=o.useState(!1);o.useEffect(()=>{p([])},[c,s,n]);function N(){r(!0)}function g(){r(!1)}function M(E){E.length<1||ce(h)||B(c)||B(n)||(i(!0),setTimeout(()=>{const w=Array.from(ge(n,c));p(Object.keys(n).map(x=>{var d;return{name:x,displayName:((d=s.get(x))==null?void 0:d.displayName)??decodeURI(x),description:`${w.includes(x)?"Upstream":"Downstream"} | ${u.has(x)?"Directly":"Indirectly"} Connected`}})),i(!1)},300))}return e.jsxs("div",{className:R("w-full",l?"block absolute top-0 left-0 right-0 z-10 pr-10 bg-light dark:bg-dark @[40rem]:items-end @[40rem]:justify-end @[40rem]:flex @[40rem]:static @[40rem]:pr-0":"items-end justify-end flex"),children:[e.jsx(Q,{shape:ie.Circle,className:R("flex @[40rem]:hidden !py-1 border-transparent",l?"hidden":"flex"),variant:ee.Alternative,size:O.sm,"aria-label":"Show search",onClick:N,children:e.jsx(Ae,{className:"w-3 h-3 text-primary-500"})}),e.jsx(ke,{list:h,placeholder:"Find",searchBy:"displayName",displayBy:"displayName",direction:"top",descriptionBy:"description",showIndex:!1,size:O.sm,onSelect:t,isLoading:f,className:R("w-full @sm:min-w-[12rem] @[40rem]:flex",l?"flex max-w-none":"hidden max-w-[20rem]"),isFullWidth:!0,onInput:M}),e.jsx("button",{className:R("flex @[40rem]:hidden bg-none border-none px-2 py-1 absolute right-0 top-0",l?"flex":"hidden"),"aria-label":"Hide search",onClick:g,children:e.jsx(Me,{className:"w-6 h-6 text-primary-500"})})]})}function K({nodes:t=[]}){const{setCenter:s}=G(),{activeNodes:n,models:c,mainNode:u,nodesMap:l,selectedNodes:r,setSelectedNodes:h,withImpacted:p,connectedNodes:f,lineageCache:i,setActiveEdges:N,setConnections:g,setLineage:M,setLineageCache:E}=F(),w=B(u)?void 0:c.get(u),x=n.size>0?n.size:f.size,d=r.size,v=f.size-1,j=t.filter(b=>b.hidden).length,m=t.filter(b=>_(b.hidden)&&(b.data.type===V.external||b.data.type===V.seed)).length,z=t.filter(b=>_(b.hidden)&&b.data.type===V.cte).length,C=x>0&&x!==v+1;function k(){if(B(u))return;const b=l[u];B(b)||setTimeout(()=>{s(b.position.x,b.position.y,{zoom:.5,duration:0})},200)}return e.jsxs(e.Fragment,{children:[$(w)&&e.jsx("a",{className:"mr-2 w-full whitespace-nowrap text-ellipsis overflow-hidden @lg:block font-bold text-neutral-600 dark:text-neutral-400 cursor-pointer hover:underline",onClick:k,children:de(w.displayName,50,25)}),e.jsxs("span",{className:"bg-neutral-5 px-2 py-0.5 flex rounded-full mr-2",children:[e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"All:"})," ",t.length]}),j>0&&e.jsxs("span",{className:"whitespace-nowrap block mr-2",children:[e.jsx("b",{children:"Hidden:"})," ",j]}),d>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Selected:"})," ",d]}),C&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Active:"})," ",x]}),(C||d>0||$(i))&&e.jsx(Q,{size:O.xs,variant:ee.Neutral,format:me.Ghost,className:"!m-0 px-1",onClick:()=>{N(new Map),g(new Map),h(new Set),$(i)&&(M(i),E(void 0))},children:"Reset"})]}),m>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Sources"}),": ",m]}),_(C)&&p&&d===0&&v>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Upstream/Downstream:"})," ",v]}),z>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"CTEs:"})," ",z]})]})}const Pe=30;function it({model:t,highlightedNodes:s}){const{setActiveNodes:n,setActiveEdges:c,setConnections:u,setLineage:l,handleError:r,setSelectedNodes:h,setMainNode:p,setWithColumns:f,setHighlightedNodes:i,setNodeConnections:N,setLineageCache:g,setUnknownModels:M,models:E,unknownModels:w}=F(),{refetch:x,isFetching:d,cancel:v}=ue(t.name),{isFetching:j}=he(),[m,z]=o.useState(!1),[C,k]=o.useState(void 0);o.useEffect(()=>{const y=Ce();return y.addEventListener("message",b),x().then(({data:L})=>{k(L),!B(L)&&(z(!0),y.postMessage({topic:"lineage",payload:{currentLineage:{},newLineage:L,mainNode:t.fqn}}))}).catch(L=>{r==null||r(L)}).finally(()=>{n(new Set),c(new Map),u(new Map),h(new Set),g(void 0),p(t.fqn)}),()=>{v==null||v(),y.removeEventListener("message",b),y.terminate(),l({}),N({}),p(void 0),i({})}},[t.name,t.hash]),o.useEffect(()=>{Object.keys(C??{}).forEach(y=>{y=encodeURI(y),_(E.has(y))&&_(w.has(y))&&w.add(y)}),M(new Set(w))},[C,E]),o.useEffect(()=>{i(s??{})},[s]);function b(y){var L;y.data.topic==="lineage"&&(z(!1),N(y.data.payload.nodesConnections),l(y.data.payload.lineage),Object.values(((L=y.data.payload)==null?void 0:L.lineage)??{}).length>Pe&&f(!1)),y.data.topic==="error"&&(r==null||r(y.data.error),z(!1))}const I=d||j||m;return e.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[I&&e.jsxs("div",{className:"absolute top-0 left-0 z-10 flex justify-center items-center w-full h-full",children:[e.jsx("span",{className:"absolute w-full h-full z-10 bg-transparent-20 backdrop-blur-lg"}),e.jsxs(te,{className:"inline-block z-10",children:[e.jsx(se,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md whitespace-nowrap",children:I?"Loading Model's Lineage...":"Merging Model's..."})]})]}),e.jsx(we,{children:e.jsx(Ze,{})})]})}function Ze(){const{withColumns:t,lineage:s,mainNode:n,selectedEdges:c,selectedNodes:u,withConnected:l,withImpacted:r,withSecondary:h,hasBackground:p,activeEdges:f,connectedNodes:i,connections:N,nodesMap:g,showControls:M,handleError:E,setActiveNodes:w}=F(),{setCenter:x}=G(),[d,v]=o.useState(!1),j=o.useMemo(()=>({model:xe}),[]),m=o.useMemo(()=>ve(s),[s]),z=o.useMemo(()=>be(s),[s]),[C,k]=o.useState([]),[b,I]=o.useState([]);o.useEffect(()=>{if(q(m)||B(n))return;v(!0);const A=X(m,f,c,g),W=Y(Object.values(g),A,n,i,u,N,l,r,h),U=J(m,N,f,A,c,u,i,l,r,h),Z=Ne({nodesMap:g,nodes:W,edges:U});return Z.create().then(H=>{I(H.edges),k(H.nodes)}).catch(H=>{E==null||E(H),I([]),k([])}).finally(()=>{const H=B(n)?void 0:g[n];$(H)&&x(H.position.x,H.position.y,{zoom:.5,duration:0}),setTimeout(()=>{v(!1)},100)}),()=>{Z.terminate(),I([]),k([])}},[f,g,z]),o.useEffect(()=>{if(B(n)||q(C))return;const A=X(m,f,c,g),W=Y(C,A,n,i,u,N,l,r,h),U=J(m,N,f,A,c,u,i,l,r,h);I(U),k(W),w(A)},[N,g,m,f,u,c,i,l,r,h,t,n]);function y(A){k(Ee(A,C))}function L(A){I(je(A,b))}return e.jsxs(e.Fragment,{children:[d&&e.jsxs("div",{className:"absolute top-0 left-0 z-10 flex justify-center items-center w-full h-full",children:[e.jsx("span",{className:"absolute w-full h-full z-10 bg-transparent-20 backdrop-blur-lg"}),e.jsxs(te,{className:"inline-block z-10",children:[e.jsx(se,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md whitespace-nowrap",children:"Building Lineage..."})]})]}),e.jsxs(ye,{nodes:C,edges:b,nodeTypes:j,onNodesChange:y,onEdgesChange:L,nodeOrigin:[.5,.5],minZoom:.05,maxZoom:1.5,snapGrid:[16,16],snapToGrid:!0,children:[M&&e.jsxs(oe,{position:"top-right",className:"bg-theme !m-0 w-full !z-10",children:[e.jsx(qe,{nodes:C}),e.jsx(pe,{})]}),e.jsx(Fe,{className:"bg-light p-1 rounded-md !border-none !shadow-lg"}),e.jsx(Oe,{variant:S.Cross,gap:32,size:4,className:R(p?"opacity-100 stroke-neutral-200 dark:stroke-neutral-800":"opacity-0")})]})]})}function qe({nodes:t=[]}){const{withColumns:s,mainNode:n,selectedNodes:c,withConnected:u,withImpacted:l,withSecondary:r,hasBackground:h,activeNodes:p,highlightedNodes:f,setSelectedNodes:i,setWithColumns:N,setWithConnected:g,setWithImpacted:M,setWithSecondary:E,setHasBackground:w}=F(),x=o.useRef(null),d=o.useMemo(()=>Object.values(f??{}).flat(),[f]);function v(j){d.includes(j.name)||n===j.name||i(m=>(m.has(j.name)?m.delete(j.name):m.add(j.name),new Set(m)))}return e.jsxs("div",{className:"px-2 flex items-center text-xs text-neutral-400 @container",children:[e.jsxs("div",{className:"contents",children:[e.jsxs(T,{className:"flex @lg:hidden bg-none border-none","aria-label":"Show lineage node details",children:[e.jsxs(T.Button,{ref:x,className:"flex items-center relative w-full cursor-pointer bg-primary-10 text-xs rounded-full text-primary-500 py-1 px-3 text-center focus:outline-none focus-visible:border-accent-500 focus-visible:ring-2 focus-visible:ring-light focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-brand-300 border-1 border-transparent",children:["Details",e.jsx(ze,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]}),e.jsx(T.Panel,{className:"absolute left-2 right-2 flex-col z-50 mt-8 transform flex px-4 py-3 bg-theme-lighter shadow-xl focus:ring-2 ring-opacity-5 rounded-lg",children:e.jsx(K,{nodes:t})})]}),e.jsx("div",{className:"hidden @lg:contents w-full",children:e.jsx(K,{nodes:t})})]}),e.jsxs("div",{className:"flex w-full justify-end items-center",children:[e.jsx(Ge,{handleSelect:v}),e.jsx(Se,{options:{Background:w,Columns:p.size>0&&c.size===0?void 0:N,Connected:p.size>0?void 0:g,"Upstream/Downstream":p.size>0?void 0:M,All:p.size>0?void 0:E},value:[s&&"Columns",h&&"Background",u&&"Connected",l&&"Upstream/Downstream",r&&"All"].filter(Boolean)})]})]})}export{it as default};
@@ -1,4 +0,0 @@
1
- import{r as x,ac as O}from"./index-BafGN4in.js";function p(l,r,e){let s=e.initialDeps??[],t;function n(){var i,o,h,c;let a;e.key&&((i=e.debug)!=null&&i.call(e))&&(a=Date.now());const u=l();if(!(u.length!==s.length||u.some((m,f)=>s[f]!==m)))return t;s=u;let v;if(e.key&&((o=e.debug)!=null&&o.call(e))&&(v=Date.now()),t=r(...u),e.key&&((h=e.debug)!=null&&h.call(e))){const m=Math.round((Date.now()-a)*100)/100,f=Math.round((Date.now()-v)*100)/100,S=f/16,b=(g,I)=>{for(g=String(g);g.length<I;)g=" "+g;return g};console.info(`%c⏱ ${b(f,5)} /${b(m,5)} ms`,`
2
- font-size: .6rem;
3
- font-weight: bold;
4
- color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(c=e==null?void 0:e.onChange)==null||c.call(e,t),t}return n.updateDeps=i=>{s=i},n}function E(l,r){if(l===void 0)throw new Error("Unexpected undefined");return l}const C=(l,r)=>Math.abs(l-r)<1,T=(l,r,e)=>{let s;return function(...t){l.clearTimeout(s),s=l.setTimeout(()=>r.apply(this,t),e)}},R=l=>l,_=l=>{const r=Math.max(l.startIndex-l.overscan,0),e=Math.min(l.endIndex+l.overscan,l.count-1),s=[];for(let t=r;t<=e;t++)s.push(t);return s},A=(l,r)=>{const e=l.scrollElement;if(!e)return;const s=l.targetWindow;if(!s)return;const t=i=>{const{width:o,height:h}=i;r({width:Math.round(o),height:Math.round(h)})};if(t(e.getBoundingClientRect()),!s.ResizeObserver)return()=>{};const n=new s.ResizeObserver(i=>{const o=()=>{const h=i[0];if(h!=null&&h.borderBoxSize){const c=h.borderBoxSize[0];if(c){t({width:c.inlineSize,height:c.blockSize});return}}t(e.getBoundingClientRect())};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(e,{box:"border-box"}),()=>{n.unobserve(e)}},M={passive:!0},y=typeof window>"u"?!0:"onscrollend"in window,D=(l,r)=>{const e=l.scrollElement;if(!e)return;const s=l.targetWindow;if(!s)return;let t=0;const n=l.options.useScrollendEvent&&y?()=>{}:T(s,()=>{r(t,!1)},l.options.isScrollingResetDelay),i=a=>()=>{const{horizontal:u,isRtl:d}=l.options;t=u?e.scrollLeft*(d&&-1||1):e.scrollTop,n(),r(t,a)},o=i(!0),h=i(!1);h(),e.addEventListener("scroll",o,M);const c=l.options.useScrollendEvent&&y;return c&&e.addEventListener("scrollend",h,M),()=>{e.removeEventListener("scroll",o),c&&e.removeEventListener("scrollend",h)}},k=(l,r,e)=>{if(r!=null&&r.borderBoxSize){const s=r.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return Math.round(l.getBoundingClientRect()[e.options.horizontal?"width":"height"])},F=(l,{adjustments:r=0,behavior:e},s)=>{var t,n;const i=l+r;(n=(t=s.scrollElement)==null?void 0:t.scrollTo)==null||n.call(t,{[s.options.horizontal?"left":"top"]:i,behavior:e})};class W{constructor(r){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(t=>{t.forEach(n=>{const i=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var t;(t=s())==null||t.disconnect(),e=null},observe:t=>{var n;return(n=s())==null?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n;return(n=s())==null?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,t])=>{typeof t>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:R,rangeExtractor:_,onChange:()=>{},measureElement:k,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,t;(t=(s=this.options).onChange)==null||t.call(s,this,e)},this.maybeNotify=p(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const t=new Map,n=new Map;for(let i=s-1;i>=0;i--){const o=e[i];if(t.has(o.lane))continue;const h=n.get(o.lane);if(h==null||o.end>h.end?n.set(o.lane,o):o.end<h.end&&t.set(o.lane,!0),t.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((i,o)=>i.end===o.end?i.index-o.index:i.end-o.end)[0]:void 0},this.getMeasurementOptions=p(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,s,t,n,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i}),{key:!1}),this.getMeasurements=p(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(a=>{this.itemSizeCache.set(a.key,a.size)}));const h=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,h);for(let a=h;a<e;a++){const u=n(a),d=this.options.lanes===1?c[a-1]:this.getFurthestMeasurement(c,a),v=d?d.end+this.options.gap:s+t,m=o.get(u),f=typeof m=="number"?m:this.options.estimateSize(a),S=v+f,b=d?d.lane:a%this.options.lanes;c[a]={index:a,start:v,size:f,end:S,key:u,lane:b}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=p(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,t,n)=>this.range=e.length>0&&s>0?j({measurements:e,outerSize:s,scrollOffset:t,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=p(()=>{let e=null,s=null;const t=this.calculateRange();return t&&(e=t.startIndex,s=t.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,t,n,i)=>n===null||i===null?[]:e({startIndex:n,endIndex:i,overscan:s,count:t}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,t=e.getAttribute(s);return t?parseInt(t,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(e,s)=>{const t=this.indexFromElement(e),n=this.measurementsCache[t];if(!n)return;const i=n.key,o=this.elementsCache.get(i);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(t,this.options.measureElement(e,s,this))},this.resizeItem=(e,s)=>{const t=this.measurementsCache[e];if(!t)return;const n=this.itemSizeCache.get(t.key)??t.size,i=s-n;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(t,i,this):t.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(t.index),this.itemSizeCache=new Map(this.itemSizeCache.set(t.key,s)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((s,t)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=p(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const t=[];for(let n=0,i=e.length;n<i;n++){const o=e[n],h=s[o];t.push(h)}return t},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return E(s[w(0,s.length-1,t=>E(s[t]).start,e)])},this.getOffsetForAlignment=(e,s,t=0)=>{const n=this.getSize(),i=this.getScrollOffset();s==="auto"&&(s=e>=i+n?"end":"start"),s==="center"?e+=(t-n)/2:s==="end"&&(e-=n);const o=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-n;return Math.max(Math.min(c,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const t=this.measurementsCache[e];if(!t)return;const n=this.getSize(),i=this.getScrollOffset();if(s==="auto")if(t.end>=i+n-this.options.scrollPaddingEnd)s="end";else if(t.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];const o=s==="end"?t.end+this.options.scrollPaddingEnd:t.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,s,t.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:s="start",behavior:t}={})=>{this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,s),{adjustments:void 0,behavior:t})},this.scrollToIndex=(e,{align:s="auto",behavior:t}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(e,s);if(!n)return;const[i,o]=n;this._scrollToOffset(i,{adjustments:void 0,behavior:t}),t!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){const[c]=E(this.getOffsetForIndex(e,o));C(c,this.getScrollOffset())||this.scrollToIndex(e,{align:o,behavior:t})}else this.scrollToIndex(e,{align:o,behavior:t})}))},this.scrollBy=(e,{behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let t;if(s.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=((e=s[s.length-1])==null?void 0:e.end)??0;else{const n=Array(this.options.lanes).fill(null);let i=s.length-1;for(;i>=0&&n.some(o=>o===null);){const o=s[i];n[o.lane]===null&&(n[o.lane]=o.end),i--}t=Math.max(...n.filter(o=>o!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:t})=>{this.options.scrollToFn(e,{behavior:t,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(r)}}const w=(l,r,e,s)=>{for(;l<=r;){const t=(l+r)/2|0,n=e(t);if(n<s)l=t+1;else if(n>s)r=t-1;else return t}return l>0?l-1:0};function j({measurements:l,outerSize:r,scrollOffset:e,lanes:s}){const t=l.length-1,n=h=>l[h].start;if(l.length<=s)return{startIndex:0,endIndex:t};let i=w(0,t,n,e),o=i;if(s===1)for(;o<t&&l[o].end<e+r;)o++;else if(s>1){const h=Array(s).fill(0);for(;o<t&&h.some(a=>a<e+r);){const a=l[o];h[a.lane]=a.end,o++}const c=Array(s).fill(e+r);for(;i>=0&&c.some(a=>a>=e);){const a=l[i];c[a.lane]=a.start,i--}i=Math.max(0,i-i%s),o=Math.min(t,o+(s-1-o%s))}return{startIndex:i,endIndex:o}}const z=typeof document<"u"?x.useLayoutEffect:x.useEffect;function B(l){const r=x.useReducer(()=>({}),{})[1],e={...l,onChange:(t,n)=>{var i;n?O.flushSync(r):r(),(i=l.onChange)==null||i.call(l,t,n)}},[s]=x.useState(()=>new W(e));return s.setOptions(e),z(()=>s._didMount(),[]),z(()=>s._willUpdate()),s}function L(l){return B({observeElementRect:A,observeElementOffset:D,scrollToFn:F,...l})}export{L as u};