PageSourceSearch

https://0x.kz/build/assets/Index-py2NeDuH.js

js 0x.kz collected 2026-10-09 04:37:11 UTC 17,043 bytes, 1 lines download raw bytes

1import{o as l,c as r,a as s,_ as R,b,h as M,t as p,u as c,e as g,F as f,j as v,l as w,v as _,d as i,k as B,g as m,n as U,m as k,f as C}from"./app-DVhk9hEg.js";import{M as O}from"./Main-16vdnVOn.js";import{F as S,r as Z,a as E}from"./FiltersChart-CSDdwyNl.js";import{_ as P,r as z,a as Y}from"./AxesContent-B5WXzWq-.js";import{R as L,P as $,a as j,L as A,B as V,D as T,b as D}from"./index-CsDG7sQh.js";import{C as H,p as G,a as I,b as K,R as N,L as W,B as q,c as J,d as Q,A as X,P as ee}from"./chart-4zv7KpEq.js";import{r as te}from"./ArrowPathRoundedSquareIcon-Dv6TRcFR.js";/* empty css            */import"./keyboard-BzxerdJT.js";import"./use-resolve-button-type-CpPrrBwU.js";import"./dialog-B1KZN6xf.js";import"./listbox-BkFxtIHv.js";function se(o,e){return l(),r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[s("path",{d:"M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z"})])}function ae(o,e){return l(),r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[s("path",{"fill-rule":"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z","clip-rule":"evenodd"})])}function le(o,e){return l(),r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[s("path",{"fill-rule":"evenodd",d:"M1.5 5.625c0-1.036.84-1.875 1.875-1.875h17.25c1.035 0 1.875.84 1.875 1.875v12.75c0 1.035-.84 1.875-1.875 1.875H3.375A1.875 1.875 0 0 1 1.5 18.375V5.625ZM21 9.375A.375.375 0 0 0 20.625 9h-7.5a.375.375 0 0 0-.375.375v1.5c0 .207.168.375.375.375h7.5a.375.375 0 0 0 .375-.375v-1.5Zm0 3.75a.375.375 0 0 0-.375-.375h-7.5a.375.375 0 0 0-.375.375v1.5c0 .207.168.375.375.375h7.5a.375.375 0 0 0 .375-.375v-1.5Zm0 3.75a.375.375 0 0 0-.375-.375h-7.5a.375.375 0 0 0-.375.375v1.5c0 .207.168.375.375.375h7.5a.375.375 0 0 0 .375-.375v-1.5ZM10.875 18.75a.375.375 0 0 0 .375-.375v-1.5a.375.375 0 0 0-.375-.375h-7.5a.375.375 0 0 0-.375.375v1.5c0 .207.168.375.375.375h7.5ZM3.375 15h7.5a.375.375 0 0 0 .375-.375v-1.5a.375.375 0 0 0-.375-.375h-7.5a.375.375 0 0 0-.375.375v1.5c0 .207.168.375.375.375Zm0-3.75h7.5a.375.375 0 0 0 .375-.375v-1.5A.375.375 0 0 0 10.875 9h-7.5A.375.375 0 0 0 3 9.375v1.5c0 .207.168.375.375.375Z","clip-rule":"evenodd"})])}const oe={class:"flex min-h-full flex-col"},re={class:"pl-5 mx-auto w-full min-w-[1450px] grow lg:flex"},de={class:"flex-1 xl:flex"},ne={class:"xl:flex-1 bg-[#F3F6F9] min-h-screen"},ie={class:"bg-white px-4"},ue={class:"divide-y divide-gray-200"},ce={class:"flex justify-between items-center py-3"},he={class:"flex gap-3"},pe={class:"text-base mb-3"},me={key:0},ge={key:1},fe={class:"flex flex-col gap-0.5"},ve={class:"flex flex-col"},be={class:"pt-1 pb-1.5 my-2 rounded-md sm:flex items-center text-center border"},ye={class:"inline-flex items-center justify-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm"},xe=["onUpdate:modelValue"],we=["value"],_e=["onUpdate:modelValue"],ke=["value"],Ce=["onUpdate:modelValue"],Ae={key:1,class:"main"},De=["onUpdate:modelValue"],Be={class:"inline-flex items-center justify-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm"},Oe={class:"flex gap-1 ml-2"},Se=["onClick"],Le=["onClick"],$e=["onClick"],je={class:"flex flex-col"},Ve={class:"pt-1 pb-1.5 my-2 rounded-md sm:flex items-center text-center border"},Te={class:"inline-flex items-center justify-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm"},Fe=["value"],Re=["value"],Me={key:1,class:"main"},Ue={class:"flex gap-1 ml-2"},Ze={class:"mt-2"},Ee={key:0},Pe={key:1},ze={key:2},Ye={key:3},He={key:4},Ge={key:5},Ie={key:6},Ke={key:7},Ne={key:8},We={key:9},qe={class:"px-4 sm:px-6 lg:px-8"},Je={class:"flow-root"},Qe={class:"-mx-4 -my-2 bg-white overflow-x-auto sm:-mx-6 lg:-mx-8"},Xe={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"},et={class:"min-w-full divide-y divide-gray-300"},tt={scope:"col",class:"py-3 pl-4 pr-3 text-left text-xs font-medium uppercase tracking-wide text-gray-500 sm:pl-0"},st={class:"divide-y divide-gray-200 bg-white"},at={class:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-0"},lt={key:10,class:"text-center"},ot={class:"flex items-center mb-4"},rt={class:"mr-2"},dt={class:"flex flex-col gap-3"},nt={class:"ml-1"},it={class:"font-roboto text-base font-semibold leading-6 text-dark"},ut={class:""},ct={role:"list",class:"grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"},ht=["onClick"],pt={class:"flex flex-1 flex-col"},mt=["src"],gt={class:"col-span-2 flex flex-col divide-y divide-gray-200 cursor-pointer rounded-lg bg-white text-center shadow"},ft={class:"flex flex-1 flex-col"};H.register(G,I,K,N,W,q,J,Q,X,ee);const vt={name:"Analytics",components:{Main:O,AxesContent:P,FiltersChart:S,Bar:D,Doughnut:T,Bubble:V,Line:A,Pie:j,PolarArea:$,Radar:L},data(){return{filters:{},leads:{count:0,total_cost:0,legends:{},data:[]},dateFormats:[{value:"%Y",label:"Год"},{value:"%Y-%m",label:"Год и месяц"},{value:"%Y-%m-%d",label:"Полная дата"},{value:"%Y-%m-%d %H",label:"Дата и время"}],charts:[{id:"bar",src:"/assets/schedule/cluster-column-1.svg",component:"BarChart"},{id:"degrees",src:"/assets/schedule/barleft.svg",component:"BarDegrees"},{id:"area",src:"/assets/schedule/area.svg",component:"AreaChart"},{id:"pie",src:"/assets/schedule/pie.svg",component:"PieChart"},{id:"doughnut",src:"/assets/schedule/doughnut.svg",component:"DoughnutChart"},{id:"radar",src:"/assets/schedule/radar.svg",component:"RadarChart"},{id:"bubble",src:"/assets/schedule/dot-plot-1.svg",component:"BubbleChart"},{id:"line",src:"/assets/schedule/double-line.svg",component:"LineChart"}
1],chartOptionsArea:{responsive:!0,plugins:{legend:{display:!0,position:"top"},title:{display:!0,text:"Area Chart"}},scales:{y:{beginAtZero:!0}}},axes:{x:{legend:"Date",aggregate:"date_format",source:"created_at",bind:["%Y-%m"]},y:{legend:"Count",aggregate:"count"}},viewType:"bar",newAxe:{legend:"",aggregate:"value",source:"",bind:[""]},fields:{},dataset:null,items:null,letters:["x","y","z","a","b","c","d","e","f"],colors:["#f87979","#36a2eb","#4bc0c0","#f99f41","#9966ff","#c9cbcf"],filter:C(!1),isSmall:C(!1),isOpenAnalytics:C(!1),chartOptions:{responsive:!0,indexAxis:"y",plugins:{legend:{display:!0,position:"top"},title:{display:!0,text:"Bar Chart (Horizontal)"}},scales:{x:{beginAtZero:!0}}}}},mounted(){this.loadFields(),this.loadDataset()},methods:{loadFields(){k.get("/api/filter").then(o=>{this.fields=o.data})},loadDataset(){this.dataset=null,k.post("/api/leads/analytics",{...this.filters,axes:this.axes}).then(o=>{this.dataset=o.data}),this.loadItems()},loadItems(){k.get("/api/leads",{params:{...this.filters,page:this.page}}).then(o=>{this.items=o.data})},addAxe(){const o=this.nextLetter;this.axes[o]={...this.newAxe},this.newAxe={legend:"",aggregate:"value",source:null,bind:[""]}},removeAxe(o){delete this.axes[o],this.loadDataset()},restard(){this.axes={x:{legend:"Date",aggregate:"date_format",source:"created_at",bind:["%Y-%m"]},y:{legend:"Count",aggregate:"count"}},this.loadDataset()},move(o,e){this.reorderKeys(o,e),this.loadDataset()},reorderKeys(o,e){let a=Object.keys(this.axes),t=a.indexOf(o);if(t===-1||t+e<0||t+e>=a.length)return;let d=[...a];[d[t],d[t+e]]=[d[t+e],d[t]];const n=d.reduce((u,h)=>(u[h]=this.axes[h],u),{});this.axes=n},groupBy(o,e){return o.reduce((a,t)=>{const d=t[e];return a[d]||(a[d]=[]),a[d].push(t),a},{})},getRandomColor(){const o="0123456789ABCDEF";let e="#";for(let a=0;a<6;a++)e+=o[Math.floor(Math.random()*16)];return e},selectChart(o){this.viewType=o.id}},computed:{aggregateFields(){return{...this.fields.fields,...this.fields.project_meta,...this.fields.lead_meta,...this.fields.utm,source:"Source",project:"Project",created_at:this.fields.created_at}},nextLetter(){let o=Object.keys(this.axes).length;return this.letters[o]},chartGroups(){var o;return(o=this.dataset)!=null&&o.data?this.groupBy(this.dataset.data,"z"):null},chartData(){var t;if(!((t=this.dataset)!=null&&t.data))return null;if(this.dataset.data.length===0)return{labels:[],datasets:[]};let o=this.dataset.data.map(d=>d.x),e=[],a=0;for(const[d,n]of Object.entries(this.chartGroups)){let u={};o.forEach(h=>{var y;return u[h]=((y=n.find(x=>x.x===h))==null?void 0:y.y)||0}),u=Object.values(u),e.push({label:d!="undefined"?d:"Data",backgroundColor:Array.from(new Set([...o])).map(()=>this.getRandomColor()),data:u}),a=a===this.colors.length-1?0:a+1}return{labels:Array.from(new Set([...o])),datasets:e}},chartDataPie(){if(!this.dataset)return null;let o=this.dataset.data.map(n=>n.x),e=Array.from(new Set([...o])),a=[],t=0;e.forEach(n=>{a.push(this.colors[t]),t=t===this.colors.length-1?0:t+1});let d=[];for(const[n,u]of Object.entries(this.chartGroups)){let h={};o.forEach(y=>{var x;return h[y]=((x=u.find(F=>F.x===y))==null?void 0:x.y)||0}),h=Object.values(h),d.push({label:n||"Data",backgroundColor:Array.from(new Set([...o])).map(()=>this.getRandomColor()),data:h})}return console.log(d),console.log("labels",o),{labels:e,datasets:d}},chartDataBubble(){if(!this.dataset)return null;let o=this.groupBy(this.dataset.data,"x"),e=[],a=0;for(const[t,d]of Object.entries(o)){let n={};n=d.map(u=>({x:u.y,y:u.z,r:u.a||10})),e.push({label:t||"Data",backgroundColor:this.colors[a],data:n}),a=a===this.colors.length-1?0:a+1}return{datasets:e}},chartRadaer(){var a;if(!((a=this.dataset)!=null&&a.data))return null;if(this.dataset.data.length===0)return{labels:[],datasets:[]};let o=this.dataset.data.map(t=>t.x),e=[];for(const[t,d]of Object.entries(this.chartGroups)){let n={};o.forEach(u=>{var h;return n[u]=((h=d.find(y=>y.x===u))==null?void 0:h.y)||0}),n=Object.values(n),e.push({label:t!="undefined"?t:"Data",backgroundColor:Array.from(new Set([...o])).map(()=>this.getRandomColor()),data:n,borderColor:this.getRandomColor(),borderWidth:1})}return{labels:Array.from(new Set([...o])),datasets:e}}},watch:{axes:{handler(o){this.loadDataset()},deep:!0},filters(o){this.loadDataset()}}},bt=Object.assign(vt,{setup(o){return(e,a)=>(l(),r("div",null,[b(O,null,{default:M(()=>[s("div",oe,[s("div",re,[s("div",de,[b(S,{filters:e.filters,fields:e.fields,onLoadDataset:e.loadDataset,axes:e.axes,onRestard:a[0]||(a[0]=()=>e.restard())},null,8,["filters","fields","onLoadDataset","axes"]),s("div",ne,[s("div",ie,[s("div",ue,[s("div",ce,[s("div",he,[
1s("span",pe,p(e.$page.props.translations.messages.analytics_axes),1),b(c(te),{class:"w-5 h-5 cursor-pointer",onClick:e.restard},null,8,["onClick"])]),s("button",{class:"text-blue-500 text-xl font-bold",onClick:a[1]||(a[1]=t=>e.isOpenAnalytics=!e.isOpenAnalytics)},[e.isOpenAnalytics?(l(),r("span",me,"-")):(l(),r("span",ge,"+"))])]),g(s("div",fe,[e.axes?(l(!0),r(f,{key:0},v(e.axes,(t,d)=>(l(),r("div",ve,[s("div",be,[s("div",ye,p(d),1),g(s("select",{"onUpdate:modelValue":n=>t.source=n,class:"text-base rounded-lg w-full p-2.5 mr-2 focus:outline-0"},[a[10]||(a[10]=s("option",{disabled:"",value:null},"Поле выборки",-1)),(l(!0),r(f,null,v(e.aggregateFields,(n,u)=>(l(),r("option",{value:u,key:u},p(n),9,we))),128))],8,xe),[[w,t.source]]),g(s("select",{"onUpdate:modelValue":n=>t.aggregate=n,class:"rounded-lg w-full py-2.5 px-4.5 mr-2 focus:outline-0"},[(l(!0),r(f,null,v(e.fields.functions,(n,u)=>(l(),r("option",{value:u,class:""},p(n.name),9,ke))),256))],8,_e),[[w,t.aggregate]]),t.aggregate==="date_format"?g((l(),r("input",{key:0,"onUpdate:modelValue":n=>t.bind[0]=n,class:"text-base rounded-lg p-2.5 mr-2 focus:outline-0",placeholder:"%Y-%m"},null,8,Ce)),[[_,t.bind[0]]]):(l(),r("div",Ae)),g(s("input",{"onUpdate:modelValue":n=>t.legend=n,class:"text-base rounded-lg py-2.5 w-24 mr-2 focus:outline-0",placeholder:"Название"},null,8,De),[[_,t.legend]]),s("div",Be,[s("div",Oe,[s("button",{onClick:n=>e.move(d,-1),class:"px-2 py-1 border rounded bg-gray-200"},[b(c(z),{class:"h-3.5 w-3.5"})],8,Se),s("button",{onClick:n=>e.move(d,1),class:"px-2 py-1 border rounded bg-gray-200"},[b(c(Y),{class:"h-3.5 w-3.5"})],8,Le),s("button",{onClick:n=>e.removeAxe(d),class:"mx-3 text-red-500 hover:text-red-700","aria-label":"Удалить ось"},[b(c(ae),{class:"cursor-pointer w-4 h-4 text-red-400","aria-hidden":"true"})],8,$e)])])])]))),256)):i("",!0),a[12]||(a[12]=s("hr",{class:"my-5"},null,-1)),s("div",je,[s("div",Ve,[s("div",Te,p(e.nextLetter),1),g(s("select",{"onUpdate:modelValue":a[2]||(a[2]=t=>e.newAxe.source=t),class:"text-base rounded-lg w-full p-2.5 mr-2 focus:outline-0"},[a[11]||(a[11]=s("option",{disabled:"",value:null},"Поле выборки",-1)),(l(!0),r(f,null,v(e.aggregateFields,(t,d)=>(l(),r("option",{value:d},p(t),9,Fe))),256))],512),[[w,e.newAxe.source]]),g(s("select",{"onUpdate:modelValue":a[3]||(a[3]=t=>e.newAxe.aggregate=t),class:"rounded-lg w-full py-2.5 px-4.5 mr-2 focus:outline-0"},[(l(!0),r(f,null,v(e.fields.functions,(t,d)=>(l(),r("option",{value:d,class:""},p(t.name),9,Re))),256))],512),[[w,e.newAxe.aggregate]]),e.newAxe.aggregate==="date_format"?g((l(),r("input",{key:0,"onUpdate:modelValue":a[4]||(a[4]=t=>e.config.bind[0]=t),class:"text-base rounded-lg p-2.5 mr-2 focus:outline-0",placeholder:"%Y-%m"},null,512)),[[_,e.config.bind[0]]]):(l(),r("div",Me)),g(s("input",{"onUpdate:modelValue":a[5]||(a[5]=t=>e.newAxe.legend=t),class:"text-base rounded-lg py-2.5 w-24 mr-2 focus:outline-0",placeholder:"Название"},null,512),[[_,e.newAxe.legend]]),s("div",{class:"inline-flex items-center justify-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm",onClick:a[7]||(a[7]=t=>e.removeAxe(e.letter))},[s("div",Ue,[s("button",{onClick:a[6]||(a[6]=(...t)=>e.addAxe&&e.addAxe(...t)),class:"mx-3 text-red-500 hover:text-red-700","aria-label":"Добавить ось"},[b(c(se),{class:"cursor-pointer w-4 h-4 text-blue-500 text-xl font-bold","aria-hidden":"true"})])])])])])],512),[[B,e.isOpenAnalytics]])])]),s("div",Ze,[e.viewType==="bar"?(l(),r("div",Ee,[e.chartData?(l(),m(c(D),{key:0,data:e.chartData},null,8,["data"])):i("",!0)])):i("",!0),e.viewType==="degrees"?(l(),r("div",Pe,[e.chartData?(l(),m(c(D),{key:0,data:e.chartData,options:e.chartOptions},null,8,["data","options"])):i("",!0)])):i("",!0),e.viewType==="doughnut"?(l(),r("div",ze,[e.chartDataPie?(l(),m(c(T),{key:0,data:e.chartDataPie},null,8,["data"])):i("",!0)])):i("",!0),e.viewType==="bubble"?(l(),r("div",Ye,[e.chartDataBubble?(l(),m(c(V),{key:0,data:e.chartDataBubble},null,8,["data"])):i("",!0)])):i("",!0),e.viewType==="line"?(l(),r("div",He,[e.chartData?(l(),m(c(A),{key:0,data:e.chartData},null,8,["data"])):i("",!0)])):i("",!0),e.viewType==="area"?(l(),r("div",Ge,[e.chartData?(l(),m(c(A),{key:0,data:e.chartData,options:e.chartOptionsArea},null,8,["data","options"])):i("",!0)])):i("",!0),e.viewType==="pie"?(l(),r("div",Ie,[e.chartData?(l(),m(c(j),{key:0,data:e.chartData},null,8,["data"])):i("",!0)])):i("",!0),e.viewType==="polar"?(l(),r("div",Ke,[e.chartData?(l(),m(c($),{key:0,data:e.chartData},null,8,["data"])):i("",!0)])):i("",!0),e.viewType==="radar"?(l(),r("div",Ne,[e.chartRadaer?(l(),m(c(L),{key:0,data:e.chartRadaer},null,8,["data"])):i("",!0)])):i("",!0),e.viewType==="table"?(l(),r("div",We,[s("div",qe,[s("div",Je,[s("div",Qe,[s("div",Xe,[s("table",et,[s("thead",null,[s("tr",null,[(l(!0),r(f,null,v(e.dataset.legends,(t,d)=>(l(),r("th",tt,p(t),1))),256))])]),s("tbody",st,[(l(!0),r(f,null,v(e.dataset.data,t=>(l(),r("tr",null,[(l(!0),r(f,null,v(e.dataset.legends,(d,n)=>(l(),r("td",at,p(t[n]),1))),256))]))),256))])])])])])])])):i("",!0),e.viewType===""?(l(),r("p",lt,p(e.$page.props.translations.messages.select_chart_to_display),1)):i("",!0)])])]),s("div",{class:U(["shrink-0 border-t border-gray-200   lg:border-l lg:border-t-0 ",e.isSmall?"lg:w-24":"lg:w-96 px-1  sm:px-6 lg:pr-8 xl:pr-6 py-2"])},[s("div",ot,[s("button",{class:"flex items-center",onClick:a[8]||(a[8]=t=>e.isSmall=!e.isSmall)},[s("span",rt,[e.isSmall?i("",!0):(l(),m(c(Z),{key:0,class:"h-5 w-5 text-indigo-700"}
1)),e.isSmall?(l(),m(c(E),{key:1,class:"h-5 w-5 text-indigo-700"})):i("",!0)])])]),g(s("div",dt,[s("div",nt,[s("span",it,p(e.$page.props.translations.messages.visualization),1)]),s("div",ut,[s("ul",ct,[(l(!0),r(f,null,v(e.charts,t=>(l(),r("li",{key:t.id,onClick:d=>e.selectChart(t),class:"col-span-2 flex flex-col divide-y divide-gray-200 cursor-pointer rounded-lg bg-white text-center shadow"},[s("div",pt,[s("img",{src:t.src,alt:"LeadHub",class:"w-auto h-36"},null,8,mt)])],8,ht))),128)),s("li",gt,[s("div",ft,[b(c(le),{alt:"LeadHub",onClick:a[9]||(a[9]=t=>e.viewType="table"),class:"text-[#0CA7DB] w-auto h-32"})])])])])],512),[[B,!e.isSmall]])],2)])])]),_:1})]))}}),$t=R(bt,[["__scopeId","data-v-e21c87c2"]]);export{$t as default};

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.