PageSourceSearch

https://cdn.caichat.ai/a673f7d7/chunk-2PTX3AFG.js

js caichat.ai collected 2026-10-05 13:29:55 UTC 46,639 bytes, 1 lines download raw bytes

1import{a as ot}from"./chunk-ONT5KDTL.js";import{f as tt}from"./chunk-HCP4LGUG.js";import"./chunk-C44WPSMH.js";import{a as at}from"./chunk-C3AQSMBB.js";import{c as rt,e as st}from"./chunk-VSVVBQ37.js";import{a as lt}from"./chunk-RZTU4CD3.js";import"./chunk-VIBQYZTN.js";import{a as nt,b as it}from"./chunk-UK75YI2T.js";import{a as et}from"./chunk-WPQGJ6LK.js";import{a as ee}from"./chunk-QBVLO57A.js";import{b as pt}from"./chunk-WZFSZ2P7.js";import{a as ct}from"./chunk-TTIBLQFN.js";import{a as qe}from"./chunk-TP56GQWA.js";import{d as Je}from"./chunk-GD2YQXVR.js";import"./chunk-SW5WEG3M.js";import"./chunk-D5NNGQNM.js";import"./chunk-QKPFSXYY.js";import"./chunk-EYNAFLU3.js";import"./chunk-K5BT6JQF.js";import"./chunk-2CBHS5LQ.js";import{a as Z}from"./chunk-CHO4XF6Q.js";import"./chunk-Z2WFIAUG.js";import"./chunk-GUV4AQWJ.js";import"./chunk-XQDMY2T5.js";import"./chunk-6EKLEQAT.js";import{a as Qe}from"./chunk-42MK45FM.js";import"./chunk-OMA253N5.js";import"./chunk-VHADCPUJ.js";import"./chunk-L2BS6EME.js";import{a as Ze}from"./chunk-47VS3NYG.js";import{b as U}from"./chunk-DPQXNSMN.js";import"./chunk-QBBU6UGB.js";import{c as ze}from"./chunk-SSEOVUJZ.js";import{b as Xe}from"./chunk-FF62T5HJ.js";import"./chunk-ECFLJWPJ.js";import"./chunk-H3AYNZHI.js";import"./chunk-BAHTY7FU.js";import"./chunk-BA42TZUG.js";import{c as $e}from"./chunk-67SEPKBD.js";import"./chunk-QNNV3NUO.js";import{a as Ge,b as W}from"./chunk-6PS5XCKV.js";import{c as Ye,h as je,i as We}from"./chunk-WKG7T2L3.js";import"./chunk-THUBN7W7.js";import{b as Fe,c as Ue}from"./chunk-6A3PCU3N.js";import{a as J}from"./chunk-7DNSTI5F.js";import{a as Ke}from"./chunk-IZVXLVIC.js";import"./chunk-REOFSKZ3.js";import"./chunk-YHQ22QYE.js";import"./chunk-XEOKTNWW.js";import{q as Ve,x as Q}from"./chunk-EUYBSYOA.js";import"./chunk-DIDLRAH3.js";import"./chunk-XKT2KTPG.js";import{m as me}from"./chunk-WHMWAO7D.js";import"./chunk-QFPV6C6J.js";import{g as He,k as ke}from"./chunk-EBJTDOWZ.js";import{L as de,Q as A}from"./chunk-Z77QN6CK.js";import{d as De}from"./chunk-IO46VJ7U.js";import"./chunk-PK3REKAC.js";import"./chunk-JRQFPDYR.js";import{j as Ne,n as X,o as pe}from"./chunk-CDAHPDFA.js";import"./chunk-FPPZ4BUR.js";import{$b as I,$c as Se,Cd as ne,Da as re,Dc as Ee,Ec as we,Fb as B,Fc as le,Gc as K,Hb as Pe,Hc as H,Ia as D,Jc as Y,Kc as g,Lb as q,Lc as O,Mc as v,Pa as te,Pc as ue,Sc as he,Tc as Ce,Uc as be,Vc as k,Wb as Te,Wc as T,Xc as x,_b as S,aa as xe,bc as se,bd as Ie,cc as R,cd as Be,dc as N,ec as d,fc as r,fd as c,gb as V,gc as l,gd as m,hc as u,hd as F,kd as ce,la as Me,mb as o,nc as ge,oc as L,od as ye,pd as _,qa as b,qd as j,rd as Ae,s as ae,tc as M,vc as C,wd as Le,xd as P,ya as E,yd as Re,za as w}from"./chunk-WLGXONUO.js";import{a as Oe,b as ve}from"./chunk-TTLSD7JL.js";var mt={items:[],summary:null,meta:null,isLoading:!1,error:null};var _e=Ye({providedIn:"root"},Ge("balance-history"),We(mt),je(t=>({setBalanceHistory(s){W(t,"[Balance History] Balance History: Set",{items:s,isLoading:!1,error:null})},setSummary(s){W(t,"[Balance History] Summary: Set",{summary:s,isLoading:!1,error:null})},setMeta(s){W(t,"[Balance History] Meta: Set",{meta:s,isLoading:!1,error:null})},clearMeta(){W(t,"[Balance History] Meta: Set",{meta:null,isLoading:!1,error:null})},setLoading(s){W(t,"[Purchase History] Loading: Set",{isLoading:s})},setError(s){W(t,"[Purchase History] Error: Set",{error:s,isLoading:!1})}})));var fe=(()=>{class t{#e=b(He);#t=b(_e);loadHistoryConfig=D(null);balanceHistoryResource=ke(()=>{let{range:e,direction:i,limit:n,page:a}=this.loadHistoryConfig()??{};if(!(!e||!i||!n||!a))return{url:`finance/balance-history?period=${e}&direction=${i}&page=${a}&limit=${n}`,method:"GET"}});isLoading=this.balanceHistoryResource.isLoading;constructor(){this.#i()}getHistoryPage(e){let{range:i,direction:n,limit:a,page:p}=e;return ae(this.#e.get(`finance/balance-history?period=${i}&direction=${n}&page=${p}&limit=${a}`))}#i(){j(()=>{let e=this.balanceHistoryResource.error(),i=this.balanceHistoryResource.isLoading(),n=this.balanceHistoryResource.value();if(!i&&!e&&n){let{items:a,summary:p,meta:y}=n;this.#t.setBalanceHistory(a),this.#t.setSummary(p),this.#t.setMeta(y),this.loadHistoryConfig.set(null)}})}static \u0275fac=function(i){return new(i||t)};static \u0275prov=Me({token:t,factory:t.\u0275fac})}return t})();var $=(function(t){return t.ALL="all",t.INCOME="income",t.EXPENSES="expense",t})($||{}),h=(function(t){return t.CHAT="chat",t.IMAGE="image",t.VIDEO="video",t.BOT_PURCHASE="bot_purchase",t.CUSTOM_AGENT="custom_agent",t.IMG_PROMPT_TUNER="img_prompt_tuner",t.AGENT="agent",t.LORE_BOOK="lore_book",t.MEMORIES="memories",t.TRANSLATION="translation",t.SUGGESTION="suggestion",t.IMAGE_PROMPT="image_prompt",t.IMAGE_DESCRIPTION="image_description",t.AVATAR_NSFW_MODERATION="avatar_nsfw_moderation",t.CHARACTER_MODERATION="character_moderation",t.PROMPT_MODERATION="prompt_moderation",t.IMAGE_AGE_MODERATION="image_age_moderation",t.OTHER="other",t})(h||{}),ie=(function(t){return t.WEEK="week",t.MONTH="month",t})(ie||{});var dt=["SOURCE","COST_RATIO","AMOUNT"],_t=100,gt=[{label:"BLOCKS.BALANCE_HISTORY.CATEGORIES.ALL",value:$.ALL},{label:"BLOCKS.BALANCE_HISTORY.CATEGORIES.EXPENSES",value:$.EXPENSES},{label:"BLOCKS.BALANCE_HISTORY.CATEGORIES.INCOME",value:$.INCOME}];function ut(t){return typeof t=="object"&&t!==null&&"spendings"in t}function ht(t){return typeof t=="object"&&t!==null&&"tokenAmount"in t}function Ct(t){return typeof t=="object"&&t!==null&&"rewardAmount"in t}function oe(t){switch(t){case h.CHAT:return"#79CCFF";case h.IMAGE:return"#D0BDFF";case h.VIDEO:return"#E0FF2F";case h.BOT_PURCHASE:return"#FFF49D";case h.CUSTOM_AGENT:return"#C4FFB8";case h.IMG_PROMPT_TUNER:return"#B8FFEE";case h.TRANSLATION:case h.AGENT:return"#FFB8F6";case h.LORE_BOOK:return"#BFB8FF";case h.MEMORIES:return"#FFD1B8";case h.SUGGESTION:return"#FFC5C5";case h.IMAGE_PROMPT:return"#FFF49D";case h.IMAGE_DESCRIPTION:return"#9CFF9C";case h.AVATAR_NSFW_MODERATION:return"#CEFF8B";case h.CHARACTER_MODERATION:return"#A1A3AD";case h.PROMPT_MODERATION:return"#C8E7F6";
1case h.IMAGE_AGE_MODERATION:return"#57FFE3";case h.OTHER:return"#57BFFF";default:return"#57BFFF"}}var bt=(t,s)=>s.type;function Pt(t,s){if(t&1&&(r(0,"div",3)(1,"div",4),g(2),l(),u(3,"div",5),l()),t&2){let e=s.$implicit,i=s.$index,n=s.$count;C();let a=x(0),p=e.percent<a;K("width",p?"1.75rem":`${e.percent}%`),H("cost-ratio__segment--compact",p),o(2),v(" ",p?"<"+a+"%":e.percent+"%"," "),o(),K("background-color",e.background),H("cost-ratio__bar--first",i===0&&i!==n-1)("cost-ratio__bar--last",i===n-1&&i!==0)("cost-ratio__bar--only",i===0&&i===n-1)}}function Tt(t,s){if(t&1&&(r(0,"div",7)(1,"div",8),u(2,"div",9),r(3,"div",10),g(4),c(5,"uppercase"),c(6,"transloco"),l()(),r(7,"div",11),g(8),l()()),t&2){let e=s.$implicit;o(2),K("background-color",e.background),o(2),O(m(6,6,m(5,4,"BLOCKS.BALANCE_HISTORY.SPEND_TYPE."+e.type))),o(4),v("",e.percent,"%")}}function Et(t,s){if(t&1&&(r(0,"div",6),R(1,Tt,9,8,"div",7,bt),l()),t&2){let e=C();o(),N(e.tooltipData())}}var z=2,yt=(()=>{class t{expenses=P.required();RATIO_THRESHOLD=z;#e=_(()=>{let e=this.expenses();if(!e.length)return[];let i={};for(let{spendType:n,costRatioPercent:a}of e)i[n]=(i[n]??0)+a;return Object.entries(i).map(([n,a])=>{let p=Number(a.toFixed(2)),y=p<z;return{type:n,percent:p,background:oe(n),tooSmall:y,label:y?`<${z}%`:`${p}%`}}).sort((n,a)=>a.percent-n.percent)});colouredRatio=_(()=>{let e=this.#e();if(!e.length)return[];let i=0,n=[];for(let a of e)a.percent<=z?i+=a.percent:n.push(a);if(i>0){let a=Number(i.toFixed(0));n.push({type:h.OTHER,percent:a,background:oe(h.OTHER),tooSmall:a<z,label:a<z?`<${z}%`:`${a}%`})}return n.sort((a,p)=>p.percent-a.percent)});tooltipData=_(()=>this.#e());static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["lib-cost-ratio"]],inputs:{expenses:[1,"expenses"]},decls:6,vars:2,consts:[["tooltipTemplate",""],["appTooltip","","tooltipWrap","nowrap","tooltipVariant","secondary",1,"cost-ratio","[--tooltip-padding:0.5rem]",3,"tooltipTemplate"],[1,"cost-ratio__segment",3,"width","cost-ratio__segment--compact"],[1,"cost-ratio__segment"],[1,"cost-ratio__label"],[1,"cost-ratio__bar"],[1,"cost-ratio__tooltip"],[1,"cost-ratio__tooltip-row","flex","items-center","justify-between","gap-2","whitespace-nowrap"],[1,"cost-ratio__tooltip-title","flex","min-w-0","flex-auto","items-center","gap-2"],[1,"cost-ratio__tooltip-dot"],[1,"cost-ratio__tooltip-label"],[1,"cost-ratio__tooltip-value","shrink-0"]],template:function(i,n){if(i&1&&(k(0),r(1,"div",1),R(2,Pt,4,13,"div",2,bt),l(),q(4,Et,3,0,"ng-template",null,0,ce)),i&2){let a=le(5);T(n.RATIO_THRESHOLD),o(),d("tooltipTemplate",a),o(),N(n.colouredRatio())}},dependencies:[Qe,A,X],styles:["[_nghost-%COMP%]{display:block;--cost-ratio__label-color: #9799A1;--cost-ratio__tooltip-border: #545456}[_nghost-%COMP%]   .cost-ratio[_ngcontent-%COMP%]{display:flex;width:100%;align-items:flex-end}[_nghost-%COMP%]   .cost-ratio__segment[_ngcontent-%COMP%]{position:relative;display:flex;min-width:1.75rem;flex-direction:column;align-items:center}[_nghost-%COMP%]   .cost-ratio__segment--compact[_ngcontent-%COMP%]{justify-content:flex-end}[_nghost-%COMP%]   .cost-ratio__label[_ngcontent-%COMP%]{color:var(--cost-ratio__label-color);font-size:.75rem;line-height:1rem}[_nghost-%COMP%]   .cost-ratio__bar[_ngcontent-%COMP%]{width:100%;height:.25rem}[_nghost-%COMP%]   .cost-ratio__bar--first[_ngcontent-%COMP%]{border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%]   .cost-ratio__bar--last[_ngcontent-%COMP%]{border-radius:0 .25rem .25rem 0}[_nghost-%COMP%]   .cost-ratio__bar--only[_ngcontent-%COMP%]{border-radius:.25rem}[_nghost-%COMP%]   .cost-ratio__tooltip[_ngcontent-%COMP%]{display:flex;width:var(--cost-ratio__tooltip-width);flex-direction:column}[_nghost-%COMP%]   .cost-ratio__tooltip-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;border-bottom:1px solid var(--cost-ratio__tooltip-border);padding:.25rem 0}[_nghost-%COMP%]   .cost-ratio__tooltip-row[_ngcontent-%COMP%]:last-child{border-bottom:0}[_nghost-%COMP%]   .cost-ratio__tooltip-title[_ngcontent-%COMP%]{display:flex;min-width:0;flex:1 1 auto;align-items:center;gap:var(--cost-ratio__tooltip-title-gap)}[_nghost-%COMP%]   .cost-ratio__tooltip-dot[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;border-radius:999px}[_nghost-%COMP%]   .cost-ratio__tooltip-label[_ngcontent-%COMP%], [_nghost-%COMP%]   .cost-ratio__tooltip-value[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;white-space:nowrap}[_nghost-%COMP%]   .cost-ratio__tooltip-label[_ngcontent-%COMP%]{color:var(--cost-ratio__tooltip-label-color)}[_nghost-%COMP%]   .cost-ratio__tooltip-value[_ngcontent-%COMP%]{color:var(--cost-ratio__tooltip-value-color);white-space:nowrap}[_nghost-%COMP%]{--cost-ratio__tooltip-width: 15.625rem;--cost-ratio__tooltip-title-gap: .5rem;--cost-ratio__tooltip-label-color: #F9F9F9;--cost-ratio__tooltip-value-color: #9799A1}"],changeDetection:0})}return t})();var ft=(()=>{class t{#e=b(te);expenseType=P(h.CHAT);backgroundColor=_(()=>{let e=this.expenseType();return oe(e)});constructor(){this.#t()}#t(){j(()=>{this.#e.nativeElement.style.backgroundColor=this.backgroundColor(),this.#e.nativeElement.style.color="rgba(0, 0, 0, 0.65)"})}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Pe({type:t,selectors:[["","libPastelBg",""]],inputs:{expenseType:[1,"expenseType"]}})}return t})();function wt(t,s){t&1&&g(0),t&2&&v(" "," "+s," ")}function St(t,s){t&1&&ge(0)}function It(t,s){t&1&&g(0),t&2&&v(" "," "+s," ")}function Bt(t,s){t&1&&ge(0)}function At(t,s){t&1&&u(0,"span",22)}var Ot=(()=>{class t{expense=P.required();totalTokens=_(()=>this.expense().tokensIn+this.expense().tokensOut);targetLanguages=_(()=>{let e=this.expense().targetLanguages;return e==null?null:"("+e.join(", ")+")"});static \u0275fac=function(i){return new(i||t)};
1static \u0275cmp=B({type:t,selectors:[["lib-expense"]],inputs:{expense:[1,"expense"]},decls:51,vars:48,consts:[["tokenCount",""],[1,"expense","expense--desktop"],[1,"expense__type"],[1,"expense__badge-wrap"],["libPastelBg","",1,"expense__badge",3,"expenseType"],[1,"expense__time"],[1,"expense__model"],[1,"expense__model-text"],[1,"expense__tokens"],[1,"expense__tokens-main"],[4,"ngTemplateOutlet"],[1,"expense__tokens-value"],[1,"expense__tokens-meta"],[1,"expense__currency"],[3,"value","isCompactView"],[1,"expense","expense--mobile"],[1,"expense__mobile-head"],[1,"expense__mobile-time"],[1,"expense__mobile-model"],[1,"expense__mobile-footer"],[1,"expense__mobile-tokens"],[1,"expense__currency","expense__currency--mobile"],["aria-hidden","true",1,"expense__token-icon"]],template:function(i,n){if(i&1&&(r(0,"div",1)(1,"div",2)(2,"div",3)(3,"span",4),g(4),c(5,"uppercase"),c(6,"transloco"),S(7,wt,1,1),l()()(),r(8,"div",5),g(9),c(10,"date"),l(),r(11,"div",6)(12,"span",7),g(13),l()(),r(14,"div",8)(15,"div",9),q(16,St,1,0,"ng-container",10),r(17,"span",11),g(18),l()(),r(19,"span",12),g(20),c(21,"transloco"),c(22,"transloco"),l()(),r(23,"div",13),u(24,"app-currency",14),l()(),r(25,"div",15)(26,"div",16)(27,"span",4),g(28),c(29,"uppercase"),c(30,"transloco"),S(31,It,1,1),l(),r(32,"span",17),g(33),c(34,"date"),l()(),r(35,"span",18),g(36),l(),r(37,"div",19)(38,"div",20)(39,"div",9),q(40,Bt,1,0,"ng-container",10),r(41,"span",11),g(42),l()(),r(43,"span",12),g(44),c(45,"transloco"),c(46,"transloco"),l()(),r(47,"div",21),u(48,"app-currency",14),l()()(),q(49,At,1,0,"ng-template",null,0,ce)),i&2){let a,p,y=le(50),f=n.expense();o(3),d("expenseType",f.spendType),o(),v(" ",m(6,28,m(5,26,"BLOCKS.BALANCE_HISTORY.SPEND_TYPE."+f.spendType))," "),o(3),I((a=n.targetLanguages())?7:-1,a),o(2),O(F(10,30,f.datetime,"dd.MM.yyyy HH:mm:ss")),o(4),O(f.modelName),o(3),d("ngTemplateOutlet",y),o(2),O(n.totalTokens()),o(2),ue("",f.tokensIn," ",m(21,33,"BLOCKS.BALANCE_HISTORY.IN")," / ",f.tokensOut," ",m(22,35,"BLOCKS.BALANCE_HISTORY.OUT")),o(4),d("value",+f.expenses)("isCompactView",!1),o(3),d("expenseType",f.spendType),o(),v(" ",m(30,39,m(29,37,"BLOCKS.BALANCE_HISTORY.SPEND_TYPE."+f.spendType))," "),o(3),I((p=n.targetLanguages())?31:-1,p),o(2),O(F(34,41,f.datetime,"dd.MM.yyyy HH:mm:ss")),o(3),O(f.modelName),o(4),d("ngTemplateOutlet",y),o(2),O(n.totalTokens()),o(2),ue("",f.tokensIn," ",m(45,44,"BLOCKS.BALANCE_HISTORY.IN")," / ",f.tokensOut," ",m(46,46,"BLOCKS.BALANCE_HISTORY.OUT")),o(4),d("value",+f.expenses)("isCompactView",!1)}},dependencies:[U,ft,Ne,pe,A,X],styles:["[_nghost-%COMP%]{display:block;--currency__font-size: .875rem;--currency__line-height: 1.25rem;--expense__line: #323232;--expense__text: #9799A1;--expense__text-strong: #F9F9F9;--expense__token-icon-color: #F9F9F9;--expense__desktop-grid: 10.5rem 5rem minmax(0, 1fr) 7.5rem 6.5rem;--expense__desktop-gap: 0 1.5rem;--expense__desktop-min-height: auto;--expense__desktop-padding-left: .75rem;--expense__desktop-padding-right: 0;--expense__currency-justify: flex-start}[_nghost-%COMP%]   .expense__badge[_ngcontent-%COMP%]{display:inline-flex;max-width:100%;align-items:center;justify-content:center;overflow:hidden;padding:.125rem .5rem;border-radius:.25rem;font-size:.75rem;line-height:1rem;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%]   .expense__tokens-main[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;color:var(--expense__text-strong)}[_nghost-%COMP%]   .expense__token-icon[_ngcontent-%COMP%]{display:block;width:1rem;height:1rem;flex:0 0 1rem;background-color:var(--expense__token-icon-color);-webkit-mask:url(/assets/images/balance-history/token-count.svg) center/contain no-repeat;mask:url(/assets/images/balance-history/token-count.svg) center/contain no-repeat}[_nghost-%COMP%]   .expense__tokens-value[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem}[_nghost-%COMP%]   .expense__tokens-meta[_ngcontent-%COMP%]{color:var(--expense__text);font-size:.75rem;line-height:1rem;white-space:nowrap}[_nghost-%COMP%]   .expense--desktop[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .expense--mobile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;border-top:1px solid var(--expense__line);padding-top:.5rem;color:var(--expense__text)}[_nghost-%COMP%]   .expense__mobile-head[_ngcontent-%COMP%], [_nghost-%COMP%]   .expense__mobile-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
1[_nghost-%COMP%]   .expense__mobile-time[_ngcontent-%COMP%], [_nghost-%COMP%]   .expense__mobile-model[_ngcontent-%COMP%]{color:var(--expense__text);font-size:.875rem;line-height:1.25rem}[_nghost-%COMP%]   .expense__mobile-time[_ngcontent-%COMP%]{text-align:right;white-space:nowrap}[_nghost-%COMP%]   .expense__mobile-model[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%]   .expense__mobile-tokens[_ngcontent-%COMP%]{display:flex;min-width:0;flex:1 1 auto;align-items:center;gap:.5rem}[_nghost-%COMP%]   .expense__currency--mobile[_ngcontent-%COMP%]{flex-shrink:0}@media screen and (min-width:768px){[_nghost-%COMP%]   .expense--desktop[_ngcontent-%COMP%]{display:grid;grid-template-columns:var(--expense__desktop-grid);align-items:center;gap:var(--expense__desktop-gap);width:100%;min-height:var(--expense__desktop-min-height);border-top:1px solid var(--expense__line);padding-top:.25rem;padding-right:var(--expense__desktop-padding-right);padding-left:var(--expense__desktop-padding-left);color:var(--expense__text)}[_nghost-%COMP%]   .expense--mobile[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .expense__type[_ngcontent-%COMP%], [_nghost-%COMP%]   .expense__currency[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%]   .expense__type[_ngcontent-%COMP%]{min-width:0}[_nghost-%COMP%]   .expense__badge-wrap[_ngcontent-%COMP%]{display:flex;min-width:0;align-items:center}[_nghost-%COMP%]   .expense__time[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;color:var(--expense__text);font-size:.875rem;line-height:1.25rem;text-align:center}[_nghost-%COMP%]   .expense__model[_ngcontent-%COMP%]{display:flex;min-width:0;align-items:center}[_nghost-%COMP%]   .expense__model-text[_ngcontent-%COMP%]{overflow:hidden;min-width:0;color:var(--expense__text);font-size:.875rem;line-height:1.25rem;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%]   .expense__tokens[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start}[_nghost-%COMP%]   .expense__currency[_ngcontent-%COMP%]{justify-content:var(--expense__currency-justify)}}[_nghost-%COMP%]   .expense__mobile-model[_ngcontent-%COMP%]{white-space:nowrap}"]})}return t})();var Lt=(t,s)=>s.datetime;function Rt(t,s){if(t&1&&(r(0,"div",2),u(1,"div",8),r(2,"div",9),g(3),c(4,"transloco"),l()()),t&2){C();let e=x(0);o(),K("background-image",`url(${e})`),o(2),O(m(4,3,"BLOCKS.BALANCE_HISTORY.CHATBOT_REMOVED"))}}function Nt(t,s){if(t&1&&(r(0,"div",2),u(1,"div",8),r(2,"div",9),g(3),c(4,"transloco"),l()()),t&2){let e=C(),i=x(5);o(),K("background-image",`url(${i})`),o(2),O(m(4,3,e.unattributedTitleKey()))}}function Ht(t,s){if(t&1){let e=L();r(0,"div",3)(1,"div",10)(2,"a",11),M("click",function(n){E(e);let a=C();return w(a.goToChatbotPage(n))}),r(3,"span",12),u(4,"img",13)(5,"i",14),l(),r(6,"span",9),g(7),l()()()()}if(t&2){let e=C(),i=x(0),n=x(3);o(2),Te("href",e.chatbotHref(),V),o(2),d("src",n,V)("imageFallback",i),o(3),v(" ",e.chatbotName()," ")}}function kt(t,s){if(t&1&&u(0,"lib-expense",15),t&2){let e=s.$implicit,i=s.$index,n=s.$count;H("balance-history-item__expense--last",i===n-1),d("expense",e)}}function Dt(t){let s=new Set(t.map(e=>e.spendType));return s.size!==1?h.OTHER:s.values().next().value??h.OTHER}var vt=(()=>{class t{#e=b(re);#t=b(Ke);#i=b(Q);#n=b(me);balanceHistoryItem=P.required();isLast=P(!1);isExpanded=ne(!1);spendings=_(()=>this.balanceHistoryItem().spendings);avatarUrl=_(()=>this.balanceHistoryItem().avatarUrl);chatbotName=_(()=>this.balanceHistoryItem().chatbot);totalExpenses=_(()=>Number(this.balanceHistoryItem().totalExpenses)||0);imgFallbackAsset=rt;uncreatedBotImg=st;activeLang=this.#t.activeLang;isUnattributedSpending=_(()=>{let e=this.balanceHistoryItem();return e?.botSlug===null&&e.chatbot==="Unknown"});unattributedSpendType=_(()=>Dt(this.spendings()));unattributedTitleKey=_(()=>`BLOCKS.BALANCE_HISTORY.SPEND_TYPE.${this.unattributedSpendType().toUpperCase()}`);unattributedImg=_(()=>this.unattributedSpendType()===h.IMAGE?this.uncreatedBotImg:this.imgFallbackAsset);isBotDeleted=_(()=>{let e=this.balanceHistoryItem();return e?.botSlug===null&&e.chatbot==="Deleted"});chatbotPath=_(()=>{let e=this.balanceHistoryItem();if(!e.botSlug)return null;let i=e.userSlug?encodeURIComponent(e.userSlug.toLowerCase()):null,n=encodeURIComponent(e.botSlug.toLowerCase());return i?[i,n]:[n]});chatbotHref=_(()=>{let e=this.chatbotPath();if(!e)return null;let i=this.#n.createUrlTree(["/",this.activeLang(),"view-chatbot",...e]);return this.#n.serializeUrl(i)});goToChatbotPage(e){if(!this.#a(e))return;let i=this.chatbotPath();if(!i)return;if(this.#e.documentElement.clientWidth>=768){let p=this.activeLang();this.#n.navigate([p,"view-chatbot",...i]);return}this.#i.openModal(Ve.CHATBOT_INFO,i)}#a(e){return e.stopPropagation(),e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey?!1:(e.preventDefault(),!0)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["lib-balance-history-item"]],inputs:{balanceHistoryItem:[1,"balanceHistoryItem"],isLast:[1,"isLast"],isExpanded:[1,"isExpanded"]},outputs:{isExpanded:"isExpandedChange"},decls:19,vars:22,consts:[[1,"style_underline","accordion","hover:rounded-lg",3,"menuClick","isItemExpandable","isItemActive"],["preview","",1,"balance-history-item__preview"],[1,"balance-history-item__chatbot","balance-history-item__chatbot--static"],[1,"balance-history-item__chatbot-wrap"],[1,"balance-history-item__ratio",3,"expenses"],[1,"balance-history-item__total",3,"value","isCompactView"],["items","",1,"balance-history-item__items"],[3,"expense","balance-history-item__expense--last"],[1,"balance-history-item__avatar","balance-history-item__avatar--placeholder"],[1,"balance-history-item__name"],[1,"balance-history-item__chatbot-row"],[1,"balance-history-item__chatbot","balance-history-item__chatbot--link",3,"click"],[1,"balance-history-item__avatar-shell"],["alt","chatbot avatar",1,"balance-history-item__avatar",3,"src","imageFallback"],[1,"balance-history-item__hover-icon","ph","ph-eye"],[3,"expense"]],template:function(i,n){if(i&1){let a=L();k(0),c(1,"assetUrl"),c(2,"replaceImageDomain"),k(3),c(4,"replaceImageDomain"),k(5),c(6,"assetUrl"),c(7,"replaceImageDomain"),k(8),r(9,"app-ui-expansion-menu",0),M("menuClick",function(){E(a);let y=x(8);return w(n.isExpanded.set(!y))}),r(10,"div",1),S(11,Rt,5,5,"div",2)(12,Nt,5,5,"div",2)(13,Ht,8,4,"div",3),u(14,"lib-cost-ratio",4)(15,"app-currency",5),l(),r(16,"div",6),R(17,kt,1,3,"lib-ex
1pense",7,Lt),l()()}if(i&2){T(m(2,10,m(1,8,n.imgFallbackAsset))),o(3),T(m(4,13,n.avatarUrl())),o(2),T(m(7,18,m(6,16,n.unattributedImg())));let a=n.spendings();o(3);let p=T(n.isExpanded());o(),H("!border-b-0",n.isLast()),d("isItemExpandable",!0)("isItemActive",p),o(2),I(n.isBotDeleted()?11:n.isUnattributedSpending()?12:13),o(3),d("expenses",a),o(),d("value",n.totalExpenses())("isCompactView",!0),o(2),N(a)}},dependencies:[ot,Ot,U,yt,at,ee,Z,A],styles:["[_nghost-%COMP%]{display:block;overflow:hidden;border-radius:.5rem;color:#f9f9f9;--currency__font-size: .875rem;--currency__line-height: 1.25rem;--balance-history-item__avatar-hover-opacity: .25;--menu-padding: .5rem 0}[_nghost-%COMP%]   .accordion[_ngcontent-%COMP%]{--menu-icon-top: .5rem;--submenu-padding: 0;--menu-border-width: 0px;--menu-border-width_hover: 0px;--menu-border-width_active: 0px}[_nghost-%COMP%]   .balance-history-item__preview[_ngcontent-%COMP%]{display:grid;width:100%;color:#f9f9f9;font-size:.875rem;line-height:1.25rem}[_nghost-%COMP%]   .balance-history-item__chatbot-wrap[_ngcontent-%COMP%]{min-width:0}[_nghost-%COMP%]   .balance-history-item__chatbot-row[_ngcontent-%COMP%], [_nghost-%COMP%]   .balance-history-item__chatbot[_ngcontent-%COMP%]{display:flex;min-width:0;max-width:100%;align-items:center;gap:.5rem}[_nghost-%COMP%]   .balance-history-item__chatbot--link[_ngcontent-%COMP%]{position:relative;cursor:pointer;text-decoration:none}[_nghost-%COMP%]   .balance-history-item__chatbot--link[_ngcontent-%COMP%]:hover   -shadowcsshost   .balance-history-item__avatar[_ngcontent-%COMP%]{opacity:var(--balance-history-item__avatar-hover-opacity)}[_nghost-%COMP%]   .balance-history-item__chatbot--link[_ngcontent-%COMP%]:hover   -shadowcsshost   .balance-history-item__hover-icon[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%]   .balance-history-item__chatbot--link[_ngcontent-%COMP%]:hover   -shadowcsshost   .balance-history-item__name[_ngcontent-%COMP%]{color:#ced0d5}[_nghost-%COMP%]   .balance-history-item__avatar[_ngcontent-%COMP%]{flex-shrink:0;border-radius:.5rem;object-fit:cover;object-position:center;transition:opacity .15s ease-in-out}[_nghost-%COMP%]   .balance-history-item__avatar--placeholder[_ngcontent-%COMP%]{display:grid;place-items:center;background-position:center;background-repeat:no-repeat;background-size:cover}[_nghost-%COMP%]   .balance-history-item__avatar-shell[_ngcontent-%COMP%]{position:relative;display:grid;flex-shrink:0;place-items:center}[_nghost-%COMP%]   .balance-history-item__hover-icon[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-items:center;opacity:0;color:#f9f9f9;font-size:1rem;line-height:1rem;transition:opacity .15s ease-in-out}[_nghost-%COMP%]   .balance-history-item__name[_ngcontent-%COMP%]{overflow:hidden;min-width:0;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%]   .balance-history-item__items[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;color:#9799a1;font-size:.875rem;line-height:1.25rem}[_nghost-%COMP%]   .balance-history-item__expense--last[_ngcontent-%COMP%]{padding-bottom:.5rem}@media screen and (min-width:768px){[_nghost-%COMP%]{--menu-padding: .75rem .75rem .5rem}}@media(hover:hover)and (pointer:fine){[_nghost-%COMP%]   .accordion[_ngcontent-%COMP%]:hover{background-color:#2b2b2b;--menu-text-color_hover: #F9F9F9}}[_nghost-%COMP%]   .balance-history-item__preview[_ngcontent-%COMP%]{grid-template-columns:2.6fr 1fr;align-items:center;justify-content:flex-start;gap:1.5rem}[_nghost-%COMP%]   .balance-history-item__avatar[_ngcontent-%COMP%], [_nghost-%COMP%]   .balance-history-item__avatar-shell[_ngcontent-%COMP%]{width:2.5rem;height:2.5rem}[_nghost-%COMP%]   .balance-history-item__avatar--placeholder[_ngcontent-%COMP%]{background-color:#2b2b2b}[_nghost-%COMP%]   .balance-history-item__hover-icon[_ngcontent-%COMP%]{left:.75rem}[_nghost-%COMP%]   .balance-history-item__ratio[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .balance-history-item__total[_ngcontent-%COMP%]{padding-left:.75rem}@media screen and (min-width:768px){[_nghost-%COMP%]   .balance-history-item__preview[_ngcontent-%COMP%]{grid-template-columns:16.5rem 4fr 5rem}[_nghost-%COMP%]   .balance-history-item__ratio[_ngcontent-%COMP%]{display:block}}"]})}return t})();var Ft=t=>({date:t}),xt=(()=>{class t{#e=b(Fe,{optional:!0})??!1;balanceHistoryItem=P.required();isLast=P(!1);infoButton=Le();hostIcon=`/assets/images/${this.#e?"favicon-rpgc.ico":"Favicon/Favicon 32x32.png"}`;transferLabelKey=`BLOCKS.BALANCE_HISTORY.CONVERT_TO_TOKENS${this.#e?"_RPGC":""}`;tokenAmount=_(()=>Number(this.balanceHistoryItem().tokenAmount)||0);completedAt=_(()=>this.balanceHistoryItem().datetime||this.balanceHistoryItem().date);
1infoButtonClick(){this.infoButton.emit()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["lib-convert-to-tokens-item"]],inputs:{balanceHistoryItem:[1,"balanceHistoryItem"],isLast:[1,"isLast"]},outputs:{infoButton:"infoButton"},decls:17,vars:24,consts:[[1,"grid","grid-cols-[2.4fr,1fr]","sm:grid-cols-[16.5rem,4fr,6.75rem]","md:[17.8rem,4fr,6.75rem]","items-center","justify-start","gap-6","text-sm","w-full","mr-6","max-sm:py-2","max-sm:px-0","p-3","pb-2"],[1,"flex","items-center","gap-2","min-w-0"],["alt","",1,"size-10","rounded-lg","flex-shrink-0","object-cover","object-center",3,"src"],[1,"text-grey-100","truncate","min-w-0"],[1,"hidden","sm:block","truncate","min-w-0","text-grey-300"],[1,"flex","gap-4","items-center","justify-between"],[1,"convert-to-tokens-item__amount","justify-self-start",3,"value","isCompactView"],["typeOfButton","button",1,"style_ghost","info-btn","icon","pr-0","group","flex","items-center","justify-center",3,"buttonClick","ariaLabel"],[1,"ph","ph-info","text-2xl/6","text-grey-100","group-hover:text-grey-200","transition-colors","duration-200"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1),u(2,"img",2),c(3,"assetUrl"),c(4,"replaceImageDomain"),r(5,"p",3),g(6),c(7,"transloco"),l()(),r(8,"div",4),g(9),c(10,"date"),c(11,"transloco"),l(),r(12,"div",5),u(13,"app-currency",6),r(14,"app-ui-button",7),c(15,"transloco"),M("buttonClick",function(){return n.infoButtonClick()}),u(16,"i",8),l()()()),i&2&&(Y(n.isLast()?"":"border-b border-grey-550"),o(2),d("src",m(4,10,m(3,8,n.hostIcon)),V),o(4),O(m(7,12,n.transferLabelKey)),o(3),v(" ",F(11,17,"BLOCKS.BALANCE_HISTORY.CONVERT_TO_TOKENS_TEXT",Ie(22,Ft,F(10,14,n.completedAt(),"dd.MM.yyyy HH:mm:ss")))," "),o(4),d("value",n.tokenAmount())("isCompactView",!0),o(),d("ariaLabel",m(15,20,"BLOCKS.BALANCE_HISTORY.WITHDRAWAL")))},dependencies:[U,J,Z,pe,ee,A],styles:["[_nghost-%COMP%]{border-radius:.5rem;overflow:hidden}[_nghost-%COMP%]   .convert-to-tokens-item__amount[_ngcontent-%COMP%]{--currency__font-size: .875rem;--currency__line-height: 1.25rem;--currency__dark-text-color: #43F959}[_nghost-%COMP%]   .info-btn[_ngcontent-%COMP%]{--button__padding-x: 0;--button__padding-y: 0}"],changeDetection:0})}return t})();var Ut=(t,s)=>({place:t,period:s});function $t(t){let[s="",e=""]=t.split("-");return s&&e?[s,e]:null}var Vt=15,Kt="BLOCKS.BALANCE_HISTORY.LEADERBOARD_POSITION.DEFAULT",Yt="BLOCKS.BALANCE_HISTORY.LEADERBOARD_POSITION.SPECIAL",jt=new Map([["01","COMMON.MONTH.JANUARY"],["02","COMMON.MONTH.FEBRUARY"],["03","COMMON.MONTH.MARCH"],["04","COMMON.MONTH.APRIL"],["05","COMMON.MONTH.MAY"],["06","COMMON.MONTH.JUNE"],["07","COMMON.MONTH.JULY"],["08","COMMON.MONTH.AUGUST"],["09","COMMON.MONTH.SEPTEMBER"],["10","COMMON.MONTH.OCTOBER"],["11","COMMON.MONTH.NOVEMBER"],["12","COMMON.MONTH.DECEMBER"]]),Mt=(()=>{class t{#e=b(de);#t=b(Q);#i=De(this.#e.langChanges$.pipe(xe(this.#e.getActiveLang())),{requireSync:!0});balanceHistoryItem=P.required();isLast=P(!1);position=_(()=>this.balanceHistoryItem().leaderboardPosition);reward=_(()=>Number(this.balanceHistoryItem().rewardAmount)||0);period=_(()=>this.balanceHistoryItem().rewardPeriod);positionLabel=_(()=>{let e=this.#i(),i=this.position();if(i<1||i>Vt)return String(i);let n={position:i},a=`${Yt}.${i}`,p=this.#e.translate(a,n,e);return p===a?this.#e.translate(Kt,n,e):p});periodLabel=_(()=>{let e=this.#i(),i=this.period(),[n="",a=""]=i.split("-"),p=jt.get(a);return!p||!n?i:`${this.#e.translate(p,{},e)} ${n}`});openHistoryModal(){let e=$t(this.period());this.#t.openModal("leaderboard-history",e?[e[1],e[0]]:[])}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["lib-reward-item"]],inputs:{balanceHistoryItem:[1,"balanceHistoryItem"],isLast:[1,"isLast"]},decls:16,vars:22,consts:[[1,"grid","grid-cols-[2.4fr,1fr]","sm:grid-cols-[16.5rem,4fr,5.75rem]","md:[17.8rem,4fr,5.75rem]","items-center","justify-start","gap-6","text-sm","w-full","mr-6","max-sm:py-2","max-sm:px-0","p-3","pb-2"],[1,"flex","items-center","gap-2","min-w-0"],["alt","reward icon",1,"size-10","rounded-lg","flex-shrink-0","object-cover","object-center","group-hover:opacity-25",3,"src"],[1,"text-grey-100","truncate","min-w-0"],[1,"hidden","sm:block","truncate","min-w-0"],[1,"flex","gap-1","items-center","justify-between"],[1,"justify-self-start",3,"value","isCompactView"],["typeOfButton","button",1,"style_ghost","icon","pr-0","group","flex","items-center","justify-center",3,"buttonClick","ariaLabel"],[1,"ph","ph-info","text-2xl/6","text-grey-100","group-hover:text-grey-200","transition-colors","duration-200"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1),u(2,"img",2),c(3,"assetUrl"),c(4,"replaceImageDomain"),r(5,"p",3),g(6),c(7,"transloco"),l()(),r(8,"div",4),g(9),c(10,"transloco"),l(),r(11,"div",5),u(12,"app-currency",6),r(13,"app-ui-button",7),c(14,"transloco"),M("buttonClick",function(){return n.openHistoryModal()}),u(15,"i",8),l()()()),i&2&&(Y(n.isLast()?"":"border-b border-grey-550"),o(2),d("src",m(4,10,m(3,8,"/assets/images/leaderboard/3_crowns.webp")),V),o(4),O(m(7,12,"BLOCKS.BALANCE_HISTORY.LEADERBOARD_REWARD")),o(3),v(" ",F(10,14,"BLOCKS.BALANCE_HISTORY.REWARD_TEXT",Be(19,Ut,n.positionLabel(),n.periodLabel()))," "),o(3),d("value",n.reward())("isCompactView",!0),o(),d("ariaLabel",m(14,17,"BLOCKS.BALANCE_HISTORY.LEADERBOARD_REWARD")))},dependencies:[U,J,Z,ee,A],styles:["[_nghost-%COMP%]{border-radius:.5rem;overflow:hidden;--currency__font-size: .875rem;--currency__line-height: 1.25rem;--currency__dark-text-color: #43F959;--button__padding-x: 0rem;--button__padding-y: 0rem}"],changeDetection:0})}return t})();var Wt=["tableTop"],Gt=(t,s)=>s.value;function zt(t,s){if(t&1){let e=L();r(0,"app-ui-button",16),M("buttonClick",function(){let n=E(e).$implicit,a=C();return w(a.selectedRangeOption.set(n))}),g(1),c(2,"uppercase"),c(3,"transloco"),l()}if(t&2){let e=s.$implicit,i=C();Y(e===i.selectedRangeOption()?"style_primary":"style_secondary"),o(),O(m(3,5,m(2,3,"BLOCKS.BALANCE_HISTORY."+e)))}}function qt(t,s){if(t&1){let e=L();r(0,"app-ui-button",17),M("buttonClick",function(){E(e);let n=C();return w(n.downloadCSV())}),u(1,"i",18),g(2),c(3,"transloco"),l(),r(4,"app-ui-button",19),M("buttonClick",function(){E(e);let n=C();return w(n.downloadCSV())}),u(5,"i",20),l()}if(t&2){C();let e=x(0),i=x(1),n=x(2);d("disabled",e||n||i),o(2),v(" ",m(3,3,"BLOCKS.PURCHASE_HISTORY.DOWNLOAD")," "),o(2),d("disabled",e||n||i)}}function Xt(t,s){if(t&1&&(r(0,"div",22),g(1),c(2,"transloco"),l()),t&2){let e=s.$implicit,i=s.$index;
1H("balance-history__head-cell--chatbot",i===0),o(),v(" ",m(2,3,"BLOCKS.BALANCE_HISTORY."+e)," ")}}function Qt(t,s){if(t&1&&(r(0,"div",10),R(1,Xt,3,5,"div",21,se),l()),t&2){let e=C();o(),N(e.titleColumns())}}function Jt(t,s){t&1&&(r(0,"div",12),u(1,"app-ui-spinner"),l())}function Zt(t,s){if(t&1&&u(0,"lib-balance-history-item",24),t&2){let e=C(),i=e.$implicit,n=e.$index,a=e.$count;d("balanceHistoryItem",i)("isLast",n===a-1)}}function en(t,s){if(t&1){let e=L();r(0,"lib-convert-to-tokens-item",25),M("infoButton",function(){E(e);let n=C().$implicit,a=C(2);return w(a.openWithdrawalInfo(n.id))}),l()}if(t&2){let e=C(),i=e.$implicit,n=e.$index,a=e.$count;d("balanceHistoryItem",i)("isLast",n===a-1)}}function tn(t,s){if(t&1&&u(0,"lib-reward-item",24),t&2){let e=C(),i=e.$implicit,n=e.$index,a=e.$count;d("balanceHistoryItem",i)("isLast",n===a-1)}}function nn(t,s){if(t&1&&S(0,Zt,1,2,"lib-balance-history-item",24)(1,en,1,2,"lib-convert-to-tokens-item",24)(2,tn,1,2,"lib-reward-item",24),t&2){let e=s.$implicit,i=C(2);I(i.isBalanceHistoryBot(e)?0:i.isConvertToTokensEntry(e)?1:i.isLeaderboardRewardEntry(e)?2:-1)}}function on(t,s){if(t&1){let e=L();r(0,"app-ui-no-data-placeholder",26),c(1,"transloco"),c(2,"transloco"),r(3,"app-ui-button",28),M("buttonClick",function(){E(e);let n=C(3);return w(n.goToHomepage())}),u(4,"span",29),r(5,"span"),g(6),c(7,"transloco"),l()()()}t&2&&(d("description",m(1,3,"BLOCKS.BALANCE_HISTORY.TIP"))("title",m(2,5,"BLOCKS.BALANCE_HISTORY.NO_RESULT")),o(6),O(m(7,7,"BLOCKS.BALANCE_HISTORY.BUTTON")))}function an(t,s){t&1&&(u(0,"app-ui-no-data-placeholder",27),c(1,"transloco"),c(2,"transloco")),t&2&&d("description",m(1,2,"BLOCKS.BALANCE_HISTORY.TIP_FOR_QUERY"))("title",m(2,4,"BLOCKS.BALANCE_HISTORY.NO_RESULT_FOR_QUERY"))}function rn(t,s){if(t&1&&(r(0,"div",23),S(1,on,8,9,"app-ui-no-data-placeholder",26)(2,an,3,6,"app-ui-no-data-placeholder",27),l()),t&2){C(2);let e=x(1),i=x(5);o(),I(i?e?2:-1:1)}}function sn(t,s){if(t&1&&R(0,nn,3,1,null,null,se,!1,rn,3,1,"div",23),t&2){let e=C();N(e.balanceHistoryItems())}}function ln(t,s){if(t&1){let e=L();r(0,"app-ui-pagination",30),M("selectedPage",function(n){E(e);let a=C();return w(a.onPageSelected(n))}),l()}if(t&2){C();let e=x(3),i=x(4);d("currentPage",i)("totalPages",e)}}function cn(t,s){if(t&1&&u(0,"app-ui-option",33),t&2){let e=s.$implicit;d("option",e)}}function pn(t,s){if(t&1){let e=L();r(0,"div",15)(1,"span",31),g(2),c(3,"transloco"),l(),r(4,"app-ui-select",32),M("optionSelect",function(n){E(e);let a=C();return w(a.onRowsOptionSelected(n))}),R(5,cn,1,1,"app-ui-option",33,Gt),l()()}if(t&2){let e=C();o(2),O(m(3,2,"BLOCKS.PURCHASE_HISTORY.DISPLAY_ROWS")),o(2),d("value",e.selectedRowsOption()),o(),N(e.rowsOptions())}}var mo=(()=>{class t{#e=b(re);#t=b(me);#i=b(et);#n=b(fe);#a=b(tt);#l=b(Q);#c=b($e);#p=b(de);#o=b(_e);tableTopAnchor=Re("tableTop",{read:te});#m=ct(this.tableTopAnchor);isTma=b(Ue);rangeOptions=D(Object.values(ie));selectedRangeOption=D(ie.WEEK);titleColumns=D(dt);balanceHistoryItems=_(()=>this.#o.items()??[]);isBalanceHistoryBot=ut;isConvertToTokensEntry=ht;isLeaderboardRewardEntry=Ct;isLoading=this.#n.isLoading;isDownloadingCsv=D(!1);rowsOptions=D(pt.map(e=>({label:e,value:e})));selectedRowsOption=ne(this.rowsOptions()[1]);totalPages=_(()=>this.#o.meta()?.totalPages??0);selectedPage=Ae(()=>this.#o.meta()?.page??1);itemCategories=gt;selectedCategory=ne($.ALL);hasAnyTransactionsEver=_(()=>this.#o.summary()?.hasAnyTransactionsEver??!1);constructor(){this.#C(),this.#b()}ngOnDestroy(){this.selectedRowsOption.set(this.rowsOptions()[1]),this.selectedRangeOption.set(ie.WEEK),this.#o.clearMeta()}async downloadCSV(){if(this.isDownloadingCsv())return;let e=this.#d(1);if(e){this.isDownloadingCsv.set(!0);try{let i=await this.#n.getHistoryPage(e),n=[...i.items],a=i.meta.totalPages;for(let y=2;y<=a;y++){let f=await this.#n.getHistoryPage(ve(Oe({},e),{page:y}));n.push(...f.items)}if(!n.length)return;let p=nt(n);it(p,this.#_(),this.#e)}finally{this.isDownloadingCsv.set(!1)}}}goToHomepage(){this.#t.navigate([""])}onPageSelected(e){this.selectedPage.set(e),this.#y()}onRowsOptionSelected(e){this.selectedRowsOption.set(e),e&&this.selectedPage.set(1)}openWithdrawalInfo(e){this.#g(e)}#d(e){let i=this.selectedRangeOption(),n=this.selectedRowsOption(),a=this.selectedCategory();if(!i||!n||!a)return null;let p=Array.isArray(n)?Number(n[0].value):Number(n.value);return{range:i,direction:a,page:e,limit:p}}#_(){let e=`balance-history-${this.#i.brandShort}.csv`,i=this.selectedRangeOption();i&&(e=e.split(".")[0].concat(`-${i}.csv`));let n=this.selectedCategory();return n&&n!==$.ALL&&(e=e.replace(".csv",`-${n}.csv`)),e}async#g(e){let i=null;try{i=await this.#u(e)}catch{return}if(!i){this.#h(e);return}await this.#l.openModal("withdrawal-result",[e],void 0,{withdrawalItem:i})}async#u(e){let i=await this.#r(1),n=this.#s(i,e);if(n)return n;let a=i.tableMeta.totalPages;for(let p=2;p<=a;p++){let y=await this.#r(p),f=this.#s(y,e);if(f)return f}return null}#r(e){return ae(this.#a.getBillingData({page:e,limit:_t}))}#s(e,i){return e.tableData.find(n=>n.id===i)??null}#h(e){this.#c.addErrorNotification(this.#p.translate("BLOCKS.BALANCE_HISTORY.WITHDRAWAL_NOT_FOUND",{id:e}))}#C(){j(()=>{let e=this.selectedRangeOption(),i=this.selectedRowsOption(),n=this.selectedCategory();!e||!i||!n||ye(()=>{let a=Array.isArray(i)?Number(i[0].value):Number(i.value);this.selectedPage.set(1),this.#n.loadHistoryConfig.set({range:e,direction:n,page:1,limit:a})})})}#b(){j(()=>{let e=this.selectedPage();ye(()=>{let i=this.selectedRangeOption(),n=this.selectedRowsOption(),a=this.selectedCategory();if(!i||!n||!a||!e)return;let p=Array.isArray(n)?Number(n[0].value):Number(n.value);this.#n.loadHistoryConfig.set({range:i,direction:a,page:e,limit:p})})})}#y(){this.#m()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["lib-balance-history"]],viewQuery:function(i,n){i&1&&Ee(n.tableTopAnchor,Wt,5,te),i&2&&we()},inputs:{selectedRowsOption:[1,"selectedRowsOption"],selectedCategory:[1,"selectedCategory"]},outputs:{selectedRowsOption:"selectedRowsOptionChange",selectedCategory:"selectedCategoryChange"},features:[Se([fe])],decls:25,vars:19,consts:[["tableTop",""],[1,"balance-history"],[1,"balance-history__controls","items-center"],[1,"flex","w-full","justify-between","gap-2"],[1,"balance-history__ranges"],[1,"period-btn","size_big",3,"class"],[1,"flex","items-center","gap-4"],[1,"hidden","sm:block",3,"valueChange","tabs","value"],[1,"sm:hidden",3,"valueChange","tabs","value"],[1,"balance-history__body"],[1,"balance-history__head"],[1,"balance-history__table"],[1,"balance-history__spinner"],[1,"balance-history__footer"],[3,"currentPage","totalPages"],[1,"balance-history__rows-control"],[1,"period-btn","size_big",3,"buttonClick"],[1,"desktop-download-btn","style_secondary","hidden","sm:block",3,"buttonClick","disabled"],["icon-left","",1,"ph","ph-download-simple"],[1,"mobile-download-btn","style_secondary","sm:hidden",3,"buttonClick","disabled"],[1,"ph","ph-download-simple","text-2xl/6"],[1,"balance-history__head-cell",3,"balance-history__head-cell--ch
1atbot"],[1,"balance-history__head-cell"],[1,"balance-history__state"],[3,"balanceHistoryItem","isLast"],[3,"infoButton","balanceHistoryItem","isLast"],["icon","table",3,"description","title"],["icon","robot",3,"description","title"],[1,"style_primary","size_xl",3,"buttonClick"],["icon-left","",1,"ph","ph-plus-square"],[3,"selectedPage","currentPage","totalPages"],[1,"hidden","px-4","sm:block"],["dropdownPosition","top-left","dropdownWidth","fit-content",1,"pagination",3,"optionSelect","value"],[3,"option"]],template:function(i,n){if(i&1){let a=L();k(0)(1)(2)(3)(4)(5),r(6,"div",1,0)(8,"div",2)(9,"div",3)(10,"div",4),R(11,zt,4,7,"app-ui-button",5,se),l(),r(13,"div",6)(14,"app-category-selector",7),be("valueChange",function(y){return E(a),Ce(n.selectedCategory,y)||(n.selectedCategory=y),w(y)}),l(),S(15,qt,6,5),l()(),r(16,"app-category-selector",8),be("valueChange",function(y){return E(a),Ce(n.selectedCategory,y)||(n.selectedCategory=y),w(y)}),l()(),r(17,"div",9),S(18,Qt,3,0,"div",10),r(19,"div",11),S(20,Jt,2,0,"div",12)(21,sn,3,1),l(),r(22,"div",13),S(23,ln,1,2,"app-ui-pagination",14),S(24,pn,7,4,"div",15),l()()()}if(i&2){let a=T(n.isLoading());o();let p=T(!n.balanceHistoryItems().length&&!a);o(),T(n.isDownloadingCsv()),o();let y=T(n.totalPages());o(),T(n.selectedPage()),o(),T(n.hasAnyTransactionsEver());let f=y>1;o(6),N(n.rangeOptions()),o(3),d("tabs",n.itemCategories),he("value",n.selectedCategory),o(),I(n.isTma?-1:15),o(),d("tabs",n.itemCategories),he("value",n.selectedCategory),o(2),I(p?-1:18),o(),H("balance-history__table--empty",p),o(),I(a?20:21),o(2),Y(f?"justify-between":"justify-end"),o(),I(f?23:-1),o(),I(p?-1:24)}},dependencies:[J,vt,ze,Ze,Xe,qe,Je,Mt,xt,lt,X,A],styles:["[_nghost-%COMP%]{display:block;min-height:0;--category-selector__width: 100%;--category-selector__tab-padding: .25rem;--category-selector__font-size: .75rem;--category-selector__line-height: 1rem;--category-selector__track-gap: .25rem;--category-selector__tab-width: 6.5rem}@media screen and (max-width:767px){[_nghost-%COMP%]{--category-selector__tab-width: 100%}}[_nghost-%COMP%]   .pagination[_ngcontent-%COMP%]{--select__width: 3.5rem;--select__height: 2.25rem;--select__padding-x: .5rem;--select__padding-y: .25rem;--select__content-gap: .625rem;--select__border-radius: .5rem;--select__background-color: transparent;--select__background-color_hover: #2B2B2B}[_nghost-%COMP%]   .desktop-download-btn[_ngcontent-%COMP%]{--button__height: 2rem}[_nghost-%COMP%]   .mobile-download-btn[_ngcontent-%COMP%]{--button__width: 2rem;--button__height: 2rem;--button__padding-x: .25rem;--button__padding-y: .25rem}[_nghost-%COMP%]   .balance-history[_ngcontent-%COMP%]{display:flex;flex:1 1 auto;flex-direction:column;gap:1.5rem;min-height:0;margin-top:1.5rem}[_nghost-%COMP%]   .balance-history__controls[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.5rem}@media screen and (max-width:767px){[_nghost-%COMP%]   .balance-history__controls[_ngcontent-%COMP%]{flex-direction:column;gap:1rem}}[_nghost-%COMP%]   .balance-history__ranges[_ngcontent-%COMP%]{display:flex;gap:.5rem}[_nghost-%COMP%]   .balance-history__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}[_nghost-%COMP%]   .balance-history__head[_ngcontent-%COMP%]{display:none;width:100%;gap:1.5rem}[_nghost-%COMP%]   .balance-history__head-cell[_ngcontent-%COMP%]{overflow:hidden;font-size:.875rem;line-height:1.25rem}[_nghost-%COMP%]   .balance-history__table[_ngcontent-%COMP%]{border-top:1px solid #323232}[_nghost-%COMP%]   .balance-history__spinner[_ngcontent-%COMP%], [_nghost-%COMP%]   .balance-history__state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}[_nghost-%COMP%]   .balance-history__spinner[_ngcontent-%COMP%]{padding-top:1.5rem}[_nghost-%COMP%]   .balance-history__footer[_ngcontent-%COMP%], [_nghost-%COMP%]   .balance-history__rows-control[_ngcontent-%COMP%]{display:flex;align-items:center}@media screen and (min-width:768px){[_nghost-%COMP%]   .balance-history[_ngcontent-%COMP%]{gap:1.25rem}[_nghost-%COMP%]   .balance-history__head[_ngcontent-%COMP%]{display:grid}}[_nghost-%COMP%]   .period-btn[_ngcontent-%COMP%]{--button__width: 7.5rem}[_nghost-%COMP%]   .balance-history__controls[_ngcontent-%COMP%]{align-items:center}[_nghost-%COMP%]   .balance-history__body[_ngcontent-%COMP%]{height:100%}
1[_nghost-%COMP%]   .balance-history__head-cell--chatbot[_ngcontent-%COMP%]{margin-left:.75rem}[_nghost-%COMP%]   .balance-history__table[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%]   .balance-history__table--empty[_ngcontent-%COMP%]{padding-top:1.5rem}@media screen and (min-width:768px){[_nghost-%COMP%]   .balance-history[_ngcontent-%COMP%]{--category-selector__width: fit-content}[_nghost-%COMP%]   .balance-history__head[_ngcontent-%COMP%]{grid-template-columns:17.75rem 4fr 6.5rem}[_nghost-%COMP%]   .balance-history__state[_ngcontent-%COMP%]{height:23rem;padding-top:1.5rem}}@media screen and (min-width:1024px){[_nghost-%COMP%]   .balance-history__state[_ngcontent-%COMP%]{height:22.2rem}}@media screen and (min-width:1280px){[_nghost-%COMP%]   .balance-history__state[_ngcontent-%COMP%]{height:13.9rem}}@media screen and (min-width:1440px){[_nghost-%COMP%]   .balance-history__state[_ngcontent-%COMP%]{height:15.3rem}}@media screen and (min-width:1920px){[_nghost-%COMP%]   .balance-history__state[_ngcontent-%COMP%]{height:22.1rem}}"]})}return t})();export{mo as BalanceHistoryComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.