legalesign-document-viewer 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,7 +54,7 @@ PERFORMANCE OF THIS SOFTWARE.
54
54
  *
55
55
  * @licend The above is the entire license notice for the
56
56
  * Javascript code in this page
57
- */var pdf_viewer=pdf_viewer$1.exports;var hasRequiredPdf_viewer;function requirePdf_viewer(){if(hasRequiredPdf_viewer)return pdf_viewer$1.exports;hasRequiredPdf_viewer=1;(function(t,e){(function e(r,i){t.exports=i()})(pdf_viewer,(function(){return function(t){var e={};function r(i){if(e[i]){return e[i].exports}var n=e[i]={i,l:false,exports:{}};t[i].call(n.exports,n,n.exports,r);n.l=true;return n.exports}r.m=t;r.c=e;r.d=function(t,e,i){if(!r.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:i})}};r.r=function(t){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})};r.t=function(t,e){if(e&1)t=r(t);if(e&8)return t;if(e&4&&typeof t==="object"&&t&&t.__esModule)return t;var i=Object.create(null);r.r(i);Object.defineProperty(i,"default",{enumerable:true,value:t});if(e&2&&typeof t!="string")for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i};r.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};r.d(e,"a",e);return e};r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};r.p="";return r(r.s=0)}([function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});Object.defineProperty(e,"AnnotationLayerBuilder",{enumerable:true,get:function(){return i.AnnotationLayerBuilder}});Object.defineProperty(e,"DefaultAnnotationLayerFactory",{enumerable:true,get:function(){return i.DefaultAnnotationLayerFactory}});Object.defineProperty(e,"DefaultTextLayerFactory",{enumerable:true,get:function(){return n.DefaultTextLayerFactory}});Object.defineProperty(e,"TextLayerBuilder",{enumerable:true,get:function(){return n.TextLayerBuilder}});Object.defineProperty(e,"EventBus",{enumerable:true,get:function(){return o.EventBus}});Object.defineProperty(e,"NullL10n",{enumerable:true,get:function(){return o.NullL10n}});Object.defineProperty(e,"ProgressBar",{enumerable:true,get:function(){return o.ProgressBar}});Object.defineProperty(e,"PDFLinkService",{enumerable:true,get:function(){return s.PDFLinkService}});Object.defineProperty(e,"SimpleLinkService",{enumerable:true,get:function(){return s.SimpleLinkService}});Object.defineProperty(e,"DownloadManager",{enumerable:true,get:function(){return a.DownloadManager}});Object.defineProperty(e,"GenericL10n",{enumerable:true,get:function(){return l.GenericL10n}});Object.defineProperty(e,"PDFFindController",{enumerable:true,get:function(){return h.PDFFindController}});Object.defineProperty(e,"PDFHistory",{enumerable:true,get:function(){return u.PDFHistory}});Object.defineProperty(e,"PDFPageView",{enumerable:true,get:function(){return d.PDFPageView}});Object.defineProperty(e,"PDFSinglePageViewer",{enumerable:true,get:function(){return c.PDFSinglePageViewer}});Object.defineProperty(e,"PDFViewer",{enumerable:true,get:function(){return f.PDFViewer}});var i=r(1);var n=r(5);var o=r(3);var s=r(4);var a=r(6);var l=r(8);var h=r(10);var u=r(12);var d=r(13);var c=r(15);var f=r(17)},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.DefaultAnnotationLayerFactory=e.AnnotationLayerBuilder=void 0;var i=r(2);var n=r(3);var o=r(4);class s{constructor({pageDiv:t,pdfPage:e,linkService:r,downloadManager:i,imageResourcesPath:o="",renderInteractiveForms:s=false,l10n:a=n.NullL10n}){this.pageDiv=t;this.pdfPage=e;this.linkService=r;this.downloadManager=i;this.imageResourcesPath=o;this.renderInteractiveForms=s;this.l10n=a;this.div=null;this._cancelled=false}render(t,e="display"){this.pdfPage.getAnnotations({intent:e}).then((e=>{if(this._cancelled){return}const r={viewport:t.clone({dontFlip:true}),div:this.div,annotations:e,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,linkService:this.linkService,downloadManager:this.downloadManager};if(this.div){i.AnnotationLayer.update(r)}else{if(e.length===0){return}this.div=document.createElement("div");this.div.className="annotationLayer";this.pageDiv.appendChild(this.div);r.div=this.div;i.AnnotationLayer.render(r);this.l10n.translate(this.div)}}))}cancel(){this._cancelled=true}hide(){if(!this.div){return}this.div.setAttribute("hidden","true")}}e.AnnotationLayerBuilder=s;class a{createAnnotationLayerBuilder(t,e,r="",i=false,a=n.NullL10n){return new s({pageDiv:t,pdfPage:e,imageResourcesPath:r,renderInteractiveForms:i,linkService:new o.SimpleLinkService,l10n:a})}}e.DefaultAnnotationLayerFactory=a},function(t,e,r){let i;if(typeof window!=="undefined"&&window["pdfjs-dist/build/pdf"]){i=window["pdfjs-dist/build/pdf"]}else{i=requirePdf()}t.exports=i},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.isValidRotation=O;e.isValidScrollMode=N;e.isValidSpreadMode=T;e.isPortraitOrientation=I;e.clamp=U;e.getPDFFileNameFromURL=S;e.noContextMenuHandler=D;e.parseQueryString=k;e.backtrackBeforeAllVisibleElements=V;e.getVisibleElements=P;e.roundToDivide=H;e.getPageSizeInches=F;e.approximateFraction=L;e.getOutputScale=b;e.scrollIntoView=M;e.watchScroll=x;e.binarySearchFirstItem=y;e.normalizeWheelEventDelta=Z;e.waitOnEventOrTimeout=R;e.moveToEndOfArray=G;e.WaitOnType=e.animationStarted=e.ProgressBar=e.EventBus=e.NullL10n=e.SpreadMode=e.ScrollMode=e.TextLayerMode=e.RendererType=e.PresentationModeState=e.VERTICAL_PADDING=e.SCROLLBAR_PADDING=e.MAX_AUTO_SCALE=e.UNKNOWN_SCALE=e.MAX_SCALE=e.MIN_SCALE=e.DEFAULT_SCALE=e.DEFAULT_SCALE_VALUE=e.CSS_UNITS=e.AutoPrintRegExp=void 0;const i=96/72;e.CSS_UNITS=i;const n="auto";e.DEFAULT_SCALE_VALUE=n;const o=1;e.DEFAULT_SCALE=o;const s=.1;e.MIN_SCALE=s;const a=10;e.MAX_SCALE=a;const l=0;e.UNKNOWN_SCALE=l;const h=1.25;e.MAX_AUTO_SCALE=h;const u=40;e.SCROLLBAR_PADDING=u;const d=5;e.VERTICAL_PADDING=d;const c={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};e.PresentationModeState=c;const f={CANVAS:"canvas",SVG:"svg"};e.RendererType=f;const v={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};e.TextLayerMode=v;const C={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};e.ScrollMode=C;const g={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};e.SpreadMode=g;const p=/\bprint\s*\(/;e.AutoPrintRegExp=p;function w(t,e){if(!e){return t}return t.replace(/\{\{\s*(\w+)\s*\}\}/g,((t,r)=>r in e?e[r]:"{{"+r+"}}"))}const m={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(t,e,r){return w(r,e)},async translate(t){}};e.NullL10n=m;function b(t){const e=window.devicePixelRatio||1;const r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;const i=e/r;return{sx:i,sy:i,scaled:i!==1}}function M(t,e,r=false){let i=t.offsetParent;if(!i){console.error("offsetParent is not set -- cannot scroll");return}let n=t.offsetTop+t.clientTop;let o=t.offsetLeft+t.clientLeft;while(i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||r&&getComputedStyle(i).overflow==="hidden"){if(i.dataset._scaleY){n/=i.dataset._scaleY;o/=i.dataset._scaleX}n+=i.offsetTop;o+=i.offsetLeft;i=i.offsetParent;if(!i){return}}if(e){if(e.top!==undefined){n+=e.top}if(e.left!==undefined){o+=e.left;i.scrollLeft=o}}i.scrollTop=n}function x(t,e){const r=function(r){if(n){return}n=window.requestAnimationFrame((function r(){n=null;const o=t.scrollLeft;const s=i.lastX;if(o!==s){i.right=o>s}i.lastX=o;const a=t.scrollTop;const l=i.lastY;if(a!==l){i.down=a>l}i.lastY=a;e(i)}))};const i={right:true,down:true,lastX:t.scrollLeft,lastY:t.scrollTop,_eventHandler:r};let n=null;t.addEventListener("scroll",r,true);return i}function k(t){const e=t.split("&");const r=Object.create(null);for(let t=0,i=e.length;t<i;++t){const i=e[t].split("=");const n=i[0].toLowerCase();const o=i.length>1?i[1]:null;r[decodeURIComponent(n)]=decodeURIComponent(o)}return r}function y(t,e){let r=0;let i=t.length-1;if(i<0||!e(t[i])){return t.length}if(e(t[r])){return r}while(r<i){const n=r+i>>1;const o=t[n];if(e(o)){i=n}else{r=n+1}}return r}function L(t){if(Math.floor(t)===t){return[t,1]}const e=1/t;const r=8;if(e>r){return[1,r]}else if(Math.floor(e)===e){return[1,e]}const i=t>1?e:t;let n=0,o=1,s=1,a=1;while(true){const t=n+s,e=o+a;if(e>r){break}if(i<=t/e){s=t;a=e}else{n=t;o=e}}let l;if(i-n/o<s/a-i){l=i===t?[n,o]:[o,n]}else{l=i===t?[s,a]:[a,s]}return l}function H(t,e){const r=t%e;return r===0?t:Math.round(t-r+e)}function F({view:t,userUnit:e,rotate:r}){const[i,n,o,s]=t;const a=r%180!==0;const l=(o-i)/72*e;const h=(s-n)/72*e;return{width:a?h:l,height:a?l:h}}function V(t,e,r){if(t<2){return t}let i=e[t].div;let n=i.offsetTop+i.clientTop;if(n>=r){i=e[t-1].div;n=i.offsetTop+i.clientTop}for(let r=t-2;r>=0;--r){i=e[r].div;if(i.offsetTop+i.clientTop+i.clientHeight<=n){break}t=r}return t}function P(t,e,r=false,i=false){const n=t.scrollTop,o=n+t.clientHeight;const s=t.scrollLeft,a=s+t.clientWidth;function l(t){const e=t.div;const r=e.offsetTop+e.clientTop+e.clientHeight;return r>n}function h(t){const e=t.div;const r=e.offsetLeft+e.clientLeft+e.clientWidth;return r>s}const u=[],d=e.length;let c=d===0?0:y(e,i?h:l);if(c>0&&c<d&&!i){c=V(c,e,n)}let f=i?a:-1;for(let t=c;t<d;t++){const r=e[t],l=r.div;const h=l.offsetLeft+l.clientLeft;const d=l.offsetTop+l.clientTop;const c=l.clientWidth,v=l.clientHeight;const C=h+c;const g=d+v;if(f===-1){if(g>=o){f=g}}else if((i?h:d)>f){break}if(g<=n||d>=o||C<=s||h>=a){continue}const p=Math.max(0,n-d)+Math.max(0,g-o);const w=Math.max(0,s-h)+Math.max(0,C-a);const m=(v-p)*(c-w)*100/v/c|0;u.push({id:r.id,x:h,y:d,view:r,percent:m})}const v=u[0],C=u[u.length-1];if(r){u.sort((function(t,e){const r=t.percent-e.percent;if(Math.abs(r)>.001){return-r}return t.id-e.id}))}return{first:v,last:C,views:u}}function D(t){t.preventDefault()}function A(t){let e=0;const r=t.length;while(e<r&&t[e].trim()===""){e++}return t.substring(e,e+5).toLowerCase()==="data:"}function S(t,e="document.pdf"){if(typeof t!=="string"){return e}if(A(t)){console.warn("getPDFFileNameFromURL: "+'ignoring "data:" URL for performance reasons.');return e}const r=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;const i=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i;const n=r.exec(t);let o=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(o){o=o[0];if(o.includes("%")){try{o=i.exec(decodeURIComponent(o))[0]}catch(t){}}}return o||e}function Z(t){let e=Math.sqrt(t.deltaX*t.deltaX+t.deltaY*t.deltaY);const r=Math.atan2(t.deltaY,t.deltaX);if(-.25*Math.PI<r&&r<.75*Math.PI){e=-e}const i=0;const n=1;const o=30;const s=30;if(t.deltaMode===i){e/=o*s}else if(t.deltaMode===n){e/=s}return e}function O(t){return Number.isInteger(t)&&t%90===0}function N(t){return Number.isInteger(t)&&Object.values(C).includes(t)&&t!==C.UNKNOWN}function T(t){return Number.isInteger(t)&&Object.values(g).includes(t)&&t!==g.UNKNOWN}function I(t){return t.width<=t.height}const E={EVENT:"event",TIMEOUT:"timeout"};e.WaitOnType=E;function R({target:t,name:e,delay:r=0}){return new Promise((function(i,n){if(typeof t!=="object"||!(e&&typeof e==="string")||!(Number.isInteger(r)&&r>=0)){throw new Error("waitOnEventOrTimeout - invalid parameters.")}function o(r){if(t instanceof j){t._off(e,s)}else{t.removeEventListener(e,s)}if(l){clearTimeout(l)}i(r)}const s=o.bind(null,E.EVENT);if(t instanceof j){t._on(e,s)}else{t.addEventListener(e,s)}const a=o.bind(null,E.TIMEOUT);const l=setTimeout(a,r)}))}const B=new Promise((function(t){window.requestAnimationFrame(t)}));e.animationStarted=B;class j{constructor(t){this._listeners=Object.create(null)}on(t,e){this._on(t,e,{external:true})}off(t,e){this._off(t,e,{external:true})}dispatch(t){const e=this._listeners[t];if(!e||e.length===0){return}const r=Array.prototype.slice.call(arguments,1);let i;e.slice(0).forEach((function({listener:t,external:e}){if(e){if(!i){i=[]}i.push(t);return}t.apply(null,r)}));if(i){i.forEach((function(t){t.apply(null,r)}));i=null}}_on(t,e,r=null){let i=this._listeners[t];if(!i){this._listeners[t]=i=[]}i.push({listener:e,external:(r&&r.external)===true})}_off(t,e,r=null){const i=this._listeners[t];if(!i){return}for(let t=0,r=i.length;t<r;t++){if(i[t].listener===e){i.splice(t,1);return}}}}e.EventBus=j;function U(t,e,r){return Math.min(Math.max(t,e),r)}class q{constructor(t,{height:e,width:r,units:i}={}){this.visible=true;this.div=document.querySelector(t+" .progress");this.bar=this.div.parentNode;this.height=e||100;this.width=r||100;this.units=i||"%";this.div.style.height=this.height+this.units;this.percent=0}_updateBar(){if(this._indeterminate){this.div.classList.add("indeterminate");this.div.style.width=this.width+this.units;return}this.div.classList.remove("indeterminate");const t=this.width*this._percent/100;this.div.style.width=t+this.units}get percent(){return this._percent}set percent(t){this._indeterminate=isNaN(t);this._percent=U(t,0,100);this._updateBar()}setWidth(t){if(!t){return}const e=t.parentNode;const r=e.offsetWidth-t.offsetWidth;if(r>0){this.bar.style.width=`calc(100% - ${r}px)`}}hide(){if(!this.visible){return}this.visible=false;this.bar.classList.add("hidden");document.body.classList.remove("loadingInProgress")}show(){if(this.visible){return}this.visible=true;document.body.classList.add("loadingInProgress");this.bar.classList.remove("hidden")}}e.ProgressBar=q;function G(t,e){const r=[],i=t.length;let n=0;for(let o=0;o<i;++o){if(e(t[o])){r.push(t[o])}else{t[n]=t[o];++n}}for(let e=0;n<i;++e,++n){t[n]=r[e]}}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.SimpleLinkService=e.PDFLinkService=void 0;var i=r(3);class n{constructor({eventBus:t,externalLinkTarget:e=null,externalLinkRel:r=null,externalLinkEnabled:i=true,ignoreDestinationZoom:n=false}={}){this.eventBus=t;this.externalLinkTarget=e;this.externalLinkRel=r;this.externalLinkEnabled=i;this._ignoreDestinationZoom=n;this.baseUrl=null;this.pdfDocument=null;this.pdfViewer=null;this.pdfHistory=null;this._pagesRefCache=null}setDocument(t,e=null){this.baseUrl=e;this.pdfDocument=t;this._pagesRefCache=Object.create(null)}setViewer(t){this.pdfViewer=t}setHistory(t){this.pdfHistory=t}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(t){this.pdfViewer.currentPageNumber=t}get rotation(){return this.pdfViewer.pagesRotation}set rotation(t){this.pdfViewer.pagesRotation=t}navigateTo(t){const e=({namedDest:r,explicitDest:i})=>{const n=i[0];let o;if(n instanceof Object){o=this._cachedPageNumber(n);if(o===null){this.pdfDocument.getPageIndex(n).then((t=>{this.cachePageRef(t+1,n);e({namedDest:r,explicitDest:i})})).catch((()=>{console.error(`PDFLinkService.navigateTo: "${n}" is not `+`a valid page reference, for dest="${t}".`)}));return}}else if(Number.isInteger(n)){o=n+1}else{console.error(`PDFLinkService.navigateTo: "${n}" is not `+`a valid destination reference, for dest="${t}".`);return}if(!o||o<1||o>this.pagesCount){console.error(`PDFLinkService.navigateTo: "${o}" is not `+`a valid page number, for dest="${t}".`);return}if(this.pdfHistory){this.pdfHistory.pushCurrentPosition();this.pdfHistory.push({namedDest:r,explicitDest:i,pageNumber:o})}this.pdfViewer.scrollPageIntoView({pageNumber:o,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom})};new Promise(((e,r)=>{if(typeof t==="string"){this.pdfDocument.getDestination(t).then((r=>{e({namedDest:t,explicitDest:r})}));return}e({namedDest:"",explicitDest:t})})).then((r=>{if(!Array.isArray(r.explicitDest)){console.error(`PDFLinkService.navigateTo: "${r.explicitDest}" is`+` not a valid destination array, for dest="${t}".`);return}e(r)}))}getDestinationHash(t){if(typeof t==="string"){return this.getAnchorUrl("#"+escape(t))}if(Array.isArray(t)){const e=JSON.stringify(t);return this.getAnchorUrl("#"+escape(e))}return this.getAnchorUrl("")}getAnchorUrl(t){return(this.baseUrl||"")+t}setHash(t){let e,r;if(t.includes("=")){const n=(0,i.parseQueryString)(t);if("search"in n){this.eventBus.dispatch("findfromurlhash",{source:this,query:n.search.replace(/"/g,""),phraseSearch:n.phrase==="true"})}if("page"in n){e=n.page|0||1}if("zoom"in n){const t=n.zoom.split(",");const e=t[0];const i=parseFloat(e);if(!e.includes("Fit")){r=[null,{name:"XYZ"},t.length>1?t[1]|0:null,t.length>2?t[2]|0:null,i?i/100:e]}else{if(e==="Fit"||e==="FitB"){r=[null,{name:e}]}else if(e==="FitH"||e==="FitBH"||e==="FitV"||e==="FitBV"){r=[null,{name:e},t.length>1?t[1]|0:null]}else if(e==="FitR"){if(t.length!==5){console.error('PDFLinkService.setHash: Not enough parameters for "FitR".')}else{r=[null,{name:e},t[1]|0,t[2]|0,t[3]|0,t[4]|0]}}else{console.error(`PDFLinkService.setHash: "${e}" is not `+"a valid zoom value.")}}}if(r){this.pdfViewer.scrollPageIntoView({pageNumber:e||this.page,destArray:r,allowNegativeOffset:true})}else if(e){this.page=e}if("pagemode"in n){this.eventBus.dispatch("pagemode",{source:this,mode:n.pagemode})}if("nameddest"in n){this.navigateTo(n.nameddest)}}else{r=unescape(t);try{r=JSON.parse(r);if(!Array.isArray(r)){r=r.toString()}}catch(t){}if(typeof r==="string"||o(r)){this.navigateTo(r);return}console.error(`PDFLinkService.setHash: "${unescape(t)}" is not `+"a valid destination.")}}executeNamedAction(t){switch(t){case"GoBack":if(this.pdfHistory){this.pdfHistory.back()}break;case"GoForward":if(this.pdfHistory){this.pdfHistory.forward()}break;case"NextPage":if(this.page<this.pagesCount){this.page++}break;case"PrevPage":if(this.page>1){this.page--}break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:t})}cachePageRef(t,e){if(!e){return}const r=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;this._pagesRefCache[r]=t}_cachedPageNumber(t){const e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this._pagesRefCache&&this._pagesRefCache[e]||null}isPageVisible(t){return this.pdfViewer.isPageVisible(t)}}e.PDFLinkService=n;function o(t){if(!Array.isArray(t)){return false}const e=t.length;if(e<2){return false}const r=t[0];if(!(typeof r==="object"&&Number.isInteger(r.num)&&Number.isInteger(r.gen))&&!(Number.isInteger(r)&&r>=0)){return false}const i=t[1];if(!(typeof i==="object"&&typeof i.name==="string")){return false}let n=true;switch(i.name){case"XYZ":if(e!==5){return false}break;case"Fit":case"FitB":return e===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(e!==3){return false}break;case"FitR":if(e!==6){return false}n=false;break;default:return false}for(let r=2;r<e;r++){const e=t[r];if(!(typeof e==="number"||n&&e===null)){return false}}return true}class s{constructor(){this.externalLinkTarget=null;this.externalLinkRel=null;this.externalLinkEnabled=true;this._ignoreDestinationZoom=false}get pagesCount(){return 0}get page(){return 0}set page(t){}get rotation(){return 0}set rotation(t){}navigateTo(t){}getDestinationHash(t){return"#"}getAnchorUrl(t){return"#"}setHash(t){}executeNamedAction(t){}cachePageRef(t,e){}isPageVisible(t){return true}}e.SimpleLinkService=s},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.DefaultTextLayerFactory=e.TextLayerBuilder=void 0;var i=r(2);const n=300;class o{constructor({textLayerDiv:t,eventBus:e,pageIndex:r,viewport:i,findController:n=null,enhanceTextSelection:o=false}){this.textLayerDiv=t;this.eventBus=e;this.textContent=null;this.textContentItemsStr=[];this.textContentStream=null;this.renderingDone=false;this.pageIdx=r;this.pageNumber=this.pageIdx+1;this.matches=[];this.viewport=i;this.textDivs=[];this.findController=n;this.textLayerRenderTask=null;this.enhanceTextSelection=o;this._onUpdateTextLayerMatches=null;this._bindMouse()}_finishRendering(){this.renderingDone=true;if(!this.enhanceTextSelection){const t=document.createElement("div");t.className="endOfContent";this.textLayerDiv.appendChild(t)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(t=0){if(!(this.textContent||this.textContentStream)||this.renderingDone){return}this.cancel();this.textDivs=[];const e=document.createDocumentFragment();this.textLayerRenderTask=(0,i.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:e,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:t,enhanceTextSelection:this.enhanceTextSelection});this.textLayerRenderTask.promise.then((()=>{this.textLayerDiv.appendChild(e);this._finishRendering();this._updateMatches()}),(function(t){}));if(!this._onUpdateTextLayerMatches){this._onUpdateTextLayerMatches=t=>{if(t.pageIndex===this.pageIdx||t.pageIndex===-1){this._updateMatches()}};this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)}}cancel(){if(this.textLayerRenderTask){this.textLayerRenderTask.cancel();this.textLayerRenderTask=null}if(this._onUpdateTextLayerMatches){this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches);this._onUpdateTextLayerMatches=null}}setTextContentStream(t){this.cancel();this.textContentStream=t}setTextContent(t){this.cancel();this.textContent=t}_convertMatches(t,e){if(!t){return[]}const{findController:r,textContentItemsStr:i}=this;let n=0,o=0;const s=i.length-1;const a=r.state.query.length;const l=[];for(let r=0,h=t.length;r<h;r++){let h=t[r];while(n!==s&&h>=o+i[n].length){o+=i[n].length;n++}if(n===i.length){console.error("Could not find a matching mapping")}const u={begin:{divIdx:n,offset:h-o}};if(e){h+=e[r]}else{h+=a}while(n!==s&&h>o+i[n].length){o+=i[n].length;n++}u.end={divIdx:n,offset:h-o};l.push(u)}return l}_renderMatches(t){if(t.length===0){return}const{findController:e,pageIdx:r,textContentItemsStr:i,textDivs:n}=this;const o=r===e.selected.pageIdx;const s=e.selected.matchIdx;const a=e.state.highlightAll;let l=null;const h={offset:undefined};function u(t,e){const r=t.divIdx;n[r].textContent="";d(r,0,t.offset,e)}function d(t,e,r,o){const s=n[t];const a=i[t].substring(e,r);const l=document.createTextNode(a);if(o){const t=document.createElement("span");t.className=o;t.appendChild(l);s.appendChild(t);return}s.appendChild(l)}let c=s,f=c+1;if(a){c=0;f=t.length}else if(!o){return}for(let i=c;i<f;i++){const a=t[i];const c=a.begin;const f=a.end;const v=o&&i===s;const C=v?" selected":"";if(v){e.scrollMatchIntoView({element:n[c.divIdx],pageIndex:r,matchIndex:s})}if(!l||c.divIdx!==l.divIdx){if(l!==null){d(l.divIdx,l.offset,h.offset)}u(c)}else{d(l.divIdx,l.offset,c.offset)}if(c.divIdx===f.divIdx){d(c.divIdx,c.offset,f.offset,"highlight"+C)}else{d(c.divIdx,c.offset,h.offset,"highlight begin"+C);for(let t=c.divIdx+1,e=f.divIdx;t<e;t++){n[t].className="highlight middle"+C}u(f,"highlight end"+C)}l=f}if(l){d(l.divIdx,l.offset,h.offset)}}_updateMatches(){if(!this.renderingDone){return}const{findController:t,matches:e,pageIdx:r,textContentItemsStr:i,textDivs:n}=this;let o=-1;for(let t=0,r=e.length;t<r;t++){const r=e[t];const s=Math.max(o,r.begin.divIdx);for(let t=s,e=r.end.divIdx;t<=e;t++){const e=n[t];e.textContent=i[t];e.className=""}o=r.end.divIdx+1}if(!t||!t.highlightMatches){return}const s=t.pageMatches[r]||null;const a=t.pageMatchesLength[r]||null;this.matches=this._convertMatches(s,a);this._renderMatches(this.matches)}_bindMouse(){const t=this.textLayerDiv;let e=null;t.addEventListener("mousedown",(r=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(true);if(e){clearTimeout(e);e=null}return}const i=t.querySelector(".endOfContent");if(!i){return}let n=r.target!==t;n=n&&window.getComputedStyle(i).getPropertyValue("-moz-user-select")!=="none";if(n){const e=t.getBoundingClientRect();const n=Math.max(0,(r.pageY-e.top)/e.height);i.style.top=(n*100).toFixed(2)+"%"}i.classList.add("active")}));t.addEventListener("mouseup",(()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){e=setTimeout((()=>{if(this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(false)}e=null}),n);return}const r=t.querySelector(".endOfContent");if(!r){return}r.style.top="";r.classList.remove("active")}))}}e.TextLayerBuilder=o;class s{createTextLayerBuilder(t,e,r,i=false,n){return new o({textLayerDiv:t,pageIndex:e,viewport:r,enhanceTextSelection:i,eventBus:n})}}e.DefaultTextLayerFactory=s},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.DownloadManager=void 0;var i=r(2);var n=r(7);const o=n.viewerCompatibilityParams.disableCreateObjectURL||false;function s(t,e){const r=document.createElement("a");if(!r.click){throw new Error('DownloadManager: "a.click()" is not supported.')}r.href=t;r.target="_parent";if("download"in r){r.download=e}(document.body||document.documentElement).appendChild(r);r.click();r.remove()}class a{constructor({disableCreateObjectURL:t=o}){this.disableCreateObjectURL=t}downloadUrl(t,e){if(!(0,i.createValidAbsoluteUrl)(t,"http://example.com")){return}s(t+"#pdfjs.action=download",e)}downloadData(t,e,r){if(navigator.msSaveBlob){navigator.msSaveBlob(new Blob([t],{type:r}),e);return}const n=(0,i.createObjectURL)(t,r,this.disableCreateObjectURL);s(n,e)}download(t,e,r){if(navigator.msSaveBlob){if(!navigator.msSaveBlob(t,r)){this.downloadUrl(e,r)}return}if(this.disableCreateObjectURL){this.downloadUrl(e,r);return}const i=URL.createObjectURL(t);s(i,r)}}e.DownloadManager=a},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.viewerCompatibilityParams=void 0;const i=Object.create(null);{const t=typeof navigator!=="undefined"&&navigator.userAgent||"";const e=typeof navigator!=="undefined"&&navigator.platform||"";const r=typeof navigator!=="undefined"&&navigator.maxTouchPoints||1;const n=/Android/.test(t);const o=/Trident/.test(t);const s=/\b(iPad|iPhone|iPod)(?=;)/.test(t)||e==="MacIntel"&&r>1;const a=/CriOS/.test(t);(function t(){if(o||a){i.disableCreateObjectURL=true}})();(function t(){if(s||n){i.maxCanvasPixels=5242880}})()}const n=Object.freeze(i);e.viewerCompatibilityParams=n},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.GenericL10n=void 0;r(9);const i=document.webL10n;class n{constructor(t){this._lang=t;this._ready=new Promise(((e,r)=>{i.setLanguage(t,(()=>{e(i)}))}))}async getLanguage(){const t=await this._ready;return t.getLanguage()}async getDirection(){const t=await this._ready;return t.getDirection()}async get(t,e,r){const i=await this._ready;return i.get(t,e,r)}async translate(t){const e=await this._ready;return e.translate(t)}}e.GenericL10n=n},function(t,e,r){document.webL10n=function(t,e,r){var i={};var n="";var o="textContent";var s="";var a={};var l="loading";var h=true;function u(){return e.querySelectorAll('link[type="application/l10n"]')}function d(){var t=e.querySelector('script[type="application/l10n"]');return t?JSON.parse(t.innerHTML):null}function c(t){return t?t.querySelectorAll("*[data-l10n-id]"):[]}function f(t){if(!t)return{};var e=t.getAttribute("data-l10n-id");var r=t.getAttribute("data-l10n-args");var i={};if(r){try{i=JSON.parse(r)}catch(t){console.warn("could not parse arguments for #"+e)}}return{id:e,args:i}}function v(t,e,r){e=e||function t(e){};r=r||function t(){};var i=new XMLHttpRequest;i.open("GET",t,h);if(i.overrideMimeType){i.overrideMimeType("text/plain; charset=utf-8")}i.onreadystatechange=function(){if(i.readyState==4){if(i.status==200||i.status===0){e(i.responseText)}else{r()}}};i.onerror=r;i.ontimeout=r;try{i.send(null)}catch(t){r()}}function C(t,e,r,s){var a=t.replace(/[^\/]*$/,"")||"./";function l(t){if(t.lastIndexOf("\\")<0)return t;return t.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function h(t,r){var i={};var n=/^\s*|\s*$/;var o=/^\s*#|^\s*$/;var s=/^\s*\[(.*)\]\s*$/;var h=/^\s*@import\s+url\((.*)\)\s*$/i;var u=/^([^=\s]*)\s*=\s*(.+)$/;function d(t,r,d){var f=t.replace(n,"").split(/[\r\n]+/);var v="*";var C=e.split("-",1)[0];var g=false;var p="";function w(){while(true){if(!f.length){d();return}var t=f.shift();if(o.test(t))continue;if(r){p=s.exec(t);if(p){v=p[1].toLowerCase();g=v!=="*"&&v!==e&&v!==C;continue}else if(g){continue}p=h.exec(t);if(p){c(a+p[1],w);return}}var n=t.match(u);if(n&&n.length==3){i[n[1]]=l(n[2])}}}w()}function c(t,e){v(t,(function(t){d(t,false,e)}),(function(){console.warn(t+" not found.");e()}))}d(t,true,(function(){r(i)}))}v(t,(function(t){n+=t;h(t,(function(t){for(var e in t){var n,s,a=e.lastIndexOf(".");if(a>0){n=e.substring(0,a);s=e.substring(a+1)}else{n=e;s=o}if(!i[n]){i[n]={}}i[n][s]=t[e]}if(r){r()}}))}),s)}function g(t,e){if(t){t=t.toLowerCase()}e=e||function t(){};p();s=t;var r=u();var n=r.length;if(n===0){var o=d();if(o&&o.locales&&o.default_locale){console.log("using the embedded JSON directory, early way out");i=o.locales[t];if(!i){var a=o.default_locale.toLowerCase();for(var h in o.locales){h=h.toLowerCase();if(h===t){i=o.locales[t];break}else if(h===a){i=o.locales[a]}}}e()}else{console.log("no resource to load, early way out")}l="complete";return}var c=null;var f=0;c=function(){f++;if(f>=n){e();l="complete"}};function v(t){var e=t.href;this.load=function(t,r){C(e,t,r,(function(){console.warn(e+" not found.");console.warn('"'+t+'" resource not found');s="";r()}))}}for(var g=0;g<n;g++){var w=new v(r[g]);w.load(t,c)}}function p(){i={};n="";s=""}function w(t){var e={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3};function r(t,e){return e.indexOf(t)!==-1}function i(t,e,r){return e<=t&&t<=r}var n={0:function(t){return"other"},1:function(t){if(i(t%100,3,10))return"few";if(t===0)return"zero";if(i(t%100,11,99))return"many";if(t==2)return"two";if(t==1)return"one";return"other"},2:function(t){if(t!==0&&t%10===0)return"many";if(t==2)return"two";if(t==1)return"one";return"other"},3:function(t){if(t==1)return"one";return"other"},4:function(t){if(i(t,0,1))return"one";return"other"},5:function(t){if(i(t,0,2)&&t!=2)return"one";return"other"},6:function(t){if(t===0)return"zero";if(t%10==1&&t%100!=11)return"one";return"other"},7:function(t){if(t==2)return"two";if(t==1)return"one";return"other"},8:function(t){if(i(t,3,6))return"few";if(i(t,7,10))return"many";if(t==2)return"two";if(t==1)return"one";return"other"},9:function(t){if(t===0||t!=1&&i(t%100,1,19))return"few";if(t==1)return"one";return"other"},10:function(t){if(i(t%10,2,9)&&!i(t%100,11,19))return"few";if(t%10==1&&!i(t%100,11,19))return"one";return"other"},11:function(t){if(i(t%10,2,4)&&!i(t%100,12,14))return"few";if(t%10===0||i(t%10,5,9)||i(t%100,11,14))return"many";if(t%10==1&&t%100!=11)return"one";return"other"},12:function(t){if(i(t,2,4))return"few";if(t==1)return"one";return"other"},13:function(t){if(i(t%10,2,4)&&!i(t%100,12,14))return"few";if(t!=1&&i(t%10,0,1)||i(t%10,5,9)||i(t%100,12,14))return"many";if(t==1)return"one";return"other"},14:function(t){if(i(t%100,3,4))return"few";if(t%100==2)return"two";if(t%100==1)return"one";return"other"},15:function(t){if(t===0||i(t%100,2,10))return"few";if(i(t%100,11,19))return"many";if(t==1)return"one";return"other"},16:function(t){if(t%10==1&&t!=11)return"one";return"other"},17:function(t){if(t==3)return"few";if(t===0)return"zero";if(t==6)return"many";if(t==2)return"two";if(t==1)return"one";return"other"},18:function(t){if(t===0)return"zero";if(i(t,0,2)&&t!==0&&t!=2)return"one";return"other"},19:function(t){if(i(t,2,10))return"few";if(i(t,0,1))return"one";return"other"},20:function(t){if((i(t%10,3,4)||t%10==9)&&!(i(t%100,10,19)||i(t%100,70,79)||i(t%100,90,99)))return"few";if(t%1e6===0&&t!==0)return"many";if(t%10==2&&!r(t%100,[12,72,92]))return"two";if(t%10==1&&!r(t%100,[11,71,91]))return"one";return"other"},21:function(t){if(t===0)return"zero";if(t==1)return"one";return"other"},22:function(t){if(i(t,0,1)||i(t,11,99))return"one";return"other"},23:function(t){if(i(t%10,1,2)||t%20===0)return"one";return"other"},24:function(t){if(i(t,3,10)||i(t,13,19))return"few";if(r(t,[2,12]))return"two";if(r(t,[1,11]))return"one";return"other"}};var o=e[t.replace(/-.*$/,"")];if(!(o in n)){console.warn("plural form unknown for ["+t+"]");return function(){return"other"}}return n[o]}a.plural=function(t,e,r,n){var l=parseFloat(e);if(isNaN(l))return t;if(n!=o)return t;if(!a._pluralRules){a._pluralRules=w(s)}var h="["+a._pluralRules(l)+"]";if(l===0&&r+"[zero]"in i){t=i[r+"[zero]"][n]}else if(l==1&&r+"[one]"in i){t=i[r+"[one]"][n]}else if(l==2&&r+"[two]"in i){t=i[r+"[two]"][n]}else if(r+h in i){t=i[r+h][n]}else if(r+"[other]"in i){t=i[r+"[other]"][n]}return t};function m(t,e,r){var n=i[t];if(!n){console.warn("#"+t+" is undefined.");if(!r){return null}n=r}var o={};for(var s in n){var a=n[s];a=b(a,e,t,s);a=M(a,e,t);o[s]=a}return o}function b(t,e,r,n){var o=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;var s=o.exec(t);if(!s||!s.length)return t;var l=s[1];var h=s[2];var u;if(e&&h in e){u=e[h]}else if(h in i){u=i[h]}if(l in a){var d=a[l];t=d(t,u,r,n)}return t}function M(t,e,r){var n=/\{\{\s*(.+?)\s*\}\}/g;return t.replace(n,(function(t,n){if(e&&n in e){return e[n]}if(n in i){return i[n]}console.log("argument {{"+n+"}} for #"+r+" is undefined.");return t}))}function x(t){var r=f(t);if(!r.id)return;var i=m(r.id,r.args);if(!i){console.warn("#"+r.id+" is undefined.");return}if(i[o]){if(k(t)===0){t[o]=i[o]}else{var n=t.childNodes;var s=false;for(var a=0,l=n.length;a<l;a++){if(n[a].nodeType===3&&/\S/.test(n[a].nodeValue)){if(s){n[a].nodeValue=""}else{n[a].nodeValue=i[o];s=true}}}if(!s){var h=e.createTextNode(i[o]);t.insertBefore(h,t.firstChild)}}delete i[o]}for(var u in i){t[u]=i[u]}}function k(t){if(t.children){return t.children.length}if(typeof t.childElementCount!=="undefined"){return t.childElementCount}var e=0;for(var r=0;r<t.childNodes.length;r++){e+=t.nodeType===1?1:0}return e}function y(t){t=t||e.documentElement;var r=c(t);var i=r.length;for(var n=0;n<i;n++){x(r[n])}x(t)}return{get:function(t,e,r){var i=t.lastIndexOf(".");var n=o;if(i>0){n=t.substring(i+1);t=t.substring(0,i)}var s;if(r){s={};s[n]=r}var a=m(t,e,s);if(a&&n in a){return a[n]}return"{{"+t+"}}"},getData:function(){return i},getText:function(){return n},getLanguage:function(){return s},setLanguage:function(t,e){g(t,(function(){if(e)e()}))},getDirection:function(){var t=["ar","he","fa","ps","ur"];var e=s.split("-",1)[0];return t.indexOf(e)>=0?"rtl":"ltr"},translate:y,getReadyState:function(){return l},ready:function(r){if(!r){return}else if(l=="complete"||l=="interactive"){t.setTimeout((function(){r()}))}else if(e.addEventListener){e.addEventListener("localized",(function t(){e.removeEventListener("localized",t);r()}))}}}}(window,document)},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFFindController=e.FindState=void 0;var i=r(2);var n=r(11);var o=r(3);const s={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};e.FindState=s;const a=250;const l=-50;const h=-400;const u={"‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"};let d=null;function c(t){if(!d){const t=Object.keys(u).join("");d=new RegExp(`[${t}]`,"g")}return t.replace(d,(function(t){return u[t]}))}class f{constructor({linkService:t,eventBus:e}){this._linkService=t;this._eventBus=e;this._reset();e._on("findbarclose",this._onFindBarClose.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this._state}setDocument(t){if(this._pdfDocument){this._reset()}if(!t){return}this._pdfDocument=t;this._firstPageCapability.resolve()}executeCommand(t,e){if(!e){return}const r=this._pdfDocument;if(this._state===null||this._shouldDirtyMatch(t,e)){this._dirtyMatch=true}this._state=e;if(t!=="findhighlightallchange"){this._updateUIState(s.PENDING)}this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||r&&this._pdfDocument!==r){return}this._extractText();const e=!this._highlightMatches;const i=!!this._findTimeout;if(this._findTimeout){clearTimeout(this._findTimeout);this._findTimeout=null}if(t==="find"){this._findTimeout=setTimeout((()=>{this._nextMatch();this._findTimeout=null}),a)}else if(this._dirtyMatch){this._nextMatch()}else if(t==="findagain"){this._nextMatch();if(e&&this._state.highlightAll){this._updateAllPages()}}else if(t==="findhighlightallchange"){if(i){this._nextMatch()}else{this._highlightMatches=true}this._updateAllPages()}else{this._nextMatch()}}))}scrollMatchIntoView({element:t=null,pageIndex:e=-1,matchIndex:r=-1}){if(!this._scrollMatches||!t){return}else if(r===-1||r!==this._selected.matchIdx){return}else if(e===-1||e!==this._selected.pageIdx){return}this._scrollMatches=false;const i={top:l,left:h};(0,o.scrollIntoView)(t,i,true)}_reset(){this._highlightMatches=false;this._scrollMatches=false;this._pdfDocument=null;this._pageMatches=[];this._pageMatchesLength=[];this._state=null;this._selected={pageIdx:-1,matchIdx:-1};this._offset={pageIdx:null,matchIdx:null,wrapped:false};this._extractTextPromises=[];this._pageContents=[];this._matchesCountTotal=0;this._pagesToSearch=null;this._pendingFindMatches=Object.create(null);this._resumePageIdx=null;this._dirtyMatch=false;clearTimeout(this._findTimeout);this._findTimeout=null;this._firstPageCapability=(0,i.createPromiseCapability)()}get _query(){if(this._state.query!==this._rawQuery){this._rawQuery=this._state.query;this._normalizedQuery=c(this._state.query)}return this._normalizedQuery}_shouldDirtyMatch(t,e){if(e.query!==this._state.query){return true}switch(t){case"findagain":const t=this._selected.pageIdx+1;const e=this._linkService;if(t>=1&&t<=e.pagesCount&&t!==e.page&&!e.isPageVisible(t)){return true}return false;case"findhighlightallchange":return false}return true}_prepareMatches(t,e,r){function i(e){const r=t[e];const i=t[e+1];if(e<t.length-1&&r.match===i.match){r.skipped=true;return true}for(let i=e-1;i>=0;i--){const e=t[i];if(e.skipped){continue}if(e.match+e.matchLength<r.match){break}if(e.match+e.matchLength>=r.match+r.matchLength){r.skipped=true;return true}}return false}t.sort((function(t,e){return t.match===e.match?t.matchLength-e.matchLength:t.match-e.match}));for(let n=0,o=t.length;n<o;n++){if(i(n)){continue}e.push(t[n].match);r.push(t[n].matchLength)}}_isEntireWord(t,e,r){if(e>0){const r=t.charCodeAt(e);const i=t.charCodeAt(e-1);if((0,n.getCharacterType)(r)===(0,n.getCharacterType)(i)){return false}}const i=e+r-1;if(i<t.length-1){const e=t.charCodeAt(i);const r=t.charCodeAt(i+1);if((0,n.getCharacterType)(e)===(0,n.getCharacterType)(r)){return false}}return true}_calculatePhraseMatch(t,e,r,i){const n=[];const o=t.length;let s=-o;while(true){s=r.indexOf(t,s+o);if(s===-1){break}if(i&&!this._isEntireWord(r,s,o)){continue}n.push(s)}this._pageMatches[e]=n}_calculateWordMatch(t,e,r,i){const n=[];const o=t.match(/\S+/g);for(let t=0,e=o.length;t<e;t++){const e=o[t];const s=e.length;let a=-s;while(true){a=r.indexOf(e,a+s);if(a===-1){break}if(i&&!this._isEntireWord(r,a,s)){continue}n.push({match:a,matchLength:s,skipped:false})}}this._pageMatchesLength[e]=[];this._pageMatches[e]=[];this._prepareMatches(n,this._pageMatches[e],this._pageMatchesLength[e])}_calculateMatch(t){let e=this._pageContents[t];let r=this._query;const{caseSensitive:i,entireWord:n,phraseSearch:o}=this._state;if(r.length===0){return}if(!i){e=e.toLowerCase();r=r.toLowerCase()}if(o){this._calculatePhraseMatch(r,t,e,n)}else{this._calculateWordMatch(r,t,e,n)}if(this._state.highlightAll){this._updatePage(t)}if(this._resumePageIdx===t){this._resumePageIdx=null;this._nextPageMatch()}const s=this._pageMatches[t].length;if(s>0){this._matchesCountTotal+=s;this._updateUIResultsCount()}}_extractText(){if(this._extractTextPromises.length>0){return}let t=Promise.resolve();for(let e=0,r=this._linkService.pagesCount;e<r;e++){const r=(0,i.createPromiseCapability)();this._extractTextPromises[e]=r.promise;t=t.then((()=>this._pdfDocument.getPage(e+1).then((t=>t.getTextContent({normalizeWhitespace:true}))).then((t=>{const i=t.items;const n=[];for(let t=0,e=i.length;t<e;t++){n.push(i[t].str)}this._pageContents[e]=c(n.join(""));r.resolve(e)}),(t=>{console.error(`Unable to get text content for page ${e+1}`,t);this._pageContents[e]="";r.resolve(e)}))))}}_updatePage(t){if(this._scrollMatches&&this._selected.pageIdx===t){this._linkService.page=t+1}this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})}_updateAllPages(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}_nextMatch(){const t=this._state.findPrevious;const e=this._linkService.page-1;const r=this._linkService.pagesCount;this._highlightMatches=true;if(this._dirtyMatch){this._dirtyMatch=false;this._selected.pageIdx=this._selected.matchIdx=-1;this._offset.pageIdx=e;this._offset.matchIdx=null;this._offset.wrapped=false;this._resumePageIdx=null;this._pageMatches.length=0;this._pageMatchesLength.length=0;this._matchesCountTotal=0;this._updateAllPages();for(let t=0;t<r;t++){if(this._pendingFindMatches[t]===true){continue}this._pendingFindMatches[t]=true;this._extractTextPromises[t].then((t=>{delete this._pendingFindMatches[t];this._calculateMatch(t)}))}}if(this._query===""){this._updateUIState(s.FOUND);return}if(this._resumePageIdx){return}const i=this._offset;this._pagesToSearch=r;if(i.matchIdx!==null){const e=this._pageMatches[i.pageIdx].length;if(!t&&i.matchIdx+1<e||t&&i.matchIdx>0){i.matchIdx=t?i.matchIdx-1:i.matchIdx+1;this._updateMatch(true);return}this._advanceOffsetPage(t)}this._nextPageMatch()}_matchesReady(t){const e=this._offset;const r=t.length;const i=this._state.findPrevious;if(r){e.matchIdx=i?r-1:0;this._updateMatch(true);return true}this._advanceOffsetPage(i);if(e.wrapped){e.matchIdx=null;if(this._pagesToSearch<0){this._updateMatch(false);return true}}return false}_nextPageMatch(){if(this._resumePageIdx!==null){console.error("There can only be one pending page.")}let t=null;do{const e=this._offset.pageIdx;t=this._pageMatches[e];if(!t){this._resumePageIdx=e;break}}while(!this._matchesReady(t))}_advanceOffsetPage(t){const e=this._offset;const r=this._linkService.pagesCount;e.pageIdx=t?e.pageIdx-1:e.pageIdx+1;e.matchIdx=null;this._pagesToSearch--;if(e.pageIdx>=r||e.pageIdx<0){e.pageIdx=t?r-1:0;e.wrapped=true}}_updateMatch(t=false){let e=s.NOT_FOUND;const r=this._offset.wrapped;this._offset.wrapped=false;if(t){const t=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx;this._selected.matchIdx=this._offset.matchIdx;e=r?s.WRAPPED:s.FOUND;if(t!==-1&&t!==this._selected.pageIdx){this._updatePage(t)}}this._updateUIState(e,this._state.findPrevious);if(this._selected.pageIdx!==-1){this._scrollMatches=true;this._updatePage(this._selected.pageIdx)}}_onFindBarClose(t){const e=this._pdfDocument;this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||e&&this._pdfDocument!==e){return}if(this._findTimeout){clearTimeout(this._findTimeout);this._findTimeout=null}if(this._resumePageIdx){this._resumePageIdx=null;this._dirtyMatch=true}this._updateUIState(s.FOUND);this._highlightMatches=false;this._updateAllPages()}))}_requestMatchesCount(){const{pageIdx:t,matchIdx:e}=this._selected;let r=0,i=this._matchesCountTotal;if(e!==-1){for(let e=0;e<t;e++){r+=this._pageMatches[e]&&this._pageMatches[e].length||0}r+=e+1}if(r<1||r>i){r=i=0}return{current:r,total:i}}_updateUIResultsCount(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}_updateUIState(t,e){this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,matchesCount:this._requestMatchesCount()})}}e.PDFFindController=f},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.getCharacterType=v;e.CharacterType=void 0;const i={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};e.CharacterType=i;function n(t){return t<11904}function o(t){return(t&65408)===0}function s(t){return t>=97&&t<=122||t>=65&&t<=90}function a(t){return t>=48&&t<=57}function l(t){return t===32||t===9||t===13||t===10}function h(t){return t>=13312&&t<=40959||t>=63744&&t<=64255}function u(t){return t>=12448&&t<=12543}function d(t){return t>=12352&&t<=12447}function c(t){return t>=65376&&t<=65439}function f(t){return(t&65408)===3584}function v(t){if(n(t)){if(o(t)){if(l(t)){return i.SPACE}else if(s(t)||a(t)||t===95){return i.ALPHA_LETTER}return i.PUNCT}else if(f(t)){return i.THAI_LETTER}else if(t===160){return i.SPACE}return i.ALPHA_LETTER}if(h(t)){return i.HAN_LETTER}else if(u(t)){return i.KATAKANA_LETTER}else if(d(t)){return i.HIRAGANA_LETTER}else if(c(t)){return i.HALFWIDTH_KATAKANA_LETTER}return i.ALPHA_LETTER}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.isDestHashesEqual=h;e.isDestArraysEqual=u;e.PDFHistory=void 0;var i=r(3);const n=1e3;const o=50;const s=1e3;function a(){return document.location.hash}class l{constructor({linkService:t,eventBus:e}){this.linkService=t;this.eventBus=e;this._initialized=false;this._fingerprint="";this.reset();this._boundEvents=null;this._isViewerInPresentationMode=false;this.eventBus._on("presentationmodechanged",(t=>{this._isViewerInPresentationMode=t.active||t.switchInProgress}));this.eventBus._on("pagesinit",(()=>{this._isPagesLoaded=false;const t=e=>{this.eventBus._off("pagesloaded",t);this._isPagesLoaded=!!e.pagesCount};this.eventBus._on("pagesloaded",t)}))}initialize({fingerprint:t,resetHistory:e=false,updateUrl:r=false}){if(!t||typeof t!=="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}if(this._initialized){this.reset()}const i=this._fingerprint!==""&&this._fingerprint!==t;this._fingerprint=t;this._updateUrl=r===true;this._initialized=true;this._bindEvents();const n=window.history.state;this._popStateInProgress=false;this._blockHashChange=0;this._currentHash=a();this._numPositionUpdates=0;this._uid=this._maxUid=0;this._destination=null;this._position=null;if(!this._isValidState(n,true)||e){const{hash:t,page:r,rotation:n}=this._parseCurrentHash(true);if(!t||i||e){this._pushOrReplaceState(null,true);return}this._pushOrReplaceState({hash:t,page:r,rotation:n},true);return}const o=n.destination;this._updateInternalState(o,n.uid,true);if(this._uid>this._maxUid){this._maxUid=this._uid}if(o.rotation!==undefined){this._initialRotation=o.rotation}if(o.dest){this._initialBookmark=JSON.stringify(o.dest);this._destination.page=null}else if(o.hash){this._initialBookmark=o.hash}else if(o.page){this._initialBookmark=`page=${o.page}`}}reset(){if(this._initialized){this._pageHide();this._initialized=false;this._unbindEvents()}if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}this._initialBookmark=null;this._initialRotation=null}push({namedDest:t=null,explicitDest:e,pageNumber:r}){if(!this._initialized){return}if(t&&typeof t!=="string"){console.error("PDFHistory.push: "+`"${t}" is not a valid namedDest parameter.`);return}else if(!Array.isArray(e)){console.error("PDFHistory.push: "+`"${e}" is not a valid explicitDest parameter.`);return}else if(!(Number.isInteger(r)&&r>0&&r<=this.linkService.pagesCount)){if(r!==null||this._destination){console.error("PDFHistory.push: "+`"${r}" is not a valid pageNumber parameter.`);return}}const i=t||JSON.stringify(e);if(!i){return}let n=false;if(this._destination&&(h(this._destination.hash,i)||u(this._destination.dest,e))){if(this._destination.page){return}n=true}if(this._popStateInProgress&&!n){return}this._pushOrReplaceState({dest:e,hash:i,page:r,rotation:this.linkService.rotation},n);if(!this._popStateInProgress){this._popStateInProgress=true;Promise.resolve().then((()=>{this._popStateInProgress=false}))}}pushCurrentPosition(){if(!this._initialized||this._popStateInProgress){return}this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress){return}const t=window.history.state;if(this._isValidState(t)&&t.uid>0){window.history.back()}}forward(){if(!this._initialized||this._popStateInProgress){return}const t=window.history.state;if(this._isValidState(t)&&t.uid<this._maxUid){window.history.forward()}}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(t,e=false){const r=e||!this._destination;const i={fingerprint:this._fingerprint,uid:r?this._uid:this._uid+1,destination:t};this._updateInternalState(t,i.uid);let n;if(this._updateUrl&&t&&t.hash){const e=document.location.href.split("#")[0];if(!e.startsWith("file://")){n=`${e}#${t.hash}`}}if(r){window.history.replaceState(i,"",n)}else{this._maxUid=this._uid;window.history.pushState(i,"",n)}}_tryPushCurrentPosition(t=false){if(!this._position){return}let e=this._position;if(t){e=Object.assign(Object.create(null),this._position);e.temporary=true}if(!this._destination){this._pushOrReplaceState(e);return}if(this._destination.temporary){this._pushOrReplaceState(e,true);return}if(this._destination.hash===e.hash){return}if(!this._destination.page&&this._numPositionUpdates<=o){return}let r=false;if(this._destination.page>=e.first&&this._destination.page<=e.page){if(this._destination.dest||!this._destination.first){return}r=true}this._pushOrReplaceState(e,r)}_isValidState(t,e=false){if(!t){return false}if(t.fingerprint!==this._fingerprint){if(e){if(typeof t.fingerprint!=="string"||t.fingerprint.length!==this._fingerprint.length){return false}const[e]=performance.getEntriesByType("navigation");if(!e||e.type!=="reload"){return false}}else{return false}}if(!Number.isInteger(t.uid)||t.uid<0){return false}if(t.destination===null||typeof t.destination!=="object"){return false}return true}_updateInternalState(t,e,r=false){if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}if(r&&t&&t.temporary){delete t.temporary}this._destination=t;this._uid=e;this._numPositionUpdates=0}_parseCurrentHash(t=false){const e=unescape(a()).substring(1);const r=(0,i.parseQueryString)(e);const n=r.nameddest||"";let o=r.page|0;if(!(Number.isInteger(o)&&o>0&&o<=this.linkService.pagesCount)||t&&n.length>0){o=null}return{hash:e,page:o,rotation:this.linkService.rotation}}_updateViewarea({location:t}){if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}this._position={hash:this._isViewerInPresentationMode?`page=${t.pageNumber}`:t.pdfOpenParams.substring(1),page:this.linkService.page,first:t.pageNumber,rotation:t.rotation};if(this._popStateInProgress){return}if(this._isPagesLoaded&&this._destination&&!this._destination.page){this._numPositionUpdates++}{this._updateViewareaTimeout=setTimeout((()=>{if(!this._popStateInProgress){this._tryPushCurrentPosition(true)}this._updateViewareaTimeout=null}),s)}}_popState({state:t}){const e=a(),r=this._currentHash!==e;this._currentHash=e;if(!t){this._uid++;const{hash:t,page:e,rotation:r}=this._parseCurrentHash();this._pushOrReplaceState({hash:t,page:e,rotation:r},true);return}if(!this._isValidState(t)){return}this._popStateInProgress=true;if(r){this._blockHashChange++;(0,i.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:n}).then((()=>{this._blockHashChange--}))}const o=t.destination;this._updateInternalState(o,t.uid,true);if(this._uid>this._maxUid){this._maxUid=this._uid}if((0,i.isValidRotation)(o.rotation)){this.linkService.rotation=o.rotation}if(o.dest){this.linkService.navigateTo(o.dest)}else if(o.hash){this.linkService.setHash(o.hash)}else if(o.page){this.linkService.page=o.page}Promise.resolve().then((()=>{this._popStateInProgress=false}))}_pageHide(){if(!this._destination||this._destination.temporary){this._tryPushCurrentPosition()}}_bindEvents(){if(this._boundEvents){return}this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)};this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea);window.addEventListener("popstate",this._boundEvents.popState);window.addEventListener("pagehide",this._boundEvents.pageHide)}_unbindEvents(){if(!this._boundEvents){return}this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea);window.removeEventListener("popstate",this._boundEvents.popState);window.removeEventListener("pagehide",this._boundEvents.pageHide);this._boundEvents=null}}e.PDFHistory=l;function h(t,e){if(typeof t!=="string"||typeof e!=="string"){return false}if(t===e){return true}const{nameddest:r}=(0,i.parseQueryString)(t);if(r===e){return true}return false}function u(t,e){function r(t,e){if(typeof t!==typeof e){return false}if(Array.isArray(t)||Array.isArray(e)){return false}if(t!==null&&typeof t==="object"&&e!==null){if(Object.keys(t).length!==Object.keys(e).length){return false}for(const i in t){if(!r(t[i],e[i])){return false}}return true}return t===e||Number.isNaN(t)&&Number.isNaN(e)}if(!(Array.isArray(t)&&Array.isArray(e))){return false}if(t.length!==e.length){return false}for(let i=0,n=t.length;i<n;i++){if(!r(t[i],e[i])){return false}}return true}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFPageView=void 0;var i=r(3);var n=r(2);var o=r(14);var s=r(7);const a=s.viewerCompatibilityParams.maxCanvasPixels||16777216;class l{constructor(t){const e=t.container;const r=t.defaultViewport;this.id=t.id;this.renderingId="page"+this.id;this.pdfPage=null;this.pageLabel=null;this.rotation=0;this.scale=t.scale||i.DEFAULT_SCALE;this.viewport=r;this.pdfPageRotate=r.rotation;this.hasRestrictedScaling=false;this.textLayerMode=Number.isInteger(t.textLayerMode)?t.textLayerMode:i.TextLayerMode.ENABLE;this.imageResourcesPath=t.imageResourcesPath||"";this.renderInteractiveForms=t.renderInteractiveForms||false;this.useOnlyCssZoom=t.useOnlyCssZoom||false;this.maxCanvasPixels=t.maxCanvasPixels||a;this.eventBus=t.eventBus;this.renderingQueue=t.renderingQueue;this.textLayerFactory=t.textLayerFactory;this.annotationLayerFactory=t.annotationLayerFactory;this.renderer=t.renderer||i.RendererType.CANVAS;this.enableWebGL=t.enableWebGL||false;this.l10n=t.l10n||i.NullL10n;this.paintTask=null;this.paintedViewportMap=new WeakMap;this.renderingState=o.RenderingStates.INITIAL;this.resume=null;this.error=null;this.annotationLayer=null;this.textLayer=null;this.zoomLayer=null;const n=document.createElement("div");n.className="page";n.style.width=Math.floor(this.viewport.width)+"px";n.style.height=Math.floor(this.viewport.height)+"px";n.setAttribute("data-page-number",this.id);this.div=n;e.appendChild(n)}setPdfPage(t){this.pdfPage=t;this.pdfPageRotate=t.rotate;const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:this.scale*i.CSS_UNITS,rotation:e});this.stats=t.stats;this.reset()}destroy(){this.reset();if(this.pdfPage){this.pdfPage.cleanup()}}_resetZoomLayer(t=false){if(!this.zoomLayer){return}const e=this.zoomLayer.firstChild;this.paintedViewportMap.delete(e);e.width=0;e.height=0;if(t){this.zoomLayer.remove()}this.zoomLayer=null}reset(t=false,e=false){this.cancelRendering(e);this.renderingState=o.RenderingStates.INITIAL;const r=this.div;r.style.width=Math.floor(this.viewport.width)+"px";r.style.height=Math.floor(this.viewport.height)+"px";const i=r.childNodes;const n=t&&this.zoomLayer||null;const s=e&&this.annotationLayer&&this.annotationLayer.div||null;for(let t=i.length-1;t>=0;t--){const e=i[t];if(n===e||s===e){continue}r.removeChild(e)}r.removeAttribute("data-loaded");if(s){this.annotationLayer.hide()}else if(this.annotationLayer){this.annotationLayer.cancel();this.annotationLayer=null}if(!n){if(this.canvas){this.paintedViewportMap.delete(this.canvas);this.canvas.width=0;this.canvas.height=0;delete this.canvas}this._resetZoomLayer()}if(this.svg){this.paintedViewportMap.delete(this.svg);delete this.svg}this.loadingIconDiv=document.createElement("div");this.loadingIconDiv.className="loadingIcon";r.appendChild(this.loadingIconDiv)}update(t,e){this.scale=t||this.scale;if(typeof e!=="undefined"){this.rotation=e}const r=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:this.scale*i.CSS_UNITS,rotation:r});if(this.svg){this.cssTransform(this.svg,true);this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:true,timestamp:performance.now()});return}let n=false;if(this.canvas&&this.maxCanvasPixels>0){const t=this.outputScale;if((Math.floor(this.viewport.width)*t.sx|0)*(Math.floor(this.viewport.height)*t.sy|0)>this.maxCanvasPixels){n=true}}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&n){this.cssTransform(this.canvas,true);this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:true,timestamp:performance.now()});return}if(!this.zoomLayer&&!this.canvas.hasAttribute("hidden")){this.zoomLayer=this.canvas.parentNode;this.zoomLayer.style.position="absolute"}}if(this.zoomLayer){this.cssTransform(this.zoomLayer.firstChild)}this.reset(true,true)}cancelRendering(t=false){if(this.paintTask){this.paintTask.cancel();this.paintTask=null}this.resume=null;if(this.textLayer){this.textLayer.cancel();this.textLayer=null}if(!t&&this.annotationLayer){this.annotationLayer.cancel();this.annotationLayer=null}}cssTransform(t,e=false){const r=this.viewport.width;const i=this.viewport.height;const n=this.div;t.style.width=t.parentNode.style.width=n.style.width=Math.floor(r)+"px";t.style.height=t.parentNode.style.height=n.style.height=Math.floor(i)+"px";const o=this.viewport.rotation-this.paintedViewportMap.get(t).rotation;const s=Math.abs(o);let a=1,l=1;if(s===90||s===270){a=i/r;l=r/i}const h="rotate("+o+"deg) "+"scale("+a+","+l+")";t.style.transform=h;if(this.textLayer){const t=this.textLayer.viewport;const e=this.viewport.rotation-t.rotation;const i=Math.abs(e);let n=r/t.width;if(i===90||i===270){n=r/t.height}const o=this.textLayer.textLayerDiv;let s,a;switch(i){case 0:s=a=0;break;case 90:s=0;a="-"+o.style.height;break;case 180:s="-"+o.style.width;a="-"+o.style.height;break;case 270:s="-"+o.style.width;a=0;break;default:console.error("Bad rotation value.");break}o.style.transform="rotate("+i+"deg) "+"scale("+n+", "+n+") "+"translate("+s+", "+a+")";o.style.transformOrigin="0% 0%"}if(e&&this.annotationLayer){this.annotationLayer.render(this.viewport,"display")}}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(t,e){return this.viewport.convertToPdfPoint(t,e)}draw(){if(this.renderingState!==o.RenderingStates.INITIAL){console.error("Must be in new state before drawing");this.reset()}const{div:t,pdfPage:e}=this;if(!e){this.renderingState=o.RenderingStates.FINISHED;if(this.loadingIconDiv){t.removeChild(this.loadingIconDiv);delete this.loadingIconDiv}return Promise.reject(new Error("pdfPage is not loaded"))}this.renderingState=o.RenderingStates.RUNNING;const r=document.createElement("div");r.style.width=t.style.width;r.style.height=t.style.height;r.classList.add("canvasWrapper");if(this.annotationLayer&&this.annotationLayer.div){t.insertBefore(r,this.annotationLayer.div)}else{t.appendChild(r)}let s=null;if(this.textLayerMode!==i.TextLayerMode.DISABLE&&this.textLayerFactory){const e=document.createElement("div");e.className="textLayer";e.style.width=r.style.width;e.style.height=r.style.height;if(this.annotationLayer&&this.annotationLayer.div){t.insertBefore(e,this.annotationLayer.div)}else{t.appendChild(e)}s=this.textLayerFactory.createTextLayerBuilder(e,this.id-1,this.viewport,this.textLayerMode===i.TextLayerMode.ENABLE_ENHANCE,this.eventBus)}this.textLayer=s;let a=null;if(this.renderingQueue){a=t=>{if(!this.renderingQueue.isHighestPriority(this)){this.renderingState=o.RenderingStates.PAUSED;this.resume=()=>{this.renderingState=o.RenderingStates.RUNNING;t()};return}t()}}const l=async r=>{if(h===this.paintTask){this.paintTask=null}if(r instanceof n.RenderingCancelledException){this.error=null;return}this.renderingState=o.RenderingStates.FINISHED;if(this.loadingIconDiv){t.removeChild(this.loadingIconDiv);delete this.loadingIconDiv}this._resetZoomLayer(true);this.error=r;this.stats=e.stats;this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:false,timestamp:performance.now()});if(r){throw r}};const h=this.renderer===i.RendererType.SVG?this.paintOnSvg(r):this.paintOnCanvas(r);h.onRenderContinue=a;this.paintTask=h;const u=h.promise.then((function(){return l(null).then((function(){if(s){const t=e.streamTextContent({normalizeWhitespace:true});s.setTextContentStream(t);s.render()}}))}),(function(t){return l(t)}));if(this.annotationLayerFactory){if(!this.annotationLayer){this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(t,e,this.imageResourcesPath,this.renderInteractiveForms,this.l10n)}this.annotationLayer.render(this.viewport,"display")}t.setAttribute("data-loaded",true);this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id});return u}paintOnCanvas(t){const e=(0,n.createPromiseCapability)();const r={promise:e.promise,onRenderContinue(t){t()},cancel(){C.cancel()}};const o=this.viewport;const s=document.createElement("canvas");this.l10n.get("page_canvas",{page:this.id},"Page {{page}}").then((t=>{s.setAttribute("aria-label",t)}));s.setAttribute("hidden","hidden");let a=true;const l=function(){if(a){s.removeAttribute("hidden");a=false}};t.appendChild(s);this.canvas=s;s.mozOpaque=true;const h=s.getContext("2d",{alpha:false});const u=(0,i.getOutputScale)(h);this.outputScale=u;if(this.useOnlyCssZoom){const t=o.clone({scale:i.CSS_UNITS});u.sx*=t.width/o.width;u.sy*=t.height/o.height;u.scaled=true}if(this.maxCanvasPixels>0){const t=o.width*o.height;const e=Math.sqrt(this.maxCanvasPixels/t);if(u.sx>e||u.sy>e){u.sx=e;u.sy=e;u.scaled=true;this.hasRestrictedScaling=true}else{this.hasRestrictedScaling=false}}const d=(0,i.approximateFraction)(u.sx);const c=(0,i.approximateFraction)(u.sy);s.width=(0,i.roundToDivide)(o.width*u.sx,d[0]);s.height=(0,i.roundToDivide)(o.height*u.sy,c[0]);s.style.width=(0,i.roundToDivide)(o.width,d[1])+"px";s.style.height=(0,i.roundToDivide)(o.height,c[1])+"px";this.paintedViewportMap.set(s,o);const f=!u.scaled?null:[u.sx,0,0,u.sy,0,0];const v={canvasContext:h,transform:f,viewport:this.viewport,enableWebGL:this.enableWebGL,renderInteractiveForms:this.renderInteractiveForms};const C=this.pdfPage.render(v);C.onContinue=function(t){l();if(r.onRenderContinue){r.onRenderContinue(t)}else{t()}};C.promise.then((function(){l();e.resolve(undefined)}),(function(t){l();e.reject(t)}));return r}paintOnSvg(t){let e=false;const r=()=>{if(e){throw new n.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")}};const s=this.pdfPage;const a=this.viewport.clone({scale:i.CSS_UNITS});const l=s.getOperatorList().then((e=>{r();const i=new n.SVGGraphics(s.commonObjs,s.objs);return i.getSVG(e,a).then((e=>{r();this.svg=e;this.paintedViewportMap.set(e,a);e.style.width=t.style.width;e.style.height=t.style.height;this.renderingState=o.RenderingStates.FINISHED;t.appendChild(e)}))}));return{promise:l,onRenderContinue(t){t()},cancel(){e=true}}}setPageLabel(t){this.pageLabel=typeof t==="string"?t:null;if(this.pageLabel!==null){this.div.setAttribute("data-page-label",this.pageLabel)}else{this.div.removeAttribute("data-page-label")}}}e.PDFPageView=l},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFRenderingQueue=e.RenderingStates=void 0;const i=3e4;const n={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};e.RenderingStates=n;class o{constructor(){this.pdfViewer=null;this.pdfThumbnailViewer=null;this.onIdle=null;this.highestPriorityPage=null;this.idleTimeout=null;this.printing=false;this.isThumbnailViewEnabled=false}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){if(this.idleTimeout){clearTimeout(this.idleTimeout);this.idleTimeout=null}if(this.pdfViewer.forceRendering(t)){return}if(this.pdfThumbnailViewer&&this.isThumbnailViewEnabled){if(this.pdfThumbnailViewer.forceRendering()){return}}if(this.printing){return}if(this.onIdle){this.idleTimeout=setTimeout(this.onIdle.bind(this),i)}}getHighestPriority(t,e,r){const i=t.views;const n=i.length;if(n===0){return null}for(let t=0;t<n;++t){const e=i[t].view;if(!this.isViewFinished(e)){return e}}if(r){const r=t.last.id;if(e[r]&&!this.isViewFinished(e[r])){return e[r]}}else{const r=t.first.id-2;if(e[r]&&!this.isViewFinished(e[r])){return e[r]}}return null}isViewFinished(t){return t.renderingState===n.FINISHED}renderView(t){switch(t.renderingState){case n.FINISHED:return false;case n.PAUSED:this.highestPriorityPage=t.renderingId;t.resume();break;case n.RUNNING:this.highestPriorityPage=t.renderingId;break;case n.INITIAL:this.highestPriorityPage=t.renderingId;t.draw().finally((()=>{this.renderHighestPriority()})).catch((t=>{console.error(`renderView: "${t}"`)}));break}return true}}e.PDFRenderingQueue=o},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFSinglePageViewer=void 0;var i=r(16);var n=r(2);class o extends i.BaseViewer{constructor(t){super(t);this.eventBus._on("pagesinit",(t=>{this._ensurePageViewVisible()}))}get _viewerElement(){return(0,n.shadow)(this,"_viewerElement",this._shadowViewer)}_resetView(){super._resetView();this._previousPageNumber=1;this._shadowViewer=document.createDocumentFragment();this._updateScrollDown=null}_ensurePageViewVisible(){const t=this._pages[this._currentPageNumber-1];const e=this._pages[this._previousPageNumber-1];const r=this.viewer.childNodes;switch(r.length){case 0:this.viewer.appendChild(t.div);break;case 1:if(r[0]!==e.div){throw new Error("_ensurePageViewVisible: Unexpected previously visible page.")}if(t===e){break}this._shadowViewer.appendChild(e.div);this.viewer.appendChild(t.div);this.container.scrollTop=0;break;default:throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.")}this._previousPageNumber=this._currentPageNumber}_scrollUpdate(){if(this._updateScrollDown){this._updateScrollDown()}super._scrollUpdate()}_scrollIntoView({pageDiv:t,pageSpot:e=null,pageNumber:r=null}){if(r){this._setCurrentPageNumber(r)}const i=this._currentPageNumber>=this._previousPageNumber;this._ensurePageViewVisible();this.update();super._scrollIntoView({pageDiv:t,pageSpot:e,pageNumber:r});this._updateScrollDown=()=>{this.scroll.down=i;this._updateScrollDown=null}}_getVisiblePages(){return this._getCurrentVisiblePage()}_updateHelper(t){}get _isScrollModeHorizontal(){return(0,n.shadow)(this,"_isScrollModeHorizontal",false)}_updateScrollMode(){}_updateSpreadMode(){}}e.PDFSinglePageViewer=o},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.BaseViewer=void 0;var i=r(3);var n=r(14);var o=r(1);var s=r(2);var a=r(13);var l=r(4);var h=r(5);const u=10;function d(t){const e=[];this.push=function(r){const i=e.indexOf(r);if(i>=0){e.splice(i,1)}e.push(r);if(e.length>t){e.shift().destroy()}};this.resize=function(r,n){t=r;if(n){const t=new Set;for(let e=0,r=n.length;e<r;++e){t.add(n[e].id)}(0,i.moveToEndOfArray)(e,(function(e){return t.has(e.id)}))}while(e.length>t){e.shift().destroy()}}}function c(t,e){if(e===t){return true}if(Math.abs(e-t)<1e-15){return true}return false}class f{constructor(t){if(this.constructor===f){throw new Error("Cannot initialize BaseViewer.")}this._name=this.constructor.name;this.container=t.container;this.viewer=t.viewer||t.container.firstElementChild;this.eventBus=t.eventBus;this.linkService=t.linkService||new l.SimpleLinkService;this.downloadManager=t.downloadManager||null;this.findController=t.findController||null;this.removePageBorders=t.removePageBorders||false;this.textLayerMode=Number.isInteger(t.textLayerMode)?t.textLayerMode:i.TextLayerMode.ENABLE;this.imageResourcesPath=t.imageResourcesPath||"";this.renderInteractiveForms=t.renderInteractiveForms||false;this.enablePrintAutoRotate=t.enablePrintAutoRotate||false;this.renderer=t.renderer||i.RendererType.CANVAS;this.enableWebGL=t.enableWebGL||false;this.useOnlyCssZoom=t.useOnlyCssZoom||false;this.maxCanvasPixels=t.maxCanvasPixels;this.l10n=t.l10n||i.NullL10n;this.defaultRenderingQueue=!t.renderingQueue;if(this.defaultRenderingQueue){this.renderingQueue=new n.PDFRenderingQueue;this.renderingQueue.setViewer(this)}else{this.renderingQueue=t.renderingQueue}this.scroll=(0,i.watchScroll)(this.container,this._scrollUpdate.bind(this));this.presentationModeState=i.PresentationModeState.UNKNOWN;this._onBeforeDraw=this._onAfterDraw=null;this._resetView();if(this.removePageBorders){this.viewer.classList.add("removePageBorders")}Promise.resolve().then((()=>{this.eventBus.dispatch("baseviewerinit",{source:this})}))}get pagesCount(){return this._pages.length}getPageView(t){return this._pages[t]}get pageViewsReady(){if(!this._pagesCapability.settled){return false}return this._pages.every((function(t){return t&&t.pdfPage}))}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(t){if(!Number.isInteger(t)){throw new Error("Invalid page number.")}if(!this.pdfDocument){return}if(!this._setCurrentPageNumber(t,true)){console.error(`${this._name}.currentPageNumber: "${t}" is not a valid page.`)}}_setCurrentPageNumber(t,e=false){if(this._currentPageNumber===t){if(e){this._resetCurrentPageView()}return true}if(!(0<t&&t<=this.pagesCount)){return false}this._currentPageNumber=t;this.eventBus.dispatch("pagechanging",{source:this,pageNumber:t,pageLabel:this._pageLabels&&this._pageLabels[t-1]});if(e){this._resetCurrentPageView()}return true}get currentPageLabel(){return this._pageLabels&&this._pageLabels[this._currentPageNumber-1]}set currentPageLabel(t){if(!this.pdfDocument){return}let e=t|0;if(this._pageLabels){const r=this._pageLabels.indexOf(t);if(r>=0){e=r+1}}if(!this._setCurrentPageNumber(e,true)){console.error(`${this._name}.currentPageLabel: "${t}" is not a valid page.`)}}get currentScale(){return this._currentScale!==i.UNKNOWN_SCALE?this._currentScale:i.DEFAULT_SCALE}set currentScale(t){if(isNaN(t)){throw new Error("Invalid numeric scale.")}if(!this.pdfDocument){return}this._setScale(t,false)}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(t){if(!this.pdfDocument){return}this._setScale(t,false)}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!(0,i.isValidRotation)(t)){throw new Error("Invalid pages rotation angle.")}if(!this.pdfDocument){return}if(this._pagesRotation===t){return}this._pagesRotation=t;const e=this._currentPageNumber;for(let e=0,r=this._pages.length;e<r;e++){const r=this._pages[e];r.update(r.scale,t)}if(this._currentScaleValue){this._setScale(this._currentScaleValue,true)}this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:t,pageNumber:e});if(this.defaultRenderingQueue){this.update()}}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _viewerElement(){throw new Error("Not implemented: _viewerElement")}_onePageRenderedOrForceFetch(){if(!this.container.offsetParent||this._getVisiblePages().views.length===0){return Promise.resolve()}return this._onePageRenderedCapability.promise}setDocument(t){if(this.pdfDocument){this._cancelRendering();this._resetView();if(this.findController){this.findController.setDocument(null)}}this.pdfDocument=t;if(!t){return}const e=t.numPages;const r=t.getPage(1);this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:e})}));this._onBeforeDraw=t=>{const e=this._pages[t.pageNumber-1];if(!e){return}this._buffer.push(e)};this.eventBus._on("pagerender",this._onBeforeDraw);this._onAfterDraw=t=>{if(t.cssTransform||this._onePageRenderedCapability.settled){return}this._onePageRenderedCapability.resolve();this.eventBus._off("pagerendered",this._onAfterDraw);this._onAfterDraw=null};this.eventBus._on("pagerendered",this._onAfterDraw);r.then((r=>{this._firstPageCapability.resolve(r);const n=this.currentScale;const o=r.getViewport({scale:n*i.CSS_UNITS});const s=this.textLayerMode!==i.TextLayerMode.DISABLE?this:null;for(let t=1;t<=e;++t){const e=new a.PDFPageView({container:this._viewerElement,eventBus:this.eventBus,id:t,scale:n,defaultViewport:o.clone(),renderingQueue:this.renderingQueue,textLayerFactory:s,textLayerMode:this.textLayerMode,annotationLayerFactory:this,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,renderer:this.renderer,enableWebGL:this.enableWebGL,useOnlyCssZoom:this.useOnlyCssZoom,maxCanvasPixels:this.maxCanvasPixels,l10n:this.l10n});this._pages.push(e)}const l=this._pages[0];if(l){l.setPdfPage(r);this.linkService.cachePageRef(1,r.ref)}if(this._spreadMode!==i.SpreadMode.NONE){this._updateSpreadMode()}this._onePageRenderedOrForceFetch().then((()=>{if(this.findController){this.findController.setDocument(t)}if(t.loadingParams.disableAutoFetch||e>7500){this._pagesCapability.resolve();return}let r=e-1;if(r<=0){this._pagesCapability.resolve();return}for(let i=2;i<=e;++i){t.getPage(i).then((t=>{const e=this._pages[i-1];if(!e.pdfPage){e.setPdfPage(t)}this.linkService.cachePageRef(i,t.ref);if(--r===0){this._pagesCapability.resolve()}}),(t=>{console.error(`Unable to get page ${i} to initialize viewer`,t);if(--r===0){this._pagesCapability.resolve()}}))}}));this.eventBus.dispatch("pagesinit",{source:this});if(this.defaultRenderingQueue){this.update()}})).catch((t=>{console.error("Unable to initialize viewer",t)}))}setPageLabels(t){if(!this.pdfDocument){return}if(!t){this._pageLabels=null}else if(!(Array.isArray(t)&&this.pdfDocument.numPages===t.length)){this._pageLabels=null;console.error(`${this._name}.setPageLabels: Invalid page labels.`)}else{this._pageLabels=t}for(let t=0,e=this._pages.length;t<e;t++){const e=this._pages[t];const r=this._pageLabels&&this._pageLabels[t];e.setPageLabel(r)}}_resetView(){this._pages=[];this._currentPageNumber=1;this._currentScale=i.UNKNOWN_SCALE;this._currentScaleValue=null;this._pageLabels=null;this._buffer=new d(u);this._location=null;this._pagesRotation=0;this._pagesRequests=new WeakMap;this._firstPageCapability=(0,s.createPromiseCapability)();this._onePageRenderedCapability=(0,s.createPromiseCapability)();this._pagesCapability=(0,s.createPromiseCapability)();this._scrollMode=i.ScrollMode.VERTICAL;this._spreadMode=i.SpreadMode.NONE;if(this._onBeforeDraw){this.eventBus._off("pagerender",this._onBeforeDraw);this._onBeforeDraw=null}if(this._onAfterDraw){this.eventBus._off("pagerendered",this._onAfterDraw);this._onAfterDraw=null}this.viewer.textContent="";this._updateScrollMode()}_scrollUpdate(){if(this.pagesCount===0){return}this.update()}_scrollIntoView({pageDiv:t,pageSpot:e=null,pageNumber:r=null}){(0,i.scrollIntoView)(t,e)}_setScaleUpdatePages(t,e,r=false,i=false){this._currentScaleValue=e.toString();if(c(this._currentScale,t)){if(i){this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e})}return}for(let e=0,r=this._pages.length;e<r;e++){this._pages[e].update(t)}this._currentScale=t;if(!r){let t=this._currentPageNumber,e;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)){t=this._location.pageNumber;e=[null,{name:"XYZ"},this._location.left,this._location.top,null]}this.scrollPageIntoView({pageNumber:t,destArray:e,allowNegativeOffset:true})}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:i?e:undefined});if(this.defaultRenderingQueue){this.update()}}_setScale(t,e=false){let r=parseFloat(t);if(r>0){this._setScaleUpdatePages(r,t,e,false)}else{const n=this._pages[this._currentPageNumber-1];if(!n){return}const o=this.isInPresentationMode||this.removePageBorders;let s=o?0:i.SCROLLBAR_PADDING;let a=o?0:i.VERTICAL_PADDING;if(!o&&this._isScrollModeHorizontal){[s,a]=[a,s]}const l=(this.container.clientWidth-s)/n.width*n.scale;const h=(this.container.clientHeight-a)/n.height*n.scale;switch(t){case"page-actual":r=1;break;case"page-width":r=l;break;case"page-height":r=h;break;case"page-fit":r=Math.min(l,h);break;case"auto":const e=(0,i.isPortraitOrientation)(n)?l:Math.min(h,l);r=Math.min(i.MAX_AUTO_SCALE,e);break;default:console.error(`${this._name}._setScale: "${t}" is an unknown zoom value.`);return}this._setScaleUpdatePages(r,t,e,true)}}_resetCurrentPageView(){if(this.isInPresentationMode){this._setScale(this._currentScaleValue,true)}const t=this._pages[this._currentPageNumber-1];this._scrollIntoView({pageDiv:t.div})}scrollPageIntoView({pageNumber:t,destArray:e=null,allowNegativeOffset:r=false,ignoreDestinationZoom:n=false}){if(!this.pdfDocument){return}const o=Number.isInteger(t)&&this._pages[t-1];if(!o){console.error(`${this._name}.scrollPageIntoView: `+`"${t}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!e){this._setCurrentPageNumber(t,true);return}let s=0,a=0;let l=0,h=0,u,d;const c=o.rotation%180!==0;const f=(c?o.height:o.width)/o.scale/i.CSS_UNITS;const v=(c?o.width:o.height)/o.scale/i.CSS_UNITS;let C=0;switch(e[1].name){case"XYZ":s=e[2];a=e[3];C=e[4];s=s!==null?s:0;a=a!==null?a:v;break;case"Fit":case"FitB":C="page-fit";break;case"FitH":case"FitBH":a=e[2];C="page-width";if(a===null&&this._location){s=this._location.left;a=this._location.top}break;case"FitV":case"FitBV":s=e[2];l=f;h=v;C="page-height";break;case"FitR":s=e[2];a=e[3];l=e[4]-s;h=e[5]-a;const t=this.removePageBorders?0:i.SCROLLBAR_PADDING;const r=this.removePageBorders?0:i.VERTICAL_PADDING;u=(this.container.clientWidth-t)/l/i.CSS_UNITS;d=(this.container.clientHeight-r)/h/i.CSS_UNITS;C=Math.min(Math.abs(u),Math.abs(d));break;default:console.error(`${this._name}.scrollPageIntoView: `+`"${e[1].name}" is not a valid destination type.`);return}if(!n){if(C&&C!==this._currentScale){this.currentScaleValue=C}else if(this._currentScale===i.UNKNOWN_SCALE){this.currentScaleValue=i.DEFAULT_SCALE_VALUE}}if(C==="page-fit"&&!e[4]){this._scrollIntoView({pageDiv:o.div,pageNumber:t});return}const g=[o.viewport.convertToViewportPoint(s,a),o.viewport.convertToViewportPoint(s+l,a+h)];let p=Math.min(g[0][0],g[1][0]);let w=Math.min(g[0][1],g[1][1]);if(!r){p=Math.max(p,0);w=Math.max(w,0)}this._scrollIntoView({pageDiv:o.div,pageSpot:{left:p,top:w},pageNumber:t})}_updateLocation(t){const e=this._currentScale;const r=this._currentScaleValue;const i=parseFloat(r)===e?Math.round(e*1e4)/100:r;const n=t.id;let o="#page="+n;o+="&zoom="+i;const s=this._pages[n-1];const a=this.container;const l=s.getPagePoint(a.scrollLeft-t.x,a.scrollTop-t.y);const h=Math.round(l[0]);const u=Math.round(l[1]);o+=","+h+","+u;this._location={pageNumber:n,scale:i,top:u,left:h,rotation:this._pagesRotation,pdfOpenParams:o}}_updateHelper(t){throw new Error("Not implemented: _updateHelper")}update(){const t=this._getVisiblePages();const e=t.views,r=e.length;if(r===0){return}const i=Math.max(u,2*r+1);this._buffer.resize(i,e);this.renderingQueue.renderHighestPriority(t);this._updateHelper(e);this._updateLocation(t.first);this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(t){return this.container.contains(t)}focus(){this.container.focus()}get _isScrollModeHorizontal(){return this.isInPresentationMode?false:this._scrollMode===i.ScrollMode.HORIZONTAL}get isInPresentationMode(){return this.presentationModeState===i.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===i.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?false:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?false:this.container.scrollHeight>this.container.clientHeight}_getCurrentVisiblePage(){if(!this.pagesCount){return{views:[]}}const t=this._pages[this._currentPageNumber-1];const e=t.div;const r={id:t.id,x:e.offsetLeft+e.clientLeft,y:e.offsetTop+e.clientTop,view:t};return{first:r,last:r,views:[r]}}_getVisiblePages(){return(0,i.getVisibleElements)(this.container,this._pages,true,this._isScrollModeHorizontal)}isPageVisible(t){if(!this.pdfDocument){return false}if(t<1||t>this.pagesCount){console.error(`${this._name}.isPageVisible: "${t}" is out of bounds.`);return false}return this._getVisiblePages().views.some((function(e){return e.id===t}))}cleanup(){for(let t=0,e=this._pages.length;t<e;t++){if(this._pages[t]&&this._pages[t].renderingState!==n.RenderingStates.FINISHED){this._pages[t].reset()}}}_cancelRendering(){for(let t=0,e=this._pages.length;t<e;t++){if(this._pages[t]){this._pages[t].cancelRendering()}}}_ensurePdfPageLoaded(t){if(t.pdfPage){return Promise.resolve(t.pdfPage)}if(this._pagesRequests.has(t)){return this._pagesRequests.get(t)}const e=this.pdfDocument.getPage(t.id).then((e=>{if(!t.pdfPage){t.setPdfPage(e)}this._pagesRequests.delete(t);return e})).catch((e=>{console.error("Unable to get page for page view",e);this._pagesRequests.delete(t)}));this._pagesRequests.set(t,e);return e}forceRendering(t){const e=t||this._getVisiblePages();const r=this._isScrollModeHorizontal?this.scroll.right:this.scroll.down;const i=this.renderingQueue.getHighestPriority(e,this._pages,r);if(i){this._ensurePdfPageLoaded(i).then((()=>{this.renderingQueue.renderView(i)}));return true}return false}createTextLayerBuilder(t,e,r,i=false,n){return new h.TextLayerBuilder({textLayerDiv:t,eventBus:n,pageIndex:e,viewport:r,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:this.isInPresentationMode?false:i})}createAnnotationLayerBuilder(t,e,r="",n=false,s=i.NullL10n){return new o.AnnotationLayerBuilder({pageDiv:t,pdfPage:e,imageResourcesPath:r,renderInteractiveForms:n,linkService:this.linkService,downloadManager:this.downloadManager,l10n:s})}get hasEqualPageSizes(){const t=this._pages[0];for(let e=1,r=this._pages.length;e<r;++e){const r=this._pages[e];if(r.width!==t.width||r.height!==t.height){return false}}return true}getPagesOverview(){const t=this._pages.map((function(t){const e=t.pdfPage.getViewport({scale:1});return{width:e.width,height:e.height,rotation:e.rotation}}));if(!this.enablePrintAutoRotate){return t}const e=(0,i.isPortraitOrientation)(t[0]);return t.map((function(t){if(e===(0,i.isPortraitOrientation)(t)){return t}return{width:t.height,height:t.width,rotation:(t.rotation+90)%360}}))}get scrollMode(){return this._scrollMode}set scrollMode(t){if(this._scrollMode===t){return}if(!(0,i.isValidScrollMode)(t)){throw new Error(`Invalid scroll mode: ${t}`)}this._scrollMode=t;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:t});this._updateScrollMode(this._currentPageNumber)}_updateScrollMode(t=null){const e=this._scrollMode,r=this.viewer;r.classList.toggle("scrollHorizontal",e===i.ScrollMode.HORIZONTAL);r.classList.toggle("scrollWrapped",e===i.ScrollMode.WRAPPED);if(!this.pdfDocument||!t){return}if(this._currentScaleValue&&isNaN(this._currentScaleValue)){this._setScale(this._currentScaleValue,true)}this._setCurrentPageNumber(t,true);this.update()}get spreadMode(){return this._spreadMode}set spreadMode(t){if(this._spreadMode===t){return}if(!(0,i.isValidSpreadMode)(t)){throw new Error(`Invalid spread mode: ${t}`)}this._spreadMode=t;this.eventBus.dispatch("spreadmodechanged",{source:this,mode:t});this._updateSpreadMode(this._currentPageNumber)}_updateSpreadMode(t=null){if(!this.pdfDocument){return}const e=this.viewer,r=this._pages;e.textContent="";if(this._spreadMode===i.SpreadMode.NONE){for(let t=0,i=r.length;t<i;++t){e.appendChild(r[t].div)}}else{const t=this._spreadMode-1;let i=null;for(let n=0,o=r.length;n<o;++n){if(i===null){i=document.createElement("div");i.className="spread";e.appendChild(i)}else if(n%2===t){i=i.cloneNode(false);e.appendChild(i)}i.appendChild(r[n].div)}}if(!t){return}this._setCurrentPageNumber(t,true);this.update()}}e.BaseViewer=f},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFViewer=void 0;var i=r(16);var n=r(2);class o extends i.BaseViewer{get _viewerElement(){return(0,n.shadow)(this,"_viewerElement",this.viewer)}_scrollIntoView({pageDiv:t,pageSpot:e=null,pageNumber:r=null}){if(!e&&!this.isInPresentationMode){const r=t.offsetLeft+t.clientLeft;const i=r+t.clientWidth;const{scrollLeft:n,clientWidth:o}=this.container;if(this._isScrollModeHorizontal||r<n||i>n+o){e={left:0,top:0}}}super._scrollIntoView({pageDiv:t,pageSpot:e,pageNumber:r})}_getVisiblePages(){if(this.isInPresentationMode){return this._getCurrentVisiblePage()}return super._getVisiblePages()}_updateHelper(t){if(this.isInPresentationMode){return}let e=this._currentPageNumber;let r=false;for(const i of t){if(i.percent<100){break}if(i.id===e){r=true;break}}if(!r){e=t[0].id}this._setCurrentPageNumber(e)}}e.PDFViewer=o}])}))})(pdf_viewer$1);return pdf_viewer$1.exports}requirePdf_viewer();const findIn=(t,e,r=false,i=false)=>{const n=new Array;const{top:o,left:s,bottom:a,right:l}=e.getBoundingClientRect();t.forEach((t=>{if(t.getBoundingClientRect().bottom<=a&&t.getBoundingClientRect().top>=o&&t.getBoundingClientRect().left>=s&&t.getBoundingClientRect().right<=l){if(r)t.selected=true;n.push(t)}else{if(r&&!i)t.selected=false}}));return n};function addField(t,e){const r=document.createElement("ls-editor-field");r.setAttribute("type",e.formElementType);r.setAttribute("id","ls-field-"+e.id);r.setAttribute("selected","selected");r.style.zIndex="100";r.style.position="absolute";r.style.top=Math.floor(e.top*this.zoom)+"px";r.style.left=Math.floor(e.left*this.zoom)+"px";r.style.height=Math.floor(e.height*this.zoom)+"px";r.style.width=Math.floor(e.width*this.zoom)+"px";r.dataItem=e;t.appendChild(r);return r}function moveField(t,e){t.style.top=Math.floor(e.top*this.zoom)+"px";t.style.left=Math.floor(e.left*this.zoom)+"px";t.style.height=Math.floor(e.height*this.zoom)+"px";t.style.width=Math.floor(e.width*this.zoom)+"px";t.dataItem=e}const findDimensions=(t,e,r)=>{const{top:i,left:n,height:o,width:s}=t.getBoundingClientRect();const a=n>0?n/r:0;const l=i>0?i/e:0;const h=(n+s)/r;const u=(i+o)/e;return{top:i,left:n,height:o,width:s,ax:a,ay:l,bx:h,by:u}};const defaultRolePalette=[{primary:"rgb(50, 124, 244)",faded:"rgb(240, 246, 255)"},{primary:"rgb(70, 219, 170)",faded:"rgb(239, 255, 249)"},{primary:"rgb(240, 182, 24)",faded:"rgb(255, 252, 239)"},{primary:"rgb(238, 229, 255)",faded:"rgb(244, 240, 255)"},{primary:"rgb(240, 86, 178)",faded:"rgb(255, 240, 249)"},{primary:"rgb(189, 240, 86)",faded:"rgb(250, 255, 240)"},{primary:"rgb(246, 74, 68)",faded:"rgb(246, 190, 188)"},{primary:"rgb(58, 0, 166)",faded:"rgb(188, 169, 240)"},{primary:"rgba(1, 179, 34, 0.69)",faded:"rgb(135, 173, 158)"},{primary:"rgb(201, 204, 0)",faded:"rgba(246, 247, 203, 0.77)"},{primary:"rgb(249, 55, 129)",faded:"rgb(255, 237, 244)"},{primary:"rgb(0, 14, 166)",faded:"rgb(209, 212, 243)"},{primary:"rgb(135, 173, 158)",faded:"rgb(205, 244, 228)"},{primary:"rgb(86, 199, 240)",faded:"rgb(202, 236, 248)"},{primary:"rgb(246, 205, 68)",faded:"rgb(244, 240, 255)"},{primary:"rgb(0, 94, 166)",faded:"rgb(188, 169, 240)"},{primary:"rgba(179, 1, 63, 0.69)",faded:"rgb(135, 173, 158)"}];function oob(t){if(t.left+t.width>t.pageDimensions.width||t.top<0||t.left<0||t.top+t.height>t.pageDimensions.height)return true;else return false}function alter(t){const e=this.selected.map((e=>({action:"update",data:t(e.dataItem)})));this.mutate.emit(e);this.update.emit(e)}function debounce(t,e=300){let r;return(...i)=>{clearTimeout(r);r=setTimeout((()=>{t.apply(this,i)}),e)}}function getApiType(t){if(!t?.id)return"invalid";const e=atob(t.id);if(e.length<3)return"invalid";const r=atob(t.id).substring(0,3);switch(r){case"ele":return"element";case"rol":return"role";case"tpl":return"template";case"doc":return"document";default:return"unknown"}}const validationTypes=[{id:0,description:"general purpose",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:30,description:"yyyy/mm/dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:31,description:"yy/mm/dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:32,description:"dd/mm/yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:33,description:"dd/mm/yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:34,description:"mm/dd/yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:35,description:"mm/dd/yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:36,description:"yyyy.mm.dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:37,description:"yy.mm.dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:38,description:"dd.mm.yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:39,description:"dd.mm.yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:40,description:"mm.dd.yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:41,description:"mm.dd.yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:42,description:"yyyy-mm-dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:43,description:"yy-mm-dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:44,description:"dd-mm-yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:45,description:"dd-mm-yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:46,description:"mm-dd-yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:47,description:"mm-dd-yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:48,description:"d mmmm yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:73,description:"Secret Code",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:77,description:"Title caps (force text to title caps)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:78,description:"Uppercase (force text to uppercase)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:79,description:"Lowercase (force text to lowercase)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:65,description:"1 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:66,description:"2 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:67,description:"3 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:68,description:"4 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:69,description:"5 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:70,description:"6 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:71,description:"7 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:72,description:"8 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:1e3,description:"First name field (special use)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:1001,description:"Last name field (special use)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:1,description:"Email",formType:"email",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:1002,description:"Email field (special use)",formType:"email",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:50,description:"Whole number",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"number"},{id:51,description:"Number",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:52,description:"Currency",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:53,description:"1 number",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:54,description:"2 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:55,description:"3 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:56,description:"4 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:57,description:"5 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:58,description:"6 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:59,description:"7 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:60,description:"8 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:61,description:"9 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:62,description:"10 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:63,description:"11 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:64,description:"12 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:2,description:"yyyy/mm/dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"date"},{id:3,description:"yy/mm/dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:4,description:"dd/mm/yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"date"},{id:5,description:"dd/mm/yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:6,description:"mm/dd/yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:7,description:"mm/dd/yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:80,description:"mm/yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:81,description:"mm/yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:8,description:"yyyy.mm.dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:9,description:"yy.mm.dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:10,description:"dd.mm.yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:11,description:"dd.mm.yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:12,description:"mm.dd.yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:13,description:"mm.dd.yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:82,description:"mm.yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:83,description:"mm.yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:14,description:"yyyy-mm-dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:15,description:"yy-mm-dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:16,description:"dd-mm-yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:17,description:"dd-mm-yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:18,description:"mm-dd-yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:19,description:"mm-dd-yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:84,description:"mm-yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:85,description:"mm-yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:20,description:"Dropdown List",formType:"dropdown",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:91,description:"Countries",formType:"dropdown",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:92,description:"Name prefix titles",formType:"dropdown",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:24,description:"✔/✗",formType:"checkbox",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:25,description:"✔/empty",formType:"checkbox",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:26,description:"✗/empty",formType:"checkbox",defaultHeight:16,defaultWidth:16,typeDefault:false,inputType:"text"},{id:74,description:"File: attach to confirmatory email to sender",formType:"file",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:75,description:"File: append to PDF, PDF files only",formType:"file",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:76,description:"File: zip with PDF (for internal view, signed PDF for signer)",formType:"file",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:90,description:"Drawn field.",formType:"drawn field",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:2e3,description:"Initials",formType:"initials",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:93,description:"Regular Expression field",formType:"regular expression",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:3e3,description:"Auto Sign",formType:"auto sign",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:4e3,description:"Text Area",formType:"textarea",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"readonly"}];function getInputType(t){console.log(t,"validation");if(t===null)return validationTypes[0];const e=validationTypes.find((e=>e.id===t));return e===null?validationTypes[0]:e}function keyDown(t){if(this.selected&&this.selected?.length>0){const e=alter.bind(this);if(t.key==="ArrowDown"){console.log("down arrow pressed");e((t=>{const e={...t,top:t.top+1,ay:t.ay+1,by:t.by+1};return oob(e)?t:e}))}else if(t.key==="ArrowUp"){console.log("up arrow pressed");e((t=>{const e={...t,top:t.top-1,ay:t.ay-1,by:t.top-1};return oob(e)?t:e}))}else if(t.key==="ArrowRight"){console.log("right arrow pressed");e((t=>{const e={...t,left:t.left+1,ax:t.ax+1,bx:t.bx+1};return oob(e)?t:e}))}else if(t.key==="ArrowLeft"){console.log("left arrow pressed");e((t=>{const e={...t,left:t.left-1,ax:t.ax-1,bx:t.bx-1};return oob(e)?t:e}))}else if(t.key==="Delete"){const t=Array.from(this.selected);this.update.emit(t.map((t=>({action:"delete",data:t.dataItem}))))}}}function mouseDown(t){if(t.offsetX<0||t.offsetY<0)return;this.hitField=null;const e=this.component.shadowRoot.querySelectorAll("ls-editor-field");e.forEach((e=>{const{left:r,top:i,height:n,width:o,bottom:s,right:a}=e.getBoundingClientRect();const l={left:e.offsetLeft,top:e.offsetTop,height:n,width:o,x:t.screenX,y:t.screenY};this.startMouse=l;if(Math.abs(t.clientX-r)<5&&t.clientY>=i&&t.clientY<=s){this.edgeSide="w";this.hitField=e}else if(Math.abs(t.clientX-a)<5&&t.clientY>=i&&t.clientY<=s){this.edgeSide="e";this.hitField=e}else if(Math.abs(t.clientY-i)<5&&t.clientX>=r&&t.clientX<=a){this.edgeSide="n";this.hitField=e}else if(Math.abs(t.clientY-s)<5&&t.clientX>=r&&t.clientX<=a){this.edgeSide="s";this.hitField=e}else if(t.clientY<=s&&t.clientY>=i&&t.clientX>=r&&t.clientX<=a){this.edgeSide=null;this.hitField=e}}));if(this.hitField){const{height:e,width:r}=this.hitField.getBoundingClientRect();const i={left:this.hitField.offsetLeft,top:this.hitField.offsetTop,height:e,width:r,x:t.screenX,y:t.screenY};this.startMouse=i;const n=this.selected?this.selected:[this.hitField];this.startLocations=n.map((t=>{const{height:e,width:r}=t.getBoundingClientRect();const i=t;return{top:i.offsetTop,left:i.offsetLeft,height:e,width:r}}));this.selectionBox=null}else{this.startLocations=null;this.startMouse=null;this.selectionBox={x:t.clientX,y:t.clientY};this.component.style.cursor="crosshair"}}function mouseMove(t){t.preventDefault();if(this.hitField&&this.edgeSide&&this.startMouse&&t.buttons===1){const e=t.screenX-this.startMouse.x;const r=t.screenY-this.startMouse.y;switch(this.edgeSide){case"n":this.hitField.style.top=this.startMouse.top+r+"px";this.hitField.style.height=this.startMouse.height-r+"px";break;case"s":this.hitField.style.height=this.startMouse.height+r+"px";break;case"e":this.hitField.style.width=this.startMouse.width+e+"px";break;case"w":this.hitField.style.left=this.startMouse.left+e+"px";this.hitField.style.width=this.startMouse.width-e+"px";break}}else if(this.selectionBox&&t.buttons===1){var e=this.component.shadowRoot.getElementById("ls-box-selector");var r=this.component.shadowRoot.getElementById("ls-document-frame");var i=r.getBoundingClientRect().left;var n=r.getBoundingClientRect().top;const o=t.clientX-this.selectionBox.x;const s=t.clientY-this.selectionBox.y;e.style.visibility="visible";e.style.left=(this.selectionBox.x>t.clientX?t.clientX:this.selectionBox.x)-i+r.scrollLeft+"px";e.style.top=(this.selectionBox.y>t.clientY?t.clientY:this.selectionBox.y)-n+r.scrollTop+"px";e.style.width=Math.abs(o)+"px";e.style.height=Math.abs(s)+"px"}else if(this.startLocations&&!this.edgeSide&&this.startMouse&&t.buttons===1){this.isMoving=true;const e=t.screenX-this.startMouse.x;const r=t.screenY-this.startMouse.y;if(this.selected?.length){for(let t=0;t<this.selected.length;t++){this.selected[t].style.left=this.startLocations[t].left+e+"px";this.selected[t].style.top=this.startLocations[t].top+r+"px"}}}}function mouseUp(t){this.edgeSide=null;this.startMouse=null;this.component.style.cursor="auto";if(this.selectionBox){var e=this.component.shadowRoot.getElementById("ls-box-selector");var r=this.component.shadowRoot.querySelectorAll("ls-editor-field");e.style.visibility="hidden";findIn(r,e,true,t.shiftKey);var i=this.component.shadowRoot.querySelectorAll("ls-editor-field");this.selectFields.emit(Array.from(i).filter((t=>t.selected)).map((t=>t.dataItem)));this.selectionBox=null;this.selected=Array.from(i).filter((t=>t.selected))}}function mouseClick(t){if(this.isMoving){this.isMoving=false;const t=this.component.shadowRoot.querySelectorAll("ls-editor-field");const e=Array.from(t).filter((t=>t.selected));this.selectFields.emit(e.map((t=>t.dataItem)));this.mutate.emit(Array.from(t).filter((t=>t.selected)).map((t=>{const e={...t.dataItem,...findDimensions(t,this.pageDimensions[this.pageNum-1].height,this.pageDimensions[this.pageNum-1].width)};t.dataItem=e;return{action:"update",data:e}})))}else{const e=this.component.shadowRoot.querySelectorAll("ls-editor-field");e.forEach((r=>{const{left:i,top:n,bottom:o,right:s}=r.getBoundingClientRect();if(t.clientY<=o&&t.clientY>=n&&t.clientX>=i&&t.clientX<=s){this.edgeSide=null;this.hitField=r;if(!t.shiftKey)e.forEach((t=>t.selected=false));r.selected=true}}));this.selected=Array.from(e).filter((t=>t.selected));this.selectFields.emit(this.selected.map((t=>t.dataItem)))}}const lsDocumentViewerCss="*,*::before,*::after{box-sizing:border-box}*{margin:0}@media (prefers-reduced-motion: no-preference){html{interpolate-size:allow-keywords}}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}#root,#__next{isolation:isolate}:host{display:flex;flex-direction:row;width:100vw;height:100vh;margin:0px;padding:0px}.leftBox{display:flex;flex-direction:row;min-width:250px;width:250px;border:1px gray solid}.rightBox{width:200px;border:1px gray solid;width:470px;min-width:390px;padding:4px;font-family:inherit}.toolbox{display:flex;flex-direction:column;width:250px;left:0px}.ls-editor-infobox{padding:2px 8px 2px 8px;color:#727272}#pdf-canvas{top:0px;left:0px;width:100%;height:100%}#ls-mid-area{display:flex;flex-direction:column;width:100%}#ls-document-frame{background-image:repeating-linear-gradient(rgba(175, 176, 178, 0.4) 0px, rgba(175, 176, 178, 0.4) 1px, transparent 1px, transparent 100%), repeating-linear-gradient(90deg, rgba(175, 176, 178, 0.4) 0px, rgba(175, 176, 178, 0.4) 1px, transparent 1px, transparent 100%);border:4px rgb(126, 126, 126) solid;position:relative;min-width:60vw;width:100%;height:98vh;max-width:100%;max-height:100%;margin:0px;padding:2px;overflow-x:scroll;overflow-y:scroll;background-color:rgb(181, 181, 181);scrollbar-width:auto;scrollbar-color:auto}.prevButton{position:relative;bottom:30px}.nextButton{position:relative;bottom:30px}.fieldBox{z-index:1000}#ls-box-selector{position:absolute;visibility:hidden;background-color:transparent;border:1px rgba(71, 71, 71, 0.716) dashed}#ls-editor-form{display:flex;flex-direction:row;width:100vw}.hidden{visibility:hidden;display:none;width:0px}";pdfExports.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.5.207/pdf.worker.min.js";const LsDocumentViewer=class{constructor(t){registerInstance(this,t);this.pageRendered=createEvent(this,"pageRendered");this.pageChange=createEvent(this,"pageChange");this.selectFields=createEvent(this,"selectFields");this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}get component(){return getElement(this)}isPageRendering;pdfDocument;pageNumPending=null;canvas;ctx;pageDimensions;isMoving=false;selectionBox=null;hitField;edgeSide;startLocations;startMouse;template;zoom=1;pageNum=1;_template;selected;mode="custom";modeHandler(t,e){if(t==="preview"){this.showtoolbar=false;this.showtoolbox=false;this.showstatusbar=false;this.showrightpanel=false;this.readonly=true}else if(t==="editor"){this.showtoolbar=true;this.showtoolbox=true;this.showstatusbar=true;this.showrightpanel=true;this.readonly=false}}tableViewHandler(t,e){if(t===true){this.showPageFields(-1)}else if(t==="editor"){this.showPageFields(this.pageNum)}this.queueRenderPage(this.pageNum)}manager="toolbox";selectedHandler(t,e){var r=this.component.shadowRoot.getElementById("ls-toolbar");r.dataItem=t}displayTable=false;showtoolbox=false;showtoolbar=false;showstatusbar=false;showpagepreview=false;showrightpanel=false;readonly=false;showtableview=false;toolboxFilter=null;roleColors=defaultRolePalette;parseTemplate(t){const e=t;const r=JSON.parse(JSON.parse(e.pageDimensions));this.pageDimensions=r.map((t=>({height:t[1],width:t[0]})));const i=e.elementConnection.templateElements.map((t=>({...t,top:t.ay*r[0].height,left:t.ax*r[0].width,height:(t.by-t.ay)*r[0].height,width:(t.bx-t.ax)*r[0].width})));this._template={...e,elementConnection:{...e.elementConnection,templateElements:i}}}pageRendered;pageChange;selectFields;mutate;update;mutateHandler(t){if(t.detail)t.detail.forEach((t=>this.syncChange(t)))}async pageNext(){if(this.pageNum>=this.pdfDocument.numPages){return}this.pageNum+=1;this.queueRenderPage(this.pageNum);this.showPageFields(this.pageNum)}async pagePrev(){if(this.pageNum<=1){return}this.pageNum-=1;this.queueRenderPage(this.pageNum);this.showPageFields(this.pageNum)}async setZoom(t){this.zoom=t;this.canvas=this.component.shadowRoot.getElementById("pdf-canvas");this.canvas.style.height=this.pageDimensions[this.pageNum-1].height*this.zoom+"px";this.canvas.style.width=this.pageDimensions[this.pageNum-1].width*this.zoom+"px";this.component.shadowRoot.querySelectorAll("ls-editor-field").forEach((t=>moveField.bind(this)(t,t.dataItem)));this.queueRenderPage(this.pageNum);this.showPageFields(this.pageNum)}renderPage(t){this.isPageRendering=true;this.pdfDocument.getPage(t).then((t=>{const e=t.getViewport({scale:this.zoom});this.canvas.height=Math.floor(e.height/this.zoom);this.canvas.width=Math.floor(e.width/this.zoom);const r={viewport:e,canvasContext:this.ctx};const i=t.render(r);i.promise.then((()=>{this.isPageRendering=false;this.pageRendered.emit(this.pageNum);if(this.pageNumPending!==null){this.renderPage(this.pageNumPending);this.pageChange.emit(this.pageNumPending);this.pageNumPending=null}}))}))}queueRenderPage(t){if(this.isPageRendering){this.pageNumPending=t}else{this.renderPage(t)}}loadAndRender(t){pdfExports.getDocument(t).promise.then((t=>{this.pdfDocument=t;this.renderPage(this.pageNum)}))}prepareElement(t){return{...t,top:Math.floor(t.ay*this.pageDimensions[t.page-1].height),left:Math.floor(t.ax*this.pageDimensions[t.page-1].width),height:Math.floor((t.by-t.ay)*this.pageDimensions[t.page-1].height),width:Math.floor((t.bx-t.ax)*this.pageDimensions[t.page-1].width),pageDimensions:this.pageDimensions[t.page-1]}}syncChange(t){console.log(getApiType(t.data),"sync");if(getApiType(t.data)==="element"){if(t.action==="create"){const e={...t.data,page:this.pageNum};addField.bind(this)(this.component.shadowRoot.getElementById("ls-document-frame"),e);const r=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);this.selected=[r];this.selectFields.emit([e])}else if(t.action==="update"){const e=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);if(e){moveField.bind(this)(e,t.data);const r=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);r.dataItem=t.data;this.selected=this.selected.map((e=>e.dataItem.id===t.data.id?r:e))}const r=this.component.shadowRoot.querySelectorAll("ls-editor-field");this.selected=Array.from(r).filter((t=>t.selected))}else if(t.action==="delete"){const e=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);this.component.shadowRoot.getElementById("ls-document-frame").removeChild(e);this.selected=[]}else{console.warn("Unrecognised action, check Legalesign documentation. `create`, `update` and `delete` allowed.")}}}componentDidLoad(){console.log("Baking your PDF");PDFDocument.create().then((t=>{const e=t.addPage([842,595]);const r=t.addPage([842,595]);e.moveTo(50,410);e.drawText("Welcome to Legalesign!");r.moveTo(500,50);r.drawText("Page 2");t.saveAsBase64({dataUri:true}).then((t=>{this.canvas=this.component.shadowRoot.getElementById("pdf-canvas");this.canvas.style.height=this.pageDimensions[this.pageNum-1].height*this.zoom+"px";this.canvas.style.width=this.pageDimensions[this.pageNum-1].width*this.zoom+"px";this.ctx=this.canvas.getContext("2d");this.loadAndRender(t)}))}));var t=this.component.shadowRoot.getElementById("ls-document-frame");t.addEventListener("click",mouseClick.bind(this));t.addEventListener("mousedown",mouseDown.bind(this));t.addEventListener("mousemove",mouseMove.bind(this));t.addEventListener("mouseup",mouseUp.bind(this));document.addEventListener("keydown",keyDown.bind(this));t.addEventListener("dragenter",(t=>{t.preventDefault()}));t.addEventListener("dragover",(t=>{t.preventDefault()}));t.addEventListener("drop",(t=>{t.preventDefault();try{const r=JSON.parse(t.dataTransfer.getData("application/json"));this.component.shadowRoot.querySelectorAll("ls-editor-field").forEach((t=>t.selected=false));var e=this.component.shadowRoot.getElementById("ls-document-frame");const i=btoa("ele"+crypto.randomUUID());const n={action:"create",data:{...r,id:i,value:"",top:t.offsetY*this.zoom+e.scrollTop,left:t.offsetX*this.zoom+e.scrollLeft,height:r.defaultHeight,width:r.defaultWidth,pageDimensions:this.pageDimensions[this.pageNum-1],fontName:"courier",fontSize:10,align:"left",signer:1,elementType:r.type}};this.mutate.emit([n]);this.update.emit([n])}catch(t){console.error(t)}}));this._template.elementConnection.templateElements.forEach((t=>{addField.bind(this)(this.component.shadowRoot.getElementById("ls-document-frame"),this.prepareElement(t))}))}showPageFields(t){const e=this.component.shadowRoot.querySelectorAll("ls-editor-field");Array.from(e).forEach((e=>{e.className=e.dataItem.page===t?"":"hidden"}))}componentWillLoad(){if(this.template){this.parseTemplate(this.template)}}render(){return h(Host,{key:"f512a2409e7baaca727edfd39539afd75cb8d970"},h("form",{key:"37046c81e4fda2fe3de18cea5d53c6c00fb421c3",id:"ls-editor-form"},this.showtoolbox===true?h("div",{class:"leftBox"},h("ls-feature-column",{onManage:t=>{if(t.detail==="document"){var e=this.component.shadowRoot.getElementById("ls-document-options");e.template=this._template}else if(t.detail==="participant"){console.log(this._template);var r=this.component.shadowRoot.getElementById("ls-participant-manager");r.template=this._template}this.manager=t.detail}}),h("div",{id:"ls-toolbox",class:this.manager==="toolbox"?"toolbox":"hidden"},h("div",{class:"ls-editor-infobox"},"Drag to Add..."),h("ls-toolbox-field",{elementType:"signature",formElementType:"signature",label:"Signature",defaultHeight:27,defaultWidth:120,validation:0}),h("ls-toolbox-field",{elementType:"text",formElementType:"text",label:"Text",defaultHeight:27,defaultWidth:100,validation:0}),h("ls-toolbox-field",{elementType:"email",formElementType:"email",label:"Email",defaultHeight:27,defaultWidth:120,validation:1}),h("ls-toolbox-field",{elementType:"number",formElementType:"number",label:"Number",defaultHeight:27,defaultWidth:80,validation:50}),h("ls-toolbox-field",{elementType:"date",formElementType:"date",label:"Date",defaultHeight:27,defaultWidth:80,validation:2}),h("ls-toolbox-field",{elementType:"checkbox",formElementType:"checkbox",label:"Checkbox",defaultHeight:27,defaultWidth:27,validation:25}),h("ls-toolbox-field",{elementType:"auto sign",formElementType:"auto sign",label:"Auto Sign",defaultHeight:27,defaultWidth:120,validation:3e3}),h("ls-toolbox-field",{elementType:"initials",formElementType:"initials",label:"Initials",defaultHeight:27,defaultWidth:120,validation:2e3}),h("ls-toolbox-field",{elementType:"regex",formElementType:"regex",label:"Regex",defaultHeight:27,defaultWidth:120,validation:93}),h("ls-toolbox-field",{elementType:"image",formElementType:"image",label:"Image",defaultHeight:27,defaultWidth:120,validation:90}),h("ls-toolbox-field",{elementType:"signing date",formElementType:"signing date",label:"Signing Date",defaultHeight:27,defaultWidth:120,validation:30}),h("ls-toolbox-field",{elementType:"file",formElementType:"file",label:"File",defaultHeight:27,defaultWidth:120,validation:74})),h("ls-participant-manager",{id:"ls-participant-manager",class:this.manager==="participant"?"toolbox":"hidden",editor:this}),h("ls-document-options",{id:"ls-document-options",class:this.manager==="document"?"toolbox":"hidden"})):h(h.Fragment,null),h("div",{key:"bb3bd54d108a59eaf70f4a609b84ba6199863b2c",id:"ls-mid-area"},h("ls-toolbar",{key:"7c1033d9a490cd9c74407f792e64f8be547b886b",id:"ls-toolbar",dataItem:this.selected?this.selected.map((t=>t.dataItem)):null,template:this._template}),h("div",{key:"78ca03bdaa892eec0c10749dbce317ea7587d543",id:"ls-document-frame"},h("canvas",{key:"890b52ba92cea64bbe0b6a63f247a727980b8685",id:"pdf-canvas",class:this.displayTable?"hidden":""}),h("ls-editor-table",{key:"e857090ad9dd6caf9a16b94331acb87766ed7c83",editor:this,class:this.displayTable?"":"hidden"}),h("div",{key:"8f1c36d80983da65c7a93283bb49c00276210fdb",id:"ls-box-selector"})),h("ls-statusbar",{key:"0e958c3744e0c83b523ae5e02a02d0037e6e0440",editor:this})),this.showrightpanel&&!this.displayTable&&this.selected&&this.selected.length>0&&h("div",{key:"f3ac5e1f2b83554b04c3ceff956e81165acea708",class:"rightBox"},h("slot",{key:"b47a45fd7c5adc2500d6d1752863153eac14c29a"}))))}static get watchers(){return{mode:["modeHandler"],displayTable:["tableViewHandler"],selected:["selectedHandler"]}}};LsDocumentViewer.style=lsDocumentViewerCss;const lsEditorFieldCss=":host{display:block;position:absolute;border:1px solid rgb(49, 49, 49);margin:0px;padding:0px 0px 0px 0px;isolation:isolate}.ls-editor-field-editable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;border:0px solid #000;margin:0;padding:0px 0px 0px 0px;min-width:2em;background-color:white;height:100%;width:100%}.ls-editor-field-editable:focus{outline:none}.ls-editor-field-draggable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;background-color:white;min-width:2px;height:98%;width:98%}.is-selected{border:1px dotted rgb(193, 26, 26)}.hidden-field{display:none}.draggable-input{font-family:inherit;font-size:inherit;position:relative;height:95%;width:95%}.editing-input{caret-color:rgb(15 23 42);caret-shape:auto;height:100%;width:100%}";const LsEditorField=class{constructor(t){registerInstance(this,t)}get component(){return getElement(this)}dataItem;selected;readonly;palette;type;page;isEditing=false;heldEdge=null;isEdgeDragging=false;innerValue;sizeObserver;handleInput(t){if(t.code==="Enter"){this.isEditing=false;this.sizeObserver.observe(this.component.shadowRoot.getElementById("field-info"))}}handleMouseMove(t){if(this.readonly)return;if(!t.clientX)return;if(Math.abs(t.offsetX)<5){this.component.style.cursor="ew-resize"}else if(Math.abs(t.offsetX-this.component.clientWidth)<5){this.component.style.cursor="ew-resize"}else if(Math.abs(t.offsetY)<5){this.component.style.cursor="ns-resize"}else if(Math.abs(t.offsetY-this.component.clientHeight)<5){this.component.style.cursor="ns-resize"}else{this.component.style.cursor="move"}}handleDoubleClick(){if(this.readonly)return;this.isEditing=true;this.heldEdge=null;this.isEdgeDragging=false;this.sizeObserver.disconnect();this.innerValue=this.innerValue?this.innerValue:this.dataItem?.value;const t=this.component.shadowRoot.getElementById("editing-input");console.log(t);if(t){t.className="ls-editor-field-editable";t.focus()}}handleDragStart(t){console.log("dragstart ls-editor-field",t,this.type);t.dataTransfer.setData("application/json",JSON.stringify({type:this.type}));t.dataTransfer.dropEffect="move"}watchSelectedHandler(t,e){if(t)this.component.style.border="1px dotted red";else this.component.style.border="1px solid black"}onInputChange(t){this.innerValue=t.target.value}componentDidLoad(){this.sizeObserver=new ResizeObserver((t=>{for(const e of t){if(e.contentRect){const t=this.component.shadowRoot.getElementById("field-info");t.style.height=e.contentRect.height+"px";t.style.width=e.contentRect.width+"px"}}}));this.sizeObserver.observe(this.component);if(this.selected)this.component.style.border="1px dotted red";else this.component.style.border="1px solid black"}render(){return h(Host,{key:"1768aa1f0591c1094aee697e8d8a99c5bb769369",class:{"ls-editor-field":true,"is-selected":this.selected}},h("input",{key:"ce5806dd692551c27d270f6bac41e038016f8067",id:"editing-input",class:this.isEditing?"ls-editor-field-editable":"hidden-field",type:getInputType(this.dataItem.validation).inputType,value:this.dataItem?.value||this.innerValue,onChange:t=>this.onInputChange(t)}),h("div",{key:"1a102290f8e8a860e8d72c2af6505facd8cf821b",id:"field-info",class:this.isEditing?"hidden-field":"ls-editor-field-draggable"},this.innerValue||this.dataItem?.label||this.dataItem?.formElementType))}static get watchers(){return{selected:["watchSelectedHandler"]}}};LsEditorField.style=lsEditorFieldCss;const lsEditorTableCss=":host{display:block;z-index:100;position:absolute;top:0px;left:0px}table{background-color:azure;border:1px solid black}td{border:1px solid black}";const LsEditorTable=class{constructor(t){registerInstance(this,t)}get component(){return getElement(this)}editor;componentDidLoad(){var t=this.component.shadowRoot.getElementById("ls-editor-table");Array.from(this.editor.component.shadowRoot.querySelectorAll("ls-editor-field")).forEach((e=>{const r=document.createElement("tr");const i=document.createElement("td");i.innerText=e.dataItem.id;r.appendChild(i);const n=document.createElement("td");n.innerText=e.dataItem.value;r.appendChild(n);const o=document.createElement("td");o.innerText=e.dataItem.label;r.appendChild(o);t.appendChild(r)}))}render(){return h(Host,{key:"271021e59ed37d9847e1cdfa84ad1de54381f08b"},h("table",{key:"7649085181f45356f016dcf8318a51c72cd2563e",id:"ls-editor-table"}),h("slot",{key:"cb439f2cc88560c780390a970e641f4243fcf736"}))}};LsEditorTable.style=lsEditorTableCss;const lsFeatureColumnCss=":host{display:block;padding:4px}.activeIcon{background-color:aliceblue}";const LsFeatureColoumn=class{constructor(t){registerInstance(this,t);this.manage=createEvent(this,"manage")}manager="toolbox";manage;render(){return h(Host,{key:"14030230876b89f69c4f404d3a9bb2d0df08231a"},h("ls-icon",{key:"da8716822dfecf75167ad79f27eec08d4aca4b78",name:"document",size:"36",class:this.manager==="document"?"activeIcon":"",onClick:()=>{console.log("document");this.manage.emit("document");this.manager="document"}}),h("ls-icon",{key:"9f191cb42e9c7e28a3988299dcb2817d6c33160d",name:"typing-input",size:"36",class:this.manager==="toolbox"?"activeIcon":"",onClick:()=>{this.manage.emit("toolbox");this.manager="toolbox"}}),h("ls-icon",{key:"fa0d54ab0996a3816eb0bfcc7c363f08735ebdb2",name:"user-group",size:"36",class:this.manager==="participant"?"activeIcon":"",onClick:()=>{this.manage.emit("participant");this.manager="participant"}}),h("slot",{key:"d8be0feee6199125d8755b66a41415a281e59811"}))}};LsFeatureColoumn.style=lsFeatureColumnCss;const lsFieldAlignmentCss=":host{display:inline-block;vertical-align:middle}button{display:inline-flex;background-color:transparent;min-width:24px;min-height:24px;border-radius:0.5rem;margin:0.25rem;width:27px;height:27px;justify-content:center;vertical-align:middle;border:0}button:hover{background-color:rgb(219, 219, 219)}";const LsFieldAlignment=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;alter(t){console.log(t);const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}right(){const t=this.dataItem.reduce(((t,e)=>e.left+e.width<t?t:e.left+e.width),0);console.log(t);const e=this.dataItem.map((e=>{const r=t-e.width;return{action:"update",data:{...e,left:r,ax:r,bx:r+e.width}}}));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}center(){const t=this.dataItem.reduce(((t,e)=>{console.log(t+(e.left+e.width/2));return t+(e.left+e.width/2)}),0);console.log(t);const e=t/this.dataItem.length;console.log("centerposition",e);const r=this.dataItem.map((t=>{const r=t.left+(e-(t.left+t.width/2));return{action:"update",data:{...t,left:r,ax:r,bx:r+t.width}}}));console.log(r);this.dataItem=r.map((t=>t.data));this.mutate.emit(r);this.update.emit(r)}top(){const t=this.dataItem.reduce(((t,e)=>e.top<t?t:e.top),0);this.alter({top:t})}left(){const t=this.dataItem.reduce(((t,e)=>e.left<t?e.left:t),this.dataItem[0].left);this.alter({left:t})}middle(){const t=this.dataItem.reduce(((t,e)=>{console.log(t+(e.top+e.height/2));return t+(e.top+e.height/2)}),0);const e=t/this.dataItem.length;const r=this.dataItem.map((t=>{const r=t.top+(e-(t.top+t.height/2));return{action:"update",data:{...t,top:r,ay:r,by:r+t.height}}}));this.dataItem=r.map((t=>t.data));this.mutate.emit(r);this.update.emit(r)}bottom(){const t=this.dataItem.reduce(((t,e)=>t>e.top+e.height?t:e.top+e.height),0);const e=this.dataItem.map((e=>{const r=t-e.height;return{action:"update",data:{...e,top:r,ay:r,by:r+e.height}}}));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}render(){return h(Host,{key:"a1de6bebd7aa25015b5d6891b6c61bda3bd16011"},h("div",{key:"9f2dd99bd6ebc7b605e47101c830ecbdfbd24641"},h("button",{key:"dcab63a0567dde0cd54fd81be729a263fea86a8d",onClick:()=>this.left(),class:"ls-round-button","aria-label":"Align selected fields vertically about their left edge.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"998fa6e15a29c7816f0b43924bb4e0663609109a",name:"field-alignment-left"})),h("button",{key:"4d83647c277e38deb0e271e6d29025d38baaaf3a",onClick:()=>this.center(),class:"ls-round-button","aria-label":"Align selected fields vertically about their centre.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"6aa90fce22792e031d9b868c5d1af2a332d99264",name:"field-alignment-centre"})),h("button",{key:"dce8bc883871937bc750a1967a733e141a51923f",onClick:()=>{this.right()},"aria-label":"Align selected fields vertically about their right edge.",class:"ls-round-button","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"c9d819e0a2b71e2b9cdc133114fdee15cac65807",name:"field-alignment-right"})),h("button",{key:"dd30c144e877fba3e55b5febbbcce282ce5b4f36",onClick:()=>this.top(),class:"ls-round-button","aria-label":"Align selected fields by their top.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"10be3c90695db9182b245ac0deee7b549d68728b",name:"field-alignment-top"})),h("button",{key:"8379fe058c20e6a6e7a38b5dacf2f2fe54767767",onClick:()=>this.middle(),class:"ls-round-button","aria-label":"Align selected fields by their middles.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"39cb5c2d0d50878dc46012590fab6c801064001e",name:"field-alignment-middle"})),h("button",{key:"2b2b7d4b14910b0b7405a72ca84b784436d3279b",onClick:()=>this.bottom(),class:"ls-round-button","aria-label":"Align selected fields by their bottoms.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"b8d043ebb45ebde2b458c80a2dc740311c3597d2",name:"field-alignment-bottom"}))),h("slot",{key:"6d8308e909e44447b868cc943858ec5f539ef644"}))}};LsFieldAlignment.style=lsFieldAlignmentCss;const lsFieldDimensionsCss=":host{display:block}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldDimensions=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;isSingle(t){return t.length===undefined}isMultiple(t){return typeof t.length==="number"}alter(t){console.log(t);if(this.isMultiple(this.dataItem)){const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}else{const e={action:"update",data:{...this.dataItem,...t}};this.dataItem=e.data;this.mutate.emit([e]);this.update.emit([e])}}render(){return h(Host,{key:"41458b8320c87c3f771a9a854e6e63bb90f598d9"},this.isMultiple(this.dataItem)&&h("div",{key:"0fe39be49300393e3e04c5ab0b1b7fbf2aba9e91",class:"ls-field-properties-section"},h("div",{key:"97d5f4502f6a33c42dcdfa7223f03dec0ed9c20f"},"Height: ",h("input",{key:"c6bbffba5356dcc5a30a9e372b107b975fb4a978",value:"",onChange:t=>this.alter({height:t.target.value}),width:"30"})),h("div",{key:"f87c1642300bbd48f276a3272bf39ce358774053"},"Width: ",h("input",{key:"82c911e73d3ecf061543bf746454cf304c255520",value:"",onChange:t=>this.alter({width:t.target.value}),width:"30"})),h("div",{key:"d4c9ded48c9a15bd5206aff3d3de813d952e632c"},"Top: ",h("input",{key:"c630505111a020a5ed32ba810a93e1d0eb4b3b61",value:"",onChange:t=>this.alter({top:t.target.value}),width:"30"})),h("div",{key:"51a7944b48838a24258505975700490a835e3d22"},"Left: ",h("input",{key:"1aabde21999546c090920cba9f9738614cbf6b6d",value:"",onChange:t=>this.alter({left:t.target.value}),width:"30"}))),this.isSingle(this.dataItem)&&h("div",{key:"62f9595ab77522c2d193531b78aeeb272fe5ae23",class:"ls-field-properties-section"},h("div",{key:"8c5d82f9e61ad4cba9c219d634e2df442a50098f"},"Height: ",h("input",{key:"0f045e5dc1fce3e86d312f085911bfa9970ab229",value:this.dataItem?.height,onChange:t=>this.alter({height:t.target.value}),width:"30"})),h("div",{key:"91626cc698e9d0b4daef997e13007f3f2a8acbdb"},"Width: ",h("input",{key:"cbf6faed034cabfaa6458d724c024643b33a344b",value:this.dataItem?.width,onChange:t=>this.alter({width:t.target.value}),width:"30"})),h("div",{key:"1216fc1ee08fc41b0ba8b09d8df23cfd2c0e9d49"},"Top: ",h("input",{key:"2071fae101442384f28885d8d68a409fc2932ec8",value:this.dataItem?.top,onChange:t=>this.alter({top:t.target.value}),width:"30"})),h("div",{key:"4a0351e88cf55bbaa872630dd24e64e4763b6679"},"Left: ",h("input",{key:"23e7033f18a899e31122fc67b09cbcef74e92098",value:this.dataItem?.left,onChange:t=>this.alter({left:t.target.value}),width:"30"}))))}};LsFieldDimensions.style=lsFieldDimensionsCss;const lsFieldDistributeCss=":host{display:inline-block;vertical-align:middle}button{display:inline-flex;background-color:transparent;min-width:24px;min-height:24px;border-radius:0.5rem;margin:0.25rem;width:27px;height:27px;justify-content:center;vertical-align:middle;border:0}button:hover{background-color:gray}.ls-toolbar-numeric{width:45px;max-height:18px;margin:0px;padding:0px}";const LsFieldDistribute=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;get component(){return getElement(this)}alter(t){console.log(t);const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}distributeHorizontal(){var t=this.component.shadowRoot.getElementById("ls-fix-horizontal-space");var e=0;const r=this.dataItem.sort(((t,e)=>t.left-e.left));if(t.value!==""){e=parseInt(t.value)}else{var i=0;for(var n=1;n<r.length;n++){const t=r[n-1];const e=r[n];i=i+(e.left-t.left-t.width<=0?0:e.left-t.left-t.width)}e=Math.floor(i/r.length)}var o=r[0].left;const s=r.map((t=>{const r=o;o=o+t.width+e;return{action:"update",data:{...t,left:r,ax:r,bx:r+t.width}}}));this.dataItem=s.map((t=>t.data));this.mutate.emit(s);this.update.emit(s)}distributeVertical(){var t=this.component.shadowRoot.getElementById("ls-fix-vertical-space");var e=0;const r=this.dataItem.sort(((t,e)=>t.top-e.top));if(t.value!=="")e=parseInt(t.value);else{var i=0;for(var n=1;n<r.length;n++){const t=r[n-1];const e=r[n];i=i+(e.top-t.top-t.height<=0?0:e.top-t.top-t.height)}e=Math.floor(i/r.length)}var o=r[0].top;const s=r.map((t=>{const r=o;o=o+t.height+e;return{action:"update",data:{...t,top:r,ay:r,by:r+t.height}}}));this.dataItem=s.map((t=>t.data));this.mutate.emit(s);this.update.emit(s)}render(){return h(Host,{key:"e34dae85e1ad46318881567b8295e4a5cecd8222"},h("div",{key:"0174acf02458bb7edfbb5a273208bae26213413f",class:"flex rounded-[10px] focus:outline-hidden focus:ring-4 focus:ring-offset-0 focus:ring-primary-30"},h("button",{key:"46455263311fa1ceaa24d95159b50190ece6b4d9",class:"ls-round-button",onClick:()=>{this.distributeHorizontal()},"aria-label":"Distribute selected fields horizontally.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Distribute selected fields horizontally.","data-tooltip-place":"top"},h("ls-icon",{key:"fcba8edda613a4f49fd28f0fbdde8be16847a59d",name:"field-distribute-horizontally"})),h("input",{key:"7369af7c27647ce8dfffc12fcbb4f25ce85590a3",type:"number",class:"ls-toolbar-numeric",id:"ls-fix-horizontal-space",value:"",size:4,min:0,max:9999}),h("button",{key:"3a6885343f04b8e38ae016440355c09b715c6600",onClick:()=>{this.distributeVertical()},class:"ls-round-button","aria-label":"Distribute selected fields vertically.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Distribute selected fields vertically.","data-tooltip-place":"top"},h("ls-icon",{key:"67cfe264bf0d8e03db9c47e999497708ec80e232",name:"field-distribute-vertically"})),h("input",{key:"7521df1e46b1c42ee0b67be3792e13a64ac33d67",type:"number",class:"ls-toolbar-numeric",id:"ls-fix-vertical-space",value:"",size:4,min:0,max:9999})),h("slot",{key:"3ed38b0cd5d436adf30e2eb1cd846d84986aade1"}))}};LsFieldDistribute.style=lsFieldDistributeCss;const lsFieldFormatCss=":host{display:flex;flex-direction:row}.ls-field-format-bar{display:flex;flex-direction:row}";const LsFieldFormat=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;get component(){return getElement(this)}alter(t){console.log(t);const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}render(){return h(Host,{key:"f7e1e01dd3519de4af0022ca839788f34622c0fe"},this.dataItem&&this.dataItem.length>1&&h("div",{key:"163d45e33489c20cfcfe100d1028bd462c7dab06",class:"ls-field-format-bar"},h("select",{key:"0bb51866dcac394ce70dff226088d2844837b32b",onChange:t=>{this.alter({fontName:t.target.value})}},h("option",{key:"a7e93b92114cfdfd595e76065dc072b7bb299bee",value:"arial"},"Arial"),h("option",{key:"c9d8c116fe38e2ec32c7b013f6fc3bc1c838520f",value:"liberation sans"},"Liberation Sans"),h("option",{key:"f36de6a494483f88cf82cd5d88c44be104c3daaf",value:"courier"},"Courier"),h("option",{key:"2ed6572a993ddd23746c858a57731cbdae4b4b1e",value:"helvetica"},"Helvetica"),h("option",{key:"5b9f95a6d02f6930ab7de9cb32fb605e8c18c639",value:"verdana"},"Verdana")),h("input",{key:"12f74056dce07d5ce41ed49f5c4c95fdbafe2382",width:"30",size:4}),h("select",{key:"a338fa91aa733ddba78c7df0d94e718f2f08445e"},h("option",{key:"d853cea035c0d5f70cd8879d13ee167a1ea5facb",value:"left"},"Left"),h("option",{key:"5a90a02f0b8257308ac6195ebed26849bc7d4fc9",value:"center"},"Center"),h("option",{key:"839dcb1c2bb6596a95c3272ea27b45f7162654cd",value:"right"},"Right"))),this.dataItem&&this.dataItem.length===1&&h("div",{key:"f91a4bb284252b4f94a7fe0361ebf04db53dc248",class:"ls-field-format-bar"},h("select",{key:"4cacd3c4864048da1b34fc301fa17d2f29f7cc6f",onChange:t=>{console.log(t.target.value)}},h("option",{key:"258b4d127ee30c3f84030007c721e7c8aae423ee",value:"arial"},"Arial"),h("option",{key:"ac6cc118d6485d1053c89b93193ca2eecca50447",value:"liberation sans"},"Liberation Sans"),h("option",{key:"8f243ec5c570276a127bcd31447fbf8594cd81b1",value:"courier"},"Courier"),h("option",{key:"074812fa4249944a00e12cae6c82cb4dfc790a7a",value:"helvetica"},"Helvetica"),h("option",{key:"45af76ec7273b9b64734e3f20c75bc684a7439c7",value:"verdana"},"Verdana")),h("input",{key:"5890944f1aa3581aa40f34b15cafef242e0a8484",width:"30",size:4,value:this.dataItem[0].fontSize}),h("select",{key:"716ffb6b12c307c95ddadcd9083858cc59e1555e"},h("option",{key:"a737e6d38809d624da52db3971c63e761a3f50ed",value:"left"},"Left"),h("option",{key:"62dffe46389bdf89c8ae703484956b13de4cd898",value:"center"},"Center"),h("option",{key:"63d6f9f019ca6936e38a99fe29627625d4ad0cfc",value:"right"},"Right"))))}};LsFieldFormat.style=lsFieldFormatCss;const lsFieldPropertiesCss=":host{display:block;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldProperties=class{constructor(t){registerInstance(this,t)}dataItem;renderFields(){if(this.dataItem&&this.dataItem?.length===1){switch(this.dataItem[0].formElementType){case"signature":return h("ls-field-properties-signature",{dataItem:this.dataItem[0]});case"date":return h("ls-field-properties-date",{dataItem:this.dataItem[0]});case"autodate":return h("ls-field-properties-date",{dataItem:this.dataItem[0]});case"text":return h("ls-field-properties-text",{dataItem:this.dataItem[0]});case"number":return h("ls-field-properties-number",{dataItem:this.dataItem[0]});default:return h("ls-field-properties-general",{dataItem:this.dataItem[0]})}}else if(this.dataItem&&this.dataItem?.length>1)return h("ls-field-properties-multiple",{dataItem:this.dataItem})}render(){return h(Host,{key:"5ec66a914aed5ab37a149a64e6ba32d981f0c93f"},this.dataItem&&this.renderFields(),h("slot",{key:"52af83caee54c5c3134d898fb7859ad58f82ccf5"}))}};LsFieldProperties.style=lsFieldPropertiesCss;const lsFieldPropertiesDateCss=":host{display:block}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldPropertiesDate=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"91b2aff43af5f14feeaca63bbc2321d86db5c3da"},h("div",{key:"59296fb97a9a63063f93a4ac75696e8caeb34dc6",class:"ls-field-properties-section"},"Date Field"),h("div",{key:"f2e720190a837f25554469ab1be43f8b7062ff17"},"Label: ",h("input",{key:"7fec61ff41be02aef43bca7213a0791b02e1e0bb",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"c5653214cabc48e06dead7e76e8560a7c595b302",dataItem:this.dataItem}),h("slot",{key:"6e007066ff5a828f9a57c58166b0f36219009f38"}))}};LsFieldPropertiesDate.style=lsFieldPropertiesDateCss;const lsFieldPropertiesGeneralCss=":host{display:block}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldPropertiesGeneral=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"e61fdbc0affab9b05cbda36bfced55fd62ed2f16"},h("div",{key:"ea65b3f69735e2a93882d8584f698ab066b3cd8b",class:"ls-field-properties-section"},"General Field"),h("div",{key:"e5df820b75aeb0a9d61c618ee040b6156382092c"},"Label: ",h("input",{key:"f4a1dbff82a379ba5eb78827b828ddc1a9612a54",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"24cf3a00d6128dd1e0810aa723f3c4d9afd3b6da",dataItem:this.dataItem}),h("slot",{key:"3ab91ac8574a5f93b33ab07b80ff9e13ba01aceb"}))}};LsFieldPropertiesGeneral.style=lsFieldPropertiesGeneralCss;const lsFieldPropertiesMultipleCss=":host{display:block}";const LsFieldPropertiesMultiple=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"0df0a3ec70677b65d31555b53c9578400b55914e"},h("div",{key:"8a83c0228fde21baba8400ff5d39776deac240d2"},this.dataItem.length," items"),h("ls-field-dimensions",{key:"39c4d89f90b3614761495fb8eab20507c97e3ae7",dataItem:this.dataItem}),h("slot",{key:"5033f4401374634a77d341ace837d00cdff009d5"}))}};LsFieldPropertiesMultiple.style=lsFieldPropertiesMultipleCss;const lsFieldPropertiesNumberCss=":host{display:block}";const LsFieldPropertiesNumber=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"0aaa2ed2233eeae3356d63b120c672d171f820ca"},h("div",{key:"4ebb3248ea59f50022c0d22567e42d8c9d3f6171",class:"ls-field-properties-section"},"Number Field"),h("div",{key:"34a1cf60306cab2ff6903011d1707784723a0126"},"Label: ",h("input",{key:"f3f307b7327c7ac50cd12a72bd17e83ae0e641fd",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"497e9ebaffe0dad411baf577d26b379436e379a0",dataItem:this.dataItem}),h("slot",{key:"142dc2b21baf7e673b6d14739166588bd4d4522f"}))}};LsFieldPropertiesNumber.style=lsFieldPropertiesNumberCss;const lsFieldPropertiesSignatureCss=":host{display:block}";const LsFieldPropertiesSignature=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"dc4a95045198437ce7220d044145a39b899e6b73"},h("ls-field-dimensions",{key:"431a9093a93818a80e3c1b8e9892399abae3e1cb",dataItem:this.dataItem}),h("slot",{key:"609e75d79941e4a4e92854a31042ec19df15fa47"}))}};LsFieldPropertiesSignature.style=lsFieldPropertiesSignatureCss;const lsFieldPropertiesTextCss=":host{display:block}";const LsFieldPropertiesText=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"064f87b73a2d50fcacc72832d5ca29d59316ffb1"},h("div",{key:"05f06007a2cfbcb9d30bc8c648ab020c8615497a",class:"ls-field-properties-section"},"Text Field"),h("div",{key:"0b8fdcda79ba6ab98a9e1164bb3203f2e68cbe0b"},"Label: ",h("input",{key:"75229d8d11fd65675150df01b5c2029e0a1c2009",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"70135cfeb573007f94d930990aeb3ad9efd2b816",dataItem:this.dataItem}),h("slot",{key:"a158525ef486e1e60283eed73634be7fb3d9e85b"}))}};LsFieldPropertiesText.style=lsFieldPropertiesTextCss;const lsFieldSizeCss=":host{display:inline-block}button{display:inline-flex;background-color:transparent;min-width:24px;min-height:24px;border-radius:0.5rem;margin:0.25rem;width:27px;height:27px;justify-content:center;vertical-align:middle;border:0}button:hover{background-color:rgb(219, 219, 219)}";const LsFieldSize=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;alter(t){const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}render(){return h(Host,{key:"0394ea5c55fdf6680ebf723c588333e4551f99ee"},h("div",{key:"e985d7ad03a96bec59d563a9ae39a06ec9dd27be",class:"flex rounded-[10px] focus:outline-hidden focus:ring-4 focus:ring-offset-0 focus:ring-primary-30"},h("button",{key:"cf4453e75fd169679715c010592ef60b6f7301dc","aria-label":"Make selected fields the same width as the first selected field.",class:"ls-round-button",onClick:()=>this.alter({width:this.dataItem[0].width}),"data-tooltip-id":"le-tooltip","data-tooltip-content":"Make selected fields the same width as the first selected field.","data-tooltip-place":"top"},h("svg",{key:"7bebe9b89820d8709a47fa536858cdb33b2abea6",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"5ae2c2a402295427600157dc92bb75e132f75693",d:"M14 9V6C14 5.44772 13.5523 5 13 5H11C10.4477 5 10 5.44772 10 6V9M14 15.0104V18C14 18.5523 13.5523 19 13 19H11C10.4477 19 10 18.5523 10 18V15.0104M6.00751 15.0104L4.00751 12M4.00751 12L6.00751 9M4.00751 12H20.0013M18.0013 15.0104L20.0013 12M20.0013 12L18.0013 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),h("button",{key:"f9375df61a69f0568de27cd4f4dc23f945c6add2",class:"ls-round-button",onClick:()=>this.alter({height:this.dataItem[0].height}),"aria-label":"Make selected fields the same height as the first selected field.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Make selected fields the same height as the first selected field.","data-tooltip-place":"top"},h("svg",{key:"31dcd7f385c184ec2730aaab08ddc6e85da479ca",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"dab2671aa531b492fcf47fde7c631c0d8d339797",d:"M9.00439 10.0042H6.00439C5.45211 10.0042 5.00439 10.4519 5.00439 11.0042V13.0042C5.00439 13.5565 5.45211 14.0042 6.00439 14.0042H9.00439M15.0148 10.0042H18.0044C18.5567 10.0042 19.0044 10.4519 19.0044 11.0042V13.0042C19.0044 13.5565 18.5567 14.0042 18.0044 14.0042H15.0148M15.0148 17.9967L12.0044 19.9967M12.0044 19.9967L9.00439 17.9968M12.0044 19.9967V4.00293M15.0148 6.00299L12.0044 4.00293M12.0044 4.00293L9.00439 6.00293",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),h("button",{key:"5a296dcd455c391deb56b4953a19a7e3c23f96e4",class:"ls-round-button",onClick:()=>this.alter({width:this.dataItem[0].width,height:this.dataItem[0].height}),"aria-label":"Make selected fields the same height and width as the first selected field.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Make selected fields the same height and width as the first selected field.","data-tooltip-place":"top"},h("svg",{key:"e1d8c0b27c9ca350b437b2a2b1513bd65becab88",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"68b64b0899019469946718ea545a76cc6c77ebad",d:"M4 8V4M4 4H8M4 4L8 8M20 8V4M20 4H16M20 4L16 8M4 16V20M4 20H8M4 20L8 16M20 16V20M20 20H16M20 20L16 16M8 8H10M8 8V10M16 8H14M16 8V10M8 16H10M8 16V14M16 16V14M16 16H14",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})))),h("slot",{key:"69b404acca8ec83463492386af516720273795c7"}))}};LsFieldSize.style=lsFieldSizeCss;const lsFormfieldCss="* {\n box-sizing: border-box;\n margin: 0;\n}\n\n.formfield-host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n width: 100%;\n}\n\n.formfield-top-elements {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0 0.125rem;\n}\n\n.formfield-left-side {\n display: flex;\n align-items: center;\n width: 100%;\n gap: 0.5rem;\n\n ls-icon {\n color: var(--gray-80, #787A80);\n }\n\n .formfield-label {\n color: var(--gray-100, #45484D);\n /* text-base/leading-6/font-medium */\n font-size: 1rem;\n font-style: normal;\n font-weight: 500;\n line-height: 1.5rem; /* 150% */\n }\n}\n\n.formfield-bottom-elements {\n position: relative;\n min-height: 1rem;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n height: fit-content;\n padding: 0 0.125rem;\n}\n\n.formfield-description-text {\n color: var(--Grey-80, #6C6E73);\n width: 100%;\n /* text-xs/leading-4/font-light */\n font-size: 0.75rem;\n font-style: normal;\n font-weight: 400;\n line-height: 1rem; /* 133.333% */\n}\n\n.formfield-error-text {\n color: var(--red-70, #DC2721);\n width: 100%;\n /* text-xs/leading-4/font-light */\n font-size: 0.75rem;\n font-style: normal;\n font-weight: 400;\n line-height: 1rem; /* 133.333% */\n}\n\n.formfield-count-container {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n gap: 0.125rem;\n align-items: center;\n font-size: 0.75rem;\n font-style: normal;\n font-weight: 400;\n line-height: 1rem; /* 133.333% */\n text-align: right;\n}\n\n.formfield-count {\n display: flex;\n align-items: center;\n color: var(--Grey-70, #6C6E73);\n gap: 0.125rem;\n}\n\n.formfield-count-error {\n display: flex;\n align-items: center;\n gap: 0.125rem;\n color: var(--red-70, #DC2721);\n}\n\n\n";const LsFormfield=class{constructor(t){registerInstance(this,t)}name;fieldId;label;as="text";value;placeholder;descriptionText;errorText;aria;inputRef;infoTooltipText;hoverTooltipText;disabled;extraLabel="none";required;valid;dirty;count;countMax;buttonClick;buttonIcon;labelIcon;fieldIcon;_value;valueWatcher(t){this._value=t}componentWillLoad(){this.valueWatcher(this?.value?.toString())}handleChange=t=>{const e=t.target;this.value=e.value};render(){const{name:t,fieldId:e,label:r,as:i,value:n,placeholder:o,descriptionText:s,errorText:a,aria:l,infoTooltipText:u,disabled:d,extraLabel:c,valid:f,dirty:v,count:C,countMax:g,buttonClick:p,buttonIcon:w,fieldIcon:m,labelIcon:b}=this;const M=n&&n.toString().length>g?"formfield-count-error":"formfield-count";return h("host",{key:"7c9e146aaa8885dfcf882d1e8d8c6661aba5aa7d",class:"formfield-host"},h("div",{key:"2c27f1279cfd30059a9f25e28dda56a1d9fb4f54",class:"formfield-top-elements"},h("div",{key:"8eeeb49e83f12069a64cba1dcccb2a76c731b2f5",class:"formfield-left-side"},b&&h("ls-icon",{key:"2615de185e959d526b41d307a134bec0d199e498",name:b}),h("label",{key:"464a7e0d9156fbbd67cf8c889378a3bb30c2cf02",htmlFor:t,class:"formfield-label"},r),u&&h("ls-icon",{key:"9dc3d844acd6806d2038c6a633280923421497a0",name:"information-circle"})),c==="optional"?h("ls-label",{text:"Optional",colour:"gray",type:"low"}):c==="required"?h("ls-label",{text:"Required",colour:"gray",type:"low"}):""),i==="text"?h("ls-text-input",{id:e,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m,onInput:t=>this.handleChange(t)}):i==="select"?h("ls-select-input",{id:t,name:t,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m},h("slot",null)):i==="radio"?h("ls-radio-input",{radioId:r,label:n?.toString(),icon:m,name:t,disabled:d}):i==="textarea"?h("ls-textarea-input",{id:t,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):i==="password"?h("ls-text-input",{type:"password",id:t,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):i==="displayonly"?h("ls-text-input",{type:"displayonly",id:t,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):i==="number"?h("ls-number-input",{type:"ls",id:t,name:t,value:Number(n),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):h("p",null,"placeholder"),h("div",{key:"ac6d1c32a100561c3a92cc7586ba7649ff5665c2",class:"formfield-bottom-elements"},a&&!f?h("p",{class:"formfield-error-text"},a):s?h("p",{class:"formfield-description-text"},s):"",C&&h("div",{key:"cbb11974083e7ab0aa70af47366af2a5a9fc64e4",class:"formfield-count-container"},h("p",{key:"883bd413b5eba25ae7a840c3b6471cf25eb5dbc2",class:M},n?.toString()?.length),g>0&&h("div",{key:"2b0b4deaf7c7a0f83e686aeec95c061406191b2d",class:M},h("p",{key:"f951ad9253b769d89eb9965cd79969dd578acfe7"},"/"),h("p",{key:"750364651c6d92335b034930d8be1a81d38ceaf2"},g)))))}static get watchers(){return{value:["valueWatcher"]}}};LsFormfield.style=lsFormfieldCss;const html=String.raw;const icons=[{name:"mail",svgSolid:html`<svg
57
+ */var pdf_viewer=pdf_viewer$1.exports;var hasRequiredPdf_viewer;function requirePdf_viewer(){if(hasRequiredPdf_viewer)return pdf_viewer$1.exports;hasRequiredPdf_viewer=1;(function(t,e){(function e(r,i){t.exports=i()})(pdf_viewer,(function(){return function(t){var e={};function r(i){if(e[i]){return e[i].exports}var n=e[i]={i,l:false,exports:{}};t[i].call(n.exports,n,n.exports,r);n.l=true;return n.exports}r.m=t;r.c=e;r.d=function(t,e,i){if(!r.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:i})}};r.r=function(t){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})};r.t=function(t,e){if(e&1)t=r(t);if(e&8)return t;if(e&4&&typeof t==="object"&&t&&t.__esModule)return t;var i=Object.create(null);r.r(i);Object.defineProperty(i,"default",{enumerable:true,value:t});if(e&2&&typeof t!="string")for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i};r.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};r.d(e,"a",e);return e};r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};r.p="";return r(r.s=0)}([function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});Object.defineProperty(e,"AnnotationLayerBuilder",{enumerable:true,get:function(){return i.AnnotationLayerBuilder}});Object.defineProperty(e,"DefaultAnnotationLayerFactory",{enumerable:true,get:function(){return i.DefaultAnnotationLayerFactory}});Object.defineProperty(e,"DefaultTextLayerFactory",{enumerable:true,get:function(){return n.DefaultTextLayerFactory}});Object.defineProperty(e,"TextLayerBuilder",{enumerable:true,get:function(){return n.TextLayerBuilder}});Object.defineProperty(e,"EventBus",{enumerable:true,get:function(){return o.EventBus}});Object.defineProperty(e,"NullL10n",{enumerable:true,get:function(){return o.NullL10n}});Object.defineProperty(e,"ProgressBar",{enumerable:true,get:function(){return o.ProgressBar}});Object.defineProperty(e,"PDFLinkService",{enumerable:true,get:function(){return s.PDFLinkService}});Object.defineProperty(e,"SimpleLinkService",{enumerable:true,get:function(){return s.SimpleLinkService}});Object.defineProperty(e,"DownloadManager",{enumerable:true,get:function(){return a.DownloadManager}});Object.defineProperty(e,"GenericL10n",{enumerable:true,get:function(){return l.GenericL10n}});Object.defineProperty(e,"PDFFindController",{enumerable:true,get:function(){return h.PDFFindController}});Object.defineProperty(e,"PDFHistory",{enumerable:true,get:function(){return u.PDFHistory}});Object.defineProperty(e,"PDFPageView",{enumerable:true,get:function(){return d.PDFPageView}});Object.defineProperty(e,"PDFSinglePageViewer",{enumerable:true,get:function(){return c.PDFSinglePageViewer}});Object.defineProperty(e,"PDFViewer",{enumerable:true,get:function(){return f.PDFViewer}});var i=r(1);var n=r(5);var o=r(3);var s=r(4);var a=r(6);var l=r(8);var h=r(10);var u=r(12);var d=r(13);var c=r(15);var f=r(17)},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.DefaultAnnotationLayerFactory=e.AnnotationLayerBuilder=void 0;var i=r(2);var n=r(3);var o=r(4);class s{constructor({pageDiv:t,pdfPage:e,linkService:r,downloadManager:i,imageResourcesPath:o="",renderInteractiveForms:s=false,l10n:a=n.NullL10n}){this.pageDiv=t;this.pdfPage=e;this.linkService=r;this.downloadManager=i;this.imageResourcesPath=o;this.renderInteractiveForms=s;this.l10n=a;this.div=null;this._cancelled=false}render(t,e="display"){this.pdfPage.getAnnotations({intent:e}).then((e=>{if(this._cancelled){return}const r={viewport:t.clone({dontFlip:true}),div:this.div,annotations:e,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,linkService:this.linkService,downloadManager:this.downloadManager};if(this.div){i.AnnotationLayer.update(r)}else{if(e.length===0){return}this.div=document.createElement("div");this.div.className="annotationLayer";this.pageDiv.appendChild(this.div);r.div=this.div;i.AnnotationLayer.render(r);this.l10n.translate(this.div)}}))}cancel(){this._cancelled=true}hide(){if(!this.div){return}this.div.setAttribute("hidden","true")}}e.AnnotationLayerBuilder=s;class a{createAnnotationLayerBuilder(t,e,r="",i=false,a=n.NullL10n){return new s({pageDiv:t,pdfPage:e,imageResourcesPath:r,renderInteractiveForms:i,linkService:new o.SimpleLinkService,l10n:a})}}e.DefaultAnnotationLayerFactory=a},function(t,e,r){let i;if(typeof window!=="undefined"&&window["pdfjs-dist/build/pdf"]){i=window["pdfjs-dist/build/pdf"]}else{i=requirePdf()}t.exports=i},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.isValidRotation=O;e.isValidScrollMode=N;e.isValidSpreadMode=T;e.isPortraitOrientation=I;e.clamp=U;e.getPDFFileNameFromURL=S;e.noContextMenuHandler=D;e.parseQueryString=k;e.backtrackBeforeAllVisibleElements=V;e.getVisibleElements=P;e.roundToDivide=H;e.getPageSizeInches=F;e.approximateFraction=L;e.getOutputScale=b;e.scrollIntoView=M;e.watchScroll=x;e.binarySearchFirstItem=y;e.normalizeWheelEventDelta=Z;e.waitOnEventOrTimeout=R;e.moveToEndOfArray=G;e.WaitOnType=e.animationStarted=e.ProgressBar=e.EventBus=e.NullL10n=e.SpreadMode=e.ScrollMode=e.TextLayerMode=e.RendererType=e.PresentationModeState=e.VERTICAL_PADDING=e.SCROLLBAR_PADDING=e.MAX_AUTO_SCALE=e.UNKNOWN_SCALE=e.MAX_SCALE=e.MIN_SCALE=e.DEFAULT_SCALE=e.DEFAULT_SCALE_VALUE=e.CSS_UNITS=e.AutoPrintRegExp=void 0;const i=96/72;e.CSS_UNITS=i;const n="auto";e.DEFAULT_SCALE_VALUE=n;const o=1;e.DEFAULT_SCALE=o;const s=.1;e.MIN_SCALE=s;const a=10;e.MAX_SCALE=a;const l=0;e.UNKNOWN_SCALE=l;const h=1.25;e.MAX_AUTO_SCALE=h;const u=40;e.SCROLLBAR_PADDING=u;const d=5;e.VERTICAL_PADDING=d;const c={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};e.PresentationModeState=c;const f={CANVAS:"canvas",SVG:"svg"};e.RendererType=f;const v={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};e.TextLayerMode=v;const C={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};e.ScrollMode=C;const g={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};e.SpreadMode=g;const p=/\bprint\s*\(/;e.AutoPrintRegExp=p;function w(t,e){if(!e){return t}return t.replace(/\{\{\s*(\w+)\s*\}\}/g,((t,r)=>r in e?e[r]:"{{"+r+"}}"))}const m={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(t,e,r){return w(r,e)},async translate(t){}};e.NullL10n=m;function b(t){const e=window.devicePixelRatio||1;const r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;const i=e/r;return{sx:i,sy:i,scaled:i!==1}}function M(t,e,r=false){let i=t.offsetParent;if(!i){console.error("offsetParent is not set -- cannot scroll");return}let n=t.offsetTop+t.clientTop;let o=t.offsetLeft+t.clientLeft;while(i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||r&&getComputedStyle(i).overflow==="hidden"){if(i.dataset._scaleY){n/=i.dataset._scaleY;o/=i.dataset._scaleX}n+=i.offsetTop;o+=i.offsetLeft;i=i.offsetParent;if(!i){return}}if(e){if(e.top!==undefined){n+=e.top}if(e.left!==undefined){o+=e.left;i.scrollLeft=o}}i.scrollTop=n}function x(t,e){const r=function(r){if(n){return}n=window.requestAnimationFrame((function r(){n=null;const o=t.scrollLeft;const s=i.lastX;if(o!==s){i.right=o>s}i.lastX=o;const a=t.scrollTop;const l=i.lastY;if(a!==l){i.down=a>l}i.lastY=a;e(i)}))};const i={right:true,down:true,lastX:t.scrollLeft,lastY:t.scrollTop,_eventHandler:r};let n=null;t.addEventListener("scroll",r,true);return i}function k(t){const e=t.split("&");const r=Object.create(null);for(let t=0,i=e.length;t<i;++t){const i=e[t].split("=");const n=i[0].toLowerCase();const o=i.length>1?i[1]:null;r[decodeURIComponent(n)]=decodeURIComponent(o)}return r}function y(t,e){let r=0;let i=t.length-1;if(i<0||!e(t[i])){return t.length}if(e(t[r])){return r}while(r<i){const n=r+i>>1;const o=t[n];if(e(o)){i=n}else{r=n+1}}return r}function L(t){if(Math.floor(t)===t){return[t,1]}const e=1/t;const r=8;if(e>r){return[1,r]}else if(Math.floor(e)===e){return[1,e]}const i=t>1?e:t;let n=0,o=1,s=1,a=1;while(true){const t=n+s,e=o+a;if(e>r){break}if(i<=t/e){s=t;a=e}else{n=t;o=e}}let l;if(i-n/o<s/a-i){l=i===t?[n,o]:[o,n]}else{l=i===t?[s,a]:[a,s]}return l}function H(t,e){const r=t%e;return r===0?t:Math.round(t-r+e)}function F({view:t,userUnit:e,rotate:r}){const[i,n,o,s]=t;const a=r%180!==0;const l=(o-i)/72*e;const h=(s-n)/72*e;return{width:a?h:l,height:a?l:h}}function V(t,e,r){if(t<2){return t}let i=e[t].div;let n=i.offsetTop+i.clientTop;if(n>=r){i=e[t-1].div;n=i.offsetTop+i.clientTop}for(let r=t-2;r>=0;--r){i=e[r].div;if(i.offsetTop+i.clientTop+i.clientHeight<=n){break}t=r}return t}function P(t,e,r=false,i=false){const n=t.scrollTop,o=n+t.clientHeight;const s=t.scrollLeft,a=s+t.clientWidth;function l(t){const e=t.div;const r=e.offsetTop+e.clientTop+e.clientHeight;return r>n}function h(t){const e=t.div;const r=e.offsetLeft+e.clientLeft+e.clientWidth;return r>s}const u=[],d=e.length;let c=d===0?0:y(e,i?h:l);if(c>0&&c<d&&!i){c=V(c,e,n)}let f=i?a:-1;for(let t=c;t<d;t++){const r=e[t],l=r.div;const h=l.offsetLeft+l.clientLeft;const d=l.offsetTop+l.clientTop;const c=l.clientWidth,v=l.clientHeight;const C=h+c;const g=d+v;if(f===-1){if(g>=o){f=g}}else if((i?h:d)>f){break}if(g<=n||d>=o||C<=s||h>=a){continue}const p=Math.max(0,n-d)+Math.max(0,g-o);const w=Math.max(0,s-h)+Math.max(0,C-a);const m=(v-p)*(c-w)*100/v/c|0;u.push({id:r.id,x:h,y:d,view:r,percent:m})}const v=u[0],C=u[u.length-1];if(r){u.sort((function(t,e){const r=t.percent-e.percent;if(Math.abs(r)>.001){return-r}return t.id-e.id}))}return{first:v,last:C,views:u}}function D(t){t.preventDefault()}function A(t){let e=0;const r=t.length;while(e<r&&t[e].trim()===""){e++}return t.substring(e,e+5).toLowerCase()==="data:"}function S(t,e="document.pdf"){if(typeof t!=="string"){return e}if(A(t)){console.warn("getPDFFileNameFromURL: "+'ignoring "data:" URL for performance reasons.');return e}const r=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;const i=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i;const n=r.exec(t);let o=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(o){o=o[0];if(o.includes("%")){try{o=i.exec(decodeURIComponent(o))[0]}catch(t){}}}return o||e}function Z(t){let e=Math.sqrt(t.deltaX*t.deltaX+t.deltaY*t.deltaY);const r=Math.atan2(t.deltaY,t.deltaX);if(-.25*Math.PI<r&&r<.75*Math.PI){e=-e}const i=0;const n=1;const o=30;const s=30;if(t.deltaMode===i){e/=o*s}else if(t.deltaMode===n){e/=s}return e}function O(t){return Number.isInteger(t)&&t%90===0}function N(t){return Number.isInteger(t)&&Object.values(C).includes(t)&&t!==C.UNKNOWN}function T(t){return Number.isInteger(t)&&Object.values(g).includes(t)&&t!==g.UNKNOWN}function I(t){return t.width<=t.height}const E={EVENT:"event",TIMEOUT:"timeout"};e.WaitOnType=E;function R({target:t,name:e,delay:r=0}){return new Promise((function(i,n){if(typeof t!=="object"||!(e&&typeof e==="string")||!(Number.isInteger(r)&&r>=0)){throw new Error("waitOnEventOrTimeout - invalid parameters.")}function o(r){if(t instanceof j){t._off(e,s)}else{t.removeEventListener(e,s)}if(l){clearTimeout(l)}i(r)}const s=o.bind(null,E.EVENT);if(t instanceof j){t._on(e,s)}else{t.addEventListener(e,s)}const a=o.bind(null,E.TIMEOUT);const l=setTimeout(a,r)}))}const B=new Promise((function(t){window.requestAnimationFrame(t)}));e.animationStarted=B;class j{constructor(t){this._listeners=Object.create(null)}on(t,e){this._on(t,e,{external:true})}off(t,e){this._off(t,e,{external:true})}dispatch(t){const e=this._listeners[t];if(!e||e.length===0){return}const r=Array.prototype.slice.call(arguments,1);let i;e.slice(0).forEach((function({listener:t,external:e}){if(e){if(!i){i=[]}i.push(t);return}t.apply(null,r)}));if(i){i.forEach((function(t){t.apply(null,r)}));i=null}}_on(t,e,r=null){let i=this._listeners[t];if(!i){this._listeners[t]=i=[]}i.push({listener:e,external:(r&&r.external)===true})}_off(t,e,r=null){const i=this._listeners[t];if(!i){return}for(let t=0,r=i.length;t<r;t++){if(i[t].listener===e){i.splice(t,1);return}}}}e.EventBus=j;function U(t,e,r){return Math.min(Math.max(t,e),r)}class q{constructor(t,{height:e,width:r,units:i}={}){this.visible=true;this.div=document.querySelector(t+" .progress");this.bar=this.div.parentNode;this.height=e||100;this.width=r||100;this.units=i||"%";this.div.style.height=this.height+this.units;this.percent=0}_updateBar(){if(this._indeterminate){this.div.classList.add("indeterminate");this.div.style.width=this.width+this.units;return}this.div.classList.remove("indeterminate");const t=this.width*this._percent/100;this.div.style.width=t+this.units}get percent(){return this._percent}set percent(t){this._indeterminate=isNaN(t);this._percent=U(t,0,100);this._updateBar()}setWidth(t){if(!t){return}const e=t.parentNode;const r=e.offsetWidth-t.offsetWidth;if(r>0){this.bar.style.width=`calc(100% - ${r}px)`}}hide(){if(!this.visible){return}this.visible=false;this.bar.classList.add("hidden");document.body.classList.remove("loadingInProgress")}show(){if(this.visible){return}this.visible=true;document.body.classList.add("loadingInProgress");this.bar.classList.remove("hidden")}}e.ProgressBar=q;function G(t,e){const r=[],i=t.length;let n=0;for(let o=0;o<i;++o){if(e(t[o])){r.push(t[o])}else{t[n]=t[o];++n}}for(let e=0;n<i;++e,++n){t[n]=r[e]}}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.SimpleLinkService=e.PDFLinkService=void 0;var i=r(3);class n{constructor({eventBus:t,externalLinkTarget:e=null,externalLinkRel:r=null,externalLinkEnabled:i=true,ignoreDestinationZoom:n=false}={}){this.eventBus=t;this.externalLinkTarget=e;this.externalLinkRel=r;this.externalLinkEnabled=i;this._ignoreDestinationZoom=n;this.baseUrl=null;this.pdfDocument=null;this.pdfViewer=null;this.pdfHistory=null;this._pagesRefCache=null}setDocument(t,e=null){this.baseUrl=e;this.pdfDocument=t;this._pagesRefCache=Object.create(null)}setViewer(t){this.pdfViewer=t}setHistory(t){this.pdfHistory=t}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(t){this.pdfViewer.currentPageNumber=t}get rotation(){return this.pdfViewer.pagesRotation}set rotation(t){this.pdfViewer.pagesRotation=t}navigateTo(t){const e=({namedDest:r,explicitDest:i})=>{const n=i[0];let o;if(n instanceof Object){o=this._cachedPageNumber(n);if(o===null){this.pdfDocument.getPageIndex(n).then((t=>{this.cachePageRef(t+1,n);e({namedDest:r,explicitDest:i})})).catch((()=>{console.error(`PDFLinkService.navigateTo: "${n}" is not `+`a valid page reference, for dest="${t}".`)}));return}}else if(Number.isInteger(n)){o=n+1}else{console.error(`PDFLinkService.navigateTo: "${n}" is not `+`a valid destination reference, for dest="${t}".`);return}if(!o||o<1||o>this.pagesCount){console.error(`PDFLinkService.navigateTo: "${o}" is not `+`a valid page number, for dest="${t}".`);return}if(this.pdfHistory){this.pdfHistory.pushCurrentPosition();this.pdfHistory.push({namedDest:r,explicitDest:i,pageNumber:o})}this.pdfViewer.scrollPageIntoView({pageNumber:o,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom})};new Promise(((e,r)=>{if(typeof t==="string"){this.pdfDocument.getDestination(t).then((r=>{e({namedDest:t,explicitDest:r})}));return}e({namedDest:"",explicitDest:t})})).then((r=>{if(!Array.isArray(r.explicitDest)){console.error(`PDFLinkService.navigateTo: "${r.explicitDest}" is`+` not a valid destination array, for dest="${t}".`);return}e(r)}))}getDestinationHash(t){if(typeof t==="string"){return this.getAnchorUrl("#"+escape(t))}if(Array.isArray(t)){const e=JSON.stringify(t);return this.getAnchorUrl("#"+escape(e))}return this.getAnchorUrl("")}getAnchorUrl(t){return(this.baseUrl||"")+t}setHash(t){let e,r;if(t.includes("=")){const n=(0,i.parseQueryString)(t);if("search"in n){this.eventBus.dispatch("findfromurlhash",{source:this,query:n.search.replace(/"/g,""),phraseSearch:n.phrase==="true"})}if("page"in n){e=n.page|0||1}if("zoom"in n){const t=n.zoom.split(",");const e=t[0];const i=parseFloat(e);if(!e.includes("Fit")){r=[null,{name:"XYZ"},t.length>1?t[1]|0:null,t.length>2?t[2]|0:null,i?i/100:e]}else{if(e==="Fit"||e==="FitB"){r=[null,{name:e}]}else if(e==="FitH"||e==="FitBH"||e==="FitV"||e==="FitBV"){r=[null,{name:e},t.length>1?t[1]|0:null]}else if(e==="FitR"){if(t.length!==5){console.error('PDFLinkService.setHash: Not enough parameters for "FitR".')}else{r=[null,{name:e},t[1]|0,t[2]|0,t[3]|0,t[4]|0]}}else{console.error(`PDFLinkService.setHash: "${e}" is not `+"a valid zoom value.")}}}if(r){this.pdfViewer.scrollPageIntoView({pageNumber:e||this.page,destArray:r,allowNegativeOffset:true})}else if(e){this.page=e}if("pagemode"in n){this.eventBus.dispatch("pagemode",{source:this,mode:n.pagemode})}if("nameddest"in n){this.navigateTo(n.nameddest)}}else{r=unescape(t);try{r=JSON.parse(r);if(!Array.isArray(r)){r=r.toString()}}catch(t){}if(typeof r==="string"||o(r)){this.navigateTo(r);return}console.error(`PDFLinkService.setHash: "${unescape(t)}" is not `+"a valid destination.")}}executeNamedAction(t){switch(t){case"GoBack":if(this.pdfHistory){this.pdfHistory.back()}break;case"GoForward":if(this.pdfHistory){this.pdfHistory.forward()}break;case"NextPage":if(this.page<this.pagesCount){this.page++}break;case"PrevPage":if(this.page>1){this.page--}break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:t})}cachePageRef(t,e){if(!e){return}const r=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;this._pagesRefCache[r]=t}_cachedPageNumber(t){const e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this._pagesRefCache&&this._pagesRefCache[e]||null}isPageVisible(t){return this.pdfViewer.isPageVisible(t)}}e.PDFLinkService=n;function o(t){if(!Array.isArray(t)){return false}const e=t.length;if(e<2){return false}const r=t[0];if(!(typeof r==="object"&&Number.isInteger(r.num)&&Number.isInteger(r.gen))&&!(Number.isInteger(r)&&r>=0)){return false}const i=t[1];if(!(typeof i==="object"&&typeof i.name==="string")){return false}let n=true;switch(i.name){case"XYZ":if(e!==5){return false}break;case"Fit":case"FitB":return e===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(e!==3){return false}break;case"FitR":if(e!==6){return false}n=false;break;default:return false}for(let r=2;r<e;r++){const e=t[r];if(!(typeof e==="number"||n&&e===null)){return false}}return true}class s{constructor(){this.externalLinkTarget=null;this.externalLinkRel=null;this.externalLinkEnabled=true;this._ignoreDestinationZoom=false}get pagesCount(){return 0}get page(){return 0}set page(t){}get rotation(){return 0}set rotation(t){}navigateTo(t){}getDestinationHash(t){return"#"}getAnchorUrl(t){return"#"}setHash(t){}executeNamedAction(t){}cachePageRef(t,e){}isPageVisible(t){return true}}e.SimpleLinkService=s},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.DefaultTextLayerFactory=e.TextLayerBuilder=void 0;var i=r(2);const n=300;class o{constructor({textLayerDiv:t,eventBus:e,pageIndex:r,viewport:i,findController:n=null,enhanceTextSelection:o=false}){this.textLayerDiv=t;this.eventBus=e;this.textContent=null;this.textContentItemsStr=[];this.textContentStream=null;this.renderingDone=false;this.pageIdx=r;this.pageNumber=this.pageIdx+1;this.matches=[];this.viewport=i;this.textDivs=[];this.findController=n;this.textLayerRenderTask=null;this.enhanceTextSelection=o;this._onUpdateTextLayerMatches=null;this._bindMouse()}_finishRendering(){this.renderingDone=true;if(!this.enhanceTextSelection){const t=document.createElement("div");t.className="endOfContent";this.textLayerDiv.appendChild(t)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(t=0){if(!(this.textContent||this.textContentStream)||this.renderingDone){return}this.cancel();this.textDivs=[];const e=document.createDocumentFragment();this.textLayerRenderTask=(0,i.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:e,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:t,enhanceTextSelection:this.enhanceTextSelection});this.textLayerRenderTask.promise.then((()=>{this.textLayerDiv.appendChild(e);this._finishRendering();this._updateMatches()}),(function(t){}));if(!this._onUpdateTextLayerMatches){this._onUpdateTextLayerMatches=t=>{if(t.pageIndex===this.pageIdx||t.pageIndex===-1){this._updateMatches()}};this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)}}cancel(){if(this.textLayerRenderTask){this.textLayerRenderTask.cancel();this.textLayerRenderTask=null}if(this._onUpdateTextLayerMatches){this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches);this._onUpdateTextLayerMatches=null}}setTextContentStream(t){this.cancel();this.textContentStream=t}setTextContent(t){this.cancel();this.textContent=t}_convertMatches(t,e){if(!t){return[]}const{findController:r,textContentItemsStr:i}=this;let n=0,o=0;const s=i.length-1;const a=r.state.query.length;const l=[];for(let r=0,h=t.length;r<h;r++){let h=t[r];while(n!==s&&h>=o+i[n].length){o+=i[n].length;n++}if(n===i.length){console.error("Could not find a matching mapping")}const u={begin:{divIdx:n,offset:h-o}};if(e){h+=e[r]}else{h+=a}while(n!==s&&h>o+i[n].length){o+=i[n].length;n++}u.end={divIdx:n,offset:h-o};l.push(u)}return l}_renderMatches(t){if(t.length===0){return}const{findController:e,pageIdx:r,textContentItemsStr:i,textDivs:n}=this;const o=r===e.selected.pageIdx;const s=e.selected.matchIdx;const a=e.state.highlightAll;let l=null;const h={offset:undefined};function u(t,e){const r=t.divIdx;n[r].textContent="";d(r,0,t.offset,e)}function d(t,e,r,o){const s=n[t];const a=i[t].substring(e,r);const l=document.createTextNode(a);if(o){const t=document.createElement("span");t.className=o;t.appendChild(l);s.appendChild(t);return}s.appendChild(l)}let c=s,f=c+1;if(a){c=0;f=t.length}else if(!o){return}for(let i=c;i<f;i++){const a=t[i];const c=a.begin;const f=a.end;const v=o&&i===s;const C=v?" selected":"";if(v){e.scrollMatchIntoView({element:n[c.divIdx],pageIndex:r,matchIndex:s})}if(!l||c.divIdx!==l.divIdx){if(l!==null){d(l.divIdx,l.offset,h.offset)}u(c)}else{d(l.divIdx,l.offset,c.offset)}if(c.divIdx===f.divIdx){d(c.divIdx,c.offset,f.offset,"highlight"+C)}else{d(c.divIdx,c.offset,h.offset,"highlight begin"+C);for(let t=c.divIdx+1,e=f.divIdx;t<e;t++){n[t].className="highlight middle"+C}u(f,"highlight end"+C)}l=f}if(l){d(l.divIdx,l.offset,h.offset)}}_updateMatches(){if(!this.renderingDone){return}const{findController:t,matches:e,pageIdx:r,textContentItemsStr:i,textDivs:n}=this;let o=-1;for(let t=0,r=e.length;t<r;t++){const r=e[t];const s=Math.max(o,r.begin.divIdx);for(let t=s,e=r.end.divIdx;t<=e;t++){const e=n[t];e.textContent=i[t];e.className=""}o=r.end.divIdx+1}if(!t||!t.highlightMatches){return}const s=t.pageMatches[r]||null;const a=t.pageMatchesLength[r]||null;this.matches=this._convertMatches(s,a);this._renderMatches(this.matches)}_bindMouse(){const t=this.textLayerDiv;let e=null;t.addEventListener("mousedown",(r=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(true);if(e){clearTimeout(e);e=null}return}const i=t.querySelector(".endOfContent");if(!i){return}let n=r.target!==t;n=n&&window.getComputedStyle(i).getPropertyValue("-moz-user-select")!=="none";if(n){const e=t.getBoundingClientRect();const n=Math.max(0,(r.pageY-e.top)/e.height);i.style.top=(n*100).toFixed(2)+"%"}i.classList.add("active")}));t.addEventListener("mouseup",(()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){e=setTimeout((()=>{if(this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(false)}e=null}),n);return}const r=t.querySelector(".endOfContent");if(!r){return}r.style.top="";r.classList.remove("active")}))}}e.TextLayerBuilder=o;class s{createTextLayerBuilder(t,e,r,i=false,n){return new o({textLayerDiv:t,pageIndex:e,viewport:r,enhanceTextSelection:i,eventBus:n})}}e.DefaultTextLayerFactory=s},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.DownloadManager=void 0;var i=r(2);var n=r(7);const o=n.viewerCompatibilityParams.disableCreateObjectURL||false;function s(t,e){const r=document.createElement("a");if(!r.click){throw new Error('DownloadManager: "a.click()" is not supported.')}r.href=t;r.target="_parent";if("download"in r){r.download=e}(document.body||document.documentElement).appendChild(r);r.click();r.remove()}class a{constructor({disableCreateObjectURL:t=o}){this.disableCreateObjectURL=t}downloadUrl(t,e){if(!(0,i.createValidAbsoluteUrl)(t,"http://example.com")){return}s(t+"#pdfjs.action=download",e)}downloadData(t,e,r){if(navigator.msSaveBlob){navigator.msSaveBlob(new Blob([t],{type:r}),e);return}const n=(0,i.createObjectURL)(t,r,this.disableCreateObjectURL);s(n,e)}download(t,e,r){if(navigator.msSaveBlob){if(!navigator.msSaveBlob(t,r)){this.downloadUrl(e,r)}return}if(this.disableCreateObjectURL){this.downloadUrl(e,r);return}const i=URL.createObjectURL(t);s(i,r)}}e.DownloadManager=a},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.viewerCompatibilityParams=void 0;const i=Object.create(null);{const t=typeof navigator!=="undefined"&&navigator.userAgent||"";const e=typeof navigator!=="undefined"&&navigator.platform||"";const r=typeof navigator!=="undefined"&&navigator.maxTouchPoints||1;const n=/Android/.test(t);const o=/Trident/.test(t);const s=/\b(iPad|iPhone|iPod)(?=;)/.test(t)||e==="MacIntel"&&r>1;const a=/CriOS/.test(t);(function t(){if(o||a){i.disableCreateObjectURL=true}})();(function t(){if(s||n){i.maxCanvasPixels=5242880}})()}const n=Object.freeze(i);e.viewerCompatibilityParams=n},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.GenericL10n=void 0;r(9);const i=document.webL10n;class n{constructor(t){this._lang=t;this._ready=new Promise(((e,r)=>{i.setLanguage(t,(()=>{e(i)}))}))}async getLanguage(){const t=await this._ready;return t.getLanguage()}async getDirection(){const t=await this._ready;return t.getDirection()}async get(t,e,r){const i=await this._ready;return i.get(t,e,r)}async translate(t){const e=await this._ready;return e.translate(t)}}e.GenericL10n=n},function(t,e,r){document.webL10n=function(t,e,r){var i={};var n="";var o="textContent";var s="";var a={};var l="loading";var h=true;function u(){return e.querySelectorAll('link[type="application/l10n"]')}function d(){var t=e.querySelector('script[type="application/l10n"]');return t?JSON.parse(t.innerHTML):null}function c(t){return t?t.querySelectorAll("*[data-l10n-id]"):[]}function f(t){if(!t)return{};var e=t.getAttribute("data-l10n-id");var r=t.getAttribute("data-l10n-args");var i={};if(r){try{i=JSON.parse(r)}catch(t){console.warn("could not parse arguments for #"+e)}}return{id:e,args:i}}function v(t,e,r){e=e||function t(e){};r=r||function t(){};var i=new XMLHttpRequest;i.open("GET",t,h);if(i.overrideMimeType){i.overrideMimeType("text/plain; charset=utf-8")}i.onreadystatechange=function(){if(i.readyState==4){if(i.status==200||i.status===0){e(i.responseText)}else{r()}}};i.onerror=r;i.ontimeout=r;try{i.send(null)}catch(t){r()}}function C(t,e,r,s){var a=t.replace(/[^\/]*$/,"")||"./";function l(t){if(t.lastIndexOf("\\")<0)return t;return t.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function h(t,r){var i={};var n=/^\s*|\s*$/;var o=/^\s*#|^\s*$/;var s=/^\s*\[(.*)\]\s*$/;var h=/^\s*@import\s+url\((.*)\)\s*$/i;var u=/^([^=\s]*)\s*=\s*(.+)$/;function d(t,r,d){var f=t.replace(n,"").split(/[\r\n]+/);var v="*";var C=e.split("-",1)[0];var g=false;var p="";function w(){while(true){if(!f.length){d();return}var t=f.shift();if(o.test(t))continue;if(r){p=s.exec(t);if(p){v=p[1].toLowerCase();g=v!=="*"&&v!==e&&v!==C;continue}else if(g){continue}p=h.exec(t);if(p){c(a+p[1],w);return}}var n=t.match(u);if(n&&n.length==3){i[n[1]]=l(n[2])}}}w()}function c(t,e){v(t,(function(t){d(t,false,e)}),(function(){console.warn(t+" not found.");e()}))}d(t,true,(function(){r(i)}))}v(t,(function(t){n+=t;h(t,(function(t){for(var e in t){var n,s,a=e.lastIndexOf(".");if(a>0){n=e.substring(0,a);s=e.substring(a+1)}else{n=e;s=o}if(!i[n]){i[n]={}}i[n][s]=t[e]}if(r){r()}}))}),s)}function g(t,e){if(t){t=t.toLowerCase()}e=e||function t(){};p();s=t;var r=u();var n=r.length;if(n===0){var o=d();if(o&&o.locales&&o.default_locale){console.log("using the embedded JSON directory, early way out");i=o.locales[t];if(!i){var a=o.default_locale.toLowerCase();for(var h in o.locales){h=h.toLowerCase();if(h===t){i=o.locales[t];break}else if(h===a){i=o.locales[a]}}}e()}else{console.log("no resource to load, early way out")}l="complete";return}var c=null;var f=0;c=function(){f++;if(f>=n){e();l="complete"}};function v(t){var e=t.href;this.load=function(t,r){C(e,t,r,(function(){console.warn(e+" not found.");console.warn('"'+t+'" resource not found');s="";r()}))}}for(var g=0;g<n;g++){var w=new v(r[g]);w.load(t,c)}}function p(){i={};n="";s=""}function w(t){var e={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3};function r(t,e){return e.indexOf(t)!==-1}function i(t,e,r){return e<=t&&t<=r}var n={0:function(t){return"other"},1:function(t){if(i(t%100,3,10))return"few";if(t===0)return"zero";if(i(t%100,11,99))return"many";if(t==2)return"two";if(t==1)return"one";return"other"},2:function(t){if(t!==0&&t%10===0)return"many";if(t==2)return"two";if(t==1)return"one";return"other"},3:function(t){if(t==1)return"one";return"other"},4:function(t){if(i(t,0,1))return"one";return"other"},5:function(t){if(i(t,0,2)&&t!=2)return"one";return"other"},6:function(t){if(t===0)return"zero";if(t%10==1&&t%100!=11)return"one";return"other"},7:function(t){if(t==2)return"two";if(t==1)return"one";return"other"},8:function(t){if(i(t,3,6))return"few";if(i(t,7,10))return"many";if(t==2)return"two";if(t==1)return"one";return"other"},9:function(t){if(t===0||t!=1&&i(t%100,1,19))return"few";if(t==1)return"one";return"other"},10:function(t){if(i(t%10,2,9)&&!i(t%100,11,19))return"few";if(t%10==1&&!i(t%100,11,19))return"one";return"other"},11:function(t){if(i(t%10,2,4)&&!i(t%100,12,14))return"few";if(t%10===0||i(t%10,5,9)||i(t%100,11,14))return"many";if(t%10==1&&t%100!=11)return"one";return"other"},12:function(t){if(i(t,2,4))return"few";if(t==1)return"one";return"other"},13:function(t){if(i(t%10,2,4)&&!i(t%100,12,14))return"few";if(t!=1&&i(t%10,0,1)||i(t%10,5,9)||i(t%100,12,14))return"many";if(t==1)return"one";return"other"},14:function(t){if(i(t%100,3,4))return"few";if(t%100==2)return"two";if(t%100==1)return"one";return"other"},15:function(t){if(t===0||i(t%100,2,10))return"few";if(i(t%100,11,19))return"many";if(t==1)return"one";return"other"},16:function(t){if(t%10==1&&t!=11)return"one";return"other"},17:function(t){if(t==3)return"few";if(t===0)return"zero";if(t==6)return"many";if(t==2)return"two";if(t==1)return"one";return"other"},18:function(t){if(t===0)return"zero";if(i(t,0,2)&&t!==0&&t!=2)return"one";return"other"},19:function(t){if(i(t,2,10))return"few";if(i(t,0,1))return"one";return"other"},20:function(t){if((i(t%10,3,4)||t%10==9)&&!(i(t%100,10,19)||i(t%100,70,79)||i(t%100,90,99)))return"few";if(t%1e6===0&&t!==0)return"many";if(t%10==2&&!r(t%100,[12,72,92]))return"two";if(t%10==1&&!r(t%100,[11,71,91]))return"one";return"other"},21:function(t){if(t===0)return"zero";if(t==1)return"one";return"other"},22:function(t){if(i(t,0,1)||i(t,11,99))return"one";return"other"},23:function(t){if(i(t%10,1,2)||t%20===0)return"one";return"other"},24:function(t){if(i(t,3,10)||i(t,13,19))return"few";if(r(t,[2,12]))return"two";if(r(t,[1,11]))return"one";return"other"}};var o=e[t.replace(/-.*$/,"")];if(!(o in n)){console.warn("plural form unknown for ["+t+"]");return function(){return"other"}}return n[o]}a.plural=function(t,e,r,n){var l=parseFloat(e);if(isNaN(l))return t;if(n!=o)return t;if(!a._pluralRules){a._pluralRules=w(s)}var h="["+a._pluralRules(l)+"]";if(l===0&&r+"[zero]"in i){t=i[r+"[zero]"][n]}else if(l==1&&r+"[one]"in i){t=i[r+"[one]"][n]}else if(l==2&&r+"[two]"in i){t=i[r+"[two]"][n]}else if(r+h in i){t=i[r+h][n]}else if(r+"[other]"in i){t=i[r+"[other]"][n]}return t};function m(t,e,r){var n=i[t];if(!n){console.warn("#"+t+" is undefined.");if(!r){return null}n=r}var o={};for(var s in n){var a=n[s];a=b(a,e,t,s);a=M(a,e,t);o[s]=a}return o}function b(t,e,r,n){var o=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;var s=o.exec(t);if(!s||!s.length)return t;var l=s[1];var h=s[2];var u;if(e&&h in e){u=e[h]}else if(h in i){u=i[h]}if(l in a){var d=a[l];t=d(t,u,r,n)}return t}function M(t,e,r){var n=/\{\{\s*(.+?)\s*\}\}/g;return t.replace(n,(function(t,n){if(e&&n in e){return e[n]}if(n in i){return i[n]}console.log("argument {{"+n+"}} for #"+r+" is undefined.");return t}))}function x(t){var r=f(t);if(!r.id)return;var i=m(r.id,r.args);if(!i){console.warn("#"+r.id+" is undefined.");return}if(i[o]){if(k(t)===0){t[o]=i[o]}else{var n=t.childNodes;var s=false;for(var a=0,l=n.length;a<l;a++){if(n[a].nodeType===3&&/\S/.test(n[a].nodeValue)){if(s){n[a].nodeValue=""}else{n[a].nodeValue=i[o];s=true}}}if(!s){var h=e.createTextNode(i[o]);t.insertBefore(h,t.firstChild)}}delete i[o]}for(var u in i){t[u]=i[u]}}function k(t){if(t.children){return t.children.length}if(typeof t.childElementCount!=="undefined"){return t.childElementCount}var e=0;for(var r=0;r<t.childNodes.length;r++){e+=t.nodeType===1?1:0}return e}function y(t){t=t||e.documentElement;var r=c(t);var i=r.length;for(var n=0;n<i;n++){x(r[n])}x(t)}return{get:function(t,e,r){var i=t.lastIndexOf(".");var n=o;if(i>0){n=t.substring(i+1);t=t.substring(0,i)}var s;if(r){s={};s[n]=r}var a=m(t,e,s);if(a&&n in a){return a[n]}return"{{"+t+"}}"},getData:function(){return i},getText:function(){return n},getLanguage:function(){return s},setLanguage:function(t,e){g(t,(function(){if(e)e()}))},getDirection:function(){var t=["ar","he","fa","ps","ur"];var e=s.split("-",1)[0];return t.indexOf(e)>=0?"rtl":"ltr"},translate:y,getReadyState:function(){return l},ready:function(r){if(!r){return}else if(l=="complete"||l=="interactive"){t.setTimeout((function(){r()}))}else if(e.addEventListener){e.addEventListener("localized",(function t(){e.removeEventListener("localized",t);r()}))}}}}(window,document)},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFFindController=e.FindState=void 0;var i=r(2);var n=r(11);var o=r(3);const s={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};e.FindState=s;const a=250;const l=-50;const h=-400;const u={"‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"};let d=null;function c(t){if(!d){const t=Object.keys(u).join("");d=new RegExp(`[${t}]`,"g")}return t.replace(d,(function(t){return u[t]}))}class f{constructor({linkService:t,eventBus:e}){this._linkService=t;this._eventBus=e;this._reset();e._on("findbarclose",this._onFindBarClose.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this._state}setDocument(t){if(this._pdfDocument){this._reset()}if(!t){return}this._pdfDocument=t;this._firstPageCapability.resolve()}executeCommand(t,e){if(!e){return}const r=this._pdfDocument;if(this._state===null||this._shouldDirtyMatch(t,e)){this._dirtyMatch=true}this._state=e;if(t!=="findhighlightallchange"){this._updateUIState(s.PENDING)}this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||r&&this._pdfDocument!==r){return}this._extractText();const e=!this._highlightMatches;const i=!!this._findTimeout;if(this._findTimeout){clearTimeout(this._findTimeout);this._findTimeout=null}if(t==="find"){this._findTimeout=setTimeout((()=>{this._nextMatch();this._findTimeout=null}),a)}else if(this._dirtyMatch){this._nextMatch()}else if(t==="findagain"){this._nextMatch();if(e&&this._state.highlightAll){this._updateAllPages()}}else if(t==="findhighlightallchange"){if(i){this._nextMatch()}else{this._highlightMatches=true}this._updateAllPages()}else{this._nextMatch()}}))}scrollMatchIntoView({element:t=null,pageIndex:e=-1,matchIndex:r=-1}){if(!this._scrollMatches||!t){return}else if(r===-1||r!==this._selected.matchIdx){return}else if(e===-1||e!==this._selected.pageIdx){return}this._scrollMatches=false;const i={top:l,left:h};(0,o.scrollIntoView)(t,i,true)}_reset(){this._highlightMatches=false;this._scrollMatches=false;this._pdfDocument=null;this._pageMatches=[];this._pageMatchesLength=[];this._state=null;this._selected={pageIdx:-1,matchIdx:-1};this._offset={pageIdx:null,matchIdx:null,wrapped:false};this._extractTextPromises=[];this._pageContents=[];this._matchesCountTotal=0;this._pagesToSearch=null;this._pendingFindMatches=Object.create(null);this._resumePageIdx=null;this._dirtyMatch=false;clearTimeout(this._findTimeout);this._findTimeout=null;this._firstPageCapability=(0,i.createPromiseCapability)()}get _query(){if(this._state.query!==this._rawQuery){this._rawQuery=this._state.query;this._normalizedQuery=c(this._state.query)}return this._normalizedQuery}_shouldDirtyMatch(t,e){if(e.query!==this._state.query){return true}switch(t){case"findagain":const t=this._selected.pageIdx+1;const e=this._linkService;if(t>=1&&t<=e.pagesCount&&t!==e.page&&!e.isPageVisible(t)){return true}return false;case"findhighlightallchange":return false}return true}_prepareMatches(t,e,r){function i(e){const r=t[e];const i=t[e+1];if(e<t.length-1&&r.match===i.match){r.skipped=true;return true}for(let i=e-1;i>=0;i--){const e=t[i];if(e.skipped){continue}if(e.match+e.matchLength<r.match){break}if(e.match+e.matchLength>=r.match+r.matchLength){r.skipped=true;return true}}return false}t.sort((function(t,e){return t.match===e.match?t.matchLength-e.matchLength:t.match-e.match}));for(let n=0,o=t.length;n<o;n++){if(i(n)){continue}e.push(t[n].match);r.push(t[n].matchLength)}}_isEntireWord(t,e,r){if(e>0){const r=t.charCodeAt(e);const i=t.charCodeAt(e-1);if((0,n.getCharacterType)(r)===(0,n.getCharacterType)(i)){return false}}const i=e+r-1;if(i<t.length-1){const e=t.charCodeAt(i);const r=t.charCodeAt(i+1);if((0,n.getCharacterType)(e)===(0,n.getCharacterType)(r)){return false}}return true}_calculatePhraseMatch(t,e,r,i){const n=[];const o=t.length;let s=-o;while(true){s=r.indexOf(t,s+o);if(s===-1){break}if(i&&!this._isEntireWord(r,s,o)){continue}n.push(s)}this._pageMatches[e]=n}_calculateWordMatch(t,e,r,i){const n=[];const o=t.match(/\S+/g);for(let t=0,e=o.length;t<e;t++){const e=o[t];const s=e.length;let a=-s;while(true){a=r.indexOf(e,a+s);if(a===-1){break}if(i&&!this._isEntireWord(r,a,s)){continue}n.push({match:a,matchLength:s,skipped:false})}}this._pageMatchesLength[e]=[];this._pageMatches[e]=[];this._prepareMatches(n,this._pageMatches[e],this._pageMatchesLength[e])}_calculateMatch(t){let e=this._pageContents[t];let r=this._query;const{caseSensitive:i,entireWord:n,phraseSearch:o}=this._state;if(r.length===0){return}if(!i){e=e.toLowerCase();r=r.toLowerCase()}if(o){this._calculatePhraseMatch(r,t,e,n)}else{this._calculateWordMatch(r,t,e,n)}if(this._state.highlightAll){this._updatePage(t)}if(this._resumePageIdx===t){this._resumePageIdx=null;this._nextPageMatch()}const s=this._pageMatches[t].length;if(s>0){this._matchesCountTotal+=s;this._updateUIResultsCount()}}_extractText(){if(this._extractTextPromises.length>0){return}let t=Promise.resolve();for(let e=0,r=this._linkService.pagesCount;e<r;e++){const r=(0,i.createPromiseCapability)();this._extractTextPromises[e]=r.promise;t=t.then((()=>this._pdfDocument.getPage(e+1).then((t=>t.getTextContent({normalizeWhitespace:true}))).then((t=>{const i=t.items;const n=[];for(let t=0,e=i.length;t<e;t++){n.push(i[t].str)}this._pageContents[e]=c(n.join(""));r.resolve(e)}),(t=>{console.error(`Unable to get text content for page ${e+1}`,t);this._pageContents[e]="";r.resolve(e)}))))}}_updatePage(t){if(this._scrollMatches&&this._selected.pageIdx===t){this._linkService.page=t+1}this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})}_updateAllPages(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}_nextMatch(){const t=this._state.findPrevious;const e=this._linkService.page-1;const r=this._linkService.pagesCount;this._highlightMatches=true;if(this._dirtyMatch){this._dirtyMatch=false;this._selected.pageIdx=this._selected.matchIdx=-1;this._offset.pageIdx=e;this._offset.matchIdx=null;this._offset.wrapped=false;this._resumePageIdx=null;this._pageMatches.length=0;this._pageMatchesLength.length=0;this._matchesCountTotal=0;this._updateAllPages();for(let t=0;t<r;t++){if(this._pendingFindMatches[t]===true){continue}this._pendingFindMatches[t]=true;this._extractTextPromises[t].then((t=>{delete this._pendingFindMatches[t];this._calculateMatch(t)}))}}if(this._query===""){this._updateUIState(s.FOUND);return}if(this._resumePageIdx){return}const i=this._offset;this._pagesToSearch=r;if(i.matchIdx!==null){const e=this._pageMatches[i.pageIdx].length;if(!t&&i.matchIdx+1<e||t&&i.matchIdx>0){i.matchIdx=t?i.matchIdx-1:i.matchIdx+1;this._updateMatch(true);return}this._advanceOffsetPage(t)}this._nextPageMatch()}_matchesReady(t){const e=this._offset;const r=t.length;const i=this._state.findPrevious;if(r){e.matchIdx=i?r-1:0;this._updateMatch(true);return true}this._advanceOffsetPage(i);if(e.wrapped){e.matchIdx=null;if(this._pagesToSearch<0){this._updateMatch(false);return true}}return false}_nextPageMatch(){if(this._resumePageIdx!==null){console.error("There can only be one pending page.")}let t=null;do{const e=this._offset.pageIdx;t=this._pageMatches[e];if(!t){this._resumePageIdx=e;break}}while(!this._matchesReady(t))}_advanceOffsetPage(t){const e=this._offset;const r=this._linkService.pagesCount;e.pageIdx=t?e.pageIdx-1:e.pageIdx+1;e.matchIdx=null;this._pagesToSearch--;if(e.pageIdx>=r||e.pageIdx<0){e.pageIdx=t?r-1:0;e.wrapped=true}}_updateMatch(t=false){let e=s.NOT_FOUND;const r=this._offset.wrapped;this._offset.wrapped=false;if(t){const t=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx;this._selected.matchIdx=this._offset.matchIdx;e=r?s.WRAPPED:s.FOUND;if(t!==-1&&t!==this._selected.pageIdx){this._updatePage(t)}}this._updateUIState(e,this._state.findPrevious);if(this._selected.pageIdx!==-1){this._scrollMatches=true;this._updatePage(this._selected.pageIdx)}}_onFindBarClose(t){const e=this._pdfDocument;this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||e&&this._pdfDocument!==e){return}if(this._findTimeout){clearTimeout(this._findTimeout);this._findTimeout=null}if(this._resumePageIdx){this._resumePageIdx=null;this._dirtyMatch=true}this._updateUIState(s.FOUND);this._highlightMatches=false;this._updateAllPages()}))}_requestMatchesCount(){const{pageIdx:t,matchIdx:e}=this._selected;let r=0,i=this._matchesCountTotal;if(e!==-1){for(let e=0;e<t;e++){r+=this._pageMatches[e]&&this._pageMatches[e].length||0}r+=e+1}if(r<1||r>i){r=i=0}return{current:r,total:i}}_updateUIResultsCount(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}_updateUIState(t,e){this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,matchesCount:this._requestMatchesCount()})}}e.PDFFindController=f},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.getCharacterType=v;e.CharacterType=void 0;const i={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};e.CharacterType=i;function n(t){return t<11904}function o(t){return(t&65408)===0}function s(t){return t>=97&&t<=122||t>=65&&t<=90}function a(t){return t>=48&&t<=57}function l(t){return t===32||t===9||t===13||t===10}function h(t){return t>=13312&&t<=40959||t>=63744&&t<=64255}function u(t){return t>=12448&&t<=12543}function d(t){return t>=12352&&t<=12447}function c(t){return t>=65376&&t<=65439}function f(t){return(t&65408)===3584}function v(t){if(n(t)){if(o(t)){if(l(t)){return i.SPACE}else if(s(t)||a(t)||t===95){return i.ALPHA_LETTER}return i.PUNCT}else if(f(t)){return i.THAI_LETTER}else if(t===160){return i.SPACE}return i.ALPHA_LETTER}if(h(t)){return i.HAN_LETTER}else if(u(t)){return i.KATAKANA_LETTER}else if(d(t)){return i.HIRAGANA_LETTER}else if(c(t)){return i.HALFWIDTH_KATAKANA_LETTER}return i.ALPHA_LETTER}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.isDestHashesEqual=h;e.isDestArraysEqual=u;e.PDFHistory=void 0;var i=r(3);const n=1e3;const o=50;const s=1e3;function a(){return document.location.hash}class l{constructor({linkService:t,eventBus:e}){this.linkService=t;this.eventBus=e;this._initialized=false;this._fingerprint="";this.reset();this._boundEvents=null;this._isViewerInPresentationMode=false;this.eventBus._on("presentationmodechanged",(t=>{this._isViewerInPresentationMode=t.active||t.switchInProgress}));this.eventBus._on("pagesinit",(()=>{this._isPagesLoaded=false;const t=e=>{this.eventBus._off("pagesloaded",t);this._isPagesLoaded=!!e.pagesCount};this.eventBus._on("pagesloaded",t)}))}initialize({fingerprint:t,resetHistory:e=false,updateUrl:r=false}){if(!t||typeof t!=="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}if(this._initialized){this.reset()}const i=this._fingerprint!==""&&this._fingerprint!==t;this._fingerprint=t;this._updateUrl=r===true;this._initialized=true;this._bindEvents();const n=window.history.state;this._popStateInProgress=false;this._blockHashChange=0;this._currentHash=a();this._numPositionUpdates=0;this._uid=this._maxUid=0;this._destination=null;this._position=null;if(!this._isValidState(n,true)||e){const{hash:t,page:r,rotation:n}=this._parseCurrentHash(true);if(!t||i||e){this._pushOrReplaceState(null,true);return}this._pushOrReplaceState({hash:t,page:r,rotation:n},true);return}const o=n.destination;this._updateInternalState(o,n.uid,true);if(this._uid>this._maxUid){this._maxUid=this._uid}if(o.rotation!==undefined){this._initialRotation=o.rotation}if(o.dest){this._initialBookmark=JSON.stringify(o.dest);this._destination.page=null}else if(o.hash){this._initialBookmark=o.hash}else if(o.page){this._initialBookmark=`page=${o.page}`}}reset(){if(this._initialized){this._pageHide();this._initialized=false;this._unbindEvents()}if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}this._initialBookmark=null;this._initialRotation=null}push({namedDest:t=null,explicitDest:e,pageNumber:r}){if(!this._initialized){return}if(t&&typeof t!=="string"){console.error("PDFHistory.push: "+`"${t}" is not a valid namedDest parameter.`);return}else if(!Array.isArray(e)){console.error("PDFHistory.push: "+`"${e}" is not a valid explicitDest parameter.`);return}else if(!(Number.isInteger(r)&&r>0&&r<=this.linkService.pagesCount)){if(r!==null||this._destination){console.error("PDFHistory.push: "+`"${r}" is not a valid pageNumber parameter.`);return}}const i=t||JSON.stringify(e);if(!i){return}let n=false;if(this._destination&&(h(this._destination.hash,i)||u(this._destination.dest,e))){if(this._destination.page){return}n=true}if(this._popStateInProgress&&!n){return}this._pushOrReplaceState({dest:e,hash:i,page:r,rotation:this.linkService.rotation},n);if(!this._popStateInProgress){this._popStateInProgress=true;Promise.resolve().then((()=>{this._popStateInProgress=false}))}}pushCurrentPosition(){if(!this._initialized||this._popStateInProgress){return}this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress){return}const t=window.history.state;if(this._isValidState(t)&&t.uid>0){window.history.back()}}forward(){if(!this._initialized||this._popStateInProgress){return}const t=window.history.state;if(this._isValidState(t)&&t.uid<this._maxUid){window.history.forward()}}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(t,e=false){const r=e||!this._destination;const i={fingerprint:this._fingerprint,uid:r?this._uid:this._uid+1,destination:t};this._updateInternalState(t,i.uid);let n;if(this._updateUrl&&t&&t.hash){const e=document.location.href.split("#")[0];if(!e.startsWith("file://")){n=`${e}#${t.hash}`}}if(r){window.history.replaceState(i,"",n)}else{this._maxUid=this._uid;window.history.pushState(i,"",n)}}_tryPushCurrentPosition(t=false){if(!this._position){return}let e=this._position;if(t){e=Object.assign(Object.create(null),this._position);e.temporary=true}if(!this._destination){this._pushOrReplaceState(e);return}if(this._destination.temporary){this._pushOrReplaceState(e,true);return}if(this._destination.hash===e.hash){return}if(!this._destination.page&&this._numPositionUpdates<=o){return}let r=false;if(this._destination.page>=e.first&&this._destination.page<=e.page){if(this._destination.dest||!this._destination.first){return}r=true}this._pushOrReplaceState(e,r)}_isValidState(t,e=false){if(!t){return false}if(t.fingerprint!==this._fingerprint){if(e){if(typeof t.fingerprint!=="string"||t.fingerprint.length!==this._fingerprint.length){return false}const[e]=performance.getEntriesByType("navigation");if(!e||e.type!=="reload"){return false}}else{return false}}if(!Number.isInteger(t.uid)||t.uid<0){return false}if(t.destination===null||typeof t.destination!=="object"){return false}return true}_updateInternalState(t,e,r=false){if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}if(r&&t&&t.temporary){delete t.temporary}this._destination=t;this._uid=e;this._numPositionUpdates=0}_parseCurrentHash(t=false){const e=unescape(a()).substring(1);const r=(0,i.parseQueryString)(e);const n=r.nameddest||"";let o=r.page|0;if(!(Number.isInteger(o)&&o>0&&o<=this.linkService.pagesCount)||t&&n.length>0){o=null}return{hash:e,page:o,rotation:this.linkService.rotation}}_updateViewarea({location:t}){if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}this._position={hash:this._isViewerInPresentationMode?`page=${t.pageNumber}`:t.pdfOpenParams.substring(1),page:this.linkService.page,first:t.pageNumber,rotation:t.rotation};if(this._popStateInProgress){return}if(this._isPagesLoaded&&this._destination&&!this._destination.page){this._numPositionUpdates++}{this._updateViewareaTimeout=setTimeout((()=>{if(!this._popStateInProgress){this._tryPushCurrentPosition(true)}this._updateViewareaTimeout=null}),s)}}_popState({state:t}){const e=a(),r=this._currentHash!==e;this._currentHash=e;if(!t){this._uid++;const{hash:t,page:e,rotation:r}=this._parseCurrentHash();this._pushOrReplaceState({hash:t,page:e,rotation:r},true);return}if(!this._isValidState(t)){return}this._popStateInProgress=true;if(r){this._blockHashChange++;(0,i.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:n}).then((()=>{this._blockHashChange--}))}const o=t.destination;this._updateInternalState(o,t.uid,true);if(this._uid>this._maxUid){this._maxUid=this._uid}if((0,i.isValidRotation)(o.rotation)){this.linkService.rotation=o.rotation}if(o.dest){this.linkService.navigateTo(o.dest)}else if(o.hash){this.linkService.setHash(o.hash)}else if(o.page){this.linkService.page=o.page}Promise.resolve().then((()=>{this._popStateInProgress=false}))}_pageHide(){if(!this._destination||this._destination.temporary){this._tryPushCurrentPosition()}}_bindEvents(){if(this._boundEvents){return}this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)};this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea);window.addEventListener("popstate",this._boundEvents.popState);window.addEventListener("pagehide",this._boundEvents.pageHide)}_unbindEvents(){if(!this._boundEvents){return}this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea);window.removeEventListener("popstate",this._boundEvents.popState);window.removeEventListener("pagehide",this._boundEvents.pageHide);this._boundEvents=null}}e.PDFHistory=l;function h(t,e){if(typeof t!=="string"||typeof e!=="string"){return false}if(t===e){return true}const{nameddest:r}=(0,i.parseQueryString)(t);if(r===e){return true}return false}function u(t,e){function r(t,e){if(typeof t!==typeof e){return false}if(Array.isArray(t)||Array.isArray(e)){return false}if(t!==null&&typeof t==="object"&&e!==null){if(Object.keys(t).length!==Object.keys(e).length){return false}for(const i in t){if(!r(t[i],e[i])){return false}}return true}return t===e||Number.isNaN(t)&&Number.isNaN(e)}if(!(Array.isArray(t)&&Array.isArray(e))){return false}if(t.length!==e.length){return false}for(let i=0,n=t.length;i<n;i++){if(!r(t[i],e[i])){return false}}return true}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFPageView=void 0;var i=r(3);var n=r(2);var o=r(14);var s=r(7);const a=s.viewerCompatibilityParams.maxCanvasPixels||16777216;class l{constructor(t){const e=t.container;const r=t.defaultViewport;this.id=t.id;this.renderingId="page"+this.id;this.pdfPage=null;this.pageLabel=null;this.rotation=0;this.scale=t.scale||i.DEFAULT_SCALE;this.viewport=r;this.pdfPageRotate=r.rotation;this.hasRestrictedScaling=false;this.textLayerMode=Number.isInteger(t.textLayerMode)?t.textLayerMode:i.TextLayerMode.ENABLE;this.imageResourcesPath=t.imageResourcesPath||"";this.renderInteractiveForms=t.renderInteractiveForms||false;this.useOnlyCssZoom=t.useOnlyCssZoom||false;this.maxCanvasPixels=t.maxCanvasPixels||a;this.eventBus=t.eventBus;this.renderingQueue=t.renderingQueue;this.textLayerFactory=t.textLayerFactory;this.annotationLayerFactory=t.annotationLayerFactory;this.renderer=t.renderer||i.RendererType.CANVAS;this.enableWebGL=t.enableWebGL||false;this.l10n=t.l10n||i.NullL10n;this.paintTask=null;this.paintedViewportMap=new WeakMap;this.renderingState=o.RenderingStates.INITIAL;this.resume=null;this.error=null;this.annotationLayer=null;this.textLayer=null;this.zoomLayer=null;const n=document.createElement("div");n.className="page";n.style.width=Math.floor(this.viewport.width)+"px";n.style.height=Math.floor(this.viewport.height)+"px";n.setAttribute("data-page-number",this.id);this.div=n;e.appendChild(n)}setPdfPage(t){this.pdfPage=t;this.pdfPageRotate=t.rotate;const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:this.scale*i.CSS_UNITS,rotation:e});this.stats=t.stats;this.reset()}destroy(){this.reset();if(this.pdfPage){this.pdfPage.cleanup()}}_resetZoomLayer(t=false){if(!this.zoomLayer){return}const e=this.zoomLayer.firstChild;this.paintedViewportMap.delete(e);e.width=0;e.height=0;if(t){this.zoomLayer.remove()}this.zoomLayer=null}reset(t=false,e=false){this.cancelRendering(e);this.renderingState=o.RenderingStates.INITIAL;const r=this.div;r.style.width=Math.floor(this.viewport.width)+"px";r.style.height=Math.floor(this.viewport.height)+"px";const i=r.childNodes;const n=t&&this.zoomLayer||null;const s=e&&this.annotationLayer&&this.annotationLayer.div||null;for(let t=i.length-1;t>=0;t--){const e=i[t];if(n===e||s===e){continue}r.removeChild(e)}r.removeAttribute("data-loaded");if(s){this.annotationLayer.hide()}else if(this.annotationLayer){this.annotationLayer.cancel();this.annotationLayer=null}if(!n){if(this.canvas){this.paintedViewportMap.delete(this.canvas);this.canvas.width=0;this.canvas.height=0;delete this.canvas}this._resetZoomLayer()}if(this.svg){this.paintedViewportMap.delete(this.svg);delete this.svg}this.loadingIconDiv=document.createElement("div");this.loadingIconDiv.className="loadingIcon";r.appendChild(this.loadingIconDiv)}update(t,e){this.scale=t||this.scale;if(typeof e!=="undefined"){this.rotation=e}const r=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:this.scale*i.CSS_UNITS,rotation:r});if(this.svg){this.cssTransform(this.svg,true);this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:true,timestamp:performance.now()});return}let n=false;if(this.canvas&&this.maxCanvasPixels>0){const t=this.outputScale;if((Math.floor(this.viewport.width)*t.sx|0)*(Math.floor(this.viewport.height)*t.sy|0)>this.maxCanvasPixels){n=true}}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&n){this.cssTransform(this.canvas,true);this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:true,timestamp:performance.now()});return}if(!this.zoomLayer&&!this.canvas.hasAttribute("hidden")){this.zoomLayer=this.canvas.parentNode;this.zoomLayer.style.position="absolute"}}if(this.zoomLayer){this.cssTransform(this.zoomLayer.firstChild)}this.reset(true,true)}cancelRendering(t=false){if(this.paintTask){this.paintTask.cancel();this.paintTask=null}this.resume=null;if(this.textLayer){this.textLayer.cancel();this.textLayer=null}if(!t&&this.annotationLayer){this.annotationLayer.cancel();this.annotationLayer=null}}cssTransform(t,e=false){const r=this.viewport.width;const i=this.viewport.height;const n=this.div;t.style.width=t.parentNode.style.width=n.style.width=Math.floor(r)+"px";t.style.height=t.parentNode.style.height=n.style.height=Math.floor(i)+"px";const o=this.viewport.rotation-this.paintedViewportMap.get(t).rotation;const s=Math.abs(o);let a=1,l=1;if(s===90||s===270){a=i/r;l=r/i}const h="rotate("+o+"deg) "+"scale("+a+","+l+")";t.style.transform=h;if(this.textLayer){const t=this.textLayer.viewport;const e=this.viewport.rotation-t.rotation;const i=Math.abs(e);let n=r/t.width;if(i===90||i===270){n=r/t.height}const o=this.textLayer.textLayerDiv;let s,a;switch(i){case 0:s=a=0;break;case 90:s=0;a="-"+o.style.height;break;case 180:s="-"+o.style.width;a="-"+o.style.height;break;case 270:s="-"+o.style.width;a=0;break;default:console.error("Bad rotation value.");break}o.style.transform="rotate("+i+"deg) "+"scale("+n+", "+n+") "+"translate("+s+", "+a+")";o.style.transformOrigin="0% 0%"}if(e&&this.annotationLayer){this.annotationLayer.render(this.viewport,"display")}}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(t,e){return this.viewport.convertToPdfPoint(t,e)}draw(){if(this.renderingState!==o.RenderingStates.INITIAL){console.error("Must be in new state before drawing");this.reset()}const{div:t,pdfPage:e}=this;if(!e){this.renderingState=o.RenderingStates.FINISHED;if(this.loadingIconDiv){t.removeChild(this.loadingIconDiv);delete this.loadingIconDiv}return Promise.reject(new Error("pdfPage is not loaded"))}this.renderingState=o.RenderingStates.RUNNING;const r=document.createElement("div");r.style.width=t.style.width;r.style.height=t.style.height;r.classList.add("canvasWrapper");if(this.annotationLayer&&this.annotationLayer.div){t.insertBefore(r,this.annotationLayer.div)}else{t.appendChild(r)}let s=null;if(this.textLayerMode!==i.TextLayerMode.DISABLE&&this.textLayerFactory){const e=document.createElement("div");e.className="textLayer";e.style.width=r.style.width;e.style.height=r.style.height;if(this.annotationLayer&&this.annotationLayer.div){t.insertBefore(e,this.annotationLayer.div)}else{t.appendChild(e)}s=this.textLayerFactory.createTextLayerBuilder(e,this.id-1,this.viewport,this.textLayerMode===i.TextLayerMode.ENABLE_ENHANCE,this.eventBus)}this.textLayer=s;let a=null;if(this.renderingQueue){a=t=>{if(!this.renderingQueue.isHighestPriority(this)){this.renderingState=o.RenderingStates.PAUSED;this.resume=()=>{this.renderingState=o.RenderingStates.RUNNING;t()};return}t()}}const l=async r=>{if(h===this.paintTask){this.paintTask=null}if(r instanceof n.RenderingCancelledException){this.error=null;return}this.renderingState=o.RenderingStates.FINISHED;if(this.loadingIconDiv){t.removeChild(this.loadingIconDiv);delete this.loadingIconDiv}this._resetZoomLayer(true);this.error=r;this.stats=e.stats;this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:false,timestamp:performance.now()});if(r){throw r}};const h=this.renderer===i.RendererType.SVG?this.paintOnSvg(r):this.paintOnCanvas(r);h.onRenderContinue=a;this.paintTask=h;const u=h.promise.then((function(){return l(null).then((function(){if(s){const t=e.streamTextContent({normalizeWhitespace:true});s.setTextContentStream(t);s.render()}}))}),(function(t){return l(t)}));if(this.annotationLayerFactory){if(!this.annotationLayer){this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(t,e,this.imageResourcesPath,this.renderInteractiveForms,this.l10n)}this.annotationLayer.render(this.viewport,"display")}t.setAttribute("data-loaded",true);this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id});return u}paintOnCanvas(t){const e=(0,n.createPromiseCapability)();const r={promise:e.promise,onRenderContinue(t){t()},cancel(){C.cancel()}};const o=this.viewport;const s=document.createElement("canvas");this.l10n.get("page_canvas",{page:this.id},"Page {{page}}").then((t=>{s.setAttribute("aria-label",t)}));s.setAttribute("hidden","hidden");let a=true;const l=function(){if(a){s.removeAttribute("hidden");a=false}};t.appendChild(s);this.canvas=s;s.mozOpaque=true;const h=s.getContext("2d",{alpha:false});const u=(0,i.getOutputScale)(h);this.outputScale=u;if(this.useOnlyCssZoom){const t=o.clone({scale:i.CSS_UNITS});u.sx*=t.width/o.width;u.sy*=t.height/o.height;u.scaled=true}if(this.maxCanvasPixels>0){const t=o.width*o.height;const e=Math.sqrt(this.maxCanvasPixels/t);if(u.sx>e||u.sy>e){u.sx=e;u.sy=e;u.scaled=true;this.hasRestrictedScaling=true}else{this.hasRestrictedScaling=false}}const d=(0,i.approximateFraction)(u.sx);const c=(0,i.approximateFraction)(u.sy);s.width=(0,i.roundToDivide)(o.width*u.sx,d[0]);s.height=(0,i.roundToDivide)(o.height*u.sy,c[0]);s.style.width=(0,i.roundToDivide)(o.width,d[1])+"px";s.style.height=(0,i.roundToDivide)(o.height,c[1])+"px";this.paintedViewportMap.set(s,o);const f=!u.scaled?null:[u.sx,0,0,u.sy,0,0];const v={canvasContext:h,transform:f,viewport:this.viewport,enableWebGL:this.enableWebGL,renderInteractiveForms:this.renderInteractiveForms};const C=this.pdfPage.render(v);C.onContinue=function(t){l();if(r.onRenderContinue){r.onRenderContinue(t)}else{t()}};C.promise.then((function(){l();e.resolve(undefined)}),(function(t){l();e.reject(t)}));return r}paintOnSvg(t){let e=false;const r=()=>{if(e){throw new n.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")}};const s=this.pdfPage;const a=this.viewport.clone({scale:i.CSS_UNITS});const l=s.getOperatorList().then((e=>{r();const i=new n.SVGGraphics(s.commonObjs,s.objs);return i.getSVG(e,a).then((e=>{r();this.svg=e;this.paintedViewportMap.set(e,a);e.style.width=t.style.width;e.style.height=t.style.height;this.renderingState=o.RenderingStates.FINISHED;t.appendChild(e)}))}));return{promise:l,onRenderContinue(t){t()},cancel(){e=true}}}setPageLabel(t){this.pageLabel=typeof t==="string"?t:null;if(this.pageLabel!==null){this.div.setAttribute("data-page-label",this.pageLabel)}else{this.div.removeAttribute("data-page-label")}}}e.PDFPageView=l},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFRenderingQueue=e.RenderingStates=void 0;const i=3e4;const n={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};e.RenderingStates=n;class o{constructor(){this.pdfViewer=null;this.pdfThumbnailViewer=null;this.onIdle=null;this.highestPriorityPage=null;this.idleTimeout=null;this.printing=false;this.isThumbnailViewEnabled=false}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){if(this.idleTimeout){clearTimeout(this.idleTimeout);this.idleTimeout=null}if(this.pdfViewer.forceRendering(t)){return}if(this.pdfThumbnailViewer&&this.isThumbnailViewEnabled){if(this.pdfThumbnailViewer.forceRendering()){return}}if(this.printing){return}if(this.onIdle){this.idleTimeout=setTimeout(this.onIdle.bind(this),i)}}getHighestPriority(t,e,r){const i=t.views;const n=i.length;if(n===0){return null}for(let t=0;t<n;++t){const e=i[t].view;if(!this.isViewFinished(e)){return e}}if(r){const r=t.last.id;if(e[r]&&!this.isViewFinished(e[r])){return e[r]}}else{const r=t.first.id-2;if(e[r]&&!this.isViewFinished(e[r])){return e[r]}}return null}isViewFinished(t){return t.renderingState===n.FINISHED}renderView(t){switch(t.renderingState){case n.FINISHED:return false;case n.PAUSED:this.highestPriorityPage=t.renderingId;t.resume();break;case n.RUNNING:this.highestPriorityPage=t.renderingId;break;case n.INITIAL:this.highestPriorityPage=t.renderingId;t.draw().finally((()=>{this.renderHighestPriority()})).catch((t=>{console.error(`renderView: "${t}"`)}));break}return true}}e.PDFRenderingQueue=o},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFSinglePageViewer=void 0;var i=r(16);var n=r(2);class o extends i.BaseViewer{constructor(t){super(t);this.eventBus._on("pagesinit",(t=>{this._ensurePageViewVisible()}))}get _viewerElement(){return(0,n.shadow)(this,"_viewerElement",this._shadowViewer)}_resetView(){super._resetView();this._previousPageNumber=1;this._shadowViewer=document.createDocumentFragment();this._updateScrollDown=null}_ensurePageViewVisible(){const t=this._pages[this._currentPageNumber-1];const e=this._pages[this._previousPageNumber-1];const r=this.viewer.childNodes;switch(r.length){case 0:this.viewer.appendChild(t.div);break;case 1:if(r[0]!==e.div){throw new Error("_ensurePageViewVisible: Unexpected previously visible page.")}if(t===e){break}this._shadowViewer.appendChild(e.div);this.viewer.appendChild(t.div);this.container.scrollTop=0;break;default:throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.")}this._previousPageNumber=this._currentPageNumber}_scrollUpdate(){if(this._updateScrollDown){this._updateScrollDown()}super._scrollUpdate()}_scrollIntoView({pageDiv:t,pageSpot:e=null,pageNumber:r=null}){if(r){this._setCurrentPageNumber(r)}const i=this._currentPageNumber>=this._previousPageNumber;this._ensurePageViewVisible();this.update();super._scrollIntoView({pageDiv:t,pageSpot:e,pageNumber:r});this._updateScrollDown=()=>{this.scroll.down=i;this._updateScrollDown=null}}_getVisiblePages(){return this._getCurrentVisiblePage()}_updateHelper(t){}get _isScrollModeHorizontal(){return(0,n.shadow)(this,"_isScrollModeHorizontal",false)}_updateScrollMode(){}_updateSpreadMode(){}}e.PDFSinglePageViewer=o},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.BaseViewer=void 0;var i=r(3);var n=r(14);var o=r(1);var s=r(2);var a=r(13);var l=r(4);var h=r(5);const u=10;function d(t){const e=[];this.push=function(r){const i=e.indexOf(r);if(i>=0){e.splice(i,1)}e.push(r);if(e.length>t){e.shift().destroy()}};this.resize=function(r,n){t=r;if(n){const t=new Set;for(let e=0,r=n.length;e<r;++e){t.add(n[e].id)}(0,i.moveToEndOfArray)(e,(function(e){return t.has(e.id)}))}while(e.length>t){e.shift().destroy()}}}function c(t,e){if(e===t){return true}if(Math.abs(e-t)<1e-15){return true}return false}class f{constructor(t){if(this.constructor===f){throw new Error("Cannot initialize BaseViewer.")}this._name=this.constructor.name;this.container=t.container;this.viewer=t.viewer||t.container.firstElementChild;this.eventBus=t.eventBus;this.linkService=t.linkService||new l.SimpleLinkService;this.downloadManager=t.downloadManager||null;this.findController=t.findController||null;this.removePageBorders=t.removePageBorders||false;this.textLayerMode=Number.isInteger(t.textLayerMode)?t.textLayerMode:i.TextLayerMode.ENABLE;this.imageResourcesPath=t.imageResourcesPath||"";this.renderInteractiveForms=t.renderInteractiveForms||false;this.enablePrintAutoRotate=t.enablePrintAutoRotate||false;this.renderer=t.renderer||i.RendererType.CANVAS;this.enableWebGL=t.enableWebGL||false;this.useOnlyCssZoom=t.useOnlyCssZoom||false;this.maxCanvasPixels=t.maxCanvasPixels;this.l10n=t.l10n||i.NullL10n;this.defaultRenderingQueue=!t.renderingQueue;if(this.defaultRenderingQueue){this.renderingQueue=new n.PDFRenderingQueue;this.renderingQueue.setViewer(this)}else{this.renderingQueue=t.renderingQueue}this.scroll=(0,i.watchScroll)(this.container,this._scrollUpdate.bind(this));this.presentationModeState=i.PresentationModeState.UNKNOWN;this._onBeforeDraw=this._onAfterDraw=null;this._resetView();if(this.removePageBorders){this.viewer.classList.add("removePageBorders")}Promise.resolve().then((()=>{this.eventBus.dispatch("baseviewerinit",{source:this})}))}get pagesCount(){return this._pages.length}getPageView(t){return this._pages[t]}get pageViewsReady(){if(!this._pagesCapability.settled){return false}return this._pages.every((function(t){return t&&t.pdfPage}))}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(t){if(!Number.isInteger(t)){throw new Error("Invalid page number.")}if(!this.pdfDocument){return}if(!this._setCurrentPageNumber(t,true)){console.error(`${this._name}.currentPageNumber: "${t}" is not a valid page.`)}}_setCurrentPageNumber(t,e=false){if(this._currentPageNumber===t){if(e){this._resetCurrentPageView()}return true}if(!(0<t&&t<=this.pagesCount)){return false}this._currentPageNumber=t;this.eventBus.dispatch("pagechanging",{source:this,pageNumber:t,pageLabel:this._pageLabels&&this._pageLabels[t-1]});if(e){this._resetCurrentPageView()}return true}get currentPageLabel(){return this._pageLabels&&this._pageLabels[this._currentPageNumber-1]}set currentPageLabel(t){if(!this.pdfDocument){return}let e=t|0;if(this._pageLabels){const r=this._pageLabels.indexOf(t);if(r>=0){e=r+1}}if(!this._setCurrentPageNumber(e,true)){console.error(`${this._name}.currentPageLabel: "${t}" is not a valid page.`)}}get currentScale(){return this._currentScale!==i.UNKNOWN_SCALE?this._currentScale:i.DEFAULT_SCALE}set currentScale(t){if(isNaN(t)){throw new Error("Invalid numeric scale.")}if(!this.pdfDocument){return}this._setScale(t,false)}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(t){if(!this.pdfDocument){return}this._setScale(t,false)}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!(0,i.isValidRotation)(t)){throw new Error("Invalid pages rotation angle.")}if(!this.pdfDocument){return}if(this._pagesRotation===t){return}this._pagesRotation=t;const e=this._currentPageNumber;for(let e=0,r=this._pages.length;e<r;e++){const r=this._pages[e];r.update(r.scale,t)}if(this._currentScaleValue){this._setScale(this._currentScaleValue,true)}this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:t,pageNumber:e});if(this.defaultRenderingQueue){this.update()}}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _viewerElement(){throw new Error("Not implemented: _viewerElement")}_onePageRenderedOrForceFetch(){if(!this.container.offsetParent||this._getVisiblePages().views.length===0){return Promise.resolve()}return this._onePageRenderedCapability.promise}setDocument(t){if(this.pdfDocument){this._cancelRendering();this._resetView();if(this.findController){this.findController.setDocument(null)}}this.pdfDocument=t;if(!t){return}const e=t.numPages;const r=t.getPage(1);this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:e})}));this._onBeforeDraw=t=>{const e=this._pages[t.pageNumber-1];if(!e){return}this._buffer.push(e)};this.eventBus._on("pagerender",this._onBeforeDraw);this._onAfterDraw=t=>{if(t.cssTransform||this._onePageRenderedCapability.settled){return}this._onePageRenderedCapability.resolve();this.eventBus._off("pagerendered",this._onAfterDraw);this._onAfterDraw=null};this.eventBus._on("pagerendered",this._onAfterDraw);r.then((r=>{this._firstPageCapability.resolve(r);const n=this.currentScale;const o=r.getViewport({scale:n*i.CSS_UNITS});const s=this.textLayerMode!==i.TextLayerMode.DISABLE?this:null;for(let t=1;t<=e;++t){const e=new a.PDFPageView({container:this._viewerElement,eventBus:this.eventBus,id:t,scale:n,defaultViewport:o.clone(),renderingQueue:this.renderingQueue,textLayerFactory:s,textLayerMode:this.textLayerMode,annotationLayerFactory:this,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,renderer:this.renderer,enableWebGL:this.enableWebGL,useOnlyCssZoom:this.useOnlyCssZoom,maxCanvasPixels:this.maxCanvasPixels,l10n:this.l10n});this._pages.push(e)}const l=this._pages[0];if(l){l.setPdfPage(r);this.linkService.cachePageRef(1,r.ref)}if(this._spreadMode!==i.SpreadMode.NONE){this._updateSpreadMode()}this._onePageRenderedOrForceFetch().then((()=>{if(this.findController){this.findController.setDocument(t)}if(t.loadingParams.disableAutoFetch||e>7500){this._pagesCapability.resolve();return}let r=e-1;if(r<=0){this._pagesCapability.resolve();return}for(let i=2;i<=e;++i){t.getPage(i).then((t=>{const e=this._pages[i-1];if(!e.pdfPage){e.setPdfPage(t)}this.linkService.cachePageRef(i,t.ref);if(--r===0){this._pagesCapability.resolve()}}),(t=>{console.error(`Unable to get page ${i} to initialize viewer`,t);if(--r===0){this._pagesCapability.resolve()}}))}}));this.eventBus.dispatch("pagesinit",{source:this});if(this.defaultRenderingQueue){this.update()}})).catch((t=>{console.error("Unable to initialize viewer",t)}))}setPageLabels(t){if(!this.pdfDocument){return}if(!t){this._pageLabels=null}else if(!(Array.isArray(t)&&this.pdfDocument.numPages===t.length)){this._pageLabels=null;console.error(`${this._name}.setPageLabels: Invalid page labels.`)}else{this._pageLabels=t}for(let t=0,e=this._pages.length;t<e;t++){const e=this._pages[t];const r=this._pageLabels&&this._pageLabels[t];e.setPageLabel(r)}}_resetView(){this._pages=[];this._currentPageNumber=1;this._currentScale=i.UNKNOWN_SCALE;this._currentScaleValue=null;this._pageLabels=null;this._buffer=new d(u);this._location=null;this._pagesRotation=0;this._pagesRequests=new WeakMap;this._firstPageCapability=(0,s.createPromiseCapability)();this._onePageRenderedCapability=(0,s.createPromiseCapability)();this._pagesCapability=(0,s.createPromiseCapability)();this._scrollMode=i.ScrollMode.VERTICAL;this._spreadMode=i.SpreadMode.NONE;if(this._onBeforeDraw){this.eventBus._off("pagerender",this._onBeforeDraw);this._onBeforeDraw=null}if(this._onAfterDraw){this.eventBus._off("pagerendered",this._onAfterDraw);this._onAfterDraw=null}this.viewer.textContent="";this._updateScrollMode()}_scrollUpdate(){if(this.pagesCount===0){return}this.update()}_scrollIntoView({pageDiv:t,pageSpot:e=null,pageNumber:r=null}){(0,i.scrollIntoView)(t,e)}_setScaleUpdatePages(t,e,r=false,i=false){this._currentScaleValue=e.toString();if(c(this._currentScale,t)){if(i){this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e})}return}for(let e=0,r=this._pages.length;e<r;e++){this._pages[e].update(t)}this._currentScale=t;if(!r){let t=this._currentPageNumber,e;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)){t=this._location.pageNumber;e=[null,{name:"XYZ"},this._location.left,this._location.top,null]}this.scrollPageIntoView({pageNumber:t,destArray:e,allowNegativeOffset:true})}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:i?e:undefined});if(this.defaultRenderingQueue){this.update()}}_setScale(t,e=false){let r=parseFloat(t);if(r>0){this._setScaleUpdatePages(r,t,e,false)}else{const n=this._pages[this._currentPageNumber-1];if(!n){return}const o=this.isInPresentationMode||this.removePageBorders;let s=o?0:i.SCROLLBAR_PADDING;let a=o?0:i.VERTICAL_PADDING;if(!o&&this._isScrollModeHorizontal){[s,a]=[a,s]}const l=(this.container.clientWidth-s)/n.width*n.scale;const h=(this.container.clientHeight-a)/n.height*n.scale;switch(t){case"page-actual":r=1;break;case"page-width":r=l;break;case"page-height":r=h;break;case"page-fit":r=Math.min(l,h);break;case"auto":const e=(0,i.isPortraitOrientation)(n)?l:Math.min(h,l);r=Math.min(i.MAX_AUTO_SCALE,e);break;default:console.error(`${this._name}._setScale: "${t}" is an unknown zoom value.`);return}this._setScaleUpdatePages(r,t,e,true)}}_resetCurrentPageView(){if(this.isInPresentationMode){this._setScale(this._currentScaleValue,true)}const t=this._pages[this._currentPageNumber-1];this._scrollIntoView({pageDiv:t.div})}scrollPageIntoView({pageNumber:t,destArray:e=null,allowNegativeOffset:r=false,ignoreDestinationZoom:n=false}){if(!this.pdfDocument){return}const o=Number.isInteger(t)&&this._pages[t-1];if(!o){console.error(`${this._name}.scrollPageIntoView: `+`"${t}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!e){this._setCurrentPageNumber(t,true);return}let s=0,a=0;let l=0,h=0,u,d;const c=o.rotation%180!==0;const f=(c?o.height:o.width)/o.scale/i.CSS_UNITS;const v=(c?o.width:o.height)/o.scale/i.CSS_UNITS;let C=0;switch(e[1].name){case"XYZ":s=e[2];a=e[3];C=e[4];s=s!==null?s:0;a=a!==null?a:v;break;case"Fit":case"FitB":C="page-fit";break;case"FitH":case"FitBH":a=e[2];C="page-width";if(a===null&&this._location){s=this._location.left;a=this._location.top}break;case"FitV":case"FitBV":s=e[2];l=f;h=v;C="page-height";break;case"FitR":s=e[2];a=e[3];l=e[4]-s;h=e[5]-a;const t=this.removePageBorders?0:i.SCROLLBAR_PADDING;const r=this.removePageBorders?0:i.VERTICAL_PADDING;u=(this.container.clientWidth-t)/l/i.CSS_UNITS;d=(this.container.clientHeight-r)/h/i.CSS_UNITS;C=Math.min(Math.abs(u),Math.abs(d));break;default:console.error(`${this._name}.scrollPageIntoView: `+`"${e[1].name}" is not a valid destination type.`);return}if(!n){if(C&&C!==this._currentScale){this.currentScaleValue=C}else if(this._currentScale===i.UNKNOWN_SCALE){this.currentScaleValue=i.DEFAULT_SCALE_VALUE}}if(C==="page-fit"&&!e[4]){this._scrollIntoView({pageDiv:o.div,pageNumber:t});return}const g=[o.viewport.convertToViewportPoint(s,a),o.viewport.convertToViewportPoint(s+l,a+h)];let p=Math.min(g[0][0],g[1][0]);let w=Math.min(g[0][1],g[1][1]);if(!r){p=Math.max(p,0);w=Math.max(w,0)}this._scrollIntoView({pageDiv:o.div,pageSpot:{left:p,top:w},pageNumber:t})}_updateLocation(t){const e=this._currentScale;const r=this._currentScaleValue;const i=parseFloat(r)===e?Math.round(e*1e4)/100:r;const n=t.id;let o="#page="+n;o+="&zoom="+i;const s=this._pages[n-1];const a=this.container;const l=s.getPagePoint(a.scrollLeft-t.x,a.scrollTop-t.y);const h=Math.round(l[0]);const u=Math.round(l[1]);o+=","+h+","+u;this._location={pageNumber:n,scale:i,top:u,left:h,rotation:this._pagesRotation,pdfOpenParams:o}}_updateHelper(t){throw new Error("Not implemented: _updateHelper")}update(){const t=this._getVisiblePages();const e=t.views,r=e.length;if(r===0){return}const i=Math.max(u,2*r+1);this._buffer.resize(i,e);this.renderingQueue.renderHighestPriority(t);this._updateHelper(e);this._updateLocation(t.first);this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(t){return this.container.contains(t)}focus(){this.container.focus()}get _isScrollModeHorizontal(){return this.isInPresentationMode?false:this._scrollMode===i.ScrollMode.HORIZONTAL}get isInPresentationMode(){return this.presentationModeState===i.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===i.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?false:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?false:this.container.scrollHeight>this.container.clientHeight}_getCurrentVisiblePage(){if(!this.pagesCount){return{views:[]}}const t=this._pages[this._currentPageNumber-1];const e=t.div;const r={id:t.id,x:e.offsetLeft+e.clientLeft,y:e.offsetTop+e.clientTop,view:t};return{first:r,last:r,views:[r]}}_getVisiblePages(){return(0,i.getVisibleElements)(this.container,this._pages,true,this._isScrollModeHorizontal)}isPageVisible(t){if(!this.pdfDocument){return false}if(t<1||t>this.pagesCount){console.error(`${this._name}.isPageVisible: "${t}" is out of bounds.`);return false}return this._getVisiblePages().views.some((function(e){return e.id===t}))}cleanup(){for(let t=0,e=this._pages.length;t<e;t++){if(this._pages[t]&&this._pages[t].renderingState!==n.RenderingStates.FINISHED){this._pages[t].reset()}}}_cancelRendering(){for(let t=0,e=this._pages.length;t<e;t++){if(this._pages[t]){this._pages[t].cancelRendering()}}}_ensurePdfPageLoaded(t){if(t.pdfPage){return Promise.resolve(t.pdfPage)}if(this._pagesRequests.has(t)){return this._pagesRequests.get(t)}const e=this.pdfDocument.getPage(t.id).then((e=>{if(!t.pdfPage){t.setPdfPage(e)}this._pagesRequests.delete(t);return e})).catch((e=>{console.error("Unable to get page for page view",e);this._pagesRequests.delete(t)}));this._pagesRequests.set(t,e);return e}forceRendering(t){const e=t||this._getVisiblePages();const r=this._isScrollModeHorizontal?this.scroll.right:this.scroll.down;const i=this.renderingQueue.getHighestPriority(e,this._pages,r);if(i){this._ensurePdfPageLoaded(i).then((()=>{this.renderingQueue.renderView(i)}));return true}return false}createTextLayerBuilder(t,e,r,i=false,n){return new h.TextLayerBuilder({textLayerDiv:t,eventBus:n,pageIndex:e,viewport:r,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:this.isInPresentationMode?false:i})}createAnnotationLayerBuilder(t,e,r="",n=false,s=i.NullL10n){return new o.AnnotationLayerBuilder({pageDiv:t,pdfPage:e,imageResourcesPath:r,renderInteractiveForms:n,linkService:this.linkService,downloadManager:this.downloadManager,l10n:s})}get hasEqualPageSizes(){const t=this._pages[0];for(let e=1,r=this._pages.length;e<r;++e){const r=this._pages[e];if(r.width!==t.width||r.height!==t.height){return false}}return true}getPagesOverview(){const t=this._pages.map((function(t){const e=t.pdfPage.getViewport({scale:1});return{width:e.width,height:e.height,rotation:e.rotation}}));if(!this.enablePrintAutoRotate){return t}const e=(0,i.isPortraitOrientation)(t[0]);return t.map((function(t){if(e===(0,i.isPortraitOrientation)(t)){return t}return{width:t.height,height:t.width,rotation:(t.rotation+90)%360}}))}get scrollMode(){return this._scrollMode}set scrollMode(t){if(this._scrollMode===t){return}if(!(0,i.isValidScrollMode)(t)){throw new Error(`Invalid scroll mode: ${t}`)}this._scrollMode=t;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:t});this._updateScrollMode(this._currentPageNumber)}_updateScrollMode(t=null){const e=this._scrollMode,r=this.viewer;r.classList.toggle("scrollHorizontal",e===i.ScrollMode.HORIZONTAL);r.classList.toggle("scrollWrapped",e===i.ScrollMode.WRAPPED);if(!this.pdfDocument||!t){return}if(this._currentScaleValue&&isNaN(this._currentScaleValue)){this._setScale(this._currentScaleValue,true)}this._setCurrentPageNumber(t,true);this.update()}get spreadMode(){return this._spreadMode}set spreadMode(t){if(this._spreadMode===t){return}if(!(0,i.isValidSpreadMode)(t)){throw new Error(`Invalid spread mode: ${t}`)}this._spreadMode=t;this.eventBus.dispatch("spreadmodechanged",{source:this,mode:t});this._updateSpreadMode(this._currentPageNumber)}_updateSpreadMode(t=null){if(!this.pdfDocument){return}const e=this.viewer,r=this._pages;e.textContent="";if(this._spreadMode===i.SpreadMode.NONE){for(let t=0,i=r.length;t<i;++t){e.appendChild(r[t].div)}}else{const t=this._spreadMode-1;let i=null;for(let n=0,o=r.length;n<o;++n){if(i===null){i=document.createElement("div");i.className="spread";e.appendChild(i)}else if(n%2===t){i=i.cloneNode(false);e.appendChild(i)}i.appendChild(r[n].div)}}if(!t){return}this._setCurrentPageNumber(t,true);this.update()}}e.BaseViewer=f},function(t,e,r){Object.defineProperty(e,"__esModule",{value:true});e.PDFViewer=void 0;var i=r(16);var n=r(2);class o extends i.BaseViewer{get _viewerElement(){return(0,n.shadow)(this,"_viewerElement",this.viewer)}_scrollIntoView({pageDiv:t,pageSpot:e=null,pageNumber:r=null}){if(!e&&!this.isInPresentationMode){const r=t.offsetLeft+t.clientLeft;const i=r+t.clientWidth;const{scrollLeft:n,clientWidth:o}=this.container;if(this._isScrollModeHorizontal||r<n||i>n+o){e={left:0,top:0}}}super._scrollIntoView({pageDiv:t,pageSpot:e,pageNumber:r})}_getVisiblePages(){if(this.isInPresentationMode){return this._getCurrentVisiblePage()}return super._getVisiblePages()}_updateHelper(t){if(this.isInPresentationMode){return}let e=this._currentPageNumber;let r=false;for(const i of t){if(i.percent<100){break}if(i.id===e){r=true;break}}if(!r){e=t[0].id}this._setCurrentPageNumber(e)}}e.PDFViewer=o}])}))})(pdf_viewer$1);return pdf_viewer$1.exports}requirePdf_viewer();const findIn=(t,e,r=false,i=false)=>{const n=new Array;const{top:o,left:s,bottom:a,right:l}=e.getBoundingClientRect();t.forEach((t=>{if(t.getBoundingClientRect().bottom<=a&&t.getBoundingClientRect().top>=o&&t.getBoundingClientRect().left>=s&&t.getBoundingClientRect().right<=l){if(r)t.selected=true;n.push(t)}else{if(r&&!i)t.selected=false}}));return n};function addField(t,e){const r=document.createElement("ls-editor-field");r.setAttribute("type",e.formElementType);r.setAttribute("id","ls-field-"+e.id);r.setAttribute("selected","selected");r.style.zIndex="100";r.style.position="absolute";r.style.top=Math.floor(e.top*this.zoom)+"px";r.style.left=Math.floor(e.left*this.zoom)+"px";r.style.height=Math.floor(e.height*this.zoom)+"px";r.style.width=Math.floor(e.width*this.zoom)+"px";r.dataItem=e;t.appendChild(r);return r}function moveField(t,e){t.style.top=Math.floor(e.top*this.zoom)+"px";t.style.left=Math.floor(e.left*this.zoom)+"px";t.style.height=Math.floor(e.height*this.zoom)+"px";t.style.width=Math.floor(e.width*this.zoom)+"px";t.dataItem=e}const findDimensions=(t,e,r)=>{const{top:i,left:n,height:o,width:s}=t.getBoundingClientRect();const a=n>0?n/r:0;const l=i>0?i/e:0;const h=(n+s)/r;const u=(i+o)/e;return{top:i,left:n,height:o,width:s,ax:a,ay:l,bx:h,by:u}};const defaultRolePalette=[{primary:"rgb(50, 124, 244)",faded:"rgb(240, 246, 255)"},{primary:"rgb(70, 219, 170)",faded:"rgb(239, 255, 249)"},{primary:"rgb(240, 182, 24)",faded:"rgb(255, 252, 239)"},{primary:"rgb(238, 229, 255)",faded:"rgb(244, 240, 255)"},{primary:"rgb(240, 86, 178)",faded:"rgb(255, 240, 249)"},{primary:"rgb(189, 240, 86)",faded:"rgb(250, 255, 240)"},{primary:"rgb(246, 74, 68)",faded:"rgb(246, 190, 188)"},{primary:"rgb(58, 0, 166)",faded:"rgb(188, 169, 240)"},{primary:"rgba(1, 179, 34, 0.69)",faded:"rgb(135, 173, 158)"},{primary:"rgb(201, 204, 0)",faded:"rgba(246, 247, 203, 0.77)"},{primary:"rgb(249, 55, 129)",faded:"rgb(255, 237, 244)"},{primary:"rgb(0, 14, 166)",faded:"rgb(209, 212, 243)"},{primary:"rgb(135, 173, 158)",faded:"rgb(205, 244, 228)"},{primary:"rgb(86, 199, 240)",faded:"rgb(202, 236, 248)"},{primary:"rgb(246, 205, 68)",faded:"rgb(244, 240, 255)"},{primary:"rgb(0, 94, 166)",faded:"rgb(188, 169, 240)"},{primary:"rgba(179, 1, 63, 0.69)",faded:"rgb(135, 173, 158)"}];function oob(t){if(t.left+t.width>t.pageDimensions.width||t.top<0||t.left<0||t.top+t.height>t.pageDimensions.height)return true;else return false}function alter(t){const e=this.selected.map((e=>({action:"update",data:t(e.dataItem)})));this.mutate.emit(e);this.update.emit(e)}function debounce(t,e=300){let r;return(...i)=>{clearTimeout(r);r=setTimeout((()=>{t.apply(this,i)}),e)}}function getApiType(t){if(!t?.id)return"invalid";const e=atob(t.id);if(e.length<3)return"invalid";const r=atob(t.id).substring(0,3);switch(r){case"ele":return"element";case"rol":return"role";case"tpl":return"template";case"doc":return"document";default:return"unknown"}}const validationTypes=[{id:0,description:"general purpose",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:30,description:"yyyy/mm/dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:31,description:"yy/mm/dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:32,description:"dd/mm/yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:33,description:"dd/mm/yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:34,description:"mm/dd/yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:35,description:"mm/dd/yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:36,description:"yyyy.mm.dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:37,description:"yy.mm.dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:38,description:"dd.mm.yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:39,description:"dd.mm.yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:40,description:"mm.dd.yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:41,description:"mm.dd.yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:42,description:"yyyy-mm-dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:43,description:"yy-mm-dd (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:44,description:"dd-mm-yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:45,description:"dd-mm-yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:46,description:"mm-dd-yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:47,description:"mm-dd-yy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:48,description:"d mmmm yyyy (auto sign day)",formType:"signing date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:73,description:"Secret Code",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:77,description:"Title caps (force text to title caps)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:78,description:"Uppercase (force text to uppercase)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:79,description:"Lowercase (force text to lowercase)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:65,description:"1 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:66,description:"2 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:67,description:"3 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:68,description:"4 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:69,description:"5 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:70,description:"6 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:71,description:"7 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:72,description:"8 character (any text)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:1e3,description:"First name field (special use)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:1001,description:"Last name field (special use)",formType:"text",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:1,description:"Email",formType:"email",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:1002,description:"Email field (special use)",formType:"email",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:50,description:"Whole number",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"number"},{id:51,description:"Number",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:52,description:"Currency",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:53,description:"1 number",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:54,description:"2 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:55,description:"3 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:56,description:"4 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:57,description:"5 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:58,description:"6 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:59,description:"7 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:60,description:"8 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:61,description:"9 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:62,description:"10 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:63,description:"11 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:64,description:"12 numbers",formType:"number",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"number"},{id:2,description:"yyyy/mm/dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"date"},{id:3,description:"yy/mm/dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:4,description:"dd/mm/yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"date"},{id:5,description:"dd/mm/yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:6,description:"mm/dd/yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:7,description:"mm/dd/yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:80,description:"mm/yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:81,description:"mm/yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:8,description:"yyyy.mm.dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:9,description:"yy.mm.dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:10,description:"dd.mm.yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:11,description:"dd.mm.yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:12,description:"mm.dd.yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:13,description:"mm.dd.yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:82,description:"mm.yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:83,description:"mm.yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:14,description:"yyyy-mm-dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:15,description:"yy-mm-dd",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:16,description:"dd-mm-yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:17,description:"dd-mm-yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:18,description:"mm-dd-yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:19,description:"mm-dd-yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:84,description:"mm-yy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:85,description:"mm-yyyy",formType:"date",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"date"},{id:20,description:"Dropdown List",formType:"dropdown",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:91,description:"Countries",formType:"dropdown",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:92,description:"Name prefix titles",formType:"dropdown",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:24,description:"✔/✗",formType:"checkbox",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:25,description:"✔/empty",formType:"checkbox",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:26,description:"✗/empty",formType:"checkbox",defaultHeight:16,defaultWidth:16,typeDefault:false,inputType:"text"},{id:74,description:"File: attach to confirmatory email to sender",formType:"file",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:75,description:"File: append to PDF, PDF files only",formType:"file",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:76,description:"File: zip with PDF (for internal view, signed PDF for signer)",formType:"file",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:90,description:"Drawn field.",formType:"drawn field",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:2e3,description:"Initials",formType:"initials",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:93,description:"Regular Expression field",formType:"regular expression",defaultHeight:16,defaultWidth:200,typeDefault:false,inputType:"text"},{id:3e3,description:"Auto Sign",formType:"auto sign",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"text"},{id:4e3,description:"Text Area",formType:"textarea",defaultHeight:16,defaultWidth:200,typeDefault:true,inputType:"readonly"}];function getInputType(t){console.log(t,"validation");if(t===null)return validationTypes[0];const e=validationTypes.find((e=>e.id===t));return e===null?validationTypes[0]:e}function keyDown(t){if(this.selected&&this.selected?.length>0){const e=alter.bind(this);if(t.key==="ArrowDown"){console.log("down arrow pressed");e((t=>{const e={...t,top:t.top+1,ay:t.ay+1,by:t.by+1};return oob(e)?t:e}))}else if(t.key==="ArrowUp"){console.log("up arrow pressed");e((t=>{const e={...t,top:t.top-1,ay:t.ay-1,by:t.top-1};return oob(e)?t:e}))}else if(t.key==="ArrowRight"){console.log("right arrow pressed");e((t=>{const e={...t,left:t.left+1,ax:t.ax+1,bx:t.bx+1};return oob(e)?t:e}))}else if(t.key==="ArrowLeft"){console.log("left arrow pressed");e((t=>{const e={...t,left:t.left-1,ax:t.ax-1,bx:t.bx-1};return oob(e)?t:e}))}else if(t.key==="Delete"){const t=Array.from(this.selected);this.update.emit(t.map((t=>({action:"delete",data:t.dataItem}))))}}}function mouseDown(t){if(t.offsetX<0||t.offsetY<0)return;this.hitField=null;const e=this.component.shadowRoot.querySelectorAll("ls-editor-field");e.forEach((e=>{const{left:r,top:i,height:n,width:o,bottom:s,right:a}=e.getBoundingClientRect();const l={left:e.offsetLeft,top:e.offsetTop,height:n,width:o,x:t.screenX,y:t.screenY};this.startMouse=l;if(Math.abs(t.clientX-r)<5&&t.clientY>=i&&t.clientY<=s){this.edgeSide="w";this.hitField=e}else if(Math.abs(t.clientX-a)<5&&t.clientY>=i&&t.clientY<=s){this.edgeSide="e";this.hitField=e}else if(Math.abs(t.clientY-i)<5&&t.clientX>=r&&t.clientX<=a){this.edgeSide="n";this.hitField=e}else if(Math.abs(t.clientY-s)<5&&t.clientX>=r&&t.clientX<=a){this.edgeSide="s";this.hitField=e}else if(t.clientY<=s&&t.clientY>=i&&t.clientX>=r&&t.clientX<=a){this.edgeSide=null;this.hitField=e}}));if(this.hitField){const{height:e,width:r}=this.hitField.getBoundingClientRect();const i={left:this.hitField.offsetLeft,top:this.hitField.offsetTop,height:e,width:r,x:t.screenX,y:t.screenY};this.startMouse=i;const n=this.selected?this.selected:[this.hitField];this.startLocations=n.map((t=>{const{height:e,width:r}=t.getBoundingClientRect();const i=t;return{top:i.offsetTop,left:i.offsetLeft,height:e,width:r}}));this.selectionBox=null}else{this.startLocations=null;this.startMouse=null;this.selectionBox={x:t.clientX,y:t.clientY};this.component.style.cursor="crosshair"}}function mouseMove(t){t.preventDefault();if(this.hitField&&this.edgeSide&&this.startMouse&&t.buttons===1){const e=t.screenX-this.startMouse.x;const r=t.screenY-this.startMouse.y;switch(this.edgeSide){case"n":this.hitField.style.top=this.startMouse.top+r+"px";this.hitField.style.height=this.startMouse.height-r+"px";break;case"s":this.hitField.style.height=this.startMouse.height+r+"px";break;case"e":this.hitField.style.width=this.startMouse.width+e+"px";break;case"w":this.hitField.style.left=this.startMouse.left+e+"px";this.hitField.style.width=this.startMouse.width-e+"px";break}}else if(this.selectionBox&&t.buttons===1){var e=this.component.shadowRoot.getElementById("ls-box-selector");var r=this.component.shadowRoot.getElementById("ls-document-frame");var i=r.getBoundingClientRect().left;var n=r.getBoundingClientRect().top;const o=t.clientX-this.selectionBox.x;const s=t.clientY-this.selectionBox.y;e.style.visibility="visible";e.style.left=(this.selectionBox.x>t.clientX?t.clientX:this.selectionBox.x)-i+r.scrollLeft+"px";e.style.top=(this.selectionBox.y>t.clientY?t.clientY:this.selectionBox.y)-n+r.scrollTop+"px";e.style.width=Math.abs(o)+"px";e.style.height=Math.abs(s)+"px"}else if(this.startLocations&&!this.edgeSide&&this.startMouse&&t.buttons===1){this.isMoving=true;const e=t.screenX-this.startMouse.x;const r=t.screenY-this.startMouse.y;if(this.selected?.length){for(let t=0;t<this.selected.length;t++){this.selected[t].style.left=this.startLocations[t].left+e+"px";this.selected[t].style.top=this.startLocations[t].top+r+"px"}}}}function mouseUp(t){this.edgeSide=null;this.startMouse=null;this.component.style.cursor="auto";if(this.selectionBox){var e=this.component.shadowRoot.getElementById("ls-box-selector");var r=this.component.shadowRoot.querySelectorAll("ls-editor-field");e.style.visibility="hidden";findIn(r,e,true,t.shiftKey);var i=this.component.shadowRoot.querySelectorAll("ls-editor-field");this.selectFields.emit(Array.from(i).filter((t=>t.selected)).map((t=>t.dataItem)));this.selectionBox=null;this.selected=Array.from(i).filter((t=>t.selected))}}function mouseClick(t){if(this.isMoving){this.isMoving=false;const t=this.component.shadowRoot.querySelectorAll("ls-editor-field");const e=Array.from(t).filter((t=>t.selected));this.selectFields.emit(e.map((t=>t.dataItem)));this.mutate.emit(Array.from(t).filter((t=>t.selected)).map((t=>{const e={...t.dataItem,...findDimensions(t,this.pageDimensions[this.pageNum-1].height,this.pageDimensions[this.pageNum-1].width)};t.dataItem=e;return{action:"update",data:e}})))}else{const e=this.component.shadowRoot.querySelectorAll("ls-editor-field");e.forEach((r=>{const{left:i,top:n,bottom:o,right:s}=r.getBoundingClientRect();if(t.clientY<=o&&t.clientY>=n&&t.clientX>=i&&t.clientX<=s){this.edgeSide=null;this.hitField=r;if(!t.shiftKey)e.forEach((t=>t.selected=false));r.selected=true}}));this.selected=Array.from(e).filter((t=>t.selected));this.selectFields.emit(this.selected.map((t=>t.dataItem)))}}const lsDocumentViewerCss="*,*::before,*::after{box-sizing:border-box}*{margin:0}@media (prefers-reduced-motion: no-preference){html{interpolate-size:allow-keywords}}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}#root,#__next{isolation:isolate}:host{display:flex;flex-direction:row;width:100vw;height:100vh;margin:0px;padding:0px}.leftBox{display:flex;flex-direction:row;min-width:250px;width:250px;border:1px gray solid}.rightBox{width:200px;border:1px gray solid;width:470px;min-width:390px;padding:4px;font-family:inherit}.toolbox{display:flex;flex-direction:column;width:250px;left:0px}.ls-editor-infobox{padding:2px 8px 2px 8px;color:#727272}#pdf-canvas{top:0px;left:0px;width:100%;height:100%}#ls-mid-area{display:flex;flex-direction:column;width:100%}#ls-document-frame{background-image:repeating-linear-gradient(rgba(175, 176, 178, 0.4) 0px, rgba(175, 176, 178, 0.4) 1px, transparent 1px, transparent 100%), repeating-linear-gradient(90deg, rgba(175, 176, 178, 0.4) 0px, rgba(175, 176, 178, 0.4) 1px, transparent 1px, transparent 100%);border:4px rgb(126, 126, 126) solid;position:relative;min-width:60vw;width:100%;height:98vh;max-width:100%;max-height:100%;margin:0px;padding:2px;overflow-x:scroll;overflow-y:scroll;background-color:rgb(181, 181, 181);scrollbar-width:auto;scrollbar-color:auto}.prevButton{position:relative;bottom:30px}.nextButton{position:relative;bottom:30px}.fieldBox{z-index:1000}#ls-box-selector{position:absolute;visibility:hidden;background-color:transparent;border:1px rgba(71, 71, 71, 0.716) dashed}#ls-editor-form{display:flex;flex-direction:row;width:100vw}.hidden{visibility:hidden;display:none;width:0px}";pdfExports.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.5.207/pdf.worker.min.js";const LsDocumentViewer=class{constructor(t){registerInstance(this,t);this.pageRendered=createEvent(this,"pageRendered");this.pageChange=createEvent(this,"pageChange");this.selectFields=createEvent(this,"selectFields");this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}get component(){return getElement(this)}isPageRendering;pdfDocument;pageNumPending=null;canvas;ctx;pageDimensions;isMoving=false;selectionBox=null;hitField;edgeSide;startLocations;startMouse;template;zoom=1;pageNum=1;_template;selected;mode="custom";modeHandler(t,e){if(t==="preview"){this.showtoolbar=false;this.showtoolbox=false;this.showstatusbar=false;this.showrightpanel=false;this.readonly=true}else if(t==="editor"){this.showtoolbar=true;this.showtoolbox=true;this.showstatusbar=true;this.showrightpanel=true;this.readonly=false}}tableViewHandler(t,e){if(t===true){this.showPageFields(-1)}else if(t==="editor"){this.showPageFields(this.pageNum)}this.queueRenderPage(this.pageNum)}manager="toolbox";selectedHandler(t,e){var r=this.component.shadowRoot.getElementById("ls-toolbar");r.dataItem=t}displayTable=false;showtoolbox=false;showtoolbar=false;showstatusbar=false;showpagepreview=false;showrightpanel=false;readonly=false;showtableview=false;toolboxFilter=null;roleColors=defaultRolePalette;parseTemplate(t){const e=t;const r=JSON.parse(JSON.parse(e.pageDimensions));this.pageDimensions=r.map((t=>({height:t[1],width:t[0]})));const i=e.elementConnection.templateElements.map((t=>({...t,top:t.ay*r[0].height,left:t.ax*r[0].width,height:(t.by-t.ay)*r[0].height,width:(t.bx-t.ax)*r[0].width})));this._template={...e,elementConnection:{...e.elementConnection,templateElements:i}}}pageRendered;pageChange;selectFields;mutate;update;mutateHandler(t){if(t.detail)t.detail.forEach((t=>this.syncChange(t)))}async pageNext(){if(this.pageNum>=this.pdfDocument.numPages){return}this.pageNum+=1;this.queueRenderPage(this.pageNum);this.showPageFields(this.pageNum)}async pagePrev(){if(this.pageNum<=1){return}this.pageNum-=1;this.queueRenderPage(this.pageNum);this.showPageFields(this.pageNum)}async setZoom(t){this.zoom=t;this.canvas=this.component.shadowRoot.getElementById("pdf-canvas");this.canvas.style.height=this.pageDimensions[this.pageNum-1].height*this.zoom+"px";this.canvas.style.width=this.pageDimensions[this.pageNum-1].width*this.zoom+"px";this.component.shadowRoot.querySelectorAll("ls-editor-field").forEach((t=>moveField.bind(this)(t,t.dataItem)));this.queueRenderPage(this.pageNum);this.showPageFields(this.pageNum)}renderPage(t){this.isPageRendering=true;this.pdfDocument.getPage(t).then((t=>{const e=t.getViewport({scale:this.zoom});this.canvas.height=Math.floor(e.height/this.zoom);this.canvas.width=Math.floor(e.width/this.zoom);const r={viewport:e,canvasContext:this.ctx};const i=t.render(r);i.promise.then((()=>{this.isPageRendering=false;this.pageRendered.emit(this.pageNum);if(this.pageNumPending!==null){this.renderPage(this.pageNumPending);this.pageChange.emit(this.pageNumPending);this.pageNumPending=null}}))}))}queueRenderPage(t){if(this.isPageRendering){this.pageNumPending=t}else{this.renderPage(t)}}loadAndRender(t){pdfExports.getDocument(t).promise.then((t=>{this.pdfDocument=t;this.renderPage(this.pageNum)}))}prepareElement(t){return{...t,top:Math.floor(t.ay*this.pageDimensions[t.page-1].height),left:Math.floor(t.ax*this.pageDimensions[t.page-1].width),height:Math.floor((t.by-t.ay)*this.pageDimensions[t.page-1].height),width:Math.floor((t.bx-t.ax)*this.pageDimensions[t.page-1].width),pageDimensions:this.pageDimensions[t.page-1]}}syncChange(t){console.log(getApiType(t.data),"sync");if(getApiType(t.data)==="element"){if(t.action==="create"){const e={...t.data,page:this.pageNum};addField.bind(this)(this.component.shadowRoot.getElementById("ls-document-frame"),e);const r=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);this.selected=[r];this.selectFields.emit([e])}else if(t.action==="update"){const e=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);if(e){moveField.bind(this)(e,t.data);const r=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);r.dataItem=t.data;this.selected=this.selected.map((e=>e.dataItem.id===t.data.id?r:e))}const r=this.component.shadowRoot.querySelectorAll("ls-editor-field");this.selected=Array.from(r).filter((t=>t.selected))}else if(t.action==="delete"){const e=this.component.shadowRoot.getElementById("ls-field-"+t.data.id);this.component.shadowRoot.getElementById("ls-document-frame").removeChild(e);this.selected=[]}else{console.warn("Unrecognised action, check Legalesign documentation. `create`, `update` and `delete` allowed.")}}}componentDidLoad(){console.log("Baking your PDF");PDFDocument.create().then((t=>{const e=t.addPage([842,595]);const r=t.addPage([842,595]);e.moveTo(50,410);e.drawText("Welcome to Legalesign!");r.moveTo(500,50);r.drawText("Page 2");t.saveAsBase64({dataUri:true}).then((t=>{this.canvas=this.component.shadowRoot.getElementById("pdf-canvas");this.canvas.style.height=this.pageDimensions[this.pageNum-1].height*this.zoom+"px";this.canvas.style.width=this.pageDimensions[this.pageNum-1].width*this.zoom+"px";this.ctx=this.canvas.getContext("2d");this.loadAndRender(t)}))}));var t=this.component.shadowRoot.getElementById("ls-document-frame");t.addEventListener("click",mouseClick.bind(this));t.addEventListener("mousedown",mouseDown.bind(this));t.addEventListener("mousemove",mouseMove.bind(this));t.addEventListener("mouseup",mouseUp.bind(this));document.addEventListener("keydown",keyDown.bind(this));t.addEventListener("dragenter",(t=>{t.preventDefault()}));t.addEventListener("dragover",(t=>{t.preventDefault()}));t.addEventListener("drop",(t=>{t.preventDefault();try{const r=JSON.parse(t.dataTransfer.getData("application/json"));this.component.shadowRoot.querySelectorAll("ls-editor-field").forEach((t=>t.selected=false));var e=this.component.shadowRoot.getElementById("ls-document-frame");const i=btoa("ele"+crypto.randomUUID());const n={action:"create",data:{...r,id:i,value:"",top:t.offsetY*this.zoom+e.scrollTop,left:t.offsetX*this.zoom+e.scrollLeft,height:r.defaultHeight,width:r.defaultWidth,pageDimensions:this.pageDimensions[this.pageNum-1],fontName:"courier",fontSize:10,align:"left",signer:1,elementType:r.type}};this.mutate.emit([n]);this.update.emit([n])}catch(t){console.error(t)}}));this._template.elementConnection.templateElements.forEach((t=>{addField.bind(this)(this.component.shadowRoot.getElementById("ls-document-frame"),this.prepareElement(t))}))}showPageFields(t){const e=this.component.shadowRoot.querySelectorAll("ls-editor-field");Array.from(e).forEach((e=>{e.className=e.dataItem.page===t?"":"hidden"}))}componentWillLoad(){if(this.template){this.parseTemplate(this.template)}}render(){return h(Host,{key:"fa4c4384dec1f5dd491dceb408d26aa13f968b2c"},h("form",{key:"e4ce6bd8dbd23d4622a7e0b4370c1de7946990ec",id:"ls-editor-form"},this.showtoolbox===true?h("div",{class:"leftBox"},h("ls-feature-column",{onManage:t=>{if(t.detail==="document"){var e=this.component.shadowRoot.getElementById("ls-document-options");e.template=this._template}else if(t.detail==="participant"){console.log(this._template);var r=this.component.shadowRoot.getElementById("ls-participant-manager");r.template=this._template}this.manager=t.detail}}),h("div",{id:"ls-toolbox",class:this.manager==="toolbox"?"toolbox":"hidden"},h("div",{class:"ls-editor-infobox"},"Drag to Add..."),h("ls-toolbox-field",{elementType:"signature",formElementType:"signature",label:"Signature",defaultHeight:27,defaultWidth:120,validation:0}),h("ls-toolbox-field",{elementType:"text",formElementType:"text",label:"Text",defaultHeight:27,defaultWidth:100,validation:0}),h("ls-toolbox-field",{elementType:"email",formElementType:"email",label:"Email",defaultHeight:27,defaultWidth:120,validation:1}),h("ls-toolbox-field",{elementType:"number",formElementType:"number",label:"Number",defaultHeight:27,defaultWidth:80,validation:50}),h("ls-toolbox-field",{elementType:"date",formElementType:"date",label:"Date",defaultHeight:27,defaultWidth:80,validation:2}),h("ls-toolbox-field",{elementType:"checkbox",formElementType:"checkbox",label:"Checkbox",defaultHeight:27,defaultWidth:27,validation:25}),h("ls-toolbox-field",{elementType:"auto sign",formElementType:"auto sign",label:"Auto Sign",defaultHeight:27,defaultWidth:120,validation:3e3}),h("ls-toolbox-field",{elementType:"initials",formElementType:"initials",label:"Initials",defaultHeight:27,defaultWidth:120,validation:2e3}),h("ls-toolbox-field",{elementType:"regex",formElementType:"regex",label:"Regex",defaultHeight:27,defaultWidth:120,validation:93}),h("ls-toolbox-field",{elementType:"image",formElementType:"image",label:"Image",defaultHeight:27,defaultWidth:120,validation:90}),h("ls-toolbox-field",{elementType:"signing date",formElementType:"signing date",label:"Signing Date",defaultHeight:27,defaultWidth:120,validation:30}),h("ls-toolbox-field",{elementType:"file",formElementType:"file",label:"File",defaultHeight:27,defaultWidth:120,validation:74})),h("ls-participant-manager",{id:"ls-participant-manager",class:this.manager==="participant"?"toolbox":"hidden",editor:this}),h("ls-document-options",{id:"ls-document-options",class:this.manager==="document"?"toolbox":"hidden"})):h(h.Fragment,null),h("div",{key:"f5e1bc777374f8dae7cbd99f9f077f3c6e42dc60",id:"ls-mid-area"},h("ls-toolbar",{key:"8c0f22b891b90cf62cbcdd872f7c8142d98a00d1",id:"ls-toolbar",dataItem:this.selected?this.selected.map((t=>t.dataItem)):null,template:this._template}),h("div",{key:"01036d8b5ef6a98e3f9f74c803bca29bfc421fd3",id:"ls-document-frame"},h("canvas",{key:"77db91bbd2470e1931fdf63a51624be17650de56",id:"pdf-canvas",class:this.displayTable?"hidden":""}),h("ls-editor-table",{key:"b19d0c2b817595c9da3f0f81daef0ec61a60da72",editor:this,class:this.displayTable?"":"hidden"}),h("div",{key:"414f48d0e0e55e8f7fdf9eb85a42585f47dd8e23",id:"ls-box-selector"})),h("ls-statusbar",{key:"75d1f66e537d05a6d900a69c91673b8252f7e212",editor:this})),this.showrightpanel&&!this.displayTable&&this.selected&&this.selected.length>0&&h("div",{key:"098750708452822ff4b84a93633a2aa982e4c661",class:"rightBox"},h("slot",{key:"44d19903806474b9c99d91b60c1c80e6bf0ef58d"}))))}static get watchers(){return{mode:["modeHandler"],displayTable:["tableViewHandler"],selected:["selectedHandler"]}}};LsDocumentViewer.style=lsDocumentViewerCss;const lsEditorFieldCss=":host{display:block;position:absolute;border:1px solid rgb(49, 49, 49);margin:0px;padding:0px 0px 0px 0px;isolation:isolate}.ls-editor-field-editable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;border:0px solid #000;margin:0;padding:0px 0px 0px 0px;min-width:2em;background-color:white;height:100%;width:100%}.ls-editor-field-editable:focus{outline:none}.ls-editor-field-draggable{display:block;font-family:inherit;font-size:inherit;overflow:hidden;white-space:nowrap;background-color:white;min-width:2px;height:98%;width:98%}.is-selected{border:1px dotted rgb(193, 26, 26)}.hidden-field{display:none}.draggable-input{font-family:inherit;font-size:inherit;position:relative;height:95%;width:95%}.editing-input{caret-color:rgb(15 23 42);caret-shape:auto;height:100%;width:100%}";const LsEditorField=class{constructor(t){registerInstance(this,t)}get component(){return getElement(this)}dataItem;selected;readonly;palette;type;page;isEditing=false;heldEdge=null;isEdgeDragging=false;innerValue;sizeObserver;handleInput(t){if(t.code==="Enter"){this.isEditing=false;this.sizeObserver.observe(this.component.shadowRoot.getElementById("field-info"))}}handleMouseMove(t){if(this.readonly)return;if(!t.clientX)return;if(Math.abs(t.offsetX)<5){this.component.style.cursor="ew-resize"}else if(Math.abs(t.offsetX-this.component.clientWidth)<5){this.component.style.cursor="ew-resize"}else if(Math.abs(t.offsetY)<5){this.component.style.cursor="ns-resize"}else if(Math.abs(t.offsetY-this.component.clientHeight)<5){this.component.style.cursor="ns-resize"}else{this.component.style.cursor="move"}}handleDoubleClick(){if(this.readonly)return;this.isEditing=true;this.heldEdge=null;this.isEdgeDragging=false;this.sizeObserver.disconnect();this.innerValue=this.innerValue?this.innerValue:this.dataItem?.value;const t=this.component.shadowRoot.getElementById("editing-input");console.log(t);if(t){t.className="ls-editor-field-editable";t.focus()}}handleDragStart(t){console.log("dragstart ls-editor-field",t,this.type);t.dataTransfer.setData("application/json",JSON.stringify({type:this.type}));t.dataTransfer.dropEffect="move"}watchSelectedHandler(t,e){if(t)this.component.style.border="1px dotted red";else this.component.style.border="1px solid black"}onInputChange(t){this.innerValue=t.target.value}componentDidLoad(){this.sizeObserver=new ResizeObserver((t=>{for(const e of t){if(e.contentRect){const t=this.component.shadowRoot.getElementById("field-info");t.style.height=e.contentRect.height+"px";t.style.width=e.contentRect.width+"px"}}}));this.sizeObserver.observe(this.component);if(this.selected)this.component.style.border="1px dotted red";else this.component.style.border="1px solid black"}render(){return h(Host,{key:"1768aa1f0591c1094aee697e8d8a99c5bb769369",class:{"ls-editor-field":true,"is-selected":this.selected}},h("input",{key:"ce5806dd692551c27d270f6bac41e038016f8067",id:"editing-input",class:this.isEditing?"ls-editor-field-editable":"hidden-field",type:getInputType(this.dataItem.validation).inputType,value:this.dataItem?.value||this.innerValue,onChange:t=>this.onInputChange(t)}),h("div",{key:"1a102290f8e8a860e8d72c2af6505facd8cf821b",id:"field-info",class:this.isEditing?"hidden-field":"ls-editor-field-draggable"},this.innerValue||this.dataItem?.label||this.dataItem?.formElementType))}static get watchers(){return{selected:["watchSelectedHandler"]}}};LsEditorField.style=lsEditorFieldCss;const lsEditorTableCss=":host{display:block;z-index:100;position:absolute;top:0px;left:0px}table{background-color:azure;border:1px solid black}td{border:1px solid black}";const LsEditorTable=class{constructor(t){registerInstance(this,t)}get component(){return getElement(this)}editor;componentDidLoad(){var t=this.component.shadowRoot.getElementById("ls-editor-table");Array.from(this.editor.component.shadowRoot.querySelectorAll("ls-editor-field")).forEach((e=>{const r=document.createElement("tr");const i=document.createElement("td");i.innerText=e.dataItem.id;r.appendChild(i);const n=document.createElement("td");n.innerText=e.dataItem.value;r.appendChild(n);const o=document.createElement("td");o.innerText=e.dataItem.label;r.appendChild(o);t.appendChild(r)}))}render(){return h(Host,{key:"271021e59ed37d9847e1cdfa84ad1de54381f08b"},h("table",{key:"7649085181f45356f016dcf8318a51c72cd2563e",id:"ls-editor-table"}),h("slot",{key:"cb439f2cc88560c780390a970e641f4243fcf736"}))}};LsEditorTable.style=lsEditorTableCss;const lsFeatureColumnCss=":host{display:block;padding:4px}.activeIcon{background-color:aliceblue}";const LsFeatureColoumn=class{constructor(t){registerInstance(this,t);this.manage=createEvent(this,"manage")}manager="toolbox";manage;render(){return h(Host,{key:"14030230876b89f69c4f404d3a9bb2d0df08231a"},h("ls-icon",{key:"da8716822dfecf75167ad79f27eec08d4aca4b78",name:"document",size:"36",class:this.manager==="document"?"activeIcon":"",onClick:()=>{console.log("document");this.manage.emit("document");this.manager="document"}}),h("ls-icon",{key:"9f191cb42e9c7e28a3988299dcb2817d6c33160d",name:"typing-input",size:"36",class:this.manager==="toolbox"?"activeIcon":"",onClick:()=>{this.manage.emit("toolbox");this.manager="toolbox"}}),h("ls-icon",{key:"fa0d54ab0996a3816eb0bfcc7c363f08735ebdb2",name:"user-group",size:"36",class:this.manager==="participant"?"activeIcon":"",onClick:()=>{this.manage.emit("participant");this.manager="participant"}}),h("slot",{key:"d8be0feee6199125d8755b66a41415a281e59811"}))}};LsFeatureColoumn.style=lsFeatureColumnCss;const lsFieldAlignmentCss=":host{display:inline-block;vertical-align:middle}button{display:inline-flex;background-color:transparent;min-width:24px;min-height:24px;border-radius:0.5rem;margin:0.25rem;width:27px;height:27px;justify-content:center;vertical-align:middle;border:0}button:hover{background-color:rgb(219, 219, 219)}";const LsFieldAlignment=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;alter(t){console.log(t);const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}right(){const t=this.dataItem.reduce(((t,e)=>e.left+e.width<t?t:e.left+e.width),0);console.log(t);const e=this.dataItem.map((e=>{const r=t-e.width;return{action:"update",data:{...e,left:r,ax:r,bx:r+e.width}}}));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}center(){const t=this.dataItem.reduce(((t,e)=>{console.log(t+(e.left+e.width/2));return t+(e.left+e.width/2)}),0);console.log(t);const e=t/this.dataItem.length;console.log("centerposition",e);const r=this.dataItem.map((t=>{const r=t.left+(e-(t.left+t.width/2));return{action:"update",data:{...t,left:r,ax:r,bx:r+t.width}}}));console.log(r);this.dataItem=r.map((t=>t.data));this.mutate.emit(r);this.update.emit(r)}top(){const t=this.dataItem.reduce(((t,e)=>e.top<t?t:e.top),0);this.alter({top:t})}left(){const t=this.dataItem.reduce(((t,e)=>e.left<t?e.left:t),this.dataItem[0].left);this.alter({left:t})}middle(){const t=this.dataItem.reduce(((t,e)=>{console.log(t+(e.top+e.height/2));return t+(e.top+e.height/2)}),0);const e=t/this.dataItem.length;const r=this.dataItem.map((t=>{const r=t.top+(e-(t.top+t.height/2));return{action:"update",data:{...t,top:r,ay:r,by:r+t.height}}}));this.dataItem=r.map((t=>t.data));this.mutate.emit(r);this.update.emit(r)}bottom(){const t=this.dataItem.reduce(((t,e)=>t>e.top+e.height?t:e.top+e.height),0);const e=this.dataItem.map((e=>{const r=t-e.height;return{action:"update",data:{...e,top:r,ay:r,by:r+e.height}}}));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}render(){return h(Host,{key:"a1de6bebd7aa25015b5d6891b6c61bda3bd16011"},h("div",{key:"9f2dd99bd6ebc7b605e47101c830ecbdfbd24641"},h("button",{key:"dcab63a0567dde0cd54fd81be729a263fea86a8d",onClick:()=>this.left(),class:"ls-round-button","aria-label":"Align selected fields vertically about their left edge.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"998fa6e15a29c7816f0b43924bb4e0663609109a",name:"field-alignment-left"})),h("button",{key:"4d83647c277e38deb0e271e6d29025d38baaaf3a",onClick:()=>this.center(),class:"ls-round-button","aria-label":"Align selected fields vertically about their centre.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"6aa90fce22792e031d9b868c5d1af2a332d99264",name:"field-alignment-centre"})),h("button",{key:"dce8bc883871937bc750a1967a733e141a51923f",onClick:()=>{this.right()},"aria-label":"Align selected fields vertically about their right edge.",class:"ls-round-button","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"c9d819e0a2b71e2b9cdc133114fdee15cac65807",name:"field-alignment-right"})),h("button",{key:"dd30c144e877fba3e55b5febbbcce282ce5b4f36",onClick:()=>this.top(),class:"ls-round-button","aria-label":"Align selected fields by their top.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"10be3c90695db9182b245ac0deee7b549d68728b",name:"field-alignment-top"})),h("button",{key:"8379fe058c20e6a6e7a38b5dacf2f2fe54767767",onClick:()=>this.middle(),class:"ls-round-button","aria-label":"Align selected fields by their middles.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"39cb5c2d0d50878dc46012590fab6c801064001e",name:"field-alignment-middle"})),h("button",{key:"2b2b7d4b14910b0b7405a72ca84b784436d3279b",onClick:()=>this.bottom(),class:"ls-round-button","aria-label":"Align selected fields by their bottoms.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Shift + Select multiple fields to access this control","data-tooltip-place":"top"},h("ls-icon",{key:"b8d043ebb45ebde2b458c80a2dc740311c3597d2",name:"field-alignment-bottom"}))),h("slot",{key:"6d8308e909e44447b868cc943858ec5f539ef644"}))}};LsFieldAlignment.style=lsFieldAlignmentCss;const lsFieldDimensionsCss=":host{display:block}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldDimensions=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;isSingle(t){return t.length===undefined}isMultiple(t){return typeof t.length==="number"}alter(t){console.log(t);if(this.isMultiple(this.dataItem)){const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}else{const e={action:"update",data:{...this.dataItem,...t}};this.dataItem=e.data;this.mutate.emit([e]);this.update.emit([e])}}render(){return h(Host,{key:"41458b8320c87c3f771a9a854e6e63bb90f598d9"},this.isMultiple(this.dataItem)&&h("div",{key:"0fe39be49300393e3e04c5ab0b1b7fbf2aba9e91",class:"ls-field-properties-section"},h("div",{key:"97d5f4502f6a33c42dcdfa7223f03dec0ed9c20f"},"Height: ",h("input",{key:"c6bbffba5356dcc5a30a9e372b107b975fb4a978",value:"",onChange:t=>this.alter({height:t.target.value}),width:"30"})),h("div",{key:"f87c1642300bbd48f276a3272bf39ce358774053"},"Width: ",h("input",{key:"82c911e73d3ecf061543bf746454cf304c255520",value:"",onChange:t=>this.alter({width:t.target.value}),width:"30"})),h("div",{key:"d4c9ded48c9a15bd5206aff3d3de813d952e632c"},"Top: ",h("input",{key:"c630505111a020a5ed32ba810a93e1d0eb4b3b61",value:"",onChange:t=>this.alter({top:t.target.value}),width:"30"})),h("div",{key:"51a7944b48838a24258505975700490a835e3d22"},"Left: ",h("input",{key:"1aabde21999546c090920cba9f9738614cbf6b6d",value:"",onChange:t=>this.alter({left:t.target.value}),width:"30"}))),this.isSingle(this.dataItem)&&h("div",{key:"62f9595ab77522c2d193531b78aeeb272fe5ae23",class:"ls-field-properties-section"},h("div",{key:"8c5d82f9e61ad4cba9c219d634e2df442a50098f"},"Height: ",h("input",{key:"0f045e5dc1fce3e86d312f085911bfa9970ab229",value:this.dataItem?.height,onChange:t=>this.alter({height:t.target.value}),width:"30"})),h("div",{key:"91626cc698e9d0b4daef997e13007f3f2a8acbdb"},"Width: ",h("input",{key:"cbf6faed034cabfaa6458d724c024643b33a344b",value:this.dataItem?.width,onChange:t=>this.alter({width:t.target.value}),width:"30"})),h("div",{key:"1216fc1ee08fc41b0ba8b09d8df23cfd2c0e9d49"},"Top: ",h("input",{key:"2071fae101442384f28885d8d68a409fc2932ec8",value:this.dataItem?.top,onChange:t=>this.alter({top:t.target.value}),width:"30"})),h("div",{key:"4a0351e88cf55bbaa872630dd24e64e4763b6679"},"Left: ",h("input",{key:"23e7033f18a899e31122fc67b09cbcef74e92098",value:this.dataItem?.left,onChange:t=>this.alter({left:t.target.value}),width:"30"}))))}};LsFieldDimensions.style=lsFieldDimensionsCss;const lsFieldDistributeCss=":host{display:inline-block;vertical-align:middle}button{display:inline-flex;background-color:transparent;min-width:24px;min-height:24px;border-radius:0.5rem;margin:0.25rem;width:27px;height:27px;justify-content:center;vertical-align:middle;border:0}button:hover{background-color:gray}.ls-toolbar-numeric{width:45px;max-height:18px;margin:0px;padding:0px}";const LsFieldDistribute=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;get component(){return getElement(this)}alter(t){console.log(t);const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}distributeHorizontal(){var t=this.component.shadowRoot.getElementById("ls-fix-horizontal-space");var e=0;const r=this.dataItem.sort(((t,e)=>t.left-e.left));if(t.value!==""){e=parseInt(t.value)}else{var i=0;for(var n=1;n<r.length;n++){const t=r[n-1];const e=r[n];i=i+(e.left-t.left-t.width<=0?0:e.left-t.left-t.width)}e=Math.floor(i/r.length)}var o=r[0].left;const s=r.map((t=>{const r=o;o=o+t.width+e;return{action:"update",data:{...t,left:r,ax:r,bx:r+t.width}}}));this.dataItem=s.map((t=>t.data));this.mutate.emit(s);this.update.emit(s)}distributeVertical(){var t=this.component.shadowRoot.getElementById("ls-fix-vertical-space");var e=0;const r=this.dataItem.sort(((t,e)=>t.top-e.top));if(t.value!=="")e=parseInt(t.value);else{var i=0;for(var n=1;n<r.length;n++){const t=r[n-1];const e=r[n];i=i+(e.top-t.top-t.height<=0?0:e.top-t.top-t.height)}e=Math.floor(i/r.length)}var o=r[0].top;const s=r.map((t=>{const r=o;o=o+t.height+e;return{action:"update",data:{...t,top:r,ay:r,by:r+t.height}}}));this.dataItem=s.map((t=>t.data));this.mutate.emit(s);this.update.emit(s)}render(){return h(Host,{key:"e34dae85e1ad46318881567b8295e4a5cecd8222"},h("div",{key:"0174acf02458bb7edfbb5a273208bae26213413f",class:"flex rounded-[10px] focus:outline-hidden focus:ring-4 focus:ring-offset-0 focus:ring-primary-30"},h("button",{key:"46455263311fa1ceaa24d95159b50190ece6b4d9",class:"ls-round-button",onClick:()=>{this.distributeHorizontal()},"aria-label":"Distribute selected fields horizontally.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Distribute selected fields horizontally.","data-tooltip-place":"top"},h("ls-icon",{key:"fcba8edda613a4f49fd28f0fbdde8be16847a59d",name:"field-distribute-horizontally"})),h("input",{key:"7369af7c27647ce8dfffc12fcbb4f25ce85590a3",type:"number",class:"ls-toolbar-numeric",id:"ls-fix-horizontal-space",value:"",size:4,min:0,max:9999}),h("button",{key:"3a6885343f04b8e38ae016440355c09b715c6600",onClick:()=>{this.distributeVertical()},class:"ls-round-button","aria-label":"Distribute selected fields vertically.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Distribute selected fields vertically.","data-tooltip-place":"top"},h("ls-icon",{key:"67cfe264bf0d8e03db9c47e999497708ec80e232",name:"field-distribute-vertically"})),h("input",{key:"7521df1e46b1c42ee0b67be3792e13a64ac33d67",type:"number",class:"ls-toolbar-numeric",id:"ls-fix-vertical-space",value:"",size:4,min:0,max:9999})),h("slot",{key:"3ed38b0cd5d436adf30e2eb1cd846d84986aade1"}))}};LsFieldDistribute.style=lsFieldDistributeCss;const lsFieldFormatCss=":host{display:flex;flex-direction:row}.ls-field-format-bar{display:flex;flex-direction:row}";const LsFieldFormat=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;get component(){return getElement(this)}alter(t){console.log(t);const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}render(){return h(Host,{key:"f7e1e01dd3519de4af0022ca839788f34622c0fe"},this.dataItem&&this.dataItem.length>1&&h("div",{key:"163d45e33489c20cfcfe100d1028bd462c7dab06",class:"ls-field-format-bar"},h("select",{key:"0bb51866dcac394ce70dff226088d2844837b32b",onChange:t=>{this.alter({fontName:t.target.value})}},h("option",{key:"a7e93b92114cfdfd595e76065dc072b7bb299bee",value:"arial"},"Arial"),h("option",{key:"c9d8c116fe38e2ec32c7b013f6fc3bc1c838520f",value:"liberation sans"},"Liberation Sans"),h("option",{key:"f36de6a494483f88cf82cd5d88c44be104c3daaf",value:"courier"},"Courier"),h("option",{key:"2ed6572a993ddd23746c858a57731cbdae4b4b1e",value:"helvetica"},"Helvetica"),h("option",{key:"5b9f95a6d02f6930ab7de9cb32fb605e8c18c639",value:"verdana"},"Verdana")),h("input",{key:"12f74056dce07d5ce41ed49f5c4c95fdbafe2382",width:"30",size:4}),h("select",{key:"a338fa91aa733ddba78c7df0d94e718f2f08445e"},h("option",{key:"d853cea035c0d5f70cd8879d13ee167a1ea5facb",value:"left"},"Left"),h("option",{key:"5a90a02f0b8257308ac6195ebed26849bc7d4fc9",value:"center"},"Center"),h("option",{key:"839dcb1c2bb6596a95c3272ea27b45f7162654cd",value:"right"},"Right"))),this.dataItem&&this.dataItem.length===1&&h("div",{key:"f91a4bb284252b4f94a7fe0361ebf04db53dc248",class:"ls-field-format-bar"},h("select",{key:"4cacd3c4864048da1b34fc301fa17d2f29f7cc6f",onChange:t=>{console.log(t.target.value)}},h("option",{key:"258b4d127ee30c3f84030007c721e7c8aae423ee",value:"arial"},"Arial"),h("option",{key:"ac6cc118d6485d1053c89b93193ca2eecca50447",value:"liberation sans"},"Liberation Sans"),h("option",{key:"8f243ec5c570276a127bcd31447fbf8594cd81b1",value:"courier"},"Courier"),h("option",{key:"074812fa4249944a00e12cae6c82cb4dfc790a7a",value:"helvetica"},"Helvetica"),h("option",{key:"45af76ec7273b9b64734e3f20c75bc684a7439c7",value:"verdana"},"Verdana")),h("input",{key:"5890944f1aa3581aa40f34b15cafef242e0a8484",width:"30",size:4,value:this.dataItem[0].fontSize}),h("select",{key:"716ffb6b12c307c95ddadcd9083858cc59e1555e"},h("option",{key:"a737e6d38809d624da52db3971c63e761a3f50ed",value:"left"},"Left"),h("option",{key:"62dffe46389bdf89c8ae703484956b13de4cd898",value:"center"},"Center"),h("option",{key:"63d6f9f019ca6936e38a99fe29627625d4ad0cfc",value:"right"},"Right"))))}};LsFieldFormat.style=lsFieldFormatCss;const lsFieldPropertiesCss=":host{display:block;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldProperties=class{constructor(t){registerInstance(this,t)}dataItem;renderFields(){if(this.dataItem&&this.dataItem?.length===1){switch(this.dataItem[0].formElementType){case"signature":return h("ls-field-properties-signature",{dataItem:this.dataItem[0]});case"date":return h("ls-field-properties-date",{dataItem:this.dataItem[0]});case"autodate":return h("ls-field-properties-date",{dataItem:this.dataItem[0]});case"text":return h("ls-field-properties-text",{dataItem:this.dataItem[0]});case"number":return h("ls-field-properties-number",{dataItem:this.dataItem[0]});default:return h("ls-field-properties-general",{dataItem:this.dataItem[0]})}}else if(this.dataItem&&this.dataItem?.length>1)return h("ls-field-properties-multiple",{dataItem:this.dataItem})}render(){return h(Host,{key:"5ec66a914aed5ab37a149a64e6ba32d981f0c93f"},this.dataItem&&this.renderFields(),h("slot",{key:"52af83caee54c5c3134d898fb7859ad58f82ccf5"}))}};LsFieldProperties.style=lsFieldPropertiesCss;const lsFieldPropertiesDateCss=":host{display:block}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldPropertiesDate=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"91b2aff43af5f14feeaca63bbc2321d86db5c3da"},h("div",{key:"59296fb97a9a63063f93a4ac75696e8caeb34dc6",class:"ls-field-properties-section"},"Date Field"),h("div",{key:"f2e720190a837f25554469ab1be43f8b7062ff17"},"Label: ",h("input",{key:"7fec61ff41be02aef43bca7213a0791b02e1e0bb",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"c5653214cabc48e06dead7e76e8560a7c595b302",dataItem:this.dataItem}),h("slot",{key:"6e007066ff5a828f9a57c58166b0f36219009f38"}))}};LsFieldPropertiesDate.style=lsFieldPropertiesDateCss;const lsFieldPropertiesGeneralCss=":host{display:block}.ls-field-properties-section{display:flex;flex-direction:column;min-width:110px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)}";const LsFieldPropertiesGeneral=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"e61fdbc0affab9b05cbda36bfced55fd62ed2f16"},h("div",{key:"ea65b3f69735e2a93882d8584f698ab066b3cd8b",class:"ls-field-properties-section"},"General Field"),h("div",{key:"e5df820b75aeb0a9d61c618ee040b6156382092c"},"Label: ",h("input",{key:"f4a1dbff82a379ba5eb78827b828ddc1a9612a54",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"24cf3a00d6128dd1e0810aa723f3c4d9afd3b6da",dataItem:this.dataItem}),h("slot",{key:"3ab91ac8574a5f93b33ab07b80ff9e13ba01aceb"}))}};LsFieldPropertiesGeneral.style=lsFieldPropertiesGeneralCss;const lsFieldPropertiesMultipleCss=":host{display:block}";const LsFieldPropertiesMultiple=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"0df0a3ec70677b65d31555b53c9578400b55914e"},h("div",{key:"8a83c0228fde21baba8400ff5d39776deac240d2"},this.dataItem.length," items"),h("ls-field-dimensions",{key:"39c4d89f90b3614761495fb8eab20507c97e3ae7",dataItem:this.dataItem}),h("slot",{key:"5033f4401374634a77d341ace837d00cdff009d5"}))}};LsFieldPropertiesMultiple.style=lsFieldPropertiesMultipleCss;const lsFieldPropertiesNumberCss=":host{display:block}";const LsFieldPropertiesNumber=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"0aaa2ed2233eeae3356d63b120c672d171f820ca"},h("div",{key:"4ebb3248ea59f50022c0d22567e42d8c9d3f6171",class:"ls-field-properties-section"},"Number Field"),h("div",{key:"34a1cf60306cab2ff6903011d1707784723a0126"},"Label: ",h("input",{key:"f3f307b7327c7ac50cd12a72bd17e83ae0e641fd",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"497e9ebaffe0dad411baf577d26b379436e379a0",dataItem:this.dataItem}),h("slot",{key:"142dc2b21baf7e673b6d14739166588bd4d4522f"}))}};LsFieldPropertiesNumber.style=lsFieldPropertiesNumberCss;const lsFieldPropertiesSignatureCss=":host{display:block}";const LsFieldPropertiesSignature=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"dc4a95045198437ce7220d044145a39b899e6b73"},h("ls-field-dimensions",{key:"431a9093a93818a80e3c1b8e9892399abae3e1cb",dataItem:this.dataItem}),h("slot",{key:"609e75d79941e4a4e92854a31042ec19df15fa47"}))}};LsFieldPropertiesSignature.style=lsFieldPropertiesSignatureCss;const lsFieldPropertiesTextCss=":host{display:block}";const LsFieldPropertiesText=class{constructor(t){registerInstance(this,t)}dataItem;render(){return h(Host,{key:"064f87b73a2d50fcacc72832d5ca29d59316ffb1"},h("div",{key:"05f06007a2cfbcb9d30bc8c648ab020c8615497a",class:"ls-field-properties-section"},"Text Field"),h("div",{key:"0b8fdcda79ba6ab98a9e1164bb3203f2e68cbe0b"},"Label: ",h("input",{key:"75229d8d11fd65675150df01b5c2029e0a1c2009",value:this.dataItem?.label,width:"30"})),h("ls-field-dimensions",{key:"70135cfeb573007f94d930990aeb3ad9efd2b816",dataItem:this.dataItem}),h("slot",{key:"a158525ef486e1e60283eed73634be7fb3d9e85b"}))}};LsFieldPropertiesText.style=lsFieldPropertiesTextCss;const lsFieldSizeCss=":host{display:inline-block}button{display:inline-flex;background-color:transparent;min-width:24px;min-height:24px;border-radius:0.5rem;margin:0.25rem;width:27px;height:27px;justify-content:center;vertical-align:middle;border:0}button:hover{background-color:rgb(219, 219, 219)}";const LsFieldSize=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}dataItem;mutate;update;alter(t){const e=this.dataItem.map((e=>({action:"update",data:{...e,...t}})));this.dataItem=e.map((t=>t.data));this.mutate.emit(e);this.update.emit(e)}render(){return h(Host,{key:"0394ea5c55fdf6680ebf723c588333e4551f99ee"},h("div",{key:"e985d7ad03a96bec59d563a9ae39a06ec9dd27be",class:"flex rounded-[10px] focus:outline-hidden focus:ring-4 focus:ring-offset-0 focus:ring-primary-30"},h("button",{key:"cf4453e75fd169679715c010592ef60b6f7301dc","aria-label":"Make selected fields the same width as the first selected field.",class:"ls-round-button",onClick:()=>this.alter({width:this.dataItem[0].width}),"data-tooltip-id":"le-tooltip","data-tooltip-content":"Make selected fields the same width as the first selected field.","data-tooltip-place":"top"},h("svg",{key:"7bebe9b89820d8709a47fa536858cdb33b2abea6",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"5ae2c2a402295427600157dc92bb75e132f75693",d:"M14 9V6C14 5.44772 13.5523 5 13 5H11C10.4477 5 10 5.44772 10 6V9M14 15.0104V18C14 18.5523 13.5523 19 13 19H11C10.4477 19 10 18.5523 10 18V15.0104M6.00751 15.0104L4.00751 12M4.00751 12L6.00751 9M4.00751 12H20.0013M18.0013 15.0104L20.0013 12M20.0013 12L18.0013 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),h("button",{key:"f9375df61a69f0568de27cd4f4dc23f945c6add2",class:"ls-round-button",onClick:()=>this.alter({height:this.dataItem[0].height}),"aria-label":"Make selected fields the same height as the first selected field.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Make selected fields the same height as the first selected field.","data-tooltip-place":"top"},h("svg",{key:"31dcd7f385c184ec2730aaab08ddc6e85da479ca",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"dab2671aa531b492fcf47fde7c631c0d8d339797",d:"M9.00439 10.0042H6.00439C5.45211 10.0042 5.00439 10.4519 5.00439 11.0042V13.0042C5.00439 13.5565 5.45211 14.0042 6.00439 14.0042H9.00439M15.0148 10.0042H18.0044C18.5567 10.0042 19.0044 10.4519 19.0044 11.0042V13.0042C19.0044 13.5565 18.5567 14.0042 18.0044 14.0042H15.0148M15.0148 17.9967L12.0044 19.9967M12.0044 19.9967L9.00439 17.9968M12.0044 19.9967V4.00293M15.0148 6.00299L12.0044 4.00293M12.0044 4.00293L9.00439 6.00293",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),h("button",{key:"5a296dcd455c391deb56b4953a19a7e3c23f96e4",class:"ls-round-button",onClick:()=>this.alter({width:this.dataItem[0].width,height:this.dataItem[0].height}),"aria-label":"Make selected fields the same height and width as the first selected field.","data-tooltip-id":"le-tooltip","data-tooltip-content":"Make selected fields the same height and width as the first selected field.","data-tooltip-place":"top"},h("svg",{key:"e1d8c0b27c9ca350b437b2a2b1513bd65becab88",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"68b64b0899019469946718ea545a76cc6c77ebad",d:"M4 8V4M4 4H8M4 4L8 8M20 8V4M20 4H16M20 4L16 8M4 16V20M4 20H8M4 20L8 16M20 16V20M20 20H16M20 20L16 16M8 8H10M8 8V10M16 8H14M16 8V10M8 16H10M8 16V14M16 16V14M16 16H14",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})))),h("slot",{key:"69b404acca8ec83463492386af516720273795c7"}))}};LsFieldSize.style=lsFieldSizeCss;const lsFormfieldCss="* {\n box-sizing: border-box;\n margin: 0;\n}\n\n.formfield-host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n width: 100%;\n}\n\n.formfield-top-elements {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0 0.125rem;\n}\n\n.formfield-left-side {\n display: flex;\n align-items: center;\n width: 100%;\n gap: 0.5rem;\n\n ls-icon {\n color: var(--gray-80, #787A80);\n }\n\n .formfield-label {\n color: var(--gray-100, #45484D);\n /* text-base/leading-6/font-medium */\n font-size: 1rem;\n font-style: normal;\n font-weight: 500;\n line-height: 1.5rem; /* 150% */\n }\n}\n\n.formfield-bottom-elements {\n position: relative;\n min-height: 1rem;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n height: fit-content;\n padding: 0 0.125rem;\n}\n\n.formfield-description-text {\n color: var(--Grey-80, #6C6E73);\n width: 100%;\n /* text-xs/leading-4/font-light */\n font-size: 0.75rem;\n font-style: normal;\n font-weight: 400;\n line-height: 1rem; /* 133.333% */\n}\n\n.formfield-error-text {\n color: var(--red-70, #DC2721);\n width: 100%;\n /* text-xs/leading-4/font-light */\n font-size: 0.75rem;\n font-style: normal;\n font-weight: 400;\n line-height: 1rem; /* 133.333% */\n}\n\n.formfield-count-container {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n gap: 0.125rem;\n align-items: center;\n font-size: 0.75rem;\n font-style: normal;\n font-weight: 400;\n line-height: 1rem; /* 133.333% */\n text-align: right;\n}\n\n.formfield-count {\n display: flex;\n align-items: center;\n color: var(--Grey-70, #6C6E73);\n gap: 0.125rem;\n}\n\n.formfield-count-error {\n display: flex;\n align-items: center;\n gap: 0.125rem;\n color: var(--red-70, #DC2721);\n}\n\n\n";const LsFormfield=class{constructor(t){registerInstance(this,t)}name;fieldId;label;as="text";value;placeholder;descriptionText;errorText;aria;inputRef;infoTooltipText;hoverTooltipText;disabled;extraLabel="none";required;valid;dirty;count;countMax;buttonClick;buttonIcon;labelIcon;fieldIcon;_value;valueWatcher(t){this._value=t}componentWillLoad(){this.valueWatcher(this?.value?.toString())}handleChange=t=>{const e=t.target;this.value=e.value};render(){const{name:t,fieldId:e,label:r,as:i,value:n,placeholder:o,descriptionText:s,errorText:a,aria:l,infoTooltipText:u,disabled:d,extraLabel:c,valid:f,dirty:v,count:C,countMax:g,buttonClick:p,buttonIcon:w,fieldIcon:m,labelIcon:b}=this;const M=n&&n.toString().length>g?"formfield-count-error":"formfield-count";return h("host",{key:"7c9e146aaa8885dfcf882d1e8d8c6661aba5aa7d",class:"formfield-host"},h("div",{key:"2c27f1279cfd30059a9f25e28dda56a1d9fb4f54",class:"formfield-top-elements"},h("div",{key:"8eeeb49e83f12069a64cba1dcccb2a76c731b2f5",class:"formfield-left-side"},b&&h("ls-icon",{key:"2615de185e959d526b41d307a134bec0d199e498",name:b}),h("label",{key:"464a7e0d9156fbbd67cf8c889378a3bb30c2cf02",htmlFor:t,class:"formfield-label"},r),u&&h("ls-icon",{key:"9dc3d844acd6806d2038c6a633280923421497a0",name:"information-circle"})),c==="optional"?h("ls-label",{text:"Optional",colour:"gray",type:"low"}):c==="required"?h("ls-label",{text:"Required",colour:"gray",type:"low"}):""),i==="text"?h("ls-text-input",{id:e,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m,onInput:t=>this.handleChange(t)}):i==="select"?h("ls-select-input",{id:t,name:t,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m},h("slot",null)):i==="radio"?h("ls-radio-input",{radioId:r,label:n?.toString(),icon:m,name:t,disabled:d}):i==="textarea"?h("ls-textarea-input",{id:t,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):i==="password"?h("ls-text-input",{type:"password",id:t,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):i==="displayonly"?h("ls-text-input",{type:"displayonly",id:t,name:t,value:n?.toString(),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):i==="number"?h("ls-number-input",{type:"ls",id:t,name:t,value:Number(n),countMax:g,placeholder:o,"aria-label":l,required:c==="required",disabled:d,valid:f,dirty:v,buttonIcon:w,buttonClick:p,fieldIcon:m}):h("p",null,"placeholder"),h("div",{key:"ac6d1c32a100561c3a92cc7586ba7649ff5665c2",class:"formfield-bottom-elements"},a&&!f?h("p",{class:"formfield-error-text"},a):s?h("p",{class:"formfield-description-text"},s):"",C&&h("div",{key:"cbb11974083e7ab0aa70af47366af2a5a9fc64e4",class:"formfield-count-container"},h("p",{key:"883bd413b5eba25ae7a840c3b6471cf25eb5dbc2",class:M},n?.toString()?.length),g>0&&h("div",{key:"2b0b4deaf7c7a0f83e686aeec95c061406191b2d",class:M},h("p",{key:"f951ad9253b769d89eb9965cd79969dd578acfe7"},"/"),h("p",{key:"750364651c6d92335b034930d8be1a81d38ceaf2"},g)))))}static get watchers(){return{value:["valueWatcher"]}}};LsFormfield.style=lsFormfieldCss;const html=String.raw;const icons=[{name:"mail",svgSolid:html`<svg
58
58
  xmlns="http://www.w3.org/2000/svg"
59
59
  width="100%"
60
60
  height="100%"
@@ -8913,4 +8913,4 @@ PERFORMANCE OF THIS SOFTWARE.
8913
8913
  fill="currentColor"
8914
8914
  />
8915
8915
  </svg>`,svgOutline:html`No Outline`}];var IconEnum;(function(t){t["MailIcon"]="mail";t["BellIcon"]="bell";t["HomeIcon"]="home";t["BriefcaseIcon"]="briefcase";t["ShieldCheckIcon"]="shield-check";t["ShieldExclamationIcon"]="shield-exclamation";t["CogIcon"]="cog";t["CheckIcon"]="check";t["TranslateIcon"]="translate";t["CashIcon"]="cash";t["LocationMarkerIcon"]="location-marker";t["UserIcon"]="user";t["UsersIcon"]="users";t["UserGroupIcon"]="user-group";t["OfficeBuildingIcon"]="office-building";t["ScaleIcon"]="scale";t["PencilAltIcon"]="pencil-alt";t["PencilIcon"]="pencil";t["EyeIcon"]="eye";t["BookmarkIcon"]="bookmark";t["ColorSwatchIcon"]="color-swatch";t["InboxIcon"]="inbox";t["InboxInIcon"]="inbox-in";t["ArchiveIcon"]="archive";t["ClockIcon"]="clock";t["PhotographIcon"]="photograph";t["TagIcon"]="tag";t["PhoneIcon"]="phone";t["PhoneIncomingIcon"]="phone-incoming";t["PhoneOutgoingIcon"]="phone-outgoing";t["MenuIcon"]="menu";t["MenuAlt1Icon"]="menu-alt-1";t["MenuAlt2Icon"]="menu-alt-2";t["MenuAlt3Icon"]="menu-alt-3";t["MenuAlt4Icon"]="menu-alt-4";t["SwitchVerticalIcon"]="switch-vertical";t["SwitchHorizontalIcon"]="switch-horizontal";t["XIcon"]="x";t["PlusIcon"]="plus";t["RefreshIcon"]="refresh";t["QuestionMarkCircleIcon"]="question-mark-circle";t["ExclamationIcon"]="exclamation";t["CloudUploadIcon"]="cloud-upload";t["CloudDownloadIcon"]="cloud-download";t["ChartPieIcon"]="chart-pie";t["DocumentIcon"]="document";t["DocumentDownloadIcon"]="document-download";t["DocumentAddIcon"]="document-add";t["DocumentRemoveIcon"]="document-remove";t["CalenderIcon"]="calender";t["CameraIcon"]="camera";t["GlobeAltIcon"]="globe-alt";t["DuplicateIcon"]="duplicate";t["ShareIcon"]="share";t["HeartIcon"]="heart";t["GlobeIcon"]="globe";t["VolumeUpIcon"]="volume-up";t["VolumeOffIcon"]="volume-off";t["AdjustmentsIcon"]="adjustments";t["LinkIcon"]="link";t["MailOpenIcon"]="mail-open";t["DocumentDuplicateIcon"]="document-duplicate";t["CreditCardIcon"]="credit-card";t["LockClosedIcon"]="lock-closed";t["TrendingUpIcon"]="trending-up";t["TrendingDownIcon"]="trending-down";t["FilterIcon"]="filter";t["AtSymbolIcon"]="at-symbol";t["TrashIcon"]="trash";t["InformationCircleIcon"]="information-circle";t["ArrowUpIcon"]="arrow-up";t["ArrowRightIcon"]="arrow-right";t["ArrowDownIcon"]="arrow-down";t["ArrowLeftIcon"]="arrow-left";t["ArrowCircleRightIcon"]="arrow-circle-right";t["ArrowCircleDownIcon"]="arrow-circle-down";t["ArrowCircleLeftIcon"]="arrow-circle-left";t["ArrowCircleUpIcon"]="arrow-circle-up";t["SortAscendingIcon"]="sort-ascending";t["SortDescendingIcon"]="sort-descending";t["XCircleIcon"]="x-circle";t["CheckCircleIcon"]="check-circle";t["ExclamationCircleIcon"]="exclamation-circle";t["PlusCircleIcon"]="plus-circle";t["MinusCircleIcon"]="minus-circle";t["UserCircleIcon"]="user-circle";t["ZoomInIcon"]="zoom-in";t["ZoomOutIcon"]="zoom-out";t["SearchIcon"]="search";t["UserAddIcon"]="user-add";t["DotsHorizontalIcon"]="dots-horizontal";t["DotsVerticalIcon"]="dots-vertical";t["UploadIcon"]="upload";t["DownloadIcon"]="download";t["ViewListIcon"]="view-list";t["ViewBoardsIcon"]="view-boards";t["PaperClipIcon"]="paper-clip";t["EmojiHappyIcon"]="emoji-happy";t["EmojiSadIcon"]="emoji-sad";t["PrinterIcon"]="printer";t["CurrencyDollarIcon"]="currency-dollar";t["CurrencyYenIcon"]="currency-yen";t["CurrencyEuroIcon"]="currency-euro";t["CurrencyPoundIcon"]="currency-pound";t["CurrencyRupeeIcon"]="currency-rupee";t["ChevronDownIcon"]="chevron-down";t["ChevronRightIcon"]="chevron-right";t["ChevronUpIcon"]="chevron-up";t["ChevronLeftIcon"]="chevron-left";t["SelectorIcon"]="selector";t["ChatIcon"]="chat";t["ReceiptRefundIcon"]="receipt-refund";t["TicketIcon"]="ticket";t["LockOpenIcon"]="lock-open";t["DotsCircleHorizontalIcon"]="dots-circle-horizontal";t["HashtagIcon"]="hashtag";t["QRCodeIcon"]="qrcode";t["ClipboardCheckIcon"]="clipboard-check";t["ClipboardListIcon"]="clipboard-list";t["ClipboardIcon"]="clipboard";t["ExternalLinkIcon"]="external-link";t["SunIcon"]="sun";t["MoonIcon"]="moon";t["ClipboardCopyIcon"]="clipboard-copy";t["AnnotationIcon"]="annotation";t["FlagIcon"]="flag";t["CollectionIcon"]="collection";t["BookOpenIcon"]="book-open";t["CodeIcon"]="code";t["LightningBoltIcon"]="lightning-bolt";t["FolderIcon"]="folder";t["SparklesIcon"]="sparkles";t["UserRemoveIcon"]="user-remove";t["ArrowNarrowUpIcon"]="arrow-narrow-up";t["ArrowNarrowRightIcon"]="arrow-narrow-right";t["ArrowNarrowDownIcon"]="arrow-narrow-down";t["ArrowNarrowLeftIcon"]="arrow-narrow-left";t["TemplateIcon"]="template";t["ReplyIcon"]="reply";t["LightBulbIcon"]="light-bulb";t["ChatAltIcon"]="chat-alt";t["DocumentReportIcon"]="document-report";t["LogOutIcon"]="logout";t["KeyIcon"]="key";t["BanIcon"]="ban";t["ShoppingCartIcon"]="shopping-cart";t["CursorClickIcon"]="cursor-click";t["MicrophoneIcon"]="microphone";t["SpeakerphoneIcon"]="speakerphone";t["BadgeCheckIcon"]="badge-check";t["DesktopComputerIcon"]="desktop-computer";t["ChatAlt2Icon"]="chat-alt-2";t["SupportIcon"]="support";t["NewspaperIcon"]="newspaper";t["BookmarkAltIcon"]="bookmark-alt";t["ViewGridAddIcon"]="view-grid-add";t["LibraryIcon"]="library";t["PlayIcon"]="play";t["PauseIcon"]="pause";t["StopIcon"]="stop";t["StarIcon"]="star";t["TerminalIcon"]="terminal";t["ChartSquareBarIcon"]="chart-square-bar";t["EyeOffIcon"]="eye-off";t["ChartBarIcon"]="chart-bar";t["FireIcon"]="fire";t["ShoppingBagIcon"]="shopping-bag";t["ThumbUpIcon"]="thumb-up";t["ThumbDownIcon"]="thumb-down";t["HandIcon"]="hand";t["ArrowsExpandIcon"]="arrows-expand";t["ViewGridIcon"]="view-grid";t["PuzzleIcon"]="puzzle";t["FolderDownloadIcon"]="folder-download";t["FolderAddIcon"]="folder-add";t["FolderRemoveIcon"]="folder-remove";t["MapIcon"]="map";t["IdentificationIcon"]="identification";t["RSSIcon"]="rss";t["ScissorsIcon"]="scissors";t["MusicNoteIcon"]="music-note";t["FilmIcon"]="film";t["DatabaseIcon"]="database";t["ServerIcon"]="server";t["LogInIcon"]="login";t["WiFiIcon"]="wifi";t["BackspaceIcon"]="backspace";t["PaperAirplaneIcon"]="paper-airplane";t["DeviceMobileIcon"]="device-mobile";t["DeviceTabletIcon"]="device-tablet";t["ChevronDoubleRightIcon"]="chevron-double-right";t["ChevronDoubleDownIcon"]="chevron-double-down";t["ChevronDoubleLeftIcon"]="chevron-double-left";t["ChevronDoubleUpIcon"]="chevron-double-up";t["FingerPrintIcon"]="finger-print";t["CubeIcon"]="cube";t["FolderOpenIcon"]="folder-open";t["SaveIcon"]="save";t["SaveAsIcon"]="save-as";t["DocumentTextIcon"]="document-text";t["TableIcon"]="table";t["CalculatorIcon"]="calculator";t["BeakerIcon"]="beaker";t["GiftIcon"]="gift";t["TruckIcon"]="truck";t["CurrencyBangladeshiIcon"]="currency-bangladeshi";t["VideoCameraIcon"]="video-camera";t["CloudIcon"]="cloud";t["CubeTransparentIcon"]="cube-transparent";t["CakeIcon"]="cake";t["PhoneMissedCallIcon"]="phone-missed-call";t["PlusSmIcon"]="plus-sm";t["MinusSmIcon"]="minus-sm";t["ReceiptTaxIcon"]="receipt-tax";t["StatusOnlineIcon"]="status-online";t["StatusOfflineIcon"]="status-offline";t["PresentationChartLineIcon"]="presentation-chart-line";t["PresentationChartBarIcon"]="presentation-chart-bar";t["FastForwardIcon"]="fast-forward";t["RewindIcon"]="rewind";t["ChipIcon"]="chip";t["AcademicCapIcon"]="academic-cap";t["VariableIcon"]="variable";t["DocumentSearchIcon"]="document-search";t["SearchCircleIcon"]="search-circle";t["MinusIcon"]="minus";t["ArrowSmUpIcon"]="arrow-sm-up";t["ArrowSmRightIcon"]="arrow-sm-right";t["ArrowSmDownIcon"]="arrow-sm-down";t["ArrowSmLeftIcon"]="arrow-sm-left";t["BaseCircleIcon"]="base-circle";t["DragVerticalIcon"]="drag-vertical";t["InitialsIcon"]="initials";t["TextIcon"]="text";t["MenuAlt5Icon"]="menu-alt-5";t["TextSizeIcon"]="text-size";t["PinIcon"]="pin";t["KeyboardIcon"]="keyboard";t["MoveVerticalIcon"]="move-vertical";t["MoveHorizontalIcon"]="move-horizontal";t["RotateLeftIcon"]="rotate-left";t["RotateRightIcon"]="rotate-right";t["UndoIcon"]="undo";t["RedoIcon"]="redo";t["DragHorizontalIcon"]="drag-horizontal";t["SidePanelCloseLeftIcon"]="side-panel-close-left";t["SidePanelCloseRightIcon"]="side-panel-close-right";t["SidePanelOpenLeftIcon"]="side-panel-open-left";t["SidePanelOpenRightIcon"]="side-panel-open-right";t["ContactsIcon"]="contacts";t["ArrowUpLinkOutIcon"]="arrow-up-link-out";t["DeviceLockIcon"]="device-lock";t["AutoDateIcon"]="auto-date";t["RevertIcon"]="revert";t["GuidesIcon"]="guides";t["BulkSendIcon"]="bulk-send";t["FieldAlignmentLeftIcon"]="field-alignment-left";t["FieldAlignmentCentreIcon"]="field-alignment-centre";t["FieldAlignmentRightIcon"]="field-alignment-right";t["AccessibilityIcon"]="accessibility";t["ArrowsMinimiseIcon"]="arrows-minimise";t["DocumentInfoIcon"]="document-info";t["DocumentImportFieldsIcon"]="document-import-fields";t["DocumentMergeAlt2Icon"]="document-merge-alt2";t["DocumentCombineIcon"]="document-combine";t["FieldAlignmentTopIcon"]="field-alignment-top";t["FieldAlignmentMiddleIcon"]="field-alignment-middle";t["FieldAlignmentBottomIcon"]="field-alignment-bottom";t["BoxEmptyIcon"]="box-empty";t["BoxTickedIcon"]="box-ticked";t["BoxCrossedIcon"]="box-crossed";t["SortAlphabeticallyAZIcon"]="sort-alphabetically-a-z";t["SortAlphabeticallyZAIcon"]="sort-alphabetically-z-a";t["LinkedDocumentIcon"]="linked-document";t["DocumentReplaceIcon"]="document-replace";t["FieldScaleIcon"]="field-scale";t["FieldMatchWidthIcon"]="field-match-width";t["FieldMatchHeightIcon"]="field-match-height";t["RecipientLinkIcon"]="recipient-link";t["RecipientLinkBrokenIcon"]="recipient-link-broken";t["WitnessArrowIcon"]="witness-arrow";t["BranchIcon"]="branch";t["VariantIcon"]="variant";t["RecipientDetailsCardIcon"]="recipient-details-card";t["RecipientDetailsIcon"]="recipient-details";t["FieldDistributeVerticallyIcon"]="field-distribute-vertically";t["FieldDistributeHorizontallyIcon"]="field-distribute-horizontally";t["FieldDuplicateIcon"]="field-duplicate";t["PreFilledContentIcon"]="pre-filled-content";t["TypingInputIcon"]="typing-input";t["TableSplitIcon"]="table-split";t["AddColumnLeftIcon"]="add-column-left";t["AddColumnRightIcon"]="add-column-right";t["RecipientLinksIcon"]="recipient-links";t["ListOrderIcon"]="list-order";t["FieldScalingOffIcon"]="field-scaling-off";t["FitWidthIcon"]="fit-width";t["FitHeightIcon"]="fit-height";t["TableQuickEditIcon"]="table-quick-edit";t["TableColumnsIcon"]="table-columns";t["TableRowsIcon"]="table-rows";t["ApplyAllRowsIcon"]="apply-all-rows";t["PagescrollPreviewIcon"]="pagescroll-preview";t["PageInsertVerticalIcon"]="page-insert-vertical";t["PageInsertHorizontalIcon"]="page-insert-horizontal";t["SignatureIcon"]="signature";t["CircleQuarterIcon"]="circle-quarter";t["CircleHalfIcon"]="circle-half";t["CircleThreeQuarterIcon"]="circle-three-quarter";t["TimeSortAscendingIcon"]="time-sort-ascending";t["TimeSortDescendingIcon"]="time-sort-descending";t["DateSortAscendingIcon"]="date-sort-ascending";t["DateSortDescendingIcon"]="date-sort-descending";t["SidePanelClosedIcon"]="side-panel-closed";t["SidePanelOpenIcon"]="side-panel-open";t["DateSentSortAscendingIcon"]="date-sent-sort-ascending";t["DateSentSortDescendingIcon"]="date-sent-sort-descending";t["SortAlphabeticallyAZAltIcon"]="sort-alphabetically-a-z-alt";t["SortAlphabeticallyZAAltIcon"]="sort-alphabetically-z-a-alt";t["TemplateSentIcon"]="template-sent";t["TemplateNotSentIcon"]="template-not-sent";t["GridIcon"]="grid";t["LinkedIcon"]="linked";t["LinkBrokenIcon"]="link-broken";t["UserAssignIcon"]="user-assign";t["XLetterIcon"]="x-letter";t["YIcon"]="y";t["FieldSelectedIcon"]="field-selected";t["DesignationIcon"]="designation";t["TextAlignmentIcon"]="text-alignment";t["FieldPlacementIcon"]="field-placement";t["RequiredIcon"]="required";t["TypefaceIcon"]="typeface";t["PageLayoutIcon"]="page-layout";t["FieldSpecialIcon"]="field-special";t["LinkValueIcon"]="link-value";t["TargetIcon"]="target";t["FieldOrderIcon"]="field-order";t["DropdownIcon"]="dropdown";t["SendArrowIcon"]="send-arrow";t["SentProgressIcon"]="sent-progress";t["CircleFilledQuarterIcon"]="circle-filled-quarter";t["CircleFilledHalfIcon"]="circle-filled-half";t["CircleFilledThreeQuarterIcon"]="circle-filled-three-quarter";t["DocumentViewedIcon"]="document-viewed";t["CollapseIcon"]="collapse";t["ExpandIcon"]="expand";t["LogoIcon"]="logo"})(IconEnum||(IconEnum={}));const iconNames=[...icons.map((t=>t.name)).sort()];const LsIcon=class{constructor(t){registerInstance(this,t)}name;solid=false;size="20";customStyle;arraysAreIdentical(t,e){const r=t[0]==="none"?t.slice(1):t;const i=e[0]==="none"?e.slice(1):e;if(r.length!==i.length){return false}const n=[...r].sort();const o=[...i].sort();return n.every(((t,e)=>t===o[e]))}iconNamesFromEnum=Object.values(IconEnum);componentDidLoad(){const t=this.arraysAreIdentical(iconNames,this.iconNamesFromEnum);if(!t)console.warn("Icons in src/components/ls-icon/icons.ts should be identical to the enum type in src/types/Icon.ts. Please add all icons to the enum type.")}render(){return h("host",{key:"7dc573913267ee893f933db2d2c52bd73e4ac87b"},icons?.filter((t=>t.name===this.name))?.map((t=>h("div",{key:t?.name,class:"iconContainer",style:{height:`${this.size}px`,width:`${this.size}px`,...this.customStyle}},this.solid?h("div",{innerHTML:t.svgSolid}):h("div",{innerHTML:t.svgOutline})))))}};function r(t){var e,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(i=r(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function clsx(){for(var t,e,i=0,n="",o=arguments.length;i<o;i++)(t=arguments[i])&&(e=r(t))&&(n&&(n+=" "),n+=e);return n}const lsNumberInputCss="* {\n box-sizing: border-box;\n font-family:\n 'IBM Plex Sans',\n sans-serif;\n margin: 0;\n}\n\n.host {\n display: flex;\n width: 100%;\n padding: 0.25rem;\n align-items: flex-start;\n gap: 0.25rem;\n border-radius: 0.625rem;\n border: 1px solid var(--Grey-20, #edeff2);\n background: var(--Grey-10, #f7f8fa);\n}\n\n.input-container {\n position: relative;\n display: flex;\n width: 100%;\n}\n\n#fieldIcon {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: 0.75rem;\n color: var(--gray-80);\n}\n\n#fieldIconDisabled {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: 0.75rem;\n color: var(--gray-60);\n}\n\n#password-icon {\n padding-right: 0.25rem;\n}\n\n.icon-input {\n padding-left: 2.5rem !important;\n}\n\n.button-input {\n padding-right: 2.5rem !important;\n}\n\n.right-items-input {\n padding-right: 4rem !important;\n}\n\n.input-basic {\n display: flex;\n width: 100%;\n height: 2.25rem;\n padding: 0.5rem 0.75rem;\n align-items: center;\n gap: 0.5rem;\n align-self: stretch;\n border-radius: 0.5rem;\n /* Shadow/sm */\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n /* text-sm/leading-5/font-regular */\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 400;\n}\n\n.input-ls {\n display: flex;\n width: 100%;\n height: 1.75rem;\n padding: 0 0.5rem;\n align-items: center;\n gap: 0.5rem;\n align-self: stretch;\n border-radius: 0.375rem;\n /* Shadow/sm */\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n /* text-sm/leading-5/font-regular */\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 400;\n\n\n}\n\n.input-ls::-webkit-outer-spin-button,\n.input-ls::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.input-ls {\n -moz-appearance: textfield;\n}\n\ninput-base:active:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456f6);\n box-shadow:\n 0px 0px 3px 0px rgba(0, 15, 153, 0.25),\n 0px 0px 2px 0px rgba(0, 15, 153, 0.06),\n 0px 0px 0px 4px #9dc3fc;\n}\n\ninput:focus:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456f6);\n box-shadow:\n 0px 0px 3px 0px rgba(0, 15, 153, 0.25),\n 0px 0px 2px 0px rgba(0, 15, 153, 0.06),\n 0px 0px 0px 4px #9dc3fc;\n}\n\n.default {\n border: 1px solid var(--gray-40, #d8d9dc);\n background: var(--White, #fff);\n color: var(--gray-100);\n}\n\n.default:hover {\n border: 1px solid var(--gray-50, #d8d9dc);\n background: var(--White, #fff);\n color: var(--gray-110);\n}\n\n.disabled {\n border: 1px solid var(--gray-40, #d8d9dc);\n background: var(--gray-10, #f7f8fa);\n color: var(--gray-60);\n cursor: not-allowed;\n}\n\n.display-only {\n border: 1px solid var(--gray-40, #d8d9dc);\n background: var(--gray-10, #f7f8fa);\n color: var(--gray-100);\n cursor: not-allowed;\n}\n\n.invalid {\n border: 1px solid var(--red-40, #ffa19e);\n background: var(--White, #fff);\n color: var(--Red-100, #7a1714);\n}\n\n.invalid:hover {\n border: 1px solid var(--red-50, #ffa19e);\n background: var(--White, #fff);\n color: var(--Red-100, #7a1714);\n}\n\n.valid {\n border: 1px solid var(--green-40, #72f0c2);\n background: var(--White, #fff);\n color: var(--Green-100, #125241);\n}\n\n.valid:hover {\n border: 1px solid var(--green-50, #72f0c2);\n background: var(--White, #fff);\n color: var(--Green-100, #125241);\n}\n\n.right-items {\n position: absolute;\n padding: 0.25rem;\n height: 36px;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n}\n\n#invalidIcon {\n margin: 0 0.5rem;\n color: var(--red-70);\n}\n\n#validIcon {\n margin: 0 0.5rem;\n color: var(--green-60);\n}\n\n.button {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-50, #c8c9cc);\n background: var(--White, #fff);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-90);\n }\n}\n\n.button-disabled {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-40, #D8D9DC);\n background: var(--gray-=10, #F7F8FA);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n cursor: not-allowed;\n\n #buttonIcon {\n color: var(--gray-70);\n }\n}\n\n.button:hover {\n border: 1px solid var(--gray-50, #c8c9cc);\n background: var(--gray-20, #edeff2);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:active {\n border: 1px solid var(--Primary-Blue-Light, #4456f6);\n background: var(--White, #fff);\n box-shadow:\n 0px 0px 4px 0px #c7ddff inset,\n 0px 0px 0px 4px #9dc3fc;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:focus {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--Primary-Blue-Light, #4456f6);\n background: var(--White, #fff);\n box-shadow:\n 0px 0px 4px 0px #c7ddff inset,\n 0px 0px 0px 4px #9dc3fc;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n";const LsNumberInput=class{constructor(t){registerInstance(this,t)}type="ls";name;value=0;placeholder;aria;inputRef;disabled;required;valid;dirty;countMax;buttonClick;buttonIcon;fieldIcon;handleChange=t=>{this.value=t.target.value};handlePlus=()=>{this.value=this.value+1};handleMinus=()=>{this.value=this.value-1};render(){const{type:t,name:e,value:r,placeholder:i,aria:n,disabled:o,required:s,valid:a,dirty:l,buttonClick:u,buttonIcon:d,fieldIcon:c,handleChange:f,handleMinus:v,handlePlus:C}=this;const g=clsx(t==="ls"?"input-ls":"input-basic",o?"disabled":l&&a?"valid":l&&!a?"invalid":"default",c&&"icon-input",l&&"button-input",d&&"button-input",d&&l&&"right-items-input");const p=clsx(o?"button-disabled":"button");return h("host",{key:"18b17b148d00e0949400ced79f9bff323e35d685",class:t==="ls"&&"host"},t==="ls"&&h("button",{key:"6fe14552c5f670e653c328f4fe207af892f5c3a0",class:p,onClick:()=>v(),disabled:o},h("ls-icon",{key:"0b0164d9dc72481ec64351912d1814a1be425bbd",id:"buttonIcon",name:"minus-sm"})),h("div",{key:"c778338bfb06b1658ac301ff7d05fa8136e28a1b",class:"input-container"},c&&h("ls-icon",{key:"2a7dfcc3960654364637bf7d277a7b79a346905b",id:o?"fieldIconDisabled":"fieldIcon",name:c}),h("input",{key:"c7704dc6793a1f1228fb75fe4858a8e8712fa563",type:"number",class:g,id:e,name:e,value:r,placeholder:i,"aria-label":n,required:s,disabled:o,onInput:t=>f(t)}),h("div",{key:"a52ee1a654028e334947340ca7c98b86234c3ba9",class:"right-items"},l&&!o&&h("ls-icon",{key:"62ff08645a5ef0297b650a77e394298683a4e1eb",id:a?"validIcon":"invalidIcon",name:a?"check-circle":"exclamation-circle"}),d&&t!=="ls"&&h("button",{key:"7f2ec8fe418466a3f95f75fe7ed4a81b6e0a1fbd",class:"button",onClick:u},h("ls-icon",{key:"6518f7d70297fad3555772cc2a604471b8ae6360",id:"buttonIcon",name:d})))),t==="ls"&&h("button",{key:"e56be068ead82409003a5d37587d10dd8c0b20f9",class:p,onClick:C,disabled:o},h("ls-icon",{key:"dc56e2bc098b493f587f4a86b91a5a76abd35316",id:"buttonIcon",name:"plus-sm"})))}};LsNumberInput.style=lsNumberInputCss;const lsParticipantManagerCss=":host{display:flex;flex-direction:column;border:1px solid black}.label-span{position:absolute;font-family:inherit;display:inline-flex;align-items:center;line-height:1rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}h1{font-size:19px}*{box-sizing:border-box}.card{display:flex;padding-right:4px;padding-left:4px;padding-top:4px;padding-bottom:4px;margin:4px;border-radius:0.55rem;gap:4px;border:0}.innerButton{margin:0px;padding:0px;background-color:transparent;border:none}.titleButton{width:100%;text-align:left;background-color:transparent;border:none}";const LsParticipantManager=class{constructor(t){registerInstance(this,t);this.mutate=createEvent(this,"mutate");this.update=createEvent(this,"update")}editor;template;mutate;update;selectedHandler(t){}deleteHandler(t){this.update.emit([{action:"delete",data:t}])}swapHandler(t,e){this.update.emit([{action:"swap",data:t,data2:e}])}createHandler(){this.update.emit([{action:"create",data:{id:btoa("rol"+crypto.randomUUID()),name:"Signer "+this.template.roles.length,roleType:"SIGNER",signerIndex:1,ordinal:this.template.roles.length,signerParent:null,experience:""}}])}render(){return h(Host,{key:"ed728f73ef8a9197e547149d4c5cd35b2112f920"},h("h1",{key:"c23f0fa76c2b945c8cd3c1caab2494f80c6a446b"},"Participants"),this.template?.roles.map(((t,e)=>h("div",{class:"card",style:{backgroundColor:this.editor.roleColors[e].faded,border:"1px solid "+this.editor.roleColors[e].primary}},h("button",{class:"titleButton",onClick:()=>{this.selectedHandler(t)}},t?.name||"Signer "+e),h("button",{class:"innerButton",onClick:()=>{this.deleteHandler(t)}},h("ls-icon",{name:"trash",size:"18"})),e!==0?h("button",{class:"innerButton",onClick:()=>{this.swapHandler(t,this.template.roles[e-1])}},h("ls-icon",{name:"arrow-up",size:"18"})):h(h.Fragment,null),e<this.template.roles.length-1?h("button",{class:"innerButton",onClick:()=>{this.swapHandler(t,this.template.roles[e+1])}},h("ls-icon",{name:"arrow-down",size:"18"})):h(h.Fragment,null)))),h("button",{key:"828789c30c2fb340a7bf02c4f275e1ae5f09ca07",onClick:()=>this.createHandler()},"Add Participant"),h("slot",{key:"5624d9c4cf3dd1d38cda2d9239cbde5a611e4258"}))}};LsParticipantManager.style=lsParticipantManagerCss;const lsRadioInputCss=".radioLabel{display:flex;align-items:center;gap:0.75rem;border-radius:0.5rem;padding:0.5rem 0.75rem}.radioLabel.checked{background-color:var(--primary-10);border-color:var(--primary-20);color:var(--primary-90)}.radioLabel:not(checked){color:var(--gray-90);background-color:var(--gray-10);border:1px solid var(--gray-20)}.radioLabel.checked:hover{border-color:var(--primary-30);color:var(--primary-100)}.radioLabel:not(.checked):not(.disabled):hover{border-color:var(--gray-50);color:var(--gray-100)}.radioLabel:focus:not(.disabled){box-shadow:var(--focus-box-shadow);outline-offset:var(--focus-outline-offset);outline:none}.radioLabel.disabled{cursor:not-allowed}.radioLabel.disabled.checked{background-color:var(--primary-10);color:var(--primary-40);border-color:var(--primary-40)}.radioLabel.disabled:not(.checked){background-color:var(--gray-10);color:var(--gray-60)}.inputClass{margin-top:0px}.inputClass:focus{outline:none}.inputClass:disabled{cursor:not-allowed}.spanContainer{display:flex;gap:0.25rem;align-items:center}";const LsRadioInput=class{constructor(t){registerInstance(this,t)}radioId;label;icon;name="name";checked=false;disabled=false;customStyle;render(){const{label:t,radioId:e,icon:r,name:i,disabled:n,checked:o,customStyle:s}=this;const a=clsx("radioLabel",n&&"disabled",o&&"checked");return h("label",{key:"868f3eaea04d42145146300976af808424127571",htmlFor:e,tabIndex:0,class:a,style:s},h("input",{key:"d493afae95f872a28bab84afed3b8553163311e0",type:"radio",class:"inputClass",id:e,name:i,value:t,disabled:n,tabIndex:0,checked:o}),h("div",{key:"4c3aea6b3845f8168927be3d3377d26a14e24ffa",class:"spanContainer"},h("span",{key:"1b34ab675781305a2818eb5076f227f5f506a87a"},r&&h("ls-icon",{key:"9db3bced5765ec9a5efaed3398966506e9f72171",name:r,size:"16"})),h("span",{key:"f9cf5a3b4f43b304c4f23b9be67f20408ebbb2c2"},t)))}};LsRadioInput.style=lsRadioInputCss;const lsSelectInputCss="* {\n box-sizing: border-box;\n margin: 0;\n}\n\n.host {\n position: relative;\n display: flex;\n width: 100%;\n}\n\n#fieldIcon {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n color: var(--gray-80)\n}\n\n#fieldIconDisabled {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n color: var(--gray-60)\n}\n\n.icon-input {\n padding-left: 2.5rem !important;\n}\n\n.button-input {\n padding-right: 2.5rem !important;\n}\n\n.right-items-input {\n padding-right: 4rem !important;\n}\n\n.input-base {\n display: flex;\n width: 100%;\n height: 2.25rem;\n padding: 0rem 0.75rem;\n align-items: center;\n vertical-align: text-top;\n gap: 0.5rem;\n align-self: stretch;\n border-radius: 0.5rem;\n /* Shadow/sm */\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n /* text-sm/leading-5/font-regular */\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 400;\n}\n\nselect::-ms-expand {\n display: none;\n}\n\nselect {\n -moz-appearance: none;\n -webkit-appearance: none;\n}\n\n#select-arrow {\n color: var(--gray-70);\n margin-right: 0.25rem;\n margin-left: -0.125rem;\n}\n\n#select-arrow-disabled {\n color: var(--gray-40);\n margin-right: 0.25rem;\n margin-left: -0.125rem;\n}\n\n.input-base:active:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456F6);\n box-shadow: 0px 0px 3px 0px rgba(0, 15, 153, 0.25), 0px 0px 2px 0px rgba(0, 15, 153, 0.06), 0px 0px 0px 4px #9DC3FC;\n}\n\n.input-base:focus:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456F6);\n box-shadow: 0px 0px 3px 0px rgba(0, 15, 153, 0.25), 0px 0px 2px 0px rgba(0, 15, 153, 0.06), 0px 0px 0px 4px #9DC3FC;\n}\n\n\n.default {\n border: 1px solid var(--gray-40, #D8D9DC);\n background: var(--White, #FFF);\n color: var(--gray-100);\n}\n\n.default:hover {\n border: 1px solid var(--gray-50, #D8D9DC);\n background: var(--White, #FFF);\n color: var(--gray-110);\n}\n\n\n.disabled {\n border: 1px solid var(--gray-40, #D8D9DC);\n background: var(--gray-10, #F7F8FA);\n color: var(--gray-60);\n cursor: not-allowed;\n}\n\n.invalid {\n border: 1px solid var(--red-40, #FFA19E);\n background: var(--White, #FFF);\n color: var(--Red-100, #7A1714);\n}\n\n.invalid:hover {\n border: 1px solid var(--red-50, #FFA19E);\n background: var(--White, #FFF);\n color: var(--Red-100, #7A1714);\n}\n\n.valid {\n border: 1px solid var(--green-40, #72F0C2);\n background: var(--White, #FFF);\n color: var(--Green-100, #125241);\n}\n\n.valid:hover {\n border: 1px solid var(--green-50, #72F0C2);\n background: var(--White, #FFF);\n color: var(--Green-100, #125241);\n}\n\n\n.right-items {\n position: absolute;\n padding: 0.25rem;\n height: 36px;\n right: 0;\n top: 0;\n display: flex;\n align-items: center;\n} \n\n#invalidIcon {\n margin: 0 0.5rem;\n color: var(--red-70);\n}\n\n#validIcon {\n margin: 0 0.5rem;\n color: var(--green-60);\n}\n\n.button {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-50, #C8C9CC);\n background: var(--White, #FFF);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-90);\n }\n}\n\n.button:hover {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-50, #C8C9CC);\n background: var(--gray-20, #EDEFF2);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:active {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--Primary-Blue-Light, #4456F6);\n background: var(--White, #FFF);\n box-shadow: 0px 0px 4px 0px #C7DDFF inset, 0px 0px 0px 4px #9DC3FC;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:focus {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--Primary-Blue-Light, #4456F6);\n background: var(--White, #FFF);\n box-shadow: 0px 0px 4px 0px #C7DDFF inset, 0px 0px 0px 4px #9DC3FC;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n\n\n\n\n";const LsSelectInput=class{constructor(t){registerInstance(this,t)}name;value;aria;inputRef;disabled;displayOnly;required;valid;dirty;buttonClick;buttonIcon;fieldIcon;render(){const{name:t,aria:e,disabled:r,displayOnly:i,required:n,valid:o,dirty:s,buttonClick:a,buttonIcon:l,fieldIcon:u}=this;const d=clsx("input-base",r?"disabled":s&&o?"valid":s&&!o?"invalid":i?"displayOnly":"default",u&&"icon-input",s&&"button-input",l&&"button-input",l&&s&&"right-items-input");return h("host",{key:"a76decdabc8574d7cc1ad7cf6dc68a95b6bb2093",class:"host"},u&&h("ls-icon",{key:"f796a7968ee39c3bdf38aee1844c600ac0bf8443",id:r?"fieldIconDisabled":"fieldIcon",name:u}),h("select",{key:"a7768bd2eac51d1ec84ebcb0933218b4880a7ebb",class:d,id:t,name:t,"aria-label":e,required:n,disabled:r},h("slot",{key:"6f8da440955311e00f0de63d791f7250abd18704"})),h("div",{key:"b3a7a36d4e21917da3a119bfac842842435cb898",class:"right-items"},s&&!r&&h("ls-icon",{key:"0149df824b9deae3e22aa6ffe79c68594c6a3fd9",id:o?"validIcon":"invalidIcon",name:o?"check-circle":"exclamation-circle"}),l?h("button",{class:"button",onClick:a},h("ls-icon",{id:"buttonIcon",name:l})):h("ls-icon",{id:r?"select-arrow-disabled":"select-arrow",name:"chevron-down"})))}};LsSelectInput.style=lsSelectInputCss;const lsStatusbarCss=":host{display:flex;flex-direction:row;bottom:0px;height:47px;min-height:47px;width:100%;background-color:rgb(205, 205, 205);border-top:2px outset rgb(208, 208, 208)}button{border:0}";const LsStatusbar=class{constructor(t){registerInstance(this,t)}get component(){return getElement(this)}zoom;editor;setZoom(t){this.editor.setZoom(t);this.zoom=t}handleZoomInput(){const t=this.component.shadowRoot.getElementById("zoomRange");console.log(Math.floor(parseInt(t.value)/100));debounce(this.setZoom(parseInt(t.value)/100),700)}fitWidth(){const t=this.editor.component.shadowRoot.getElementById("ls-document-frame");this.setZoom(t.clientWidth/this.editor.pageDimensions[0].width)}fitHeight(){const t=this.editor.component.shadowRoot.getElementById("ls-document-frame");this.setZoom(t.clientHeight/this.editor.pageDimensions[0].height)}componentDidLoad(){this.zoom=this.editor.zoom}render(){return h(Host,{key:"b95446e09483c187ae18323659cb15fbaa556628"},h("button",{key:"6619aae12a619b9839ca8d0869024bba1d30437a",onClick:()=>this.editor.displayTable=true},h("ls-icon",{key:"43d64cc63e88fac42eaf8a0a17ea4c15ca7e15cb",name:"table"})),h("button",{key:"76913cf3cab4a47c3e72df2bc927c9e2112247cd",onClick:()=>this.editor.displayTable=false},h("ls-icon",{key:"0ba35b608484dc842bbc76c83af8d1b017f61adc",name:"template"})),h("button",{key:"85cf6a4497bef5bc9757836788931e2c52da3462",onClick:()=>this.fitWidth()},h("ls-icon",{key:"410104a377ae387b5cd70a08b92073c2eb3cbe46",name:"fit-width"})),h("button",{key:"9095791508b75cd8604e2f2a154ac74d3a5fac63",onClick:()=>this.fitHeight()},h("ls-icon",{key:"edae7ec77d581ed7c7091718aab021c81c826da5",name:"fit-height"})),h("button",{key:"9f61c8f22845ba438ca24e34c5750ad5911c9e6d",onClick:()=>{this.editor.pagePrev()}},h("ls-icon",{key:"51742295b1b81900cad284e31a2cd7211da1cb48",name:"arrow-left"})),h("button",{key:"92b8b0f942b0922beb018f30b4591df96a0886ec",onClick:()=>{this.editor.pageNext()}},h("ls-icon",{key:"19314267df935920db7f9281d3e5b9a36fd7f439",name:"arrow-right"})),h("button",{key:"3c375b0d1d1dcaed55ded87c606e6e3abfba8834",onClick:()=>this.setZoom(this.editor.zoom*.8)},h("ls-icon",{key:"88c4ee79ba4b8f082d273b72f7be14d0f3526845",name:"zoom-out"})),h("div",{key:"7e264fd6daa06f546c7bb19b3f34caa570705899"},h("input",{key:"95392f84583a468376f28b80e39fabef7f527008",type:"range",min:"1",max:"300",value:this.zoom*100,class:"slider",id:"zoomRange",onInput:()=>this.handleZoomInput()})),h("button",{key:"791824a0052eb32f3152ba1202add301abbd1312",onClick:()=>this.setZoom(this.editor.zoom/.8)},h("ls-icon",{key:"889fb5b382d8c328ba9f583b913477df3d172104",name:"zoom-in"})),h("slot",{key:"3e45fac107893f17c0f3e6e18757173577c5afe5"}))}};LsStatusbar.style=lsStatusbarCss;const lsTextInputCss='* {\n box-sizing: border-box;\n font-family: "IBM Plex", sans-serif;\n margin: 0;\n}\n\n.host {\n position: relative;\n display: flex;\n width: 100%;\n}\n\n#fieldIcon {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n color: var(--gray-80)\n}\n\n#fieldIconDisabled {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n color: var(--gray-60)\n}\n\n#password-icon {\n padding-right: 0.25rem;\n}\n\n.icon-input {\n padding-left: 2.5rem !important;\n}\n\n.button-input {\n padding-right: 2.5rem !important;\n}\n\n.right-items-input {\n padding-right: 4rem !important;\n}\n\n.input-base {\n display: flex;\n width: 100%;\n height: 2.25rem;\n padding: 0.5rem 0.75rem;\n align-items: center;\n gap: 0.5rem;\n align-self: stretch;\n border-radius: 0.5rem;\n /* Shadow/sm */\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n /* text-sm/leading-5/font-regular */\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 400;\n}\n\n.input-base:active:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456F6);\n box-shadow: 0px 0px 3px 0px rgba(0, 15, 153, 0.25), 0px 0px 2px 0px rgba(0, 15, 153, 0.06), 0px 0px 0px 4px #9DC3FC;\n}\n\n.input-base:focus:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456F6);\n box-shadow: 0px 0px 3px 0px rgba(0, 15, 153, 0.25), 0px 0px 2px 0px rgba(0, 15, 153, 0.06), 0px 0px 0px 4px #9DC3FC;\n}\n\n\n.default {\n border: 1px solid var(--gray-40, #D8D9DC);\n background: var(--White, #FFF);\n color: var(--gray-100);\n}\n\n.default:hover {\n border: 1px solid var(--gray-50, #D8D9DC);\n background: var(--White, #FFF);\n color: var(--gray-110);\n}\n\n\n.disabled {\n border: 1px solid var(--gray-40, #D8D9DC);\n background: var(--gray-10, #F7F8FA);\n color: var(--gray-60);\n cursor: not-allowed;\n}\n\n.display-only {\n border: 1px solid var(--gray-40, #D8D9DC);\n background: var(--gray-10, #F7F8FA);\n color: var(--gray-100);\n cursor: not-allowed;\n}\n\n.invalid {\n border: 1px solid var(--red-40, #FFA19E);\n background: var(--White, #FFF);\n color: var(--Red-100, #7A1714);\n}\n\n.invalid:hover {\n border: 1px solid var(--red-50, #FFA19E);\n background: var(--White, #FFF);\n color: var(--Red-100, #7A1714);\n}\n\n.valid {\n border: 1px solid var(--green-40, #72F0C2);\n background: var(--White, #FFF);\n color: var(--Green-100, #125241);\n}\n\n.valid:hover {\n border: 1px solid var(--green-50, #72F0C2);\n background: var(--White, #FFF);\n color: var(--Green-100, #125241);\n}\n\n\n.right-items {\n position: absolute;\n padding: 0.25rem;\n height: 36px;\n right: 0;\n top: 0;\n display: flex;\n align-items: center;\n} \n\n#invalidIcon {\n margin: 0 0.5rem;\n color: var(--red-70);\n}\n\n#validIcon {\n margin: 0 0.5rem;\n color: var(--green-60);\n}\n\n.button {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-50, #C8C9CC);\n background: var(--White, #FFF);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-90);\n }\n}\n\n.button:hover {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-50, #C8C9CC);\n background: var(--gray-20, #EDEFF2);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:active {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--Primary-Blue-Light, #4456F6);\n background: var(--White, #FFF);\n box-shadow: 0px 0px 4px 0px #C7DDFF inset, 0px 0px 0px 4px #9DC3FC;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:focus {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--Primary-Blue-Light, #4456F6);\n background: var(--White, #FFF);\n box-shadow: 0px 0px 4px 0px #C7DDFF inset, 0px 0px 0px 4px #9DC3FC;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n\n\n\n\n';const LsTextInput=class{constructor(t){registerInstance(this,t)}type="default";name;value;placeholder;aria;inputRef;disabled;required;valid;dirty;countMax;buttonClick;buttonIcon;fieldIcon;showPassword=false;handlePassword=()=>{this.showPassword=!this.showPassword};render(){const{type:t,name:e,value:r,placeholder:i,aria:n,disabled:o,required:s,valid:a,dirty:l,countMax:u,buttonClick:d,buttonIcon:c,fieldIcon:f,showPassword:v,handlePassword:C}=this;const g=clsx("input-base",t==="displayonly"?"display-only":o?"disabled":l&&a?"valid":l&&!a?"invalid":"default",f&&"icon-input",l&&"button-input",c&&"button-input",c&&l&&"right-items-input");return h(Host,{key:"6462187da506b6cd1adb89f00247097c2f3c5416",class:"host"},f&&h("ls-icon",{key:"c80abd9b78a54b31a827851d637c845aaebea0dc",id:o?"fieldIconDisabled":"fieldIcon",name:f}),t==="password"?h("input",{type:v&&"password",class:g,id:e,name:e,value:r,maxlength:u,placeholder:i,"aria-label":n,required:s,disabled:o}):t==="displayonly"?h("input",{class:g,id:e,name:e,value:r,maxlength:u,placeholder:i,"aria-label":n,required:s,disabled:true}):h("input",{class:g,id:e,name:e,value:r,maxlength:u,placeholder:i,"aria-label":n,required:s,disabled:o}),h("div",{key:"61739c02c2de93f0dcfd55dce6e72cb6cc973af7",class:"right-items"},l&&!o&&h("ls-icon",{key:"9d9966564af4d40bf4c1b67e7c97426b7985a105",id:a?"validIcon":"invalidIcon",name:a?"check-circle":"exclamation-circle"}),c&&h("button",{key:"fb91b8562c4d946625a02da2e4f3661c047b1df6",class:"button",onClick:d},h("ls-icon",{key:"5c791544181981b821be4723ee60e525bbe246a6",id:"buttonIcon",name:c})),t==="password"&&!c&&h("ls-icon-button",{key:"4ddbf5b44cde5fe4d4a8babfeda0c915e21bef5e",id:"password-icon",icon:v?"eye":"eye-off",onClick:C})))}};LsTextInput.style=lsTextInputCss;const lsTextareaInputCss='* {\n box-sizing: border-box;\n font-family: "IBM Plex", sans-serif;\n margin: 0;\n}\n\n.host {\n position: relative;\n display: flex;\n width: 100%;\n}\n\n#fieldIcon {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n color: var(--gray-80);\n}\n\n#fieldIconDisabled {\n position: absolute;\n top: 0.5rem;\n left: 0.75rem;\n color: var(--gray-60);\n}\n\n.icon-input {\n padding-left: 2.5rem !important;\n}\n\n.button-input {\n padding-right: 2.5rem !important;\n}\n\n.right-items-input {\n padding-right: 4rem !important;\n}\n\n.input-base {\n display: flex;\n resize: vertical;\n width: 100%;\n min-height: 4rem;\n padding: 0.5rem 0.75rem;\n align-items: center;\n gap: 0.5rem;\n align-self: stretch;\n border-radius: 0.5rem;\n /* Shadow/sm */\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n overflow: hidden;\n text-overflow: ellipsis;\n /* text-sm/leading-5/font-regular */\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 400;\n}\n\n.input-base:active:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456f6);\n box-shadow:\n 0px 0px 3px 0px rgba(0, 15, 153, 0.25),\n 0px 0px 2px 0px rgba(0, 15, 153, 0.06),\n 0px 0px 0px 4px #9dc3fc;\n}\n\n.input-base:focus:not(:disabled) {\n outline: 1px solid var(--Legalesign-Blue-60, #4456f6);\n box-shadow:\n 0px 0px 3px 0px rgba(0, 15, 153, 0.25),\n 0px 0px 2px 0px rgba(0, 15, 153, 0.06),\n 0px 0px 0px 4px #9dc3fc;\n}\n\n.default {\n border: 1px solid var(--gray-40, #d8d9dc);\n background: var(--White, #fff);\n color: var(--gray-100);\n}\n\n.default:hover {\n border: 1px solid var(--gray-50, #d8d9dc);\n background: var(--White, #fff);\n color: var(--gray-110);\n}\n\n.disabled {\n border: 1px solid var(--gray-40, #d8d9dc);\n background: var(--gray-10, #f7f8fa);\n color: var(--gray-60);\n cursor: not-allowed;\n}\n\n.invalid {\n border: 1px solid var(--red-40, #ffa19e);\n background: var(--White, #fff);\n color: var(--Red-100, #7a1714);\n}\n\n.invalid:hover {\n border: 1px solid var(--red-50, #ffa19e);\n background: var(--White, #fff);\n color: var(--Red-100, #7a1714);\n}\n\n.valid {\n border: 1px solid var(--green-40, #72f0c2);\n background: var(--White, #fff);\n color: var(--Green-100, #125241);\n}\n\n.valid:hover {\n border: 1px solid var(--green-50, #72f0c2);\n background: var(--White, #fff);\n color: var(--Green-100, #125241);\n}\n\n.right-items {\n position: absolute;\n padding: 0.25rem;\n height: 36px;\n right: 0;\n top: 0;\n display: flex;\n align-items: center;\n}\n\n#invalidIcon {\n margin: 0 0.5rem;\n color: var(--red-70);\n}\n\n#validIcon {\n margin: 0 0.5rem;\n color: var(--green-60);\n}\n\n.button {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-50, #c8c9cc);\n background: var(--White, #fff);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-90);\n }\n}\n\n.button:hover {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--gray-50, #c8c9cc);\n background: var(--gray-20, #edeff2);\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:active {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--Primary-Blue-Light, #4456f6);\n background: var(--White, #fff);\n box-shadow:\n 0px 0px 4px 0px #c7ddff inset,\n 0px 0px 0px 4px #9dc3fc;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n\n.button:focus {\n display: flex;\n height: 28px;\n width: 28px;\n padding: 0.25rem;\n justify-content: center;\n align-items: center;\n border-radius: 0.375rem;\n border: 1px solid var(--Primary-Blue-Light, #4456f6);\n background: var(--White, #fff);\n box-shadow:\n 0px 0px 4px 0px #c7ddff inset,\n 0px 0px 0px 4px #9dc3fc;\n\n #buttonIcon {\n color: var(--gray-100);\n }\n}\n';const LsTextareaInput=class{constructor(t){registerInstance(this,t)}name;value;placeholder;aria;inputRef;disabled;displayOnly;required;valid;dirty;countMax;buttonClick;buttonIcon;fieldIcon;render(){const{name:t,value:e,placeholder:r,aria:i,disabled:n,displayOnly:o,required:s,valid:a,dirty:l,countMax:u,buttonClick:d,buttonIcon:c,fieldIcon:f}=this;const v=clsx("input-base",n?"disabled":l&&a?"valid":l&&!a?"invalid":o?"displayOnly":"default",f&&"icon-input",l&&"button-input",c&&"button-input",c&&l&&"right-items-input");return h("host",{key:"63b0922d0feb42bee3c0e91de96a485690e8944d",class:"host"},f&&h("ls-icon",{key:"da7ff50644c71cfad18ef2eff80d4fb5cea5b87f",id:n?"fieldIconDisabled":"fieldIcon",name:f}),h("textarea",{key:"2d85c6d34a0398b45b0cbdae1e0e014a4b6f07d0",class:v,id:t,name:t,value:e,maxlength:u,placeholder:r,"aria-label":i,required:s,disabled:n}),h("div",{key:"f38c190f48022334d56df348cb174a7e033d07f3",class:"right-items"},l&&!n&&h("ls-icon",{key:"70a91ac79ef10533644db3b226a775d27986c0ac",id:a?"validIcon":"invalidIcon",name:a?"check-circle":"exclamation-circle"}),c&&h("button",{key:"fcd8fbb0163ae6edf847c23ac5f0211de4ea468c",class:"button",onClick:d},h("ls-icon",{key:"3606cf132a466341a50e787371334c232929e6ab",id:"buttonIcon",name:c}))))}};LsTextareaInput.style=lsTextareaInputCss;const lsToolbarCss=":host{display:flex;flex-direction:row;height:32px;width:100%;background-color:rgb(205, 205, 205)}.rowbox{display:flex;flex-direction:row;vertical-align:middle}";const LsToolbar=class{constructor(t){registerInstance(this,t)}dataItem;template;editor;render(){return h(Host,{key:"760062b8fec68c747e9b914483e7a87e16613cbb"},this.dataItem&&this.dataItem.length>1?h("div",{class:"rowbox"},h("select",{class:"ls-participant-select"},h("option",{value:"0"},"Sender"),this.template.roles.map((t=>h("option",{value:t.id},t.name)))),h("ls-field-format",{dataItem:this?.dataItem}),h("ls-field-alignment",{dataItem:this.dataItem}),h("ls-field-distribute",{dataItem:this.dataItem}),h("ls-field-size",{dataItem:this.dataItem})):h("div",{class:"rowbox"},h("select",{class:"ls-participant-select"},h("option",{value:"0"},"Sender"),this.template.roles.map((t=>h("option",{value:t.id},t.name)))),h("ls-field-format",{dataItem:this?.dataItem})),h("slot",{key:"d8f47970928a50744475e4aa532fe596e3617cda"}))}};LsToolbar.style=lsToolbarCss;const lsToolboxFieldCss=":host{display:block;border:1px green solid;position:relative;min-width:110px;padding:8px;background-color:white;border-radius:0.75rem;border:1px solid var(--gray-20, #EDEFF2);background:var(--white, #FFF);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -2px rgba(0, 0, 0, 0.05);color:rgb(76, 75, 75)}.ls-sixdots{position:absolute;right:0px;color:inherit}";const LsToolboxField=class{constructor(t){registerInstance(this,t)}formElementType;elementType;validation=0;label;defaultHeight;defaultWidth;handleDragStart(t){t.dataTransfer.setData("application/json",JSON.stringify({formElementType:this.formElementType,elementType:this.elementType,validation:this.validation,defaultHeight:this.defaultHeight,defaultWidth:this.defaultWidth}));t.dataTransfer.dropEffect="copy"}handleKeyDown(t){if(t.key==="ArrowDown"){console.log("down arrow pressed")}}render(){return h(Host,{key:"7462f248062a6b96803cdd53cc0f9a24974af630",draggable:"true"},this.label,h("span",{key:"0c1e419aa5296831ee256b4a278cfee563890299",class:"ls-sixdots"},h("svg",{key:"fc8fe0921f2384672cd256f8762621311465a5f6",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{key:"7b51e08c9df2ae5aa281572abaab17e8664754e0",d:"M9 5V5.01M9 12V12.01M9 19V19.01M15 5V5.01M15 12V12.01M15 19V19.01M9 6C8.44772 6 8 5.55228 8 5C8 4.44772 8.44772 4 9 4C9.55229 4 10 4.44772 10 5C10 5.55228 9.55229 6 9 6ZM9 13C8.44772 13 8 12.5523 8 12C8 11.4477 8.44772 11 9 11C9.55229 11 10 11.4477 10 12C10 12.5523 9.55229 13 9 13ZM9 20C8.44772 20 8 19.5523 8 19C8 18.4477 8.44772 18 9 18C9.55228 18 10 18.4477 10 19C10 19.5523 9.55228 20 9 20ZM15 6C14.4477 6 14 5.55228 14 5C14 4.44772 14.4477 4 15 4C15.5523 4 16 4.44772 16 5C16 5.55228 15.5523 6 15 6ZM15 13C14.4477 13 14 12.5523 14 12C14 11.4477 14.4477 11 15 11C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13ZM15 20C14.4477 20 14 19.5523 14 19C14 18.4477 14.4477 18 15 18C15.5523 18 16 18.4477 16 19C16 19.5523 15.5523 20 15 20Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))))}};LsToolboxField.style=lsToolboxFieldCss;export{LsDocumentOptions as ls_document_options,LsDocumentViewer as ls_document_viewer,LsEditorField as ls_editor_field,LsEditorTable as ls_editor_table,LsFeatureColoumn as ls_feature_column,LsFieldAlignment as ls_field_alignment,LsFieldDimensions as ls_field_dimensions,LsFieldDistribute as ls_field_distribute,LsFieldFormat as ls_field_format,LsFieldProperties as ls_field_properties,LsFieldPropertiesDate as ls_field_properties_date,LsFieldPropertiesGeneral as ls_field_properties_general,LsFieldPropertiesMultiple as ls_field_properties_multiple,LsFieldPropertiesNumber as ls_field_properties_number,LsFieldPropertiesSignature as ls_field_properties_signature,LsFieldPropertiesText as ls_field_properties_text,LsFieldSize as ls_field_size,LsFormfield as ls_formfield,LsIcon as ls_icon,LsNumberInput as ls_number_input,LsParticipantManager as ls_participant_manager,LsRadioInput as ls_radio_input,LsSelectInput as ls_select_input,LsStatusbar as ls_statusbar,LsTextInput as ls_text_input,LsTextareaInput as ls_textarea_input,LsToolbar as ls_toolbar,LsToolboxField as ls_toolbox_field};
8916
- //# sourceMappingURL=p-36261506.entry.js.map
8916
+ //# sourceMappingURL=p-20c9ab64.entry.js.map