UNPKG

@suns/react-monorepo-nx

Version:

To evaluate and compare the bundled and unbundled builds on large codebase.

2 lines 30.7 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{1711:function(e,t,n){var r=n(26),i=n(1712);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:function(e){const t=document.getElementsByTagName("apryse-webviewer");if(t.length>0){const n=[];for(let r=0;r<t.length;r++){const i=t[r];if(0===r)i.shadowRoot.appendChild(e),e.onload=function(){n.length>0&&n.forEach(t=>{t.innerHTML=e.innerHTML})};else{const t=e.cloneNode(!0);i.shadowRoot.appendChild(t),n.push(t)}}}else document.head.appendChild(e)},singleton:!1};r(i,o);e.exports=i.locals||{}},1712:function(e,t,n){(t=e.exports=n(27)(!1)).push([e.i,".open.ColorPickerOverlay{visibility:visible}.closed.ColorPickerOverlay{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}.ColorPickerOverlay{position:absolute;z-index:70;justify-content:center;align-items:center}.ColorPickerOverlay:empty{padding:0}.ColorPickerOverlay .buttons{display:flex}.ColorPickerOverlay .Button{margin:4px;width:32px;height:32px}@media(max-width:640px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .ColorPickerOverlay .Button{width:42px;height:42px}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .ColorPickerOverlay .Button{width:42px;height:42px}}.ColorPickerOverlay .Button:hover{background:var(--popup-button-hover)}.ColorPickerOverlay .Button .Icon{width:18px;height:18px}@media(max-width:640px){.App:not(.is-in-desktop-only-mode):not(.is-web-component) .ColorPickerOverlay .Button .Icon{width:24px;height:24px}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .ColorPickerOverlay .Button .Icon{width:24px;height:24px}}.is-vertical.ColorPickerOverlay .Button.main-menu-button{width:100%;border-radius:0;justify-content:flex-start;padding-left:var(--padding-small);padding-right:var(--padding-small);margin:0 0 var(--padding-tiny) 0}.is-vertical.ColorPickerOverlay .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.ColorPickerOverlay .Button.main-menu-button{width:100%;height:32px}}@container (max-width: 640px){.App.is-web-component:not(.is-in-desktop-only-mode) .is-vertical.ColorPickerOverlay .Button.main-menu-button{width:100%;height:32px}}.is-vertical.ColorPickerOverlay .Button.main-menu-button .Icon{margin-right:10px}.is-vertical.ColorPickerOverlay .Button.main-menu-button span{white-space:nowrap}@-webkit-keyframes bottom-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes bottom-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes up-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes up-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}.ColorPickerOverlay{border-radius:4px;box-shadow:0 0 3px 0 var(--document-box-shadow);background:var(--component-background);display:flex;flex-direction:column;padding:16px}",""]),t.locals={LEFT_HEADER_WIDTH:"41px",RIGHT_HEADER_WIDTH:"41px"}},1713:function(e,t,n){var r=n(26),i=n(1714);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:function(e){const t=document.getElementsByTagName("apryse-webviewer");if(t.length>0){const n=[];for(let r=0;r<t.length;r++){const i=t[r];if(0===r)i.shadowRoot.appendChild(e),e.onload=function(){n.length>0&&n.forEach(t=>{t.innerHTML=e.innerHTML})};else{const t=e.cloneNode(!0);i.shadowRoot.appendChild(t),n.push(t)}}}else document.head.appendChild(e)},singleton:!1};r(i,o);e.exports=i.locals||{}},1714:function(e,t,n){(t=e.exports=n(27)(!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}.MainHeader.OfficeEditorTools{padding:0 8px;align-items:center;flex-direction:row}.MainHeader.OfficeEditorTools .HeaderItems{width:auto}.MainHeader.OfficeEditorTools .HeaderItems .Dropdown{margin-left:8px}.MainHeader.OfficeEditorTools .HeaderItems .Dropdown.small-dropdown{width:80px!important}.MainHeader.OfficeEditorTools .HeaderItems .Dropdown.large-dropdown{width:160px!important}.MainHeader.OfficeEditorTools .HeaderItems .Dropdown .picked-option{text-align:left}.MainHeader.OfficeEditorTools .HeaderItems .line-spacing-dropdown .Dropdown__items{top:40px}.MainHeader.OfficeEditorTools .HeaderItems .action-button-wrapper{display:flex;align-items:center;position:relative}.MainHeader.OfficeEditorTools .HeaderItems .action-button-wrapper .more-tools{position:absolute;top:46px;right:6px;width:auto;padding:0}.MainHeader.OfficeEditorTools .Button .Icon svg{vertical-align:middle}",""]),t.locals={LEFT_HEADER_WIDTH:"41px",RIGHT_HEADER_WIDTH:"41px"}},1732:function(e,t,n){"use strict";n.r(t);n(313),n(370),n(55),n(64),n(127),n(7),n(132),n(106),n(130),n(15),n(24),n(25),n(35),n(133),n(84),n(18),n(11),n(13),n(12),n(8),n(9),n(10),n(14),n(20),n(16),n(36),n(37),n(33),n(23),n(31),n(71),n(73),n(72);var r=n(0),i=n.n(r),o=n(6),a=n(134),l=n(248),c=n(138),s=n(51),u=(n(97),n(38),n(53),n(67),n(68),n(69),n(70),n(42),n(45),n(46),n(66),n(2)),d=n(22),f=n(1);n(562);function p(e){return(p="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 m(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),l=new j(i||[]);return r(a,"_invoke",{value:x(e,n,l)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d={};function f(){}function h(){}function g(){}var y={};c(y,o,(function(){return this}));var v=Object.getPrototypeOf,E=v&&v(v(T([])));E&&E!==t&&n.call(E,o)&&(y=E);var b=g.prototype=f.prototype=Object.create(y);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){var i;r(this,"_invoke",{value:function(r,o){function a(){return new t((function(i,a){!function r(i,o,a,l){var c=u(e[i],e,o);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==p(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(d).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,l)}))}l(c.arg)}(r,o,i,a)}))}return i=i?i.then(a,a):a()}})}function x(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return h.prototype=g,r(b,"constructor",{value:g,configurable:!0}),r(g,"constructor",{value:h,configurable:!0}),h.displayName=c(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(O.prototype),c(O.prototype,a,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new O(s(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),c(b,l,"Generator"),c(b,o,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function h(e,t,n,r,i,o,a){try{var l=e[o](a),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,i)}var g=["jpg","jpeg","png","bmp"].map((function(e){return".".concat(e)})).join(", "),y=function(e){return new Promise((function(t,n){var r=new FileReader;r.readAsDataURL(e),r.onload=function(){return t(r.result)},r.onerror=n}))},v=function(){var e=Object(o.d)(),t=function(){var t,n=(t=m().mark((function t(n){var r,i,o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=n.target.files[0])){t.next=15;break}return t.prev=2,t.next=5,y(r);case 5:return i=t.sent,t.next=8,f.a.getOfficeEditor().insertImageAtCursor(i);case 8:t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),e(u.a.showWarningMessage({title:"Error",message:t.t0.message}));case 13:(o=Object(d.a)().querySelector("#office-editor-file-picker"))&&(o.value="");case 15:case"end":return t.stop()}}),t,null,[[2,10]])})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(e){h(o,r,i,a,l,"next",e)}function l(e){h(o,r,i,a,l,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();return i.a.createElement("div",{className:"FilePickerHandler"},i.a.createElement("input",{id:"office-editor-file-picker",type:"file",accept:g,onChange:t}))},E=n(5),b=n(3),w=n(87),O=n(316),x=n(342),S=n(149),k=n(228),C=n(17),j=n.n(C);n(1711);function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(e,t)}(e,t)||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,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var A=function(e){var t=e.color,n=e.onStyleChange,a=e.portalElementId,l=void 0===a?"app":a,c=T(Object(r.useState)((function(){return{left:"555px",right:"auto",top:"auto"}})),2),f=c[0],p=c[1],m=Object(r.useRef)(null),h=T(Object(o.e)((function(e){return[b.a.isElementOpen(e,"colorPickerOverlay")]})),1)[0],g=Object(o.d)();return Object(S.a)(m,(function(e){var t=document.querySelector('[data-element="textColorButton"]');(null==t?void 0:t.contains(e.target))||g(u.a.closeElements(["colorPickerOverlay"]))})),Object(r.useLayoutEffect)((function(){if(h){var e=function(){var e=Object(k.a)("textColorButton",m);p(e)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}}),[h]),Object(w.createPortal)(i.a.createElement(s.a,{"data-element":"colorPickerOverlay",className:j()({ColorPickerOverlay:!0,Popup:!0,open:h,closed:!h}),style:f,ref:m},i.a.createElement(O.a,{color:t,property:"TextColor",onStyleChange:n,useMobileMinMaxWidth:!0}),i.a.createElement(x.a,{color:t,onStyleChange:n,enableEdit:!0})),Object(d.a)().getElementById(l))},I=n(227),H=function(){var e;null===(e=Object(d.a)().querySelector("#office-editor-file-picker"))||void 0===e||e.click()},L=n(209),_={Single:1,1.15:1.15,1.5:1.5,Double:2},N="left",D="center",F="right",M="both",R="ordered",B="unordered",z=n(177),G=n(39);n(438),n(1713);function V(e){return(V="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 U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){W(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function W(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==V(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==V(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===V(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e,t)||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 q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var J={"Normal Text":{fontSize:"11pt",color:"#000000"},Title:{fontSize:"26pt",color:"#000000"},Subtitle:{fontSize:"15pt",color:"#666666"},"Heading 1":{fontSize:"20pt",color:"#000000"},"Heading 2":{fontSize:"16pt",color:"#000000"},"Heading 3":{fontSize:"14pt",color:"#434343"},"Heading 4":{fontSize:"12pt",color:"#666666"},"Heading 5":{fontSize:"11pt",color:"#666666"}},$=["8","9","10","11","12","14","18","24","30","36","48","60","72"],Q=function(){G.o||G.i||f.a.getViewerElement().focus()},X=function(e){var t=e.cursorProperties,n=e.isBold,r=e.isItalic,o=e.isUnderline;return i.a.createElement(i.a.Fragment,null,i.a.createElement(v,null),i.a.createElement(l.a,{isActive:n,onClick:function(){f.a.getOfficeEditor().isTextSelected()?f.a.getOfficeEditor().toggleSelectedTextStyle("bold"):f.a.getOfficeEditor().setCursorStyle({bold:!t.bold}),Q()},dataElement:"office-editor-bold",title:"officeEditor.bold",img:"icon-text-bold"}),i.a.createElement(l.a,{isActive:r,onClick:function(){f.a.getOfficeEditor().isTextSelected()?f.a.getOfficeEditor().toggleSelectedTextStyle("italic"):f.a.getOfficeEditor().setCursorStyle({italic:!t.italic}),Q()},dataElement:"office-editor-italic",title:"officeEditor.italic",img:"icon-text-italic"}),i.a.createElement(l.a,{isActive:o,onClick:function(){f.a.getOfficeEditor().isTextSelected()?f.a.getOfficeEditor().toggleSelectedTextStyle("underline"):f.a.getOfficeEditor().setCursorStyle({underline:"none"===t.underlineStyle}),Q()},dataElement:"office-editor-underline",title:"officeEditor.underline",img:"icon-text-underline"}))},Z=function(e){var t=e.justification;return i.a.createElement(i.a.Fragment,null,i.a.createElement(l.a,{isActive:t===N,dataElement:"office-editor-left-align",title:"officeEditor.leftAlign",img:"icon-menu-left-align",onClick:function(){f.a.getOfficeEditor().updateParagraphStyle({justification:"left"}),f.a.getOfficeEditor().setCursorStyle({justification:"left"}),Q(),f.a.getDocumentViewer().clearSelection()}}),i.a.createElement(l.a,{isActive:t===D,dataElement:"office-editor-center-align",title:"officeEditor.centerAlign",img:"icon-menu-centre-align",onClick:function(){f.a.getOfficeEditor().updateParagraphStyle({justification:"center"}),f.a.getOfficeEditor().setCursorStyle({justification:"center"}),Q(),f.a.getDocumentViewer().clearSelection()}}),i.a.createElement(l.a,{isActive:t===F,dataElement:"office-editor-right-align",title:"officeEditor.rightAlign",img:"icon-menu-right-align",onClick:function(){f.a.getOfficeEditor().updateParagraphStyle({justification:"right"}),f.a.getOfficeEditor().setCursorStyle({justification:"right"}),Q(),f.a.getDocumentViewer().clearSelection()}}),i.a.createElement(l.a,{isActive:t===M,dataElement:"office-editor-justify",title:"officeEditor.justify",img:"icon-menu-both-align",onClick:function(){f.a.getOfficeEditor().updateParagraphStyle({justification:"both"}),f.a.getOfficeEditor().setCursorStyle({justification:"both"}),Q(),f.a.getDocumentViewer().clearSelection()}}))},ee=function(e){var t=e.listType;return i.a.createElement(i.a.Fragment,null,i.a.createElement(l.a,{isActive:t===B,dataElement:"office-editor-bullet-list",title:"officeEditor.bulletList",img:"icon-office-editor-bullet-list",onClick:function(){f.a.getOfficeEditor().toggleListSelection(B),Q()}}),i.a.createElement(l.a,{isActive:t===R,dataElement:"office-editor-number-list",title:"officeEditor.numberList",img:"icon-office-number-list",onClick:function(){f.a.getOfficeEditor().toggleListSelection(R),Q()}}))};t.default=function(){var e=Object(o.d)(),t=K(Object(o.e)((function(e){return[b.a.isElementOpen(e,E.a.OFFICE_EDITOR_TOOLS_HEADER),b.a.getOfficeEditorCursorProperties(e),b.a.getOfficeEditorSelectionProperties(e),b.a.getAvailableFontFaces(e),b.a.getActiveTheme(e),b.a.getCSSFontValues(e),b.a.isElementDisabled(e,E.a.OFFICE_EDITOR_TOOLS_HEADER_INSERT_IMAGE)]}),o.c),7),n=t[0],d=t[1],p=t[2],m=t[3],h=t[4],g=t[5],y=t[6],v=K(Object(r.useState)(0),2),w=v[0],O=v[1],x=K(Object(r.useState)(0),2),S=x[0],k=x[1],C=K(Object(r.useState)(6),2),j=C[0],T=C[1],P=K(Object(r.useState)(!1),2),N=P[0],D=P[1];Object(r.useEffect)((function(){var t,n,r=function(t){e(u.a.setOfficeEditorCursorProperties(t))},i=function(t){e(u.a.setOfficeEditorSelectionProperties(t))};return null===(t=f.a.getDocument())||void 0===t||t.addEventListener("cursorPropertiesUpdated",r),null===(n=f.a.getDocument())||void 0===n||n.addEventListener("selectionPropertiesUpdated",i),function(){var e,t;null===(e=f.a.getDocument())||void 0===e||e.removeEventListener("selectionPropertiesUpdated",i),null===(t=f.a.getDocument())||void 0===t||t.removeEventListener("cursorPropertiesUpdated",r)}}),[]),Object(r.useEffect)((function(){d.fontFace&&!m.includes(d.fontFace)&&e(u.a.addOfficeEditorAvailableFontFace(d.fontFace))}),[m,d]),Object(r.useEffect)((function(){if(0!==w&&0!==S){var e=w-16;T(e>=S?6:e<S&&e>=S-121+77?5:e<S-121+77&&e>=S-121-209+77&&e>=858?4:3)}}),[w,S]);var F,M=f.a.getOfficeEditor().isTextSelected(),R=M?p.bold:d.bold,B=M?p.italic:d.italic,G=M?"single"===p.underlineStyle:"single"===d.underlineStyle,V=M?p.fontFace:d.fontFace,U=M?p.pointSize:d.pointSize,W=void 0===U?void 0:U.toString(),q=M?p.justification:d.justification,Q=function(e,t,n){var r=t?t/n:e;switch(Object.values(_).reduce((function(e,t){var n=Math.abs(e-r),i=Math.abs(t-r);return n===i?e<t?e:t:i<n?t:e}))){case 1:return"Single";case 1.15:return"1.15";case 1.5:return"1.5";case 2:return"Double";default:return"Single"}}(M?p.lineHeightMultiplier:d.lineHeightMultiplier,M?p.lineHeight:d.lineHeight,d.fontPointSize||11),te=M?p.listType:d.listType,ne=h===L.a.LIGHT,re=(F=d.color)?new window.Core.Annotations.Color(F.r,F.g,F.b,1):new window.Core.Annotations.Color(0,0,0,1),ie=ne?"rgba(255,255,255,1)"===re.toString():"rgba(0,0,0,1)"===re.toString(),oe=function(e){var t=e.paragraphTextStyle||e,n=t.pointSize,r=t.color,i="Normal Text";if(!n||!r)return i;var o="".concat(n,"pt"),a="#000000";return a&&(a=Object(I.c)(r.r,r.g,r.b).slice(0,-2)),Object.keys(J).forEach((function(e){J[e].fontSize===o&&J[e].color===a&&(i=e)})),i};return n?i.a.createElement(s.a,{dataElement:E.a.OFFICE_EDITOR_TOOLS_HEADER,className:"HeaderToolsContainer"},i.a.createElement(z.a,{bounds:!0,onResize:function(e){var t=e.bounds;O(t.width)}},(function(t){var n=t.measureRef;return i.a.createElement("div",{className:"MainHeader Tools OfficeEditorTools",ref:n},i.a.createElement(z.a,{bounds:!0,onResize:function(e){var t=e.bounds;0===S&&k(t.width)}},(function(t){var n=t.measureRef;return i.a.createElement("div",{className:"HeaderItems",ref:n},i.a.createElement(a.a,{items:Object.keys(J),onOpened:function(){return D(!1)},onClickItem:function(e){var t=J[e],n=parseInt(t.fontSize,10),r=new window.Core.Annotations.Color(t.color),i={bold:!1,italic:!1,underline:!1,pointSize:n,color:{r:r.R,g:r.G,b:r.B,a:255}};f.a.getOfficeEditor().updateParagraphStyle({textStyle:i}),f.a.getOfficeEditor().setCursorStyle(i),setTimeout((function(){f.a.getViewerElement().focus()})),f.a.getDocumentViewer().clearSelection()},getCustomItemStyle:function(e){return Y(Y({},J[e]),{},{padding:"20px 10px",color:"var(--gray-12)"})},applyCustomStyleToButton:!1,currentSelectionKey:oe(d),className:"large-dropdown",dataElement:"office-editor-text-format"}),i.a.createElement(a.a,{items:m,onOpened:function(){return D(!1)},onClickItem:function(e){f.a.getOfficeEditor().isTextSelected()&&f.a.getOfficeEditor().updateSelectionStyle({fontFace:e}),f.a.getOfficeEditor().setCursorStyle({fontFace:e}),setTimeout((function(){f.a.getViewerElement().focus()}))},getCustomItemStyle:function(e){return Y({},g[e])},maxHeight:500,customDataValidator:function(e){return m.includes(e)},className:"large-dropdown",dataElement:"office-editor-font",currentSelectionKey:V,hasInput:!0}),i.a.createElement(a.a,{items:$,onOpened:function(){return D(!1)},onClickItem:function(e){var t=parseInt(e,10);isNaN(t)&&(t=11),t>72&&(t=72),f.a.getOfficeEditor().isTextSelected()&&f.a.getOfficeEditor().updateSelectionStyle({pointSize:t}),f.a.getOfficeEditor().setCursorStyle({pointSize:t}),setTimeout((function(){f.a.getViewerElement().focus()}))},currentSelectionKey:W,className:"small-dropdown",dataElement:"office-editor-font-size",hasInput:!0,isSearchEnabled:!1}),j>=4&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"divider"}),i.a.createElement(X,{cursorProperties:d,isBold:R,isItalic:B,isUnderline:G})),i.a.createElement("div",{className:"divider"}),i.a.createElement(c.a,{onClick:function(){return D(!1)},dataElement:"textColorButton",title:"officeEditor.textColor",img:"icon-office-editor-circle",element:"colorPickerOverlay",color:re.toString(),iconClassName:ie?"icon-border":""}),i.a.createElement(A,{onStyleChange:function(t,n){var r={r:n.R,g:n.G,b:n.B,a:255};f.a.getOfficeEditor().isTextSelected()&&f.a.getOfficeEditor().updateSelectionStyle({fontColor:r}),f.a.getOfficeEditor().setCursorStyle({fontColor:r}),e(u.a.closeElements(["colorPickerOverlay"])),f.a.getViewerElement().focus()},color:re}),j>=5&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"divider"}),i.a.createElement(Z,{justification:q})),i.a.createElement("div",{className:"divider"}),i.a.createElement(a.a,{items:Object.keys(_),onClickItem:function(e){var t=_[e];f.a.getOfficeEditor().updateParagraphStyle({lineHeightMultiplier:t}),f.a.getOfficeEditor().setCursorStyle({lineHeight:Q}),f.a.getViewerElement().focus(),f.a.getDocumentViewer().clearSelection()},currentSelectionKey:Q,className:"small-dropdown line-spacing-dropdown",dataElement:"office-editor-line-spacing",displayButton:function(e){return i.a.createElement(l.a,{title:"officeEditor.lineSpacing",img:"icon-office-editor-line-spacing",isActive:e,onClick:function(){return D(!1)}})}}),!y&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"divider"}),i.a.createElement(l.a,{className:"tool-group-button",dataElement:E.a.OFFICE_EDITOR_TOOLS_HEADER_INSERT_IMAGE,title:"officeEditor.insertImage",img:"icon-tool-image-line",onClick:H})),6===j&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"divider"}),i.a.createElement(ee,{listType:te})),j<6&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"divider"}),i.a.createElement("div",{className:"action-button-wrapper"},i.a.createElement(l.a,{className:"tool-group-button",isActive:N,dataElement:"office-editor-more-tools",title:"action.more",img:"icon-tools-more-vertical",onClick:function(){return D(!N)}}),N&&i.a.createElement("div",{className:"more-tools MainHeader Tools OfficeEditorTools"},i.a.createElement("div",{className:"HeaderItems"},j<4&&i.a.createElement(i.a.Fragment,null,i.a.createElement(X,{cursorProperties:d,isBold:R,isItalic:B,isUnderline:G}),i.a.createElement("div",{className:"divider"})),j<5&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Z,{justification:q}),i.a.createElement("div",{className:"divider"})),j<6&&i.a.createElement(ee,{listType:te}))))))})))}))):null}}}]); //# sourceMappingURL=25.chunk.js.map