(function(){function n(n,t){function w(n,t){return c.getComputedStyle||(c.getComputedStyle=function(n){return this.el=n,this.getPropertyValue=function(t){var i=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),i.test(t)&&(t=t.replace(i,function(){return arguments[2].toUpperCase()})),n.currentStyle&&n.currentStyle[t]?n.currentStyle[t]:null},this}),c.getComputedStyle(n,null).getPropertyValue(t)}function b(t){var i=t||n.clientHeight,r=k(n);return Math.max(Math.floor(i/r),0)}function tt(t){var i=k(n);return i*t}function k(n){var t=w(n,"line-height");return t=="normal"&&(t=parseInt(w(n,"font-size"))*1.2),parseInt(t)}function h(t){return t.lastChild.children&&t.lastChild.children.length>0?h(Array.prototype.slice.call(t.children).pop()):t.lastChild&&t.lastChild.nodeValue&&t.lastChild.nodeValue!=""&&t.lastChild.nodeValue!=i.truncationChar?t.lastChild:(t.lastChild.parentNode.removeChild(t.lastChild),h(n))}function a(t,f){function o(){e=i.splitOnChars.slice(0);r=e[0];u=null;l=null}if(f){var c=t.nodeValue.replace(i.truncationChar,"");if(u||(r=e.length>0?e.shift():"",u=c.split(r)),u.length>1?(l=u.pop(),v(t,u.join(r))):u=null,s&&(t.nodeValue=t.nodeValue.replace(i.truncationChar,""),n.innerHTML=t.nodeValue+" "+s.innerHTML+i.truncationChar),u){if(n.clientHeight<=f)if(e.length>=0&&r!="")v(t,u.join(r)+r+l),u=null;else return n.innerHTML}else r==""&&(v(t,""),t=h(n),o());if(i.animate)setTimeout(function(){a(t,f)},i.animate===!0?10:i.animate);else return a(t,f)}}function v(n,t){n.nodeValue=t+i.truncationChar}var e,r,u,l,d,y;t=t||{};var it=this,c=window,i={clamp:t.clamp||2,useNativeClamp:typeof t.useNativeClamp!="undefined"?t.useNativeClamp:!0,splitOnChars:t.splitOnChars||[".","-","–","—"," "],animate:t.animate||!1,truncationChar:t.truncationChar||"…",truncationHTML:t.truncationHTML},o=n.style,g=n.innerHTML,nt=typeof n.style.webkitLineClamp!="undefined",f=i.clamp,p=f.indexOf&&(f.indexOf("px")>-1||f.indexOf("em")>-1),s;return i.truncationHTML&&(s=document.createElement("span"),s.innerHTML=i.truncationHTML),e=i.splitOnChars.slice(0),r=e[0],f=="auto"?f=b():p&&(f=b(parseInt(f))),nt&&i.useNativeClamp?(o.overflow="hidden",o.textOverflow="ellipsis",o.webkitBoxOrient="vertical",o.display="-webkit-box",o.webkitLineClamp=f,p&&(o.height=i.clamp+"px")):(y=tt(f),y<=n.clientHeight&&(d=a(h(n),y))),{original:g,clamped:d}}window.$clamp=n})()