/*! For license information please see dll.ChatButton.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[28],{2310:function(t,e,n){"use strict";n.r(e);var o=n(965),a=n(2311);o.default.addResources("de","chat-button",a.DE),o.default.addResources("en","chat-button",a.EN),o.default.addResources("es","chat-button",a.ES)},2311:function(t){t.exports=JSON.parse('{"DE":{"join-chat":"Chat beitreten","join-chat-id":"Chat mit ID {{id}} beitreten","leave-chat":"Chat mit ID {{id}} verlassen","leave-chat-id":"Leave chat with ID {{id}}","toggle-chat":"Chat ein-/ausschalten"},"EN":{"join-chat":"Join Chat","join-chat-id":"Join chat with ID {{id}}","leave-chat-id":"Leave chat with ID {{id}}","leave-chat":"Leave Chat","toggle-chat":"Toggle Chat"},"ES":{"join-chat":"Unirse chat","join-chat-id":"Unirse al chat con ID {{id}}","leave-chat-id":"Dejar charla con ID {{id}}","leave-chat":"Dejar la charla","toggle-chat":"Toggle al chat"}}')},838:function(t,e,n){"use strict";n.r(e);var o=n(14),a=n.n(o),s=n(13),i=n.n(s),r=n(10),c=n.n(r),l=n(15),p=n.n(l),h=n(16),u=n.n(h),d=n(8),f=n.n(d),m=n(7),b=n.n(m),v=n(0),g=n.n(v),S=n(1),C=n.n(S),y=n(36),E=n.n(y),T=n(2309),w=n(92),D=n(77),j=n(44),_=n(146),k=n(37),A=n(109);n(2310);function I(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=f()(t);if(e){var a=f()(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return u()(this,n)}}var M=E()("isle:chat-button"),R=function(t){p()(n,t);var e=I(n);function n(t){var o;return a()(this,n),o=e.call(this,t),b()(c()(o),"hideAnimation",(function(){o.setState({showAnimation:!1})})),b()(c()(o),"handleClick",(function(t){M("Handle click to join chat...");var e=!o.state.opened;o.props.onClick(t,e),o.setState({opened:e},(function(){var t=o.context;e?(M("Should join chat for component with id '".concat(o.props.for,"'...")),t.joinChat({name:o.props.for,anonymousSubmissions:o.props.anonymousSubmissions})):(M("Should leave chat for component with id '".concat(o.props.for,"'...")),t.leaveChat(o.props.for))}))})),o.state={opened:!1,nMessages:0,nMembers:0},o}return i()(n,[{key:"componentDidMount",value:function(){var t=this,e=this.context;this.unsubscribe=e.subscribe((function(n,o){if(n!==A.SELF_HAS_JOINED_CHAT&&n!==A.RECEIVED_CHAT_HISTORY||!o||o.name!==t.props.for){if(n===A.CHAT_STATISTICS&&o.name===t.props.for){var a={nMessages:o.nMessages,nMembers:o.nMembers};o.nMessages>t.state.nMessages&&(a.showAnimation=!0),t.setState(a),setTimeout(t.hideAnimation,4e3)}else if(o===t.props.for){e.getChat(t.props.for)&&n!==A.SELF_HAS_LEFT_CHAT?n===A.REMOVED_CHAT&&t.setState({opened:!1}):t.setState({opened:!1}),t.forceUpdate()}}else t.setState({opened:!0})}))}},{key:"componentWillUnmount",value:function(){this.unsubscribe()}},{key:"render",value:function(){var t,e,n=this.state.nMessages;t=this.props.buttonLabel?this.props.buttonLabel:this.state.opened?this.props.t("leave-chat"):this.props.t("join-chat"),e=this.props.buttonVariant?this.props.buttonVariant:this.state.nMembers>0?"success":"secondary";var o,a=g.a.createElement(D.default,{className:this.props.className,variant:e,size:this.props.size,onClick:this.handleClick,style:this.props.style,"aria-label":this.props.t("toggle-chat")},g.a.createElement("span",{style:{pointerEvents:"none"}},t),n?g.a.createElement(w.default,{variant:"dark",style:{marginLeft:"5px",fontSize:"10px",pointerEvents:"none",animation:this.state.showAnimation?"ping 0.7s 3":"none"}},n):null);return o=this.props.tooltip?this.props.tooltip:this.state.opened?this.props.t("leave-chat-id",{id:this.props.for}):this.props.t("join-chat-id",{id:this.props.for}),this.props.showTooltip&&(a=g.a.createElement(j.default,{tooltip:o,placement:this.props.tooltipPlacement},a)),g.a.createElement(_.default,{user:!0},a)}}]),n}(v.Component);R.propTypes={for:C.a.string.isRequired,anonymousSubmissions:C.a.bool,buttonLabel:C.a.node,showTooltip:C.a.bool,tooltip:C.a.string,size:C.a.string,buttonVariant:C.a.string,tooltipPlacement:C.a.oneOf(["left","top","right","bottom"]),onClick:C.a.func,className:C.a.string,style:C.a.object},R.defaultProps={anonymousSubmissions:!1,buttonLabel:null,showTooltip:!0,tooltip:null,size:"sm",buttonVariant:null,tooltipPlacement:"top",onClick:function(){},className:"",style:{}},R.contextType=k.default,e.default=Object(T.withTranslation)("chat-button")(R)}}]);