1import{$ as e,$t as t,A as n,D as r,E as i,K as a,M as o,O as s,S as c,T as l,Tt as u,V as d,W as f,c as p,et as m,f as h,in as g,it as _,jt as v,lt as y,pt as b,tn as x,ut as S,v as C,vt as w,w as T,zt as E}from"./BZC2i9SB.js";import{s as D,t as O}from"#entry";var k=0;function A(){function e(){k++,document.body.style.overflow=`hidden`}function t(){k>0&&k--,k===0&&(document.body.style.overflow=``)}return{lock:e,unlock:t}}w(),d();var j=`a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])`;function M(t,n){let r=u(null);function i(e){if(e.key===`Escape`){n?.onEscape?.();return}if(e.key===`Tab`){let t=n?.elementRef?.value;if(!t)return;let r=t.querySelectorAll(j);if(r.length===0){e.preventDefault();return}let i=r[0],a=r[r.length-1];e.shiftKey&&document.activeElement===i?(e.preventDefault(),a.focus()):!e.shiftKey&&document.activeElement===a&&(e.preventDefault(),i.focus())}}return S(t,e=>{e?(r.value=document.activeElement,document.addEventListener(`keydown`,i),a(()=>{let e=n?.elementRef?.value;if(e){let t=e.querySelectorAll(j);t.length>0&&t[0].focus()}})):(document.removeEventListener(`keydown`,i),a(()=>r.value?.focus()))}),e(()=>{document.removeEventListener(`keydown`,i)}),{focusableSelector:j,handleKeydown:i,triggerElement:r}}w(),d();function N(e={}){let t=u(0),n=u(0),r=u(!1),i=u(!1),a=0,o=0,s=0,c=0,l=0;function d(){return typeof e.maxHeight==`function`?e.maxHeight():typeof e.maxHeight==`number`?e.maxHeight:window.innerHeight*.88}function f(){return Math.min(Math.max(t.value,0)||window.innerHeight,d())*.35}function p(){n.value=0,requestAnimationFrame(()=>{i.value=!0})}function m(e){n.value=0}let h=T(()=>{let e={transform:`translateY(${n.value}px)`};return!r.value&&i.value&&(e.transition=`transform 400ms cubic-bezier(0.32, 0.72, 0, 1)`),e});function g(e){if(r.value=!0,i.value=!0,l=0,s=0,c=0,`touches`in e){let t=e.touches[0];if(!t)return;a=t.clientY}else a=e.clientY;o=n.value,document.addEventListener(`touchmove`,_,{passive:!0}),document.addEventListener(`touchend`,v),document.addEventListener(`mousemove`,_),document.addEventListener(`mouseup`,v)}function _(e){if(!r.value)return;let t;if(`touches`in e){let n=e.touches[0];if(!n)return;t=n.clientY}else t=e.clientY;let i=performance.now();c&&(l=(t-s)/(i-c)),s=t,c=i;let u=t-a,d=o+u;d<0?n.value=d*.4:n.value=d}function v(){if(r.value){if(r.value=!1,document.removeEventListener(`touchmove`,_),document.removeEventListener(`touchend`,v),document.removeEventListener(`mousemove`,_),document.removeEventListener(`mouseup`,v),l>.5||n.value>=f()){e.onClose?.();return}n.value=0}}function y(){document.removeEventListener(`touchmove`,_),document.removeEventListener(`touchend`,v),document.removeEventListener(`mousemove`,_),document.removeEventListener(`mouseup`,v)}return{sheetHeight:t,translateY:n,isDragging:r,isAnimatingIn:i,sheetStyle:h,snapToIndex:m,onDragStart:g,cleanup:y,open:p,maxHeight:d}}w(),d(),E(),h();var P={key:0,class:`pb-4 border-b border-zinc-200 dark:border-zinc-700`},F={id:`sheet-title`,class:`text-lg font-bold text-zinc-800 dark:text-white`},I=`a, button, input, textarea, select, label, [role="button"], [data-no-drag]`,L=Object.assign(o({inheritAttrs:!1,__name:`UiBottomSheet`,props:f({title:{},preventClose:{type:Boolean},snapPoints:{default:()=>[]},initialSnap:{default:1}},{isOpen:{type:Boolean,default:!1},isOpenModifiers:{}}),emits:[`update:isOpen`],setup(o){let{isHydrated:d}=D(),{lock:f,unlock:h}=A(),w=o,E=y(o,`isOpen`),k=u(null),j=T(()=>k.value?.$el??null),L=()=>{w.preventClose||(V.value=!1,z.value=0,E.value=!1)};M(E,{onEscape:L,elementRef:j});let{sheetHeight:R,translateY:z,isDragging:B,isAnimatingIn:V,sheetStyle:H,onDragStart:U,cleanup:W,open:G}=N({onClose:L}),K=e=>{e.target?.closest(I)||(e.cancelable&&e.preventDefault(),U(e))},q=null;return S(E,async e=>{e?(V.value=!1,z.value=0,await a(),j.value&&(R.value=j.value.offsetHeight,q=new ResizeObserver(e=>{let t=e[0];!t||B.value||(R.value=t.contentRect.height)}),q.observe(j.value)),G(),f()):(q?.disconnect(),q=null,h())}),e(()=>{q?.disconnect(),W(),h()}),(e,a)=>{let u=O;
1return v(d)?(m(),i(c,{key:0,to:`body`},[n(p,{"enter-active-class":`transition duration-300 ease-out`,"enter-from-class":`opacity-0`,"leave-active-class":`transition duration-300 ease-in`,"leave-to-class":`opacity-0`},{default:b(()=>[E.value?(m(),s(`div`,{key:0,class:`fixed inset-0 z-sheet flex items-end`,onClick:C(L,[`self`])},[l(`div`,{class:`absolute inset-0 bg-black/50 backdrop-blur-sm`,onClick:L}),n(u,{ref_key:`sheetRef`,ref:k,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o.title?`sheet-title`:void 0,"aria-label":o.title?void 0:`برگÙ`,class:t([`relative bg-white dark:bg-zinc-800 rounded-t-2xl shadow-2xl max-h-[88vh] overflow-y-auto pb-[env(safe-area-inset-bottom)]`,{"transition-none":v(B)}]),style:x(v(H)),onClick:a[0]||=C(()=>{},[`stop`])},{default:b(()=>[l(`div`,{class:`sticky top-0 z-10 bg-white dark:bg-zinc-800 rounded-t-2xl -mx-2 md:-mx-4 px-2 md:px-4 pb-4`,onTouchstart:K,onMousedown:K},[a[1]||=l(`div`,{class:`pt-2 pb-1 flex justify-center`},[l(`div`,{class:`w-10 h-1.5 rounded-full bg-zinc-300 dark:bg-zinc-600`})],-1),o.title||e.$slots.title?(m(),s(`div`,P,[_(e.$slots,`title`,{},()=>[l(`h3`,F,g(o.title),1)])])):r(``,!0)],32),_(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`aria-label`,`class`,`style`])])):r(``,!0)]),_:3})])):r(``,!0)}}}),{__name:`UiBottomSheet`});export{M as n,A as r,L as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.