1import{_ as z}from"./D31hZUl6.js";import{aG as V,aZ as E,aI as n,aJ as d,aX as b,aP as m,aK as a,aL as s,aM as h,aS as u,a_ as y,a$ as w,aN as _,aQ as c,aT as I,b4 as M,aR as x,b2 as O,aO as f,b3 as L}from"./Duq0Yqab.js";import{P as N}from"./BBZpJyqX.js";import{T as j}from"./b6yWvfrj.js";import{S as R}from"./8_WIQb_j.js";import{A as H}from"./CAyhup6h.js";import{s as G}from"./BqExOCGq.js";import{D as K}from"./Dqgcihh-.js";import"./1GubcYVz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"bb082cde4d1a2072e36f45763ce4b2e1c8ea0cc5"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6da592d7-1a25-4e52-b8db-62dbaa005304",e._sentryDebugIdIdentifier="sentry-dbid-6da592d7-1a25-4e52-b8db-62dbaa005304")})()}catch{}const B={setup(){const e=I(),t=M("export_feed",{maxAge:300,path:"/",domain:".ria.com"});return{nuxtApp:e,exportCookie:t}},name:"feeds",components:{Multiselect:G,AlertMessage:H,TabsNav:j,Popup:N,Loader:E,Select:R,DatePicker:K},data(){var e=["file_id","created_at","file_name","rubric_name_uk","status_id","format_file","end_at","actions"],t=this.$store?.state.main.host?.includes("zapchasti");return{is_zapchasti:t,params:{type_id:1,status_id:"1,2",format_file:1,rubric_id:0,upload_time:"",deleted_date:""},langId:this.$i18n.locale==="uk"?4:2,statusArr:[],loader:0,categoryOptions:[{value:0,name:this.$t("notifications.All")}],filesAll:[],files:[],userId:this.$store.state.auth.user_id||0,columns:e,columnsFile:e,columnsLink:["file_id","created_at","end_at","file_name","rubric_name_uk","upload_day_str","upload_time_str","actions"],showModal:0,updatePeriods:[{value:1,name:this.$t("import.Every day")},{value:2,name:this.$t("import.On certain days of the week")}],daysOfWeek:[{id:101,name:"ÐÐ"},{id:102,name:"ÐТ"},{id:103,name:"СР"},{id:104,name:"ЧТ"},{id:105,name:"ÐТ"},{id:106,name:"СÐ"},{id:107,name:this.langId==4?"ÐÐ":"ÐС"}],selectedUploadDays:[],selectedUploadHours:[],selectedUpdatePeriod:1,selectedTimeToUpload:-1,initialDate:new Date,rowsPerPage:20,rowsPerPageOptions:[10,20,30,50,100]}},async created(){this.setTypeId(),await this.fetchFinalRubrics()},computed:{locale(){return this.$i18n.locale},isDisabled(){return Number(this.exportCookie)},exportTabs(){return[{key:1,label:this.$t("export.Export Files")},{key:2,label:this.$t("export.Export Links")}]},updateHours(){let e=[];for(let t=8;t<=18;t++){let p=t<10?`0${t}`:`${t}`;e.push({value:t,name:`${p}:00`})}return e},tableColumns(){const e=this.params.type_id==2,t=[{prop:"file_id",label:"ID",width:50,sortable:!1},{prop:"created_at",label:[this.$t("export.Date"),this.$t("export.creation")].join(" "),width:100,sortable:!0},{prop:"file_name",label:this.$t("export.The name of the file"),width:180,sortable:!1},{prop:"rubric_name_uk",label:this.$t("export.Heading"),width:110,sortable:!1},{prop:"status_id",label:this.$t("export.Status"),width:"auto",sortable:!0},{prop:"format_file",label:this.$t("export.File type"),width:"auto",sortable:!0},{prop:"end_at",label:[this.$t("export.Date"),this.$t("export.update")].join(" "),width:100,sortable:!0},{prop:"actions",label:this.$t("export.Actions"),width:140,sortable:!1}],p=[{prop:"file_id",label:"ID",width:50,sortable:!1},{prop:"created_at",label:[this.$t("export.Date"),this.$t("export.creation")].join(" "),width:"auto",sortable:!0},{prop:"end_at",label:[this.$t("export.Date"),this.$t("export.update")].join(" "),width:"auto",sortable:!0},{prop:"file_name",label:this.$t("export.The name of the file"),width:"auto",sortable:!1},{prop:"rubric_name_uk",label:this.$t("export.Heading"),width:"auto",sortable:!1},{prop:"upload_day_str",label:[this.$t("export.Date"),this.$t("export.generations")].join(" "),width:"auto",sortable:!1},{prop:"upload_time_str",label:[this.$t("export.Time"),this.$t("export.generations")].join(" "),width:"auto",sortable:!1},{prop:"actions",label:this.$t("export.Actions"),width:180,sortable:!1}];return e?p:t}},methods:{selectedUpdatePeriodChange(e){this.selectedUpdatePeriod=Number(e)||1},clearSelection(){this.selectedTimeToUpload=-1},async setTypeId(e){e&&(this.params.type_id=e),await this.getFiles()},async fetchFinalRubrics(){const{data:e}=await this.$axios.get(`user/rubricAdvUser/?user_id=${this.$store.state.auth.user_id||0}&langId=${this.langId}&status_id=${this.params.status_id}`);e&&e.agg_rubric_id&&(this.categoryOptions=e.agg_rubric_id.filter(t=>t.doc_count>0).map(t=>({value:t.rubric_id,name:t.name})),this.is_zapchasti?(this.categoryOptions.unshift({value:1,name:this.$t("notifications.All")+" "+this.$t("bar.Goods")}),this.categoryOptions.unshift({value:29,name:this.$t("notifications.All")+" "+this.$t("header.Car Parts")}),this.params.rubric_id=29):(this.categoryOptions.unshift({value:29,name:this.$t("notifications.All")+" "+this.$t("header.Car Parts")}),this.categoryOptions.unshift({value:1,name:this.$t("notifications.All")+" "+this.$t("bar.Goods")}),this.params.rubric_id=1))},handleChangeStatus(e){this.params.status_id=e,this.fetchFinalRubrics()},handleChangeStatusFormat(e){this.params.format_file=e},handleChangeRubric(e){this.params.rubric_id=e},async getFiles(){var{data:e}=await this.$axios.get(`psp/files/getAllExportFeedsUser/?langId=${this.langId}`);e&&(this.filesAll=e.files||[]),this.setFilesFilter()},setFilesFilter(){this.files=[...this.filesAll.filter(e=>e.type_id==this.params.type_id)]},async exportFeed(){this.loader=1;try{console.log(this.params);var e=await this.createUserExportFeed(this.params);this.exportCookie="1",await this.getFiles(),this.loader=0}catch(t){console.log(t)}},async deleteFile(e){this.filesAll=this.filesAll.filter(p=>p.file_id!==e),this.setFilesFilter();var{data:t}=await this.$axios.post("psp/files/removeExportFeedUser/",{file_id:e});t&&t.result&&await this.getFiles()},async reloadFile(e){var t={file_id:e.file_id},p=await this.createUserExportFeed(t);p&&p.result&&await this.getFiles()},async createUserExportFeed(e){var{data:t}=await this.$axios.get("psp/files/createUserExportFeed/",{params:e});return t},copyLink(e){navigator.clipboard.writeText(`https://${this.is_zapchasti?"zapchasti":"www"}.ria.com/uk/xml/export_link/${e.file_name}`)}
1,openPopupClick(e){this.editItem=e,this.selectedUploadDays=e.upload_day_arr,this.selectedUpdatePeriod=e.upload_day_arr.length?2:1,this.selectedUploadHours=e.upload_time_arr.map(t=>{let p=t<10?`0${t}`:`${t}`;return{value:t,name:`${p}:00`}}),this.showModal=1,this.nuxtApp.$utils.openModalFixed()},closeModal(){this.showModal=0,this.nuxtApp.$utils.closeModalFixed()},updateSelected(e){this.selectedUploadHours=e||[]},async saveSelectedPopup(){var e=[this.selectedUploadHours.map(k=>k.value)].join(","),t=this.selectedUploadDays.join(",");this.selectedUpdatePeriod==1&&(t="");var p={file_id:this.editItem.file_id,upload_time:e,upload_day:t};await this.createUserExportFeed(p),await this.getFiles(),this.closeModal()},fileUrl(e){return`https://${this.is_zapchasti?"zapchasti":"www"}.ria.com/uk/xml/export${e.type_id==2?"_link":""}/${e.file_name}`},openChildCalendar(){this.$refs.childComponentDate.openCalendar()},async handleDateChange(e){this.params.deleted_date=e},async clearDate(){this.params.deleted_date=""}}},W={class:"structure-row ai-center jc-between gap-10 mb-16 lh1_3 p-15-20"},J={class:"display-if size18-24 bold mb-0"},Q={class:"account-tabs light-box mb12"},X={class:"export-section"},Y={class:"light-box mb20"},Z={class:"structure-col-row structure-col-row-large ai-center jc-between gap-10"},q={class:"w-full"},ee={class:"size13 text-light shrink-0 ellipsis-1 mb-8 lh1_2"},te={class:"w-full"},ae={class:"size13 text-light shrink-0 ellipsis-1 mb-8 lh1_2"},se={class:"mp-search__date w-full shrink-0 relative"},ie=["value"],le={class:"w-full"},oe={class:"size13 text-light shrink-0 ellipsis-1 mb-8 lh1_2"},re={class:"w-full"},de={class:"size13 text-light shrink-0 ellipsis-1 mb-8 lh1_2"},ne={class:"mb-0"},pe={class:"light-box mb20"},ue={class:"table-area"},he={key:0,class:"file-name-break"},ce=["href"],_e={key:1,class:"file-name"},me={key:2,class:"file-name"},fe={key:3,class:"file-name"},be={key:0},ye={key:2,class:"common-badge small"},ge={class:"break-all"},ve=["onClick"],we={class:"break-all"},ke=["onClick"],xe={key:5,class:"structure-col gap-10"},Ce=["href"],$e=["onClick"],Fe=["onClick"],De=["onClick"],Ue={class:"form-section"},Pe={class:"relative mt-16"},Ae={class:"size13 text-light shrink-0 ellipsis-1 mb-8 lh1_2"},Te={class:"structure-col gap-8 w-full"},Se={class:"relative mt-16"},ze={class:"size13 text-light shrink-0 ellipsis-1 mb-8 lh1_2"},Ve={class:"structure-row flex-wrap gap-10"},Ee=["id","value"],Ie=["for"],Me={class:"relative mt-16 pb-32"},Oe={class:"size13 text-light shrink-0 ellipsis-1 mb-8 lh1_2"},Le={class:"structure-row flex-wrap gap-10"},Ne={slot:"noResult"},je={slot:"singleLabel","slot-scope":"{option }"},Re={key:0},He={slot:"maxElements","slot-scope":"{max}"},Ge={class:"structure-row flex-wrap ai-center jc-center gap-16 mt-20"},Ke=["value"],Be=["value"];function We(e,t,p,k,o,r){const C=u("loader"),$=u("TabsNav"),g=u("Select"),F=z,D=u("DatePicker"),U=u("AlertMessage"),P=u("Column"),A=u("DataTable"),T=u("Multiselect"),S=u("Popup");return d(),n(c,null,[o.loader?(d(),b(C,{key:0})):m("",!0),a("div",W,[a("h1",J,s(e.$t("export.Export ads")),1)]),a("div",Q,[h($,{tabs:r.exportTabs,keyField:"key",labelField:"label",activeKey:o.params.type_id,"onUpdate:activeKey":t[0]||(t[0]=i=>o.params.type_id=i),onChange:r.setTypeId},null,8,["tabs","activeKey","onChange"])]),a("section",X,[a("div",Y,[a("div",Z,[y(a("div",q,[a("span",ee,s(this.$t("statistic.Adv")),1),h(g,{values:[{value:"1,2",name:this.$t("left_panel.Active")},{value:"5",name:this.$t("left_panel.Archive")}],modelValue:o.params.status_id,"onUpdate:modelValue":r.handleChangeStatus},null,8,["values","modelValue","onUpdate:modelValue"])],512),[[w,o.params.type_id!=2]]),y(a("div",te,[a("span",ae,s(this.$t("adv.Deletion date")),1),a("div",se,[a("input",{type:"text",name:"date",placeholder:"ÐаÑа",value:o.params.deleted_date,readonly:"",class:"w-full"},null,8,ie),a("span",{class:"open_calendar size20",onClick:t[1]||(t[1]=(...i)=>r.openChildCalendar&&r.openChildCalendar(...i))},[h(F,{icon:"common-i24-calendar"})]),o.params.deleted_date?(d(),n("span",{key:0,class:"clear-input display-f jc-center ai-center size18 round-full lh1",onClick:t[2]||(t[2]=(...i)=>r.clearDate&&r.clearDate(...i))})):m("",!0),h(D,{ref:"childComponentDate",initialDate:o.initialDate,onDateChanged:r.handleDateChange,mode:"single"},null,8,["initialDate","onDateChanged"])])],512),[[w,o.params.status_id==5]]),a("div",le,[a("span",oe,s(this.$t("bar.Category")),1),h(g,{values:o.categoryOptions,modelValue:o.params.rubric_id,"onUpdate:modelValue":r.handleChangeRubric},null,8,["values","modelValue","onUpdate:modelValue"])]),y(a("div",re,[a("span",de,s(this.$t("export.File type")),1),h(g,{values:[{value:1,name:"exel"},{value:2,name:"xml"}],modelValue:o.params.format_file,"onUpdate:modelValue":r.handleChangeStatusFormat},null,8,["modelValue","onUpdate:modelValue"])],512),[[w,o.params.type_id!=2]]),a("button",{id:"generate_file",class:"button w-content _blue size16 mtAuto",onClick:t[3]||(t[3]=(...i)=>r.exportFeed&&r.exportFeed(...i))},s(e.$t(o.params.type_id==2?"export.Generate link":"export.Generate file")),1)])]),r.isDisabled?(d(),b(U,{key:0,t
1ype:"info","show-button-close":!1},{default:_(()=>[a("p",ne,s(e.$t("export.The file is generated, it can take from 2 to 10 minutes")),1)]),_:1})):m("",!0),a("div",pe,[a("div",ue,[(d(),b(A,{key:o.params.type_id,value:o.files,dataKey:"file_id",sortOrder:-1,paginator:o.files.length>o.rowsPerPage,rows:o.rowsPerPage,rowsPerPageOptions:o.rowsPerPageOptions},{empty:_(()=>[f(s(e.$t("add.Nothing found")),1)]),default:_(()=>[(d(!0),n(c,null,x(r.tableColumns,i=>(d(),b(P,{key:i.prop,field:i.prop,header:i.label,sortable:i.sortable,headerStyle:i.width&&i.width!=="auto"?{width:i.width+"px"}:void 0,bodyStyle:i.width&&i.width!=="auto"?{width:i.width+"px"}:void 0},{body:_(l=>[i.prop==="file_name"?(d(),n(c,{key:0},[l.data.file_name&&l.data.exist_file&&l.data.end_at?(d(),n("div",he,[a("a",{download:"",href:`https://${o.is_zapchasti?"zapchasti":"www"}.ria.com/uk/xml/export${l.data.type_id==2?"_link":""}/${l.data.file_name}`,target:"_blank",class:"file-name-link"},s(l.data.file_name),9,ce)])):!l.data.file_name&&!l.data.end_at||!l.data.start_at?(d(),n("div",_e,s(e.$t("export.The file is generated, it can take from 2 to 10 minutes")),1)):l.data.file_name&&!l.data.exist_file&&l.data.end_at?(d(),n("div",me,s(e.$t("export.File generation error"))+" "+s(e.$t("export.File not generated")),1)):(d(),n("div",fe,s(e.$t("export.File not generated")),1))],64)):i.prop==="status_id"?(d(),n(c,{key:1},[a("div",{class:O(["common-badge small",l.data.status_id=="1,2"?"_green":"_orange"])},s(l.data.status_id=="1,2"?e.$t("left_panel.Active"):e.$t("left_panel.Archive")),3),l.data.status_id==5&&l.data.deleted_date!=""?(d(),n("div",be,s(l.data.deleted_date),1)):m("",!0)],64)):i.prop==="format_file"?(d(),n("div",ye,s(l.data.format_file==1?"excel":"xml"),1)):i.prop==="upload_day_str"?(d(),n(c,{key:3},[a("div",ge,s(l.data.upload_day_str),1),a("a",{class:"link display-if mt-6",onClick:v=>r.openPopupClick(l.data)},s(e.$t("adv.Edit")),9,ve)],64)):i.prop==="upload_time_str"?(d(),n(c,{key:4},[a("div",we,s(l.data.upload_time_str),1),a("a",{class:"link display-if mt-6",onClick:v=>r.openPopupClick(l.data)},s(e.$t("adv.Edit")),9,ke)],64)):i.prop==="actions"?(d(),n("div",xe,[l.data.type_id==1?(d(),n("a",{key:0,href:r.fileUrl(l.data),download:"",class:"button h-small _transparent green",target:"_blank"},s(e.$t("export.Download")),9,Ce)):(d(),n("a",{key:1,onClick:v=>r.copyLink(l.data),class:"button h-small _transparent green"},s(e.$t("export.Copied link")),9,$e)),a("button",{class:"button h-small _transparent red",onClick:v=>r.deleteFile(l.data.file_id)},s(e.$t("adv.Delete")),9,Fe),a("button",{class:"button h-small _transparent blue",onClick:v=>r.reloadFile(l.data)},s(e.$t("import.Reload file")),9,De)])):(d(),n(c,{key:6},[f(s(l.data[i.prop]),1)],64))]),_:2},1032,["field","header","sortable","headerStyle","bodyStyle"]))),128))]),_:1},8,["value","paginator","rows","rowsPerPageOptions"]))])])]),o.showModal?(d(),b(S,{key:1,onClose:r.closeModal,customClass:"large"},{"popup-header":_(()=>[f(s(e.$t("import.Edit file")),1)]),"popup-content":_(()=>[a("form",Ue,[a("div",Pe,[a("div",Ae,s(e.$t("import.Loading period")),1),a("div",Te,[h(g,{"default-option-text":e.$t("import.Choose value"),values:o.updatePeriods,selected:o.selectedUpdatePeriod,"onUpdate:modelValue":r.selectedUpdatePeriodChange},null,8,["default-option-text","values","selected","onUpdate:modelValue"])])]),y(a("div",Se,[a("div",ze,s(e.$t("import.Loading days")),1),a("div",Ve,[(d(!0),n(c,null,x(o.daysOfWeek,i=>(d(),n("div",{class:"display-if ai-center gap-6",key:i.id},[y(a("input",{type:"checkbox",id:"upload_month_day_"+i.id,value:i.id,name:"upload_day[]","onUpdate:modelValue":t[4]||(t[4]=l=>o.selectedUploadDays=l)},null,8,Ee),[[L,o.selectedUploadDays]]),a("label",{for:"upload_month_day_"+i.id},s(i.name),9,Ie)]))),128))])],512),[[w,o.selectedUpdatePeriod==2]]),a("div",Me,[a("div",Oe,s(e.$t("import.Loading time")),1),a("div",Le,[h(T,{modelValue:o.selectedUploadHours,options:r.updateHours,multiple:!0,"track-by":"value","close-on-select":!1,"clear-on-select":!1,searchable:!0,"allow-empty":!0,placeholder:"Ðе обÑано",label:"name","max-height":80,optionsLimit:200,max:2,class:"w-full","onUpdate:modelValue":r.updateSelected},{default:_(()=>[a("template",Ne,[f(s(e.$t("add.Nothing found")),1)]),a("template",je,[f(s(e.option.name)+" ",1),e.option.value?(d(),n("span",Re,"("+s(e.option.value)+")",1)):m("",!0)]),a("template",He,[f(s(e.$t("export.Maximum selected"))+" "+s(e.max)+" "+s(e.$t("export.options selected"))+". "+s(e.$t("export.First remove a selected option to select another")),1)])]),_:1},8,["modelValue","options","onUpdate:modelValue"])])]),a("div",Ge,[a("input",{type:"button",onClick:t[5]||(t[5]=(...i)=>r.saveSelectedPopup&&r.saveSelectedPopup(...i)),class:"button w-small size16",value:e.$t("adv.Save")},null,8,Ke),a("input",{type:"button",class:"button _transparent w-small size16",onClick:t[6]||(t[6]=(...i)=>r.closeModal&&r.closeModal(...i)),value:e.$t("adv.Cancel")},null,8,Be)])])]),_:1},8,["onClose"])):m("",!0)],64)}const st=V(B,[["render",We]]);export{st 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.