UNPKG

@rero/sonar-ui

Version:

User interface for SONAR.

1 lines 88.4 kB
import{a as _i,b as fi}from"./chunk-5VFGEJYA.js";import{$a as de,$b as qe,Aa as I,Ab as Lt,Ad as Zt,B as ne,Ba as c,Bb as Et,Cb as xe,Cc as Ot,Ce as ri,D as oe,Db as Ut,Dc as Vt,Ea as ye,Eb as X,F as fe,Fa as Ve,G as C,Ga as T,Ge as Me,H as b,Ha as F,Hc as J,I as x,Ic as Ie,Ie as si,J as O,Ja as vt,Jc as ee,Je as pi,Ka as Ct,Kc as Se,La as nt,Lb as me,M,Ma as Re,Mc as Be,Me as ci,N as _t,Na as yt,Nb as Te,Nc as ue,O as he,Oa as L,Oe as di,P as ft,Pa as $,Pc as N,Pd as Jt,Q as P,Qa as Ee,Qd as Yt,Ra as Pe,Rc as Rt,Re as mi,Sa as Ne,Tc as we,Ua as bt,Ub as Qe,Uc as Pt,V as Oe,Va as xt,Wa as Tt,Wb as je,Wc as Nt,X as d,Xa as Ft,Xd as Xt,Xe as ui,Ya as It,Za as $e,Zb as kt,_ as D,_b as He,a as W,ab as St,ac as Fe,ba as ge,bb as be,bd as $t,be as ke,c as l,ca as H,cb as ot,ce as Ke,da as u,db as Ae,dd as st,fa as E,fb as Bt,fd as At,fe as ei,g as ct,gd as zt,ge as ti,h as pe,hd as We,he as ii,ia as B,ib as wt,id as _e,j as ie,ja as w,jb as S,jc as q,jd as Qt,k as dt,ka as ht,kb as U,la as et,lb as Ue,ma as ve,na as Ce,nc as Mt,ne as ni,oa as p,ob as k,oc as at,oe as oi,p as De,pa as f,qa as h,qd as jt,r as mt,ra as g,rb as ze,rd as Ht,s as ut,sa as tt,sb as le,sd as qt,se as Ze,ta as it,tb as G,te as li,ua as ce,ub as lt,va as A,wa as z,wc as rt,wd as Gt,xa as K,xc as Ge,xd as Wt,ya as V,yb as R,z as Y,za as gt,zb as ae,zc as Dt,zd as Kt,ze as ai}from"./chunk-OW4VQFLY.js";var Ni=["data-p-icon","angle-double-down"],hi=(()=>{let o=class o extends we{};l(o,"\u0275fac",(()=>{let r;return function(i){return(r||(r=P(o)))(i||o)}})()),l(o,"\u0275cmp",D({type:o,selectors:[["","data-p-icon","angle-double-down"]],features:[H],attrs:Ni,decls:1,vars:0,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M6.70786 6.59831C6.80043 6.63674 6.89974 6.65629 6.99997 6.65581C7.19621 6.64081 7.37877 6.54953 7.50853 6.40153L11.0685 2.8416C11.1364 2.69925 11.1586 2.53932 11.132 2.38384C11.1053 2.22837 11.0311 2.08498 10.9195 1.97343C10.808 1.86188 10.6646 1.78766 10.5091 1.76099C10.3536 1.73431 10.1937 1.75649 10.0513 1.82448L6.99997 4.87585L3.9486 1.82448C3.80625 1.75649 3.64632 1.73431 3.49084 1.76099C3.33536 1.78766 3.19197 1.86188 3.08043 1.97343C2.96888 2.08498 2.89466 2.22837 2.86798 2.38384C2.84131 2.53932 2.86349 2.69925 2.93147 2.8416L6.46089 6.43205C6.53132 6.50336 6.61528 6.55989 6.70786 6.59831ZM6.70786 12.1925C6.80043 12.2309 6.89974 12.2505 6.99997 12.25C7.10241 12.2465 7.20306 12.2222 7.29575 12.1785C7.38845 12.1348 7.47124 12.0726 7.53905 11.9957L11.0685 8.46629C11.1614 8.32292 11.2036 8.15249 11.1881 7.98233C11.1727 7.81216 11.1005 7.6521 10.9833 7.52781C10.866 7.40353 10.7104 7.3222 10.5415 7.29688C10.3725 7.27155 10.1999 7.30369 10.0513 7.38814L6.99997 10.4395L3.9486 7.38814C3.80006 7.30369 3.62747 7.27155 3.45849 7.29688C3.28951 7.3222 3.13393 7.40353 3.01667 7.52781C2.89942 7.6521 2.82729 7.81216 2.81184 7.98233C2.79639 8.15249 2.83852 8.32292 2.93148 8.46629L6.4609 12.0262C6.53133 12.0975 6.61529 12.1541 6.70786 12.1925Z","fill","currentColor"]],template:function(n,i){n&1&&(O(),ce(0,"path",0))},encapsulation:2}));let t=o;return t})();var $i=["data-p-icon","angle-double-up"],gi=(()=>{let o=class o extends we{};l(o,"\u0275fac",(()=>{let r;return function(i){return(r||(r=P(o)))(i||o)}})()),l(o,"\u0275cmp",D({type:o,selectors:[["","data-p-icon","angle-double-up"]],features:[H],attrs:$i,decls:1,vars:0,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M10.1504 6.67719C10.2417 6.71508 10.3396 6.73436 10.4385 6.73389C10.6338 6.74289 10.8249 6.67441 10.97 6.54334C11.1109 6.4023 11.19 6.21112 11.19 6.01178C11.19 5.81245 11.1109 5.62127 10.97 5.48023L7.45977 1.96998C7.31873 1.82912 7.12755 1.75 6.92821 1.75C6.72888 1.75 6.5377 1.82912 6.39666 1.96998L2.9165 5.45014C2.83353 5.58905 2.79755 5.751 2.81392 5.91196C2.83028 6.07293 2.89811 6.22433 3.00734 6.34369C3.11656 6.46306 3.26137 6.54402 3.42025 6.57456C3.57914 6.60511 3.74364 6.5836 3.88934 6.51325L6.89813 3.50446L9.90691 6.51325C9.97636 6.58357 10.0592 6.6393 10.1504 6.67719ZM9.93702 11.9993C10.065 12.1452 10.245 12.2352 10.4385 12.25C10.632 12.2352 10.812 12.1452 10.9399 11.9993C11.0633 11.8614 11.1315 11.6828 11.1315 11.4978C11.1315 11.3128 11.0633 11.1342 10.9399 10.9963L7.48987 7.48609C7.34883 7.34523 7.15765 7.26611 6.95832 7.26611C6.75899 7.26611 6.5678 7.34523 6.42677 7.48609L2.91652 10.9963C2.84948 11.1367 2.82761 11.2944 2.85391 11.4477C2.88022 11.601 2.9534 11.7424 3.06339 11.8524C3.17338 11.9624 3.31477 12.0356 3.46808 12.0619C3.62139 12.0882 3.77908 12.0663 3.91945 11.9993L6.92823 8.99048L9.93702 11.9993Z","fill","currentColor"]],template:function(n,i){n&1&&(O(),ce(0,"path",0))},encapsulation:2}));let t=o;return t})();var Ai=["data-p-icon","upload"],vi=(()=>{let o=class o extends we{constructor(){super(...arguments);l(this,"pathId")}onInit(){this.pathId="url(#"+Ge()+")"}};l(o,"\u0275fac",(()=>{let n;return function(s){return(n||(n=P(o)))(s||o)}})()),l(o,"\u0275cmp",D({type:o,selectors:[["","data-p-icon","upload"]],features:[H],attrs:Ai,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,s){i&1&&(O(),tt(0,"g"),ce(1,"path",0),it(),tt(2,"defs")(3,"clipPath",1),ce(4,"rect",2),it()()),i&2&&(E("clip-path",s.pathId),d(3),gt("id",s.pathId))},encapsulation:2}));let t=o;return t})();var re={production:!0,projectTitle:"Swiss Open Access Repository",apiBaseUrl:"",$refPrefix:"https://sonar.ch",globalViewName:"global",languages:["fr","de","it","en"],translationsURLs:["/static/node_modules/@rero/sonar-ui/dist/sonar/browser/assets/i18n/${lang}.json","/api/translations/${lang}.json"]};var Je=(()=>{let o=class o extends di{constructor(){super(),this.maxFileSize=500*1024*1024,this.languagesMap=[{code:"en",bibCode:"eng"},{code:"fr",bibCode:"fre"},{code:"de",bibCode:"ger"},{code:"it",bibCode:"ita"}],this.production=re.production,this.apiBaseUrl=re.apiBaseUrl,this.$refPrefix=re.$refPrefix,this.globalviewName=re.globalViewName,this.languages=re.languages,this.projectTitle=re.projectTitle,this.schemaFormEndpoint="/schemas",this.translationsURLs=re.translationsURLs}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=oe({token:o,factory:o.\u0275fac,providedIn:"root"});let t=o;return t})();var Ci="\n .p-progressbar {\n display: block;\n position: relative;\n overflow: hidden;\n height: dt('progressbar.height');\n background: dt('progressbar.background');\n border-radius: dt('progressbar.border.radius');\n }\n\n .p-progressbar-value {\n margin: 0;\n background: dt('progressbar.value.background');\n }\n\n .p-progressbar-label {\n color: dt('progressbar.label.color');\n font-size: dt('progressbar.label.font.size');\n font-weight: dt('progressbar.label.font.weight');\n }\n\n .p-progressbar-determinate .p-progressbar-value {\n height: 100%;\n width: 0%;\n position: absolute;\n display: none;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transition: width 1s ease-in-out;\n }\n\n .p-progressbar-determinate .p-progressbar-label {\n display: inline-flex;\n }\n\n .p-progressbar-indeterminate .p-progressbar-value::before {\n content: '';\n position: absolute;\n background: inherit;\n inset-block-start: 0;\n inset-inline-start: 0;\n inset-block-end: 0;\n will-change: inset-inline-start, inset-inline-end;\n animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n }\n\n .p-progressbar-indeterminate .p-progressbar-value::after {\n content: '';\n position: absolute;\n background: inherit;\n inset-block-start: 0;\n inset-inline-start: 0;\n inset-block-end: 0;\n will-change: inset-inline-start, inset-inline-end;\n animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n animation-delay: 1.15s;\n }\n\n @keyframes p-progressbar-indeterminate-anim {\n 0% {\n inset-inline-start: -35%;\n inset-inline-end: 100%;\n }\n 60% {\n inset-inline-start: 100%;\n inset-inline-end: -90%;\n }\n 100% {\n inset-inline-start: 100%;\n inset-inline-end: -90%;\n }\n }\n @-webkit-keyframes p-progressbar-indeterminate-anim {\n 0% {\n inset-inline-start: -35%;\n inset-inline-end: 100%;\n }\n 60% {\n inset-inline-start: 100%;\n inset-inline-end: -90%;\n }\n 100% {\n inset-inline-start: 100%;\n inset-inline-end: -90%;\n }\n }\n\n @keyframes p-progressbar-indeterminate-anim-short {\n 0% {\n inset-inline-start: -200%;\n inset-inline-end: 100%;\n }\n 60% {\n inset-inline-start: 107%;\n inset-inline-end: -8%;\n }\n 100% {\n inset-inline-start: 107%;\n inset-inline-end: -8%;\n }\n }\n @-webkit-keyframes p-progressbar-indeterminate-anim-short {\n 0% {\n inset-inline-start: -200%;\n inset-inline-end: 100%;\n }\n 60% {\n inset-inline-start: 107%;\n inset-inline-end: -8%;\n }\n 100% {\n inset-inline-start: 107%;\n inset-inline-end: -8%;\n }\n }\n";var zi=["content"],Qi=t=>({$implicit:t});function ji(t,o){if(t&1&&(f(0,"div"),$(1),h()),t&2){let e=c(2);Re("display",e.value!=null&&e.value!==0?"flex":"none"),d(),Ne("",e.value,"",e.unit)}}function Hi(t,o){t&1&&K(0)}function qi(t,o){if(t&1&&(f(0,"div",2)(1,"div",2),u(2,ji,2,4,"div",3)(3,Hi,1,0,"ng-container",4),h()()),t&2){let e=c();L(e.cn(e.cx("value"),e.valueStyleClass)),Re("width",e.value+"%")("display","flex")("background",e.color),p("pBind",e.ptm("value")),E("data-p",e.dataP),d(),L(e.cx("label")),p("pBind",e.ptm("label")),E("data-p",e.dataP),d(),p("ngIf",e.showValue&&!e.contentTemplate&&!e._contentTemplate),d(),p("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)("ngTemplateOutletContext",be(17,Qi,e.value))}}function Gi(t,o){if(t&1&&g(0,"div",2),t&2){let e=c();L(e.cn(e.cx("value"),e.valueStyleClass)),Re("background",e.color),p("pBind",e.ptm("value")),E("data-p",e.dataP)}}var Wi={root:({instance:t})=>["p-progressbar p-component",{"p-progressbar-determinate":t.mode=="determinate","p-progressbar-indeterminate":t.mode=="indeterminate"}],value:"p-progressbar-value",label:"p-progressbar-label"},yi=(()=>{let o=class o extends Se{constructor(){super(...arguments);l(this,"name","progressbar");l(this,"style",Ci);l(this,"classes",Wi)}};l(o,"\u0275fac",(()=>{let n;return function(s){return(n||(n=P(o)))(s||o)}})()),l(o,"\u0275prov",oe({token:o,factory:o.\u0275fac}));let t=o;return t})();var bi=new fe("PROGRESSBAR_INSTANCE"),Si=(()=>{var o;let e=class e extends ue{constructor(){super(...arguments);l(this,"componentName","ProgressBar");l(this,"$pcProgressBar",(o=C(bi,{optional:!0,skipSelf:!0}))!=null?o:void 0);l(this,"bindDirectiveInstance",C(N,{self:!0}));l(this,"value");l(this,"showValue",!0);l(this,"styleClass");l(this,"valueStyleClass");l(this,"unit","%");l(this,"mode","determinate");l(this,"color");l(this,"contentTemplate");l(this,"_componentStyle",C(yi));l(this,"templates");l(this,"_contentTemplate")}onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}onAfterContentInit(){var i;(i=this.templates)==null||i.forEach(s=>{s.getType()==="content"?this._contentTemplate=s.template:this._contentTemplate=s.template})}get dataP(){return this.cn({determinate:this.mode==="determinate",indeterminate:this.mode==="indeterminate"})}};l(e,"\u0275fac",(()=>{let i;return function(a){return(i||(i=P(e)))(a||e)}})()),l(e,"\u0275cmp",D({type:e,selectors:[["p-progressBar"],["p-progressbar"],["p-progress-bar"]],contentQueries:function(s,a,m){if(s&1&&ye(m,zi,4)(m,J,4),s&2){let _;T(_=F())&&(a.contentTemplate=_.first),T(_=F())&&(a.templates=_)}},hostAttrs:["role","progressbar"],hostVars:7,hostBindings:function(s,a){s&2&&(E("aria-valuemin",0)("aria-valuenow",a.value)("aria-valuemax",100)("aria-level",a.value+a.unit)("data-p",a.dataP),L(a.cn(a.cx("root"),a.styleClass)))},inputs:{value:[2,"value","value",ae],showValue:[2,"showValue","showValue",R],styleClass:"styleClass",valueStyleClass:"valueStyleClass",unit:"unit",mode:"mode",color:"color"},features:[de([yi,{provide:bi,useExisting:e},{provide:Be,useExisting:e}]),ge([N]),H],decls:2,vars:2,consts:[[3,"class","pBind","width","display","background",4,"ngIf"],[3,"class","pBind","background",4,"ngIf"],[3,"pBind"],[3,"display",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(s,a){s&1&&u(0,qi,4,19,"div",0)(1,Gi,1,6,"div",1),s&2&&(p("ngIf",a.mode==="determinate"),d(),p("ngIf",a.mode==="indeterminate"))},dependencies:[me,xe,X,Ie,N],encapsulation:2,changeDetection:0}));let t=e;return t})();var Bi="\n .p-fileupload input[type='file'] {\n display: none;\n }\n\n .p-fileupload-advanced {\n border: 1px solid dt('fileupload.border.color');\n border-radius: dt('fileupload.border.radius');\n background: dt('fileupload.background');\n color: dt('fileupload.color');\n }\n\n .p-fileupload-header {\n display: flex;\n align-items: center;\n padding: dt('fileupload.header.padding');\n background: dt('fileupload.header.background');\n color: dt('fileupload.header.color');\n border-style: solid;\n border-width: dt('fileupload.header.border.width');\n border-color: dt('fileupload.header.border.color');\n border-radius: dt('fileupload.header.border.radius');\n gap: dt('fileupload.header.gap');\n }\n\n .p-fileupload-content {\n border: 1px solid transparent;\n display: flex;\n flex-direction: column;\n gap: dt('fileupload.content.gap');\n transition: border-color dt('fileupload.transition.duration');\n padding: dt('fileupload.content.padding');\n }\n\n .p-fileupload-content .p-progressbar {\n width: 100%;\n height: dt('fileupload.progressbar.height');\n }\n\n .p-fileupload-file-list {\n display: flex;\n flex-direction: column;\n gap: dt('fileupload.filelist.gap');\n }\n\n .p-fileupload-file {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n padding: dt('fileupload.file.padding');\n border-block-end: 1px solid dt('fileupload.file.border.color');\n gap: dt('fileupload.file.gap');\n }\n\n .p-fileupload-file:last-child {\n border-block-end: 0;\n }\n\n .p-fileupload-file-info {\n display: flex;\n flex-direction: column;\n gap: dt('fileupload.file.info.gap');\n }\n\n .p-fileupload-file-thumbnail {\n flex-shrink: 0;\n }\n\n .p-fileupload-file-actions {\n margin-inline-start: auto;\n }\n\n .p-fileupload-highlight {\n border: 1px dashed dt('fileupload.content.highlight.border.color');\n }\n\n .p-fileupload-basic .p-message {\n margin-block-end: dt('fileupload.basic.gap');\n }\n\n .p-fileupload-basic-content {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: dt('fileupload.basic.gap');\n }\n";var Ki=["pFileContent",""],Zi=(t,o,e)=>({class:t,file:o,index:e}),Ji=(t,o)=>(o==null?null:o.name)+"-"+t;function Yi(t,o){}function Xi(t,o){t&1&&u(0,Yi,0,0,"ng-template")}function en(t,o){if(t&1&&u(0,Xi,1,0,null,7),t&2){let e=c().class,r=c(),n=r.$implicit,i=r.$index,s=c();p("ngTemplateOutlet",s.fileRemoveIconTemplate())("ngTemplateOutletContext",Ae(2,Zi,e,n,i))}}function tn(t,o){if(t&1&&(O(),g(0,"svg",8)),t&2){let e=c().class;L(e),E("aria-hidden",!0)}}function nn(t,o){if(t&1&&B(0,en,1,6)(1,tn,1,3,":svg:svg",6),t&2){let e=c(2);w(e.fileRemoveIconTemplate()?0:1)}}function on(t,o){if(t&1){let e=V();f(0,"div",2),g(1,"img",3),f(2,"div",2)(3,"div",2),$(4),h(),f(5,"span",2),$(6),h()(),g(7,"p-badge",4),f(8,"div",2)(9,"p-button",5),I("onClick",function(n){let i=b(e).$index,s=c();return x(s.onRemoveClick(n,i))}),u(10,nn,2,1,"ng-template",null,0,k),h()()()}if(t&2){let e=o.$implicit,r=c();L(r.cx("file")),p("pBind",r.$pcFileUpload.ptm("file")),d(),L(r.cx("fileThumbnail")),p("src",e.objectURL,Oe)("width",r.previewWidth())("pBind",r.$pcFileUpload.ptm("fileThumbnail")),E("alt",e.name),d(),L(r.cx("fileInfo")),p("pBind",r.$pcFileUpload.ptm("fileInfo")),d(),L(r.cx("fileName")),p("pBind",r.$pcFileUpload.ptm("fileName")),d(),Ee(e.name),d(),L(r.cx("fileSize")),p("pBind",r.$pcFileUpload.ptm("fileSize")),d(),Ee(r.formatSize(e.size)),d(),L(r.cx("pcFileBadge")),p("value",r.badgeValue())("severity",r.badgeSeverity())("pt",r.$pcFileUpload.ptm("pcFileBadge"))("unstyled",r.unstyled()),d(),L(r.cx("fileActions")),p("pBind",r.$pcFileUpload.ptm("fileActions")),d(),p("styleClass",r.cx("pcFileRemoveButton"))("pt",r.$pcFileUpload.ptm("pcFileRemoveButton"))("unstyled",r.unstyled())}}var ln=["file"],an=["header"],wi=["content"],rn=["toolbar"],sn=["chooseicon"],pn=["filelabel"],cn=["uploadicon"],dn=["cancelicon"],mn=["empty"],un=["advancedfileinput"],_n=["basicfileinput"],fn=(t,o,e,r,n)=>({$implicit:t,uploadedFiles:o,chooseCallback:e,clearCallback:r,uploadCallback:n}),hn=(t,o,e,r,n,i,s,a)=>({$implicit:t,uploadedFiles:o,chooseCallback:e,clearCallback:r,removeUploadedFileCallback:n,removeFileCallback:i,progress:s,messages:a}),gn=t=>({$implicit:t});function vn(t,o){if(t&1&&g(0,"span",8),t&2){let e,r=c(4);L(r.chooseIcon),p("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon),E("aria-label",!0)}}function Cn(t,o){if(t&1&&(O(),g(0,"svg",17)),t&2){let e,r=c(5);p("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon),E("aria-label",!0)}}function yn(t,o){}function bn(t,o){t&1&&u(0,yn,0,0,"ng-template")}function xn(t,o){if(t&1&&(f(0,"span",8),u(1,bn,1,0,null,11),h()),t&2){let e,r=c(5);p("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon),E("aria-label",!0),d(),p("ngTemplateOutlet",r.chooseIconTemplate||r._chooseIconTemplate)}}function Tn(t,o){if(t&1&&(A(0),u(1,Cn,1,2,"svg",15)(2,xn,2,3,"span",16),z()),t&2){let e=c(4);d(),p("ngIf",!e.chooseIconTemplate&&!e._chooseIconTemplate),d(),p("ngIf",e.chooseIconTemplate||e._chooseIconTemplate)}}function Fn(t,o){if(t&1&&u(0,vn,1,4,"span",5)(1,Tn,3,2,"ng-container",9),t&2){let e=c(3);p("ngIf",e.chooseIcon),d(),p("ngIf",!e.chooseIcon)}}function In(t,o){if(t&1&&g(0,"span",20),t&2){let e,r=c(5);p("ngClass",r.uploadIcon)("pBind",(e=r.ptm("pcUploadButton"))==null?null:e.icon),E("aria-hidden",!0)}}function Sn(t,o){if(t&1&&(O(),g(0,"svg",22)),t&2){let e,r=c(6);p("pBind",(e=r.ptm("pcUploadButton"))==null?null:e.icon)}}function Bn(t,o){}function wn(t,o){t&1&&u(0,Bn,0,0,"ng-template")}function Ln(t,o){if(t&1&&(f(0,"span",8),u(1,wn,1,0,null,11),h()),t&2){let e,r=c(6);p("pBind",(e=r.ptm("pcUploadButton"))==null?null:e.icon),E("aria-hidden",!0),d(),p("ngTemplateOutlet",r.uploadIconTemplate||r._uploadIconTemplate)}}function En(t,o){if(t&1&&(A(0),u(1,Sn,1,1,"svg",21)(2,Ln,2,3,"span",16),z()),t&2){let e=c(5);d(),p("ngIf",!e.uploadIconTemplate&&!e._uploadIconTemplate),d(),p("ngIf",e.uploadIconTemplate||e._uploadIconTemplate)}}function Un(t,o){if(t&1&&u(0,In,1,3,"span",19)(1,En,3,2,"ng-container",9),t&2){let e=c(4);p("ngIf",e.uploadIcon),d(),p("ngIf",!e.uploadIcon)}}function kn(t,o){if(t&1){let e=V();f(0,"p-button",18),I("onClick",function(){b(e);let n=c(3);return x(n.upload())}),u(1,Un,2,2,"ng-template",null,2,k),h()}if(t&2){let e=c(3);p("label",e.uploadButtonLabel)("disabled",!e.hasFiles()||e.isFileLimitExceeded())("styleClass",e.cn(e.cx("pcUploadButton"),e.uploadStyleClass))("buttonProps",e.uploadButtonProps)("pt",e.ptm("pcUploadButton"))("unstyled",e.unstyled())}}function Mn(t,o){if(t&1&&g(0,"span",24),t&2){let e=c(5);p("ngClass",e.cancelIcon)}}function Dn(t,o){t&1&&(O(),g(0,"svg",26)),t&2&&E("aria-hidden",!0)}function On(t,o){}function Vn(t,o){t&1&&u(0,On,0,0,"ng-template")}function Rn(t,o){if(t&1&&(f(0,"span"),u(1,Vn,1,0,null,11),h()),t&2){let e=c(6);E("aria-hidden",!0),d(),p("ngTemplateOutlet",e.cancelIconTemplate||e._cancelIconTemplate)}}function Pn(t,o){if(t&1&&(A(0),u(1,Dn,1,1,"svg",25)(2,Rn,2,2,"span",9),z()),t&2){let e=c(5);d(),p("ngIf",!e.cancelIconTemplate&&!e._cancelIconTemplate),d(),p("ngIf",e.cancelIconTemplate||e._cancelIconTemplate)}}function Nn(t,o){if(t&1&&u(0,Mn,1,1,"span",23)(1,Pn,3,2,"ng-container",9),t&2){let e=c(4);p("ngIf",e.cancelIcon),d(),p("ngIf",!e.cancelIcon)}}function $n(t,o){if(t&1){let e=V();f(0,"p-button",18),I("onClick",function(){b(e);let n=c(3);return x(n.clear())}),u(1,Nn,2,2,"ng-template",null,2,k),h()}if(t&2){let e=c(3);p("label",e.cancelButtonLabel)("disabled",!e.hasFiles()||e.uploading)("styleClass",e.cn(e.cx("pcCancelButton"),e.cancelStyleClass))("buttonProps",e.cancelButtonProps)("pt",e.ptm("pcCancelButton"))("unstyled",e.unstyled())}}function An(t,o){if(t&1){let e=V();A(0),f(1,"p-button",13),I("focus",function(){b(e);let n=c(2);return x(n.onFocus())})("blur",function(){b(e);let n=c(2);return x(n.onBlur())})("onClick",function(){b(e);let n=c(2);return x(n.choose())})("keydown.enter",function(){b(e);let n=c(2);return x(n.choose())}),f(2,"input",7,0),I("change",function(n){b(e);let i=c(2);return x(i.onFileSelect(n))}),h(),u(4,Fn,2,2,"ng-template",null,2,k),h(),u(6,kn,3,6,"p-button",14)(7,$n,3,6,"p-button",14),z()}if(t&2){let e=c(2);d(),p("styleClass",e.cn(e.cx("pcChooseButton"),e.chooseStyleClass))("disabled",e.disabled||e.isChooseDisabled())("label",e.chooseButtonLabel)("buttonProps",e.chooseButtonProps)("pt",e.ptm("pcChooseButton"))("unstyled",e.unstyled()),d(),p("multiple",e.multiple)("accept",e.accept)("disabled",e.disabled||e.isChooseDisabled())("pBind",e.ptm("input")),E("aria-label",e.browseFilesLabel)("title",""),d(4),p("ngIf",!e.auto&&e.showUploadButton),d(),p("ngIf",!e.auto&&e.showCancelButton)}}function zn(t,o){t&1&&K(0)}function Qn(t,o){t&1&&K(0)}function jn(t,o){t&1&&K(0)}function Hn(t,o){if(t&1&&u(0,jn,1,0,"ng-container",10),t&2){let e=c(2);p("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)("ngTemplateOutletContext",wt(2,hn,e.files,e.uploadedFiles,e.choose.bind(e),e.clear.bind(e),e.removeUploadedFile.bind(e),e.remove.bind(e),e.progress,e.msgs))}}function qn(t,o){if(t&1&&g(0,"p-progressbar",30),t&2){let e=c(3);p("value",e.progress)("showValue",!1)("pt",e.ptm("pcProgressBar"))}}function Gn(t,o){if(t&1&&g(0,"p-message",28),t&2){let e=o.$implicit,r=c(3);p("severity",e.severity)("text",e.text)("pt",r.ptm("pcMessage"))("unstyled",r.unstyled())}}function Wn(t,o){}function Kn(t,o){if(t&1){let e=V();f(0,"div",33),I("onRemove",function(n){b(e);let i=c(4);return x(i.onRemoveClick(n))}),h()}if(t&2){let e=c(4);p("unstyled",e.unstyled())("files",e.files)("badgeValue",e.pendingLabel)("previewWidth",e.previewWidth)("fileRemoveIconTemplate",e.cancelIconTemplate||e._cancelIconTemplate)}}function Zn(t,o){if(t&1&&(f(0,"div",8),u(1,Wn,0,0,"ng-template",31),B(2,Kn,1,5,"div",32),h()),t&2){let e=c(3);L(e.cx("fileList")),p("pBind",e.ptm("fileList")),d(),p("ngForOf",e.files)("ngForTemplate",e.fileTemplate||e._fileTemplate),d(),w(!e.fileTemplate&&!e._fileTemplate?2:-1)}}function Jn(t,o){}function Yn(t,o){if(t&1){let e=V();f(0,"div",35),I("onRemove",function(n){b(e);let i=c(4);return x(i.onRemoveUploadedFileClick(n))}),h()}if(t&2){let e=c(4);p("unstyled",e.unstyled())("files",e.uploadedFiles)("badgeValue",e.completedLabel())("previewWidth",e.previewWidth)("fileRemoveIconTemplate",e.cancelIconTemplate||e._cancelIconTemplate)}}function Xn(t,o){if(t&1&&(f(0,"div",8),u(1,Jn,0,0,"ng-template",31),B(2,Yn,1,5,"div",34),h()),t&2){let e=c(3);L(e.cx("fileList")),p("pBind",e.ptm("fileList")),d(),p("ngForOf",e.uploadedFiles)("ngForTemplate",e.fileTemplate||e._fileTemplate),d(),w(!e.fileTemplate&&!e._fileTemplate?2:-1)}}function eo(t,o){if(t&1&&(u(0,qn,1,3,"p-progressbar",27),ve(1,Gn,1,4,"p-message",28,et),B(3,Zn,3,6,"div",29),B(4,Xn,3,6,"div",29)),t&2){let e=c(2);p("ngIf",e.hasFiles()),d(),Ce(e.msgs),d(2),w(e.hasFiles()?3:-1),d(),w(e.hasUploadedFiles()?4:-1)}}function to(t,o){if(t&1&&K(0,8),t&2){let e=c(3);p("pBind",e.ptm("empty"))}}function io(t,o){if(t&1&&u(0,to,1,1,"ng-container",36),t&2){let e=c(2);p("ngTemplateOutlet",e.emptyTemplate||e._emptyTemplate)}}function no(t,o){if(t&1){let e=V();f(0,"div",6)(1,"input",7,0),I("change",function(n){b(e);let i=c();return x(i.onFileSelect(n))}),h(),f(3,"div",8),u(4,An,8,14,"ng-container",9)(5,zn,1,0,"ng-container",10)(6,Qn,1,0,"ng-container",11),h(),f(7,"div",12,1),I("dragenter",function(n){b(e);let i=c();return x(i.onDragEnter(n))})("dragleave",function(n){b(e);let i=c();return x(i.onDragLeave(n))})("drop",function(n){b(e);let i=c();return x(i.onDrop(n))}),B(9,Hn,1,11,"ng-container")(10,eo,5,3),B(11,io,1,1,"ng-container",8),h()()}if(t&2){let e=c();L(e.cn(e.cx("root"),e.styleClass)),p("ngStyle",e.style)("pBind",e.ptm("root")),d(),p("multiple",e.multiple)("accept",e.accept)("disabled",e.disabled||e.isChooseDisabled())("pBind",e.ptm("input")),E("aria-label",e.browseFilesLabel)("title",""),d(2),L(e.cx("header")),p("pBind",e.ptm("header")),d(),p("ngIf",!e.headerTemplate&&!e._headerTemplate),d(),p("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)("ngTemplateOutletContext",Bt(22,fn,e.files,e.uploadedFiles,e.choose.bind(e),e.clear.bind(e),e.upload.bind(e))),d(),p("ngTemplateOutlet",e.toolbarTemplate||e._toolbarTemplate),d(),L(e.cx("content")),p("pBind",e.ptm("content")),d(2),w(e.contentTemplate||e._contentTemplate?9:10),d(2),w((e.emptyTemplate||e._emptyTemplate)&&!e.hasFiles()&&!e.hasUploadedFiles()?11:-1)}}function oo(t,o){if(t&1&&g(0,"p-message",28),t&2){let e=o.$implicit,r=c(2);p("severity",e.severity)("text",e.text)("pt",r.ptm("pcMessage"))("unstyled",r.unstyled())}}function lo(t,o){if(t&1&&g(0,"span",40),t&2){let e,r=c(4);p("ngClass",r.uploadIcon)("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon)}}function ao(t,o){if(t&1&&(O(),g(0,"svg",22)),t&2){let e,r=c(5);L("p-button-icon p-button-icon-left"),p("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon)}}function ro(t,o){}function so(t,o){t&1&&u(0,ro,0,0,"ng-template")}function po(t,o){if(t&1&&(f(0,"span",43),u(1,so,1,0,null,11),h()),t&2){let e,r=c(5);p("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon),d(),p("ngTemplateOutlet",r._uploadIconTemplate||r.uploadIconTemplate)}}function co(t,o){if(t&1&&(A(0),u(1,ao,1,3,"svg",41)(2,po,2,2,"span",42),z()),t&2){let e=c(4);d(),p("ngIf",!e.uploadIconTemplate&&!e._uploadIconTemplate),d(),p("ngIf",e._uploadIconTemplate||e.uploadIconTemplate)}}function mo(t,o){if(t&1&&u(0,lo,1,2,"span",39)(1,co,3,2,"ng-container",9),t&2){let e=c(3);p("ngIf",e.uploadIcon),d(),p("ngIf",!e.uploadIcon)}}function uo(t,o){if(t&1&&g(0,"span",45),t&2){let e,r=c(4);p("ngClass",r.chooseIcon)("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon)}}function _o(t,o){if(t&1&&(O(),g(0,"svg",17)),t&2){let e,r=c(5);p("pBind",(e=r.ptm("pcChooseButton"))==null?null:e.icon)}}function fo(t,o){}function ho(t,o){t&1&&u(0,fo,0,0,"ng-template")}function go(t,o){if(t&1&&(A(0),u(1,_o,1,1,"svg",15)(2,ho,1,0,null,11),z()),t&2){let e=c(4);d(),p("ngIf",!e.chooseIconTemplate&&!e._chooseIconTemplate),d(),p("ngTemplateOutlet",e.chooseIconTemplate||e._chooseIconTemplate)}}function vo(t,o){if(t&1&&u(0,uo,1,2,"span",44)(1,go,3,2,"ng-container",9),t&2){let e=c(3);p("ngIf",e.chooseIcon),d(),p("ngIf",!e.chooseIcon)}}function Co(t,o){if(t&1&&B(0,mo,2,2)(1,vo,2,2),t&2){let e=c(2);w(e.hasFiles()&&!e.auto?0:1)}}function yo(t,o){if(t&1&&(f(0,"span"),$(1),h()),t&2){let e=c(3);d(),Pe(" ",e.basicFileChosenLabel()," ")}}function bo(t,o){t&1&&K(0)}function xo(t,o){if(t&1&&u(0,bo,1,0,"ng-container",10),t&2){let e=c(3);p("ngTemplateOutlet",e.fileLabelTemplate||e._fileLabelTemplate)("ngTemplateOutletContext",be(2,gn,e.files))}}function To(t,o){if(t&1&&B(0,yo,2,1,"span")(1,xo,1,4,"ng-container"),t&2){let e=c(2);w(!e.fileLabelTemplate&&!e._fileLabelTemplate?0:1)}}function Fo(t,o){if(t&1){let e=V();f(0,"div",8),ve(1,oo,1,4,"p-message",28,et),f(3,"div",8)(4,"p-button",37),I("onClick",function(){b(e);let n=c();return x(n.onBasicUploaderClick())})("keydown",function(n){b(e);let i=c();return x(i.onBasicKeydown(n))}),u(5,Co,2,1,"ng-template",null,2,k),f(7,"input",38,3),I("change",function(n){b(e);let i=c();return x(i.onFileSelect(n))})("focus",function(){b(e);let n=c();return x(n.onFocus())})("blur",function(){b(e);let n=c();return x(n.onBlur())}),h()(),B(9,To,2,1),h()()}if(t&2){let e=c();L(e.cn(e.cx("root"),e.styleClass)),p("pBind",e.ptm("root")),d(),Ce(e.msgs),d(2),L(e.cx("basicContent")),p("pBind",e.ptm("basicContent")),d(),yt(e.style),p("styleClass",e.cn(e.cx("pcChooseButton"),e.chooseStyleClass))("disabled",e.disabled)("label",e.chooseButtonLabel)("buttonProps",e.chooseButtonProps)("pt",e.ptm("pcChooseButton"))("unstyled",e.unstyled()),d(3),p("accept",e.accept)("multiple",e.multiple)("disabled",e.disabled)("pBind",e.ptm("input")),E("aria-label",e.browseFilesLabel),d(2),w(e.auto?-1:9)}}var Io={root:({instance:t})=>"p-fileupload p-fileupload-".concat(t.mode," p-component"),header:"p-fileupload-header",pcChooseButton:"p-fileupload-choose-button",pcUploadButton:"p-fileupload-upload-button",pcCancelButton:"p-fileupload-cancel-button",content:"p-fileupload-content",fileList:"p-fileupload-file-list",file:"p-fileupload-file",fileThumbnail:"p-fileupload-file-thumbnail",fileInfo:"p-fileupload-file-info",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",pcFileBadge:"p-fileupload-file-badge",fileActions:"p-fileupload-file-actions",pcFileRemoveButton:"p-fileupload-file-remove-button",basicContent:"p-fileupload-basic-content"},Ye=(()=>{let o=class o extends Se{constructor(){super(...arguments);l(this,"name","fileupload");l(this,"style",Bi);l(this,"classes",Io)}};l(o,"\u0275fac",(()=>{let n;return function(s){return(n||(n=P(o)))(s||o)}})()),l(o,"\u0275prov",oe({token:o,factory:o.\u0275fac}));let t=o;return t})();var Li=new fe("FILEUPLOAD_INSTANCE"),So=(()=>{let o=class o extends ue{constructor(){super(...arguments);l(this,"_componentStyle",C(Ye));l(this,"$pcFileUpload",C(Li));l(this,"onRemove",le());l(this,"files",G());l(this,"badgeSeverity",G("warn"));l(this,"badgeValue",G());l(this,"previewWidth",G(50));l(this,"fileRemoveIconTemplate",G())}onRemoveClick(n,i){this.onRemove.emit({event:n,index:i})}formatSize(n){let a=this.config.getTranslation(ee.FILE_SIZE_TYPES);if(n===0)return"0 ".concat(a[0]);let m=Math.floor(Math.log(n)/Math.log(1024)),_=(n/Math.pow(1024,m)).toFixed(3);return"".concat(_," ").concat(a[m])}};l(o,"\u0275fac",(()=>{let n;return function(s){return(n||(n=P(o)))(s||o)}})()),l(o,"\u0275cmp",D({type:o,selectors:[["","pFileContent",""]],inputs:{files:[1,"files"],badgeSeverity:[1,"badgeSeverity"],badgeValue:[1,"badgeValue"],previewWidth:[1,"previewWidth"],fileRemoveIconTemplate:[1,"fileRemoveIconTemplate"]},outputs:{onRemove:"onRemove"},features:[de([Ye]),H],attrs:Ki,decls:2,vars:0,consts:[["icon",""],[3,"class","pBind"],[3,"pBind"],["role","presentation",3,"src","width","pBind"],[3,"value","severity","pt","unstyled"],["text","","rounded","","severity","danger",3,"onClick","styleClass","pt","unstyled"],["data-p-icon","times",3,"class"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["data-p-icon","times"]],template:function(i,s){i&1&&ve(0,on,12,32,"div",1,Ji),i&2&&Ce(s.files())},dependencies:[me,X,Rt,_e,st,N],encapsulation:2,changeDetection:0}));let t=o;return t})(),Xe=(()=>{let o=class o extends ue{constructor(){super(...arguments);l(this,"componentName","FileUpload");l(this,"bindDirectiveInstance",C(N,{self:!0}));l(this,"name");l(this,"url");l(this,"method","post");l(this,"multiple");l(this,"accept");l(this,"disabled");l(this,"auto");l(this,"withCredentials");l(this,"maxFileSize");l(this,"invalidFileSizeMessageSummary","{0}: Invalid file size, ");l(this,"invalidFileSizeMessageDetail","maximum upload size is {0}.");l(this,"invalidFileTypeMessageSummary","{0}: Invalid file type, ");l(this,"invalidFileTypeMessageDetail","allowed file types: {0}.");l(this,"invalidFileLimitMessageDetail","limit is {0} at most.");l(this,"invalidFileLimitMessageSummary","Maximum number of files exceeded, ");l(this,"style");l(this,"styleClass");l(this,"previewWidth",50);l(this,"chooseLabel");l(this,"uploadLabel");l(this,"cancelLabel");l(this,"chooseIcon");l(this,"uploadIcon");l(this,"cancelIcon");l(this,"showUploadButton",!0);l(this,"showCancelButton",!0);l(this,"mode","advanced");l(this,"headers");l(this,"customUpload");l(this,"fileLimit");l(this,"uploadStyleClass");l(this,"cancelStyleClass");l(this,"removeStyleClass");l(this,"chooseStyleClass");l(this,"chooseButtonProps");l(this,"uploadButtonProps",{severity:"secondary"});l(this,"cancelButtonProps",{severity:"secondary"});l(this,"onBeforeUpload",new M);l(this,"onSend",new M);l(this,"onUpload",new M);l(this,"onError",new M);l(this,"onClear",new M);l(this,"onRemove",new M);l(this,"onSelect",new M);l(this,"onProgress",new M);l(this,"uploadHandler",new M);l(this,"onImageError",new M);l(this,"onRemoveUploadedFile",new M);l(this,"fileTemplate");l(this,"headerTemplate");l(this,"contentTemplate");l(this,"toolbarTemplate");l(this,"chooseIconTemplate");l(this,"fileLabelTemplate");l(this,"uploadIconTemplate");l(this,"cancelIconTemplate");l(this,"emptyTemplate");l(this,"advancedFileInput");l(this,"basicFileInput");l(this,"content");l(this,"_files",[]);l(this,"progress",0);l(this,"dragHighlight");l(this,"msgs");l(this,"uploadedFileCount",0);l(this,"focus");l(this,"uploading");l(this,"duplicateIEEvent");l(this,"translationSubscription");l(this,"dragOverListener");l(this,"uploadedFiles",[]);l(this,"sanitizer",C(kt));l(this,"zone",C(_t));l(this,"http",C(je));l(this,"_componentStyle",C(Ye));l(this,"_headerTemplate");l(this,"_contentTemplate");l(this,"_toolbarTemplate");l(this,"_chooseIconTemplate");l(this,"_uploadIconTemplate");l(this,"_cancelIconTemplate");l(this,"_emptyTemplate");l(this,"_fileTemplate");l(this,"_fileLabelTemplate");l(this,"templates")}onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm("host"))}set files(n){this._files=[];for(let i=0;i<n.length;i++){let s=n[i];this.validate(s)&&(this.isImage(s)&&(s.objectURL=this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(n[i]))),this._files.push(n[i]))}}get files(){return this._files}get basicButtonLabel(){var n;return this.auto||!this.hasFiles()?this.chooseLabel:(n=this.uploadLabel)!=null?n:this.files[0].name}onInit(){this.translationSubscription=this.config.translationObserver.subscribe(()=>{this.cd.markForCheck()})}onAfterViewInit(){Te(this.platformId)&&this.mode==="advanced"&&this.zone.runOutsideAngular(()=>{this.content&&(this.dragOverListener=this.renderer.listen(this.content.nativeElement,"dragover",this.onDragOver.bind(this)))})}onAfterContentInit(){var n;(n=this.templates)==null||n.forEach(i=>{switch(i.getType()){case"header":this._headerTemplate=i.template;break;case"file":this._fileTemplate=i.template;break;case"content":this._contentTemplate=i.template;break;case"toolbar":this._toolbarTemplate=i.template;break;case"chooseicon":this._chooseIconTemplate=i.template;break;case"uploadicon":this._uploadIconTemplate=i.template;break;case"cancelicon":this._cancelIconTemplate=i.template;break;case"empty":this._emptyTemplate=i.template;break;case"filelabel":this._fileLabelTemplate=i.template;break;default:this._fileTemplate=i.template;break}})}basicFileChosenLabel(){var n;return this.auto?this.chooseButtonLabel:this.hasFiles()?this.files&&this.files.length===1?this.files[0].name:(n=this.config.getTranslation("fileChosenMessage"))==null?void 0:n.replace("{0}",this.files.length):this.config.getTranslation("noFileChosenMessage")||""}completedLabel(){return this.config.getTranslation("completed")||""}getTranslation(n){return this.config.getTranslation(n)}choose(){var n;(n=this.advancedFileInput)==null||n.nativeElement.click()}onFileSelect(n){if(n.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.multiple||(this.files=[]),this.msgs=[],this.files=this.files||[];let i=n.dataTransfer?n.dataTransfer.files:n.target.files;for(let s=0;s<i.length;s++){let a=i[s];this.isFileSelected(a)||this.validate(a)&&(this.isImage(a)&&(a.objectURL=this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(i[s]))),this.files.push(i[s]))}this.onSelect.emit({originalEvent:n,files:i,currentFiles:this.files}),this.checkFileLimit(i),this.hasFiles()&&this.auto&&(this.mode!=="advanced"||!this.isFileLimitExceeded())&&this.upload(),n.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()}isFileSelected(n){for(let i of this.files)if(i.name+i.type+i.size===n.name+n.type+n.size)return!0;return!1}isIE11(){if(Te(this.platformId))return!!this.document.defaultView.MSInputMethodContext&&!!this.document.documentMode}validate(n){if(this.msgs=this.msgs||[],this.accept&&!this.isFileTypeValid(n)){let i="".concat(this.invalidFileTypeMessageSummary.replace("{0}",n.name)," ").concat(this.invalidFileTypeMessageDetail.replace("{0}",this.accept));return this.msgs.push({severity:"error",text:i}),!1}if(this.maxFileSize&&n.size>this.maxFileSize){let i="".concat(this.invalidFileSizeMessageSummary.replace("{0}",n.name)," ").concat(this.invalidFileSizeMessageDetail.replace("{0}",this.formatSize(this.maxFileSize)));return this.msgs.push({severity:"error",text:i}),!1}return!0}isFileTypeValid(n){var s;let i=(s=this.accept)==null?void 0:s.split(",").map(a=>a.trim());for(let a of i)if(this.isWildcard(a)?this.getTypeClass(n.type)===this.getTypeClass(a):n.type==a||this.getFileExtension(n).toLowerCase()===a.toLowerCase())return!0;return!1}getTypeClass(n){return n.substring(0,n.indexOf("/"))}isWildcard(n){return n.indexOf("*")!==-1}getFileExtension(n){return"."+n.name.split(".").pop()}isImage(n){return/^image\//.test(n.type)}onImageLoad(n){window.URL.revokeObjectURL(n.src)}uploader(){if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.uploadHandler.emit({files:this.files}),this.cd.markForCheck();else{this.uploading=!0,this.msgs=[];let n=new FormData;this.onBeforeUpload.emit({formData:n});for(let i=0;i<this.files.length;i++)n.append(this.name,this.files[i],this.files[i].name);this.http.request(this.method,this.url,{body:n,headers:this.headers,reportProgress:!0,observe:"events",withCredentials:this.withCredentials}).subscribe(i=>{switch(i.type){case Qe.Sent:this.onSend.emit({originalEvent:i,formData:n});break;case Qe.Response:this.uploading=!1,this.progress=0,i.status>=200&&i.status<300?(this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.onUpload.emit({originalEvent:i,files:this.files})):this.onError.emit({files:this.files}),this.uploadedFiles=[...this.uploadedFiles,...this.files],this.clear();break;case Qe.UploadProgress:{i.loaded&&(this.progress=Math.round(i.loaded*100/i.total)),this.onProgress.emit({originalEvent:i,progress:this.progress});break}}this.cd.markForCheck()},i=>{this.uploading=!1,this.onError.emit({files:this.files,error:i})})}}onRemoveClick(n){let{event:i,index:s}=n;this.hasFiles()&&this.remove(i,s)}onRemoveUploadedFileClick(n){let{index:i}=n;this.hasUploadedFiles()&&this.removeUploadedFile(i)}clear(){this.files=[],this.onClear.emit(),this.clearInputElement(),this.msgs=[],this.cd.markForCheck()}remove(n,i){this.clearInputElement(),this.onRemove.emit({originalEvent:n,file:this.files[i]}),this.files.splice(i,1),this.checkFileLimit(this.files)}removeUploadedFile(n){let i=this.uploadedFiles.splice(n,1)[0];this.uploadedFiles=[...this.uploadedFiles],this.onRemoveUploadedFile.emit({file:i,files:this.uploadedFiles})}isFileLimitExceeded(){let i=this.auto?this.files.length:this.files.length+this.uploadedFileCount;return this.fileLimit&&this.fileLimit<=i&&this.focus&&(this.focus=!1),this.fileLimit&&this.fileLimit<i}isChooseDisabled(){return this.auto?this.fileLimit&&this.fileLimit<=this.files.length:this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount}checkFileLimit(n){var s;(s=this.msgs)!=null||(this.msgs=[]);let i=this.msgs.length>0&&this.fileLimit&&this.fileLimit<n.length;if(this.isFileLimitExceeded()||i){let a="".concat(this.invalidFileLimitMessageSummary.replace("{0}",this.fileLimit.toString())," ").concat(this.invalidFileLimitMessageDetail.replace("{0}",this.fileLimit.toString()));this.msgs.push({severity:"error",text:a})}else this.msgs=this.msgs.filter(a=>!a.text.includes(this.invalidFileLimitMessageSummary))}clearInputElement(){this.advancedFileInput&&this.advancedFileInput.nativeElement&&(this.advancedFileInput.nativeElement.value=""),this.basicFileInput&&this.basicFileInput.nativeElement&&(this.basicFileInput.nativeElement.value="")}clearIEInput(){this.advancedFileInput&&this.advancedFileInput.nativeElement&&(this.duplicateIEEvent=!0,this.advancedFileInput.nativeElement.value="")}hasFiles(){return this.files&&this.files.length>0}hasUploadedFiles(){return this.uploadedFiles&&this.uploadedFiles.length>0}onDragEnter(n){this.disabled||(n.stopPropagation(),n.preventDefault())}onDragOver(n){var i,s;this.disabled||(!this.$unstyled()&&Mt((i=this.content)==null?void 0:i.nativeElement,"p-fileupload-highlight"),(s=this.content)==null||s.nativeElement.setAttribute("data-p-highlight",!0),this.dragHighlight=!0,n.stopPropagation(),n.preventDefault())}onDragLeave(n){var i,s;this.disabled||(!this.$unstyled()&&at((i=this.content)==null?void 0:i.nativeElement,"p-fileupload-highlight"),(s=this.content)==null||s.nativeElement.setAttribute("data-p-highlight",!1))}onDrop(n){var i,s;if(!this.disabled){!this.$unstyled()&&at((i=this.content)==null?void 0:i.nativeElement,"p-fileupload-highlight"),(s=this.content)==null||s.nativeElement.setAttribute("data-p-highlight",!1),n.stopPropagation(),n.preventDefault();let a=n.dataTransfer?n.dataTransfer.files:n.target.files;(this.multiple||a&&a.length===1)&&this.onFileSelect(n)}}onFocus(){this.focus=!0}onBlur(){this.focus=!1}formatSize(n){let a=this.getTranslation(ee.FILE_SIZE_TYPES);if(n===0)return"0 ".concat(a[0]);let m=Math.floor(Math.log(n)/Math.log(1024)),_=(n/Math.pow(1024,m)).toFixed(3);return"".concat(_," ").concat(a[m])}upload(){this.hasFiles()&&this.uploader()}onBasicUploaderClick(){var n;(n=this.basicFileInput)==null||n.nativeElement.click()}onBasicKeydown(n){switch(n.code){case"Space":case"Enter":this.onBasicUploaderClick(),n.preventDefault();break}}imageError(n){this.onImageError.emit(n)}getBlockableElement(){return this.el.nativeElement.children[0]}get chooseButtonLabel(){return this.chooseLabel||this.config.getTranslation(ee.CHOOSE)}get uploadButtonLabel(){return this.uploadLabel||this.config.getTranslation(ee.UPLOAD)}get cancelButtonLabel(){return this.cancelLabel||this.config.getTranslation(ee.CANCEL)}get browseFilesLabel(){return this.config.getTranslation(ee.ARIA)[ee.BROWSE_FILES]}get pendingLabel(){return this.config.getTranslation(ee.PENDING)}onDestroy(){this.content&&this.content.nativeElement&&this.dragOverListener&&(this.dragOverListener(),this.dragOverListener=null),this.translationSubscription&&this.translationSubscription.unsubscribe()}};l(o,"\u0275fac",(()=>{let n;return function(s){return(n||(n=P(o)))(s||o)}})()),l(o,"\u0275cmp",D({type:o,selectors:[["p-fileupload"],["p-fileUpload"]],contentQueries:function(i,s,a){if(i&1&&ye(a,ln,4)(a,an,4)(a,wi,4)(a,rn,4)(a,sn,4)(a,pn,4)(a,cn,4)(a,dn,4)(a,mn,4)(a,J,4),i&2){let m;T(m=F())&&(s.fileTemplate=m.first),T(m=F())&&(s.headerTemplate=m.first),T(m=F())&&(s.contentTemplate=m.first),T(m=F())&&(s.toolbarTemplate=m.first),T(m=F())&&(s.chooseIconTemplate=m.first),T(m=F())&&(s.fileLabelTemplate=m.first),T(m=F())&&(s.uploadIconTemplate=m.first),T(m=F())&&(s.cancelIconTemplate=m.first),T(m=F())&&(s.emptyTemplate=m.first),T(m=F())&&(s.templates=m)}},viewQuery:function(i,s){if(i&1&&Ve(un,5)(_n,5)(wi,5),i&2){let a;T(a=F())&&(s.advancedFileInput=a.first),T(a=F())&&(s.basicFileInput=a.first),T(a=F())&&(s.content=a.first)}},inputs:{name:"name",url:"url",method:"method",multiple:[2,"multiple","multiple",R],accept:"accept",disabled:[2,"disabled","disabled",R],auto:[2,"auto","auto",R],withCredentials:[2,"withCredentials","withCredentials",R],maxFileSize:[2,"maxFileSize","maxFileSize",ae],invalidFileSizeMessageSummary:"invalidFileSizeMessageSummary",invalidFileSizeMessageDetail:"invalidFileSizeMessageDetail",invalidFileTypeMessageSummary:"invalidFileTypeMessageSummary",invalidFileTypeMessageDetail:"invalidFileTypeMessageDetail",invalidFileLimitMessageDetail:"invalidFileLimitMessageDetail",invalidFileLimitMessageSummary:"invalidFileLimitMessageSummary",style:"style",styleClass:"styleClass",previewWidth:[2,"previewWidth","previewWidth",ae],chooseLabel:"chooseLabel",uploadLabel:"uploadLabel",cancelLabel:"cancelLabel",chooseIcon:"chooseIcon",uploadIcon:"uploadIcon",cancelIcon:"cancelIcon",showUploadButton:[2,"showUploadButton","showUploadButton",R],showCancelButton:[2,"showCancelButton","showCancelButton",R],mode:"mode",headers:"headers",customUpload:[2,"customUpload","customUpload",R],fileLimit:[2,"fileLimit","fileLimit",n=>ae(n,void 0)],uploadStyleClass:"uploadStyleClass",cancelStyleClass:"cancelStyleClass",removeStyleClass:"removeStyleClass",chooseStyleClass:"chooseStyleClass",chooseButtonProps:"chooseButtonProps",uploadButtonProps:"uploadButtonProps",cancelButtonProps:"cancelButtonProps",files:"files"},outputs:{onBeforeUpload:"onBeforeUpload",onSend:"onSend",onUpload:"onUpload",onError:"onError",onClear:"onClear",onRemove:"onRemove",onSelect:"onSelect",onProgress:"onProgress",uploadHandler:"uploadHandler",onImageError:"onImageError",onRemoveUploadedFile:"onRemoveUploadedFile"},features:[de([Ye,{provide:Li,useExisting:o},{provide:Be,useExisting:o}]),ge([N]),H],decls:2,vars:2,consts:[["advancedfileinput",""],["content",""],["icon",""],["basicfileinput",""],[3,"class","ngStyle","pBind",4,"ngIf"],[3,"class","pBind",4,"ngIf"],[3,"ngStyle","pBind"],["type","file",3,"change","multiple","accept","disabled","pBind"],[3,"pBind"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngTemplateOutlet"],[3,"dragenter","dragleave","drop","pBind"],[3,"focus","blur","onClick","keydown.enter","styleClass","disabled","label","buttonProps","pt","unstyled"],[3,"label","disabled","styleClass","buttonProps","pt","unstyled","onClick",4,"ngIf"],["data-p-icon","plus",3,"pBind",4,"ngIf"],[3,"pBind",4,"ngIf"],["data-p-icon","plus",3,"pBind"],[3,"onClick","label","disabled","styleClass","buttonProps","pt","unstyled"],[3,"ngClass","pBind",4,"ngIf"],[3,"ngClass","pBind"],["data-p-icon","upload",3,"pBind",4,"ngIf"],["data-p-icon","upload",3,"pBind"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],["data-p-icon","times",4,"ngIf"],["data-p-icon","times"],[3,"value","showValue","pt",4,"ngIf"],[3,"severity","text","pt","unstyled"],[3,"class","pBind"],[3,"value","showValue","pt"],["ngFor","",3,"ngForOf","ngForTemplate"],["pFileContent","",3,"unstyled","files","badgeValue","previewWidth","fileRemoveIconTemplate"],["pFileContent","",3,"onRemove","unstyled","files","badgeValue","previewWidth","fileRemoveIconTemplate"],["pFileContent","","badgeSeverity","success",3,"unstyled","files","badgeValue","previewWidth","fileRemoveIconTemplate"],["pFileContent","","badgeSeverity","success",3,"onRemove","unstyled","files","badgeValue","previewWidth","fileRemoveIconTemplate"],[3,"pBind",4,"ngTemplateOutlet"],[3,"onClick","keydown","styleClass","disabled","label","buttonProps","pt","unstyled"],["type","file",3,"change","focus","blur","accept","multiple","disabled","pBind"],["class","p-button-icon p-button-icon-left",3,"ngClass","pBind",4,"ngIf"],[1,"p-button-icon","p-button-icon-left",3,"ngClass","pBind"],["data-p-icon","upload",3,"class","pBind",4,"ngIf"],["class","p-button-icon p-button-icon-left",3,"pBind",4,"ngIf"],[1,"p-button-icon","p-button-icon-left",3,"pBind"],["class","p-button-icon p-button-icon-left pi",3,"ngClass","pBind",4,"ngIf"],[1,"p-button-icon","p-button-icon-left","pi",3,"ngClass","pBind"]],template:function(i,s){i&1&&u(0,no,12,28,"div",4)(1,Fo,10,20,"div",5),i&2&&(p("ng