"use strict";var MATERIAL_CATEGORY;(function(a){a.MATERIAL="\u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B",a.NEWS="\u043D\u043E\u0432\u043E\u0441\u0442\u044C",a.NOTICE="\u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435"})(MATERIAL_CATEGORY||(MATERIAL_CATEGORY={}));var MENU_CATEGORY;(function(a){a.MAIN="__main",a.TOP="__top"})(MENU_CATEGORY||(MENU_CATEGORY={}));var CLIENT_PLATFORM;(function(a){a[a.DESKTOP=9999]="DESKTOP",a[a.OLD_DESKTOP=1280]="OLD_DESKTOP",a[a.TABLET=1024]="TABLET",a[a.MOBILE=560]="MOBILE"})(CLIENT_PLATFORM||(CLIENT_PLATFORM={}));var VKKO;(function(a){var b;(function(a){function b(){document.documentElement.style.marginRight=window.innerWidth-document.documentElement.clientWidth+"px",document.documentElement.style.overflow="hidden",d++}function c(){d--,0>=d&&(document.documentElement.style.overflow="",document.documentElement.style.marginRight=null,d=0)}var d=0;a.Platform=CLIENT_PLATFORM.DESKTOP,a.BlockScroll=b;a.UnblockScroll=c})(b=a.Setting||(a.Setting={}))})(VKKO||(VKKO={}));var VKKO;(function(a){var b;(function(a){a.logError=function(a){console.log("%c ERROR ","background-color: red; color: white; font-weight: 700;",a)},a.logWarning=function(a){console.log("%c WARNING ","background-color: orange; color: white; font-weight: 700;",a)},a.logInfo=function(a){console.log("%c INFO ","background-color: green; color: white; font-weight: 700;",a)},a.GenerateHash256=function(a){void 0===a&&(a=!1);for(var b=crypto.getRandomValues(new Uint32Array(4)),c="",d=0;db;b++)a=document.createElement("div"),a.className="glob",a.setAttribute("style","--i:"+(b+1)),this.__LoadAnimationElement.append(a);document.body.append(this.__LoadAnimationElement)}}return b.prototype.onStartRequest=function(){0===this.__QueryCounter&&this.__LoadAnimationElement.classList.remove("hidden"),this.__QueryCounter++},b.prototype.onStopRequest=function(){this.__QueryCounter--,0>=this.__QueryCounter&&(this.__LoadAnimationElement.classList.add("hidden"),this.__QueryCounter=0)},b.prototype.POST=function(b,c,d,e,f,g){if(void 0===f&&(f=!0),void 0===g&&(g=!1),!c)return void a.Utils.logError("URI \u043D\u0435 \u0431\u044B\u043B \u043F\u0435\u0440\u0435\u0434\u0430\u043D");d||(d={});var h=new XMLHttpRequest;h.onloadstart=this.onStartRequest,h.onloadend=this.onStopRequest,h.onabort=function(){a.Utils.logWarning(c+" => \u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0431\u044B\u043B\u043E \u043F\u0440\u0435\u0440\u0432\u0430\u043D\u043E..."),VKKOWork.Messenger.Show("\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0431\u044B\u043B\u043E \u043F\u0440\u0435\u0440\u0432\u0430\u043D\u043E...")},h.onerror=function(){a.Utils.logError(c+" => "+this.statusText+" "+this.status),VKKOWork.Messenger.Show("\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043B\u043E\u0441\u044C \u043D\u0435\u0443\u0434\u0430\u0447\u0435\u0439. \u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443. \u0415\u0441\u043B\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F, \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0441\u043E\u043E\u0431\u0449\u0438\u0442\u0435 \u043E\u0431 \u044D\u0442\u043E\u043C \u0430\u0434\u043C\u0438\u043D\u0438\u0441\u0442\u0440\u0430\u0442\u043E\u0440\u0443 admin@ktk-45.ru")},h.ontimeout=function(){a.Utils.logError(c+" => \u0412\u0440\u0435\u043C\u044F \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0438\u0441\u0442\u0435\u043A\u043B\u043E... \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0441 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043E\u043C"),VKKOWork.Messenger.Show("\u0412\u0440\u0435\u043C\u044F \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0438\u0441\u0442\u0435\u043A\u043B\u043E... \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0441 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u043E\u043C")},h.onload=function(){a.Utils.logInfo(c+" => "+this.statusText+" "+this.status.toString());var d;try{d=JSON.parse(this.response)}catch(b){a.Utils.logError(b),d=null}return null===d?void 0:"Error"in d&&"boolean"==typeof d.Error?void VKKOWork.Messenger.Show(d.Error):void b(d,e)},h.open("POST",c,f),g?h.send(d):(h.setRequestHeader("Content-Type","application/json; charset=utf-8"),h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.send(JSON.stringify(d)))},b}();a.XHR=b})(VKKO||(VKKO={}));var VKKOWork;(function(a){a.XHR=new VKKO.XHR})(VKKOWork||(VKKOWork={}));var VKKO;(function(a){var b;(function(a){function b(a,b,c,d){void 0===c&&(c=null),void 0===d&&(d=null);var e=document.createElement("label"),f=document.createElement("input"),g=document.createElement("span"),h=document.createElement("span");if(e.className="checkbox",e.append(f,g,h),h.className="text",h.textContent=a,g.className="checked",f.type="checkbox",b){var i=document.querySelector("#"+b);if(i)return void VKKOWork.Messenger.Show("\u041D\u0435\u043B\u044C\u0437\u044F \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0441 \u043F\u043E\u0432\u0442\u043E\u0440\u044F\u044E\u0449\u0438\u043C\u0441\u044F \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u043C");f.id=b}if(c)for(var j in c)c.hasOwnProperty(j)&&(f.dataset[j]=c[j]);return d&&(f.onchange=d),e}a.CreateCheckbox=b})(b=a.Control||(a.Control={}))})(VKKO||(VKKO={}));var VKKO;(function(a){var b;(function(b){function c(b,c,f){var g;if(0===e?(g=document.createElement("div"),g.className="backdrop-container",document.body.append(g),a.Setting.BlockScroll()):g=document.querySelector(".backdrop-container"),null==g)return void VKKOWork.Messenger.Show("\u041E\u0439, \u0447\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A...");var h=document.createElement("div"),i=document.createElement("div"),j=document.createElement("div"),k=document.createElement("div"),l=document.createElement("div");if(l.className="backdrop",h.className="modal",i.className="head",j.className="body",k.className="close fas fa-times",k.onclick=d.bind(k,f),h.append(k,i,j),l.append(h),g.append(l),l.style.zIndex=(e++).toString(),("string"==typeof b||b instanceof HTMLElement)&&i.append(b),c instanceof HTMLElement)for(;0e){var d=document.querySelector(".backdrop-container");d&&(d.remove(),e=0,a.Setting.UnblockScroll())}b&&b()}var e=0;b.Create=c})(b=a.Modal||(a.Modal={}))})(VKKO||(VKKO={}));var VKKO;(function(a){var b=function(){function b(b,c,d){if(void 0===c&&(c=250),void 0===d&&(d=5e3),this.__SlideCount=0,this.__WidthOneSlide=0,this.__CarouselRoot=document.querySelector(b),!this.__CarouselRoot)return void a.Utils.logWarning("\u041E\u0442\u043C\u0435\u043D\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0441\u043B\u0430\u0439\u0434\u0435\u0440\u0430. \u041D\u0435\u0442 \u043A\u043E\u0440\u043D\u0435\u0432\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u0430.");if(this.__Carousel=this.__CarouselRoot.querySelector(".carousel"),!this.__Carousel)return a.Utils.logWarning("\u041E\u0442\u043C\u0435\u043D\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0441\u043B\u0430\u0439\u0434\u0435\u0440\u0430. \u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0431\u043E\u043A\u0441."),void this.__CarouselRoot.remove();if(this.__Slider=this.__Carousel.querySelector(".slider"),!this.__Slider)return void this.__CarouselRoot.remove();if(this.__NavigationDots=this.__Carousel.querySelector(".navigation-dots"),this.__SlideCount=this.__Slider.children.length,0==this.__SlideCount)return void this.__CarouselRoot.remove();switch(a.Setting.Platform){case CLIENT_PLATFORM.DESKTOP:this.__WidthOneSlide=this.__CarouselRoot.getBoundingClientRect().width;break;case CLIENT_PLATFORM.TABLET:break;case CLIENT_PLATFORM.MOBILE:this.__WidthOneSlide=document.documentElement.clientWidth;break;default:this.__WidthOneSlide=this.__CarouselRoot.getBoundingClientRect().width;}return this.buildNavigationDots(),this.buildButtonEvent(),1==this.__SlideCount?(this.__Slider.style.width=this.__WidthOneSlide+"px",void this.outForeground()):void(1CLIENT_PLATFORM.MOBILE?document.documentElement.clientWidth>CLIENT_PLATFORM.TABLET?document.documentElement.clientWidth>CLIENT_PLATFORM.OLD_DESKTOP?CLIENT_PLATFORM.OLD_DESKTOP:CLIENT_PLATFORM.DESKTOP:CLIENT_PLATFORM.TABLET:CLIENT_PLATFORM.MOBILE},250)}function d(a,b){var c={Login:a.value,Password:b.value};VKKOWork.XHR.POST(function(a){a?a.Error?VKKOWork.Messenger.Show(a.Error):(VKKOWork.Messenger.Show("\u041F\u0440\u0438\u0432\u0435\u0442, "+a.Name),window.location.reload()):VKKOWork.Messenger.Show("\u0421\u0435\u0440\u0432\u0435\u0440 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u0432\u0435\u0440\u043D\u0443\u043B :(")},"/login",c),this.closest(".modal").querySelector(".close").click()}function e(){VKKOWork.XHR.POST(function(a){null==a.Error&&window.location.reload()},"/logout")}var f;b.Init=function(){c(),setTimeout(window.FsLightbox,250),setTimeout(function(){document.body.onresize=c},500)},b.SignIn=function(){var b=document.createElement("div"),c=document.createElement("input"),e=document.createElement("input"),f=document.createElement("button"),g=1;c.type="text",c.placeholder="\u041B\u043E\u0433\u0438\u043D",c.tabIndex=g++,e.type="password",e.placeholder="\u041F\u0430\u0440\u043E\u043B\u044C",e.tabIndex=g++,e.onkeypress=function(a){13==a.keyCode&&d.call(f,c,e)},f.textContent="\u0412\u043E\u0439\u0442\u0438",f.onclick=d.bind(f,c,e),f.tabIndex=g++,b.append(c,e,f),a.Modal.Create("\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F",b)},b.SignOut=e})(b=a.Main||(a.Main={}))})(VKKO||(VKKO={}));var VKKO;(function(a){var b=function(){function a(){this.__Root=document.createElement("div"),this.__Root.classList.add("tree")}return a.prototype.onClickBranch=function(){if(this instanceof HTMLElement){var a=this.closest(".tree"),b=a.querySelectorAll(".selected"),c=this.parentElement;b.forEach(function(a){a!==c&&a.classList.remove("selected")}),c.classList.toggle("selected")}},a.prototype.AddBranch=function(a,b,c){var d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div");if(b)for(var g in b)b.hasOwnProperty(g)&&(d.dataset[g]=b[g]);return d.classList.add("branch"),e.classList.add("body"),f.classList.add("head"),f.textContent=a,f.onclick=this.onClickBranch,d.append(f,e),c?c.append(d):this.__Root.append(d),e},a.prototype.CreateBranch=function(a,b){return this.AddBranch(a,b).parentElement},a.prototype.InsertInto=function(a,b,c,d){d||(d=this.__Root);for(var e,f=d.children.length,g=0;g"+l.data.text+"

",n.String+=l.data.text;break;case"header":t+=""+l.data.text+"",n.String+=l.data.text;break;case"list":if("ordered"===l.data.style){t+="
    ";for(var w,x=0,y=l.data.items;x"+w+"",n.String+=w;t+="
"}else{t+="
    ";for(var w,z=0,A=l.data.items;z"+w+"",n.String+=w;t+="
"}break;case"delimiter":t+="
";break;case"table":t+="";for(var B,C=0,D=l.data.content;C";for(var E,F=0,G=B;F"+E+"",n.String+=E;t+=""}t+="
";break;case"image":var H=a.Utils.GenerateHashDashed(2)+"."+l.data.url.slice(11,l.data.url.indexOf(";"));t+="";var I=document.createElement("div");I.innerHTML=l.data.caption,0"+l.data.caption+""),s.append("Files",h(l.data.url),H);break;case"embed":t+="";var J=document.createElement("div");J.innerHTML=l.data.caption,0"+l.data.caption+"");}var K=document.createElement("div");K.innerHTML=n.String,n.String=K.textContent,260");for(var Q=0;Q\""+H+"\""),s.append("Files",R,H),M.push({Image:"/"+d+H,Thumb:"/"+r+H})}q!=MATERIAL_CATEGORY.NOTICE&&(t+="")}}s.set("Caption",b.value),s.set("Link",e.value),s.set("Content",t),s.set("Source",JSON.stringify(g)),s.set("SourceImages",JSON.stringify(M)),s.set("PreviewValid",n.Valid),s.set("PreviewString",n.String),s.set("ImageValid",L.Valid),s.set("ImageString",L.String),s.set("ImagePath",d),s.set("ThumbPath",r);var f=this.closest(".modal").querySelector(".close");VKKOWork.XHR.POST(function(a){a&&"Error"in a&&(null===a.Error?(VKKOWork.Messenger.Show(q+" \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430"),f.click()):VKKOWork.Messenger.Show("\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043D\u043E\u0432\u043E\u0441\u0442\u0438."+a.Error))},"/material-insert/"+q,s,null,!0,!0)}function k(b,e,f,g,j){if(!b||!e||!f||!g)return void VKKOWork.Messenger.Show("\u041D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u043D\u0435 \u0431\u044B\u043B\u0438 \u043D\u0430\u0439\u0434\u0435\u043D\u044B, \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043D\u043E\u0432\u043E\u0441\u0442\u044C!");if(0==b.value.length)return void VKKOWork.Messenger.Show("\u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A!");0==e.value.length&&(e.value=a.Utils.GenerateHash256());var k={Valid:"true",String:""},l=new Date,n=("00"+(l.getMonth()+1)).slice(-2),m=("00"+l.getDate()).slice(-2),d="",o="";q==MATERIAL_CATEGORY.MATERIAL?(d="image/"+q+"/"+l.getUTCFullYear().toString()+"-"+n+"-"+m+"/",o="thumb/"+q+"/"+l.getUTCFullYear().toString()+"-"+n+"-"+n+"/"):0"+p.data.text+"

",k.String+=p.data.text;break;case"header":s+=""+p.data.text+"",k.String+=p.data.text;break;case"list":if("ordered"===p.data.style){s+="
    ";for(var v,w=0,x=p.data.items;w"+v+"",k.String+=v;s+="
"}else{s+="
    ";for(var v,y=0,z=p.data.items;y"+v+"",k.String+=v;s+="
"}break;case"delimiter":s+="
";break;case"table":s+="";for(var A,B=0,C=p.data.content;B";for(var D,E=0,F=A;E"+D+"",k.String+=D;s+=""}s+="
";break;case"image":var G=a.Utils.GenerateHashDashed(2)+"."+p.data.url.slice(11,p.data.url.indexOf(";"));s+="";var H=document.createElement("div");H.innerHTML=p.data.caption,0"+p.data.caption+""),r.append("Files",h(p.data.url),G);break;case"embed":s+="";var I=document.createElement("div");I.innerHTML=p.data.caption,0"+p.data.caption+"");}var J=document.createElement("div");if(J.innerHTML=k.String,k.String=J.textContent,260");for(var K=0;K\""+j[K].Image.slice(j[K].Image.lastIndexOf("/")+1)+"\"");q!=MATERIAL_CATEGORY.NOTICE&&(s+="")}r.set("Link",e.value),r.set("Caption",b.value),r.set("Content",s),r.set("Source",JSON.stringify(f)),r.set("PreviewValid",k.Valid),r.set("PreviewString",k.String),r.set("ImagePath",d),r.set("ThumbPath",o);var L=this.closest(".modal").querySelector(".close");VKKOWork.XHR.POST(function(a){a&&"Error"in a&&(null===a.Error?(VKKOWork.Messenger.Show(q+" \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430"),L.click()):VKKOWork.Messenger.Show("\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043D\u043E\u0432\u043E\u0441\u0442\u0438."+a.Error))},"/material-update/"+q,r,null,!0,!0)}var l=document.querySelector("#CreateNewsButton");l&&(l.onclick=d);var m=document.querySelector("#CreateNoticeButton");m&&(m.onclick=d);var n=document.querySelector("#CreateMaterialButton");n&&(n.onclick=d);var o=document.querySelector("#EditMaterialButton");o&&(o.onclick=e);var p=document.querySelector("#DeleteMaterialButton");p&&(p.onclick=c);var q=void 0;b.initButton=function(){var a=document.querySelectorAll(".edit-material-button"),b=!0,d=!1,f=void 0;try{for(var g,h,i=a[Symbol.iterator]();!(b=(g=i.next()).done);b=!0)h=g.value,h.onclick=e}catch(a){d=!0,f=a}finally{try{!b&&i.return&&i.return()}finally{if(d)throw f}}var j=document.querySelectorAll(".delete-material-button"),k=!0,l=!1,m=void 0;try{for(var n,o,p=j[Symbol.iterator]();!(k=(n=p.next()).done);k=!0)o=n.value,o.onclick=c}catch(a){l=!0,m=a}finally{try{!k&&p.return&&p.return()}finally{if(l)throw m}}}})(b=a.MaterialEditor||(a.MaterialEditor={}))})(VKKO||(VKKO={}));var VKKO,singIn=document.querySelector(".sign-hide"),isOver=!1,clickCount=0;singIn&&(singIn.onmouseover=function(){isOver=!0,clickCount=0},singIn.onmouseleave=function(){isOver=!1,clickCount=0},singIn.onclick=function(){isOver&&(clickCount++,5==clickCount&&(this.classList.remove("hide"),this.onmouseover=void 0,this.onmouseleave=void 0,this.onclick=VKKO.Main.SignIn))});var AddMaterialButton=document.querySelector("#AddMaterialButton");AddMaterialButton&&(AddMaterialButton.onclick=function(){var a=document.createElement("label"),b=document.createElement("input"),c=document.createElement("button"),d=document.createElement("div");a.textContent="\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B",b.type="text",c.textContent="\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C",c.onclick=function(){VKKOWork.XHR.POST(function(a){"Error"in a&&null==a.Error?VKKOWork.Messenger.Show("\u0421\u0441\u044B\u043B\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430"):VKKOWork.Messenger.Show(a.Error)},"/set-material-list",{Link:b.value}),this.closest(".modal").querySelector(".close").click()},d.append(a,b,c),VKKO.Modal.Create("\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0432 \u043F\u043E\u043B\u0435\u0437\u043D\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E",d)});function printTable(){var a=document.getElementById("ManageOrderPacient"),b=window.open("","new div","height=877,width=1200");b.document.write(""),b.document.write(""),b.document.write(""+a.outerHTML+""),b.document.close(),b.focus(),b.print()}