Files
2/static/js/main.0d10aada.chunk.js
2023-02-11 00:22:28 +03:00

2 lines
30 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{140:function(e,t,n){e.exports=n(193)},176:function(e,t,n){},193:function(e,t,n){"use strict";n.r(t);n(141),n(166);var a=n(0),r=n.n(a),o=n(43),i=n.n(o),c=n(22),l=n(96),s=n(17),u=n(9),p=n(6),h=n(35),d=n(24),m=n.n(d),f=function(e){return{type:"SET_ACCESS_TOKEN",payload:e}},v=function(e,t){return t.access_token=fe.getState().vkui.accessToken,t.v=void 0===t.v?"5.92":t.v,m.a.send("VKWebAppCallAPIMethod",{method:e,params:t}).then(function(e){return e.response}).catch(function(e){return e})},y=function(e){var t=fe.getState().router.activePanel,n=fe.getState().router.panelsHistory;return"undefined"!==typeof n[e]&&(t=n[e][n[e].length-1]),t},b={activeStory:null,activeView:null,activePanel:null,storiesHistory:[],viewsHistory:[],panelsHistory:[],activeModals:[],modalHistory:[],popouts:[],scrollPosition:[]},O={accessToken:void 0,colorScheme:"client_light",activeTab:[],componentScroll:[]},g={forms:[]},E=Object(c.combineReducers)({vkui:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_COLOR_SCHEME":return Object(p.a)({},e,{colorScheme:t.payload});case"SET_ACCESS_TOKEN":return Object(p.a)({},e,{accessToken:t.payload});case"SET_ACTIVE_TAB":return Object(p.a)({},e,{activeTab:Object(p.a)({},e.activeTab,Object(u.a)({},t.payload.component,t.payload.tab))});case"SET_SCROLL_POSITION":return Object(p.a)({},e,{componentScroll:Object(p.a)({},e.componentScroll,Object(u.a)({},t.payload.component,{x:t.payload.x,y:t.payload.y}))});case"SET_SCROLL_POSITION_BY_ID":var n=document.getElementById(t.payload.component).getElementsByClassName("HorizontalScroll__in")[0],a=n.scrollLeft,r=n.scrollTop;return Object(p.a)({},e,{componentScroll:Object(p.a)({},e.componentScroll,Object(u.a)({},t.payload.component,{x:a,y:r}))});default:return e}},router:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PAGE":var n=t.payload.view,a=t.payload.panel;window.history.pushState(null,null);var r=e.panelsHistory[n]||[],o=e.viewsHistory[e.activeStory]||[],i=o.indexOf(n);return-1!==i&&o.splice(i,1),-1===r.indexOf(a)&&(r=[].concat(Object(h.a)(r),[a])),r.length>1&&m.a.send("VKWebAppEnableSwipeBack",{}).then(function(e){return e}).catch(function(e){return e}),Object(p.a)({},e,{activeView:n,activePanel:a,panelsHistory:Object(p.a)({},e.panelsHistory,Object(u.a)({},n,r)),viewsHistory:Object(p.a)({},e.viewsHistory,Object(u.a)({},e.activeStory,[].concat(Object(h.a)(o),[n]))),scrollPosition:Object(p.a)({},e.scrollPosition,Object(u.a)({},e.activeStory+"_"+e.activeView+"_"+e.activePanel,window.pageYOffset))});case"SET_STORY":window.history.pushState(null,null);var c=e.viewsHistory[t.payload.story]||[t.payload.story],l=e.storiesHistory,s=c[c.length-1],d=e.panelsHistory[s]||[t.payload.initial_panel],f=d[d.length-1];if(t.payload.story===e.activeStory)if(d.length>1){var v=d.shift();f=(d=[v])[d.length-1]}else if(c.length>1){var y=c.shift();s=(c=[y])[c.length-1],f=(d=e.panelsHistory[s])[d.length-1]}return t.payload.story===e.activeStory&&1===d.length&&window.pageYOffset>0&&(window.scrollTo(0,30),function e(){var t=document.documentElement.scrollTop||document.body.scrollTop;t>30||t>0&&(window.requestAnimationFrame(e),window.scrollTo(0,t-t/8))}()),(-1===l.indexOf(t.payload.story)||l[0]===t.payload.story&&l[l.length-1]!==t.payload.story)&&(l=[].concat(Object(h.a)(l),[t.payload.story])),Object(p.a)({},e,{activeStory:t.payload.story,activeView:s,activePanel:f,storiesHistory:l,viewsHistory:Object(p.a)({},e.viewsHistory,Object(u.a)({},s,c)),panelsHistory:Object(p.a)({},e.panelsHistory,Object(u.a)({},s,d)),scrollPosition:Object(p.a)({},e.scrollPosition,Object(u.a)({},e.activeStory+"_"+e.activeView+"_"+e.activePanel,window.pageYOffset))});case"GO_BACK":var O=e.activeView,g=e.activePanel,E=e.activeStory,w=e.popouts;if(w[O])return w[O]=null,Object(p.a)({},e,{popouts:Object(p.a)({},e.popouts,{popoutsData:w})});var j=e.modalHistory[O];if(void 0!==j&&0!==j.length){var S=j[j.length-2]||null;return null===S?j=[]:-1!==j.indexOf(S)?j=j.splice(0,j.indexOf(S)+1):j.push(S),Object(p.a)({},e,{activeModals:Object(p.a)({},e.activeModals,Object(u.a)({},O,S)),modalHistory:Object(p.a)({},e.modalHistory,Object(u.a)({},O,j))})}var k=e.panelsHistory[O]||[],T=e.viewsHistory[e.activeStory]||[],_=e.storiesHistory;if(k.length>1)k.pop(),g=k[k.length-1];else if(T.length>1){T.pop(),O=T[T.length-1];var P=e.panelsHistory[O];g=P[P.length-1]}else if(_.length>1){_.pop(),E=_[_.length-1],O=e.viewsHistory[E][e.viewsHistory[E].length-1];var A=e.panelsHistory[O];g=A.length>1?A[A.length-1]:A[0]}else m.a.send("VKWebAppClose",{status:"success"}).then(function(e){return e}).catch(function(e){return e});return 1===k.length&&m.a.send("VKWebAppDisableSwipeBack",{}).then(function(e){return e}).catch(function(e){return e}),Object(p.a)({},e,{activeView:O,activePanel:g,activeStory:E,viewsHistory:Object(p.a)({},e.viewsHistory,Object(u.a)({},e.activeView,T)),panelsHistory:Object(p.a)({},e.panelsHistory,Object(u.a)({},e.activeView,k))});case"OPEN_POPOUT":return window.history.pushState(null,null),Object(p.a)({},e,{popouts:Object(p.a)({},e.popouts,Object(u.a)({},e.activeView,t.payload.popout))});case"CLOSE_POPOUT":return Object(p.a)({},e,{popouts:Object(p.a)({},e.popouts,Object(u.a)({},e.activeView,null))});case"OPEN_MODAL":window.history.pushState(null,null);var C=t.payload.id||null,L=e.modalHistory[e.activeView]?Object(h.a)(e.modalHistory[e.activeView]):[];return null===C?L=[]:-1!==L.indexOf(C)?L=L.splice(0,L.indexOf(C)+1):L.push(C),Object(p.a)({},e,{activeModals:Object(p.a)({},e.activeModals,Object(u.a)({},e.activeView,C)),modalHistory:Object(p.a)({},e.modalHistory,Object(u.a)({},e.activeView,L))});case"CLOSE_MODAL":var x=e.modalHistory[e.activeView][e.modalHistory[e.activeView].length-2]||null,H=e.modalHistory[e.activeView]?Object(h.a)(e.modalHistory[e.activeView]):[];return null===x?H=[]:-1!==H.indexOf(x)?H=H.splice(0,H.indexOf(x)+1):H.push(x),Object(p.a)({},e,{activeModals:Object(p.a)({},e.activeModals,Object(u.a)({},e.activeView,x)),modalHistory:Object(p.a)({},e.modalHistory,Object(u.a)({},e.activeView,H))});default:return e}},formData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SAVE_FORM_DATA":return Object(p.a)({},e,{forms:Object(p.a)({},e.forms,Object(u.a)({},t.payload.form,t.payload.data))});default:return e}}}),w=n(83),j=function(e,t){return{type:"SET_STORY",payload:{story:e,initial_panel:t}}},S=function(e,t){return{type:"SET_PAGE",payload:{view:e,panel:t}}},k=function(){return{type:"GO_BACK"}},T=function(e){return{type:"OPEN_POPOUT",payload:{popout:e}}},_=function(){return{type:"CLOSE_POPOUT"}},P=function(e){return{type:"OPEN_MODAL",payload:{id:e}}},A=function(){return{type:"CLOSE_MODAL"}},C=(n(175),n(176),n(14)),L=n(15),x=n(18),H=n(16),V=n(19),I=n(2),D=n(94),M=n.n(D),B=n(95),G=n.n(B),N=n(45);var F=function(e){function t(){var e,n;Object(C.a)(this,t);for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return(n=Object(x.a)(this,(e=Object(H.a)(t)).call.apply(e,[this].concat(r)))).state={showImg:!1},n.showImg=function(){n.setState({showImg:!0})},n}return Object(V.a)(t,e),Object(L.a)(t,[{key:"openPopout",value:function(){var e=this;this.props.openPopout(r.a.createElement(I.a,{actions:[{title:"\u041d\u0435\u0442",autoclose:!0,style:"cancel"},{title:"\u0414\u0430",autoclose:!0,action:this.showImg}],onClose:function(){return e.props.closePopout()}},r.a.createElement("h2",null,"\u0412\u043e\u043f\u0440\u043e\u0441 \u0437\u043d\u0430\u0447\u0438\u0442"),r.a.createElement("p",null,"\u0412\u0430\u0441 \u0440\u043e\u043d\u044f\u043b\u0438 \u0432 \u0434\u0435\u0442\u0441\u0442\u0432\u0435?")))}},{key:"render",value:function(){var e=this,t=this.props,n=t.id;t.setPage,t.withoutEpic,new URL(window.location.href);return r.a.createElement(I.w,{id:n},r.a.createElement(I.x,null,"Examples"),r.a.createElement(I.m,null,r.a.createElement(I.h,null,r.a.createElement("p",null,new URL(window.location.href).searchParams.get("payload")?"\u0432\u0430\u0448 \u043d\u0438\u043a: "+new URL(window.location.href).searchParams.get("payload"):"\u0412\u042b \u041d\u0415 \u0410\u0412\u0422\u041e\u0420\u0418\u0417\u041e\u0412\u0410\u041d\u042b")),r.a.createElement(I.h,null,r.a.createElement(I.c,{mode:"secondary",size:"l",stretched:!0,onClick:function(){return e.openPopout()}},"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0430\u043b\u0435\u0440\u0442")),r.a.createElement(I.h,null,r.a.createElement(I.c,{mode:"secondary",size:"l",stretched:!0,onClick:function(){return e.props.openModal("MODAL_PAGE_BOTS_LIST")}},"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443"))))}}]),t}(r.a.Component),z={setPage:S,goBack:k,openPopout:T,closePopout:_,openModal:P},R=Object(s.b)(null,z)(F),K=function(e){function t(){return Object(C.a)(this,t),Object(x.a)(this,Object(H.a)(t).apply(this,arguments))}return Object(V.a)(t,e),Object(L.a)(t,[{key:"render",value:function(){var e=this.props,t=e.description,n=e.photo,a=e.name,o=t.length>0?t:"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442";return r.a.createElement(I.d,{description:o,before:r.a.createElement(I.b,{size:40,src:n})},a)}}]),t}(a.PureComponent),U=function(e){var t=null;return void 0!==e&&null!==e&&0!==e.length&&(t=e.map(function(e){return r.a.createElement(K,{key:e.id,description:e.description,photo:e.photo_100,name:e.name})})),t};function W(){W=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(P){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(r||[]);return a(i,"_invoke",{value:E(e,n,c)}),i}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=s;var p={};function h(){}function d(){}function m(){}var f={};l(f,o,function(){return this});var v=Object.getPrototypeOf,y=v&&v(v(T([])));y&&y!==t&&n.call(y,o)&&(f=y);var b=m.prototype=h.prototype=Object.create(f);function O(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function g(e,t){var r;a(this,"_invoke",{value:function(a,o){function i(){return new t(function(r,i){!function a(r,o,i,c){var l=u(e[r],e,o);if("throw"!==l.type){var s=l.arg,p=s.value;return p&&"object"==typeof p&&n.call(p,"__await")?t.resolve(p.__await).then(function(e){a("next",e,i,c)},function(e){a("throw",e,i,c)}):t.resolve(p).then(function(e){s.value=e,i(s)},function(e){return a("throw",e,i,c)})}c(l.arg)}(a,o,r,i)})}return r=r?r.then(i,i):i()}})}function E(e,t,n){var a="suspendedStart";return function(r,o){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw o;return _()}for(n.method=r,n.arg=o;;){var i=n.delegate;if(i){var c=w(i,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var l=u(e,t,n);if("normal"===l.type){if(a=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a="completed",n.method="throw",n.arg=l.arg)}}}function w(e,t){var n=t.method,a=e.iterator[n];if(void 0===a)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=u(a,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,r=function t(){for(;++a<e.length;)if(n.call(e,a))return t.value=e[a],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=m,a(b,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:d,configurable:!0}),d.displayName=l(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},O(g.prototype),l(g.prototype,i,function(){return this}),e.AsyncIterator=g,e.async=function(t,n,a,r,o){void 0===o&&(o=Promise);var i=new g(s(t,n,a,r),o);return e.isGeneratorFunction(n)?i:i.next().then(function(e){return e.done?e.value:i.next()})},O(b),l(b,c,"Generator"),l(b,o,function(){return this}),l(b,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var a in t)n.push(a);return n.reverse(),function e(){for(;n.length;){var a=n.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},e.values=T,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function a(n,a){return i.type="throw",i.arg=e,t.next=n,a&&(t.method="next",t.arg=void 0),!!a}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}var Y=function(e){function t(){var e,n;Object(C.a)(this,t);for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return(n=Object(x.a)(this,(e=Object(H.a)(t)).call.apply(e,[this].concat(r)))).state={groups:{admined:[],other:[]},loading:!0,errorGetAuthToken:!1},n}return Object(V.a)(t,e),Object(L.a)(t,[{key:"componentDidMount",value:function(){void 0===this.props.accessToken?this.getAuthToken():this.getGroupsList()}},{key:"getAuthToken",value:function(){var e;this.props.dispatch((e=["groups"],function(t){m.a.send("VKWebAppGetAuthToken",{app_id:6984089,scope:e.join(",")}).then(function(e){t(f(e.access_token))}).catch(function(){t(f(null))})}))}},{key:"componentDidUpdate",value:function(e,t,n){this.props!==e&&(null===this.props.accessToken?this.setState({loading:!1,errorGetAuthToken:!0}):(this.setState({loading:!0,errorGetAuthToken:!1}),this.getGroupsList()))}},{key:"getGroupsList",value:function(){var e=Object(N.a)(W().mark(function e(){var t,n,a;return W().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!localStorage.getItem("userGroupsAdmined")||!localStorage.getItem("userGroupsOther")){e.next=3;break}return this.setState({groups:{admined:JSON.parse(localStorage.getItem("userGroupsAdmined")),other:JSON.parse(localStorage.getItem("userGroupsOther"))},loading:!1}),e.abrupt("return");case 3:return e.next=5,v("groups.get",{extended:"1",fields:"description",count:"100"});case 5:t=e.sent,console.log(t),n=t.items.filter(function(e){return 1===e.is_admin}),a=t.items.filter(function(e){return 0===e.is_admin}),localStorage.setItem("userGroupsAdmined",JSON.stringify(n)),localStorage.setItem("userGroupsOther",JSON.stringify(a)),this.setState({groups:{admined:n,other:a},loading:!1});case 12:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=this.props,n=t.id,a=t.goBack,o=U(this.state.groups.admined),i=U(this.state.groups.other);return r.a.createElement(I.w,{id:n},r.a.createElement(I.x,{left:r.a.createElement(I.y,{onClick:function(){return a()}})},"\u0413\u0440\u0443\u043f\u043f\u044b"),this.state.loading&&r.a.createElement(I.A,null),!this.state.loading&&this.state.errorGetAuthToken&&r.a.createElement(I.m,null,r.a.createElement(I.h,null,"\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0412\u044b \u043d\u0435 \u0432\u044b\u0434\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0433\u0440\u0443\u043f\u043f."),r.a.createElement(I.h,null,r.a.createElement(I.c,{size:"l",stretched:!0,onClick:function(){return e.getAuthToken()}},"\u0417\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e"))),!this.state.loading&&!this.state.errorGetAuthToken&&o&&r.a.createElement(I.m,{header:r.a.createElement(I.n,{mode:"secondary"},"\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435")},r.a.createElement(I.s,null,o)),!this.state.loading&&!this.state.errorGetAuthToken&&i&&r.a.createElement(I.m,{header:r.a.createElement(I.n,{mode:"secondary"},"\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435")},r.a.createElement(I.s,null,i)))}}]),t}(r.a.Component);var J=Object(s.b)(function(e){return{accessToken:e.vkui.accessToken}},function(e){return Object(p.a)({dispatch:e},Object(c.bindActionCreators)({goBack:k,openPopout:T,closePopout:_,openModal:P},e))})(Y),q=function(e){function t(e){var n;return Object(C.a)(this,t),(n=Object(x.a)(this,Object(H.a)(t).call(this,e))).state={activeTab:e.activeTab.EXAMPLE||"modal"},n}return Object(V.a)(t,e),Object(L.a)(t,[{key:"setTab",value:function(e){this.setState({activeTab:e})}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.setScrollPositionByID;(0,e.setActiveTab)("EXAMPLE",this.state.activeTab),t("EXAMPLE_TABS_LIST")}},{key:"componentDidMount",value:function(){!function(){var e=fe.getState().vkui.componentScroll;Object.keys(e).forEach(function(t){var n=e[t],a=document.getElementById(t);a&&((a=a.getElementsByClassName("HorizontalScroll__in")[0]).scrollLeft=n.x,a.scrollTop=n.y)})}()}},{key:"render",value:function(){var e=this,t=this.props,n=t.id,a=t.setPage;return r.a.createElement(I.w,{id:n},r.a.createElement(I.x,{noShadow:!0},"Examples 2"),r.a.createElement(I.j,{vertical:"top"},r.a.createElement(I.E,{theme:"header",mode:"default"},r.a.createElement(I.o,{id:"EXAMPLE_TABS_LIST"},r.a.createElement(I.F,{onClick:function(){return e.setTab("modal")},selected:"modal"===this.state.activeTab},"\u041c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e"),r.a.createElement(I.F,{onClick:function(){return e.setTab("test")},selected:"test"===this.state.activeTab},"\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0430"),r.a.createElement(I.F,{onClick:function(){return e.setTab("test2")},selected:"test2"===this.state.activeTab},"\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0430 2"),r.a.createElement(I.F,{onClick:function(){return e.setTab("test3")},selected:"test3"===this.state.activeTab},"\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0430 3")))),r.a.createElement(I.m,{style:{marginTop:56}},"modal"===this.state.activeTab&&r.a.createElement(I.e,{onClick:function(){return a("modal","filters")}},"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e"),"modal"!==this.state.activeTab&&r.a.createElement(I.h,null,this.state.activeTab)))}}]),t}(r.a.Component),X={setPage:S,setActiveTab:function(e,t){return{type:"SET_ACTIVE_TAB",payload:{component:e,tab:t}}},setScrollPositionByID:function(e){return{type:"SET_SCROLL_POSITION_BY_ID",payload:{component:e}}}},Q=Object(s.b)(function(e){return{activeTab:e.vkui.activeTab}},X)(q),Z=function(e){function t(e){var n;Object(C.a)(this,t),n=Object(x.a)(this,Object(H.a)(t).call(this,e));var a={workplace:"",workposition:"",checkboxPhoto:0,checkboxOnline:0};return n.state={inputData:e.inputData.example_form||a},n.handleInput=function(e){var t=e.currentTarget.value;"checkbox"===e.currentTarget.type&&(t=e.currentTarget.checked),n.setState({inputData:Object(p.a)({},n.state.inputData,Object(u.a)({},e.currentTarget.name,t))})},n.clearForm=function(){n.setState({inputData:a})},n}return Object(V.a)(t,e),Object(L.a)(t,[{key:"componentWillUnmount",value:function(){this.props.setFormData("example_form",this.state.inputData)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.goBack;return r.a.createElement(I.w,{id:t},r.a.createElement(I.x,{left:r.a.createElement(I.y,{onClick:function(){return n()}})},"\u041c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e"),r.a.createElement(I.m,null,r.a.createElement(I.k,null,r.a.createElement(I.l,{top:"\u0420\u0430\u0431\u043e\u0442\u0430"},r.a.createElement(I.r,{value:this.state.inputData.workplace,onChange:this.handleInput,name:"workplace",placeholder:"\u041c\u0435\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u044b",autoComplete:"off"}),r.a.createElement(I.r,{value:this.state.inputData.workposition,onChange:this.handleInput,name:"workposition",placeholder:"\u0414\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c",autoComplete:"off"})),r.a.createElement(I.l,{top:"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e"},r.a.createElement(I.f,{checked:this.state.inputData.checkboxPhoto,onChange:this.handleInput,name:"checkboxPhoto"},"\u0421 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0435\u0439"),r.a.createElement(I.f,{checked:this.state.inputData.checkboxOnline,onChange:this.handleInput,name:"checkboxOnline"},"\u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435"))),r.a.createElement(I.h,{className:"buttons-group"},r.a.createElement(I.c,{size:"l",stretched:!0,onClick:function(){return n()}},"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"),r.a.createElement(I.c,{size:"l",stretched:!0,onClick:this.clearForm},"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c"))))}}]),t}(r.a.Component),$={setFormData:function(e,t){return{type:"SAVE_FORM_DATA",payload:{form:e,data:t}}},goBack:k},ee=Object(s.b)(function(e){return{inputData:e.formData.forms}},$)(Z),te=n(46),ne=n.n(te),ae=n(33),re=n.n(ae),oe=n(44),ie=n.n(oe),ce=[{name:"VKS",avatar:"https://pp.userapi.com/c851520/v851520442/48ce/Sik7V4c58qw.jpg",desc:"\u041d\u0435\u0442, \u043c\u0435\u043d\u044f \u043d\u0435 \u0440\u043e\u043d\u044f\u043b\u0438 \u0432 \u0434\u0435\u0442\u0441\u0442\u0432\u0435"},{name:"\u041d\u0435\u0434\u043e\u0431\u043e\u0442",avatar:"https://pp.userapi.com/c854420/v854420431/da51/X8ohw4-4Fk4.jpg",desc:"\u042f \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u0438\u043b \u043a\u043e\u043a\u043e\u0441\u043e\u0432\u043e\u0435 \u043c\u043e\u043b\u043e\u043a\u043e"},{name:"Realm of War",avatar:"https://sun9-72.userapi.com/c853520/v853520591/1f167d/avj_z9yFtQA.jpg?ava=1",desc:"\u041d\u0435\u043d\u0430\u0432\u0438\u0436\u0443 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u044b."}],le=function(e){function t(){return Object(C.a)(this,t),Object(x.a)(this,Object(H.a)(t).apply(this,arguments))}return Object(V.a)(t,e),Object(L.a)(t,[{key:"render",value:function(){var e=this.props,t=e.id,n=e.onClose,a=e.openModal,o=e.platform;return r.a.createElement(I.t,{id:t,header:r.a.createElement(I.u,{left:o!==I.p&&r.a.createElement(I.z,{onClick:n},r.a.createElement(re.a,null)),right:o===I.p&&r.a.createElement(I.z,{onClick:n},r.a.createElement(ne.a,null))},"/appbots \u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u043a\u0430\u0445"),onClose:n,settlingHeight:80},r.a.createElement(I.s,null,ce.map(function(e,t){return r.a.createElement(I.d,{key:t,description:e.desc,before:r.a.createElement(I.b,{size:40,src:e.avatar}),onClick:function(){return a("MODAL_PAGE_BOT_INFO")},asideContent:r.a.createElement(ie.a,{fill:"#528bcc"})},e.name)})))}}]),t}(r.a.Component),se={openModal:P},ue=Object(I.H)(Object(s.b)(null,se)(le)),pe=function(e){function t(){return Object(C.a)(this,t),Object(x.a)(this,Object(H.a)(t).apply(this,arguments))}return Object(V.a)(t,e),Object(L.a)(t,[{key:"render",value:function(){var e=this.props,t=e.id,n=e.onClose,a=e.platform;return r.a.createElement(I.t,{id:t,header:r.a.createElement(I.u,{left:a!==I.p&&r.a.createElement(I.z,{onClick:n},r.a.createElement(re.a,null)),right:a===I.p&&r.a.createElement(I.z,{onClick:n},r.a.createElement(ne.a,null))},"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0431\u043e\u0442\u0435"),onClose:n,settlingHeight:80},r.a.createElement(I.d,{description:"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435",before:r.a.createElement(I.b,{size:40,src:"https://vk.com/images/community_100.png?ava=1"})},"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435"),r.a.createElement(I.s,null,r.a.createElement(I.d,null,r.a.createElement(I.q,{header:"\u041f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432"},"8800")),r.a.createElement(I.d,null,r.a.createElement(I.q,{header:"\u0417\u0430\u043f\u0438\u0441\u0435\u0439"},"555")),r.a.createElement(I.d,null,r.a.createElement(I.q,{header:"\u0420\u0435\u0439\u0442\u0438\u043d\u0433"},"3535"))))}}]),t}(r.a.Component),he=Object(I.H)(Object(s.b)()(pe)),de=function(e){function t(e){var n;return Object(C.a)(this,t),(n=Object(x.a)(this,Object(H.a)(t).call(this,e))).lastAndroidBackAction=0,n}return Object(V.a)(t,e),Object(L.a)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.goBack;(0,t.dispatch)(function(e){return m.a.subscribe(function t(n){"VKWebAppUpdateConfig"===n.detail.type&&(m.a.unsubscribe(t),e({type:"SET_COLOR_SCHEME",payload:n.detail.data.scheme}))}),m.a.send("VKWebAppInit",{}).then(function(e){return e}).catch(function(e){return e})}),window.onpopstate=function(){var t=+new Date;t-e.lastAndroidBackAction>500?(e.lastAndroidBackAction=t,n()):window.history.pushState(null,null)}}},{key:"componentDidUpdate",value:function(e,t,n){var a=this.props,r=a.activeView,o=a.activeStory,i=a.activePanel,c=a.scrollPosition;if(e.activeView!==r||e.activePanel!==i||e.activeStory!==o){var l=c[o+"_"+r+"_"+i]||0;window.scroll(0,l)}}},{key:"render",value:function(){var e=this.props,t=e.goBack,n=e.setStory,a=e.closeModal,o=e.popouts,i=e.activeView,c=e.activeStory,l=e.activeModals,s=e.panelsHistory,u=e.colorScheme,p=void 0===s[i]?[i]:s[i],h=void 0===o[i]?null:o[i],d=void 0===l[i]?null:l[i],m=r.a.createElement(I.v,{activeModal:d},r.a.createElement(ue,{id:"MODAL_PAGE_BOTS_LIST",onClose:function(){return a()}}),r.a.createElement(he,{id:"MODAL_PAGE_BOT_INFO",onClose:function(){return a()}}));return r.a.createElement(I.g,{isWebView:!0,scheme:u},r.a.createElement(I.i,{activeStory:c,tabbar:r.a.createElement(I.C,null,r.a.createElement(I.D,{onClick:function(){return n("home","base")},selected:"home"===c},r.a.createElement(M.a,null)),r.a.createElement(I.D,{onClick:function(){return n("more","callmodal")},selected:"more"===c},r.a.createElement(G.a,null)))},r.a.createElement(I.B,{id:"home",activeView:i,popout:h},r.a.createElement(I.G,{id:"home",modal:m,activePanel:y("home"),history:p,onSwipeBack:function(){return t()}},r.a.createElement(R,{id:"base",withoutEpic:!1}),r.a.createElement(J,{id:"groups"}))),r.a.createElement(I.B,{id:"more",activeView:i,popout:h},r.a.createElement(I.G,{id:"more",modal:m,activePanel:y("more"),history:p,onSwipeBack:function(){return t()}},r.a.createElement(Q,{id:"callmodal"})),r.a.createElement(I.G,{id:"modal",modal:m,activePanel:y("modal"),history:p,onSwipeBack:function(){return t()}},r.a.createElement(ee,{id:"filters"})))))}}]),t}(r.a.Component);var me=Object(s.b)(function(e){return{activeView:e.router.activeView,activeStory:e.router.activeStory,panelsHistory:e.router.panelsHistory,activeModals:e.router.activeModals,popouts:e.router.popouts,scrollPosition:e.router.scrollPosition,colorScheme:e.vkui.colorScheme}},function(e){return Object(p.a)({dispatch:e},Object(c.bindActionCreators)({setStory:j,goBack:k,closeModal:A},e))})(de);n.d(t,"store",function(){return fe});var fe=Object(c.createStore)(E,Object(w.composeWithDevTools)(Object(c.applyMiddleware)(l.a)));fe.dispatch(j("home","base")),i.a.render(r.a.createElement(s.a,{store:fe},r.a.createElement(me,null)),document.getElementById("root"))}},[[140,1,2]]]);
//# sourceMappingURL=main.0d10aada.chunk.js.map