@pdftron/webviewer
Version:
[WebViewer](https://www.apryse.com/webviewer) is a powerful JavaScript Document SDK and UI Component Library that is a part of the [Apryse PDF SDK](https://www.apryse.com). It provides a slick, out-of-the-box responsive UI that interacts with the core lib
1 lines • 51.9 kB
JavaScript
(window.webpackJsonpWebViewerUI=window.webpackJsonpWebViewerUI||[]).push([[40],{1629:function(e,n,t){"use strict";t.d(n,"a",(function(){return o}));t(46),t(64);var o=function(e,n){var t=e.getDisplayModeObject().getVisiblePages().includes(n.PageNumber);return e.isContinuousDisplayMode()||!e.isContinuousDisplayMode()&&t}},1660:function(e,n,t){"use strict";t(8),t(57);var o=t(1),i=t(30),a=t(3),r=t(53),l=t(186);function c(){}n.a=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return function(i){return o.a.isWebViewerServerDocument()?u(e,i,t):s(e,n,i,t)}};var u=function(e,n,t){return o.a.applyRedactions(e,t).then((function(e){if(e&&e.url)return Object(l.a)(n,{filename:"redacted.pdf",includeAnnotations:!0,externalURL:e.url});console.warn("WebViewer Server did not return a valid result")}))},s=function(e,n,t,l){var c={message:i.a.t("warning.redaction.applyMessage"),title:i.a.t("warning.redaction.applyTile"),confirmBtnText:i.a.t("action.apply"),onConfirm:function(){return o.a.applyRedactions(e,l).then((function(){n()})).catch((function(e){return Object(r.b)(e)})),Promise.resolve()}};return t(a.a.showWarningMessage(c))}},1661:function(e,n,t){var o=t(36),i=t(1662);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:function(e){if(!window.isApryseWebViewerWebComponent)return void document.head.appendChild(e);let n;n=document.getElementsByTagName("apryse-webviewer"),n.length||(n=function e(n,t=document){const o=[];return t.querySelectorAll(n).forEach(e=>o.push(e)),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&o.push(...e(n,t.shadowRoot))}),o}("apryse-webviewer"));const t=[];for(let o=0;o<n.length;o++){const i=n[o];if(0===o)i.shadowRoot.appendChild(e),e.onload=function(){t.length>0&&t.forEach(n=>{n.innerHTML=e.innerHTML})};else{const n=e.cloneNode(!0);i.shadowRoot.appendChild(n),t.push(n)}}},singleton:!1};o(i,a);e.exports=i.locals||{}},1662:function(e,n,t){(n=e.exports=t(37)(!1)).push([e.i,":host{display:inline-block;container-type:inline-size;width:100%;height:100%;overflow:hidden}@media(min-width:901px){.App:not(.is-web-component) .hide-in-desktop{display:none}}@container (min-width: 901px){.hide-in-desktop{display:none}}@media(min-width:641px)and (max-width:900px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .hide-in-tablet{display:none}}@container (min-width: 641px) and (max-width: 900px){.App.is-web-component:not(.is-in-desktop-only-mode) .hide-in-tablet{display:none}}@media(max-width:640px)and (min-width:431px){.App:not(.is-web-component) .hide-in-mobile{display:none}}@container (max-width: 640px) and (min-width: 431px){.App.is-web-component .hide-in-mobile{display:none}}@media(max-width:430px){.App:not(.is-web-component) .hide-in-small-mobile{display:none}}@container (max-width: 430px){.App.is-web-component .hide-in-small-mobile{display:none}}.always-hide{display:none}@keyframes bottom-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes up-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@media(max-width:640px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .AnnotationStylePopup{width:100%;margin:0;position:relative;max-width:none;border-radius:4px 4px 0 0;border:0;padding-bottom:24px;box-shadow:none}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .AnnotationStylePopup{width:100%;margin:0;position:relative;max-width:none;border-radius:4px 4px 0 0;border:0;padding-bottom:24px;box-shadow:none}}.AnnotationStylePopup .back-to-menu-container{margin-top:var(--padding-medium);margin-inline-end:var(--padding-medium);margin-inline-start:var(--padding-medium);padding-bottom:var(--padding-small);border-bottom:1px solid var(--border)}.AnnotationStylePopup .Button.back-to-menu-button{margin:0;width:100%;height:32px;border-radius:0;justify-content:flex-start}@media(max-width:640px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .AnnotationStylePopup .Button.back-to-menu-button{width:100%;height:32px}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .AnnotationStylePopup .Button.back-to-menu-button{width:100%;height:32px}}",""]),n.locals={LEFT_HEADER_WIDTH:"41px",RIGHT_HEADER_WIDTH:"41px"}},1705:function(e,n,t){"use strict";t(9),t(10),t(14),t(32),t(27),t(21),t(20),t(12),t(22),t(33),t(18),t(16),t(29),t(24),t(8),t(17),t(19),t(11),t(31),t(13);var o=t(0),i=t.n(o),a=t(2),r=t.n(a),l=t(6),c=t(208),u=t(307),s=t(321),p=t(81),d=t(1),m=t(1608),f=t(114),b=t(45),h=t(318),y=t(3),w=t(4),g=t(5),v=t(484);t(1661);function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=A(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,n||"default");if("object"!=A(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==A(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function E(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,a,r,l=[],c=!0,u=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(o=a.call(t)).done)&&(l.push(o.value),l.length!==n);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return P(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?P(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var S={annotations:r.a.array.isRequired,style:r.a.object.isRequired,properties:r.a.object.isRequired,isRedaction:r.a.bool,isFreeText:r.a.bool,isEllipse:r.a.bool,hasBackToMenu:r.a.bool,onBackToMenu:r.a.func},x=function(e){var n=e.annotations,t=e.style,a=e.isRedaction,r=e.isFreeText,A=e.isEllipse,P=e.isMeasure,S=e.colorMapKey,x=e.showLineStyleOptions,T=e.properties,C=e.hideSnapModeCheckbox,N=e.onResize,k=e.hasBackToMenu,j=e.onBackToMenu,D=E(Object(l.e)((function(e){return[w.a.isElementDisabled(e,g.a.ANNOTATION_STYLE_POPUP),w.a.isToolDefaultStyleUpdateFromAnnotationPopupEnabled(e),w.a.getActiveDocumentViewerKey(e)]})),3),F=D[0],M=D[1],_=D[2],I=Object(l.d)(),R=E(Object(u.a)(),1)[0],B=E(Object(o.useState)(T.isAutoSizeFont),2),L=B[0],U=B[1],W=function(e,t,o){o&&Y();var i=d.a.getAnnotationManager(_);n.forEach((function(n){n[e]=t,"StrokeThickness"===e&&Object(h.a)(n),i.redrawAnnotation(n),n instanceof window.Core.Annotations.WidgetAnnotation&&n.refresh()}))},z=function(e,t){n.forEach((function(n){d.a.setAnnotationStyles(n,O({},e,t),_),M&&Object(f.a)(n.ToolName,e,t),"FontSize"!==e&&"Font"!==e||Object(h.a)(n)}))},Y=function(e,t){n.forEach((function(n){d.a.setAnnotationStyles(n,O({},e,t),_),M&&Object(f.a)(n.ToolName,e,t)}))},V=function(e,t){n.forEach((function(n){d.a.updateAnnotationRichTextStyle(n,O({},e,t),_)}))},G=function(e,t){n.forEach((function(n){var o="";if("start"===e)n.setStartStyle(t),o="StartLineStyle";else if("end"===e)n.setEndStyle(t),o="EndLineStyle";else if("middle"===e){var i=t.split(","),a=i.shift();n.Style=a,n.Dashes=i,o="StrokeStyle"}M&&Object(f.a)(n.ToolName,o,t),d.a.getAnnotationManager(_).redrawAnnotation(n)})),d.a.getAnnotationManager(_).trigger("annotationChanged",[n,"modify",{}])},H=function(e){Object(b.k)()&&e.target===e.currentTarget&&I(y.a.closeElement(g.a.ANNOTATION_POPUP))},K=Object(m.a)("Popup AnnotationStylePopup",e);return F?null:i.a.createElement(c.a,{onResize:function(){N&&N()}},(function(e){var o=e.measureRef;return i.a.createElement("div",{className:K,"data-element":g.a.ANNOTATION_STYLE_POPUP,onClick:H,ref:o},k&&i.a.createElement("div",{className:"back-to-menu-container","data-element":g.a.ANNOTATION_STYLE_POPUP_BACK_BUTTON_CONTAINER},i.a.createElement(p.a,{className:"back-to-menu-button",dataElement:g.a.ANNOTATION_STYLE_POPUP_BACK_BUTTON,label:R("action.backToMenu"),img:"icon-chevron-left",onClick:j})),i.a.createElement(s.a,{hideSnapModeCheckbox:C,colorMapKey:S,style:t,isFreeText:r,isFreeTextAutoSize:L,onFreeTextSizeToggle:function(){return Object(v.a)(n[0],U,L)},isEllipse:A,isMeasure:P,onStyleChange:Y,onSliderChange:W,onPropertyChange:z,disableSeparator:!0,properties:T,onRichTextStyleChange:V,isRedaction:a,showLineStyleOptions:x,onLineStyleChange:G}))}))};x.propTypes=S;var T=x;n.a=T},1871:function(e,n,t){var o=t(36),i=t(1931);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:function(e){if(!window.isApryseWebViewerWebComponent)return void document.head.appendChild(e);let n;n=document.getElementsByTagName("apryse-webviewer"),n.length||(n=function e(n,t=document){const o=[];return t.querySelectorAll(n).forEach(e=>o.push(e)),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&o.push(...e(n,t.shadowRoot))}),o}("apryse-webviewer"));const t=[];for(let o=0;o<n.length;o++){const i=n[o];if(0===o)i.shadowRoot.appendChild(e),e.onload=function(){t.length>0&&t.forEach(n=>{n.innerHTML=e.innerHTML})};else{const n=e.cloneNode(!0);i.shadowRoot.appendChild(n),t.push(n)}}},singleton:!1};o(i,a);e.exports=i.locals||{}},1929:function(e,n,t){var o=t(36),i=t(1930);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:function(e){if(!window.isApryseWebViewerWebComponent)return void document.head.appendChild(e);let n;n=document.getElementsByTagName("apryse-webviewer"),n.length||(n=function e(n,t=document){const o=[];return t.querySelectorAll(n).forEach(e=>o.push(e)),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&o.push(...e(n,t.shadowRoot))}),o}("apryse-webviewer"));const t=[];for(let o=0;o<n.length;o++){const i=n[o];if(0===o)i.shadowRoot.appendChild(e),e.onload=function(){t.length>0&&t.forEach(n=>{n.innerHTML=e.innerHTML})};else{const n=e.cloneNode(!0);i.shadowRoot.appendChild(n),t.push(n)}}},singleton:!1};o(i,a);e.exports=i.locals||{}},1930:function(e,n,t){(n=e.exports=t(37)(!1)).push([e.i,":host{display:inline-block;container-type:inline-size;width:100%;height:100%;overflow:hidden}@media(min-width:901px){.App:not(.is-web-component) .hide-in-desktop{display:none}}@container (min-width: 901px){.hide-in-desktop{display:none}}@media(min-width:641px)and (max-width:900px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .hide-in-tablet{display:none}}@container (min-width: 641px) and (max-width: 900px){.App.is-web-component:not(.is-in-desktop-only-mode) .hide-in-tablet{display:none}}@media(max-width:640px)and (min-width:431px){.App:not(.is-web-component) .hide-in-mobile{display:none}}@container (max-width: 640px) and (min-width: 431px){.App.is-web-component .hide-in-mobile{display:none}}@media(max-width:430px){.App:not(.is-web-component) .hide-in-small-mobile{display:none}}@container (max-width: 430px){.App.is-web-component .hide-in-small-mobile{display:none}}.always-hide{display:none}@keyframes bottom-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes up-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}.CalibrationPopup{display:flex;flex-direction:column;align-items:flex-start;padding:var(--padding-medium);width:220px;background:var(--gray-0);box-shadow:0 0 3px var(--gray-7);border-radius:4px}.CalibrationPopup .calibration-popup-label{font-weight:700;margin-bottom:var(--padding-medium)}.CalibrationPopup .pop-switch{margin-top:var(--padding-medium)}.CalibrationPopup .pop-switch.ui__choice--disabled .ui__choice__label{color:var(--gray-5)}.CalibrationPopup .input-container{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start;grid-gap:var(--padding-small);gap:var(--padding-small);height:32px}.CalibrationPopup .input-container .input-field{width:94px;height:32px}.CalibrationPopup .input-container .input-field.invalid-value{border-color:red}.CalibrationPopup .input-container .input-field:focus{border:1px solid var(--blue-5)}.CalibrationPopup .input-container .input-field .Dropdown__wrapper{width:100%;height:100%}.CalibrationPopup .input-container .input-field .Dropdown__wrapper .Dropdown{height:100%;width:100%!important;text-align:start}",""]),n.locals={LEFT_HEADER_WIDTH:"41px",RIGHT_HEADER_WIDTH:"41px"}},1931:function(e,n,t){(n=e.exports=t(37)(!1)).push([e.i,".open.AnnotationPopup{visibility:visible}.closed.AnnotationPopup{visibility:hidden}:host{display:inline-block;container-type:inline-size;width:100%;height:100%;overflow:hidden}@media(min-width:901px){.App:not(.is-web-component) .hide-in-desktop{display:none}}@container (min-width: 901px){.hide-in-desktop{display:none}}@media(min-width:641px)and (max-width:900px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .hide-in-tablet{display:none}}@container (min-width: 641px) and (max-width: 900px){.App.is-web-component:not(.is-in-desktop-only-mode) .hide-in-tablet{display:none}}@media(max-width:640px)and (min-width:431px){.App:not(.is-web-component) .hide-in-mobile{display:none}}@container (max-width: 640px) and (min-width: 431px){.App.is-web-component .hide-in-mobile{display:none}}@media(max-width:430px){.App:not(.is-web-component) .hide-in-small-mobile{display:none}}@container (max-width: 430px){.App.is-web-component .hide-in-small-mobile{display:none}}.always-hide{display:none}.AnnotationPopup{position:absolute;z-index:70;display:flex;justify-content:center;align-items:center}.AnnotationPopup:empty{padding:0}.AnnotationPopup .buttons{display:flex}.AnnotationPopup .Button{margin:4px;width:32px;height:32px}@media(max-width:640px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .AnnotationPopup .Button{width:42px;height:42px}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .AnnotationPopup .Button{width:42px;height:42px}}.AnnotationPopup .Button:hover{background:var(--popup-button-hover)}.AnnotationPopup .Button:hover:disabled{background:none}.AnnotationPopup .Button .Icon{width:18px;height:18px}@media(max-width:640px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .AnnotationPopup .Button .Icon{width:24px;height:24px}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .AnnotationPopup .Button .Icon{width:24px;height:24px}}.is-vertical.AnnotationPopup .Button.main-menu-button{width:100%;border-radius:0;justify-content:flex-start;padding-inline-start:var(--padding-small);padding-inline-end:var(--padding-small);margin:0 0 var(--padding-tiny) 0}.is-vertical.AnnotationPopup .Button.main-menu-button:first-child{margin-top:var(--padding-tiny)}@media(max-width:640px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .is-vertical.AnnotationPopup .Button.main-menu-button{width:100%;height:32px}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .is-vertical.AnnotationPopup .Button.main-menu-button{width:100%;height:32px}}.is-vertical.AnnotationPopup .Button.main-menu-button .Icon{margin-inline-end:10px}.is-vertical.AnnotationPopup .Button.main-menu-button span{white-space:nowrap}@keyframes bottom-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes up-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}.AnnotationPopup{position:fixed;border-radius:4px;box-shadow:0 0 3px 0 var(--document-box-shadow);background:var(--component-background)}.AnnotationPopup.is-horizontal .container{display:inherit}.AnnotationPopup.is-vertical{flex-direction:column;align-items:flex-start}.shortCuts3D{position:relative}.shortCuts3D .closeButton{position:absolute;inset-inline-end:4px;padding:2px;cursor:pointer;width:20px;text-align:center}.shortCuts3D .row{padding:4px 0;margin:8px 26px 8px 16px}.shortCuts3D .row span{background:#e7ebee;padding:4px 8px;border-radius:4px}",""]),n.locals={LEFT_HEADER_WIDTH:"41px",RIGHT_HEADER_WIDTH:"41px"}},2105:function(e,n,t){"use strict";t.r(n);t(9),t(10),t(14),t(83),t(27),t(21),t(46),t(20),t(12),t(22),t(18),t(26),t(16),t(40),t(24),t(41),t(35),t(42),t(8),t(57),t(17),t(19),t(64),t(11),t(31),t(13);var o=t(0),i=t.n(o),a=t(6),r=t(2),l=t.n(r),c=t(102),u=t.n(c),s=t(175),p=t(1),d=t(231),m=t(1660),f=t(45),b=t(307),h=t(219),y=t(497),w=t(39),g=t(148),v=t(3),A=t(4),O=t(5),E=t(65),P=t(23),S=t(7),x=(t(32),t(38),t(34),t(33),t(29),t(49),t(48),t(50),t(185)),T=t.n(x),C=t(15),N=t.n(C),k=t(326),j=t(81),D=t(1705);function F(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,n,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function a(t,o,i,a){var c=o&&o.prototype instanceof l?o:l,u=Object.create(c.prototype);return M(u,"_invoke",function(t,o,i){var a,l,c,u=0,s=i||[],p=!1,d={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(n,t){return a=n,l=0,c=e,d.n=t,r}};function m(t,o){for(l=t,c=o,n=0;!p&&u&&!i&&n<s.length;n++){var i,a=s[n],m=d.p,f=a[2];t>3?(i=f===o)&&(c=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=m&&((i=t<2&&m<a[1])?(l=0,d.v=o,d.n=a[1]):m<f&&(i=t<3||a[0]>o||o>f)&&(a[4]=t,a[5]=o,d.n=f,l=0))}if(i||t>1)return r;throw p=!0,o}return function(i,s,f){if(u>1)throw TypeError("Generator is already running");for(p&&1===s&&m(s,f),l=s,c=f;(n=l<2?e:c)||!p;){a||(l?l<3?(l>1&&(d.n=-1),m(l,c)):d.n=c:d.v=c);try{if(u=2,a){if(l||(i="next"),n=a[i]){if(!(n=n.call(a,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,l<2&&(l=0)}else 1===l&&(n=a.return)&&n.call(a),l<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),l=1);a=e}else if((n=(p=d.n<0)?c:t.call(o,d))!==r)break}catch(n){a=e,l=1,c=n}finally{u=1}}return{value:n,done:p}}}(t,i,a),!0),u}var r={};function l(){}function c(){}function u(){}n=Object.getPrototypeOf;var s=[][o]?n(n([][o]())):(M(n={},o,(function(){return this})),n),p=u.prototype=l.prototype=Object.create(s);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,M(e,i,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=u,M(p,"constructor",u),M(u,"constructor",c),c.displayName="GeneratorFunction",M(u,i,"GeneratorFunction"),M(p),M(p,i,"Generator"),M(p,o,(function(){return this})),M(p,"toString",(function(){return"[object Generator]"})),(F=function(){return{w:a,m:d}})()}function M(e,n,t,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(M=function(e,n,t,o){if(n)i?i(e,n,{value:t,enumerable:!o,configurable:!o,writable:!o}):e[n]=t;else{var a=function(n,t){M(e,n,(function(e){return this._invoke(n,t,e)}))};a("next",0),a("throw",1),a("return",2)}})(e,n,t,o)}function _(e,n,t,o,i,a,r){try{var l=e[a](r),c=l.value}catch(e){return void t(e)}l.done?n(c):Promise.resolve(c).then(o,i)}var I=function(e){var n=e.onClick,t=e.annotation,a=e.onDatePickerShow,r=Object(o.useRef)(null),l=Object(o.useRef)(null);return Object(o.useEffect)((function(){var e;return function(){var o,i=(o=F().m((function o(){return F().w((function(o){for(;;)switch(o.n){case 0:return o.n=1,window.Core.createDatePicker({field:r.current,onClick:n,container:l.current,format:t.getDateFormat()});case 1:e=o.v,a(!0);case 2:return o.a(2)}}),o)})),function(){var e=this,n=arguments;return new Promise((function(t,i){var a=o.apply(e,n);function r(e){_(a,t,i,r,l,"next",e)}function l(e){_(a,t,i,r,l,"throw",e)}r(void 0)}))});return function(){return i.apply(this,arguments)}}()(),function(){e.destroy(),e=null,a(!1)}}),[]),i.a.createElement("div",{"data-element":"datePickerContainer"},i.a.createElement("div",{ref:r}),i.a.createElement("div",{ref:l}))};I.propTypes={onClick:l.a.func.isRequired,annotation:l.a.object.isRequired,onDatePickerShow:l.a.func.isRequired};var R=I,B=t(1855),L=(t(137),t(136),t(106)),U=t(72),W=t(120),z=t(418);t(1929);function Y(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,a,r,l=[],c=!0,u=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(o=a.call(t)).done)&&(l.push(o.value),l.length!==n);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return V(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?V(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var G=window.Core.Scale,H=function(e){var n=e.Measure.axis[0].factor;switch(e.Scale[1][1]){case"ft-in":return e.getLineLength()*n/12;case"in":default:return e.getLineLength()*n}},K={annotation:l.a.shape({Scale:l.a.arrayOf(l.a.array)})},q=function(e){var n,t,r=e.annotation,l=Y(Object(b.a)(),1)[0],c=Object(a.d)(),u=Y(Object(a.e)((function(e){return[A.a.getMeasurementUnits(e),A.a.getCalibrationInfo(e)]}),a.c),2),s=u[0],d=u[1],m=d.tempScale,f=d.isFractionalUnit,h=d.defaultUnit,y=Y(Object(o.useState)(""),2),w=y[0],g=y[1],O=Object(o.useRef)(null),E=(null===(n=new G(m).worldScale)||void 0===n?void 0:n.unit)||"mm",P=f?s.to.filter((function(e){return z.e.includes(e)})):s.to,S=!z.e.includes(E),x=f||"ft-in"===E?"text":"number",T=N()("input-field",{"invalid-value":!(m&&(null===(t=new G(m).worldScale)||void 0===t?void 0:t.value)>0)}),C=function(e,n){var t,o=H(r),i=r.Scale,a=o/i[1][0],l=[i[0][0]*a,i[0][1]],u="pt"===(t=n)?"pt":z.m.includes(t)?"mm":"in",s=Object(z.c)(l[0],l[1],u);c(v.a.updateCalibrationInfo({tempScale:"".concat(s," ").concat(u," = ").concat(e," ").concat(n),isFractionalUnit:f}))},k=function(e){var n;C(e,null===(n=new G(m).worldScale)||void 0===n?void 0:n.unit)},j=function(){var e,n,t=null===(e=new G(m).worldScale)||void 0===e?void 0:e.value;n=f||"ft-in"===E?G.getFormattedValue(t,E,f?1/64:1e-4,!1,!0):"".concat(t),g(n||"")},D=Object(o.useRef)(m);return Object(o.useEffect)((function(){D.current=m}),[m]),Object(o.useEffect)((function(){if(r){var e=H(r),n=r.Scale[1][1];h?C(Object(z.c)(e,n,h),h):C(e,n)}var t=function(e,n){if("modify"===n&&1===e.length&&e[0]===r){var t,o=H(r),i=r.Scale[1][1],a=null===(t=new G(D.current).worldScale)||void 0===t?void 0:t.unit;a?C(Object(z.c)(o,i,a),a):C(o,i)}};return p.a.addEventListener("annotationChanged",t),function(){p.a.removeEventListener("annotationChanged",t),p.a.deleteAnnotations([r])}}),[r]),Object(o.useEffect)((function(){(null==O?void 0:O.current)!==document.activeElement&&j()}),[m,f]),i.a.createElement("div",{className:"CalibrationPopup","data-element":"calibrationPopup"},i.a.createElement("label",{className:"calibration-popup-label",id:"calibration-popup-label",htmlFor:"calibration-popup-value"},l("option.measurement.scaleModal.units")),i.a.createElement("div",{className:"input-container"},i.a.createElement("input",{id:"calibration-popup-value",className:T,ref:O,type:x,value:w,min:"0",onChange:function(e){g(e.target.value);var n=e.target.value.trim();if(f){if("in"===E){if(z.k.test(n)){var t=Object(z.p)(n);if(t>0)return void k(t)}}else if("ft-in"===E&&z.g.test(n)){var o=Object(z.o)(n);if(o>0)return void k(o)}}else if("ft-in"===E&&z.f.test(n)){var i=Object(z.n)(n);if(i>0)return void k(i)}else if(z.d.test(n)){var a=parseFloat(n)||0;return void k(a)}k(0)},onBlur:function(){j()},placeholder:f?z.i[E]:"ft-in"===E?z.i["ft-in decimal"]:""}),i.a.createElement(W.a,{content:"option.measurement.scaleModal.displayUnits"},i.a.createElement("div",{className:"input-field"},i.a.createElement(U.a,{id:"calibration-popup-units",dataElement:"calibrationUnits",items:P,currentSelectionKey:E,onClickItem:function(e){var n;C(null===(n=new G(m).worldScale)||void 0===n?void 0:n.value,e)},labelledById:"calibration-popup-label"})))),i.a.createElement(W.a,{content:l("option.measurement.scaleModal.fractionUnitsTooltip")},i.a.createElement("div",null,i.a.createElement(L.a,{isSwitch:!0,leftLabel:!0,label:l("option.measurement.scaleModal.fractionalUnits"),disabled:S,checked:f,id:"calibration-popup-fractional-units",className:"pop-switch",onChange:function(){c(v.a.updateCalibrationInfo({tempScale:m,isFractionalUnit:!f}))}}))))};q.propTypes=K;var $=q,J=t(54);t(1871);function X(e){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Q(Object(t),!0).forEach((function(n){ee(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Q(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ee(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=X(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,n||"default");if("object"!=X(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==X(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ne(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,a,r,l=[],c=!0,u=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(o=a.call(t)).done)&&(l.push(o.value),l.length!==n);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return te(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?te(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var oe={isMobile:l.a.bool,isIE:l.a.bool,isOpen:l.a.bool,isRightClickMenu:l.a.bool,isNotesPanelOpenOrActive:l.a.bool,isRichTextPopupOpen:l.a.bool,isLinkModalOpen:l.a.bool,isWarningModalOpen:l.a.bool,isContextMenuPopupOpen:l.a.bool,isVisible:l.a.bool,focusedAnnotation:l.a.object,popupRef:l.a.any,position:l.a.object,showViewFileButton:l.a.bool,onViewFile:l.a.func,showCommentButton:l.a.bool,onCommentAnnotation:l.a.func,isDateFreeTextCanEdit:l.a.bool,isDatePickerOpen:l.a.bool,handleDateChange:l.a.func,onDatePickerShow:l.a.func,isCalibrationPopupOpen:l.a.bool,showEditStyleButton:l.a.bool,isStylePopupOpen:l.a.bool,hideSnapModeCheckbox:l.a.bool,openEditStylePopup:l.a.func,closeEditStylePopup:l.a.func,annotationStyle:l.a.object,onResize:l.a.func,showContentEditButton:l.a.bool,onEditContent:l.a.func,openContentEditDeleteWarningModal:l.a.func,showClearSignatureButton:l.a.bool,onClearAppearanceSignature:l.a.func,showRedactionButton:l.a.bool,onApplyRedaction:l.a.func,showGroupButton:l.a.bool,onGroupAnnotations:l.a.func,showUngroupButton:l.a.bool,onUngroupAnnotations:l.a.func,showFormFieldButton:l.a.bool,onOpenFormField:l.a.func,showDeleteButton:l.a.bool,onDeleteAnnotation:l.a.func,showLinkButton:l.a.bool,hasAssociatedLink:l.a.bool,linkAnnotationToURL:l.a.func,showFileDownloadButton:l.a.bool,downloadFileAttachment:l.a.func,showAudioPlayButton:l.a.bool,handlePlaySound:l.a.func,showCalibrateButton:l.a.bool,onOpenCalibration:l.a.func,showAlignButton:l.a.bool,onOpenAlignmentModal:l.a.func,customizableUI:l.a.bool,toggleStylePanel:l.a.func,isInReadOnlyMode:l.a.bool},ie=function(e){var n,t,a=e.isMobile,r=e.isIE,l=e.isOpen,c=e.isRightClickMenu,u=e.isNotesPanelOpenOrActive,s=e.isRichTextPopupOpen,p=e.isLinkModalOpen,d=e.isWarningModalOpen,m=e.isContextMenuPopupOpen,f=e.isVisible,h=e.focusedAnnotation,y=e.popupRef,w=e.position,g=e.showViewFileButton,v=e.onViewFile,A=e.showCommentButton,E=e.onCommentAnnotation,S=e.isDateFreeTextCanEdit,x=e.isDatePickerOpen,C=e.handleDateChange,F=e.onDatePickerShow,M=e.isCalibrationPopupOpen,_=e.showEditStyleButton,I=e.isStylePopupOpen,L=e.hideSnapModeCheckbox,U=e.openEditStylePopup,W=e.closeEditStylePopup,z=e.annotationStyle,Y=e.onResize,V=e.showContentEditButton,G=e.onEditContent,H=e.openContentEditDeleteWarningModal,K=e.showClearSignatureButton,q=e.onClearAppearanceSignature,X=e.showRedactionButton,Q=e.onApplyRedaction,ee=e.showGroupButton,te=e.onGroupAnnotations,oe=e.showUngroupButton,ie=e.onUngroupAnnotations,ae=e.showFormFieldButton,re=e.onOpenFormField,le=e.showDeleteButton,ce=e.onDeleteAnnotation,ue=e.showLinkButton,se=e.hasAssociatedLink,pe=e.linkAnnotationToURL,de=e.showFileDownloadButton,me=e.downloadFileAttachment,fe=e.showAudioPlayButton,be=e.handlePlaySound,he=e.showCalibrateButton,ye=e.onOpenCalibration,we=e.showAlignButton,ge=e.onOpenAlignmentModal,ve=e.customizableUI,Ae=e.toggleStylePanel,Oe=e.isInReadOnlyMode,Ee=ne(Object(b.a)(),1)[0],Pe=ne(Object(o.useState)(!1),2),Se=Pe[0],xe=Pe[1],Te=S?"action.changeDate":"action.comment",Ce=S?"icon-tool-fill-and-sign-calendar":"icon-header-chat-line",Ne=!Oe&&h instanceof window.Core.Annotations.Model3DAnnotation&&!a,ke=h instanceof window.Core.Annotations.RectangleAnnotation,je=h instanceof window.Core.Annotations.EllipseAnnotation,De=h instanceof window.Core.Annotations.PolygonAnnotation,Fe=h instanceof window.Core.Annotations.FreeTextAnnotation&&(h.getIntent()===window.Core.Annotations.FreeTextAnnotation.Intent.FreeText||h.getIntent()===window.Core.Annotations.FreeTextAnnotation.Intent.FreeTextCallout),Me=h instanceof window.Core.Annotations.RedactionAnnotation,_e=Object(J.g)(h),Ie=!!h.Measure,Re=Object(J.e)(Object(J.j)(h.ToolName)).hasLineEndings,Be=!window.isApryseWebViewerWebComponent||(null===(n=document.activeElement)||void 0===n?void 0:n.shadowRoot)===Object(P.a)(),Le="solid",Ue=null===(t=h.isContentEditPlaceholder)||void 0===t?void 0:t.call(h),We=h instanceof window.Core.Annotations.SignatureWidgetAnnotation&&h.fieldFlags.get(window.Core.Annotations.WidgetFlags.READ_ONLY);try{Le="dash"===h.Style?"".concat(h.Style,",").concat(h.Dashes):h.Style}catch(e){console.error(e)}var ze={};if(Re&&(ze={StartLineStyle:h.getStartStyle(),EndLineStyle:h.getEndStyle(),StrokeStyle:Le}),(ke||je||De)&&(ze={StrokeStyle:Le}),Fe){var Ye,Ve,Ge,He,Ke,qe,$e,Je,Xe,Qe,Ze,en=h.getRichTextStyle(),nn=h.isAutoSizeFont(),tn=h.getCalculatedFontSize();ze={Font:h.Font,FontSize:h.FontSize,TextAlign:h.TextAlign,TextVerticalAlign:h.TextVerticalAlign,bold:null!==(Ye="bold"===(null==en||null===(Ve=en[0])||void 0===Ve?void 0:Ve["font-weight"]))&&void 0!==Ye&&Ye,italic:null!==(Ge="italic"===(null==en||null===(He=en[0])||void 0===He?void 0:He["font-style"]))&&void 0!==Ge&&Ge,underline:(null==en||null===(Ke=en[0])||void 0===Ke||null===(qe=Ke["text-decoration"])||void 0===qe?void 0:qe.includes("underline"))||(null==en||null===($e=en[0])||void 0===$e||null===(Je=$e["text-decoration"])||void 0===Je?void 0:Je.includes("word")),strikeout:null!==(Xe=null==en||null===(Qe=en[0])||void 0===Qe||null===(Ze=Qe["text-decoration"])||void 0===Ze?void 0:Ze.includes("line-through"))&&void 0!==Xe&&Xe,StrokeStyle:Le,isAutoSizeFont:nn,calculatedFontSize:tn}}Me&&(ze={OverlayText:h.OverlayText,Font:h.Font,FontSize:h.FontSize,TextAlign:h.TextAlign});var on=i.a.createElement("div",{className:N()({Popup:!0,AnnotationPopup:!0,open:l,closed:!l,stylePopupOpen:I,"is-vertical":c,"is-horizontal":!c}),ref:y,"data-element":O.a.ANNOTATION_POPUP,style:Z(Z({},w),{},{visibility:f||void 0===f?"visible":"hidden"})},function(){switch(!0){case I:return i.a.createElement(D.a,{annotations:[h],style:z,isOpen:l,onResize:Y,isFreeText:Fe,isEllipse:je,isRedaction:Me,isMeasure:Ie,colorMapKey:_e,showLineStyleOptions:Re,properties:ze,hideSnapModeCheckbox:L,hasBackToMenu:c,onBackToMenu:W});case x:return i.a.createElement(R,{onClick:C,annotation:h,onDatePickerShow:F});case M:return i.a.createElement($,{annotation:h});case Se&&h instanceof window.Core.Annotations.Model3DAnnotation:return i.a.createElement("div",{className:"shortCuts3D"},i.a.createElement("div",{className:"closeButton",onClick:function(){return xe(!1)}},"x"),i.a.createElement("div",{className:"row"},Ee("action.rotate3D")," ",i.a.createElement("span",null,Ee("shortcut.rotate3D"))),i.a.createElement("div",{className:"row"},Ee("action.zoom")," ",i.a.createElement("span",null,Ee("shortcut.zoom3D"))));default:return i.a.createElement(k.a,{locked:l&&Be&&!s&&!u&&!p&&!d&&!Fe&&!m},i.a.createElement("div",{className:"container"},i.a.createElement(B.a,{dataElement:O.a.ANNOTATION_POPUP,childrenClassName:"main-menu-button"},g&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"viewFileButton",label:c?"action.viewFile":"",title:c?"":"action.viewFile",img:"icon-view",onClick:v}),A&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationCommentButton",label:c?Te:"",title:c?"":Te,img:Ce,onClick:E}),_&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationStyleEditButton",label:c?"action.style":"",title:c?"":"action.style",img:"icon-menu-style-line",onClick:ve?Ae:U}),V&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationContentEditButton",label:c?"action.edit":"",title:c?"":"action.edit",img:"ic_edit_page_24px",onClick:G}),K&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationClearSignatureButton",label:!We&&c?"action.clearSignature":"",title:We?"action.readOnlySignature":c?"":"action.clearSignature",img:"icon-delete-line",onClick:q,isNotClickableSelector:function(){return We}}),X&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationRedactButton",label:c?"action.apply":"",title:c?"":"action.apply",img:"ic_check_black_24px",onClick:Q}),ee&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationGroupButton",label:c?"action.group":"",title:c?"":"action.group",img:"group-annotations-icon",onClick:te}),oe&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationUngroupButton",label:c?"action.ungroup":"",title:c?"":"action.ungroup",img:"ungroup-annotations-icon",onClick:ie}),we&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"openAlignmentButton",label:c?"alignmentPopup.alignment":"",title:c?"":"alignmentPopup.alignment",img:"ic-alignment-main",onClick:ge}),ae&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"formFieldEditButton",label:c?"action.formFieldEdit":"",title:c?"":"action.formFieldEdit",img:"icon-edit-form-field",onClick:re}),le&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"annotationDeleteButton",label:c?"action.delete":"",title:c?"":"action.delete",img:"icon-delete-line",onClick:Ue?H:ce}),he&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:O.a.CALIBRATION_POPUP_BUTTON,label:c?"action.calibrate":"",title:c?"":"action.calibrate",img:"calibrate",onClick:ye}),ue&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"linkButton",label:c?"tool.Link":"",title:c?"":"tool.Link",img:se?"icon-tool-unlink":"icon-tool-link",onClick:pe}),de&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"fileAttachmentDownload",label:c?"action.fileAttachmentDownload":"",title:c?"":"action.fileAttachmentDownload",img:"icon-download",onClick:function(){return me(h)}}),Ne&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"shortCutKeysFor3D",label:c?"action.viewShortCutKeysFor3D":"",title:c?"":"action.viewShortCutKeysFor3D",img:"icon-keyboard",onClick:function(){return xe(!0)}}),fe&&i.a.createElement(j.a,{className:"main-menu-button",dataElement:"playSoundButton",label:c?"action.playAudio":"",title:c?"":"action.playAudio",img:"ic_play_24px",onClick:function(){return be(h)}}))))}}());return r||a?on:i.a.createElement(T.a,{cancel:".Button, .cell, .sliders-container svg, select, button, input"},on)};ie.propTypes=oe;var ae=ie,re=t(1629);function le(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,n,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function a(t,o,i,a){var c=o&&o.prototype instanceof l?o:l,u=Object.create(c.prototype);return ce(u,"_invoke",function(t,o,i){var a,l,c,u=0,s=i||[],p=!1,d={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(n,t){return a=n,l=0,c=e,d.n=t,r}};function m(t,o){for(l=t,c=o,n=0;!p&&u&&!i&&n<s.length;n++){var i,a=s[n],m=d.p,f=a[2];t>3?(i=f===o)&&(c=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=m&&((i=t<2&&m<a[1])?(l=0,d.v=o,d.n=a[1]):m<f&&(i=t<3||a[0]>o||o>f)&&(a[4]=t,a[5]=o,d.n=f,l=0))}if(i||t>1)return r;throw p=!0,o}return function(i,s,f){if(u>1)throw TypeError("Generator is already running");for(p&&1===s&&m(s,f),l=s,c=f;(n=l<2?e:c)||!p;){a||(l?l<3?(l>1&&(d.n=-1),m(l,c)):d.n=c:d.v=c);try{if(u=2,a){if(l||(i="next"),n=a[i]){if(!(n=n.call(a,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,l<2&&(l=0)}else 1===l&&(n=a.return)&&n.call(a),l<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),l=1);a=e}else if((n=(p=d.n<0)?c:t.call(o,d))!==r)break}catch(n){a=e,l=1,c=n}finally{u=1}}return{value:n,done:p}}}(t,i,a),!0),u}var r={};function l(){}function c(){}function u(){}n=Object.getPrototypeOf;var s=[][o]?n(n([][o]())):(ce(n={},o,(function(){return this})),n),p=u.prototype=l.prototype=Object.create(s);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,ce(e,i,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=u,ce(p,"constructor",u),ce(u,"constructor",c),c.displayName="GeneratorFunction",ce(u,i,"GeneratorFunction"),ce(p),ce(p,i,"Generator"),ce(p,o,(function(){return this})),ce(p,"toString",(function(){return"[object Generator]"})),(le=function(){return{w:a,m:d}})()}function ce(e,n,t,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(ce=function(e,n,t,o){if(n)i?i(e,n,{value:t,enumerable:!o,configurable:!o,writable:!o}):e[n]=t;else{var a=function(n,t){ce(e,n,(function(e){return this._invoke(n,t,e)}))};a("next",0),a("throw",1),a("return",2)}})(e,n,t,o)}function ue(e,n,t,o,i,a,r){try{var l=e[a](r),c=l.value}catch(e){return void t(e)}l.done?n(c):Promise.resolve(c).then(o,i)}function se(e){return function(){var n=this,t=arguments;return new Promise((function(o,i){var a=e.apply(n,t);function r(e){ue(a,o,i,r,l,"next",e)}function l(e){ue(a,o,i,r,l,"throw",e)}r(void 0)}))}}function pe(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,a,r,l=[],c=!0,u=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(o=a.call(t)).done)&&(l.push(o.value),l.length!==n);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return de(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?de(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var me=window.Core.Tools.ToolNames,fe=window.Core.Annotations,be={focusedAnnotation:l.a.object,selectedMultipleAnnotations:l.a.bool,canModify:l.a.bool,focusedAnnotationStyle:l.a.object,isStylePopupOpen:l.a.bool,setIsStylePopupOpen:l.a.func,isDatePickerOpen:l.a.bool,setDatePickerOpen:l.a.func,isDatePickerMount:l.a.bool,setDatePickerMount:l.a.func,hasAssociatedLink:l.a.bool,includesFormFieldAnnotation:l.a.bool,stylePopupRepositionFlag:l.a.bool,setStylePopupRepositionFlag:l.a.func,closePopup:l.a.func,widgetThatOpenedPopupRef:l.a.object},he=function(e){var n=e.focusedAnnotation,t=e.selectedMultipleAnnotations,r=e.canModify,l=e.focusedAnnotationStyle,c=e.isStylePopupOpen,x=e.setIsStylePopupOpen,T=e.isDatePickerOpen,C=e.setDatePickerOpen,N=e.isDatePickerMount,k=e.setDatePickerMount,j=e.hasAssociatedLink,D=e.includesFormFieldAnnotation,F=e.stylePopupRepositionFlag,M=e.setStylePopupRepositionFlag,_=e.closePopup,I=e.widgetThatOpenedPopupRef,R=Object(a.e)((function(e){return A.a.isElementDisabled(e,O.a.ANNOTATION_POPUP)})),B=Object(a.e)((function(e){return A.a.isElementOpen(e,O.a.ANNOTATION_POPUP)})),L=Object(a.e)((function(e){return A.a.isElementOpen(e,O.a.CONTEXT_MENU_POPUP)})),U=Object(a.e)(A.a.isRightClickAnnotationPopupEnabled),W=Object(a.e)((function(e){return A.a.isElementDisabled(e,O.a.NOTES_PANEL)})),z=Object(a.e)((function(e){return A.a.isElementDisabled(e,O.a.ANNOTATION_STYLE_POPUP)})),Y=Object(a.e)((function(e){return A.a.isElementDisabled(e,O.a.INLINE_COMMENT_POPUP)})),V=Object(a.e)((function(e){return A.a.isElementOpen(e,O.a.NOTES_PANEL)})),G=Object(a.e)((function(e){return A.a.isElementOpen(e,O.a.LINK_MODAL)})),H=Object(a.e)((function(e){return A.a.isElementOpen(e,O.a.WARNING_MODAL)})),K=Object(a.e)((function(e){return A.a.isElementOpen(e,"richTextPopup")})),q=Object(a.e)(A.a.getIsMultiTab),$=Object(a.e)(A.a.getTabManager),J=Object(a.e)(A.a.getTabs),X=Object(a.e)(A.a.getNotesInLeftPanel),Q=Object(a.e)((function(e){return A.a.isElementOpen(e,O.a.LEFT_PANEL)})),Z=Object(a.e)(A.a.getActiveLeftPanel),ee=Object(a.e)(A.a.getActiveDocumentViewerKey),ne=Object(a.e)(A.a.isAnyCustomPanelOpen),te=Object(a.e)(A.a.getFeatureFlags),oe=Object(a.e)((function(e){return A.a.isElementOpen(e,O.a.STYLE_PANEL)})),ie=Object(a.e)((function(e){return A.a.isElementDisabled(e,O.a.STYLE_PANEL)})),ce=Object(a.e)((function(e){return A.a.getIsPanelInFlyout(e,S.j.STYLE_PANEL,[O.a.MULTI_SELECT_STYLE_PANEL_FLYOUT])})),ue=Object(a.e)((function(e){return A.a.isElementOpen(e,null==ce?void 0:ce.dataElement)})),de=pe(Object(b.a)(),1)[0],be=Object(a.d)(),ye=pe(Object(o.useState)({left:0,top:0}),2),we=ye[0],ge=ye[1],ve=pe(Object(o.useState)(!1),2),Ae=ve[0],Oe=ve[1],Ee=pe(Object(o.useState)(!1),2),Pe=Ee[0],Se=Ee[1],xe=Object(o.useRef)(),Te=!U||p.a.isAnnotationSelected(n,ee),Ce=p.a.getAnnotationManager(ee),Ne=te.customizableUI;Object(g.a)(xe,Object(o.useCallback)((function(e){var n,t=Object(P.a)().querySelector('[data-element="'.concat(O.a.NOTES_PANEL,'"]')),o=null==t?void 0:t.contains(e.target),i=null===(n=Object(P.a)().querySelector(".LinkModal.open"))||void 0===n?void 0:n.contains(e.target),a=Object(P.a)().querySelector("[data-element=".concat(null==ce?void 0:ce.dataElement,"]")),r=null==a?void 0:a.contains(e.target),l=Object(h.b)(),c=Object(h.d)(),u=Object(h.c)();o||i||r||c||u||l||(U?_():be(v.a.closeElement(O.a.ANNOTATION_POPUP)))}),[U]));var ke=u()((function(){he&&function(){var e=p.a.getDisplayModeObject().getVisiblePages(),t=Object(re.a)(p.a,n);if(xe.current&&t&&n)ge(Object(d.c)(n,xe,ee));else if(!W&&!t){var o=p.a.getSelectedAnnotations().find((function(n){return e.includes(n.PageNumber)}));ge(Object(d.c)(o,xe,ee))}}()}),16,{trailing:!0,leading:!1}),je=u()((function(){he&&Oe(Te)}),32,{trailing:!0,leading:!1});Object(o.useEffect)((function(){return window.addEventListener("resize",ke),function(){window.removeEventListener("resize",ke)}}),[]),Object(o.useLayoutEffect)((function(){(n||c||N)&&(ke(),Oe(!1),je())}),[n,c,N,r,ee]),Object(o.useEffect)((function(){n&&n.ToolName===me.CALIBRATION_MEASUREMENT&&Se(!0)}),[n]),Object(o.useEffect)((function(){(B||K)&&be(v.a.closeElement(O.a.INLINE_COMMENT_POPUP))}),[B,K]);var De=!!Object(w.a)("webviewerServerURL",null)?window.Core.SupportedFileFormats.SERVER:window.Core.SupportedFileFormats.CLIENT,Fe=n instanceof fe.FileAttachmentAnnotation&&q&&De.includes(window.Core.mimeTypeToExtension[n.getFileMetadata().mimeType]),Me=Object(o.useCallback)(se(le().m((function e(){var t,o,i,a,r;return le().w((function(e){for(;;)switch(e.n){case 0:if($&&q){e.n=1;break}return e.a(2,console.warn("Can't open file in non-multi-tab mode"));case 1:if(t=n.getFileMetadata(),!(o=J.find((function(e){return e.options.filename===t.filename})))){e.n=3;break}return e.n=2,$.setActiveTab(o.id,!0);case 2:return e.a(2);case 3:return i=$,e.n=4,n.getFileData();case 4:return a=e.v,r={extension:window.Core.mimeTypeToExtension[t.mimeType],filename:t.filename,saveCurrentActiveTabState:!0,setActive:!0},e.n=5,i.addTab.call(i,a,r);case 5:return e.a(2)}}),e)}))),[$,n,J,q]);if(Object(o.useEffect)((function(){var e=xe.current;if(e&&null!=I&&I.current){var t=I.current.getAssociatedSignatureAnnotation(),o=function(e){var o;("Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),t===n&&Ce.deselectAnnotation(n,ee),_()),r&&("Delete"===e.key||"Backspace"===e.key)&&B)&&(e.preventDefault(),e.stopPropagation(),null!=I&&null!==(o=I.current)&&void 0!==o&&o.isSignedByAppearance()?I.current.clearSignature(Ce):t&&Ce.deleteAnnotation(t,ee),_())};return e.addEventListener("keydown",o,!0),function(){return e.removeEventListener("keydown",o,!0)}}}),[xe,B,I,n,_,Ce,ee]),R||!n)return null;var _e=p.a.getSelectedAnnotations(ee),Ie=_e.length,Re=Ie>1,Be=n instanceof fe.FreeTextAnnotation&&!!n.getDateFormat()&&p.a.canModifyContents(n,ee),Le=p.a.getNumberOfGroups(_e,ee),Ue=Le>1,We=1===Le&&Ie>1&&Te,ze=n instanceof fe.SignatureWidgetAnnotation&&n.isSignedByAppearance(),Ye=p.a.getIsReadOnly(),Ve=(!W||!Y)&&(!Re||Re&&!Te)&&n.ToolName!==me.CROP&&!D&&!n.isContentEditPlaceholder()&&!ze,Ge=r&&Re&&!Object(f.k)(),He=Object.keys(l).length>0,Ke=[me.CROP,me.VIDEO_REDACTION,me.VIDEO_AND_AUDIO_REDACTION,me.AUDIO_REDACTION],qe=r&&He&&(!z||Ne)&&(!Re||We||Re&&!Te)&&!Ke.includes(n.ToolName)&&!(n instanceof fe.Model3DAnnotation)&&!n.isContentEditPlaceholder()&&!ze&&!(n instanceof fe.PushButtonWidgetAnnotation),$e=n instanceof fe.EllipseAnnotation||!p.a.isFullPDFEnabled(),Je=n.isContentEditPlaceholder()&&n.getContentEditType()===window.Core.ContentEdit.Types.TEXT,Xe=function(){var e=se(le().m((function e(){return le().w((function(e){for(;;)switch(e.n){case 0:Ce.trigger("annotationDoubleClicked",n),be(v.a.closeElement(O.a.ANNOTATION_POPUP));case 1:return e.a(2)}}),e)})));return function(){return e.apply(this,arguments)}}(),Qe=r&&ze&&!an,Ze=p.a.isAnnotationRedactable(n,ee)&&!Re&&!D,en=_e.find((function(e){return!e.InReplyTo})),nn=r&&Te&&Ue&&!D,tn=We,on=p.a.getFormFieldCreationManager(ee).isInFormFieldCreationMode(),an=D&&on&&!(n instanceof fe.PushButtonWidgetAnnotation),rn=r&&!Qe,ln=function(){Te?p.a.deleteAnnotations(p.a.getSelectedAnnotations(ee),void 0,ee):p.a.deleteAnnotations([n],void 0,ee),_()},cn=[me.CROP,me.SIGNATURE,me.REDACTION,me.REDACTION2,me.REDACTION3,me.REDACTION4,me.STICKY,me.STICKY2,me.STICKY3,me.STICKY4],un=r&&!cn.includes(n.ToolName)&&!D&&!n.isContentEditPlaceholder()&&!(n instanceof fe.SoundAnnotation)&&!ze,sn=r&&n.Measure&&n instanceof fe.LineAnnotation,pn=n instanceof fe.FileAttachmentAnnotation,dn=function(){var e=se(le().m((function e(n){var t,o,i;return le().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,n.getFullFileMetadata();case 1:t=e.v,o=t.fileData,i=t.fileName,Object(s.saveAs)(o,i);case 2:return e.a(2)}}),e)})));return function(n){return e.apply(this,arguments)}}(),mn=!f.e&&!t&&n instanceof fe.SoundAnnotation&&n.hasAudioData(),fn=V||X&&Q&&"notesPanel"===Z||ne||on;return i.a.createElement(ae,{isMobile:Object(f.k)(),isIE:f.e,isOpen:B,isRightClickMenu:U,isNotesPanelOpenOrActive:fn,isRichTextPopupOpen:K,isLinkModalOpen:G,isWarningModalOpen:H,isContextMenuPopupOpen:L,isVisible:Ae,popupRef:xe,position:we,focusedAnnotation:n,multipleAnnotationsSelected:Re,showViewFileButton:Fe,onViewFile:Me,showCommentButton:Ve,onCommentAnnotation:function(){if(Be)C(!0);else{be(v.a.closeElement("searchPanel")),be(v.a.closeElement("redactionPanel"));var e=p.a.getContentEditManager(ee);e.isInContentEditMode()&&(be(v.a.closeElement("textEditingPanel")),e.endContentEditMode()),be(v.a.triggerNoteEditing()),Y?(be(v.a.openElement(O.a.NOTES_PANEL)),be(v.a.closeElement(O.a.ANNOTATION_POPUP))):(V||be(v.a.openElement(O.a.INLINE_COMMENT_POPUP)),_())}},isDateFreeTextCanEdit:Be,isDatePickerOpen:T,handleDateChange:function(e){Ce.setNoteContents(n,e),Ce.updateAnnotation(n)},onDatePickerShow:function(e){k(e)},isCalibrationPopupOpen:Pe,showEditStyleButton:qe,isStylePopupOpen:c,hideSnapModeCheckbox:$e,openEditStylePopup:function(){return x(!0)},closeEditStylePopup:function(){return x(!1)},annotationStyle:l,onResize:function(){M(!F)},showContentEditButton:Je,onEditContent:Xe,openContentEditDeleteWarningModal:function(){var e={message:de("option.contentEdit.deletionModal.message"),title:de("option.contentEdit.deletionModal.title"),confirmBtnText:de("action.ok"),onConfirm:function(){return ln()}};be(v.a.s