User Profile Picture - Version 2.3.5

Version Description

  • Released 2019-09-17
  • Added option in Gutenberg block to customize the View Posts and View Website text.
Download this release

Release Info

Developer ronalfy
Plugin Icon 128x128 User Profile Picture
Version 2.3.5
Comparing to
See all releases

Code changes from version 2.3.2 to 2.3.5

dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(e,t,r){"use strict";function o(e){return"[object Array]"===T.call(e)}function n(e){return"[object ArrayBuffer]"===T.call(e)}function i(e){return"undefined"!==typeof FormData&&e instanceof FormData}function a(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function l(e){return"string"===typeof e}function s(e){return"number"===typeof e}function p(e){return"undefined"===typeof e}function c(e){return null!==e&&"object"===typeof e}function u(e){return"[object Date]"===T.call(e)}function m(e){return"[object File]"===T.call(e)}function f(e){return"[object Blob]"===T.call(e)}function h(e){return"[object Function]"===T.call(e)}function d(e){return c(e)&&h(e.pipe)}function g(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams}function b(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function w(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function C(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}function v(){function e(e,r){"object"===typeof t[r]&&"object"===typeof e?t[r]=v(t[r],e):t[r]=e}for(var t={},r=0,o=arguments.length;r<o;r++)C(arguments[r],e);return t}function E(e,t,r){return C(t,function(t,o){e[o]=r&&"function"===typeof t?_(t,r):t}),e}var _=r(4),y=r(15),T=Object.prototype.toString;e.exports={isArray:o,isArrayBuffer:n,isBuffer:y,isFormData:i,isArrayBufferView:a,isString:l,isNumber:s,isObject:c,isUndefined:p,isDate:u,isFile:m,isBlob:f,isFunction:h,isStream:d,isURLSearchParams:g,isStandardBrowserEnv:w,forEach:C,merge:v,extend:E,trim:b}},function(e,t,r){"use strict";(function(t){function o(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var n=r(0),i=r(18),a={"Content-Type":"application/x-www-form-urlencoded"},l={adapter:function(){var e;return"undefined"!==typeof XMLHttpRequest?e=r(5):"undefined"!==typeof t&&(e=r(5)),e}(),transformRequest:[function(e,t){return i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(e){l.headers[e]={}}),n.forEach(["post","put","patch"],function(e){l.headers[e]=n.merge(a)}),e.exports=l}).call(t,r(17))},function(e,t,r){var o,n;!function(){"use strict";function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var n=typeof o;if("string"===n||"number"===n)e.push(o);else if(Array.isArray(o)&&o.length){var a=r.apply(null,o);a&&e.push(a)}else if("object"===n)for(var l in o)i.call(o,l)&&o[l]&&e.push(l)}}return e.join(" ")}var i={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(r.default=r,e.exports=r):(o=[],void 0!==(n=function(){return r}.apply(t,o))&&(e.exports=n))}()},function(e,t,r){e.exports=r(14)},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];return e.apply(t,r)}}},function(e,t,r){"use strict";var o=r(0),n=r(19),i=r(21),a=r(22),l=r(23),s=r(6);e.exports=function(e){return new Promise(function(t,p){var c=e.data,u=e.headers;o.isFormData(c)&&delete u["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",h=e.auth.password||"";u.Authorization="Basic "+btoa(f+":"+h)}if(m.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),m.timeout=e.timeout,m.onreadystatechange=function(){if(m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in m?a(m.getAllResponseHeaders()):null,o=e.responseType&&"text"!==e.responseType?m.response:m.responseText,i={data:o,status:m.status,statusText:m.statusText,headers:r,config:e,request:m};n(t,p,i),m=null}},m.onerror=function(){p(s("Network Error",e,null,m)),m=null},m.ontimeout=function(){p(s("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",m)),m=null},o.isStandardBrowserEnv()){var d=r(24),g=(e.withCredentials||l(e.url))&&e.xsrfCookieName?d.read(e.xsrfCookieName):void 0;g&&(u[e.xsrfHeaderName]=g)}if("setRequestHeader"in m&&o.forEach(u,function(e,t){"undefined"===typeof c&&"content-type"===t.toLowerCase()?delete u[t]:m.setRequestHeader(t,e)}),e.withCredentials&&(m.withCredentials=!0),e.responseType)try{m.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"===typeof e.onDownloadProgress&&m.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){m&&(m.abort(),p(e),m=null)}),void 0===c&&(c=null),m.send(c)})}},function(e,t,r){"use strict";var o=r(20);e.exports=function(e,t,r,n,i){var a=new Error(e);return o(a,t,r,n,i)}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";function o(e){this.message=e}o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(10)},function(e,t,r){"use strict";var o=r(11),n=(r.n(o),r(12)),i=(r.n(n),r(13)),a=r(32),l=r(2),s=r.n(l),__=wp.i18n.__,p=wp.blocks.registerBlockType,c=wp.element,u=(c.Component,c.Fragment),m=wp.editor.RichText,f={profileName:{type:"string",default:""},profileTitle:{type:"string",default:""},profileContent:{type:"string",default:""},profileAlignment:{type:"string"},profileImgURL:{type:"string",source:"attribute",attribute:"src",selector:"img",default:""},profileImgID:{type:"number",default:""},profileURL:{type:"string",default:""},profileBackgroundColor:{type:"string",default:"#f2f2f2"},profileTextColor:{type:"string",default:"#32373c"},profileViewPostsBackgroundColor:{type:"string",default:"#cf6d38"},profileViewPostsTextColor:{type:"string",default:"#FFFFFF"},profileViewPostsWidth:{type:"number",default:100},profileFontSize:{type:"number",default:18},profileAvatarShape:{type:"string",default:"square"},showName:{type:"bool",default:!0},showTitle:{type:"bool",default:!0},showDescription:{type:"bool",default:!0},showViewPosts:{type:"bool",default:!0},user_id:{type:"number",default:0}};p("mpp/user-profile",{title:__("User Profile Legacy","metronet-profile-picture"),icon:wp.element.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 753.53 979.74"},wp.element.createElement("title",null,"upp"),wp.element.createElement("path",{d:"M806.37,185.9c0,40.27-30.49,72.9-68.11,72.9s-68.17-32.63-68.17-72.9S700.62,113,738.26,113,806.37,145.64,806.37,185.9Z",transform:"translate(-123.47 -11)",fill:"#4063ad"}),wp.element.createElement("path",{d:"M330.36,183.8c0,40.27-30.49,72.9-68.12,72.9s-68.17-32.63-68.17-72.9,30.52-72.87,68.17-72.87S330.36,143.56,330.36,183.8Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M331.3,888.13V698.21H329c-31.64,0-57.28-27.45-57.28-61.29V336.5a118.37,118.37,0,0,1,5.43-34.79H179.84c-31.94,0-56.37,31.57-56.37,56.34V601.46h48.32V888.13Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M388.59,636.92V990.74H611.88V636.92H671.5V336.5c0-30.63-27.64-69.57-69.6-69.57H398.56c-39.44,0-69.61,38.94-69.61,69.57V636.92Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M584.3,101c0,49.69-37.63,90-84,90S416.12,150.67,416.12,101s37.66-90,84.14-90S584.3,51.27,584.3,101Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M820.61,303.79H724.08a121.69,121.69,0,0,1,4.7,32.71V636.92c0,33.84-25.64,61.29-57.28,61.29h-2.33v192H828.7V603.54H877V360.16C877,335.36,854.62,303.79,820.61,303.79Z",transform:"translate(-123.47 -11)",fill:"#4063ad"})),category:"mpp",attributes:f,edit:a.a,save:function(e){var t=e.attributes,r=t.profileName,o=t.profileTitle,n=t.profileContent,i=t.profileAlignment,a=t.profileImgURL,l=(t.profileImgID,t.profileFontSize),p=t.profileBackgroundColor,c=t.profileTextColor,f=(t.profileLinkColor,t.profileAvatarShape),h=t.profileViewPostsBackgroundColor,d=t.profileViewPostsTextColor,g=t.profileURL,b=t.showTitle,w=t.showName,C=t.showDescription,v=t.showViewPosts;return wp.element.createElement(u,null,wp.element.createElement("div",{className:s()("mpp-profile-wrap",i,f,"mt-font-size-"+l,"mpp-block-profile"),style:{backgroundColor:p,color:c}},wp.element.createElement("div",{className:s()("mpp-profile-gutenberg-wrap","mpp-block-profile"),style:{backgroundColor:p,color:c}},wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement("img",{className:"mpp-profile-avatar",src:a,alt:"avatar"}))),wp.element.createElement("div",{className:"mpp-content-wrap"},r&&!!r.length&&w&&wp.element.createElement(m.Content,{tagName:"h2",className:"mpp-profile-name",style:{color:c},value:r}),o&&!!o.length&&b&&wp.element.createElement(m.Content,{tagName:"p",className:"mpp-profile-title",style:{color:c},value:o}),n&&!!n.length&&C&&wp.element.createElement(m.Content,{tagName:"div",className:"mpp-profile-text",value:n}))),g&&!!g.length&&wp.element.createElement("div",{className:"mpp-gutenberg-view-posts"},v&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:h,color:d}},wp.element.createElement("a",{href:g,style:{backgroundColor:h,color:d}},__("View Posts","metronet-profile-picture"))))))}}),p("mpp/user-profile-enhanced",{title:__("User Profile","metronet-profile-picture"),icon:wp.element.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 753.53 979.74"},wp.element.createElement("title",null,"upp"),wp.element.createElement("path",{d:"M806.37,185.9c0,40.27-30.49,72.9-68.11,72.9s-68.17-32.63-68.17-72.9S700.62,113,738.26,113,806.37,145.64,806.37,185.9Z",transform:"translate(-123.47 -11)",fill:"#4063ad"}),wp.element.createElement("path",{d:"M330.36,183.8c0,40.27-30.49,72.9-68.12,72.9s-68.17-32.63-68.17-72.9,30.52-72.87,68.17-72.87S330.36,143.56,330.36,183.8Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M331.3,888.13V698.21H329c-31.64,0-57.28-27.45-57.28-61.29V336.5a118.37,118.37,0,0,1,5.43-34.79H179.84c-31.94,0-56.37,31.57-56.37,56.34V601.46h48.32V888.13Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M388.59,636.92V990.74H611.88V636.92H671.5V336.5c0-30.63-27.64-69.57-69.6-69.57H398.56c-39.44,0-69.61,38.94-69.61,69.57V636.92Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M584.3,101c0,49.69-37.63,90-84,90S416.12,150.67,416.12,101s37.66-90,84.14-90S584.3,51.27,584.3,101Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M820.61,303.79H724.08a121.69,121.69,0,0,1,4.7,32.71V636.92c0,33.84-25.64,61.29-57.28,61.29h-2.33v192H828.7V603.54H877V360.16C877,335.36,854.62,303.79,820.61,303.79Z",transform:"translate(-123.47 -11)",fill:"#4063ad"})),category:"mpp",getEditWrapperProps:function(e){},edit:i.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}var l=r(3),s=r.n(l),p=r(2),c=r.n(p),u=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),m=wp.element,f=m.Component,h=m.Fragment,__=wp.i18n.__,d=wp.components,g=d.PanelBody,b=d.Placeholder,w=(d.QueryControls,d.RangeControl),C=d.SelectControl,v=d.Spinner,E=d.TextControl,_=d.ToggleControl,y=(d.Toolbar,d.withAPIData,d.ColorPalette,d.Button),T=wp.editor,P=T.InspectorControls,S=(T.BlockControls,T.MediaUpload),N=T.RichText,x=(T.AlignmentToolbar,T.PanelColorSettings),k=function(e){function t(){n(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));e.get_users=function(){s.a.post(mpp_gutenberg.rest_url+"/get_users",{},{headers:{"X-WP-Nonce":mpp_gutenberg.nonce}}).then(function(t){var r,n=Array(),i=Array(),a=0,l="",s=0,p="",c="",u="",m="",f="";$.each(t.data,function(e,t){n[t.ID]={profile_pictures:t.profile_pictures,has_profile_picture:t.has_profile_picture,display_name:t.display_name,description:t.description,is_user_logged_in:t.is_user_logged_in,profile_picture_id:t.profile_picture_id,default_image:t.default_image,permalink:t.permalink},t.is_user_logged_in&&(a=t.ID),i.push({value:t.ID,label:t.display_name})}),0!==e.props.attributes.user_id&&(a=e.props.attributes.user_id);var h=n[a];h.has_profile_picture?(l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:h.profile_pictures.thumbnail,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:h.profile_picture_id,p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:h.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",m=h.permalink,c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:h.description,f=e.props.attributes.showWebsite):(p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:h.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:h.description,l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:h.default_image,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:0,m=h.permalink,f=e.props.attributes.showWebsite),void 0==c&&(c=""),e.setState((r={loading:!1,users:n,active_user:a,user_list:i,profile_picture:l,profile_picture_id:s},o(r,"active_user",a),o(r,"profile_name",p),o(r,"profile_name_unfiltered",h.display_name),o(r,"profile_title",u),o(r,"profile_description",c),o(r,"profile_url",m),o(r,"show_website",f),r)),e.props.setAttributes(o({profileContent:c,profileName:p,profileTitle:u,profileURL:m,profileImgID:s,profileImgURL:l,showWebsite:f,showSocialMedia:!0},"profileName",h.display_name))})},e.on_user_change=function(t){var r=e.state.users[t],n="",i=0,a="";r.has_profile_picture?(n=e.state.users[t].profile_pictures.thumbnail,i=e.state.users[t].profile_picture_id):(n=mpp_gutenberg.mystery_man,i=0);var l=e.state.users[t].description;void 0===l&&(l=""),a=e.state.users[t].display_name,e.props.setAttributes(o({profileName:a,profileContent:l,profileTitle:"",profileURL:e.state.users[t].permalink,profileImgURL:n,tabbedAuthorSubHeading:"",tabbedAuthorProfileTitle:"",socialFacebook:"",socialGitHub:"",socialInstagram:"",socialLinkedIn:"",socialPinterest:"",socialTwitter:"",socialWordPress:"",socialYouTube:""},"profileName",e.state.users[t].display_name)),e.setState({profile_name_unfiltered:e.state.users[t].display_name,profile_name:a,profile_description:l,profile_title:"",profile_picture:n,profile_picture_id:i,active_user:t,profile_url:e.state.users[t].permalink,socialFacebook:"",socialGitHub:"",socialInstagram:"",socialLinkedIn:"",socialPinterest:"",socialTwitter:"",socialWordPress:"",socialYouTube:""}),e.getLatestPosts()},e.getLatestPosts=function(){e.setState({loadingLatestPosts:!0});s.a.post(mpp_gutenberg.rest_url+"/get_posts",{user_id:e.state.active_user},{headers:{"X-WP-Nonce":mpp_gutenberg.nonce}}).then(function(t){var r=t.data,o=r.map(function(e){return wp.element.createElement("li",{key:e.ID},wp.element.createElement("a",{href:e.permalink},e.post_title))});e.setState({loadingLatestPosts:!1,latestPosts:o})})},e.componentDidMount=function(){e.get_users()},e.handleImageChange=function(t,r){e.setState({profile_picture:r,profile_picture_id:t})},e.onChangeName=function(t){e.setState({profile_name:t})},e.onChangeTitle=function(t){e.setState({profile_title:t})},e.onChangeProfileText=function(t){e.setState({profile_description:t})},e.onThemeChange=function(t){e.setState({theme:t})},e.handleFacebookChange=function(t){e.setState({socialFacebook:t})},e.handleYouTubeChange=function(t){e.setState({socialYouTube:t})},e.handleGitHubChange=function(t){e.setState({socialGitHub:t})},e.handleLinkedInChange=function(t){e.setState({socialLinkedIn:t})},e.handleTwitterChange=function(t){e.setState({socialTwitter:t})},e.handleWordPressChange=function(t){e.setState({socialWordPress:t})},e.handleWebsiteChange=function(t){e.setState({website:t}),""!==t&&e.props.setAttributes({showWebsite:!0})},e.handleInstagramChange=function(t){e.setState({socialInstagram:t})},e.handlePinterestChange=function(t){e.setState({socialPinterest:t})},e.handleSocialMediaChange=function(t){e.setState({showSocialMedia:t}),e.props.setAttributes({showSocialMedia:t})},e.handleSocialMediaOptionChange=function(t){e.setState({socialMediaOptions:t})},e.onChangeTabbedProfileText=function(t){e.setState({tabbedAuthorProfile:t})},e.onChangeTabbedSubHeading=function(t){e.setState({tabbedAuthorSubHeading:t})},e.onChangeActiveProfileTab=function(){e.setState({activeTab:"profile"})},e.onChangeActivePostTab=function(){e.setState({activeTab:"latest",loadingLatestPosts:!0}),e.getLatestPosts()},e.onChangetabbedAuthorProfile=function(t){e.setState({tabbedAuthorProfile:t})},e.onChangetabbedAuthorProfileHeading=function(t){e.setState({tabbedAuthorProfileHeading:t})},e.onChangetabbedAuthorLatestPosts=function(t){e.setState({tabbedAuthorLatestPosts:t})},e.onChangeProfileTabColor=function(t){e.setState({profileTabColor:t}),e.props.setAttributes({profileTabColor:t})},e.onChangePostsTabColor=function(t){e.setState({profileTabPostsColor:t}),e.props.setAttributes({profileTabPostsColor:t})},e.onChangePostsTabHeadlineColor=function(t){e.setState({profileTabHeadlineColor:t}),e.props.setAttributes({profileTabHeadlineColor:t})},e.onChangeProfileTabPostColorText=function(t){e.setState({profileTabPostsTextColor:t}),e.props.setAttributes({profileTabPostsTextColor:t})},e.onChangeProfileTabHeadlineColorText=function(t){e.setState({profileTabHeadlineTextColor:t}),e.props.setAttributes({profileTabHeadlineTextColor:t})},e.onChangeProfileTabColorText=function(t){e.setState({profileTabTextColor:t}),e.props.setAttributes({profileTabTextColor:t})},e.onLatestPostsChange=function(t){e.setState({profileLatestPostsOptionsValue:t})},e.onCompactAlignmentChange=function(t){e.setState({profileCompactAlignment:t})};var r=Array();return r.push({value:"regular",label:__("Regular","metronet-profile-picture")}),r.push({value:"profile",label:__("Profile","metronet-profile-picture")}),r.push({value:"tabbed",label:__("Tabbed","metronet-profile-picture")}),r.push({value:"compact",label:__("Compact","metronet-profile-picture")}),e.state={loading:!0,users:!1,user_list:!1,profile_picture:e.props.attributes.profileImgURL,profile_picture_id:e.props.attributes.profileImgID,active_user:!1,profile_description:"",profile_name:"",profile_name_unfiltered:"",profile_title:"",show_website:e.props.attributes.showWebsite,theme:e.props.attributes.theme,themes:r,socialFacebook:e.props.attributes.socialFacebook,socialGitHub:e.props.attributes.socialGitHub,socialLinkedIn:e.props.attributes.socialLinkedIn,socialPinterest:e.props.attributes.socialPinterest,socialTwitter:e.props.attributes.socialTwitter,socialWordPress:e.props.attributes.socialWordPress,socialYouTube:e.props.attributes.socialYouTube,socialInstagram:e.props.attributes.socialInstagram,website:e.props.attributes.website,showSocialMedia:!0,socialMediaOptions:e.props.attributes.socialMediaOptions,socialMediaColors:e.props.attributes.socialMediaColors,tabbedAuthorProfile:e.props.attributes.tabbedAuthorProfile,tabbedAuthorLatestPosts:e.props.attributes.tabbedAuthorLatestPosts,tabbedAuthorSubHeading:e.props.attributes.tabbedAuthorSubHeading,tabbedAuthorProfileHeading:e.props.attributes.tabbedAuthorProfileHeading,activeTab:"profile",loadingLatestPosts:!0,latestPosts:{},profileTabColor:e.props.attributes.profileTabColor,profileTabHeadlineColor:e.props.attributes.profileTabHeadlineColor,profileTabPostsColor:e.props.attributes.profileTabPostsColor,profileTabHeadlineTextColor:e.props.attributes.profileTabHeadlineTextColor,profileTabTextColor:e.props.attributes.profileTabTextColor,profileTabPostsTextColor:e.props.attributes.profileTabPostsTextColor,profileLatestPostsOptionsValue:e.props.attributes.profileLatestPostsOptionsValue,profileCompactAlignment:e.props.attributes.profileCompactAlignment},e}return a(t,e),u(t,[{key:"render",value:function(){var e=this,t=this.props,r=t.attributes,o=r.profileName,n=r.profileTitle,i=r.profileContent,a=r.profileAlignment,l=r.profileImgURL,s=r.profileImgID,p=r.profileURL,u=r.profileFontSize,m=r.buttonFontSize,f=r.headerFontSize,d=r.profileBackgroundColor,T=r.profileTextColor,k=r.profileAvatarShape,A=r.profileViewPostsBackgroundColor,I=r.profileViewPostsTextColor,L=r.showTitle,O=r.showName,V=r.showDescription,H=r.showViewPosts,R=r.showPostsWidth,M=(r.showSocialMedia,r.showWebsite),B=(r.theme,r.theme_list,r.socialFacebook,r.socialGitHub,r.socialLinkedIn,r.socialPinterest,r.socialTwitter,r.socialWordPress,r.socialYouTube,r.socialMediaColors),U=r.profileWebsiteBackgroundColor,D=r.profileWebsiteTextColor,F=r.padding,W=r.border,j=r.borderRounded,z=r.borderColor,q=r.profileLinkColor,Z=(r.tabbedAuthorProfile,r.tabbedAuthorSubHeading,r.tabbedAuthorProfileTitle),G=(r.profileLatestPostsOptionsValue,t.attributes,t.isSelected,t.editable,t.className,t.setAttributes);this.state.profile_pictures;s=this.state.profile_picture_id,l=this.state.profile_picture,o=this.state.profile_name,i=this.state.profile_description,n=this.state.profile_title,p=this.state.profile_url,R=""!==this.state.website&&this.props.attributes.showWebsite?"":"100%",G({showPostsWidth:R});var Y=function(e){return G({profileBackgroundColor:e})},X=function(e){return G({profileTextColor:e})},$=function(e){return G({profileViewPostsBackgroundColor:e})},J=function(e){return G({profileViewPostsTextColor:e})},K=function(e){return G({profileWebsiteBackgroundColor:e})},Q=function(e){return G({profileWebsiteTextColor:e})},ee=function(e){return G({socialMediaColors:e})},te=function(e){return G({borderColor:e})},re=function(e){return G({profileLinkColor:e})},oe=[{value:"square",label:__("Square","metronet-profile-picture")},{value:"round",label:__("Round","metronet-profile-picture")}],ne=[{value:"colors",label:__("Brand Colors","metronet-profile-picture")},{value:"custom",label:__("Custom","metronet-profile-picture")}],ie=[{value:"none",label:__("None","metronet-profile-picture")},{value:"white",label:__("White","metronet-profile-picture")},{value:"light",label:__("Light","metronet-profile-picture")},{value:"black",label:__("Black","metronet-profile-picture")},{value:"magenta",label:__("Magenta","metronet-profile-picture")},{value:"blue",label:__("Blue","metronet-profile-picture")},{value:"green",label:__("Green","metronet-profile-picture")}],ae=[{value:"left",label:__("Left","metronet-profile-picture")},{value:"center",label:__("Center","metronet-profile-picture")},{value:"right",label:__("Right","metronet-profile-picture")}],le="none",se="";return"center"===this.state.profileCompactAlignment&&(le="none",se="0 auto"),"left"===this.state.profileCompactAlignment&&(le="left",se="0"),"right"===this.state.profileCompactAlignment&&(le="right",se="0"),wp.element.createElement(h,null,this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(b,null,wp.element.createElement("div",null,wp.element.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",width:"125px",height:"125px",viewBox:"0 0 753.53 979.74"},wp.element.createElement("title",null,"upp"),wp.element.createElement("path",{d:"M806.37,185.9c0,40.27-30.49,72.9-68.11,72.9s-68.17-32.63-68.17-72.9S700.62,113,738.26,113,806.37,145.64,806.37,185.9Z",transform:"translate(-123.47 -11)",fill:"#4063ad"}),wp.element.createElement("path",{d:"M330.36,183.8c0,40.27-30.49,72.9-68.12,72.9s-68.17-32.63-68.17-72.9,30.52-72.87,68.17-72.87S330.36,143.56,330.36,183.8Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M331.3,888.13V698.21H329c-31.64,0-57.28-27.45-57.28-61.29V336.5a118.37,118.37,0,0,1,5.43-34.79H179.84c-31.94,0-56.37,31.57-56.37,56.34V601.46h48.32V888.13Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M388.59,636.92V990.74H611.88V636.92H671.5V336.5c0-30.63-27.64-69.57-69.6-69.57H398.56c-39.44,0-69.61,38.94-69.61,69.57V636.92Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M584.3,101c0,49.69-37.63,90-84,90S416.12,150.67,416.12,101s37.66-90,84.14-90S584.3,51.27,584.3,101Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M820.61,303.79H724.08a121.69,121.69,0,0,1,4.7,32.71V636.92c0,33.84-25.64,61.29-57.28,61.29h-2.33v192H828.7V603.54H877V360.16C877,335.36,854.62,303.79,820.61,303.79Z",transform:"translate(-123.47 -11)",fill:"#4063ad"})),wp.element.createElement("div",{className:"mpp-spinner"},wp.element.createElement(v,null))))),!this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(P,null,wp.element.createElement(g,{title:__("User Profile Settings","metronet-profile-picture")},wp.element.createElement(C,{label:__("Select a user","metronet-profile-picture"),value:this.state.active_user,options:this.state.user_list,onChange:function(t){e.on_user_change(t),G({user_id:Number(t)})}}),wp.element.createElement(C,{label:__("Select a theme","metronet-profile-picture"),value:this.state.theme,options:this.state.themes,onChange:function(t){e.onThemeChange(t),G({theme:t})}}),"compact"===this.state.theme&&wp.element.createElement(C,{label:__("Select an alignment","metronet-profile-picture"),value:this.state.profileCompactAlignment,options:ae,onChange:function(t){e.onCompactAlignmentChange(t),G({profileCompactAlignment:t})}}),wp.element.createElement(C,{label:__("Avatar Shape","metronet-profile-picture"),description:__("Choose between a round or square avatar shape.","metronet-profile-picture"),options:oe,value:k,onChange:function(t){return e.props.setAttributes({profileAvatarShape:t})}}),"tabbed"!==this.state.theme&&wp.element.createElement(E,{label:__("Website","metronet-profile-picture"),value:this.state.website,onChange:function(t){e.props.setAttributes({website:t}),e.handleWebsiteChange(t)}}),wp.element.createElement(_,{label:__("Show Name","metronet-profile-picture"),checked:O,onChange:function(){return e.props.setAttributes({showName:!O})}}),wp.element.createElement(_,{label:__("Show Title","metronet-profile-picture"),checked:L,onChange:function(){return e.props.setAttributes({showTitle:!L})}}),wp.element.createElement(_,{label:__("Show Description","metronet-profile-picture"),checked:V,onChange:function(){return e.props.setAttributes({showDescription:!V})}}),"tabbed"!==this.state.theme&&wp.element.createElement(h,null,wp.element.createElement(_,{label:__("Show View Posts","metronet-profile-picture"),checked:H,onChange:function(){return e.props.setAttributes({showViewPosts:!H})}}),wp.element.createElement(_,{label:__("Show Website","metronet-profile-picture"),checked:this.state.show_website,onChange:function(t){e.props.setAttributes({showWebsite:t}),e.setState({show_website:t})}})),wp.element.createElement(_,{label:__("Show Social Media","metronet-profile-picture"),checked:this.state.showSocialMedia,onChange:function(t){e.props.setAttributes({showSocialMedia:t}),e.handleSocialMediaChange(t)}})),"tabbed"===this.state.theme&&wp.element.createElement(g,{title:__("User Profile Settings","metronet-profile-picture")},wp.element.createElement(C,{label:__("Select a theme","metronet-profile-picture"),value:this.state.latestPostsTheme,options:{},onChange:function(t){e.on_user_change(t),G({user_id:Number(t)})}})),wp.element.createElement(g,{title:__("Colors","metronet-profile-picture"),initialOpen:!1},wp.element.createElement(x,{title:__("Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:d,onChange:Y,label:__("Background Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:T,onChange:X,label:__("Text Color","metronet-profile-picture")}]}),"profile"===this.state.theme&&wp.element.createElement(x,{title:__("Link Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:q,onChange:re,label:__("Link Color","metronet-profile-picture")}]}),"tabbed"===this.state.theme&&wp.element.createElement(h,null,wp.element.createElement(x,{title:__("Profile Tab Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabColor,onChange:this.onChangeProfileTabColor,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Tab Color Text","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabTextColor,onChange:this.onChangeProfileTabColorText,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Posts Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabPostsColor,onChange:this.onChangePostsTabColor,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Post Color Text","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabPostsTextColor,onChange:this.onChangeProfileTabPostColorText,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Headline Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabHeadlineColor,onChange:this.onChangePostsTabHeadlineColor,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Headline Color Text","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabHeadlineColorText,onChange:this.onChangeProfileTabHeadlineColorText,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(C,{label:__("Select a Post Theme","metronet-profile-picture"),value:this.state.profileLatestPostsOptionsValue,options:ie,onChange:function(t){e.onLatestPostsChange(t),G({profileLatestPostsOptionsValue:t})}})),"tabbed"!==this.state.theme&&"profile"!==this.state.theme&&wp.element.createElement(h,null,wp.element.createElement(x,{title:__("View Posts Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:A,onChange:$,label:__("View Posts Background","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("View Posts Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:I,onChange:J,label:__("View Posts Text Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Website Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:U,onChange:K,label:__("View Website Background","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("View Website Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:D,onChange:Q,label:__("View Website Text Color","metronet-profile-picture")}]}))),wp.element.createElement(g,{title:__("Spacing and Font Settings","metronet-profile-picture"),initialOpen:!1},wp.element.createElement(w,{label:__("Header Font Size","metronet-profile-picture"),value:f,onChange:function(t){return e.props.setAttributes({headerFontSize:t})},min:14,max:32,step:1}),wp.element.createElement(w,{label:__("Font Size","metronet-profile-picture"),value:u,onChange:function(t){return e.props.setAttributes({profileFontSize:t})},min:14,max:24,step:1}),"tabbed"!==this.state.theme&&wp.element.createElement(w,{label:__("Button Size","metronet-profile-picture"),value:m,onChange:function(t){return e.props.setAttributes({buttonFontSize:t})},min:10,max:24,step:1}),wp.element.createElement(w,{label:__("Padding","metronet-profile-picture"),value:F,onChange:function(t){return e.props.setAttributes({padding:t})},min:0,max:60,step:1}),wp.element.createElement(w,{label:__("Border","metronet-profile-picture"),value:W,onChange:function(t){return e.props.setAttributes({border:t})},min:0,max:10,step:1}),wp.element.createElement(w,{label:__("Border Rounded","metronet-profile-picture"),value:j,onChange:function(t){return e.props.setAttributes({borderRounded:t})},min:0,max:10,step:1}),wp.element.createElement(x,{title:__("Border Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:z,onChange:te,label:__("Border Color","metronet-profile-picture")}]})),wp.element.createElement(g,{title:__("Social Media Settings","metronet-profile-picture"),initialOpen:!1},wp.element.createElement(C,{label:__("Social Media Colors","metronet-profile-picture"),value:this.state.socialMediaOptions,options:ne,onChange:function(t){G({socialMediaOptions:t}),e.handleSocialMediaOptionChange(t)}}),"custom"===this.state.socialMediaOptions&&wp.element.createElement(x,{title:__("Social Media Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:B,onChange:ee,label:__("Social Media Color","metronet-profile-picture")}]}),wp.element.createElement(E,{label:__("Facebook","metronet-profile-picture"),value:this.state.socialFacebook,onChange:function(t){e.props.setAttributes({socialFacebook:t}),e.handleFacebookChange(t)}}),wp.element.createElement(E,{label:__("Twitter","metronet-profile-picture"),value:this.state.socialTwitter,onChange:function(t){e.props.setAttributes({socialTwitter:t}),e.handleTwitterChange(t)}}),wp.element.createElement(E,{label:__("Instagram","metronet-profile-picture"),value:this.state.socialInstagram,onChange:function(t){e.props.setAttributes({socialInstagram:t}),e.handleInstagramChange(t)}}),wp.element.createElement(E,{label:__("LinkedIn","metronet-profile-picture"),value:this.state.socialLinkedIn,onChange:function(t){e.props.setAttributes({socialLinkedIn:t}),e.handleLinkedInChange(t)}}),wp.element.createElement(E,{label:__("YouTube","metronet-profile-picture"),value:this.state.socialYouTube,onChange:function(t){e.props.setAttributes({socialYouTube:t}),e.handleYouTubeChange(t)}}),wp.element.createElement(E,{label:__("GitHub","metronet-profile-picture"),value:this.state.socialGitHub,onChange:function(t){e.props.setAttributes({socialGitHub:t}),e.handleGitHubChange(t)}}),wp.element.createElement(E,{label:__("Pinterest","metronet-profile-picture"),value:this.state.socialPinterest,onChange:function(t){e.props.setAttributes({socialPinterest:t}),e.handlePinterestChange(t)}}),wp.element.createElement(E,{label:__("WordPress","metronet-profile-picture"),value:this.state.socialWordPress,onChange:function(t){e.props.setAttributes({socialWordPress:t}),e.handleWordPressChange(t)}}))),"tabbed"!==this.state.theme&&wp.element.createElement("div",{className:c()("mpp-enhanced-profile-wrap",this.state.theme,a,k,"mpp-block-profile"),style:{padding:F+"px",border:W+"px solid "+z,borderRadius:j+"px",backgroundColor:d,color:T,float:le,margin:se}},"regular"===this.state.theme&&wp.element.createElement(h,null,wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap","mt-font-size-"+u)},wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),G({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),wp.element.createElement("div",{className:"mpp-content-wrap"},O&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),G({profileName:t})}}),L&&wp.element.createElement(N,{tagName:"p",placeholder:__("Add title","atomic-blocks"),value:n,className:"mpp-profile-title",style:{color:T},onChange:function(t){e.onChangeTitle(t),G({profileTitle:t})}}),V&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),G({profileContent:t})}}))),p&&!!p.length&&wp.element.createElement("div",{className:"mpp-gutenberg-view-posts",style:{width:R}},H&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:A,color:I,width:R,fontSize:m+"px"}},wp.element.createElement("a",{href:p,style:{backgroundColor:A,color:I}},__("View Posts","metronet-profile-picture"))),""!=this.state.website&&M&&wp.element.createElement("div",{className:"mpp-profile-view-website",style:{backgroundColor:U,color:D,fontSize:m+"px"}},wp.element.createElement("a",{href:this.state.website,style:{backgroundColor:U,color:D}},__("View Website","metronet-profile-picture"))))),"profile"===this.state.theme&&wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap","mt-font-size-"+u)},O&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),G({profileName:t})}}),wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),G({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),V&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),G({profileContent:t})}}),wp.element.createElement("div",{className:"mpp-profile-meta",style:{fontSize:m+"px"}},H&&wp.element.createElement("div",{className:"mpp-profile-link alignleft"},wp.element.createElement("a",{href:this.state.profile_url,style:{color:q}},__("View all posts by","metronet-profile-picture")," ",this.state.profile_name_unfiltered)),""!=this.state.website&&M&&wp.element.createElement("div",{className:"mpp-profile-link alignright"},wp.element.createElement("a",{href:this.state.website,style:{color:q}},__("Website","metronet-profile-picture"))))),"compact"===this.state.theme&&wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap","mt-font-size-"+u)},O&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),G({profileName:t})}}),wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),G({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),V&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),G({profileContent:t})}}),wp.element.createElement("div",{className:"mpp-compact-meta"},H&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:A,color:I,width:"90%",margin:"0 auto 10px auto",fontSize:m+"px"}},wp.element.createElement("a",{href:p,style:{backgroundColor:A,color:I}},__("View Posts","metronet-profile-picture"))),""!=this.state.website&&M&&wp.element.createElement("div",{className:"mpp-profile-view-website",style:{backgroundColor:U,color:D,fontSize:m+"px",width:"90%",margin:"0 auto"}},wp.element.createElement("a",{href:this.state.website,style:{backgroundColor:U,color:D}},__("View Website","metronet-profile-picture"))))),1==this.state.showSocialMedia&&("regular"===this.state.theme||"compact"===this.state.theme||"profile"===this.state.theme)&&wp.element.createElement("div",{className:"mpp-social"},""!=this.state.socialFacebook&&wp.element.createElement("a",{href:this.state.socialFacebook},wp.element.createElement("svg",{className:"icon icon-facebook",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#facebook"}))),""!=this.state.socialTwitter&&wp.element.createElement("a",{href:this.state.socialTwitter},wp.element.createElement("svg",{className:"icon icon-twitter",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#twitter"}))),""!=this.state.socialInstagram&&wp.element.createElement("a",{href:this.state.socialInstagram},wp.element.createElement("svg",{className:"icon icon-instagram",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#instagram"}))),""!=this.state.socialPinterest&&wp.element.createElement("a",{href:this.state.socialPinterest},wp.element.createElement("svg",{className:"icon icon-pinterest",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#pinterest"}))),""!=this.state.socialLinkedIn&&wp.element.createElement("a",{href:this.state.socialLinkedIn},wp.element.createElement("svg",{className:"icon icon-linkedin",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#linkedin"}))),""!=this.state.socialYouTube&&wp.element.createElement("a",{href:this.state.socialYouTube},wp.element.createElement("svg",{className:"icon icon-youtube",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#youtube"}))),""!=this.state.socialGitHub&&wp.element.createElement("a",{href:this.state.socialGitHub},wp.element.createElement("svg",{className:"icon icon-github",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#github"}))),""!=this.state.socialWordPress&&wp.element.createElement("a",{href:this.state.socialWordPress},wp.element.createElement("svg",{className:"icon icon-wordpress",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#wordpress"}))))),"tabbed"===this.state.theme&&wp.element.createElement(h,null,wp.element.createElement("div",{className:c()("mpp-author-tabbed",this.state.theme,a,k,"mpp-block-profile")},wp.element.createElement("ul",{className:"mpp-author-tabs"},wp.element.createElement("li",{className:c()("mpp-tab-profile","profile"===this.state.activeTab?"active":""),onClick:this.onChangeActiveProfileTab,style:{backgroundColor:this.state.profileTabColor,color:this.state.profileTabTextColor}},wp.element.createElement(N,{tagName:"span",placeholder:__("Add tab name.","metronet-profile-picture"),value:this.state.tabbedAuthorProfile,formattingControls:[],onChange:function(t){e.onChangetabbedAuthorProfile(t),G({tabbedAuthorProfile:t})}})),wp.element.createElement("li",{className:c()("mpp-tab-posts","latest"===this.state.activeTab?"active":""),onClick:this.onChangeActivePostTab,style:{backgroundColor:this.state.profileTabPostsColor,color:this.state.profileTabPostsTextColor}},wp.element.createElement(N,{tagName:"span",placeholder:__("Add tab name.","metronet-profile-picture"),value:this.state.tabbedAuthorLatestPosts,formattingControls:[],onChange:function(t){e.onChangetabbedAuthorLatestPosts(t),G({tabbedAuthorLatestPosts:t})}}))),wp.element.createElement("div",{className:"mpp-tab-wrapper",style:{padding:F+"px",border:W+"px solid "+z,borderRadius:j+"px",backgroundColor:d,color:T}},"profile"===this.state.activeTab&&wp.element.createElement(h,null,wp.element.createElement("div",{className:"mpp-author-social-wrapper"},wp.element.createElement("div",{className:"mpp-author-heading"},wp.element.createElement(N,{tagName:"div",className:"mpp-author-profile-heading",value:this.state.tabbedAuthorProfileHeading,formattingControls:[],onChange:function(t){e.onChangetabbedAuthorProfileHeading(t),G({profileTabHeadlineTextColor:t})},style:{backgroundColor:this.state.profileTabHeadlineColor,color:this.state.profileTabHeadlineTextColor}})),this.state.showSocialMedia&&wp.element.createElement("div",{className:"mpp-author-social"},wp.element.createElement("div",{className:"mpp-social"},""!=this.state.socialFacebook&&wp.element.createElement("a",{href:this.state.socialFacebook},wp.element.createElement("svg",{className:"icon icon-facebook",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#facebook"}))),""!=this.state.socialTwitter&&wp.element.createElement("a",{href:this.state.socialTwitter},wp.element.createElement("svg",{className:"icon icon-twitter",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#twitter"}))),""!=this.state.socialInstagram&&wp.element.createElement("a",{href:this.state.socialInstagram},wp.element.createElement("svg",{className:"icon icon-instagram",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#instagram"}))),""!=this.state.socialPinterest&&wp.element.createElement("a",{href:this.state.socialPinterest},wp.element.createElement("svg",{className:"icon icon-pinterest",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#pinterest"}))),""!=this.state.socialLinkedIn&&wp.element.createElement("a",{href:this.state.socialLinkedIn},wp.element.createElement("svg",{className:"icon icon-linkedin",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#linkedin"}))),""!=this.state.socialYouTube&&wp.element.createElement("a",{href:this.state.socialYouTube},wp.element.createElement("svg",{className:"icon icon-youtube",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#youtube"}))),""!=this.state.socialGitHub&&wp.element.createElement("a",{href:this.state.socialGitHub},wp.element.createElement("svg",{className:"icon icon-github",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#github"}))),""!=this.state.socialWordPress&&wp.element.createElement("a",{href:this.state.socialWordPress},wp.element.createElement("svg",{className:"icon icon-wordpress",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?B:""}},wp.element.createElement("use",{href:"#wordpress"})))))),wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),G({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}),wp.element.createElement(N,{tagName:"div",className:"mpp-author-profile-sub-heading",placeholder:__("Add profile description...","metronet-profile-picture"),value:this.state.tabbedAuthorSubHeading,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeTabbedSubHeading(t),G({tabbedAuthorSubHeading:t})}}))),wp.element.createElement("div",{className:"mpp-tabbed-profile-information"},L&&wp.element.createElement(N,{tagName:"div",className:"mpp-author-profile-title",placeholder:__("Add profile title...","metronet-profile-picture"),value:Z,formattingControls:["bold","italic","strikethrough","link"],onChange:function(e){G({tabbedAuthorProfileTitle:e})}}),O&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),G({profileName:t})}}),V&&wp.element.createElement(N,{tagName:"div",className:c()("mpp-profile-text","mt-font-size-"+u),placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),G({profileContent:t})}}))),"latest"===this.state.activeTab&&wp.element.createElement(h,null,this.state.loadingLatestPosts&&wp.element.createElement(h,null,wp.element.createElement("div",null,wp.element.createElement("div",{className:"mpp-spinner"},wp.element.createElement(v,null)))),!this.state.loadingLatestPosts&&wp.element.createElement(h,null,wp.element.createElement("ul",{className:c()("mpp-author-tab-content",this.state.profileLatestPostsOptionsValue)},this.state.latestPosts))))))))}}]),t}(f);t.a=k},function(e,t,r){"use strict";function o(e){var t=new a(e),r=i(a.prototype.request,t);return n.extend(r,a.prototype,t),n.extend(r,t),r}var n=r(0),i=r(4),a=r(16),l=r(1),s=o(l);s.Axios=a,s.create=function(e){return o(n.merge(l,e))},s.Cancel=r(8),s.CancelToken=r(30),s.isCancel=r(7),s.all=function(e){return Promise.all(e)},s.spread=r(31),e.exports=s,e.exports.default=s},function(e,t){e.exports=function(e){return null!=e&&null!=e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";function o(e){this.defaults=e,this.interceptors={request:new a,response:new a}}var n=r(1),i=r(0),a=r(25),l=r(26);o.prototype.request=function(e){"string"===typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),e=i.merge(n,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[l,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},i.forEach(["delete","get","head","options"],function(e){o.prototype[e]=function(t,r){return this.request(i.merge(r||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){o.prototype[e]=function(t,r,o){return this.request(i.merge(o||{},{method:e,url:t,data:r}))}}),e.exports=o},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function n(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(u===clearTimeout)return clearTimeout(e);if((u===o||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}function a(){d&&f&&(d=!1,f.length?h=f.concat(h):g=-1,h.length&&l())}function l(){if(!d){var e=n(a);d=!0;for(var t=h.length;t;){for(f=h,h=[];++g<t;)f&&f[g].run();g=-1,t=h.length}f=null,d=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function p(){}var c,u,m=e.exports={};!function(){try{c="function"===typeof setTimeout?setTimeout:r}catch(e){c=r}try{u="function"===typeof clearTimeout?clearTimeout:o}catch(e){u=o}}();var f,h=[],d=!1,g=-1;m.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new s(e,t)),1!==h.length||d||n(l)},s.prototype.run=function(){this.fun.apply(null,this.array)},m.title="browser",m.browser=!0,m.env={},m.argv=[],m.version="",m.versions={},m.on=p,m.addListener=p,m.once=p,m.off=p,m.removeListener=p,m.removeAllListeners=p,m.emit=p,m.prependListener=p,m.prependOnceListener=p,m.listeners=function(e){return[]},m.binding=function(e){throw new Error("process.binding is not supported")},m.cwd=function(){return"/"},m.chdir=function(e){throw new Error("process.chdir is not supported")},m.umask=function(){return 0}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t){o.forEach(e,function(r,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[o])})}},function(e,t,r){"use strict";var o=r(6);e.exports=function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(o("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,o,n){return e.config=t,r&&(e.code=r),e.request=o,e.response=n,e}},function(e,t,r){"use strict";function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var n=r(0);e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var a=[];n.forEach(t,function(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))}))}),i=a.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,r){"use strict";var o=r(0),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,a={};return e?(o.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=o.trim(e.substr(0,i)).toLowerCase(),r=o.trim(e.substr(i+1)),t){if(a[t]&&n.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}}),a):a}},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");return t=e(window.location.href),function(r){var n=o.isString(r)?e(r):r;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?function(){return{write:function(e,t,r,n,i,a){var l=[];l.push(e+"="+encodeURIComponent(t)),o.isNumber(r)&&l.push("expires="+new Date(r).toGMTString()),o.isString(n)&&l.push("path="+n),o.isString(i)&&l.push("domain="+i),!0===a&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";function o(){this.handlers=[]}var n=r(0);o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},function(e,t,r){"use strict";function o(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var n=r(0),i=r(27),a=r(7),l=r(1),s=r(28),p=r(29);e.exports=function(e){return o(e),e.baseURL&&!s(e.url)&&(e.url=p(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||l.adapter)(e).then(function(t){return o(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(o(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t,r){return o.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}var n=r(8);o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}var l=r(3),s=r.n(l),p=r(2),c=r.n(p),u=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),m=wp.element,f=m.Component,h=m.Fragment,__=wp.i18n.__,d=wp.components,g=d.PanelBody,b=d.Placeholder,w=(d.QueryControls,d.RangeControl),C=d.SelectControl,v=d.Spinner,E=(d.TextControl,d.ToggleControl),_=(d.Toolbar,d.withAPIData,d.ColorPalette,d.Button),y=wp.editor,T=y.InspectorControls,P=y.BlockControls,S=y.MediaUpload,N=y.RichText,x=y.AlignmentToolbar,k=y.PanelColorSettings,A=function(e){function t(){n(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.get_users=function(){s.a.post(mpp_gutenberg.rest_url+"/get_users",{},{headers:{"X-WP-Nonce":mpp_gutenberg.nonce}}).then(function(t){var r,n=Array(),i=Array(),a=0,l="",s=0,p="",c="",u="",m="";$.each(t.data,function(e,t){n[t.ID]={profile_pictures:t.profile_pictures,has_profile_picture:t.has_profile_picture,display_name:t.display_name,description:t.description,is_user_logged_in:t.is_user_logged_in,profile_picture_id:t.profile_picture_id,default_image:t.default_image,permalink:t.permalink},t.is_user_logged_in&&(a=t.ID),i.push({value:t.ID,label:t.display_name})}),0!==e.props.attributes.user_id&&(a=e.props.attributes.user_id);var f=n[a];f.has_profile_picture?(l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:f.profile_pictures.thumbnail,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:f.profile_picture_id,p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:f.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",m=f.permalink,c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:f.description):(p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:f.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:f.description,l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:f.default_image,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:0,m=f.permalink),void 0==c&&(c=""),e.setState((r={loading:!1,users:n,active_user:a,user_list:i,profile_picture:l,profile_picture_id:s},o(r,"active_user",a),o(r,"profile_name",p),o(r,"profile_title",u),o(r,"profile_description",c),o(r,"profile_url",m),r)),e.props.setAttributes({profileContent:c,profileName:p,profileTitle:u,profileURL:m,profileImgID:s,profileImgURL:l})})},e.on_user_change=function(t){var r=e.state.users[t],o="",n=0;r.has_profile_picture?(o=e.state.users[t].profile_pictures.thumbnail,n=e.state.users[t].profile_picture_id):(o=mpp_gutenberg.mystery_man,n=0);var i=e.state.users[t].description;void 0===i&&(i=""),e.props.setAttributes({profileName:e.state.users[t].display_name,profileContent:i,profileTitle:"",profileURL:e.state.users[t].permalink,profileImgURL:o}),e.setState({profile_name:e.state.users[t].display_name,profile_description:i,profile_title:"",profile_picture:o,profile_picture_id:n,active_user:t,profile_url:e.state.users[t].permalink})},e.componentDidMount=function(){e.get_users()},e.handleImageChange=function(t,r){e.setState({profile_picture:r,profile_picture_id:t})},e.onChangeName=function(t){e.setState({profile_name:t})},e.onChangeTitle=function(t){e.setState({profile_title:t})},e.onChangeProfileText=function(t){e.setState({profile_description:t})},e.state={loading:!0,users:!1,user_list:!1,profile_picture:!1,profile_picture_id:0,active_user:!1,profile_description:"",profile_name:"",profile_title:""},e}return a(t,e),u(t,[{key:"render",value:function(){var e=this,t=this.props,r=t.attributes,o=r.profileName,n=r.profileTitle,i=r.profileContent,a=r.profileAlignment,l=r.profileImgURL,s=r.profileImgID,p=r.profileURL,u=r.profileFontSize,m=r.profileBackgroundColor,f=r.profileTextColor,d=r.profileAvatarShape,y=r.profileViewPostsBackgroundColor,A=r.profileViewPostsTextColor,I=r.showTitle,L=r.showName,O=r.showDescription,V=r.showViewPosts,H=(t.attributes,t.isSelected,t.editable,t.className,t.setAttributes);this.state.profile_pictures;s=this.state.profile_picture_id,l=this.state.profile_picture,o=this.state.profile_name,i=this.state.profile_description,n=this.state.profile_title,p=this.state.profile_url;var R=function(e){return H({profileBackgroundColor:e})},M=function(e){return H({profileTextColor:e})},B=function(e){return H({profileViewPostsBackgroundColor:e})},U=function(e){return H({profileViewPostsTextColor:e})},D=[{value:"square",label:__("Square","metronet-profile-picture")},{value:"round",label:__("Round","metronet-profile-picture")}];return wp.element.createElement(h,null,this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(b,null,__("Loading...","metronet-profile-picture"),wp.element.createElement(v,null))),!this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(T,null,wp.element.createElement(g,{title:__("User Profile Settings","metronet-profile-picture")},wp.element.createElement(C,{label:__("Select a user","metronet-profile-picture"),value:this.state.active_user,options:this.state.user_list,onChange:function(t){e.on_user_change(t),H({user_id:Number(t)})}}),wp.element.createElement(w,{label:__("Font Size","metronet-profile-picture"),value:u,onChange:function(t){return e.props.setAttributes({profileFontSize:t})},min:14,max:24,step:1}),wp.element.createElement(C,{label:__("Avatar Shape","metronet-profile-picture"),description:__("Choose between a round or square avatar shape.","metronet-profile-picture"),options:D,value:d,onChange:function(t){return e.props.setAttributes({profileAvatarShape:t})}}),wp.element.createElement(k,{title:__("Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:m,onChange:R,label:__("Background Color","metronet-profile-picture")}]}),wp.element.createElement(k,{title:__("Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:f,onChange:M,label:__("Text Color","metronet-profile-picture")}]}),wp.element.createElement(k,{title:__("View Posts Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:y,onChange:B,label:__("View Posts Background","metronet-profile-picture")}]}),wp.element.createElement(k,{title:__("View Posts Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:A,onChange:U,label:__("View Posts Text Color","metronet-profile-picture")}]}),wp.element.createElement(E,{label:__("Show Name","metronet-profile-picture"),checked:L,onChange:function(){return e.props.setAttributes({showName:!L})}}),wp.element.createElement(E,{label:__("Show Title","metronet-profile-picture"),checked:I,onChange:function(){return e.props.setAttributes({showTitle:!I})}}),wp.element.createElement(E,{label:__("Show Description","metronet-profile-picture"),checked:O,onChange:function(){return e.props.setAttributes({showDescription:!O})}}),wp.element.createElement(E,{label:__("Show View Posts","metronet-profile-picture"),checked:V,onChange:function(){return e.props.setAttributes({showViewPosts:!V})}}))),wp.element.createElement(P,{key:"controls"},wp.element.createElement(x,{value:a,onChange:function(e){return H({profileAlignment:e})}})),wp.element.createElement("div",{className:c()("mpp-profile-wrap","legacy",a,d,"mt-font-size-"+u,"mpp-block-profile"),style:{backgroundColor:m,color:f}},wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap")},wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),H({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(_,{onClick:t},s?wp.element.createElement("img",{class:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),wp.element.createElement("div",{className:"mpp-content-wrap"},L&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:f},onChange:function(t){e.onChangeName(t),H({profileName:t})}}),I&&wp.element.createElement(N,{tagName:"p",placeholder:__("Add title","atomic-blocks"),value:n,className:"mpp-profile-title",style:{color:f},onChange:function(t){e.onChangeTitle(t),H({profileTitle:t})}}),O&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),H({profileContent:t})}}))),p&&!!p.length&&wp.element.createElement("div",{className:"mpp-gutenberg-view-posts"},V&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:y,color:A}},wp.element.createElement("a",{href:p,style:{backgroundColor:y,color:A}},__("View Posts","metronet-profile-picture")))))))}}]),t}(f);t.a=A}]);
1
+ !function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(e,t,r){"use strict";function o(e){return"[object Array]"===T.call(e)}function n(e){return"[object ArrayBuffer]"===T.call(e)}function i(e){return"undefined"!==typeof FormData&&e instanceof FormData}function a(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function l(e){return"string"===typeof e}function s(e){return"number"===typeof e}function p(e){return"undefined"===typeof e}function c(e){return null!==e&&"object"===typeof e}function u(e){return"[object Date]"===T.call(e)}function m(e){return"[object File]"===T.call(e)}function f(e){return"[object Blob]"===T.call(e)}function h(e){return"[object Function]"===T.call(e)}function d(e){return c(e)&&h(e.pipe)}function g(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams}function b(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function w(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function C(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}function v(){function e(e,r){"object"===typeof t[r]&&"object"===typeof e?t[r]=v(t[r],e):t[r]=e}for(var t={},r=0,o=arguments.length;r<o;r++)C(arguments[r],e);return t}function E(e,t,r){return C(t,function(t,o){e[o]=r&&"function"===typeof t?_(t,r):t}),e}var _=r(4),y=r(15),T=Object.prototype.toString;e.exports={isArray:o,isArrayBuffer:n,isBuffer:y,isFormData:i,isArrayBufferView:a,isString:l,isNumber:s,isObject:c,isUndefined:p,isDate:u,isFile:m,isBlob:f,isFunction:h,isStream:d,isURLSearchParams:g,isStandardBrowserEnv:w,forEach:C,merge:v,extend:E,trim:b}},function(e,t,r){"use strict";(function(t){function o(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var n=r(0),i=r(18),a={"Content-Type":"application/x-www-form-urlencoded"},l={adapter:function(){var e;return"undefined"!==typeof XMLHttpRequest?e=r(5):"undefined"!==typeof t&&(e=r(5)),e}(),transformRequest:[function(e,t){return i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(e){l.headers[e]={}}),n.forEach(["post","put","patch"],function(e){l.headers[e]=n.merge(a)}),e.exports=l}).call(t,r(17))},function(e,t,r){var o,n;!function(){"use strict";function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var n=typeof o;if("string"===n||"number"===n)e.push(o);else if(Array.isArray(o)&&o.length){var a=r.apply(null,o);a&&e.push(a)}else if("object"===n)for(var l in o)i.call(o,l)&&o[l]&&e.push(l)}}return e.join(" ")}var i={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(r.default=r,e.exports=r):(o=[],void 0!==(n=function(){return r}.apply(t,o))&&(e.exports=n))}()},function(e,t,r){e.exports=r(14)},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];return e.apply(t,r)}}},function(e,t,r){"use strict";var o=r(0),n=r(19),i=r(21),a=r(22),l=r(23),s=r(6);e.exports=function(e){return new Promise(function(t,p){var c=e.data,u=e.headers;o.isFormData(c)&&delete u["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",h=e.auth.password||"";u.Authorization="Basic "+btoa(f+":"+h)}if(m.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),m.timeout=e.timeout,m.onreadystatechange=function(){if(m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in m?a(m.getAllResponseHeaders()):null,o=e.responseType&&"text"!==e.responseType?m.response:m.responseText,i={data:o,status:m.status,statusText:m.statusText,headers:r,config:e,request:m};n(t,p,i),m=null}},m.onerror=function(){p(s("Network Error",e,null,m)),m=null},m.ontimeout=function(){p(s("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",m)),m=null},o.isStandardBrowserEnv()){var d=r(24),g=(e.withCredentials||l(e.url))&&e.xsrfCookieName?d.read(e.xsrfCookieName):void 0;g&&(u[e.xsrfHeaderName]=g)}if("setRequestHeader"in m&&o.forEach(u,function(e,t){"undefined"===typeof c&&"content-type"===t.toLowerCase()?delete u[t]:m.setRequestHeader(t,e)}),e.withCredentials&&(m.withCredentials=!0),e.responseType)try{m.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"===typeof e.onDownloadProgress&&m.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){m&&(m.abort(),p(e),m=null)}),void 0===c&&(c=null),m.send(c)})}},function(e,t,r){"use strict";var o=r(20);e.exports=function(e,t,r,n,i){var a=new Error(e);return o(a,t,r,n,i)}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";function o(e){this.message=e}o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(10)},function(e,t,r){"use strict";var o=r(11),n=(r.n(o),r(12)),i=(r.n(n),r(13)),a=r(32),l=r(2),s=r.n(l),__=wp.i18n.__,p=wp.blocks.registerBlockType,c=wp.element,u=(c.Component,c.Fragment),m=wp.editor.RichText,f={profileName:{type:"string",default:""},profileTitle:{type:"string",default:""},profileContent:{type:"string",default:""},profileAlignment:{type:"string"},profileImgURL:{type:"string",source:"attribute",attribute:"src",selector:"img",default:""},profileImgID:{type:"number",default:""},profileURL:{type:"string",default:""},profileBackgroundColor:{type:"string",default:"#f2f2f2"},profileTextColor:{type:"string",default:"#32373c"},profileViewPostsBackgroundColor:{type:"string",default:"#cf6d38"},profileViewPostsTextColor:{type:"string",default:"#FFFFFF"},profileViewPostsWidth:{type:"number",default:100},profileFontSize:{type:"number",default:18},profileAvatarShape:{type:"string",default:"square"},showName:{type:"bool",default:!0},showTitle:{type:"bool",default:!0},showDescription:{type:"bool",default:!0},showViewPosts:{type:"bool",default:!0},user_id:{type:"number",default:0}};p("mpp/user-profile",{title:__("User Profile Legacy","metronet-profile-picture"),icon:wp.element.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 753.53 979.74"},wp.element.createElement("title",null,"upp"),wp.element.createElement("path",{d:"M806.37,185.9c0,40.27-30.49,72.9-68.11,72.9s-68.17-32.63-68.17-72.9S700.62,113,738.26,113,806.37,145.64,806.37,185.9Z",transform:"translate(-123.47 -11)",fill:"#4063ad"}),wp.element.createElement("path",{d:"M330.36,183.8c0,40.27-30.49,72.9-68.12,72.9s-68.17-32.63-68.17-72.9,30.52-72.87,68.17-72.87S330.36,143.56,330.36,183.8Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M331.3,888.13V698.21H329c-31.64,0-57.28-27.45-57.28-61.29V336.5a118.37,118.37,0,0,1,5.43-34.79H179.84c-31.94,0-56.37,31.57-56.37,56.34V601.46h48.32V888.13Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M388.59,636.92V990.74H611.88V636.92H671.5V336.5c0-30.63-27.64-69.57-69.6-69.57H398.56c-39.44,0-69.61,38.94-69.61,69.57V636.92Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M584.3,101c0,49.69-37.63,90-84,90S416.12,150.67,416.12,101s37.66-90,84.14-90S584.3,51.27,584.3,101Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M820.61,303.79H724.08a121.69,121.69,0,0,1,4.7,32.71V636.92c0,33.84-25.64,61.29-57.28,61.29h-2.33v192H828.7V603.54H877V360.16C877,335.36,854.62,303.79,820.61,303.79Z",transform:"translate(-123.47 -11)",fill:"#4063ad"})),category:"mpp",attributes:f,edit:a.a,save:function(e){var t=e.attributes,r=t.profileName,o=t.profileTitle,n=t.profileContent,i=t.profileAlignment,a=t.profileImgURL,l=(t.profileImgID,t.profileFontSize),p=t.profileBackgroundColor,c=t.profileTextColor,f=(t.profileLinkColor,t.profileAvatarShape),h=t.profileViewPostsBackgroundColor,d=t.profileViewPostsTextColor,g=t.profileURL,b=t.showTitle,w=t.showName,C=t.showDescription,v=t.showViewPosts;return wp.element.createElement(u,null,wp.element.createElement("div",{className:s()("mpp-profile-wrap",i,f,"mt-font-size-"+l,"mpp-block-profile"),style:{backgroundColor:p,color:c}},wp.element.createElement("div",{className:s()("mpp-profile-gutenberg-wrap","mpp-block-profile"),style:{backgroundColor:p,color:c}},wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement("img",{className:"mpp-profile-avatar",src:a,alt:"avatar"}))),wp.element.createElement("div",{className:"mpp-content-wrap"},r&&!!r.length&&w&&wp.element.createElement(m.Content,{tagName:"h2",className:"mpp-profile-name",style:{color:c},value:r}),o&&!!o.length&&b&&wp.element.createElement(m.Content,{tagName:"p",className:"mpp-profile-title",style:{color:c},value:o}),n&&!!n.length&&C&&wp.element.createElement(m.Content,{tagName:"div",className:"mpp-profile-text",value:n}))),g&&!!g.length&&wp.element.createElement("div",{className:"mpp-gutenberg-view-posts"},v&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:h,color:d}},wp.element.createElement("a",{href:g,style:{backgroundColor:h,color:d}},__("View Posts","metronet-profile-picture"))))))}}),p("mpp/user-profile-enhanced",{title:__("User Profile","metronet-profile-picture"),icon:wp.element.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 753.53 979.74"},wp.element.createElement("title",null,"upp"),wp.element.createElement("path",{d:"M806.37,185.9c0,40.27-30.49,72.9-68.11,72.9s-68.17-32.63-68.17-72.9S700.62,113,738.26,113,806.37,145.64,806.37,185.9Z",transform:"translate(-123.47 -11)",fill:"#4063ad"}),wp.element.createElement("path",{d:"M330.36,183.8c0,40.27-30.49,72.9-68.12,72.9s-68.17-32.63-68.17-72.9,30.52-72.87,68.17-72.87S330.36,143.56,330.36,183.8Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M331.3,888.13V698.21H329c-31.64,0-57.28-27.45-57.28-61.29V336.5a118.37,118.37,0,0,1,5.43-34.79H179.84c-31.94,0-56.37,31.57-56.37,56.34V601.46h48.32V888.13Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M388.59,636.92V990.74H611.88V636.92H671.5V336.5c0-30.63-27.64-69.57-69.6-69.57H398.56c-39.44,0-69.61,38.94-69.61,69.57V636.92Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M584.3,101c0,49.69-37.63,90-84,90S416.12,150.67,416.12,101s37.66-90,84.14-90S584.3,51.27,584.3,101Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M820.61,303.79H724.08a121.69,121.69,0,0,1,4.7,32.71V636.92c0,33.84-25.64,61.29-57.28,61.29h-2.33v192H828.7V603.54H877V360.16C877,335.36,854.62,303.79,820.61,303.79Z",transform:"translate(-123.47 -11)",fill:"#4063ad"})),category:"mpp",getEditWrapperProps:function(e){},edit:i.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}var l=r(3),s=r.n(l),p=r(2),c=r.n(p),u=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),m=wp.element,f=m.Component,h=m.Fragment,__=wp.i18n.__,d=wp.components,g=d.PanelBody,b=d.Placeholder,w=(d.QueryControls,d.RangeControl),C=d.SelectControl,v=d.Spinner,E=d.TextControl,_=d.ToggleControl,y=(d.Toolbar,d.withAPIData,d.ColorPalette,d.Button),T=wp.editor,P=T.InspectorControls,S=(T.BlockControls,T.MediaUpload),N=T.RichText,x=(T.AlignmentToolbar,T.PanelColorSettings),k=function(e){function t(){n(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));e.get_users=function(){s.a.post(mpp_gutenberg.rest_url+"/get_users",{},{headers:{"X-WP-Nonce":mpp_gutenberg.nonce}}).then(function(t){var r,n=Array(),i=Array(),a=0,l="",s=0,p="",c="",u="",m="",f="";$.each(t.data,function(e,t){n[t.ID]={profile_pictures:t.profile_pictures,has_profile_picture:t.has_profile_picture,display_name:t.display_name,description:t.description,is_user_logged_in:t.is_user_logged_in,profile_picture_id:t.profile_picture_id,default_image:t.default_image,permalink:t.permalink},t.is_user_logged_in&&(a=t.ID),i.push({value:t.ID,label:t.display_name})}),0!==e.props.attributes.user_id&&(a=e.props.attributes.user_id);var h=n[a];h.has_profile_picture?(l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:h.profile_pictures.thumbnail,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:h.profile_picture_id,p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:h.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",m=h.permalink,c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:h.description,f=e.props.attributes.showWebsite):(p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:h.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:h.description,l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:h.default_image,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:0,m=h.permalink,f=e.props.attributes.showWebsite),void 0==c&&(c=""),e.setState((r={loading:!1,users:n,active_user:a,user_list:i,profile_picture:l,profile_picture_id:s},o(r,"active_user",a),o(r,"profile_name",p),o(r,"profile_name_unfiltered",h.display_name),o(r,"profile_title",u),o(r,"profile_description",c),o(r,"profile_url",m),o(r,"show_website",f),r)),e.props.setAttributes(o({profileContent:c,profileName:p,profileTitle:u,profileURL:m,profileImgID:s,profileImgURL:l,showWebsite:f,showSocialMedia:!0},"profileName",h.display_name))})},e.on_user_change=function(t){var r=e.state.users[t],n="",i=0,a="";r.has_profile_picture?(n=e.state.users[t].profile_pictures.thumbnail,i=e.state.users[t].profile_picture_id):(n=mpp_gutenberg.mystery_man,i=0);var l=e.state.users[t].description;void 0===l&&(l=""),a=e.state.users[t].display_name,e.props.setAttributes(o({profileName:a,profileContent:l,profileTitle:"",profileURL:e.state.users[t].permalink,profileImgURL:n,tabbedAuthorSubHeading:"",tabbedAuthorProfileTitle:"",socialFacebook:"",socialGitHub:"",socialInstagram:"",socialLinkedIn:"",socialPinterest:"",socialTwitter:"",socialWordPress:"",socialYouTube:""},"profileName",e.state.users[t].display_name)),e.setState({profile_name_unfiltered:e.state.users[t].display_name,profile_name:a,profile_description:l,profile_title:"",profile_picture:n,profile_picture_id:i,active_user:t,profile_url:e.state.users[t].permalink,socialFacebook:"",socialGitHub:"",socialInstagram:"",socialLinkedIn:"",socialPinterest:"",socialTwitter:"",socialWordPress:"",socialYouTube:""}),e.getLatestPosts()},e.getLatestPosts=function(){e.setState({loadingLatestPosts:!0});s.a.post(mpp_gutenberg.rest_url+"/get_posts",{user_id:e.state.active_user},{headers:{"X-WP-Nonce":mpp_gutenberg.nonce}}).then(function(t){var r=t.data,o=r.map(function(e){return wp.element.createElement("li",{key:e.ID},wp.element.createElement("a",{href:e.permalink},e.post_title))});e.setState({loadingLatestPosts:!1,latestPosts:o})})},e.componentDidMount=function(){e.get_users()},e.handleImageChange=function(t,r){e.setState({profile_picture:r,profile_picture_id:t})},e.onChangeName=function(t){e.setState({profile_name:t})},e.onChangeTitle=function(t){e.setState({profile_title:t})},e.onChangeProfileText=function(t){e.setState({profile_description:t})},e.onThemeChange=function(t){e.setState({theme:t})},e.handleFacebookChange=function(t){e.setState({socialFacebook:t})},e.handleYouTubeChange=function(t){e.setState({socialYouTube:t})},e.handleGitHubChange=function(t){e.setState({socialGitHub:t})},e.handleLinkedInChange=function(t){e.setState({socialLinkedIn:t})},e.handleTwitterChange=function(t){e.setState({socialTwitter:t})},e.handleWordPressChange=function(t){e.setState({socialWordPress:t})},e.handleWebsiteChange=function(t){e.setState({website:t}),""!==t&&e.props.setAttributes({showWebsite:!0})},e.handleInstagramChange=function(t){e.setState({socialInstagram:t})},e.handlePinterestChange=function(t){e.setState({socialPinterest:t})},e.handleSocialMediaChange=function(t){e.setState({showSocialMedia:t}),e.props.setAttributes({showSocialMedia:t})},e.handleSocialMediaOptionChange=function(t){e.setState({socialMediaOptions:t})},e.onChangeTabbedProfileText=function(t){e.setState({tabbedAuthorProfile:t})},e.onChangeTabbedSubHeading=function(t){e.setState({tabbedAuthorSubHeading:t})},e.onChangeActiveProfileTab=function(){e.setState({activeTab:"profile"})},e.onChangeActivePostTab=function(){e.setState({activeTab:"latest",loadingLatestPosts:!0}),e.getLatestPosts()},e.onChangetabbedAuthorProfile=function(t){e.setState({tabbedAuthorProfile:t})},e.onChangetabbedAuthorProfileHeading=function(t){e.setState({tabbedAuthorProfileHeading:t})},e.onChangetabbedAuthorLatestPosts=function(t){e.setState({tabbedAuthorLatestPosts:t})},e.onChangeProfileTabColor=function(t){e.setState({profileTabColor:t}),e.props.setAttributes({profileTabColor:t})},e.onChangePostsTabColor=function(t){e.setState({profileTabPostsColor:t}),e.props.setAttributes({profileTabPostsColor:t})},e.onChangePostsTabHeadlineColor=function(t){e.setState({profileTabHeadlineColor:t}),e.props.setAttributes({profileTabHeadlineColor:t})},e.onChangeProfileTabPostColorText=function(t){e.setState({profileTabPostsTextColor:t}),e.props.setAttributes({profileTabPostsTextColor:t})},e.onChangeProfileTabHeadlineColorText=function(t){e.setState({profileTabHeadlineTextColor:t}),e.props.setAttributes({profileTabHeadlineTextColor:t})},e.onChangeProfileTabColorText=function(t){e.setState({profileTabTextColor:t}),e.props.setAttributes({profileTabTextColor:t})},e.onLatestPostsChange=function(t){e.setState({profileLatestPostsOptionsValue:t})},e.onCompactAlignmentChange=function(t){e.setState({profileCompactAlignment:t})};var r=Array();return r.push({value:"regular",label:__("Regular","metronet-profile-picture")}),r.push({value:"profile",label:__("Profile","metronet-profile-picture")}),r.push({value:"tabbed",label:__("Tabbed","metronet-profile-picture")}),r.push({value:"compact",label:__("Compact","metronet-profile-picture")}),e.state={loading:!0,users:!1,user_list:!1,profile_picture:e.props.attributes.profileImgURL,profile_picture_id:e.props.attributes.profileImgID,active_user:!1,profile_description:"",profile_name:"",profile_name_unfiltered:"",profile_title:"",show_website:e.props.attributes.showWebsite,profileViewPosts:e.props.attributes.profileViewPosts,profileViewWebsite:e.props.attributes.profileViewWebsite,theme:e.props.attributes.theme,themes:r,socialFacebook:e.props.attributes.socialFacebook,socialGitHub:e.props.attributes.socialGitHub,socialLinkedIn:e.props.attributes.socialLinkedIn,socialPinterest:e.props.attributes.socialPinterest,socialTwitter:e.props.attributes.socialTwitter,socialWordPress:e.props.attributes.socialWordPress,socialYouTube:e.props.attributes.socialYouTube,socialInstagram:e.props.attributes.socialInstagram,website:e.props.attributes.website,showSocialMedia:!0,socialMediaOptions:e.props.attributes.socialMediaOptions,socialMediaColors:e.props.attributes.socialMediaColors,tabbedAuthorProfile:e.props.attributes.tabbedAuthorProfile,tabbedAuthorLatestPosts:e.props.attributes.tabbedAuthorLatestPosts,tabbedAuthorSubHeading:e.props.attributes.tabbedAuthorSubHeading,tabbedAuthorProfileHeading:e.props.attributes.tabbedAuthorProfileHeading,activeTab:"profile",loadingLatestPosts:!0,latestPosts:{},profileTabColor:e.props.attributes.profileTabColor,profileTabHeadlineColor:e.props.attributes.profileTabHeadlineColor,profileTabPostsColor:e.props.attributes.profileTabPostsColor,profileTabHeadlineTextColor:e.props.attributes.profileTabHeadlineTextColor,profileTabTextColor:e.props.attributes.profileTabTextColor,profileTabPostsTextColor:e.props.attributes.profileTabPostsTextColor,profileLatestPostsOptionsValue:e.props.attributes.profileLatestPostsOptionsValue,profileCompactAlignment:e.props.attributes.profileCompactAlignment},e}return a(t,e),u(t,[{key:"render",value:function(){var e=this,t=this.props,r=t.attributes,o=r.profileName,n=r.profileTitle,i=r.profileContent,a=r.profileAlignment,l=r.profileImgURL,s=r.profileImgID,p=r.profileURL,u=r.profileFontSize,m=r.buttonFontSize,f=r.headerFontSize,d=r.profileBackgroundColor,T=r.profileTextColor,k=r.profileAvatarShape,A=r.profileViewPostsBackgroundColor,I=r.profileViewPostsTextColor,L=r.profileViewPosts,O=r.profileViewWebsite,V=r.showTitle,H=r.showName,R=r.showDescription,M=r.showViewPosts,B=r.showPostsWidth,U=(r.showSocialMedia,r.showWebsite),D=(r.theme,r.theme_list,r.socialFacebook,r.socialGitHub,r.socialLinkedIn,r.socialPinterest,r.socialTwitter,r.socialWordPress,r.socialYouTube,r.socialMediaColors),F=r.profileWebsiteBackgroundColor,W=r.profileWebsiteTextColor,j=r.padding,z=r.border,q=r.borderRounded,Z=r.borderColor,G=r.profileLinkColor,Y=(r.tabbedAuthorProfile,r.tabbedAuthorSubHeading,r.tabbedAuthorProfileTitle),X=(r.profileLatestPostsOptionsValue,t.attributes,t.isSelected,t.editable,t.className,t.setAttributes);this.state.profile_pictures;s=this.state.profile_picture_id,l=this.state.profile_picture,o=this.state.profile_name,i=this.state.profile_description,n=this.state.profile_title,p=this.state.profile_url,B=""!==this.state.website&&this.props.attributes.showWebsite?"":"100%",X({showPostsWidth:B});var $=function(e){return X({profileBackgroundColor:e})},J=function(e){return X({profileTextColor:e})},K=function(e){return X({profileViewPostsBackgroundColor:e})},Q=function(e){return X({profileViewPostsTextColor:e})},ee=function(e){return X({profileWebsiteBackgroundColor:e})},te=function(e){return X({profileWebsiteTextColor:e})},re=function(e){return X({socialMediaColors:e})},oe=function(e){return X({borderColor:e})},ne=function(e){return X({profileLinkColor:e})},ie=[{value:"square",label:__("Square","metronet-profile-picture")},{value:"round",label:__("Round","metronet-profile-picture")}],ae=[{value:"colors",label:__("Brand Colors","metronet-profile-picture")},{value:"custom",label:__("Custom","metronet-profile-picture")}],le=[{value:"none",label:__("None","metronet-profile-picture")},{value:"white",label:__("White","metronet-profile-picture")},{value:"light",label:__("Light","metronet-profile-picture")},{value:"black",label:__("Black","metronet-profile-picture")},{value:"magenta",label:__("Magenta","metronet-profile-picture")},{value:"blue",label:__("Blue","metronet-profile-picture")},{value:"green",label:__("Green","metronet-profile-picture")}],se=[{value:"left",label:__("Left","metronet-profile-picture")},{value:"center",label:__("Center","metronet-profile-picture")},{value:"right",label:__("Right","metronet-profile-picture")}],pe="none",ce="";return"center"===this.state.profileCompactAlignment&&(pe="none",ce="0 auto"),"left"===this.state.profileCompactAlignment&&(pe="left",ce="0"),"right"===this.state.profileCompactAlignment&&(pe="right",ce="0"),wp.element.createElement(h,null,this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(b,null,wp.element.createElement("div",null,wp.element.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",width:"125px",height:"125px",viewBox:"0 0 753.53 979.74"},wp.element.createElement("title",null,"upp"),wp.element.createElement("path",{d:"M806.37,185.9c0,40.27-30.49,72.9-68.11,72.9s-68.17-32.63-68.17-72.9S700.62,113,738.26,113,806.37,145.64,806.37,185.9Z",transform:"translate(-123.47 -11)",fill:"#4063ad"}),wp.element.createElement("path",{d:"M330.36,183.8c0,40.27-30.49,72.9-68.12,72.9s-68.17-32.63-68.17-72.9,30.52-72.87,68.17-72.87S330.36,143.56,330.36,183.8Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M331.3,888.13V698.21H329c-31.64,0-57.28-27.45-57.28-61.29V336.5a118.37,118.37,0,0,1,5.43-34.79H179.84c-31.94,0-56.37,31.57-56.37,56.34V601.46h48.32V888.13Z",transform:"translate(-123.47 -11)",fill:"#a34d9c"}),wp.element.createElement("path",{d:"M388.59,636.92V990.74H611.88V636.92H671.5V336.5c0-30.63-27.64-69.57-69.6-69.57H398.56c-39.44,0-69.61,38.94-69.61,69.57V636.92Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M584.3,101c0,49.69-37.63,90-84,90S416.12,150.67,416.12,101s37.66-90,84.14-90S584.3,51.27,584.3,101Z",transform:"translate(-123.47 -11)",fill:"#f4831f"}),wp.element.createElement("path",{d:"M820.61,303.79H724.08a121.69,121.69,0,0,1,4.7,32.71V636.92c0,33.84-25.64,61.29-57.28,61.29h-2.33v192H828.7V603.54H877V360.16C877,335.36,854.62,303.79,820.61,303.79Z",transform:"translate(-123.47 -11)",fill:"#4063ad"})),wp.element.createElement("div",{className:"mpp-spinner"},wp.element.createElement(v,null))))),!this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(P,null,wp.element.createElement(g,{title:__("User Profile Settings","metronet-profile-picture")},wp.element.createElement(C,{label:__("Select a user","metronet-profile-picture"),value:this.state.active_user,options:this.state.user_list,onChange:function(t){e.on_user_change(t),X({user_id:Number(t)})}}),wp.element.createElement(C,{label:__("Select a theme","metronet-profile-picture"),value:this.state.theme,options:this.state.themes,onChange:function(t){e.onThemeChange(t),X({theme:t})}}),"compact"===this.state.theme&&wp.element.createElement(C,{label:__("Select an alignment","metronet-profile-picture"),value:this.state.profileCompactAlignment,options:se,onChange:function(t){e.onCompactAlignmentChange(t),X({profileCompactAlignment:t})}}),wp.element.createElement(C,{label:__("Avatar Shape","metronet-profile-picture"),description:__("Choose between a round or square avatar shape.","metronet-profile-picture"),options:ie,value:k,onChange:function(t){return e.props.setAttributes({profileAvatarShape:t})}}),"tabbed"!==this.state.theme&&wp.element.createElement(E,{label:__("Website","metronet-profile-picture"),value:this.state.website,onChange:function(t){e.props.setAttributes({website:t}),e.handleWebsiteChange(t)}}),wp.element.createElement(_,{label:__("Show Name","metronet-profile-picture"),checked:H,onChange:function(){return e.props.setAttributes({showName:!H})}}),wp.element.createElement(_,{label:__("Show Title","metronet-profile-picture"),checked:V,onChange:function(){return e.props.setAttributes({showTitle:!V})}}),wp.element.createElement(_,{label:__("Show Description","metronet-profile-picture"),checked:R,onChange:function(){return e.props.setAttributes({showDescription:!R})}}),"tabbed"!==this.state.theme&&wp.element.createElement(h,null,wp.element.createElement(_,{label:__("Show View Posts","metronet-profile-picture"),checked:M,onChange:function(){return e.props.setAttributes({showViewPosts:!M})}}),M&&wp.element.createElement(E,{label:__("View Posts Text","metronet-profile-picture"),value:L,onChange:function(t){e.props.setAttributes({profileViewPosts:t})}}),wp.element.createElement(_,{label:__("Show Website","metronet-profile-picture"),checked:this.state.show_website,onChange:function(t){e.props.setAttributes({showWebsite:t}),e.setState({show_website:t})}}),this.state.show_website&&wp.element.createElement(E,{label:__("View Website Text","metronet-profile-picture"),value:O,onChange:function(t){e.props.setAttributes({profileViewWebsite:t})}})),wp.element.createElement(_,{label:__("Show Social Media","metronet-profile-picture"),checked:this.state.showSocialMedia,onChange:function(t){e.props.setAttributes({showSocialMedia:t}),e.handleSocialMediaChange(t)}})),"tabbed"===this.state.theme&&wp.element.createElement(g,{title:__("User Profile Settings","metronet-profile-picture")},wp.element.createElement(C,{label:__("Select a theme","metronet-profile-picture"),value:this.state.latestPostsTheme,options:{},onChange:function(t){e.on_user_change(t),X({user_id:Number(t)})}})),wp.element.createElement(g,{title:__("Colors","metronet-profile-picture"),initialOpen:!1},wp.element.createElement(x,{title:__("Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:d,onChange:$,label:__("Background Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:T,onChange:J,label:__("Text Color","metronet-profile-picture")}]}),"profile"===this.state.theme&&wp.element.createElement(x,{title:__("Link Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:G,onChange:ne,label:__("Link Color","metronet-profile-picture")}]}),"tabbed"===this.state.theme&&wp.element.createElement(h,null,wp.element.createElement(x,{title:__("Profile Tab Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabColor,onChange:this.onChangeProfileTabColor,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Tab Color Text","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabTextColor,onChange:this.onChangeProfileTabColorText,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Posts Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabPostsColor,onChange:this.onChangePostsTabColor,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Post Color Text","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabPostsTextColor,onChange:this.onChangeProfileTabPostColorText,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Headline Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabHeadlineColor,onChange:this.onChangePostsTabHeadlineColor,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Profile Headline Color Text","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:this.state.profileTabHeadlineColorText,onChange:this.onChangeProfileTabHeadlineColorText,label:__("Color","metronet-profile-picture")}]}),wp.element.createElement(C,{label:__("Select a Post Theme","metronet-profile-picture"),value:this.state.profileLatestPostsOptionsValue,options:le,onChange:function(t){e.onLatestPostsChange(t),X({profileLatestPostsOptionsValue:t})}})),"tabbed"!==this.state.theme&&"profile"!==this.state.theme&&wp.element.createElement(h,null,wp.element.createElement(x,{title:__("View Posts Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:A,onChange:K,label:__("View Posts Background","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("View Posts Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:I,onChange:Q,label:__("View Posts Text Color","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("Website Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:F,onChange:ee,label:__("View Website Background","metronet-profile-picture")}]}),wp.element.createElement(x,{title:__("View Website Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:W,onChange:te,label:__("View Website Text Color","metronet-profile-picture")}]}))),wp.element.createElement(g,{title:__("Spacing and Font Settings","metronet-profile-picture"),initialOpen:!1},wp.element.createElement(w,{label:__("Header Font Size","metronet-profile-picture"),value:f,onChange:function(t){return e.props.setAttributes({headerFontSize:t})},min:14,max:32,step:1}),wp.element.createElement(w,{label:__("Font Size","metronet-profile-picture"),value:u,onChange:function(t){return e.props.setAttributes({profileFontSize:t})},min:14,max:24,step:1}),"tabbed"!==this.state.theme&&wp.element.createElement(w,{label:__("Button Size","metronet-profile-picture"),value:m,onChange:function(t){return e.props.setAttributes({buttonFontSize:t})},min:10,max:24,step:1}),wp.element.createElement(w,{label:__("Padding","metronet-profile-picture"),value:j,onChange:function(t){return e.props.setAttributes({padding:t})},min:0,max:60,step:1}),wp.element.createElement(w,{label:__("Border","metronet-profile-picture"),value:z,onChange:function(t){return e.props.setAttributes({border:t})},min:0,max:10,step:1}),wp.element.createElement(w,{label:__("Border Rounded","metronet-profile-picture"),value:q,onChange:function(t){return e.props.setAttributes({borderRounded:t})},min:0,max:10,step:1}),wp.element.createElement(x,{title:__("Border Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:Z,onChange:oe,label:__("Border Color","metronet-profile-picture")}]})),wp.element.createElement(g,{title:__("Social Media Settings","metronet-profile-picture"),initialOpen:!1},wp.element.createElement(C,{label:__("Social Media Colors","metronet-profile-picture"),value:this.state.socialMediaOptions,options:ae,onChange:function(t){X({socialMediaOptions:t}),e.handleSocialMediaOptionChange(t)}}),"custom"===this.state.socialMediaOptions&&wp.element.createElement(x,{title:__("Social Media Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:D,onChange:re,label:__("Social Media Color","metronet-profile-picture")}]}),wp.element.createElement(E,{label:__("Facebook","metronet-profile-picture"),value:this.state.socialFacebook,onChange:function(t){e.props.setAttributes({socialFacebook:t}),e.handleFacebookChange(t)}}),wp.element.createElement(E,{label:__("Twitter","metronet-profile-picture"),value:this.state.socialTwitter,onChange:function(t){e.props.setAttributes({socialTwitter:t}),e.handleTwitterChange(t)}}),wp.element.createElement(E,{label:__("Instagram","metronet-profile-picture"),value:this.state.socialInstagram,onChange:function(t){e.props.setAttributes({socialInstagram:t}),e.handleInstagramChange(t)}}),wp.element.createElement(E,{label:__("LinkedIn","metronet-profile-picture"),value:this.state.socialLinkedIn,onChange:function(t){e.props.setAttributes({socialLinkedIn:t}),e.handleLinkedInChange(t)}}),wp.element.createElement(E,{label:__("YouTube","metronet-profile-picture"),value:this.state.socialYouTube,onChange:function(t){e.props.setAttributes({socialYouTube:t}),e.handleYouTubeChange(t)}}),wp.element.createElement(E,{label:__("GitHub","metronet-profile-picture"),value:this.state.socialGitHub,onChange:function(t){e.props.setAttributes({socialGitHub:t}),e.handleGitHubChange(t)}}),wp.element.createElement(E,{label:__("Pinterest","metronet-profile-picture"),value:this.state.socialPinterest,onChange:function(t){e.props.setAttributes({socialPinterest:t}),e.handlePinterestChange(t)}}),wp.element.createElement(E,{label:__("WordPress","metronet-profile-picture"),value:this.state.socialWordPress,onChange:function(t){e.props.setAttributes({socialWordPress:t}),e.handleWordPressChange(t)}}))),"tabbed"!==this.state.theme&&wp.element.createElement("div",{className:c()("mpp-enhanced-profile-wrap",this.state.theme,a,k,"mpp-block-profile"),style:{padding:j+"px",border:z+"px solid "+Z,borderRadius:q+"px",backgroundColor:d,color:T,float:pe,margin:ce}},"regular"===this.state.theme&&wp.element.createElement(h,null,wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap","mt-font-size-"+u)},wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),X({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),wp.element.createElement("div",{className:"mpp-content-wrap"},H&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),X({profileName:t})}}),V&&wp.element.createElement(N,{tagName:"p",placeholder:__("Add title","atomic-blocks"),value:n,className:"mpp-profile-title",style:{color:T},onChange:function(t){e.onChangeTitle(t),X({profileTitle:t})}}),R&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),X({profileContent:t})}}))),p&&!!p.length&&wp.element.createElement("div",{className:"mpp-gutenberg-view-posts",style:{width:B}},M&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:A,color:I,width:B,fontSize:m+"px"}},wp.element.createElement("a",{href:p,style:{backgroundColor:A,color:I}},L)),""!=this.state.website&&U&&wp.element.createElement("div",{className:"mpp-profile-view-website",style:{backgroundColor:F,color:W,fontSize:m+"px"}},wp.element.createElement("a",{href:this.state.website,style:{backgroundColor:F,color:W}},O)))),"profile"===this.state.theme&&wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap","mt-font-size-"+u)},H&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),X({profileName:t})}}),wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),X({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),R&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),X({profileContent:t})}}),wp.element.createElement("div",{className:"mpp-profile-meta",style:{fontSize:m+"px"}},M&&wp.element.createElement("div",{className:"mpp-profile-link alignleft"},wp.element.createElement("a",{href:this.state.profile_url,style:{color:G}},__("View all posts by","metronet-profile-picture")," ",this.state.profile_name_unfiltered)),""!=this.state.website&&U&&wp.element.createElement("div",{className:"mpp-profile-link alignright"},wp.element.createElement("a",{href:this.state.website,style:{color:G}},__("Website","metronet-profile-picture"))))),"compact"===this.state.theme&&wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap","mt-font-size-"+u)},H&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),X({profileName:t})}}),wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),X({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),R&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),X({profileContent:t})}}),wp.element.createElement("div",{className:"mpp-compact-meta"},M&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:A,color:I,width:"90%",margin:"0 auto 10px auto",fontSize:m+"px"}},wp.element.createElement("a",{href:p,style:{backgroundColor:A,color:I}},__("View Posts","metronet-profile-picture"))),""!=this.state.website&&U&&wp.element.createElement("div",{className:"mpp-profile-view-website",style:{backgroundColor:F,color:W,fontSize:m+"px",width:"90%",margin:"0 auto"}},wp.element.createElement("a",{href:this.state.website,style:{backgroundColor:F,color:W}},__("View Website","metronet-profile-picture"))))),1==this.state.showSocialMedia&&("regular"===this.state.theme||"compact"===this.state.theme||"profile"===this.state.theme)&&wp.element.createElement("div",{className:"mpp-social"},""!=this.state.socialFacebook&&wp.element.createElement("a",{href:this.state.socialFacebook},wp.element.createElement("svg",{className:"icon icon-facebook",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#facebook"}))),""!=this.state.socialTwitter&&wp.element.createElement("a",{href:this.state.socialTwitter},wp.element.createElement("svg",{className:"icon icon-twitter",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#twitter"}))),""!=this.state.socialInstagram&&wp.element.createElement("a",{href:this.state.socialInstagram},wp.element.createElement("svg",{className:"icon icon-instagram",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#instagram"}))),""!=this.state.socialPinterest&&wp.element.createElement("a",{href:this.state.socialPinterest},wp.element.createElement("svg",{className:"icon icon-pinterest",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#pinterest"}))),""!=this.state.socialLinkedIn&&wp.element.createElement("a",{href:this.state.socialLinkedIn},wp.element.createElement("svg",{className:"icon icon-linkedin",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#linkedin"}))),""!=this.state.socialYouTube&&wp.element.createElement("a",{href:this.state.socialYouTube},wp.element.createElement("svg",{className:"icon icon-youtube",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#youtube"}))),""!=this.state.socialGitHub&&wp.element.createElement("a",{href:this.state.socialGitHub},wp.element.createElement("svg",{className:"icon icon-github",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#github"}))),""!=this.state.socialWordPress&&wp.element.createElement("a",{href:this.state.socialWordPress},wp.element.createElement("svg",{className:"icon icon-wordpress",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#wordpress"}))))),"tabbed"===this.state.theme&&wp.element.createElement(h,null,wp.element.createElement("div",{className:c()("mpp-author-tabbed",this.state.theme,a,k,"mpp-block-profile")},wp.element.createElement("ul",{className:"mpp-author-tabs"},wp.element.createElement("li",{className:c()("mpp-tab-profile","profile"===this.state.activeTab?"active":""),onClick:this.onChangeActiveProfileTab,style:{backgroundColor:this.state.profileTabColor,color:this.state.profileTabTextColor}},wp.element.createElement(N,{tagName:"span",placeholder:__("Add tab name.","metronet-profile-picture"),value:this.state.tabbedAuthorProfile,formattingControls:[],onChange:function(t){e.onChangetabbedAuthorProfile(t),X({tabbedAuthorProfile:t})}})),wp.element.createElement("li",{className:c()("mpp-tab-posts","latest"===this.state.activeTab?"active":""),onClick:this.onChangeActivePostTab,style:{backgroundColor:this.state.profileTabPostsColor,color:this.state.profileTabPostsTextColor}},wp.element.createElement(N,{tagName:"span",placeholder:__("Add tab name.","metronet-profile-picture"),value:this.state.tabbedAuthorLatestPosts,formattingControls:[],onChange:function(t){e.onChangetabbedAuthorLatestPosts(t),X({tabbedAuthorLatestPosts:t})}}))),wp.element.createElement("div",{className:"mpp-tab-wrapper",style:{padding:j+"px",border:z+"px solid "+Z,borderRadius:q+"px",backgroundColor:d,color:T}},"profile"===this.state.activeTab&&wp.element.createElement(h,null,wp.element.createElement("div",{className:"mpp-author-social-wrapper"},wp.element.createElement("div",{className:"mpp-author-heading"},wp.element.createElement(N,{tagName:"div",className:"mpp-author-profile-heading",value:this.state.tabbedAuthorProfileHeading,formattingControls:[],onChange:function(t){e.onChangetabbedAuthorProfileHeading(t),X({profileTabHeadlineTextColor:t})},style:{backgroundColor:this.state.profileTabHeadlineColor,color:this.state.profileTabHeadlineTextColor}})),this.state.showSocialMedia&&wp.element.createElement("div",{className:"mpp-author-social"},wp.element.createElement("div",{className:"mpp-social"},""!=this.state.socialFacebook&&wp.element.createElement("a",{href:this.state.socialFacebook},wp.element.createElement("svg",{className:"icon icon-facebook",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#facebook"}))),""!=this.state.socialTwitter&&wp.element.createElement("a",{href:this.state.socialTwitter},wp.element.createElement("svg",{className:"icon icon-twitter",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#twitter"}))),""!=this.state.socialInstagram&&wp.element.createElement("a",{href:this.state.socialInstagram},wp.element.createElement("svg",{className:"icon icon-instagram",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#instagram"}))),""!=this.state.socialPinterest&&wp.element.createElement("a",{href:this.state.socialPinterest},wp.element.createElement("svg",{className:"icon icon-pinterest",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#pinterest"}))),""!=this.state.socialLinkedIn&&wp.element.createElement("a",{href:this.state.socialLinkedIn},wp.element.createElement("svg",{className:"icon icon-linkedin",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#linkedin"}))),""!=this.state.socialYouTube&&wp.element.createElement("a",{href:this.state.socialYouTube},wp.element.createElement("svg",{className:"icon icon-youtube",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#youtube"}))),""!=this.state.socialGitHub&&wp.element.createElement("a",{href:this.state.socialGitHub},wp.element.createElement("svg",{className:"icon icon-github",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#github"}))),""!=this.state.socialWordPress&&wp.element.createElement("a",{href:this.state.socialWordPress},wp.element.createElement("svg",{className:"icon icon-wordpress",role:"img",style:{fill:"custom"===this.state.socialMediaOptions?D:""}},wp.element.createElement("use",{href:"#wordpress"})))))),wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),X({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(y,{onClick:t},s?wp.element.createElement("img",{className:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}),wp.element.createElement(N,{tagName:"div",className:"mpp-author-profile-sub-heading",placeholder:__("Add profile description...","metronet-profile-picture"),value:this.state.tabbedAuthorSubHeading,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeTabbedSubHeading(t),X({tabbedAuthorSubHeading:t})}}))),wp.element.createElement("div",{className:"mpp-tabbed-profile-information"},V&&wp.element.createElement(N,{tagName:"div",className:"mpp-author-profile-title",placeholder:__("Add profile title...","metronet-profile-picture"),value:Y,formattingControls:["bold","italic","strikethrough","link"],onChange:function(e){X({tabbedAuthorProfileTitle:e})}}),H&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:T,fontSize:f+"px"},onChange:function(t){e.onChangeName(t),X({profileName:t})}}),R&&wp.element.createElement(N,{tagName:"div",className:c()("mpp-profile-text","mt-font-size-"+u),placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),X({profileContent:t})}}))),"latest"===this.state.activeTab&&wp.element.createElement(h,null,this.state.loadingLatestPosts&&wp.element.createElement(h,null,wp.element.createElement("div",null,wp.element.createElement("div",{className:"mpp-spinner"},wp.element.createElement(v,null)))),!this.state.loadingLatestPosts&&wp.element.createElement(h,null,wp.element.createElement("ul",{className:c()("mpp-author-tab-content",this.state.profileLatestPostsOptionsValue)},this.state.latestPosts))))))))}}]),t}(f);t.a=k},function(e,t,r){"use strict";function o(e){var t=new a(e),r=i(a.prototype.request,t);return n.extend(r,a.prototype,t),n.extend(r,t),r}var n=r(0),i=r(4),a=r(16),l=r(1),s=o(l);s.Axios=a,s.create=function(e){return o(n.merge(l,e))},s.Cancel=r(8),s.CancelToken=r(30),s.isCancel=r(7),s.all=function(e){return Promise.all(e)},s.spread=r(31),e.exports=s,e.exports.default=s},function(e,t){e.exports=function(e){return null!=e&&null!=e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";function o(e){this.defaults=e,this.interceptors={request:new a,response:new a}}var n=r(1),i=r(0),a=r(25),l=r(26);o.prototype.request=function(e){"string"===typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),e=i.merge(n,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[l,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},i.forEach(["delete","get","head","options"],function(e){o.prototype[e]=function(t,r){return this.request(i.merge(r||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){o.prototype[e]=function(t,r,o){return this.request(i.merge(o||{},{method:e,url:t,data:r}))}}),e.exports=o},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function n(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(u===clearTimeout)return clearTimeout(e);if((u===o||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}function a(){d&&f&&(d=!1,f.length?h=f.concat(h):g=-1,h.length&&l())}function l(){if(!d){var e=n(a);d=!0;for(var t=h.length;t;){for(f=h,h=[];++g<t;)f&&f[g].run();g=-1,t=h.length}f=null,d=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function p(){}var c,u,m=e.exports={};!function(){try{c="function"===typeof setTimeout?setTimeout:r}catch(e){c=r}try{u="function"===typeof clearTimeout?clearTimeout:o}catch(e){u=o}}();var f,h=[],d=!1,g=-1;m.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new s(e,t)),1!==h.length||d||n(l)},s.prototype.run=function(){this.fun.apply(null,this.array)},m.title="browser",m.browser=!0,m.env={},m.argv=[],m.version="",m.versions={},m.on=p,m.addListener=p,m.once=p,m.off=p,m.removeListener=p,m.removeAllListeners=p,m.emit=p,m.prependListener=p,m.prependOnceListener=p,m.listeners=function(e){return[]},m.binding=function(e){throw new Error("process.binding is not supported")},m.cwd=function(){return"/"},m.chdir=function(e){throw new Error("process.chdir is not supported")},m.umask=function(){return 0}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t){o.forEach(e,function(r,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[o])})}},function(e,t,r){"use strict";var o=r(6);e.exports=function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(o("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,o,n){return e.config=t,r&&(e.code=r),e.request=o,e.response=n,e}},function(e,t,r){"use strict";function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var n=r(0);e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var a=[];n.forEach(t,function(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))}))}),i=a.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,r){"use strict";var o=r(0),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,a={};return e?(o.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=o.trim(e.substr(0,i)).toLowerCase(),r=o.trim(e.substr(i+1)),t){if(a[t]&&n.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}}),a):a}},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");return t=e(window.location.href),function(r){var n=o.isString(r)?e(r):r;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()},function(e,t,r){"use strict";var o=r(0);e.exports=o.isStandardBrowserEnv()?function(){return{write:function(e,t,r,n,i,a){var l=[];l.push(e+"="+encodeURIComponent(t)),o.isNumber(r)&&l.push("expires="+new Date(r).toGMTString()),o.isString(n)&&l.push("path="+n),o.isString(i)&&l.push("domain="+i),!0===a&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";function o(){this.handlers=[]}var n=r(0);o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},function(e,t,r){"use strict";function o(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var n=r(0),i=r(27),a=r(7),l=r(1),s=r(28),p=r(29);e.exports=function(e){return o(e),e.baseURL&&!s(e.url)&&(e.url=p(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||l.adapter)(e).then(function(t){return o(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(o(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,r){"use strict";var o=r(0);e.exports=function(e,t,r){return o.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}var n=r(8);o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}var l=r(3),s=r.n(l),p=r(2),c=r.n(p),u=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),m=wp.element,f=m.Component,h=m.Fragment,__=wp.i18n.__,d=wp.components,g=d.PanelBody,b=d.Placeholder,w=(d.QueryControls,d.RangeControl),C=d.SelectControl,v=d.Spinner,E=(d.TextControl,d.ToggleControl),_=(d.Toolbar,d.withAPIData,d.ColorPalette,d.Button),y=wp.editor,T=y.InspectorControls,P=y.BlockControls,S=y.MediaUpload,N=y.RichText,x=y.AlignmentToolbar,k=y.PanelColorSettings,A=function(e){function t(){n(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.get_users=function(){s.a.post(mpp_gutenberg.rest_url+"/get_users",{},{headers:{"X-WP-Nonce":mpp_gutenberg.nonce}}).then(function(t){var r,n=Array(),i=Array(),a=0,l="",s=0,p="",c="",u="",m="";$.each(t.data,function(e,t){n[t.ID]={profile_pictures:t.profile_pictures,has_profile_picture:t.has_profile_picture,display_name:t.display_name,description:t.description,is_user_logged_in:t.is_user_logged_in,profile_picture_id:t.profile_picture_id,default_image:t.default_image,permalink:t.permalink},t.is_user_logged_in&&(a=t.ID),i.push({value:t.ID,label:t.display_name})}),0!==e.props.attributes.user_id&&(a=e.props.attributes.user_id);var f=n[a];f.has_profile_picture?(l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:f.profile_pictures.thumbnail,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:f.profile_picture_id,p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:f.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",m=f.permalink,c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:f.description):(p=e.props.attributes.profileName.length>0?e.props.attributes.profileName:f.display_name,u=e.props.attributes.profileTitle.length>0?e.props.attributes.profileTitle:"",c=e.props.attributes.profileContent.length>0?e.props.attributes.profileContent:f.description,l=e.props.attributes.profileImgURL.length>0?e.props.attributes.profileImgURL:f.default_image,s=e.props.attributes.profileImgID.length>0?e.props.attributes.profileImgID:0,m=f.permalink),void 0==c&&(c=""),e.setState((r={loading:!1,users:n,active_user:a,user_list:i,profile_picture:l,profile_picture_id:s},o(r,"active_user",a),o(r,"profile_name",p),o(r,"profile_title",u),o(r,"profile_description",c),o(r,"profile_url",m),r)),e.props.setAttributes({profileContent:c,profileName:p,profileTitle:u,profileURL:m,profileImgID:s,profileImgURL:l})})},e.on_user_change=function(t){var r=e.state.users[t],o="",n=0;r.has_profile_picture?(o=e.state.users[t].profile_pictures.thumbnail,n=e.state.users[t].profile_picture_id):(o=mpp_gutenberg.mystery_man,n=0);var i=e.state.users[t].description;void 0===i&&(i=""),e.props.setAttributes({profileName:e.state.users[t].display_name,profileContent:i,profileTitle:"",profileURL:e.state.users[t].permalink,profileImgURL:o}),e.setState({profile_name:e.state.users[t].display_name,profile_description:i,profile_title:"",profile_picture:o,profile_picture_id:n,active_user:t,profile_url:e.state.users[t].permalink})},e.componentDidMount=function(){e.get_users()},e.handleImageChange=function(t,r){e.setState({profile_picture:r,profile_picture_id:t})},e.onChangeName=function(t){e.setState({profile_name:t})},e.onChangeTitle=function(t){e.setState({profile_title:t})},e.onChangeProfileText=function(t){e.setState({profile_description:t})},e.state={loading:!0,users:!1,user_list:!1,profile_picture:!1,profile_picture_id:0,active_user:!1,profile_description:"",profile_name:"",profile_title:""},e}return a(t,e),u(t,[{key:"render",value:function(){var e=this,t=this.props,r=t.attributes,o=r.profileName,n=r.profileTitle,i=r.profileContent,a=r.profileAlignment,l=r.profileImgURL,s=r.profileImgID,p=r.profileURL,u=r.profileFontSize,m=r.profileBackgroundColor,f=r.profileTextColor,d=r.profileAvatarShape,y=r.profileViewPostsBackgroundColor,A=r.profileViewPostsTextColor,I=r.showTitle,L=r.showName,O=r.showDescription,V=r.showViewPosts,H=(t.attributes,t.isSelected,t.editable,t.className,t.setAttributes);this.state.profile_pictures;s=this.state.profile_picture_id,l=this.state.profile_picture,o=this.state.profile_name,i=this.state.profile_description,n=this.state.profile_title,p=this.state.profile_url;var R=function(e){return H({profileBackgroundColor:e})},M=function(e){return H({profileTextColor:e})},B=function(e){return H({profileViewPostsBackgroundColor:e})},U=function(e){return H({profileViewPostsTextColor:e})},D=[{value:"square",label:__("Square","metronet-profile-picture")},{value:"round",label:__("Round","metronet-profile-picture")}];return wp.element.createElement(h,null,this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(b,null,__("Loading...","metronet-profile-picture"),wp.element.createElement(v,null))),!this.state.loading&&wp.element.createElement(h,null,wp.element.createElement(T,null,wp.element.createElement(g,{title:__("User Profile Settings","metronet-profile-picture")},wp.element.createElement(C,{label:__("Select a user","metronet-profile-picture"),value:this.state.active_user,options:this.state.user_list,onChange:function(t){e.on_user_change(t),H({user_id:Number(t)})}}),wp.element.createElement(w,{label:__("Font Size","metronet-profile-picture"),value:u,onChange:function(t){return e.props.setAttributes({profileFontSize:t})},min:14,max:24,step:1}),wp.element.createElement(C,{label:__("Avatar Shape","metronet-profile-picture"),description:__("Choose between a round or square avatar shape.","metronet-profile-picture"),options:D,value:d,onChange:function(t){return e.props.setAttributes({profileAvatarShape:t})}}),wp.element.createElement(k,{title:__("Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:m,onChange:R,label:__("Background Color","metronet-profile-picture")}]}),wp.element.createElement(k,{title:__("Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:f,onChange:M,label:__("Text Color","metronet-profile-picture")}]}),wp.element.createElement(k,{title:__("View Posts Background Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:y,onChange:B,label:__("View Posts Background","metronet-profile-picture")}]}),wp.element.createElement(k,{title:__("View Posts Text Color","metronet-profile-picture"),initialOpen:!1,colorSettings:[{value:A,onChange:U,label:__("View Posts Text Color","metronet-profile-picture")}]}),wp.element.createElement(E,{label:__("Show Name","metronet-profile-picture"),checked:L,onChange:function(){return e.props.setAttributes({showName:!L})}}),wp.element.createElement(E,{label:__("Show Title","metronet-profile-picture"),checked:I,onChange:function(){return e.props.setAttributes({showTitle:!I})}}),wp.element.createElement(E,{label:__("Show Description","metronet-profile-picture"),checked:O,onChange:function(){return e.props.setAttributes({showDescription:!O})}}),wp.element.createElement(E,{label:__("Show View Posts","metronet-profile-picture"),checked:V,onChange:function(){return e.props.setAttributes({showViewPosts:!V})}}))),wp.element.createElement(P,{key:"controls"},wp.element.createElement(x,{value:a,onChange:function(e){return H({profileAlignment:e})}})),wp.element.createElement("div",{className:c()("mpp-profile-wrap","legacy",a,d,"mt-font-size-"+u,"mpp-block-profile"),style:{backgroundColor:m,color:f}},wp.element.createElement("div",{className:c()("mpp-profile-gutenberg-wrap")},wp.element.createElement("div",{className:"mpp-profile-image-wrapper"},wp.element.createElement("div",{className:"mpp-profile-image-square"},wp.element.createElement(S,{buttonProps:{className:"change-image"},onSelect:function(t){e.handleImageChange(t.id,t.url),H({profileImgID:t.id,profileImgURL:t.url})},type:"image",value:s,render:function(e){var t=e.open;return wp.element.createElement(_,{onClick:t},s?wp.element.createElement("img",{class:"profile-avatar",src:l,alt:"avatar"}):wp.element.createElement("img",{src:l,alt:"placeholder"}))}}))),wp.element.createElement("div",{className:"mpp-content-wrap"},L&&wp.element.createElement(N,{tagName:"h2",placeholder:__("Add name","metronet-profile-picture"),value:o,className:"mpp-profile-name",style:{color:f},onChange:function(t){e.onChangeName(t),H({profileName:t})}}),I&&wp.element.createElement(N,{tagName:"p",placeholder:__("Add title","atomic-blocks"),value:n,className:"mpp-profile-title",style:{color:f},onChange:function(t){e.onChangeTitle(t),H({profileTitle:t})}}),O&&wp.element.createElement(N,{tagName:"div",className:"mpp-profile-text",placeholder:__("Add profile text...","metronet-profile-picture"),value:i,formattingControls:["bold","italic","strikethrough","link"],onChange:function(t){e.onChangeProfileText(t),H({profileContent:t})}}))),p&&!!p.length&&wp.element.createElement("div",{className:"mpp-gutenberg-view-posts"},V&&wp.element.createElement("div",{className:"mpp-profile-view-posts",style:{backgroundColor:y,color:A}},wp.element.createElement("a",{href:p,style:{backgroundColor:y,color:A}},__("View Posts","metronet-profile-picture")))))))}}]),t}(f);t.a=A}]);
gutenberg/class-gutenberg.php CHANGED
@@ -55,6 +55,14 @@ class Metronet_Profile_Picture_Gutenberg {
55
  'type' => 'string',
56
  'default' => '',
57
  ),
 
 
 
 
 
 
 
 
58
  'profileAlignment' => array(
59
  'type' => 'string',
60
  'default' => '',
@@ -304,12 +312,27 @@ class Metronet_Profile_Picture_Gutenberg {
304
  <?php if ( $attributes['showViewPosts'] ) : ?>
305
  <div class="mpp-profile-view-posts" style="background-color: <?php echo esc_attr( $attributes['profileViewPostsBackgroundColor'] ); ?>; color: <?php echo esc_attr( $attributes['profileViewPostsTextColor'] ); ?>; width: <?php echo esc_attr( $attributes['showPostsWidth'] ); ?>; font-size: <?php echo esc_attr( $attributes['buttonFontSize'] ); ?>px;">
306
  <a href="<?php echo esc_url( $attributes['profileURL'] ); ?>" style="background: <?php echo esc_attr( $attributes['profileViewPostsBackgroundColor'] ); ?>; color: <?php echo esc_attr( $attributes['profileViewPostsTextColor'] ); ?>">
307
- <?php esc_html_e( 'View Posts', 'metronet-profile-picture' ); ?></a>
 
 
 
 
 
 
 
308
  </div><!-- .mpp-profile-view-posts -->
309
  <?php endif; ?>
310
  <?php if ( '' != $attributes['website'] && $attributes['showWebsite'] ) : ?>
311
  <div class="mpp-profile-view-website" style="background: <?php echo esc_attr( $attributes['profileWebsiteBackgroundColor'] ); ?>;color: <?php echo esc_attr( $attributes['profileWebsiteTextColor'] ); ?>; font-size: <?php echo esc_attr( $attributes['buttonFontSize'] ); ?>px;">
312
- <a href="<?php echo esc_url( $attributes['website'] ); ?>" style="background: <?php echo esc_attr( $attributes['profileWebsiteBackgroundColor'] ); ?>; color: <?php echo esc_attr( $attributes['profileWebsiteTextColor'] ); ?>;"><?php esc_html_e( 'View Website', 'metronet-profile-picture' ); ?></a>
 
 
 
 
 
 
 
 
313
  </div><!-- .mpp-profile-view-website -->
314
  <?php endif; ?>
315
  </div><!-- .mpp-gutenberg-view-posts -->
55
  'type' => 'string',
56
  'default' => '',
57
  ),
58
+ 'profileViewPosts' => array(
59
+ 'type' => 'string',
60
+ 'default' => __( 'View Posts', 'metronet-profile-picture' ),
61
+ ),
62
+ 'profileViewWebsite' => array(
63
+ 'type' => 'string',
64
+ 'default' => __( 'View Website', 'metronet-profile-picture' ),
65
+ ),
66
  'profileAlignment' => array(
67
  'type' => 'string',
68
  'default' => '',
312
  <?php if ( $attributes['showViewPosts'] ) : ?>
313
  <div class="mpp-profile-view-posts" style="background-color: <?php echo esc_attr( $attributes['profileViewPostsBackgroundColor'] ); ?>; color: <?php echo esc_attr( $attributes['profileViewPostsTextColor'] ); ?>; width: <?php echo esc_attr( $attributes['showPostsWidth'] ); ?>; font-size: <?php echo esc_attr( $attributes['buttonFontSize'] ); ?>px;">
314
  <a href="<?php echo esc_url( $attributes['profileURL'] ); ?>" style="background: <?php echo esc_attr( $attributes['profileViewPostsBackgroundColor'] ); ?>; color: <?php echo esc_attr( $attributes['profileViewPostsTextColor'] ); ?>">
315
+ <?php
316
+ if ( isset( $attributes['profileViewPosts'] ) ) {
317
+ echo esc_html( $attributes['profileViewPosts'] );
318
+ } else {
319
+ esc_html_e( 'View Posts', 'metronet-profile-picture' );
320
+ }
321
+ ?>
322
+ </a>
323
  </div><!-- .mpp-profile-view-posts -->
324
  <?php endif; ?>
325
  <?php if ( '' != $attributes['website'] && $attributes['showWebsite'] ) : ?>
326
  <div class="mpp-profile-view-website" style="background: <?php echo esc_attr( $attributes['profileWebsiteBackgroundColor'] ); ?>;color: <?php echo esc_attr( $attributes['profileWebsiteTextColor'] ); ?>; font-size: <?php echo esc_attr( $attributes['buttonFontSize'] ); ?>px;">
327
+ <a href="<?php echo esc_url( $attributes['website'] ); ?>" style="background: <?php echo esc_attr( $attributes['profileWebsiteBackgroundColor'] ); ?>; color: <?php echo esc_attr( $attributes['profileWebsiteTextColor'] ); ?>;">
328
+ <?php
329
+ if ( isset( $attributes['profileViewWebsite'] ) ) {
330
+ echo esc_html( $attributes['profileViewWebsite'] );
331
+ } else {
332
+ esc_html_e( 'View Website', 'metronet-profile-picture' );
333
+ }
334
+ ?>
335
+ </a>
336
  </div><!-- .mpp-profile-view-website -->
337
  <?php endif; ?>
338
  </div><!-- .mpp-gutenberg-view-posts -->
metronet-profile-picture.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: User Profile Picture
4
  Plugin URI: http://wordpress.org/extend/plugins/metronet-profile-picture/
5
  Description: Use the native WP uploader on your user profile page.
6
  Author: Ronald Huereca
7
- Version: 2.3.2
8
  Requires at least: 3.5
9
  Author URI: https://www.mediaron.com
10
  Contributors: ronalfy
@@ -12,7 +12,7 @@ Text Domain: metronet-profile-picture
12
  Domain Path: /languages
13
  */
14
 
15
- define( 'METRONET_PROFILE_PICTURE_VERSION', '2.3.2' );
16
  define( 'METRONET_PROFILE_PICTURE_PLUGIN_NAME', 'User Profile Picture' );
17
  define( 'METRONET_PROFILE_PICTURE_DIR', plugin_dir_path( __FILE__ ) );
18
  define( 'METRONET_PROFILE_PICTURE_URL', plugins_url( '/', __FILE__ ) );
4
  Plugin URI: http://wordpress.org/extend/plugins/metronet-profile-picture/
5
  Description: Use the native WP uploader on your user profile page.
6
  Author: Ronald Huereca
7
+ Version: 2.3.5
8
  Requires at least: 3.5
9
  Author URI: https://www.mediaron.com
10
  Contributors: ronalfy
12
  Domain Path: /languages
13
  */
14
 
15
+ define( 'METRONET_PROFILE_PICTURE_VERSION', '2.3.5' );
16
  define( 'METRONET_PROFILE_PICTURE_PLUGIN_NAME', 'User Profile Picture' );
17
  define( 'METRONET_PROFILE_PICTURE_DIR', plugin_dir_path( __FILE__ ) );
18
  define( 'METRONET_PROFILE_PICTURE_URL', plugins_url( '/', __FILE__ ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: ronalfy, Alaadiaa
3
  Tags: users, user profile, gravatar, avatar, blocks, block
4
  Requires at least: 3.5
5
  Tested up to: 5.2
6
- Stable tag: 2.3.2
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -126,6 +126,10 @@ Yes, but you'll have to set a new profile image per site. This is currently a l
126
 
127
  == Changelog ==
128
 
 
 
 
 
129
  = 2.3.2 =
130
  * Released 2019-07-14
131
  * Added top level navigation menu in anticipation for User Profile Picture Enhanced.
@@ -326,20 +330,5 @@ Yes, but you'll have to set a new profile image per site. This is currently a l
326
 
327
  == Upgrade Notice ==
328
 
329
- = 2.3.2 =
330
- Added top level navigation menu in anticipation for User Profile Picture Enhanced. Adding more filters for third-party plugin integration.
331
-
332
- = 2.3.0 =
333
- Gutenberg blocks are now in the User Profile Picture category. New filters for add-on extensibility. Added Options page so you can disable the Gutenberg blocks if you so desire. Bug fix: Adding user display name to post title when User Profile Picture creates the user page.
334
-
335
- = 2.2.8 =
336
- New REST API endpoint for changing profile pictures.
337
-
338
- = 2.2.7 =
339
- Fixing permissions in REST API.
340
-
341
- = 2.2.6 =
342
- Fixing permissions in REST API.
343
-
344
- = 2.2.5 =
345
- Code cleanup. Leaner Gutenberg JavaScript. Gutenberg improvements. Security improvements.
3
  Tags: users, user profile, gravatar, avatar, blocks, block
4
  Requires at least: 3.5
5
  Tested up to: 5.2
6
+ Stable tag: 2.3.5
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
126
 
127
  == Changelog ==
128
 
129
+ = 2.3.5 =
130
+ * Released 2019-09-17
131
+ * Added option in Gutenberg block to customize the View Posts and View Website text.
132
+
133
  = 2.3.2 =
134
  * Released 2019-07-14
135
  * Added top level navigation menu in anticipation for User Profile Picture Enhanced.
330
 
331
  == Upgrade Notice ==
332
 
333
+ = 2.3.5 =
334
+ Added option in Gutenberg block to customize the View Posts and View Website text.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/block/profile.js CHANGED
@@ -55,6 +55,8 @@ class MPP_Gutenberg_Enhanced extends Component {
55
  profile_name_unfiltered: '',
56
  profile_title: '',
57
  show_website: this.props.attributes.showWebsite,
 
 
58
  theme: this.props.attributes.theme,
59
  themes: theme_list,
60
  socialFacebook: this.props.attributes.socialFacebook,
@@ -483,6 +485,8 @@ class MPP_Gutenberg_Enhanced extends Component {
483
  profileAvatarShape,
484
  profileViewPostsBackgroundColor,
485
  profileViewPostsTextColor,
 
 
486
  showTitle,
487
  showName,
488
  showDescription,
@@ -655,11 +659,25 @@ class MPP_Gutenberg_Enhanced extends Component {
655
  checked={ showViewPosts }
656
  onChange={ () => this.props.setAttributes( { showViewPosts: ! showViewPosts } ) }
657
  />
 
 
 
 
 
 
 
658
  <ToggleControl
659
  label={ __( 'Show Website', 'metronet-profile-picture' ) }
660
  checked={ this.state.show_website }
661
  onChange={ ( value ) => { this.props.setAttributes( { showWebsite: value } ); this.setState({show_website: value}); } }
662
  />
 
 
 
 
 
 
 
663
  </Fragment>
664
  }
665
  <ToggleControl
@@ -1058,7 +1076,7 @@ class MPP_Gutenberg_Enhanced extends Component {
1058
  backgroundColor: profileViewPostsBackgroundColor,
1059
  color: profileViewPostsTextColor,
1060
  } }
1061
- >{__('View Posts', 'metronet-profile-picture')}</a>
1062
  </div>
1063
  }
1064
  { this.state.website != '' && showWebsite &&
@@ -1076,7 +1094,7 @@ class MPP_Gutenberg_Enhanced extends Component {
1076
  backgroundColor: profileWebsiteBackgroundColor,
1077
  color: profileWebsiteTextColor,
1078
  } }
1079
- >{__('View Website', 'metronet-profile-picture')}</a>
1080
  </div>
1081
  }
1082
  </div>
55
  profile_name_unfiltered: '',
56
  profile_title: '',
57
  show_website: this.props.attributes.showWebsite,
58
+ profileViewPosts: this.props.attributes.profileViewPosts,
59
+ profileViewWebsite: this.props.attributes.profileViewWebsite,
60
  theme: this.props.attributes.theme,
61
  themes: theme_list,
62
  socialFacebook: this.props.attributes.socialFacebook,
485
  profileAvatarShape,
486
  profileViewPostsBackgroundColor,
487
  profileViewPostsTextColor,
488
+ profileViewPosts,
489
+ profileViewWebsite,
490
  showTitle,
491
  showName,
492
  showDescription,
659
  checked={ showViewPosts }
660
  onChange={ () => this.props.setAttributes( { showViewPosts: ! showViewPosts } ) }
661
  />
662
+ { showViewPosts &&
663
+ <TextControl
664
+ label={__('View Posts Text', 'metronet-profile-picture')}
665
+ value={profileViewPosts}
666
+ onChange={ ( value ) => { this.props.setAttributes( { profileViewPosts: value }); } }
667
+ />
668
+ }
669
  <ToggleControl
670
  label={ __( 'Show Website', 'metronet-profile-picture' ) }
671
  checked={ this.state.show_website }
672
  onChange={ ( value ) => { this.props.setAttributes( { showWebsite: value } ); this.setState({show_website: value}); } }
673
  />
674
+ { this.state.show_website &&
675
+ <TextControl
676
+ label={__('View Website Text', 'metronet-profile-picture')}
677
+ value={profileViewWebsite}
678
+ onChange={ ( value ) => { this.props.setAttributes( { profileViewWebsite: value }); } }
679
+ />
680
+ }
681
  </Fragment>
682
  }
683
  <ToggleControl
1076
  backgroundColor: profileViewPostsBackgroundColor,
1077
  color: profileViewPostsTextColor,
1078
  } }
1079
+ >{profileViewPosts}</a>
1080
  </div>
1081
  }
1082
  { this.state.website != '' && showWebsite &&
1094
  backgroundColor: profileWebsiteBackgroundColor,
1095
  color: profileWebsiteTextColor,
1096
  } }
1097
+ >{profileViewWebsite}</a>
1098
  </div>
1099
  }
1100
  </div>