forked from shipshapecode/tether
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtether.min.js
2 lines (2 loc) · 19.7 KB
/
tether.min.js
1
2
/*! tether 0.5.2 */
(function(){var t,e,o,i,n,s,l,r,h,a,f,p,u,d,g,c,m={}.hasOwnProperty,b=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1},v=[].slice;null==window.Tether&&(window.Tether={}),a=function(t){var e,o,i,n,s;if(o=getComputedStyle(t).position,"fixed"===o)return t;for(i=void 0,e=t;e=e.parentNode;){try{n=getComputedStyle(e)}catch(l){}if(null==n)return e;if(/(auto|scroll)/.test(n.overflow+n["overflow-y"]+n["overflow-x"])&&("absolute"!==o||"relative"===(s=n.position)||"absolute"===s||"fixed"===s))return e}return document.body},d=function(){var t;return t=0,function(){return t++}}(),c={},h=function(t){var e,i,s,l,r;if(s=t._tetherZeroElement,null==s&&(s=t.createElement("div"),s.setAttribute("data-tether-id",d()),n(s.style,{top:0,left:0,position:"absolute"}),t.body.appendChild(s),t._tetherZeroElement=s),e=s.getAttribute("data-tether-id"),null==c[e]){c[e]={},r=s.getBoundingClientRect();for(i in r)l=r[i],c[e][i]=l;o(function(){return c[e]=void 0})}return c[e]},p=null,l=function(t){var e,o,i,n,s,l,r;t===document?(o=document,t=document.documentElement):o=t.ownerDocument,i=o.documentElement,e={},r=t.getBoundingClientRect();for(n in r)l=r[n],e[n]=l;return s=h(o),e.top-=s.top,e.left-=s.left,null==e.width&&(e.width=document.body.scrollWidth-e.left-e.right),null==e.height&&(e.height=document.body.scrollHeight-e.top-e.bottom),e.top=e.top-i.clientTop,e.left=e.left-i.clientLeft,e.right=o.body.clientWidth-e.width-e.left,e.bottom=o.body.clientHeight-e.height-e.top,e},r=function(t){return t.offsetParent||document.documentElement},n=function(t){var e,o,i,n,s,l,r;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),r=e.slice(1),s=0,l=r.length;l>s;s++)if(i=r[s])for(o in i)m.call(i,o)&&(n=i[o],t[o]=n);return t},u=function(t,e){var o,i,n,s,l;if(null!=t.classList){for(s=e.split(" "),l=[],i=0,n=s.length;n>i;i++)o=s[i],l.push(t.classList.remove(o));return l}return t.className=t.className.replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," ")},e=function(t,e){var o,i,n,s,l;if(null!=t.classList){for(s=e.split(" "),l=[],i=0,n=s.length;n>i;i++)o=s[i],l.push(t.classList.add(o));return l}return u(t,e),t.className+=" "+e},f=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},g=function(t,o,i){var n,s,l,r,h,a;for(s=0,r=i.length;r>s;s++)n=i[s],b.call(o,n)<0&&f(t,n)&&u(t,n);for(a=[],l=0,h=o.length;h>l;l++)n=o[l],f(t,n)?a.push(void 0):a.push(e(t,n));return a},i=[],o=function(t){return i.push(t)},s=function(){var t,e;for(e=[];t=i.pop();)e.push(t());return e},t=function(){function t(){}return t.prototype.on=function(t,e,o,i){var n;return null==i&&(i=!1),null==this.bindings&&(this.bindings={}),null==(n=this.bindings)[t]&&(n[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:i})},t.prototype.once=function(t,e,o){return this.on(t,e,o,!0)},t.prototype.off=function(t,e){var o,i,n;if(null!=(null!=(i=this.bindings)?i[t]:void 0)){if(null==e)return delete this.bindings[t];for(o=0,n=[];o<this.bindings[t].length;)this.bindings[t][o].handler===e?n.push(this.bindings[t].splice(o,1)):n.push(o++);return n}},t.prototype.trigger=function(){var t,e,o,i,n,s,l,r,h;if(o=arguments[0],t=2<=arguments.length?v.call(arguments,1):[],null!=(l=this.bindings)?l[o]:void 0){for(n=0,h=[];n<this.bindings[o].length;)r=this.bindings[o][n],i=r.handler,e=r.ctx,s=r.once,i.apply(null!=e?e:this,t),s?h.push(this.bindings[o].splice(n,1)):h.push(n++);return h}},t}(),Tether.Utils={getScrollParent:a,getBounds:l,getOffsetParent:r,extend:n,addClass:e,removeClass:u,hasClass:f,updateClasses:g,defer:o,flush:s,uniqueId:d,Evented:t}}).call(this),function(){var t,e,o,i,n,s,l,r,h,a,f,p,u,d,g,c,m,b,v,y,w,C,O,T,x,A,E,M=[].slice,P=function(t,e){return function(){return t.apply(e,arguments)}};if("undefined"==typeof Tether||null===Tether)throw new Error("You must include the utils.js file before tether.js");E=Tether.Utils,d=E.getScrollParent,g=E.getSize,u=E.getOuterSize,f=E.getBounds,p=E.getOffsetParent,h=E.extend,i=E.addClass,w=E.removeClass,T=E.updateClasses,r=E.defer,a=E.flush,x=function(t,e,o){return null==o&&(o=1),t+o>=e&&e>=t-o},O=function(){var t,e,o,i,n;for(t=document.createElement("div"),n=["transform","webkitTransform","OTransform","MozTransform","msTransform"],o=0,i=n.length;i>o;o++)if(e=n[o],void 0!==t.style[e])return e}(),C=[],y=function(){var t,e,o;for(e=0,o=C.length;o>e;e++)t=C[e],t.position(!1);return a()},c=function(){var t;return null!=(t="undefined"!=typeof performance&&null!==performance?"function"==typeof performance.now?performance.now():void 0:void 0)?t:+new Date},function(){var t,e,o,i,n,s,l,r,h;for(e=null,o=null,i=null,n=function(){if(null!=o&&o>16)return o=Math.min(o-16,250),i=setTimeout(n,250),void 0;if(!(null!=e&&c()-e<10))return null!=i&&(clearTimeout(i),i=null),e=c(),y(),o=c()-e},r=["resize","scroll","touchmove"],h=[],s=0,l=r.length;l>s;s++)t=r[s],h.push(window.addEventListener(t,n));return h}(),t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},o={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},l=function(o,i){var n,s;return n=o.left,s=o.top,"auto"===n&&(n=t[i.left]),"auto"===s&&(s=e[i.top]),{left:n,top:s}},s=function(t){var e,i;return{left:null!=(e=o[t.left])?e:t.left,top:null!=(i=o[t.top])?i:t.top}},n=function(){var t,e,o,i,n,s,l;for(e=1<=arguments.length?M.call(arguments,0):[],o={top:0,left:0},n=0,s=e.length;s>n;n++)l=e[n],i=l.top,t=l.left,"string"==typeof i&&(i=parseFloat(i,10)),"string"==typeof t&&(t=parseFloat(t,10)),o.top+=i,o.left+=t;return o},m=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},b=v=function(t){var e,o,i;return i=t.split(" "),o=i[0],e=i[1],{top:o,left:e}},A=function(){function t(t){this.position=P(this.position,this);var e,o,i,n,s;for(C.push(this),this.history=[],this.setOptions(t,!1),n=Tether.modules,o=0,i=n.length;i>o;o++)e=n[o],null!=(s=e.initialize)&&s.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,o;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(o=this.options.classes)?o[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var o,n,s,l,r,a;for(this.options=t,null==e&&(e=!0),o={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=h(o,this.options),r=this.options,this.element=r.element,this.target=r.target,this.targetModifier=r.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),a=["element","target"],s=0,l=a.length;l>s;s++){if(n=a[s],null==this[n])throw new Error("Tether Error: Both element and target must be defined");null!=this[n].jquery?this[n]=this[n][0]:"string"==typeof this[n]&&(this[n]=document.querySelector(this[n]))}if(i(this.element,this.getClass("element")),i(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=b(this.options.targetAttachment),this.attachment=b(this.options.attachment),this.offset=v(this.options.offset),this.targetOffset=v(this.options.targetOffset),null!=this.scrollParent&&this.disable(),this.scrollParent="scroll-handle"===this.targetModifier?this.target:d(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){var t,e,o,i,n,s,l,r,h;if(null==this.targetModifier)return f(this.target);switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=f(this.target),n={height:t.height,width:t.width,top:t.top,left:t.left},n.height=Math.min(n.height,t.height-(pageYOffset-t.top)),n.height=Math.min(n.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),n.height=Math.min(innerHeight,n.height),n.height-=2,n.width=Math.min(n.width,t.width-(pageXOffset-t.left)),n.width=Math.min(n.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),n.width=Math.min(innerWidth,n.width),n.width-=2,n.top<pageYOffset&&(n.top=pageYOffset),n.left<pageXOffset&&(n.left=pageXOffset),n);case"scroll-handle":return h=this.target,h===document.body?(h=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=f(h),r=getComputedStyle(h),o=h.scrollWidth>h.clientWidth||"scroll"===[r.overflow,r.overflowX]||this.target!==document.body,s=0,o&&(s=15),i=t.height-parseFloat(r.borderTopWidth)-parseFloat(r.borderBottomWidth)-s,n={width:15,height:.975*i*(i/h.scrollHeight),left:t.left+t.width-parseFloat(r.borderLeftWidth)-15},e=0,408>i&&this.target===document.body&&(e=-11e-5*Math.pow(i,2)-.00727*i+22.58),this.target!==document.body&&(n.height=Math.max(n.height,24)),l=this.target.scrollTop/(h.scrollHeight-i),n.top=l*(i-n.height-e)+t.top+parseFloat(r.borderTopWidth),this.target===document.body&&(n.height=Math.max(n.height,24)),n}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),i(this.target,this.getClass("enabled")),i(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return w(this.target,this.getClass("enabled")),w(this.element,this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,o,i,n;for(this.disable(),n=[],t=o=0,i=C.length;i>o;t=++o){if(e=C[t],e===this){C.splice(t,1);break}n.push(void 0)}return n},t.prototype.updateAttachClasses=function(t,e){var o,i,n,s,l,h,a,f,p,u=this;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),s=["left","top","bottom","right","middle","center"],(null!=(p=this._addAttachClasses)?p.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),o=null!=this._addAttachClasses?this._addAttachClasses:this._addAttachClasses=[],t.top&&o.push(""+this.getClass("element-attached")+"-"+t.top),t.left&&o.push(""+this.getClass("element-attached")+"-"+t.left),e.top&&o.push(""+this.getClass("target-attached")+"-"+e.top),e.left&&o.push(""+this.getClass("target-attached")+"-"+e.left),i=[],l=0,a=s.length;a>l;l++)n=s[l],i.push(""+this.getClass("element-attached")+"-"+n);for(h=0,f=s.length;f>h;h++)n=s[h],i.push(""+this.getClass("target-attached")+"-"+n);return r(function(){return null!=u._addAttachClasses?(T(u.element,u._addAttachClasses,i),T(u.target,u._addAttachClasses,i),u._addAttachClasses=void 0):void 0})},t.prototype.position=function(t){var e,o,i,r,h,u,d,g,c,b,v,y,w,C,O,T,x,A,E,M,P,W,S,_,B,F,L,z,Y,H,X,N,j=this;if(null==t&&(t=!0),this.enabled){for(this.clearCache(),E=l(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,E),e=this.cache("element-bounds",function(){return f(j.element)}),_=e.width,i=e.height,0===_&&0===i&&null!=this.lastSize?(Y=this.lastSize,_=Y.width,i=Y.height):this.lastSize={width:_,height:i},W=P=this.cache("target-bounds",function(){return j.getTargetBounds()}),c=m(s(this.attachment),{width:_,height:i}),M=m(s(E),W),h=m(this.offset,{width:_,height:i}),u=m(this.targetOffset,W),c=n(c,h),M=n(M,u),r=P.left+M.left-c.left,S=P.top+M.top-c.top,H=Tether.modules,B=0,L=H.length;L>B;B++)if(d=H[B],O=d.position.call(this,{left:r,top:S,targetAttachment:E,targetPos:P,elementPos:e,offset:c,targetOffset:M,manualOffset:h,manualTargetOffset:u}),null!=O&&"object"==typeof O){if(O===!1)return!1;S=O.top,r=O.left}if(g={page:{top:S,bottom:document.body.scrollHeight-S-i,left:r,right:document.body.scrollWidth-r-_},viewport:{top:S-pageYOffset,bottom:pageYOffset-S-i+innerHeight,left:r-pageXOffset,right:pageXOffset-r-_+innerWidth}},(null!=(X=this.options.optimizations)?X.moveElement:void 0)!==!1&&null==this.targetModifier){for(v=this.cache("target-offsetparent",function(){return p(j.target)}),C=this.cache("target-offsetparent-bounds",function(){return f(v)}),w=getComputedStyle(v),o=getComputedStyle(this.element),y=C,b={},N=["Top","Left","Bottom","Right"],F=0,z=N.length;z>F;F++)A=N[F],b[A.toLowerCase()]=parseFloat(w["border"+A+"Width"]);C.right=document.body.scrollWidth-C.left-y.width+b.right,C.bottom=document.body.scrollHeight-C.top-y.height+b.bottom,g.page.top>=C.top+b.top&&g.page.bottom>=C.bottom&&g.page.left>=C.left+b.left&&g.page.right>=C.right&&(x=v.scrollTop,T=v.scrollLeft,g.offset={top:g.page.top-C.top+x-b.top,left:g.page.left-C.left+T-b.left})}return this.move(g),this.history.unshift(g),this.history.length>3&&this.history.pop(),t&&a(),!0}},t.prototype.move=function(t){var e,o,i,n,s,l,a,f,u,d,g,c,m,b,v,y,w,C=this;if(null!=this.element.parentNode){f={};for(d in t){f[d]={};for(n in t[d]){for(i=!1,y=this.history,b=0,v=y.length;v>b;b++)if(a=y[b],!x(null!=(w=a[d])?w[n]:void 0,t[d][n])){i=!0;break}i||(f[d][n]=!0)}}e={top:"",left:"",right:"",bottom:""},u=function(t,o){var i,n,s;return(null!=(s=C.options.optimizations)?s.gpu:void 0)===!1?(t.top?e.top=""+o.top+"px":e.bottom=""+o.bottom+"px",t.left?e.left=""+o.left+"px":e.right=""+o.right+"px"):(t.top?(e.top=0,n=o.top):(e.bottom=0,n=-o.bottom),t.left?(e.left=0,i=o.left):(e.right=0,i=-o.right),e[O]="translateX("+Math.round(i)+"px) translateY("+Math.round(n)+"px)","msTransform"!==O?e[O]+=" translateZ(0)":void 0)},s=!1,(f.page.top||f.page.bottom)&&(f.page.left||f.page.right)?(e.position="absolute",u(f.page,t.page)):(f.viewport.top||f.viewport.bottom)&&(f.viewport.left||f.viewport.right)?(e.position="fixed",u(f.viewport,t.viewport)):null!=f.offset&&f.offset.top&&f.offset.left?(e.position="absolute",l=this.cache("target-offsetparent",function(){return p(C.target)}),p(this.element)!==l&&r(function(){return C.element.parentNode.removeChild(C.element),l.appendChild(C.element)}),u(f.offset,t.offset),s=!0):(e.position="absolute",u({top:!0,left:!0},t.page)),s||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),m={},c=!1;for(n in e)g=e[n],o=this.element.style[n],""===o||""===g||"top"!==n&&"left"!==n&&"bottom"!==n&&"right"!==n||(o=parseFloat(o),g=parseFloat(g)),o!==g&&(c=!0,m[n]=e[n]);return c?r(function(){return h(C.element.style,m)}):void 0}},t}(),Tether.position=y,window.Tether=h(A,Tether)}.call(this),function(){var t,e,o,i,n,s,l,r,h,a,f=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};a=Tether.Utils,l=a.getOuterSize,s=a.getBounds,r=a.getSize,i=a.extend,h=a.updateClasses,o=a.defer,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],n=function(e,o){var i,n,l,r,h,a,f;if("scrollParent"===o?o=e.scrollParent:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),null!=o.nodeType)for(n=r=s(o),h=getComputedStyle(o),o=[n.left,n.top,r.width+n.left,r.height+n.top],i=a=0,f=t.length;f>a;i=++a)l=t[i],l=l[0].toUpperCase()+l.substr(1),"Top"===l||"Left"===l?o[i]+=parseFloat(h["border"+l+"Width"]):o[i]-=parseFloat(h["border"+l+"Width"]);return o},Tether.modules.push({position:function(e){var l,r,a,p,u,d,g,c,m,b,v,y,w,C,O,T,x,A,E,M,P,W,S,_,B,F,L,z,Y,H,X,N,j,R,U,k,q,D,Z,$,I,G,J,K,Q,V,te,ee=this;if(F=e.top,v=e.left,P=e.targetAttachment,!this.options.constraints)return!0;for(A=function(e){var o,i,n,s;for(ee.removeClass(e),s=[],i=0,n=t.length;n>i;i++)o=t[i],s.push(ee.removeClass(""+e+"-"+o));return s},$=this.cache("element-bounds",function(){return s(ee.element)}),b=$.height,L=$.width,0===L&&0===b&&null!=this.lastSize&&(I=this.lastSize,L=I.width,b=I.height),S=this.cache("target-bounds",function(){return ee.getTargetBounds()}),W=S.height,_=S.width,M={},m={},r=[this.getClass("pinned"),this.getClass("out-of-bounds")],G=this.options.constraints,z=0,N=G.length;N>z;z++)c=G[z],c.outOfBoundsClass&&r.push(c.outOfBoundsClass),c.pinnedClass&&r.push(c.pinnedClass);for(Y=0,j=r.length;j>Y;Y++)for(g=r[Y],J=["left","top","right","bottom"],H=0,R=J.length;R>H;H++)E=J[H],r.push(""+g+"-"+E);for(l=[],M=i({},P),m=i({},this.attachment),K=this.options.constraints,X=0,U=K.length;U>X;X++){if(c=K[X],B=c.to,a=c.attachment,O=c.pin,null==a&&(a=""),f.call(a," ")>=0?(Q=a.split(" "),d=Q[0],u=Q[1]):u=d=a,p=n(this,B),("target"===d||"both"===d)&&(F<p[1]&&"top"===M.top&&(F+=W,M.top="bottom"),F+b>p[3]&&"bottom"===M.top&&(F-=W,M.top="top")),"together"===d&&(F<p[1]&&"top"===M.top&&("bottom"===m.top?(F+=W,M.top="bottom",F+=b,m.top="top"):"top"===m.top&&(F+=W,M.top="bottom",F-=b,m.top="bottom")),F+b>p[3]&&"bottom"===M.top&&("top"===m.top?(F-=W,M.top="top",F-=b,m.top="bottom"):"bottom"===m.top&&(F-=W,M.top="top",F+=b,m.top="top"))),("target"===u||"both"===u)&&(v<p[0]&&"left"===M.left&&(v+=_,M.left="right"),v+L>p[2]&&"right"===M.left&&(v-=_,M.left="left")),"together"===u&&(v<p[0]&&"left"===M.left?"right"===m.left?(v+=_,M.left="right",v+=L,m.left="left"):"left"===m.left&&(v+=_,M.left="right",v-=L,m.left="right"):v+L>p[2]&&"right"===M.left&&("left"===m.left?(v-=_,M.left="left",v-=L,m.left="right"):"right"===m.left&&(v-=_,M.left="left",v+=L,m.left="left"))),("element"===d||"both"===d)&&(F<p[1]&&"bottom"===m.top&&(F+=b,m.top="top"),F+b>p[3]&&"top"===m.top&&(F-=b,m.top="bottom")),("element"===u||"both"===u)&&(v<p[0]&&"right"===m.left&&(v+=L,m.left="left"),v+L>p[2]&&"left"===m.left&&(v-=L,m.left="right")),"string"==typeof O?O=function(){var t,e,o,i;for(o=O.split(","),i=[],e=0,t=o.length;t>e;e++)C=o[e],i.push(C.trim());return i}():O===!0&&(O=["top","left","right","bottom"]),O||(O=[]),T=[],y=[],F<p[1]&&(f.call(O,"top")>=0?(F=p[1],T.push("top")):y.push("top")),F+b>p[3]&&(f.call(O,"bottom")>=0?(F=p[3]-b,T.push("bottom")):y.push("bottom")),v<p[0]&&(f.call(O,"left")>=0?(v=p[0],T.push("left")):y.push("left")),v+L>p[2]&&(f.call(O,"right")>=0?(v=p[2]-L,T.push("right")):y.push("right")),T.length)for(x=null!=(V=this.options.pinnedClass)?V:this.getClass("pinned"),l.push(x),D=0,k=T.length;k>D;D++)E=T[D],l.push(""+x+"-"+E);if(y.length)for(w=null!=(te=this.options.outOfBoundsClass)?te:this.getClass("out-of-bounds"),l.push(w),Z=0,q=y.length;q>Z;Z++)E=y[Z],l.push(""+w+"-"+E);(f.call(T,"left")>=0||f.call(T,"right")>=0)&&(m.left=M.left=!1),(f.call(T,"top")>=0||f.call(T,"bottom")>=0)&&(m.top=M.top=!1),(M.top!==P.top||M.left!==P.left||m.top!==this.attachment.top||m.left!==this.attachment.left)&&this.updateAttachClasses(m,M)}return o(function(){return h(ee.target,l,r),h(ee.element,l,r)}),{top:F,left:v}}})}.call(this),function(){var t,e,o,i;i=Tether.Utils,e=i.getBounds,o=i.updateClasses,t=i.defer,Tether.modules.push({position:function(i){var n,s,l,r,h,a,f,p,u,d,g,c,m,b,v,y,w,C,O,T,x,A,E,M,P,W=this;if(g=i.top,a=i.left,x=this.cache("element-bounds",function(){return e(W.element)}),h=x.height,c=x.width,d=this.getTargetBounds(),r=g+h,f=a+c,n=[],g<=d.bottom&&r>=d.top)for(A=["left","right"],m=0,w=A.length;w>m;m++)p=A[m],((E=d[p])===a||E===f)&&n.push(p);if(a<=d.right&&f>=d.left)for(M=["top","bottom"],b=0,C=M.length;C>b;b++)p=M[b],((P=d[p])===g||P===r)&&n.push(p);for(l=[],s=[],u=["left","top","right","bottom"],l.push(this.getClass("abutted")),v=0,O=u.length;O>v;v++)p=u[v],l.push(""+this.getClass("abutted")+"-"+p);for(n.length&&s.push(this.getClass("abutted")),y=0,T=n.length;T>y;y++)p=n[y],s.push(""+this.getClass("abutted")+"-"+p);return t(function(){return o(W.target,s,l),o(W.element,s,l)}),!0}})}.call(this),function(){Tether.modules.push({position:function(t){var e,o,i,n,s,l,r;return l=t.top,e=t.left,this.options.shift?(o=function(t){return"function"==typeof t?t.call(this,{top:l,left:e}):t},i=o(this.options.shift),"string"==typeof i?(i=i.split(" "),i[1]||(i[1]=i[0]),s=i[0],n=i[1],s=parseFloat(s,10),n=parseFloat(n,10)):(r=[i.top,i.left],s=r[0],n=r[1]),l+=s,e+=n,{top:l,left:e}):void 0}})}.call(this);