PageSourceSearch

https://gazprom.kg/assets/UploadPhotoModal-CTY5wWLH.js

js gazprom.kg collected 2026-10-07 03:01:21 UTC 3,510 bytes, 1 lines download raw bytes

1import{T as u,J as h,U as w,A as U,N as v,L as b,_ as y,c as r,o as s,b as a,v as d,u as n,z as k,x as C,d as p,w as f,O as _}from"./index-ae80RWzP.js";const M={name:"UploadPhoto",components:{BaseButton:b,BaseLoader:v},data(){return{file:[],loading:!1,errorMsg:"",loadingDelete:!1,previewUrl:""}},computed:{...U(h,["image","token"])},methods:{...u(w,["close"]),...u(h,["fetchUserProfile","updatePhoto","fetchPhoto"]),async handlePhotoUpload(){if(this.file.length===0){this.errorMsg="Вы не выбрали фото";return}try{this.loading=!0;const e=new FormData;e.append("image",this.file[0]);const{data:o}=await this.$axiosApi.post("gazprom-app/user/photo",e,{headers:{"Content-Type":"multipart/form-data"}});if(o){const i=o.imageFileName;this.updatePhoto(i),this.close(),await this.fetchUserProfile(),this.$route.path!=="/profile"&&await this.fetchPhoto()}}catch(e){console.log(e),this.errorMsg=e.response.data.message||"Ошибка при загрузке фотографии.",this.loading=!1}this.loading=!1},async deletePhotoHandler(){try{this.loadingDelete=!0;const{data:e}=await this.$axiosApi.delete("gazprom-app/user/photo");if(e){const o=h();o.image=void 0,o.imageName=void 0,this.close(),await this.fetchUserProfile()}}catch(e){console.log(e),this.errorMsg=e.response.data.message||"Ошибка при удалении фотографии."}finally{this.loadingDelete=!1}},validateFile(e){var i;const o=e.target;if(((i=o.files)==null?void 0:i.length)===1){this.file=[o.files[0]];const c=new FileReader;c.onload=t=>{var l;this.previewUrl=(l=t.target)==null?void 0:l.result},c.readAsDataURL(this.file[0])}else this.file=[],this.previewUrl="",this.errorMsg="Вы можете загрузить только одно изображение"},clearError(){this.errorMsg=""}}},F={class:"upload-modal"},B={class:"form"},D={class:"modal-header"},A={key:0,class:"title"},N={key:1,class:"title"},x={class:"modal-body"},S={key:0,class:"error-msg"},z={class:"custom-file-input"},L={key:1,class:"image-preview"},E=["src","alt"],V={class:"modal-footer"};function H(e,o,i,c,t,l){const m=v,g=b;return s(),r("div",F,[a("form",B,[a("div",D,[e.image?(s(),r("div",N,d(e.$t("modals.uploadPhoto.replace")),1)):(s(),r("div",A,d(e.$t("modals.uploadPhoto.title")),1))]),a("div",x,[t.errorMsg?(s(),r("span",S,d(t.errorMsg),1)):n("",!0),a("div",z,[a("input",{type:"file",id:"fileUpload",onChange:o[0]||(o[0]=(...P)=>l.validateFile&&l.validateFile(...P)),accept:"image/jpeg,image/png"},null,32),a("label",{for:"fileUpload",class:k(["fileUpload",{error:t.errorMsg}])},d(e.$t("modals.uploadPhoto.inputs.selectFile")),3)]),t.previewUrl?(s(),r("div",L,[a("img",{src:t.previewUrl,alt:e.$t("modals.uploadPhoto.inputs.selectFilePreview")},null,8,E)])):n("",!0)]),a("div",V,[C(g,{onClick:_(l.handlePhotoUpload,["prevent"]),"disabled-btn":t.loading,text:t.loading?"":e.$t("modals.uploadPhoto.buttons.submit"),bgColor:"#1852E0",class:"btn-primary"},{btnContent:f(()=>[t.loading?(s(),p(m,{key:0,loaderWidth:"10px",color:"white"})):n("",!0)]),_:1},8,["onClick","disabled-btn","text"]),e.image?(s(),p(g,{key:0,onClick:_(l.deletePhotoHandler,["prevent"]),"disabled-btn":t.loadingDelete,text:t.loadingDelete?"":e.$t("modals.uploadPhoto.buttons.delete"),bgColor:"#FF5A5F",class:"btn-secondary"},{btnContent:f(()=>[t.loadingDelete?(s(),p(m,{key:0,loaderWidth:"10px",color:"white"})):n("",!0)]),_:1},8,["onClick","disabled-btn","text"])):n("",!0)])])])}const T=y(M,[["render",H],["__scopeId","data-v-693bd210"]]);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.