(()=>{"use strict";const t=window.wp.data,e=window.wp.i18n;let s=!1;(0,t.subscribe)((()=>{if(s)return;if(!seopressPostWatcherData.noticeData)return;const i=wp.data.select("core/editor"),a=seopressPostWatcherData.noticeData||[],o={message:a?.message?a.message:"",options:{id:"redirection-notice",isDismissible:!0,actions:[{label:a?.actionLabel||"",onClick:()=>{const t=window.open(a?.actionUrl||"","_blank");t&&t.focus()},variant:"primary"}]}},n=()=>{s||o.message&&(s=!0,(0,t.dispatch)("core/notices").createWarningNotice(o.message,o.options))};if(a&&a.displayOnLoad&&n(),i.isSavingPost()&&!i.isAutosavingPost()){const t=i.getCurrentPost()?.link,s=i.getPermalink(),o=i.getCurrentPost().slug,r=i.getEditedPostSlug(),c=i.getEditedPostAttribute("status");if(!o)return;if(["draft","auto-draft"].includes(c))return;if(o!==r){const i=URL.parse(t),o=URL.parse(s);o&&i&&(a.actionUrl+=(0,e.sprintf)("&post_title=%s",i.pathname.replace(/^\//g,""))+(0,e.sprintf)("&redirect_to=%s",o.pathname.replace(/^\//g,""))),n()}}}))})();