From 5388c8e6c3da60138da84853e36b8486475d7210 Mon Sep 17 00:00:00 2001 From: Boris Diakur Date: Mon, 3 Apr 2023 20:44:55 +0200 Subject: [PATCH] fix(tether): fix tether patch --- .yarn/patches/tether-npm-2.0.0-f14e824ccf.patch | 17 +++++++++++++---- yarn.lock | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.yarn/patches/tether-npm-2.0.0-f14e824ccf.patch b/.yarn/patches/tether-npm-2.0.0-f14e824ccf.patch index 5ddd2379e6..106b5d6bca 100644 --- a/.yarn/patches/tether-npm-2.0.0-f14e824ccf.patch +++ b/.yarn/patches/tether-npm-2.0.0-f14e824ccf.patch @@ -45,7 +45,7 @@ index b2719dd8bf986bc1d3add0d28a7c4ebe3bf41640..cfa1d88a240bbe3b94659a988e1886d3 var id = node.getAttribute('data-tether-id'); diff --git a/dist/js/tether.esm.min.js b/dist/js/tether.esm.min.js -index 1b2cb71590b6710544203bcf61f179dc0c5a0dd8..128b1ac71bbcd4ef3e3e23eeae3a4d84c5d3248f 100644 +index 1b2cb71590b6710544203bcf61f179dc0c5a0dd8..1a79ddac6d06981b2bc4cc86e0341437c01921d3 100644 --- a/dist/js/tether.esm.min.js +++ b/dist/js/tether.esm.min.js @@ -1,4 +1,3 @@ @@ -54,9 +54,8 @@ index 1b2cb71590b6710544203bcf61f179dc0c5a0dd8..128b1ac71bbcd4ef3e3e23eeae3a4d84 -function t(e,o){return(t=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(e,o)}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){return"string"==typeof t}function i(t){return void 0===t}function n(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.add(e)}))}function r(t,e,o){return void 0===t&&(t=""),i(e)||i(e[t])?o?o+"-"+t:t:!1===e[t]?"":e[t]}function s(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.remove(e)}))}function a(t,e,o){o.forEach((function(o){-1===e.indexOf(o)&&t.classList.contains(o)&&s(t,o)})),e.forEach((function(e){t.classList.contains(e)||n(t,e)}))}var h=[];function l(t){h.push(t)}function f(){for(var t;t=h.pop();)t()}var p=null;function d(t){void 0===t&&(t={});var e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach((function(e){if(e)for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])})),t}function c(){if(p)return p;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");d(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var o=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=e.clientWidth),document.body.removeChild(e);var n=o-i;return p={width:n,height:n}}var u,m=(u=0,function(){return++u}),g={},v=null;function b(t,e){var o;e===document?(o=document,e=document.documentElement):o=e.ownerDocument;var n=o.documentElement,r=w(e),s=function(t){var e=v;e&&t.contains(e)||((e=document.createElement("div")).setAttribute("data-tether-id",m()),d(e.style,{top:0,left:0,position:"absolute"}),t.appendChild(e),v=e);var o=e.getAttribute("data-tether-id");i(g[o])&&(g[o]=w(e),l((function(){delete g[o]})));return g[o]}(t);return r.top-=s.top,r.left-=s.left,i(r.width)&&(r.width=document.body.scrollWidth-r.left-r.right),i(r.height)&&(r.height=document.body.scrollHeight-r.top-r.bottom),r.top=r.top-n.clientTop,r.left=r.left-n.clientLeft,r.right=o.body.clientWidth-r.width-r.left,r.bottom=o.body.clientHeight-r.height-r.top,r}function w(t){var e=t.getBoundingClientRect(),o={};for(var i in e)o[i]=e[i];try{if(t.ownerDocument!==document){var n=t.ownerDocument.defaultView.frameElement;if(n){var r=w(n);o.top+=r.top,o.bottom+=r.top,o.left+=r.left,o.right+=r.left}}}catch(t){}return o}var y={position:function(t){var e=this,o=t.top,i=t.left,n=this.cache("element-bounds",(function(){return b(e.element)})),s=n.height,h=n.width,f=this.getTargetBounds(),p=o+s,d=i+h,c=[];o<=f.bottom&&p>=f.top&&["left","right"].forEach((function(t){var e=f[t];e!==i&&e!==d||c.push(t)})),i<=f.right&&d>=f.left&&["top","bottom"].forEach((function(t){var e=f[t];e!==o&&e!==p||c.push(t)}));var u=this.options,m=u.classes,g=u.classPrefix;return this.all.push(r("abutted",m,g)),["left","top","right","bottom"].forEach((function(t){e.all.push(r("abutted",m,g)+"-"+t)})),c.length&&this.add.push(r("abutted",m,g)),c.forEach((function(t){e.add.push(r("abutted",m,g)+"-"+t)})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,e.add,e.all),a(e.element,e.add,e.all)})),!0}},E=["left","top","right","bottom"];var O={position:function(t){var e=this,n=t.top,s=t.left,h=t.targetAttachment;if(!this.options.constraints)return!0;var f=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),p=f.height,c=f.width;if(0===c&&0===p&&!i(this.lastSize)){var u=this.lastSize;c=u.width,p=u.height}var m=this.cache("target-bounds",(function(){return e.getTargetBounds()})),g=m.height,v=m.width,w=this.options,y=w.classes,O=w.classPrefix,x=function(t,e,o){var i=[r("pinned",t,e),r("out-of-bounds",t,e)];return o.forEach((function(t){var e=t.outOfBoundsClass,o=t.pinnedClass;e&&i.push(e),o&&i.push(o)})),i.forEach((function(t){["left","top","right","bottom"].forEach((function(e){i.push(t+"-"+e)}))})),i}(y,O,this.options.constraints),C=[],T=d({},h),P=d({},this.attachment);return this.options.constraints.forEach((function(t){var a,l,f=t.to,d=t.attachment,u=t.pin;if(i(d)&&(d=""),d.indexOf(" ")>=0){var m=d.split(" ");l=m[0],a=m[1]}else a=l=d;var w=function(t,e,o){if(!o)return null;if("scrollParent"===o?o=e.scrollParents[0]:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),!i(o.nodeType)){var n=o,r=b(t,o),s=r,a=getComputedStyle(o);if(o=[s.left,s.top,r.width+s.left,r.height+s.top],n.ownerDocument!==document){var h=n.ownerDocument.defaultView;o[0]+=h.pageXOffset,o[1]+=h.pageYOffset,o[2]+=h.pageXOffset,o[3]+=h.pageYOffset}E.forEach((function(t,e){"Top"===(t=t[0].toUpperCase()+t.substr(1))||"Left"===t?o[e]+=parseFloat(a["border"+t+"Width"]):o[e]-=parseFloat(a["border"+t+"Width"])}))}return o}(e.bodyElement,e,f);"target"!==l&&"both"!==l||(nw[3]&&"bottom"===T.top&&(n-=g,T.top="top")),"together"===l&&(n=function(t,e,o,i,n,r){return"top"===t.top&&("bottom"===e.top&&ro[3]&&r-(i-n)>=o[1]&&(r-=i-n,t.top="bottom",e.top="bottom")),"bottom"===t.top&&("top"===e.top&&r+i>o[3]?(r-=n,t.top="top",r-=i,e.top="bottom"):"bottom"===e.top&&ro[3]&&"top"===e.top?(r-=i,e.top="bottom"):rw[2]&&"right"===T.left&&(s-=v,T.left="left")),"together"===a&&(s=function(t,e,o,i,n,r){return ro[2]&&"right"===t.left?"left"===e.left?(r-=n,t.left="left",r-=i,e.left="right"):"right"===e.left&&(r-=n,t.left="left",r+=i,e.left="left"):"center"===t.left&&(r+i>o[2]&&"left"===e.left?(r-=i,e.left="right"):rw[3]&&"top"===P.top&&(n-=p,P.top="bottom")),"element"!==a&&"both"!==a||(sw[2]&&("left"===P.left?(s-=c,P.left="right"):"center"===P.left&&(s-=c/2,P.left="right"))),o(u)?u=u.split(",").map((function(t){return t.trim()})):!0===u&&(u=["top","left","right","bottom"]);var x,A=[],W=[];(s=function(t,e,o,i,n,r){return t=0?(t=e[0],n.push("left")):r.push("left")),t+o>e[2]&&(i.indexOf("right")>=0?(t=e[2]-o,n.push("right")):r.push("right")),t}(s,w,c,u=u||[],A,W),n=function(t,e,o,i,n,r){return t=0?(t=e[1],n.push("top")):r.push("top")),t+o>e[3]&&(i.indexOf("bottom")>=0?(t=e[3]-o,n.push("bottom")):r.push("bottom")),t}(n,w,p,u,A,W),A.length)&&(x=i(e.options.pinnedClass)?r("pinned",y,O):e.options.pinnedClass,C.push(x),A.forEach((function(t){C.push(x+"-"+t)})));!function(t,e,o,n,s){var a;t.length&&(a=i(s)?r("out-of-bounds",o,n):s,e.push(a),t.forEach((function(t){e.push(a+"-"+t)})))}(W,C,y,O,e.options.outOfBoundsClass),(A.indexOf("left")>=0||A.indexOf("right")>=0)&&(P.left=T.left=!1),(A.indexOf("top")>=0||A.indexOf("bottom")>=0)&&(P.top=T.top=!1),T.top===h.top&&T.left===h.left&&P.top===e.attachment.top&&P.left===e.attachment.left||(e.updateAttachClasses(P,T),e.trigger("update",{attachment:P,targetAttachment:T}))})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,C,x),a(e.element,C,x)})),{top:n,left:s}}},x={position:function(t){var e=t.top,i=t.left;if(this.options.shift){var n,r,s=this.options.shift;if("function"==typeof s&&(s=s.call(this,{top:e,left:i})),o(s)){(s=s.split(" "))[1]=s[1]||s[0];var a=s;n=a[0],r=a[1],n=parseFloat(n,10),r=parseFloat(r,10)}else{var h=[s.top,s.left];n=h[0],r=h[1]}return{top:e+=n,left:i+=r}}}},C=function(){function t(){}var e=t.prototype;return e.on=function(t,e,o,n){return void 0===n&&(n=!1),i(this.bindings)&&(this.bindings={}),i(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:n}),this},e.once=function(t,e,o){return this.on(t,e,o,!0)},e.off=function(t,e){var o=this;return i(this.bindings)||i(this.bindings[t])||(i(e)?delete this.bindings[t]:this.bindings[t].forEach((function(i,n){i.handler===e&&o.bindings[t].splice(n,1)}))),this},e.trigger=function(t){for(var e=this,o=arguments.length,n=new Array(o>1?o-1:0),r=1;r16)return S=Math.min(S-16,250),void(X=setTimeout(t,250));!i(Y)&&N()-Y<10||(null!=X&&(clearTimeout(X),X=null),Y=N(),B(),S=N()-Y)},i(window)||i(window.addEventListener)||["resize","scroll","touchmove"].forEach((function(t){window.addEventListener(t,H)}));var R=function(h){var p,u;function m(t){var o;return(o=h.call(this)||this).position=o.position.bind(e(o)),k.push(e(o)),o.history=[],o.setOptions(t,!1),L.modules.forEach((function(t){i(t.initialize)||t.initialize.call(e(o))})),o.position(),o}u=h,(p=m).prototype=Object.create(u.prototype),p.prototype.constructor=p,t(p,u);var g=m.prototype;return g.setOptions=function(t,e){var n=this;void 0===e&&(e=!0);var r={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether",bodyElement:document.body};this.options=d(r,t);var s=this.options,a=s.element,h=s.target,l=s.targetModifier,f=s.bodyElement;if(this.element=a,this.target=h,this.targetModifier=l,"string"==typeof f&&(f=document.querySelector(f)),this.bodyElement=f,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach((function(t){if(i(n[t]))throw new Error("Tether Error: Both element and target must be defined");i(n[t].jquery)?o(n[t])&&(n[t]=document.querySelector(n[t])):n[t]=n[t][0]})),this._addClasses(),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=z(this.options.targetAttachment),this.attachment=z(this.options.attachment),this.offset=z(this.options.offset),this.targetOffset=z(this.options.targetOffset),i(this.scrollParents)||this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=function(t){var e=(getComputedStyle(t)||{}).position,o=[];if("fixed"===e)return[t];for(var n=t;(n=n.parentNode)&&n&&1===n.nodeType;){var r=void 0;try{r=getComputedStyle(n)}catch(t){}if(i(r)||null===r)return o.push(n),o;var s=r,a=s.overflow,h=s.overflowX,l=s.overflowY;/(auto|scroll|overlay)/.test(a+l+h)&&("absolute"!==e||["relative","absolute","fixed"].indexOf(r.position)>=0)&&o.push(n)}return o.push(t.ownerDocument.body),t.ownerDocument!==document&&o.push(t.ownerDocument.defaultView),o}(this.target),!1!==this.options.enabled&&this.enable(e)},g.getTargetBounds=function(){return i(this.targetModifier)?b(this.bodyElement,this.target):"visible"===this.targetModifier?function(t,e){if(e===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var o=b(t,e),i={height:o.height,width:o.width,top:o.top,left:o.left};return i.height=Math.min(i.height,o.height-(pageYOffset-o.top)),i.height=Math.min(i.height,o.height-(o.top+o.height-(pageYOffset+innerHeight))),i.height=Math.min(innerHeight,i.height),i.height-=2,i.width=Math.min(i.width,o.width-(pageXOffset-o.left)),i.width=Math.min(i.width,o.width-(o.left+o.width-(pageXOffset+innerWidth))),i.width=Math.min(innerWidth,i.width),i.width-=2,i.tope.clientWidth||[r.overflow,r.overflowX].indexOf("scroll")>=0||!n)&&(s=15);var a=o.height-parseFloat(r.borderTopWidth)-parseFloat(r.borderBottomWidth)-s,h={width:15,height:.975*a*(a/e.scrollHeight),left:o.left+o.width-parseFloat(r.borderLeftWidth)-15},l=0;a<408&&n&&(l=-11e-5*Math.pow(a,2)-.00727*a+22.58),n||(h.height=Math.max(h.height,24));var f=i/(e.scrollHeight-a);return h.top=f*(a-h.height-l)+o.top+parseFloat(r.borderTopWidth),n&&(h.height=Math.max(h.height,24)),h}(this.bodyElement,this.target):void 0},g.clearCache=function(){this._cache={}},g.cache=function(t,e){return i(this._cache)&&(this._cache={}),i(this._cache[t])&&(this._cache[t]=e.call(this)),this._cache[t]},g.enable=function(t){var e=this;void 0===t&&(t=!0);var o=this.options,i=o.classes,s=o.classPrefix;!1!==this.options.addTargetClasses&&n(this.target,r("enabled",i,s)),n(this.element,r("enabled",i,s)),this.enabled=!0,this.scrollParents.forEach((function(t){t!==e.target.ownerDocument&&t.addEventListener("scroll",e.position)})),t&&this.position()},g.disable=function(){var t=this,e=this.options,o=e.classes,n=e.classPrefix;s(this.target,r("enabled",o,n)),s(this.element,r("enabled",o,n)),this.enabled=!1,i(this.scrollParents)||this.scrollParents.forEach((function(e){e&&e.removeEventListener&&e.removeEventListener("scroll",t.position)}))},g.destroy=function(){var t,e=this;this.disable(),this._removeClasses(),k.forEach((function(t,o){t===e&&k.splice(o,1)})),0===k.length&&(t=this.bodyElement,v&&t.removeChild(v),v=null)},g.updateAttachClasses=function(t,e){var o=this;t=t||this.attachment,e=e||this.targetAttachment;var n=this.options,s=n.classes,h=n.classPrefix;!i(this._addAttachClasses)&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),i(this._addAttachClasses)&&(this._addAttachClasses=[]),this.add=this._addAttachClasses,t.top&&this.add.push(r("element-attached",s,h)+"-"+t.top),t.left&&this.add.push(r("element-attached",s,h)+"-"+t.left),e.top&&this.add.push(r("target-attached",s,h)+"-"+e.top),e.left&&this.add.push(r("target-attached",s,h)+"-"+e.left),this.all=[],["left","top","bottom","right","middle","center"].forEach((function(t){o.all.push(r("element-attached",s,h)+"-"+t),o.all.push(r("target-attached",s,h)+"-"+t)})),l((function(){i(o._addAttachClasses)||(a(o.element,o._addAttachClasses,o.all),!1!==o.options.addTargetClasses&&a(o.target,o._addAttachClasses,o.all),delete o._addAttachClasses)}))},g.position=function(t){var e=this;if(void 0===t&&(t=!0),this.enabled){this.clearCache();var o=function(t,e){var o=t.left,i=t.top;return"auto"===o&&(o=T[e.left]),"auto"===i&&(i=P[e.top]),{left:o,top:i}}(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,o);var n=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),r=n.width,s=n.height;if(0!==r||0!==s||i(this.lastSize))this.lastSize={width:r,height:s};else{var a=this.lastSize;r=a.width,s=a.height}var h=this.cache("target-bounds",(function(){return e.getTargetBounds()})),l=h,p=M(_(this.attachment),{width:r,height:s}),d=M(_(o),l),u=M(this.offset,{width:r,height:s}),m=M(this.targetOffset,l);p=W(p,u),d=W(d,m);for(var g=h.left+d.left-p.left,v=h.top+d.top-p.top,w=0;wx.documentElement.clientHeight&&(E=this.cache("scrollbar-size",c),O.viewport.bottom-=E.height),C.innerWidth>x.documentElement.clientWidth&&(E=this.cache("scrollbar-size",c),O.viewport.right-=E.width),-1!==["","static"].indexOf(x.body.style.position)&&-1!==["","static"].indexOf(x.body.parentElement.style.position)||(O.page.bottom=x.body.scrollHeight-v-s,O.page.right=x.body.scrollWidth-g-r),!i(this.options.optimizations)&&!1!==this.options.optimizations.moveElement&&i(this.targetModifier)){var A=this.cache("target-offsetparent",(function(){return F(e.target)})),z=this.cache("target-offsetparent-bounds",(function(){return b(e.bodyElement,A)})),Y=getComputedStyle(A),S=z,X={};if(["Top","Left","Bottom","Right"].forEach((function(t){X[t.toLowerCase()]=parseFloat(Y["border"+t+"Width"])})),z.right=x.body.scrollWidth-z.left-S.width+X.right,z.bottom=x.body.scrollHeight-z.top-S.height+X.bottom,O.page.top>=z.top+X.top&&O.page.bottom>=z.bottom&&O.page.left>=z.left+X.left&&O.page.right>=z.right){var H=A.scrollLeft,D=A.scrollTop;O.offset={top:O.page.top-z.top+D-X.top,left:O.page.left-z.left+H-X.left}}}return this.move(O),this.history.unshift(O),this.history.length>3&&this.history.pop(),t&&f(),!0}},g.move=function(t){var e=this;if(!i(this.element.parentNode)){var o,n,r,s={};for(var a in t)for(var h in s[a]={},t[a]){for(var f=!1,p=0;p=n&&n>=o-r))){f=!0;break}}f||(s[a][h]=!0)}var u={top:"",left:"",right:"",bottom:""},m=function(t,o){var n,r;!1!==(!i(e.options.optimizations)?e.options.optimizations.gpu:null)?(t.top?(u.top=0,n=o.top):(u.bottom=0,n=-o.bottom),t.left?(u.left=0,r=o.left):(u.right=0,r=-o.right),"number"==typeof window.devicePixelRatio&&devicePixelRatio%1==0&&(r=Math.round(r*devicePixelRatio)/devicePixelRatio,n=Math.round(n*devicePixelRatio)/devicePixelRatio),u[D]="translateX("+r+"px) translateY("+n+"px)","msTransform"!==D&&(u[D]+=" translateZ(0)")):(t.top?u.top=o.top+"px":u.bottom=o.bottom+"px",t.left?u.left=o.left+"px":u.right=o.right+"px")},g=!0;!i(this.options.optimizations)&&!1===this.options.optimizations.allowPositionFixed&&(g=!1);var v,b,w=!1;if((s.page.top||s.page.bottom)&&(s.page.left||s.page.right))u.position="absolute",m(s.page,t.page);else if(g&&(s.viewport.top||s.viewport.bottom)&&(s.viewport.left||s.viewport.right))u.position="fixed",m(s.viewport,t.viewport);else if(!i(s.offset)&&s.offset.top&&s.offset.left){u.position="absolute";var y=this.cache("target-offsetparent",(function(){return F(e.target)}));F(this.element)!==y&&l((function(){e.element.parentNode.removeChild(e.element),y.appendChild(e.element)})),m(s.offset,t.offset),w=!0}else u.position="absolute",m({top:!0,left:!0},t.page);if(!w)if(this.options.bodyElement)this.element.parentNode!==this.options.bodyElement&&this.options.bodyElement.appendChild(this.element);else{for(var E=!0,O=this.element.parentNode;O&&1===O.nodeType&&"BODY"!==O.tagName&&(b=void 0,((b=(v=O).ownerDocument).fullscreenElement||b.webkitFullscreenElement||b.mozFullScreenElement||b.msFullscreenElement)!==v);){if("static"!==getComputedStyle(O).position){E=!1;break}O=O.parentNode}E||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var x={},C=!1;for(var T in u){var P=u[T];this.element.style[T]!==P&&(C=!0,x[T]=P)}C&&l((function(){d(e.element.style,x),e.trigger("repositioned")}))}},g._addClasses=function(){var t=this.options,e=t.classes,o=t.classPrefix;n(this.element,r("element",e,o)),!1!==this.options.addTargetClasses&&n(this.target,r("target",e,o))},g._removeClasses=function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;s(this.element,r("element",o,i)),!1!==this.options.addTargetClasses&&s(this.target,r("target",o,i)),this.all.forEach((function(e){t.element.classList.remove(e),t.target.classList.remove(e)}))},m}(C);R.modules=[],L.position=B;var j=d(R,L);j.modules.push({initialize:function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;this.markers={},["target","element"].forEach((function(e){var n=document.createElement("div");n.className=r(e+"-marker",o,i);var s=document.createElement("div");s.className=r("marker-dot",o,i),n.appendChild(s),t[e].appendChild(n),t.markers[e]={dot:s,el:n}}))},position:function(t){var e={element:t.manualOffset,target:t.manualTargetOffset};for(var i in e){var n=e[i];for(var r in n){var s,a=n[r];(!o(a)||-1===a.indexOf("%")&&-1===a.indexOf("px"))&&(a+="px"),this.markers[i]&&(null==(s=this.markers[i].dot)?void 0:s.style[r])!==a&&(this.markers[i].dot.style[r]=a)}}return!0}});export default j; -//# sourceMappingURL=tether.esm.min.js.map +function t(e,o){return t=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t(e,o)}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){return"string"==typeof t}function i(t){return void 0===t}function n(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.add(e)}))}function r(t,e,o){return void 0===t&&(t=""),i(e)||i(e[t])?o?o+"-"+t:t:!1===e[t]?"":e[t]}function s(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.remove(e)}))}function a(t,e,o){o.forEach((function(o){-1===e.indexOf(o)&&t.classList.contains(o)&&s(t,o)})),e.forEach((function(e){t.classList.contains(e)||n(t,e)}))}var h=[];function l(t){h.push(t)}function f(){for(var t;t=h.pop();)t()}var p=null;function d(t){void 0===t&&(t={});var e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach((function(e){if(e)for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])})),t}function c(){if(p)return p;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");d(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var o=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=e.clientWidth),document.body.removeChild(e);var n=o-i;return p={width:n,height:n}}var u,m=(u=0,function(){return++u}),g={},v=new Map;function b(t,e){var o;e===document?(o=document,e=document.documentElement):o=e.ownerDocument;var n=o.documentElement,r=w(e),s=function(t){var e=v.get(t);e&&t.contains(e)||((e=document.createElement("div")).setAttribute("data-tether-id",m()),d(e.style,{top:0,left:0,position:"absolute"}),t.appendChild(e),v.set(t,e));var o=e.getAttribute("data-tether-id");i(g[o])&&(g[o]=w(e),l((function(){delete g[o]})));return g[o]}(t);return r.top-=s.top,r.left-=s.left,i(r.width)&&(r.width=document.body.scrollWidth-r.left-r.right),i(r.height)&&(r.height=document.body.scrollHeight-r.top-r.bottom),r.top=r.top-n.clientTop,r.left=r.left-n.clientLeft,r.right=o.body.clientWidth-r.width-r.left,r.bottom=o.body.clientHeight-r.height-r.top,r}function w(t){var e=t.getBoundingClientRect(),o={};for(var i in e)o[i]=e[i];try{if(t.ownerDocument!==document){var n=t.ownerDocument.defaultView.frameElement;if(n){var r=w(n);o.top+=r.top,o.bottom+=r.top,o.left+=r.left,o.right+=r.left}}}catch(t){}return o}var y={position:function(t){var e=this,o=t.top,i=t.left,n=this.cache("element-bounds",(function(){return b(e.element)})),s=n.height,h=n.width,f=this.getTargetBounds(),p=o+s,d=i+h,c=[];o<=f.bottom&&p>=f.top&&["left","right"].forEach((function(t){var e=f[t];e!==i&&e!==d||c.push(t)})),i<=f.right&&d>=f.left&&["top","bottom"].forEach((function(t){var e=f[t];e!==o&&e!==p||c.push(t)}));var u=this.options,m=u.classes,g=u.classPrefix;return this.all.push(r("abutted",m,g)),["left","top","right","bottom"].forEach((function(t){e.all.push(r("abutted",m,g)+"-"+t)})),c.length&&this.add.push(r("abutted",m,g)),c.forEach((function(t){e.add.push(r("abutted",m,g)+"-"+t)})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,e.add,e.all),a(e.element,e.add,e.all)})),!0}},E=["left","top","right","bottom"];var O={position:function(t){var e=this,n=t.top,s=t.left,h=t.targetAttachment;if(!this.options.constraints)return!0;var f=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),p=f.height,c=f.width;if(0===c&&0===p&&!i(this.lastSize)){var u=this.lastSize;c=u.width,p=u.height}var m=this.cache("target-bounds",(function(){return e.getTargetBounds()})),g=m.height,v=m.width,w=this.options,y=w.classes,O=w.classPrefix,x=function(t,e,o){var i=[r("pinned",t,e),r("out-of-bounds",t,e)];return o.forEach((function(t){var e=t.outOfBoundsClass,o=t.pinnedClass;e&&i.push(e),o&&i.push(o)})),i.forEach((function(t){["left","top","right","bottom"].forEach((function(e){i.push(t+"-"+e)}))})),i}(y,O,this.options.constraints),C=[],T=d({},h),P=d({},this.attachment);return this.options.constraints.forEach((function(t){var a,l,f=t.to,d=t.attachment,u=t.pin;if(i(d)&&(d=""),d.indexOf(" ")>=0){var m=d.split(" ");l=m[0],a=m[1]}else a=l=d;var w=function(t,e,o){if(!o)return null;if("scrollParent"===o?o=e.scrollParents[0]:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),!i(o.nodeType)){var n=o,r=b(t,o),s=r,a=getComputedStyle(o);if(o=[s.left,s.top,r.width+s.left,r.height+s.top],n.ownerDocument!==document){var h=n.ownerDocument.defaultView;o[0]+=h.pageXOffset,o[1]+=h.pageYOffset,o[2]+=h.pageXOffset,o[3]+=h.pageYOffset}E.forEach((function(t,e){"Top"===(t=t[0].toUpperCase()+t.substr(1))||"Left"===t?o[e]+=parseFloat(a["border"+t+"Width"]):o[e]-=parseFloat(a["border"+t+"Width"])}))}return o}(e.bodyElement,e,f);"target"!==l&&"both"!==l||(nw[3]&&"bottom"===T.top&&(n-=g,T.top="top")),"together"===l&&(n=function(t,e,o,i,n,r){return"top"===t.top&&("bottom"===e.top&&ro[3]&&r-(i-n)>=o[1]&&(r-=i-n,t.top="bottom",e.top="bottom")),"bottom"===t.top&&("top"===e.top&&r+i>o[3]?(r-=n,t.top="top",r-=i,e.top="bottom"):"bottom"===e.top&&ro[3]&&"top"===e.top?(r-=i,e.top="bottom"):rw[2]&&"right"===T.left&&(s-=v,T.left="left")),"together"===a&&(s=function(t,e,o,i,n,r){return ro[2]&&"right"===t.left?"left"===e.left?(r-=n,t.left="left",r-=i,e.left="right"):"right"===e.left&&(r-=n,t.left="left",r+=i,e.left="left"):"center"===t.left&&(r+i>o[2]&&"left"===e.left?(r-=i,e.left="right"):rw[3]&&"top"===P.top&&(n-=p,P.top="bottom")),"element"!==a&&"both"!==a||(sw[2]&&("left"===P.left?(s-=c,P.left="right"):"center"===P.left&&(s-=c/2,P.left="right"))),o(u)?u=u.split(",").map((function(t){return t.trim()})):!0===u&&(u=["top","left","right","bottom"]);var x,A=[],W=[];(s=function(t,e,o,i,n,r){return t=0?(t=e[0],n.push("left")):r.push("left")),t+o>e[2]&&(i.indexOf("right")>=0?(t=e[2]-o,n.push("right")):r.push("right")),t}(s,w,c,u=u||[],A,W),n=function(t,e,o,i,n,r){return t=0?(t=e[1],n.push("top")):r.push("top")),t+o>e[3]&&(i.indexOf("bottom")>=0?(t=e[3]-o,n.push("bottom")):r.push("bottom")),t}(n,w,p,u,A,W),A.length)&&(x=i(e.options.pinnedClass)?r("pinned",y,O):e.options.pinnedClass,C.push(x),A.forEach((function(t){C.push(x+"-"+t)})));!function(t,e,o,n,s){var a;t.length&&(a=i(s)?r("out-of-bounds",o,n):s,e.push(a),t.forEach((function(t){e.push(a+"-"+t)})))}(W,C,y,O,e.options.outOfBoundsClass),(A.indexOf("left")>=0||A.indexOf("right")>=0)&&(P.left=T.left=!1),(A.indexOf("top")>=0||A.indexOf("bottom")>=0)&&(P.top=T.top=!1),T.top===h.top&&T.left===h.left&&P.top===e.attachment.top&&P.left===e.attachment.left||(e.updateAttachClasses(P,T),e.trigger("update",{attachment:P,targetAttachment:T}))})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,C,x),a(e.element,C,x)})),{top:n,left:s}}},x={position:function(t){var e=t.top,i=t.left;if(this.options.shift){var n,r,s=this.options.shift;if("function"==typeof s&&(s=s.call(this,{top:e,left:i})),o(s)){(s=s.split(" "))[1]=s[1]||s[0];var a=s;n=a[0],r=a[1],n=parseFloat(n,10),r=parseFloat(r,10)}else{var h=[s.top,s.left];n=h[0],r=h[1]}return{top:e+=n,left:i+=r}}}},C=function(){function t(){}var e=t.prototype;return e.on=function(t,e,o,n){return void 0===n&&(n=!1),i(this.bindings)&&(this.bindings={}),i(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:n}),this},e.once=function(t,e,o){return this.on(t,e,o,!0)},e.off=function(t,e){var o=this;return i(this.bindings)||i(this.bindings[t])||(i(e)?delete this.bindings[t]:this.bindings[t].forEach((function(i,n){i.handler===e&&o.bindings[t].splice(n,1)}))),this},e.trigger=function(t){for(var e=this,o=arguments.length,n=new Array(o>1?o-1:0),r=1;r16)return S=Math.min(S-16,250),void(X=setTimeout(t,250));!i(Y)&&N()-Y<10||(null!=X&&(clearTimeout(X),X=null),Y=N(),B(),S=N()-Y)},i(window)||i(window.addEventListener)||["resize","scroll","touchmove"].forEach((function(t){window.addEventListener(t,H)}));var R=function(h){var p,u;function m(t){var o;return(o=h.call(this)||this).position=o.position.bind(e(o)),k.push(e(o)),o.history=[],o.setOptions(t,!1),L.modules.forEach((function(t){i(t.initialize)||t.initialize.call(e(o))})),o.position(),o}u=h,(p=m).prototype=Object.create(u.prototype),p.prototype.constructor=p,t(p,u);var g=m.prototype;return g.setOptions=function(t,e){var n=this;void 0===e&&(e=!0);var r={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether",bodyElement:document.body};this.options=d(r,t);var s=this.options,a=s.element,h=s.target,l=s.targetModifier,f=s.bodyElement;if(this.element=a,this.target=h,this.targetModifier=l,"string"==typeof f&&(f=document.querySelector(f)),this.bodyElement=f,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach((function(t){if(i(n[t]))throw new Error("Tether Error: Both element and target must be defined");i(n[t].jquery)?o(n[t])&&(n[t]=document.querySelector(n[t])):n[t]=n[t][0]})),this._addClasses(),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=z(this.options.targetAttachment),this.attachment=z(this.options.attachment),this.offset=z(this.options.offset),this.targetOffset=z(this.options.targetOffset),i(this.scrollParents)||this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=function(t){var e=(getComputedStyle(t)||{}).position,o=[];if("fixed"===e)return[t];for(var n=t;(n=n.parentNode)&&n&&1===n.nodeType;){var r=void 0;try{r=getComputedStyle(n)}catch(t){}if(i(r)||null===r)return o.push(n),o;var s=r,a=s.overflow,h=s.overflowX,l=s.overflowY;/(auto|scroll|overlay)/.test(a+l+h)&&("absolute"!==e||["relative","absolute","fixed"].indexOf(r.position)>=0)&&o.push(n)}return o.push(t.ownerDocument.body),t.ownerDocument!==document&&o.push(t.ownerDocument.defaultView),o}(this.target),!1!==this.options.enabled&&this.enable(e)},g.getTargetBounds=function(){return i(this.targetModifier)?b(this.bodyElement,this.target):"visible"===this.targetModifier?function(t,e){if(e===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var o=b(t,e),i={height:o.height,width:o.width,top:o.top,left:o.left};return i.height=Math.min(i.height,o.height-(pageYOffset-o.top)),i.height=Math.min(i.height,o.height-(o.top+o.height-(pageYOffset+innerHeight))),i.height=Math.min(innerHeight,i.height),i.height-=2,i.width=Math.min(i.width,o.width-(pageXOffset-o.left)),i.width=Math.min(i.width,o.width-(o.left+o.width-(pageXOffset+innerWidth))),i.width=Math.min(innerWidth,i.width),i.width-=2,i.tope.clientWidth||[r.overflow,r.overflowX].indexOf("scroll")>=0||!n)&&(s=15);var a=o.height-parseFloat(r.borderTopWidth)-parseFloat(r.borderBottomWidth)-s,h={width:15,height:.975*a*(a/e.scrollHeight),left:o.left+o.width-parseFloat(r.borderLeftWidth)-15},l=0;a<408&&n&&(l=-11e-5*Math.pow(a,2)-.00727*a+22.58),n||(h.height=Math.max(h.height,24));var f=i/(e.scrollHeight-a);return h.top=f*(a-h.height-l)+o.top+parseFloat(r.borderTopWidth),n&&(h.height=Math.max(h.height,24)),h}(this.bodyElement,this.target):void 0},g.clearCache=function(){this._cache={}},g.cache=function(t,e){return i(this._cache)&&(this._cache={}),i(this._cache[t])&&(this._cache[t]=e.call(this)),this._cache[t]},g.enable=function(t){var e=this;void 0===t&&(t=!0);var o=this.options,i=o.classes,s=o.classPrefix;!1!==this.options.addTargetClasses&&n(this.target,r("enabled",i,s)),n(this.element,r("enabled",i,s)),this.enabled=!0,this.scrollParents.forEach((function(t){t!==e.target.ownerDocument&&t.addEventListener("scroll",e.position)})),t&&this.position()},g.disable=function(){var t=this,e=this.options,o=e.classes,n=e.classPrefix;s(this.target,r("enabled",o,n)),s(this.element,r("enabled",o,n)),this.enabled=!1,i(this.scrollParents)||this.scrollParents.forEach((function(e){e&&e.removeEventListener&&e.removeEventListener("scroll",t.position)}))},g.destroy=function(){var t,e=this;this.disable(),this._removeClasses(),k.forEach((function(t,o){t===e&&k.splice(o,1)})),0===k.length&&(t=this.bodyElement,v.has(t)&&t.removeChild(v.get(t)),v.delete(t))},g.updateAttachClasses=function(t,e){var o=this;t=t||this.attachment,e=e||this.targetAttachment;var n=this.options,s=n.classes,h=n.classPrefix;!i(this._addAttachClasses)&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),i(this._addAttachClasses)&&(this._addAttachClasses=[]),this.add=this._addAttachClasses,t.top&&this.add.push(r("element-attached",s,h)+"-"+t.top),t.left&&this.add.push(r("element-attached",s,h)+"-"+t.left),e.top&&this.add.push(r("target-attached",s,h)+"-"+e.top),e.left&&this.add.push(r("target-attached",s,h)+"-"+e.left),this.all=[],["left","top","bottom","right","middle","center"].forEach((function(t){o.all.push(r("element-attached",s,h)+"-"+t),o.all.push(r("target-attached",s,h)+"-"+t)})),l((function(){i(o._addAttachClasses)||(a(o.element,o._addAttachClasses,o.all),!1!==o.options.addTargetClasses&&a(o.target,o._addAttachClasses,o.all),delete o._addAttachClasses)}))},g.position=function(t){var e=this;if(void 0===t&&(t=!0),this.enabled){this.clearCache();var o=function(t,e){var o=t.left,i=t.top;return"auto"===o&&(o=T[e.left]),"auto"===i&&(i=P[e.top]),{left:o,top:i}}(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,o);var n=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),r=n.width,s=n.height;if(0!==r||0!==s||i(this.lastSize))this.lastSize={width:r,height:s};else{var a=this.lastSize;r=a.width,s=a.height}var h=this.cache("target-bounds",(function(){return e.getTargetBounds()})),l=h,p=M(_(this.attachment),{width:r,height:s}),d=M(_(o),l),u=M(this.offset,{width:r,height:s}),m=M(this.targetOffset,l);p=W(p,u),d=W(d,m);for(var g=h.left+d.left-p.left,v=h.top+d.top-p.top,w=0;wx.documentElement.clientHeight&&(E=this.cache("scrollbar-size",c),O.viewport.bottom-=E.height),C.innerWidth>x.documentElement.clientWidth&&(E=this.cache("scrollbar-size",c),O.viewport.right-=E.width),-1!==["","static"].indexOf(x.body.style.position)&&-1!==["","static"].indexOf(x.body.parentElement.style.position)||(O.page.bottom=x.body.scrollHeight-v-s,O.page.right=x.body.scrollWidth-g-r),!i(this.options.optimizations)&&!1!==this.options.optimizations.moveElement&&i(this.targetModifier)){var A=this.cache("target-offsetparent",(function(){return F(e.target)})),z=this.cache("target-offsetparent-bounds",(function(){return b(e.bodyElement,A)})),Y=getComputedStyle(A),S=z,X={};if(["Top","Left","Bottom","Right"].forEach((function(t){X[t.toLowerCase()]=parseFloat(Y["border"+t+"Width"])})),z.right=x.body.scrollWidth-z.left-S.width+X.right,z.bottom=x.body.scrollHeight-z.top-S.height+X.bottom,O.page.top>=z.top+X.top&&O.page.bottom>=z.bottom&&O.page.left>=z.left+X.left&&O.page.right>=z.right){var H=A.scrollLeft,D=A.scrollTop;O.offset={top:O.page.top-z.top+D-X.top,left:O.page.left-z.left+H-X.left}}}return this.move(O),this.history.unshift(O),this.history.length>3&&this.history.pop(),t&&f(),!0}},g.move=function(t){var e=this;if(!i(this.element.parentNode)){var o,n,r,s={};for(var a in t)for(var h in s[a]={},t[a]){for(var f=!1,p=0;p=n&&n>=o-r))){f=!0;break}}f||(s[a][h]=!0)}var u={top:"",left:"",right:"",bottom:""},m=function(t,o){var n,r;!1!==(!i(e.options.optimizations)?e.options.optimizations.gpu:null)?(t.top?(u.top=0,n=o.top):(u.bottom=0,n=-o.bottom),t.left?(u.left=0,r=o.left):(u.right=0,r=-o.right),"number"==typeof window.devicePixelRatio&&devicePixelRatio%1==0&&(r=Math.round(r*devicePixelRatio)/devicePixelRatio,n=Math.round(n*devicePixelRatio)/devicePixelRatio),u[D]="translateX("+r+"px) translateY("+n+"px)","msTransform"!==D&&(u[D]+=" translateZ(0)")):(t.top?u.top=o.top+"px":u.bottom=o.bottom+"px",t.left?u.left=o.left+"px":u.right=o.right+"px")},g=!0;!i(this.options.optimizations)&&!1===this.options.optimizations.allowPositionFixed&&(g=!1);var v,b,w=!1;if((s.page.top||s.page.bottom)&&(s.page.left||s.page.right))u.position="absolute",m(s.page,t.page);else if(g&&(s.viewport.top||s.viewport.bottom)&&(s.viewport.left||s.viewport.right))u.position="fixed",m(s.viewport,t.viewport);else if(!i(s.offset)&&s.offset.top&&s.offset.left){u.position="absolute";var y=this.cache("target-offsetparent",(function(){return F(e.target)}));F(this.element)!==y&&l((function(){e.element.parentNode.removeChild(e.element),y.appendChild(e.element)})),m(s.offset,t.offset),w=!0}else u.position="absolute",m({top:!0,left:!0},t.page);if(!w)if(this.options.bodyElement)this.element.parentNode!==this.options.bodyElement&&this.options.bodyElement.appendChild(this.element);else{for(var E=!0,O=this.element.parentNode;O&&1===O.nodeType&&"BODY"!==O.tagName&&(b=void 0,((b=(v=O).ownerDocument).fullscreenElement||b.webkitFullscreenElement||b.mozFullScreenElement||b.msFullscreenElement)!==v);){if("static"!==getComputedStyle(O).position){E=!1;break}O=O.parentNode}E||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var x={},C=!1;for(var T in u){var P=u[T];this.element.style[T]!==P&&(C=!0,x[T]=P)}C&&l((function(){d(e.element.style,x),e.trigger("repositioned")}))}},g._addClasses=function(){var t=this.options,e=t.classes,o=t.classPrefix;n(this.element,r("element",e,o)),!1!==this.options.addTargetClasses&&n(this.target,r("target",e,o))},g._removeClasses=function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;s(this.element,r("element",o,i)),!1!==this.options.addTargetClasses&&s(this.target,r("target",o,i)),this.all.forEach((function(e){t.element.classList.remove(e),t.target.classList.remove(e)}))},m}(C);R.modules=[],L.position=B;var j=d(R,L);j.modules.push({initialize:function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;this.markers={},["target","element"].forEach((function(e){var n=document.createElement("div");n.className=r(e+"-marker",o,i);var s=document.createElement("div");s.className=r("marker-dot",o,i),n.appendChild(s),t[e].appendChild(n),t.markers[e]={dot:s,el:n}}))},position:function(t){var e={element:t.manualOffset,target:t.manualTargetOffset};for(var i in e){var n=e[i];for(var r in n){var s,a=n[r];(!o(a)||-1===a.indexOf("%")&&-1===a.indexOf("px"))&&(a+="px"),this.markers[i]&&(null==(s=this.markers[i].dot)?void 0:s.style[r])!==a&&(this.markers[i].dot.style[r]=a)}}return!0}});export default j; -\ No newline at end of file diff --git a/dist/js/tether.js b/dist/js/tether.js -index 8a3c21d6312fe700ffbbadf29335146a96cd90e6..0af5d490878dffe264591a8df06ad3c8f5fdcb8d 100644 +index 8a3c21d6312fe700ffbbadf29335146a96cd90e6..67503b2a46b6b4a9dac209dc71131c923b20ab5c 100644 --- a/dist/js/tether.js +++ b/dist/js/tether.js @@ -199,7 +199,7 @@ @@ -64,7 +63,7 @@ index 8a3c21d6312fe700ffbbadf29335146a96cd90e6..0af5d490878dffe264591a8df06ad3c8 var zeroPosCache = {}; - var zeroElement = null; -+ var zeroElement = new Map(); ++ var zeroElements = new Map(); function getBounds(body, el) { var doc; @@ -101,3 +100,13 @@ index 8a3c21d6312fe700ffbbadf29335146a96cd90e6..0af5d490878dffe264591a8df06ad3c8 } var id = node.getAttribute('data-tether-id'); +diff --git a/dist/js/tether.min.js b/dist/js/tether.min.js +index 86eed6ad86cb91f3d2bd7f4a46e5c62a95232ed0..93072f55a6d500e2b00380869c73473e874054d5 100644 +--- a/dist/js/tether.min.js ++++ b/dist/js/tether.min.js +@@ -1,4 +1,3 @@ + /*! tether 2.0.0 */ + +-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Tether=e()}(this,(function(){"use strict";function t(e,o){return(t=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(e,o)}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){return"string"==typeof t}function i(t){return void 0===t}function n(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.add(e)}))}function s(t,e,o){return void 0===t&&(t=""),i(e)||i(e[t])?o?o+"-"+t:t:!1===e[t]?"":e[t]}function r(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.remove(e)}))}function a(t,e,o){o.forEach((function(o){-1===e.indexOf(o)&&t.classList.contains(o)&&r(t,o)})),e.forEach((function(e){t.classList.contains(e)||n(t,e)}))}var h=[];function l(t){h.push(t)}function f(){for(var t;t=h.pop();)t()}var p=null;function d(t){void 0===t&&(t={});var e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach((function(e){if(e)for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])})),t}function c(){if(p)return p;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");d(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var o=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=e.clientWidth),document.body.removeChild(e);var n=o-i;return p={width:n,height:n}}var u,m=(u=0,function(){return++u}),g={},v=null;function b(t,e){var o;e===document?(o=document,e=document.documentElement):o=e.ownerDocument;var n=o.documentElement,s=w(e),r=function(t){var e=v;e&&t.contains(e)||((e=document.createElement("div")).setAttribute("data-tether-id",m()),d(e.style,{top:0,left:0,position:"absolute"}),t.appendChild(e),v=e);var o=e.getAttribute("data-tether-id");i(g[o])&&(g[o]=w(e),l((function(){delete g[o]})));return g[o]}(t);return s.top-=r.top,s.left-=r.left,i(s.width)&&(s.width=document.body.scrollWidth-s.left-s.right),i(s.height)&&(s.height=document.body.scrollHeight-s.top-s.bottom),s.top=s.top-n.clientTop,s.left=s.left-n.clientLeft,s.right=o.body.clientWidth-s.width-s.left,s.bottom=o.body.clientHeight-s.height-s.top,s}function w(t){var e=t.getBoundingClientRect(),o={};for(var i in e)o[i]=e[i];try{if(t.ownerDocument!==document){var n=t.ownerDocument.defaultView.frameElement;if(n){var s=w(n);o.top+=s.top,o.bottom+=s.top,o.left+=s.left,o.right+=s.left}}}catch(t){}return o}var y={position:function(t){var e=this,o=t.top,i=t.left,n=this.cache("element-bounds",(function(){return b(e.element)})),r=n.height,h=n.width,f=this.getTargetBounds(),p=o+r,d=i+h,c=[];o<=f.bottom&&p>=f.top&&["left","right"].forEach((function(t){var e=f[t];e!==i&&e!==d||c.push(t)})),i<=f.right&&d>=f.left&&["top","bottom"].forEach((function(t){var e=f[t];e!==o&&e!==p||c.push(t)}));var u=this.options,m=u.classes,g=u.classPrefix;return this.all.push(s("abutted",m,g)),["left","top","right","bottom"].forEach((function(t){e.all.push(s("abutted",m,g)+"-"+t)})),c.length&&this.add.push(s("abutted",m,g)),c.forEach((function(t){e.add.push(s("abutted",m,g)+"-"+t)})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,e.add,e.all),a(e.element,e.add,e.all)})),!0}},E=["left","top","right","bottom"];var O={position:function(t){var e=this,n=t.top,r=t.left,h=t.targetAttachment;if(!this.options.constraints)return!0;var f=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),p=f.height,c=f.width;if(0===c&&0===p&&!i(this.lastSize)){var u=this.lastSize;c=u.width,p=u.height}var m=this.cache("target-bounds",(function(){return e.getTargetBounds()})),g=m.height,v=m.width,w=this.options,y=w.classes,O=w.classPrefix,x=function(t,e,o){var i=[s("pinned",t,e),s("out-of-bounds",t,e)];return o.forEach((function(t){var e=t.outOfBoundsClass,o=t.pinnedClass;e&&i.push(e),o&&i.push(o)})),i.forEach((function(t){["left","top","right","bottom"].forEach((function(e){i.push(t+"-"+e)}))})),i}(y,O,this.options.constraints),C=[],T=d({},h),P=d({},this.attachment);return this.options.constraints.forEach((function(t){var a,l,f=t.to,d=t.attachment,u=t.pin;if(i(d)&&(d=""),d.indexOf(" ")>=0){var m=d.split(" ");l=m[0],a=m[1]}else a=l=d;var w=function(t,e,o){if(!o)return null;if("scrollParent"===o?o=e.scrollParents[0]:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),!i(o.nodeType)){var n=o,s=b(t,o),r=s,a=getComputedStyle(o);if(o=[r.left,r.top,s.width+r.left,s.height+r.top],n.ownerDocument!==document){var h=n.ownerDocument.defaultView;o[0]+=h.pageXOffset,o[1]+=h.pageYOffset,o[2]+=h.pageXOffset,o[3]+=h.pageYOffset}E.forEach((function(t,e){"Top"===(t=t[0].toUpperCase()+t.substr(1))||"Left"===t?o[e]+=parseFloat(a["border"+t+"Width"]):o[e]-=parseFloat(a["border"+t+"Width"])}))}return o}(e.bodyElement,e,f);"target"!==l&&"both"!==l||(nw[3]&&"bottom"===T.top&&(n-=g,T.top="top")),"together"===l&&(n=function(t,e,o,i,n,s){return"top"===t.top&&("bottom"===e.top&&so[3]&&s-(i-n)>=o[1]&&(s-=i-n,t.top="bottom",e.top="bottom")),"bottom"===t.top&&("top"===e.top&&s+i>o[3]?(s-=n,t.top="top",s-=i,e.top="bottom"):"bottom"===e.top&&so[3]&&"top"===e.top?(s-=i,e.top="bottom"):sw[2]&&"right"===T.left&&(r-=v,T.left="left")),"together"===a&&(r=function(t,e,o,i,n,s){return so[2]&&"right"===t.left?"left"===e.left?(s-=n,t.left="left",s-=i,e.left="right"):"right"===e.left&&(s-=n,t.left="left",s+=i,e.left="left"):"center"===t.left&&(s+i>o[2]&&"left"===e.left?(s-=i,e.left="right"):sw[3]&&"top"===P.top&&(n-=p,P.top="bottom")),"element"!==a&&"both"!==a||(rw[2]&&("left"===P.left?(r-=c,P.left="right"):"center"===P.left&&(r-=c/2,P.left="right"))),o(u)?u=u.split(",").map((function(t){return t.trim()})):!0===u&&(u=["top","left","right","bottom"]);var x,A=[],W=[];(r=function(t,e,o,i,n,s){return t=0?(t=e[0],n.push("left")):s.push("left")),t+o>e[2]&&(i.indexOf("right")>=0?(t=e[2]-o,n.push("right")):s.push("right")),t}(r,w,c,u=u||[],A,W),n=function(t,e,o,i,n,s){return t=0?(t=e[1],n.push("top")):s.push("top")),t+o>e[3]&&(i.indexOf("bottom")>=0?(t=e[3]-o,n.push("bottom")):s.push("bottom")),t}(n,w,p,u,A,W),A.length)&&(x=i(e.options.pinnedClass)?s("pinned",y,O):e.options.pinnedClass,C.push(x),A.forEach((function(t){C.push(x+"-"+t)})));!function(t,e,o,n,r){var a;t.length&&(a=i(r)?s("out-of-bounds",o,n):r,e.push(a),t.forEach((function(t){e.push(a+"-"+t)})))}(W,C,y,O,e.options.outOfBoundsClass),(A.indexOf("left")>=0||A.indexOf("right")>=0)&&(P.left=T.left=!1),(A.indexOf("top")>=0||A.indexOf("bottom")>=0)&&(P.top=T.top=!1),T.top===h.top&&T.left===h.left&&P.top===e.attachment.top&&P.left===e.attachment.left||(e.updateAttachClasses(P,T),e.trigger("update",{attachment:P,targetAttachment:T}))})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,C,x),a(e.element,C,x)})),{top:n,left:r}}},x={position:function(t){var e=t.top,i=t.left;if(this.options.shift){var n,s,r=this.options.shift;if("function"==typeof r&&(r=r.call(this,{top:e,left:i})),o(r)){(r=r.split(" "))[1]=r[1]||r[0];var a=r;n=a[0],s=a[1],n=parseFloat(n,10),s=parseFloat(s,10)}else{var h=[r.top,r.left];n=h[0],s=h[1]}return{top:e+=n,left:i+=s}}}},C=function(){function t(){}var e=t.prototype;return e.on=function(t,e,o,n){return void 0===n&&(n=!1),i(this.bindings)&&(this.bindings={}),i(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:n}),this},e.once=function(t,e,o){return this.on(t,e,o,!0)},e.off=function(t,e){var o=this;return i(this.bindings)||i(this.bindings[t])||(i(e)?delete this.bindings[t]:this.bindings[t].forEach((function(i,n){i.handler===e&&o.bindings[t].splice(n,1)}))),this},e.trigger=function(t){for(var e=this,o=arguments.length,n=new Array(o>1?o-1:0),s=1;s16)return S=Math.min(S-16,250),void(X=setTimeout(t,250));!i(Y)&&N()-Y<10||(null!=X&&(clearTimeout(X),X=null),Y=N(),B(),S=N()-Y)},i(window)||i(window.addEventListener)||["resize","scroll","touchmove"].forEach((function(t){window.addEventListener(t,H)}));var R=function(h){var p,u;function m(t){var o;return(o=h.call(this)||this).position=o.position.bind(e(o)),k.push(e(o)),o.history=[],o.setOptions(t,!1),L.modules.forEach((function(t){i(t.initialize)||t.initialize.call(e(o))})),o.position(),o}u=h,(p=m).prototype=Object.create(u.prototype),p.prototype.constructor=p,t(p,u);var g=m.prototype;return g.setOptions=function(t,e){var n=this;void 0===e&&(e=!0);var s={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether",bodyElement:document.body};this.options=d(s,t);var r=this.options,a=r.element,h=r.target,l=r.targetModifier,f=r.bodyElement;if(this.element=a,this.target=h,this.targetModifier=l,"string"==typeof f&&(f=document.querySelector(f)),this.bodyElement=f,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach((function(t){if(i(n[t]))throw new Error("Tether Error: Both element and target must be defined");i(n[t].jquery)?o(n[t])&&(n[t]=document.querySelector(n[t])):n[t]=n[t][0]})),this._addClasses(),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=z(this.options.targetAttachment),this.attachment=z(this.options.attachment),this.offset=z(this.options.offset),this.targetOffset=z(this.options.targetOffset),i(this.scrollParents)||this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=function(t){var e=(getComputedStyle(t)||{}).position,o=[];if("fixed"===e)return[t];for(var n=t;(n=n.parentNode)&&n&&1===n.nodeType;){var s=void 0;try{s=getComputedStyle(n)}catch(t){}if(i(s)||null===s)return o.push(n),o;var r=s,a=r.overflow,h=r.overflowX,l=r.overflowY;/(auto|scroll|overlay)/.test(a+l+h)&&("absolute"!==e||["relative","absolute","fixed"].indexOf(s.position)>=0)&&o.push(n)}return o.push(t.ownerDocument.body),t.ownerDocument!==document&&o.push(t.ownerDocument.defaultView),o}(this.target),!1!==this.options.enabled&&this.enable(e)},g.getTargetBounds=function(){return i(this.targetModifier)?b(this.bodyElement,this.target):"visible"===this.targetModifier?function(t,e){if(e===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var o=b(t,e),i={height:o.height,width:o.width,top:o.top,left:o.left};return i.height=Math.min(i.height,o.height-(pageYOffset-o.top)),i.height=Math.min(i.height,o.height-(o.top+o.height-(pageYOffset+innerHeight))),i.height=Math.min(innerHeight,i.height),i.height-=2,i.width=Math.min(i.width,o.width-(pageXOffset-o.left)),i.width=Math.min(i.width,o.width-(o.left+o.width-(pageXOffset+innerWidth))),i.width=Math.min(innerWidth,i.width),i.width-=2,i.tope.clientWidth||[s.overflow,s.overflowX].indexOf("scroll")>=0||!n)&&(r=15);var a=o.height-parseFloat(s.borderTopWidth)-parseFloat(s.borderBottomWidth)-r,h={width:15,height:.975*a*(a/e.scrollHeight),left:o.left+o.width-parseFloat(s.borderLeftWidth)-15},l=0;a<408&&n&&(l=-11e-5*Math.pow(a,2)-.00727*a+22.58),n||(h.height=Math.max(h.height,24));var f=i/(e.scrollHeight-a);return h.top=f*(a-h.height-l)+o.top+parseFloat(s.borderTopWidth),n&&(h.height=Math.max(h.height,24)),h}(this.bodyElement,this.target):void 0},g.clearCache=function(){this._cache={}},g.cache=function(t,e){return i(this._cache)&&(this._cache={}),i(this._cache[t])&&(this._cache[t]=e.call(this)),this._cache[t]},g.enable=function(t){var e=this;void 0===t&&(t=!0);var o=this.options,i=o.classes,r=o.classPrefix;!1!==this.options.addTargetClasses&&n(this.target,s("enabled",i,r)),n(this.element,s("enabled",i,r)),this.enabled=!0,this.scrollParents.forEach((function(t){t!==e.target.ownerDocument&&t.addEventListener("scroll",e.position)})),t&&this.position()},g.disable=function(){var t=this,e=this.options,o=e.classes,n=e.classPrefix;r(this.target,s("enabled",o,n)),r(this.element,s("enabled",o,n)),this.enabled=!1,i(this.scrollParents)||this.scrollParents.forEach((function(e){e&&e.removeEventListener&&e.removeEventListener("scroll",t.position)}))},g.destroy=function(){var t,e=this;this.disable(),this._removeClasses(),k.forEach((function(t,o){t===e&&k.splice(o,1)})),0===k.length&&(t=this.bodyElement,v&&t.removeChild(v),v=null)},g.updateAttachClasses=function(t,e){var o=this;t=t||this.attachment,e=e||this.targetAttachment;var n=this.options,r=n.classes,h=n.classPrefix;!i(this._addAttachClasses)&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),i(this._addAttachClasses)&&(this._addAttachClasses=[]),this.add=this._addAttachClasses,t.top&&this.add.push(s("element-attached",r,h)+"-"+t.top),t.left&&this.add.push(s("element-attached",r,h)+"-"+t.left),e.top&&this.add.push(s("target-attached",r,h)+"-"+e.top),e.left&&this.add.push(s("target-attached",r,h)+"-"+e.left),this.all=[],["left","top","bottom","right","middle","center"].forEach((function(t){o.all.push(s("element-attached",r,h)+"-"+t),o.all.push(s("target-attached",r,h)+"-"+t)})),l((function(){i(o._addAttachClasses)||(a(o.element,o._addAttachClasses,o.all),!1!==o.options.addTargetClasses&&a(o.target,o._addAttachClasses,o.all),delete o._addAttachClasses)}))},g.position=function(t){var e=this;if(void 0===t&&(t=!0),this.enabled){this.clearCache();var o=function(t,e){var o=t.left,i=t.top;return"auto"===o&&(o=T[e.left]),"auto"===i&&(i=P[e.top]),{left:o,top:i}}(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,o);var n=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),s=n.width,r=n.height;if(0!==s||0!==r||i(this.lastSize))this.lastSize={width:s,height:r};else{var a=this.lastSize;s=a.width,r=a.height}var h=this.cache("target-bounds",(function(){return e.getTargetBounds()})),l=h,p=M(_(this.attachment),{width:s,height:r}),d=M(_(o),l),u=M(this.offset,{width:s,height:r}),m=M(this.targetOffset,l);p=W(p,u),d=W(d,m);for(var g=h.left+d.left-p.left,v=h.top+d.top-p.top,w=0;wx.documentElement.clientHeight&&(E=this.cache("scrollbar-size",c),O.viewport.bottom-=E.height),C.innerWidth>x.documentElement.clientWidth&&(E=this.cache("scrollbar-size",c),O.viewport.right-=E.width),-1!==["","static"].indexOf(x.body.style.position)&&-1!==["","static"].indexOf(x.body.parentElement.style.position)||(O.page.bottom=x.body.scrollHeight-v-r,O.page.right=x.body.scrollWidth-g-s),!i(this.options.optimizations)&&!1!==this.options.optimizations.moveElement&&i(this.targetModifier)){var A=this.cache("target-offsetparent",(function(){return F(e.target)})),z=this.cache("target-offsetparent-bounds",(function(){return b(e.bodyElement,A)})),Y=getComputedStyle(A),S=z,X={};if(["Top","Left","Bottom","Right"].forEach((function(t){X[t.toLowerCase()]=parseFloat(Y["border"+t+"Width"])})),z.right=x.body.scrollWidth-z.left-S.width+X.right,z.bottom=x.body.scrollHeight-z.top-S.height+X.bottom,O.page.top>=z.top+X.top&&O.page.bottom>=z.bottom&&O.page.left>=z.left+X.left&&O.page.right>=z.right){var H=A.scrollLeft,D=A.scrollTop;O.offset={top:O.page.top-z.top+D-X.top,left:O.page.left-z.left+H-X.left}}}return this.move(O),this.history.unshift(O),this.history.length>3&&this.history.pop(),t&&f(),!0}},g.move=function(t){var e=this;if(!i(this.element.parentNode)){var o,n,s,r={};for(var a in t)for(var h in r[a]={},t[a]){for(var f=!1,p=0;p=n&&n>=o-s))){f=!0;break}}f||(r[a][h]=!0)}var u={top:"",left:"",right:"",bottom:""},m=function(t,o){var n,s;!1!==(!i(e.options.optimizations)?e.options.optimizations.gpu:null)?(t.top?(u.top=0,n=o.top):(u.bottom=0,n=-o.bottom),t.left?(u.left=0,s=o.left):(u.right=0,s=-o.right),"number"==typeof window.devicePixelRatio&&devicePixelRatio%1==0&&(s=Math.round(s*devicePixelRatio)/devicePixelRatio,n=Math.round(n*devicePixelRatio)/devicePixelRatio),u[D]="translateX("+s+"px) translateY("+n+"px)","msTransform"!==D&&(u[D]+=" translateZ(0)")):(t.top?u.top=o.top+"px":u.bottom=o.bottom+"px",t.left?u.left=o.left+"px":u.right=o.right+"px")},g=!0;!i(this.options.optimizations)&&!1===this.options.optimizations.allowPositionFixed&&(g=!1);var v,b,w=!1;if((r.page.top||r.page.bottom)&&(r.page.left||r.page.right))u.position="absolute",m(r.page,t.page);else if(g&&(r.viewport.top||r.viewport.bottom)&&(r.viewport.left||r.viewport.right))u.position="fixed",m(r.viewport,t.viewport);else if(!i(r.offset)&&r.offset.top&&r.offset.left){u.position="absolute";var y=this.cache("target-offsetparent",(function(){return F(e.target)}));F(this.element)!==y&&l((function(){e.element.parentNode.removeChild(e.element),y.appendChild(e.element)})),m(r.offset,t.offset),w=!0}else u.position="absolute",m({top:!0,left:!0},t.page);if(!w)if(this.options.bodyElement)this.element.parentNode!==this.options.bodyElement&&this.options.bodyElement.appendChild(this.element);else{for(var E=!0,O=this.element.parentNode;O&&1===O.nodeType&&"BODY"!==O.tagName&&(b=void 0,((b=(v=O).ownerDocument).fullscreenElement||b.webkitFullscreenElement||b.mozFullScreenElement||b.msFullscreenElement)!==v);){if("static"!==getComputedStyle(O).position){E=!1;break}O=O.parentNode}E||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var x={},C=!1;for(var T in u){var P=u[T];this.element.style[T]!==P&&(C=!0,x[T]=P)}C&&l((function(){d(e.element.style,x),e.trigger("repositioned")}))}},g._addClasses=function(){var t=this.options,e=t.classes,o=t.classPrefix;n(this.element,s("element",e,o)),!1!==this.options.addTargetClasses&&n(this.target,s("target",e,o))},g._removeClasses=function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;r(this.element,s("element",o,i)),!1!==this.options.addTargetClasses&&r(this.target,s("target",o,i)),this.all.forEach((function(e){t.element.classList.remove(e),t.target.classList.remove(e)}))},m}(C);R.modules=[],L.position=B;var j=d(R,L);return j.modules.push({initialize:function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;this.markers={},["target","element"].forEach((function(e){var n=document.createElement("div");n.className=s(e+"-marker",o,i);var r=document.createElement("div");r.className=s("marker-dot",o,i),n.appendChild(r),t[e].appendChild(n),t.markers[e]={dot:r,el:n}}))},position:function(t){var e={element:t.manualOffset,target:t.manualTargetOffset};for(var i in e){var n=e[i];for(var s in n){var r,a=n[s];(!o(a)||-1===a.indexOf("%")&&-1===a.indexOf("px"))&&(a+="px"),this.markers[i]&&(null==(r=this.markers[i].dot)?void 0:r.style[s])!==a&&(this.markers[i].dot.style[s]=a)}}return!0}}),j})); +-//# sourceMappingURL=tether.min.js.map ++var t,e;t=this,e=function(){function t(e,o){return t=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t(e,o)}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){return"string"==typeof t}function i(t){return void 0===t}function n(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.add(e)}))}function s(t,e,o){return void 0===t&&(t=""),i(e)||i(e[t])?o?o+"-"+t:t:!1===e[t]?"":e[t]}function r(t,e){e.split(" ").forEach((function(e){e.trim()&&t.classList.remove(e)}))}function a(t,e,o){o.forEach((function(o){-1===e.indexOf(o)&&t.classList.contains(o)&&r(t,o)})),e.forEach((function(e){t.classList.contains(e)||n(t,e)}))}var h=[];function l(t){h.push(t)}function f(){for(var t;t=h.pop();)t()}var p=null;function d(t){void 0===t&&(t={});var e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach((function(e){if(e)for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])})),t}function c(){if(p)return p;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");d(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var o=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=e.clientWidth),document.body.removeChild(e);var n=o-i;return p={width:n,height:n}}var u,m=(u=0,function(){return++u}),g={},v=new Map;function b(t,e){var o;e===document?(o=document,e=document.documentElement):o=e.ownerDocument;var n=o.documentElement,s=w(e),r=function(t){var e=v.get(t);e&&t.contains(e)||((e=document.createElement("div")).setAttribute("data-tether-id",m()),d(e.style,{top:0,left:0,position:"absolute"}),t.appendChild(e),v.set(t,e));var o=e.getAttribute("data-tether-id");return i(g[o])&&(g[o]=w(e),l((function(){delete g[o]}))),g[o]}(t);return s.top-=r.top,s.left-=r.left,i(s.width)&&(s.width=document.body.scrollWidth-s.left-s.right),i(s.height)&&(s.height=document.body.scrollHeight-s.top-s.bottom),s.top=s.top-n.clientTop,s.left=s.left-n.clientLeft,s.right=o.body.clientWidth-s.width-s.left,s.bottom=o.body.clientHeight-s.height-s.top,s}function w(t){var e=t.getBoundingClientRect(),o={};for(var i in e)o[i]=e[i];try{if(t.ownerDocument!==document){var n=t.ownerDocument.defaultView.frameElement;if(n){var s=w(n);o.top+=s.top,o.bottom+=s.top,o.left+=s.left,o.right+=s.left}}}catch(t){}return o}var y={position:function(t){var e=this,o=t.top,i=t.left,n=this.cache("element-bounds",(function(){return b(e.element)})),r=n.height,h=n.width,f=this.getTargetBounds(),p=o+r,d=i+h,c=[];o<=f.bottom&&p>=f.top&&["left","right"].forEach((function(t){var e=f[t];e!==i&&e!==d||c.push(t)})),i<=f.right&&d>=f.left&&["top","bottom"].forEach((function(t){var e=f[t];e!==o&&e!==p||c.push(t)}));var u=this.options,m=u.classes,g=u.classPrefix;return this.all.push(s("abutted",m,g)),["left","top","right","bottom"].forEach((function(t){e.all.push(s("abutted",m,g)+"-"+t)})),c.length&&this.add.push(s("abutted",m,g)),c.forEach((function(t){e.add.push(s("abutted",m,g)+"-"+t)})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,e.add,e.all),a(e.element,e.add,e.all)})),!0}},E=["left","top","right","bottom"],O={position:function(t){var e=this,n=t.top,r=t.left,h=t.targetAttachment;if(!this.options.constraints)return!0;var f=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),p=f.height,c=f.width;if(0===c&&0===p&&!i(this.lastSize)){var u=this.lastSize;c=u.width,p=u.height}var m=this.cache("target-bounds",(function(){return e.getTargetBounds()})),g=m.height,v=m.width,w=this.options,y=w.classes,O=w.classPrefix,x=function(t,e,o){var i=[s("pinned",t,e),s("out-of-bounds",t,e)];return o.forEach((function(t){var e=t.outOfBoundsClass,o=t.pinnedClass;e&&i.push(e),o&&i.push(o)})),i.forEach((function(t){["left","top","right","bottom"].forEach((function(e){i.push(t+"-"+e)}))})),i}(y,O,this.options.constraints),C=[],T=d({},h),P=d({},this.attachment);return this.options.constraints.forEach((function(t){var a,l,f=t.to,d=t.attachment,u=t.pin;if(i(d)&&(d=""),d.indexOf(" ")>=0){var m=d.split(" ");l=m[0],a=m[1]}else a=l=d;var w=function(t,e,o){if(!o)return null;if("scrollParent"===o?o=e.scrollParents[0]:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),!i(o.nodeType)){var n=o,s=b(t,o),r=s,a=getComputedStyle(o);if(o=[r.left,r.top,s.width+r.left,s.height+r.top],n.ownerDocument!==document){var h=n.ownerDocument.defaultView;o[0]+=h.pageXOffset,o[1]+=h.pageYOffset,o[2]+=h.pageXOffset,o[3]+=h.pageYOffset}E.forEach((function(t,e){"Top"===(t=t[0].toUpperCase()+t.substr(1))||"Left"===t?o[e]+=parseFloat(a["border"+t+"Width"]):o[e]-=parseFloat(a["border"+t+"Width"])}))}return o}(e.bodyElement,e,f);"target"!==l&&"both"!==l||(nw[3]&&"bottom"===T.top&&(n-=g,T.top="top")),"together"===l&&(n=function(t,e,o,i,n,s){return"top"===t.top&&("bottom"===e.top&&so[3]&&s-(i-n)>=o[1]&&(s-=i-n,t.top="bottom",e.top="bottom")),"bottom"===t.top&&("top"===e.top&&s+i>o[3]?(s-=n,t.top="top",s-=i,e.top="bottom"):"bottom"===e.top&&so[3]&&"top"===e.top?(s-=i,e.top="bottom"):sw[2]&&"right"===T.left&&(r-=v,T.left="left")),"together"===a&&(r=function(t,e,o,i,n,s){return so[2]&&"right"===t.left?"left"===e.left?(s-=n,t.left="left",s-=i,e.left="right"):"right"===e.left&&(s-=n,t.left="left",s+=i,e.left="left"):"center"===t.left&&(s+i>o[2]&&"left"===e.left?(s-=i,e.left="right"):sw[3]&&"top"===P.top&&(n-=p,P.top="bottom")),"element"!==a&&"both"!==a||(rw[2]&&("left"===P.left?(r-=c,P.left="right"):"center"===P.left&&(r-=c/2,P.left="right"))),o(u)?u=u.split(",").map((function(t){return t.trim()})):!0===u&&(u=["top","left","right","bottom"]);var x,A=[],W=[];r=function(t,e,o,i,n,s){return t=0?(t=e[0],n.push("left")):s.push("left")),t+o>e[2]&&(i.indexOf("right")>=0?(t=e[2]-o,n.push("right")):s.push("right")),t}(r,w,c,u=u||[],A,W),n=function(t,e,o,i,n,s){return t=0?(t=e[1],n.push("top")):s.push("top")),t+o>e[3]&&(i.indexOf("bottom")>=0?(t=e[3]-o,n.push("bottom")):s.push("bottom")),t}(n,w,p,u,A,W),A.length&&(x=i(e.options.pinnedClass)?s("pinned",y,O):e.options.pinnedClass,C.push(x),A.forEach((function(t){C.push(x+"-"+t)}))),function(t,e,o,n,r){var a;t.length&&(a=i(r)?s("out-of-bounds",o,n):r,e.push(a),t.forEach((function(t){e.push(a+"-"+t)})))}(W,C,y,O,e.options.outOfBoundsClass),(A.indexOf("left")>=0||A.indexOf("right")>=0)&&(P.left=T.left=!1),(A.indexOf("top")>=0||A.indexOf("bottom")>=0)&&(P.top=T.top=!1),T.top===h.top&&T.left===h.left&&P.top===e.attachment.top&&P.left===e.attachment.left||(e.updateAttachClasses(P,T),e.trigger("update",{attachment:P,targetAttachment:T}))})),l((function(){!1!==e.options.addTargetClasses&&a(e.target,C,x),a(e.element,C,x)})),{top:n,left:r}}},x={position:function(t){var e=t.top,i=t.left;if(this.options.shift){var n,s,r=this.options.shift;if("function"==typeof r&&(r=r.call(this,{top:e,left:i})),o(r)){(r=r.split(" "))[1]=r[1]||r[0];var a=r;n=a[0],s=a[1],n=parseFloat(n,10),s=parseFloat(s,10)}else{var h=[r.top,r.left];n=h[0],s=h[1]}return{top:e+=n,left:i+=s}}}},C=function(){function t(){}var e=t.prototype;return e.on=function(t,e,o,n){return void 0===n&&(n=!1),i(this.bindings)&&(this.bindings={}),i(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:n}),this},e.once=function(t,e,o){return this.on(t,e,o,!0)},e.off=function(t,e){var o=this;return i(this.bindings)||i(this.bindings[t])||(i(e)?delete this.bindings[t]:this.bindings[t].forEach((function(i,n){i.handler===e&&o.bindings[t].splice(n,1)}))),this},e.trigger=function(t){for(var e=this,o=arguments.length,n=new Array(o>1?o-1:0),s=1;s16)return Y=Math.min(Y-16,250),void(S=setTimeout(t,250));!i(L)&&N()-L<10||(null!=S&&(clearTimeout(S),S=null),L=N(),B(),Y=N()-L)},i(window)||i(window.addEventListener)||["resize","scroll","touchmove"].forEach((function(t){window.addEventListener(t,X)}));var R=function(h){var p,u;function m(t){var o;return(o=h.call(this)||this).position=o.position.bind(e(o)),k.push(e(o)),o.history=[],o.setOptions(t,!1),H.modules.forEach((function(t){i(t.initialize)||t.initialize.call(e(o))})),o.position(),o}u=h,(p=m).prototype=Object.create(u.prototype),p.prototype.constructor=p,t(p,u);var g=m.prototype;return g.setOptions=function(t,e){var n=this;void 0===e&&(e=!0);var s={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether",bodyElement:document.body};this.options=d(s,t);var r=this.options,a=r.element,h=r.target,l=r.targetModifier,f=r.bodyElement;if(this.element=a,this.target=h,this.targetModifier=l,"string"==typeof f&&(f=document.querySelector(f)),this.bodyElement=f,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach((function(t){if(i(n[t]))throw new Error("Tether Error: Both element and target must be defined");i(n[t].jquery)?o(n[t])&&(n[t]=document.querySelector(n[t])):n[t]=n[t][0]})),this._addClasses(),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=z(this.options.targetAttachment),this.attachment=z(this.options.attachment),this.offset=z(this.options.offset),this.targetOffset=z(this.options.targetOffset),i(this.scrollParents)||this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=function(t){var e=(getComputedStyle(t)||{}).position,o=[];if("fixed"===e)return[t];for(var n=t;(n=n.parentNode)&&n&&1===n.nodeType;){var s=void 0;try{s=getComputedStyle(n)}catch(t){}if(i(s)||null===s)return o.push(n),o;var r=s,a=r.overflow,h=r.overflowX,l=r.overflowY;/(auto|scroll|overlay)/.test(a+l+h)&&("absolute"!==e||["relative","absolute","fixed"].indexOf(s.position)>=0)&&o.push(n)}return o.push(t.ownerDocument.body),t.ownerDocument!==document&&o.push(t.ownerDocument.defaultView),o}(this.target),!1!==this.options.enabled&&this.enable(e)},g.getTargetBounds=function(){return i(this.targetModifier)?b(this.bodyElement,this.target):"visible"===this.targetModifier?function(t,e){if(e===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var o=b(t,e),i={height:o.height,width:o.width,top:o.top,left:o.left};return i.height=Math.min(i.height,o.height-(pageYOffset-o.top)),i.height=Math.min(i.height,o.height-(o.top+o.height-(pageYOffset+innerHeight))),i.height=Math.min(innerHeight,i.height),i.height-=2,i.width=Math.min(i.width,o.width-(pageXOffset-o.left)),i.width=Math.min(i.width,o.width-(o.left+o.width-(pageXOffset+innerWidth))),i.width=Math.min(innerWidth,i.width),i.width-=2,i.tope.clientWidth||[s.overflow,s.overflowX].indexOf("scroll")>=0||!n)&&(r=15);var a=o.height-parseFloat(s.borderTopWidth)-parseFloat(s.borderBottomWidth)-r,h={width:15,height:.975*a*(a/e.scrollHeight),left:o.left+o.width-parseFloat(s.borderLeftWidth)-15},l=0;a<408&&n&&(l=-11e-5*Math.pow(a,2)-.00727*a+22.58),n||(h.height=Math.max(h.height,24));var f=i/(e.scrollHeight-a);return h.top=f*(a-h.height-l)+o.top+parseFloat(s.borderTopWidth),n&&(h.height=Math.max(h.height,24)),h}(this.bodyElement,this.target):void 0},g.clearCache=function(){this._cache={}},g.cache=function(t,e){return i(this._cache)&&(this._cache={}),i(this._cache[t])&&(this._cache[t]=e.call(this)),this._cache[t]},g.enable=function(t){var e=this;void 0===t&&(t=!0);var o=this.options,i=o.classes,r=o.classPrefix;!1!==this.options.addTargetClasses&&n(this.target,s("enabled",i,r)),n(this.element,s("enabled",i,r)),this.enabled=!0,this.scrollParents.forEach((function(t){t!==e.target.ownerDocument&&t.addEventListener("scroll",e.position)})),t&&this.position()},g.disable=function(){var t=this,e=this.options,o=e.classes,n=e.classPrefix;r(this.target,s("enabled",o,n)),r(this.element,s("enabled",o,n)),this.enabled=!1,i(this.scrollParents)||this.scrollParents.forEach((function(e){e&&e.removeEventListener&&e.removeEventListener("scroll",t.position)}))},g.destroy=function(){var t,e=this;this.disable(),this._removeClasses(),k.forEach((function(t,o){t===e&&k.splice(o,1)})),0===k.length&&(t=this.bodyElement,v.has(t)&&t.removeChild(v.get(t)),v.delete(t))},g.updateAttachClasses=function(t,e){var o=this;t=t||this.attachment,e=e||this.targetAttachment;var n=this.options,r=n.classes,h=n.classPrefix;!i(this._addAttachClasses)&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),i(this._addAttachClasses)&&(this._addAttachClasses=[]),this.add=this._addAttachClasses,t.top&&this.add.push(s("element-attached",r,h)+"-"+t.top),t.left&&this.add.push(s("element-attached",r,h)+"-"+t.left),e.top&&this.add.push(s("target-attached",r,h)+"-"+e.top),e.left&&this.add.push(s("target-attached",r,h)+"-"+e.left),this.all=[],["left","top","bottom","right","middle","center"].forEach((function(t){o.all.push(s("element-attached",r,h)+"-"+t),o.all.push(s("target-attached",r,h)+"-"+t)})),l((function(){i(o._addAttachClasses)||(a(o.element,o._addAttachClasses,o.all),!1!==o.options.addTargetClasses&&a(o.target,o._addAttachClasses,o.all),delete o._addAttachClasses)}))},g.position=function(t){var e=this;if(void 0===t&&(t=!0),this.enabled){this.clearCache();var o=function(t,e){var o=t.left,i=t.top;return"auto"===o&&(o=T[e.left]),"auto"===i&&(i=P[e.top]),{left:o,top:i}}(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,o);var n=this.cache("element-bounds",(function(){return b(e.bodyElement,e.element)})),s=n.width,r=n.height;if(0!==s||0!==r||i(this.lastSize))this.lastSize={width:s,height:r};else{var a=this.lastSize;s=a.width,r=a.height}var h=this.cache("target-bounds",(function(){return e.getTargetBounds()})),l=h,p=M(_(this.attachment),{width:s,height:r}),d=M(_(o),l),u=M(this.offset,{width:s,height:r}),m=M(this.targetOffset,l);p=W(p,u),d=W(d,m);for(var g=h.left+d.left-p.left,v=h.top+d.top-p.top,w=0;wx.documentElement.clientHeight&&(E=this.cache("scrollbar-size",c),O.viewport.bottom-=E.height),C.innerWidth>x.documentElement.clientWidth&&(E=this.cache("scrollbar-size",c),O.viewport.right-=E.width),-1!==["","static"].indexOf(x.body.style.position)&&-1!==["","static"].indexOf(x.body.parentElement.style.position)||(O.page.bottom=x.body.scrollHeight-v-r,O.page.right=x.body.scrollWidth-g-s),!i(this.options.optimizations)&&!1!==this.options.optimizations.moveElement&&i(this.targetModifier)){var A=this.cache("target-offsetparent",(function(){return F(e.target)})),z=this.cache("target-offsetparent-bounds",(function(){return b(e.bodyElement,A)})),L=getComputedStyle(A),Y=z,S={};if(["Top","Left","Bottom","Right"].forEach((function(t){S[t.toLowerCase()]=parseFloat(L["border"+t+"Width"])})),z.right=x.body.scrollWidth-z.left-Y.width+S.right,z.bottom=x.body.scrollHeight-z.top-Y.height+S.bottom,O.page.top>=z.top+S.top&&O.page.bottom>=z.bottom&&O.page.left>=z.left+S.left&&O.page.right>=z.right){var X=A.scrollLeft,D=A.scrollTop;O.offset={top:O.page.top-z.top+D-S.top,left:O.page.left-z.left+X-S.left}}}return this.move(O),this.history.unshift(O),this.history.length>3&&this.history.pop(),t&&f(),!0}},g.move=function(t){var e=this;if(!i(this.element.parentNode)){var o,n,s,r={};for(var a in t)for(var h in r[a]={},t[a]){for(var f=!1,p=0;p=n&&n>=o-s))){f=!0;break}}f||(r[a][h]=!0)}var u={top:"",left:"",right:"",bottom:""},m=function(t,o){var n,s;!1!==(i(e.options.optimizations)?null:e.options.optimizations.gpu)?(t.top?(u.top=0,n=o.top):(u.bottom=0,n=-o.bottom),t.left?(u.left=0,s=o.left):(u.right=0,s=-o.right),"number"==typeof window.devicePixelRatio&&devicePixelRatio%1==0&&(s=Math.round(s*devicePixelRatio)/devicePixelRatio,n=Math.round(n*devicePixelRatio)/devicePixelRatio),u[D]="translateX("+s+"px) translateY("+n+"px)","msTransform"!==D&&(u[D]+=" translateZ(0)")):(t.top?u.top=o.top+"px":u.bottom=o.bottom+"px",t.left?u.left=o.left+"px":u.right=o.right+"px")},g=!0;!i(this.options.optimizations)&&!1===this.options.optimizations.allowPositionFixed&&(g=!1);var v,b,w=!1;if((r.page.top||r.page.bottom)&&(r.page.left||r.page.right))u.position="absolute",m(r.page,t.page);else if(g&&(r.viewport.top||r.viewport.bottom)&&(r.viewport.left||r.viewport.right))u.position="fixed",m(r.viewport,t.viewport);else if(!i(r.offset)&&r.offset.top&&r.offset.left){u.position="absolute";var y=this.cache("target-offsetparent",(function(){return F(e.target)}));F(this.element)!==y&&l((function(){e.element.parentNode.removeChild(e.element),y.appendChild(e.element)})),m(r.offset,t.offset),w=!0}else u.position="absolute",m({top:!0,left:!0},t.page);if(!w)if(this.options.bodyElement)this.element.parentNode!==this.options.bodyElement&&this.options.bodyElement.appendChild(this.element);else{for(var E=!0,O=this.element.parentNode;O&&1===O.nodeType&&"BODY"!==O.tagName&&(b=void 0,((b=(v=O).ownerDocument).fullscreenElement||b.webkitFullscreenElement||b.mozFullScreenElement||b.msFullscreenElement)!==v);){if("static"!==getComputedStyle(O).position){E=!1;break}O=O.parentNode}E||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var x={},C=!1;for(var T in u){var P=u[T];this.element.style[T]!==P&&(C=!0,x[T]=P)}C&&l((function(){d(e.element.style,x),e.trigger("repositioned")}))}},g._addClasses=function(){var t=this.options,e=t.classes,o=t.classPrefix;n(this.element,s("element",e,o)),!1!==this.options.addTargetClasses&&n(this.target,s("target",e,o))},g._removeClasses=function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;r(this.element,s("element",o,i)),!1!==this.options.addTargetClasses&&r(this.target,s("target",o,i)),this.all.forEach((function(e){t.element.classList.remove(e),t.target.classList.remove(e)}))},m}(C);R.modules=[],H.position=B;var j=d(R,H);return j.modules.push({initialize:function(){var t=this,e=this.options,o=e.classes,i=e.classPrefix;this.markers={},["target","element"].forEach((function(e){var n=document.createElement("div");n.className=s(e+"-marker",o,i);var r=document.createElement("div");r.className=s("marker-dot",o,i),n.appendChild(r),t[e].appendChild(n),t.markers[e]={dot:r,el:n}}))},position:function(t){var e={element:t.manualOffset,target:t.manualTargetOffset};for(var i in e){var n=e[i];for(var s in n){var r,a=n[s];(!o(a)||-1===a.indexOf("%")&&-1===a.indexOf("px"))&&(a+="px"),this.markers[i]&&(null==(r=this.markers[i].dot)?void 0:r.style[s])!==a&&(this.markers[i].dot.style[s]=a)}}return!0}}),j},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Tether=e(); diff --git a/yarn.lock b/yarn.lock index 9e512be348..51775eb5e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16094,8 +16094,8 @@ send@latest: "tether@patch:tether@npm:2.0.0#.yarn/patches/tether-npm-2.0.0-f14e824ccf.patch::locator=%40emdgroup-liquid%2Fliquid%40workspace%3A.": version: 2.0.0 - resolution: "tether@patch:tether@npm%3A2.0.0#.yarn/patches/tether-npm-2.0.0-f14e824ccf.patch::version=2.0.0&hash=3fc587&locator=%40emdgroup-liquid%2Fliquid%40workspace%3A." - checksum: 6181ecf7b4f20c2bd9eed8e864f04b45992bf0d15c676ba2f3df5d09e9d7a7eca1323521cbf14c3041035a5e0b2f67bb92f6e722af0f034cd66170a52decf676 + resolution: "tether@patch:tether@npm%3A2.0.0#.yarn/patches/tether-npm-2.0.0-f14e824ccf.patch::version=2.0.0&hash=4fa706&locator=%40emdgroup-liquid%2Fliquid%40workspace%3A." + checksum: 31745c9f16c463d975093e2939a18718ff892eb19f196144e4f42efaa7ec1652ed01cd8e6ec1a9830569cd17cd65bab09fb4e925396af7573e44184f38feee4c languageName: node linkType: hard