Build 586984stable
Module 446837
7,617 characters · in 56594.6edaaeaaca198aca.jsDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{t:()=>$});var r,i,a,o=[],s="ResizeObserver loop completed with undelivered notifications.",l=function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:s}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=s),window.dispatchEvent(e)};(r=i||(i={})).BORDER_BOX="border-box",r.CONTENT_BOX="content-box",r.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box";var u=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Object.freeze(this)}return e.prototype.toJSON=function(){return{x:this.x,y:this.y,top:this.top,right:this.right,bottom:this.bottom,left:this.left,width:this.width,height:this.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),c=function(e){return e instanceof SVGElement&&"getBBox"in e},d=function(e){if(c(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e.offsetWidth,a=e.offsetHeight;return!(i||a||e.getClientRects().length)},f=function(e){var t,n=null==(t=null==e?void 0:e.ownerDocument)?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},p=function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},h="u">typeof window?window:{},m=new Map,g=/auto|scroll/,v=/^tb|vertical/,y=/msie|trident/i.test(h.navigator&&h.navigator.userAgent),b=function(e){return parseFloat(e||"0")},_=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),Object.freeze({inlineSize:(n?t:e)||0,blockSize:(n?e:t)||0})},w=Object.freeze({devicePixelContentBoxSize:_(),borderBoxSize:_(),contentBoxSize:_(),contentRect:new u(0,0,0,0)}),x=function(e){if(m.has(e))return m.get(e);if(d(e))return m.set(e,w),w;var t=getComputedStyle(e),n=c(e)&&e.ownerSVGElement&&e.getBBox(),r=!y&&"border-box"===t.boxSizing,i=v.test(t.writingMode||""),a=!n&&g.test(t.overflowY||""),o=!n&&g.test(t.overflowX||""),s=n?0:b(t.paddingTop),l=n?0:b(t.paddingRight),f=n?0:b(t.paddingBottom),p=n?0:b(t.paddingLeft),h=n?0:b(t.borderTopWidth),x=n?0:b(t.borderRightWidth),E=n?0:b(t.borderBottomWidth),S=n?0:b(t.borderLeftWidth),k=p+l,T=s+f,C=S+x,P=h+E,A=o?e.offsetHeight-P-e.clientHeight:0,M=a?e.offsetWidth-C-e.clientWidth:0,R=n?n.width:b(t.width)-(r?k+C:0)-M,I=n?n.height:b(t.height)-(r?T+P:0)-A,L=R+k+M+C,O=I+T+A+P,D=Object.freeze({devicePixelContentBoxSize:_(Math.round(R*devicePixelRatio),Math.round(I*devicePixelRatio),i),borderBoxSize:_(L,O,i),contentBoxSize:_(R,I,i),contentRect:new u(p,s,R,I)});return m.set(e,D),D},E=function(e,t){var n=x(e),r=n.borderBoxSize,a=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(t){case i.DEVICE_PIXEL_CONTENT_BOX:return o;case i.BORDER_BOX:return r;default:return a}},S=function(e){var t=x(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=[t.borderBoxSize],this.contentBoxSize=[t.contentBoxSize],this.devicePixelContentBoxSize=[t.devicePixelContentBoxSize]},k=function(e){if(d(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},T=function(){var e=1/0,t=[];o.forEach(function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function(t){var n=new S(t.target),i=k(t.target);r.push(n),t.lastReportedSize=E(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0;n<t.length;n++)(0,t[n])();return e},C=function(e){m.clear(),o.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(k(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},P=function(){var e=0;for(C(0);o.some(function(e){return e.activeTargets.length>0});)C(e=T());return o.some(function(e){return e.skippedTargets.length>0})&&l(),e>0},A=[],M=function(e){if(!a){var t=0,n=document.createTextNode("");new MutationObserver(function(){return A.splice(0).forEach(function(e){return e()})}).observe(n,{characterData:!0}),a=function(){n.textContent=""+(t?t--:t++)}}A.push(e),a()},R=function(e){M(function(){requestAnimationFrame(e)})},I=0,L={attributes:!0,characterData:!0,childList:!0,subtree:!0},O=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],D=!1,F=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;D||(D=!0,R(function(){var n=!1;try{n=P()}finally{if(D=!1,!I)return;n?t.run(60):e?t.run(e-1):t.start()}}))},e.prototype.schedule=function(){this.stop(),this.run(12)},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,L)};document.body?t():h.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),O.forEach(function(t){return h.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),O.forEach(function(t){return h.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),N=function(e){!I&&e>0&&F.start(),(I+=e)||F.stop()},V=function(){function e(e,t){this.target=e,this.observedBox=t||i.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=E(this.target,this.observedBox);return c(e=this.target)||p(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),j=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},B=new Map,U=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return -1},K=function(){function e(){}return e.connect=function(e,t){var n=new j(e,t);o.push(n),B.set(e,n)},e.observe=function(e,t,n){if(B.has(e)){var r=B.get(e);0>U(r.observationTargets,t)&&(r.observationTargets.push(new V(t,n&&n.box)),N(1),F.schedule())}},e.unobserve=function(e,t){if(B.has(e)){var n=B.get(e),r=U(n.observationTargets,t);r>=0&&(n.observationTargets.splice(r,1),N(-1))}},e.disconnect=function(e){if(B.has(e)){var t=B.get(e);o.splice(o.indexOf(t),1),B.delete(e),N(-t.observationTargets.length)}},e}(),$=function(){function e(e){if(0==arguments.length)throw TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");K.connect(this,e)}return e.prototype.observe=function(e,t){if(0==arguments.length)throw TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!f(e))throw TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");K.observe(this,e,t)},e.prototype.unobserve=function(e){if(0==arguments.length)throw TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!f(e))throw TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");K.unobserve(this,e)},e.prototype.disconnect=function(){K.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}()}