@elcrm/telegram 0.0.118 → 0.0.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -2305,7 +2305,7 @@ var T;
2305
2305
  return ((n = r.WebApp.initDataUnsafe) == null ? void 0 : n.user) === void 0 ? {} : r.WebApp.initDataUnsafe;
2306
2306
  }, r.Location = (n) => {
2307
2307
  if (de.is)
2308
- return n({ latitude: 0, longitude: 0 });
2308
+ return n({ latitude: 55.752555, longitude: 37.623123 });
2309
2309
  let a = () => {
2310
2310
  r.WebApp.LocationManager.getLocation(async (c) => {
2311
2311
  if (!c) {
package/dist/index.umd.js CHANGED
@@ -57,4 +57,4 @@ Check the top-level render call using <`+n+">.")}return t}}function tt(e,t){{if(
57
57
  <%s {...props} />
58
58
  React keys must be passed directly to JSX without using spread:
59
59
  let props = %s;
60
- <%s key={someKey} {...props} />`,Ae,W,Ft,W),ot[W+Ae]=!0}}return e===l?Bt(j):zt(j),j}}function Nt(e,t,n){return nt(e,t,n,!0)}function It(e,t,n){return nt(e,t,n,!1)}var Mt=It,Dt=Nt;st.Fragment=l,st.jsx=Mt,st.jsxs=Dt}()),st}process.env.NODE_ENV==="production"?gr():hr();const mr="0.0.40",Yt={version:mr},te={},J={module:"",v:Yt.version,page:"Main",auth:"Auth",STORAGE:"f",LISTENER:{},debug:!1,tab:"",id:0,prev:{page:"",module:"",tab:"",id:0}};function pe(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:{}}pe().elcrm||(pe().elcrm={}),Object.assign(pe().elcrm,{router:Yt.version});function Z(r){var o,a,l,c;const p=pe();if(p.ROUTER_PARAMS){r.debug||p.ROUTER_PARAMS.debug;const w={page:(o=p.ROUTER_PARAMS)==null?void 0:o.page,module:(a=p.ROUTER_PARAMS)==null?void 0:a.module,tab:(l=p.ROUTER_PARAMS)==null?void 0:l.tab,id:(c=p.ROUTER_PARAMS)==null?void 0:c.id};p.ROUTER_PARAMS={...p.ROUTER_PARAMS,...r,prev:w}}else{r.debug||J.debug;const w={page:J==null?void 0:J.page,module:J==null?void 0:J.module,tab:J==null?void 0:J.tab,id:J==null?void 0:J.id};p.ROUTER_PARAMS={...J,...r,prev:w}}}function O(){return pe().ROUTER_PARAMS||J}function ge(r){const o=pe();o.ROUTER_PARAMS?o.ROUTER_PARAMS.LISTENER={...o.ROUTER_PARAMS.LISTENER,...r}:o.ROUTER_PARAMS.LISTENER={...r}}function re(){return pe().ROUTER_PARAMS.LISTENER||J.LISTENER}var ce;(r=>{function o(){var x;let E=sessionStorage.getItem("f");if(E){if(E=le.deCode(E),!E)return!1;Z({id:E.id,tab:E.tab,page:E.page,module:E.module,time:E.time,payment:{active:!0},module_admin:E.module_admin})}else Z({id:0,tab:"",page:(x=localStorage.getItem("d"))!=null&&x.length?O().page:O().auth,module:O().module});return!0}function a(){te.id=0,te.tab="",te.page=O().page,te.module=O().module}r.Reset=a;function l({module:x=O().module,page:E=O().page,auth:N=O().auth,debug:M=O().debug}){Z({page:E,module:x,auth:N,debug:M}),o()}r.Default=l;function c(x){let E=I=>(Z({page:I}),I);const[N,M]=R.useState(w()||x&&E(x)||O().page);return ge({page:I=>{M(I)}}),N}r.usePage=c;function p(x,E=!0,N={}){Z({page:x,...N}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&re().page(x)}r.setPage=p;function w(){return O().page}r.getPage=w;function v(x){return O().page===x}r.isPage=v;function u(){return O().prev}r.getBack=u;function k(x,E){const[N,M]=R.useState(y()||x||O().module);return ge({module:M}),N}r.useModule=k;function h(x,E=!0){Z({module:x}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&re().module(x)}r.setModule=h;function y(){return O().module||""}r.getModule=y;function m(x){return O().module===x}r.isModule=m;function z(x,E){if(typeof x!="function"){const[N,M]=R.useState(!E),[I,B]=R.useState(x||ye());return ge({tabs:B}),E&&R.useEffect(()=>{M(!0)},[]),[I,N]}else ge({tabs:x})}r.useTabs=z;function $(x){let E=I=>(Z({tab:I}),I);const[N,M]=R.useState(ye()||x&&E(x)||O().tab);return ge({tabs:I=>{M(I)}}),N}r.useTab=$;async function Ne(x,E=!0){Z({tab:x}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&(re().tabs&&re().tabs(x))}r.setTabs=Ne;function ye(){return O().tab}r.getTabs=ye;function L(x){return O().tab===x}r.isTabs=L;function A(x){if(typeof x!="function"){const[E,N]=R.useState(x||Pe());return ge({id:M=>{N(M)}}),E}else ge({id:x})}r.useId=A;function Ie(x){}r.subId=Ie;async function Me(x,E=!0){Z({id:x}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&re().id(x)}r.setId=Me;function Pe(){return O().id}r.getId=Pe;function De(x){return Number(O().id)===x}r.isId=De;async function Fe(x){var E,N,M,I,B,D,U,de;const{page:X,module:Y,tab:Q,id:ee}=x;X!==void 0&&(te.page=X),Y!==void 0&&(te.module=Y),Q!==void 0&&(te.tab=Q),ee!==void 0&&(te.id=ee),Z({...te}),ee!==void 0&&((N=(E=re()).id)==null||N.call(E,ee)),Q!==void 0&&((I=(M=re()).tabs)==null||I.call(M,Q)),Y!==void 0&&((D=(B=re()).module)==null||D.call(B,Y)),X!==void 0&&((de=(U=re()).page)==null||de.call(U,X)),sessionStorage.setItem(O().STORAGE,le.enCode(O()))}r.navigate=Fe})(ce||(ce={}));const he={n:"_n_zlj3m_1",i:"_i_zlj3m_10",t:"_t_zlj3m_28",e:"_e_zlj3m_32",s:"_s_zlj3m_35",w:"_w_zlj3m_38",h:"_h_zlj3m_41"};let lt={};function _r(){const[r,o]=R.useState([]);return lt.set=a=>{o([...r,a])},lt.del=a=>{r.forEach((l,c)=>{l.key===a&&r.splice(c,1)}),o(r)},r.length===0?i.jsx(i.Fragment,{}):i.jsx("div",{className:he.n,children:r.map(a=>a.item)})}function br(r){let o=new Date().getTime();r.key=o,lt.set({item:i.jsx(vr,{data:r},o),key:o})}function vr(r){const o=r.data;let[a]=R.useState("show"),[l,c]=R.useState(!1);R.useEffect(()=>{setTimeout(function(){c(!0),lt.del(o.key)},5e3)},[o.key]);let p;switch(o.type){case"error":p=i.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm3.53 12.22a.75.75 0 1 1-1.06 1.06L12 13.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L10.94 12 8.47 9.53a.75.75 0 0 1 1.06-1.06L12 10.94l2.47-2.47a.75.75 0 0 1 1.06 1.06L13.06 12l2.47 2.47Z"});break;case"success":p=i.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm5.074 6.482-6.3 7.5a.748.748 0 0 1-.562.268h-.013a.75.75 0 0 1-.557-.248l-2.7-3a.751.751 0 0 1 .88-1.186c.09.045.17.107.234.182l2.123 2.36 5.747-6.84a.75.75 0 0 1 1.148.964Z"});break;case"warning":p=i.jsx("path",{d:"M12 2.625c-5.17 0-9.375 4.206-9.375 9.375 0 5.17 4.206 9.375 9.375 9.375 5.17 0 9.375-4.206 9.375-9.375 0-5.17-4.206-9.375-9.375-9.375Zm0 3.844a1.219 1.219 0 1 1 0 2.437 1.219 1.219 0 0 1 0-2.437Zm2.25 10.593h-4.125a.75.75 0 1 1 0-1.5h1.313v-4.124h-.75a.75.75 0 1 1 0-1.5h1.5a.75.75 0 0 1 .75.75v4.874h1.312a.75.75 0 1 1 0 1.5Z"});break;default:p="icon fa fa-exclamation-circle";break}const w={error:he.e,success:he.s,warning:he.w};return i.jsx(i.Fragment,{children:l?i.jsx(i.Fragment,{}):i.jsxs("div",{className:he.i+w[o.type]+` ${o.thema!==void 0?he.h:""}`,"data-status":a,children:[i.jsx("svg",{type:"solid",fill:"currentColor",stroke:"none",strokeWidth:"0",width:"24",height:"24",viewBox:"0 0 24 24",children:p}),i.jsx("span",{className:he.t,children:o.text})]})})}let me={Send:br,Init:_r};const ue={d:"_d_1u25q_1",b:"_b_1u25q_21",o:"_o_1u25q_25",m:"_m_1u25q_30",t:"_t_1u25q_41",a:"_a_1u25q_108",v:"_v_1u25q_118"},fe={is:!1,MainButton:{},BackButton:{}};let K={};K.dark={"--tg-theme-subtitle-text-color":"#98989e","--tg-theme-destructive-text-color":"#e53935","--tg-theme-section-separator-color":"#545458","--tg-theme-link-color":"#3e88f7","--tg-theme-accent-text-color":"#3e88f7","--tg-theme-bg-color":"#000000","--tg-theme-secondary-bg-color":"#1c1c1d","--tg-theme-button-color":"#3e88f7","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#1d1d1d","--tg-theme-section-header-text-color":"#8d8e93","--tg-theme-header-bg-color":"#1a1a1a","--tg-theme-hint-color":"#98989e","--tg-theme-text-color":"#ffffff","--tg-theme-section-bg-color":"#2c2c2e"},K.light={"--tg-theme-subtitle-text-color":"#8e8e93","--tg-theme-destructive-text-color":"#ff3b30","--tg-theme-section-separator-color":"#c8c7cc","--tg-theme-link-color":"#007aff","--tg-theme-accent-text-color":"#007aff","--tg-theme-bg-color":"#ffffff","--tg-theme-secondary-bg-color":"#efeff4","--tg-theme-button-color":"#007aff","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#f2f2f2","--tg-theme-section-header-text-color":"#6d6d72","--tg-theme-header-bg-color":"#f8f8f8","--tg-theme-hint-color":"#8e8e93","--tg-theme-text-color":"#000000","--tg-theme-section-bg-color":"#f8f8f8"},K.users={"--tg-theme-bg-color":"#000000","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#98989e","--tg-theme-link-color":"#ffffff","--tg-theme-button-color":"#ffffff","--tg-theme-button-text-color":"#000000","--tg-theme-secondary-bg-color":"#000000"};const yr=()=>{if(location.hostname==="localhost"){let[r,o]=R.useState(!1),[a,l]=R.useState(!1),[c,p]=R.useState("dark"),[w,v]=R.useState(!1),[u,k]=R.useState(!1);fe.is=!0,fe.MainButton.set=o,fe.BackButton.set=l,R.useEffect(()=>{K[c]["--tg-theme-bg-color-alpha"]=K[c]["--tg-theme-bg-color"]+"b3",K[c]["--tg-theme-secondary-bg-color-alpha"]=K[c]["--tg-theme-secondary-bg-color"]+"d3";for(let m in K[c])document.documentElement.style.setProperty(m,K[c][m]);ve.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]);let h=m=>{for(let z in K[m])document.documentElement.style.setProperty(z,K[m][z]);p(m),v(!1)},y=()=>{v(!1),k(!0)};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ue.d,children:[a===!1?i.jsx("div",{className:ue.b,children:"Отмена"}):i.jsx("div",{onClick:()=>{var m;a.page===void 0?(m=a.callback)==null||m.call(a):ce.setPage(a.page)},className:ue.b,children:"Назад"}),i.jsx("div",{className:ue.o,onClick:()=>v(!w),children:"Меню"})]}),i.jsx(me.Init,{}),r&&i.jsx("div",{className:ue.m,children:i.jsx("button",{onClick:()=>{r.page&&ce.setPage(r.page),r.callback&&r.callback()},children:r.text})}),w?i.jsxs("div",{className:ue.t,children:[i.jsxs("ul",{children:[i.jsx("li",{children:i.jsx("button",{onClick:y,children:"Authorization"})}),i.jsx("li",{})]}),i.jsxs("ul",{children:[i.jsxs("li",{children:[i.jsx("button",{children:"Thema"}),i.jsxs("ol",{children:[i.jsx("li",{children:i.jsx("button",{onClick:()=>h("dark"),children:"Dark"})}),i.jsx("li",{children:i.jsx("button",{onClick:()=>h("light"),children:"Light"})}),i.jsx("li",{children:i.jsx("button",{onClick:()=>h("users"),children:"Users"})})]})]}),i.jsx("li",{children:i.jsx("button",{onClick:()=>v(!w),children:"Closed"})})]})]}):"",u?i.jsx(xr,{setAuthorization:k}):""]})}else return R.useEffect(()=>{document.documentElement.style.setProperty("--tg-theme-secondary-bg-color-alpha",ve.themeParams.secondary_bg_color+"d3"),document.documentElement.style.setProperty("--tg-theme-bg-color-alpha",ve.themeParams.bg_color+"b3"),ve.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]),i.jsx(i.Fragment,{children:i.jsx(me.Init,{})})},xr=({setAuthorization:r})=>{let o={},a=()=>{localStorage.setItem("auth",o)};return i.jsx("div",{className:ue.a,children:i.jsxs("div",{className:ue.v,children:[i.jsx("fieldset",{}),i.jsx("div",{onClick:a,children:" Сохранить "})]})})},Qt={p:"_p_1axqy_1",s:"_s_1axqy_17"},kr=({className:r,children:o,isScroll:a=!0})=>i.jsx("div",{className:[Qt.p,a&&Qt.s,r].filter(l=>l!==void 0).join(" "),children:o}),wr={l:"_l_gfyud_1"},Sr=({children:r,className:o})=>i.jsx("div",{className:[wr.l,o].filter(a=>a!==void 0).join(" "),children:r}),_e={m:"_m_ppm7n_2",g:"_g_ppm7n_10",i:"_i_ppm7n_18",c:"_c_ppm7n_35",l:"_l_ppm7n_42",a:"_a_ppm7n_57",n:"_n_ppm7n_62"},Rr=({items:r})=>{const o=l=>{ce.setPage(l)},a=l=>{ve.openTelegramLink(l)};return i.jsx("div",{className:_e.m,children:r.map(l=>i.jsx("div",{className:_e.g,children:l.items.map((c,p)=>i.jsxs("div",{className:_e.i,onClick:()=>{c.link&&a(c.link),c.page&&o(c.page),c.callback&&c.callback()},children:[i.jsxs("div",{className:_e.c,children:[i.jsx("span",{className:_e.l,style:{background:c.color},children:c.icon}),c.title,c.count&&i.jsx("span",{className:_e.n,children:c.count})]}),i.jsx("span",{className:_e.a,children:"›"})]},p))},l.id))})},oe={o:"_o_8ho2f_3",m:"_m_8ho2f_14",l:"_l_8ho2f_28",r:"_r_8ho2f_33",x:"_x_8ho2f_38",h:"_h_8ho2f_42",c:"_c_8ho2f_57",u:"_u_8ho2f_72"};function jr({children:r,icon:o,iconBadge:a=0,title:l,className:c,view:p="list",position:w="left"}){const[v,u]=R.useState(!1),[k,h]=R.useState(null);R.useEffect(()=>{let m=document.querySelector(".p_sb");return m||(m=document.createElement("div"),m.className="_p_sb",document.body.appendChild(m)),h(m),()=>{m&&m.parentNode&&m.parentNode.removeChild(m)}},[]);const y=i.jsxs(i.Fragment,{children:[v&&i.jsx("div",{className:oe.o,onClick:()=>u(!1)}),i.jsxs("div",{className:be(oe.m,w==="left"?oe.l:oe.r,v&&oe.x,c),children:[i.jsxs("div",{className:oe.h,children:[l&&i.jsx("h3",{className:oe.t,children:l}),i.jsxs("svg",{onClick:()=>u(!1),fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",width:"24",height:"24","data-pointer":"true",style:{cursor:"pointer"},children:[i.jsx("path",{d:"M17.25 17.25 6.75 6.75"}),i.jsx("path",{d:"m17.25 6.75-10.5 10.5"})]})]}),i.jsx("div",{className:oe.c,children:p==="list"?i.jsx("ul",{className:oe.u,children:r}):r})]})]});return i.jsxs(i.Fragment,{children:[o&&i.jsx("div",{onClick:()=>u(!0),className:"bage","data-count":a,children:o}),k&&ar.createPortal(y,k)]})}let Be=()=>{};const er=({children:r,title:o,isOverlay:a=!0,footer:l=!0,className:c,onOpen:p})=>{const[w,v]=R.useState(!1);return Be=()=>{v(!0),setTimeout(()=>{var u;p==null||p(!1),(u=Ce==null?void 0:Ce.onClose)==null||u.call(Ce)},300)},i.jsx("div",{className:`footer-menu-overlay ${a?"is-overlay":""} ${w?"closing":""} `,onClick:Be,children:i.jsxs("div",{className:`footer-menu-popup-book ${w?"closing":""} ${c||""} ${l?"footer":""}`,onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{className:"footer-menu-header",children:[i.jsx("h3",{children:o}),i.jsx("button",{className:"footer-menu-close-btn",onClick:Be,children:"✕"})]}),r]})})},tr={h:"_h_1gb68_1",row:"_row_1gb68_20",column:"_column_1gb68_23"},Er={b:"_b_r6m8n_1"},Ar=({className:r,value:o})=>i.jsx("div",{className:[Er.b,r].filter(a=>a!==void 0).join(" "),children:o}),Ce=[],rr=(r,o)=>r.findIndex(a=>(a==null?void 0:a.page)===o),Or=({actions:r,children:o,className:a,toHide:l=!1,page:c,onPageChange:p,direction:w="row"})=>{const[v,u]=R.useState(null),[k,h]=R.useState(c?rr(r||[],c):0);return Ce.onClose=()=>{u(null),h(c?rr(r||[],c):0)},R.useEffect(()=>{if(!l)return;const y=document.querySelectorAll("[contenteditable]"),m=()=>{const $=document.querySelector("footer");$&&($.style.display="flex")},z=()=>{const $=document.querySelector("footer");$&&($.style.display="none")};return y.forEach($=>{$.addEventListener("focus",z,!0),$.addEventListener("blur",m,!0)}),()=>{y.forEach($=>{$.removeEventListener("focus",z,!0),$.removeEventListener("blur",m,!0)})}},[]),i.jsxs(i.Fragment,{children:[v,i.jsxs("footer",{className:`${tr.h} ${tr[w]} ${a} `,children:[o,r&&r.map((y,m)=>i.jsxs("div",{"data-active":k===m?"true":"false",onClick:()=>{y.page&&(h(m),p==null||p(y.page)),y.onClick&&y.onClick(()=>h(m)),y.component&&(k===m?Be():(u(y.component),h(m)))},children:[y.icon,y.badge&&i.jsx(Ar,{value:y.badge})]},m))]})]})},ct={w:"_w_yx04q_3",v:"_v_yx04q_24",s:"_s_yx04q_34",n:"_n_yx04q_38"},dt={};function Cr({children:r,name:o,onClose:a,isOpen:l,isScroll:c=!0,nextBackButton:p}){const[w,v]=R.useState(!1);return R.useEffect(()=>{if(!l)return;const u=p===void 0?nr().pop():p,k=()=>{v(!1),setTimeout(()=>{gt(u||!1),a==null||a()},300)};dt[o]={onClose:k,onOpen:()=>{v(!0)}},gt({callback:k});const h=setTimeout(()=>{v(!0)},10);return()=>{clearTimeout(h)}},[l]),l?i.jsxs("div",{className:be(ct.w,w&&ct.v,c&&ct.s),children:[i.jsx("div",{className:ct.n}),r]}):""}const Pr=(r,o)=>{var a,l;o?(a=dt[r])==null||a.onOpen():(l=dt[r])==null||l.onClose()},or={s:"_s_ezoxx_3",n:"_n_ezoxx_14"};function $r({className:r,children:o,onScrollEnd:a,offset:l=100,isLoading:c,isScrollBar:p=!1}){const[w,v]=R.useState(c||!1);R.useEffect(()=>{v(c||!1)},[c]);let u={onScroll:k=>{const{scrollTop:h,scrollHeight:y,clientHeight:m}=k.currentTarget;h+m>=y-l&&!w&&(v(!0),a==null||a())}};return i.jsx("div",{...u,className:be(or.s,!p&&or.n,r),children:o})}const pt={a:"_a_ohhaz_1",l:"_l_ohhaz_12",r:"_r_ohhaz_15"};function Tr({children:r,className:o,position:a="center",title:l}){let c="";return a==="left"?c=pt.l:a==="right"&&(c=pt.r),i.jsxs("div",{className:be(pt.a,c,o),children:[r,l&&i.jsx("b",{children:l})]})}const F={state:[!1],listen:[],prev:{},router:r=>{r===!1?(_.default.WebApp.BackButton.isVisible=!1,_.default.WebApp.BackButton.offClick(F.listen[0]),F.listen.shift(),F.state.length!==1&&F.state.pop()):(_.default.WebApp.BackButton.isVisible=!0,_.default.WebApp.BackButton.offClick(F.listen[0]),F.listen.shift(),F.listen.push(()=>{var a;let o=F.state.pop();F.prev=ce.getPage(),o.page!==void 0?ce.setPage(o.page):(a=o.callback)==null||a.call(o)}),ve.BackButton.onClick(F.listen[0]))}},be=(...r)=>r.filter(o=>o!==void 0&&o!==!1&&o!==null&&o!=="").join(" ");_.default=void 0,(r=>{r.WebApp=window.Telegram.WebApp,r.getUser=()=>{var o;return((o=r.WebApp.initDataUnsafe)==null?void 0:o.user)===void 0?{}:r.WebApp.initDataUnsafe},r.Location=o=>{if(fe.is)return o({latitude:0,longitude:0});let a=()=>{r.WebApp.LocationManager.getLocation(async l=>{if(!l){r.WebApp.LocationManager.isAccessRequested||r.WebApp.LocationManager.openSettings();return}o(l)})};!r.WebApp.LocationManager||!r.WebApp.LocationManager.isInited?r.WebApp.LocationManager.init(()=>{a()}):a()},r.Notice={Send:(o,a,l)=>{var c,p;a!==void 0?(me.Send({type:o,text:a,thema:l}),(c=r.WebApp.HapticFeedback)==null||c.notificationOccurred(o)):(me.Send(o),(p=r.WebApp.HapticFeedback)==null||p.notificationOccurred(o.type))},Error:o=>{var a;me.Send({type:"error",text:o}),(a=r.WebApp.HapticFeedback)==null||a.notificationOccurred("error")},Success:o=>{var a;me.Send({type:"success",text:o}),(a=r.WebApp.HapticFeedback)==null||a.notificationOccurred("success")},Warning:o=>{var a;me.Send({type:"warning",text:o}),(a=r.WebApp.HapticFeedback)==null||a.notificationOccurred("warning")}},r.Header=yr,r.TabBar=Or,r.BottomSheet=er,r.toggleBottomSheet=Be,r.SafeArea=kr,r.Loading=Sr,r.Sidebar=jr,r.SidePanel=Cr,r.AppBar=Tr,r.SidePanelController=Pr,r.Scroll=$r,r.Modal=ft,r.Menu=Rr,r.MainButton={callback:[],set:o=>{fe.is?fe.MainButton.set(o):(r.WebApp.MainButton.callback.forEach(a=>{r.WebApp.MainButton.offClick(a)}),r.WebApp.MainButton.callback=[],typeof o=="boolean"?r.WebApp.MainButton.isVisible=!1:(r.WebApp.MainButton.text=o.text,o.color&&(r.WebApp.MainButton.color=o.color),o.textColor&&(r.WebApp.MainButton.textColor=o.textColor),r.WebApp.MainButton.isVisible=!0,r.WebApp.MainButton.isActive=o.isActive===void 0?!0:o.isActive,r.WebApp.MainButton.callback.push(()=>{var a;o.page===void 0?(a=o.callback)==null||a.call(o):ce.setPage(o.page)}),r.WebApp.MainButton.onClick(r.WebApp.MainButton.callback[0])))}},r.BackButtonPrev=()=>{F.prev&&(0,r.BackButton)(F.prev)},r.BackButtonState=()=>F.state,r.BackButton=o=>{fe.is?fe.BackButton.set(o):(F.state.push(o),F.router(o))}})(_.default||(_.default={}));const zr=_.default.TabBar,Br=er,gt=_.default.BackButton,Nr=_.default.BackButtonPrev,nr=_.default.BackButtonState,Ir=_.default.Notice,Mr=_.default.SafeArea,Dr=_.default.Loading,Fr=_.default.Menu,Lr=_.default.SidePanel,Wr=_.default.Scroll,Ur=_.default.AppBar,qr=_.default.Sidebar,Vr=_.default.Location,Hr=_.default.SidePanelController,{Header:Jr,toggleBottomSheet:Kr,Modal:Gr,MainButton:Zr,WebApp:ve,getUser:Xr}=_.default;_.AppBar=Ur,_.BackButton=gt,_.BackButtonPrev=Nr,_.BackButtonState=nr,_.BottomSheet=Br,_.Header=Jr,_.Loading=Dr,_.Location=Vr,_.MainButton=Zr,_.Menu=Fr,_.Modal=Gr,_.Notice=Ir,_.SafeArea=Mr,_.Scroll=Wr,_.SidePanel=Lr,_.SidePanelController=Hr,_.Sidebar=qr,_.TabBar=zr,_.WebApp=ve,_.clsx=be,_.getUser=Xr,_.toggleBottomSheet=Kr,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
60
+ <%s key={someKey} {...props} />`,Ae,W,Ft,W),ot[W+Ae]=!0}}return e===l?Bt(j):zt(j),j}}function Nt(e,t,n){return nt(e,t,n,!0)}function It(e,t,n){return nt(e,t,n,!1)}var Mt=It,Dt=Nt;st.Fragment=l,st.jsx=Mt,st.jsxs=Dt}()),st}process.env.NODE_ENV==="production"?gr():hr();const mr="0.0.40",Yt={version:mr},te={},J={module:"",v:Yt.version,page:"Main",auth:"Auth",STORAGE:"f",LISTENER:{},debug:!1,tab:"",id:0,prev:{page:"",module:"",tab:"",id:0}};function pe(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:{}}pe().elcrm||(pe().elcrm={}),Object.assign(pe().elcrm,{router:Yt.version});function Z(r){var o,a,l,c;const p=pe();if(p.ROUTER_PARAMS){r.debug||p.ROUTER_PARAMS.debug;const w={page:(o=p.ROUTER_PARAMS)==null?void 0:o.page,module:(a=p.ROUTER_PARAMS)==null?void 0:a.module,tab:(l=p.ROUTER_PARAMS)==null?void 0:l.tab,id:(c=p.ROUTER_PARAMS)==null?void 0:c.id};p.ROUTER_PARAMS={...p.ROUTER_PARAMS,...r,prev:w}}else{r.debug||J.debug;const w={page:J==null?void 0:J.page,module:J==null?void 0:J.module,tab:J==null?void 0:J.tab,id:J==null?void 0:J.id};p.ROUTER_PARAMS={...J,...r,prev:w}}}function O(){return pe().ROUTER_PARAMS||J}function ge(r){const o=pe();o.ROUTER_PARAMS?o.ROUTER_PARAMS.LISTENER={...o.ROUTER_PARAMS.LISTENER,...r}:o.ROUTER_PARAMS.LISTENER={...r}}function re(){return pe().ROUTER_PARAMS.LISTENER||J.LISTENER}var ce;(r=>{function o(){var x;let E=sessionStorage.getItem("f");if(E){if(E=le.deCode(E),!E)return!1;Z({id:E.id,tab:E.tab,page:E.page,module:E.module,time:E.time,payment:{active:!0},module_admin:E.module_admin})}else Z({id:0,tab:"",page:(x=localStorage.getItem("d"))!=null&&x.length?O().page:O().auth,module:O().module});return!0}function a(){te.id=0,te.tab="",te.page=O().page,te.module=O().module}r.Reset=a;function l({module:x=O().module,page:E=O().page,auth:N=O().auth,debug:M=O().debug}){Z({page:E,module:x,auth:N,debug:M}),o()}r.Default=l;function c(x){let E=I=>(Z({page:I}),I);const[N,M]=R.useState(w()||x&&E(x)||O().page);return ge({page:I=>{M(I)}}),N}r.usePage=c;function p(x,E=!0,N={}){Z({page:x,...N}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&re().page(x)}r.setPage=p;function w(){return O().page}r.getPage=w;function v(x){return O().page===x}r.isPage=v;function u(){return O().prev}r.getBack=u;function k(x,E){const[N,M]=R.useState(y()||x||O().module);return ge({module:M}),N}r.useModule=k;function h(x,E=!0){Z({module:x}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&re().module(x)}r.setModule=h;function y(){return O().module||""}r.getModule=y;function m(x){return O().module===x}r.isModule=m;function z(x,E){if(typeof x!="function"){const[N,M]=R.useState(!E),[I,B]=R.useState(x||ye());return ge({tabs:B}),E&&R.useEffect(()=>{M(!0)},[]),[I,N]}else ge({tabs:x})}r.useTabs=z;function $(x){let E=I=>(Z({tab:I}),I);const[N,M]=R.useState(ye()||x&&E(x)||O().tab);return ge({tabs:I=>{M(I)}}),N}r.useTab=$;async function Ne(x,E=!0){Z({tab:x}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&(re().tabs&&re().tabs(x))}r.setTabs=Ne;function ye(){return O().tab}r.getTabs=ye;function L(x){return O().tab===x}r.isTabs=L;function A(x){if(typeof x!="function"){const[E,N]=R.useState(x||Pe());return ge({id:M=>{N(M)}}),E}else ge({id:x})}r.useId=A;function Ie(x){}r.subId=Ie;async function Me(x,E=!0){Z({id:x}),sessionStorage.setItem(O().STORAGE,le.enCode(O())),E&&re().id(x)}r.setId=Me;function Pe(){return O().id}r.getId=Pe;function De(x){return Number(O().id)===x}r.isId=De;async function Fe(x){var E,N,M,I,B,D,U,de;const{page:X,module:Y,tab:Q,id:ee}=x;X!==void 0&&(te.page=X),Y!==void 0&&(te.module=Y),Q!==void 0&&(te.tab=Q),ee!==void 0&&(te.id=ee),Z({...te}),ee!==void 0&&((N=(E=re()).id)==null||N.call(E,ee)),Q!==void 0&&((I=(M=re()).tabs)==null||I.call(M,Q)),Y!==void 0&&((D=(B=re()).module)==null||D.call(B,Y)),X!==void 0&&((de=(U=re()).page)==null||de.call(U,X)),sessionStorage.setItem(O().STORAGE,le.enCode(O()))}r.navigate=Fe})(ce||(ce={}));const he={n:"_n_zlj3m_1",i:"_i_zlj3m_10",t:"_t_zlj3m_28",e:"_e_zlj3m_32",s:"_s_zlj3m_35",w:"_w_zlj3m_38",h:"_h_zlj3m_41"};let lt={};function _r(){const[r,o]=R.useState([]);return lt.set=a=>{o([...r,a])},lt.del=a=>{r.forEach((l,c)=>{l.key===a&&r.splice(c,1)}),o(r)},r.length===0?i.jsx(i.Fragment,{}):i.jsx("div",{className:he.n,children:r.map(a=>a.item)})}function br(r){let o=new Date().getTime();r.key=o,lt.set({item:i.jsx(vr,{data:r},o),key:o})}function vr(r){const o=r.data;let[a]=R.useState("show"),[l,c]=R.useState(!1);R.useEffect(()=>{setTimeout(function(){c(!0),lt.del(o.key)},5e3)},[o.key]);let p;switch(o.type){case"error":p=i.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm3.53 12.22a.75.75 0 1 1-1.06 1.06L12 13.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L10.94 12 8.47 9.53a.75.75 0 0 1 1.06-1.06L12 10.94l2.47-2.47a.75.75 0 0 1 1.06 1.06L13.06 12l2.47 2.47Z"});break;case"success":p=i.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm5.074 6.482-6.3 7.5a.748.748 0 0 1-.562.268h-.013a.75.75 0 0 1-.557-.248l-2.7-3a.751.751 0 0 1 .88-1.186c.09.045.17.107.234.182l2.123 2.36 5.747-6.84a.75.75 0 0 1 1.148.964Z"});break;case"warning":p=i.jsx("path",{d:"M12 2.625c-5.17 0-9.375 4.206-9.375 9.375 0 5.17 4.206 9.375 9.375 9.375 5.17 0 9.375-4.206 9.375-9.375 0-5.17-4.206-9.375-9.375-9.375Zm0 3.844a1.219 1.219 0 1 1 0 2.437 1.219 1.219 0 0 1 0-2.437Zm2.25 10.593h-4.125a.75.75 0 1 1 0-1.5h1.313v-4.124h-.75a.75.75 0 1 1 0-1.5h1.5a.75.75 0 0 1 .75.75v4.874h1.312a.75.75 0 1 1 0 1.5Z"});break;default:p="icon fa fa-exclamation-circle";break}const w={error:he.e,success:he.s,warning:he.w};return i.jsx(i.Fragment,{children:l?i.jsx(i.Fragment,{}):i.jsxs("div",{className:he.i+w[o.type]+` ${o.thema!==void 0?he.h:""}`,"data-status":a,children:[i.jsx("svg",{type:"solid",fill:"currentColor",stroke:"none",strokeWidth:"0",width:"24",height:"24",viewBox:"0 0 24 24",children:p}),i.jsx("span",{className:he.t,children:o.text})]})})}let me={Send:br,Init:_r};const ue={d:"_d_1u25q_1",b:"_b_1u25q_21",o:"_o_1u25q_25",m:"_m_1u25q_30",t:"_t_1u25q_41",a:"_a_1u25q_108",v:"_v_1u25q_118"},fe={is:!1,MainButton:{},BackButton:{}};let K={};K.dark={"--tg-theme-subtitle-text-color":"#98989e","--tg-theme-destructive-text-color":"#e53935","--tg-theme-section-separator-color":"#545458","--tg-theme-link-color":"#3e88f7","--tg-theme-accent-text-color":"#3e88f7","--tg-theme-bg-color":"#000000","--tg-theme-secondary-bg-color":"#1c1c1d","--tg-theme-button-color":"#3e88f7","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#1d1d1d","--tg-theme-section-header-text-color":"#8d8e93","--tg-theme-header-bg-color":"#1a1a1a","--tg-theme-hint-color":"#98989e","--tg-theme-text-color":"#ffffff","--tg-theme-section-bg-color":"#2c2c2e"},K.light={"--tg-theme-subtitle-text-color":"#8e8e93","--tg-theme-destructive-text-color":"#ff3b30","--tg-theme-section-separator-color":"#c8c7cc","--tg-theme-link-color":"#007aff","--tg-theme-accent-text-color":"#007aff","--tg-theme-bg-color":"#ffffff","--tg-theme-secondary-bg-color":"#efeff4","--tg-theme-button-color":"#007aff","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#f2f2f2","--tg-theme-section-header-text-color":"#6d6d72","--tg-theme-header-bg-color":"#f8f8f8","--tg-theme-hint-color":"#8e8e93","--tg-theme-text-color":"#000000","--tg-theme-section-bg-color":"#f8f8f8"},K.users={"--tg-theme-bg-color":"#000000","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#98989e","--tg-theme-link-color":"#ffffff","--tg-theme-button-color":"#ffffff","--tg-theme-button-text-color":"#000000","--tg-theme-secondary-bg-color":"#000000"};const yr=()=>{if(location.hostname==="localhost"){let[r,o]=R.useState(!1),[a,l]=R.useState(!1),[c,p]=R.useState("dark"),[w,v]=R.useState(!1),[u,k]=R.useState(!1);fe.is=!0,fe.MainButton.set=o,fe.BackButton.set=l,R.useEffect(()=>{K[c]["--tg-theme-bg-color-alpha"]=K[c]["--tg-theme-bg-color"]+"b3",K[c]["--tg-theme-secondary-bg-color-alpha"]=K[c]["--tg-theme-secondary-bg-color"]+"d3";for(let m in K[c])document.documentElement.style.setProperty(m,K[c][m]);ve.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]);let h=m=>{for(let z in K[m])document.documentElement.style.setProperty(z,K[m][z]);p(m),v(!1)},y=()=>{v(!1),k(!0)};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ue.d,children:[a===!1?i.jsx("div",{className:ue.b,children:"Отмена"}):i.jsx("div",{onClick:()=>{var m;a.page===void 0?(m=a.callback)==null||m.call(a):ce.setPage(a.page)},className:ue.b,children:"Назад"}),i.jsx("div",{className:ue.o,onClick:()=>v(!w),children:"Меню"})]}),i.jsx(me.Init,{}),r&&i.jsx("div",{className:ue.m,children:i.jsx("button",{onClick:()=>{r.page&&ce.setPage(r.page),r.callback&&r.callback()},children:r.text})}),w?i.jsxs("div",{className:ue.t,children:[i.jsxs("ul",{children:[i.jsx("li",{children:i.jsx("button",{onClick:y,children:"Authorization"})}),i.jsx("li",{})]}),i.jsxs("ul",{children:[i.jsxs("li",{children:[i.jsx("button",{children:"Thema"}),i.jsxs("ol",{children:[i.jsx("li",{children:i.jsx("button",{onClick:()=>h("dark"),children:"Dark"})}),i.jsx("li",{children:i.jsx("button",{onClick:()=>h("light"),children:"Light"})}),i.jsx("li",{children:i.jsx("button",{onClick:()=>h("users"),children:"Users"})})]})]}),i.jsx("li",{children:i.jsx("button",{onClick:()=>v(!w),children:"Closed"})})]})]}):"",u?i.jsx(xr,{setAuthorization:k}):""]})}else return R.useEffect(()=>{document.documentElement.style.setProperty("--tg-theme-secondary-bg-color-alpha",ve.themeParams.secondary_bg_color+"d3"),document.documentElement.style.setProperty("--tg-theme-bg-color-alpha",ve.themeParams.bg_color+"b3"),ve.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]),i.jsx(i.Fragment,{children:i.jsx(me.Init,{})})},xr=({setAuthorization:r})=>{let o={},a=()=>{localStorage.setItem("auth",o)};return i.jsx("div",{className:ue.a,children:i.jsxs("div",{className:ue.v,children:[i.jsx("fieldset",{}),i.jsx("div",{onClick:a,children:" Сохранить "})]})})},Qt={p:"_p_1axqy_1",s:"_s_1axqy_17"},kr=({className:r,children:o,isScroll:a=!0})=>i.jsx("div",{className:[Qt.p,a&&Qt.s,r].filter(l=>l!==void 0).join(" "),children:o}),wr={l:"_l_gfyud_1"},Sr=({children:r,className:o})=>i.jsx("div",{className:[wr.l,o].filter(a=>a!==void 0).join(" "),children:r}),_e={m:"_m_ppm7n_2",g:"_g_ppm7n_10",i:"_i_ppm7n_18",c:"_c_ppm7n_35",l:"_l_ppm7n_42",a:"_a_ppm7n_57",n:"_n_ppm7n_62"},Rr=({items:r})=>{const o=l=>{ce.setPage(l)},a=l=>{ve.openTelegramLink(l)};return i.jsx("div",{className:_e.m,children:r.map(l=>i.jsx("div",{className:_e.g,children:l.items.map((c,p)=>i.jsxs("div",{className:_e.i,onClick:()=>{c.link&&a(c.link),c.page&&o(c.page),c.callback&&c.callback()},children:[i.jsxs("div",{className:_e.c,children:[i.jsx("span",{className:_e.l,style:{background:c.color},children:c.icon}),c.title,c.count&&i.jsx("span",{className:_e.n,children:c.count})]}),i.jsx("span",{className:_e.a,children:"›"})]},p))},l.id))})},oe={o:"_o_8ho2f_3",m:"_m_8ho2f_14",l:"_l_8ho2f_28",r:"_r_8ho2f_33",x:"_x_8ho2f_38",h:"_h_8ho2f_42",c:"_c_8ho2f_57",u:"_u_8ho2f_72"};function jr({children:r,icon:o,iconBadge:a=0,title:l,className:c,view:p="list",position:w="left"}){const[v,u]=R.useState(!1),[k,h]=R.useState(null);R.useEffect(()=>{let m=document.querySelector(".p_sb");return m||(m=document.createElement("div"),m.className="_p_sb",document.body.appendChild(m)),h(m),()=>{m&&m.parentNode&&m.parentNode.removeChild(m)}},[]);const y=i.jsxs(i.Fragment,{children:[v&&i.jsx("div",{className:oe.o,onClick:()=>u(!1)}),i.jsxs("div",{className:be(oe.m,w==="left"?oe.l:oe.r,v&&oe.x,c),children:[i.jsxs("div",{className:oe.h,children:[l&&i.jsx("h3",{className:oe.t,children:l}),i.jsxs("svg",{onClick:()=>u(!1),fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",width:"24",height:"24","data-pointer":"true",style:{cursor:"pointer"},children:[i.jsx("path",{d:"M17.25 17.25 6.75 6.75"}),i.jsx("path",{d:"m17.25 6.75-10.5 10.5"})]})]}),i.jsx("div",{className:oe.c,children:p==="list"?i.jsx("ul",{className:oe.u,children:r}):r})]})]});return i.jsxs(i.Fragment,{children:[o&&i.jsx("div",{onClick:()=>u(!0),className:"bage","data-count":a,children:o}),k&&ar.createPortal(y,k)]})}let Be=()=>{};const er=({children:r,title:o,isOverlay:a=!0,footer:l=!0,className:c,onOpen:p})=>{const[w,v]=R.useState(!1);return Be=()=>{v(!0),setTimeout(()=>{var u;p==null||p(!1),(u=Ce==null?void 0:Ce.onClose)==null||u.call(Ce)},300)},i.jsx("div",{className:`footer-menu-overlay ${a?"is-overlay":""} ${w?"closing":""} `,onClick:Be,children:i.jsxs("div",{className:`footer-menu-popup-book ${w?"closing":""} ${c||""} ${l?"footer":""}`,onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{className:"footer-menu-header",children:[i.jsx("h3",{children:o}),i.jsx("button",{className:"footer-menu-close-btn",onClick:Be,children:"✕"})]}),r]})})},tr={h:"_h_1gb68_1",row:"_row_1gb68_20",column:"_column_1gb68_23"},Er={b:"_b_r6m8n_1"},Ar=({className:r,value:o})=>i.jsx("div",{className:[Er.b,r].filter(a=>a!==void 0).join(" "),children:o}),Ce=[],rr=(r,o)=>r.findIndex(a=>(a==null?void 0:a.page)===o),Or=({actions:r,children:o,className:a,toHide:l=!1,page:c,onPageChange:p,direction:w="row"})=>{const[v,u]=R.useState(null),[k,h]=R.useState(c?rr(r||[],c):0);return Ce.onClose=()=>{u(null),h(c?rr(r||[],c):0)},R.useEffect(()=>{if(!l)return;const y=document.querySelectorAll("[contenteditable]"),m=()=>{const $=document.querySelector("footer");$&&($.style.display="flex")},z=()=>{const $=document.querySelector("footer");$&&($.style.display="none")};return y.forEach($=>{$.addEventListener("focus",z,!0),$.addEventListener("blur",m,!0)}),()=>{y.forEach($=>{$.removeEventListener("focus",z,!0),$.removeEventListener("blur",m,!0)})}},[]),i.jsxs(i.Fragment,{children:[v,i.jsxs("footer",{className:`${tr.h} ${tr[w]} ${a} `,children:[o,r&&r.map((y,m)=>i.jsxs("div",{"data-active":k===m?"true":"false",onClick:()=>{y.page&&(h(m),p==null||p(y.page)),y.onClick&&y.onClick(()=>h(m)),y.component&&(k===m?Be():(u(y.component),h(m)))},children:[y.icon,y.badge&&i.jsx(Ar,{value:y.badge})]},m))]})]})},ct={w:"_w_yx04q_3",v:"_v_yx04q_24",s:"_s_yx04q_34",n:"_n_yx04q_38"},dt={};function Cr({children:r,name:o,onClose:a,isOpen:l,isScroll:c=!0,nextBackButton:p}){const[w,v]=R.useState(!1);return R.useEffect(()=>{if(!l)return;const u=p===void 0?nr().pop():p,k=()=>{v(!1),setTimeout(()=>{gt(u||!1),a==null||a()},300)};dt[o]={onClose:k,onOpen:()=>{v(!0)}},gt({callback:k});const h=setTimeout(()=>{v(!0)},10);return()=>{clearTimeout(h)}},[l]),l?i.jsxs("div",{className:be(ct.w,w&&ct.v,c&&ct.s),children:[i.jsx("div",{className:ct.n}),r]}):""}const Pr=(r,o)=>{var a,l;o?(a=dt[r])==null||a.onOpen():(l=dt[r])==null||l.onClose()},or={s:"_s_ezoxx_3",n:"_n_ezoxx_14"};function $r({className:r,children:o,onScrollEnd:a,offset:l=100,isLoading:c,isScrollBar:p=!1}){const[w,v]=R.useState(c||!1);R.useEffect(()=>{v(c||!1)},[c]);let u={onScroll:k=>{const{scrollTop:h,scrollHeight:y,clientHeight:m}=k.currentTarget;h+m>=y-l&&!w&&(v(!0),a==null||a())}};return i.jsx("div",{...u,className:be(or.s,!p&&or.n,r),children:o})}const pt={a:"_a_ohhaz_1",l:"_l_ohhaz_12",r:"_r_ohhaz_15"};function Tr({children:r,className:o,position:a="center",title:l}){let c="";return a==="left"?c=pt.l:a==="right"&&(c=pt.r),i.jsxs("div",{className:be(pt.a,c,o),children:[r,l&&i.jsx("b",{children:l})]})}const F={state:[!1],listen:[],prev:{},router:r=>{r===!1?(_.default.WebApp.BackButton.isVisible=!1,_.default.WebApp.BackButton.offClick(F.listen[0]),F.listen.shift(),F.state.length!==1&&F.state.pop()):(_.default.WebApp.BackButton.isVisible=!0,_.default.WebApp.BackButton.offClick(F.listen[0]),F.listen.shift(),F.listen.push(()=>{var a;let o=F.state.pop();F.prev=ce.getPage(),o.page!==void 0?ce.setPage(o.page):(a=o.callback)==null||a.call(o)}),ve.BackButton.onClick(F.listen[0]))}},be=(...r)=>r.filter(o=>o!==void 0&&o!==!1&&o!==null&&o!=="").join(" ");_.default=void 0,(r=>{r.WebApp=window.Telegram.WebApp,r.getUser=()=>{var o;return((o=r.WebApp.initDataUnsafe)==null?void 0:o.user)===void 0?{}:r.WebApp.initDataUnsafe},r.Location=o=>{if(fe.is)return o({latitude:55.752555,longitude:37.623123});let a=()=>{r.WebApp.LocationManager.getLocation(async l=>{if(!l){r.WebApp.LocationManager.isAccessRequested||r.WebApp.LocationManager.openSettings();return}o(l)})};!r.WebApp.LocationManager||!r.WebApp.LocationManager.isInited?r.WebApp.LocationManager.init(()=>{a()}):a()},r.Notice={Send:(o,a,l)=>{var c,p;a!==void 0?(me.Send({type:o,text:a,thema:l}),(c=r.WebApp.HapticFeedback)==null||c.notificationOccurred(o)):(me.Send(o),(p=r.WebApp.HapticFeedback)==null||p.notificationOccurred(o.type))},Error:o=>{var a;me.Send({type:"error",text:o}),(a=r.WebApp.HapticFeedback)==null||a.notificationOccurred("error")},Success:o=>{var a;me.Send({type:"success",text:o}),(a=r.WebApp.HapticFeedback)==null||a.notificationOccurred("success")},Warning:o=>{var a;me.Send({type:"warning",text:o}),(a=r.WebApp.HapticFeedback)==null||a.notificationOccurred("warning")}},r.Header=yr,r.TabBar=Or,r.BottomSheet=er,r.toggleBottomSheet=Be,r.SafeArea=kr,r.Loading=Sr,r.Sidebar=jr,r.SidePanel=Cr,r.AppBar=Tr,r.SidePanelController=Pr,r.Scroll=$r,r.Modal=ft,r.Menu=Rr,r.MainButton={callback:[],set:o=>{fe.is?fe.MainButton.set(o):(r.WebApp.MainButton.callback.forEach(a=>{r.WebApp.MainButton.offClick(a)}),r.WebApp.MainButton.callback=[],typeof o=="boolean"?r.WebApp.MainButton.isVisible=!1:(r.WebApp.MainButton.text=o.text,o.color&&(r.WebApp.MainButton.color=o.color),o.textColor&&(r.WebApp.MainButton.textColor=o.textColor),r.WebApp.MainButton.isVisible=!0,r.WebApp.MainButton.isActive=o.isActive===void 0?!0:o.isActive,r.WebApp.MainButton.callback.push(()=>{var a;o.page===void 0?(a=o.callback)==null||a.call(o):ce.setPage(o.page)}),r.WebApp.MainButton.onClick(r.WebApp.MainButton.callback[0])))}},r.BackButtonPrev=()=>{F.prev&&(0,r.BackButton)(F.prev)},r.BackButtonState=()=>F.state,r.BackButton=o=>{fe.is?fe.BackButton.set(o):(F.state.push(o),F.router(o))}})(_.default||(_.default={}));const zr=_.default.TabBar,Br=er,gt=_.default.BackButton,Nr=_.default.BackButtonPrev,nr=_.default.BackButtonState,Ir=_.default.Notice,Mr=_.default.SafeArea,Dr=_.default.Loading,Fr=_.default.Menu,Lr=_.default.SidePanel,Wr=_.default.Scroll,Ur=_.default.AppBar,qr=_.default.Sidebar,Vr=_.default.Location,Hr=_.default.SidePanelController,{Header:Jr,toggleBottomSheet:Kr,Modal:Gr,MainButton:Zr,WebApp:ve,getUser:Xr}=_.default;_.AppBar=Ur,_.BackButton=gt,_.BackButtonPrev=Nr,_.BackButtonState=nr,_.BottomSheet=Br,_.Header=Jr,_.Loading=Dr,_.Location=Vr,_.MainButton=Zr,_.Menu=Fr,_.Modal=Gr,_.Notice=Ir,_.SafeArea=Mr,_.Scroll=Wr,_.SidePanel=Lr,_.SidePanelController=Hr,_.Sidebar=qr,_.TabBar=zr,_.WebApp=ve,_.clsx=be,_.getUser=Xr,_.toggleBottomSheet=Kr,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elcrm/telegram",
3
- "version": "0.0.118",
3
+ "version": "0.0.119",
4
4
  "description": "plugin for elCRM to work with telegram",
5
5
  "type": "module",
6
6
  "author": "MaSkal <dev@elcrm.online>",