import{f as D,ga as b,lb as u,rb as I,sa as g}from"./chunk-NW2U37DI.js";import{a as m}from"./chunk-TWZW5B45.js";var E={htmlType:"domObj",printMode:"template",pageTitle:"",templateString:"",popupProperties:"",stylesheets:[],styles:[],baseHref:""},h=()=>{let e=document.getElementsByTagName("head")[0],t=Math.round(Math.random()*9999999).toString(),r=`ngx-print-element-${t}`,n=`ngx-print-element-head-${t}`,a=`ngx-print-element-body-${t}`,s=`ngx-print-element-iframe-${t}`;return{head:e,nameUID:r,nameUIDHead:n,nameUIDBody:a,nameUIDIFrame:s}},f=e=>{let t=document.createElement("style");t.innerHTML=y(e),t.id=`${e.nameUIDHead}`,e.head.appendChild(t)},y=e=>`
  @media print {
    .${e.nameUIDBody} {
      visibility: hidden !important;
    }
    .${e.nameUID},
    .${e.nameUID} * {
        visibility: visible !important;
    }
    .${e.nameUID} {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
    }
    .${e.nameUID} .print-none {
        display: none !important;
    }
    /* ----- Author: DaiDH ----- */
    /* Copyright (C) 2022 - ${new Date().getFullYear()} */
  }`,w=e=>{let t=document.getElementById(e.nameUIDHead);t&&e.head.removeChild(t)},T=e=>{let t=window.location.port?`:${window.location.port}`:"",r=`${window.location.protocol}//${window.location.hostname}${t}${window.location.pathname}`;return e.baseHref?e.baseHref:r},v=(e,t,r)=>{let n=t.templateString,a=new RegExp(/{{\s*printBody\s*}}/gi),s,c,o=[];return t.htmlType==="domObj"&&(e=e.outerHTML),t.htmlType==="text"&&(e=e.innerText),n&&a.test(n)&&(e=n.replace(a,e)),o.push(`<html><head><title>${t.pageTitle||""}</title>`),t.stylesheets?s=Array.isArray(t.stylesheets)?t.stylesheets:[t.stylesheets]:s=Array.prototype.slice.call(document.getElementsByTagName("link")).map(i=>i),s.forEach(i=>{o.push(`<link rel="${i.rel}" href="${i.href}">`)}),t.styles?c=Array.isArray(t.styles)?[...t.styles,y(r)]:[t.styles+y(r)]:c=Array.prototype.slice.call(document.getElementsByTagName("style")).map(i=>i.innerHTML),c.forEach(i=>{o.push(`<style type="text/css">${i}</style>`)}),o.push(`<base href="${T(t)}"/>`),o.push(`</head><body class="${r.nameUID}">`),o.push(e),o.push("</body></html>"),o.join("")},A=(e,t={},r)=>{try{let n=m(m({},E),t),a=e.nativeElement,s=h(),c=window.open("about:blank","printElementWindow",n.popupProperties),o=c&&c.document,i=v(a,n,s);f(s);let p=d=>{o.close(),c.close(),w(s),l(r,{close:!0})};c.focus(),o.write(i),setTimeout(()=>p(c.print()),t&&t.windowOpenTimeout||500),c.onbeforeprint=d=>l(r,d),c.onafterprint=d=>l(r,d)}catch(n){l(r,n)}},U=(e,t={},r)=>{try{let n=m(m({},E),t),a=e.nativeElement,s=h(),c=v(a,n,s),o=document.createElement("iframe");o.setAttribute("id",s.nameUIDIFrame),o.setAttribute("class",s.nameUIDIFrame),o.setAttribute("src","about:blank"),o.setAttribute("frameBorder","0"),o.setAttribute("scrolling","no"),o.setAttribute("style","position:fixed;bottom:100%;right:100%;"),document.body.appendChild(o);let i=null;o.contentDocument?i=o.contentDocument:o.contentWindow&&(i=o.contentWindow.document),f(s),setTimeout(()=>{let p=d=>{i.close(),w(s),o.remove(),l(r,{close:!0})};o.contentWindow.focus(),i.open(),i.write(c),setTimeout(()=>p(o.contentWindow.print()),t&&t.windowOpenTimeout||200),o.contentWindow.onbeforeprint=d=>l(r,d),o.contentWindow.onafterprint=d=>l(r,d)})}catch(n){l(r,n)}},$=(e,t,r={},n)=>{try{let a=e.nativeElement,s=h(),c=Array.from(document.querySelectorAll("body"));c.length&&(c.forEach(i=>i&&i.classList.add(s.nameUIDBody)),t.addClass(a,s.nameUID),f(s));let o=i=>{c.forEach(p=>p&&p.classList.remove(s.nameUIDBody)),t.setAttribute(a,"class",a.className.replace(s.nameUID,"")),w(s),l(n,{close:!0})};window.focus(),setTimeout(()=>o(window.print()),r&&r.windowOpenTimeout||0),window.onbeforeprint=i=>l(n,i),window.onafterprint=i=>l(n,i)}catch(a){l(n,a)}},l=(e,t,r=null)=>{r?e.error(r):e.next(t)},x=(()=>{class e{renderer;print(r,n){let a=new D;return r&&(n?(n.printMode==="template"&&U(r,n,a),n.printMode==="template-popup"&&A(r,n,a)):$(r,this.renderer,n,a)),a}static \u0275fac=function(n){return new(n||e)};static \u0275prov=b({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),S=(()=>{class e{renderer;prints;constructor(r,n){this.renderer=r,this.prints=n}ngOnInit(){this.prints.renderer=this.renderer}static \u0275fac=function(n){return new(n||e)(u(I),u(x))};static \u0275dir=g({type:e,selectors:[["","ngxPrintElement",""]],standalone:!0})}return e})();export{x as a,S as b};
