UNPKG

@rero/rero-ils-ui

Version:

User interface for RERO integrated library system (RERO ILS).

278 lines (234 loc) 27.7 kB
import{a as It,b as wt,c as Mt,e as kt,f as Et,h as z}from"./chunk-4H236NYG.js";import{Ab as x,Bb as T,Be as yt,Ce as O,Gb as i,Hb as h,Ib as _,Jb as u,Kb as I,Kc as gt,Lb as w,Mb as M,Nb as at,Nc as Y,Ne as xt,Ob as rt,Oc as N,Pb as H,Qb as Q,Qe as Tt,Rb as B,Re as J,Sb as D,Se as S,Ta as r,Tb as a,Uc as Z,Ue as P,V as K,Vc as A,W,Wb as lt,Y as tt,Yb as V,Zb as F,_ as C,a as $,bb as ot,da as b,ea as v,ec as ct,fa as p,fc as d,gb as g,gc as R,gd as ft,hb as st,hc as dt,hd as ht,ic as pt,id as _t,kb as it,kd as Ct,la as j,lb as f,ma as et,mb as E,qa as G,rd as X,sa as nt,tc as q,te as U,ue as k,va as y,vc as mt,wc as ut,xb as l,xe as vt,yd as bt}from"./chunk-Q2WBXDIA.js";var Vt=["data-p-icon","exclamation-triangle"],Ot=(()=>{class e extends P{pathId;onInit(){this.pathId="url(#"+k()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=y(e)))(n||e)}})();static \u0275cmp=g({type:e,selectors:[["","data-p-icon","exclamation-triangle"]],features:[f],attrs:Vt,decls:7,vars:2,consts:[["d","M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z","fill","currentColor"],["d","M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z","fill","currentColor"],["d","M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(p(),I(0,"g"),M(1,"path",0)(2,"path",1)(3,"path",2),w(),I(4,"defs")(5,"clipPath",3),M(6,"rect",4),w()()),o&2&&(l("clip-path",n.pathId),r(5),B("id",n.pathId))},encapsulation:2})}return e})();var Ft=["data-p-icon","info-circle"],St=(()=>{class e extends P{pathId;onInit(){this.pathId="url(#"+k()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=y(e)))(n||e)}})();static \u0275cmp=g({type:e,selectors:[["","data-p-icon","info-circle"]],features:[f],attrs:Ft,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(p(),I(0,"g"),M(1,"path",0),w(),I(2,"defs")(3,"clipPath",1),M(4,"rect",2),w()()),o&2&&(l("clip-path",n.pathId),r(3),B("id",n.pathId))},encapsulation:2})}return e})();var Bt=` .p-toast { width: dt('toast.width'); white-space: pre-line; word-break: break-word; } .p-toast-message { margin: 0 0 1rem 0; display: grid; grid-template-rows: 1fr; } .p-toast-message-icon { flex-shrink: 0; font-size: dt('toast.icon.size'); width: dt('toast.icon.size'); height: dt('toast.icon.size'); } .p-toast-message-content { display: flex; align-items: flex-start; padding: dt('toast.content.padding'); gap: dt('toast.content.gap'); min-height: 0; overflow: hidden; transition: padding 250ms ease-in; } .p-toast-message-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: dt('toast.text.gap'); } .p-toast-summary { font-weight: dt('toast.summary.font.weight'); font-size: dt('toast.summary.font.size'); } .p-toast-detail { font-weight: dt('toast.detail.font.weight'); font-size: dt('toast.detail.font.size'); } .p-toast-close-button { display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; cursor: pointer; background: transparent; transition: background dt('toast.transition.duration'), color dt('toast.transition.duration'), outline-color dt('toast.transition.duration'), box-shadow dt('toast.transition.duration'); outline-color: transparent; color: inherit; width: dt('toast.close.button.width'); height: dt('toast.close.button.height'); border-radius: dt('toast.close.button.border.radius'); margin: -25% 0 0 0; right: -25%; padding: 0; border: none; user-select: none; } .p-toast-close-button:dir(rtl) { margin: -25% 0 0 auto; left: -25%; right: auto; } .p-toast-message-info, .p-toast-message-success, .p-toast-message-warn, .p-toast-message-error, .p-toast-message-secondary, .p-toast-message-contrast { border-width: dt('toast.border.width'); border-style: solid; backdrop-filter: blur(dt('toast.blur')); border-radius: dt('toast.border.radius'); } .p-toast-close-icon { font-size: dt('toast.close.icon.size'); width: dt('toast.close.icon.size'); height: dt('toast.close.icon.size'); } .p-toast-close-button:focus-visible { outline-width: dt('focus.ring.width'); outline-style: dt('focus.ring.style'); outline-offset: dt('focus.ring.offset'); } .p-toast-message-info { background: dt('toast.info.background'); border-color: dt('toast.info.border.color'); color: dt('toast.info.color'); box-shadow: dt('toast.info.shadow'); } .p-toast-message-info .p-toast-detail { color: dt('toast.info.detail.color'); } .p-toast-message-info .p-toast-close-button:focus-visible { outline-color: dt('toast.info.close.button.focus.ring.color'); box-shadow: dt('toast.info.close.button.focus.ring.shadow'); } .p-toast-message-info .p-toast-close-button:hover { background: dt('toast.info.close.button.hover.background'); } .p-toast-message-success { background: dt('toast.success.background'); border-color: dt('toast.success.border.color'); color: dt('toast.success.color'); box-shadow: dt('toast.success.shadow'); } .p-toast-message-success .p-toast-detail { color: dt('toast.success.detail.color'); } .p-toast-message-success .p-toast-close-button:focus-visible { outline-color: dt('toast.success.close.button.focus.ring.color'); box-shadow: dt('toast.success.close.button.focus.ring.shadow'); } .p-toast-message-success .p-toast-close-button:hover { background: dt('toast.success.close.button.hover.background'); } .p-toast-message-warn { background: dt('toast.warn.background'); border-color: dt('toast.warn.border.color'); color: dt('toast.warn.color'); box-shadow: dt('toast.warn.shadow'); } .p-toast-message-warn .p-toast-detail { color: dt('toast.warn.detail.color'); } .p-toast-message-warn .p-toast-close-button:focus-visible { outline-color: dt('toast.warn.close.button.focus.ring.color'); box-shadow: dt('toast.warn.close.button.focus.ring.shadow'); } .p-toast-message-warn .p-toast-close-button:hover { background: dt('toast.warn.close.button.hover.background'); } .p-toast-message-error { background: dt('toast.error.background'); border-color: dt('toast.error.border.color'); color: dt('toast.error.color'); box-shadow: dt('toast.error.shadow'); } .p-toast-message-error .p-toast-detail { color: dt('toast.error.detail.color'); } .p-toast-message-error .p-toast-close-button:focus-visible { outline-color: dt('toast.error.close.button.focus.ring.color'); box-shadow: dt('toast.error.close.button.focus.ring.shadow'); } .p-toast-message-error .p-toast-close-button:hover { background: dt('toast.error.close.button.hover.background'); } .p-toast-message-secondary { background: dt('toast.secondary.background'); border-color: dt('toast.secondary.border.color'); color: dt('toast.secondary.color'); box-shadow: dt('toast.secondary.shadow'); } .p-toast-message-secondary .p-toast-detail { color: dt('toast.secondary.detail.color'); } .p-toast-message-secondary .p-toast-close-button:focus-visible { outline-color: dt('toast.secondary.close.button.focus.ring.color'); box-shadow: dt('toast.secondary.close.button.focus.ring.shadow'); } .p-toast-message-secondary .p-toast-close-button:hover { background: dt('toast.secondary.close.button.hover.background'); } .p-toast-message-contrast { background: dt('toast.contrast.background'); border-color: dt('toast.contrast.border.color'); color: dt('toast.contrast.color'); box-shadow: dt('toast.contrast.shadow'); } .p-toast-message-contrast .p-toast-detail { color: dt('toast.contrast.detail.color'); } .p-toast-message-contrast .p-toast-close-button:focus-visible { outline-color: dt('toast.contrast.close.button.focus.ring.color'); box-shadow: dt('toast.contrast.close.button.focus.ring.shadow'); } .p-toast-message-contrast .p-toast-close-button:hover { background: dt('toast.contrast.close.button.hover.background'); } .p-toast-top-center { transform: translateX(-50%); } .p-toast-bottom-center { transform: translateX(-50%); } .p-toast-center { min-width: 20vw; transform: translate(-50%, -50%); } .p-toast-message-enter-active { animation: p-animate-toast-enter 300ms ease-out; } .p-toast-message-leave-active { animation: p-animate-toast-leave 250ms ease-in; } .p-toast-message-leave-to .p-toast-message-content { padding-top: 0; padding-bottom: 0; } @keyframes p-animate-toast-enter { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; grid-template-rows: 1fr; } } @keyframes p-animate-toast-leave { from { opacity: 1; } to { opacity: 0; margin-bottom: 0; grid-template-rows: 0fr; transform: translateY(-100%) scale(0.6); } } `;var Nt=(e,s)=>({$implicit:e,closeFn:s}),Zt=e=>({$implicit:e});function Pt(e,s){e&1&&H(0)}function zt(e,s){if(e&1&&E(0,Pt,1,0,"ng-container",3),e&2){let t=a();i("ngTemplateOutlet",t.headlessTemplate)("ngTemplateOutletContext",ut(2,Nt,t.message,t.onCloseIconClick))}}function Lt(e,s){if(e&1&&u(0,"span",4),e&2){let t=a(3);d(t.cn(t.cx("messageIcon"),t.message==null?null:t.message.icon)),i("pBind",t.ptm("messageIcon"))}}function $t(e,s){if(e&1&&(p(),u(0,"svg",11)),e&2){let t=a(4);d(t.cx("messageIcon")),i("pBind",t.ptm("messageIcon")),l("aria-hidden",!0)}}function jt(e,s){if(e&1&&(p(),u(0,"svg",12)),e&2){let t=a(4);d(t.cx("messageIcon")),i("pBind",t.ptm("messageIcon")),l("aria-hidden",!0)}}function Gt(e,s){if(e&1&&(p(),u(0,"svg",13)),e&2){let t=a(4);d(t.cx("messageIcon")),i("pBind",t.ptm("messageIcon")),l("aria-hidden",!0)}}function Ht(e,s){if(e&1&&(p(),u(0,"svg",14)),e&2){let t=a(4);d(t.cx("messageIcon")),i("pBind",t.ptm("messageIcon")),l("aria-hidden",!0)}}function Qt(e,s){if(e&1&&(p(),u(0,"svg",12)),e&2){let t=a(4);d(t.cx("messageIcon")),i("pBind",t.ptm("messageIcon")),l("aria-hidden",!0)}}function Rt(e,s){if(e&1&&x(0,$t,1,4,":svg:svg",7)(1,jt,1,4,":svg:svg",8)(2,Gt,1,4,":svg:svg",9)(3,Ht,1,4,":svg:svg",10)(4,Qt,1,4,":svg:svg",8),e&2){let t,o=a(3);T((t=o.message.severity)==="success"?0:t==="info"?1:t==="error"?2:t==="warn"?3:4)}}function qt(e,s){if(e&1&&(at(0),x(1,Lt,1,3,"span",2)(2,Rt,5,1),h(3,"div",6)(4,"div",6),R(5),_(),h(6,"div",6),R(7),_()(),rt()),e&2){let t=a(2);r(),T(t.message.icon?1:2),r(2),i("pBind",t.ptm("messageText"))("ngClass",t.cx("messageText")),l("data-p",t.dataP),r(),i("pBind",t.ptm("summary"))("ngClass",t.cx("summary")),l("data-p",t.dataP),r(),pt(" ",t.message.summary," "),r(),i("pBind",t.ptm("detail"))("ngClass",t.cx("detail")),l("data-p",t.dataP),r(),dt(t.message.detail)}}function Yt(e,s){e&1&&H(0)}function Xt(e,s){if(e&1&&u(0,"span",4),e&2){let t=a(4);d(t.cn(t.cx("closeIcon"),t.message==null?null:t.message.closeIcon)),i("pBind",t.ptm("closeIcon"))}}function Ut(e,s){if(e&1&&E(0,Xt,1,3,"span",17),e&2){let t=a(3);i("ngIf",t.message.closeIcon)}}function Jt(e,s){if(e&1&&(p(),u(0,"svg",18)),e&2){let t=a(3);d(t.cx("closeIcon")),i("pBind",t.ptm("closeIcon")),l("aria-hidden",!0)}}function Kt(e,s){if(e&1){let t=Q();h(0,"div")(1,"button",15),D("click",function(n){b(t);let c=a(2);return v(c.onCloseIconClick(n))})("keydown.enter",function(n){b(t);let c=a(2);return v(c.onCloseIconClick(n))}),x(2,Ut,1,1,"span",2)(3,Jt,1,4,":svg:svg",16),_()()}if(e&2){let t=a(2);r(),i("pBind",t.ptm("closeButton")),l("class",t.cx("closeButton"))("aria-label",t.closeAriaLabel)("data-p",t.dataP),r(),T(t.message.closeIcon?2:3)}}function Wt(e,s){if(e&1&&(h(0,"div",4),E(1,qt,8,12,"ng-container",5)(2,Yt,1,0,"ng-container",3),x(3,Kt,4,5,"div"),_()),e&2){let t=a();d(t.cn(t.cx("messageContent"),t.message==null?null:t.message.contentStyleClass)),i("pBind",t.ptm("messageContent")),r(),i("ngIf",!t.template),r(),i("ngTemplateOutlet",t.template)("ngTemplateOutletContext",mt(7,Zt,t.message)),r(),T((t.message==null?null:t.message.closable)!==!1?3:-1)}}var te=["message"],ee=["headless"];function ne(e,s){if(e&1){let t=Q();h(0,"p-toastItem",1),D("onClose",function(n){b(t);let c=a();return v(c.onMessageClose(n))})("onAnimationEnd",function(){b(t);let n=a();return v(n.onAnimationEnd())})("onAnimationStart",function(){b(t);let n=a();return v(n.onAnimationStart())}),_()}if(e&2){let t=s.$implicit,o=s.index,n=a();i("message",t)("index",o)("life",n.life)("clearAll",n.clearAllTrigger())("template",n.template||n._template)("headlessTemplate",n.headlessTemplate||n._headlessTemplate)("pt",n.pt)("unstyled",n.unstyled())("motionOptions",n.computedMotionOptions())}}var oe={root:({instance:e})=>{let{_position:s}=e;return{position:"fixed",top:s==="top-right"||s==="top-left"||s==="top-center"?"20px":s==="center"?"50%":null,right:(s==="top-right"||s==="bottom-right")&&"20px",bottom:(s==="bottom-left"||s==="bottom-right"||s==="bottom-center")&&"20px",left:s==="top-left"||s==="bottom-left"?"20px":s==="center"||s==="top-center"||s==="bottom-center"?"50%":null}}},se={root:({instance:e})=>["p-toast p-component",`p-toast-${e._position}`],message:({instance:e})=>({"p-toast-message":!0,"p-toast-message-info":e.message.severity==="info"||e.message.severity===void 0,"p-toast-message-warn":e.message.severity==="warn","p-toast-message-error":e.message.severity==="error","p-toast-message-success":e.message.severity==="success","p-toast-message-secondary":e.message.severity==="secondary","p-toast-message-contrast":e.message.severity==="contrast"}),messageContent:"p-toast-message-content",messageIcon:({instance:e})=>({"p-toast-message-icon":!0,[`pi ${e.message.icon}`]:!!e.message.icon}),messageText:"p-toast-message-text",summary:"p-toast-summary",detail:"p-toast-detail",closeButton:"p-toast-close-button",closeIcon:({instance:e})=>({"p-toast-close-icon":!0,[`pi ${e.message.closeIcon}`]:!!e.message.closeIcon})},L=(()=>{class e extends xt{name="toast";style=Bt;classes=se;inlineStyles=oe;static \u0275fac=(()=>{let t;return function(n){return(t||(t=y(e)))(n||e)}})();static \u0275prov=K({token:e,factory:e.\u0275fac})}return e})(),ie=(function(e){return e.root="p-toast",e.message="p-toast-message",e.messageContent="p-toast-message-content",e.messageIcon="p-toast-message-icon",e.messageText="p-toast-message-text",e.summary="p-toast-summary",e.detail="p-toast-detail",e.closeButton="p-toast-close-button",e.closeIcon="p-toast-close-icon",e})(ie||{}),Dt=new tt("TOAST_INSTANCE"),ae=(()=>{class e extends J{zone;message;index;life;template;headlessTemplate;showTransformOptions;hideTransformOptions;showTransitionOptions;hideTransitionOptions;motionOptions=N();clearAll=N(null);onAnimationStart=Y();onAnimationEnd=Y();onBeforeEnter(t){this.onAnimationStart.emit(t.element)}onAfterLeave(t){!this.visible()&&!this.isDestroyed&&(this.onClose.emit({index:this.index,message:this.message}),this.isDestroyed||this.onAnimationEnd.emit(t.element))}onClose=new j;_componentStyle=C(L);timeout;visible=G(void 0);isDestroyed=!1;isClosing=!1;constructor(t){super(),this.zone=t,nt(()=>{this.clearAll()&&this.visible.set(!1)})}onAfterViewInit(){this.message?.sticky&&this.visible.set(!0),this.initTimeout()}initTimeout(){this.message?.sticky||(this.clearTimeout(),this.zone.runOutsideAngular(()=>{this.visible.set(!0),this.timeout=setTimeout(()=>{this.visible.set(!1)},this.message?.life||this.life||3e3)}))}clearTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}onMouseEnter(){this.clearTimeout()}onMouseLeave(){this.isClosing||this.initTimeout()}onCloseIconClick=t=>{this.isClosing=!0,this.clearTimeout(),this.visible.set(!1),t.preventDefault()};get closeAriaLabel(){return this.config.translation.aria?this.config.translation.aria.close:void 0}onDestroy(){this.isDestroyed=!0,this.clearTimeout(),this.visible.set(!1)}get dataP(){return this.cn({[this.message?.severity]:this.message?.severity})}static \u0275fac=function(o){return new(o||e)(ot(et))};static \u0275cmp=g({type:e,selectors:[["p-toastItem"]],inputs:{message:"message",index:[2,"index","index",A],life:[2,"life","life",A],template:"template",headlessTemplate:"headlessTemplate",showTransformOptions:"showTransformOptions",hideTransformOptions:"hideTransformOptions",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",motionOptions:[1,"motionOptions"],clearAll:[1,"clearAll"]},outputs:{onAnimationStart:"onAnimationStart",onAnimationEnd:"onAnimationEnd",onClose:"onClose"},features:[q([L]),f],decls:4,vars:10,consts:[["container",""],["role","alert","aria-live","assertive","aria-atomic","true",3,"pMotionOnBeforeEnter","pMotionOnAfterLeave","mouseenter","mouseleave","pMotion","pMotionAppear","pMotionName","pMotionOptions","pBind"],[3,"pBind","class"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"pBind"],[4,"ngIf"],[3,"pBind","ngClass"],["data-p-icon","check",3,"pBind","class"],["data-p-icon","info-circle",3,"pBind","class"],["data-p-icon","times-circle",3,"pBind","class"],["data-p-icon","exclamation-triangle",3,"pBind","class"],["data-p-icon","check",3,"pBind"],["data-p-icon","info-circle",3,"pBind"],["data-p-icon","times-circle",3,"pBind"],["data-p-icon","exclamation-triangle",3,"pBind"],["type","button","autofocus","",3,"click","keydown.enter","pBind"],["data-p-icon","times",3,"pBind","class"],[3,"pBind","class",4,"ngIf"],["data-p-icon","times",3,"pBind"]],template:function(o,n){o&1&&(h(0,"div",1,0),D("pMotionOnBeforeEnter",function(m){return n.onBeforeEnter(m)})("pMotionOnAfterLeave",function(m){return n.onAfterLeave(m)})("mouseenter",function(){return n.onMouseEnter()})("mouseleave",function(){return n.onMouseLeave()}),x(2,zt,1,5,"ng-container")(3,Wt,4,9,"div",2),_()),o&2&&(d(n.cn(n.cx("message"),n.message==null?null:n.message.styleClass)),i("pMotion",n.visible())("pMotionAppear",!0)("pMotionName","p-toast-message")("pMotionOptions",n.motionOptions())("pBind",n.ptm("message")),l("id",n.message==null?null:n.message.id)("data-p",n.dataP),r(2),T(n.headlessTemplate?2:3))},dependencies:[X,ft,_t,Ct,It,Ot,St,wt,Mt,O,S,Et,kt],encapsulation:2,changeDetection:0})}return e})(),re=(()=>{class e extends J{componentName="Toast";$pcToast=C(Dt,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=C(S,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}key;autoZIndex=!0;baseZIndex=0;life=3e3;styleClass;get position(){return this._position}set position(t){this._position=t,this.cd.markForCheck()}preventOpenDuplicates=!1;preventDuplicates=!1;showTransformOptions="translateY(100%)";hideTransformOptions="translateY(-100%)";showTransitionOptions="300ms ease-out";hideTransitionOptions="250ms ease-in";motionOptions=N(void 0);computedMotionOptions=gt(()=>$($({},this.ptm("motion")),this.motionOptions()));breakpoints;onClose=new j;template;headlessTemplate;messageSubscription;clearSubscription;messages;messagesArchieve;_position="top-right";messageService=C(vt);_componentStyle=C(L);styleElement;id=k("pn_id_");templates;clearAllTrigger=G(null);constructor(){super()}onInit(){this.messageSubscription=this.messageService.messageObserver.subscribe(t=>{if(t)if(Array.isArray(t)){let o=t.filter(n=>this.canAdd(n));this.add(o)}else this.canAdd(t)&&this.add([t])}),this.clearSubscription=this.messageService.clearObserver.subscribe(t=>{t?this.key===t&&this.clearAll():this.clearAll(),this.cd.markForCheck()})}clearAll(){this.clearAllTrigger.set({})}_template;_headlessTemplate;onAfterContentInit(){this.templates?.forEach(t=>{switch(t.getType()){case"message":this._template=t.template;break;case"headless":this._headlessTemplate=t.template;break;default:this._template=t.template;break}})}onAfterViewInit(){this.breakpoints&&this.createStyle()}add(t){this.messages=this.messages?[...this.messages,...t]:[...t],this.preventDuplicates&&(this.messagesArchieve=this.messagesArchieve?[...this.messagesArchieve,...t]:[...t]),this.cd.markForCheck()}canAdd(t){let o=this.key===t.key;return o&&this.preventOpenDuplicates&&(o=!this.containsMessage(this.messages,t)),o&&this.preventDuplicates&&(o=!this.containsMessage(this.messagesArchieve,t)),o}containsMessage(t,o){return t?t.find(n=>n.summary===o.summary&&n.detail==o.detail&&n.severity===o.severity)!=null:!1}onMessageClose(t){this.messages?.splice(t.index,1),this.onClose.emit({message:t.message}),this.onAnimationEnd(),this.cd.detectChanges()}onAnimationStart(){this.renderer.setAttribute(this.el?.nativeElement,this.id,""),this.autoZIndex&&this.el?.nativeElement.style.zIndex===""&&z.set("modal",this.el?.nativeElement,this.baseZIndex||this.config.zIndex.modal)}onAnimationEnd(){this.autoZIndex&&bt(this.messages)&&z.clear(this.el?.nativeElement)}createStyle(){if(!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",U(this.styleElement,"nonce",this.config?.csp()?.nonce),this.renderer.appendChild(this.document.head,this.styleElement);let t="";for(let o in this.breakpoints){let n="";for(let c in this.breakpoints[o])n+=c+":"+this.breakpoints[o][c]+" !important;";t+=` @media screen and (max-width: ${o}) { .p-toast[${this.id}] { ${n} } } `}this.renderer.setProperty(this.styleElement,"innerHTML",t),U(this.styleElement,"nonce",this.config?.csp()?.nonce)}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}onDestroy(){this.messageSubscription&&this.messageSubscription.unsubscribe(),this.el&&this.autoZIndex&&z.clear(this.el.nativeElement),this.clearSubscription&&this.clearSubscription.unsubscribe(),this.destroyStyle()}get dataP(){return this.cn({[this.position]:this.position})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=g({type:e,selectors:[["p-toast"]],contentQueries:function(o,n,c){if(o&1&&lt(c,te,5)(c,ee,5)(c,yt,4),o&2){let m;V(m=F())&&(n.template=m.first),V(m=F())&&(n.headlessTemplate=m.first),V(m=F())&&(n.templates=m)}},hostVars:5,hostBindings:function(o,n){o&2&&(l("data-p",n.dataP),ct(n.sx("root")),d(n.cn(n.cx("root"),n.styleClass)))},inputs:{key:"key",autoZIndex:[2,"autoZIndex","autoZIndex",Z],baseZIndex:[2,"baseZIndex","baseZIndex",A],life:[2,"life","life",A],styleClass:"styleClass",position:"position",preventOpenDuplicates:[2,"preventOpenDuplicates","preventOpenDuplicates",Z],preventDuplicates:[2,"preventDuplicates","preventDuplicates",Z],showTransformOptions:"showTransformOptions",hideTransformOptions:"hideTransformOptions",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",motionOptions:[1,"motionOptions"],breakpoints:"breakpoints"},outputs:{onClose:"onClose"},features:[q([L,{provide:Dt,useExisting:e},{provide:Tt,useExisting:e}]),it([S]),f],decls:1,vars:1,consts:[[3,"message","index","life","clearAll","template","headlessTemplate","pt","unstyled","motionOptions","onClose","onAnimationEnd","onAnimationStart",4,"ngFor","ngForOf"],[3,"onClose","onAnimationEnd","onAnimationStart","message","index","life","clearAll","template","headlessTemplate","pt","unstyled","motionOptions"]],template:function(o,n){o&1&&E(0,ne,1,9,"p-toastItem",0),o&2&&i("ngForOf",n.messages)},dependencies:[X,ht,ae,O],encapsulation:2,changeDetection:0})}return e})(),Pe=(()=>{class e{static \u0275fac=function(o){return new(o||e)};static \u0275mod=st({type:e});static \u0275inj=W({imports:[re,O,O]})}return e})();export{L as a,ie as b,ae as c,re as d,Pe as e};