1import{o as n,c as o,a as l,C as q,S as K,I as Y,D as G,E as S,F as Q,f as v,O as x,_ as H,P as J,b as i,h as D,u as d,t as p,d as u,n as M,g as F}from"./app-DVhk9hEg.js";import O from"./LeadInfo-BemaNRbR.js";import{P as B}from"./Pagination-DLRJKwGi.js";import X from"./LineChat-CmtzTCQz.js";import E from"./Statistics-CI14YCiO.js";import N from"./Filters-bWcviPjW.js";import{M as T}from"./Main-16vdnVOn.js";import A from"./TableLead-cDQmrtxD.js";import{r as ee}from"./ArrowPathRoundedSquareIcon-Dv6TRcFR.js";import{d as te,p as se}from"./listbox-BkFxtIHv.js";import{i as le,E as re,A as ne,T as ae,o as oe,b as V}from"./keyboard-BzxerdJT.js";import{s as ie}from"./use-resolve-button-type-CpPrrBwU.js";import{f as de,u as ue}from"./dialog-B1KZN6xf.js";/* empty css */import"./transition-CLaDrR5O.js";import"./XMarkIcon-B221X_Ru.js";import"./chart-4zv7KpEq.js";function pe(s,e){return n(),o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[l("path",{d:"M7.25 10.25a.75.75 0 0 0 1.5 0V4.56l2.22 2.22a.75.75 0 1 0 1.06-1.06l-3.5-3.5a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 1.06 1.06l2.22-2.22v5.69Z"}),l("path",{d:"M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"})])}function m(s,e){return n(),o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[l("path",{d:"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z"})])}function fe(s,e){return n(),o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[l("path",{"fill-rule":"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z","clip-rule":"evenodd"})])}let me=Symbol("GroupContext"),ge=q({name:"Switch",emits:{"update:modelValue":s=>!0},props:{as:{type:[Object,String],default:"button"},modelValue:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,optional:!0},form:{type:String,optional:!0},name:{type:String,optional:!0},value:{type:String,optional:!0},id:{type:String,default:null},disabled:{type:Boolean,default:!1},tabIndex:{type:Number,default:0}},inheritAttrs:!1,setup(s,{emit:e,attrs:t,slots:r,expose:g}){var f;let c=(f=s.id)!=null?f:`headlessui-switch-${le()}`,y=K(me,null),[b,C]=te(x(()=>s.modelValue),a=>e("update:modelValue",a),x(()=>s.defaultChecked));function j(){C(!b.value)}let P=v(null),k=y===null?P:y.switchRef,_=ie(x(()=>({as:s.as,type:t.type})),k);g({el:k,$el:k});function I(a){a.preventDefault(),j()}function U(a){a.key===V.Space?(a.preventDefault(),j()):a.key===V.Enter&&se(a.currentTarget)}function W(a){a.preventDefault()}let w=x(()=>{var a,h;return(h=(a=oe(k))==null?void 0:a.closest)==null?void 0:h.call(a,"form")});return Y(()=>{G([w],()=>{if(!w.value||s.defaultChecked===void 0)return;function a(){C(s.defaultChecked)}return w.value.addEventListener("reset",a),()=>{var h;(h=w.value)==null||h.removeEventListener("reset",a)}},{immediate:!0})}),()=>{let{name:a,value:h,form:Z,tabIndex:$,...L}=s,z={checked:b.value},R={id:c,ref:k,role:"switch",type:_.value,tabIndex:$===-1?0:$,"aria-checked":b.value,"aria-labelledby":y==null?void 0:y.labelledby.value,"aria-describedby":y==null?void 0:y.describedby.value,onClick:I,onKeyup:U,onKeypress:W};return S(Q,[a!=null&&b.value!=null?S(de,re({features:ue.Hidden,as:"input",type:"checkbox",hidden:!0,readOnly:!0,checked:b.value,form:Z,disabled:L.disabled,name:a,value:h})):null,ne({ourProps:R,theirProps:{...t,...ae(L,["modelValue","defaultChecked"])},slot:z,attrs:t,slots:r,name:"Switch"})])}}});function ce(s,e){return n(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32
10 0 1 12 3Z"})])}const he={},ye={class:"grid min-h-full place-items-center bg-white px-6 py-24 sm:py-20 lg:px-8"};function be(s,e,t,r,g,f){return n(),o("div",ye,[...e[0]||(e[0]=[J('<div class="text-center"><p class="text-4xl font-roboto font-semibold text-indigo-600"> 404 </p><h1 class="mt-4 text-6xl font-bold tracking-tight text-gray-900 sm:text-5xl"> Ðид не найден </h1><p class="mt-6 text-base leading-7 text-gray-600"> ÐзвиниÑе, Ñакого лида не ÑÑÑеÑÑвÑеÑ. ÐожалÑйÑÑа, ÑвÑжиÑеÑÑ Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸ÑÑÑаÑоÑом ÑайÑа. </p><div class="mt-10 flex items-center justify-center gap-x-6"><a href="/leads" class="rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Go back Leads</a></div></div>',1)])])}const ke=H(he,[["render",be]]),ve={class:""},we={class:"px-4 sm:px-6 lg:px-8 text-[#2d333f]"},xe={class:"flex justify-end text-start items-center"},Fe={class:"flex gap-4"},Ce=["href"],je={class:"font-medium"},$e={class:""},Le={key:0},Se={class:"flex-center-between my-7 pr-10"},De={class:"flex gap-1"},Me={class:"text-[15px] text-dark/90 font-medium"},Ve={class:"text-[15px] text-dark/90 font-medium"},Oe={class:"text-[15px] text-dark/90 font-medium"},Be={class:"text-[15px] text-dark/90 font-medium"},Ee={class:"text-[15px] text-dark/90 font-medium"},Ne={class:"text-[15px] text-dark/90 font-medium"},Te={class:"text-[15px] text-dark/90 font-medium"},Ae={class:"text-[15px] text-dark/90 font-medium"},Pe={class:"text-[15px] text-dark/90 font-medium"},_e={class:"flex gap-5 items-center"},Ie={class:"font-medium text-sm text-gray-600"},Ue={key:0,class:"flex flex-col gap-4"},We={key:1,class:""},Ze={class:"mt-4 flex items-center justify-between"},ze={name:"Leads",components:{Pagination:B,LeadInfo:O,Statistics:E,LineChat:X,Filters:N,Main:T,TableLead:A},data(){return{pagesTable:!1,filter:v(!1),page:v(1),calendar_open:v(!1),calendar_date:v({name:"ÐаÑа",alltime:{name:"ÐаÑа"},week:{name:"Ðа неделÑ"},month:{name:"Ðа меÑÑÑ"},quarter:{name:"Ðа кваÑÑал"}}),leads:null,dates:null,sources:null,projects:null,meta:null,edit:null,opened:!1,filters:{source:null,from:null,to:null,project:null,payload_arr:null,utm_term:null,utm_medium:null,utm_source:null,utm_content:null,utm_campaign:null,responce_code:null,page:1},sendOne:{source:null,from:null,to:null,project:null}}},mounted(){this.load()},watch:{"filters.page"(s){this.load()}},methods:{getMeWeek(){const s=new Date,e=new Date(s);e.setDate(e.getDate()-7);function t(r){let g=r.getFullYear(),f=String(r.getMonth()+1).padStart(2,"0"),c=String(r.getDate()).padStart(2,"0");return`${g}-${f}-${c}`}return t(e)},getMeMonth(){const s=new Date,e=new Date(s);e.setDate(e.getDate()-30);function t(r){let g=r.getFullYear(),f=String(r.getMonth()+1).padStart(2,"0"),c=String(r.getDate()).padStart(2,"0");return`${g}-${f}-${c}`}return t(e)},getMeQuarter(){const s=new Date,e=new Date(s);e.setDate(e.getDate()-90);function t(r){let g=r.getFullYear(),f=String(r.getMonth()+1).padStart(2,"0"),c=String(r.getDate()).padStart(2,"0");return`${g}-${f}-${c}`}return t(e)},calendar_onclick(){this.calendar_open=!this.calendar_open},filterDeleted(){this.filters.deleted==null?(this.filters.deleted=!0,this.load()):(this.filters.deleted=!this.filters.deleted,this.load())},open_calendar(s){s=="week"?(this.filters.to=this.getMeWeek(),this.calendar_date.name=this.calendar_date.week.name):s=="alltime"?(this.filters.to=null,this.calendar_date.name="ÐаÑа"):s=="month"?(this.filters.to=this.getMeMonth(),this.calendar_date.name=this.calendar_date.month.name):s=="quarter"?(this.filters.to=this.getMeQuarter(),this.calendar_date.name=this.calendar_date.quarter.name):this.calendar_date.name="ÐаÑа",this.load()},restard(){this.filters={source:null,from:null,to:null,project:null,payload_arr:null,utm_term:null,utm_medium:null,utm_source:null,utm_content:null,utm_campaign:null,page:1},this.load()},toggleClickFilters(s){this.filters[s]=null,this.load(),this.open_calendar(
1)},filterLoad(){this.load()},filterOpen(){this.filter=!this.filter},pagesTableorAnalitycs(){this.pagesTable=!this.pagesTable},searchLoad(s){this.filters.payload_arr=s.target.value,api.get("/api/leads",{params:this.filters}).then(e=>{this.leads=e,this.sources=e.sources,this.meta=e.meta,this.projects=e.projects})},load(){api.get("/api/leads",{params:this.filters}).then(s=>{this.leads=s,this.meta=s.meta,this.sources=s.sources,this.projects=s.projects})},replayOne(s){api.get("/api/leads/replayone",{params:{replayone:s}}).then(e=>{}),this.load()},replay(){api.get("/api/leads/replay",{params:this.filters}).then(s=>{this.leads=s,this.meta=s.data.meta,this.sources=s.data.sources,this.projects=s.data.projects})},random(){let s={...this.filters,random:1};api.get("/api/leads",{params:s}).then(e=>{this.leads=e,this.leads.data[0].only=!0,this.meta=e.data.meta,this.sources=e.data.sources,this.projects=e.data.projects})},openLead(s,e=!1){e?this.opened=!0:this.edit=s},prjName(s){return this.projects[s]||s}},computed:{exportUrl(){let s=Object.fromEntries(Object.entries(this.filters).filter(([e,t])=>t!==null));return"/api/leads/export?"+new URLSearchParams(s).toString()}}},it=Object.assign(ze,{setup(s){return(e,t)=>(n(),o("div",ve,[i(T,null,{default:D(()=>[l("div",we,[l("div",xe,[l("div",Fe,[l("button",{class:"cursor-pointer rounded-md shadow-sm text-gray-400 bg-white px-4 py-3 text-[14px] flex gap-1 ring-1 ring-inset ring-gray-300 hover:text-white hover:bg-indigo-600",onClick:t[0]||(t[0]=(...r)=>e.restard&&e.restard(...r))},[i(d(ee),{class:"size-5"})]),l("a",{href:e.exportUrl,target:"_blank",class:"cursor-pointer rounded-md shadow-sm bg-white px-4 py-3 text-[14px] font-medium text-gray-400 flex gap-1 ring-1 ring-inset ring-gray-300 hover:text-white hover:bg-indigo-600"},[i(d(pe),{class:"size-5"}),t[19]||(t[19]=l("span",{class:""},"ÐагÑÑзиÑÑ",-1))],8,Ce),l("button",{class:"cursor-pointer bg-indigo-600 font-medium text-white hover:text-gray-400 rounded-lg shadow-sm px-4 py-3 text-[14px] flex gap-1 ring-1 ring-inset ring-gray-400 hover:bg-gray-50",onClick:t[1]||(t[1]=(...r)=>e.filterOpen&&e.filterOpen(...r))},[i(d(ce),{class:"size-5"}),l("span",je,p(e.$page.props.translations.messages.filter),1)])])]),l("div",$e,[e.leads&&e.leads&&e.leads.data.length?(n(),o("div",Le,[i(E,{leads:e.leads},null,8,["leads"])])):u("",!0)]),l("div",Se,[l("div",De,[e.filters.project?(n(),o("button",{key:0,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[2]||(t[2]=r=>e.toggleClickFilters("project"))},[l("span",Me,p(e.projects[e.filters.project]),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.source?(n(),o("button",{key:1,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[3]||(t[3]=r=>e.toggleClickFilters("source"))},[l("span",Ve,p(e.filters.source),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.utm_term?(n(),o("button",{key:2,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[4]||(t[4]=()=>e.toggleClickFilters("utm_term"))},[l("span",Oe,p(e.filters.utm_term),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.utm_medium?(n(),o("button",{key:3,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[5]||(t[5]=()=>e.toggleClickFilters("utm_medium"))},[l("span",Be,p(e.filters.utm_medium),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.utm_source?(n(),o("button",{key:4,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[6]||(t[6]=r=>e.toggleClickFilters("utm_source"))},[l("span",Ee,p(e.filters.utm_source),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.utm_content?(n(),o("button",{key:5,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[7]||(t[7]=r=>
1e.toggleClickFilters("utm_content"))},[l("span",Ne,p(e.filters.utm_content),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.utm_campaign?(n(),o("button",{key:6,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[8]||(t[8]=r=>e.toggleClickFilters("utm_campaign"))},[l("span",Te,p(e.filters.utm_campaign),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.to?(n(),o("button",{key:7,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[9]||(t[9]=r=>e.toggleClickFilters("to"))},[l("span",Ae,p(e.filters.to),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0),e.filters.from?(n(),o("button",{key:8,class:"bg-[#F0F4F8] px-4 py-1.5 justify-between rounded-2xl flex gap-1 items-center focus:ring-indigo-600 outline-none-border focus:ring-2",onClick:t[10]||(t[10]=r=>e.toggleClickFilters("from"))},[l("span",Pe,p(e.filters.from),1),i(d(m),{class:"h-4 w-4 text-dark/90"})])):u("",!0)]),l("div",_e,[l("span",Ie,p(e.$page.props.translations.messages.deleted),1),i(d(ge),{modelValue:e.filters.deleted,"onUpdate:modelValue":t[11]||(t[11]=r=>e.filters.deleted=r),onClick:e.filterDeleted,class:"group relative inline-flex h-5 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-full focus:outline-none"},{default:D(()=>[t[20]||(t[20]=l("span",{"aria-hidden":"true",class:"pointer-events-none absolute h-full w-full rounded-md bg-white"},null,-1)),l("span",{"aria-hidden":"true",class:M([e.filters.deleted?"bg-indigo-600":"bg-gray-200","pointer-events-none absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out"])},null,2),l("span",{"aria-hidden":"true",class:M([e.filters.deleted?"translate-x-5":"translate-x-0","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-full border border-gray-200 bg-white shadow ring-0 transition-transform duration-200 ease-in-out"])},null,2)]),_:1},8,["modelValue","onClick"]),l("button",{class:"outline-none border-2 rounded-md px-1.5 py-1 border-green-600",onClick:t[12]||(t[12]=(...r)=>e.replay&&e.replay(...r))},[i(d(fe),{class:"h-[22px] w-[22px] text-green-600"})])])]),e.leads?(n(),o("div",Ue,[(n(),F(A,{key:e.filters.page,leads:e.leads,filters:e.filters,opened:e.opened,searchLoad:e.searchLoad,replayOne:e.replayOne,openLead:e.openLead,prjName:e.prjName,restard:e.restard},null,8,["leads","filters","opened","searchLoad","replayOne","openLead","prjName","restard"]))])):(n(),o("div",We,[i(ke)])),l("div",Ze,[e.leads?(n(),F(B,{key:0,data:e.leads.meta,modelValue:e.filters.page,"onUpdate:modelValue":t[13]||(t[13]=r=>e.filters.page=r),filters:e.filters},null,8,["data","modelValue","filters"])):u("",!0)])])]),_:1}),e.edit?(n(),F(O,{key:0,lead:e.edit,onClose:t[14]||(t[14]=()=>e.edit=null),onFilterLoad:t[15]||(t[15]=()=>e.filterLoad()),filters:e.filters},null,8,["lead","filters"])):u("",!0),e.filter?(n(),F(N,{key:1,filters:e.filters,projects:e.projects,sources:e.sources,load:e.load,onClose:t[16]||(t[16]=()=>e.filter=!1),onFilterLoad:t[17]||(t[17]=()=>e.filterLoad()),onRestard:t[18]||(t[18]=()=>e.restard())},null,8,["filters","projects","sources","load"])):u("",!0)]))}});export{it 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.