(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[779],{9558:function(e,t,n){"use strict";var s=n(5893),a=n(7294),r=n(2810),c=n.n(r),i=n(6843),l=n(1983),o=n(7941),d=n(1860),g=n(1657),p=n(4575),u=n(7875);const h=a.memo((function(e){let{page:t,index:n,onSelectionChange:a,handleRotatePageLeft:r,handleRotatePageRight:h,handleDeletePage:m,zoomOnPage:f}=e;const{t:x}=(0,u.$G)(),E=t.width>t.height?c().landscape:c().portrait;return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"preview ".concat(c().preview," ").concat(t.selected?c().selected:""),onClick:e=>{a(n,e.ctrlKey)},id:t.id,"data-id":t.id,"data-index":n,"data-page-rotation":t.degree,"data-page-number":"1",children:(0,s.jsx)("div",{className:"d-flex",children:(0,s.jsxs)("div",{className:"file ".concat(c().file),children:[(0,s.jsxs)("div",{className:"".concat(c().file_actions),children:[f&&(0,s.jsx)(p.Z,{title:x("common:zoom"),onClick:f,children:(0,s.jsx)(l.Z,{})}),r&&(0,s.jsx)(p.Z,{title:x("common:rotate_left"),onClick:r,hideOnMobile:!0,children:(0,s.jsx)(o.Z,{})}),h&&(0,s.jsx)(p.Z,{title:x("common:rotate_right"),onClick:h,children:(0,s.jsx)(d.Z,{})}),m&&(0,s.jsx)(p.Z,{title:x("common:delete"),onClick:m,children:(0,s.jsx)(g.Z,{})})]}),(0,s.jsx)("div",{className:"".concat(c().file_canvas," ").concat(E),style:{transform:"rotate(".concat(t.degree,"deg)")},children:(0,s.jsx)(i.Z,{blob:t.outputBlob,width:149,scale:1})}),(0,s.jsx)("div",{className:"".concat(c().file_info),children:(0,s.jsx)("span",{className:"".concat(c().file_info_name),children:t.order})})]})})})})}));t.Z=h},5570:function(e,t,n){"use strict";var s=n(5893),a=n(7294),r=n(386),c=n(3260),i=n.n(c),l=n(5697),o=n.n(l);const d=a.memo((function(e){let{children:t,onChange:n,isChecked:a,value:c,icon:l}=e;return(0,s.jsx)("div",{className:"".concat(i().box),children:(0,s.jsxs)("label",{className:"form-control ".concat(a&&"border-[#EE1B22]/50"),children:[(0,s.jsx)("input",{type:"radio",name:"radioLevel",value:c,onChange:e=>{n(),(0,r.Qp)(e)},checked:a}),(0,s.jsxs)("div",{className:"d-flex flex-row w-100",children:[(0,s.jsx)("div",{className:"".concat(i().option_icon),children:l}),(0,s.jsx)("div",{className:"".concat(i().pdf_to_image_option_desc_wrapper),children:t})]})]})})}));t.Z=d,d.propTypes={onChange:o().func.isRequired,isChecked:o().bool.isRequired,value:o().string.isRequired}},6843:function(e,t,n){"use strict";var s=n(5893),a=n(7294),r=(n(7405),n(2191)),c=n(6117),i=n(9037),l=n(386),o=n(7875),d=n(5697),g=n.n(d),p=n(9755),u=n.n(p),h=n(2810),m=n.n(h);r.default.GlobalWorkerOptions.workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(r.default.version,"/pdf.worker.min.js");const f=a.memo((function(e){let{blob:t,width:n,scale:r}=e;const{t:d}=(0,o.$G)(),g=(0,a.useRef)(!1);return(0,a.useEffect)((()=>(g.current=!0,()=>{g.current=!1})),[]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(c.Z,{file:t,loading:"",onLoadError:e=>{g.current&&(0,l.h4)("error",d("common:file_load_error"))},error:(0,s.jsx)("div",{className:"".concat(m().awa_a4," ").concat(m().awa_portrait," "),children:(0,s.jsx)(u(),{src:"/img/corrupted-file.png",layout:"fill",objectFit:"contain",alt:"corrupted-file"})}),renderMode:"canvas",children:(0,s.jsx)(i.Z,{width:n,pageNumber:1,rotate:0,onRenderSuccess:e=>{e.cleanupAfterRender=!0,e._ownerDocument=null,e._transport.commonObjs.clear(),e._transport.fontLoader.clear(),e._transport.loadingTask.destroy(),e._transport.pageCache=[],e._transport._params=[],e._transport.pagePromises=[]},loading:"",renderAnnotationLayer:!1,renderInteractiveForms:!1,renderTextLayer:!1,renderMode:"canvas",scale:r})})})}));t.Z=f,f.propTypes={blob:g().object.isRequired}},8495:function(e,t,n){"use strict";var s=n(5893),a=n(7294),r=n(2007),c=n(3260),i=n.n(c),l=n(5697),o=n.n(l),d=n(1646);n(7288);const g=a.memo((function(e){let{children:t,title:n,action:c,actionTitle:l}=e;const o=(0,a.useRef)();return(0,a.useEffect)((()=>{const e=o.current;return()=>{null===e||void 0===e||e.removeEventListener("click",c,!1)}}),[]),(0,s.jsx)("section",{className:"".concat(i().toolbox," py-0 mt-0"),children:(0,s.jsx)("div",{className:"d-flex",children:(0,s.jsxs)("div",{className:"w-100 pt-3 pb-3 d-flex flex-column align-items-center",children:[(0,s.jsx)("div",{className:"row w-100 d-flex justify-content-center text-center mt-2",children:(0,s.jsx)("h2",{className:"".concat(i().container_title),children:n})}),(0,s.jsx)("div",{className:"row w-100 d-flex justify-content-center mt-3",children:t}),(0,s.jsx)("div",{className:"row w-100 gap-10 d-flex justify-content-center items-center",children:(0,s.jsxs)(d.Z,{title:l,onClick:c,isActive:!0,buttonStyle:"".concat(i().action_btn),children:[l,(0,s.jsx)(r.Z,{className:"ml-2 w-5 h-5"})]})})]})})})}));t.Z=g,g.propTypes={title:o().string.isRequired,actionTitle:o().string.isRequired,action:o().func.isRequired}},5593:function(e,t,n){"use strict";var s=n(7294),a=n(5518),r=n(386);const c={pages:[],hoverIndex:-1,insertIndex:-1},i=(e,t)=>{switch(t.type){case"ADD_PAGES":let n=e.pages.concat([t.newPage]);return n=(0,r.sO)(n),{...e,pages:n};case"UPDATE_PAGES":return{...e,pages:t.newPages};case"CLEAR_SELECTION":const s=e.pages.map((e=>({...e,selected:!1})));return{...e,pages:s};case"SELECT_PAGE":const a=t.newSelectedPage,i=e.pages.map((e=>a.id===e.id?{...e,selected:!0}:e));return{...e,pages:i};case"REMOVE_SELECT_PAGE":const l=t.newUnselectedPage,o=e.pages.map((e=>l.id===e.id?{...e,selected:!1}:e));return{...e,pages:o};case"SET_INSERTINDEX":return{...e,hoverIndex:t.hoverIndex,insertIndex:t.insertIndex};case"RESET_INITIAL_STATE":return c;default:return e}};t.Z=()=>{const[e,t]=(0,s.useReducer)(i,c),n=n=>{const s=e.pages,a=n<0?"":s[n];t({type:"REMOVE_SELECT_PAGE",newUnselectedPage:a})},l=()=>{t({type:"CLEAR_SELECTION"})},o=n=>{const s=e.pages,a=n<0?"":s[n];t({type:"SELECT_PAGE",newSelectedPage:a})};return{pages:e.pages,hoverIndex:e.hoverIndex,insertIndex:e.insertIndex,handleAddPage:e=>{t({type:"ADD_PAGES",newPage:e})},handleRotatePageRight:n=>{let s=e.pages.map((e=>{if(e.id===n){const t=(0,r.px)(e.degree);return{...e,degree:t,selected:!0}}return{...e,selected:!1}}));t({type:"UPDATE_PAGES",newPages:s})},handleRotatePageLeft:n=>{let s=e.pages.map((e=>{if(e.id===n){const t=(0,r.lH)(e.degree);return{...e,degree:t,selected:!0}}return{...e,selected:!1}}));t({type:"UPDATE_PAGES",newPages:s})},handleRotateSelectedPagesToRight:()=>{const n=e.pages;let s;s=n.filter((e=>!0===e.selected)).length>0?n.map((e=>{if(!0===e.selected){const t=(0,r.px)(e.degree);return{...e,degree:t}}return e})):n.map((e=>{const t=(0,r.px)(e.degree);return{...e,degree:t}})),t({type:"UPDATE_PAGES",newPages:s})},rotateSelectedPagesToLeft:()=>{const n=e.pages;let s;s=n.filter((e=>!0===e.selected)).length>0?n.map((e=>{if(!0===e.selected){const t=(0,r.lH)(e.degree);return{...e,degree:t}}return e})):n.map((e=>{const t=(0,r.lH)(e.degree);return{...e,degree:t}})),t({type:"UPDATE_PAGES",newPages:s})},handleDeleteSelectedPages:()=>{let n=e.pages.filter((e=>!1===e.selected));n=(0,r.sO)(n),t({type:"UPDATE_PAGES",newPages:n})},handleSetInsertIndex:(n,s)=>{e.hoverIndex===n&&e.insertIndex===s||t({type:"SET_INSERTINDEX",hoverIndex:n,insertIndex:s})},handleRemovePageSelection:n,handleClearPageSelection:l,handlePageSelection:o,handlePagesSelection:(t,s)=>{const r=e.pages,c=t<0?"":r[t];a.tq||s?!0===c.selected?n(t):o(t):(l(),o(t))},handleRearrangePages:n=>{let s=e.pages.slice();const a=n.pages;let c;c=e.insertIndex>=0&e.insertIndex!a.find((t=>t.id===e.id)))),l=s.slice(c).filter((e=>!a.find((t=>t.id===e.id))));let o=[...i,...a,...l];o=(0,r.sO)(o),t({type:"UPDATE_PAGES",newPages:o,newSelectedPages:a})},handleDeletePage:n=>{let s=e.pages.filter((e=>!(n===e.id)));s=(0,r.sO)(s),t({type:"UPDATE_PAGES",newPages:s})},handleResetInitialPagesstate:()=>{t({type:"RESET_INITIAL_STATE"})}}}},3414:function(){},172:function(){},2001:function(){},3779:function(){},2258:function(){}}]);