1 line
6.7 KiB
JavaScript
1 line
6.7 KiB
JavaScript
|
"use strict";exports.id=1614,exports.ids=[1614],exports.modules={30671:(e,a)=>{Object.defineProperty(a,"M",{enumerable:!0,get:function(){return function e(a,t){return t in a?a[t]:"then"in a&&"function"==typeof a.then?a.then(a=>e(a,t)):"function"==typeof a&&"default"===t?a:void 0}}})},77826:(e,a,t)=>{t.d(a,{A:()=>r});var l=t(8732),n=t(82015),i=t.n(n),c=t(79100);function r({user:e,userImage:a,setUserImage:t,database:n,className:r}){let d=i().useRef();return(0,l.jsxs)("div",{className:"card no-hover col"+(r?" "+r:""),children:[(0,l.jsx)("div",{className:"bg-white rounded-full overflow-hidden w-24 h-24",children:(0,l.jsx)("img",{src:a?"string"==typeof a?a:a.imageBase64Full:"/images/user-preset.png",alt:"Database Image",width:100,className:"w-full h-full object-cover",ref:d,"data-imagepreview":"image"})}),(0,l.jsxs)("div",{className:"w-full flex-col image-selector-wrapper",children:[(0,l.jsx)("div",{className:"button outlined secondary w-full whitespace-normal",onClick:e=>{e.target.closest(".image-selector-wrapper").querySelector("input").click()},children:"Upload Image"}),(0,l.jsx)("input",{type:"file",accept:".png,.jpg,.jpeg,.webp",placeholder:"Choose Database Image",className:"hidden",onChange:async e=>{t(await (0,c.A)({imageInputFile:e.target.files[0],maxWidth:400}))}})]})]})}t(55158)},55158:(e,a,t)=>{t.d(a,{Ay:()=>r,PB:()=>d,fs:()=>s});var l=t(8732),n=t(58150),i=t(82015),c=t.n(i);function r({children:e,title:a,data:t,fullPage:i,wrapperClasses:r,closePopupDispatch:d,wrapperStyle:o,noContainer:p}){return i?(0,l.jsxs)("div",{className:"popup-bg overflow-hidden "+(r||""),"data-popupid":a||null,style:o,children:[p?(0,l.jsx)(c().Fragment,{children:e}):(0,l.jsx)("div",{className:"relative w-full h-full z-50","data-data":t?JSON.stringify(t):"",children:e}),(0,l.jsx)("button",{className:"popup-cancel-button fixed outlined gray",onClick:e=>{s(),d&&d()},children:(0,l.jsx)(n.A,{color:"white",size:20})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{s(),d&&d()}})]}):(0,l.jsxs)("div",{className:"popup-bg","data-popupid":a||null,children:[p?(0,l.jsx)(c().Fragment,{children:e}):(0,l.jsxs)("div",{className:"popup-content-container minimal-scrollbars","data-data":t?JSON.stringify(t):"",children:[e,(0,l.jsx)("button",{className:"outlined gray popup-cancel-button",onClick:e=>{s(),d&&d()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})})]}),p&&(0,l.jsx)("button",{className:"gray popup-cancel-button",onClick:e=>{s(),d&&d()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{s(),d&&d()}})]})}function d(e,a){let t=document.querySelector(`[data-popupid='${e}']`);t&&(t.style.display="flex",a&&a(t))}function s(e){document.querySelectorAll("[data-popupid]").forEach(e=>{e.style.display="none"}),e&&e()}},79100:(e,a,t)=>{t.d(a,{A:()=>l});async function l({imageInputFile:e,maxWidth:a}){let t,l,n=document.querySelector("[data-imagepreview='image']"),i=e.name.replace(/\..*/,""),c=document.createElement("canvas"),r=e.type,d=a||null,s=URL.createObjectURL(e),o=new Image;return o.src=s,t=await new Promise((e,a)=>{o.onerror=function(){URL.revokeObjectURL(this.src),console.log("Cannot load image")},o.onload=function(){if(URL.revokeObjectURL(this.src),d){let e=d/o.naturalWidth;c.width=o.naturalWidth<d?o.naturalWidth:d,c.height=o.naturalWidth<d?o.naturalHeight:o.naturalHeight*e}else c.width=o.naturalWidth,c.height=o.naturalHeight;let a=c.getContext("2d");a?.drawImage(o,0,0,c.width,c.height);let t=c.toDataURL(r,.95);n&&document.querySelectorAll("[data-imagepreview='image']").forEach(e=>{e.src=t}),e(t)}}),l=await new Promise((e,a)=>{c.toBlob(a=>{e(a?.size)},r,.95)}),{imageBase64:t.replace(/.*?base64,/,""),imageBase64Full:t,imageName:i,imageSize:l}}},23293:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(82544).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},92441:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(82544).A)("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["path"
|