Socket
Socket
Sign inDemoInstall

@react-pdf-viewer/core

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-pdf-viewer/core - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

4

lib/cjs/core.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("pdfjs-dist");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r,a=n(e),o=n(t);!function(e){e[e.Text=1]="Text",e[e.Link=2]="Link",e[e.FreeText=3]="FreeText",e[e.Line=4]="Line",e[e.Square=5]="Square",e[e.Circle=6]="Circle",e[e.Polygon=7]="Polygon",e[e.Polyline=8]="Polyline",e[e.Highlight=9]="Highlight",e[e.Underline=10]="Underline",e[e.Squiggly=11]="Squiggly",e[e.StrikeOut=12]="StrikeOut",e[e.Stamp=13]="Stamp",e[e.Caret=14]="Caret",e[e.Ink=15]="Ink",e[e.Popup=16]="Popup",e[e.FileAttachment=17]="FileAttachment"}(r||(r={}));var i,s=r,c=a.createContext({prefixClass:"rpv-core"}),l=function(e){var t=[];return Object.keys(e).forEach((function(n){n&&e[n]&&t.push(n)})),t.join(" ")},u=function(e){var t=e.children,n=e.size,r=void 0===n?24:n,o=a.useContext(c),i=(r||24)+"px";return a.createElement("svg",{className:o.prefixClass+"-icon",height:i,viewBox:"0 0 24 24",width:i},t)},p=function(){return a.createElement(u,{size:16},a.createElement("path",{d:"M23.5,0.499l-16.5,23l-6.5-6.5"}))},d=function(){var e=a.useContext(c);return a.createElement("svg",{className:e.prefixClass+"-spinner",width:"64px",height:"64px",viewBox:"0 0 32 32"},a.createElement("circle",{className:e.prefixClass+"-spinner-circle",cx:"16",cy:"16",r:"12",strokeDasharray:2*Math.PI*9}))},f="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,g=function(e){var t=a.useRef(null),n=e.threshold,r=e.onVisibilityChanged;return f((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){var t=e.isIntersecting,n=e.intersectionRatio;r({isVisible:t,ratio:n})}))}),{threshold:n||0}),a=t.current;if(a)return e.observe(a),function(){e.unobserve(a)}}),[]),t},m=a.createContext({}),h={core:{askingPassword:{requirePasswordToOpen:"This document requires a password to open",submit:"Submit"},wrongPassword:{submit:"Submit",tryAgain:"The password is wrong. Please try again"}}},v=function(e){var t=e.children,n=e.localization,r=h,o=a.useState(n||r),i=o[0],s=o[1];return a.createElement(m.Provider,{value:i},t((function(e){return s(e)})))},E=function(e,t,n){var r=function(e){var r=t.current;r&&!r.contains(e.target)&&n()};a.useEffect((function(){if(e)return document.addEventListener("click",r),function(){document.removeEventListener("click",r)}}),[])},x=function(e,t){var n=function(n){n.keyCode===e&&t()};a.useEffect((function(){return document.addEventListener("keyup",n),function(){document.removeEventListener("keyup",n)}}),[])},C=function(e){var t=e.children,n=e.closeOnClickOutside,r=e.closeOnEscape,o=e.onToggle,i=a.useContext(c),s=a.createRef();return a.useEffect((function(){var e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}),[]),x(27,(function(){return r&&o()})),E(n,s,o),f((function(){var e=s.current;if(e){var t=.75*document.body.clientHeight;e.getBoundingClientRect().height>=t&&(e.style.overflow="auto",e.style.maxHeight=t+"px")}}),[]),a.createElement("div",{className:i.prefixClass+"-modal-body",ref:s},t)},w=function(e){var t=e.children,n=a.useContext(c);return a.createElement("div",{className:n.prefixClass+"-modal-overlay"},t)};!function(e){e.Close="Close",e.Open="Open",e.Toggle="Toggle"}(i||(i={}));var y,b=function(){var e=a.useState(!1),t=e[0],n=e[1];return{opened:t,toggle:function(e){switch(e){case i.Close:n(!1);break;case i.Open:n(!0);break;case i.Toggle:default:n((function(e){return!e}))}}}},k=function(e){var t=e.content,n=e.target,r=b(),o=r.opened,i=r.toggle;return a.createElement(a.Fragment,null,n(i,o),o&&t(i))};!function(e){e.TopLeft="TOP_LEFT",e.TopCenter="TOP_CENTER",e.TopRight="TOP_RIGHT",e.RightTop="RIGHT_TOP",e.RightCenter="RIGHT_CENTER",e.RightBottom="RIGHT_BOTTOM",e.BottomLeft="BOTTOM_LEFT",e.BottomCenter="BOTTOM_CENTER",e.BottomRight="BOTTOM_RIGHT",e.LeftTop="LEFT_TOP",e.LeftCenter="LEFT_CENTER",e.LeftBottom="LEFT_BOTTOM"}(y||(y={}));var P,O=y,L=function(e,t,n,r,a){f((function(){var o=t.current,i=e.current,s=n.current;if(i&&o&&s){var c=s.getBoundingClientRect(),l=function(e,t,n,r){var a=t.getBoundingClientRect(),o=e.getBoundingClientRect(),i=o.height,s=o.width,c=0,l=0;switch(n){case O.TopLeft:c=a.top-i,l=a.left;break;case O.TopCenter:c=a.top-i,l=a.left+a.width/2-s/2;break;case O.TopRight:c=a.top-i,l=a.left+a.width-s;break;case O.RightTop:c=a.top,l=a.left+a.width;break;case O.RightCenter:c=a.top+a.height/2-i/2,l=a.left+a.width;break;case O.RightBottom:c=a.top+a.height-i,l=a.left+a.width;break;case O.BottomLeft:c=a.top+a.height,l=a.left;break;case O.BottomCenter:c=a.top+a.height,l=a.left+a.width/2-s/2;break;case O.BottomRight:c=a.top+a.height,l=a.left+a.width-s;break;case O.LeftTop:c=a.top,l=a.left-s;break;case O.LeftCenter:c=a.top+a.height/2-i/2,l=a.left-s;break;case O.LeftBottom:c=a.top+a.height-i,l=a.left-s}return{left:l+(r.left||0),top:c+(r.top||0)}}(i,o,r,a),u=l.top,p=l.left;i.style.top=u-c.top+"px",i.style.left=p-c.left+"px"}}),[])},R=function(e){var t,n=e.customClassName,r=e.position,o=a.useContext(c);return a.createElement("div",{className:l((t={},t[o.prefixClass+"-arrow"]=!0,t[o.prefixClass+"-arrow-tl"]=r===O.TopLeft,t[o.prefixClass+"-arrow-tc"]=r===O.TopCenter,t[o.prefixClass+"-arrow-tr"]=r===O.TopRight,t[o.prefixClass+"-arrow-rt"]=r===O.RightTop,t[o.prefixClass+"-arrow-rc"]=r===O.RightCenter,t[o.prefixClass+"-arrow-rb"]=r===O.RightBottom,t[o.prefixClass+"-arrow-bl"]=r===O.BottomLeft,t[o.prefixClass+"-arrow-bc"]=r===O.BottomCenter,t[o.prefixClass+"-arrow-br"]=r===O.BottomRight,t[o.prefixClass+"-arrow-lt"]=r===O.LeftTop,t[o.prefixClass+"-arrow-lc"]=r===O.LeftCenter,t[o.prefixClass+"-arrow-lb"]=r===O.LeftBottom,t[""+n]=""!==n,t))})},T=function(e){var t=e.children,n=e.closeOnClickOutside,r=e.offset,o=e.position,i=e.targetRef,s=e.onClose,l=a.useContext(c),u=a.createRef(),p=a.createRef(),d=a.createRef();return E(n,u,s),L(u,i,d,o,r),f((function(){var e=p.current;if(e){var t=.75*document.body.clientHeight;e.getBoundingClientRect().height>=t&&(e.style.overflow="auto",e.style.maxHeight=t+"px")}}),[]),a.createElement(a.Fragment,null,a.createElement("div",{ref:d,style:{left:0,position:"absolute",top:0}}),a.createElement("div",{className:l.prefixClass+"-popover-body",ref:u},a.createElement(R,{customClassName:l.prefixClass+"-popover-body-arrow",position:o}),a.createElement("div",{ref:p},t)))},S=function(e){var t=e.closeOnEscape,n=e.onClose,r=a.useContext(c);return x(27,(function(){return t&&n()})),a.createElement("div",{className:r.prefixClass+"-popover-overlay"})},N=function(e){var t=e.children,n=e.offset,r=e.position,o=e.targetRef,i=a.useContext(c),s=a.createRef(),l=a.createRef();return L(s,o,l,r,n),a.createElement(a.Fragment,null,a.createElement("div",{ref:l,style:{left:0,position:"absolute",top:0}}),a.createElement("div",{className:i.prefixClass+"-tooltip-body",ref:s},a.createElement(R,{customClassName:i.prefixClass+"-tooltip-body-arrow",position:r}),a.createElement("div",{className:i.prefixClass+"-tooltip-body-content"},t)))};!function(e){e.ActualSize="ActualSize",e.PageFit="PageFit",e.PageWidth="PageWidth"}(P||(P={}));var M=P,H=function(e,t){return(H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("pdfjs-dist");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r,o=n(e),a=n(t);!function(e){e[e.Text=1]="Text",e[e.Link=2]="Link",e[e.FreeText=3]="FreeText",e[e.Line=4]="Line",e[e.Square=5]="Square",e[e.Circle=6]="Circle",e[e.Polygon=7]="Polygon",e[e.Polyline=8]="Polyline",e[e.Highlight=9]="Highlight",e[e.Underline=10]="Underline",e[e.Squiggly=11]="Squiggly",e[e.StrikeOut=12]="StrikeOut",e[e.Stamp=13]="Stamp",e[e.Caret=14]="Caret",e[e.Ink=15]="Ink",e[e.Popup=16]="Popup",e[e.FileAttachment=17]="FileAttachment"}(r||(r={}));var i,c=r,l=function(e){var t=e.children,n=e.size,r=((void 0===n?24:n)||24)+"px";return o.createElement("svg",{className:"rpv-core__icon",height:r,viewBox:"0 0 24 24",width:r},t)},s=function(){return o.createElement(l,{size:16},o.createElement("path",{d:"M23.5,0.499l-16.5,23l-6.5-6.5"}))},p=function(e){var t=[];return Object.keys(e).forEach((function(n){n&&e[n]&&t.push(n)})),t.join(" ")},u=function(e){var t=e.children,n=e.onClick;return o.createElement("button",{className:"rpv-core__primary-button",onClick:n},t)},d=function(){return o.createElement("svg",{className:"rpv-core__spinner",width:"64px",height:"64px",viewBox:"0 0 32 32"},o.createElement("circle",{className:"rpv-core__spinner-circle",cx:"16",cy:"16",r:"12",strokeDasharray:2*Math.PI*9}))},f=function(e){var t=e.placeholder,n=void 0===t?"":t,r=e.type,a=void 0===r?"text":r,i=e.value,c=void 0===i?"":i,l=e.onChange,s=e.onKeyDown,p=void 0===s?function(){}:s;return o.createElement("input",{className:"rpv-core__textbox",placeholder:n,type:a,value:c,onChange:function(e){return l(e.target.value)},onKeyDown:p})},v="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,m=function(e){var t=o.useRef(null),n=e.threshold,r=e.onVisibilityChanged;return v((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){var t=e.isIntersecting,n=e.intersectionRatio;r({isVisible:t,ratio:n})}))}),{threshold:n||0}),o=t.current;if(o)return e.observe(o),function(){e.unobserve(o)}}),[]),t},g=o.createContext({}),h={core:{askingPassword:{requirePasswordToOpen:"This document requires a password to open",submit:"Submit"},wrongPassword:{submit:"Submit",tryAgain:"The password is wrong. Please try again"}}},E=function(e){var t=e.children,n=e.localization,r=h,a=o.useState(n||r),i=a[0],c=a[1];return o.createElement(g.Provider,{value:i},t((function(e){return c(e)})))},w=function(e,t,n){var r=function(e){var r=t.current;r&&!r.contains(e.target)&&n()};o.useEffect((function(){if(e)return document.addEventListener("click",r),function(){document.removeEventListener("click",r)}}),[])},y=function(e,t){var n=function(n){n.keyCode===e&&t()};o.useEffect((function(){return document.addEventListener("keyup",n),function(){document.removeEventListener("keyup",n)}}),[])},_=function(e){var t=e.children,n=e.closeOnClickOutside,r=e.closeOnEscape,a=e.onToggle,i=o.useRef();return o.useEffect((function(){var e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}),[]),y(27,(function(){return r&&a()})),w(n,i,a),v((function(){var e=i.current;if(e){var t=.75*document.body.clientHeight;e.getBoundingClientRect().height>=t&&(e.style.overflow="auto",e.style.maxHeight=t+"px")}}),[]),o.createElement("div",{className:"rpv-core__modal-body",ref:i},t)},x=function(e){var t=e.children;return o.createElement("div",{className:"rpv-core__modal-overlay"},t)};!function(e){e.Close="Close",e.Open="Open",e.Toggle="Toggle"}(i||(i={}));var k,b=function(){var e=o.useState(!1),t=e[0],n=e[1];return{opened:t,toggle:function(e){switch(e){case i.Close:n(!1);break;case i.Open:n(!0);break;case i.Toggle:default:n((function(e){return!e}))}}}},P=function(e){var t=e.content,n=e.target,r=b(),a=r.opened,i=r.toggle;return o.createElement(o.Fragment,null,n(i,a),a&&t(i))};!function(e){e.TopLeft="TOP_LEFT",e.TopCenter="TOP_CENTER",e.TopRight="TOP_RIGHT",e.RightTop="RIGHT_TOP",e.RightCenter="RIGHT_CENTER",e.RightBottom="RIGHT_BOTTOM",e.BottomLeft="BOTTOM_LEFT",e.BottomCenter="BOTTOM_CENTER",e.BottomRight="BOTTOM_RIGHT",e.LeftTop="LEFT_TOP",e.LeftCenter="LEFT_CENTER",e.LeftBottom="LEFT_BOTTOM"}(k||(k={}));var C,O=k,L=function(e,t,n,r,o){v((function(){var a=t.current,i=e.current,c=n.current;if(i&&a&&c){var l=c.getBoundingClientRect(),s=function(e,t,n,r){var o=t.getBoundingClientRect(),a=e.getBoundingClientRect(),i=a.height,c=a.width,l=0,s=0;switch(n){case O.TopLeft:l=o.top-i,s=o.left;break;case O.TopCenter:l=o.top-i,s=o.left+o.width/2-c/2;break;case O.TopRight:l=o.top-i,s=o.left+o.width-c;break;case O.RightTop:l=o.top,s=o.left+o.width;break;case O.RightCenter:l=o.top+o.height/2-i/2,s=o.left+o.width;break;case O.RightBottom:l=o.top+o.height-i,s=o.left+o.width;break;case O.BottomLeft:l=o.top+o.height,s=o.left;break;case O.BottomCenter:l=o.top+o.height,s=o.left+o.width/2-c/2;break;case O.BottomRight:l=o.top+o.height,s=o.left+o.width-c;break;case O.LeftTop:l=o.top,s=o.left-c;break;case O.LeftCenter:l=o.top+o.height/2-i/2,s=o.left-c;break;case O.LeftBottom:l=o.top+o.height-i,s=o.left-c}return{left:s+(r.left||0),top:l+(r.top||0)}}(i,a,r,o),p=s.top,u=s.left;i.style.top=p-l.top+"px",i.style.left=u-l.left+"px"}}),[])},R=function(e){var t,n=e.customClassName,r=e.position;return o.createElement("div",{className:p((t={"rpv-core__arrow":!0,"rpv-core__arrow--tl":r===O.TopLeft,"rpv-core__arrow--tc":r===O.TopCenter,"rpv-core__arrow--tr":r===O.TopRight,"rpv-core__arrow--rt":r===O.RightTop,"rpv-core__arrow--rc":r===O.RightCenter,"rpv-core__arrow--rb":r===O.RightBottom,"rpv-core__arrow--bl":r===O.BottomLeft,"rpv-core__arrow--bc":r===O.BottomCenter,"rpv-core__arrow--br":r===O.BottomRight,"rpv-core__arrow--lt":r===O.LeftTop,"rpv-core__arrow--lc":r===O.LeftCenter,"rpv-core__arrow--lb":r===O.LeftBottom},t[""+n]=""!==n,t))})},T=function(e){var t=e.children,n=e.closeOnClickOutside,r=e.offset,a=e.position,i=e.targetRef,c=e.onClose,l=o.useRef(),s=o.useRef(),p=o.useRef();return w(n,l,c),L(l,i,p,a,r),v((function(){var e=s.current;if(e){var t=.75*document.body.clientHeight;e.getBoundingClientRect().height>=t&&(e.style.overflow="auto",e.style.maxHeight=t+"px")}}),[]),o.createElement(o.Fragment,null,o.createElement("div",{ref:p,style:{left:0,position:"absolute",top:0}}),o.createElement("div",{className:"rpv-core__popover-body",ref:l},o.createElement(R,{customClassName:"rpv-core__popover-body-arrow",position:a}),o.createElement("div",{ref:s},t)))},S=function(e){var t=e.closeOnEscape,n=e.onClose;return y(27,(function(){return t&&n()})),o.createElement("div",{className:"rpv-core__popover-overlay"})},N=function(e){var t=e.children,n=e.offset,r=e.position,a=e.targetRef,i=o.useRef(),c=o.useRef();return L(i,a,c,r,n),o.createElement(o.Fragment,null,o.createElement("div",{ref:c,style:{left:0,position:"absolute",top:0}}),o.createElement("div",{className:"rpv-core__tooltip-body",ref:i},o.createElement(R,{customClassName:"rpv-core__tooltip-body-arrow",position:r}),o.createElement("div",{className:"rpv-core__tooltip-body-content"},t)))};!function(e){e.ActualSize="ActualSize",e.PageFit="PageFit",e.PageWidth="PageWidth"}(C||(C={}));var M=C,H=function(e,t){return(H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};
/*! *****************************************************************************

@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function B(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}H(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var F,I=function(){return(I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};!function(e){e[e.PreRender=0]="PreRender",e[e.DidRender=1]="DidRender"}(F||(F={}));var A,D=F;!function(e){e[e.Solid=1]="Solid",e[e.Dashed=2]="Dashed",e[e.Beveled=3]="Beveled",e[e.Inset=4]="Inset",e[e.Underline=5]="Underline"}(A||(A={}));var W,j=A,V=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),_=function(e,t,n,r){var a=parseInt(e,10);return a>=t&&a<=n?a:r},z=function(e){var t=e.annotation,n=a.createRef(),r=a.useContext(c),o="";if(t.modificationDate){var i=function(e){var t=V.exec(e);if(!t)return null;var n=parseInt(t[1],10),r=_(t[2],1,12,1)-1,a=_(t[3],1,31,1),o=_(t[4],0,23,0),i=_(t[5],0,59,0),s=_(t[6],0,59,0),c=t[7]||"Z",l=_(t[8],0,23,0),u=_(t[9],0,59,0);switch(c){case"-":o+=l,i+=u;break;case"+":o-=l,i-=u}return new Date(Date.UTC(n,r,a,o,i,s))}(t.modificationDate);o=i?i.toLocaleDateString()+", "+i.toLocaleTimeString():""}return a.useLayoutEffect((function(){if(n.current){var e=document.querySelector('[data-annotation-id="'+t.id+'"]');if(e){var r=e;return r.style.zIndex+=1,function(){r.style.zIndex=""+(parseInt(r.style.zIndex,10)-1)}}}}),[]),a.createElement("div",{ref:n,className:r.prefixClass+"-annotation-popup-wrapper",style:{top:t.annotationType===s.Popup?"":"100%"}},t.title&&a.createElement("div",{className:r.prefixClass+"-annotation-popup-wrapper-header"},a.createElement("div",{className:r.prefixClass+"-annotation-popup-wrapper-title"},t.title),a.createElement("span",{className:r.prefixClass+"-annotation-popup-wrapper-date"},o)),t.contents&&a.createElement("div",{className:r.prefixClass+"-annotation-popup-wrapper-content"},t.contents.split("\n").map((function(e,t){return a.createElement(a.Fragment,{key:t},e,a.createElement("br",null))}))))};!function(e){e.Click="Click",e.Hover="Hover"}(W||(W={}));var q=function(e){var t,n=e.annotation,r=e.children,o=e.ignoreBorder,s=e.hasPopup,c=e.isRenderable,l=e.page,u=e.viewport,p=n.rect,d=function(){var e=b(),t=e.opened,n=e.toggle,r=a.useState(W.Hover),o=r[0],s=r[1];return{opened:t,closeOnHover:function(){o===W.Hover&&n(i.Close)},openOnHover:function(){o===W.Hover&&n(i.Open)},toggleOnClick:function(){switch(o){case W.Click:t&&s(W.Hover),n(i.Toggle);break;case W.Hover:s(W.Click),n(i.Open)}}}}(),f=d.closeOnHover,g=d.opened,m=d.openOnHover,h=d.toggleOnClick,v=(t=[p[0],l.view[3]+l.view[1]-p[1],p[2],l.view[3]+l.view[1]-p[3]],[Math.min(t[0],t[2]),Math.min(t[1],t[3]),Math.max(t[0],t[2]),Math.max(t[1],t[3])]),E=p[2]-p[0],x=p[3]-p[1],C={borderColor:"",borderRadius:"",borderStyle:"",borderWidth:""};if(!o&&n.borderStyle.width>0){switch(n.borderStyle.style){case j.Dashed:C.borderStyle="dashed";break;case j.Solid:C.borderStyle="solid";break;case j.Underline:C=Object.assign({borderBottomStyle:"solid"},C);break;case j.Beveled:case j.Inset:}var w=n.borderStyle.width;C.borderWidth=w+"px",n.borderStyle.style!==j.Underline&&(E-=2*w,x-=2*w);var y=n.borderStyle,k=y.horizontalCornerRadius,P=y.verticalCornerRadius;(k>0||P>0)&&(C.borderRadius=k+"px / "+P+"px"),n.color?C.borderColor="rgb("+(0|n.color[0])+", "+(0|n.color[1])+", "+(0|n.color[2])+")":C.borderWidth="0"}return a.createElement(a.Fragment,null,c&&r({popup:{opened:g,closeOnHover:f,openOnHover:m,toggleOnClick:h},slot:{attrs:{style:Object.assign({height:x+"px",left:v[0]+"px",top:v[1]+"px",transform:"matrix("+u.transform.join(",")+")",transformOrigin:"-"+v[0]+"px -"+v[1]+"px",width:E+"px"},C)},children:a.createElement(a.Fragment,null,s&&g&&a.createElement(z,{annotation:n}))}}))},U=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents);return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-caret","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Z=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents),l=t.rect,u=l[2]-l[0],p=l[3]-l[1],d=t.borderStyle.width;return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-circle","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),a.createElement("svg",{height:p+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+u+" "+p,width:u+"px"},a.createElement("circle",{cy:p/2,fill:"none",rx:u/2-d/2,ry:p/2-d/2,stroke:"transparent",strokeWidth:d||1})),e.slot.children)}))},G=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!(!1!==t.hasPopup||!t.title&&!t.contents),s=function(){var e,n,r,a,o=t.file;o&&(e=o.filename,n=o.content,r="string"==typeof n?"":URL.createObjectURL(new Blob([n],{type:""})),(a=document.createElement("a")).style.display="none",a.href=r||e,a.setAttribute("download",function(e){var t=e.split("/").pop();return t?t.split("#")[0].split("?")[0]:e}(e)),document.body.appendChild(a),a.click(),document.body.removeChild(a),r&&URL.revokeObjectURL(r))};return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:!0,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-file-attachment","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onDoubleClick:s,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},J=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents);return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-free-text","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},X=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!(!t.title&&!t.contents),s=!t.parentType||-1!==["Circle","Ink","Line","Polygon","PolyLine","Square"].indexOf(t.parentType);return f((function(){if(t.parentId){var e=document.querySelector('[data-annotation-id="'+t.parentId+'"]'),n=document.querySelector('[data-annotation-id="'+t.id+'"]');if(e&&n){var r=parseFloat(e.style.left),a=parseFloat(e.style.top)+parseFloat(e.style.height);n.style.left=r+"px",n.style.top=a+"px",n.style.transformOrigin="-"+r+"px -"+a+"px"}}}),[]),a.createElement(q,{annotation:t,hasPopup:s,ignoreBorder:!1,isRenderable:i,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-popup","data-annotation-id":t.id}),a.createElement(z,{annotation:t}))}))},Y=function(e){var t=e.annotation,n=e.childAnnotation,r=e.page,o=e.viewport,i=a.useContext(c),l=!1===t.hasPopup,u=!!(t.hasPopup||t.title||t.contents);if(t.quadPoints&&t.quadPoints.length>0){var p=t.quadPoints.map((function(e){return Object.assign({},t,{rect:[e[2].x,e[2].y,e[1].x,e[1].y],quadPoints:[]})}));return a.createElement(a.Fragment,null,p.map((function(e,t){return a.createElement(Y,{key:t,annotation:e,childAnnotation:n,page:r,viewport:o})})))}return a.createElement(q,{annotation:t,hasPopup:l,ignoreBorder:!0,isRenderable:u,page:r,viewport:o},(function(e){return a.createElement(a.Fragment,null,a.createElement("div",I({},e.slot.attrs,{className:i.prefixClass+"-annotation "+i.prefixClass+"-annotation-highlight","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children),n&&n.annotationType===s.Popup&&e.popup.opened&&a.createElement(X,{annotation:n,page:r,viewport:o}))}))},K=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents),l=t.rect,u=l[2]-l[0],p=l[3]-l[1],d=t.borderStyle.width;return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-ink","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.inkLists&&t.inkLists.length&&a.createElement("svg",{height:p+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+u+" "+p,width:u+"px"},t.inkLists.map((function(e,t){return a.createElement("polyline",{key:t,fill:"none",stroke:"transparent",strokeWidth:d||1,points:e.map((function(e){return e.x-l[0]+","+(l[3]-e.y)})).join(" ")})}))),e.slot.children)}))},Q=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents),l=t.rect,u=l[2]-l[0],p=l[3]-l[1],d=t.borderStyle.width;return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-line","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),a.createElement("svg",{height:p+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+u+" "+p,width:u+"px"},a.createElement("line",{stroke:"transparent",strokeWidth:d||1,x1:l[2]-t.lineCoordinates[0],x2:l[2]-t.lineCoordinates[2],y1:l[3]-t.lineCoordinates[1],y2:l[3]-t.lineCoordinates[3]})),e.slot.children)}))},$=function(e,t){return new Promise((function(n){new Promise((function(n){"string"==typeof t?e.getDestination(t).then((function(e){n(e)})):n(t)})).then((function(t){return"object"==typeof t[0]?e.getPageIndex(t[0]).then((function(e){return Promise.resolve({pageIndex:e,destArray:t})})):Promise.resolve({pageIndex:t[0],destArray:t})})).then((function(e){var t=function(e,t){switch(t[1].name){case"XYZ":return{bottomOffset:t[3],pageIndex:e-1,scaleTo:t[4]};case"Fit":case"FitB":return{bottomOffset:0,pageIndex:e-1,scaleTo:M.PageFit};case"FitH":case"FitBH":return{bottomOffset:t[2],pageIndex:e-1,scaleTo:M.PageWidth};default:return{bottomOffset:0,pageIndex:e-1,scaleTo:1}}}(e.pageIndex,e.destArray);n(t)}))}))},ee=function(e){var t=e.annotation,n=e.doc,r=e.page,o=e.viewport,i=e.onExecuteNamedAction,s=e.onJumpToDest,l=a.useContext(c),u=!!(t.url||t.dest||t.action),p=t.url?{href:t.url,rel:"noopener noreferrer nofollow",target:t.newWindow?"_blank":"",title:t.url}:{href:"",onClick:function(e){e.preventDefault(),t.action?i(t.action):$(n,t.dest).then((function(e){var t=e.pageIndex,n=e.bottomOffset,r=e.scaleTo;s(n?t+1:t,n,0,r)}))}};return a.createElement(q,{annotation:t,hasPopup:!1,ignoreBorder:!1,isRenderable:u,page:r,viewport:o},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:l.prefixClass+"-annotation "+l.prefixClass+"-annotation-link","data-annotation-id":t.id}),a.createElement("a",I({},p)))}))},te=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents),l=t.rect,u=l[2]-l[0],p=l[3]-l[1],d=t.borderStyle.width;return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-polygon","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.vertices&&t.vertices.length&&a.createElement("svg",{height:p+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+u+" "+p,width:u+"px"},a.createElement("polygon",{fill:"none",stroke:"transparent",strokeWidth:d||1,points:t.vertices.map((function(e){return e.x-l[0]+","+(l[3]-e.y)})).join(" ")})),e.slot.children)}))},ne=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents),l=t.rect,u=l[2]-l[0],p=l[3]-l[1],d=t.borderStyle.width;return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-polyline","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.vertices&&t.vertices.length&&a.createElement("svg",{height:p+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+u+" "+p,width:u+"px"},a.createElement("polyline",{fill:"none",stroke:"transparent",strokeWidth:d||1,points:t.vertices.map((function(e){return e.x-l[0]+","+(l[3]-e.y)})).join(" ")})),e.slot.children)}))},re=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents),l=t.rect,u=l[2]-l[0],p=l[3]-l[1],d=t.borderStyle.width;return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-square","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),a.createElement("svg",{height:p+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+u+" "+p,width:u+"px"},a.createElement("rect",{height:p-d,fill:"none",stroke:"transparent",strokeWidth:d||1,x:d/2,y:d/2,width:u-d})),e.slot.children)}))},ae=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents);return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-squiggly","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},oe=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents);return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-stamp","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},ie=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents);return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-strike-out","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},se=function(){return a.createElement(u,{size:16},a.createElement("path",{d:"M.5,16.5a1,1,0,0,0,1,1h2v4l4-4h15a1,1,0,0,0,1-1V3.5a1,1,0,0,0-1-1H1.5a1,1,0,0,0-1,1Z"}),a.createElement("path",{d:"M7.25,9.75A.25.25,0,1,1,7,10a.25.25,0,0,1,.25-.25"}),a.createElement("path",{d:"M12,9.75a.25.25,0,1,1-.25.25A.25.25,0,0,1,12,9.75"}),a.createElement("path",{d:"M16.75,9.75a.25.25,0,1,1-.25.25.25.25,0,0,1,.25-.25"}))},ce=function(){return a.createElement(u,{size:16},a.createElement("path",{d:"M0.500 12.001 A11.500 11.500 0 1 0 23.500 12.001 A11.500 11.500 0 1 0 0.500 12.001 Z"}),a.createElement("path",{d:"M6.000 12.001 A6.000 6.000 0 1 0 18.000 12.001 A6.000 6.000 0 1 0 6.000 12.001 Z"}),a.createElement("path",{d:"M21.423 5.406L17.415 9.414"}),a.createElement("path",{d:"M14.587 6.585L18.607 2.565"}),a.createElement("path",{d:"M5.405 21.424L9.413 17.416"}),a.createElement("path",{d:"M6.585 14.588L2.577 18.596"}),a.createElement("path",{d:"M18.602 21.419L14.595 17.412"}),a.createElement("path",{d:"M17.419 14.58L21.428 18.589"}),a.createElement("path",{d:"M2.582 5.399L6.588 9.406"}),a.createElement("path",{d:"M9.421 6.581L5.412 2.572"}))},le=function(){return a.createElement(u,{size:16},a.createElement("path",{d:"M4.000 18.500 A1.500 1.500 0 1 0 7.000 18.500 A1.500 1.500 0 1 0 4.000 18.500 Z"}),a.createElement("path",{d:"M20.5.5l-9.782,9.783a7,7,0,1,0,3,3L17,10h1.5V8.5L19,8h1.5V6.5L21,6h1.5V4.5l1-1V.5Z"}))},ue=function(){return a.createElement(u,{size:16},a.createElement("path",{d:"M2.000 2.500 L22.000 2.500 L22.000 23.500 L2.000 23.500 Z"}),a.createElement("path",{d:"M6 4.5L6 0.5"}),a.createElement("path",{d:"M18 4.5L18 0.5"}),a.createElement("path",{d:"M10 4.5L10 0.5"}),a.createElement("path",{d:"M14 4.5L14 0.5"}))},pe=function(){return a.createElement(u,{size:16},a.createElement("path",{d:"M17.5 0.498L17.5 23.498"}),a.createElement("path",{d:"M10.5 0.498L10.5 23.498"}),a.createElement("path",{d:"M23.5.5H6.5a6,6,0,0,0,0,12h4"}))},de=function(){return a.createElement(u,{size:16},a.createElement("path",{d:"M2.5 22.995L12 6.005 21.5 22.995 2.5 22.995z"}))},fe=function(e){var t=e.annotation,n=e.childAnnotation,r=e.page,o=e.viewport,i=a.useContext(c),l=!1===t.hasPopup,u=!!(t.hasPopup||t.title||t.contents),d=t.name?t.name.toLowerCase():"";return a.createElement(q,{annotation:t,hasPopup:l,ignoreBorder:!1,isRenderable:u,page:r,viewport:o},(function(e){return a.createElement(a.Fragment,null,a.createElement("div",I({},e.slot.attrs,{className:i.prefixClass+"-annotation "+i.prefixClass+"-annotation-text","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),d&&a.createElement("div",{className:i.prefixClass+"-annotation-text-icon"},"check"===d&&a.createElement(p,null),"comment"===d&&a.createElement(se,null),"help"===d&&a.createElement(ce,null),"insert"===d&&a.createElement(de,null),"key"===d&&a.createElement(le,null),"note"===d&&a.createElement(ue,null),("newparagraph"===d||"paragraph"===d)&&a.createElement(pe,null)),e.slot.children),n&&n.annotationType===s.Popup&&e.popup.opened&&a.createElement(X,{annotation:n,page:r,viewport:o}))}))},ge=function(e){var t=e.annotation,n=e.page,r=e.viewport,o=a.useContext(c),i=!1===t.hasPopup,s=!!(t.hasPopup||t.title||t.contents);return a.createElement(q,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:s,page:n,viewport:r},(function(e){return a.createElement("div",I({},e.slot.attrs,{className:o.prefixClass+"-annotation "+o.prefixClass+"-annotation-underline","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},me=function(e){var t=e.annotations,n=e.containerRef,r=e.doc,o=e.page,i=e.pageIndex,c=e.plugins,l=e.rotation,u=e.scale,p=e.onExecuteNamedAction,d=e.onJumpToDest,f=o.getViewport({rotation:l,scale:u}).clone({dontFlip:!0}),g=t.filter((function(e){return!e.parentId}));return a.useEffect((function(){var e=n.current;e&&c.forEach((function(t){t.onAnnotationLayerRender&&t.onAnnotationLayerRender({annotations:g,container:e,pageIndex:i,rotation:l,scale:u})}))}),[]),a.createElement(a.Fragment,null,g.map((function(e){var n=t.find((function(t){return t.parentId===e.id}));switch(e.annotationType){case s.Caret:return a.createElement(U,{key:e.id,annotation:e,page:o,viewport:f});case s.Circle:return a.createElement(Z,{key:e.id,annotation:e,page:o,viewport:f});case s.FileAttachment:return a.createElement(G,{key:e.id,annotation:e,page:o,viewport:f});case s.FreeText:return a.createElement(J,{key:e.id,annotation:e,page:o,viewport:f});case s.Highlight:return a.createElement(Y,{key:e.id,annotation:e,childAnnotation:n,page:o,viewport:f});case s.Ink:return a.createElement(K,{key:e.id,annotation:e,page:o,viewport:f});case s.Line:return a.createElement(Q,{key:e.id,annotation:e,page:o,viewport:f});case s.Link:return a.createElement(ee,{key:e.id,annotation:e,doc:r,page:o,viewport:f,onExecuteNamedAction:p,onJumpToDest:d});case s.Polygon:return a.createElement(te,{key:e.id,annotation:e,page:o,viewport:f});case s.Polyline:return a.createElement(ne,{key:e.id,annotation:e,page:o,viewport:f});case s.Popup:return a.createElement(X,{key:e.id,annotation:e,page:o,viewport:f});case s.Square:return a.createElement(re,{key:e.id,annotation:e,page:o,viewport:f});case s.Squiggly:return a.createElement(ae,{key:e.id,annotation:e,page:o,viewport:f});case s.Stamp:return a.createElement(oe,{key:e.id,annotation:e,page:o,viewport:f});case s.StrikeOut:return a.createElement(ie,{key:e.id,annotation:e,page:o,viewport:f});case s.Text:return a.createElement(fe,{key:e.id,annotation:e,childAnnotation:n,page:o,viewport:f});case s.Underline:return a.createElement(ge,{key:e.id,annotation:e,page:o,viewport:f});default:return a.createElement(a.Fragment,{key:e.id})}})))},he=function(e){var t=e.page,n=e.renderAnnotations,r=a.useState({loading:!0,annotations:[]}),o=r[0],i=r[1];return a.useEffect((function(){t.getAnnotations({intent:"display"}).then((function(e){i({loading:!1,annotations:e})}))}),[]),o.loading?a.createElement(a.Fragment,null):n(o.annotations)},ve=function(e){var t=e.doc,n=e.page,r=e.pageIndex,o=e.plugins,i=e.rotation,s=e.scale,l=e.onExecuteNamedAction,u=e.onJumpToDest,p=a.useContext(c),d=a.createRef();return a.createElement("div",{ref:d,className:p.prefixClass+"-annotation-layer"},a.createElement(he,{page:n,renderAnnotations:function(e){return a.createElement(me,{annotations:e,containerRef:d,doc:t,page:n,pageIndex:r,plugins:o,rotation:i,scale:s,onExecuteNamedAction:l,onJumpToDest:u})}}))},Ee=function(e){var t=e.callback,n=e.children,r=e.rotation,o=e.scale;return f((function(){t()}),[r,o]),a.createElement(a.Fragment,null,n)},xe=function(e){var t=e.height,n=e.page,r=e.pageIndex,o=e.plugins,i=e.rotation,s=e.scale,l=e.width,u=a.useContext(c),p=a.createRef(),f=a.useRef(),g=a.useState(!1),m=g[0],h=g[1],v=window.devicePixelRatio||1;return a.createElement(Ee,{callback:function(){h(!1);var e=f.current;e&&e.cancel();var a=p.current;o.forEach((function(e){e.onCanvasLayerRender&&e.onCanvasLayerRender({ele:a,pageIndex:r,rotation:i,scale:s,status:D.PreRender})})),a.height=t*v,a.width=l*v,a.style.opacity="0";var c=a.getContext("2d",{alpha:!1}),u=n.getViewport({rotation:i,scale:s*v});f.current=n.render({canvasContext:c,viewport:u}),f.current.promise.then((function(){h(!0),a.style.removeProperty("opacity"),o.forEach((function(e){e.onCanvasLayerRender&&e.onCanvasLayerRender({ele:a,pageIndex:r,rotation:i,scale:s,status:D.DidRender})}))}),(function(){h(!0)}))},rotation:i,scale:s},a.createElement("div",{className:u.prefixClass+"-canvas-layer",style:{height:t+"px",width:l+"px"}},!m&&a.createElement("div",{className:u.prefixClass+"-canvas-layer-loader"},a.createElement(d,null)),a.createElement("canvas",{ref:p,style:{transform:"scale("+1/v+")",transformOrigin:"top left"}})))},Ce=function(e){var t=e.height,n=e.page,r=e.rotation,i=e.scale,s=e.width,l=a.useContext(c),u=a.createRef();return a.createElement(Ee,{callback:function(){var e=u.current,a=n.getViewport({rotation:r,scale:i});n.getOperatorList().then((function(r){!function(){var e=u.current;e&&(e.innerHTML="")}(),new o.SVGGraphics(n.commonObjs,n.objs).getSVG(r,a).then((function(n){n.style.height=t+"px",n.style.width=s+"px",e.appendChild(n)}))}))},rotation:r,scale:i},a.createElement("div",{className:l.prefixClass+"-svg-layer",ref:u}))},we=function(e){var t=e.page,n=e.pageIndex,r=e.plugins,i=e.rotation,s=e.scale,l=a.useContext(c),u=a.createRef(),p=a.useRef();return a.createElement(Ee,{callback:function(){var e=p.current;e&&e.cancel();var a=u.current;if(a){var c=t.getViewport({rotation:i,scale:s});r.forEach((function(e){e.onTextLayerRender&&e.onTextLayerRender({ele:a,pageIndex:n,scale:s,status:D.PreRender})})),t.getTextContent().then((function(e){!function(){var e=u.current;if(e)for(var t=e.querySelectorAll("span."+l.prefixClass+"-text"),n=t.length,r=0;r<n;r++){var a=t[r];e.removeChild(a)}}(),p.current=o.renderTextLayer({container:a,textContent:e,viewport:c}),p.current.promise.then((function(){for(var e=a.childNodes,t=e.length,o=0;o<t;o++){e[o].classList.add(l.prefixClass+"-text")}r.forEach((function(e){e.onTextLayerRender&&e.onTextLayerRender({ele:a,pageIndex:n,scale:s,status:D.DidRender})}))}),(function(){}))}))}},rotation:i,scale:s},a.createElement("div",{className:l.prefixClass+"-text-layer",ref:u}))},ye=function(e){var t=e.currentPage,n=e.doc,r=e.height,o=e.pageIndex,i=e.plugins,s=e.renderPage,l=e.rotation,u=e.scale,p=e.width,f=e.onExecuteNamedAction,m=e.onJumpToDest,h=e.onPageVisibilityChanged,v=a.useContext(c),E=a.useState({page:null,pageHeight:r,pageWidth:p,viewportRotation:0}),x=E[0],C=E[1],w=x.page,y=x.pageHeight,b=x.pageWidth,k=a.useRef(!1),P=Array(10).fill(null).map((function(e,t){return t/10})),O=b*u,L=y*u,R=Math.abs(l)%180==0,T=R?O:L,S=R?L:O,N=function(){k.current||(k.current=!0,n.getPage(o+1).then((function(e){var t=e.getViewport({scale:1});C({page:e,pageHeight:t.height,pageWidth:t.width,viewportRotation:t.rotation})})))},M=s||function(e){return a.createElement(a.Fragment,null,e.canvasLayer.children,e.textLayer.children,e.annotationLayer.children)},H=(l+x.viewportRotation)%360,B=g({threshold:P,onVisibilityChanged:function(e){h(o,e.isVisible?e.ratio:-1),e.isVisible&&N()}});return a.useEffect((function(){t-2<=o&&o<=t+2&&N()}),[t]),a.createElement("div",{ref:B,className:v.prefixClass+"-page-layer","data-testid":"viewer-page-layer-"+o,style:{height:S+"px",width:T+"px"}},w?a.createElement(a.Fragment,null,M({annotationLayer:{attrs:{},children:a.createElement(ve,{doc:n,page:w,pageIndex:o,plugins:i,rotation:H,scale:u,onExecuteNamedAction:f,onJumpToDest:m})},canvasLayer:{attrs:{},children:a.createElement(xe,{height:S,page:w,pageIndex:o,plugins:i,rotation:H,scale:u,width:T})},doc:n,height:S,pageIndex:o,rotation:l,scale:u,svgLayer:{attrs:{},children:a.createElement(Ce,{height:S,page:w,rotation:H,scale:u,width:T})},textLayer:{attrs:{},children:a.createElement(we,{page:w,pageIndex:o,plugins:i,rotation:H,scale:u})},width:T}),i.map((function(e,t){return e.renderPageLayer?a.createElement(a.Fragment,{key:t},e.renderPageLayer({doc:n,height:S,pageIndex:o,rotation:l,scale:u,width:T})):a.createElement(a.Fragment,{key:t})}))):a.createElement(d,null))},be=function(e,t,n,r){switch(r){case M.ActualSize:return 1;case M.PageFit:return Math.min((e.clientWidth-17)/n,(e.clientHeight-16)/t);case M.PageWidth:return(e.clientWidth-17)/n}},ke=function(e){var t=e.doc,n=e.initialPage,r=e.pageSize,o=e.plugins,i=e.renderPage,s=e.viewerState,l=e.onDocumentLoad,u=e.onOpenFile,p=e.onPageChange,d=e.onZoom,f=a.useContext(c),g=a.useRef(null),m=a.useRef(null),h=a.useState(0),v=h[0],E=h[1],x=a.useState(0),C=x[0],w=x[1],y=a.useRef(s),b=a.useState(r.scale),k=b[0],P=b[1],O=t.numPages,L=r.pageWidth,R=r.pageHeight,T=Array(O).fill(null),S=T.map((function(){return 0})),N=T.map((function(){return a.useRef()})),H=function(e){var t=e;o.forEach((function(e){e.onViewerStateChange&&(t=e.onViewerStateChange(t))})),y.current=t},B=function(){return m.current},F=function(e){return e<0||e>=O?null:N[e].current},A=function(){return y.current},D=function(e,n,r,a){var o=m.current,i=y.current;if(o&&i){var s=e+1;t.getPage(s).then((function(t){var s=t.getViewport({scale:1}),c=0,l=n||0,u=r||0,p=i.scale;switch(a){case M.PageFit:c=0,u=0,_(M.PageFit);break;case M.PageWidth:p=be(o,R,L,M.PageWidth),c=(s.height-l)*p,u*=p,_(p);break;default:c=(s.height-l)*i.scale,u*=i.scale}var d=N[e].current;d&&(o.scrollTop=d.offsetTop+c,o.scrollLeft=d.offsetLeft+u)}))}},W=function(e){if(!(e<0||e>=O)){var t=m.current,n=N[e].current;t&&n&&(t.scrollTop=n.offsetTop,t.scrollLeft=n.offsetLeft),E(e)}},j=function(e){var t,n;"pdf"===(t=e.name,n=t.split(/\./).pop(),n?n.toLowerCase():"").toLowerCase()&&new Promise((function(t){var n=new FileReader;n.readAsArrayBuffer(e),n.onload=function(){var e=new Uint8Array(n.result);t(e)}})).then((function(t){u(e.name,t)}))},V=function(e){w(e),H({file:s.file,pageIndex:v,pageHeight:R,pageWidth:L,rotation:e,scale:k})},_=function(e){var n=m.current,r=n?"string"==typeof e?be(n,R,L,e):e:1;P(r),d({doc:t,scale:r})};a.useEffect((function(){var e=m.current,t=y.current;e&&t&&(e.scrollTop=e.scrollTop*k/t.scale,e.scrollLeft=e.scrollLeft*k/t.scale,H({file:s.file,pageIndex:t.pageIndex,pageHeight:R,pageWidth:L,rotation:C,scale:k}))}),[k]);a.useEffect((function(){var e={getPageElement:F,getPagesContainer:B,getViewerState:A,jumpToDestination:D,jumpToPage:W,openFile:j,rotate:V,setViewerState:H,zoom:_};return o.forEach((function(t){t.install&&t.install(e)})),function(){o.forEach((function(t){t.uninstall&&t.uninstall(e)}))}}),[]),a.useEffect((function(){l({doc:t}),o.forEach((function(e){e.onDocumentLoad&&e.onDocumentLoad({doc:t})})),n&&W(n)}),[]),a.useEffect((function(){p({currentPage:v,doc:t}),H({file:s.file,pageIndex:v,pageHeight:R,pageWidth:L,rotation:C,scale:k})}),[v]);var z,q=function(e,t){S[e]=t;var n=S.reduce((function(e,t,n,r){return t>r[e]?n:e}),0);E(n)},U=function(e){var t=v-1,n=v+1;switch(e){case"FirstPage":W(0);break;case"LastPage":W(O-1);break;case"NextPage":n<O&&W(n);break;case"PrevPage":t>=0&&W(t)}},Z=function(e){return a.createElement("div",I({},e.attrs,{style:e.attrs&&e.attrs.style?e.attrs.style:{}}),e.children,e.subSlot&&Z(e.subSlot))};return Z((z={attrs:{ref:g,style:{height:"100%"}},children:a.createElement(a.Fragment,null),subSlot:{attrs:{ref:m,style:{height:"100%",overflow:"auto",position:"relative"}},children:a.createElement(a.Fragment,null,Array(O).fill(0).map((function(e,n){return a.createElement("div",{className:f.prefixClass+"-inner-page",key:"pagelayer-"+n,ref:function(e){N[n].current=e}},a.createElement(ye,{currentPage:v,doc:t,height:R,pageIndex:n,plugins:o,renderPage:i,rotation:C,scale:k,width:L,onExecuteNamedAction:U,onJumpToDest:D,onPageVisibilityChanged:q}))})))}},o.forEach((function(e){e.renderViewer&&(z=e.renderViewer({containerRef:g,doc:t,pageHeight:R,pageWidth:L,rotation:C,slot:z,jumpToPage:W,openFile:j,rotate:V,zoom:_}))})),z))},Pe=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.3,1.5,1.7,1.9,2.1,2.4,2.7,3,3.3,3.7,4.1,4.6,5.1,5.7,6.3,7,7.7,8.5,9.4,10],Oe=function(e){var t=e.defaultScale,n=e.doc,r=e.render,o=a.useContext(c),i=a.useRef(null),s=a.useState({pageHeight:0,pageWidth:0,scale:1}),l=s[0],u=s[1];return a.useEffect((function(){n.getPage(1).then((function(e){var n=e.getViewport({scale:1}),r=n.width,a=n.height,o=i.current;if(o){var s,c,l=(o.clientWidth-100)/r,p=t?"string"==typeof t?be(o,a,r,t):t:(s=l,-1===(c=Pe.findIndex((function(e){return e>=s})))||0===c?s:Pe[c-1]);u({pageHeight:a,pageWidth:r,scale:p})}}))}),[n]),0===l.pageWidth?a.createElement("div",{className:o.prefixClass+"-page-size-calculator",ref:i},a.createElement(d,null)):r(l)},Le=function(){},Re=function(e){function t(t){var n=e.call(this)||this;return n.verifyPasswordFn=t,n}return B(t,e),t}(Le),Te=function(e){var t=e.verifyPasswordFn,n=a.useContext(m),r=a.useContext(c),o=a.useState(""),i=o[0],s=o[1];return a.createElement("div",{className:r.prefixClass+"-asking-password"},a.createElement("div",null,a.createElement("div",{className:r.prefixClass+"-asking-password-message"},n.core.askingPassword.requirePasswordToOpen,":"),a.createElement("div",{className:r.prefixClass+"-asking-password-input-container"},a.createElement("input",{className:r.prefixClass+"-asking-password-input",type:"password",onChange:function(e){return s(e.target.value)}}),a.createElement("button",{className:r.prefixClass+"-asking-password-button",onClick:function(){return t(i)}},n.core.askingPassword.submit))))},Se=function(e){function t(t){var n=e.call(this)||this;return n.doc=t,n}return B(t,e),t}(Le),Ne=function(e){function t(t){var n=e.call(this)||this;return n.error=t,n}return B(t,e),t}(Le),Me=function(e){function t(t){var n=e.call(this)||this;return n.percentages=t,n}return B(t,e),t}(Le),He=function(e){var t=e.verifyPasswordFn,n=a.useContext(m),r=a.useContext(c),o=a.useState(""),i=o[0],s=o[1];return a.createElement("div",{className:r.prefixClass+"-asking-password"},a.createElement("div",null,a.createElement("div",{className:r.prefixClass+"-asking-password-message"},n.core.wrongPassword.tryAgain,":"),a.createElement("div",{className:r.prefixClass+"-asking-password-input-container"},a.createElement("input",{className:r.prefixClass+"-asking-password-input",type:"password",onChange:function(e){return s(e.target.value)}}),a.createElement("button",{className:r.prefixClass+"-asking-password-button",onClick:function(){return t(i)}},n.core.wrongPassword.submit))))},Be=function(e){function t(t){var n=e.call(this)||this;return n.verifyPasswordFn=t,n}return B(t,e),t}(Le),Fe=function(e){var t,n=e.characterMap,r=e.file,i=e.httpHeaders,s=e.render,l=e.renderError,u=e.renderLoader,p=e.transformGetDocumentParams,f=e.withCredentials,g=a.useContext(c),m=a.useState(new Me(0)),h=m[0],v=m[1],E=a.useState(0),x=E[0],C=E[1],w=a.useState(null),y=w[0],b=w[1],k=(t=a.useRef(!1),a.useEffect((function(){return t.current=!0,function(){t.current=!1}}),[]),t);switch(a.useEffect((function(){v(new Me(0));var e=new o.PDFWorker({name:"PDFWorker_"+Date.now()}),t=Object.assign({httpHeaders:i,withCredentials:f,worker:e},"string"==typeof r?{url:r}:{data:r},n?{cMapUrl:n.url,cMapPacked:n.isCompressed}:{}),a=p?p(t):t,s=o.getDocument(a);return s.onPassword=function(e,t){switch(t){case o.PasswordResponses.NEED_PASSWORD:k.current&&v(new Re(e));break;case o.PasswordResponses.INCORRECT_PASSWORD:k.current&&v(new Be(e))}},s.onProgress=function(e){e.total>0?k.current&&C(Math.min(100,100*e.loaded/e.total)):k.current&&C(100)},s.promise.then((function(e){return k.current&&b(e)}),(function(t){return k.current&&!e.destroyed&&v(new Ne({message:t.message||"Cannot load document",name:t.name}))})),function(){s.destroy(),e.destroy()}}),[r]),a.useEffect((function(){100===x&&y?k.current&&v(new Se(y)):k.current&&v(new Me(x))}),[x,y]),!0){case h instanceof Re:return a.createElement(Te,{verifyPasswordFn:h.verifyPasswordFn});case h instanceof Be:return a.createElement(He,{verifyPasswordFn:h.verifyPasswordFn});case h instanceof Se:return s(h.doc);case h instanceof Ne:return l?l(h.error):a.createElement("div",{className:g.prefixClass+"-doc-error"},a.createElement("div",{className:g.prefixClass+"-doc-error-text"},h.error.message));case h instanceof Me:return a.createElement("div",{className:g.prefixClass+"-doc-loading"},u?u(h.percentages):a.createElement(d,null));default:return a.createElement("div",{className:g.prefixClass+"-doc-loading"},a.createElement(d,null))}},Ie=function(e){var t=e.children,n=e.prefixClass;return a.createElement(c.Provider,{value:{prefixClass:n||"rpv-core"}},t)};exports.AnnotationType=s,exports.Button=function(e){var t,n=e.children,r=e.isDisabled,o=void 0!==r&&r,i=e.isSelected,s=void 0!==i&&i,u=e.onClick,p=a.useContext(c);return a.createElement("button",{className:l((t={},t[p.prefixClass+"-button"]=!0,t[p.prefixClass+"-button-disabled"]=o,t[p.prefixClass+"-button-selected"]=s,t)),onClick:u},n)},exports.Icon=u,exports.LayerRenderStatus=D,exports.LocalizationContext=m,exports.LocalizationProvider=v,exports.Menu=function(e){var t=e.children,n=a.useContext(c);return a.createElement("ul",{className:n.prefixClass+"-menu"},t)},exports.MenuDivider=function(){var e=a.useContext(c);return a.createElement("li",{className:e.prefixClass+"-menu-divider"})},exports.MenuItem=function(e){var t,n=e.checked,r=void 0!==n&&n,o=e.children,i=e.icon,s=void 0===i?null:i,u=e.isDisabled,d=void 0!==u&&u,f=e.onClick,g=a.useContext(c);return a.createElement("li",{className:l((t={},t[g.prefixClass+"-menu-item"]=!0,t[g.prefixClass+"-menu-item-disabled"]=d,t)),onClick:f},a.createElement("div",{className:g.prefixClass+"-menu-item-icon"},s),a.createElement("div",{className:g.prefixClass+"-menu-item-label"},o),a.createElement("div",{className:g.prefixClass+"-menu-item-check"},r&&a.createElement(p,null)))},exports.Modal=function(e){var t=e.closeOnClickOutside,n=e.closeOnEscape,r=e.content,o=e.target;return a.createElement(k,{target:o,content:function(e){return a.createElement(w,null,a.createElement(C,{closeOnClickOutside:t,closeOnEscape:n,onToggle:e},r(e)))}})},exports.Popover=function(e){var t=e.closeOnClickOutside,n=e.closeOnEscape,r=e.content,o=e.offset,i=e.position,s=e.target,c=a.createRef();return a.createElement(k,{content:function(e){return a.createElement(a.Fragment,null,a.createElement(S,{closeOnEscape:n,onClose:e}),a.createElement(T,{closeOnClickOutside:t,offset:o,position:i,targetRef:c,onClose:e},r(e)))},target:function(e,t){return a.createElement("div",{ref:c},s(e,t))}})},exports.Position=O,exports.PrimaryButton=function(e){var t=e.children,n=e.onClick,r=a.useContext(c);return a.createElement("button",{className:r.prefixClass+"-primary-button",onClick:n},t)},exports.ProgressBar=function(e){var t=e.progress,n=a.useContext(c);return a.createElement("div",{className:n.prefixClass+"-progress-bar"},a.createElement("div",{className:n.prefixClass+"-progress-bar-inner",style:{width:t+"%"}},t,"%"))},exports.Separator=function(){var e=a.useContext(c);return a.createElement("div",{className:e.prefixClass+"-separator"})},exports.SpecialZoomLevel=M,exports.Spinner=d,exports.Tooltip=function(e){var t=e.content,n=e.offset,r=e.position,o=e.target,s=a.createRef();return a.createElement(k,{target:function(e){return a.createElement("div",{ref:s,onMouseEnter:function(){e(i.Open)},onMouseLeave:function(){e(i.Close)}},o)},content:function(){return a.createElement(N,{offset:n,position:r,targetRef:s},t())}})},exports.Viewer=function(e){var t,n,r=e.characterMap,o=e.defaultScale,i=e.fileUrl,s=e.httpHeaders,c=void 0===s?{}:s,l=e.initialPage,u=void 0===l?0:l,p=e.localization,d=e.plugins,f=void 0===d?[]:d,m=e.prefixClass,h=e.renderError,E=e.renderPage,x=e.renderLoader,C=e.transformGetDocumentParams,w=e.withCredentials,y=void 0!==w&&w,b=e.onDocumentLoad,k=void 0===b?function(){}:b,P=e.onPageChange,O=void 0===P?function(){}:P,L=e.onZoom,R=void 0===L?function(){}:L,T=a.useState({data:i,name:"string"==typeof i?i:"",shouldLoad:!1}),S=T[0],N=T[1],M=function(e,t){console.log(e,t),N({data:t,name:e,shouldLoad:!0})},H=a.useState(!1),B=H[0],F=H[1],I=(t=S,n=a.useRef(t),a.useEffect((function(){n.current=t}),[t]),n.current);a.useEffect((function(){var e,t,n,r;e=I.data,r=typeof(t=i),"string"===(n=typeof e)&&"string"===r&&e===t||"object"===n&&"object"===r&&e.length===t.length&&e.every((function(e,n){return e===t[n]}))||N({data:i,name:"string"==typeof i?i:"",shouldLoad:B})}),[i,B]);var A=g({onVisibilityChanged:function(e){F(e.isVisible),e.isVisible&&N((function(e){return Object.assign({},e,{shouldLoad:!0})}))}});return a.createElement(Ie,{prefixClass:m},a.createElement(v,{localization:p},(function(e){return a.createElement("div",{ref:A,"data-testid":"viewer",style:{height:"100%",width:"100%"}},S.shouldLoad&&a.createElement(Fe,{characterMap:r,file:S.data,httpHeaders:c,render:function(e){return a.createElement(Oe,{defaultScale:o,doc:e,render:function(t){return a.createElement(ke,{doc:e,initialPage:u,pageSize:t,plugins:f,renderPage:E,viewerState:{file:S,pageIndex:u,pageHeight:t.pageHeight,pageWidth:t.pageWidth,rotation:0,scale:t.scale},onDocumentLoad:k,onOpenFile:M,onPageChange:O,onZoom:R})}})},renderError:h,renderLoader:x,transformGetDocumentParams:C,withCredentials:y}))})))},exports.Worker=function(e){var t=e.children,n=e.workerUrl;return o.GlobalWorkerOptions.workerSrc=n,a.createElement(a.Fragment,null,t)},exports.createStore=function(e){var t=e||{},n={};return{subscribe:function(e,t){n[e]=(n[e]||[]).concat(t)},unsubscribe:function(e,t){n[e]=(n[e]||[]).filter((function(e){return e!==t}))},update:function(e,r){var a;t=I(I({},t),((a={})[e]=r,a)),(n[e]||[]).forEach((function(n){return n(t[e])}))},get:function(e){return t[e]}}},exports.getDestination=$,exports.useIntersectionObserver=g,exports.useIsomorphicLayoutEffect=f;
***************************************************************************** */function B(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}H(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var F=function(){return(F=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var I,A=o.createContext({currentTheme:"light",setCurrentTheme:function(){}}),D=function(e){var t=e.children,n=e.theme,r=o.useMemo((function(){return"auto"===n?"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n}),[]),a=o.useState(r),i=a[0],c=a[1];o.useEffect((function(){if("auto"===n){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=function(e){c(e.matches?"dark":"light")};return e.addEventListener("change",t),function(){return e.removeEventListener("change",t)}}}),[]);var l={currentTheme:i,setCurrentTheme:c};return o.createElement(A.Provider,{value:l},t)};!function(e){e[e.PreRender=0]="PreRender",e[e.DidRender=1]="DidRender"}(I||(I={}));var W,j=I;!function(e){e[e.Solid=1]="Solid",e[e.Dashed=2]="Dashed",e[e.Beveled=3]="Beveled",e[e.Inset=4]="Inset",e[e.Underline=5]="Underline"}(W||(W={}));var V,z=W,q=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),U=function(e,t,n,r){var o=parseInt(e,10);return o>=t&&o<=n?o:r},Z=function(e){var t=e.annotation,n=o.useRef(),r="";if(t.modificationDate){var a=function(e){var t=q.exec(e);if(!t)return null;var n=parseInt(t[1],10),r=U(t[2],1,12,1)-1,o=U(t[3],1,31,1),a=U(t[4],0,23,0),i=U(t[5],0,59,0),c=U(t[6],0,59,0),l=t[7]||"Z",s=U(t[8],0,23,0),p=U(t[9],0,59,0);switch(l){case"-":a+=s,i+=p;break;case"+":a-=s,i-=p}return new Date(Date.UTC(n,r,o,a,i,c))}(t.modificationDate);r=a?a.toLocaleDateString()+", "+a.toLocaleTimeString():""}return o.useLayoutEffect((function(){if(n.current){var e=document.querySelector('[data-annotation-id="'+t.id+'"]');if(e){var r=e;return r.style.zIndex+=1,function(){r.style.zIndex=""+(parseInt(r.style.zIndex,10)-1)}}}}),[]),o.createElement("div",{ref:n,className:"rpv-core__annotation-popup-wrapper",style:{top:t.annotationType===c.Popup?"":"100%"}},t.title&&o.createElement("div",{className:"rpv-core__annotation-popup-header"},o.createElement("div",{className:"rpv-core__annotation-popup-title"},t.title),o.createElement("span",{className:"rpv-core__annotation-popup-date"},r)),t.contents&&o.createElement("div",{className:"rpv-core__annotation-popup-content"},t.contents.split("\n").map((function(e,t){return o.createElement(o.Fragment,{key:t},e,o.createElement("br",null))}))))};!function(e){e.Click="Click",e.Hover="Hover"}(V||(V={}));var G=function(e){var t,n=e.annotation,r=e.children,a=e.ignoreBorder,c=e.hasPopup,l=e.isRenderable,s=e.page,p=e.viewport,u=n.rect,d=function(){var e=b(),t=e.opened,n=e.toggle,r=o.useState(V.Hover),a=r[0],c=r[1];return{opened:t,closeOnHover:function(){a===V.Hover&&n(i.Close)},openOnHover:function(){a===V.Hover&&n(i.Open)},toggleOnClick:function(){switch(a){case V.Click:t&&c(V.Hover),n(i.Toggle);break;case V.Hover:c(V.Click),n(i.Open)}}}}(),f=d.closeOnHover,v=d.opened,m=d.openOnHover,g=d.toggleOnClick,h=(t=[u[0],s.view[3]+s.view[1]-u[1],u[2],s.view[3]+s.view[1]-u[3]],[Math.min(t[0],t[2]),Math.min(t[1],t[3]),Math.max(t[0],t[2]),Math.max(t[1],t[3])]),E=u[2]-u[0],w=u[3]-u[1],y={borderColor:"",borderRadius:"",borderStyle:"",borderWidth:""};if(!a&&n.borderStyle.width>0){switch(n.borderStyle.style){case z.Dashed:y.borderStyle="dashed";break;case z.Solid:y.borderStyle="solid";break;case z.Underline:y=Object.assign({borderBottomStyle:"solid"},y);break;case z.Beveled:case z.Inset:}var _=n.borderStyle.width;y.borderWidth=_+"px",n.borderStyle.style!==z.Underline&&(E-=2*_,w-=2*_);var x=n.borderStyle,k=x.horizontalCornerRadius,P=x.verticalCornerRadius;(k>0||P>0)&&(y.borderRadius=k+"px / "+P+"px"),n.color?y.borderColor="rgb("+(0|n.color[0])+", "+(0|n.color[1])+", "+(0|n.color[2])+")":y.borderWidth="0"}return o.createElement(o.Fragment,null,l&&r({popup:{opened:v,closeOnHover:f,openOnHover:m,toggleOnClick:g},slot:{attrs:{style:Object.assign({height:w+"px",left:h[0]+"px",top:h[1]+"px",transform:"matrix("+p.transform.join(",")+")",transformOrigin:"-"+h[0]+"px -"+h[1]+"px",width:E+"px"},y)},children:o.createElement(o.Fragment,null,c&&v&&o.createElement(Z,{annotation:n}))}}))},J=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents);return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--caret","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},K=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents),c=t.rect,l=c[2]-c[0],s=c[3]-c[1],p=t.borderStyle.width;return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--circle","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),o.createElement("svg",{height:s+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+l+" "+s,width:l+"px"},o.createElement("circle",{cy:s/2,fill:"none",rx:l/2-p/2,ry:s/2-p/2,stroke:"transparent",strokeWidth:p||1})),e.slot.children)}))},X=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!(!1!==t.hasPopup||!t.title&&!t.contents),i=function(){var e,n,r,o,a=t.file;a&&(e=a.filename,n=a.content,r="string"==typeof n?"":URL.createObjectURL(new Blob([n],{type:""})),(o=document.createElement("a")).style.display="none",o.href=r||e,o.setAttribute("download",function(e){var t=e.split("/").pop();return t?t.split("#")[0].split("?")[0]:e}(e)),document.body.appendChild(o),o.click(),document.body.removeChild(o),r&&URL.revokeObjectURL(r))};return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:!0,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--file-attachment","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onDoubleClick:i,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Y=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents);return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--free-text","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Q=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!(!t.title&&!t.contents),i=!t.parentType||-1!==["Circle","Ink","Line","Polygon","PolyLine","Square"].indexOf(t.parentType);return v((function(){if(t.parentId){var e=document.querySelector('[data-annotation-id="'+t.parentId+'"]'),n=document.querySelector('[data-annotation-id="'+t.id+'"]');if(e&&n){var r=parseFloat(e.style.left),o=parseFloat(e.style.top)+parseFloat(e.style.height);n.style.left=r+"px",n.style.top=o+"px",n.style.transformOrigin="-"+r+"px -"+o+"px"}}}),[]),o.createElement(G,{annotation:t,hasPopup:i,ignoreBorder:!1,isRenderable:a,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--popup","data-annotation-id":t.id}),o.createElement(Z,{annotation:t}))}))},$=function(e){var t=e.annotation,n=e.childAnnotation,r=e.page,a=e.viewport,i=!1===t.hasPopup,l=!!(t.hasPopup||t.title||t.contents);if(t.quadPoints&&t.quadPoints.length>0){var s=t.quadPoints.map((function(e){return Object.assign({},t,{rect:[e[2].x,e[2].y,e[1].x,e[1].y],quadPoints:[]})}));return o.createElement(o.Fragment,null,s.map((function(e,t){return o.createElement($,{key:t,annotation:e,childAnnotation:n,page:r,viewport:a})})))}return o.createElement(G,{annotation:t,hasPopup:i,ignoreBorder:!0,isRenderable:l,page:r,viewport:a},(function(e){return o.createElement(o.Fragment,null,o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--highlight","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children),n&&n.annotationType===c.Popup&&e.popup.opened&&o.createElement(Q,{annotation:n,page:r,viewport:a}))}))},ee=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents),c=t.rect,l=c[2]-c[0],s=c[3]-c[1],p=t.borderStyle.width;return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--ink","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.inkLists&&t.inkLists.length&&o.createElement("svg",{height:s+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+l+" "+s,width:l+"px"},t.inkLists.map((function(e,t){return o.createElement("polyline",{key:t,fill:"none",stroke:"transparent",strokeWidth:p||1,points:e.map((function(e){return e.x-c[0]+","+(c[3]-e.y)})).join(" ")})}))),e.slot.children)}))},te=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents),c=t.rect,l=c[2]-c[0],s=c[3]-c[1],p=t.borderStyle.width;return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--line","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),o.createElement("svg",{height:s+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+l+" "+s,width:l+"px"},o.createElement("line",{stroke:"transparent",strokeWidth:p||1,x1:c[2]-t.lineCoordinates[0],x2:c[2]-t.lineCoordinates[2],y1:c[3]-t.lineCoordinates[1],y2:c[3]-t.lineCoordinates[3]})),e.slot.children)}))},ne=function(e,t){return new Promise((function(n){new Promise((function(n){"string"==typeof t?e.getDestination(t).then((function(e){n(e)})):n(t)})).then((function(t){return"object"==typeof t[0]?e.getPageIndex(t[0]).then((function(e){return Promise.resolve({pageIndex:e,destArray:t})})):Promise.resolve({pageIndex:t[0],destArray:t})})).then((function(e){var t=function(e,t){switch(t[1].name){case"XYZ":return{bottomOffset:t[3],pageIndex:e-1,scaleTo:t[4]};case"Fit":case"FitB":return{bottomOffset:0,pageIndex:e-1,scaleTo:M.PageFit};case"FitH":case"FitBH":return{bottomOffset:t[2],pageIndex:e-1,scaleTo:M.PageWidth};default:return{bottomOffset:0,pageIndex:e-1,scaleTo:1}}}(e.pageIndex,e.destArray);n(t)}))}))},re=function(e){var t=e.annotation,n=e.doc,r=e.page,a=e.viewport,i=e.onExecuteNamedAction,c=e.onJumpToDest,l=!!(t.url||t.dest||t.action),s=t.url?{href:t.url,rel:"noopener noreferrer nofollow",target:t.newWindow?"_blank":"",title:t.url}:{href:"",onClick:function(e){e.preventDefault(),t.action?i(t.action):ne(n,t.dest).then((function(e){var t=e.pageIndex,n=e.bottomOffset,r=e.scaleTo;c(n?t+1:t,n,0,r)}))}};return o.createElement(G,{annotation:t,hasPopup:!1,ignoreBorder:!1,isRenderable:l,page:r,viewport:a},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--link","data-annotation-id":t.id}),o.createElement("a",F({},s)))}))},oe=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents),c=t.rect,l=c[2]-c[0],s=c[3]-c[1],p=t.borderStyle.width;return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polygon","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.vertices&&t.vertices.length&&o.createElement("svg",{height:s+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+l+" "+s,width:l+"px"},o.createElement("polygon",{fill:"none",stroke:"transparent",strokeWidth:p||1,points:t.vertices.map((function(e){return e.x-c[0]+","+(c[3]-e.y)})).join(" ")})),e.slot.children)}))},ae=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents),c=t.rect,l=c[2]-c[0],s=c[3]-c[1],p=t.borderStyle.width;return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polyline","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.vertices&&t.vertices.length&&o.createElement("svg",{height:s+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+l+" "+s,width:l+"px"},o.createElement("polyline",{fill:"none",stroke:"transparent",strokeWidth:p||1,points:t.vertices.map((function(e){return e.x-c[0]+","+(c[3]-e.y)})).join(" ")})),e.slot.children)}))},ie=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents),c=t.rect,l=c[2]-c[0],s=c[3]-c[1],p=t.borderStyle.width;return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--square","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),o.createElement("svg",{height:s+"px",preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 "+l+" "+s,width:l+"px"},o.createElement("rect",{height:s-p,fill:"none",stroke:"transparent",strokeWidth:p||1,x:p/2,y:p/2,width:l-p})),e.slot.children)}))},ce=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents);return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--squiggly","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},le=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents);return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--stamp","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},se=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents);return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--strike-out","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},pe=function(){return o.createElement(l,{size:16},o.createElement("path",{d:"M.5,16.5a1,1,0,0,0,1,1h2v4l4-4h15a1,1,0,0,0,1-1V3.5a1,1,0,0,0-1-1H1.5a1,1,0,0,0-1,1Z"}),o.createElement("path",{d:"M7.25,9.75A.25.25,0,1,1,7,10a.25.25,0,0,1,.25-.25"}),o.createElement("path",{d:"M12,9.75a.25.25,0,1,1-.25.25A.25.25,0,0,1,12,9.75"}),o.createElement("path",{d:"M16.75,9.75a.25.25,0,1,1-.25.25.25.25,0,0,1,.25-.25"}))},ue=function(){return o.createElement(l,{size:16},o.createElement("path",{d:"M0.500 12.001 A11.500 11.500 0 1 0 23.500 12.001 A11.500 11.500 0 1 0 0.500 12.001 Z"}),o.createElement("path",{d:"M6.000 12.001 A6.000 6.000 0 1 0 18.000 12.001 A6.000 6.000 0 1 0 6.000 12.001 Z"}),o.createElement("path",{d:"M21.423 5.406L17.415 9.414"}),o.createElement("path",{d:"M14.587 6.585L18.607 2.565"}),o.createElement("path",{d:"M5.405 21.424L9.413 17.416"}),o.createElement("path",{d:"M6.585 14.588L2.577 18.596"}),o.createElement("path",{d:"M18.602 21.419L14.595 17.412"}),o.createElement("path",{d:"M17.419 14.58L21.428 18.589"}),o.createElement("path",{d:"M2.582 5.399L6.588 9.406"}),o.createElement("path",{d:"M9.421 6.581L5.412 2.572"}))},de=function(){return o.createElement(l,{size:16},o.createElement("path",{d:"M4.000 18.500 A1.500 1.500 0 1 0 7.000 18.500 A1.500 1.500 0 1 0 4.000 18.500 Z"}),o.createElement("path",{d:"M20.5.5l-9.782,9.783a7,7,0,1,0,3,3L17,10h1.5V8.5L19,8h1.5V6.5L21,6h1.5V4.5l1-1V.5Z"}))},fe=function(){return o.createElement(l,{size:16},o.createElement("path",{d:"M2.000 2.500 L22.000 2.500 L22.000 23.500 L2.000 23.500 Z"}),o.createElement("path",{d:"M6 4.5L6 0.5"}),o.createElement("path",{d:"M18 4.5L18 0.5"}),o.createElement("path",{d:"M10 4.5L10 0.5"}),o.createElement("path",{d:"M14 4.5L14 0.5"}))},ve=function(){return o.createElement(l,{size:16},o.createElement("path",{d:"M17.5 0.498L17.5 23.498"}),o.createElement("path",{d:"M10.5 0.498L10.5 23.498"}),o.createElement("path",{d:"M23.5.5H6.5a6,6,0,0,0,0,12h4"}))},me=function(){return o.createElement(l,{size:16},o.createElement("path",{d:"M2.5 22.995L12 6.005 21.5 22.995 2.5 22.995z"}))},ge=function(e){var t=e.annotation,n=e.childAnnotation,r=e.page,a=e.viewport,i=!1===t.hasPopup,l=!!(t.hasPopup||t.title||t.contents),p=t.name?t.name.toLowerCase():"";return o.createElement(G,{annotation:t,hasPopup:i,ignoreBorder:!1,isRenderable:l,page:r,viewport:a},(function(e){return o.createElement(o.Fragment,null,o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--text","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),p&&o.createElement("div",{className:"rpv-core__annotation-text-icon"},"check"===p&&o.createElement(s,null),"comment"===p&&o.createElement(pe,null),"help"===p&&o.createElement(ue,null),"insert"===p&&o.createElement(me,null),"key"===p&&o.createElement(de,null),"note"===p&&o.createElement(fe,null),("newparagraph"===p||"paragraph"===p)&&o.createElement(ve,null)),e.slot.children),n&&n.annotationType===c.Popup&&e.popup.opened&&o.createElement(Q,{annotation:n,page:r,viewport:a}))}))},he=function(e){var t=e.annotation,n=e.page,r=e.viewport,a=!1===t.hasPopup,i=!!(t.hasPopup||t.title||t.contents);return o.createElement(G,{annotation:t,hasPopup:a,ignoreBorder:!0,isRenderable:i,page:n,viewport:r},(function(e){return o.createElement("div",F({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--underline","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Ee=function(e){var t=e.annotations,n=e.containerRef,r=e.doc,a=e.page,i=e.pageIndex,l=e.plugins,s=e.rotation,p=e.scale,u=e.onExecuteNamedAction,d=e.onJumpToDest,f=a.getViewport({rotation:s,scale:p}).clone({dontFlip:!0}),v=t.filter((function(e){return!e.parentId}));return o.useEffect((function(){var e=n.current;e&&l.forEach((function(t){t.onAnnotationLayerRender&&t.onAnnotationLayerRender({annotations:v,container:e,pageIndex:i,rotation:s,scale:p})}))}),[]),o.createElement(o.Fragment,null,v.map((function(e){var n=t.find((function(t){return t.parentId===e.id}));switch(e.annotationType){case c.Caret:return o.createElement(J,{key:e.id,annotation:e,page:a,viewport:f});case c.Circle:return o.createElement(K,{key:e.id,annotation:e,page:a,viewport:f});case c.FileAttachment:return o.createElement(X,{key:e.id,annotation:e,page:a,viewport:f});case c.FreeText:return o.createElement(Y,{key:e.id,annotation:e,page:a,viewport:f});case c.Highlight:return o.createElement($,{key:e.id,annotation:e,childAnnotation:n,page:a,viewport:f});case c.Ink:return o.createElement(ee,{key:e.id,annotation:e,page:a,viewport:f});case c.Line:return o.createElement(te,{key:e.id,annotation:e,page:a,viewport:f});case c.Link:return o.createElement(re,{key:e.id,annotation:e,doc:r,page:a,viewport:f,onExecuteNamedAction:u,onJumpToDest:d});case c.Polygon:return o.createElement(oe,{key:e.id,annotation:e,page:a,viewport:f});case c.Polyline:return o.createElement(ae,{key:e.id,annotation:e,page:a,viewport:f});case c.Popup:return o.createElement(Q,{key:e.id,annotation:e,page:a,viewport:f});case c.Square:return o.createElement(ie,{key:e.id,annotation:e,page:a,viewport:f});case c.Squiggly:return o.createElement(ce,{key:e.id,annotation:e,page:a,viewport:f});case c.Stamp:return o.createElement(le,{key:e.id,annotation:e,page:a,viewport:f});case c.StrikeOut:return o.createElement(se,{key:e.id,annotation:e,page:a,viewport:f});case c.Text:return o.createElement(ge,{key:e.id,annotation:e,childAnnotation:n,page:a,viewport:f});case c.Underline:return o.createElement(he,{key:e.id,annotation:e,page:a,viewport:f});default:return o.createElement(o.Fragment,{key:e.id})}})))},we=function(e){var t=e.page,n=e.renderAnnotations,r=o.useState({loading:!0,annotations:[]}),a=r[0],i=r[1];return o.useEffect((function(){t.getAnnotations({intent:"display"}).then((function(e){i({loading:!1,annotations:e})}))}),[]),a.loading?o.createElement(o.Fragment,null):n(a.annotations)},ye=function(e){var t=e.doc,n=e.page,r=e.pageIndex,a=e.plugins,i=e.rotation,c=e.scale,l=e.onExecuteNamedAction,s=e.onJumpToDest,p=o.useRef();return o.createElement("div",{ref:p,className:"rpv-core__annotation-layer"},o.createElement(we,{page:n,renderAnnotations:function(e){return o.createElement(Ee,{annotations:e,containerRef:p,doc:t,page:n,pageIndex:r,plugins:a,rotation:i,scale:c,onExecuteNamedAction:l,onJumpToDest:s})}}))},_e=function(e){var t=e.callback,n=e.children,r=e.rotation,a=e.scale;return v((function(){t()}),[r,a]),o.createElement(o.Fragment,null,n)},xe=function(e){var t=e.height,n=e.page,r=e.pageIndex,a=e.plugins,i=e.rotation,c=e.scale,l=e.width,s=o.useRef(),p=o.useRef(),u=o.useState(!1),f=u[0],v=u[1],m=window.devicePixelRatio||1;return o.createElement(_e,{callback:function(){v(!1);var e=p.current;e&&e.cancel();var o=s.current;a.forEach((function(e){e.onCanvasLayerRender&&e.onCanvasLayerRender({ele:o,pageIndex:r,rotation:i,scale:c,status:j.PreRender})})),o.height=t*m,o.width=l*m,o.style.opacity="0";var u=o.getContext("2d",{alpha:!1}),d=n.getViewport({rotation:i,scale:c*m});p.current=n.render({canvasContext:u,viewport:d}),p.current.promise.then((function(){v(!0),o.style.removeProperty("opacity"),a.forEach((function(e){e.onCanvasLayerRender&&e.onCanvasLayerRender({ele:o,pageIndex:r,rotation:i,scale:c,status:j.DidRender})}))}),(function(){v(!0)}))},rotation:i,scale:c},o.createElement("div",{className:"rpv-core__canvas-layer",style:{height:t+"px",width:l+"px"}},!f&&o.createElement("div",{className:"rpv-core__canvas-layer-loader"},o.createElement(d,null)),o.createElement("canvas",{ref:s,style:{transform:"scale("+1/m+")",transformOrigin:"top left"}})))},ke=function(e){var t=e.height,n=e.page,r=e.rotation,i=e.scale,c=e.width,l=o.useRef();return o.createElement(_e,{callback:function(){var e=l.current,o=n.getViewport({rotation:r,scale:i});n.getOperatorList().then((function(r){!function(){var e=l.current;e&&(e.innerHTML="")}(),new a.SVGGraphics(n.commonObjs,n.objs).getSVG(r,o).then((function(n){n.style.height=t+"px",n.style.width=c+"px",e.appendChild(n)}))}))},rotation:r,scale:i},o.createElement("div",{className:"rpv-core__svg-layer",ref:l}))},be=function(e){var t=e.page,n=e.pageIndex,r=e.plugins,i=e.rotation,c=e.scale,l=o.useRef(),s=o.useRef();return o.createElement(_e,{callback:function(){var e=s.current;e&&e.cancel();var o=l.current;if(o){var p=t.getViewport({rotation:i,scale:c});r.forEach((function(e){e.onTextLayerRender&&e.onTextLayerRender({ele:o,pageIndex:n,scale:c,status:j.PreRender})})),t.getTextContent().then((function(e){!function(){var e=l.current;if(e)for(var t=e.querySelectorAll("span.rpv-core__text-layer-text"),n=t.length,r=0;r<n;r++){var o=t[r];e.removeChild(o)}}(),s.current=a.renderTextLayer({container:o,textContent:e,viewport:p,enhanceTextSelection:!0}),s.current.promise.then((function(){for(var e=o.childNodes,t=e.length,a=0;a<t;a++){e[a].classList.add("rpv-core__text-layer-text")}r.forEach((function(e){e.onTextLayerRender&&e.onTextLayerRender({ele:o,pageIndex:n,scale:c,status:j.DidRender})}))}),(function(){}))}))}},rotation:i,scale:c},o.createElement("div",{className:"rpv-core__text-layer",ref:l}))},Pe=function(e){var t=e.currentPage,n=e.doc,r=e.height,a=e.pageIndex,i=e.plugins,c=e.renderPage,l=e.rotation,s=e.scale,p=e.width,u=e.onExecuteNamedAction,f=e.onJumpToDest,v=e.onPageVisibilityChanged,g=o.useState({page:null,pageHeight:r,pageWidth:p,viewportRotation:0}),h=g[0],E=g[1],w=h.page,y=h.pageHeight,_=h.pageWidth,x=o.useRef(!1),k=Array(10).fill(null).map((function(e,t){return t/10})),b=_*s,P=y*s,C=Math.abs(l)%180==0,O=C?b:P,L=C?P:b,R=function(){x.current||(x.current=!0,n.getPage(a+1).then((function(e){var t=e.getViewport({scale:1});E({page:e,pageHeight:t.height,pageWidth:t.width,viewportRotation:t.rotation})})))},T=c||function(e){return o.createElement(o.Fragment,null,e.canvasLayer.children,e.textLayer.children,e.annotationLayer.children)},S=(l+h.viewportRotation)%360,N=m({threshold:k,onVisibilityChanged:function(e){v(a,e.isVisible?e.ratio:-1),e.isVisible&&R()}});return o.useEffect((function(){t-2<=a&&a<=t+2&&R()}),[t]),o.createElement("div",{ref:N,className:"rpv-core__page-layer","data-testid":"viewer-page-layer-"+a,style:{height:L+"px",width:O+"px"}},w?o.createElement(o.Fragment,null,T({annotationLayer:{attrs:{},children:o.createElement(ye,{doc:n,page:w,pageIndex:a,plugins:i,rotation:S,scale:s,onExecuteNamedAction:u,onJumpToDest:f})},canvasLayer:{attrs:{},children:o.createElement(xe,{height:L,page:w,pageIndex:a,plugins:i,rotation:S,scale:s,width:O})},doc:n,height:L,pageIndex:a,rotation:l,scale:s,svgLayer:{attrs:{},children:o.createElement(ke,{height:L,page:w,rotation:S,scale:s,width:O})},textLayer:{attrs:{},children:o.createElement(be,{page:w,pageIndex:a,plugins:i,rotation:S,scale:s})},width:O}),i.map((function(e,t){return e.renderPageLayer?o.createElement(o.Fragment,{key:t},e.renderPageLayer({doc:n,height:L,pageIndex:a,rotation:l,scale:s,width:O})):o.createElement(o.Fragment,{key:t})}))):o.createElement(d,null))},Ce=function(e,t,n,r){switch(r){case M.ActualSize:return 1;case M.PageFit:return Math.min((e.clientWidth-17)/n,(e.clientHeight-16)/t);case M.PageWidth:return(e.clientWidth-17)/n}},Oe=function(e){var t=e.doc,n=e.initialPage,r=e.pageSize,a=e.plugins,i=e.renderPage,c=e.viewerState,l=e.onDocumentLoad,s=e.onOpenFile,p=e.onPageChange,u=e.onZoom,d=o.useRef(null),f=o.useRef(null),v=o.useState(0),m=v[0],g=v[1],h=o.useState(0),E=h[0],w=h[1],y=o.useRef(c),_=o.useState(r.scale),x=_[0],k=_[1],b=t.numPages,P=r.pageWidth,C=r.pageHeight,O=Array(b).fill(null),L=O.map((function(){return 0})),R=O.map((function(){return o.useRef()})),T=function(e){var t=e;a.forEach((function(e){e.onViewerStateChange&&(t=e.onViewerStateChange(t))})),y.current=t},S=function(){return f.current},N=function(e){return e<0||e>=b?null:R[e].current},H=function(){return y.current},B=function(e,n,r,o){var a=f.current,i=y.current;if(a&&i){var c=e+1;t.getPage(c).then((function(t){var c=t.getViewport({scale:1}),l=0,s=n||0,p=r||0,u=i.scale;switch(o){case M.PageFit:l=0,p=0,W(M.PageFit);break;case M.PageWidth:u=Ce(a,C,P,M.PageWidth),l=(c.height-s)*u,p*=u,W(u);break;default:l=(c.height-s)*i.scale,p*=i.scale}var d=R[e].current;d&&(a.scrollTop=d.offsetTop+l,a.scrollLeft=d.offsetLeft+p)}))}},I=function(e){if(!(e<0||e>=b)){var t=f.current,n=R[e].current;t&&n&&(t.scrollTop=n.offsetTop,t.scrollLeft=n.offsetLeft),g(e)}},A=function(e){var t,n;"pdf"===(t=e.name,n=t.split(/\./).pop(),n?n.toLowerCase():"").toLowerCase()&&new Promise((function(t){var n=new FileReader;n.readAsArrayBuffer(e),n.onload=function(){var e=new Uint8Array(n.result);t(e)}})).then((function(t){s(e.name,t)}))},D=function(e){w(e),T({file:c.file,pageIndex:m,pageHeight:C,pageWidth:P,rotation:e,scale:x})},W=function(e){var n=f.current,r=n?"string"==typeof e?Ce(n,C,P,e):e:1;k(r),u({doc:t,scale:r})};o.useEffect((function(){var e=f.current,t=y.current;e&&t&&(e.scrollTop=e.scrollTop*x/t.scale,e.scrollLeft=e.scrollLeft*x/t.scale,T({file:c.file,pageIndex:t.pageIndex,pageHeight:C,pageWidth:P,rotation:E,scale:x}))}),[x]);o.useEffect((function(){var e={getPageElement:N,getPagesContainer:S,getViewerState:H,jumpToDestination:B,jumpToPage:I,openFile:A,rotate:D,setViewerState:T,zoom:W};return a.forEach((function(t){t.install&&t.install(e)})),function(){a.forEach((function(t){t.uninstall&&t.uninstall(e)}))}}),[]),o.useEffect((function(){l({doc:t}),a.forEach((function(e){e.onDocumentLoad&&e.onDocumentLoad({doc:t})})),n&&I(n)}),[]),o.useEffect((function(){p({currentPage:m,doc:t}),T({file:c.file,pageIndex:m,pageHeight:C,pageWidth:P,rotation:E,scale:x})}),[m]);var j,V=function(e,t){L[e]=t;var n=L.reduce((function(e,t,n,r){return t>r[e]?n:e}),0);g(n)},z=function(e){var t=m-1,n=m+1;switch(e){case"FirstPage":I(0);break;case"LastPage":I(b-1);break;case"NextPage":n<b&&I(n);break;case"PrevPage":t>=0&&I(t)}},q=function(e){return o.createElement("div",F({},e.attrs,{style:e.attrs&&e.attrs.style?e.attrs.style:{}}),e.children,e.subSlot&&q(e.subSlot))};return q((j={attrs:{ref:d,style:{height:"100%"}},children:o.createElement(o.Fragment,null),subSlot:{attrs:{ref:f,style:{height:"100%",overflow:"auto",position:"relative"}},children:o.createElement(o.Fragment,null,Array(b).fill(0).map((function(e,n){return o.createElement("div",{className:"rpv-core__inner-page",key:"pagelayer-"+n,ref:function(e){R[n].current=e}},o.createElement(Pe,{currentPage:m,doc:t,height:C,pageIndex:n,plugins:a,renderPage:i,rotation:E,scale:x,width:P,onExecuteNamedAction:z,onJumpToDest:B,onPageVisibilityChanged:V}))})))}},a.forEach((function(e){e.renderViewer&&(j=e.renderViewer({containerRef:d,doc:t,pageHeight:C,pageWidth:P,rotation:E,slot:j,jumpToPage:I,openFile:A,rotate:D,zoom:W}))})),j))},Le=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.3,1.5,1.7,1.9,2.1,2.4,2.7,3,3.3,3.7,4.1,4.6,5.1,5.7,6.3,7,7.7,8.5,9.4,10],Re=function(e){var t=e.defaultScale,n=e.doc,r=e.render,a=o.useRef(null),i=o.useState({pageHeight:0,pageWidth:0,scale:1}),c=i[0],l=i[1];return o.useEffect((function(){n.getPage(1).then((function(e){var n=e.getViewport({scale:1}),r=n.width,o=n.height,i=a.current;if(i){var c,s,p=(i.clientWidth-100)/r,u=t?"string"==typeof t?Ce(i,o,r,t):t:(c=p,-1===(s=Le.findIndex((function(e){return e>=c})))||0===s?c:Le[s-1]);l({pageHeight:o,pageWidth:r,scale:u})}}))}),[n]),0===c.pageWidth?o.createElement("div",{className:"rpv-core__page-size-calculator",ref:a},o.createElement(d,null)):r(c)},Te=function(){},Se=function(e){function t(t){var n=e.call(this)||this;return n.verifyPasswordFn=t,n}return B(t,e),t}(Te),Ne=function(e){var t=e.verifyPasswordFn,n=o.useContext(g),r=o.useState(""),a=r[0],i=r[1];return o.createElement("div",{className:"rpv-core__asking-password-wrapper"},o.createElement("div",{className:"rpv-core__asking-password"},o.createElement("div",{className:"rpv-core__asking-password-message"},n.core.askingPassword.requirePasswordToOpen,":"),o.createElement("div",{className:"rpv-core__asking-password-body"},o.createElement("div",{className:"rpv-core__asking-password-input"},o.createElement(f,{type:"password",value:a,onChange:i})),o.createElement(u,{onClick:function(){return t(a)}},n.core.askingPassword.submit))))},Me=function(e){function t(t){var n=e.call(this)||this;return n.doc=t,n}return B(t,e),t}(Te),He=function(e){function t(t){var n=e.call(this)||this;return n.error=t,n}return B(t,e),t}(Te),Be=function(e){function t(t){var n=e.call(this)||this;return n.percentages=t,n}return B(t,e),t}(Te),Fe=function(e){var t=e.verifyPasswordFn,n=o.useContext(g),r=o.useState(""),a=r[0],i=r[1];return o.createElement("div",{className:"rpv-core__asking-password-wrapper"},o.createElement("div",{className:"rpv-core__asking-password"},o.createElement("div",{className:"rpv-core__asking-password-message"},n.core.wrongPassword.tryAgain,":"),o.createElement("div",{className:"rpv-core__asking-password-body"},o.createElement("div",{className:"rpv-core__asking-password-input"},o.createElement(f,{type:"password",value:a,onChange:i})),o.createElement("button",{className:"rpv-core__asking-password-button",onClick:function(){return t(a)}},n.core.wrongPassword.submit))))},Ie=function(e){function t(t){var n=e.call(this)||this;return n.verifyPasswordFn=t,n}return B(t,e),t}(Te),Ae=function(e){var t,n=e.characterMap,r=e.file,i=e.httpHeaders,c=e.render,l=e.renderError,s=e.renderLoader,p=e.transformGetDocumentParams,u=e.withCredentials,f=o.useState(new Be(0)),v=f[0],m=f[1],g=o.useState(0),h=g[0],E=g[1],w=o.useState(null),y=w[0],_=w[1],x=(t=o.useRef(!1),o.useEffect((function(){return t.current=!0,function(){t.current=!1}}),[]),t);switch(o.useEffect((function(){m(new Be(0));var e=new a.PDFWorker({name:"PDFWorker_"+Date.now()}),t=Object.assign({httpHeaders:i,withCredentials:u,worker:e},"string"==typeof r?{url:r}:{data:r},n?{cMapUrl:n.url,cMapPacked:n.isCompressed}:{}),o=p?p(t):t,c=a.getDocument(o);return c.onPassword=function(e,t){switch(t){case a.PasswordResponses.NEED_PASSWORD:x.current&&m(new Se(e));break;case a.PasswordResponses.INCORRECT_PASSWORD:x.current&&m(new Ie(e))}},c.onProgress=function(e){e.total>0?x.current&&E(Math.min(100,100*e.loaded/e.total)):x.current&&E(100)},c.promise.then((function(e){return x.current&&_(e)}),(function(t){return x.current&&!e.destroyed&&m(new He({message:t.message||"Cannot load document",name:t.name}))})),function(){c.destroy(),e.destroy()}}),[r]),o.useEffect((function(){100===h&&y?x.current&&m(new Me(y)):x.current&&m(new Be(h))}),[h,y]),!0){case v instanceof Se:return o.createElement(Ne,{verifyPasswordFn:v.verifyPasswordFn});case v instanceof Ie:return o.createElement(Fe,{verifyPasswordFn:v.verifyPasswordFn});case v instanceof Me:return c(v.doc);case v instanceof He:return l?l(v.error):o.createElement("div",{className:"rpv-core__doc-error"},o.createElement("div",{className:"rpv-core__doc-error-text"},v.error.message));case v instanceof Be:return o.createElement("div",{className:"rpv-core__doc-loading"},s?s(v.percentages):o.createElement(d,null));default:return o.createElement("div",{className:"rpv-core__doc-loading"},o.createElement(d,null))}};exports.AnnotationType=c,exports.Button=function(e){var t=e.children,n=e.onClick;return o.createElement("button",{className:"rpv-core__button",onClick:n},t)},exports.Icon=l,exports.LayerRenderStatus=j,exports.LocalizationContext=g,exports.LocalizationProvider=E,exports.Menu=function(e){var t=e.children;return o.createElement("ul",{className:"rpv-core__menu"},t)},exports.MenuDivider=function(){return o.createElement("li",{className:"rpv-core__menu-divider"})},exports.MenuItem=function(e){var t=e.checked,n=void 0!==t&&t,r=e.children,a=e.icon,i=void 0===a?null:a,c=e.isDisabled,l=void 0!==c&&c,u=e.onClick;return o.createElement("li",{className:p({"rpv-core__menu-item":!0,"rpv-core__menu-item--disabled":l}),onClick:u},o.createElement("div",{className:"rpv-core__menu-item-icon"},i),o.createElement("div",{className:"rpv-core__menu-item-label"},r),o.createElement("div",{className:"rpv-core__menu-item-check"},n&&o.createElement(s,null)))},exports.MinimalButton=function(e){var t=e.children,n=e.isDisabled,r=void 0!==n&&n,a=e.isSelected,i=void 0!==a&&a,c=e.onClick;return o.createElement("button",{className:p({"rpv-core__minimal-button":!0,"rpv-core__minimal-button--disabled":r,"rpv-core__minimal-button--selected":i}),onClick:c},t)},exports.Modal=function(e){var t=e.closeOnClickOutside,n=e.closeOnEscape,r=e.content,a=e.target;return o.createElement(P,{target:a,content:function(e){return o.createElement(x,null,o.createElement(_,{closeOnClickOutside:t,closeOnEscape:n,onToggle:e},r(e)))}})},exports.Popover=function(e){var t=e.closeOnClickOutside,n=e.closeOnEscape,r=e.content,a=e.offset,i=e.position,c=e.target,l=o.useRef();return o.createElement(P,{content:function(e){return o.createElement(o.Fragment,null,o.createElement(S,{closeOnEscape:n,onClose:e}),o.createElement(T,{closeOnClickOutside:t,offset:a,position:i,targetRef:l,onClose:e},r(e)))},target:function(e,t){return o.createElement("div",{ref:l},c(e,t))}})},exports.Position=O,exports.PrimaryButton=u,exports.ProgressBar=function(e){var t=e.progress;return o.createElement("div",{className:"rpv-core__progress-bar"},o.createElement("div",{className:"rpv-core__progress-bar-progress",style:{width:t+"%"}},t,"%"))},exports.Separator=function(){return o.createElement("div",{className:"rpv-core__separator"})},exports.SpecialZoomLevel=M,exports.Spinner=d,exports.TextBox=f,exports.ThemeContext=A,exports.ThemeProvider=D,exports.Tooltip=function(e){var t=e.content,n=e.offset,r=e.position,a=e.target,c=o.useRef();return o.createElement(P,{target:function(e){return o.createElement("div",{ref:c,onMouseEnter:function(){e(i.Open)},onMouseLeave:function(){e(i.Close)}},a)},content:function(){return o.createElement(N,{offset:n,position:r,targetRef:c},t())}})},exports.Viewer=function(e){var t,n,r=e.characterMap,a=e.defaultScale,i=e.fileUrl,c=e.httpHeaders,l=void 0===c?{}:c,s=e.initialPage,p=void 0===s?0:s,u=e.localization,d=e.plugins,f=void 0===d?[]:d,v=e.renderError,g=e.renderPage,h=e.renderLoader,w=e.transformGetDocumentParams,y=e.theme,_=void 0===y?"light":y,x=e.withCredentials,k=void 0!==x&&x,b=e.onDocumentLoad,P=void 0===b?function(){}:b,C=e.onPageChange,O=void 0===C?function(){}:C,L=e.onZoom,R=void 0===L?function(){}:L,T=o.useState({data:i,name:"string"==typeof i?i:"",shouldLoad:!1}),S=T[0],N=T[1],M=function(e,t){N({data:t,name:e,shouldLoad:!0})},H=o.useState(!1),B=H[0],F=H[1],I=(t=S,n=o.useRef(t),o.useEffect((function(){n.current=t}),[t]),n.current);o.useEffect((function(){var e,t,n,r;e=I.data,r=typeof(t=i),"string"===(n=typeof e)&&"string"===r&&e===t||"object"===n&&"object"===r&&e.length===t.length&&e.every((function(e,n){return e===t[n]}))||N({data:i,name:"string"==typeof i?i:"",shouldLoad:B})}),[i,B]);var W=m({onVisibilityChanged:function(e){F(e.isVisible),e.isVisible&&N((function(e){return Object.assign({},e,{shouldLoad:!0})}))}});return o.createElement(D,{theme:_},o.createElement(E,{localization:u},(function(e){var t=o.useContext(A);return o.createElement("div",{ref:W,className:"rpv-core__viewer rpv-core__viewer--"+t.currentTheme,"data-testid":"viewer",style:{height:"100%",width:"100%"}},S.shouldLoad&&o.createElement(Ae,{characterMap:r,file:S.data,httpHeaders:l,render:function(e){return o.createElement(Re,{defaultScale:a,doc:e,render:function(t){return o.createElement(Oe,{doc:e,initialPage:p,pageSize:t,plugins:f,renderPage:g,viewerState:{file:S,pageIndex:p,pageHeight:t.pageHeight,pageWidth:t.pageWidth,rotation:0,scale:t.scale},onDocumentLoad:P,onOpenFile:M,onPageChange:O,onZoom:R})}})},renderError:v,renderLoader:h,transformGetDocumentParams:w,withCredentials:k}))})))},exports.Worker=function(e){var t=e.children,n=e.workerUrl;return a.GlobalWorkerOptions.workerSrc=n,o.createElement(o.Fragment,null,t)},exports.createStore=function(e){var t=e||{},n={};return{subscribe:function(e,t){n[e]=(n[e]||[]).concat(t)},unsubscribe:function(e,t){n[e]=(n[e]||[]).filter((function(e){return e!==t}))},update:function(e,r){var o;t=F(F({},t),((o={})[e]=r,o)),(n[e]||[]).forEach((function(n){return n(t[e])}))},get:function(e){return t[e]}}},exports.getDestination=ne,exports.useIntersectionObserver=m,exports.useIsomorphicLayoutEffect=v;

@@ -196,2 +196,3 @@ /**

// Localization provider
export interface LocalizationMap {

@@ -211,2 +212,15 @@ [key: string]: LocalizationMap;

// Theme provider
export interface ThemeContextProps {
currentTheme: string;
setCurrentTheme: (theme: string) => void;
}
export const ThemeContext: React.Context<ThemeContextProps>;
export interface ThemeProviderProps {
theme?: string;
}
export class ThemeProvider extends React.Component<ThemeProviderProps> {}
export interface Offset {

@@ -278,4 +292,4 @@ left: number;

// Button
export interface ButtonProps {
// Minimal button
export interface MinimalButtonProps {
isDisabled?: boolean;

@@ -286,4 +300,18 @@ isSelected?: boolean;

export class MinimalButton extends React.Component<MinimalButtonProps> {}
// Normal button
export interface ButtonProps {
onClick(): void;
}
export class Button extends React.Component<ButtonProps> {}
// Primary button
export interface PrimaryButtonProps {
onClick(): void;
}
export class PrimaryButton extends React.Component<PrimaryButtonProps> {}
// Icon

@@ -338,9 +366,2 @@ export interface IconProps {

// Primary button
export interface PrimaryButtonProps {
onClick(): void;
}
export class PrimaryButton extends React.Component<PrimaryButtonProps> {}
// Progress bar

@@ -359,2 +380,12 @@ export interface ProgressBarProps {

// Textbox
export interface TextBoxProps {
placeholder?: string;
type?: string;
value?: string;
onChange: (value: string) => void;
onKeyDown?: (e: React.KeyboardEvent) => void;
}
export class TextBox extends React.Component<TextBoxProps> {}
// Tooltip

@@ -590,7 +621,7 @@ export type RenderTooltipContent = () => React.ReactNode;

localization?: LocalizationMap;
// The prefix for CSS classes
prefixClass?: string;
renderError?: RenderError;
renderPage?: RenderPage;
renderLoader?(percentages: number): React.ReactElement;
// Theme
theme?: string;
transformGetDocumentParams?(

@@ -597,0 +628,0 @@ options: PdfJs.GetDocumentParams

{
"name": "@react-pdf-viewer/core",
"version": "2.5.0",
"version": "2.6.0",
"description": "A React component to view a PDF document",

@@ -50,3 +50,3 @@ "license": "https://react-pdf-viewer.dev/license",

},
"gitHead": "3c7ba1ea082607670f4e2bf69d5312a14baf7057"
"gitHead": "91d6279570bd3d4672b131100392afd6e8658892"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc