frontend-roadreport-main/frontend-roadreport-deploy/dist/road-report/685.36a1f48f2a4f3cab.js
2024-12-31 10:28:36 +07:00

1 line
46 KiB
JavaScript

"use strict";(self.webpackChunkroad_report=self.webpackChunkroad_report||[]).push([[685],{8685:(_e,P,s)=>{s.d(P,{MF:()=>ce,mu:()=>ge,Xx:()=>xe,A8:()=>u});var e=s(8699),h=s(7673),k=s(1584),v=s(1413),O=s(4572),_=s(345),y=s(6977),M=s(6354),j=s(8141);const I={ez:"application/andrew-inset",aw:"application/applixware",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomdeleted:"application/atomdeleted+xml",atomsvc:"application/atomsvc+xml",dwd:"application/atsc-dwd+xml",held:"application/atsc-held+xml",rsat:"application/atsc-rsat+xml",bdoc:"application/bdoc",xcs:"application/calendar+xml",ccxml:"application/ccxml+xml",cdfx:"application/cdfx+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cu:"application/cu-seeme",mpd:"application/dash+xml",davmount:"application/davmount+xml",dbk:"application/docbook+xml",dssc:"application/dssc+der",xdssc:"application/dssc+xml",es:"application/ecmascript",ecma:"application/ecmascript",emma:"application/emma+xml",emotionml:"application/emotionml+xml",epub:"application/epub+zip",exi:"application/exi",fdt:"application/fdt+xml",pfr:"application/font-tdpfr",geojson:"application/geo+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gxf:"application/gxf",gz:"application/gzip",hjson:"application/hjson",stk:"application/hyperstudio",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",its:"application/its+xml",jar:"application/java-archive",war:"application/java-archive",ear:"application/java-archive",ser:"application/java-serialized-object",class:"application/java-vm",js:"application/javascript",mjs:"application/javascript",json:"application/json",map:"application/json",json5:"application/json5",jsonml:"application/jsonml+json",jsonld:"application/ld+json",lgr:"application/lgr+xml",lostxml:"application/lost+xml",hqx:"application/mac-binhex40",cpt:"application/mac-compactpro",mads:"application/mads+xml",webmanifest:"application/manifest+json",mrc:"application/marc",mrcx:"application/marcxml+xml",ma:"application/mathematica",nb:"application/mathematica",mb:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mscml:"application/mediaservercontrol+xml",metalink:"application/metalink+xml",meta4:"application/metalink4+xml",mets:"application/mets+xml",maei:"application/mmt-aei+xml",musd:"application/mmt-usd+xml",mods:"application/mods+xml",m21:"application/mp21",mp21:"application/mp21",mp4s:"application/mp4",m4p:"application/mp4",doc:"application/msword",dot:"application/msword",mxf:"application/mxf",nq:"application/n-quads",nt:"application/n-triples",cjs:"application/node",bin:"application/octet-stream",dms:"application/octet-stream",lrf:"application/octet-stream",mar:"application/octet-stream",so:"application/octet-stream",dist:"application/octet-stream",distz:"application/octet-stream",pkg:"application/octet-stream",bpk:"application/octet-stream",dump:"application/octet-stream",elc:"application/octet-stream",deploy:"application/octet-stream",exe:"application/octet-stream",dll:"application/octet-stream",deb:"application/octet-stream",dmg:"application/octet-stream",iso:"application/octet-stream",img:"application/octet-stream",msi:"application/octet-stream",msp:"application/octet-stream",msm:"application/octet-stream",buffer:"application/octet-stream",oda:"application/oda",opf:"application/oebps-package+xml",ogx:"application/ogg",omdoc:"application/omdoc+xml",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",oxps:"application/oxps",relo:"application/p2p-overlay+xml",xer:"application/patch-ops-error+xml",pdf:"application/pdf",pgp:"application/pgp-encrypted",asc:"application/pgp-signature",sig:"application/pgp-signature",prf:"application/pics-rules",p10:"application/pkcs10",p7m:"application/pkcs7-mime",p7c:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",ac:"application/pkix-attr-cert",cer:"application/pkix-cert",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",pki:"application/pkixcmp",pls:"application/pls+xml",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",provx:"application/provenance+xml",cww:"application/prs.cww",pskcxml:"application/pskc+xml",raml:"application/raml+yaml",rdf:"application/rdf+xml",owl:"application/rdf+xml",rif:"application/reginfo+xml",rnc:"application/relax-ng-compact-syntax",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rs:"application/rls-services+xml",rapd:"application/route-apd+xml",sls:"application/route-s-tsid+xml",rusd:"application/route-usd+xml",gbr:"application/rpki-ghostbusters",mft:"application/rpki-manifest",roa:"application/rpki-roa",rsd:"application/rsd+xml",rss:"application/rss+xml",rtf:"application/rtf",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",sdp:"application/sdp",senmlx:"application/senml+xml",sensmlx:"application/sensml+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",shf:"application/shf+xml",siv:"application/sieve",sieve:"application/sieve",smi:"application/smil+xml",smil:"application/smil+xml",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",sru:"application/sru+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",swidtag:"application/swid+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",tfi:"application/thraud+xml",tsd:"application/timestamped-data",toml:"application/toml",trig:"application/trig",ttml:"application/ttml+xml",ubj:"application/ubjson",rsheet:"application/urc-ressheet+xml",td:"application/urc-targetdesc+xml",vxml:"application/voicexml+xml",wasm:"application/wasm",wgt:"application/widget",hlp:"application/winhlp",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml",xaml:"application/xaml+xml",xav:"application/xcap-att+xml",xca:"application/xcap-caps+xml",xdf:"application/xcap-diff+xml",xel:"application/xcap-el+xml",xns:"application/xcap-ns+xml",xenc:"application/xenc+xml",xhtml:"application/xhtml+xml",xht:"application/xhtml+xml",xlf:"application/xliff+xml",xml:"application/xml",xsl:"application/xml",xsd:"application/xml",rng:"application/xml",dtd:"application/xml-dtd",xop:"application/xop+xml",xpl:"application/xproc+xml",xslt:"application/xml",xspf:"application/xspf+xml",mxml:"application/xv+xml",xhvml:"application/xv+xml",xvml:"application/xv+xml",xvm:"application/xv+xml",yang:"application/yang",yin:"application/yin+xml",zip:"application/zip","3gpp":"video/3gpp",adp:"audio/adpcm",amr:"audio/amr",au:"audio/basic",snd:"audio/basic",mid:"audio/midi",midi:"audio/midi",kar:"audio/midi",rmi:"audio/midi",mxmf:"audio/mobile-xmf",mp3:"audio/mpeg",m4a:"audio/mp4",mp4a:"audio/mp4",mpga:"audio/mpeg",mp2:"audio/mpeg",mp2a:"audio/mpeg",m2a:"audio/mpeg",m3a:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",spx:"audio/ogg",opus:"audio/ogg",s3m:"audio/s3m",sil:"audio/silk",wav:"audio/wav",weba:"audio/webm",xm:"audio/xm",ttc:"font/collection",otf:"font/otf",ttf:"font/ttf",woff:"font/woff",woff2:"font/woff2",exr:"image/aces",apng:"image/apng",avif:"image/avif",bmp:"image/bmp",cgm:"image/cgm",drle:"image/dicom-rle",emf:"image/emf",fits:"image/fits",g3:"image/g3fax",gif:"image/gif",heic:"image/heic",heics:"image/heic-sequence",heif:"image/heif",heifs:"image/heif-sequence",hej2:"image/hej2k",hsj2:"image/hsj2",ief:"image/ief",jls:"image/jls",jp2:"image/jp2",jpg2:"image/jp2",jpeg:"image/jpeg",jpg:"image/jpeg",jpe:"image/jpeg",jph:"image/jph",jhc:"image/jphc",jpm:"image/jpm",jpx:"image/jpx",jpf:"image/jpx",jxr:"image/jxr",jxra:"image/jxra",jxrs:"image/jxrs",jxs:"image/jxs",jxsc:"image/jxsc",jxsi:"image/jxsi",jxss:"image/jxss",ktx:"image/ktx",ktx2:"image/ktx2",png:"image/png",btif:"image/prs.btif",pti:"image/prs.pti",sgi:"image/sgi",svg:"image/svg+xml",svgz:"image/svg+xml",t38:"image/t38",tif:"image/tiff",tiff:"image/tiff",tfx:"image/tiff-fx",webp:"image/webp",wmf:"image/wmf","disposition-notification":"message/disposition-notification",u8msg:"message/global",u8dsn:"message/global-delivery-status",u8mdn:"message/global-disposition-notification",u8hdr:"message/global-headers",eml:"message/rfc822",mime:"message/rfc822","3mf":"model/3mf",gltf:"model/gltf+json",glb:"model/gltf-binary",igs:"model/iges",iges:"model/iges",msh:"model/mesh",mesh:"model/mesh",silo:"model/mesh",mtl:"model/mtl",obj:"model/obj",stpz:"model/step+zip",stpxz:"model/step-xml+zip",stl:"model/stl",wrl:"model/vrml",vrml:"model/vrml",x3db:"model/x3d+fastinfoset",x3dbz:"model/x3d+binary",x3dv:"model/x3d-vrml",x3dvz:"model/x3d+vrml",x3d:"model/x3d+xml",x3dz:"model/x3d+xml",appcache:"text/cache-manifest",manifest:"text/cache-manifest",ics:"text/calendar",ifb:"text/calendar",coffee:"text/coffeescript",litcoffee:"text/coffeescript",css:"text/css",csv:"text/csv",html:"text/html",htm:"text/html",shtml:"text/html",jade:"text/jade",jsx:"text/jsx",less:"text/less",markdown:"text/markdown",md:"text/markdown",mml:"text/mathml",mdx:"text/mdx",n3:"text/n3",txt:"text/plain",text:"text/plain",conf:"text/plain",def:"text/plain",list:"text/plain",log:"text/plain",in:"text/plain",ini:"text/plain",dsc:"text/prs.lines.tag",rtx:"text/richtext",sgml:"text/sgml",sgm:"text/sgml",shex:"text/shex",slim:"text/slim",slm:"text/slim",spdx:"text/spdx",stylus:"text/stylus",styl:"text/stylus",tsv:"text/tab-separated-values",t:"text/troff",tr:"text/troff",roff:"text/troff",man:"text/troff",me:"text/troff",ms:"text/troff",ttl:"text/turtle",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",vtt:"text/vtt",yaml:"text/yaml",yml:"text/yaml","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",m4s:"video/iso.segment",jpgv:"video/jpeg",jpgm:"image/jpm",mj2:"video/mj2",mjp2:"video/mj2",ts:"video/mp2t",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg",ogv:"video/ogg",qt:"video/quicktime",mov:"video/quicktime",webm:"video/webm"};var S=s(9079),c=s(177);function E(n,p){if(1&n&&(e.j41(0,"div",4),e.nrm(1,"cloud-icon",5),e.j41(2,"div",6),e.EFF(3),e.k0s(),e.j41(4,"div",7),e.EFF(5),e.k0s(),e.j41(6,"button",8),e.EFF(7),e.k0s()()),2&n){const t=e.XpG();e.R7$(3),e.SpI(" ",null==t.captions||null==t.captions.dropzone?null:t.captions.dropzone.title," "),e.R7$(2),e.SpI(" ",null==t.captions||null==t.captions.dropzone?null:t.captions.dropzone.or," "),e.R7$(2),e.SpI(" ",null==t.captions||null==t.captions.dropzone?null:t.captions.dropzone.browse," ")}}const R=["*"];function z(n,p){if(1&n){const t=e.RV6();e.j41(0,"div",17)(1,"img",18),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.imageClicked.next(o.fileItem))}),e.k0s()()}if(2&n){const t=e.XpG(2);e.R7$(1),e.Y8G("src",t.safeUrl,e.B4B)}}function U(n,p){if(1&n&&(e.j41(0,"div",19),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.Y8G("ngClass",t.fileItem.fileName.split(".").pop()),e.R7$(1),e.SpI(" ",t.fileType," ")}}function B(n,p){if(1&n&&(e.j41(0,"div",20),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(1),e.JRh(t.niceBytes(null==t.fileItem.file?null:t.fileItem.file.size))}}function G(n,p){1&n&&(e.j41(0,"div",21),e.nrm(1,"span",22),e.k0s())}function V(n,p){if(1&n){const t=e.RV6();e.j41(0,"refresh-icon",23),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onRetry())}),e.k0s()}}function A(n,p){if(1&n&&e.nrm(0,"a",24),2&n){const t=e.XpG(2);e.FS9("title",null==t.captions||null==t.captions.previewCard?null:t.captions.previewCard.uploadError)}}const N=function(n){return{width:n}};function L(n,p){if(1&n&&(e.qex(0),e.j41(1,"div",25),e.nrm(2,"div",26),e.k0s(),e.j41(3,"div",27)(4,"div",28),e.EFF(5),e.k0s()(),e.bVm()),2&n){const t=e.XpG(2);e.R7$(2),e.Y8G("ngStyle",e.eq3(2,N,t.uploadProgress+"%")),e.R7$(3),e.SpI("",t.uploadProgress," %")}}const w=function(n){return{"visually-hidden":n}};function X(n,p){if(1&n){const t=e.RV6();e.j41(0,"div",2)(1,"div",3),e.DNE(2,z,2,1,"div",4),e.DNE(3,U,2,2,"div",5),e.nrm(4,"div",6),e.k0s(),e.j41(5,"div",7)(6,"a",8)(7,"p"),e.EFF(8),e.k0s()(),e.DNE(9,B,2,1,"div",9),e.k0s(),e.j41(10,"div",10),e.DNE(11,G,2,0,"div",11),e.DNE(12,V,1,0,"refresh-icon",12),e.j41(13,"a",13),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onRemove(o.fileItem))}),e.nrm(14,"close-icon",14),e.k0s()(),e.DNE(15,A,1,1,"a",15),e.DNE(16,L,6,4,"ng-container",16),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("ngClass",e.eq3(11,w,t.itemTemplate)),e.R7$(2),e.Y8G("ngIf",t.isImageFile&&(null==t.fileItem?null:t.fileItem.file)),e.R7$(1),e.Y8G("ngIf",!t.isImageFile||!(null!=t.fileItem&&t.fileItem.file)),e.R7$(3),e.Y8G("title",t.fileItem.fileName),e.R7$(2),e.JRh(t.fileItem.fileName),e.R7$(1),e.Y8G("ngIf",null==t.fileItem?null:t.fileItem.file),e.R7$(2),e.Y8G("ngIf",!t.uploadError&&!t.uploadProgress&&(null==t.fileItem?null:t.fileItem.file)),e.R7$(1),e.Y8G("ngIf",t.uploadError),e.R7$(1),e.FS9("title",null==t.captions||null==t.captions.previewCard?null:t.captions.previewCard.remove),e.R7$(2),e.Y8G("ngIf",t.uploadError&&!t.uploadProgress),e.R7$(1),e.Y8G("ngIf",t.uploadProgress)}}function $(n,p){1&n&&e.eu8(0)}const Y=function(n,p){return{fileItem:n,uploadProgress:p}},q=function(n){return{visibility:n}};function J(n,p){if(1&n){const t=e.RV6();e.j41(0,"preview-lightbox",2),e.bIt("previewClose",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.closeLightbox())}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("file",t.lightboxFile)}}function Z(n,p){if(1&n){const t=e.RV6();e.j41(0,"file-preview-item",3),e.bIt("removeFile",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.removeFile.next(o))})("uploadSuccess",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.uploadSuccess.next(o))})("uploadFail",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.uploadFail.next(o))})("imageClicked",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.openLightbox(o))}),e.k0s()}if(2&n){const t=p.$implicit,i=e.XpG();e.Y8G("fileItem",t)("itemTemplate",i.itemTemplate)("adapter",i.adapter)("captions",i.captions)("enableAutoUpload",i.enableAutoUpload)}}function Q(n,p){if(1&n){const t=e.RV6();e.j41(0,"div",6),e.bIt("click",function(){e.eBV(t),e.XpG();const o=e.sdS(2);return e.Njj(o.click())}),e.j41(1,"file-drop",7),e.bIt("onFileDrop",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.dropped(o))}),e.SdG(2),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(1),e.Y8G("customstyle","custom-drag")("captions",t.captions)}}const H=function(n){return{"is-loading":n}};function K(n,p){if(1&n){const t=e.RV6();e.j41(0,"div",8)(1,"div",9)(2,"img",10),e.bIt("load",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.cropperImgLoaded(o))}),e.k0s(),e.j41(3,"div",11)(4,"button",12),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCropSubmit())}),e.EFF(5),e.k0s(),e.j41(6,"button",13),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.closeCropper({file:o.currentCropperFile,fileName:o.currentCropperFile.name}))}),e.EFF(7),e.k0s()()()()}if(2&n){const t=e.XpG();e.R7$(2),e.Y8G("src",t.safeCropImgUrl,e.B4B),e.R7$(2),e.Y8G("disabled",t.isCroppingBusy)("ngClass",e.eq3(5,H,t.isCroppingBusy)),e.R7$(1),e.SpI(" ",null==t.captions||null==t.captions.cropper?null:t.captions.cropper.crop," "),e.R7$(2),e.SpI(" ",null==t.captions||null==t.captions.cropper?null:t.captions.cropper.cancel," ")}}function W(n,p){if(1&n){const t=e.RV6();e.j41(0,"file-preview-container",14),e.bIt("removeFile",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.removeFile(o))})("uploadSuccess",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.onUploadSuccess(o))})("uploadFail",function(o){e.eBV(t);const a=e.XpG();return e.Njj(a.onUploadFail(o))}),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("previewFiles",t.files)("adapter",t.adapter)("itemTemplate",t.itemTemplate)("captions",t.captions)("enableAutoUpload",t.enableAutoUpload)}}const ee=[[["",8,"dropzonetemplate"]]],te=[".dropzoneTemplate"];let x=(()=>{class n{constructor(t){this.sanitizer=t}mockUploadFile(t){const i=new CustomEvent("customevent",{detail:{type:"UploadProgreess"}});return(0,h.of)(i.detail)}createSafeUrl(t){try{const i=window.URL.createObjectURL(t);return this.sanitizer.bypassSecurityTrustResourceUrl(i)}catch(i){console.log(i)}}static{this.\u0275fac=function(i){return new(i||n)(e.KVO(_.up))}}static{this.\u0275prov=e.jDH({token:n,factory:n.\u0275fac})}}return n})();var m=function(n){return n.fileMaxSize="FILE_MAX_SIZE",n.fileMaxCount="FILE_MAX_COUNT",n.totalMaxSize="TOTAL_MAX_SIZE",n.extensions="EXTENSIONS",n.uploadType="UPLOAD_TYPE",n.customValidator="CUSTOM_VALIDATOR",n}(m||{});const ae={dropzone:{title:"Drag and drop file here",or:"or",browse:"Browse Files"},cropper:{crop:"Crop",cancel:"Cancel"},previewCard:{remove:"Remove",uploadError:"Error on upload"}},le={dragMode:"crop",aspectRatio:1,autoCrop:!0,movable:!0,zoomable:!0,scalable:!0,autoCropArea:.8};function b(n){return parseFloat(n.toString())/1048576}let pe=(()=>{class n{constructor(){}isValidExtension(t,i){if(!i?.length)return!0;const o=t.split(".").pop();return-1!==i.map(l=>l.toLowerCase()).indexOf(o.toLowerCase())}isValidUploadType(t,i){return!("single"===i&&t?.length>0)}isValidMaxFileCount(t,i,o){return!t||t>=o?.length+i?.length}isValidFileSize(t,i){const o=b(t);return!(i&&!(i&&o<i))}isValidTotalFileSize(t,i,o){const a=i.map(l=>l.file?l.file.size:0).reduce((l,r)=>l+r,0);return!(o&&!(o&&b(a+t.size)<o))}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=e.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();class g{constructor(p,t){this.relativePath=p,this.fileEntry=t}}class re{constructor(p){this.files=p}}let se=(()=>{class n{constructor(){}ngOnInit(){}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["cloud-icon"]],decls:3,vars:0,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","width","42px","height","42px",1,"svg-icon"],["d","M0 0h24v24H0z","fill","none"],["d","M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"]],template:function(i,o){1&i&&(e.qSk(),e.j41(0,"svg",0),e.nrm(1,"path",1)(2,"path",2),e.k0s())},styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:center;margin-bottom:.4em}.svg-icon[_ngcontent-%COMP%]{fill:#95a5a6}"],changeDetection:0})}}return n})(),C=(()=>{class n{constructor(t,i){this.zone=t,this.renderer=i,this.customstyle=null,this.disableIf=!1,this.onFileDrop=new e.bkB,this.onFileOver=new e.bkB,this.onFileLeave=new e.bkB,this.stack=[],this.files=[],this.dragoverflag=!1,this.globalDisable=!1,this.numOfActiveReadEntries=0,this.customstyle||(this.customstyle="drop-zone"),this.globalStart=this.renderer.listen("document","dragstart",o=>{this.globalDisable=!0}),this.globalEnd=this.renderer.listen("document","dragend",o=>{this.globalDisable=!1})}onDragOver(t){!this.globalDisable&&!this.disableIf&&(this.dragoverflag||(this.dragoverflag=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragLeave(t){!this.globalDisable&&!this.disableIf&&(this.dragoverflag&&(this.dragoverflag=!1,this.onFileLeave.emit(t)),this.preventAndStop(t))}dropFiles(t){if(!this.globalDisable&&!this.disableIf){let i;this.dragoverflag=!1,t.dataTransfer.dropEffect="copy",i=t.dataTransfer.items?t.dataTransfer.items.length:t.dataTransfer.files.length;for(let a=0;a<i;a++){let l;if(t.dataTransfer.items?t.dataTransfer.items[a].webkitGetAsEntry&&(l=t.dataTransfer.items[a].webkitGetAsEntry()):t.dataTransfer.files[a].webkitGetAsEntry&&(l=t.dataTransfer.files[a].webkitGetAsEntry()),l)if(l.isFile){const r=new g(l.name,l);this.addToQueue(r)}else l.isDirectory&&this.traverseFileTree(l,l.name);else{const r=t.dataTransfer.files[a];if(r){const f={name:r.name,isDirectory:!1,isFile:!0,file:ve=>{ve(r)}},d=new g(f.name,f);this.addToQueue(d)}}}this.preventAndStop(t);const o=(0,k.O)(200,200);this.subscription=o.subscribe(a=>{this.files.length>0&&0===this.numOfActiveReadEntries&&(this.onFileDrop.emit(new re(this.files)),this.files=[])})}}traverseFileTree(t,i){if(t.isFile){const o=new g(i,t);this.files.push(o),this.zone.run(()=>{this.popToStack()})}else{this.pushToStack(i),i+="/";const o=t.createReader();let a=[];const l=this,r=()=>{l.numOfActiveReadEntries++,o.readEntries(f=>{if(f.length)a=a.concat(f),r();else{if(0===a.length){const d=new g(i,t);l.zone.run(()=>{l.addToQueue(d)})}else for(let d=0;d<a.length;d++)l.zone.run(()=>{l.traverseFileTree(a[d],i+a[d].name)});l.zone.run(()=>{l.popToStack()})}l.numOfActiveReadEntries--})};r()}}addToQueue(t){this.files.push(t)}pushToStack(t){this.stack.push(t)}popToStack(){this.stack.pop()}clearQueue(){this.files=[]}preventAndStop(t){t.stopPropagation(),t.preventDefault()}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),this.globalStart(),this.globalEnd()}static{this.\u0275fac=function(i){return new(i||n)(e.rXU(e.SKi),e.rXU(e.sFG))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["file-drop"]],inputs:{captions:"captions",customstyle:"customstyle",disableIf:"disableIf"},outputs:{onFileDrop:"onFileDrop",onFileOver:"onFileOver",onFileLeave:"onFileLeave"},ngContentSelectors:R,decls:5,vars:4,consts:[["id","dropZone",3,"className","drop","dragover","dragleave"],[1,"custom-dropzone"],["ref",""],["class","content",4,"ngIf"],[1,"content"],[1,"cloud-icon"],[1,"content-top-text"],[1,"content-center-text"],["type","button",1,"file-browse-button"]],template:function(i,o){if(1&i&&(e.NAR(),e.j41(0,"div",0),e.bIt("drop",function(l){return o.dropFiles(l)})("dragover",function(l){return o.onDragOver(l)})("dragleave",function(l){return o.onDragLeave(l)}),e.j41(1,"div",1,2),e.SdG(3),e.k0s(),e.DNE(4,E,8,3,"div",3),e.k0s()),2&i){const a=e.sdS(2);e.AVh("over",o.dragoverflag),e.Y8G("className",o.customstyle),e.R7$(4),e.Y8G("ngIf",0==(null==a.children?null:a.children.length))}},dependencies:[c.bT,se],styles:["[_nghost-%COMP%]{display:block;width:100%;padding:0 16px}#dropZone[_ngcontent-%COMP%]{max-width:440px;margin:auto;border:2px dashed #ecf0f1;border-radius:6px;padding:56px 0;background:#ffffff}.file-browse-button[_ngcontent-%COMP%]{padding:12px 18px;background:#7f8c8d;border:0;outline:0;font-size:14px;color:#fff;font-weight:700;border-radius:6px;cursor:pointer}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}.over[_ngcontent-%COMP%]{background-color:#93939380}.content-top-text[_ngcontent-%COMP%]{font-size:18px;font-weight:700;color:#5b5b7b}.content-center-text[_ngcontent-%COMP%]{color:#90a0bc;margin:12px 0;font-size:14px}"]})}}return n})();var u=function(n){return n.UPLOADED="UPLOADED",n.IN_PROGRESS="IN PROGRESS",n.ERROR="ERROR",n}(u||{});class ce{}let de=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["refresh-icon"]],decls:3,vars:0,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","width","18px","height","18px"],["d","M0 0h24v24H0z","fill","none"],["d","M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"]],template:function(i,o){1&i&&(e.qSk(),e.j41(0,"svg",0),e.nrm(1,"path",1)(2,"path",2),e.k0s())},styles:["[_nghost-%COMP%]{display:block;cursor:pointer}svg[_ngcontent-%COMP%]{fill:#95a5a6}"],changeDetection:0})}}return n})(),F=(()=>{class n{constructor(){}ngOnInit(){}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["close-icon"]],decls:3,vars:0,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","width","18px","height","18px"],["d","M0 0h24v24H0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]],template:function(i,o){1&i&&(e.qSk(),e.j41(0,"svg",0),e.nrm(1,"path",1)(2,"path",2),e.k0s())},styles:["[_nghost-%COMP%]{display:block;cursor:pointer}svg[_ngcontent-%COMP%]{fill:#95a5a6}"],changeDetection:0})}}return n})(),me=(()=>{class n{constructor(t,i){this.fileService=t,this.changeRef=i,this.removeFile=new e.bkB,this.uploadSuccess=new e.bkB,this.uploadFail=new e.bkB,this.imageClicked=new e.bkB}ngOnInit(){this.fileItem.file&&(this._uploadFile(this.fileItem),this.safeUrl=this.getSafeUrl(this.fileItem.file)),this.fileType=function ne(n){return n.split(".").pop().toUpperCase()}(this.fileItem.fileName),this.isImageFile=function oe(n){return["PNG","JPG","JPEG","BMP","WEBP","JFIF","TIFF"].includes(n.toUpperCase())}(this.fileType)}getSafeUrl(t){return this.fileService.createSafeUrl(t)}niceBytes(t){let o=0,a=parseInt(t,10)||0;for(;a>=1024&&++o;)a/=1024;return a.toFixed(a<10&&o>0?1:0)+" "+["bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][o]}onRetry(){this.uploadError=void 0,this._uploadFile(this.fileItem)}onRemove(t){this._uploadUnsubscribe(),this.removeFile.next({...t,uploadResponse:this.uploadResponse||t.uploadResponse})}_uploadFile(t){this.enableAutoUpload&&(this.adapter?this._uploadSubscription=this.adapter.uploadFile(t).subscribe(i=>{i&&i.status===u.UPLOADED&&(this._onUploadSuccess(i.body,t),this.uploadProgress=void 0),i&&i.status===u.IN_PROGRESS&&(this.uploadProgress=i.progress,this.changeRef.detectChanges()),i&&i.status===u.ERROR&&(this.uploadError=!0,this.uploadFail.next(i.body),this.uploadProgress=void 0),this.changeRef.detectChanges()},i=>{this.uploadError=!0,this.uploadFail.next(i),this.uploadProgress=void 0,this.changeRef.detectChanges()}):console.warn("no adapter was provided"))}_onUploadSuccess(t,i){this.uploadResponse=t,this.fileItem.uploadResponse=t,this.uploadSuccess.next({...i,uploadResponse:t})}_uploadUnsubscribe(){this._uploadSubscription&&this._uploadSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||n)(e.rXU(x),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["file-preview-item"]],inputs:{fileItem:"fileItem",adapter:"adapter",itemTemplate:"itemTemplate",captions:"captions",enableAutoUpload:"enableAutoUpload"},outputs:{removeFile:"removeFile",uploadSuccess:"uploadSuccess",uploadFail:"uploadFail",imageClicked:"imageClicked"},decls:2,vars:6,consts:[["class","file-preview-wrapper",3,"ngClass",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"file-preview-wrapper",3,"ngClass"],[1,"file-preview-thumbnail"],["class","img-preview-thumbnail",4,"ngIf"],["class","other-preview-thumbnail",3,"ngClass",4,"ngIf"],[1,"thumbnail-backdrop"],[1,"file-preview-description"],["href","javascript:void(0)",1,"file-preview-title",3,"title"],["class","file-preview-size",4,"ngIf"],[1,"file-preview-actions"],["class","ngx-checkmark-wrapper",4,"ngIf"],[3,"click",4,"ngIf"],[1,"ngx-close-icon-wrapper",3,"title","click"],[1,"ngx-close-icon"],["class","file-upload-error-wrapper","href","javascipt:void(0)",3,"title",4,"ngIf"],[4,"ngIf"],[1,"img-preview-thumbnail"],[3,"src","click"],[1,"other-preview-thumbnail",3,"ngClass"],[1,"file-preview-size"],[1,"ngx-checkmark-wrapper"],[1,"ngx-checkmark"],[3,"click"],["href","javascipt:void(0)",1,"file-upload-error-wrapper",3,"title"],[1,"file-upload-progress-bar-wrapper"],[1,"file-upload-progress-bar",3,"ngStyle"],[1,"file-upload-percentage-wrapper"],[1,"file-upload-percentage"]],template:function(i,o){1&i&&(e.DNE(0,X,17,13,"div",0),e.DNE(1,$,1,0,"ng-container",1)),2&i&&(e.Y8G("ngIf",o.fileItem),e.R7$(1),e.Y8G("ngTemplateOutlet",o.itemTemplate)("ngTemplateOutletContext",e.l_i(3,Y,o.fileItem,o.uploadProgress)))},dependencies:[c.YU,c.bT,c.T3,c.B3,de,F],styles:['[_nghost-%COMP%]{display:block;padding:20px 16px;border-bottom:1px solid #ebeef1;max-width:440px;position:relative}.visually-hidden[_ngcontent-%COMP%]{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;outline:0;-webkit-appearance:none;-moz-appearance:none}.file-preview-wrapper[_ngcontent-%COMP%]{display:flex;width:100%}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%]{position:relative;z-index:2;cursor:pointer}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .img-preview-thumbnail[_ngcontent-%COMP%]{width:36px;height:36px}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .img-preview-thumbnail[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;border-radius:6px}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail[_ngcontent-%COMP%]{width:36px;height:36px;display:flex;justify-content:center;align-items:center;background:#706fd3;border-radius:4px;color:#fff;font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail.pdf[_ngcontent-%COMP%]{background:#e4394e}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail.doc[_ngcontent-%COMP%], .file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail.docx[_ngcontent-%COMP%]{background:#2196F3}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail.xls[_ngcontent-%COMP%], .file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail.xlsx[_ngcontent-%COMP%]{background:#4CAF50}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail.txt[_ngcontent-%COMP%], .file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .other-preview-thumbnail.ppt[_ngcontent-%COMP%]{background:#FF9800}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%] .thumbnail-backdrop[_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0;width:100%;height:100%;border-radius:6px;transition:all .1s ease-in-out;pointer-events:none;background:rgba(43,56,71,.2)}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%]:hover .thumbnail-backdrop[_ngcontent-%COMP%]{visibility:visible}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-thumbnail[_ngcontent-%COMP%]:active .thumbnail-backdrop[_ngcontent-%COMP%]{visibility:visible;background:rgba(43,56,71,.4)}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-description[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding-left:16px;padding-right:16px;color:#74809d;overflow:hidden;flex:1;z-index:2;position:relative}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-description[_ngcontent-%COMP%] .file-preview-title[_ngcontent-%COMP%]{font-weight:700;width:90%;text-decoration:none;color:#74809d;cursor:default}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-description[_ngcontent-%COMP%] .file-preview-title[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-overflow:ellipsis;max-width:100%;overflow:hidden;white-space:nowrap;margin:0}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-description[_ngcontent-%COMP%] .file-preview-size[_ngcontent-%COMP%]{font-size:12px;color:#979fb8}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-actions[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:10px;z-index:3;position:relative}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-actions[_ngcontent-%COMP%] .ngx-checkmark-wrapper[_ngcontent-%COMP%]{position:relative;cursor:pointer;font-size:22px;height:20px;width:20px;border-radius:50%;background:#43d084}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-actions[_ngcontent-%COMP%] .ngx-checkmark-wrapper[_ngcontent-%COMP%] .ngx-checkmark[_ngcontent-%COMP%]{position:absolute;top:0;left:0;height:19px;width:19px}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-actions[_ngcontent-%COMP%] .ngx-checkmark-wrapper[_ngcontent-%COMP%] .ngx-checkmark[_ngcontent-%COMP%]:after{content:"";position:absolute;display:block;left:7px;top:4px;width:3px;height:7px;border:1px solid #ffffff;border-width:0 3px 3px 0;transform:rotate(45deg)}.file-preview-wrapper[_ngcontent-%COMP%] .file-preview-actions[_ngcontent-%COMP%] .ngx-close-icon-wrapper[_ngcontent-%COMP%]{border-radius:50%;padding:3px;margin-left:5px;cursor:pointer}.file-preview-wrapper[_ngcontent-%COMP%] .file-upload-progress-bar-wrapper[_ngcontent-%COMP%], .file-preview-wrapper[_ngcontent-%COMP%] .file-upload-percentage-wrapper[_ngcontent-%COMP%]{position:absolute;z-index:1;width:100%;height:95%;left:0;top:0;bottom:0;margin:auto}.file-preview-wrapper[_ngcontent-%COMP%] .file-upload-progress-bar[_ngcontent-%COMP%]{background:#eef1fa;border-radius:6px;width:0%;height:95%;transition:width .3s ease-in}.file-preview-wrapper[_ngcontent-%COMP%] .file-upload-percentage[_ngcontent-%COMP%]{padding-right:10%;color:#c2cdda;padding-top:5%;font-size:19px;text-align:right}.file-preview-wrapper[_ngcontent-%COMP%] .file-upload-error-wrapper[_ngcontent-%COMP%]{position:absolute;z-index:1;width:100%;height:95%;left:0;top:0;bottom:0;margin:auto;background:rgba(254,84,111,.06)}'],changeDetection:0})}}return n})(),fe=(()=>{class n{constructor(t){this.sanitizer=t,this.previewClose=new e.bkB}ngOnInit(){this.getSafeUrl(this.file.file)}getSafeUrl(t){const i=window.URL.createObjectURL(t);this.safeUrl=this.sanitizer.bypassSecurityTrustResourceUrl(i)}onClose(t){this.previewClose.next()}static{this.\u0275fac=function(i){return new(i||n)(e.rXU(_.up))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["preview-lightbox"]],inputs:{file:"file"},outputs:{previewClose:"previewClose"},decls:6,vars:4,consts:[[1,"ng-modal-backdrop",3,"click"],[1,"ng-modal-content"],[1,"close-icon-wrapper",3,"click"],[1,"lightbox-item"],[3,"src","ngStyle","load"]],template:function(i,o){1&i&&(e.j41(0,"div",0),e.bIt("click",function(l){return o.onClose(l)}),e.k0s(),e.j41(1,"div",1)(2,"div",2),e.bIt("click",function(l){return o.onClose(l)}),e.nrm(3,"close-icon"),e.k0s(),e.j41(4,"div",3)(5,"img",4),e.bIt("load",function(){return o.loaded=!0}),e.k0s()()()),2&i&&(e.R7$(5),e.Y8G("src",o.safeUrl,e.B4B)("ngStyle",e.eq3(2,q,o.loaded?"visible":"hidden")))},dependencies:[c.B3,F],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;position:fixed;z-index:1040;left:0;top:0;width:100vw;height:100vh;overflow:auto;overflow:hidden}.ng-modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1040;background:rgba(0,0,0,.288)}.ng-modal-content[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;color:#000000de;z-index:1041}.ng-modal-content[_ngcontent-%COMP%] .close-icon-wrapper[_ngcontent-%COMP%]{position:absolute;top:20px;right:20px;font-size:20px}.ng-modal-content[_ngcontent-%COMP%] .lightbox-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:calc(100vw - 30px);max-height:calc(100vh - 30px);width:100%;height:auto;-o-object-fit:contain;object-fit:contain;animation-name:_ngcontent-%COMP%_zoomIn;animation-duration:.2s}@keyframes _ngcontent-%COMP%_zoomIn{0%{opacity:0;transform:scale3d(.9,.9,.9)}50%{opacity:1}}"],changeDetection:0})}}return n})(),ue=(()=>{class n{constructor(){this.removeFile=new e.bkB,this.uploadSuccess=new e.bkB,this.uploadFail=new e.bkB}ngOnInit(){}openLightbox(t){this.lightboxFile=t}closeLightbox(){this.lightboxFile=void 0}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["file-preview-container"]],inputs:{previewFiles:"previewFiles",itemTemplate:"itemTemplate",enableAutoUpload:"enableAutoUpload",adapter:"adapter",captions:"captions"},outputs:{removeFile:"removeFile",uploadSuccess:"uploadSuccess",uploadFail:"uploadFail"},decls:2,vars:2,consts:[[3,"file","previewClose",4,"ngIf"],[3,"fileItem","itemTemplate","adapter","captions","enableAutoUpload","removeFile","uploadSuccess","uploadFail","imageClicked",4,"ngFor","ngForOf"],[3,"file","previewClose"],[3,"fileItem","itemTemplate","adapter","captions","enableAutoUpload","removeFile","uploadSuccess","uploadFail","imageClicked"]],template:function(i,o){1&i&&(e.DNE(0,J,1,1,"preview-lightbox",0),e.DNE(1,Z,1,5,"file-preview-item",1)),2&i&&(e.Y8G("ngIf",o.lightboxFile),e.R7$(1),e.Y8G("ngForOf",o.previewFiles))},dependencies:[c.Sq,c.bT,me,fe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;justify-content:flex-start;width:100%;background:#fafbfd}"],changeDetection:0})}}return n})(),ge=(()=>{class n{constructor(t,i,o){this.fileService=t,this.fileValidatorService=i,this.changeRef=o,this.uploadSuccess=new e.bkB,this.uploadFail=new e.bkB,this.removeSuccess=new e.bkB,this.validationError=new e.bkB,this.fileAdded=new e.bkB,this.fileRemoved=new e.bkB,this.enableCropper=!1,this.showeDragDropZone=!0,this.showPreviewContainer=!0,this.uploadType="multi",this.croppedCanvasOptions={},this.captions=ae,this.enableAutoUpload=!0,this.files=[],this.filesForCropper=[],this._cropClosed$=new v.B,this._onDestroy$=new v.B,this.injector=(0,e.WQX)(e.zZn)}ngOnInit(){this._setCropperOptions(),this._listenToCropClose()}ngOnDestroy(){this._onDestroy$.next(),this._onDestroy$.complete()}onChange(t){const i=Array.from(t);this.handleFiles(i).subscribe()}dropped(t){const i=t.files,o=[];for(const a of i)a.fileEntry.isFile&&a.fileEntry.file(r=>{o.push(r),(0,e.N4e)(this.injector,()=>{this.handleFiles(o).pipe((0,S.pQ)()).subscribe()})})}onUploadSuccess(t){this.uploadSuccess.next(t)}onUploadFail(t){this.uploadFail.next(t)}onRemoveSuccess(t){this.removeSuccess.next(t),this.removeFileFromList(t)}getSafeUrl(t){return this.fileService.createSafeUrl(t)}removeFile(t){this.enableAutoUpload?this.adapter?this.adapter.removeFile(t).subscribe(i=>{this.onRemoveSuccess(t)}):console.warn("no adapter was provided"):this.removeFileFromList(t)}_listenToCropClose(){this._cropClosed$.pipe((0,y.Q)(this._onDestroy$)).subscribe(t=>{const i=this.filesForCropper.findIndex(a=>a.name===t.fileName),o=-1!==i?this.filesForCropper[i+1]:void 0;this.filesForCropper=[...this.filesForCropper].filter(a=>a.name!==t.fileName),o&&this.openCropper(o)})}_setCropperOptions(){this.cropperOptions||this._setDefaultCropperOptions()}_setDefaultCropperOptions(){this.cropperOptions=le}handleFiles(t){if(!this.isValidMaxFileCount(t))return(0,h.of)(null);const i=t.every(a=>this._validateFileSync(a)),o=t.map(a=>this._validateFileAsync(a));return(0,O.z)([...o]).pipe((0,M.T)(a=>{const l=a.every(r=>!0===r);!i||!l||t.forEach((r,f)=>{this.handleInputFile(r,f)})}))}_validateFileSync(t){return!(!t||!this.isValidUploadType(t)||!this.isValidExtension(t,t.name))}_validateFileAsync(t){return this.customValidator?this.customValidator(t).pipe((0,j.M)(i=>{i||this.validationError.next({file:t,error:m.customValidator})})):(0,h.of)(!0)}handleInputFile(t,i){"image"===function ie(n){return n.includes("image")?"image":n.includes("video")?"video":"other"}(t.type)&&this.enableCropper?(this.filesForCropper.push(t),this.currentCropperFile||this.openCropper(t)):this.isValidSize(t,t.size)&&this.pushFile(t)}isValidUploadType(t){return!!this.fileValidatorService.isValidUploadType(this.files,this.uploadType)||(this.validationError.next({file:t,error:m.uploadType}),!1)}isValidMaxFileCount(t){return!!this.fileValidatorService.isValidMaxFileCount(this.fileMaxCount,t,this.files)||(this.validationError.next({file:null,error:m.fileMaxCount}),!1)}pushFile(t,i=t.name){const a=[...this.files,{file:t,fileName:i}];this.setFiles(a),this.fileAdded.next({file:t,fileName:i}),this.changeRef.detectChanges()}setFiles(t){this.files=t,this.changeRef.detectChanges()}openCropper(t){window.CROPPER||typeof Cropper<"u"?(this.safeCropImgUrl=this.fileService.createSafeUrl(t),this.currentCropperFile=t,this.changeRef.detectChanges()):console.warn("please import cropperjs script and styles to use cropper feature or disable it by setting [enableCropper]='false'")}cropperImgLoaded(t){const i=document.getElementById("cropper-img");this.cropper=new Cropper(i,this.cropperOptions)}closeCropper(t){this.currentCropperFile=void 0,this.cropper=void 0,this.changeRef.detectChanges(),setTimeout(()=>this._cropClosed$.next(t),200)}removeFileFromList(t){const i=this.files.filter(o=>o.fileName!==t.fileName);this.setFiles(i),this.fileRemoved.next(t),this.changeRef.detectChanges()}isValidExtension(t,i){return!!this.fileValidatorService.isValidExtension(i,this.fileExtensions)||(this.validationError.next({file:t,error:m.extensions}),!1)}isValidSize(t,i){const o=this.fileValidatorService.isValidFileSize(i,this.fileMaxSize),a=this.fileValidatorService.isValidTotalFileSize(t,this.files,this.totalMaxSize);return o||this.validationError.next({file:t,error:m.fileMaxSize}),a||this.validationError.next({file:t,error:m.totalMaxSize}),o&&a}onCropSubmit(){const t=function T(n){let p=(""+n).trim().toLowerCase(),t=p.lastIndexOf(".");return I[~t?p.substring(++t):p]}(this.currentCropperFile.name);if(!t)throw new Error("mimeType not found");this.isCroppingBusy=!0,this.cropper.getCroppedCanvas(this.croppedCanvasOptions).toBlob(this._blobFallBack.bind(this),t)}_blobFallBack(t){t&&(this.isValidSize(t,t.size)&&this.pushFile(t,this.currentCropperFile.name),this.closeCropper({file:t,fileName:this.currentCropperFile.name}),this.isCroppingBusy=!1,this.changeRef.detectChanges())}static{this.\u0275fac=function(i){return new(i||n)(e.rXU(x),e.rXU(pe),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["ngx-awesome-uploader"]],inputs:{customValidator:"customValidator",enableCropper:"enableCropper",showeDragDropZone:"showeDragDropZone",showPreviewContainer:"showPreviewContainer",itemTemplate:"itemTemplate",uploadType:"uploadType",fileMaxSize:"fileMaxSize",fileMaxCount:"fileMaxCount",totalMaxSize:"totalMaxSize",accept:"accept",fileExtensions:"fileExtensions",cropperOptions:"cropperOptions",croppedCanvasOptions:"croppedCanvasOptions",adapter:"adapter",dropzoneTemplate:"dropzoneTemplate",captions:"captions",enableAutoUpload:"enableAutoUpload",fileInputCapture:"fileInputCapture"},outputs:{uploadSuccess:"uploadSuccess",uploadFail:"uploadFail",removeSuccess:"removeSuccess",validationError:"validationError",fileAdded:"fileAdded",fileRemoved:"fileRemoved"},ngContentSelectors:te,decls:6,vars:9,consts:[["class","file-drop-wrapper",3,"click",4,"ngIf"],["type","file","name","file[]","id","fileInput",1,"file-input",3,"multiple","accept","click","change"],["fileInput",""],["class","cropperJsOverlay",4,"ngIf"],[1,"files-preview-wrapper",3,"ngClass"],[3,"previewFiles","adapter","itemTemplate","captions","enableAutoUpload","removeFile","uploadSuccess","uploadFail",4,"ngIf"],[1,"file-drop-wrapper",3,"click"],[3,"customstyle","captions","onFileDrop"],[1,"cropperJsOverlay"],[1,"cropperJsBox"],["id","cropper-img",3,"src","load"],[1,"cropper-actions"],["type","button",1,"cropSubmit",3,"disabled","ngClass","click"],["type","button",1,"cropCancel",3,"click"],[3,"previewFiles","adapter","itemTemplate","captions","enableAutoUpload","removeFile","uploadSuccess","uploadFail"]],template:function(i,o){if(1&i){const a=e.RV6();e.NAR(ee),e.DNE(0,Q,3,2,"div",0),e.j41(1,"input",1,2),e.bIt("click",function(){e.eBV(a);const r=e.sdS(2);return e.Njj(r.value=null)})("change",function(){e.eBV(a);const r=e.sdS(2);return e.Njj(o.onChange(r.files))}),e.k0s(),e.DNE(3,K,8,7,"div",3),e.j41(4,"div",4),e.DNE(5,W,1,5,"file-preview-container",5),e.k0s()}2&i&&(e.Y8G("ngIf",o.showeDragDropZone),e.R7$(1),e.Y8G("multiple","multi"===o.uploadType?"multiple":"")("accept",o.accept),e.BMQ("capture",o.fileInputCapture),e.R7$(2),e.Y8G("ngIf",o.currentCropperFile),e.R7$(1),e.Y8G("ngClass",e.eq3(7,w,!o.showPreviewContainer)),e.R7$(1),e.Y8G("ngIf",o.files))},dependencies:[c.YU,c.bT,C,ue],styles:['*[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;width:100%;height:100%;overflow:auto;max-width:440px;border-radius:6px}.files-preview-wrapper[_ngcontent-%COMP%]{width:100%}#cropper-img[_ngcontent-%COMP%]{max-width:60vw;display:none}#cropper-img[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%}.file-drop-wrapper[_ngcontent-%COMP%]{width:100%;background:#fafbfd;padding-top:20px}.preview-container[_ngcontent-%COMP%]{display:flex}.cropperJsOverlay[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;position:fixed;z-index:999;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,.32)}.cropperJsBox[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;max-height:calc(100vh - 88px);max-width:90vw}.cropperJsBox[_ngcontent-%COMP%] .cropper-actions[_ngcontent-%COMP%]{display:flex}.cropperJsBox[_ngcontent-%COMP%] .cropper-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin:5px;padding:12px 25px;border-radius:6px;border:0;cursor:pointer}.cropperJsBox[_ngcontent-%COMP%] .cropper-actions[_ngcontent-%COMP%] .cropSubmit[_ngcontent-%COMP%]{color:#fff;background:#16a085} .cropper img{max-height:300px!important}#images[_ngcontent-%COMP%]{display:flex;justify-content:center;width:500px;overflow-x:auto}#images[_ngcontent-%COMP%] .image[_ngcontent-%COMP%]{flex:0 0 100px;margin:0 2px;display:flex;flex-direction:column;align-items:flex-end}#fileInput[_ngcontent-%COMP%]{display:none}.uploader-submit-btn[_ngcontent-%COMP%]{background:#ffd740;color:#000000de;border:0;padding:0 16px;line-height:36px;font-size:15px;margin-top:12px;border-radius:4px;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;cursor:pointer}button[_ngcontent-%COMP%]:disabled{color:#00000042;background:gainsboro}.visually-hidden[_ngcontent-%COMP%]{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;outline:0;-webkit-appearance:none;-moz-appearance:none}button.is-loading[_ngcontent-%COMP%]{color:#00000042!important;background-color:#fff!important;box-shadow:none;cursor:not-allowed;outline:none}button.is-loading[_ngcontent-%COMP%]:after{content:"";font-family:sans-serif;font-weight:100;animation:1.25s linear infinite _ngcontent-%COMP%_three-quarters;border:3px solid #7f8c8d;border-right-color:transparent;border-radius:100%;box-sizing:border-box;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;text-indent:-9999px;width:18px;height:18px;opacity:1;margin-left:10px}@keyframes _ngcontent-%COMP%_three-quarters{0%{transform:rotate(0)}to{transform:rotate(360deg)}}'],changeDetection:0})}}return n})(),he=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=e.$C({type:n,bootstrap:[C]})}static{this.\u0275inj=e.G2t({imports:[c.MD]})}}return n})(),xe=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=e.$C({type:n})}static{this.\u0275inj=e.G2t({providers:[x],imports:[c.MD,he]})}}return n})()}}]);