!function(t){function e(e){for(var r,a,s=e[0],u=e[1],l=e[2],d=0,p=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);for(c&&c(e);p.length;)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,s=1;s<n.length;s++){var u=n[s];0!==o[u]&&(r=!1)}r&&(i.splice(e--,1),t=a(a.s=n[0]))}return t}var r={},o={16:0},i=[];function a(e){if(r[e])return r[e].exports;var n=r[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=r,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 r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));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 s=window.webpackWPML=window.webpackWPML||[],u=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var c=u;i.push([1297,0]),n()}({1297:function(t,e,n){"use strict";n.r(e);var r=n(14),o=n.n(r),i=n(16),a=n.n(i),s=function(){function t(e){o()(this,t),this.ajaxUrl=e,this.migrationTrigger=document.querySelector(".wpml-start-jobs-migration"),this.results=document.querySelector(".wpml-js-jobs-migration-progress"),this.jobsMigrated=document.querySelector(".wpml-js-migrated-jobs"),this.jobsMigratedCount=0,this.totalJobs=document.querySelector(".wpml-js-total-jobs"),this.totalJobsCount=0,this.spinner=document.querySelector(".wpml-jobs-migration-spinner"),this.nonce=document.querySelector("#wpml_translation_jobs_migration").value}return a()(t,[{key:"attachEvents",value:function(){var t=this;this.migrationTrigger.addEventListener("click",(function(){return t.run()}))}},{key:"run",value:function(){this.migrationTrigger.disabled=!0,this.spinner.classList.add("is-active"),this.migrate()}},{key:"migrate",value:function(){var t=this;fetch(this.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=wpml_translation_jobs_migration&nonce=".concat(this.nonce),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(e){if(!e.success)throw e;t.results.style.display="block",t.jobsMigratedCount+=e.data.jobsMigrated,t.updateResults(t.jobsMigratedCount),t.totalJobsCount||(t.totalJobsCount=e.data.totalJobs,t.totalJobs.innerHTML=t.totalJobsCount),e.data.done?location.reload():t.migrate()})).catch((function(t){var e=document.querySelector(".wpml-job-migration-error");e&&(t.data&&(e.querySelector(".error-message").textContent=t.data),e.style.display="block")}))}},{key:"updateResults",value:function(t){this.jobsMigrated.innerHTML=t}}]),t}();document.addEventListener("DOMContentLoaded",(function(){return new s(ajaxurl).attachEvents()}))}});