(()=>{"use strict";function e(e=""){var t,o,n,r,c=(e=e||location?.href).indexOf("?")+1,a=e.indexOf("#")+1||e.length+1,i=e.slice(c,a-1),l=i.replace(/\+/g," ").split("&"),d={};if(i!==e&&""!==i){for(t=0;t<l.length;t++)r=l[t].split("=",2),o=decodeURIComponent(r[0]),n=decodeURIComponent(r[1]),d.hasOwnProperty(o)||(d[o]=[]),d[o]=2===r.length?n:null;return d}}document.addEventListener("DOMContentLoaded",function(){t.protect(document.querySelectorAll(".pdfp_wrapper")),document.querySelectorAll(".pdfp_quick_frame_wrapper").forEach(t=>{const o=t.querySelector("iframe"),n=e(o?.src);if(n.file){const e=new URL(n?.file),t=new URL(o?.src);t?.protocol!==e?.protocol&&(o.src=t.href.replace(e.protocol,t.protocol))}})}),document.addEventListener("adobe_dc_view_sdk.ready",function(){document.querySelectorAll(".pdfp-adobe-viewer").forEach(e=>{let o=e?.href||e?.dataset?.href;const n=e?.dataset?.id||e?.parentElement?.id,r=JSON.parse(e?.dataset?.options,"{}"),c=t.scramble("decode",pdfp.adobeClientKey),a=e.parentElement;if(window.parentElement=a,window.doc=e,n&&o){o=t.scramble("decode",e?.href||e?.dataset?.href);const i={showPrintPDF:!1,showDownloadPDF:!1,showAnnotationTools:!1,embedMode:r.embedMode};function l(e){new AdobeDC.View({clientId:c,divId:n}).previewFile({content:{location:{url:o}},metaData:{fileName:" "}},{...e,enableLinearization:!0})}"BUTTON"===e?.tagName?e.addEventListener("click",()=>{l(i)}):l(i)}})});class t{static protect=async o=>{const n=this.getDetectorData(o);let r=!1,c=null;if(!n)return!1;const{wrapper:a,iframe:i,options:l,infos:d,frame:s}=n,u=a.querySelector(".pdfp_fullscreen"),p=a.querySelector(".close"),f=a.querySelector(".iframe_wrapper");if("_self"===u?.target&&u?.addEventListener("click",e=>{t.isiOSDevice()?u.target="blank":(e.preventDefault(),f?.requestFullscreen())}),p?.addEventListener("click",e=>{document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}),d?.protect){a.classList.add("pdfp_protected");let w=i?.dataset?.source||"";i.dataset.source="";let m=w.match(/\?file=(.+)&nobaki/);if(m||(r=!0,m=w.match(/https:\/\/bplugins.com\/(.+)/)),m){if(m=this.scramble("decode",m[1]),m=m.replace(/https?:/,window.location.protocol),m.includes("dropbox.com"))c=m;else{const b=await fetch(m),E=await b.blob();c=URL.createObjectURL(E)}function h(e){isNaN(+e)&&(e=100);var t=+new Date,o=+new Date;(isNaN(t)||isNaN(o)||o-t>e)&&(URL.revokeObjectURL(c),alert("please close devtool"),i.src="")}m=r?c:w.replace(/\?file=(.+)&nobaki/,`?file=${c}&nobaki`),i.src=m,window.attachEvent?"complete"!==document.readyState&&"interactive"!==document.readyState||(h(),window.attachEvent("onresize",h),window.attachEvent("onmousemove",h),window.attachEvent("onfocus",h),window.attachEvent("onblur",h)):(window.addEventListener("load",h),window.addEventListener("resize",h),window.addEventListener("mousemove",h),window.addEventListener("focus",h),window.addEventListener("blur",h));const v=()=>{try{i&&i.contentWindow&&i.contentWindow.document&&(i.contentWindow.document.oncontextmenu=d?.alert?function(e){alert("Right Click Disabled"),e.preventDefault()}:function(e){e.preventDefault()})}catch(e){}};i&&(i.addEventListener("load",v),v())}document.oncontextmenu=d?.alert?function(e){alert("Right Click Disabled"),e.preventDefault()}:function(e){e.preventDefault()}}else{const L=e(i?.src),g=new URL(L?.file),y=new URL(i?.src),D=a.querySelector(".pdfp_fullscreen");y?.protocol!==g?.protocol&&(i.src=y.href.replace(g.protocol,y.protocol),D&&(D.href=y.href.replace(g.protocol,y.protocol))),i?.removeAttribute("data-source")}};static getDetectorData=(e,o=!1,n=!1)=>{let r=null,c=null;return null!==e&&(void 0!==e[0]?(e.forEach(e=>{t.protect(e)}),!1):(void 0===e.length||0!==e.length)&&(null!==e.querySelector(".pdfp_wrapper")&&(e=e.querySelector(".pdfp_wrapper")),o||null==e?.dataset?.options||(o=JSON.parse(e?.dataset?.options||"{}")),n||null==e?.dataset?.infos||(n=JSON.parse(e?.dataset?.infos||"{}"),e.removeAttribute("data-infos")),r=e.querySelector("iframe"),c=e.querySelector("iframe").getAttribute("id"),{wrapper:e,iframe:r,options:o,infos:n,frame:c}))};static scramble(e="encode",t=""){const o="abcdefghijklmnopqrstuvwxyz1234567890",n="z1ntg4ihmwj5cr09byx8spl7ak6vo2q3eduf";let r="";if("encode"==e&&""!=t){const e=t.length;for(let c=0;c<e;c++){const e=o.indexOf(t[c]);r+=-1!==e?n[e]:t[c]}}if("decode"==e&&""!=t){const e=t.length;for(let c=0;c<e;c++){const e=t[c],a=n.indexOf(e);r+=-1!==a?o[a]:e}}return r}static isiOSDevice(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}}})();