(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=jQuery;!function(e,t,n){var i,l,a,s,r,o=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i,c=/^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,63}[^ "]*$/i,p={},d={},u="ontouchend"in document;function h(){return i?i.$('a[data-wplink-edit="true"]'):null}window.wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:"",textarea:"",modalOpen:!1,init:function(){p.wrap=e("#wp-link-wrap"),p.dialog=e("#wp-link"),p.backdrop=e("#wp-link-backdrop"),p.submit=e("#wp-link-submit"),p.close=e("#wp-link-close");var n=e('

"+t.schemaMarkupLabel+'

"),i=e('');n.insertAfter("#wp-link .link-target"),i.insertAfter("#wp-link .wp-link-text-field"),e("#wp-link .query-results").css("top","290px"),p.text=e("#wp-link-text"),p.url=e("#wp-link-url"),p.nonce=e("#_ajax_linking_nonce"),p.openInNewTab=e("#wp-link-target"),p.search=e("#wp-link-search"),p.nofollow=e("#wp-link-nofollow"),p.sponsored=e("#wp-link-sponsored"),p.about=e("#wp-link-about"),p.mentions=e("#wp-link-mentions"),p.title=e("#wp-link-title"),d.search=new r(e("#search-results")),d.recent=new r(e("#most-recent-results")),d.elements=p.dialog.find(".query-results"),p.queryNotice=e("#query-notice-message"),p.queryNoticeTextDefault=p.queryNotice.find(".query-notice-default"),p.queryNoticeTextHint=p.queryNotice.find(".query-notice-hint"),p.dialog.on("keydown",(function(e){return wpLink.keydown(e)})),p.dialog.on("keyup",(function(e){return wpLink.keyup(e)})),p.submit.on("click",(function(e){e.preventDefault(),wpLink.update()})),p.close.add(p.backdrop).add("#wp-link-cancel button").on("click",(function(e){e.preventDefault(),wpLink.close()})),d.elements.on("river-select",wpLink.updateFields),p.search.on("focus.wplink",(function(){p.queryNoticeTextDefault.hide(),p.queryNoticeTextHint.removeClass("screen-reader-text").show()})).on("blur.wplink",(function(){p.queryNoticeTextDefault.show(),p.queryNoticeTextHint.addClass("screen-reader-text").hide()})),p.search.on("keyup input",(function(){window.clearTimeout(l),l=window.setTimeout((function(){wpLink.searchInternalLinks()}),500)})),p.url.on("paste",(function(){setTimeout(wpLink.correctURL,0)})),p.url.on("blur",wpLink.correctURL)},correctURL:function(){var t=e.trim(p.url.val());t&&a!==t&&!/^(?:[a-z]+:|#|\?|\.|\/)/.test(t)&&(p.url.val("http://"+t),a=t)},open:function(t,n,l){var a;"acf-link-textarea"===t?e(".wp-link-title-field").hide():e(".wp-link-title-field").show();var s=e(document.body);s.addClass("modal-open"),wpLink.modalOpen=!0,wpLink.range=null,t&&(window.wpActiveEditor=t),window.wpActiveEditor&&(this.textarea=e("#"+window.wpActiveEditor).get(0),void 0!==window.tinymce&&(s.append(p.backdrop,p.wrap),a=window.tinymce.get(window.wpActiveEditor),i=a&&!a.isHidden()?a:null),!wpLink.isMCE()&&document.selection&&(this.textarea.focus(),this.range=document.selection.createRange()),p.wrap.show(),p.backdrop.show(),wpLink.refresh(n,l),e(document).trigger("wplink-open",p.wrap))},isMCE:function(){return i&&!i.isHidden()},refresh:function(e,t){d.search.refresh(),d.recent.refresh(),wpLink.isMCE()?wpLink.mceRefresh(e,t):(p.wrap.hasClass("has-text-field")||p.wrap.addClass("has-text-field"),document.selection?document.selection.createRange().text||t||"":void 0!==this.textarea.selectionStart&&this.textarea.selectionStart!==this.textarea.selectionEnd&&(t=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd)||t||""),p.text.val(t),wpLink.setDefaultValues()),u?p.url.focus().blur():window.setTimeout((function(){p.url[0].select(),p.url.focus()})),d.recent.ul.children().length||d.recent.ajax(),a=p.url.val().replace(/^http:\/\//,"")},hasSelectedText:function(e){var t,n,l,a=i.selection.getContent();if(/]+>[^<]+<\/a>$/.test(a.trim())||-1===a.indexOf("href=")))return!1;if(e.length){if(!(n=e[0].childNodes)||!n.length)return!1;for(l=n.length-1;0<=l;l--)if(3!==(t=n[l]).nodeType&&!window.tinymce.dom.BookmarkManager.isBookmarkNode(t))return!1}return!0},mceRefresh:function(n,l){var a,s,r=h(),d=this.hasSelectedText(r);r.length?(a=r.text(),s=r.attr("href"),e.trim(a)||(a=l||""),n&&(c.test(n)||o.test(n))&&(s=n),"_wp_link_placeholder"!==s?(p.url.val(s),p.openInNewTab.prop("checked","_blank"===i.dom.getAttrib(r,"target")),p.nofollow.prop("checked",i.dom.getAttrib(r,"rel").includes("nofollow")),p.sponsored.prop("checked",i.dom.getAttrib(r,"rel").includes("sponsored")),p.about.prop("checked",i.dom.getAttrib(r,"data-schema-attribute").includes("about")),p.mentions.prop("checked",i.dom.getAttrib(r,"data-schema-attribute").includes("mentions")),p.title.val(i.dom.getAttrib(r,"title")),p.submit.val(t.update)):this.setDefaultValues(a),n&&n!==s?p.search.val(n):p.search.val(""),window.setTimeout((function(){wpLink.searchInternalLinks()}))):(a=i.selection.getContent({format:"text"})||l||"",this.setDefaultValues(a)),d?(p.text.val(a),p.wrap.addClass("has-text-field")):(p.text.val(""),p.wrap.removeClass("has-text-field"))},close:function(t){e(document.body).removeClass("modal-open"),wpLink.modalOpen=!1,"noReset"!==t&&(wpLink.isMCE()?(i.plugins.wplink&&i.plugins.wplink.close(),i.focus()):(wpLink.textarea.focus(),wpLink.range&&(wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select()))),p.backdrop.hide(),p.wrap.hide(),a=!1,e(document).trigger("wplink-close",p.wrap)},getAttrs:function(){wpLink.correctURL();var t=p.nofollow.prop("checked")?"nofollow":"";p.sponsored.prop("checked")&&(t=t?t+" sponsored":"sponsored");var n=p.about.prop("checked")?"about":"";p.mentions.prop("checked")&&(n=n?n+" mentions":"mentions");var i={href:e.trim(p.url.val()),target:p.openInNewTab.prop("checked")?"_blank":null,rel:t,"data-schema-attribute":n||null};return e.trim(p.title.val())&&(i.title=e.trim(p.title.val())),i},buildHtml:function(e){var t='"},update:function(){wpLink.isMCE()?wpLink.mceUpdate():wpLink.htmlUpdate()},htmlUpdate:function(){var i=wpLink.textarea;if(i){var l,a,s,r,o,c=wpLink.getAttrs(),d=document.createElement("a");if(d.href=c.href,"javascript:"!==d.protocol&&"data:"!==d.protocol||(c.href=""),c.href){l=wpLink.buildHtml(c);var u=p.text.val();document.selection&&wpLink.range?(i.focus(),wpLink.range.text=l+(u||wpLink.range.text)+"",wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select(),wpLink.range=null):void 0!==i.selectionStart&&(a=i.selectionStart,s=i.selectionEnd,r=a+(l=l+(o=u||i.value.substring(a,s))+"").length,a!==s||o||(r-=4),i.value=i.value.substring(0,a)+l+i.value.substring(s,i.value.length),i.selectionStart=i.selectionEnd=r),wpLink.close(),i.focus(),e(i).trigger("change"),n.a11y.speak(t.linkInserted)}}},mceUpdate:function(){var l,a,s,r,o=wpLink.getAttrs(),c=document.createElement("a");if(c.href=o.href,"javascript:"!==c.protocol&&"data:"!==c.protocol||(o.href=""),!o.href)return i.execCommand("unlink"),void wpLink.close();l=i.$(h()),i.undoManager.transact((function(){l.length||(i.execCommand("mceInsertLink",!1,{href:"_wp_link_placeholder","data-wp-temp-link":1}),l=i.$('a[data-wp-temp-link="1"]').removeAttr("data-wp-temp-link"),s=e.trim(l.text())),l.length?(p.wrap.hasClass("has-text-field")&&((a=p.text.val())?l.text(a):s||l.text(o.href)),o["data-wplink-edit"]=null,o["data-mce-href"]=null,o.hasOwnProperty("rel")&&!o.rel&&(o.rel=null),l.attr(o)):i.execCommand("unlink")})),wpLink.close("noReset"),i.focus(),l.length&&((r=l.parent("#_mce_caret")).length&&r.before(l.removeAttr("data-mce-bogus")),i.selection.select(l[0]),i.selection.collapse(),i.plugins.wplink&&i.plugins.wplink.checkLink(l[0])),i.nodeChanged(),p.title.val(""),n.a11y.speak(t.linkInserted)},updateFields:function(e,t){p.url.val(t.children(".item-permalink").val()),p.wrap.hasClass("has-text-field")&&!p.text.val()&&p.text.val(t.children(".item-title").text())},getUrlFromSelection:function(t){return t||(this.isMCE()?t=i.selection.getContent({format:"text"}):document.selection&&wpLink.range?t=wpLink.range.text:void 0!==this.textarea.selectionStart&&(t=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd))),(t=e.trim(t))&&o.test(t)?"mailto:"+t:t&&c.test(t)?t.replace(/&|�?38;/gi,"&"):""},setDefaultValues:function(e){p.url.val(this.getUrlFromSelection(e)),p.search.val(""),wpLink.searchInternalLinks(),p.submit.val(t.save)},searchInternalLinks:function(){var e,t=p.search.val()||"";if(2l?this.element.scrollTop(a+l):l+n>i&&this.element.scrollTop(a+l-i+n),this.element.trigger("river-select",[e,t,this])}},deselect:function(){this.selected&&this.selected.removeClass("selected"),this.selected=!1},prev:function(){var e;this.visible&&(this.selected&&(e=this.selected.prev("li")).length&&this.select(e))},next:function(){if(this.visible){var t=this.selected?this.selected.next("li"):e("li:not(.unselectable):first",this.element);t.length&&this.select(t)}},ajax:function(e){var t=this,n=1===this.query.page?0:wpLink.minRiverAJAXDuration,i=wpLink.delayedCallback((function(n,i){t.process(n,i),e&&e(n,i)}),n);this.query.ajax(i)},change:function(e){this.query&&this._search===e||(this._search=e,this.query=new s(e),this.element.scrollTop(0))},process:function(n,i){var l="",a=!0,s="",r=1===i.page;n?e.each(n,(function(){s=a?"alternate":"",s+=this.title?"":" no-title",l+=s?'
  • ':"
  • ",l+='',l+='',l+=this.title?this.title:t.noTitle,l+=''+this.info+"
  • ",a=!a})):r&&(l+='
  • '+t.noMatchesFound+"
  • "),this.ul[r?"html":"append"](l)},maybeLoad:function(){var e=this,t=this.element,n=t.scrollTop()+t.height();!this.query.ready()||n