-
Notifications
You must be signed in to change notification settings - Fork 11
/
chunk-2LBKIA5W.js
1 lines (1 loc) · 25.6 KB
/
chunk-2LBKIA5W.js
1
import{a as Ht,b as Wt}from"./chunk-U6B6NZRZ.js";import{c as $t}from"./chunk-4F3F27BT.js";import{a as Bt,b as At,d as qt}from"./chunk-HVFPNQ3B.js";import{A as G,Ca as Et,Ea as Pt,Fa as kt,J as St,a as Nt,c as It,d as Dt,e as Rt,ec as Vt,f as Ot,gc as jt,ia as J,ja as K}from"./chunk-YWVGY2C2.js";import{$b as lt,Ac as W,Ba as y,Bc as Q,Ca as w,Cc as X,E as ft,Gc as f,Hc as Z,Hd as mt,Ib as q,Jb as yt,Jc as Y,La as nt,Ma as zt,Ob as wt,Pb as p,Qa as xt,Qc as st,Rc as P,Ud as Mt,Vb as v,Vd as _t,Wb as s,Xb as H,Xd as tt,Yb as E,Zb as Tt,Zd as ut,_b as ot,_c as U,a as et,aa as $,ac as vt,ba as O,c as L,da as gt,dc as u,ed as pt,f as A,fc as Ft,gc as Ut,hc as bt,ic as h,id as S,ja as Ct,jc as g,jd as ct,kc as T,mb as V,nc as Lt,o as R,oa as M,oc as b,rb as c,rc as F,s as k,sb as N,tc as a,td as dt,uc as at,vc as rt,ya as it,z as ht}from"./chunk-GBKJFEQZ.js";import{a as B}from"./chunk-EQDQRRRY.js";var Yt=["file"],Gt=["nz-upload-btn",""],Xt=["*"],j=e=>({$implicit:e}),Jt=()=>({opacity:.5,"pointer-events":"none"});function Kt(e,l){}function te(e,l){if(e&1&&(h(0,"div",16),p(1,Kt,0,0,"ng-template",17),g()),e&2){let t=a(2).$implicit,i=f(5);E("ant-upload-list-item-file",!t.isUploading),c(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",P(4,j,t))}}function ee(e,l){if(e&1&&T(0,"img",19),e&2){let t=a(3).$implicit;s("src",t.thumbUrl||t.url,V),v("alt",t.name)}}function ie(e,l){}function ne(e,l){if(e&1&&p(0,ie,0,0,"ng-template",17),e&2){let t=a(3).$implicit,i=f(5);s("ngTemplateOutlet",i)("ngTemplateOutletContext",P(2,j,t))}}function oe(e,l){if(e&1){let t=b();h(0,"a",18),F("click",function(o){y(t);let n=a(2).$implicit,r=a();return w(r.handlePreview(n,o))}),p(1,ee,1,2,"img",19)(2,ne,1,4,null,17),g()}if(e&2){let t=a(2).$implicit;E("ant-upload-list-item-file",!t.isImageUrl),s("href",t.url||t.thumbUrl,V),c(),u(t.isImageUrl?1:2)}}function le(e,l){}function ae(e,l){if(e&1&&(h(0,"div",15),p(1,le,0,0,"ng-template",17),g()),e&2){let t=a(2).$implicit,i=f(5);c(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",P(2,j,t))}}function re(e,l){if(e&1&&p(0,te,2,6,"div",13)(1,oe,3,4,"a",14)(2,ae,2,4,"div",15),e&2){let t,i=a().$implicit;u((t=i.iconType)==="uploading"?0:t==="thumbnail"?1:2)}}function se(e,l){e&1&&T(0,"nz-icon",21)}function pe(e,l){if(e&1&&T(0,"nz-icon",22),e&2){let t=a(3).$implicit;s("nzType",t.isImageUrl?"picture":"file")}}function ce(e,l){if(e&1&&p(0,se,1,0,"nz-icon",21)(1,pe,1,1,"nz-icon",22),e&2){let t=a(2).$implicit;u(t.isUploading?0:1)}}function de(e,l){if(e&1&&Z(0),e&2){let t=a(5);Y(" ",t.locale.uploading," ")}}function me(e,l){if(e&1&&T(0,"nz-icon",22),e&2){let t=a(3).$implicit;s("nzType",t.isImageUrl?"picture":"file")}}function _e(e,l){if(e&1&&p(0,de,1,1)(1,me,1,1,"nz-icon",22),e&2){let t=a(2).$implicit;u(t.isUploading?0:1)}}function ue(e,l){if(e&1&&T(0,"nz-icon",20),e&2){let t=a(2).$implicit;s("nzType",t.isUploading?"loading":"paper-clip")}}function he(e,l){if(e&1&&p(0,ce,2,1)(1,_e,2,1)(2,ue,1,1,"nz-icon",20),e&2){let t,i=a(3);u((t=i.listType)==="picture"?0:t==="picture-card"?1:2)}}function fe(e,l){}function ge(e,l){if(e&1&&p(0,fe,0,0,"ng-template",17),e&2){let t=a().$implicit,i=a(2);s("ngTemplateOutlet",i.iconRender)("ngTemplateOutletContext",P(2,j,t))}}function Ce(e,l){if(e&1&&p(0,he,3,1)(1,ge,1,4,null,17),e&2){let t=a(2);u(t.iconRender?1:0)}}function ze(e,l){if(e&1){let t=b();h(0,"button",24),F("click",function(o){y(t);let n=a(2).$implicit,r=a();return w(r.handleRemove(n,o))}),T(1,"nz-icon",25),g()}if(e&2){let t=a(3);v("title",t.locale.removeFile)}}function xe(e,l){if(e&1&&p(0,ze,2,1,"button",23),e&2){let t=a(2);u(t.icons.showRemoveIcon?0:-1)}}function ye(e,l){if(e&1){let t=b();h(0,"button",24),F("click",function(){y(t);let o=a(2).$implicit,n=a();return w(n.handleDownload(o))}),T(1,"nz-icon",26),g()}if(e&2){let t=a(3);v("title",t.locale.downloadFile)}}function we(e,l){if(e&1&&p(0,ye,2,1,"button",23),e&2){let t=a().$implicit;u(t.showDownload?0:-1)}}function Te(e,l){}function ve(e,l){}function Fe(e,l){if(e&1&&(h(0,"span"),p(1,Te,0,0,"ng-template",10)(2,ve,0,0,"ng-template",10),g()),e&2){a(2);let t=f(7),i=f(9),o=a();lt("ant-upload-list-item-card-actions ",o.listType==="picture"?"picture":"",""),c(),s("ngTemplateOutlet",i),c(),s("ngTemplateOutlet",t)}}function Ue(e,l){if(e&1&&p(0,Fe,3,5,"span",6),e&2){let t=a(2);u(t.listType!=="picture-card"?0:-1)}}function be(e,l){if(e&1){let t=b();h(0,"a",29),F("click",function(o){y(t);let n=a(2).$implicit,r=a();return w(r.handlePreview(n,o))}),Z(1),g()}if(e&2){let t=a(2).$implicit;s("href",t.url,V),v("title",t.name)("download",t.linkProps&&t.linkProps.download),c(),Y(" ",t.name," ")}}function Le(e,l){if(e&1){let t=b();h(0,"span",30),F("click",function(o){y(t);let n=a(2).$implicit,r=a();return w(r.handlePreview(n,o))}),Z(1),g()}if(e&2){let t=a(2).$implicit;v("title",t.name),c(),Y(" ",t.name," ")}}function Ne(e,l){}function Ie(e,l){if(e&1&&p(0,be,2,4,"a",27)(1,Le,2,2,"span",28)(2,Ne,0,0,"ng-template",10),e&2){let t=a().$implicit,i=f(11);u(t.url?0:1),c(2),s("ngTemplateOutlet",i)}}function De(e,l){}function Re(e,l){}function Oe(e,l){if(e&1){let t=b();h(0,"a",32),F("click",function(o){y(t);let n=a(2).$implicit,r=a();return w(r.handlePreview(n,o))}),T(1,"nz-icon",33),g()}if(e&2){let t=a(2).$implicit,i=a();Tt(t.url||t.thumbUrl?null:st(4,Jt)),s("href",t.url||t.thumbUrl,V),v("title",i.locale.previewFile)}}function Se(e,l){}function $e(e,l){if(e&1&&p(0,Se,0,0,"ng-template",10),e&2){a(2);let t=f(9);s("ngTemplateOutlet",t)}}function Ee(e,l){}function Pe(e,l){if(e&1&&(h(0,"span",11),p(1,Oe,2,5,"a",31)(2,$e,1,1,null,10)(3,Ee,0,0,"ng-template",10),g()),e&2){let t=a().$implicit,i=f(7),o=a();c(),u(o.icons.showPreviewIcon?1:-1),c(),u(t.status==="done"?2:-1),c(),s("ngTemplateOutlet",i)}}function ke(e,l){if(e&1&&(h(0,"div",12),T(1,"nz-progress",34),g()),e&2){let t=a().$implicit;c(),s("nzPercent",t.percent)("nzShowInfo",!1)("nzStrokeWidth",2)}}function Me(e,l){if(e&1&&(h(0,"div")(1,"div",7),p(2,re,3,1,"ng-template",null,0,U)(4,Ce,2,1,"ng-template",null,1,U)(6,xe,1,1,"ng-template",null,2,U)(8,we,1,1,"ng-template",null,3,U)(10,Ue,1,1,"ng-template",null,4,U)(12,Ie,3,2,"ng-template",null,5,U),h(14,"div",8)(15,"span",9),p(16,De,0,0,"ng-template",10)(17,Re,0,0,"ng-template",10),g()(),p(18,Pe,4,3,"span",11)(19,ke,2,3,"div",12),g()()),e&2){let t=l.$implicit,i=f(3),o=f(13),n=a();lt("ant-upload-list-",n.listType,"-container"),c(),vt("ant-upload-list-item ant-upload-list-item-",t.status," ant-upload-list-item-list-type-",n.listType,""),s("@itemState",void 0)("nzTooltipTitle",t.status==="error"?t.message:null),v("data-key",t.key),c(15),s("ngTemplateOutlet",i),c(),s("ngTemplateOutlet",o),c(),u(n.listType==="picture-card"&&!t.isUploading?18:-1),c(),u(t.isUploading?19:-1)}}var Ve=["uploadComp"],je=["listComp"],Be=()=>[];function Ae(e,l){if(e&1&&T(0,"nz-upload-list",6,3),e&2){let t=a(2);H("display",t.nzShowUploadList?"":"none"),s("locale",t.locale)("listType",t.nzListType)("items",t.nzFileList||st(13,Be))("icons",t.nzShowUploadList)("iconRender",t.nzIconRender)("previewFile",t.nzPreviewFile)("previewIsImage",t.nzPreviewIsImage)("onPreview",t.nzPreview)("onRemove",t.onRemove)("onDownload",t.nzDownload)("dir",t.dir)}}function qe(e,l){e&1&&Lt(0)}function He(e,l){if(e&1&&p(0,qe,1,0,"ng-container",7),e&2){let t=a(2);s("ngTemplateOutlet",t.nzFileListRender)("ngTemplateOutletContext",P(2,j,t.nzFileList))}}function We(e,l){if(e&1&&p(0,Ae,2,14,"nz-upload-list",5)(1,He,1,4,"ng-container"),e&2){let t=a();u(t.locale&&!t.nzFileListRender?0:-1),c(),u(t.nzFileListRender?1:-1)}}function Qe(e,l){e&1&&rt(0)}function Xe(e,l){}function Ze(e,l){if(e&1&&(h(0,"div")(1,"div",8,4),p(3,Xe,0,0,"ng-template",9),g()()),e&2){let t=a(),i=f(3);ot(t.classList),H("display",t.nzShowButton?"":"none"),c(),s("options",t._btnOptions),c(2),s("ngTemplateOutlet",i)}}function Ye(e,l){}function Ge(e,l){}function Je(e,l){if(e&1){let t=b();h(0,"div",10),F("drop",function(o){y(t);let n=a();return w(n.fileDrop(o))})("dragover",function(o){y(t);let n=a();return w(n.fileDrop(o))})("dragleave",function(o){y(t);let n=a();return w(n.fileDrop(o))}),h(1,"div",11,4)(3,"div",12),p(4,Ye,0,0,"ng-template",9),g()()(),p(5,Ge,0,0,"ng-template",9)}if(e&2){let t=a(),i=f(1),o=f(3);ot(t.classList),c(),s("options",t._btnOptions),c(3),s("ngTemplateOutlet",o),c(),s("ngTemplateOutlet",i)}}function Ke(e,l){}function ti(e,l){}function ei(e,l){if(e&1&&p(0,Ke,0,0,"ng-template",9)(1,ti,0,0,"ng-template",9),e&2){a(2);let t=f(1),i=f(5);s("ngTemplateOutlet",t),c(),s("ngTemplateOutlet",i)}}function ii(e,l){}function ni(e,l){}function oi(e,l){if(e&1&&p(0,ii,0,0,"ng-template",9)(1,ni,0,0,"ng-template",9),e&2){a(2);let t=f(1),i=f(5);s("ngTemplateOutlet",i),c(),s("ngTemplateOutlet",t)}}function li(e,l){if(e&1&&p(0,ei,2,2)(1,oi,2,2),e&2){let t=a();u(t.nzListType==="picture-card"?0:1)}}var ai=(()=>{class e{onClick(){this.options.disabled||!this.options.openFileDialogOnClick||this.file.nativeElement.click()}onFileDrop(t){if(this.options.disabled||t.type==="dragover"){t.preventDefault();return}if(this.options.directory)this.traverseFileTree(t.dataTransfer.items);else{let i=Array.prototype.slice.call(t.dataTransfer.files).filter(o=>this.attrAccept(o,this.options.accept));i.length&&this.uploadFiles(i)}t.preventDefault()}onChange(t){if(this.options.disabled)return;let i=t.target;this.uploadFiles(i.files),i.value=""}traverseFileTree(t){let i=(o,n)=>{o.isFile?o.file(r=>{this.attrAccept(r,this.options.accept)&&this.uploadFiles([r])}):o.isDirectory&&o.createReader().readEntries(m=>{for(let _ of m)i(_,`${n}${o.name}/`)})};for(let o of t)i(o.webkitGetAsEntry(),"")}attrAccept(t,i){if(t&&i){let o=Array.isArray(i)?i:i.split(","),n=`${t.name}`,r=`${t.type}`,m=r.replace(/\/.*$/,"");return o.some(_=>{let C=_.trim();return C.charAt(0)==="."?n.toLowerCase().indexOf(C.toLowerCase(),n.toLowerCase().length-C.toLowerCase().length)!==-1:/\/\*$/.test(C)?m===C.replace(/\/.*$/,""):r===C})}return!0}attachUid(t){return t.uid||(t.uid=Math.random().toString(36).substring(2)),t}uploadFiles(t){let i=R(Array.prototype.slice.call(t));this.options.filters&&this.options.filters.forEach(o=>{i=i.pipe($(n=>{let r=o.fn(n);return r instanceof L?r:R(r)}))}),i.subscribe(o=>{o.forEach(n=>{this.attachUid(n),this.upload(n,o)})},o=>{G("Unhandled upload filter error",o)})}upload(t,i){if(!this.options.beforeUpload)return this.post(t);let o=this.options.beforeUpload(t,i);if(o instanceof L)o.subscribe(n=>{let r=Object.prototype.toString.call(n);r==="[object File]"||r==="[object Blob]"?(this.attachUid(n),this.post(n)):typeof n=="boolean"&&n!==!1&&this.post(t)},n=>{G("Unhandled upload beforeUpload error",n)});else if(o!==!1)return this.post(t)}post(t){if(this.destroy)return;let i=R(t),o,n=this.options,{uid:r}=t,{action:m,data:_,headers:C,transformFile:D}=n,x={action:typeof m=="string"?m:"",name:n.name,headers:C,file:t,postFile:t,data:_,withCredentials:n.withCredentials,onProgress:n.onProgress?d=>{n.onProgress(d,t)}:void 0,onSuccess:(d,z)=>{this.clean(r),n.onSuccess(d,t,z)},onError:d=>{this.clean(r),n.onError(d,t)}};if(typeof m=="function"){let d=m(t);d instanceof L?i=i.pipe($(()=>d),k(z=>(x.action=z,t))):x.action=d}if(typeof D=="function"){let d=D(t);i=i.pipe($(()=>d instanceof L?d:R(d)),gt(z=>o=z))}if(typeof _=="function"){let d=_(t);d instanceof L?i=i.pipe($(()=>d),k(z=>(x.data=z,o??t))):x.data=d}if(typeof C=="function"){let d=C(t);d instanceof L?i=i.pipe($(()=>d),k(z=>(x.headers=z,o??t))):x.headers=d}i.subscribe(d=>{x.postFile=d;let z=(n.customRequest||this.xhr).call(this,x);z instanceof et||G("Must return Subscription type in '[nzCustomRequest]' property"),this.reqs[r]=z,n.onStart(t)})}xhr(t){let i=new FormData;t.data&&Object.keys(t.data).map(n=>{i.append(n,t.data[n])}),i.append(t.name,t.postFile),t.headers||(t.headers={}),t.headers["X-Requested-With"]!==null?t.headers["X-Requested-With"]="XMLHttpRequest":delete t.headers["X-Requested-With"];let o=new It("POST",t.action,i,{reportProgress:!0,withCredentials:t.withCredentials,headers:new Nt(t.headers)});return this.http.request(o).subscribe(n=>{n.type===Dt.UploadProgress?(n.total>0&&(n.percent=n.loaded/n.total*100),t.onProgress(n,t.file)):n instanceof Rt&&t.onSuccess(n.body,t.file,n)},n=>{this.abort(t.file),t.onError(n,t.file)})}clean(t){let i=this.reqs[t];i instanceof et&&i.unsubscribe(),delete this.reqs[t]}abort(t){t?this.clean(t&&t.uid):Object.keys(this.reqs).forEach(i=>this.clean(i))}constructor(t){if(this.elementRef=t,this.reqs={},this.destroy=!1,this.destroy$=new A,this.http=M(Ot,{optional:!0}),!this.http)throw new Error("Not found 'HttpClient', You can configure 'HttpClient' with 'provideHttpClient()' in your root module.")}ngOnInit(){J(this.elementRef.nativeElement,"click").pipe(O(this.destroy$)).subscribe(()=>this.onClick()),J(this.elementRef.nativeElement,"keydown").pipe(O(this.destroy$)).subscribe(t=>{this.options.disabled||(t.key==="Enter"||t.keyCode===13)&&this.onClick()})}ngOnDestroy(){this.destroy=!0,this.destroy$.next(),this.abort()}static{this.\u0275fac=function(i){return new(i||e)(N(xt))}}static{this.\u0275cmp=q({type:e,selectors:[["","nz-upload-btn",""]],viewQuery:function(i,o){if(i&1&&W(Yt,7),i&2){let n;Q(n=X())&&(o.file=n.first)}},hostAttrs:[1,"ant-upload"],hostVars:4,hostBindings:function(i,o){i&1&&F("drop",function(r){return o.onFileDrop(r)})("dragover",function(r){return o.onFileDrop(r)}),i&2&&(v("tabindex","0")("role","button"),E("ant-upload-disabled",o.options.disabled))},inputs:{options:"options"},exportAs:["nzUploadBtn"],attrs:Gt,ngContentSelectors:Xt,decls:3,vars:6,consts:[["file",""],["type","file",3,"change","multiple"]],template:function(i,o){if(i&1){let n=b();at(),h(0,"input",1,0),F("change",function(m){return y(n),w(o.onChange(m))}),g(),rt(2)}i&2&&(H("display","none"),s("multiple",o.options.multiple),v("accept",o.options.accept)("directory",o.options.directory?"directory":null)("webkitdirectory",o.options.directory?"webkitdirectory":null))},encapsulation:2})}}return e})(),Qt=e=>!!e&&e.indexOf("image/")===0,I=200,Zt=(()=>{class e{get showPic(){return this.listType==="picture"||this.listType==="picture-card"}set items(t){this.list=t}genErr(t){return t.response&&typeof t.response=="string"?t.response:t.error&&t.error.statusText||this.locale.uploadError}extname(t){let i=t.split("/"),n=i[i.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]}isImageUrl(t){if(Qt(t.type))return!0;let i=t.thumbUrl||t.url||"";if(!i)return!1;let o=this.extname(i);return/^data:image\//.test(i)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg)$/i.test(o)?!0:/^data:/.test(i)?!1:!o}getIconType(t){return this.showPic?t.isUploading||!t.thumbUrl&&!t.url?"uploading":"thumbnail":""}previewImage(t){if(!Qt(t.type)||!this.platform.isBrowser)return R("");let i=this.document.createElement("canvas");i.width=I,i.height=I,i.style.cssText=`position: fixed; left: 0; top: 0; width: ${I}px; height: ${I}px; z-index: 9999; display: none;`,this.document.body.appendChild(i);let o=i.getContext("2d"),n=new Image,r=URL.createObjectURL(t);return n.src=r,ht(n,"load").pipe(k(()=>{let{width:m,height:_}=n,C=I,D=I,x=0,d=0;m<_?(D=_*(I/m),d=-(D-C)/2):(C=m*(I/_),x=-(C-D)/2);try{o.drawImage(n,x,d,C,D)}catch{}let z=i.toDataURL();return this.document.body.removeChild(i),URL.revokeObjectURL(r),z}))}genThumb(){if(!this.platform.isBrowser)return;let t=window;!this.showPic||typeof document>"u"||typeof t>"u"||!t.FileReader||!t.File||this.list.filter(i=>i.originFileObj instanceof File&&i.thumbUrl===void 0).forEach(i=>{i.thumbUrl="";let o=(this.previewFile?this.previewFile(i):this.previewImage(i.originFileObj)).pipe(O(this.destroy$));this.ngZone.runOutsideAngular(()=>{o.subscribe(n=>{this.ngZone.run(()=>{i.thumbUrl=n,this.detectChanges()})})})})}showDownload(t){return!!(this.icons.showDownloadIcon&&t.status==="done")}fixData(){this.list.forEach(t=>{t.isUploading=t.status==="uploading",t.message=this.genErr(t),t.linkProps=typeof t.linkProps=="string"?JSON.parse(t.linkProps):t.linkProps,t.isImageUrl=this.previewIsImage?this.previewIsImage(t):this.isImageUrl(t),t.iconType=this.getIconType(t),t.showDownload=this.showDownload(t)})}handlePreview(t,i){if(this.onPreview)return i.preventDefault(),this.onPreview(t)}handleRemove(t,i){i.preventDefault(),this.onRemove&&this.onRemove(t)}handleDownload(t){typeof this.onDownload=="function"?this.onDownload(t):t.url&&window.open(t.url)}constructor(t,i,o){this.cdr=t,this.ngZone=i,this.platform=o,this.list=[],this.locale={},this.iconRender=null,this.dir="ltr",this.document=M(dt),this.destroy$=new A}detectChanges(){this.fixData(),this.cdr.detectChanges()}ngOnChanges(){this.fixData(),this.genThumb()}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||e)(N(pt),N(zt),N(K))}}static{this.\u0275cmp=q({type:e,selectors:[["nz-upload-list"]],hostAttrs:[1,"ant-upload-list"],hostVars:8,hostBindings:function(i,o){i&2&&E("ant-upload-list-rtl",o.dir==="rtl")("ant-upload-list-text",o.listType==="text")("ant-upload-list-picture",o.listType==="picture")("ant-upload-list-picture-card",o.listType==="picture-card")},inputs:{locale:"locale",listType:"listType",items:"items",icons:"icons",onPreview:"onPreview",onRemove:"onRemove",onDownload:"onDownload",previewFile:"previewFile",previewIsImage:"previewIsImage",iconRender:"iconRender",dir:"dir"},exportAs:["nzUploadList"],features:[it],decls:2,vars:0,consts:[["icon",""],["iconNode",""],["removeIcon",""],["downloadIcon",""],["downloadOrDelete",""],["preview",""],[3,"class"],["nz-tooltip","",3,"nzTooltipTitle"],[1,"ant-upload-list-item-info"],[1,"ant-upload-span"],[3,"ngTemplateOutlet"],[1,"ant-upload-list-item-actions"],[1,"ant-upload-list-item-progress"],[1,"ant-upload-list-item-thumbnail",3,"ant-upload-list-item-file"],["target","_blank","rel","noopener noreferrer",1,"ant-upload-list-item-thumbnail",3,"ant-upload-list-item-file","href"],[1,"ant-upload-text-icon"],[1,"ant-upload-list-item-thumbnail"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["target","_blank","rel","noopener noreferrer",1,"ant-upload-list-item-thumbnail",3,"click","href"],[1,"ant-upload-list-item-image",3,"src"],[3,"nzType"],["nzType","loading"],["nzTheme","twotone",3,"nzType"],["type","button","nz-button","","nzType","text","nzSize","small",1,"ant-upload-list-item-card-actions-btn"],["type","button","nz-button","","nzType","text","nzSize","small",1,"ant-upload-list-item-card-actions-btn",3,"click"],["nzType","delete"],["nzType","download"],["target","_blank","rel","noopener noreferrer",1,"ant-upload-list-item-name",3,"href"],[1,"ant-upload-list-item-name"],["target","_blank","rel","noopener noreferrer",1,"ant-upload-list-item-name",3,"click","href"],[1,"ant-upload-list-item-name",3,"click"],["target","_blank","rel","noopener noreferrer",3,"href","style"],["target","_blank","rel","noopener noreferrer",3,"click","href"],["nzType","eye"],["nzType","line",3,"nzPercent","nzShowInfo","nzStrokeWidth"]],template:function(i,o){i&1&&Ut(0,Me,20,14,"div",6,Ft),i&2&&bt(o.list)},dependencies:[jt,Vt,mt,Pt,Et,qt,At,Bt,Wt,Ht],encapsulation:2,data:{animation:[Mt("itemState",[ut(":enter",[tt({height:"0",width:"0",opacity:0}),_t(150,tt({height:"*",width:"*",opacity:1}))]),ut(":leave",[_t(150,tt({height:"0",width:"0",opacity:0}))])])]},changeDetection:0})}}return e})(),ri=(()=>{class e{set nzShowUploadList(t){this._showUploadList=typeof t=="boolean"?St(t):t}get nzShowUploadList(){return this._showUploadList}zipOptions(){typeof this.nzShowUploadList=="boolean"&&this.nzShowUploadList&&(this.nzShowUploadList={showPreviewIcon:!0,showRemoveIcon:!0,showDownloadIcon:!0});let t=this.nzFilter.slice();if(this.nzMultiple&&this.nzLimit>0&&t.findIndex(i=>i.name==="limit")===-1&&t.push({name:"limit",fn:i=>i.slice(-this.nzLimit)}),this.nzSize>0&&t.findIndex(i=>i.name==="size")===-1&&t.push({name:"size",fn:i=>i.filter(o=>o.size/1024<=this.nzSize)}),this.nzFileType&&this.nzFileType.length>0&&t.findIndex(i=>i.name==="type")===-1){let i=this.nzFileType.split(",");t.push({name:"type",fn:o=>o.filter(n=>~i.indexOf(n.type))})}return this._btnOptions={disabled:this.nzDisabled,accept:this.nzAccept,action:this.nzAction,directory:this.nzDirectory,openFileDialogOnClick:this.nzOpenFileDialogOnClick,beforeUpload:this.nzBeforeUpload,customRequest:this.nzCustomRequest,data:this.nzData,headers:this.nzHeaders,name:this.nzName,multiple:this.nzMultiple,withCredentials:this.nzWithCredentials,filters:t,transformFile:this.nzTransformFile,onStart:this.onStart,onProgress:this.onProgress,onSuccess:this.onSuccess,onError:this.onError},this}constructor(t,i,o){this.cdr=t,this.i18n=i,this.directionality=o,this.destroy$=new A,this.dir="ltr",this.nzType="select",this.nzLimit=0,this.nzSize=0,this.nzDirectory=!1,this.nzOpenFileDialogOnClick=!0,this.nzFilter=[],this.nzFileList=[],this.nzDisabled=!1,this.nzListType="text",this.nzMultiple=!1,this.nzName="file",this._showUploadList=!0,this.document=M(dt),this.nzShowButton=!0,this.nzWithCredentials=!1,this.nzIconRender=null,this.nzFileListRender=null,this.nzChange=new nt,this.nzFileListChange=new nt,this.platform=M(K),this.onStart=n=>{this.nzFileList||(this.nzFileList=[]);let r=this.fileToObject(n);r.status="uploading",this.nzFileList=this.nzFileList.concat(r),this.nzFileListChange.emit(this.nzFileList),this.nzChange.emit({file:r,fileList:this.nzFileList,type:"start"}),this.detectChangesList()},this.onProgress=(n,r)=>{let m=this.nzFileList,_=this.getFileItem(r,m);_.percent=n.percent,this.nzChange.emit({event:n,file:B({},_),fileList:this.nzFileList,type:"progress"}),this.detectChangesList()},this.onSuccess=(n,r)=>{let m=this.nzFileList,_=this.getFileItem(r,m);_.status="done",_.response=n,this.nzChange.emit({file:B({},_),fileList:m,type:"success"}),this.detectChangesList()},this.onError=(n,r)=>{let m=this.nzFileList,_=this.getFileItem(r,m);_.error=n,_.status="error",this.nzChange.emit({file:B({},_),fileList:m,type:"error"}),this.detectChangesList()},this.onRemove=n=>{this.uploadComp.abort(n),n.status="removed";let r=typeof this.nzRemove=="function"?this.nzRemove(n):this.nzRemove==null?!0:this.nzRemove;(r instanceof L?r:R(r)).pipe(ft(m=>m)).subscribe(()=>{this.nzFileList=this.removeFileItem(n,this.nzFileList),this.nzChange.emit({file:n,fileList:this.nzFileList,type:"removed"}),this.nzFileListChange.emit(this.nzFileList),this.cdr.detectChanges()})},this.prefixCls="ant-upload",this.classList=[]}fileToObject(t){return{lastModified:t.lastModified,lastModifiedDate:t.lastModifiedDate,name:t.filename||t.name,size:t.size,type:t.type,uid:t.uid,response:t.response,error:t.error,percent:0,originFileObj:t}}getFileItem(t,i){return i.filter(o=>o.uid===t.uid)[0]}removeFileItem(t,i){return i.filter(o=>o.uid!==t.uid)}fileDrop(t){t.type!==this.dragState&&(this.dragState=t.type,this.setClassMap())}detectChangesList(){this.cdr.detectChanges(),this.listComp?.detectChanges()}setClassMap(){let t=[];this.nzType==="drag"?(this.nzFileList.some(i=>i.status==="uploading")&&t.push(`${this.prefixCls}-drag-uploading`),this.dragState==="dragover"&&t.push(`${this.prefixCls}-drag-hover`)):t=[`${this.prefixCls}-select-${this.nzListType}`],this.classList=[this.prefixCls,`${this.prefixCls}-${this.nzType}`,...t,this.nzDisabled&&`${this.prefixCls}-disabled`||"",this.dir==="rtl"&&`${this.prefixCls}-rtl`||""].filter(i=>!!i),this.cdr.detectChanges()}ngOnInit(){this.dir=this.directionality.value,this.directionality.change?.pipe(O(this.destroy$)).subscribe(t=>{this.dir=t,this.setClassMap(),this.cdr.detectChanges()}),this.i18n.localeChange.pipe(O(this.destroy$)).subscribe(()=>{this.locale=this.i18n.getLocaleData("Upload"),this.detectChangesList()})}ngAfterViewInit(){this.platform.FIREFOX&&J(this.document.body,"drop").pipe(O(this.destroy$)).subscribe(t=>{t.preventDefault(),t.stopPropagation()})}ngOnChanges(){this.zipOptions().setClassMap()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||e)(N(pt),N($t),N(kt))}}static{this.\u0275cmp=q({type:e,selectors:[["nz-upload"]],viewQuery:function(i,o){if(i&1&&(W(Ve,5),W(je,5)),i&2){let n;Q(n=X())&&(o.uploadComp=n.first),Q(n=X())&&(o.listComp=n.first)}},hostVars:2,hostBindings:function(i,o){i&2&&E("ant-upload-picture-card-wrapper",o.nzListType==="picture-card")},inputs:{nzType:"nzType",nzLimit:[2,"nzLimit","nzLimit",ct],nzSize:[2,"nzSize","nzSize",ct],nzFileType:"nzFileType",nzAccept:"nzAccept",nzAction:"nzAction",nzDirectory:[2,"nzDirectory","nzDirectory",S],nzOpenFileDialogOnClick:[2,"nzOpenFileDialogOnClick","nzOpenFileDialogOnClick",S],nzBeforeUpload:"nzBeforeUpload",nzCustomRequest:"nzCustomRequest",nzData:"nzData",nzFilter:"nzFilter",nzFileList:"nzFileList",nzDisabled:[2,"nzDisabled","nzDisabled",S],nzHeaders:"nzHeaders",nzListType:"nzListType",nzMultiple:[2,"nzMultiple","nzMultiple",S],nzName:"nzName",nzShowUploadList:"nzShowUploadList",nzShowButton:[2,"nzShowButton","nzShowButton",S],nzWithCredentials:[2,"nzWithCredentials","nzWithCredentials",S],nzRemove:"nzRemove",nzPreview:"nzPreview",nzPreviewFile:"nzPreviewFile",nzPreviewIsImage:"nzPreviewIsImage",nzTransformFile:"nzTransformFile",nzDownload:"nzDownload",nzIconRender:"nzIconRender",nzFileListRender:"nzFileListRender"},outputs:{nzChange:"nzChange",nzFileListChange:"nzFileListChange"},exportAs:["nzUpload"],features:[wt,it],ngContentSelectors:Xt,decls:8,vars:1,consts:[["list",""],["con",""],["btn",""],["listComp",""],["uploadComp",""],[3,"display","locale","listType","items","icons","iconRender","previewFile","previewIsImage","onPreview","onRemove","onDownload","dir"],[3,"locale","listType","items","icons","iconRender","previewFile","previewIsImage","onPreview","onRemove","onDownload","dir"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nz-upload-btn","",3,"options"],[3,"ngTemplateOutlet"],[3,"drop","dragover","dragleave"],["nz-upload-btn","",1,"ant-upload-btn",3,"options"],[1,"ant-upload-drag-container"]],template:function(i,o){i&1&&(at(),p(0,We,2,2,"ng-template",null,0,U)(2,Qe,1,0,"ng-template",null,1,U)(4,Ze,4,6,"ng-template",null,2,U)(6,Je,6,5)(7,li,2,1)),i&2&&(c(6),u(o.nzType==="drag"?6:7))},dependencies:[Zt,mt,ai],encapsulation:2,changeDetection:0})}}return e})(),ki=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=yt({type:e})}static{this.\u0275inj=Ct({imports:[ri,Zt]})}}return e})();export{ri as a,ki as b};