PageSourceSearch

https://cossui-svelte.com/_app/immutable/chunks/DrzYY1C1.js

js cossui-svelte.com collected 2026-10-05 07:11:06 UTC 9,944 bytes, 1 lines download raw bytes

1import{Et as e,Mt as t,Ot as n,rt as r}from"./DVu4Yavg.js";import{h as i,m as a,n as o,p as s,r as c,t as l,u}from"./fWNZHVxF.js";import{t as d}from"./CdyEs2CM.js";function f(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}function p(e,t){let n=t===`vertical`,{overflowX:r,overflowY:i}=c(e),a=n?i:r;return a!==`auto`&&a!==`scroll`?!1:n?e.scrollHeight>e.clientHeight:e.scrollWidth>e.clientWidth}function m(e,t,n){let r=e;for(;a(r)&&r!==t&&!i(r);){for(let e of n)if(p(r,e))return!0;r=u(r)}return!1}function h(e,t,n){let r=a(e)?e:null;for(;a(r)&&r!==t&&!i(r);){if(p(r,n))return r;r=u(r)}return p(t,n)?t:null}var g=40,_=10,v=1,y=50,b=16,x=80,S=`button,a,input,select,textarea,label,[role="button"]`;function C(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function w(e){let t=(e.ownerDocument.defaultView??window).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}function T(e){return Number.isFinite(e)&&e>0?e:null}function E(e){return e%2==1}function D(e,t,n){if(typeof e[n]==`function`)try{e[n](t)}catch(e){if(!(e instanceof DOMException)||e.name!==`NotFoundError`)throw e}}function O(e){return e?.ownerDocument??document}function k(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function A(e){return`touches`in e||e.pointerType===`touch`}function j(e){return e>=0?Math.sqrt(e):-Math.sqrt(-e)}function M(e,t,n){return!t&&e<0||!n&&e>0?j(e):e}var N=class{#e=n(!1);get swiping(){return r(this.#e)}set swiping(t){e(this.#e,t,!0)}#t=n(void 0);get direction(){return r(this.#t)}set direction(t){e(this.#t,t,!0)}#n=n({x:0,y:0});#r=n({x:0,y:0,scale:1});#i=!1;#a=null;#o={x:0,y:0};#s={x:0,y:0};#c=null;#l;#u=0;#d=!1;#f={x:0,y:0};#p=!1;#m=null;#h=!1;#g=!1;#_={width:0,height:0};#v=0;#y=g;#b=null;#x=null;#S={x:0,y:0};#C=null;#w=!1;#T;constructor(e){this.#T=e}#E=t(()=>this.#T().enabled);#D=t(()=>this.#T().directions);#O=t(()=>this.#T().element);#k=t(()=>this.#T().movementCssVars);#A=t(()=>this.#T().ignoreSelectorWhenTouch??!0);#j=t(()=>this.#T().ignoreScrollableAncestors??!1);#M=t(()=>this.#T().trackDrag??!0);#N=t(()=>{let e=r(this.#D),t=e.includes(`left`),n=e.includes(`right`),i=e.includes(`up`),a=e.includes(`down`),o=t||n,s=i||a,c=e.length===1?e[0]:void 0,l=[];return s&&l.push(`vertical`),o&&l.push(`horizontal`),{allowLeft:t,allowRight:n,allowUp:i,allowDown:a,hasHorizontal:o,hasVertical:s,primaryDirection:c,scrollAxes:l}});#P=t(()=>{let e=r(this.#k),t=r(this.#M)?r(this.#n):this.#s,n=r(this.#r),i={};return this.swiping&&(i.transition=`none`,i.transform=`translate3d(${t.x}px,${t.y}px,0) scale(${n.scale})`),i[e.x]=`${t.x-n.x}px`,i[e.y]=`${t.y-n.y}px`,i});get dragStyles(){return r(this.#P)}set dragStyles(t){e(this.#P,t)}#F(e){this.#w!==e&&(this.#w=e,this.swiping=e,this.#T().onSwipingChange?.(e))}#I(e){if(!e)return;let t=this.#T().swipeThreshold;if(!t){this.#y=g;return}let n=r(this.#O);if(!n)return;let i=t({element:n,direction:e});this.#y=Math.max(0,i)}#L(e,t){let n=Number.isFinite(e)?d(e,0,1):0,r=n!==this.#v,i=!1;if(t){let e=this.#C;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}(r||i)&&(this.#v=n,t?this.#C=t:r&&(this.#C=null),this.#T().onProgress?.(n,t))}#R(e,t){if(t===null)return;let n=this.#x;if(n&&t>n.time){let r=Math.max(t-n.time,b);this.#S={x:(e.x-n.x)/r,y:(e.y-n.y)/r}}this.#x={x:e.x,y:e.y,time:t}}reset=()=>{this.direction=void 0,this.#F(!1),this.#i=!1,e(this.#n,{x:0,y:0}),e(this.#r,{x:0,y:0,scale:1}),this.#a=null,this.#L(0),this.#y=g,this.#o={x:0,y:0},this.#s={x:0,y:0},this.#l=void 0,this.#u=0,this.#d=!1,this.#f={x:0,y:0},this.#p=!1,this.#c=null,this.#m=null,this.#h=!1,this.#g=!1,this.#_={width:0,height:0},this.#b=null,this.#x=null,this.#S={x:0,y:0},this.#C=null};#z(e,t){let n=f(r(this.#O)?.ownerDocument,e.x,e.y)??o(t);return s(n)?n:null}#B(e,t){let{hasHorizontal:n,hasVertical:i}=r(this.#N);return n&&!i?h(e,t,`horizontal`):i&&!n?h(e,t,`vertical`):h(e,t,`vertical`)??h(e,t,`horizontal`)}
1#V(t,n,i=!1){let o=r(this.#O);this.#h=!1;let s=A(t),c=this.#z(n,t),l=O(o).body,u=s&&l?this.#B(c,l):null;if(u&&!i||(this.#h=!!(u&&i),c&&c.closest(S)&&(!s||r(this.#A))))return!1;let{primaryDirection:d,scrollAxes:f}=r(this.#N);if(r(this.#j)&&o&&a(c)&&f.length>0&&!i&&m(c,o,f))return!1;if(this.#d=!1,this.#l=void 0,this.#u=0,this.#o=n,this.#b=T(t.timeStamp),this.#f=n,this.#c=n,o){this.#_={width:o.offsetWidth,height:o.offsetHeight},this.#I(d);let n=w(o);e(this.#r,n),this.#s={x:n.x,y:n.y},e(this.#n,{x:n.x,y:n.y}),this.#R({x:n.x,y:n.y},this.#b),`touches`in t||D(o,t.pointerId,`setPointerCapture`)}return this.#T().onSwipeStart?.(t),this.#F(!0),this.#i=!1,this.#a=null,this.#p=!0,this.#L(0),!0}#H(){this.#m=null,this.#h=!1,this.#c=null}#U(t){if(this.#H(),!this.#w)return;this.#F(!1),this.#i=!1,this.#a=null;let{x:n,y:i}=r(this.#r);this.#s={x:n,y:i},e(this.#n,{x:n,y:i}),this.direction=void 0,this.#g=!1;let a=r(this.#O);a&&D(a,t.pointerId,`releasePointerCapture`),this.#L(0,{deltaX:0,deltaY:0,direction:void 0}),this.#T().onCancel?.(t)}#W(e,t){let{allowLeft:n,allowRight:i,allowUp:a,allowDown:o,hasHorizontal:s,hasVertical:c}=r(this.#N);return{x:s?M(e,n,i):j(e),y:c?M(t,a,o):j(t)}}#G(e,t,n){let{allowDown:i,allowLeft:a,allowRight:o,allowUp:s,hasHorizontal:c,hasVertical:l}=r(this.#N),u=Math.abs(t),d=Math.abs(n);if(l&&n!==0&&(!c||d>=u)){let t=Math.max(0,e.scrollHeight-e.clientHeight),r=e.scrollTop<=0,a=e.scrollTop>=t;return n>0&&r&&i||n<0&&a&&s}if(c&&t!==0&&(!l||u>d)){let n=Math.max(0,e.scrollWidth-e.clientWidth),r=e.scrollLeft<=0,i=e.scrollLeft>=n;return t>0&&r&&o||t<0&&i&&a}return null}start=e=>{if(!r(this.#E)||e.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let t=k(e);if(!t)return;this.#m=t,this.#h=!1,this.#g=!(`touches`in e);let n=this.#T().canStart;(!n||n(t,{nativeEvent:e,direction:r(this.#N).primaryDirection}))&&this.#V(e,t)&&(this.#m=null)};#K(e,t){let n=this.#f,r=t.x<0&&e.x>n.x||t.x>0&&e.x<n.x,i=t.y<0&&e.y>n.y||t.y>0&&e.y<n.y;this.#f={x:r?e.x:n.x,y:i?e.y:n.y}}#q(e,t){if(this.#i||Math.hypot(e,t)<v)return;this.#i=!0;let{hasHorizontal:n,hasVertical:i}=r(this.#N);n&&i&&(this.#a=Math.abs(e)>Math.abs(t)?`horizontal`:`vertical`)}#J(e,t,n){let{allowLeft:i,allowRight:a,allowUp:o,allowDown:s}=r(this.#N),c;e===`vertical`?n!==0&&(c=n>0?`down`:`up`):e===`horizontal`?t!==0&&(c=t>0?`right`:`left`):c=Math.abs(t)>=Math.abs(n)?t>0?`right`:`left`:n>0?`down`:`up`,c&&(c===`left`&&i||c===`right`&&a||c===`up`&&o||c===`down`&&s)&&(this.#l=c,this.#u=C(c,t,n),this.direction=c,this.#I(c))}#Y(e,t){let{allowLeft:n,allowRight:i,allowUp:a,allowDown:o}=r(this.#N),s=this.#l,c=C(s,e,t);if(c>this.#y){this.#d=!1,this.direction=s;return}!(n&&i)&&!(a&&o)&&this.#u-c>=_&&(this.#d=!0)}#X(t,n,i){let{hasHorizontal:a,hasVertical:o}=r(this.#N),s=this.#W(t,n),c=r(this.#r),l=c.x+(a&&i!==`vertical`?s.x:0),u=c.y+(o&&i!==`horizontal`?s.y:0);return this.#s={x:l,y:u},r(this.#M)&&e(this.#n,{x:l,y:u}),{x:l,y:u}}#Z(e){let t=r(this.#N).primaryDirection??this.#l;if(!t)return 0;let n=t===`left`||t===`right`?this.#_.width:this.#_.height,i=r(this.#r).scale||1;if(n<=0||i<=0)return 0;let a=C(t,e.x-r(this.#r).x,e.y-r(this.#r).y);return a>0?a/(n*i):0}#Q(e,t,n,i){if(!r(this.#E)||!this.#w)return;if(A(e)&&!this.#h){let n=o(e);if(this.#B(n,t))return}if(`touches`in e||e.preventDefault(),this.#p&&(this.#p=!1,r(this.#M))){this.#o=n;let t=T(e.timeStamp);t!==null&&(this.#b=t)}this.#K(n,i);let a=n.x-this.#o.x,s=n.y-this.#o.y;this.#q(a,s);let c=this.#a;this.#l?this.#Y(n.x-this.#f.x,n.y-this.#f.y):this.#J(c,a,s);let l=this.#X(a,s,c);this.#R(l,T(e.timeStamp)),this.#L(this.#Z(l),{deltaX:l.x-r(this.#r).x,deltaY:l.y-r(this.#r).y,direction:this.#l})}#$(e,t){if(!A(e)&&e.defaultPrevented)return this.#H(),!0;let n=this.#T().canStart;if(n&&!n(t,{nativeEvent:e,direction:r(this.#N).primaryDirection}))return!1;let i=this.#m,a=r(this.#O),o=!1;if(A(e)&&i&&a){let n=this.#z(t,e),r=O(a).body,s=r?this.#B(n,r):null;if(s&&(l(a,s)||l(s,a))){let e=this.#G(s,t.x-i.x,t.y-i.y);if(e===!1)return!0;e===!0&&(o=!0)}}return this.#V(e,t,o)?(this.#m=null,i&&o?(this.#o=i,this.#f=i,this.#c=i,this.#p=!1):this.#h=!1,!1):!1}move=(e,t)=>{if(!r(this.#E))return;let n=k(e);if(!n)return;let i=!1;if(!(`touches`in e)){let t=E(e.buttons);if(t&&(this.#g=!0),e.buttons!==0&&!t){this.#U(e);return}if(e.buttons===0&&this.#g){if(!this.#w){this.end(e);return}i=!0}}if(!this.swiping&&this.#m!==null&&this.#$(e,n))return;let a=this.#c,o=a===null?{x:0,y:0}:{x:n.x-a.x,y:n.y-a.y};this.#c=n,this.#Q(e,t,n,o),i&&!(`touches`in e)&&this.end(e)};end=t=>{if(!r(this.#E))return;let{primaryDirection:n}=r(this.#N),i=this.#s,a=r(this.#r),o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:this.direction??this.#l},l=()=>{this.#s={x:a.x,y:a.y},e(this.#n,{x:a.x,y:a.y}),this.direction=void 0,this.#L(0,c)};if(!this.#w){this.#H(),this.#L(0,c);return}this.#F(!1),this.#i=!1,this.#a=null,this.#H(),this.#g=!1;let u=r(this.#O);u&&!(`touches`in t)&&D(u,t.pointerId,`releasePointerCapture`);let d=this.#T().onRelease?.({event:t,direction:this.direction??this.#l,deltaX:o,deltaY:s,...this.#ee(o,s,i,T(t.timeStamp))}),f=typeof d==`boolean`;if((this.#d||t.type===`pointercancel`)&&!f){l();return}let p=f?d?this.direction??this.#l??n:void 0:this.#te(o,s);if(!p){l();return}this.direction=p,this.#T().onDismiss?.(t,{direction:p})};#ee(e,t,n,r){let i=this.#b,a=i!==null&&r!==null&&r>i?r-i:0,o=a>0?Math.max(a,y):0,s=this.#S.x,c=this.#S.y,l=this.#x;if(l&&r!==null&&r>=l.time){let e=r-l.time;if(e>
1x)s=0,c=0;else{let t=Math.max(e,b),r=(n.x-l.x)/t,i=(n.y-l.y)/t;r!==0&&(s=r),i!==0&&(c=i)}}return{velocityX:o>0?e/o:0,velocityY:o>0?t/o:0,releaseVelocityX:s,releaseVelocityY:c}}#te(e,t){let n=this.#y;return r(this.#D).find(r=>C(r,e,t)>n)}};export{h as a,D as i,C as n,p as o,w as r,f as s,N 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.