UNPKG

@talves/netlify-cms-widget-text

Version:

Widget for editing multiline plain string values in Netlify CMS.

2 lines 22 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("netlify-cms-ui-default")):"function"==typeof define&&define.amd?define("NetlifyCmsWidgetText",["prop-types","react","netlify-cms-ui-default"],t):"object"==typeof exports?exports.NetlifyCmsWidgetText=t(require("prop-types"),require("react"),require("netlify-cms-ui-default")):e.NetlifyCmsWidgetText=t(e.NetlifyCmsDefaultExports.PropTypes,e.React,e.NetlifyCmsUiDefault)}(window,function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";(function(e){r.d(t,"b",function(){return o}),r.d(t,"a",function(){return s});var n=r(5),i=void 0!==e?e:{},a=Object(n.a)(i),o=(a.flush,a.hydrate,a.cx,a.merge),s=(a.getRegisteredStyles,a.injectGlobal,a.keyframes,a.css);a.sheet,a.caches}).call(this,r(6))},function(e,t,r){e.exports=function(){"use strict";return function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,i,a,o,s,c,u,l,f){switch(r){case 1:if(0===l&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===u)return n+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(i[0]+n),"";default:return n+(0===f?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}}()},function(e,t){e.exports=r},function(e,t,r){"use strict";var n=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}},i={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var a=function(e){for(var t,r=e.length,n=r^r,i=0;r>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(t>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),r-=4,++i;switch(r){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)},o=function e(t){function r(e,t,r){var i=t.trim().split(g);t=i;var a=i.length,o=e.length;switch(o){case 0:case 1:var s=0;for(e=0===o?"":e[0]+" ";s<a;++s)t[s]=n(e,t[s],r).trim();break;default:var c=s=0;for(t=[];s<a;++s)for(var u=0;u<o;++u)t[c++]=n(e[u]+" ",i[s],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(b,"$1"+e.trim());case 58:return e.trim()+t.replace(b,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(b,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function i(e,t,r,n){var o=e+";",s=2*t+3*r+4*n;if(944===s){e=o.indexOf(":",9)+1;var c=o.substring(e,o.length-1).trim();return c=o.substring(0,e).trim()+c+";",1===E||2===E&&a(c,1)?"-webkit-"+c+c:c}if(0===E||2===E&&!a(o,1))return o;switch(s){case 1015:return 97===o.charCodeAt(10)?"-webkit-"+o+o:o;case 951:return 116===o.charCodeAt(3)?"-webkit-"+o+o:o;case 963:return 110===o.charCodeAt(5)?"-webkit-"+o+o:o;case 1009:if(100!==o.charCodeAt(4))break;case 969:case 942:return"-webkit-"+o+o;case 978:return"-webkit-"+o+"-moz-"+o+o;case 1019:case 983:return"-webkit-"+o+"-moz-"+o+"-ms-"+o+o;case 883:if(45===o.charCodeAt(8))return"-webkit-"+o+o;if(0<o.indexOf("image-set(",11))return o.replace(O,"$1-webkit-$2")+o;break;case 932:if(45===o.charCodeAt(4))switch(o.charCodeAt(5)){case 103:return"-webkit-box-"+o.replace("-grow","")+"-webkit-"+o+"-ms-"+o.replace("grow","positive")+o;case 115:return"-webkit-"+o+"-ms-"+o.replace("shrink","negative")+o;case 98:return"-webkit-"+o+"-ms-"+o.replace("basis","preferred-size")+o}return"-webkit-"+o+"-ms-"+o+o;case 964:return"-webkit-"+o+"-ms-flex-"+o+o;case 1023:if(99!==o.charCodeAt(8))break;return"-webkit-box-pack"+(c=o.substring(o.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+o+"-ms-flex-pack"+c+o;case 1005:return d.test(o)?o.replace(h,":-webkit-")+o.replace(h,":-moz-")+o:o;case 1e3:switch(t=(c=o.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=o.replace(y,"tb");break;case 232:c=o.replace(y,"tb-rl");break;case 220:c=o.replace(y,"lr");break;default:return o}return"-webkit-"+o+"-ms-"+c+o;case 1017:if(-1===o.indexOf("sticky",9))break;case 975:switch(t=(o=e).length-10,s=(c=(33===o.charCodeAt(t)?o.substring(0,t):o).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:o=o.replace(c,"-webkit-"+c)+";"+o;break;case 207:case 102:o=o.replace(c,"-webkit-"+(102<s?"inline-":"")+"box")+";"+o.replace(c,"-webkit-"+c)+";"+o.replace(c,"-ms-"+c+"box")+";"+o}return o+";";case 938:if(45===o.charCodeAt(5))switch(o.charCodeAt(6)){case 105:return"-webkit-"+o+"-webkit-box-"+(c=o.replace("-items",""))+"-ms-flex-"+c+o;case 115:return"-webkit-"+o+"-ms-flex-item-"+o.replace(x,"")+o;default:return"-webkit-"+o+"-ms-flex-line-pack"+o.replace("align-content","").replace(x,"")+o}break;case 973:case 989:if(45!==o.charCodeAt(3)||122===o.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?i(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):o.replace(c,"-webkit-"+c)+o.replace(c,"-moz-"+c.replace("fill-",""))+o;break;case 962:if(o="-webkit-"+o+(102===o.charCodeAt(5)?"-ms-"+o:"")+o,211===r+n&&105===o.charCodeAt(13)&&0<o.indexOf("transform",10))return o.substring(0,o.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+o}return o}function a(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),N(2!==t?n:n.replace(A,"$1"),r,t)}function o(e,t){var r=i(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(C," or ($1)").substring(4):"("+t+")"}function s(e,t,r,n,i,a,o,s,c,l){for(var f,h=0,d=t;h<F;++h)switch(f=M[h].call(u,e,d,r,n,i,a,o,s,c,l)){case void 0:case!1:case!0:case null:break;default:d=f}if(d!==t)return d}function c(e){return void 0!==(e=e.prefix)&&(N=null,e?"function"!=typeof e?E=1:(E=2,N=e):E=0),c}function u(t,n){if(void 0!==this&&this.constructor===u)return e(t);var c=t;if(33>c.charCodeAt(0)&&(c=c.trim()),c=[c],0<F){var h=s(-1,n,c,c,z,S,0,0,0,0);void 0!==h&&"string"==typeof h&&(n=h)}var d=function e(t,n,c,u,h){for(var d,p,g,b,y,C=0,x=0,A=0,_=0,O=0,M=0,N=g=d=0,T=0,P=0,$=0,I=0,W=c.length,q=W-1,D="",L="",G="",U="";T<W;){if(p=c.charCodeAt(T),T===q&&0!==x+_+A+C&&(0!==x&&(p=47===x?10:47),_=A=C=0,W++,q++),0===x+_+A+C){if(T===q&&(0<P&&(D=D.replace(f,"")),0<D.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:D+=c.charAt(T)}p=59}switch(p){case 123:for(d=(D=D.trim()).charCodeAt(0),g=1,I=++T;T<W;){switch(p=c.charCodeAt(T)){case 123:g++;break;case 125:g--;break;case 47:switch(p=c.charCodeAt(T+1)){case 42:case 47:e:{for(N=T+1;N<q;++N)switch(c.charCodeAt(N)){case 47:if(42===p&&42===c.charCodeAt(N-1)&&T+2!==N){T=N+1;break e}break;case 10:if(47===p){T=N+1;break e}}T=N}}break;case 91:p++;case 40:p++;case 34:case 39:for(;T++<q&&c.charCodeAt(T)!==p;);}if(0===g)break;T++}switch(g=c.substring(I,T),0===d&&(d=(D=D.replace(l,"").trim()).charCodeAt(0)),d){case 64:switch(0<P&&(D=D.replace(f,"")),p=D.charCodeAt(1)){case 100:case 109:case 115:case 45:P=n;break;default:P=R}if(I=(g=e(n,P,g,p,h+1)).length,0<F&&(y=s(3,g,P=r(R,D,$),n,z,S,I,p,h,u),D=P.join(""),void 0!==y&&0===(I=(g=y.trim()).length)&&(p=0,g="")),0<I)switch(p){case 115:D=D.replace(k,o);case 100:case 109:case 45:g=D+"{"+g+"}";break;case 107:g=(D=D.replace(m,"$1 $2"))+"{"+g+"}",g=1===E||2===E&&a("@"+g,3)?"@-webkit-"+g+"@"+g:"@"+g;break;default:g=D+g,112===u&&(L+=g,g="")}else g="";break;default:g=e(n,r(n,D,$),g,u,h+1)}G+=g,g=$=P=N=d=0,D="",p=c.charCodeAt(++T);break;case 125:case 59:if(1<(I=(D=(0<P?D.replace(f,""):D).trim()).length))switch(0===N&&(d=D.charCodeAt(0),45===d||96<d&&123>d)&&(I=(D=D.replace(" ",":")).length),0<F&&void 0!==(y=s(1,D,n,t,z,S,L.length,u,h,u))&&0===(I=(D=y.trim()).length)&&(D="\0\0"),d=D.charCodeAt(0),p=D.charCodeAt(1),d){case 0:break;case 64:if(105===p||99===p){U+=D+c.charAt(T);break}default:58!==D.charCodeAt(I-1)&&(L+=i(D,d,p,D.charCodeAt(2)))}$=P=N=d=0,D="",p=c.charCodeAt(++T)}}switch(p){case 13:case 10:47===x?x=0:0===1+d&&107!==u&&0<D.length&&(P=1,D+="\0"),0<F*H&&s(0,D,n,t,z,S,L.length,u,h,u),S=1,z++;break;case 59:case 125:if(0===x+_+A+C){S++;break}default:switch(S++,b=c.charAt(T),p){case 9:case 32:if(0===_+C+x)switch(O){case 44:case 58:case 9:case 32:b="";break;default:32!==p&&(b=" ")}break;case 0:b="\\0";break;case 12:b="\\f";break;case 11:b="\\v";break;case 38:0===_+x+C&&(P=$=1,b="\f"+b);break;case 108:if(0===_+x+C+j&&0<N)switch(T-N){case 2:112===O&&58===c.charCodeAt(T-3)&&(j=O);case 8:111===M&&(j=M)}break;case 58:0===_+x+C&&(N=T);break;case 44:0===x+A+_+C&&(P=1,b+="\r");break;case 34:case 39:0===x&&(_=_===p?0:0===_?p:_);break;case 91:0===_+x+A&&C++;break;case 93:0===_+x+A&&C--;break;case 41:0===_+x+C&&A--;break;case 40:if(0===_+x+C){if(0===d)switch(2*O+3*M){case 533:break;default:d=1}A++}break;case 64:0===x+A+_+C+N+g&&(g=1);break;case 42:case 47:if(!(0<_+C+A))switch(x){case 0:switch(2*p+3*c.charCodeAt(T+1)){case 235:x=47;break;case 220:I=T,x=42}break;case 42:47===p&&42===O&&I+2!==T&&(33===c.charCodeAt(I+2)&&(L+=c.substring(I,T+1)),b="",x=0)}}0===x&&(D+=b)}M=O,O=p,T++}if(0<(I=L.length)){if(P=n,0<F&&void 0!==(y=s(2,L,P,t,z,S,I,u,h,u))&&0===(L=y).length)return U+L+G;if(L=P.join(",")+"{"+L+"}",0!=E*j){switch(2!==E||a(L,2)||(j=0),j){case 111:L=L.replace(w,":-moz-$1")+L;break;case 112:L=L.replace(v,"::-webkit-input-$1")+L.replace(v,"::-moz-$1")+L.replace(v,":-ms-input-$1")+L}j=0}}return U+L+G}(R,c,n,0,0);return 0<F&&void 0!==(h=s(-2,d,c,c,z,S,d.length,0,0,0))&&(d=h),j=0,S=z=1,d}var l=/^\0+/g,f=/[\0\r\f]/g,h=/: */g,d=/zoo|gra/,p=/([,: ])(transform)/g,g=/,\r+?/g,b=/([\t\r\n ])*\f?&/g,m=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,w=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,k=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,x=/-self|flex-/g,A=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,O=/([^-])(image-set\()/,S=1,z=1,j=0,E=1,R=[],M=[],F=0,N=null,H=0;return u.use=function e(t){switch(t){case void 0:case null:F=M.length=0;break;default:switch(t.constructor){case Array:for(var r=0,n=t.length;r<n;++r)e(t[r]);break;case Function:M[F++]=t;break;case Boolean:H=0|!!t}}return e},u.set=c,void 0!==t&&c(t),u},s=r(3),c=r.n(s),u=/[A-Z]|^ms/g,l=n(function(e){return e.replace(u,"-$&").toLowerCase()}),f=function(e,t){return null==t||"boolean"==typeof t?"":1===i[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:t+"px"},h=function e(t){for(var r=t.length,n=0,i="";n<r;n++){var a=t[n];if(null!=a){var o=void 0;switch(typeof a){case"boolean":break;case"function":0,o=e([a()]);break;case"object":if(Array.isArray(a))o=e(a);else for(var s in o="",a)a[s]&&s&&(o&&(o+=" "),o+=s);break;default:o=a}o&&(i&&(i+=" "),i+=o)}}return i},d="undefined"!=typeof document;function p(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),(void 0!==e.container?e.container:document.head).appendChild(t),t}var g=function(){function e(e){this.isSpeedy=!0,this.tags=[],this.ctr=0,this.opts=e}var t=e.prototype;return t.inject=function(){if(this.injected)throw new Error("already injected!");this.tags[0]=p(this.opts),this.injected=!0},t.speedy=function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e},t.insert=function(e,t){if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(this.tags[this.tags.length-1]);try{r.insertRule(e,r.cssRules.length)}catch(e){0}}else{var n=p(this.opts);this.tags.push(n),n.appendChild(document.createTextNode(e+(t||"")))}this.ctr++,this.ctr%65e3==0&&this.tags.push(p(this.opts))},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0,this.injected=!1},e}();t.a=function(e,t){if(void 0!==e.__SECRET_EMOTION__)return e.__SECRET_EMOTION__;void 0===t&&(t={});var r,n,i=t.key||"css",s=c()(function(e){r+=e,d&&p.insert(e,m)});void 0!==t.prefix&&(n={prefix:t.prefix});var u={registered:{},inserted:{},nonce:t.nonce,key:i},p=new g(t);d&&p.inject();var b=new o(n);b.use(t.stylisPlugins)(s);var m="";function v(e,t){if(null==e)return"";switch(typeof e){case"boolean":return"";case"function":if(void 0!==e.__emotion_styles){var r=e.toString();return r}return v.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(k.has(e))return k.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=v.call(this,e,!1)},this):Object.keys(e).forEach(function(r){"object"!=typeof e[r]?void 0!==u.registered[e[r]]?t+=r+"{"+u.registered[e[r]]+"}":t+=l(r)+":"+f(r,e[r])+";":Array.isArray(e[r])&&"string"==typeof e[r][0]&&void 0===u.registered[e[r][0]]?e[r].forEach(function(e){t+=l(r)+":"+f(r,e)+";"}):t+=r+"{"+v.call(this,e[r],!1)+"}"},this),k.set(e,t),t}.call(this,e);default:var n=u.registered[e];return!1===t&&void 0!==n?n:e}}var w,y,k=new WeakMap,C=/label:\s*([^\s;\n{]+)\s*;/g,x=function(e){var t=!0,r="",n="";null==e||void 0===e.raw?(t=!1,r+=v.call(this,e,!1)):r+=e[0];for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return o.forEach(function(n,i){r+=v.call(this,n,46===r.charCodeAt(r.length-1)),!0===t&&void 0!==e[i+1]&&(r+=e[i+1])},this),y=r,r=r.replace(C,function(e,t){return n+="-"+t,""}),w=function(e,t){return a(e+t)+t}(r,n),r};function A(e,t){void 0===u.inserted[w]&&(r="",b(e,t),u.inserted[w]=r)}var _=function(){var e=x.apply(this,arguments),t=i+"-"+w;return void 0===u.registered[t]&&(u.registered[t]=y),A("."+t,e),t};function O(e,t){var r="";return t.split(" ").forEach(function(t){void 0!==u.registered[t]?e.push(t):r+=t+" "}),r}function S(e,t){var r=[],n=O(r,e);return r.length<2?e:n+_(r,t)}function z(e){u.inserted[e]=!0}if(d){var j=document.querySelectorAll("[data-emotion-"+i+"]");Array.prototype.forEach.call(j,function(e){p.tags[0].parentNode.insertBefore(e,p.tags[0]),e.getAttribute("data-emotion-"+i).split(" ").forEach(z)})}var E={flush:function(){d&&(p.flush(),p.inject()),u.inserted={},u.registered={}},hydrate:function(e){e.forEach(z)},cx:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return S(h(t))},merge:S,getRegisteredStyles:O,injectGlobal:function(){A("",x.apply(this,arguments))},keyframes:function(){var e=x.apply(this,arguments),t="animation-"+w;return A("","@keyframes "+t+"{"+e+"}"),t},css:_,sheet:p,caches:u};return e.__SECRET_EMOTION__=E,E}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";r.r(t);var n=r(2),i=r(1),a=r.n(i),o=r(0),s=r.n(o);function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var l=!!document.documentElement.currentStyle,f={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},h=["letter-spacing","line-height","font-family","font-weight","font-size","font-style","tab-size","text-rendering","text-transform","width","text-indent","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","box-sizing"],d={},p=document.createElement("textarea"),g=function(e){Object.keys(f).forEach(function(t){e.style.setProperty(t,f[t],"important")})};function b(e,t,r,n,i){void 0===r&&(r=!1),void 0===n&&(n=null),void 0===i&&(i=null),null===p.parentNode&&document.body.appendChild(p);var a=function(e,t,r){void 0===r&&(r=!1);if(r&&d[t])return d[t];var n=window.getComputedStyle(e);if(null===n)return null;var i=h.reduce(function(e,t){return e[t]=n.getPropertyValue(t),e},{}),a=i["box-sizing"];if(""===a)return null;l&&"border-box"===a&&(i.width=parseFloat(i.width)+parseFloat(n["border-right-width"])+parseFloat(n["border-left-width"])+parseFloat(n["padding-right"])+parseFloat(n["padding-left"])+"px");var o=parseFloat(i["padding-bottom"])+parseFloat(i["padding-top"]),s=parseFloat(i["border-bottom-width"])+parseFloat(i["border-top-width"]),c={sizingStyle:i,paddingSize:o,borderSize:s,boxSizing:a};r&&(d[t]=c);return c}(e,t,r);if(null===a)return null;var o=a.paddingSize,s=a.borderSize,c=a.boxSizing,u=a.sizingStyle;Object.keys(u).forEach(function(e){p.style[e]=u[e]}),g(p),p.value=e.value||e.placeholder||"x";var f=-1/0,b=1/0,m=p.scrollHeight;"border-box"===c?m+=s:"content-box"===c&&(m-=o),p.value="x";var v=p.scrollHeight-o,w=Math.floor(m/v);return null!==n&&(f=v*n,"border-box"===c&&(f=f+o+s),m=Math.max(f,m)),null!==i&&(b=v*i,"border-box"===c&&(b=b+o+s),m=Math.min(b,m)),{height:m,minHeight:f,maxHeight:b,rowCount:Math.floor(m/v),valueRowCount:w}}g(p);var m=function(){},v=window.requestAnimationFrame?[window.requestAnimationFrame,window.cancelAnimationFrame]:[setTimeout,clearTimeout],w=v[0],y=v[1],k=0,C=function(e){function t(t){var r;return(r=e.call(this,t)||this)._onRef=function(e){r._ref=e,r.props.inputRef(e)},r._onChange=function(e){r._controlled||r._resizeComponent(),r.props.onChange(e,u(u(r)))},r._resizeComponent=function(e){void 0===e&&(e=m);var t=b(r._ref,r._uid,r.props.useCacheForDOMMeasurements,r.props.minRows,r.props.maxRows);if(null!==t){var n=t.height,i=t.minHeight,a=t.maxHeight,o=t.rowCount,s=t.valueRowCount;r.rowCount=o,r.valueRowCount=s,r.state.height===n&&r.state.minHeight===i&&r.state.maxHeight===a?e():r.setState({height:n,minHeight:i,maxHeight:a},e)}else e()},r.state={height:t.style&&t.style.height||0,minHeight:-1/0,maxHeight:1/0},r._uid=k++,r._controlled=void 0!==t.value,r._resizeLock=!1,r}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.render=function(){var e=this.props,t=(e.inputRef,e.maxRows,e.minRows,e.onHeightChange,e.useCacheForDOMMeasurements,function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]));return t.style=c({},t.style,{height:this.state.height}),Math.max(t.style.maxHeight||1/0,this.state.maxHeight)<this.state.height&&(t.style.overflow="hidden"),a.a.createElement("textarea",c({},t,{onChange:this._onChange,ref:this._onRef}))},r.componentDidMount=function(){var e=this;this._resizeComponent(),this._resizeListener=function(){e._resizeLock||(e._resizeLock=!0,e._resizeComponent(function(){e._resizeLock=!1}))},window.addEventListener("resize",this._resizeListener)},r.componentDidUpdate=function(e,t){var r=this;e!==this.props&&(y(this._rafId),this._rafId=w(function(){r._resizeComponent()})),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},r.componentWillUnmount=function(){y(this._rafId),window.removeEventListener("resize",this._resizeListener),function(e){delete d[e]}(this._uid)},t}(a.a.Component);C.defaultProps={inputRef:m,onChange:m,onHeightChange:m,useCacheForDOMMeasurements:!1};var x=C;function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _={fontFamily:"inherit"};class O extends a.a.Component{shouldComponentUpdate(){return!0}render(){const e=this.props,t=e.forID,r=e.value,i=e.onChange,o=e.classNameWrapper,s=e.setActiveStyle,c=e.setInactiveStyle;return a.a.createElement(x,{id:t,value:r||"",className:Object(n.b)(Object(n.a)(_)+" "+o),onFocus:s,onBlur:c,style:{minHeight:"140px"},onChange:e=>i(e.target.value)})}}A(O,"propTypes",{onChange:s.a.func.isRequired,forID:s.a.string,value:s.a.node,classNameWrapper:s.a.string.isRequired,setActiveStyle:s.a.func.isRequired,setInactiveStyle:s.a.func.isRequired}),A(O,"defaultProps",{value:""});var S=r(4);const z=({value:e})=>a.a.createElement(S.WidgetPreviewContainer,null,e);z.propTypes={value:s.a.node};var j=z;r.d(t,"NetlifyCmsWidgetText",function(){return E}),r.d(t,"Control",function(){return O}),r.d(t,"Preview",function(){return j});const E={Control:O,Preview:j}}]).NetlifyCmsWidgetText}); //# sourceMappingURL=netlify-cms-widget-text.js.map