Version Description
- Released 2019-07-06
- 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.
- New add-on in the works: User Profile Picture Enhanced.
Download this release
Release Info
Developer | ronalfy |
Plugin | User Profile Picture |
Version | 2.3.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.8 to 2.3.0
- dist/blocks.build.js +1 -1
- metronet-profile-picture.php +250 -11
- readme.txt +14 -1
- src/block/block.js +2 -2
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:"common",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:"common",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,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}]);
|
metronet-profile-picture.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
/*
|
3 |
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.
|
8 |
Requires at least: 3.5
|
9 |
Author URI: https://www.mediaron.com
|
10 |
Contributors: ronalfy
|
@@ -12,7 +12,12 @@ Text Domain: metronet-profile-picture
|
|
12 |
Domain Path: /languages
|
13 |
*/
|
14 |
|
15 |
-
define( 'METRONET_PROFILE_PICTURE_VERSION', '2.
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
/**
|
18 |
* Main Class for User Profile Picture
|
@@ -72,7 +77,6 @@ class Metronet_Profile_Picture {
|
|
72 |
add_action( 'edit_user_profile_update', array( $this, 'save_user_profile' ) );
|
73 |
add_action( 'personal_options_update', array( $this, 'save_user_profile' ) );
|
74 |
|
75 |
-
|
76 |
//User Avatar override
|
77 |
add_filter( 'get_avatar', array( $this, 'avatar_override' ), 10, 6 );
|
78 |
add_filter( 'pre_get_avatar_data', array( $this, 'pre_avatar_override' ), 10, 2 );
|
@@ -83,11 +87,182 @@ class Metronet_Profile_Picture {
|
|
83 |
//Avatar check overridden - Can be overridden using a higher priority
|
84 |
add_filter( 'mpp_hide_avatar_override', '__return_true', 5 );
|
85 |
|
86 |
-
//
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
} //end constructor
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
/**
|
92 |
* ajax_add_thumbnail()
|
93 |
*
|
@@ -418,6 +593,9 @@ class Metronet_Profile_Picture {
|
|
418 |
* @return int post_id
|
419 |
*/
|
420 |
private function get_post_id( $user_id = 0 ) {
|
|
|
|
|
|
|
421 |
//Get/Create Profile Picture Post
|
422 |
$post_args = array(
|
423 |
'post_type' => 'mt_pp',
|
@@ -431,6 +609,7 @@ class Metronet_Profile_Picture {
|
|
431 |
'post_author' => $user_id,
|
432 |
'post_type' => 'mt_pp',
|
433 |
'post_status' => 'publish',
|
|
|
434 |
)
|
435 |
);
|
436 |
} else {
|
@@ -491,6 +670,10 @@ class Metronet_Profile_Picture {
|
|
491 |
*/
|
492 |
public function init() {
|
493 |
|
|
|
|
|
|
|
|
|
494 |
add_theme_support( 'post-thumbnails' ); //This should be part of the theme, but the plugin registers it just in case.
|
495 |
//Register post types
|
496 |
$post_type_args = array(
|
@@ -504,6 +687,15 @@ class Metronet_Profile_Picture {
|
|
504 |
'hierarchical' => false,
|
505 |
'supports' => array( 'thumbnail' ),
|
506 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
register_post_type( 'mt_pp', $post_type_args );
|
508 |
|
509 |
/**
|
@@ -523,7 +715,33 @@ class Metronet_Profile_Picture {
|
|
523 |
|
524 |
}//end function init
|
525 |
|
526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
|
528 |
/**
|
529 |
* insert_upload_form
|
@@ -567,7 +785,7 @@ class Metronet_Profile_Picture {
|
|
567 |
$remove_classes[] = 'mpp-no-profile-image';
|
568 |
}
|
569 |
?>
|
570 |
-
<a id="metronet-remove" class="<?php echo implode( ' ', $remove_classes ); ?>" href="#" title="<?php esc_attr_e( 'Remove profile image', 'metronet-profile-picture' ); ?>"><?php esc_html_e( 'Remove profile image', 'metronet-profile-picture' )
|
571 |
<div style="display: none">
|
572 |
<?php printf( '<img class="mpp-loading" width="150" height="150" alt="Loading" src="%s" />', esc_url( self::get_plugin_url( '/img/loading.gif' ) ) ); ?>
|
573 |
</div>
|
@@ -592,12 +810,19 @@ class Metronet_Profile_Picture {
|
|
592 |
<?php
|
593 |
else :
|
594 |
?>
|
595 |
-
<br /><input type="checkbox" name="metronet-user-avatar" id="metronet-user-avatar" value="on" <?php echo $checked; ?>
|
596 |
<?php endif; ?>
|
597 |
</div><!-- #metronet-override-avatar -->
|
598 |
</td>
|
599 |
</tr>
|
600 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
} //end insert_upload_form
|
602 |
|
603 |
/**
|
@@ -1095,7 +1320,7 @@ function mt_profile_img( $user_id, $args = array() ) {
|
|
1095 |
'attr' => '',
|
1096 |
'echo' => true,
|
1097 |
);
|
1098 |
-
$args
|
1099 |
extract( $args ); //todo - get rid of evil extract
|
1100 |
|
1101 |
$post_thumbnail_id = get_post_thumbnail_id( $profile_post_id );
|
@@ -1490,6 +1715,13 @@ function mpp_get_social_icons( $attributes ) {
|
|
1490 |
*
|
1491 |
*/
|
1492 |
function mpp_load_gutenblock_svgs() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1493 |
if ( '' !== get_post_type() ) {
|
1494 |
// Define SVG sprite file.
|
1495 |
$path = '/img/social-logos.svg';
|
@@ -1513,4 +1745,11 @@ function mpp_load_gutenblock_svgs() {
|
|
1513 |
echo '</div>';
|
1514 |
}
|
1515 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1516 |
}
|
1 |
+
<?php // phpcs:ignore
|
2 |
/*
|
3 |
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.0
|
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.0' );
|
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__ ) );
|
19 |
+
define( 'METRONET_PROFILE_PICTURE_SLUG', plugin_basename( __FILE__ ) );
|
20 |
+
define( 'METRONET_PROFILE_PICTURE_FILE', __FILE__ );
|
21 |
|
22 |
/**
|
23 |
* Main Class for User Profile Picture
|
77 |
add_action( 'edit_user_profile_update', array( $this, 'save_user_profile' ) );
|
78 |
add_action( 'personal_options_update', array( $this, 'save_user_profile' ) );
|
79 |
|
|
|
80 |
//User Avatar override
|
81 |
add_filter( 'get_avatar', array( $this, 'avatar_override' ), 10, 6 );
|
82 |
add_filter( 'pre_get_avatar_data', array( $this, 'pre_avatar_override' ), 10, 2 );
|
87 |
//Avatar check overridden - Can be overridden using a higher priority
|
88 |
add_filter( 'mpp_hide_avatar_override', '__return_true', 5 );
|
89 |
|
90 |
+
// Determine if to load Gutenberg or not.
|
91 |
+
$options = $this->get_options();
|
92 |
+
if ( 'on' === $options['load_gutenberg'] ) {
|
93 |
+
// Include Gutenberg
|
94 |
+
add_filter( 'block_categories', array( $this, 'add_block_category' ), 10, 2 );
|
95 |
+
include_once self::get_plugin_dir( '/gutenberg/class-gutenberg.php' );
|
96 |
+
new Metronet_Profile_Picture_Gutenberg();
|
97 |
+
}
|
98 |
+
|
99 |
} //end constructor
|
100 |
|
101 |
+
/**
|
102 |
+
* Add a User Profile Picture category for block creation.
|
103 |
+
*
|
104 |
+
* @since 2.3.0
|
105 |
+
*
|
106 |
+
* @param array $categories Array of available categories
|
107 |
+
* @param object $post Post to attach it to
|
108 |
+
*
|
109 |
+
* @return array New Categories
|
110 |
+
*/
|
111 |
+
public function add_block_category( $categories, $post ) {
|
112 |
+
return array_merge(
|
113 |
+
$categories,
|
114 |
+
array(
|
115 |
+
array(
|
116 |
+
'slug' => 'mpp',
|
117 |
+
'title' => __( 'User Profile Picture', 'metronet-profile-picture' ),
|
118 |
+
'icon' => 'groups',
|
119 |
+
),
|
120 |
+
)
|
121 |
+
);
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Register the settings menu for User Profile Picture
|
126 |
+
*
|
127 |
+
* @since 2.3.0
|
128 |
+
*
|
129 |
+
*/
|
130 |
+
public function register_settings_menu() {
|
131 |
+
$hook = add_submenu_page(
|
132 |
+
'options-general.php',
|
133 |
+
__( 'User Profile Picture', 'metronet-profile-picture' ),
|
134 |
+
__( 'User Profile Picture', 'metronet-profile-picture' ),
|
135 |
+
'manage_options',
|
136 |
+
'mpp',
|
137 |
+
array( $this, 'admin_page' )
|
138 |
+
);
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Admin page for User Profile Picture
|
143 |
+
*
|
144 |
+
* @since 2.3.0
|
145 |
+
*
|
146 |
+
*/
|
147 |
+
public function admin_page() {
|
148 |
+
if ( isset( $_POST['submit'] ) && isset( $_POST['options'] ) ) {
|
149 |
+
check_admin_referer( 'save_mpp_options' );
|
150 |
+
$this->update_options( $_POST['options'] );
|
151 |
+
printf( '<div class="updated"><p><strong>%s</strong></p></div>', esc_html__( 'Your options have been saved.', 'metronet-profile-picture' ) );
|
152 |
+
}
|
153 |
+
// Get options and defaults
|
154 |
+
$options = $this->get_options();
|
155 |
+
?>
|
156 |
+
<div class="wrap">
|
157 |
+
<form action="" method="POST">
|
158 |
+
<?php wp_nonce_field( 'save_mpp_options' ); ?>
|
159 |
+
<h1><svg id="Layer_1" width="30" height="30" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 753.53 979.74"><title>upp</title><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"/><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"/><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"/><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"/><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"/><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"/></svg> <?php esc_html_e( 'User Profile Picture', 'metronet-profile-picture' ); ?></h1>
|
160 |
+
<p><?php esc_html_e( 'Welcome to User Profile Picture!', 'metronet-profile-picture' ); ?></p>
|
161 |
+
<?php
|
162 |
+
if ( ! defined( 'USER_PROFILE_PICTURE_ENHANCED' ) ) :
|
163 |
+
?>
|
164 |
+
<p><?php esc_html_e( 'Please try: ', 'metronet-profile-picture' ); ?><a target="_blank" href="https://mediaron.com/downloads/user-profile-picture-enhanced/"><?php esc_html_e( 'User Profile Picture Enhanced', 'metronet-profile-picture' ); ?></a></p>
|
165 |
+
<?php
|
166 |
+
endif;
|
167 |
+
?>
|
168 |
+
<table class="form-table">
|
169 |
+
<tbody>
|
170 |
+
<tr>
|
171 |
+
<th scope="row"><?php esc_html_e( 'Gutenberg Blocks', 'metronet-profile-picture' ); ?></th>
|
172 |
+
<td>
|
173 |
+
<input type="hidden" name="options['load_gutenberg']" value="on" />
|
174 |
+
<input id="mpp-load-gutenberg" type="checkbox" value="off" name="options[load_gutenberg]" <?php checked( 'off', $options['load_gutenberg'] ); ?> /> <label for="mpp-load-gutenberg"><?php esc_html_e( 'Disable Gutenberg Blocks', 'metronet-profile-picture' ); ?></label>
|
175 |
+
<p class="description"><?php esc_html_e( 'Select this option if you do not want User Profile Picture to show up in Gutenberg or do not plan on using the blocks.', 'metronet-profile-picture' ); ?></p>
|
176 |
+
</td>
|
177 |
+
</tr>
|
178 |
+
<?php
|
179 |
+
/**
|
180 |
+
* Allow other plugins to run code after the user profile admin Table Row.
|
181 |
+
*
|
182 |
+
* @since 2.3.0
|
183 |
+
*
|
184 |
+
*/
|
185 |
+
do_action( 'mpp_user_profile_admin_settings_after_row' );
|
186 |
+
?>
|
187 |
+
</tbody>
|
188 |
+
</table>
|
189 |
+
<?php
|
190 |
+
/**
|
191 |
+
* Allow other plugins to run code after the user profile admin Table.
|
192 |
+
*
|
193 |
+
* @since 2.3.0
|
194 |
+
*
|
195 |
+
*/
|
196 |
+
do_action( 'mpp_user_profile_admin_settings_after_table' );
|
197 |
+
?>
|
198 |
+
<?php submit_button( __( 'Save Options', 'metronet-profile-picture' ) ); ?>
|
199 |
+
</form>
|
200 |
+
</div>
|
201 |
+
<?php
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Get the options for User Profile Picture
|
206 |
+
*
|
207 |
+
* @since 2.3.0
|
208 |
+
*
|
209 |
+
*/
|
210 |
+
public function get_options() {
|
211 |
+
$options = get_option( 'mpp_options', false );
|
212 |
+
if ( false === $options ) {
|
213 |
+
$options = $this->get_defaults();
|
214 |
+
} elseif ( is_array( $options ) ) {
|
215 |
+
$options = wp_parse_args( $options, $this->get_defaults() );
|
216 |
+
} else {
|
217 |
+
$options = $this->get_defaults();
|
218 |
+
}
|
219 |
+
return $options;
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Update options via sanitization
|
224 |
+
*
|
225 |
+
* @since 2.3.0
|
226 |
+
* @access public
|
227 |
+
* @param array $options array of options to save
|
228 |
+
* @return void
|
229 |
+
*/
|
230 |
+
private function update_options( $options ) {
|
231 |
+
$options = wp_unslash( $options );
|
232 |
+
foreach ( $options as $key => &$option ) {
|
233 |
+
switch ( $key ) {
|
234 |
+
default:
|
235 |
+
$option = sanitize_text_field( $options[ $key ] );
|
236 |
+
break;
|
237 |
+
}
|
238 |
+
}
|
239 |
+
/**
|
240 |
+
* Allow other plugins to perform their own sanitization functions.
|
241 |
+
*
|
242 |
+
* @since 2.3.0
|
243 |
+
*
|
244 |
+
* @param array $options An array of sanitized POST options
|
245 |
+
*
|
246 |
+
*/
|
247 |
+
$options = apply_filters( 'mpp_options_sanitized', $options );
|
248 |
+
update_option( 'mpp_options', $options );
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Get the default options for User Profile Picture
|
253 |
+
*
|
254 |
+
* @access private
|
255 |
+
*
|
256 |
+
* @since 2.3.0
|
257 |
+
*
|
258 |
+
*/
|
259 |
+
private function get_defaults() {
|
260 |
+
$defaults = array(
|
261 |
+
'load_gutenberg' => 'on',
|
262 |
+
);
|
263 |
+
return $defaults;
|
264 |
+
}
|
265 |
+
|
266 |
/**
|
267 |
* ajax_add_thumbnail()
|
268 |
*
|
593 |
* @return int post_id
|
594 |
*/
|
595 |
private function get_post_id( $user_id = 0 ) {
|
596 |
+
|
597 |
+
$user = get_user_by( 'id', $user_id );
|
598 |
+
|
599 |
//Get/Create Profile Picture Post
|
600 |
$post_args = array(
|
601 |
'post_type' => 'mt_pp',
|
609 |
'post_author' => $user_id,
|
610 |
'post_type' => 'mt_pp',
|
611 |
'post_status' => 'publish',
|
612 |
+
'post_title' => $user->data->display_name,
|
613 |
)
|
614 |
);
|
615 |
} else {
|
670 |
*/
|
671 |
public function init() {
|
672 |
|
673 |
+
// For the admin interface
|
674 |
+
add_action( 'admin_menu', array( $this, 'register_settings_menu' ) );
|
675 |
+
add_action( 'plugin_action_links_' . METRONET_PROFILE_PICTURE_SLUG, array( $this, 'plugin_settings_link' ) );
|
676 |
+
|
677 |
add_theme_support( 'post-thumbnails' ); //This should be part of the theme, but the plugin registers it just in case.
|
678 |
//Register post types
|
679 |
$post_type_args = array(
|
687 |
'hierarchical' => false,
|
688 |
'supports' => array( 'thumbnail' ),
|
689 |
);
|
690 |
+
|
691 |
+
/**
|
692 |
+
* Allow other plugins to modify the post type creation arguments.
|
693 |
+
*
|
694 |
+
* @since 2.3.0
|
695 |
+
*
|
696 |
+
* @param array Post type arguments prior to registering the post type.
|
697 |
+
*/
|
698 |
+
$post_type_args = apply_filters( 'mpp_post_type_args', $post_type_args );
|
699 |
register_post_type( 'mt_pp', $post_type_args );
|
700 |
|
701 |
/**
|
715 |
|
716 |
}//end function init
|
717 |
|
718 |
+
/**
|
719 |
+
* Adds a plugin settings link.
|
720 |
+
*
|
721 |
+
* Adds a plugin settings link.
|
722 |
+
*
|
723 |
+
* @param array $settings The settings array for the plugin.
|
724 |
+
*
|
725 |
+
*/
|
726 |
+
public function plugin_settings_link( $settings ) {
|
727 |
+
$admin_anchor = sprintf(
|
728 |
+
'<a href="%s">%s</a>',
|
729 |
+
esc_url( admin_url( 'options-general.php?page=mpp' ) ),
|
730 |
+
esc_html__( 'Settings', 'metronet-profile-picture' )
|
731 |
+
);
|
732 |
+
if ( ! defined( 'USER_PROFILE_PICTURE_ENHANCED' ) ) {
|
733 |
+
$admin_anchor .= sprintf(
|
734 |
+
' | <a href="%s">%s</a>',
|
735 |
+
esc_url( 'https://mediaron.com/downloads/user-profile-picture-enhanced/' ),
|
736 |
+
esc_html__( 'Get Enhanced!', 'metronet-profile-picture' )
|
737 |
+
);
|
738 |
+
}
|
739 |
+
if ( ! is_array( $settings ) ) {
|
740 |
+
return array( $admin_anchor );
|
741 |
+
} else {
|
742 |
+
return array_merge( $settings, array( $admin_anchor ) );
|
743 |
+
}
|
744 |
+
}
|
745 |
|
746 |
/**
|
747 |
* insert_upload_form
|
785 |
$remove_classes[] = 'mpp-no-profile-image';
|
786 |
}
|
787 |
?>
|
788 |
+
<a id="metronet-remove" class="<?php echo implode( ' ', $remove_classes ); // phpcs:ignore ?>" href="#" title="<?php esc_attr_e( 'Remove profile image', 'metronet-profile-picture' ); ?>"><?php esc_html_e( 'Remove profile image', 'metronet-profile-picture' ); ?></a>
|
789 |
<div style="display: none">
|
790 |
<?php printf( '<img class="mpp-loading" width="150" height="150" alt="Loading" src="%s" />', esc_url( self::get_plugin_url( '/img/loading.gif' ) ) ); ?>
|
791 |
</div>
|
810 |
<?php
|
811 |
else :
|
812 |
?>
|
813 |
+
<br /><input type="checkbox" name="metronet-user-avatar" id="metronet-user-avatar" value="on" <?php echo $checked; // phpcs:ignore ?> /> <label for="metronet-user-avatar"><?php esc_html_e( 'Override Avatar?', 'metronet-profile-picture' ); ?></label>
|
814 |
<?php endif; ?>
|
815 |
</div><!-- #metronet-override-avatar -->
|
816 |
</td>
|
817 |
</tr>
|
818 |
<?php
|
819 |
+
/**
|
820 |
+
* Allow other plugins to run code after the user profile picture UI.
|
821 |
+
*
|
822 |
+
* @since 2.3.0
|
823 |
+
*
|
824 |
+
*/
|
825 |
+
do_action( 'mpp_user_profile_form' );
|
826 |
} //end insert_upload_form
|
827 |
|
828 |
/**
|
1320 |
'attr' => '',
|
1321 |
'echo' => true,
|
1322 |
);
|
1323 |
+
$args = wp_parse_args( $args, $defaults );
|
1324 |
extract( $args ); //todo - get rid of evil extract
|
1325 |
|
1326 |
$post_thumbnail_id = get_post_thumbnail_id( $profile_post_id );
|
1715 |
*
|
1716 |
*/
|
1717 |
function mpp_load_gutenblock_svgs() {
|
1718 |
+
/**
|
1719 |
+
* Allow other plugins to run code from inside this SVG block.
|
1720 |
+
*
|
1721 |
+
* @since 2.3.0
|
1722 |
+
*
|
1723 |
+
*/
|
1724 |
+
do_action( 'mpp_svg_start' );
|
1725 |
if ( '' !== get_post_type() ) {
|
1726 |
// Define SVG sprite file.
|
1727 |
$path = '/img/social-logos.svg';
|
1745 |
echo '</div>';
|
1746 |
}
|
1747 |
}
|
1748 |
+
/**
|
1749 |
+
* Allow other plugins to run code from inside this SVG block at the end.
|
1750 |
+
*
|
1751 |
+
* @since 2.3.0
|
1752 |
+
*
|
1753 |
+
*/
|
1754 |
+
do_action( 'mpp_svg_end' );
|
1755 |
}
|
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.
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -14,6 +14,8 @@ Set a custom profile image (avatar) for a user using the standard WordPress medi
|
|
14 |
|
15 |
Set or remove a custom profile image for a user using the standard WordPress media upload tool.
|
16 |
|
|
|
|
|
17 |
<a href="https://mediaron.com/user-profile-picture/">View Documentation and Examples</a>
|
18 |
|
19 |
https://www.youtube.com/watch?v=9icnOWWZUpA&rel=0
|
@@ -124,6 +126,14 @@ Yes, but you'll have to set a new profile image per site. This is currently a l
|
|
124 |
|
125 |
== Changelog ==
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
= 2.2.8 =
|
128 |
* Released 2019-06-11
|
129 |
* New REST API endpoint for changing profile pictures.
|
@@ -311,6 +321,9 @@ Yes, but you'll have to set a new profile image per site. This is currently a l
|
|
311 |
|
312 |
== Upgrade Notice ==
|
313 |
|
|
|
|
|
|
|
314 |
= 2.2.8 =
|
315 |
New REST API endpoint for changing profile pictures.
|
316 |
|
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.0
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
14 |
|
15 |
Set or remove a custom profile image for a user using the standard WordPress media upload tool.
|
16 |
|
17 |
+
> Get <a href="https://mediaron.com/downloads/user-profile-picture-enhanced/">User Profile Picture Enhanced</a>, an add-on for User Profile Picture.
|
18 |
+
|
19 |
<a href="https://mediaron.com/user-profile-picture/">View Documentation and Examples</a>
|
20 |
|
21 |
https://www.youtube.com/watch?v=9icnOWWZUpA&rel=0
|
126 |
|
127 |
== Changelog ==
|
128 |
|
129 |
+
= 2.3.0 =
|
130 |
+
* Released 2019-07-06
|
131 |
+
* Gutenberg blocks are now in the User Profile Picture category.
|
132 |
+
* New filters for add-on extensibility
|
133 |
+
* Added Options page so you can disable the Gutenberg blocks if you so desire.
|
134 |
+
* Bug fix: Adding user display name to post title when User Profile Picture creates the user page.
|
135 |
+
* New add-on in the works: <a href="https://mediaron.com/downloads/user-profile-picture-enhanced/">User Profile Picture Enhanced</a>.
|
136 |
+
|
137 |
= 2.2.8 =
|
138 |
* Released 2019-06-11
|
139 |
* New REST API endpoint for changing profile pictures.
|
321 |
|
322 |
== Upgrade Notice ==
|
323 |
|
324 |
+
= 2.3.0 =
|
325 |
+
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.
|
326 |
+
|
327 |
= 2.2.8 =
|
328 |
New REST API endpoint for changing profile pictures.
|
329 |
|
src/block/block.js
CHANGED
@@ -123,7 +123,7 @@ const blockAttributes = {
|
|
123 |
registerBlockType( 'mpp/user-profile', { // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
|
124 |
title: __( 'User Profile Legacy', 'metronet-profile-picture' ), // Block title.
|
125 |
icon: <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 753.53 979.74"><title>upp</title><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"/><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"/><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"/><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"/><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"/><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"/></svg>,
|
126 |
-
category: '
|
127 |
// Setup the block attributes
|
128 |
attributes: blockAttributes,
|
129 |
|
@@ -243,7 +243,7 @@ registerBlockType( 'mpp/user-profile', { // Block name. Block names must be stri
|
|
243 |
registerBlockType( 'mpp/user-profile-enhanced', { // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
|
244 |
title: __( 'User Profile', 'metronet-profile-picture' ), // Block title.
|
245 |
icon: <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 753.53 979.74"><title>upp</title><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"/><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"/><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"/><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"/><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"/><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"/></svg>,
|
246 |
-
category: '
|
247 |
// Setup the block attributes
|
248 |
getEditWrapperProps( attributes ) {
|
249 |
|
123 |
registerBlockType( 'mpp/user-profile', { // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
|
124 |
title: __( 'User Profile Legacy', 'metronet-profile-picture' ), // Block title.
|
125 |
icon: <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 753.53 979.74"><title>upp</title><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"/><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"/><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"/><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"/><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"/><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"/></svg>,
|
126 |
+
category: 'mpp', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
127 |
// Setup the block attributes
|
128 |
attributes: blockAttributes,
|
129 |
|
243 |
registerBlockType( 'mpp/user-profile-enhanced', { // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
|
244 |
title: __( 'User Profile', 'metronet-profile-picture' ), // Block title.
|
245 |
icon: <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 753.53 979.74"><title>upp</title><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"/><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"/><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"/><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"/><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"/><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"/></svg>,
|
246 |
+
category: 'mpp', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
247 |
// Setup the block attributes
|
248 |
getEditWrapperProps( attributes ) {
|
249 |
|