/*!
 * PSPDFKit for Web 2021.4.1 (https://pspdfkit.com/web)
 * 
 * Copyright (c) 2016-2019 PSPDFKit GmbH. All rights reserved.
 * 
 * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
 * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 * This notice may not be removed from this file.
 * 
 * PSPDFKit uses several open source third-party components: https://pspdfkit.com/acknowledgements/web/
 */
(window.webpackJsonpPSPDFKit=window.webpackJsonpPSPDFKit||[]).push([[66],{642:function(e,t,a){var n={"./add.svg":444,"./duplicate.svg":445,"./extract.svg":446,"./help.svg":447,"./importDocument.svg":441,"./move.svg":442,"./moveLeft.svg":448,"./moveRight.svg":449,"./multiplePages.svg":443,"./redo.svg":450,"./remove.svg":451,"./rotateLeft.svg":452,"./rotateRight.svg":453,"./selectAll.svg":454,"./selectNone.svg":455,"./undo.svg":456};function s(e){var t=o(e);return a(t)}function o(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}s.keys=function(){return Object.keys(n)},s.resolve=o,e.exports=s,s.id=642},726:function(e,t,a){"use strict";a.r(t);var n=a(1),s=a.n(n),o=a(411),r=a(9),l=a(3),i=a(193),c=a(22),d=a(15),m=a(29),u=a(4),p=a(2),g=a(42),f=a(0),b=a(6),P=a.n(b),y=a(8),v=a(410),h=a(45),w=a(86),O=a(112),I=a(275),E=a(70),N=a.n(E),D=a(13),k=a.n(D),C=a(60);function j(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?j(Object(a),!0).forEach((function(t){s()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const S=f.memo((({items:e,builtInItems:t,moveDialog:n,CSS_HACK:{components:{ToolbarButtonComponent:s},styles:o}})=>e.map(((e,r)=>{const l=t.find((t=>t.type===e.type));if("spacer"===e.type)return f.createElement("div",{style:{flex:1},className:e.className,key:`spacer-${r}`});if("move"===e.type&&l)return f.createElement("div",{key:l.type,className:o.moveButtonContainer},f.createElement(s,k()({},l,{icon:a(442),className:P()(l.className,e.className),onPress:e=>{l&&l.onPress&&l.onPress(e)}})),n);if(l){const t=Object(C.g)(l.type);return f.createElement(s,k()({},l,{key:l.type||r,icon:a(642)(`./${t}.svg`),onPress:e=>{l&&l.onPress&&l.onPress(e)},className:P()(l.className,e.className)}))}if("custom"===e.type&&e.node){const{type:t}=e,a=N()(e,["type"]);return f.createElement(I.a,k()({},a,{onPress:t=>e.onPress&&e.onPress(t,e.id),key:e.id||r}))}return f.createElement(s,k()({},e,{key:l&&l.type||r,onPress:t=>e.onPress&&e.onPress(t,e.id)}))})))),M=f.memo((({items:e,builtInItems:t,CSS_HACK:{components:{ToolbarDropdownGroupComponent:n,ToolbarButtonComponent:s},styles:o},frameWindow:r})=>{const l=e.map((({item:e,index:a})=>{const n=t.find((t=>t.type===e.type));return n?{index:a,item:x(x({},n),{},{className:P()(n.className,e.className),onPress:e=>{n.onPress&&n.onPress(e)}})}:{item:e,index:a}}));return l.length>0&&f.createElement(f.Fragment,null,f.createElement("div",{style:{flex:1},key:"spacer-responsive"}),f.createElement(n,{icon:{type:"more",size:{width:20,height:20}},items:l,discreteDropdown:!0,caretDirection:"down",role:"menu",ItemComponent:({item:e,isSelectedItem:n,state:r,itemComponentProps:l})=>{const i=!n&&t.find((t=>t.type===e.item.type));if(n)return null;const c=i&&i.type?Object(C.g)(i.type):"";return e.item.node?f.createElement(I.a,k()({},e.item,{onPress:e.item.onPress?t=>e.item.onPress(t,e.id):void 0,key:e.item.id||e.index})):f.createElement(s,k()({},e.item,{role:"menuitem",className:P()(e.item.className,o.toolbar.dropdownButton,"Focused"===r&&o.toolbar["dropdownButton"+r]),icon:i?a(642)(`./${c}.svg`):e.item.icon,itemComponentProps:l}))},onSelect:(e,t)=>{const{onPress:a,disabled:n}=t.item;n||a&&a(e)},noInitialSelection:!0,frameWindow:r}))}));var A=a(7);function z(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function K(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?z(Object(a),!0).forEach((function(t){s()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):z(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const B=new p.P({width:r.b,height:r.a});var L=f.createElement("div",null),R=f.createElement(w.a,null);const T=e=>{const{styles:t,formatMessage:n,movePreview:s}=e;return f.createElement("div",{style:{width:e.width,height:e.height},className:P()(t.importedDocument,{[t.importedDocumentMovePreview]:s})},f.createElement("div",{className:t.importedDocumentIconCircle},f.createElement(h.a,{src:a(441)})),f.createElement("span",{className:t.importedDocumentInfo},n(_.documentMergedHere)))},F=(e,t,a,n)=>{const s=t.flatten();let o=e.map((e=>({type:"page",page:e,rotation:0,label:e.pageLabel})));const r=e=>{const t=e.dupeOf||e.label;let a=0;for(const e of o)"dupeOf"in e&&null!=e.dupeOf&&e.dupeOf===t&&null!=e.dupeNumber&&e.dupeNumber>a&&(a=e.dupeNumber);return a+1};let i=0;for(const e of s)switch(e.type){case"addPage":{let t;null!=e.afterPageIndex?t=e.afterPageIndex+1:(Object(A.a)(null!=e.beforePageIndex),t=e.beforePageIndex),++i,o=o.insert(t,{type:"newPage",label:`${a(_.newPage)} ${i}`,rotation:0,size:new p.P({width:e.pageWidth,height:e.pageHeight})});break}case"removePages":{const t=e.pageIndexes.map((e=>o.get(e)));for(const e of t){Object(A.a)(null!=e);const t=o.indexOf(e);o=o.delete(t)}break}case"rotatePages":for(const t of e.pageIndexes){const a=o.get(t);let n,s;Object(A.a)(null!=a),Object(A.a)("page"===a.type||"newPage"===a.type);const r=a.rotation;if(s=90===e.rotateBy?270===r?0:r+e.rotateBy:90===r?0:180===r?90:270===r?180:r+e.rotateBy,Object(A.a)(0===s||90===s||180===s||270===s),"page"===a.type)n=K(K({},a),{},{rotation:s});else{if("newPage"!==a.type)throw new l.a("Rotation is not allowed on imported documents");n=K(K({},a),{},{rotation:s})}o=o.set(t,n)}break;case"duplicatePages":{const t=e.pageIndexes.map((e=>o.get(e)));for(const e of t){Object(A.a)(null!=e),Object(A.a)("page"===e.type);const t=r(e),a=e.dupeOf||e.label,n=o.indexOf(e);o=o.insert(n+1,Object.assign({},e,{label:`${a} (${t})`,dupeOf:a,dupeNumber:t}))}break}case"movePages":{const t=e.pageIndexes;if(1===t.length){const a=t[0];let n;null!=e.beforePageIndex?n=e.beforePageIndex:(Object(A.a)(null!=e.afterPageIndex),n=e.afterPageIndex+1);const s=o.get(a);Object(A.a)(null!=s);const r=o.get(n),l=o.size;o=o.delete(a),n===l?o=o.push(s):0===n?o=o.unshift(s):(Object(A.a)(null!=r),o=o.insert(o.indexOf(r),s))}else{const a=t.slice().sort();if(null!=e.beforePageIndex){Object(A.a)(0===e.beforePageIndex);const t=a.map((e=>o.get(e))).reverse();for(const e of t)Object(A.a)(null!=e),o=o.delete(o.indexOf(e)),o=o.unshift(e)}else{Object(A.a)(null!=e.afterPageIndex);const t=o.get(e.afterPageIndex);Object(A.a)(null!=t);const n=a.map((e=>o.get(e))).reverse();for(const e of n)Object(A.a)(null!=e),o=o.delete(o.indexOf(e)),o=o.insert(o.indexOf(t)+1,e)}}break}case"importDocument":{let t,a;if("beforePageIndex"in e&&null!=e.beforePageIndex?t=e.beforePageIndex:(Object(A.a)("afterPageIndex"in e&&null!=e.afterPageIndex),t=e.afterPageIndex+1),"string"==typeof e.document){const t=e.document;Object(A.a)(n.has(t)),a=n.get(t,"Imported Document")}else Object(A.a)("string"==typeof e.document.name),a=e.document.name;o=o.insert(t,{type:"importedDocument",label:a});break}case"keepPages":case"applyInstantJson":case"applyXfdf":case"flattenAnnotations":case"performOcr":case"setPageLabel":case"applyRedactions":case"updateMetadata":throw Error("Unknown document operation");default:Object(l.b)(e.type)}return o},H=e=>{const{pages:t,style:a,styles:n,previewCount:s}=e;return f.createElement("div",{className:n.movePreview},f.createElement("div",{className:P()(n.movePreviewPages,{[n.movePreviewPagesLoose]:"loose"===a})},t),f.createElement("div",{className:n.movePreviewCount},s||t.length))};t.default=Object(d.d)((e=>{const{onCancel:t,pages:n,dispatch:s,backend:d,frameWindow:b,intl:{formatMessage:w},onDialog:E,footerItems:N,toolbarItems:D}=e,k=f.useMemo((()=>N.toJS()),[N]),C=f.useMemo((()=>D.toJS()),[D]),{styles:j}=e.CSS_HACK,[x,z]=f.useState(Object(u.b)()),[W,$]=f.useState(Object(u.a)()),[V,J]=f.useState(0),G=W.slice(0,W.size-V),U=F(e.pages,G,w,x),[Y,q]=f.useState(Object(u.g)()),[X,Q]=f.useState(!1),[Z,ee]=f.useState(!1),te=f.useRef(null),ae=f.useRef(null),[ne,se]=f.useState(!1),[oe,re]=f.useState(""),le=f.useCallback((()=>{const e=ae.current;null!=e&&(ne&&e.ownerDocument.activeElement!==e?e.focus():ne||e.ownerDocument.activeElement!==e||e.blur())}),[ne]),ie=f.useCallback((e=>{se(e),le(),E(e)}),[E,le]);f.useEffect((()=>{le()}),[le]);const ce=f.useCallback((e=>{$(G.push(e)),J(0)}),[G]),de=f.useRef(!0);f.useLayoutEffect((()=>()=>{de.current&&(de.current=!1)}),[]);const me=f.useCallback((()=>{const e=n.get(0),t=e?e.pageSize:B,a={type:"addPage",backgroundColor:p.j.WHITE,pageWidth:t.width,pageHeight:t.height,rotateBy:0};1===Y.size?a.afterPageIndex=Y.first():a.beforePageIndex=0,ce(a),q(Y.clear())}),[n,Y,ce]),ue=f.useCallback((()=>{ce({type:"removePages",pageIndexes:Y.toArray()}),q(Y.clear())}),[ce,Y]),pe=f.useCallback((()=>{ce({type:"duplicatePages",pageIndexes:Y.toArray()}),q(Y.clear())}),[ce,Y]),ge=f.useCallback((()=>{ce({type:"rotatePages",pageIndexes:Y.toArray(),rotateBy:270})}),[ce,Y]),fe=f.useCallback((()=>{ce({type:"rotatePages",pageIndexes:Y.toArray(),rotateBy:90})}),[ce,Y]),be=f.useCallback((()=>{ie(!ne)}),[ne,ie]),Pe=f.useCallback((e=>{const t=e.target.value;let a=t;const n=parseInt(t,10);isNaN(n)||(a=Math.min(Math.max(n,0),U.size).toString()),re(a)}),[U.size]),ye=parseInt(oe,10),ve=f.useCallback((e=>{let t;return 1===e.size||null==e.sort().find((e=>{let a=!1;return null!=t&&(a=e!==t+1),t=e,a}))}),[]),he=f.useCallback(((e,t)=>{const a=null!=t?t:Y,n=ve(a);return!(a.includes(e-1)||0===e&&n&&a.includes(0)||n&&a.sort().first()===e)}),[Y,ve]),we=!isNaN(ye)&&he(ye),Oe=f.useCallback(((e,t)=>{const a=null!=t?t:Y,n=e-1;ce(K({type:"movePages",pageIndexes:a.toArray()},0===e?{beforePageIndex:0}:{afterPageIndex:n}));let s=Object(u.g)(),o=0;0!==e&&(o=n+1,a.forEach((e=>{e<n&&--o})));let r=o;a.forEach((()=>{s=s.add(r),++r})),q(s)}),[Y,ce,q]),Ie=f.useCallback((e=>{e.preventDefault(),we&&(Oe(ye),ie(!1))}),[we,ye,ie,Oe]),Ee=f.useCallback((e=>{const t=e.target;if(!ne||t.classList.contains(j.moveToolbarButton))return;const a=te.current;Object(A.a)(null!=a),a.contains(t)||ie(!1)}),[ne,ie,j.moveToolbarButton]),Ne=f.useCallback((()=>{const e=Y.sort().toList().map((e=>({type:"movePages",pageIndexes:[e],beforePageIndex:e-1})));ce(e),q(Object(u.g)(Y.toArray().map((e=>e-1))))}),[ce,Y]),De=f.useCallback((()=>{const e=Y.sort().toList().map((e=>({type:"movePages",pageIndexes:[e],afterPageIndex:e+1})));ce(e),q(Object(u.g)(Y.toArray().map((e=>e+1))))}),[ce,Y]),ke=f.useCallback((()=>{q(Y.clear()),J(V+1)}),[Y,V]),Ce=f.useCallback((()=>{q(Y.clear()),J(V-1)}),[Y,V]),je=f.useCallback((async()=>{const e={};1===Y.size?e.afterPageIndex=Y.first():e.beforePageIndex=0;{const t=document.createElement("input");t.type="file",t.accept="application/pdf",t.onclick=e=>{e.target.value=""},t.onchange=t=>{if(0===t.target.files.length)return;let a=G;for(const n of t.target.files){if("string"!=typeof n.name||0===n.name.length)return;if("application/pdf"!==n.type)return void Object(l.o)("The uploaded file must be a PDF.");if(-1!==U.findIndex((e=>"importedDocument"===e.type&&e.label===n.name)))return;a=a.push(K({type:"importDocument",treatImportedDocumentAsOnePage:!0,document:n},e))}$(a),J(0),q(Y.clear())},t.click()}}),[Y,x,ce,G,U]),xe=f.useCallback((()=>{q(U.keySeq().toSet())}),[U,q]),Se=f.useCallback((()=>{q(Y.clear())}),[Y,q]),Me=f.useCallback((e=>{Y.has(e)?q(Y.delete(e)):q(Y.add(e))}),[Y,q]),Ae=f.useCallback((()=>{t()}),[t]),ze=f.useCallback((()=>{Q(!0),s(Object(i.a)(G.flatten().toArray(),(()=>{de.current&&Q(!1)}),(e=>{throw de.current&&Q(!1),e})))}),[s,G]),Ke=f.useCallback((async()=>{Q(!0);try{const e=await d.exportPDFWithOperations(G.flatten().toArray().map(g.q));Object(m.d)(e,b)}catch(e){throw e}finally{de.current&&Q(!1)}}),[d,G,b]),Be=(e,t,a,n)=>{const s=U.get(e);let r;switch(Object(A.a)(null!=s),s.type){case"page":r=f.createElement(o.b,{key:`page-${s.label}`,page:s.page,size:t,maxSize:a,rotation:s.rotation});break;case"newPage":{const{rotatedWidth:e,rotatedHeight:n}=Object(o.a)(s.size,s.rotation,t,a);r=f.createElement("div",{key:`newPage-${s.label}`,className:j.newPage,style:{width:e,height:n}});break}case"importedDocument":{const{containerWidth:e,containerHeight:l}=Object(o.a)(B,0,t,a);r=f.createElement(T,{width:e,height:l,movePreview:n,key:`importedDoc-${s.label}`,styles:j,formatMessage:w});break}default:r=f.createElement(f.Fragment,null),Object(l.b)(s.type)}return{item:r,label:s.label}},Le=Y.size>0&&Y.size!==U.size&&!X,Re=Y.size>0&&void 0===Y.find((e=>{const t=U.get(e);return Object(A.a)(null!=t),"page"!==t.type&&"newPage"!==t.type})),Te=Y.size>0&&void 0===Y.find((e=>{const t=U.get(e);return Object(A.a)(null!=t),"page"!==t.type})),Fe=!Y.isEmpty()&&Y.size!==U.size&&!X,He=!Y.isEmpty()&&!Y.includes(0),_e=!Y.isEmpty()&&!Y.includes(U.size-1),We=V<W.size,$e=V>0,Ve=Y.size<U.size&&!X,Je=!Y.isEmpty()&&!X,Ge=f.useRef(null),Ue=f.useRef(!1);f.useLayoutEffect((()=>{const e=Ge.current;if(null==e)return;Ue.current||(e.focus(),Ue.current=!0);const t=e=>{if(null!=document.activeElement&&"INPUT"===document.activeElement.tagName)return;if(X)return;const t=e.key.toLowerCase(),a=e.metaKey||e.ctrlKey,n=a&&!e.shiftKey&&!e.altKey,s=e.altKey&&!a&&!e.shiftKey,o=!a&&!e.shiftKey&&!e.altKey;if(e.altKey&&e.shiftKey&&!a&&"arrowleft"===t&&Re)ge();else if(e.altKey&&e.shiftKey&&!a&&"arrowright"===t&&Re)fe();else if(s&&"arrowleft"===t&&He)Ne();else if(s&&"arrowright"===t&&_e)De();else if(a&&e.shiftKey&&!e.altKey&&"z"===t&&$e)Ce();else if(n&&"z"===t&&We)ke();else if(n&&"a"===t&&Ve)xe();else if(n&&"d"===t&&Je)Se();else if(o&&"n"===t)me();else if(o&&"d"===t&&Le)ue();else if(o&&"c"===t&&Te)pe();else if(o&&"l"===t&&Re)ge();else if(o&&"r"===t&&Re)fe();else if(o&&"m"===t&&Fe)ie(!0);else{if(!o||"i"!==t)return;je()}e.preventDefault()};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[Te,Fe,He,_e,$e,Le,Re,Ve,Je,We,me,pe,je,Ne,De,Ce,ue,ge,fe,xe,Se,ke,X,ie]);const Ye=j.toolbar.toolbarButton,qe=[{type:"add",onPress:me,className:Ye,disabled:X,children:w(_.newPage)},{type:"remove",onPress:ue,className:Ye,disabled:!Le,children:w(_.removePage)},{type:"duplicate",onPress:pe,className:Ye,children:w(_.duplicatePage),disabled:!Te||X},{type:"rotate-left",onPress:ge,className:Ye,children:w(_.rotatePageLeft),disabled:!Re||X},{type:"rotate-right",onPress:fe,className:Ye,children:w(_.rotatePageRight),disabled:!Re||X},{type:"move",onPress:be,className:P()(Ye,j.moveToolbarButton),children:w(_.openMoveDialog),disabled:!Fe},{type:"move-left",onPress:Ne,className:j.toolbar.toolbarButton,children:w(_.moveBefore),disabled:!He||X},{type:"move-right",onPress:De,className:Ye,children:w(_.moveAfter),disabled:!_e||X},{type:"import-document",onPress:je,className:Ye,children:w(_.mergeDocument),disabled:X},{type:"spacer"},{type:"undo",onPress:ke,className:Ye,children:w(y.a.undo),disabled:!We||X},{type:"redo",onPress:Ce,className:Ye,children:w(y.a.redo),disabled:!$e||X},{type:"select-all",onPress:xe,className:Ye,children:w(_.selectAll),disabled:!Ve},{type:"select-none",onPress:Se,className:Ye,children:w(_.selectNone),disabled:!Je}],[Xe,Qe]=f.useState(Number.POSITIVE_INFINITY),[Ze,et]=f.useMemo((()=>Xe===Number.POSITIVE_INFINITY?[C,[]]:[C.slice(0,Xe),C.slice(Xe).filter((e=>"spacer"!==e.type)).map(((e,t)=>({index:t,item:K(K({},e),{},{dropdownGroup:"documentEditor"})})))]),[C,Xe]),[tt,at]=f.useState(new p.P),nt=f.useCallback((e=>{at((t=>(t.width!==e.width&&Qe(Number.POSITIVE_INFINITY),new p.P({width:e.width,height:e.height}))))}),[at,Qe]),st=f.useRef(null);f.useLayoutEffect((()=>{const e=st.current;if(!e||0===tt.width)return;const t=e.children;if(t.length===Xe)return;const a=e.ownerDocument.defaultView.getComputedStyle(e);let n=44+(parseInt(a.getPropertyValue("padding-left"))||0)+(parseInt(a.getPropertyValue("padding-right"))||0);const s=[].findIndex.call(t,((e,t)=>"spacer"!==C[t].type&&(n+=e.clientWidth,n>tt.width)));Qe(-1===s?Number.POSITIVE_INFINITY:s);e.ownerDocument.defaultView.innerWidth>=r.e?ee(!0):ee(!1)}),[tt,Xe,Qe,C]);const ot=f.useCallback((e=>{"Escape"===e.key&&ne&&(ie(!1),e.stopPropagation())}),[ne,ie]),rt=f.useMemo((()=>null!=Ze.find((e=>"move"===e.type))),[Ze]),lt=f.createElement("div",{className:P()(j.moveDialog,{[j.moveDialogShown]:ne,[j.moveDialogDetached]:!rt}),ref:te},f.createElement("form",{onSubmit:Ie,className:j.moveDialogForm},f.createElement("span",{className:j.moveDialogFormLabel},w(_.insertAfterPage)),f.createElement("input",{className:j.moveDialogFormInput,type:"number",min:"0",max:U.size,value:oe,onChange:Pe,ref:ae}),f.createElement(c.b,{type:"submit",className:j.moveDialogMoveButton,disabled:!we},w(_.move))),f.createElement("div",{className:j.moveDialogHint},f.createElement("p",{className:j.moveDialogHintText},w(_.moveBeginningHint)))),it=f.useCallback(((e,t)=>{const a=Object(u.g)(e);he(t,a)&&Oe(t,a)}),[Oe,he]);let ct;const dt=ne&&!isNaN(ye);if(dt){const e=Y.toList().sort().map((e=>Be(e,160,160,!0).item)).toArray(),t=f.createElement(H,{pages:e,style:"straight",styles:j});dt&&(ct=0===ye?{previewContent:t,pageIndex:0,position:"left"}:{previewContent:t,pageIndex:ye-1,position:"right"},we||(ct.disabled=!0))}const mt=f.useMemo((()=>({cancel:{element:f.createElement(c.b,null,w(y.a.cancel)),onPress:Ae},"selected-pages":{element:f.createElement("div",null,f.createElement("div",{className:j.pagesSelectedIcon},f.createElement(h.a,{src:a(443)})),w(_.pagesSelected,{arg0:Y.size})),className:P()({[j.pagesSelectedIndicator]:!0,[j.pagesSelectedIndicatorShown]:Y.size>0})},spacer:{element:L,className:j.spacer},"loading-indicator":{element:R,hide:!X},"save-as":{element:f.createElement(c.b,null,w(y.a.saveAs)),onPress:Ke,disabled:X},save:{element:f.createElement(c.b,{primary:!0},w(y.a.save)),disabled:G.isEmpty()||X,onPress:ze}})),[j,w,Ae,Ke,ze,X,G,_,Y]),ut=f.useMemo((()=>k.map(((e,t)=>{const{onPress:a,className:n,type:s,node:o,id:r}=e;if("custom"===s)return o?f.createElement(I.a,{className:n,onPress:a?e=>a(e,r):void 0,key:r||t,node:o}):null;if(s){const e=mt[s];return e.hide?null:f.cloneElement(e.element,{onClick:t=>{e.onPress&&e.onPress(t)},key:s,disabled:e.disabled,className:P()(e.className,n)})}}))),[k,mt]);return f.createElement("div",{className:P()(j.docEditor,"PSPDFKit-DocumentEditor"),onClick:Ee,onKeyDown:ot,tabIndex:"-1",ref:Ge},f.createElement("div",{className:P()(j.toolbar.root,j.toolbarRoot,"PSPDFKit-DocumentEditor-Toolbar"),style:{flex:0}},f.createElement("div",{ref:st,className:j.toolbarContainer},f.createElement(S,{items:Ze,builtInItems:qe,moveDialog:lt,CSS_HACK:e.CSS_HACK})),f.createElement(M,{builtInItems:qe,items:et,CSS_HACK:e.CSS_HACK,frameWindow:b})),f.createElement("div",{className:j.pagesView},f.createElement(O.a,{onResize:nt}),!rt&&lt,f.createElement("div",{className:P()(j.pagesGrid,{[j.pagesGridLargeThumbnails]:Z})},f.createElement(v.a,{canInsert:(e,t)=>he(t,Object(u.g)(e)),totalItems:U.size,width:tt.width,height:tt.height,itemScale:e.scale,renderItemCallback:Be,renderDragPreviewCallback:(e,t,a,n)=>{const s=Object(u.a)(e).filter((e=>e!==t)).sort().push(t).slice(-5).map((e=>Be(e,a,n,!0).item)).toArray();return f.createElement(H,{pages:s,style:"straight",styles:j,previewCount:e.length})},onItemPress:Me,selectedItemIndexes:Y,cssPrefix:"PSPDFKit-DocumentEditor",moveCursor:null!=ct?ct:void 0,onItemsMove:ne?void 0:it}))),f.createElement("div",{className:P()(j.bottomBar,"PSPDFKit-DocumentEditor-Footer")},ut))}));const _=Object(d.c)({newPage:{id:"newPage",defaultMessage:"New Page",description:"Add new page"},removePage:{id:"removePage",defaultMessage:"Remove Page",description:"Remove page"},duplicatePage:{id:"duplicatePage",defaultMessage:"Duplicate Page",description:"Duplicate page"},rotatePageLeft:{id:"rotatePageLeft",defaultMessage:"Rotate Page Left",description:"Rotate Page Left"},rotatePageRight:{id:"rotatePageRight",defaultMessage:"Rotate Page Right",description:"Rotate Page Right"},mergeDocument:{id:"mergeDocument",defaultMessage:"Merge Document",description:"Merge Document"},selectAll:{id:"selectAll",defaultMessage:"Select All",description:"Select All Pages"},selectNone:{id:"selectNone",defaultMessage:"Select None",description:"Deselect All Pages"},openMoveDialog:{id:"openMoveDialog",defaultMessage:"Move…",description:"Open dialog for moving pages to specific location in the document"},move:{id:"move",defaultMessage:"Move",description:"Move pages to specific location in the document"},moveBefore:{id:"moveBefore",defaultMessage:"Move Before",description:"Move page before previous one"},moveAfter:{id:"moveAfter",defaultMessage:"Move After",description:"Move page after next one"},documentMergedHere:{id:"documentMergedHere",defaultMessage:"Document will be merged here",description:"Placeholder for the imported document"},pagesSelected:{id:"pagesSelected",defaultMessage:"{arg0, plural,\n      =0 {{arg0} Pages}\n      one {{arg0} Page}\n      two {{arg0} Pages}\n      other {{arg0} Pages}\n    }",description:"Number of pages selected."},insertAfterPage:{id:"insertAfterPage",defaultMessage:"Insert after page",description:"Move selected pages after designated page index."},moveBeginningHint:{id:"docEditorMoveBeginningHint",defaultMessage:"Type “0” to move selected pages to the beginning of the document.",description:"Instructions for how to move pages to the beginning of the document when using the Move button in the Document Editor."}})}}]);