!function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};t.m=n;t.c=i;t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})};t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})};t.t=function(n,i){var r,u;if((1&i&&(n=t(n)),8&i)||4&i&&"object"==typeof n&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&i&&"string"!=typeof n)for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r};t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i};t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)};t.p="";t(t.s=0)}([function(n,t,i){var r=[];r.push(i(1));r.push(i(2));r.push(i(3));window.Frontiers=window.Frontiers||{};Frontiers.Ugarit=Frontiers.Ugarit||{};i(4);i(8);i(9);i(10);i(11);i(12);i(13);i(14);i(15);$(document).ready(function(){r.forEach(function(n){$("body").append(n)})})},function(n){n.exports=' <script id=common-organization-template type=text/html> <div class="common-organization-form" data-test-id="common-organization-component">\r\n\r\n        <label id="title" data-test-id="common-organization-title"><\/label>\r\n\r\n        <div class="add-affiliation-dropdown">\r\n            <select id="name" data-test-id="common-organization-select-name" tabindex="1"><\/select>\r\n            <input type="text" id="city" data-test-id="common-organization-input-city" tabindex="2" />\r\n            <select id="country" data-test-id="common-organization-select-country" tabindex="3"><\/select>\r\n            <div class="cb"><\/div>\r\n            <button type="button" id="cancel" class="btn-cancel" data-test-id="common-organization-cancel-btn" tabindex="5">\r\n                Cancel\r\n            <\/button>\r\n            <button type="button" id="save" class="btn-save" data-test-id="common-organization-save-btn" tabindex="4">\r\n                Save\r\n            <\/button>            \r\n        <\/div>\r\n    <\/div> <\/script> <script id=common-organization-error-template type=text/html> <div class="form-validator-error" data-test-id="common-organization-form-validation-error">\r\n        <span><\/span>\r\n    <\/div> <\/script> '},function(n){n.exports=' <script id=create-organization-template type=text/html> <div class="create-organization-form" data-test-id="create-organization-component">        \r\n        <label id="title" data-test-id="create-organization-title"><\/label>\r\n        <div class="add-affiliation-dropdown">\r\n                <input type="text" id="name" data-test-id="create-organization-input-name" tabindex="1" />\r\n                <input type="text" id="city" data-test-id="create-organization-input-city" tabindex="2" />                \r\n                <select id="country" data-test-id="create-organization-select-country" tabindex="3"><\/select>\r\n                <div class="cb"><\/div>                \r\n                <button type="button" id="cancel" class="btn-cancel" data-test-id="create-organization-cancel-btn" tabindex="5">\r\n                    Cancel\r\n                <\/button>\r\n                <button type="button" id="save" class="btn-save" data-test-id="create-organization-save-btn" tabindex="4">\r\n                    Save\r\n                <\/button>\r\n                <div id="api-error" data-test-id="create-organization-api-error" class="form-validator-warning">\r\n                    <span><\/span>\r\n                <\/div>\r\n        <\/div>\r\n    <\/div> <\/script> <script id=create-organization-error-template type=text/html> <div class="form-validator-error" data-test-id="create-organization-form-validation-error">\r\n        <span><\/span>\r\n    <\/div> <\/script> '},function(n){n.exports=' <script id=default-suggestion-plugin-template type=text/html> <div class="organization-dropdown" data-test-id="affiliation-dropdown">\r\n        <div class="info" data-test-id="affiliation-dropdown-tip">Please, type at least 3 characters to search.<\/div>        \r\n        <div class="error-container" data-test-id="affiliation-dropdown-error">\r\n            <div class="form-validator-warning">Something went wrong. Please type again.<\/div>\r\n        <\/div>        \r\n        <div class="spinner-container" data-test-id="affiliation-dropdown-spinner"><div class="spin"><\/div><\/div>        \r\n        \r\n        <ul class="other-options-container" data-test-id="no-affiliation-list"><\/ul>        \r\n        \r\n        <div data-test-id="affiliation-dropdown-suggestions">\r\n            <ul class="suggestion-container"><\/ul>\r\n            <div class="cb"><\/div>\r\n        <\/div>\r\n\r\n        <div class="no-result" data-test-id="affiliation-dropdown-empty-case">\r\n            Can\'t find your affiliation?\r\n            <div class="cb"><\/div>\r\n            <span class="create-organization link" data-test-id="affiliation-dropdown-empty-case-link"><\/span>\r\n            <span class="separator"> | <\/span>\r\n            <span class="common-organization link" data-test-id="affiliation-dropdown-select-option-link">No current affiliation<\/span>\r\n            <div class="cb"><\/div>\r\n        <\/div>\r\n        <div class="cb"><\/div>\r\n    <\/div> <\/script> <script id=default-suggestion-list-item-template type=text/html> <li>\r\n        <div class="data">\r\n            <div class="organization-name">${name}<\/div>\r\n            <div class="cb"><\/div>\r\n            <div class="organization-location">${location}<\/div>\r\n        <\/div>\r\n    <\/li> <\/script> <script id=default-other-list-item-template type=text/html> <li>\r\n        <div class="data">\r\n            <div class="organization-name">${name}<\/div>\r\n        <\/div>\r\n    <\/li> <\/script> <script id=erase-input-template type=text/html> <div class="erase-container" data-test-id="affiliation-erase-affiliation">\r\n        <i class="erase"><\/i>\r\n    <\/div> <\/script> '},function(n,t,i){var r=i(5);"string"==typeof r&&(r=[[n.i,r,""]]);i(7)(r,{});r.locals&&(n.exports=r.locals)},function(n,t,i){(n.exports=i(6)()).push([n.i,'.plugin-organization{position:relative;width:100%}@-webkit-keyframes rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(3turn);transform:rotate(3turn)}}@keyframes rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(3turn);transform:rotate(3turn)}}.plugin-organization input{padding:0 26px 0 6px;width:100%;box-sizing:border-box;min-height:25px}.plugin-organization input::-ms-clear{display:none}.plugin-organization .cb{clear:both}.plugin-organization .erase-container{width:16px;height:16px;position:absolute;top:calc(50% - 8px);right:4px;cursor:pointer}.plugin-organization .erase-container:hover .erase{opacity:1;-webkit-transform:rotate(-45deg) scale(1.1);transform:rotate(-45deg) scale(1.1);transition:all .5s cubic-bezier(.37,.74,.15,1.5)}.plugin-organization .erase-container .erase{position:absolute;width:16px;height:16px;top:0;right:0;-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:.7;transition:all .3s cubic-bezier(.37,.74,.15,1)}.plugin-organization .erase-container .erase:before{content:"";width:16px;height:2px;background:#000;position:absolute;top:7px;left:0;border-radius:1px}.plugin-organization .erase-container .erase:after{content:"";width:2px;height:16px;background:#000;position:absolute;top:0;left:7px;border-radius:1px}.plugin-organization .organization-dropdown{position:absolute;width:calc(100% - 38px);background:#fff;top:0;left:0;z-index:1}.plugin-organization .organization-dropdown .info{font-size:12px;border:1px solid #e0e0e0;border-top:none;background:#fff;padding-left:5px;height:47px;line-height:47px;position:relative}.plugin-organization .organization-dropdown .error-container{width:100%;height:47px;position:relative;float:left;border:1px solid #e0e0e0;border-top:none;box-sizing:border-box;color:#d40028;background:#fff}.plugin-organization .organization-dropdown .error-container .form-validator-warning{margin:15px 0 0 10px}.plugin-organization .organization-dropdown .error-container .btn-retry{width:62px;height:26px;border-radius:13px;font-size:12px;line-height:26px;margin:0;position:absolute;top:10px;right:10px;color:#fff;background-image:none}.plugin-organization .organization-dropdown .spinner-container{width:100%;height:47px;position:relative;float:left;border:1px solid #e0e0e0;border-top:none;box-sizing:border-box;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.12)}.plugin-organization .organization-dropdown .spinner-container .spin{top:50%;left:50%;margin-top:-10px;margin-left:-10px;position:absolute;width:20px;height:20px;border-radius:50%;background:#dadada;z-index:0;-webkit-animation:rotate 2s linear infinite backwards;animation:rotate 2s linear infinite backwards}.plugin-organization .organization-dropdown .spinner-container .spin:after{content:"";position:absolute;background:#fff;height:16px;width:16px;top:2px;left:2px;border-radius:50%;z-index:1}.plugin-organization .organization-dropdown .spinner-container .spin:before{content:"";position:absolute;background:#fff;width:10px;height:20px;top:0;right:0;z-index:2}.plugin-organization .organization-dropdown .other-options-container,.plugin-organization .organization-dropdown .suggestion-container{padding:0;margin:0;float:left;background:#fff;border-left:1px solid #e0e0e0;border-right:1px solid #e0e0e0;border-bottom:1px solid #e0e0e0;max-height:235px;overflow-x:none;overflow-y:auto;z-index:10;position:relative;width:100%}.plugin-organization .organization-dropdown .other-options-container::-webkit-scrollbar,.plugin-organization .organization-dropdown .suggestion-container::-webkit-scrollbar{background:#f1f1f1;-webkit-appearance:none;width:7px}.plugin-organization .organization-dropdown .other-options-container::-webkit-scrollbar-thumb,.plugin-organization .organization-dropdown .suggestion-container::-webkit-scrollbar-thumb{border-radius:4px;background-color:rgba(0,0,0,.5);-webkit-box-shadow:0 0 1px hsla(0,0%,100%,.5)}.plugin-organization .organization-dropdown .other-options-container li,.plugin-organization .organization-dropdown .suggestion-container li{width:100%;list-style:none;border-bottom:1px solid #e0e0e0;float:left;cursor:pointer}.plugin-organization .organization-dropdown .other-options-container li:last-child,.plugin-organization .organization-dropdown .suggestion-container li:last-child{border-bottom:none}.plugin-organization .organization-dropdown .other-options-container li.preselected,.plugin-organization .organization-dropdown .other-options-container li:hover,.plugin-organization .organization-dropdown .suggestion-container li.preselected,.plugin-organization .organization-dropdown .suggestion-container li:hover{background:#eee;color:#000}.plugin-organization .organization-dropdown .other-options-container li .data,.plugin-organization .organization-dropdown .suggestion-container li .data{width:100%;float:left;font-size:12px;line-height:18px}.plugin-organization .organization-dropdown .other-options-container li .data .organization-name,.plugin-organization .organization-dropdown .suggestion-container li .data .organization-name{font-weight:600;padding-left:5px;padding-top:5px}.plugin-organization .organization-dropdown .other-options-container li .data .organization-location,.plugin-organization .organization-dropdown .suggestion-container li .data .organization-location{color:#999;padding-left:5px;padding-bottom:5px}.plugin-organization .organization-dropdown .other-options-container .organization-name{padding-bottom:5px}.plugin-organization .organization-dropdown .no-result{border:1px solid #e0e0e0;border-top:none;background:#fff;padding:5px;font-size:12px;line-height:18px;font-weight:600;z-index:9;position:relative}.plugin-organization .organization-dropdown .no-result .link{color:#f29400;transition:all .1s ease-in-out;cursor:pointer}.plugin-organization .organization-dropdown .no-result .link:hover{color:#bababa}.plugin-organization .organization-dropdown .no-result .add-btn{border:1px solid #e0e0e0;background:#fff;padding:3px 5px;display:block;float:left;margin-top:5px;cursor:pointer;transition:all .1s ease-in-out}.plugin-organization .organization-dropdown .no-result .add-btn:hover{background:#e0e0e0;color:#000}.plugin-organization .create-organization-form{padding:15px;position:relative;border:1px solid #e0e0e0}.plugin-organization .create-organization-form input,.plugin-organization .create-organization-form select{padding:0 6px;width:100%;box-sizing:border-box;min-height:25px;margin-top:10px;margin-bottom:4px}.plugin-organization .create-organization-form .form-validator-error{color:#d40028}.plugin-organization .create-organization-form .form-validator-warning{color:#d40028;margin:10px 0 0 5px}.plugin-organization .create-organization-form .btn-save{float:right}.plugin-organization .common-organization-form{padding:15px;position:relative;border:1px solid #e0e0e0}.plugin-organization .common-organization-form input,.plugin-organization .common-organization-form select{padding:0 6px;width:100%;box-sizing:border-box;min-height:25px;margin-top:10px;margin-bottom:4px}.plugin-organization .common-organization-form .form-validator-error{color:#d40028}.plugin-organization .common-organization-form .form-validator-warning{color:#d40028;margin:10px 0 0 5px}.plugin-organization .common-organization-form .btn-save{float:right}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu-item{margin:0;padding:0;cursor:pointer;overflow:hidden}.ui-menu-item a{padding:4px 6px}.ui-menu-item:hover,.ui-state-hover{background:#f1f1f1;transition:all .1s ease-in-out;cursor:pointer}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333;width:100%;display:block}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:700}',""])},function(n){n.exports=function(){var n=[];return n.toString=function(){for(var n,t=[],i=0;i<this.length;i++)n=this[i],n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1]);return t.join("")},n.i=function(t,i){var f,r,e,u;for("string"==typeof t&&(t=[[null,t,""]]),f={},r=0;r<this.length;r++)e=this[r][0],"number"==typeof e&&(f[e]=!0);for(r=0;r<t.length;r++)u=t[r],"number"==typeof u[0]&&f[u[0]]||(i&&!u[2]?u[2]=i:i&&(u[2]="("+u[2]+") and ("+i+")"),n.push(u))},n}},function(n){function e(n,t){for(var u,f,r,o,e=0;e<n.length;e++)if(u=n[e],f=i[u.id],f){for(f.refs++,r=0;r<f.parts.length;r++)f.parts[r](u.parts[r]);for(;r<u.parts.length;r++)f.parts.push(l(u.parts[r],t))}else{for(o=[],r=0;r<u.parts.length;r++)o.push(l(u.parts[r],t));i[u.id]={id:u.id,refs:1,parts:o}}}function o(n){for(var f=[],r={},u=0;u<n.length;u++){var t=n[u],i=t[0],e={css:t[1],media:t[2],sourceMap:t[3]};r[i]?r[i].parts.push(e):f.push(r[i]={id:i,parts:[e]})}return f}function s(n,i){var r=p(),u=t[t.length-1];if("top"===n.insertAt)u?u.nextSibling?r.insertBefore(i,u.nextSibling):r.appendChild(i):r.insertBefore(i,r.firstChild),t.push(i);else{if("bottom"!==n.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");r.appendChild(i)}}function h(n){n.parentNode.removeChild(n);var i=t.indexOf(n);i>=0&&t.splice(i,1)}function c(n){var t=document.createElement("style");return t.type="text/css",s(n,t),t}function l(n,t){var i,r,u,e;return t.singleton?(e=w++,i=f||(f=c(t)),r=v.bind(null,i,e,!1),u=v.bind(null,i,e,!0)):n.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=function(n){var t=document.createElement("link");return t.rel="stylesheet",s(n,t),t}(t),r=k.bind(null,i),u=function(){h(i);i.href&&URL.revokeObjectURL(i.href)}):(i=c(t),r=b.bind(null,i),u=function(){h(i)}),r(n),function(t){if(t){if(t.css===n.css&&t.media===n.media&&t.sourceMap===n.sourceMap)return;r(n=t)}else u()}}function v(n,t,i,r){var e=i?"":r.css,f,u;n.styleSheet?n.styleSheet.cssText=a(t,e):(f=document.createTextNode(e),u=n.childNodes,u[t]&&n.removeChild(u[t]),u.length?n.insertBefore(f,u[t]):n.appendChild(f))}function b(n,t){var i=t.css,r=t.media;if(r&&n.setAttribute("media",r),n.styleSheet)n.styleSheet.cssText=i;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(i))}}function k(n,t){var r=t.css,u=t.sourceMap,f,i;u&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(u))))+" */");f=new Blob([r],{type:"text/css"});i=n.href;n.href=URL.createObjectURL(f);i&&URL.revokeObjectURL(i)}var i={},u=function(n){var t;return function(){return void 0===t&&(t=n.apply(this,arguments)),t}},y=u(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),p=u(function(){return document.head||document.getElementsByTagName("head")[0]}),f=null,w=0,t=[],r,a;n.exports=function(n,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");void 0===(t=t||{}).singleton&&(t.singleton=y());void 0===t.insertAt&&(t.insertAt="bottom");var r=o(n);return e(r,t),function(n){for(var c,f,h,s=[],u=0;u<r.length;u++)c=r[u],(f=i[c.id]).refs--,s.push(f);for(n&&e(o(n),t),u=0;u<s.length;u++)if(0===(f=s[u]).refs){for(h=0;h<f.parts.length;h++)f.parts[h]();delete i[f.id]}}};a=(r=[],function(n,t){return r[n]=t,r.filter(Boolean).join("\n")})},function(){Frontiers.Ugarit.Constants=Frontiers.Ugarit.Constants||{};Frontiers.Ugarit.Constants.Endpoints={ElasticSuggestion:function(n,t){var i="ugarit/v1/organizations/elasticSuggestions?query="+n;return null!==t&&(i+="&maxCount="+t),Frontiers.Ugarit.Common.Configuration.OrganizationsApiBaseUrl()+i},CreateOrganizationBasic:function(){return Frontiers.Ugarit.Common.Configuration.OrganizationsApiBaseUrl()+"ugarit/v1/organizations/addBasic"},Countries:function(){return Frontiers.Ugarit.Common.Configuration.OrganizationsApiBaseUrl()+"ugarit/v1/countries"},CommonOrganizations:function(){return Frontiers.Ugarit.Common.Configuration.OrganizationsApiBaseUrl()+"ugarit/v1/commonOrganizations"}};Frontiers.Ugarit.Constants.UIMessages={requiredWithMinLength:function(n){return"Please fill in this field (min. "+n+" characters)."},limitExceded:function(n){return"The field has exceeded the "+n+" character limit."},required:"Please fill in this field.",suggestionRequired:"Please select a valid country from the suggestions.",organizationAlreadyExists:"This organization already exists. Please, select it from the suggestions list.",genericErrorSaving:"Sorry, something went wrong and your changes could not be saved. Please try again.",genericApiErrorMessage:"Something went wrong. Please type again."};Frontiers.Ugarit.Constants.OrganizationTypes={VALIDATED:"validated",COMMON:"common",NEW:"new"}},function(){Frontiers.Ugarit.Common=Frontiers.Ugarit.Common||{};Frontiers.Ugarit.Common.Ajax=function(){function t(n,t){var i,u=!0;return $("html").hasClass("ie9")&&(u=!1),i={type:n.verb,url:n.endpoint,async:t,timeout:n.timeout,tryCount:0,retryLimit:3,crossDomain:u,dataType:"json",contentType:"application/json; charset=utf-8",cache:!r,data:n.inputData,success:function(t){"function"==typeof n.successCallback&&n.successCallback(t)},error:function(t,i,r){this.tryCount+=1;0===t.status&&"timeout"===t.statusText&&this.tryCount<=this.retryLimit-1&&"GET"===n.verb?$.ajax(this):n.errorCallback(t.status,i,r)}},t&&(i.xhrFields={withCredentials:n.withCredentials}),$.ajax(i)}function i(n,t){var r=[],i=[];if(n.endpoint||r.push("endpoint"),n.verb||(n.verb=t),n.withCredentials||(n.withCredentials=!1),r.length>0)throw new Error("Missing required fields: "+r.join(","));if("string"!=typeof n.endpoint&&i.push("endpoint"),"string"!=typeof n.verb&&i.push("verb"),"boolean"!=typeof n.withCredentials&&i.push("withCredentials"),i.length>0)throw new Error("Wrong field types: "+i.join(","));isNaN(n.timeout)&&(n.timeout=15e3)}$.support.cors=!0;var r=!0,n={endpoint:null,verb:null,inputData:null,timeout:15e3,successCallback:null,errorCallback:null};return{forceNoCache:function(n){r=n},loadData:function(r){return i(r=jQuery.extend(!0,{},n,r),"GET"),t(r,!0)},updateData:function(r){i(r=jQuery.extend(!0,{},n,r),"PUT");t(r,!0)},createData:function(r){i(r=jQuery.extend(!0,{},n,r),"POST");t(r,!0)},deleteData:function(r){return i(r=jQuery.extend(!0,{},n,r),"DELETE"),t(r,"DELETE")}}}()},function(){Frontiers.Ugarit.Common=Frontiers.Ugarit.Common||{};Frontiers.Ugarit.Common.Configuration=function(){function h(n,t){var i,r=(i=n,jQuery.extend([],i));return r.unshift(t),r}function n(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function o(){i=[];Frontiers.Ugarit.Common.Ajax.loadData({endpoint:Frontiers.Ugarit.Constants.Endpoints.Countries(),successCallback:function(n){n.sort(function(n,t){return n.name===t.name?0:n.name>t.name?1:-1});i=n},errorCallback:function(n,t){var r=[{id:1678561444,name:"Afghanistan",isoCode:"AFG",isoCodeAlpha2:"AF"},{id:1553494541,name:"Åland Islands",isoCode:"ALA",isoCodeAlpha2:"AX"},{id:2011605210,name:"Albania",isoCode:"ALB",isoCodeAlpha2:"AL"},{id:1946162701,name:"Algeria",isoCode:"DZA",isoCodeAlpha2:"DZ"},{id:224532790,name:"American Samoa",isoCode:"ASM",isoCodeAlpha2:"AS"},{id:1811000739,name:"Andorra",isoCode:"AND",isoCodeAlpha2:"AD"},{id:1220880767,name:"Angola",isoCode:"AGO",isoCodeAlpha2:"AO"},{id:1207291086,name:"Anguilla",isoCode:"AIA",isoCodeAlpha2:"AI"},{id:1223419909,name:"Antarctica",isoCode:"ATA",isoCodeAlpha2:"AQ"},{id:1537806256,name:"Antigua and Barbuda",isoCode:"ATG",isoCodeAlpha2:"AG"},{id:1726703397,name:"Argentina",isoCode:"ARG",isoCodeAlpha2:"AR"},{id:1946401378,name:"Armenia",isoCode:"ARM",isoCodeAlpha2:"AM"},{id:2125316386,name:"Aruba",isoCode:"ABW",isoCodeAlpha2:"AW"},{id:185378018,name:"Australia",isoCode:"AUS",isoCodeAlpha2:"AU"},{id:1648115611,name:"Austria",isoCode:"AUT",isoCodeAlpha2:"AT"},{id:1956435132,name:"Azerbaijan",isoCode:"AZE",isoCodeAlpha2:"AZ"},{id:1159875611,name:"Bahamas",isoCode:"BHS",isoCodeAlpha2:"BS"},{id:463117118,name:"Bahrain",isoCode:"BHR",isoCodeAlpha2:"BH"},{id:1731460729,name:"Bangladesh",isoCode:"BGD",isoCodeAlpha2:"BD"},{id:1034329612,name:"Barbados",isoCode:"BRB",isoCodeAlpha2:"BB"},{id:1858693313,name:"Belarus",isoCode:"BLR",isoCodeAlpha2:"BY"},{id:615370077,name:"Belgium",isoCode:"BEL",isoCodeAlpha2:"BE"},{id:925994048,name:"Belize",isoCode:"BLZ",isoCodeAlpha2:"BZ"},{id:1256921492,name:"Benin",isoCode:"BEN",isoCodeAlpha2:"BJ"},{id:1251658486,name:"Bermuda",isoCode:"BMU",isoCodeAlpha2:"BM"},{id:1592681644,name:"Bhutan",isoCode:"BTN",isoCodeAlpha2:"BT"},{id:1434413467,name:"Bolivia",isoCode:"BOL",isoCodeAlpha2:"BO"},{id:1289050398,name:"Bonaire, Sint Eustatius and Saba",isoCode:"BES",isoCodeAlpha2:"BQ"},{id:897406143,name:"Bosnia and Herzegovina",isoCode:"BIH",isoCodeAlpha2:"BA"},{id:715068700,name:"Botswana",isoCode:"BWA",isoCodeAlpha2:"BW"},{id:2000032629,name:"Bouvet Island",isoCode:"BVT",isoCodeAlpha2:"BV"},{id:1336809528,name:"Brazil",isoCode:"BRA",isoCodeAlpha2:"BR"},{id:253965211,name:"British Indian Ocean Territory",isoCode:"IOT",isoCodeAlpha2:"IO"},{id:1995739570,name:"Brunei",isoCode:"BRN",isoCodeAlpha2:"BN"},{id:964025643,name:"Bulgaria",isoCode:"BGR",isoCodeAlpha2:"BG"},{id:1648332448,name:"Burkina Faso",isoCode:"BFA",isoCodeAlpha2:"BF"},{id:717241240,name:"Burundi",isoCode:"BDI",isoCodeAlpha2:"BI"},{id:1387092282,name:"Cabo Verde",isoCode:"CPV",isoCodeAlpha2:"CV"},{id:2126012022,name:"Cambodia",isoCode:"KHM",isoCodeAlpha2:"KH"},{id:1756221076,name:"Cameroon",isoCode:"CMR",isoCodeAlpha2:"CM"},{id:509091739,name:"Canada",isoCode:"CAN",isoCodeAlpha2:"CA"},{id:2000163492,name:"Cayman Islands",isoCode:"CYM",isoCodeAlpha2:"KY"},{id:1834075444,name:"Central African Republic (the)",isoCode:"CAF",isoCodeAlpha2:"CF"},{id:2103718569,name:"Chad",isoCode:"TCD",isoCodeAlpha2:"TD"},{id:1669259847,name:"Chile",isoCode:"CHL",isoCodeAlpha2:"CL"},{id:1153713793,name:"China",isoCode:"CHN",isoCodeAlpha2:"CN"},{id:281559723,name:"Christmas Island",isoCode:"CXR",isoCodeAlpha2:"CX"},{id:875933931,name:"Cocos (Keeling) Islands",isoCode:"CCK",isoCodeAlpha2:"CC"},{id:246545030,name:"Colombia",isoCode:"COL",isoCodeAlpha2:"CO"},{id:785577634,name:"Comoros",isoCode:"COM",isoCodeAlpha2:"KM"},{id:731160045,name:"Congo (the Democratic Republic of the)",isoCode:"COD",isoCodeAlpha2:"CD"},{id:1034988,name:"Congo (the)",isoCode:"COG",isoCodeAlpha2:"CG"},{id:1394830528,name:"Cook Islands (the)",isoCode:"COK",isoCodeAlpha2:"CK"},{id:1186114049,name:"Costa Rica",isoCode:"CRI",isoCodeAlpha2:"CR"},{id:137198256,name:"Côte d'Ivoire",isoCode:"CIV",isoCodeAlpha2:"CI"},{id:1951641461,name:"Croatia",isoCode:"HRV",isoCodeAlpha2:"HR"},{id:1092131617,name:"Cuba",isoCode:"CUB",isoCodeAlpha2:"CU"},{id:1542652460,name:"Curaçao",isoCode:"CUW",isoCodeAlpha2:"CW"},{id:1639945260,name:"Cyprus",isoCode:"CYP",isoCodeAlpha2:"CY"},{id:1237392088,name:"Czechia",isoCode:"CZE",isoCodeAlpha2:"CZ"},{id:447519117,name:"Denmark",isoCode:"DNK",isoCodeAlpha2:"DK"},{id:1486917866,name:"Djibouti",isoCode:"DJI",isoCodeAlpha2:"DJ"},{id:645083517,name:"Dominica",isoCode:"DMA",isoCodeAlpha2:"DM"},{id:1996563349,name:"Dominican Republic",isoCode:"DOM",isoCodeAlpha2:"DO"},{id:1824864865,name:"Ecuador",isoCode:"ECU",isoCodeAlpha2:"EC"},{id:110576471,name:"Egypt",isoCode:"EGY",isoCodeAlpha2:"EG"},{id:1986338300,name:"El Salvador",isoCode:"SLV",isoCodeAlpha2:"SV"},{id:694495547,name:"Equatorial Guinea",isoCode:"GNQ",isoCodeAlpha2:"GQ"},{id:940484622,name:"Eritrea",isoCode:"ERI",isoCodeAlpha2:"ER"},{id:279419845,name:"Estonia",isoCode:"EST",isoCodeAlpha2:"EE"},{id:633882046,name:"Ethiopia",isoCode:"ETH",isoCodeAlpha2:"ET"},{id:1366686636,name:"Falkland Islands (Islas Malvinas)",isoCode:"FLK",isoCodeAlpha2:"FK"},{id:670731012,name:"Faroe Islands",isoCode:"FRO",isoCodeAlpha2:"FO"},{id:846080647,name:"Fiji",isoCode:"FJI",isoCodeAlpha2:"FJ"},{id:1160015254,name:"Finland",isoCode:"FIN",isoCodeAlpha2:"FI"},{id:1370945938,name:"France",isoCode:"FRA",isoCodeAlpha2:"FR"},{id:1229683408,name:"French Guiana",isoCode:"GUF",isoCodeAlpha2:"GF"},{id:371136380,name:"French Polynesia",isoCode:"PYF",isoCodeAlpha2:"PF"},{id:1302638806,name:"French Southern Territories",isoCode:"ATF",isoCodeAlpha2:"TF"},{id:210781329,name:"Gabon",isoCode:"GAB",isoCodeAlpha2:"GA"},{id:608661106,name:"Gambia",isoCode:"GMB",isoCodeAlpha2:"GM"},{id:731270324,name:"Georgia",isoCode:"GEO",isoCodeAlpha2:"GE"},{id:766663848,name:"Germany",isoCode:"DEU",isoCodeAlpha2:"DE"},{id:606636584,name:"Ghana",isoCode:"GHA",isoCodeAlpha2:"GH"},{id:27475273,name:"Gibraltar",isoCode:"GIB",isoCodeAlpha2:"GI"},{id:1276655145,name:"Greece",isoCode:"GRC",isoCodeAlpha2:"GR"},{id:1444193546,name:"Greenland",isoCode:"GRL",isoCodeAlpha2:"GL"},{id:1948450466,name:"Grenada",isoCode:"GRD",isoCodeAlpha2:"GD"},{id:562381138,name:"Guadeloupe",isoCode:"GLP",isoCodeAlpha2:"GP"},{id:426894921,name:"Guam",isoCode:"GUM",isoCodeAlpha2:"GU"},{id:336041795,name:"Guatemala",isoCode:"GTM",isoCodeAlpha2:"GT"},{id:1005212045,name:"Guernsey",isoCode:"GGY",isoCodeAlpha2:"GG"},{id:2101008429,name:"Guinea",isoCode:"GIN",isoCodeAlpha2:"GN"},{id:2121706930,name:"Guinea-Bissau",isoCode:"GNB",isoCodeAlpha2:"GW"},{id:794746109,name:"Guyana",isoCode:"GUY",isoCodeAlpha2:"GY"},{id:50098683,name:"Haiti",isoCode:"HTI",isoCodeAlpha2:"HT"},{id:1932285016,name:"Heard Island and McDonald Islands",isoCode:"HMD",isoCodeAlpha2:"HM"},{id:366034573,name:"Vatican City",isoCode:"VAT",isoCodeAlpha2:"VA"},{id:819424528,name:"Honduras",isoCode:"HND",isoCodeAlpha2:"HN"},{id:1595024335,name:"Hong Kong, SAR China",isoCode:"HKG",isoCodeAlpha2:"HK"},{id:505292770,name:"Hungary",isoCode:"HUN",isoCodeAlpha2:"HU"},{id:742671599,name:"Iceland",isoCode:"ISL",isoCodeAlpha2:"IS"},{id:341574783,name:"India",isoCode:"IND",isoCodeAlpha2:"IN"},{id:1583295607,name:"Indonesia",isoCode:"IDN",isoCodeAlpha2:"ID"},{id:996230465,name:"Iran",isoCode:"IRN",isoCodeAlpha2:"IR"},{id:1905397803,name:"Iraq",isoCode:"IRQ",isoCodeAlpha2:"IQ"},{id:1012652936,name:"Ireland",isoCode:"IRL",isoCodeAlpha2:"IE"},{id:359324702,name:"Isle of Man",isoCode:"IMN",isoCodeAlpha2:"IM"},{id:1640065824,name:"Israel",isoCode:"ISR",isoCodeAlpha2:"IL"},{id:316662998,name:"Italy",isoCode:"ITA",isoCodeAlpha2:"IT"},{id:1713273101,name:"Jamaica",isoCode:"JAM",isoCodeAlpha2:"JM"},{id:1225895820,name:"Japan",isoCode:"JPN",isoCodeAlpha2:"JP"},{id:1686352738,name:"Jersey",isoCode:"JEY",isoCodeAlpha2:"JE"},{id:1921178157,name:"Jordan",isoCode:"JOR",isoCodeAlpha2:"JO"},{id:1407658520,name:"Kazakhstan",isoCode:"KAZ",isoCodeAlpha2:"KZ"},{id:729109508,name:"Kenya",isoCode:"KEN",isoCodeAlpha2:"KE"},{id:1323342457,name:"Kiribati",isoCode:"KIR",isoCodeAlpha2:"KI"},{id:2111821148,name:"DPR Korea",isoCode:"PRK",isoCodeAlpha2:"KP"},{id:398458223,name:"South Korea",isoCode:"KOR",isoCodeAlpha2:"KR"},{id:1838588128,name:"Kuwait",isoCode:"KWT",isoCodeAlpha2:"KW"},{id:2132398016,name:"Kyrgyzstan",isoCode:"KGZ",isoCodeAlpha2:"KG"},{id:1687140183,name:"Laos",isoCode:"LAO",isoCodeAlpha2:"LA"},{id:1072148194,name:"Latvia",isoCode:"LVA",isoCodeAlpha2:"LV"},{id:1660047568,name:"Lebanon",isoCode:"LBN",isoCodeAlpha2:"LB"},{id:792287501,name:"Lesotho",isoCode:"LSO",isoCodeAlpha2:"LS"},{id:34356586,name:"Liberia",isoCode:"LBR",isoCodeAlpha2:"LR"},{id:284250416,name:"Libya",isoCode:"LBY",isoCodeAlpha2:"LY"},{id:1734401821,name:"Liechtenstein",isoCode:"LIE",isoCodeAlpha2:"LI"},{id:1585938948,name:"Lithuania",isoCode:"LTU",isoCodeAlpha2:"LT"},{id:1450859395,name:"Luxembourg",isoCode:"LUX",isoCodeAlpha2:"LU"},{id:1551129384,name:"Macao, SAR China",isoCode:"MAC",isoCodeAlpha2:"MO"},{id:895892381,name:"North Macedonia",isoCode:"MKD",isoCodeAlpha2:"MK"},{id:426092600,name:"Madagascar",isoCode:"MDG",isoCodeAlpha2:"MG"},{id:203116630,name:"Malawi",isoCode:"MWI",isoCodeAlpha2:"MW"},{id:1390102395,name:"Malaysia",isoCode:"MYS",isoCodeAlpha2:"MY"},{id:370590288,name:"Maldives",isoCode:"MDV",isoCodeAlpha2:"MV"},{id:1741977698,name:"Mali",isoCode:"MLI",isoCodeAlpha2:"ML"},{id:334351708,name:"Malta",isoCode:"MLT",isoCodeAlpha2:"MT"},{id:1204666203,name:"Marshall Islands",isoCode:"MHL",isoCodeAlpha2:"MH"},{id:863871092,name:"Martinique",isoCode:"MTQ",isoCodeAlpha2:"MQ"},{id:919391649,name:"Mauritania",isoCode:"MRT",isoCodeAlpha2:"MR"},{id:253984606,name:"Mauritius",isoCode:"MUS",isoCodeAlpha2:"MU"},{id:882205771,name:"Mayotte",isoCode:"MYT",isoCodeAlpha2:"YT"},{id:1378197331,name:"Mexico",isoCode:"MEX",isoCodeAlpha2:"MX"},{id:466964786,name:"Micronesia",isoCode:"FSM",isoCodeAlpha2:"FM"},{id:214539259,name:"Moldova",isoCode:"MDA",isoCodeAlpha2:"MD"},{id:1873588777,name:"Monaco",isoCode:"MCO",isoCodeAlpha2:"MC"},{id:310848600,name:"Mongolia",isoCode:"MNG",isoCodeAlpha2:"MN"},{id:248080961,name:"Montenegro",isoCode:"MNE",isoCodeAlpha2:"ME"},{id:1140983369,name:"Montserrat",isoCode:"MSR",isoCodeAlpha2:"MS"},{id:2044765019,name:"Morocco",isoCode:"MAR",isoCodeAlpha2:"MA"},{id:1921276129,name:"Mozambique",isoCode:"MOZ",isoCodeAlpha2:"MZ"},{id:1552338671,name:"Myanmar (Burma)",isoCode:"MMR",isoCodeAlpha2:"MM"},{id:1336707220,name:"Namibia",isoCode:"NAM",isoCodeAlpha2:"NA"},{id:254906113,name:"Nauru",isoCode:"NRU",isoCodeAlpha2:"NR"},{id:176263853,name:"Nepal",isoCode:"NPL",isoCodeAlpha2:"NP"},{id:1958748096,name:"Netherlands",isoCode:"NLD",isoCodeAlpha2:"NL"},{id:2085809069,name:"New Caledonia",isoCode:"NCL",isoCodeAlpha2:"NC"},{id:266758371,name:"New Zealand",isoCode:"NZL",isoCodeAlpha2:"NZ"},{id:381172239,name:"Nicaragua",isoCode:"NIC",isoCodeAlpha2:"NI"},{id:582166105,name:"Niger",isoCode:"NER",isoCodeAlpha2:"NE"},{id:601397227,name:"Nigeria",isoCode:"NGA",isoCodeAlpha2:"NG"},{id:164882254,name:"Niue",isoCode:"NIU",isoCodeAlpha2:"NU"},{id:422553058,name:"Norfolk Island",isoCode:"NFK",isoCodeAlpha2:"NF"},{id:1216721886,name:"Northern Mariana Islands",isoCode:"MNP",isoCodeAlpha2:"MP"},{id:2051110200,name:"Norway",isoCode:"NOR",isoCodeAlpha2:"NO"},{id:1786537481,name:"Oman",isoCode:"OMN",isoCodeAlpha2:"OM"},{id:2064735066,name:"Pakistan",isoCode:"PAK",isoCodeAlpha2:"PK"},{id:1241254634,name:"Palau",isoCode:"PLW",isoCodeAlpha2:"PW"},{id:1355830708,name:"Palestinian Territories",isoCode:"PSE",isoCodeAlpha2:"PS"},{id:2004229434,name:"Panama",isoCode:"PAN",isoCodeAlpha2:"PA"},{id:1357597890,name:"Papua New Guinea",isoCode:"PNG",isoCodeAlpha2:"PG"},{id:1422433455,name:"Paraguay",isoCode:"PRY",isoCodeAlpha2:"PY"},{id:796884946,name:"Peru",isoCode:"PER",isoCodeAlpha2:"PE"},{id:928434316,name:"Philippines",isoCode:"PHL",isoCodeAlpha2:"PH"},{id:1966476742,name:"Pitcairn Islands",isoCode:"PCN",isoCodeAlpha2:"PN"},{id:1700366435,name:"Poland",isoCode:"POL",isoCodeAlpha2:"PL"},{id:607888243,name:"Portugal",isoCode:"PRT",isoCodeAlpha2:"PT"},{id:2071220430,name:"Puerto Rico",isoCode:"PRI",isoCodeAlpha2:"PR"},{id:618251996,name:"Qatar",isoCode:"QAT",isoCodeAlpha2:"QA"},{id:1980018361,name:"Réunion",isoCode:"REU",isoCodeAlpha2:"RE"},{id:1992911550,name:"Romania",isoCode:"ROU",isoCodeAlpha2:"RO"},{id:2045303740,name:"Russia",isoCode:"RUS",isoCodeAlpha2:"RU"},{id:775199890,name:"Rwanda",isoCode:"RWA",isoCodeAlpha2:"RW"},{id:715094357,name:"Saint Barthélemy",isoCode:"BLM",isoCodeAlpha2:"BL"},{id:509893523,name:"Saint Helena",isoCode:"SHN",isoCodeAlpha2:"SH"},{id:451168211,name:"Saint Kitts and Nevis",isoCode:"KNA",isoCodeAlpha2:"KN"},{id:1226052896,name:"Saint Lucia",isoCode:"LCA",isoCodeAlpha2:"LC"},{id:1718054729,name:"Saint Martin (French part)",isoCode:"MAF",isoCodeAlpha2:"MF"},{id:652014278,name:"Saint Pierre and Miquelon",isoCode:"SPM",isoCodeAlpha2:"PM"},{id:152048826,name:"Saint Vincent and the Grenadines",isoCode:"VCT",isoCodeAlpha2:"VC"},{id:1143774806,name:"Samoa",isoCode:"WSM",isoCodeAlpha2:"WS"},{id:55867508,name:"San Marino",isoCode:"SMR",isoCodeAlpha2:"SM"},{id:313844074,name:"Sao Tome and Principe",isoCode:"STP",isoCodeAlpha2:"ST"},{id:1740335887,name:"Saudi Arabia",isoCode:"SAU",isoCodeAlpha2:"SA"},{id:1640560299,name:"Senegal",isoCode:"SEN",isoCodeAlpha2:"SN"},{id:304707575,name:"Serbia",isoCode:"SRB",isoCodeAlpha2:"RS"},{id:2065100564,name:"Seychelles",isoCode:"SYC",isoCodeAlpha2:"SC"},{id:1859542514,name:"Sierra Leone",isoCode:"SLE",isoCodeAlpha2:"SL"},{id:1195479654,name:"Singapore",isoCode:"SGP",isoCodeAlpha2:"SG"},{id:334035937,name:"Sint Maarten (Dutch part)",isoCode:"SXM",isoCodeAlpha2:"SX"},{id:995344482,name:"Slovakia",isoCode:"SVK",isoCodeAlpha2:"SK"},{id:1125605417,name:"Slovenia",isoCode:"SVN",isoCodeAlpha2:"SI"},{id:1181769579,name:"Solomon Islands",isoCode:"SLB",isoCodeAlpha2:"SB"},{id:1438241585,name:"Somalia",isoCode:"SOM",isoCodeAlpha2:"SO"},{id:760535882,name:"South Africa",isoCode:"ZAF",isoCodeAlpha2:"ZA"},{id:1804008815,name:"South Georgia and the South Sandwich Islands",isoCode:"SGS",isoCodeAlpha2:"GS"},{id:198811468,name:"South Sudan",isoCode:"SSD",isoCodeAlpha2:"SS"},{id:887050244,name:"Spain",isoCode:"ESP",isoCodeAlpha2:"ES"},{id:1252700379,name:"Sri Lanka",isoCode:"LKA",isoCodeAlpha2:"LK"},{id:695833456,name:"Sudan",isoCode:"SDN",isoCodeAlpha2:"SD"},{id:1960641615,name:"Suriname",isoCode:"SUR",isoCodeAlpha2:"SR"},{id:732053970,name:"Svalbard and Jan Mayen",isoCode:"SJM",isoCodeAlpha2:"SJ"},{id:1459317551,name:"Eswatini",isoCode:"SWZ",isoCodeAlpha2:"SZ"},{id:985330941,name:"Sweden",isoCode:"SWE",isoCodeAlpha2:"SE"},{id:585897497,name:"Switzerland",isoCode:"CHE",isoCodeAlpha2:"CH"},{id:1355294681,name:"Syria",isoCode:"SYR",isoCodeAlpha2:"SY"},{id:1845378489,name:"Taiwan",isoCode:"TWN",isoCodeAlpha2:"TW"},{id:1760123675,name:"Tajikistan",isoCode:"TJK",isoCodeAlpha2:"TJ"},{id:643765491,name:"Tanzania",isoCode:"TZA",isoCodeAlpha2:"TZ"},{id:1379519482,name:"Thailand",isoCode:"THA",isoCodeAlpha2:"TH"},{id:379190903,name:"Timor-Leste",isoCode:"TLS",isoCodeAlpha2:"TL"},{id:2130439837,name:"Togo",isoCode:"TGO",isoCodeAlpha2:"TG"},{id:1515884962,name:"Tokelau",isoCode:"TKL",isoCodeAlpha2:"TK"},{id:234061621,name:"Tonga",isoCode:"TON",isoCodeAlpha2:"TO"},{id:995911990,name:"Trinidad and Tobago",isoCode:"TTO",isoCodeAlpha2:"TT"},{id:1680731914,name:"Tunisia",isoCode:"TUN",isoCodeAlpha2:"TN"},{id:1515436380,name:"Turkey",isoCode:"TUR",isoCodeAlpha2:"TR"},{id:367971963,name:"Turkmenistan",isoCode:"TKM",isoCodeAlpha2:"TM"},{id:948189791,name:"Turks and Caicos Islands",isoCode:"TCA",isoCodeAlpha2:"TC"},{id:280351015,name:"Tuvalu",isoCode:"TUV",isoCodeAlpha2:"TV"},{id:1561280970,name:"Uganda",isoCode:"UGA",isoCodeAlpha2:"UG"},{id:1833866898,name:"Ukraine",isoCode:"UKR",isoCodeAlpha2:"UA"},{id:125378496,name:"Undefined",isoCode:null,isoCodeAlpha2:null},{id:2012058321,name:"United Arab Emirates",isoCode:"ARE",isoCodeAlpha2:"AE"},{id:561382372,name:"United Kingdom",isoCode:"GBR",isoCodeAlpha2:"GB"},{id:989089031,name:"U.S. Minor Outlying Islands",isoCode:"UMI",isoCodeAlpha2:"UM"},{id:426727504,name:"United States",isoCode:"USA",isoCodeAlpha2:"US"},{id:261848091,name:"Uruguay",isoCode:"URY",isoCodeAlpha2:"UY"},{id:709522365,name:"Uzbekistan",isoCode:"UZB",isoCodeAlpha2:"UZ"},{id:1985302868,name:"Vanuatu",isoCode:"VUT",isoCodeAlpha2:"VU"},{id:836540644,name:"Venezuela",isoCode:"VEN",isoCodeAlpha2:"VE"},{id:891459223,name:"Vietnam",isoCode:"VNM",isoCodeAlpha2:"VN"},{id:1822297990,name:"British Virgin Islands",isoCode:"VGB",isoCodeAlpha2:"VG"},{id:2052475335,name:"U.S. Virgin Islands",isoCode:"VIR",isoCodeAlpha2:"VI"},{id:1575843394,name:"Wallis and Futuna",isoCode:"WLF",isoCodeAlpha2:"WF"},{id:1298951907,name:"Western Sahara",isoCode:"ESH",isoCodeAlpha2:"EH"},{id:673972740,name:"Yemen",isoCode:"YEM",isoCodeAlpha2:"YE"},{id:2043856285,name:"Zambia",isoCode:"ZMB",isoCodeAlpha2:"ZM"},{id:777487800,name:"Zimbabwe",isoCode:"ZWE",isoCodeAlpha2:"ZW"}];r.sort(function(n,t){return n.name===t.name?0:n.name>t.name?1:-1});i=r;"function"==typeof Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed&&Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed(n,t)}})}function s(){t=[];Frontiers.Ugarit.Common.Ajax.loadData({endpoint:Frontiers.Ugarit.Constants.Endpoints.CommonOrganizations(),successCallback:function(n){t=n},errorCallback:function(n,i){t=[];"function"==typeof Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed&&Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed(n,i)}})}var r="",u="api",f="",e="",i=null,t=null;return{version:function(){return"2.6"},generateUUID:function(){return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},MainDomain:function(n){return"string"==typeof n&&("/"===(n=n.trim().toLowerCase()).substring(n.length-1)&&(n=n.substring(0,n.length-1)),r=n,o(),s()),r},FrontiersDomain:function(n){return console.warn("Frontiers.Ugarit.Common.Configuration.FrontiersDomain function is deprecated. Use Frontiers.Ugarit.Common.Configuration.SetBaseUrls function instead of."),Frontiers.Ugarit.Common.Configuration.MainDomain(n)},SetBaseUrls:function(n,t){void 0!==n&&n.length>0&&("/"!==(n=n.trim().toLowerCase()).substring(n.length-1)&&(n+="/"),f=n);void 0!==t&&t.length>0&&("/"!==(t=t.trim().toLowerCase()).substring(t.length-1)&&(t+="/"),e=t);o();s()},OrganizationsApiSubdomain:function(n){return"string"==typeof n&&("/"===(n=n.trim().toLowerCase()).substring(n.length-1)&&(n=n.substring(0,n.length-1)),u=n),u},LoopBaseUrl:function(){return e.length>0?e:"https://loop."+r+"/"},OrganizationsApiBaseUrl:function(){return f.length>0?f:"https://"+u+"."+r+"/"},GetCountries:function(n){return void 0!==n&&n?h(i,{id:0,name:"Select"}):i},GetCommonOrganizations:function(){return t},GetUgaritApiStatus:function(){return t=null,Frontiers.Ugarit.Common.Configuration.GetCommonOrganizations(),t.length>0?"good":"error"},onUgaritApiFailed:null}}()},function(){Frontiers.Ugarit.ViewModels=Frontiers.Ugarit.ViewModels||{};Frontiers.Ugarit.ViewModels.CreateOrganization=function(n){function f(n,r){i={id:n,type:Frontiers.Ugarit.Constants.OrganizationTypes.NEW,name:r,city:t.organization.city,street:null,zipCode:null,country:{id:t.organization.countryId,name:t.organization.countryName,isoCode:function(){for(var i=Frontiers.Ugarit.Common.Configuration.GetCountries(),n=0,n=0;n<i.length;n+=1)if(i[n].id===t.organization.countryId)return i[n].isoCode;return null}()},state:null,webDomain:null};"function"==typeof t.onOrganizationCreated&&t.onOrganizationCreated(i)}function e(n){var t=[];return n.length<3&&t.push(Frontiers.Ugarit.Constants.UIMessages.requiredWithMinLength(3)),n.length>200&&t.push(Frontiers.Ugarit.Constants.UIMessages.limitExceded(200)),t}var t=this,i=null,r=!1,u={applyValidation:!1,organization:{name:"",city:"",countryId:null,countryName:null},shadowSave:!1,onOrganizationCreated:null,onOrganizationCreationError:null};t.applyValidation=!1;t.saving=!1;t.organization=null;t.organizationErrors={name:[],city:[],countryId:[],reset:function(){this.name=[];this.city=[];this.countryId=[]},hasErrors:function(){return this.name.length>0||this.city.length>0||this.countryId.length>0}};t.organizationAPIError="";t.getNewOrganizationCreated=function(){return i};t.onOrganizationCreated=null;t.onOrganizationCreationError=null;t.validateOrganization=function(){return t.organizationErrors.reset(),null===t.organization&&(t.organization=u.organization),t.organization.name=t.organization.name.trim(),t.organization.city=t.organization.city.trim(),!0===t.applyValidation&&(t.organizationErrors.name=e(t.organization.name),t.organizationErrors.city=e(t.organization.city),t.organizationErrors.countryId=function(n,t){var i=[];return(isNaN(n)||""===n||null===n)&&i.push(t),i}(t.organization.countryId,Frontiers.Ugarit.Constants.UIMessages.suggestionRequired)),!t.organizationErrors.hasErrors()};t.setOrganization=function(n){if(null===n)throw new Error("Organization cannot be null.");t.organization.name="string"==typeof n.name?n.name.trim():"";t.organization.city="string"==typeof n.city?n.city.trim():"";t.organization.countryId="number"==typeof n.countryId?n.countryId:null};t.saveOrganization=function(){var n=$.Deferred();return n.promise(),t.applyValidation=!0,t.validateOrganization()?!0===r?(f(null,t.organization.name),n.resolve(i)):function(n){if(!1===t.saving){t.saving=!0;var r=Frontiers.Ugarit.Constants.Endpoints.CreateOrganizationBasic();Frontiers.Ugarit.Common.Ajax.createData({withCredentials:!0,endpoint:r,inputData:JSON.stringify({name:t.organization.name,cityName:t.organization.city,countryId:t.organization.countryId}),successCallback:function(r){t.saving=!1;f(r.id,r.name);n.resolve(i)},errorCallback:function(r,u){t.saving=!1;i=null;t.organizationAPIError=409===r?Frontiers.Ugarit.Constants.UIMessages.organizationAlreadyExists:Frontiers.Ugarit.Constants.UIMessages.genericErrorSaving;"function"==typeof t.onOrganizationCreationError&&t.onOrganizationCreationError(r,u,t.organizationAPIError);"function"==typeof Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed&&Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed(r,u);n.reject(t.organizationAPIError)}})}}(n):n.reject("There are validation errors."),n},function(){t.saving=!1;t.organizationAPIError="";var i=jQuery.extend(!0,{},u,n);!function(n){if("boolean"!=typeof n.applyValidation)throw new Error("options.applyValidation must be boolean.");if("boolean"!=typeof n.shadowSave)throw new Error("options.shadowSave must be boolean.");}(i);r=i.shadowSave;t.applyValidation=i.applyValidation;t.organization=i.organization;t.onOrganizationCreated=i.onOrganizationCreated;t.onOrganizationCreationError=i.onOrganizationCreationError}()}},function(){Frontiers.Ugarit.Plugins=Frontiers.Ugarit.Plugins||{};Frontiers.Ugarit.Plugins.CreateOrganization=function(n){function p(n,i,r){t.apiError.text(r)}function w(n){i.organization.name=t.inputName.val();i.validateOrganization();f(n,t.inputName,i.organizationErrors.name)}function b(n){i.organization.city=t.inputCity.val();i.validateOrganization();f(n,t.inputCity,i.organizationErrors.city)}function d(n){var e=t.inputCountry.val(),o=null,s=null,r=0,u=Frontiers.Ugarit.Common.Configuration.GetCountries(!1);if("null"!==e)for(r=0;r<u.length;r++)if(u[r].id===parseInt(e)){o=u[r].id;s=u[r].name;break}i.organization.countryId=o;i.organization.countryName=s;i.validateOrganization();f(n,t.inputCountry,i.organizationErrors.countryId)}function f(n,t,r){if(!0===i.applyValidation&&t){var f=t.next(),u=null;r.length>0?(f.hasClass("form-validator-error")?u=f:(u=$(y.fieldError),t.after(u)),u.text(""),r.forEach(function(n){u.text(n)})):f.hasClass("form-validator-error")&&f.remove()}}var c,e,l,r,u=this,k={title:"Affiliation / Employer",placeHolders:{organization:"Name *",city:"City *",country:"Country / Region *"},viewModel:new Frontiers.Ugarit.ViewModels.CreateOrganization,templateId:"create-organization-template",errorTemplateId:"create-organization-error-template",parentElementId:null,onOrganizationCreated:null,onOrganizationCreationCancelled:null},i=null,o=null,a="",v="",t={formContainer:null,labelTitle:null,inputName:null,inputCity:null,inputCountry:null,btnCancel:null,btnSave:null,apiError:null},y={fieldError:null},s=null,h=null;u.organization={};u.organization.name=function(n){i.organization.name=n};u.show=function(){t.formContainer.show();t.inputName.focus()};u.hide=function(){t.formContainer.hide()};u.dispose=function(){t.formContainer.remove();u=null};r=jQuery.extend(!0,{},k,n);c=r.title;e=r.placeHolders;i=r.viewModel;a=r.templateId;v=r.errorTemplateId;o=r.parentElementId;s=r.onOrganizationCreated;h=r.onOrganizationCreationCancelled,function(){if("object"!=typeof i)throw new Error("Invalid viewModel.");if("string"==typeof o&&0===$("#"+o).length)throw new Error("Element ID '"+o+"' not found.");}();"function"!=typeof i.onOrganizationCreationError&&(i.onOrganizationCreationError=p);l=Frontiers.Ugarit.Common.Configuration.GetCountries(!1);t.formContainer=$($("#"+a).html());y.fieldError=$("#"+v).html();t.labelTitle=t.formContainer.find("#title");t.inputName=t.formContainer.find("#name");t.inputCity=t.formContainer.find("#city");t.inputCountry=t.formContainer.find("#country");t.btnCancel=t.formContainer.find("#cancel");t.btnSave=t.formContainer.find("#save");t.apiError=t.formContainer.find("#api-error");t.labelTitle.text(c);t.inputName.val(i.organization.name);t.inputName.attr("placeholder",e.organization);t.inputCity.attr("placeholder",e.city);t.inputCountry.attr("placeholder",e.country);t.inputName.bind("keyup",w);t.inputName.bind("change",w);t.inputCity.bind("keyup",b);t.inputCity.bind("change",b);t.inputCountry.bind("change",d);t.btnSave.bind("click",function(n){i.applyValidation=!0;i.validateOrganization()?$.when(i.saveOrganization()).done(function(t){"function"==typeof s&&s(t,n)}).fail(p):(f(0,t.inputName,i.organizationErrors.name),f(0,t.inputCity,i.organizationErrors.city),f(0,t.inputCountry,i.organizationErrors.countryId))});t.btnCancel.bind("click",function(n){"function"==typeof h?h(n):u.hide()});u.hide();$("#"+o).append(t.formContainer);t.inputCountry.append("<option value='null'>"+e.country+"<\/option>");$.each(l,function(n,i){t.inputCountry.append("<option value='"+i.id+"'>"+i.name+"<\/option>")})}},function(){Frontiers.Ugarit.ViewModels=Frontiers.Ugarit.ViewModels||{};Frontiers.Ugarit.ViewModels.CommonOrganization=function(n){function u(n,t){var i=[];return(isNaN(n)||""===n||null===n)&&i.push(t),i}var i,t=this,r={applyValidation:!1,organization:{id:null,name:"",city:"",countryId:null,countryName:null,countryIsoCode:null}};t.applyValidation=!1;t.organization=null;t.organizationErrors={id:[],city:[],countryId:[],reset:function(){this.id=[];this.city=[];this.countryId=[]},hasErrors:function(){return this.id.length>0||this.city.length>0||this.countryId.length>0}};t.validateOrganization=function(){return t.organizationErrors.reset(),null===t.organization&&(t.organization=r.organization),t.organization.city=t.organization.city.trim(),!0===t.applyValidation&&(t.organizationErrors.id=u(t.organization.id,Frontiers.Ugarit.Constants.UIMessages.required),t.organizationErrors.city=function(n){var t=[];return n.length<3&&t.push(Frontiers.Ugarit.Constants.UIMessages.requiredWithMinLength(3)),n.length>200&&t.push(Frontiers.Ugarit.Constants.UIMessages.limitExceded(200)),t}(t.organization.city),t.organizationErrors.countryId=u(t.organization.countryId,Frontiers.Ugarit.Constants.UIMessages.suggestionRequired)),!t.organizationErrors.hasErrors()};t.setOrganization=function(n){if(null===n)throw new Error("Organization cannot be null.");t.organization.id="number"==typeof n.id?n.id:null;t.organization.name="string"==typeof n.name?n.name.trim():"";t.organization.city="string"==typeof n.city?n.city.trim():"";t.organization.countryId="number"==typeof n.countryId?n.countryId:null;t.organization.countryName="number"==typeof n.countryName?n.countryName:null;t.organization.isoCode="string"==typeof n.isoCode?n.isoCode.trim():""};t.saveOrganization=function(){return t.applyValidation=!0,t.validateOrganization()?(t.organization.type=Frontiers.Ugarit.Constants.OrganizationTypes.COMMON,t.organization):"There are validation errors."},function(n){if("boolean"!=typeof n.applyValidation)throw new Error("options.applyValidation must be boolean.");}(i=jQuery.extend(!0,{},r,n));t.applyValidation=i.applyValidation;t.organization=i.organization}},function(){Frontiers.Ugarit.Plugins=Frontiers.Ugarit.Plugins||{};Frontiers.Ugarit.Plugins.CommonOrganization=function(n){function b(n){i.applyValidation=!0;i.validateOrganization()?(u.organization=i.organization,"function"==typeof s&&s(u.organization,n)):(e(null,t.inputName,i.organizationErrors.id),e(null,t.inputCity,i.organizationErrors.city),e(null,t.inputCountry,i.organizationErrors.countryId))}function k(n){"function"==typeof h?h(n):u.hide()}function d(n){var f=t.inputName.val(),o=null,s=null,r=0,u=Frontiers.Ugarit.Common.Configuration.GetCommonOrganizations();if("null"!==f)for(r=0;r<u.length;r++)if(u[r].id===parseInt(f)){o=u[r].id;s=u[r].name;break}i.organization.id=o;i.organization.name=s;i.organization.type=Frontiers.Ugarit.Constants.OrganizationTypes.COMMON;i.validateOrganization();e(n,t.inputName,i.organizationErrors.organizationId)}function p(n){i.organization.city=t.inputCity.val();i.validateOrganization();e(n,t.inputCity,i.organizationErrors.city)}function g(n){var f=t.inputCountry.val(),o=null,s=null,h=null,r=0,u=Frontiers.Ugarit.Common.Configuration.GetCountries(!1);if("null"!==f)for(r=0;r<u.length;r++)if(u[r].id===parseInt(f)){o=u[r].id;s=u[r].name;h=u[r].isoCode;break}i.organization.countryId=o;i.organization.countryName=s;i.organization.countryIsoCode=h;i.validateOrganization();e(n,t.inputCountry,i.organizationErrors.countryId)}function e(n,t,r){if(!0===i.applyValidation&&t){var f=t.next(),u=null;r.length>0?(f.hasClass("form-validator-error")?u=f:(u=$(y.fieldError),t.after(u)),u.text(""),r.forEach(function(n){u.text(n)})):f.hasClass("form-validator-error")&&f.remove()}}var c,f,l,r,u=this,w={title:"Affiliation / Employer",placeHolders:{organization:"Name *",city:"City *",country:"Country / Region *"},viewModel:new Frontiers.Ugarit.ViewModels.CommonOrganization,templateId:"common-organization-template",errorTemplateId:"common-organization-error-template",parentElementId:null,onOrganizationSelected:null,onOrganizationSelectionCancelled:null},i=null,o=null,a="",v="",t={formContainer:null,labelTitle:null,inputName:null,inputCity:null,inputCountry:null,btnCancel:null,btnSave:null},y={fieldError:null},s=null,h=null;u.organization={};u.show=function(){t.formContainer.show();t.inputName.focus()};u.hide=function(){t.formContainer.hide()};u.dispose=function(){t.formContainer.remove();u=null};r=jQuery.extend(!0,{},w,n);c=r.title;f=r.placeHolders;i=r.viewModel;a=r.templateId;v=r.errorTemplateId;o=r.parentElementId;s=r.onOrganizationSelected;h=r.onOrganizationSelectionCancelled,function(){if("object"!=typeof i)throw new Error("Invalid viewModel.");if("string"==typeof o&&0===$("#"+o).length)throw new Error("Element ID '"+o+"' not found.");}();l=Frontiers.Ugarit.Common.Configuration.GetCountries(!1);t.formContainer=$($("#"+a).html());y.fieldError=$("#"+v).html();t.labelTitle=t.formContainer.find("#title");t.inputName=t.formContainer.find("#name");t.inputCity=t.formContainer.find("#city");t.inputCountry=t.formContainer.find("#country");t.btnCancel=t.formContainer.find("#cancel");t.btnSave=t.formContainer.find("#save");t.infoContainer=t.formContainer.find(".info");t.infoContainer.hide();t.errorContainer=t.formContainer.find(".error-container");t.errorContainer.hide();t.labelTitle.text(c);t.inputName.attr("placeholder",f.organization);t.inputCity.attr("placeholder",f.city);t.inputCountry.attr("placeholder",f.country);t.inputName.bind("change",d);t.inputCity.bind("keyup",p);t.inputCity.bind("change",p);t.inputCountry.bind("change",g);t.btnSave.bind("click",b);t.btnCancel.bind("click",k);u.hide();$("#"+o).append(t.formContainer);t.inputName.append("<option value='null'>"+f.organization+"<\/option>");$.each(Frontiers.Ugarit.Common.Configuration.GetCommonOrganizations(),function(n,i){t.inputName.append("<option value='"+i.id+"'>"+i.name+"<\/option>")});t.inputCountry.append("<option value='null'>"+f.country+"<\/option>");$.each(l,function(n,i){t.inputCountry.append("<option value='"+i.id+"'>"+i.name+"<\/option>")})}},function(){Frontiers.Ugarit.Plugins=Frontiers.Ugarit.Plugins||{};Frontiers.Ugarit.Plugins.AutocompleteOrganizations=function(n){function f(){r.showPluginContainer(!0);r.showSuggestions(!1);r.showUsageInfo(!1);r.showSpinner(!1);r.showEmptyCase(!1);r.showOtherOptions(!1);r.showError(!1);r.showEraseIcon(t.inputTextValue().length>0)}function wt(){f();r.showUsageInfo(!0)}function bt(){h&&(f(),i.suggestionContainer.empty(),t.lastSuggestions.forEach(function(n){var r=$(nt.suggestionItemHtml.replace("${name}",n.name).replace("${location}",n.location()));r.click(function(i){t.selectSuggestion(n,i)});i.suggestionContainer.append(r)}),r.showSuggestions(!0),$(pt).scrollTop(0),setTimeout(function(){r.showSuggestions()&&kt(!1)},at))}function kt(n){void 0!==n&&"boolean"==typeof n||(n=!0);!0===n&&f();r.showEmptyCase(!0===v&&t.lastSuggestions.length>0||0===t.lastSuggestions.length&&!o)}function dt(){var u,n;b?"function"==typeof t.onCreatingOrganization?t.onCreatingOrganization():(u=new Frontiers.Ugarit.ViewModels.CreateOrganization({organization:{name:t.inputTextValue()},shadowSave:d}),n=new Frontiers.Ugarit.Plugins.CreateOrganization({title:vt,viewModel:u,parentElementId:s,onOrganizationCreated:function(i,u){t.selectSuggestion({id:i.id,type:Frontiers.Ugarit.Constants.OrganizationTypes.NEW,name:i.name,city:i.city,street:i.street,zipCode:i.zipCode,country:i.country.name,countryId:i.country.id,countryIsoCode:i.country.isoCode,state:i.state,webDomain:i.webDomain},u);n.hide();n.dispose();r.showPluginContainer(!0);"function"==typeof t.onOrganizationCreated&&t.onOrganizationCreated(i,u)},onOrganizationCreationCancelled:function(t){n.hide();n.dispose();r.showPluginContainer(!0);r.showSuggestions(!0);i.inputText.focus();t.stopPropagation()},onOrganizationCreationError:function(n,i,r){"function"==typeof t.onOrganizationCreationError&&t.onOrganizationCreationError(n,i,r)}}),r.showPluginContainer(!1),n.show()):window.open(Frontiers.Ugarit.Common.Configuration.LoopBaseUrl()+"/contact","_blank")}function ti(){var u,n;k?"function"==typeof t.onSelectingOtherOption?t.onSelectingOtherOption():(u=new Frontiers.Ugarit.ViewModels.CommonOrganization,n=new Frontiers.Ugarit.Plugins.CommonOrganization({title:yt,viewModel:u,parentElementId:s,onOrganizationSelected:function(i,u){var f={id:i.id,type:Frontiers.Ugarit.Constants.OrganizationTypes.COMMON,name:i.name,city:i.city,street:i.street,zipCode:i.zipCode,country:i.countryName,countryId:i.countryId,countryIsoCode:i.countryIsoCode,state:i.state,webDomain:i.webDomain};t.selectSuggestion(f,u);n.hide();n.dispose();r.showPluginContainer(!0);"function"==typeof t.onCommonOrganizationSelected&&t.onCommonOrganizationSelected(f,u)},onOrganizationSelectionCancelled:function(u){n.hide();n.dispose();r.showPluginContainer(!0);r.showSuggestions(!0);i.inputText.focus();u.stopPropagation();"function"==typeof t.onCommonOrganizationSelectionCancelled&&t.onCommonOrganizationSelectionCancelled()}}),r.showPluginContainer(!1),n.show()):window.open(Frontiers.Ugarit.Common.Configuration.LoopBaseUrl()+"/contact","_blank")}function tt(){if(null!==e){if(e===c())return bt(),void it();e=c()}else e=c();var i=encodeURIComponent(c()),u=Frontiers.Ugarit.Constants.Endpoints.ElasticSuggestion(i,lt),n=Frontiers.Ugarit.Common.Configuration.generateUUID();a=n;Frontiers.Ugarit.Common.Ajax.loadData({endpoint:u,successCallback:function(i){var r,u;o=!1;u=[];(r={data:i,uid:n}).uid===a&&(r.data&&r.data.length>0?(r.data.forEach(function(n){u.push({id:n.id,type:Frontiers.Ugarit.Constants.OrganizationTypes.VALIDATED,name:n.organizationName,city:n.city,street:n.street,zipCode:n.zipCode,country:n.country,countryIsoCode:n.countryIsoCode,state:n.state,webDomain:n.webDomain,location:function(){var t=[];return n.city&&t.push(n.city),n.country&&t.push(n.country),t.join(", ")}})}),t.lastSuggestions=u,bt()):(e="",t.lastSuggestions=[],kt()));it()},errorCallback:function(n,i){o=!0;f();r.showError(!0);"function"==typeof t.onSuggestionsLoadingFail&&t.onSuggestionsLoadingFail(n,i);"function"==typeof Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed&&Frontiers.Ugarit.Common.Configuration.onUgaritApiFailed(n,i)},preventModalOnError:!1,timeout:15e3,withCredentials:!0})}function it(){"function"==typeof t.onSuggestionsLoaded&&t.onSuggestionsLoaded(t.lastSuggestions)}function rt(){return c().length>=3}function c(){if(t.inputTextValue()){var n=t.inputTextValue();return $.trim(n)}return""}function ii(){!rt()||!1!==o&&((new Date).getTime()-ft.getTime())/1e3<.5||(ft=new Date,h&&(f(),r.showSpinner(!0)),tt())}function gt(n){function u(){var n,t=i.suggestionContainer.find(".preselected"),r={duration:100};t.position().top>=i.suggestionContainer.height()?(n=i.suggestionContainer.scrollTop()+t.outerHeight(),i.suggestionContainer.animate({scrollTop:n},r)):t.position().top<0&&(n=i.suggestionContainer.scrollTop()-t.outerHeight(),i.suggestionContainer.animate({scrollTop:n},r))}var r=i.suggestionContainer.find(".preselected"),f;switch(n.which){case 13:if(0===r.length)return;f=t.lastSuggestions[function(){for(var t=i.suggestionContainer.find("li"),n=0;n<t.length;n+=1)if($(t[n]).hasClass("preselected"))return n;return-1}()];t.selectSuggestion(f,n);n.preventDefault();break;case 38:if(0===r.length)i.suggestionContainer.find("li").last().addClass("preselected");else{if(0===r.prev().length)return;r.removeClass("preselected").prev().addClass("preselected")}u();n.preventDefault();break;case 40:if(0===r.length)i.suggestionContainer.find("li").first().addClass("preselected");else{if(0===r.next().length)return;r.removeClass("preselected").next().addClass("preselected")}u();n.preventDefault();break;default:return}}function ni(){i.pluginContainer.find(".organization-dropdown").css("width","100%").css("top",i.inputText.outerHeight())}function ri(n){if(!((f=n.which)>=37&&f<=40||13===n.which)){var f,u=i.inputText.val();g=u;r.showEraseIcon(u.trim().length>0);!0!==y&&(v=!0,et?et=!1:null!==t.selectedSuggestion()&&"number"==typeof t.selectedSuggestion().id&&u===t.selectedSuggestion().name||(t.selectedSuggestion(null),u.length<3?(a=null,e="",t.lastSuggestions=[],wt(),it()):ut()))}}function l(){!0!==y&&!0!==o&&(v=!1,rt()?tt():(a=null,wt(),i.inputText.unbind("focus",l),i.inputText.focus(),i.inputText.bind("focus",l)))}var a,ut,t=this,ft=new Date,o=!1,s="",et=!0,v=!1,w={inputTextElementId:"",errorApiMessage:Frontiers.Ugarit.Constants.UIMessages.genericApiErrorMessage,clearInputOnSelection:!1,allowCreateOrganization:!0,createNewLinkText:"Create a new one",displayOtherOptions:!0,displaySuggestions:!1,maxNumberOfSuggestionToDisplay:10,millisecondsToShowCreateNew:2e3,onSuggestionsLoaded:null,onSuggestionsLoadingFail:null,onSelectedOrganizationChanged:null,onCreatingOrganization:null,onSelectingOtherOption:null,defaultCreateOrganization:{shadowSave:!1,title:"Add new organization",onOrganizationCreated:null,onOrganizationCreationError:null},defaultCommonOrganization:{title:"No current affiliation",onOrganizationSelected:null,onOrganizationSelectionCancelled:null}},ot="",st=!1,ht="",b=w.allowCreateOrganization,ct=w.createNewLinkText,y=!1,k=!1,lt=0,h=!0,at=0,d=!1,vt=null,yt=null,pt="",e=null,u={},r={},g="",p=null,i={pluginContainer:null,creationFormContainer:null,inputText:null,infoElement:null,errorContainer:null,spinerContainer:null,suggestionContainer:null,otherContainer:null,noResult:null,linkCreateNew:null,linkOtherOption:null,eraseInputElement:null},nt={suggestionItemHtml:null,otherItemHtml:null};t.onSuggestionsLoaded=null;t.onSuggestionsLoadingFail=null;t.onSelectedOrganizationChanged=null;t.onCreatingOrganization=null;t.onOrganizationCreated=null;t.onOrganizationCreationError=null;t.onCommonOrganizationSelected=null;t.onCommonOrganizationSelectionCancelled=null;t.lastSuggestions=[];t.inputTextValue=function(n){return"string"==typeof n&&(g=n,i.inputText.val(n)),g};t.selectedSuggestion=function(n,i){return void 0!==n&&p!==n&&(p=n,"function"==typeof t.onSelectedOrganizationChanged&&t.onSelectedOrganizationChanged(p,i)),p};t.hide=function(){r.showPluginContainer(!1)};t.show=function(){r.showPluginContainer(!0)};t.disableSuggestions=function(){f();y=!0};t.enableSuggestions=function(){f();y=!1};t.clearInput=function(n){n="boolean"!=typeof n||n;t.inputTextValue("");r.showEraseIcon(!1);t.selectedSuggestion(null);n&&l()};t.selectSuggestion=function(n,i){void 0!==typeof n.id&&(void 0===n.city&&(n.city=null),void 0===n.country&&(n.country=null),t.selectedSuggestion(n,i),t.inputTextValue(n.name));f();!0===st&&t.clearInput(!1)};t.showOtherOptions=function(){f();r.showOtherOptions(!0)};t.showCreateOrganizationForm=function(n){d=n;dt()};t.triggerSearch=function(){l()};u={showPlugin:!0,showEraseIcon:!1,showUsageInfo:!1,showSpinner:!1,showSuggestions:!1,showEmptyCase:!1,showOtherOptions:!1,showError:!1};r={showPluginContainer:function(n){return"boolean"==typeof n&&(u.showPlugin=n,n?i.pluginContainer.show():i.pluginContainer.hide()),u.showPlugin},showEraseIcon:function(n){return"boolean"==typeof n&&(u.showEraseIcon=n,n?i.eraseInputElement.show():i.eraseInputElement.hide()),u.showEraseIcon},showUsageInfo:function(n){return h||(n=!1),"boolean"==typeof n&&(u.showUsageInfo=n,n?i.infoElement.show():i.infoElement.hide()),u.showUsageInfo},showSpinner:function(n){return h||(n=!1),"boolean"==typeof n&&(u.showSpinner=n,n?i.spinerContainer.show():i.spinerContainer.hide()),u.showSpinner},showSuggestions:function(n){return"boolean"==typeof n&&u.showSuggestions!==n&&(u.showSuggestions=n,n?(i.suggestionContainer.show(),$(document).on("keydown",gt),i.suggestionContainer.animate({scrollTop:0},0)):(i.suggestionContainer.hide(),$(document).off("keydown",gt))),u.showSuggestions},showEmptyCase:function(n){return"boolean"==typeof n&&(u.showEmptyCase=n,n?i.noResult.show():i.noResult.hide()),u.showEmptyCase},showOtherOptions:function(n){return"boolean"==typeof n&&(u.showOtherOptions=n,n?i.otherContainer.show():i.otherContainer.hide()),u.showOtherOptions},showError:function(n){return"boolean"==typeof n&&(u.showError=n,n?i.errorContainer.show():i.errorContainer.hide()),u.showError}},function(){s=Frontiers.Ugarit.Common.Configuration.generateUUID();v=!1;var o,c,a,e,u=jQuery.extend(!0,{},w,n);!function(n){if("string"!=typeof n.inputTextElementId)throw new Error("options.inputTextElementId must be an string.");if(0===$("#"+n.inputTextElementId).length)throw new Error("Element '"+n.inputTextElementId+"' not found.");if("number"!=typeof n.millisecondsToShowCreateNew)throw new Error("options.millisecondsToShowCreateNew must be a number.");if("number"!=typeof n.maxNumberOfSuggestionToDisplay)throw new Error("options.maxNumberOfSuggestionToDisplay must be a number.");if(n.maxNumberOfSuggestionToDisplay<1||n.maxNumberOfSuggestionToDisplay>100)throw new Error("options.maxNumberOfSuggestionToDisplay must be a number between 1 and 100.");if("boolean"!=typeof n.allowCreateOrganization)throw new Error("options.allowCreateOrganization must be boolean.");if("boolean"!=typeof n.displayOtherOptions)throw new Error("options.displayOtherOptions must be boolean.");if("boolean"!=typeof n.defaultCreateOrganization.shadowSave)throw new Error("options.defaultCreateOrganization.shadowSave must be boolean.");}(u);ot="#"+u.inputTextElementId;st=u.clearInputOnSelection;ht=u.errorApiMessage;b=u.allowCreateOrganization;ct=u.createNewLinkText;k=u.displayOtherOptions;lt=u.maxNumberOfSuggestionToDisplay;h=u.displaySuggestions;at=u.millisecondsToShowCreateNew;pt="."+u.suggestionElementSelector;t.onSuggestionsLoaded=u.onSuggestionsLoaded;t.onSuggestionsLoadingFail=u.onSuggestionsLoadingFail;t.onSelectedOrganizationChanged=u.onSelectedOrganizationChanged;t.onCreatingOrganization=u.onCreatingOrganization;t.onSelectingOtherOption=u.onSelectingOtherOption;d=u.defaultCreateOrganization.shadowSave;vt=u.defaultCreateOrganization.title;t.onOrganizationCreated=u.defaultCreateOrganization.onOrganizationCreated;t.onOrganizationCreationError=u.defaultCreateOrganization.onOrganizationCreationError;yt=u.defaultCommonOrganization.title;t.onCommonOrganizationSelected=u.defaultCommonOrganization.onOrganizationSelected;t.onCommonOrganizationSelectionCancelled=u.defaultCommonOrganization.onOrganizationSelectionCancelled;$("html").on("click",function(n){!0===r.showPluginContainer()&&($(n.target).closest("#"+s).length||f())}),function(){var n=$($("#default-suggestion-plugin-template").html());nt.suggestionItemHtml=$("#default-suggestion-list-item-template").html();nt.otherItemHtml=$("#default-other-list-item-template").html();i.inputText=$(ot);i.inputText.attr("autocomplete","off");i.eraseInputElement=$($("#erase-input-template").html());i.infoElement=n.find(".info");i.errorContainer=n.find(".error-container");i.errorContainer.find(".form-validator-warning").text(ht);i.spinerContainer=n.find(".spinner-container");i.suggestionContainer=n.find(".suggestion-container");i.suggestionContainer.hide();i.otherContainer=n.find(".other-options-container");i.noResult=n.find(".no-result");i.linkCreateNew=n.find(".create-organization");i.linkOtherOption=n.find(".common-organization");i.eraseInputElement.click(t.clearInput);i.linkCreateNew.text(b?ct:"Contact support");i.linkCreateNew.click(dt);i.linkOtherOption.click(ti);k||(i.noResult.find(".separator").css("display","none"),i.linkOtherOption.css("display","none"));i.inputText.wrap("<div id='plugin-container'><\/div>");i.inputText.before(i.eraseInputElement);i.inputText.after(n);i.pluginContainer=i.inputText.parent();i.pluginContainer.wrap("<div id='"+s+"' class='plugin-organization'><\/div>");f();i.inputText.bind("keyup",ri);i.inputText.bind("focus",l);ni();window.addEventListener("resize",ni);rt()&&tt()}();o=ii;c=300;ut=function(){var n,t=this,i=arguments;n=a&&!e;clearTimeout(e);e=setTimeout(function(){e=null;a||o.apply(t,i)},c);n&&o.apply(t,i)}}()}}])