PageSourceSearch

https://khachhang.supership.vn/assets/rc-resize-observer-L_wv83Pg.js

js supership.vn collected 2026-10-01 14:18:29 UTC 2,621 bytes, 1 lines download raw bytes

1import{h as B,i as $,a as L,_ as j,e as M,d as A,g as F}from"./@babel-nGMctoUQ.js";import{r as t}from"./react-BZvnZFH-.js";import{s as K,k as T,h as V,M as C,z as X}from"./rc-util-U1vyC9Mt.js";import{i as Y}from"./resize-observer-polyfill-B1PUzC5B.js";var b=t.createContext(null);function q(e){var i=e.children,r=e.onBatchResize,o=t.useRef(0),n=t.useRef([]),a=t.useContext(b),l=t.useCallback(function(d,u,f){o.current+=1;var h=o.current;n.current.push({size:d,element:u,data:f}),Promise.resolve().then(function(){h===o.current&&(r==null||r(n.current),n.current=[])}),a==null||a(d,u,f)},[r,a]);return t.createElement(b.Provider,{value:l},i)}var c=new Map;function G(e){e.forEach(function(i){var r,o=i.target;(r=c.get(o))===null||r===void 0||r.forEach(function(n){return n(o)})})}var I=new Y(G);function J(e,i){c.has(e)||(c.set(e,new Set),I.observe(e)),c.get(e).add(i)}function Q(e,i){c.has(e)&&(c.get(e).delete(i),c.get(e).size||(I.unobserve(e),c.delete(e)))}var U=function(e){B(r,e);var i=$(r);function r(){return L(this,r),i.apply(this,arguments)}return j(r,[{key:"render",value:function(){return this.props.children}}]),r}(t.Component);function Z(e,i){var r=e.children,o=e.disabled,n=t.useRef(null),a=t.useRef(null),l=t.useContext(b),d=typeof r=="function",u=d?r(n):r,f=t.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),h=!d&&t.isValidElement(u)&&K(u),O=h?T(u):null,D=V(O,n),z=function(){var v;return C(n.current)||(n.current&&A(n.current)==="object"?C((v=n.current)===null||v===void 0?void 0:v.nativeElement):null)||C(a.current)};t.useImperativeHandle(i,function(){return z()});var E=t.useRef(e);E.current=e;var _=t.useCallback(function(s){var v=E.current,w=v.onResize,N=v.data,x=s.getBoundingClientRect(),p=x.width,m=x.height,R=s.offsetWidth,g=s.offsetHeight,y=Math.floor(p),k=Math.floor(m);if(f.current.width!==y||f.current.height!==k||f.current.offsetWidth!==R||f.current.offsetHeight!==g){var W={width:y,height:k,offsetWidth:R,offsetHeight:g};f.current=W;var P=R===Math.round(p)?p:R,S=g===Math.round(m)?m:g,H=M(M({},W),{},{offsetWidth:P,offsetHeight:S});l==null||l(H,s,N),w&&Promise.resolve().then(function(){w(H,s)})}},[]);return t.useEffect(function(){var s=z();return s&&!o&&J(s,_),function(){return Q(s,_)}},[n.current,o]),t.createElement(U,{ref:a},h?t.cloneElement(u,{ref:D}):u)}var ee=t.forwardRef(Z),re="rc-observer-key";function te(e,i){var r=e.children,o=typeof r=="function"?[r]:X(r);return o.map(function(n,a){var l=(n==null?void 0:n.key)||"".concat(re,"-").concat(a);return t.createElement(ee,F({},e,{key:l,ref:a===0?i:void 0}),n)})}var ne=t.forwardRef(te);ne.Collection=q;export{ne as R};

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.