HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/hanode/public_html/wp-content/plugins/sitepress-multilingual-cms/dist/js/settings/app.js
!function(t){function e(e){for(var i,a,o=e[0],u=e[1],l=e[2],h=0,f=[];h<o.length;h++)a=o[h],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&f.push(r[a][0]),r[a]=0;for(i in u)Object.prototype.hasOwnProperty.call(u,i)&&(t[i]=u[i]);for(c&&c(e);f.length;)f.shift()();return s.push.apply(s,l||[]),n()}function n(){for(var t,e=0;e<s.length;e++){for(var n=s[e],i=!0,o=1;o<n.length;o++){var u=n[o];0!==r[u]&&(i=!1)}i&&(s.splice(e--,1),t=a(a.s=n[0]))}return t}var i={},r={12:0},s=[];function a(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=i,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)a.d(n,i,function(e){return t[e]}.bind(null,i));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="";var o=window.webpackWPML=window.webpackWPML||[],u=o.push.bind(o);o.push=e,o=o.slice();for(var l=0;l<o.length;l++)e(o[l]);var c=u;s.push([1279,0]),n()}({113:function(t,e,n){},114:function(t,e,n){"use strict";var i=n(3),r=n.n(i),s=n(7),a=n.n(s),o=n(9),u=n.n(o),l=n(0),c=n(17);e.a=function(t){var e=Object(l.useState)(!1),n=u()(e,2),i=n[0],s=n[1],o=Object(l.useState)(""),h=u()(o,2),f=h[0],d=h[1];return[i,function(){var e=a()(r.a.mark((function e(n,i){var a,o,u,l;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(""),s(!0),e.next=4,Object(c.a)(t,n);case 4:a=e.sent,o=a.data,u=o.success,l=o.data,s(!1),u?i():d(l);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),f,function(){return d("")}]}},123:function(t,e,n){},1279:function(t,e,n){"use strict";n.r(e);var i=n(0),r=n.n(i),s=n(38),a=n.n(s),o=n(14),u=n.n(o),l=n(16),c=n.n(l),h=n(35),f=n.n(h),d=n(42),p=n.n(d),v=n(34),m=n.n(v),y=n(68);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return p()(this,n)}}var S=function(t){f()(n,t);var e=g(n);function n(t){var i;return u()(this,n),(i=e.call(this)).ateControls=t,i.translationMethodForm=document.getElementById("icl_doc_translation_method"),i}return c()(n,[{key:"init",value:function(){this.updateSelectedOption(),this.initEventHandlers(),this.ateControls.init(),this.currentOptionIsATE()?(this.ateControls.visibility(!0),this.ateControls.updateControlsStatus()):this.ateControls.visibility(!1)}},{key:"updateSelectedOption",value:function(){var t=this;this.translationMethodForm&&(this.translationMethodOptions=this.translationMethodForm.querySelectorAll('[type="radio"][name="t_method"]'),Array.from(this.translationMethodOptions).map((function(e){e.checked&&(t.selectedOptionValue=e.value)})))}},{key:"currentOptionIsATE",value:function(){return"ATE"===this.selectedOptionValue}},{key:"initEventHandlers",value:function(){var t=this;if(this.translationMethodOptions)for(var e=0;e<this.translationMethodOptions.length;e++)this.translationMethodOptions[e].onchange=function(){t.updateSelectedOption(),t.ateControls.visibility(t.currentOptionIsATE()),t.ateControls.updateControlsStatus()}}}]),n}(y.a),b={registerClient:"/wpml/tm/v1/ams/register_manager",checkStatus:"/wpml/tm/v1/ams/status",synchronizeTranslators:"/wpml/tm/v1/ams/synchronize/translators",synchronizeManagers:"/wpml/tm/v1/ams/synchronize/managers",consoleURL:"/wpml/tm/v1/ams/console",engines:"/wpml/tm/v1/ams/engines"},k=function(){function t(e){u()(this,t),this.request=e}return c()(t,[{key:"registerClient",value:function(){return this.request.post(b.registerClient)}},{key:"checkStatus",value:function(){return this.request.get(b.checkStatus)}},{key:"synchronize",value:function(){var t=this;return this.request.get(b.synchronizeTranslators).then((function(){return t.request.get(b.synchronizeManagers)}))}},{key:"updateConsoleURL",value:function(){return this.request.get(b.consoleURL).then((function(t){return t}))}},{key:"getEngines",value:function(){return this.request.get(b.engines).then((function(t){return t}))}},{key:"updateEngines",value:function(t){return this.request.post(b.engines,t).then((function(t){return t}))}}]),t}(),E=n(67),C=n(3),w=n.n(C),O=n(7),_=n.n(O),T={nonActive:"non-active",enabled:"enabled",active:"active"},A=n(27),L=n.n(A),P=n(153),j=n(65),R=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preventReload,i=void 0!==n&&n;u()(this,t),this.preventReload=i,this.tools=new P.a}return c()(t,[{key:"clearCache",value:function(){this.ateControls=null,this.synchronizeWithAMS=null,this.status=null,this.errors=null,this.spinner=null}},{key:"initEventHandlers",value:function(){var t=this;this.getAteConsoleLink()&&(this.getAteConsoleLink().onclick=function(e){if(!t.preventReload)return window.location.reload(!0);t.tools.hide(e.currentTarget)})}},{key:"isStatusOnly",value:function(){return this.getAteControls()&&this.getAteControls().hasAttribute("data-status-only")}},{key:"getAteControls",value:function(){return this.ateControls||(this.ateControls=document.getElementById("ate-controls")),this.ateControls}},{key:"getStatus",value:function(){return this.getAteControls()&&!this.status&&(this.status=this.getAteControls().querySelector(".otgs-notice__status")),this.status}},{key:"getErrors",value:function(){return this.getAteControls()&&!this.errors&&(this.errors=this.getAteControls().querySelector(".otgs-notice__errors")),this.errors}},{key:"getSpinner",value:function(){return this.getAteControls()&&!this.spinner&&(this.spinner=this.getAteControls().querySelector(".spinner")),this.spinner}},{key:"getAteConsoleLink",value:function(){return this.getAteControls()?this.getAteControls().querySelector(".js-ate-console"):null}},{key:"updateAteConsoleLink",value:function(t){this.getAteConsoleLink()&&(this.getAteConsoleLink().href=t)}},{key:"showStatus",value:function(t){var e,n=t.status,i=t.statusTypes;this.getStatus()&&this.tools.show(this.getStatus()),this.getStatus().querySelector("p").innerHTML=this.getStatusHTML(n.message),(e=this.getStatus().classList).remove.apply(e,L()(i)),this.getStatus().classList.add(n.type)}},{key:"updateErrors",value:function(t){if(this.getErrors())if(t){var e="<strong>"+j.a("WPML's Advanced Translation Editor is not working","header",t)+"</strong>";e+="<br/>",e+="<p>"+j.a("","description",t),this.getErrors().querySelector(".message").innerHTML=e,this.showErrors()}else this.hideErrors()}},{key:"setControlsVisibility",value:function(t){t?this.showAteControls():this.hideAteControls()}},{key:"showAteControls",value:function(){this.getAteControls()&&this.tools.show(this.getAteControls()),this.updateActions()}},{key:"hideAteControls",value:function(){this.getAteControls()&&this.tools.hide(this.getAteControls())}},{key:"hideAteConsoleLink",value:function(){this.getAteConsoleLink()&&this.tools.hide(this.getAteConsoleLink())}},{key:"getStatusHTML",value:function(t){var e=t.status,n=t.text;return"<strong>".concat(e,"</strong> ").concat(n)}},{key:"hideStatus",value:function(){this.getStatus()&&this.tools.hide(this.getStatus())}},{key:"hideErrors",value:function(){this.getErrors()&&this.tools.hide(this.getErrors())}},{key:"showSpinner",value:function(){this.getSpinner()&&this.getSpinner().classList.add("is-active")}},{key:"hideSpinner",value:function(){this.getSpinner()&&this.getSpinner().classList.remove("is-active")}},{key:"showErrors",value:function(){this.getErrors()&&this.tools.show(this.getErrors())}},{key:"updateActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isStatusOnly()||t)&&(this.clearCache(),this.hideAteConsoleLink())}}]),t}();function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return p()(this,n)}}var q=function(t){f()(i,t);var e,n=M(i);function i(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=r.preventReload,a=void 0!==s&&s;return u()(this,i),(e=n.call(this)).visible=!1,e.ui=new R({preventReload:a}),e.amsAPI=t,e.statusTypes=Object.keys(e.ateSettings.statuses).map((function(t){return e.ateSettings.statuses[t].type})),e}return c()(i,[{key:"init",value:function(){this.initUI(),this.checkActivation(),this.initEventHandlers()}},{key:"initUI",value:function(){this.ui.hideStatus(),this.ui.hideErrors()}},{key:"show",value:function(){this.visibility(!0)}},{key:"hide",value:function(){this.visibility(!1)}},{key:"visibility",value:function(t){this.visible=t,this.ui.setControlsVisibility(t)}},{key:"updateControlsStatus",value:function(){this.visible&&(this.ATERequiresActivation()?this.enableATE():(this.ATEIsActive()&&this.initEventHandlers(),this.updateStatusMessage())),this.initEventHandlers()}},{key:"updateStatusMessage",value:function(){this.ateSettings.currentStatus!==T.active?(this.ui.showAteControls(),this.ui.showStatus({status:this.getStatus(),statusTypes:this.statusTypes})):this.ui.hideAteControls()}},{key:"getStatus",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===t&&(t=this.ateSettings.currentStatus),this.ateSettings.statuses[t]}},{key:"ATERequiresActivation",value:function(){return this.ateSettings.currentStatus===T.nonActive}},{key:"ATEIsActive",value:function(){return this.ateSettings.currentStatus===T.active}},{key:"initEventHandlers",value:function(){this.ui.initEventHandlers()}},{key:"checkActivation",value:function(){var t=this;this.ui.clearCache(),this.ateSettings.currentStatus===T.enabled?(this.ui.updateErrors(),this.ui.showSpinner(),this.amsAPI.checkStatus().then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{activated:!1},n=e.activated;n&&(t.ateSettings.currentStatus=T.active,t.handleSynchronize())})).finally((function(){t.updateControlsStatus(),t.ui.updateActions(!0),t.ui.hideSpinner()}))):this.updateControlsStatus()}},{key:"enableATE",value:function(t,e){var n=this;if(!this.enablingATE){this.enablingATE=!0;var i=!1;this.ui.clearCache(),this.ui.updateErrors(),this.ui.showSpinner(),this.visibility(!0),this.updateControlsStatus(),this.amsAPI.registerClient().then((function(t){if(!t.enabled)throw j.a([],"error",t);return t})).then((function(){n.ateSettings.currentStatus=T.enabled,n.checkActivation(),n.updateConsoleURL(),t&&t()})).catch((function(t){i=!0,n.ui.updateErrors(t),e&&e()})).finally((function(){n.ui.hideSpinner(),n.enablingATE=!1,i||(n.checkActivation(),n.ui.updateActions())}))}}},{key:"enableATEWithoutUI",value:(e=_()(w.a.mark((function t(){var e=this;return w.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.amsAPI.registerClient().then((function(t){return t.enabled&&(e.ateSettings.currentStatus=T.enabled),t})));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"updateConsoleURL",value:function(){var t=this;return this.amsAPI.updateConsoleURL().catch((function(e){t.ui.updateErrors(e)})).then((function(e){t.ui.updateAteConsoleLink(e)}))}},{key:"handleSynchronize",value:function(){return this.amsAPI.synchronize()}},{key:"isStatusOnly",value:function(){return this.ui.isStatusOnly()}}]),i}(y.a),I=n(393),N=n(78),U=n(154),x=n(1);function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return p()(this,n)}}var D=function(t){f()(n,t);var e=z(n);function n(){var t;return u()(this,n),(t=e.call(this)).translationMethodOptions=[],t.oldJobsMethodOptions=[],t.form=document.getElementById("icl_doc_translation_method"),t.form&&(t.translationMethodOptions=t.form.querySelectorAll('[type="radio"][name="t_method"]'),t.oldJobsCheckbox=t.form.querySelectorAll('[type="checkbox"][name="wpml-old-jobs-editor"]'),t.submitButton=t.form.querySelector(".button-primary"),t.initEventHandlers()),t}return c()(n,[{key:"initEventHandlers",value:function(){for(var t=this,e=0;e<this.translationMethodOptions.length;++e){var n=this.translationMethodOptions[e];this.oldJobsCheckbox[0].onclick=function(e){t.saveForm()},n.onclick=function(e){var n=e.currentTarget;t.saveForm(),Object(I.a)("editor-mode",n.value)}}Object(I.b)("auto-translation-method").then(Object(N.a)("automatic")).then(this.disableClassicEditor.bind(this))}},{key:"disableClassicEditor",value:function(t){this.translationMethodOptions.forEach((function(e){if("1"===e.value){e.disabled=t;var n=t?Object(x.a)("You must use the Advanced Translation Editor if you want to translate your content automatically.","sitepress"):"",i=e.parentNode;i.setAttribute("title",n),i._tippy||Object(U.a)(i,"otgs")}}))}},{key:"updateOldJobsMethods",value:function(t){for(var e=0;e<this.oldJobsMethodOptions.length;++e){var n=this.oldJobsMethodOptions[e];n.disabled="ATE"!==t,n.disabled&&(n.checked="ATE"!==n.value.toUpperCase())}}},{key:"saveForm",value:function(){this.submitButton&&this.submitButton.click()}}]),n}(y.a);function B(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return p()(this,n)}}var H=function(t){f()(n,t);var e=B(n);function n(){var t;return u()(this,n),(t=e.call(this)).options=[],t.form=document.getElementById("icl_doc_translation_method"),t.form&&(t.options=t.form.querySelectorAll('.wpml-old-jobs-editor [name="wpml-old-jobs-editor"]'),t.submitButton=t.form.querySelector(".button-primary"),t.submitButton&&t.initEventHandlers()),t}return c()(n,[{key:"initEventHandlers",value:function(){for(var t=this,e=0;e<this.options.length;++e){this.options[e].onclick=function(){return t.submitButton.click()}}}}]),n}(y.a),F=function(){function t(e,n){var i=n.minSearchLength,r=n.searchTimeOutValue;u()(this,t),this.minSearchLength=i,this.searchTimeOutValue=r,this.timeout=null,this.onUpdateRequired=null,this.tools=new P.a,this.filterContainer=e,this.initData()}return c()(t,[{key:"initData",value:function(){this.searchField=this.filterContainer.querySelector(".wpml_tm_search"),this.prevSearch=this.searchField.value,this.spinner=this.filterContainer.querySelector(".spinner")}},{key:"bindEvents",value:function(){var t=this;this.searchField.onkeydown=function(e){if(13!==e.keyCode)return!0;e.preventDefault(),t.getSearchText().length>=t.minSearchLength&&(clearTimeout(t.timeout),t.maybeDoSearch())},this.searchField.onkeyup=function(e){if(13===e.keyCode)return!1;t.updateSearch()}}},{key:"getSearchText",value:function(){return this.searchField.value.trim()}},{key:"updateSearch",value:function(){var t=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){t.maybeDoSearch()}),this.searchTimeOutValue)}},{key:"maybeDoSearch",value:function(){var t=this.getSearchText();this.mustUpdate(t)&&(this.prevSearch=t,this.updateFilter())}},{key:"mustUpdate",value:function(t){return(0===t.length||t.length>=this.minSearchLength)&&this.prevSearch!==t}},{key:"updateFilter",value:function(){this.tools.showSpinner(this.spinner),this.onUpdateRequired()}},{key:"onUpdated",value:function(){this.tools.hideSpinner(this.spinner),this.initData(),this.bindEvents()}}]),t}(),W=function(){function t(e,n){u()(this,t),this.default_page_size=n,this.onUpdateRequired=null,this.tools=new P.a,this.navigatorContainer=e,this.initData()}return c()(t,[{key:"initData",value:function(){this.pageSize=this.default_page_size,this.currentPage=1,this.pagesContainer=this.navigatorContainer.querySelector(".tablenav-pages"),this.pageNumbers=this.pagesContainer.querySelectorAll(".page-numbers"),this.displayLess=this.pagesContainer.querySelector(".display-less"),this.displayAll=this.pagesContainer.querySelector(".display-all"),this.next=this.pagesContainer.querySelector(".next"),this.previous=this.pagesContainer.querySelector(".prev"),this.spinner=this.navigatorContainer.querySelector(".spinner"),this.pageSizeSelect=this.navigatorContainer.querySelector('select[name="wpml_tm_per_page"]'),this.currentPageButton=this.navigatorContainer.querySelector(".current"),this.customFieldsType=this.navigatorContainer.dataset.type,this.pageSizeSelect&&this.setPageSize(this.pageSizeSelect.value),this.currentPageButton&&this.setCurrentPage(this.currentPageButton.innerText)}},{key:"bindEvents",value:function(){var t=this;if(this.previous&&(this.previous.onclick=function(e){return t.onPreviousClick(e)}),this.next&&(this.next.onclick=function(e){return t.onNextClick(e)}),this.displayAll&&(this.displayAll.onclick=function(e){return t.onDisplayAllClick(e)}),this.displayLess&&(this.displayLess.onclick=function(e){return t.onDisplayLessClick(e)}),this.pageNumbers)for(var e=0;e<this.pageNumbers.length;e++){var n=this.pageNumbers[e],i=n.classList;i.contains("dots")||i.contains("current")||i.contains("prev")||i.contains("next")||(n.onclick=function(e){e.preventDefault(),t.setCurrentPage(e.currentTarget.innerText),t.updateNavigator()})}this.pageSizeSelect&&(this.pageSizeSelect.onchange=function(){return t.onPageSizeChange()})}},{key:"onPreviousClick",value:function(t){t.preventDefault(),this.goToPrevious(),this.updateNavigator()}},{key:"onNextClick",value:function(t){t.preventDefault(),this.goToNext(),this.updateNavigator()}},{key:"onDisplayAllClick",value:function(t){t.preventDefault(),this.setCurrentPage(-1),this.updateNavigator()}},{key:"onDisplayLessClick",value:function(t){t.preventDefault(),this.setCurrentPage(1),this.setPageSize(this.default_page_size),this.updateNavigator()}},{key:"onPageSizeChange",value:function(){this.setPageSize(this.pageSizeSelect.value),this.updateNavigator()}},{key:"getCurrentPage",value:function(){return this.currentPage}},{key:"setCurrentPage",value:function(e){this.currentPage=t.getInt(e)}},{key:"goToPrevious",value:function(){this.currentPage--}},{key:"goToNext",value:function(){this.currentPage++}},{key:"getPageSize",value:function(){return this.pageSize}},{key:"setPageSize",value:function(e){this.pageSize=t.getInt(e)}},{key:"updateNavigator",value:function(){this.tools.showSpinner(this.spinner),this.onUpdateRequired()}},{key:"onUpdated",value:function(){this.tools.hideSpinner(this.spinner),this.initData(),this.bindEvents()}}],[{key:"getInt",value:function(t){return Number.isInteger(t)?t:parseInt(t.trim().replace(/\D+/g,""))}}]),t}(),V=function(){function t(e,n){var i=this;u()(this,t),this.DEFAULT_PAGE_SIZE=20,this.SCROLL_DURATION=1200,this.MIN_SEARCH_LENGTH=1,this.SEARCH_TIMEOUT_VALUE=500,this.form=e,this.tools=n,this.lastSearch="",this.initData(),this.customFieldsType=this.form.dataset.type,this.highestPageLoaded=1,document.addEventListener("icl-save-form-"+this.form.id,(function(){i.saveFormCallback()}))}return c()(t,[{key:"initData",value:function(){this.filterContainer=this.form.querySelector(".wpml_tm_search_container"),delete this.filter,this.filterContainer&&(this.filter=new F(this.filterContainer,{minSearchLength:this.MIN_SEARCH_LENGTH,searchTimeOutValue:this.SEARCH_TIMEOUT_VALUE})),this.navigatorContainer=this.form.querySelector(".wpml_tm_pagination_container"),delete this.navigator,this.navigatorContainer&&(this.navigator=new W(this.navigatorContainer,this.DEFAULT_PAGE_SIZE)),this.form&&(this.errors=this.form.querySelector(".otgs-notice__errors")),this.values=this.getValues()}},{key:"bindEvents",value:function(){var t=this;this.filter&&(this.filter.bindEvents(),this.filter.onUpdateRequired=function(){return t.updateCustomFields()}),this.navigator&&(this.navigator.bindEvents(),this.navigator.onUpdateRequired=function(){return t.updateCustomFields()}),wpmlCustomEvent("icl-bind-locks",{detail:this.form.id})}},{key:"getValues",value:function(){return{checked:L()(this.form.querySelectorAll('input[type="radio"]')).map((function(t){return t.checked})),locked:L()(this.form.querySelectorAll('input[name*="cf_unlocked"]')).map((function(t){return t.value}))}}},{key:"saveFormCallback",value:function(){this.values=this.getValues(),this.updateCustomFields()}},{key:"updateError",value:function(t){t?(this.errors.querySelector("p").innerHTML=t,this.tools.show(this.errors)):this.tools.hide(this.errors)}},{key:"updateCustomFields",value:function(){var t=this;if(JSON.stringify(this.values)===JSON.stringify(this.getValues())){var e=this.form.querySelector("#show_cf_meta_box"),n=this.filter.getSearchText(),i=this.navigator.getCurrentPage();n===this.lastSearch?this.highestPageLoaded=this.highestPageLoaded<i?i:this.highestPageLoaded:(i=1,this.highestPageLoaded=1);var r={action:"wpml_update_mcs_cf",type:this.customFieldsType,nonce:this.form.querySelector("#_icl_nonce").value,show_cf_meta_box:!!e&&e.checked,items_per_page:this.navigator.getPageSize(),search:n,paged:i,highest_page_loaded:this.highestPageLoaded,show_system_fields:Boolean(new URL(document.location).searchParams.get("show_system_fields"))},s=Object.keys(r).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(r[t])})).join("&");return this.updateError(),fetch(ajaxurl,{method:"POST",body:s,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},credentials:"same-origin"}).then((function(t){if(!t.ok)throw new Error(t.statusText);return t.json()})).then((function(e){if(!e.success)throw new Error(e.data.message);t.lastSearch=n,t.form.querySelector(".wpml-flex-table-body").innerHTML=e.data.body,t.navigatorContainer.outerHTML=e.data.pagination})).then((function(){t.initData(),t.bindEvents(),t.tools.scrollTo(t.form.parentElement,t.tools.SCROLL_TO_BOTTOM,t.SCROLL_DURATION),t.filter.onUpdated(),t.navigator.onUpdated()})).catch((function(e){return t.updateError(e),t.filter.onUpdated(),t.navigator.onUpdated(),e}))}this.form.querySelector('input[type="submit"]').click()}}]),t}(),G=n(9),J=n.n(G),Y=function(t){var e=t.ateControls,n=Object(i.useState)(""),s=J()(n,2),a=s[0],o=s[1],u=Object(i.useState)(!1),l=J()(u,2),c=l[0],h=l[1];return r.a.createElement("div",null,r.a.createElement("button",{disabled:c,className:"button-secondary",onClick:function(){return h(!0),void e.handleSynchronize().catch((function(t){return o(t)})).finally((function(){return h(!1)}))}},Object(x.a)("Synchronize translators and translation managers with ATE","sitepress"),c&&r.a.createElement("span",{className:"spinner",style:{visibility:"visible"}})),a&&r.a.createElement(Z,{message:a}))},Z=function(t){var e=t.message,n=Object(x.c)(Object(x.a)("Please try again in a few minutes. If the problem persists, please contact %sWPML support%s.","sitepress"),'<a target="_blank" rel="noopener" href="https://wpml.org/forums/forum/english-support/">',"</a>");return r.a.createElement("div",{className:"otgs-notice otgs-notice__errors error inline"},r.a.createElement("p",{className:"message"},e),r.a.createElement("p",{className:"help",dangerouslySetInnerHTML:{__html:sanitizeHtml(n,{allowedTags:["a"]})}}))},$=n(54),K=n(40),X=n(129),Q=n(161),tt=n(846),et=n(389),nt=n(532),it=(n(113),n(151),n(506)),rt=(n(76),n(150)),st=n(74),at=(n(53),n(92)),ot=(n(123),n(84)),ut=n(111),lt=(n(163),function(t){var e=t.hasCurrentData,n=t.visible,s=t.onCancel,a=t.onSend,o=t.title,u=t.content,l=t.yes,c=t.no,h=t.fetching,f=Object(i.useState)(!0),d=J()(f,2),p=d[0],v=d[1],m=function(t){var e=t.children;return h?r.a.createElement(it.a,null,e):e};return r.a.createElement(nt.a,{visible:n,onCancel:s,footer:null,closable:!1,width:600,className:"wpml-wizard__modal",closeIcon:r.a.createElement(ot.a,null)},r.a.createElement("h3",null,o),r.a.createElement(m,null,u,e&&r.a.createElement(rt.a,{className:"wpml-row-spacing"},r.a.createElement(st.a,null,r.a.createElement(ut.a,{checked:!p,onChange:function(){v(!1)},value:"automatic"},r.a.createElement("span",{dangerouslySetInnerHTML:{__html:Object(x.a)("Yes, translate <b>existing</b> and <b>future</b> content automatically","sitepress")}})))),r.a.createElement(rt.a,{className:"wpml-row-spacing"},r.a.createElement(st.a,null,r.a.createElement(ut.a,{checked:p,onChange:function(){v(!0)},value:"automaticOnlyNew"},r.a.createElement("span",{dangerouslySetInnerHTML:{__html:e?Object(x.a)("Yes, but only translate <b>future</b> content automatically","sitepress"):Object(x.a)("Yes, translate <b>future</b> content automatically","sitepress")}}))))),r.a.createElement(rt.a,{className:"ant-modal-body__footer"},r.a.createElement(st.a,{span:4},r.a.createElement(at.a,{className:"wpml-antd-button wpml-antd-button-secondary wpml-no-do-not-send",type:"Secondary",onClick:s},c)),r.a.createElement(st.a,{span:20,className:"text-right"},r.a.createElement(at.a,{className:"wpml-antd-button wpml-antd-button-primary wpml-yes-send-to-translation",type:"primary",onClick:function(){return a(p)},disabled:h},l))))}),ct=n(17),ht=n(114),ft=n(1311),dt=n(441);function pt(t,e){return(e=function(t){return Object(dt.a)(window.wpmlStore)||Object(dt.a)(window.wpmlStore[t])?null:window.wpmlStore[t]}(e))?e.getState()[t]:null}var vt=function(){return document.getElementById("wpml_post_type_save_legacy").click()},mt="undefined"!=typeof wpmlSettingsUI?wpmlSettingsUI.existingPostTypes:[],yt=Object($.a)(Object(K.a)("slug"),Object(X.a)(Q.a,mt),tt.a),gt=function(){return L()(document.querySelectorAll("#icl_custom_posts_sync_options input.js-custom-post-mode:checked")).filter((function(t){return"1"===t.value||"2"===t.value})).map(Object(K.a)("dataset")).filter(yt)},St=function(t){var e=t.postTypes;return r.a.createElement("strong",null,e.map(Object(K.a)("name")).reduce((function(t,e){return t+(t?", ":"")+e}),""))},bt=function(){var t=Object(i.useState)(!1),e=J()(t,2),n=e[0],s=e[1],a=function(t){var e=Object(i.useState)(!1),n=J()(e,2),r=n[0],s=n[1],a=Object(i.useState)(0),o=J()(a,2),u=o[0],l=o[1];return[r,u,function(){var e=_()(w.a.mark((function e(){var n,i,r,a,o,u=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>0&&void 0!==u[0]?u[0]:null,s(!0),e.next=4,Object(ct.a)(t,n?{postTypes:n}:{});case 4:i=e.sent,r=i.data,a=r.success,o=r.data,a&&o&&l(o),s(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()]}(wpmlSettingsUI.endpoints.getCount),o=J()(a,3),u=o[0],l=o[1],c=o[2],h=Object(i.useState)([]),f=J()(h,2),d=f[0],p=f[1],v=Object(ht.a)(wpmlSettingsUI.endpoints.setAutomatic),m=J()(v,2),y=m[0],g=m[1];Object(i.useEffect)((function(){n&&c(Object(et.a)("slug",d))}),[n]);var S=function(){s(!1),vt()},b=Object(x.a)("Please confirm this translation setting","sitepress"),k=l>0?Object(x.c)(Object(x.b)("Your site is set to translate all content automatically. When you make <PostTypesNames /> translatable, WPML will automatically translate the %1$d existing item.","Your site is set to translate all content automatically. When you make <PostTypesNames /> translatable, WPML will automatically translate the %1$d existing items.",parseInt(l),"sitepress"),l):Object(x.a)("Your site is set to translate all content automatically. When you make <PostTypesNames /> translatable, WPML will automatically translate all future content.","sitepress");k=Object(ft.a)(k,{PostTypesNames:r.a.createElement(St,{postTypes:d})});var E=Object(x.a)("Are you OK with paying for this?","sitepress"),C=Object(x.a)("Cancel","sitepress"),O=Object(x.a)("Make translatable","sitepress"),T=r.a.createElement("p",null,r.a.createElement("span",null,k),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("strong",null,E));return r.a.createElement(r.a.Fragment,null,r.a.createElement("button",{className:"button-primary wpml-button base-btn",onClick:function(t){t.preventDefault();var e=gt();e.length&&"automatic"===pt("method","translationMethod")?(p(e),s(!0)):vt()}},Object(x.a)("Save","sitepress")),r.a.createElement(lt,{hasCurrentData:l>0,visible:n,onCancel:function(){return s(!1)},title:b,content:T,onSend:function(t){var e=gt().map(Object(K.a)("slug"));g({postTypes:e,onlyNew:t},S)},fetching:u||y,no:C,yes:O}))};document.addEventListener("DOMContentLoaded",(function(){if("undefined"!=typeof wpmlSettingsUI){var t=document.getElementById("wpml_post_type_save");if(t&&a.a.render(r.a.createElement(bt,null),t),wpmlSettingsUI&&wpmlSettingsUI.isTMLoaded){var e=new E.a;new D,new H;var n=new k(e),i=new q(n);if(i.isStatusOnly())i.initEventHandlers();else new S(i).init();!function(t){var e=document.getElementById("synchronize-ate-ams");e&&a.a.render(r.a.createElement(Y,{ateControls:t}),e)}(i);var s=new P.a,o=document.querySelectorAll(".wpml-custom-fields-settings");Array.from(o).map((function(t){new V(t,s).bindEvents()}))}}}))},151:function(t,e,n){},153:function(t,e,n){"use strict";var i=n(14),r=n.n(i),s=n(16),a=n.n(s),o=function(){function t(){r()(this,t),this.SCROLL_TO_TOP=1,this.SCROLL_TO_BOTTOM=2}return a()(t,[{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(t.style.display=null),t.classList.remove("hidden")}},{key:"hide",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(t.style.display="none"),t.classList.add("hidden")}},{key:"showSpinner",value:function(t){t.classList.add("is-active")}},{key:"hideSpinner",value:function(t){t.classList.remove("is-active")}},{key:"enableElement",value:function(t){t.classList.remove("disabled")}},{key:"disableElement",value:function(t){t.classList.add("disabled")}},{key:"scrollTo",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.SCROLL_TO_TOP,i=arguments.length>2?arguments[2]:void 0,r=t.getBoundingClientRect();e=this.SCROLL_TO_BOTTOM===n?window.scrollY-window.innerHeight+r.top+r.height:window.scrollY+r.top;var s=document.scrollingElement||document.documentElement,a=s.scrollTop,o=e-a,u=+new Date,l=function(t,e,n,i){return(t/=i/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},c=function t(){var n=+new Date-u;s.scrollTop=parseInt(l(n,a,o,i)),n<i?requestAnimationFrame(t):s.scrollTop=e};c()}}]),t}();e.a=o},154:function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var i=n(509),r=n.n(i),s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wpml",n="rtl"===document.getElementsByTagName("html")[0].dir,i={arrow:!0,theme:e,animation:"fade",sticky:!0,interactive:!0,dynamicTitle:!0,placement:n?"top-end":"top-start"};r()(t,i)};e.a=s;var a=function(t,e){var n=t._tippy;n&&n.destroy(),t.setAttribute("title",e),s(t,"otgs")}},163:function(t,e,n){},393:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return c}));var i=n(27),r=n.n(i),s=n(452),a=n(451),o=n(54),u=Object(s.a)("WPML-"),l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};document.dispatchEvent(new CustomEvent(u(t),{detail:e}))},c=function(t){var e=[],n={then:function(t){return e=Object(a.a)(t,e),this}};return document.addEventListener(u(t),(function(t){o.a.apply(void 0,r()(e))(t.detail)})),n}},53:function(t,e,n){},67:function(t,e,n){"use strict";var i=n(3),r=n.n(i),s=n(7),a=n.n(s),o=n(14),u=n.n(o),l=n(16),c=n.n(l),h=n(35),f=n.n(h),d=n(42),p=n.n(d),v=n(34),m=n.n(v),y=n(68),g=n(71);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return p()(this,n)}}Object(g.a)();var b=function(t){f()(i,t);var e,n=S(i);function i(){return u()(this,i),n.apply(this,arguments)}return c()(i,[{key:"get",value:function(t){return this.request(t,"GET")}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.request(t,"POST",e)}},{key:"download",value:(e=a()(r.a.mark((function t(e){var n=this;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",fetch(e,this.generateArgs("GET")).then((function(t){return t.ok?t.blob():n.buildError(t)})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"request",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.generateArgs(e,n);return this.restUrl.includes("?")&&(t=t.replace("?","&")),this.handleRequest(this.restUrl+t,i)}},{key:"handleRequest",value:function(t,e){var n=this;return fetch(t,e).then((function(t){return t.ok?t.json():n.buildError(t)}))}},{key:"generateArgs",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n={method:t.toUpperCase(),headers:{Accept:"application/json","Content-Type":"application/json","X-WP-Nonce":this.restNonce},credentials:"same-origin"};return"GET"!==n.method&&e&&(n.body="string"==typeof e?e:JSON.stringify(e)),n}},{key:"buildError",value:function(t){return t.json().then((function(e){var n=new Error(e.message||t.statusText);return Promise.reject(Object.assign(n,{response:t}))}))}}]),i}(y.a);e.a=b},68:function(t,e,n){"use strict";var i=n(14),r=n.n(i),s=function t(e){r()(this,t),this.ID=e.ID,this.caps=e.caps,this.roles=e.roles,this.user_email=e.data,this.user_login=e.data.user_email,this.user_nicename=e.data.user_login};e.a=function t(){r()(this,t),this.restUrl=WPML_TM_SETTINGS.restUrl,this.restNonce=WPML_TM_SETTINGS.restNonce,this.ateSettings=WPML_TM_SETTINGS.ate,this.currentUser=new s(WPML_TM_SETTINGS.currentUser)}},76:function(t,e,n){},84:function(t,e,n){"use strict";var i=n(0);function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var s=i.createElement("path",{d:"M11.778 13.743l1.965-1.965a.871.871 0 000-1.235L10.2 7l3.543-3.543a.871.871 0 000-1.235L11.778.257a.871.871 0 00-1.235 0L7 3.8 3.457.257a.871.871 0 00-1.235 0L.257 2.222a.871.871 0 000 1.235L3.8 7 .257 10.543a.871.871 0 000 1.235l1.965 1.965a.871.871 0 001.235 0L7 10.2l3.543 3.543a.878.878 0 001.235 0z",fill:"#555"});e.a=function(t){return i.createElement("svg",r({width:14,height:14,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),s)}}});