UNPKG

react-fb-like

Version:

React component for facebook like button

15 lines 10.6 kB
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),u=n.n(a),c=n(6),s=n.n(c),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.language,n=e.appId,r=e.version;document&&"undefined"!=typeof document&&function(e,o,i){var a=e.getElementsByTagName(o)[e.getElementsByTagName(o).length-1];if(!e.getElementById(i)){var u=e.createElement(o);u.id=i,u.src="//connect.facebook.net/"+t+"/sdk.js#xfbml=1&version="+r+"&appId="+n,a.parentNode.insertBefore(u,a)}}(document,"script","facebook-jssdk")}},{key:"render",value:function(){var e=this.props,t=e.href,n=e.layout,r=e.action,o=e.size,i=e.share,a=e.showFaces,c=e.reference,s=e.width,l=e.colorscheme,f=e.kidDirectedSite;return u.a.createElement("div",{className:"fb-like","data-href":t,"data-layout":n,"data-action":r,"data-size":o,"data-show-faces":a,"data-share":i,"data-width":s,"data-ref":c,"data-colorscheme":l,"data-kid-directed-site":f})}}]),t}(a.Component);f.propTypes={appId:s.a.string.isRequired,version:s.a.string,language:s.a.string,href:s.a.string,layout:s.a.oneOf(["standard","box_count","button_count","button"]),action:s.a.string,size:s.a.string,share:s.a.bool,showFaces:s.a.bool,width:s.a.oneOfType([s.a.string,s.a.number]),reference:s.a.string,colorscheme:s.a.string,kidDirectedSite:s.a.bool},f.defaultProps={language:"en_US",version:"v2.12",layout:"standard",action:"like",size:"small",share:!0,showFaces:!0,colorscheme:"light",kidDirectedSite:!1,href:null,width:null,reference:null},t.default=f},function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);throw t=Error(n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."),t.name="Invariant Violation",t.framesToPop=1,t}function o(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||E}function i(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||E}function a(){}function u(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||E}function c(e,t,n){var r,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)A.call(t,r)&&!I.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];o.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===o[r]&&(o[r]=u[r]);return{$$typeof:w,type:e,key:i,ref:a,props:o,_owner:C.current}}function s(e){return"object"==typeof e&&null!==e&&e.$$typeof===w}function l(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function f(e,t,n,r){if(N.length){var o=N.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function p(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>N.length&&N.push(e)}function y(e,t,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case w:case k:case j:case x:a=!0}}if(a)return n(o,e,""===t?"."+d(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;u<e.length;u++){i=e[u];var c=t+d(i,u);a+=y(i,c,n,o)}else if(null===e||void 0===e?c=null:(c=S&&e[S]||e["@@iterator"],c="function"==typeof c?c:null),"function"==typeof c)for(e=c.call(e),u=0;!(i=e.next()).done;)i=i.value,c=t+d(i,u++),a+=y(i,c,n,o);else"object"===i&&(n=""+e,r("31","[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return a}function d(e,t){return"object"==typeof e&&null!==e&&null!=e.key?l(e.key):t.toString(36)}function h(e,t){e.func.call(e.context,t,e.count++)}function b(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?m(e,r,n,O.thatReturnsArgument):null!=e&&(s(e)&&(t=o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace($,"$&/")+"/")+n,e={$$typeof:w,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function m(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace($,"$&/")+"/"),t=f(t,i,r,o),null==e||y(e,"",b,t),p(t)}/** @license React v16.2.0 * react.production.min.js * * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var v=n(4),g=n(5),O=n(0),_="function"==typeof Symbol&&Symbol.for,w=_?Symbol.for("react.element"):60103,k=_?Symbol.for("react.call"):60104,j=_?Symbol.for("react.return"):60105,x=_?Symbol.for("react.portal"):60106,P=_?Symbol.for("react.fragment"):60107,S="function"==typeof Symbol&&Symbol.iterator,E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};o.prototype.isReactComponent={},o.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e,t,"setState")},o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},a.prototype=o.prototype;var R=i.prototype=new a;R.constructor=i,v(R,o.prototype),R.isPureReactComponent=!0;var T=u.prototype=new a;T.constructor=u,v(T,o.prototype),T.unstable_isAsyncReactComponent=!0,T.render=function(){return this.props.children};var C={current:null},A=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0},$=/\/+/g,N=[],F={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return m(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=f(null,null,t,n),null==e||y(e,"",h,t),p(t)},count:function(e){return null==e?0:y(e,"",O.thatReturnsNull,null)},toArray:function(e){var t=[];return m(e,t,null,O.thatReturnsArgument),t},only:function(e){return s(e)||r("143"),e}},Component:o,PureComponent:i,unstable_AsyncComponent:u,Fragment:P,createElement:c,cloneElement:function(e,t,n){var r=v({},e.props),o=e.key,i=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,a=C.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)A.call(t,c)&&!I.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=n;else if(1<c){u=Array(c);for(var s=0;s<c;s++)u[s]=arguments[s+2];r.children=u}return{$$typeof:w,type:e.type,key:o,ref:i,props:r,_owner:a}},createFactory:function(e){var t=c.bind(null,e);return t.type=e,t},isValidElement:s,version:"16.2.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:C,assign:v}},U=Object.freeze({default:F}),q=U&&F||U;e.exports=q.default?q.default:q},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* object-assign (c) Sindre Sorhus @license MIT */ var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,c=r(e),s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var l in n)i.call(n,l)&&(c[l]=n[l]);if(o){u=o(n);for(var f=0;f<u.length;f++)a.call(n,u[f])&&(c[u[f]]=n[u[f]])}}return c}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){e.exports=n(7)()},function(e,t,n){"use strict";var r=n(0),o=n(8),i=n(9);e.exports=function(){function e(e,t,n,r,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e,t,n,r,i,a,u,c){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,u,c],f=0;s=new Error(t.replace(/%s/g,function(){return l[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}]); //# sourceMappingURL=react-fb-like.js.map