@if(!defined('LOAD_PDFOBJECT'))
	@push('scripts')
		<script type="text/javascript" src="{{ asset('/assets/plugins/pdfobject/pdfobject.min.js') }}"></script>
		<script>
			function PDFViewer(url) {
				console.log('PDFViewer');
				console.log(url);
				console.log(btoa(url));
				var url_open = "{{ route('Core.PDF.view') }}/" + btoa(url);
				console.log(url_open);
				openModal("{{ __('pdf_viewer') }}", '#pdf-viewer', url_open, false, false, false, true);
			}


			function PDFPreviewer(url, model) {
				var pdfOptions = {
					pdfOpenParams: {
						pagemode: "thumbs",
						navpanes: 1,
						toolbar: 1,
						statusbar: 0,
						view: "FitV"
					}
				};
				PDFObject.embed(url, "#" + model + "-preview", pdfOptions);
			}
		</script>
	@endpush
	@php(define('LOAD_PDFOBJECT', true))
@endif