@cmmd-center/forge 0.14.1 → 0.14.2

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 (71) hide show
  1. package/dist/bin.cjs +487 -41
  2. package/dist/bin.mjs +511 -65
  3. package/dist/client/assets/{CanvasPanel-BeSvnc85.js → CanvasPanel-Bk1rL0LG.js} +3 -3
  4. package/dist/client/assets/CompositeItem-D1GrQhpu.js +2 -0
  5. package/dist/client/assets/CompositeList-CEBk8sf_.js +2 -0
  6. package/dist/client/assets/DiffPanel-jC25MVg8.js +64 -0
  7. package/dist/client/assets/{DiffPanel.logic-CAb-hngG.js → DiffPanel.logic-DHo4jHZM.js} +6 -6
  8. package/dist/client/assets/{DiffWorkerPoolProvider-BbyQb-ye.js → DiffWorkerPoolProvider-r1DUfA1d.js} +10 -10
  9. package/dist/client/assets/Effect-CyyMOw4X.js +15 -0
  10. package/dist/client/assets/PullRequestCodePanel-BWuWxI6X.js +5 -0
  11. package/dist/client/assets/Schema-8EGdYSms.js +3 -0
  12. package/dist/client/assets/Stream-Bvl2Z6qI.js +2 -0
  13. package/dist/client/assets/ThemeEditorPanel-BOkxNR3t.js +2 -0
  14. package/dist/client/assets/Virtualizer-DOL71mrP.js +2 -0
  15. package/dist/client/assets/WorkerPoolContext-gI2-7Koc.js +2538 -0
  16. package/dist/client/assets/activeOrganizationId-CySrJzMX.js +2 -0
  17. package/dist/client/assets/atomRegistry-CzI2zp7d.js +3 -0
  18. package/dist/client/assets/{canvasStateStore-DYt9MgFu.js → canvasStateStore-dUmp5NFj.js} +2 -2
  19. package/dist/client/assets/chevron-left-BXpfeqsT.js +2 -0
  20. package/dist/client/assets/chevron-right-B103tjaJ.js +2 -0
  21. package/dist/client/assets/cmmdAuthRedirect-CHlAAdAc.js +3 -0
  22. package/dist/client/assets/cmmdEmbedMode-DhVvltxi.js +2 -0
  23. package/dist/client/assets/currentForgeWorkspaceStore-eKCBxKgv.js +2 -0
  24. package/dist/client/assets/dialog-BfhVD7Kq.js +2 -0
  25. package/dist/client/assets/getPseudoElementBounds-DBf0dPO9.js +2 -0
  26. package/dist/client/assets/index-BS4FABiE.js +301 -0
  27. package/dist/client/assets/minus-CbEeUDFT.js +2 -0
  28. package/dist/client/assets/popover-D8qvi5AD.js +2 -0
  29. package/dist/client/assets/{react-D4GEJ3ir.js → react-A0DLYjwn.js} +2 -2
  30. package/dist/client/assets/scroll-area-BDuz0PnB.js +2 -0
  31. package/dist/client/assets/sidebarV2CustomSnoozeDialog-pxOuwuY2.js +2 -0
  32. package/dist/client/assets/src-7C4X1Oy2.js +2 -0
  33. package/dist/client/assets/switch-BeaQwtm7.js +2 -0
  34. package/dist/client/assets/{themePalette-BWvBK22X.js → themePalette-D4rx0k29.js} +2 -2
  35. package/dist/client/assets/toggle--uJ9LmDV.js +2 -0
  36. package/dist/client/assets/toggle-group-6UcL78FY.js +2 -0
  37. package/dist/client/assets/tooltip-C_eHCky0.js +2 -0
  38. package/dist/client/assets/useOpenInteractionType-BFjAYgzR.js +2 -0
  39. package/dist/client/assets/{workspaceReadinessAtom-D6bgTvKb.js → workspaceReadinessAtom-BIm13kLJ.js} +2 -2
  40. package/dist/client/index.html +33 -31
  41. package/dist/forge-build.json +1 -1
  42. package/dist/{open-yHTUkd2Y.mjs → open-2-reBrpv.mjs} +3 -3
  43. package/package.json +1 -1
  44. package/dist/client/assets/CompositeItem-DTyKsv13.js +0 -2
  45. package/dist/client/assets/CompositeList-Bc8TYCyy.js +0 -2
  46. package/dist/client/assets/DiffPanel-3EEekk0W.js +0 -64
  47. package/dist/client/assets/PullRequestCodePanel--fricLiS.js +0 -5
  48. package/dist/client/assets/Stream-mUTFnSY9.js +0 -15
  49. package/dist/client/assets/ThemeEditorPanel-BCJuZ6ai.js +0 -2
  50. package/dist/client/assets/Virtualizer-DX75f7Mw.js +0 -2
  51. package/dist/client/assets/WorkerPoolContext-D_2lN-9Y.js +0 -1533
  52. package/dist/client/assets/atomRegistry-C1yW8tyM.js +0 -3
  53. package/dist/client/assets/chevron-left-1XbEOuXj.js +0 -2
  54. package/dist/client/assets/chevron-right-DAF000Jz.js +0 -2
  55. package/dist/client/assets/cmmdAuthRedirect-DRkKjx0G.js +0 -3
  56. package/dist/client/assets/cmmdForgeRuntimeListResource-Df9wlF4U.js +0 -1008
  57. package/dist/client/assets/currentForgeWorkspaceStore-CiCPSq18.js +0 -2
  58. package/dist/client/assets/dialog-C0bK23D8.js +0 -2
  59. package/dist/client/assets/getPseudoElementBounds-DJTX-eyW.js +0 -2
  60. package/dist/client/assets/index-BHReJBiJ.js +0 -301
  61. package/dist/client/assets/minus-_j91i8bf.js +0 -2
  62. package/dist/client/assets/popover-ClRgm7hB.js +0 -2
  63. package/dist/client/assets/scroll-area-BHqISEYq.js +0 -2
  64. package/dist/client/assets/sidebarV2CustomSnoozeDialog-lbAJoff_.js +0 -2
  65. package/dist/client/assets/src-B_wrKHuq.js +0 -3
  66. package/dist/client/assets/switch-BWQHMJkU.js +0 -2
  67. package/dist/client/assets/toggle-CORC1vE9.js +0 -2
  68. package/dist/client/assets/toggle-group-C9nAr6VB.js +0 -2
  69. package/dist/client/assets/tooltip-CrS-TEbN.js +0 -2
  70. package/dist/client/assets/useOpenInteractionType-KsRrk6uH.js +0 -2
  71. package/dist/client/assets/utils-xQJ3ak-X.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{Ha as n}from"./Effect-CyyMOw4X.js";import{z as r}from"./Stream-Bvl2Z6qI.js";import{$t as i,An as a,Bt as o,Dn as s,E as c,Et as l,Fn as u,Gt as d,In as f,J as p,Jt as m,Kt as h,Lt as g,Mn as _,Mt as v,Nn as y,Nt as b,On as x,Qt as S,Tn as ee,Tt as C,Ut as w,Vt as T,Wt as E,Y as D,at as te,bt as O,dn as ne,en as k,gt as re,ht as A,in as j,it as ie,jn as M,jt as N,kn as P,ln as F,nn as ae,on as I,qt as oe,rn as se,rt as L,sn as R,tn as ce,un as z,wt as B,x as V,xt as le}from"./CompositeItem-D1GrQhpu.js";var ue=t((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),H=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ue()})),de=ne(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),U=e(H(),1),W=r(),fe=f(),pe=u(),G=e(n(),1),K=[],q=void 0;function J(){return q}function me(e){K.push(e)}function he(e){let t=(t,n)=>{let r=_(_e).current,i;try{q=r;for(let e of K)e.before(r);i=e(t,n);for(let e of K)e.after(r);r.didInitialize=!0}finally{q=void 0}return i};return t.displayName=e.displayName||e.name,t}function ge(e){return G.forwardRef(he(e))}function _e(){return{didInitialize:!1}}function ve(e){G.useEffect(e,s)}var ye=0,be=class e{static create(){return new e}currentId=ye;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ye,t()},e)}isStarted(){return this.currentId!==ye}clear=()=>{this.currentId!==ye&&(clearTimeout(this.currentId),this.currentId=ye)};disposeEffect=()=>this.clear};function xe(){let e=_(be.create).current;return ve(e.disposeEffect),e}var Se=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Ce=!Se&&F.includes(`firefox`);!Se&&F.includes(`chrom`);var we=I;function Te(e,t){if(!w(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(C(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ee(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function De(e){return e.matches(`html,body`)}function Oe(e){return E(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ke(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${v}`)!=null}function Ae(e){return e?e.getAttribute(`role`)===`combobox`&&Oe(e):!1}function je(e){if(!e||j)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Me(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Y(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ne(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Pe(e){let t=_(Fe,e).current;return t.next=e,z(t.effect),t}function Fe(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ie=null;globalThis.requestAnimationFrame;var Le=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},X=class e{static create(){return new e}static request(e){return Le.request(e)}static cancel(e){return Le.cancel(e)}currentId=Ie;request(e){this.cancel(),this.currentId=Le.request(()=>{this.currentId=Ie,e()})}cancel=()=>{this.currentId!==Ie&&(Le.cancel(this.currentId),this.currentId=Ie)};disposeEffect=()=>this.cancel};function Re(){let e=_(X.create).current;return ve(e.disposeEffect),e}function Z(e){return e?.ownerDocument||document}var ze={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Be={...ze,position:`fixed`,top:0,left:0},Ve={...ze,position:`absolute`},He=G.forwardRef(function(e,t){let[n,r]=G.useState();z(()=>{we&&Se&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,W.jsx)(`span`,{...e,ref:t,style:Be,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Ue=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function We(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return m(n)?n.host:null}function Ge(e){for(let t of Array.from(e.children))if(g(t)===`summary`)return t;return null}function Ke(e,t){let n=Ge(t);return!!n&&(e===n||C(n,e))}function qe(e){let t=e?g(e):``;return e!=null&&e.matches(Ue)&&(t!==`summary`||e.parentElement!=null&&g(e.parentElement)===`details`&&Ge(e.parentElement)===e)&&(t!==`details`||Ge(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Je(e){if(!qe(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=We(t)){let n=t!==e,r=g(t)===`slot`;if(t.hasAttribute(`inert`)||n&&g(t)===`details`&&!t.open&&!Ke(e,t)||t.hasAttribute(`hidden`)||!r&&!Ye(t,n))return!1}return!0}function Ye(e,t){let n=b(e);return t?n.display!==`none`:c(e,n)}function Xe(e){let t=e.tabIndex;if(t<0){let t=g(e);if(t===`details`||t===`audio`||t===`video`||E(e)&&e.isContentEditable)return 0}return t}function Ze(e){if(g(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Qe(e,t){let n=Ze(e);if(!n)return!0;let r=t.find(e=>{let t=Ze(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Ze(e);return t?.name===n.name&&t.form===n.form})===n}function $e(e){if(E(e)&&g(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return E(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function et(e,t){$e(e).forEach(e=>{qe(e)&&t.push(e),et(e,t)})}function tt(e,t,n){$e(e).forEach(e=>{E(e)&&e.matches(t)&&n.push(e),tt(e,t,n)})}function nt(e){return Je(e)&&Xe(e)>=0}function rt(e){let t=[];return et(e,t),t.filter(Je)}function it(e){let t=rt(e);return t.filter(e=>Xe(e)>=0&&Qe(e,t))}function at(e,t){let n=it(e),r=n.length;if(r===0)return;let i=B(Z(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ot(e){return at(Z(e).body,1)||e}function st(e){return at(Z(e).body,-1)||e}function ct(e,t){if(!e)return null;let n=it(Z(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function lt(e){return ct(e,1)}function ut(e){return ct(e,-1)}function dt(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!C(n,r)}function ft(e){it(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function pt(e){let t=[];tt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function mt(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...mt(e,t.id,n)])}function ht(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function gt(e){return`data-base-ui-${e}`}var _t=0;function vt(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(_t);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),P;let o=requestAnimationFrame(a);return _t=o,()=>{_t===o&&(cancelAnimationFrame(o),_t=0)}}var yt={inert:new WeakMap,"aria-hidden":new WeakMap},bt=`data-base-ui-inert`,xt={inert:new WeakSet,"aria-hidden":new WeakSet},St=new WeakMap,Ct=0;function wt(e){return xt[e]}function Tt(e){return e?m(e)?e.host:Tt(e.parentNode):null}var Et=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Tt(t);return e.contains(n)?n:null}).filter(e=>e!=null),Dt=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ot=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{g(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function kt(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Et(t,e),l=i?Ot(t,Dt(c),new Set(c)):[],u=[],d=[];if(a){let e=yt[a],n=wt(a);s=n,o=e;let r=Et(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Ot(t,Dt(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(St.get(e)||0)+1;St.set(e,t),d.push(e),t===1&&e.setAttribute(bt,``)}),Ct+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(St.get(e)||0)-1;St.set(e,t),t||e.removeAttribute(bt)}),--Ct,Ct||(yt.inert=new WeakMap,yt[`aria-hidden`]=new WeakMap,xt.inert=new WeakSet,xt[`aria-hidden`]=new WeakSet,St=new WeakMap)}}function At(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Z(e[0]).body;return kt(e,a,n,r,{mark:i})}var jt={style:{transition:`none`}},Mt=`data-base-ui-click-trigger`,Nt=`data-base-ui-swipe-ignore`,Pt=`data-swipe-ignore`,Ft=`[${Nt}]`,It=`[${Pt}]`,Lt={fallbackAxisSide:`none`},Rt={fallbackAxisSide:`end`},zt={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Bt=G.createContext(null),Vt=()=>G.useContext(Bt),Ht=gt(`portal`);function Ut(e={}){let{ref:t,container:n,componentProps:r=x,elementProps:i}=e,a=V(),o=Vt()?.portalNode,[s,c]=G.useState(null),[l,u]=G.useState(null),d=p(e=>{e!==null&&u(e)}),f=G.useRef(null);z(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(h(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let m=ee(`div`,r,{ref:[t,d],props:[{id:a,[Ht]:``},i]}),g=s&&m?U.createPortal(m,s):null;return{node:l,nodeId:G.isValidElement(m)?m.props.id:void 0,subtree:g}}var Wt=G.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=Ut({container:o,ref:t,componentProps:e,elementProps:s}),d=G.useRef(null),f=G.useRef(null),p=G.useRef(null),m=G.useRef(null),[h,g]=G.useState(null),_=G.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;G.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&dt(e)&&(e.type===`focusin`?_.current&&=(pt(c),!1):(ft(c),_.current=!0))}return Ne(Y(c,`focusin`,e,!0),Y(c,`focusout`,e,!0))},[c,v]),z(()=>{!c||y!==!0||!_.current||(pt(c),_.current=!1)},[y,c]);let x=G.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,W.jsxs)(G.Fragment,{children:[u,(0,W.jsxs)(Bt.Provider,{value:x,children:[b&&c&&(0,W.jsx)(He,{"data-type":`outside`,ref:d,onFocus:e=>{dt(e,c)?p.current?.focus():st(h?h.domReference:null)?.focus()}}),b&&c&&(0,W.jsx)(`span`,{"aria-owns":l,style:zt}),c&&U.createPortal(a,c),b&&c&&(0,W.jsx)(He,{"data-type":`outside`,ref:f,onFocus:e=>{dt(e,c)?m.current?.focus():(ot(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,D(`focus-out`,e.nativeEvent)))}})]})]})});function Gt(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Kt=class{nodesRef={current:[]};events=Gt();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},qt=G.createContext(null),Jt=G.createContext(null),Yt=()=>G.useContext(qt)?.id||null,Xt=e=>{let t=G.useContext(Jt);return e??t};function Zt(e){let t=V(),n=Xt(e),r=Yt();return z(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Qt(e){let{children:t,id:n}=e,r=Yt();return(0,W.jsx)(qt.Provider,{value:G.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function $t(e){let{children:t,externalTree:n}=e,r=_(()=>n??new Kt).current;return(0,W.jsx)(Jt.Provider,{value:r,children:t})}function Q(e){return e==null?e:`current`in e?e.current:e}function en(e,t){let n=T(l(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var tn=20,$=[];function nn(){$=$.filter(e=>e.deref()?.isConnected)}function rn(e){nn(),e&&g(e)!==`body`&&($.push(new WeakRef(e)),$.length>tn&&($=$.slice(-20)))}function an(){return nn(),$[$.length-1]?.deref()}function on(e){return e?nt(e)?e:it(e)[0]||e:null}function sn(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=rt(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return nt(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function cn(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:_,getInsideElements:v}=e,y=`rootStore`in t?t.rootStore:t,b=y.useState(`open`),x=y.useState(`domReferenceElement`),S=y.useState(`floatingElement`),{events:ee,dataRef:w}=y.context,T=p(()=>w.current.floatingContext?.nodeId),te=i===!1,O=Ae(x)&&te,ne=Pe(i),k=Pe(a),re=Pe(d),A=Pe(b),j=Xt(_),N=Vt(),P=G.useRef(!1),F=G.useRef(!1),I=G.useRef(!1),oe=G.useRef(null),L=G.useRef(``),R=G.useRef(``),V=G.useRef(null),le=G.useRef(null),ue=M(V,h,N?.beforeInsideRef),H=M(le,N?.afterInsideRef),de=xe(),U=xe(),fe=Re(),pe=N!=null,K=Me(S),q=p((e=K)=>e?it(e):[]),J=p(()=>v?.().filter(e=>e!=null)??[]);G.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&C(K,B(Z(K)))&&q().length===0&&!O&&se(e)}return Y(Z(K),`keydown`,e)},[r,K,s,O,q]),G.useEffect(()=>{if(r||!b)return;let e=Z(K);function t(){I.current=!1}function n(e){let t=l(e),n=J(),r=C(S,t)||C(x,t)||C(N?.portalNode,t)||n.some(e=>e===t||C(e,t));I.current=!r,R.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(F.current=!0,U.start(0,()=>{F.current=!1}))}function i(){R.current=`keyboard`}return Ne(Y(e,`pointerdown`,n,!0),Y(e,`pointerup`,t,!0),Y(e,`pointercancel`,t,!0),Y(e,`keydown`,i,!0),t)},[r,S,x,K,b,N,U,J]),G.useEffect(()=>{if(r||!u)return;let e=Z(K);function t(){F.current=!0,U.start(0,()=>{F.current=!1})}function n(e){let t=l(e);nt(t)&&(oe.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=l(t);s&&n==null&&i!=null&&C(S,i)&&rn(i),queueMicrotask(()=>{let a=T(),l=y.context.triggerElements,u=J(),d=n?.hasAttribute(gt(`focus-guard`))&&[V.current,le.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,Q(m),Q(f)].includes(n),p=!(C(x,n)||C(S,n)||C(n,S)||C(N?.portalNode,n)||u.some(e=>e===n||C(e,n))||l.hasMatchingElement(e=>C(e,n))||d||j&&(mt(j.nodesRef.current,a).find(e=>C(e.context?.elements.floating,n)||C(e.context?.elements.domReference,n))||ht(j.nodesRef.current,a).find(e=>[e.context?.elements.floating,Me(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===x&&K&&sn(K),o&&r!==x&&!c(i)&&B(e)===e.body){if(E(K)&&(K.focus(),o===`popup`)){fe.request(()=>{K.focus()});return}let e=q(),t=oe.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||K;E(n)&&n.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(O||!s)&&n&&p&&!F.current&&(O||n!==an())&&(P.current=!0,y.setOpen(!1,D(ie,t)))})}function a(){I.current||(w.current.insideReactTree=!0,de.start(0,()=>{w.current.insideReactTree=!1}))}let d=E(x)?x:null;if(!(!S&&!d))return Ne(d&&Y(d,`focusout`,i),d&&Y(d,`pointerdown`,t),S&&Y(S,`focusin`,n),S&&Y(S,`focusout`,i),S&&N&&Y(S,`focusout`,a,!0))},[r,x,S,K,s,j,N,y,u,o,q,O,T,w,de,U,fe,f,m,J]),G.useEffect(()=>{if(r||!S||!b)return;let e=Array.from(N?.portalNode?.querySelectorAll(`[${gt(`portal`)}]`)||[]),t=(j?ht(j.nodesRef.current,T()):[]).find(e=>Ae(e.context?.elements.domReference||null))?.context?.elements.domReference,n=At([S,...e,V.current,le.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...J(),t,Q(m),Q(f),O?x:null].filter(e=>e!=null),{ariaHidden:s||O,mark:!1}),i=At([S,...e].filter(e=>e!=null));return()=>{i(),n()}},[b,r,x,S,s,N,O,j,T,f,m,J]),z(()=>{if(!b||r||!E(K))return;L.current=``,R.current=``;let e=Z(K),t=B(e);queueMicrotask(()=>{let n=ne.current,r=typeof n==`function`?n(re.current||``):n;if(r===void 0||r===!1||C(K,t))return;let i=null,a=()=>(i??=q(K),i[0]||K),o;o=r===!0||r===null?a():Q(r),o||=a();let s=C(K,B(e));vt(o,{preventScroll:o===K,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=B(e);return!(t!==o&&C(K,t))}})})},[r,b,K,q,ne,re,A]),z(()=>{if(r||!K)return;let e=Z(K),t=B(e),n=re.current==null;rn(t);function i(e){if(e.open||(L.current=en(e.nativeEvent,R.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(P.current=!0),e.reason===`outside-press`)if(e.nested)P.current=!1;else if(ce(e.nativeEvent)||ae(e.nativeEvent))P.current=!1;else{let e=!1;Z(K).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}ee.on(`openchange`,i);function a(e){let r=k.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=x?.isConnected?x:null,o=t?.isConnected&&g(t)!==`body`?t:null,s=n?o||a:a||o;return s||=an()||null,typeof i==`boolean`?s:Q(i)||s||null}return()=>{ee.off(`openchange`,i);let t=B(e),n=J(),r=C(S,t)||n.some(e=>e===t||C(e,t))||j&&mt(j.nodesRef.current,T(),!1).some(e=>C(e.context?.elements.floating,t)),o=k.current,s=L.current,c=a(s);queueMicrotask(()=>{let n=on(c),i=typeof o!=`boolean`;if(o&&!P.current&&E(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}P.current=!1})}},[r,S,K,k,re,ee,j,x,T,J]),z(()=>{if(!Se||b||!S)return;let e=B(Z(S));!E(e)||!Oe(e)||C(S,e)&&e.blur()},[b,S]),z(()=>{if(!(r||!N))return N.setFocusManagerState({modal:s,closeOnFocusOut:u,open:b,onOpenChange:y.setOpen,domReference:x}),()=>{N.setFocusManagerState(null)}},[r,N,s,b,y,u,x]),z(()=>{if(!(r||!K))return sn(K),()=>{queueMicrotask(nn)}},[r,K]);let me=!r&&(!s||!O)&&(pe||s);return(0,W.jsxs)(G.Fragment,{children:[me&&(0,W.jsx)(He,{"data-type":`inside`,ref:ue,onFocus:e=>{if(s){let e=q();vt(e[e.length-1])}else N?.portalNode&&(P.current=!1,dt(e,N.portalNode)?ot(x)?.focus():Q(m??N.beforeOutsideRef)?.focus())}}),n,me&&(0,W.jsx)(He,{"data-type":`inside`,ref:H,onFocus:e=>{s?vt(q()[0]):N?.portalNode&&(u&&(P.current=!0),dt(e,N.portalNode)?st(x)?.focus():Q(f??N.afterOutsideRef)?.focus())}})]})}function ln(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:a=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:u=le}=t,d=`rootStore`in e?e.rootStore:e,f=d.context.dataRef,p=G.useRef(void 0),m=Re(),h=xe(),g=G.useMemo(()=>{function e(e,t,n,r){let i=D(u,t,n);e&&r===`touch`&&c>0?h.start(c,()=>{d.setOpen(!0,i)}):d.setOpen(e,i)}function t(e,t,n){let r=f.current.openEvent,i=d.select(`domReferenceElement`)!==t;return e&&i||!e||!a?!0:r&&s?!n(r.type):!1}return{onPointerDown(e){p.current=i(e.pointerType,!0)&&ae(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let a=p.current,s=n.nativeEvent,c=d.select(`open`);if(n.button!==0||r===`click`||i(a,!0)&&o)return;let u=t(c,n.currentTarget,e=>e===`click`||e===`mousedown`),f=l(s);if(Oe(f)){e(u,s,f,a);return}let h=n.currentTarget;m.request(()=>{e(u,s,h,a)})},onClick(n){if(r===`mousedown-only`)return;let a=p.current;if(r===`mousedown`&&a){p.current=void 0;return}i(a,!0)&&o||e(t(d.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,a)},onKeyDown(){p.current=void 0}}},[f,r,o,u,d,s,a,m,h,c]);return G.useMemo(()=>n?{reference:g}:x,[n,g])}function un(){return!1}function dn(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function fn(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:s=un,bubbles:c,externalTree:u}=t,f=`rootStore`in e?e.rootStore:e,h=f.useState(`open`),g=f.useState(`floatingElement`),{dataRef:_}=f.context,v=Xt(u),y=p(typeof i==`function`?i:()=>!1),x=typeof i==`function`?y:i,S=x!==!1,ee=p(()=>a),{escapeKey:T,outsidePress:te}=dn(c),O=G.useRef(!1),ne=G.useRef(!1),A=G.useRef(!1),j=G.useRef(!1),ie=G.useRef(``),M=G.useRef(null),N=xe(),P=xe(),F=p(()=>{P.clear(),_.current.insideReactTree=!1}),ae=p(e=>{let t=_.current.floatingContext?.nodeId;return(v?mt(v.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),I=p(e=>Ee(e,f.select(`floatingElement`))||Ee(e,f.select(`domReferenceElement`))),oe=p(e=>{s()&&f.setOpen(!1,D(le,e.nativeEvent))}),se=p(e=>{if(!h||!n||!r||e.key!==`Escape`||j.current||!T&&ae(`__escapeKeyBubbles`))return;let t=k(e)?e.nativeEvent:e,i=D(L,t);f.setOpen(!1,i),i.isCanceled||e.preventDefault(),!T&&!i.isPropagationAllowed&&e.stopPropagation()}),R=p(()=>{_.current.insideReactTree=!0,P.start(0,F)}),ce=p(e=>{if(!h||!n||e.button!==0)return;let t=l(e.nativeEvent);C(f.select(`floatingElement`),t)&&(O.current||(O.current=!0,ne.current=!1))}),z=p(e=>{!h||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&O.current&&(ne.current=!0)});G.useEffect(()=>{if(!h||!n)return F;_.current.__escapeKeyBubbles=T,_.current.__outsidePressBubbles=te;let e=new be,t=new be;function i(){e.clear(),j.current=!0}function a(){e.start(Se?5:0,()=>{j.current=!1})}function s(){A.current=!0,t.start(0,()=>{A.current=!1})}function c(){O.current=!1,ne.current=!1}function u(){let e=ie.current,t=e===`pen`||!e?`mouse`:e,n=ee(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=u();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function y(e){let t=_.current.floatingContext?.nodeId,n=v&&mt(v.nodesRef.current,t).some(t=>Ee(e,t.context?.elements.floating));return I(e)||n}function k(e){if(p(e)){e.type!==`click`&&!I(e)&&(t.clear(),A.current=!1),F();return}if(_.current.insideReactTree){F();return}let n=l(e),r=`[${gt(`inert`)}]`,i=w(n)?n.getRootNode():null,a=Array.from((m(i)?i:Z(f.select(`floatingElement`))).querySelectorAll(r)),s=f.context.triggerElements;if(n&&(s.hasElement(n)||s.hasMatchingElement(e=>C(e,n))))return;let c=w(n)?n:null;for(;c&&!d(c);){let e=o(c);if(d(e)||!w(e))break;c=e}if(!(a.length&&w(n)&&!De(n)&&!C(n,f.select(`floatingElement`))&&a.every(e=>!C(c,e)))){if(E(n)&&!(`touches`in e)){let t=d(n),r=b(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),f=s&&e.offsetY>n.clientHeight;if(u||f)return}if(!y(e)){if(u()===`intentional`&&A.current){t.clear(),A.current=!1;return}typeof x==`function`&&!x(e)||ae(`__outsidePressBubbles`)||(f.setOpen(!1,D(re,e)),F())}}}function P(e){u()!==`sloppy`||e.pointerType===`touch`||!f.select(`open`)||!n||I(e)||k(e)}function oe(e){if(u()!==`sloppy`||!f.select(`open`)||!n||I(e))return;let t=e.touches[0];t&&(M.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=l(e);if(!n)return;let r=Y(n,e.type,()=>{t(e),r()})}function R(e){ie.current=`touch`,L(e,oe)}function ce(e){N.clear(),e.type===`pointerdown`&&(ie.current=e.pointerType),!(e.type===`mousedown`&&M.current&&!M.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function z(e){if(!O.current)return;let n=ne.current;if(c(),u()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!y(e)){if(n){s();return}typeof x==`function`&&!x(e)||(t.clear(),A.current=!0,F())}}}function B(e){if(u()!==`sloppy`||!M.current||I(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-M.current.startX),r=Math.abs(t.clientY-M.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(M.current.dismissOnTouchEnd=!0),i>10&&(k(e),N.clear(),M.current=null)}function V(e){L(e,B)}function le(e){u()!==`sloppy`||!M.current||I(e)||(M.current.dismissOnTouchEnd&&k(e),N.clear(),M.current=null)}function ue(e){L(e,le)}let H=Z(g),de=Ne(r&&Ne(Y(H,`keydown`,se),Y(H,`compositionstart`,i),Y(H,`compositionend`,a)),S&&Ne(Y(H,`click`,ce,!0),Y(H,`pointerdown`,ce,!0),Y(H,`pointerup`,z,!0),Y(H,`pointercancel`,z,!0),Y(H,`mousedown`,ce,!0),Y(H,`mouseup`,z,!0),Y(H,`touchstart`,R,!0),Y(H,`touchmove`,V,!0),Y(H,`touchend`,ue,!0)));return()=>{de(),e.clear(),t.clear(),c(),A.current=!1,F()}},[_,g,r,S,x,h,n,T,te,se,F,ee,ae,I,v,f,N]);let B=G.useMemo(()=>({onKeyDown:se,onPointerDown:oe,onClick:oe}),[se,oe]),V=G.useMemo(()=>({onKeyDown:se,onPointerDown:z,onMouseDown:z,onClickCapture:R,onMouseDownCapture(e){R(),ce(e)},onPointerDownCapture(e){R(),ce(e)},onMouseUpCapture:R,onTouchEndCapture:R,onTouchMoveCapture:R}),[se,R,ce,z]);return G.useMemo(()=>n?{reference:B,floating:V,trigger:B}:{},[n,B,V])}var pn=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(y(99,this.componentName,e,this.componentName));t.setOpen(!0,D(te,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,D(te))}},mn=a(19)?_n:vn;function hn(e,t,n,r,i){return mn(e,t,n,r,i)}function gn(e,t,n,r,i){let a=G.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,fe.useSyncExternalStore)(e.subscribe,a,a)}me({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,fe.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _n(e,t,n,r,i){let a=J();if(!a)return gn(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function vn(e,t,n,r,i){return(0,pe.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var yn=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return hn(this,e,t,n,r)}},bn=class extends yn{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){G.useDebugValue(e);let n=this;z(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;z(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);z(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){G.useDebugValue(e);let n=this,r=t!==void 0;z(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return G.useDebugValue(e),hn(this,this.selectors[e],t,n,r)}useContextCallback(e,t){G.useDebugValue(e);let n=p(t??P);this.context[e]=n}useStateSetter(e){let t=G.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},xn={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Sn=class extends bn{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Gt(),nested:n,triggerElements:i},xn),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&S(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Cn(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=G.useRef(null);r===void 0&&f.current===null&&(f.current=new Sn({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),z(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};w(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function wn(e,t=!1,n=!1){let[r,i]=G.useState(e&&t?`idle`:void 0),[a,o]=G.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),z(()=>{if(!e&&a&&r!==`ending`&&n){let e=X.request(()=>{i(`ending`)});return()=>{X.cancel(e)}}},[e,a,r,n]),z(()=>{if(!e||t)return;let n=X.request(()=>{i(void 0)});return()=>{X.cancel(n)}},[t,e]),z(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=X.request(()=>{i(`idle`)});return()=>{X.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Tn(e,t=!1){let n=Re();return p((r,i=null)=>{n.cancel();let a=Q(e);if(a==null)return;let o=a,s=()=>{U.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function En(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=p(i),o=Tn(r,n);G.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Dn={tabIndex:-1,[N]:``};function On(e){return t=>t!==`touch`||e.current}function kn(e,t=!1){let n=V(),r=Yt()!=null,i=_(()=>e(n,r)).current;return Cn({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function An({handle:e,store:t}){return z(()=>e.attachStore(t),[e,t]),null}function jn(e,t){let n=G.useRef(null),r=G.useRef(null);return G.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Mn(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Nn(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Pn(e,t,n,r={}){let i=n.reason,a=i===O,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Nn(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),Mn(i,t,n.trigger,c()),e.update(i)};a?U.flushSync(l):l()}function Fn(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=jn(e,n),o=p(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=G.useCallback(e=>{a(e),e&&o(e)},[a,o]);return z(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function In(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=G.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);z(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=D(A);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Ln(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=wn(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=p(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return En({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Rn(e,t){e.useSyncedValues(t),z(()=>()=>{e.update({activeTriggerProps:x,inactiveTriggerProps:x,popupProps:x})},[e])}function zn(e,t){z(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),z(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Bn=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Vn(){return new Sn({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Bn,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Hn(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Vn(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:x,inactiveTriggerProps:x,popupProps:x}}function Un(e,t,n=!1){return new Sn({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var Wn=e=>e.triggerIdProp??e.activeTriggerId,Gn=e=>e.openProp??e.open,Kn=e=>(e.popupElement?.id??e.floatingId)||void 0;function qn(e,t){return t!==void 0&&Gn(e)&&Wn(e)===t}function Jn(e,t){return qn(e,t)?!0:t!==void 0&&Gn(e)&&Wn(e)==null&&e.triggerCount===1}var Yn={open:Gn,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Wn,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Kn,isTriggerActive:(e,t)=>t!==void 0&&Wn(e)===t,isOpenedByTrigger:(e,t)=>qn(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Wn(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Jn(e,t)?Kn(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Xn(e){let t=G.useCallback(t=>e===void 0?P:e.subscribeStore(t),[e]),n=G.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,fe.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Zn=class extends bn{setState(e){}update(e){}set(e,t){}notifyAll(){}},Qn=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),$n={"data-starting-style":``},er={"data-ending-style":``},tr={transitionStatus(e){return e===`starting`?$n:e===`ending`?er:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Qn.startingStyle]=`startingStyle`,e[e.endingStyle=Qn.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var nr={"data-popup-open":``},rr={"data-popup-open":``,"data-pressed":``},ir={"data-open":``},ar={"data-closed":``},or={"data-anchor-hidden":``},sr={open(e){return e?nr:null}},cr={open(e){return e?rr:null}},lr={open(e){return e?ir:ar},anchorHidden(e){return e?or:null}},ur={...lr,...tr};function dr(e){return a(19)?e:e?`true`:void 0}var fr=G.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,W.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),pr={},mr={},hr=``;function gr(e,t){return oe(e)?e:t}function _r(e,t,n){return/hidden|clip/.test(e.getComputedStyle(gr(t,n)).overflowY)}function vr(e){if(typeof document>`u`)return!1;let t=Z(e);return T(t).innerWidth-t.documentElement.clientWidth>0}function yr(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Z(e),n=t.documentElement,r=t.body,i=gr(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function br(e){let t=Z(e),n=t.documentElement,r=t.body,i=gr(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function xr(e){let t=Z(e),n=t.documentElement,r=t.body,i=T(n),a=0,o=0,s=!1,c=X.create();if(Se&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,pr={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},hr=n.style.scrollBehavior,mr={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=gr(n,r);if(s=yr(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,pr),Object.assign(r.style,mr),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=hr)}function d(){u(),c.request(l)}l();let f=Y(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Sr=new class{lockCount=0;restore=null;timeoutLock=be.create();timeoutUnlock=be.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Z(e),n=t.documentElement,r=t.body,i=T(n);if(_r(i,n,r)){let t=new i.MutationObserver(()=>{_r(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=R||!vr(e);this.restore=a?br(e):xr(e)}};function Cr(e=!0,t=null){z(()=>{if(e)return Sr.acquire(t)},[e,t])}function wr(e){let t=G.useRef(``),n=G.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:G.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Tr(e,t){let n=G.useRef(e),r=p(t);z(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Er(e,t){let{onClick:n,onPointerDown:r}=wr(p((n,r)=>{(typeof e==`function`?e():e)||t(r||(R?`touch`:``))}));return G.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Dr(e){let[t,n]=G.useState(null),r=Er(e,n);return Tr(e,t=>{t&&!e&&n(null)}),G.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}export{Mt as $,Fn as A,xe as At,pn as B,On as C,Ae as Ct,Rn as D,Ce as Dt,Ln as E,we as Et,Cn as F,H as Ft,$t as G,ln as H,Sn as I,Xt as J,Zt as K,bn as L,En as M,he as Mt,Tn as N,ge as Nt,kn as O,Se as Ot,wn as P,de as Pt,Ft as Q,yn as R,Nn as S,Te as St,In as T,je as Tt,cn as U,fn as V,Qt as W,Wt as X,Kt as Y,Ut as Z,Yn as _,Pe as _t,fr as a,gt as at,An as b,Me as bt,ur as c,lt as ct,Qn as d,He as dt,jt as et,tr as f,Be as ft,Un as g,Re as gt,Hn as h,X as ht,Cr as i,vt as it,jn as j,ve as jt,zn as k,be as kt,cr as l,ut as lt,Xn as m,Z as mt,Er as n,It as nt,dr as o,mt as ot,Zn as p,Ve as pt,Yt as q,Tr as r,Rt as rt,lr as s,ot as st,Dr as t,Lt as tt,sr as u,dt as ut,Bn as v,Ne as vt,Mn as w,Oe as wt,Pn as x,ke as xt,Dn as y,Y as yt,hn as z};
2
+ //# sourceMappingURL=useOpenInteractionType-BFjAYgzR.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-hePW80VL.js";import{l as t,n,o as r,s as i}from"./atomRegistry-C1yW8tyM.js";var a=e({setWorkspaceReadinessPhase:()=>c,setWorkspaceReadinessPhaseForEnvironment:()=>l,workspaceReadinessByEnvironmentAtom:()=>s}),o=i(null).pipe(r,t(`workspace-readiness`)),s=i({}).pipe(r,t(`workspace-readiness-by-environment`));function c(e){if(e===null){n.set(o,null);return}let t=n.get(o);t!==null&&e.ts<t.ts||n.set(o,e)}function l(e,t){let r=n.get(s);if(t===null){let{[e]:t,...i}=r;n.set(s,i);return}let i=r[e]??null;i!==null&&t.ts<i.ts||n.set(s,{...r,[e]:t})}export{s as i,l as n,a as r,c as t};
2
- //# sourceMappingURL=workspaceReadinessAtom-D6bgTvKb.js.map
1
+ import{n as e}from"./rolldown-runtime-hePW80VL.js";import{l as t,n,o as r,s as i}from"./atomRegistry-CzI2zp7d.js";var a=e({setWorkspaceReadinessPhase:()=>c,setWorkspaceReadinessPhaseForEnvironment:()=>l,workspaceReadinessByEnvironmentAtom:()=>s}),o=i(null).pipe(r,t(`workspace-readiness`)),s=i({}).pipe(r,t(`workspace-readiness-by-environment`));function c(e){if(e===null){n.set(o,null);return}let t=n.get(o);t!==null&&e.ts<t.ts||n.set(o,e)}function l(e,t){let r=n.get(s);if(t===null){let{[e]:t,...i}=r;n.set(s,i);return}let i=r[e]??null;i!==null&&t.ts<i.ts||n.set(s,{...r,[e]:t})}export{s as i,l as n,a as r,c as t};
2
+ //# sourceMappingURL=workspaceReadinessAtom-BIm13kLJ.js.map
@@ -108,40 +108,42 @@
108
108
  }
109
109
  </style>
110
110
  <title>Forge</title>
111
- <script type="module" crossorigin src="/assets/index-BHReJBiJ.js"></script>
111
+ <script type="module" crossorigin src="/assets/index-BS4FABiE.js"></script>
112
112
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
113
- <link rel="modulepreload" crossorigin href="/assets/Stream-mUTFnSY9.js">
114
- <link rel="modulepreload" crossorigin href="/assets/atomRegistry-C1yW8tyM.js">
115
- <link rel="modulepreload" crossorigin href="/assets/CompositeItem-DTyKsv13.js">
116
- <link rel="modulepreload" crossorigin href="/assets/useOpenInteractionType-KsRrk6uH.js">
117
- <link rel="modulepreload" crossorigin href="/assets/src-B_wrKHuq.js">
113
+ <link rel="modulepreload" crossorigin href="/assets/Effect-CyyMOw4X.js">
114
+ <link rel="modulepreload" crossorigin href="/assets/Stream-Bvl2Z6qI.js">
115
+ <link rel="modulepreload" crossorigin href="/assets/atomRegistry-CzI2zp7d.js">
116
+ <link rel="modulepreload" crossorigin href="/assets/Schema-8EGdYSms.js">
117
+ <link rel="modulepreload" crossorigin href="/assets/src-7C4X1Oy2.js">
118
+ <link rel="modulepreload" crossorigin href="/assets/CompositeItem-D1GrQhpu.js">
119
+ <link rel="modulepreload" crossorigin href="/assets/useOpenInteractionType-BFjAYgzR.js">
118
120
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
119
- <link rel="modulepreload" crossorigin href="/assets/cmmdAuthRedirect-DRkKjx0G.js">
120
- <link rel="modulepreload" crossorigin href="/assets/utils-xQJ3ak-X.js">
121
- <link rel="modulepreload" crossorigin href="/assets/react-D4GEJ3ir.js">
122
- <link rel="modulepreload" crossorigin href="/assets/transport-CgH8pQK3.js">
121
+ <link rel="modulepreload" crossorigin href="/assets/cmmdEmbedMode-DhVvltxi.js">
122
+ <link rel="modulepreload" crossorigin href="/assets/cmmdAuthRedirect-CHlAAdAc.js">
123
+ <link rel="modulepreload" crossorigin href="/assets/react-A0DLYjwn.js">
123
124
  <link rel="modulepreload" crossorigin href="/assets/debouncer-BEV7Iuwb.js">
124
- <link rel="modulepreload" crossorigin href="/assets/cmmdForgeRuntimeListResource-Df9wlF4U.js">
125
- <link rel="modulepreload" crossorigin href="/assets/workspaceReadinessAtom-D6bgTvKb.js">
126
- <link rel="modulepreload" crossorigin href="/assets/themePalette-BWvBK22X.js">
127
- <link rel="modulepreload" crossorigin href="/assets/WorkerPoolContext-D_2lN-9Y.js">
128
- <link rel="modulepreload" crossorigin href="/assets/scroll-area-BHqISEYq.js">
129
- <link rel="modulepreload" crossorigin href="/assets/popover-ClRgm7hB.js">
130
- <link rel="modulepreload" crossorigin href="/assets/chevron-right-DAF000Jz.js">
131
- <link rel="modulepreload" crossorigin href="/assets/tooltip-CrS-TEbN.js">
132
- <link rel="modulepreload" crossorigin href="/assets/getPseudoElementBounds-DJTX-eyW.js">
133
- <link rel="modulepreload" crossorigin href="/assets/CompositeList-Bc8TYCyy.js">
134
- <link rel="modulepreload" crossorigin href="/assets/DiffWorkerPoolProvider-BbyQb-ye.js">
135
- <link rel="modulepreload" crossorigin href="/assets/Virtualizer-DX75f7Mw.js">
136
- <link rel="modulepreload" crossorigin href="/assets/canvasStateStore-DYt9MgFu.js">
137
- <link rel="modulepreload" crossorigin href="/assets/chevron-left-1XbEOuXj.js">
138
- <link rel="modulepreload" crossorigin href="/assets/minus-_j91i8bf.js">
139
- <link rel="modulepreload" crossorigin href="/assets/dialog-C0bK23D8.js">
140
- <link rel="modulepreload" crossorigin href="/assets/toggle-CORC1vE9.js">
141
- <link rel="modulepreload" crossorigin href="/assets/toggle-group-C9nAr6VB.js">
142
- <link rel="modulepreload" crossorigin href="/assets/sidebarV2CustomSnoozeDialog-lbAJoff_.js">
143
- <link rel="modulepreload" crossorigin href="/assets/currentForgeWorkspaceStore-CiCPSq18.js">
144
- <link rel="modulepreload" crossorigin href="/assets/switch-BWQHMJkU.js">
125
+ <link rel="modulepreload" crossorigin href="/assets/activeOrganizationId-CySrJzMX.js">
126
+ <link rel="modulepreload" crossorigin href="/assets/transport-CgH8pQK3.js">
127
+ <link rel="modulepreload" crossorigin href="/assets/workspaceReadinessAtom-BIm13kLJ.js">
128
+ <link rel="modulepreload" crossorigin href="/assets/themePalette-D4rx0k29.js">
129
+ <link rel="modulepreload" crossorigin href="/assets/WorkerPoolContext-gI2-7Koc.js">
130
+ <link rel="modulepreload" crossorigin href="/assets/scroll-area-BDuz0PnB.js">
131
+ <link rel="modulepreload" crossorigin href="/assets/popover-D8qvi5AD.js">
132
+ <link rel="modulepreload" crossorigin href="/assets/chevron-right-B103tjaJ.js">
133
+ <link rel="modulepreload" crossorigin href="/assets/tooltip-C_eHCky0.js">
134
+ <link rel="modulepreload" crossorigin href="/assets/getPseudoElementBounds-DBf0dPO9.js">
135
+ <link rel="modulepreload" crossorigin href="/assets/CompositeList-CEBk8sf_.js">
136
+ <link rel="modulepreload" crossorigin href="/assets/DiffWorkerPoolProvider-r1DUfA1d.js">
137
+ <link rel="modulepreload" crossorigin href="/assets/Virtualizer-DOL71mrP.js">
138
+ <link rel="modulepreload" crossorigin href="/assets/canvasStateStore-dUmp5NFj.js">
139
+ <link rel="modulepreload" crossorigin href="/assets/chevron-left-BXpfeqsT.js">
140
+ <link rel="modulepreload" crossorigin href="/assets/minus-CbEeUDFT.js">
141
+ <link rel="modulepreload" crossorigin href="/assets/dialog-BfhVD7Kq.js">
142
+ <link rel="modulepreload" crossorigin href="/assets/toggle--uJ9LmDV.js">
143
+ <link rel="modulepreload" crossorigin href="/assets/toggle-group-6UcL78FY.js">
144
+ <link rel="modulepreload" crossorigin href="/assets/sidebarV2CustomSnoozeDialog-pxOuwuY2.js">
145
+ <link rel="modulepreload" crossorigin href="/assets/currentForgeWorkspaceStore-eKCBxKgv.js">
146
+ <link rel="modulepreload" crossorigin href="/assets/switch-BeaQwtm7.js">
145
147
  <link rel="stylesheet" crossorigin href="/assets/index-CK6MAAUs.css">
146
148
  </head>
147
149
  <body>
@@ -1 +1 @@
1
- {"version":"0.14.1","commit":"c541d41e992712a7ab25a9ae28ee5e3815e77426"}
1
+ {"version":"0.14.2","commit":"a00cf0b653c5ad41933b286a3f108c74a8b61780"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import childProcess, { execFile } from "node:child_process";
4
4
  import fs from "node:fs";
5
- import os from "node:os";
5
+ import $U from "node:os";
6
6
  import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import process from "node:process";
@@ -49,7 +49,7 @@ function isInsideContainer() {
49
49
  //#region ../../node_modules/.bun/is-wsl@3.1.1/node_modules/is-wsl/index.js
50
50
  const isWsl = () => {
51
51
  if (process.platform !== "linux") return false;
52
- if (os.release().toLowerCase().includes("microsoft")) {
52
+ if ($U.release().toLowerCase().includes("microsoft")) {
53
53
  if (isInsideContainer()) return false;
54
54
  return true;
55
55
  }
@@ -589,4 +589,4 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari"
589
589
  //#endregion
590
590
  export { apps, open as default, openApp };
591
591
 
592
- //# sourceMappingURL=open-yHTUkd2Y.mjs.map
592
+ //# sourceMappingURL=open-2-reBrpv.mjs.map
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "cmmd-forge": "dist/bin.mjs"
10
10
  },
11
11
  "type": "module",
12
- "version": "0.14.1",
12
+ "version": "0.14.2",
13
13
  "engines": {
14
14
  "node": "^22.16 || ^23.11 || >=24.10"
15
15
  },
@@ -1,2 +0,0 @@
1
- import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{Wa as n}from"./Stream-mUTFnSY9.js";var r=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{var t=n(),r=i();function a(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var o=typeof Object.is==`function`?Object.is:a,s=r.useSyncExternalStore,c=t.useRef,l=t.useEffect,u=t.useMemo,d=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=c(null);if(a.current===null){var f={hasValue:!1,value:null};a.current=f}else f=a.current;a=u(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,o(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var a=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=s(e,a[0],a[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),d(p),p}})),o=t(((e,t)=>{t.exports=a()}));function s(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var c={};function l(e,t,n,r,i){if(!n&&!r&&!i&&!e)return d(t);let a=d(e);return t&&(a=f(a,t)),n&&(a=f(a,n)),r&&(a=f(a,r)),i&&(a=f(a,i)),a}function u(e){if(e.length===0)return c;if(e.length===1)return d(e[0]);let t=d(e[0]);for(let n=1;n<e.length;n+=1)t=f(t,e[n]);return t}function d(e){return g(e)?{..._(e,c)}:p(e)}function f(e,t){return g(t)?_(t,e):m(e,t)}function p(e){let t={...e};for(let e in t){let n=t[e];h(e,n)&&(t[e]=y(n))}return t}function m(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=s(e.style,r);break;case`className`:e[n]=ee(e.className,r);break;default:e[n]=h(n,r)?v(e[n],r):r}}return e}function h(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function g(e){return typeof e==`function`}function _(e,t){return g(e)?e(t):e??c}function v(e,t){return t?e?(...n)=>{let r=n[0];if(x(r)){let i=r;b(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:y(t):e}function y(e){return e&&((...t)=>{let n=t[0];return x(n)&&b(n),e(...t)})}function b(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ee(e,t){return t?e?t+` `+e:t:e}function x(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}var S=e(n(),1);function te(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var C=te(`https://base-ui.com/production-error`,`Base UI`),ne={};function w(e,t){let n=S.useRef(ne);return n.current===ne&&(n.current=e(t)),n}function T(e,t,n,r){let i=w(ie).current;return ae(i,e,t,n,r)&&se(i,[e,t,n,r]),i.callback}function re(e){let t=w(ie).current;return oe(t,e)&&se(t,e),t.callback}function ie(){return{callback:null,cleanup:null,refs:[]}}function ae(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function oe(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function se(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var ce=19;function le(e){return ce>=e}function ue(e){if(!S.isValidElement(e))return null;let t=e,n=t.props;return(le(19)?n?.ref:t.ref)??null}function de(){}var E=Object.freeze([]),D=Object.freeze({});function fe(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function pe(e,t){return typeof e==`function`?e(t):e}function me(e,t){return typeof e==`function`?e(t):e}function he(e,t,n={}){let r=t.render,i=ge(t,n);return n.enabled===!1?null:ye(e,r,i,n.state??D)}function ge(e,t={}){let{className:n,style:r,render:i}=e,{state:a=D,ref:o,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?pe(n,a):void 0,f=u?me(r,a):void 0,p=u?fe(a,l):D,m=u&&c?_e(c):void 0,h=u?s(p,m)??{}:D;return typeof document<`u`&&(u?h.ref=Array.isArray(o)?re([h.ref,ue(i),...o]):T(h.ref,ue(i),o):T(null,null)),u?(d!==void 0&&(h.className=ee(h.className,d)),f!==void 0&&(h.style=s(h.style,f)),h):D}function _e(e){return Array.isArray(e)?u(e):l(void 0,e)}var ve=Symbol.for(`react.lazy`);function ye(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=l(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===ve&&(i=S.Children.toArray(t)[0]),S.cloneElement(i,e)}if(e&&typeof e==`string`)return be(e,n);throw Error(C(8))}function be(e,t){return e===`button`?(0,S.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,S.createElement)(`img`,{alt:``,...t,key:t.key}):S.createElement(e,t)}var xe=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Se=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ce=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),we=e=>{let t=Ce(e);return t.charAt(0).toUpperCase()+t.slice(1)},Te={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},De=(0,S.createContext)({}),Oe=()=>(0,S.useContext)(De),ke=(0,S.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Oe()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,S.createElement)(`svg`,{ref:c,...Te,width:t??l??Te.width,height:t??l??Te.height,stroke:e??f,strokeWidth:m,className:xe(`lucide`,p,i),...!a&&!Ee(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,S.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ae=(e,t)=>{let n=(0,S.forwardRef)(({className:n,...r},i)=>(0,S.createElement)(ke,{ref:i,iconNode:t,className:xe(`lucide-${Se(we(e))}`,`lucide-${e}`,n),...r}));return n.displayName=we(e),n},je=typeof document<`u`?S.useLayoutEffect:()=>{};function Me(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ne,platform:Pe,maxTouchPoints:Fe}=Me(),O=Ne.toLowerCase(),k=Pe.toLowerCase(),A=/^i(os$|p)/.test(k)||k===`macintel`&&Fe>1,Ie=`android`,j=k===Ie||O.includes(Ie),Le=!A&&k.startsWith(`mac`);k.startsWith(`win`),!j&&/^(linux|chrome os)/.test(k);var Re=Le||A,ze=/jsdom|happydom/.test(O);function M(e){e.preventDefault(),e.stopPropagation()}function Be(e){return`nativeEvent`in e}function Ve(e){return e.pointerType===``&&e.isTrusted?!0:j&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function He(e){return ze?!1:!j&&e.width===0&&e.height===0||j&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ue(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function We(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function N(){return typeof window<`u`}function P(e){return Ke(e)?(e.nodeName||``).toLowerCase():`#document`}function F(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ge(e){return((Ke(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ke(e){return N()?e instanceof Node||e instanceof F(e).Node:!1}function qe(e){return N()?e instanceof Element||e instanceof F(e).Element:!1}function I(e){return N()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function L(e){return!N()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function Je(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ye(e){return/^(table|td|th)$/.test(P(e))}function Xe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ze=/transform|translate|scale|rotate|perspective|filter/,Qe=/paint|layout|strict|content/,R=e=>!!e&&e!==`none`,$e;function et(e){let t=qe(e)?z(e):e;return R(t.transform)||R(t.translate)||R(t.scale)||R(t.rotate)||R(t.perspective)||!nt()&&(R(t.backdropFilter)||R(t.filter))||Ze.test(t.willChange||``)||Qe.test(t.contain||``)}function tt(e){let t=B(e);for(;I(t)&&!rt(t);){if(et(t))return t;if(Xe(t))return null;t=B(t)}return null}function nt(){return $e??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),$e}function rt(e){return/^(html|body|#document)$/.test(P(e))}function z(e){return F(e).getComputedStyle(e)}function it(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function B(e){if(P(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||L(e)&&e.host||Ge(e);return L(t)?t.host:t}function at(e){let t=B(e);return rt(t)?(e.ownerDocument||e).body:I(t)&&Je(t)?t:at(t)}function V(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=at(e),i=r===e.ownerDocument?.body,a=F(r);if(i){let e=ot(a);return t.concat(a,a.visualViewport||[],Je(r)?r:[],e&&n?V(e):[])}return t.concat(r,V(r,[],n))}function ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var st=`data-base-ui-focusable`,ct=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,lt=`ArrowLeft`,ut=`ArrowRight`,dt=`ArrowUp`,ft=`ArrowDown`;function pt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function mt(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&L(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ht(e){return`composedPath`in e?e.composedPath()[0]:e.target}var gt=`none`,_t=`trigger-press`,vt=`trigger-hover`,yt=`trigger-focus`,bt=`outside-press`,xt=`item-press`,St=`close-press`,Ct=`clear-press`,wt=`chip-remove-press`,Tt=`increment-press`,Et=`decrement-press`,Dt=`input-change`,Ot=`input-clear`,kt=`input-blur`,At=`input-paste`,jt=`input-press`,Mt=`focus-out`,Nt=`escape-key`,Pt=`list-navigation`,Ft=`keyboard`,It=`pointer`,Lt=`wheel`,Rt=`cancel-open`,zt=`sibling-open`,Bt=`disabled`,Vt=`imperative-action`,Ht=`window-resize`;function Ut(e,t,n,r){let i=!1,a=!1,o=r??D;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Wt(e,t,n){let r=n??D;return{reason:e,event:t??new Event(`base-ui`),...r}}var H={...S},U=H.useInsertionEffect,Gt=U&&U!==H.useLayoutEffect?U:e=>e();function Kt(e){let t=w(qt).current;return t.next=e,Gt(t.effect),t.trampoline}function qt(){let e={next:void 0,callback:Jt,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Jt(){}var Yt=Math.min,Xt=Math.max,Zt=Math.round,W=Math.floor,Qt=e=>({x:e,y:e}),$t={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function en(e,t,n){return Xt(e,Yt(t,n))}function tn(e,t){return typeof e==`function`?e(t):e}function G(e){return e.split(`-`)[0]}function K(e){return e.split(`-`)[1]}function nn(e){return e===`x`?`y`:`x`}function rn(e){return e===`y`?`height`:`width`}function an(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function on(e){return nn(an(e))}function sn(e,t,n){n===void 0&&(n=!1);let r=K(e),i=on(e),a=rn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=J(o)),[o,J(o)]}function cn(e){let t=J(e);return[q(e),t,q(t)]}function q(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ln=[`left`,`right`],un=[`right`,`left`],dn=[`top`,`bottom`],fn=[`bottom`,`top`];function pn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?un:ln:t?ln:un;case`left`:case`right`:return t?dn:fn;default:return[]}}function mn(e,t,n,r){let i=K(e),a=pn(G(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(q)))),a}function J(e){let t=G(e);return $t[t]+e.slice(t.length)}function hn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function gn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:hn(e)}function _n(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Y(e,t,n){return Math.floor(e/t)!==n}function vn(e,t){return t<0||t>=e.length}function yn(e,t){return X(e.current,{disabledIndices:t})}function bn(e,t){return X(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function X(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Z(e,a,r));return a}function xn(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Z(e,n,s))return n}}},ee=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=W(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Z(e,r,s))return r}};d&&M(t);let x=b(p)??ee(p);if(x!==void 0)f=x;else if(u===-1)f=p===`up`?l:c;else if(f=X(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=X(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}vn(e,f)&&(f=u)}if(n===`both`){let n=W(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&M(t),u%o===o-1?r&&(f=X(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=X(e,{startingIndex:u,disabledIndices:s}),r&&Y(f,o,n)&&(f=X(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Y(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&M(t),u%o===0?r&&(f=X(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=X(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Y(f,o,n)&&(f=X(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Y(f,o,n)&&(f=u));let c=W(l/o)===n;vn(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:X(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Z(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Cn(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Sn(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Cn(e,t=e?z(e):null){return!e||!e.isConnected||!t||Sn(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var wn=0;function Tn(e,t=`mui`){let[n,r]=S.useState(e),i=e||n;return S.useEffect(()=>{n??(wn+=1,r(`${t}-${wn}`))},[n,t]),i}var En=H.useId;function Dn(e,t){if(En!==void 0){let n=En();return e??(t?`${t}-${n}`:n)}return Tn(e,t)}function On(e){return Dn(e,`base-ui`)}var kn=S.createContext(void 0);function An(){return S.useContext(kn)?.direction??`ltr`}var jn=S.createContext(void 0);function Mn(e=!1){let t=S.useContext(jn);if(t===void 0&&!e)throw Error(C(16));return t}function Nn(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:S.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Q(e,t,{detail:n=0}={}){e.dispatchEvent(new(F(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Pn(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=S.useRef(null),s=Mn(!0),c=a??s!==void 0,{props:u}=Nn({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),d=S.useCallback(()=>{let e=o.current;Fn(e)&&c&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,c]);return je(d,[d]),{getButtonProps:S.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...d}=e;return l({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(b(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Fn(r),s=!i&&In(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Q(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Q(r,e)))},onKeyUp(e){if(!t){if(b(e),a?.(e),e.target===e.currentTarget&&i&&c&&Fn(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Q(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},u,d)},[t,u,c,i]),buttonRef:Kt(e=>{o.current=e,d()})}}function Fn(e){return I(e)&&e.tagName===`BUTTON`}function In(e){return I(e)&&e.tagName===`A`&&!!e.href}function Ln({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=S.useRef(e!==void 0),[a,o]=S.useState(t);return[i?e:a,S.useCallback(e=>{i||o(e)},[])]}var Rn=`ArrowUp`,zn=`ArrowDown`,Bn=`ArrowLeft`,Vn=`ArrowRight`,Hn=`Home`,Un=new Set([Rn,zn,Bn,Vn,Hn,`End`]),Wn=[`Shift`,`Control`,`Alt`,`Meta`];function Gn(e){return I(e)&&e.tagName===`INPUT`}function Kn(e){return!!(Gn(e)&&e.selectionStart!=null||I(e)&&e.tagName===`TEXTAREA`)}function qn(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Jn(e,t,`left`),a=$(e),o=$(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Jn(e,t,`top`),r=$(e),i=$(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Jn(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function $(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Yn=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Xn(){return S.useContext(Yn)}function Zn(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Xn(),u=S.useRef(-1),[d,f]=S.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=S.useRef(null),h=S.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return je(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Qn=S.createContext(void 0);function $n(e){let t=S.useContext(Qn);if(t===void 0&&!e)throw Error(C(69));return t}function er(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Mn(),{ref:i,index:a}=Zn(e),o=n===a,s=S.useRef(null),c=T(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function tr(e){let{render:t,className:n,style:r,state:i=D,props:a=E,refs:o=E,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=er({metadata:s});return he(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}export{Ct as $,Ue as $t,Qt as A,dt as At,J as B,B as Bt,xn as C,i as Cn,Ht as Ct,vn as D,ft as Dt,Cn as E,ht as Et,sn as F,Ge as Ft,Yt as G,rt as Gt,G as H,et as Ht,rn as I,ot as It,Kt as J,L as Jt,_n as K,Ke as Kt,cn as L,P as Lt,W as M,ct as Mt,K as N,z as Nt,Z as O,lt as Ot,on as P,tt as Pt,wt as Q,We as Qt,nn as R,it as Rt,X as S,o as Sn,Lt as St,yn as T,mt as Tt,an as U,qe as Ut,gn as V,F as Vt,Xt as W,I as Wt,Wt as X,Xe as Xt,Ut as Y,Ye as Yt,Rt as Z,nt as Zt,jn as _,le as _n,It as _t,zn as a,j as an,Vt as at,On as b,C as bn,vt as bt,Rn as c,Le as cn,Dt as ct,Wn as d,Ae as dn,jt as dt,Be as en,St as et,Kn as f,he as fn,xt as ft,Q as g,de as gn,bt as gt,Pn as h,D as hn,gt as ht,Yn as i,ze as in,Mt as it,tn as j,st as jt,en as k,ut as kt,Un as l,O as ln,Ot as lt,Ln as m,E as mn,Pt as mt,$n as n,He as nn,Bt as nt,Bn as o,Re as on,Tt as ot,qn as p,me as pn,Ft as pt,Zt as q,Je as qt,Zn as r,M as rn,Nt as rt,Vn as s,A as sn,kt as st,tr as t,Ve as tn,Et as tt,Hn as u,je as un,At as ut,Mn as v,T as vn,zt as vt,bn as w,pt as wt,Dn as x,l as xn,_t as xt,An as y,w as yn,yt,mn as z,V as zt};
2
- //# sourceMappingURL=CompositeItem-DTyKsv13.js.map
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ua as t,Wa as n}from"./Stream-mUTFnSY9.js";import{J as r,fn as i,i as a,un as o,yn as s}from"./CompositeItem-DTyKsv13.js";var c=e(n(),1),l=c.forwardRef(function(e,t){let{className:n,render:r,orientation:a=`horizontal`,style:o,...s}=e;return i(`div`,e,{state:{orientation:a},ref:t,props:[{role:`separator`,"aria-orientation":a},s]})}),u=t();function d(e){let{children:t,elementsRef:n,labelsRef:i,onMapChange:l}=e,d=r(l),[,v]=c.useState(!1),y=s(p).current,b=s(f).current,x=c.useRef(0),S=c.useRef(!0),C=c.useRef([]),w=c.useRef(null),T=r(()=>{S.current||(S.current=!0,v(e=>!e))}),E=r((e,t)=>{b.set(e,t),T()}),D=r(e=>{b.delete(e),T()}),O=r(e=>{let t=new Map;return n.current.length=0,i&&(i.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,i&&(i.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),x.current=n.current.length,t});function k(e){if(w.current?.disconnect(),w.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!g(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&_(r,n)>0){t.disconnect(),T();return}r=n}});w.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=h(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let A=r(()=>{let[e,t]=m(b),n=O(e);k(t),C.current=e,S.current=!1,y.forEach(e=>e(n)),d(n)});o(()=>(S.current||O(C.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,O]),o(()=>{S.current&&A()}),o(()=>()=>{w.current?.disconnect(),S.current=!0},[]);let j=r(e=>(y.add(e),()=>{y.delete(e)})),M=c.useMemo(()=>({register:E,unregister:D,subscribeMapChange:j,nextIndexRef:x}),[E,D,j,x]);return(0,u.jsx)(a.Provider,{value:M,children:t})}function f(){return new Map}function p(){return new Set}function m(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>_(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function h(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function g(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function _(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}export{l as n,d as t};
2
- //# sourceMappingURL=CompositeList-Bc8TYCyy.js.map
@@ -1,64 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ha as t,Mi as n,Ua as r,Wa as i}from"./Stream-mUTFnSY9.js";import{Kr as a,Lr as o,Ls as s,Nn as c,Qn as l,Tn as u,Vn as d,Wn as f,Yo as p,c as m,d as h,fn as g,kn as _,m as v,ns as y,o as b,pi as x,qn as S,qt as C,s as w,t as T,ts as E,u as D,zn as O}from"./WorkerPoolContext-D_2lN-9Y.js";import{a as k,c as A,i as j,l as M,n as N,o as P,r as F,s as I,t as L}from"./Virtualizer-DX75f7Mw.js";import{H as R,Hn as z,Wn as ee,j as B}from"./cmmdForgeRuntimeListResource-Df9wlF4U.js";import{On as V,at as H,ot as U}from"./src-B_wrKHuq.js";import"./cmmdAuthRedirect-DRkKjx0G.js";import{t as W}from"./utils-xQJ3ak-X.js";import{t as G}from"./chevron-left-1XbEOuXj.js";import{t as K}from"./chevron-right-DAF000Jz.js";import{a as q,c as te,d as ne,h as re,i as ie,l as ae,m as oe,n as se,o as J,p as ce,r as le,s as ue,t as de,u as fe}from"./DiffPanel.logic-CAb-hngG.js";import{n as pe,t as Y}from"./toggle-group-C9nAr6VB.js";var X=e(i(),1),me=typeof window>`u`?X.useEffect:X.useLayoutEffect;function he({fileDiff:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:a,metrics:o,hasGutterRenderUtility:s,hasCustomHeader:c,disableWorkerPool:l,edit:u}){let d=N(),f=i!==void 0,p=(0,X.useContext)(T),h=w(),g=(0,X.useRef)(null),_=m(n=>{if(n!=null){if(g.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);d==null?g.current=new ne(Z({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),l?void 0:p,!0):g.current=new fe(Z({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),d,o,l?void 0:p,!0),g.current.hydrate({fileDiff:e,fileContainer:n,lineAnnotations:r,prerenderedHTML:a})}else{if(g.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);g.current.cleanUp(),g.current=null}});return me(()=>{let{current:n}=g;if(n==null)return;let a=Z({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),o=a!==void 0&&!C(n.options,a);n.setOptions(a),n.render({forceRender:o,fileDiff:e,lineAnnotations:r}),i!==void 0&&n.setSelectedLines(i)}),me(()=>{if(u&&g.current!=null){if(h===void 0)throw Error(`FileDiff: EditContext is not attached`);let e=h(n??{});if(e==null)throw Error(`FileDiff: EditProvider.createEditor must return an editor instance`);try{return e.edit(g.current)}catch(t){throw e.cleanUp(),t}}},[u]),{ref:_,getHoveredLine:(0,X.useCallback)(()=>g.current?.getHoveredLine(),[])}}function Z({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?b:e?.renderCustomHeader,renderGutterUtility:r?b:e?.renderGutterUtility}:e}var Q=r();function ge({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:i,selectedLines:a,className:o,style:s,prerenderedHTML:c,renderAnnotation:l,renderCustomHeader:u,renderHeaderPrefix:d,renderHeaderFilenameSuffix:f,renderHeaderMetadata:p,renderGutterUtility:m,disableWorkerPool:h=!1,edit:_=!1}){let{ref:v,getHoveredLine:y}=he({fileDiff:e,options:t,editorOptions:n,metrics:r,lineAnnotations:i,selectedLines:a,prerenderedHTML:c,hasGutterRenderUtility:m!=null,hasCustomHeader:u!=null,disableWorkerPool:h,edit:_});return(0,Q.jsx)(g,{ref:v,className:o,style:s,children:F(ae({fileDiff:e,renderCustomHeader:u,renderHeaderPrefix:d,renderHeaderFilenameSuffix:f,renderHeaderMetadata:p,renderAnnotation:l,renderGutterUtility:m,lineAnnotations:i,getHoveredLine:y}),c)})}var $=t();function _e(e){return e.fromTurnCount===0?V(H)({threadId:e.threadId,toTurnCount:e.toTurnCount}).pipe(n(e=>({kind:`fullThreadDiff`,input:e}))):V(U)({threadId:e.threadId,fromTurnCount:e.fromTurnCount,toTurnCount:e.toTurnCount}).pipe(n(e=>({kind:`turnDiff`,input:e})))}function ve(e){return e instanceof Error?e.message:typeof e==`string`?e:``}function ye(e){let t=ve(e).trim();if(t.length===0)return`Failed to load checkpoint diff.`;let n=t.toLowerCase();if(n.includes(`not a git repository`))return`Turn diffs are unavailable because this project is not a git repository.`;if(n.includes(`checkpoint unavailable for thread`)||n.includes(`checkpoint invariant violation`)){let e=t.indexOf(`:`);if(e>=0){let n=t.slice(e+1).trim();if(n.length>0)return n}}return t}function be(e){let t=ve(e).toLowerCase();return t.includes(`exceeds current turn count`)||t.includes(`checkpoint is unavailable for turn`)||t.includes(`filesystem checkpoint is unavailable`)}function xe(e){let t=_e(e);return E({queryKey:p.checkpointDiff(e),queryFn:async({signal:n})=>{if(!e.environmentId||!e.threadId||t._tag===`None`)throw Error(`Checkpoint diff is unavailable.`);let r=l(e.environmentId);try{return t.value.kind===`fullThreadDiff`?await r.orchestration.getFullThreadDiff(t.value.input,{signal:n}):await r.orchestration.getTurnDiff(t.value.input,{signal:n})}catch(e){throw Error(ye(e),{cause:e})}},enabled:(e.enabled??!0)&&!!e.environmentId&&!!e.threadId&&t._tag===`Some`,staleTime:1/0,retry:(e,t)=>be(t)?e<12:e<3,retryDelay:(e,t)=>be(t)?Math.min(5e3,250*2**(e-1)):Math.min(1e3,100*2**(e-1))})}function Se(e){if(!(!e.canScrollLeft&&!e.canScrollRight))return{maskImage:`linear-gradient(to right, ${e.canScrollLeft?`transparent 24px, black 72px`:`black`}, ${e.canScrollRight?`black calc(100% - 72px), transparent calc(100% - 24px)`:`black`})`}}function Ce(e){return e instanceof Error?e.message:e?`Failed to load checkpoint diff.`:null}function we(e){return{environmentId:e.environmentId??null,threadId:e.threadId,fromTurnCount:e.range?.fromTurnCount??null,toTurnCount:e.range?.toTurnCount??null,cacheScope:e.selectedTurnId?`turn:${e.selectedTurnId}`:e.conversationCacheScope,enabled:e.enabled}}function Te(){let e=(0,$.c)(8),t=(0,X.useRef)(null),[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(!1),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=t.current;if(!e){r(!1),a(!1);return}let n=ue({scrollLeft:e.scrollLeft,scrollWidth:e.scrollWidth,clientWidth:e.clientWidth});r(n.canScrollLeft),a(n.canScrollRight)},e[0]=o):o=e[0];let s=o,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{t.current?.scrollBy({left:e,behavior:`smooth`})},e[1]=c):c=e[1];let l=c,u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let n=t.current;n&&te({scrollWidth:n.scrollWidth,clientWidth:n.clientWidth,deltaX:e.deltaX,deltaY:e.deltaY})&&(e.preventDefault(),n.scrollBy({left:e.deltaY,behavior:`auto`}))},e[2]=u):u=e[2];let d=u,f,p;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=t.current;if(!e)return;let n=window.requestAnimationFrame(s),r=()=>s();e.addEventListener(`scroll`,r,{passive:!0});let i=new ResizeObserver(()=>s());return i.observe(e),()=>{window.cancelAnimationFrame(n),e.removeEventListener(`scroll`,r),i.disconnect()}},p=[s],e[3]=f,e[4]=p):(f=e[3],p=e[4]),(0,X.useEffect)(f,p);let m;return e[5]!==n||e[6]!==i?(m={ref:t,canScrollLeft:n,canScrollRight:i,scrollBy:l,onWheel:d,remeasure:s},e[5]=n,e[6]=i,e[7]=m):m=e[7],m}function Ee(e,t){let n=(0,$.c)(5),r;n[0]===e.current?r=n[1]:(r=()=>{(e.current?.querySelector(`[data-turn-chip-selected='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`smooth`})},n[0]=e.current,n[1]=r);let i;n[2]!==e||n[3]!==t?(i=[e,t],n[2]=e,n[3]=t,n[4]=i):i=n[4],(0,X.useEffect)(r,i)}var De=`
2
- [data-diffs-header],
3
- [data-diff],
4
- [data-file],
5
- [data-error-wrapper],
6
- [data-virtualizer-buffer] {
7
- --diffs-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
8
- --diffs-light-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
9
- --diffs-dark-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
10
- --diffs-token-light-bg: transparent;
11
- --diffs-token-dark-bg: transparent;
12
-
13
- --diffs-bg-context-override: color-mix(in srgb, var(--background) 97%, var(--foreground));
14
- --diffs-bg-hover-override: color-mix(in srgb, var(--background) 94%, var(--foreground));
15
- --diffs-bg-separator-override: color-mix(in srgb, var(--background) 95%, var(--foreground));
16
- --diffs-bg-buffer-override: color-mix(in srgb, var(--background) 90%, var(--foreground));
17
-
18
- --diffs-bg-addition-override: color-mix(in srgb, var(--background) 92%, var(--success));
19
- --diffs-bg-addition-number-override: color-mix(in srgb, var(--background) 88%, var(--success));
20
- --diffs-bg-addition-hover-override: color-mix(in srgb, var(--background) 85%, var(--success));
21
- --diffs-bg-addition-emphasis-override: color-mix(in srgb, var(--background) 80%, var(--success));
22
-
23
- --diffs-bg-deletion-override: color-mix(in srgb, var(--background) 92%, var(--destructive));
24
- --diffs-bg-deletion-number-override: color-mix(in srgb, var(--background) 88%, var(--destructive));
25
- --diffs-bg-deletion-hover-override: color-mix(in srgb, var(--background) 85%, var(--destructive));
26
- --diffs-bg-deletion-emphasis-override: color-mix(
27
- in srgb,
28
- var(--background) 80%,
29
- var(--destructive)
30
- );
31
-
32
- background-color: var(--diffs-bg) !important;
33
- }
34
-
35
- [data-file-info] {
36
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
37
- border-block-color: var(--border) !important;
38
- color: var(--foreground) !important;
39
- }
40
-
41
- [data-diffs-header] {
42
- position: sticky !important;
43
- top: 0;
44
- z-index: 4;
45
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
46
- border-bottom: 1px solid var(--border) !important;
47
- }
48
-
49
- [data-title] {
50
- cursor: pointer;
51
- transition:
52
- color 120ms ease,
53
- text-decoration-color 120ms ease;
54
- text-decoration: underline;
55
- text-decoration-color: transparent;
56
- text-underline-offset: 2px;
57
- }
58
-
59
- [data-title]:hover {
60
- color: color-mix(in srgb, var(--foreground) 84%, var(--primary)) !important;
61
- text-decoration-color: currentColor;
62
- }
63
- `;function Oe(e){let t=(0,$.c)(44),{mode:n}=e,r=n===void 0?`inline`:n,{resolvedTheme:i}=c(),o=a(),[s,l]=(0,X.useState)(`stacked`),[d,f]=(0,X.useState)(o.diffWordWrap),p=(0,X.useRef)(null),m=(0,X.useRef)(!1),g=Te(),{activeCwd:v,activeThread:y,bodyState:b,diffOpen:x,inferredCheckpointTurnCountByTurnId:C,orderedTurnDiffSummaries:w,renderableFiles:T,renderablePatch:E,selectedFilePath:D,selectedTurn:k,selectedTurnId:A}=Le(i),j,M;t[0]!==x||t[1]!==o.diffWordWrap?(j=()=>{x&&!m.current&&f(o.diffWordWrap),m.current=x},M=[x,o.diffWordWrap],t[0]=x,t[1]=o.diffWordWrap,t[2]=j,t[3]=M):(j=t[2],M=t[3]),(0,X.useEffect)(j,M);let N;t[4]===D?N=t[5]:(N=()=>{!D||!p.current||Array.from(p.current.querySelectorAll(`[data-diff-file-path]`)).find(e=>e.dataset.diffFilePath===D)?.scrollIntoView({block:`nearest`})},t[4]=D,t[5]=N);let P;t[6]!==T||t[7]!==D?(P=[D,T],t[6]=T,t[7]=D,t[8]=P):P=t[8],(0,X.useEffect)(N,P);let F;t[9]===v?F=t[10]:(F=e=>{let t=O();if(!t)return;let n=v?u(e,v):e;_(t,n).catch(ke)},t[9]=v,t[10]=F);let I=F,L;t[11]===y?L=t[12]:(L=e=>{y&&S.getState().openDiff(ee(z(y.environmentId,y.id)),e)},t[11]=y,t[12]=L);let R=L,B;t[13]===y?B=t[14]:(B=()=>{y&&S.getState().openDiff(ee(z(y.environmentId,y.id)))},t[13]=y,t[14]=B);let V=B,H;t[15]===g.remeasure?H=t[16]:(H=()=>{let e=window.requestAnimationFrame(g.remeasure);return()=>window.cancelAnimationFrame(e)},t[15]=g.remeasure,t[16]=H);let U;t[17]!==w||t[18]!==A||t[19]!==g.remeasure?(U=[w,A,g.remeasure],t[17]=w,t[18]=A,t[19]=g.remeasure,t[20]=U):U=t[20],(0,X.useEffect)(H,U),Ee(g.ref,k?.turnId??A);let W;t[21]!==s||t[22]!==d||t[23]!==C||t[24]!==w||t[25]!==R||t[26]!==V||t[27]!==k||t[28]!==A||t[29]!==o||t[30]!==g?(W=(0,Q.jsx)(Ae,{diffRenderMode:s,diffWordWrap:d,inferredCheckpointTurnCountByTurnId:C,orderedTurnDiffSummaries:w,selectTurn:R,selectWholeConversation:V,selectedTurn:k,selectedTurnId:A,setDiffRenderMode:l,setDiffWordWrap:f,settings:o,turnStrip:g}),t[21]=s,t[22]=d,t[23]=C,t[24]=w,t[25]=R,t[26]=V,t[27]=k,t[28]=A,t[29]=o,t[30]=g,t[31]=W):W=t[31];let G=W,K;t[32]!==b||t[33]!==s||t[34]!==d||t[35]!==I||t[36]!==T||t[37]!==E||t[38]!==i?(K=(0,Q.jsx)(je,{bodyState:b,diffRenderMode:s,diffWordWrap:d,openDiffFileInEditor:I,patchViewportRef:p,renderableFiles:T,renderablePatch:E,resolvedTheme:i}),t[32]=b,t[33]=s,t[34]=d,t[35]=I,t[36]=T,t[37]=E,t[38]=i,t[39]=K):K=t[39];let q;return t[40]!==G||t[41]!==r||t[42]!==K?(q=(0,Q.jsx)(h,{mode:r,header:G,children:K}),t[40]=G,t[41]=r,t[42]=K,t[43]=q):q=t[43],q}function ke(e){console.warn(`Failed to open diff file in editor.`,e)}function Ae(e){let t=(0,$.c)(59),{diffRenderMode:n,diffWordWrap:r,inferredCheckpointTurnCountByTurnId:i,orderedTurnDiffSummaries:a,selectTurn:o,selectWholeConversation:s,selectedTurn:c,selectedTurnId:l,setDiffRenderMode:u,setDiffWordWrap:d,settings:f,turnStrip:p}=e,m,h;t[0]===p?(m=t[1],h=t[2]):(m=(0,Q.jsx)(Be,{direction:`left`,strip:p}),h=(0,Q.jsx)(Be,{direction:`right`,strip:p}),t[0]=p,t[1]=m,t[2]=h);let g=p.ref,_;t[3]!==p.canScrollLeft||t[4]!==p.canScrollRight?(_=Se({canScrollLeft:p.canScrollLeft,canScrollRight:p.canScrollRight}),t[3]=p.canScrollLeft,t[4]=p.canScrollRight,t[5]=_):_=t[5];let v=p.onWheel,y=l===null,b=l===null?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`,x;t[6]===b?x=t[7]:(x=W(`rounded-md border px-2 py-1 text-left transition-colors`,b),t[6]=b,t[7]=x);let S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(`div`,{className:`text-[10px] leading-tight font-medium`,children:`All turns`}),t[8]=S):S=t[8];let C;t[9]===x?C=t[10]:(C=(0,Q.jsx)(`div`,{className:x,children:S}),t[9]=x,t[10]=C);let w;t[11]!==s||t[12]!==C||t[13]!==y?(w=(0,Q.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:s,"data-turn-chip-selected":y,children:C}),t[11]=s,t[12]=C,t[13]=y,t[14]=w):w=t[14];let T;if(t[15]!==i||t[16]!==a||t[17]!==o||t[18]!==c?.turnId||t[19]!==f){let e;t[21]!==i||t[22]!==o||t[23]!==c?.turnId||t[24]!==f?(e=e=>(0,Q.jsx)(Ve,{summary:e,selected:e.turnId===c?.turnId,turnCount:e.checkpointTurnCount??i[e.turnId],timestampFormat:f.timestampFormat,onSelect:o},e.turnId),t[21]=i,t[22]=o,t[23]=c?.turnId,t[24]=f,t[25]=e):e=t[25],T=a.map(e),t[15]=i,t[16]=a,t[17]=o,t[18]=c?.turnId,t[19]=f,t[20]=T}else T=t[20];let E;t[26]!==w||t[27]!==T||t[28]!==_||t[29]!==p.onWheel||t[30]!==p.ref?(E=(0,Q.jsxs)(`div`,{ref:g,className:`turn-chip-strip flex gap-1 overflow-x-auto px-8 py-0.5`,style:_,onWheel:v,children:[w,T]}),t[26]=w,t[27]=T,t[28]=_,t[29]=p.onWheel,t[30]=p.ref,t[31]=E):E=t[31];let D;t[32]!==m||t[33]!==E||t[34]!==h?(D=(0,Q.jsxs)(`div`,{className:`relative min-w-0 flex-1 [-webkit-app-region:no-drag]`,children:[m,h,E]}),t[32]=m,t[33]=E,t[34]=h,t[35]=D):D=t[35];let O;t[36]===n?O=t[37]:(O=[n],t[36]=n,t[37]=O);let k;t[38]===u?k=t[39]:(k=e=>{let t=e[0];(t===`stacked`||t===`split`)&&u(t)},t[38]=u,t[39]=k);let A;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(Y,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,Q.jsx)(oe,{className:`size-3`})}),t[40]=A):A=t[40];let j;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(Y,{"aria-label":`Split diff view`,value:`split`,children:(0,Q.jsx)(re,{className:`size-3`})}),t[41]=j):j=t[41];let M;t[42]!==O||t[43]!==k?(M=(0,Q.jsxs)(pe,{className:`shrink-0`,variant:`outline`,size:`xs`,value:O,onValueChange:k,children:[A,j]}),t[42]=O,t[43]=k,t[44]=M):M=t[44];let N=r?`Disable diff line wrapping`:`Enable diff line wrapping`,P=r?`Disable line wrapping`:`Enable line wrapping`,F;t[45]===d?F=t[46]:(F=e=>{d(!!e)},t[45]=d,t[46]=F);let I;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(ce,{className:`size-3`}),t[47]=I):I=t[47];let L;t[48]!==r||t[49]!==N||t[50]!==P||t[51]!==F?(L=(0,Q.jsx)(Y,{"aria-label":N,title:P,variant:`outline`,size:`xs`,pressed:r,onPressedChange:F,children:I}),t[48]=r,t[49]=N,t[50]=P,t[51]=F,t[52]=L):L=t[52];let R;t[53]!==M||t[54]!==L?(R=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[M,L]}),t[53]=M,t[54]=L,t[55]=R):R=t[55];let z;return t[56]!==D||t[57]!==R?(z=(0,Q.jsxs)(Q.Fragment,{children:[D,R]}),t[56]=D,t[57]=R,t[58]=z):z=t[58],z}function je(e){let t=(0,$.c)(18),{bodyState:n,diffRenderMode:r,diffWordWrap:i,openDiffFileInEditor:a,patchViewportRef:o,renderableFiles:s,renderablePatch:c,resolvedTheme:l}=e;if(n.kind===`no-thread`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Ne,{children:`Select a thread to inspect turn diffs.`}),t[0]=e):e=t[0],e}if(n.kind===`not-git-repo`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Ne,{children:`Turn diffs are unavailable because this project is not a git repository.`}),t[1]=e):e=t[1],e}if(n.kind===`no-completed-turns`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Ne,{children:`No completed turns yet.`}),t[2]=e):e=t[2],e}let u;t[3]!==n.error||t[4]!==c?(u=n.error&&!c&&(0,Q.jsx)(`div`,{className:`px-3`,children:(0,Q.jsx)(`p`,{className:`mb-2 text-[11px] text-destructive-foreground`,children:n.error})}),t[3]=n.error,t[4]=c,t[5]=u):u=t[5];let d;t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==a||t[10]!==s||t[11]!==c||t[12]!==l?(d=c?c.kind===`files`?(0,Q.jsx)(L,{className:`diff-render-surface h-full min-h-0 overflow-auto px-2 pb-2`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:s.map(e=>{let t=J(e),n=`${de(e)}:${l}`;return(0,Q.jsx)(`div`,{"data-diff-file-path":t,className:`diff-render-file mb-2 rounded-md first:mt-2 last:mb-0`,onClickCapture:e=>{(e.nativeEvent.composedPath?.()??[]).some(Me)&&a(t)},children:(0,Q.jsx)(ge,{fileDiff:e,options:{diffStyle:r===`split`?`split`:`unified`,lineDiffType:`none`,overflow:i?`wrap`:`scroll`,theme:v(l),themeType:l,unsafeCSS:De}})},n)})}):(0,Q.jsx)(`div`,{className:`h-full overflow-auto p-2`,children:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:c.reason}),(0,Q.jsx)(`pre`,{className:W(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,i?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:c.text})]})}):(0,Q.jsx)(Re,{bodyState:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=a,t[10]=s,t[11]=c,t[12]=l,t[13]=d):d=t[13];let f;return t[14]!==o||t[15]!==u||t[16]!==d?(f=(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`div`,{ref:o,className:`diff-panel-viewport min-h-0 min-w-0 flex-1 overflow-hidden`,children:[u,d]})}),t[14]=o,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function Me(e){return e instanceof Element&&e.hasAttribute(`data-title`)}function Ne(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:n}),t[0]=n,t[1]=r),r}function Pe(){let e=(0,$.c)(19),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1,select:Ie},e[0]=t):t=e[0];let n=s(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r={strict:!1,select:Fe},e[1]=r):r=e[1];let i=M(r),a=i.rightPanel===`diff`,c=n?.threadId??null,l,u;e[2]===n?u=e[3]:(u=o(n),e[2]=n,e[3]=u),l=u;let f=R(l),p=He(f),m=f?.worktreePath,h=p?.cwd,g;e[4]!==m||e[5]!==h?(g=P({threadWorktreePath:m,projectCwd:h}),e[4]=m,e[5]=h,e[6]=g):g=e[6];let _=g,v=f?.environmentId??null,y=_??null,b;e[7]!==v||e[8]!==y?(b={environmentId:v,cwd:y},e[7]=v,e[8]=y,e[9]=b):b=e[9];let x=d(b),S;e[10]===x.data?S=e[11]:(S=I(x.data),e[10]=x.data,e[11]=S);let C=S,w;return e[12]!==_||e[13]!==f||e[14]!==c||e[15]!==a||e[16]!==i||e[17]!==C?(w={activeThread:f,activeThreadId:c,activeCwd:_,isGitRepo:C,diffSearch:i,diffOpen:a},e[12]=_,e[13]=f,e[14]=c,e[15]=a,e[16]=i,e[17]=C,e[18]=w):w=e[18],w}function Fe(e){return k(e)}function Ie(e){return x(e)}function Le(e){let{activeThread:t,activeThreadId:n,activeCwd:r,isGitRepo:i,diffSearch:a,diffOpen:o}=Pe(),{turnDiffSummaries:s,inferredCheckpointTurnCountByTurnId:c}=j(t),l=a.diffTurnId??null,u=l===null?null:a.diffFilePath??null,{activeCheckpointRange:d,conversationCacheScope:f,orderedTurnDiffSummaries:p,selectedTurn:m}=(0,X.useMemo)(()=>q({summaries:s,inferredCheckpointTurnCountByTurnId:c,selectedTurnId:l}),[c,l,s]),h=y(xe(we({environmentId:t?.environmentId,threadId:n,range:d,selectedTurnId:m?.turnId,conversationCacheScope:f,enabled:i}))),g=h.isLoading,_=Ce(h.error),v=h.data?.diff,b=typeof v==`string`&&v.trim().length===0,{emptyDiffMessage:x}=(0,X.useMemo)(()=>ie(m),[m]),S=(0,X.useMemo)(()=>se(v,`diff-panel:${e}`),[e,v]),C=(0,X.useMemo)(()=>Ue(S),[S]);return{activeCwd:r,activeThread:t,bodyState:le({hasActiveThread:!!t,isGitRepo:i,turnSummaryCount:p.length,checkpointDiffError:_,hasRenderablePatch:!!S,isLoadingCheckpointDiff:g,hasNoNetChanges:b,emptyDiffMessage:x}),diffOpen:o,inferredCheckpointTurnCountByTurnId:c,orderedTurnDiffSummaries:p,renderableFiles:C,renderablePatch:S,selectedFilePath:u,selectedTurn:m,selectedTurnId:l}}function Re(e){let t=(0,$.c)(4),{bodyState:n}=e;if(n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(D,{label:`Loading checkpoint diff...`}),t[0]=e):e=t[0],e}let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(A,{className:`size-7 text-muted-foreground/25`}),t[1]=r):r=t[1];let i=n.kind===`empty`?n.message:`No diff is available for this range.`,a;return t[2]===i?a=t[3]:(a=(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 px-5 py-2 text-center`,children:[r,(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:i})]}),t[2]=i,t[3]=a),a}var ze=180;function Be(e){let t=(0,$.c)(14),{direction:n,strip:r}=e,i=n===`left`,a=i?r.canScrollLeft:r.canScrollRight,o=i?G:K,s=i?`left-0`:`right-0`,c=a?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`,l;t[0]!==s||t[1]!==c?(l=W(`absolute top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,s,c),t[0]=s,t[1]=c,t[2]=l):l=t[2];let u;t[3]!==i||t[4]!==r?(u=()=>r.scrollBy(i?-180:ze),t[3]=i,t[4]=r,t[5]=u):u=t[5];let d=!a,f=`Scroll turn list ${n}`,p;t[6]===o?p=t[7]:(p=(0,Q.jsx)(o,{className:`size-3.5`}),t[6]=o,t[7]=p);let m;return t[8]!==l||t[9]!==u||t[10]!==d||t[11]!==f||t[12]!==p?(m=(0,Q.jsx)(`button`,{type:`button`,className:l,onClick:u,disabled:d,"aria-label":f,children:p}),t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function Ve(e){let t=(0,$.c)(23),{summary:n,selected:r,turnCount:i,timestampFormat:a,onSelect:o}=e,s;t[0]!==o||t[1]!==n.turnId?(s=()=>o(n.turnId),t[0]=o,t[1]=n.turnId,t[2]=s):s=t[2];let c=n.turnId,l=r?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`,u;t[3]===l?u=t[4]:(u=W(`rounded-md border px-2 py-1 text-left transition-colors`,l),t[3]=l,t[4]=u);let d=i??`?`,p;t[5]===d?p=t[6]:(p=(0,Q.jsxs)(`span`,{className:`text-[10px] leading-tight font-medium`,children:[`Turn `,d]}),t[5]=d,t[6]=p);let m;t[7]!==n.completedAt||t[8]!==a?(m=f(n.completedAt,a),t[7]=n.completedAt,t[8]=a,t[9]=m):m=t[9];let h;t[10]===m?h=t[11]:(h=(0,Q.jsx)(`span`,{className:`text-[9px] leading-tight opacity-70`,children:m}),t[10]=m,t[11]=h);let g;t[12]!==p||t[13]!==h?(g=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[p,h]}),t[12]=p,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==u||t[16]!==g?(_=(0,Q.jsx)(`div`,{className:u,children:g}),t[15]=u,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==r||t[19]!==n.turnId||t[20]!==s||t[21]!==_?(v=(0,Q.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:s,title:c,"data-turn-chip-selected":r,children:_}),t[18]=r,t[19]=n.turnId,t[20]=s,t[21]=_,t[22]=v):v=t[22],v}function He(e){let t=(0,$.c)(3),n=e?.environmentId,r=e?.projectId,i;return t[0]!==n||t[1]!==r?(i=e=>n&&r?B(e,{environmentId:n,projectId:r}):void 0,t[0]=n,t[1]=r,t[2]=i):i=t[2],R(i)}function Ue(e){return!e||e.kind!==`files`?[]:e.files.toSorted((e,t)=>J(e).localeCompare(J(t),void 0,{numeric:!0,sensitivity:`base`}))}export{Oe as default};
64
- //# sourceMappingURL=DiffPanel-3EEekk0W.js.map