!function(){var e={634:function(e){e.exports=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(t){for(var a=1;a(e=""+e,t=""+t,a&&(e=e.trim(),t=t.trim()),n?e==t:e.toLowerCase()==t.toLowerCase()),i=(e,t)=>e&&Array.isArray(e)&&e.map((e=>o(e,t)));function o(e,t){var n,a={};for(n in e)t.indexOf(n)<0&&(a[n]=e[n]);return a}function s(e){var t=document.createElement("div");return e.replace(/\&#?[0-9a-z]+;/gi,(function(e){return t.innerHTML=e,t.innerText}))}function l(e){return(new DOMParser).parseFromString(e.trim(),"text/html").body.firstElementChild}function c(e,t){for(t=t||"previous";e=e[t+"Sibling"];)if(3==e.nodeType)return e}function p(e){return"string"==typeof e?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/`|'/g,"'"):e}function u(e){var t=Object.prototype.toString.call(e).split(" ")[1].slice(0,-1);return e===Object(e)&&"Array"!=t&&"Function"!=t&&"RegExp"!=t&&"HTMLUnknownElement"!=t}function d(e,t,n){function a(e,t){for(var n in t)if(t.hasOwnProperty(n)){if(u(t[n])){u(e[n])?a(e[n],t[n]):e[n]=Object.assign({},t[n]);continue}if(Array.isArray(t[n])){e[n]=Object.assign([],t[n]);continue}e[n]=t[n]}}return e instanceof Object||(e={}),a(e,t),n&&a(e,n),e}function m(){const e=[],t={};for(let n of arguments)for(let a of n)u(a)?t[a.value]||(e.push(a),t[a.value]=1):e.includes(a)||e.push(a);return e}function h(e){return String.prototype.normalize?"string"==typeof e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:e}var g=()=>/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent);function f(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}function v(e){return e&&e.classList&&e.classList.contains(this.settings.classNames.tag)}function w(e,t){var n=window.getSelection();return t=t||n.getRangeAt(0),"string"==typeof e&&(e=document.createTextNode(e)),t&&(t.deleteContents(),t.insertNode(e)),e}function y(e,t,n){return e?(t&&(e.__tagifyTagData=n?t:d({},e.__tagifyTagData||{},t)),e.__tagifyTagData):(console.warn("tag element doesn't exist",e,t),t)}function b(e){if(e&&e.parentNode){var t=e,n=window.getSelection(),a=n.getRangeAt(0);n.rangeCount&&(a.setStartAfter(t),a.collapse(!0),n.removeAllRanges(),n.addRange(a))}}function k(e,t){e.forEach((e=>{if(y(e.previousSibling)||!e.previousSibling){var n=document.createTextNode(a);e.before(n),t&&b(n)}}))}var T={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:()=>{},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:" "},autoComplete:{enabled:!0,rightKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,highlightFirst:!1,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:()=>Promise.resolve(),beforePaste:()=>Promise.resolve(),suggestionClick:()=>Promise.resolve()}};function E(){this.dropdown={};for(let e in this._dropdown)this.dropdown[e]="function"==typeof this._dropdown[e]?this._dropdown[e].bind(this):this._dropdown[e];this.dropdown.refs()}var _={refs(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs(){return[...this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector)]},show(e){var t,n,a,i=this.settings,o="mix"==i.mode&&!i.enforceWhitelist,s=!i.whitelist||!i.whitelist.length,l="manual"==i.dropdown.position;if(e=void 0===e?this.state.inputText:e,!(s&&!o&&!i.templates.dropdownItemNoMatch||!1===i.dropdown.enable||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(e),e&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",e),i.templates.dropdownItemNoMatch&&(a=i.templates.dropdownItemNoMatch.call(this,{value:e}))),!a){if(this.suggestedListItems.length)e&&o&&!this.state.editing.scope&&!r(this.suggestedListItems[0].value,e)&&this.suggestedListItems.unshift({value:e});else{if(!e||!o||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:e}]}n=""+(u(t=this.suggestedListItems[0])?t.value:t),i.autoComplete&&n&&0==n.indexOf(e)&&this.input.autocomplete.suggest.call(this,t)}this.dropdown.fill(a),i.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(i.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=e||!0,this.state.dropdown.query=e,this.setStateSelection(),l||setTimeout((()=>{this.dropdown.position(),this.dropdown.render()})),setTimeout((()=>{this.trigger("dropdown:show",this.DOM.dropdown)}))}},hide(e){var t=this.DOM,n=t.scope,a=t.dropdown,r="manual"==this.settings.dropdown.position&&!e;if(a&&document.body.contains(a)&&!r)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),a.parentNode.removeChild(a),setTimeout((()=>{this.state.dropdown.visible=!1}),100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",a),this},toggle(e){this.dropdown[this.state.dropdown.visible&&!e?"hide":"show"]()},render(){var e,t,n=((t=this.DOM.dropdown.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(t),e=t.clientHeight,t.parentNode.removeChild(t),e),a=this.settings;return"number"==typeof a.dropdown.enabled&&a.dropdown.enabled>=0?(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(a.classNames.dropdownInital),this.dropdown.position(n),a.dropdown.appendTarget.appendChild(this.DOM.dropdown),setTimeout((()=>this.DOM.dropdown.classList.remove(a.classNames.dropdownInital)))),this):this},fill(e){e="string"==typeof e?e:this.dropdown.createListHTML(e||this.suggestedListItems);var t,n=this.settings.templates.dropdownContent.call(this,e);this.DOM.dropdown.content.innerHTML=(t=n)?t.replace(/\>[\r\n ]+\<").split(/>\s+<").trim():""},fillHeaderFooter(){var e=this.dropdown.filterListItems(this.state.dropdown.query),t=this.parseTemplate("dropdownHeader",[e]),n=this.parseTemplate("dropdownFooter",[e]),a=this.dropdown.getHeaderRef(),r=this.dropdown.getFooterRef();t&&a?.parentNode.replaceChild(t,a),n&&r?.parentNode.replaceChild(n,r)},refilter(e){e=e||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(e),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},position(e){var t=this.settings.dropdown;if("manual"!=t.position){var n,a,r,i,o,s,l=this.DOM.dropdown,c=t.placeAbove,p=t.appendTarget===document.body,u=p?window.pageYOffset:t.appendTarget.scrollTop,d=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,m=d.clientHeight,h=Math.max(d.clientWidth||0,window.innerWidth||0)>480?t.position:"all",g=this.DOM["input"==h?"input":"scope"];if(e=e||l.clientHeight,this.state.dropdown.visible){if("text"==h?(r=(n=function(){const e=document.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),n=t.startContainer,a=t.startOffset;let r,i;if(a>0)return i=document.createRange(),i.setStart(n,a-1),i.setEnd(n,a),r=i.getBoundingClientRect(),{left:r.right,top:r.top,bottom:r.bottom};if(n.getBoundingClientRect)return n.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,a=n.top,i=n.left,o="auto"):(s=function(e){for(var t=0,n=0;e&&e!=d;)t+=e.offsetLeft||0,n+=e.offsetTop||0,e=e.parentNode;return{left:t,top:n}}(t.appendTarget),a=(n=g.getBoundingClientRect()).top-s.top,r=n.bottom-1-s.top,i=n.left-s.left,o=n.width+"px"),!p){let e=function(){for(var e=0,n=t.appendTarget.parentNode;n;)e+=n.scrollTop||0,n=n.parentNode;return e}();a+=e,r+=e}a=Math.floor(a),r=Math.ceil(r),c=void 0===c?m-n.bottom0&&void 0!==arguments[0])||arguments[0];var t=this.dropdown.events.callbacks,n=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:t.onKeyDown.bind(this),onMouseOver:t.onMouseOver.bind(this),onMouseLeave:t.onMouseLeave.bind(this),onClick:t.onClick.bind(this),onScroll:t.onScroll.bind(this)},a=e?"addEventListener":"removeEventListener";"manual"!=this.settings.dropdown.position&&(document[a]("scroll",n.position,!0),window[a]("resize",n.position),window[a]("keydown",n.onKeyDown)),this.DOM.dropdown[a]("mouseover",n.onMouseOver),this.DOM.dropdown[a]("mouseleave",n.onMouseLeave),this.DOM.dropdown[a]("mousedown",n.onClick),this.DOM.dropdown.content[a]("scroll",n.onScroll)},callbacks:{onKeyDown(e){if(this.state.hasFocus&&!this.state.composing){var t=this.DOM.dropdown.querySelector(this.settings.classNames.dropdownItemActiveSelector),n=this.dropdown.getSuggestionDataByNode(t);switch(e.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":e.preventDefault();var a=this.dropdown.getAllSuggestionsRefs(),r="ArrowUp"==e.key||"Up"==e.key;t&&(t=this.dropdown.getNextOrPrevOption(t,!r)),t&&t.matches(this.settings.classNames.dropdownItemSelector)||(t=a[r?a.length-1:0]),this.dropdown.highlightOption(t,!0);break;case"Escape":case"Esc":this.dropdown.hide();break;case"ArrowRight":if(this.state.actions.ArrowLeft)return;case"Tab":if("mix"!=this.settings.mode&&t&&!this.settings.autoComplete.rightKey&&!this.state.editing){e.preventDefault();var i=this.dropdown.getMappedValue(n);return this.input.autocomplete.set.call(this,i),!1}return!0;case"Enter":e.preventDefault(),this.settings.hooks.suggestionClick(e,{tagify:this,tagData:n,suggestionElm:t}).then((()=>{if(t)return this.dropdown.selectOption(t),t=this.dropdown.getNextOrPrevOption(t,!r),void this.dropdown.highlightOption(t);this.dropdown.hide(),"mix"!=this.settings.mode&&this.addTags(this.state.inputText.trim(),!0)})).catch((e=>e));break;case"Backspace":{if("mix"==this.settings.mode||this.state.editing.scope)return;const e=this.input.raw.call(this);""!=e&&8203!=e.charCodeAt(0)||(!0===this.settings.backspace?this.removeTags():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0))}}}},onMouseOver(e){var t=e.target.closest(this.settings.classNames.dropdownItemSelector);t&&this.dropdown.highlightOption(t)},onMouseLeave(e){this.dropdown.highlightOption()},onClick(e){if(0==e.button&&e.target!=this.DOM.dropdown&&e.target!=this.DOM.dropdown.content){var t=e.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(t);this.state.actions.selectOption=!0,setTimeout((()=>this.state.actions.selectOption=!1),50),this.settings.hooks.suggestionClick(e,{tagify:this,tagData:n,suggestionElm:t}).then((()=>{t?this.dropdown.selectOption(t,e):this.dropdown.hide()})).catch((e=>console.warn(e)))}},onScroll(e){var t=e.target,n=t.scrollTop/(t.scrollHeight-t.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(n)})}}},getSuggestionDataByNode(e){var t=e&&e.getAttribute("value");return this.suggestedListItems.find((e=>e.value==t))||null},getNextOrPrevOption(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var n=this.dropdown.getAllSuggestionsRefs(),a=n.findIndex((t=>t===e));return t?n[a+1]:n[a-1]},highlightOption(e,t){var n,a=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(a),this.state.ddItemElm.removeAttribute("aria-selected")),!e)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);n=this.dropdown.getSuggestionDataByNode(e),this.state.ddItemData=n,this.state.ddItemElm=e,e.classList.add(a),e.setAttribute("aria-selected",!0),t&&(e.parentNode.scrollTop=e.clientHeight+e.offsetTop-e.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,n),this.dropdown.position())},selectOption(e,t){var n=this.settings.dropdown,a=n.clearOnSelect,r=n.closeOnSelect;if(!e)return this.addTags(this.state.inputText,!0),void(r&&this.dropdown.hide());t=t||{};var i=e.getAttribute("value"),o="noMatch"==i,s=this.suggestedListItems.find((e=>(e.value??e)==i));this.trigger("dropdown:select",{data:s,elm:e,event:t}),i&&(s||o)?(this.state.editing?this.onEditTagDone(null,d({__isValid:!0},this.normalizeTags([s])[0])):this["mix"==this.settings.mode?"addMixTags":"addTags"]([s||this.input.raw.call(this)],a),this.DOM.input.parentNode&&(setTimeout((()=>{this.DOM.input.focus(),this.toggleFocusClass(!0)})),r&&setTimeout(this.dropdown.hide.bind(this)),e.addEventListener("transitionend",(()=>{this.dropdown.fillHeaderFooter(),setTimeout((()=>e.remove()),100)}),{once:!0}),e.classList.add(this.settings.classNames.dropdownItemHidden))):r&&setTimeout(this.dropdown.hide.bind(this))},selectAll(e){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var t=this.dropdown.filterListItems("");return e||(t=this.state.dropdown.suggestions),this.addTags(t,!0),this},filterListItems(e,t){var n,a,r,i,o,s=this.settings,l=s.dropdown,c=(t=t||{},[]),p=[],d=s.whitelist,m=l.maxItems>=0?l.maxItems:1/0,g=l.searchKeys,f=0;if(!(e="select"==s.mode&&this.value.length&&this.value[0][s.tagTextProp]==e?"":e)||!g.length)return c=l.includeSelectedTags?d:d.filter((e=>!this.isTagDuplicate(u(e)?e.value:e))),this.state.dropdown.suggestions=c,c.slice(0,m);function v(e,t){return t.toLowerCase().split(" ").every((t=>e.includes(t.toLowerCase())))}for(o=l.caseSensitive?""+e:(""+e).toLowerCase();fg.includes(e)))?g:["value"];l.fuzzySearch&&!t.exact?(r=m.reduce(((e,t)=>e+" "+(n[t]||"")),"").toLowerCase().trim(),l.accentedSearch&&(r=h(r),o=h(o)),e=0==r.indexOf(o),s=r===o,a=v(r,o)):(e=!0,a=m.some((e=>{var a=""+(n[e]||"");return l.accentedSearch&&(a=h(a),o=h(o)),l.caseSensitive||(a=a.toLowerCase()),s=a===o,t.exact?a===o:0==a.indexOf(o)}))),i=!l.includeSelectedTags&&this.isTagDuplicate(u(n)?n.value:n),a&&!i&&(s&&e?p.push(n):"startsWith"==l.sortby&&e?c.unshift(n):c.push(n))}return this.state.dropdown.suggestions=p.concat(c),"function"==typeof l.sortby?l.sortby(p.concat(c),o):p.concat(c).slice(0,m)},getMappedValue(e){var t=this.settings.dropdown.mapValueTo;return t?"function"==typeof t?t(e):e[t]||e.value:e.value},createListHTML(e){return d([],e).map(((e,n)=>{"string"!=typeof e&&"number"!=typeof e||(e={value:e});var a=this.dropdown.getMappedValue(e);return a="string"==typeof a?p(a):a,this.settings.templates.dropdownItem.apply(this,[t(t({},e),{},{mappedValue:a}),this])})).join("")}};const x="@yaireo/tagify/";var O,S={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},N={wrapper:(e,t)=>`\n \n ​\n `,tag(e,t){let n=t.settings;return`\n \n
\n ${e[n.tagTextProp]||e.value}\n
\n
`},dropdown(e){var t=e.dropdown,n="manual"==t.position,a=`${e.classNames.dropdown}`;return`
\n
\n
`},dropdownContent(e){var t=this.settings,n=this.state.dropdown.suggestions;return`\n ${t.templates.dropdownHeader.call(this,n)}\n ${e}\n ${t.templates.dropdownFooter.call(this,n)}\n `},dropdownItem(e){return`
${e.mappedValue||e.value}
`},dropdownHeader(e){return`
`},dropdownFooter(e){var t=e.length-this.settings.dropdown.maxItems;return t>0?`
\n ${t} more items. Refine your search.\n
`:""},dropdownItemNoMatch:null},C={customBinding(){this.customEventsList.forEach((e=>{this.on(e,this.settings.callbacks[e])}))},binding(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var t,n=this.events.callbacks,a=e?"addEventListener":"removeEventListener";if(!this.state.mainEvents||!e){for(var r in this.state.mainEvents=e,e&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),t=this.listeners.main=this.listeners.main||{focus:["input",n.onFocusBlur.bind(this)],keydown:["input",n.onKeydown.bind(this)],click:["scope",n.onClickScope.bind(this)],dblclick:["scope",n.onDoubleClickScope.bind(this)],paste:["input",n.onPaste.bind(this)],drop:["input",n.onDrop.bind(this)],compositionstart:["input",n.onCompositionStart.bind(this)],compositionend:["input",n.onCompositionEnd.bind(this)]})this.DOM[t[r][0]][a](r,t[r][1]);clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(n.observeOriginalInputValue.bind(this),500);var i=this.listeners.main.inputMutationObserver||new MutationObserver(n.onInputDOMChange.bind(this));i.disconnect(),"mix"==this.settings.mode&&i.observe(this.DOM.input,{childList:!0})}},bindGlobal(e){var t,n=this.events.callbacks,a=e?"removeEventListener":"addEventListener";if(this.listeners&&(e||!this.listeners.global))for(t of(this.listeners.global=this.listeners.global||[{type:this.isIE?"keydown":"input",target:this.DOM.input,cb:n[this.isIE?"onInputIE":"onInput"].bind(this)},{type:"keydown",target:window,cb:n.onWindowKeyDown.bind(this)},{type:"blur",target:this.DOM.input,cb:n.onFocusBlur.bind(this)},{type:"click",target:document,cb:n.onClickAnywhere.bind(this)}],this.listeners.global))t.target[a](t.type,t.cb)},unbindGlobal(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur(e){var t=this.settings,n=e.target?this.trim(e.target.textContent):"",a=this.value?.[0]?.[t.tagTextProp],r=e.type,i=t.dropdown.enabled>=0,o={relatedTarget:e.relatedTarget},s=this.state.actions.selectOption&&(i||!t.dropdown.closeOnSelect),l=this.state.actions.addNew&&i,c=e.relatedTarget&&v.call(this,e.relatedTarget)&&this.DOM.scope.contains(e.relatedTarget);if("blur"==r){if(e.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),t.onChangeAfterBlur&&this.triggerChangeEvent()}if(!s&&!l)if(this.state.hasFocus="focus"==r&&+new Date,this.toggleFocusClass(this.state.hasFocus),"mix"!=t.mode){if("focus"==r)return this.trigger("focus",o),void(0!==t.dropdown.enabled&&t.userInput||this.dropdown.show(this.value.length?"":void 0));"blur"==r&&(this.trigger("blur",o),this.loading(!1),"select"==t.mode&&(c&&(this.removeTags(),n=""),a===n&&(n="")),n&&!this.state.actions.selectOption&&t.addTagOnBlur&&this.addTags(n,!0)),this.DOM.input.removeAttribute("style"),this.dropdown.hide()}else"focus"==r?this.trigger("focus",o):"blur"==e.type&&(this.trigger("blur",o),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onCompositionStart(e){this.state.composing=!0},onCompositionEnd(e){this.state.composing=!1},onWindowKeyDown(e){var t,n=document.activeElement,a=v.call(this,n)&&this.DOM.scope.contains(document.activeElement),r=a&&n.hasAttribute("readonly");if(a&&!r)switch(t=n.nextElementSibling,e.key){case"Backspace":this.settings.readonly||(this.removeTags(n),(t||this.DOM.input).focus());break;case"Enter":setTimeout(this.editTag.bind(this),0,n)}},onKeydown(e){var t=this.settings;if(!this.state.composing&&t.userInput){"select"==t.mode&&t.enforceWhitelist&&this.value.length&&"Tab"!=e.key&&e.preventDefault();var n=this.trim(e.target.textContent);if(this.trigger("keydown",{event:e}),"mix"==t.mode){switch(e.key){case"Left":case"ArrowLeft":this.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(this.state.editing)return;var a=document.getSelection(),r="Delete"==e.key&&a.anchorOffset==(a.anchorNode.length||0),i=a.anchorNode.previousSibling,o=1==a.anchorNode.nodeType||!a.anchorOffset&&i&&1==i.nodeType&&a.anchorNode.previousSibling;s(this.DOM.input.innerHTML);var l,p,u,d=this.getTagElms(),m=1===a.anchorNode.length&&a.anchorNode.nodeValue==String.fromCharCode(8203);if("edit"==t.backspace&&o)return l=1==a.anchorNode.nodeType?null:a.anchorNode.previousElementSibling,setTimeout(this.editTag.bind(this),0,l),void e.preventDefault();if(g()&&o instanceof Element)return u=c(o),o.hasAttribute("readonly")||o.remove(),this.DOM.input.focus(),void setTimeout((()=>{b(u),this.DOM.input.click()}));if("BR"==a.anchorNode.nodeName)return;if((r||o)&&1==a.anchorNode.nodeType?p=0==a.anchorOffset?r?d[0]:null:d[Math.min(d.length,a.anchorOffset)-1]:r?p=a.anchorNode.nextElementSibling:o instanceof Element&&(p=o),3==a.anchorNode.nodeType&&!a.anchorNode.nodeValue&&a.anchorNode.previousElementSibling&&e.preventDefault(),(o||r)&&!t.backspace)return void e.preventDefault();if("Range"!=a.type&&!a.anchorOffset&&a.anchorNode==this.DOM.input&&"Delete"!=e.key)return void e.preventDefault();if("Range"!=a.type&&p&&p.hasAttribute("readonly"))return void b(c(p));"Delete"==e.key&&m&&y(a.anchorNode.nextSibling)&&this.removeTags(a.anchorNode.nextSibling),clearTimeout(O),O=setTimeout((()=>{var e=document.getSelection();s(this.DOM.input.innerHTML),!r&&e.anchorNode.previousSibling,this.value=[].map.call(d,((e,t)=>{var n=y(e);if(e.parentNode||n.readonly)return n;this.trigger("remove",{tag:e,index:t,data:n})})).filter((e=>e))}),20)}return!0}switch(e.key){case"Backspace":"select"==t.mode&&t.enforceWhitelist&&this.value.length?this.removeTags():this.state.dropdown.visible&&"manual"!=t.dropdown.position||""!=e.target.textContent&&8203!=n.charCodeAt(0)||(!0===t.backspace?this.removeTags():"edit"==t.backspace&&setTimeout(this.editTag.bind(this),0));break;case"Esc":case"Escape":if(this.state.dropdown.visible)return;e.target.blur();break;case"Down":case"ArrowDown":this.state.dropdown.visible||this.dropdown.show();break;case"ArrowRight":{let e=this.state.inputSuggestion||this.state.ddItemData;if(e&&t.autoComplete.rightKey)return void this.addTags([e],!0);break}case"Tab":{let a="select"==t.mode;if(!n||a)return!0;e.preventDefault()}case"Enter":if(this.state.dropdown.visible&&"manual"!=t.dropdown.position)return;e.preventDefault(),setTimeout((()=>{this.state.dropdown.visible||this.state.actions.selectOption||this.addTags(n,!0)}))}}},onInput(e){this.postUpdate();var t=this.settings;if("mix"==t.mode)return this.events.callbacks.onMixTagsInput.call(this,e);var n=this.input.normalize.call(this),a=n.length>=t.dropdown.enabled,r={value:n,inputElm:this.DOM.input},i=this.validateTag({value:n});"select"==t.mode&&this.toggleScopeValidation(i),r.isValid=i,this.state.inputText!=n&&(this.input.set.call(this,n,!1),-1!=n.search(t.delimiters)?this.addTags(n)&&this.input.set.call(this):t.dropdown.enabled>=0&&this.dropdown[a?"show":"hide"](n),this.trigger("input",r))},onMixTagsInput(e){var t,n,a,r,i,o,s,l,c=this.settings,p=this.value.length,u=this.getTagElms(),m=document.createDocumentFragment(),h=window.getSelection().getRangeAt(0),f=[].map.call(u,(e=>y(e).value));if("deleteContentBackward"==e.inputType&&g()&&this.events.callbacks.onKeydown.call(this,{target:e.target,key:"Backspace"}),k(this.getTagElms()),this.value.slice().forEach((e=>{e.readonly&&!f.includes(e.value)&&m.appendChild(this.createTagElem(e))})),m.childNodes.length&&(h.insertNode(m),this.setRangeAtStartEnd(!1,m.lastChild)),u.length!=p)return this.value=[].map.call(this.getTagElms(),(e=>y(e))),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(o=window.getSelection()).rangeCount>0&&3==o.anchorNode.nodeType){if((h=o.getRangeAt(0).cloneRange()).collapse(!0),h.setStart(o.focusNode,0),a=(t=h.toString().slice(0,h.endOffset)).split(c.pattern).length-1,(n=t.match(c.pattern))&&(r=t.slice(t.lastIndexOf(n[n.length-1]))),r){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:r.match(c.pattern)[0],value:r.replace(c.pattern,"")},this.state.tag.baseOffset=o.baseOffset-this.state.tag.value.length,l=this.state.tag.value.match(c.delimiters))return this.state.tag.value=this.state.tag.value.replace(c.delimiters,""),this.state.tag.delimiters=l[0],this.addTags(this.state.tag.value,c.dropdown.clearOnSelect),void this.dropdown.hide();i=this.state.tag.value.length>=c.dropdown.enabled;try{s=(s=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&s.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch(e){}(s||a{this.update({withoutChangeEvent:!0}),this.trigger("input",d({},this.state.tag,{textContent:this.DOM.input.textContent})),this.state.tag&&this.dropdown[i?"show":"hide"](this.state.tag.value)}),10)},onInputIE(e){var t=this;setTimeout((function(){t.events.callbacks.onInput.call(t,e)}))},observeOriginalInputValue(){this.DOM.originalInput.parentNode||this.destroy(),this.DOM.originalInput.value!=this.DOM.originalInput.tagifyValue&&this.loadOriginalValues()},onClickAnywhere(e){e.target==this.DOM.scope||this.DOM.scope.contains(e.target)||(this.toggleFocusClass(!1),this.state.hasFocus=!1)},onClickScope(e){var t=this.settings,n=e.target.closest("."+t.classNames.tag),a=+new Date-this.state.hasFocus;if(e.target!=this.DOM.scope){if(!e.target.classList.contains(t.classNames.tagX))return n?(this.trigger("click",{tag:n,index:this.getNodeIndex(n),data:y(n),event:e}),void(1!==t.editTags&&1!==t.editTags.clicks||this.events.callbacks.onDoubleClickScope.call(this,e))):void(e.target==this.DOM.input&&("mix"==t.mode&&this.fixFirefoxLastTagNoCaret(),a>500)?this.state.dropdown.visible?this.dropdown.hide():0===t.dropdown.enabled&&"mix"!=t.mode&&this.dropdown.show(this.value.length?"":void 0):"select"!=t.mode||0!==t.dropdown.enabled||this.state.dropdown.visible||this.dropdown.show());this.removeTags(e.target.parentNode)}else this.DOM.input.focus()},onPaste(e){e.preventDefault();var t,n,a=this.settings;if("select"==a.mode&&a.enforceWhitelist||!a.userInput)return!1;a.readonly||(t=e.clipboardData||window.clipboardData,n=t.getData("Text"),a.hooks.beforePaste(e,{tagify:this,pastedText:n,clipboardData:t}).then((t=>{void 0===t&&(t=n),t&&(this.injectAtCaret(t,window.getSelection().getRangeAt(0)),"mix"==this.settings.mode?this.events.callbacks.onMixTagsInput.call(this,e):this.settings.pasteAsTags?this.addTags(this.state.inputText+t,!0):this.state.inputText=t)})).catch((e=>e)))},onDrop(e){e.preventDefault()},onEditTagInput(e,t){var n=e.closest("."+this.settings.classNames.tag),a=this.getNodeIndex(n),r=y(n),i=this.input.normalize.call(this,e),o={[this.settings.tagTextProp]:i,__tagId:r.__tagId},s=this.validateTag(o);this.editTagChangeDetected(d(r,o))||!0!==e.originalIsValid||(s=!0),n.classList.toggle(this.settings.classNames.tagInvalid,!0!==s),r.__isValid=s,n.title=!0===s?r.title||r.value:s,i.length>=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=i),this.dropdown.show(i)),this.trigger("edit:input",{tag:n,index:a,data:d({},this.value[a],{newValue:i}),event:t})},onEditTagPaste(e,t){var n=(t.clipboardData||window.clipboardData).getData("Text");t.preventDefault();var a=w(n);this.setRangeAtStartEnd(!1,a)},onEditTagFocus(e){this.state.editing={scope:e,input:e.querySelector("[contenteditable]")}},onEditTagBlur(e){if(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(e)){var t,n,a=this.settings,r=e.closest("."+a.classNames.tag),i=y(r),o=this.input.normalize.call(this,e),s={[a.tagTextProp]:o,__tagId:i.__tagId},l=i.__originalData,c=this.editTagChangeDetected(d(i,s)),p=this.validateTag(s);if(o)if(c){if(t=this.hasMaxTags(),n=d({},l,{[a.tagTextProp]:this.trim(o),__isValid:p}),a.transformTag.call(this,n,l),!0!==(p=(!t||!0===l.__isValid)&&this.validateTag(n))){if(this.trigger("invalid",{data:n,tag:r,message:p}),a.editTags.keepInvalid)return;a.keepInvalidTags?n.__isValid=p:n=l}else a.keepInvalidTags&&(delete n.title,delete n["aria-invalid"],delete n.class);this.onEditTagDone(r,n)}else this.onEditTagDone(r,l);else this.onEditTagDone(r)}},onEditTagkeydown(e,t){if(!this.state.composing)switch(this.trigger("edit:keydown",{event:e}),e.key){case"Esc":case"Escape":t.parentNode.replaceChild(t.__tagifyTagData.__originalHTML,t),this.state.editing=!1;case"Enter":case"Tab":e.preventDefault(),e.target.blur()}},onDoubleClickScope(e){var t,n,a=e.target.closest("."+this.settings.classNames.tag),r=y(a),i=this.settings;a&&i.userInput&&!1!==r.editable&&(t=a.classList.contains(this.settings.classNames.tagEditing),n=a.hasAttribute("readonly"),"select"==i.mode||i.readonly||t||n||!this.settings.editTags||this.editTag(a),this.toggleFocusClass(!0),this.trigger("dblclick",{tag:a,index:this.getNodeIndex(a),data:y(a)}))},onInputDOMChange(e){e.forEach((e=>{e.addedNodes.forEach((e=>{if("

"==e.outerHTML)e.replaceWith(document.createElement("br"));else if(1==e.nodeType&&e.querySelector(this.settings.classNames.tagSelector)){let t=document.createTextNode("");3==e.childNodes[0].nodeType&&"BR"!=e.previousSibling.nodeName&&(t=document.createTextNode("\n")),e.replaceWith(t,...[...e.childNodes].slice(0,-1)),b(t)}else if(v.call(this,e))if(3!=e.previousSibling?.nodeType||e.previousSibling.textContent||e.previousSibling.remove(),e.previousSibling&&"BR"==e.previousSibling.nodeName){e.previousSibling.replaceWith("\n"+a);let t=e.nextSibling,n="";for(;t;)n+=t.textContent,t=t.nextSibling;n.trim()&&b(e.previousSibling)}else e.previousSibling&&!y(e.previousSibling)||e.before(a)})),e.removedNodes.forEach((e=>{e&&"BR"==e.nodeName&&v.call(this,t)&&(this.removeTags(t),this.fixFirefoxLastTagNoCaret())}))}));var t=this.DOM.input.lastChild;t&&""==t.nodeValue&&t.remove(),t&&"BR"==t.nodeName||this.DOM.input.appendChild(document.createElement("br"))}}};function I(e,t){if(!e){console.warn("Tagify:","input element not found",e);const t=new Proxy(this,{get:()=>()=>t});return t}if(e.__tagify)return console.warn("Tagify: ","input element is already Tagified - Same instance is returned.",e),e.__tagify;var n;d(this,function(e){var t=document.createTextNode("");function n(e,n,a){a&&n.split(/\s+/g).forEach((n=>t[e+"EventListener"].call(t,n,a)))}return{off(e,t){return n("remove",e,t),this},on(e,t){return t&&"function"==typeof t&&n("add",e,t),this},trigger(n,a,r){var i;if(r=r||{cloneData:!0},n)if(e.settings.isJQueryPlugin)"remove"==n&&(n="removeTag"),jQuery(e.DOM.originalInput).triggerHandler(n,[a]);else{try{var o="object"==typeof a?a:{value:a};if((o=r.cloneData?d({},o):o).tagify=this,a.event&&(o.event=this.cloneEvent(a.event)),a instanceof Object)for(var s in a)a[s]instanceof HTMLElement&&(o[s]=a[s]);i=new CustomEvent(n,{detail:o})}catch(e){console.warn(e)}t.dispatchEvent(i)}}}}(this)),this.isFirefox=/firefox|fxios/i.test(navigator.userAgent)&&!/seamonkey/i.test(navigator.userAgent),this.isIE=window.document.documentMode,t=t||{},this.getPersistedData=(n=t.id,e=>{let t,a="/"+e;if(1==localStorage.getItem(x+n+"/v",1))try{t=JSON.parse(localStorage[x+n+a])}catch(e){}return t}),this.setPersistedData=(e=>e?(localStorage.setItem(x+e+"/v",1),(t,n)=>{let a="/"+n,r=JSON.stringify(t);t&&n&&(localStorage.setItem(x+e+a,r),dispatchEvent(new Event("storage")))}):()=>{})(t.id),this.clearPersistedData=(e=>t=>{const n=x+"/"+e+"/";if(t)localStorage.removeItem(n+t);else for(let e in localStorage)e.includes(n)&&localStorage.removeItem(e)})(t.id),this.applySettings(e,t),this.state={inputText:"",editing:!1,composing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(e),E.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),e.autofocus&&this.DOM.input.focus(),e.__tagify=this}return I.prototype={_dropdown:_,getSetTagData:y,helpers:{sameStr:r,removeCollectionProp:i,omit:o,isObject:u,parseHTML:l,escapeHTML:p,extend:d,concatWithoutDups:m,getUID:f,isNodeTag:v},customEventsList:["change","add","remove","invalid","input","click","keydown","focus","blur","edit:input","edit:beforeUpdate","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select","dropdown:updated","dropdown:noMatch","dropdown:scroll"],dataProps:["__isValid","__removed","__originalData","__originalHTML","__tagId"],trim(e){return this.settings.trim&&e&&"string"==typeof e?e.trim():e},parseHTML:l,templates:N,parseTemplate(e,t){return l((e=this.settings.templates[e]||e).apply(this,t))},set whitelist(e){const t=e&&Array.isArray(e);this.settings.whitelist=t?e:[],this.setPersistedData(t?e:[],"whitelist")},get whitelist(){return this.settings.whitelist},generateClassSelectors(e){for(let t in e){let n=t;Object.defineProperty(e,n+"Selector",{get(){return"."+this[n].split(" ")[0]}})}},applySettings(e,n){T.templates=this.templates;var a=d({},T,"mix"==n.mode?{dropdown:{position:"text"}}:{}),r=this.settings=d({},a,n);if(r.disabled=e.hasAttribute("disabled"),r.readonly=r.readonly||e.hasAttribute("readonly"),r.placeholder=p(e.getAttribute("placeholder")||r.placeholder||""),r.required=e.hasAttribute("required"),this.generateClassSelectors(r.classNames),void 0===r.dropdown.includeSelectedTags&&(r.dropdown.includeSelectedTags=r.duplicates),this.isIE&&(r.autoComplete=!1),["whitelist","blacklist"].forEach((t=>{var n=e.getAttribute("data-"+t);n&&(n=n.split(r.delimiters))instanceof Array&&(r[t]=n)})),"autoComplete"in n&&!u(n.autoComplete)&&(r.autoComplete=T.autoComplete,r.autoComplete.enabled=n.autoComplete),"mix"==r.mode&&(r.pattern=r.pattern||/@/,r.autoComplete.rightKey=!0,r.delimiters=n.delimiters||null,r.tagTextProp&&!r.dropdown.searchKeys.includes(r.tagTextProp)&&r.dropdown.searchKeys.push(r.tagTextProp)),e.pattern)try{r.pattern=new RegExp(e.pattern)}catch(e){}if(r.delimiters){r._delimiters=r.delimiters;try{r.delimiters=new RegExp(this.settings.delimiters,"g")}catch(e){}}r.disabled&&(r.userInput=!1),this.TEXTS=t(t({},S),r.texts||{}),("select"!=r.mode||n.dropdown?.enabled)&&r.userInput||(r.dropdown.enabled=0),r.dropdown.appendTarget=n.dropdown?.appendTarget||document.body;let i=this.getPersistedData("whitelist");Array.isArray(i)&&(this.whitelist=Array.isArray(r.whitelist)?m(r.whitelist,i):i)},getAttributes(e){var t,n=this.getCustomAttributes(e),a="";for(t in n)a+=" "+t+(void 0!==e[t]?`="${n[t]}"`:"");return a},getCustomAttributes(e){if(!u(e))return"";var t,n={};for(t in e)"__"!=t.slice(0,2)&&"class"!=t&&e.hasOwnProperty(t)&&void 0!==e[t]&&(n[t]=p(e[t]));return n},setStateSelection(){var e=window.getSelection(),t={anchorOffset:e.anchorOffset,anchorNode:e.anchorNode,range:e.getRangeAt&&e.rangeCount&&e.getRangeAt(0)};return this.state.selection=t,t},getCSSVars(){var e,t=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(e=>{let t=e.value;return"s"==e.unit?1e3*t:t})(function(e){if(!e)return{};var t=(e=e.trim().split(" ")[0]).split(/\d+/g).filter((e=>e)).pop().trim();return{value:+e.split(t).filter((e=>e))[0].trim(),unit:t}}((e="tag-hide-transition",t.getPropertyValue("--"+e))))}},build(e){var t=this.DOM;this.settings.mixMode.integrated?(t.originalInput=null,t.scope=e,t.input=e):(t.originalInput=e,t.originalInput_tabIndex=e.tabIndex,t.scope=this.parseTemplate("wrapper",[e,this.settings]),t.input=t.scope.querySelector(this.settings.classNames.inputSelector),e.parentNode.insertBefore(t.scope,e),e.tabIndex=-1)},destroy(){this.events.unbindGlobal.call(this),this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,delete this.DOM.originalInput.__tagify,this.dropdown.hide(!0),clearTimeout(this.dropdownHide__bindEventsTimeout),clearInterval(this.listeners.main.originalInputValueObserverInterval)},loadOriginalValues(e){var t,n=this.settings;if(this.state.blockChangeEvent=!0,void 0===e){const t=this.getPersistedData("value");e=t&&!this.DOM.originalInput.value?t:n.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),e)if("mix"==n.mode)this.parseMixTags(e),(t=this.DOM.input.lastChild)&&"BR"==t.tagName||this.DOM.input.insertAdjacentHTML("beforeend","
");else{try{JSON.parse(e)instanceof Array&&(e=JSON.parse(e))}catch(e){}this.addTags(e,!0).forEach((e=>e&&e.classList.add(n.classNames.tagNoAnimation)))}else this.postUpdate();this.state.lastOriginalValueReported=n.mixMode.integrated?"":this.DOM.originalInput.value},cloneEvent(e){var t={};for(var n in e)"path"!=n&&(t[n]=e[n]);return t},loading(e){return this.state.isLoading=e,this.DOM.scope.classList[e?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading(e,t){return e&&e.classList[t?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass(e,t){"string"==typeof e&&this.DOM.scope.classList.toggle(e,t)},toggleScopeValidation(e){var t=!0===e||void 0===e;!this.settings.required&&e&&e===this.TEXTS.empty&&(t=!0),this.toggleClass(this.settings.classNames.tagInvalid,!t),this.DOM.scope.title=t?"":e},toggleFocusClass(e){this.toggleClass(this.settings.classNames.focus,!!e)},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var e=this.DOM.originalInput,t=this.state.lastOriginalValueReported!==e.value,n=new CustomEvent("change",{bubbles:!0});t&&(this.state.lastOriginalValueReported=e.value,n.simulated=!0,e._valueTracker&&e._valueTracker.setValue(Math.random()),e.dispatchEvent(n),this.trigger("change",this.state.lastOriginalValueReported),e.value=this.state.lastOriginalValueReported)}},events:C,fixFirefoxLastTagNoCaret(){},setRangeAtStartEnd(e,t){if(t){e="number"==typeof e?e:!!e,t=t.lastChild||t;var n=document.getSelection();if(n.focusNode instanceof Element&&!this.DOM.input.contains(n.focusNode))return!0;try{n.rangeCount>=1&&["Start","End"].forEach((a=>n.getRangeAt(0)["set"+a](t,e||t.length)))}catch(e){}}},insertAfterTag(e,t){if(t=t||this.settings.mixMode.insertAfterTag,e&&e.parentNode&&t)return t="string"==typeof t?document.createTextNode(t):t,e.parentNode.insertBefore(t,e.nextSibling),t},editTagChangeDetected(e){var t=e.__originalData;for(var n in t)if(!this.dataProps.includes(n)&&e[n]!=t[n])return!0;return!1},getTagTextNode(e){return e.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode(e,t){this.getTagTextNode(e).innerHTML=p(t)},editTag(e,t){e=e||this.getLastTag(),t=t||{},this.dropdown.hide();var n=this.settings,a=this.getTagTextNode(e),r=this.getNodeIndex(e),i=y(e),o=this.events.callbacks,s=this,l=!0;if(a){if(!(i instanceof Object&&"editable"in i)||i.editable)return i=y(e,{__originalData:d({},i),__originalHTML:e.cloneNode(!0)}),y(i.__originalHTML,i.__originalData),a.setAttribute("contenteditable",!0),e.classList.add(n.classNames.tagEditing),a.addEventListener("focus",o.onEditTagFocus.bind(this,e)),a.addEventListener("blur",(function(){setTimeout((()=>o.onEditTagBlur.call(s,s.getTagTextNode(e))))})),a.addEventListener("input",o.onEditTagInput.bind(this,a)),a.addEventListener("paste",o.onEditTagPaste.bind(this,a)),a.addEventListener("keydown",(t=>o.onEditTagkeydown.call(this,t,e))),a.addEventListener("compositionstart",o.onCompositionStart.bind(this)),a.addEventListener("compositionend",o.onCompositionEnd.bind(this)),t.skipValidation||(l=this.editTagToggleValidity(e)),a.originalIsValid=l,this.trigger("edit:start",{tag:e,index:r,data:i,isValid:l}),a.focus(),this.setRangeAtStartEnd(!1,a),this}else console.warn("Cannot find element in Tag template: .",n.classNames.tagTextSelector)},editTagToggleValidity(e,t){var n;if(t=t||y(e))return(n=!("__isValid"in t)||!0===t.__isValid)||this.removeTagsFromValue(e),this.update(),e.classList.toggle(this.settings.classNames.tagNotAllowed,!n),t.__isValid=n,t.__isValid;console.warn("tag has no data: ",e,t)},onEditTagDone(e,t){t=t||{};var n={tag:e=e||this.state.editing.scope,index:this.getNodeIndex(e),previousData:y(e),data:t};this.trigger("edit:beforeUpdate",n,{cloneData:!1}),this.state.editing=!1,delete t.__originalData,delete t.__originalHTML,e&&t[this.settings.tagTextProp]?(e=this.replaceTag(e,t),this.editTagToggleValidity(e,t),this.settings.a11y.focusableTags?e.focus():b(e)):e&&this.removeTags(e),this.trigger("edit:updated",n),this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag(e,t){t&&t.value||(t=e.__tagifyTagData),t.__isValid&&1!=t.__isValid&&d(t,this.getInvalidTagAttrs(t,t.__isValid));var n=this.createTagElem(t);return e.parentNode.replaceChild(n,e),this.updateValueByDOMTags(),n},updateValueByDOMTags(){this.value.length=0,[].forEach.call(this.getTagElms(),(e=>{e.classList.contains(this.settings.classNames.tagNotAllowed.split(" ")[0])||this.value.push(y(e))})),this.update()},injectAtCaret(e,t){return!(t=t||this.state.selection?.range)&&e?(this.appendMixTags(e),this):(w(e,t),this.setRangeAtStartEnd(!1,e),this.updateValueByDOMTags(),this.update(),this)},input:{set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var n=this.settings.dropdown.closeOnSelect;this.state.inputText=e,t&&(this.DOM.input.innerHTML=p(""+e)),!e&&n&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw(){return this.DOM.input.textContent},validate(){var e=!this.state.inputText||!0===this.validateTag({value:this.state.inputText});return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!e),e},normalize(e){var t=e||this.DOM.input,n=[];t.childNodes.forEach((e=>3==e.nodeType&&n.push(e.nodeValue))),n=n.join("\n");try{n=n.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch(e){}return n=n.replace(/\s/g," "),this.trim(n)},autocomplete:{suggest(e){if(this.settings.autoComplete.enabled){"string"==typeof(e=e||{value:""})&&(e={value:e});var t=this.dropdown.getMappedValue(e);if("number"!=typeof t){var n=t.substr(0,this.state.inputText.length).toLowerCase(),a=t.substring(this.state.inputText.length);t&&this.state.inputText&&n==this.state.inputText.toLowerCase()?(this.DOM.input.setAttribute("data-suggest",a),this.state.inputSuggestion=e):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}}},set(e){var t=this.DOM.input.getAttribute("data-suggest"),n=e||(t?this.state.inputText+t:null);return!!n&&("mix"==this.settings.mode?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+n)):(this.input.set.call(this,n),this.setRangeAtStartEnd(!1,this.DOM.input)),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx(e){return this.value.findIndex((t=>t.__tagId==(e||{}).__tagId))},getNodeIndex(e){var t=0;if(e)for(;e=e.previousElementSibling;)t++;return t},getTagElms(){for(var e=arguments.length,t=new Array(e),n=0;n{a.__tagifyTagData&&r(this.trim(a.__tagifyTagData.value),e,n)&&t.push(i)})),t},getTagElmByValue(e){var t=this.getTagIndexByValue(e)[0];return this.getTagElms()[t]},flashTag(e){e&&(e.classList.add(this.settings.classNames.tagFlash),setTimeout((()=>{e.classList.remove(this.settings.classNames.tagFlash)}),100))},isTagBlacklisted(e){return e=this.trim(e.toLowerCase()),this.settings.blacklist.filter((t=>(""+t).toLowerCase()==e)).length},isTagWhitelisted(e){return!!this.getWhitelistItem(e)},getWhitelistItem(e,t,n){t=t||"value";var a,i=this.settings;return(n=n||i.whitelist).some((n=>{var o="string"==typeof n?n:n[t]||n.value;if(r(o,e,i.dropdown.caseSensitive,i.trim))return a="string"==typeof n?{value:n}:n,!0})),a||"value"!=t||"value"==i.tagTextProp||(a=this.getWhitelistItem(e,i.tagTextProp,n)),a},validateTag(e){var t=this.settings,n="value"in e?"value":t.tagTextProp,a=this.trim(e[n]+"");return(e[n]+"").trim()?"mix"!=t.mode&&t.pattern&&t.pattern instanceof RegExp&&!t.pattern.test(a)?this.TEXTS.pattern:!t.duplicates&&this.isTagDuplicate(a,t.dropdown.caseSensitive,e.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(a)||t.enforceWhitelist&&!this.isTagWhitelisted(a)?this.TEXTS.notAllowed:!t.validate||t.validate(e):this.TEXTS.empty},getInvalidTagAttrs(e,t){return{"aria-invalid":!0,class:`${e.class||""} ${this.settings.classNames.tagNotAllowed}`.trim(),title:t}},hasMaxTags(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly(e,t){var n=this.settings;document.activeElement.blur(),n[t||"readonly"]=e,this.DOM.scope[(e?"set":"remove")+"Attribute"](t||"readonly",!0),this.settings.userInput=!0,this.setContentEditable(!e)},setContentEditable(e){this.settings.userInput&&(this.DOM.input.contentEditable=e,this.DOM.input.tabIndex=e?0:-1)},setDisabled(e){this.setReadonly(e,"disabled")},normalizeTags(e){var t=this.settings,n=t.whitelist,a=t.delimiters,r=t.mode,i=t.tagTextProp,o=[],s=!!n&&n[0]instanceof Object,l=Array.isArray(e),c=l&&e[0].value,p=e=>(e+"").split(a).filter((e=>e)).map((e=>({[i]:this.trim(e),value:this.trim(e)})));if("number"==typeof e&&(e=e.toString()),"string"==typeof e){if(!e.trim())return[];e=p(e)}else l&&(e=[].concat(...e.map((e=>null!=e.value?e:p(e)))));return s&&!c&&(e.forEach((e=>{var t=o.map((e=>e.value)),n=this.dropdown.filterListItems.call(this,e[i],{exact:!0});this.settings.duplicates||(n=n.filter((e=>!t.includes(e.value))));var a=n.length>1?this.getWhitelistItem(e[i],i,n):n[0];a&&a instanceof Object?o.push(a):"mix"!=r&&(null==e.value&&(e.value=e[i]),o.push(e))})),o.length&&(e=o)),e},parseMixTags(e){var t=this.settings,n=t.mixTagsInterpolator,a=t.duplicates,r=t.transformTag,i=t.enforceWhitelist,o=t.maxTags,s=t.tagTextProp,l=[];e=e.split(n[0]).map(((e,t)=>{var c,p,u,d=e.split(n[1]),m=d[0],h=l.length==o;try{if(m==+m)throw Error;p=JSON.parse(m)}catch(e){p=this.normalizeTags(m)[0]||{value:m}}if(r.call(this,p),h||!(d.length>1)||i&&!this.isTagWhitelisted(p.value)||!a&&this.isTagDuplicate(p.value)){if(e)return t?n[0]+e:e}else p[c=p[s]?s:"value"]=this.trim(p[c]),u=this.createTagElem(p),l.push(p),u.classList.add(this.settings.classNames.tagNoAnimation),d[0]=u.outerHTML,this.value.push(p);return d.join("")})).join(""),this.DOM.input.innerHTML=e,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize();var c=this.getTagElms();return c.forEach(((e,t)=>y(e,l[t]))),this.update({withoutChangeEvent:!0}),k(c,this.state.hasFocus),e},replaceTextWithNode(e,t){if(this.state.tag||t){t=t||this.state.tag.prefix+this.state.tag.value;var n,a,r=this.state.selection||window.getSelection(),i=r.anchorNode,o=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return i.splitText(r.anchorOffset-o),-1==(n=i.nodeValue.lastIndexOf(t))||(a=i.splitText(n),e&&i.parentNode.replaceChild(e,a)),!0}},selectTag(e,t){var n=this.settings;if(!n.enforceWhitelist||this.isTagWhitelisted(t.value)){this.input.set.call(this,t[n.tagTextProp]||t.value,!0),this.state.actions.selectOption&&setTimeout((()=>this.setRangeAtStartEnd(!1,this.DOM.input)));var a=this.getLastTag();return a?this.replaceTag(a,t):this.appendTag(e),this.value[0]=t,this.update(),this.trigger("add",{tag:e,data:t}),[e]}},addEmptyTag(e){var t=d({value:""},e||{}),n=this.createTagElem(t);y(n,t),this.appendTag(n),this.editTag(n,{skipValidation:!0})},addTags(e,t,n){var a=[],r=this.settings,i=[],o=document.createDocumentFragment();if(n=n||r.skipInvalid,!e||0==e.length)return a;switch(e=this.normalizeTags(e),r.mode){case"mix":return this.addMixTags(e);case"select":t=!1,this.removeAllTags()}return this.DOM.input.removeAttribute("style"),e.forEach((e=>{var t,s={},l=Object.assign({},e,{value:e.value+""});if(e=Object.assign({},l),r.transformTag.call(this,e),e.__isValid=this.hasMaxTags()||this.validateTag(e),!0!==e.__isValid){if(n)return;if(d(s,this.getInvalidTagAttrs(e,e.__isValid),{__preInvalidData:l}),e.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(e.value)),!r.createInvalidTags)return void i.push(e.value)}if("readonly"in e&&(e.readonly?s["aria-readonly"]=!0:delete e.readonly),t=this.createTagElem(e,s),a.push(t),"select"==r.mode)return this.selectTag(t,e);o.appendChild(t),e.__isValid&&!0===e.__isValid?(this.value.push(e),this.trigger("add",{tag:t,index:this.value.length-1,data:e})):(this.trigger("invalid",{data:e,index:this.value.length,tag:t,message:e.__isValid}),r.keepInvalidTags||setTimeout((()=>this.removeTags(t,!0)),1e3)),this.dropdown.position()})),this.appendTag(o),this.update(),e.length&&t&&(this.input.set.call(this,r.createInvalidTags?"":i.join(r._delimiters)),this.setRangeAtStartEnd(!1,this.DOM.input)),r.dropdown.enabled&&this.dropdown.refilter(),a},addMixTags(e){if((e=this.normalizeTags(e))[0].prefix||this.state.tag)return this.prefixedTextToTag(e[0]);var t=document.createDocumentFragment();return e.forEach((e=>{var n=this.createTagElem(e);t.appendChild(n)})),this.appendMixTags(t),t},appendMixTags(e){var t=!!this.state.selection;t?this.injectAtCaret(e):(this.DOM.input.focus(),(t=this.setStateSelection()).range.setStart(this.DOM.input,t.range.endOffset),t.range.setEnd(this.DOM.input,t.range.endOffset),this.DOM.input.appendChild(e),this.updateValueByDOMTags(),this.update())},prefixedTextToTag(e){var t,n=this.settings,a=this.state.tag.delimiters;if(n.transformTag.call(this,e),e.prefix=e.prefix||this.state.tag?this.state.tag.prefix:(n.pattern.source||n.pattern)[0],t=this.createTagElem(e),this.replaceTextWithNode(t)||this.DOM.input.appendChild(t),setTimeout((()=>t.classList.add(this.settings.classNames.tagNoAnimation)),300),this.value.push(e),this.update(),!a){var r=this.insertAfterTag(t)||t;setTimeout(b,0,r)}return this.state.tag=null,this.trigger("add",d({},{tag:t},{data:e})),t},appendTag(e){var t=this.DOM,n=t.input;t.scope.insertBefore(e,n)},createTagElem(e,n){e.__tagId=f();var a,r=d({},e,t({value:p(e.value+"")},n));return function(e){for(var t,n=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,null,!1);t=n.nextNode();)t.textContent.trim()||t.parentNode.removeChild(t)}(a=this.parseTemplate("tag",[r,this])),y(a,e),a},reCheckInvalidTags(){var e=this.settings;this.getTagElms(e.classNames.tagNotAllowed).forEach(((t,n)=>{var a=y(t),r=this.hasMaxTags(),i=this.validateTag(a),o=!0===i&&!r;if("select"==e.mode&&this.toggleScopeValidation(i),o)return a=a.__preInvalidData?a.__preInvalidData:{value:a.value},this.replaceTag(t,a);t.title=r||i}))},removeTags(e,t,n){var a,r=this.settings;if(e=e&&e instanceof HTMLElement?[e]:e instanceof Array?e:e?[e]:[this.getLastTag()],a=e.reduce(((e,t)=>{t&&"string"==typeof t&&(t=this.getTagElmByValue(t));var n=y(t);return t&&n&&!n.readonly&&e.push({node:t,idx:this.getTagIdx(n),data:y(t,{__removed:!0})}),e}),[]),n="number"==typeof n?n:this.CSSVars.tagHideTransition,"select"==r.mode&&(n=0,this.input.set.call(this)),1==a.length&&"select"!=r.mode&&a[0].node.classList.contains(r.classNames.tagNotAllowed)&&(t=!0),a.length)return r.hooks.beforeRemoveTag(a,{tagify:this}).then((()=>{function e(e){e.node.parentNode&&(e.node.parentNode.removeChild(e.node),t?r.keepInvalidTags&&this.trigger("remove",{tag:e.node,index:e.idx}):(this.trigger("remove",{tag:e.node,index:e.idx,data:e.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),r.keepInvalidTags&&this.reCheckInvalidTags()))}n&&n>10&&1==a.length?function(t){t.node.style.width=parseFloat(window.getComputedStyle(t.node).width)+"px",document.body.clientTop,t.node.classList.add(r.classNames.tagHide),setTimeout(e.bind(this),n,t)}.call(this,a[0]):a.forEach(e.bind(this)),t||(this.removeTagsFromValue(a.map((e=>e.node))),this.update(),"select"==r.mode&&this.setContentEditable(!0))})).catch((e=>{}))},removeTagsFromDOM(){[].slice.call(this.getTagElms()).forEach((e=>e.parentNode.removeChild(e)))},removeTagsFromValue(e){(e=Array.isArray(e)?e:[e]).forEach((e=>{var t=y(e),n=this.getTagIdx(t);n>-1&&this.value.splice(n,1)}))},removeAllTags(e){e=e||{},this.value=[],"mix"==this.settings.mode?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout((()=>{this.DOM.input.focus()})),"select"==this.settings.mode&&(this.input.set.call(this),this.setContentEditable(!0)),this.update(e)},postUpdate(){this.state.blockChangeEvent=!1;var e=this.settings,t=e.classNames,n="mix"==e.mode?e.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(t.hasMaxTags,this.value.length>=e.maxTags),this.toggleClass(t.hasNoTags,!this.value.length),this.toggleClass(t.empty,!n),"select"==e.mode&&this.toggleScopeValidation(this.value?.[0]?.__isValid)},setOriginalInputValue(e){var t=this.DOM.originalInput;this.settings.mixMode.integrated||(t.value=e,t.tagifyValue=t.value,this.setPersistedData(e,"value"))},update(e){clearTimeout(this.debouncedUpdateTimeout),this.debouncedUpdateTimeout=setTimeout(function(){var t=this.getInputValue();this.setOriginalInputValue(t),this.settings.onChangeAfterBlur&&(e||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent(),this.postUpdate()}.bind(this),100)},getInputValue(){var e=this.getCleanValue();return"mix"==this.settings.mode?this.getMixedTagsAsString(e):e.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(e):JSON.stringify(e):""},getCleanValue(e){return i(e||this.value,this.dataProps)},getMixedTagsAsString(){var e="",t=this,n=this.settings,a=n.originalInputValueFormat||JSON.stringify,r=n.mixTagsInterpolator;return function n(i){i.childNodes.forEach((i=>{if(1==i.nodeType){const s=y(i);if("BR"==i.tagName&&(e+="\r\n"),s&&v.call(t,i)){if(s.__removed)return;e+=r[0]+a(o(s,t.dataProps))+r[1]}else i.getAttribute("style")||["B","I","U"].includes(i.tagName)?e+=i.textContent:"DIV"!=i.tagName&&"P"!=i.tagName||(e+="\r\n",n(i))}else e+=i.textContent}))}(this.DOM.input),e}},I.prototype.removeTag=I.prototype.removeTags,I}()},184:function(e,t){var n;!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t=t||n<0||f&&e-h>=p}function b(){var e=r();if(y(e))return k(e);d=setTimeout(b,function(e){var n=t-(e-m);return f?s(n,p-(e-h)):n}(e))}function k(e){return d=void 0,v&&l?w(e):(l=c=void 0,u)}function T(){var e=r(),n=y(e);if(l=arguments,c=this,m=e,n){if(void 0===d)return function(e){return h=e,d=setTimeout(b,t),g?w(e):u}(m);if(f)return clearTimeout(d),d=setTimeout(b,t),w(m)}return void 0===d&&(d=setTimeout(b,t)),u}return t=i(t)||0,a(n)&&(g=!!n.leading,p=(f="maxWait"in n)?o(i(n.maxWait)||0,t):p,v="trailing"in n?!!n.trailing:v),T.cancel=function(){void 0!==d&&clearTimeout(d),h=0,l=m=c=d=void 0},T.flush=function(){return void 0===d?u:k(r())},T}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(e,t,n){var a=n(239),r=n(5);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==a(e)}},771:function(e,t,n){var a=n(639);e.exports=function(){return a.Date.now()}},841:function(e,t,n){var a=n(561),r=n(218),i=n(448),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=a(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):o.test(e)?NaN:+e}}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var i=t[a]={exports:{}};return e[a].call(i.exports,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 a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e={};n.r(e),n.d(e,{__experimentalGetAllAnnotationsForBlock:function(){return pt},__experimentalGetAnnotations:function(){return dt},__experimentalGetAnnotationsForBlock:function(){return ct},__experimentalGetAnnotationsForRichText:function(){return ut}});var t={};n.r(t),n.d(t,{__experimentalAddAnnotation:function(){return bt},__experimentalRemoveAnnotation:function(){return kt},__experimentalRemoveAnnotationsBySource:function(){return Et},__experimentalUpdateAnnotationRange:function(){return Tt}});var a=wp.i18n,r=wp.data,i=wp.hooks,o=wp.element,s=n(184),l=n.n(s),c=lodash,p=wp.compose,u=wp.components;function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var m=["tabId","onClick","children","selected"];function h(e,t){for(var n=0;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var E=function(e){var t=e.tabId,n=e.onClick,a=e.children,r=e.selected,i=T(e,m);return wp.element.createElement(u.Button,k({role:"tab",tabIndex:r?null:-1,"aria-selected":r,id:t,onClick:n},i),a)},_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(i,e);var t,n,a,r=f(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),y(v(e=r.apply(this,arguments)),"handleClick",(function(t){var n=e.props.onSelect,a=void 0===n?c.noop:n;e.setState({selected:t}),a(t)})),y(v(e),"onNavigate",(function(e,t){t.click()}));var t=e.props,n=t.tabs,a=t.initialTabName;return e.state={selected:a||(n.length>0?n[0].name:null)},e}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.state.selected,n=this.props,a=n.activeClass,r=void 0===a?"is-active":a,i=n.className,o=n.instanceId,s=n.orientation,p=void 0===s?"horizontal":s,d=n.tabs,m=(0,c.find)(d,{name:t}),h=o+"-"+m.name,g=d.slice(4);return wp.element.createElement("div",{className:i},wp.element.createElement(u.NavigableMenu,{role:"tablist",orientation:p,onNavigate:this.onNavigate,className:"components-tab-panel__tabs "+t},d.slice(0,4).map((function(n){return wp.element.createElement(E,{className:l()("components-tab-panel__tabs-item",n.className,y({},r,n.name===t)),tabId:o+"-"+n.name,"aria-controls":o+"-"+n.name+"-view",selected:n.name===t,key:n.name,onClick:(0,c.partial)(e.handleClick,n.name)},n.title)})),g.map((function(n){return wp.element.createElement(E,{className:l()("components-tab-panel__tabs-item",n.className,y({},r,n.name===t)),tabId:o+"-"+n.name,"aria-controls":o+"-"+n.name+"-view",selected:n.name===t,key:n.name,onClick:(0,c.partial)(e.handleClick,n.name)},n.title)}))),m&&wp.element.createElement("div",{"aria-labelledby":h,role:"tabpanel",id:h+"-view",className:"components-tab-panel__tab-content"},this.props.children(m)))}}])&&h(t.prototype,n),a&&h(t,a),Object.defineProperty(t,"prototype",{writable:!1}),i}(o.Component),x=(0,p.withInstanceId)(_),O=document.createElement("div");function S(e){return e&&"string"==typeof e&&(e=e.replace(/]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),O.innerHTML=e,e=O.textContent,O.textContent=""),e}function N(e,t,n){var a=0;return!1!==(0,c.get)(n,"pixelWidth",!1)&&(a=Math.min(100,Math.floor(t/n.pixelWidth*100))),Math.max(Math.min(100,Math.floor(e/n.max*100)),a)+"%"}function C(e,t){return e<=t.min||e>t.max}function I(e,t){return e<=t.minWidth||e>t.pixelWidth}var D=function(e){var t=function(e,t){var n=S(e).length,a=0,r=!1;if(!1!==(0,c.get)(t,"pixelWidth",!1)){r=!0;var i=document.createTextNode(e),o=document.createElement("span");o.appendChild(i),o.id="rank-math-width-tester",o.className=t.widthCheckerClass;var s=document.body.appendChild(o);a=document.getElementById("rank-math-width-tester").offsetWidth,s.outerHTML=""}return{left:N(n,a,t),isInvalid:C(n,t),isInvalidWidth:!!r&&I(a,t),count:n+" / "+t.max,pixelWidth:r?a+"px / "+t.pixelWidth+"px":""}}(e.source,e),n=t.pixelWidth?" (".concat(t.pixelWidth,")"):"";return wp.element.createElement("span",{className:l()("length-indicator-wrapper",{invalid:t.isInvalid||t.isInvalidWidth})},wp.element.createElement("span",{className:"length-count"},t.count,n),wp.element.createElement("span",{className:"length-indicator"},wp.element.createElement("span",{style:{left:t.left}})))},M=wp.htmlEntities,A=React;function P(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function R(e,t){let n,a,r=[];for(let i=0;i","{{strong}}").replace("","{{/strong}}"))))}),this))),wp.element.createElement(u.Button,{icon:"arrow-down-alt2",onClick:function(){e.toggle()}}))}},{key:"toggle",value:function(){this.state.isOpen?document.removeEventListener("click",this.handleOutsideClick,!0):document.addEventListener("click",this.handleOutsideClick,!0),this.setState({display:this.state.isOpen?"none":"block",isOpen:!this.state.isOpen})}},{key:"handleOutsideClick",value:function(e){this.node.contains(e.target)||this.toggle()}},{key:"handleSearch",value:function(e){var t=e.toLowerCase();2>t.length?this.setState({filtered:this.state.variables}):this.setState({filtered:this.state.variables.filter((function(e){return-1!==Object.values(e).join(" ").toLowerCase().indexOf(t)}))})}}])&&U(t.prototype,n),r&&U(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component),K=(0,p.compose)((0,r.withSelect)((function(e){var t=e("rank-math");return{title:t.getTitle(),serpTitle:t.getSerpTitle()}})),(0,r.withDispatch)((function(e){return{updateTitle:function(t){e("rank-math").updateSerpTitle(t),e("rank-math").updateTitle(t)}}})))((function(e){var t=e.title,n=e.serpTitle,r=e.updateTitle;return wp.element.createElement("div",{className:"field-group"},wp.element.createElement("label",{htmlFor:"rank-math-editor-title"},(0,a.__)("Title","rank-math")),wp.element.createElement(D,{source:n,min:15,max:60,pixelWidth:580,widthCheckerClass:"title"}),wp.element.createElement("div",{className:"variable-group"},wp.element.createElement(u.TextControl,{id:"rank-math-editor-title",value:t,placeholder:rankMath.assessor.serpData.titleTemplate,help:(0,a.__)("This is what will appear in the first line when this post shows up in the search results.","rank-math"),onChange:r}),wp.element.createElement(G,{exclude:["seo_title","seo_description"],onClick:function(e){return r(t+" %"+e.variable+"%")}})))})),$=rankMathAnalyzer,q=wp.url;var Y=(0,p.compose)((0,r.withSelect)((function(e){var t=rankMathEditor.assessor.dataCollector,n=e("rank-math").getSerpSlug();return{permalink:n||t.getSlug(),serpPermalink:t.getPermalink()}})),(0,r.withDispatch)((function(){return{updatePermalink:function(e){rankMathEditor.updatePermalink($.Helpers.sanitizeText(e),!0)},updatePermalinkSanitize:function(e){rankMathEditor.updatePermalinkSanitize(function(e){return e=e.replace(/,/g,""),e=$.Helpers.removeDiacritics(e),$.Helpers.sanitizeText(e)}(e))}}})))((function(e){var t=e.permalink,n=e.serpPermalink,r=e.updatePermalink,i=e.updatePermalinkSanitize;return wp.element.createElement("div",{className:"field-group"},wp.element.createElement("label",{htmlFor:"rank-math-editor-permalink"},(0,a.__)("Permalink","rank-math")),wp.element.createElement(D,{source:(0,q.safeDecodeURIComponent)(n),min:5,max:75}),wp.element.createElement(u.TextControl,{id:"rank-math-editor-permalink",value:rankMath.is_front_page?"/":(0,q.safeDecodeURIComponent)(t),onChange:r,help:rankMath.is_front_page?(0,a.__)("Editing Homepage permalink is not possible.","rank-math"):(0,a.__)("This is the unique URL of this page, displayed below the post title in the search results.","rank-math"),disabled:rankMath.is_front_page?"disabled":"",onBlur:function(e){i(e.target.value)}}))})),X=(0,p.compose)((0,r.withSelect)((function(e){var t=e("rank-math");return{description:t.getDescription(),serpDescription:t.getSerpDescription()}})),(0,r.withDispatch)((function(e){return{updateDescription:function(t){e("rank-math").updateSerpDescription(t),e("rank-math").updateDescription(t)}}})))((function(e){var t=e.description,n=e.serpDescription,r=e.updateDescription;return wp.element.createElement("div",{className:"field-group"},wp.element.createElement("label",{htmlFor:"rank-math-editor-description"},(0,a.__)("Description","rank-math")),wp.element.createElement(D,{source:n,min:80,max:160,pixelWidth:920,widthCheckerClass:"description"}),wp.element.createElement("div",{className:"variable-group rank-math-description-variables"},wp.element.createElement(u.TextareaControl,{id:"rank-math-editor-description",value:S(t),placeholder:n||(0,c.unescape)(rankMath.assessor.serpData.descriptionTemplate),help:(0,a.__)("This is what will appear as the description when this post shows up in the search results.","rank-math"),onChange:r}),wp.element.createElement(G,{exclude:["seo_title","seo_description"],onClick:function(e){return r(t+" %"+e.variable+"%")}})))})),J=(0,p.compose)((0,r.withSelect)((function(e){return{type:e("rank-math").getSnippetPreviewType()}})),(0,r.withDispatch)((function(e,t){return{updatePreviewType:function(n){e("rank-math").updateSnippetPreviewType(n===t.type?"":n)}}})))((function(e){var t=e.type,n=e.updatePreviewType,a=l()("button button-secondary button-small",{active:"desktop"===t}),r=l()("button button-secondary button-small",{active:"mobile"===t});return wp.element.createElement("div",{className:"rank-math-button-devices alignright"},(0,i.applyFilters)("rank_math_before_serp_devices",""),wp.element.createElement("div",{onClick:function(){return n("desktop")},className:a},wp.element.createElement("i",{className:"rm-icon rm-icon-desktop"})),wp.element.createElement("div",{onClick:function(){return n("mobile")},className:r},wp.element.createElement("i",{className:"rm-icon rm-icon-mobile"})))}));function Z(e){return 100'+e+""})))}var te=function(e,t){for(var n=[],a=1;a<=e;a++)n.push(wp.element.createElement(u.Dashicon,{key:Math.random(),size:"13",icon:"star-"+t}));return n},ne=(0,r.withSelect)((function(e){var t=e("rank-math").getSchemas();return{schema:(0,c.find)(t,(function(e){return!(0,c.isEmpty)(e.metadata.isPrimary)}))}}))((function(e){var t=e.schema;if((0,c.isEmpty)(t))return null;var n=(0,c.get)(t,"review.reviewRating",{}),r=n.ratingValue;if((0,c.isEmpty)(r))return null;(0,c.get)(n,"worstRating",1);var i=(0,c.get)(n,"bestRating",5);return wp.element.createElement("div",{className:"rank-math-rating-preview"},wp.element.createElement("div",{className:"serp-ratings"},te(i,"filled"),function(e,t,n){return e*=100/n,wp.element.createElement("div",{className:"serp-result",style:{width:e+"%"}},te(n,"filled"))}(r,0,i)),wp.element.createElement("span",{className:"serp-rating-label"},(0,a.__)("Rating: ","rank-math")),wp.element.createElement("span",{className:"serp-rating-value"},r))}));function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function re(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ae(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!==ae(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ae(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ie=(0,r.withSelect)((function(e){var t=e("rank-math"),n=t.getRobots();return{title:t.getSerpTitle(),permalink:rankMathEditor.assessor.dataCollector.getPermalink(),description:t.getSerpDescription(),previewType:t.getSnippetPreviewType(),isNoIndex:"noindex"in n,keyword:t.getSelectedKeyword().data.value}}))((function(e){var t=e.title,n=e.permalink,r=e.description,i=e.previewType,o=void 0===i?"desktop":i,s=e.isNoIndex,c=e.keyword,p=e.onClick,u=e.showScore,d=void 0===u||u,m=e.showDevices,h=void 0!==m&&m,g=l()("serp-preview",re(re({"expanded-preview":""!==o},"".concat(o,"-preview"),""!==o&&h),"noindex-preview",s)),f=l()("serp-title",{capitalize:rankMath.capitalizeTitle}),v=rankMathEditor.assessor.getResearch("slugify")(c);return wp.element.createElement("div",{className:g},wp.element.createElement("div",{className:"serp-preview-title","data-title":(0,a.__)("Preview","rank-math"),"data-desktop":(0,a.__)("Desktop Preview","rank-math"),"data-mobile":(0,a.__)("Mobile Preview","rank-math")},d&&wp.element.createElement(Q,null)," ",h&&wp.element.createElement(J,null)),wp.element.createElement("div",{className:"serp-preview-wrapper"},wp.element.createElement("div",{className:"serp-preview-bg"},wp.element.createElement("div",{className:"serp-preview-input"},wp.element.createElement("input",{type:"text",value:c||(0,a.__)("Rank Math","rank-math"),disabled:!0}),wp.element.createElement("span",{className:"serp-icon-search"},wp.element.createElement("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},wp.element.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))),wp.element.createElement("span",{className:"serp-icon-mic"})),wp.element.createElement("div",{className:"serp-preview-menus"},wp.element.createElement("ul",null,wp.element.createElement("li",{className:"current"},wp.element.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgyNHYyNEgweiIvPjxwYXRoIGZpbGw9IiMzNEE4NTMiIGQ9Ik0xMCAydjJhNiA2IDAgMCAxIDYgNmgyYTggOCAwIDAgMC04LTh6Ii8+PHBhdGggZmlsbD0iI0VBNDMzNSIgZD0iTTEwIDRWMmE4IDggMCAwIDAtOCA4aDJjMC0zLjMgMi43LTYgNi02eiIvPjxwYXRoIGZpbGw9IiNGQkJDMDQiIGQ9Ik00IDEwSDJhOCA4IDAgMCAwIDggOHYtMmMtMy4zIDAtNi0yLjY5LTYtNnoiLz48cGF0aCBmaWxsPSIjNDI4NUY0IiBkPSJNMjIgMjAuNTlsLTUuNjktNS42OUE3Ljk2IDcuOTYgMCAwIDAgMTggMTBoLTJhNiA2IDAgMCAxLTYgNnYyYzEuODUgMCAzLjUyLS42NCA0Ljg4LTEuNjhsNS42OSA1LjY5TDIyIDIwLjU5eiIvPjwvc3ZnPgo=",alt:"","data-atf":"1"}),(0,a.__)("All","rank-math")),wp.element.createElement("li",null,wp.element.createElement("svg",{focusable:"false",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),wp.element.createElement("path",{d:"M14 13l4 5H6l4-4 1.79 1.78L14 13zm-6.01-2.99A2 2 0 0 0 8 6a2 2 0 0 0-.01 4.01zM22 5v14a3 3 0 0 1-3 2.99H5c-1.64 0-3-1.36-3-3V5c0-1.64 1.36-3 3-3h14c1.65 0 3 1.36 3 3zm-2.01 0a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h7v-.01h7a1 1 0 0 0 1-1V5z"}))," ",(0,a.__)("Images","rank-math")),wp.element.createElement("li",null,wp.element.createElement("svg",{focusable:"false",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{clipRule:"evenodd",d:"M0 0h24v24H0z",fill:"none"}),wp.element.createElement("path",{clipRule:"evenodd",d:"M10 16.5l6-4.5-6-4.5v9zM5 20h14a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1zm14.5 2H5a3 3 0 0 1-3-3V4.4A2.4 2.4 0 0 1 4.4 2h15.2A2.4 2.4 0 0 1 22 4.4v15.1a2.5 2.5 0 0 1-2.5 2.5z",fillRule:"evenodd"}))," ",(0,a.__)("Videos","rank-math")),wp.element.createElement("li",null,wp.element.createElement("svg",{focusable:"false",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),wp.element.createElement("path",{d:"M12 11h6v2h-6v-2zm-6 6h12v-2H6v2zm0-4h4V7H6v6zm16-7.22v12.44c0 1.54-1.34 2.78-3 2.78H5c-1.64 0-3-1.25-3-2.78V5.78C2 4.26 3.36 3 5 3h14c1.64 0 3 1.25 3 2.78zM19.99 12V5.78c0-.42-.46-.78-1-.78H5c-.54 0-1 .36-1 .78v12.44c0 .42.46.78 1 .78h14c.54 0 1-.36 1-.78V12zM12 9h6V7h-6v2z"}))," ",(0,a.__)("News","rank-math")),wp.element.createElement("li",null,wp.element.createElement("svg",{focusable:"false",viewBox:"0 0 16 16"},wp.element.createElement("path",{d:"M7.503 0c3.09 0 5.502 2.487 5.502 5.427 0 2.337-1.13 3.694-2.26 5.05-.454.528-.906 1.13-1.358 1.734-.452.603-.754 1.508-.98 1.96-.226.452-.377.829-.904.829-.528 0-.678-.377-.905-.83-.226-.451-.527-1.356-.98-1.959-.452-.603-.904-1.206-1.356-1.734C3.132 9.121 2 7.764 2 5.427 2 2.487 4.412 0 7.503 0zm0 1.364c-2.283 0-4.14 1.822-4.14 4.063 0 1.843.86 2.873 1.946 4.177.468.547.942 1.178 1.4 1.79.34.452.596.99.794 1.444.198-.455.453-.992.793-1.445.459-.61.931-1.242 1.413-1.803 1.074-1.29 1.933-2.32 1.933-4.163 0-2.24-1.858-4.063-4.139-4.063zm0 2.734a1.33 1.33 0 11-.001 2.658 1.33 1.33 0 010-2.658"}))," ",(0,a.__)("Maps","rank-math")),wp.element.createElement("li",null,wp.element.createElement("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},wp.element.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))," ",(0,a.__)("More","rank-math"))),wp.element.createElement("ul",{className:"menus-right"},wp.element.createElement("li",null,(0,a.__)("Settings","rank-math")),wp.element.createElement("li",null,(0,a.__)("Tools","rank-math")))),wp.element.createElement("div",{className:"serp-preview-result-stats"},(0,a.__)("About 43,700,000 results (0.32 seconds) ","rank-math"))),wp.element.createElement("div",{className:"serp-preview-body",role:"button",tabIndex:0,onClick:function(){p&&p()}},wp.element.createElement("div",{className:"group"},wp.element.createElement("img",{src:rankMath.siteFavIcon,width:"16",height:"16",className:"serp-preview-favicon",alt:""}),wp.element.createElement("div",{className:"serp-url",dangerouslySetInnerHTML:{__html:ee(v,$.Helpers.sanitizeText((0,q.safeDecodeURIComponent)(n)),75,/-? +/)}})),wp.element.createElement("div",{className:"group"},wp.element.createElement("h5",{className:f,dangerouslySetInnerHTML:{__html:ee(c,$.Helpers.sanitizeText(t),60)}})),wp.element.createElement(ne,null),wp.element.createElement("div",{className:"group"},wp.element.createElement("div",{className:"serp-description",dangerouslySetInnerHTML:{__html:ee(c,$.Helpers.sanitizeText(r),160)}}))),wp.element.createElement("div",{className:"serp-preview-noindex"},wp.element.createElement("h3",null,(0,a.__)("Noindex robots meta is enabled","rank-math")),wp.element.createElement("p",null,(0,a.__)("This page will not appear in search results. You can disable noindex in the Advanced tab.","rank-math")))))})),oe=(0,r.withSelect)((function(e){return{isNoIndex:"noindex"in e("rank-math").getRobots()}}))((function(){return wp.element.createElement("div",{className:"rank-math-editor-general"},wp.element.createElement(ie,{showScore:!1,showDevices:!0}),wp.element.createElement(K,null),wp.element.createElement(Y,null),wp.element.createElement(X,null))}));function se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=rankMath.links[e]||"";if(!n)return"#";if(!t)return n;var a={utm_source:"Plugin",utm_medium:encodeURIComponent(t),utm_campaign:"WP"};return n+"?"+Object.keys(a).map((function(e){return"".concat(e,"=").concat(a[e])})).join("&")}var le=jQuery,ce=n.n(le);function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}function ue(e,t){for(var n=0;n0?(0,a.__)("Replace Image","rank-math"):(0,a.__)("Add Image","rank-math")),e.imageID>0&&wp.element.createElement(u.Button,{className:"button",isDestructive:!0,isLink:!0,onClick:e.removeImage},(0,a.__)("Remove Image","rank-math")))},onSelect:e.updateImage}),wp.element.createElement("p",{className:"components-base-control__help"},(0,a.__)("Upload at least 600x315px image. Recommended size is 1200x630px.","rank-math")),wp.element.createElement("div",{className:"notice notice-warning inline hidden"},wp.element.createElement("p",null,(0,a.__)("Image is smaller than the minimum size, please select a different image.","rank-math"))))};function we(){var e=rankMath.overlayImages,t=[];return Object.keys(e).forEach((function(n){t.push({label:e[n].name,value:n})})),t}function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t3?n.removeClass("normal angry").addClass("happy"):n.removeClass("happy angry").addClass("normal")}))}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"_handleRef",value:function(e){this.component=e}},{key:"render",value:function(){for(var e=this,t=[],n=1;n<=5;n++)t.push(wp.element.createElement("a",{key:n,href:"https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?filter=5#new-post",target:"_blank",rel:"noopener noreferrer"},wp.element.createElement("span",{className:"dashicons dashicons-star-filled"})));return wp.element.createElement("div",{className:"ask-review",ref:this._handleRef},wp.element.createElement("h3",null,(0,a.__)("Rate Rank Math SEO","rank-math")),wp.element.createElement("p",null,wp.element.createElement(L,{tags:"em"},(0,a.__)("Hey, we noticed you are using Rank Math SEO plugin for more than a week now –{{em}}that's awesome!{{/em}} Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?","rank-math"))),wp.element.createElement("div",{className:"stars-wrapper"},wp.element.createElement("div",{className:"face"},wp.element.createElement("div",{className:"smiley happy"},wp.element.createElement("div",{className:"eyes"},wp.element.createElement("div",{className:"eye"}),wp.element.createElement("div",{className:"eye"})),wp.element.createElement("div",{className:"mouth"}))),wp.element.createElement("div",{className:"stars"},t)),wp.element.createElement(u.CheckboxControl,{label:wp.element.createElement(o.Fragment,null,wp.element.createElement("span",null,(0,a.__)("I already did. Please don't show this message again.","rank-math"))),onChange:function(){return e.alreadyReviewed()}}))}},{key:"alreadyReviewed",value:function(){ce().ajax({url:rankMath.ajaxurl,data:{action:"rank_math_already_reviewed",security:rankMath.security}}),rankMath.pluginReviewed=!0;var e=ce()(this.component);e.animate({opacity:.01},1500,(function(){var t=ce()(".rank-math-editor > .components-tab-panel__tabs > button");t.first().click(),t.last().remove(),e.remove()}))}}])&&Se(t.prototype,n),r&&Se(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component),Ae=(0,u.withFilters)("rankMath.analytics.reportButton")((function(){return null})),Pe=(0,p.compose)((0,r.withSelect)((function(e){return{isOpen:e("rank-math").isSnippetEditorOpen()}})),(0,r.withDispatch)((function(e,t){return{toggleEditor:function(){e("rank-math").toggleSnippetEditor(!t.isOpen)}}})))((function(e){var t=e.isOpen,n=e.initialTab,r=void 0===n?"":n,i=e.toggleEditor,s=[{name:"general",title:wp.element.createElement(o.Fragment,null,wp.element.createElement("i",{className:"rm-icon rm-icon-settings"}),wp.element.createElement("span",null,(0,a.__)("General","rank-math"))),view:oe}];return rankMath.canUser.social&&s.push({name:"social",title:wp.element.createElement(o.Fragment,null,wp.element.createElement("i",{className:"rm-icon rm-icon-social"}),wp.element.createElement("span",null,(0,a.__)("Social","rank-math"))),view:xe}),rankMath.showReviewTab&&!1===rankMath.pluginReviewed&&s.push({name:"review",className:"review-tab",title:wp.element.createElement(o.Fragment,null,wp.element.createElement("i",{className:"rm-icon rm-icon-heart-filled"})),view:Me}),wp.element.createElement(o.Fragment,null,wp.element.createElement(u.Button,{isPrimary:!0,className:"rank-math-edit-snippet",onClick:i},(0,a.__)("Edit Snippet","rank-math")),""===r&&wp.element.createElement(Ae,null),t&&wp.element.createElement(u.Modal,{title:(0,a.__)("Preview Snippet Editor","rank-math"),closeButtonLabel:(0,a.__)("Close","rank-math"),shouldCloseOnClickOutside:!1,onRequestClose:function(){document.body.classList.remove("modal-open"),i()},className:"rank-math-modal",overlayClassName:"rank-math-modal-overlay"},wp.element.createElement(u.TabPanel,{className:"rank-math-tabs rank-math-editor",activeClass:"is-active",initialTabName:r,tabs:s},(function(e){return(0,o.createElement)(e.view)}))))})),Re=function(){return wp.element.createElement(u.PanelBody,{initialOpen:!0},wp.element.createElement(u.BaseControl,{className:"rank-math-social"},wp.element.createElement("span",{className:"components-base-control__label"},(0,a.__)("Social Media Preview","rank-math")),wp.element.createElement("p",{className:"cmb2-metabox-description"},(0,a.__)("Here you can view and edit the thumbnail, title and description that will be displayed when your site is shared on social media.","rank-math")),wp.element.createElement("p",{className:"cmb2-metabox-description"},(0,a.__)("Click on the button below to view and edit the preview.","rank-math")),wp.element.createElement(Pe,{buttonLabel:(0,a.__)("Preview & Edit Social Media","rank-math"),initialTab:"social"})))};const je={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp://g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","€-¿×÷"," -⯿","⸀-⹿","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function Le(e,t){return t.replace(e.HTMLRegExp,"\n")}function Fe(e,t){return t.replace(e.astralRegExp,"a")}function Ue(e,t){return t.replace(e.HTMLEntityRegExp,"")}function Be(e,t){return t.replace(e.connectorRegExp," ")}function He(e,t){return t.replace(e.removeRegExp,"")}function Ve(e,t){return t.replace(e.HTMLcommentRegExp,"")}function ze(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,"\n"):t}function We(e,t){return t.replace(e.spaceRegExp," ")}function Ge(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function Ke(e,t,n){var a;return e=[Le.bind(null,n),Ve.bind(null,n),ze.bind(null,n),Fe.bind(null,n),We.bind(null,n),Ge.bind(null,n)].reduce(((e,t)=>t(e)),e),e+="\n",null!==(a=e.match(t)?.length)&&void 0!==a?a:0}function $e(e,t,n){const a=function(e,t){var n;const a=Object.assign({},je,t);return a.shortcodes=null!==(n=a.l10n?.shortcodes)&&void 0!==n?n:[],a.shortcodes&&a.shortcodes.length&&(a.shortcodesRegExp=new RegExp("\\[\\/?(?:"+a.shortcodes.join("|")+")[^\\]]*?\\]","g")),a.type=e,"characters_excluding_spaces"!==a.type&&"characters_including_spaces"!==a.type&&(a.type="words"),a}(t,n);let r;switch(a.type){case"words":return r=a.wordsRegExp,function(e,t,n){var a;return e=[Le.bind(null,n),Ve.bind(null,n),ze.bind(null,n),We.bind(null,n),Ue.bind(null,n),Be.bind(null,n),He.bind(null,n)].reduce(((e,t)=>t(e)),e),e+="\n",null!==(a=e.match(t)?.length)&&void 0!==a?a:0}(e,r,a);case"characters_including_spaces":return r=a.characters_including_spacesRegExp,Ke(e,r,a);case"characters_excluding_spaces":return r=a.characters_excluding_spacesRegExp,Ke(e,r,a);default:return 0}}var qe=wp.richText;const Ye="core/annotations",Xe="core/annotation",Je="annotation-text-";const Ze={name:Xe,title:(0,a.__)("Annotation"),tagName:"mark",className:"annotation-text",attributes:{className:"class",id:"id"},edit(){return null},__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:t,blockClientId:n}){return{annotations:e(Ye).__experimentalGetAnnotationsForRichText(n,t)}},__experimentalCreatePrepareEditableTree({annotations:e}){return(t,n)=>{if(0===e.length)return t;let a={formats:t,text:n};return a=function(e,t=[]){return t.forEach((t=>{let{start:n,end:a}=t;n>e.text.length&&(n=e.text.length),a>e.text.length&&(a=e.text.length);const r=Je+t.source,i=Je+t.id;e=(0,qe.applyFormat)(e,{type:Xe,attributes:{className:r,id:i}},n,a)})),e}(a,e),a.formats}},__experimentalGetPropsForEditableTreeChangeHandler(e){return{removeAnnotation:e(Ye).__experimentalRemoveAnnotation,updateAnnotationRange:e(Ye).__experimentalUpdateAnnotationRange}},__experimentalCreateOnChangeEditableValue(e){return t=>{const n=function(e){const t={};return e.forEach(((e,n)=>{(e=(e=e||[]).filter((e=>e.type===Xe))).forEach((e=>{let{id:a}=e.attributes;a=a.replace(Je,""),t.hasOwnProperty(a)||(t[a]={start:n}),t[a].end=n+1}))})),t}(t),{removeAnnotation:a,updateAnnotationRange:r,annotations:i}=e;!function(e,t,{removeAnnotation:n,updateAnnotationRange:a}){e.forEach((e=>{const r=t[e.id];if(!r)return void n(e.id);const{start:i,end:o}=e;i===r.start&&o===r.end||a(e.id,r.start,r.end)}))}(i,n,{removeAnnotation:a,updateAnnotationRange:r})}}},{name:Qe,...et}=Ze;(0,qe.registerFormatType)(Qe,et);function tt(e,t){const n=e.filter(t);return e.length===n.length?e:n}(0,i.addFilter)("editor.BlockListBlock","core/annotations",(e=>(0,r.withSelect)(((e,{clientId:t,className:n})=>({className:e(Ye).__experimentalGetAnnotationsForBlock(t).map((e=>"is-annotated-by-"+e.source)).concat(n).filter(Boolean).join(" ")})))(e)));const nt=(e,t)=>Object.entries(e).reduce(((e,[n,a])=>({...e,[n]:t(a)})),{});var at=function(e={},t){var n;switch(t.type){case"ANNOTATION_ADD":const a=t.blockClientId,r={id:t.id,blockClientId:a,richTextIdentifier:t.richTextIdentifier,source:t.source,selector:t.selector,range:t.range};if("range"===r.selector&&!function(e){return"number"==typeof e.start&&"number"==typeof e.end&&e.start<=e.end}(r.range))return e;const i=null!==(n=e?.[a])&&void 0!==n?n:[];return{...e,[a]:[...i,r]};case"ANNOTATION_REMOVE":return nt(e,(e=>tt(e,(e=>e.id!==t.annotationId))));case"ANNOTATION_UPDATE_RANGE":return nt(e,(e=>{let n=!1;const a=e.map((e=>e.id===t.annotationId?(n=!0,{...e,range:{start:t.start,end:t.end}}):e));return n?a:e}));case"ANNOTATION_REMOVE_SOURCE":return nt(e,(e=>tt(e,(e=>e.source!==t.source))))}return e},rt={};function it(e){return[e]}function ot(e,t,n){var a;if(e.length!==t.length)return!1;for(a=n;a{var n;return(null!==(n=e?.[t])&&void 0!==n?n:[]).filter((e=>"block"===e.selector))}),((e,t)=>{var n;return[null!==(n=e?.[t])&&void 0!==n?n:lt]}));function pt(e,t){var n;return null!==(n=e?.[t])&&void 0!==n?n:lt}const ut=st(((e,t,n)=>{var a;return(null!==(a=e?.[t])&&void 0!==a?a:[]).filter((e=>"range"===e.selector&&n===e.richTextIdentifier)).map((e=>{const{range:t,...n}=e;return{...t,...n}}))}),((e,t)=>{var n;return[null!==(n=e?.[t])&&void 0!==n?n:lt]}));function dt(e){return Object.values(e).flat()}var mt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let ht;const gt=new Uint8Array(16);function ft(){if(!ht&&(ht="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ht(gt)}const vt=[];for(let e=0;e<256;++e)vt.push((e+256).toString(16).slice(1));function wt(e,t=0){return vt[e[t+0]]+vt[e[t+1]]+vt[e[t+2]]+vt[e[t+3]]+"-"+vt[e[t+4]]+vt[e[t+5]]+"-"+vt[e[t+6]]+vt[e[t+7]]+"-"+vt[e[t+8]]+vt[e[t+9]]+"-"+vt[e[t+10]]+vt[e[t+11]]+vt[e[t+12]]+vt[e[t+13]]+vt[e[t+14]]+vt[e[t+15]]}var yt=function(e,t,n){if(mt.randomUUID&&!t&&!e)return mt.randomUUID();const a=(e=e||{}).random||(e.rng||ft)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=a[e];return t}return wt(a)};function bt({blockClientId:e,richTextIdentifier:t=null,range:n=null,selector:a="range",source:r="default",id:i=yt()}){const o={type:"ANNOTATION_ADD",id:i,blockClientId:e,richTextIdentifier:t,source:r,selector:a};return"range"===a&&(o.range=n),o}function kt(e){return{type:"ANNOTATION_REMOVE",annotationId:e}}function Tt(e,t,n){return{type:"ANNOTATION_UPDATE_RANGE",annotationId:e,start:t,end:n}}function Et(e){return{type:"ANNOTATION_REMOVE_SOURCE",source:e}}const _t=(0,r.createReduxStore)(Ye,{reducer:at,selectors:e,actions:t});function xt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ot(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if("classic"!==rankMath.currentEditor){if(!e)return(0,r.dispatch)(St).__experimentalRemoveAnnotationsBySource(Nt),void n([]);var a=(0,r.select)("core/block-editor").getBlocks();(0,c.forEach)(a,(function(e){if("core/paragraph"===e.name){var a=e.clientId;$e(e.attributes.content,"words")<120?(0,c.includes)(t,a)&&((0,r.dispatch)(St).__experimentalRemoveAnnotation(a),t=(0,c.remove)(t,a),n(t)):(t.push(a),n(t),(0,r.dispatch)(St).__experimentalAddAnnotation({id:a,blockClientId:a,source:Nt,richTextIdentifier:"content",range:{start:0,end:e.attributes.content.length}}))}}))}else!function(e){var t=window.tinymce.get(window.wpActiveEditor);if(!t)return!1;if(e){var n,a=xt(t.getBody().children||[]);try{for(a.s();!(n=a.n()).done;){var r=n.value;if("p"===r.localName)if($e(r.innerText,"words")<120)t.annotator.remove(Nt),r.getElementsByClassName("rank-math-content-ai-tooltip").length&&r.getElementsByClassName("rank-math-content-ai-tooltip")[0].remove();else{var i=t.selection.win.getSelection();i.selectAllChildren(r),t.annotator.annotate(Nt,{uid:"rank-math-annotation"}),i.empty()}}}catch(e){a.e(e)}finally{a.f()}}else t.annotator.remove(Nt)}(e)};function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}function Dt(e,t){for(var n=0;n").html(e).text(),((new DOMParser).parseFromString(e,"text/html").body.textContent||"").replace(/["<>]/g,"")||""},tn=function(e){var t=e.onClick;return wp.element.createElement(u.Modal,{title:(0,a.__)("Upgrade to re-order Focus Keywords","rank-math"),closeButtonLabel:(0,a.__)("Close","rank-math"),shouldCloseOnClickOutside:!0,onRequestClose:function(){return t()},className:"rank-math-modal rank-math-focus-keywords-cta-modal",overlayClassName:"rank-math-modal-overlay"},wp.element.createElement("div",{className:"components-panel__body rank-math-focus-keywords-cta-wrapper"},wp.element.createElement("div",{id:"rank-math-pro-cta",className:"center"},wp.element.createElement("div",{className:"rank-math-cta-box blue-ticks"},wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,a.__)("Improve the SEO workflow","rank-math")),wp.element.createElement("li",null,(0,a.__)("Set different Primary Focus Keyword","rank-math")),wp.element.createElement("li",null,(0,a.__)("and many other premium SEO features","rank-math"))),wp.element.createElement("a",{className:"button button-primary is-green",href:rankMath.trendsUpgradeLink,rel:"noreferrer noopener",target:"_blank"},rankMath.trendsUpgradeLabel)))))};function nn(e){return nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nn(e)}function an(e,t){for(var n=0;n\n \n
\n ").concat(en(n),"\n
\n ")}},callbacks:this.callbacks},this);return this.setKeywordsClasses(),wp.element.createElement(React.Fragment,null,wp.element.createElement(Qt,{ref:this.tagifyField,mode:"input",settings:t,showDropdown:this.state.showDropdown,initialValue:this.keywords,placeholder:(0,a.__)("Example: Rank Math SEO","rank-math")}),this.state.showCTA&&wp.element.createElement(tn,{onClick:function(){return e.setState({showCTA:!1})}}))}},{key:"shouldComponentUpdate",value:function(e,t){return this.state.showCTA!==t.showCTA||this.state.showDropdown!==t.showDropdown||e.isRefreshing!==this.props.isRefreshing||e.keywords!==this.props.keywords}},{key:"getScoreClass",value:function(e){return 800){var a=t.queryTags();n.map((function(t,n){if(!(0,c.isUndefined)(a[n])){var r=rankMathEditor.resultManager.getScore($.Helpers.removeDiacritics(t.value));a[n].classList.remove("ok-fk","good-fk","bad-fk"),a[n].classList.add(e.getScoreClass(r))}}))}}}},{key:"onSetup",value:function(){this.selectFirstKeyword(),this.setKeywordsClasses()}},{key:"onInput",value:function(e){var t=this;(e=(0,c.has)(e.detail,"value")?e.detail.value:e.detail.data.value).length<2||(this.hideDropdown(),this.hasAdded?this.hasAdded=!1:this.request=ce().ajax({url:rankMath.keywordsApi.url,data:{keyword:e,locale:rankMath.locale},success:function(n){if(t.hasAdded)t.hasAdded=!1;else{var a=ce().map(n,(function(e){return e}));t.setState({whitelist:a,showDropdown:e})}}}))}},{key:"onAdd",value:function(e){this.hasAdded=!0,0===e.detail.index&&this.props.updateSelectedKeyword(e.detail,this.tagifyField.current),this.updateKeywords()}},{key:"onRemove",value:function(e){this.hideDropdown(),0===e.detail.index&&this.onSetup(),rankMathEditor.resultManager.deleteResult(e.detail.data.value),this.selectFirstKeyword(),this.updateKeywords()}},{key:"onClick",value:function(e){var t=this;this.clickCount++,1===this.clickCount?this.singleClickTimer=setTimeout((function(){t.clickCount=0,t.props.updateSelectedKeyword(e.detail,t.tagifyField.current)}),400):2===this.clickCount&&(clearTimeout(this.singleClickTimer),this.clickCount=0)}},{key:"onEditUpdated",value:function(e){this.hasAdded=!0,0===e.detail.index&&this.props.updateSelectedKeyword(e.detail,this.tagifyField.current),this.updateKeywords()}},{key:"selectFirstKeyword",value:function(){var e=this.tagifyField.current,t=e.tagify.value,n={tag:"",index:0,data:{value:""}};t.length>0&&(n={tag:e.queryTags()[0],index:0,data:{value:t[0].value}}),this.props.updateSelectedKeyword(n,e)}},{key:"updateKeywords",value:function(){var e=this.tagifyField.current,t=en(e.toString());this.props.updateKeywords(t)}},{key:"onDragEnd",value:function(){1!==this.tagifyField.current.queryTags().length&&this.setState({showCTA:!0})}},{key:"hideDropdown",value:function(){null!==this.request&&(this.request.abort(),this.request=null),this.setState({whitelist:[],showDropdown:!1})}}],n&&an(t.prototype,n),r&&an(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(o.Component),dn=(0,p.compose)((0,r.withSelect)((function(e){var t=e("rank-math");return{keywords:t.getKeywords(),isRefreshing:t.isRefreshing()}})),(0,r.withDispatch)((function(e){return{updateKeywords:function(t){e("rank-math").updateKeywords(t)},updateSelectedKeyword:function(t,n){n.queryTags().forEach((function(e){e.classList.remove("selected")})),(0,c.isUndefined)(t.tag)||""===t.tag||t.tag.classList.add("selected"),e("rank-math").updateSelectedKeyword(t)}}})))(un);function mn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=i.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?e:[]})),wp.element.createElement("div",null,wp.element.createElement(dn,null)),wp.element.createElement(Vt,null),"post"===rankMath.objectType&&wp.element.createElement(u.CheckboxControl,{className:"pillar-content",label:wp.element.createElement(o.Fragment,null,wp.element.createElement("strong",null,(0,a.__)("This post is Pillar Content","rank-math")),wp.element.createElement("a",{href:se("pillar-content-internal-linking","Pillar Content"),rel:"noreferrer",target:"_blank",className:"dashicons-before dashicons-editor-help rank-math-help-icon"})),checked:n,onChange:r})):null})),yn=(0,u.createSlotFill)("RankMathAfterEditor"),bn=yn.Fill,kn=yn.Slot,Tn=function(e){var t=e.children,n=e.className;return wp.element.createElement(bn,null,wp.element.createElement(u.PanelRow,{className:n},t))};Tn.Slot=kn;var En=Tn,_n=(0,r.withDispatch)((function(e){return{toggleEditor:function(){e("rank-math").toggleSnippetEditor(!0)}}}))((function(e){var t=e.toggleEditor;return wp.element.createElement(o.Fragment,null,wp.element.createElement(u.PanelBody,{initialOpen:!0},wp.element.createElement(ie,{onClick:t}),wp.element.createElement(Pe,null),wp.element.createElement(En.Slot,null,(function(e){return e.length>0?e:[]}))),wp.element.createElement(wn,null),rankMath.canUser.analysis&&wp.element.createElement(jt,null))})),xn=function(e,t,n){return!1===n?delete e[t]:e[t]=!0,e},On=(0,p.compose)((0,r.withSelect)((function(e){var t=e("rank-math").getRobots();return{robots:t,isRobotIndex:"index"in t,isRobotNoIndex:"noindex"in t,isRobotNoFollow:"nofollow"in t,isRobotNoArchive:"noarchive"in t,isRobotNoImageIndex:"noimageindex"in t,isRobotNoSnippet:"nosnippet"in t}})),(0,r.withDispatch)((function(e,t){var n=t.robots;return{updateRobots:function(t,a){n=xn(n,t,a),"index"===t&&(n=xn(n,"noindex",!a)),"noindex"===t&&(n=xn(n,"index",!a)),e("rank-math").updateRobots(n)}}})))((function(e){return wp.element.createElement(u.BaseControl,{className:"rank-math-robots",id:"rank-math-robots",label:(0,a.__)("Robots Meta","rank-math")},wp.element.createElement("div",{className:"rank-math-robots-list"},wp.element.createElement(u.CheckboxControl,{className:"robot-choice-index",label:wp.element.createElement(o.Fragment,null,(0,a.__)("Index","rank-math"),wp.element.createElement(zt,null,(0,a.__)("Instructs search engines to index and show these pages in the search results","rank-math"))),checked:e.isRobotIndex,onChange:function(t){return e.updateRobots("index",t)}}),wp.element.createElement(u.CheckboxControl,{className:"robot-choice-noindex",label:wp.element.createElement(o.Fragment,null,(0,a.__)("No Index","rank-math"),wp.element.createElement(zt,null,(0,a.__)("Prevents pages from being indexed and displayed in search engine result pages","rank-math"))),checked:e.isRobotNoIndex,onChange:function(t){return e.updateRobots("noindex",t)}}),wp.element.createElement(u.CheckboxControl,{className:"robot-choice-nofollow",label:wp.element.createElement(o.Fragment,null,(0,a.__)("Nofollow","rank-math"),wp.element.createElement(zt,null,(0,a.__)("Prevents search engines from following links on the pages","rank-math"))),checked:e.isRobotNoFollow,onChange:function(t){return e.updateRobots("nofollow",t)}}),wp.element.createElement(u.CheckboxControl,{className:"robot-choice-noarchive",label:wp.element.createElement(o.Fragment,null,(0,a.__)("No Archive","rank-math"),wp.element.createElement(zt,null,(0,a.__)("Prevents search engines from showing Cached links for pages","rank-math"))),checked:e.isRobotNoArchive,onChange:function(t){return e.updateRobots("noarchive",t)}}),wp.element.createElement(u.CheckboxControl,{className:"robot-choice-noimageindex",label:wp.element.createElement(o.Fragment,null,(0,a.__)("No Image Index","rank-math"),wp.element.createElement(zt,null,(0,a.__)("This option prevents images on a page from being indexed by Google and other search engines","rank-math"))),checked:e.isRobotNoImageIndex,onChange:function(t){return e.updateRobots("noimageindex",t)}}),wp.element.createElement(u.CheckboxControl,{className:"robot-choice-nosnippet",label:wp.element.createElement(o.Fragment,null,(0,a.__)("No Snippet","rank-math"),wp.element.createElement(zt,null,(0,a.__)("Prevents a snippet from being shown in the search results","rank-math"))),checked:e.isRobotNoSnippet,onChange:function(t){return e.updateRobots("nosnippet",t)}})))}));function Sn(e){return Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sn(e)}function Nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Cn(e){for(var t=1;t0?e:[]})))},qn=n(279),Yn=n.n(qn),Xn={init:function(){this.cacheProps(),this.initVars(),this.bindEvents()},cacheProps:function(){this.root=document.documentElement,this.$wpAdminbar=ce()("#wpadminbar")},initVars:function(){this.$wpAdminbar.length&&this.setWpAdminbarHeight.call(this)},bindEvents:function(){window.addEventListener("resize",Yn()(this.onWindowResize.bind(this)))},onWindowResize:function(){this.$wpAdminbar.length&&this.setWpAdminbarHeight.call(this)},setWpAdminbarHeight:function(){this.root.style.setProperty("--rankmath-wp-adminbar-height",this.$wpAdminbar.outerHeight()+"px")}};ce()((function(){Xn.init()}));var Jn=function(e){"social"===e&&(0,r.dispatch)("rank-math").toggleSnippetEditor(!0)},Zn=function(){return wp.element.createElement(x,{className:"rank-math-tabs",activeClass:"is-active",tabs:(e=[],rankMath.canUser.general&&e.push({name:"general",title:wp.element.createElement(o.Fragment,null,wp.element.createElement("i",{className:"rm-icon rm-icon-settings",title:(0,a.__)("General","rank-math")}),wp.element.createElement("span",null,(0,a.__)("General","rank-math"))),view:_n,className:"rank-math-general-tab"}),rankMath.canUser.advanced&&e.push({name:"advanced",title:wp.element.createElement(o.Fragment,null,wp.element.createElement("i",{className:"rm-icon rm-icon-toolbox",title:(0,a.__)("Advanced","rank-math")}),wp.element.createElement("span",null,(0,a.__)("Advanced","rank-math"))),view:$n,className:"rank-math-advanced-tab"}),rankMath.canUser.social&&e.push({name:"social",title:wp.element.createElement(o.Fragment,null,wp.element.createElement("i",{className:"rm-icon rm-icon-social",title:(0,a.__)("Social","rank-math")}),wp.element.createElement("span",null,(0,a.__)("Social","rank-math"))),view:Re,className:"rank-math-social-tab"}),(0,i.applyFilters)("rank_math_sidebar_tabs",e)),onSelect:Jn},(function(e){return wp.element.createElement("div",{className:"rank-math-tab-content-"+e.name},(0,o.createElement)(e.view))}));var e};(0,i.addAction)("rank_math_loaded","rank-math",(function(){(0,i.addFilter)("rank_math_app","rank-math",(function(){return Zn}))}))}()}();