@elcrm/telegram 0.0.73 → 0.0.74
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 +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1713,7 +1713,7 @@ const zt = ({ children: n, title: o, isOverlay: i = !0 }) => {
|
|
|
1713
1713
|
document.addEventListener("blur", () => {
|
|
1714
1714
|
document.querySelector("footer").style.display = "flex";
|
|
1715
1715
|
}), document.addEventListener("focus", () => {
|
|
1716
|
-
document.querySelector("footer").style.display = "none";
|
|
1716
|
+
document.querySelector("footer").style.display = "none!important";
|
|
1717
1717
|
});
|
|
1718
1718
|
}, []), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
1719
1719
|
j,
|
package/dist/index.umd.js
CHANGED
|
@@ -57,4 +57,4 @@ Check the top-level render call using <`+r+">.")}return t}}function Je(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} />`,ve,N,Ct,N),qe[N+ve]=!0}}return e===f?wt(y):Rt(y),y}}function St(e,t,r){return Ke(e,t,r,!0)}function Et(e,t,r){return Ke(e,t,r,!1)}var Ot=Et,jt=St;Xe.Fragment=f,Xe.jsx=Ot,Xe.jsxs=jt}()),Xe}process.env.NODE_ENV==="production"?tr():rr();const or="0.0.37",Lt={version:or},Z={},ot={module:"",v:Lt.version,page:"Main",auth:"Auth",STORAGE:"f",LISTENER:{}};function le(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:{}}le().elcrm||(le().elcrm={}),Object.assign(le().elcrm,{router:Lt.version});function X(o){const n=le();n.ROUTER_PARAMS?n.ROUTER_PARAMS={...n.ROUTER_PARAMS,...o}:n.ROUTER_PARAMS={...ot,...o}}function C(){return le().ROUTER_PARAMS||ot}function be(o){const n=le();n.ROUTER_PARAMS?n.ROUTER_PARAMS.LISTENER={...n.ROUTER_PARAMS.LISTENER,...o}:n.ROUTER_PARAMS.LISTENER={...o}}function Q(){return le().ROUTER_PARAMS.LISTENER||ot.LISTENER}var ye;(o=>{function n(){var v;let k=sessionStorage.getItem("f");if(k){if(k=ne.deCode(k),!k)return!1;X({id:k.id,tab:k.tab,page:k.page,module:k.module,time:k.time,payment:{active:!0},module_admin:k.module_admin})}else X({id:0,tab:"",page:(v=localStorage.getItem("d"))!=null&&v.length?C().page:C().auth,module:C().module});return!0}function i(){Z.id=0,Z.tab="",Z.page=C().page,Z.module=C().module}o.Reset=i;function f({module:v=C().module,page:k=C().page,auth:B=C().auth}){X({page:k,module:v,auth:B}),n()}o.Default=f;function g(v){let k=L=>(X({page:L}),L);const[B,D]=R.useState(P()||v&&k(v)||C().page);return be({page:L=>{D(L)}}),B}o.usePage=g;function h(v,k=!0,B={}){X({page:v,...B}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&Q().page(v)}o.setPage=h;function P(){return C().page}o.getPage=P;function x(v){return C().page===v}o.isPage=x;function m(v,k){const[B,D]=R.useState(d()||v||C().module);return be({module:D}),B}o.useModule=m;function w(v,k=!0){X({module:v}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&Q().module(v)}o.setModule=w;function d(){return C().module||""}o.getModule=d;function _(v){return C().module===v}o.isModule=_;function A(v,k){if(typeof v!="function"){const[B,D]=R.useState(!k),[L,ie]=R.useState(v||ae());return be({tabs:ie}),k&&R.useEffect(()=>{D(!0)},[]),[L,B]}else be({tabs:v})}o.useTabs=A;async function U(v,k=!0){X({tab:v}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&(Q().tabs&&Q().tabs(v))}o.setTabs=U;function ae(){return C().tab}o.getTabs=ae;function Ee(v){return C().tab===v}o.isTabs=Ee;function Oe(v){if(typeof v!="function"){const[k,B]=R.useState(v||_e());return be({id:D=>{B(D)}}),k}else be({id:v})}o.useId=Oe;function F(v){}o.subId=F;async function S(v,k=!0){X({id:v}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&Q().id(v)}o.setId=S;function _e(){return C().id}o.getId=_e;function je(v){return Number(C().id)===v}o.isId=je;async function Ce(v){var k,B,D,L,ie,se,I,M;const{page:$,module:q,tab:K,id:G}=v;$!==void 0&&(Z.page=$),q!==void 0&&(Z.module=q),K!==void 0&&(Z.tab=K),G!==void 0&&(Z.id=G),X({...Z}),G!==void 0&&((B=(k=Q()).id)==null||B.call(k,G)),K!==void 0&&((L=(D=Q()).tabs)==null||L.call(D,K)),q!==void 0&&((se=(ie=Q()).module)==null||se.call(ie,q)),$!==void 0&&((M=(I=Q()).page)==null||M.call(I,$)),sessionStorage.setItem(C().STORAGE,ne.enCode(C()))}o.navigate=Ce})(ye||(ye={}));let Qe={};function nr(){const[o,n]=R.useState([]);return Qe.set=i=>{n([...o,i])},Qe.del=i=>{o.forEach((f,g)=>{f.key===i&&o.splice(g,1)}),n(o)},o.length===0?c.jsx(c.Fragment,{}):c.jsx("div",{className:"notice",children:o.map(i=>i.item)})}function ar(o){let n=new Date().getTime();o.key=n,Qe.set({item:c.jsx(ir,{data:o},n),key:n})}function ir(o){const n=o.data;let[i]=R.useState("show"),[f,g]=R.useState(!1);R.useEffect(()=>{setTimeout(function(){g(!0),Qe.del(n.key)},5e3)},[n.key]);let h;switch(n.type){case"error":h=c.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":h=c.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":h=c.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:h="icon fa fa-exclamation-circle";break}return c.jsx(c.Fragment,{children:f?c.jsx(c.Fragment,{}):c.jsxs("div",{className:"item "+n.type+` ${n.thema!==void 0?" thema":""}`,"data-status":i,children:[c.jsx("svg",{type:"solid",fill:"currentColor",stroke:"none",strokeWidth:"0",width:"24",height:"24",viewBox:"0 0 24 24",children:h}),c.jsx("span",{className:"text",children:n.text})]})})}let et={Send:ar,Init:nr},Se=()=>{};const zt=({children:o,title:n,isOverlay:i=!0})=>{const[f,g]=R.useState(!1);return Se=()=>{g(!0),setTimeout(()=>{Wt.onClose()},300)},c.jsx("div",{className:`footer-menu-overlay ${i?"is-overlay":""} ${f?"closing":""}`,onClick:Se,children:c.jsxs("div",{className:`footer-menu-popup-book ${f?"closing":""}`,onClick:h=>h.stopPropagation(),children:[c.jsxs("div",{className:"footer-menu-header",children:[c.jsx("h3",{children:n}),c.jsx("button",{className:"footer-menu-close-btn",onClick:Se,children:"✕"})]}),o]})})},Yt={h:"_h_rl5ga_1",row:"_row_rl5ga_14",column:"_column_rl5ga_17"},Wt=[],Vt=(o,n)=>o.findIndex(i=>(i==null?void 0:i.page)===n),Jt=({actions:o,children:n,className:i,page:f,onPageChange:g,direction:h="row"})=>{const[P,x]=R.useState(null),[m,w]=R.useState(f?Vt(o||[],f):0);return Wt.onClose=()=>{x(null),w(f?Vt(o||[],f):0)},R.useEffect(()=>{document.addEventListener("blur",()=>{document.querySelector("footer").style.display="flex"}),document.addEventListener("focus",()=>{document.querySelector("footer").style.display="none"})},[]),c.jsxs(c.Fragment,{children:[P,c.jsxs("footer",{className:`${Yt.h} ${Yt[h]} ${i} `,children:[n,o&&o.map((d,_)=>c.jsx("div",{"data-active":m===_?"true":"false",onClick:()=>{d.page&&(w(_),g==null||g(d.page)),d.callback&&(d.callback(),w(_)),d.component&&(m===_?Se():(x(d.component),w(_)))},children:d.icon},_))]})]})},ce={is:!1,MainButton:{},BackButton:{}};let W={};W.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"},W.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"},W.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 sr=()=>{if(location.hostname==="localhost"){let[o,n]=R.useState(!1),[i,f]=R.useState(!1),[g,h]=R.useState("dark"),[P,x]=R.useState(!1),[m,w]=R.useState(!1);ce.is=!0,ce.MainButton.set=n,ce.BackButton.set=f,R.useEffect(()=>{W[g]["--tg-theme-bg-color-alpha"]=W[g]["--tg-theme-bg-color"]+"b3",W[g]["--tg-theme-secondary-bg-color-alpha"]=W[g]["--tg-theme-secondary-bg-color"]+"d3";for(let A in W[g])document.documentElement.style.setProperty(A,W[g][A]);xe.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]);let d=A=>{for(let U in W[A])document.documentElement.style.setProperty(U,W[A][U]);h(A),x(!1)},_=()=>{x(!1),w(!0)};return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"debug",children:[i===!1?c.jsx("div",{className:"b",children:"Отмена"}):c.jsx("div",{onClick:()=>{var A;i.page===void 0?(A=i.callback)==null||A.call(i):ye.setPage(i.page)},className:"b",children:"Назад"}),c.jsx("div",{className:"o",onClick:()=>x(!P),children:"Меню"})]}),c.jsx(et.Init,{}),o&&c.jsx("div",{className:"mb",children:c.jsx("button",{onClick:()=>{o.page&&ye.setPage(o.page),o.callback&&o.callback()},children:o.text})}),P?c.jsxs("div",{className:"tm",children:[c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx("button",{onClick:_,children:"Authorization"})}),c.jsx("li",{})]}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("button",{children:"Thema"}),c.jsxs("ol",{children:[c.jsx("li",{children:c.jsx("button",{onClick:()=>d("dark"),children:"Dark"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("light"),children:"Light"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("users"),children:"Users"})})]})]}),c.jsx("li",{children:c.jsx("button",{onClick:()=>x(!P),children:"Closed"})})]})]}):"",m?c.jsx(lr,{setAuthorization:w}):""]})}else return R.useEffect(()=>{document.documentElement.style.setProperty("--tg-theme-secondary-bg-color-alpha",xe.themeParams.secondary_bg_color+"d3"),document.documentElement.style.setProperty("--tg-theme-bg-color-alpha",xe.themeParams.bg_color+"b3"),xe.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]),c.jsx(c.Fragment,{children:c.jsx(et.Init,{})})},lr=({setAuthorization:o})=>{let n={},i=()=>{localStorage.setItem("auth",n)};return c.jsx("div",{className:"ta",children:c.jsxs("div",{className:"--body",children:[c.jsx("fieldset",{}),c.jsx("div",{onClick:i,children:" Сохранить "})]})})},V={state:[!1],listen:[],router:o=>{o===!1?(O.default.WebApp.BackButton.isVisible=!1,O.default.WebApp.BackButton.offClick(V.listen[0]),V.listen.shift(),V.state.length!==1&&V.state.pop()):(O.default.WebApp.BackButton.isVisible=!0,O.default.WebApp.BackButton.offClick(V.listen[0]),V.listen.shift(),V.listen.push(()=>{var i;let n=V.state.pop();n.page!==void 0?ye.setPage(n.page):(i=n.callback)==null||i.call(n)}),xe.BackButton.onClick(V.listen[0]))}};O.default=void 0,(o=>{o.WebApp=window.Telegram.WebApp,o.getUser=()=>{var n;return((n=o.WebApp.initDataUnsafe)==null?void 0:n.user)===void 0?{}:o.WebApp.initDataUnsafe},o.Notice=(n,i,f)=>{var g,h;i!==void 0?(et.Send({type:n,text:i,thema:f}),(g=o.WebApp.HapticFeedback)==null||g.notificationOccurred(n)):(et.Send(n),(h=o.WebApp.HapticFeedback)==null||h.notificationOccurred(n.type))},o.Header=sr,o.Footer=Jt,o.BottomSheet=zt,o.toggleBottomSheet=Se,o.Modal=rt,o.MainButton={callback:[],set:n=>{ce.is?ce.MainButton.set(n):(o.WebApp.MainButton.callback.forEach(i=>{o.WebApp.MainButton.offClick(i)}),o.WebApp.MainButton.callback=[],typeof n=="boolean"?o.WebApp.MainButton.isVisible=!1:(o.WebApp.MainButton.text=n.text,n.color&&(o.WebApp.MainButton.color=n.color),n.textColor&&(o.WebApp.MainButton.textColor=n.textColor),o.WebApp.MainButton.isVisible=!0,o.WebApp.MainButton.isActive=n.isActive===void 0?!0:n.isActive,o.WebApp.MainButton.callback.push(()=>{var i;n.page===void 0?(i=n.callback)==null||i.call(n):ye.setPage(n.page)}),o.WebApp.MainButton.onClick(o.WebApp.MainButton.callback[0])))}},o.BackButton=n=>{ce.is?ce.BackButton.set(n):(V.state.push(n),V.router(n))}})(O.default||(O.default={}));const cr=Jt,ur=zt,fr=O.default.BackButton,dr=O.default.Notice,{Header:pr,toggleBottomSheet:gr,Modal:mr,MainButton:hr,WebApp:xe,getUser:vr}=O.default;O.BackButton=fr,O.BottomSheet=ur,O.Footer=cr,O.Header=pr,O.MainButton=hr,O.Modal=mr,O.Notice=dr,O.WebApp=xe,O.getUser=vr,O.toggleBottomSheet=gr,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
60
|
+
<%s key={someKey} {...props} />`,ve,N,Ct,N),qe[N+ve]=!0}}return e===f?wt(y):Rt(y),y}}function St(e,t,r){return Ke(e,t,r,!0)}function Et(e,t,r){return Ke(e,t,r,!1)}var Ot=Et,jt=St;Xe.Fragment=f,Xe.jsx=Ot,Xe.jsxs=jt}()),Xe}process.env.NODE_ENV==="production"?tr():rr();const or="0.0.37",Lt={version:or},Z={},ot={module:"",v:Lt.version,page:"Main",auth:"Auth",STORAGE:"f",LISTENER:{}};function le(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:{}}le().elcrm||(le().elcrm={}),Object.assign(le().elcrm,{router:Lt.version});function X(o){const n=le();n.ROUTER_PARAMS?n.ROUTER_PARAMS={...n.ROUTER_PARAMS,...o}:n.ROUTER_PARAMS={...ot,...o}}function C(){return le().ROUTER_PARAMS||ot}function be(o){const n=le();n.ROUTER_PARAMS?n.ROUTER_PARAMS.LISTENER={...n.ROUTER_PARAMS.LISTENER,...o}:n.ROUTER_PARAMS.LISTENER={...o}}function Q(){return le().ROUTER_PARAMS.LISTENER||ot.LISTENER}var ye;(o=>{function n(){var v;let k=sessionStorage.getItem("f");if(k){if(k=ne.deCode(k),!k)return!1;X({id:k.id,tab:k.tab,page:k.page,module:k.module,time:k.time,payment:{active:!0},module_admin:k.module_admin})}else X({id:0,tab:"",page:(v=localStorage.getItem("d"))!=null&&v.length?C().page:C().auth,module:C().module});return!0}function i(){Z.id=0,Z.tab="",Z.page=C().page,Z.module=C().module}o.Reset=i;function f({module:v=C().module,page:k=C().page,auth:B=C().auth}){X({page:k,module:v,auth:B}),n()}o.Default=f;function g(v){let k=L=>(X({page:L}),L);const[B,D]=R.useState(P()||v&&k(v)||C().page);return be({page:L=>{D(L)}}),B}o.usePage=g;function h(v,k=!0,B={}){X({page:v,...B}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&Q().page(v)}o.setPage=h;function P(){return C().page}o.getPage=P;function x(v){return C().page===v}o.isPage=x;function m(v,k){const[B,D]=R.useState(d()||v||C().module);return be({module:D}),B}o.useModule=m;function w(v,k=!0){X({module:v}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&Q().module(v)}o.setModule=w;function d(){return C().module||""}o.getModule=d;function _(v){return C().module===v}o.isModule=_;function A(v,k){if(typeof v!="function"){const[B,D]=R.useState(!k),[L,ie]=R.useState(v||ae());return be({tabs:ie}),k&&R.useEffect(()=>{D(!0)},[]),[L,B]}else be({tabs:v})}o.useTabs=A;async function U(v,k=!0){X({tab:v}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&(Q().tabs&&Q().tabs(v))}o.setTabs=U;function ae(){return C().tab}o.getTabs=ae;function Ee(v){return C().tab===v}o.isTabs=Ee;function Oe(v){if(typeof v!="function"){const[k,B]=R.useState(v||_e());return be({id:D=>{B(D)}}),k}else be({id:v})}o.useId=Oe;function F(v){}o.subId=F;async function S(v,k=!0){X({id:v}),sessionStorage.setItem(C().STORAGE,ne.enCode(C())),k&&Q().id(v)}o.setId=S;function _e(){return C().id}o.getId=_e;function je(v){return Number(C().id)===v}o.isId=je;async function Ce(v){var k,B,D,L,ie,se,I,M;const{page:$,module:q,tab:K,id:G}=v;$!==void 0&&(Z.page=$),q!==void 0&&(Z.module=q),K!==void 0&&(Z.tab=K),G!==void 0&&(Z.id=G),X({...Z}),G!==void 0&&((B=(k=Q()).id)==null||B.call(k,G)),K!==void 0&&((L=(D=Q()).tabs)==null||L.call(D,K)),q!==void 0&&((se=(ie=Q()).module)==null||se.call(ie,q)),$!==void 0&&((M=(I=Q()).page)==null||M.call(I,$)),sessionStorage.setItem(C().STORAGE,ne.enCode(C()))}o.navigate=Ce})(ye||(ye={}));let Qe={};function nr(){const[o,n]=R.useState([]);return Qe.set=i=>{n([...o,i])},Qe.del=i=>{o.forEach((f,g)=>{f.key===i&&o.splice(g,1)}),n(o)},o.length===0?c.jsx(c.Fragment,{}):c.jsx("div",{className:"notice",children:o.map(i=>i.item)})}function ar(o){let n=new Date().getTime();o.key=n,Qe.set({item:c.jsx(ir,{data:o},n),key:n})}function ir(o){const n=o.data;let[i]=R.useState("show"),[f,g]=R.useState(!1);R.useEffect(()=>{setTimeout(function(){g(!0),Qe.del(n.key)},5e3)},[n.key]);let h;switch(n.type){case"error":h=c.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":h=c.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":h=c.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:h="icon fa fa-exclamation-circle";break}return c.jsx(c.Fragment,{children:f?c.jsx(c.Fragment,{}):c.jsxs("div",{className:"item "+n.type+` ${n.thema!==void 0?" thema":""}`,"data-status":i,children:[c.jsx("svg",{type:"solid",fill:"currentColor",stroke:"none",strokeWidth:"0",width:"24",height:"24",viewBox:"0 0 24 24",children:h}),c.jsx("span",{className:"text",children:n.text})]})})}let et={Send:ar,Init:nr},Se=()=>{};const zt=({children:o,title:n,isOverlay:i=!0})=>{const[f,g]=R.useState(!1);return Se=()=>{g(!0),setTimeout(()=>{Wt.onClose()},300)},c.jsx("div",{className:`footer-menu-overlay ${i?"is-overlay":""} ${f?"closing":""}`,onClick:Se,children:c.jsxs("div",{className:`footer-menu-popup-book ${f?"closing":""}`,onClick:h=>h.stopPropagation(),children:[c.jsxs("div",{className:"footer-menu-header",children:[c.jsx("h3",{children:n}),c.jsx("button",{className:"footer-menu-close-btn",onClick:Se,children:"✕"})]}),o]})})},Yt={h:"_h_rl5ga_1",row:"_row_rl5ga_14",column:"_column_rl5ga_17"},Wt=[],Vt=(o,n)=>o.findIndex(i=>(i==null?void 0:i.page)===n),Jt=({actions:o,children:n,className:i,page:f,onPageChange:g,direction:h="row"})=>{const[P,x]=R.useState(null),[m,w]=R.useState(f?Vt(o||[],f):0);return Wt.onClose=()=>{x(null),w(f?Vt(o||[],f):0)},R.useEffect(()=>{document.addEventListener("blur",()=>{document.querySelector("footer").style.display="flex"}),document.addEventListener("focus",()=>{document.querySelector("footer").style.display="none!important"})},[]),c.jsxs(c.Fragment,{children:[P,c.jsxs("footer",{className:`${Yt.h} ${Yt[h]} ${i} `,children:[n,o&&o.map((d,_)=>c.jsx("div",{"data-active":m===_?"true":"false",onClick:()=>{d.page&&(w(_),g==null||g(d.page)),d.callback&&(d.callback(),w(_)),d.component&&(m===_?Se():(x(d.component),w(_)))},children:d.icon},_))]})]})},ce={is:!1,MainButton:{},BackButton:{}};let W={};W.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"},W.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"},W.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 sr=()=>{if(location.hostname==="localhost"){let[o,n]=R.useState(!1),[i,f]=R.useState(!1),[g,h]=R.useState("dark"),[P,x]=R.useState(!1),[m,w]=R.useState(!1);ce.is=!0,ce.MainButton.set=n,ce.BackButton.set=f,R.useEffect(()=>{W[g]["--tg-theme-bg-color-alpha"]=W[g]["--tg-theme-bg-color"]+"b3",W[g]["--tg-theme-secondary-bg-color-alpha"]=W[g]["--tg-theme-secondary-bg-color"]+"d3";for(let A in W[g])document.documentElement.style.setProperty(A,W[g][A]);xe.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]);let d=A=>{for(let U in W[A])document.documentElement.style.setProperty(U,W[A][U]);h(A),x(!1)},_=()=>{x(!1),w(!0)};return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"debug",children:[i===!1?c.jsx("div",{className:"b",children:"Отмена"}):c.jsx("div",{onClick:()=>{var A;i.page===void 0?(A=i.callback)==null||A.call(i):ye.setPage(i.page)},className:"b",children:"Назад"}),c.jsx("div",{className:"o",onClick:()=>x(!P),children:"Меню"})]}),c.jsx(et.Init,{}),o&&c.jsx("div",{className:"mb",children:c.jsx("button",{onClick:()=>{o.page&&ye.setPage(o.page),o.callback&&o.callback()},children:o.text})}),P?c.jsxs("div",{className:"tm",children:[c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx("button",{onClick:_,children:"Authorization"})}),c.jsx("li",{})]}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("button",{children:"Thema"}),c.jsxs("ol",{children:[c.jsx("li",{children:c.jsx("button",{onClick:()=>d("dark"),children:"Dark"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("light"),children:"Light"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("users"),children:"Users"})})]})]}),c.jsx("li",{children:c.jsx("button",{onClick:()=>x(!P),children:"Closed"})})]})]}):"",m?c.jsx(lr,{setAuthorization:w}):""]})}else return R.useEffect(()=>{document.documentElement.style.setProperty("--tg-theme-secondary-bg-color-alpha",xe.themeParams.secondary_bg_color+"d3"),document.documentElement.style.setProperty("--tg-theme-bg-color-alpha",xe.themeParams.bg_color+"b3"),xe.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]),c.jsx(c.Fragment,{children:c.jsx(et.Init,{})})},lr=({setAuthorization:o})=>{let n={},i=()=>{localStorage.setItem("auth",n)};return c.jsx("div",{className:"ta",children:c.jsxs("div",{className:"--body",children:[c.jsx("fieldset",{}),c.jsx("div",{onClick:i,children:" Сохранить "})]})})},V={state:[!1],listen:[],router:o=>{o===!1?(O.default.WebApp.BackButton.isVisible=!1,O.default.WebApp.BackButton.offClick(V.listen[0]),V.listen.shift(),V.state.length!==1&&V.state.pop()):(O.default.WebApp.BackButton.isVisible=!0,O.default.WebApp.BackButton.offClick(V.listen[0]),V.listen.shift(),V.listen.push(()=>{var i;let n=V.state.pop();n.page!==void 0?ye.setPage(n.page):(i=n.callback)==null||i.call(n)}),xe.BackButton.onClick(V.listen[0]))}};O.default=void 0,(o=>{o.WebApp=window.Telegram.WebApp,o.getUser=()=>{var n;return((n=o.WebApp.initDataUnsafe)==null?void 0:n.user)===void 0?{}:o.WebApp.initDataUnsafe},o.Notice=(n,i,f)=>{var g,h;i!==void 0?(et.Send({type:n,text:i,thema:f}),(g=o.WebApp.HapticFeedback)==null||g.notificationOccurred(n)):(et.Send(n),(h=o.WebApp.HapticFeedback)==null||h.notificationOccurred(n.type))},o.Header=sr,o.Footer=Jt,o.BottomSheet=zt,o.toggleBottomSheet=Se,o.Modal=rt,o.MainButton={callback:[],set:n=>{ce.is?ce.MainButton.set(n):(o.WebApp.MainButton.callback.forEach(i=>{o.WebApp.MainButton.offClick(i)}),o.WebApp.MainButton.callback=[],typeof n=="boolean"?o.WebApp.MainButton.isVisible=!1:(o.WebApp.MainButton.text=n.text,n.color&&(o.WebApp.MainButton.color=n.color),n.textColor&&(o.WebApp.MainButton.textColor=n.textColor),o.WebApp.MainButton.isVisible=!0,o.WebApp.MainButton.isActive=n.isActive===void 0?!0:n.isActive,o.WebApp.MainButton.callback.push(()=>{var i;n.page===void 0?(i=n.callback)==null||i.call(n):ye.setPage(n.page)}),o.WebApp.MainButton.onClick(o.WebApp.MainButton.callback[0])))}},o.BackButton=n=>{ce.is?ce.BackButton.set(n):(V.state.push(n),V.router(n))}})(O.default||(O.default={}));const cr=Jt,ur=zt,fr=O.default.BackButton,dr=O.default.Notice,{Header:pr,toggleBottomSheet:gr,Modal:mr,MainButton:hr,WebApp:xe,getUser:vr}=O.default;O.BackButton=fr,O.BottomSheet=ur,O.Footer=cr,O.Header=pr,O.MainButton=hr,O.Modal=mr,O.Notice=dr,O.WebApp=xe,O.getUser=vr,O.toggleBottomSheet=gr,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|