@theoremjs/studio 0.3.4-next.381.g9417e5a → 0.3.4-next.387.g8bea7ff

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 (92) hide show
  1. package/README.md +1 -1
  2. package/package.json +4 -4
  3. package/page/assets/Banner-D2s9xjDu.js +2 -0
  4. package/page/assets/BottomSheet-BQPskY35.js +1 -0
  5. package/page/assets/{Card-Lp-0P5eL.js → Card-Ghe4ozhC.js} +1 -1
  6. package/page/assets/CheckboxInput-C9kbVyhK.js +2 -0
  7. package/page/assets/CodeBlock-Kjgv83A6.js +52 -0
  8. package/page/assets/CollapsibleGroup-toq0Nedn.js +2 -0
  9. package/page/assets/ContextMenu-Bs-xBzLA.js +2 -0
  10. package/page/assets/DateInput-BJt-UTCy.js +1 -0
  11. package/page/assets/Dialog-BDUExlk_.js +1 -0
  12. package/page/assets/HoverCard-C6thuzrf.js +1 -0
  13. package/page/assets/Icon-ZfFwTt8n.js +3 -0
  14. package/page/assets/IconButton-CG5klqF1.js +1 -0
  15. package/page/assets/{PaneState-BvA2tLQg.js → PaneState-C8jetBGI.js} +1 -1
  16. package/page/assets/PaneState-CnxaP3LD.css +1 -0
  17. package/page/assets/ScrollableArea-C8AVuqnt.js +1 -0
  18. package/page/assets/SegmentedControlItem-BLuJOusN.js +1 -0
  19. package/page/assets/SidePanel-OYp0bLNO.js +1 -0
  20. package/page/assets/{Text-bum6zWWx.js → Text-BsiAsowd.js} +2 -2
  21. package/page/assets/{TimestampHoverCard-DQIG0RZF.js → TimestampHoverCard-CCnmnVlQ.js} +1 -1
  22. package/page/assets/{ToolResultCharts-CgN_6U7d.js → ToolResultCharts-DP6XvRai.js} +1 -1
  23. package/page/assets/{Tooltip-BH9xiRMl.js → Tooltip-CTEuMRLe.js} +1 -1
  24. package/page/assets/TraceInspector-DmrYVbB9.js +1 -0
  25. package/page/assets/{TraceOverview-CqhEG7KQ.js → TraceOverview-BH5UvvAW.js} +1 -1
  26. package/page/assets/{browser-engine-Doqpao9n.js → browser-engine-Dduo9AOi.js} +1 -1
  27. package/page/assets/browser-transport-KwpVG2px.js +47 -0
  28. package/page/assets/chainEventHandlers-C6ttXGfW.js +1 -0
  29. package/page/assets/{embedding-space-view-judaIj9T.js → embedding-space-view-BU2AjjAx.js} +1 -1
  30. package/page/assets/{export-agent-Cev6w6V4.js → export-agent-BeBzFZ7T.js} +1 -1
  31. package/page/assets/fieldParts-Cs6Amprh.js +1 -0
  32. package/page/assets/focusReturn-CTppP2k0.js +1 -0
  33. package/page/assets/{guardrail-tester-Bq72Vr9v.js → guardrail-tester-BHQjkUP-.js} +2 -2
  34. package/page/assets/index-C_weLbPu.js +102 -0
  35. package/page/assets/index-Oo9otEIT.css +1 -0
  36. package/page/assets/{labels-provider-4TIWDvsE.js → labels-provider-BqgbdxdT.js} +2 -2
  37. package/page/assets/{studio-code-pane-BWMNxAkQ.js → studio-code-pane-Culehk_a.js} +1 -1
  38. package/page/assets/{studio-console-BBiBCBte.js → studio-console-CawD8qZ8.js} +1 -1
  39. package/page/assets/{studio-decision-VFQNBzqD.js → studio-decision-DdqYtp4p.js} +1 -1
  40. package/page/assets/studio-embedding-B9Gsa6Fd.js +2 -0
  41. package/page/assets/studio-host-console-CDJllabB.js +2 -0
  42. package/page/assets/studio-live-Bt1dF-IZ.js +5 -0
  43. package/page/assets/studio-map-3VNh8RBZ.js +1 -0
  44. package/page/assets/{trace-patterns-DnYJa0nI.js → trace-patterns-CS99kExN.js} +1 -1
  45. package/page/assets/{use-one-call-BBRAgQMm.js → use-one-call-BFIsOrln.js} +1 -1
  46. package/page/assets/{useAdaptivePresentation-BzmPCddb.js → useAdaptivePresentation-BY_zvjIp.js} +1 -1
  47. package/page/assets/{useClipboard-BgGRxRMJ.js → useClipboard-B1amtN2V.js} +1 -1
  48. package/page/assets/useDevWarning-Cna3kqg1.js +1 -0
  49. package/page/assets/useLayerDismissal-BAnTRYTt.js +1 -0
  50. package/page/assets/useScrollableArea-vxuztwym.js +1 -0
  51. package/page/assets/useTooltip-rxACYEAC.js +1 -0
  52. package/page/index.html +31 -30
  53. package/ui/built/theme.css +7 -2
  54. package/ui/built/theme.css.d.ts +2 -2
  55. package/ui/built/theorem-studio.d.ts +2 -2
  56. package/ui/built/theorem-studio.js +7 -2
  57. package/ui/built/theorem-studio.variants.d.ts +2 -2
  58. package/ui/diff-block.d.ts +6 -11
  59. package/ui/diff-block.js +5 -11
  60. package/ui/studio-conflicts.js +1 -1
  61. package/ui/studio-save.js +13 -12
  62. package/ui/studio-screen.js +2 -3
  63. package/ui/studio.css +4 -26
  64. package/page/assets/Banner-Biro9wFg.js +0 -2
  65. package/page/assets/BottomSheet-BwfBDtje.js +0 -1
  66. package/page/assets/CheckboxInput-Cj5pk-KI.js +0 -2
  67. package/page/assets/CodeBlock-C7XJ4ioE.js +0 -51
  68. package/page/assets/CollapsibleGroup-N7_SOjbm.js +0 -2
  69. package/page/assets/ContextMenu-omhsUI8x.js +0 -2
  70. package/page/assets/DateInput-BGrQ5tPC.js +0 -1
  71. package/page/assets/Dialog-DELWQo-v.js +0 -1
  72. package/page/assets/HoverCard-D1Y1ltWQ.js +0 -1
  73. package/page/assets/Icon-JrysT8aU.js +0 -3
  74. package/page/assets/IconButton-DlOGzJIX.js +0 -1
  75. package/page/assets/PaneState-eUzUkNE8.css +0 -1
  76. package/page/assets/ScrollableArea-Ckugdj1N.js +0 -1
  77. package/page/assets/SegmentedControlItem-h-aaXzyS.js +0 -1
  78. package/page/assets/SidePanel-BL32abk8.js +0 -1
  79. package/page/assets/TraceInspector-D1OEjVvd.js +0 -1
  80. package/page/assets/browser-transport-CxGBlTfw.js +0 -47
  81. package/page/assets/focusableSelector-DXZeMU85.js +0 -1
  82. package/page/assets/groupStyles-C7Ter7zC.js +0 -1
  83. package/page/assets/index-BJyzY1Pv.js +0 -101
  84. package/page/assets/index-DOaHlqBo.css +0 -1
  85. package/page/assets/studio-embedding-rOpRaKac.js +0 -2
  86. package/page/assets/studio-host-console-CAiMw0cg.js +0 -2
  87. package/page/assets/studio-live-DG6gBVwu.js +0 -5
  88. package/page/assets/studio-map-BvzzC2RQ.js +0 -1
  89. package/page/assets/useDevWarning-Z9SoixOP.js +0 -1
  90. package/page/assets/useLayerDismissal-B_G7IWpC.js +0 -1
  91. package/page/assets/useScrollableArea-0NzdiBCq.js +0 -1
  92. package/page/assets/useTooltip-CJM_xhLB.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{r as n}from"./useLayerDismissal-B_G7IWpC.js";import{f as r}from"./useTooltip-CJM_xhLB.js";import{t as i}from"./useMediaQuery-BCT0NUeZ.js";var a=e(t(),1),o={phase:`idle`},s={type:`none`};function c(e){return{gesture:{phase:`idle`},effect:e}}function l(e){return e==null?{type:`clear`}:{type:`highlight`,row:e}}function u(e,t){return t.row==null?t.isInMenu||t.isOnTrigger?c({type:`settle`,stray:!0,dismiss:!1}):c({type:`settle`,stray:!0,dismiss:e===`mouse`}):c({type:`act`,row:t.row})}function d(e,t){switch(e.phase){case`idle`:return f(e,t);case`triggerPress`:return p(e,t);case`open`:return m(e,t);case`tracking`:return h(e,t)}}function f(e,t){return t.type===`down`?t.target===`menu`?{gesture:{phase:`tracking`,pointerType:t.pointerType,origin:`menu`,row:t.row},effect:l(t.row)}:t.pointerType===`mouse`?{gesture:{phase:`open`,pointerType:`mouse`,openedAt:t.time},effect:{type:`open`}}:{gesture:{phase:`triggerPress`,pointerType:t.pointerType,startedAt:t.time},effect:s}:{gesture:e,effect:s}}function p(e,t){switch(t.type){case`opened`:return{gesture:{phase:`open`,pointerType:e.pointerType,openedAt:t.time},effect:s};case`up`:return c({type:`settle`,stray:!1,dismiss:!1});case`cancel`:return c({type:`settle`,stray:!1,dismiss:!1});case`down`:case`move`:return{gesture:e,effect:s}}}function m(e,t){switch(t.type){case`move`:return t.isInMenu?{gesture:{phase:`tracking`,pointerType:e.pointerType,origin:`trigger`,row:t.row},effect:l(t.row)}:{gesture:e,effect:s};case`up`:return t.time-e.openedAt>=300?u(e.pointerType,t):c({type:`settle`,stray:!0,dismiss:!1});case`cancel`:return c({type:`settle`,stray:!1,dismiss:!1});case`down`:case`opened`:return{gesture:e,effect:s}}}function h(e,t){switch(t.type){case`move`:return t.row===e.row?{gesture:e,effect:s}:{gesture:{...e,row:t.row},effect:l(t.row)};case`up`:return u(e.pointerType,t);case`cancel`:return c({type:`settle`,stray:!1,dismiss:!1});case`down`:case`opened`:return{gesture:e,effect:s}}}var g=500,_=10;function v(e){let{onLongPress:t,disabled:n=!1,delayMs:r=g,moveCancelPx:i=_}=e,o=(0,a.useRef)(null),s=(0,a.useRef)(null),c=(0,a.useRef)(t);c.current=t;let l=(0,a.useCallback)(()=>{o.current!=null&&(clearTimeout(o.current),o.current=null),s.current=null},[]),u=(0,a.useCallback)(e=>{n||(l(),s.current={x:e.x,y:e.y},o.current=setTimeout(()=>{let e=s.current;e!=null&&c.current({x:e.x,y:e.y})},r))},[n,r,l]),d=(0,a.useCallback)(e=>{let t=s.current;return t==null?!1:Math.abs(e.x-t.x)>i||Math.abs(e.y-t.y)>i?(l(),!1):!0},[i,l]),f=(0,a.useCallback)(e=>{if(n)return;if(e.touches.length!==1){l();return}let t=e.touches[0];u({x:t.clientX,y:t.clientY})},[n,l,u]),p=(0,a.useCallback)(e=>{if(s.current==null)return;if(e.touches.length!==1){l();return}let t=e.touches[0];d({x:t.clientX,y:t.clientY})},[l,d]);return(0,a.useEffect)(()=>l,[l]),{onTouchStart:f,onTouchMove:p,onTouchEnd:l,onTouchCancel:l,start:u,moveTo:d,cancel:l}}var y=`data-astryx-menu-press`,b=`[${y}]`,x=6,S=16,C=`[tabindex], a[href], button, input, select, textarea, [contenteditable]`,w=`a[href], button, [tabindex]`,T=!1;function E(){return T}var D=null;function O(){D!=null&&(D.isArmed=!1,D.timer!=null&&(clearTimeout(D.timer),D.timer=null))}function k(e){D!=null&&D.isArmed&&(e.detail===0||T||(e.preventDefault(),e.stopImmediatePropagation(),O()))}function A(e){let t=e.defaultView;t!=null&&((D==null||D.doc!==e)&&(D!=null&&(D.doc.defaultView?.removeEventListener(`click`,k,!0),D.doc.removeEventListener(`pointerdown`,O,!0)),t.addEventListener(`click`,k,!0),e.addEventListener(`pointerdown`,O,!0),D={doc:e,isArmed:!1,timer:null}),O(),D.isArmed=!0,D.timer=setTimeout(O,400))}function j(e){return e===`mouse`||e===`touch`||e===`pen`?e:null}function M(e){return e.matches(C)}function N(e){let t=e;for(;;){let e=t.parentElement?.closest(b);if(e==null)return t;t=e}}function P(e){let t=(0,a.useRef)(e);t.current=e;let n=(0,a.useRef)(o),i=(0,a.useRef)(null),s=(0,a.useRef)(null),c=(0,a.useRef)(null),l=(0,a.useRef)(null),u=(0,a.useRef)(null),f=(0,a.useRef)(null),p=(0,a.useRef)(null),m=(0,a.useRef)(null),h=(0,a.useCallback)(()=>t.current.menuRef.current?.ownerDocument??t.current.triggerRef?.current?.ownerDocument??document,[]),g=(0,a.useCallback)(e=>{let{menuRef:n,triggerRef:r,itemSelector:i,hitTest:a}=t.current,o=n.current,s=h(),c;c=a==null?typeof s.elementFromPoint==`function`?s.elementFromPoint(e.clientX,e.clientY):e.target instanceof Element?e.target:null:a(e.clientX,e.clientY);let l=o==null?null:N(o),u=l!=null&&c!=null&&l.contains(c),d=r?.current??null,f=d!=null&&c!=null&&d.contains(c),p=null;return u&&c!=null&&(p=c.closest(i),p!=null&&!l.contains(p)&&(p=null)),{row:p,isInMenu:u,isOnTrigger:f}},[h]),_=(0,a.useCallback)(()=>{u.current!=null&&(clearInterval(u.current.timer),u.current=null)},[]),C=(0,a.useCallback)(()=>{c.current?.cancel(),l.current?.(),l.current=null,_(),s.current?.(),s.current=null,i.current=null,f.current=null,n.current=o},[_]),E=(0,a.useCallback)(e=>{let{onHighlight:n,menuRef:r}=t.current;if(n!=null){n(e);return}let i=e==null?r.current:M(e)?e:e.querySelector(w);i!=null&&i!==h().activeElement&&i.focus({preventScroll:!0})},[h]),D=(0,a.useCallback)((e,n)=>{let{onActivate:r}=t.current;T=!0;try{if(r!=null){r(e,n);return}e.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:0,button:n.button,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,altKey:n.altKey,metaKey:n.metaKey}))}finally{T=!1}},[]),O=(0,a.useRef)(()=>{}),k=(0,a.useCallback)((e,n,i)=>{let a=h();switch(e.type){case`none`:return;case`open`:{let e=n.phase===`open`?n.pointerType:`mouse`;p.current=r(),(t.current.onTriggerPress?.(e)??!1)||C();return}case`highlight`:E(e.row);return;case`clear`:E(null);return;case`act`:C(),A(a),i!=null&&D(e.row,i);return;case`settle`:C(),e.stray&&A(a),e.dismiss&&t.current.onDismiss?.();return}},[D,C,h,E]),P=(0,a.useCallback)((e,t)=>{let r=d(n.current,e);n.current=r.gesture,k(r.effect,r.gesture,t)},[k]);O.current=P;let F=(0,a.useCallback)(()=>{let{getScroller:e,menuRef:n}=t.current;if(e!=null)return e();let r=n.current;return r==null?null:r.scrollHeight>r.clientHeight+1?r:null},[]),I=(0,a.useCallback)(e=>{if(n.current.phase!==`tracking`){_();return}let t=F();if(t==null){_();return}let r=t.getBoundingClientRect();if(r.height<=0){_();return}let i=0;if(e.clientY<=r.top+24?i=-1:e.clientY>=r.bottom-24&&(i=1),i===0){_();return}if(u.current?.direction===i)return;_();let a=()=>{let e=t.scrollTop;if(t.scrollTop=e+i*x,t.scrollTop===e){_();return}let n=f.current;if(n!=null){let e=g(n);O.current({type:`move`,row:e.row,isInMenu:e.isInMenu,time:Date.now()},n)}};u.current={direction:i,timer:setInterval(a,S)},a()},[F,g,_]),L=(0,a.useCallback)(e=>{s.current?.();let t=h(),r=t.defaultView;i.current=e;let a=e=>{if(e.pointerId!==i.current)return;if(f.current=e,n.current.phase===`triggerPress`){c.current?.moveTo({x:e.clientX,y:e.clientY})===!1&&O.current({type:`cancel`});return}let t=g(e);O.current({type:`move`,row:t.row,isInMenu:t.isInMenu,time:Date.now()},e),I(e)},o=e=>{if(e.pointerId!==i.current)return;let t=g(e);O.current({type:`up`,row:t.row,isInMenu:t.isInMenu,isOnTrigger:t.isOnTrigger,time:Date.now()},e)},l=e=>{e.pointerId===i.current&&O.current({type:`cancel`})},u=e=>{e.pointerId!==i.current&&(m.current=e.pointerId,O.current({type:`cancel`}))},d=()=>{O.current({type:`cancel`})};t.addEventListener(`pointermove`,a,!0),t.addEventListener(`pointerup`,o,!0),t.addEventListener(`pointercancel`,l,!0),t.addEventListener(`pointerdown`,u,!0),r?.addEventListener(`blur`,d),s.current=()=>{t.removeEventListener(`pointermove`,a,!0),t.removeEventListener(`pointerup`,o,!0),t.removeEventListener(`pointercancel`,l,!0),t.removeEventListener(`pointerdown`,u,!0),r?.removeEventListener(`blur`,d)}},[h,g,I]);c.current=v({onLongPress:(0,a.useCallback)(()=>{let e=n.current;if(e.phase!==`triggerPress`)return;if(p.current=r(),!(t.current.onTriggerPress?.(e.pointerType)??!1)){P({type:`cancel`});return}let i=h(),a=e=>{e.cancelable&&e.preventDefault()};i.addEventListener(`touchmove`,a,{passive:!1,capture:!0}),l.current=()=>{i.removeEventListener(`touchmove`,a,!0)},P({type:`opened`,time:Date.now()})},[h,P]),delayMs:e.longPressDelayMs??500});let R=(0,a.useCallback)(e=>{let{menuRef:r,isEnabled:i=!0}=t.current,a=r.current;if(!i||a==null)return;if(e.pointerId===m.current){m.current=null;return}if(n.current.phase!==`idle`){P({type:`cancel`});return}let o=j(e.pointerType);if(o==null||o===`mouse`&&e.button!==0||e.target?.closest(b)!==a)return;o!==`mouse`&&e.preventDefault();let s=e.nativeEvent;L(s.pointerId),f.current=s;let c=g(s);P({type:`down`,target:`menu`,pointerType:o,row:c.row,time:Date.now()},s)},[L,g,P]),z=(0,a.useCallback)(e=>{let{isEnabled:r=!0}=t.current;if(e.pointerId===m.current){m.current=null;return}if(!r||n.current.phase!==`idle`)return;let i=j(e.pointerType);if(i==null||e.button!==0||i===`mouse`&&e.ctrlKey)return;let a=e.nativeEvent;L(a.pointerId),f.current=a,i!==`mouse`&&c.current?.start({x:a.clientX,y:a.clientY}),P({type:`down`,target:`trigger`,pointerType:i,row:null,time:Date.now()},a)},[L,P]),B=(0,a.useCallback)(e=>{let t=n.current;t.phase!==`idle`&&t.pointerType!==`mouse`&&e.preventDefault()},[]),V=(0,a.useCallback)(()=>p.current!=null&&p.current===r(),[]),H=(0,a.useCallback)(()=>{n.current.phase!==`idle`&&P({type:`cancel`}),C()},[C,P]);return(0,a.useEffect)(()=>(r(),()=>{C()}),[C]),(0,a.useMemo)(()=>({menuProps:{onPointerDown:R,[y]:``},triggerProps:{onPointerDown:z,onContextMenu:B},isTriggerClickFromPress:V,cancel:H}),[R,z,B,V,H])}function F(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!I(e)&&e.key!==` `}function I(e){return e.isComposing===!0||e.nativeEvent?.isComposing===!0}function L(e){let{getItemLabels:t,onMatch:n,getCurrentIndex:r,resetMs:i=750,isDisabled:o}=e,s=(0,a.useRef)(``),c=(0,a.useRef)(void 0),l=(0,a.useCallback)(()=>{s.current=``,c.current&&=(clearTimeout(c.current),void 0)},[]),u=(0,a.useCallback)(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s.current=``,c.current=void 0},i)},[i]);return{onKeyDown:(0,a.useCallback)(e=>{let i=e.key===` `&&!e.ctrlKey&&!e.metaKey&&!I(e)&&s.current.length>0;if(!F(e)&&!i)return!1;let a=t();if(a.length===0)return!1;let c=e.key.toLowerCase(),l=s.current.length>0&&s.current.split(``).every(e=>e===c)?c:s.current+c;s.current=l,u();let d=r?.()??-1,f=a.length,p=d>=0,m=p?d:0,h=p&&l.length===1?1:0;for(let e=0;e<f;e++){let t=(m+h+e+f)%f;if(o?.(t))continue;let r=a[t];if(r!=null&&r.trim().toLowerCase().startsWith(l))return n(t),!0}return!0},[t,n,r,u,o]),reset:l}}function R(e,t,r){let[i,o]=(0,a.useState)(!1),s=(0,a.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.scrollHeight>t.clientHeight+1;o(e=>e===n?e:n)},[e]);return n(()=>{if(!r)return;let t=e.current;if(!t)return;s();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(s),i=typeof MutationObserver>`u`?null:new MutationObserver(s);return n?.observe(t),i?.observe(t,{childList:!0,characterData:!0,subtree:!0}),t.addEventListener(`load`,s,!0),window.addEventListener(`resize`,s),window.visualViewport?.addEventListener(`resize`,s),()=>{n?.disconnect(),i?.disconnect(),t.removeEventListener(`load`,s,!0),window.removeEventListener(`resize`,s),window.visualViewport?.removeEventListener(`resize`,s)}},[r,s,e]),n(()=>{r&&s()},[t,r,s]),i}var z=`(max-width: 768px) and (pointer: coarse)`;function B(e){let t=i(z);return e===`adaptive`?t?`bottom-sheet`:`popover`:e}export{E as a,L as i,B as n,P as o,R as r,v as s,z as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{r as n}from"./useLayerDismissal-BAnTRYTt.js";import{u as r}from"./useTooltip-rxACYEAC.js";import{t as i}from"./useMediaQuery-BCT0NUeZ.js";var a=e(t(),1),o={phase:`idle`},s={type:`none`};function c(e){return{gesture:{phase:`idle`},effect:e}}function l(e){return e==null?{type:`clear`}:{type:`highlight`,row:e}}function u(e,t){return t.row==null?t.isInMenu||t.isOnTrigger?c({type:`settle`,stray:!0,dismiss:!1}):c({type:`settle`,stray:!0,dismiss:e===`mouse`}):c({type:`act`,row:t.row})}function d(e,t){switch(e.phase){case`idle`:return f(e,t);case`triggerPress`:return p(e,t);case`open`:return m(e,t);case`tracking`:return h(e,t)}}function f(e,t){return t.type===`down`?t.target===`menu`?{gesture:{phase:`tracking`,pointerType:t.pointerType,origin:`menu`,row:t.row},effect:l(t.row)}:t.pointerType===`mouse`?{gesture:{phase:`open`,pointerType:`mouse`,openedAt:t.time},effect:{type:`open`}}:{gesture:{phase:`triggerPress`,pointerType:t.pointerType,startedAt:t.time},effect:s}:{gesture:e,effect:s}}function p(e,t){switch(t.type){case`opened`:return{gesture:{phase:`open`,pointerType:e.pointerType,openedAt:t.time},effect:s};case`up`:return c({type:`settle`,stray:!1,dismiss:!1});case`cancel`:return c({type:`settle`,stray:!1,dismiss:!1});case`down`:case`move`:return{gesture:e,effect:s}}}function m(e,t){switch(t.type){case`move`:return t.isInMenu?{gesture:{phase:`tracking`,pointerType:e.pointerType,origin:`trigger`,row:t.row},effect:l(t.row)}:{gesture:e,effect:s};case`up`:return t.time-e.openedAt>=300?u(e.pointerType,t):c({type:`settle`,stray:!0,dismiss:!1});case`cancel`:return c({type:`settle`,stray:!1,dismiss:!1});case`down`:case`opened`:return{gesture:e,effect:s}}}function h(e,t){switch(t.type){case`move`:return t.row===e.row?{gesture:e,effect:s}:{gesture:{...e,row:t.row},effect:l(t.row)};case`up`:return u(e.pointerType,t);case`cancel`:return c({type:`settle`,stray:!1,dismiss:!1});case`down`:case`opened`:return{gesture:e,effect:s}}}var g=500,_=10;function v(e){let{onLongPress:t,disabled:n=!1,delayMs:r=g,moveCancelPx:i=_}=e,o=(0,a.useRef)(null),s=(0,a.useRef)(null),c=(0,a.useRef)(t);c.current=t;let l=(0,a.useCallback)(()=>{o.current!=null&&(clearTimeout(o.current),o.current=null),s.current=null},[]),u=(0,a.useCallback)(e=>{n||(l(),s.current={x:e.x,y:e.y},o.current=setTimeout(()=>{let e=s.current;e!=null&&c.current({x:e.x,y:e.y})},r))},[n,r,l]),d=(0,a.useCallback)(e=>{let t=s.current;return t==null?!1:Math.abs(e.x-t.x)>i||Math.abs(e.y-t.y)>i?(l(),!1):!0},[i,l]),f=(0,a.useCallback)(e=>{if(n)return;if(e.touches.length!==1){l();return}let t=e.touches[0];u({x:t.clientX,y:t.clientY})},[n,l,u]),p=(0,a.useCallback)(e=>{if(s.current==null)return;if(e.touches.length!==1){l();return}let t=e.touches[0];d({x:t.clientX,y:t.clientY})},[l,d]);return(0,a.useEffect)(()=>l,[l]),{onTouchStart:f,onTouchMove:p,onTouchEnd:l,onTouchCancel:l,start:u,moveTo:d,cancel:l}}var y=`data-astryx-menu-press`,b=`[${y}]`,x=6,S=16,C=`[tabindex], a[href], button, input, select, textarea, [contenteditable]`,w=`a[href], button, [tabindex]`,T=!1;function E(){return T}var D=null;function O(){D!=null&&(D.isArmed=!1,D.timer!=null&&(clearTimeout(D.timer),D.timer=null))}function k(e){D!=null&&D.isArmed&&(e.detail===0||T||(e.preventDefault(),e.stopImmediatePropagation(),O()))}function A(e){let t=e.defaultView;t!=null&&((D==null||D.doc!==e)&&(D!=null&&(D.doc.defaultView?.removeEventListener(`click`,k,!0),D.doc.removeEventListener(`pointerdown`,O,!0)),t.addEventListener(`click`,k,!0),e.addEventListener(`pointerdown`,O,!0),D={doc:e,isArmed:!1,timer:null}),O(),D.isArmed=!0,D.timer=setTimeout(O,400))}function j(e){return e===`mouse`||e===`touch`||e===`pen`?e:null}function M(e){return e.matches(C)}function N(e){let t=e;for(;;){let e=t.parentElement?.closest(b);if(e==null)return t;t=e}}function P(e){let t=(0,a.useRef)(e);t.current=e;let n=(0,a.useRef)(o),i=(0,a.useRef)(null),s=(0,a.useRef)(null),c=(0,a.useRef)(null),l=(0,a.useRef)(null),u=(0,a.useRef)(null),f=(0,a.useRef)(null),p=(0,a.useRef)(null),m=(0,a.useRef)(null),h=(0,a.useCallback)(()=>t.current.menuRef.current?.ownerDocument??t.current.triggerRef?.current?.ownerDocument??document,[]),g=(0,a.useCallback)(e=>{let{menuRef:n,triggerRef:r,itemSelector:i,hitTest:a}=t.current,o=n.current,s=h(),c;c=a==null?typeof s.elementFromPoint==`function`?s.elementFromPoint(e.clientX,e.clientY):e.target instanceof Element?e.target:null:a(e.clientX,e.clientY);let l=o==null?null:N(o),u=l!=null&&c!=null&&l.contains(c),d=r?.current??null,f=d!=null&&c!=null&&d.contains(c),p=null;return u&&c!=null&&(p=c.closest(i),p!=null&&!l.contains(p)&&(p=null)),{row:p,isInMenu:u,isOnTrigger:f}},[h]),_=(0,a.useCallback)(()=>{u.current!=null&&(clearInterval(u.current.timer),u.current=null)},[]),C=(0,a.useCallback)(()=>{c.current?.cancel(),l.current?.(),l.current=null,_(),s.current?.(),s.current=null,i.current=null,f.current=null,n.current=o},[_]),E=(0,a.useCallback)(e=>{let{onHighlight:n,menuRef:r}=t.current;if(n!=null){n(e);return}let i=e==null?r.current:M(e)?e:e.querySelector(w);i!=null&&i!==h().activeElement&&i.focus({preventScroll:!0})},[h]),D=(0,a.useCallback)((e,n)=>{let{onActivate:r}=t.current;T=!0;try{if(r!=null){r(e,n);return}e.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:0,button:n.button,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,altKey:n.altKey,metaKey:n.metaKey}))}finally{T=!1}},[]),O=(0,a.useRef)(()=>{}),k=(0,a.useCallback)((e,n,i)=>{let a=h();switch(e.type){case`none`:return;case`open`:{let e=n.phase===`open`?n.pointerType:`mouse`;p.current=r(),(t.current.onTriggerPress?.(e)??!1)||C();return}case`highlight`:E(e.row);return;case`clear`:E(null);return;case`act`:C(),A(a),i!=null&&D(e.row,i);return;case`settle`:C(),e.stray&&A(a),e.dismiss&&t.current.onDismiss?.();return}},[D,C,h,E]),P=(0,a.useCallback)((e,t)=>{let r=d(n.current,e);n.current=r.gesture,k(r.effect,r.gesture,t)},[k]);O.current=P;let F=(0,a.useCallback)(()=>{let{getScroller:e,menuRef:n}=t.current;if(e!=null)return e();let r=n.current;return r==null?null:r.scrollHeight>r.clientHeight+1?r:null},[]),I=(0,a.useCallback)(e=>{if(n.current.phase!==`tracking`){_();return}let t=F();if(t==null){_();return}let r=t.getBoundingClientRect();if(r.height<=0){_();return}let i=0;if(e.clientY<=r.top+24?i=-1:e.clientY>=r.bottom-24&&(i=1),i===0){_();return}if(u.current?.direction===i)return;_();let a=()=>{let e=t.scrollTop;if(t.scrollTop=e+i*x,t.scrollTop===e){_();return}let n=f.current;if(n!=null){let e=g(n);O.current({type:`move`,row:e.row,isInMenu:e.isInMenu,time:Date.now()},n)}};u.current={direction:i,timer:setInterval(a,S)},a()},[F,g,_]),L=(0,a.useCallback)(e=>{s.current?.();let t=h(),r=t.defaultView;i.current=e;let a=e=>{if(e.pointerId!==i.current)return;if(f.current=e,n.current.phase===`triggerPress`){c.current?.moveTo({x:e.clientX,y:e.clientY})===!1&&O.current({type:`cancel`});return}let t=g(e);O.current({type:`move`,row:t.row,isInMenu:t.isInMenu,time:Date.now()},e),I(e)},o=e=>{if(e.pointerId!==i.current)return;let t=g(e);O.current({type:`up`,row:t.row,isInMenu:t.isInMenu,isOnTrigger:t.isOnTrigger,time:Date.now()},e)},l=e=>{e.pointerId===i.current&&O.current({type:`cancel`})},u=e=>{e.pointerId!==i.current&&(m.current=e.pointerId,O.current({type:`cancel`}))},d=()=>{O.current({type:`cancel`})};t.addEventListener(`pointermove`,a,!0),t.addEventListener(`pointerup`,o,!0),t.addEventListener(`pointercancel`,l,!0),t.addEventListener(`pointerdown`,u,!0),r?.addEventListener(`blur`,d),s.current=()=>{t.removeEventListener(`pointermove`,a,!0),t.removeEventListener(`pointerup`,o,!0),t.removeEventListener(`pointercancel`,l,!0),t.removeEventListener(`pointerdown`,u,!0),r?.removeEventListener(`blur`,d)}},[h,g,I]);c.current=v({onLongPress:(0,a.useCallback)(()=>{let e=n.current;if(e.phase!==`triggerPress`)return;if(p.current=r(),!(t.current.onTriggerPress?.(e.pointerType)??!1)){P({type:`cancel`});return}let i=h(),a=e=>{e.cancelable&&e.preventDefault()};i.addEventListener(`touchmove`,a,{passive:!1,capture:!0}),l.current=()=>{i.removeEventListener(`touchmove`,a,!0)},P({type:`opened`,time:Date.now()})},[h,P]),delayMs:e.longPressDelayMs??500});let R=(0,a.useCallback)(e=>{let{menuRef:r,isEnabled:i=!0}=t.current,a=r.current;if(!i||a==null)return;if(e.pointerId===m.current){m.current=null;return}if(n.current.phase!==`idle`){P({type:`cancel`});return}let o=j(e.pointerType);if(o==null||o===`mouse`&&e.button!==0||e.target?.closest(b)!==a)return;o!==`mouse`&&e.preventDefault();let s=e.nativeEvent;L(s.pointerId),f.current=s;let c=g(s);P({type:`down`,target:`menu`,pointerType:o,row:c.row,time:Date.now()},s)},[L,g,P]),z=(0,a.useCallback)(e=>{let{isEnabled:r=!0}=t.current;if(e.pointerId===m.current){m.current=null;return}if(!r||n.current.phase!==`idle`)return;let i=j(e.pointerType);if(i==null||e.button!==0||i===`mouse`&&e.ctrlKey)return;let a=e.nativeEvent;L(a.pointerId),f.current=a,i!==`mouse`&&c.current?.start({x:a.clientX,y:a.clientY}),P({type:`down`,target:`trigger`,pointerType:i,row:null,time:Date.now()},a)},[L,P]),B=(0,a.useCallback)(e=>{let t=n.current;t.phase!==`idle`&&t.pointerType!==`mouse`&&e.preventDefault()},[]),V=(0,a.useCallback)(()=>p.current!=null&&p.current===r(),[]),H=(0,a.useCallback)(()=>{n.current.phase!==`idle`&&P({type:`cancel`}),C()},[C,P]);return(0,a.useEffect)(()=>(r(),()=>{C()}),[C]),(0,a.useMemo)(()=>({menuProps:{onPointerDown:R,[y]:``},triggerProps:{onPointerDown:z,onContextMenu:B},isTriggerClickFromPress:V,cancel:H}),[R,z,B,V,H])}function F(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!I(e)&&e.key!==` `}function I(e){return e.isComposing===!0||e.nativeEvent?.isComposing===!0}function L(e){let{getItemLabels:t,onMatch:n,getCurrentIndex:r,resetMs:i=750,isDisabled:o}=e,s=(0,a.useRef)(``),c=(0,a.useRef)(void 0),l=(0,a.useCallback)(()=>{s.current=``,c.current&&=(clearTimeout(c.current),void 0)},[]),u=(0,a.useCallback)(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s.current=``,c.current=void 0},i)},[i]);return{onKeyDown:(0,a.useCallback)(e=>{let i=e.key===` `&&!e.ctrlKey&&!e.metaKey&&!I(e)&&s.current.length>0;if(!F(e)&&!i)return!1;let a=t();if(a.length===0)return!1;let c=e.key.toLowerCase(),l=s.current.length>0&&s.current.split(``).every(e=>e===c)?c:s.current+c;s.current=l,u();let d=r?.()??-1,f=a.length,p=d>=0,m=p?d:0,h=p&&l.length===1?1:0;for(let e=0;e<f;e++){let t=(m+h+e+f)%f;if(o?.(t))continue;let r=a[t];if(r!=null&&r.trim().toLowerCase().startsWith(l))return n(t),!0}return!0},[t,n,r,u,o]),reset:l}}function R(e,t,r){let[i,o]=(0,a.useState)(!1),s=(0,a.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.scrollHeight>t.clientHeight+1;o(e=>e===n?e:n)},[e]);return n(()=>{if(!r)return;let t=e.current;if(!t)return;s();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(s),i=typeof MutationObserver>`u`?null:new MutationObserver(s);return n?.observe(t),i?.observe(t,{childList:!0,characterData:!0,subtree:!0}),t.addEventListener(`load`,s,!0),window.addEventListener(`resize`,s),window.visualViewport?.addEventListener(`resize`,s),()=>{n?.disconnect(),i?.disconnect(),t.removeEventListener(`load`,s,!0),window.removeEventListener(`resize`,s),window.visualViewport?.removeEventListener(`resize`,s)}},[r,s,e]),n(()=>{r&&s()},[t,r,s]),i}var z=`(max-width: 768px) and (pointer: coarse)`;function B(e){let t=i(z);return e===`adaptive`?t?`bottom-sheet`:`popover`:e}export{E as a,L as i,B as n,P as o,R as r,v as s,z as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{n}from"./IconButton-DlOGzJIX.js";var r=e(t(),1),i=2e3;function a(e={}){let{announce:t,resetAfterMs:a=i}=e,o=n(),[s,c]=(0,r.useState)(!1),l=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{l.current!=null&&clearTimeout(l.current)},[]),{copy:(0,r.useCallback)(async e=>{try{return await navigator.clipboard.writeText(e),c(!0),t&&o(t),l.current!=null&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,c(!1)},a),!0}catch{return!1}},[o,t,a]),isCopied:s}}export{a as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import{n}from"./IconButton-CG5klqF1.js";var r=e(t(),1),i=2e3;function a(e={}){let{announce:t,resetAfterMs:a=i}=e,o=n(),[s,c]=(0,r.useState)(!1),l=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{l.current!=null&&clearTimeout(l.current)},[]),{copy:(0,r.useCallback)(async e=>{try{return await navigator.clipboard.writeText(e),c(!0),t&&o(t),l.current!=null&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,c(!1)},a),!0}catch{return!1}},[o,t,a]),isCopied:s}}export{a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./themeProps-3IqahpCr.js";import"./devWarning-DxuplmRl.js";var n=`button:not([disabled]), a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child`,r=e(t(),1);function i(e,t,n=!0){let i=(0,r.useRef)(!1);(0,r.useEffect)(()=>{n&&!i.current&&(i.current=!0)},[e,t,n])}export{n,i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";var r=e(n(),1),i=Symbol.for(`@astryxdesign/core/interaction-modality/v1`);function a(e){let t=e,n=t[i];if(n!=null)return n;let r={modality:`keyboard`,isListening:!1,onPointerDown:()=>{r.modality=`pointer`},onKeyDown:e=>{e.metaKey||e.altKey||e.ctrlKey||(r.modality=`keyboard`)}};return Object.defineProperty(t,i,{value:r}),r}function o(){if(typeof document>`u`)return()=>{};let e=document,t=a(e);return t.isListening||(t.isListening=!0,e.addEventListener(`pointerdown`,t.onPointerDown,{capture:!0,passive:!0}),e.addEventListener(`keydown`,t.onKeyDown,{capture:!0,passive:!0})),()=>{}}function s(){(0,r.useEffect)(()=>o(),[])}function c(){return typeof document>`u`?`keyboard`:a(document).modality}var l=t(),u=229;function d(e){return e.isComposing===!0||e.keyCode===u}var f={reset:{kMv6JI:`x9ynric`,kGuDYH:`xjm74w1`,k63SB2:`xxovm9e`,kLWn49:`xw6l6zx`,kKX8nH:`x1j61x8r`,k9WMMc:`x1yc453h`,kJI5tL:`x7ssn7h`,kTHuQy:`xzugeeo`,kP9fke:`x6mezaz`,kb6lSQ:`x1i21sxh`,k4JVr9:`xp3md9m`,kKMj4B:`x19pm5ym`,khDVqt:`xeaf4i8`,kTgw9:`x1lldw8n`,kHjlTd:`x1h4wwuj`,kE4Cay:`xxydokm`,$$css:!0}},p={reset:{"--step-connector-gap":`x1qkaldv`,$$css:!0}},m=typeof window<`u`?r.useLayoutEffect:r.useEffect,h=(0,r.createContext)(0);h.displayName=`LayerDepthContext`;function g(){return(0,r.use)(h)}function _({children:e}){let t=(0,r.use)(h);return(0,l.jsx)(h,{value:t+1,children:e})}_.displayName=`LayerDepthProvider`;var v=[],y=new WeakMap,b=0,x=!1;function S(e){let t=y.get(e);if(t!==void 0)return t;let n=b++;return y.set(e,n),n}function C(e,t){if(e.depth!==t.depth)return e.depth-t.depth;let n=e.getContainer?.()??null,r=t.getContainer?.()??null;if(n!=null&&r!=null&&n!==r){if(r.contains(n))return 1;if(n.contains(r))return-1}return e.seq-t.seq}function w(e){return e.isPresent?.()??!0}var T=!1;function E(){return T}function D(){T=!0}function O(){T=!1}function k(){let e=null;for(let t of v)w(t)&&(e==null||C(t,e)>0)&&(e=t);return e}function A(e){return k()?.token===e}function j(){let e=k();return e!=null&&(e.behavior===`block`||e.dismiss(),!0)}function M(e){e.key===`Escape`&&(d(e)?k()!=null&&e.preventDefault():e.defaultPrevented||j()&&e.preventDefault())}function N(){x||typeof document>`u`||(document.addEventListener(`keydown`,M),document.addEventListener(`compositionstart`,D,!0),document.addEventListener(`compositionend`,O,!0),document.addEventListener(`blur`,O,!0),x=!0)}function P(){x&&typeof document<`u`&&(document.removeEventListener(`keydown`,M),document.removeEventListener(`compositionstart`,D,!0),document.removeEventListener(`compositionend`,O,!0),document.removeEventListener(`blur`,O,!0),T=!1,x=!1)}function F(e){let t={...e,seq:S(e.token)};return v.push(t),N(),()=>{let e=v.indexOf(t);e!==-1&&v.splice(e,1),v.length===0&&P()}}function I(e){let{isActive:t,onDismiss:n,escapeBehavior:i=`close`,getContainer:a,isPresent:o,isEnabled:s=!0}=e,c=g(),l=(0,r.useRef)({}),u=(0,r.useRef)(!1),d=(0,r.useRef)(n),f=(0,r.useRef)(a),p=(0,r.useRef)(o);(0,r.useEffect)(()=>{d.current=n,f.current=a,p.current=o});let m=t&&s;return(0,r.useEffect)(()=>{if(!m)u.current=!1;else return u.current||=(l.current={},!0),F({token:l.current,depth:c,behavior:i,getContainer:()=>f.current?.()??null,isPresent:()=>p.current?.()??!0,dismiss:()=>d.current()})},[m,c,i]),{shouldDismissOnCloseRequest:(0,r.useCallback)(()=>m&&!E()&&A(l.current),[m])}}export{f as a,s as c,p as i,_ as n,d as o,m as r,c as s,I as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{l as t,u as n}from"./themeProps-3IqahpCr.js";import{t as r}from"./mergeProps-ptS-gIMz.js";import{n as i,t as a}from"./sharedResizeObserver-4U9Xq5Oq.js";import{r as o}from"./useLayerDismissal-BAnTRYTt.js";import{n as s}from"./useDevWarning-Cna3kqg1.js";var c=e(n(),1),l=new WeakMap;function u(e,t){l.set(e,t)}function d(e){l.delete(e)}function f(e){return l.get(e)}var p=new Set([`article`,`banner`,`complementary`,`contentinfo`,`definition`,`directory`,`document`,`figure`,`form`,`generic`,`group`,`heading`,`list`,`listitem`,`main`,`navigation`,`none`,`note`,`paragraph`,`presentation`,`region`,`section`,`status`,`table`,`term`]);function m(e){if(e.tabIndex<0||e.matches(`:disabled`)||e.closest(`[inert], [hidden]`)!=null||e.getClientRects().length===0)return!1;let t=getComputedStyle(e).visibility;return t!==`hidden`&&t!==`collapse`}function h(e,t){let n=t.querySelectorAll(s),r=t.matches(`button:not([disabled]), a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child`)&&m(t)?t:null;for(let e of n)if(!(r!=null&&e.tabIndex<=0)&&m(e)){if(e.tabIndex>0)return null;r??=e}if(r==null||r.tabIndex!==0||!r.matches(`a[href], button`)||r.closest(`[aria-hidden="true"]`)!=null||r.matches(`[aria-disabled="true"], [aria-haspopup]:not([aria-haspopup="false"])`))return null;let i=r;for(;i!=null&&i!==e;){let e=i.getAttribute(`role`)?.trim().toLowerCase(),t=i===r&&(e===`button`&&r.localName===`button`||e===`link`&&r.localName===`a`);if(e!=null&&e!==``&&!t&&!p.has(e)||i===r&&e!=null&&e!==``&&!t||i.hasAttribute(`aria-activedescendant`)||i.isContentEditable||i.matches(`[contenteditable]:not([contenteditable="false"])`)||f(i)!=null)return null;let n=getComputedStyle(i);if(/^(auto|scroll|overlay)$/.test(n.overflowX)&&i.scrollWidth>i.clientWidth+1||/^(auto|scroll|overlay)$/.test(n.overflowY)&&i.scrollHeight>i.clientHeight+1)return null;i=i.parentElement}return i===e?r:null}function g(e,t){let n=e.ownerDocument,r=n.defaultView;if(r==null)return()=>{};let i=null,a=null,o=null,s,c,l=()=>{i=null,a=null,r.clearTimeout(s),c?.(),c=void 0},u=t=>{if(l(),!(t.key!==`Tab`||t.ctrlKey||t.metaKey)){if(i=t,a=t.target,t.shiftKey&&o!=null&&n.activeElement===o&&e.contains(o)){let t=e.getAttribute(`tabindex`);e.tabIndex=-1,c=()=>{e.getAttribute(`tabindex`)===`-1`&&(t==null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t))}}s=r.setTimeout(l,0)}},d=r=>{let s=i,c=a;if(l(),r.target!==e){e.contains(r.target)||(o=null);return}if(o=null,s==null||s.shiftKey||s.defaultPrevented||s.eventPhase!==0||r.relatedTarget!=null&&r.relatedTarget!==c)return;let u=h(e,t);u!=null&&(o=u,u.focus(),n.activeElement!==u&&(o=null))};return n.addEventListener(`keydown`,u,!0),n.addEventListener(`keyup`,l,!0),n.addEventListener(`pointerdown`,l,!0),n.addEventListener(`focusin`,d,!0),r.addEventListener(`blur`,l),()=>{l(),n.removeEventListener(`keydown`,u,!0),n.removeEventListener(`keyup`,l,!0),n.removeEventListener(`pointerdown`,l,!0),n.removeEventListener(`focusin`,d,!0),r.removeEventListener(`blur`,l)}}var _={isScrollable:!1,atStart:!0,atEnd:!0};function v(e,t){let n=e.toLowerCase(),r=n.startsWith(`vertical`)||n.startsWith(`sideways`),i=t===`rtl`;return r?{inline:`y`,block:`x`,inlineReversed:n===`sideways-lr`?!i:i,blockReversed:n.endsWith(`-rl`)}:{inline:`x`,block:`y`,inlineReversed:i,blockReversed:!1}}function y(e){return e===`auto`||e===`scroll`||e===`overlay`}function b(e,t){let n=getComputedStyle(e);return t===`x`?{clientExtent:e.clientWidth,contentExtent:e.scrollWidth,offset:e.scrollLeft,overflow:n.overflowX}:{clientExtent:e.clientHeight,contentExtent:e.scrollHeight,offset:e.scrollTop,overflow:n.overflowY}}function x(e,t){return e.isConnected&&t.display!==`none`&&e.clientWidth>0&&e.clientHeight>0}function S(e,t,n){if(!x(e,getComputedStyle(e)))return null;let r=n[t],i=r===`x`?e.clientWidth:e.clientHeight;return(r===`x`?e.scrollWidth:e.scrollHeight)-i>1}function C(e,t,n){if(!x(e,getComputedStyle(e)))return null;let r=n[t],i=b(e,r),a=i.contentExtent-i.clientExtent;if(!y(i.overflow)||a<=1)return _;let o=n[`${t}Reversed`],s=Math.min(a,Math.max(0,o?Math.abs(i.offset):i.offset));return{isScrollable:!0,atStart:s<=1,atEnd:s>=a-1}}var w={isScrollable:!1,atStart:!0,atEnd:!0},T={inline:w,block:w},E={inline:!1,block:!1},D={inline:`x`,block:`y`,inlineReversed:!1,blockReversed:!1},O={overflow:(e,t)=>[{kXHlph:e==null?e:`xyto64x`,kORKVm:t==null?t:`x4ncuvb`,$$css:!0},{"--x-overflowX":e??void 0,"--x-overflowY":t??void 0}]};function k(e,t){return e===t||e===`both`}function A(e,t){return e.inline.isScrollable===t.inline.isScrollable&&e.inline.atStart===t.inline.atStart&&e.inline.atEnd===t.inline.atEnd&&e.block.isScrollable===t.block.isScrollable&&e.block.atStart===t.block.atStart&&e.block.atEnd===t.block.atEnd}function j(e,t){return e.inline===t.inline&&e.block===t.block}function M(e,t){return e.inline===t.inline&&e.block===t.block&&e.inlineReversed===t.inlineReversed&&e.blockReversed===t.blockReversed}function N(e){if(e==null)return;let t={...e};return delete t.overflow,delete t.overflowX,delete t.overflowY,delete t.overflowInline,delete t.overflowBlock,t}function P(e){let t=(0,c.useRef)(void 0),n=(0,c.useRef)(null);return(0,c.useCallback)(r=>{if(n.current!=null&&Object.is(t.current,r))return n.current;let a=i(r,e);return t.current=r,n.current=a,a},[e])}function F({axis:e,keyboardAccess:n,overscroll:i=`allow`,stickyContainment:s=`whenScrollable`}){let[l,f]=(0,c.useState)(null),[p,m]=(0,c.useState)(null),[h,_]=(0,c.useState)(T),[y,b]=(0,c.useState)(E),[x,F]=(0,c.useState)(D),I=(0,c.useRef)(T),L=(0,c.useCallback)(e=>{f(t=>t===e?t:e)},[]),R=(0,c.useCallback)(e=>{m(t=>t===e?t:e)},[]),z=P(L),B=P(R);o(()=>{if(l==null||p==null)return;let t=null,n=!0,r=()=>{t=null;let n=getComputedStyle(l),r=v(n.writingMode,n.direction),i=k(e,`inline`)?S(l,`inline`,r):!1,a=k(e,`block`)?S(l,`block`,r):!1,o=k(e,`inline`)?C(l,`inline`,r):w,s=k(e,`block`)?C(l,`block`,r):w;if(i==null||a==null||o==null||s==null)return;let c={inline:i,block:a},d={inline:o,block:s};I.current=d,u(l,d),b(e=>j(e,c)?e:c),_(e=>A(e,d)?e:d),F(e=>M(e,r)?e:r)},i=()=>{n&&t==null&&(t=window.requestAnimationFrame(r))};u(l,I.current),r();let o=a(l,i),s=a(p,i);l.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i),window.visualViewport?.addEventListener(`resize`,i),p.addEventListener(`load`,i,!0),l.addEventListener(`transitionend`,i),l.addEventListener(`animationend`,i),p.addEventListener(`transitionend`,i),p.addEventListener(`animationend`,i);let c=typeof MutationObserver>`u`?null:new MutationObserver(i);c?.observe(l,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`]}),c?.observe(p,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`],characterData:!0,childList:!0,subtree:!0});let f=l.parentElement;for(;f!=null;)c?.observe(f,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`]}),f=f.parentElement;let m=document.fonts;return m?.addEventListener?.(`loadingdone`,i),m?.ready.then(i),()=>{n=!1,d(l),o(),s(),c?.disconnect(),l.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i),window.visualViewport?.removeEventListener(`resize`,i),p.removeEventListener(`load`,i,!0),l.removeEventListener(`transitionend`,i),l.removeEventListener(`animationend`,i),p.removeEventListener(`transitionend`,i),p.removeEventListener(`animationend`,i),m?.removeEventListener?.(`loadingdone`,i),t!=null&&window.cancelAnimationFrame(t)}},[e,p,l]);let V=(0,c.useMemo)(()=>({inline:k(e,`inline`)?h.inline:w,block:k(e,`block`)?h.block:w}),[e,h]),H=V.inline.isScrollable||V.block.isScrollable;return o(()=>{if(n.owner===`contentOrViewport`&&H&&l!=null&&p!=null)return g(l,p)},[p,H,n.owner,l]),{getViewportProps:(0,c.useCallback)((a={})=>{let o=V.inline.isScrollable||V.block.isScrollable,c=k(e,`inline`)&&x.inline===`x`||k(e,`block`)&&x.block===`x`,u=k(e,`inline`)&&x.inline===`y`||k(e,`block`)&&x.block===`y`,d=y.inline&&x.inline===`x`||y.block&&x.block===`x`,f=y.inline&&x.inline===`y`||y.block&&x.block===`y`,p=d||f||s===`always`,m=s===`always`?c:d,h=s===`always`?u:f,{xstyle:g,..._}=a,v={..._,style:N(_.style)},b=r(v,t(g,O.overflow(p?m?`auto`:`hidden`:`clip`,p?h?`auto`:`hidden`:`clip`))),S=n.owner!==`content`,C=(!S||!o)&&l!=null&&typeof document<`u`&&document.activeElement===l,w={...b.style},T=i===`contain`&&V.inline.isScrollable,E=i===`contain`&&V.block.isScrollable,D=x.inline,A=x.block;k(e,`inline`)&&(w[D===`x`?`overscrollBehaviorX`:`overscrollBehaviorY`]=T?`contain`:`auto`),k(e,`block`)&&(w[A===`x`?`overscrollBehaviorX`:`overscrollBehaviorY`]=E?`contain`:`auto`);let j=n.owner===`content`?{}:{role:n.role??`group`,"aria-label":n.label,tabIndex:S&&o?0:C?-1:void 0};return{...b,...j,ref:z(b.ref),style:w,"data-scroll-axis":e,"data-scrollable-inline":V.inline.isScrollable?`true`:void 0,"data-scrollable-block":V.block.isScrollable?`true`:void 0,"data-scroll-inline-start":V.inline.atStart?`true`:void 0,"data-scroll-inline-end":V.inline.atEnd?`true`:void 0,"data-scroll-block-start":V.block.atStart?`true`:void 0,"data-scroll-block-end":V.block.atEnd?`true`:void 0}},[e,z,n,x,y,i,V,s,l]),getContentProps:(0,c.useCallback)((e={})=>({...e,ref:B(e.ref),"data-scroll-content":``}),[B]),state:V}}export{F as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{c as n,l as r,n as i,u as a}from"./themeProps-3IqahpCr.js";import{a as o,h as s,s as c}from"./tokens.stylex-DkHf0P9C.js";import{c as l,v as u}from"./padding.stylex-B76907Zf.js";import{a as d,c as f,i as p,r as m,s as h,t as g}from"./useLayerDismissal-BAnTRYTt.js";var _=t((e=>{var t=a();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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=i,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=i.p;try{if(u.T=null,i.p=2,e)return e()}finally{u.T=t,i.p=n,i.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,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,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=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.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=d(n,t.crossOrigin);i.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=d(t.as,t.crossOrigin);i.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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),v=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=_()})),y=e(a(),1),ee=v();function b(e){return(e.style.anchorName??``).split(`,`).map(e=>e.trim()).filter(Boolean)}function x(e,t){e.style.anchorName=t.join(`, `)}function S(e,t){let n=b(e);n.includes(t)||(n.push(t),x(e,n))}function C(e,t){x(e,b(e).filter(e=>e!==t))}var w=0,T=null,E=!1;function D(){w+=1}function O(){T=w}function k(){E||typeof document>`u`||(E=!0,document.addEventListener(`pointerdown`,D,!0),document.addEventListener(`keydown`,D,!0),document.addEventListener(`click`,O,!0))}function A(){return k(),w}function j(){return k(),T===w}var M=new Set(`p.h1.h2.h3.h4.h5.h6.dt.pre.legend.data.dfn.meter.output.progress.option.optgroup.table.thead.tbody.tfoot.tr.colgroup.ul.ol.menu.dl.select.datalist.picture.hgroup.ruby.rt.rp.a.button.label.summary.span.em.strong.b.i.u.s.small.mark.code.kbd.samp.var.sub.sup.abbr.cite.q.time.bdi.bdo.ins.del`.split(`.`));function te(e){if(!e)return null;let t=null,n=e;for(;n;){let e=n.tagName.toLowerCase();if(e===`dialog`)break;M.has(e)&&(t=n),n=n.parentElement}return t?.parentElement??null}var N={gutterBlockStart:`calc(max(var(--spacing-4), env(safe-area-inset-top, 0px)) + var(--astryx-layer-inset-block-start, 0px))`,gutterBlockEnd:`calc(max(var(--spacing-4), env(safe-area-inset-bottom, 0px)) + var(--astryx-layer-inset-block-end, 0px))`,gutterInline:`calc(max(var(--spacing-4), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) + max(var(--astryx-layer-inset-inline-start, 0px), var(--astryx-layer-inset-inline-end, 0px)))`,gutterBlock:`calc(max(var(--spacing-4), env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px)) + max(var(--astryx-layer-inset-block-start, 0px), var(--astryx-layer-inset-block-end, 0px)))`,gutterBlockFallback:`calc(var(--spacing-4) + max(var(--astryx-layer-inset-block-start, 0px), var(--astryx-layer-inset-block-end, 0px)))`,gutterBlockStartFallback:`calc(var(--spacing-4) + var(--astryx-layer-inset-block-start, 0px))`,gutterBlockEndFallback:`calc(var(--spacing-4) + var(--astryx-layer-inset-block-end, 0px))`,gutterInlineFallback:`calc(var(--spacing-4) + max(var(--astryx-layer-inset-inline-start, 0px), var(--astryx-layer-inset-inline-end, 0px)))`,maxInlineSize:`calc(100vi - calc(max(var(--spacing-4), env(safe-area-inset-left, 0px)) + var(--astryx-layer-inset-inline-start, 0px)) - calc(max(var(--spacing-4), env(safe-area-inset-right, 0px)) + var(--astryx-layer-inset-inline-end, 0px)))`,maxInlineSizeFallback:`calc(100vw - var(--spacing-4) - var(--spacing-4) - var(--astryx-layer-inset-inline-start, 0px) - var(--astryx-layer-inset-inline-end, 0px))`,maxBlockSize:`calc(100dvb - calc(max(var(--spacing-4), env(safe-area-inset-top, 0px)) + var(--astryx-layer-inset-block-start, 0px)) - calc(max(var(--spacing-4), env(safe-area-inset-bottom, 0px)) + var(--astryx-layer-inset-block-end, 0px)))`,maxBlockSizeFallback:`calc(100vh - var(--spacing-4) - var(--spacing-4) - var(--astryx-layer-inset-block-start, 0px) - var(--astryx-layer-inset-block-end, 0px))`},P=[[`blockStart`,`--astryx-layer-inset-block-start`],[`blockEnd`,`--astryx-layer-inset-block-end`],[`inlineStart`,`--astryx-layer-inset-inline-start`],[`inlineEnd`,`--astryx-layer-inset-inline-end`]];function F(e){return typeof e==`number`?`${e}px`:e}function I(e){let t={};if(e)for(let[n,r]of P){let i=e[n];i!=null&&i!==``&&(t[r]=F(i))}return t}var L=`--_astryx-layer-clearance`;function R(e,t,n){return`--astryx-layer-slide-${e}-${t}-${n}`}var z=`var(${L}, 0px)`;function B(e,t,n){return`${e}:${t};${e}:${n};`}function V(e){return B(e,N.gutterBlockFallback,N.gutterBlock)}function H(e){return B(e,N.gutterInlineFallback,N.gutterInline)}var U={above:`below`,below:`above`,start:`end`,end:`start`};function W(e){switch(e){case`above`:return`self-block-start span-all`;case`below`:return`self-block-end span-all`;case`start`:return`self-inline-start span-all`;case`end`:return`self-inline-end span-all`}}function G(e){switch(e){case`above`:return`margin-block-end:${z};${V(`margin-block-start`)}`;case`below`:return`margin-block-start:${z};${V(`margin-block-end`)}`;case`start`:return`margin-inline-end:${z};${H(`margin-inline-start`)}`;case`end`:return`margin-inline-start:${z};${H(`margin-inline-end`)}`}}function ne(e){return e===`above`||e===`below`?`${H(`margin-inline-start`)}${H(`margin-inline-end`)}inset-inline-start:0;inset-inline-end:0;`:`${V(`margin-block-start`)}${V(`margin-block-end`)}inset-block-start:0;inset-block-end:0;`}function re(e,t,n){let r=n===`same`?e:U[e];return`@position-try ${R(e,t,n)}{position-area:${W(r)};${G(r)}${ne(r)}}`}var ie=[`above`,`below`,`start`,`end`],K=[`start`,`center`,`end`];function q(){return ie.flatMap(e=>K.flatMap(t=>[re(e,t,`same`),re(e,t,`opposite`)])).join(``)}var J=`astryx-layer-slide-rules`;function ae(e){if(e.getElementById(`astryx-layer-slide-rules`))return;let t=e.createElement(`style`);t.id=J,t.textContent=q(),e.head.appendChild(t)}var Y=(0,y.createContext)(null);Y.displayName=`LayerContext`;function oe(){return(0,y.use)(Y)}var X=n(),Z={keoZOQ:`x1vhfslr`,k1K539:`x119uzjn`,$$css:!0},se={keoZOQ:`x1lhixnp`,k1K539:`xlm3tn6`,$$css:!0},ce={k71WvV:`xa3ewmy`,$$css:!0},le={keTefX:`x1cytvie`,$$css:!0},Q={base:{keoZOQ:`xdj266r`,k1K539:`xat24cr`,keTefX:`x1lziwak`,k71WvV:`x14z9mp`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kVQacm:`x1rea2x4`,kWkggS:`xjbqb8w`,$$css:!0},fixed:{kVAEAm:`xixxii4`,$$css:!0},placementBelow:e=>[Z,{"--x-marginBlockStart":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],placementAbove:e=>[se,{"--x-marginBlockEnd":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],placementEnd:e=>[ce,{keTefX:e==null?e:`x4lel18`,$$css:!0},{"--x-marginInlineStart":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],placementStart:e=>[le,{k71WvV:e==null?e:`x1c9tiao`,$$css:!0},{"--x-marginInlineEnd":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],farBelow:{k1K539:`x119uzjn`,$$css:!0},farAbove:{keoZOQ:`x1lhixnp`,$$css:!0},farEnd:{k71WvV:`xa3ewmy`,$$css:!0},farStart:{keTefX:`x1cytvie`,$$css:!0},viewportFit:{kB7OPa:`x9f619`,ks0D6T:`x1p5vr2b`,kskxy:`xv8yize`,$$css:!0},gutterInlineEnd:{k71WvV:`x1m9hk3x`,$$css:!0},gutterInlineStart:{keTefX:`x1ey4id`,$$css:!0},gutterBlockEnd:{k1K539:`x1chv945`,$$css:!0},gutterBlockStart:{keoZOQ:`x3390rn`,$$css:!0}};function ue(e){return typeof e==`number`?`${e}px`:e}var $=new WeakMap;function de(e,t){$.set(e,($.get(e)??0)+1);try{t()}finally{$.set(e,($.get(e)??1)-1)}}function fe(e){return($.get(e)??0)>0}function pe(e,t){let n=e.ownerDocument.defaultView;if(!n)return{};let r=n.getComputedStyle(e),i=n.getComputedStyle(t);return{...r.direction!==i.direction&&{direction:r.direction},...r.writingMode!==i.writingMode&&{writingMode:r.writingMode}}}function me(e=`above`,t=`center`){if(e===`above`||e===`below`){let n=e===`above`?`self-block-start`:`self-block-end`;return t===`start`?`${n} span-self-inline-end`:t===`end`?`${n} span-self-inline-start`:n}let n=e===`start`?`self-inline-start`:`self-inline-end`;return t===`start`?`${n} span-self-block-end`:t===`end`?`${n} span-self-block-start`:n}function he(e=`above`,t=`center`){let n=`flip-block, flip-inline, flip-block flip-inline`,r=`${R(e,t,`same`)}, ${R(e,t,`opposite`)}`;if(t!==`center`)return`${n}, ${r}`;if(e===`above`||e===`below`){let[t,i]=e===`above`?[`top`,`bottom`]:[`bottom`,`top`];return`${n}, ${t} span-left, ${t} span-right, ${i} span-left, ${i} span-right, ${r}`}let[i,a]=e===`start`?[`left`,`right`]:[`right`,`left`];return`${n}, ${i} span-top, ${i} span-bottom, ${a} span-top, ${a} span-bottom, ${r}`}function ge(e,t,n){if(n||t===`center`)return{};let r=t===`start`?`unsafe self-start`:`unsafe self-end`;return e===`above`||e===`below`?{justifySelf:r}:{alignSelf:r}}function _e(e,t){return e===`above`||e===`below`?t===`start`?[Q.gutterInlineEnd]:t===`end`?[Q.gutterInlineStart]:[Q.gutterInlineStart,Q.gutterInlineEnd]:t===`start`?[Q.gutterBlockEnd]:t===`end`?[Q.gutterBlockStart]:[Q.gutterBlockStart,Q.gutterBlockEnd]}function ve(e,t){let n=(0,y.useRef)(t);return n.current=t,(0,y.useMemo)(()=>({onPointerDown:t=>{if(!n.current)return;let r=t.currentTarget,i=r.ownerDocument;r.setAttribute(`popovertarget`,e);let a=()=>{i.removeEventListener(`pointerup`,a),i.removeEventListener(`pointercancel`,a),i.defaultView?.setTimeout(()=>{r.removeAttribute(`popovertarget`)},0)};i.addEventListener(`pointerup`,a),i.addEventListener(`pointercancel`,a)},onClickCapture:e=>{let t=e.currentTarget;t.hasAttribute(`popovertarget`)&&(e.preventDefault(),t.removeAttribute(`popovertarget`))}}),[e])}function ye(e){let{mode:t,onShow:n,onHide:i,lightDismiss:a=!1}=e,o=t===`context`?e.lazyMount??!1:!1,s=(0,y.useId)(),c=`--astryx-layer-${s.replace(/:/g,``)}`,[f,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(!0),v=(0,y.useRef)(!0),b=(0,y.useCallback)(e=>{v.current!==e&&(v.current=e,_(e))},[]),x=oe()?.inset,w=(0,y.useRef)(null),T=(0,y.useRef)(null),E=(0,y.useRef)(null),D=(0,y.useRef)(null),O=(0,y.useRef)(null),[k,M]=(0,y.useState)(null),N=(0,y.useRef)(!1),P=(0,y.useRef)(!1),F=(0,y.useRef)(null),R=(0,y.useRef)(null),z=(0,y.useCallback)(()=>{let e=A();return F.current===e},[]),B=(0,y.useCallback)(e=>{typeof e.showPopover==`function`?de(e.ownerDocument,()=>{e.showPopover({source:E.current??void 0})}):e.style.display=`block`,T.current=e},[]),V=(0,y.useCallback)(e=>{if(t!==`context`)return!0;let n=O.current;if(n===null)return!1;let r=n.portalTarget??D.current?.parentElement??null;return e.parentElement===r},[t]),H=(0,y.useCallback)(()=>{if(t!==`context`)return;let e=D.current,n=e?.parentElement??null;if(!e||!n)return;let r=te(n),i={portalTarget:r,portalStyle:r?pe(e,r):{}};O.current=i,M(i)},[t]),U=(0,y.useCallback)(()=>{t===`context`&&o&&(O.current=null,M(null))},[t,o]),W=(0,y.useCallback)(()=>{if(z())return;let e=w.current,t=e&&V(e)?e:null;if(!t)N.current=!0,H();else if(!P.current){if(fe(t.ownerDocument)){N.current=!0,queueMicrotask(()=>{N.current&&(N.current=!1,ne.current())});return}B(t),P.current=!0,h(!0),n?.()}},[n,H,B,V,z]),G=(0,y.useCallback)(()=>{if(N.current=!1,P.current){let e=w.current;T.current=null,P.current=!1,e&&(typeof e.hidePopover==`function`?de(e.ownerDocument,()=>{e.hidePopover()}):e.style.display=`none`),h(!1),i?.()}U()},[i,U]),ne=(0,y.useRef)(W);ne.current=W;let re=(0,y.useCallback)(e=>{E.current&&E.current!==e&&C(E.current,c),e&&S(e,c),E.current=e},[c]),ie=(0,y.useCallback)(e=>{if(R.current?.(),j())return;F.current=A();let t=e.defaultView,n=null,r=()=>{F.current=null,e.removeEventListener(`click`,i,!0),n!==null&&(t?.clearTimeout(n),n=null),R.current===r&&(R.current=null)},i=()=>{e.removeEventListener(`click`,i,!0),t?n=t.setTimeout(()=>{n=null,R.current===r&&r()},0):r()};e.addEventListener(`click`,i,!0),R.current=r},[]);(0,y.useEffect)(()=>(A(),()=>R.current?.()),[]);let K=(0,y.useCallback)(e=>{e.newState===`closed`&&P.current&&(T.current=null,P.current=!1,ie(e.currentTarget?.ownerDocument??document),h(!1),i?.(),U())},[i,U,ie]),q=(0,y.useRef)(null),J=(0,y.useRef)(null),Y=(0,y.useCallback)((e,t)=>{q.current&&J.current&&(q.current!==e||J.current!==t)&&(q.current.removeEventListener(`toggle`,J.current),q.current=null,J.current=null),e&&q.current!==e&&(e.addEventListener(`toggle`,t),q.current=e,J.current=t)},[]),Z=(0,y.useCallback)(e=>{w.current=e,Y(e,K),e&&N.current?(N.current=!1,W()):e&&P.current&&T.current!==e&&V(e)&&B(e)},[K,Y,W,B,V]),se=(0,y.useCallback)(e=>{D.current=e,e&&(!o||N.current||P.current)&&H()},[o,H]);(0,y.useEffect)(()=>(w.current&&Y(w.current,K),()=>{q.current&&J.current&&(q.current.removeEventListener(`toggle`,J.current),q.current=null,J.current=null)}),[K,Y]),m(()=>{if(t!==`context`)return;let e=w.current?.ownerDocument??D.current?.ownerDocument;e&&ae(e)},[t,k]),m(()=>{if(!f||t!==`context`)return;let e=E.current;if(!e)return;let n=e.ownerDocument.defaultView;if(n){let t=e.getBoundingClientRect(),r=t.bottom>=0&&t.right>=0&&t.top<=n.innerHeight&&t.left<=n.innerWidth;b(r)}if(typeof IntersectionObserver>`u`)return;let r=new IntersectionObserver(e=>{let t=e[e.length-1];t&&b(t.isIntersecting)});return r.observe(e),()=>r.disconnect()},[f,t,b]);let ce=(0,y.useCallback)((e,t)=>{let n=(0,X.jsx)(`template`,{ref:se});if(k===null)return(0,X.jsx)(X.Fragment,{children:n});let{placement:i=`above`,alignment:o=`center`,positioning:f=`anchor`,offset:m,role:h,"aria-label":_,xstyle:v,className:y,style:b,as:S=`div`,onMouseEnter:C,onMouseLeave:w}=t||{},T=f===`custom`?{positionAnchor:c}:{positionAnchor:c,positionArea:me(i,o),positionTryFallbacks:he(i,o),...ge(i,o,g)},E=m?ue(m):null,D=f===`anchor`&&E!=null?{[L]:E}:{},O=f===`anchor`?E==null?i===`above`?Q.farAbove:i===`below`?Q.farBelow:i===`start`?Q.farStart:Q.farEnd:i===`above`?Q.placementAbove(E):i===`below`?Q.placementBelow(E):i===`start`?Q.placementStart(E):Q.placementEnd(E):null,A=f===`anchor`?[Q.viewportFit,..._e(i,o)]:null,j=r(d.reset,p.reset,Q.base,l.reset,A,O,v),M=y?`${y} ${j.className??``}`:j.className,te=(0,X.jsx)(S,{ref:Z,id:s,role:h,"aria-label":_,popover:a?`auto`:`manual`,className:M,style:{...j.style,...T,...D,...I(x),...k.portalStyle,...b},onMouseEnter:C,onMouseLeave:w,children:(0,X.jsx)(u,{children:e})});return(0,X.jsxs)(X.Fragment,{children:[n,k.portalTarget?(0,ee.createPortal)(te,k.portalTarget):te]})},[c,k,x,s,g,a,Z,se]),le=(0,y.useCallback)((e,t)=>{let{x:n,y:i,xstyle:o,className:c,style:f}=t,m={top:i,left:n},h=r(d.reset,p.reset,Q.base,l.reset,Q.fixed,o),g=c?`${c} ${h.className??``}`:h.className;return(0,X.jsx)(`div`,{ref:Z,id:s,popover:a?`auto`:`manual`,className:g,style:{...h.style,...m,...f},children:(0,X.jsx)(u,{children:e})})},[Z,s,a]),$=(0,y.useMemo)(()=>({ref:re,anchorId:c,show:W,hide:G,isOpen:f,wasJustDismissed:z,id:s,render:ce}),[re,c,W,G,f,z,s,ce]),ve=(0,y.useMemo)(()=>({ref:void 0,show:W,hide:G,isOpen:f,wasJustDismissed:z,id:s,render:le}),[W,G,f,z,s,le]);return t===`context`?$:ve}function be(e){let t=ye(e);return(0,y.useMemo)(()=>{let{wasJustDismissed:e,...n}=t;return n},[t])}var xe=new Set([`touch`,`pen`]),Se=new Set([`button`,`checkbox`,`combobox`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`searchbox`,`slider`,`spinbutton`,`switch`,`tab`,`textbox`]);function Ce(e){let t=e.getAttribute(`role`);if(t!=null&&t!==``)return Se.has(t);switch(e.tagName){case`BUTTON`:case`INPUT`:case`LABEL`:case`SELECT`:case`SUMMARY`:case`TEXTAREA`:return!0;case`A`:case`AREA`:return e.hasAttribute(`href`);default:return we(e)}}function we(e){if(e.isContentEditable===!0)return!0;let t=e.getAttribute(`contenteditable`);return t!=null&&t!==`false`}function Te(e){let{touchTrigger:t,isEnabled:n,isControlled:r,isOpen:i,layerId:a,triggerRef:o,show:s,hide:c}=e,l=(0,y.useRef)(!1),u=(0,y.useRef)(i);u.current=i;let d=(0,y.useRef)(c);d.current=c;let p=(0,y.useRef)(a);p.current=a;let m=(0,y.useRef)(!1),g=(0,y.useRef)(null);f();let _=(0,y.useCallback)(()=>{m.current=!1;let e=g.current;e!=null&&(g.current=null,document.removeEventListener(`pointerdown`,e,!0))},[]),v=(0,y.useCallback)(()=>{if(m.current=!0,g.current!=null)return;let e=e=>{let t=e.target;(t==null||o.current?.contains(t)!==!0&&document.getElementById(p.current)?.contains(t)!==!0)&&(_(),d.current())};g.current=e,document.addEventListener(`pointerdown`,e,!0)},[o,_]);(0,y.useEffect)(()=>_,[_]);let ee=(0,y.useCallback)(()=>l.current&&h()===`pointer`,[]),b=(0,y.useCallback)(e=>{l.current=e.pointerType===`touch`},[]),x=(0,y.useCallback)(e=>{let i=xe.has(e.pointerType);if(l.current=i,!i||r)return!1;let a=o.current;return(t===`auto`?a!=null&&Ce(a)?`none`:`tap`:t)===`none`||!n||u.current||m.current?(_(),c(),!0):(v(),s(),!0)},[t,n,r,o,s,c,v,_]),S=(0,y.useRef)(i);return(0,y.useEffect)(()=>{S.current&&!i&&_(),S.current=i},[i,_]),{isTouchPointerRef:l,isTouchInteraction:ee,handlePointerEnter:b,handlePointerDown:x,clearTapOpen:_}}o[`--duration-fast-max`],c[`--ease-standard`];var Ee={below:{kKVMdj:`xl1vlw0 x1aquc0h`,k44tkh:`x9uej1z`,kyAemX:`x128ha8g`,kWV6AL:`xskzprw`,$$css:!0},above:{kKVMdj:`x3psbcj x1aquc0h`,k44tkh:`x9uej1z`,kyAemX:`x128ha8g`,kWV6AL:`xskzprw`,$$css:!0},end:{kKVMdj:`x1i331go x1vxsm5i x1aquc0h`,k44tkh:`x9uej1z`,kyAemX:`x128ha8g`,kWV6AL:`xskzprw`,$$css:!0},start:{kKVMdj:`xck01x9 x18lne9g x1aquc0h`,k44tkh:`x9uej1z`,kyAemX:`x128ha8g`,kWV6AL:`xskzprw`,$$css:!0}},De=100,Oe={container:{kWkggS:`x19aspcf`,kMwMTN:`xrkvqaz`,kaIpWk:`x1hviunn`,kMv6JI:`x9ynric`,kGuDYH:`xjm74w1`,kLWn49:`xw6l6zx`,$$css:!0}};function ke(e){return e.hasAttribute(`tabindex`)?e.tabIndex>=0:[`A`,`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`].includes(e.tagName)?!e.disabled:!!e.isContentEditable}function Ae(e={}){let{placement:t=`above`,alignment:n=`center`,delay:r=200,hideDelay:a=0,focusTrigger:o=`auto`,touchTrigger:c=`auto`,isEnabled:l=!0,isOpen:u,isDefaultOpen:d=!1,onShow:f,onHide:p}=e,{ref:m,anchorId:h,show:_,hide:v,isOpen:ee,id:b,render:x}=be({mode:`context`,onShow:f,onHide:p}),S=Oe.container,C=(0,y.useRef)(null),w=(0,y.useRef)(null),T=(0,y.useRef)(null),E=(0,y.useCallback)(()=>{C.current&&=(clearTimeout(C.current),null),w.current&&=(clearTimeout(w.current),null)},[]),D=(0,y.useCallback)(()=>{E(),_()},[E,_]),O=(0,y.useCallback)(()=>{E(),v()},[E,v]),{isTouchPointerRef:k,isTouchInteraction:A,handlePointerEnter:j,handlePointerDown:M,clearTapOpen:te}=Te({touchTrigger:c,isEnabled:l,isControlled:u!==void 0,isOpen:ee,layerId:b,triggerRef:T,show:D,hide:O}),N=(0,y.useCallback)(()=>{l&&u!==!1&&(E(),C.current=setTimeout(()=>{_()},r))},[l,u,E,_,r]),P=(0,y.useCallback)(()=>{u!==!0&&(E(),w.current=setTimeout(()=>{v()},a>0?a:De))},[u,E,v,a]),F=(0,y.useCallback)(()=>{w.current&&=(clearTimeout(w.current),null)},[]),I=(0,y.useCallback)(()=>{k.current||N()},[k,N]),L=(0,y.useCallback)(()=>{k.current||P()},[k,P]),R=(0,y.useCallback)(e=>{l&&(A()||e.target.matches(`:focus-visible`)&&(E(),_()))},[l,A,E,_]),z=(0,y.useCallback)(()=>{P()},[P]),B=(0,y.useCallback)(e=>{M(e)||u===void 0&&(E(),v())},[M,u,E,v]),V=(0,y.useCallback)(e=>{T.current&&(T.current.removeEventListener(`mouseenter`,I),T.current.removeEventListener(`mouseleave`,L),T.current.removeEventListener(`focusin`,R),T.current.removeEventListener(`focusout`,z),T.current.removeEventListener(`pointerenter`,j),T.current.removeEventListener(`pointerdown`,B)),e&&(e.addEventListener(`pointerenter`,j),e.addEventListener(`mouseenter`,I),e.addEventListener(`mouseleave`,L),e.addEventListener(`pointerdown`,B),(o===`always`||o===`auto`&&ke(e))&&(e.addEventListener(`focusin`,R),e.addEventListener(`focusout`,z))),T.current=e},[o,I,L,R,z,j,B]),H=(0,y.useCallback)(e=>{m(e),V(e)},[m,V]);return(0,y.useEffect)(()=>()=>{E()},[E]),(0,y.useEffect)(()=>{d&&_()},[]),(0,y.useEffect)(()=>{u!==void 0&&(u?(E(),_()):(E(),v()))},[u,E,_,v]),g({isActive:!0,isPresent:()=>{let e=typeof document>`u`?null:document.getElementById(b);if(e==null)return!1;try{return e.matches(`:popover-open`)}catch{return ee}},onDismiss:()=>{E(),te(),u===void 0?v():p?.()}}),{ref:H,positionRef:m,interactionRef:V,anchorId:h,describedBy:b,renderTooltip:(0,y.useCallback)((e,r)=>{let a=r?.placement??t,o={placement:a,alignment:r?.alignment??n,offset:s[`--spacing-1`],role:`tooltip`,xstyle:[S,Ee[a]],className:i(`tooltip`).className,onMouseEnter:F,onMouseLeave:P};return x((0,X.jsx)(`div`,{className:`xfsso4q xy143xn x12gdq22 x1djylfy xw5ewwj x13faqbe`,children:e}),o)},[x,t,n,S,F,P])}}export{be as a,I as c,v as d,ve as i,N as l,Ee as n,Y as o,Te as r,oe as s,Ae as t,A as u};
package/page/index.html CHANGED
@@ -10,7 +10,7 @@
10
10
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%23000'/%3E%3Cg transform='translate(4 4)' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4.5 18.5c2 0 3-1.2 4.2-3.4l2.6-5c1-1.9 2.1-3.1 4.2-3.1'/%3E%3Cpath d='M5.5 8.2c1.6-.9 3.2-.4 3.8 1.6l2.3 6.6c.6 1.7 2.1 2.4 3.9 1.7'/%3E%3Ccircle cx='19.5' cy='4.5' r='1.6' fill='%23fff' stroke='none'/%3E%3C/g%3E%3C/svg%3E"
11
11
  />
12
12
  <title>theorem studio</title>
13
- <script type="module" crossorigin src="/studio/assets/index-BJyzY1Pv.js"></script>
13
+ <script type="module" crossorigin src="/studio/assets/index-C_weLbPu.js"></script>
14
14
  <link rel="modulepreload" crossorigin href="/studio/assets/rolldown-runtime-hePW80VL.js">
15
15
  <link rel="modulepreload" crossorigin href="/studio/assets/themeProps-3IqahpCr.js">
16
16
  <link rel="modulepreload" crossorigin href="/studio/assets/tokens.stylex-DkHf0P9C.js">
@@ -18,33 +18,32 @@
18
18
  <link rel="modulepreload" crossorigin href="/studio/assets/mergeProps-ptS-gIMz.js">
19
19
  <link rel="modulepreload" crossorigin href="/studio/assets/VStack-CkVMcNiK.js">
20
20
  <link rel="modulepreload" crossorigin href="/studio/assets/StackItem-CQviqAfM.js">
21
+ <link rel="modulepreload" crossorigin href="/studio/assets/useLayerDismissal-BAnTRYTt.js">
21
22
  <link rel="modulepreload" crossorigin href="/studio/assets/devWarning-DxuplmRl.js">
22
23
  <link rel="modulepreload" crossorigin href="/studio/assets/sharedResizeObserver-4U9Xq5Oq.js">
23
24
  <link rel="modulepreload" crossorigin href="/studio/assets/preload-helper-DpV6A1kQ.js">
24
- <link rel="modulepreload" crossorigin href="/studio/assets/Text-bum6zWWx.js">
25
+ <link rel="modulepreload" crossorigin href="/studio/assets/Text-BsiAsowd.js">
25
26
  <link rel="modulepreload" crossorigin href="/studio/assets/useMediaQuery-BCT0NUeZ.js">
26
- <link rel="modulepreload" crossorigin href="/studio/assets/Icon-JrysT8aU.js">
27
+ <link rel="modulepreload" crossorigin href="/studio/assets/Icon-ZfFwTt8n.js">
27
28
  <link rel="modulepreload" crossorigin href="/studio/assets/focusOutline.stylex-BT0kfa4t.js">
28
- <link rel="modulepreload" crossorigin href="/studio/assets/useLayerDismissal-B_G7IWpC.js">
29
- <link rel="modulepreload" crossorigin href="/studio/assets/useTooltip-CJM_xhLB.js">
30
- <link rel="modulepreload" crossorigin href="/studio/assets/IconButton-DlOGzJIX.js">
31
- <link rel="modulepreload" crossorigin href="/studio/assets/useDevWarning-Z9SoixOP.js">
32
- <link rel="modulepreload" crossorigin href="/studio/assets/Tooltip-BH9xiRMl.js">
29
+ <link rel="modulepreload" crossorigin href="/studio/assets/useTooltip-rxACYEAC.js">
30
+ <link rel="modulepreload" crossorigin href="/studio/assets/IconButton-CG5klqF1.js">
31
+ <link rel="modulepreload" crossorigin href="/studio/assets/useDevWarning-Cna3kqg1.js">
32
+ <link rel="modulepreload" crossorigin href="/studio/assets/Tooltip-CTEuMRLe.js">
33
33
  <link rel="modulepreload" crossorigin href="/studio/assets/createReactComponent-CZwsv6DD.js">
34
34
  <link rel="modulepreload" crossorigin href="/studio/assets/isRtlElement-BG33-k_H.js">
35
- <link rel="modulepreload" crossorigin href="/studio/assets/groupStyles-C7Ter7zC.js">
36
- <link rel="modulepreload" crossorigin href="/studio/assets/focusableSelector-DXZeMU85.js">
37
- <link rel="modulepreload" crossorigin href="/studio/assets/SegmentedControlItem-h-aaXzyS.js">
38
- <link rel="modulepreload" crossorigin href="/studio/assets/useClipboard-BgGRxRMJ.js">
39
- <link rel="modulepreload" crossorigin href="/studio/assets/CodeBlock-C7XJ4ioE.js">
35
+ <link rel="modulepreload" crossorigin href="/studio/assets/fieldParts-Cs6Amprh.js">
36
+ <link rel="modulepreload" crossorigin href="/studio/assets/SegmentedControlItem-BLuJOusN.js">
37
+ <link rel="modulepreload" crossorigin href="/studio/assets/useClipboard-B1amtN2V.js">
38
+ <link rel="modulepreload" crossorigin href="/studio/assets/useScrollableArea-vxuztwym.js">
39
+ <link rel="modulepreload" crossorigin href="/studio/assets/CodeBlock-Kjgv83A6.js">
40
40
  <link rel="modulepreload" crossorigin href="/studio/assets/container.stylex-BmOi-8DQ.js">
41
- <link rel="modulepreload" crossorigin href="/studio/assets/Card-Lp-0P5eL.js">
42
- <link rel="modulepreload" crossorigin href="/studio/assets/useScrollableArea-0NzdiBCq.js">
43
- <link rel="modulepreload" crossorigin href="/studio/assets/ScrollableArea-Ckugdj1N.js">
44
- <link rel="modulepreload" crossorigin href="/studio/assets/SidePanel-BL32abk8.js">
41
+ <link rel="modulepreload" crossorigin href="/studio/assets/Card-Ghe4ozhC.js">
42
+ <link rel="modulepreload" crossorigin href="/studio/assets/ScrollableArea-C8AVuqnt.js">
43
+ <link rel="modulepreload" crossorigin href="/studio/assets/SidePanel-OYp0bLNO.js">
45
44
  <link rel="modulepreload" crossorigin href="/studio/assets/IconAlertTriangle-BqAEqqdU.js">
46
- <link rel="modulepreload" crossorigin href="/studio/assets/labels-provider-4TIWDvsE.js">
47
- <link rel="modulepreload" crossorigin href="/studio/assets/Banner-Biro9wFg.js">
45
+ <link rel="modulepreload" crossorigin href="/studio/assets/labels-provider-BqgbdxdT.js">
46
+ <link rel="modulepreload" crossorigin href="/studio/assets/Banner-D2s9xjDu.js">
48
47
  <link rel="modulepreload" crossorigin href="/studio/assets/arrive-DvbqpeRS.js">
49
48
  <link rel="modulepreload" crossorigin href="/studio/assets/Center-nHS1JSux.js">
50
49
  <link rel="modulepreload" crossorigin href="/studio/assets/IconSearch-BTx66a40.js">
@@ -60,10 +59,12 @@
60
59
  <link rel="modulepreload" crossorigin href="/studio/assets/types-EVrOoUBG.js">
61
60
  <link rel="modulepreload" crossorigin href="/studio/assets/useScrollLock-Dyf6PHJt.js">
62
61
  <link rel="modulepreload" crossorigin href="/studio/assets/useContainerReveal-BFy8N_QU.js">
63
- <link rel="modulepreload" crossorigin href="/studio/assets/browser-transport-CxGBlTfw.js">
64
- <link rel="modulepreload" crossorigin href="/studio/assets/Dialog-DELWQo-v.js">
65
- <link rel="modulepreload" crossorigin href="/studio/assets/HoverCard-D1Y1ltWQ.js">
66
- <link rel="modulepreload" crossorigin href="/studio/assets/CheckboxInput-Cj5pk-KI.js">
62
+ <link rel="modulepreload" crossorigin href="/studio/assets/browser-transport-KwpVG2px.js">
63
+ <link rel="modulepreload" crossorigin href="/studio/assets/focusReturn-CTppP2k0.js">
64
+ <link rel="modulepreload" crossorigin href="/studio/assets/chainEventHandlers-C6ttXGfW.js">
65
+ <link rel="modulepreload" crossorigin href="/studio/assets/Dialog-BDUExlk_.js">
66
+ <link rel="modulepreload" crossorigin href="/studio/assets/HoverCard-C6thuzrf.js">
67
+ <link rel="modulepreload" crossorigin href="/studio/assets/CheckboxInput-C9kbVyhK.js">
67
68
  <link rel="modulepreload" crossorigin href="/studio/assets/IconEye-BB5aY-wQ.js">
68
69
  <link rel="modulepreload" crossorigin href="/studio/assets/encode-files-Bc3HJyAh.js">
69
70
  <link rel="modulepreload" crossorigin href="/studio/assets/turn-client-DwVPS3TX.js">
@@ -71,14 +72,14 @@
71
72
  <link rel="modulepreload" crossorigin href="/studio/assets/lent-keys-C32ems-I.js">
72
73
  <link rel="modulepreload" crossorigin href="/studio/assets/editors-BJX_S59A.js">
73
74
  <link rel="modulepreload" crossorigin href="/studio/assets/EmptyState-C8W4JKBZ.js">
74
- <link rel="modulepreload" crossorigin href="/studio/assets/PaneState-BvA2tLQg.js">
75
- <link rel="modulepreload" crossorigin href="/studio/assets/useAdaptivePresentation-BzmPCddb.js">
75
+ <link rel="modulepreload" crossorigin href="/studio/assets/PaneState-C8jetBGI.js">
76
+ <link rel="modulepreload" crossorigin href="/studio/assets/useAdaptivePresentation-BY_zvjIp.js">
76
77
  <link rel="modulepreload" crossorigin href="/studio/assets/Section-DJ97F7QE.js">
77
- <link rel="modulepreload" crossorigin href="/studio/assets/CollapsibleGroup-N7_SOjbm.js">
78
- <link rel="modulepreload" crossorigin href="/studio/assets/ContextMenu-omhsUI8x.js">
79
- <link rel="modulepreload" crossorigin href="/studio/assets/BottomSheet-BwfBDtje.js">
80
- <link rel="stylesheet" crossorigin href="/studio/assets/PaneState-eUzUkNE8.css">
81
- <link rel="stylesheet" crossorigin href="/studio/assets/index-DOaHlqBo.css">
78
+ <link rel="modulepreload" crossorigin href="/studio/assets/CollapsibleGroup-toq0Nedn.js">
79
+ <link rel="modulepreload" crossorigin href="/studio/assets/ContextMenu-Bs-xBzLA.js">
80
+ <link rel="modulepreload" crossorigin href="/studio/assets/BottomSheet-BQPskY35.js">
81
+ <link rel="stylesheet" crossorigin href="/studio/assets/PaneState-CnxaP3LD.css">
82
+ <link rel="stylesheet" crossorigin href="/studio/assets/index-Oo9otEIT.css">
82
83
  <style>html{color-scheme:dark}html,body{margin:0;background:#000}html[data-boot-pending],html[data-boot-pending] body{background:#262626}html[data-boot-pending] .astryx-app-shell{height:100dvh}html[data-boot-pending] .astryx-app-shell-sidenav{position:absolute;inset-block:0;inset-inline-start:0;z-index:0;width:3rem}html[data-boot-pending] #astryx-app-shell-main{position:relative;z-index:1;width:100%;height:100%;max-width:none;margin:0;border-radius:0;clip-path:none;background:#262626;color:#fff}html[data-boot-pending] #astryx-app-shell-main>:not([data-boot]){visibility:hidden}html[data-boot-pending] [data-boot]{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:#262626;color:#fff}</style>
83
84
  <noscript> <style>html[data-boot-pending],html[data-boot-pending] body{background:#000}html[data-boot-pending] #astryx-app-shell-main>:not([data-boot]){visibility:visible !important}[data-boot]{display:none !important}</style>
84
85
  </noscript>
@@ -2,8 +2,8 @@
2
2
  * @generated by `astryx theme build` — do not edit manually.
3
3
  * Source: ui/studio-theme.ts
4
4
  * Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
5
- * CLI: @astryxdesign/cli@0.7.0
6
- * Core: @astryxdesign/core@0.7.0
5
+ * CLI: @astryxdesign/cli@0.7.1
6
+ * Core: @astryxdesign/core@0.7.1
7
7
  */
8
8
 
9
9
  @layer reset, astryx-base, astryx-theme;
@@ -166,6 +166,11 @@
166
166
  --color-syntax-property: light-dark(#005348, #90d7c8);
167
167
  --color-syntax-punctuation: light-dark(#6a6a6a, #9e9e9e);
168
168
  --color-syntax-background: light-dark(#ffffff, #111111);
169
+ --color-syntax-added: color-mix(in srgb, var(--color-success-muted) 25%, transparent);
170
+ --color-syntax-removed: color-mix(in srgb, var(--color-error-muted) 25%, transparent);
171
+ --color-syntax-diff-header: transparent;
172
+ --color-syntax-added-marker: var(--color-syntax-punctuation);
173
+ --color-syntax-removed-marker: var(--color-syntax-punctuation);
169
174
  --color-background-surface: light-dark(#ffffff, #262626);
170
175
  --color-background-body: #000000;
171
176
  --color-background-card: light-dark(#ffffff, #1b1b1b);
@@ -2,8 +2,8 @@
2
2
  * @generated by `astryx theme build` — do not edit manually.
3
3
  * Source: ui/studio-theme.ts
4
4
  * Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
5
- * CLI: @astryxdesign/cli@0.7.0
6
- * Core: @astryxdesign/core@0.7.0
5
+ * CLI: @astryxdesign/cli@0.7.1
6
+ * Core: @astryxdesign/core@0.7.1
7
7
  */
8
8
 
9
9
  export {};
@@ -2,8 +2,8 @@
2
2
  * @generated by `astryx theme build` — do not edit manually.
3
3
  * Source: ui/studio-theme.ts
4
4
  * Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
5
- * CLI: @astryxdesign/cli@0.7.0
6
- * Core: @astryxdesign/core@0.7.0
5
+ * CLI: @astryxdesign/cli@0.7.1
6
+ * Core: @astryxdesign/core@0.7.1
7
7
  */
8
8
 
9
9
  /// <reference path="./theorem-studio.variants.d.ts" />
@@ -2,8 +2,8 @@
2
2
  * @generated by `astryx theme build` — do not edit manually.
3
3
  * Source: ui/studio-theme.ts
4
4
  * Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
5
- * CLI: @astryxdesign/cli@0.7.0
6
- * Core: @astryxdesign/core@0.7.0
5
+ * CLI: @astryxdesign/cli@0.7.1
6
+ * Core: @astryxdesign/core@0.7.1
7
7
  */
8
8
 
9
9
  import { theoremTheme } from '@theoremjs/react/ui/theme';
@@ -100,6 +100,11 @@ export const theoremStudioTheme = {
100
100
  "--color-syntax-property": "light-dark(#005348, #90d7c8)",
101
101
  "--color-syntax-punctuation": "light-dark(#6a6a6a, #9e9e9e)",
102
102
  "--color-syntax-background": "light-dark(#ffffff, #111111)",
103
+ "--color-syntax-added": "color-mix(in srgb, var(--color-success-muted) 25%, transparent)",
104
+ "--color-syntax-removed": "color-mix(in srgb, var(--color-error-muted) 25%, transparent)",
105
+ "--color-syntax-diff-header": "transparent",
106
+ "--color-syntax-added-marker": "var(--color-syntax-punctuation)",
107
+ "--color-syntax-removed-marker": "var(--color-syntax-punctuation)",
103
108
  "--color-background-surface": "light-dark(#ffffff, #262626)",
104
109
  "--color-background-body": "#000000",
105
110
  "--color-background-card": "light-dark(#ffffff, #1b1b1b)",
@@ -2,8 +2,8 @@
2
2
  * @generated by `astryx theme build` — do not edit manually.
3
3
  * Source: ui/studio-theme.ts
4
4
  * Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
5
- * CLI: @astryxdesign/cli@0.7.0
6
- * Core: @astryxdesign/core@0.7.0
5
+ * CLI: @astryxdesign/cli@0.7.1
6
+ * Core: @astryxdesign/core@0.7.1
7
7
  */
8
8
 
9
9
  // Generated by astryx theme build
@@ -1,21 +1,16 @@
1
1
  import type { DiffLine } from '../mod.ts';
2
2
  /**
3
- * Changed lines as a unified diff: removed lines red, added lines green, the lines both share
4
- * between. `sides` names what the `-` and the `+` lines each are. `start` numbers the lines as
5
- * the file had them. `kept` is the side that stands, and the other reads as set aside.
3
+ * Two values as a unified diff, read as prose: removed lines red, added lines green, the lines
4
+ * both share between. `sides` names what the `-` and the `+` lines each are, and `kept` is the
5
+ * side that stands, so the other reads as set aside.
6
6
  */
7
- export declare function DiffBlock({ title, lines, sides, start, kept, isWrapped, maxHeight, }: {
8
- title?: string;
7
+ export declare function DiffBlock({ lines, sides, kept, maxHeight, }: {
9
8
  lines: readonly DiffLine[];
10
9
  /** What the `-` lines and the `+` lines each are. */
11
- sides?: {
10
+ sides: {
12
11
  removed: string;
13
12
  added: string;
14
13
  };
15
- /** The one-based line of the file the first line is. Without it the lines are not numbered. */
16
- start?: number;
17
- kept?: '-' | '+';
18
- /** Whether a long line wraps, for text read as prose. Code scrolls sideways. */
19
- isWrapped?: boolean;
14
+ kept: '-' | '+';
20
15
  maxHeight?: string;
21
16
  }): import("react").JSX.Element;
package/ui/diff-block.js CHANGED
@@ -1,17 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  const SIGN_LABEL = { ' ': undefined, '-': 'Removed', '+': 'Added' };
3
3
  /**
4
- * Changed lines as a unified diff: removed lines red, added lines green, the lines both share
5
- * between. `sides` names what the `-` and the `+` lines each are. `start` numbers the lines as
6
- * the file had them. `kept` is the side that stands, and the other reads as set aside.
4
+ * Two values as a unified diff, read as prose: removed lines red, added lines green, the lines
5
+ * both share between. `sides` names what the `-` and the `+` lines each are, and `kept` is the
6
+ * side that stands, so the other reads as set aside.
7
7
  */
8
- export function DiffBlock({ title, lines, sides, start, kept, isWrapped = false, maxHeight, }) {
8
+ export function DiffBlock({ lines, sides, kept, maxHeight, }) {
9
9
  const count = (sign) => lines.filter((line) => line.sign === sign).length;
10
- // A line the change adds is not one the file had, so it takes no number.
11
- let at = (start ?? 1) - 1;
12
- return (_jsxs("figure", { className: "studio-diff", "data-wrapped": isWrapped, "data-kept": kept, children: [_jsxs("figcaption", { className: "studio-diff-head", children: [sides ? (_jsxs("span", { className: "studio-diff-sides", children: [_jsx("span", { "data-sign": "-", children: `− ${sides.removed}` }), _jsx("span", { "data-sign": "+", children: `+ ${sides.added}` })] })) : (_jsx("span", { className: "studio-diff-title", children: title })), _jsxs("span", { className: "studio-diff-count", children: [_jsx("span", { "data-sign": "+", children: `+${String(count('+'))}` }), _jsx("span", { "data-sign": "-", children: `−${String(count('-'))}` })] })] }), _jsx("div", { className: "studio-diff-lines", style: { maxHeight }, children: lines.map((line, index) => {
13
- if (line.sign !== '+')
14
- at += 1;
15
- return (_jsxs("div", { className: "studio-diff-line", "data-sign": line.sign, children: [start !== undefined && (_jsx("span", { className: "studio-diff-number", "aria-hidden": true, children: line.sign === '+' ? '' : String(at) })), _jsx("span", { className: "studio-diff-sign", role: "img", "aria-label": SIGN_LABEL[line.sign], children: line.sign === '-' ? '−' : line.sign }), _jsx("code", { children: line.text || ' ' })] }, index));
16
- }) })] }));
10
+ return (_jsxs("figure", { className: "studio-diff", "data-kept": kept, children: [_jsxs("figcaption", { className: "studio-diff-head", children: [_jsxs("span", { className: "studio-diff-sides", children: [_jsx("span", { "data-sign": "-", children: `− ${sides.removed}` }), _jsx("span", { "data-sign": "+", children: `+ ${sides.added}` })] }), _jsxs("span", { className: "studio-diff-count", children: [_jsx("span", { "data-sign": "+", children: `+${String(count('+'))}` }), _jsx("span", { "data-sign": "-", children: `−${String(count('-'))}` })] })] }), _jsx("div", { className: "studio-diff-lines", style: { maxHeight }, children: lines.map((line, index) => (_jsxs("div", { className: "studio-diff-line", "data-sign": line.sign, children: [_jsx("span", { className: "studio-diff-sign", role: "img", "aria-label": SIGN_LABEL[line.sign], children: line.sign === '-' ? '−' : line.sign }), _jsx("code", { children: line.text || ' ' })] }, index))) })] }));
17
11
  }
@@ -76,7 +76,7 @@ export function FileConflicts({ conflicts, files, onApply, onClose, }) {
76
76
  }, children: [_jsx(ToggleButton, { value: "source", label: "Keep source code" }), _jsx(ToggleButton, { value: "studio", label: "Keep studio edit" })] })] }), _jsx(DiffBlock, { lines: lineDiff(valueText(conflict, 'source'), valueText(conflict, 'studio')), sides: {
77
77
  removed: sourceName,
78
78
  added: SIDE_NAME.studio,
79
- }, kept: pick === 'studio' ? '+' : '-', isWrapped: true, maxHeight: DIFF_MAX_HEIGHT })] }, id));
79
+ }, kept: pick === 'studio' ? '+' : '-', maxHeight: DIFF_MAX_HEIGHT })] }, id));
80
80
  }) }) }) }), footer: _jsx(LayoutFooter, { children: _jsxs(HStack, { gap: 2, justify: "between", children: [_jsx(HStack, { gap: 2, children: !one && (_jsxs(_Fragment, { children: [_jsx(Button, { label: "Keep all source code", variant: "ghost", onClick: () => {
81
81
  all('source');
82
82
  } }), _jsx(Button, { label: "Keep all studio edits", variant: "ghost", onClick: () => {
package/ui/studio-save.js CHANGED
@@ -17,8 +17,7 @@ import { Token } from '@astryxdesign/core/Token';
17
17
  import { VStack } from '@astryxdesign/core/VStack';
18
18
  import { IconFiles, IconListDetails } from '@tabler/icons-react';
19
19
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
20
- import { atStart, removeAgent, resetAgent, startedHere, } from "../mod.js";
21
- import { DiffBlock } from "./diff-block.js";
20
+ import { atStart, removeAgent, resetAgent, startedHere } from "../mod.js";
22
21
  import { reviewSave, undoSave, writeSave } from "./lib/studio-project.js";
23
22
  import { RefusalDetail } from "./refusal-detail.js";
24
23
  /** Wide enough for a reason's sentence to read in a few lines. */
@@ -96,17 +95,19 @@ function reason(change) {
96
95
  return 'The studio could not find where your files set this.';
97
96
  }
98
97
  }
99
- /** One run of changed lines: the lines taken out marked `-`, the lines put in marked `+`. */
98
+ /** One run of changed lines as a unified diff over the file's own language. */
100
99
  function HunkBlock({ file, hunk }) {
101
- const signed = (sign) => (text) => ({ sign, text });
102
- return (_jsx(DiffBlock, { title: file.created || file.removed
103
- ? `${fileNote(file)} · ${file.file}`
104
- : `${file.file}:${String(hunk.line)}`, start: hunk.line - hunk.lead.length, lines: [
105
- ...hunk.lead.map(signed(' ')),
106
- ...hunk.removed.map(signed('-')),
107
- ...hunk.added.map(signed('+')),
108
- ...hunk.trail.map(signed(' ')),
109
- ] }));
100
+ const signed = (sign) => (text) => `${sign}${text}`;
101
+ const code = [
102
+ ...hunk.lead.map(signed(' ')),
103
+ ...hunk.removed.map(signed('-')),
104
+ ...hunk.added.map(signed('+')),
105
+ ...hunk.trail.map(signed(' ')),
106
+ ].join('\n');
107
+ const place = file.created || file.removed
108
+ ? `${fileNote(file)} · ${file.file}`
109
+ : `${file.file}:${String(hunk.line)}`;
110
+ return (_jsx(CodeBlock, { code: code, language: file.file.split('.').at(-1), title: `${place} · +${String(hunk.added.length)} −${String(hunk.removed.length)}`, isDiff: true, size: "sm" }));
110
111
  }
111
112
  /** What happens to a file: it is new, it goes, or how many places in it change. */
112
113
  function fileNote(file) {
@@ -23,7 +23,7 @@ import { TreeList } from '@astryxdesign/core/TreeList';
23
23
  import { VStack } from '@astryxdesign/core/VStack';
24
24
  import { IconActivity, IconAdjustmentsHorizontal, IconArrowBarToDown, IconArrowLeft, IconBrowserShare, IconCheck, IconCloud, IconCode, IconCopy, IconCopyPlus, IconFile, IconFileSmile, IconFileZip, IconKey, IconMenu2, IconPlayerPlay, IconPlaylistX, IconPlus, IconRestore, IconRotateClockwise, IconSearch, IconShieldSearch, IconSitemap, IconSparkles, IconTool, IconX, } from '@tabler/icons-react';
25
25
  import { profileGraphFacet } from '@theoremjs/agents';
26
- import { InPlace, PaneFailure, RaisedPane, useDisclosureMotion, useLabels, } from '@theoremjs/react/ui';
26
+ import { InPlace, PaneFailure, RaisedPane, useDisclosureMotion, } from '@theoremjs/react/ui';
27
27
  import { canonical } from "../canonical.js";
28
28
  import { addAgent, addArchitectExample, addProvider, agentNodeId, compileWorkspace, createBlankDraft, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createStudioRunId, draftFacets, duplicateAgent, editedSince, excludeFacet, includableFacets, includeFacet, libraryDraft, localProviderAddress, mergedWithFiles, modelBindingNodeId, modelRoute, modelSharers, modelSlots, nodeOrigins, onStudioLocal, openOutcome, originLabel, originPlace, originWay, providerIdOf, providerNodeId, providerUse, rebased, removeAgent, removeLibraryTool, removeProvider, renameProvider, reopened, resetAgent, resetAll, resetLibraryTool, resetProvider, sampleToolInput, saveStudioRunPayload, scopedNodeId, setToolAllowed, sharedAsk, sharedAt, sharedEntries, studioNodeRef, studioSource, studioTree, toolSpecKeyOf, withAgentDraft, withFilesChosen, withProvider, workspaceNodeRef, workspaceRunAgent, workspaceTree, writeAsk, } from "../mod.js";
29
29
  import { studioSurface } from "../surface.js";
@@ -1735,8 +1735,7 @@ function ClearHistoryButton({ run }) {
1735
1735
  /** The preview's header: back to the editor, the agent to chat with, history, trace, and Export. */
1736
1736
  function PreviewHeader({ store, chatAgents, chatWith, compile, run, connection, trace, testing, copy, setSheet, }) {
1737
1737
  const testLabel = testing.open ? 'Close guardrail test' : 'Test guardrails';
1738
- const t = useLabels();
1739
- const traceLabel = t(trace.open ? '@theorem.panel.trace.hide' : '@theorem.panel.trace.show');
1738
+ const traceLabel = trace.open ? 'Hide trace' : 'View trace';
1740
1739
  const { compiled } = compile;
1741
1740
  return (_jsx(Section, { variant: "transparent", paddingInline: 3, paddingBlock: 0, children: _jsxs(HStack, { gap: 2, vAlign: "center", children: [_jsx(SheetButton, { label: "Back to the editor", icon: IconArrowLeft, sheet: null, setSheet: setSheet }), _jsx(StackItem, { size: "fill", children: _jsx(ChatPicker, { agents: chatAgents, chatWith: chatWith, onChange: store.chatWith }) }), _jsx(StackItem, { size: "static", children: _jsxs(HStack, { gap: 1, vAlign: "center", children: [_jsx(ActingAsButton, {}), compile.payload && run.isUsed && !testing.open && _jsx(ClearHistoryButton, { run: run }), compile.payload && (_jsx(IconButton, { label: testLabel, variant: "ghost", tooltip: testLabel, icon: _jsx(Icon, { icon: IconShieldSearch, size: "sm" }), "aria-pressed": testing.open, onClick: testing.toggle })), _jsx(ExportActions, { store: store, compiled: compiled.ok ? compiled : undefined, chatted: compile.chatted, chattedId: compile.chattedId, blocked: compile.blocked, copy: copy, connection: {
1742
1741
  connectionMode: connection.mode,
package/ui/studio.css CHANGED
@@ -315,13 +315,6 @@ button.inspector-origin:hover {
315
315
  color: var(--color-text-secondary);
316
316
  }
317
317
 
318
- .studio-diff-title {
319
- min-width: 0;
320
- overflow: hidden;
321
- text-overflow: ellipsis;
322
- white-space: nowrap;
323
- }
324
-
325
318
  .studio-diff-sides {
326
319
  display: flex;
327
320
  flex-wrap: wrap;
@@ -344,18 +337,14 @@ button.inspector-origin:hover {
344
337
  color: var(--color-text-green);
345
338
  }
346
339
 
347
- /* The gutters size to their widest cell and every line shares them. */
340
+ /* The sign gutter sizes to its widest cell and every line shares it. */
348
341
  .studio-diff-lines {
349
342
  display: grid;
350
- grid-template-columns: repeat(2, max-content) minmax(max-content, 1fr);
343
+ grid-template-columns: max-content minmax(0, 1fr);
351
344
  overflow: auto;
352
345
  padding-block: var(--spacing-1);
353
346
  }
354
347
 
355
- .studio-diff[data-wrapped="true"] .studio-diff-lines {
356
- grid-template-columns: repeat(2, max-content) minmax(0, 1fr);
357
- }
358
-
359
348
  .studio-diff-line {
360
349
  display: grid;
361
350
  grid-column: 1 / -1;
@@ -370,17 +359,11 @@ button.inspector-origin:hover {
370
359
  background: var(--color-background-green);
371
360
  }
372
361
 
373
- .studio-diff-number,
374
362
  .studio-diff-sign {
375
363
  padding-inline: var(--spacing-2);
376
364
  color: var(--color-text-secondary);
377
- text-align: end;
378
- user-select: none;
379
- }
380
-
381
- .studio-diff-sign {
382
- grid-column: 2;
383
365
  text-align: center;
366
+ user-select: none;
384
367
  }
385
368
 
386
369
  .studio-diff-line[data-sign="-"] .studio-diff-sign {
@@ -392,16 +375,11 @@ button.inspector-origin:hover {
392
375
  }
393
376
 
394
377
  .studio-diff-line code {
395
- grid-column: 3;
396
378
  padding-inline-end: var(--spacing-3);
397
379
  font: inherit;
398
- white-space: pre;
399
- transition: opacity 120ms ease;
400
- }
401
-
402
- .studio-diff[data-wrapped="true"] .studio-diff-line code {
403
380
  white-space: pre-wrap;
404
381
  overflow-wrap: anywhere;
382
+ transition: opacity 120ms ease;
405
383
  }
406
384
 
407
385
  /* The side that does not stand is set aside: struck through and faint. */
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TraceInspector-D1OEjVvd.js","assets/rolldown-runtime-hePW80VL.js","assets/themeProps-3IqahpCr.js","assets/tokens.stylex-DkHf0P9C.js","assets/SegmentedControlItem-h-aaXzyS.js","assets/padding.stylex-B76907Zf.js","assets/VStack-CkVMcNiK.js","assets/mergeProps-ptS-gIMz.js","assets/StackItem-CQviqAfM.js","assets/groupStyles-C7Ter7zC.js","assets/Icon-JrysT8aU.js","assets/devWarning-DxuplmRl.js","assets/Text-bum6zWWx.js","assets/sharedResizeObserver-4U9Xq5Oq.js","assets/preload-helper-DpV6A1kQ.js","assets/useMediaQuery-BCT0NUeZ.js","assets/focusOutline.stylex-BT0kfa4t.js","assets/useLayerDismissal-B_G7IWpC.js","assets/IconButton-DlOGzJIX.js","assets/useTooltip-CJM_xhLB.js","assets/useDevWarning-Z9SoixOP.js","assets/Tooltip-BH9xiRMl.js","assets/createReactComponent-CZwsv6DD.js","assets/isRtlElement-BG33-k_H.js","assets/focusableSelector-DXZeMU85.js","assets/CodeBlock-C7XJ4ioE.js","assets/useClipboard-BgGRxRMJ.js","assets/DateInput-BGrQ5tPC.js","assets/Card-Lp-0P5eL.js","assets/container.stylex-BmOi-8DQ.js","assets/ScrollableArea-Ckugdj1N.js","assets/useScrollableArea-0NzdiBCq.js","assets/BottomSheet-BwfBDtje.js","assets/useScrollLock-Dyf6PHJt.js","assets/SidePanel-BL32abk8.js","assets/CheckboxInput-Cj5pk-KI.js","assets/IconAlertTriangle-BqAEqqdU.js","assets/arrive-DvbqpeRS.js","assets/IconShield-DDOh7Gr5.js","assets/shaped-data-BcarWqd5.js","assets/host-patterns-C9RMP16Q.js","assets/trace-record-C3zNksA_.js","assets/TraceOverview-CqhEG7KQ.js","assets/labels-provider-4TIWDvsE.js","assets/index-BJyzY1Pv.js","assets/browser-transport-CxGBlTfw.js","assets/Center-nHS1JSux.js","assets/IconSearch-BTx66a40.js","assets/schemas-BQ9Jydzb.js","assets/tool-schema-BrqSc6vO.js","assets/reader-B0gVhfoZ.js","assets/live-ingress-lDUGPwth.js","assets/trace-schema-9CdEyG6Q.js","assets/stub-DEZDrr-l.js","assets/tree-DeO1319a.js","assets/types-EVrOoUBG.js","assets/useContainerReveal-BFy8N_QU.js","assets/Dialog-DELWQo-v.js","assets/HoverCard-D1Y1ltWQ.js","assets/IconEye-BB5aY-wQ.js","assets/turn-client-DwVPS3TX.js","assets/encode-files-Bc3HJyAh.js","assets/workspace-Ck0o-_fd.js","assets/lent-keys-C32ems-I.js","assets/editors-BJX_S59A.js","assets/EmptyState-C8W4JKBZ.js","assets/PaneState-BvA2tLQg.js","assets/PaneState-eUzUkNE8.css","assets/CollapsibleGroup-N7_SOjbm.js","assets/useAdaptivePresentation-BzmPCddb.js","assets/Section-DJ97F7QE.js","assets/ContextMenu-omhsUI8x.js","assets/index-DOaHlqBo.css","assets/trace-patterns-DnYJa0nI.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{h as a}from"./tokens.stylex-DkHf0P9C.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{D as s,O as c}from"./groupStyles-C7Ter7zC.js";import{b as l,t as u}from"./Icon-JrysT8aU.js";import{d,r as f}from"./IconButton-DlOGzJIX.js";import{_ as p,c as m,d as h,f as g,l as _,m as v,p as y,t as b,u as x}from"./SidePanel-BL32abk8.js";import{t as S}from"./preload-helper-DpV6A1kQ.js";import{n as C,t as w}from"./labels-provider-4TIWDvsE.js";import{t as T}from"./createReactComponent-CZwsv6DD.js";import{a as E}from"./ScrollableArea-Ckugdj1N.js";var D=T(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),O=T(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),k=e(i(),1),A=t(),j=(0,k.lazy)(()=>S(()=>import(`./TraceInspector-D1OEjVvd.js`).then(e=>({default:e.TraceGuardrailsBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73]))),M=(0,k.lazy)(()=>S(()=>import(`./TraceInspector-D1OEjVvd.js`).then(e=>({default:e.TraceFeedBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73]))),N=(0,k.createContext)(`replace`);function P({value:e,children:t}){return(0,A.jsx)(N,{value:e,children:t})}function F({id:e,header:t,traces:n}){return(0,A.jsx)(m,{id:e,header:t,children:e=>(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(M,{traces:n,isWide:e})})})}function I(e,t,n){let r=C(),i=(0,k.useId)(),[a,o]=(0,k.useState)(!1),s=(0,k.use)(N),c={name:r(`@theorem.panel.trace.name`),show:r(`@theorem.panel.trace.show`),hide:r(`@theorem.panel.trace.hide`),resize:r(`@theorem.panel.trace.resize`)};if(e.observability?.record!==!0)return{toggle:null,view:null,labels:c,offered:!1};let l=n??a,d=n===void 0?(0,A.jsx)(h,{labels:c,icon:(0,A.jsx)(u,{icon:E}),panelId:i,open:l,onToggle:()=>o(e=>!e)}):null;return{toggle:d,view:l?L(s===`panel`,i,t,d):null,labels:c,offered:!0}}function L(e,t,n,r){return e?(0,A.jsx)(R,{id:t,traces:n}):(0,A.jsx)(F,{id:t,header:r?(0,A.jsx)(x,{floating:!0,children:r}):void 0,traces:n})}function R({id:e,traces:t}){let{ref:n,width:r}=v();return(0,A.jsx)(`div`,{id:e,ref:n,style:{height:`100%`},children:(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(M,{traces:t,isWide:g(r)})})})}function z({inspector:e,children:t}){let n=(0,k.useRef)(null),r=y(n,!1),i=(0,k.useRef)(void 0),a=(0,k.useCallback)(e=>{n.current=e;let t=i.current;typeof t==`function`?t(e):t!=null&&(t.current=e)},[]);if(!(0,k.isValidElement)(t))return(0,A.jsx)(b,{view:e.view,children:t});i.current=t.props.ref;let o=e.view!=null;return(0,k.cloneElement)(t,{ref:a,end:(0,A.jsx)(_,{labels:e.labels,resizable:r.resizable,open:o,children:e.view})})}function B({inspector:e,children:t}){return(0,k.use)(N)===`panel`&&e.offered?(0,A.jsx)(z,{inspector:e,children:t}):(0,A.jsx)(b,{view:e.view,children:t})}function V({records:e,head:t}){return(0,A.jsx)(w,{children:(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(j,{records:e,head:t})})})}var H={info:`info`,warning:`warning`,error:`error`,success:`success`},U={info:`accent`,warning:`warning`,error:`error`,success:`success`},W={root:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kMv6JI:`xjb2p0i`,$$css:!0},rootElevatedCard:{kaIpWk:`x1vf2byn`,$$css:!0},header:{k1xSpc:`x78zum5`,kGNEyG:`x1cy8zhl`,kwnvtZ:`x1a02dak`,k1C7PZ:`xak3so`,khm7nJ:`x4olc9o`,k8WAf4:`x8o8v82`,kg3NbH:`x1pzlopt`,$$css:!0},headerCardStandalone:{kaIpWk:`x1vf2byn`,$$css:!0},headerCardWithContent:{krdFHd:`xwxb7qi`,kfmiAY:`x13nour3`,kVL7Gh:`xbiv7yw`,kT0f0o:`x16uus16`,$$css:!0},headerCentered:{kGNEyG:`x6s0dn4`,$$css:!0},endArea:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kwnvtZ:`x1a02dak`,kjj79g:`x13a6bvl`,kOIVth:`x1txdalj`,kmuXW:`x2lah0s`,ks0D6T:`x193iq5w`,keTefX:`xvc5jky`,kqGvvJ:`x81ka23`,$$css:!0},chevron:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},chevronExpanded:{k3aq6I:`x19jd1h0`,$$css:!0}},G={info:{kWkggS:`xgcxg3y`,$$css:!0},warning:{kWkggS:`x24i8r5`,$$css:!0},error:{kWkggS:`x1pritpl`,$$css:!0},success:{kWkggS:`xu13z74`,$$css:!0}};function K(e){return Object.prototype.hasOwnProperty.call(G,e)}var ee={none:{kGVxlE:`x1gnnqk1`,$$css:!0},low:{kGVxlE:`x1i5ehqx`,$$css:!0},med:{kGVxlE:`x14hfi27`,$$css:!0},high:{kGVxlE:`x1kcpxr7`,$$css:!0}};function q({status:e,title:t,description:i,icon:m,isDismissable:h=!1,onDismiss:g,dismissLabel:_,endContent:v,container:y=`card`,elevation:b=`none`,collapsible:x=!0,children:S,xstyle:C,className:w,style:T,ref:E,onFocusCapture:D,onPointerDownCapture:O,...j}){let M=l(),[N,P]=(0,k.useState)(!1),F=typeof x==`object`&&x?x:{},{isEnabled:I,isOpen:L,toggle:R}=p({isCollapsible:x!==!1&&{...F,defaultIsOpen:F.defaultIsOpen??!1}}),z=(0,k.useRef)(null),B=(0,k.useId)(),V=H[e],q=U[e],J=s(S),Y=M(`@astryx.banner.dismiss`),te=_??Y,ne=_??(typeof t==`string`?M(`@astryx.banner.dismissTitled`,{dismiss:Y,title:t}):Y);if(N)return null;let X=(e,t)=>{e instanceof HTMLElement&&e!==document.body&&!t.contains(e)&&(z.current=e)},re=e=>{X(e.relatedTarget,e.currentTarget)},ie=e=>{X(document.activeElement,e.currentTarget)},ae=()=>{let e=z.current;P(!0),g?.(),e?.isConnected&&e.focus()},Z=I&&J,oe=s(v)||h||Z,se=s(v)||h,ce=!s(i)&&se,Q=J&&(!I||L),$=y===`card`;return(0,A.jsxs)(`div`,{ref:E,onFocusCapture:c(D,re),onPointerDownCapture:c(O,ie),...o(r(`banner-frame`,{container:y,elevation:b}),n(W.root,ee[b],$&&b!==`none`&&W.rootElevatedCard,C),w,T),...j,children:[(0,A.jsxs)(`div`,{...o(r(`banner`,{container:y,status:e}),n(W.header,ce&&W.headerCentered,K(e)&&G[e],$&&(Q?W.headerCardWithContent:W.headerCardStandalone))),children:[(0,A.jsx)(`div`,{...s(m)?o(r(`banner-icon`,{status:e}),{className:`x78zum5 x6s0dn4 x2lah0s`}):{className:`x78zum5 x6s0dn4 x2lah0s`},"aria-hidden":`true`,children:s(m)?m:V==null?null:(0,A.jsx)(u,{icon:V,size:`md`,color:q,...r(`banner-icon`,{status:e})})}),(0,A.jsxs)(`div`,{...{0:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli`},1:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli xgualba`}}[!!s(v)|0],children:[(0,A.jsx)(`div`,{className:`x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0 xj0a0fe`,children:t}),s(i)&&(0,A.jsx)(`div`,{...o(r(`banner-description`),{className:`x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4 xj0a0fe`}),children:i})]}),oe&&(0,A.jsxs)(`div`,{...n(W.endArea,d.inset(a[`--spacing-2`])),children:[v,Z&&(0,A.jsx)(f,{variant:`ghost`,size:`sm`,label:M(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),tooltip:M(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),icon:(0,A.jsx)(u,{icon:`chevronDown`,size:`sm`,color:`inherit`,xstyle:[W.chevron,L&&W.chevronExpanded]}),onClick:R,"aria-expanded":L,"aria-controls":Q?B:void 0,isIconOnly:!0}),h&&(0,A.jsx)(f,{variant:`ghost`,size:`sm`,label:ne,tooltip:te,icon:(0,A.jsx)(u,{icon:`close`,size:`sm`,color:`inherit`}),onClick:ae,isIconOnly:!0})]})]}),Q&&(0,A.jsx)(`div`,{id:Z?B:void 0,...o(r(`banner-content`,{container:y,status:e}),{0:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh`},1:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x1k5g1gk x1eprgri`}}[!!$|0]),children:S})]})}q.displayName=`Banner`;export{I as a,B as i,V as n,O as o,P as r,D as s,q as t};