!function(){"use strict";var e={567:function(e){e.exports=window.jQuery},736:function(e){e.exports=window.wp.i18n}},n={};function o(r){var t=n[r];if(void 0!==t)return t.exports;var a=n[r]={exports:{}};return e[r](a,a.exports,o),a.exports}o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,{a:n}),n},o.d=function(e,n){for(var r in n)o.o(n,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e=o(736),n=o(567),r=o.n(n);const _n=e._n,__=e.__,{ajaxUrl:t,connectionsUrl:a,isEnhancedPublishingEnabled:s}=window.jetpackSocialClassicEditorOptions,i=["instagram-business"],c=(e,n)=>{const o=window.wp.media.featuredImage.get(),r=o&&-1!==o,t=e("#pub-connection-needs-media"),a=!!t.html();if(r!==a)return;if(n.forEach((n=>{e(".wpas-submit-"+n).each(((n,o)=>{const t=e(o);t.prop("disabled")||r||t.data("checkedVal",t.prop("checked")),t.prop("checked",r&&t.data("checkedVal")),t.prop("disabled",!r)}))})),r)return void t.removeClass().html("");const i=s?/* translators: %s is the link to the media upload best practices. */__('You need a featured image to share to Instagram. Use the block editor for more advanced media features! <a href="%s" rel="noopener noreferrer" target="_blank">Learn more</a>.',"jetpack-publicize-pkg"):/* translators: %s is the link to the media upload best practices. */__('You need a featured image to share to Instagram. <a href="%s" rel="noopener noreferrer" target="_blank">Learn more</a>.',"jetpack-publicize-pkg",0);t.addClass("notice-warning publicize__notice-media-warning publicize__notice-warning").append(i.replace("%s","https://jetpack.com/redirect/?source=jetpack-social-media-support-information"))};r()((function(e){const n=i.filter((n=>e(".wpas-submit-"+n).length));if(n.length>0){c(e,n);const o=window.wp.media.featuredImage.set;window.wp.media.featuredImage.set=function(r){o(r),c(e,n)}}let o=!1;const r=function(){o||(e.post(t,{action:"test_publicize_conns"},d),o=!0)};let s;window.addEventListener("focus",(()=>{s&&clearTimeout(s),s=setTimeout(r,2e3)}));const p=(n,o)=>o.data?o.data.reduce(((o,r)=>r.connectionTestPassed||n!==(r.connectionTestErrorCode??"broken")?o:(e("#wpas-submit-"+r.id).prop("checked",!1).prop("disabled",!0),o+1)),0):0,d=function(n){o=!1;const r=e("#pub-connection-tests");r.removeClass("test-in-progress").removeClass("below-h2").removeClass("error").removeClass("publicize-token-refresh-message").html("");const t=p("broken",n),s=p("unsupported",n);if(t){
/* translators: %s is the link to the connections page in Calypso */
const e=_n('One of your social connections is broken. Reconnect it on the <a href="%s" rel="noopener noreferrer" target="_blank">connection management</a> page.','Some of your social connections are broken. Reconnect them on the <a href="%s" rel="noopener noreferrer" target="_blank">connection management</a> page.',t,"jetpack-publicize-pkg");r.addClass("below-h2").addClass("error").addClass("publicize-token-refresh-message").append(e.replace("%s",a))}if(s){
/* translators: %s is the link to the connections page in Calypso */
const e=__('Twitter is not supported anymore. <a href="%s" rel="noopener noreferrer" target="_blank">Learn more</a>.',"jetpack-publicize-pkg");t?r.append("<hr />"):r.addClass("below-h2").addClass("error").addClass("publicize-token-refresh-message"),r.append(e.replace("%s",a))}};e("#pub-connection-tests").length&&r()}))}()}();