UNPKG

@telsystems/common

Version:
1 lines 69.9 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@telsystems/design"),require("@telsystems/helpers"),require("@telsystems/inputs"),require("classnames"),require("lodash/cloneDeep"),require("prop-types")):"function"==typeof define&&define.amd?define(["@telsystems/design","@telsystems/helpers","@telsystems/inputs","classnames","lodash/cloneDeep","prop-types"],e):"object"==typeof exports?exports.main=e(require("@telsystems/design"),require("@telsystems/helpers"),require("@telsystems/inputs"),require("classnames"),require("lodash/cloneDeep"),require("prop-types")):t.main=e(t["@telsystems/design"],t["@telsystems/helpers"],t["@telsystems/inputs"],t.classnames,t["lodash/cloneDeep"],t["prop-types"])}(this,function(t,e,r,n,o,i){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=17)}([function(t,e,r){t.exports=r(6)(2)},function(e,r){e.exports=t},function(t,e,r){t.exports=r(6)(74)},function(t,e,r){t.exports=r(6)(615)},function(t,r){t.exports=e},function(t,e){t.exports=r},function(t,e){t.exports=vendor},function(t,e){t.exports=n},function(t,e,r){t.exports=r(6)(278)},function(t,e,r){t.exports=r(6)(128)},function(t,e,r){"use strict";t.exports=function(t){return null!==t&&"object"==typeof t}},function(t,e){t.exports=o},function(t,e,r){var n;"undefined"!=typeof window?n=window:"undefined"!=typeof self?n=self:(console.warn("Using browser-only version of superagent in non-browser environment"),n=this);var o=r(18),i=r(19),s=r(10),a=r(20),u=r(22);function c(){}var l=e=t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1==arguments.length?new e.Request("GET",t):new e.Request(t,r)};e.Request=m,l.getXHR=function(){if(!(!n.XMLHttpRequest||n.location&&"file:"==n.location.protocol&&n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function f(t){if(!s(t))return t;var e=[];for(var r in t)d(e,r,t[r]);return e.join("&")}function d(t,e,r){if(null!=r)if(Array.isArray(r))r.forEach(function(r){d(t,e,r)});else if(s(r))for(var n in r)d(t,e+"["+n+"]",r[n]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(r));else null===r&&t.push(encodeURIComponent(e))}function h(t){for(var e,r,n={},o=t.split("&"),i=0,s=o.length;i<s;++i)-1==(r=(e=o[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function y(t){return/[\/+]json($|[^-\w])/.test(t)}function _(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.header=this.headers=function(t){for(var e,r,n,o,i=t.split(/\r?\n/),s={},a=0,u=i.length;a<u;++a)-1!==(e=(r=i[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),o=p(r.slice(e+1)),s[n]=o);return s}(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function m(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",function(){var t,e=null,n=null;try{n=new _(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)})}function g(t,e,r){var n=l("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}l.serializeObject=f,l.parseString=h,l.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},l.serialize={"application/x-www-form-urlencoded":f,"application/json":JSON.stringify},l.parse={"application/x-www-form-urlencoded":h,"application/json":JSON.parse},a(_.prototype),_.prototype._parseBody=function(t){var e=l.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&y(this.type)&&(e=l.parse["application/json"]),e&&t&&(t.length||t instanceof Object)?e(t):null)},_.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot "+e+" "+r+" ("+this.status+")",o=new Error(n);return o.status=this.status,o.method=e,o.url=r,o},l.Response=_,o(m.prototype),i(m.prototype),m.prototype.type=function(t){return this.set("Content-Type",l.types[t]||t),this},m.prototype.accept=function(t){return this.set("Accept",l.types[t]||t),this},m.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"==typeof e&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});return this._auth(t,e,r,function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")})},m.prototype.query=function(t){return"string"!=typeof t&&(t=f(t)),t&&this._query.push(t),this},m.prototype.attach=function(t,e,r){if(e){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},m.prototype._getFormData=function(){return this._formData||(this._formData=new n.FormData),this._formData},m.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},m.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},m.prototype.buffer=m.prototype.ca=m.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},m.prototype.pipe=m.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},m.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},m.prototype.end=function(t){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||c,this._finalizeQueryString(),this._end()},m.prototype._end=function(){var t=this,e=this.xhr=l.getXHR(),r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4==r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.onprogress=n.bind(null,"download"),e.upload&&(e.upload.onprogress=n.bind(null,"upload"))}catch(t){}try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||l.serialize[o?o.split(";")[0]:""];!i&&y(o)&&(i=l.serialize["application/json"]),i&&(r=i(r))}for(var s in this.header)null!=this.header[s]&&this.header.hasOwnProperty(s)&&e.setRequestHeader(s,this.header[s]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==r?r:null),this},l.agent=function(){return new u},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){u.prototype[t.toLowerCase()]=function(e,r){var n=new l.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}}),u.prototype.del=u.prototype.delete,l.get=function(t,e,r){var n=l("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},l.head=function(t,e,r){var n=l("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},l.options=function(t,e,r){var n=l("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.del=g,l.delete=g,l.patch=function(t,e,r){var n=l("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.post=function(t,e,r){var n=l("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.put=function(t,e,r){var n=l("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e,r){t.exports=r(6)(466)},function(t){t.exports={domain:{objects:{sipuser:"Учетные записи SIP",provider:"Операторы SIP телефонии",route:"Маршрутизация. Выбор вектора",vectorrule:"Маршрутизация. Внутри вектора",featurecode:"Коды абонентских функций",redirect_rule:"Переадресация. Правила",redirect_activity:"Переадресация. Активность",group:"Групповые номера",provider_callerid:"Нормализация CallerID внешних линий",representative:"Нормализация CallerID между ТД",svcscript:"Служебные сценарии",svctask:"Cron запуска служебных сценариев",ivrscript:"IVR сценарии",chatbotscript:"ICR сценарии",chatcampaign:"ICR кампания",user:"Пользователь",hunt:"Очереди",addressbook:"Адресная книга",workday:"Рабочее расписание",domain:"Дочерние КД",settings:"Настройки",report:"Система отчетности",dbproc:"Сбор данных для отчетности",project:"Проекты сценариев",domain_user:"Пользователи дочерних КД"},route:{"dir___*":"*",dir___inner:"Внутренние SIP абоненты",dir___outer:"Внешние SIP операторы",dir___cross:"Другие КД"},vectorrule:{action___denied:"Запретить вызов",action___external:"На внешнего SIP оператора",action___internal:"На внутреннего SIP абонента",action___internalpbx:"На абонента за IP-АТС",action___crossdomain:"В другой КД",action___featurecode:"Код абонентских функций","dir___*":"*",dir___inner:"Внутренние SIP абоненты",dir___outer:"Внешние SIP операторы",dir___cross:"Другие КД"},featurecode:{type___conference:"Конференция",type___pickup:"Перехват звонка",type___grouppickup:"Перехват звонка по групповым номерам",type___ivr:"Сценарий IVR",type___voicemail:"Голосовая почта",type___voicemail_send:"Отправка голосовой почты",type___parking:"Парковка",type___parking_get:"Взятие с парковки",type___intercom:"Интерком",type___barge:"Вторжение"},redirect_activity:{type___absolute:"Безусловная",type___unregistered:"Нет регистрации",type___busy:"Занято",type___timeout:"Нет ответа",type___decline:"Отклонено",type___dnd:"Режим DND",type___error:"Ошибка вызова",type___other:"Другая причина"},provider_callerid:{dir___inner:"Исходящий на внешнюю линию",dir___outer:"Входящий с внешней линии"},representative:{"dir___*":"*",dir___inner:"Исходящий из текущего КД",dir___global:"Скрыть",dir___cross:"Входящий в текущий КД"}},masterDomain:{objects:{sipuser:"Учетные записи SIP",provider:"Операторы SIP телефонии",route:"Маршрутизация. Выбор вектора",vectorrule:"Маршрутизация. Внутри вектора",featurecode:"Коды абонентских функций",redirect_rule:"Переадресация. Правила",redirect_activity:"Переадресация. Активность",group:"Групповые номера",provider_callerid:"Нормализация CallerID внешних линий",representative:"Нормализация CallerID между ТД",svcscript:"Служебные сценарии",svctask:"Cron запуска служебных сценариев",ivrscript:"IVR сценарии",chatbotscript:"ICR сценарии",chatcampaign:"ICR кампания",user:"Системные учетные записи",hunt:"Очереди",addressbook:"Адресная книга",workday:"Рабочее расписание",domain:"КД уровня L1",settings:"Общие настройки",borderrule:"Правила пограничного контроля (SBC)",report:"Система отчетности",dbproc:"Сбор данных для отчетности",domain_user:"Пользователи дочерних КД"}}}},function(t,e,r){t.exports=r(6)(467)},function(t,e,r){t.exports=r(6)(469)},function(t,e,r){t.exports=r(24)},function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks["$"+t];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e);return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,r){"use strict";var n=r(10);function o(t){if(t)return function(t){for(var e in o.prototype)t[e]=o.prototype[e];return t}(t)}t.exports=o,o.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},o.prototype.parse=function(t){return this._parser=t,this},o.prototype.responseType=function(t){return this._responseType=t,this},o.prototype.serialize=function(t){return this._serializer=t,this},o.prototype.timeout=function(t){if(!t||"object"!=typeof t)return this._timeout=t,this._responseTimeout=0,this;for(var e in t)switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;default:console.warn("Unknown timeout option",e)}return this},o.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var i=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];o.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!=e.status)return!0;if(t){if(t.code&&~i.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},o.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},o.prototype.then=function(t,e){if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(t,e){r.end(function(r,n){r?e(r):t(n)})})}return this._fullfilledPromise.then(t,e)},o.prototype.catch=function(t){return this.then(void 0,t)},o.prototype.use=function(t){return t(this),this},o.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},o.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},o.prototype.get=function(t){return this._header[t.toLowerCase()]},o.prototype.getHeader=o.prototype.get,o.prototype.set=function(t,e){if(n(t)){for(var r in t)this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},o.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},o.prototype.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),n(t)){for(var r in t)this.field(r,t[r]);return this}if(Array.isArray(e)){for(var o in e)this.field(t,e[o]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},o.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},o.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic "+n(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},o.prototype.withCredentials=function(t){return void 0==t&&(t=!0),this._withCredentials=t,this},o.prototype.redirects=function(t){return this._maxRedirects=t,this},o.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},o.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},o.prototype.send=function(t){var e=n(t),r=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&n(this._data))for(var o in t)this._data[o]=t[o];else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"==r?this._data?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(r||this.type("json"),this)},o.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},o.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.substring(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,e)+"?"+r.join("&")}}},o.prototype._appendQueryString=function(){console.trace("Unsupported")},o.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error(t+e+"ms exceeded");n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},o.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(t,e,r){"use strict";var n=r(21);function o(t){if(t)return function(t){for(var e in o.prototype)t[e]=o.prototype[e];return t}(t)}t.exports=o,o.prototype.get=function(t){return this.header[t.toLowerCase()]},o.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var o in r)this[o]=r[o];this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},o.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.created=201==t,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t,this.unprocessableEntity=422==t}},function(t,e,r){"use strict";e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce(function(t,e){var r=e.split(/ *= */),n=r.shift(),o=r.shift();return n&&o&&(t[n]=o),t},{})},e.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t},{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},function(t,e){function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(t){r.prototype[t]=function(){return this._defaults.push({fn:t,arguments:arguments}),this}}),r.prototype._setDefaults=function(t){this._defaults.forEach(function(e){t[e.fn].apply(t,e.arguments)})},t.exports=r},function(t,e){t.exports=i},function(t,e,r){"use strict";r.r(e);var n,o=r(3),i=r.n(o),s=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r},u=function(t){function e(e,r){void 0===r&&(r={});var n=t.call(this,e,r)||this,o=n.cleanExtraProps(n.getState());return n.update(o),n}return s(e,t),e.prototype.cleanExtraProps=function(t){t.__waiting,t.__failed;return a(t,["__waiting","__failed"])},e}(i.a.Model),c=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(u),p=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e.Model=l,e}(i.a.Collection),d=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),h=function(){return(h=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){function e(e,r,n){var o,i,s=t.call(this,e,r,n)||this,a=s.storeKey;if(e){if(!a){var u="storeKey must be defined to use model in "+s.constructor.name;throw console.error(u),new Error(u)}s.model=new e(r[a]),s.currentProps=h({},r,((o={})[a]=e.defaults,o)),s.nextProps=h({},r,((i={})[a]=e.defaults,i))}return s}return d(e,t),e.prototype.componentWillReceiveProps=function(t,e){var r=this.storeKey;this.currentProps=t,this.nextProps=e,this.model&&this.model.updateProps(t[r],e[r])},e}(i.a.Controller),_=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e}(u);!function(t){t.ADMIN="admin",t.AUTO_PROVISION="autoprovision",t.CFG="cfg",t.CHAT_AGENT="chatagent",t.MONITOR="monitor",t.SITEMONITOR="sitemonitor",t.SCRIPT_EDITOR="scripteditor",t.SELECTOR="selector",t.STAT="stat",t.WEB_API="webapi"}(n||(n={}));var g=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getUserInfo=function(){var t=this.getState();return{login:t.login,name:t.name,name_login:t.name_login}},e.prototype.isMasterDomain=function(){return this.getState().td_is_master},e.prototype.getMonitorRights=function(){if(this.isMasterDomain()){var t=this.getState().rights;return t.includes(n.MONITOR)?n.MONITOR:t.includes(n.SITEMONITOR)?n.SITEMONITOR:null}return null},e}(u),b=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),O=function(t){function e(r,n){void 0===n&&(n={});var o=t.call(this,r,n)||this;return o.update(Object.assign({},e.defaults,r)),o}return b(e,t),e.prototype.saveExtProp=function(t,e,r){var n=this.getState().ext;n[t]=n[t]||{},n[t][e]=r,this.update({ext:n})},e.prototype.getExtProp=function(t){return this.getState().ext[t]},e.prototype.savePreset=function(t){var e=this.getState().ext;e.presets||(e.presets=[]),e.presets.push(t),this.update({ext:e})},e.prototype.deletePreset=function(t){var e=this.getState().ext;if(e.presets){var r=e.presets.findIndex(function(e){return e.name===t});r>-1&&(e.presets.splice(r,1),this.update({ext:e}))}},e.prototype.getPresets=function(){var t=this.getState().ext;return t.presets?t.presets:[]},e.prototype.isAdmin=function(){return this.getState().rights.includes("admin")},e.defaults={login:"",name:"",ext:{},id:"",opts:{chat_dlg_limit:1,chat_dlg_mode:0,chat_full_limit:0,comment:"",tags:[]},pwd:"",rights:"",timezone:""},e}(u),w=r(11),E=r.n(w),P=r(4),T=function(){return(T=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function S(t,e,r){return T({},r,{value:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=t.data,i=t.resultcode,s=t.resultmsg,a={result:o,error:0!==i?{code:i,message:s}:null};return r.value.apply(this,[a].concat(e))}})}r(12);var j=r(2),R=function(){return(R=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},x="ERROR@ERROR_HANDLER",D={statusCode:null,statusText:null,body:null,showErrorModal:!1};Object(j.applyReducer)("handlingErrors",function(t,e){void 0===t&&(t=D);var r=e.statusCode,n=e.type,o=e.statusText,i=e.body;switch(n){case x:return R({},t,{statusCode:r,statusText:o,body:i,showErrorModal:!0});case"ERROR@CLOSE_ERROR_MODAL":return R({},t,{showErrorModal:!1});default:return t}});var A=function(t){var e=t.body,r=t.statusText,n=t.statusCode;return{type:x,body:e,statusCode:n,statusText:r}},C=r(9),I=r(13);function N(t){var e=t.data,r=t.requestHelper,n=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||C.compose,o=[Object(j.middleware)(r)],i=Object(j.combine)({routing:I.routerReducer});return n(C.applyMiddleware.apply(void 0,o))(C.createStore)(i,e)}var k=r(14),L=function(){function t(){this.isMasertDomain=!1}return t.prototype.translateSideBar=function(t){var e=this.getDictionary().objects;return e&&e[t]?e[t]:this.getOriginalId(t)},t.prototype.translateFormField=function(t){var e=this.getDictionary()[this.objectName];return e&&e[t]?e[t]:this.getOriginalId(t)},t.prototype.setIsMasterDomain=function(t){this.isMasertDomain=t,this.setDictionary(k[t?"masterDomain":"domain"])},t.prototype.setObjectName=function(t){this.objectName=t},t.prototype.setDictionary=function(t){this.dictionary=t},t.prototype.getDictionary=function(){return this.dictionary},t.prototype.getOriginalId=function(t){return t.split("___").slice(-1)[0]},t}(),M=new L;function W(t){if(0===t.resultcode)return t;throw t}function U(t){var e=t.resultcode,r=t.resultmsg;return 1407===e&&r.includes("Session not found")}function F(t){return"/api/"+t}function q(){var t=document.getElementById("root");t&&t.classList.remove("invisible")}function K(){var t=document.getElementById("initial-display-rule");t&&t.remove()}function H(t,e,r){var n=r||"td=foobar.webdev.rostell.ru&login=admin5&pwd=admin5";return F(e?t+"&"+n:t+"?"+n)}function z(t,e,r){var n=r||"td=webdev.rostell.ru&login=admin5&pwd=admin5";return F(e?t+"&"+n:t+"?"+n)}function G(t){var e=t;return t instanceof Error&&(e={message:t.message,stack:t.stack}),Object.assign({},{timestamp:(new Date).getTime(),responseTimestamp:void 0,message:"",meta:"",stack:"",type:void 0,details:""},e)}var B,X=function(){return(X=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function V(t){this.message=t.toString(),this.name="Promise unhandled error",this.stack=t.stack}V.prototype.toString=function(){return this.message};var $=function(){return($=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function J(t,e,r){return $({},r,{value:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=function(t){var e={statusCode:t&&t.status?t.status:0,statusText:t.error||"Error",body:t.message||JSON.stringify(t)};if(t.errorDetails&&t.errorDetails.detail&&t.errorDetails.status&&t.errorDetails.title&&(e.statusCode=t.errorDetails.status,e.statusText=t.errorDetails.title,e.body=t.errorDetails.detail,t.errorMessages&&t.errorMessages.length)){var r=t.errorMessages.map(function(t){return t.field+": "+t.message}).join("; ");e.body+=": "+r}return t instanceof Error&&(e.statusText=t.message,e.body=t.stack||""),$({},e)}(t);return function(t){setTimeout(function(){B.dispatch(A(X({},t)))},1)}(o),r.value.apply(this,[{error:o,origError:t}].concat(e))}})}var Q=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Z=function(){return(Z=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Y=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},tt=function(t){function e(e,r){var n=t.call(this,e,r)||this,o=n.getState();return n.updateProps(o,o),n}return Q(e,t),e.prototype.createDefaults=function(){var t={};return this.constructor.defaults&&(t=Object.assign({},t,this.constructor.defaults)),Object.assign({},this.getState(),t)},e.prototype.resetWaiting=function(t){return void 0===t&&(t=this.currentAction),this.set("__waiting."+t,!1),this},e.prototype.reset=function(t){return this.state=Object.assign({},{__waiting:{},__failed:{}},E()(t)),this},e.prototype.isWaiting=function(t){var e=!1;return e=t?!!this.getState().__waiting[t]:!!Object.entries(this.getState().__waiting).find(function(t){t[0];return!0===t[1]}),!this.isActionFulfilled(t)&&e},e.prototype.isFailed=function(t){var e=!1;return e=t?!!this.getState().__failed[t]:!!Object.entries(this.getState().__failed).find(function(t){t[0];return!0===t[1]}),this.isActionFulfilled(t)&&e},e.prototype.updateProps=function(t,e){this.lastProps=t,this.currentProps=e,this.reset(e)},e.prototype.diff=function(t){return t?P.common.diff(this.lastProps[t],this.currentProps[t]):P.common.diff(this.lastProps,this.currentProps)},e.prototype.isEqual=function(t){return Object.keys(this.diff(t)).length>0},e.prototype.getLastProp=function(t){return this.lastProps[t]},e.prototype.isActionFulfilled=function(t){var e=!1,r=!1;if(t)e=this.getLastProp("__waiting")[t],r=this.getWaiting(t);else{var n=this.getLastProp("__waiting"),o=this.getWaiting();e=!!Object.keys(n).find(function(t){return n[t]}),r=!!Object.keys(o).find(function(t){return o[t]})}return e&&!r},e.prototype.setActionToWaiting=function(t,e){return void 0===t&&(t=this.currentAction),void 0===e&&(e={}),this.setWaiting(t).update(Z({error:null},e)).resetFailed(t).getState()},e.prototype.setActionToFailed=function(t,e){var r=t.error;t.origError;return void 0===e&&(e=this.currentAction),this.resetWaiting(e).update({error:r}).setFailed(e).getState()},e.prototype.onInit=function(){return this.currentAction=this.options.action,this},Y([J],e.prototype,"setActionToFailed",null),e}(i.a.Model),et=r(0),rt=r(7),nt=r.n(rt),ot=r(25),it=r.n(ot),st=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return st(e,t),e.prototype.render=function(){var t=this.props,e=t.children,r=t.className;return et.createElement("div",{className:nt()(it.a.container,r)},e)},e}(et.PureComponent),ut=r(30),ct=r.n(ut),lt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lt(e,t),e.prototype.render=function(){var t=this.props,e=t.children,r=t.horizontal,n=t.vertical,o=t.className,i=r?ct.a.horizontal:"",s=n?ct.a.vertical:"";return et.createElement("div",{className:nt()(ct.a.centered,i,s,o)},e)},e.defaultProps={children:et.createElement("div",null),vertical:!0,horizontal:!0},e}(et.Component),ft=(r(23),"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0);function dt(t,e,r){t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent&&t.attachEvent("on"+e,function(){r(window.event)})}function ht(t,e){for(var r=e.slice(0,e.length-1),n=0;n<r.length;n++)r[n]=t[r[n].toLowerCase()];return r}function yt(t){t||(t="");for(var e=(t=t.replace(/\s/g,"")).split(","),r=e.lastIndexOf("");r>=0;)e[r-1]+=",",e.splice(r,1),r=e.lastIndexOf("");return e}function _t(t,e){for(var r=t.length>=e.length?t:e,n=t.length>=e.length?e:t,o=!0,i=0;i<r.length;i++)-1===n.indexOf(r[i])&&(o=!1);return o}for(var mt={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ft?173:189,"=":ft?61:187,";":ft?59:186,"'":222,"[":219,"]":221,"\\":220},gt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":ft?224:91,cmd:ft?224:91,command:ft?224:91},vt=[],bt={16:"shiftKey",18:"altKey",17:"ctrlKey"},Ot={16:!1,18:!1,17:!1},wt={},Et=1;Et<20;Et++)mt["f"+Et]=111+Et;bt[ft?224:91]="metaKey",Ot[ft?224:91]=!1;var Pt="all",Tt=!1,St=function(t){return mt[t.toLowerCase()]||gt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function jt(t){Pt=t||"all"}function Rt(){return Pt||"all"}function xt(t,e,r){var n=void 0;if(e.scope===r||"all"===e.scope){for(var o in n=e.mods.length>0,Ot)Object.prototype.hasOwnProperty.call(Ot,o)&&(!Ot[o]&&e.mods.indexOf(+o)>-1||Ot[o]&&-1===e.mods.indexOf(+o))&&(n=!1);(0!==e.mods.length||Ot[16]||Ot[18]||Ot[17]||Ot[91])&&!n&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function Dt(t,e,r){var n=yt(t),o=[],i="all",s=document,a=0;for(void 0===r&&"function"==typeof e&&(r=e),"[object Object]"===Object.prototype.toString.call(e)&&(e.scope&&(i=e.scope),e.element&&(s=e.element)),"string"==typeof e&&(i=e);a<n.length;a++)o=[],(t=n[a].split("+")).length>1&&(o=ht(gt,t)),(t="*"===(t=t[t.length-1])?"*":St(t))in wt||(wt[t]=[]),wt[t].push({scope:i,mods:o,shortcut:n[a],method:r,key:n[a]});void 0===s||Tt||(Tt=!0,dt(s,"keydown",function(t){!function(t){var e=wt["*"],r=t.keyCode||t.which||t.charCode;if(-1===vt.indexOf(r)&&vt.push(r),93!==r&&224!==r||(r=91),r in Ot){for(var n in Ot[r]=!0,gt)gt[n]===r&&(Dt[n]=!0);if(!e)return}for(var o in Ot)Object.prototype.hasOwnProperty.call(Ot,o)&&(Ot[o]=t[bt[o]]);if(Dt.filter.call(this,t)){var i=Rt();if(e)for(var s=0;s<e.length;s++)e[s].scope===i&&xt(t,e[s],i);if(r in wt)for(var a=0;a<wt[r].length;a++)xt(t,wt[r][a],i)}}(t)}),dt(s,"keyup",function(t){!function(t){var e=t.keyCode||t.which||t.charCode,r=vt.indexOf(e);if(r>=0&&vt.splice(r,1),93!==e&&224!==e||(e=91),e in Ot)for(var n in Ot[e]=!1,gt)gt[n]===e&&(Dt[n]=!1)}(t)}))}var At={setScope:jt,getScope:Rt,deleteScope:function(t,e){var r=void 0,n=void 0;for(var o in t||(t=Rt()),wt)if(Object.prototype.hasOwnProperty.call(wt,o))for(r=wt[o],n=0;n<r.length;)r[n].scope===t?r.splice(n,1):n++;Rt()===t&&jt(e||"all")},getPressedKeyCodes:function(){return vt.slice(0)},isPressed:function(t){return"string"==typeof t&&(t=St(t)),-1!==vt.indexOf(t)},filter:function(t){var e=t.target||t.srcElement,r=e.tagName;return!("INPUT"===r||"SELECT"===r||"TEXTAREA"===r||e.isContentEditable)},unbind:function(t,e){for(var r=yt(t),n=void 0,o=[],i=void 0,s=0;s<r.length;s++){if((n=r[s].split("+")).length>1&&(o=ht(gt,n)),t="*"===(t=n[n.length-1])?"*":St(t),e||(e=Rt()),!wt[t])return;for(var a=0;a<wt[t].length;a++)(i=wt[t][a]).scope===e&&_t(i.mods,o)&&(wt[t][a]={})}}};for(var Ct in At)Object.prototype.hasOwnProperty.call(At,Ct)&&(Dt[Ct]=At[Ct]);if("undefined"!=typeof window){var It=window.hotkeys;Dt.noConflict=function(t){return t&&window.hotkeys===Dt&&(window.hotkeys=It),Dt},window.hotkeys=Dt}var Nt=Dt;Nt.filter=function(t){var e=(t.target||t.srcElement).tagName;return Nt.setScope(/^(INPUT|TEXTAREA|SELECT)$/.test(e)?"input":"other"),!0};var kt=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return n.onKeyDown=n.onKeyDown.bind(n),n.onKeyUp=n.onKeyUp.bind(n),n.handleKeyUpEvent=n.handleKeyUpEvent.bind(n),n.isKeyDown=!1,n.handle={},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){Nt.unbind(this.props.keyName),Nt(this.props.keyName,this.onKeyDown),document.addEventListener("keyup",this.handleKeyUpEvent)},e.prototype.componentWillUnmount=function(){Nt.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document.removeEventListener("keyup",this.handleKeyUpEvent)},e.prototype.onKeyUp=function(t,e){var r=this.props.onKeyUp;r(e.shortcut,t,e)},e.prototype.onKeyDown=function(t,e){var r=this.props.onKeyDown;this.isKeyDown||(this.isKeyDown=!0,this.handle=e,r(e.shortcut,t,e))},e.prototype.handleKeyUpEvent=function(t){this.isKeyDown&&(this.isKeyDown=!1,this.props.keyName.indexOf(this.handle.shortcut)<0||(this.onKeyUp(t,this.handle),this.handle={}))},e.prototype.render=function(){return this.props.children||null},e}(et.Component);kt.propTypes={},kt.defaultProps={onKeyUp:function(){},onKeyDown:function(){}};var Lt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Lt(e,t),e.prototype.render=function(){var t=this.props,e=t.onKeyDown,r=t.onKeyUp,n=t.keyName,o=t.children;return et.createElement(kt,{keyName:n.join(", "),onKeyDown:e,onKeyUp:r},o)},e}(et.Component);function Wt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.join("+")}var Ut,Ft,qt=Wt("alt","enter"),Kt=Wt("ctrl","enter"),Ht=Wt("shift","ctrl"),zt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gt=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zt(e,t),e.prototype.onLoadSuccess=function(t){var e=t.result;return this.update({data:e}).getState()},e.defaults={data:[],isWaiting:!1,error:null},Gt([S],e.prototype,"onLoadSuccess",null),e}(tt),Xt=function(){return(Xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vt="domains",$t=Object.assign({},Bt.defaults),Jt=Vt+"@@LOAD",Qt=Vt+"@@CHANGE_DOMAIN",Zt=Object(j.createActions)({storeKey:Vt,initialState:$t,actions:(Ut={},Ut[Jt]={action:function(){return{promise:function(t){return t(F("auth/v1/domains")).get({})}}},handlers:{onWait:function(t){return new Bt(t,{currentAction:Jt}).setActionToWaiting()},onFail:function(t,e){var r=e.error;return new Bt(t,{currentAction:Jt}).setActionToFailed(r)},onSuccess:function(t,e){var r=e.result;return new Bt(t,{currentAction:Jt}).onLoadSuccess(r)}}},Ut[Qt]={action:function(t){return{promise:function(e){return e(F("auth/v1/chdom?domain="+t)).post({data:{domain:t}})}}},handlers:{onWait:function(t){return new Bt(t,{currentAction:Qt}).setActionToWaiting()},onFail:function(t,e){var r=e.error;return new Bt(t,{currentAction:Qt}).setActionToFailed(r)},onSuccess:function(t){return Xt({},t,{isWaiting:!1})}}},Ut)}),Yt=Zt[Jt],te=Zt[Qt],ee=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),re=function(){return(re=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ne=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ee(e,t),e.prototype.updateState=function(t){return this.update(re({},t,{isModified:!0})).getState()},e.defaults={isWaiting:!1,error:null,data:null,isAuthorized:!1},e}(tt),oe=function(){return(oe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ie={data:null,error:null,isWaiting:!1,isAuthorized:!1},se="auth/v1/info";var ae=((Ft={})["user@@LOGIN"]={action:function(t){return{promise:function(e){return e(F("auth/v1/login")).get({params:t})}}},handlers:{onWait:function(t){return oe({},t,{isWaiting:!0,error:null,data:null})},onFail:function(t,e){var r=e.error;return oe({},t,{isWaiting:!1,error:r})},onSuccess:function(t,e){var r=e.result,n=r.resultcode,o=r.resultmsg,i=r.data;return oe({},t,0!==n?{error:{code:n,message:o},isWaiting:!1}:{isWaiting:!1,data:i})}}},Ft["user@@LOGOUT"]={action:function(){return{promise:function(t){return t(F("auth/v1/logout")).get({})}}},handlers:{onWait:function(t){return t},onFail:function(t,e){e.error;return t},onSuccess:function(t){return oe({},t,{isAuthorized:!1})}}},Ft["user@@FETCH"]={action:function(){return{promise:function(t){return function(t){return new Promise(function(e,r){t(F(se)).get({params:{user:!0}}).then(function(n){if(1407===n.resultcode)return r(n);t(F(ce(n.data.id))).get({}).then(function(t){return e({info:n,userData:t})})})})}(t)}}},handlers:{onWait:function(t){return oe({},t,{error:null,isAuthorized:!1,isWaiting:!0,data:null})},onFail:function(t,e){var r=e.error;return oe({},t,{isWaiting:!1,error:r,isAuthorized:!U(r)})},onSuccess:function(t,e){var r=e.result,n=r.userData,o=n.data,i=n.resultcode,s=(n.resultmsg,r.info),a=s.data,u=s.resultcode;s.resultmsg;if(1407===i||1407===u)return oe({},t,{isWaiting:!1});new v(a);var c=Array.isArray(o)&&o.length>0&&new O(o[0]);return oe({},t,{isWaiting:!1,isAuthorized:!0,data:c?c.getState():null})}}},Ft["user@@SAVE_PROFILE_SETTINGS"]={action:function(t,e){return{promise:function(r){return r(F(le(t.id,e))).post({data:{data:t}})}}},handlers:{onWait:function(t){return new ne(t).updateState({error:null,isWaiting:!0})},onFail:function(t,e){var r=e.error;return new ne(t).updateState({isWaiting:!1,error:r})},onSuccess:function(t,e){e.result;return new ne(t).updateState({isWaiting:!1,error:null})}}},Ft),ue=Object(j.createActions)({storeKey:"user",initialState:ie,actions:ae});function ce(t){return'admin/v1/user/read/?filter={"id":"'+t+'"}'}function le(t,e){return"admin/v1/user/"+(e?"create":"update")+'?filter={"id": "'+t+'"}'}var pe,fe=ue["user@@FETCH"],de=ue["user@@LOGIN"],he=ue["user@@LOGOUT"],ye=ue["user@@SAVE_PROFILE_SETTINGS"],_e=function(){return(_e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},me="info",ge=me+"@@LOAD",ve=Object(j.createActions)({storeKey:me,initialState:{data:null,error:null,isWaiting:!1},actions:(pe={},pe[ge]={action:function(){return{promise:function(t){return t(F("auth/v1/info")).get({})}}},handlers:{onWait:function(t){return t},onFail:function(t){return _e({},t,{isWaiting:!1,error:"something wrong"})},onSuccess:function(t,e){var r=e.result,n=new v(r.data);return M.setIsMasterDomain(n.getState().td_is_master),_e({},t,{data:n.getState(),isWaiting:!1,isFailed:!1})}}},pe)}),be=ve[ge],Oe=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),we=function(t){function e(e,r){var n=t.call(this,Bt,e,r)||this;return n.changeDomain=function(t){n.action(te,t.title).then(function(){P.common.reloadPage(!0)})},n.getSelectedDomain=function(){return n.nextProps[me]&&n.nextProps[me].data?n.nextProps[me].data.td:""},n.getDomainsObject=function(){return Ee(n.nextProps[Vt].data).reduce(function(t,e){return t.push({content:{title:e}}),t},[])},n.action(Yt),n}return Oe(e,t),e.storeKey=Vt,e.Model=Bt,e.connectedState=[Vt,me],e}(y);function Ee(t){var e=Pe(t.filter(function(t){return t.is_master})),r=Pe(t.filter(function(t){return!t.i