(self.AMP=self.AMP||[]).push({n:"amp-fit-text",v:"2005012256000",f:(function(AMP,_){
var c="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},k;if("function"==typeof Object.setPrototypeOf)k=Object.setPrototypeOf;else{var l;a:{var n={a:!0},p={};try{p.__proto__=n;l=p.a;break a}catch(a){}l=!1}k=l?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var q=k;var r=self.AMP_CONFIG||{},t=("string"==typeof r.cdnProxyRegex?new RegExp(r.cdnProxyRegex):r.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function u(a){if(self.document&&self.document.head&&(!self.location||!t.test(self.location.origin))){var b=self.document.head.querySelector('meta[name="'+a+'"]');b&&b.getAttribute("content")}}r.cdnUrl||u("runtime-host");r.geoApiUrl||u("amp-geo-api");self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var v,w="Webkit webkit Moz moz ms O o".split(" ");function x(a,b,d){var f;var e=a.style;if(2>b.length||0!=b.lastIndexOf("--",0)){v||(v=Object.create(null));var g=v[b];if(!g){g=b;if(void 0===e[b]){var h=b.charAt(0).toUpperCase()+b.slice(1);b:{for(var m=0;m<w.length;m++){var z=w[m]+h;if(void 0!==e[z]){h=z;break b}}h=""}void 0!==e[h]&&(g=h)}v[b]=g}b=g}if(b){var A=f?d+f:d;(2>b.length?0:0==b.lastIndexOf("--",0))?a.style.setProperty(b,A):a.style[b]=A}}function y(a,b){for(var d in b)x(a,d,b[d])};function B(a){var b=parseFloat(a);a=b;return"number"===typeof a&&isFinite(a)?b:void 0};function C(a){a=AMP.BaseElement.call(this,a)||this;a.h=null;a.c=null;a.j=null;a.m=-1;a.l=-1;return a}var D=AMP.BaseElement;C.prototype=c(D.prototype);C.prototype.constructor=C;if(q)q(C,D);else for(var E in D)if("prototype"!=E)if(Object.defineProperties){var F=Object.getOwnPropertyDescriptor(D,E);F&&Object.defineProperty(C,E,F)}else C[E]=D[E];C.o=D.prototype;
C.prototype.isLayoutSupported=function(a){return"fixed"==a||"fixed-height"==a||"responsive"==a||"fill"==a||"flex-item"==a||"fluid"==a||"intrinsic"==a};
C.prototype.buildCallback=function(){var a=this;this.h=this.element.ownerDocument.createElement("div");this.applyFillContent(this.h);this.h.classList.add("i-amphtml-fit-text-content");y(this.h,{zIndex:2});this.c=this.element.ownerDocument.createElement("div");y(this.c,{lineHeight:"1.15em"});this.h.appendChild(this.c);this.j=this.element.ownerDocument.createElement("div");y(this.j,{position:"absolute",top:0,left:0,zIndex:1,visibility:"hidden",lineHeight:"1.15em"});this.getRealChildNodes().forEach(function(b){a.c.appendChild(b)});
this.j.innerHTML=this.c.innerHTML;this.element.appendChild(this.h);this.element.appendChild(this.j);this.m=B(this.element.getAttribute("min-font-size"))||6;this.l=B(this.element.getAttribute("max-font-size"))||72};C.prototype.prerenderAllowed=function(){return!0};C.prototype.isRelayoutNeeded=function(){return!0};
C.prototype.layoutCallback=function(){var a=this;return this.mutateElement(function(){var b=a.element.offsetHeight,d=a.j,f=a.element.offsetWidth;var e=a.m;var g=a.l;for(g++;1<g-e;){var h=Math.floor((e+g)/2);x(d,"fontSize",h+"px");var m=d.offsetWidth;d.offsetHeight>b||m>f?g=h:e=h}x(a.c,"fontSize",e+"px");d=a.c;f=a.j;x(f,"fontSize",e+"px");f=f.offsetHeight>b;e*=1.15;b=Math.floor(b/e);d.classList.toggle("i-amphtml-fit-text-content-overflown",f);y(d,{lineClamp:f?b:"",maxHeight:f?e*b+"px":""})})};
(function(a){a.registerElement("amp-fit-text",C,".i-amphtml-fit-text-content,.i-amphtml-fit-text-content.i-amphtml-fill-content{display:block;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:center;justify-content:center}.i-amphtml-fit-text-content-overflown{display:block;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}\n/*# sourceURL=/extensions/amp-fit-text/0.1/amp-fit-text.css*/")})(self.AMP);
})});

//# sourceMappingURL=amp-fit-text-0.1.js.map
