@openchambery/web 2.0.0-beta.8 → 2.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AssistantView-CxAzKd78.js → AssistantView-CLFPj5Ki.js} +3 -3
- package/dist/assets/{DiagramView-BBPsLqLq.js → DiagramView-oeXj4YHn.js} +1 -1
- package/dist/assets/{MarkdownRenderer-yq2DPZUG.js → MarkdownRenderer-BK69MEHQ.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-CD0RYNWX.js → MarkdownRendererImpl-CahUctxC.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-CECVYTH6.js → MarkstreamRendererImpl-5JUaTSdl.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DOwW-F0i.js → MobileDetailNavigation-agQ-Yhpd.js} +1 -1
- package/dist/assets/{MobileShareBridge-d0hQ2FSQ.js → MobileShareBridge-yCN95dYg.js} +1 -1
- package/dist/assets/{MobileSurface-qalyCN7X.js → MobileSurface-D0HP_lTS.js} +1 -1
- package/dist/assets/{MultiRunWindow-DOdFEgMg.js → MultiRunWindow-C0HqMFpp.js} +1 -1
- package/dist/assets/{OverlayScrollbar-S-7EePsU.js → OverlayScrollbar-CRfGtcmG.js} +1 -1
- package/dist/assets/{SettingsView-DVxMbeKC.js → SettingsView-xLYb22wV.js} +1 -1
- package/dist/assets/{SettingsWindow-vKn-MWGU.js → SettingsWindow-B_d5Aqq3.js} +1 -1
- package/dist/assets/{TerminalView-BgPjY0CO.js → TerminalView-DdNQQb8W.js} +1 -1
- package/dist/assets/{ToolOutputDialog-DtT3wbie.js → ToolOutputDialog-4DC5OE1J.js} +1 -1
- package/dist/assets/{appThemeRegistry-DC5NRV_i.js → appThemeRegistry-LkVH62uF.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-B8Blr6EI.js → fileMentionTouchSelection-CBzDuQxP.js} +1 -1
- package/dist/assets/{gitApi-D9ygh31C.js → gitApi-da8etTTe.js} +1 -1
- package/dist/assets/{insertionBoundaries-DYu8VdgE.js → insertionBoundaries-DQrE5qG2.js} +1 -1
- package/dist/assets/{main-SXMSe99Y.js → main-DYISNvWY.js} +9 -9
- package/dist/assets/{main-B97oNWoh.js → main-KwlAomA8.js} +2 -2
- package/dist/assets/{mcpQueries-zC4-V5b8.js → mcpQueries-3GTWeMU-.js} +1 -1
- package/dist/assets/{miniChat-CIi4PmQO.js → miniChat-DYIqdWi7.js} +2 -2
- package/dist/assets/{mobile-BK0Ov-k5.js → mobile-CwiCcmWt.js} +2 -2
- package/dist/assets/{multirun-UIu_EbC2.js → multirun-C3snjTFs.js} +1 -1
- package/dist/assets/{platform-D_c-T5nO.js → platform-CurqO28D.js} +2 -2
- package/dist/assets/{projectMeta-BPi16qGY.js → projectMeta-BkhYFMaM.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-CnTCJpBd.js → renderElectronMiniChatApp-7iyh_419.js} +2 -2
- package/dist/assets/{renderMobileApp-BFDrOvfv.js → renderMobileApp-y0_NeckR.js} +5 -5
- package/dist/assets/{runtimeConfig-023C-il6.js → runtimeConfig-12C5j02f.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-Bdx3CutT.js → runtimeEndpointReset-DTY2ZXXb.js} +1 -1
- package/dist/assets/{sessionChangeSummary-B8xrgW5-.js → sessionChangeSummary-CwPBIb3Z.js} +1 -1
- package/dist/assets/{sessionLookup-DcyGP3xg.js → sessionLookup-0Z4e-J1g.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-BsObV7Pl.js → sortable-tabs-strip-CE7W7lJ9.js} +1 -1
- package/dist/assets/{terminalApi-Dhqqp4xi.js → terminalApi-mDR2jXTo.js} +1 -1
- package/dist/assets/{textarea-BoXpPjTd.js → textarea-XD2oX_Ee.js} +1 -1
- package/dist/assets/{useAppFontEffects-BauzQXF0.js → useAppFontEffects-y_GTVXhJ.js} +53 -53
- package/dist/assets/{useDesktopWindowControlsLayout-kZ4wtPnO.js → useDesktopWindowControlsLayout-CR_DcY77.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-qDoROBC_.js → useEffectiveDirectory-BW9jNyuK.js} +1 -1
- package/dist/assets/{useFontPreferences-Xw1vSkmC.js → useFontPreferences-Bjx8zkGM.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-BDXu5FSG.js → useMobileNavigationStore-DwupvLSA.js} +13 -13
- package/dist/assets/{useSessionAutoCleanup-BHloMhRp.js → useSessionAutoCleanup-DkGO_usj.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-D8luxgem.js → useWorkerHighlightedLines-BUcSLKlL.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +4 -4
- package/dist/mobile.html +4 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n,tt as r}from"./vendor-base-ui-CnHfUmDN.js";import{n as i}from"./vendor-react-DLPElpoQ.js";import{f as a,r as o,t as s}from"./button-DIIrsMjW.js";import{n as c}from"./Icon-B8fSTLdP.js";import{t as l}from"./OverlayScrollbar-S-7EePsU.js";var u=e(n(),1),d=i(),f=t(),p=e(r(),1),m=0,h=()=>{m=Date.now()+800},g=()=>Date.now()<m,_=(e,t)=>{let n=`flex min-h-0 flex-col bg-background shadow-none`;if(e===`page`)return`${n} h-full w-full`;let r=`${n} pwa-overlay-panel`;return t===`top`?`${r} mx-auto mb-auto max-h-[calc(100dvh-0.75rem)] w-full max-w-lg rounded-b-xl border-x border-b border-border/50`:t===`left`?`${r} h-full w-[min(86vw,24rem)] rounded-r-xl border-r border-y border-border/50`:t===`right`?`${r} ml-auto h-full w-[min(86vw,24rem)] rounded-l-xl border-l border-y border-border/50`:`${r} mx-auto mt-auto max-h-[calc(100dvh-0.75rem)] w-full max-w-lg rounded-t-2xl border-x border-t border-border/50 pb-[max(0.5rem,var(--oc-app-bottom-safe,0px),var(--oc-safe-area-bottom,env(safe-area-inset-bottom,0px)))]`},v=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:0)),y=(e,t,n)=>{let r=Number.isFinite(t)&&t>0?t:1,i=Math.max(0,Number.isFinite(e)?e:0)/r,a=v(n[0]??1),o=Math.abs(i-a);for(let e=1;e<n.length;e+=1){let t=v(n[e]??a),r=Math.abs(i-t);r<o&&(a=t,o=r)}return a},b=(e,t)=>{let n=v(t),r=`${(1-n)*100}%`;return{progress:n,scrimOpacity:n,surfaceOpacity:n,surfaceTransform:e===`left`?`translate3d(-${r}, 0, 0)`:e===`right`?`translate3d(${r}, 0, 0)`:e===`top`?`translate3d(0, -${r}, 0)`:`translate3d(0, ${r}, 0)`}},x=(e,t)=>{let n=v(t);return e===`present`?n:1-n},S=(e,t)=>e===`present`?+(t===`commit`):t===`commit`?0:1,C=e=>+!!e,w=.72,T=.98,E=[w,T],D=180,O=`cubic-bezier(0.32, 0.72, 0, 1)`,k=64,A=()=>Math.max(1,window.innerHeight),j=(e,t,n=k,r)=>e<=N(t,r)-n,M=(e,t,n)=>Math.min(t*T,Math.max(n?0:t*w,e)),N=(e,t)=>{let n=Math.max(1,e)*w;return t==null||!Number.isFinite(t)?n:Math.min(n,Math.max(0,t))},P=(e,t,n)=>{let r=N(t,n),i=Math.max(1,t)*T;return Math.abs(e-r)<=Math.abs(e-i)?w:T},F=({initialSnapPoint:e=w,fitContent:t=!1,onDismiss:n,dismissThresholdPx:r=k}={})=>{let i=u.useRef(null),a=u.useRef(null),o=u.useRef(null),s=u.useRef(null),c=u.useRef(null),l=u.useRef(null),d=u.useRef(!1),[f,p]=u.useState(e),m=u.useRef(e),h=u.useRef(n);h.current=n;let g=u.useCallback(()=>{o.current!==null&&window.cancelAnimationFrame(o.current),o.current=null},[]),_=u.useCallback((e,n)=>{let r=i.current,a=m.current;if(m.current=e,p(e),g(),s.current=null,c.current?.cancel(),c.current=null,!r)return;let o=n??r.getBoundingClientRect().height;t&&a===.72&&l.current===null&&(l.current=N(A(),o));let u=e===.72?N(A(),t?l.current:void 0):A()*T;if(r.style.height=``,r.style.willChange=``,Math.abs(o-u)<1||typeof r.animate!=`function`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let d=r.animate([{height:`${o}px`},{height:`${u}px`}],{duration:D,easing:O,fill:`both`});c.current=d,d.finished.catch(()=>void 0).then(()=>{c.current===d&&(c.current=null,d.cancel())})},[g,t]),v=u.useCallback(e=>{if(!e.isPrimary||e.pointerType===`mouse`&&e.button!==0)return;let n=i.current;if(!n)return;let r=n.getBoundingClientRect().height;t&&m.current===.72&&(l.current=N(A(),r)),c.current?.cancel(),c.current=null,n.style.height=`${r}px`,n.style.willChange=`height`,a.current={pointerId:e.pointerId,startY:e.clientY,startHeight:r,startSnapPoint:m.current,viewportHeight:A()},d.current=!1,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[t]),b=u.useCallback(e=>{let t=a.current,n=i.current;if(!t||t.pointerId!==e.pointerId||!n)return;let r=t.startY-e.clientY;Math.abs(r)>3&&(d.current=!0),s.current=M(t.startHeight+r,t.viewportHeight,!!h.current),o.current===null&&(o.current=window.requestAnimationFrame(()=>{o.current=null,i.current&&s.current!==null&&(i.current.style.height=`${s.current}px`)})),e.preventDefault()},[]),x=u.useCallback((e,n)=>{let o=a.current,c=i.current;if(!o||o.pointerId!==e.pointerId||!c)return;a.current=null,g();let u=s.current??c.getBoundingClientRect().height;if(s.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),!n&&h.current&&j(u,o.viewportHeight,r,t?l.current:void 0)){c.style.willChange=``,h.current(),e.preventDefault();return}let d=n?o.startSnapPoint:t?P(u,o.viewportHeight,l.current):y(u,o.viewportHeight,E);_(d,u),e.preventDefault()},[g,r,t,_]),S=u.useCallback(()=>{if(d.current){d.current=!1;return}_(m.current===.98?w:T)},[_]),C=u.useCallback(e=>{let t=null;(e.key===`ArrowUp`||e.key===`Home`)&&(t=T),(e.key===`ArrowDown`||e.key===`End`)&&(t=w),(e.key===`Enter`||e.key===` `)&&(t=m.current===.98?w:T),t!==null&&(e.preventDefault(),_(t))},[_]),F=u.useCallback(()=>{a.current=null,g(),s.current=null,c.current?.cancel(),c.current=null,l.current=null,m.current=e,p(e),i.current&&(i.current.style.height=``,i.current.style.willChange=``)},[g,e]);return u.useEffect(()=>()=>{g(),c.current?.cancel()},[g]),{surfaceRef:i,snapPoint:f,handlePointerDown:v,handlePointerMove:b,handlePointerUp:e=>x(e,!1),handlePointerCancel:e=>x(e,!0),handleClick:S,handleKeyDown:C,reset:F}},I=e=>{let t=(0,d.c)(12),{controller:n,ariaLabel:r}=e,i;t[0]===n.snapPoint?i=t[1]:(i=Math.round(n.snapPoint*100),t[0]=n.snapPoint,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,f.jsx)(`div`,{className:`h-1.5 w-11 rounded-full bg-[var(--interactive-border)]`}),t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==n.handleClick||t[5]!==n.handleKeyDown||t[6]!==n.handlePointerCancel||t[7]!==n.handlePointerDown||t[8]!==n.handlePointerMove||t[9]!==n.handlePointerUp||t[10]!==i?(o=(0,f.jsx)(`div`,{"data-mobile-sheet-snap-handle":!0,role:`separator`,tabIndex:0,"aria-label":r,"aria-orientation":`horizontal`,"aria-valuemin":w*100,"aria-valuemax":T*100,"aria-valuenow":i,className:`flex min-h-8 cursor-ns-resize touch-none justify-center pt-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--interactive-focus-ring)]`,onPointerDown:n.handlePointerDown,onPointerMove:n.handlePointerMove,onPointerUp:n.handlePointerUp,onPointerCancel:n.handlePointerCancel,onClick:n.handleClick,onKeyDown:n.handleKeyDown,children:a}),t[3]=r,t[4]=n.handleClick,t[5]=n.handleKeyDown,t[6]=n.handlePointerCancel,t[7]=n.handlePointerDown,t[8]=n.handlePointerMove,t[9]=n.handlePointerUp,t[10]=i,t[11]=o):o=t[11],o},L=new WeakMap;function R(e){L.set(e.currentTarget,!0)}function z(e){if(L.delete(e.currentTarget))return!0;if(e.detail!==0)return!1;if(typeof document>`u`)return!0;let t=document.activeElement,n=e.currentTarget;return n instanceof Node&&t instanceof Node&&n.contains(t)}function B(e){e.target===e.currentTarget&&R(e)}function V(e){return e.target===e.currentTarget&&z(e)}var H=new class{entries=[];listeners=new Set;previousOverflow=null;getSnapshot=()=>this.entries.at(-1)?.id??null;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));add(e,t){return this.entries=[...this.entries.filter(t=>t.id!==e.id),e],this.entries.length===1&&t&&(this.previousOverflow=t.style.overflow,t.style.overflow=`hidden`),this.emit(),()=>this.remove(e.id,t)}remove(e,t){let n=this.entries.length;this.entries=this.entries.filter(t=>t.id!==e),n>0&&this.entries.length===0&&t&&this.previousOverflow!==null&&(t.style.overflow=this.previousOverflow,this.previousOverflow=null),this.emit()}closeTop(){this.entries.at(-1)?.onClose()}emit(){for(let e of this.listeners)e()}},U=`mobile-sessions`,W=new Map,G=e=>W.get(e)??null,ee=(e,t)=>(W.set(e,t),()=>{W.get(e)===t&&W.delete(e)}),K=`.overlay-scrollbar-container`,q=1,J=e=>e===`left`||e===`right`?`x`:`y`,te=e=>e===`bottom`||e===`right`?1:-1,Y=(e,t,n)=>{let r=J(e)===`x`?t:n;return Math.max(0,r*te(e))},ne=(e,t,n,r,i)=>{let a=Y(e,t,n),o=Math.abs(J(e)===`x`?n:t);return Math.hypot(t,n)>r&&a>0&&o<a*i},re=(e,t)=>Math.min(1,Math.max(0,e/Math.max(1,t))),ie=(e,t,n,r)=>Math.min(r,Math.max(n,e*t)),ae=(e,t,n,r,i)=>e>=n||e>=i&&t>=r,oe=(e,t,n,r,i)=>t!==0&&n>0?t*i/n:r>80?0:e,X=(e,t,n=q)=>{if(t===`bottom`)return e.scrollTop<=n;if(t===`top`)return e.scrollTop>=e.scrollHeight-e.clientHeight-n;if(e.matches?.(`:dir(rtl)`)){let r=e.scrollWidth-e.clientWidth;return t===`right`?Math.abs(e.scrollLeft)<=n:Math.abs(e.scrollLeft)>=r-n}return t===`right`?e.scrollLeft<=n:e.scrollLeft>=e.scrollWidth-e.clientWidth-n},se=(e,t)=>{for(let n=0;n<e.length;n+=1){let r=e.item(n);if(r?.identifier===t)return r}return null},Z=(e,t)=>{let n=window.getComputedStyle(e),r=J(t),i=r===`x`?n.overflowX:n.overflowY,a=r===`x`?e.scrollWidth:e.scrollHeight,o=r===`x`?e.clientWidth:e.clientHeight;return(i===`auto`||i===`scroll`||i===`overlay`)&&a>o},ce=(e,t,n,r)=>{let i=t instanceof Element?t:null,a=i instanceof HTMLElement?i:i?.parentElement??null;for(;a&&e.contains(a);){if(Z(a,n))return a;if(a===e)break;a=a.parentElement}let o=i?.closest(r)??null;return o&&e.contains(o)&&Z(o,n)?o:null},le=e=>{let t=u.useRef(e),n=u.useRef(null),r=u.useRef(null);return t.current=e,u.useCallback(e=>{if(n.current?.(),n.current=null,!e)return;let i=()=>{let e=r.current;r.current=null,e?.active&&e.controller?.finish(`cancel`)},a=(e,t,n)=>{let r=J(e.edge)===`x`?t.clientX:t.clientY,i=n-e.lastTime,a=r-e.lastPrimary;e.velocity=oe(e.velocity,a,i,n-e.lastVelocityTime,te(e.edge)),a!==0&&i>0&&(e.lastVelocityTime=n),e.lastPrimary=r,e.lastTime=n,e.distance=Y(e.edge,t.clientX-e.startX,t.clientY-e.startY)},o=n=>{i();let a=t.current;if(a.disabled||n.touches.length!==1)return;let o=n.target instanceof Element?n.target:null,s=a.reservedTargetSelector?o?.closest(a.reservedTargetSelector):null;if(s&&e.contains(s)||o?.closest(`input, textarea, select, [contenteditable=""], [contenteditable="true"], [data-mobile-sheet-no-dismiss]`))return;let c=n.touches[0],l=ce(e,n.target,a.edge,a.scrollContainerSelector??K);if(l&&!X(l,a.edge))return;let u=e.getBoundingClientRect(),d=J(a.edge)===`x`?u.width||window.innerWidth:u.height||window.innerHeight;r.current={edge:a.edge,motionId:a.motionId,touchId:c.identifier,startX:c.clientX,startY:c.clientY,lastPrimary:J(a.edge)===`x`?c.clientX:c.clientY,lastTime:n.timeStamp,lastVelocityTime:n.timeStamp,velocity:0,distance:0,commitDistance:ie(d,a.commitDistanceRatio??.1,a.minCommitDistance??40,a.maxCommitDistance??64),motionDistance:d,intentDistance:a.intentDistance??8,maxOffAxisRatio:a.maxOffAxisRatio??1,flingVelocity:a.flingVelocity??.65,flingMinDistance:a.flingMinDistance??12,controller:null,active:!1}},s=e=>{let n=r.current;if(!n)return;if(t.current.disabled||e.touches.length!==1){i();return}let o=se(e.touches,n.touchId);if(!o){i();return}if(a(n,o,e.timeStamp),!n.active){if(Math.hypot(o.clientX-n.startX,o.clientY-n.startY)<=n.intentDistance)return;if(!ne(n.edge,o.clientX-n.startX,o.clientY-n.startY,n.intentDistance,n.maxOffAxisRatio)){r.current=null;return}let e=G(n.motionId);if(!e){r.current=null;return}if(!e.begin(`dismiss`)){r.current=null;return}n.active=!0,n.controller=e}n.controller?.update(re(n.distance,n.motionDistance)),e.preventDefault()},c=e=>{let t=r.current;if(!t)return;let n=se(e.changedTouches,t.touchId);if(!n){i();return}if(r.current=null,!t.active)return;a(t,n,e.timeStamp),t.controller?.update(re(t.distance,t.motionDistance));let o=ae(t.distance,t.velocity,t.commitDistance,t.flingVelocity,t.flingMinDistance);t.controller?.finish(o?`commit`:`cancel`),e.preventDefault()},l=()=>i();e.addEventListener(`touchstart`,o,{passive:!0,capture:!0}),e.addEventListener(`touchmove`,s,{passive:!1,capture:!0}),e.addEventListener(`touchend`,c,{passive:!1,capture:!0}),e.addEventListener(`touchcancel`,l,{passive:!0,capture:!0}),n.current=()=>{i(),e.removeEventListener(`touchstart`,o,!0),e.removeEventListener(`touchmove`,s,!0),e.removeEventListener(`touchend`,c,!0),e.removeEventListener(`touchcancel`,l,!0)}},[])},ue=`mobile-overlay-root`,de=200,fe=80,pe=`cubic-bezier(0.32, 0.72, 0, 1)`,me=`a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,he=()=>{if(typeof document>`u`)return null;let e=document.getElementById(ue);return e||(e=document.createElement(`div`),e.id=ue,document.body.appendChild(e)),e},ge=()=>typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,Q=({id:e,open:t,onOpenChange:n,keepMounted:r=!1,presentation:i=`sheet`,edge:a=`bottom`,children:s,className:c,scrimClassName:l,surfaceClassName:d,surfaceElementRef:m,dismissGesture:h=!1,onExitComplete:v,onPreviewChange:y,ariaLabel:w})=>{let T=u.useRef(null),E=u.useRef(null),D=u.useRef(null),O=u.useRef(t),k=u.useRef(n),A=u.useRef(v),j=u.useRef(y),M=u.useRef(0),N=u.useRef(0),P=u.useRef(null),F=u.useRef([]),I=u.useRef(null),L=u.useRef(`standard`),R=u.useRef(`present`),z=u.useRef(0),U=u.useRef(!1),W=u.useRef(t),G=u.useRef(!1),K=u.useRef(t),q=u.useRef(null),[J,te]=u.useState(t),[Y,ne]=u.useState(t),[re,ie]=u.useState(`standard`),[ae,oe]=u.useState(!1),X=re===`interactive-present`,se=u.useSyncExternalStore(H.subscribe,H.getSnapshot,H.getSnapshot),Z=Y&&!X&&se===e,ce=le({motionId:e,edge:a,disabled:!h,...typeof h==`object`?h:{}}),ue=u.useCallback(e=>{D.current=e,ce(e),typeof m==`function`?m(e):m&&typeof m==`object`&&(m.current=e)},[ce,m]),Q=u.useCallback(()=>{K.current&&(K.current=!1,ne(!1),r||te(!1),A.current?.())},[r]);O.current=t,k.current=n,A.current=v,j.current=y,u.useLayoutEffect(()=>{j.current?.(Y&&X)},[Y,X]),typeof document<`u`&&!T.current&&(T.current=he());let $=u.useCallback(e=>{let t=b(a,e);M.current=t.progress,!(!E.current||!D.current)&&(E.current.style.opacity=String(t.scrimOpacity),D.current.style.transform=t.surfaceTransform,D.current.style.opacity=String(t.surfaceOpacity))},[a]),_e=u.useCallback(()=>{P.current!==null&&window.cancelAnimationFrame(P.current),P.current=null},[]),ve=u.useCallback(()=>{E.current&&(E.current.style.willChange=``),D.current&&(D.current.style.willChange=``)},[]),ye=u.useCallback((e=F.current)=>{for(let t of e)t.cancel();F.current=[]},[]),be=u.useCallback(()=>{_e();let e=I.current;if(e){let t=e.animations[1]?.effect?.getComputedTiming().progress;$(typeof t==`number`&&Number.isFinite(t)?e.from+(e.target-e.from)*t:M.current),ye(e.animations),I.current=null}else ye();ve(),oe(!1)},[$,ye,_e,ve]),xe=u.useCallback((e,t)=>{if(I.current?.target===e)return;be();let n=M.current,r=E.current,i=D.current;if(oe(!0),!r||!i||ge()||n===e){$(e),ve(),oe(!1),t?.();return}let o=b(a,n),s=b(a,e);r.style.willChange=`opacity`,i.style.willChange=`transform, opacity`;let c=Math.max(fe,de*Math.abs(e-n)),l=[r.animate([{opacity:o.scrimOpacity},{opacity:s.scrimOpacity}],{duration:c,easing:pe,fill:`forwards`}),i.animate([{transform:o.surfaceTransform,opacity:o.surfaceOpacity},{transform:s.surfaceTransform,opacity:s.surfaceOpacity}],{duration:c,easing:pe,fill:`forwards`})];F.current=l;let u={from:n,target:e,animations:l};I.current=u,Promise.all(l.map(e=>e.finished.catch(()=>void 0))).then(()=>{I.current===u&&($(e),ye(l),I.current=null,ve(),oe(!1),t?.())})},[$,ye,ve,a,be]);if(u.useLayoutEffect(()=>{G.current=J,J&&$(N.current)},[$,J]),u.useLayoutEffect(()=>{K.current=Y},[Y]),u.useEffect(()=>{t&&!G.current&&(N.current=M.current,te(!0)),t&&!K.current&&(K.current=!0,ne(!0)),G.current&&L.current===`standard`&&xe(C(t),()=>{!O.current&&L.current===`standard`&&Q()})},[Q,t,xe]),u.useLayoutEffect(()=>{!J||L.current!==`standard`||xe(+!!t,()=>{!O.current&&L.current===`standard`&&Q()})},[Q,J,t,xe]),u.useEffect(()=>{if(!(!Y||X))return window.dispatchEvent(new Event(`oc:mobile-overlay-opened`)),()=>{window.dispatchEvent(new Event(`oc:mobile-overlay-closed`))}},[Y,X]),u.useEffect(()=>{if(!(!Y||X))return H.add({id:e,onClose:()=>k.current(!1)},document.body)},[Y,e,X]),u.useEffect(()=>{if(!Y||X||!Z)return;let e=D.current,t=document.activeElement instanceof HTMLElement?document.activeElement:null;e?.focus({preventScroll:!0});let n=t=>{if(t.key===`Escape`&&H.closeTop(),t.key!==`Tab`||!e)return;let n=Array.from(e.querySelectorAll(me)).filter(e=>!e.closest(`[data-mobile-sheet-snap-handle]`)),r=n[0]??e,i=n.at(-1)??e;t.shiftKey&&document.activeElement===r&&(t.preventDefault(),i.focus({preventScroll:!0})),!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),r.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`keydown`,n),g()||t?.focus({preventScroll:!0})}},[Y,X,Z]),q.current={begin:e=>{if(e===`dismiss`&&(!K.current||L.current===`interactive-present`))return!1;be(),z.current+=1,U.current=!0,R.current=e;let t=e===`present`?`interactive-present`:`interactive-dismiss`;return L.current=t,ie(t),oe(!0),e===`present`&&(N.current=M.current,K.current=!0,ne(!0),te(!0)),!0},update:e=>{U.current&&(N.current=x(R.current,e),P.current===null&&(P.current=window.requestAnimationFrame(()=>{P.current=null,U.current&&$(N.current)})))},finish:e=>{if(!U.current)return;U.current=!1;let t=z.current,n=R.current,r=S(n,e);P.current!==null&&(_e(),$(N.current)),xe(r,()=>{t===z.current&&(e===`commit`&&k.current(n===`present`),n===`present`&&e===`cancel`&&!O.current&&Q(),L.current=`standard`,ie(`standard`),r===0&&Q())})},interrupt:()=>{z.current+=1,U.current=!1;let e=L.current===`interactive-present`&&!O.current;e||(L.current=`standard`,ie(`standard`)),be(),xe(C(O.current),()=>{O.current||Q(),e&&(L.current=`standard`,ie(`standard`))})}},u.useLayoutEffect(()=>{let e=W.current;W.current=t,e&&!t&&L.current!==`standard`&&q.current?.interrupt()},[t]),u.useEffect(()=>{let t=ee(e,{begin:e=>q.current?.begin(e)??!1,update:e=>q.current?.update(e),finish:e=>q.current?.finish(e),interrupt:()=>q.current?.interrupt()});return()=>{t(),_e(),ye(),I.current=null,ve(),q.current=null}},[ye,_e,ve,e]),!J||!T.current)return null;let Se=(0,f.jsx)(`div`,{ref:E,className:o(`oc-mobile-window-motion oc-keyboard-inset-surface fixed inset-0 z-[60] flex flex-col bg-[rgb(0_0_0_/_0.45)]`,ae&&`oc-mobile-window-motion-active`,!Y&&!X&&`pointer-events-none invisible`,l,c),"data-mobile-overlay-active":String(Y),role:X?void 0:`dialog`,"aria-label":X?void 0:w,"aria-modal":Y&&Z?`true`:void 0,"aria-hidden":X||!Y||!Z||void 0,inert:X||!Y||!Z||void 0,onPointerDown:B,onClick:e=>{!Y||X||!Z||V(e)&&k.current(!1)},children:(0,f.jsx)(`div`,{ref:ue,tabIndex:-1,className:o(`oc-mobile-floating-shell`,_(i,a),d),"data-oc-motion-id":e,style:{contain:`layout paint style`},onClick:e=>e.stopPropagation(),children:s})});return(0,p.createPortal)(Se,T.current)},$=u.createContext(null),_e=e=>{let t=(0,d.c)(5),{children:n}=e,r=u.useContext($);if(!r)return null;let i;t[0]===n?i=t[1]:(i=(0,f.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,p.createPortal)(i,r),t[2]=r,t[3]=i,t[4]=a):a=t[4],a},ve=e=>{let t=(0,d.c)(45),{id:n,open:r,onOpenChange:i,title:a,leading:l,trailing:p,ariaLabel:m,closeAriaLabel:h,resizeAriaLabel:g,initiallyExpanded:_,fitContent:v,bodyClassName:y,children:b}=e,x=_!==void 0&&_,S=v!==void 0&&v,C=x?T:void 0,w;t[0]===i?w=t[1]:(w=()=>i(!1),t[0]=i,t[1]=w);let E;t[2]!==S||t[3]!==C||t[4]!==w?(E={initialSnapPoint:C,fitContent:S,onDismiss:w},t[2]=S,t[3]=C,t[4]=w,t[5]=E):E=t[5];let D=F(E),[O,k]=u.useState(null),A=a!=null||l!=null||p!=null,j=D.snapPoint===T,M=j||!S,N;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(N={reservedTargetSelector:`[data-mobile-sheet-snap-handle]`},t[6]=N):N=t[6];let P=j?`h-[98dvh] max-h-[98dvh]`:S?`h-auto max-h-[72dvh]`:`h-[72dvh] max-h-[98dvh]`,L=D.surfaceRef,R=D.reset,z=M&&`flex-1`,B;t[7]===z?B=t[8]:(B=o(`flex min-h-0 flex-col`,z),t[7]=z,t[8]=B);let V;t[9]!==g||t[10]!==D?(V=(0,f.jsx)(I,{controller:D,ariaLabel:g}),t[9]=g,t[10]=D,t[11]=V):V=t[11];let H;t[12]!==h||t[13]!==S||t[14]!==A||t[15]!==l||t[16]!==i||t[17]!==a||t[18]!==p?(H=A?(0,f.jsxs)(`div`,{className:S?`flex min-h-9 items-center gap-2 px-4 pb-1`:`flex min-h-10 items-center gap-2 px-4 pb-2`,children:[l?(0,f.jsx)(`div`,{className:`flex shrink-0 items-center`,children:l}):null,(0,f.jsx)(`div`,{className:`min-w-0 flex-1`,children:a}),p?(0,f.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:p}):null,(0,f.jsx)(`div`,{ref:k,className:`contents`}),(0,f.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>i(!1),"aria-label":h,className:`shrink-0 text-muted-foreground`,style:{touchAction:`manipulation`},children:(0,f.jsx)(c,{name:`close`,className:`size-5`})})]}):null,t[12]=h,t[13]=S,t[14]=A,t[15]=l,t[16]=i,t[17]=a,t[18]=p,t[19]=H):H=t[19];let U;t[20]!==V||t[21]!==H?(U=(0,f.jsxs)(`div`,{className:`shrink-0`,children:[V,H]}),t[20]=V,t[21]=H,t[22]=U):U=t[22];let W=M&&`flex-1`,G;t[23]!==y||t[24]!==W?(G=o(`flex min-h-0 flex-col overflow-hidden`,W,y),t[23]=y,t[24]=W,t[25]=G):G=t[25];let ee;t[26]!==b||t[27]!==G?(ee=(0,f.jsx)(`div`,{className:G,"data-page-scroll-lock":`true`,children:b}),t[26]=b,t[27]=G,t[28]=ee):ee=t[28];let K;t[29]!==B||t[30]!==U||t[31]!==ee?(K=(0,f.jsxs)(`div`,{className:B,children:[U,ee]}),t[29]=B,t[30]=U,t[31]=ee,t[32]=K):K=t[32];let q;t[33]!==m||t[34]!==n||t[35]!==i||t[36]!==r||t[37]!==D.reset||t[38]!==D.surfaceRef||t[39]!==K||t[40]!==P?(q=(0,f.jsx)(Q,{id:n,open:r,onOpenChange:i,presentation:`sheet`,edge:`bottom`,dismissGesture:N,ariaLabel:m,surfaceClassName:P,surfaceElementRef:L,onExitComplete:R,children:K}),t[33]=m,t[34]=n,t[35]=i,t[36]=r,t[37]=D.reset,t[38]=D.surfaceRef,t[39]=K,t[40]=P,t[41]=q):q=t[41];let J;return t[42]!==O||t[43]!==q?(J=(0,f.jsx)($.Provider,{value:O,children:q}),t[42]=O,t[43]=q,t[44]=J):J=t[44],J};function ye(e,t){let n=(0,d.c)(3),r;return n[0]!==e||n[1]!==t?(r=n=>{[e,t].forEach(e=>{typeof e==`function`?e(n):e&&typeof e==`object`&&(e.current=n)})},n[0]=e,n[1]=t,n[2]=r):r=n[2],r}var be=u.forwardRef((e,t)=>{let n=(0,d.c)(28),{as:r,orientation:i,offset:a,size:o,isEnabled:s,hideTopShadow:c,hideBottomShadow:l,observeMutations:p,onVisibilityChange:m,style:h,className:g,children:_,...v}=e,y=r===void 0?`div`:r,b=i===void 0?`vertical`:i,x=a===void 0?0:a,S=o===void 0?48:o,C=s===void 0||s,w=c!==void 0&&c,T=l!==void 0&&l,E=p===void 0||p,D=u.useRef(null),O=u.useRef(`none`),k=v[`data-scroll-shadow`];delete v[`data-scroll-shadow`];let A=h,j;n[0]!==S||n[1]!==A?(j={...A},j[`--scroll-shadow-size`]=`${S}px`,n[0]=S,n[1]=A,n[2]=j):j=n[2];let M=j,N=xe,P=Se,F;n[3]!==T||n[4]!==w||n[5]!==C||n[6]!==x||n[7]!==m||n[8]!==b?(F=()=>{let e=D.current;if(!e)return;if(!C){P(e),O.current!==`none`&&(O.current=`none`,m?.(`none`));return}let t=b===`vertical`?e.scrollTop>x+1:e.scrollLeft>x+1,n=b===`vertical`?e.scrollHeight-(e.scrollTop+e.clientHeight)>x+1:e.scrollWidth-(e.scrollLeft+e.clientWidth)>x+1,r=w&&b===`vertical`?!1:t;T&&b===`vertical`&&(n=!1),N(e,r,n,b===`vertical`?`top`:`left`,b===`vertical`?`bottom`:`right`);let i=r&&n?`both`:r?b===`vertical`?`top`:`left`:n?b===`vertical`?`bottom`:`right`:`none`;i!==O.current&&(O.current=i,m?.(i))},n[3]=T,n[4]=w,n[5]=C,n[6]=x,n[7]=m,n[8]=b,n[9]=F):F=n[9];let I=F,L,R;n[10]!==I||n[11]!==C?(L=()=>{C||I()},R=[I,C],n[10]=I,n[11]=C,n[12]=L,n[13]=R):(L=n[12],R=n[13]),u.useLayoutEffect(L,R);let z,B;n[14]!==I||n[15]!==C||n[16]!==E?(z=()=>{let e=D.current;if(!e||!C)return;let t=null,n=()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,I()}))},r=n,i=typeof ResizeObserver<`u`?new ResizeObserver(n):null,a=E&&typeof MutationObserver<`u`?new MutationObserver(n):null;return I(),e.addEventListener(`scroll`,r,{passive:!0}),i?.observe(e),a?.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t!==null&&cancelAnimationFrame(t),e.removeEventListener(`scroll`,r),i?.disconnect(),a?.disconnect()}},B=[I,C,E],n[14]=I,n[15]=C,n[16]=E,n[17]=z,n[18]=B):(z=n[17],B=n[18]),u.useEffect(z,B);let V=ye(D,t),H=k??!0,U;return n[19]!==y||n[20]!==_||n[21]!==g||n[22]!==V||n[23]!==M||n[24]!==b||n[25]!==v||n[26]!==H?(U=(0,f.jsx)(y,{...v,ref:V,className:g,"data-orientation":b,"data-scroll-shadow":H,style:M,children:_}),n[19]=y,n[20]=_,n[21]=g,n[22]=V,n[23]=M,n[24]=b,n[25]=v,n[26]=H,n[27]=U):U=n[27],U});be.displayName=`ScrollShadow`;function xe(e,t,n,r,i){let a=`${r}${i.charAt(0).toUpperCase()}${i.slice(1)}Scroll`;t&&n?(e.dataset[a]=`true`,e.removeAttribute(`data-${r}-scroll`),e.removeAttribute(`data-${i}-scroll`)):(e.dataset[`${r}Scroll`]=String(t),e.dataset[`${i}Scroll`]=String(n),e.removeAttribute(`data-${r}-${i}-scroll`))}function Se(e){[`top`,`bottom`,`top-bottom`,`left`,`right`,`left-right`].forEach(t=>{e.removeAttribute(`data-${t}-scroll`)})}var Ce=u.forwardRef((e,t)=>{let n=(0,d.c)(45),r,i,a,s,c,p,m,h,g,_,v,y,b,x,S,C;n[0]===e?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5],p=n[6],m=n[7],h=n[8],g=n[9],_=n[10],v=n[11],y=n[12],b=n[13],x=n[14],S=n[15],C=n[16]):({className:i,outerClassName:c,children:r,style:g,minThumbSize:s,hideDelayMs:a,as:_,scrollbarClassName:h,disableHorizontal:v,observeMutations:y,fillContainer:b,preventOverscroll:x,useScrollShadow:S,scrollShadowSize:m,userIntentOnly:C,...p}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c,n[6]=p,n[7]=m,n[8]=h,n[9]=g,n[10]=_,n[11]=v,n[12]=y,n[13]=b,n[14]=x,n[15]=S,n[16]=C);let w=_===void 0?`div`:_,T=v!==void 0&&v,E=y===void 0||y,D=b===void 0||b,O=x!==void 0&&x,k=S!==void 0&&S,A=C!==void 0&&C,j=u.useRef(null),M,N;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>j.current,N=[],n[17]=M,n[18]=N):(M=n[17],N=n[18]),u.useImperativeHandle(t,M,N);let P=O&&`overscroll-none`,F;n[19]!==c||n[20]!==P?(F=o(`relative flex flex-col min-h-0 w-full overflow-hidden`,P,c),n[19]=c,n[20]=P,n[21]=F):F=n[21];let I;n[22]!==w||n[23]!==r||n[24]!==i||n[25]!==T||n[26]!==D||n[27]!==E||n[28]!==O||n[29]!==p||n[30]!==m||n[31]!==g||n[32]!==k?(I=k?(0,f.jsx)(be,{as:w,ref:j,size:m,className:o(`overlay-scrollbar-target overlay-scrollbar-container`,O&&`overscroll-none`,D?`flex-1 min-h-0 w-full`:`flex-none w-full h-auto`,T?`overflow-y-auto overflow-x-hidden`:`overflow-auto`,i),style:g,observeMutations:E,...p,children:r}):(0,f.jsx)(w,{ref:j,className:o(`overlay-scrollbar-target overlay-scrollbar-container`,O&&`overscroll-none`,D?`flex-1 min-h-0 w-full`:`flex-none w-full h-auto`,T?`overflow-y-auto overflow-x-hidden`:`overflow-auto`,i),style:g,...p,children:r}),n[22]=w,n[23]=r,n[24]=i,n[25]=T,n[26]=D,n[27]=E,n[28]=O,n[29]=p,n[30]=m,n[31]=g,n[32]=k,n[33]=I):I=n[33];let L;n[34]!==T||n[35]!==a||n[36]!==s||n[37]!==E||n[38]!==h||n[39]!==A?(L=(0,f.jsx)(l,{containerRef:j,minThumbSize:s,hideDelayMs:a,className:h,disableHorizontal:T,observeMutations:E,userIntentOnly:A}),n[34]=T,n[35]=a,n[36]=s,n[37]=E,n[38]=h,n[39]=A,n[40]=L):L=n[40];let R;return n[41]!==F||n[42]!==I||n[43]!==L?(R=(0,f.jsxs)(`div`,{className:F,children:[I,L]}),n[41]=F,n[42]=I,n[43]=L,n[44]=R):R=n[44],R});Ce.displayName=`ScrollableOverlay`;function we(e){let t=(0,d.c)(4),{onResizeStart:n,ariaLabel:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,f.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0,children:(0,f.jsx)(`path`,{d:`M9.11111 2L2 9.11111M10 6.44444L6.44444 10`,className:`stroke-muted-foreground`,strokeLinecap:`round`})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,f.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":r,onPointerDown:n,className:`pointer-events-auto -m-2 flex size-7 cursor-ns-resize items-end justify-end p-2 touch-none select-none`,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}var Te=u.forwardRef((e,t)=>{let n=(0,d.c)(64),r,i,s,c,l,p,m,h,g,_,v,y,b,x;n[0]===e?(r=n[1],i=n[2],s=n[3],c=n[4],l=n[5],p=n[6],m=n[7],h=n[8],g=n[9],_=n[10],v=n[11],y=n[12],b=n[13],x=n[14]):({className:r,outerClassName:m,scrollbarClassName:_,fillContainer:y,useScrollShadow:b,scrollShadowSize:g,hasError:l,resizedHeight:i,onResizeHeightChange:p,disabled:s,simple:v,embedded:x,endSlot:c,...h}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=s,n[4]=c,n[5]=l,n[6]=p,n[7]=m,n[8]=h,n[9]=g,n[10]=_,n[11]=v,n[12]=y,n[13]=b,n[14]=x);let S=y!==void 0&&y,C=b!==void 0&&b,w=x!==void 0&&x,{t:T}=a(),E=u.useRef(null),D=u.useRef(null),[O,k]=u.useState(null),A=i??O,j;n[15]===p?j=n[16]:(j=e=>{let t=E.current;if(!t)return;D.current={startY:e.clientY,startHeight:t.getBoundingClientRect().height};let n=e.currentTarget;n.setPointerCapture(e.pointerId);let r=e=>{let t=D.current;if(!t)return;let n=t.startHeight+(e.clientY-t.startY),r=Math.max(82,n);p?p(r):k(r)},i=()=>{D.current=null,n.removeEventListener(`pointermove`,r),n.removeEventListener(`pointerup`,i),n.removeEventListener(`pointercancel`,i)};n.addEventListener(`pointermove`,r),n.addEventListener(`pointerup`,i),n.addEventListener(`pointercancel`,i),e.preventDefault()},n[15]=p,n[16]=j);let M=j,N;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{if(e.target.closest(`textarea, button, [role="separator"]`))return;let t=E.current?.querySelector(`textarea`);t&&document.activeElement!==t&&(e.preventDefault(),t.focus())},n[17]=N):N=n[17];let P=N;if(v){let e=t,i=S?`[field-sizing:fixed]`:`field-sizing-content`,a;n[18]!==r||n[19]!==i?(a=o(`block w-full appearance-none resize-none bg-transparent text-foreground typography-markdown outline-none`,`px-3 py-2 md:typography-ui-label`,`placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`,i,r),n[18]=r,n[19]=i,n[20]=a):a=n[20];let c;return n[21]!==s||n[22]!==S||n[23]!==m||n[24]!==h||n[25]!==g||n[26]!==_||n[27]!==e||n[28]!==a||n[29]!==C?(c=(0,f.jsx)(Ce,{as:`textarea`,ref:e,disableHorizontal:!0,fillContainer:S,useScrollShadow:C,scrollShadowSize:g,outerClassName:m,scrollbarClassName:_,className:a,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,disabled:s,...h}),n[21]=s,n[22]=S,n[23]=m,n[24]=h,n[25]=g,n[26]=_,n[27]=e,n[28]=a,n[29]=C,n[30]=c):c=n[30],c}let F;n[31]===A?F=n[32]:(F=A===null?void 0:{height:`${A}px`},n[31]=A,n[32]=F);let I;if(n[33]!==w||n[34]!==l||n[35]!==m){let e;n[37]===l?e=n[38]:(e=l&&[`ring-[var(--status-error)]`,`focus-within:ring-2 focus-within:ring-[var(--status-error)]`],n[37]=l,n[38]=e);let t;n[39]===w?t=n[40]:(t=w&&[`rounded-none bg-transparent ring-0`,`hover:[&:not(:focus-within)]:bg-transparent`,`has-[[disabled]]:bg-transparent`],n[39]=w,n[40]=t),I=o(`group/textarea relative flex w-full flex-col rounded-[var(--radius-xl)] bg-[var(--surface-elevated)] pb-2.5`,`ring-1 ring-inset ring-border/60 transition duration-200 ease-out`,`hover:[&:not(:focus-within)]:bg-[var(--surface-subtle)]`,`has-[[disabled]]:pointer-events-none has-[[disabled]]:bg-[var(--surface-subtle)] has-[[disabled]]:ring-transparent`,!l&&[`hover:[&:not(:focus-within)]:ring-transparent`,`focus-within:ring-2 focus-within:ring-[var(--interactive-focus-ring)]`],e,t,m),n[33]=w,n[34]=l,n[35]=m,n[36]=I}else I=n[36];let L;n[41]!==r||n[42]!==s?(L=o(`block w-full flex-1 min-h-0 appearance-none resize-none bg-transparent text-foreground typography-markdown outline-none`,`min-h-[82px] pl-3 pr-2.5 pt-2.5 md:typography-ui-label`,`focus-visible:outline-none disabled:cursor-not-allowed`,!s&&[`placeholder:select-none placeholder:text-muted-foreground placeholder:transition placeholder:duration-200 placeholder:ease-out`,`group-hover/textarea:placeholder:text-foreground/80`,`focus:placeholder:text-foreground/80`],s&&`text-muted-foreground/60 placeholder:text-muted-foreground/60`,r),n[41]=r,n[42]=s,n[43]=L):L=n[43];let R;n[44]!==s||n[45]!==h||n[46]!==t||n[47]!==L?(R=(0,f.jsx)(`textarea`,{ref:t,className:L,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,disabled:s,...h}),n[44]=s,n[45]=h,n[46]=t,n[47]=L,n[48]=R):R=n[48];let z;n[49]===T?z=n[50]:(z=T(`textarea.resizeHandleAria`),n[49]=T,n[50]=z);let B;n[51]!==M||n[52]!==z?(B=(0,f.jsx)(we,{onResizeStart:M,ariaLabel:z}),n[51]=M,n[52]=z,n[53]=B):B=n[53];let V;n[54]!==c||n[55]!==B?(V=(0,f.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 pl-3 pr-2.5`,children:[c,B]}),n[54]=c,n[55]=B,n[56]=V):V=n[56];let H;n[57]!==V||n[58]!==R?(H=(0,f.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-2`,children:[R,V]}),n[57]=V,n[58]=R,n[59]=H):H=n[59];let U;return n[60]!==H||n[61]!==F||n[62]!==I?(U=(0,f.jsx)(`div`,{ref:E,onPointerDown:P,style:F,className:I,children:H}),n[60]=H,n[61]=F,n[62]=I,n[63]=U):U=n[63],U});Te.displayName=`Textarea`;export{h as C,g as S,B as _,_e as a,T as b,Y as c,ne as d,ae as f,R as g,z as h,ve as i,re as l,G as m,Ce as n,Q as o,U as p,be as r,ie as s,Te as t,oe as u,V as v,F as x,I as y};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n,tt as r}from"./vendor-base-ui-CnHfUmDN.js";import{n as i}from"./vendor-react-DLPElpoQ.js";import{f as a,r as o,t as s}from"./button-DIIrsMjW.js";import{n as c}from"./Icon-B8fSTLdP.js";import{t as l}from"./OverlayScrollbar-CRfGtcmG.js";var u=e(n(),1),d=i(),f=t(),p=e(r(),1),m=0,h=()=>{m=Date.now()+800},g=()=>Date.now()<m,_=(e,t)=>{let n=`flex min-h-0 flex-col bg-background shadow-none`;if(e===`page`)return`${n} h-full w-full`;let r=`${n} pwa-overlay-panel`;return t===`top`?`${r} mx-auto mb-auto max-h-[calc(100dvh-0.75rem)] w-full max-w-lg rounded-b-xl border-x border-b border-border/50`:t===`left`?`${r} h-full w-[min(86vw,24rem)] rounded-r-xl border-r border-y border-border/50`:t===`right`?`${r} ml-auto h-full w-[min(86vw,24rem)] rounded-l-xl border-l border-y border-border/50`:`${r} mx-auto mt-auto max-h-[calc(100dvh-0.75rem)] w-full max-w-lg rounded-t-2xl border-x border-t border-border/50 pb-[max(0.5rem,var(--oc-app-bottom-safe,0px),var(--oc-safe-area-bottom,env(safe-area-inset-bottom,0px)))]`},v=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:0)),y=(e,t,n)=>{let r=Number.isFinite(t)&&t>0?t:1,i=Math.max(0,Number.isFinite(e)?e:0)/r,a=v(n[0]??1),o=Math.abs(i-a);for(let e=1;e<n.length;e+=1){let t=v(n[e]??a),r=Math.abs(i-t);r<o&&(a=t,o=r)}return a},b=(e,t)=>{let n=v(t),r=`${(1-n)*100}%`;return{progress:n,scrimOpacity:n,surfaceOpacity:n,surfaceTransform:e===`left`?`translate3d(-${r}, 0, 0)`:e===`right`?`translate3d(${r}, 0, 0)`:e===`top`?`translate3d(0, -${r}, 0)`:`translate3d(0, ${r}, 0)`}},x=(e,t)=>{let n=v(t);return e===`present`?n:1-n},S=(e,t)=>e===`present`?+(t===`commit`):t===`commit`?0:1,C=e=>+!!e,w=.72,T=.98,E=[w,T],D=180,O=`cubic-bezier(0.32, 0.72, 0, 1)`,k=64,A=()=>Math.max(1,window.innerHeight),j=(e,t,n=k,r)=>e<=N(t,r)-n,M=(e,t,n)=>Math.min(t*T,Math.max(n?0:t*w,e)),N=(e,t)=>{let n=Math.max(1,e)*w;return t==null||!Number.isFinite(t)?n:Math.min(n,Math.max(0,t))},P=(e,t,n)=>{let r=N(t,n),i=Math.max(1,t)*T;return Math.abs(e-r)<=Math.abs(e-i)?w:T},F=({initialSnapPoint:e=w,fitContent:t=!1,onDismiss:n,dismissThresholdPx:r=k}={})=>{let i=u.useRef(null),a=u.useRef(null),o=u.useRef(null),s=u.useRef(null),c=u.useRef(null),l=u.useRef(null),d=u.useRef(!1),[f,p]=u.useState(e),m=u.useRef(e),h=u.useRef(n);h.current=n;let g=u.useCallback(()=>{o.current!==null&&window.cancelAnimationFrame(o.current),o.current=null},[]),_=u.useCallback((e,n)=>{let r=i.current,a=m.current;if(m.current=e,p(e),g(),s.current=null,c.current?.cancel(),c.current=null,!r)return;let o=n??r.getBoundingClientRect().height;t&&a===.72&&l.current===null&&(l.current=N(A(),o));let u=e===.72?N(A(),t?l.current:void 0):A()*T;if(r.style.height=``,r.style.willChange=``,Math.abs(o-u)<1||typeof r.animate!=`function`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let d=r.animate([{height:`${o}px`},{height:`${u}px`}],{duration:D,easing:O,fill:`both`});c.current=d,d.finished.catch(()=>void 0).then(()=>{c.current===d&&(c.current=null,d.cancel())})},[g,t]),v=u.useCallback(e=>{if(!e.isPrimary||e.pointerType===`mouse`&&e.button!==0)return;let n=i.current;if(!n)return;let r=n.getBoundingClientRect().height;t&&m.current===.72&&(l.current=N(A(),r)),c.current?.cancel(),c.current=null,n.style.height=`${r}px`,n.style.willChange=`height`,a.current={pointerId:e.pointerId,startY:e.clientY,startHeight:r,startSnapPoint:m.current,viewportHeight:A()},d.current=!1,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[t]),b=u.useCallback(e=>{let t=a.current,n=i.current;if(!t||t.pointerId!==e.pointerId||!n)return;let r=t.startY-e.clientY;Math.abs(r)>3&&(d.current=!0),s.current=M(t.startHeight+r,t.viewportHeight,!!h.current),o.current===null&&(o.current=window.requestAnimationFrame(()=>{o.current=null,i.current&&s.current!==null&&(i.current.style.height=`${s.current}px`)})),e.preventDefault()},[]),x=u.useCallback((e,n)=>{let o=a.current,c=i.current;if(!o||o.pointerId!==e.pointerId||!c)return;a.current=null,g();let u=s.current??c.getBoundingClientRect().height;if(s.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),!n&&h.current&&j(u,o.viewportHeight,r,t?l.current:void 0)){c.style.willChange=``,h.current(),e.preventDefault();return}let d=n?o.startSnapPoint:t?P(u,o.viewportHeight,l.current):y(u,o.viewportHeight,E);_(d,u),e.preventDefault()},[g,r,t,_]),S=u.useCallback(()=>{if(d.current){d.current=!1;return}_(m.current===.98?w:T)},[_]),C=u.useCallback(e=>{let t=null;(e.key===`ArrowUp`||e.key===`Home`)&&(t=T),(e.key===`ArrowDown`||e.key===`End`)&&(t=w),(e.key===`Enter`||e.key===` `)&&(t=m.current===.98?w:T),t!==null&&(e.preventDefault(),_(t))},[_]),F=u.useCallback(()=>{a.current=null,g(),s.current=null,c.current?.cancel(),c.current=null,l.current=null,m.current=e,p(e),i.current&&(i.current.style.height=``,i.current.style.willChange=``)},[g,e]);return u.useEffect(()=>()=>{g(),c.current?.cancel()},[g]),{surfaceRef:i,snapPoint:f,handlePointerDown:v,handlePointerMove:b,handlePointerUp:e=>x(e,!1),handlePointerCancel:e=>x(e,!0),handleClick:S,handleKeyDown:C,reset:F}},I=e=>{let t=(0,d.c)(12),{controller:n,ariaLabel:r}=e,i;t[0]===n.snapPoint?i=t[1]:(i=Math.round(n.snapPoint*100),t[0]=n.snapPoint,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,f.jsx)(`div`,{className:`h-1.5 w-11 rounded-full bg-[var(--interactive-border)]`}),t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==n.handleClick||t[5]!==n.handleKeyDown||t[6]!==n.handlePointerCancel||t[7]!==n.handlePointerDown||t[8]!==n.handlePointerMove||t[9]!==n.handlePointerUp||t[10]!==i?(o=(0,f.jsx)(`div`,{"data-mobile-sheet-snap-handle":!0,role:`separator`,tabIndex:0,"aria-label":r,"aria-orientation":`horizontal`,"aria-valuemin":w*100,"aria-valuemax":T*100,"aria-valuenow":i,className:`flex min-h-8 cursor-ns-resize touch-none justify-center pt-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--interactive-focus-ring)]`,onPointerDown:n.handlePointerDown,onPointerMove:n.handlePointerMove,onPointerUp:n.handlePointerUp,onPointerCancel:n.handlePointerCancel,onClick:n.handleClick,onKeyDown:n.handleKeyDown,children:a}),t[3]=r,t[4]=n.handleClick,t[5]=n.handleKeyDown,t[6]=n.handlePointerCancel,t[7]=n.handlePointerDown,t[8]=n.handlePointerMove,t[9]=n.handlePointerUp,t[10]=i,t[11]=o):o=t[11],o},L=new WeakMap;function R(e){L.set(e.currentTarget,!0)}function z(e){if(L.delete(e.currentTarget))return!0;if(e.detail!==0)return!1;if(typeof document>`u`)return!0;let t=document.activeElement,n=e.currentTarget;return n instanceof Node&&t instanceof Node&&n.contains(t)}function B(e){e.target===e.currentTarget&&R(e)}function V(e){return e.target===e.currentTarget&&z(e)}var H=new class{entries=[];listeners=new Set;previousOverflow=null;getSnapshot=()=>this.entries.at(-1)?.id??null;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));add(e,t){return this.entries=[...this.entries.filter(t=>t.id!==e.id),e],this.entries.length===1&&t&&(this.previousOverflow=t.style.overflow,t.style.overflow=`hidden`),this.emit(),()=>this.remove(e.id,t)}remove(e,t){let n=this.entries.length;this.entries=this.entries.filter(t=>t.id!==e),n>0&&this.entries.length===0&&t&&this.previousOverflow!==null&&(t.style.overflow=this.previousOverflow,this.previousOverflow=null),this.emit()}closeTop(){this.entries.at(-1)?.onClose()}emit(){for(let e of this.listeners)e()}},U=`mobile-sessions`,W=new Map,G=e=>W.get(e)??null,ee=(e,t)=>(W.set(e,t),()=>{W.get(e)===t&&W.delete(e)}),K=`.overlay-scrollbar-container`,q=1,J=e=>e===`left`||e===`right`?`x`:`y`,te=e=>e===`bottom`||e===`right`?1:-1,Y=(e,t,n)=>{let r=J(e)===`x`?t:n;return Math.max(0,r*te(e))},ne=(e,t,n,r,i)=>{let a=Y(e,t,n),o=Math.abs(J(e)===`x`?n:t);return Math.hypot(t,n)>r&&a>0&&o<a*i},re=(e,t)=>Math.min(1,Math.max(0,e/Math.max(1,t))),ie=(e,t,n,r)=>Math.min(r,Math.max(n,e*t)),ae=(e,t,n,r,i)=>e>=n||e>=i&&t>=r,oe=(e,t,n,r,i)=>t!==0&&n>0?t*i/n:r>80?0:e,X=(e,t,n=q)=>{if(t===`bottom`)return e.scrollTop<=n;if(t===`top`)return e.scrollTop>=e.scrollHeight-e.clientHeight-n;if(e.matches?.(`:dir(rtl)`)){let r=e.scrollWidth-e.clientWidth;return t===`right`?Math.abs(e.scrollLeft)<=n:Math.abs(e.scrollLeft)>=r-n}return t===`right`?e.scrollLeft<=n:e.scrollLeft>=e.scrollWidth-e.clientWidth-n},se=(e,t)=>{for(let n=0;n<e.length;n+=1){let r=e.item(n);if(r?.identifier===t)return r}return null},Z=(e,t)=>{let n=window.getComputedStyle(e),r=J(t),i=r===`x`?n.overflowX:n.overflowY,a=r===`x`?e.scrollWidth:e.scrollHeight,o=r===`x`?e.clientWidth:e.clientHeight;return(i===`auto`||i===`scroll`||i===`overlay`)&&a>o},ce=(e,t,n,r)=>{let i=t instanceof Element?t:null,a=i instanceof HTMLElement?i:i?.parentElement??null;for(;a&&e.contains(a);){if(Z(a,n))return a;if(a===e)break;a=a.parentElement}let o=i?.closest(r)??null;return o&&e.contains(o)&&Z(o,n)?o:null},le=e=>{let t=u.useRef(e),n=u.useRef(null),r=u.useRef(null);return t.current=e,u.useCallback(e=>{if(n.current?.(),n.current=null,!e)return;let i=()=>{let e=r.current;r.current=null,e?.active&&e.controller?.finish(`cancel`)},a=(e,t,n)=>{let r=J(e.edge)===`x`?t.clientX:t.clientY,i=n-e.lastTime,a=r-e.lastPrimary;e.velocity=oe(e.velocity,a,i,n-e.lastVelocityTime,te(e.edge)),a!==0&&i>0&&(e.lastVelocityTime=n),e.lastPrimary=r,e.lastTime=n,e.distance=Y(e.edge,t.clientX-e.startX,t.clientY-e.startY)},o=n=>{i();let a=t.current;if(a.disabled||n.touches.length!==1)return;let o=n.target instanceof Element?n.target:null,s=a.reservedTargetSelector?o?.closest(a.reservedTargetSelector):null;if(s&&e.contains(s)||o?.closest(`input, textarea, select, [contenteditable=""], [contenteditable="true"], [data-mobile-sheet-no-dismiss]`))return;let c=n.touches[0],l=ce(e,n.target,a.edge,a.scrollContainerSelector??K);if(l&&!X(l,a.edge))return;let u=e.getBoundingClientRect(),d=J(a.edge)===`x`?u.width||window.innerWidth:u.height||window.innerHeight;r.current={edge:a.edge,motionId:a.motionId,touchId:c.identifier,startX:c.clientX,startY:c.clientY,lastPrimary:J(a.edge)===`x`?c.clientX:c.clientY,lastTime:n.timeStamp,lastVelocityTime:n.timeStamp,velocity:0,distance:0,commitDistance:ie(d,a.commitDistanceRatio??.1,a.minCommitDistance??40,a.maxCommitDistance??64),motionDistance:d,intentDistance:a.intentDistance??8,maxOffAxisRatio:a.maxOffAxisRatio??1,flingVelocity:a.flingVelocity??.65,flingMinDistance:a.flingMinDistance??12,controller:null,active:!1}},s=e=>{let n=r.current;if(!n)return;if(t.current.disabled||e.touches.length!==1){i();return}let o=se(e.touches,n.touchId);if(!o){i();return}if(a(n,o,e.timeStamp),!n.active){if(Math.hypot(o.clientX-n.startX,o.clientY-n.startY)<=n.intentDistance)return;if(!ne(n.edge,o.clientX-n.startX,o.clientY-n.startY,n.intentDistance,n.maxOffAxisRatio)){r.current=null;return}let e=G(n.motionId);if(!e){r.current=null;return}if(!e.begin(`dismiss`)){r.current=null;return}n.active=!0,n.controller=e}n.controller?.update(re(n.distance,n.motionDistance)),e.preventDefault()},c=e=>{let t=r.current;if(!t)return;let n=se(e.changedTouches,t.touchId);if(!n){i();return}if(r.current=null,!t.active)return;a(t,n,e.timeStamp),t.controller?.update(re(t.distance,t.motionDistance));let o=ae(t.distance,t.velocity,t.commitDistance,t.flingVelocity,t.flingMinDistance);t.controller?.finish(o?`commit`:`cancel`),e.preventDefault()},l=()=>i();e.addEventListener(`touchstart`,o,{passive:!0,capture:!0}),e.addEventListener(`touchmove`,s,{passive:!1,capture:!0}),e.addEventListener(`touchend`,c,{passive:!1,capture:!0}),e.addEventListener(`touchcancel`,l,{passive:!0,capture:!0}),n.current=()=>{i(),e.removeEventListener(`touchstart`,o,!0),e.removeEventListener(`touchmove`,s,!0),e.removeEventListener(`touchend`,c,!0),e.removeEventListener(`touchcancel`,l,!0)}},[])},ue=`mobile-overlay-root`,de=200,fe=80,pe=`cubic-bezier(0.32, 0.72, 0, 1)`,me=`a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,he=()=>{if(typeof document>`u`)return null;let e=document.getElementById(ue);return e||(e=document.createElement(`div`),e.id=ue,document.body.appendChild(e)),e},ge=()=>typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,Q=({id:e,open:t,onOpenChange:n,keepMounted:r=!1,presentation:i=`sheet`,edge:a=`bottom`,children:s,className:c,scrimClassName:l,surfaceClassName:d,surfaceElementRef:m,dismissGesture:h=!1,onExitComplete:v,onPreviewChange:y,ariaLabel:w})=>{let T=u.useRef(null),E=u.useRef(null),D=u.useRef(null),O=u.useRef(t),k=u.useRef(n),A=u.useRef(v),j=u.useRef(y),M=u.useRef(0),N=u.useRef(0),P=u.useRef(null),F=u.useRef([]),I=u.useRef(null),L=u.useRef(`standard`),R=u.useRef(`present`),z=u.useRef(0),U=u.useRef(!1),W=u.useRef(t),G=u.useRef(!1),K=u.useRef(t),q=u.useRef(null),[J,te]=u.useState(t),[Y,ne]=u.useState(t),[re,ie]=u.useState(`standard`),[ae,oe]=u.useState(!1),X=re===`interactive-present`,se=u.useSyncExternalStore(H.subscribe,H.getSnapshot,H.getSnapshot),Z=Y&&!X&&se===e,ce=le({motionId:e,edge:a,disabled:!h,...typeof h==`object`?h:{}}),ue=u.useCallback(e=>{D.current=e,ce(e),typeof m==`function`?m(e):m&&typeof m==`object`&&(m.current=e)},[ce,m]),Q=u.useCallback(()=>{K.current&&(K.current=!1,ne(!1),r||te(!1),A.current?.())},[r]);O.current=t,k.current=n,A.current=v,j.current=y,u.useLayoutEffect(()=>{j.current?.(Y&&X)},[Y,X]),typeof document<`u`&&!T.current&&(T.current=he());let $=u.useCallback(e=>{let t=b(a,e);M.current=t.progress,!(!E.current||!D.current)&&(E.current.style.opacity=String(t.scrimOpacity),D.current.style.transform=t.surfaceTransform,D.current.style.opacity=String(t.surfaceOpacity))},[a]),_e=u.useCallback(()=>{P.current!==null&&window.cancelAnimationFrame(P.current),P.current=null},[]),ve=u.useCallback(()=>{E.current&&(E.current.style.willChange=``),D.current&&(D.current.style.willChange=``)},[]),ye=u.useCallback((e=F.current)=>{for(let t of e)t.cancel();F.current=[]},[]),be=u.useCallback(()=>{_e();let e=I.current;if(e){let t=e.animations[1]?.effect?.getComputedTiming().progress;$(typeof t==`number`&&Number.isFinite(t)?e.from+(e.target-e.from)*t:M.current),ye(e.animations),I.current=null}else ye();ve(),oe(!1)},[$,ye,_e,ve]),xe=u.useCallback((e,t)=>{if(I.current?.target===e)return;be();let n=M.current,r=E.current,i=D.current;if(oe(!0),!r||!i||ge()||n===e){$(e),ve(),oe(!1),t?.();return}let o=b(a,n),s=b(a,e);r.style.willChange=`opacity`,i.style.willChange=`transform, opacity`;let c=Math.max(fe,de*Math.abs(e-n)),l=[r.animate([{opacity:o.scrimOpacity},{opacity:s.scrimOpacity}],{duration:c,easing:pe,fill:`forwards`}),i.animate([{transform:o.surfaceTransform,opacity:o.surfaceOpacity},{transform:s.surfaceTransform,opacity:s.surfaceOpacity}],{duration:c,easing:pe,fill:`forwards`})];F.current=l;let u={from:n,target:e,animations:l};I.current=u,Promise.all(l.map(e=>e.finished.catch(()=>void 0))).then(()=>{I.current===u&&($(e),ye(l),I.current=null,ve(),oe(!1),t?.())})},[$,ye,ve,a,be]);if(u.useLayoutEffect(()=>{G.current=J,J&&$(N.current)},[$,J]),u.useLayoutEffect(()=>{K.current=Y},[Y]),u.useEffect(()=>{t&&!G.current&&(N.current=M.current,te(!0)),t&&!K.current&&(K.current=!0,ne(!0)),G.current&&L.current===`standard`&&xe(C(t),()=>{!O.current&&L.current===`standard`&&Q()})},[Q,t,xe]),u.useLayoutEffect(()=>{!J||L.current!==`standard`||xe(+!!t,()=>{!O.current&&L.current===`standard`&&Q()})},[Q,J,t,xe]),u.useEffect(()=>{if(!(!Y||X))return window.dispatchEvent(new Event(`oc:mobile-overlay-opened`)),()=>{window.dispatchEvent(new Event(`oc:mobile-overlay-closed`))}},[Y,X]),u.useEffect(()=>{if(!(!Y||X))return H.add({id:e,onClose:()=>k.current(!1)},document.body)},[Y,e,X]),u.useEffect(()=>{if(!Y||X||!Z)return;let e=D.current,t=document.activeElement instanceof HTMLElement?document.activeElement:null;e?.focus({preventScroll:!0});let n=t=>{if(t.key===`Escape`&&H.closeTop(),t.key!==`Tab`||!e)return;let n=Array.from(e.querySelectorAll(me)).filter(e=>!e.closest(`[data-mobile-sheet-snap-handle]`)),r=n[0]??e,i=n.at(-1)??e;t.shiftKey&&document.activeElement===r&&(t.preventDefault(),i.focus({preventScroll:!0})),!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),r.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`keydown`,n),g()||t?.focus({preventScroll:!0})}},[Y,X,Z]),q.current={begin:e=>{if(e===`dismiss`&&(!K.current||L.current===`interactive-present`))return!1;be(),z.current+=1,U.current=!0,R.current=e;let t=e===`present`?`interactive-present`:`interactive-dismiss`;return L.current=t,ie(t),oe(!0),e===`present`&&(N.current=M.current,K.current=!0,ne(!0),te(!0)),!0},update:e=>{U.current&&(N.current=x(R.current,e),P.current===null&&(P.current=window.requestAnimationFrame(()=>{P.current=null,U.current&&$(N.current)})))},finish:e=>{if(!U.current)return;U.current=!1;let t=z.current,n=R.current,r=S(n,e);P.current!==null&&(_e(),$(N.current)),xe(r,()=>{t===z.current&&(e===`commit`&&k.current(n===`present`),n===`present`&&e===`cancel`&&!O.current&&Q(),L.current=`standard`,ie(`standard`),r===0&&Q())})},interrupt:()=>{z.current+=1,U.current=!1;let e=L.current===`interactive-present`&&!O.current;e||(L.current=`standard`,ie(`standard`)),be(),xe(C(O.current),()=>{O.current||Q(),e&&(L.current=`standard`,ie(`standard`))})}},u.useLayoutEffect(()=>{let e=W.current;W.current=t,e&&!t&&L.current!==`standard`&&q.current?.interrupt()},[t]),u.useEffect(()=>{let t=ee(e,{begin:e=>q.current?.begin(e)??!1,update:e=>q.current?.update(e),finish:e=>q.current?.finish(e),interrupt:()=>q.current?.interrupt()});return()=>{t(),_e(),ye(),I.current=null,ve(),q.current=null}},[ye,_e,ve,e]),!J||!T.current)return null;let Se=(0,f.jsx)(`div`,{ref:E,className:o(`oc-mobile-window-motion oc-keyboard-inset-surface fixed inset-0 z-[60] flex flex-col bg-[rgb(0_0_0_/_0.45)]`,ae&&`oc-mobile-window-motion-active`,!Y&&!X&&`pointer-events-none invisible`,l,c),"data-mobile-overlay-active":String(Y),role:X?void 0:`dialog`,"aria-label":X?void 0:w,"aria-modal":Y&&Z?`true`:void 0,"aria-hidden":X||!Y||!Z||void 0,inert:X||!Y||!Z||void 0,onPointerDown:B,onClick:e=>{!Y||X||!Z||V(e)&&k.current(!1)},children:(0,f.jsx)(`div`,{ref:ue,tabIndex:-1,className:o(`oc-mobile-floating-shell`,_(i,a),d),"data-oc-motion-id":e,style:{contain:`layout paint style`},onClick:e=>e.stopPropagation(),children:s})});return(0,p.createPortal)(Se,T.current)},$=u.createContext(null),_e=e=>{let t=(0,d.c)(5),{children:n}=e,r=u.useContext($);if(!r)return null;let i;t[0]===n?i=t[1]:(i=(0,f.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,p.createPortal)(i,r),t[2]=r,t[3]=i,t[4]=a):a=t[4],a},ve=e=>{let t=(0,d.c)(45),{id:n,open:r,onOpenChange:i,title:a,leading:l,trailing:p,ariaLabel:m,closeAriaLabel:h,resizeAriaLabel:g,initiallyExpanded:_,fitContent:v,bodyClassName:y,children:b}=e,x=_!==void 0&&_,S=v!==void 0&&v,C=x?T:void 0,w;t[0]===i?w=t[1]:(w=()=>i(!1),t[0]=i,t[1]=w);let E;t[2]!==S||t[3]!==C||t[4]!==w?(E={initialSnapPoint:C,fitContent:S,onDismiss:w},t[2]=S,t[3]=C,t[4]=w,t[5]=E):E=t[5];let D=F(E),[O,k]=u.useState(null),A=a!=null||l!=null||p!=null,j=D.snapPoint===T,M=j||!S,N;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(N={reservedTargetSelector:`[data-mobile-sheet-snap-handle]`},t[6]=N):N=t[6];let P=j?`h-[98dvh] max-h-[98dvh]`:S?`h-auto max-h-[72dvh]`:`h-[72dvh] max-h-[98dvh]`,L=D.surfaceRef,R=D.reset,z=M&&`flex-1`,B;t[7]===z?B=t[8]:(B=o(`flex min-h-0 flex-col`,z),t[7]=z,t[8]=B);let V;t[9]!==g||t[10]!==D?(V=(0,f.jsx)(I,{controller:D,ariaLabel:g}),t[9]=g,t[10]=D,t[11]=V):V=t[11];let H;t[12]!==h||t[13]!==S||t[14]!==A||t[15]!==l||t[16]!==i||t[17]!==a||t[18]!==p?(H=A?(0,f.jsxs)(`div`,{className:S?`flex min-h-9 items-center gap-2 px-4 pb-1`:`flex min-h-10 items-center gap-2 px-4 pb-2`,children:[l?(0,f.jsx)(`div`,{className:`flex shrink-0 items-center`,children:l}):null,(0,f.jsx)(`div`,{className:`min-w-0 flex-1`,children:a}),p?(0,f.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:p}):null,(0,f.jsx)(`div`,{ref:k,className:`contents`}),(0,f.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>i(!1),"aria-label":h,className:`shrink-0 text-muted-foreground`,style:{touchAction:`manipulation`},children:(0,f.jsx)(c,{name:`close`,className:`size-5`})})]}):null,t[12]=h,t[13]=S,t[14]=A,t[15]=l,t[16]=i,t[17]=a,t[18]=p,t[19]=H):H=t[19];let U;t[20]!==V||t[21]!==H?(U=(0,f.jsxs)(`div`,{className:`shrink-0`,children:[V,H]}),t[20]=V,t[21]=H,t[22]=U):U=t[22];let W=M&&`flex-1`,G;t[23]!==y||t[24]!==W?(G=o(`flex min-h-0 flex-col overflow-hidden`,W,y),t[23]=y,t[24]=W,t[25]=G):G=t[25];let ee;t[26]!==b||t[27]!==G?(ee=(0,f.jsx)(`div`,{className:G,"data-page-scroll-lock":`true`,children:b}),t[26]=b,t[27]=G,t[28]=ee):ee=t[28];let K;t[29]!==B||t[30]!==U||t[31]!==ee?(K=(0,f.jsxs)(`div`,{className:B,children:[U,ee]}),t[29]=B,t[30]=U,t[31]=ee,t[32]=K):K=t[32];let q;t[33]!==m||t[34]!==n||t[35]!==i||t[36]!==r||t[37]!==D.reset||t[38]!==D.surfaceRef||t[39]!==K||t[40]!==P?(q=(0,f.jsx)(Q,{id:n,open:r,onOpenChange:i,presentation:`sheet`,edge:`bottom`,dismissGesture:N,ariaLabel:m,surfaceClassName:P,surfaceElementRef:L,onExitComplete:R,children:K}),t[33]=m,t[34]=n,t[35]=i,t[36]=r,t[37]=D.reset,t[38]=D.surfaceRef,t[39]=K,t[40]=P,t[41]=q):q=t[41];let J;return t[42]!==O||t[43]!==q?(J=(0,f.jsx)($.Provider,{value:O,children:q}),t[42]=O,t[43]=q,t[44]=J):J=t[44],J};function ye(e,t){let n=(0,d.c)(3),r;return n[0]!==e||n[1]!==t?(r=n=>{[e,t].forEach(e=>{typeof e==`function`?e(n):e&&typeof e==`object`&&(e.current=n)})},n[0]=e,n[1]=t,n[2]=r):r=n[2],r}var be=u.forwardRef((e,t)=>{let n=(0,d.c)(28),{as:r,orientation:i,offset:a,size:o,isEnabled:s,hideTopShadow:c,hideBottomShadow:l,observeMutations:p,onVisibilityChange:m,style:h,className:g,children:_,...v}=e,y=r===void 0?`div`:r,b=i===void 0?`vertical`:i,x=a===void 0?0:a,S=o===void 0?48:o,C=s===void 0||s,w=c!==void 0&&c,T=l!==void 0&&l,E=p===void 0||p,D=u.useRef(null),O=u.useRef(`none`),k=v[`data-scroll-shadow`];delete v[`data-scroll-shadow`];let A=h,j;n[0]!==S||n[1]!==A?(j={...A},j[`--scroll-shadow-size`]=`${S}px`,n[0]=S,n[1]=A,n[2]=j):j=n[2];let M=j,N=xe,P=Se,F;n[3]!==T||n[4]!==w||n[5]!==C||n[6]!==x||n[7]!==m||n[8]!==b?(F=()=>{let e=D.current;if(!e)return;if(!C){P(e),O.current!==`none`&&(O.current=`none`,m?.(`none`));return}let t=b===`vertical`?e.scrollTop>x+1:e.scrollLeft>x+1,n=b===`vertical`?e.scrollHeight-(e.scrollTop+e.clientHeight)>x+1:e.scrollWidth-(e.scrollLeft+e.clientWidth)>x+1,r=w&&b===`vertical`?!1:t;T&&b===`vertical`&&(n=!1),N(e,r,n,b===`vertical`?`top`:`left`,b===`vertical`?`bottom`:`right`);let i=r&&n?`both`:r?b===`vertical`?`top`:`left`:n?b===`vertical`?`bottom`:`right`:`none`;i!==O.current&&(O.current=i,m?.(i))},n[3]=T,n[4]=w,n[5]=C,n[6]=x,n[7]=m,n[8]=b,n[9]=F):F=n[9];let I=F,L,R;n[10]!==I||n[11]!==C?(L=()=>{C||I()},R=[I,C],n[10]=I,n[11]=C,n[12]=L,n[13]=R):(L=n[12],R=n[13]),u.useLayoutEffect(L,R);let z,B;n[14]!==I||n[15]!==C||n[16]!==E?(z=()=>{let e=D.current;if(!e||!C)return;let t=null,n=()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,I()}))},r=n,i=typeof ResizeObserver<`u`?new ResizeObserver(n):null,a=E&&typeof MutationObserver<`u`?new MutationObserver(n):null;return I(),e.addEventListener(`scroll`,r,{passive:!0}),i?.observe(e),a?.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t!==null&&cancelAnimationFrame(t),e.removeEventListener(`scroll`,r),i?.disconnect(),a?.disconnect()}},B=[I,C,E],n[14]=I,n[15]=C,n[16]=E,n[17]=z,n[18]=B):(z=n[17],B=n[18]),u.useEffect(z,B);let V=ye(D,t),H=k??!0,U;return n[19]!==y||n[20]!==_||n[21]!==g||n[22]!==V||n[23]!==M||n[24]!==b||n[25]!==v||n[26]!==H?(U=(0,f.jsx)(y,{...v,ref:V,className:g,"data-orientation":b,"data-scroll-shadow":H,style:M,children:_}),n[19]=y,n[20]=_,n[21]=g,n[22]=V,n[23]=M,n[24]=b,n[25]=v,n[26]=H,n[27]=U):U=n[27],U});be.displayName=`ScrollShadow`;function xe(e,t,n,r,i){let a=`${r}${i.charAt(0).toUpperCase()}${i.slice(1)}Scroll`;t&&n?(e.dataset[a]=`true`,e.removeAttribute(`data-${r}-scroll`),e.removeAttribute(`data-${i}-scroll`)):(e.dataset[`${r}Scroll`]=String(t),e.dataset[`${i}Scroll`]=String(n),e.removeAttribute(`data-${r}-${i}-scroll`))}function Se(e){[`top`,`bottom`,`top-bottom`,`left`,`right`,`left-right`].forEach(t=>{e.removeAttribute(`data-${t}-scroll`)})}var Ce=u.forwardRef((e,t)=>{let n=(0,d.c)(45),r,i,a,s,c,p,m,h,g,_,v,y,b,x,S,C;n[0]===e?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5],p=n[6],m=n[7],h=n[8],g=n[9],_=n[10],v=n[11],y=n[12],b=n[13],x=n[14],S=n[15],C=n[16]):({className:i,outerClassName:c,children:r,style:g,minThumbSize:s,hideDelayMs:a,as:_,scrollbarClassName:h,disableHorizontal:v,observeMutations:y,fillContainer:b,preventOverscroll:x,useScrollShadow:S,scrollShadowSize:m,userIntentOnly:C,...p}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c,n[6]=p,n[7]=m,n[8]=h,n[9]=g,n[10]=_,n[11]=v,n[12]=y,n[13]=b,n[14]=x,n[15]=S,n[16]=C);let w=_===void 0?`div`:_,T=v!==void 0&&v,E=y===void 0||y,D=b===void 0||b,O=x!==void 0&&x,k=S!==void 0&&S,A=C!==void 0&&C,j=u.useRef(null),M,N;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>j.current,N=[],n[17]=M,n[18]=N):(M=n[17],N=n[18]),u.useImperativeHandle(t,M,N);let P=O&&`overscroll-none`,F;n[19]!==c||n[20]!==P?(F=o(`relative flex flex-col min-h-0 w-full overflow-hidden`,P,c),n[19]=c,n[20]=P,n[21]=F):F=n[21];let I;n[22]!==w||n[23]!==r||n[24]!==i||n[25]!==T||n[26]!==D||n[27]!==E||n[28]!==O||n[29]!==p||n[30]!==m||n[31]!==g||n[32]!==k?(I=k?(0,f.jsx)(be,{as:w,ref:j,size:m,className:o(`overlay-scrollbar-target overlay-scrollbar-container`,O&&`overscroll-none`,D?`flex-1 min-h-0 w-full`:`flex-none w-full h-auto`,T?`overflow-y-auto overflow-x-hidden`:`overflow-auto`,i),style:g,observeMutations:E,...p,children:r}):(0,f.jsx)(w,{ref:j,className:o(`overlay-scrollbar-target overlay-scrollbar-container`,O&&`overscroll-none`,D?`flex-1 min-h-0 w-full`:`flex-none w-full h-auto`,T?`overflow-y-auto overflow-x-hidden`:`overflow-auto`,i),style:g,...p,children:r}),n[22]=w,n[23]=r,n[24]=i,n[25]=T,n[26]=D,n[27]=E,n[28]=O,n[29]=p,n[30]=m,n[31]=g,n[32]=k,n[33]=I):I=n[33];let L;n[34]!==T||n[35]!==a||n[36]!==s||n[37]!==E||n[38]!==h||n[39]!==A?(L=(0,f.jsx)(l,{containerRef:j,minThumbSize:s,hideDelayMs:a,className:h,disableHorizontal:T,observeMutations:E,userIntentOnly:A}),n[34]=T,n[35]=a,n[36]=s,n[37]=E,n[38]=h,n[39]=A,n[40]=L):L=n[40];let R;return n[41]!==F||n[42]!==I||n[43]!==L?(R=(0,f.jsxs)(`div`,{className:F,children:[I,L]}),n[41]=F,n[42]=I,n[43]=L,n[44]=R):R=n[44],R});Ce.displayName=`ScrollableOverlay`;function we(e){let t=(0,d.c)(4),{onResizeStart:n,ariaLabel:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,f.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0,children:(0,f.jsx)(`path`,{d:`M9.11111 2L2 9.11111M10 6.44444L6.44444 10`,className:`stroke-muted-foreground`,strokeLinecap:`round`})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,f.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":r,onPointerDown:n,className:`pointer-events-auto -m-2 flex size-7 cursor-ns-resize items-end justify-end p-2 touch-none select-none`,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}var Te=u.forwardRef((e,t)=>{let n=(0,d.c)(64),r,i,s,c,l,p,m,h,g,_,v,y,b,x;n[0]===e?(r=n[1],i=n[2],s=n[3],c=n[4],l=n[5],p=n[6],m=n[7],h=n[8],g=n[9],_=n[10],v=n[11],y=n[12],b=n[13],x=n[14]):({className:r,outerClassName:m,scrollbarClassName:_,fillContainer:y,useScrollShadow:b,scrollShadowSize:g,hasError:l,resizedHeight:i,onResizeHeightChange:p,disabled:s,simple:v,embedded:x,endSlot:c,...h}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=s,n[4]=c,n[5]=l,n[6]=p,n[7]=m,n[8]=h,n[9]=g,n[10]=_,n[11]=v,n[12]=y,n[13]=b,n[14]=x);let S=y!==void 0&&y,C=b!==void 0&&b,w=x!==void 0&&x,{t:T}=a(),E=u.useRef(null),D=u.useRef(null),[O,k]=u.useState(null),A=i??O,j;n[15]===p?j=n[16]:(j=e=>{let t=E.current;if(!t)return;D.current={startY:e.clientY,startHeight:t.getBoundingClientRect().height};let n=e.currentTarget;n.setPointerCapture(e.pointerId);let r=e=>{let t=D.current;if(!t)return;let n=t.startHeight+(e.clientY-t.startY),r=Math.max(82,n);p?p(r):k(r)},i=()=>{D.current=null,n.removeEventListener(`pointermove`,r),n.removeEventListener(`pointerup`,i),n.removeEventListener(`pointercancel`,i)};n.addEventListener(`pointermove`,r),n.addEventListener(`pointerup`,i),n.addEventListener(`pointercancel`,i),e.preventDefault()},n[15]=p,n[16]=j);let M=j,N;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{if(e.target.closest(`textarea, button, [role="separator"]`))return;let t=E.current?.querySelector(`textarea`);t&&document.activeElement!==t&&(e.preventDefault(),t.focus())},n[17]=N):N=n[17];let P=N;if(v){let e=t,i=S?`[field-sizing:fixed]`:`field-sizing-content`,a;n[18]!==r||n[19]!==i?(a=o(`block w-full appearance-none resize-none bg-transparent text-foreground typography-markdown outline-none`,`px-3 py-2 md:typography-ui-label`,`placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`,i,r),n[18]=r,n[19]=i,n[20]=a):a=n[20];let c;return n[21]!==s||n[22]!==S||n[23]!==m||n[24]!==h||n[25]!==g||n[26]!==_||n[27]!==e||n[28]!==a||n[29]!==C?(c=(0,f.jsx)(Ce,{as:`textarea`,ref:e,disableHorizontal:!0,fillContainer:S,useScrollShadow:C,scrollShadowSize:g,outerClassName:m,scrollbarClassName:_,className:a,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,disabled:s,...h}),n[21]=s,n[22]=S,n[23]=m,n[24]=h,n[25]=g,n[26]=_,n[27]=e,n[28]=a,n[29]=C,n[30]=c):c=n[30],c}let F;n[31]===A?F=n[32]:(F=A===null?void 0:{height:`${A}px`},n[31]=A,n[32]=F);let I;if(n[33]!==w||n[34]!==l||n[35]!==m){let e;n[37]===l?e=n[38]:(e=l&&[`ring-[var(--status-error)]`,`focus-within:ring-2 focus-within:ring-[var(--status-error)]`],n[37]=l,n[38]=e);let t;n[39]===w?t=n[40]:(t=w&&[`rounded-none bg-transparent ring-0`,`hover:[&:not(:focus-within)]:bg-transparent`,`has-[[disabled]]:bg-transparent`],n[39]=w,n[40]=t),I=o(`group/textarea relative flex w-full flex-col rounded-[var(--radius-xl)] bg-[var(--surface-elevated)] pb-2.5`,`ring-1 ring-inset ring-border/60 transition duration-200 ease-out`,`hover:[&:not(:focus-within)]:bg-[var(--surface-subtle)]`,`has-[[disabled]]:pointer-events-none has-[[disabled]]:bg-[var(--surface-subtle)] has-[[disabled]]:ring-transparent`,!l&&[`hover:[&:not(:focus-within)]:ring-transparent`,`focus-within:ring-2 focus-within:ring-[var(--interactive-focus-ring)]`],e,t,m),n[33]=w,n[34]=l,n[35]=m,n[36]=I}else I=n[36];let L;n[41]!==r||n[42]!==s?(L=o(`block w-full flex-1 min-h-0 appearance-none resize-none bg-transparent text-foreground typography-markdown outline-none`,`min-h-[82px] pl-3 pr-2.5 pt-2.5 md:typography-ui-label`,`focus-visible:outline-none disabled:cursor-not-allowed`,!s&&[`placeholder:select-none placeholder:text-muted-foreground placeholder:transition placeholder:duration-200 placeholder:ease-out`,`group-hover/textarea:placeholder:text-foreground/80`,`focus:placeholder:text-foreground/80`],s&&`text-muted-foreground/60 placeholder:text-muted-foreground/60`,r),n[41]=r,n[42]=s,n[43]=L):L=n[43];let R;n[44]!==s||n[45]!==h||n[46]!==t||n[47]!==L?(R=(0,f.jsx)(`textarea`,{ref:t,className:L,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,disabled:s,...h}),n[44]=s,n[45]=h,n[46]=t,n[47]=L,n[48]=R):R=n[48];let z;n[49]===T?z=n[50]:(z=T(`textarea.resizeHandleAria`),n[49]=T,n[50]=z);let B;n[51]!==M||n[52]!==z?(B=(0,f.jsx)(we,{onResizeStart:M,ariaLabel:z}),n[51]=M,n[52]=z,n[53]=B):B=n[53];let V;n[54]!==c||n[55]!==B?(V=(0,f.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 pl-3 pr-2.5`,children:[c,B]}),n[54]=c,n[55]=B,n[56]=V):V=n[56];let H;n[57]!==V||n[58]!==R?(H=(0,f.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-2`,children:[R,V]}),n[57]=V,n[58]=R,n[59]=H):H=n[59];let U;return n[60]!==H||n[61]!==F||n[62]!==I?(U=(0,f.jsx)(`div`,{ref:E,onPointerDown:P,style:F,className:I,children:H}),n[60]=H,n[61]=F,n[62]=I,n[63]=U):U=n[63],U});Te.displayName=`Textarea`;export{h as C,g as S,B as _,_e as a,T as b,Y as c,ne as d,ae as f,R as g,z as h,ve as i,re as l,G as m,Ce as n,Q as o,U as p,be as r,ie as s,Te as t,oe as u,V as v,F as x,I as y};
|