PageSourceSearch

https://transcri.io/_app/yl2Nlqpq.js

js transcri.io collected 2026-10-09 01:37:36 UTC 3,488 bytes, 1 lines download raw bytes

1import{a6 as I,B as K,b1 as O,a2 as Y,o as F,c as H,aF as A,e as N,F as V,m as j,g as R,S as C,A as P,f as q,q as G,y as J,H as Q}from"./DuSfuktZ.js";const Z=["onMousedown","onTouchstart"],tt=150,et={__name:"Draggable",props:{targetEvent:{type:Array,default:()=>["INPUT","BUTTON"]},cookieKey:{type:String,default:"_draggable"},savePosition:{type:Boolean,default:!0},resizable:{type:Boolean,default:!1},disableOnTouch:{type:Boolean,default:!1}},setup(y){const{isTouchDevice:b}=G(),{isMobileOrTablet:S}=I(),n=Q(),r=y,f=J(()=>r.disableOnTouch&&(S||b())),U=[{name:"top-left",position:"top-0 left-0",cursor:"cursor-nwse-resize"},{name:"top-right",position:"top-0 right-0",cursor:"cursor-nesw-resize"},{name:"bottom-left",position:"bottom-0 left-0",cursor:"cursor-nesw-resize"},{name:"bottom-right",position:"bottom-0 right-0",cursor:"cursor-nwse-resize"}];let E=0,x=0,u=null;const v=b(),L=v?"touchstart":"mousedown",a=v?"touchmove":"mousemove",i=v?"touchend":"mouseup",d=t=>t.touches?t.touches[0]:t,T=()=>{if(!r.savePosition)return;const t=n.value,e={x:parseFloat(t.style.left),y:parseFloat(t.style.top)};t.style.width&&(e.w=parseFloat(t.style.width)),O(r.cookieKey).value=e},z=t=>{const e=t.getBoundingClientRect();return t.style.right="auto",t.style.bottom="auto",t.style.transform="none",t.style.left=`${e.left}px`,t.style.top=`${e.top}px`,e},m=t=>{const{clientX:e,clientY:o}=d(t),s=n.value;s.style.left=`${e-E}px`,s.style.top=`${o-x}px`,T()},D=()=>{window.removeEventListener(a,m)},$=t=>{if(r.targetEvent.includes(t.target.tagName))return;t.preventDefault();const e=z(n.value),{clientX:o,clientY:s}=d(t);E=o-e.left,x=s-e.top,window.addEventListener(a,m)},g=t=>{if(!u)return;const{clientX:e}=d(t),{corner:o,startX:s,startWidth:l,startHeight:B,startLeft:M,startTop:X,aspectRatio:W}=u;let h=e-s;(o==="top-left"||o==="bottom-left")&&(h=-h);const p=Math.max(tt,l+h),_=p/W,c=n.value;c.style.width=`${p}px`,o==="top-left"?(c.style.left=`${M+l-p}px`,c.style.top=`${X+B-_}px`):o==="top-right"?c.style.top=`${X+B-_}px`:o==="bottom-left"&&(c.style.left=`${M+l-p}px`),T()},w=()=>{u=null,window.removeEventListener(a,g),window.removeEventListener(i,w)},k=(t,e)=>{const o=n.value,s=z(o),{clientX:l}=d(e);u={corner:t,startX:l,startWidth:s.width,startHeight:s.height,startLeft:s.left,startTop:s.top,aspectRatio:s.width/s.height},window.addEventListener(a,g),window.addEventListener(i,w)};return K(()=>{if(f.value)return;const t=n.value;if(t.addEventListener(L,$),window.addEventListener(i,D),r.savePosition){const e=O(r.cookieKey)?.value;e?.x!=null&&e?.y!=null&&(t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.right="auto",t.style.bottom="auto",t.style.transform="none",e.w&&(t.style.width=`${e.w}px`))}}),Y(()=>{n.value?.removeEventListener(L,$),window.removeEventListener(i,D),window.removeEventListener(a,m),window.removeEventListener(a,g),window.removeEventListener(i,w)}),(t,e)=>(F(),H("div",{ref_key:"draggable",ref:n,class:P(["group/drag",{"cursor-move":!N(f)}])},[A(t.$slots,"default"),y.resizable&&!N(f)?(F(),H(V,{key:0},j(U,o=>R("div",{key:o.name,class:P(["absolute w-4 h-4 z-10 opacity-0 group-hover/drag:opacity-100 transition-opacity duration-200",[o.position,o.cursor]]),onMousedown:C(s=>k(o.name,s),["stop","prevent"]),onTouchstart:C(s=>k(o.name,s),["stop","prevent"])},[...e[0]||(e[0]=[R("div",{class:"w-2.5 h-2.5 m-[3px] rounded-full bg-white dark:bg-light-black/80 shadow"},null,-1)])],42,Z)),64)):q("",!0)],2))}},st=Object.assign(et,{__name:"Draggable"});export{st as default};

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.