handy-uploader 1.1.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +389 -30
- package/dist/favicon.ico +0 -0
- package/dist/handy-uploader.es.js +2407 -0
- package/dist/handy-uploader.umd.js +1 -0
- package/package.json +58 -56
- package/.eslintrc.js +0 -14
- package/LICENSE +0 -21
- package/babel.config.js +0 -3
- package/dist/demo.html +0 -10
- package/dist/handyUploader.common.js +0 -30712
- package/dist/handyUploader.common.js.map +0 -1
- package/dist/handyUploader.css +0 -5
- package/dist/handyUploader.umd.js +0 -30722
- package/dist/handyUploader.umd.js.map +0 -1
- package/dist/handyUploader.umd.min.js +0 -11
- package/dist/handyUploader.umd.min.js.map +0 -1
- package/package-lock.json +0 -11831
- package/src/App.vue +0 -69
- package/src/components/InsertButton.vue +0 -61
- package/src/components/SelectFileIconType.vue +0 -103
- package/src/components/SimpleUploader.vue +0 -401
- package/src/components/TableUploader.vue +0 -350
- package/src/components/ThumbnailUploader.vue +0 -371
- package/src/components/handyUploader.vue +0 -883
- package/src/components/index.js +0 -10
- package/src/components/language.js +0 -148
- package/src/main.js +0 -10
- package/src/plugins/vuetify.js +0 -11
- package/vue.config.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(x,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(x=typeof globalThis<"u"?globalThis:x||self,e(x.HandyUploaderVue={},x.Vue))})(this,function(x,e){"use strict";const O=e.defineComponent({__name:"SelectFileIconType",props:{fileFormat:{},size:{default:30}},setup(a){const i=a,t=e.computed(()=>({pdf:{icon:"mdi-file-pdf-outline",color:"red darken-1"},doc:{icon:"mdi-file-word-outline",color:"blue darken-1"},docx:{icon:"mdi-file-word-outline",color:"blue darken-1"},odt:{icon:"mdi-file-word-outline",color:"blue darken-1"},jpg:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},jpeg:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},png:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},tif:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},bmp:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},xls:{icon:"mdi-file-excel-outline",color:"teal darken-1"},xlsx:{icon:"mdi-file-excel-outline",color:"teal darken-1"},ppt:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},pptx:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},pptm:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},mp4:{icon:"mdi-file-video-outline",color:"red lighten-1"},mov:{icon:"mdi-file-video-outline",color:"red lighten-1"},flv:{icon:"mdi-file-video-outline",color:"red lighten-1"},wmv:{icon:"mdi-file-video-outline",color:"red lighten-1"},avi:{icon:"mdi-file-video-outline",color:"red lighten-1"},dwg:{icon:"mdi-file-cad",color:"indigo lighten-2"},zip:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},rar:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},"7-zip":{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},txt:{icon:"mdi-script-text-outline",color:"light-green darken-3"}})[i.fileFormat]||{icon:"mdi-file-question-outline",color:"indigo lighten-1"});return(o,m)=>{const w=e.resolveComponent("v-icon");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(w,{size:i.size,color:t.value.color,textContent:e.toDisplayString(t.value.icon)},null,8,["size","color","textContent"])])}}});function G(a){const i=a/1024,t=i/1024;return t>=1?{text:`${t.toFixed(2)} MB`,color:t>10?"red":t>5?"orange":"green"}:{text:`${i.toFixed(2)} KB`,color:i>1e3?"orange":"green"}}function W(a,i){var o;const t=((o=a.split(".").pop())==null?void 0:o.toLowerCase())||"";return["jpg","jpeg","png","gif","bmp","svg","webp","tiff"].includes(t)||i!=null&&i.startsWith("image/")?"image":["pdf","doc","docx","txt","rtf","odt"].includes(t)?"document":["xls","xlsx","csv","ods"].includes(t)?"spreadsheet":["ppt","pptx","odp"].includes(t)?"presentation":["zip","rar","7z","tar","gz"].includes(t)?"archive":["mp4","avi","mov","wmv","flv","webm"].includes(t)?"video":["mp3","wav","flac","aac","ogg"].includes(t)?"audio":"file"}function oe(a,i){const t=W(a,i),o={image:{icon:"mdi-file-image",color:"blue"},document:{icon:"mdi-file-document",color:"red"},spreadsheet:{icon:"mdi-file-excel",color:"green"},presentation:{icon:"mdi-file-powerpoint",color:"orange"},archive:{icon:"mdi-folder-zip",color:"purple"},video:{icon:"mdi-file-video",color:"pink"},audio:{icon:"mdi-file-music",color:"teal"},file:{icon:"mdi-file",color:"grey"}};return o[t]||o.file}function Q(a,i){return W(a,i)==="image"}function le(a,i){return a<=i}function ne(a,i){return a<i}function v(a){var o;const i=((o=a.split(".").pop())==null?void 0:o.toLowerCase())||"";return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",mp4:"video/mp4",avi:"video/x-msvideo",mov:"video/quicktime",wmv:"video/x-ms-wmv",flv:"video/x-flv",webm:"video/webm",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",txt:"text/plain",csv:"text/csv",zip:"application/zip",rar:"application/x-rar-compressed"}[i]||"application/octet-stream"}function ie(a,i){const t=a.replace(/^data:image\/[a-zA-Z]+;base64,/,"");return`data:${i.startsWith("image/")?i:`image/${i}`};base64,${t}`}function ae(a,i=.8,t=1920,o=1080){return new Promise((m,w)=>{const V=document.createElement("canvas"),f=V.getContext("2d"),p=new Image;p.onload=()=>{let{width:u,height:h}=p;if(u>t||h>o){const y=Math.min(t/u,o/h);u*=y,h*=y}V.width=u,V.height=h,f==null||f.drawImage(p,0,0,u,h);const B=V.toDataURL("image/jpeg",i);m(B)},p.onerror=()=>w(new Error("Failed to load image for compression"));const F=new FileReader;F.onload=u=>{var h;p.src=(h=u.target)==null?void 0:h.result},F.onerror=()=>w(new Error("Failed to read file")),F.readAsDataURL(a)})}function ee(a){return new Promise((i,t)=>{const o=new FileReader;o.onload=()=>{const m=o.result,w=m.split(",")[1]||m;i(w)},o.onerror=()=>t(new Error("Failed to read file")),o.readAsDataURL(a)})}const de={key:1,style:{height:"200px","background-color":"#f5f5f5",position:"relative",overflow:"hidden",display:"flex","align-items":"center","justify-content":"center"}},ce=["src","onError"],me={key:1,style:{width:"100%",height:"100%",background:"#e0e0e0",display:"flex","align-items":"center","justify-content":"center"}},pe={class:"d-flex justify-center align-center",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.7)","border-radius":"50%",width:"60px",height:"60px",cursor:"pointer"}},fe={key:2,class:"d-flex justify-center align-center",style:{height:"200px","background-color":"#f5f5f5"}},ge={class:"BYekan"},ue={class:"BYekan"},he={key:0},Y=e.defineComponent({__name:"ThumbnailUploader",props:{lang:{default:"en"},documentAttachment:{},thumb:{type:Boolean,default:!0},cols:{default:4},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},selectedLang:{},cardType:{},outlined:{type:Boolean,default:!1},raised:{type:Boolean,default:!1},shaped:{type:Boolean,default:!1},tile:{type:Boolean,default:!1}},emits:["openDeleteDialog","openEditDocumentDialog"],setup(a,{emit:i}){const t=a,o=i,m=l=>{const n=W(l)==="video";return console.log("🎥 Checking if video file:",l,"result:",n,"fileType:",W(l)),n},w=l=>ie(l.base64,l.format),V=l=>{var n;console.error("Image failed to load:",{name:l.name,format:l.format,base64Length:((n=l.base64)==null?void 0:n.length)||0})},f=e.reactive(new Map),p=l=>(console.log("🎬 Starting video thumbnail generation for:",l.name),new Promise((n,d)=>{var P;const c=document.createElement("video"),C=document.createElement("canvas"),N=C.getContext("2d");if(!N){console.error("❌ Canvas context not available"),d(new Error("Canvas context not available"));return}c.crossOrigin="anonymous",c.preload="metadata",c.muted=!0,c.onloadedmetadata=()=>{if(console.log("📹 Video metadata loaded:",{duration:c.duration,width:c.videoWidth,height:c.videoHeight,readyState:c.readyState,networkState:c.networkState}),c.duration===0||isNaN(c.duration)){console.error("❌ Invalid video duration:",c.duration);const U=F(l);u.delete(U),d(new Error("Invalid video duration"));return}if(c.videoWidth===0||c.videoHeight===0){console.error("❌ Invalid video dimensions:",c.videoWidth,"x",c.videoHeight);const U=F(l);u.delete(U),d(new Error("Invalid video dimensions"));return}C.width=c.videoWidth,C.height=c.videoHeight;const T=Math.min(1,c.duration*.1);console.log("⏰ Seeking to time:",T,"of total duration:",c.duration),c.currentTime=T},c.onseeked=()=>{console.log("🎯 Video seeked successfully to:",c.currentTime);try{console.log("🖼️ Canvas setup:",{width:C.width,height:C.height,videoCurrentTime:c.currentTime,videoReadyState:c.readyState}),N.drawImage(c,0,0,C.width,C.height);const U=N.getImageData(0,0,C.width,C.height).data.some(M=>M!==0);console.log("🎨 Canvas content check:",U?"Has content":"Empty/transparent");const _=C.toDataURL("image/jpeg",.8);console.log("✅ Generated thumbnail:",{dataUrlLength:_.length,startsWithData:_.startsWith("data:image/jpeg"),preview:_.substring(0,50)+"..."}),n(_)}catch(T){console.error("❌ Error during thumbnail generation:",T),d(T)}},c.onabort=()=>{console.warn("⚠️ Video loading aborted"),d(new Error("Video loading aborted"))},c.onstalled=()=>{console.warn("⚠️ Video loading stalled")},c.onerror=T=>{console.error("❌ Video failed to load for thumbnail generation:",T),d(new Error("Video failed to load for thumbnail generation"))},c.onloadstart=()=>{console.log("🔄 Video load started")},c.oncanplay=()=>{console.log("▶️ Video can play")};const b=((P=l.base64)==null?void 0:P.replace(/^data:[^;]+;base64,/,""))||"";let D;l.format.startsWith("video/")?D=l.format:(D=v(l.name),D.startsWith("video/")||(D=`video/${l.format}`));const S=`data:${D};base64,${b}`;console.log("🔗 Setting video source:",{fileName:l.name,format:l.format,mimeType:D,base64Length:b.length,videoSrcLength:S.length}),c.src=S})),F=l=>{var n;return`${l.name}_${(n=l.base64)==null?void 0:n.substring(0,50)}`};e.computed(()=>(console.log("🔄 Video thumbnails computed updated:",Array.from(f.keys())),f));const u=new Set,h=l=>{const n=F(l);if(console.log("🔍 Getting video thumbnail for:",l.name,"cache key:",n),f.has(n))return console.log("💾 Returning cached thumbnail for:",l.name),f.get(n);if(u.has(n)){console.log("⏳ Thumbnail already being generated for:",l.name);return}console.log("🚀 No cached thumbnail, generating new one for:",l.name),u.add(n),p(l).then(d=>{console.log("✅ Thumbnail generated and cached for:",l.name),f.set(n,d),u.delete(n),e.nextTick(()=>{console.log("🔄 UI update triggered for:",l.name)})}).catch(d=>{console.error("❌ Failed to generate video thumbnail for:",l.name,d),u.delete(n)})},B=l=>{console.error("Video thumbnail failed to load:",{name:l.name,format:l.format});const n=F(l);f.delete(n)},y=l=>oe(l),z=l=>l.tags.length>0||!!l.description,L=l=>{l.showDetailState=!l.showDetailState},$=(l,n)=>{o("openDeleteDialog",l,n)},s=(l,n)=>{o("openEditDocumentDialog",l,n)},r=()=>{console.log("🎯 Generating thumbnails for videos, total attachments:",t.documentAttachment.length);const l=t.documentAttachment.filter(n=>m(n.file.name));console.log("📹 Found video attachments:",l.length,l.map(n=>n.file.name)),l.forEach(n=>{console.log("🎬 Processing video:",n.file.name),h(n.file)})};return e.watch(()=>t.documentAttachment,r,{immediate:!0}),e.onMounted(r),(l,n)=>{const d=e.resolveComponent("v-img"),c=e.resolveComponent("v-icon"),C=e.resolveComponent("v-card-subtitle"),N=e.resolveComponent("v-chip"),b=e.resolveComponent("v-divider"),D=e.resolveComponent("v-btn"),S=e.resolveComponent("v-tooltip"),P=e.resolveComponent("v-spacer"),T=e.resolveComponent("v-card-actions"),U=e.resolveComponent("v-chip-group"),_=e.resolveComponent("v-card-text"),M=e.resolveComponent("v-expand-transition"),I=e.resolveComponent("v-card"),H=e.resolveComponent("v-col"),q=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(q,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.documentAttachment,(k,R)=>(e.openBlock(),e.createBlock(H,{key:`attachment-${R}`,cols:"12",md:l.cols,xs:"12"},{default:e.withCtx(()=>[e.createVNode(I,{shaped:l.shaped,outlined:l.outlined,raised:l.raised,tile:l.tile,class:"mx-auto","max-width":"344"},{default:e.withCtx(()=>[e.unref(Q)(k.file.name)?(e.openBlock(),e.createBlock(d,{key:0,src:w(k.file),height:"200px",onError:E=>V(k.file)},null,8,["src","onError"])):m(k.file.name)?(e.openBlock(),e.createElementBlock("div",de,[h(k.file)?(e.openBlock(),e.createElementBlock("img",{key:0,src:h(k.file),style:{width:"100%",height:"100%","object-fit":"cover"},onError:E=>B(k.file)},null,40,ce)):(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(c,{size:"60",color:"grey"},{default:e.withCtx(()=>n[0]||(n[0]=[e.createTextVNode("mdi-video")])),_:1})])),e.createElementVNode("div",pe,[e.createVNode(c,{color:"white",size:"30"},{default:e.withCtx(()=>n[1]||(n[1]=[e.createTextVNode("mdi-play")])),_:1})])])):(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(c,{size:"120",color:y(k.file.name).color},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y(k.file.name).icon),1)]),_:2},1032,["color"])])),e.createVNode(C,{class:"text-truncate py-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.file.name),1)]),_:2},1024),e.createVNode(C,{class:"pt-2 pb-3"},{default:e.withCtx(()=>[e.createVNode(N,{color:e.unref(G)(k.file.size).color,label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(G)(k.file.size).text)+" ",1),e.createVNode(c,{right:""},{default:e.withCtx(()=>n[2]||(n[2]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1032,["color"])]),_:2},1024),e.createVNode(b,{class:"mx-4"}),e.createVNode(T,{style:{padding:"0"}},{default:e.withCtx(()=>[e.createVNode(S,{right:""},{activator:e.withCtx(({props:E})=>[l.deletePermission?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},E,{onClick:K=>$(R,"")}),{default:e.withCtx(()=>[e.createVNode(c,{color:"red"},{default:e.withCtx(()=>n[3]||(n[3]=[e.createTextVNode("mdi-trash-can-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ge,e.toDisplayString(l.selectedLang[l.lang].delete),1)]),_:2},1024),e.createVNode(S,{right:""},{activator:e.withCtx(({props:E})=>[l.editPermission?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},E,{onClick:K=>s(k,R)}),{default:e.withCtx(()=>[e.createVNode(c,{color:"green"},{default:e.withCtx(()=>n[4]||(n[4]=[e.createTextVNode("mdi-pencil-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ue,e.toDisplayString(l.selectedLang[l.lang].edit),1)]),_:2},1024),e.createVNode(P),z(k.file)?(e.openBlock(),e.createBlock(D,{key:0,icon:"",onClick:E=>L(k.file)},{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.file.showDetailState?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:2},1024)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(M,null,{default:e.withCtx(()=>[z(k.file)?e.withDirectives((e.openBlock(),e.createElementBlock("div",he,[e.createVNode(b),k.file.tags.length?(e.openBlock(),e.createBlock(U,{key:0,multiple:"","active-class":"primary--text",class:"pa-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.file.tags,(E,K)=>(e.openBlock(),e.createBlock(N,{key:`tag-${K}`,class:"ma-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E),1)]),_:2},1024))),128))]),_:2},1024)):e.createCommentVNode("",!0),k.file.description?(e.openBlock(),e.createBlock(_,{key:1,class:"text-justify"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.file.description),1)]),_:2},1024)):e.createCommentVNode("",!0)],512)),[[e.vShow,k.file.showDetailState]]):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1032,["shaped","outlined","raised","tile"])]),_:2},1032,["md"]))),128))]),_:1})])}}}),Ce={key:0,class:"text-left"},be={class:"text-left"},we={class:"text-left"},ke={class:"text-left"},xe={key:0},ye={class:"BYekan"},X=e.defineComponent({__name:"TableUploader",props:{documentAttachment:{},thumb:{type:Boolean,default:!0},lang:{default:"en"},cols:{default:4},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},tableThumbColumn:{type:Boolean},tableFixedHeader:{type:Boolean,default:!0},tableHeight:{default:400},selectedLang:{}},emits:["openDeleteDialog","openEditDocumentDialog"],setup(a,{emit:i}){const t=a,o=i,m=f=>{var p;return f&&((p=f.split(".").pop())==null?void 0:p.toLowerCase())||""},w=(f,p)=>{o("openDeleteDialog",f,p)},V=(f,p)=>{o("openEditDocumentDialog",f,p)};return(f,p)=>{const F=e.resolveComponent("v-img"),u=e.resolveComponent("v-icon"),h=e.resolveComponent("v-chip"),B=e.resolveComponent("v-card-subtitle"),y=e.resolveComponent("v-btn"),z=e.resolveComponent("v-tooltip"),L=e.resolveComponent("v-simple-table"),$=e.resolveComponent("v-col"),s=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,null,{default:e.withCtx(()=>[e.createVNode($,{cols:"12",lg:"12",md:"12",xs:"12"},{default:e.withCtx(()=>[e.createVNode(L,{"fixed-header":t.tableFixedHeader,height:t.tableHeight+"px"},{default:e.withCtx(()=>[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.tableThumbColumn?(e.openBlock(),e.createElementBlock("th",Ce,e.toDisplayString(t.selectedLang[f.lang].table.thumb),1)):e.createCommentVNode("",!0),e.createElementVNode("th",be,e.toDisplayString(t.selectedLang[f.lang].table.name),1),e.createElementVNode("th",we,e.toDisplayString(t.selectedLang[f.lang].table.size),1),e.createElementVNode("th",ke,e.toDisplayString(t.selectedLang[f.lang].table.action.action),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.documentAttachment,(r,l)=>{var n;return e.openBlock(),e.createElementBlock("tr",{key:`attachment-${l}`},[t.tableThumbColumn?(e.openBlock(),e.createElementBlock("td",xe,[r.file.name&&["jpg","jpeg","png","tif","bmp"].includes(((n=r.file.name.split(".").pop())==null?void 0:n.toLowerCase())||"")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.thumb?(e.openBlock(),e.createBlock(F,{key:0,style:{margin:"10px"},src:"data:"+r.file.format+","+r.file.base64,height:"50px",width:"50px"},null,8,["src"])):(e.openBlock(),e.createBlock(u,{key:1,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"deep-purple darken-1"},{default:e.withCtx(()=>p[0]||(p[0]=[e.createTextVNode("mdi-file-image-outline")])),_:1}))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[m(r.file.name)==="pdf"?(e.openBlock(),e.createBlock(u,{key:0,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"red darken-1"},{default:e.withCtx(()=>p[1]||(p[1]=[e.createTextVNode("mdi-file-pdf-outline")])),_:1})):["doc","docx","odt"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:1,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"blue darken-1"},{default:e.withCtx(()=>p[2]||(p[2]=[e.createTextVNode("mdi-file-word-outline")])),_:1})):["xls","xlsx"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:2,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"teal darken-1"},{default:e.withCtx(()=>p[3]||(p[3]=[e.createTextVNode("mdi-file-excel-outline")])),_:1})):["pptx","pptm","ppt"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:3,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"orange darken-3"},{default:e.withCtx(()=>p[4]||(p[4]=[e.createTextVNode("mdi-file-powerpoint-outline")])),_:1})):["mp4","mov","flv","wmv","avi"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:4,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"red lighten-1"},{default:e.withCtx(()=>p[5]||(p[5]=[e.createTextVNode("mdi-file-video-outline")])),_:1})):m(r.file.name)==="dwg"?(e.openBlock(),e.createBlock(u,{key:5,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"indigo lighten-2"},{default:e.withCtx(()=>p[6]||(p[6]=[e.createTextVNode("mdi-file-cad")])),_:1})):["zip","rar","7-zip"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:6,size:"120","file-word-outline":"",color:"lime lighten-1"},{default:e.withCtx(()=>p[7]||(p[7]=[e.createTextVNode("mdi-folder-zip-outline")])),_:1})):m(r.file.name)==="txt"?(e.openBlock(),e.createBlock(u,{key:7,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"light-green darken-3"},{default:e.withCtx(()=>p[8]||(p[8]=[e.createTextVNode("mdi-script-text-outline")])),_:1})):(e.openBlock(),e.createBlock(u,{key:8,"x-large":"","file-word-outline":"",color:"indigo lighten-1"},{default:e.withCtx(()=>p[9]||(p[9]=[e.createTextVNode("mdi-file-question-outline")])),_:1}))],64))])):e.createCommentVNode("",!0),e.createElementVNode("td",null,e.toDisplayString(r.file.name),1),e.createElementVNode("td",null,[Number((r.file.size/1e3).toFixed(1))<1024?(e.openBlock(),e.createBlock(B,{key:0,class:"mt2"},{default:e.withCtx(()=>[e.createVNode(h,{color:"teal lighten-2",label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Number((r.file.size/1e3).toFixed(1))+f.selectedLang[f.lang].size.kb)+" ",1),e.createVNode(u,{right:""},{default:e.withCtx(()=>p[10]||(p[10]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1024)]),_:2},1024)):e.createCommentVNode("",!0),Number((r.file.size/1e3).toFixed(1))>1024?(e.openBlock(),e.createBlock(B,{key:1},{default:e.withCtx(()=>[e.createVNode(h,{color:"teal lighten-2",label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Number((r.file.size/1e3/1024).toFixed(1))+f.selectedLang[f.lang].size.mb)+" ",1),e.createVNode(u,{right:""},{default:e.withCtx(()=>p[11]||(p[11]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1024)]),_:2},1024)):e.createCommentVNode("",!0)]),e.createElementVNode("td",null,[e.createVNode(z,{top:""},{activator:e.withCtx(({props:d})=>[f.deletePermission?(e.openBlock(),e.createBlock(y,e.mergeProps({key:0,icon:"",color:"red",ref_for:!0},d,{onClick:c=>w(l,"")}),{default:e.withCtx(()=>[e.createVNode(u,null,{default:e.withCtx(()=>p[12]||(p[12]=[e.createTextVNode("mdi-delete")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(f.selectedLang[f.lang].table.action.deleteTooltip),1)]),_:2},1024),e.createVNode(z,{top:""},{activator:e.withCtx(({props:d})=>[f.editPermission?(e.openBlock(),e.createBlock(y,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},d,{onClick:c=>V(r,l)}),{default:e.withCtx(()=>[e.createVNode(u,{color:"green"},{default:e.withCtx(()=>p[13]||(p[13]=[e.createTextVNode("mdi-pencil-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ye,e.toDisplayString(f.selectedLang[f.lang].edit),1)]),_:2},1024)])])}),128))])]),_:1},8,["fixed-header","height"])]),_:1})]),_:1})])}}}),Z=e.defineComponent({__name:"SimpleUploader",props:{documentAttachment:{},lang:{default:"en"},thumb:{type:Boolean,default:!0},cols:{default:4},editPermission:{type:Boolean,default:!0},cardType:{},outlined:{type:Boolean},raised:{type:Boolean},shaped:{type:Boolean},tile:{type:Boolean},deletePermission:{type:Boolean,default:!0},selectedLang:{}},emits:["setCardTheme","openDeleteDialog","openEditDocumentDialog"],setup(a,{emit:i}){const t=a,o=i,m=u=>{const h=u/1e3;return h<1024?`${h.toFixed(1)} ${t.selectedLang[t.lang].size.kb}`:`${(h/1024).toFixed(1)} ${t.selectedLang[t.lang].size.mb}`},w=u=>{var h;return["jpg","jpeg","png","tif","bmp"].includes(((h=u.split(".").pop())==null?void 0:h.toLowerCase())||"")},V=u=>{var y;const h=(y=u.split(".").pop())==null?void 0:y.toLowerCase();return h&&{pdf:"mdi-file-pdf-outline",doc:"mdi-file-word-outline",docx:"mdi-file-word-outline",odt:"mdi-file-word-outline",jpg:"mdi-file-image-outline",jpeg:"mdi-file-image-outline",png:"mdi-file-image-outline",tif:"mdi-file-image-outline",bmp:"mdi-file-image-outline",xls:"mdi-file-excel-outline",xlsx:"mdi-file-excel-outline",pptx:"mdi-file-powerpoint-outline",pptm:"mdi-file-powerpoint-outline",ppt:"mdi-file-powerpoint-outline",mp4:"mdi-file-video-outline",mov:"mdi-file-video-outline",flv:"mdi-file-video-outline",wmv:"mdi-file-video-outline",avi:"mdi-file-video-outline",dwg:"mdi-file-cad",zip:"mdi-folder-zip-outline",rar:"mdi-folder-zip-outline","7-zip":"mdi-folder-zip-outline",txt:"mdi-script-text-outline"}[h]||"mdi-file-question-outline"},f=u=>{var y;const h=(y=u.split(".").pop())==null?void 0:y.toLowerCase();return h&&{pdf:"red darken-1",doc:"blue darken-1",docx:"blue darken-1",odt:"blue darken-1",jpg:"deep-purple darken-1",jpeg:"deep-purple darken-1",png:"deep-purple darken-1",tif:"deep-purple darken-1",bmp:"deep-purple darken-1",xls:"teal darken-1",xlsx:"teal darken-1",pptx:"orange darken-3",pptm:"orange darken-3",ppt:"orange darken-3",mp4:"red lighten-1",mov:"red lighten-1",flv:"red lighten-1",wmv:"red lighten-1",avi:"red lighten-1",dwg:"indigo lighten-2",zip:"lime lighten-1",rar:"lime lighten-1","7-zip":"lime lighten-1",txt:"light-green darken-3"}[h]||"indigo lighten-1"},p=(u,h)=>o("openDeleteDialog",u,h),F=(u,h)=>o("openEditDocumentDialog",u,h);return(u,h)=>{const B=e.resolveComponent("v-list-item-subtitle"),y=e.resolveComponent("v-icon"),z=e.resolveComponent("v-chip"),L=e.resolveComponent("v-list-item-content"),$=e.resolveComponent("v-img"),s=e.resolveComponent("v-avatar"),r=e.resolveComponent("v-list-item-title"),l=e.resolveComponent("v-list-item"),n=e.resolveComponent("v-divider"),d=e.resolveComponent("v-btn"),c=e.resolveComponent("v-tooltip"),C=e.resolveComponent("v-spacer"),N=e.resolveComponent("v-card-actions"),b=e.resolveComponent("v-chip-group"),D=e.resolveComponent("v-card-text"),S=e.resolveComponent("v-expand-transition"),P=e.resolveComponent("v-card"),T=e.resolveComponent("v-col"),U=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(U,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.documentAttachment,(_,M)=>(e.openBlock(),e.createBlock(T,{key:`attachment-${M}`,cols:"12",md:t.cols,xs:"12"},{default:e.withCtx(()=>[e.createVNode(P,{shaped:t.shaped,outlined:t.outlined,raised:t.raised,tile:t.tile},{default:e.withCtx(()=>[e.createVNode(l,{"three-line":""},{default:e.withCtx(()=>[e.createVNode(L,null,{default:e.withCtx(()=>[e.createVNode(B,{color:"blue-grey darken-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.file.name),1)]),_:2},1024),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(z,{color:"teal lighten-2",label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(_.file.size))+" ",1),e.createVNode(y,{right:""},{default:e.withCtx(()=>h[0]||(h[0]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1024)]),_:2},1024)]),_:2},1024),e.createVNode(l,null,{prepend:e.withCtx(()=>[e.createVNode(s,{size:"80",color:"blue-grey lighten-5"},{default:e.withCtx(()=>[w(_.file.name)&&t.thumb?(e.openBlock(),e.createBlock($,{key:0,src:"data:"+_.file.format+","+_.file.base64},null,8,["src"])):(e.openBlock(),e.createBlock(y,{key:1,color:f(_.file.name),size:"50"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V(_.file.name)),1)]),_:2},1032,["color"]))]),_:2},1024)]),default:e.withCtx(()=>[e.createVNode(r,null,{default:e.withCtx(()=>h[1]||(h[1]=[e.createTextVNode("File Title Here")])),_:1})]),_:2},1024)]),_:2},1024),e.createVNode(n,{class:"mx-4"}),e.createVNode(N,{style:{padding:"0"}},{default:e.withCtx(()=>[e.createVNode(c,{right:""},{activator:e.withCtx(({props:I})=>[t.deletePermission?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},I,{onClick:H=>p(M,"")}),{default:e.withCtx(()=>[e.createVNode(y,{color:"red"},{default:e.withCtx(()=>h[2]||(h[2]=[e.createTextVNode("mdi-trash-can-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.selectedLang[u.lang].delete),1)]),_:2},1024),e.createVNode(c,{right:""},{activator:e.withCtx(({props:I})=>[t.editPermission?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},I,{onClick:H=>F(_,M)}),{default:e.withCtx(()=>[e.createVNode(y,{color:"green"},{default:e.withCtx(()=>h[3]||(h[3]=[e.createTextVNode("mdi-pencil-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.selectedLang[u.lang].edit),1)]),_:2},1024),e.createVNode(C),_.file.tags.length>0||_.file.description?(e.openBlock(),e.createBlock(d,{key:0,icon:"",onClick:e.withModifiers(I=>_.file.showDetailState=!_.file.showDetailState,["prevent"])},{default:e.withCtx(()=>[e.createVNode(y,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.file.showDetailState?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:2},1024)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(S,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[e.createVNode(n),_.file.tags.length?(e.openBlock(),e.createBlock(b,{key:0,multiple:"","active-class":"primary--text",style:{padding:"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.file.tags,(I,H)=>(e.openBlock(),e.createBlock(z,{key:`tag-${H}`,style:{margin:"5px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I),1)]),_:2},1024))),128))]),_:2},1024)):e.createCommentVNode("",!0),_.file.description?(e.openBlock(),e.createBlock(D,{key:1,style:{"text-align":"justify"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.file.description),1)]),_:2},1024)):e.createCommentVNode("",!0)],512),[[e.vShow,_.file.showDetailState]])]),_:2},1024)]),_:2},1032,["shaped","outlined","raised","tile"])]),_:2},1032,["md"]))),128))]),_:1})])}}}),J=e.defineComponent({__name:"InsertButton",props:{documentAttachment:{},badgeCounter:{type:Boolean},btnColor:{},lang:{},maxFileCount:{},selectedLang:{}},emits:["openInputDocumentModal"],setup(a,{emit:i}){const t=i,o=a,m=()=>{t("openInputDocumentModal")};return(w,V)=>{const f=e.resolveComponent("v-btn"),p=e.resolveComponent("v-badge");return e.openBlock(),e.createElementBlock("div",null,[o.badgeCounter?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.documentAttachment.length>0?(e.openBlock(),e.createBlock(p,{key:0,bordered:"",color:o.documentAttachment.length===o.maxFileCount?"error":"success",overlap:"",content:w.documentAttachment.length},{default:e.withCtx(()=>[e.createVNode(f,{color:o.btnColor,onClick:m,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[w.lang].insertFile),1)]),_:1},8,["color"])]),_:1},8,["color","content"])):(e.openBlock(),e.createBlock(f,{key:1,color:o.btnColor,onClick:m,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[w.lang].insertFile),1)]),_:1},8,["color"]))],64)):e.createCommentVNode("",!0),o.badgeCounter?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:1,color:w.btnColor,onClick:m,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[w.lang].insertFile),1)]),_:1},8,["color"]))])}}}),re={en:{insertFile:"Insert File",insertNewFile:"Insert New File",add:"Add",delete:"Delete",edit:"Edit",deleteDialog:{message:"Are you sure you want to delete the file?",cancel:"cancel"},table:{thumb:"Thumb",name:"Name",size:"Size",tags:"tags",action:{action:"Action",deleteTooltip:"Delete"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"Max file Size is",maxFileCountAlert:"Max file Count is",fileName:"File Name",fileDescription:"File Description",fileTags:"File Tags"},fa:{insertFile:"افزودن فایل",insertNewFile:"افزودن فایل جدید",add:"افزودن",delete:"حذف",edit:"ویرایش",deleteDialog:{message:"آیا برای حذف فایل اطمینان دارید؟",cancel:"لغو"},table:{thumb:"پیش نمایش",name:"نام",size:"حجم",action:{action:"عملیات",deleteTooltip:"حذف"}},size:{kb:"کیلو بایت",mb:"مگابایت"},maxFileSizeAlert:"حداکثر حجم فایل انتحابی ",maxFileCountAlert:"حداکثر تعداد فایل انتخابی",fileName:"نام فایل",fileDescription:"توضیحات فایل",fileTags:"برچسب فایل"},fr:{insertFile:"Insérer un fichier",insertNewFile:"Insérer un nouveau fichier",add:"Ajouter",delete:"Supprimer",edit:"Éditer",deleteDialog:{message:"Voulez-vous vraiment supprimer le fichier?",cancel:"Annuler"},table:{thumb:"la vignette",name:"Nom",size:"Taille",action:{action:"Action",deleteTooltip:"Supprimer"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"La taille maximale du fichier est",maxFileCountAlert:"Le nombre maximal de fichiers est",fileName:"Nom de fichier",fileDescription:"description du fichier",fileTags:"Balises de fichier"},ch:{insertFile:"插入档案",insertNewFile:"插入新文件",add:"加",delete:"删除",edit:"编辑",deleteDialog:{message:"您确定要删除文件吗?",cancel:"取消"},table:{thumb:"缩图",name:"名称",size:"尺寸",action:{action:"行动",deleteTooltip:"删除"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"档案大小上限为",maxFileCountAlert:"现“最大文件数”为",fileName:"文档名称",fileDescription:"文件描述",fileTags:"文件标签"},ar:{insertFile:"إدراج ملف",insertNewFile:"إدراج ملف جديد",add:"أضف",delete:"حذف",edit:"تعديل",deleteDialog:{message:"هل أنت متأكد أنك تريد حذف الملف؟",cancel:"إلغاء"},table:{thumb:"ظفري",name:"اسم",size:"بحجم",action:{action:"عمل",deleteTooltip:"حذف"}},size:{kb:"کیلو بایت",mb:"ميغا بايت"},maxFileSizeAlert:"الحجم الأقصى للملف هو",maxFileCountAlert:"الحد الأقصى لعدد الملفات هو",fileName:"اسم الملف",fileDescription:"وصف الملف",fileTags:"علامات الملف"}};function _e(a,i={}){const{maxFileSize:t=5*1024*1024,maxFileCount:o=10,imageCompressor:m=!1,imageCompressLevel:w=.8,fileAccept:V="*"}=i,f=e.ref(!1),p=e.ref({show:!1,text:"",color:"success"}),F=e.computed(()=>a.value.length),u=e.computed(()=>F.value<o),h=e.computed(()=>a.value.reduce((l,n)=>l+n.file.size,0));function B(l,n="success"){p.value={show:!0,text:l,color:n}}function y(l){var n;if(!le(l.size,t))return{valid:!1,error:`File size exceeds maximum allowed size of ${(t/1048576).toFixed(1)}MB`};if(!ne(F.value,o))return{valid:!1,error:`Maximum file count of ${o} reached`};if(V!=="*"){const d=V.split(",").map(b=>b.trim()),c=`.${(n=l.name.split(".").pop())==null?void 0:n.toLowerCase()}`,C=l.type;if(!d.some(b=>b.startsWith(".")?b===c:b.includes("/*")?C.startsWith(b.replace("/*","")):b===C))return{valid:!1,error:`File type not accepted. Allowed types: ${V}`}}return{valid:!0}}async function z(l){let n;if(m&&Q(l.name,l.type))try{n=(await ae(l,w)).split(",")[1]}catch(C){console.warn("Image compression failed, using original file:",C),n=await ee(l)}else n=await ee(l);const d=G(l.size),c=v(l.name);return{base64:n,size:d.text,name:l.name,tags:[],description:"",showDetailState:!1,format:c}}async function L(l){if(f.value)return!1;f.value=!0;const n=Array.from(l),d=[];for(const c of n){const C=y(c);C.valid?d.push(c):B(C.error,"error")}if(d.length===0)return f.value=!1,!1;try{const C=(await Promise.all(d.map(b=>z(b)))).map(b=>{var D;return{file:{name:b.name,format:b.format,base64:b.base64,size:((D=d.find(S=>S.name===b.name))==null?void 0:D.size)||0,tags:b.tags,description:b.description,showDetailState:b.showDetailState}}});a.value.push(...C);const N=d.length===1?`File "${d[0].name}" uploaded successfully`:`${d.length} files uploaded successfully`;return B(N,"success"),!0}catch(c){return console.error("File upload error:",c),B("Failed to upload files. Please try again.","error"),!1}finally{f.value=!1}}function $(l){if(l>=0&&l<a.value.length){const n=a.value[l];return a.value.splice(l,1),B(`File "${n.file.name}" removed`,"warning"),!0}return!1}function s(l,n){if(l>=0&&l<a.value.length){const d=a.value[l].file;return Object.assign(d,n),B("File updated successfully","success"),!0}return!1}function r(){const l=a.value.length;a.value.splice(0),B(`${l} files cleared`,"warning")}return{isUploading:f,snackbar:p,fileCount:F,canAddMoreFiles:u,totalSize:h,uploadFiles:L,removeFile:$,updateFileMetadata:s,clearAllFiles:r,validateFile:y,showSnackbar:B}}function Me(a){return a}function Ve(a={}){const{maxErrors:i=10,autoRemoveTimeout:t=5e3,logToConsole:o=!0}=a,m=e.ref([]),w=e.ref(!1);function V(){return`error_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function f(n,d="error",c,C){const N={id:V(),message:n,type:d,timestamp:new Date,context:c,action:C};return o&&(d==="error"?console.error:d==="warning"?console.warn:d==="info"?console.info:console.log)(`[${d.toUpperCase()}] ${n}`,c||""),m.value.unshift(N),m.value.length>i&&(m.value=m.value.slice(0,i)),t>0&&setTimeout(()=>{p(N.id)},t),N.id}function p(n){const d=m.value.findIndex(c=>c.id===n);return d!==-1?(m.value.splice(d,1),!0):!1}function F(){m.value=[]}function u(n){m.value=m.value.filter(d=>d.type!==n)}async function h(n,d,c){w.value=!0;try{return await n()}catch(C){const N=d||(C instanceof Error?C.message:"An unexpected error occurred");return f(N,"error",{...c,originalError:C instanceof Error?C.message:String(C)}),null}finally{w.value=!1}}function B(n,d,c){return n||f(d,"error",c),n}function y(n,d){return f(n,"success",d)}function z(n,d){return f(n,"warning",d)}function L(n,d){return f(n,"info",d)}function $(n){return m.value.filter(d=>d.type===n)}function s(){return m.value[0]||null}function r(n){return n?m.value.some(d=>d.type===n):m.value.length>0}const l={fileSizeExceeded:(n,d)=>f(`File "${n}" exceeds maximum size of ${(d/(1024*1024)).toFixed(1)}MB`,"error",{fileName:n,maxSize:d,category:"file-upload"}),fileCountExceeded:n=>f(`Maximum file count of ${n} reached`,"error",{maxCount:n,category:"file-upload"}),invalidFileType:(n,d)=>f(`File "${n}" type not allowed. Accepted types: ${d}`,"error",{fileName:n,allowedTypes:d,category:"file-upload"}),uploadFailed:(n,d)=>f(`Failed to upload "${n}"${d?`: ${d}`:""}`,"error",{fileName:n,reason:d,category:"file-upload"}),compressionFailed:n=>f(`Image compression failed for "${n}", using original file`,"warning",{fileName:n,category:"file-upload"})};return{errors:m,isLoading:w,addError:f,removeError:p,clearErrors:F,clearErrorsByType:u,handleAsync:h,validate:B,showSuccess:y,showWarning:z,showInfo:L,getErrorsByType:$,getLatestError:s,hasErrors:r,fileUploadErrors:l}}function je(a){return a}function Be(a){const i=["simple","thumbnail","table"],t={isValid:!0,errors:[],warnings:[]};return typeof a!="string"?(t.isValid=!1,t.errors.push("File uploader type must be a string")):i.includes(a)||(t.isValid=!1,t.errors.push(`File uploader type must be one of: ${i.join(", ")}`)),t}function Ne(a){const i=["default","outlined","shaped","raised","tile"],t={isValid:!0,errors:[],warnings:[]};return a!==void 0&&typeof a!="string"?(t.isValid=!1,t.errors.push("Card type must be a string")):a&&!i.includes(a)&&(t.isValid=!1,t.errors.push(`Card type must be one of: ${i.join(", ")}`)),t}function De(a){const i=["en","fa","fr","ch","ar"],t={isValid:!0,errors:[],warnings:[]};return typeof a!="string"?(t.isValid=!1,t.errors.push("Language code must be a string")):i.includes(a)||(t.isValid=!1,t.errors.push(`Language code must be one of: ${i.join(", ")}`)),t}function Fe(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("File size must be a number")):a<=0?(i.isValid=!1,i.errors.push("File size must be greater than 0")):a>100*1024*1024&&i.warnings.push("File size limit is very large (>100MB), consider reducing for better performance"),i}function Te(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("File count must be a number")):a<0?(i.isValid=!1,i.errors.push("File count cannot be negative")):a>100&&i.warnings.push("File count limit is very high (>100), consider reducing for better performance"),i}function Se(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("Compression level must be a number")):a<0||a>1?(i.isValid=!1,i.errors.push("Compression level must be between 0 and 1")):a<.1?i.warnings.push("Very low compression level may result in poor image quality"):a>.9&&i.warnings.push("Very high compression level may not reduce file size significantly"),i}function ze(a){const i={isValid:!0,errors:[],warnings:[]};return a!==void 0&&typeof a!="string"?(i.isValid=!1,i.errors.push("File accept pattern must be a string")):a&&a.trim()===""&&i.warnings.push("Empty file accept pattern will accept all files"),i}function Ae(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("Columns count must be a number")):(a<1||a>12)&&(i.isValid=!1,i.errors.push("Columns count must be between 1 and 12")),i}function Le(a){const i={isValid:!0,errors:[],warnings:[]};return a!==void 0&&typeof a!="number"?(i.isValid=!1,i.errors.push("Table height must be a number")):a&&a<100?i.warnings.push("Table height is very small (<100px), content may not be visible"):a&&a>1e3&&i.warnings.push("Table height is very large (>1000px), consider reducing for better UX"),i}function Ee(a){const i={isValid:!0,errors:[],warnings:[]};return Array.isArray(a)?(a.forEach((t,o)=>{if(!t||typeof t!="object"){i.errors.push(`Attachment at index ${o} must be an object`);return}if(!t.file||typeof t.file!="object"){i.errors.push(`Attachment at index ${o} must have a file property`);return}const m=t.file;["name","format","base64","size"].forEach(V=>{V in m||i.errors.push(`File at index ${o} is missing required field: ${V}`)}),m.name&&typeof m.name!="string"&&i.errors.push(`File name at index ${o} must be a string`),m.format&&typeof m.format!="string"&&i.errors.push(`File format at index ${o} must be a string`),m.base64&&typeof m.base64!="string"&&i.errors.push(`File base64 at index ${o} must be a string`),m.size&&typeof m.size!="number"&&i.errors.push(`File size at index ${o} must be a number`),m.tags&&!Array.isArray(m.tags)&&i.errors.push(`File tags at index ${o} must be an array`)}),i.errors.length>0&&(i.isValid=!1),i):(i.isValid=!1,i.errors.push("Document attachment must be an array"),i)}function $e(a){const i={isValid:!0,errors:[],warnings:[]};return[{key:"fileUploaderType",validator:Be},{key:"cardType",validator:Ne},{key:"lang",validator:De},{key:"maxFileSize",validator:Fe},{key:"maxFileCount",validator:Te},{key:"imageCompressLevel",validator:Se},{key:"fileAccept",validator:ze},{key:"cols",validator:Ae},{key:"tableHeight",validator:Le},{key:"documentAttachment",validator:Ee}].forEach(({key:o,validator:m})=>{if(o in a){const w=m(a[o]);i.errors.push(...w.errors.map(V=>`${o}: ${V}`)),i.warnings.push(...w.warnings.map(V=>`${o}: ${V}`)),w.isValid||(i.isValid=!1)}}),i}const te=e.defineComponent({__name:"handyUploader",props:{documentAttachment:{},lang:{default:"en"},maxFileSize:{default:5242880},fileUploaderType:{default:"thumbnail"},maxFileCount:{default:10},badgeCounter:{type:Boolean,default:!0},btnColor:{default:"info"},imageCompressor:{type:Boolean},imageCompressLevel:{default:.8},fileAccept:{},thumb:{type:Boolean,default:!0},tableThumbColumn:{type:Boolean},tableFixedHeader:{type:Boolean,default:!0},tableHeight:{default:400},rtlSupport:{type:Boolean,default:!1},changeFileName:{type:Boolean,default:!1},addFileDescription:{type:Boolean,default:!1},addFileTag:{type:Boolean,default:!1},tags:{},customLang:{default:null},insertPermission:{type:Boolean,default:!0},cols:{default:3},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},cardType:{default:"default"},outlined:{type:Boolean},raised:{type:Boolean},shaped:{type:Boolean},tile:{type:Boolean}},emits:["updateCardType","updateBadgeCounter","updateMaxFileCount","updateMaxFileSize","updateImageCompressor","updateImageCompressLevel","updateFileAccept","updateThumb","updateChangeFileName","updateAddFileDescription","updateTableThumbColumn","updateTableFixedHeader","updateTableHeight","updateLang","updateDocumentAttachment"],setup(a,{emit:i}){const t=a;if(process.env.NODE_ENV==="development"){const s=$e(t);s.isValid||console.error("HandyUploader prop validation failed:",s.errors),s.warnings.length>0&&console.warn("HandyUploader prop validation warnings:",s.warnings)}const o=e.reactive({insertDocumentDialog:!1,editDocumentDialog:!1,deleteDocumentDialog:!1,tempAttachment:[],tempAttachmentChanged:[],fileUploaderSnackBarAlert:!1,fileUploaderSnackText:"",fileUploaderSnackBarAlertColor:"green",readerFile:null,registryDocFile:[],documentAttachmentAPI:[],btnLoader:!1,showDetail:!1,showDetailState:[],selectedIndex:0,selectedId:"",returnedRecord:{},outlined:!1,raised:!1,shaped:!1,tile:!1,selectedLang:{},beforeInsertAttachments:{},attachmentIndex:0}),m=i;e.onBeforeMount(()=>{V(),o.registryDocFile=t.documentAttachment,t.rtlSupport&&f(),p()}),e.watch(()=>o.tempAttachment,s=>{s&&s.length>0?z(s):o.tempAttachmentChanged=[]}),e.watch(()=>t.cardType,s=>{m("updateCardType",s),p()}),e.watch(()=>t.badgeCounter,s=>{m("updateBadgeCounter",s)}),e.watch(()=>t.maxFileCount,s=>{m("updateMaxFileCount",s)}),e.watch(()=>t.maxFileSize,s=>{m("updateMaxFileSize",s)}),e.watch(()=>t.maxFileSize,s=>{m("updateMaxFileSize",s)}),e.watch(()=>t.imageCompressor,s=>{m("updateImageCompressor",s)}),e.watch(()=>t.imageCompressLevel,s=>{m("updateImageCompressLevel",s)}),e.watch(()=>t.fileAccept,s=>{m("updateFileAccept",s)}),e.watch(()=>t.thumb,s=>{m("updateThumb",s)}),e.watch(()=>t.changeFileName,s=>{m("updateChangeFileName",s)}),e.watch(()=>t.addFileDescription,s=>{m("updateAddFileDescription",s)}),e.watch(()=>t.addFileTag,s=>{m("updateAddFileDescription",s)}),e.watch(()=>t.tableThumbColumn,s=>{m("updateTableThumbColumn",s)}),e.watch(()=>t.tableFixedHeader,s=>{m("updateTableFixedHeader",s)}),e.watch(()=>t.tableHeight,s=>{m("updateTableHeight",s)}),e.watch(()=>t.lang,s=>{m("updateLang",s)}),e.onDeactivated(()=>{o.registryDocFile=[]});const w=()=>{o.btnLoader=!1,o.tempAttachment=[],o.insertDocumentDialog=!0},V=()=>{t.customLang!==null?o.selectedLang=t.customLang:o.selectedLang=re},f=()=>{},p=()=>{const r={default:{outlined:!1,raised:!1,shaped:!1,tile:!1},outlined:{outlined:!0,raised:!1,shaped:!1,tile:!1},shaped:{outlined:!1,raised:!1,shaped:!0,tile:!1},raised:{outlined:!1,raised:!0,shaped:!1,tile:!1},tile:{outlined:!1,raised:!1,shaped:!1,tile:!0}}[t.cardType||"default"];o.outlined=r.outlined,o.raised=r.raised,o.shaped=r.shaped,o.tile=r.tile},F=s=>{let r=new FileReader;return new Promise(function(l){r.onloadend=()=>{l(r.result)},r.readAsDataURL(s)})},u=async()=>{o.btnLoader=!0;const s=(r,l)=>{o.fileUploaderSnackText=r,o.fileUploaderSnackBarAlertColor=l,o.fileUploaderSnackBarAlert=!0};for(const[r,l]of o.tempAttachmentChanged.entries()){if(t.documentAttachment.length>=t.maxFileCount){s(`${o.selectedLang[t.lang].maxFileCountAlert} ${t.maxFileCount}`,"red");break}if(l.file.size/1e3>t.maxFileSize){s(`${o.selectedLang[t.lang].maxFileSizeAlert} ${Math.round(t.maxFileSize/1024)} ${o.selectedLang[t.lang].size.mb}`,"red");continue}let n={},d={};const c=l.file,C=c.format;let N=!1,b="",D=c.base64;t.imageCompressor&&["image/png","image/jpg","image/jpeg","image/webp"].includes(C)&&(N=!0,b=await h(`data:${C};base64,${D}`),D=b.split(",")[1]);try{const S=D.replace(/\s/g,"");n={base64:S,size:N?(atob(S).length/1024).toFixed(1):c.size.toString(),name:`${c.name}.${c.format}`,tags:c.tags||[],description:c.description||"",showDetailState:!1,format:C},d.file=n,o.registryDocFile.push(d),m("updateDocumentAttachment",o.registryDocFile)}catch(S){console.error("Error processing Base64 string:",S),s("File could not be processed due to an invalid format.","red");continue}}o.documentAttachmentAPI=[],o.tempAttachmentChanged=[],o.insertDocumentDialog=!1,o.btnLoader=!1},h=s=>{const r=document.createElement("canvas"),l=document.createElement("img");return new Promise((n,d)=>{let c=t.imageCompressLevel;l.onload=function(){let C=l.width,N=l.height;r.width=C,r.height=N;const b=r.getContext("2d");b==null||b.drawImage(l,0,0,C,N),n(r.toDataURL("image/jpeg",c))},l.onerror=function(C){d(C)},l.src=s})},B=(s,r)=>{o.btnLoader=!1,o.selectedIndex=s,o.selectedId=r,o.deleteDocumentDialog=!0},y=()=>{o.registryDocFile.splice(o.selectedIndex,1),m("updateDocumentAttachment",o.registryDocFile),o.deleteDocumentDialog=!1},z=async s=>{for(let r of s){let l="";try{l=await F(r)}catch(c){console.log(c);continue}let d={file:{name:r.name.split(".")[0],format:r.name.substr(r.name.lastIndexOf(".")+1),base64:l.split(",")[1],size:r.size,tags:[],description:null,showDetailState:!1}};o.tempAttachmentChanged.push(d)}},L=(s,r)=>{o.btnLoader=!1,o.attachmentIndex=r,o.editDocumentDialog=!0,o.tempAttachmentChanged=[s]},$=()=>{const s=[...t.documentAttachment];s.splice(o.attachmentIndex,1,o.tempAttachmentChanged[0]),m("updateDocumentAttachment",s),o.editDocumentDialog=!1};return(s,r)=>{const l=e.resolveComponent("v-col"),n=e.resolveComponent("v-row"),d=e.resolveComponent("v-icon"),c=e.resolveComponent("v-card-title"),C=e.resolveComponent("v-file-input"),N=e.resolveComponent("v-expansion-panel-title"),b=e.resolveComponent("v-text-field"),D=e.resolveComponent("v-textarea"),S=e.resolveComponent("v-autocomplete"),P=e.resolveComponent("v-img"),T=e.resolveComponent("v-card"),U=e.resolveComponent("v-expansion-panel-text"),_=e.resolveComponent("v-expansion-panel"),M=e.resolveComponent("v-expansion-panels"),I=e.resolveComponent("v-list-item-title"),H=e.resolveComponent("v-list-item"),q=e.resolveComponent("v-card-text"),k=e.resolveComponent("v-btn"),R=e.resolveComponent("v-card-actions"),E=e.resolveComponent("v-dialog"),K=e.resolveComponent("v-snackbar"),Ie=e.resolveComponent("v-spacer"),Pe=e.resolveComponent("v-container");return e.openBlock(),e.createBlock(Pe,null,{default:e.withCtx(()=>[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(l,{cols:"12",md:"12",xs:"12"},{default:e.withCtx(()=>[e.createVNode(J,{documentAttachment:t.documentAttachment,selectedLang:o.selectedLang,lang:t.lang,badgeCounter:t.badgeCounter,btnColor:t.btnColor,maxFileCount:t.maxFileCount,onOpenInputDocumentModal:w},null,8,["documentAttachment","selectedLang","lang","badgeCounter","btnColor","maxFileCount"]),t.fileUploaderType==="simple"?(e.openBlock(),e.createBlock(Z,{key:0,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:p,onOpenDeleteDialog:B,onOpenEditDocumentDialog:L},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0),t.fileUploaderType==="thumbnail"?(e.openBlock(),e.createBlock(Y,{key:1,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:p,onOpenDeleteDialog:r[0]||(r[0]=(g,j)=>B(g,j)),onOpenEditDocumentDialog:r[1]||(r[1]=(g,j)=>L(g,j))},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0),t.fileUploaderType==="table"?(e.openBlock(),e.createBlock(X,{key:2,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,tableThumbColumn:t.tableThumbColumn,tableFixedHeader:t.tableFixedHeader,tableHeight:t.tableHeight,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:p,onOpenDeleteDialog:B,onOpenEditDocumentDialog:L},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","tableThumbColumn","tableFixedHeader","tableHeight","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.createVNode(n,{justify:"center"},{default:e.withCtx(()=>[e.createVNode(E,{modelValue:o.insertDocumentDialog,"onUpdate:modelValue":r[5]||(r[5]=g=>o.insertDocumentDialog=g),scrollable:!1,persistent:"",width:"50%"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(d,{onClick:r[2]||(r[2]=g=>o.insertDocumentDialog=!1)},{default:e.withCtx(()=>r[12]||(r[12]=[e.createTextVNode("mdi-close")])),_:1})]),_:1}),e.createVNode(q,null,{default:e.withCtx(()=>[o.tempAttachment.length===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.fileAccept!==""?(e.openBlock(),e.createBlock(C,{key:0,multiple:"",accept:t.fileAccept,chip:"",modelValue:o.tempAttachment,"onUpdate:modelValue":r[3]||(r[3]=g=>o.tempAttachment=g),label:o.selectedLang[s.lang].insertNewFile},null,8,["accept","modelValue","label"])):(e.openBlock(),e.createBlock(C,{key:1,multiple:"",modelValue:o.tempAttachment,"onUpdate:modelValue":r[4]||(r[4]=g=>o.tempAttachment=g),label:o.selectedLang[s.lang].insertNewFile},null,8,["modelValue","label"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.addFileTag||t.addFileDescription||t.changeFileName?(e.openBlock(),e.createBlock(M,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,j)=>(e.openBlock(),e.createBlock(_,{key:`attachment-${j}`},{default:e.withCtx(()=>[e.createVNode(N,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.file.name),1)]),_:2},1024),e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(n,{align:"center",justify:"center"},{default:e.withCtx(()=>[e.createVNode(l,{cols:"12",lg:"9",md:"9",xs:"12"},{default:e.withCtx(()=>[t.changeFileName?(e.openBlock(),e.createBlock(b,{key:0,label:o.selectedLang[s.lang].fileName,modelValue:g.file.name,"onUpdate:modelValue":A=>g.file.name=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileDescription?(e.openBlock(),e.createBlock(D,{key:1,label:o.selectedLang[s.lang].fileDescription,"auto-grow":"","row-height":"1",modelValue:g.file.description,"onUpdate:modelValue":A=>g.file.description=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileTag?(e.openBlock(),e.createBlock(S,{key:2,modelValue:g.file.tags,"onUpdate:modelValue":A=>g.file.tags=A,items:t.tags,dense:"",chips:"",label:o.selectedLang[s.lang].fileTags,multiple:""},null,8,["modelValue","onUpdate:modelValue","items","label"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(l,{align:"center",cols:"12",lg:"3",md:"3",xs:"12"},{default:e.withCtx(()=>[g.file.format==="jpg"||g.file.format==="jpeg"||g.file.format==="png"||g.file.format==="tif"||g.file.format==="bmp"?(e.openBlock(),e.createBlock(T,{key:0},{default:e.withCtx(()=>[e.createVNode(P,{src:"data:"+g.file.format+";base64,"+g.file.base64},null,8,["src"])]),_:2},1024)):(e.openBlock(),e.createBlock(O,{key:1,"file-format":g.file.format,size:60},null,8,["file-format"]))]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})):(e.openBlock(),e.createBlock(T,{key:1,class:"mx-auto",tile:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,j)=>(e.openBlock(),e.createBlock(H,{key:`attachment-${j}`,style:{"border-bottom":"1px solid #E0E0E0"}},{default:e.withCtx(()=>[e.createVNode(I,null,{default:e.withCtx(()=>[e.createVNode(O,{"file-format":g.file.format,size:24},null,8,["file-format"]),e.createTextVNode(" "+e.toDisplayString(g.file.name)+"."+e.toDisplayString(g.file.format),1)]),_:2},1024)]),_:2},1024))),128))]),_:1}))],64))]),_:1}),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(k,{disabled:o.tempAttachment==null||o.btnLoader,loading:o.btnLoader,color:t.btnColor,onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].add),1)]),_:1},8,["disabled","loading","color"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(n,{justify:"center"},{default:e.withCtx(()=>[e.createVNode(E,{modelValue:o.editDocumentDialog,"onUpdate:modelValue":r[7]||(r[7]=g=>o.editDocumentDialog=g),scrollable:!1,persistent:"",width:"50%"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(d,{onClick:r[6]||(r[6]=g=>o.editDocumentDialog=!1)},{default:e.withCtx(()=>r[13]||(r[13]=[e.createTextVNode("mdi-close")])),_:1})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,j)=>(e.openBlock(),e.createBlock(q,{key:`attachment-${j}`},{default:e.withCtx(()=>[e.createVNode(n,{align:"center",justify:"center"},{default:e.withCtx(()=>[e.createVNode(l,{cols:"12",lg:"9",md:"9",xs:"12"},{default:e.withCtx(()=>[t.changeFileName?(e.openBlock(),e.createBlock(b,{key:0,label:o.selectedLang[s.lang].fileName,modelValue:g.file.name,"onUpdate:modelValue":A=>g.file.name=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileDescription?(e.openBlock(),e.createBlock(D,{key:1,label:o.selectedLang[s.lang].fileDescription,"auto-grow":"","row-height":"1",modelValue:g.file.description,"onUpdate:modelValue":A=>g.file.description=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileTag?(e.openBlock(),e.createBlock(S,{key:2,modelValue:g.file.tags,"onUpdate:modelValue":A=>g.file.tags=A,items:t.tags,dense:"",chips:"",label:o.selectedLang[s.lang].fileTags,multiple:""},null,8,["modelValue","onUpdate:modelValue","items","label"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(l,{align:"center",cols:"12",lg:"3",md:"3",xs:"12"},{default:e.withCtx(()=>{var A;return[g.file.name&&["jpg","jpeg","png","tif","bmp"].includes(((A=g.file.name.split(".").pop())==null?void 0:A.toLowerCase())||"")?(e.openBlock(),e.createBlock(T,{key:0},{default:e.withCtx(()=>[e.createVNode(P,{src:"data:"+g.file.format+";base64,"+g.file.base64},null,8,["src"])]),_:2},1024)):(e.openBlock(),e.createBlock(O,{key:1,"file-format":g.file.format,size:60},null,8,["file-format"]))]}),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(k,{disabled:o.tempAttachment===null||o.btnLoader,loading:o.btnLoader,color:t.btnColor,onClick:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].edit),1)]),_:1},8,["disabled","loading","color"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(K,{modelValue:o.fileUploaderSnackBarAlert,"onUpdate:modelValue":r[9]||(r[9]=g=>o.fileUploaderSnackBarAlert=g),right:"",bottom:"",color:o.fileUploaderSnackBarAlertColor,timeout:3e3},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.fileUploaderSnackText)+" ",1),e.createVNode(k,{color:"white",text:"",onClick:r[8]||(r[8]=g=>o.fileUploaderSnackBarAlert=!1)},{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>r[14]||(r[14]=[e.createTextVNode("mdi-close")])),_:1})]),_:1})]),_:1},8,["modelValue","color"]),e.createVNode(n,{justify:"center"},{default:e.withCtx(()=>[e.createVNode(E,{modelValue:o.deleteDocumentDialog,"onUpdate:modelValue":r[11]||(r[11]=g=>o.deleteDocumentDialog=g),persistent:"",width:"30%"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(d,{color:"red"})]),_:1}),e.createVNode(q,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].deleteDialog.message),1)]),_:1}),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(Ie),e.createVNode(k,{color:"green darken-1",text:"",onClick:r[10]||(r[10]=g=>o.deleteDocumentDialog=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].deleteDialog.cancel),1)]),_:1}),e.createVNode(k,{color:"primary",disabled:o.btnLoader,loading:o.btnLoader,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].delete),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})}}}),Ue={ThumbnailUploader:Y,TableUploader:X,SimpleUploader:Z,HandyUploader:te,InsertButton:J,SelectFileIconType:O};function se(a){a.component("ThumbnailUploader",Y),a.component("TableUploader",X),a.component("SimpleUploader",Z),a.component("HandyUploader",te),a.component("InsertButton",J),a.component("SelectFileIconType",O)}typeof window<"u"&&window.Vue&&se(window.Vue),x.HandyUploader=te,x.InsertButton=J,x.SelectFileIconType=O,x.SimpleUploader=Z,x.TableUploader=X,x.ThumbnailUploader=Y,x.compressImage=ae,x.constructImageDataUrl=ie,x.default=Ue,x.fileToBase64=ee,x.formatFileSize=G,x.getFileIcon=oe,x.getFileType=W,x.getMimeTypeFromExtension=v,x.install=se,x.isImageFile=Q,x.languageData=re,x.useErrorHandler=Ve,x.useFileUpload=_e,x.validateFileCount=ne,x.validateFileSize=le,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,71 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "handy-uploader",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"core-js": "^3.15.2",
|
|
16
|
-
"css-loader": "^3.6.0",
|
|
17
|
-
"vue": "^2.6.14",
|
|
18
|
-
"vuetify": "^2.5.6"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@mdi/font": "^5.8.55",
|
|
22
|
-
"@vue/cli-plugin-babel": "~4.4.0",
|
|
23
|
-
"@vue/cli-plugin-eslint": "~4.4.0",
|
|
24
|
-
"@vue/cli-service": "~4.4.0",
|
|
25
|
-
"@vue/eslint-config-prettier": "^6.0.0",
|
|
26
|
-
"babel-eslint": "^10.1.0",
|
|
27
|
-
"eslint": "^6.7.2",
|
|
28
|
-
"eslint-plugin-prettier": "^3.3.0",
|
|
29
|
-
"eslint-plugin-vue": "^6.2.2",
|
|
30
|
-
"prettier": "^1.19.1",
|
|
31
|
-
"sass": "^1.35.2",
|
|
32
|
-
"sass-loader": "^8.0.2",
|
|
33
|
-
"vue-cli-plugin-vuetify": "^2.4.1",
|
|
34
|
-
"vue-template-compiler": "^2.6.14",
|
|
35
|
-
"vuetify-loader": "^1.3.0"
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "A comprehensive Vue 3 file uploader component library with video thumbnail generation and multiple upload styles",
|
|
5
|
+
"main": "dist/handy-uploader.umd.js",
|
|
6
|
+
"module": "dist/handy-uploader.es.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/handy-uploader.es.js",
|
|
11
|
+
"require": "./dist/handy-uploader.umd.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
36
14
|
},
|
|
37
15
|
"files": [
|
|
38
|
-
"dist
|
|
39
|
-
"src/*",
|
|
40
|
-
"public/*",
|
|
41
|
-
"*.json",
|
|
42
|
-
"*.js"
|
|
16
|
+
"dist"
|
|
43
17
|
],
|
|
44
18
|
"keywords": [
|
|
45
|
-
"vue.js",
|
|
46
19
|
"vue",
|
|
47
|
-
"
|
|
48
|
-
"image",
|
|
49
|
-
"responsive",
|
|
50
|
-
"fileUploader",
|
|
51
|
-
"vue-file-upload",
|
|
52
|
-
"vue-file-component",
|
|
53
|
-
"vue-image-upload",
|
|
54
|
-
"upload",
|
|
20
|
+
"vue3",
|
|
55
21
|
"uploader",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
22
|
+
"file-upload",
|
|
23
|
+
"video-thumbnail",
|
|
24
|
+
"drag-drop",
|
|
25
|
+
"vuetify",
|
|
26
|
+
"typescript",
|
|
27
|
+
"component-library"
|
|
62
28
|
],
|
|
29
|
+
"author": "Your Name <your.email@example.com>",
|
|
30
|
+
"license": "MIT",
|
|
63
31
|
"repository": {
|
|
64
32
|
"type": "git",
|
|
65
|
-
"url": "
|
|
33
|
+
"url": "https://github.com/yourusername/handy-uploader-vue.git"
|
|
66
34
|
},
|
|
35
|
+
"homepage": "https://github.com/yourusername/handy-uploader-vue#readme",
|
|
67
36
|
"bugs": {
|
|
68
|
-
"url": "https://github.com/
|
|
37
|
+
"url": "https://github.com/yourusername/handy-uploader-vue/issues"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"dev": "vite",
|
|
41
|
+
"build": "run-p type-check build-lib",
|
|
42
|
+
"build-lib": "vite build --mode lib",
|
|
43
|
+
"preview": "vite preview",
|
|
44
|
+
"build-only": "vite build",
|
|
45
|
+
"type-check": "vue-tsc --noEmit",
|
|
46
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
47
|
+
"format": "prettier --write src/",
|
|
48
|
+
"prepublishOnly": "npm run build"
|
|
69
49
|
},
|
|
70
|
-
"
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"vue": "^3.0.0",
|
|
52
|
+
"vuetify": "^3.0.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@mdi/font": "^7.4.47",
|
|
56
|
+
"@rushstack/eslint-patch": "^1.7.2",
|
|
57
|
+
"@types/node": "^20.11.9",
|
|
58
|
+
"@vitejs/plugin-vue": "^5.0.3",
|
|
59
|
+
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
60
|
+
"@vue/eslint-config-prettier": "^9.0.0",
|
|
61
|
+
"@vue/eslint-config-typescript": "^12.0.0",
|
|
62
|
+
"@vue/tsconfig": "^0.5.1",
|
|
63
|
+
"eslint": "^8.56.0",
|
|
64
|
+
"eslint-plugin-vue": "^9.20.1",
|
|
65
|
+
"npm-run-all": "^4.1.5",
|
|
66
|
+
"prettier": "^3.2.4",
|
|
67
|
+
"typescript": "~5.3.3",
|
|
68
|
+
"vite": "^5.0.12",
|
|
69
|
+
"vue": "^3.4.15",
|
|
70
|
+
"vue-tsc": "^1.8.27",
|
|
71
|
+
"vuetify": "^3.5.1"
|
|
72
|
+
}
|
|
71
73
|
}
|
package/.eslintrc.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
node: true
|
|
5
|
-
},
|
|
6
|
-
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
|
|
7
|
-
parserOptions: {
|
|
8
|
-
parser: "babel-eslint"
|
|
9
|
-
},
|
|
10
|
-
rules: {
|
|
11
|
-
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
12
|
-
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
|
|
13
|
-
}
|
|
14
|
-
};
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 ali jahanpak
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/babel.config.js
DELETED