"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
postscriptum.plugin('ps-print-preview', (processor) => {
    const { util, css } = postscriptum;
    const stylesheet = (destId) => `@media screen {

	#${destId} {
		background-color: #ccc;
	}

	ps-page {
		margin: 1em auto;
		box-shadow: 1px 1px 20px #555;
		position: relative;
	}
	
	ps-page::before {
		content: "";
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		background-color: white;
		z-index: -1;
	}
	

	ps-page:first-of-type {
		margin-top: 0.25em;
	}

	ps-page:last-of-type {
		margin-bottom: 0.25em;
	}
}`;
    processor.on('end', () => {
        const destId = util.dom.id(processor.dest);
        const doc = processor.source.ownerDocument;
        css.insertStyleSheet(doc, stylesheet(destId), true, 'ps-print-preview-' + destId, doc.head.firstChild);
    });
});
