web-document-viewer 11.4.8 → 11.4.9
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// Permission for usage and modification of this code is only permitted
|
|
8
8
|
// with the purchase of a source code license.
|
|
9
9
|
//-------------------------------------------------------------------------------------------------
|
|
10
|
-
// Version 11,4,0,
|
|
10
|
+
// Version 11,4,0,377
|
|
11
11
|
|
|
12
12
|
export as namespace Atalasoft;
|
|
13
13
|
interface NotificationCallback {
|
|
@@ -569,7 +569,7 @@ function Pn(e){return{" transform":e,"-moz-transform":e,"-webkit-transform":e,"-
|
|
|
569
569
|
*/function Qe(e){if("string"==typeof e){var t=e.trim(),n=parseInt(t);if(/^([+|-]?[0-9]+)$/.test(t))return n}return"number"!=typeof e?null:e}
|
|
570
570
|
/**
|
|
571
571
|
* @private
|
|
572
|
-
*/function Tn(e){return isFinite(e)&&!(e%1)}function Ue(e){return!isNaN(e)&&isFinite(e)}var Dn={instanceCounter:0};function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cn=function(){function e(e){S(this,"viewer",void 0),S(this,"currentThumb",void 0),this.viewer=e,this.currentThumb=null}var t=e.prototype;return t.isViewerActive=function(){return!(!this.viewer||!this.currentThumb)},t.isThumbnailerActive=function(e){return e&&!!this.currentThumb&&this.currentThumb.get()===e.get()},t.activateThumbnailer=function(e,t,n,o,i){var a=this.isThumbnailerActive(e);a&&!i||(this.currentThumb&&!a&&this.currentThumb.detachViewer(),this.currentThumb=e,this.viewer&&this.viewer.isInitialized()&&(this.viewer.switchDocument(t,n,o),this.currentThumb.activateViewer()))},t.closeDocument=function(e,t){e=e||this.currentThumb;var n=this.isThumbnailerActive(e);n&&(e.detachViewer(),this.currentThumb=null),this.viewer&&this.viewer.isInitialized()&&t&&this.viewer.closeDocument(t,n)},e}();function F(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var En=function(){function e(e){A(this,"jqe",fn({})),A(this,"memoryEntries",[]),A(this,"config",{colorDepth:8,compression:1,highWaterMark:5e8,pageSize:{width:800,height:1132}}),A(this,"bytesInUse",0),e&&fn.extend(this.config,e)}var t,n,o,i=e.prototype;return i.dispose=function(){this.clearEntries()},i.bind=function(){return this.jqe.on.apply(this.jqe,arguments),this},i.unbind=function(){return this.jqe.off.apply(this.jqe,arguments),this},i.trigger=function(e){return this.jqe.trigger.apply(this.jqe,arguments),this},i.allocate=function(e){return this.memoryEntries.push(e),this.bytesInUse+=this.calcBytes(e),this.bytesInUse>this.config.highWaterMark&&this.trigger("exceededhighwatermark"),this.bytesInUse},i.deallocateOldestEntry=function(){var e=this.memoryEntries.shift();return void 0!==e&&this.deallocate(e),e},i.clearEntries=function(){this.memoryEntries.length=0,this.bytesInUse=0},i.deallocate=function(e){return this.bytesInUse-=this.calcBytes(e),this.bytesInUse<0&&(this.bytesInUse=0),this.bytesInUse},i.calcBytes=function(e){return(e.width()||this.config.pageSize.width)*(e.height()||this.config.pageSize.height)*this.config.colorDepth/8*this.config.compression},t=e,(n=[{key:"typeOf",get:function(){return"Atalasoft.Document.MemoryTacker"}},{key:"colorDepth",set:function(e){this.config.colorDepth=e},get:function(){return this.config.colorDepth}},{key:"highWatermark",set:function(e){this.config.highWaterMark=e},get:function(){return this.config.highWaterMark}},{key:"pageSize",set:function(e){this.config.pageSize={width:e.width,height:e.height}},get:function(){return this.config.pageSize}}])&&F(t.prototype,n),o&&F(t,o),e}(),Mn=[11,4,0,355],O=(n(61),n(88),n(62),n(115),n(63),n(66),function(o,e,t){var n=this,f=o,h=e,g=null,p=null,m=!1,v={" ":!0,"-":!0,"?":!0,"\n":!0,"\t":!0},i=t,a=null;function b(){var e,t;(t=document.body).currentStyle?e=t.currentStyle.direction:window.getComputedStyle&&(e=document.defaultView.getComputedStyle(t,null).getPropertyValue("direction")),"rtl"===e.toLowerCase()&&(m=!0),g=fn("<canvas "+(m?'dir="rtl"':"")+"/>"),p=fn('<span style="position:absolute; visibility:hidden; left: -5000px;">{[|,0123456789Thqkbfjplyg</span>'),fn(i).append(p)}function r(e){g&&p||b(),h.applyTo(p),g[0].width=e.width,g[0].height=e.height;var t=g[0].getContext("2d"),n=function(e,t,n){var o=[];if("string"==typeof t){if(f.text.autoscale)return t.split("\n");for(var i=t,a=n,r=function(e){for(var t=[],n="",o=0,i=0;i<e.length;i++){var a=e[i];v[n]&&(t.push(e.substr(o,i-o)),o=i),n=a}return o<e.length&&t.push(e.substr(o,e.length-o)),t}(i),l="",s="",u=[],c=0;c<r.length;c++)if(l=s,s=r[c],e.measureText(s).width>a)for(var d=s.split(""),h=0;h<d.length;h++)u.push(d[h]),e.measureText(u.join("")).width>a&&(u.pop(),o.push(u.join("")),u.length=0,u.push(d[h]));else u.push(s),(e.measureText(u.join("").trim()).width>a||0<=l.indexOf("\n"))&&(u.pop(),o.push(u.join("")),u.length=0,u.push(s));0<u.length&&(o.push(u.join("")),u.length=0)}return o}(t,f.text.value,e.width),o=function(e){if(f.text.autoscale){var t=Math.max(0,f.height-2*f.outline.width);return 0<e?Math.floor(t/e):t}return h.applyTo(p,1),p[0].offsetHeight}(n.length),i=f.text.autoscale?o:f.text.font.size,a=[f.text.font.italic?"italic":"normal",f.text.font.bold?"bold":"normal",i+"px",f.text.font.family];t.font=a.join(" "),t.fillStyle=f.text.font.color,t.textBaseline="top";var r,l=0,s=n.length?n[0]:"";for(r=0;r<n.length;r++)n[r].length>s.length&&(s=n[r]);var u=t.measureText(s).width,c=m?u:0;if(f.text.autoscale&&"left"!==f.text.align)switch(f.text.align){case"center":t.textAlign=f.text.align,c=u/2;break;case"right":t.textAlign=f.text.align,c=m?0:u;break;default:t.textAlign="start",c=m?u:0}if(f.text.autoscale){var d=e.width/u;t.scale(d,1)}if(!f.text.autoscale)switch(f.text.align){case"center":t.textAlign=f.text.align,c=e.width/2;break;case"right":t.textAlign=f.text.align,c=e.width}for(r=0;r<n.length;r++)t.fillText(n[r],c,l,u),l+=o;return g[0].toDataURL()}n.dispose=function(){h=f=n=null,g&&g.remove&&(g.remove(),g=null),p&&p.remove&&(p.remove(),p=null),i=null},n.renderToDataURL=r,n.renderToSVGImage=function(e,t){var n=a;n&&n.width===t.width&&n.height===t.height&&n.text===o.text.value&&n.align===o.text.align||(a={width:t.width,height:t.height,text:o.text.value,align:o.text.align},e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r(t)))}}),I=(n(117),function(e,t){var n=this,o=t,i={bold:!1,italic:!1,strike:!1,underline:!1,color:"#000000",family:"Arial",size:12},a=1,r=1,l=pn.Mobile.Any()?18:8;function s(e){e&&fn.extend(i,e),u()}function u(e,t,n){(e=e||o)&&(t=void 0!==t?t:a,n||(t=d()),c(e,t))}function c(e,t){var n="none";(i.strike||i.underline)&&(n=i.strike?"line-through ":"",n+=i.underline?"underline":"");var o=i.size*(t||1);e.css({color:i.color,"font-family":i.family,"font-style":i.italic?"italic":"normal","font-weight":i.bold?"bold":"normal","font-size":o+"pt","text-decoration":n})}function d(){return a=i.size*r<l?l/i.size:r}s(e),n.dispose=function(){i=o=n=null},n.set=s,n.get=function(e){return e?i[e]:i},n.repaint=u,n.applyTo=c,n.getAdjustedZoom=d,n.getZoom=function(){return r},n.setZoom=function(e){r=e,u()}}),B=function(_,w,e){var t=this,z=e,o=_.getEventObject(),k=null,a=null,P=null,r=null,T=_.get("text"),n=T.value,D=!1,C=3,E=pn.Mobile.Any()?{width:200,height:200}:{width:1,height:1},i={},l={moving:u,resized:u,moved:u,rotated:u},M=function(){var e=_.get();a||(a=fn('<textarea selectable="false"/>'),fn(r.innerDom).append(a),a.css({"background-color":"transparent",border:"0px solid","overflow-x":"hidden","overflow-y":"hidden","-moz-user-select":"none","-khtml-user-select":"none","-webkit-user-select":"none","user-select":"none",resize:"none",cursor:"inherit"}),a.attr("readonly","readonly"),a.on({focus:function(){return this.blur(),!1}}),a[0].raphaelParent=!0),a.val(T.value);var t=_.get("outline").width/2,n=Math.max(Math.ceil(e.width-2*(t+C)),1),o=Math.max(Math.ceil(e.height-2*(t+C)),1);if(P&&(P.set(T.font),P.repaint(a,1,!0)),a.css({width:n+"px",height:o+"px","max-width":n+"px","max-height":o+"px",padding:C+"px","text-align":T.align}),a.attr("title",e.tooltip),r.attr({x:Math.round(t+e.x),y:Math.round(t+e.y),width:e.width,height:e.height}),0<=e.cornerradius){var i=_.getObject();fn(i[0]).attr({rx:e.cornerradius||0,ry:e.cornerradius||0})}r.transform(S().toTransformString(!0))};function s(){var e=_.get("outline").width/2,t=_.get(),n=Math.max(Math.ceil(t.width-2*(e+C)),0),o=Math.max(Math.ceil(t.height-2*(e+C)),0);if(P&&P.set(T.font),r.attr({x:Math.round(e+C+t.x),y:Math.round(e+C+t.y),width:n,height:o,title:t.tooltip}),0<=t.cornerradius){var i=_.getObject();fn(i[0]).attr({rx:t.cornerradius||0,ry:t.cornerradius||0})}r.renderer&&r.renderer.renderToSVGImage(r[0],{width:n,height:o}),r.transform(S().toTransformString(!0))}function S(){var e=gn.matrix(),t=z.getViewerTransform(_._pageindex),n=_.getTransform();return e.add(t.a,t.b,t.c,t.d,t.e,t.f),e.add(n.a,n.b,n.c,n.d,n.e,n.f),e}function u(){r&&p()}function F(e,t,n){return{x:e.x(t,n),y:e.y(t,n)}}function c(){if(null==P&&(P=new I(T.font)),r){var e=!0!==r.removed?r:null;o.unbind(e,{showeditor:d,hideeditor:f})}var t=D,n=T.autoscale;(r=n?w.atalaImage():w.html()).isHtml&&!n||(r.renderer=new O(_.get(),P,w._page),M=s),null!=k&&w._page&&(w._page.append(k),w._page.on(i)),gn.vml&&(_.getObject().node.style.overflow="hidden"),r.transform(S().toTransformString(!0)),o.bind(r,{showeditor:d,hideeditor:f}),t&&d()}function d(){w._page[0].classList.contains(_n.atala_active_thumb)||(k||function(){k=fn("<textarea/>").hide(),w._page&&(w._page.append(k),w._page.on(i)),k.on("change keydown mouseup mousemove mousedown",h),k.bind({blur:f}),_.bind({deselected:f});var e=_.getObject();if(k.css({position:"absolute","overflow-x":"auto","overflow-y":"auto","z-index":99999,border:"0px solid",padding:"0px","background-color":"transparent","text-align":T.align}),pn.Mobile.Any()){var t=_.get(),n=Q(w.canvas,w._page);k.css({left:t.x+n.left+"px",top:t.y+n.top+"px",width:t.width+"px","max-width":t.width+"px",height:t.height+"px","max-height":t.height+"px",border:e.attr("stroke")+" "+e.attr("strokewidth")+"px","background-color":e.attr("fill")})}P.setZoom(_.getZoom()),(pn.Chrome||pn.Safari)&&k.css({resize:"none"}),null!=T.value&&k.val(T.value),T.readonly&&k.prop("readonly","readonly"),P.repaint(k,_.getZoom())}(),_&&!_.get("visible")||(!k.is(":hidden")&&D||(r.hide(),k.prop("readonly",T.readonly?"readonly":""),T.value!==k.val()&&k.val(T.value),k.show(),p()),pn.Touch&&k.focus(function(){k[0].setSelectionRange(0,9999)}),k[0].focus(),n=T.value,D=!0))}function h(e){e.stopPropagation(),T.value!==k.val()&&(T.value=k.val(),_.set({text:T}))}function f(){if(k&&((k.is(":visible")||D)&&(k.hide(),r.show(),p()),0===arguments.length||1===arguments.length&&"blur"===arguments[0].type)){o.trigger("annotationtextchanged");var e=_.getClonedData(),t=fn.extend(!0,{},e);delete t.update,delete t.getPageIndex,t.text.value=n,o.trigger({type:"annotationchanged",ann:_,annobefore:t}),k[0].blur(),D=!1}}function g(){!_||_.get("visible")?D?d():r.show():r.hide(),r.backgroundColor&&r.backgroundColor(_.get("fill").color)}function A(e){e&&(w!==e||r.removed)&&(w=e,null!=a&&(a.remove(),a=null),c(),g())}function p(e){if(A(e),M(),k&&(!k.is(":hidden")||D)){var t=_.get("outline").width/2,n=_.get(),o=_.getZoom(),i=_.getBox(),a=S(),r=F(a,i.x,i.y),l=F(a,i.x+i.width,i.y+i.height),s=i.width*o,u=i.height*o,c=(r.x+l.x-s)/2,d=(r.y+l.y-u)/2,h=C*o,f=t*o,g=2*(h+f),p=Math.max(Math.ceil(s-g),E.width),m=Math.max(Math.ceil(u-g),E.height),v=Q(w.canvas,w._page),b=n.rotation+z.getPageRotation(_._pageindex),y=0!==b?"rotate("+b+"deg)":"",x={left:Math.round(c+v.left+f)+"px",top:Math.round(d+v.top+f)+"px",width:p+"px",height:m+"px","max-width":p+"px","max-height":m+"px",padding:Math.ceil(h)+"px"};fn.extend(x,Pn(y)),k.css(x)}P&&(P.set(T.font),P.setZoom(_.getZoom()),P.repaint(k,_.getZoom()))}c(),p(),_.bind(l),t.dispose=function(){k&&k.remove(),a&&a.remove(),P&&P.dispose(),r&&r.remove(),w&&w._page&&w._page.off(i),_.unbind(l),T=r=a=P=k=o=t=null},t.set=function(e){e&&fn.extend(T,e)},t.get=function(e){return e?T[e]:T},t.getFont=function(){return P},t.inEditMode=function(){return D},t.updateView=g,t.changepaper=A,t.repaint=p},V=function(){var e=this,t=fn({}),o={drawing:!1,hold:null,pinching:!1,tapped:!1,touching:!1,delta:{x:0,y:0},origin:{x:0,y:0},point:{x:0,y:0},moves:0,e:null};function i(){t.trigger.apply(t,arguments)}function a(){i({type:"interactstart"})}function r(){i({type:"interactend"})}function l(e){if(o.e=e,a(),i(e),2===e.originalEvent.touches.length&&function(e){for(var t=null,n=0;n<e.length;n++){var o=e[n].target;if(!o||!o.raphael&&!o.raphaelParent)return!1;if(null===t)t=o;else if(t!==o)return!1}return!0}(e.originalEvent.touches))c(),o.touching=!1,(n=e).stopPropagation(),n.preventDefault(),o.pinching=!0,i({type:"pinchstart",touches:n.originalEvent.touches});else if(1===e.originalEvent.touches.length){i("selectchange"),o.touching=!0;var t=J(e);o.point.x=t.x,o.point.y=t.y,o.hold=setTimeout(u,1500)}var n}function s(){o.tapped=!1}function u(){if(0<o.moves&&null!==o.e){var e=J(o.e);Math.abs(o.point.x-e.x)<5&&Math.abs(o.point.y-e.y)<5&&(o.moves=0)}0===o.moves&&o.touching&&o.e&&(o.touching=!1,i({type:"contextmenu",x:o.e.originalEvent.touches[0].pageX,y:o.e.originalEvent.touches[0].pageY}))}function c(){null!==o.hold&&(clearTimeout(o.hold),o.hold=null)}e.events={click:function(e){i(e)},dblclick:function(e){i(e);var t=J(e);i({type:"showeditor",x:t.x,y:t.y})},mousedown:function(e){return a(),i(e),i({type:"selectchange",shiftKey:e.shiftKey,ctrlKey:e.ctrlKey}),3===e.which&&i({type:"contextmenu",x:e.pageX,y:e.pageY,event:e}),!1},mousemove:function(e){i(e)},mouseout:function(e){i(e)},mouseover:function(e){i(e)},mouseup:function(e){i(e),r()}},pn.Features.Touch&&fn.extend(!0,e.events,{touchstart:l,touchmove:function(e){var t;i(o.e=e),o.pinching?((t=e).stopPropagation(),t.preventDefault(),i({type:"pinchmove",touches:t.originalEvent.touches})):o.moves++},touchend:function(e){var t,n;i(o.e=e),o.pinching?((n=e).stopPropagation(),n.preventDefault(),o.pinching=!1,i({type:"pinchend",touches:n.originalEvent.touches}),1===n.originalEvent.touches.length&&l(n)):o.touching&&(o.touching=!1,c(),o.moves=0,o.tapped?(t=e,o.e=t,i({type:"showeditor",x:o.point.x,y:o.point.y})):(o.tapped=!0,setTimeout(s,300))),r()}}),e.bind=function(){return t.on.apply(t,arguments),e},e.unbind=function(){return t.off.apply(t,arguments),e},e.trigger=i},R=function(e){var n=fn({}),t=e,o=null,a={target:null,mx:null,my:null,px:null,py:null,dx:null,dy:null};function r(e){a.px=a.mx,a.py=a.my,e.originalEvent?(a.mx=e.originalEvent.targetTouches[0].pageX,a.my=e.originalEvent.targetTouches[0].pageY):(a.mx=e.targetTouches[0].pageX,a.my=e.targetTouches[0].pageY),a.dx=a.mx-a.px,a.dy=a.my-a.py}function l(e){a.px=a.mx,a.py=a.my,a.mx=e.screenX,a.my=e.screenY,a.dx=a.mx-a.px,a.dy=a.my-a.py}function s(){n.trigger.apply(n,arguments)}function i(){s({type:"interactstart",target:t})}function u(){s({type:"interactend",target:t})}function c(e,t,n,o,i){(e||t)&&(pn.Features.Touch&&i.target!==a.target||(null===a.px&&d(0,0,i),i.touches?r(i):l(i),s({type:"dragmove",dx:a.dx,dy:a.dy,mx:a.mx,my:a.my,originalEvent:i})))}function d(e,t,n){a.target=n.target,i(),n.touches?r(n):l(n),s({type:"dragstart",mx:a.mx,my:a.my,originalEvent:n})}function h(e){pn.Features.Touch&&e.target!==a.target||(a.target=null,a.px=null,a.py=null,a.mx=null,a.my=null,s({type:"dragend",originalEvent:e}))}function f(){s("hoverin")}function g(){s("hoverout")}function p(e){s(e)}function m(e){s(e)}function v(e){a.px=null,a.py=null,s(e)}function b(e){s(e)}function y(e){s(e)}function x(e){s(e)}function _(e){s(e)}function w(e){s(e)}function z(e){s(e),1===e.which?s("mousedownleft"):3===e.which&&s("mousedownright")}function k(e){s(e)}function P(e){s(e)}function T(e){s(e)}function D(e){s(e),3===e.which&&s("rightclick")}function C(e){s(e)}function E(e){s(e)}function M(e){s(e)}(o=new V).bind({click:_,dblclick:w,mousedown:z,mousemove:k,mouseover:T,mouseout:P,mouseup:D,touchmove:C,touchstart:M,interactstart:i,interactend:u,pinchstart:p,pinchmove:m,pinchend:v,selectchange:b,contextmenu:y,showeditor:x,annoresized:E}),this.bind=function(e){var t=arguments;!e||e.constructor.prototype!==gn.el&&e.constructor.prototype!==gn.st||(e.drag(c,d,h),e.hover(f,g),"set"!==e.type?fn(e[0]).on(o.events):e.forEach(function(e){fn(e[0]).on(o.events)}),t=Array.prototype.slice.call(t,1)),0<t.length&&n.on.apply(n,t)},this.unbind=function(e){var t=arguments;!e||e.constructor.prototype!==gn.el&&e.constructor.prototype!==gn.st?null===e&&1<t.length&&(t=Array.prototype.slice.call(t,1)):(e.undrag(),e.unhover(f,g),"set"!==e.type?fn(e[0]).off(o.events):e.forEach(function(e){fn(e[0]).off(o.events)}),t=Array.prototype.slice.call(t,1)),n.off.apply(n,t)},this.trigger=s},N=function(e,t){var n=this,o=e,i=null,a=null,r=t;function l(){return r.trigger.apply(r,arguments),n}function s(e){return e.image()}function u(e){o.customurl?e.attr("src",o.customurl):l("serverrenderurlrequested",{data:o,complete:c})}function c(e){e.customurl=e}return n.dispose=function(){a=i=o=n=null},n.bind=function(){return r.on.apply(r,arguments),n},n.unbind=function(){return r.off.apply(r,arguments),n},n.trigger=l,n.construct=function(e){return i(e,o)},n.render=function(e){a(e,o)},i=o.constructor?o.constructor:s,a=o.renderer?o.renderer:u,n},q=function(e,t,n,o,i){var a=this,c=e,r=t,l=n,d=null,s=null,u=i,h=o,f=null,g=null,p=null,m=null,v={},b=function(){},y=function(){};function x(e){var t=J(e);if(d.paper){var n=Q(d.paper.canvas,d.paper._page);t.x-=n.left,t.y-=n.top}return t}function _(e){var t=r.getViewerTransform(h._pageindex).invert(),n=t.x(e.x,e.y);return e.y=t.y(e.x,e.y),e.x=n,e}function w(){l.trigger.apply(l,arguments)}function z(e,t,n){d=t,s=n,e.stopPropagation(),e.preventDefault();var o=_(x(e));c.visible=!0,g={x:o.x,y:o.y},c.x=Math.round(o.x),c.y=Math.round(o.y),c.width=1,c.height=1,y="path"===d.type&&"custom"!==c.type?"ellipse"!==c.type?(c.points=[{x:c.x,y:c.y}],"lines"!==c.type&&"polygon"!==c.type||c.points.push({x:c.x,y:c.y}),c.x=0,c.y=0,b=T,A):(b=D,F):(b=D,S),E(),(f={events:pn.Features.Touch?{touchend:C,touchmove:P,mouseup:C,mousemove:P}:{mouseup:C,mousemove:P},src:fn(e.srcElement||e.target),main:fn(e.currentTarget)}).src.on(f.events),f.main.on({mouseup:C})}function k(){f&&(f.src.off(f.events),f.main.off({mouseup:C}))}function P(e){e.stopPropagation(),b(e),E()}function T(e){var t=_(x(e));switch(c.type){case"line":c.points[1]=t;break;case"freehand":c.points.push(t);break;case"lines":case"polygon":c.points[c.points.length-1]=t}"path"===d.type&&("ellipse"===c.type?I():V(),d._&&0===d._.dirty&&(d._.dirty=1))}function D(e){var t=_(x(e)),n=g.x,o=g.y,i=Math.max(Math.abs(t.x-g.x),1),a=Math.max(Math.abs(t.y-g.y),1);0<c.aspectratio&&(Math.abs((t.y-g.y)/(t.x-g.x))>1/c.aspectratio?i=Math.round(a/c.aspectratio):a=Math.round(i/c.aspectratio)),t.x<g.x&&(n=g.x-i),t.y<g.y&&(o=g.y-a),c.x=n,c.y=o,c.width=i,c.height=a}function C(e){e.stopPropagation();var t=!1;if("lines"===c.type||"polygon"===c.type){if(r.activepage._index!==h._pageindex)return;if(c.points.push(_(x(e))),2!==e.button)return}else c.points?c.points&&c.points.length<2&&"custom"!==c.type&&(t=!0):(c.width<4&&c.height<4&&(c.width=100,c.height=100),E());k(),f=null,w(t?"cancelled":"drawn")}function E(){y(),d&&d.transform(M()),s&&s.repaint()}function M(){var e=gn.matrix(),t=r.getViewerTransform(h._pageindex),n=h.getTransform();return e.add(t.a,t.b,t.c,t.d,t.e,t.f),e.add(n.a,n.b,n.c,n.d,n.e,n.f),e.toTransformString()}function S(){d.attr({x:c.x,y:c.y,width:c.width,height:c.height}),u&&u.render(d,c),pn.Features.VML&&d.transform(M())}function F(){I(),d._&&0===d._.dirty&&(d._.dirty=1)}function A(){V(),d._&&0===d._.dirty&&(d._.dirty=1)}a.events={drawstart:z,drawmove:P,drawend:C,dragstart:function(e){if(!r.readonly){e.originalEvent.stopPropagation(),delete(v=fn.extend(!0,{},h.getClonedData())).update,delete v.getPageIndex;var t=h.getBox();g={x:t.x,y:t.y}}},dragmove:function(e){if(!r.readonly){e.originalEvent.stopPropagation();var t=_({x:0,y:0}),n=_({x:e.dx,y:e.dy});h.translate(n.x-t.x,n.y-t.y),w("moving")}},dragend:function(e){if(!r.readonly){e.originalEvent.stopPropagation();var t,n,o=h.getBox();if(d.paper&&d.paper._page){var i=d.getBBox(),a={x:0,y:0,width:d.paper._page.width(),height:d.paper._page.height()};if(!(H(t=a,(n=i).x,n.y)||H(t,n.x+n.width,n.y)||H(t,n.x,n.y+n.height)||H(t,n.x+n.width,n.y+n.height)))return void h.translate(g.x-o.x,g.y-o.y)}g.x===o.x&&g.y===o.y||(w("moved"),w({type:"annotationchanged",ann:h,annobefore:v}))}},update:function(){E()},viewchanged:function(e){d=e.annview,s=e.textview,y="path"===d.type&&"custom"!==c.type?"ellipse"!==c.type?(b=T,A):(b=D,F):(b=D,S)},pinchstart:function(e){if(!c.points&&!r.readonly){var t=_({x:e.touches[0].clientX,y:e.touches[0].clientY}),n=_({x:e.touches[1].clientX,y:e.touches[1].clientY}),o=h.getBox();m={start:Y(t.x,t.y,n.x,n.y),rect:o}}},pinchmove:function(e){if(m){var t=_({x:e.touches[0].clientX,y:e.touches[0].clientY}),n=_({x:e.touches[1].clientX,y:e.touches[1].clientY}),o=Y(t.x,t.y,n.x,n.y,m.start),i=o.x-m.start.x,a=o.y-m.start.y,r=m.rect.x-o.dx,l=m.rect.y-o.dy,s=m.rect.width+i,u=m.rect.height+a;c.points?h.transform(r,l,s,u):(c.x=r,c.y=l,c.width=s,c.height=u),d.paper&&d.paper._page&&d.paper._page._grips&&d.paper._page._grips.repaint(),E()}},pinchend:function(){w("resized"),w("annoresized"),m=null}},a.drawStart=z,a.unbindEvents=k,a.repaint=E,a.getTransform=M;var O=.5522847498307936;function I(){var e=c.width/2,t=c.height/2,n=O*e,o=O*t,i=c.x+c.width/2,a=c.y+c.height/2,r=["M",i,a-t,"C",i+n,a-t,i+e,a-o,i+e,a,"C",i+e,a+o,i+n,a+t,i,a+t,"C",i-n,a+t,i-e,a+o,i-e,a,"C",i-e,a-o,i-n,a-t,i,a-t,"Z"];d.attr({path:r})}function V(){if(c.points&&0!==c.points.length){for(var e=["M",c.points[0].x,c.points[0].y],t=1;t<c.points.length;t++)e=e.concat(["L",c.points[t].x,c.points[t].y]);"polygon"===c.type&&e.push("Z"),d.attr({path:e}),
|
|
572
|
+
*/function Tn(e){return isFinite(e)&&!(e%1)}function Ue(e){return!isNaN(e)&&isFinite(e)}var Dn={instanceCounter:0};function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cn=function(){function e(e){S(this,"viewer",void 0),S(this,"currentThumb",void 0),this.viewer=e,this.currentThumb=null}var t=e.prototype;return t.isViewerActive=function(){return!(!this.viewer||!this.currentThumb)},t.isThumbnailerActive=function(e){return e&&!!this.currentThumb&&this.currentThumb.get()===e.get()},t.activateThumbnailer=function(e,t,n,o,i){var a=this.isThumbnailerActive(e);a&&!i||(this.currentThumb&&!a&&this.currentThumb.detachViewer(),this.currentThumb=e,this.viewer&&this.viewer.isInitialized()&&(this.viewer.switchDocument(t,n,o),this.currentThumb.activateViewer()))},t.closeDocument=function(e,t){e=e||this.currentThumb;var n=this.isThumbnailerActive(e);n&&(e.detachViewer(),this.currentThumb=null),this.viewer&&this.viewer.isInitialized()&&t&&this.viewer.closeDocument(t,n)},e}();function F(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var En=function(){function e(e){A(this,"jqe",fn({})),A(this,"memoryEntries",[]),A(this,"config",{colorDepth:8,compression:1,highWaterMark:5e8,pageSize:{width:800,height:1132}}),A(this,"bytesInUse",0),e&&fn.extend(this.config,e)}var t,n,o,i=e.prototype;return i.dispose=function(){this.clearEntries()},i.bind=function(){return this.jqe.on.apply(this.jqe,arguments),this},i.unbind=function(){return this.jqe.off.apply(this.jqe,arguments),this},i.trigger=function(e){return this.jqe.trigger.apply(this.jqe,arguments),this},i.allocate=function(e){return this.memoryEntries.push(e),this.bytesInUse+=this.calcBytes(e),this.bytesInUse>this.config.highWaterMark&&this.trigger("exceededhighwatermark"),this.bytesInUse},i.deallocateOldestEntry=function(){var e=this.memoryEntries.shift();return void 0!==e&&this.deallocate(e),e},i.clearEntries=function(){this.memoryEntries.length=0,this.bytesInUse=0},i.deallocate=function(e){return this.bytesInUse-=this.calcBytes(e),this.bytesInUse<0&&(this.bytesInUse=0),this.bytesInUse},i.calcBytes=function(e){return(e.width()||this.config.pageSize.width)*(e.height()||this.config.pageSize.height)*this.config.colorDepth/8*this.config.compression},t=e,(n=[{key:"typeOf",get:function(){return"Atalasoft.Document.MemoryTacker"}},{key:"colorDepth",set:function(e){this.config.colorDepth=e},get:function(){return this.config.colorDepth}},{key:"highWatermark",set:function(e){this.config.highWaterMark=e},get:function(){return this.config.highWaterMark}},{key:"pageSize",set:function(e){this.config.pageSize={width:e.width,height:e.height}},get:function(){return this.config.pageSize}}])&&F(t.prototype,n),o&&F(t,o),e}(),Mn=[11,4,0,377],O=(n(61),n(88),n(62),n(115),n(63),n(66),function(o,e,t){var n=this,f=o,h=e,g=null,p=null,m=!1,v={" ":!0,"-":!0,"?":!0,"\n":!0,"\t":!0},i=t,a=null;function b(){var e,t;(t=document.body).currentStyle?e=t.currentStyle.direction:window.getComputedStyle&&(e=document.defaultView.getComputedStyle(t,null).getPropertyValue("direction")),"rtl"===e.toLowerCase()&&(m=!0),g=fn("<canvas "+(m?'dir="rtl"':"")+"/>"),p=fn('<span style="position:absolute; visibility:hidden; left: -5000px;">{[|,0123456789Thqkbfjplyg</span>'),fn(i).append(p)}function r(e){g&&p||b(),h.applyTo(p),g[0].width=e.width,g[0].height=e.height;var t=g[0].getContext("2d"),n=function(e,t,n){var o=[];if("string"==typeof t){if(f.text.autoscale)return t.split("\n");for(var i=t,a=n,r=function(e){for(var t=[],n="",o=0,i=0;i<e.length;i++){var a=e[i];v[n]&&(t.push(e.substr(o,i-o)),o=i),n=a}return o<e.length&&t.push(e.substr(o,e.length-o)),t}(i),l="",s="",u=[],c=0;c<r.length;c++)if(l=s,s=r[c],e.measureText(s).width>a)for(var d=s.split(""),h=0;h<d.length;h++)u.push(d[h]),e.measureText(u.join("")).width>a&&(u.pop(),o.push(u.join("")),u.length=0,u.push(d[h]));else u.push(s),(e.measureText(u.join("").trim()).width>a||0<=l.indexOf("\n"))&&(u.pop(),o.push(u.join("")),u.length=0,u.push(s));0<u.length&&(o.push(u.join("")),u.length=0)}return o}(t,f.text.value,e.width),o=function(e){if(f.text.autoscale){var t=Math.max(0,f.height-2*f.outline.width);return 0<e?Math.floor(t/e):t}return h.applyTo(p,1),p[0].offsetHeight}(n.length),i=f.text.autoscale?o:f.text.font.size,a=[f.text.font.italic?"italic":"normal",f.text.font.bold?"bold":"normal",i+"px",f.text.font.family];t.font=a.join(" "),t.fillStyle=f.text.font.color,t.textBaseline="top";var r,l=0,s=n.length?n[0]:"";for(r=0;r<n.length;r++)n[r].length>s.length&&(s=n[r]);var u=t.measureText(s).width,c=m?u:0;if(f.text.autoscale&&"left"!==f.text.align)switch(f.text.align){case"center":t.textAlign=f.text.align,c=u/2;break;case"right":t.textAlign=f.text.align,c=m?0:u;break;default:t.textAlign="start",c=m?u:0}if(f.text.autoscale){var d=e.width/u;t.scale(d,1)}if(!f.text.autoscale)switch(f.text.align){case"center":t.textAlign=f.text.align,c=e.width/2;break;case"right":t.textAlign=f.text.align,c=e.width}for(r=0;r<n.length;r++)t.fillText(n[r],c,l,u),l+=o;return g[0].toDataURL()}n.dispose=function(){h=f=n=null,g&&g.remove&&(g.remove(),g=null),p&&p.remove&&(p.remove(),p=null),i=null},n.renderToDataURL=r,n.renderToSVGImage=function(e,t){var n=a;n&&n.width===t.width&&n.height===t.height&&n.text===o.text.value&&n.align===o.text.align||(a={width:t.width,height:t.height,text:o.text.value,align:o.text.align},e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r(t)))}}),I=(n(117),function(e,t){var n=this,o=t,i={bold:!1,italic:!1,strike:!1,underline:!1,color:"#000000",family:"Arial",size:12},a=1,r=1,l=pn.Mobile.Any()?18:8;function s(e){e&&fn.extend(i,e),u()}function u(e,t,n){(e=e||o)&&(t=void 0!==t?t:a,n||(t=d()),c(e,t))}function c(e,t){var n="none";(i.strike||i.underline)&&(n=i.strike?"line-through ":"",n+=i.underline?"underline":"");var o=i.size*(t||1);e.css({color:i.color,"font-family":i.family,"font-style":i.italic?"italic":"normal","font-weight":i.bold?"bold":"normal","font-size":o+"pt","text-decoration":n})}function d(){return a=i.size*r<l?l/i.size:r}s(e),n.dispose=function(){i=o=n=null},n.set=s,n.get=function(e){return e?i[e]:i},n.repaint=u,n.applyTo=c,n.getAdjustedZoom=d,n.getZoom=function(){return r},n.setZoom=function(e){r=e,u()}}),B=function(_,w,e){var t=this,z=e,o=_.getEventObject(),k=null,a=null,P=null,r=null,T=_.get("text"),n=T.value,D=!1,C=3,E=pn.Mobile.Any()?{width:200,height:200}:{width:1,height:1},i={},l={moving:u,resized:u,moved:u,rotated:u},M=function(){var e=_.get();a||(a=fn('<textarea selectable="false"/>'),fn(r.innerDom).append(a),a.css({"background-color":"transparent",border:"0px solid","overflow-x":"hidden","overflow-y":"hidden","-moz-user-select":"none","-khtml-user-select":"none","-webkit-user-select":"none","user-select":"none",resize:"none",cursor:"inherit"}),a.attr("readonly","readonly"),a.on({focus:function(){return this.blur(),!1}}),a[0].raphaelParent=!0),a.val(T.value);var t=_.get("outline").width/2,n=Math.max(Math.ceil(e.width-2*(t+C)),1),o=Math.max(Math.ceil(e.height-2*(t+C)),1);if(P&&(P.set(T.font),P.repaint(a,1,!0)),a.css({width:n+"px",height:o+"px","max-width":n+"px","max-height":o+"px",padding:C+"px","text-align":T.align}),a.attr("title",e.tooltip),r.attr({x:Math.round(t+e.x),y:Math.round(t+e.y),width:e.width,height:e.height}),0<=e.cornerradius){var i=_.getObject();fn(i[0]).attr({rx:e.cornerradius||0,ry:e.cornerradius||0})}r.transform(S().toTransformString(!0))};function s(){var e=_.get("outline").width/2,t=_.get(),n=Math.max(Math.ceil(t.width-2*(e+C)),0),o=Math.max(Math.ceil(t.height-2*(e+C)),0);if(P&&P.set(T.font),r.attr({x:Math.round(e+C+t.x),y:Math.round(e+C+t.y),width:n,height:o,title:t.tooltip}),0<=t.cornerradius){var i=_.getObject();fn(i[0]).attr({rx:t.cornerradius||0,ry:t.cornerradius||0})}r.renderer&&r.renderer.renderToSVGImage(r[0],{width:n,height:o}),r.transform(S().toTransformString(!0))}function S(){var e=gn.matrix(),t=z.getViewerTransform(_._pageindex),n=_.getTransform();return e.add(t.a,t.b,t.c,t.d,t.e,t.f),e.add(n.a,n.b,n.c,n.d,n.e,n.f),e}function u(){r&&p()}function F(e,t,n){return{x:e.x(t,n),y:e.y(t,n)}}function c(){if(null==P&&(P=new I(T.font)),r){var e=!0!==r.removed?r:null;o.unbind(e,{showeditor:d,hideeditor:f})}var t=D,n=T.autoscale;(r=n?w.atalaImage():w.html()).isHtml&&!n||(r.renderer=new O(_.get(),P,w._page),M=s),null!=k&&w._page&&(w._page.append(k),w._page.on(i)),gn.vml&&(_.getObject().node.style.overflow="hidden"),r.transform(S().toTransformString(!0)),o.bind(r,{showeditor:d,hideeditor:f}),t&&d()}function d(){w._page[0].classList.contains(_n.atala_active_thumb)||(k||function(){k=fn("<textarea/>").hide(),w._page&&(w._page.append(k),w._page.on(i)),k.on("change keydown mouseup mousemove mousedown",h),k.bind({blur:f}),_.bind({deselected:f});var e=_.getObject();if(k.css({position:"absolute","overflow-x":"auto","overflow-y":"auto","z-index":99999,border:"0px solid",padding:"0px","background-color":"transparent","text-align":T.align}),pn.Mobile.Any()){var t=_.get(),n=Q(w.canvas,w._page);k.css({left:t.x+n.left+"px",top:t.y+n.top+"px",width:t.width+"px","max-width":t.width+"px",height:t.height+"px","max-height":t.height+"px",border:e.attr("stroke")+" "+e.attr("strokewidth")+"px","background-color":e.attr("fill")})}P.setZoom(_.getZoom()),(pn.Chrome||pn.Safari)&&k.css({resize:"none"}),null!=T.value&&k.val(T.value),T.readonly&&k.prop("readonly","readonly"),P.repaint(k,_.getZoom())}(),_&&!_.get("visible")||(!k.is(":hidden")&&D||(r.hide(),k.prop("readonly",T.readonly?"readonly":""),T.value!==k.val()&&k.val(T.value),k.show(),p()),pn.Touch&&k.focus(function(){k[0].setSelectionRange(0,9999)}),k[0].focus(),n=T.value,D=!0))}function h(e){e.stopPropagation(),T.value!==k.val()&&(T.value=k.val(),_.set({text:T}))}function f(){if(k&&((k.is(":visible")||D)&&(k.hide(),r.show(),p()),0===arguments.length||1===arguments.length&&"blur"===arguments[0].type)){o.trigger("annotationtextchanged");var e=_.getClonedData(),t=fn.extend(!0,{},e);delete t.update,delete t.getPageIndex,t.text.value=n,o.trigger({type:"annotationchanged",ann:_,annobefore:t}),k[0].blur(),D=!1}}function g(){!_||_.get("visible")?D?d():r.show():r.hide(),r.backgroundColor&&r.backgroundColor(_.get("fill").color)}function A(e){e&&(w!==e||r.removed)&&(w=e,null!=a&&(a.remove(),a=null),c(),g())}function p(e){if(A(e),M(),k&&(!k.is(":hidden")||D)){var t=_.get("outline").width/2,n=_.get(),o=_.getZoom(),i=_.getBox(),a=S(),r=F(a,i.x,i.y),l=F(a,i.x+i.width,i.y+i.height),s=i.width*o,u=i.height*o,c=(r.x+l.x-s)/2,d=(r.y+l.y-u)/2,h=C*o,f=t*o,g=2*(h+f),p=Math.max(Math.ceil(s-g),E.width),m=Math.max(Math.ceil(u-g),E.height),v=Q(w.canvas,w._page),b=n.rotation+z.getPageRotation(_._pageindex),y=0!==b?"rotate("+b+"deg)":"",x={left:Math.round(c+v.left+f)+"px",top:Math.round(d+v.top+f)+"px",width:p+"px",height:m+"px","max-width":p+"px","max-height":m+"px",padding:Math.ceil(h)+"px"};fn.extend(x,Pn(y)),k.css(x)}P&&(P.set(T.font),P.setZoom(_.getZoom()),P.repaint(k,_.getZoom()))}c(),p(),_.bind(l),t.dispose=function(){k&&k.remove(),a&&a.remove(),P&&P.dispose(),r&&r.remove(),w&&w._page&&w._page.off(i),_.unbind(l),T=r=a=P=k=o=t=null},t.set=function(e){e&&fn.extend(T,e)},t.get=function(e){return e?T[e]:T},t.getFont=function(){return P},t.inEditMode=function(){return D},t.updateView=g,t.changepaper=A,t.repaint=p},V=function(){var e=this,t=fn({}),o={drawing:!1,hold:null,pinching:!1,tapped:!1,touching:!1,delta:{x:0,y:0},origin:{x:0,y:0},point:{x:0,y:0},moves:0,e:null};function i(){t.trigger.apply(t,arguments)}function a(){i({type:"interactstart"})}function r(){i({type:"interactend"})}function l(e){if(o.e=e,a(),i(e),2===e.originalEvent.touches.length&&function(e){for(var t=null,n=0;n<e.length;n++){var o=e[n].target;if(!o||!o.raphael&&!o.raphaelParent)return!1;if(null===t)t=o;else if(t!==o)return!1}return!0}(e.originalEvent.touches))c(),o.touching=!1,(n=e).stopPropagation(),n.preventDefault(),o.pinching=!0,i({type:"pinchstart",touches:n.originalEvent.touches});else if(1===e.originalEvent.touches.length){i("selectchange"),o.touching=!0;var t=J(e);o.point.x=t.x,o.point.y=t.y,o.hold=setTimeout(u,1500)}var n}function s(){o.tapped=!1}function u(){if(0<o.moves&&null!==o.e){var e=J(o.e);Math.abs(o.point.x-e.x)<5&&Math.abs(o.point.y-e.y)<5&&(o.moves=0)}0===o.moves&&o.touching&&o.e&&(o.touching=!1,i({type:"contextmenu",x:o.e.originalEvent.touches[0].pageX,y:o.e.originalEvent.touches[0].pageY}))}function c(){null!==o.hold&&(clearTimeout(o.hold),o.hold=null)}e.events={click:function(e){i(e)},dblclick:function(e){i(e);var t=J(e);i({type:"showeditor",x:t.x,y:t.y})},mousedown:function(e){return a(),i(e),i({type:"selectchange",shiftKey:e.shiftKey,ctrlKey:e.ctrlKey}),3===e.which&&i({type:"contextmenu",x:e.pageX,y:e.pageY,event:e}),!1},mousemove:function(e){i(e)},mouseout:function(e){i(e)},mouseover:function(e){i(e)},mouseup:function(e){i(e),r()}},pn.Features.Touch&&fn.extend(!0,e.events,{touchstart:l,touchmove:function(e){var t;i(o.e=e),o.pinching?((t=e).stopPropagation(),t.preventDefault(),i({type:"pinchmove",touches:t.originalEvent.touches})):o.moves++},touchend:function(e){var t,n;i(o.e=e),o.pinching?((n=e).stopPropagation(),n.preventDefault(),o.pinching=!1,i({type:"pinchend",touches:n.originalEvent.touches}),1===n.originalEvent.touches.length&&l(n)):o.touching&&(o.touching=!1,c(),o.moves=0,o.tapped?(t=e,o.e=t,i({type:"showeditor",x:o.point.x,y:o.point.y})):(o.tapped=!0,setTimeout(s,300))),r()}}),e.bind=function(){return t.on.apply(t,arguments),e},e.unbind=function(){return t.off.apply(t,arguments),e},e.trigger=i},R=function(e){var n=fn({}),t=e,o=null,a={target:null,mx:null,my:null,px:null,py:null,dx:null,dy:null};function r(e){a.px=a.mx,a.py=a.my,e.originalEvent?(a.mx=e.originalEvent.targetTouches[0].pageX,a.my=e.originalEvent.targetTouches[0].pageY):(a.mx=e.targetTouches[0].pageX,a.my=e.targetTouches[0].pageY),a.dx=a.mx-a.px,a.dy=a.my-a.py}function l(e){a.px=a.mx,a.py=a.my,a.mx=e.screenX,a.my=e.screenY,a.dx=a.mx-a.px,a.dy=a.my-a.py}function s(){n.trigger.apply(n,arguments)}function i(){s({type:"interactstart",target:t})}function u(){s({type:"interactend",target:t})}function c(e,t,n,o,i){(e||t)&&(pn.Features.Touch&&i.target!==a.target||(null===a.px&&d(0,0,i),i.touches?r(i):l(i),s({type:"dragmove",dx:a.dx,dy:a.dy,mx:a.mx,my:a.my,originalEvent:i})))}function d(e,t,n){a.target=n.target,i(),n.touches?r(n):l(n),s({type:"dragstart",mx:a.mx,my:a.my,originalEvent:n})}function h(e){pn.Features.Touch&&e.target!==a.target||(a.target=null,a.px=null,a.py=null,a.mx=null,a.my=null,s({type:"dragend",originalEvent:e}))}function f(){s("hoverin")}function g(){s("hoverout")}function p(e){s(e)}function m(e){s(e)}function v(e){a.px=null,a.py=null,s(e)}function b(e){s(e)}function y(e){s(e)}function x(e){s(e)}function _(e){s(e)}function w(e){s(e)}function z(e){s(e),1===e.which?s("mousedownleft"):3===e.which&&s("mousedownright")}function k(e){s(e)}function P(e){s(e)}function T(e){s(e)}function D(e){s(e),3===e.which&&s("rightclick")}function C(e){s(e)}function E(e){s(e)}function M(e){s(e)}(o=new V).bind({click:_,dblclick:w,mousedown:z,mousemove:k,mouseover:T,mouseout:P,mouseup:D,touchmove:C,touchstart:M,interactstart:i,interactend:u,pinchstart:p,pinchmove:m,pinchend:v,selectchange:b,contextmenu:y,showeditor:x,annoresized:E}),this.bind=function(e){var t=arguments;!e||e.constructor.prototype!==gn.el&&e.constructor.prototype!==gn.st||(e.drag(c,d,h),e.hover(f,g),"set"!==e.type?fn(e[0]).on(o.events):e.forEach(function(e){fn(e[0]).on(o.events)}),t=Array.prototype.slice.call(t,1)),0<t.length&&n.on.apply(n,t)},this.unbind=function(e){var t=arguments;!e||e.constructor.prototype!==gn.el&&e.constructor.prototype!==gn.st?null===e&&1<t.length&&(t=Array.prototype.slice.call(t,1)):(e.undrag(),e.unhover(f,g),"set"!==e.type?fn(e[0]).off(o.events):e.forEach(function(e){fn(e[0]).off(o.events)}),t=Array.prototype.slice.call(t,1)),n.off.apply(n,t)},this.trigger=s},N=function(e,t){var n=this,o=e,i=null,a=null,r=t;function l(){return r.trigger.apply(r,arguments),n}function s(e){return e.image()}function u(e){o.customurl?e.attr("src",o.customurl):l("serverrenderurlrequested",{data:o,complete:c})}function c(e){e.customurl=e}return n.dispose=function(){a=i=o=n=null},n.bind=function(){return r.on.apply(r,arguments),n},n.unbind=function(){return r.off.apply(r,arguments),n},n.trigger=l,n.construct=function(e){return i(e,o)},n.render=function(e){a(e,o)},i=o.constructor?o.constructor:s,a=o.renderer?o.renderer:u,n},q=function(e,t,n,o,i){var a=this,c=e,r=t,l=n,d=null,s=null,u=i,h=o,f=null,g=null,p=null,m=null,v={},b=function(){},y=function(){};function x(e){var t=J(e);if(d.paper){var n=Q(d.paper.canvas,d.paper._page);t.x-=n.left,t.y-=n.top}return t}function _(e){var t=r.getViewerTransform(h._pageindex).invert(),n=t.x(e.x,e.y);return e.y=t.y(e.x,e.y),e.x=n,e}function w(){l.trigger.apply(l,arguments)}function z(e,t,n){d=t,s=n,e.stopPropagation(),e.preventDefault();var o=_(x(e));c.visible=!0,g={x:o.x,y:o.y},c.x=Math.round(o.x),c.y=Math.round(o.y),c.width=1,c.height=1,y="path"===d.type&&"custom"!==c.type?"ellipse"!==c.type?(c.points=[{x:c.x,y:c.y}],"lines"!==c.type&&"polygon"!==c.type||c.points.push({x:c.x,y:c.y}),c.x=0,c.y=0,b=T,A):(b=D,F):(b=D,S),E(),(f={events:pn.Features.Touch?{touchend:C,touchmove:P,mouseup:C,mousemove:P}:{mouseup:C,mousemove:P},src:fn(e.srcElement||e.target),main:fn(e.currentTarget)}).src.on(f.events),f.main.on({mouseup:C})}function k(){f&&(f.src.off(f.events),f.main.off({mouseup:C}))}function P(e){e.stopPropagation(),b(e),E()}function T(e){var t=_(x(e));switch(c.type){case"line":c.points[1]=t;break;case"freehand":c.points.push(t);break;case"lines":case"polygon":c.points[c.points.length-1]=t}"path"===d.type&&("ellipse"===c.type?I():V(),d._&&0===d._.dirty&&(d._.dirty=1))}function D(e){var t=_(x(e)),n=g.x,o=g.y,i=Math.max(Math.abs(t.x-g.x),1),a=Math.max(Math.abs(t.y-g.y),1);0<c.aspectratio&&(Math.abs((t.y-g.y)/(t.x-g.x))>1/c.aspectratio?i=Math.round(a/c.aspectratio):a=Math.round(i/c.aspectratio)),t.x<g.x&&(n=g.x-i),t.y<g.y&&(o=g.y-a),c.x=n,c.y=o,c.width=i,c.height=a}function C(e){e.stopPropagation();var t=!1;if("lines"===c.type||"polygon"===c.type){if(r.activepage._index!==h._pageindex)return;if(c.points.push(_(x(e))),2!==e.button)return}else c.points?c.points&&c.points.length<2&&"custom"!==c.type&&(t=!0):(c.width<4&&c.height<4&&(c.width=100,c.height=100),E());k(),f=null,w(t?"cancelled":"drawn")}function E(){y(),d&&d.transform(M()),s&&s.repaint()}function M(){var e=gn.matrix(),t=r.getViewerTransform(h._pageindex),n=h.getTransform();return e.add(t.a,t.b,t.c,t.d,t.e,t.f),e.add(n.a,n.b,n.c,n.d,n.e,n.f),e.toTransformString()}function S(){d.attr({x:c.x,y:c.y,width:c.width,height:c.height}),u&&u.render(d,c),pn.Features.VML&&d.transform(M())}function F(){I(),d._&&0===d._.dirty&&(d._.dirty=1)}function A(){V(),d._&&0===d._.dirty&&(d._.dirty=1)}a.events={drawstart:z,drawmove:P,drawend:C,dragstart:function(e){if(!r.readonly){e.originalEvent.stopPropagation(),delete(v=fn.extend(!0,{},h.getClonedData())).update,delete v.getPageIndex;var t=h.getBox();g={x:t.x,y:t.y}}},dragmove:function(e){if(!r.readonly){e.originalEvent.stopPropagation();var t=_({x:0,y:0}),n=_({x:e.dx,y:e.dy});h.translate(n.x-t.x,n.y-t.y),w("moving")}},dragend:function(e){if(!r.readonly){e.originalEvent.stopPropagation();var t,n,o=h.getBox();if(d.paper&&d.paper._page){var i=d.getBBox(),a={x:0,y:0,width:d.paper._page.width(),height:d.paper._page.height()};if(!(H(t=a,(n=i).x,n.y)||H(t,n.x+n.width,n.y)||H(t,n.x,n.y+n.height)||H(t,n.x+n.width,n.y+n.height)))return void h.translate(g.x-o.x,g.y-o.y)}g.x===o.x&&g.y===o.y||(w("moved"),w({type:"annotationchanged",ann:h,annobefore:v}))}},update:function(){E()},viewchanged:function(e){d=e.annview,s=e.textview,y="path"===d.type&&"custom"!==c.type?"ellipse"!==c.type?(b=T,A):(b=D,F):(b=D,S)},pinchstart:function(e){if(!c.points&&!r.readonly){var t=_({x:e.touches[0].clientX,y:e.touches[0].clientY}),n=_({x:e.touches[1].clientX,y:e.touches[1].clientY}),o=h.getBox();m={start:Y(t.x,t.y,n.x,n.y),rect:o}}},pinchmove:function(e){if(m){var t=_({x:e.touches[0].clientX,y:e.touches[0].clientY}),n=_({x:e.touches[1].clientX,y:e.touches[1].clientY}),o=Y(t.x,t.y,n.x,n.y,m.start),i=o.x-m.start.x,a=o.y-m.start.y,r=m.rect.x-o.dx,l=m.rect.y-o.dy,s=m.rect.width+i,u=m.rect.height+a;c.points?h.transform(r,l,s,u):(c.x=r,c.y=l,c.width=s,c.height=u),d.paper&&d.paper._page&&d.paper._page._grips&&d.paper._page._grips.repaint(),E()}},pinchend:function(){w("resized"),w("annoresized"),m=null}},a.drawStart=z,a.unbindEvents=k,a.repaint=E,a.getTransform=M;var O=.5522847498307936;function I(){var e=c.width/2,t=c.height/2,n=O*e,o=O*t,i=c.x+c.width/2,a=c.y+c.height/2,r=["M",i,a-t,"C",i+n,a-t,i+e,a-o,i+e,a,"C",i+e,a+o,i+n,a+t,i,a+t,"C",i-n,a+t,i-e,a+o,i-e,a,"C",i-e,a-o,i-n,a-t,i,a-t,"Z"];d.attr({path:r})}function V(){if(c.points&&0!==c.points.length){for(var e=["M",c.points[0].x,c.points[0].y],t=1;t<c.points.length;t++)e=e.concat(["L",c.points[t].x,c.points[t].y]);"polygon"===c.type&&e.push("Z"),d.attr({path:e}),
|
|
573
573
|
/**
|
|
574
574
|
* Work around outlined by this post:
|
|
575
575
|
* http://stackoverflow.com/questions/15693178/svg-line-markers-not-updating-when-line-moves-in-ie10
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-document-viewer",
|
|
3
|
-
"version": "11.4.
|
|
3
|
+
"version": "11.4.9",
|
|
4
4
|
"description": "Atalasoft JavaScript library for presenting images and documents, including PDF Forms, on a web page.",
|
|
5
5
|
"main": "atalaWebDocumentViewer.js",
|
|
6
6
|
"types:":"atalaWebDocumentViewer.d.ts",
|