(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[698420],{697656:e=>{e.exports=[{types:{UserBackgroundImageOnWeb:[2,{id:10,imageName:1,imageContent:1,imagePath:1,status:"VideoBackgroundImageState!",imageThumbnail:1,imageTimestamp:"BigInt"}]}},{types:{Query:[2,{allUserBackgroundsOnWeb:"[UserBackgroundImageOnWeb!]",userBackgroundByIdOnWeb:["UserBackgroundImageOnWeb",{imageId:10}]}],Mutation:[2,{uploadUserBackgroundOnWeb:["UserBackgroundImageOnWeb!",{imageName:1,imageURL:1,imageId:10,imageThumbnailURL:1,imageTimestamp:"BigInt"}],deleteUserBackgroundsOnWeb:[7,{imageIDs:26}]}]}}]},698361:(e,a,r)=>{"use strict";r.r(a),r.d(a,{resolvers:()=>n,typeDefs:()=>g});var g=r(697656);const t="userBackgroundOnWebWorkerResolver",n={Query:{async allUserBackgroundsOnWeb(e,a,{userUploadedBackgroundManager:r,loggerFactory:g}){const n=g.newLogger(t,"data-resolvers-user-background-on-web");try{const e=await r.getAllImages();return n.log(`Fetched all user backgrounds on web, count: ${e.length}`),e.map((e=>{const a=URL.createObjectURL(e.imageBlob),r=URL.createObjectURL(e.imageThumbnailBlob);return{id:e.imageId,status:"SUCCESS",imageName:e.imageName,imageContent:a,imageThumbnail:r,imagePath:a,imageTimestamp:e.imageTimestamp}}))}catch(e){return n.error("Error fetching all user backgrounds on web: ",e?.message),[]}},async userBackgroundByIdOnWeb(e,{imageId:a},{userUploadedBackgroundManager:r,loggerFactory:g}){const n=g.newLogger(t,"data-resolvers-user-background-on-web");try{const e=await r.getImageById(a);if(n.log(`Fetched user background by ID: ${a}, status: ${e?"SUCCESS":"FAIL"}`),!e)return{id:a,status:"FAIL"};const g=URL.createObjectURL(e.imageBlob),t=URL.createObjectURL(e.imageThumbnailBlob);return{id:e.imageId,imageName:e.imageName,imageContent:g,status:"SUCCESS",imageThumbnail:t,imagePath:g,imageTimestamp:e.imageTimestamp}}catch(e){return n.error(`Error fetching user background by ID: ${a}, error message: ${e?.message}`),{id:a,status:"FAIL"}}}},Mutation:{async uploadUserBackgroundOnWeb(e,{imageId:a,imageName:r,imageURL:g,imageThumbnailURL:n,imageTimestamp:s},{userUploadedBackgroundManager:m,loggerFactory:o}){const i=o.newLogger(t,"data-resolvers-user-background-on-web");try{const e=await fetch(g).then((e=>e.blob())),t=await fetch(n).then((e=>e.blob()));return await m.addImage({imageId:a,imageName:r,imageBlob:e,imageThumbnailBlob:t,imageTimestamp:s}),i.log(`Uploaded user background, imageId: ${a}, imageName: ${r}`),{id:a,imageName:r,imageTimestamp:s,imageContent:g,status:"SUCCESS",imageThumbnail:n,imagePath:g}}catch(e){return i.error("Error uploading user background: ",e?.message),{id:a,status:"FAIL"}}},async deleteUserBackgroundsOnWeb(e,{imageIDs:a},{userUploadedBackgroundManager:r,loggerFactory:g}){const n=g.newLogger(t,"data-resolvers-user-background-on-web");try{return await r.removeImage(a),n.log(`Deleted user backgrounds, imageIDs: ${a.join(", ")}`),!0}catch(e){return n.error("Error deleting user backgrounds: ",e?.message),!1}}}}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/r_data-resolvers-user-background-on-web-981decf3f16e982d.js.map