(()=>{function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var n,e,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.toStringTag||"@@toStringTag";function u(t,o,a,i){var u=o&&o.prototype instanceof f?o:f,l=Object.create(u.prototype);return r(l,"_invoke",function(t,r,o){var a,i,u,f=0,l=o||[],s=!1,p={p:0,n:0,v:n,a:v,f:v.bind(n,4),d:function(t,r){return a=t,i=0,u=n,p.n=r,c}};function v(t,r){for(i=t,u=r,e=0;!s&&f&&!o&&e<l.length;e++){var o,a=l[e],v=p.p,y=a[2];t>3?(o=y===r)&&(u=a[(i=a[4])?5:(i=3,3)],a[4]=a[5]=n):a[0]<=v&&((o=t<2&&v<a[1])?(i=0,p.v=r,p.n=a[1]):v<y&&(o=t<3||a[0]>r||r>y)&&(a[4]=t,a[5]=r,p.n=y,i=0))}if(o||t>1)return c;throw s=!0,r}return function(o,l,y){if(f>1)throw TypeError("Generator is already running");for(s&&1===l&&v(l,y),i=l,u=y;(e=i<2?n:u)||!s;){a||(i?i<3?(i>1&&(p.n=-1),v(i,u)):p.n=u:p.v=u);try{if(f=2,a){if(i||(o="next"),e=a[o]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,i<2&&(i=0)}else 1===i&&(e=a.return)&&e.call(a),i<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),i=1);a=n}else if((e=(s=p.n<0)?u:t.call(r,p))!==c)break}catch(t){a=n,i=1,u=t}finally{f=1}}return{value:e,done:s}}}(t,a,i),!0),l}var c={};function f(){}function l(){}function s(){}e=Object.getPrototypeOf;var p=[][a]?e(e([][a]())):(r(e={},a,function(){return this}),e),v=s.prototype=f.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,r(t,i,"GeneratorFunction")),t.prototype=Object.create(v),t}return l.prototype=s,r(v,"constructor",s),r(s,"constructor",l),l.displayName="GeneratorFunction",r(s,i,"GeneratorFunction"),r(v),r(v,i,"Generator"),r(v,a,function(){return this}),r(v,"toString",function(){return"[object Generator]"}),(t=function(){return{w:u,m:y}})()}function r(t,n,e,o){var a=Object.defineProperty;try{a({},"",{})}catch(t){a=0}r=function(t,n,e,o){function i(n,e){r(t,n,function(t){return this._invoke(n,e,t)})}n?a?a(t,n,{value:e,enumerable:!o,configurable:!o,writable:!o}):t[n]=e:(i("next",0),i("throw",1),i("return",2))},r(t,n,e,o)}function n(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var o=0,a=function(){};return{s:a,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:a}}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,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,i=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw i}}}}function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=Array(r);n<r;n++)e[n]=t[n];return e}function o(t,r,n,e,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void n(t)}u.done?r(c):Promise.resolve(c).then(e,o)}$(function(){$(document).on("submit",'[data-bb-toggle="import-available-data"]',function(){var r,e=(r=t().m(function r(e){var o,a,i,u,c,f,l,s,p,v,y,b;return t().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e.preventDefault(),o=$(e.currentTarget),(a=o.find("select").val())&&0!==a.length){t.n=1;break}return Botble.showError(o.data("empty-selection-message")),t.a(2);case 1:i=n(a),t.p=2,i.s();case 3:if((u=i.n()).done){t.n=9;break}return c=u.value,f=c===a[a.length-1],t.p=4,(l=new FormData).append("country_code",c),l.append("continue",f?0:1),t.n=5,$httpClient.make().withButtonLoading(o.find("button[type=submit]")).post(o.prop("action"),l);case 5:if(s=t.v,p=s.error,v=s.data,!p){t.n=6;break}return Botble.showError(v.message),t.a(2);case 6:f&&(Botble.showSuccess(v.message),o.find("select").val("").trigger("change")),t.n=8;break;case 7:t.p=7,y=t.v,Botble.showError(y.message);case 8:t.n=3;break;case 9:t.n=11;break;case 10:t.p=10,b=t.v,i.e(b);case 11:return t.p=11,i.f(),t.f(11);case 12:return t.a(2)}},r,null,[[4,7],[2,10,11,12]])}),function(){var t=this,n=arguments;return new Promise(function(e,a){var i=r.apply(t,n);function u(t){o(i,e,a,u,c,"next",t)}function c(t){o(i,e,a,u,c,"throw",t)}u(void 0)})});return function(t){return e.apply(this,arguments)}}())})})();