Plugin Directory

Changeset 2955414


Ignore:
Timestamp:
08/18/2023 01:34:43 PM (3 years ago)
Author:
likecoin
Message:
  • Version 3.1.2
Location:
likecoin
Files:
190 added
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • likecoin/trunk/admin/editor.php

    r2831266 r2955414  
    3333        return;
    3434    }
     35    global $post;
     36    $post_id = null;
     37    if ( $post ) {
     38        $post_id = $post->ID;
     39    }
    3540    $asset_file = include plugin_dir_path( __FILE__ ) . '/../assets/js/sidebar/index.asset.php';
    3641    wp_enqueue_style(
     
    4045        $asset_file['version']
    4146    );
    42     wp_enqueue_script(
     47    wp_register_script(
    4348        'lc_js_editor',
    4449        LC_URI . 'assets/js/sidebar/index.js',
     
    4752        true
    4853    );
     54    wp_localize_script(
     55        'lc_js_editor',
     56        'likecoinApiSettings',
     57        array(
     58            'siteurl'       => get_site_url(),
     59            'postId'        => $post_id,
     60            'likecoHost'    => LC_LIKE_CO_HOST,
     61            'likerlandHost' => LC_LIKER_LAND_HOST,
     62        )
     63    );
     64    wp_enqueue_script( 'lc_js_editor' );
    4965}
    5066
  • likecoin/trunk/admin/likecoin.php

    r2869121 r2955414  
    2929require_once dirname( __FILE__ ) . '/editor.php';
    3030require_once dirname( __FILE__ ) . '/metabox.php';
    31 require_once dirname( __FILE__ ) . '/sidebar.php';
    3231require_once dirname( __FILE__ ) . '/plugin-action.php';
    3332require_once dirname( __FILE__ ) . '/post.php';
     
    8786    likecoin_add_privacy_policy_content();
    8887}
     88
     89/**
     90 * Add likecoin metabox for legacy editor
     91 */
     92function likecoin_add_metabox() {
     93    if ( likecoin_is_block_editor() ) {
     94        return;
     95    }
     96    add_meta_box( 'like-coin', __( 'Web3Press', LC_PLUGIN_SLUG ), 'likecoin_display_meta_box' );
     97}
     98
    8999/**
    90100 * Check if it's block editor or not
     
    102112    return false;
    103113}
    104 /**
    105  * Show plugin based on if gutenberg(sidebar) or classic(metabox) editor
    106  */
    107 function likecoin_show_plugin() {
    108     $is_block_editor = likecoin_is_block_editor();
    109     global $post;
    110     if ( $post && $is_block_editor ) {
    111         likecoin_register_sidebar( $post );
    112     } else {
    113         add_meta_box( 'like-coin', __( 'Web3Press', LC_PLUGIN_SLUG ), 'likecoin_display_meta_box' );
    114     }
    115 }
     114
    116115/**
    117116 * Run all admin related WordPress hook
     
    134133    add_action( 'manage_posts_columns', 'likecoin_add_posts_columns', 10, 2 );
    135134    add_action( 'manage_posts_custom_column', 'likecoin_populate_posts_columns', 10, 2 );
    136     add_action( 'add_meta_boxes', 'likecoin_show_plugin' ); // show sidebar or metaboxes.
     135    add_action( 'add_meta_boxes', 'likecoin_add_metabox' );
    137136}
  • likecoin/trunk/admin/metabox.php

    r2903806 r2955414  
    435435        wp_enqueue_style( 'lc_css_common' );
    436436        $asset_file = include plugin_dir_path( __FILE__ ) . '/../assets/js/admin-metabox/metabox.asset.php';
    437         wp_enqueue_script(
     437        wp_register_script(
    438438            'lc_js_metabox',
    439439            LC_URI . 'assets/js/admin-metabox/metabox.js',
     
    444444        wp_localize_script(
    445445            'lc_js_metabox',
    446             'wpApiSettings',
     446            'likecoinApiSettings',
    447447            array(
    448448                'root'          => esc_url_raw( rest_url() ),
     
    491491            )
    492492        );
     493        wp_enqueue_style( 'lc_js_metabox' );
    493494}
    494495
  • likecoin/trunk/assets/js/admin-metabox/metabox.asset.php

    r2903806 r2955414  
    11<?php return array(
    22    'dependencies' => array(),
    3     'version'      => '7eaa9190849f930711cd',
     3    'version'      => '52988637c6cc94d5f64b',
    44);
  • likecoin/trunk/assets/js/admin-metabox/metabox.js

    r2903806 r2955414  
    1 !function(){const t="LikeCoin WordPress Plugin",e=document.querySelector("#lcTitleStatus"),n=document.querySelector("#lcISCNStatus");function o(t,e){let{text:n,className:o,id:s,rel:a,target:i,href:r}=e;const c=document.createElement(t);return n&&(c.innerText=n),s&&c.setAttribute("id",s),o&&c.setAttribute("class",o),a&&c.setAttribute("rel",a),i&&c.setAttribute("target",i),r&&c.setAttribute("href",r),c}const{mainStatusLoading:s,mainStatusFailedPopUp:a,mainStatusLIKEPay:i,mainStatusUploadArweave:r,mainStatusRegisterISCN:c,buttonSubmitISCN:l,buttonRegisterISCN:d,buttonUpdateISCN:u,draft:p}=lcStringInfo,f={loading:s,failedPopup:a,onLIKEPay:i,onUploadArweave:r,onRegisterISCN:c},S=`https://app.${window.wpApiSettings.likecoHost}`;function I(t,n){e.textContent="";const s=o("h1",{text:" · ",className:t}),a=o("h3",{text:n,className:"iscn-status-text"});e.appendChild(s),e.appendChild(a)}function m(t){return f[t]?f[t]:"-"}function h(t,e){t&&(t.textContent="",t.appendChild(e))}function w(t,e){h(t,o("p",{text:e}))}async function g(t){t&&t.preventDefault();const e=document.querySelector("#lcMattersStatus"),s=document.querySelector("#lcArweaveStatus"),a=document.querySelector("#lcIPFSStatus"),{iscnHash:i,iscnId:r,isMattersPublished:c,lastModifiedTime:f,iscnTimestamp:S}=lcPostInfo,g=await jQuery.ajax({type:"POST",url:`${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/refresh`,method:"POST",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce)}}),{matters:P,ipfs:b,arweave:N}=g,T=g.wordpress_published;if(lcPostInfo.isMattersPublished=g.matters.status,lcPostInfo.mattersIPFSHash=g.matters.ipfs_hash,i&&r){const t=encodeURIComponent(r);I("iscn-status-green",lcStringInfo.mainTitleDone);const e=o("a",{text:r,rel:"noopener",target:"_blank",href:`https://app.${window.wpApiSettings.likecoHost}/view/${t}`});h(n,e)}if("publish"!==T||"initial"!==lcPostInfo.mainStatus&&!lcPostInfo.mainStatus.includes("failed")||r&&!(f>S))if("publish"!==T){I("iscn-status-red",lcStringInfo.mainTitleDraft);const t=o("button",{text:l,className:"button button-primary",id:"lcArweaveUploadBtn"});t.disabled="disabled";const e=o("p",{text:lcStringInfo.mainTitleDraft}),s=document.createElement("div");s.appendChild(t),s.appendChild(e),h(n,s)}else I("iscn-status-orange",lcStringInfo.mainTitleIntermediate),w(n,m(lcPostInfo.mainStatus));else{I("iscn-status-orange",lcStringInfo.mainTitleIntermediate);let t=N.url?d:l;r&&(t=u);const e=o("button",{text:t,className:"button button-primary",id:"lcArweaveUploadBtn"});h(n,e),e.addEventListener("click",y)}if(N.url){const{url:t}=N;h(s,o("a",{text:N.arweave_id,rel:"noopener",target:"_blank",href:t}))}if(b.url){const{url:t,hash:e}=b;h(a,o("a",{text:e,rel:"noopener",target:"_blank",href:t}))}if(P.url){const{url:t}=P,n=P.article_id;let s;s="Published"===c?o("a",{text:n,rel:"noopener",target:"_blank",href:t}):0!==n.length?o("a",{text:p,rel:"noopener",target:"_blank",href:t}):o("p",{text:"-"}),h(e,s)}}async function P(e){if(e.origin===S)try{const{action:o,data:s}=JSON.parse(e.data);"ISCN_WIDGET_READY"===o?async function(){const{ISCNWindow:e}=lcPostInfo;if(!e)throw new Error("POPUP_WINDOW_NOT_FOUND");e.postMessage(JSON.stringify({action:"INIT_WIDGET"}),S);try{const n=await jQuery.ajax({type:"GET",url:`${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/arweave/upload`,dataType:"json",method:"GET",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce)}}),{files:o,title:s,tags:a,url:i,author:r,authorDescription:c,description:l,mattersIPFSHash:d}=n,u=[];if(d){const t=`ipfs://${d}`;u.push(t)}e.postMessage(JSON.stringify({action:"SUBMIT_ISCN_DATA",data:{files:o,metadata:{name:s,tags:a,url:i,author:r,authorDescription:c,description:l,fingerprints:u,type:"article",license:"",recordNotes:t,memo:t}}}),S)}catch(t){console.error("error occured when submitting ISCN:"),console.error(t),lcPostInfo.mainStatus="failed"}}():"ARWEAVE_SUBMITTED"===o?async function(t){const{ipfsHash:e,arweaveId:o}=t;if(e&&o){lcPostInfo.arweaveIPFSHash=e,lcPostInfo.arweaveId=o,w(n,m(lcPostInfo.mainStatus));const t={arweaveIPFSHash:e,arweaveId:o};try{await jQuery.ajax({type:"POST",url:`${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/arweave`,dataType:"json",contentType:"application/json; charset=UTF-8",data:JSON.stringify(t),method:"POST",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce)}})}catch(t){console.error(t)}finally{await g()}}}(s):"ISCN_SUBMITTED"===o?async function(t){lcPostInfo.mainStatus="onRegisterISCN";try{const{tx_hash:e,error:n,success:o,iscnId:s}=t;if(n||!1===o)throw new Error("REGISTER_ISCN_SERVER_ERROR");await jQuery.ajax({type:"POST",url:`${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/metadata`,dataType:"json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({iscnHash:e,iscnId:s}),method:"POST",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce)}}),lcPostInfo.iscnHash=e,lcPostInfo.iscnId=s,lcPostInfo.mainStatus="done"}catch(t){console.error(t),lcPostInfo.mainStatus="failed"}finally{await g()}}(s):console.warn(`Unknown event: ${o}`)}catch(t){console.error(t)}}async function y(t){t&&t.preventDefault();const{siteurl:e}=wpApiSettings,{url:o}=lcPostInfo;lcPostInfo.mainStatus="onRegisterISCN",w(n,m(lcPostInfo.mainStatus));const s=encodeURIComponent(e),a=encodeURIComponent(lcPostInfo.iscnId||""),i=encodeURIComponent(o),r=`${S}/nft/url?opener=1&platform=wordpress&redirect_uri=${s}&url=${i}&iscn_id=${a}&update=${a?1:0}`,c=window.open(r,"likeCoISCNWindow","menubar=no,location=no,width=576,height=768");if(!c||c.closed||void 0===c.closed)return lcPostInfo.mainStatus="failedPopup",void w(n,m(lcPostInfo.mainStatus));lcPostInfo.ISCNWindow=c,lcPostInfo.mainStatus="initial",window.addEventListener("message",P,!1)}(()=>{const t=document.getElementById("lcPublishRefreshBtn");t&&t.addEventListener("click",g),g()})()}();
     1!function(){const t="LikeCoin WordPress Plugin",e=document.querySelector("#lcTitleStatus"),n=document.querySelector("#lcISCNStatus");function o(t,e){let{text:n,className:o,id:i,rel:s,target:a,href:r}=e;const c=document.createElement(t);return n&&(c.innerText=n),i&&c.setAttribute("id",i),o&&c.setAttribute("class",o),s&&c.setAttribute("rel",s),a&&c.setAttribute("target",a),r&&c.setAttribute("href",r),c}const{mainStatusLoading:i,mainStatusFailedPopUp:s,mainStatusLIKEPay:a,mainStatusUploadArweave:r,mainStatusRegisterISCN:c,buttonSubmitISCN:l,buttonRegisterISCN:d,buttonUpdateISCN:u,draft:p}=lcStringInfo,f={loading:i,failedPopup:s,onLIKEPay:a,onUploadArweave:r,onRegisterISCN:c},S=`https://app.${window.likecoinApiSettings.likecoHost}`;function I(t,n){e.textContent="";const i=o("h1",{text:" · ",className:t}),s=o("h3",{text:n,className:"iscn-status-text"});e.appendChild(i),e.appendChild(s)}function m(t){return f[t]?f[t]:"-"}function h(t,e){t&&(t.textContent="",t.appendChild(e))}function g(t,e){h(t,o("p",{text:e}))}async function P(t){t&&t.preventDefault();const e=document.querySelector("#lcMattersStatus"),i=document.querySelector("#lcArweaveStatus"),s=document.querySelector("#lcIPFSStatus"),{iscnHash:a,iscnId:r,isMattersPublished:c,lastModifiedTime:f,iscnTimestamp:S=0}=lcPostInfo,P=await jQuery.ajax({type:"POST",url:`${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/refresh`,method:"POST",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",likecoinApiSettings.nonce)}}),{matters:w,ipfs:b,arweave:N}=P,T=P.wordpress_published;if(lcPostInfo.isMattersPublished=P.matters.status,lcPostInfo.mattersIPFSHash=P.matters.ipfs_hash,a&&r){const t=encodeURIComponent(r);I("iscn-status-green",lcStringInfo.mainTitleDone);const e=o("a",{text:r,rel:"noopener",target:"_blank",href:`https://app.${window.likecoinApiSettings.likecoHost}/view/${t}`});h(n,e)}if("publish"!==T||"initial"!==lcPostInfo.mainStatus&&!lcPostInfo.mainStatus.includes("failed")||r&&!(f>S))if("publish"!==T){I("iscn-status-red",lcStringInfo.mainTitleDraft);const t=o("button",{text:l,className:"button button-primary",id:"lcArweaveUploadBtn"});t.disabled="disabled";const e=o("p",{text:lcStringInfo.mainTitleDraft}),i=document.createElement("div");i.appendChild(t),i.appendChild(e),h(n,i)}else I("iscn-status-orange",lcStringInfo.mainTitleIntermediate),g(n,m(lcPostInfo.mainStatus));else{I("iscn-status-orange",lcStringInfo.mainTitleIntermediate);let t=N.url?d:l;r&&(t=u);const e=o("button",{text:t,className:"button button-primary",id:"lcArweaveUploadBtn"});h(n,e),e.addEventListener("click",y)}if(N.url){const{url:t}=N;h(i,o("a",{text:N.arweave_id,rel:"noopener",target:"_blank",href:t}))}if(b.url){const{url:t,hash:e}=b;h(s,o("a",{text:e,rel:"noopener",target:"_blank",href:t}))}if(w.url){const{url:t}=w,n=w.article_id;let i;i="Published"===c?o("a",{text:n,rel:"noopener",target:"_blank",href:t}):0!==n.length?o("a",{text:p,rel:"noopener",target:"_blank",href:t}):o("p",{text:"-"}),h(e,i)}}async function w(e){if(e.origin===S)try{const{action:o,data:i}=JSON.parse(e.data);"ISCN_WIDGET_READY"===o?async function(){const{ISCNWindow:e}=lcPostInfo;if(!e)throw new Error("POPUP_WINDOW_NOT_FOUND");e.postMessage(JSON.stringify({action:"INIT_WIDGET"}),S);try{const n=await jQuery.ajax({type:"GET",url:`${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/arweave/upload`,dataType:"json",method:"GET",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",likecoinApiSettings.nonce)}}),{files:o,title:i,tags:s,url:a,author:r,authorDescription:c,description:l,mattersIPFSHash:d}=n,u=[];if(d){const t=`ipfs://${d}`;u.push(t)}e.postMessage(JSON.stringify({action:"SUBMIT_ISCN_DATA",data:{files:o,metadata:{name:i,tags:s,url:a,author:r,authorDescription:c,description:l,fingerprints:u,type:"article",license:"",recordNotes:t,memo:t}}}),S)}catch(t){console.error("error occured when submitting ISCN:"),console.error(t),lcPostInfo.mainStatus="failed"}}():"ARWEAVE_SUBMITTED"===o?async function(t){const{ipfsHash:e,arweaveId:o}=t;if(e&&o){lcPostInfo.arweaveIPFSHash=e,lcPostInfo.arweaveId=o,g(n,m(lcPostInfo.mainStatus));const t={arweaveIPFSHash:e,arweaveId:o};try{await jQuery.ajax({type:"POST",url:`${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/arweave`,dataType:"json",contentType:"application/json; charset=UTF-8",data:JSON.stringify(t),method:"POST",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",likecoinApiSettings.nonce)}})}catch(t){console.error(t)}finally{await P()}}}(i):"ISCN_SUBMITTED"===o?async function(t){lcPostInfo.mainStatus="onRegisterISCN";try{const{tx_hash:e,error:n,success:o,iscnId:i}=t;if(n||!1===o)throw new Error("REGISTER_ISCN_SERVER_ERROR");await jQuery.ajax({type:"POST",url:`${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/metadata`,dataType:"json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({iscnHash:e,iscnId:i}),method:"POST",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",likecoinApiSettings.nonce)}}),lcPostInfo.iscnHash=e,lcPostInfo.iscnId=i,lcPostInfo.mainStatus="done"}catch(t){console.error(t),lcPostInfo.mainStatus="failed"}finally{await P()}}(i):console.warn(`Unknown event: ${o}`)}catch(t){console.error(t)}}async function y(t){t&&t.preventDefault();const{siteurl:e}=likecoinApiSettings,{url:o}=lcPostInfo;lcPostInfo.mainStatus="onRegisterISCN",g(n,m(lcPostInfo.mainStatus));const i=encodeURIComponent(e),s=encodeURIComponent(lcPostInfo.iscnId||""),a=encodeURIComponent(o),r=`${S}/nft/url?opener=1&platform=wordpress&redirect_uri=${i}&url=${a}&iscn_id=${s}&update=${s?1:0}`,c=window.open(r,"likeCoISCNWindow","menubar=no,location=no,width=576,height=768");if(!c||c.closed||void 0===c.closed)return lcPostInfo.mainStatus="failedPopup",void g(n,m(lcPostInfo.mainStatus));lcPostInfo.ISCNWindow=c,lcPostInfo.mainStatus="initial",window.addEventListener("message",w,!1)}(()=>{const t=document.getElementById("lcPublishRefreshBtn");t&&t.addEventListener("click",P),P()})()}();
  • likecoin/trunk/assets/js/sidebar/index.asset.php

    r2912658 r2955414  
    11<?php return array(
    22    'dependencies' => array( 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-wordcount' ),
    3     'version'      => 'b67094d4d96b1230990a',
     3    'version'      => 'cd6f88cb1cd5682ed03d',
    44);
  • likecoin/trunk/assets/js/sidebar/index.js

    r2912658 r2955414  
    1 !function(){var e={669:function(e,t,n){e.exports=n(609)},448:function(e,t,n){"use strict";var r=n(867),a=n(26),i=n(372),s=n(327),o=n(97),c=n(109),l=n(985),u=n(61);e.exports=function(e){return new Promise((function(t,n){var d=e.data,p=e.headers,m=e.responseType;r.isFormData(d)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(h+":"+g)}var E=o(e.baseURL,e.url);function v(){if(f){var r="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f};a(t,n,i),f=null}}if(f.open(e.method.toUpperCase(),s(E,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(v)},f.onabort=function(){f&&(n(u("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(u("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(u(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var S=(e.withCredentials||l(E))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;S&&(p[e.xsrfHeaderName]=S)}"setRequestHeader"in f&&r.forEach(p,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),m&&"json"!==m&&(f.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),n(e),f=null)})),d||(d=null),f.send(d)}))}},609:function(e,t,n){"use strict";var r=n(867),a=n(849),i=n(321),s=n(185);function o(e){var t=new i(e),n=a(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var c=o(n(655));c.Axios=i,c.create=function(e){return o(s(c.defaults,e))},c.Cancel=n(263),c.CancelToken=n(972),c.isCancel=n(502),c.all=function(e){return Promise.all(e)},c.spread=n(713),c.isAxiosError=n(268),e.exports=c,e.exports.default=c},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,n){"use strict";var r=n(263);function a(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.source=function(){var e;return{token:new a((function(t){e=t})),cancel:e}},e.exports=a},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,n){"use strict";var r=n(867),a=n(327),i=n(782),s=n(572),o=n(185),c=n(875),l=c.validators;function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=o(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:l.transitional(l.boolean,"1.0.0"),forcedJSONParsing:l.transitional(l.boolean,"1.0.0"),clarifyTimeoutError:l.transitional(l.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var a,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var u=[s,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(i),a=Promise.resolve(e);u.length;)a=a.then(u.shift(),u.shift());return a}for(var d=e;n.length;){var p=n.shift(),m=n.shift();try{d=p(d)}catch(e){m(e);break}}try{a=s(d)}catch(e){return Promise.reject(e)}for(;i.length;)a=a.then(i.shift(),i.shift());return a},u.prototype.getUri=function(e){return e=o(this.defaults,e),a(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,n){return this.request(o(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,n,r){return this.request(o(r||{},{method:e,url:t,data:n}))}})),e.exports=u},782:function(e,t,n){"use strict";var r=n(867);function a(){this.handlers=[]}a.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=a},97:function(e,t,n){"use strict";var r=n(793),a=n(303);e.exports=function(e,t){return e&&!r(t)?a(e,t):t}},61:function(e,t,n){"use strict";var r=n(481);e.exports=function(e,t,n,a,i){var s=new Error(e);return r(s,t,n,a,i)}},572:function(e,t,n){"use strict";var r=n(867),a=n(527),i=n(502),s=n(655);function o(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return o(e),e.headers=e.headers||{},e.data=a.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return o(e),t.data=a.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(o(e),t&&t.response&&(t.response.data=a.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,n,r,a){return e.config=t,n&&(e.code=n),e.request=r,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:function(e,t,n){"use strict";var r=n(867);e.exports=function(e,t){t=t||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function l(a){r.isUndefined(t[a])?r.isUndefined(e[a])||(n[a]=c(void 0,e[a])):n[a]=c(e[a],t[a])}r.forEach(a,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(i,l),r.forEach(s,(function(a){r.isUndefined(t[a])?r.isUndefined(e[a])||(n[a]=c(void 0,e[a])):n[a]=c(void 0,t[a])})),r.forEach(o,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var u=a.concat(i).concat(s).concat(o),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return r.forEach(d,l),n}},26:function(e,t,n){"use strict";var r=n(61);e.exports=function(e,t,n){var a=n.config.validateStatus;n.status&&a&&!a(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},527:function(e,t,n){"use strict";var r=n(867),a=n(655);e.exports=function(e,t,n){var i=this||a;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},655:function(e,t,n){"use strict";var r=n(867),a=n(16),i=n(481),s={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(448)),c),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(o(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||a&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(s)})),e.exports=l},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},327:function(e,t,n){"use strict";var r=n(867);function a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(a(t)+"="+a(e))})))})),i=s.join("&")}if(i){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,n){"use strict";var r=n(867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,a,i,s){var o=[];o.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),r.isString(a)&&o.push("path="+a),r.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.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)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,n){"use strict";var r=n(867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function a(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{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}}return e=a(window.location.href),function(t){var n=r.isString(t)?a(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},16:function(e,t,n){"use strict";var r=n(867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},109:function(e,t,n){"use strict";var r=n(867),a=["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,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&a.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,n){"use strict";var r=n(593),a={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){a[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=r.version.split(".");function o(e,t){for(var n=t?t.split("."):s,r=e.split("."),a=0;a<3;a++){if(n[a]>r[a])return!0;if(n[a]<r[a])return!1}return!1}a.transitional=function(e,t,n){var a=t&&o(t);function s(e,t){return"[Axios v"+r.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new Error(s(r," has been removed in "+t));return a&&!i[r]&&(i[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}},e.exports={isOlderVersion:o,assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),a=r.length;a-- >0;){var i=r[a],s=t[i];if(s){var o=e[i],c=void 0===o||s(o,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:a}},867:function(e,t,n){"use strict";var r=n(849),a=Object.prototype.toString;function i(e){return"[object Array]"===a.call(e)}function s(e){return void 0===e}function o(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===a.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:o,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:l,isStream:function(e){return o(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,a=arguments.length;r<a;r++)u(arguments[r],n);return t},extend:function(e,t,n){return u(t,(function(t,a){e[a]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},593:function(e){"use strict";e.exports=JSON.parse('{"_args":[["axios@0.21.4","/Users/william/likecoin-wordpress"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/Users/william/likecoin-wordpress","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.plugins,r=window.React,a=window.wp.data,i=window.wp.editPost,s=window.wp.i18n,o=function(t){return(0,e.createElement)("div",{onClick:t.onClick,style:t.paddingLeft?{paddingLeft:t.paddingLeft}:{}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 30 30"},(0,e.createElement)("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},(0,e.createElement)("g",{fill:t.color,transform:"translate(0 1)"},(0,e.createElement)("path",{d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z"})))))},c=function(t){return(0,e.createElement)("div",{className:"SideBarStatusRowTitle"},(0,e.createElement)("p",{style:{marginBottom:"0px"}}," ",t.title," "))},l=function(t){return(0,e.createElement)("div",{className:"sidebarStatusTitleOuterDiv"},(0,e.createElement)(c,{title:t.title}),t.status&&(0,e.createElement)("div",{className:"SideBarStatusRowDetails"}," ",t.link&&(0,e.createElement)("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"longLink"},t.status)," ",!t.link&&t.status))},u=function(t){return(0,e.createElement)(l,{title:(0,s.__)("State","likecoin"),status:(0,e.createElement)("div",{className:"flexBoxRow"},!t.isCurrentPostPublished&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"greyDot"})," ",(0,e.createElement)("div",{className:"postStatusDiv"},`${(0,s.__)("Not Ready","likecoin")}`)),t.isCurrentPostPublished&&!t.ISCNId&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"redDot"})," ",(0,e.createElement)("div",{className:"postStatusDiv"},`${(0,s.__)("Ready","likecoin")}`)),t.isCurrentPostPublished&&t.ISCNId&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"greenDot"})," ",(0,e.createElement)("div",{className:"postStatusDiv"},`${(0,s.__)("Published","likecoin")}`)))})},d=function(t){const[n,l]=(0,r.useState)(!1),[d,p]=(0,r.useState)(!1),[m,f]=(0,r.useState)(!0),[h,g]=(0,r.useState)(!0),E=(0,a.useSelect)((e=>e("core/editor").isCurrentPostPublished())),v=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("modified_gmt")));return(0,r.useEffect)((()=>{f(!!(E&&t.ISCNTimestamp&&Date.parse(`${v}Z`)>t.ISCNTimestamp))}),[E,v,t.ISCNTimestamp]),(0,r.useEffect)((()=>g(!!t.ISCNId)),[t.ISCNId]),(0,r.useEffect)((()=>{l(!E&&t.mattersDraftId),p(E&&t.mattersArticleId)}),[E,t]),(0,e.createElement)(i.PluginDocumentSettingPanel,{name:"depub-panel",title:(0,s.__)("Web3Press","likecoin"),className:"depub-panel",icon:(0,e.createElement)(o,{color:"#9B9B9B",paddingLeft:"10px"})},(0,e.createElement)("div",{className:"postStatusInfoPanelOuterDiv"},(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)("div",{className:"divOuterHolderStatusInfoPanel"},(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u,{isCurrentPostPublished:E,ISCNId:t.ISCNId}),n&&(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)(c,{title:(0,s.__)("Distribution","likecoin")}),(0,e.createElement)("div",null,(0,e.createElement)("a",{rel:"noopener noreferrer",target:"_blank",className:"icon",href:`https://matters.news/me/drafts/${t.mattersDraftId}`},"Matters"))),d&&(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)(c,{title:(0,s.__)("Distribution","likecoin")}),(0,e.createElement)("div",null,(0,e.createElement)("a",{rel:"noopener noreferrer",target:"_blank",className:"icon",href:`https://matters.news/@${t.mattersId}/${t.mattersArticleSlug}-${t.mattersPublishedArticleHash}`},"Matters"))),(0,e.createElement)("div",{className:"postStatusInfoRowOuterDiv"},!E&&(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",style:{minWidth:"0",width:"100%"},onClick:e=>{e.preventDefault(),document.getElementsByClassName("editor-post-publish-button__button")[0].click()}},(0,s.__)("Publish your post first","likecoin")),E&&!t.ISCNId&&(0,e.createElement)("div",{style:{display:"flex",flexDirection:"row",width:"100%"}},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleRegisterISCN},(0,s.__)("Publish","likecoin")),(0,e.createElement)("button",{className:"whiteBackgroundBlueTextSmallBtn",onClick:e=>{e.preventDefault(),document.querySelector('[aria-label="Web3Press"]').click()}},(0,s.__)("Details","likecoin"))),m&&(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleRegisterISCN},(0,s.__)("Update","likecoin")),h&&(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleNFTAction},t.NFTClassId?(0,s.__)("View NFT","likecoin"):(0,s.__)("Mint NFT","likecoin"))))))))},p=window.wp.components,m=window.wp.wordcount,f=n(669),h=n.n(f),g=window.wp.apiFetch,E=n.n(g);function v(e,t){if(a.createReduxStore){const n=(0,a.createReduxStore)(e,t);return(0,a.register)(n),n}return(0,a.registerStore)(e,t),e}const{postId:S,likecoHost:I}=window.wpApiSettings,N="likecoin/iscn_info_store",w=`/likecoin/v1/posts/${S}/iscn/arweave/upload`,_=`/likecoin/v1/posts/${S}/iscn/arweave`,C=`/likecoin/v1/posts/${S}/iscn/metadata`,T=`/likecoin/v1/posts/${S}/iscn/metadata`,b=`https://api.${I}/likernft/mint?iscn_id=`,D={DBArticleTitle:"",DBAuthorDescription:"",DBDescription:"",DBAuthor:"",DBArticleURL:"",DBArticleTags:[],DBISCNId:"",DBArweaveId:"",DBLicense:"",DBISCNVersion:0,DBISCNTimestamp:0,DBNFTClassId:"",DBMattersIPFSHash:"",DBMattersPublishedArticleHash:"",DBMattersDraftId:"",DBMattersArticleId:"",DBMattersId:"",DBMattersArticleSlug:""},B={getISCNInfo(){return{type:"GET_ISCN_INFO"}},setISCNInfo(e){return{type:"SET_ISCN_INFO",data:e}},setISCNLicense(e){return{type:"SET_ISCN_LICENSE",license:e}},getNFTInfo(e){return{type:"GET_NFT_INFO",iscnId:e}},setNFTInfo(e){return{type:"SET_NFT_INFO",data:e}},setHTTPErrors(e){return{type:"SET_ERROR_MESSAGE",errorMsg:e}},*fetchISCNRegisterData(){const e=yield{type:"GET_ISCN_REGISTER_DATA"};if(!e)throw new Error("NO_ISCN_REGISTER_DATA_RETURNED");return e},*postArweaveInfoData(e){const t=yield{type:"POST_ARWEAVE_INFO_DATA",data:e};if(!t)throw new Error("NO_ARWEAVE_INFO_RETURNED");yield{type:"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE",data:{arweaveId:t.data.arweave_id}}},*postISCNInfoData(e){const t=yield{type:"POST_ISCN_INFO_DATA",data:e};if(!t)throw new Error("NO_ISCN_INFO_RETURNED");const{iscn_id:n,iscnVersion:r,iscnTimestamp:a}=t;yield{type:"UPDATE_ISCN_ID_GLOBAL_STATE",data:{iscnId:n,iscnTimestamp:a,iscnVersion:r}}}},k={reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ISCN_INFO":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:t.data.iscnTimestamp,DBLicense:t.data.license,DBNFTClassId:t.data.nftClassId,DBArticleTitle:t.data.title,DBAuthorDescription:t.data.authorDescription,DBDescription:t.data.description,DBAuthor:t.data.author,DBArticleURL:t.data.url,DBArticleTags:t.data.tags,DBArweaveId:t.data.arweaveId,DBMattersIPFSHash:t.data.mattersIPFSHash,DBMattersPublishedArticleHash:t.data.mattersPublishedArticleHash,DBMattersArticleId:t.data.mattersArticleId,DBMattersId:t.data.mattersId,DBMattersArticleSlug:t.data.mattersArticleSlug};case"SET_NFT_INFO":return{...e,DBNFTClassId:t.data.classId};case"SET_ISCN_LICENSE":return{...e,DBLicense:t.license};case"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE":{const{arweaveId:n}=t.data;return{...e,DBArweaveId:n}}case"UPDATE_ISCN_ID_GLOBAL_STATE":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:1e3*t.data.iscnTimestamp};default:return e}},controls:{GET_ISCN_INFO(){return E()({path:C})},GET_NFT_INFO(e){return h().get(`${b}${encodeURIComponent(e.iscnId)}`)},GET_ISCN_REGISTER_DATA(){return E()({path:w})},POST_ARWEAVE_INFO_DATA(e){return E()({method:"POST",path:_,data:{arweaveIPFSHash:e.data.ipfsHash,arweaveId:e.data.arweaveId}})},POST_ISCN_INFO_DATA(e){return E()({method:"POST",path:T,data:{iscnHash:e.data.iscnHash,iscnId:e.data.iscnId,iscnVersion:e.data.iscnVersion,iscnTimestamp:e.data.timestamp,iscnData:{license:e.data.license}}})}},selectors:{selectISCNInfo:e=>e,selectNFTInfo:e=>e,getLicense(e){return e.DBLicense}},resolvers:{*selectISCNInfo(){try{const e=yield B.getISCNInfo(),{iscnId:t,iscnVersion:n,iscnTimestamp:r,iscnData:a={},title:i,authorDescription:s,description:o,author:c,url:l,tags:u,arweaveId:d,arweaveIPFSHash:p,mattersIPFSHash:m,mattersPublishedArticleHash:f,mattersArticleId:h,mattersId:g,mattersArticleSlug:E}=e;return B.setISCNInfo({...a,iscnId:t,iscnVersion:n,iscnTimestamp:1e3*r,title:i,authorDescription:s,description:o,author:c,url:l,tags:u,arweaveId:d,arweaveIPFSHash:p,mattersIPFSHash:m,mattersPublishedArticleHash:f,mattersArticleId:h,mattersId:g,mattersArticleSlug:E})}catch(e){return B.setHTTPErrors(e.message)}},*selectNFTInfo(e){if(!e)return{};try{const t=yield B.getNFTInfo(e),{classId:n,currentPrice:r}=t.data;return B.setNFTInfo({classId:n,currentPrice:r})}catch(e){return console.error(e),{}}}},actions:B};v(N,k);var y=function(){return(0,e.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 4C7.94772 4 7.5 4.44772 7.5 5C7.5 5.55228 7.94772 6 8.5 6H9V14H8.5C7.94772 14 7.5 14.4477 7.5 15C7.5 15.5523 7.94772 16 8.5 16H11.5C12.0523 16 12.5 15.5523 12.5 15C12.5 14.4477 12.0523 14 11.5 14H11V6H11.5C12.0523 6 12.5 5.55228 12.5 5C12.5 4.44772 12.0523 4 11.5 4H8.5ZM15.2929 13.7071C14.9024 13.3166 14.9024 12.6834 15.2929 12.2929L17.5858 10L15.2929 7.70711C14.9024 7.31658 14.9024 6.68342 15.2929 6.29289C15.6834 5.90237 16.3166 5.90237 16.7071 6.29289L19.7071 9.29289C20.0976 9.68342 20.0976 10.3166 19.7071 10.7071L16.7071 13.7071C16.3166 14.0976 15.6834 14.0976 15.2929 13.7071ZM4.70711 6.29289C5.09763 6.68342 5.09763 7.31658 4.70711 7.70711L2.41421 10L4.70711 12.2929C5.09763 12.6834 5.09763 13.3166 4.70711 13.7071C4.31658 14.0976 3.68342 14.0976 3.29289 13.7071L0.292893 10.7071C-0.0976311 10.3166 -0.097631 9.68342 0.292893 9.29289L3.29289 6.29289C3.68342 5.90237 4.31658 5.90237 4.70711 6.29289Z",fill:"#4A4A4A"}))},A=function(t){return(0,e.createElement)("div",{onClick:t.onClick,style:{cursor:"pointer"}},(0,e.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.8384 3.74744C15.2289 3.35691 15.8621 3.35691 16.2526 3.74744C16.6431 4.13796 16.6431 4.77113 16.2526 5.16165L11.4143 10L16.2526 14.8383C16.6431 15.2289 16.6431 15.862 16.2526 16.2526C15.8621 16.6431 15.2289 16.6431 14.8384 16.2526L10 11.4142L5.1617 16.2526C4.77117 16.6431 4.13801 16.6431 3.74748 16.2526C3.35696 15.862 3.35696 15.2289 3.74748 14.8383L8.58583 10L3.74748 5.16165C3.35696 4.77113 3.35696 4.13796 3.74748 3.74744C4.13801 3.35691 4.77117 3.35691 5.1617 3.74744L10 8.58578L14.8384 3.74744Z",fill:"#9B9B9B"})))},x=function(t){return(0,e.createElement)("div",null,(0,e.createElement)("p",{className:"sidebarPopUpRowTitle"}," ",t.title," "))},P=function(t){return(0,e.createElement)("div",null,(0,e.createElement)("p",null,t.details))},O=function(t){return(0,e.createElement)("div",{className:"TagOuterDiv"},(0,e.createElement)("p",null," ",t.tag," "))};const R=[{name:(0,s.__)("(Not set)","likecoin"),value:""},{name:"CC0",value:"http://creativecommons.org/publicdomain/zero/1.0/"},{name:"CC-BY",value:"https://creativecommons.org/licenses/by/4.0/"},{name:"CC-BY-SA",value:"https://creativecommons.org/licenses/by-sa/4.0/"}];var L=function(t){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(c,{title:(0,s.__)("License:","likecoin")}),(0,e.createElement)("select",{name:"license",onChange:e=>{t.onSelect(e.target.value)},disabled:!!t.disabled||null},R.map((n=>(0,e.createElement)("option",{selected:n.value===t.defaultLicense||null,value:n.value},n.name)))))},U=function(t){return(0,e.createElement)("div",{onClick:t.onClick,style:t.paddingLeft?{paddingLeft:t.paddingLeft}:{}},(0,e.createElement)("svg",{width:"22",height:"22",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z",fill:t.color})))};const{postId:F}=window.wpApiSettings,M="likecoin/button_info_store",j=`/likecoin/v1/posts/${F}/button/settings`,H=`/likecoin/v1/posts/${F}/button/settings`,$={isWidgetEnabled:!1,isOptionDisabled:!0,isLikerIdMissing:!1},V={getButtonSettings(){return{type:"GET_BUTTON_SETTINGS"}},setButtonSettings(e){return{type:"SET_BUTTON_SETTINGS",data:e}},*fetchButtonSettings(){const e=yield{type:"GET_BUTTON_SETTINGS"};if(!e)throw new Error("FETCH_BUTTON_SETTINGS_ERROR");return e},*postButtonSettings(e){if(!(yield{type:"POST_BUTTON_SETTINGS",data:e}))throw new Error("FAIL_TO_POST_BUTTON_SETTINGS")}},W={reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,t=arguments.length>1?arguments[1]:void 0;if("SET_BUTTON_SETTINGS"===t.type){const{isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:a}=t.data;return{...e,isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:a}}return e},controls:{GET_BUTTON_SETTINGS(){return E()({path:j})},POST_BUTTON_SETTINGS(e){return E()({method:"POST",path:H,data:{is_widget_enabled:e.data.isEnabled?"bottom":"none"}})}},selectors:{getButtonSettings:e=>e},resolvers:{*getButtonSettings(){const e=yield V.getButtonSettings(),{is_widget_enabled:t,is_disabled:n,show_no_id_error:r}=e;return V.setButtonSettings({isWidgetEnabled:t,isOptionDisabled:n,isLikerIdMissing:r})}},actions:V};v(M,W);const{likecoHost:G,likerlandHost:q}=window.wpApiSettings;var z=function(t){const n=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("content"))),{postISCNInfoData:d,postArweaveInfoData:f,setISCNLicense:h}=(0,a.useDispatch)(N),g=(0,a.useSelect)((e=>e(N).getLicense())),{isWidgetEnabled:E,isOptionDisabled:v}=(0,a.useSelect)((e=>e(M).getButtonSettings())),{setButtonSettings:S,postButtonSettings:I}=(0,a.useDispatch)(M),w=(0,m.count)(n,"words",{}),[_,C]=(0,r.useState)(!1),[T,b]=(0,r.useState)(!0),[D,B]=(0,r.useState)(!0),[k,R]=(0,r.useState)(!0),[F,j]=(0,r.useState)(!0),[H,$]=(0,r.useState)("#3973B9"),V=(0,a.useSelect)((e=>e("core/edit-post").isPluginSidebarOpened())),W=(0,a.useSelect)((e=>e("core/editor").isCurrentPostPublished())),z=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("modified_gmt")));function J(e){e.preventDefault(),C(!_)}return(0,r.useEffect)((()=>{B(!!W&&!t.ISCNId)}),[W,t.ISCNId]),(0,r.useEffect)((()=>{R(!!(W&&t.ISCNTimestamp&&Date.parse(`${z}Z`)>t.ISCNTimestamp))}),[W,z,t.ISCNTimestamp]),(0,r.useEffect)((()=>j(!!t.ISCNId)),[t.ISCNId]),(0,r.useEffect)((()=>{const e=t.ISCNVersion?`${t.ISCNVersion} (${new Date(t.ISCNTimestamp).toGMTString()})`:"-";b(e)}),[t.ISCNVersion,t.ISCNTimestamp]),(0,r.useEffect)((()=>{$(V?"white":"#3973B9")}),[V,$]),(0,e.createElement)(i.PluginSidebar,{name:"likecoin-sidebar",title:(0,s.__)("Web3Press","likecoin"),icon:(0,e.createElement)(U,{color:H})},(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"dePubMainSidebarDiv"},(0,e.createElement)("p",{className:"dePubStatusRed"},(0,s.__)("Decentralized Publishing","likecoin"))),(0,e.createElement)("div",{className:"likeCoinIconOuterDiv"},(0,e.createElement)(o,{color:"#9B9B9B"}))),!W&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:e=>{e.preventDefault(),document.getElementsByClassName("editor-post-publish-button__button")[0].click()}},(0,s.__)("Publish your post first","likecoin")))),D&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:t.handleRegisterISCN},(0,s.__)("Publish","likecoin")))),k&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:t.handleRegisterISCN},(0,s.__)("Update","likecoin")))),F&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:t.handleNFTAction},t.NFTClassId?(0,s.__)("View NFT","likecoin"):(0,s.__)("Mint NFT","likecoin")))),(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)(l,{title:(0,s.__)("Publishing Status","likecoin"),status:""}),(0,e.createElement)(u,{isCurrentPostPublished:W,ISCNId:t.ISCNId}),(0,e.createElement)(l,{title:(0,s.__)("ISCN ID","likecoin"),status:t.ISCNId?t.ISCNId:"-",link:t.ISCNId?`https://app.${G}/view/${encodeURIComponent(t.ISCNId)}`:""}),t.ISCNId&&(0,e.createElement)(l,{title:(0,s.__)("NFT","likecoin"),status:t.NFTClassId?t.NFTClassId:(0,s.__)("Mint Now","likecoin"),link:t.NFTClassId?`https://${q}/nft/class/${encodeURIComponent(t.NFTClassId)}`:""}),(0,e.createElement)(l,{title:(0,s.__)("Storage","likecoin"),status:t.arweaveId?t.arweaveId:"-",link:t.arweaveId?`https://arweave.net/${t.arweaveId}`:""}),(0,e.createElement)(l,{title:(0,s.__)("Version","likecoin"),status:T})),!v&&(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)(c,{title:(0,s.__)("Widget","likecoin")}),(0,e.createElement)(p.CheckboxControl,{label:(0,s.__)("Enable in-post widget","likecoin"),help:(0,s.__)("Embed widget in this post (Overrides site setting)","likecoin"),checked:!!E,onChange:function(){const e=!E;I({isEnabled:e}),S({isWidgetEnabled:e})}})),(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)(L,{defaultLicense:g,onSelect:function(e){h(e)},disabled:!(!W||D||k)})),(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)("div",{className:"sidebarStatusTitleOuterDivPointer",onClick:J},(0,e.createElement)(c,{title:(0,s.__)("Metadata","likecoin")}),(0,e.createElement)("div",{className:"marginLeftAuto"},(0,e.createElement)(y,null))),_&&(0,e.createElement)("div",{className:"popUpWrapper"},(0,e.createElement)("div",{className:"popUpMainTitleDiv"},(0,e.createElement)(x,{title:(0,s.__)("Metadata","likecoin")}),(0,e.createElement)("div",{className:"popUpCrossIconWrapper"},(0,e.createElement)(A,{onClick:J}))),(0,e.createElement)("div",{className:"popUpMainContentWrapper"},(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Title","likecoin")}),(0,e.createElement)(P,{details:t.title})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Description","likecoin")}),(0,e.createElement)(P,{details:t.description})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Author","likecoin")}),(0,e.createElement)(P,{details:t.author})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Tag","likecoin")}),(0,e.createElement)("div",{className:"flexBoxRow"},t.tags&&t.tags.length>0&&t.tags.map((t=>(0,e.createElement)(O,{tag:t}))))),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Url","likecoin")}),(0,e.createElement)(P,{details:t.url})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(c,{title:(0,s.__)("Word count","likecoin")}),(0,e.createElement)(P,{details:w}))))),(0,e.createElement)(p.Panel,null,(0,e.createElement)(p.PanelBody,{title:(0,s.__)("Advanced","likecoin"),initialOpen:!1},(0,e.createElement)(p.PanelRow,null,(0,e.createElement)(p.TextControl,{label:(0,s.__)("Override ISCN ID","likecoin"),value:t.ISCNId,onChange:e=>d({iscnId:e})})),(0,e.createElement)(p.PanelRow,null,(0,e.createElement)(p.TextControl,{label:(0,s.__)("Override Arweave ID","likecoin"),value:t.arweaveId,onChange:e=>{f({arweaveId:e})}})))))},J=function(){return(0,e.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"components-panel__arrow",role:"img","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}))},Z=function(){return(0,e.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"components-panel__arrow",role:"img","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}))},X=function(t){const[n,a]=(0,r.useState)(!0);return(0,e.createElement)(i.PluginPostPublishPanel,null,(0,e.createElement)("div",{className:"divOuterHolderStatusInfoPanel"},(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)("div",{className:"dePubDiv"},(0,e.createElement)("p",{className:"dePubStatusRed"},(0,s.__)("Web3Press","likecoin"))),(0,e.createElement)("div",{className:"likeCoinIconOuterDiv"},(0,e.createElement)(o,{color:"#9B9B9B"})),(0,e.createElement)("div",{onClick:function(e){e.preventDefault(),a(!n)},className:"marginLeftAuto"},!n&&(0,e.createElement)(Z,null),n&&(0,e.createElement)(J,null))),n&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)("div",null,(0,e.createElement)("p",{className:"flexBoxRowNormalText"},(0,s.__)("Register your content to decetralized publishing","likecoin")))),(0,e.createElement)("div",{className:"registerISCNBtnOuterDiv"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleRegisterISCN},(0,s.__)("Publish","likecoin")),(0,e.createElement)("button",{className:"whiteBackgroundBlueTextSmallBtn",onClick:e=>{e.preventDefault(),document.querySelector('[aria-label="Close panel"]').click()}},(0,s.__)("Details","likecoin"))))))};const{siteurl:K,likecoHost:Y,likerlandHost:Q}=window.wpApiSettings,ee=`https://app.${Y}`,te=`https://app.${Y}`,ne="LikeCoin WordPress Plugin";var re=function(){const t=(0,a.useSelect)((e=>e("core/editor").getCurrentPost())),{DBLIKEPayAmount:n,DBMemo:i,DBArticleTitle:s,DBAuthorDescription:o,DBDescription:c,DBAuthor:l,DBArticleURL:u,DBArticleTags:p,DBISCNId:m,DBArweaveId:f,DBMattersIPFSHash:h,DBMattersPublishedArticleHash:g,DBISCNVersion:E,DBISCNTimestamp:v,DBMattersDraftId:S,DBMattersArticleId:I,DBMattersId:w,DBMattersArticleSlug:_,DBLicense:C}=(0,a.useSelect)((e=>e(N).selectISCNInfo())),{DBNFTClassId:T}=(0,a.useSelect)((e=>e(N).selectNFTInfo(m))),{fetchISCNRegisterData:b,postArweaveInfoData:D,postISCNInfoData:B}=(0,a.useDispatch)(N),[k,y]=(0,r.useState)(s),[A,x]=(0,r.useState)(o),[P,O]=(0,r.useState)(c),[R,L]=(0,r.useState)(l),[U,F]=(0,r.useState)(u),[M,j]=(0,r.useState)(p),[H,$]=(0,r.useState)(m),[V,W]=(0,r.useState)(T),[G,q]=(0,r.useState)(f),[J,Z]=(0,r.useState)(h),[Y,re]=(0,r.useState)(g),[ae,ie]=(0,r.useState)(E),[se,oe]=(0,r.useState)(v),[ce,le]=(0,r.useState)(S),[ue,de]=(0,r.useState)(I),[pe,me]=(0,r.useState)(w),[fe,he]=(0,r.useState)(_),[ge,Ee]=(0,r.useState)([]),[ve,Se]=(0,r.useState)(!1),[Ie,Ne]=(0,r.useState)(!1),[we,_e]=(0,r.useState)(null),Ce=(0,r.useCallback)((e=>{const{ipfsHash:t,arweaveId:n}=e;q(n),D({ipfsHash:t,arweaveId:n})}),[D]),Te=(0,r.useCallback)((e=>{const{tx_hash:t,iscnId:n,iscnVersion:r,timestamp:a}=e;B({iscnHash:t,iscnId:n,iscnVersion:r,timestamp:a,license:C})}),[C,B]),be=(0,r.useCallback)((async()=>{we.postMessage(JSON.stringify({action:"INIT_WIDGET"}),ee);const e=await b(),{files:t,title:n,tags:r,url:a,author:i,authorDescription:s,description:o}=e;y(n),j(r),F(a),L(i),x(s),O(o);const c=JSON.stringify({action:"SUBMIT_ISCN_DATA",data:{metadata:{fingerprints:ge,name:n,tags:r,url:a,author:i,authorDescription:s,description:o,type:"article",license:C,recordNotes:ne,memo:ne},files:t}});we.postMessage(c,ee)}),[C,b,ge,we]),De=(0,r.useCallback)((async e=>{if(e&&e.data&&(e.origin===ee||e.origin===te)&&"string"==typeof e.data)try{const{action:t,data:n}=JSON.parse(e.data);"ISCN_WIDGET_READY"===t?Ne(!0):"ARWEAVE_SUBMITTED"===t?Ce(n):"ISCN_SUBMITTED"===t?Te(n):"NFT_MINT_DATA"===t?n.classId&&W(n.classId):console.warn(`Unknown event: ${t}`)}catch(e){console.error(e)}}),[Ce,Te]),Be=(0,r.useCallback)((()=>{const e=encodeURIComponent(H||""),n=encodeURIComponent(K),r=encodeURIComponent(t.link||""),a=`${ee}/nft/url?opener=1&platform=wordpress&redirect_uri=${n}&url=${r}&iscn_id=${e}&update=${e?1:0}`;try{const e=window.open(a,"likePayWindow","menubar=no,location=no,width=576,height=768");if(!e||e.closed||void 0===e.closed)return void console.error("POPUP_BLOCKED");_e(e),window.addEventListener("message",De,!1)}catch(e){console.error(e)}}),[H,t.link,De]);async function ke(e){e.preventDefault(),Se(!0)}(0,r.useEffect)((()=>{if(y(s),o){const{length:e}=o.split(" ");if(e>200){const t=o.split(" ").slice(0,197).join(" ").concat("...").concat(o.split(" ")[e-1]);x(t)}else x(o)}c&&O(c),L(l),F(u),j(p),$(m),W(T),ie(E),oe(v),le(S),de(I),me(w),he(_),re(g),q(f)}),[n,i,s,o,c,l,u,p,m,E,v,T,S,I,w,_,g,f]),(0,r.useEffect)((()=>{Z(h);const e=[];if(h&&"-"!==h){const t=`ipfs://${h}`;e.push(t)}e.length>1&&Ee(e)}),[h]),(0,r.useEffect)((()=>{ve&&(Be(),Se(!1)),Ie&&(be(),Ne(!1))}),[ve,Ie,Be,be]);const ye=async e=>{if(e&&e.data&&e.origin===te&&"string"==typeof e.data)try{const{action:t,data:n}=JSON.parse(e.data);"NFT_MINT_DATA"===t?n.classId&&W(n.classId):console.warn(`Unknown event: ${t}`)}catch(e){console.error(e)}},Ae=(0,r.useCallback)((e=>{if(e.preventDefault(),!H)return;const t=encodeURIComponent(K),n=V?`https://${Q}/nft/class/${encodeURIComponent(V)}`:`${te}/nft/iscn/${encodeURIComponent(H)}?opener=1&platform=wordpress&redirect_uri=${t}`;window.open(n,"_blank")&&!V&&window.addEventListener("message",ye,!1)}),[H,V]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(z,{handleRegisterISCN:ke,handleNFTAction:Ae,ISCNId:H,arweaveId:G,ISCNVersion:ae,ISCNTimestamp:se,NFTClassId:V,mattersDraftId:ce,mattersArticleId:ue,mattersId:pe,mattersArticleSlug:fe,mattersIPFSHash:J,mattersPublishedArticleHash:Y,title:k,authorDescription:A,description:P,author:R,tags:M,url:U}),(0,e.createElement)(d,{handleRegisterISCN:ke,handleNFTAction:Ae,ISCNId:H,arweaveId:G,ISCNVersion:ae,ISCNTimestamp:se,NFTClassId:V,mattersDraftId:ce,mattersArticleId:ue,mattersId:pe,mattersArticleSlug:fe,mattersIPFSHash:J,mattersPublishedArticleHash:Y}),(0,e.createElement)(X,{handleRegisterISCN:ke}))};(0,t.registerPlugin)("likecoin-sidebar",{render:function(){return(0,e.createElement)(re,null)}})}()}();
     1!function(){var e={669:function(e,t,n){e.exports=n(609)},448:function(e,t,n){"use strict";var r=n(867),a=n(26),i=n(372),s=n(327),o=n(97),c=n(109),l=n(985),u=n(61);e.exports=function(e){return new Promise((function(t,n){var d=e.data,p=e.headers,m=e.responseType;r.isFormData(d)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(h+":"+g)}var E=o(e.baseURL,e.url);function v(){if(f){var r="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f};a(t,n,i),f=null}}if(f.open(e.method.toUpperCase(),s(E,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(v)},f.onabort=function(){f&&(n(u("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(u("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(u(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var S=(e.withCredentials||l(E))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;S&&(p[e.xsrfHeaderName]=S)}"setRequestHeader"in f&&r.forEach(p,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),m&&"json"!==m&&(f.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),n(e),f=null)})),d||(d=null),f.send(d)}))}},609:function(e,t,n){"use strict";var r=n(867),a=n(849),i=n(321),s=n(185);function o(e){var t=new i(e),n=a(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var c=o(n(655));c.Axios=i,c.create=function(e){return o(s(c.defaults,e))},c.Cancel=n(263),c.CancelToken=n(972),c.isCancel=n(502),c.all=function(e){return Promise.all(e)},c.spread=n(713),c.isAxiosError=n(268),e.exports=c,e.exports.default=c},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,n){"use strict";var r=n(263);function a(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.source=function(){var e;return{token:new a((function(t){e=t})),cancel:e}},e.exports=a},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,n){"use strict";var r=n(867),a=n(327),i=n(782),s=n(572),o=n(185),c=n(875),l=c.validators;function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=o(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:l.transitional(l.boolean,"1.0.0"),forcedJSONParsing:l.transitional(l.boolean,"1.0.0"),clarifyTimeoutError:l.transitional(l.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var a,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var u=[s,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(i),a=Promise.resolve(e);u.length;)a=a.then(u.shift(),u.shift());return a}for(var d=e;n.length;){var p=n.shift(),m=n.shift();try{d=p(d)}catch(e){m(e);break}}try{a=s(d)}catch(e){return Promise.reject(e)}for(;i.length;)a=a.then(i.shift(),i.shift());return a},u.prototype.getUri=function(e){return e=o(this.defaults,e),a(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,n){return this.request(o(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,n,r){return this.request(o(r||{},{method:e,url:t,data:n}))}})),e.exports=u},782:function(e,t,n){"use strict";var r=n(867);function a(){this.handlers=[]}a.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=a},97:function(e,t,n){"use strict";var r=n(793),a=n(303);e.exports=function(e,t){return e&&!r(t)?a(e,t):t}},61:function(e,t,n){"use strict";var r=n(481);e.exports=function(e,t,n,a,i){var s=new Error(e);return r(s,t,n,a,i)}},572:function(e,t,n){"use strict";var r=n(867),a=n(527),i=n(502),s=n(655);function o(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return o(e),e.headers=e.headers||{},e.data=a.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return o(e),t.data=a.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(o(e),t&&t.response&&(t.response.data=a.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,n,r,a){return e.config=t,n&&(e.code=n),e.request=r,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:function(e,t,n){"use strict";var r=n(867);e.exports=function(e,t){t=t||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function l(a){r.isUndefined(t[a])?r.isUndefined(e[a])||(n[a]=c(void 0,e[a])):n[a]=c(e[a],t[a])}r.forEach(a,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(i,l),r.forEach(s,(function(a){r.isUndefined(t[a])?r.isUndefined(e[a])||(n[a]=c(void 0,e[a])):n[a]=c(void 0,t[a])})),r.forEach(o,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var u=a.concat(i).concat(s).concat(o),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return r.forEach(d,l),n}},26:function(e,t,n){"use strict";var r=n(61);e.exports=function(e,t,n){var a=n.config.validateStatus;n.status&&a&&!a(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},527:function(e,t,n){"use strict";var r=n(867),a=n(655);e.exports=function(e,t,n){var i=this||a;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},655:function(e,t,n){"use strict";var r=n(867),a=n(16),i=n(481),s={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(448)),c),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(o(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||a&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(s)})),e.exports=l},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},327:function(e,t,n){"use strict";var r=n(867);function a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(a(t)+"="+a(e))})))})),i=s.join("&")}if(i){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,n){"use strict";var r=n(867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,a,i,s){var o=[];o.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),r.isString(a)&&o.push("path="+a),r.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.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)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,n){"use strict";var r=n(867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function a(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{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}}return e=a(window.location.href),function(t){var n=r.isString(t)?a(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},16:function(e,t,n){"use strict";var r=n(867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},109:function(e,t,n){"use strict";var r=n(867),a=["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,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&a.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,n){"use strict";var r=n(593),a={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){a[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=r.version.split(".");function o(e,t){for(var n=t?t.split("."):s,r=e.split("."),a=0;a<3;a++){if(n[a]>r[a])return!0;if(n[a]<r[a])return!1}return!1}a.transitional=function(e,t,n){var a=t&&o(t);function s(e,t){return"[Axios v"+r.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new Error(s(r," has been removed in "+t));return a&&!i[r]&&(i[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}},e.exports={isOlderVersion:o,assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),a=r.length;a-- >0;){var i=r[a],s=t[i];if(s){var o=e[i],c=void 0===o||s(o,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:a}},867:function(e,t,n){"use strict";var r=n(849),a=Object.prototype.toString;function i(e){return"[object Array]"===a.call(e)}function s(e){return void 0===e}function o(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===a.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:o,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:l,isStream:function(e){return o(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,a=arguments.length;r<a;r++)u(arguments[r],n);return t},extend:function(e,t,n){return u(t,(function(t,a){e[a]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},593:function(e){"use strict";e.exports=JSON.parse('{"_args":[["axios@0.21.4","/Users/william/likecoin-wordpress"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/Users/william/likecoin-wordpress","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.plugins,r=window.React,a=window.wp.data,i=window.wp.editPost,s=window.wp.i18n,o=function(t){return(0,e.createElement)("div",{onClick:t.onClick,style:t.paddingLeft?{paddingLeft:t.paddingLeft}:{}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 30 30"},(0,e.createElement)("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},(0,e.createElement)("g",{fill:t.color,transform:"translate(0 1)"},(0,e.createElement)("path",{d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z"})))))},c=function(t){return(0,e.createElement)("div",{className:"SideBarStatusRowTitle"},(0,e.createElement)("p",{style:{marginBottom:"0px"}}," ",t.title," "))},l=function(t){return(0,e.createElement)("div",{className:"sidebarStatusTitleOuterDiv"},(0,e.createElement)(c,{title:t.title}),t.status&&(0,e.createElement)("div",{className:"SideBarStatusRowDetails"}," ",t.link&&(0,e.createElement)("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"longLink"},t.status)," ",!t.link&&t.status))},u=function(t){return(0,e.createElement)(l,{title:(0,s.__)("State","likecoin"),status:(0,e.createElement)("div",{className:"flexBoxRow"},!t.isCurrentPostPublished&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"greyDot"})," ",(0,e.createElement)("div",{className:"postStatusDiv"},`${(0,s.__)("Not Ready","likecoin")}`)),t.isCurrentPostPublished&&!t.ISCNId&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"redDot"})," ",(0,e.createElement)("div",{className:"postStatusDiv"},`${(0,s.__)("Ready","likecoin")}`)),t.isCurrentPostPublished&&t.ISCNId&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"greenDot"})," ",(0,e.createElement)("div",{className:"postStatusDiv"},`${(0,s.__)("Published","likecoin")}`)))})},d=function(t){const[n,l]=(0,r.useState)(!1),[d,p]=(0,r.useState)(!1),[m,f]=(0,r.useState)(!0),[h,g]=(0,r.useState)(!0),E=(0,a.useSelect)((e=>e("core/editor").isCurrentPostPublished())),v=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("modified_gmt")));return(0,r.useEffect)((()=>{f(!!(E&&Date.parse(`${v}Z`)>(t.ISCNTimestamp||0)))}),[E,v,t.ISCNTimestamp]),(0,r.useEffect)((()=>g(!!t.ISCNId)),[t.ISCNId]),(0,r.useEffect)((()=>{l(!E&&t.mattersDraftId),p(E&&t.mattersArticleId)}),[E,t]),(0,e.createElement)(i.PluginDocumentSettingPanel,{name:"depub-panel",title:(0,s.__)("Web3Press","likecoin"),className:"depub-panel",icon:(0,e.createElement)(o,{color:"#9B9B9B",paddingLeft:"10px"})},(0,e.createElement)("div",{className:"postStatusInfoPanelOuterDiv"},(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)("div",{className:"divOuterHolderStatusInfoPanel"},(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u,{isCurrentPostPublished:E,ISCNId:t.ISCNId}),n&&(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)(c,{title:(0,s.__)("Distribution","likecoin")}),(0,e.createElement)("div",null,(0,e.createElement)("a",{rel:"noopener noreferrer",target:"_blank",className:"icon",href:`https://matters.news/me/drafts/${t.mattersDraftId}`},"Matters"))),d&&(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)(c,{title:(0,s.__)("Distribution","likecoin")}),(0,e.createElement)("div",null,(0,e.createElement)("a",{rel:"noopener noreferrer",target:"_blank",className:"icon",href:`https://matters.news/@${t.mattersId}/${t.mattersArticleSlug}-${t.mattersPublishedArticleHash}`},"Matters"))),(0,e.createElement)("div",{className:"postStatusInfoRowOuterDiv"},!E&&(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",style:{minWidth:"0",width:"100%"},onClick:e=>{e.preventDefault(),document.getElementsByClassName("editor-post-publish-button__button")[0].click()}},(0,s.__)("Publish your post first","likecoin")),E&&!t.ISCNId&&(0,e.createElement)("div",{style:{display:"flex",flexDirection:"row",width:"100%"}},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleRegisterISCN},(0,s.__)("Publish","likecoin")),(0,e.createElement)("button",{className:"whiteBackgroundBlueTextSmallBtn",onClick:e=>{e.preventDefault(),document.querySelector('[aria-label="Web3Press"]').click()}},(0,s.__)("Details","likecoin"))),m&&(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleRegisterISCN},(0,s.__)("Update","likecoin")),h&&(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleNFTAction},t.NFTClassId?(0,s.__)("View NFT","likecoin"):(0,s.__)("Mint NFT","likecoin"))))))))},p=window.wp.components,m=window.wp.wordcount,f=n(669),h=n.n(f),g=window.wp.apiFetch,E=n.n(g);function v(e,t){if(a.createReduxStore){const n=(0,a.createReduxStore)(e,t);return(0,a.register)(n),n}return(0,a.registerStore)(e,t),e}const{postId:S,likecoHost:I}=window.likecoinApiSettings,N="likecoin/iscn_info_store",w=`/likecoin/v1/posts/${S}/iscn/arweave/upload`,_=`/likecoin/v1/posts/${S}/iscn/arweave`,C=`/likecoin/v1/posts/${S}/iscn/metadata`,T=`/likecoin/v1/posts/${S}/iscn/metadata`,b=`https://api.${I}/likernft/mint?iscn_id=`,D={DBArticleTitle:"",DBAuthorDescription:"",DBDescription:"",DBAuthor:"",DBArticleURL:"",DBArticleTags:[],DBISCNId:"",DBArweaveId:"",DBLicense:"",DBISCNVersion:0,DBISCNTimestamp:0,DBNFTClassId:"",DBMattersIPFSHash:"",DBMattersPublishedArticleHash:"",DBMattersDraftId:"",DBMattersArticleId:"",DBMattersId:"",DBMattersArticleSlug:""},k={getISCNInfo(){return{type:"GET_ISCN_INFO"}},setISCNInfo(e){return{type:"SET_ISCN_INFO",data:e}},setISCNLicense(e){return{type:"SET_ISCN_LICENSE",license:e}},getNFTInfo(e){return{type:"GET_NFT_INFO",iscnId:e}},setNFTInfo(e){return{type:"SET_NFT_INFO",data:e}},setHTTPErrors(e){return{type:"SET_ERROR_MESSAGE",errorMsg:e}},*fetchISCNRegisterData(){const e=yield{type:"GET_ISCN_REGISTER_DATA"};if(!e)throw new Error("NO_ISCN_REGISTER_DATA_RETURNED");return e},*postArweaveInfoData(e){const t=yield{type:"POST_ARWEAVE_INFO_DATA",data:e};if(!t)throw new Error("NO_ARWEAVE_INFO_RETURNED");yield{type:"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE",data:{arweaveId:t.data.arweave_id}}},*postISCNInfoData(e){const t=yield{type:"POST_ISCN_INFO_DATA",data:e};if(!t)throw new Error("NO_ISCN_INFO_RETURNED");const{iscn_id:n,iscnVersion:r,iscnTimestamp:a}=t;yield{type:"UPDATE_ISCN_ID_GLOBAL_STATE",data:{iscnId:n,iscnTimestamp:a,iscnVersion:r}}}},B={reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ISCN_INFO":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:t.data.iscnTimestamp,DBLicense:t.data.license,DBNFTClassId:t.data.nftClassId,DBArticleTitle:t.data.title,DBAuthorDescription:t.data.authorDescription,DBDescription:t.data.description,DBAuthor:t.data.author,DBArticleURL:t.data.url,DBArticleTags:t.data.tags,DBArweaveId:t.data.arweaveId,DBMattersIPFSHash:t.data.mattersIPFSHash,DBMattersPublishedArticleHash:t.data.mattersPublishedArticleHash,DBMattersArticleId:t.data.mattersArticleId,DBMattersId:t.data.mattersId,DBMattersArticleSlug:t.data.mattersArticleSlug};case"SET_NFT_INFO":return{...e,DBNFTClassId:t.data.classId};case"SET_ISCN_LICENSE":return{...e,DBLicense:t.license};case"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE":{const{arweaveId:n}=t.data;return{...e,DBArweaveId:n}}case"UPDATE_ISCN_ID_GLOBAL_STATE":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:1e3*t.data.iscnTimestamp};default:return e}},controls:{GET_ISCN_INFO(){return E()({path:C})},GET_NFT_INFO(e){return h().get(`${b}${encodeURIComponent(e.iscnId)}`)},GET_ISCN_REGISTER_DATA(){return E()({path:w})},POST_ARWEAVE_INFO_DATA(e){return E()({method:"POST",path:_,data:{arweaveIPFSHash:e.data.ipfsHash,arweaveId:e.data.arweaveId}})},POST_ISCN_INFO_DATA(e){return E()({method:"POST",path:T,data:{iscnHash:e.data.iscnHash,iscnId:e.data.iscnId,iscnVersion:e.data.iscnVersion,iscnTimestamp:e.data.timestamp,iscnData:{license:e.data.license}}})}},selectors:{selectISCNInfo:e=>e,selectNFTInfo:e=>e,getLicense(e){return e.DBLicense}},resolvers:{*selectISCNInfo(){try{const e=yield k.getISCNInfo(),{iscnId:t,iscnVersion:n,iscnTimestamp:r,iscnData:a={},title:i,authorDescription:s,description:o,author:c,url:l,tags:u,arweaveId:d,arweaveIPFSHash:p,mattersIPFSHash:m,mattersPublishedArticleHash:f,mattersArticleId:h,mattersId:g,mattersArticleSlug:E}=e;return k.setISCNInfo({...a,iscnId:t,iscnVersion:n,iscnTimestamp:1e3*r,title:i,authorDescription:s,description:o,author:c,url:l,tags:u,arweaveId:d,arweaveIPFSHash:p,mattersIPFSHash:m,mattersPublishedArticleHash:f,mattersArticleId:h,mattersId:g,mattersArticleSlug:E})}catch(e){return k.setHTTPErrors(e.message)}},*selectNFTInfo(e){if(!e)return{};try{const t=yield k.getNFTInfo(e),{classId:n,currentPrice:r}=t.data;return k.setNFTInfo({classId:n,currentPrice:r})}catch(e){return console.error(e),{}}}},actions:k};v(N,B);var y=function(){return(0,e.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 4C7.94772 4 7.5 4.44772 7.5 5C7.5 5.55228 7.94772 6 8.5 6H9V14H8.5C7.94772 14 7.5 14.4477 7.5 15C7.5 15.5523 7.94772 16 8.5 16H11.5C12.0523 16 12.5 15.5523 12.5 15C12.5 14.4477 12.0523 14 11.5 14H11V6H11.5C12.0523 6 12.5 5.55228 12.5 5C12.5 4.44772 12.0523 4 11.5 4H8.5ZM15.2929 13.7071C14.9024 13.3166 14.9024 12.6834 15.2929 12.2929L17.5858 10L15.2929 7.70711C14.9024 7.31658 14.9024 6.68342 15.2929 6.29289C15.6834 5.90237 16.3166 5.90237 16.7071 6.29289L19.7071 9.29289C20.0976 9.68342 20.0976 10.3166 19.7071 10.7071L16.7071 13.7071C16.3166 14.0976 15.6834 14.0976 15.2929 13.7071ZM4.70711 6.29289C5.09763 6.68342 5.09763 7.31658 4.70711 7.70711L2.41421 10L4.70711 12.2929C5.09763 12.6834 5.09763 13.3166 4.70711 13.7071C4.31658 14.0976 3.68342 14.0976 3.29289 13.7071L0.292893 10.7071C-0.0976311 10.3166 -0.097631 9.68342 0.292893 9.29289L3.29289 6.29289C3.68342 5.90237 4.31658 5.90237 4.70711 6.29289Z",fill:"#4A4A4A"}))},A=function(t){return(0,e.createElement)("div",{onClick:t.onClick,style:{cursor:"pointer"}},(0,e.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.8384 3.74744C15.2289 3.35691 15.8621 3.35691 16.2526 3.74744C16.6431 4.13796 16.6431 4.77113 16.2526 5.16165L11.4143 10L16.2526 14.8383C16.6431 15.2289 16.6431 15.862 16.2526 16.2526C15.8621 16.6431 15.2289 16.6431 14.8384 16.2526L10 11.4142L5.1617 16.2526C4.77117 16.6431 4.13801 16.6431 3.74748 16.2526C3.35696 15.862 3.35696 15.2289 3.74748 14.8383L8.58583 10L3.74748 5.16165C3.35696 4.77113 3.35696 4.13796 3.74748 3.74744C4.13801 3.35691 4.77117 3.35691 5.1617 3.74744L10 8.58578L14.8384 3.74744Z",fill:"#9B9B9B"})))},x=function(t){return(0,e.createElement)("div",null,(0,e.createElement)("p",{className:"sidebarPopUpRowTitle"}," ",t.title," "))},P=function(t){return(0,e.createElement)("div",null,(0,e.createElement)("p",null,t.details))},O=function(t){return(0,e.createElement)("div",{className:"TagOuterDiv"},(0,e.createElement)("p",null," ",t.tag," "))};const R=[{name:(0,s.__)("(Not set)","likecoin"),value:""},{name:"CC0",value:"http://creativecommons.org/publicdomain/zero/1.0/"},{name:"CC-BY",value:"https://creativecommons.org/licenses/by/4.0/"},{name:"CC-BY-SA",value:"https://creativecommons.org/licenses/by-sa/4.0/"}];var L=function(t){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(c,{title:(0,s.__)("License:","likecoin")}),(0,e.createElement)("select",{name:"license",onChange:e=>{t.onSelect(e.target.value)},disabled:!!t.disabled||null},R.map((n=>(0,e.createElement)("option",{selected:n.value===t.defaultLicense||null,value:n.value},n.name)))))},U=function(t){return(0,e.createElement)("div",{onClick:t.onClick,style:t.paddingLeft?{paddingLeft:t.paddingLeft}:{}},(0,e.createElement)("svg",{width:"22",height:"22",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z",fill:t.color})))};const{postId:F}=window.likecoinApiSettings,M="likecoin/button_info_store",j=`/likecoin/v1/posts/${F}/button/settings`,H=`/likecoin/v1/posts/${F}/button/settings`,$={isWidgetEnabled:!1,isOptionDisabled:!0,isLikerIdMissing:!1},V={getButtonSettings(){return{type:"GET_BUTTON_SETTINGS"}},setButtonSettings(e){return{type:"SET_BUTTON_SETTINGS",data:e}},*fetchButtonSettings(){const e=yield{type:"GET_BUTTON_SETTINGS"};if(!e)throw new Error("FETCH_BUTTON_SETTINGS_ERROR");return e},*postButtonSettings(e){if(!(yield{type:"POST_BUTTON_SETTINGS",data:e}))throw new Error("FAIL_TO_POST_BUTTON_SETTINGS")}},W={reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,t=arguments.length>1?arguments[1]:void 0;if("SET_BUTTON_SETTINGS"===t.type){const{isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:a}=t.data;return{...e,isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:a}}return e},controls:{GET_BUTTON_SETTINGS(){return E()({path:j})},POST_BUTTON_SETTINGS(e){return E()({method:"POST",path:H,data:{is_widget_enabled:e.data.isEnabled?"bottom":"none"}})}},selectors:{getButtonSettings:e=>e},resolvers:{*getButtonSettings(){const e=yield V.getButtonSettings(),{is_widget_enabled:t,is_disabled:n,show_no_id_error:r}=e;return V.setButtonSettings({isWidgetEnabled:t,isOptionDisabled:n,isLikerIdMissing:r})}},actions:V};v(M,W);const{likecoHost:G,likerlandHost:q}=window.likecoinApiSettings;var z=function(t){const n=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("content"))),{postISCNInfoData:d,postArweaveInfoData:f,setISCNLicense:h}=(0,a.useDispatch)(N),g=(0,a.useSelect)((e=>e(N).getLicense())),{isWidgetEnabled:E,isOptionDisabled:v}=(0,a.useSelect)((e=>e(M).getButtonSettings())),{setButtonSettings:S,postButtonSettings:I}=(0,a.useDispatch)(M),w=(0,m.count)(n,"words",{}),[_,C]=(0,r.useState)(!1),[T,b]=(0,r.useState)(!0),[D,k]=(0,r.useState)(!0),[B,R]=(0,r.useState)(!0),[F,j]=(0,r.useState)(!0),[H,$]=(0,r.useState)("#3973B9"),V=(0,a.useSelect)((e=>e("core/edit-post").isPluginSidebarOpened())),W=(0,a.useSelect)((e=>e("core/editor").isCurrentPostPublished())),z=(0,a.useSelect)((e=>e("core/editor").getEditedPostAttribute("modified_gmt")));function J(e){e.preventDefault(),C(!_)}return(0,r.useEffect)((()=>{k(!!W&&!t.ISCNId)}),[W,t.ISCNId]),(0,r.useEffect)((()=>{R(!!(W&&Date.parse(`${z}Z`)>(t.ISCNTimestamp||0)))}),[W,z,t.ISCNTimestamp]),(0,r.useEffect)((()=>j(!!t.ISCNId)),[t.ISCNId]),(0,r.useEffect)((()=>{const e=t.ISCNVersion?`${t.ISCNVersion} (${new Date(t.ISCNTimestamp).toGMTString()})`:"-";b(e)}),[t.ISCNVersion,t.ISCNTimestamp]),(0,r.useEffect)((()=>{$(V?"white":"#3973B9")}),[V,$]),(0,e.createElement)(i.PluginSidebar,{name:"likecoin-sidebar",title:(0,s.__)("Web3Press","likecoin"),icon:(0,e.createElement)(U,{color:H})},(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"dePubMainSidebarDiv"},(0,e.createElement)("p",{className:"dePubStatusRed"},(0,s.__)("Decentralized Publishing","likecoin"))),(0,e.createElement)("div",{className:"likeCoinIconOuterDiv"},(0,e.createElement)(o,{color:"#9B9B9B"}))),!W&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:e=>{e.preventDefault(),document.getElementsByClassName("editor-post-publish-button__button")[0].click()}},(0,s.__)("Publish your post first","likecoin")))),D&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:t.handleRegisterISCN},(0,s.__)("Publish","likecoin")))),B&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:t.handleRegisterISCN},(0,s.__)("Update","likecoin")))),F&&(0,e.createElement)("div",{className:"divOuterHolder"},(0,e.createElement)("div",{className:"divInnerHolder"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextBtn",onClick:t.handleNFTAction},t.NFTClassId?(0,s.__)("View NFT","likecoin"):(0,s.__)("Mint NFT","likecoin")))),(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)(l,{title:(0,s.__)("Publishing Status","likecoin"),status:""}),(0,e.createElement)(u,{isCurrentPostPublished:W,ISCNId:t.ISCNId}),(0,e.createElement)(l,{title:(0,s.__)("ISCN ID","likecoin"),status:t.ISCNId?t.ISCNId:"-",link:t.ISCNId?`https://app.${G}/view/${encodeURIComponent(t.ISCNId)}`:""}),t.ISCNId&&(0,e.createElement)(l,{title:(0,s.__)("NFT","likecoin"),status:t.NFTClassId?t.NFTClassId:(0,s.__)("Mint Now","likecoin"),link:t.NFTClassId?`https://${q}/nft/class/${encodeURIComponent(t.NFTClassId)}`:""}),(0,e.createElement)(l,{title:(0,s.__)("Storage","likecoin"),status:t.arweaveId?t.arweaveId:"-",link:t.arweaveId?`https://arweave.net/${t.arweaveId}`:""}),(0,e.createElement)(l,{title:(0,s.__)("Version","likecoin"),status:T})),!v&&(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)(c,{title:(0,s.__)("Widget","likecoin")}),(0,e.createElement)(p.CheckboxControl,{label:(0,s.__)("Enable in-post widget","likecoin"),help:(0,s.__)("Embed widget in this post (Overrides site setting)","likecoin"),checked:!!E,onChange:function(){const e=!E;I({isEnabled:e}),S({isWidgetEnabled:e})}})),(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)(L,{defaultLicense:g,onSelect:function(e){h(e)},disabled:!(!W||D||B)})),(0,e.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,e.createElement)("div",{className:"sidebarStatusTitleOuterDivPointer",onClick:J},(0,e.createElement)(c,{title:(0,s.__)("Metadata","likecoin")}),(0,e.createElement)("div",{className:"marginLeftAuto"},(0,e.createElement)(y,null))),_&&(0,e.createElement)("div",{className:"popUpWrapper"},(0,e.createElement)("div",{className:"popUpMainTitleDiv"},(0,e.createElement)(x,{title:(0,s.__)("Metadata","likecoin")}),(0,e.createElement)("div",{className:"popUpCrossIconWrapper"},(0,e.createElement)(A,{onClick:J}))),(0,e.createElement)("div",{className:"popUpMainContentWrapper"},(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Title","likecoin")}),(0,e.createElement)(P,{details:t.title})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Description","likecoin")}),(0,e.createElement)(P,{details:t.description})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Author","likecoin")}),(0,e.createElement)(P,{details:t.author})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Tag","likecoin")}),(0,e.createElement)("div",{className:"flexBoxRow"},t.tags&&t.tags.length>0&&t.tags.map((t=>(0,e.createElement)(O,{tag:t}))))),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(x,{title:(0,s.__)("Url","likecoin")}),(0,e.createElement)(P,{details:t.url})),(0,e.createElement)("div",{className:"popUpMainContentRow"},(0,e.createElement)(c,{title:(0,s.__)("Word count","likecoin")}),(0,e.createElement)(P,{details:w}))))),(0,e.createElement)(p.Panel,null,(0,e.createElement)(p.PanelBody,{title:(0,s.__)("Advanced","likecoin"),initialOpen:!1},(0,e.createElement)(p.PanelRow,null,(0,e.createElement)(p.TextControl,{label:(0,s.__)("Override ISCN ID","likecoin"),value:t.ISCNId,onChange:e=>d({iscnId:e})})),(0,e.createElement)(p.PanelRow,null,(0,e.createElement)(p.TextControl,{label:(0,s.__)("Override Arweave ID","likecoin"),value:t.arweaveId,onChange:e=>{f({arweaveId:e})}})))))},J=function(){return(0,e.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"components-panel__arrow",role:"img","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}))},Z=function(){return(0,e.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"components-panel__arrow",role:"img","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}))},X=function(t){const[n,a]=(0,r.useState)(!0);return(0,e.createElement)(i.PluginPostPublishPanel,null,(0,e.createElement)("div",{className:"divOuterHolderStatusInfoPanel"},(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)("div",{className:"dePubDiv"},(0,e.createElement)("p",{className:"dePubStatusRed"},(0,s.__)("Web3Press","likecoin"))),(0,e.createElement)("div",{className:"likeCoinIconOuterDiv"},(0,e.createElement)(o,{color:"#9B9B9B"})),(0,e.createElement)("div",{onClick:function(e){e.preventDefault(),a(!n)},className:"marginLeftAuto"},!n&&(0,e.createElement)(Z,null),n&&(0,e.createElement)(J,null))),n&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"flexBoxRow"},(0,e.createElement)("div",null,(0,e.createElement)("p",{className:"flexBoxRowNormalText"},(0,s.__)("Register your content to decetralized publishing","likecoin")))),(0,e.createElement)("div",{className:"registerISCNBtnOuterDiv"},(0,e.createElement)("button",{className:"blueBackgroundWhiteTextSmallBtn",onClick:t.handleRegisterISCN},(0,s.__)("Publish","likecoin")),(0,e.createElement)("button",{className:"whiteBackgroundBlueTextSmallBtn",onClick:e=>{e.preventDefault(),document.querySelector('[aria-label="Close panel"]').click()}},(0,s.__)("Details","likecoin"))))))};const{siteurl:K,likecoHost:Y,likerlandHost:Q}=window.likecoinApiSettings,ee=`https://app.${Y}`,te=`https://app.${Y}`,ne="LikeCoin WordPress Plugin";var re=function(){const t=(0,a.useSelect)((e=>e("core/editor").getCurrentPost())),{DBLIKEPayAmount:n,DBMemo:i,DBArticleTitle:s,DBAuthorDescription:o,DBDescription:c,DBAuthor:l,DBArticleURL:u,DBArticleTags:p,DBISCNId:m,DBArweaveId:f,DBMattersIPFSHash:h,DBMattersPublishedArticleHash:g,DBISCNVersion:E,DBISCNTimestamp:v,DBMattersDraftId:S,DBMattersArticleId:I,DBMattersId:w,DBMattersArticleSlug:_,DBLicense:C}=(0,a.useSelect)((e=>e(N).selectISCNInfo())),{DBNFTClassId:T}=(0,a.useSelect)((e=>e(N).selectNFTInfo(m))),{fetchISCNRegisterData:b,postArweaveInfoData:D,postISCNInfoData:k}=(0,a.useDispatch)(N),[B,y]=(0,r.useState)(s),[A,x]=(0,r.useState)(o),[P,O]=(0,r.useState)(c),[R,L]=(0,r.useState)(l),[U,F]=(0,r.useState)(u),[M,j]=(0,r.useState)(p),[H,$]=(0,r.useState)(m),[V,W]=(0,r.useState)(T),[G,q]=(0,r.useState)(f),[J,Z]=(0,r.useState)(h),[Y,re]=(0,r.useState)(g),[ae,ie]=(0,r.useState)(E),[se,oe]=(0,r.useState)(v),[ce,le]=(0,r.useState)(S),[ue,de]=(0,r.useState)(I),[pe,me]=(0,r.useState)(w),[fe,he]=(0,r.useState)(_),[ge,Ee]=(0,r.useState)([]),[ve,Se]=(0,r.useState)(!1),[Ie,Ne]=(0,r.useState)(!1),[we,_e]=(0,r.useState)(null),Ce=(0,r.useCallback)((e=>{const{ipfsHash:t,arweaveId:n}=e;q(n),D({ipfsHash:t,arweaveId:n})}),[D]),Te=(0,r.useCallback)((e=>{const{tx_hash:t,iscnId:n,iscnVersion:r,timestamp:a}=e;k({iscnHash:t,iscnId:n,iscnVersion:r,timestamp:a,license:C})}),[C,k]),be=(0,r.useCallback)((async()=>{we.postMessage(JSON.stringify({action:"INIT_WIDGET"}),ee);const e=await b(),{files:t,title:n,tags:r,url:a,author:i,authorDescription:s,description:o}=e;y(n),j(r),F(a),L(i),x(s),O(o);const c=JSON.stringify({action:"SUBMIT_ISCN_DATA",data:{metadata:{fingerprints:ge,name:n,tags:r,url:a,author:i,authorDescription:s,description:o,type:"article",license:C,recordNotes:ne,memo:ne},files:t}});we.postMessage(c,ee)}),[C,b,ge,we]),De=(0,r.useCallback)((async e=>{if(e&&e.data&&(e.origin===ee||e.origin===te)&&"string"==typeof e.data)try{const{action:t,data:n}=JSON.parse(e.data);"ISCN_WIDGET_READY"===t?Ne(!0):"ARWEAVE_SUBMITTED"===t?Ce(n):"ISCN_SUBMITTED"===t?Te(n):"NFT_MINT_DATA"===t?n.classId&&W(n.classId):console.warn(`Unknown event: ${t}`)}catch(e){console.error(e)}}),[Ce,Te]),ke=(0,r.useCallback)((()=>{const e=encodeURIComponent(H||""),n=encodeURIComponent(K),r=encodeURIComponent(t.link||""),a=`${ee}/nft/url?opener=1&platform=wordpress&redirect_uri=${n}&url=${r}&iscn_id=${e}&update=${e?1:0}`;try{const e=window.open(a,"likePayWindow","menubar=no,location=no,width=576,height=768");if(!e||e.closed||void 0===e.closed)return void console.error("POPUP_BLOCKED");_e(e),window.addEventListener("message",De,!1)}catch(e){console.error(e)}}),[H,t.link,De]);async function Be(e){e.preventDefault(),Se(!0)}(0,r.useEffect)((()=>{if(y(s),o){const{length:e}=o.split(" ");if(e>200){const t=o.split(" ").slice(0,197).join(" ").concat("...").concat(o.split(" ")[e-1]);x(t)}else x(o)}c&&O(c),L(l),F(u),j(p),$(m),W(T),ie(E),oe(v),le(S),de(I),me(w),he(_),re(g),q(f)}),[n,i,s,o,c,l,u,p,m,E,v,T,S,I,w,_,g,f]),(0,r.useEffect)((()=>{Z(h);const e=[];if(h&&"-"!==h){const t=`ipfs://${h}`;e.push(t)}e.length>1&&Ee(e)}),[h]),(0,r.useEffect)((()=>{ve&&(ke(),Se(!1)),Ie&&(be(),Ne(!1))}),[ve,Ie,ke,be]);const ye=async e=>{if(e&&e.data&&e.origin===te&&"string"==typeof e.data)try{const{action:t,data:n}=JSON.parse(e.data);"NFT_MINT_DATA"===t?n.classId&&W(n.classId):console.warn(`Unknown event: ${t}`)}catch(e){console.error(e)}},Ae=(0,r.useCallback)((e=>{if(e.preventDefault(),!H)return;const t=encodeURIComponent(K),n=V?`https://${Q}/nft/class/${encodeURIComponent(V)}`:`${te}/nft/iscn/${encodeURIComponent(H)}?opener=1&platform=wordpress&redirect_uri=${t}`;window.open(n,"_blank")&&!V&&window.addEventListener("message",ye,!1)}),[H,V]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(z,{handleRegisterISCN:Be,handleNFTAction:Ae,ISCNId:H,arweaveId:G,ISCNVersion:ae,ISCNTimestamp:se,NFTClassId:V,mattersDraftId:ce,mattersArticleId:ue,mattersId:pe,mattersArticleSlug:fe,mattersIPFSHash:J,mattersPublishedArticleHash:Y,title:B,authorDescription:A,description:P,author:R,tags:M,url:U}),(0,e.createElement)(d,{handleRegisterISCN:Be,handleNFTAction:Ae,ISCNId:H,arweaveId:G,ISCNVersion:ae,ISCNTimestamp:se,NFTClassId:V,mattersDraftId:ce,mattersArticleId:ue,mattersId:pe,mattersArticleSlug:fe,mattersIPFSHash:J,mattersPublishedArticleHash:Y}),(0,e.createElement)(X,{handleRegisterISCN:Be}))};(0,t.registerPlugin)("likecoin-sidebar",{render:function(){return(0,e.createElement)(re,null)}})}()}();
  • likecoin/trunk/js/admin-metabox/metabox.js

    r2903806 r2955414  
    1 /* global jQuery, wpApiSettings, lcPostInfo, lcStringInfo */
     1/* global jQuery, likecoinApiSettings, lcPostInfo, lcStringInfo */
    22
    33const ISCN_RECORD_NOTE = 'LikeCoin WordPress Plugin';
     
    3737};
    3838
    39 const ISCN_WIDGET_ORIGIN = `https://app.${window.wpApiSettings.likecoHost}`;
     39const ISCN_WIDGET_ORIGIN = `https://app.${window.likecoinApiSettings.likecoHost}`;
    4040
    4141function updateMainTitleField(signalCSSClass, text) {
     
    8383    isMattersPublished,
    8484    lastModifiedTime,
    85     iscnTimestamp,
     85    iscnTimestamp = 0,
    8686  } = lcPostInfo;
    8787  const res = await jQuery.ajax({
    8888    type: 'POST',
    89     url: `${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/refresh`,
     89    url: `${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/refresh`,
    9090    method: 'POST',
    9191    beforeSend: (xhr) => {
    92       xhr.setRequestHeader('X-WP-Nonce', wpApiSettings.nonce);
     92      xhr.setRequestHeader('X-WP-Nonce', likecoinApiSettings.nonce);
    9393    },
    9494  });
     
    104104      rel: 'noopener',
    105105      target: '_blank',
    106       href: `https://app.${window.wpApiSettings.likecoHost}/view/${iscnIdString}`,
     106      href: `https://app.${window.likecoinApiSettings.likecoHost}/view/${iscnIdString}`,
    107107    });
    108108    updateFieldStatusElement(ISCNStatusTextField, ISCNLink);
     
    233233      await jQuery.ajax({
    234234        type: 'POST',
    235         url: `${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/arweave`,
     235        url: `${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/arweave`,
    236236        dataType: 'json',
    237237        contentType: 'application/json; charset=UTF-8',
     
    239239        method: 'POST',
    240240        beforeSend: (xhr) => {
    241           xhr.setRequestHeader('X-WP-Nonce', wpApiSettings.nonce);
     241          xhr.setRequestHeader('X-WP-Nonce', likecoinApiSettings.nonce);
    242242        },
    243243      });
     
    261261    await jQuery.ajax({
    262262      type: 'POST',
    263       url: `${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/metadata`,
     263      url: `${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/metadata`,
    264264      dataType: 'json',
    265265      contentType: 'application/json; charset=UTF-8',
     
    267267      method: 'POST',
    268268      beforeSend: (xhr) => {
    269         xhr.setRequestHeader('X-WP-Nonce', wpApiSettings.nonce);
     269        xhr.setRequestHeader('X-WP-Nonce', likecoinApiSettings.nonce);
    270270      },
    271271    });
     
    283283async function onSubmitToISCN(e) {
    284284  if (e) e.preventDefault();
    285   const { siteurl } = wpApiSettings;
     285  const { siteurl } = likecoinApiSettings;
    286286  const { url } = lcPostInfo;
    287287  lcPostInfo.mainStatus = 'onRegisterISCN';
     
    313313    const res = await jQuery.ajax({
    314314      type: 'GET',
    315       url: `${wpApiSettings.root}likecoin/v1/posts/${wpApiSettings.postId}/iscn/arweave/upload`,
     315      url: `${likecoinApiSettings.root}likecoin/v1/posts/${likecoinApiSettings.postId}/iscn/arweave/upload`,
    316316      dataType: 'json',
    317317      method: 'GET',
    318318      beforeSend: (xhr) => {
    319         xhr.setRequestHeader('X-WP-Nonce', wpApiSettings.nonce);
     319        xhr.setRequestHeader('X-WP-Nonce', likecoinApiSettings.nonce);
    320320      },
    321321    });
  • likecoin/trunk/js/sidebar/src/pages/LikeCoinPlugin.js

    r2903806 r2955414  
    66import { ISCN_INFO_STORE_NAME } from '../store/iscn-info-store';
    77
    8 const { siteurl, likecoHost, likerlandHost } = window.wpApiSettings;
     8const { siteurl, likecoHost, likerlandHost } = window.likecoinApiSettings;
    99
    1010const ISCN_WIDGET_ORIGIN = `https://app.${likecoHost}`;
  • likecoin/trunk/js/sidebar/src/pages/LikeCoinPluginDocumentSettingPanel.js

    r2866440 r2955414  
    1717  useEffect(() => {
    1818    setShowUpdateISCNButton(!!(isCurrentPostPublished
    19       && props.ISCNTimestamp
    20       && Date.parse(`${postDate}Z`) > props.ISCNTimestamp)); // force parsing as gmt;
     19      && Date.parse(`${postDate}Z`) > (props.ISCNTimestamp || 0))); // force parsing as gmt;
    2120  }, [isCurrentPostPublished, postDate, props.ISCNTimestamp]);
    2221  useEffect(() => setShowNFTButton(!!props.ISCNId), [props.ISCNId]);
  • likecoin/trunk/js/sidebar/src/pages/LikeCoinPluginSideBar.js

    r2912658 r2955414  
    2121import { BUTTON_INFO_STORE_NAME } from '../store/button-info-store';
    2222
    23 const { likecoHost, likerlandHost } = window.wpApiSettings;
     23const { likecoHost, likerlandHost } = window.likecoinApiSettings;
    2424
    2525function LikeCoinPluginSideBar(props) {
     
    5353  useEffect(() => {
    5454    setShowUpdateISCNButton(!!(isCurrentPostPublished
    55       && props.ISCNTimestamp
    56       && Date.parse(`${postDate}Z`) > props.ISCNTimestamp)); // force parsing as gmt
     55      && Date.parse(`${postDate}Z`) > (props.ISCNTimestamp || 0))); // force parsing as gmt
    5756  }, [isCurrentPostPublished, postDate, props.ISCNTimestamp]);
    5857  useEffect(() => setShowNFTButton(!!props.ISCNId), [props.ISCNId]);
  • likecoin/trunk/js/sidebar/src/store/button-info-store.js

    r2888124 r2955414  
    44const {
    55  postId,
    6 } = window.wpApiSettings;
     6} = window.likecoinApiSettings;
    77
    88// eslint-disable-next-line import/prefer-default-export
  • likecoin/trunk/js/sidebar/src/store/iscn-info-store.js

    r2912658 r2955414  
    55const {
    66  postId, likecoHost,
    7 } = window.wpApiSettings;
     7} = window.likecoinApiSettings;
    88
    99// eslint-disable-next-line import/prefer-default-export
  • likecoin/trunk/likecoin.php

    r2912658 r2955414  
    1414 * Plugin URI:   https://github.com/likecoin/likecoin-wordpress
    1515 * Description:  Publishes your posts to the blockchain. Sell your posts, share your work, build community, preserve content.
    16  * Version:      3.1.1
     16 * Version:      3.1.2
    1717 * Author:       LikeCoin
    1818 * Author URI:   https://like.co/
     
    4242define( 'LC_PLUGIN_SLUG', 'likecoin' );
    4343define( 'LC_PLUGIN_NAME', 'Web3Press By LikeCoin' );
    44 define( 'LC_PLUGIN_VERSION', '3.1.1' );
     44define( 'LC_PLUGIN_VERSION', '3.1.2' );
    4545
    4646require_once dirname( __FILE__ ) . '/includes/constant/options.php';
  • likecoin/trunk/readme.txt

    r2912658 r2955414  
    77Tested up to: 6.2
    88Requires PHP: 5.4
    9 Stable tag: 3.1.1
     9Stable tag: 3.1.2
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    151151
    152152== Changelog ==
     153
     154= 3.1.2 =
     155
     156- Fix undefined restful API path issue
     157- Fix duplicated import of sidebar js
    153158
    154159= 3.1.1 =
Note: See TracChangeset for help on using the changeset viewer.