/*! Inzi-sFormViewer1.0 - v2.0.0 - 2023-04-18
* Copyright (c) 2023 Mobileleader; Licensed INZISOFT */
!function(o){"use strict";for(var c,p,d,a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!o.requestAnimationFrame;++e)o.requestAnimationFrame=o[t[e]+"RequestAnimationFrame"],o.cancelAnimationFrame=o[t[e]+"CancelAnimationFrame"]||o[t[e]+"CancelRequestAnimationFrame"];o.requestAnimationFrame||(o.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-a)),n=o.setTimeout(function(){t(e+i)},i);return a=e+i,n}),o.cancelAnimationFrame||(o.cancelAnimationFrame=function(t){clearTimeout(t)}),o.Array.prototype.indexOf||(o.Array.prototype.indexOf=function(t,e){for(var i=e||0;i<this.length;i++)if(this[i]===t)return i}),o.Array.prototype.isArray||(o.Array.isArray=function(t){return"[object Array]"===o.Object.prototype.toString.call(t)}),o.Array.prototype.contains||(o.Array.prototype.contains=function(t){for(var e=0;e<this.length;e++)if(this[e]===t)return!0;return!1}),o.String.prototype.trim||(o.String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),o.SVGElement.prototype.getTransformToElement||(o.SVGElement.prototype.getTransformToElement=o.SVGElement.prototype.getTransformToElement||function(t){return t.getScreenCTM().inverse().multiply(this.getScreenCTM())}),o.console||(o.console={log:function(){}}),CanvasRenderingContext2D.prototype.setLineDash||(c=CanvasRenderingContext2D.prototype.moveTo,p=CanvasRenderingContext2D.prototype.lineTo,d={x:0,y:0},CanvasRenderingContext2D.prototype.setLineDash=function(t){0!==t[0]&&void 0!==t[0]||(t[0]=.1),void 0===t[1]&&(t[1]=0),this._lineDash=t},CanvasRenderingContext2D.prototype.moveTo=function(t,e){c.call(this,t,e),d.x=t,d.y=e},CanvasRenderingContext2D.prototype.lineTo=function(t,e){if("_lineDash"in this&&this._lineDash){c.call(this,d.x,d.y),this.save();for(var i=d.x,n=d.y,o=t-i,a=e-n,r=Math.sqrt(o*o+a*a),a=Math.atan2(a,o),s=(this.translate(i,n),c.call(this,0,0),this.rotate(a),this._lineDash.length),l=0,h=!0,i=0;i<r;)r<(i+=this._lineDash[l++%s])&&(i=r),(h?p:c).call(this,i,0),h=!h;this.restore(),this.moveTo(t,e)}else p.call(this,t,e),d.x=t,d.y=e}),Date.now||(Date.now=function(){return(new Date).getTime()}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var i=this.toString(),i=(("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>i.length)&&(e=i.length),e-=t.length,i.indexOf(t,e));return-1!==i&&i===e})}(window,document);var InziSForm=InziSForm||{};!function(e,i,o){"use strict";var n={payer:"결제자",toolbarControl:{},annotationConfig:{arc:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},chord:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},pie:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},arrowline:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},checkmark:{editable:!0,contextmenu:!0,fixed:!0,type:"text",securityLevel:255},ellipse:{editable:!0,contextmenu:!0,fixed:!0,fillOpacity:1,securityLevel:255},circle:{editable:!0,contextmenu:!0,fixed:!0,fillOpacity:1,securityLevel:255},highlighter:{editable:!0,contextmenu:!0,fixed:!0,stroke:!(o.ns=function(t){var e,i=t.split("."),n=o;for(i[0]===this.moduleName&&(i=i.slice(1)),e=0;e<i.length;e+=1)void 0===n[i[e]]&&(n[i[e]]={}),n=n[i[e]];return n}),strokeWidth:0,type:"rect",fillOpacity:.4,securityLevel:255},highlighterpen:{editable:!0,contextmenu:!0,fixed:!0,stroke:!1,strokeWidth:0,fillOpacity:.4,securityLevel:255},image:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},line:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},memo:{editable:!0,contextmenu:!0,fillOpacity:1,fixed:!0,width:200,height:30,securityLevel:255},text:{editable:!0,contextmenu:!0,fixed:!0,stroke:!0,strokeWidth:1,fixedOpacity:!1,fillOpacity:1,width:200,height:50,securityLevel:255},memopad:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},polycurve:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},polygon:{editable:!0,contextmenu:!0,fixed:!0,fillOpacity:0,securityLevel:255},protractor:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},polyline:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},pen:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},rect:{editable:!0,contextmenu:!0,fixed:!0,fixedOpacity:!1,fillOpacity:1,securityLevel:255},stamp:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},imagearea:{editable:!0,contextmenu:!0,fixed:!0,securityLevel:255},hiddenarea:{editable:!1,contextmenu:!1,fixed:!0,securityLevel:10},mask:{editable:!0,contextmenu:!0,fixed:!0,fixedOpacity:!0,fillOpacity:1,securityLevel:10},edittext:{editable:!0,contextmenu:!0,fixed:!0,fillOpacity:1,securityLevel:255},stickynote:{editable:!0,contextmenu:!0,fixed:!1,fillOpacity:1,width:300,height:50,securityLevel:255},eternityrect:{editable:!0,contextmenu:!0,fixed:!0,pattern:{enabled:!0},stroke:!0,strokeWidth:2,securityLevel:10},grid:{editable:!0,contextmenu:!0,fixed:!0,pattern:{width:10,height:10,stroke:"#333",strokeWidth:1,strokeDasharray:"1"},securityLevel:255},blackmarking:{editable:!0,contextmenu:!0,fixed:!0,fixedOpacity:!0,fillOpacity:1,securityLevel:10}},notifications:{enabled:!0,fade:!1,timeout:500},serviceManagerConfig:{mask:{overwrite:!0,maskingType:0},annotationPermanence:{overwrite:!0,annotationContentTypeList:["MASK","ETERNITYRECT"]},fileEdit:{overwrite:!0},merge:{overwrite:null}}},a=(o.moduleName="InziSForm",o.moduleFullName="Inzi-WebFormViewer 3.0",o.moduleIdPrefix="sform-viewer",o.moduleClassName="sform",o.moduleLoadClassName="sform-viewer-loaded",o.modulePrintWindow="iframe",o.modulePrintProtocol="BatchPrintTrigger",o.moduleAnnotationGraphicType="snap",o.moduleImageGraphicType="canvas",o.modulePrintURL={customURI:"BatchPrintTrigger://",http:"http://localhost:43421",https:"https://localhost:34527",ws:"ws://localhost:41221/batchprint",wss:"wss://localhost:41223/batchprint"},o.modulePrintPort={customURI:0,http:0,https:0,ws:41221,wss:41223},o.setting=function(t){if(1===arguments.length&&"string"==typeof t)return n[t];2===arguments.length?n[t]=arguments[1]:InziSForm.Utils.extend(n,t)},o.create=function(t){t(this,e,i)},o.inherit=function(t,e){function i(){}return t=t,i.prototype=(e=e).prototype,t.prototype=new i,t.super=e.prototype,void(t.prototype.constructor=t)},o.viewerLoad=function(t){var e=t.container;if(null!==e){e=o.Element.select(i.body,e);if(null!==e)if(!InziSForm.Element.hasClass(e,o.moduleLoadClassName))return o.Element.addClass(e,o.moduleLoadClassName),new o.Controller(t)}},o.loadViewer=function(t){return this.viewerLoad(t)},o.loadDocViewer=function(t){var e=t.container;if(null!==e){e=o.Element.select(i.body,e);if(null!==e)if(!o.Element.hasClass(e,o.moduleLoadClassName))return o.Element.addClass(e,o.moduleLoadClassName),new o.DocController(t)}},o.batchPrint=function(t,e){o.Utils.globalLocation();new o.BatchPrintManager(t).print();t=[];t.push("<div style='color:#02a5de; line-height: 25px;'>인쇄 모듈 설치 및 프로그램 실행 허용 후 서비스 이용이 가능합니다.</div>"),e&&t.push("<div style='line-height: 20px; margin-top: 5px; font-size:12px;'><a href='"+e+"'><span>인쇄 모듈 다운로드 </span></a></div>"),o.UI.message(t.join(""),null,null,5e3)},o.ns(o.moduleName+".core"),o.ns(o.moduleName+".annotation"),{});o.listeners=function(t,e){if(1===arguments.length)return a[t];a[t]=e},o.generateListenerId=function(){return"listener"+(new Date).getTime()}}(window,document,InziSForm),InziSForm.create(function(t,e,i){"use strict";t.moduleName;var n=t.moduleClassName;t.moduleIdPrefix;return t.Type={DataType:{STRING:{},NUMBER:{},BOOLEAN:{TRUE:!0,FALSE:!1},OBJECT:{},FUNCTION:{}},GraphicUnitType:{INCH:0,CM:1,MM:2,PX:3,PT:4,DXA:5,EMU:6},GraphicUnitReferenceValue:{INCH:1,CM:2.54,MM:25.4,PX:96,PT:72,DXA:1440,EMU:914400},ModuleStatus:{READY:0,PENDING:1,INITIALIZE:2,INITIALIZE_COMPLETE:3},LayerType:{THUMBNAIL:"thumbnail",VIEWER:"viewer",DOC_THUMBNAIL:"doc-thumbnail",DOC_VIEWER:"doc-viewer",TOOLBAR:"toolbar",ICON:"icon",POPUP:"popup"},ToolbarLayoutType:{INLINE:"inline",SIMPLE:"simple",FULL:"full",HIDDEN:"hidden"},GraphicsType:{CANVAS:0,SVG:1,SNAP:2},FilterType:{BRIGHTNESS:"brightness",GRAYSCALE:"grayscale",INVERT:"invert",CONSTRAST:"constrast",GRID:"grid",NONE:"none"},ViewerType:{IMAGE_THUMBNAIL:"IMAGE_THUMBNAIL",IMAGE:"IMAGE",THUMBNAIL:"THUMBNAIL"},PaginateUnit:{ALL:"all",FILE:"file",DOCUMENT:"document",NONE:"none"},VIEWER_COMPAT_TYPE:{IFORM:"iform",VISUAL:"visual",NONE:""},GraphicType:{SVG:"svg",CANVAS:"canvas",SNAP:"snap"},ControlType:{name:function(){return"controlType"},NONE:"none",ZOOM:"zoom",AUTOZOOMIN:"autozoomin",AUTOZOOMOUT:"autozoomout",ROTATE:"rotate",MAGNIFICATION:"magnification",ANNOTATION:"annotation",SELECT:"select",FILTER:"filter",CROP:"crop",CLIP:"clip",COMPARE:"compare"},DragType:{name:function(){return"dragType"},NONE:"none",ZOOM:"zoom",MOVE:"move",MAGNIFICATION:"magnification",SELECTIONAREA:"selectionarea"},AnnotationViewMode:{ALL:"all",LEVEL1:1,LEVEL2:2,LEVEL3:3,LEVEL4:4},ThumbnailLabelType:{NONE:"none",DEFAULT:"default",PAGE:"page",ALL:"all"},AnnotationType:{name:function(){return"annotationType"},RECT:"rect",CIRCLE:"circle",LINE:"line",ARROWLINE:"arrowline",POLYLINE:"polyline",POLYGON:"polygon",PEN:"pen",HIGHLIGHTER:"highlighter",HIGHLIGHTERRECT:"highlighterRect",HIGHLIGHTERPEN:"highlighterPen",MEMO:"memo",MEMOPAD:"memopad",STAMP:"stamp",CHECKMARK:"checkmark",ELLIPSE:"ellipse",POLYCURVE:"polycurve",TEXT:"text",EDITTEXT:"edittext",PROTRACTOR:"protractor",ARC:"arc",IMAGE:"image",IMAGEAREAd:"imagearea",HIDDENAREA:"hiddenarea",MASK:"mask",STICKYNOTE:"stickynote",ETERNITYRECT:"EternityRect",GRID:"grid",CHORD:"chord",PIE:"pie",BLACKMARKING:"blackmarking"},ZoomType:{DEFAULT:"default",IN:"in",OUT:"out",FITSCREEN:"fitscreen",FITHEIGHT:"fitheight",FITWIDTH:"fitwidth",FITMAX:"fitmax",FITAUTO:"fitauto"},AnnotationSetPropType:{INDEX_FIRST:"index_first",INDEX_LAST:"index_last",INDEX_FRONT:"index_front",INDEX_BACK:"index_back"},AnnotationAttribute:{TEXT_ALIGN:{0:"start",1:"middle",2:"end"},TEXT_ALIGN_BASELINE:{0:"hanging",1:"middle",2:"baseline"}},RenderType:{CLIP:"clip",SCROLL:"scroll"},RenderNodeType:{CANVAS:"canvas",IMAGE:"image"},RenderQuality:{DRAFT:"draft",LOW:"low",MEDIUM:"medium",HIGH:"high",BEST:"best",CUSTOM:"custom"},ToolbarItemType:{ZOOM:"zoom",ANNOTATION:"annotation",PAGENATION:"pagenation"},MarkerType:{getByIndex:function(t,e){var i={LEFT:["NONE","ARROW_LEFT","OPENARROW_LEFT","SHARPARROW_LEFT","DIAMOND","CIRCLE"],RIGHT:["NONE","ARROW_RIGHT","OPENARROW_RIGHT","SHARPARROW_RIGHT","DIAMOND","CIRCLE"]};if(i[t])return i[t][e]},DIRECTION_LEFT:"LEFT",DIRECTION_RIGHT:"RIGHT",NONE:"NONE",ARROW_LEFT:"ARROW_LEFT",OPENARROW_LEFT:"OPENARROW_LEFT",SHARPARROW_LEFT:"SHARPARROW_LEFT",DIAMOND:"DIAMOND",CIRCLE:"CIRCLE",ARROW_RIGHT:"ARROW_RIGHT",OPENARROW_RIGHT:"OPENARROW_RIGHT",SHARPARROW_RIGHT:"SHARPARROW_RIGHT"},Marker:{NONE:{type:"NONE",shapeIndex:0},ARROW_RIGHT:{type:"ARROW_RIGHT",markerType:"path",attr:{d:"M 0 0 L 10 5 L 0 10 z",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:8,refY:5,markerUnits:"strokeWidth",shapeIndex:2},OPENARROW_RIGHT:{type:"OPENARROW_RIGHT",markerType:"path",attr:{d:"M 0 0 L 10 5 L 0 10",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:9,refY:5,markerUnits:"strokeWidth",shapeIndex:3},SHARPARROW_RIGHT:{type:"SHARPARROW_RIGHT",markerType:"path",attr:{d:"M 0 0 L 10 5 L 0 10 L 5 5z",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:5,refY:5,markerUnits:"strokeWidth",shapeIndex:1},DIAMOND:{type:"DIAMOND",markerType:"path",attr:{d:"M 0,5 L 5,4.6e-007 L 10,5 L 5,10 L 0,5 z",stroke:"none"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:5,refY:5,markerUnits:"strokeWidth",shapeIndex:4},CIRCLE:{type:"CIRCLE",markerType:"path",attr:{d:"M1,5a4,4 0 1,0 8,0a4,4 0 1,0 -8,0",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:5,refY:5,markerUnits:"strokeWidth",shapeIndex:5},BOX:{type:"BOX",markerType:"path",attr:{d:"M0,0 10,0 10,10, 0,10 0,0z",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:5,refY:5,markerUnits:"strokeWidth",shapeIndex:6},ARROW_LEFT:{type:"ARROW_LEFT",markerType:"path",attr:{d:"M 10 0 L 0 5 L 10 10 z",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:5,refY:5,markerUnits:"strokeWidth",shapeIndex:2},OPENARROW_LEFT:{type:"OPENARROW_LEFT",markerType:"path",attr:{d:"M 10 0 L 0 5 L 10 10",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:2,refY:5,markerUnits:"strokeWidth",shapeIndex:3},SHARPARROW_LEFT:{type:"SHARPARROW_LEFT",markerType:"path",attr:{d:"M10,0 L0,5 L10,10 L5,5 z",fill:"none","stroke-width":2,"stroke-linecap":"butt"},viewBox:"0 0 10 10",orient:"auto",markerWidth:4,markerHeight:3,refX:5,refY:5,markerUnits:"strokeWidth",shapeIndex:1}},MARKER_SHAPE:{START:{0:"NONE",1:"ARROW_LEFT",2:"SHARPARROW_LEFT",3:"OPENARROW_LEFT",4:"DIAMOND",5:"CIRCLE",6:"BOX"},END:{0:"NONE",1:"ARROW_RIGHT",2:"SHARPARROW_RIGHT",3:"OPENARROW_RIGHT",4:"DIAMOND",5:"CIRCLE",6:"BOX"}},MEDIA_TYPE:{APPLICATION_ATOM_XML:"application/atom+xml",APPLICATION_FORM_URLENCODED:"application/x-www-form-urlencoded",APPLICATION_JSON:"application/json",APPLICATION_JSON_UTF8:"application/json;charset=UTF-8",APPLICATION_OCTET_STREAM:"application/octet-stream",APPLICATION_XHTML_XML:"application/xhtml+xml",APPLICATION_XML:"application/xml",IMAGE_GIF:"image/gif",IMAGE_JPEG:"image/jpeg",IMAGE_PNG:"image/png",MULTIPART_FORM_DATA:"multipart/form-data",TEXT_HTML:"text/html",TEXT_PLAIN:"text/plain",TEXT_XML:"text/xml"},VIEWER_CONTROL:{ZOOM:{type:"ZOOM",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"IN",title:"확대",nodeType:"icon",triggerName:"trigger.change.zoom",className:"icon-zoom-in",disabled:!1,inlineDisabled:!1},{type:"OUT",title:"축소",nodeType:"icon",triggerName:"trigger.change.zoom",className:"icon-zoom-out",disabled:!1,inlineDisabled:!1}]},ZOOM_SELECT:{type:"ZOOM",classDefaultName:n+"-ui-icon",disabled:!1,inlineDisabled:!1,controlItem:[{type:"ZOOM",title:"비율 선택",nodeType:"select",name:"zoomRatio",triggerName:"trigger.change.zoom",className:"sform--ui-select",disabled:!1,enabledOption:!0,value:null,options:[{text:"선택",value:""},{text:"25%",value:.25},{text:"50%",value:.5},{text:"75%",value:.75},{text:"100%",value:1},{text:"125%",value:1.25},{text:"150%",value:1.5},{text:"200%",value:2},{text:"400%",value:4},{text:"화면맞춤",value:"FITSCREEN"},{text:"자동맞춤",value:"FITAUTO"},{text:"높이맞춤",value:"FITHEIGHT"},{text:"너비맞춤",value:"FITWIDTH"}]}]},ZOOM_SELECT_CUSTOM:{type:"ZOOM",classDefaultName:n+"-ui-icon",disabled:!0,inlineDisabled:!1,controlItem:[{type:"ZOOM",title:"비율 선택",nodeType:"input",name:"zoomRatio",triggerName:"trigger.change.zoom",dataType:"number",maxLength:4,replacePattern:"%",replaceChar:"",className:"sform-zoom-field",disabled:!1,enabledOption:!0,readonly:!1,value:null,options:[{text:"25%",value:.25},{text:"50%",value:.5},{text:"75%",value:.75},{text:"100%",value:1},{text:"125%",value:1.25},{text:"150%",value:1.5},{text:"200%",value:2},{text:"400%",value:4},{text:"화면맞춤",value:"FITSCREEN"},{text:"자동맞춤",value:"FITAUTO"},{text:"높이맞춤",value:"FITHEIGHT"},{text:"너비맞춤",value:"FITWIDTH"}]}]},ROTATE:{type:"ROTATE",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"checkbox",value:!1,label:"전체 회전",title:"전체 회전",nodeType:"input",triggerName:"trigger.change.rotate",name:"applyAllRotation",className:"check-global-rotate",disabled:!0,inlineDisabled:!0},{type:-90,value:-90,title:"왼쪽 90도 회전",nodeType:"icon",triggerName:"trigger.change.rotate",className:"icon-rotate-left",disabled:!1,inlineDisabled:!1},{type:90,value:90,title:"오른쪽 90도 회전",nodeType:"icon",triggerName:"trigger.change.rotate",className:"icon-rotate-right",disabled:!1,inlineDisabled:!1},{type:180,value:180,title:"180도 회전",nodeType:"icon",triggerName:"trigger.change.rotate",className:"icon-rotate-180",disabled:!1,inlineDisabled:!1}]},AUTOZOOMIN:{type:"AUTOZOOMIN",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"AUTOZOOMIN",title:"자동확대",nodeType:"icon",triggerName:"trigger.change.autozoom",className:"icon-auto-zoom-in",disabled:!1,inlineDisabled:!1}]},AUTOZOOMOUT:{type:"AUTOZOOMOUT",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"AUTOZOOMOUT",title:"자동축소",nodeType:"icon",triggerName:"trigger.change.autozoom",className:"icon-auto-zoom-out",disabled:!1,inlineDisabled:!1}]},MAGNIFICATION:{type:"MAGNIFICATION",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"MAGNIFICATION",title:"돋보기",nodeType:"icon",triggerName:"trigger.magnification",className:"icon-magnifier-in",disabled:!1,inlineDisabled:!1}]},FIT_ZOOM:{type:"ZOOM",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"FITWIDTH",title:"너비맞춤",nodeType:"icon",triggerName:"trigger.change.zoom",className:"icon-fitwidth",disabled:!1,inlineDisabled:!1},{type:"FITHEIGHT",title:"높이맞춤",nodeType:"icon",triggerName:"trigger.change.zoom",className:"icon-fitheight",disabled:!1,inlineDisabled:!1}]},FILTER:{type:"brightness",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:10,title:"밝게",nodeType:"icon",triggerName:"trigger.change.filter",className:"icon-brightness-up",disabled:!1},{type:-10,title:"어둡게",nodeType:"icon",triggerName:"trigger.change.filter",className:"icon-brightness-down",disabled:!1}]},FILE_DOWNLOAD:{type:"file.download",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"filedownload",title:"다운로드",nodeType:"icon",triggerName:"trigger.file.download",className:"button-default",disabled:!1,label:"다운로드"}]},FILE_PRINT:{type:"print",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"print",title:"프린트",nodeType:"icon",triggerName:"trigger.file.print",className:"icon-print",optionClassName:"print",disabled:!1,enabledOption:!1,inlineDisabled:!1,options:[{text:"현재페이지",value:"page"},{text:"전체페이지",value:"all"},{text:"페이지지정",value:"custom",nodeType:"input",name:"pintPageRange",inputType:"text",dataType:"range",placeholder:"예: 1-5,8,11-13",errorMessage:"* 잘못된 페이지 범위입니다.<br/>예: 1-5,8,11-13을(를) 사용하세요.",confirm:!0}]}]},FILE_SAVE:{type:"save",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"save",title:"저장",nodeType:"icon",triggerName:"trigger.file.save",className:"icon-save",disabled:!0,inlineDisabled:!1}]},ANNOTATION_SAVE:{type:"annotation.save",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"annotation.save",title:"주석 저장",nodeType:"icon",triggerName:"trigger.annotation.save",className:"icon-save-annotation",disabled:!1,inlineDisabled:!1}]},FILE_DELETE:{type:"file.delete",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"file.delete",title:"파일 삭제",nodeType:"icon",triggerName:"trigger.file.delete",className:"button-default",disabled:!1,label:"삭제",inlineDisabled:!1}]}},PAGENATION_CONTROL:{name:"PAGENATION_CONTROL",type:"movepage",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"first",title:"첫 페이지",nodeType:"icon",triggerName:"trigger.movepage",className:"icon-arrow-first",disabled:!1,inlineDisabled:!1},{type:"prev",title:"이전 페이지",nodeType:"icon",triggerName:"trigger.movepage",className:"icon-arrow-prev",disabled:!1,inlineDisabled:!1},{type:"number",title:"현재 페이지",nodeType:"input",triggerName:"change.current.page.no",name:"currentPageNo",className:"current-page-number number",disabled:!1,readonly:!1,inlineDisabled:!1},{type:"number",title:"전체 페이지",nodeType:"input",triggerName:"change.total.page.no",name:"totalPageNo",className:"total-page-number number",disabled:!1,readonly:!0,inlineDisabled:!1},{type:"next",title:"다음 페이지",nodeType:"icon",triggerName:"trigger.movepage",className:"icon-arrow-next",disabled:!1,inlineDisabled:!1},{type:"last",title:"마지막 페이지",nodeType:"icon",triggerName:"trigger.movepage",className:"icon-arrow-last",disabled:!1,inlineDisabled:!1}]},VIEWER_TYPE_CONTROL:{IMAGE_THUMBNAIL_VIEW:{type:"ViewerType",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"IMAGE_THUMBNAIL",title:"이미지/섬네일 뷰",nodeType:"icon",triggerName:"trigger.change.viewer.type",className:"icon-image-thumbnail",disabled:!1,inlineDisabled:!1}]},IMAGE_VIEW:{type:"ViewerType",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"IMAGE",title:"이미지 뷰",nodeType:"icon",triggerName:"trigger.change.viewer.type",className:"icon-image",disabled:!1,inlineDisabled:!1}]},THUMBNAIL_VIEW:{type:"ViewerType",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"THUMBNAIL",title:"섬네일 뷰",nodeType:"icon",triggerName:"trigger.change.viewer.type",className:"icon-thumbnail",disabled:!1,inlineDisabled:!1}]}},FILE_CONTROL:{FILE_DOWNLOAD:{type:"file.download",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"filedownload",title:"다운로드",nodeType:"icon",triggerName:"trigger.file.download",className:"button-default",disabled:!1,label:"다운로드"}]},FILE_PRINT:{type:"file_print",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"file_print",title:"프린트",nodeType:"icon",triggerName:"trigger.file.print",className:"icon-print",optionClassName:"print",disabled:!1,enabledOption:!1,inlineDisabled:!1,options:[{text:"현재페이지",value:"page"},{text:"전체페이지",value:"all"},{text:"페이지지정",value:"custom",nodeType:"input",name:"pintPageRange",inputType:"text",dataType:"range",placeholder:"예: 1-5,8,11-13",errorMessage:"* 잘못된 페이지 범위입니다.<br/>예: 1-5,8,11-13을(를) 사용하세요.",confirm:!0}]}]},FILE_SAVE:{type:"file.save",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"save",title:"저장",nodeType:"icon",triggerName:"trigger.file.save",className:"icon-save",disabled:!1,inlineDisabled:!1}]},ANNOTATION_SAVE:{type:"annotation.save",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"annotation.save",title:"주석 저장",nodeType:"icon",triggerName:"trigger.annotation.save",className:"icon-save-annotation",disabled:!1,inlineDisabled:!1}]},FILE_DELETE:{type:"file.delete",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"file.delete",title:"파일 삭제",nodeType:"icon",triggerName:"trigger.file.delete",className:"button-default",disabled:!1,label:"삭제",inlineDisabled:!1}]},FILE_FAX:{type:"file.fax",classDefaultName:n+"-ui-icon",disabled:!0,controlItem:[{type:"fax",title:"Fax",nodeType:"icon",triggerName:"trigger.file.fax",className:"icon-fax",disabled:!1,inlineDisabled:!1}]}},ANNOTATION_CONTROL:{PROPERTY:{type:"prop",classDefaultName:n+"-ui-icon",disabled:!1,controlItem:[{type:"font-color",title:"글꼴 색",nodeType:"icon",triggerName:"trigger.set.annotation.color",className:"icon-color-font icon-color",disabled:!1,value:"#000000",targetNode:null,innerHTML:'<span class="color" style="background: #000000;">&nbsp;</span>'},{type:"stroke",title:"선 색",nodeType:"icon",triggerName:"trigger.set.annotation.color",className:"icon-color-stroke icon-color",disabled:!1,value:"#000000",targetNode:null,innerHTML:'<span class="color" style="background: #000000;">&nbsp;</span>'},{type:"fill",title:"채우기 색",nodeType:"icon",triggerName:"trigger.set.annotation.color",className:"icon-color-fill icon-color",disabled:!1,value:"#ffffff",targetNode:null,innerHTML:'<span class="color" style="background: #ffffff;">&nbsp;</span>'},{type:"index_first",title:"맨 앞으로",nodeType:"icon",triggerName:"trigger.set.annotation.index",className:"icon-index-first",disabled:!1},{type:"index_last",title:"맨 뒤로",nodeType:"icon",triggerName:"trigger.set.annotation.index",className:"icon-index-last",disabled:!1},{type:"index_front",title:"앞으로",nodeType:"icon",triggerName:"trigger.set.annotation.index",className:"icon-index-front",disabled:!1},{type:"index_back",title:"뒤로",nodeType:"icon",triggerName:"trigger.set.annotation.index",className:"icon-index-back",disabled:!1}]},DRAGGABLE_TOOLBAR:{type:"draggable.toolbar"},ITEM:{DISPLAY:{type:"display",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml idoc default",controlItem:[{type:"show",title:"주석 보이기",nodeType:"icon",triggerName:"trigger.display.annotation",className:"icon-annotation-show",value:!0,disabled:!1},{type:"hide",title:"주석 숨기기",nodeType:"icon",triggerName:"trigger.display.annotation",className:"icon-annotation-hide",value:!1,disabled:!1}]},SELECT:{type:"select",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml idoc default",controlItem:[{type:"select",title:"주석 선택",nodeType:"icon",triggerName:"trigger.selected.annotation",className:"icon-select-annotation",disabled:!1}]},RECT:{type:"rect",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml idoc default",controlItem:[{type:"rect",title:"사각형",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-rect",disabled:!1}]},CIRCLE:{type:"circle",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"",controlItem:[{type:"circle",title:"원",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-ellipse",disabled:!1}]},ELLIPSE:{type:"ellipse",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml idoc default",controlItem:[{type:"ellipse",title:"원",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-ellipse",disabled:!1}]},LINE:{type:"line",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml idoc default",controlItem:[{type:"line",title:"선",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-line",disabled:!1}]},ARROWLINE:{type:"arrowline",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml idoc default",controlItem:[{type:"arrowline",title:"화살표",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-arrow",disabled:!1}]},POLYLINE:{type:"polyline",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"visual visualxml idoc default",controlItem:[{type:"polyline",title:"폴리라인",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-polyline",disabled:!1}]},POLYGON:{type:"polygon",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml default",controlItem:[{type:"polygon",title:"폴리곤",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-polygon",disabled:!1}]},PEN:{type:"pen",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform visual visualxml idoc",controlItem:[{type:"pen",title:"펜",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-pen",disabled:!1}]},HIGHLIGHTER_RECT:{type:"highlighterRect",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform idoc default",controlItem:[{type:"highlighter",title:"형광펜",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-highlighter",disabled:!1}]},HIGHLIGHTER:{type:"highlighter",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"visual visualxml",controlItem:[{type:"highlighter",title:"형광펜",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-highlighter",disabled:!1}]},HIGHLIGHTER_PEN:{type:"highlighterPen",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"visual visualxml",controlItem:[{type:"highlighterPen",title:"형광펜(펜)",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-highlighter",disabled:!1}]},MEMO:{type:"memo",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform",controlItem:[{type:"memo",title:"메모",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-text",disabled:!1}]},MEMOPAD:{type:"memopad",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform idoc",controlItem:[{type:"memopad",title:"메모패드",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-memopad",disabled:!1}]},STAMP:{type:"stamp",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform",controlItem:[{type:"stamp",title:"스탬프",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-stamp",disabled:!1}]},CHECKMARK:{type:"checkmark",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform idoc",controlItem:[{type:"checkmark",title:"체크마크",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-checkmark",disabled:!1}]},POLYCURVE:{type:"polycurve",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"visual visualxml",controlItem:[{type:"polycurve",title:"폴리커브",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-polycurve",disabled:!1}]},TEXT:{type:"text",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"visual visualxml idoc",controlItem:[{type:"text",title:"텍스트",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-text",disabled:!1}]},PROTRACTOR:{type:"protractor",classDefaultName:n+"-ui-icon",disabled:!0,viewerCompatType:"visual visualxml",controlItem:[{type:"protractor",title:"각도기",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-protractor",disabled:!1}]},ARC:{type:"arc",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"visual visualxml",controlItem:[{type:"arc",title:"호",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-arc",disabled:!1}]},IMAGE:{type:"image",classDefaultName:n+"-ui-icon",disabled:!0,viewerCompatType:"",controlItem:[{type:"image",title:"이미지",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-image",disabled:!1}]},MASK:{type:"mask",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"idoc default",controlItem:[{type:"mask",title:"마스킹",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-masking",disabled:!1}]},ETERNITYRECT:{type:"EternityRect",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"iform",controlItem:[{type:"EternityRect",title:"마스킹",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-masking",disabled:!1}]},HIDDENAREA:{type:"hiddenarea",classDefaultName:n+"-ui-icon",disabled:!0,viewerCompatType:"iform",controlItem:[{type:"hiddenarea",title:"마스킹",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"button-default",disabled:!1,label:"마스킹"}]},EDITTEXT:{type:"edittext",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"",controlItem:[{type:"edittext",title:"텍스트",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-text",disabled:!1}]},STICKYNOTE:{type:"stickynote",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"idoc default",controlItem:[{type:"stickynote",title:"스티커 메모",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-text",disabled:!1}]},BLACKMARKING:{type:"blackmarking",classDefaultName:n+"-ui-icon",disabled:!1,viewerCompatType:"idoc",controlItem:[{type:"blackmarking",title:"마스킹",nodeType:"icon",triggerName:"trigger.set.annotation.type",className:"icon-masking",disabled:!1}]}}},SERVICE_TYPE:{API:"api",PCAGENT_API:"pcagent_api",RESOURCE:"resource"},MAGNIFIER_TYPE:{xsmall:{width:150,height:100},small:{width:250,height:200},medium:{width:400,height:300},large:{width:700,height:500}},VIEWER_CONFIG:{container:null,wrapper:null,globalTransform:!0,zoom:"fitauto",minZoom:.25,maxZoom:4,zoomRatio:.25,angle:0,width:0,height:0,hAlign:"",editable:!0,draggable:!1,visible:!0,transform:0,isMulti:!1,resize:!0,showScroll:!1,isVisibleWatermark:!1,annotationEnable:!1,annotationViewMode:"all",renderNodeType:"canvas",renderType:"",renderQuality:"",securityLevel:0,cors:!1,watermark:{visible:!0,type:"text",message:"Copy",position:"center center"},magnifier:{type:"small"},style:{position:"absolute","background-color":"#ffffff",left:"0px",top:"0px"},annotation:{visible:!0,editable:!0,fill:"#ffffff","fill-opacity":.5,stroke:"#000000","stroke-width":3,"font-family":"굴림","font-size":12,"font-weight":"normal","font-style":"normal","font-color":"#000000"},layerOptions:{toolbarControl:!0,viewerControl:!0,annotationControl:!1,thumbnailControl:!0,pageControl:!0,propertyControl:!0},zoomOptions:{isDblclickEnabled:!1},eventOptions:{pinch:!0,swipe:!0},listenerId:null},PRINT_LAYOUT_TYPE:{DEFAULT:"default",LANDSCAPE:"landscape",PORTRAIT:"portrait"},PRINT_RANGE_TYPE:{DEFAULT:"file",SELECTION:"selection",FILE:"file",PAGE:"page",CUSTOM:"custom",ALL:"all"},PRINT_PAGE_RENDER_SIZE_TYPE:{DEFAULT:"default",FIXED:"fixed",AUTO:"auto"},PRINT_PAPER_SIZE_TYPE:{A4:{PORTRAIT:{name:"A4",web:"A4",width:210,height:297,batch:"PAGE_TYPE_A4"},LANDSCAPE:{name:"A4 가로",web:"A4",width:297,height:210,batch:"PAGE_TYPE_A4_LANDSCAPE"}},A5:{PORTRAIT:{name:"A5",web:"A5",width:148,height:210,batch:"PAGE_TYPE_A5"},LANDSCAPE:{name:"A5",web:"A5",width:210,height:148,batch:"PAGE_TYPE_A5_LANDSCAPE"}},A6:{PORTRAIT:{name:"A6",web:"A6",width:105,height:148,batch:"PAGE_TYPE_A6"},LANDSCAPE:{name:"A6",web:"A6",width:148,height:105,batch:"PAGE_TYPE_A6_LANDSCAPE"}},A7:{PORTRAIT:{name:"A7",web:"A7",width:74,height:105,batch:"PAGE_TYPE_A7"},LANDSCAPE:{name:"A7",web:"A7",width:105,height:74,batch:"PAGE_TYPE_A7_LANDSCAPE"}},B5:{PORTRAIT:{name:"B5",web:"B5",width:176,height:250,batch:"PAGE_TYPE_B5"},LANDSCAPE:{name:"B5",web:"B5",width:250,height:176,batch:"PAGE_TYPE_B5_LANDSCAPE"}},B6:{PORTRAIT:{name:"B6",web:"B6",width:125,height:176,batch:"PAGE_TYPE_B6"},LANDSCAPE:{name:"B6",web:"B6",width:176,height:125,batch:"PAGE_TYPE_B6_LANDSCAPE"}},B7:{PORTRAIT:{name:"B7",web:"B7",width:88,height:125,batch:"PAGE_TYPE_B7"},LANDSCAPE:{name:"B7",web:"B7",width:125,height:88,batch:"PAGE_TYPE_B7_LANDSCAPE"}},POST_CARD:{PORTRAIT:{name:"엽서",web:"엽서",width:8.267,height:11.693,batch:"PAGE_TYPE_POST_CARD"},LANDSCAPE:{name:"엽서",web:"엽서 가로",width:8.267,height:11.693,batch:"PAGE_TYPE_POST_CARD_LANDSCAPE"}},NAME_CARD:{PORTRAIT:{name:"명함",web:"명함",width:8.267,height:11.693,batch:"PAGE_TYPE_NAME_CARD"},LANDSCAPE:{name:"명함 가로",web:"명함 가로",width:8.267,height:11.693,batch:"PAGE_TYPE_NAME_CARD_LANDSCAPE"}}},PRINT_PAGE_TYPE:{PAGE_TYPE_A4:{name:"A4",web:"A4",width:210,height:297,batch:"PAGE_TYPE_A4"},PAGE_TYPE_A5:{name:"A5",web:"A5",width:148,height:210,batch:"PAGE_TYPE_A5"},PAGE_TYPE_A6:{name:"A6",web:"A4",width:105,height:148,batch:"PAGE_TYPE_A6"},PAGE_TYPE_A7:{name:"A7",web:"A4",width:74,height:105,batch:"PAGE_TYPE_A7"},PAGE_TYPE_B5:{name:"B5",web:"B5",width:176,height:250,batch:"PAGE_TYPE_B5"},PAGE_TYPE_B6:{name:"B6",web:"A4",width:125,height:176,batch:"PAGE_TYPE_B6"},PAGE_TYPE_B7:{name:"B7",web:"A4",width:88,height:125,batch:"PAGE_TYPE_B7"},PAGE_TYPE_POST_CARD:{name:"엽서",web:"A4",width:8.267,height:11.693,batch:"PAGE_TYPE_POST_CARD"},PAGE_TYPE_NAME_CARD:{name:"명함",web:"A4",width:8.267,height:11.693,batch:"PAGE_TYPE_NAME_CARD"},PAGE_TYPE_A4_LANDSCAPE:{name:"A4 가로",web:"A4",width:297,height:210,batch:"PAGE_TYPE_A4_LANDSCAPE"},PAGE_TYPE_A5_LANDSCAPE:{name:"A5 가로",web:"A4",width:210,height:148,batch:"PAGE_TYPE_A5_LANDSCAPE"},PAGE_TYPE_A6_LANDSCAPE:{name:"A6 가로",web:"A4",width:148,height:105,batch:"PAGE_TYPE_A6_LANDSCAPE"},PAGE_TYPE_A7_LANDSCAPE:{name:"A7 가로",web:"A4",width:105,height:74,batch:"PAGE_TYPE_A7_LANDSCAPE"},PAGE_TYPE_B5_LANDSCAPE:{name:"B5 가로",web:"A4",width:250,height:176,batch:"PAGE_TYPE_B5_LANDSCAPE"},PAGE_TYPE_B6_LANDSCAPE:{name:"B6 가로",web:"A4",width:176,height:125,batch:"PAGE_TYPE_B6_LANDSCAPE"},PAGE_TYPE_B7_LANDSCAPE:{name:"B7 가로",web:"A4",width:125,height:88,batch:"PAGE_TYPE_B7_LANDSCAPE"},PAGE_TYPE_POST_CARD_LANDSCAPE:{name:"엽서 가로",web:"A4",width:8.267,height:11.693,batch:"PAGE_TYPE_POST_CARD_LANDSCAPE"},PAGE_TYPE_NAME_CARD_LANDSCAPE:{name:"명함 가로",web:"A4",width:8.267,height:11.693,batch:"PAGE_TYPE_NAME_CARD_LANDSCAPE"}},PRINT_SERVICE_TYPE:{DEFAULT:"webbrowser",WEBBROWSER:"webbrowser",PCAGENT:"pcagent",BATCHPRINT:"batchprint"},UI:{LOADING_BAR:{THUMBNAIL:"data:image/gif;base64,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",VIEWER:"data:image/gif;base64,R0lGODlhIAAgAPUAAP///zM+SLq+wZyhpn+GjG93fmRsdGx0e3d/hYySmKSprbK2uoSLkVxlbVpja19ocGdvd4+Vm7e7vr7BxIeOk1liar/DxlRdZnyDiamtslFaY05XYJ+kqaywtJedonR7gpSan0pUXUxWXklTXK+zt0ROV8fKzUFLVMLGyMrN0NfZ29rc3t/h4tLV18/S1Ofo6e/w8err7PLz8/f3+Pz8/OLk5TZBSjM+SDpFTwAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEicDBCOS8lBbDqfgAUidDqVSlaoliggbEbX8Amy3S4MoXQ6fC1DM5eNeh0+uJ0Lx0YuWj8IEQoKd0UQGhsaIooGGYRQFBcakocRjlALFReRGhcDllAMFZmalZ9OAg0VDqofpk8Dqw0ODo2uTQSzDQ12tk0FD8APCb1NBsYGDxzERMcGEB3LQ80QtdEHEAfZg9EACNnZHtwACd8FBOIKBwXqCAvcAgXxCAjD3BEF8xgE28sS8wj6CLi7Q2PLAAz6GDBIQMLNjIJaLDBIuBCEAhRQYMh4WEYCgY8JIoDwoGCBhRQqVrBg8SIGjBkcAUDEQ2GhyAEcMnSQYMFEC0QVLDXCpEFUiwAQIUEMGJCBhEkTLoC2hPFyhhsLGW4K6rBAAIoUP1m6hOEIK04FGRY8jaryBdlPJgQscLpgggmULMoEAQAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEicDDCPSqnUeCBAxKiUuEBoQqGltnQSTb9CAUMjEo2woZHWpgBPFxDNZoPGqpc3iTvaeWjkG2V2dyUbe1QPFxd/ciIGDBEKChEEB4dCEwcVFYqLBxmXYAkOm6QVEaFgCw+kDQ4NHKlgFA21rlCyUwIPvLwIuV8cBsMGDx3AUwzEBr/IUggHENKozlEH19dt1UQF2AfH20MF3QcF4OEACN0FCNroBAUfCAgD6EIR8ggYCfYAGfoICBBYYE+APgwCPfQDgZAAgwTntkkQyIBCggh60HFg8DACiAEZt1kAcTHCgAEKFqT4MoPGJQERYp5UkGGBBRcqWLyIAWNGy0JQEmSi7LBgggmcOmHI+BnKAgeUCogaRbqzJ9NLKEhIIioARYoWK2rwXNrSZSgTC7haOJpTrNIZzkygQMF2RdI9QQAAIfkECQcAAAAsAAAAACAAIAAABv9AgHBInHAwj0ZI9HggBhOidDpcYC4b0SY0GpW+pxFiQaUKKJWLRpPlhrjf0ulEKBMXh7R6LRK933EnNyR2Qh0GFYkXexttJV5fNgiFAAsGDhUOmIsQFCAKChEEF5GUEwVJmpoHGWUKGgOUEQ8GBk0PIJS6CxC1vgq6ugm+tbnBhQIHEMoGdceFCgfS0h3PhQnTB87WZQQFBQcFHtx2CN8FCK3kVAgfCO9k61PvCBgYhPJSGPUYBOr5Qxj0I8AAGMAhIAgQZGDsIIAMCxNEEOAQwAQKCSR+qghAgcQIHgZIqDhB44ABCkxUDBVSQYYOKg9aOMlBQYcFEkyokInS5oJECSZcqKgRA8aMGTRoWLOQIQOJBRaCqmDxAoYMpORMLHgaVShVq1jJpbAgoevUqleVynNhQioLokaRqpWnYirctHPLBAEAIfkECQcAAAAsAAAAACAAIAAABv9AgHBInCgIBsNmkyQMJsSodLggNC5YjWYZGoU0iMV0Kkg8Kg5HdisKuUelEkEwHko+jXS+ctFuRG1ucSUPYmMdBw8GDw15an1LbV6DJSIKUxIHSUmMDgcJIAoKIAwNI3BxODcPUhMIBhCbBggdYwoGgycEUyAHvrEHHnVDCSc3DpgFvsuXw0MeCGMRB8q+A87YAAIF3NwU2dgZH9wIYeDOIOXl3+fDDBgYCE7twwT29rX0Y/cMDBL6+/oxSPAPoJQECBNEMGSQCAiEEUDkazhEgUIQA5pRFLJAoYeMJjYKsQACI4cMDDdmGMBBQQYSIUVaaPlywYQWIgEsUNBhgQRHCyZUiDRBgoRNFClasIix0YRPoC5UsHgBQ8YMGjQAmpgAVSpVq1kNujBhIurUqlcpqnBh9mvajSxWnAWLNWeMGDBm6K2LLQgAIfkECQcAAAAsAAAAACAAIAAABv9AgHBInCgYB8jlAjEQOBOidDqUMAwNR2V70XhFF8SCShVEDIbHo5GtdL0bkWhDEJCrmCY63V5+RSEhIw9jZCQIB0l7aw4NfnGAISUlGhlUEoiJBwZNBQkeGRkgDA8agYGTGoVDEwQHBZoHGB1kGRAiIyOTJQ92QwMFsMIDd0MJIruTBFUICB/PCJbFv7qTNjYSQh4YGM0IHNNSCSUnNwas3NwEEeFTDhpSGQTz86vtQtlSAwwEDAzs96ZFYECBQQJpAe9ESMAwgr2EUxJEiAACRBSIZCSCGDDgIsYpFTlC+UiFA0cFCnyRJNKBg4IMHfKtrIKyAwkJLmYOMQHz5gRVEzqrkFggAIUJFUEBmFggwYIJFypqJEUxAUUKqCxiBHVhFOqKGjFgzNDZ4qkKFi9gyJhBg8ZMFS3Opl3rVieLu2FnsE0K4MXcvXzD0q3LF4BewAGDAAAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEicKBKHg6ORZCgmxKh0KElADNiHo8K9XCqYxXQ6ARWSV2yj4XB4NZoLQTCmEg7nQ9rwYLsvcBsiBmJjCwgFiUkHWX1tbxoiIiEXGVMSBAgfikkIEQMZGR4JBoCCkyMXhUMTFAgYCJoFDB1jGQeSISEjJQZQQwOvsbEcdUMRG7ohJSUEdgTQBBi1xsAbI7vMhQPR0ArVUQm8zCUIABYJFAkMDB7gUhDkzBIkCfb2Eu9RGeQnJxEcEkSIAGKAPikPSti4YYPAABAgPIAgcTAKgg0E8gGIOKAjnYp1Og7goAAFyDokFYQycXKMAgUdOixg2VJKTBILJNCsSYTeAlYBFnbyFIJCAlATKVgMHeJCQtAULlQsHWICaVQWL6YCUGHiao0XMLSqULECKwwYM6ayUIE1BtoZNGgsZWFWBly5U1+4nQFXq5CzfPH6BRB4MBHBhpcGAQAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEgEZBKIgsFQKFAUk6J0Kkl8DljI0vBwOB6ExXQ6GSSb2MO2W2lXKILxUEJBID6FtHr5aHgrFxcQYmMLDHZ2eGl8fV6BGhoOGVMCDAQEGIgIBCADHRkDCQeOkBsbF4RDFiCWl5gJqUUZBxcapqYGUUMKCQmWlgpyQxG1IiHHBEMTvcywwkQcGyIiIyMahAoR2todz0URxiHVCAAoIOceIMHeRQfHIyUjEgsD9fUW7LIlxyUlER0KOChQMClfkQf9+hUAmKFhHINECCQs0aCDRRILTEAk4mGiCBIYJUhwsXFXwhMlRE6wYKFFSSEKTpZYicJEChUvp5iw6cLFikWcUnq6UKGCBdAiKloUZVEjxtEhLIrWeBEDxlOoLF7AgCFjxlUAMah2nTGDxtetZGmoNXs1LduvANLCJaJ2rt27ePPKCQIAIfkECQcAAAAsAAAAACAAIAAABv9AgHBIBHRABMzhgEEkFJOidCoANT+F7PJg6DIW06llkGwiCtsDpGtoPBKC8HACYhCSiDx6ue42Kg4HYGESEQkJdndme2wPfxUVBh1iEYaHDHYJAwokHRwgBQaOjxcPg0Mon5WWIKdFHR8OshcXGhBRQyQDHgMDIBGTckIgf7UbGgxDJgoKvb1xwkMKFcbHgwvM2RLRRREaGscbGAApHeYdGa7cQgcbIiEiGxIoC/X1KetFGSLvIyEgFgQImCDAQj4pEEIoFIHAgkMTKFwcLMJAYYgRBkxodOFCxUQiHkooLLEhBccWKlh8lFZixIgSJVCqWMHixUohCmDqTMmixotJGDcBhNQpgkXNGDBgBCWgs8SDFy+SwpgR9AOOGzZOfEA6dcYMGkEBTGCgIQGArjTShi3iVe1atl/fTokrVwrYunjz6t3Lt+/bIAAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEgEdDwMAqJAIEQyk6J0KhhQCBiEdlk4eCmS6dSiSFCuTe2n64UYIBGBeGgZJO6JpBKx9h7cBg8FC3MTAyAgEXcUSVkfH34GkoEGHVMoCgOHiYoRChkkHQogCAeTDw0OBoRFopkDHiADYVMdCIEPDhUVB1FDExkZCsMcrHMAHgYNFboVFEMuCyShohbHRAoPuxcXFawmEuELC9bXRBEV3NwEACooFvAC5eZEHxca+BoSLSb9/S30imTIt2GDBxUtXCh0EVCKAQ0iCiJQQZHiioZFGGwIEdEAi48fa2AkMiBEiBEhLrxYGeNFjJFDFJwcMUIEjJs4YQqRSbOmjFQZM2TIgKETWQmaJTQAXTqjKIESUEs8oEGValOdDqKWKEBjCI2rIxWcgHriBAgiVHVqKDF2LK2iQ0DguFEWAdwpCW7gMHa3SIK+gAMLHky4sOGAQQAAIfkECQcAAAAsAAAAACAAIAAABv9AgHBIBCw4kQQBQ2F4MsWoFGBRJBNNAgHBLXwSkmnURBqAIleGlosoHAoFkEAsNGU4AzMogdViEB8fbwcQCGFTJh0KiwMeZ3xqf4EHlBAQBx1SKQskGRkKeB4DGR0LCxkDGIKVBgYHh0QWEhKcnxkTUyQElq2tBbhDKRYWAgKmwHQDB70PDQlDKikmJiiyJnRECgYPzQ4PC0IqLS4u0y7YRR7cDhUODAA1Kyrz5OhRCOzsDQIvNSz/KljYK5KBXYUKFwbEWNhP4MAiBxBeuEAAhsWFMR4WYVBBg8cDM2bIsAhDI5EBGjakrBCypQyTQxRsELGhJo2bNELCFKJAhM9dmkNyztgJYECIoyIuEKFBFACDECNGhDDQtMiDo1ERVI1ZAmpUEFuFPCgRtYQIWE0TnCjB9oTWrSBKrGVbAtxWAjfmniAQVsiAvCcuzOkLAO+ITIT9KkjMuLFjmEEAACH5BAkHAAAALAAAAAAgACAAAAb/QIBwSARMOgNPIgECDTrFqBRgWmQUgwEosmQQviDJNOqyLDpXThLU/WIQCM9kLGyhBJIFKa3leglvHwUEYlMqJiYWFgJ6aR5sCV5wCAUFCCRSLC0uLoiLCwsSEhMCewmAcAcFBx+FRCsqsS4piC5TCwkIHwe8BxhzQy8sw7AtKnRCHJW9BhFDMDEv0sMsyEMZvBAG2wtCMN/fMTHWRAMH29sUQjIzMzLf5EUE6A8GAu347fFEHdsPDw4GzKBBkOC+Ih8AOqhAwKAQGgeJJGjgoOIBiBGlDKi48EHGKRkqVLhA8qMUBSQvaLhgMsoAlRo0OGhZhEHMDRoM0CRiYIPPVQ0IdgrJIKLoBhEehAI4EEJE0w2uWiYIQZVq0J0DRjgNMUJDN5oJSpQYwXUEAZoCNIhdW6KBgJ0XcLANAUWojRNiNShQutRG2698N2B4y1dI1MJjggAAIfkECQcAAAAsAAAAACAAIAAABv9AgHBIBJgkHQVnwFQsitAooHVcdDIKxcATSXgHAimURUVZJFbstpugEBiDiVhYU7VcJjM6uQR1GQQECBQSYi8sKyoqeCYCEiRZA34JgIIIBE9QMDEvNYiLJqGhKEgDlIEIqQiFRTCunCyKKlISIKgIHwUEckMzMzIymy8vc0IKGKkFBQcgvb6+wTDFQx24B8sFrDTbNM/TRArLB+MJQjRD3d9FDOMHEBBhRNvqRB3jEAYGA/TFCPn5DPjNifDPwAeBYjg8MPBgIUIpGRo+cNDgYZQMDRo4qFDRYpEBDkJWeOCxSAKRFQ6UJHLgwoUKFwisFJJBg4YLN/fNPKBhg81UC6xKRhAhoqcGmSsHbCAqwmcmjwlEhGAqAqlFBQZKhNi69UE8hAgclBjLdYQGEh4PnBhbYsTYCxlKMrDBduyDpx5trF2L4WtJvSE+4F2ZwYNfKEEAACH5BAkHAAAALAAAAAAgACAAAAb/QIBwSAS0TBPJIsPsSIrQKOC1crlMFmVGwRl4QAqBNBqrrVRXlGDRUSi8kURCYRkPYbEXa9W6ZklbAyBxCRQRYlIzMzJ4emhYWm+DchQMDAtSNDSLeCwqKn1+CwqTCQwEqE9RmzONL1ICA6aoBAgUE5mcdkIZp7UICAO5MrtDJBgYwMCqRZvFRArAHx8FEc/PCdMF24jXYyTUBwUHCt67BAfpBwnmdiDpEBAI7WMK8BAH9FIdBv39+lEy+PsHsAiHBwMLFknwoOGDDwqJFGjgoCKBiLwcVNDoQBjGAhorVGjQrWCECyhFMsA44IIGDSkxKUywoebLCxQUChQRIoRNQwMln7lJQKBCiZ49a1YgQe9BiadHQ4wY4fNCBn0lTkCVOjWEAZn0IGiFWmLEBgJBzZ1YyzYEArAADZy4UOHDAFxjggAAIfkECQcAAAAsAAAAACAAIAAABv9AgHBIBLxYKlcKZRFMLMWoVAiDHVdJk0WyyCgW0Gl0RobFjtltV8EZdMJiAG0+k1lZK5cJNVl02AMgAxNxQzRlMTUrLSkmAn4KAx4gEREShXKHVYlIehJ/kiAJCRECmIczUyYdoaMUEXBSc5gLlKMMBAOYuwu3BL+Xu4UdFL8ECB7CmCC/CAgYpspiCxgYzggK0nEU1x8R2mIDHx8FBQTgUwrkBwUf6FIdBQfsB+9RHfP59kUK+fP7RCIYgDAQAcAhCAwoNEDhIIAODxYa4OAQwYOIEaPtA+GgY4MGDQFyaNCxgoMHCwBGqHChgksHCfZlOKChZssKEDQWQkAgggJNBREYPBCxoaaGCxdQKntQomnTECFEiNBQVMODDNJuOB0BteuGohBSKltgY2uIEWiJamCgc5cGHCecPh2hAYFYbRI+uCxxosIDBIPiBAEAIfkECQcAAAAsAAAAACAAIAAABv9AgHBIBNBmM1isxlK1XMWotHhUvpouk8WSmnqHVdhVlZ1IFhLTV0qrxsZlSSfTQa2JbaSytnKlUBMLHQqEAndDSDJWTX9nGQocAwMTh18uAguPkhEDFpVfFpADIBEJCp9fE6OkCQmGqFMLrAkUHLBeHK0UDAyUt1ESCbwEBBm/UhHExCDHUQrKGBTNRR0I1ggE00Qk19baQ9UIBR8f30IKHwUFB+XmIAfrB9nmBAf2BwnmHRAH/Aen3zAYMACB36tpIAYqzKdNgYEHCg0s0BbhgUWIDyKsEXABYJQMBxxUcOCgwYMDB6fYwHGiAQFTCiIwMKDhwoWRIyWuUXCihM9DEiNGhBi6QUPNCkgNdLhz44RToEGFhiha8+aBiWs6OH0KVaiIDUVvMkj5ZcGHElyDTv16AQNWVKoQlAwxwiKCSV+CAAAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEgk0mYzGOxVKzqfT9pR+WKprtCs8yhbWl2mlEurlSZjVRXYMkmRo8dzbaVKmSaLBer9nHVjXyYoAgsdHSZ8WixrEoUKGXuJWS6EHRkKAySSWiYkl5gDE5tZFgocAx4gCqNZHaggEQkWrE8WA7AJFJq0ThwRsQkcvE4ZCbkJIMNFJAkMzgzKRAsMBNUE0UML1hjX2AAdCBjh3dgDCOcI0N4MHx/nEd4kBfPzq9gEBwX5BQLlB///4D25lUgBBAgAC0h4AuJEiQRvPBiYeBBCMmI2cJQo8SADlA4FHkyk+KFfkQg2bGxcaYCBqgwgEhxw0OCByIkHFjyRsGFliU8QQEUI1aDhQoUKDWiKPNAhy4IGDkuMGBE0BNGiRyvQLKBTiwAMK6eO2CBiA1GjRx8kMPlmwYcNIahumHv2wgMCXTdNMGczxAaRBDiIyhIEACH5BAkHAAAALAAAAAAgACAAAAb/QIBwSCwOabSZcclkImcwWKxJXT6lr1p1C3hCY7WVasV1JqGwF0vlcrXKzJlMWlu7TCgXnJm2p1AWE3tNLG0mFhILgoNLKngTiR0mjEsuApEKC5RLAgsdCqAom0UmGaADAxKjRR0cqAMKq0QLAx4gIAOyQxK3Eb66QhK+CcTAABLEycYkCRTOCcYKDATUEcYJ1NQeRhaMCwgYGAQYGUUXD4wJCOvrAkMVNycl0HADHwj3CNtCISfy8rm4ZDhQoGABDKqEYCghr0SJEfSoDDhAkeCBfUImXGg4IsQIA+WWdEAAoSJFDIuGdAjhMITLEBsMUACRIQOIBAceGDBgsoAmVSMKRDgc0VHEBg0aLjhY+kDnTggQCpBosuBBx44wjyatwHTnTgQJmwggICKE0Q1HL1TgWqFBUwMJ3HH5pgEm0gtquTowwCAsnAkDMOzEW5KBgpRLggAAIfkECQcAAAAsAAAAACAAIAAABv9AgHBILBqPyGSSpmw2aTOntAiVwaZSGhQWi2GX2pk1Vnt9j+EZDPZisc5INbu2UqngxzlL5Urd8UVtfC4mJoBGfCkmFhMuh0QrihYCEoaPQ4sCCx0Sl5gSmx0dnkImJB0ZChmkACapChwcrCiwA7asErYeu0MeBxGAJCAeIBG2Gic2JQ2AAxHPCQoRJycl1gpwEgnb2yQS1uAGcCAMDBQUCRYAH9XgCV8KBPLyA0IL4CEjG/VSHRjz8joJIWAthMENwJpwQMAQAQYE/IQIcFBihMEQIg6sOtKBQYECDREwmFCExIURFkNs0HDhQAIPGTI4+3Cg5oECHxAQEFgkwwVPjCI2rLzgwEGDBw8MGLD5ESSJJAsMBF3JsuhRpQYg1CxwYGcTAQQ0iL1woYJRpFi3giApZQGGCmQryHWQVCmEBDyxTOBAoGbRmxQUsEUSBAAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEgsGo/IpHLJbDqf0CiNNosyp1UrckqdwbRHrBcWAxdnaBjsxTYTZepXjcVyE2Nylqq1sgtjLCt7Li1+QoMuJimGACqJJigojCqQFgISBg8PBgZmLgKXEgslJyclJRlgLgusHR0ip6cRYCiuGbcOsSUEYBIKvwoZBaanD2AZHAMDHB0RpiEhqFYTyh7KCxIjJSMjIRBWHCDi4hYACNzdIrNPHQkR7wkKQgsb3NAbHE4LFBQJ/gkThhCAdu/COiUKCChk4E/eEAEPNkjcoOHCgQ5ISCRAgEEhAQYRyhEhcUGihooOHBSIMMDVABAEEMjkuFDCkQwOTl64UMFBA0hNnA4ILfDhw0wCC5IsgLCzQs+fnAwIHWoUAQWbSgQwcOrUwSZOEIYWKIBgQMAmCwg8SPnVQNihCbBCmaCAQYEDnMgmyHAWSRAAIfkECQcAAAAsAAAAACAAIAAABv9AgHBILBqPyKRyyWw6n9CodEpV0qrLK/ZIo822w2t39gUDut4ZDAAyDLDkmQxGL5xsp8t7OofFYi8OJYMlBFR+gCwsIoQle1IxNYorKo0lClQ1lCoqLoQjJRxULC0upiaMIyElIFQqKSkmsg8lqiEMVC4WKBa9CCG2BlQTEgISEhYgwCEiIhlSJgvSJCQoEhsizBsHUiQZHRnfJgAIGxrnGhFQEgrt7QtCCxob5hoVok0SHgP8HAooQxjMO1fBQaslHSKA8MDQAwkiAgxouHDBgcUPHZBIAJEgQYSPEQYAJEKiwYUKFRo0ePAAAYgBHTooGECBAAEGDDp6FHAkwwNNlA5WGhh64EABBEgR2CRAwaOEJAsOOEj5YCiEokaTYlgKgqcSAQkeCDVwFetRBBiUDrDgZAGDoQbMFijwAW1XKRMUJKhbVGmEDBOUBAEAIfkECQcAAAAsAAAAACAAIAAABv9AgHBILBqPyKRyyWw6n9CodEqFUqrJRQkHwhoRp5PtNPAKJaVTaf0xA0DqdUnhpdEK8lKDagfYZw8lIyMlBFQzdjQzMxolISElHoeLizIig490UzIwnZ0hmCKaUjAxpi8vGqAiIpJTMTWoLCwGGyIhGwxULCu9vQgbwRoQVCotxy0qHsIaFxlSKiYuKdQqEhrYGhUFUiYWJijhKgAEF80VDl1PJgsSAhMTJkILFRfoDg+jSxYZJAv/ElwMoVChQoMGDwy4UiJBgYIMGTp0mEBEwAEH6BIaQNABiQAOHgYMcKiggzwiCww4QGig5QEMI/9lUAAiQQQQIQdwUIDiSAdQAxoNQDhwoAACBBgIEGCQwOZNEAMoIllQQCNRokaRKmXaNMIAC0sEJHCJtcAHrUqbJlAAtomEBFcLmEWalEACDgKkTMiQQKlRBgxAdGiLJAgAIfkECQcAAAAsAAAAACAAIAAABv9AgHBILBqPyKRyyWw6n0yFBtpcbHBTanLiKJVsWa2R4PXeNuLiouwdKdJERGk08ibgQ8mmFAqVIHhDICEjfSVvgQAIhH0GiUIGIiEiIgyPABoblCIDjzQboKAZcDQ0AKUamamIWjMzpTQzFakaFx5prrkzELUaFRRpMMLDBBfGDgdpLzExMMwDFxUVDg4dWi8sLC8vNS8CDdIODQhaKior2doADA7TDwa3Ty0uLi3mK0ILDw7vBhCsS1xYMGEiRQoX+IQk6GfAwIFOS1BIkGDBAgoULogIKNAPwoEDBEggsUAiA4kFEwVYaKHmQEOPHz8wGJBhwQISHQYM4KAgQ4dYkxIyGungEuaBDwgwECDAIEEEEDp5ZjBpIokEBB8LaEWQlCmFCE897FTQoaoSASC0bu3KNIFbEFAXmGUiIcEHpFyXNnUbIYMFLRMygGDAAAEBpxwW/E0SBAAh+QQJBwAAACwAAAAAIAAgAAAG/0CAcEgsGo9I4iLJZAowuKa0uHicTqXpNLPBnnATLXOxKZnNUfFx8jCPzgb1kfAOhcwJuZE8GtlDA3pGGCF+hXmCRBIbIiEiIgeJRR4iGo8iGZJECBudGnGaQwYangyhQw4aqheBpwAXsBcVma6yFQ4VCq4AD7cODq2nBxXEDYh6NEQ0BL8NDx+JNNIA0gMODQbZHXoz3dI0MwIGD9kGGHowMN3dQhTk2QfBUzEx6ekyQgvZEAf9tFIsWNR4Qa/ekAgG+vUroKuJihYqVgisEYOIgA8KDxRAkGDJERcmTLhwoSIiiz0FNGpEgIFAggwkBEyQIGHBAgEWQo5UcdIIiVcPBQp8QICAAAMKCUB4GKAgQ4cFEiygMJFCRRIJBDayJGA0QQQQA5jChDrBhFUmE0AQLdo16dKmThegcKFFAggMLRkk2AtWrIQUeix0GPB1b9gOAkwwCQIAIfkECQcAAAAsAAAAACAAIAAABv9AgHBInAw8xKRymVx8Sqcbc8oUEErYU4nKHS4e2LCN0KVmLthR+HQoMxeX0SgUCjcQbuXEEJr3SwYZeUsMIiIhhyIJg0sLGhuGIhsDjEsEjxuQEZVKEhcajxptnEkDn6AagqREGBeuFxCrSQcVFQ4Oi7JDD7a3lLpCDbYNDarADQ4NDw8KwEIGy9C/wAUG1gabzgzXBnjOAwYQEAcHHc4C4+QHDJU0SwnqBQXNeTM07kkSBQfyHwjmZWTMsOfu3hAQ/AogQECAHpUYMAQSxCdkAoEC/hgSACGBCQsWNSDCGDhDyYKFCwkwoJCAwwIBJkykcJGihQoWL0SOXEKCAAZVDCoZRADhgUOGDhIsoHBhE2ROGFMEUABKgCWIAQMUdFiQ1IQLFTdDcrEwQGWCBEOzHn2JwquLFTXcCBhwNsFVox1ILJiwdEUlCwsUDOCQdasFE1yCAAA7AAAAAAAAAAAA",POPUP:"data:image/gif;base64,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"}},CONTROL_POSITION_TYPE:{TOP:1,LEFT:3,RIGHT:7,BOTTOM:10},CONTROL_POSITION_STYLE:{1:{class:"top",direction:"horizontal"},3:{class:"left",direction:"vertical"},7:{class:"right",direction:"vertical"},10:{class:"bottom",direction:"horizontal"}},RESOURCE:{ICON:{BOOKMARK:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAk9QTFRFAAAA019f1WBg1F9f015e02Ji01tb0YCA019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f02Bg019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f019f02Bg02Bg019f015e2nh41Who121t89PT3oiI0l1d02Bg6rGx//7+7Lm502Fh011d3IGB+u7u////+ejo2HJy1Wdn8tDQ/vv74ZKS5aKi/vr68cvL1GRk++/v2nl51GNj78TE5aCg4ZOT/fb29NnZ1mlp2HBw9t/f/PX13YKC67e33oaG+/Hx+OTk129v1mpq9NXV4I2N56mp/vz878PD23x8+uvr+u3t2XZ20lxc1WRk8MrK/v3945qa1GJi1WVl1mtr2HFx2XR023t73H5+3YWF34yM6rKy/fj43H9/8MfH8tHR89TU9NjY9dvb9t7e9+Hh+/Dw+/Ly/PT0/PPz0ltb7sHB89LS45iY1mho12xs9t3d7sLC4paW2Xd32nd37b+/2XV1+uzs9dra7b294I+P1WZm7Lq64I6O6Kqq5Jyc7sDA3YOD4peX6Kys9NbW235+7by8125u5qKi6K2t9+Tk8s/P//3967a234qK7Lu72np63ICA34uL8czM+Obm45mZ3oeH/ff35aGh78bG/Pb2+enp67i43YSE9+Dg89XV2HNz5Jub67W14JCQ1GFh8MjI9+Pj4ZCQ9+Li1mxs2XNz6rS04YmyAAAAADB0Uk5TAAAAAAAAAAAEGx8exuLh9fb8x09Ty3MYeuXzny4DAzKoTQoMUuDk5xqELzOMAgYHg21ZXAAAAAFiS0dEQP7ZXNgAAAAJcEhZcwAAnXsAAJ17ATyfd8QAAARBSURBVHja7dtnVxNBFAZgo6JGBMVesfeWG8CNMQsTAxiVKFhQiiUKVmJDUQHBihXFXlHEhr33Xn6YSYzJJGRnd7MzrkfnfuSEuc++NzuzIYc2bXjx4vV3lqGTsXM8xeps7GRQBzB2SUikWAldjCoB8YkmqpUYzwEcwAEcwAHMAKA3wJyihMAMAKlpUwQ9AZap1mk2HQFiegayT1cwA0YAcGQilJWtYAasADOcCKGZs/QCgNnu7Y9m54g6AVxzfP2Rda5OAMjN8wPQvPmyb0MWAFiw8Fd/lL9I9m3IAmBbbA0A0FQ9RiAWFP7uj4qK5WZAHwBLlgb7I+cyuRkwSGC5OwRAK1x/GgArS7D+qHQVsAeAv0RR8NbqNWvx/mjdeoElwFbmmuVxzN+QWrxxk3nzlvTyrbnbKsIAKM0B7ACwfcfOyqrqXTVF9pKM2t178iqcbmt4f7R3+z4RWAFMjv2R/VqV9UCd+aBFkERoA8ChTDmA91SuPXzk6DGHSQD6ABPUL5QX+BAZ1cezT0RDaL0LoLxBkcC3KZWePHV605kIhObbEI7uUSrwIRqqzp7baKG6D1jOO1UIvFV4gS4APBdlbwW8GurCdmcKOyGkHlDRv/qSie57wCcw1yht754T+ahO5TCCAoW3Qv7yVhszndMQLucr6W/PtlHfBwJlu5Il297aeDXKXkgJAB7ZU8F5rSnaQzqtBxJoqiT3333dw+IsCJXYTOx/Y6sl+nlIDeC6SWh/KzOHzXGMjWCBnXD3394g+RmNFkC4UyENmL1K+sGQ2ghaCBMovCuyBkBKNQGQf495AmJOLQFQUc4eMHcdAZB1nzmg7AFpE3Bnr2YMgKaHJID1EWuA8PgJcR98yhpguh3WL6/x2fOwHzQDY4CjChv4i5evUlynX+OnY4uFLUCszwje8m8evbV4n/xhegs2lbVljAHv3IGLf78oJfC5A1wfaoIhNHrYAj5+8l98ZZ3/4oO3xttgCIcPAksApH72X7wj4pMfuL4EQvj6jSlAuFSSFn7xkSHYi9kmUJ/uiP7Z+3cIpd+ZAkwgSN/n/hBqzcwfSKTLG8LXvVskT6M/8bUdfP9xVccEfIIy6T9X/stfXHIAB3AAB3AAB3AAB/zvgK7ddAUkde/Rs1eSfoCE3n3atjP27acToP+AgYO8qxqSBw/pqgMgqfvQYe3jfK+Naz98hOwcqAN86QeXNBhk50AZEEgfe73cHKgCQumHSm4ONAFh6WO/QpwDPUCr9JXNgRYgWvqK5kAJIJG+gjlQARDSl50DBQA5fbk5aAfIpk+eg1aAovRJc9AGUJo+YQ6aACrSx1YIn4MGgMr0sTXwOcQMUJ9+qPA5xAqIKX1smeAcYgPEnD62UGAOsQC0pB+qwBzUA0aO0pY+tpZ3DqNVA8aMHac1fWy15PET1P6738RJHTSnH6q4jpOTqV0OL168KNdPT4xc9TixAOMAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTgtMDYtMDFUMTE6NTE6NTQrMDI6MDA4JP4+AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE4LTA2LTAxVDExOjUxOjU0KzAyOjAwSXlGggAAAEZ0RVh0c29mdHdhcmUASW1hZ2VNYWdpY2sgNi43LjgtOSAyMDE2LTA2LTE2IFExNiBodHRwOi8vd3d3LmltYWdlbWFnaWNrLm9yZ+a/NLYAAAAYdEVYdFRodW1iOjpEb2N1bWVudDo6UGFnZXMAMaf/uy8AAAAYdEVYdFRodW1iOjpJbWFnZTo6aGVpZ2h0ADUxMsDQUFEAAAAXdEVYdFRodW1iOjpJbWFnZTo6V2lkdGgANTEyHHwD3AAAABl0RVh0VGh1bWI6Ok1pbWV0eXBlAGltYWdlL3BuZz+yVk4AAAAXdEVYdFRodW1iOjpNVGltZQAxNTI3ODQ2NzE0m4Hi+QAAABJ0RVh0VGh1bWI6OlNpemUAOC4xS0JCye1RsgAAAER0RVh0VGh1bWI6OlVSSQBmaWxlOi8vLi91cGxvYWRzLzU2L1d2M0R2VzkvMTUwMS91c2VyYm9va21hcmtzXzEwMzUyOS5wbmfGneeXAAAAAElFTkSuQmCC",CHECKMARK:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNDBweCIgaGVpZ2h0PSIzMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiBzdHlsZT0iYm9yZGVyOjBweCBzb2xpZCAjZmYwMDAwOyI+DQogPHBhdGggZGF0YS1uYW1lPSJzdHJva2UiIGQ9Ik0yOCA0OEwxNC44NzkgMzQuMTIxYTMgMyAwIDAgMSA0LjI0Mi00LjI0M0wyOCAzOWwxOC44My0yMC4wNzJhMyAzIDAgMCAxIDQuMzQgNC4xNDN6Ig0KICBmaWxsPSIjZmYwMDAwIiBzdHJva2U9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCINCiAgc3Ryb2tlLXdpZHRoPSIxIiBzdHlsZT0idHJhbnNmb3JtOnRyYW5zbGF0ZSgtMTNweCwgLTE3cHgpIj48L3BhdGg+DQo8L3N2Zz4="}},BATCHPRINT_SERVICE_API_TYPE:{CUSTOMURI:"customURI",AJAX:"ajax",WEBSOCKET:"websocket"},WATERMARK_TYPE:{NONE:"none",DEFAULT:"",TEXT:"text",IMAGE:"image"},SECURITY_LEVEL_TYPE:{DEFAULT:0,HIGH:1,LOW:255},ERROR_TYPE:{NOT_FOUND_FILE:{type:"NOT_FOUND_FILE",name:"FileNotFoundError",message:"파일을 찾을 수 없습니다.<br/>요청 정보를 확인해주시기 바랍니다."},UNSUPPORTED_TARGET_FILE_FORAMT:{type:"UNSUPPORTED_TARGET_FILE_FORAMT",name:"UnsupportedTargetFileFormatError",message:"이미지 뷰어에서 지원하지 않는 포맷입니다. 파일 포맷 확인 후 다시 이용 부탁드립니다."},INTERNAL_SERVER_ERROR:{type:"INTERNAL_SERVER_ERROR",name:"InternalServerError",message:"API 연동 오류가 발생했습니다.<br/>장애가 지속될 경우 담당자에게 연락 부탁드립니다."},FAIL_CONVERT_FORMAT:{type:"FAIL_CONVERT_FORMAT",name:"FileConvertFormatError",message:"파일 변환 처리 시 오류가 발생했습니다."},IMAGE_PROCESSING_ERROR:{type:"IMAGE_PROCESSING_ERROR",name:"ImageProcessingError",message:"이미지 변환 오류가 발생했습니다."},SERVICE_ERROR:{type:"SERVICE_ERROR",name:"ServiceError",message:"요청하신 업무가 정상적으로 처리되지 않았습니다.<br/>요청 정보를 확인해주시거나,<br/>잠시 후 다시 이용해주시기 바랍니다."}},NOTIFICATION_TYPE:{NONE:"none",SUCCESS:"success",INFO:"info",ERROR:"error",WARNING:"warning"},PAGEMOVE_TRIGGER_TYPE:{MULTISELECT:"multiselect",PRELOAD:"preload"}}}),InziSForm.create(function(i,a,l){"use strict";var n=i.Type,o={BROWSER_MSIE_VERSION:new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),BROWSER_NETSCAPE_VERSION:new RegExp("rv:([0-9]{1,}[.0-9]{0,})"),BROWSER_CHROME_VERSION:new RegExp("Chrome/([0-9]{1,}[.0-9]{0,}[.0-9]{0,}[.0-9]{0,})"),DOCTYPE_MSOFFICE:new RegExp("xls|xlsx|ppt|pptx|doc|docx","gi"),DOCTYPE_AUDIO:new RegExp("amr|dmd|mp3|pdm|3gp|m4a|wma|wav","gi"),DOCTYPE_VIDEO:new RegExp("avi|asf|asx|mpg|mpeg|mpe|mp4|wmv|rm|mov|dat|mkv|skm|k3g|3pg","gi"),DOCTYPE_IMAGE:new RegExp("jpg|jpeg|png|bmp|tiff|tif|jb2|pdf","gi"),DOCTYPE_TXT:new RegExp("txt","gi"),DOCTYPE_HWP:new RegExp("hwp","gi"),DOCTYPE_ADOBE:new RegExp("pdf","gi")};return i.Utils={isNumeric:function(t){return t="string"==typeof t?t.replace(",","."):t,!isNaN(parseFloat(t))&&isFinite(t)&&"[object array]"!==Object.prototype.toString.call(t).toLowerCase()},isFunction:function(t){return"function"==typeof t},isNotEmpty:function(t){t=String(t).trim();return!(null==t||"null"===t||"undefined"===t||""===t||"NaN"===t)},isEmpty:function(t){return!this.isNotEmpty(t)},toNotEmpty:function(t,e){return this.isEmpty(t)?e:"number"==typeof e?this.toInt(t):t},toInt:function(t,e){return this.isNotEmpty(t+="")?(e=e||10,parseInt(t,e)):t},toFloat:function(t,e){if(this.isNotEmpty(t))return e=e||0,"number"==typeof t?parseFloat(t.toFixed(e)):"string"==typeof t?parseFloat(t,e):void 0},mapToString:function(t,e,i){var n,o=[];for(n in e=e||"",i=i||"",t)this.hasOwn(t,n)&&o.push(n+e+t[n]);return o.join(i)},hasOwn:function(t,e){return"hasOwnProperty"in t?t.hasOwnProperty(e):Object.prototype.hasOwnProperty.call(t,e)},hasClass:function(t,e){return!!t.className&&!!~(t.className.baseVal.match(/\S+/g)||[]).indexOf(e)},parent:function(t,e){t=this.parents(t,e,1);return null==t?null:t[0]},parents:function(t,e,i){var n,o=[];for(e&&(n=e.charAt(0));t&&t!==l&&(e?("."===n&&t.classList.contains(e.substr(1))&&o.push(t),"#"===n&&t.id===e.substr(1)&&o.push(t),"["===n&&t.hasAttribute(e.substr(1,e.length-2))&&o.push(t),t.tagName.toLowerCase()===e&&o.push(t)):o.push(t),o.length!==i);t=t.parentNode);var a=o.length;return 0===a?null:o.slice(0,a<i?a:i)},stringByteLength:function(t,e,i,n){for(e=i=0;n=t.charCodeAt(i++);e+=n>>11?3:n>>7?2:1);return e},stringToArrayBuffer:function(){},arrayBufferToString:function(t){return String.fromCharCode.apply(null,new Uint16Array(t))},stringToBase64:function(){},base64ToString:function(t){for(var e="",i=new Uint8Array(t),n=i.byteLength,o=0;o<n;o++)e+=String.fromCharCode(i[o]);return a.btoa(e)},base64ToArrayBuffer:function(t){for(var e=a.atob(t),i=e.length,n=new Uint8Array(i),o=0;o<i;o++)n[o]=e.charCodeAt(o);return n.buffer},arrayBufferToBase64:function(t){for(var e="",i=new Uint8Array(t),n=i.byteLength,o=0;o<n;o++)e+=String.fromCharCode(i[o]);return a.btoa(e)},createDataUrl:function(t,e){return"data:"+t+";base64,"+e},dateFormat:function(e,t){var i,n=this;if(!e.valueOf())return" ";var o=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"];return t.replace(/(yyyy|yy|MM|dd|E|hh|mm|ss|a\/p)/gi,function(t){switch(t){case"yyyy":return e.getFullYear();case"yy":return n.lpad((e.getFullYear()%1e3).toString(),2,"0");case"MM":return n.lpad((e.getMonth()+1).toString(),2,"0");case"dd":return n.lpad(e.getDate().toString(),2,"0");case"E":return o[e.getDay()];case"HH":return n.lpad(e.getHours().toString(),2,"0");case"hh":return n.lpad(((i=e.getHours()%12)?i:12).toString(),2,"0");case"mm":return n.lpad(e.getMinutes().toString(),2,"0");case"ss":return n.lpad(e.getSeconds().toString(),2,"0");case"a/p":return e.getHours()<12?"오전":"오후";default:return t}})},lpad:function(t,e,i){if(!t||t.length>=e)return t;var n=(e-t.length)/i.length;i=i||" ";for(var o=0;o<n;o++)t=i+t;return t},rpad:function(t,e,i){if(!t||t.length>=e)return t;var n=(e-t.length)/i.length;i=i||" ";for(var o=0;o<n;o++)t+=i;return t},extend:function(t,e,i){for(var n in i=void 0!==i&&i,e)e.hasOwnProperty(n)&&(Array.isArray(t[n])||null===t[n]?t[n]=e[n]:t.hasOwnProperty(n)?"object"==typeof t[n]?t[n]=this.extend(t[n],e[n],i):t[n]=e[n]:i&&(t[n]=e[n]));return t},data:function(t,e){if(void 0===t)return this._data;if(void 0!==e)return this._data[t]=e,this;if("object"!=typeof t)return this._data[t];for(var i in t)this._data[i]=t[i];return this},clone:function(e){if(null===e||"object"!=typeof e)return e;var t,i;try{if(!this.isElement(e))for(i in t=e.constructor(),e)e.hasOwnProperty(i)&&(t[i]=this.clone(e[i]))}catch(t){console.log(t,e)}return t},isNode:function(t){return"object"==typeof Node?t instanceof Node:t&&"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},isElement:function(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName},bind:function(t,e,i,n){var o=e.split(" ");n=void 0!==n&&n;for(var a=0,r=o.length;a<r;a++){var s=o[a];this.isNotEmpty(s)&&(l.addEventListener?t.addEventListener(s,i,n):l.attachEvent&&t.attachEvent("on"+s,i))}},unbind:function(t,e,i){for(var n=e.split(" "),o=0,a=n.length;o<a;o++){var r=n[o];this.isNotEmpty(r)&&(l.removeEventListener?t.removeEventListener(r,i):l.attachEvent&&t.detachEvent("on"+r,i))}},namespace:function(t){var e,i=t.split("."),n=InziSForm;for("InziSForm"===i[0]&&(i=i.slice(1)),e=0;e<i.length;e+=1)void 0===n[i[e]]&&(n[i[e]]={}),n=n[i[e]];return n},isMobile:function(){return{Android:function(){return/Android/i.test(navigator.userAgent)},BlackBerry:function(){return/BlackBerry/i.test(navigator.userAgent)},iOS:function(){return/iPhone|iPad|iPod/i.test(navigator.userAgent)},Opera:function(){return/Opera Mini/i.test(navigator.userAgent)},Windows:function(){return/IEMobile/i.test(navigator.userAgent)},any:function(){return this.Android()||this.BlackBerry()||this.iOS()||this.Opera()||this.Windows()}}},isSupportCanvas:function(){return!!a.HTMLCanvasElement||"undefined"===a.G_vmlCanvasManager},isSupportSVG:function(){return!!a.SVGElement},eventStop:function(t){return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),!1},generateId:function(t,e){return(e=e||"__")+t},domReady:function(t){var e=l.addEventListener?"DOMContentLoaded":"onreadystatechange";this.bind(l,e,t)},IEVersion:function(){var t=-1,e=navigator.appName||"",i=navigator.userAgent;return"Microsoft Internet Explorer"===e?null!==o.BROWSER_MSIE_VERSION.exec(i)&&(t=this.toFloat(RegExp.$1)):"Netscape"===e&&-1!==i.indexOf("Trident")&&null!==o.BROWSER_NETSCAPE_VERSION.exec(i)&&(t=this.toFloat(RegExp.$1)),t},ChromeVersion:function(){var t=-1,e=o.BROWSER_CHROME_VERSION,i=navigator.userAgent;return null!==e.exec(i)&&(t=RegExp.$1.substring(0,4),t=this.toFloat(t)),t},isBrowser:function(){return{wIE:function(){return/MSIE|Trident/i.test(navigator.userAgent)},wEdge:function(){return/Edge/i.test(navigator.userAgent)},wChrome:function(){return/Chrome/i.test(navigator.userAgent)},wSafari:function(){return/Safari/i.test(navigator.userAgent)},wOpera:function(){return/Opera/i.test(navigator.userAgent)},wFirefox:function(){return/Firefox/i.test(navigator.userAgent)},anyWeb:function(){return this.wIE()||this.wEdge()||this.wChrome()||this.wSafari()||this.wOpera()},mAndroid:function(){return/Android/i.test(navigator.userAgent)},mBlackBerry:function(){return/BlackBerry/i.test(navigator.userAgent)},mIOS:function(){return/iPhone|iPad|iPod/i.test(navigator.userAgent)},mOpera:function(){return/Opera Mini/i.test(navigator.userAgent)},mWindows:function(){return/IEMobile/i.test(navigator.userAgent)},anyMobileWeb:function(){return this.Android()||this.BlackBerry()||this.iOS()||this.Opera()||this.Windows()}}},getSlope:function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2),Math.pow(t[1]-e[1],2))},getRandomId:function(t){var e=(new Date).getTime();return["__",i.moduleIdPrefix,"_",t?t+"_":"",e].join("")},pxToCm:function(t,e){return t/37.795276},cmToPx:function(t,e){return e=e||n.GraphicUnitReferenceValue.PX,this.convertInchBasedGraphicUnit(this.convertInch(n.GraphicUnitType.INCH,t),n.GraphicUnitType.PX)},inchToPx:function(t){return this.convertInchBasedGraphicUnit(n.GraphicUnitType.PX,t)},mmToPx:function(t,e){return t*(e=e||n.GraphicUnitReferenceValue.PX)/n.GraphicUnitReferenceValue.MM},convertInchBasedGraphicUnit:function(t,e){var i=0;switch(t){case n.GraphicUnitType.INCH:i=e;break;case n.GraphicUnitType.CM:i=e*n.GraphicUnitReferenceValue.CM;break;case n.GraphicUnitType.MM:i=e*n.GraphicUnitReferenceValue.MM;break;case n.GraphicUnitType.PX:i=e*n.GraphicUnitReferenceValue.PX;break;case n.GraphicUnitType.PT:i=e*n.GraphicUnitReferenceValue.PT;break;case n.GraphicUnitType.DXA:i=e*n.GraphicUnitReferenceValue.DXA;break;case n.GraphicUnitType.EMU:i=e*n.GraphicUnitReferenceValue.EMU}return i},convertInch:function(t,e){var i=0;switch(t){case n.GraphicUnitType.INCH:i=e;break;case n.GraphicUnitType.CM:i=e/n.GraphicUnitReferenceValue.CM;break;case n.GraphicUnitType.MM:i=e/n.GraphicUnitReferenceValue.MM;break;case n.GraphicUnitType.PX:i=e/n.GraphicUnitReferenceValue.PX;break;case n.GraphicUnitType.PT:i=e/n.GraphicUnitReferenceValue.PT;break;case n.GraphicUnitType.DXA:i=e/n.GraphicUnitReferenceValue.DXA;break;case n.GraphicUnitType.EMU:i=e/n.GraphicUnitReferenceValue.EMU}return i},generateElementId:function(t,e){return"__"+i.moduleIdPrefix+"_"+t+"__"+e},globalLocation:function(){var t,e=a.location;if(void 0!==e)return t=e.protocol,{protocol:t=t.substring(0,t.length-1),hostname:e.hostname,port:e.port,pathname:e.pathname}},hex2rgba:function(t,e){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},hex2rgbaToString:function(e,t){return"rgba("+(e=e.replace("#","")).match(new RegExp("(.{"+e.length/3+"})","g")).map(function(t){return parseInt(e.length%2?t+t:t,16)}).concat(t||1).join(",")+")"},rgba2hex:function(t){function e(t,e){t=Math.max(0,parseInt(t,10));return e?Math.floor(255*Math.min(100,t)/100):Math.min(255,t)}var i="";return i=(t=/^rgb\(\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*\)$/.exec(t))?"#0x"+(16777216+(e(t[1],t[2])<<16)+(e(t[3],t[4])<<8)+e(t[5],t[6])).toString(16).slice(1):i},getEventTarget:function(t){return t.target||t.srcElement},color:function(){return""},hsl:function(){return""},rgb:function(){return""},svgCursorPoint:function(t,e,i){var n=t.createSVGPoint();return n.x=e,n.y=i,n.matrixTransform(t.getScreenCTM().inverse())},svgCoordinateTransform:function(t,e){e=e.getScreenCTM();return t.matrixTransform(e.inverse())},svgGlobalToLocalPoint:function(t,e){t=t.getTransformToElement(t).inverse();return t.e=t.f=0,e.matrixTransform(t)},getDocType:function(t){var e="",t=(t=this.toNotEmpty(t,"")).substring(t.lastIndexOf(".")+1,t.length);return new RegExp("jpg|jpeg|png|bmp|tiff|tif|jb2|pdf","gi").test(t)?e="image":new RegExp("xls|xlsx|ppt|pptx|doc|docx","gi").test(t)?e="msoffice":new RegExp("amr|dmd|mp3|pdm|3gp|m4a|wma|wav","gi").test(t)?e="audio":new RegExp("avi|asf|asx|mpg|mpeg|mpe|mp4|wmv|rm|mov|dat|mkv|skm|k3g|3pg","gi").test(t)?e="video":new RegExp("txt","gi").test(t)?e="txt":new RegExp("hwp","gi").test(t)?e="hwp":new RegExp("pdf","gi").test(t)&&(e="adobe"),e},generateUUID:function(){var i=(new Date).getTime(),n=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random();return 0<i?(e=(i+e)%16|0,i=Math.floor(i/16)):(e=(n+e)%16|0,n=Math.floor(n/16)),("x"===t?e:3&e|8).toString(16)})},validatePageRanges:function(t){if(!/^((\d{1})?([-,]?[0-9])+)$/.test(t))return!1;for(var e,i=!0,n=(t||"").split(","),o=0;o<n.length;o++){var a,r=n[o].trim();if(a=-1!=r.indexOf("-")?2==(a=r.split("-")).length?(e=this.isNumeric(a[0])?this.toInt(a[0]):0,this.isNumeric(a[1])?this.toInt(a[1]):0):e=0:e=this.isNumeric(r)?this.toInt(r):0,0==e||0==a||a<e){i=!1;break}}return i},toPageRanges:function(t){for(var e,i=[],n=(t||"").split(","),o=0;o<n.length;o++){var a,r,s=n[o].trim();r=-1!=s.indexOf("-")?2==(a=s.split("-")).length?(e=this.isNumeric(a[0])?this.toInt(a[0]):0,this.isNumeric(a[1])?this.toInt(a[1]):0):e=0:e=this.isNumeric(s)?this.toInt(s):0;for(var l=e;l<=r;l++)0<l&&-1===i.indexOf(l)&&i.push(l)}return i=i.sort(function(t,e){return t-e})}}}),InziSForm.create(function(t,M,k){"use strict";var a=t.Utils;t.ImageUtils={createCanvasByImage:function(t){var e=k.createElement("canvas"),i=e.getContext("2d"),n=t.width,o=t.height;return e.width=n,e.height=o,i.drawImage(t,0,0,n,o),e},cropToImage:function(t,e){var i=new Image;return i.src=this.cropToDataURL(t,e),i.width=a.toInt(e.width*(1/e.sx)),i.height=a.toInt(e.height*(1/e.sy)),i},downScale:function(t,c,p,e,d){if(!M.Float32Array)return t;if(1<e||d<0)return t;for(var g,u,f,m,y,i,n,o,v=e*d,a=Math.floor(c*e),I=Math.floor(p*d),_=0,A=0,b=0,r=0,s=0,l=0,T=0,x=0,w=0,N=0,E=t,h=new Float32Array(3*a*I),A=0;A<p;A++)for(u=3*(f=0|(g=A*d))*a,(y=f!=(0|g+d))&&(w=1+f-g,N=g+d-f-1),_=0;_<c;_++,b+=4)r=u+3*(n=0|(i=_*e)),(m=n!=(0|i+e))&&(T=1+n-i,x=i+e-n-1),i=E[b],n=E[b+1],o=E[b+2],m||y?m&&!y?(h[r]+=i*(s=T*e),h[r+1]+=n*s,h[r+2]+=o*s,h[r+3]+=i*(l=x*e),h[r+4]+=n*l,h[r+5]+=o*l):y&&!m?(h[r]+=i*(s=w*d),h[r+1]+=n*s,h[r+2]+=o*s,h[r+3*a]+=i*(l=N*d),h[r+3*a+1]+=n*l,h[r+3*a+2]+=o*l):(h[r]+=i*(s=T*w),h[r+1]+=n*s,h[r+2]+=o*s,h[r+3]+=i*(l=x*w),h[r+4]+=n*l,h[r+5]+=o*l,h[r+3*a]+=i*(l=T*N),h[r+3*a+1]+=n*l,h[r+3*a+2]+=o*l,h[r+3*a+3]+=i*(l=x*N),h[r+3*a+4]+=n*l,h[r+3*a+5]+=o*l):(h[r]+=i*v,h[r+1]+=n*v,h[r+2]+=o*v);for(var t=k.createElement("canvas"),t=(t.width=a,t.height=I,t.getContext("2d")),C=t.getImageData(0,0,a,I),P=C.data,S=0,b=0,r=0;S<a*I;b+=3,r+=4,S++)P[r]=Math.ceil(h[b]),P[r+1]=Math.ceil(h[b+1]),P[r+2]=Math.ceil(h[b+2]),P[r+3]=255;return t.putImageData(C,0,0),t.getImageData(0,0,a,I)},cropToDataURL:function(t,e){var i=k.createElement("canvas"),n=i.getContext("2d"),o=e.contentType||"image/png",t=(i.width=a.toInt(e.width),i.height=a.toInt(e.height),this.getImageData(t,a.toInt(e.x),a.toInt(e.y),a.toInt(e.width),a.toInt(e.height)));return n.putImageData(t,0,0),i.toDataURL(o)},getImageData:function(t,e,i,n,o){t=t.getContext("2d");return n=n||t.canvas.width,o=o||t.canvas.height,t.getImageData(e=e||0,i=i||0,n,o)},watermark:function(t,e){var i,n,o,a,r,s,l,h;t&&(i=(n=t.canvas).width,n=n.height,a=e.message,t.font=(o=n/5)+"px bold",t.fillStyle="rgba(213, 213, 213, "+e.opacity+")",t.setTransform(1,0,0,1,0,0),r=(s=t.measureText(a)).width,s.height,s=i/2-r/2,l=n/2+o/2,"top"===(h=(e=e.position.split(" "))[0])?l=o:"center"===h?l=n/2+o/2:"bottom"===h&&(l=n-o/2),"left"===(h=e[1])?s=0:"center"===h?s=i/2-r/2:"right"===h&&(s=i-r),t.fillText(a,s,l),t.restore())}}}),InziSForm.create(function(t,e,i){"use strict";return t.DateUtils={now:function(){return(new Date).getTime()}}}),InziSForm.create(function(t){"use strict";function e(){this._listenerId=t.generateListenerId(),this.listeners={},this.listenerIndex=0}var p=t.Utils,d=["click","contextmenu","dblclick","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","touchstart","touchend","touchmove","touchcancel","gesturestart","gesturechange","gestureend","pointerover","pointerenter","pointerdown","pointermove","pointerup","pointercancel","pointerout","pointerleave","gotpointercapture","lostpointercapture","MSPointerDown","MSPointerMove","MSPointerUp","focus","blur","focusin","focusout","change","keydown","keyup","scroll","orientationchange"];return e.prototype={trigger:function(t,e){for(var i in this.listeners)this.listeners.hasOwnProperty(i)&&i.split("-")[0]===t&&this.listeners[i].callback(e)},listenerId:function(t){return this._listenerId},_uniqueId:function(t){return this.listenerIndex++,t+"-"+this.listenerIndex},on:function(t,e,i,n){for(var o=[],a={callback:e,event:null,target:i},r=t.split(" "),s=0,c=r.length;s<c;s++){var l=r[s],h=this._uniqueId(l),l=(a.event=r[s],this.listeners[h]=a,-1!==l.indexOf(".")?l.substring(0,l.indexOf(".")):l);-1!==d.indexOf(l)&&i&&p.bind(i,l,e,n),o.push(h)}return o},multyOff:function(t){for(var e=0,i=t.length;e<i;e++){var n=t[e],n=this.listeners[n];this._off(n.event,n.target)}},off:function(t,e){for(var i=t.split(" "),n=0,o=i.length;n<o;n++){var a=i[n];this._off(a,e)}},_off:function(t,e){for(var i in this.listeners){var n,o;this.listeners.hasOwnProperty(i)&&(i.split("-")[0]!==t&&t!==i||((n=this.listeners[i])&&n.target&&e===n.target&&(o=-1!==(o=i.split("-")[0]).indexOf(".")?o.substring(0,o.indexOf(".")):o,p.unbind(n.target,o,n.callback)),delete this.listeners[i]))}},hasEvent:function(t,e){var i,n=!1;for(i in this.listeners)if(this.listeners.hasOwnProperty(i)){var o=this.listeners[i];if(o.event===t)if(o&&o.target){if(e===o.target){n=!0;break}}else if(!e){n=!0;break}}return n}},t.Events=e,t.Events}),InziSForm.create(function(t){"use strict";function e(){this._events=null}e.prototype={trigger:function(t,e){this._events.trigger(t,e)},on:function(t,e,i){return this._events.on(t,e,i)},off:function(t,e){this._events.off(t,e)}},t.EventHandler=e}),InziSForm.create(function(t,e,i){"use strict";t.ImageUtils;t.Filter={Type:{BRIGHTNESS:"brightness",GRAYSCALE:"grayscale",INVERT:"invert",CONSTRAST:"constrast"},getImageData:function(t,e,i,n,o){t=t.getContext("2d");return n=n||t.canvas.width,o=o||t.canvas.height,t.getImageData(e=e||0,i=i||0,n,o)},putImageData:function(t,e,i,n){t.getContext("2d").putImageData(e,i||0,n||0)},invert:function(t,e){for(var i=this.getImageData(t),n=i.data,o=0,a=n.length,o=0;o<a;o+=4)n[o]=255-n[o],n[o+1]=255-n[o+1],n[o+2]=255-n[o+2];this.putImageData(t,i,0,0)},brightness:function(t,e){var i=this.getImageData(t),n=i.data,o=0,a=n.length;for(e=e||10,o=0;o<a;o+=4)n[o]+=e,n[o+1]+=e,n[o+2]+=e;this.putImageData(t,i,0,0)},grayscale:function(t,e){for(var i=this.getImageData(t),n=i.data,o=0,a=n.length,o=0;o<a;o+=4){var r=.34*n[o]+.5*n[o+1]+.16*n[o+2];n[o]=r,n[o+1]=r,n[o+2]=r}this.putImageData(t,i,0,0)},contrast:function(t,e){for(var i=this.getImageData(t),n=i.data,o=0,a=n.length,r=(e=e||10,255+(e*=2.55)),o=0;o<a;o+=4)n[o]=r*(n[o]-128)+128,n[o+1]=r*(n[o+1]-128)+128,n[o+2]=r*(n[o+2]-128)+128;this.putImageData(t,i,0,0)},flip:function(t,e){this.getImageData(t).data.length;var i=t.getContext("2d"),n=i.canvas.width,o=i.canvas.height,a=new Image,t=(a.src=t.toDataURL(),e?1:-1),r=e?-1:1,s=e?0:-1*n,e=e?-1*o:0;i.save(),i.setTransform(1,0,0,1,0,0),i.scale(t,r),i.drawImage(a,s,e,n,o),i.restore()}}}),InziSForm.create(function(t,a,s){"use strict";var f=t.Utils,r=(f.IEVersion(),"canvas");function i(t,e){if(t&&e)for(var i=0,n=e.length;i<n;i++)e[i]&&e[i].parentNode&&e[i].parentNode.removeChild(e[i])}t.Element={createElementNS:function(t,e,i){var n,o=s.createElementNS("http://www.w3.org/2000/svg",e);for(n in i)i.hasOwnProperty(n)&&o.setAttribute(n,i[n]);return t.appendChild(o)},createElement:function(t,e,i){var n,o=s.createElement(t);for(n in e)e.hasOwnProperty(n)&&o.setAttribute(n,e[n]);return i&&(t!==r||f.isSupportCanvas()||a.G_vmlCanvasManager.initElement&&(o=a.G_vmlCanvasManager.initElement(o)),i.appendChild(o)),o},appendToElement:function(t,e,i){var n,o=s.createElement(e);for(n in i)i.hasOwnProperty(n)&&o.setAttribute(n,i[n]);return e!==r||f.isSupportCanvas()||a.G_vmlCanvasManager.initElement&&(o=a.G_vmlCanvasManager.initElement(o)),t.appendChild(o)},createCanvas:function(t,e){var i,n=s.createElement(r);for(i in t)t.hasOwnProperty(i)&&n.setAttribute(i,t[i]);return e.appendChild(n),n},insertBefore:function(t,e){t.parentNode.insertBefore(e,t)},insertAfter:function(t,e){t.parentNode.insertBefore(e,t.nextSibling)},appendChild:function(t,e){t.appendChild(e)},empty:function(t){var e=t.parentNode;e&&i(e,[t])},attr:function(t,e,i){if("string"==typeof e&&2===arguments.length)return t.getAttribute?t.getAttribute(e):null;if("string"==typeof e&&i)t.setAttribute(e,i);else for(var n in e)e.hasOwnProperty(n)&&t.setAttribute(n,e[n]);return t},removeAttr:function(t,e){return t.hasOwnProperty(e)&&t.removeAttribute(e),t},prop:function(t,e,i){if("string"==typeof e&&i)return t[e]=i,t;if("string"!=typeof e||i){for(var n in e)e.hasOwnProperty(n)&&void 0!==t[n]&&(t[n]=e[n]);return t}return t[e]},rect:function(t,e){return t.nodeName===r?this.createCanvasElement(t,"rect",e):this.createElementNS(t,"rect",e)},circle:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"rect",i):this.createElementNS(t,"circle",i)},ellipse:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"ellipse",i):this.createElementNS(t,"ellipse",i)},line:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"line",i):this.createElementNS(t,"line",i)},polygon:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"polygon",i):this.createElementNS(t,"polygon",i)},polyline:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"polyline",i):this.createElementNS(t,"polyline",i)},path:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"path",i):this.createElementNS(t,"path",i)},text:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"text",i):this.createElementNS(t,"text",i)},image:function(t,e,i){return t.nodeName===r?this.createCanvasElement(t,"image",i):this.createElementNS(t,"image",i)},bBox:function(t,e){for(var i=e.getTransformToElement(t),e=e.getBBox(),t=t.createSVGPoint(),n=[],o=(t.x=e.x,t.y=e.y,n.push(t.matrixTransform(i)),t.x=e.x+e.width,t.y=e.y,n.push(t.matrixTransform(i)),t.x=e.x+e.width,t.y=e.y+e.height,n.push(t.matrixTransform(i)),t.x=e.x,t.y=e.y+e.height,n.push(t.matrixTransform(i)),n[0].x),a=n[0].x,r=n[0].y,c=n[0].y,s=1;s<n.length;s++){var l=n[s].x,h=n[s].y;l<o?o=l:a<l&&(a=l),h<r?r=h:c<h&&(c=h)}return e.x=o,e.y=r,e.width=a-o,e.height=c-r,e},transformToElement:function(t,e){for(var i=t.getCTM(),n=t.getParentNode();n!==e;)i=t.getCTM().multiply(i),t=t.getParentNode();return i},limit:function(t,e,i,n,o,a,r,s){return{x:t=(t=r-i<t?r-i:t)<o?o:t,y:e=(e=s-n<e?s-n:e)<a?a:e}},select:function(t,e){return e instanceof HTMLBodyElement?e:t.querySelector(e)},selectAll:function(t,e){return e instanceof HTMLBodyElement?[e]:t.querySelectorAll(e)},getById:function(t){return s.getElementById(t)},remove:function(t,e){e=e||s.body,(t="string"==typeof t?this.select(e,t):t)&&i(e,[t])},removeAll:function(t,e){e=e||s.body;t=this.selectAll(e,t);t&&i(e,t)},addClass:function(t,e){for(var i=this.getClassNames(t),n=e.split(" "),o=i.split(" "),a="",r=0,s=n.length;r<s;r++){var l=n[r];-1===o.indexOf(l)&&(a=(t.className&&t.className.baseVal,a+" "+l))}return t.className&&void 0!==t.className.baseVal?t.className.baseVal=i+" "+a:t.className=i+" "+a,this},getClassNames:function(t){return t?(t=(t=t.className)instanceof SVGAnimatedString?t.baseVal:t,f.toNotEmpty(t,"")):""},hasClass:function(t,e){var t=this.getClassNames(t);return!!t&&(void 0!==(t=t.match(/\S+/g)||[])&&-1!==t.indexOf(e))},removeClass:function(t,e){var i;t.className&&(-1===(i=this.getClassNames(t)||"").indexOf(e)||(e=new RegExp("(\\s|^)"+e+"(\\s|$)"),i=(i=i.replace(e," ")).replace(/ +/g," "),t.className&&t.className.baseVal?t.className.baseVal=i:t.className=i))},parent:function(t,e){t=this.parents(t,e,1);return null===t?null:t[0]},parents:function(t,e,i){var n,o,a=[];for(e&&(n=e.charAt(0));t&&t!==s;t=t.parentNode)if(e?("."!==n||((o=t.getAttribute("class")||"")?o.split(/\s+/):[]).contains(e.substr(1))&&a.push(t),"#"===n&&t.id===e.substr(1)&&a.push(t),"["===n&&t.hasAttribute(e.substr(1,e.length-2))&&a.push(t),t.tagName.toLowerCase()===e&&a.push(t)):a.push(t),a.length===i)break;var r=a.length;return 0===r?null:a.slice(0,r<i?r:i)},__getOffset:function(t,e){var i=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.getComputedStyle&&t.ownerDocument.defaultView.getComputedStyle(t,null),n=i&&i.getPropertyValue(e?"height":"width")||"";return n=n&&-1<n.indexOf(".")?f.toFloat(n)+f.toInt(i.getPropertyValue(e?"padding-top":"padding-left"))+f.toInt(i.getPropertyValue(e?"padding-bottom":"padding-right"))+f.toInt(i.getPropertyValue(e?"border-top-width":"border-left-width"))+f.toInt(i.getPropertyValue(e?"border-bottom-width":"border-right-width")):e?t.offsetHeight:t.offsetWidth},_getOffsetWidth:function(t){return this.__getOffset(t)},_getOffsetHeight:function(t){return this.__getOffset(t,!0)},offset:function(t){return{width:this._getOffsetWidth(t),height:this._getOffsetHeight(t)}},width:function(t,e){if(!e)return this._getOffsetWidth(t);this.prop(t.style,"width",e)},height:function(t,e){if(!e)return this._getOffsetHeight(t);this.prop(t.style,"height",e)},getElementNode:function(t){return"string"==typeof t?this.select(s.body,t):t instanceof a.Node||t instanceof a.Element?t:void 0},convertTextareaLineBreakList:function(t,e,i,n,o){var a=this.createElement("textarea",{},s.body),o=(a.style.position="absolute",a.style.left="-99999px",a.style.width=e+"px",a.style.height=(i||150)+"px",a.style.fontSize=(n||10)+"px",a.style.fontFamily=o||"Arial",a.value=t,this.textareaLineBreakListByCanvas(a,e,i,n));return this.remove(a,s.body),o},textareaLineBreakListByCanvas:function(t,e,i,c,p){var n=[],o="",d=t.value.split("\n"),g=t.offsetWidth,a=this.createElement("canvas"),r=(a.width=e,a.height=i,a.getContext("2d"));r.font=c+"px "+(t.style.fontFamily||"Arial");for(var s=0;s<d.length;s++){var l=d[s],o="";if(l)for(var h=0;h<l.length;h++){var u=l[h];o+=u,r.fillText(o,0,0),g<=f.toInt(r.measureText(o).width)+f.toInt(c)/3&&(o=o.substring(0,o.length-1),n.push(o),r.clearRect(0,0,e,i),o=u),0<o.length&&h===l.length-1&&n.push(o)}else n.push("")}return a&&this.remove(a),n},textareaLineBreakList:function(t){var e=[],i="",n=t.value,o=n.split("\n"),c=t.offsetWidth,a=t;if(a.setAttribute("wrap","off"),t.value="",0<o.length){for(var r=0;r<o.length;r++){var s=o[r];if(i="",s)for(var l=0;l<s.length;l++){var h=s[l],p=(i+=h,a.value=i,a.scrollWidth);c<=p&&(i=i.substring(0,i.length-1),e.push(i),i=h,a.value=h),0<i.length&&l===s.length-1&&e.push(i)}else e.push("")}return t.setAttribute("wrap",""),t.value=n,e}return e},getEventTarget:function(t){return t.target||t.srcElement},getPointer:function(t){var e,i;return t.touches||t.changedTouches?1===t.touches.length?(e=t.targetTouches[0].pageX,i=t.targetTouches[0].pageY):t.changedTouches&&(e=t.changedTouches[0].pageX,i=t.changedTouches[0].pageY):(e=t.pageX,i=t.pageY),{x:e,y:i}},getPageX:function(t){for(var e=0;t.offsetParent;)e+=t.offsetLeft,t=t.offsetParent;return e},getPageY:function(t){for(var e=0;t.offsetParent;)e+=t.offsetTop,t=t.offsetParent;return e},getOffsetX:function(t){var e=t.target||t.srcElement,i=e.currentStyle||a.getComputedStyle(e,null),i=parseInt(i.borderLeftWidth,10),e=e.getBoundingClientRect();return t.layerX-i-e.left},getOffsetY:function(t){var e=t.target||t.srcElement,i=e.currentStyle||a.getComputedStyle(e,null),i=parseInt(i.borderTopWidth,10),e=e.getBoundingClientRect();return t.layerY-i-e.top},getLayerX:function(t){return t.changedTouches&&t.changedTouches[0]?t.changedTouches[0].clientX:(!t.layerX||a.parent!==a)&&a.event.offsetX||t.offsetX},getLayerY:function(t){return t.changedTouches&&t.changedTouches[0]?t.changedTouches[0].clientY:(!t.layerY||a.parent!==a)&&a.event.offsetY||t.offsetY},animate:function(t,e,i){i=f.extend({name:"",delay:0,direction:"normal",duration:0,easing:"linear",endDelay:0,fill:"none",iterationStart:.5,iterations:1/0,iterationCount:1},i),(t="string"==typeof t?this.select(s.body,t):t).style.transitionDelay=i.delay+"ms",t.style.transitionDuration=i.duration+"ms",t.style.transitionTimingFunction=i.easing;for(var n=0,o=e.length,n=0;n<o;n++){var a,r=e[n];for(a in r)t.style[a]=r[a]}},transform:function(t,e){"string"==typeof transform?(t.style["transform-origin"]=e,t.style.transform=e,t.style["-ms-transform"]=e,t.style["-webkit-transform"]=e):((e=e||{}).transformOrigin&&(t.style["transform-origin"]=e.transformOrigin),e.transform&&(t.style.transform=e.transform,t.style["-ms-transform"]=e.transform,t.style["-webkit-transform"]=e.transform))}}}),InziSForm.create(function(t,e,i){"use strict";t.Utils;function n(t){this._domNode=t}var o=t.Element;n.prototype={createElementNS:function(t,e){return o.createElementNS(this._domNode,t,e)},createElement:function(t,e){return o.createElement(t,e,this._domNode)},appendToElement:function(t,e){return o.appendToElement(this._domNode,t,e)},createCanvas:function(t,e,i){return o.createCanvas(i,this._domNode)},attr:function(t,e){return o.attr(this._domNode,t,e)},removeAttr:function(t){return o.removeAttr(this._domNode,t),this},prop:function(){var t=Array.prototype.slice.call(arguments,0),e=arguments.length;return(1===e||2===e&&"string"==typeof arguments[1])&&(t=[this._domNode].concat(t)),o.prop.apply(this,t)},remove:function(t,e){return o.remove(this._domNode,t,e)},removeAll:function(t,e){return o.removeAll(this._domNode,t,e)},addClass:function(t){return o.addClass(this._domNode,t),this},getClassNames:function(){return o.getClassNames(this._domNode)},hasClass:function(t){return o.hasClass(this._domNode,t)},removeClass:function(t){return o.removeClass(this._domNode,t),this},parent:function(t){return o.parent(this._domNode,t)},parents:function(t,e){return o.parents(this._domNode,t,e)},offset:function(){return o.offset(this._domNode)},insertBefore:function(t){return o.insertBefore(this._domNode,t),this},insertAfter:function(t){return o.insertAfter(this._domNode,t),this},empty:function(t){var e=[];if(t)e.push(t);else{if(!this._domNode.firstChild)return;e.push(this._domNode.firstChild)}o.empty.apply(this,e)},animate:function(t,e){o.animate(this._domNode,t,e)}},t.DOMWrapper=n}),InziSForm.create(function(j,t,Z){"use strict";var $=j.Utils,tt=j.Type,et=j.Element,it=j.moduleName,v=j.moduleClassName,nt=et.attr,d=[["63,0,72,4,72,15,63,19,54,15,54,4","#003366"],["81,0,90,4,90,15,81,19,72,15,72,4","#336699"],["99,0,108,4,108,15,99,19,90,15,90,4","#3366CC"],["117,0,126,4,126,15,117,19,108,15,108,4","#003399"],["135,0,144,4,144,15,135,19,126,15,126,4","#000099"],["153,0,162,4,162,15,153,19,144,15,144,4","#0000CC"],["171,0,180,4,180,15,171,19,162,15,162,4","#000066"],["54,15,63,19,63,30,54,34,45,30,45,19","#006666"],["72,15,81,19,81,30,72,34,63,30,63,19","#006699"],["90,15,99,19,99,30,90,34,81,30,81,19","#0099CC"],["108,15,117,19,117,30,108,34,99,30,99,19","#0066CC"],["126,15,135,19,135,30,126,34,117,30,117,19","#0033CC"],["144,15,153,19,153,30,144,34,135,30,135,19","#0000FF"],["162,15,171,19,171,30,162,34,153,30,153,19","#3333FF"],["180,15,189,19,189,30,180,34,171,30,171,19","#333399"],["45,30,54,34,54,45,45,49,36,45,36,34","#669999"],["63,30,72,34,72,45,63,49,54,45,54,34","#009999"],["81,30,90,34,90,45,81,49,72,45,72,34","#33CCCC"],["99,30,108,34,108,45,99,49,90,45,90,34","#00CCFF"],["117,30,126,34,126,45,117,49,108,45,108,34","#0099FF"],["135,30,144,34,144,45,135,49,126,45,126,34","#0066FF"],["153,30,162,34,162,45,153,49,144,45,144,34","#3366FF"],["171,30,180,34,180,45,171,49,162,45,162,34","#3333CC"],["189,30,198,34,198,45,189,49,180,45,180,34","#666699"],["36,45,45,49,45,60,36,64,27,60,27,49","#339966"],["54,45,63,49,63,60,54,64,45,60,45,49","#00CC99"],["72,45,81,49,81,60,72,64,63,60,63,49","#00FFCC"],["90,45,99,49,99,60,90,64,81,60,81,49","#00FFFF"],["108,45,117,49,117,60,108,64,99,60,99,49","#33CCFF"],["126,45,135,49,135,60,126,64,117,60,117,49","#3399FF"],["144,45,153,49,153,60,144,64,135,60,135,49","#6699FF"],["162,45,171,49,171,60,162,64,153,60,153,49","#6666FF"],["180,45,189,49,189,60,180,64,171,60,171,49","#6600FF"],["198,45,207,49,207,60,198,64,189,60,189,49","#6600CC"],["27,60,36,64,36,75,27,79,18,75,18,64","#339933"],["45,60,54,64,54,75,45,79,36,75,36,64","#00CC66"],["63,60,72,64,72,75,63,79,54,75,54,64","#00FF99"],["81,60,90,64,90,75,81,79,72,75,72,64","#66FFCC"],["99,60,108,64,108,75,99,79,90,75,90,64","#66FFFF"],["117,60,126,64,126,75,117,79,108,75,108,64","#66CCFF"],["135,60,144,64,144,75,135,79,126,75,126,64","#99CCFF"],["153,60,162,64,162,75,153,79,144,75,144,64","#9999FF"],["171,60,180,64,180,75,171,79,162,75,162,64","#9966FF"],["189,60,198,64,198,75,189,79,180,75,180,64","#9933FF"],["207,60,216,64,216,75,207,79,198,75,198,64","#9900FF"],["18,75,27,79,27,90,18,94,9,90,9,79","#006600"],["36,75,45,79,45,90,36,94,27,90,27,79","#00CC00"],["54,75,63,79,63,90,54,94,45,90,45,79","#00FF00"],["72,75,81,79,81,90,72,94,63,90,63,79","#66FF99"],["90,75,99,79,99,90,90,94,81,90,81,79","#99FFCC"],["108,75,117,79,117,90,108,94,99,90,99,79","#CCFFFF"],["126,75,135,79,135,90,126,94,117,90,117,79","#CCCCFF"],["144,75,153,79,153,90,144,94,135,90,135,79","#CC99FF"],["162,75,171,79,171,90,162,94,153,90,153,79","#CC66FF"],["180,75,189,79,189,90,180,94,171,90,171,79","#CC33FF"],["198,75,207,79,207,90,198,94,189,90,189,79","#CC00FF"],["216,75,225,79,225,90,216,94,207,90,207,79","#9900CC"],["9,90,18,94,18,105,9,109,0,105,0,94","#003300"],["27,90,36,94,36,105,27,109,18,105,18,94","#009933"],["45,90,54,94,54,105,45,109,36,105,36,94","#33CC33"],["63,90,72,94,72,105,63,109,54,105,54,94","#66FF66"],["81,90,90,94,90,105,81,109,72,105,72,94","#99FF99"],["99,90,108,94,108,105,99,109,90,105,90,94","#CCFFCC"],["117,90,126,94,126,105,117,109,108,105,108,94","#FFFFFF"],["135,90,144,94,144,105,135,109,126,105,126,94","#FFCCFF"],["153,90,162,94,162,105,153,109,144,105,144,94","#FF99FF"],["171,90,180,94,180,105,171,109,162,105,162,94","#FF66FF"],["189,90,198,94,198,105,189,109,180,105,180,94","#FF00FF"],["207,90,216,94,216,105,207,109,198,105,198,94","#CC00CC"],["225,90,234,94,234,105,225,109,216,105,216,94","#660066"],["18,105,27,109,27,120,18,124,9,120,9,109","#336600"],["36,105,45,109,45,120,36,124,27,120,27,109","#009900"],["54,105,63,109,63,120,54,124,45,120,45,109","#66FF33"],["72,105,81,109,81,120,72,124,63,120,63,109","#99FF66"],["90,105,99,109,99,120,90,124,81,120,81,109","#CCFF99"],["108,105,117,109,117,120,108,124,99,120,99,109","#FFFFCC"],["126,105,135,109,135,120,126,124,117,120,117,109","#FFCCCC"],["144,105,153,109,153,120,144,124,135,120,135,109","#FF99CC"],["162,105,171,109,171,120,162,124,153,120,153,109","#FF66CC"],["180,105,189,109,189,120,180,124,171,120,171,109","#FF33CC"],["198,105,207,109,207,120,198,124,189,120,189,109","#CC0099"],["216,105,225,109,225,120,216,124,207,120,207,109","#993399"],["27,120,36,124,36,135,27,139,18,135,18,124","#333300"],["45,120,54,124,54,135,45,139,36,135,36,124","#669900"],["63,120,72,124,72,135,63,139,54,135,54,124","#99FF33"],["81,120,90,124,90,135,81,139,72,135,72,124","#CCFF66"],["99,120,108,124,108,135,99,139,90,135,90,124","#FFFF99"],["117,120,126,124,126,135,117,139,108,135,108,124","#FFCC99"],["135,120,144,124,144,135,135,139,126,135,126,124","#FF9999"],["153,120,162,124,162,135,153,139,144,135,144,124","#FF6699"],["171,120,180,124,180,135,171,139,162,135,162,124","#FF3399"],["189,120,198,124,198,135,189,139,180,135,180,124","#CC3399"],["207,120,216,124,216,135,207,139,198,135,198,124","#990099"],["36,135,45,139,45,150,36,154,27,150,27,139","#666633"],["54,135,63,139,63,150,54,154,45,150,45,139","#99CC00"],["72,135,81,139,81,150,72,154,63,150,63,139","#CCFF33"],["90,135,99,139,99,150,90,154,81,150,81,139","#FFFF66"],["108,135,117,139,117,150,108,154,99,150,99,139","#FFCC66"],["126,135,135,139,135,150,126,154,117,150,117,139","#FF9966"],["144,135,153,139,153,150,144,154,135,150,135,139","#FF6666"],["162,135,171,139,171,150,162,154,153,150,153,139","#FF0066"],["180,135,189,139,189,150,180,154,171,150,171,139","#CC6699"],["198,135,207,139,207,150,198,154,189,150,189,139","#993366"],["45,150,54,154,54,165,45,169,36,165,36,154","#999966"],["63,150,72,154,72,165,63,169,54,165,54,154","#CCCC00"],["81,150,90,154,90,165,81,169,72,165,72,154","#FFFF00"],["99,150,108,154,108,165,99,169,90,165,90,154","#FFCC00"],["117,150,126,154,126,165,117,169,108,165,108,154","#FF9933"],["135,150,144,154,144,165,135,169,126,165,126,154","#FF6600"],["153,150,162,154,162,165,153,169,144,165,144,154","#FF5050"],["171,150,180,154,180,165,171,169,162,165,162,154","#CC0066"],["189,150,198,154,198,165,189,169,180,165,180,154","#660033"],["54,165,63,169,63,180,54,184,45,180,45,169","#996633"],["72,165,81,169,81,180,72,184,63,180,63,169","#CC9900"],["90,165,99,169,99,180,90,184,81,180,81,169","#FF9900"],["108,165,117,169,117,180,108,184,99,180,99,169","#CC6600"],["126,165,135,169,135,180,126,184,117,180,117,169","#FF3300"],["144,165,153,169,153,180,144,184,135,180,135,169","#FF0000"],["162,165,171,169,171,180,162,184,153,180,153,169","#CC0000"],["180,165,189,169,189,180,180,184,171,180,171,169","#990033"],["63,180,72,184,72,195,63,199,54,195,54,184","#663300"],["81,180,90,184,90,195,81,199,72,195,72,184","#996600"],["99,180,108,184,108,195,99,199,90,195,90,184","#CC3300"],["117,180,126,184,126,195,117,199,108,195,108,184","#993300"],["135,180,144,184,144,195,135,199,126,195,126,184","#990000"],["153,180,162,184,162,195,153,199,144,195,144,184","#800000"],["171,180,180,184,180,195,171,199,162,195,162,184","#993333"]],D=["굴림","돋움","맑은고딕","Arial","궁서"],B=[8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,36,40,48,72],U=[["normal|normal","보통"],["normal|italic","기울임꼴"],["bold|normal","굵게"],["bold|italic","굵게 기울임꼴"]];return j.UI={stamp:function(m,I){var t="__stamp_ui_stamp",_=m.x,A=m.y,s="boolean"==typeof m.block&&m.block;if(null==Z.querySelector(t)){var l=[[1,"승인"],[2,"기각"],[3,"보류"],[4,"수신"],[5,"반려"],[6,"불승인"],[7,"부지급"],[8,"일부승인"],[9,"이송"],[10,"미가입재해"],[11,"14일이내 재해"]],e=[[3,"없음"],[0,"사각형"]],h=[[1,"중앙맞춤"],[2,"오른쪽맞춤"],[0,"왼쪽맞춤"]],i=-1,n=[],o=0,a=0;for(n[++i]='<div class="popup-container">',n[++i]="<div class='ui-font'>",n[++i]="<p><span class='ui-text-label'>종류&nbsp;:</span>",n[++i]="<select name='__sform__stamp__text_' id='__sform__stamp__text_' onchange=\"javascript:var el = this.parentNode.parentNode.parentNode.querySelector('input[name=__prev_type_]'); var arr = el.value.split('%'); arr.shift(); arr.unshift(this.options[this.selectedIndex].text); el.value=arr.join('%'); el.onchange();\">",o=0,a=l.length;o<a;o+=1)n[++i]="<option value='"+l[o][0]+"'"+(0===o?" selected='selected'":"")+">"+l[o][1]+"</option>";for(n[++i]="</select></p>",n[++i]="<p><span class='ui-font-color'>",n[++i]="<span style='display:block;' onclick=\""+it+".UI.font('"+t+"');\">글꼴</span>",n[++i]="<input type='hidden' name='__sform_font-size' value='"+m["font-size"]+"' onchange=\"this.parentNode.parentNode.parentNode.querySelector('.preview-display').style.fontSize=this.value+'px';\" />",n[++i]="<input type='hidden' name='__sform_font-weight' value='"+m["font-weight"]+"' onchange=\"this.parentNode.parentNode.parentNode.querySelector('.preview-display').style.fontWeight=this.value;\" />",n[++i]="<input type='hidden' name='__sform_font-style' value='"+m["font-style"]+"'onchange=\"this.parentNode.parentNode.parentNode.querySelector('.preview-display').style.fontStyle=this.value;\" />",n[++i]="<input type='hidden' name='__sform_font-family'  value='"+m["font-family"]+"' onchange=\"this.parentNode.parentNode.parentNode.querySelector('.preview-display').style.fontFamily=this.value;\"/>",n[++i]="<span style='display:block;' class='font-family'></span>",n[++i]="<span style='display:block; width:40px; height:20px; background:"+m["font-color"]+"; border:1px solid #ccc;' class='color'><input type='hidden' name='__sform_font-color'onchange=\"this.parentNode.parentNode.parentNode.querySelector('.preview-display').style.color=this.value;\" /></span>",n[++i]="</span>",n[++i]="<span class='ui-preview'>",n[++i]="<span class='title'>미리보기</span>",n[++i]="<span style='display:inline-block; width: 320px; overflow:hidden; text-align: center; font-size:"+m["font-size"]+"px;'><span class='preview-display'>승인</span></span>",n[++i]="</span></p></div>",n[++i]="<div class='ui-type'>",n[++i]="<span class='ui-text-label'>테두리&nbsp;:</span>",n[++i]="<select name='__sform_stroke-width'>",o=0,a=e.length;o<a;o+=1)n[++i]="<option value='"+e[o][0]+"' "+(e[o][0]===m["stroke-width"]?"selected=selected":"")+">"+e[o][1]+"</option>";for(n[++i]="</select>",n[++i]="<span class='ui-text-label'>표시위치&nbsp;:</span>",n[++i]="<select name='__stamp_text_align_' onchange=\"javascript:this.parentNode.parentNode.querySelector('.preview-display').style.textAlign=this.value;\">",o=0,a=h.length;o<a;o+=1)n[++i]="<option value='"+h[o][0]+"'>"+h[o][1]+"</option>";n[++i]="</select>",n[++i]="</div>",n[++i]="<div class='ui-format'>",n[++i]="<input type='checkbox' name='__fdate_' id='__sform_fdate_' format='%D' value='1' onchange=\"javascript:var el = this.parentNode.querySelector('input[name=__prev_type_]');if(this.checked){ el.value = el.value+this.getAttribute('format');} else {el.value =el.value.replace(this.getAttribute('format'), '');} el.onchange();\"/> <label for='__sform_fdate_'>날짜</label>",n[++i]="<input type='checkbox' name='__ftime_'  id='__sform_ftime_' format='%T' value='2' onchange=\"javascript:var el = this.parentNode.querySelector('input[name=__prev_type_]');if(this.checked){ el.value = el.value+this.getAttribute('format');} else {el.value =el.value.replace(this.getAttribute('format'), '');} el.onchange();\" /> <label for='__sform_ftime_'>시간</label>",n[++i]="<input type='checkbox' name='__fpayer_' id='__sform_fpayer_' format='%M' value='4' onchange=\"javascript:var el = this.parentNode.querySelector('input[name=__prev_type_]');if(this.checked){ el.value = el.value+this.getAttribute('format');} else {el.value =el.value.replace(this.getAttribute('format'), '');} el.onchange();\" /> <label for='__sform_fpayer_'>결제자</label>";var b=j.setting("payer"),r=(n[++i]="<input type='checkbox' name='__fimage_' id='__sform_stamp_image_' format='%I' value='8' onchange=\"javascript:var el = this.parentNode.parentNode.querySelector('input[name=__prev_type_');if(this.checked){ el.value = el.value+this.getAttribute('format'); this.parentNode.parentNode.querySelector('input[name=__stamp_image_').click();} else {el.value =el.value.replace(this.getAttribute('format'), '');}\"/><label for='__sform_stamp_image_'>이미지</label>",n[++i]="<input type='file' name='__stamp_image_'  style='display:none;' onchange=\"javascript:function __onSelectedFile(event) { var t = event.target, file = event.srcElement.files[0]; var reader = new FileReader(); reader.onload = (function(aFile){return function(e) { t.setAttribute('dataURL', e.target.result);};})(file);reader.readAsDataURL(file); event.stopPropagation(); event.preventDefault();} __onSelectedFile(event); var el = this.parentNode.querySelector('input[name=__prev_stamp_image_]'); el.value=this.value;\"/>",n[++i]="<p><span class='ui-text-label'>형식&nbsp;:</span><input type='text' name='__prev_type_' readonly='readonly' style='width:300px' value='승인' onchange=\"javascript:var el = this.parentNode.parentNode.parentNode.querySelector('.preview-display'); var d = new Date(); el.innerHTML = this.value.replace('%D', ' '+d.getFullYear()+'년 '+(d.getMonth()+1)+'월 '+d.getDate()+'일 ').replace('%T', ' '+d.getHours()+'시 '+d.getMinutes()+'분').replace('%M','"+b+"').replace('%I','');\"/></p>",n[++i]="<p><span class='ui-text-label'>이미지 파일명&nbsp;:</span><input type='text' name='__prev_stamp_image_' readonly='readonly'  style='width:240px' disabled='disabled'/> </p>",n[++i]="</div>",n[++i]="<div class='btn-area'>",n[++i]="<a href='#' class='btn-blue' id='__sform_stamp_confirm'>확인</a>",n[++i]="<a href='#' class='btn-blue' id='__sform_stamp_close' >닫기</a>",n[++i]="</div>",n[++i]="</div>",m.node||Z.body),y=et.createElement("div",{id:t,class:"sform-ui-stamp-prop sform-ui-popup sform-popup-layer",style:$.mapToString({position:"absolute","z-index":1e3},":",";")},r),c=(y.innerHTML=n.join(""),this),p=(s?c.block("body",y,!0):r.appendChild(y),(r.clientHeight-y.offsetHeight)/2),d=(r.clientWidth-y.offsetWidth)/2;function v(){$.unbind(g,"click",f),$.unbind(w,"click",x),$.unbind(N,"click",v),s?c.unblock("body","#"+t,!0):et.select(r,".sform-ui-memo")&&r.removeChild(y)}y.style.top=(p<0?0:p)+"px",y.style.left=(d<0?0:d)+"px";var g=et.select(y,".color"),T=et.select(g,"input[name='__sform_font-color']"),u=function(t){T.value=t.hex,T.onchange(),g.style.backgroundColor=t.hex},f=function(){j.UI.colorpicker("#000000",u)},x=function(){var t=y,e={};if(null!=t)for(var i=et.selectAll(t,"input:not([type='button']),select"),n=0,c=i.length;n<c;n+=1){var p=i[n];e[et.attr(p,"name")]=p}var d=e.__prev_type_.value;if($.isNotEmpty(d)){for(var g,o=$.toNotEmpty(e["__sform_font-size"].value,12),a=new Date,o=$.toInt(o),t=et.select(t,".preview-display").offsetWidth+8,u=o+8,r=((m={anntype:tt.AnnotationType.STAMP,x:_,y:A,width:t,height:u,"text-halign":$.toInt(e.__stamp_text_align_.value),"font-color":$.toNotEmpty(T.value,"#000000"),"font-family":e["__sform_font-family"].value,"font-weight":"normal","font-size":o,"stroke-width":$.toInt(e["__sform_stroke-width"].value),stroke:"#000000",text:"","stamp-style":0,"stamp-mode":0,"image-href":nt(e.__stamp_image_,"dataURL")})["stamp-style"]=$.toInt(et.getById("__sform__stamp__text_").value),d.split("%")),s=[r[0]],l=1,f=r.length;l<f;l++){var h=r[l];"D"===h?(m["stamp-mode"]=m["stamp-mode"]+1,s.push(a.getFullYear()+"년 "+(a.getMonth()+1)+"월 "+a.getDate()+"일")):"T"===h?(m["stamp-mode"]=m["stamp-mode"]+2,s.push(a.getHours()+"시 "+a.getMinutes()+"분")):"M"===h?(m["stamp-mode"]=m["stamp-mode"]+4,s.push(b)):"I"===h&&(m["stamp-mode"]=m["stamp-mode"]+8)}m.text=s.join(" "),$.isNotEmpty(m.text)?(e["__sform_stroke-width"].value,m.fill="#ffffff",g=setTimeout(function(){I(m),clearTimeout(g),v()},500)):v()}else v()},w=et.select(y,"#__sform_stamp_confirm"),N=et.select(y,"#__sform_stamp_close");$.bind(g,"click",f),$.bind(w,"click",x),$.bind(N,"click",v)}},contextmenuThumbnail:function(t,e,i,n){var o="sform_ui_contextmenu_thumbnail",a=et.getById(o),n=n+10,i=i+10,r=-1,s=[];null===a?(o=et.createElement("div",{id:o,class:"sform-ui-contextmenu",style:"height:30px;"},Z.body),et.prop(o.style,{top:n+"px",left:i+"px"}),s[++r]="<ul>",s[++r]="<li class='last'><span>삭제</span></li>",s[2]="</ul>",o.innerHTML=s.join(""),Z.body.appendChild(o),r=et.selectAll(o,"li"),$.bind(r[0],"click",function(){null!=e&&t._removeSelectItem(),j.UI.uncontextmenu()})):(a.style.top=n+"px",a.style.left=i+"px")},contextmenu:function(p,e,f,m){var d,g,r,t,s,l,h,i,n,o,u,a;p.data("editable")&&(d=e.el,g=d.id,t=et.getById(r="sform_ui_contextmenu"),s=m+10,l=f+10,h=p.data("pasteType"),i=-1,n=[],u=e.attr(),$.isEmpty(h)&&null===t?(o=et.createElement("div",{id:r,elId:g,class:"sform-ui-contextmenu",style:"height:120px;"},Z.body),et.prop(o.style,{top:s+"px",left:l+"px"}),n[++i]="<ul>",n[++i]="<li><span>잘라내기</span></li>",n[++i]="<li><span>복사</span></li>",n[++i]="<li class='deactive'><span>붙여넣기</span></li>",n[++i]="<li><span>삭제</span></li>",n[++i]="<li class='last'><span>속성</span></li>",n[++i]="</ul>",o.innerHTML=n.join(""),Z.body.appendChild(o),a=et.selectAll(o,"li"),$.bind(a[0],"click",function(){e.selected(!1),p.data("pasteType","cut"),p.data("pasteItem",e),d.node.style.opacity=0,d.node.style.display="none",j.UI.uncontextmenu(g)}),$.bind(a[1],"click",function(){p.data("pasteType","copy"),p.data("pasteItem",e),j.UI.uncontextmenu(g)}),$.bind(a[3],"click",function(){null!=d&&p.removeItem(e),j.UI.uncontextmenu(g)}),$.bind(a[4],"click",function(){j.UI.uncontextmenu(g),j.UI.properties(p,e,function(t){p.changeItemAttr(e,t)})})):$.isNotEmpty(h)&&null===t?(o=et.createElement("div"),nt(o,{id:r,uiId:r,elId:g,class:"sform-ui-contextmenu"}),et.prop(o.style,{top:s+"px",left:l+"px"}),n[++i]="<ul>",n[++i]="<li class='deactive'><span>잘라내기</span></li>",n[++i]="<li class='deactive'><span>복사</span></li>",n[++i]="<li class='paste'><span>붙여넣기</span></li>",n[++i]="<li class='deactive'><span>삭제</span></li>",n[++i]="<li class='deactive' class='last'><span>속성</span></li>",n[++i]="</ul>",o.innerHTML=n.join(""),Z.body.appendChild(o),a=o.querySelector(".paste"),$.bind(a,"click",function(){var t,e=p.data("pasteType"),i=p.data("pasteItem");try{var n,o=d.getBBox(),a=(o.x,o.y,j.Utils.svgCursorPoint(d.paper.node,f,m)),r=i.el.transform().diffMatrix.invert(),s=("cut"===e?(u=(t=i).attr(),d.node.style.opacity=u["fill-opacity"]||1,d.node.style.display="block"):(u=i.attrToJson(),t=p.drawingItem(u),d=t.el),r.e=r.f=0,r.x(a.x,a.y)),c=r.y(a.x,a.y),l=s-u.x,h=c-u.y;d.transform("t"+[l,h]),t.attr("anntype")!==tt.AnnotationType.STICKYNOTE&&t.attr("anntype")!==tt.AnnotationType.MEMO&&t.attr("anntype")!==tt.AnnotationType.TEXT||(n=Math.max(t.transforms.length-1,0),t.transforms[n]={tx:l,ty:h,type:"translate"})}catch(t){console.log(t)}p.data({pasteType:null,pasteItem:null}),j.UI.uncontextmenu(g)})):(t.style.top=s+"px",t.style.left=l+"px"))},uncontextmenu:function(t){if(t){var e;null!==(e=et.getById("sform_ui_contextmenu"))&&(e.remove?e.remove():e.parentNode.removeChild(e))}else for(var i=et.selectAll(Z.body,".sform-ui-contextmenu"),n=0,o=i.length;n<o;n++)(e=i[n]).remove?e.remove():e.parentNode.removeChild(e)},mouseovercolor:function(t,e){t=Z.getElementById(t);t.querySelector(".previewColor").style.backgroundColor=e,t.querySelector(".previewColorTxt").innerHTML=e,Z.body.style.cursor="pointer"},clickcolor:function(t,c,p,d){var e,i,n,o,a=Z.getElementById(t),r=Snap.color(c),s=a.querySelector(".colors-lightness"),g=r.s,u=r.l,l=-1,h=[];for(h[++l]="<table cellpadding='0' cellspacing='0' style='margin: 0 auto;'>",h[++l]="<tr>",o=0;o<10;o+=1)n=Snap.hsl(r.h,g/10*o,u/10*o,r),e=Snap.color(n),i=Snap.rgb(e.r,e.g,e.b,e.opacity),h[++l]="<td",h[++l]=" onclick=\"InziSForm.UI.clickcolor('"+t+"', '"+n.toUpperCase()+"',-1,-1)\"",h[++l]=" onmouseover=\"InziSForm.UI.mouseovercolor('"+t+"', '"+n.toUpperCase()+"')\"",h[++l]=" style='width: 20px; height: 20px; color: #FFFFFF; background: "+i+"'>&nbsp;</td>";for(h[++l]="</tr>",h[++l]="<tr>",o=0;o<10;o+=1)n=Snap.hsl(r.h,g-g/10*(o+1),u+(1-u)/10*(o+1),r),e=Snap.color(n),i=Snap.rgb(e.r,e.g,e.b,e.opacity),h[++l]="<td",h[++l]=' onclick="'+it+".UI.clickcolor('"+t+"', '"+n.toUpperCase()+"',-1,-1)\"",h[++l]=' onmouseover="'+it+".UI.mouseovercolor('"+t+"', '"+n.toUpperCase()+"')\"",h[++l]=" style='width: 20px; height: 20px; color: #FFFFFF; background: "+i+"'>&nbsp;</td>";h[++l]="</tr>",h[++l]="</table>",s.innerHTML=h.join(""),-1<p&&-1<d?((s=a.querySelector(".selected-color-bg")).style.top=p+"px",s.style.left=d+"px",s.style.visibility="visible"):a.querySelector(".selected-color-bg").style.visibility="hidden",a.querySelector(".selectedColor").style.backgroundColor=c,a.querySelector(".selectedColorTxt").innerHTML=c,a.querySelector("input[name='__sform_color_h']").value=$.toInt(360*r.h),a.querySelector("input[name='__sform_color_s']").value=$.toInt(100*r.s),a.querySelector("input[name='__sform_color_l']").value=$.toInt(100*r.l),a.querySelector("input[name='__sform_color_r']").value=r.r,a.querySelector("input[name='__sform_color_g']").value=r.g,a.querySelector("input[name='__sform_color_b']").value=r.b},colorpicker:function(t,e,i){t=t||"#000000";var n=Snap.color(t),o=Z.querySelectorAll(".sform-ui-colorpicker"),a="sform-ui-colorpicker"+(null==o?1:o.length+1),r=-1,s=[],l=0,c=d.length;for(s[++r]="<div class='popup-container'>",s[++r]="<div class='frame'>",s[++r]="<div class='ui-left'>",s[++r]="<div class='selected-color-bg'></div>",s[++r]="<div class='color-map'>",s[++r]="<div usemap='#colormap' alt='colormap' title='colormap'></div>",s[++r]="<img src='data:image/gif;base64,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' usemap='#colormap' alt='colormap' />",s[++r]="<map id='colormap' name='colormap'>",l=0;l<c;l+=1){var h=d[l],p=h[0].split(",");s[++r]="<area style='cursor: pointer' shape='poly' coords='"+h[0]+"' onclick=\"InziSForm.UI.clickcolor('"+a+"','"+h[1]+"',"+($.toInt(p[9])-15)+","+p[10]+')" onmouseover="InziSForm.UI.mouseovercolor(\''+a+"', '"+h[1]+"')\" alt='"+h[1]+"' />"}s[++r]="</map>",s[++r]="</div>",s[++r]="<div class='colors-lightness'></div>",s[++r]="</div>",s[++r]="<div class='ui-right'>",s[++r]="<div style='height:22px;'>",s[++r]="<span class='selectedColor color' style='background:"+(t||"#000000;")+"' ></span>",s[++r]="<span class='selectedColorTxt text'>"+n.hex+"</span>",s[++r]="</div>",s[++r]="<div style='height:22px; margin:10px 0;'>",s[++r]="<span class='previewColor color'></span>",s[++r]="<span class='previewColorTxt text'></span>",s[++r]="</div>",s[++r]="<div style='height:22px; margin:10px 0;'>",s[++r]="<ul>",s[++r]="<li><span class='text'>H:</span><span><input type='number' name='__sform_color_h' value='"+n.h+"' /></span></li>",s[++r]="<li><span class='text'>S:</span><span><input type='number' name='__sform_color_s' value='"+n.s+"' /></span></li>",s[++r]="<li><span class='text'>L:</span><span><input type='number' name='__sform_color_l' value='"+n.l+"' /></span></li>",s[++r]="<li><span class='text'>R:</span><span><input type='number' name='__sform_color_r' value='"+n.r+"' /></span></li>",s[++r]="<li><span class='text'>G: </span><span><input type='number' name='__sform_color_g' value='"+n.g+"' /></span></li>",s[++r]="<li><span class='text'>B:</span><span><input type='number' name='__sform_color_b' value='"+n.b+"' /></span></li>",s[++r]="</ul>",s[++r]="</div>",s[++r]="</div>",s[++r]="<div class='btn-area'>",s[++r]="<a href='#' class='btn-blue' id='__sform_color_save'>확인</a>",s[++r]="<a href='#' class='btn-blue' onclick=\""+it+".UI.unblock('body', '#"+a+"');\">닫기</a>",s[++r]="</div>",s[++r]="</div>",s[++r]="</div>";o=et.createElement("div",{class:"sform-ui-colorpicker sform-popup-layer",id:a,style:"z-index:99999;"},Z.body);o.innerHTML=s.join(""),this.block("body",o),$.isFunction(e)&&(t=Z.getElementById("__sform_color_save"),$.bind(t,"click",function(){var t=Snap.color(Z.getElementById(a).querySelector(".selectedColorTxt").innerHTML);i?e(i,t):e(t),j.UI.unblock("body","#"+a)}))},font:function(t,c){var p="sform-ui-font-prop",d="__sform_",e=-1,i=[],n=0,o=0,a=["굴림","돋움","맑은고딕","Arial","궁서"],r=[8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,36,40,48,72],g=[["normal|normal","보통"],["normal|italic","기울임꼴"],["bold|normal","굵게"],["bold|italic","굵게 기울임꼴"]],t=et.getById(t),s=et.select(t,"input[name='"+d+"font-size']"),u=et.select(t,"input[name='"+d+"font-weight']"),f=et.select(t,"input[name='"+d+"font-style']"),l=et.select(t,"input[name='"+d+"font-family']");for(i[++e]="<div class='popup-container'>",i[++e]="<div class='options'>",i[++e]="<ul>",i[++e]="<li><span class='title'>글꼴</span></li>",i[++e]="<li><input type='text' name='inputFontFamily' style='width:120px;' value='"+$.toNotEmpty(l.value,a[0])+"' /></li>",i[++e]="<li>",i[++e]="<select name='font-family' style='width:120px;' onchange=\"this.parentNode.parentNode.querySelector('input[name=inputFontFamily]').value = this.options[selectedIndex].text; this.parentNode.parentNode.parentNode.parentNode.querySelector('.preview-font').style.fontFamily = this.value;\">",n=0,o=a.length;n<o;n+=1)i[++e]="<option value='"+a[n]+"' "+(a[n]===l.value?"selected='selected'":"")+">"+a[n]+"</option>";for(i[++e]="</select>",i[++e]="</li>",i[++e]="</ul>",i[++e]="<ul>",i[++e]="<li><span class='title'>글꼴 사이즈</span></li>",i[++e]="<li><input type='text' name='inputFontSize' style='width:100px;' value='"+$.toNotEmpty(s.value,r[4])+"' /></li>",i[++e]="<li>",i[++e]="<select name='font-size' multiple style='width:100px; height:70px;' onchange=\"this.parentNode.parentNode.querySelector('input[name=inputFontSize]').value = this.options[selectedIndex].text; this.parentNode.parentNode.parentNode.parentNode.querySelector('.preview-font').style.fontSize = this.value+'px';\">",n=0,o=r.length;n<o;n+=1)i[++e]="<option value='"+r[n]+"' "+(r[n]===$.toInt(s.value)?"selected='selected'":"")+">"+r[n]+"</option>";for(i[++e]="</select>",i[++e]="</li>",i[++e]="</ul>",i[++e]="<ul>",i[++e]="<li><span class='title'>글꼴 스타일</span></li>",i[++e]="<li><input type='text' name='inputFontStyle' style='width:100px;' value='"+g[0][1]+"' /></li>",i[++e]="<li>",i[++e]="<select name='font-style' multiple style='width:100px; height:70px;' onchange=\"this.parentNode.parentNode.querySelector('input[name=inputFontStyle]').value = this.options[selectedIndex].text; var values = this.value.split('|'), el = this.parentNode.parentNode.parentNode.parentNode.querySelector('.preview-font'); el.style.fontWeight = values[0]; el.style.fontStyle = values[1];\">",n=0,o=g.length;n<o;n+=1)i[++e]="<option value='"+g[n][0]+"' "+(0===n?"selected='selected'":"")+">"+g[n][1]+"</option>";i[++e]="</select>",i[++e]="</li>",i[++e]="</ul>",i[++e]="</div>",i[++e]="<div class='preview-area'>",i[++e]="<span class='title'>미리보기</span>",i[++e]="<div class='preview-font'>가나다AaBbCcYyZz123</div>",i[++e]="</div>",i[++e]="<div class='btn-area'>",i[++e]="<a href='#' class='btn-blue' id='btnConfirm'>확인</a>",i[++e]="<a href='#' class='btn-blue' onclick=\""+it+".UI.unblock('body', '#"+p+"');\">닫기</a>",i[++e]="</div>",i[++e]="</div>";var h=et.createElement("div",{class:"sform-ui-font-prop sform-popup-layer",id:p,style:"z-index:9999;"},Z.body),t=(h.innerHTML=i.join(""),this.block("body",h),et.getById("btnConfirm"));$.bind(t,"click",function(){var t=et.select(h,"select[name='font-style']").value.split("|");l.value=et.select(h,"select[name='font-family']").value,s.value=et.select(h,"input[name='inputFontSize']").value,u.value=t[0],f.value=t[1],$.isFunction(l.onchange)&&l.onchange(),$.isFunction(s.onchange)&&s.onchange(),$.isFunction(u.onchange)&&u.onchange(),$.isFunction(f.onchange)&&f.onchange(),j.UI.unblock("body","#"+p)})},properties:function(c,p,d){var s,g,u,f,m,y="sform-ui-properties",v=et.getById(y),t=p.attr(),e=t.anntype,l="__sform_",i=-1,n=[],I=j.UI,o=0,a=0,r=0,_=0;if(n[++i]='<div class="popup-container">',n[++i]="<div class='frame'>",e!==tt.AnnotationType.MEMO&&e!==tt.AnnotationType.TEXT&&e!==tt.AnnotationType.STICKYNOTE&&e!==tt.AnnotationType.EDITTEXT&&e!==tt.AnnotationType.CHECKMARK||(n[++i]="<div class='prop-font'>",n[++i]="<span class='title'>글꼴</span>",n[++i]="<ul>",n[++i]="<li><span class='preview' onclick=\""+it+".UI.font('"+y+"')\">"+t["font-family"]+"</span>",n[++i]="<input type='hidden' name='"+l+"font-family' onchange=\"javascript:var elDisplay = this.parentNode.querySelector('.preview'); elDisplay.innerHTML = this.value;\" value=\""+t["font-family"]+'"  />',n[++i]="<input type='hidden' name='"+l+"font-size' value='"+t["font-size"]+"' />",n[++i]="<input type='hidden' name='"+l+"font-weight' value='"+t["font-weight"]+"' />",n[++i]="<input type='hidden' name='"+l+"font-style' value='"+t["font-style"]+"' />",n[++i]="</li>",n[++i]="<li><span>색:</span><span class='font-color' style='background:"+t["font-color"]+"'><input type='hidden' name='"+l+"font-color' /></span></li>",n[++i]="</ul>",n[++i]="</div>"),e!==tt.AnnotationType.LINE&&e!==tt.AnnotationType.ARROWLINE&&e!==tt.AnnotationType.POLYLINE&&e!==tt.AnnotationType.PEN&&(n[++i]="<div class='prop-fill'>",n[++i]="<span class='title'>채우기</span>",n[++i]="<ul>",n[++i]="<li><span class='text-label'>색:</span><span class='fill-color' style='background:"+t.fill+"'><input type='hidden' name='"+l+"fill' /></span></li>",e!==tt.AnnotationType.MASK&&(n[++i]="<li><span class='text-label'>투명: </span><span>",e===tt.AnnotationType.STICKYNOTE?n[++i]="<input type='text' name='fill-opacity'  value='"+t["fill-opacity"]+"'/>":n[++i]="<input type='checkbox' name='fill-opacity' "+(0===$.toFloat(t["fill-opacity"],1)?"checked=checked":"")+" value='"+t["fill-opacity"]+"' onchange='if(this.checked){this.value=0;}else{this.value=1;}'/>",n[++i]="</span></li>"),n[++i]="</ul>",n[++i]="</div>"),e!==tt.AnnotationType.STICKYNOTE){n[++i]="<div class='prop-stroke'>",n[++i]="<span class='title'>선</span>",n[++i]="<ul>",n[++i]="<li><span class='text-label'>색:</span><span class='stroke-color' style='background:"+t.stroke+"'><input type='hidden' name='"+l+"stroke' /></span></li>",n[++i]="<li><span class='text-label'>두께: </span><span><select name='"+l+"stroke-width'>";for(var A=[0,.25,.5,.75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25,4.5,4.75,5,5.25,5.5,5.75,6,6.25,6.5,6.75,7,7.25,7.5,7.75,8,8.25,8.5,8.75,9,9.25,9.5,9.75,10,10.5,11,12,20,32],o=0,a=A.length;o<a;o+=1)n[++i]="<option value='"+A[o]+"' "+(5===o?"selected='selected'":"")+">"+A[o]+"</option>";n[++i]="</select></span></li>",n[++i]="</ul>",n[++i]="</div>"}if(e===tt.AnnotationType.ARROWLINE){n[++i]="<div class='prop-arrow'>",n[++i]="<span class='title'>화살표</span>",n[++i]="<ul>";var b,p=j.Type.MarkerType.getByIndex("LEFT",t["left-arrow-shape"]),T=j.Type.MarkerType.getByIndex("RIGHT",t["right-arrow-shape"]),h=j.Type.MarkerType,x=(n[++i]="<li><span class='text-label'>시작 스타일:</span><span><input type='hidden' name='left-arrow-shape' value='"+t["left-arrow-shape"]+"' /><span class='marker-start-"+j.Type.Marker[p].type.toLowerCase()+"' attrValue='"+p+"'></span></span>",n[++i]="<ul type='marker-start'>",j.Type.Marker),w=[h.NONE,h.ARROW_LEFT,h.OPENARROW_LEFT,h.SHARPARROW_LEFT,h.DIAMOND,h.CIRCLE],N=[h.NONE,h.ARROW_RIGHT,h.OPENARROW_RIGHT,h.SHARPARROW_RIGHT,h.DIAMOND,h.CIRCLE];for(o=0,a=w.length;o<a;o+=1)b=x[w[o]],n[++i]="<li><span class='marker-start-"+w[b.shapeIndex].toLowerCase()+"' type='marker-start' attrValue='"+b.shapeIndex+"'></span></li>";for(n[++i]="</ul>",n[++i]="</li>",n[++i]="<li><span class='text-label'>끝 스타일:</span><span><input type='hidden' name='right-arrow-shape' value='"+t["right-arrow-shape"]+"' /><span class='marker-end-"+j.Type.Marker[T].type.toLowerCase()+"' attrValue='"+T+"'></span></span>",n[++i]="<ul type='marker-end'>",o=0,a=N.length;o<a;o+=1)b=x[N[o]],n[++i]="<li><span class='marker-end-"+N[b.shapeIndex].toLowerCase()+"' type='marker-end' attrValue='"+b.shapeIndex+"'></span></li>";n[++i]="</ul>",n[++i]="</li>",n[++i]="<li><span class='text-label'>시작 크기:</span><span><input type='text' name='las-size' value='"+t["las-size"]+"' style='width:25px;' maxlength='2'/></span></li>",n[++i]="<li><span class='text-label'>끝 크기:</span><span><input type='text' name='ras-size' value='"+t["ras-size"]+"'  style='width:25px;' maxlength='2' /></span></li>",n[++i]="</ul>",n[++i]="</div>",n[++i]="</div>"}for(m in n[++i]='<div class="btn-area">',n[++i]="<a href='#' class='btn-blue' id='btn-sform-confirm'>확인</a>",n[++i]="<a href='#' class='btn-blue' onclick=\""+it+".UI.unblock('body', '#"+y+"');\">닫기</a>",n[++i]="</div>",n[++i]="</div>",v?(s=v).removeChild():s=et.createElement("div",{class:"sform-ui-properties sform-popup-layer",id:y},Z.body),s.innerHTML=n.join(""),t)g=s.querySelector("input[name='"+l+m+"'],select[name='"+l+m+"']"),f=t[m],null!=g&&$.isNotEmpty(f)&&("hidden"===g.type||"text"===g.type?"object"!=typeof t[m]&&(g.value=f):-1!==g.type.indexOf("select")&&null!==(u=g.querySelector("option[value='"+f+"']"))&&(u.selected=!0));function E(t){et.parent(t.target,"li").querySelector("ul").style.display="block"}function C(t){var e=("svg"===(t=t.target).localName?t:t.parentNode).childNodes[0],i=B.querySelector("svg"),n=i.childNodes[0];n&&i.removeChild(n),i.appendChild(e.cloneNode(!0)),et.select(B,"input[name='strokeDasharray']").value=nt(e,"stroke-dasharray"),et.select(B,"input[name='strokeDashStyle']").value=nt(e,"strokeDashStyle"),M(t)}function P(t){var t=t.target,e=et.parent(t,"ul").previousSibling;(e=et.select(e,"input[name='strokeLinecap']")).value=nt(t,"attrValue"),nt(e.nextSibling,"class",e.value),M(t)}var S,M=function(t){et.parent(t,"ul").style.display="none"},k=function(t){q.value=t.hex,Q.style.backgroundColor=t.hex},R=function(t){X.value=t.hex,V.style.backgroundColor=t.hex,e===tt.AnnotationType.HIGHLIGHTER&&(X.value=t.hex,V.style.backgroundColor=t.hex)},L=function(t){J.value=t.hex,K.style.backgroundColor=t.hex},O=et.selectAll(s,".prop-stroke ul li ul");for(o=0,a=O.length;o<a;o+=1){var F,D=O[o],B=D.previousSibling,U=nt(D,"attrType");if("stroke-dasharray"===U&&t.hasOwnProperty(U))for(et.select(B,"svg line").setAttribute("stroke-dasharray",$.toNotEmpty(t["stroke-dasharray"],"0,0")),$.bind(B,"click",E),r=0,_=(S=D.childNodes).length;r<_;r+=1)F=S[r],$.bind(F,"click",C);else if("stroke-linecap"===U&&t.hasOwnProperty(U))for(f=$.toNotEmpty(t["stroke-linecap"],"round"),B.querySelector("input[name='stroke-linecap']").nextSibling.setAttribute("class",t[U]),$.bind(B,"click",E),r=0,_=(S=D.childNodes).length;r<_;r+=1)F=S[r],$.bind(F,"click",P);else B.setAttribute("class","disabled")}if(e===tt.AnnotationType.ARROWLINE||e===tt.AnnotationType.LINE){var z,H=et.selectAll(s,".prop-arrow ul li ul"),G=function(t){var t=t.target,e=et.parent(t,"ul"),i=e.previousSibling,n=i.querySelector("input"),i=i.querySelector("span"),e=nt(e,"type"),o=$.toInt(nt(t,"attrValue")),a=(nt(t,"type"),"left-arrow-shape"===nt(n,"name")?j.Type.MarkerType.getByIndex("LEFT",o):j.Type.MarkerType.getByIndex("RIGHT",o));n.value=o,i.setAttribute("class",e+"-"+j.Type.Marker[a].type.toLowerCase()),M(t)};for(o=0,a=H.length;o<a;o+=1){var Y=H[o],W=Y.previousSibling;for($.bind(W,"click",E),r=0,_=(S=Y.childNodes).length;r<_;r+=1)z=S[r].querySelector("span"),$.bind(z,"click",G)}}this.block("body",s);var Q=et.select(s,".font-color"),q=et.select(s,"input[name="+l+"font-color]"),V=(Q&&$.bind(Q,"click",function(){I.colorpicker(Q.style.backgroundColor,k)}),et.select(s,".fill-color")),X=et.select(s,"input[name="+l+"fill]"),K=(V&&$.bind(V,"click",function(){I.colorpicker(V.style.backgroundColor,R)}),et.select(s,".stroke-color")),J=et.select(s,"input[name="+l+"stroke]");K&&$.bind(K,"click",function(){I.colorpicker(K.style.backgroundColor,L)}),$.bind(et.getById("btn-sform-confirm"),"click",function(){for(var t=et.selectAll(s,"input:not([type='button']),select"),e={},i={},n=0,o=t.length;n<o;n+=1){var a,r=t[n],r=(e[a=(a=nt(r,"name")).replace(l,"")]=r).value;-1!==a.indexOf("stroke-width")?r=$.toFloat(r,2):-1===a.indexOf("arrow-shape")&&-1===a.indexOf("font-size")||(r=$.toInt(r)),i[a]=r}$.isFunction(d)&&d(i),I.unblock("body","#"+y)})},block:function(t,e){var i,n,o,a,r,t="string"==typeof t?Z.querySelector(t)||Z.querySelector("body"):t;null!==t&&(i=t.offsetWidth,n=t.offsetHeight,r="block_"+nt(e,"id"),o=e&&e.style.zIndex||999,null!=(a=Z.querySelector(r?"div[blockId=block_"+r+"]":"."+v+"-ui-block"))&&t.removeChild(a),et.createElement("div",{blockId:r,class:v+"-ui-block",style:"width:"+i+"px; height:"+n+"px; z-index:"+($.toInt(o)-10)+";"},t),void 0!==e&&"object"==typeof e&&(t.appendChild(e),a=e.offsetWidth,r=e.offsetHeight,e.style.top=Math.min(250,(t.clientHeight-r)/2)+"px",e.style.left=(t.clientWidth-a)/2+"px",et.attr(e,{tabindex:"0"})))},unblock:function(t,e,i){var n,t=Z.querySelector(t)||Z.querySelector("body");try{if(null!==t){var o,a,r,s=et.select(t,e),l=(null!==s&&(n=nt(s,"id"),s.parentNode.removeChild(s)),n?"div[blockId=block_"+n+"]":"."+v+"-ui-block");r=i?et.selectAll(t,l):(a=et.select(t,l))?[a]:[];for(var h=0,c=r.length;h<c;h++)null!=(o=r[h])&&o.parentNode.removeChild(o)}}catch(t){console.log(t)}},imageCompare:function(c,p){var t="__sform_compare_ui_popup",e=-1,i=[],n=0,o=1,a=et.getById(t),a=(null!==a&&a.parentNode.removeChild(a),et.createElement("div")),e=(i[++e]="<div class='"+v+"-popup-layer'>",i[++e]="<div class='popup-container'>",i[++e]="<div class='popup-title'>",i[++e]="<h3>이미지 비교</h3>",i[++e]="</div>",i[++e]="<div class='popup-contents'>",i[++e]="<div class='"+v+"-ui-compare-control'>",i[++e]="<div class='default-toolbar'><span><a id='sform-compare-button' href='#' class='btn-gray'>비교 하기</a></span></div>",i[++e]="<div style='display:none;' class='control-toolbar'>",i[++e]="<span class='sform-ui-active'><a id='sform-compare-zoomin' title='축소' alt='축소' href='#' class='sform-ui-icon icon-zoom-in'></a></span>",i[++e]="<span class='sform-ui-active'><a id='sform-compare-zoomout' title='축소' alt='축소' href='#' class='sform-ui-icon icon-zoom-out'></a></span>",i[++e]="<span class='sform-ui-active'><a id='sform-compare-rotate-left' title='왼쪽 회전' alt='왼쪽 회전' href='#' class='sform-ui-icon icon-rotate-left'></a></span>",i[++e]="<span class='sform-ui-active'><a id='sform-compare-rotate-right' title='오른쪽 회전' alt='오른쪽 회전' href='#' class='sform-ui-icon icon-rotate-right'></a></span>",i[++e]="</div>",i[++e]="</div>",i[++e]="<div class='compare-contents'>",i[++e]="<div class='display-image'>",i[++e]="<div id='sform-compare-source'></div>",i[++e]="<div id='sform-compare-dest'></div>",i[++e]="</div>",i[++e]="</div>",i[++e]='<div class="btn-right">',i[++e]="<a href='#' class='btn-close' onclick=\""+it+".UI.unblock('body', '#"+t+"');\">닫기</a>",i[++e]="</div>",i[++e]="</div>",i[++e]="</div>",i[26]="</div>",a.innerHTML=i.join(""),nt(a,{id:t,class:v+"-ui-image-compare"}),et.select(Z.body,".sform-wrapper")),i=(this.block(e,a),et.getById("sform-compare-button")),r=et.getById("sform-compare-source"),s=et.getById("sform-compare-dest"),d=(r.appendChild(c),s.appendChild(p),et.select(a,".default-toolbar")),g=et.select(a,".control-toolbar"),t=et.getById("sform-compare-zoomin"),e=et.getById("sform-compare-zoomout"),c=et.getById("sform-compare-rotate-left"),p=et.getById("sform-compare-rotate-right"),l=r.parentNode.offsetWidth,h=(r.parentNode.offsetHeight,Math.max(r.offsetWidth,s.offsetWidth)),u=Math.max(r.offsetHeight,s.offsetHeight);function f(t){t=t.target;"sform-compare-zoomin"===nt(t,"id")?o+=.2:o-=.2,o=2<o?Math.min(o,2):o<.5?Math.max(o,.5):o,y(s,o,n)}function m(t){t=t.target;"sform-compare-rotate-left"===nt(t,"id")?n-=10:n+=10,y(s,o,n)}function y(t,e,i){i="rotate("+i+"deg) scale("+e+")",et.prop(t.style,{transformOrigin:"50% 50%",transform:i,"-webkit-transform":i,"-webkit-transform-origin-x":"50%","-webkit-transform-origin-y":"50%","-ms-transform":i,"-ms-transform-origin":"50% 50%","-o-transform":i,"-o-transform-origin-x":"50%","-o-transform-origin-y":"50%","-moz-transform":i,"-moz-transform-origin-x":"50%","-moz-transform-origin-y":"50%"}),t=Math.max(r.offsetWidth,s.offsetWidth*e),i=Math.max(r.offsetHeight,s.offsetHeight*e);r.style.top=i/2-r.offsetHeight/2+"px",r.style.left=(l-t)/2+t/2-r.offsetWidth/2+"px",s.style.top=i/2-s.offsetHeight/2+"px",s.style.left=(l-t)/2+t/2-s.offsetWidth/2+"px"}null!=i&&($.bind(i,"click",function(){g.style.display="block",d.style.display="none",r.style.position="absolute",r.style.zIndex=1,r.style.top=u/2-r.offsetHeight/2+"px",r.style.left=(l-h)/2+h/2-r.offsetWidth/2+"px",s.style.position="absolute",s.style.zIndex=100,s.style.opacity=.5,s.style.top=u/2-s.offsetHeight/2+"px",s.style.left=(l-h)/2+h/2-s.offsetWidth/2+"px"}),$.bind(t,"click",f),$.bind(e,"click",f),$.bind(c,"click",m),$.bind(p,"click",m))},memo:function(n,c,p){var d=this,g="__sform_ui_popup_memo",t=-1,e=[],u=n.fontSize,i="__sform_",f={memopad:"메모패드",memo:"메모",text:"메모",edittext:"텍스트",stickynote:"스티커 메모"},f=f[n.type]||"Properties",o=((a=et.getById(g))&&a.parentNode.removeChild(a),n.node||Z.body),a=et.createElement("div",{id:g,class:"sform-ui-popup sform-ui-memo",style:$.mapToString({position:"absolute","z-index":99999},":",";")},o);if(e[++t]='<div class="sform-popup-layer">',e[++t]='<div class="popup-container">',e[++t]='<div class="popup-title">',e[++t]="<h3>"+f+"</h3>",e[++t]="</div>",e[++t]='<div class="popup-contents">',e[++t]='<div class="message mb20 text-center">',n.type===tt.AnnotationType.STICKYNOTE||n.type===tt.AnnotationType.TEXT){var m=D,r=B,y=U,s=0,v=r.length;for(e[++t]='<ul class="properties">',e[++t]="<li><span>배경색&nbsp;</span> <span class='color fill-color' data-color-type='fill' style='background:"+n.fill+"'><input type='hidden' name='"+i+"fill' value=\""+n.fill+'"/></span></li>',e[++t]='<li><label for="'+it+'-memo-font-size">불투명</label><select name="fill-opacity" id="'+it+'-memo-fill-opacity">',s=0;s<=10;s++)e[++t]='<option value="'+s/10+'" '+(n.fillOpacity===s/10?"selected='selected'":"")+">"+10*s+"%</option>";for(e[++t]="</select></li>",e[++t]="<li><span>라인색&nbsp;</span> <span class='color stroke-color' data-color-type='stroke' style='background:"+n.stroke+"'><input type='hidden' name='"+i+"stroke' value=\""+n.stroke+'"/></span></li>',e[++t]="</ul>",e[++t]='<ul class="properties">',e[++t]="<li><span>글자색&nbsp;</span> <span class='color font-color' data-color-type='font' style='background:"+n.fontColor+"'><input type='hidden' name='"+i+"font-color' value=\""+n.fontColor+'"/></span></li>',e[++t]='<li><label for="'+it+'-memo-font-family">글꼴</label><select name="font-family" id="'+it+'-memo-font-family" style="width:75px;">',n.fontFamily&&-1===m.indexOf(n.fontFamily)&&(e[++t]='<option value="'+n.fontFamily+'" >'+n.fontFamily+"</option>"),s=0,v=m.length;s<v;s++)e[++t]='<option value="'+m[s]+'" '+(m[s]===(n.fontFamily||"Arial")?"selected='selected'":"")+">"+m[s]+"</option>";for(e[++t]="</select></li>",e[++t]='<li><label for="'+it+'-memo-font-size">크기&nbsp;</label><select name="font-size" id="'+it+'-memo-font-size" style="width:50px;">',-1===r.indexOf($.toInt(n.fontSize))&&(e[++t]='<option value="'+$.toInt(n.fontSize)+'" >'+$.toInt(n.fontSize)+"</option>"),s=0,v=r.length;s<v;s++)e[++t]='<option value="'+r[s]+'" '+(r[s]===($.toInt(n.fontSize)||24)?"selected='selected'":"")+">"+r[s]+"</option>";for(e[++t]="</select></li>",e[++t]='<li><label for="'+it+'-memo-font-style">스타일</label>',e[++t]="<select name='font-style'  id='"+it+"-memo-font-style' style='width:100px;'>",s=0,v=y.length;s<v;s+=1)e[++t]="<option value='"+y[s][0]+"' "+(0===s?"selected='selected'":"")+">"+y[s][1]+"</option>";e[++t]="</select>",e[++t]="</li>",n.type===tt.AnnotationType.STICKYNOTE&&(e[++t]='<li><label for="'+it+'-memo-text-halign">가로 맞춤</label><select name="text-halign" id="'+it+'-memo-text-halign" style="width:70px;">',e[++t]='<option value="0">왼쪽</option>',e[++t]='<option value="1">가운데</option>',e[++t]='<option value="2">오른쪽</option>',e[++t]="</select></li>",e[++t]='<li><label for="'+it+'-memo-text-valign">세로 맞춤</label><select name="text-valign" id="'+it+'-memo-text-valign" style="width:70px;">',e[++t]='<option value="0">위쪽</option>',e[++t]='<option value="1">중간</option>',e[++t]='<option value="2">아래쪽</option>',e[++t]="</select></li>"),e[++t]="</ul>"}e[++t]='<textarea rows="7">'+(n.text||"")+"</textarea>",e[++t]="</div>",e[++t]='<div class="btn-right">',e[++t]='<a href="#" class="btn-close">확인</a>',e[++t]="</div>",e[++t]="</div>",e[++t]="</div>",e[++t]="</div>",a.innerHTML=e.join("");var f=(o.clientHeight-a.offsetHeight)/2,I=(o.clientWidth-a.offsetWidth)/2,f=(a.style.top=(f<0?0:f)+"px",a.style.left=(I<0?0:I)+"px",et.select(a,".btn-close")),l=et.select(a,"textarea"),_=et.getById(it+"-memo-font-size"),A=et.getById(it+"-memo-font-style"),b=et.getById(it+"-memo-font-family"),T=et.getById(it+"-memo-fill-opacity"),x=et.getById(it+"-memo-text-valign"),w=(x&&(x.value=n.textValign||0),et.getById(it+"-memo-text-halign")),N=(x&&(w.value=n.textHalign||0),et.select(a,".fill-color")),E=et.select(a,"input[name="+i+"fill]"),C=et.select(a,".stroke-color"),P=et.select(a,"input[name="+i+"stroke]"),S=et.select(a,".font-color"),M=et.select(a,"input[name="+i+"font-color]"),k=function(t,e){var i=t.getAttribute("data-color-type");"fill"===i?E.value=e.hex:"stroke"===i?P.value=e.hex:"font"===i&&(M.value=e.hex),t.style.backgroundColor=e.hex};N&&$.bind(N,"click",function(){j.UI.colorpicker(N.style.backgroundColor,k,N)}),C&&$.bind(C,"click",function(){j.UI.colorpicker(C.style.backgroundColor,k,C)}),S&&$.bind(S,"click",function(){j.UI.colorpicker(S.style.backgroundColor,k,S)}),$.bind(f,"click",function(){var t;$.isFunction(c)&&(t=n.type===tt.AnnotationType.STICKYNOTE?(u=_.value,{text:l.value,fontSize:j.Utils.toInt(u),fontFamily:b.value,fontStyle:A.value,fontColor:M.value,stroke:P.value,fill:E.value,fillOpacity:$.toFloat(T.value,1)||.1,textValign:j.Utils.toInt(x.value),textHalign:j.Utils.toInt(w.value)}):n.type===tt.AnnotationType.TEXT?(u=_.value,{text:l.value,fontSize:j.Utils.toInt(u),fontFamily:b.value,fontColor:M.value,fontStyle:A.value,fillOpacity:$.toFloat(T.value,1)||.1,stroke:P.value,fill:E.value}):l.value,c(t)),p?d.unblock("body","#"+g,!0):et.select(o,".sform-ui-memo")&&o.removeChild(a)}),p?d.block("body",a,!0):o.appendChild(a);var R,L,O,h,F=setTimeout(function(){var t,e=n.text||"",i=e.length,e=e.length;l.setSelectionRange?(l.focus(),l.setSelectionRange(i,e)):l.createTextRange&&((t=l.createTextRange()).collapse(!0),t.moveEnd("character",e),t.moveStart("character",i),t.select()),clearTimeout(F)},0);O=!1,h=a.parentNode,$.bind(a,"mousedown",function(t){O=!0,R=t.pageX,L=t.pageY}),$.bind(h,"mousemove",function(t){var e,i;O&&(e=parseInt(a.style.top)||0,i=parseInt(a.style.left)||0,e+=t.pageY-L,i+=t.pageX-R,e<0?e=0:e>h.offsetHeight-a.offsetHeight&&(e=h.offsetHeight-a.offsetHeight),i<0?i=0:i>h.offsetWidth-a.offsetWidth&&(i=h.offsetWidth-a.offsetWidth),R=t.pageX,L=t.pageY,a.style.top=e+"px",a.style.left=i+"px",a.style.cursor="crosshair")}),$.bind(h,"mouseleave mouseup",function(t){O=!1,L=R=-1,a.style.cursor="default"})},loading:function(t,e){var i="sform-ui-progressbar",n="."+v+"-wrapper",o=et.select(Z.body,"#"+i),a=(Z.body,[]),r=-1;if(!t)return this.unblock("body",i),void(o&&o.parentNode&&o.parentNode.removeChild(o));o||(t=et.createElement("div",{id:i,class:"sform-ui-popup sform-ui-progressbar"}),a[++r]="<div class='container'>",a[++r]="<div class='progress-message'>",a[++r]="<div>",a[++r]="<p>"+(e||"처리중 입니다.")+"</p>",a[++r]="<img src='"+tt.UI.LOADING_BAR.POPUP+"' alt='로딩바'/>",a[++r]="</div>",a[++r]="</div>",a[7]="</div>",t.innerHTML=a.join(""),this.block(n,t))},show:function(t){var e;t&&(e=et.offset(t),t.style.position="absolute",t.style.display="block",t.style.top=(Z.body.clientHeight-e.height)/2+"px",t.style.left=(Z.body.clientWidth-e.width)/2+"px")},progress:function(t,e,i){var n,o="sform-ui-progressbar",a=et.getById(o),r=[],s=-1,t=$.toInt(t/e*100),e="progressbar-gray",l=(10<t&&t<70?e="progressbar-blue":70<=t&&(e="progressbar-green"),"progressbar "+e),e=(null===a&&(a=et.createElement("div",{id:o,class:"sform-ui-progressbar"},Z.body),j.UI.block("body",a),r[++s]="<div class='container'>",r[++s]="<div class='"+e+"'>",r[++s]="<div class='progress-message'>0%</div>",r[++s]="<div class='progressbar'>",r[++s]="<div class='progressbar-inner'></div>",r[++s]="</div>",r[++s]="</div>",r[7]="</div>",a.innerHTML=r.join("")),et.select(a,".progressbar")),s=et.select(a,".progressbar-inner"),r=et.select(a,".progress-message");e&&et.attr(e,"class",l),s&&(s.style.width=t+"%"),r&&(r.innerHTML=t+"%"),100===t&&i&&(n=setTimeout(function(){j.UI.unblock("body","#"+o),clearTimeout(n)},200))},alert:function(t,e,i){j.setting("notifications").enabled&&this.message(t,e,i)},message:function(t,e,h,i){var n,o="sform-ui-message_"+$.generateUUID(),a=et.getById(o),r=[],s=-1,l=et.select(Z.body,"."+v+"-wrapper")||Z.body,a=et.createElement("div",{id:o,class:"sform-ui-message"},l);j.UI.block(l,a),r[++s]='<div class="contents">',r[++s]='<div class="sform-popup-layer">',r[++s]='<div class="popup-container">',r[++s]='<div class="popup-title">',r[++s]="<h3>알림</h3>",r[++s]="</div>",r[++s]="<div class='message'>",r[++s]=t,r[++s]="</div>",r[++s]='<div class="btn-right">',r[++s]="<a href='#' id='__sform_confirm_btn_close' class='btn-close' onclick=\""+it+".UI.unblock('body', '#"+o+"');\">닫기</a>",r[++s]="</div>",r[++s]="</div>",r[13]="</div>",a.innerHTML=r.join(""),void 0!==i?n=setTimeout(function(){j.UI.unblock("body","#"+o),clearTimeout(n)},i):(l=et.getById("__sform_confirm_btn_close"),$.isFunction(e)&&$.bind(l,"click",function(){e()}))},confirm:function(t,e,i,n){var o="sform-ui-message",a=et.getById(o),r=[],s=-1,l=et.select(Z.body,"."+v+"-wrapper")||Z.body,a=et.createElement("div",{id:o,class:"sform-ui-message"},l),l=(j.UI.block(l,a),r[++s]='<div class="contents">',r[++s]='<div class="sform-popup-layer">',r[++s]='<div class="popup-container">',r[++s]='<div class="popup-title">',r[++s]="<h3>확인</h3>",r[++s]="</div>",r[++s]="<div class='message'>",r[++s]=t,r[++s]="</div>",r[++s]='<div class="btn-right">',r[++s]="<a href='#' class='btn-close sform_btn_cancel' style='margin-right:20px' onclick=\""+it+".UI.unblock('body', '#"+o+"'); \">취소</a>",r[++s]="<a href='#' class='btn-close sform_btn_confirm' onclick=\""+it+".UI.unblock('body', '#"+o+"');\">확인</a>",r[++s]="</div>",r[++s]="</div>",r[14]="</div>",a.innerHTML=r.join(""),et.select(a,".sform_btn_confirm")),t=et.select(a,".sform_btn_cancel");$.unbind(l,"click"),$.unbind(t,"click"),$.isFunction(e)&&$.bind(l,"click",function(){e()}),$.isFunction(i)&&$.bind(t,"click",function(){i()})},mergeConfirm:function(t,e,i,n){var o="sform-ui-message",a=et.getById(o),r=[],s=-1,l=et.select(Z.body,"."+v+"-wrapper")||Z.body,a=et.createElement("div",{id:o,class:"sform-ui-message"},l),l=(j.UI.block(l,a),r[++s]='<div class="contents">',r[++s]='<div class="sform-popup-layer">',r[++s]='<div class="popup-container">',r[++s]='<div class="popup-title">',r[++s]="<h3>병합</h3>",r[++s]="</div>",r[++s]="<div class='message'>",r[++s]=t,r[++s]="</div>",r[++s]="<div class='message'>",r[++s]="<label style='margin-right:20px'>",r[++s]="<input type='radio' name='mergeOverwrite' checked='checked' value='false'>신규파일생성",r[++s]="</label>",r[++s]="<label>",r[++s]="<input type='radio' name='mergeOverwrite' value='true'>기존 파일에 병합",r[++s]="</label>",r[++s]="</div>",r[++s]='<div class="btn-right">',r[++s]="<a href='#' class='btn-close sform_btn_cancel' style='margin-right:20px' onclick=\""+it+".UI.unblock('body', '#"+o+"'); \">취소</a>",r[++s]="<a href='#' class='btn-close sform_btn_confirm' onclick=\""+it+".UI.unblock('body', '#"+o+"');\">확인</a>",r[++s]="</div>",r[++s]="</div>",r[22]="</div>",a.innerHTML=r.join(""),et.select(a,".sform_btn_confirm")),t=et.select(a,".sform_btn_cancel");$.unbind(l,"click"),$.unbind(t,"click"),$.isFunction(e)&&$.bind(l,"click",function(){e(et.select(a,"input[name=mergeOverwrite]:checked").value)}),$.isFunction(i)&&$.bind(t,"click",function(){i()})},animation:function(t,e){},resetLayer:function(t,e){for(var i,n=et.select(Z.body,"."+v+"-wrapper")||Z.body,o=et.selectAll(n,e),a=0,r=o.length,a=0;a<r;a++)try{(i=o[a]).parentNode&&i.parentNode.removeChild(i)}catch(t){console.log("[ERROR]removeLayer:",t)}}}}),InziSForm.create(function(t,e,o){"use strict";function i(t){this._params=n.extend({data:null,dataUrl:null,name:null,mimeType:null,width:null,height:null,fileId:null,pageNo:-1},t),this.data=this._params.data,this.dataUrl=this._params.dataUrl,this.name=this._params.name,this.mimeType=this._params.mimeType,this.width=this._params.width||0,this.height=this._params.height||0,this.fileId=this._params.fileId||"",this._pageNo=this._params.pageNo||1,this._canvasImageData=null,this.dataUrl.match(a)&&(t=this.dataUrl?this.dataUrl.replace(a,""):"",this.dataAB=n.isNotEmpty(t)?n.base64ToArrayBuffer(t):null)}var a=/^data:image\/(png|jpg|jpeg|gif|bmp);base64,/,n=t.Utils;t.Type,t.UI;i.prototype={setData:function(t){var i,n=this;this.data=t,this.dataUrl.match(a)&&(i=setTimeout(function(){var t,e;n.data&&((t=o.createElement("canvas")).width=n.width,t.height=n.height,t.getContext("2d").drawImage(n.data,0,0,n.width,n.height),e=t.getContext("2d").getImageData(0,0,n.width,n.height),n.setCanvasImageData(e),t=null),clearTimeout(i)},100))},getData:function(){return this.data},setCanvasImageData:function(t){this._canvasImageData=t},getCanvasImageData:function(){return this._canvasImageData},setDataUrl:function(t,e){this.dataUrl=t,e&&(t=this.dataUrl?this.dataUrl.replace(a,""):"",this.dataAB=n.isNotEmpty(t)?n.base64ToArrayBuffer(t):null)},getDataUrl:function(){return this.dataUrl},setName:function(t){this.name=t},getName:function(){return this.name},setMimeType:function(t){this.mimeType=t},getMimeType:function(){return this.mimeType},setSize:function(t,e){this.setWidth(t),this.setHeight(e)},setWidth:function(t){this.width=t},getWidth:function(){return this.width},setHeight:function(t){this.height=t},getHeight:function(){return this.height},setFileId:function(t){this.fileId=t},getFileId:function(){return this.fileId},setPageNo:function(t){this._pageNo=t},getPageNo:function(){return this._pageNo},setDataAB:function(t,e){this.dataAB=t,e&&0<t.byteLength&&(e=n.arrayBufferToBase64(t),this.dataUrl=n.isNotEmpty(e)?n.createDataUrl(this.mimeType,e):null)},getDataAB:function(){return this.dataAB}},t.core.Image=i}),InziSForm.create(function(t,e,i){"use strict";function n(t,e){this._x=t||0,this._y=e||0}n.prototype.getPosition=function(){return{x:this._x,y:this._y}},n.prototype.getX=function(){return this._y},n.prototype.getY=function(){return this._y},n.prototype.getPosition=function(){return{x:this._x,y:this._y}},n.prototype.setPosition=function(t,e){this._x=t||0,this._y=e||0},t.core.Position=n}),InziSForm.create(function(t,e,i){"use strict";function n(t,e){this.x=t||1,this.y=e||1}n.prototype={getScale:function(){return{x:this.x,y:this.y}},setScale:function(t,e){this.x=t,this.y=e}},t.core.Scale=n}),InziSForm.create(function(t,e,i){"use strict";function n(t,e){this.width=t||0,this.height=e||0}t.Utils;n.prototype.getSize=function(){return{width:this.width,height:this.height}},n.prototype.getWidth=function(){return this.width},n.prototype.getHeight=function(){return this.height},n.prototype.setSize=function(t,e){this.width=t||0,this.height=e||0},t.core.Size=n}),InziSForm.create(function(t,e,i){"use strict";t.Utils;function n(t,e){this.message=t,this.callback=e}var o=t.UI;n.prototype.notify=function(){o.alert(this.message)},t.ServiceException=n}),InziSForm.create(function(E,C,h){"use strict";function t(t){var e={container:null,controlType:E.Type.ControlType.NONE,renderNodeType:E.Type.RenderNodeType.CANVAS,renderType:"",renderQuality:"",index:-1,zoomType:"",angle:0,brightness:0,scale:new E.core.Scale(1,1),changed:!1,editable:!0,annotationEnable:!1,annotationFixed:!1,annotationViewMode:"all",securityLevel:0,cors:!1,listenerId:null};this._data=E.Utils.extend(e,t),this._pageIndex=this._data.index,this._container=this._data.container,this._pageNode=null,this._canvasNode=null,this._canvasContext=null,this._annotation=null,this._selectedItem=null,this._scale=new E.core.Scale(1,1),this._imageFile=null,this._drawing=!1,this._renderImageDataMap={},this._pageInfo={fileId:null,annotationId:null,itemPageNo:0},this._events=E.listeners(this._data.listenerId),this._init()}var P=E.Utils,l=E.ImageUtils,S=E.Element,M=E.Type,a=E.UI,k=E.moduleClassName,s="change.zoom",c="change.rotate",p="change.zoom.page",d="change.rotate.page",g="change.editable.page",u="change.securityLevel",e=(E.inherit(t,E.EventHandler),t.prototype);function r(t){var e,i,n,o=t.attributes;if(o)for(i=o.length,e=0;e<i;e+=1)"function"==typeof t[n=o[e].name]&&(t[n]=null);if(o=t.childNodes)for(i=o.length,e=0;e<i;e+=1)r(t.childNodes[e])}e._init=function(){var e=this;function t(t){e.data("zoomType",t.zoomType),e.setScale(t.scale.x,t.scale.y)}function i(t){e.angle(t.angle),e.refreshAnnotation(),e.data("change.rotate.data",t),e.data("change.rotate.render",!1)}null===this._pageNode&&this._createPageNode();var n,o=this.on(s,t);this.updateBindEvents(o),o=this.on(c,i),this.updateBindEvents(o),o=this.on(p+e.pageIndex(),t),this.updateBindEvents(o),o=this.on(d+e.pageIndex(),i),this.updateBindEvents(o),o=this.on(g,function(t){e.data("editable",t)}),this.updateBindEvents(o),o=this.on(u,function(t){e.data("securityLevel",t)}),this.updateBindEvents(o),o=this.on("page"+e.pageIndex()+".change.annotation",function(t){t.attr("anntype")!==M.AnnotationType.ETERNITYRECT&&t.attr("anntype")!==M.AnnotationType.MASK&&t.attr("anntype")!==M.AnnotationType.IMAGEAREA||(clearTimeout(n),n=setTimeout(function(){e._annotation&&e._annotation.refreshImage(),clearTimeout(n)},200)),e.trigger("change.annotation",t)}),this.updateBindEvents(o),this.hide()},e.updateBindEvents=function(t){for(var e,i=this.data("bind.events")||[],n=0,o=i.length,a=!0,n=0;n<o;n++)if(e=i[n].split("-")[0],0===t.indexOf(e)){a=!1;break}a&&(i=i.concat(t)),this.data("bind.events",i)},e.angle=function(t){if(1!==arguments.length)return this._data.angle;this._data.angle=(this._data.angle+t)%360},e.refreshAnnotation=function(){this._annotation&&this._annotation.refreshItem()},e.zoom=function(){return this._data.zoomType===M.ZoomType.DEFAULT?this._scale.x:this._data.zoomType},e._setVisible=function(t){this._pageNode&&(this._pageNode.style.display=t?"block":"none")},e.show=function(){this._setVisible(!0),this.refreshAnnotation()},e.hide=function(){this.unSelectedItem(),this._setVisible(!1)},e.data=function(t,e){return P.data.apply(this,Array.prototype.slice.call(arguments,0))},e.setScale=function(t,e){this._scale.setScale(t,e)},e.getScale=function(){return this._scale},e.pageNo=function(){return this._pageIndex+1},e._createPageNode=function(){var t,e;this._pageNode||(this._pageNode=S.createElement("div",{id:P.generateElementId("page",this.pageNo()),oncontextmenu:"return false",class:"sform-page"},this._container),this._container.offsetWidth,this._container.offsetHeight,t=this._pageNode.clientWidth,e=this._pageNode.clientHeight,this._pageNode.style.position="clip"===this._data.renderType?"absolute":"relative",this._createImageNode(t,e),this.data("annotationEnable")&&this._createAnnotation(t,e),this._filterNode=S.createElement("div",{id:P.generateElementId("sform-page-filter",this.pageNo()),class:"sform-page-filter"},this._pageNode),this.data("renderNodeType")===E.Type.RenderNodeType.IMAGE&&S.addClass(this._filterNode,"sform-watermark"))},e.filter=function(t){M.FilterType.GRID===t?S.addClass(this._filterNode,"filter-"+t):S.removeClass(this._filterNode,"filter-grid")},e._createImageNode=function(t,e){this._data.renderNodeType===E.Type.RenderNodeType.IMAGE?(this._imageRenderNode=S.createElement("img",{draggable:"false","alt":""},this._pageNode),this._imageRenderNode.style.display="none",this._imageRenderNode.style.width="0px",this._imageRenderNode.style.height="0px"):(this._canvasGraphic=E.GraphicsFactory.createGraphic(E.moduleImageGraphicType,this._pageNode,t,e,function(t){}),this._imageRenderNode=this._canvasGraphic.node,this._imageRenderNode.style.position="absolute",this._canvasContext=this._imageRenderNode?this._imageRenderNode.getContext("2d"):null,this._canvasContext.imageSmoothingEnabled=!0,this._canvasContext.mozImageSmoothingEnabled=!0,this._canvasContext.webkitImageSmoothingEnabled=!0,this._canvasContext.msImageSmoothingEnabled=!0)},e._createAnnotation=function(t,e){this._annotation=new E.core.Annotation(this,{viewMode:this._data.annotationViewMode,editable:this._data.editable,pageNo:this.getImageFile()?this.getImageFile().getPageNo():1,container:this._pageNode,width:t,height:e})},e.pageIndex=function(){return this._pageIndex},e.getImageData=function(t){if(this.getImageFile())return this._data.renderNodeType===E.Type.RenderNodeType.IMAGE?this._imageRenderNode:this._annotation&&this.data("controlType")===M.ControlType.MAGNIFICATION&&this._annotation.toImage()?this._annotation.toImage():this.getImageFile().getData()},e.getPageNode=function(){return this._pageNode},e.getGraphicNode=function(){return this._annotation?this._annotation.getGraphicNode():null},e.setAnnotationVisible=function(t){this._annotation&&(t?this._annotation.show(this._data.annotationViewMode):this._annotation.hide(this._data.annotationViewMode))},e.isAnnotationVisible=function(t){if(this._annotation)return this._annotation.isVisible()},e._getAnnotationData=function(t){var e=this.getAnnotation();if(e)return e.data(t)},e.getImageFile=function(){return this._imageFile},e.setImageData=function(t){var e=t.type,i=t.fileName,n=t.mimeType,o=t.fileId,a=t.annotation,r=a?t.annotation.data:"",a=(a&&t.annotation.annotationId,t.pageNo||1),s="",s="base64"===e||"url"===e?t.data:"data:image/"+(n=P.isEmpty(n)?i.substring(i.lastIndexOf(".")+1):n)+";base64,"+P.arrayBufferToBase64(r),e=new E.core.Image({dataUrl:s,name:i,mimeType:n,fileId:o,pageNo:a,width:t.width||0,height:t.height||0});this.setPageInfo({fileId:o,itemPageNo:a}),this.setImageFile(e),this._imageDataURL=s},e.setImageFile=function(t){var e,i,n=this,o=(this._imageFile=t,new Image);if(this._data.renderNodeType===E.Type.RenderNodeType.IMAGE)o=this._imageRenderNode;else if(o=new Image,this.data("cors"))try{o.crossOrigin="Anonymous"}catch(t){console.log("Unsupported CORS(Cross-Origin Resource Sharing) attribute.")}o.src=t.getDataUrl(),"clip"!==this._data.renderType&&a.loading(!0),o.onload=function(t){n._imageFile&&(e=o.naturalWidth,i=o.naturalHeight,n._imageFile.setSize(e,i),n._data.renderNodeType!==E.Type.RenderNodeType.IMAGE&&n._imageFile.setData(o),n.updateAnnotationData({width:e,height:i}),n._drawingItems&&n.getAnnotation()&&(n.getAnnotation().getItem()||[]).length!==n._drawingItems.length&&n.drawingItems(n._drawingItems),n.data("width",e),n.data("height",i),n.trigger("page.load.complete"+n.pageIndex(),{page:n,fileId:n._imageFile.getFileId(),width:e,height:i,pageNo:n.pageNo()},n),n._imageRenderNode.style.display="block"),a.loading(!1),o.onload=null,o.onerror=null,o=null},o.onerror=function(){a.loading(!1)}},e.getImageRenderNode=function(){return this._imageRenderNode},e.getCanvasContext=function(){if(null!==this._canvasContext)return this._canvasContext},e.reset=function(){var t={zoomType:"",angle:0,scale:new E.core.Scale(1,1),matrix:"",index:-1,context:null,currentFile:null,annotation:null,changed:!1,selectedItem:null,isDrawing:!1,contentsNode:null,controlType:E.Type.ControlType.NONE,annotationEnable:!1,annotationViewMode:"all",editable:!0};this._pageNode=null,this._imageRenderNode=null,this._canvasContext=null,this._annotation=null,this._selectedItem=null,this._drawing=!1,this._graphic=null,this._imageFile&&this._imageFile.setData(null),this._imageFile=null,this.data(t)},e.remove=function(){for(var t=this.data("bind.events"),e=0;e<t.length;e++)this.off(t[e]);this._pageNode&&(r(this._imageRenderNode),r(this._pageNode),this._container.removeChild(this._pageNode)),this._annotation&&this._annotation.remove(),this.reset()},e.resetAnnotation=function(){this.getAnnotation()&&this.getAnnotation()&&this.getAnnotation().removeAllItem()},e.resetItem=function(){this.removeAllItem()},e.drawing=function(t){this._annotation&&!this._drawing&&this.isAnnotationVisible()&&(this._drawing=!0,null!==this.selectedItem()&&this.unSelectedItem(),t["page-index"]=this.getImageFile().getPageNo()-1,this._annotation.drawing(this,t,!0))},e.undrawing=function(){var t=this.getAnnotation();t&&t._graphic._drawing&&((t=t._graphic)._drawingItem&&t.drawEnd()),this._drawing=!1},e.getItems=function(t){return t?this.getAnnotation().getItem(t):this.getAnnotation().getItem()},e.getAnnotation=function(){if(null!==this._annotation)return this._annotation},e.removeItem=function(t){var e=this.getAnnotation();e&&(t=void 0===t?this.selectedItem():t)&&(this.unSelectedItem(t),e.removeItem(t))},e.removeAllItem=function(){var t=this.getAnnotation();t&&t.removeAllItem()},e.itemProp=function(t,e){var i=this.getAnnotation(),e=e||this.selectedItem();i.setProp(e,t)},e.selectedItem=function(t,e,i,n){if(!(1<=arguments.length))return this._selectedItem;t&&(t.selected(!0,e,i,n),this.trigger("page.annotation.selected",t),this._selectedItem=t)},e.selectedPrevItem=function(){if(this._annotation){var t=this.getAnnotation().getItem()||[],e=0,i=t.length,n=-1;if(0<i){if(null===this._selectedItem&&0<i)n=0;else{for(e=0;e<i;e++)if(this._selectedItem===t[e]){n=e;break}(n-=1)<0&&(n=i-1)}var o=t[n];null!==this._selectedItem&&o!==this._selectedItem&&this.unSelectedItem(this._selectedItem),o!==this._selectedItem&&this.selectedItem(o)}}return this},e.selectedNextItem=function(){if(this._annotation){var t=this.getAnnotation().getItem()||[],e=0,i=t.length;if(0<i){var n=-1;if(null===this._selectedItem&&0<i)n=0;else{for(e=0;e<i;e++)if(this._selectedItem===t[e]){n=e;break}i-1<(n+=1)&&(n=0)}var o=t[n];null!==this._selectedItem&&o!==this._selectedItem&&this.unSelectedItem(this._selectedItem),o!==this._selectedItem&&this.selectedItem(o)}}return this},e.unSelectedItem=function(t){t=t||this.selectedItem();return t&&(t.selected(!1),this._selectedItem=null,E.UI.uncontextmenu()),this},e.changeItemAttr=function(t,e){t&&t.change(e)},e.drawingItems=function(t){var e;if(this._drawingItems=t,this._drawingItems&&this.trigger("page.annotation.load",{page:this}),this._annotation&&this.getImageFile())return t=this._data.angle,e=this.getScale(),this.viewportUpdate(t,e.x,e.y),this._annotation.drawingItems(this,this._drawingItems)},e.drawingItem=function(t){t=this.drawingItems([t])||[];if(0<t.length)return t[0]},e.updateAnnotationData=function(t){var e=this.getAnnotation();if(e)for(var i in t)e.data(i,t[i])},e._getRenderImage=function(){var t,e,i,n,o,a,r,s,l=this.getImageData();if(null!==l)return e=this.getImageFile(),t=e.getWidth(),e=e.getHeight(),n=this.getScale(),i=n.x,n=n.y,o=t,s=e,a=this._container.clientWidth,r=this._container.offsetHeight,s=this._data.angle/90%2==0?(o=Math.floor(t*i),Math.floor(e*n)):(o=Math.floor(t*n),Math.floor(e*i)),{image:l,containerWidth:a,containerHeight:r,width:t,height:e,rWidth:o,rHeight:s}},e.render=function(t,e){null!==this.getImageData()&&(this._magnifierNode&&(S.remove(this._magnifierNode,this._pageNode),this._magnifierNode=null),this._data.renderNodeType===E.Type.RenderNodeType.IMAGE?this.renderImage(t,e):this.renderCanvas(t,e),!1===this.data("change.rotate.render")&&(this.data("change.rotate.render",!0),this.trigger("change.rotate.page.complete",this)))},e.isAnnotationFixed=function(){return this.data("annotationEnable")&&this.data("annotationFixed")},e.renderImage=function(c,p){var d,g,t=this.isAnnotationFixed(),u=this,f=u.getPageNode(),e=u.getImageFile(),i=e.getWidth(),e=e.getHeight(),n=u.getScale(),o=n.x,n=n.y,a=o*i,r=n*e,s=o*i,l=n*e,m=u._data.angle,y=u._container.offsetWidth,v=u._container.offsetHeight,I=0,h=0,r=m%180==0||t?(a=t?Math.max(Math.floor(i*o),y):Math.floor(i*o),Math.floor(e*n)):(a=Math.floor(e*n),Math.floor(i*o)),o=(t&&Math.abs(m)/90%2==1&&(o=r/i,n=a/e,l=e<i?(s=r,Math.floor(e*o)):(s=Math.floor(i*n),a)),f.style.width=a+"px",f.style.height=r+"px",p=P.isEmpty(p)?P.toInt(f.style.top||0):p,c=P.isEmpty(c)?P.toInt(f.style.left||0):c,"clip"===u._data.renderType?(d=Math.min(y,a),p=r<=(g=Math.min(v,r))||0<p||0<p?0:Math.max(p,-(r-g)),c=a<=d||0<c||0<c?0:Math.max(c,-(a-d))):(d=a,g=r),m/90),n=(1==o||-3==o?v-P.toInt(r)<=1&&y-P.toInt(a)<=1?(h=-l,l<r&&t&&(h-=(a-l)/2),s<r&&(I=(r-s)/2)):e<i?(h=(s<l?(l-s)/2:0)-l,s<a&&t&&(h-=(a-l)/2)):(h=(s<l?0:(l-s)/2)-l,l<r&&t&&(I=(r-s)/2)):2==o||-2==o?(I=-s-(s<a?(a-s)/2:0),h=-l):3==o||-1==o?(I=-s,h=-(s<l?(l-s)/2:0),v-P.toInt(r)<=1&&y-P.toInt(a)<=1?(h=0,s<a&&t&&(h+=(a-l)/2),s<r&&(I-=(r-s)/2)):e<i?(h=-(s<l?(l-s)/2:0),s<a&&t&&(h+=(a-l)/2)):(h=-(s<l?0:(l-s)/2),l<r&&t&&(I-=(r-s)/2))):s<a&&(I=(a-s)/2),"rotate("+m+"deg) translate("+I+"px,"+h+"px)");90===Math.abs(m%180)&&e<i&&(n=n+"scale("+i/e+", 1)"),this._imageRenderNode.style["transform-origin"]="0px 0px 0px",this._imageRenderNode.style.transform=n,this._imageRenderNode.style["-ms-transform"]=n,this._imageRenderNode.style["-webkit-transform"]=n,this._imageRenderNode.style.width=s+"px",this._imageRenderNode.style.height=l+"px","clip"===this._data.renderType&&(f.style.top=p+"px",f.style.left=c+"px"),u.trigger("page"+u.pageIndex()+".renderEnd")},e.renderCanvas=function(t,e){var c,p,d,g,u,f,i=this,m=i.getPageNode(),y=this.getImageData(),n=i.getImageFile(),v=n.getWidth(),I=n.getHeight(),_=n.getWidth(),n=n.getHeight(),o=i.getScale(),a=o.x,o=o.y,A=i._data.angle,r=_,s=n,b=m.style,l=P.toInt(b.width),h=P.toInt(b.height),T=i._canvasContext.canvas,x=i._container.offsetWidth,w=i._container.offsetHeight,l=("clip"===i._data.renderType&&(x=i._container.clientWidth,w=i._container.clientHeight),i._canvasGraphic.clear(),s=A/90%2==0?(r=Math.floor(_*a),Math.floor(n*o)):(r=Math.floor(n*o),Math.floor(_*a)),l!==r&&(b.width=r+"px"),h!==s&&(b.height=s+"px"),"clip"===i._data.renderType?(v=Math.min(x,r),I=Math.min(w,s),T.width=v,T.height=I):(v=T.width=r,I=T.height=s),0),h=0,b=(e=P.isEmpty(e)?P.toInt(m.style.top||0):e,t=P.isEmpty(t)?P.toInt(m.style.left||0):t,"clip"===i._data.renderType&&(e=s<=I||0<e||0<e?0:Math.max(e,-(s-I)),t=r<=v||0<t||0<t?0:Math.max(t,-(r-v))),_/-2),x=n/-2,N=(this._canvasContext.translate(v/2,I/2),this._canvasContext.rotate(A*Math.PI/180),A/90%4);A/90%2==0?(d=b*a+(c=P.toInt(_*a-v)/2),g=x*o+(p=P.toInt(n*o-I)/2),u=b*a-c,f=x*o-p,h=0==N?(l=b*a+(t<=0?c+t:0),x*o+(e<=0?p+e:0)):(l=t<=0?u-t:0,e<=0?f-e:0),t<=0&&(l<u?l=u:d<l&&(l=d)),e<=0&&(h<f?h=f:g<h&&(h=g))):(d=b*a+(c=P.toInt(_*a-I)/2),g=x*o+(p=P.toInt(n*o-v)/2),u=b*a-c,f=x*o-p,h=-1==N||3==N?(l=e<=0?u-e:0,t<=0?g+t:0):(l=e<=0?d+e:0,t<=0?f-t:0),l=e<=0?l<u?u:d<l?d:l:l,h=t<=0?h<f?f:g<h?g:h:h),this._canvasContext.drawImage(y,l,h,_*a,n*o),a<1&&a===o&&i._data.renderQuality===M.RenderQuality.HIGH?this._canvasContext.putImageData(this.getRenderImageData(),t,e,0,0,r,s):this._canvasContext.drawImage(y,l,h,_*a,n*o),"clip"===i._data.renderType?(m.style.top=e+"px",m.style.left=t+"px"):m.style.marginTop=(w<s?0:(w-s)/2)+"px",T.style.top=(e<0?-e:0)+"px",T.style.left=(t<0?-t:0)+"px";try{i._imageDataURL=T.toDataURL()}catch(t){i._imageDataURL=this.getImageData()}i.trigger("page"+i.pageIndex()+".renderEnd")},e.getTransformInfo=function(t,c){var e=this,p=e.getPageNode(),i=e.getImageFile(),n=i.getWidth(),i=i.getHeight(),o=e.getScale(),a=o.x,o=o.y,r=a*n,d=o*i,s=a*n,l=o*i,g=e._data.angle,u=e._container.offsetWidth,e=e._container.offsetHeight,f=0,h=0,d=g%180==0?(r=Math.floor(n*a),Math.floor(i*o)):(r=Math.floor(i*o),Math.floor(n*a)),o=(t=P.isEmpty(t)?P.toInt(p.style.top||0):t,c=P.isEmpty(c)?P.toInt(p.style.left||0):c,g/90);return 1==o||-3==o?h=e-P.toInt(d)<=1&&u-P.toInt(r)<=1?-l:i<n?(s<l?(l-s)/2:0)-l:(s<l?0:(l-s)/2)-l:2==o||-2==o?(f=-s,h=-l):3!=o&&-1!=o||(f=-s,h=-(s<l?(l-s)/2:0),h=e-P.toInt(d)<=1&&u-P.toInt(r)<=1?0:i<n?-(s<l?(l-s)/2:0):-(s<l?0:(l-s)/2)),{transformOrigin:"0px 0px 0px",transform:"rotate("+g+"deg) translate("+f+"px,"+h+"px)",width:s,height:l}},e.getRenderImageData=function(){var t,e,i=this.getImageFile(),n=i.getWidth(),i=i.getHeight(),o=this.getScale(),a=o.x,o=o.y,r=this._data.angle,s=r%360;return void 0===this._renderImageDataMap["scale_"+a]&&(this._renderImageDataMap["scale_"+a]={}),this._renderImageDataMap["scale_"+a][s]||(e=(t=h.createElement("canvas")).getContext("2d"),r/90%2==0?(t.width=n,t.height=i):(t.width=i,t.height=n),e.translate(t.width/2,t.height/2),e.rotate(r*Math.PI/180),e.drawImage(this._imageFile.getData(),-n/2,-i/2,n,i),e.translate(-t.width/2,-t.height/2),this._renderImageDataMap["scale_"+a][s]=l.downScale(e.getImageData(0,0,t.width,t.height).data,t.width,t.height,a,o)),this._renderImageDataMap["scale_"+a][s]},e.bbox=function(t,e){this.getPageNode(),this.getImageData();var i=this.getImageFile(),n=i.getWidth(),o=i.getHeight(),i=(i.getWidth(),i.getHeight(),this.getScale());i.x,i.y;return"clip"===this._data.renderType&&(n=this._container.clientWidth,o=this._container.offsetHeight),{top:void 0,left:void 0,width:n,height:o,dspWidth:void 0,dspHeight:void 0,cx:void 0,cy:void 0}},e.magnify=function(c,p,t,e,i){var n,o,d,a,r,g,u,f,m,y,v,I,_,A,s,b,T,x,w,l,h,N;this._imageDataURL&&(n=this,(o=new Image).src=this._imageDataURL,(a=this.getImageFile()).getWidth(),a.getHeight(),n._container.offsetWidth,n._container.offsetHeight,d=(a=this.getScale()).x,a=a.y,t=t||250,e=e||200,r=this._pageNode.getBoundingClientRect(),g=(i.changedTouches?i.changedTouches[0]:i).pageX,u=(i.changedTouches?i.changedTouches[0]:i).pageY,this._data.renderNodeType===E.Type.RenderNodeType.CANVAS?(s=!((I=this._imageRenderNode).style.cursor="crosshair"),(s=(0<r.top||0<r.left)&&i.pageX===i.offsetX&&i.pageY===i.offsetY?!0:s)&&(0<r.left&&(c=Math.min(c,i.layerX)),0<r.top&&(p=Math.min(p,i.layerY))),_=c-t/2,A=p-e/2,o.onload=function(){n._canvasGraphic.clear(n._canvasContext,o.naturalWidth,o.naturalHeight),n._canvasContext.save(),n._canvasContext.drawImage(o,0-+c+4,0-+p+4,2*I.width-8,2*I.height-8),n._canvasContext.globalCompositeOperation="destination-atop",n._canvasContext.beginPath(),n._canvasContext.lineWidth=5,n._canvasGraphic.roundRect(_,A,t,e,30,"#ffffff",null,n._canvasContext),n._canvasContext.closePath(),n._canvasContext.drawImage(o,0,0,o.naturalWidth,o.naturalHeight),n._canvasContext.restore(),n._canvasContext.stroke(),n._canvasContext.restore()}):(this._magnifierNode||(s=(s=null)!=this._annotation&&this._annotation.getImageDataURL()?this._annotation.getImageDataURL():this._imageDataURL,this._magnifierNode=S.createElement("div",{id:"sform-magnifier",oncontextmenu:"return false",class:k+"-magnifier"},this._pageNode),this._magnifierNode.style.background="url('"+s+"') no-repeat",this._magnifierNode.style.width=t+"px",this._magnifierNode.style.height=e+"px"),i=this.data("angle"),s=this.isAnnotationFixed(),b=P.toInt(this._pageNode.style.width),T=P.toInt(this._pageNode.style.height),x=o.naturalWidth,w=o.naturalHeight,s&&Math.abs(i)/90%2==1&&(a=d=Math.min(T/x,b/w)),f=g-r.left-C.scrollX-t/2,m=u-r.top-C.scrollY-e/2,y=x*(2*d),v=w*(2*a),m=Math.min(r.height-e,m),l=-(2*(g-r.left-C.scrollX)-t/2),h=-(2*(u-r.top-C.scrollY)-e/2),this._magnifierNode.style.backgroundSize=x*(2*d)+"px "+w*(2*a)+"px",this._magnifierNode.style.left=f+"px",this._magnifierNode.style.top=m+"px",this._magnifierNode.style["-webkit-transform"]="rotate("+i+"deg)",this._magnifierNode.style["-moz-transform"]="rotate("+i+"deg)",this._magnifierNode.style["-ms-transform"]="rotate("+i+"deg)",this._magnifierNode.style["-o-transform"]="rotate("+i+"deg)",this._magnifierNode.style.transform="rotate("+i+"deg)",s&&(N=P.toInt(this._imageRenderNode.style.width),P.toInt(this._imageRenderNode.style.height)),90===i||-270===i?(h=-(v+l)+e,l=-(2*(u-r.top-C.scrollY)-e/2),s&&(N<T?l+=T-y/2:h-=b-w/2)):180===i||-180===i?(l=-(y+l)+t-(N<b?b-y/2:0),h=-(v+h)+e):270===i||-90===i?(l=-(y+h)+t,h=-(2*(g-r.left-C.scrollX)-t/2),s&&(N<T?l-=T-y/2:h+=b-w/2)):l+=N<b?b-y/2:0,this._magnifierNode.style.backgroundPosition=l+"px "+h+"px"))},e.resize=function(t,e){},e.cropImage=function(t){return null===this.getImageFile()?"":l.cropToDataURL(l.createCanvasByImage(this.getImageData()),t)},e.getViewport=function(){return this._annotation.getViewport()},e.viewportUpdate=function(){var t,e,i,n,o,a,r;this._annotation&&(t=this.getScale(),e=this.selectedItem(),this.isAnnotationFixed()&&(r=(r=this.getImageFile())?(o=this._container.offsetWidth,a=this._container.offsetHeight,i=r.getWidth(),r=r.getHeight(),n=Math.min(o/i,a/r),o=Math.min(o/r,a/i),a=Math.max(n,o),Math.max(n,o)):(a=t.x,t.y)),this._annotation.viewportUpdate(this.data("angle"),t.x,t.y,this.isAnnotationFixed(),a,r),e&&this.unSelectedItem(e).selectedItem(e))},e.setPageInfo=function(t){return this._pageInfo=E.Utils.extend(this._pageInfo,t),this},e.getPageInfo=function(){return this._pageInfo},e.setWatermark=function(t){var e,i;t.opacity=t.opacity||.4,this.data("renderNodeType")===E.Type.RenderNodeType.IMAGE?(i=P.toInt(this._pageNode.style.height),this._filterNode.style.height=i+"px",this._filterNode.style.opacity=t.opacity,"text"===t.type?(e=t.message,t.visible||(e=""),this._filterNode.innerHTML=e,this._filterNode.style.fontSize=i/5+"px",this._filterNode.style.lineHeight=i+"px",this._filterNode.style.opacity=t.opacity):"image"===t.type&&t.imageHref&&(t.visible?0<t.width&&0<t.height&&(e=P.toInt(this._pageNode.style.width),i=P.toInt(this._pageNode.style.height),e=Math.min(this._container.offsetWidth,e),i=Math.min(this._container.offsetHeight,i),e=(e-t.width)/2-P.toNotEmpty(this._pageNode.style.left,0),i=(i-t.height)/2-P.toNotEmpty(this._pageNode.style.top,0),this._filterNode.style.background="url('"+t.imageHref+"') "+e+"px "+i+"px no-repeat"):this._filterNode.style.background="none")):t.visible&&E.ImageUtils.watermark(this.getCanvasContext(),t)},e.uncontextmenu=function(){return this.data({pasteType:null,pasteItem:null}),E.UI.uncontextmenu(),this},e.getTopStackNode=function(){return this.isAnnotationVisible()?this.getAnnotation().getGraphicNode():this._filterNode||this._pageNode},e.reloadImage=function(t){this.resetAnnotation(),this._drawingItems=null,this._imageFile=null,this.setImageData(t)},E.core.Page=t}),InziSForm.create(function(h,t,e){"use strict";function i(t,e){return this.page=t,this._data=h.Utils.extend({index:0,container:null,data:null,items:[],changed:!1,editable:!0,width:0,height:0,viewMode:"all"},e),this._container=this._data.container,this._graphicNode=null,this._graphic=null,this._items=[],this.changed=!1,this._procQueue=[],this._visible=!1,this._canvas=null,this._annotationImage=new Image,this.imageLoad=!1,this._init(),this.annotationConfig=h.setting("annotationConfig"),this.annotationLastId=0,this.annotationIdMap={},this}var a=h.Utils,o=h.Type;h.UI;h.inherit(i,h.EventHandler),i.prototype={_init:function(){this._createGraphicNode(),this._createConvertImageNode()},remove:function(){this._graphic&&this._graphic.remove(),this.page=null,this._annotationImage=null},_createGraphicNode:function(){var i=this;i._graphicNode||(i._graphic=h.GraphicsFactory.createGraphic(h.moduleAnnotationGraphicType,i._container,i._data.width,i._data.height,function(t,e){e="boolean"==typeof e&&e,t?e?i.removeItem(t,!1):((e=t.attr("id"))<0?(i.annotationLastId=i.annotationLastId+1,e=i.annotationLastId):i.annotationLastId=e,i.addItem(t),t.redraw(!1),i._data.viewMode!==o.AnnotationViewMode.ALL&&(t._level===i._data.viewMode?t.show():t.hide()),i.page.trigger("page"+i.page.pageIndex()+".annotation.drawEnd"),i.page.trigger("add.annotation",t)):i.page.trigger("page"+i.page.pageIndex()+".annotation.drawEnd"),i.page._drawing=!1}),i._graphicNode=i._graphic.node,this._setVisible(!0))},_createConvertImageNode:function(){this._canvas||(this._canvas=e.createElement("canvas"),this._canvas.width=this._data.width,this._canvas.height=this._data.height,this._canvas.style.background="transparent",this._context=this._canvas.getContext("2d"),this._imageDataURL=null)},refreshImage:function(t){if(this._canvas.width=this._data.width,this._canvas.height=this._data.height,0!==this._canvas.width&&0!==this._canvas.height&&this.page.getImageFile().getCanvasImageData()){this._context.clearRect(0,0,this._canvas.width,this._canvas.height),this.page.getImageFile().getCanvasImageData()?this._context.putImageData(this.page.getImageFile().getCanvasImageData(),0,0):this._canvas.getContext("2d").drawImage(this.page._imageRenderNode,0,0,this._data.width,this._data.height);for(var e=this.itemsToJSON(),i=0;i<e.length;i++){var n=e[i];n&&(n.anntype!==o.AnnotationType.ETERNITYRECT&&n.anntype!==o.AnnotationType.MASK&&n.anntype!==o.AnnotationType.IMAGEAREA||(this._context.fillStyle=n.anntype===o.AnnotationType.MASK?n.fill:"#ffffff",this._context.fillRect(n.x,n.y,n.width,n.height),this._context.save()))}this._imageDataURL=this._canvas.toDataURL(),this._annotationImage.src=this._imageDataURL,this._annotationImage.width=this._canvas.width,this._annotationImage.height=this._canvas.height}},refreshItem:function(){for(var t=this._items,e=0;e<t.length;e++){var i=t[e];i.attr("anntype")!==o.AnnotationType.STICKYNOTE&&(i.attr("anntype")!==o.AnnotationType.TEXT||this.annotationConfig.text.fixed)&&i.fixed||i.rotate(this.page.data("angle"))}},getImageDataURL:function(){if(this._imageDataURL)return this._imageDataURL},getImageData:function(t,e,i,n){if(this._context)return i=this._canvas.width,n=this._canvas.height,this._context.getImageData(t=t||0,e=e||0,i,n)},toImage:function(t,e){if(this._imageDataURL)return this._annotationImage},_setVisible:function(t,e){if(this._visible=t,this._graphicNode)if(void 0===e||e===o.AnnotationViewMode.ALL)this._graphicNode.style.display=this._visible?"block":"none";else{this._visible&&(this._graphicNode.style.display="block");for(var i=0;i<this._items.length;i++){var n=this._items[i];e!==n._level&&t?n._setVisible(!1):n._setVisible(t)}}},isVisible:function(){return this._visible},show:function(t){this._setVisible(!0,t)},hide:function(t){this._setVisible(!1,t)},getGraphicNode:function(){return this._graphicNode},drawing:function(t,e,i){t=this.createAnnotationItem(t,e);t&&this._graphic.draw(t,i)},data:function(t,e){return a.data.apply(this,Array.prototype.slice.call(arguments,0))},drawingItems:function(t,e){var i,n=0,o=[];if(Array.isArray(e))for(n=0,i=e.length;n<i;n++){var a=e[n],a=this.createAnnotationItem(t,a);a&&(a.draw(),o.push(a))}return o},createAnnotationItem:function(t,e,i){return h.AnnotationItemFactory.createItem(e.anntype,t,e,i)},viewportUpdate:function(t,e,i,n,o,a){this._graphic.viewportUpdate(t,e,i,n,o,a)},getViewport:function(){if(this._graphic)return this._graphic._ownerWrapper.data()},addItem:function(t){return this._items.push(t),this},redrawItem:function(t){return t&&t.redraw(!1),this},redraw:function(t,e){if(t)this.redrawItem(t,e);else for(var i=this._items||[],n=i.length,o=0;o<n;o++)this.redrawItem(i[o]);a.isFunction(e)&&e.call(this,!0)},removeItem:function(t,e){for(var i=this._items,n=i.length,o=[],a=this,r=0;r<n;r++){var s=i[r];"string"!=typeof t||t!==s.el.id?t!==s?o.push(s):t.remove(e):s.remove()}this._items=o,setTimeout(function(){a.refreshImage()},200)},removeAllItem:function(){for(var t=this._items,e=t.length,i=0;i<e;i++)t[i].el&&this.removeItem(t[i]);this.data("items",[])},itemsToJSON:function(){for(var t=0,e=this._items.length,i=[],t=0;t<e;t++){var n=this._items[t];n.attr("id",t+1),i.push(n.attrToJson())}return i},setProp:function(t,e){this._procQueue.push({propType:e,item:t}),this._isInProgress||this.runSetProp()},runSetProp:function(t){t&&this._procQueue.shift();t=0<this._procQueue.length;if(t&&1<this._items.length){this._isInProgress=t;for(var t=this._procQueue[0].propType,e=this._procQueue[0].item,i=this._items,n=[],o=i.length,a=-1,r=0,s=this.runSetProp,r=0;r<o;r++){var l=i[r];if(e.el.id===l.el.id){a=r;break}}if(h.Type.AnnotationSetPropType.INDEX_FIRST===t){for(r=0;r<o;r++)r!==a&&n.push(i[r]);n.push(e)}else if(h.Type.AnnotationSetPropType.INDEX_LAST===t)for(n[0]=e,r=0;r<o;r++)r!==a&&n.push(i[r]);else if(h.Type.AnnotationSetPropType.INDEX_FRONT===t&&0<o&&a<o-1)for(r=0;r<o;r++)r===a?n.push(i[a+1]):r===a+1?n.push(i[a]):n.push(i[r]);else if(h.Type.AnnotationSetPropType.INDEX_BACK===t&&0<a)for(r=0;r<o;r++)r===a?n.push(i[a-1]):r===a-1?n.push(i[a]):n.push(i[r]);else n=i;this._items=n,this.redraw(null,s)}else this._isInProgress=!1},getItem:function(t){if(t){for(var e,i=this._items,n=i.length,o=0;o<n;o++){var a=i[o];t.id===a.el.id&&(e=a,o=n)}return e}return void 0===this._items&&(this._items=[]),this._items},getItemById:function(t){for(var e,i=this._items,n=i.length,o=0;o<n;o++){var a=i[o];if(a.attr("id")===t){e=a;break}}return e}},h.core.Annotation=i}),InziSForm.create(function(e,t,i){"use strict";function n(t){this._attr=e.Utils.extend({itemIdx:-1,itemId:0,name:null,annotationId:null,presetAnnotationId:!1,docFormCode:null,formName:null,param:null,empId:null,createTime:null,additionalInfo:null,initItem:!1,size:0,type:null,rotate:0,fileStorageType:"",fileStorageAddOption:{storageKey:null,profile:null,datas:null},pages:null,annotationType:null},t),this._itemId=this._attr.itemId,this._itemIdx=this._attr.itemIdx,this._name=this._attr.name,this._size=this._attr.size,this._type=this._attr.type,this._annotationId=this._attr.annotationId,this._fileStorageType=this._attr.fileStorageType,this._attr.rotate=s.isNumeric(this._attr.rotate)?s.toInt(this._attr.rotate):0,this._pageInfo={itemId:this._itemId,annotationId:this._annotationId,pageNo:0,pageCount:-1,itemPageNo:0,currentPageNo:0},this._pages=[],this._pageRanges=null,this._thumbnailInfo={pageNo:1,running:!1,items:[]},this._status=0,this._enable=!0,this._loaded=!1,this.init()}var s=e.Utils;n.prototype.init=function(){this._pageRanges=[];for(var t,e=(this._attr.pages||"").split(","),i=0;i<e.length;i++){var n,o,a=e[i].trim();o=-1!=a.indexOf("-")?2==(n=a.split("-")).length?(t=s.isNumeric(n[0])?s.toInt(n[0]):0,s.isNumeric(n[1])?s.toInt(n[1]):0):t=0:t=s.isNumeric(a)?s.toInt(a):0;for(var r=t;r<=o;r++)0<r&&-1===this._pageRanges.indexOf(r)&&this._pageRanges.push(r)}this._pageRanges.sort(function(t,e){return t-e})},n.prototype.pages=function(t){return 1===arguments.length?this._pages[t]:this._pages},n.prototype.isLoaded=function(){return this._loaded},n.prototype.isInitItem=function(){return this._attr.initItem},n.prototype.enable=function(t){if(!(0<arguments.length))return this._enable;this._enable=t},n.prototype.loaded=function(t){this._loaded=t},n.prototype.getItemId=function(){return this._itemId},n.prototype.getItemIdx=function(){return this._itemIdx},n.prototype.setItemIdx=function(t){this._itemIdx=t},n.prototype.getName=function(){return this._name},n.prototype.setName=function(t){this._name=t},n.prototype.getType=function(){return this._type},n.prototype.setType=function(t){this._type=t},n.prototype.getSize=function(){return this._size},n.prototype.setSize=function(t){this._size=t},n.prototype.setAnnotationId=function(t){this._annotationId=t},n.prototype.getAnnotationId=function(){return this._annotationId},n.prototype.getPageInfo=function(){return this._pageInfo},n.prototype.setPageInfo=function(t){1===arguments.length?this._pageInfo=s.extend(this._pageInfo,t):this._pageInfo[t]=arguments[1]},n.prototype.getThumbnailInfo=function(){return this._thumbnailInfo},n.prototype.setThumbnailInfo=function(t){this._thumbnailInfo=s.extend(this._thumbnailInfo,t)},n.prototype.getCreateTime=function(){return this._attr.createTime},n.prototype.getEmpId=function(){return this._attr.empId},n.prototype.getDocFormCode=function(){return this._attr.docFormCode},n.prototype.setDocFormCode=function(t){this._attr.docFormCode=t},n.prototype.getParam=function(){return this._attr.param},n.prototype.getAdditionalInfo=function(){return this._attr.additionalInfo},n.prototype.isPresetAnnotationId=function(){return this._attr.presetAnnotationId},n.prototype.setPresetAnnotationId=function(t){return this._attr.presetAnnotationId=t},n.prototype.getRotate=function(){return this._attr.rotate},n.prototype.setRotate=function(t){return this._attr.rotate=t,this},n.prototype.getFileStorageType=function(){return this._fileStorageType},n.prototype.setFileStorageType=function(t){this._fileStorageType=t},n.prototype.setFileStorageAddOption=function(t){this._attr.fileStorageAddOption=t},n.prototype.getFileStorageAddOption=function(){return this._attr.fileStorageAddOption},n.prototype.setAnnotationType=function(t){this._attr.annotationType=t},n.prototype.getAnnotationType=function(){return this._attr.annotationType},n.prototype.isPageRangeView=function(){return 0<this._pageRanges.length},n.prototype.refreshPageRange=function(){if(this._pageInfo.pageCount<1)this._pages=[];else{for(var t,e=[],i=0,n=this._pageRanges.length;i<n;i++)(t=this._pageRanges[i])<=this._pageInfo.pageCount&&0<t&&e.push(t);this._pages=e}},n.prototype.getPageCount=function(){return this.isPageRangeView()&&this.isLoaded()?this._pages.length:this._pageInfo.pageCount},e.core.FileItem=n}),InziSForm.create(function(i,n,t){"use strict";function e(t){this._attr=i.Utils.extend({itemId:"",name:null,docFormCode:null,param:null},t),this._pageCount=0,this._fileItems=[]}i.Utils;e.prototype.getItemId=function(){return this._attr.itemId},e.prototype.getDocFormCode=function(){return this._attr.docFormCode},e.prototype.setFileItems=function(t){if(n.Array.isArray(t))for(var e=0,i=t.length,e=0;e<i;e++)this._fileItems.push(this._convertToFileItem(t[e]));else this._fileItems.push(this._convertToFileItem(t))},e.prototype.getFileItems=function(t){return this._fileItems},e.prototype._convertToFileItem=function(t){var e=new i.core.FileItem({itemId:t.fileId||"",name:t.name||t.fileName,annotationId:t.annotationId||"",createTime:t.createTime||"",empId:t.empId||"",docFormCode:t.docFormCode||"",param:this.getParam()});return e.setPageInfo({pageCount:t.pageCount||-1}),e},e.prototype.getParam=function(){return this._attr.param},i.core.DocItem=e}),InziSForm.create(function(i,t,e){"use strict";function n(){}i.Type,i.Element;n.ITEM_MAP={arc:"Arc",arrowline:"ArrowLine",checkmark:{text:"CheckMark",image:"CheckMarkImage"},ellipse:"Ellipse",circle:"Circle",highlighterpen:"HighlighterPen",highlighter:{pen:"Highlighter",rect:"HighlighterRect"},image:"Image",line:"Line",memo:"Memo",text:"Memo",memopad:"MemoPad",polycurve:"Polycurve",polygon:"Polygon",protractor:"Protractor",polyline:"Polyline",pen:"Pen",rect:"Rect",stamp:"Stamp",imagearea:"ImageArea",hiddenarea:"HiddenArea",mask:"Masking",edittext:"EditText",stickynote:"StickyNote",eternityrect:"EternityRect",grid:"Grid",chord:"Chord",pie:"Pie",blackmarking:"Blackmarking"},n.createItem=function(t){var t=t.toLowerCase(),e=i.setting("annotationConfig")[t],t=this.ITEM_MAP[t],t=(e&&e.type&&(t=t[e.type]),i.annotation[t]);if(t)return t=new t((t=Array.prototype.slice.call(arguments,1))[0],t[1],t[2]),e&&(t.editable(e.editable),t._enabledContextmenu=e.contextmenu,t.fixed=e.fixed),t},i.AnnotationItemFactory=n}),InziSForm.create(function(e,t,i){"use strict";e.Type,e.Element;function n(){}var o={CANVAS:"Canvas",SVG:"SVG",SNAP:"Snap",IMAGE:"Image"};n.createGraphic=function(t){t=t.toUpperCase();var t=e.graphics[o[t]];if(t)return new t((t=Array.prototype.slice.call(arguments,1))[0],t[1],t[2],t[3])},e.GraphicsFactory=n,e.ns(e.moduleName+".graphics")}),InziSForm.create(function(t,e,i){"use strict";t.Type,t.Element;var s=t.Utils;function o(t,e,i,n){var e=e||t,e=(o=(i=i||t)[0]-e[0],i=i[1]-e[1],{length:Math.sqrt(Math.pow(o,2)+Math.pow(i,2)),angle:Math.atan2(i,o)}),i=e.angle+(n?Math.PI:0),o=.2*e.length;return[t[0]+Math.cos(i)*o,t[1]+Math.sin(i)*o]}function a(t){return t.reduce(function(t,e,i,n){return 0===i?"M "+e[0]+","+e[1]:t+" "+(t=e,i=o((e=n)[(n=i)-1],e[n-2],t),e=o(t,e[n-1],e[n+1],!0),"C "+i[0]+","+i[1]+" "+e[0]+","+e[1]+" "+t[0]+","+t[1])},"")}function n(t,e){var i=[],n=0;if("arc"===t){for(n=0;n<e.length;n++)0===n?i.push("M"):2===n&&5<e.length&&i.push("Q"),i.push(e[n]);return i.join(" ")}if("chord"===t){for(n=0;n<e.length;n++)0===n?i.push("M"):2===n&&5<e.length&&i.push("Q"),i.push(e[n]);return 5<e.length&&i.push("L"+e[0]+" "+e[1]),i.join(" ")}if("pie"===t){for(n=0;n<e.length;n++)0===n?i.push("M"):2===n&&5<e.length&&i.push("Q"),i.push(e[n]);return 5<e.length&&(i.push("L"+e[0]+" "+e[5]),i.push("L"+e[0]+" "+e[1])),i.join(" ")}if("polycurve"===t){for(var o=[],n=0;n<e.length;n+=2)o.push([e[n],e[n+1]]);return a(o)}for(n=0;n<e.length;n++)0===n?i.push("M"):n%2==0&&i.push("L"),i.push(e[n]);return i.join(" ")}function r(t,e,i,n){this._container=t,this.node=null,this.width=e,this.height=i,this._callback=n,this._init(),this._drawing=!1,this._redrawing=!1}r.prototype.pathToString=function(t){for(var e="",i=0,n=t.length;i<n;i++)e+=t[i].join(" ");return e},r.prototype.pointsToPath=n,r.prototype.getStrokeWidth=function(t,e,i){return t=t||0},r.prototype.getPathToPoints=function(t){for(var e=(t.path||"").split(" "),i=[],n=0,o=e.length;n<o;n+=2){var a=(a=e[n].replace("M","")).replace("L",""),r=e[n+1];i.push(s.toInt(a)),i.push(s.toInt(r))}return i},r.prototype.getPoints=function(t){var e=[],i=(void 0===t.points&&(t.points=[]),t.points?t.points.length:0),n=0;if(0<i)for(n=0;n<i;n++){var o=t.points[n];e.push(s.toFloat(o.x)),e.push(s.toFloat(o.y))}else(t.x||t.y)&&(e.push(t.x),e.push(t.y));return e},r.prototype.createNode=function(){},r.prototype.render=function(){},r.prototype.renderAll=function(){},r.prototype.rect=function(){},r.prototype.text=function(){},r.prototype.line=function(){},r.prototype.polyline=function(){},r.prototype.polygon=function(){},r.prototype.circle=function(){},r.prototype.ellipse=function(){},r.prototype.path=function(){},r.prototype.rect=function(){},r.prototype.marker=function(){},r.prototype.mask=function(){},r.prototype.addHandler=function(){},r.prototype.removeHandler=function(){},t.graphics.Graphics=r}),InziSForm.create(function(t,e,i){"use strict";t.Type;function n(t,e,i,n){return this._container=t,this.node=null,this.width=e,this.height=i,this._callback=n,this._context=null,this._init(),this._drawing=!1,this}var o=t.Element;t.inherit(n,t.graphics.Graphics),n.prototype._init=function(){this.node||this._createNode()},n.prototype._createNode=function(){this.node=o.createCanvas({width:this.width,height:this.height},this._container),this.node.style.position="absolute",this.node.style.background="transparent",this._context=this.node?this.node.getContext("2d"):null},n.prototype.clear=function(t,e,i){t=t||this._context,e=e||this.width,i=i||this.width,t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e,i)},n.prototype.renderImage=function(t,e){},n.prototype.rect=function(t,e){},n.prototype.text=function(t,e){},n.prototype.line=function(t,e){},n.prototype.polyline=function(t,e){},n.prototype.polygon=function(t,e){},n.prototype.circle=function(t,e){},n.prototype.ellipse=function(t,e){},n.prototype.path=function(t,e){},n.prototype.rect=function(t,e){},n.prototype.arc=function(t,e){},n.prototype.mask=function(t,e,i){return(i=i||this._context).restore(),i.fillStyle=t.fill,i.fillRect(t.x,t.y,t.width,t.height),i.save(),this},n.prototype.restore=function(){return this._context.restore(),this},n.prototype.save=function(){return this._context.save(),this},n.prototype.roundRect=function(t,e,i,n,o,a,r,s){return void 0===o&&(o=5),(s=s||this._context).beginPath(),s.moveTo(t+o,e),s.lineTo(t+i-o,e),s.quadraticCurveTo(t+i,e,t+i,e+o),s.lineTo(t+i,e+n-o),s.quadraticCurveTo(t+i,e+n,t+i-o,e+n),s.lineTo(t+o,e+n),s.quadraticCurveTo(t,e+n,t,e+n-o),s.lineTo(t,e+o),s.quadraticCurveTo(t,e,t+o,e),s.closePath(),r&&(s.strokeStyle=r,s.stroke()),a&&(s.fillStyle=a,s.fill()),this},t.graphics.Canvas=n}),InziSForm.create(function(t,e,i){"use strict";function n(t){this.element=t}t.Type,t.Element;t.inherit(n,t.graphics.Graphics),n.prototype.rect=function(){},n.prototype.text=function(){},n.prototype.line=function(){},n.prototype.polyline=function(){},n.prototype.polygon=function(){},n.prototype.circle=function(){},n.prototype.ellipse=function(){},n.prototype.path=function(){},n.prototype.rect=function(){},n.prototype.marker=function(){},n.prototype.image=function(){},n.prototype.image=function(){},t.graphics.SVG=n}),InziSForm.create(function(b,t,n){"use strict";function e(t,e,i,n){return this._container=t,this.node=null,this.width=e,this.height=i,this._callback=n,this._init(),this._drawing=!1,this._drawingEndFun,this}var p=b.Type,d=b.Element,_=b.Utils,g=b.setting("annotationConfig"),i={position:"absolute","z-index":200,left:"0px",top:"0px",overflow:"hidden",background:"rgba(255,255,255,0)"};function u(t,e,i,n){var o,a=p.Marker;return a.hasOwnProperty(t)&&t!==p.MarkerType.NONE&&((t=(a=a[t]).attr).fill=i.stroke,t.stroke=i.stroke,i=_.toInt(t["fill-opacity"],0)<1?0:1,t["fill-opacity"]=i,o=e.path().attr(t).marker(0,0,a.markerWidth,a.markerHeight,a.refX,a.refY).attr({orient:a.orient,viewBox:a.viewBox,fill:t.fill,"fill-opacity":i,markerUnits:a.markerUnits,markerWidth:(n||a.markerWidth)/2,markerHeight:(n||a.markerHeight)/2,type:a.type})),o}b.inherit(e,b.graphics.Graphics),e.prototype._init=function(){this.node||this._createNode()},e.prototype.drawStart=function(t){this._callback&&this._callback(t)},e.prototype.drawing=function(t){this._callback&&this._callback(t)},e.prototype.drawEnd=function(t,e){!t&&this._drawingItem&&this._drawing&&!e&&0<(this._ownerWrapper.events||[]).length&&this._ownerWrapper.mouseup(),this._drawingItem=null,this._callback&&!this._redrawing&&this._callback(t,e),this.undraw()},e.prototype._createNode=function(t){var e=b.Element.createElementNS(this._container,"svg",{style:b.Utils.mapToString(i,":",";"),width:this.width,height:this.height,focusable:!1,id:b.Utils.getRandomId(b.Type.ControlType.ANNOTATION)});this.node=e,this._ownerWrapper=Snap(e),this._drawWrapper=this._ownerWrapper.svg(0,0,this.width,this.height,0,0,this.width,this.height),this._createGroup()},e.prototype._createPattern=function(t){var t="hiddenAreaPattern_"+t+"_"+(new Date).getTime(),e=this._ownerWrapper.ptrn(0,0,10,10).attr({id:t,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"}),i=this._ownerWrapper.rect(0,0,10,10).attr({stroke:"#000000",strokeWidth:3,fill:"#ffffff"});return e.add(i),t},e.prototype._createGroup=function(){this._completeGroup=this._drawWrapper.select(".group-complete"),this._controlGroup=this._drawWrapper.select(".group-control"),_.isEmpty(this._completeGroup)&&(this._completeGroup=this._drawWrapper.g().attr("class","group-complete")),_.isEmpty(this._controlGroup)&&(this._controlGroup=this._drawWrapper.g().attr("class","group-control"))},e.prototype.viewportUpdate=function(t,e,i,n,o,a){this.undraw(),n&&(t=0);var r=this._container,c=this._controlGroup.node.childNodes.length,s=_.toInt(r.style.width||0),l=_.toInt(r.style.height||0),r=(_.toInt(r.style.top),_.toInt(r.style.left),[0,0,s,l]),h=t/180,s=(.5==h||-1.5==h?r.splice(0,1,-s):1==h||-1==h?r.splice(0,2,-s,-l):1.5!=h&&-.5!=h||r.splice(1,1,-l),d.attr(this._ownerWrapper.node,{width:s,height:l}),d.attr(this._drawWrapper.node,{width:s,height:l,viewBox:r.join(" "),"viewport-fill":"red"}),0<c&&((h=this._controlGroup).attr({transform:this._ownerWrapper.data("txInvertMatrix")}),h.removeClass("group-control"),this._completeGroup.add(h),this._controlGroup=this._drawWrapper.g().addClass("group-control")),this._controlGroup.attr({transform:"transform("+r[0]+","+r[1]+")",ra:t,tx:r[0],ty:r[1],sx:e,sy:i}),new Snap.Matrix),l=(Math.abs(t)%180==0||n?n?s.scale(o,a):s.scale(e,i):s.scale(i,e),s.rotate(t),this._completeGroup.attr({transform:s.toTransformString()}),s.translate(r[0],r[1]),new Snap.Matrix);l.scale(1/e,1/i),l.rotate(-t),l.translate(r[0],r[1]),this._ownerWrapper.data({txCurrentMatrix:s.toTransformString(),txInvertMatrix:l.toTransformString(),currentMatrix:s,invertMatrix:l,sx:e,sy:i})},e.prototype.draw=function(t,e,i){var n=this._controlGroup.data("matrix"),i=(this._drawing=void 0!==e&&e,this._redrawing=i||!1,e?(this._drawGroup=this._controlGroup,t.data("invertMatrix",this._ownerWrapper.data("invertMatrix"))):this._drawGroup=this._completeGroup.g(),{rect:this.rect,circle:this.circle,line:this.line,arrowline:this.arrowline,polyline:this.polyline,polygon:this.polygon,pen:this.pen,highlighter:this.highlighterRectType,highlighterPenType:this.highlighter,highlighterPen:this.highlighter,memo:this.memo,text:this.memo,edittext:this.memo,memopad:this.memopad,stamp:this.stamp,checkmark:this.checkmark,ellipse:this.ellipse,polycurve:this.polycurve,protractor:this.protractor,arc:this.arc,imagearea:this.imagearea,hiddenarea:this.hiddenarea,mask:this.mask,stickynote:this.stickynote,EternityRect:this.hiddenarea,image:this.image,grid:this.grid,chord:this.chord,pie:this.pie,blackmarking:this.blackmarking}),e=t.attr(),o=_.clone(e),i=(o.width=o.width||0,o.height=o.height||0,o["fill-opacity"]=o["fill-opacity"],o.x=Math.max(0,o.x),o.y=Math.max(0,o.y),i[e.anntype]);"function"==typeof i&&(this._drawingItem=t,this._drawWrapper.data("currentMatrix",n),i.call(this,o,t))},e.prototype.undraw=function(){for(var t=this._ownerWrapper.events||[],e=t.length,i=0;i<e;i++){var n=t.pop();n&&n.unbind()}b.Element.removeClass(this.node,b.moduleClassName+"-drawing"),this._drawing=!1},e.prototype.render=function(){},e.prototype.renderAll=function(){},e.prototype.rect=function(l,e){function t(){var t;l.width<e.minWidth&&l.height<e.minHeight?r.drawEnd(null,!0):(t={x:l.x,y:l.y,width:l.width,height:l.height},e.attr(t),r.drawEnd(e))}var i=l.x,n=l.y,o=l.width,a=l.height,r=this,h=((this._drawing||g.rect.fixedOpacity)&&(l["fill-opacity"]=g.rect.fillOpacity),this._drawGroup.rect(i,n,o,a).attr({stroke:l.stroke,strokeWidth:l["stroke-width"],strokeOpacity:1,fill:l.fill,fillOpacity:l["fill-opacity"],ox:i,oy:n,anntype:l.anntype,transform:l.transform}));e.attr(l),e.setElement(h);this._drawing?this._ownerWrapper.mousemove(function(t){var e=_.toInt(h.attr("ox")),i=_.toInt(h.attr("oy")),n=b.Element.getLayerX(t),t=b.Element.getLayerY(t),o=e,a=i,r=n-o,s=t-a;r<0&&s<0?(r=e-(o=n),s=i-(a=t)):r<0?r=e-(o=n):s<0&&(s=i-(a=t)),l.x=o,l.y=a,l.width=r,l.height=s,h.attr({x:l.x,y:l.y,width:l.width,height:l.height})}).mouseup(t):t()},e.prototype.grid=function(l,e){function t(){var t;l.width<20&&l.height<20?(h.remove(),s.remove(),a.drawEnd(null,!0)):(t={x:l.x,y:l.y,width:l.width,height:l.height},e.attr(t),a.drawEnd(e))}var i=l.x,n=l.y,o=l.width,c=l.height,a=this,r=e.attr("pattern"),s=this._drawGroup.paper.path("M0 0 L"+r.width+" 0 M0 0 L0 "+r.height).attr({fill:"none",stroke:r.stroke,strokeWidth:r["stroke-width"],strokeDasharray:r["stroke-dasharray"]}).pattern(0,0,r.width,r.height),h=(e.pattern=s,this._drawGroup.rect(i,n,o,c).attr({stroke:l.stroke,strokeWidth:l["stroke-width"],strokeOpacity:1,fill:s,fillOpacity:l["fill-opacity"],ox:i,oy:n,anntype:l.anntype,transform:l.transform}));e.attr(l),e.setElement(h);this._drawing?this._ownerWrapper.mousemove(function(t){var e=_.toInt(h.attr("ox")),i=_.toInt(h.attr("oy")),n=b.Element.getLayerX(t),t=b.Element.getLayerY(t),o=e,a=i,r=n-o,s=t-a;r<0&&s<0?(r=e-(o=n),s=i-(a=t)):r<0?r=e-(o=n):s<0&&(s=i-(a=t)),l.x=o,l.y=a,l.width=r,l.height=s,h.attr({x:l.x,y:l.y,width:l.width,height:l.height})}).mouseup(t):t()},e.prototype.stamp=function(t,c){t.x,t.y;var i=this,p=4,e=function(t){var e=new Image;e.src=t["image-href"],e.onload=function(){t["image-height"]=e.height,t["image-width"]=e.width,n.call(i,t)}},n=function(t){var e,i,n,o=this._drawGroup.g(),a=0===t["stroke-width"]?3:0,r=t.x,s=t.y,l=t.width,h=t.height;t.text&&(l=(i=(e=this._drawGroup.text(r,s,t.text).attr({"text-anchor":b.Type.AnnotationAttribute.TEXT_ALIGN[t["text-halign"]],stroke:t["font-color"],strokeWidth:"bold"===t["font-weight"]?2:1,"font-style":t["font-style"],"font-weight":t["font-weight"],"font-family":t["font-family"],fill:t["font-color"],"font-size":t["font-size"],"alignment-baseline":"hanging"})).getBBox()).width+2*p,h=i.height+2*p,1===t["text-halign"]?r+=l/2:2===t["text-halign"]&&(r+=l),r+=p,s=t.y+(t["font-size"]*(-1!==_.IEVersion()||_.isBrowser().wEdge())?0:1)+p,e.attr({x:r,y:s})),t["image-href"]&&(t["image-height"]>(i=100)||t["image-width"]>l?i=t["image-height"]*(l/t["image-width"]):t["image-height"]<i/2&&(i/=2),h+=i,n=this._drawGroup.image().attr({"xlink:href":t["image-href"],x:t.x,y:t.y,width:l,height:i,preserveAspectRatio:"none"}),s=t.y+i+(t["font-size"]*(-1!==_.IEVersion()||_.isBrowser().wEdge())?0:1)+p,e.attr("y",s)),r=this._drawGroup.rect(t.x,t.y,l,h).attr({stroke:t.stroke||"#ff0000",strokeWidth:a,fill:"#ffffff",fillOpacity:1}),o.add(r),n&&o.add(n),o.add(e),o.attr("anntype",t.anntype),c.attr(t),c.setElement(o),c.selected(c.isSelected()),this.drawEnd(c)};function o(t){(_.isNotEmpty(t["image-href"])?e:n).call(this,t)}this._drawing?(t["stroke-width"]=0,t.page=c.page,t.node=d.parent(this._container,".sform-contents"),b.UI.stamp(t,function(t){o.call(i,t)})):o.call(i,t)},e.prototype.text=function(t,e){},e.prototype.line=function(t,i){function e(){var t=_.toNotEmpty(a-n,-1),e=_.toNotEmpty(r-o,-1);Math.abs(t)<20&&Math.abs(e)<20?(l.remove(),s.drawEnd(null,!0)):(i.setElement(l),s.drawEnd(i))}var n=t.x1||t.x,o=t.y1||t.y,a=t.x2||t.x,r=t.y2||t.y,s=this,l=this._drawGroup.line(n,o,a,r).attr({stroke:t.stroke||t.stroke,strokeWidth:t["stroke-width"]||t.strokeWidth,fill:t.fill,ox1:n,oy1:o,ox2:a,oy2:r,anntype:t.anntype,"vector-effect":"non-scaling-stroke"});this._drawing?this._ownerWrapper.mousemove(function(t){var e=b.Element.getLayerX(t),t=b.Element.getLayerY(t),e={x1:n,y1:o,x2:e,y2:t};a=e.x2,r=e.y2,l.attr(e),i.attr(e)}).mouseup(e):e()},e.prototype.polyline=function(t,e){t.x,t.y;var n="",i=this,o=this.getPoints(t),a=this._drawGroup.polyline().attr({stroke:t.stroke,strokeWidth:t["stroke-width"],fill:"none",anntype:t.anntype,points:o,transform:t.transform,"vector-effect":"non-scaling-stroke"}),r=function(){e.setElement(a),e.data("points",o),i.drawEnd(e)};this._drawing?this._ownerWrapper.mousemove(function(t){var e=a.attr("points"),i=e.length,i=(2<i&&"mousemove"===n&&e.splice(i-2,2),b.Element.getLayerX(t)),t=b.Element.getLayerY(t);e.push(i),e.push(t),a.attr("points",e),n="mousemove"}).mousedown(function(t){if(2===t.button)return t.preventDefault(),t.stopPropagation(),r(),!1;var e=a.attr("points"),i=e.length,i=(2<i&&e.splice(i-2,2),b.Element.getLayerX(t)),t=b.Element.getLayerY(t);e.push(i),e.push(t),a.attr("points",e),n="mousedown"}):r()},e.prototype.polygon=function(t,a){t.x,t.y;var r="",e=this,i=e.getPoints(t),s=(this._drawing&&(t["fill-opacity"]=g.polygon.fillOpacity),this._drawGroup.polygon().attr({stroke:t.stroke,strokeWidth:t["stroke-width"],fill:t.fill,fillOpacity:t["fill-opacity"],anntype:t.anntype,points:i,transform:t.transform})),l=(a.attr(t),function(){a.setElement(s),e.drawEnd(a)});this._drawing?this._ownerWrapper.mousemove(function(t,e,i){var n=s.attr("points"),o=n.length,o=(2<o&&"mousemove"===r&&n.splice(o-2,2),b.Element.getLayerX(t)),t=b.Element.getLayerY(t);n.push(o),n.push(t),s.attr("points",n),a.data("points",n),r="mousemove"}).mousedown(function(t,e,i){var n,o;2===t.button?(t.preventDefault(),t.stopPropagation(),l()):(2<(o=(n=s.attr("points")).length)&&n.splice(o-2,2),o=b.Element.getLayerX(t),t=b.Element.getLayerY(t),n.push(o),n.push(t),s.attr("points",n),r="mousedown")}):(a.data("points",i),l())},e.prototype.circle=function(t,o){function e(){o.setElement(r),a.drawEnd(o)}var i=t.x,n=t.y,a=this,r=(this._drawing&&(t["fill-opacity"]=g.circle.fillOpacity),this._drawGroup.circle(i,n,0).attr({stroke:t.stroke,strokeWidth:t["stroke-width"],fill:t.fill,fillOpacity:t["fill-opacity"],cx:i+(t.r||0),cy:n+(t.r||0),r:t.r||0,anntype:t.anntype}));o.attr(t);this._drawing?this._ownerWrapper.mousemove(function(t){var e=_.toInt(r.attr("cx")),i=_.toInt(r.attr("cy")),n=b.Element.getLayerX(t),t=(b.Element.getLayerY(t),(t=e-n)<0?-t:t);r.attr("r",t),o.attr({cx:e,cy:i,r:t})}).mouseup(e):e()},e.prototype.ellipse=function(t,r){function e(){r.attr("width")<10||r.attr("height")<10?(h.remove(),s.drawEnd(null,!0)):s.drawEnd(r)}var i=t.x,n=t.y,o=t.cx,a=t.cy,c=t.rx,p=t.ry,s=this,l=(this._drawing&&(t["fill-opacity"]=g.ellipse.fillOpacity),{stroke:t.stroke,strokeWidth:t["stroke-width"],fill:t.fill,fillOpacity:t["fill-opacity"],ox:i,oy:n,anntype:t.anntype}),h=(o&&(l.cx=o,l.cy=a,l.rx=c,l.ry=p),r.attr(t),this._drawGroup.ellipse(i,n,0,0).attr(l));r.setElement(h);this._drawing?this._ownerWrapper.mousemove(function(t){var e=Math.round(h.attr("ox")),i=Math.round(h.attr("oy")),n=b.Element.getLayerX(t)-e,t=b.Element.getLayerY(t)-i,e=e+n/2,i=i+t/2,o=0,a=0,o=0<n?n/2:-n/2,a=0<t?t/2:-t/2;h.attr({cx:e,cy:i,rx:o,ry:a}),r.attr({cx:e,cy:i,rx:o,ry:a,x:e-o,y:i-a,width:2*o,height:2*a})}).mouseup(e):e()},e.prototype.memopad=function(n,o){var a=n.x,r=n.y,s=this,t={text:n.text,padding:4,x:n.x,y:n.y,width:n.width,height:n.height};function e(t){var e,i=t.text;_.isNotEmpty(i)?(i=s._drawGroup.rect(a,r,o.attr("width")-5,o.attr("height")).attr({x:a,y:r,fill:"#ffff99"}),e=s._drawGroup.image().attr({"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABR0lEQVRIS7VVS47DIAw16agXyUVyieyKNEfxWcqSS+RYUTUNI1ehIo6xoVLZVA3G9nvPHwfseO8TfQohOPpV/g8A8LLVzstJeSyH/N4MkB9YhtZ9RsztnPd+A4ATEsshv7+HMDiAxBFSgCbO13X9iTE+s/04jhdEpLdvHTgbhKo5gCA6iUznIDQPcgogUEP0idWCAAMCbDUWyFdLAFGOBOBKzrNRiVSlqCZyWS21CixtTggQcUBEqqyuzEtjNYDWF1xoKQPeD5oGbpqmy7Isf1KntzgXRZYQfJJ5TqCKYJ7na4zxkQ1bqJNQVRuNjDmfGrpaUZh9oDURr/mPEJRZSw6t8S0hOIwGaYDRBNg7efu93dLTuROdpsg1cWu6aPvgMK733WCuQp5AT4CuXbNTmEIIeXwf3r816PIqGJsIvhaAO7amaW8i/xoDI1SybNmqAAAAAElFTkSuQmCC",x:a,y:r,width:o.attr("width"),height:o.attr("height"),preserveAspectRatio:"none"}),i=s._drawGroup.g(i,e).attr("anntype",n.anntype),o.attr(t),o.setElement(i),s.drawEnd(o)):s.drawEnd(null,!0)}this._drawing?b.UI.memo({x:a,y:r,type:n.anntype,node:d.parent(this._container,".sform-contents")},function(t){n.text=t,e(n)}):e(t)},e.prototype.memo=function(y,v){var t=y.x,e=y.y,I=this,_=(this._drawing&&y.anntype===p.AnnotationType.EDITTEXT?(y["stroke-width"]=0,y["fill-opacity"]=0):(this._drawing||g[y.anntype].fixedOpacity)&&(y["fill-opacity"]=g[y.anntype].fillOpacity),!1),A=!1;function n(t,e,i,n,o){if(b.Utils.isNotEmpty(o)){var a=_?o.split("\n"):b.Element.convertTextareaLineBreakList(o,i-2*v.textPadding,n,y["font-size"],y["font-family"]),r=y["font-size"],c=y["font-style"]||"normal",p=y["font-weight"]||"normal",a=I._drawGroup.text(t,e,a).attr({tabindex:"-1",fill:y["font-color"]}),d=a.node.childNodes,s=t;1===y["text-halign"]?s=t+v.textPadding+i/2:2===y["text-halign"]&&(s=t+i-v.textPadding);for(var g,l=(d=a.node.childNodes).length,h=0,u=l;h<u;h+=1){var f=Snap(d[h]);g=I.textPosition(s,e,h,r,v.textPadding,y),f.attr({x:g.x,y:g.y+v.textPadding,"text-anchor":b.Type.AnnotationAttribute.TEXT_ALIGN[y["text-halign"]],fill:y["font-color"],"font-family":y["font-family"],"font-size":r+"px","font-style":c,"font-weight":p,"alignment-baseline":b.Type.AnnotationAttribute.TEXT_ALIGN_BASELINE[y["text-valign"]],tabindex:"-1"})}var m=a.getBBox(),l=r*l+2*v.textPadding,l=(n=A?l:Math.max(l,y.height),i=_?m.width+2*v.textPadding:Math.max(i,m.width),I._drawGroup.rect(t,e,i,n).attr({stroke:y.stroke||"#7dbcbe",strokeWidth:y["stroke-width"],fill:y.fill||"#ffffff",fillOpacity:y["fill-opacity"]})),i=(1===y["text-valign"]&&(t=(n+r-m.height)/2,a.attr("transform","translate(0,"+t+")")),y.text=o,y.height=n,I._drawGroup.g(l,a));i.attr("anntype",y.anntype),v.attr(y),v.setElement(i),I.drawEnd(v)}else I.drawEnd(null,!0)}g[y.anntype]&&"auto"==g[y.anntype].width&&(_=!0),g[y.anntype]&&"auto"==g[y.anntype].height&&(A=!0),y.anntype===p.AnnotationType.TEXT&&(y["stroke-width"]=g.text.stroke?g.text.strokeWidth:0),this._drawing?b.UI.memo({x:t,y:e,type:y.anntype,text:y.text,fontSize:y["font-size"],fontColor:y["font-color"],fontStyle:y["font-style"],fontWeight:y["font-weight"],fontFamily:y["font-family"],stroke:y.stroke,fillOpacity:y["fill-opacity"],fill:y.fill,node:d.parent(this._container,".sform-contents")},function(t){var e,i="",i="string"==typeof t?t:(t.fontSize&&(y["font-size"]=t.fontSize),y.fill=t.fill,y["fill-opacity"]=t.fillOpacity||1,y.stroke=t.stroke,t.fontFamily&&(y["font-family"]=t.fontFamily),!t.fontStyle||2===(e=t.fontStyle.split("|")).length&&(y["font-weight"]=e[0],y["font-style"]=e[1]),t.fontColor&&(y["font-color"]=t.fontColor),t.text);n(y.x,y.y,y.width,y.height,i)}):n(y.x,y.y,y.width,y.height,y.text)},e.prototype.stickynote=function(y,v){var t=y.x,e=y.y,I=this;function i(t,e,i,n,o,a){var r=[];if(0<(r=Array.isArray(a)?a:b.Element.convertTextareaLineBreakList(o,i-2*v.textPadding,n,y["font-size"],y["font-family"])).length&&_.isNotEmpty(o)||!I._drawing){for(var s=y["font-size"],c=y["font-style"]||"normal",p=y["font-weight"]||"normal",l=t,a=(1===y["text-halign"]?l=t-v.textPadding+i/2:2===y["text-halign"]&&(l=t+i-v.textPadding),I._drawGroup.text(t,e,r).attr({tabindex:"-1",fill:y["font-color"]})),d=a.node.childNodes,r=d.length,h=0,g=r;h<g;h+=1){var u=Snap(d[h]),f=I.textPosition(l,e,h,s,v.textPadding);u.attr({x:f.x,y:f.y,"text-anchor":b.Type.AnnotationAttribute.TEXT_ALIGN[y["text-halign"]],fill:y["font-color"],"font-family":y["font-family"],"font-size":s+"px","font-style":c,"font-weight":p,strokeWidth:y["stroke-width"],"alignment-baseline":b.Type.AnnotationAttribute.TEXT_ALIGN_BASELINE[y["text-valign"]],tabindex:"-1"})}var m=a.getBBox(),r=(n=Math.max(s*r+2*v.textPadding,y.height),I._drawGroup.rect(t,e,i,n).attr({stroke:y.stroke,strokeWidth:y["stroke-width"],fill:y.fill,fillOpacity:y["fill-opacity"]})),t=y["text-valign"]||0,t=(0<t&&(i=0,1===t?i=(n+s-m.height)/2:2===t&&(i=n-m.height),-1===_.IEVersion()&&!_.isBrowser().wEdge()||(i-=s+v.textPadding),i=Math.max(i,0),a.attr("transform","translate(0,"+i+")")),y.height=n,y.text=o,I._drawGroup.g(r,a));t.attr("anntype",y.anntype),v.attr(y),v.setElement(t),I.drawEnd(v)}else I.drawEnd(null,!0)}this._drawing&&("#000000"!==y.fill&&"#ffffff"!==y.fill||(y.fill="#ffff99",y.stroke="#ffff99"),y["fill-opacity"]=1),y["font-size"]=Math.max(y["font-size"],8),this._drawing?b.UI.memo({x:t,y:e,fontSize:y["font-size"],fontColor:y["font-color"],fontStyle:y["font-style"],fontWeight:y["font-weight"],fontFamily:y["font-family"],stroke:y.stroke,fill:y.fill,fillOpacity:y["fill-opacity"],textValign:y["text-valign"],textHalign:y["text-halign"],type:y.anntype,text:y.text,node:d.parent(this._container,".sform-contents")},function(t){var e;t.fontSize&&(y["font-size"]=t.fontSize),y.fill=t.fill,y["fill-opacity"]=t.fillOpacity,y.stroke=t.stroke,y["text-valign"]=t.textValign,y["text-halign"]=t.textHalign,t.fontFamily&&(y["font-family"]=t.fontFamily),!t.fontStyle||2===(e=t.fontStyle.split("|")).length&&(y["font-weight"]=e[0],y["font-style"]=e[1]),t.fontColor&&(y["font-color"]=t.fontColor),y.width=y.width||250,i(y.x,y.y,y.width,y.height,t.text)}):i(y.x,y.y,y.width,y.height,y.text)},e.prototype.textPosition=function(t,e,i,n,o){return{x:t+o,y:e+(n*(i+(-1!==_.IEVersion()||_.isBrowser().wEdge()?1:0))+o/2)}},e.prototype.arrowline=function(r,n){var t=r.x1||r.x,e=r.y1||r.y,i=r.x2||r.x,o=r.y2||r.y,s=this,l=(this._drawing&&(r["right-arrow-shape"]=1,r.fill="#000000"),this._drawGroup.line(t,e,i,o).attr({anntype:r.anntype})),h=u(p.MarkerType.getByIndex(p.MarkerType.DIRECTION_LEFT,r["left-arrow-shape"]),s._drawWrapper,r,r["las-size"]),c=u(p.MarkerType.getByIndex(p.MarkerType.DIRECTION_RIGHT,r["right-arrow-shape"]),s._drawWrapper,r,r["ras-size"]);l.data("markerLeft",h),l.data("markerRight",c),n.setElement(l),l.attr({markerStart:h,markerEnd:c,stroke:r.stroke,strokeWidth:r["stroke-width"],fill:r.fill,mx:t,my:e,anntype:r.anntype,transform:r.transform,"vector-effect":"non-scaling-stroke"}),l.data({x1:t,y1:e,x2:i,y2:o,"left-arrow-shape":r["left-arrow-shape"],"right-arrow-shape":r["right-arrow-shape"],"las-size":r["las-size"],"ras-size":r["ras-size"]});this._drawing?this._ownerWrapper.mousemove(function(t){var e=b.Element.getLayerX(t),t=b.Element.getLayerY(t),i=r.x1||r.x,n=r.y1||r.y,o=r["left-arrow-shape"]||0,a=r["right-arrow-shape"]||0;l.data("markerLeft")&&l.data("markerLeft").remove(),l.data("markerRight")&&l.data("markerRight").remove(),h=u(p.MarkerType.getByIndex(p.MarkerType.DIRECTION_LEFT,o),s._drawWrapper,r,r["las-size"]),c=u(p.MarkerType.getByIndex(p.MarkerType.DIRECTION_RIGHT,a),s._drawWrapper,r,r["ras-size"]),l.data("markerLeft",h),l.data("markerRight",c),l.attr({x1:i,y1:n,x2:e,y2:t,markerStart:h,markerEnd:c,"left-arrow-shape":o,"right-arrow-shape":a,"las-size":r["las-size"],"ras-size":r["ras-size"]}),l.data({x1:i,y1:n,x2:e,y2:t,"left-arrow-shape":o,"right-arrow-shape":a,"las-size":r["las-size"],"ras-size":r["ras-size"]})}).mouseup(function(t){r.x1=l.data("x1"),r.y1=l.data("y1"),r.x2=l.data("x2"),r.y2=l.data("y2"),r["left-arrow-shape"]=l.data("left-arrow-shape"),r["right-arrow-shape"]=l.data("right-arrow-shape");var e=_.toNotEmpty(r.x2-r.x1,-1),i=_.toNotEmpty(r.y2-r.y1,-1);Math.abs(e)<20&&Math.abs(i)<20?(l.remove(),s.drawEnd(null,!0)):(n.attr(r),n.setElement(l),s.drawEnd(n))}):(n.attr(r),s.drawEnd(n))},e.prototype.arc=function(o,t){o.x,o.y;var a="",r=this,s=r.getPoints(o),l=this._drawGroup.path(this.pointsToPath(o.anntype,s)).attr({stroke:o.stroke,strokeWidth:o["stroke-width"],fill:"none",anntype:o.anntype,"vector-effect":"non-scaling-stroke"}),h=function(){t.data("points",s),t.setElement(l),r.drawEnd(t)};this._drawing?this._ownerWrapper.mousemove(function(t){var e=s.length,i=b.Element.getLayerX(t),t=b.Element.getLayerY(t),e=(4<e&&"mousemove"===a&&s.splice(e-4,4),[i,s[1],i,t]);s=s.concat(e),l.attr("d",r.pointsToPath(o.anntype,s)),a="mousemove"}).mouseup(function(t){var e=s.length,i=b.Element.getLayerX(t),n=b.Element.getLayerY(t),e=(2<e&&s.splice(e-4,4),[i,s[1],i,n]);if(!(Math.abs(s[1]-n)<20))return 2===t.button?(t.preventDefault(),t.stopPropagation(),h(),!1):6===(s=s.concat(e)).length?(t.preventDefault(),t.stopPropagation(),void h()):(l.attr("d",r.pointsToPath(o.anntype,s)),void(a="mouseup"));l.remove(),r.drawEnd(null,!0)}):h()},e.prototype.chord=function(o,t){o.x,o.y;var a="",r=this,s=r.getPoints(o),l=this._drawGroup.path(this.pointsToPath(o.anntype,s)).attr({stroke:o.stroke,strokeWidth:o["stroke-width"],fill:o.fill,fillOpacity:o["fill-opacity"],anntype:o.anntype,"vector-effect":"non-scaling-stroke"}),h=function(){t.data("points",s),t.setElement(l),r.drawEnd(t)};this._drawing?this._ownerWrapper.mousemove(function(t){var e=s.length,i=b.Element.getLayerX(t),t=b.Element.getLayerY(t),e=(4<e&&"mousemove"===a&&s.splice(e-4,4),[i,s[1],i,t]);s=s.concat(e),l.attr("d",r.pointsToPath(o.anntype,s)),a="mousemove"}).mouseup(function(t){var e=s.length,i=b.Element.getLayerX(t),n=b.Element.getLayerY(t),e=(2<e&&s.splice(e-4,4),[i,s[1],i,n]);if(!(Math.abs(s[1]-n)<20))return 2===t.button?(t.preventDefault(),t.stopPropagation(),h(),!1):6===(s=s.concat(e)).length?(t.preventDefault(),t.stopPropagation(),void h()):(l.attr("d",r.pointsToPath(o.anntype,s)),void(a="mouseup"));l.remove(),r.drawEnd(null,!0)}):h()},e.prototype.pie=function(o,t){o.x,o.y;var a="",r=this,s=r.getPoints(o),l=this._drawGroup.path(this.pointsToPath(o.anntype,s)).attr({stroke:o.stroke,strokeWidth:o["stroke-width"],fill:o.fill,fillOpacity:o["fill-opacity"],anntype:o.anntype,"vector-effect":"non-scaling-stroke"}),h=function(){t.data("points",s),t.setElement(l),r.drawEnd(t)};this._drawing?this._ownerWrapper.mousemove(function(t){var e=s.length,i=b.Element.getLayerX(t),t=b.Element.getLayerY(t),e=(4<e&&"mousemove"===a&&s.splice(e-4,4),[i,s[1],i,t]);s=s.concat(e),l.attr("d",r.pointsToPath(o.anntype,s)),a="mousemove"}).mouseup(function(t){var e=s.length,i=b.Element.getLayerX(t),n=b.Element.getLayerY(t),e=(2<e&&s.splice(e-4,4),[i,s[1],i,n]);if(!(Math.abs(s[1]-n)<20))return 2===t.button?(t.preventDefault(),t.stopPropagation(),h(),!1):6===(s=s.concat(e)).length?(t.preventDefault(),t.stopPropagation(),void h()):(l.attr("d",r.pointsToPath(o.anntype,s)),void(a="mouseup"));l.remove(),r.drawEnd(null,!0)}):h()},e.prototype.pen=function(t,e){t.x,t.y;function i(){e.data("points",a.attr("points")),e.setElement(a),n.drawEnd(e)}var n=this,o=n.getPoints(t),a=(this._drawing||0!==o.length||(o=n.getPathToPoints(t)),this._drawGroup.polyline().attr({stroke:t.stroke||t.stroke,strokeWidth:t["stroke-width"]||t.strokeWidth,fill:"none",anntype:t.anntype,points:o,transform:t.transform,"vector-effect":"non-scaling-stroke"}));this._drawing?this._ownerWrapper.mousemove(function(t,e,i){var n=a.attr("points"),o=b.Element.getLayerX(t),t=b.Element.getLayerY(t);n.push(o),n.push(t),a.attr("points",n)}).mouseup(i):i()},e.prototype.penToPath=function(o,t){function e(){t.data("points",a),t.attr("path",l.attr("d")),t.setElement(l),s.drawEnd(t)}var i=o.x,n=o.y,a=this.getPathToPoints(o),r="",s=this,r=this._drawing?(a=[i,n,i,n],this.pathToString([["M",i,n],["L",i,n]])):o.path,l=this._drawGroup.path().attr({stroke:o.stroke||o.stroke,strokeWidth:o["stroke-width"]||o.strokeWidth,fill:"none",anntype:o.anntype,d:r,transform:o.transform,"vector-effect":"non-scaling-stroke"});this._drawing?this._ownerWrapper.mousemove(function(t,e,i){var n=b.Element.getLayerX(t),t=b.Element.getLayerY(t);a.push(n),a.push(t),l.data("points",n,t),l.attr("d",s.pointsToPath(o.anntype,a))}).mouseup(e):e()},e.prototype.highlighter=function(t,e){t.x,t.y;function i(){e.data("points",a.attr("points")),e.setElement(a),n.drawEnd(e)}var n=this,o=n.getPoints(t),a=this._drawGroup.polyline().attr({stroke:t.stroke||t.stroke,strokeWidth:t["stroke-width"]||e.attr("stroke-width"),fill:"none",anntype:t.anntype,points:o,transform:t.transform});this._drawing?this._ownerWrapper.mousemove(function(t,e,i){var n=a.attr("points"),o=b.Element.getLayerX(t),t=b.Element.getLayerY(t);n.push(o),n.push(t),a.attr("points",n)}).mouseup(i):i()},e.prototype.highlighterRectType=function(l,e){function t(){var t;l.width<20&&l.height<20?(h.remove(),r.drawEnd(null,!0)):(t={x:l.x,y:l.y,width:l.width,height:l.height},e.attr(t),r.drawEnd(e))}var i=l.x,n=l.y,o=l.width,a=l.height,r=this,h=(this._drawing?("#000000"!==l.fill&&"#ffffff"!==l.fill||(l.fill="#ffff00"),l["fill-opacity"]=g.highlighter.fillOpacity):l["stroke-width"]=e.attr("stroke-width"),l["fill-opacity"]=Math.min(l["fill-opacity"],e.maxFillOpacity()),this._drawGroup.rect(i,n,o,a).attr({fill:l.fill,stroke:l.stroke,strokeWidth:l["stroke-width"],strokeOpacity:e.attr("stroke-opacity"),fillOpacity:l["fill-opacity"],ox:i,oy:n,anntype:l.anntype,transform:l.transform}));e.attr(l),e.setElement(h);this._drawing?this._ownerWrapper.mousemove(function(t){var e=_.toInt(h.attr("ox")),i=_.toInt(h.attr("oy")),n=b.Element.getLayerX(t),t=b.Element.getLayerY(t),o=e,a=i,r=n-o,s=t-a;r<0&&s<0?(r=e-(o=n),s=i-(a=t)):r<0?r=e-(o=n):s<0&&(s=i-(a=t)),l.x=o,l.y=a,l.width=r,l.height=s,h.attr({x:l.x,y:l.y,width:l.width,height:l.height})}).mouseup(t):t()},e.prototype.protractor=function(n,o){n.x,n.y;var a="",t=this.getPoints(n),r=this,s=this._drawGroup.polyline().attr({stroke:n.stroke,strokeWidth:n["stroke-width"],fill:"none",anntype:n.anntype,points:t,transform:n.transform,"vector-effect":"non-scaling-stroke"}),l=this._drawGroup.text(t[0],t[1],"").attr({stroke:n.stroke,strokeWidth:1,"text-anchor":"middle",fill:"none",fontColor:n["font-color"]||"#000000"}),h=this._drawGroup.g(s,l).attr({anntype:n.anntype}),c=function(){o.setElement(h),r.drawEnd(o)};function p(t){var e=[],e=(e.push(t[2]),e.push(t[2]),Snap.angle(t[2],t[3],t[0],t[1])),i=Snap.angle(t[2],t[3],t[4],t[5]),e=(e=_.toFloat(e-i))<0?-e:e,i=_.toFloat(t[3]);!(i>t[1]&&i>t[5])&&(i>t[1]||i>t[5])?i-=20:i+=20,6===t.length&&(s.remove(),l.remove(),l=r._drawGroup.text(_.toFloat(t[2]),i,e).attr({stroke:n.stroke,strokeWidth:1,"text-anchor":"middle",fill:"none",fontColor:n["font-color"]||"#000000"}),t[2],t[3],t[0],t[1],t[4],t[5],h.g(s,l),h.attr("anntype",n.anntype),o.data("points",t))}this._drawing?this._ownerWrapper.mousemove(function(t){var e=s.attr("points"),i=e.length,i=(2<i&&"mousemove"===a&&e.splice(i-2,2),b.Element.getLayerX(t)),t=b.Element.getLayerY(t);e.push(i),e.push(t),s.attr("points",e),p(e),a="mousemove"}).mousedown(function(t){if(2===t.button)return t.preventDefault(),t.stopPropagation(),c(),!1;var e,i=s.attr("points"),n=i.length;if(2<n&&i.splice(n-2,2),i.length<5&&(n=b.Element.getLayerX(t),e=b.Element.getLayerY(t),i.push(n),i.push(e)),6===i.length||6<i.length)return t.preventDefault(),t.stopPropagation(),void c();s.attr("points",i),a="mousedown"}):(p(t),c(o))},e.prototype.hiddenarea=function(l,h){function t(){a.drawEnd(h)}var e=l.x,i=l.y,n=l.width,o=l.height,a=this,r=(this._drawing&&(l["fill-opacity"]=1),g[p.AnnotationType.ETERNITYRECT.toLowerCase()]),c=(this._drawing||!1===r.pattern.enabled?l.fill="#000000":(l.fill="url(#"+this._createPattern(l.anntype)+")",l.stroke="#000000"),r.stroke?l["stroke-width"]=r.strokeWidth||l["stroke-width"]:(l["stroke-width"]=0,l.stroke="#000000"),this._drawGroup.rect(e,i,n,o).attr({stroke:l.stroke,strokeWidth:l["stroke-width"],strokeOpacity:1,fill:l.fill,fillOpacity:l["fill-opacity"],ox:e,oy:i,anntype:l.anntype,transform:l.transform}));h.setElement(c);this._drawing?this._ownerWrapper.mousemove(function(t){var e=_.toInt(c.attr("ox")),i=_.toInt(c.attr("oy")),n=(_.toInt(c.attr("width")),_.toInt(c.attr("height")),b.Element.getLayerX(t)),t=b.Element.getLayerY(t),o=e,a=i,r=n-o,s=t-a,e=(r<0&&s<0?(r=e-(o=n),s=i-(a=t)):r<0?r=e-(o=n):s<0&&(s=i-(a=t)),{x:o,y:a,width:r,height:s,"fill-opacity":l["fill-opacity"]});c.attr(e),h.attr(e)}).mouseup(t):t()},e.prototype.imagearea=function(t,e){var i=t.x,n=t.y,o=this,a=this._drawGroup.g();t["image-href"]&&(n=this._drawGroup.image().attr({"xlink:href":t["image-href"],x:i,y:n,width:t.width,height:t.height,preserveAspectRatio:"none"}),a.add(n)),t.text&&(n=this._drawGroup.text(i,t.y+t.height+t["font-size"],t.text).attr({"text-anchor":"start",fill:t["font-color"],"font-size":t["font-size"]}),a.add(n)),a.attr("anntype",t.anntype),e.attr(t);e.setElement(a),o.drawEnd(e)},e.prototype.image=function(t,e){var i,n=t.x,o=t.y,a=this;function r(t){t["image-href"]&&((i=a._drawGroup.image().attr("anntype",t.anntype)).attr("anntype",t.anntype),i.attr({"xlink:href":t["image-href"],x:n,y:o,width:t.width,height:t.height,preserveAspectRatio:"none"})),i&&(e.attr(t),e.setElement(i),a.drawEnd(e))}this._drawing||r(t)},e.prototype.polycurve=function(i,n){var o="",a=this.getPoints(i),r=this,s=this._drawGroup.path().attr({stroke:i.stroke,strokeWidth:i["stroke-width"],fill:"none",anntype:i.anntype,d:r.pointsToPath(i.anntype,a),"vector-effect":"non-scaling-stroke"}),l=function(){n.data("points",a),n.setElement(s),r.drawEnd(n)};this._drawing?this._ownerWrapper.mousemove(function(t){var e=a.length,e=(1<e&&"mousemove"===o&&a.splice(e-2,2),b.Element.getLayerX(t)),t=b.Element.getLayerY(t);a.push(e),a.push(t),s.attr("d",r.pointsToPath(i.anntype,a)),o="mousemove"}).mousedown(function(t){if(2===t.button)return t.preventDefault(),t.stopPropagation(),l(),!1;var e=a.length,e=(2<e&&a.splice(e-2,2),b.Element.getLayerX(t)),t=b.Element.getLayerY(t);a.push(e),a.push(t),n.data("points",a),s.attr("d",r.pointsToPath(i.anntype,a)),o="mousedown"}):l()},e.prototype.checkmark=function(t,e){if("image"===e._subType)this.checkMarkImage(t,e);else{var i=t.x,n=t.y,o=(e.page,this),a=0,r=(this._drawWrapper.node.viewBox.animVal?r=this._drawWrapper.node.viewBox.animVal:this._drawWrapper.node.viewBox.baseVal&&(r=this._drawWrapper.node.viewBox.baseVal),r.x<0&&r.y<0?a=180:r.x<0&&0<=r.y?a=90:0<=r.x&&r.y<0&&(a=270),this._drawing&&(t["font-size"]=48,t["font-weight"]="weight",t["font-color"]="#ff0000",t.height=72,90===a?(n=t.y+t.height/2,i=t.x+t.height/2):180===a?(n=t.y+t.height,i=t.x+t.height/2):270===a&&(n=t.y+t.height)),this._drawGroup.g());r.attr("anntype",t.anntype),e.attr(t),this._drawing&&(t.text="√",i-=8);var a=i,i=n,n=t.width,c=t.height,p=t.text,d=Array.isArray(p)?p:p.split("\n");if(a=a||t.x,i=i||t.y,n=n||t.width,c=c||t.height,o._drawing&&(i-=t["font-size"]),b.Utils.isNotEmpty(p)){r.clear();for(var s=a,g=(1===t["text-halign"]?s=a+n/2:2===t["text-halign"]&&(s=a+n),t["font-size"]),c=o._drawGroup.text(s,i,d).attr({"text-anchor":b.Type.AnnotationAttribute.TEXT_ALIGN[t["text-halign"]],tabindex:"-1",fill:t["font-color"]}),u=c.node.childNodes,f=u.length,l=0,m=n,l=0;l<f;l+=1){var h,y=(h=Snap(u[l])).node.textLength.baseVal.value;m<y&&(m=y),h.attr("x",s),y=o.textPosition(s,0,l,g,0),h.attr("dy",y.y),h.attr("fill",t["font-color"]),h.attr("alignment-baseline","hanging"),h.attr("alignment-baseline","text-before-edge"),h.attr("font-size",g+"px"),h.attr("font-family",t["font-family"]),h.attr("font-weight",t["font-weight"]),h.attr("tabindex","-1")}if(0===n)for(o._drawing&&(m=32),1===t["text-halign"]?s=a+m/2:2===t["text-halign"]&&(s=a+m),c.attr("x",s),l=0;l<f;l+=1)(h=Snap(u[l])).attr("x",s);r.add(c),t.text=p,e.attr({text:p,x:a,y:i,x1:a,y1:i}),e.setElement(r),o.drawEnd(e)}else o.drawEnd(null,!0)}},e.prototype.checkMarkImage=function(t,e){var i,n=t.x,o=t.y,a=this;this._drawing&&(t.width=37,t.height=30);t=t,(i=a._drawGroup.image().attr("anntype",t.anntype)).attr("anntype",t.anntype),i.attr({"xlink:href":e.attr("image-href"),x:n,y:o,width:t.width,height:t.height,preserveAspectRatio:"none"}),i&&(e.attr(t),e.setElement(i),a.drawEnd(e))},e.prototype.mask=function(l,e){function t(){var t;l.width<e.minWidth&&l.height<e.minHeight?r.drawEnd(null,!0):(t={x:l.x,y:l.y,width:l.width,height:l.height},e.attr(t),r.drawEnd(e))}var i=l.x,n=l.y,o=l.width,a=l.height,r=this,h=(l.fill=this._drawing?"#000000":l.fill,l.stroke=this._drawing?"#000000":l.stroke,this._drawGroup.rect(i,n,o,a).attr({stroke:l.stroke,strokeWidth:l["stroke-width"],strokeOpacity:1,fill:l.fill,fillOpacity:e.attr("fill-opacity"),ox:i,oy:n,anntype:l.anntype,transform:l.transform}));e.attr(l),e.setElement(h);this._drawing?this._ownerWrapper.mousemove(function(t){var e=_.toInt(h.attr("ox")),i=_.toInt(h.attr("oy")),n=(_.toInt(h.attr("width")),_.toInt(h.attr("height")),b.Element.getLayerX(t)),t=b.Element.getLayerY(t),o=e,a=i,r=n-o,s=t-a;r<0&&s<0?(r=e-(o=n),s=i-(a=t)):r<0?r=e-(o=n):s<0&&(s=i-(a=t)),l.x=o,l.y=a,l.width=r,l.height=s,h.attr({x:l.x,y:l.y,width:l.width,height:l.height})}).mouseup(t):t()},e.prototype.blackmarking=function(l,e){function t(){var t;l.width<e.minWidth&&l.height<e.minHeight?r.drawEnd(null,!0):(t={x:l.x,y:l.y,width:l.width,height:l.height},e.attr(t),r.drawEnd(e))}var h,i=l.x,n=l.y,o=l.width,a=l.height,r=this;l.fill=this._drawing?"#000000":l.fill,l.stroke=this._drawing?"#000000":l.stroke,l["image-href"]?(h=this._drawGroup.image().attr({anntype:l.anntype,"xlink:href":l["image-href"],x:i,y:n,width:o,height:a,preserveAspectRatio:"none"}),e.resizable(!1)):h=this._drawGroup.rect(i,n,o,a).attr({stroke:l.stroke,strokeWidth:l["stroke-width"],strokeOpacity:1,fill:l.fill,fillOpacity:e.attr("fill-opacity"),ox:i,oy:n,anntype:l.anntype,transform:l.transform}),e.attr(l),e.setElement(h);this._drawing?this._ownerWrapper.mousemove(function(t){var e=_.toInt(h.attr("ox")),i=_.toInt(h.attr("oy")),n=(_.toInt(h.attr("width")),_.toInt(h.attr("height")),b.Element.getLayerX(t)),t=b.Element.getLayerY(t),o=e,a=i,r=n-o,s=t-a;r<0&&s<0?(r=e-(o=n),s=i-(a=t)):r<0?r=e-(o=n):s<0&&(s=i-(a=t)),l.x=o,l.y=a,l.width=r,l.height=s,h.attr({x:l.x,y:l.y,width:l.width,height:l.height})}).mouseup(t):t()},e.prototype.remove=function(){this._drawGroup=null,this._ownerWrapper&&(this.undraw(),this._ownerWrapper.paper.clear(),this._ownerWrapper.remove(),this._completeGroup&&(this._completeGroup.paper.clear(),this._completeGroup.remove()),this._controlGroup&&(this._controlGroup.paper.clear(),this._controlGroup.remove()),this._drawWrapper&&(this._drawWrapper.paper.clear(),this._drawWrapper.remove())),this._ownerWrapper=null,this._drawWrapper=null},b.graphics.Snap=e}),InziSForm.create(function(t,e,i){"use strict";function n(t,e,i){return this._attr=d.extend({"page-index":0,anntype:"",angle:0,id:-1,width:0,height:0,x:0,y:0,transform:"",fill:"#000000","fill-style":-1,"fill-opacity":.5,matrix:"","log-font":"","security-level":255,"uid-encode":"","upw-encode":"","fix-mode":0},e,!0),this._data={},this.page=t,this.el=i,this._graphics=null,this._selected=!1,this._visible=!1,this._editable=!0,this._resizable=!0,this._draggable=!0,this._readonly=!1,this._level=1,this._enabledContextmenu=!0,this.transforms=[],this.fixed=!0,this.securityLevel=r[this._attr.anntype.toLowerCase()].securityLevel,this.viewerCompatType="",this}var d=t.Utils,o=t.Type,a=t.UI,r=(t.Events,t.setting("annotationConfig"));n.prototype={initItemHandler:function(){return this.initOnSelected(),this},initOnSelected:function(){var n=this;n.el&&(n.el.unmousedown(),n.el.mousedown(function(t,e,i){if(n.page.data("editable")&&n.editable()&&n.page.data(o.ControlType.name())!==o.ControlType.MAGNIFICATION&&!(n.page.data("securityLevel")>n.securityLevel)){n.click(t);try{document.activeElement&&document.activeElement.blur()}catch(t){console.log(t)}}}),n.el.initDrag(n))},editable:function(t){if(1!==arguments.length)return this._editable;this._editable=t},resizable:function(t){if(1!==arguments.length)return this._resizable;this._resizable=t},readonly:function(t){if(1!==arguments.length)return this._readonly;this._readonly=t},draggable:function(t){if(1!==arguments.length)return this._draggable;this._draggable=t},dblclick:function(){},click:function(t){var e=this.data("evtTimeStamp")||0,i=Date.now();this.data("evtTimeStamp",i-e<500?0:i),2===t.button?this.contextmenu(t.pageX,t.pageY):((e=this.page.selectedItem())&&e!==this&&this.page.unSelectedItem(e),this.isSelected()||this.page.selectedItem(this,t,t.pageX,t.pageY))},contextmenu:function(t,e){this._enabledContextmenu&&a.contextmenu(this.page,this,t,e)},selected:function(t,e,i,n){this._editable&&(this._selected=t,this.el&&(t?this.el.selected(this,e,i,n):this.el.unselected()))},isSelected:function(){return this._selected},pageControlType:function(){return this.page.data("controlType")},pageSelectedItem:function(t){if(!t)return this.page.selectedItem();this.page.selectedItem("selectedItem",t)},options:function(){},change:function(t){this.attr(t),this._changeAttr(t)},_changeAttr:function(t){this.redraw()},draw:function(t){return this.page.getAnnotation()._graphic.draw(this,!1,t),this},setElement:function(t){this.el=t,this.initItemHandler()},redraw:function(){var t=this.isSelected();t&&this.selected(!1),this.attr(this.attrToJson()),this.data("invertMatrix",null),this.remove(!1).draw(!0),this.selected(t),this.page.trigger("page"+this.page.pageIndex()+".change.annotation",this)},remove:function(t){return t="boolean"!=typeof t||t,this.el&&(this.el.unselected(),this.el.remove(),this.el=null,t&&(this.page.removeItem(this),this.page.trigger("remove.annotation",this))),this},attr:function(t,e){if(0===arguments.length)return this._attr;if(1!==arguments.length)return t in this._attr&&(this._attr[t]=e),this;if("object"!=typeof t)return this._attr[t];for(var i in t)i in this._attr&&(this._attr[i]=t[i]);return this},data:function(t,e){return 0===arguments.length?this._data:d.data.call(this,t,e)},copyAttr:function(){var t,e={},i=this.attr();for(t in i)e[t]=i[t];return e},_exportAttr:function(t){if(null!==this.el){var e,i=this.copyAttr(),n=[1,0,0,1,0,0].join(","),o=this.getGlobalBBox();for(e in i.matrix=n,i.transform="matrix("+n+")",t&&(i["page-index"]=t-1),o)i.hasOwnProperty(e)&&(i[e]=o[e]);return i["fill-opacity"]=d.toFloat(i["fill-opacity"],1),i["stroke-dashstyle"]=d.toNotEmpty(i["stroke-dashstyle"],1),i["stroke-width"]=d.toFloat(i["stroke-width"],1),i.width=d.toNotEmpty(i.width,0),i.height=d.toNotEmpty(i.height,0),i.x=d.toNotEmpty(i.x,0),i.y=d.toNotEmpty(i.y,0),i["fill-size"]=d.toInt(d.toNotEmpty(i["font-size"],10)),0===i["fill-opacity"]&&delete i.fill,i}},attrToJson:function(t){return this._exportAttr(t)},_pointsToMapByNode:function(){var t,e,i,n,o=this.el?this.el.node.points:this.data("points"),a=[],r=this.getInvertMatrix(),s=0,o=o||[];try{if(o.numberOfItems)for(s=0;s<o.numberOfItems;s++)(e={x:i=(t=o.getItem(s)).x,y:n=t.y}).x&&e.y&&r&&(e.x=r.x(i,n),e.y=r.y(i,n),a.push(e));else for(s=0;s<o.length;s+=2)(e={x:i=o[s],y:n=o[s+1]}).x&&e.y&&r&&(e.x=r.x(i,n),e.y=r.y(i,n),a.push(e))}catch(t){console.log(t)}return a},_pointsToMapByData:function(){for(var t,e,i,n=this.data("points"),o=[],a=this.getInvertMatrix(),r=0,r=0;r<n.length;r+=2)(t={x:e=n[r],y:i=n[r+1]}).x&&t.y&&a&&(t.x=a.x(e,i),t.y=a.y(e,i),o.push(t));return o},_pointsToPathByNode:function(t){var e,i,n,o,a,r=this.el?this.el.node.points:this.data("points"),s=[],l=this.getInvertMatrix(),h=0;t=void 0===t||t,r=r||[];try{if(r.numberOfItems)for(h=0;h<r.numberOfItems;h++)(i={x:o=(e=r.getItem(h)).x,y:a=e.y}).x&&i.y&&l&&(i.x=l.x(o,a),i.y=l.y(o,a),n=t?0===h?"M":"L":"",n+=d.toInt(i.x)+" "+d.toInt(i.y),s.push(n));else for(h=0;h<r.length;h+=2)(i={x:o=r[h],y:a=r[h+1]}).x&&i.y&&l&&(i.x=l.x(o,a),i.y=l.y(o,a),n=t?0===h?"M":"L":"",n+=d.toInt(i.x)+" "+d.toInt(i.y),s.push(n))}catch(t){console.log(t)}return s.join(" ")},_pointsToPathByData:function(t){var e,i,n,o=this.data("points"),a=[],r=this.getInvertMatrix(),s=0;for(t=void 0===t||t,s=0;s<o.length;s+=2)(e={x:i=o[s],y:n=o[s+1]}).x&&e.y&&r&&(e.x=r.x(i,n),e.y=r.y(i,n),i=t?0===s?"M":"L":"",i+=d.toInt(e.x)+" "+d.toInt(e.y),a.push(i));return a.join(" ")},pointsToMap:function(t){return t?this._pointsToMapByNode():this._pointsToMapByData()},pointsToPath:function(t,e){return t?this._pointsToPathByNode():this._pointsToPathByData()},getInvertMatrix:function(){var t=[1,0,0,1,0,0],e=this.data("invertMatrix"),i=this.el.transform(),n=i.localMatrix,i=(i.globalMatrix,i.globalMatrix,new Snap.Matrix);return n&&i.add(n),e&&(t=[e.a,e.b,e.c,e.d,e.e,e.f]),i.add(t[0],t[1],t[2],t[3],t[4],t[5]),i},_globalBBox:function(){var t=this.el.getBBox(1),e=this.getInvertMatrix(),i=e.x(t.x,t.y),n=e.y(t.x,t.y),o=e.x(t.x1,t.y1)||i,a=e.y(t.x1,t.y1)||n,r=e.x(t.x2,t.y2),e=e.y(t.x2,t.y2),t=Math.min(i,r),s=Math.max(i,r),l=Math.min(n,e),h=Math.max(n,e),c=s-t,p=h-l;return{x:d.toFloat(i,2),y:d.toFloat(n,2),x1:d.toFloat(o,2),y1:d.toFloat(a,2),x2:d.toFloat(r,2),y2:d.toFloat(e,2),cx:d.toFloat(0,2),cy:d.toFloat(0,2),r:d.toFloat(0,2),rx:d.toFloat(0,2),ry:d.toFloat(0,2),minX:d.toFloat(t,2),minY:d.toFloat(l,2),maxX:d.toFloat(s,2),maxY:d.toFloat(h,2),width:d.toFloat(c,2),height:d.toFloat(p,2)}},getGlobalBBox:function(){return this._globalBBox()},hide:function(){this._setVisible(!1)},show:function(){this._setVisible(!0)},_setVisible:function(t){this._visible=t,this.el&&(this.el.node.style.display=t?"block":"none")},render:function(){},changeViewport:function(){},focus:function(){},getBoundingClientRect:function(){if(this.el)return this.el.node.getBoundingClientRect()},rotate:function(t){}},t.annotation.AnnotationItem=n}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.ARC,points:[],stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,fill:"none"},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(),t},o.annotation.Arc=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.ARROWLINE,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,"right-arrow-shape":0,"left-arrow-shape":0,x1:0,y1:0,x2:0,y2:0,"ras-size":8,"las-size":8},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox(),e=this.getInvertMatrix();return this.el&&(t.x1=e.x(this.el.attr("x1"),this.el.attr("y1")),t.y1=e.y(this.el.attr("x1"),this.el.attr("y1")),t.x2=e.x(this.el.attr("x2"),this.el.attr("y2")),t.y2=e.y(this.el.attr("x2"),this.el.attr("y2"))),t},o.annotation.ArrowLine=i}),InziSForm.create(function(a,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.CHECKMARK,fill:"none","fill-style":-1,"fill-opacity":.5,text:"","font-size":48,"text-halign":0,"font-color":"#FF0000","font-family":"굴림","font-weight":"bold","text-valign":1};return this._subType="text",n=o.extend(n,e,!0),a.annotation.Text.call(this,t,n,i),this}var o=a.Utils,r=a.Type;a.inherit(i,a.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox(),e=this.getInvertMatrix();return t.x=e.x(this.attr("x"),this.attr("y")),t.y=e.y(this.attr("x"),this.attr("y")),t.x1=t.x,t.y1=t.y,t},i.prototype.initOnSelected=function(){var n=this,t=n.el,o=n.attr("anntype").toLowerCase();t&&(t.unmousedown(),t.mousedown(function(t,e,i){n.pageControlType()===r.ControlType.NONE||""===n.pageControlType()?2===t.button?(t.preventDefault(),t.stopPropagation(),n.contextmenu(e,i)):(t.preventDefault(),t.stopPropagation(),a.UI.memo({x:e,y:i,type:o,node:n.page.getPageNode(),text:n.attr("text")},function(t){n.attr("text",t),n.redraw()},!0)):n.pageControlType()===r.ControlType.SELECT&&((t=n.page.selectedItem())?(n.page.unSelectedItem(t),n.isSelected()||n.page.selectedItem(n)):n.page.selectedItem(n))}))},i.prototype.contextmenu=function(t,e){a.UI.contextmenu(this.page,this,t,e)},a.annotation.CheckMark=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.ELLIPSE,fill:"#ffffff",stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,"fill-opacity":1,rx:0,ry:0,cx:0,cy:0};return this.selectionHandleType="rect",n=a.extend(n,e,!0),o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox();return t.rx=(t.maxX-t.minX)/2,t.ry=(t.maxY-t.minY)/2,t.cx=t.maxX-t.rx,t.cy=t.maxY-t.ry,t},o.annotation.Ellipse=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.CIRCLE,fill:"#ffffff",stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,"fill-opacity":1,r:0,cx:0,cy:0};return this.selectionHandleType="rect",n=a.extend(n,e,!0),o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox();return t.r=(t.maxY-t.minY)/2,t.cx=t.maxX-t.r,t.cy=t.maxY-t.r,t},o.annotation.Circle=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){a=o.setting("annotationConfig");var n={anntype:s.AnnotationType.HIGHLIGHTER,points:[],stroke:"#f0f014","stroke-dashstyle":0,"stroke-width":10,fill:"#f0f014","fill-opacity":a.highlighter.fillOpacity||.4},n=r.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a,r=o.Utils,s=o.Type;o.inherit(i,o.annotation.AnnotationItem),o.annotation.Highlighter=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){a=o.setting("annotationConfig");var n={anntype:s.AnnotationType.HIGHLIGHTER,points:[],stroke:"#f0f014","stroke-dashstyle":0,"stroke-width":0,fill:"#f0f014","fill-opacity":a.highlighter.fillOpacity,"stroke-opacity":0};return this._subType="rect",this._attr=r.extend(n,e,!0),this._maxFillOpacity=.4,a.highlighter.stroke&&(this._attr["stroke-width"]=a.highlighter.strokeWidth||this._attr["stroke-width"],this._attr["stroke-opacity"]=1),o.annotation.Rect.call(this,t,this._attr,i),this}var a,r=o.Utils,s=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.maxFillOpacity=function(){return this._maxFillOpacity},i.prototype.getGlobalBBox=function(){var t=this._globalBBox();return t.x=t.minX,t.x2=t.maxX,t.y=t.minY,t.y2=t.maxY,t},o.annotation.HighlighterRect=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){a=o.setting("annotationConfig");var n={anntype:s.AnnotationType.HIGHLIGHTER_PEN,points:[],stroke:"#f0f014","stroke-dashstyle":0,"stroke-width":10,fill:"#f0f014","fill-opacity":a.highlighter.fillOpacity||.4},n=r.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a,r=o.Utils,s=o.Type;o.inherit(i,o.annotation.AnnotationItem),o.annotation.HighlighterPen=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.IMAGE,"image-opacity":1,"image-href":""};return this.selectionHandleType="rect",n=a.extend(n,e,!0),o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),o.annotation.Image=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.LINE,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,x1:0,y1:0,x2:0,y2:0,"right-arrow-shape":0,"left-arrow-shape":0,"ras-size":8,"las-size":8},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox(),e=this.getInvertMatrix();return this.el&&(t.x1=e.x(this.el.attr("x1"),this.el.attr("y1")),t.y1=e.y(this.el.attr("x1"),this.el.attr("y1")),t.x2=e.x(this.el.attr("x2"),this.el.attr("y2")),t.y2=e.y(this.el.attr("x2"),this.el.attr("y2"))),t},o.annotation.Line=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.TEXT,text:"","font-size":10,"text-halign":0,"font-color":"#000000","font-family":"굴림","font-weight":"normal","text-valign":0,width:s.width||0,height:s.height||50,"fill-opacity":s.fillOpacity||1};return this.selectionHandleType="rect",o.annotation.AnnotationItem.call(this,t,n,i),this._attr=a.extend(n,e,!0),this.textPadding=5,this.fixed=s.fixed,this}var a=o.Utils,r=o.Type,s=o.setting("annotationConfig").text;i.prototype.click=function(t){var e=this,i=this.data("evtTimeStamp")||0,n=Date.now(),i=n-i<500;this.data("evtTimeStamp",i?0:n),i?o.UI.memo({x:e.attr("x"),y:e.attr("y"),type:e.attr("anntype"),node:e.page.getPageNode(),text:e.attr("text")},function(t){e.attr("text",t),e.redraw()},!0):2===t.button?this.contextmenu(t.pageX,t.pageY):((n=this.page.selectedItem())&&n!==this&&this.page.unSelectedItem(n),this.isSelected()||this.page.selectedItem(this,t,t.pageX,t.pageY))},i.prototype.rotate=function(t){this.el&&!this.fixed&&(this.el.transform(this.transformsToString()+"r"+-t),this.data("angle",-t))},o.inherit(i,o.annotation.AnnotationItem),o.annotation.Text=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:a.AnnotationType.MEMO,text:"",stroke:"#000000","font-size":10,"fill-opacity":1,"text-halign":0,"font-color":"#FF0000","font-family":"굴림","font-weight":"normal","text-valign":0},n=d.extend(n,e,!0);return o.annotation.Text.call(this,t,n,i),this.textPadding=4,this._data.angle=0,this.fixed=r.fixed,this}var d=o.Utils,a=o.Type,r=o.setting("annotationConfig").memo;o.inherit(i,o.annotation.AnnotationItem),i.prototype.click=function(t){var i=this,e=this.data("evtTimeStamp")||0,n=Date.now(),e=n-e<500&&0===t.button;0===t.button&&this.data("evtTimeStamp",e?0:n),e?(o.UI.uncontextmenu(),o.UI.memo({x:i.attr("x"),y:i.attr("y"),type:i.attr("anntype"),fontSize:i.attr("font-size"),fontColor:i.attr("font-color"),fontStyle:i.attr("font-style"),fontWeight:i.attr("font-weight"),fontFamily:i.attr("font-family"),fillOpacity:i.attr("fill-opacity"),stroke:i.attr("stroke"),fill:i.attr("fill"),node:i.page.getPageNode(),text:i.attr("text")},function(t){var e;"string"==typeof t?i.attr("text",t):(2===(e=t.fontStyle.split("|")).length&&(t["font-weight"]=e[0],t["font-style"]=e[1]),i.attr({text:t.text,"font-size":t.fontSize,"font-color":t.fontColor,"font-family":t.fontFamily,"font-style":t["font-style"],"font-weight":t["font-weight"],"fill-opacity":t.fillOpacity,stroke:t.stroke,fill:t.fill,width:i.attr("width")})),i.redraw()},!0)):2===t.button?this.contextmenu(t.pageX,t.pageY):((n=this.page.selectedItem())&&n!==this&&this.page.unSelectedItem(n),this.isSelected()||this.page.selectedItem(this,t,t.pageX,t.pageY))},i.prototype.getGlobalBBox=function(){var t=this._globalBBox(),e=this.getInvertMatrix();return t.x=e.x(this.attr("x"),this.attr("y")),t.y=e.y(this.attr("x"),this.attr("y")),t.x1=t.x,t.y1=t.y,t},i.prototype.updateTextNode=function(t,e,i,n){return this},i.prototype.getInvertMatrix=function(){for(var t=[1,0,0,1,0,0],e=this.data("invertMatrix"),i=this.el.transform(),n=(i.localMatrix,i.globalMatrix,i.globalMatrix,new Snap.Matrix),o=0,a=this.transforms.length;o<a;o++){var r=this.transforms[o];"translate"===r.type&&n.translate(r.tx,r.ty)}return e&&(t=[e.a,e.b,e.c,e.d,e.e,e.f]),n.add(t[0],t[1],t[2],t[3],t[4],t[5]),n},i.prototype.transformsToString=function(){for(var t=0,e=this.transforms.length,i="";t<e;t++){var n=this.transforms[t];"translate"===n.type&&(i+="t"+n.tx+","+n.ty)}return i},i.prototype.rotate=function(t){this.el&&!this.fixed&&(this.el.transform(this.transformsToString()+"r"+-t),this.data("angle",-t))},i.prototype.redraw=function(t){t="boolean"!=typeof t||t;var e=this.isSelected();return this.isSelected()&&this.selected(!1),this.attr(this.attrToJson()),this.data("invertMatrix",null),this.remove(!1).draw(!0),this.transforms=[],0!==this.page.data("angle")&&this.rotate(this.page.data("angle")),this.selected(e),t&&this.page.trigger("page"+this.page.pageIndex()+".change.annotation",this),this},i.prototype._globalBBox=function(){var t=this.el[0].getBBox(1),e=this.getInvertMatrix(),i=e.x(t.x,t.y),n=e.y(t.x,t.y),o=i,a=n,r=e.x(t.x2,t.y2),e=e.y(t.x2,t.y2),s=Math.min(i,r),l=Math.max(i,r),h=Math.min(n,e),c=Math.max(n,e),p=t.width,t=t.height;return{x:d.toFloat(i,2),y:d.toFloat(n,2),x1:d.toFloat(o,2),y1:d.toFloat(a,2),x2:d.toFloat(r,2),y2:d.toFloat(e,2),cx:d.toFloat(0,2),cy:d.toFloat(0,2),r:d.toFloat(0,2),rx:d.toFloat(0,2),ry:d.toFloat(0,2),minX:d.toFloat(s,2),minY:d.toFloat(h,2),maxX:d.toFloat(l,2),maxY:d.toFloat(c,2),width:d.toFloat(p,2),height:d.toFloat(t,2)}},i.prototype.getGlobalBBox=function(){return this._globalBBox()},o.annotation.Memo=i}),InziSForm.create(function(o,t,a){"use strict";function e(t,e,i){var n={anntype:s.AnnotationType.MEMOPAD,width:27,height:32,fill:"#ffff00",stroke:"#00ff00","font-color":"#00ff00"};return(n=r.extend(n,e,!0)).fill="#ffff00",n.stroke="#00ff00",n["font-color"]="#00ff00",o.annotation.Memo.call(this,t,n,i),this}var r=o.Utils,s=o.Type;o.Element;o.inherit(e,o.annotation.AnnotationItem),e.prototype.click=function(t){var e=this,i=this.data("evtTimeStamp")||0,n=Date.now(),i=n-i<500&&0===t.button;0===t.button&&this.data("evtTimeStamp",i?0:n),i?(o.UI.uncontextmenu(),o.UI.memo({x:e.attr("x"),y:e.attr("y"),type:e.attr("anntype"),node:o.Element.select(a.body,".sform-contents"),text:e.attr("text")},function(t){e.attr("text",t)},!0),o.UI.uncontextmenu()):2===t.button?this.contextmenu(t.pageX,t.pageY):((n=this.page.selectedItem())&&n!==this&&this.page.unSelectedItem(n),this.isSelected()||this.page.selectedItem(this,t,t.pageX,t.pageY))},o.annotation.MemoPad=e}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.POLYCURVE,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,points:[]},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(),t},o.annotation.Polycurve=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.POLYGON,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,"fill-opacity":0,fill:"#ffffffff",points:[]},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(!0),t["fill-opacity"]=a.toFloat(t["fill-opacity"],1),t},o.annotation.Polygon=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.POLYLINE,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,path:"",points:[]},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(!0),t},o.annotation.Polyline=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.PEN,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,path:"",points:[]},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(),t.path=this.pointsToPath(),t},o.annotation.Pen=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.PROTRACTOR,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,x1:0,points:[]},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(),t},o.annotation.Protractor=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.RECT,fill:"#ff0000",stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,"fill-opacity":1,x1:0,y1:0,x2:0,y2:0},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this.minWidth=10,this.minHeight=10,this.selectionHandleType="rect",this._resizable=!0,this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox();return t.x=t.minX,t.x2=t.maxX,t.y=t.minY,t.y2=t.maxY,t},o.annotation.Rect=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:a.AnnotationType.STAMP,stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,"stamp-mode":0,"stamp-style":0,stampText:"","image-value":""};return this._attr=d.extend(n,e,!0),o.annotation.Image.call(this,t,this._attr,i),o.annotation.Memo.call(this,t,this._attr,i),this._resizable=!1,this}var d=o.Utils,a=o.Type;o.Element;o.inherit(i,o.annotation.AnnotationItem),i.prototype.click=function(t){var e=this,i=this.data("evtTimeStamp")||0,n=Date.now(),i=(e.page.getPageNode(),n-i<500&&0===t.button);0===t.button&&this.data("evtTimeStamp",i?0:n),i?(o.UI.uncontextmenu(),e.draggable(!1),(n=e.attr()).block=!0,o.UI.stamp(n,function(t){"popup-colse"!==t.event&&(e.attr(t),e.redraw()),e.draggable(!0)})):2===t.button?this.contextmenu(t.pageX,t.pageY):((i=this.page.selectedItem())&&i!==this&&this.page.unSelectedItem(i),this.isSelected()||this.page.selectedItem(this,t,t.pageX,t.pageY))},i.prototype._globalBBox=function(){var t=this.el[0].getBBox(1),e=this.getInvertMatrix(),i=e.x(t.x,t.y),n=e.y(t.x,t.y),o=i,a=n,r=e.x(t.x2,t.y2),e=e.y(t.x2,t.y2),s=Math.min(i,r),l=Math.max(i,r),h=Math.min(n,e),c=Math.max(n,e),p=t.width,t=t.height;return{x:d.toFloat(i,2),y:d.toFloat(n,2),x1:d.toFloat(o,2),y1:d.toFloat(a,2),x2:d.toFloat(r,2),y2:d.toFloat(e,2),cx:d.toFloat(0,2),cy:d.toFloat(0,2),r:d.toFloat(0,2),rx:d.toFloat(0,2),ry:d.toFloat(0,2),minX:d.toFloat(s,2),minY:d.toFloat(h,2),maxX:d.toFloat(l,2),maxY:d.toFloat(c,2),width:d.toFloat(p,2),height:d.toFloat(t,2)}},o.annotation.Stamp=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.IMAGEAREA},n=a.extend(n,e,!0);return o.annotation.Image.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.initOnSelected=function(){},i.prototype.contextmenu=function(){},o.annotation.ImageArea=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.HIDDENAREA,"image-opacity":1,"image-href":""},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this._editable=!1,this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox();return t.x=t.minX,t.x2=t.maxX,t.y=t.minY,t.y2=t.maxY,t},o.annotation.HiddenArea=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.MASK,points:[],stroke:"#000","stroke-dashstyle":0,"stroke-width":3,fill:"#000","fill-opacity":1};return this._attr=a.extend(n,e,!0),s.fixedOpacity&&(this._attr["fill-opacity"]=s.fillOpacity),this.minWidth=10,this.minHeight=10,o.annotation.Rect.call(this,t,this._attr,i),this}var a=o.Utils,r=o.Type,s=o.setting("annotationConfig").mask;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox();return t.x=t.minX,t.x2=t.maxX,t.y=t.minY,t.y2=t.maxY,t},o.annotation.Masking=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.EDITTEXT,text:"","fill-opacity":0,"stroke-width":0,stroke:"#000000","font-size":10},n=a.extend(n,e,!0);return o.annotation.Text.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.click=function(t){var e=this,i=this.data("evtTimeStamp")||0,n=Date.now(),i=n-i<500;this.data("evtTimeStamp",i?0:n),i?o.UI.memo({x:e.attr("x"),y:e.attr("y"),type:e.attr("anntype"),node:e.page.getPageNode(),text:e.attr("text")},function(t){e.attr("text",t),e.redraw()},!0):2===t.button?this.contextmenu(t.pageX,t.pageY):((n=this.page.selectedItem())&&n!==this&&this.page.unSelectedItem(n),this.isSelected()||this.page.selectedItem(this,t,t.pageX,t.pageY))},o.annotation.EditText=i}),InziSForm.create(function(o,t,a){"use strict";function e(t,e,i){var n={anntype:r.AnnotationType.STICKYNOTE,text:"",stroke:"#ffff99","font-size":10,"text-halign":0,"font-color":"#000000","font-family":"굴림","font-weight":"normal","text-valign":0,fill:"#ffff99","fill-opacity":1,width:s.width||300,height:s.height||50};(n=d.extend(n,e,!0)).fill=n.fill||"#ffff99",n.stroke=n.stroke||n.fill,o.annotation.Text.call(this,t,n,i),this.fixed=!1,this.minWidth=20,this.minHeight=10,this._data.angle=0,this.textPadding=20}var d=o.Utils,r=o.Type,s=o.setting("annotationConfig").stickynote;o.inherit(e,o.annotation.AnnotationItem),e.prototype.click=function(t){var i=this,e=this.data("evtTimeStamp")||0,n=Date.now(),e=n-e<500&&0===t.button;0===t.button&&this.data("evtTimeStamp",e?0:n),e?(o.UI.uncontextmenu(),o.UI.memo({x:i.attr("x"),y:i.attr("y"),fontSize:i.attr("font-size"),fontColor:i.attr("font-color"),fontStyle:i.attr("font-style"),fontWeight:i.attr("font-weight"),fontFamily:i.attr("font-family"),stroke:i.attr("stroke"),fill:i.attr("fill"),fillOpacity:i.attr("fill-opacity"),textValign:i.attr("text-valign"),textHalign:i.attr("text-halign"),type:i.attr("anntype"),node:o.Element.select(a.body,".sform-contents"),text:i.attr("text")},function(t){var e=t.fontStyle.split("|");2===e.length&&(t["font-weight"]=e[0],t["font-style"]=e[1]),i.attr({text:t.text,"font-size":t.fontSize,"font-color":t.fontColor,"font-family":t.fontFamily,"font-weight":t["font-weight"],"font-style":t["font-style"],stroke:t.stroke,fill:t.fill,width:i.attr("width"),"fill-opacity":t.fillOpacity,"text-halign":t.textHalign,"text-valign":t.textValign}),i.redraw(!0)},!0),o.UI.uncontextmenu()):2===t.button?this.contextmenu(t.pageX,t.pageY):((n=this.page.selectedItem())&&n!==this&&this.page.unSelectedItem(n),this.isSelected()||this.page.selectedItem(this,t,t.pageX,t.pageY))},e.prototype.getGlobalBBox=function(){var t=this._globalBBox(),e=this.getInvertMatrix();return t.x=e.x(this.attr("x"),this.attr("y")),t.y=e.y(this.attr("x"),this.attr("y")),t.x1=t.x,t.y1=t.y,t},e.prototype.updateTextNode=function(t,e,i,n){return this},e.prototype.rotate=function(t){this.el&&!this.fixed&&(this.el.transform(this.transformsToString()+"r"+-t),this.data("angle",-t))},e.prototype.getInvertMatrix=function(){for(var t=[1,0,0,1,0,0],e=this.data("invertMatrix"),i=this.el.transform(),n=(i.localMatrix,i.globalMatrix,i.globalMatrix,new Snap.Matrix),o=0,a=this.transforms.length;o<a;o++){var r=this.transforms[o];"translate"===r.type&&n.translate(r.tx,r.ty)}return e&&(t=[e.a,e.b,e.c,e.d,e.e,e.f]),n.add(t[0],t[1],t[2],t[3],t[4],t[5]),n},e.prototype.transformsToString=function(){for(var t=0,e=this.transforms.length,i="";t<e;t++){var n=this.transforms[t];"translate"===n.type&&(i+="t"+n.tx+","+n.ty)}return i},e.prototype.redraw=function(t){t="boolean"!=typeof t||t;var e=this.isSelected();return this.isSelected()&&this.selected(!1),this.attr(this.attrToJson()),this.data("invertMatrix",null),this.remove(!1).draw(!0),this.transforms=[],0!==this.page.data("angle")&&this.rotate(this.page.data("angle")),this.selected(e),t&&this.page.trigger("page"+this.page.pageIndex()+".change.annotation",this),this},e.prototype._globalBBox=function(){var t=this.el[0].getBBox(1),e=this.getInvertMatrix(),i=e.x(t.x,t.y),n=e.y(t.x,t.y),o=i,a=n,r=e.x(t.x2,t.y2),e=e.y(t.x2,t.y2),s=Math.min(i,r),l=Math.max(i,r),h=Math.min(n,e),c=Math.max(n,e),p=t.width,t=t.height;return{x:d.toFloat(i,2),y:d.toFloat(n,2),x1:d.toFloat(o,2),y1:d.toFloat(a,2),x2:d.toFloat(r,2),y2:d.toFloat(e,2),cx:d.toFloat(0,2),cy:d.toFloat(0,2),r:d.toFloat(0,2),rx:d.toFloat(0,2),ry:d.toFloat(0,2),minX:d.toFloat(s,2),minY:d.toFloat(h,2),maxX:d.toFloat(l,2),maxY:d.toFloat(c,2),width:d.toFloat(p,2),height:d.toFloat(t,2)}},e.prototype.getGlobalBBox=function(){return this._globalBBox()},o.annotation.StickyNote=e}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.ETERNITYRECT,points:[],stroke:"#000","stroke-dashstyle":0,"stroke-width":3,fill:"#000","fill-opacity":1};return this._attr=a.extend(n,e,!0),o.annotation.Rect.call(this,t,this._attr,i),this._attr.anntype=r.AnnotationType.ETERNITYRECT,this._level=2,this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox();return t.x=t.minX,t.x2=t.maxX,t.y=t.minY,t.y2=t.maxY,t},o.annotation.EternityRect=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n=o.setting("annotationConfig").grid.pattern||{},n={anntype:r.AnnotationType.GRID,points:[],stroke:"#333","stroke-dashstyle":0,"stroke-width":0,fill:"none","fill-opacity":1,"stroke-opacity":0,pattern:{width:n.width||10,height:n.height||10,stroke:n.stroke||"#333","stroke-width":n.strokeWidth||1,"stroke-dasharray":n.strokeDasharray||"1"}};return this._subType="rect",this.resizable=!0,this._attr=a.extend(n,e,!0),this._attr["fill-opacity"]=1,o.annotation.Rect.call(this,t,this._attr,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.remove=function(t){return t="boolean"!=typeof t||t,this.el&&(this.el.unselected(),this.el.remove(),this.pattern&&this.pattern.remove(),this.el=null,t&&(this.page.removeItem(this),this.page.trigger("remove.annotation",this))),this},o.annotation.Grid=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.CHORD,points:[],stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,fill:"none"},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(),t},o.annotation.Chord=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.PIE,points:[],stroke:"#000000","stroke-dashstyle":0,"stroke-width":3,fill:"none"},n=a.extend(n,e,!0);return o.annotation.AnnotationItem.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.attrToJson=function(t){t=this._exportAttr(t);return t.points=this.pointsToMap(),t},o.annotation.Pie=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.BLACKMARKING,"image-opacity":1,"image-href":""};return this._attr=a.extend(n,e,!0),this.selectionHandleType="rect",(n=o.setting("annotationConfig").blackmarking).fixedOpacity&&(this._attr["fill-opacity"]=n.fillOpacity),this.minWidth=10,this.minHeight=10,o.annotation.AnnotationItem.call(this,t,this._attr,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),o.annotation.Blackmarking=i}),InziSForm.create(function(o,t,e){"use strict";function i(t,e,i){var n={anntype:r.AnnotationType.CheckMarkImage,"image-href":r.RESOURCE.ICON.CHECKMARK,fill:"none",stroke:"#ff0000","stroke-width":2};return this._subType="image",n=a.extend(n,e,!0),o.annotation.Image.call(this,t,n,i),this}var a=o.Utils,r=o.Type;o.inherit(i,o.annotation.AnnotationItem),i.prototype.getGlobalBBox=function(){var t=this._globalBBox(),e=this.getInvertMatrix();return t.x=e.x(this.attr("x"),this.attr("y")),t.y=e.y(this.attr("x"),this.attr("y")),t.x1=t.x,t.y1=t.y,t},o.annotation.CheckMarkImage=i}),InziSForm.create(function(s,t,o){"use strict";function e(t){var e={protocol:i.protocol,hostname:i.hostname,port:s.Utils.toInt(i.port),context:"",resolve:null,reject:null,cors:!1,withCredentials:null};return this.options=l.extend(e,t),this.requestTask={},this.serviceManagerConfig=s.setting("serviceManagerConfig"),this}var l=s.Utils,a=s.Element,n=s.Type,i=(s.ServiceAPIMessage={Action:{PageCount:"PageCount",PageInfo:"PageInfo",PageStream:"PageStream",PageAnnotation:"PageAnnotation"},DocInfoRequest:{URI:"/sform/doc/info.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{docId:"",docFormCode:"",fileStorageType:""}},PageCountRequest:{URI:"/sform/file/@/count.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{fileId:"",fileStorageType:""}},PageInfoRequest:{URI:"/sform/file/info.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{fileId:"",fileStorageType:""}},PageStreamRequestByPost:{URI:"/sform/file/streaming.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{fileId:"",pageNo:1,fileFormat:"jpg",compressFormat:"jpeg",compressValue:5,imageSize:"",action:"PageStream",fileStorageType:""}},PageStreamRequestByGet:{URI:"/sform/file/streaming.wfm",TYPE:"GET",ContentType:"json",DataType:"json",PARAM:{fileId:"",pageNo:1,fileFormat:"jpg",compressFormat:"jpeg",compressValue:5,imageSize:"",action:"PageStream",fileStorageType:""}},PageStreamFileRequest:{URI:"/sform/file/streaming.wfm",TYPE:"POST",ContentType:"json",DataType:"arraybuffer",PARAM:{fileId:"",pageNo:1,fileFormat:"jpg",compressFormat:"jpeg",compressValue:5,imageSize:"",action:"PageStream",fileStorageType:""}},PageProcessingRequest:{URI:"/sform/file/processing.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",pageNo:1,processingList:{}},ITEM:{command:"",angle:0,x:0,y:0,width:0,height:0}},AnnotationCreateRequest:{URI:"/sform/file/annotation/create.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",annotationId:"",pageNo:1,annotation:"",fileStorageType:"",annotationMap:{},addOption:{storageKey:null,profile:null,datas:null},annotationType:""}},AnnotationUpdateRequest:{URI:"/sform/file/annotation/update.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",annotationId:"",pageNo:1,annotation:"",fileStorageType:"",annotationMap:{},addOption:{storageKey:null,profile:null,datas:null},annotationType:""}},AnnotationGetRequest:{URI:"/sform/file/annotation.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{fileId:"",annotationId:"",pageNo:1,fileStorageType:"",annotationType:""}},AnnotationContentDeleteRequest:{URI:"/sform/file/annotation/content/delete.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{annotationId:"",annotationContentTypeList:[],annotationType:""}},ThumbnailPostRequest:{URI:"/sform/file/thumbnail.wfm",TYPE:"POST",ContentType:"json",DataType:"arraybuffer",PARAM:{fileId:"",pageNo:1,fileFormat:"jpg",compressFormat:"jpeg",compressValue:5,imageSize:"100,150",fileStorageType:""}},ThumbnailGetRequest:{URI:"/sform/file/thumbnail.wfm",TYPE:"GET",ContentType:"json",DataType:"arraybuffer",PARAM:{fileId:"",pageNo:1,fileFormat:"jpg",compressFormat:"jpeg",compressValue:5,imageSize:"100,150",fileStorageType:""}},FileDownloadRequest:{URI:"/sform/file/down.wfm",TYPE:"POST",ContentType:"",DataType:"",PARAM:{fileId:"",fileStorageType:""}},MaskSaveRequest:{URI:"/sform/file/mask.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",overwrite:!0,maskingType:0,maskList:"",fileStorageType:"",addOption:{storageKey:null,profile:null,datas:null}}},AnnotationPermanenceRequest:{URI:"/sform/file/annotation/permanence.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",annotationId:"",overwrite:!0,annotationContentTypeList:["MASK","ETERNITYRECT"],fileStorageType:"",annotationType:null,addOption:{storageKey:null,profile:null,datas:null}}},FileSplitRequest:{URI:"/sform/file/split.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",annotationId:null,fileStorageType:"",addOption:{storageKey:null,profile:null,datas:null}}},FileMergeRequest:{URI:"/sform/file/merge.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileAnnotationList:null,overwrite:!0,fileStorageType:"",addOption:{storageKey:null,profile:null,datas:null}}},FileEditRequest:{URI:"/sform/file/edit.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",annotationId:null,overwrite:!0,pageList:null,deleteList:null,addPageList:null,addOption:{storageKey:null,profile:null,datas:null},annotationType:null,fileStorageType:""}},FileCropRequest:{URI:"/sform/file/crop.wfm",TYPE:"POST",ContentType:"json",DataType:"json",ParamType:"json",PARAM:{fileId:"",pageNo:1,crop:null,addOption:{storageKey:null,profile:null,datas:null},fileStorageType:""}}},s.Utils.globalLocation());return e.prototype.setOptions=function(t){var e=this.options;return this.options=l.extend(e,t),this},e.prototype._makeUrl=function(t){return 0===t.indexOf("http")?t:(this.options.context.endsWith("/")&&t.startsWith("/")&&(t=t.substring(1,t.length)),t=this.options.context+t,this.options.protocol+"://"+this.options.hostname+(s.Utils.isNotEmpty(this.options.port)?":"+this.options.port:"")+(0===t.indexOf("/")?t:"/"+t))},e.prototype.request=function(t,e,i,h){var n=t.type,o=n.URI,a=n.TYPE,r=n.DataType,s=n.ContentType,n=(e=e||this.options.resolve,i=i||this.options.reject,o=o.replace("@",t.fileId),t.pageNo&&(o=o.replace(/[$]/gi,t.pageNo)),n.ParamType),l=t.params||this.paramToString(t),a={ajaxType:a,url:this._makeUrl(o),contentType:s,dataType:r,params:l,reject:i,resolve:e};try{"binary"===n?(a.data=t.data,this.xhrBinary(a)):"arraybuffer"===r?this.xhrArraybuffer(a):this.ajax(a)}catch(t){console.log(t)}return this},e.prototype.loadend=function(t){1===arguments.length&&this.requestTask[t]&&delete this.requestTask[t]},e.prototype.abort=function(){for(var t in this.requestTask){var e=this.requestTask[t];try{e instanceof XMLHttpRequest&&(e.abort(),this.loadend(t))}catch(t){console.log(t)}}},e.createRequest=function(){if(t.XMLHttpRequest)return new XMLHttpRequest;if(t.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){return new ActiveXObject("Microsoft.XMLHTTP")}},e.prototype.createRequest=function(){if(t.XMLHttpRequest)return new XMLHttpRequest;if(t.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){return new ActiveXObject("Microsoft.XMLHTTP")}},e.prototype.requestDocInfo=function(t,e,i){t={type:s.ServiceAPIMessage.DocInfoRequest,docId:t.docId,docFormCode:t.docFormCode||"",param:t.param};this.request(t,e,i)},e.prototype.requestPageInfo=function(t,e,i){t={type:s.ServiceAPIMessage.PageInfoRequest,fileId:t.fileId,pageNo:t.pageNo||1,fileStorageType:t.fileStorageType,param:t.param};this.request(t,e,i)},e.prototype.requestPageStreaming=function(t,e,i){t={type:s.ServiceAPIMessage.PageStreamFileRequest,fileId:t.fileId,pageNo:t.pageNo||1,fileStorageType:t.fileStorageType};this.request(t,e,i)},e.prototype.requestPageThumbnail=function(t,e,i){t={type:s.ServiceAPIMessage.ThumbnailPostRequest,fileId:t.fileId,pageNo:t.pageNo||1,fileStorageType:t.fileStorageType};this.request(t,e,i)},e.prototype.requestAnnotation=function(t,e,i){t={type:s.ServiceAPIMessage.AnnotationGetRequest,fileId:t.fileId,annotationId:t.annotationId,pageNo:t.pageNo||1,fileStorageType:t.fileStorageType,annotationType:t.annotationType};return this.request(t,e,i),this},e.prototype.requestAnnotationCreate=function(t,e,i){t={fileId:t.fileId,annotationId:t.annotationId,pageNo:t.pageNo||1,annotation:t.annotation,annotationMap:t.annotationMap,fileStorageType:t.fileStorageType,annotationType:t.annotationType};t.type=s.ServiceAPIMessage.AnnotationCreateRequest;try{t.params=JSON.stringify(this.extend(this._copyByRequestParam(t.type.PARAM),t,!0))}catch(t){console.log(t)}return this.request(t,e,i),this},e.prototype.requestAnnotationUpdate=function(t,e,i){t={fileId:t.fileId,annotationId:t.annotationId,pageNo:t.pageNo||1,annotation:t.annotation,annotationMap:t.annotationMap,fileStorageType:t.fileStorageType,annotationType:t.annotationType};t.type=s.ServiceAPIMessage.AnnotationUpdateRequest;try{t.params=JSON.stringify(this.extend(this._copyByRequestParam(t.type.PARAM),t,!0))}catch(t){console.log(t)}return this.request(t,e,i),this},e.prototype.requestAnnotationSave=function(t,e,i){var n={fileId:t.fileId,annotationId:t.annotationId||"",pageNo:t.pageNo||1,annotation:t.annotation,annotationMap:t.annotationMap,fileStorageType:t.fileStorageType,annotationType:t.annotationType,params:null};n.type=t.annotationId?s.ServiceAPIMessage.AnnotationUpdateRequest:s.ServiceAPIMessage.AnnotationCreateRequest;try{n.params=JSON.stringify(this.extend(this._copyByRequestParam(n.type.PARAM),n,!0))}catch(t){console.log(t)}return this.request(n,e,i),this},e.prototype.requestAnnotationContentDelete=function(t,e,i){t={type:s.ServiceAPIMessage.AnnotationContentDeleteRequest,annotationId:t.annotationId,annotationContentTypeList:[],annotationType:t.annotationType,fileStorageType:t.fileStorageType};return this.request(t,e,i),this},e.prototype.requestFileDownload=function(t){if(!l.isEmpty(t.fileId)){var e,i="";for(e in t)l.isNotEmpty(t[e])&&(l.isNotEmpty(i)&&(i+="&"),i=i+e+"="+encodeURIComponent(t[e]));var n=o.createElement("a");a.attr(n,{id:"__sform-download_"+l.generateUUID(),href:this.createRequestUrl({type:s.ServiceAPIMessage.FileDownloadRequest})+"?"+i,target:"_blank"}),o.body.appendChild(n),n.click(),setTimeout(function(){n.parentNode.removeChild(n)},1e3)}},e.prototype.requestMaskSave=function(t,e,i){var n=this.serviceManagerConfig.mask,n={type:s.ServiceAPIMessage.MaskSaveRequest,fileId:t.fileId,overwrite:n.overwrite,maskingType:n.maskingType,maskList:t.maskList,fileStorageType:t.fileStorageType,addOption:t.addOption};return this.request(n,e,i),this},e.prototype.requestAnnotationPermanence=function(t,e,i){var n=this.serviceManagerConfig.annotationPermanence,n={type:s.ServiceAPIMessage.AnnotationPermanenceRequest,fileId:t.fileId,annotationId:t.annotationId,overwrite:n.overwrite,annotationContentTypeList:n.annotationContentTypeList,annotationType:t.annotationType,fileStorageType:t.fileStorageType,addOption:t.addOption};return this.request(n,e,i),this},e.prototype.requestFileSplit=function(t,e,i){t={type:s.ServiceAPIMessage.FileSplitRequest,fileId:t.fileId,annotationId:t.annotationId,fileStorageType:t.fileStorageType,addOption:t.addOption};return this.request(t,e,i),this},e.prototype.requestFileMerge=function(t,e,i){this.serviceManagerConfig.merge;t={type:s.ServiceAPIMessage.FileMergeRequest,fileAnnotationList:t.fileAnnotationList,overwrite:t.overwrite,fileStorageType:t.fileStorageType,addOption:t.addOption};return this.request(t,e,i),this},e.prototype.requestFileEdit=function(t,e,i){var n=this.serviceManagerConfig.fileEdit,n={type:s.ServiceAPIMessage.FileEditRequest,fileId:t.fileId,annotationId:t.annotationId,overwrite:n.overwrite,pageList:t.pageList,deleteList:t.deleteList,addPageList:t.addPageList,fileStorageType:t.fileStorageType,addOption:t.addOption};return this.request(n,e,i),this},e.prototype.requestFileCrop=function(t,e,i){t={type:s.ServiceAPIMessage.FileCropRequest,fileId:t.fileId,pageNo:t.pageNo,crop:t.crop,fileStorageType:t.fileStorageType,addOption:t.addOption};return this.request(t,e,i),this},e.prototype.requestImageProcessing=function(t,e,i){t={type:s.ServiceAPIMessage.PageProcessingRequest,fileId:t.fileId,pageNo:t.pageNo||1,processingList:t.processingList};return this.request(t,e,i),this},e.prototype.requestPCAgentPrint=function(t,e,i){t={type:s.ServiceAPIMessage.PCAgentPrintRequest,items:t.items,watermark:t.watermark,param:t.param};this.request(t,e,i)},e.prototype.resolve=function(){return"function"==typeof this.options.resolve&&this.options.resolve.apply(null,Array.prototype.slice.call(arguments,0)),this},e.prototype.catch=function(){return"function"==typeof this.options.reject&&this.options.reject.apply(null,Array.prototype.slice.call(arguments,0)),this},e.prototype._responseProcess=function(t,e,i,n){var o,a,r=n.status;try{200===r&&(r=(o=i.currentTarget||i.target).status,a=o.response||o.responseText,l.isFunction(t)&&t(a=a&&"object"!=typeof a?JSON.parse(a):a,o))}catch(t){r=500,console.log(t),l.isFunction(e)?e(n):s.UI.alert("API 연동 오류가 발생했습니다.<br/>장애가 지속될 경우 담당자에게 연락 부탁드립니다.")}200!==r&&l.isFunction(e)&&e(n)},e.prototype.createRequestUrl=function(t){var e,i=t.type,n=this._makeUrl(i.URI),o=[],a=i.TYPE,r=this.extend(i.PARAM,t,!0);for(e in r)"object"!=typeof r[e]&&o.push(e+"="+r[e]);return"POST"===a?n:i===s.ServiceAPIMessage.ThumbnailGetRequest?(n=n.replace("@",t.fileId)).replace(/[$]/gi,t.pageNo):n+"?"+o.join("&")},e.prototype.paramToString=function(t,e){this.options.context;var i=[],n=t.type,o=(n.TYPE,e=void 0!==e&&e,this.extend(this._copyByRequestParam(n.PARAM),t,e)),a=n.ContentType||"";if(e||"json"!==a){for(var r in o)"object"!=typeof o[r]&&(n.PARAM.hasOwnProperty(r)||e)&&i.push(r+"="+o[r]);return i.join("&")}return o=this.extend(o,t.param,!0),JSON.stringify(o)},e.prototype._copyByRequestParam=function(t){var e,i={};for(e in t)i[e]=t[e];return i},e.prototype.readyRequest=function(e){var t,i=this,n=this.createRequest();if(null!==n)return t=l.generateUUID(),n.taskId=t,this.requestTask[t]=n,t=-1===(t=e.url).indexOf("?")?t+"?t="+(new Date).getTime():t+"&t="+(new Date).getTime(),n.open(e.ajaxType,e.url+"",!0),n.overrideMimeType&&n.overrideMimeType(e.contentType),this.options.cors&&this.options.withCredentials&&void 0!==n.withCredentials&&(n.withCredentials=this.options.withCredentials),n.responseType=e.dataType,n.setRequestHeader("Content-type",e.contentType),n.onreadystatechange=function(t){4===t.readyState&&(200===t.status?console.log(t.responseText):console.log("Error",t.statusText))},n.onload=function(t){i._responseProcess.apply(i,[e.resolve,e.reject,t,this])},n.onloadend=function(t){i.loadend(this.taskId)},n},e.prototype.ajax=function(t){var e=t.params,i=n.MEDIA_TYPE.APPLICATION_FORM_URLENCODED,i=("json"===t.contentType&&(i=n.MEDIA_TYPE.APPLICATION_JSON),t.contentType=i,this.readyRequest(t));return i.send(e),i},e.prototype.xhrBinary=function(t){var e=n.MEDIA_TYPE.APPLICATION_FORM_URLENCODED,e=("json"===t.contentType&&(e=n.MEDIA_TYPE.APPLICATION_JSON),t.contentType=e,this.readyRequest(t)),t=new Blob([t.data],{type:n.MEDIA_TYPE.TEXT_PLAIN});return e.send(t),e},e.prototype.xhrArraybuffer=function(t){var e=n.MEDIA_TYPE.APPLICATION_FORM_URLENCODED,e=("json"===t.contentType&&(e=n.MEDIA_TYPE.APPLICATION_JSON),t.contentType=e,this.readyRequest(t));return e.send(t.params),e},e.prototype.error=function(t){try{200===t.status&&t.responseJSON&&t.responseJSON.message?t.responseJSON.message:t.statusText}catch(t){s.UI.alert("API 연동 오류가 발생했습니다.<br/>장애가 지속될 경우 담당자에게 연락 부탁드립니다.")}},e.prototype.extend=function(t,e,i){for(var n in e)t.hasOwnProperty(n)?"function"==typeof t[n]||Array.isArray(t[n])||i||"object"!=typeof t[n]||null==t[n]?t[n]=e[n]:t[n]=this.extend(t[n],e[n]):i&&(t[n]=e[n]);return t},s.ServiceManager=e,s.ServiceManager.prototype.constructor=e.prototype,s.ServiceManager}),InziSForm.create(function(o,t,e){"use strict";function i(t){var e={protocol:r.protocol,hostname:r.hostname,port:o.Utils.toInt(r.port),context:"",resolve:null,reject:null,cors:!1,withCredentials:null,setting:null,serverUri:null,serverContextPath:null,setStreamingPass:!0};o.ServiceManager.call(this,t),this.options=n.extend(e,t),this.requestTask={},this.serviceManagerConfig=o.setting("serviceManagerConfig")}var n=o.Utils,a=(o.Element,o.Type),r=(o.PCAgentServiceAPIMessage=n.extend({},o.ServiceAPIMessage,!0),o.PCAgentServiceAPIMessage={PrintFileRequest:{URI:"/sform/file/print.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{items:[],watermark:{}}},PrintStateRequest:{URI:"/sform/file/print_state.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{printId:""}},SettingRequest:{URI:"/sform/pcagent/setting.wfm",TYPE:"POST",ContentType:"json",DataType:"json",PARAM:{serverUri:"",serverContextPath:"",setStreamingPass:!1}}},o.Utils.globalLocation());return o.inherit(i,o.ServiceManager),i.prototype.setOptions=function(t,e){var i=this.options;this.options=n.extend(i,t),t.serviceType!==a.SERVICE_TYPE.API&&this.requestSetting(this.options,e)},i.prototype.init=function(t,e,i){},i.prototype.requestPrintFile=function(t,e,i){var n={type:o.PCAgentServiceAPIMessage.PrintFileRequest,params:""};try{n.params=JSON.stringify(this.extend(this._copyByRequestParam(n.type.PARAM),{items:t.items,watermark:t.watermark},!0))}catch(t){console.log(t)}this.request(n,e,i)},i.prototype.requestPrintState=function(t,e,i){var n={type:o.PCAgentServiceAPIMessage.PrintStateRequest,params:""};try{n.params=JSON.stringify(this.extend(this._copyByRequestParam(n.type.PARAM),{printId:t.printId},!0))}catch(t){console.log(t)}this.request(n,e,i)},i.prototype.requestPrintFile=function(t,e,i){var n={type:o.PCAgentServiceAPIMessage.PrintFileRequest,params:""};try{n.params=JSON.stringify(this.extend(this._copyByRequestParam(n.type.PARAM),{items:t.items,watermark:t.watermark},!0))}catch(t){console.log(t)}this.request(n,e,i)},i.prototype.requestSetting=function(t,e,i){var n={type:o.PCAgentServiceAPIMessage.SettingRequest,serverUri:t.serverUri,serverContextPath:t.serverContextPath||"",param:t.param};"boolean"==typeof t.setStreamingPass&&(n.setStreamingPass=t.setStreamingPass||!1),this.request(n,e,i)},o.PCAgentServiceManager=i,o.PCAgentServiceManager.prototype.constructor=i.prototype,o.PCAgentServiceManager}),InziSForm.create(function(t,n,a){"use strict";function e(t,e){var i={batchjob:{protocol:"http",baseURL:null,port:null,path:"",infoURI:"",streamingURI:"",items:[],pages:[]},commonOption:{mediaSize:null,layout:"auto",margins:null,pageRenderSize:"auto",paperSize:null,fixedRatio:null},watermark:{type:g.WATERMARK_TYPE.NONE,text:"",imageHref:"",repeat:1,fontSize:0,fontColor:"",opacity:.3,date:{display:!1,format:"yyyy-MM-dd HH:mm:ss"}},header:{display:!1,textAlign:"right",text:null,date:{display:!0,format:"yyyy-MM-dd HH:mm:ss"}},footer:{display:!1,textAlign:"right",text:null,date:{display:!0,format:"yyyy-MM-dd HH:mm:ss"}}};return this._callback=e,this._options=d.extend(i,t),this._paperSizeType=this._options.commonOption.paperSize||r,e=this.commonOption().layout===g.PRINT_LAYOUT_TYPE.LANDSCAPE?g.PRINT_LAYOUT_TYPE.LANDSCAPE:g.PRINT_LAYOUT_TYPE.PORTRAIT,this._paperSize=this._paperSizeType[e.toUpperCase()],d.isEmpty(this._options.commonOption.margins)&&(this._options.commonOption.margins=19.05),this._paperWidth=(this._paperSize?this._paperSize.width:210)-2*this._options.commonOption.margins,this._paperHeight=(this._paperSize?this._paperSize.height:297)-2*this._options.commonOption.margins,this._items=this._options.batchjob?this._options.batchjob.items:[],this._pages=this._options.batchjob?this._options.batchjob.pages:[],this._renderFrameNode=null,this._progressInfo={total:this._pages.length,error:0,loaded:0},this._itemStatus={},this._running=!1,this.init(),this}var h=t.Element,o=t.UI,d=t.Utils,g=t.Type,r=g.PRINT_PAPER_SIZE_TYPE.A4,s=d.IEVersion();function u(t,e){var i,n=0;for(i in t)t[i].status===e&&(n+=1);return n}e.prototype.init=function(){this.fileIdList=[];var t,e,i,n,o=0,a=this._pages.length,r=0;try{for(o=0;o<a;o++)if(2==(e=(this._pages[o]||"").split("?")).length)for(t=(i=e[1].split("&")).length,r=0;r<t;r++)if(-1!==i[r].indexOf("fileId")&&2==(n=i[r].split("=")).length){if(-1!=this.fileIdList.indexOf(n[1]))break;this.fileIdList.push(decodeURIComponent(n[1]))}}catch(t){console.log(t)}},e.prototype.batchJob=function(){return this._options.batchjob},e.prototype.commonOption=function(){return this._options.commonOption},e.prototype.run=function(){this._running||(this._running=!0,this.renderPrint())},e.prototype.updateProgress=function(c,t){var e,i,n,o,a,r=t.getAttribute("data-index"),p=t.getAttribute("data-rotate"),s=t.naturalWidth,l=t.naturalHeight,h=(this.commonOption().pageRenderSize===g.PRINT_PAGE_RENDER_SIZE_TYPE.AUTO?(e=Math.floor(d.mmToPx(this._paperWidth)),i=Math.floor(d.mmToPx(this._paperHeight)),n=0,a=l,(e<(o=s)||i<l)&&(d.isNumeric(this._options.commonOption.fixedRatio)&&(h=d.toFloat(this._options.commonOption.fixedRatio,2),l<s?l=s*h:s=l*h),e<s?(o=(n=e/s)*s,i<(a=n*l)&&(o*=n=i/a,a*=n)):i<l&&(a=(n=i/a)*l,e<(o=n*s)&&(o*=n=e/o,a*=n)),t.width=d.toInt(o),t.style.width=d.toInt(o)+"px",t.height=d.toInt(a),t.style.height=d.toInt(a)+"px")):this.commonOption().pageRenderSize===g.PRINT_PAGE_RENDER_SIZE_TYPE.FIXED?(e=Math.floor(d.mmToPx(this._paperSize.width)),i=Math.floor(d.mmToPx(this._paperSize.height)),t.removeAttribute("width"),t.removeAttribute("height"),(e<s||i<l)&&(Math.abs(p)%180==90?(t.style.minWidth=this._paperHeight+"mm",t.style.minHeight=this._paperWidth+"mm"):(t.style.minWidth=this._paperWidth+"mm",t.style.minHeight=this._paperHeight-1+"mm"))):(t.removeAttribute("width"),t.removeAttribute("height"),Math.abs(p)%180==90&&(t.style.maxWidth=this._paperHeight+"mm",t.style.maxHeight=this._paperWidth+"mm")),"load"===c.type?"load":"error");this._itemStatus[r]?this._itemStatus[r].status!==h&&(this._itemStatus[r].status=h):this._itemStatus[r]={status:h},this._progressInfo.loaded=u(this._itemStatus,"load"),this._progressInfo.error=u(this._itemStatus,"error"),this.renderProgress()},e.prototype.renderPrint=function(){"window"===t.modulePrintWindow?this.createRenderFrameBlank():this.createRenderFrame()},e.prototype.createRenderFrameBlank=function(){var t=this._paperSize.width,e=this._paperSize.height,i=a.body;if(this._renderFrameNode=n.open("_blank","sformPrintWindow","width="+i.clientWidth+", height="+i.clientHeight+", left=0, top=0, scrollbars=no, resizable=no"),null===this._renderFrameNode)return o.alert("이 페이지에서 팝업이 차단되었습니다.<br/>팝업 허용 후 다시 시도해주세요."),void this.clear();this._renderFrameNode.document&&(this._renderFrameNode.document.body.innerHTML=""),this._renderFrameNode.document.write(this._createInnerHTML(t,e,this._options.commonOption.margins,this._options.commonOption.margins)),this.renderItem()},e.prototype._createInnerHTML=function(t,e,i,n){var o=[],a=-1,r=Math.floor(t-2*n),e=Math.floor(e-2*i),i=-1===s?this._options.commonOption.margins+"mm":i+"mm "+n+"mm",n=this.commonOption().layout===g.PRINT_LAYOUT_TYPE.LANDSCAPE;return o[++a]="<!DOCTYPE html>",o[++a]="<html>",o[++a]="<head>",o[++a]='<meta charset="UTF-8">',o[++a]="<title>&nbsp;</title>",o[++a]="<style>",o[++a]="html, body { margin: 0; padding: 0;}",o[++a]="@media print {",this.commonOption().pageRenderSize===g.PRINT_PAGE_RENDER_SIZE_TYPE.DEFAULT?(o[++a]="html, body { background: #fff; width: "+this._paperSize.width+"mm; height: auto; margin:0; text-align:center; padding:0; box-shadow: 0; } ",o[++a]="page[size='A4'] {border: 0; width: "+this._paperSize.width+"mm; height: "+this._paperSize.height+"mm; display: block; margin: 0;} ",o[++a]=".page_size { position: relative !important; background: #fff; margin: 0; border: initial;border-radius: initial; width: initial; min-height: initial; box-shadow: initial; background: initial; width: "+this._paperSize.width+"mm; max-width: "+this._paperSize.width+"mm;",o[++a]=n?"height: "+(this._paperHeight-1)+"mm; max-height: auto;":"height: "+this._paperSize.height+"mm; min-height: "+this._paperHeight+"mm; max-height: "+this._paperHeight+"mm;",o[++a]="}",o[++a]=".page_size img { margin:0 auto; border: 0; vertical-align:middle; max-width: 100%; max-height: "+(n?this._paperHeight-1+"mm":"100%")+";} "):this.commonOption().pageRenderSize===g.PRINT_PAGE_RENDER_SIZE_TYPE.FIXED?(o[++a]="html, body { background: #fff; width: "+this._paperSize.width+"mm; height: auto; margin:0; text-align:center; padding:0; box-shadow: 0; }",o[++a]="page[size='A4'] {background: #fff; width: "+this._paperSize.width+"mm; height: "+this._paperSize.height+"mm; display: block; margin: 0;} ",o[++a]=".page_size { position: relative !important; background: #fff; overflow:visible; margin: 0; border: initial;border-radius: initial; width: initial; height: initial; min-height: initial; box-shadow: initial; background: initial; width: "+this._paperSize.width+"mm; max-width: "+this._paperWidth+"mm;",o[++a]=n?"height: "+(this._paperHeight-1)+"mm; max-height: "+(this._paperHeight-1)+"mm;":"height: "+this._paperSize.height+"mm; min-height: "+this._paperHeight+"mm; max-height: "+this._paperHeight+"mm;",o[++a]="}",o[++a]=".page_size img { margin:"+i+"; border: 0; vertical-align:middle; max-width: 100%; max-height: "+(n?this._paperHeight-1:this._paperHeight)+"mm;}"):(o[++a]="html, body { background: #fff; width: "+t+"mm; height: auto; margin:0; text-align:center; padding:0; box-shadow: 0; } ",o[++a]="page[size='A4'] {background: #fff; width: "+this._paperSize.width+"mm; height: "+this._paperSize.height+"mm; display: block; margin: 0;} ",o[++a]="@page {",o[++a]="background: #ff0000; width: "+r+"mm; height: "+e+"mm; padding:0; margin: auto; text-align:center; orphans: 0!important; widows: 0!important; border: 0; ",o[++a]="}",o[++a]=".page_size { position: relative !important; background: #fff; overflow:visible; margin: 0; border: initial;border-radius: initial; width: initial; height: initial; min-height: initial; box-shadow: initial; background: initial; width: "+this._paperSize.width+"mm; max-width: "+this._paperSize.width+"mm;",o[++a]="height: auto; min-height: "+e+"mm; max-height: "+e+"mm;",o[++a]="}",o[++a]=".page_size img { margin:0 auto; border: 0; vertical-align:middle; }"),o[++a]=".page_before { page-break-before: always; }",o[++a]=".page_after { page-break-after: always; }",o[++a]=".page_watermark { position: absolute; z-index: 10; width:100%;  color: #ccc; opacity: 0.3; top:0; bottom: 0; overflow:hidden; background:transparent; }",o[++a]=".page_header { position: absolute; z-index: 20; width:100%; color: #232323; opacity: 0.4; top:0; overflow:hidden; }",o[++a]=".page_footer { position: absolute; z-index: 20; width:100%; color: #232323; opacity: 0.4; bottom:0; overflow:hidden; }",o[++a]="}",o[++a]="</style>",o[++a]="</head>",o[++a]="<body>",o[++a]="</body>",o[++a]="</html>",o.join(" ")},e.prototype.createRenderFrame=function(){var t=a.createElement("iframe"),e=this,i=e._paperSize.width,n=e._paperSize.height,o=this._options.commonOption.margins;t.width="1px",t.height="1px",t.src="about:blank",t.onload=function(){t.contentWindow.document.write(e._createInnerHTML(i,n,o,o)),e._renderFrameNode=t,e.renderItem()},a.body.appendChild(t)},e.prototype.renderItem=function(){if(null!==this._renderFrameNode){this.renderProgress();for(var t=("sformPrintWindow"===this._renderFrameNode.name?this._renderFrameNode:this._renderFrameNode.contentWindow).document.body,e=this._pages.length,i=0,i=0;i<e;i++)t.appendChild(this.createItem(i,this._pages[i]))}},e.prototype.createItem=function(t,e){var i=this,n=i._pages.length,n=h.createElement("div",{class:"page_size "+(1<n?"page_after":"page_one")},a.body),o=new Image,e=(o.src=e,o.setAttribute("data-index",t),o.onload=function(t){i.updateProgress(t,this)},o.onerror=function(t){i.updateProgress(t,this)},n.appendChild(o),null);return this._options.header.display&&(e=new Date,t=h.createElement("div",{class:"page_header",style:"text-align:"+this._options.header.textAlign},n),o=this._options.header.text||"",this._options.header.date.display&&(o+="&nbsp;"+d.dateFormat(e,this._options.header.date.format)),t.innerHTML=o),this._options.footer.display&&(null===e&&(e=new Date),t=h.createElement("div",{class:"page_footer",style:"text-align:"+this._options.footer.textAlign},n),o=this._options.footer.text||"",this._options.footer.date.display&&(o+="&nbsp;"+d.dateFormat(e,this._options.footer.date.format)),t.innerHTML=o),this.createWatermarkNode(n,e),n},e.prototype.createWatermarkNode=function(t,e){var i=!1;if(i=0<this._options.watermark.repeat&&this._options.watermark.type===g.WATERMARK_TYPE.TEXT&&this._options.watermark.text||this._options.watermark.type===g.WATERMARK_TYPE.IMAGE&&this._options.watermark.imageHref?!0:i)for(var n=Math.floor(d.mmToPx(this._paperWidth)),i=Math.floor(d.mmToPx(this._paperHeight)),o=this._options.watermark.repeat,a=Math.floor(i/o),r=0;r<o;r++){var s,l=h.createElement("div",{class:"page_watermark"},t);this._options.watermark.type===g.WATERMARK_TYPE.TEXT?(s=this._options.watermark.text,this._options.watermark.date.display&&(s+="&nbsp;"+d.dateFormat(e,this._options.watermark.date.format)),l.innerHTML=s,l.style.fontSize=(0==this._options.watermark.fontSize?a/4:this._options.watermark.fontSize)+"px",d.isNotEmpty(this._options.watermark.fontColor)&&(l.style.color=this._options.watermark.fontColor)):this._options.watermark.type===g.WATERMARK_TYPE.IMAGE&&(l.innerHTML="<img src='"+this._options.watermark.imageHref+"' style='opacity : "+this._options.watermark.opacity+"'/>"),l.style.width=n+"px",l.style.height=a+"px",l.style.lineHeight=a+"px",l.style.top=a*r+"px",l.style.opacity=this._options.watermark.opacity}},e.prototype.print=function(){var t=this,e="sformPrintWindow"===this._renderFrameNode.name?this._renderFrameNode:t._renderFrameNode.contentWindow;setTimeout(function(){try{e.document.execCommand("print",!1,null)}catch(t){e.print()}t.clear(),t._afterPrintProc({event:"print.completed",fileIdList:t.fileIdList||[],success:!0})},1e3)},e.prototype._afterPrintProc=function(t){"function"==typeof this._callback&&this._callback({event:t.event,fileIdList:t.fileIdList||[],success:t.success,message:t.message||""})},e.prototype.clear=function(){this._renderFrameNode&&("sformPrintWindow"===this._renderFrameNode.name?this._renderFrameNode.close():this._renderFrameNode.parentNode.removeChild(this._renderFrameNode)),this._items=[],this._pages=[],this._renderFrameNode=null,this._progressInfo={total:this._pages.length,error:0,loaded:0},this._itemStatus={},this._running=!1},e.prototype.renderProgress=function(){var t,e=this;o.progress(this._progressInfo.loaded,this._progressInfo.total,!0),this._progressInfo.loaded===this._progressInfo.total?e.print():this._progressInfo.loaded+this._progressInfo.error===this._progressInfo.total&&(t="일부 페이지 로드에 실패했습니다.</br>(성공:"+this._progressInfo.loaded+", 실패: "+this._progressInfo.error+")",o.progress(this._progressInfo.loaded+this._progressInfo.error,this._progressInfo.total,!0),o.alert(t,function(){e.print()},function(){e.clear()}))},t.PrintManager=e}),InziSForm.create(function(n,e,i){"use strict";function t(t,e){var i={batchjob:{protocol:o.protocol,baseURL:o.hostname,port:n.Utils.toInt(o.port),path:"",infoURI:n.ServiceAPIMessage.PageInfoRequest.URI,streamingURI:n.ServiceAPIMessage.PageStreamFileRequest.URI,items:[]},commonOption:{mediaSize:"PAGE_TYPE_A4",layout:"auto",margins:0}};return this._options=n.Utils.extend(i,t),this.serviceType=t.serviceType||n.Type.PRINT_SERVICE_TYPE.CUSTOMURI,this.init(),this}var o=n.Utils.globalLocation();t.prototype.init=function(){this._makeParameter()},t.prototype._makeParameter=function(){var t="--\x3e";t+=JSON.stringify(this._options),this.parameter=t+="<--"},t.prototype.requestByCustomURI=function(){var t=n.modulePrintURL[this.serviceType],e=i.createElement("iframe");e.name="sform-batch-print-frame",e.setAttribute("style","width:1px; height:1px;"),i.body.appendChild(e);try{e.contentWindow.location.href=t+this.parameter}catch(t){}setTimeout(function(){i.body.removeChild(e)},1e3)},t.prototype.requestByAjax=function(){var e=this.createHttpRequest(),t=n.modulePrintURL[this._options.batchjob.protocol];e.onreadystatechange=function(t){e.readyState,e.DONE},e.open("POST",t,!0),e.send(this.parameter)},t.prototype.requestByWebSocket=function(){var e=this,t="https"===this._options.batchjob.protocol?"wss":"ws",t=n.modulePrintURL[t];this.socket||this._connect(t),this.socket&&(this.socket.onopen=function(t){e.socket.readyState===e.socket.OPEN&&e.socket.send(e.parameter)},this.socket.onerror=function(t){},this.socket.onclose=function(t){e.message("[일괄인쇄모듈]WebSocket 연결 종료 또는 실패되었습니다.")})},t.prototype.message=function(t){n.UI.message(t,null,null,5e3)},t.prototype._connect=function(t){if("WebSocket"in e)try{this.socket=new WebSocket(t)}catch(t){this.message("[일괄인쇄모듈]WebSocket 연결에 실패했습니다.")}else this.message("WebSocket을 지원하지 않는 브라우저입니다.")},t.prototype.createHttpRequest=function(){var e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){e=new ActiveXObject("Microsoft.XMLHTTP")}}return e},t.prototype.print=function(){this.serviceType===n.Type.PRINT_SERVICE_TYPE.WEBSOCKET?this.requestByWebSocket():this.serviceType===n.Type.PRINT_SERVICE_TYPE.AJAX?this.requestByAjax():this.requestByCustomURI()},n.BatchPrintManager=t}),InziSForm.create(function(t,e,h){"use strict";t.Element,t.UI;function i(t,e){var i={items:[],pages:[],commonOption:{mediaSize:null,layout:"auto",margins:null,pageRenderSize:"auto",paperSize:null,fixedRatio:null},watermark:{type:o.WATERMARK_TYPE.NONE,text:"",imageHref:"",repeat:1,opacity:.3},currentItem:null,editFileItems:null,serviceManager:null};return this._callback=e,this._options=n.extend(i,t),this.init(),this}var n=t.Utils,o=t.Type,a={code:10,message:"인쇄 성공(완료)"},r={code:20,message:"인쇄 중"},s={code:30,message:"인쇄 실패(완료)"},l={code:31,message:"인쇄 실패(사용자 취소)"};i.prototype.init=function(){this._isCompleted=!1,this._setItems()},i.prototype._setItems=function(){this._options.watermark.type;var t,e={};this._fileIdList=[];for(var i=0;i<this._options.pages.length;i++){e[(t=this._options.pages[i]).fileId]||(e[t.fileId]={fileId:t.fileId,annotationId:t.annotationId||"",fileStorageType:t.fileStorageType||"",pageNoList:[],rotate:{}});var n=e[t.fileId].pageNoList||[];n.push(t.pageNo),e[t.fileId].rotate[t.pageNo]=t.rotate,Array.isArray(t.annotations)&&(e[t.fileId].annotationMap||(e[t.fileId].annotationMap={}),e[t.fileId].annotationMap[t.pageNo]=t.annotations),e[t.fileId].pageNoList=n}var o,a,r=this._options.currentItem||{};for(a in e)this._fileIdList.push(decodeURIComponent(a)),(t=e[a]).pages=t.pageNoList.join(","),o={fileId:t.fileId,annotationId:t.annotationId,pages:t.pages,fileStorageType:t.fileStorageType},t.annotationMap&&(o.annotationMap=t.annotationMap),t.rotate&&(o.rotate=t.rotate),r.fileId==a&&0<r.pageNo&&(""!==t.pages&&-1==t.pageNoList.indexOf(r.pageNo)||(o.currentPage=r.pageNo)),this._options.items.push(o);return this},i.prototype.run=function(){var e=this;0===(this._options.items||[]).length?this._afterPrintProc({event:"",success:!1,message:"인쇄 대상 파일이 없습니다."}):this._options.serviceManager.requestPrintFile({items:this._options.items,watermark:this._options.watermark},function(t){t.printId&&200==t.statusCode?e._checkPrintState(t.printId):e._afterPrintProc({event:t,success:!1})},function(t){e._afterPrintProc({event:t,success:!1})})},i.prototype._afterPrintProc=function(t){"function"==typeof this._callback&&this._callback({event:t.event,fileIdList:this._fileIdList||[],success:t.success,message:t.message||""})},i.prototype._checkPrintState=function(t){var n=this;this._options.serviceManager.requestPrintState({printId:t},function(t){var e,i;t.state===r.code?setTimeout(function(){n._checkPrintState(t.printId)},1e3):(n._isCompleted=!0,e=t.state==a.code,i="",t.state==a.code?i=a.message:t.state==s.code?i=s.message:t.state==l.code&&(i=l.message),n._afterPrintProc({event:t,success:e,message:i}))},function(t){n._afterPrintProc({event:t,success:!1})})},t.PCAgentPrintManager=i}),InziSForm.create(function(n,t,e){"use strict";function i(t){this._options=n.Utils.extend({maxSize:10,removalListener:null},t),this.maxSize=Math.max(this._options.maxSize,1),this.removalListener=this._options.removalListener,this._cacheLoadMap={},this._cacheItems=[],this.init()}return n.inherit(i,n.EventHandler),i.prototype.init=function(){},i.prototype.set=function(t,e,i){return this._cacheLoadMap[t]&&!i||(this._cacheLoadMap[t]=e),-1===this._cacheItems.indexOf(t)&&this._cacheItems.push(t),this},i.prototype.get=function(t){return this._cacheLoadMap[t]},i.prototype.load=function(t,e,i){this.set(t,e,i),this.length()>this.maxSize&&this.remove()},i.prototype.asMap=function(){},i.prototype.add=function(){},i.prototype.remove=function(){var t=this._cacheItems.shift();t&&this.Invalidate(t)},i.prototype.Invalidate=function(t,e){var i=this._cacheLoadMap[t];e=void 0===e||e,i&&(delete this._cacheLoadMap[t],e&&n.Utils.isFunction(this.removalListener)&&this.removalListener(i))},i.prototype.clear=function(){for(var t in this._cacheLoadMap)this.Invalidate(t,!1);this._cacheItems=[]},i.prototype.length=function(){return Object.keys(this._cacheLoadMap).length},n.CacheManager=i,n.CacheManager.prototype.constructor=i.prototype,n.CacheManager}),InziSForm.create(function(E,d,g){"use strict";function e(t){var e,i={container:null,wrapper:null,zoom:1,minZoom:.1,maxZoom:4,zoomRatio:.25,angle:0,width:0,height:0,position:new E.core.Position(0,0),offset:new E.core.Position(0,0),hAlign:"",editable:!0,draggable:!0,dragType:{leftButton:"",rightButton:""},visible:!0,transform:0,clip:!1,isMulti:!1,resize:!0,renderNodeType:E.Type.RenderNodeType.CANVAS,renderType:"",renderQuality:"",showScroll:!1,annotationEnable:!1,annotationFixed:!1,annotationViewMode:"all",autoPagemove:!1,globalTransform:{enabled:!0,rotation:!0,zoom:!0},securityLevel:0,cors:!1,watermark:{visible:!0,type:"text",message:"Copy",imageHref:"",position:"center center",width:0,height:0,opacity:.4},magnifier:{type:"small",keepScope:"mouse"},style:{position:"absolute",overflow:"auto",left:"0px",top:"0px"},annotation:{anntype:"",fill:"#ffffff","fill-opacity":.5,stroke:"#000000","stroke-width":3,"font-family":"굴림","font-size":12,"font-weight":"normal","font-style":"normal","font-color":"#000000",text:"","text-halign":0,"text-valign":0},zoomOptions:{dblclickEnabled:!1},eventOptions:{pinch:!0,swipe:!0},listenerId:null};return"boolean"==typeof t.globalTransform&&(e=t.globalTransform,t.globalTransform={enabled:e,rotation:e,zoom:e}),t.zoomOptions&&t.zoomOptions.isDblclickEnabled&&(i.dblclickEnabled=t.zoomOptions.isDblclickEnabled),"string"==typeof t.dragType&&(e=t.dragType,t.dragType={leftButton:e}),this._settings=M.extend(i,t),this._containerNode=k.getElementNode(this._settings.container),this._containerWrapper=null,this._innerContentsNode=null,this._wrapper=this._settings.wrapper,this._pageIndex=-1,this._pageNo=0,this.currentPage=null,this.pageList=[],this.pageCount=0,this.currZoom=1,this.zoomType=M.isNumeric(this._settings.zoom)?P.ZoomType.DEFAULT:this._settings.zoom,this.scale=new E.core.Scale(1,1),this.position=this._settings.position,this.brightness=0,this.annotationVisible=!0,this._data={angle:this._settings.angle||0,controlType:P.ControlType.NONE,annotationType:P.ControlType.NONE,clipData:{},containerWidth:0,containerHeight:0,clientWidth:0,clientHeight:0,contentWidth:0,contentHeight:0,mousePosition:{x:0,y:0}},this._viewport=null,this.status=P.ModuleStatus.READY,this.enableScroll=!1,this._magnifierType=P.MAGNIFIER_TYPE[this._settings.magnifier.type]||P.MAGNIFIER_TYPE.small,this._pageInfoCache={},null===this._settings.listenerId?(this._events=new E.Events,E.listeners(this._events.listenerId(),this._events)):this._events=E.listeners(this._settings.listenerId),this._init(),this}var i,s,C=E.moduleClassName,P=E.Type,S=E.UI,L=E.ImageUtils,M=E.Utils,k=E.Element,n=P.ControlType.name(),R=P.AnnotationType.name(),t=(E.inherit(e,E.EventHandler),e.prototype);function O(t,e){e.clearRect(0,0,e.canvas.width,e.canvas.height),t.onDrawing(),e.setTransform(1,0,0,1,0,0),e.setLineDash&&e.setLineDash([2,2]),e.lineDashOffset=2,e.lineWidth=1,e.strokeStyle="#000000"}function F(t,e){var c=e.data("dragStart"),i=(t.type,e.getScale()),n=e.currentPage,p=e.data("containerWidth"),d=e.data("containerHeight");if(null!==n.getPageNode()){event.target&&event.target.tagName;var o={top:0,left:0,x:t.offsetX||t.layerX,y:t.offsetY||t.layerY,sx:i.x,sy:i.y,dx:0,dy:0,pageX:t.pageX,pageY:t.pageY,dragStart:c},a=e.data("eventData"),g=e._settings.annotationEnable?n.getGraphicNode():n.getImageRenderNode();switch(t.type){case"mousedown":S.uncontextmenu(),e._clipNode=k.select(n.getPageNode(),"."+C+"-clip-rect"),null===e._clipNode&&(o.x=null,o.y=null,e._clipNode=k.createElement("div",{class:C+"-clip-rect"},n.getPageNode())),g.setAttribute("class",C+"-clipping"),e._clipLayerNode=k.select(n.getPageNode(),"."+C+"-clip-layer"),null===e._clipLayerNode&&(e._clipLayerNode=k.createElement("div",{class:C+"-clip-layer"},n.getPageNode())),o.dragStart=!0,e.data("eventData",o),e.data("dragStart",!0),n.data("magnification.on",!1);break;case"mousemove":c&&e._clipNode&&(null!==a.x&&null!==a.y||(a.x=o.x,a.y=o.y,e.data("eventData",a)),s=a.x-o.x,l=a.y-o.y,e._clipNode.style.display="block",e._clipNode.style.top=Math.min(a.y,o.y)+"px",e._clipNode.style.left=Math.min(a.x,o.x)+"px",e._clipNode.style.width=Math.abs(s)+"px",e._clipNode.style.height=Math.abs(l)+"px");break;case"mouseup":var r=e.data("dragType")||2===t.button?e._settings.dragType.rightButton:e._settings.dragType.leftButton;if(a&&null!==a.x&&null!==a.y&&a.dragStart){if(r===P.DragType.SELECTIONAREA){var s=Math.min(a.x,o.x),l=Math.min(a.y,o.y),u=Math.abs(o.x-a.x),f=Math.abs(o.y-a.y),r={x:Math.round(s*(1/o.sx)),y:Math.round(l*(1/o.sy)),width:Math.round(u*(1/o.sx)),height:Math.round(f*(1/o.sy)),ox:0,oy:0,owidth:0,oheight:0},h=function(t,e){var i=e.getImageFile(),n=i.getWidth(),i=i.getHeight(),e=e.isAnnotationFixed()?0:e.data("angle"),o={x:t.x,y:t.y,width:t.width,height:t.height};90===e||-270===e?(o.x=t.y,o.y=i-(t.x+t.width),o.width=t.height,o.height=t.width):180===e||-180===e?(o.x=n-(t.x+t.width),o.y=i-(t.y+t.height)):270!==e&&-90!==e||(o.x=n-(t.y+t.height),o.y=t.x,o.width=t.height,o.height=t.width);return o}(r,n);r.ox=h.x,r.oy=h.y,r.owidth=h.width,r.oheight=h.height,e.trigger("selectionarea.complete",r)}else{var s=a.x-o.x,l=a.y-o.y,h=e.getPage().getPageNode(),r=s/p,m=l/d,y=Math.max(Math.abs(r),Math.abs(m)),v=Math.min(a.x,t.offsetX),I=Math.min(a.y,t.offsetY),s=Math.abs(s),l=Math.abs(l);if(s<10||l<10)return;s=n._getRenderImage(),u=(n.data("angle")%180==0?(e.scrollX=v*(s.containerWidth/s.rWidth),e.scrollY=I*(s.containerHeight/s.rHeight)):(e.scrollX=v*(s.containerWidth/s.rHeight),e.scrollY=I*(s.containerHeight/s.rWidth)),h.style.top=-I+"px",h.style.left=-v+"px",Math.abs(a.x-o.x)),f=Math.abs(a.y-o.y);e.controlType()===P.ControlType.AUTOZOOMIN?e.zoom(i.x+y):e.controlType()===P.ControlType.AUTOZOOMOUT?e.zoom(i.x-y):r<0&&m<0||0<r&&m<0?e.zoom(i.x+y):(0<r&&0<m||r<0&&0<m)&&e.zoom(i.x-y),e._refreshScroll(!0)}e.data("eventData",null)}e.data("dragStart",!1),null!=e._clipNode&&(n.getPageNode().removeChild(e._clipNode),e._clipNode=null),null!=e._clipLayerNode&&(n.getPageNode().removeChild(e._clipLayerNode),e._clipLayerNode=null),g.setAttribute("class",C+"-grab")}}}function D(t,e){var i=e.data("dragStart"),c=t.type,p=e.getScale(),n=e.currentPage,o=e._settings.annotationEnable?n.getGraphicNode():n.getImageRenderNode(),a=n._getRenderImage();if(null!==n.getPageNode()&&null!==a){var d,r,s,l=t,h={top:0,left:0,x:(l=t.changedTouches&&t.changedTouches[0]?t.changedTouches[0]:l).pageX,y:l.pageY,sx:p.x,sy:p.y,dx:0,dy:0};switch(c){case"touchstart":case"mousedown":e.data("eventData",h),e.data("dragStart",!0),o.setAttribute("class","sform-grabbing");break;case"touchend":case"mouseup":e.data("dragStart",!1),o.setAttribute("class","sform-grab");break;case"touchmove":case"mousemove":i&&(d=(r=e.data("eventData")).x-h.x,r=r.y-h.y,s=e.getPage().getPageNode(),r=M.toInt(s.style.top,0)-r,s=M.toInt(s.style.left,0)-d,n.data("angle")%180==0?(e.scrollX=-s*(a.containerWidth/a.rWidth),e.scrollY=-r*(a.containerHeight/a.rHeight)):(e.scrollX=-s*(a.containerWidth/a.rHeight),e.scrollY=-r*(a.containerHeight/a.rWidth)),e.data("eventData",h),e.onDrawing(s,r),e.controlType()===P.ControlType.MAGNIFICATION&&2==e.data("event.buttons")&&n.magnify(E.Element.getLayerX(t),E.Element.getLayerY(t),e._magnifierType.width,e._magnifierType.height,t)),o.setAttribute("class",i?"sform-grabbing":"sform-grab");break;case"touchcancle":case"mouseleave":e.data("dragStart",!1),o.setAttribute("class","sform-grab")}}}function B(t,e){var i=e.currentPage;e.data("dragging");var n,o=t,a=o.type;switch(a){case"mousedown":case"touchstart":n=o,e.data("dragging",!0),i.data("magnification.on",!0),e.onDrawing(),i.magnify(E.Element.getLayerX(n),E.Element.getLayerY(n),e._magnifierType.width,e._magnifierType.height,n);break;case"mouseup":case"touchcancel":break;case"mousemove":case"touchmove":n=o,i.magnify(E.Element.getLayerX(n),E.Element.getLayerY(n),e._magnifierType.width,e._magnifierType.height,n);break;case"mouseleave":case"touchend":e.unbindMagnificationHandler(a)}}return t._init=function(){var t,e,i;if(this.status!==P.ModuleStatus.INITIALIZE_COMPLETE)return null===this._containerNode&&(this._containerNode=this._createContainerNode(this._wrapper,M.getRandomId(P.LayerType.VIEWER))),this._containerWrapper=new E.DOMWrapper(this._containerNode),this._initZoom=this._settings.zoom,e=this._containerWrapper.offset(),t=e.width,e=e.height,0!==t&&0!==e||(i=this._containerNode.parentNode)&&(i=k.offset(i),0===t&&(t=i.width),0===e&&(e=i.height)),this._settings.width=this._settings.width||t,this._settings.height=this._settings.height||e,this._innerContentsNode=k.createElement("div",{style:M.mapToString(this._settings.style,":",";")},this._containerNode),this._innerContentsNode.style.width=this._settings.width+"px",this._innerContentsNode.style.height=this._settings.height+"px",this._innerContentsNode.style.overflow="clip"===this._settings.renderType?"hidden":"auto",this._data.containerWidth=this._settings.width,this._data.containerHeight=this._settings.height,this._data.clientWidth=this._containerNode.clientWidth,this._data.clientHeight=this._containerNode.clientHeight,this.scrollY=0,this.scrollX=0,this._initListener(),this._initEvent(),"clip"===this._settings.renderType?this._initCustomScroll():this._initScroll(),E.Utils.isMobile().any()&&this._initMobileEvent(),this.status=P.ModuleStatus.INITIALIZE_COMPLETE,this},t._initMobileEvent=function(){var e,t,i,n,r=this,o=null,a=null;function s(t){var e,i,n=!1,o=t.type,a=t.deltaTime,t=t.distance;return P.ControlType.NONE===r.controlType()&&(e=(i=r.currentPage.getPageNode()).clientWidth,i=i.clientHeight,a<350&&(("swipeleft"===o||"swiperight"===o)&&e/3<=t||("swipeup"===o||"swipedown"===o)&&i/3<=t)&&(n=!0)),n}(this._settings.eventOptions.pinch||this._settings.eventOptions.swipe)&&(t=new Hammer.Manager(this._innerContentsNode),this._settings.eventOptions.pinch&&(i=new Hammer.Pinch,n=new Hammer.Pan,i.recognizeWith(n),t.add([i]),t.on("pinchstart",function(t){e=r.getScale(),o=e.x,a=e.y}),t.on("pinchmove",function(t){P.ControlType.NONE===r.controlType()&&r.zoom(parseFloat(Math.min(o,a)*t.scale).toFixed(3))})),this._settings.eventOptions.swipe&&(n=new Hammer.Swipe({direction:Hammer.DIRECTION_ALL}),t.add([n]),t.on("swiperight swipedown",function(t){s(t)&&r.trigger("trigger.swipe.movepage",{type:"prev"})}),t.on("swipeleft swipeup",function(t){s(t)&&r.trigger("trigger.swipe.movepage",{type:"next"})})))},t._initScroll=function(){var i,n,a,r,s,l,h=this,c=!1,p=E.Utils.isMobile().any();this.on(p?"touchstart":"mousedown",function(t){c=!0,s=p?t.touches[0]:t,i=a=s.clientX,n=r=s.clientY,l=t.timeStamp},this._innerContentsNode),this.on(p?"touchend":"mouseup mouseleave",function(t){var e,i,n,o;c&&(c=!1,h._settings.eventOptions.swipe&&!p&&(t=t,h.currentPage&&(a-=s.clientX,r-=s.clientY,l=t.timeStamp-l,t=Math.abs(a),i=!1,l<350&&(t=Math.abs(a)>Math.abs(r)?(e=a<0?"swiperight":"swipeleft",Math.abs(a)):(e=r<0?"swipedown":"swipeup",Math.abs(r)),n=(o=h.currentPage.getPageNode()).clientWidth,o=o.clientHeight,(i=("swipeleft"===e||"swiperight"===e)&&n/3<=t||("swipeup"===e||"swipedown"===e)&&o/3<=t?!0:i)&&("swipeleft"===e||"swipeup"===e?h.trigger("trigger.swipe.movepage",{type:"next"}):h.trigger("trigger.swipe.movepage",{type:"prev"}))))))},this._innerContentsNode),this.on(p?"touchmove":"mousemove",function(t){var e;s=p?t.changedTouches[0]:t,c&&(t=s.clientX-i,e=s.clientY-n,10<Math.abs(t)+Math.abs(e)&&(i=s.clientX,n=s.clientY,h._innerContentsNode.scrollLeft-=t,h._innerContentsNode.scrollTop-=e))},this._innerContentsNode)},t._initCustomScroll=function(){this.enableScroll=!0;var o,a=20,r=this,s=0;"clip"===this._settings.renderType&&(this._scrollbarVertical=k.createElement("div",{class:E.moduleClassName+"-ui-scrollY"},this._innerContentsNode),this._scrollbarHorizontal=k.createElement("div",{class:E.moduleClassName+"-ui-scrollX"},this._innerContentsNode),this._onDragScroll()),M.bind(this._containerNode,"mousewheel wheel",function(t){t.stopPropagation(),t.preventDefault(),t.srcElement||t.target;var e,i,n=0;(t=t||d.event).wheelDelta?(n=t.wheelDelta/120,d.opera&&(n=-n)):t.detail?n=-t.detail/3:t.deltaY&&(n=-t.deltaY/120),n&&(t.ctrlKey?(t=r.getScale(),t=Math.max(t.x,t.y),r.zoom(t+.05*n)):(t=n,n=!1,r._settings.autoPagemove&&r.currentPage&&(i=r.currentPage.getPageNode(),((e=M.toInt(i.style.height,0))+((i=M.toInt(i.style.top,0))-r._viewport.height)<=0&&t<0||e>=r._viewport.height&&0===i&&0<t)&&(n=!0)),o&&clearTimeout(o),n?(s=t,o=setTimeout(function(){var t=r._pageNo;s<0?t+=1:t-=1,clearTimeout(o),o=void 0,r.trigger("trigger.viewer.movepage",{pageNo:t,force:!1})},700)):r.scrollTo(r.scrollX,r.scrollY-t*a*2)))},{passive:!1})},t._onDragScroll=function(){var a,r,s,l,h,c=this,p=!1;k.getPageY(this._innerContentsNode),k.getPageX(this._innerContentsNode);function t(t){a=t.target||t.srcElement,k.hasClass(a,E.moduleClassName+"-ui-scrollY")?(p=!0,c.scrollMoved=!0,r=t.pageX,s=t.pageY,l=c.scrollX,h=c.scrollY):k.hasClass(a,E.moduleClassName+"-ui-scrollX")&&(p=!1,c.scrollMoved=!0,r=t.pageX,s=t.pageY,l=c.scrollX,h=c.scrollY)}this.scrollMoved=!1,this.on("mousedown touchstart pointerdown",t,this._scrollbarVertical),this.on("mousedown touchstart pointerdown",t,this._scrollbarHorizontal),this.on("mouseup touchend click pointerup",function(t){c.scrollMoved=!1,a=null,s=r=0},g.body),this.on("mousemove touchmove pointermove",function(t){var e,i,n,o;c.scrollMoved&&a&&(o=n=0,t.touches?1===t.touches.length&&(e=t.targetTouches[0].pageX,i=t.targetTouches[0].pageY):(e=t.pageX,i=t.pageY),p?(o=h+(i-s),n=c.scrollX):(n=l+(e-r),o=c.scrollY),c.scrollTo(n,o))},d)},t._initListener=function(){},t._initEvent=function(){var t=this;M.bind(d,"resize",function(){t.updatePosition()}),this._initGolbalEvent()},t._createContainerNode=function(t,e){return this._wrapper.createElement("div",{id:M.getRandomId(e),class:C+"-ui-toolbar"})},t.data=function(t,e){return 0===arguments.length?this._data:M.data.call(this,t,e)},t.isSelected=function(t){if(!(0<arguments.length))return this.data("isSelectedAnn");this.data("isSelectedAnn",t),t?(this.data(n,P.ControlType.SELECT),this.data(R,P.ControlType.NONE)):P.ControlType.SELECT===this.controlType()&&this.data(n,P.ControlType.NONE),this.currentPage&&(this.currentPage.unSelectedItem(),this.currentPage.data(n,this.controlType()))},t.addPage=function(t,e){if(t="number"==typeof t?t:this.pageList.length,this.pageList[t])return this.pageList[t];this._pageInfoCache[t]&&(this._pageInfoCache[t].angle="",this._pageInfoCache[t].scale="");e={index:t,angle:M.isNumeric(e)?e:this.data("angle")||0,zoomType:this._initZoom,container:this._innerContentsNode,renderNodeType:this._settings.renderNodeType,renderType:this._settings.renderType,renderQuality:this._settings.renderQuality,editable:this._settings.editable,annotationEnable:this._settings.annotationEnable,annotationFixed:this._settings.annotationFixed,annotationViewMode:this._settings.annotationViewMode,securityLevel:this._settings.securityLevel,listenerId:this._events.listenerId(),cors:this._settings.cors},e=new E.core.Page(e);return this.pageList[t]=e,this._initBaseHandler(e.getPageNode()),null===this.currentPage&&(this.currentPage=e,this._pageNo=e.pageNo(),this._pageIndex=e.pageNo()),this.pageCount=this.pageList.length,this._bindPageLoadComplete(e),e},t._bindPageLoadComplete=function(t){var e,i=this;t&&(e=t.on("page.load.complete"+t.pageIndex(),function(t){i._displayPageNode(),i.trigger("page.file.load",{page:t.page,fileId:t.fileId,itemId:t.itemId,pageNo:t.pageNo,imageWidth:t.width,imageHeight:t.height})}),t.updateBindEvents(e),e=t.on("page"+t.pageIndex()+".annotation.drawEnd",function(t){i.setAnnotationType(P.ControlType.NONE),i.controlType()===P.ControlType.ANNOTATION&&(i.changeControlType(P.ControlType.NONE),i.onDrawing())}),t.updateBindEvents(e),e=t.on("page"+t.pageIndex()+".renderEnd",function(t){i._afterRender()}),t.updateBindEvents(e))},t.moveNextPage=function(){this.movePage(this.pageNo()+1)},t.movePrevPage=function(){this.movePage(this.pageNo()-1)},t.movePage=function(t){var e=this.totalPageNo();t=t<0?1:e<t?e:t,this.isSelected(!1),this._pageNo=t,this._displayPageNode()},t._displayPageNode=function(){this.currentPage&&(this.currentPage.uncontextmenu(),this.clearDisplayImageArea(),this.clearLayer(),this.setAnnotationType(""),this.controlType()==P.ControlType.CROP&&this.changeControlType(P.ControlType.NONE),this.currentPage.hide()),this.currentPage=this.pageList[this._pageNo-1],this._renderPage()},t._renderPage=function(){var t;this.currentPage&&(this.currentPage.data(n,this.controlType()),this.currentPage.show(),this.currentPage.setAnnotationVisible(this.annotationVisible),t=this.currentPage.zoom(),this._settings.globalTransform.enabled&&this._settings.globalTransform.zoom&&(t=this.zoomType===P.ZoomType.DEFAULT?this.getScale().x:this.zoomType),this.zoom(t),this.scrollTo(0,0))},t.pageNo=function(){return this.currentPage?this.currentPage.pageNo():null},t.pageIndex=function(t){return t&&(this._pageIndex=t),this._pageIndex},t.totalPageNo=function(){return this.pageList.length},t.removePage=function(t){var e=this.pageList[t];e&&(M.unbind(e.getPageNode(),"mousemove mouseleave mouseup mousedown touchstart touchmove touchend touchcancel",i),e.remove()),this.pageList[t]=null},t.pageIndex=function(){var t=this.pageList.length;return 0<t?t-1:t},t.setPosition=function(t,e){this.x=t,this.y=e},t.filter=function(t,e){this.data("filter",t),null!==this.currentPage&&(P.FilterType.GRID!==t&&(P.FilterType.BRIGHTNESS===t&&this.currentPage.data("brightness",this.currentPage.data("brightness")+e),this.onDrawing()),this.currentPage.filter(this.data("filter")))},t.zoom=function(t,c,p,d){if(!(0<arguments.length))return this.zoomType===P.ZoomType.DEFAULT?this.currZoom:this.zoomType;var e,i,n,o,a,r,s=this._innerContentsNode.clientWidth,l=this.data("containerHeight"),g=this.currentPage?this.currentPage.data("angle")%180:0,h=this.currentPage?this.currentPage.getImageFile():null;h&&(e=h.getWidth(),i=h.getHeight(),o=n=0,r=a=1,this.getScale(),0!=e&&0!=i&&(M.toInt(g/90)%2==0||this.currentPage.isAnnotationFixed()||(e=h.getHeight(),i=h.getWidth()),M.isNumeric(t)||t===P.ZoomType.DEFAULT?(this.currZoom=M.isNumeric(t)?t:this.currentPage.zoom(),n=e*t,o=i*t,this.zoomType=P.ZoomType.DEFAULT,a=r=this.currZoom<this._settings.minZoom?this._settings.minZoom:this.currZoom>this._settings.maxZoom?this._settings.maxZoom:this.currZoom):(t=t.toLowerCase(),P.ZoomType.IN===t||P.ZoomType.OUT===t?this.zoomType=P.ZoomType.DEFAULT:this.zoomType=t,P.ZoomType.FITMAX!==t&&P.ZoomType.FITAUTO!==t||(t=(a=(n=s)/e)<(r=(o=l)/i)?P.ZoomType.FITWIDTH:P.ZoomType.FITHEIGHT),n=(h=this.transformZoomData({type:t,width:e,height:i,containerWidth:s,containerHeight:l,angle:g})).width,o=h.height,a=h.sx,r=h.sy),a=M.toFloat(a,3),r=M.toFloat(r,3),this.currZoom=[a,r].sort()[0],this.setScale(a,r),this.resize(n,o,!0),this._viewport=this.viewport(),this.scrollTo(),this._refreshScroll(!0),this._displayImageAreaRender()))},t.transformZoomData=function(t){var e,i,n,o={width:0,height:0,sx:0,sy:0};return P.ZoomType.IN===t.type||P.ZoomType.OUT===t.type?(n=this.currZoom,e=this._settings.minZoom,i=this._settings.maxZoom,n=M.toFloat(n+this._settings.zoomRatio*(t.type===P.ZoomType.IN?1:-1),2),o.width=t.width*(n=n<e?e:i<n?i:n),o.height=t.height*n,o.sx=n,o.sy=n):P.ZoomType.FITHEIGHT===t.type?(o.width=t.width*(t.containerHeight/t.height),o.height=t.containerHeight,o.sx=o.width/t.width,o.sy=o.height/t.height):P.ZoomType.FITWIDTH===t.type?(o.width=t.containerWidth,o.height=t.height*(t.containerWidth/t.width),o.width=o.height>t.containerHeight?o.width-("clip"===this._settings.renderType?0:17):o.width,o.sx=o.width/t.width,o.sy=o.height/t.height):P.ZoomType.FITSCREEN===t.type&&(o.width=t.containerWidth,o.height=t.containerHeight,o.sx=t.containerWidth/t.width,o.sy=t.containerHeight/t.height),o},t.getZoomType=function(){return this.zoomType},t.setScale=function(t,e){this.scale.setScale(t,e);t={scale:{x:t,y:e},zoomType:this.zoomType};this.trigger("change.zoom",t,this.currentPage),this.trigger("change.current.zoom",t)},t.getScale=function(){return this.currentPage&&!this._settings.globalTransform.enabled?this.currentPage.getScale():this.scale},t.rotate=function(t,e){var i;e="boolean"==typeof e?e:this._settings.globalTransform.enabled&&this._settings.globalTransform.rotation,(e="checkbox"===t?!0:e)?(i=((this.data("angle")||0)+t)%360,this.data("angle",i)):this.data("angle",0),"number"==typeof t&&null!==this.currentPage&&(this.trigger("change.rotate",{angle:t,degrees:t,applyAll:e},!0===e?null:this.currentPage),this.zoom(this.zoomType,!0))},t.scrollTo=function(t,e){var i,n,o,a;this.enableScroll?(this.scrollY,this.scrollX,t=void 0!==t?t:this.scrollX,e=void 0!==e?e:this.scrollY,null!==this.currentPage&&null!=this._viewport&&(this._viewport.height>=this._viewport.dspHeight?this.scrollY=a=0:(a=this._viewport.height/this._viewport.dspHeight*this._viewport.height,e<this._viewport.height-a?this.scrollY=Math.max(e,0):this.scrollY=Math.min(e,this._viewport.height-a)),this._scrollbarVertical.style["-ms-transform"]="translate(0px, "+this.scrollY+"px)",this._scrollbarVertical.style["-webkit-transform"]="translate(0px, "+this.scrollY+"px)",this._scrollbarVertical.style.transform="translate(0px, "+this.scrollY+"px)",this._viewport.width>=this._viewport.dspWidth?this.scrollX=i=0:(i=this._viewport.width/this._viewport.dspWidth*this._viewport.width,t<this._viewport.width-i?this.scrollX=Math.max(t,0):(this.scrollX=Math.min(t,this._viewport.width-i),o=this._viewport.width-this._viewport.dspWidth)),this._scrollbarHorizontal.style.left=this.scrollX+"px",this.currentPage.getPageNode()&&((a=this.currentPage._getRenderImage())&&(0===M.toInt(this.currentPage.data("angle")%180)?(n=-(this.scrollY*(a.rHeight/a.containerHeight)),void 0===o&&(o=-(this.scrollX*(a.rWidth/a.containerWidth)))):(n=-(this.scrollY*(a.rWidth/a.containerHeight)),void 0===o&&(o=-(this.scrollX*(a.rHeight/a.containerWidth))))),this.onDrawing(o,n)))):(this._innerContentsNode.scrollTop=e,this._innerContentsNode.scrollLeft=t)},t._refreshScroll=function(t){var e,i,n,o;this.enableScroll&&null!==this._viewport&&null!==this.currentPage&&(i=this.currentPage._getRenderImage(),this._viewport.height>=this._viewport.dspHeight?this.scrollY=o=0:(o=this._viewport.height/this._viewport.dspHeight*this._viewport.height,this.scrollY<this._viewport.height-o?this.scrollY=Math.max(this.scrollY,0):this.scrollY=Math.min(this.scrollY,this._viewport.height-o)),this._scrollbarVertical.style.height=o+"px",this._scrollbarVertical.style.display=0===o?"none":"block",this._scrollbarVertical.style["-ms-transform"]="translate(0px, "+this.scrollY+"px)",this._scrollbarVertical.style["-webkit-transform"]="translate(0px, "+this.scrollY+"px)",this._scrollbarVertical.style.transform="translate(0px, "+this.scrollY+"px)",this._viewport.width>=this._viewport.dspWidth?this.scrollX=e=0:(e=this._viewport.width/this._viewport.dspWidth*this._viewport.width,this.scrollX<this._viewport.width-e?this.scrollX=Math.max(this.scrollX,0):this.scrollX=Math.min(this.scrollX,this._viewport.width-e)),this._scrollbarHorizontal.style.width=e+"px",this._scrollbarHorizontal.style.display=0===e?"none":"block",this._scrollbarHorizontal.style.left=this.scrollX+"px",t&&i&&(o=0===M.toInt(this.currentPage.data("angle")%180)?(n=-(this.scrollY*(i.rHeight/i.containerHeight)),-(this.scrollX*(i.rWidth/i.containerWidth))):(n=-(this.scrollY*(i.rWidth/i.containerHeight)),-(this.scrollX*(i.rHeight/i.containerWidth))),this.onDrawing(o,n)))},t.updatePosition=function(t,e){var i,n,o,a=this._containerNode.offsetWidth,r=this._containerNode.offsetHeight,s=E.Utils.isNumeric(t)?t:this._containerNode.clientWidth,l=E.Utils.isNumeric(e)?e:this._containerNode.clientHeight,h=!1;(E.Utils.isNumeric(t)||E.Utils.isNumeric(e))&&(this._containerNode.style.width=s+"px",this._containerNode.style.height=l+"px",this._innerContentsNode.style.width=s+"px",this._innerContentsNode.style.height=l+"px",a=this._containerNode.offsetWidth,r=this._containerNode.offsetHeight),s===this.data("clientWidth")&&l===this.data("clientHeight")||(h=!0),null!==this.currentPage&&(e=(t=this.currentPage.getPageNode()).clientWidth,i=t.clientHeight,n=M.toInt(l-i)/2,o=M.toInt(this._innerContentsNode.offsetWidth-e)/2,o=this.zoomType===P.ZoomType.FITWIDTH&&this._innerContentsNode.offsetWidth<e?0:o,this._updateElementSize({containerWidth:a,containerHeight:r,clientWidth:s,clientHeight:l,contentWidth:e,contentHeight:i,canvasWidth:1,canvasHeight:1}),k.prop(t.style,{marginTop:(0<n?n:0)+"px",marginLeft:(0<o?o:0)+"px"}),this._viewport=this.viewport(),h&&this.zoom(this.currentPage.zoom()))},t.viewportUpdate=function(){this.currentPage&&this.currentPage.viewportUpdate()},t.resize=function(t,e,i){i=void 0===i||i,this.currentPage&&(this.currentPage.resize(t,e),this.currentPage.getImageData()&&i&&this.onDrawing(),this.viewportUpdate())},t.viewport=function(t,e,c){var p,d,i,n,o,a,r,s,l,h,g=0,u=0,f=0,m=0;return t=t||0,e=e||0,this.currentPage&&(o=(a=this.getScale()).x,a=a.y,r=this.data("containerWidth"),s=this.data("clientHeight"),h=this.currentPage.getImageFile(),l=M.toFloat(h.width)||r,h=M.toFloat(h.height)||s,(h=this.currentPage.data("angle")/90%2==0||this.currentPage.isAnnotationFixed()?(n=Math.floor(l*o),Math.floor(h*a)):(n=Math.floor(h*a),Math.floor(l*o)))<s?(d=s/2,u=m=e=(s-h)/2):(u=s-h,m=0,d=s/2-(e=Math.min(0,Math.max(e,s-h)))),n<r?(p=r/2,g=f=t=(r-n)/2):(p=r/2-(t=Math.min(0,Math.max(t,r-n))),u=r-n,m=0),(l=Math.round(M.toFloat(p,3)))-r/2<0?l=r/2:n<l+r/2&&(l=n-r/2),(i=Math.round(M.toFloat(d,3)))-s/2<0?i=s/2:h<i+s/2&&(i=h-s/2),p=Math.round(l/o),d=Math.round(i/a)),{top:e,left:t,minX:g,minY:u,maxX:f,maxY:m,sx:o,sy:a,width:r,height:s,dspWidth:n,dspHeight:h,cx:l,cy:i}},t._updateElementSize=function(t){this.data(t)},t.clearEventListener=function(t){},t.setWidth=function(t){this._settings.width=t},t.setHeight=function(t){this._settings.height=t},t.setSize=function(t,e){this._settings.width=t,this._settings.height=e},t.getSize=function(){return new E.core.Size(this._settings.width,this._settings.height)},t.setting=function(t,e){return 1===arguments.length?this._settings[t]:2===arguments.length?(this._settings[t]=e,this):this._settings},t.setVisible=function(t){this._settings.visible=t},t.isVisible=function(){return this._settings.visible},t.setEditable=function(t){return!1===(this._settings.editable=t)&&this.currentPage&&this.currentPage.unSelectedItem(),this.trigger("change.editable.page",t),this},t.editable=function(t){return 1===arguments.length?(!1===(this._settings.editable=t)&&this.currentPage&&this.currentPage.unSelectedItem(),this.trigger("change.editable.page",t),this):this._settings.editable},t.isEditable=function(){return this._settings.editable},t.setDraggable=function(t){this._settings.draggable=t},t.isDraggable=function(){return this._settings.draggable},t.setImageData=function(t){(null===this.currentPage?this.addPage():this.currentPage).setImageData(t)},t.setImage=function(i,n,o){var a=new Image,t=Math.random(),r=this;i=-1===i.indexOf("?")?i+"?t="+t:i+"&t="+t,a.src=i,null===this.currentPage&&this.addPage(),a.onload=function(t){r.reset(),a.width=a.naturalWidth,a.height=a.naturalHeight;var e=new E.core.Image({data:a,dataUrl:a.src,name:i,width:a.width,height:a.height,fileId:n,pageNo:o});r.currentPage.setImageFile(e),r.currentPage.resetItem(),r.zoom(r.zoom()),r.trigger("page.file.load",{pageNo:r.currentPage.pageNo(),imageWidth:a.width,imageHeight:a.height})}},t.setAnnData=function(t){if(t.data)for(var e=0;e<this.pageList.length;e++){var i=this.pageList[e];if(i){var n=i.getPageInfo();if(n.fileId===t.fileId&&n.itemPageNo===t.pageNo){this._setAnnotationByPage(i,t);break}}}},t._setAnnotationByPage=function(t,e){this.resetann(t),t.updateAnnotationData({annotationId:e.annotationId,fileId:e.fileId,pageNo:e.pageNo}),t.drawingItems(e.data),this.trigger("page.reset.annotation",t)},t.reset=function(){this.brightness=0,this._settings.angle=0,this.setScale(1,1),this.resetann()},t.resetann=function(t){t=t||this.currentPage,M.isNotEmpty(t)&&t.resetItem()},t.getPage=function(t){return"number"==typeof t?this.pageList[t]:this.currentPage},t.getPageData=function(t){t=t?this.getPage(t-1):this.currentPage;return t||null},t.onDrawing=function(t,e){if(null!==this.currentPage&&null!==this.currentPage.getPageNode())try{this.currentPage.render(t,e),this._afterRender()}catch(t){console.log(t)}},t._afterRender=function(){try{this.updatePosition(),this.viewportUpdate(),this._refreshScroll(!1),this.setWatermark(),this.currentPage.filter(this.data("filter"));var t=this.currentPage.getCanvasContext();if(!t)return;var e=this.currentPage.data("brightness");e&&E.Filter.brightness(t.canvas,e),M.isSupportCanvas()?this.selectedPageDataURL=t.canvas.toDataURL():this.selectedPageDataURL=this.currentPage.getImageData(),t.save()}catch(t){console.log(t)}},t.setWatermark=function(t){var e,i;return 0<arguments.length&&(this._settings.watermark=M.extend(this._settings.watermark,t)),this.currentPage&&((e=this)._settings.watermark.type!==P.WATERMARK_TYPE.IMAGE||0<this._settings.watermark.width&&0<this._settings.watermark.height?this.currentPage.setWatermark(this._settings.watermark):((i=new Image).src=this._settings.watermark.imageHref,i.onload=function(){e._settings.watermark.width=this.naturalWidth,e._settings.watermark.height=this.naturalHeight,e.currentPage.setWatermark(e._settings.watermark),i.onload=null,i=null})),this},t._positionCenter=function(t,e){if(!(0<arguments.length))return this.position;this.position.x=M.toFloat(t),this.position.y=M.toFloat(e)},t.setAnnotationType=function(t){var e;this.currentPage&&(e=null,this.isSupportedAnnotation(t)?(this.isSelected(!1),this.currentPage.undrawing(),this.changeControlType(P.ControlType.ANNOTATION),e=t.toLowerCase()):(e=P.ControlType.NONE,this.clearAnnotationType()),this.data(R,e),this.currentPage.unSelectedItem(),this.clearLayer(),S.uncontextmenu(),this.trigger("change.annotation.type",t))},t.undrawing=function(t){return this.currentPage&&this.currentPage.undrawing(),this},t.clearLayer=function(){var t=k.select(g.body,"."+E.moduleClassName+"-popup-layer");t&&(k.parent(t,"."+E.moduleClassName+"-ui-message")||t.parentNode.removeChild(t))},t.clearAnnotationType=function(){null!==this.currentPage&&(this.data(n)!==P.ControlType.NONE?(this.data({CONTROL_TYPE:P.ControlType.NONE,ANNOTATION_TYPE:P.ControlType.NONE}),this.currentPage.undrawing(),this.changeControlType(P.ControlType.NONE)):(this.data(R,P.ControlType.NONE),this.data("isSelectedAnn",!1)),this.currentPage.unSelectedItem())},t.getAnnotationType=function(){return this.data(R)},t.setAnnotationProp=function(t,e,i){(this.currentPage&&M.isNotEmpty(this.currentPage.selectedItem())||this.currentPage&&this.currentPage&&M.isNotEmpty(e))&&this.currentPage.itemProp(t,e)},t.setAnnotationVisible=function(t){this.annotationVisible=t,this.currentPage.setAnnotationVisible(this.annotationVisible)},t.getAnnotationVisible=function(){return this.currentPage.isAnnotationVisible()},t.setAnnotationOption=function(t,e){2===arguments.length?this._settings.annotation[t]=e:"object"==typeof t&&(this._settings.annotation=M.extend(this._settings.annotation,t));var i={};i[t]=e,this.currentPage&&this.currentPage.selectedItem()&&this.currentPage.changeItemAttr(this.currentPage.selectedItem(),i)},t.getAnnotationOption=function(t){return 1===arguments.length?this._settings.annotation[t]:this._settings.annotation},t.stopEvent=function(t){return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),!1},t.changeControlType=function(t){var e=this.data("controlType");this.currentPage&&(this.currentPage.unSelectedItem(),this.currentPage.data(n,t),e!==t&&this.onDrawing(),S.uncontextmenu(),t!==P.ControlType.ANNOTATION&&this.data(R,P.ControlType.NONE)),this.data(n,t),this.trigger("change.viewer.control.type",t)},t.handleEvent=function(t){t.type},t.dragType=function(){return 0===arguments.length?this.setting("dragType"):2!==arguments.length?1===arguments.length&&"string"==typeof arguments[0]?(this._settings.dragType.leftButton=arguments[0],this):1===arguments.length?(M.extend(this._settings.dragType,arguments[0]),this):void 0:void(this._settings.dragType[arguments[0]]=arguments[1])},t._initBaseHandler=function(t){var x=this,w=-1,N=-1;i=function(t){var e,i=x.currentPage;if(null!=i){var c,n=x.controlType(),o=t.type,p=M.getEventTarget(t).nodeName.toLowerCase();if(i&&(c=x._settings.annotationEnable?i.getGraphicNode():i.getImageRenderNode(),"click"==o&&x.trigger("click.viewer.page",{pageNo:i.pageNo()})),x.data("prev.dragging",x.data("dragging")),i.data("pasteItem")&&2===t.buttons?S.contextmenu(i,i.data("pasteItem"),t.pageX,t.pageY):"mousedown"===o||"touchstart"===o?(x.data("event.buttons",t.buttons),w=(t.changedTouches?t.changedTouches[0]:t).pageX,N=(t.changedTouches?t.changedTouches[0]:t).pageY,x.data("dragging",!0)):"mousemove"!==o&&"touchmove"!==o||!x.data("dragging")?"mouseup"!==o&&"mouseleave"!==o&&"touchend"!==o&&"touchcancel"!==o||(w=N=-1,x.data("dragging",!1)):x.data("dragging",!0),n===P.ControlType.MAGNIFICATION)2==x.data("event.buttons")?D(t,x):B(t,x);else if(n===P.ControlType.ANNOTATION)c.setAttribute("class",E.moduleClassName+"-drawing"),"mousedown"!==o&&"touchstart"!==o||(c=t,a=x,g=E.Element.getLayerX(c),c=E.Element.getLayerY(c),g={x:g,y:c,anntype:a.data(R)},g=M.extend(a._settings.annotation,g,!0),a.currentPage.drawing(g));else if(n===P.ControlType.CROP){var a=t,r=x,d=r.data("dragStart"),g=(a.type,r.getScale()),u=r.currentPage;if(r.data("containerWidth"),r.data("containerHeight"),null!==u.getPageNode()){event.target&&event.target.tagName;var f,m,y,s,l={top:0,left:0,x:a.offsetX||a.layerX,y:a.offsetY||a.layerY,sx:g.x,sy:g.y,dx:0,dy:0,pageX:a.pageX,pageY:a.pageY,dragStart:d},h=r.data("eventData"),v=r._settings.annotationEnable?u.getGraphicNode():u.getImageRenderNode();switch(a.type){case"mousedown":S.uncontextmenu(),r._clipNode=k.select(u.getPageNode(),"."+C+"-clip-rect"),null===r._clipNode&&(l.x=null,l.y=null,r._clipNode=k.createElement("div",{class:C+"-clip-rect"},u.getPageNode())),v.setAttribute("class",C+"-clipping"),l.dragStart=!0,r.data("eventData",l),r.data("dragStart",!0),u.data("magnification.on",!1);break;case"mousemove":d&&r._clipNode&&(null!==h.x&&null!==h.y||(h.x=l.x,h.y=l.y,r.data("eventData",h)),s=h.x-l.x,f=h.y-l.y,r._clipNode.style.display="block",r._clipNode.style.top=Math.min(h.y,l.y)+"px",r._clipNode.style.left=Math.min(h.x,l.x)+"px",r._clipNode.style.width=Math.abs(s)+"px",r._clipNode.style.height=Math.abs(f)+"px"),v.setAttribute("class",C+"-clipping");break;case"mouseup":null!==h.x&&null!==h.y&&h.dragStart&&(s=h.x,f=h.y,m=Math.abs(l.x-s),y=Math.abs(l.y-f),l.x<s&&(s=l.x),l.y<f&&(f=l.y),s={x:Math.round(s*(1/l.sx)),y:Math.round(f*(1/l.sy)),width:Math.round(m*(1/l.sx)),height:Math.round(y*(1/l.sy)),fileId:r.currentPage.getPageInfo().fileId,pageNo:r.currentPage.pageNo()},10<m&&10<y&&r.trigger("on.crop.end",s),r.data("eventData",null)),r.data("dragStart",!1),r._clipNode&&(r.currentPage.getPageNode().removeChild(r._clipNode),r._clipNode=null),r.changeControlType(P.ControlType.NONE),v.setAttribute("class",C+"-grab")}}}else if(n===P.ControlType.AUTOZOOMIN||n===P.ControlType.AUTOZOOMOUT)"click"===o||"touchstart"===o?(b=n===P.ControlType.AUTOZOOMIN?P.ZoomType.IN:P.ZoomType.OUT,x.zoom(b)):F(t,x);else if(x.selectedItem())("clip"===x._settings.renderType&&"svg"===p||"clip"===x._settings.renderType&&"canvas"===p)&&D(t,x),"svg"===p&&"svg"===x.data("prevEvtTarget")&&"mouseup"===o&&x.currentPage.unSelectedItem();else if(2===t.buttons||"mousedown"!==o||x.data("dragging")||S.uncontextmenu(),e=x.data("dragType")||2===t.buttons?x._settings.dragType.rightButton:x._settings.dragType.leftButton,n!==P.ControlType.SELECT)if(x._settings.dragType.leftButton!==P.DragType.ZOOM||M.toNotEmpty(x._settings.dragType.rightButton,P.DragType.NONE)!==P.DragType.NONE||2!==t.buttons||x._settings.zoomOptions.dblclickEnabled||(e=P.DragType.ZOOM),"mousemove"!==o||(b=i.getTopStackNode())&&(n="",b.style!==(n=e===P.DragType.ZOOM||e===P.DragType.SELECTIONAREA?"crosshair":n)&&(b.style.cursor=n)),e===P.DragType.MAGNIFICATION)B(t,x);else if(e===P.DragType.ZOOM||e===P.DragType.SELECTIONAREA)i.data("pasteItem")||F(t,x);else if("clip"===x._settings.renderType&&x._settings.draggable)D(t,x);else{var I=t,_=x,A=_.data("clipping"),b=I.type,n=_.getScale();if(_.currentPage,_._data.renderNodeType!==E.Type.RenderNodeType.IMAGE){var T={top:0,left:0,x:E.Element.getLayerX(I),y:E.Element.getLayerY(I),sx:n.x,sy:n.y};switch(b){case"mousedown":A||!function(t,e){var i=this.currentPage,n=this.data("controlData")||{};i._data.renderNodeType!==E.Type.RenderNodeType.IMAGE&&(O(this,this.currentPage.getImageRenderNode().getContext("2d")),i={x:e.x,y:e.y,sx:e.sx,sy:e.sy,rx:Math.round(e.x*(1/e.sx)),ry:Math.round(e.y*(1/e.sy)),width:0,height:0,rw:0,rh:0,direction:0,pageNo:this.currentPage.pageNo()},this.data("clipping",!0),this.data("controlData",n),this.data("clipData",i))}.apply(_,[I,T]);break;case"mouseup":A&&!function(t,e){var i=this.currentPage,n=i.getImageRenderNode(),o=i.getCanvasContext(),i=this.data("clipData"),a=this.data("controlData")||{},r=(n.style.cursor="default",i.x),s=i.y;i.width=Math.round(e.x-r),i.height=Math.round(e.y-s),e.x<r&&(i.x=e.x,i.width=r-e.x);e.y<s&&(i.y=e.y,i.height=s-e.y,i.direction=-1);i.rx=Math.round(i.x*(1/e.sx)),i.ry=Math.round(i.y*(1/e.sy)),i.rw=Math.round(i.width*(1/e.sx)),i.rh=Math.round(i.height*(1/e.sy));r=M.toInt(o.canvas.width),s=M.toInt(o.canvas.height);this.data("clipData",i),this.data("clipping",!1),0<i.rw&&0<i.rh&&this.trigger("on.clip.end",i);function l(t,e){return O(this,o),L.cropToImage(t,e)}2===t.button?(t=i.width*i.height/(r*s),t=i.direction<0?e.sx-t:e.sx+t,this.zoom(t)):10<i.rw&&10<i.rh&&this.controlType()===P.ControlType.COMPARE?(O(this,o),function(t,e){a.source?a.dest=e:a.source=e,a.source&&a.dest&&(e=l.call(this,t,a.source),t=l.call(this,t,a.dest),S.imageCompare(e,t),a={}),this.data("controlData",a)}.call(this,n,i)):O(this,o)}.apply(_,[I,T]);break;case"mousemove":A&&!function(t,e){var i=this.data("clipData"),n=this.currentPage.getImageRenderNode(),o=n.getContext("2d"),a=M.toInt(e.x-i.x),e=M.toInt(e.y-i.y),r=(O(this,o),i.x-M.toInt(n.style.left)),i=i.y-M.toInt(n.style.top);o.beginPath(),o.moveTo(r,i),o.lineTo(r+a,i),o.lineTo(r+a,i+e),o.lineTo(r,i+e),o.lineTo(r,i),o.stroke(),o.restore(),o.closePath(),n.style.cursor="crosshair",this.data("clipping",!0)}.apply(_,[I,T]);break;case"mouseleave":_.data("clipping",!1)}}}"mousedown"===o||"touchstart"===o?(x.data("prevEvt",o),x.data("prevEvtTarget",p),x.data("dragging")||x.data("dragType",e)):"mouseup"!==o&&"touchcancel"!==o||(x.data("prevEvtTarget",null),x.data("dragType",null),x.data("event.buttons",null))}},M.bind(t,"click mousemove mouseleave mouseup mousedown touchstart touchmove touchend touchcancel",i,!1)},t._initGolbalEvent=function(t){var o=0,a="",r=this;r._clipNode=null,r._clipLayerNode=null,s=function(t){var e,i=t.type,n=t.target,t=t.keyCode;"keydown"===i?(i=k.select(g.body,"."+C+"-ui-block"),e=k.select(g.body,"."+C+"-popup-layer"),r.getPage()&&(8!==t&&46!==t||/(SELECT|INPUT|TEXTAREA)/i.test(n.tagName)||null!==i||null!==e||(t=r.selectedItem())&&r.getPage().removeItem(t))):(null!=r._clipNode&&r.getPage()&&(r.getPage().getPageNode().removeChild(r._clipNode),r._clipNode=null),r.scrollMoved=!1,r.data("dragStart",!1))};this._settings.zoomOptions.dblclickEnabled&&M.bind(this._innerContentsNode,"mousedown",function(t){var e=t.target?t.target.tagName:"";if(/(SVG|DIV|CANVAS)/i.test(e)){var e=r.data("mousePosition"),i=t.pageX,n=t.pageY,e=Math.max(Math.abs(e.x-i),Math.abs(e.y-n));if(r.data("mousePosition",{x:i,y:n}),1<e)return a=0===t.button?"left":"right",void(o=t.timeStamp);0===t.button?(i=t,!("left"!==a||!o)&&i.timeStamp-o<300?(o=0,r.zoom(P.ZoomType.IN)):(o=i.timeStamp,a="left"),i.preventDefault()):(n=t,"right"===a&&n.timeStamp-o<300?(o=0,r.zoom(P.ZoomType.OUT)):(o=n.timeStamp,a="right"))}},!1),M.bind(d,"keydown mouseleave mouseup click touchend pointerup",s,!1)},t.translate=function(t,e){var i,n=this.currentPage;n.getPageNode(),this.data("containerWidth"),this.data("containerHeight"),this.data("contentWidth"),this.data("contentHeight");n&&(n=this._innerContentsNode.scrollTop,i=this._innerContentsNode.scrollLeft,this._innerContentsNode.scrollTop=n+e,this._innerContentsNode.scrollLeft=i+t)},t.scrollToAnnotation=function(t){var t=t.getBoundingClientRect(),e=this.currentPage.getPageNode(),i=0,n=0,o=0,a=0,r=this.currentPage._getRenderImage();this.enableScroll?(o=M.toInt(e.style.top)-t.top,a=M.toInt(e.style.left)-t.left,r&&(n=0===M.toInt(this.currentPage.data("angle")%180)?(o+=t.height,i=-(a/(r.rWidth/r.containerWidth)),-(o/(r.rHeight/r.containerHeight))):(i=-((a+=t.width)/(r.rHeight/r.containerWidth)),-(o/(r.rWidth/r.containerHeight))))):(i=this._innerContentsNode.scrollTop+t.top,n=this._innerContentsNode.scrollLeft+t.left),this.scrollTo(i,n)},t.unbindMagnificationHandler=function(t){var e=this.currentPage;e&&("mouse"==this._settings.magnifier.keepScope&&t||!t)&&(e.getImageRenderNode().style.cursor="default",e.setAnnotationVisible(this.annotationVisible),e.data("magnification.on",!1),this.onDrawing(),this.data("dragging",!1))},t.selectedItem=function(){var t=this.getPage();if(t)return t.selectedItem()},t.preventDefault=function(t){t=t||d.event;return t.preventDefault&&t.preventDefault(),t.returnValue=!1},t.isSupportedAnnotation=function(t){return M.hasOwn(P.AnnotationType,t.toUpperCase())},t.controlType=function(t,e,i){if(0===arguments.length)return this.data(n);(t=t.toLowerCase())===R?(this.setAnnotationType(e),this.unbindMagnificationHandler()):t===P.ControlType.MAGNIFICATION?t=P.ControlType.MAGNIFICATION:t===P.ControlType.COMPARE?(t=P.ControlType.COMPARE,this.unbindMagnificationHandler()):t===P.ControlType.SELECT?(this.isSelected(!0),this.unbindMagnificationHandler()):t===P.ControlType.CROP?(t=P.ControlType.CROP,this.unbindMagnificationHandler()):t===P.ControlType.AUTOZOOMIN||t===P.ControlType.AUTOZOOMOUT?this.unbindMagnificationHandler():(t===P.ControlType.ROTATE?this.rotate(i):t===P.ControlType.FILTER&&this.filter(e,i),t=P.ControlType.NONE,this.controlType()===P.ControlType.MAGNIFICATION&&this.unbindMagnificationHandler()),this.changeControlType(t)},t.setCenter=function(t,e){this.position.x=M.toFloat(t),this.position.y=M.toFloat(e)},t.getCenter=function(){return this.position},t.updatePageInfo=function(t){},t.unSelectedItem=function(){return this.currentPage&&this.currentPage.unSelectedItem(),this},t.securityLevel=function(t){return 1===arguments.length?(M.isNumeric(t)&&(this.setting("securityLevel",M.toInt(t)),this.unSelectedItem(),this.trigger("change.securityLevel",M.toInt(t))),this):this.setting("securityLevel")},t.clear=function(){for(var t=0;t<this.pageList.length;t++){var e=this.pageList[t];e&&e.remove()}this.currentPage=null,this.pageList=[],this._pageIndex=-1,this.pageCount=0,this.reset()},t.trigger=function(t,e,i){var n=this._settings.globalTransform.enabled,o="boolean"==typeof e.applyAll?e.applyAll:n&&this._settings.globalTransform.rotation;!i||(n||-1==t.indexOf("rotate")||o)&&(n||-1==t.indexOf("zoom")||this._settings.globalTransform.zoom&&n)?this._events.trigger(t,e):this._events.trigger(t+".page"+i.pageIndex(),e)},t.displayImageArea=function(t,e){var i,n,o,a,r;null!=this.currentPage&&(e="boolean"!=typeof e||e,this._displayLayerNode=k.select(this.currentPage.getPageNode(),"."+C+"-display-imagearea-layer"),null===this._displayLayerNode&&(this._displayLayerNode=k.createElement("div",{class:C+"-display-imagearea-layer"},this.currentPage.getPageNode())),i=k.createElement("div",{class:C+"-display-imagearea-layer-item"},this._displayLayerNode),t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.width=Math.max(t.width,0),t.height=Math.max(t.height,0),a=(r=this.getScale()).x,r=r.y,t.zoom?(M.isNumeric(t.zoom)||(t.zoom=1),o=t.zoom<this._settings.minZoom?this._settings.minZoom:t.zoom>this._settings.maxZoom?this._settings.maxZoom:t.zoom,this.zoom(o),r=a=o):(n=this.currentPage.getTransformInfo())&&(k.transform(this._displayLayerNode,n),k.prop(this._displayLayerNode.style,{width:n.width+"px",height:n.height+"px"})),k.attr(i,{"data-x":t.x,"data-y":t.y,"data-width":t.width,"data-height":t.height,"data-scale":o,"data-scale-x":a,"data-scale-y":r,"data-original-image-size":e}),e&&(t.x=a*t.x,t.y=r*t.y,t.width=a*t.width,t.height=r*t.height),n=t.x+t.width/2,o=t.y+t.height/2,this.currentPage.getPageNode(),k.prop(i.style,{top:t.y+"px",left:t.x+"px",width:t.width+"px",height:t.height+"px"}),M.isNumeric(t.border)&&k.prop(i.style,{borderWidth:t.border+"px"}),n=t.x+t.width/2,o=t.y+t.height/2,e=this.currentPage._getRenderImage(),a=-(o-M.toInt(e.containerHeight)/2),r=-(n-M.toInt(e.containerWidth)/2),scrollY=0===M.toInt(this.currentPage.data("angle")%180)?(scrollX=-(r/(e.rWidth/e.containerWidth)),-(a/(e.rHeight/e.containerHeight))):(scrollX=-(r/(e.rHeight/e.containerWidth)),-(a/(e.rWidth/e.containerHeight))),this.scrollTo(scrollX,scrollY))},t.clearDisplayImageArea=function(){this.currentPage&&this.currentPage.getPageNode()&&(this._displayLayerNode=k.select(this.currentPage.getPageNode(),"."+C+"-display-imagearea-layer"),this._displayLayerNode&&this.currentPage.getPageNode().removeChild(this._displayLayerNode))},t._displayImageAreaRender=function(){if(this._displayLayerNode){var t=this.currentPage.getTransformInfo(),e=(t&&(k.transform(this._displayLayerNode,t),k.prop(this._displayLayerNode.style,{width:t.width+"px",height:t.height+"px"})),k.selectAll(this.currentPage.getPageNode(),"."+C+"-display-imagearea-layer-item")||[]),i=this.getScale();if(e){var n=0;for(length=e.length,n=0;n<length;n++){var o=e[n],a=M.toInt(k.attr(o,"data-x")),r=M.toInt(k.attr(o,"data-y")),s=M.toFloat(k.attr(o,"data-scale-x"),2),c=M.toFloat(k.attr(o,"data-scale-y"),2),l=M.toInt(k.attr(o,"data-width")),h=M.toInt(k.attr(o,"data-height")),h="true"==k.attr(o,"data-original-image-size")?(a=i.x*a,r=i.y*r,l=i.x*l,i.y*h):(a=i.x/s*a,r=i.y/c*r,l=i.x/s*l,i.y/c*h);k.prop(o.style,{top:r+"px",left:a+"px",width:l+"px",height:h+"px"})}}}return this},t.initZoom=function(){return 1==arguments.length?(this._initZoom=arguments[0],this):this._initZoom},E.Viewer=e,E.Viewer.prototype.constructor=e.prototype,E.Viewer}),InziSForm.create(function(n,t,e){"use strict";function i(){}var o=n.Type,a=n.Element,r=n.Utils;i.createLayer=function(t,e){var i=t.type,n=t.container;return o.LayerType.THUMBNAIL===i?this._createThumbnail(n,t.config,e):o.LayerType.VIEWER===i?this._createViewer(n):o.LayerType.TOOLBAR===i?this._createToolbar(n):o.LayerType.DOC_THUMBNAIL===i?this._createDocThumbnail(n,t.config):o.LayerType.DOC_VIEWER===i?this._createViewer(n):void 0},i._createThumbnail=function(t,e,i){t=a.createElement("div",{class:"sform-thumbnail"},t),t=r.extend({container:t},e,!0);return new n.ThumbnailLayer(t,i)},i._createDocThumbnail=function(t,e){t=a.createElement("div",{class:"sform-thumbnail"},t),t=r.extend({container:t},e,!0);return new n.DocThumbnailLayer(t)},i._createViewer=function(t){},i._createToolbar=function(t){},n.LayerFactory=i,n.LayerFactory.prototype.constructor=i.prototype}),InziSForm.create(function(o,d,e){"use strict";o.moduleName;function t(t,e){var i={width:150,height:150,itemSize:"fixed",itemWidth:100,itemHeight:140,container:null,wrapper:null,resizable:!0,initLoadItemCount:0,paginateUnit:o.Type.PaginateUnit.FILE,labelType:o.Type.ThumbnailLabelType.DEFAULT,controlPosition:o.Type.CONTROL_POSITION_TYPE.LEFT,async:!1,immediate:!1,multiselect:!1,autoPageMove:!1,keepMultiselect:!1,listenerId:null,bookmarkAutoEnabled:!0,pageDeletable:!1,contextMenuEnable:!0,serviceStreamingType:""};return this._settings=f.extend(i,t),this._containerNode=null,this._containerWrapper=null,this._wrapper=this._settings.wrapper,this._serviceManager=e,this._items=[],this._filterItems=[],this._renderItems=[],this._thumbJobList=[],this._renderItemQueue=[],this._visible=!0,this._thumbnailNode=null,this._activeItem=null,this._selectedItemMap={},this._deletedItemCountMap={},this._width=0,this._height=0,this._status=0,this._labelRowCount=0,this._pageMapping={},this._selectedBeginPageNo=null,this._prevKeyType=null,this._overflow={x:!1,y:!1},this._events=new o.Events,o.listeners(this._events.listenerId(),this._events),this.disabledUnselectItem=!1,this._init(),this}var g=o.moduleClassName,u=o.Element,f=o.Utils,m=o.UI,s=o.DateUtils,r=o.Type,a=d.URL||d.webkitURL,i=(r.RESOURCE.ICON.BOOKMARK,o.inherit(t,o.EventHandler),t.prototype);function c(t){t=t.getBoundingClientRect();return{left:t.left+e.body.scrollLeft,top:t.top+e.body.scrollTop}}return i._init=function(){var t=this,e=(t._settings.container?t._containerNode=u.getElementNode(this._settings.container):t._containerNode=t._wrapper.appendToElement("div",{class:g+"-thumbnail"}),t._containerWrapper=new o.DOMWrapper(this._containerNode),t._setControlStyle(),t._thumbnailNode=this._containerWrapper.appendToElement("div",{class:"thumb-section"}),t._thumbnailListNode=u.createElement("ul",null,this._thumbnailNode),t._filterListNode=u.createElement("ul",null,this._thumbnailNode),t._filterListNode.style.display="none",this._containerWrapper.offset());t._width=e.width,t._height=e.height,t._containerHeight=this._containerNode.offsetHeight,t._containerWidth=this._containerNode.offsetWidth,t._setThumbItemSize(),this._initEvent(),this.hasItem()&&this.renderItem(this._items)},i._setControlStyle=function(){var t=r.CONTROL_POSITION_STYLE[this._settings.controlPosition];this._containerWrapper.attr("class",g+"-thumbnail"),this._containerWrapper.addClass(g+"-thumbnail-"+t.direction),this._containerWrapper.addClass(g+"-thumbnail-"+t.direction+"-"+t.class),"vertical"===t.direction?(this._containerNode.style.width=this._settings.width+"px",this._containerNode.style.height="100%",this._settings.controlPosition===r.CONTROL_POSITION_TYPE.RIGHT?(this._containerNode.style.right="0px",this._containerNode.style.left=""):this._settings.controlPosition===r.CONTROL_POSITION_TYPE.LEFT&&(this._containerNode.style.left="0px",this._containerNode.style.right="")):(this._containerNode.style.width="100%",this._containerNode.style.height=this._settings.height+"px",this._containerNode.style.left="0px",this._settings.controlPosition===r.CONTROL_POSITION_TYPE.TOP?(this._containerNode.style.top="0px",this._containerNode.style.bottom=""):this._settings.controlPosition===r.CONTROL_POSITION_TYPE.BOTTOM&&(this._containerNode.style.top="",this._containerNode.style.bottom="0px")),this._containerHeight=this._containerNode.offsetHeight,this._containerWidth=this._containerNode.offsetWidth},i._initEvent=function(){function e(){h._scrollStatus=0,h._displayThumbItem(!1),h._settings.autoPageMove&&h._triggerMovePage(),clearTimeout(n),n=null}var i,n,l,h=this,c=(h.posX=0,h.posY=0,h._scrollStatus=0,this._settings.immediate,f.bind(this._containerNode,"mousewheel wheel",function(t){t.stopPropagation()},{passive:!1}),f.bind(this._containerNode,"DOMMouseScroll scroll",function(t){0<(i=h._settings.immediate?0:700)?(h._scrollStatus=1,h.posY!==h._containerNode.scrollTop&&(h.posY=h._containerNode.scrollTop),clearTimeout(n),n=setTimeout(e,i)):(clearTimeout(scrollTimeout),h._displayThumbItem(!1))}),!1),p=0;f.bind(this._containerNode,"click mousedown contextmenu",function(t){var e=t.target,e=u.parent(e,"."+g+"-ui-thumb-item");if(e){if(e=f.toNotEmpty(e.getAttribute("data-item-index"),-1),e=h._items[e]){var i,n,o=!1;if("mousedown"===t.type)t.ctrlKey||t.shiftKey||(2==t.button&&(h._settings.pageDeletable&&(e===h.activeItem()||h._selectedItemMap[e.pageNo])?(h._settings.contextMenuEnable&&m.contextmenuThumbnail(h,e,t.pageX,t.pageY),0==(n=h._getSelectItems()).length&&n.push(e),h.trigger("trigger.right.click.thumbnail",n)):h.trigger("trigger.right.click.thumbnail",e)),h._events.hasEvent("mousedown.thumbnail")&&h.trigger("mousedown.thumbnail",{itemId:e.fileId,itemPageNo:e.itemPageNo,itemPageCount:e.itemPageCount,pageNo:e.newPageNo!=e.pageNo?e.newPageNo:e.pageNo,type:"mousedown",event:t}));else if("contextmenu"===t.type)h.trigger("contextmenu.thumbnail",{itemId:e.fileId,itemPageNo:e.itemPageNo,itemPageCount:e.itemPageCount,pageNo:e.newPageNo!=e.pageNo?e.newPageNo:e.pageNo,type:"contextmenu",event:t});else{if(n=h._events.hasEvent("click.thumbnail"),i=h._events.hasEvent("dblclick.thumbnail"),l="",(t.ctrlKey||t.shiftKey)&&h._settings.multiselect){if(0===e.pageNo)return;t.ctrlKey?a="ctrlKey":t.shiftKey&&(a="shiftKey");var a,r=h.activeItem(),s=h._selectedBeginPageNo;null==h._selectedBeginPageNo&&null!=r&&(h._selectedBeginPageNo=r.pageNo,s=r.newPageNo,r!=e&&h._selectItem(r)),null==h._selectedBeginPageNo||t.ctrlKey?h._selectItem(e):h._selectMultipleItem(e,s,e.newPageNo),o=!0,h._prevKeyType=a}else h.activeItem(e),c=0===t.button&&p&&t.timeStamp-p<300||(p=t.timeStamp,!1);i&&c?l="dblclick.thumbnail":n?l="click.thumbnail":!i&&c?l="trigger.dblclick.thumbnail":n||(l="trigger.click.thumbnail"),""!==l&&h.trigger(l,{itemId:e.fileId,itemPageNo:e.itemPageNo,itemPageCount:e.itemPageCount,pageNo:e.newPageNo!=e.pageNo?e.newPageNo:e.pageNo,type:o?"multiselect":""})}}}else h._settings.multiselect&&(t.ctrlKey||t.shiftKey||h.unselectItems())}),this._settings.multiselect&&(this._settings.keepMultiselect||f.bind(d,"click",function(t){t=t.target;u.parents(t,"."+g+"-thumbnail")||h.unselectItems()}))},i._triggerMovePage=function(){var t="filter"===this.layerType?this._filterItems:this._items,t=(t=t||[])[this._getFirstDisplayIndex()];t&&this.trigger("trigger.click.thumbnail",t)},i._getFirstDisplayIndex=function(){var t,e,i=0;return this.posTop=this._containerNode.scrollTop,this.posLeft=this._containerNode.scrollLeft,this.posBottom=this._containerNode.scrollTop+this._containerNode.offsetHeight,"filter"===this.layerType?(e=this._filterListNode,this._filterItems):(e=this._thumbnailListNode,this._items),e&&e.firstChild&&(t=e.firstChild.offsetHeight,e=e.firstChild.offsetWidth,i="vertical"===r.CONTROL_POSITION_STYLE[this._settings.controlPosition].direction?Math.max(parseInt(this.posTop/t),0):Math.max(parseInt(this.posLeft/e),0)),i},i._displayThumbItem=function(t,e){var i;this._scrollStatus&&!t||(t="filter"===this.layerType?(i=this._filterListNode,this._filterItems):(i=this._thumbnailListNode,this._items),e?this._resizeThumbItem(t):(e=r.CONTROL_POSITION_STYLE[this._settings.controlPosition],i.firstChild&&("vertical"===e.direction?this._verticalThumbItem(i,t):this._horizontalThumbItem(i,t))))},i._setThumbItemSize=function(){var t,e,i;return"auto"===this.setting("itemSize")&&(i=e=t=0,i="vertical"===r.CONTROL_POSITION_STYLE[this._settings.controlPosition].direction?(t=Math.min(this.width(),this._containerWidth)-(this._overflow.y?30:0)-16,e=parseInt(t)-(this._overflow.x?30:0),parseInt(1.5*e)):(t=Math.min(this.height(),this._containerHeight)-17*this._labelRowCount-(this._overflow.x?30:0)-16,e=parseInt(.7*t),parseInt(t)-(this._overflow.x&&this._overflow.y?30:0)),this._settings.itemWidth=e,this._settings.itemHeight=i),this},i._resizeThumbItem=function(t){this.width(),this.height();for(var e in this._setThumbItemSize(),t){var i,n,o,e=t[e],a=e.node;a&&(a.style.width=this._settings.itemWidth+8+"px",(i=u.select(a,".thumb-box"))&&(i.style.width=this._settings.itemWidth+8+"px",i.style.height=this._settings.itemHeight+8+"px"),"auto"===this.setting("itemSize")&&(a=u.select(a,"img"),e.width=this._settings.itemWidth,e.height=this._settings.itemHeight,u.hasClass(i,g+"-thumbnail-load")&&(e=parseInt(a.getAttribute("data-item-width"))||this._settings.itemWidth,i=parseInt(a.getAttribute("data-item-height"))||this._settings.itemHeight,o=this._settings.itemWidth/e,n=this._settings.itemHeight/i,o=Math.min(o,n),a.width=o*e,a.height=o*i,this._settings.itemHeight>o*i?a.style.marginTop=(this._settings.itemHeight-o*i)/2+"px":a.style.marginTop="")))}},i._verticalThumbItem=function(t,e){this.posTop=this._containerNode.scrollTop,this.posBottom=this._containerNode.scrollTop+this._containerNode.offsetHeight;var i,n=c(this._containerNode),o=t.firstChild.offsetHeight,t=Math.max(parseInt(this.posTop/o),0),a=parseInt(this.posBottom/o)+2,r=e.length;0===t&&(i="all"===this._settings.initLoadItemCount?r:f.isNumeric(this._settings.initLoadItemCount)?this._settings.initLoadItemCount:0,a=Math.max(a,t+i)),a=r<a?r:a;for(var s=0;s<r;s++){var l=e[s];if(l.node&&!l.loadedThumbnail){var h=c(l.node).top-n.top;if(-o<h&&h<=this._containerNode.offsetHeight+o||this._settings.immediate&&s<a)this._loadRealImage(l);else if(this.posBottom<h)break}}},i._horizontalThumbItem=function(t,e){this.posLeft=this._containerNode.scrollLeft,this.posRight=this.posLeft+this._containerNode.offsetWidth;var i=c(this._containerNode),t=t.firstChild.offsetWidth,n=Math.max(parseInt(this.posLeft/t),0),o=parseInt(this.posRight/t)+2,a=e.length;0===n&&(t="all"===this._settings.initLoadItemCount?a:f.isNumeric(this._settings.initLoadItemCount)?this._settings.initLoadItemCount:0,o=Math.max(o,n+t)),o=a<o?a:o;for(var r=0;r<a;r++){var s=e[r];if(!s.loadedThumbnail&&s.node){var l=c(s.node),l=0<=d.scrollX?Math.max(l.left,0):l.left;if(l-=Math.max(i.left,0),this.posLeft<=l+this.posLeft&&l+this.posLeft<=this.posRight||this._settings.immediate&&r<o)this._loadRealImage(s);else if(this.posRight<l)break}}},i.hasItem=function(){return 0<this._items.length},i._autoThumbnailResize=function(t){var e,i,n;"auto"===this.setting("itemSize")&&(i=e=!1,this._containerNode.offsetWidth<this._containerNode.scrollWidth&&(e=!0),this._containerNode.offsetHeight<this._containerNode.scrollHeight&&(i=!0),n=r.CONTROL_POSITION_STYLE[this._settings.controlPosition],(this._overflow.x!==e||this._overflow.y!==i||"horizontal"===n.direction&&i||t)&&(this._overflow.x=e,this._overflow.y=i,this._resizeThumbItem(this._items)))},i._appendResizeContainer=function(){this._thumbnailResizeBar=this._containerWrapper.appendToElement("div",{class:"resizable-e resizable-bar",draggable:"false",ondragstart:"return false;"}),u.prop(this._thumbnailResizeBar.style,{position:"absolute",right:"0",width:"7px",height:"100%",zIndex:999999})},i.refresh=function(t){this._displayThumbItem(!1,t),this._autoThumbnailResize()},i.renderItem=function(t){for(var e=[],i=0,n=(e=Array.isArray(t)?t:[t]).length,o=Math.max(this._items.length-1,0);i<n;i++)this._createItem(e[i],o+i);this._displayThumbItem()},i._makeSortable=function(){var e=this;new Sortable(e._thumbnailListNode,{animation:150,onStart:function(t){e.trigger("thumbnail.item.move.start",t)},onEnd:function(t){e.trigger("thumbnail.item.move.complete",t)}})},i.addItem=function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)t[e].newPageNo=t[e].pageNo;this._items.concat(t)}else t.newPageNo=t.pageNo,this._items.push(t);Array.isArray(t)?this._renderItemQueue.concat(t):this._renderItemQueue.push(t)},i.addItemAndRender=function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)t[e].newPageNo=t[e].pageNo;this._items.concat(t)}else t.newPageNo=t.pageNo,this._items.push(t);this.renderItem(t),this.trigger("thumbnail.item.render.complete",t)},i.render=function(){for(var t=0,e=this._renderItemQueue.length,i="";t<e;t++)i+=this._createItemToHTML(this._renderItemQueue[t],t);this._thumbnailListNode.insertAdjacentHTML("beforeend",i),this._setThumbnailItemNode(),this._displayThumbItem(),this._renderItemQueue=[],this.activeItem()||this.activeItem(this._renderItems[0])},i._setThumbnailItemNode=function(){for(var t,e,i=u.selectAll(this._thumbnailListNode,"[data-item-index]")||[],n=0,o=i.length,n=0;n<o;n++)t=i[n],e=f.toNotEmpty(t.getAttribute("data-item-index"),0),(e=this._items[e])&&(e.node||(e.node=t,this.trigger("thumbnail.item.render.complete",e),this.trigger("thumbnail.itemnode.rendering",e)))},i._createItem=function(t,e){var i=u.createElement("li",{class:g+"-ui-thumb-item","data-thumb-id":t.fileId+"_"+t.pageNo,title:t.name||"페이지 ("+t.pageNo+")","data-item-index":e},this._thumbnailListNode),e=(t.node=i,this._renderItems.length),e=(this._renderItems.push(t),this._pageMapping[t.pageNo]=e,1===this._renderItems.length&&this.activeItem(this._renderItems[0]),this._createThumbWrapNode(t));i.appendChild(e),this._settings.labelType!==o.Type.ThumbnailLabelType.NONE&&i.appendChild(this._createLabelNode(t)),(i.style.width="auto")!==this.setting("itemSize")&&(i.style.maxWidth="95%"),this._selectedItemMap[t.pageNo]&&(u.hasClass(t.node,"multiple-select")||u.addClass(t.node,"multiple-select")),this.trigger("thumbnail.itemnode.rendering",t),this.refresh()},i._createThumbWrapNode=function(t){var e,i,n=u.createElement("span",{class:"thumb-box"});return 0<t.itemPageCount?(e=u.createElement("img",{src:r.UI.LOADING_BAR.THUMBNAIL},n),u.addClass(e,g+"-ui-loader")):(u.addClass(n,g+"-thumbnail-doc"),e=u.createElement("span",{class:g+"-type-"+t.type+"-bg"},n),i="",f.isNotEmpty(t.type)?i=t.type.toUpperCase():t.name&&(i=t.name),e.innerHTML=i),n.style.width=this._settings.itemWidth+8+"px",n.style.height=this._settings.itemHeight+8+"px",n},i._createLabelNode=function(t){var e=u.createElement("span",{class:"label"}),i="",n=0;return this._settings.labelType!==o.Type.ThumbnailLabelType.PAGE&&t.name&&(i="<span class='thumb-name'>"+t.name+"</span>",n+=1),this._settings.labelType===o.Type.ThumbnailLabelType.ALL&&(t.createTime||t.empId)&&(i+="<span class='thumb-desc'>",t.empId&&(i+="<span>"+t.empId+"</span>",n+=1),t.createTime&&(f.isNumeric(t.createTime)?i+="<span>"+o.Utils.dateFormat(new Date(t.createTime),"yyyy-MM-dd HH:mm")+"</span>":i+="<span>"+t.createTime+"</span>",n+=1),t.additionalInfo&&(i+="<span>"+t.additionalInfo+"</span>",n+=1),i+="</span>"),0<t.itemPageCount&&(this._settings.paginateUnit===o.Type.PaginateUnit.FILE?(i+="<span class='thumb-page'>("+t.itemPageNo+"/"+t.itemPageCount+")</span>",n+=1):this._settings.paginateUnit!==o.Type.PaginateUnit.NONE&&(i+="<span class='thumb-page'><&nbsp;"+t.pageNo+"&nbsp;></span>",n+=1)),e.innerHTML=i,this._labelRowCount=Math.max(n,this._labelRowCount),e},i._createItemToHTML=function(t,e){var i="",n="<li",i=g+"-ui-thumb-item",e=(this._selectedItemMap[t.pageNo]&&(i+=" multiple-select"),n=(n=n+(' class="'+i+'"')+(' data-thumb-id="'+t.fileId+"_"+t.pageNo+'"'))+(' data-item-index="'+e+'"')+' style="width:auto;',"auto"!==this.setting("itemSize")&&(n+="max-width:95%;"),n=(n=n+'"'+(" title='페이지 ("+t.pageNo+")'>"))+this._createThumbWrapNodeToHTML(t),this._settings.labelType!==o.Type.ThumbnailLabelType.NONE&&(n+=this._createLabelNodeToHTML(t)),t.bookmark&&(n+='<span class="bookmark"></span>'),n+="</li>",this._renderItems.length);return this._renderItems.push(t),this._pageMapping[t.pageNo]=e,n},i._createThumbWrapNodeToHTML=function(t){var e=this._settings.itemWidth+8,i=this._settings.itemHeight+8,e='<span class="thumb-box'+(0<t.itemPageCount?"":" "+g+"-thumbnail-doc")+'" style="width:'+e+"px; height:"+i+'px">';return 0<t.itemPageCount?e+='<img class="'+g+'-ui-loader" src="'+r.UI.LOADING_BAR.THUMBNAIL+'" />':(e+='<span class="'+g+"-type-"+t.type+'-bg">',i="",f.isNotEmpty(t.type)?i=t.type.toUpperCase():t.name&&(i=t.name),e=e+i+"</span>"),e+="</span>"},i._createLabelNodeToHTML=function(t){var e='<span class="label">',i="",n=0;return this._settings.labelType!==o.Type.ThumbnailLabelType.PAGE&&t.name&&(i="<span class='thumb-name'>"+t.name+"</span>",n+=1),this._settings.labelType===o.Type.ThumbnailLabelType.ALL&&(t.createTime||t.empId)&&(i+="<span class='thumb-desc'>",t.empId&&(i+="<span>"+t.empId+"</span>",n+=1),t.createTime&&(f.isNumeric(t.createTime)?i+="<span>"+o.Utils.dateFormat(new Date(t.createTime),"yyyy-MM-dd HH:mm")+"</span>":i+="<span>"+t.createTime+"</span>",n+=1),t.additionalInfo&&(i+="<span>"+t.additionalInfo+"</span>",n+=1),i+="</span>"),0<t.itemPageCount&&(this._settings.paginateUnit===o.Type.PaginateUnit.FILE?(i+="<span class='thumb-page'>("+t.itemPageNo+"/"+t.itemPageCount+")</span>",n+=1):this._settings.paginateUnit!==o.Type.PaginateUnit.NONE&&(i+="<span class='thumb-page'><&nbsp;"+t.pageNo+"&nbsp;></span>",n+=1)),e=e+i+"</span>",this._labelRowCount=Math.max(n,this._labelRowCount),e},i._loadRealImage=function(t){t.loadedThumbnail||0===t.itemPageCount?t.loadedThumbnail=!0:(t.width=t.width||this._settings.itemWidth,t.height=t.height||this._settings.itemHeight,this._onloadImage(t))},i.reloadThumbnailByPageNo=function(t){t=this._getItemByPageNo(t);t&&0!=t.itemPageCount&&this._isLoadedThumbnail(t)&&t&&t.node&&this._onloadImage(t,null,!0)},i._isLoadedThumbnail=function(t){return!!t.loadedThumbnail},i._onloadImage=function(i,t,e){var n=0,o=0,a=i.node,r=u.select(a,".thumb-box");i&&r&&(i.loadedThumbnail=!0,(a=e?u.select(r,"img"):u.select(r,"."+g+"-ui-loader"))&&(t=t||i.url+(-1===i.url.indexOf("?")?"?":"&")+"t="+s.now(),a.src=t,a.onload=function(){n=this.naturalWidth,o=this.naturalHeight,n=0===n?i.width:n,o=0===o?i.height:o;var t=i.width/n,e=i.height/o,t=Math.min(t,e);this.width=t*n,this.height=t*o,i.height>t*o?this.style.marginTop=(i.height-t*o)/2+"px":this.style.marginTop="",this.setAttribute("data-item-width",this.naturalWidth),this.setAttribute("data-item-height",this.naturalHeight),u.removeClass(this,g+"-ui-loader"),u.addClass(r,g+"-thumbnail-load"),0!==i.rotate&&self.rotate(i),i.loadedThumbnail=!0,this.onload=null,this.onerror=null},a.onerror=function(){var t=f.toNotEmpty(this.getAttribute("retry-count"),0);t<3?(this.src=this.src,this.setAttribute("retry-count",t+1),i.loadedThumbnail=!1):i.loadedThumbnail=!0},this.trigger("thumbnail.item.loaded",i)))},i.activeItem=function(t){if(0===arguments.length)return this._activeItem;var e,i;this._activeItem&&this._activeItem.node&&u.removeClass(this._activeItem.node,"selected"),(this._activeItem=t)&&(i=this._containerNode.scrollTop,((e=this._activeItem.node.offsetTop)<i||e>i+this._containerHeight)&&(this._containerNode.scrollTop=this._activeItem.node.offsetTop),e=this._containerNode.scrollLeft,((i=this._activeItem.node.offsetLeft)<e||i>e+this._containerWidth)&&(this._containerNode.scrollLeft=this._activeItem.node.offsetLeft),this._displayThumbItem(!0),u.addClass(t.node,"selected"))},i._selectMultipleItem=function(t,e,i){var n,o=Math.min(e,i);i=Math.max(e,i),this.unselectItems(!0),this._selectedBeginPageNo=e;for(var a=o;a<=i;a++)(n=this._getItemByNewPageNo(a))&&n.node&&this._selectItem(n)},i._selectItem=function(t,e){t&&(this._selectedItemMap[t.pageNo]&&!e?delete this._selectedItemMap[t.pageNo]:this._selectedItemMap[t.pageNo]=t,t.node&&(this._selectedItemMap[t.pageNo]?u.hasClass(t.node,"multiple-select")||u.addClass(t.node,"multiple-select"):u.removeClass(t.node,"multiple-select")))},i.selectItem=function(t,e){if(0===arguments.length)return this._getSelectItems();for(var i=[],n=0,o=0,n=0,o=(t="string"==typeof t?[t]:t).length;n<o;n++)i=i.concat(this.findByItemId(t[n]));for(n=0,o=i.length;n<o;n++)this._selectItem(i[n]);return this},i.selectAllItems=function(){for(var t,e=0,i=this._items.length,e=0;e<i;e++)(t=this._items[e])&&this._selectItem(t,!0);return this},i._getSelectItems=function(){var t,e,i=[];for(e in this._selectedItemMap)t={fileId:this._selectedItemMap[e].fileId,pageNo:this._selectedItemMap[e].pageNo,newPageNo:this._selectedItemMap[e].newPageNo,itemPageNo:this._selectedItemMap[e].itemPageNo,newItemPageNo:this._selectedItemMap[e].newItemPageNo,itemPageCount:this._selectedItemMap[e].itemPageCount,newItemPageCount:this._selectedItemMap[e].newItemPageCount,node:this._selectedItemMap[e].node},i.push(t);return t=null,i},i._unselectItems=function(){var t,e;for(e in this._selectedItemMap)(t=this._selectedItemMap[e])&&t.node&&u.removeClass(t.node,"multiple-select"),delete this._selectedItemMap[e];this._selectedBeginPageNo=null},i.unselectItems=function(t){if(this.disabledUnselectItem&&!t)return this;var e,i;for(i in this._selectedItemMap)(e=this._selectedItemMap[i])&&e.node&&u.removeClass(e.node,"multiple-select"),delete this._selectedItemMap[i];return this._selectedBeginPageNo=null,this},i.getRenderItem=function(t){if(1!==arguments.length)return this._renderItems;t=this._pageMapping[t];return 0<=(t="number"==typeof t?t:-1)?this._renderItems[t]:void 0},i._removeItem=function(t){var e=t["event-id"]||[],i=0,n=e.length;if(0<n)for(i=0;i<n;i++)this.off(e[i],t.node);try{u.remove(t.node,this._thumbnailListNode)}catch(t){console.log("Failed to remove child node.",t)}},i._removeSelectItem=function(){if(this._settings.pageDeletable){var t=this._getSelectItems(),e=0,i=t.length;for(0==i&&(t.push(this._activeItem),i=1),e=0;e<i;e++){var n=t[e];if(this._deletedItemCountMap[n.fileId]?this._deletedItemCountMap[n.fileId]++:this._deletedItemCountMap[n.fileId]=1,(n.newItemPageCount||n.itemPageCount)<=this._deletedItemCountMap[n.fileId])return this._deletedItemCountMap={},void m.alert("삭제를 실패하였습니다. 파일에는 적어도 하나의 페이지는 남아있어야 합니다.")}for(e=0;e<i;e++)this._removeItem(t[e]);return this.unselectItems(),this.trigger("thumbnail.item.delete",t),this.refresh(),t}},i._removeAllItem=function(){for(var t,e=0,i=this._items.length,e=0;e<i;e++)t=this._items[e],this._removeItem(t)},i.removeByItemId=function(t){for(var e,i=0,n=this._items,o=n.length,i=0;i<o;i++)(e=n[i])&&(e.fileId===t?this._removeItem(e):this._items.push(e));return this},i.changeLayerType=function(t){"filter"===(this.layerType=t)?(this._thumbnailListNode.style.display="none",this._filterListNode.style.display="block"):(this._thumbnailListNode.style.display="block",this._filterListNode.style.display="none")},i._emptyFilterListNode=function(){this._filterListNode&&(this._filterListNode.innerHTML="")},i.show=function(t){t?this._displayItem(t,!0):this._visible||this._displayControl(!0)},i.hide=function(t){t?this._displayItem(t,!1):this._visible&&this._displayControl(!1)},i._displayItem=function(t,e){for(var i=0,n=this._items.length,i=0;i<n;i++){var o=this._items[i];o.fileId===t&&(o.node.style.display=e?"inline-block":"none")}},i._displayControl=function(t){this._containerNode.style.display=t?"block":"none",this._visible=t},i.setting=function(t,e){return 1===arguments.length&&"object"==typeof t?(this._settings=f.extend(this._settings,t),this):1<arguments.length?(this._settings[t]=e,this):1===arguments.length&&"string"==typeof t?this._settings[t]:void 0},i.width=function(t){if(!(0<arguments.length))return f.isNumeric(this._width)||(this._width=this._containerNode.clientWidth,this.setting("width",this._width)),"number"!=typeof this._width&&(this._width=parseInt(this._width)),this._width;f.isNumeric(this._width)&&(this._width=t,this.setting("width",this._width))},i.height=function(t){if(!(0<arguments.length))return f.isNumeric(this._height)||(this._height=this._containerNode.clientHeight,this.setting("height",this._height)),"number"!=typeof this._height&&(this._height=parseInt(this._height)),this._height;f.isNumeric(this._height)&&(this._height=t,this.setting("height",this._height))},i.resize=function(t,e,i,n){var o,a=!1;return 0===t&&0===e?this.hide():(this.show(),i="boolean"!=typeof i||i,o=r.CONTROL_POSITION_STYLE[this._settings.controlPosition]||r.CONTROL_POSITION_STYLE[r.CONTROL_POSITION_TYPE.LEFT],void 0!==t&&(this.width()!==t&&"vertical"===o.direction&&i&&(a=!0,this.width(t)),this._containerNode.style.width=t+"px"),e&&(this.height()!==e&&"horizontal"===o.direction&&i&&(a=!0,this.height(e)),this._containerNode.style.height=e+"px"),this._containerHeight=this._containerNode.offsetHeight,this._containerWidth=this._containerNode.offsetWidth,this.refresh(a)),this},i.clear=function(){if(null!==this._containerNode&&null!==this._containerWrapper){try{null!==this._thumbnailNode&&(this._removeAllItem(),this._thumbnailNode.removeChild(this._thumbnailListNode),this._thumbnailListNode=u.createElement("ul",null,this._thumbnailNode))}catch(t){}this._items=[],this._renderItems=[],this._thumbJobList=[],this._filterItems=[],this._renderItemQueue=[],this._pageMapping={},this._overflow={x:!1,y:!1}}},i.onRenderThumbnail=function(){var t=this._thumbJobInfo.fileItem,e=t.getPageInfo();this._thumbJobInfo.pageNo>e.pageCount||this._thumbJobInfo.running||(this._thumbJobInfo.running=!0,e={fileId:t.getItemId(),pageNo:this._thumbJobInfo.pageNo,newPageNo:this._thumbJobInfo.pageNo,name:t.getName()},d.Uint8Array?this._requestPageThumbnailByBody(e):this._requestPageThumbnailByURI(e))},i._requestPageThumbnailByBody=function(t){var e,i=this,n=i._thumbJobInfo.fileItem;this._serviceManager?this._serviceManager.requestPageThumbnail(t,function(t){t=new Uint8Array(t),t=new Blob([t],{type:"image/jpeg"}),t=a.createObjectURL(t),n=i._thumbJobInfo.fileItem,e=i._pageCount++,t={fileId:n.getItemId(),url:t,name:n.getName(),pageNo:e,newPageNo:e,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo,imageSize:this._settings.itemWidth+","+this._settings.itemHeight};1===i._thumbJobInfo.pageNo&&n.setPageInfo({pageNo:e}),i._afterRenderThumbnail(t)},function(){}):(e=i._pageCount++,i._afterRenderThumbnail({fileId:n.getItemId(),url:n.getItemId(),name:n.getName(),pageNo:e,newPageNo:e,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo}),1===i._thumbJobInfo.pageNo&&n.setPageInfo({pageNo:e}))},i._requestPageThumbnailByURI=function(t){var e,i=this,n=i._thumbJobInfo.fileItem;this._serviceManager?(e={fileId:n.getItemId(),type:o.ServiceAPIMessage.ThumbnailGetRequest,pageNo:i._thumbJobInfo.pageNo,newPageNo:i._thumbJobInfo.pageNo,imageSize:this._settings.itemWidth+","+this._settings.itemHeight},e=this._serviceManager.createRequestUrl(e)+"?"+this._serviceManager.paramToString(e,!0),e={fileId:n.getItemId(),url:e,name:n.getName(),pageNo:i._pageCount++,newPageNo:i._pageCount++,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo},i._afterRenderThumbnail(e)):i._afterRenderThumbnail({fileId:n.getItemId(),name:n.getName(),url:n.getItemId(),pageNo:i._pageCount++,newPageNo:i._pageCount++,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo})},i._resetThumbJobInfo=function(){this._thumbJobInfo={fileItem:null,pageNo:1,newPageNo:1,pageCount:1,running:!1,thumbItems:[]}},i._afterRenderThumbnail=function(t){var i=this,e=(i._thumbJobInfo.thumbItems.push(t),i._thumbJobInfo.fileItem.getPageInfo());i._thumbJobInfo.pageNo===e.pageCount?(i._resetThumbJobInfo(),t&&(i._layer.thumbnailLayer.addItem(t),i._thumbJobList.shift())):(t&&i._layer.thumbnailLayer.addItem(t),i._thumbJobInfo.running=!1,i._thumbJobInfo.pageNo=i._thumbJobInfo.pageNo+1),clearTimeout(i._renderTImeout),0<i._thumbJobList.length&&(i._renderTImeout=setTimeout(function(){var t=i._thumbJobList[0],e=t.getPageInfo();i._thumbJobInfo.fileItem=t,i._thumbJobInfo.pageCount=e.pageCount,i.onRenderThumbnail()},400))},i._getItemByPageNo=function(t){for(var e,i,n=0,o=this._items.length,n=0;n<o;n++)if((i=this._items[n])&&i.pageNo===t){e=i;break}return e},i._getItemByNewPageNo=function(t){for(var e,i,n=0,o=this._items.length,n=0;n<o;n++)if((i=this._items[n])&&i.newPageNo===t){e=i;break}return e},i._hasBookmark=function(t){if(t)return"boolean"==typeof targetItem.bookmark&&targetItem.bookmark},i.hasBookmark=function(t){t=this._getItemByPageNo(t);return!!t&&("boolean"==typeof t.bookmark&&t.bookmark)},i.addBookmark=function(t){t=this._getItemByPageNo(t);t&&(t.bookmark=!0,this._setBookmarkDisplay(t,!0))},i.removeBookmark=function(t){t=this._getItemByPageNo(t);t&&(t.bookmark=!1,this._setBookmarkDisplay(t,!1))},i._setBookmarkDisplay=function(t,e){t&&t.node&&(e?(e=o.Element.select(t.node,".thumb-box"),u.select(t.node,".bookmark")||u.createElement("span",{class:"bookmark"},e)):u.remove(".bookmark",t.node))},i.findByPageNo=function(t){return this._items[t-1]},i.findByItemId=function(t){for(var e=0,i=this._items.length,n=[],e=0;e<i;e++){var o=this._items[e];o.fileId===t&&n.push(o)}return n},i.renderFilterItem=function(t){this._emptyFilterListNode(),this._filterItems=[];for(var e=0,i=t.length;e<i;e++){var n=this.findByItemId(t[e].getItemId());0<n.length&&this._appendFilterItem(n)}this.refresh()},i._cloneItem=function(t,e){var i=this.findByItemId(t),n={};if(0<i.length)for(var o in i[0])n[o]=i[0][o];return n},i._appendFilterItem=function(t){var e,i,n=this;0<t.length&&(e=t[0].node.cloneNode(!0),this._filterListNode.append(e),(i=this._cloneItem(t[0].fileId)).node=e,this._filterItems.push(i),this.on((f.isMobile().any()?"touchstart":"click")+".thumbnail.item",function(){n.trigger("trigger.click.thumbnail",i)},e))},i.controlPosition=function(t){var e,i=this._settings.controlPosition,i=r.CONTROL_POSITION_STYLE[i],t=(this.setting("controlPosition",f.toInt(t)),r.CONTROL_POSITION_STYLE[this._settings.controlPosition]),n=!1;t.direction!==i.direction&&(i=this.width(),e=this.height(),"horizontal"===t.direction?this.height(i):this.width(e),n=!0),this._setControlStyle(),"auto"===this.setting("itemSize")&&n&&this._autoThumbnailResize(n)},i.rotate=function(t){var e,i,n,o,a=t.node;a&&(n=u.select(a,".thumb-box"),a=u.select(a,"img"),u.hasClass(n,g+"-thumbnail-load")&&(n=parseInt(a.getAttribute("data-item-width"))||this._settings.itemWidth,parseInt(a.getAttribute("data-item-height"))||this._settings.itemHeight,t=parseInt(t.rotate),i=Math.abs(t),o=parseInt(a.width),e=parseInt(a.height),n=o,e=90===i||270===i?(o=e,n):(o=n,e),i=this._settings.itemWidth/o,n=this._settings.itemHeight/e,o=Math.min(i,n),a.style.transformOrigin="50% 50%",a.style["-webkit-transform"]="rotate("+t+"deg) scale("+o+")",a.style["-moz-transform"]="rotate("+t+"deg) scale("+o+")",a.style["-ms-transform"]="rotate("+t+"deg) scale("+o+")",a.style["-o-transform"]="rotate("+t+"deg) scale("+o+")",a.style.transform="rotate("+t+"deg) scale("+o+")"))},i._reorderPageNo=function(){for(var t=this._thumbnailListNode.childNodes,e=this._items,i=0,n=0,o="",a=1,r=0;r<e.length;r++)e[r].newPageNo=-1;for(i=0;i<t.length;i++)for(n=0;n<e.length;n++)if(t[i]===e[n].node){o==e[n].fileId&&0<e[n].itemPageCount?a++:0<e[n].itemPageCount?(a=1,o=e[n].fileId):a=e[n].itemPageNo,e[n].newPageNo=0<e[n].itemPageCount?i+1:0,e[n].newItemPageNo=a,e[n].newItemPageCount=e[n].newItemPageCount||e[n].itemPageCount,this._deletedItemCountMap[e[n].fileId]&&(e[n].newItemPageCount=e[n].newItemPageCount-this._deletedItemCountMap[e[n].fileId]),this.refreshPageNo(e[n]);break}this._deletedItemCountMap={}},i.refreshPageNo=function(t){0<t.itemPageCount&&(this._settings.paginateUnit===o.Type.PaginateUnit.FILE?o.Element.select(t.node,".thumb-page").textContent="("+t.newItemPageNo+"/"+t.newItemPageCount+")":this._settings.paginateUnit!==o.Type.PaginateUnit.NONE&&(o.Element.select(t.node,".thumb-page").textContent="< "+t.newPageNo+" >"))},i.isBookmarkAutoEnabled=function(){return this._settings.bookmarkAutoEnabled},o.ThumbnailLayer=t,o.ThumbnailLayer.prototype.constructor=t.prototype,o.ThumbnailLayer}),InziSForm.create(function(i,t,g){"use strict";i.moduleName;function e(t){var e={width:0,height:0,container:null,wrapper:null,toolbarControl:!0,thumbnailControl:!0,pageControl:!0,annotationControl:!1,propertyControl:!1,viewerCompatType:"",controlType:0,layoutType:m.ToolbarLayoutType.FULL,iconSize:"",listenerId:null};return this._settings=h.extend(e,t),this._containerNode=f.getElementNode(t.container),this._containerWrapper=new i.DOMWrapper(this._containerNode),this._wrapper=this._settings.wrapper,this.loaded=!1,this._toolbarNodeMap={headerSectionNode:null,headerNode:null,headerRightSideNode:null,headerLeftSideNode:null,footerNode:null,optionNode:null},this._selectedIcon=null,this._toolbarItemMap={},this._toolbarItems=[],(this._activeItem=null)===this._settings.listenerId?(this._events=new i.Events,i.listeners(this._events.listenerId(),this._events)):this._events=i.listeners(this._settings.listenerId),this._init(),this}var u=i.moduleClassName,h=i.Utils,f=i.Element,m=i.Type,n=(i.inherit(e,i.EventHandler),e.prototype);n._init=function(){var t;this.loaded||(t=f.appendToElement(this._containerNode,"div",{class:u+"-header "+u+"-header-"+this._settings.iconSize+(this._settings.layoutType===m.ToolbarLayoutType.INLINE?" "+u+"-header-inline":"")}),this._toolbarNodeMap.headerSectionNode=t,this._toolbarNodeMap.headerNode=f.appendToElement(t,"div",{id:h.getRandomId(m.LayerType.TOOLBAR),class:u+(this._settings.layoutType===m.ToolbarLayoutType.INLINE?"-toolbar-inline":"-toolbar")+" "+u+"-toolbar-"+this._settings.iconSize}),(this._settings.pageControl||this._settings.propertyControl)&&this._settings.layoutType!==m.ToolbarLayoutType.INLINE&&(this._toolbarNodeMap.footerNode=this._containerWrapper.appendToElement("div",{class:u+"-footer "+u+"-footer-"+this._settings.iconSize})),this._createUI(),"boolean"!=typeof this._settings.toolbarControl.display&&(this._settings.toolbarControl.display=!0),this.display(this._settings.toolbarControl.display),this.loaded=!0)},n._createUI=function(){this.__createToolbarControl()},n.__createToolbarControl=function(){var t,e,i;this._settings.toolbarControl&&(e=h.clone(m.VIEWER_CONTROL),this._settings.layoutType===m.ToolbarLayoutType.INLINE&&"small"!==this._settings.iconSize?(this._toolbarNodeMap.headerLeftSideNode=f.appendToElement(this._toolbarNodeMap.headerNode,"div",{style:"position:absolute; left:7px;"}),t=this._toolbarNodeMap.headerLeftSideNode,this._toolbarNodeMap.headerRightSideNode=f.appendToElement(this._toolbarNodeMap.headerNode,"div",{style:"position:absolute; right:7px;"})):t=this._toolbarNodeMap.headerNode,this._createToolbarItem(e,t),e=h.clone(m.VIEWER_TYPE_CONTROL),i="boolean"==typeof this._settings.thumbnailControl?this._settings.thumbnailControl:this._settings.thumbnailControl.enable,this._settings.layoutType===m.ToolbarLayoutType.INLINE?i&&(t="small"===this._settings.iconSize?this._toolbarNodeMap.headerNode:this._toolbarNodeMap.headerRightSideNode,this._createToolbarItem(e,t)):this._settings.thumbnailControl&&this._createToolbarItem(e),this._createToolbarPageControl()),this._settings.layoutType===m.ToolbarLayoutType.INLINE&&(t="small"===this._settings.iconSize?this._toolbarNodeMap.headerNode:this._toolbarNodeMap.headerRightSideNode),this._createToolbarAnnotationControl(t)},n._createToolbarPageControl=function(){var t;this._settings.pageControl&&(t=this._settings.layoutType===m.ToolbarLayoutType.INLINE?this._toolbarNodeMap.headerNode:this._toolbarNodeMap.footerNode,this._pageNavigationNode=f.appendToElement(t,"div",{class:"pagenation"}),t=f.appendToElement(this._pageNavigationNode,"div"),this._createControlItem(m.PAGENATION_CONTROL,t))},n._createToolbarAnnotationControl=function(t){var e;t=t||this._toolbarNodeMap.headerNode,this._annotationControlNode,this._settings.annotationControl&&(this._annotationControl=h.clone(m.ANNOTATION_CONTROL),e=this._getAnnotationControlItem(),this._annotationControlNode=f.appendToElement(t,"span",{class:"sform-annotation"}),this._settings.layoutType===m.ToolbarLayoutType.SIMPLE||this._settings.layoutType===m.ToolbarLayoutType.INLINE?this._createAnnotationControlHiddenLayer(e,this._annotationControlNode):this._createAnnotationControl(e,this._annotationControlNode),this._settings.propertyControl&&this._settings.layoutType!==m.ToolbarLayoutType.INLINE&&(t=f.appendToElement(this._toolbarNodeMap.footerNode,"div",{class:"properties"}),e=f.appendToElement(t,"div"),this._annotationPropertyNode=t,this._createControlItem(this._annotationControl.PROPERTY,e)),this.show(i.Type.FILE_CONTROL.ANNOTATION_SAVE),!1===i.Type.FILE_CONTROL.FILE_PRINT.disabled&&this.show(i.Type.VIEWER_CONTROL.FILE_PRINT),this._createToolbarDraggableAnnotationControl())},n.displayToolbar=function(t,e){t===m.ToolbarItemType.ANNOTATION&&(this._annotationControlNode&&(this._annotationControlNode.style.display=e?"block":"none"),this._annotationPropertyNode&&(this._annotationPropertyNode.style.display=e?"block":"none"),this.displayHiddenLayer(e))},n._createToolbarDraggableAnnotationControl=function(){function t(t,e){o.trigger(t.triggerName,t)}var e,i,n,o=this,a=(this._draggableToolbarNode=g.createElement("div"),u+"-draggable-toolbar "+u+"-draggable-toolbar-"+this._settings.iconSize),a=(this._draggableToolbarNode.setAttribute("class",a),g.createElement("div")),a=(a.setAttribute("class",u+"-toolbar-title"),a.innerHTML="Toolbar",this._draggableToolbarNode.appendChild(a),g.createElement("span")),r=(a.setAttribute("class",u+"-toolbar-close"),this._draggableToolbarNode.appendChild(a),this.on("click.draggable.toolbar.close",function(){o.controlType(0)},a),g.createElement("div")),c=(r.setAttribute("class",u+"-toolbar-items"),this._getAnnotationControlItem()),s=0,l=0,a=(this._draggableToolbarNode.appendChild(r),f.appendToElement(this._draggableToolbarNode,"div",{class:"properties"}));for(n in c)for(l=(i=c[n]).controlItem.length,s=0;s<l;s++)e=this.__createDraggableToolbarRenderItem(i,i.controlItem[s],t),r.appendChild(e);for(var p=f.appendToElement(a,"div"),s=0,l=this._annotationControl.PROPERTY.controlItem.length;s<l;s++)e=this.__createDraggableToolbarRenderItem(this._annotationControl.PROPERTY,this._annotationControl.PROPERTY.controlItem[s],t),p.appendChild(e);this._containerNode.appendChild(this._draggableToolbarNode);var h,a=10,d=20;"boolean"==typeof this._settings.thumbnailControl||(h=(this._settings.thumbnailControl||{}).controlPosition)&&((h=parseInt(h))===m.CONTROL_POSITION_TYPE.RIGHT?a=10:h===m.CONTROL_POSITION_TYPE.BOTTOM?(d=100,a=10):h===m.CONTROL_POSITION_TYPE.TOP&&(a=10)),this._draggableToolbarNode.style.bottom="none",this._draggableToolbarNode.style.left=a+"px",this._draggableToolbarNode.style.bottom=d+"px",this._initDraggableAnnotationControlHandler(),this._setControlType()},n._initDraggableAnnotationControlHandler=function(){var n,o,a=this,r=!1;this.on("mousedown.draggable.toolbar",function(t){r=!0,n=t.pageX,o=t.pageY},this._draggableToolbarNode),this.on("mousemove.draggable.toolbar",function(t){var e,i;r&&(e=parseInt(a._draggableToolbarNode.style.bottom)||0,i=parseInt(a._draggableToolbarNode.style.left)||0,e-=t.pageY-o,i+=t.pageX-n,e<0?e=0:e>a._containerNode.offsetHeight-a._draggableToolbarNode.offsetHeight&&(e=a._containerNode.offsetHeight-a._draggableToolbarNode.offsetHeight),i<0?i=0:i>a._containerNode.offsetWidth-a._draggableToolbarNode.offsetWidth&&(i=a._containerNode.offsetWidth-a._draggableToolbarNode.offsetWidth),n=t.pageX,o=t.pageY,a._draggableToolbarNode.style.bottom=e+"px",a._draggableToolbarNode.style.left=i+"px",a._draggableToolbarNode.style.cursor="crosshair")},this._containerNode),this.on("mouseleave.draggable.toolbar mouseup.draggable.toolbar",function(t){r=!1,o=n=-1,a._draggableToolbarNode.style.cursor="default"},this._containerNode)},n.displayHiddenLayer=function(t){return this._hiddenLayer&&(this._hiddenLayer.style.display=t?"block":"none"),this},n.displayToolbarHiddenLayer=function(t){for(var e in this.displayHiddenLayer(),this._toolbarNodeMap.optionNode)this._toolbarNodeMap.optionNode[e]&&(this._toolbarNodeMap.optionNode[e].style.display=t?"block":"none");return this},n._displayHeaderOptionLayer=function(t,e){if(t)for(var i=f.selectAll(t,"."+u+"-hidden-option-layer")||[],n=0,o=i.length,n=0;n<o;n++)i[n]&&(i[n].style.display=e?"block":"none")},n._createAnnotationControlHiddenLayer=function(t,e){this._hiddenLayer=f.appendToElement(e,"div",{class:u+"-layer "+u+"-hidden-annotation-layer "+this._settings.listenerId,style:"display:none"});function i(t,e){var i;!1===t.disabled&&(i=f.parent(t.target,"div"),(i=f.select(i,"."+u+"-hidden-annotation-layer"))?(r.deactiveItem(t),"none"===i.style.display?r.displayHiddenLayer(!0):r.displayHiddenLayer(!1)):((i=f.select(e._controlNode,"a"))&&(f.attr(i,"class",u+"-ui-icon "+t.className),i.innerHTML=t.label||"&nbsp;"),r.displayHiddenLayer(!1),e.trigger(t.triggerName,t)))}var n,o,a,r=this,s=this._annotationControl.ITEM.SELECT.controlItem,l=0,h=s.length;for(this._createSeparatorNode(e),l=0;l<h;l++)o=s[l],this._controlNode=this.__createRenderItem(this._annotationControl.ITEM.SELECT,o,i),this._annotationControlDefaultItem=o,e.appendChild(this._controlNode);for(a in this._createSeparatorNode(e),t)for(h=(o=t[a]).controlItem.length,l=0;l<h;l++)n=this.__createRenderItem(o,o.controlItem[l],i),this._hiddenLayer.appendChild(n)},n.setDefaultAnnotationControlNode=function(){var t;this._controlNode&&(f.attr(this._controlNode,"class",u+"-ui-icon "+this._annotationControlDefaultItem.className),(t=f.select(this._controlNode,"a"))&&(f.attr(t,"class",u+"-ui-icon "+this._annotationControlDefaultItem.className),t.innerHTML=this._annotationControlDefaultItem.label||"&nbsp;"))},n._getAnnotationControlItem=function(){var t,e,i={};for(e in this._annotationControl.ITEM)-1===(t=this._annotationControl.ITEM[e]).viewerCompatType.indexOf(this._settings.viewerCompatType)||t.disabled||(i[e]={},i[e]=t);return i},n._createAnnotationControl=function(t,e){this._createToolbarItem(t,e)},n._createSeparatorNode=function(t){var e=f.appendToElement(t,"span",{class:"icon-separator"});e.innerHTML="|",t.appendChild(e)},n._createToolbarItem=function(t,e){for(var i in(e=e||this._toolbarNodeMap.headerNode).firstChild&&this._createSeparatorNode(e),t){i=t[i];i.disabled||this._createControlItem(i,e)}},n._createControlItem=function(t,e){for(var i=t.controlItem,n=0,o=i.length,a=(e=e||this._toolbarNodeMap.headerNode,g.createElement("span")),n=0;n<o;n++){var r=i[n];r.disabled||(r=this.__createRenderItem(t,r),e.appendChild(r))}return a},n.__createItem=function(t,e,i){var n=-1,o=[],a=0,r=e.options||[],s=r.length;if("input"===e.nodeType)o[++n]="<span class='"+e.className+"' control-type=\""+t.type+'"  control-data="'+e.type+'">',o[++n]="<input type='"+e.type+"' name='"+e.name+"' "+(!1===e.readonly?"":'readonly="readonly"'),o[++n]=" class='sform-ui-"+(e.disabled?"disabled":"active")+" "+(e.className||"")+"' title=\""+e.title+'"',e.maxLength&&(o[++n]=' maxlength="'+e.maxLength+'"'),e.dataType&&(o[++n]=' data-type="'+e.dataType+'"'),e.replacePattern&&(o[++n]=' data-replaceChar="'+e.replaceChar+'"',e.regExp=new RegExp(e.replacePattern,"gi")),o[++n]="/>",e.label&&(o[++n]="<label>"+e.label+"</label>"),o[++n]="</span>","currentPageNo"===e.name&&(o[++n]=" <span>/</span>");else if("select"===e.nodeType){for(o[++n]="<select name='"+e.className+"' class='sform-ui-"+(e.disabled?"disabled":"active")+"' title=\""+e.title+'">',a=0;a<s;a++){var l=r[a];o[++n]="<option value='"+l.value+"'>",o[++n]=l.text,o[++n]="</option>"}o[++n]="</select>"}else o[++n]='<span control-type="'+t.type+'" control-data="'+e.type+'" class="sform-ui-'+(e.disabled?"disabled":"active")+" icon-"+this._settings.iconSize+'">',o[++n]='<a href="javascript:;" title="'+e.title+'" class="'+t.classDefaultName+" "+e.className+'">',e.label&&(o[++n]=(e.label||"")+"</a>"),e.innerHTML&&(o[++n]=e.innerHTML),o[++n]="</a>",o[++n]="</span>";i&&(e.callbackFn=i.bind(this));i=g.createElement("span");return i.innerHTML=o.join(""),e.controlType=t.type,e.node=i,0<s&&"select"!==e.nodeType&&this.__createItemOptionNode(t,e),e},n.__createRenderItem=function(t,e,i){return(e=this.__createItem(t,e,i)).controlType=t.type,void 0===this._toolbarItemMap[t.type]&&(this._toolbarItemMap[t.type]={}),this._toolbarItems.push(e),this._toolbarItemMap[t.type][e.type]=e,this._bindTrigger(e.node,e),e.node},n.__createItemOptionNode=function(t,e){var i=0,n=e.options||[],o=n.length;if(0<o&&e.enabledOption){var a=f.appendToElement(e.node,"div",{class:u+"-layer "+u+"-hidden-option-layer "+e.optionClassName}),r="";for(r+="<ul>",i=0;i<o;i++){var s=n[i];r+="<li control-type='"+t.type+"' control-data='"+s.value+"'>","input"===s.nodeType?r+="<input type='"+s.inputType+"' name='"+s.name+"' control-data='"+s.value+"' data-type='"+s.dataType+"' placeholder='"+s.placeholder+"' data-message='"+s.errorMessage+"'/>":r+=s.text,s.confirm&&(r+="<input type='button' value='확인' data-name='"+s.name+"' control-data='"+s.value+"' data-type='"+s.dataType+"'/>"),r+="</li>"}a.innerHTML=r+="</ul>",e.optionNode=a,this._setOptionNode(e)}},n._setOptionNode=function(t){this._toolbarNodeMap.optionNode||(this._toolbarNodeMap.optionNode={}),this._toolbarNodeMap.optionNode[t.type]=t.optionNode},n.getOptionNode=function(t){if(this._toolbarNodeMap.optionNode&&t)return this._toolbarNodeMap.optionNode[t.type]},n.toggleOption=function(t){var e,t=this.getOptionNode(t);t&&((e="block"!=t.style.display)&&this.displayToolbarHiddenLayer(!1),this._visibleOption(t,e))},n.showOption=function(t){this.displayToolbarHiddenLayer(!1);t=this.getOptionNode(t);this._visibleOption(t,!0)},n.hideOption=function(t){t=this.getOptionNode(t);this._visibleOption(t,!1)},n._visibleOption=function(t,e){if(t){for(var i=f.selectAll(t,"input[type=text]")||[],n=0,o=i.length;n<o;n++)i[n]&&(i[n].value="");for(n=0,o=(i=f.selectAll(t,".alert-error")||[]).length;n<o;n++)i[n]&&i[n].parentNode.removeChild(i[n]);t.style.display=e?"block":"none"}},n.__createDraggableToolbarRenderItem=function(t,e,i){e=h.clone(e);return e.node=null,(e=this.__createItem(t,e,i)).controlType=t.type,void 0===this._toolbarItemMap[t.type]&&(this._toolbarItemMap[t.type]={}),e.type=e.type,e.triggerName=e.triggerName+"_2",this._bindTrigger(e.node,e),e.node},n._bindTrigger=function(t,a){var r,s,l=this,e="click.toolbar";"select"===a.nodeType?this.on("change.trigger",function(t){t=f.getEventTarget(t);a.value=t.value,l.trigger(a.triggerName,a)},f.select(t,"select")):"input"===a.nodeType&&!1===a.readonly?(a.optionNode&&this.on(e+=" focusout.toolbar",function(t){var e,i,n=f.getEventTarget(t),o=l.getOptionNode(a);a.type==m.VIEWER_CONTROL.ZOOM_SELECT_CUSTOM.type&&o&&(e=n.getAttribute("control-type"),i=n.getAttribute("control-data"),"focusout"===t.type?(clearTimeout(r),r=setTimeout(function(){o=l.getOptionNode(a);var t=a.node.getAttribute("selected-control-data"),e=n.getAttribute("current-control-data");"none"!=o.style.display||t||(a.controlData=null,a.value=h.toNotEmpty(n.value,0),0==a.value&&h.isNotEmpty(e)&&(h.isNumeric(e)?a.value=e:a.controlData=e),l.trigger(a.triggerName,a)),clearTimeout(r)},100)):(a.controlData=i,e&&i?(a.node.setAttribute("selected-control-data",i),a.controlData=i,a.value=i,l.trigger(a.triggerName,a)):(a.node.removeAttribute("selected-control-data"),t=n.getAttribute("data-replaceChar"),a.regExp&&null!=t&&(n.value=n.value.replace(a.regExp,t)),l.toggleOption(a))))},t),this.on("keyup.toolbar",function(t){var e=f.getEventTarget(t);13===t.keyCode?(a.controlData=null,a.value=h.toNotEmpty(e.value,0),l.trigger(a.triggerName,a)):"number"==e.getAttribute("data-type")&&(t=e.value.replace(/[^0-9.]/g,""),e.value=t,a.value=t,a.node.value=t)},t)):"input"===a.nodeType&&"checkbox"===a.type?this.on(e,function(t){t=f.getEventTarget(t);a.value=t.checked,l.trigger(a.triggerName,a)},t):(this.on(e,function(t){var e,i,t=f.getEventTarget(t),n=!0,o=l.getOptionNode(a);"trigger.set.annotation.type"===a.triggerName||"trigger.selected.annotation"===a.triggerName?(i=f.select(this,".sform-ui-active"))&&(f.hasClass(i,"sform-icon-focus")?f.removeClass(i,"sform-icon-focus"):(l._selectedIcon&&f.removeClass(l._selectedIcon,"sform-icon-focus"),l._selectedIcon=i,f.addClass(i,"sform-icon-focus"))):a.type!=m.VIEWER_CONTROL.FILE_PRINT.type&&a.type!=m.FILE_CONTROL.FILE_PRINT.type||!o?-1===a.triggerName.indexOf("annotation")&&l._selectedIcon&&f.removeClass(l._selectedIcon,"sform-icon-focus"):(t.getAttribute("control-type")||a.type,i=t.getAttribute("control-data")||a.type,e=t.nodeName||"",0===t.childNodes.length&&"input"!==e.toLowerCase()||1==t.childNodes.length&&"input"!==t.childNodes[0].nodeName.toLowerCase()?(a.controlData=i,a.optionNode=o):(n=!1,"button"!=t.type||(e=f.select(t.parentNode,"input[name='"+t.getAttribute("data-name")+"']"))&&(o=e.value.replace(/ /g,""),h.validatePageRanges(o)?(n=!0,a.controlData=i,a.value=o):l._displayErrorMessage(e,!0)))),-1===a.triggerName.indexOf("trigger.set.annotation.color")||(i=f.hasClass(t,"color")?t:f.select(t,".color"))&&(a.targetNode=i),n&&(a.callbackFn?(a.target=t,a.callbackFn.call(this,a,l)):l.trigger(a.triggerName,a))},t),0<(a.options||[]).length&&this.on("keyup.toolbar",function(t){var e=f.getEventTarget(t),i=e.getAttribute("data-type"),n=!0,o=e.value||"";13===t.keyCode?("range"==i?(o=o.replace(/ /g,""),h.validatePageRanges(o)?a.controlData=e.getAttribute("control-data"):n=!1,a.value=o):(a.controlData=null,a.value=h.toNotEmpty(e.value,0)),n&&l.trigger(a.triggerName,a)):"number"==i?(clearTimeout(s),s=setTimeout(function(){var t=e.value.replace(/[^0-9.]/g,"");e.value=t,a.value=t,a.node.value=t,clearTimeout(s)},5)):"range"==i&&(""===(o=o.replace(/ /g,""))||h.validatePageRanges(o)?l._displayErrorMessage(e,!1):l._displayErrorMessage(e,!0))},t))},n._displayErrorMessage=function(t,e){var i=t.parentNode,n=f.select(i,".alert-error");return e?n||((n=f.appendToElement(i,"span",{class:"alert-error"})).innerHTML=t.getAttribute("data-message")):n&&i.removeChild(n),this},n.currentPageNoNode=function(){if(this._pageNavigationNode)return f.select(this._pageNavigationNode,".current-page-number input")},n.totalPageNoNode=function(){if(this._pageNavigationNode)return f.select(this._pageNavigationNode,".total-page-number input")},n.toolbarItem=function(t,e){if(t in this._toolbarItemMap)return this._toolbarItemMap[t][e]},n.__createControlInnerHTML=function(t){for(var e=-1,i=[],n=t.controlItem,o=0,a=t.controlItem.length,o=0;o<a;o++){var r=n[o];i[++e]='<span control-type="'+t.type+'" control-data="'+r.type+'" class="sform-ui-'+(r.disabled?"disabled":"active")+'">',i[++e]='<a href="#" class="'+t.classDefaultName+" "+r.className+'"></a>',i[++e]="</span>"}return i.join("")},n.addItem=function(t){},n.removeItem=function(t){},n.activeItem=function(t){if(0===arguments.length)return this._activeItem;var e;!t||(e=t.node)&&(f.addClass(e,"icon-selected"),this._activeItem=t)},n.deactiveItem=function(t){(t=t||this._activeItem)?(t=t.node)&&f.removeClass(t,"icon-selected"):(t=f.select(this._containerNode,".icon-selected"))&&f.removeClass(t,"icon-selected"),this._activeItem=null},n.show=function(t){var e;!t||(e=null)!==(e=this._settings.layoutType===m.ToolbarLayoutType.INLINE&&"small"!==this._settings.iconSize?this._toolbarNodeMap.headerRightSideNode:this._toolbarNodeMap.headerNode)&&(t=this.__createRenderItem(t,t.controlItem[0]),e.appendChild(t))},n.hide=function(t){},n._getToolbarItem=function(t){return toolbar="number"==typeof t?this.getToolbarItem(t):(this._toolbarItemMap[t.type]||{})[t.type],toolbar},n.disable=function(t,e){var i,t=this._getToolbarItem(t);t&&t.node&&(t.disabled=!0,(i=f.select(t.node,".sform-ui-active"))&&(f.removeClass(i,"sform-ui-active"),f.addClass(i,"sform-ui-disabled"),"select"!==t.nodeType&&"input"!==t.nodeType||f.attr(i,"disabled","disabled")))},n.enable=function(t){var e,t=this._getToolbarItem(t);t&&t.node&&(t.disabled=!1,(e=f.select(t.node,".sform-ui-disabled"))&&(f.removeClass(e,"sform-ui-disabled"),f.addClass(e,"sform-ui-active"),"select"!==t.nodeType&&"input"!==t.nodeType||f.removeAttr(e,"disabled")))},n.clear=function(){var t=this.currentPageNoNode(),e=this.totalPageNoNode();t&&(t.value=""),e&&(e.value=""),this.displayToolbarHiddenLayer(!1)},n._setControlType=function(){this._draggableToolbarNode&&(1===this._settings.controlType?(this._draggableToolbarNode.style.display="block",this.refresh()):this._draggableToolbarNode.style.display="none")},n.controlType=function(t){return 1===arguments.length?(this._settings.controlType=h.toInt(t),this._setControlType(),this):this._settings.controlType},n.changeItemStatus=function(t,e){for(var i=0,n=f.selectAll(this._containerNode,"span[control-data="+t.type+"]")||[],o=n.length,i=0;i<o;i++){var a=n[i];-1===t.triggerName.indexOf("trigger.set.annotation.color")||(a=f.select(a,".color"))&&(a.style.background=e.hex)}},n.refresh=function(){var t,e,i;this._draggableToolbarNode&&(t=parseInt(this._draggableToolbarNode.style.bottom)||0,e=parseInt(this._draggableToolbarNode.style.left)||0,i=!1,t<0?i=!(t=0):t>this._containerNode.offsetHeight-this._draggableToolbarNode.offsetHeight&&(t=this._containerNode.offsetHeight-this._draggableToolbarNode.offsetHeight,i=!0),e<0?i=!(e=0):e>this._containerNode.offsetWidth-this._draggableToolbarNode.offsetWidth&&(e=this._containerNode.offsetWidth-this._draggableToolbarNode.offsetWidth,i=!0),i&&"block"===this._draggableToolbarNode.style.display&&(this._draggableToolbarNode.style.bottom=t+"px",this._draggableToolbarNode.style.left=e+"px")),this.trigger("toolbar.refresh",{triggerName:"toolbar.refresh",diabled:!1})},n.display=function(t){t?(this._toolbarNodeMap.headerSectionNode.style.display="block",this._toolbarNodeMap.footerNode&&(this._toolbarNodeMap.footerNode.style.display="block")):(this._toolbarNodeMap.headerSectionNode.style.display="none",this._toolbarNodeMap.footerNode&&(this._toolbarNodeMap.footerNode.style.display="none")),this.refresh()},n.getToolbarItem=function(t){return this._toolbarItems[t]},i.ToolbarLayer=e}),InziSForm.create(function(e,t,i){"use strict";function n(t){if(!t.container)throw new Error;this.container=e.Element.select(i.body,t.container),this.node=e.Element.createElement("div",{},this.container),this.textContent=this.node.innerHTML}n.prototype={append:function(t){return"string"==typeof t?this._appendToString(t):t instanceof HTMLElement&&this._appendToElement(t),this},_appendToString:function(t){this.textContent=this.textContent+t,this.refresh()},_appendToElement:function(t){this.node.appendChild(t),this.textContent=this.node.innerHTML},innerHTML:function(){return this.node.innerHTML},refresh:function(){this.node.innerHTML=this.textContent},remove:function(t){t&&this.node.removeChild(t)},empty:function(){this.node.innerHTML=""}},e.PopupLayer=n}),InziSForm.create(function(v,a,o){"use strict";var I=v.Utils,h=v.Element,y=v.Type,c=v.moduleClassName,r=a.URL||a.webkitURL;function t(t){var e,i,n;"trigger.change.autozoom"==t.triggerName?this.controlType()===t.type.toLowerCase()?(this.controlType(y.ControlType.NONE),this._layer.toolbarLayer.deactiveItem(t)):(this.controlType(t.type),this._layer.toolbarLayer.activeItem(t)):t.optionNode?(i=this.getToolbarLayer(),n=!0,t.controlData?e=t.controlData:I.isNumeric(t.value)?e=t.value/100:n=!1,t.node.value=e,i.hideOption({type:t.type}),n&&this.zoom(e)):(e="select"===t.nodeType?t.value:t.type,this.zoom(e))}function s(t){this._setAnnotationType(t.type)}function l(t){this.setAnnotationProp(t.type)}function p(e){var i=this;v.UI.colorpicker(e.value,function(t){null!==i.getToolbarLayer()&&i.getToolbarLayer().changeItemStatus(e,t),i.annotationOption(e.type,t.hex)})}function d(t){var e,i,n=i=this._currentPageNo,o=this._pageCount;0<i&&0<o&&(t.type===y.PAGENATION_CONTROL.controlItem[0].type?i=1:t.type===y.PAGENATION_CONTROL.controlItem[1].type?i=Math.max(i-1,1):t.type===y.PAGENATION_CONTROL.controlItem[4].type?i=Math.min(i+1,o):t.type===y.PAGENATION_CONTROL.controlItem[5].type?i=o:t.type===y.PAGENATION_CONTROL.controlItem[3].type&&(i=t.value,this.setting.paginateUnit!==v.Type.PaginateUnit.FILE||(t=this._editedPageItems[this._currentPageNo-1])&&(t=t.fileId,e=this._getFirstPageNoByItemId(t),t=this._getLastPageNoByItemId(t),(t<(i=e+i-1)||i<1)&&(i=n)),(!I.isNumeric(i)||i<1||o<i)&&(i=n),this.movePage(i)),n!==i&&this.movePage(i))}function g(t){this._viewer.isSelected(!this._viewer.isSelected())}function u(t){this._viewer.setAnnotationVisible(t.value)}function f(t){this._itemSave(t)}function e(t){var e={protocol:i.protocol,hostname:i.hostname,port:i.port,context:"",container:null,serviceType:v.Type.SERVICE_TYPE.API,serviceStreamingType:"body",preloadImage:{enabled:!1},item:null,scope:null,viewerType:null,viewerCompatType:"",toolbarLayoutType:"",paginateUnit:v.Type.PaginateUnit.FILE,async:!1,cors:!1,withCredentials:null,initPageNo:null,viewerConfig:null,cacheConfig:{maxSize:0,removalListener:null},printConfig:{serviceType:y.PRINT_SERVICE_TYPE.DEFAULT,protocol:null,hostname:null,port:null,context:null,serverUri:null,serverContextPath:null,withAnnotations:!1,commonOption:{mediaSize:null,layout:"auto",margins:null},watermark:{type:y.WATERMARK_TYPE.DEFAULT,text:"Copy",imageHref:"",repeat:1,opacity:.3}},fileEditConfig:{rotate:!1,move:!1,remove:!1,add:!1,merge:!1,split:!1,crop:!1}};return this.setting=I.extend(e,t,!0),this._viewer=null,this._viewerType=this.setting.viewerType||v.Type.ViewerType.IMAGE_THUMBNAIL,this._containerNode=h.getElementNode(this.setting.container),this._containerWrapper=new v.DOMWrapper(this._containerNode),this.serviceManager=null,this.pcAgentServiceManager=null,this._layer={contentsLayer:null,containerLayer:null,toolbarLayer:null,thumbnailLayer:null},this._currentPageNo=this.setting.initPageNo,this._pageCount=0,this._items=[],this._currentItem=null,this._renderItem=null,this._thumbJobList=[],this._pageItems=[],this._filterPageItems=[],this._editedPageItems=[],this._deletedPageItems=[],this._isEditMode=!1,this._isInfoRenderAll=!0,this._thumbJobInfo={fileItem:null,pageNo:1,pageCount:1,running:!1,thumbItems:[]},this._notifyMessage="",this._lastFileItem=null,this._thumbnailItemMap={},this._retryRotateThumbnailItems=[],this._fileItemMap={},this._triggerRequestAnnotationMap={},this._events=new v.Events,this._processId=I.generateUUID(),v.listeners(this._events.listenerId(),this._events),this._init(),this}var m={"trigger.change.viewer.type":function(t){this._resizeByType(t.type)},"trigger.change.zoom":t,"trigger.change.autozoom":t,"trigger.change.filter":function(t){this.filter("brightness",t.type)},"trigger.change.rotate":function(t){this.rotate(t.type,t.value)},"trigger.magnification":function(t){this.controlType()===y.ControlType.MAGNIFICATION?(this.controlType(y.ControlType.NONE),this._layer.toolbarLayer.deactiveItem(t)):(this.controlType(t.type),this._layer.toolbarLayer.activeItem(t))},"trigger.file.print":function(t){var e;0<this._getSelectedThumbnailItems().length||1==this.pageCount()?this.printPages():(e=this.getToolbarLayer())&&(e.getOptionNode({type:t.type})?t.controlData!=t.controlType?(e.hideOption({type:t.type}),t.controlData===y.PRINT_RANGE_TYPE.CUSTOM?this.printPages(t.controlData,I.toPageRanges(t.value)):this.printPages(t.controlData)):e.toggleOption({type:t.type}):this.printPages())},"trigger.file.download":function(t){this.download()},"trigger.movepage":d,"trigger.set.annotation.type":s,"trigger.set.annotation.index":l,"trigger.set.annotation.color":p,"trigger.selected.annotation":g,"trigger.display.annotation":u,"trigger.set.annotation.type_2":s,"trigger.set.annotation.index_2":l,"trigger.set.annotation.color_2":p,"trigger.selected.annotation_2":g,"trigger.display.annotation_2":u,"trigger.annotation.save":f,"trigger.file.save":f,"trigger.file.delete":function(t){var e,i=this.currentPage();null===i||null!==(i=i.getImageFile())&&(e={fileId:i.getFileId(),pageNo:i.getPageNo()}),this.trigger(t.type,e)},"trigger.file.fax":function(t){},"change.current.page.no":d,"toolbar.refresh":function(t,e){this.refresh()}},i=I.globalLocation(),n=(v.inherit(e,v.EventHandler),e.prototype);return n._init=function(){var t,e=this;this._layer.containerLayer||(this._viewerId=I.generateUUID(),h.attr(this._containerNode,{"data-viewer-id":this._viewerId}),this._layer.containerLayer=this._containerWrapper.appendToElement("div",{class:"sform-container"}),0<this.setting.cacheConfig.maxSize&&(this.setting.cacheConfig.removalListener=function(t){t&&e._removePage(t.pageNo)},this.cacheManager=new v.CacheManager(this.setting.cacheConfig)),t={protocol:this.setting.protocol,hostname:this.setting.hostname,port:this.setting.port,context:this.setting.context,cors:this.setting.cors,withCredentials:this.setting.withCredentials},this.serviceManager=this.createServiceManager(this.setting.serviceType,t),this.setting.serviceType===y.SERVICE_TYPE.PCAGENT_API&&(this.pcAgentServiceManager=this.serviceManager),this._initControl(),this._initViewer(),this.refresh(this._viewerType,0),this._initEvent(),this._initItem().render())},n._initItem=function(){var t=this._items.length,e=[];if("string"==typeof this.setting.item&&I.isNotEmpty(this.setting.item))e=[this._createFileItem(this.setting.item,t)];else if(this.setting.item instanceof v.core.FileItem)e.push(this._createFileItem(this.setting.item,t));else if(this.setting.item instanceof v.core.DocItem)this._requestDocInfo(this.setting.item);else if(Array.isArray(this.setting.item))for(var i=0,n=this.setting.item.length;i<n;i++)e.push(this._createFileItem(this.setting.item[i],t+i));return 0<e.length&&this._setItem(e),this},n._setItem=function(t){for(var e=0,e=0,i=t.length;e<i;e++)void 0===this._fileItemMap[t[e].getItemId()]&&(this._fileItemMap[t[e].getItemId()]=t[e].getItemId(),this._items.push(t[e]));0<this._items.length&&(this._currentItem=this._getInitItem(),this._lastFileItem=this._items[this._items.length-1])},n._getInitItem=function(){var t,e,i=0,n=this._items.length;if(0<this._items.length){for(t=this._items[0],i=0;i<n;i++)if((e=this._items[i])&&e.isInitItem()){t=e;break}return t}},n._initControl=function(){var t,e,i;this.setting.viewerConfig=I.extend(v.Type.VIEWER_CONFIG,this.setting.viewerConfig,!0),this.setting.viewerConfig.listenerId=this._events.listenerId(),"boolean"==typeof this.setting.viewerConfig.layerOptions.toolbarControl&&(i=this.setting.viewerConfig.layerOptions.toolbarControl,this.setting.viewerConfig.layerOptions.toolbarControl={enable:i}),this.setting.viewerConfig.layerOptions.toolbarControl.enable&&(this._initToolbar(),t=this._layer.toolbarLayer._toolbarNodeMap.headerNode.clientHeight,e=this._layer.toolbarLayer._toolbarNodeMap.footerNode?this._layer.toolbarLayer._toolbarNodeMap.footerNode.clientHeight:0,this._layer.containerLayer.style.top=t+"px",this._layer.containerLayer.style.bottom=e+"px"),"boolean"==typeof this.setting.viewerConfig.layerOptions.thumbnailControl&&(i=this.setting.viewerConfig.layerOptions.thumbnailControl,this.setting.viewerConfig.layerOptions.thumbnailControl={enable:i}),this.setting.viewerConfig.layerOptions.thumbnailControl.enable&&this._initThumbnail()},n._createFileItem=function(t,e){var i;return"string"==typeof t?i=new v.core.FileItem({itemIdx:e,itemId:t}):(i=t).setItemIdx(e),i.processId=this._processId,i},n._initEvent=function(){var i,n,o=this;I.bind(a,"resize",function(){o._resizeByType(o._viewerType)}),I.bind(a,"mouseup",function(t){var e=h.parent(t.target,"."+c+"-contents"),t=h.parent(t.target,"."+c+"-popup-layer");null===e&&null===t&&o.viewer().undrawing()}),I.bind(a,"click",function(t){var e,t=t.target,i=t.parentNode?h.attr(t.parentNode,"control-data"):"",n=!1;h.parent(t,"[data-viewer-id]")==o._containerNode&&(e=h.parent(t,"."+c+"-hidden-option-layer"),n=t.parentNode&&t.parentNode.nextSibling?h.hasClass(t.parentNode.nextSibling,c+"-hidden-option-layer"):!!h.hasClass(t.nextSibling,c+"-hidden-option-layer")||(null!=h.select(t,"."+c+"-hidden-option-layer")||(null!=e||h.hasClass(t,c+"-hidden-option-layer")))),(!n&&"select"!==i||0===o._pageCount)&&o._layer.toolbarLayer&&o._layer.toolbarLayer.displayToolbarHiddenLayer(!1)}),I.bind(this._containerNode,"contextmenu",function(t){t.preventDefault()},!1),this._layer.toolbarLayer&&(i=v.Element.select(this._layer.toolbarLayer._containerNode,"[name=sform--ui-select]")||v.Element.select(this._layer.toolbarLayer._containerNode,"input[name=zoomRatio]"),n=(i?i.nodeName:"").toLowerCase(),i&&this._viewer.on("change.current.zoom",function(t){var e=Math.min(t.scale.x,t.scale.y);I.isNumeric(e)&&("select"===n?(i.options[0].text="=="+Math.round(100*e)+"%==",i.options[0].value=e,i.options[0].selected="selected"):(i.setAttribute("current-control-data",t.zoomType===y.ZoomType.DEFAULT?100*e:t.zoomType),i.value=Math.round(100*e)+"%"))})),o._angle=0,this._viewer.on("change.rotate",function(t,e){o._angle=(o._angle+t.degrees)%360}),this._viewer.on("change.annotation.type",function(t){t===y.ControlType.NONE&&o._layer.toolbarLayer&&o._layer.toolbarLayer.setDefaultAnnotationControlNode()}),this.on("change.rotate.page.complete",function(t){var e=t.data("change.rotate.data")||{};o._setRotationInPageItem(!0,e,t)}),o._layer.thumbnailLayer&&(this.on("add.annotation",function(t){var t=t.page,e=t.pageNo();0<(t.getItems()||[]).length&&o._layer.thumbnailLayer.isBookmarkAutoEnabled()&&o._layer.thumbnailLayer.addBookmark(e)}),this.on("remove.annotation",function(t){var t=t.page,e=t.pageNo();0===(t.getItems()||[]).length&&o._layer.thumbnailLayer.isBookmarkAutoEnabled()&&o._layer.thumbnailLayer.removeBookmark(e)}),o._layer.thumbnailLayer.on("thumbnail.item.loaded",function(t){var e=o._getByItemId(t.fileId);e&&(o._getPage(t.pageNo)||o._addPage(e,null,t.pageNo).setPageInfo({fileId:e.getItemId(),itemPageNo:t.itemPageNo}),o._pageItems[t.itemPageNo-1]&&(o._pageItems[t.itemPageNo-1].loadedThumbnail=!0),o._layer.thumbnailLayer.isBookmarkAutoEnabled()&&o._triggerRequestAnnotation({fileId:e.getItemId(),annotationId:e.getAnnotationId(),pageNo:t.itemPageNo}))}),this.on("page.annotation.load",function(t){var t=t.page,e=t.pageNo();0<(t._drawingItems||[]).length&&o._layer.thumbnailLayer.isBookmarkAutoEnabled()&&o._layer.thumbnailLayer.addBookmark(e)})),this.on("page.file.load",function(t){var e=t.page,t=o._getByItemId(t.fileId);null===e.getAnnotation()||e._drawingItems||o._triggerRequestAnnotation({fileId:t.getItemId(),annotationId:t.getAnnotationId(),pageNo:e.getImageFile().getPageNo()})}),this._viewer.on("change.viewer.control.type",function(t){var e;o._layer.toolbarLayer&&(t=t.toUpperCase(),(e=o._layer.toolbarLayer.activeItem())?e.controlType!==t&&o._layer.toolbarLayer.deactiveItem():(e=o._layer.toolbarLayer.toolbarItem(t,t))?o._layer.toolbarLayer.activeItem(e):o._layer.toolbarLayer.deactiveItem())}),this._viewer.on("click.viewer.page",function(t){o.trigger("click.page",t)})},n._triggerRequestAnnotation=function(t){var e=this._getByItemId(t.fileId);e&&e.getAnnotationId()&&!e.isPresetAnnotationId()&&(t={fileId:e.getItemId(),annotationId:e.getAnnotationId(),pageNo:t.pageNo,fileStorageType:e.getFileStorageType(),annotationType:e.getAnnotationType()},this._requestAnnotation(t))},n.resize=function(){},n._initToolbar=function(){var t={},e=("boolean"==typeof this.setting.viewerConfig.layerOptions.toolbarControl?t.enable=this.setting.viewerConfig.layerOptions.toolbarControl:t=this.setting.viewerConfig.layerOptions.toolbarControl,t.controlType||0),t={container:this._containerNode,wrapper:this._containerWrapper,viewerCompatType:this.setting.viewerCompatType,layoutType:this.setting.toolbarLayoutType||t.layoutType,toolbarControl:t,iconSize:t.iconSize||"normal",controlType:I.toInt(e),thumbnailControl:this.setting.viewerConfig.layerOptions.thumbnailControl,pageControl:this.setting.viewerConfig.layerOptions.pageControl,propertyControl:this.setting.viewerConfig.layerOptions.propertyControl,annotationControl:this.setting.viewerConfig.layerOptions.annotationControl,listenerId:this._events.listenerId()};this._layer.toolbarLayer=new v.ToolbarLayer(t),this._toolbarHandler()},n._initViewer=function(){var t=this._layer.containerLayer.offsetWidth,e=(this._layer.thumbnailLayer&&(t-=this._layer.thumbnailLayer?this._layer.thumbnailLayer.setting("width"):0),this._layer.contentsLayer=h.createElement("div",{class:"sform-contents"},this._layer.containerLayer),this.setting.viewerConfig);e.width=t,e.container=this._layer.contentsLayer,e.cors=this.setting.cors,this._viewer=new v.Viewer(e),this._triggerHandler()},n._initThumbnail=function(){var r=this,t=(y.ThumbnailLabelType.DEFAULT,this.setting.viewerConfig.layerOptions.thumbnailControl.labelType&&this.setting.viewerConfig.layerOptions.thumbnailControl.labelType,I.extend(this.setting.viewerConfig.layerOptions.thumbnailControl,{paginateUnit:this.setting.paginateUnit,wrapper:this._containerWrapper,listenerId:this._events.listenerId(),pageDeletable:this.setting.fileEditConfig.remove,serviceStreamingType:this.setting.serviceStreamingType},!0)),s=v.LayerFactory.createLayer({type:y.LayerType.THUMBNAIL,container:this._layer.containerLayer,config:t});s.on("trigger.click.thumbnail",function(t){r._currentItem=r._getByItemId(t.itemId),"multiselect"===t.type?s._settings.keepMultiselect&&r.movePage(t.pageNo,{triggerType:t.type}):r.movePage(t.pageNo),r.trigger("click.thumbnail",t)}),s.on("thumbnail.item.delete",function(t){for(var e=0,i=0,n=t.length,o=t[0].newPageNo,e=0;e<n;e++){for(var a=-1,i=0;i<r._editedPageItems.length;i++)if(r._editedPageItems[i].fileId==t[e].fileId&&r._editedPageItems[i].pageNo==t[e].pageNo){a=i;break}0<=a&&(r._editedPageItems.splice(a,1),r._deletedPageItems.push(t[e]))}s._reorderPageNo(),0<n&&(r._pageCount=r._pageCount-n,r.movePage(Math.min(o,r._editedPageItems.length)),r._isEditMode=!0)}),s.on("thumbnail.item.move.complete",function(t){var e;t.oldIndex!=t.newIndex&&(e=r._editedPageItems.splice(t.oldIndex,1),r._editedPageItems.splice(t.newIndex,0,e[0]),r._currentPageNo==t.oldIndex+1?r._currentPageNo=t.newIndex+1:r._currentPageNo>t.oldIndex+1&&r._currentPageNo<=t.newIndex+1?r._currentPageNo=r._currentPageNo-1:r._currentPageNo<t.oldIndex+1&&r._currentPageNo>=t.newIndex+1&&(r._currentPageNo=r._currentPageNo+1),s._reorderPageNo(),r._displayPageNo(),r._isEditMode=!0),r.trigger("thumbnail.item.move.complete",t)}),s.on("thumbnail.item.move.start",function(t){r.trigger("thumbnail.item.move.start",t)}),s.on("trigger.right.click.thumbnail",function(t){r.trigger("right.click.thumbnail",t)}),this._layer.thumbnailLayer=s},n._toolbarHandler=function(){var t,n=this,e=this._layer.toolbarLayer;function i(t,e){var i;!1===t.disabled&&(i=t.triggerName,(i=m[i])&&(i.call(n,t),n.trigger("click.toolbaricon",t.type)))}for(t in m)e.on(t,i)},n._triggerHandler=function(){var r=this;this._viewer.on("on.clip.end",function(t){var e=r._viewer.getPage(),i=e.getImageFile(),n=i.getWidth(),i=i.getHeight(),e=e.data("angle"),o={x:t.rx,y:t.ry,x1:t.rx,y1:t.ry,x2:t.rx+t.rw,y2:t.ry+t.rh,width:t.rw,height:t.rh,pageNo:t.pageNo};90===e||-270===e?(o.x=t.ry,o.y=i-(t.rx+t.rw),o.x1=o.x,o.y1=o.y,o.width=t.rh,o.height=t.rw,o.x2=o.x+o.width,o.y2=o.y+o.height):180===e||-180===e?(o.x=n-(t.rx+t.rw),o.y=i-(t.ry+t.rh),o.x1=o.x,o.y1=o.y,o.x2=t.rx+o.width,o.y2=t.ry+o.height):270!==e&&-90!==e||(o.x=n-(t.ry+t.rh),o.y=t.rx,o.x1=o.x,o.y1=o.y,o.width=t.rh,o.height=t.rw,o.x2=o.x+o.width,o.y2=o.y+o.height),r.trigger("file.clip.complete",o)}),this._viewer.on("on.crop.end",function(t){var i,e=r._viewer.getPage(),n=e.getImageFile(),o=n.getWidth(),n=n.getHeight(),e=e.data("angle"),a={x:t.x,y:t.y,x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height,width:t.width,height:t.height,fileId:t.fileId,pageNo:t.pageNo};90===e||-270===e?(a.x=t.y,a.y=n-(t.x+t.width),a.x1=a.x,a.y1=a.y,a.width=t.height,a.height=t.width,a.x2=a.x+a.width,a.y2=a.y+a.height):180===e||-180===e?(a.x=o-(t.x+t.width),a.y=n-(t.y+t.height),a.x1=a.x,a.y1=a.y,a.x2=t.x+a.width,a.y2=t.y+a.height):270!==e&&-90!==e||(a.x=o-(t.y+t.height),a.y=t.x,a.x1=a.x,a.y1=a.y,a.width=t.height,a.height=t.width,a.x2=a.x+a.width,a.y2=a.y+a.height),0<=a.x&&0<=a.y&&0<a.width&&0<a.height&&(n=r._getFileItem(a.fileId),i={fileId:a.fileId,pageNo:a.pageNo,crop:{x:a.x,y:a.y,width:a.width,height:a.height},fileStorageType:n.getFileStorageType(),addOption:n.getFileStorageAddOption()},r._requestFileCrop(i,function(t){var e={fileId:i.fileId,newFileId:t.fileId,fileStorageType:i.fileStorageType,success:!1};500===t.statusCode||t.errorCode?console.log(t.errorCode):e.success=!0,v.UI.message("저장이 완료되었습니다. <br/> 저장경로 : <div style='width:350px;word-wrap: break-word'>"+t.fileId+"</div>",function(){r.trigger("file.crop.complete",e)})}))}),this._viewer.on("trigger.viewer.movepage",function(t){var e;t.pageNo&&(e=!0,(e=!t.force&&r._currentPageNo===t.pageNo||!t.force&&(t.pageNo<1||r._pageCount<t.pageNo)?!1:e)&&r.movePage(t.pageNo))}),this._viewer.on("page.file.load",function(t){t.container=r.setting.container,r.trigger("pageload.complete",t)}),this._viewer.on("trigger.swipe.movepage",function(t){var e,i=e=r._currentPageNo,n=r._pageCount;0<e&&0<n&&(t.type===y.PAGENATION_CONTROL.controlItem[1].type?e=Math.max(e-1,1):t.type===y.PAGENATION_CONTROL.controlItem[4].type&&(e=Math.min(e+1,n)),i!==e&&r.movePage(e))})},n._requestFileCrop=function(t,e){this.serviceManager.requestFileCrop(t,e,function(t){})},n._getFileItem=function(t){for(var e,i=0,n=this._items.length,i=0;i<n;i++){var o=this._items[i];if(o&&o.getItemId()===t){e=o;break}}return e},n.onRenderThumbnail=function(){var t=this._thumbJobInfo.fileItem,e=t.getPageInfo();this._thumbJobInfo.pageNo>e.pageCount||this._thumbJobInfo.running||(this._thumbJobInfo.running=!0,e={fileId:t.getItemId(),pageNo:this._thumbJobInfo.pageNo,name:t.getName()},a.Uint8Array?this._requestPageThumbnailByBody(e):this._requestPageThumbnailByURI(e))},n._requestPageThumbnailByBody=function(t){var e,i=this,n=i._thumbJobInfo.fileItem;this._isAPIService()?this.serviceManager.requestPageThumbnail(t,function(t){t=new Uint8Array(t),t=new Blob([t],{type:"image/jpeg"}),t=r.createObjectURL(t),n=i._thumbJobInfo.fileItem,e=i._pageCount++,t={fileId:n.getItemId(),url:t,name:n.getName(),pageNo:e,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo,loaded:!1};1===i._thumbJobInfo.pageNo&&n.setPageInfo({pageNo:e}),i._afterRenderThumbnail(t)},function(){}):(e=i._pageCount++,i._afterRenderThumbnail({fileId:n.getItemId(),url:n.getItemId(),name:n.getName(),pageNo:e,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo,loaded:!1}),1===i._thumbJobInfo.pageNo&&n.setPageInfo({pageNo:e}))},n._requestPageThumbnailByURI=function(t){var e,i=this,n=i._thumbJobInfo.fileItem;this._isAPIService()?(e={fileId:encodeURIComponent(n.getItemId()),type:v.ServiceAPIMessage.ThumbnailGetRequest,pageNo:i._thumbJobInfo.pageNo},e=this.serviceManager.createRequestUrl(e)+"?"+this.serviceManager.paramToString(e,!0),e={fileId:n.getItemId(),url:e,name:n.getName(),pageNo:i._pageCount++,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo},i._afterRenderThumbnail(e)):i._afterRenderThumbnail({fileId:n.getItemId(),name:n.getName(),url:n.getItemId(),pageNo:i._pageCount++,itemPageCount:i._thumbJobInfo.pageCount,itemPageNo:i._thumbJobInfo.pageNo})},n._resetThumbJobInfo=function(){this._thumbJobInfo={fileItem:null,pageNo:1,pageCount:1,running:!1,thumbItems:[]}},n._afterRenderThumbnail=function(t){var i=this,e=(i._thumbJobInfo.thumbItems.push(t),i._thumbJobInfo.fileItem.getPageInfo());i._thumbJobInfo.pageNo===e.pageCount?(i._resetThumbJobInfo(),t&&(i._addThumbnailItem(t),i._thumbJobList.shift())):(t&&i._addThumbnailItem(t),i._thumbJobInfo.running=!1,i._thumbJobInfo.pageNo=i._thumbJobInfo.pageNo+1),0<i._thumbJobList.length&&setTimeout(function(){var t=i._thumbJobList[0],e=t.getPageInfo();i._thumbJobInfo.fileItem=t,i._thumbJobInfo.pageCount=e.pageCount,i.onRenderThumbnail()},400),i._displayPageNo()},n._fileItemToThumbnailItem=function(t){var e=this._viewer.setting("globalTransform").rotation;return{fileId:t.getItemId(),annotationId:t.getAnnotationId(),name:t.getName(),type:t.getType(),createTime:t.getCreateTime(),empId:t.getEmpId(),additionalInfo:t.getAdditionalInfo(),url:"",pageNo:0,rotate:t.getRotate()+(e?this._angle:0),itemPageCount:t.pageCount||-1,itemPageNo:t.pageNo||0,loadedThumbnail:!1,isReqStreaming:!1,fileStorageType:t.getFileStorageType()}},n._updateItem=function(t){var e,i,n=this._getByItemId(t.getItemId()),o=!0,a=0,r=!0;if(n){n.loaded(!0),n.refreshPageRange();for(var s=0,l=this._items.length;s<l;s++)e=(i=this._items[s]).getPageInfo(),a+=Math.max(i.getPageCount(),0),1<e.pageCount&&1<this._items.length&&(r=!1),i.setPageInfo({pageNo:a}),i.isLoaded()||(o=!1);this._pageCount=a,o&&(this._isInfoRenderAll=o,this.setting.fileEditConfig.move&&this._layer.thumbnailLayer&&r&&this._layer.thumbnailLayer._makeSortable()),this._jobItemsToRenderItem(o,t)}},n._jobItemsToRenderItem=function(t,e){for(var i,n,o=0,c=this._items.length,p=1,a=[],r=[],s=1,o=0;o<c;o++){n=(i=this._items[o]).getPageInfo(),i.setPageInfo({pageNo:s,pageCount:i.getPageCount()}),s+=n.pageCount;for(var d=Math.max(n.pageCount,1),l=1;l<=d;l++){var h=this._fileItemToThumbnailItem(i);h.itemPageCount=n.pageCount,e.isPageRangeView()?h.itemPageNo=e.pages(l-1):h.itemPageNo=l,0<n.pageCount?(h.pageNo=p++,h.url=this._createThumbnailURI(h)):h.pageNo=0,0<n.pageCount&&(a.push(h),r.push(h)),(0<n.pageCount||"image"!==this.setting.scope&&0===n.pageCount)&&(e?this._layer.thumbnailLayer&&e===i&&this._addThumbnailItem(h):this._layer.thumbnailLayer&&t&&this._addThumbnailItem(h))}this._pageItems=a,this._editedPageItems=r,this._displayPageNo()}t&&(1<this.setting.initPageNo?this.movePage(this._currentPageNo):this.movePageByItem(this._currentItem.getItemId()))},n._createThumbnailURI=function(t){var e;if(this._layer.thumbnailLayer)return this._isAPIService()?(e={fileId:encodeURIComponent(t.fileId),type:v.ServiceAPIMessage.ThumbnailGetRequest,pageNo:t.itemPageNo,fileStorageType:t.fileStorageType||"",imageSize:parseInt(this._layer.thumbnailLayer._settings.itemWidth)+","+parseInt(this._layer.thumbnailLayer._settings.itemHeight)},this.serviceManager.createRequestUrl(e)+"?"+this.serviceManager.paramToString(e,!0)):t.fileId},n.appendThumbnail=function(t){this._layer.thumbnailLayer},n._createRequestPageStreamingUrl=function(t,e,i){return e&&(t=I.extend(t,e,i)),this.serviceManager.createRequestUrl(t)+"?"+this.serviceManager.paramToString(t,i)},n.getPageListInfo=function(t,e,i){var n=[];if(void 0===i&&(i={}),Array.isArray(t)){for(var o,a=0,r=t.length;a<r;a++)o={itemId:t[a].fileId,pageNo:t[a].pageNo,pageCount:t[a].pageNo,fileStorageType:t[a].fileStorageType||""},I.isNumeric(t[a].rotate)?i.rotate=t[a].rotate:i.rotate=0,n=n.concat(this._createPageStreamingUrl(o,e,i));return n}return I.isNumeric(t.rotate)?i.rotate=t.rotate:i.rotate=0,t.pageNo=1,this._createPageStreamingUrl(t,e,i)},n._createPageStreamingUrl=function(t,e,i){var n=[];if(this._isAPIService()){if(t&&(0<t.pageCount||0<t.pageNo))for(var o=e?v.ServiceAPIMessage.PageStreamRequestByPost:v.ServiceAPIMessage.ThumbnailGetRequest,a=void 0===t.pageNo?1:t.pageNo,r=void 0===t.pageCount?t.pageNo:t.pageCount,s=a;s<=r;s++){var l={fileId:encodeURIComponent(t.itemId),type:o,pageNo:s,fileStorageType:t.fileStorageType||""},h=this._createRequestPageStreamingUrl(l,i,!0);e?n.push(h):(l.url=h,n.push(l))}}else n.push(t.itemId+"?"+I.mapToString(i,"=","&"));return n},n._render=function(t){null!==this._viewer&&t&&(this._renderItem=t,this._requestPageInfo(this._renderItem))},n._requestDocInfo=function(t,e){var i,n,o=this;"string"==typeof t?i=new v.core.DocItem({itemId:t}):t instanceof v.core.DocItem&&(i=t),n=i.getItemId(),this._isAPIService()&&(n={docId:n,docFormCode:i.getDocFormCode()||"",param:t.getParam()},this.serviceManager.requestDocInfo(n,e=void 0===e?function(t){var e;0===t.statusCode||200===t.statusCode?t.fileList&&0<t.fileList.length?(i.setFileItems(t.fileList),0<(e=i.getFileItems()).length&&o.addItem(e).render()):o.notify({type:y.NOTIFICATION_TYPE.ERROR,message:"해당 정보로 조회된 문서가 없습니다."}):t.errorCode&&(e="요청하신 업무가 정상적으로 처리되지 않았습니다.<br/>요청 정보를 확인해주시거나,<br/>잠시 후 다시 이용해주시기 바랍니다.",40401===t.errorCode&&"File Not Found"!==t.message&&(e=t.message),o.notify({type:y.NOTIFICATION_TYPE.ERROR,message:e}))}:e))},n._prevUpdateItem=function(t,e){var i={pageCount:-1,pageNo:0,currentPageNo:1};e&&(i.pageCount=e.pageCount||0,t.setType(e.type),null===t.getName()&&e.fileName&&t.setName(e.fileName)),t.setPageInfo(i),this._updateItem(t),0<i.pageCount&&null===this.setting.initPageNo&&(this._currentItem?this._currentItem.getItemId()===t.getItemId()&&this.movePageByItem(t.getItemId()):(this._currentItem=t,this.movePageByItem(t.getItemId()))),this._nextItemRender()},n._requestPageInfo=function(n,t){var o,a=this,e="string"==typeof n?n:n.getItemId(),i="string"==typeof n?"":n.getFileStorageType(),r="요청하신 업무가 정상적으로 처리되지 않았습니다.<br/>요청 정보를 확인해주시거나,<br/>잠시 후 다시 이용해주시기 바랍니다.";v.setting("notifications");"string"!=typeof n&&-1!==n.getPageInfo().pageCount?a._prevUpdateItem(n):this._isAPIService()?this.serviceManager.requestPageInfo(o={fileId:e,fileStorageType:i},t=void 0===t?function(t){var e,i;a._processId===n.processId&&(e=!0,i="",0!==t.statusCode&&200!==t.statusCode?(i=y.ERROR_TYPE.SERVICE_ERROR,50005===t.errorCode?(r="이미지 뷰어에서 지원하지 않는 포맷입니다. 파일 포맷 확인 후 다시 이용 부탁드립니다.",i=y.ERROR_TYPE.UNSUPPORTED_TARGET_FILE_FORAMT):40401===t.errorCode&&(a._notifyMessage+=(a._notifyMessage?",<br/>":"")+n.getItemId(),i=y.ERROR_TYPE.NOT_FOUND_FILE,"File Not Found"!==t.message&&(a._notifyMessage+="&nbsp;("+t.message+")")),a._notifyMessage||a.notify({type:y.NOTIFICATION_TYPE.ERROR,message:r}),e=!1,t=null):0!==t.statusCode&&200!==t.statusCode||0!==t.pageCount||"image"!==a.setting.scope||(i=y.ERROR_TYPE.UNSUPPORTED_TARGET_FILE_FORAMT,r="이미지 뷰어에서 지원하지 않는 포맷입니다.<br/>파일 포맷 확인 후 다시 이용 부탁드립니다.<br/>["+t.fileId+"]",e=!1,a.notify({type:y.NOTIFICATION_TYPE.ERROR,message:r})),a._lastFileItem&&a._lastFileItem.getItemId()===o.fileId&&I.isNotEmpty(a._notifyMessage)&&(i=y.ERROR_TYPE.NOT_FOUND_FILE,r="파일을 찾을 수 없습니다.<br/>요청 정보를 확인해주시기 바랍니다.<br/>"+a._notifyMessage,a.notify({type:y.NOTIFICATION_TYPE.ERROR,message:r}),a._notifyMessage="",e=!1),e||""===i||a.trigger("error",{type:i.name,itemId:o.fileId}),a._prevUpdateItem(n,t))}:t,function(t){a._prevUpdateItem(n),a.notify({type:y.NOTIFICATION_TYPE.INFO,message:r})}):a._prevUpdateItem(n,{pageCount:1})},n.notify=function(t,e){(v.setting("notifications").enabled||e&&e.force)&&v.UI.alert(t.message),this.trigger("notification",t)},n._loadComplete=function(t){t._loaded=1},n.load=function(){this.serviceManager.requestPageInfo()},n.controlType=function(t){if(!t)return this._viewer.controlType();this._viewer.controlType(t)},n.zoom=function(t){return 0===arguments.length?this._viewer.zoom():(this._viewer.zoom(t),this)},n.rotate=function(t,e){0<this._getSelectedThumbnailItems().length&&(e=!1),this._viewer.rotate(t,e)},n.filter=function(t,e){this._viewer.filter(t,e)},n.annotationOption=function(t,e){return 0===arguments.length?this._viewer.getAnnotationOption():1===arguments.length?this._viewer.getAnnotationOption(t):(2===arguments.length?this._viewer.setAnnotationOption(t,e):"object"==typeof t&&this._viewer.setAnnotationOption(t),this)},n.setAnnotationProp=function(t,e){this._viewer.setAnnotationProp(t,e)},n._setAnnotationType=function(t,e){t===this._viewer.getAnnotationType()&&e?this._viewer.clearAnnotationType():this._viewer.setAnnotationType(t)},n.annotationType=function(t){if(1!==arguments.length)return this._viewer.getAnnotationType();this._setAnnotationType(t)},n.addAnnotation=function(t,e){this._viewer.getPage()&&(t=this._viewer.getPage().drawingItem(t),I.isFunction(e)&&e(t))},n.addAnnotations=function(t,e){return this._viewer.getPage()&&(t=this._viewer.getPage().drawingItems(t),I.isFunction(e)&&e(t)),this},n.process=function(t,e,i){t===this.ServiceAPIMessage.PageInfoRequest&&this.serviceManager.requestData({type:t,fileId:e,pageNo:i},function(t){})},n._api=function(t,e){return this},n.pageStreaming=function(t,e){return this},n.displayToolbar=function(t,e){return this._layer.toolbarLayer&&(e?this._layer.toolbarLayer.show(t):this._layer.toolbarLayer.hide(t)),this},n.disableToolbar=function(t,e){return this._layer.toolbarLayer&&(e?this._layer.toolbarLayer.disable(t):this._layer.toolbarLayer.enable(t)),this},n.displayControl=function(t,e){return this._layer.toolbarLayer&&(e?this._layer.toolbarLayer.show(t):this._layer.toolbarLayer.hide(t)),this},n.displayAnnotation=function(t){return this._viewer.setAnnotationVisible(t),this},n.download=function(t,e,i){t=t||this._currentItem.getItemId(),e=e||this._currentItem._fileStorageType,i=i||this._currentItem.getName(),I.isNotEmpty(t)&&this.serviceManager.requestFileDownload({fileId:t,fileStorageType:e,fileName:i})},n._preProcessPrint=function(t,e,i,n){t={batchjob:{protocol:this.setting.protocol,baseURL:this.setting.hostname,port:this.setting.port,path:"",infoURI:"",streamingURI:"",items:[],pages:this.getPageListInfo(t,!0,i)},commonOption:{mediaSize:v.Type.PRINT_PAGE_TYPE.PAGE_TYPE_A4,layout:"auto",margins:null}},t=I.extend(t,this.setting.printConfig,!0);this.print(t,e)},n.printPages=function(t,e,i,n){var o,a=1===arguments.length&&"object"==typeof t&&null!==t?(o=t.type||y.PRINT_RANGE_TYPE.DEFAULT,e=t.items,i=t.params,n=t.callback,t.printConfig):(o=t||y.PRINT_RANGE_TYPE.DEFAULT,this.setting.printConfig),e=this._getPrintItem(o,e,a)||[],r=Array.isArray(e);r&&0<e.length||!r&&e?a.serviceType===y.PRINT_SERVICE_TYPE.PCAGENT||a&&a.serviceType===y.PRINT_SERVICE_TYPE.PCAGENT?(this.pcAgentServiceManager||this.initPCAgentServiceManager(a),this.printPagesByPCAgent(e,t)):this._preProcessPrint(e,n,i,o):this.notify({type:y.NOTIFICATION_TYPE.INFO,message:"인쇄 조건에 해당하는 파일이 없습니다."})},n.initPCAgentServiceManager=function(t){this.setting.printConfig=I.extend(this.setting.printConfig,t,!0),this.pcAgentServiceManager=this.createServiceManager(y.SERVICE_TYPE.PCAGENT_API,t);var e={serverUri:t.serverUri,serverContextPath:t.serverContextPath,setStreamingPass:!0};"boolean"==typeof t.streamingPass&&(e.setStreamingPass=t.streamingPass),this.pcAgentServiceManager.requestSetting(e,function(t){console.log(t)})},n.createServiceManager=function(t,e){e={protocol:e.protocol,hostname:e.hostname,port:e.port,context:e.context||"",resolve:null,reject:null,cors:e.cors,withCredentials:e.withCredentials};return new(t===y.SERVICE_TYPE.PCAGENT_API?v.PCAgentServiceManager:v.ServiceManager)(e)},n.printPagesByPCAgent=function(t,e){var i=I.extend({},this.setting.printConfig,!0),n=(i.pages=t,i.serviceManager=this.pcAgentServiceManager,this),t=(null!=e&&"object"==typeof e&&"object"==typeof e.printConfig&&(i=I.extend(i,e.printConfig,!0)),this.currentPageItem());t&&(i.currentItem={fileId:t.fileId,pageNo:t.itemPageNo}),new v.PCAgentPrintManager(i,function(t){t={fileId:t.fileIdList||[],success:t.success,message:t.message||""};t.success&&n._unselectThumbnailItems(),n.trigger("print.completed",t)}).run()},n.getPCAgentServiceManager=function(){},n.printPage=function(t,e,i){this.printPages(y.PRINT_RANGE_TYPE.PAGE,[t],e,i)},n.print=function(t,e,i){try{var n=this;0===arguments.length?this.printPages():"string"==typeof t?this._requestPageInfo(t,function(t){0!==t.statusCode&&200!==t.statusCode||(t={itemId:t.fileId,pageCount:t.pageCount},n._preProcessPrint(t,e,i))}):0<t.batchjob.pages.length&&(I.isFunction(e)||(e=function(t){t={fileId:t.fileIdList||[],success:t.success,message:""};t.success&&n._unselectThumbnailItems(),n.trigger("print.completed",t)}),t.serviceStreamingType=this.setting.serviceStreamingType,new v.PrintManager(t,e).run())}catch(t){console.log(t)}},n.clear=function(){return this._processId=I.generateUUID(),this._currentPageNo=this.setting.initPageNo||1,this._pageCount=0,this._items=[],this._currentItem=null,this._renderItem=null,this._thumbJobList=[],this._pageItems=[],this._editedPageItems=[],this._deletedPageItems=[],this._isEditMode=!1,this._triggerRequestAnnotationMap={},this._thumbJobInfo={fileItem:null,pageNo:1,pageCount:1,running:!1,thumbItems:[]},this._fileItemMap={},this._thumbnailItemMap={},this._isInfoRenderAll=!0,this._retryRotateThumbnailItems=[],this._filterPageItems=[],this._filterPageIdx=0,this._viewer.clear(),this._layer.thumbnailLayer&&(this._resetThumbJobInfo(),this._layer.thumbnailLayer.clear()),this._layer.toolbarLayer&&this._layer.toolbarLayer.clear(),this.cacheManager&&this.cacheManager.clear(),this.serviceManager&&this.serviceManager.abort(),this._angle=0,v.UI.resetLayer(o.body,"."+c+"-popup-layer"),this},n.currentPage=function(){return this._viewer.getPage()},n._getByItemId=function(t){for(var e,i,n=0,o=this._items.length,n=0;n<o;n++)if((e=this._items[n])&&e.getItemId()===t){i=e;break}return i},n.movePageByItem=function(t){var t=this._getByItemId(t);t&&(this._currentItem=t,t=this._currentItem.getPageInfo(),this.movePage(t.pageNo))},n._getFirstPageNoByItemId=function(t){var e=0,i=this.setting.fileEditConfig;if(i.remove||i.add){for(var n=0,o=this._editedPageItems.length;n<o;n++)if(this._editedPageItems[n].fileId==t){e=n+1;break}}else{i=this._getByItemId(t);i&&(e=i.getPageInfo().pageNo)}return e},n._getLastPageNoByItemId=function(t){var e=0,i=!1,n=this.setting.fileEditConfig;if(n.remove||n.add)for(var o=0,a=this._editedPageItems.length;o<a;o++){if((i=this._editedPageItems[o].fileId==t?!0:i)&&this._editedPageItems[o].fileId!=t){e=o;break}o==a-1&&i&&(e=o+1)}else{n=this._getByItemId(t);n&&(e=n.getPageInfo().pageNo+n.getPageInfo().pageCount-1)}return e},n._validMovePageNo=function(t){var e;0===this._pageCount||(e=this._editedPageItems[t-1])&&(this._isInfoRenderAll||this._currentPageNo<this._pageCount)&&this._getByItemId(e.fileId).enable()&&(e=Math.min(t,this._editedPageItems.length),this._currentPageNo=Math.max(1,e))},n._getPageItem=function(t){t=this._pageItems[t-1];return t||{fileId:this._currentItem.getPageInfo().itemId,itemPageNo:1}},n.isPageMoveKeepMultiselect=function(t){return!!this._layer.thumbnailLayer&&(this._layer.thumbnailLayer._settings.keepMultiselect&&"multiselect"===t)},n.movePage=function(t,e){var i,n,o,a,r;e&&(I.isFunction(e)?i=e:n=(e=e||{}).triggerType),n!=y.PAGEMOVE_TRIGGER_TYPE.PRELOAD&&(0<t&&(t=Math.max(t,1),this._validMovePageNo(t)),e=this.isPageMoveKeepMultiselect(n),0<t&&0<this._currentPageNo&&this._currentPageNo<=this._pageCount?(o=this._getOriginalPageNo(),r=this._getPage(o),a=this._getPageItem(o),r&&r.getImageFile()?(this._viewer.movePage(o),this._currentItem.setPageInfo("currentPageNo",a?a.itemPageNo:1),this.trigger("pagemove.complete",{pageNo:t})):a.isReqStreaming||(r={fileId:a.fileId,pageNo:a.itemPageNo,fileStorageType:a.fileStorageType||""},this._currentItem=this._getByItemId(r.fileId),r.triggerType=n,this._requestPageStreaming(r,i),a.isReqStreaming=!0),this._layer.thumbnailLayer&&(this._layer.thumbnailLayer.activeItem(this._layer.thumbnailLayer.getRenderItem(o)),e||this._unselectThumbnailItems())):((this._isInfoRenderAll||this._currentPageNo<this._pageCount)&&(this._currentPageNo=0),this._hidePage()),this._displayPageNo())},n._hidePage=function(){this.currentPage()&&this.currentPage().hide(),this._displayPageNo()},n.addItem=function(t){var e,i=this._items.length,n=[],o=0;if(a.Array.isArray(t))for(o=0,e=t.length;o<e;o++)n.push(this._createFileItem(t[o],i+o));else t instanceof v.core.DocItem?this._requestDocInfo(t):n.push(this._createFileItem(t,i));return 0<n.length&&this._setItem(n),this},n._getThumbnailItem=function(t){return this._thumbnailItemMap[t.fileId]?this._thumbnailItemMap[t.fileId][t.itemPageNo]:null},n._setThumbnailItem=function(t){return void 0===this._thumbnailItemMap[t.fileId]&&(this._thumbnailItemMap[t.fileId]={},this._thumbnailItemMap[t.fileId][t.itemPageNo]={fileId:t.fileId,itemPageNo:t.itemPageNo,pageNo:t.pageNo}),this},n._addThumbnailItem=function(t){return this._getThumbnailItem(t)||(this._setThumbnailItem(t),this._layer.thumbnailLayer.setting("async")?this._layer.thumbnailLayer.addItemAndRender(t):this._layer.thumbnailLayer.addItem(t)),!0},n.render=function(){this._isInfoRenderAll&&this._nextItemRender()},n._nextItemRender=function(){for(var t,e=0,i=this._items.length,n=0,e=0;e<i;e++)if((t=this._items[e])&&!t.isLoaded()){n++,this._isInfoRenderAll=!1,this._render(t);break}0<i&&0===n&&(this.getThumbnailViewer()&&!this.getThumbnailViewer().setting("async")&&(this.getThumbnailViewer().render(),this._retryRotateThumbnailItem()),this.trigger("item.render.complete",this.setting.container),this.setting.preloadImage.enabled&&this.loadPages())},n.renderAll=function(){this._nextItemRender()},n._isAPIService=function(){return this.setting.serviceType===v.Type.SERVICE_TYPE.API||this.setting.serviceType===v.Type.SERVICE_TYPE.PCAGENT_API},n._requestPageStreaming=function(t,e){this._isAPIService()?a.Uint8Array&&"body"===this.setting.serviceStreamingType?this._requestPageStreamingByBody(t,e):this._requestPageStreamingByURI(t,e):(this._setPage(this._currentItem,{fileId:this._currentItem.getItemId(),pageNo:1,type:"url",data:this._currentItem.getItemId(),width:700,height:700},this._currentPageNo,t.keepMultiselect),this.appendThumbnail(this._currentItem),this._loadComplete(this._currentItem))},n._requestAnnotation=function(i){var n=this;i.annotationId&&this._viewer.setting("annotationEnable")&&(this._triggerRequestAnnotationMap[i.annotationId]||(this._triggerRequestAnnotationMap[i.annotationId]={}),!0!==this._triggerRequestAnnotationMap[i.annotationId][i.pageNo]&&(this._triggerRequestAnnotationMap[i.annotationId][i.pageNo]=!0,this.serviceManager.requestAnnotation(i,function(t){var e={fileId:t.fileId,pageNo:t.pageNo,annotationId:t.annotationId,data:t.annotation},e=(n._viewer.setAnnData(e),{pageNo:i.pageNo,data:t.annotation});n.trigger("page.annotation.load.draw.complete",e)})))},n._requestPageStreamingByBody=function(i,n){var o=this;this.serviceManager.requestPageStreaming(i,function(t){var t={type:"base64",data:I.createDataUrl("image/jpg",I.arrayBufferToBase64(t)),fileName:t.fileName,mimeType:"image/jpg",fileId:i.fileId,pageNo:i.pageNo,fileStorageType:i.fileStorageType||""},e=i.triggerType==y.PAGEMOVE_TRIGGER_TYPE.PRELOAD?i.originalPageNo:o._getOriginalPageNo();o._setPage(o._renderItem,t,e,i.triggerType),I.isFunction(n)&&n({event:"page.load.complete",fileId:i.fileId,pageNo:i.pageNo})},function(t){console.log(t)})},n._getPage=function(t){return t=Math.max(t,1),this._viewer.getPage(t-1)},n._setPage=function(t,e,i,n){var o=this._getPage(i);try{o?o.getImageFile()||o.setImageData(e):o=this._addPage(t,e,i),this.cacheManager&&this.cacheManager.load(i,{itemId:t.getItemId(),pageNo:i}),this.movePage(this._currentPageNo,{triggerType:n})}catch(t){console.log(t,o)}this._displayPageNo()},n._generatePageIndex=function(t){return I.isNumeric(t)?t-1:null},n._addPage=function(t,e,i){var n,o;if(this._processId===t.processId)return this._viewer.data("angle",this._angle),o=this.getPageItem(i-1),n=t.getRotate(),o&&(n=I.toNotEmpty(o.rotate,t.getRotate()),n=I.isNumeric(n)?I.toInt(n):0),o=this._viewer.addPage(this._generatePageIndex(i),n),e&&(o.setImageData(e),t.pageNo=o.pageNo()),o},n._removePage=function(t){this._viewer.removePage(t-1);t=this._getPageItem(t);return t&&(t.isReqStreaming=!1),this},n.removePageByItemId=function(t){var e,i=this._getByItemId(t);if(i){for(var n=0,o=this._items||[],a=o.length,n=0;n<a;n++)(e=o[n])&&e.getItemId()!==t&&this._items.push(e);for(a=(o=this._pageItems||[]).length,n=n=0;n<a;n++)(e=o[n])&&e.fileId!==t&&this._pageItems.push(e);var i=i.getPageInfo(),r=i.pageNo+i.pageCount-1;for(n=i.pageNo;n<=r;n++)this._viewer.removePage(n-1);this._layer.thumbnailLayer&&this._layer.thumbnailLayer.removeByItemId(t)}return this},n._requestPageStreamingByURI=function(t,e){var i={fileId:encodeURIComponent(t.fileId),type:v.ServiceAPIMessage.PageStreamRequestByPost,pageNo:t.pageNo,fileStorageType:t.fileStorageType||""},n=this.serviceManager.createRequestUrl(i)+"?"+this.serviceManager.paramToString(i,!0)+"&t="+(new Date).getTime(),n={fileId:t.fileId,pageNo:t.pageNo,type:"url",data:n,fileName:i.fileId+"_"+i.pageNo},i=t.triggerType==y.PAGEMOVE_TRIGGER_TYPE.PRELOAD?t.originalPageNo:this._getOriginalPageNo();this._setPage(this._renderItem,n,i,t.triggerType),I.isFunction(e)&&e({event:"page.load.complete",fileId:t.fileId,pageNo:t.pageNo})},n._displayPageNo=function(t){var e,i,n,o,a;this._layer.toolbarLayer&&(i=1,n=0,this.setting.paginateUnit===v.Type.PaginateUnit.FILE?(this._editedPageItems[this._currentPageNo-1]&&this._layer.thumbnailLayer&&(o=this._layer.thumbnailLayer._getItemByNewPageNo(this._currentPageNo).newItemPageNo,a=this._layer.thumbnailLayer._getItemByNewPageNo(this._currentPageNo).newItemPageCount),this.currentItem()&&(e=this.currentItem().getPageInfo(),i=o||e.currentPageNo,n=a||e.pageCount)):n=0<this._filterPageItems.length?(this._filterPageIdx=this.getFilterIndexByPageNo(this._viewer.pageNo()),i=this._filterPageIdx+1,this._filterPageItems.length):(i=this._currentPageNo,this._pageCount),o=this._layer.toolbarLayer.currentPageNoNode(),a=this._layer.toolbarLayer.totalPageNoNode(),o&&(o.value=0<this._pageCount&&0<this._currentPageNo?i:""),a&&(a.value=0<this._pageCount&&0<this._currentPageNo?n:""))},n._resizeByType=function(t,e){this._viewerType=t;var i=this._layer.toolbarLayer,n=0,o=0,i=(i&&(i._toolbarNodeMap.headerNode&&(n=i._toolbarNodeMap.headerNode.offsetHeight+1),i._toolbarNodeMap.footerNode&&(o=i._toolbarNodeMap.footerNode.offsetHeight+1),this._layer.containerLayer.style.top=n+"px",this._layer.containerLayer.style.bottom=o+"px"),this._layer.thumbnailLayer?this._layer.thumbnailLayer.setting("width"):0),n=this._layer.thumbnailLayer?this._layer.thumbnailLayer.setting("height"):0,o=h.offset(this._layer.containerLayer),a=o.width,o=o.height,r=a,s=o,l=this._layer.thumbnailLayer?I.toNotEmpty(this._layer.thumbnailLayer.setting("controlPosition"),3):3;t===y.ViewerType.IMAGE?(n=i=0,l===y.CONTROL_POSITION_TYPE.TOP?this._viewer._containerNode.style.top="0px":l===y.CONTROL_POSITION_TYPE.RIGHT?this._viewer._containerNode.style.right="0px":l===y.CONTROL_POSITION_TYPE.BOTTOM?this._viewer._containerNode.style.bottom="0px":this._viewer._containerNode.style.left="0px"):t===y.ViewerType.THUMBNAIL?(i=a,n=o,r=0):l===y.CONTROL_POSITION_TYPE.TOP?(this._viewer._containerNode.style.top=n+"px",this._viewer._containerNode.style.left="0px",r=i=a,s=o-n):l===y.CONTROL_POSITION_TYPE.RIGHT?(this._viewer._containerNode.style.top="0px",this._viewer._containerNode.style.right="",this._viewer._containerNode.style.left="0px",this._viewer._containerNode.style.bottom="0px",r=a-(i+5),n=s):l===y.CONTROL_POSITION_TYPE.BOTTOM?(this._viewer._containerNode.style.top="0px",this._viewer._containerNode.style.left="0px",this._viewer._containerNode.style.bottom="",r=i=a,s=o-n):(this._viewer._containerNode.style.top="0px",this._viewer._containerNode.style.left=i+"px",r=a-(i+5),n=s),this._layer.thumbnailLayer&&(t===y.ViewerType.THUMBNAIL?h.addClass(this._layer.thumbnailLayer._containerNode,c+"-thumbnail-full"):h.removeClass(this._layer.thumbnailLayer._containerNode,c+"-thumbnail-full"),this._layer.thumbnailLayer.resize(i,n,!1,e)),this._layer.toolbarLayer&&this._layer.toolbarLayer.refresh(),this._viewer.updatePosition(r,s)},n.movePrevPage=function(){var t,e,i=-1;0<this._filterPageItems.length?(t=this._filterPageIdx-1,(e=this._filterPageItems[t])?(i=e.pageNo,this._filterPageIdx=t):i=this._filterPageItems[0].pageNo):i=this._currentPageNo-1,i=Math.max(i,1),this.movePage(i)},n.moveNextPage=function(){var t,e,i=-1,n=this._filterPageItems.length;0<n?(t=this._filterPageIdx+1,(e=this._filterPageItems[t])?(i=e.pageNo,this._filterPageIdx=t):i=this._filterPageItems[n-1].pageNo):i=this._currentPageNo+1,this.movePage(i)},n.removeItem=function(t){this.currentPage()&&this.currentPage().removeItem(t)},n.addThumbnail=function(){},n.removeThumbnail=function(){},n._itemSave=function(a,r){r="boolean"!=typeof r||r;for(var o,p=this._viewer.pageList,d=p.length,s=this,g=v.setting("notifications"),l=[],h=[],u=!1,t={},f=0;f<d;f++){var e,i,n=p[f],u=!1;n&&(!(e=n.getAnnotation())||(n=n.getImageFile())&&((i=this._getFileItem(n.getFileId())).isPresetAnnotationId()?e&&0<e.getItem().length&&(u=!0):(I.isNotEmpty(i.getAnnotationId())||e&&0<e.getItem().length)&&(u=!0),u&&(t[n.getFileId()]||(t[n.getFileId()]={fileId:n.getFileId(),annotationId:i.getAnnotationId(),annotationType:i.getAnnotationType(),fileStorageType:i.getFileStorageType(),annotationMap:{}}),t[n.getFileId()].annotationMap[n.getPageNo()]=e.itemsToJSON())))}for(o in t)l.push(t[o]);var m=l.length,c=0,y="주석 정보가 저장되었습니다.";0===m?I.isFunction(a)&&a(h):function o(){var t,e;0!==l.length&&(t=l[0],e=s._getFileItem(t.fileId),I.isNotEmpty(e.getAnnotationId())&&(t.annotationId=e.getAnnotationId()),s._requestAnnotationSave(t,function(t){var e,i={fileId:t.fileId,annotationId:null,success:!1},n=s._getFileItem(t.fileId);n&&(n.setAnnotationId(t.annotationId),n.setPresetAnnotationId(!1),i.annotationId=t.annotationId,i.success=!0),500!==t.statusCode&&!t.errorCode||(c+=1),h.push(i),l.shift(),0<l.length?o():(0<m&&0<c&&(r=!0,y="주석 정보 저장을 실패했습니다. <br/>* 처리: "+m+"건&nbsp;(성공:&nbsp;"+(m-c)+"건&nbsp;/&nbsp;실패:&nbsp;"+c+"건)"),I.isFunction(a)?a(h):s.trigger("save.annotation.complete",h),r&&(g.fade&&0===c&&(e=g.timeout),v.UI.message(y,null,null,e)))}))}()},n.annotationToJSON=function(){for(var t=this._viewer.pageList,e=t.length,i=[],n=0;n<e;n++){var o=t[n];!o||(o=o.getAnnotation())&&i.push(o.itemsToJSON())}return i},n._requestAnnotationSave=function(t,e){this.serviceManager.requestAnnotationSave(t,e,function(t){})},n.saveMasking=function(t){this._maskSave(t)},n._maskSave=function(n){for(var c=this._viewer.pageList,p=c.length,d=this,o=(v.setting("notifications"),v.setting("annotationConfig").mask,[]),a=[],g="",t=0;t<p;t++){var e=c[t];if(e){var i=e.getItems();if(i){var r=e.getImageFile();if(r){for(var s,l=[],h=0;h<i.length;h++)i[h]._attr.anntype===y.AnnotationType.MASK&&(s=i[h].attrToJson(),s={pageNo:r.getPageNo(),x:s.x,y:s.y,width:s.width,height:s.height},l.push(s));if(0<l.length){e=this._getFileItem(r.getFileId());if(g!=r.getFileId()){e={fileId:r.getFileId(),maskList:l,fileStorageType:e.getFileStorageType(),addOption:e.getFileStorageAddOption()};o.push(e),g=r.getFileId()}else for(var u=o[o.length-1],h=0;h<l.length;h++)u.maskList.push(l[h])}}}}}var f=o.length,m=0;0===f?I.isFunction(n)&&n(a):function e(){var i;0!==o.length&&(i=o[0],d._requestMaskSave(i,function(t){500!==t.statusCode&&!t.errorCode||(m+=1),t={fileId:i.fileId,newFileId:t.fileId,success:!0},a.push(t),o.shift(),0<o.length?e():(0<f&&0<m&&0,I.isFunction(n)?n(a):d.trigger("save.mask.complete",a))}))}()},n._requestMaskSave=function(t,e){this.serviceManager.requestMaskSave(t,e,function(t){})},n.annotationPermanence=function(t){this._annotationPermanence(t)},n._annotationPermanence=function(a){for(var r=this,s=(v.setting("notifications"),[]),l=[],t=0;t<this._items.length;t++){var e=this._items[t];I.isNotEmpty(e.getAnnotationId())&&(e={fileId:e.getItemId(),annotationId:e.getAnnotationId(),fileStorageType:e.getFileStorageType(),annotationType:e.getAnnotationType(),addOption:e.getFileStorageAddOption()},s.push(e))}var h=s.length,c=0;0===h?I.isFunction(a)&&a(l):function n(){var o;0!==s.length&&(o=s[0],r._getFileItem(o.fileId),r._requestAnnotationPermanence(o,function(t){var e={fileId:o.fileId,newFileId:t.fileId,annotationId:o.annotationId,newAnnotationId:t.annotationId,success:!1},i=r._getFileItem(t.fileId);i&&(i.setAnnotationId(t.annotationId),i.setPresetAnnotationId(!1),e.annotationId=t.annotationId,e.success=!0),500!==t.statusCode&&!t.errorCode||(c+=1),l.push(e),s.shift(),0<s.length?n():(0<h&&0<c&&0,I.isFunction(a)?a(l):r.trigger("annotation.permanence.complete",l))}))}()},n._requestAnnotationPermanence=function(t,e){this.serviceManager.requestAnnotationPermanence(t,e,function(t){})},n.fileSplit=function(r){for(var s=this,l=[],h=[],t=0;t<this._items.length;t++){var e={fileId:(e=this._items[t]).getItemId(),annotationId:e.getAnnotationId(),fileStorageType:e.getFileStorageType(),addOption:e.getFileStorageAddOption()};l.push(e)}var i=l.length;0===i?I.isFunction(r)&&r(h):function o(){var a;0!==l.length&&(a=l[0],s._requestFileSplit(a,function(t){var e={fileId:a.fileId,annotationId:a.annotationId,fileStorageType:a.fileStorageType,addOption:a.addOption,newFileAnnotationList:[],success:!1};if(500===t.statusCode||t.errorCode)0;else{var i=t.fileAnnotationList;if(i){for(var n=0;n<i.length;n++)e.newFileAnnotationList.push({fileId:i[n].fileId,annotationId:i[n].annotationId});i.length}e.success=!0}h.push(e),l.shift(),0<l.length?o():I.isFunction(r)?r(h):s.trigger("file.split.complete",h)}))}()},n._requestFileSplit=function(t,e){this.serviceManager.requestFileSplit(t,e,function(t){})},n.fileMerge=function(e){for(var i,n=this,t=v.setting("serviceManagerConfig").merge,o=[],a={fileAnnotationList:[],fileStorageType:null,addOption:null,overwrite:t.overwrite},r=n._layer.thumbnailLayer.activeItem(),s=0;s<this._items.length;s++){var l=this._items[s];a.fileAnnotationList.push({fileId:l.getItemId(),annotationId:l.getAnnotationId()}),l.getItemId()===r.fileId&&(a.fileStorageType=l.getFileStorageType(),a.addOption=l.getFileStorageAddOption())}0===a.fileAnnotationList.length?I.isFunction(e)&&e(o):(t=t.overwrite,0!==a.fileAnnotationList.length&&(a.overwrite=t,n._requestFileMerge(i=a,function(t){o={fileAnnotationList:i.fileAnnotationList,fileStorageType:i.fileStorageType,addOption:i.addOption,newFileId:null,newAnnotationId:null,success:!1},500===t.statusCode||t.errorCode?console.log(t.errorCode):(o.newFileId=t.fileId,o.newAnnotationId=t.annotationId,o.success=!0),I.isFunction(e)?e(o):n.trigger("file.merge.complete",o)})))},n._requestFileMerge=function(t,e){this.serviceManager.requestFileMerge(t,e,function(t){})},n._fileSave=function(n){for(var o=this,c=o._items,t=o._editedPageItems,p=o._deletedPageItems,d=!1,a=[],r=[],g={},u=0;u<c.length;u++){var e=c[u],i={fileId:e.getItemId(),annotationId:e.getAnnotationId()?e.getAnnotationId():null,pageList:[],deleteList:[],addPageList:[],fileStorageType:e.getFileStorageType(),addOption:e.getFileStorageAddOption(),isSaveFile:!1,fileType:e.getType()};g[e.getItemId()]=i,a.push(i)}for(var s=0;s<t.length;s++){var i=g[t[s].fileId],f={pageNo:t[s].itemPageNo,rotate:t[s].rotate<0?360+t[s].rotate:t[s].rotate,annotation:null,crop:null},l=o._viewer.pageList[t[s].pageNo-1];l&&l.getImageFile()&&((l=l.getAnnotation())&&l.getItem()&&(i.annotationId||l.itemsToJSON()&&0<l.itemsToJSON().length)&&(f.annotation=l.itemsToJSON(),i.isSaveFile=!0)),i.pageList.push(f),(t[s]!=o._pageItems[s]||0<t[s].rotate)&&(i.isSaveFile=!0),"pdf"==i.fileType&&0<t[s].rotate&&(d=!0)}for(var h=0;h<p.length;h++)(i=g[p[h].fileId]).deleteList.push(p[h].itemPageNo),i.isSaveFile=!0;function m(){var i;0!==a.length&&(i=a[0],o._requestFileEdit(i,function(t){var e={fileId:i.fileId,newFileId:t.fileId,annotationId:i.annotationId,newAnnotationId:t.annotationId,fileStorageType:i.fileStorageType,success:!1};500===t.statusCode||t.errorCode?console.log(t.errorCode):e.success=!0,r.push(e),a.shift(),0<a.length?m():(o._isEditMode=!1,I.isFunction(n)?n(r):o.trigger("save.file.complete",r))}))}0===a.length?I.isFunction(n)&&n(r):d?v.UI.confirm("회전된 장표가 있는 PDF 파일은 텍스트 기반에서 이미지 기반 PDF 파일로 변환되어 저장됩니다.",m):m()},n._requestFileEdit=function(t,e){this.serviceManager.requestFileEdit(t,e,function(t){})},n.cropImage=function(t){return this.currentPage()?this.currentPage().cropImage(t):""},n.getPages=function(){for(var t=this._viewer.pageList,e=t.length,i=[],n=0;n<e;n++){var o=t[n];o&&i.push(o)}return i},n.setAnnotationConfig=function(t){return v.setting({annotationConfig:t}),this},n.setServiceManagerConfig=function(t){return v.setting({serviceManagerConfig:t}),this},n._chanteItemStatus=function(){},n.itemFilter=function(t){for(var e,i,n,o,a={},r=0,s=this._items.length;r<s;r++)e=this._items[r],i=!0,I.isNotEmpty(t.itemId)&&e.getItemId()!==t.itemId&&(i=!1),I.isNotEmpty(t.docFormCode)&&e.getDocFormCode()!==t.docFormCode&&(i=!1),e.enable(i),this._layer.thumbnailLayer&&(i?this._layer.thumbnailLayer.show(e.getItemId()):this._layer.thumbnailLayer.hide(e.getItemId()),this._layer.thumbnailLayer.refresh()),e.enable()&&(a[e.getItemId()]=e.enable()),i&&void 0===n&&(n=e);for(o in this._filterPageItems=[],this._filterPageIdx=0,this._pageItems){var l=this._pageItems[o];a[l.fileId]&&this._filterPageItems.push(l)}n&&(this._currentItem=n,this.movePageByItem(n.getItemId())),void 0===n&&(this.notify({type:y.NOTIFICATION_TYPE.INFO,message:"검색 조건에 해당하는 파일이 없습니다."}),this.movePage(-1))},n.getFilterIndexByPageNo=function(t){var e,i=-1;for(e in this._filterPageItems)if(this._filterPageItems[e].pageNo===t){i=I.toInt(e);break}return i},n.refresh=function(t,e){t=t||this._viewerType,this._resizeByType(t,e)},n.scrollToAnnotation=function(t){this._viewer.scrollToAnnotation(t)},n.pageNo=function(t){return 1===arguments.length?(this.setting.initPageNo=t,this._currentPageNo=this.setting.initPageNo,this):this._currentPageNo},n.pageCount=function(){return this._pageCount},n.getThumbnailViewer=function(){return this._layer.thumbnailLayer},n._getSelectedThumbnailItems=function(){var t=[];return t=this._layer.thumbnailLayer?this._layer.thumbnailLayer.selectItem():t},n._unselectThumbnailItems=function(){if(this._layer.thumbnailLayer)return this._layer.thumbnailLayer.unselectItems()},n._getOriginalPageNo=function(t){return 0==arguments.length&&(t=this._currentPageNo),this._editedPageItems[t-1].pageNo},n._getPrintItem=function(t,e,i){e=e||[];var n,o,c=this,a=(i&&"boolean"==typeof i.withAnnotations?i:this.setting.printConfig).withAnnotations,r=(t=0===arguments.length||t===y.PRINT_RANGE_TYPE.DEFAULT?this._getSelectedThumbnailItems()&&0<this._getSelectedThumbnailItems().length?y.PRINT_RANGE_TYPE.SELECTION:y.PRINT_RANGE_TYPE.DEFAULT:y.PRINT_RANGE_TYPE[""+t.toUpperCase()]||y.PRINT_RANGE_TYPE.DEFAULT,[]),s=0;if(e=e||[],t===y.PRINT_RANGE_TYPE.CUSTOM&&0<e.length?e.forEach(function(t,e){(n=c._pageItems[t-1])&&0<n.itemPageNo&&0<n.itemPageCount&&r.push({fileId:n.fileId,annotationId:a&&n.annotationId||"",pageNo:n.itemPageNo,rotate:n?n.rotate:0,fileStorageType:n.fileStorageType||""})}):t===y.PRINT_RANGE_TYPE.FILE&&0==e.length?(o=this.currentItem(),this._pageItems.forEach(function(t,e){t.fileId==o.getItemId()&&r.push({fileId:t.fileId,annotationId:a&&t.annotationId||"",pageNo:t.itemPageNo,rotate:t.rotate,fileStorageType:t.fileStorageType})})):t===y.PRINT_RANGE_TYPE.FILE&&0<e.length?e.forEach(function(t,e){var i=c._getByItemId(t);if(i){var n=i.getPageInfo();for(s=0;s<n.pageCount;s++)r.push({fileId:i.getItemId(),annotationId:a?i.getAnnotationId():"",fileStorageType:i.getFileStorageType(),pageNo:s+1})}}):t===y.PRINT_RANGE_TYPE.SELECTION?(this._getSelectedThumbnailItems()||[]).forEach(function(t,e){n=c._pageItems[t.pageNo-1],0<t.itemPageNo&&0<t.itemPageCount&&r.push({fileId:t.fileId,annotationId:a&&t.annotationId||"",pageNo:t.itemPageNo,rotate:n?n.rotate:0,fileStorageType:n.fileStorageType||""})}):t===y.PRINT_RANGE_TYPE.PAGE?(i=0<e.length?I.toInt(e[0]):this._getOriginalPageNo(),(n=this._pageItems[i-1])&&0<n.itemPageNo&&0<n.itemPageCount&&(r=[{fileId:n.fileId,annotationId:a&&n.annotationId||"",pageNo:n.itemPageNo,rotate:n.rotate,fileStorageType:n.fileStorageType}])):t===y.PRINT_RANGE_TYPE.ALL?this._pageItems.forEach(function(t,e){0<t.itemPageNo&&0<t.itemPageCount&&r.push({fileId:t.fileId,annotationId:a&&t.annotationId||"",pageNo:t.itemPageNo,rotate:t.rotate,fileStorageType:t.fileStorageType})}):(o=this.currentItem())&&(e=o.getPageInfo(),n=this._pageItems[e.pageNo-1],r=[{fileId:n.fileId,annotationId:a&&n.annotationId||"",pageNo:n.itemPageNo,rotate:n?n.rotate:0,fileStorageType:n.fileStorageType||""}]),a)for(var l,p,h,s=0,d=r.length;s<d;s++)l=r[s],(h=this._getByItemId(l.fileId)).getPageInfo()&&(h=h.getPageInfo().pageNo+l.pageNo-1,(h=this._viewer.getPage(h-1))&&(p=h.getAnnotation())&&(l.annotations=p.itemsToJSON(),r[s]=l));return r},n.currentItem=function(){var t=this._editedPageItems[this._currentPageNo-1];return t&&this._currentItem&&this._currentItem.getItemId()!==t.fileId&&(this._currentItem=this._getByItemId(t.fileId)),this._currentItem},n.currentPageItem=function(){var t=this._editedPageItems[this._currentPageNo-1];if(t&&this._currentItem)return t},n._setRotationInPageItem=function(c,t,p){var e,i,n,o,a=0,r=[],s=this._getSelectedThumbnailItems()||[],l=0,h=(t=t||{}).degrees||0;if(0<s.length)for(a=0,l=0;l<s.length;l++)e=(i=s[l]).pageNo-1,n=this._pageItems[e],0<i.pageNo&&(a=(o=this._viewer.getPage(n.pageNo-1))?(this._currentPageNo!==i.newPageNo&&o.angle(h),o.angle()):this._pageItems[e].rotate+h),n.rotate!==a&&(this._pageItems[e].rotate=a,n.rotate=a,this.rotateThumbnailItem(n)),r.push(n);else if(t.applyAll)for(l=0;l<this._pageItems.length;l++)0<(n=this._pageItems[l]).pageNo&&(a=(o=this._viewer.getPage(n.pageNo-1))?o.angle():(n.rotate+h)%360,n.rotate!==a&&(this._pageItems[l].rotate=a,n.rotate=a,this.rotateThumbnailItem(n)),r.push(n));else 0<(n=this._editedPageItems[this._currentPageNo-1]).pageNo&&(o=this._viewer.getPage(n.pageNo-1))&&(a=o.angle(),n.rotate!==a&&(this._editedPageItems[this._currentPageNo-1].rotate=a,n.rotate=a,this.rotateThumbnailItem(n)),r.push(n));c&&this.trigger("change.rotate.complete",r)},n.rotateThumbnailItem=function(t){var e;this._layer.thumbnailLayer&&((e=this._layer.thumbnailLayer.getRenderItem(t.pageNo))?(e.rotate=t.rotate,this._layer.thumbnailLayer.rotate(e)):(this._retryRotateThumbnailItems=this._retryRotateThumbnailItems||[],this._retryRotateThumbnailItems.push(t)))},n._retryRotateThumbnailItem=function(){var i=this,t=this._retryRotateThumbnailItems||[];0<t.length&&(t.forEach(function(t,e){i.rotateThumbnailItem(t)}),this._retryRotateThumbnailItems=[])},n.getPageItem=function(t){return 0===arguments.length?this._pageItems:this._pageItems[t]},n.setViewerConfig=function(t,e){return this._viewer.setting(t,e),this},n.getToolbarLayer=function(){return this._layer.toolbarLayer},n.viewerType=function(t){return 1===arguments.length?(this._viewerType=t,this):this._viewerType},n.saveAnnotation=function(t,e){this._itemSave(t,e)},n.getPageByItemId=function(t){t=this._getByItemId(t);if(t){t=this._getPage(t.getPageInfo().pageNo);if(t)return t}return null},n.startCrop=function(t){this.controlType()===y.ControlType.CROP?this.controlType(y.ControlType.NONE):(this.controlType(y.ControlType.CROP),I.isFunction(t)&&(this.off("file.crop.complete"),this.on("file.crop.complete",t)))},n.viewer=function(){return this._viewer},n.securityLevel=function(t){return 0<arguments.length?(this._viewer.securityLevel(t),this):this._viewer.securityLevel()},n.saveFile=function(t){var e=this.setting.fileEditConfig;(e.rotate||e.move||e.remove||e.add)&&this._fileSave(t)},n.removeSelectedPages=function(t){var e=this._layer.thumbnailLayer._removeSelectItem();I.isFunction(t)&&t(e)},n.hasAnnotationContent=function(t){for(var e=!1,i=this._viewer.pageList,n=i.length,o=0;o<n;o++){var a=i[o];if(a){a=a.getAnnotation();if(a)for(var r=a.itemsToJSON(),s=0;s<r.length;s++)if(-1!==t.indexOf(r[s].anntype)){e=!0;break}}if(e)break}return e},n.addFileAddOptionData=function(t,e){var i,n=0,o=0,a=[],r=Object.keys(t);for(e?a.push(this._getFileItem(e)):a=this._items,i=a.length,n=0;n<i;n++){var s=a[n].getFileStorageAddOption();if(s.datas)for(o=0;o<r.length;o++)s.datas[r[o]]=t[r[o]];else s.datas=t}},n.clearFileAddOptionData=function(t){var e,i=0,n=[];for(t?n.push(this._getFileItem(t)):n=this._items,e=n.length,i=0;i<e;i++)n[i].getFileStorageAddOption().datas=null},n.serviceManagerOption=function(t,e){var i={protocol:this.setting.protocol,hostname:this.setting.hostname,port:this.setting.port,context:this.setting.context,serviceType:this.setting.serviceType},i=(t=I.extend(i,t,!0),!1),n={success:!0,message:""},o={serverUri:t.serverUri,serverContextPath:t.serverContextPath,setStreamingPass:!0};"boolean"==typeof t.streamingPass&&(o.setStreamingPass=t.streamingPass),t=I.extend(t,o,!0),this.setting.serviceType===v.Type.SERVICE_TYPE.PCAGENT_API?(i=!0,this.serviceManager.setOptions(t,function(t){200!==t.statusCode&&(console.log(t),n.success=!1,n.message=t.message),I.isFunction(e)&&e(n)})):this.serviceManager.setOptions(t),this.pcAgentServiceManager&&this.pcAgentServiceManager!=this.serviceManager&&(i=!0,this.pcAgentServiceManager.requestSetting(t,function(t){200!==t.statusCode&&(console.log(t),n.success=!1,n.message=t.message),I.isFunction(e)&&e(n)})),i||I.isFunction(e)&&e(n)},n.reloadImageByPageNo=function(t){var e,i,n=this.getThumbnailViewer(),n=(n&&n.reloadThumbnailByPageNo(t),this._getPage(t));!n||(t=n.getImageFile())&&(e=(e=t.getDataUrl()).split("&t")[0]+"&t="+(new Date).getTime(),(i=this._getByItemId(t.getFileId())).getAnnotationId()&&this._triggerRequestAnnotationMap[i.getAnnotationId()]&&(this._triggerRequestAnnotationMap[i.getAnnotationId()][t.getPageNo()]=null),i={fileId:t.getFileId(),pageNo:t.getPageNo(),type:"url",data:e,fileName:t.getFileId()+"_"+t.getPageNo()},n.reloadImage(i))},n.loadPages=function(t){if(this.setting.preloadImage.enabled){if(this._isInfoRenderAll)for(var e,i,n=[],o=(1==arguments.length?n[0]=t:n=this._pageItems,0),a=n.length,r=[],o=0;o<a;o++)(i=n[o])&&0<i.pageNo&&(i.isReqStreaming||(e=this._getOriginalPageNo(i.pageNo),r.push({fileId:i.fileId,pageNo:i.itemPageNo,originalPageNo:e,fileStorageType:i.fileStorageType||"",triggerType:y.PAGEMOVE_TRIGGER_TYPE.PRELOAD})));var s,l=this;0<r.length&&!function i(){s=setTimeout(function(){clearTimeout(s);var t=r.shift(),e=l._getPageItem(t.originalPageNo);e&&(l._requestPageStreaming(t,null),e.isReqStreaming=!0),0<r.length&&i()},20)}()}},v.Controller=e,v.Controller.prototype.constructor=e.prototype,v.Controller}),function(t){function g(t,e){return t-e}function u(){for(var t=0,e=this.length;t<e;t++)if(void 0!==this[t])return this[t]}function A(){for(var t=this.length;--t;)if(void 0!==this[t])return this[t]}function f(t,e){t=String(t);var i,c=y,n=Array.prototype.slice.call(arguments,2),o=f.listeners(t),a=0,r=[],s={},l=[],p=m;l.firstDefined=u,l.lastDefined=A,m=t;for(var h=y=0,d=o.length;h<d;h++)"zIndex"in o[h]&&(r.push(o[h].zIndex),o[h].zIndex<0&&(s[o[h].zIndex]=o[h]));for(r.sort(g);r[a]<0;)if(i=s[r[a++]],l.push(i.apply(e,n)),y)return y=c,l;for(h=0;h<d;h++)if("zIndex"in(i=o[h]))if(i.zIndex==r[a]){if(l.push(i.apply(e,n)),y)break;do{if((i=s[r[++a]])&&l.push(i.apply(e,n)),y)break}while(i)}else s[i.zIndex]=i;else if(l.push(i.apply(e,n)),y)break;return y=c,m=p,l}var m,y,d="hasOwnProperty",v=/[\.\/]/,I=/\s*,\s*/,_={n:{}};f._events=_,f.listeners=function(c){for(var t,e,i,n,o,a,r,p=c.split(v),s=[_],l=[],h=0,d=p.length;h<d;h++){for(r=[],o=0,a=s.length;o<a;o++)for(i=[(t=s[o].n)[p[h]],t["*"]],n=2;n--;)(e=i[n])&&(r.push(e),l=l.concat(e.f||[]));s=r}return l},f.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var i=t.split(I),n=0,o=i.length;n<o;n++){h=l=a=s=r=void 0;for(var a,r=i[n].split(v),s=_,l=0,h=r.length;l<h;l++)s=(s=s.n).hasOwnProperty(r[l])&&s[r[l]]||(s[r[l]]={n:{}});for(s.f=s.f||[],l=0,h=s.f.length;l<h;l++)if(s.f[l]==e){a=!0;break}a||s.f.push(e)}return function(t){+t==+t&&(e.zIndex=+t)}},f.f=function(t){var e=[].slice.call(arguments,1);return function(){f.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},f.stop=function(){y=1},f.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(m):m},f.nts=function(){return m.split(v)},f.off=f.unbind=function(c,t){if(c)if(1<(r=c.split(I)).length)for(var e=0,i=r.length;e<i;e++)f.off(r[e],t);else{var n,o,a,r=c.split(v),s=[_];for(e=0,i=r.length;e<i;e++)for(h=0;h<s.length;h+=a.length-2){if(a=[h,1],n=s[h].n,"*"!=r[e])n[r[e]]&&a.push(n[r[e]]);else for(o in n)n[d](o)&&a.push(n[o]);s.splice.apply(s,a)}for(e=0,i=s.length;e<i;e++)for(n=s[e];n.n;){if(t){if(n.f){for(h=0,p=n.f.length;h<p;h++)if(n.f[h]==t){n.f.splice(h,1);break}n.f.length||delete n.f}for(o in n.n)if(n.n[d](o)&&n.n[o].f){for(var l=n.n[o].f,h=0,p=l.length;h<p;h++)if(l[h]==t){l.splice(h,1);break}l.length||delete n.n[o].f}}else for(o in delete n.f,n.n)n.n[d](o)&&n.n[o].f&&delete n.n[o].f;n=n.n}}else f._events=_={n:{}}},f.once=function(t,e){function i(){return f.unbind(t,i),e.apply(this,arguments)}return f.on(t,i)},f.version="0.4.2",f.toString=function(){return"You are running Eve 0.4.2"},"undefined"!=typeof module&&module.exports?module.exports=f:"function"==typeof define&&define.amd?define("eve",[],function(){return f}):t.eve=f}(this),function(e,i){var t;"function"==typeof define&&define.amd?define(["eve"],function(t){return i(e,t)}):"undefined"!=typeof exports?(t=require("eve"),module.exports=i(e,t)):i(e,e.eve)}(window||this,function(I,V){o=void 0===V?function(){}:V,h={},c=I.requestAnimationFrame||I.webkitRequestAnimationFrame||I.mozRequestAnimationFrame||I.oRequestAnimationFrame||I.msRequestAnimationFrame||function(t){setTimeout(t,16)},a=Array.isArray||function(t){return t instanceof Array||"[object Array]"==Object.prototype.toString.call(t)},u=0,f="M"+(+new Date).toString(36),t=Date.now||function(){return+new Date},p=function(){var t,e,i,n=0;for(t in h)h.hasOwnProperty(t)&&(i=(e=h[t]).get(),n++,e.s=(i-e.b)/(e.dur/e.spd),1<=e.s&&(delete h[t],e.s=1,n--,function(t){setTimeout(function(){o("mina.finish."+t.id,t)})}(e)),e.update());n&&c(p)},d.time=t,d.getById=function(t){return h[t]||null},d.linear=function(t){return t},d.easeout=function(t){return Math.pow(t,1.7)},d.easein=function(t){return Math.pow(t,.48)},d.easeinout=function(t){if(1==t)return 1;if(0==t)return 0;var t=.48-t/1.04,e=Math.sqrt(.1734+t*t),i=e-t,e=-e-t,t=Math.pow(Math.abs(i),1/3)*(i<0?-1:1)+Math.pow(Math.abs(e),1/3)*(e<0?-1:1)+.5;return 3*(1-t)*t*t+t*t*t},d.backin=function(t){if(1==t)return 1;return t*t*(2.70158*t-1.70158)},d.backout=function(t){if(0==t)return 0;return(t-=1)*t*(2.70158*t+1.70158)+1},d.elastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1},d.bounce=function(t){var e=7.5625,e=t<1/2.75?e*t*t:t<2/2.75?e*(t-=1.5/2.75)*t+.75:t<2.5/2.75?e*(t-=2.25/2.75)*t+.9375:e*(t-=2.625/2.75)*t+.984375;return e};var o,h,c,a,u,f,p,_=I.mina=d;function m(t){if(null==t)return this.s;var e=this.s-t;this.b+=this.dur*e,this.B+=this.dur*e,this.s=t}function y(t){if(null==t)return this.spd;this.spd=t}function v(t){if(null==t)return this.dur;this.s=this.s*t/this.dur,this.dur=t}function A(){delete h[this.id],this.update(),o("mina.stop."+this.id,this)}function b(){this.pdif||(delete h[this.id],this.update(),this.pdif=this.get()-this.b)}function T(){this.pdif&&(this.b=this.get()-this.pdif,delete this.pdif,h[this.id]=this)}function x(){var t=this;if(a(t.start))for(var e=[],i=0,n=t.start.length;i<n;i++)e[i]=+t.start[i]+(t.end[i]-t.start[i])*t.easing(t.s);else e=+t.start+(t.end-t.start)*t.easing(t.s);t.set(e)}function d(t,e,i,n,o,a,r){var s,t={id:f+(u++).toString(36),start:t,end:e,b:i,s:0,dur:n-i,spd:1,get:o,set:a,easing:r||d.linear,status:m,speed:y,duration:v,stop:A,pause:b,resume:T,update:x},l=(h[t.id]=t,0);for(s in h)if(h.hasOwnProperty(s)&&2==++l)break;return 1==l&&c(p),t}var t=function(t){function m(t,e){if(t){if(t.nodeType)return f(t);if(d(t,"array")&&m.set)return m.set.apply(m,t);if(t instanceof Y)return t;if(null==e)return f(t=l.doc.querySelector(String(t)))}return new u(t=null==t?"100%":t,e=null==e?"100%":e)}m.version="0.4.0",m.toString=function(){return"Snap v"+this.version};var e,o,l={win:t.window,doc:t.window.document},h=((m._={}).glob=l,"hasOwnProperty"),y=String,s=parseFloat,v=parseInt,c=Math,I=c.max,_=c.min,A=c.abs,b=(c.pow,c.PI),i=(c.round,Object.prototype.toString),T=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,x=(m._.separator=/[,\s]+/,/[\s]*,[\s]*/),w={hs:1,rg:1},n=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,a=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,N=/(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/gi,r=0,E="S"+(+new Date).toString(36),C=function(t){return(t&&t.type?t.type:"")+E+(r++).toString(36)},P="http://www.w3.org/1999/xlink",S="http://www.w3.org/2000/svg",M={};m.url=function(t){return"url('#"+t+"')"};function p(t,e){if(e){if("string"==typeof(t="#comment"==(t="#text"==t?l.doc.createTextNode(e.text||e["#text"]||""):t)?l.doc.createComment(e.text||e["#text"]||""):t)&&(t=p(t)),"string"==typeof e)return 1==t.nodeType?"xlink:"==e.substring(0,6)?t.getAttributeNS(P,e.substring(6)):"xml:"==e.substring(0,4)?t.getAttributeNS(S,e.substring(4)):t.getAttribute(e):"text"==e?t.nodeValue:null;if(1==t.nodeType)for(var i in e){var n;e[h](i)&&((n=y(e[i]))?"xlink:"==i.substring(0,6)?t.setAttributeNS(P,i.substring(6),n):"xml:"==i.substring(0,4)?t.setAttributeNS(S,i.substring(4),n):t.setAttribute(i,n):t.removeAttribute(i))}else"text"in e&&(t.nodeValue=e.text)}else t=l.doc.createElementNS(S,t);return t}function d(t,e){return"finite"==(e=y.prototype.toLowerCase.call(e))?isFinite(t):!("array"!=e||!(t instanceof Array||Array.isArray&&Array.isArray(t)))||("null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||i.call(t).slice(8,-1).toLowerCase()==e)}function k(o,a,r){function s(){var t=Array.prototype.slice.call(arguments,0),e=t.join("␀"),i=s.cache=s.cache||{},n=s.count=s.count||[];return i[h](e)?function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return t.push(t.splice(i,1)[0])}(n,e):(1e3<=n.length&&delete i[n.shift()],n.push(e),i[e]=o.apply(a,t)),r?r(i[e]):i[e]}return s}function R(t){return t%360*b/180}m._.$=p,m._.id=C,m.format=(e=/\{([^\}]+)\}/g,o=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(t,n){return y(t).replace(e,function(t,e){return t=t,a=i=n,e.replace(o,function(t,e,i,n,o){e=e||n,a&&"function"==typeof(a=e in a?a[e]:a)&&o&&(a=a())}),a=(null==a||a==i?t:a)+"";var i,a})}),m._.clone=function t(e){if("function"==typeof e||Object(e)!==e)return e;var i,n=new e.constructor;for(i in e)e[h](i)&&(n[i]=t(e[i]));return n},m._.cacher=k,m.rad=R,m.deg=function(t){return 180*t/b%360},m.sin=function(t){return c.sin(m.rad(t))},m.tan=function(t){return c.tan(m.rad(t))},m.cos=function(t){return c.cos(m.rad(t))},m.asin=function(t){return m.deg(c.asin(t))},m.acos=function(t){return m.deg(c.acos(t))},m.atan=function(t){return m.deg(c.atan(t))},m.atan2=function(t){return m.deg(c.atan2(t))},m.angle=function t(e,i,n,o,a,r){var s,l;return null==a?(l=i-o,(s=e-n)||l?(180+180*c.atan2(-l,-s)/b+360)%360:0):t(e,i,a,r)-t(n,o,a,r)},m.len=function(t,e,i,n){return Math.sqrt(m.len2(t,e,i,n))},m.len2=function(t,e,i,n){return(t-i)*(t-i)+(e-n)*(e-n)},m.closestPoint=function(c,p,d){function t(t){var e=t.x-p,t=t.y-d;return e*e+t*t}for(var e,i,n,g,u,f,o,m,y,a=c.node,r=a.getTotalLength(),s=r/a.pathSegList.numberOfItems*.125,l=1/0,h=0;h<=r;h+=s)(g=t(n=a.getPointAtLength(h)))<l&&(e=n,i=h,l=g);for(s*=.5;.5<s;)0<=(o=i-s)&&(m=t(u=a.getPointAtLength(o)))<l?(e=u,i=o,l=m):(o=i+s)<=r&&(y=t(f=a.getPointAtLength(o)))<l?(e=f,i=o,l=y):s*=.5;return e={x:e.x,y:e.y,length:i,distance:Math.sqrt(l)}},m.is=d,m.snapTo=function(t,e,i){if(i=d(i,"finite")?i:10,d(t,"array")){for(var n=t.length;n--;)if(A(t[n]-e)<=i)return t[n]}else{var o=e%(t=+t);if(o<i)return e-o;if(t-i<o)return e-o+t}return e},m.getRGB=k(function(t){if(!t||(t=y(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:U};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:U};if(!(t=!w[h](t.toLowerCase().substring(0,2))&&"#"!=t.charAt()?B(t):t))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:U};var e,i,n,o,a,r,t=t.match(T);return t?(t[2]&&(n=v(t[2].substring(5),16),i=v(t[2].substring(3,5),16),e=v(t[2].substring(1,3),16)),t[3]&&(n=v((a=t[3].charAt(3))+a,16),i=v((a=t[3].charAt(2))+a,16),e=v((a=t[3].charAt(1))+a,16)),t[4]&&(r=t[4].split(x),e=s(r[0]),"%"==r[0].slice(-1)&&(e*=2.55),i=s(r[1]),"%"==r[1].slice(-1)&&(i*=2.55),n=s(r[2]),"%"==r[2].slice(-1)&&(n*=2.55),"rgba"==t[1].toLowerCase().slice(0,4)&&(o=s(r[3])),r[3]&&"%"==r[3].slice(-1)&&(o/=100)),t[5]?(r=t[5].split(x),e=s(r[0]),"%"==r[0].slice(-1)&&(e/=100),i=s(r[1]),"%"==r[1].slice(-1)&&(i/=100),n=s(r[2]),"%"==r[2].slice(-1)&&(n/=100),"deg"!=r[0].slice(-3)&&"°"!=r[0].slice(-1)||(e/=360),"hsba"==t[1].toLowerCase().slice(0,4)&&(o=s(r[3])),r[3]&&"%"==r[3].slice(-1)&&(o/=100),m.hsb2rgb(e,i,n,o)):t[6]?(r=t[6].split(x),e=s(r[0]),"%"==r[0].slice(-1)&&(e/=100),i=s(r[1]),"%"==r[1].slice(-1)&&(i/=100),n=s(r[2]),"%"==r[2].slice(-1)&&(n/=100),"deg"!=r[0].slice(-3)&&"°"!=r[0].slice(-1)||(e/=360),"hsla"==t[1].toLowerCase().slice(0,4)&&(o=s(r[3])),r[3]&&"%"==r[3].slice(-1)&&(o/=100),m.hsl2rgb(e,i,n,o)):(e=_(c.round(e),255),i=_(c.round(i),255),n=_(c.round(n),255),o=_(I(o,0),1),(t={r:e,g:i,b:n,toString:U}).hex="#"+(16777216|n|i<<8|e<<16).toString(16).slice(1),t.opacity=d(o,"finite")?o:1,t)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:U}},m),m.hsb=k(function(t,e,i){return m.hsb2rgb(t,e,i).hex}),m.hsl=k(function(t,e,i){return m.hsl2rgb(t,e,i).hex}),m.rgb=k(function(t,e,i,n){var o;return d(n,"finite")?"rgba("+[(o=c.round)(t),o(e),o(i),+n.toFixed(2)]+")":"#"+(16777216|i|e<<8|t<<16).toString(16).slice(1)});function L(){return"hsb("+[this.h,this.s,this.b]+")"}function O(){return"hsl("+[this.h,this.s,this.l]+")"}function F(t,e,i){var n;return null==e&&d(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,e=t.g,t=t.r),null==e&&d(t,string)&&(t=(n=m.getRGB(t)).r,e=n.g,i=n.b),(1<t||1<e||1<i)&&(t/=255,e/=255,i/=255),[t,e,i]}function D(t,e,i,n){return t={r:t=c.round(255*t),g:e=c.round(255*e),b:i=c.round(255*i),opacity:d(n,"finite")?n:1,hex:m.rgb(t,e,i),toString:U},d(n,"finite")&&(t.opacity=n),t}var B=function(t){var e=l.doc.getElementsByTagName("head")[0]||l.doc.getElementsByTagName("svg")[0],i="rgb(255, 0, 0)";return(B=k(function(t){if("red"==t.toLowerCase())return i;e.style.color=i,e.style.color=t;t=l.doc.defaultView.getComputedStyle(e,"").getPropertyValue("color");return t==i?null:t}))(t)},U=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},z=(m.color=function(t){var e;return d(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=m.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):d(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=m.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):(d(t,"string")&&(t=m.getRGB(t)),d(t,"object")&&"r"in t&&"g"in t&&"b"in t&&!("error"in t)?(e=m.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=m.rgb2hsb(t),t.v=e.b):((t={hex:"none"}).r=t.g=t.b=t.h=t.s=t.v=t.l=-1,t.error=1)),t.toString=U,t},m.hsb2rgb=function(t,e,i,n){var o,a,r;return d(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(i=t.b,e=t.s,n=t.o,t=t.h),r=(e=i*e)*(1-A((t=(t*=360)%360/60)%2-1)),o=a=i=i-e,D(o+=[e,r,0,0,r,e][t=~~t],a+=[r,e,e,r,0,0][t],i+=[0,0,r,e,e,r][t],n)},m.hsl2rgb=function(t,e,i,n){var o,a,r;return d(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(i=t.l,e=t.s,t=t.h),(1<t||1<e||1<i)&&(t/=360,e/=100,i/=100),r=(e=2*e*(i<.5?i:1-i))*(1-A((t=(t*=360)%360/60)%2-1)),o=a=i=i-e/2,D(o+=[e,r,0,0,r,e][t=~~t],a+=[r,e,e,r,0,0][t],i+=[0,0,r,e,e,r][t],n)},m.rgb2hsb=function(t,e,i){var n,o;return t=(i=F(t,e,i))[0],e=i[1],i=i[2],{h:((0==(o=(n=I(t,e,i))-_(t,e,i))?null:n==t?(e-i)/o:n==e?(i-t)/o+2:(t-e)/o+4)+360)%6*60/360,s:0==o?0:o/n,b:n,toString:L}},m.rgb2hsl=function(t,e,i){var n,o,a;return t=(i=F(t,e,i))[0],e=i[1],i=i[2],n=((o=I(t,e,i))+(a=_(t,e,i)))/2,{h:((0==(a=o-a)?null:o==t?(e-i)/a:o==e?(i-t)/a+2:(t-e)/a+4)+360)%6*60/360,s:0==a?0:n<.5?a/(2*n):a/(2-2*n),l:n,toString:O}},m.parsePathString=function(t){if(!t)return null;var e=m.path(t);if(e.arr)return m.path.clone(e.arr);var a={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},r=[];return(r=d(t,"array")&&d(t[0],"array")?m.path.clone(t):r).length||y(t).replace(n,function(t,e,i){var n=[],o=e.toLowerCase();if(i.replace(N,function(t,e){e&&n.push(+e)}),"m"==o&&2<n.length&&(r.push([e].concat(n.splice(0,2))),o="l",e="m"==e?"l":"L"),"o"==o&&1==n.length&&r.push([e,n[0]]),"r"==o)r.push([e].concat(n));else for(;n.length>=a[o]&&(r.push([e].concat(n.splice(0,a[o]))),a[o]););}),r.toString=m.path.toString,e.arr=m.path.clone(r),r},m.parseTransformString=function(t){if(!t)return null;var o=[];return(o=d(t,"array")&&d(t[0],"array")?m.path.clone(t):o).length||y(t).replace(a,function(t,e,i){var n=[];e.toLowerCase();i.replace(N,function(t,e){e&&n.push(+e)}),o.push([e].concat(n))}),o.toString=m.path.toString,o});m._.svgTransform2string=function(t){var n=[];return t=t.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(t,e,i){return i=i.split(/\s*,\s*|\s+/),"rotate"==e&&1==i.length&&i.push(0,0),"scale"==e&&(2<i.length?i=i.slice(0,2):2==i.length&&i.push(0,0),1==i.length&&i.push(i[0],0,0)),"skewX"==e?n.push(["m",1,0,c.tan(R(i[0])),1,0,0]):"skewY"==e?n.push(["m",1,c.tan(R(i[0])),0,1,0,0]):n.push([e.charAt(0)].concat(i)),t}),n},m._.rgTransform=/^[a-z][\s]*-?\.?\d/i,m._.transform2matrix=function(c,p){var t=z(c),e=new m.Matrix;if(t)for(var d=0,g=t.length;d<g;d++){var u,f,i,n,o,a=t[d],r=a.length,s=y(a[0]).toLowerCase(),l=a[0]!=s,h=l?e.invert():0;"t"==s&&2==r?e.translate(a[1],0):"t"==s&&3==r?l?(u=h.x(0,0),f=h.y(0,0),i=h.x(a[1],a[2]),n=h.y(a[1],a[2]),e.translate(i-u,n-f)):e.translate(a[1],a[2]):"r"==s?2==r?e.rotate(a[1],(o=o||p).x+o.width/2,o.y+o.height/2):4==r&&(l?(i=h.x(a[2],a[3]),n=h.y(a[2],a[3]),e.rotate(a[1],i,n)):e.rotate(a[1],a[2],a[3])):"s"==s?2==r||3==r?e.scale(a[1],a[r-1],(o=o||p).x+o.width/2,o.y+o.height/2):4==r?l?(i=h.x(a[2],a[3]),n=h.y(a[2],a[3]),e.scale(a[1],a[1],i,n)):e.scale(a[1],a[1],a[2],a[3]):5==r&&(l?(i=h.x(a[3],a[4]),n=h.y(a[3],a[4]),e.scale(a[1],a[2],i,n)):e.scale(a[1],a[2],a[3],a[4])):"m"==s&&7==r&&e.add(a[1],a[2],a[3],a[4],a[5],a[6])}return e},m._unit2px=function(i,n,o){var t=H(i).node,a={},e=t.querySelector(".svg---mgr");e||(e=p("rect"),p(e,{x:-9e9,y:-9e9,width:10,height:10,class:"svg---mgr",fill:"none"}),t.appendChild(e));function r(t){if(null==t)return"";if(t==+t)return t;p(e,{width:t});try{return e.getBBox().width}catch(t){return 0}}function s(t){if(null==t)return"";if(t==+t)return t;p(e,{height:t});try{return e.getBBox().height}catch(t){return 0}}function l(t,e){null==n?a[t]=e(i.attr(t)||0):t==n&&(a=e(null==o?i.attr(t)||0:o))}switch(i.type){case"rect":l("rx",r),l("ry",s);case"image":l("width",r),l("height",s);case"text":l("x",r),l("y",s);break;case"circle":l("cx",r),l("cy",s),l("r",r);break;case"ellipse":l("cx",r),l("cy",s),l("rx",r),l("ry",s);break;case"line":l("x1",r),l("x2",r),l("y1",s),l("y2",s);break;case"marker":l("refX",r),l("markerWidth",r),l("refY",s),l("markerHeight",s);break;case"radialGradient":l("fx",r),l("fy",s);break;case"tspan":l("dx",r),l("dy",s);break;default:l(n,r)}return t.removeChild(e),a};l.doc.contains||l.doc.compareDocumentPosition;function H(t){return t.node.ownerSVGElement&&f(t.node.ownerSVGElement)||m.select("svg")}function G(t){d(t,"array")||(t=Array.prototype.slice.call(arguments,0));for(var e=0,i=0,n=this.node;this[e];)delete this[e++];for(e=0;e<t.length;e++)"set"==t[e].type?t[e].forEach(function(t){n.appendChild(t.node)}):n.appendChild(t[e].node);for(var o=n.childNodes,e=0;e<o.length;e++)this[i++]=f(o[e]);return this}function Y(t){if(t.snap in M)return M[t.snap];try{e=t.ownerSVGElement}catch(t){}this.node=t,e&&(this.paper=new u(e)),this.type=t.tagName||t.nodeName;var e=this.id=C(this);if(this.anims={},this._={transform:[]},t.snap=e,"g"==(M[e]=this).type&&(this.add=G),this.type in{g:1,mask:1,pattern:1,symbol:1})for(var i in u.prototype)u.prototype[h](i)&&(this[i]=u.prototype[i])}function W(t){this.node=t}function Q(t,e){t=p(t);return e.appendChild(t),f(t)}function u(t,e){var i=u.prototype;if(t&&"svg"==t.tagName){if(t.snap in M)return M[t.snap];var n,o=t.ownerDocument,a=new Y(t),r=t.getElementsByTagName("desc")[0],s=t.getElementsByTagName("defs")[0];for(n in r||((r=p("desc")).appendChild(o.createTextNode("Created with Snap")),a.node.appendChild(r)),s||(s=p("defs"),a.node.appendChild(s)),a.defs=s,i)i[h](n)&&(a[n]=i[n]);a.paper=a.root=a}else p((a=Q("svg",l.doc.body)).node,{height:e,version:1.1,width:t,xmlns:S});return a}function f(t){return t&&(t instanceof Y||t instanceof W?t:t.tagName&&"svg"==t.tagName.toLowerCase()?new u(t):t.tagName&&"object"==t.tagName.toLowerCase()&&"image/svg+xml"==t.type?new u(t.contentDocument.getElementsByTagName("svg")[0]):new Y(t))}m._.getSomeDefs=function(t){var e=(t=t.node.ownerSVGElement&&f(t.node.ownerSVGElement)||t.node.parentNode&&f(t.node.parentNode)||m.select("svg")||m(0,0)).select("defs");return null!=e&&e.node||Q("defs",t.node).node},m._.getSomeSVG=H,m.select=function(t){return t=y(t).replace(/([^\\]):/g,"$1\\:"),f(l.doc.querySelector(t))},m.selectAll=function(t){for(var e=l.doc.querySelectorAll(t),i=(m.set||Array)(),n=0;n<e.length;n++)i.push(f(e[n]));return i},setInterval(function(){for(var t in M){var e,i;M[h](t)&&(i=(e=M[t]).node,("svg"!=e.type&&!i.ownerSVGElement||"svg"==e.type&&(!i.parentNode||"ownerSVGElement"in i.parentNode&&!i.ownerSVGElement))&&delete M[t])}},1e4),Y.prototype.attr=function(t,e){var i,n=this.node;if(!t){if(1!=n.nodeType)return{text:n.nodeValue};for(var o=n.attributes,a={},r=0,s=o.length;r<s;r++)a[o[r].nodeName]=o[r].nodeValue;return a}if(d(t,"string")){if(!(1<arguments.length))return V("snap.util.getattr."+t,this).firstDefined();n={};n[t]=e,t=n}for(i in t)t[h](i)&&V("snap.util.attr."+i,this,t[i]);return this},m.parse=function(t){var e=l.doc.createDocumentFragment(),i=!0,n=l.doc.createElement("div");if((t=y(t)).match(/^\s*<\s*svg(?:\s|>)/)||(t="<svg>"+t+"</svg>",i=!1),n.innerHTML=t,t=n.getElementsByTagName("svg")[0])if(i)e=t;else for(;t.firstChild;)e.appendChild(t.firstChild);return new W(e)},m.fragment=function(){for(var t=Array.prototype.slice.call(arguments,0),e=l.doc.createDocumentFragment(),i=0,n=t.length;i<n;i++){var o=t[i];o.node&&o.node.nodeType&&e.appendChild(o.node),o.nodeType&&e.appendChild(o),"string"==typeof o&&e.appendChild(m.parse(o).node)}return new W(e)},m._.make=Q,m._.wrap=f,u.prototype.el=function(t,e){t=Q(t,this.node);return e&&t.attr(e),t},Y.prototype.children=function(){for(var t=[],e=this.node.childNodes,i=0,n=e.length;i<n;i++)t[i]=m(e[i]);return t},Y.prototype.toJSON=function(){var t=[];return function t(e,i){for(var n=0,o=e.length;n<o;n++){var a={type:e[n].type,attr:e[n].attr()},r=e[n].children();i.push(a),r.length&&t(r,a.childNodes=[])}}([this],t),t[0]},V.on("snap.util.getattr",function(){var t=V.nt(),e=(t=t.substring(t.lastIndexOf(".")+1)).replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()});return q[h](e)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(e):p(this.node,t)});var q={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};V.on("snap.util.attr",function(t){var e=V.nt(),i={},n=(i[e=e.substring(e.lastIndexOf(".")+1)]=t,e.replace(/-(\w)/gi,function(t,e){return e.toUpperCase()})),e=e.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()});q[h](e)?this.node.style[n]=null==t?"":t:p(this.node,i)}),m.ajax=function(t,e,i,n){var o=new XMLHttpRequest,a=C();if(o){if(d(e,"function"))n=i,i=e,e=null;else if(d(e,"object")){var r,s=[];for(r in e)e.hasOwnProperty(r)&&s.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));e=s.join("&")}return(o.open(e?"POST":"GET",t,!0),e&&(o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded")),i&&(V.once("snap.ajax."+a+".0",i),V.once("snap.ajax."+a+".200",i),V.once("snap.ajax."+a+".304",i)),o.onreadystatechange=function(){4==o.readyState&&V("snap.ajax."+a+"."+o.status,n,o)},4==o.readyState)?o:(o.send(e),o)}},m.load=function(t,e,i){m.ajax(t,function(t){t=m.parse(t.responseText);i?e.call(i,t):e(t)})};return m.getElementByPoint=function(t,e){this.canvas;var i,n,o,a,r,s=l.doc.elementFromPoint(t,e);return l.win.opera&&"svg"==s.tagName&&(n=(i=s).getBoundingClientRect(),i=i.ownerDocument,o=i.body,i=i.documentElement,a=i.clientTop||o.clientTop||0,r=i.clientLeft||o.clientLeft||0,a={y:n.top+(g.win.pageYOffset||i.scrollTop||o.scrollTop)-a,x:n.left+(g.win.pageXOffset||i.scrollLeft||o.scrollLeft)-r},(n=s.createSVGRect()).x=t-a.x,n.y=e-a.y,n.width=n.height=1,(i=s.getIntersectionList(n,null)).length&&(s=i[i.length-1])),s?f(s):null},m.plugin=function(t){t(m,Y,u,l,W)},l.win.Snap=m}(I||this);return t.plugin(function(l,t,e,i,n){function h(){return this.string}var t=t.prototype,f=l.is,m=String,a=l._unit2px,g=l._.$,s=l._.make,c=l._.getSomeDefs,y="hasOwnProperty",r=l._.wrap;t.getBBox=function(t){if(!l.Matrix||!l.path)return this.node.getBBox();var e,i=this,n=new l.Matrix;if(i.removed)return l._.box();for(;"use"==i.type;)t||(n=n.add(i.transform().localMatrix.translate(i.attr("x")||0,i.attr("y")||0))),i=i.original||(e=i.attr("xlink:href"),i.original=i.node.ownerDocument.getElementById(e.substring(e.indexOf("#")+1)));var o=i._,a=l.path.get[i.type]||l.path.get.deflt;try{return t?(o.bboxwt=a?l.path.getBBox(i.realPath=a(i)):l._.box(i.node.getBBox()),l._.box(o.bboxwt)):(i.realPath=a(i),i.matrix=i.transform().localMatrix,o.bbox=l.path.getBBox(l.path.map(i.realPath,n.add(i.matrix))),l._.box(o.bbox))}catch(t){return l._.box()}};function p(t,e){if(null==e){var i=!0;if(!(e="linearGradient"==t.type||"radialGradient"==t.type?t.node.getAttribute("gradientTransform"):"pattern"==t.type?t.node.getAttribute("patternTransform"):t.node.getAttribute("transform")))return new l.Matrix;e=l._.svgTransform2string(e)}else e=l._.rgTransform.test(e)?m(e).replace(/\.{3}|\u2026/g,t._.transform||""):l._.svgTransform2string(e),f(e,"array")&&(e=l.path?l.path.toString.call(e):m(e)),t._.transform=e;e=l._.transform2matrix(e,t.getBBox(1));if(i)return e;t.matrix=e}function d(c){var t,e=c.selectAll("*"),p=/^\s*url\(("|'|)(.*)\1\)\s*$/,i=[],o={};function n(i,n){var t=g(i.node,n);(t=(t=t&&t.match(p))&&t[2])&&"#"==t.charAt()&&(t=t.substring(1))&&(o[t]=(o[t]||[]).concat(function(t){var e={};e[n]=URL(t),g(i.node,e)}))}for(var a=0,r=e.length;a<r;a++){n(t=e[a],"fill"),n(t,"stroke"),n(t,"filter"),n(t,"mask"),n(t,"clip-path"),function(e){var t=g(e.node,"xlink:href");t&&"#"==t.charAt()&&(t=t.substring(1))&&(o[t]=(o[t]||[]).concat(function(t){e.attr("xlink:href","#"+t)}))}(t);var s=g(t.node,"id");s&&(g(t.node,{id:t.id}),i.push({old:s,id:t.id}))}for(a=0,r=i.length;a<r;a++){var l=o[i[a].old];if(l)for(var h=0,d=l.length;h<d;h++)l[h](i[a].id)}}t.transform=function(t){var e=this._;if(null!=t)return t instanceof l.Matrix?(this.matrix=t,this._.transform=t.toTransformString()):p(this,t),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?g(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?g(this.node,{patternTransform:this.matrix}):g(this.node,{transform:this.matrix})),this;for(var i,n=this,t=new l.Matrix(this.node.getCTM()),o=p(this),a=[o],r=new l.Matrix,s=o.toTransformString(),e=m(o)==m(this.matrix)?m(e.transform):s;"svg"!=n.type&&(n=n.parent());)a.push(p(n));for(i=a.length;i--;)r.add(a[i]);return{string:e,globalMatrix:t,totalMatrix:r,localMatrix:o,diffMatrix:t.clone().add(o.invert()),global:t.toTransformString(),total:r.toTransformString(),local:s,toString:h}},t.parent=function(){return r(this.node.parentNode)},t.append=t.add=function(t){if(t){var e;if("set"==t.type)return e=this,t.forEach(function(t){e.add(t)}),this;t=r(t),this.node.appendChild(t.node),t.paper=this.paper}return this},t.appendTo=function(t){return t&&(t=r(t)).append(this),this},t.prepend=function(t){if(t){var e,i;if("set"==t.type)return e=this,t.forEach(function(t){i?i.after(t):e.prepend(t),i=t}),this;var n=(t=r(t)).parent();this.node.insertBefore(t.node,this.node.firstChild),this.add&&this.add(),t.paper=this.paper,this.parent()&&this.parent().add(),n&&n.add()}return this},t.prependTo=function(t){return(t=r(t)).prepend(this),this},t.before=function(t){var i;if("set"==t.type)return i=this,t.forEach(function(t){var e=t.parent();i.node.parentNode.insertBefore(t.node,i.node),e&&e.add()}),this.parent().add(),this;var e=(t=r(t)).parent();return this.node.parentNode.insertBefore(t.node,this.node),this.parent()&&this.parent().add(),e&&e.add(),t.paper=this.paper,this},t.after=function(t){var e=(t=r(t)).parent();return this.node.nextSibling?this.node.parentNode.insertBefore(t.node,this.node.nextSibling):this.node.parentNode.appendChild(t.node),this.parent()&&this.parent().add(),e&&e.add(),t.paper=this.paper,this},t.insertBefore=function(t){t=r(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},t.insertAfter=function(t){t=r(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node.nextSibling),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},t.remove=function(){var t=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,t&&t.add(),this},t.select=function(t){return r(this.node.querySelector(t))},t.selectAll=function(t){for(var e=this.node.querySelectorAll(t),i=(l.set||Array)(),n=0;n<e.length;n++)i.push(r(e[n]));return i},t.asPX=function(t,e){return null==e&&(e=this.attr(t)),+a(this,t,e)},t.use=function(){var t,e=this.node.id;return e||(e=this.id,g(this.node,{id:e})),t="linearGradient"==this.type||"radialGradient"==this.type||"pattern"==this.type?s(this.type,this.node.parentNode):s("use",this.node.parentNode),g(t.node,{"xlink:href":"#"+e}),t.original=this,t},t.clone=function(){var t=r(this.node.cloneNode(!0));return g(t.node,"id")&&g(t.node,{id:t.id}),d(t),t.insertAfter(this),t},t.toDefs=function(){return c(this).appendChild(this.node),this},t.pattern=t.toPattern=function(t,e,i,n){var o=s("pattern",c(this));return null==t&&(t=this.getBBox()),f(t,"object")&&"x"in t&&(e=t.y,i=t.width,n=t.height,t=t.x),g(o.node,{x:t,y:e,width:i,height:n,patternUnits:"userSpaceOnUse",id:o.id,viewBox:[t,e,i,n].join(" ")}),o.node.appendChild(this.node),o},t.marker=function(t,e,i,n,o,a){var r=s("marker",c(this));return null==t&&(t=this.getBBox()),f(t,"object")&&"x"in t&&(e=t.y,i=t.width,n=t.height,o=t.refX||t.cx,a=t.refY||t.cy,t=t.x),g(r.node,{viewBox:[t,e,i,n].join(" "),markerWidth:i,markerHeight:n,orient:"auto",refX:o||0,refY:a||0,id:r.id}),r.node.appendChild(this.node),r};function v(t,e,i,n){"function"!=typeof i||i.length||(n=i,i=_.linear),this.attr=t,this.dur=e,i&&(this.easing=i),n&&(this.callback=n)}l._.Animation=v,l.animation=function(t,e,i,n){return new v(t,e,i,n)},t.inAnim=function(){var t,i=[];for(t in this.anims)this.anims[y](t)&&!function(e){i.push({anim:new v(e._attrs,e.dur,e.easing,e._callback),mina:e,curStatus:e.status(),status:function(t){return e.status(t)},stop:function(){e.stop()}})}(this.anims[t]);return i},l.animate=function(t,e,i,n,o,a){"function"!=typeof o||o.length||(a=o,o=_.linear);var r=_.time(),t=_(t,e,r,r+n,_.time,i,o);return a&&V.once("mina.finish."+t.id,a),t},t.stop=function(){for(var t=this.inAnim(),e=0,i=t.length;e<i;e++)t[e].stop();return this},t.animate=function(t,c,e,i){"function"!=typeof e||e.length||(i=e,e=_.linear),t instanceof v&&(i=t.callback,e=t.easing,c=t.dur,t=t.attr);var n,p,o,a,d,r=[],g=[],s={},l=this;for(a in t)t[y](a)&&(l.equal?(n=(o=l.equal(a,m(t[a]))).from,p=o.to,o=o.f):(n=+l.attr(a),p=+t[a]),d=f(n,"array")?n.length:1,s[a]=function(e,i,n){return function(t){t=t.slice(e,i);return 1==t.length&&(t=t[0]),n?n(t):t}}(r.length,r.length+d,o),r=r.concat(n),g=g.concat(p));var u=_.time(),h=_(r,g,u,u+c,_.time,function(t){var e,i={};for(e in s)s[y](e)&&(i[e]=s[e](t));l.attr(i)},e);return(l.anims[h.id]=h)._attrs=t,h._callback=i,V("snap.animcreated."+l.id,h),V.once("mina.finish."+h.id,function(){delete l.anims[h.id],i&&i.call(l)}),V.once("mina.stop."+h.id,function(){delete l.anims[h.id]}),l};var o={};function u(a){return function(){var t=a?"<"+this.type:"",e=this.node.attributes,i=this.node.childNodes;if(a)for(var n=0,o=e.length;n<o;n++)t+=" "+e[n].name+'="'+e[n].value.replace(/"/g,'\\"')+'"';if(i.length){for(a&&(t+=">"),n=0,o=i.length;n<o;n++)3==i[n].nodeType?t+=i[n].nodeValue:1==i[n].nodeType&&(t+=r(i[n]).toString());a&&(t+="</"+this.type+">")}else a&&(t+="/>");return t}}t.data=function(t,e){var i=o[this.id]=o[this.id]||{};if(0==arguments.length)return V("snap.data.get."+this.id,this,i,null),i;if(1!=arguments.length)return i[t]=e,V("snap.data.set."+this.id,this,e,t),this;if(l.is(t,"object")){for(var n in t)t[y](n)&&this.data(n,t[n]);return this}return V("snap.data.get."+this.id,this,i[t],t),i[t]},t.removeData=function(t){return null==t?o[this.id]={}:o[this.id]&&delete o[this.id][t],this},t.outerSVG=t.toString=u(1),t.innerSVG=u(),t.toDataURL=function(){var t;if(I&&I.btoa)return t=this.getBBox(),t=l.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>',{x:+t.x.toFixed(3),y:+t.y.toFixed(3),width:+t.width.toFixed(3),height:+t.height.toFixed(3),contents:this.outerSVG()}),"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t)))},n.prototype.select=t.select,n.prototype.selectAll=t.selectAll}),t.plugin(function(o,t,l,h,c){var e,r=Object.prototype.toString,i=String,a=Math;function g(t,e,i,n,o,a){if(null==e&&"[object SVGMatrix]"==r.call(t))return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,void(this.f=t.f);null!=t?(this.a=+t,this.b=+e,this.c=+i,this.d=+n,this.e=+o,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function n(t){return t[0]*t[0]+t[1]*t[1]}function s(t){var e=a.sqrt(n(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}(e=g.prototype).add=function(t,e,i,n,c,p){var o,a,r,s,l=[[],[],[]],d=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],h=[[t,i,c],[e,n,p],[0,0,1]];for(t&&t instanceof g&&(h=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),o=0;o<3;o++)for(a=0;a<3;a++){for(r=s=0;r<3;r++)s+=d[o][r]*h[r][a];l[o][a]=s}return this.a=l[0][0],this.b=l[1][0],this.c=l[0][1],this.d=l[1][1],this.e=l[0][2],this.f=l[1][2],this},e.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new g(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},e.clone=function(){return new g(this.a,this.b,this.c,this.d,this.e,this.f)},e.translate=function(t,e){return this.add(1,0,0,1,t,e)},e.scale=function(t,e,i,n){return null==e&&(e=t),(i||n)&&this.add(1,0,0,1,i,n),this.add(t,0,0,e,0,0),(i||n)&&this.add(1,0,0,1,-i,-n),this},e.rotate=function(t,e,i){t=o.rad(t),e=e||0,i=i||0;var n=+a.cos(t).toFixed(9),t=+a.sin(t).toFixed(9);return this.add(n,t,-t,n,e,i),this.add(1,0,0,1,-e,-i)},e.x=function(t,e){return t*this.a+e*this.c+this.e},e.y=function(t,e){return t*this.b+e*this.d+this.f},e.get=function(t){return+this[i.fromCharCode(97+t)].toFixed(4)},e.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},e.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},e.determinant=function(){return this.a*this.d-this.b*this.c},e.split=function(){var t={},e=(t.dx=this.e,t.dy=this.f,[[this.a,this.c],[this.b,this.d]]),i=(t.scalex=a.sqrt(n(e[0])),s(e[0]),t.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*t.shear,e[1][1]-e[0][1]*t.shear],t.scaley=a.sqrt(n(e[1])),s(e[1]),t.shear/=t.scaley,this.determinant()<0&&(t.scalex=-t.scalex),-e[0][1]),e=e[1][1];return e<0?(t.rotate=o.deg(a.acos(e)),i<0&&(t.rotate=360-t.rotate)):t.rotate=o.deg(a.asin(i)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},e.toTransformString=function(t){t=t||this.split();return+t.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx||t.dy?"t"+[+t.dx.toFixed(4),+t.dy.toFixed(4)]:"")+(1!=t.scalex||1!=t.scaley?"s"+[t.scalex,t.scaley,0,0]:"")+(t.rotate?"r"+[+t.rotate.toFixed(4),0,0]:""))},o.Matrix=g,o.matrix=function(t,e,i,n,o,a){return new g(t,e,i,n,o,a)}}),t.plugin(function(o,a,i,r,d){var n,g=o._.make,s=o._.wrap,l=o.is,h=o._.getSomeDefs,u=/^url\(#?([^)]+)\)$/,c=o._.$,p=o.url,f=String,m=o._.separator;function y(n){return function(t){V.stop(),t instanceof d&&1==t.node.childNodes.length&&("radialGradient"==t.node.firstChild.tagName||"linearGradient"==t.node.firstChild.tagName||"pattern"==t.node.firstChild.tagName)&&(t=t.node.firstChild,h(this).appendChild(t),t=s(t)),e=t instanceof a?"radialGradient"==t.type||"linearGradient"==t.type||"pattern"==t.type?(t.node.id||c(t.node,{id:t.id}),p(t.node.id)):t.attr(n):(e=o.color(t)).error?(i=o(h(this).ownerSVGElement).gradient(t))?(i.node.id||c(i.node,{id:i.id}),p(i.node.id)):t:f(e);var e,i={};i[n]=e,c(this.node,i),this.node.style[n]=""}}V.on("snap.util.attr.mask",function(t){var e;(t instanceof a||t instanceof d)&&(V.stop(),t instanceof d&&1==t.node.childNodes.length&&(t=t.node.firstChild,h(this).appendChild(t),t=s(t)),"mask"==t.type?e=t:(e=g("mask",h(this))).node.appendChild(t.node),e.node.id||c(e.node,{id:e.id}),c(this.node,{mask:p(e.id)}))}),n=function(t){var e;(t instanceof a||t instanceof d)&&(V.stop(),"clipPath"==t.type?e=t:((e=g("clipPath",h(this))).node.appendChild(t.node),e.node.id||c(e.node,{id:e.id})),c(this.node,{"clip-path":p(e.node.id||e.id)}))},V.on("snap.util.attr.clip",n),V.on("snap.util.attr.clip-path",n),V.on("snap.util.attr.clipPath",n),V.on("snap.util.attr.fill",y("fill")),V.on("snap.util.attr.stroke",y("stroke"));var v=/^([lr])(?:\(([^)]*)\))?(.*)$/i;function I(t){V.stop(),t==+t&&(t+="px"),this.node.style.fontSize=t}function t(e){return function(){V.stop();var t=r.doc.defaultView.getComputedStyle(this.node,null).getPropertyValue("marker-"+e);return"none"==t?t:o(r.doc.getElementById(t.match(u)[1]))}}function e(n){return function(t){V.stop();var e,i="marker"+n.charAt(0).toUpperCase()+n.substring(1);""!=t&&t?"marker"==t.type&&((e=t.node.id)||c(t.node,{id:t.id}),this.node.style[i]=p(e)):this.node.style[i]="none"}}function _(){return V.stop(),this.node.style.fontSize}V.on("snap.util.grad.parse",function(t){t=(t=f(t)).match(v);if(!t)return null;var e=t[1],i=t[2],t=t[3];return{type:e,params:i=1==(i=i.split(/\s*,\s*/).map(function(t){return+t==t?+t:t})).length&&0==i[0]?[]:i,stops:t=(t=t.split("-")).map(function(t){var e={color:(t=t.split(":"))[0]};return t[1]&&(e.offset=parseFloat(t[1])),e})}}),V.on("snap.util.attr.d",function(t){V.stop(),l(t,"array")&&l(t[0],"array")&&(t=o.path.toString.call(t)),(t=f(t)).match(/[ruo]/i)&&(t=o.path.toAbsolute(t)),c(this.node,{d:t})})(-1),V.on("snap.util.attr.#text",function(t){V.stop(),t=f(t);for(t=r.doc.createTextNode(t);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(t)})(-1),V.on("snap.util.attr.path",function(t){V.stop(),this.attr({d:t})})(-1),V.on("snap.util.attr.class",function(t){V.stop(),this.node.className.baseVal=t})(-1),V.on("snap.util.attr.viewBox",function(t){t=l(t,"object")&&"x"in t?[t.x,t.y,t.width,t.height].join(" "):l(t,"array")?t.join(" "):t;c(this.node,{viewBox:t}),V.stop()})(-1),V.on("snap.util.attr.transform",function(t){this.transform(t),V.stop()})(-1),V.on("snap.util.attr.r",function(t){"rect"==this.type&&(V.stop(),c(this.node,{rx:t,ry:t}))})(-1),V.on("snap.util.attr.textpath",function(t){if(V.stop(),"text"==this.type){var e,i,n,o;if(!t&&this.textPath){for(e=this.textPath;e.node.firstChild;)this.node.appendChild(e.node.firstChild);return e.remove(),void delete this.textPath}if(l(t,"string")?(n=h(this),o=s(n.parentNode).path(t),n.appendChild(o.node),n=o.id,o.attr({id:n})):(t=s(t))instanceof a&&((n=t.attr("id"))||(n=t.id,t.attr({id:n}))),n)if(e=this.textPath,i=this.node,e)e.attr({"xlink:href":"#"+n});else{for(e=c("textPath",{"xlink:href":"#"+n});i.firstChild;)e.appendChild(i.firstChild);i.appendChild(e),this.textPath=s(e)}}})(-1),V.on("snap.util.attr.text",function(t){if("text"==this.type){for(var e=this.node,n=function(t){var e=c("tspan");if(l(t,"array"))for(var i=0;i<t.length;i++)e.appendChild(n(t[i]));else e.appendChild(r.doc.createTextNode(t));return e.normalize&&e.normalize(),e};e.firstChild;)e.removeChild(e.firstChild);for(var i=n(t);i.firstChild;)e.appendChild(i.firstChild)}V.stop()})(-1),V.on("snap.util.attr.fontSize",I)(-1),V.on("snap.util.attr.font-size",I)(-1),V.on("snap.util.getattr.transform",function(){return V.stop(),this.transform()})(-1),V.on("snap.util.getattr.textpath",function(){return V.stop(),this.textPath})(-1),V.on("snap.util.getattr.marker-end",t("end"))(-1),V.on("snap.util.getattr.markerEnd",t("end"))(-1),V.on("snap.util.getattr.marker-start",t("start"))(-1),V.on("snap.util.getattr.markerStart",t("start"))(-1),V.on("snap.util.getattr.marker-mid",t("mid"))(-1),V.on("snap.util.getattr.markerMid",t("mid"))(-1),V.on("snap.util.attr.marker-end",e("end"))(-1),V.on("snap.util.attr.markerEnd",e("end"))(-1),V.on("snap.util.attr.marker-start",e("start"))(-1),V.on("snap.util.attr.markerStart",e("start"))(-1),V.on("snap.util.attr.marker-mid",e("mid"))(-1),V.on("snap.util.attr.markerMid",e("mid"))(-1),V.on("snap.util.getattr.r",function(){if("rect"==this.type&&c(this.node,"rx")==c(this.node,"ry"))return V.stop(),c(this.node,"rx")})(-1),V.on("snap.util.getattr.text",function(){var t;if("text"==this.type||"tspan"==this.type)return V.stop(),1==(t=function t(e){for(var i=[],n=e.childNodes,o=0,a=n.length;o<a;o++){var r=n[o];3==r.nodeType&&i.push(r.nodeValue),"tspan"==r.tagName&&(1==r.childNodes.length&&3==r.firstChild.nodeType?i.push(r.firstChild.nodeValue):i.push(t(r)))}return i}(this.node)).length?t[0]:t})(-1),V.on("snap.util.getattr.#text",function(){return this.node.textContent})(-1),V.on("snap.util.getattr.viewBox",function(){V.stop();var t=c(this.node,"viewBox");if(t)return t=t.split(m),o._.box(+t[0],+t[1],+t[2],+t[3])})(-1),V.on("snap.util.getattr.points",function(){var t=c(this.node,"points");if(V.stop(),t)return t.split(m)})(-1),V.on("snap.util.getattr.path",function(){var t=c(this.node,"d");return V.stop(),t})(-1),V.on("snap.util.getattr.class",function(){return this.node.className.baseVal})(-1),V.on("snap.util.getattr.fontSize",_)(-1),V.on("snap.util.getattr.font-size",_)(-1)}),t.plugin(function(t,e,i,n,o){var s=/\S+/g,r=String,e=e.prototype;e.addClass=function(t){var e,i,n=r(t||"").match(s)||[],t=this.node,o=t.className.baseVal,a=o.match(s)||[];if(n.length){for(e=0;i=n[e++];)~a.indexOf(i)||a.push(i);o!=(o=a.join(" "))&&(t.className.baseVal=o)}return this},e.removeClass=function(t){var e,i,n=r(t||"").match(s)||[],t=this.node,o=t.className.baseVal,a=o.match(s)||[];if(a.length){for(e=0;i=n[e++];)~(i=a.indexOf(i))&&a.splice(i,1);o!=(o=a.join(" "))&&(t.className.baseVal=o)}return this},e.hasClass=function(t){return!!~(this.node.className.baseVal.match(s)||[]).indexOf(t)},e.toggleClass=function(t,e){if(null!=e)return e?this.addClass(t):this.removeClass(t);for(var i,n,o=(t||"").match(s)||[],e=this.node,t=e.className.baseVal,a=t.match(s)||[],r=0;n=o[r++];)~(i=a.indexOf(n))?a.splice(i,1):a.push(n);return t!=(t=a.join(" "))&&(e.className.baseVal=t),this}}),t.plugin(function(t,e,i,n,o){var l={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"/":function(t,e){return t/e},"*":function(t,e){return t*e}},h=String,c=/[a-z]+$/i,p=/^\s*([+\-\/*])\s*=\s*([\d.eE+\-]+)\s*([^\d\s]+)?\s*$/;function s(t){return t}V.on("snap.util.attr",function(t){var e,i,n,o,a,r,s=h(t).match(p);s&&(e=(e=V.nt()).substring(e.lastIndexOf(".")+1),i=this.attr(e),n={},V.stop(),o=s[3]||"",a=i.match(c),r=l[s[1]],t=a&&a==o?r(parseFloat(i),+s[2]):(i=this.asPX(e),r(this.asPX(e),this.asPX(e,s[2]+o))),isNaN(i)||isNaN(t)||(n[e]=t,this.attr(n)))})(-10),V.on("snap.util.equal",function(t,e){var i,n,o,a,r=h(this.attr(t)||""),e=h(e).match(p);if(e)return V.stop(),i=e[3]||"",n=r.match(c),o=l[e[1]],n&&n==i?{from:parseFloat(r),to:o(parseFloat(r),+e[2]),f:(a=n,function(t){return+t.toFixed(3)+a})}:{from:r=this.asPX(t),to:o(r,this.asPX(t,e[2]+i)),f:s}})(-10)}),t.plugin(function(s,e,t,o,n){var c,i=t.prototype,h=s.is,g=(i.rect=function(t,e,i,n,o,a){var r;return null==a&&(a=o),h(t,"object")&&"[object Object]"==t?r=t:null!=t&&(r={x:t,y:e,width:i,height:n},null!=o&&(r.rx=o,r.ry=a)),this.el("rect",r)},i.circle=function(t,e,i){var n;return h(t,"object")&&"[object Object]"==t?n=t:null!=t&&(n={cx:t,cy:e,r:i}),this.el("circle",n)},function(t,e){var i=o.doc.createElement("img"),n=o.doc.body;i.style.cssText="position:absolute;left:-9999em;top:-9999em",i.onload=function(){e.call(i),i.onload=i.onerror=null,n.removeChild(i)},i.onerror=a,n.appendChild(i),i.src=t});function a(){this.parentNode.removeChild(this)}function r(){return this.selectAll("stop")}function l(t,e){var i=c("stop"),e={offset:+e+"%"};return t=s.color(t),e["stop-color"]=t.hex,t.opacity<1&&(e["stop-opacity"]=t.opacity),c(i,e),this.node.appendChild(i),this}function p(){var t,e,i,n;return"linearGradient"==this.type?(i=c(this.node,"x1")||0,e=c(this.node,"x2")||1,t=c(this.node,"y1")||0,n=c(this.node,"y2")||0,s._.box(i,t,math.abs(e-i),math.abs(n-t))):(e=this.node.cx||.5,i=this.node.cy||.5,n=this.node.r||0,s._.box(e-n,i-n,2*n,2*n))}function d(t,e,i,n,o){t=s._.make("linearGradient",t);return t.stops=r,t.addStop=l,t.getBBox=p,null!=e&&c(t.node,{x1:e,y1:i,x2:n,y2:o}),t}function u(t,e,i,n,o,a){t=s._.make("radialGradient",t);return t.stops=r,t.addStop=l,t.getBBox=p,null!=e&&c(t.node,{cx:e,cy:i,r:n}),null!=o&&null!=a&&c(t.node,{fx:o,fy:a}),t}i.image=function(t,e,i,n,o){var a,r=this.el("image");return h(t,"object")&&"src"in t?r.attr(t):null!=t&&(a={"xlink:href":t,preserveAspectRatio:"none"},null!=e&&null!=i&&(a.x=e,a.y=i),null!=n&&null!=o?(a.width=n,a.height=o):g(t,function(){s._.$(r.node,{width:this.offsetWidth,height:this.offsetHeight})}),s._.$(r.node,a)),r},i.ellipse=function(t,e,i,n){var o;return h(t,"object")&&"[object Object]"==t?o=t:null!=t&&(o={cx:t,cy:e,rx:i,ry:n}),this.el("ellipse",o)},i.path=function(t){var e;return h(t,"object")&&!h(t,"array")?e=t:t&&(e={d:t}),this.el("path",e)},i.group=i.g=function(t){var e=this.el("g");return 1==arguments.length&&t&&!t.type?e.attr(t):arguments.length&&e.add(Array.prototype.slice.call(arguments,0)),e},i.svg=function(t,e,i,n,o,a,r,s){var l={};return h(t,"object")&&null==e?l=t:(null!=t&&(l.x=t),null!=e&&(l.y=e),null!=i&&(l.width=i),null!=n&&(l.height=n),null!=o&&null!=a&&null!=r&&null!=s&&(l.viewBox=[o,a,r,s])),this.el("svg",l)},i.mask=function(t){var e=this.el("mask");return 1==arguments.length&&t&&!t.type?e.attr(t):arguments.length&&e.add(Array.prototype.slice.call(arguments,0)),e},i.ptrn=function(t,e,i,n,o,a,r,s){var l;return h(t,"object")?l=t:(l={patternUnits:"userSpaceOnUse"},t&&(l.x=t),e&&(l.y=e),null!=i&&(l.width=i),null!=n&&(l.height=n),l.viewBox=null!=o&&null!=a&&null!=r&&null!=s?[o,a,r,s]:[t||0,e||0,i||0,n||0]),this.el("pattern",l)},i.use=function(t){return null!=t?(t instanceof e&&(t.attr("id")||t.attr({id:s._.id(t)}),t=t.attr("id")),"#"==String(t).charAt()&&(t=t.substring(1)),this.el("use",{"xlink:href":"#"+t})):e.prototype.use.call(this)},i.symbol=function(t,e,i,n){var o={};return null!=t&&null!=e&&null!=i&&null!=n&&(o.viewBox=[t,e,i,n]),this.el("symbol",o)},i.text=function(t,e,i){var n={};return h(t,"object")?n=t:null!=t&&(n={x:t,y:e,text:i||""}),this.el("text",n)},i.line=function(t,e,i,n){var o={};return h(t,"object")?o=t:null!=t&&(o={x1:t,x2:i,y1:e,y2:n}),this.el("line",o)},i.polyline=function(t){1<arguments.length&&(t=Array.prototype.slice.call(arguments,0));var e={};return h(t,"object")&&!h(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polyline",e)},i.polygon=function(t){1<arguments.length&&(t=Array.prototype.slice.call(arguments,0));var e={};return h(t,"object")&&!h(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polygon",e)},c=s._.$,i.gradient=function(t){var e,i=this.defs;if(!(t=V("snap.util.grad.parse",null,t).firstDefined()))return null;t.params.unshift(i),e=("l"==t.type.toLowerCase()?d:u).apply(0,t.params),t.type!=t.type.toLowerCase()&&c(e.node,{gradientUnits:"userSpaceOnUse"});var o=t.stops,n=o.length,a=0,r=0;function s(t,e){for(var i=(e-a)/(t-r),n=r;n<t;n++)o[n].offset=+(+a+i*(n-r)).toFixed(2);r=t,a=e}n--;for(var l=0;l<n;l++)"offset"in o[l]&&s(l,o[l].offset);for(o[n].offset=o[n].offset||100,s(n,o[n].offset),l=0;l<=n;l++){var h=o[l];e.addStop(h.color,h.offset)}return e},i.gradientLinear=function(t,e,i,n){return d(this.defs,t,e,i,n)},i.gradientRadial=function(t,e,i,n,o){return u(this.defs,t,e,i,n,o)},i.toString=function(){var t=this.node.ownerDocument,e=t.createDocumentFragment(),t=t.createElement("div"),i=this.node.cloneNode(!0);return e.appendChild(t),t.appendChild(i),s._.$(i,{xmlns:"http://www.w3.org/2000/svg"}),i=t.innerHTML,e.removeChild(e.firstChild),i},i.toDataURL=function(){if(I&&I.btoa)return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this)))},i.clear=function(){for(var t,e=this.node.firstChild;e;)t=e.nextSibling,"defs"!=e.tagName?e.parentNode.removeChild(e):i.clear.call({node:e}),e=t}}),t.plugin(function(x,y,t,e){var i=y.prototype,T=x.is,d=x._.clone,n="hasOwnProperty",o=/,?([a-z]),?/gi,C=parseFloat,w=Math,N=w.PI,I=w.min,_=w.max,v=w.pow,E=w.abs;function A(e){var i=A.ps=A.ps||{};return i[e]?i[e].sleep=100:i[e]={sleep:100},setTimeout(function(){for(var t in i)i[n](t)&&t!=e&&(i[t].sleep--,i[t].sleep||delete i[t])}),i[e]}function f(t,e,i,n){return null==t&&(t=e=i=n=0),null==e&&(e=t.y,i=t.width,n=t.height,t=t.x),{x:t,y:e,width:i,w:i,height:n,h:n,x2:t+i,y2:e+n,cx:t+i/2,cy:e+n/2,r1:w.min(i,n)/2,r2:w.max(i,n)/2,r0:w.sqrt(i*i+n*n)/2,path:p(t,e,i,n),vb:[t,e,i,n].join(" ")}}function P(){return this.join(",").replace(o,"$1")}function b(t){t=d(t);return t.toString=P,t}function S(t,e,i,n,o,a,r,s,l){return null==l?O(t,e,i,n,o,a,r,s):M(t,e,i,n,o,a,r,s,function(t,e,i,n,o,a,r,s,l){if(!(l<0||O(t,e,i,n,o,a,r,s)<l)){var h,c=.5,p=1-c;for(h=O(t,e,i,n,o,a,r,s,p);.01<E(h-l);)h=O(t,e,i,n,o,a,r,s,p+=(h<l?1:-1)*(c/=2));return p}}(t,e,i,n,o,a,r,s,l))}function a(g,u){function f(t){return+(+t).toFixed(3)}return x._.cacher(function(t,e,c){for(var i,n,o,a,r,s="",l={},h=0,p=0,d=(t=Y(t=t instanceof y?t.attr("d"):t)).length;p<d;p++){if("M"==(o=t[p])[0])i=+o[1],n=+o[2];else{if(e<h+(a=S(i,n,o[1],o[2],o[3],o[4],o[5],o[6]))){if(u&&!l.start){if(s+=["C"+f((r=S(i,n,o[1],o[2],o[3],o[4],o[5],o[6],e-h)).start.x),f(r.start.y),f(r.m.x),f(r.m.y),f(r.x),f(r.y)],c)return s;l.start=s,s=["M"+f(r.x),f(r.y)+"C"+f(r.n.x),f(r.n.y),f(r.end.x),f(r.end.y),f(o[5]),f(o[6])].join(),h+=a,i=+o[5],n=+o[6];continue}if(!g&&!u)return r=S(i,n,o[1],o[2],o[3],o[4],o[5],o[6],e-h)}h+=a,i=+o[5],n=+o[6]}s+=o.shift()+o}return l.end=s,r=g?h:u?l:M(i,n,o[0],o[1],o[2],o[3],o[4],o[5],1)},null,x._.clone)}var r=a(1),s=a(),l=a(0,1);function M(t,e,i,n,o,a,r,c,s){var l=1-s,p=v(l,3),d=v(l,2),h=s*s,g=h*s,u=t+2*s*(i-t)+h*(o-2*i+t),f=e+2*s*(n-e)+h*(a-2*n+e),m=i+2*s*(o-i)+h*(r-2*o+i),h=n+2*s*(a-n)+h*(c-2*a+n);return{x:p*t+3*d*s*i+3*l*s*s*o+g*r,y:p*e+3*d*s*n+3*l*s*s*a+g*c,m:{x:u,y:f},n:{x:m,y:h},start:{x:l*t+s*i,y:l*e+s*n},end:{x:l*o+s*r,y:l*a+s*c},alpha:90-180*w.atan2(u-m,f-h)/N}}function k(t,e,i,n,o,a,r,s){x.is(t,"array")||(t=[t,e,i,n,o,a,r,s]);e=G.apply(null,t);return f(e.min.x,e.min.y,e.max.x-e.min.x,e.max.y-e.min.y)}function m(t,e,i){return e>=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function R(t,e){return t=f(t),m(e=f(e),t.x,t.y)||m(e,t.x2,t.y)||m(e,t.x,t.y2)||m(e,t.x2,t.y2)||m(t,e.x,e.y)||m(t,e.x2,e.y)||m(t,e.x,e.y2)||m(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}function L(t,e,i,n,o){return t*(t*(-3*e+9*i-9*n+3*o)+6*e-12*i+6*n)-3*e+3*i}function O(t,e,i,n,c,p,d,g,o){for(var a=(o=1<(o=null==o?1:o)?1:o<0?0:o)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],r=0,s=0;s<12;s++){var l=a*u[s]+a,h=L(l,t,i,c,d),l=L(l,e,n,p,g);r+=f[s]*w.sqrt(h*h+l*l)}return a*r}function F(c,p,d){if(!R(k(c),k(p)))return d?0:[];for(var t=~~(O.apply(0,c)/8),e=~~(O.apply(0,p)/8),g=[],u=[],f={},m=d?0:[],i=0;i<1+t;i++){var n=M.apply(0,c.concat(i/t));g.push({x:n.x,y:n.y,t:i/t})}for(i=0;i<1+e;i++)n=M.apply(0,p.concat(i/e)),u.push({x:n.x,y:n.y,t:i/e});for(i=0;i<t;i++)for(var y=0;y<e;y++){var o=g[i],a=g[i+1],r=u[y],s=u[y+1],l=E(a.x-o.x)<.001?"y":"x",v=E(s.x-r.x)<.001?"y":"x",h=function(t,e,i,n,o,a,r,s){if(!(_(t,i)<I(o,r)||I(t,i)>_(o,r)||_(e,n)<I(a,s)||I(e,n)>_(a,s))){var c=(t*n-e*i)*(o-r)-(t-i)*(o*s-a*r),p=(t*n-e*i)*(a-s)-(e-n)*(o*s-a*r),l=(t-i)*(a-s)-(e-n)*(o-r);if(l){var c=c/l,p=p/l,l=+c.toFixed(2),h=+p.toFixed(2);if(!(l<+I(t,i).toFixed(2)||l>+_(t,i).toFixed(2)||l<+I(o,r).toFixed(2)||l>+_(o,r).toFixed(2)||h<+I(e,n).toFixed(2)||h>+_(e,n).toFixed(2)||h<+I(a,s).toFixed(2)||h>+_(a,s).toFixed(2)))return{x:c,y:p}}}}(o.x,o.y,a.x,a.y,r.x,r.y,s.x,s.y);h&&f[h.x.toFixed(4)]!=h.y.toFixed(4)&&(f[h.x.toFixed(4)]=h.y.toFixed(4),l=o.t+E((h[l]-o[l])/(a[l]-o[l]))*(a.t-o.t),a=r.t+E((h[v]-r[v])/(s[v]-r[v]))*(s.t-r.t),0<=l&&l<=1&&0<=a&&a<=1&&(d?m++:m.push({x:h.x,y:h.y,t1:l,t2:a})))}return m}function h(t,e,c){t=Y(t),e=Y(e);for(var i,n,p,d,g,u,o,a,f=c?0:[],m=0,y=t.length;m<y;m++){var r=t[m];if("M"==r[0])i=p=r[1],v=d=r[2];else for(var v="C"==r[0]?(i=(o=[i,v].concat(r.slice(1)))[6],o[7]):(o=[i,v,i,v,p,d,p,d],i=p,d),I=0,_=e.length;I<_;I++){var s=e[I];if("M"==s[0])n=g=s[1],A=u=s[2];else{var A="C"==s[0]?(n=(a=[n,A].concat(s.slice(1)))[6],a[7]):(a=[n,A,n,A,g,u,g,u],n=g,u),l=F(o,a,c);if(c)f+=l;else{for(var h=0,b=l.length;h<b;h++)l[h].segment1=m,l[h].segment2=I,l[h].bez1=o,l[h].bez2=a;f=f.concat(l)}}}}return f}function c(t){var e=A(t);if(e.bbox)return d(e.bbox);if(!t)return f();for(var i,n,o=0,a=0,r=[],s=[],l=0,c=(t=Y(t)).length;l<c;l++)"M"==(n=t[l])[0]?(o=n[1],a=n[2],r.push(o),s.push(a)):(i=G(o,a,n[1],n[2],n[3],n[4],n[5],n[6]),r=r.concat(i.min.x,i.max.x),s=s.concat(i.min.y,i.max.y),o=n[5],a=n[6]);var h=I.apply(0,r),p=I.apply(0,s),h=f(h,p,_.apply(0,r)-h,_.apply(0,s)-p);return e.bbox=d(h),h}function p(t,e,i,n,o){if(o)return[["M",+t+ +o,e],["l",i-2*o,0],["a",o,o,0,0,1,o,o],["l",0,n-2*o],["a",o,o,0,0,1,-o,o],["l",2*o-i,0],["a",o,o,0,0,1,-o,-o],["l",0,2*o-n],["a",o,o,0,0,1,o,-o],["z"]];o=[["M",t,e],["l",i,0],["l",0,n],["l",-i,0],["z"]];return o.toString=P,o}function D(t,e,i,n,o){var a,r,s;return null==o&&null==n&&(n=i),t=+t,e=+e,i=+i,n=+n,(s=null!=o?(a=Math.PI/180,s=t+i*Math.cos(-n*a),r=t+i*Math.cos(-o*a),[["M",s,e+i*Math.sin(-n*a)],["A",i,i,0,+(180<o-n),0,r,e+i*Math.sin(-o*a)]]):[["M",t,e],["m",0,-n],["a",i,n,0,1,1,0,2*n],["a",i,n,0,1,1,0,-2*n],["z"]]).toString=P,s}var g=x._unit2px,u={path:function(t){return t.attr("path")},circle:function(t){t=g(t);return D(t.cx,t.cy,t.r)},ellipse:function(t){t=g(t);return D(t.cx||0,t.cy||0,t.rx,t.ry)},rect:function(t){t=g(t);return p(t.x||0,t.y||0,t.width,t.height,t.rx,t.ry)},image:function(t){t=g(t);return p(t.x||0,t.y||0,t.width,t.height)},line:function(t){return"M"+[t.attr("x1")||0,t.attr("y1")||0,t.attr("x2"),t.attr("y2")]},polyline:function(t){return"M"+t.attr("points")},polygon:function(t){return"M"+t.attr("points")+"z"},deflt:function(t){t=t.node.getBBox();return p(t.x,t.y,t.width,t.height)}};function B(t){var c=A(t);if(c.abs)return b(c.abs);if(!(t=!T(t,"array")||!T(t&&t[0],"array")?x.parsePathString(t):t)||!t.length)return[["M",0,0]];for(var e,i,n,o=[],a=0,r=0,s=0,p=0,d=0,g=("M"==t[0][0]&&(s=a=+t[0][1],p=r=+t[0][2],d++,o[0]=["M",a,r]),3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase()),u=d,f=t.length;u<f;u++){if(o.push(i=[]),(e=(n=t[u])[0])!=e.toUpperCase())switch(i[0]=e.toUpperCase(),i[0]){case"A":i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=+n[6]+a,i[7]=+n[7]+r;break;case"V":i[1]=+n[1]+r;break;case"H":i[1]=+n[1]+a;break;case"R":for(var l=[a,r].concat(n.slice(1)),h=2,m=l.length;h<m;h++)l[h]=+l[h]+a,l[++h]=+l[h]+r;o.pop(),o=o.concat(W(l,g));break;case"O":o.pop(),(l=D(a,r,n[1],n[2])).push(l[0]),o=o.concat(l);break;case"U":o.pop(),o=o.concat(D(a,r,n[1],n[2],n[3])),i=["U"].concat(o[o.length-1].slice(-2));break;case"M":s=+n[1]+a,p=+n[2]+r;default:for(h=1,m=n.length;h<m;h++)i[h]=+n[h]+(h%2?a:r)}else if("R"==e)l=[a,r].concat(n.slice(1)),o.pop(),o=o.concat(W(l,g)),i=["R"].concat(n.slice(-2));else if("O"==e)o.pop(),(l=D(a,r,n[1],n[2])).push(l[0]),o=o.concat(l);else if("U"==e)o.pop(),o=o.concat(D(a,r,n[1],n[2],n[3])),i=["U"].concat(o[o.length-1].slice(-2));else for(var y=0,v=n.length;y<v;y++)i[y]=n[y];if("O"!=(e=e.toUpperCase()))switch(i[0]){case"Z":a=+s,r=+p;break;case"H":a=i[1];break;case"V":r=i[1];break;case"M":s=i[i.length-2],p=i[i.length-1];default:a=i[i.length-2],r=i[i.length-1]}}return o.toString=P,c.abs=b(o),o}function U(t,e,i,n){return[t,e,i,n,i,n]}function z(t,e,i,n,o,a){return[1/3*t+2/3*i,1/3*e+2/3*n,1/3*o+2/3*i,1/3*a+2/3*n,o,a]}function H(c,p,t,e,d,i,g,n,o,u){var f=120*N/180,m=N/180*(+d||0),y=[],v=x._.cacher(function(t,e,i){return{x:t*w.cos(i)-e*w.sin(i),y:t*w.sin(i)+e*w.cos(i)}}),i=(u?(l=u[0],h=u[1],I=u[2],_=u[3]):(c=(r=v(c,p,-m)).x,p=r.y,n=(r=v(n,o,-m)).x,o=r.y,w.cos(N/180*d),w.sin(N/180*d),1<(a=(r=(c-n)/2)*r/(t*t)+(s=(p-o)/2)*s/(e*e))&&(t*=a=w.sqrt(a),e*=a),I=(a=(i==g?-1:1)*w.sqrt(E(((a=t*t)*(i=e*e)-a*s*s-i*r*r)/(a*s*s+i*r*r))))*t*s/e+(c+n)/2,l=w.asin(((p-(_=a*-e*r/t+(p+o)/2))/e).toFixed(9)),h=w.asin(((o-_)/e).toFixed(9)),(l=c<I?N-l:l)<0&&(l=2*N+l),(h=n<I?N-h:h)<0&&(h=2*N+h),g&&h<l&&(l-=2*N),!g&&l<h&&(h-=2*N)),h-l),f=(E(i)>f&&(s=h,a=n,r=o,y=H(n=I+t*w.cos(h=l+f*(g&&l<h?1:-1)),o=_+e*w.sin(h),t,e,d,0,g,a,r,[h,s,I,_])),i=h-l,w.cos(l)),d=w.sin(l),g=w.cos(h),a=w.sin(h),r=w.tan(i/4),s=4/3*t*r,I=4/3*e*r,_=[c,p],l=[c+s*d,p-I*f],h=[n+s*a,o-I*g],i=[n,o];if(l[0]=2*_[0]-l[0],l[1]=2*_[1]-l[1],u)return[l,h,i].concat(y);for(var A=[],b=0,T=(y=[l,h,i].concat(y).join().split(",")).length;b<T;b++)A[b]=b%2?v(y[b-1],y[b],m).y:v(y[b],y[b+1],m).x;return A}function G(t,e,c,p,d,g,u,f){for(var i,n,o,a,m,r=[],s=[[],[]],y=0;y<2;++y)a=0==y?(n=6*t-12*c+6*d,i=-3*t+9*c-9*d+3*u,3*c-3*t):(n=6*e-12*p+6*g,i=-3*e+9*p-9*g+3*f,3*p-3*e),E(i)<1e-12?E(n)<1e-12||0<(o=-a/n)&&o<1&&r.push(o):(m=w.sqrt(a=n*n-4*a*i),a<0||(0<(a=(-n+m)/(2*i))&&a<1&&r.push(a),0<(a=(-n-m)/(2*i))&&a<1&&r.push(a)));for(var l,h=r.length,v=h;h--;)o=r[h],s[0][h]=(l=1-o)*l*l*t+3*l*l*o*c+3*l*o*o*d+o*o*o*u,s[1][h]=l*l*l*e+3*l*l*o*p+3*l*o*o*g+o*o*o*f;return s[0][v]=t,s[1][v]=e,s[0][v+1]=u,s[1][v+1]=f,s[0].length=s[1].length=v+2,{min:{x:I.apply(0,s[0]),y:I.apply(0,s[1])},max:{x:_.apply(0,s[0]),y:_.apply(0,s[1])}}}function Y(c,p){var d=!p&&A(c);if(!p&&d.curve)return b(d.curve);function g(t,e,i){var n,o;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(t[0]in{T:1,Q:1}||(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(H.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":o="C"==i||"S"==i?(n=2*e.x-e.bx,2*e.y-e.by):(n=e.x,e.y),t=["C",n,o].concat(t.slice(1));break;case"T":"Q"==i||"T"==i?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(z(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(z(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(U(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(U(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(U(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(U(e.x,e.y,e.X,e.Y))}return t}function u(t,e){if(7<t[e].length){t[e].shift();for(var i=t[e];i.length;)n[e]="A",r&&(o[e]="A"),t.splice(e++,0,["C"].concat(i.splice(0,6)));t.splice(e,1),y=_(a.length,r&&r.length||0)}}function f(t,e,i,n,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",n.x,n.y]),i.bx=0,i.by=0,i.x=t[o][1],i.y=t[o][2],y=_(a.length,r&&r.length||0))}for(var a=B(c),r=p&&B(p),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},n=[],o=[],i="",m="",s=0,y=_(a.length,r&&r.length||0);s<y;s++){"C"!=(i=a[s]?a[s][0]:i)&&(n[s]=i,s&&(m=n[s-1])),a[s]=g(a[s],t,m),"A"!=n[s]&&"C"==i&&(n[s]="C"),u(a,s),r&&("C"!=(i=r[s]?r[s][0]:i)&&(o[s]=i,s&&(m=o[s-1])),r[s]=g(r[s],e,m),"A"!=o[s]&&"C"==i&&(o[s]="C"),u(r,s)),f(a,r,t,e,s),f(r,a,e,t,s);var l=a[s],h=r&&r[s],v=l.length,I=r&&h.length;t.x=l[v-2],t.y=l[v-1],t.bx=C(l[v-4])||t.x,t.by=C(l[v-3])||t.y,e.bx=r&&(C(h[I-4])||e.x),e.by=r&&(C(h[I-3])||e.y),e.x=r&&h[I-2],e.y=r&&h[I-1]}return r||(d.curve=b(a)),r?[a,r]:a}function W(t,e){for(var i=[],n=0,o=t.length;n<o-2*!e;n+=2){var a=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?o-4==n?a[3]={x:+t[0],y:+t[1]}:o-2==n&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[o-2],y:+t[o-1]}:o-4==n?a[3]=a[2]:n||(a[0]={x:+t[n],y:+t[n+1]}),i.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return i}x.path=A,x.path.getTotalLength=r,x.path.getPointAtLength=s,x.path.getSubpath=function(t,e,i){if(this.getTotalLength(t)-i<1e-6)return l(t,e).end;t=l(t,i,1);return e?l(t,e).end:t},i.getTotalLength=function(){if(this.node.getTotalLength)return this.node.getTotalLength()},i.getPointAtLength=function(t){return s(this.attr("d"),t)},i.getSubpath=function(t,e){return x.path.getSubpath(this.attr("d"),t,e)},x._.box=f,x.path.findDotsAtSegment=M,x.path.bezierBBox=k,x.path.isPointInsideBBox=m,x.closest=function(t,e,i,c){for(var n=100,o=f(t-n/2,e-n/2,n,n),a=[],p=i[0].hasOwnProperty("x")?function(t){return{x:i[t].x,y:i[t].y}}:function(t){return{x:i[t],y:c[t]}},r=0;n<=1e6&&!r;){for(var s=0,l=i.length;s<l;s++){var h=p(s);if(m(o,h.x,h.y)){r++,a.push(h);break}}r||(o=f(t-(n*=2)/2,e-n/2,n,n))}if(1e6!=n){for(var d,g=1/0,s=0,l=a.length;s<l;s++){var u=x.len(t,e,a[s].x,a[s].y);u<g&&(a[s].len=g=u,d=a[s])}return d}},x.path.isBBoxIntersect=R,x.path.intersection=function(t,e){return h(t,e)},x.path.intersectionNumber=function(t,e){return h(t,e,1)},x.path.isPointInside=function(t,e,i){var n=c(t);return m(n,e,i)&&h(t,[["M",e,i],["H",n.x2+10]],1)%2==1},x.path.getBBox=c,x.path.get=u,x.path.toRelative=function(t){var c=A(t),p=String.prototype.toLowerCase;if(c.rel)return b(c.rel);var e=[],i=0,n=0,o=0,a=0,d=0;"M"==(t=!x.is(t,"array")||!x.is(t&&t[0],"array")?x.parsePathString(t):t)[0][0]&&(o=i=t[0][1],a=n=t[0][2],d++,e.push(["M",i,n]));for(var r=d,g=t.length;r<g;r++){var s=e[r]=[],l=t[r];if(l[0]!=p.call(l[0]))switch(s[0]=p.call(l[0]),s[0]){case"a":s[1]=l[1],s[2]=l[2],s[3]=l[3],s[4]=l[4],s[5]=l[5],s[6]=+(l[6]-i).toFixed(3),s[7]=+(l[7]-n).toFixed(3);break;case"v":s[1]=+(l[1]-n).toFixed(3);break;case"m":o=l[1],a=l[2];default:for(var h=1,u=l.length;h<u;h++)s[h]=+(l[h]-(h%2?i:n)).toFixed(3)}else{s=e[r]=[],"m"==l[0]&&(o=l[1]+i,a=l[2]+n);for(var f=0,m=l.length;f<m;f++)e[r][f]=l[f]}var y=e[r].length;switch(e[r][0]){case"z":i=o,n=a;break;case"h":i+=+e[r][y-1];break;case"v":n+=+e[r][y-1];break;default:i+=+e[r][y-2],n+=+e[r][y-1]}}return e.toString=P,c.rel=b(e),e},x.path.toAbsolute=B,x.path.toCubic=Y,x.path.map=function(t,e){if(!e)return t;for(var i,n,o,a,r,s=0,l=(t=Y(t)).length;s<l;s++)for(o=1,a=(r=t[s]).length;o<a;o+=2)i=e.x(r[o],r[o+1]),n=e.y(r[o],r[o+1]),r[o]=i,r[o+1]=n;return t},x.path.toString=P,x.path.clone=b}),t.plugin(function(p,t,e,i){function l(t){if(this.items=[],this.bindings={},this.length=0,this.type="set",t)for(var e=0,i=t.length;e<i;e++)t[e]&&(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)}var h=Math.max,c=Math.min,n=l.prototype;n.push=function(){for(var t,e,i=0,n=arguments.length;i<n;i++)(t=arguments[i])&&(this[e=this.items.length]=this.items[e]=t,this.length++);return this},n.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},n.forEach=function(t,e){for(var i=0,n=this.items.length;i<n;i++)if(!1===t.call(e,this.items[i],i))return this;return this},n.animate=function(i,n,o,t){"function"!=typeof o||o.length||(t=o,o=_.linear),i instanceof p._.Animation&&(t=i.callback,o=i.easing,n=o.dur,i=i.attr);var a,r=arguments;p.is(i,"array")&&p.is(r[r.length-1],"array")&&(a=!0);function s(){e?this.b=e:e=this.b}var e,l=0,h=this,c=t&&function(){++l==h.length&&t.call(this)};return this.forEach(function(t,e){V.once("snap.animcreated."+t.id,s),a?r[e]&&t.animate.apply(t,r[e]):t.animate(i,n,o,c)})},n.remove=function(){for(;this.length;)this.pop().remove();return this},n.bind=function(t,e,i){var n,o={};return"function"==typeof e?this.bindings[t]=e:(n=i||t,this.bindings[t]=function(t){o[n]=t,e.attr(o)}),this},n.attr=function(t){var e,i={};for(e in t)this.bindings[e]?this.bindings[e](t[e]):i[e]=t[e];for(var n=0,o=this.items.length;n<o;n++)this.items[n].attr(i);return this},n.clear=function(){for(;this.length;)this.pop()},n.splice=function(t,e,i){t=t<0?h(this.length+t,0):t,e=h(0,c(this.length-t,e));for(var n=[],o=[],a=[],r=2;r<arguments.length;r++)a.push(arguments[r]);for(r=0;r<e;r++)o.push(this[t+r]);for(;r<this.length-t;r++)n.push(this[t+r]);var s=a.length;for(r=0;r<s+n.length;r++)this.items[t+r]=this[t+r]=r<s?a[r]:n[r-s];for(r=this.items.length=this.length-=e-s;this[r];)delete this[r++];return new l(o)},n.exclude=function(t){for(var e=0,i=this.length;e<i;e++)if(this[e]==t)return this.splice(e,1),!0;return!1},n.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},n.getBBox=function(){for(var t,e=[],i=[],n=[],o=[],a=this.items.length;a--;)this.items[a].removed||(t=this.items[a].getBBox(),e.push(t.x),i.push(t.y),n.push(t.x+t.width),o.push(t.y+t.height));return{x:e=c.apply(0,e),y:i=c.apply(0,i),x2:n=h.apply(0,n),y2:o=h.apply(0,o),width:n-e,height:o-i,cx:e+(n-e)/2,cy:i+(o-i)/2}},n.clone=function(t){t=new l;for(var e=0,i=this.items.length;e<i;e++)t.push(this.items[e].clone());return t},n.toString=function(){return"Snap‘s set"},n.type="set",p.Set=l,p.set=function(){var t=new l;return arguments.length&&t.push.apply(t,Array.prototype.slice.call(arguments,0)),t}}),t.plugin(function(I,t,e,i){var _={},A=/[a-z]+$/i,b=String;function T(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}}function x(t){return t}function C(t){return t.join(" ")}function P(t){return I.rgb(t[0],t[1],t[2])}function w(t){for(var e,i,n,o,a=0,r=[],s=0,l=t.length;s<l;s++){for(n="[",o=['"'+t[s][0]+'"'],e=1,i=t[s].length;e<i;e++)o[e]="val["+a+++"]";n+=o+"]",r[s]=n}return Function("val","return Snap.path.toString.call(["+r+"])")}function N(t){for(var e=[],i=0,n=t.length;i<n;i++)for(var o=1,a=t[i].length;o<a;o++)e.push(t[i][o]);return e}function E(t){return isFinite(parseFloat(t))}_.stroke=_.fill="colour",t.prototype.equal=function(t,e){return V("snap.util.equal",this,t,e).firstDefined()},V.on("snap.util.equal",function(t,e){var c=b(this.attr(t)||""),p=this;if(E(c)&&E(e))return{from:parseFloat(c),to:parseFloat(e),f:x};if("colour"==_[t])return l=I.color(c),h=I.color(e),{from:[l.r,l.g,l.b,l.opacity],to:[h.r,h.g,h.b,h.opacity],f:P};if("viewBox"==t)return{from:l=this.attr(t).vb.split(" ").map(Number),to:h=e.split(" ").map(Number),f:C};if("transform"==t||"gradientTransform"==t||"patternTransform"==t){e instanceof I.Matrix&&(e=e.toTransformString()),I._.rgTransform.test(e)||(e=I._.svgTransform2string(e));var i=c,n=e,d=function(){return p.getBBox(1)};n=b(n).replace(/\.{3}|\u2026/g,i),i=I.parseTransformString(i)||[],n=I.parseTransformString(n)||[];for(var o,g,a,r,u=Math.max(i.length,n.length),f=[],m=[],s=0;s<u;s++){if(a=i[s]||T(n[s]),r=n[s]||T(a),a[0]!=r[0]||"r"==a[0].toLowerCase()&&(a[2]!=r[2]||a[3]!=r[3])||"s"==a[0].toLowerCase()&&(a[3]!=r[3]||a[4]!=r[4])){i=I._.transform2matrix(i,d()),n=I._.transform2matrix(n,d()),f=[["m",i.a,i.b,i.c,i.d,i.e,i.f]],m=[["m",n.a,n.b,n.c,n.d,n.e,n.f]];break}for(f[s]=[],m[s]=[],o=0,g=Math.max(a.length,r.length);o<g;o++)o in a&&(f[s][o]=a[o]),o in r&&(m[s][o]=r[o])}return{from:N(f),to:N(m),f:w(f)}}if("d"==t||"path"==t)return{from:N((l=I.path.toCubic(c,e))[0]),to:N(l[1]),f:w(l[0])};if("points"==t)return{from:l=b(c).split(I._.separator),to:h=b(e).split(I._.separator),f:function(t){return t}};var y,v,l=c.match(A),h=b(e).match(A);return l&&(v=l,h=h,I.is(v,"array")&&I.is(h,"array")&&v.toString()==h.toString())?{from:parseFloat(c),to:parseFloat(e),f:(y=l,function(t){return+t.toFixed(3)+y})}:{from:this.asPX(t),to:this.asPX(t,e),f:x}})}),t.plugin(function(c,e,n,i){function v(){return this.originalEvent.preventDefault()}function I(){return this.originalEvent.stopPropagation()}function a(r,s,l,h){function t(t){var e=g("y",h),i=g("x",h);if(p&&d.hasOwnProperty(s))for(var n=0,o=t.targetTouches&&t.targetTouches.length;n<o;n++)if(t.targetTouches[n].target==r||r.contains(t.targetTouches[n].target)){var a=t;(t=t.targetTouches[n]).originalEvent=a,t.preventDefault=v,t.stopPropagation=I;break}return i=t.clientX+i,e=t.clientY+e,l.call(h,t,i,e)}var e=p&&d[s]?d[s]:s;return s!==e&&r.addEventListener(s,t,!1),r.addEventListener(e,t,!1),function(){return s!==e&&r.removeEventListener(s,t,!1),r.removeEventListener(e,t,!1),!0}}for(var t=e.prototype,p=("createTouch"in i.doc),o=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],d={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},g=function(t,e){t="y"==t?"scrollTop":"scrollLeft",e=e&&e.node?e.node.ownerDocument:i.doc;return e[t in e.documentElement?"documentElement":"body"][t]},u=[],f=function(t){for(var e,i=t.clientX,n=t.clientY,o=g("y"),a=g("x"),r=u.length;r--;){if(e=u[r],p){for(var s,l=t.touches&&t.touches.length;l--;)if((s=t.touches[l]).identifier==e.el._drag.id||e.el.node.contains(s.target)){i=s.clientX,n=s.clientY,(t.originalEvent||t).preventDefault();break}}else t.preventDefault();var h=e.el.node;h.nextSibling,h.parentNode,h.style.display;i+=a,n+=o,V("snap.drag.move."+e.el.id,e.move_scope||e.el,i-e.el._drag.x,n-e.el._drag.y,i,n,t)}},m=function(t){c.unmousemove(f).unmouseup(m);for(var e,i=u.length;i--;)(e=u[i]).el._drag={},V("snap.drag.end."+e.el.id,e.end_scope||e.start_scope||e.move_scope||e.el,t),V.off("snap.drag.*."+e.el.id);u=[]},r=o.length;r--;)!function(o){c[o]=t[o]=function(t,e){if(c.is(t,"function"))this.events=this.events||[],this.events.push({name:o,f:t,unbind:a(this.node||document,o,t,e||this)});else for(var i=0,n=this.events.length;i<n;i++)if(this.events[i].name==o)try{this.events[i].f.call(this)}catch(t){}return this},c["un"+o]=t["un"+o]=function(t){for(var e=this.events||[],i=e.length;i--;)if(e[i].name==o&&(e[i].f==t||!t))return e[i].unbind(),e.splice(i,1),e.length||delete this.events,this;return this}}(o[r]);t.hover=function(t,e,i,n){return this.mouseover(t,i).mouseout(e,n||i)},t.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var y=[];t.drag=function(n,o,a,r,s,h){var i,l=this;return arguments.length?(V.on("snap.draginit."+l.id,t),l._drag={},y.push({el:l,start:t,init:e}),l.mousedown(e),l):l.drag(function(t,e){this.attr({transform:i+(i?"T":"t")+[t,e]})},function(){i=this.transform().local});function t(t,e,i){(t.originalEvent||t).preventDefault(),l._drag.x=e,l._drag.y=i,l._drag.id=t.identifier,u.length||c.mousemove(f).mouseup(m),u.push({el:l,move_scope:r,start_scope:s,end_scope:h}),o&&V.on("snap.drag.start."+l.id,o),n&&V.on("snap.drag.move."+l.id,n),a&&V.on("snap.drag.end."+l.id,a),V("snap.drag.start."+l.id,s||r||l,e,i,t)}function e(t,e,i){V("snap.draginit."+l.id,l,t,e,i)}},t.undrag=function(){for(var t=y.length;t--;)y[t].el==this&&(this.unmousedown(y[t].init),y.splice(t,1),V.unbind("snap.drag.*."+this.id),V.unbind("snap.draginit."+this.id));return y.length||c.unmousemove(f).unmouseup(m),this}}),t.plugin(function(a,o,t,e){o.prototype;var t=t.prototype,i=/^\s*url\((.+)\)/,r=String,s=a._.$;a.filter={},t.filter=function(t){var e=this,t=("svg"!=e.type&&(e=e.paper),a.parse(r(t))),i=a._.id(),n=(e.node.offsetWidth,e.node.offsetHeight,s("filter"));return s(n,{id:i,filterUnits:"userSpaceOnUse"}),n.appendChild(t.node),e.defs.appendChild(n),new o(n)},V.on("snap.util.getattr.filter",function(){V.stop();var t=s(this.node,"filter");if(t)return(t=r(t).match(i))&&a.select(t[1])}),V.on("snap.util.attr.filter",function(t){var e;t instanceof o&&"filter"==t.type&&(V.stop(),(e=t.node.id)||(s(t.node,{id:t.id}),e=t.id),s(this.node,{filter:a.url(e)})),t&&"none"!=t||(V.stop(),this.node.removeAttribute("filter"))}),a.filter.blur=function(t,e){return null==t&&(t=2),a.format('<feGaussianBlur stdDeviation="{def}"/>',{def:null==e?t:[t,e]})},a.filter.blur.toString=function(){return this()},a.filter.shadow=function(t,e,i,n,o){return"string"==typeof i&&(o=n=i,i=4),"string"!=typeof n&&(o=n,n="#000"),null==i&&(i=4),null==o&&(o=1),null==t&&(t=0,e=2),null==e&&(e=t),n=a.color(n=n||"#000"),a.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>',{color:n,dx:t,dy:e,blur:i,opacity:o})},a.filter.shadow.toString=function(){return this()},a.filter.grayscale=function(t){return a.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>',{a:.2126+.7874*(1-(t=null==t?1:t)),b:.7152-.7152*(1-t),c:.0722-.0722*(1-t),d:.2126-.2126*(1-t),e:.7152+.2848*(1-t),f:.0722-.0722*(1-t),g:.2126-.2126*(1-t),h:.0722+.9278*(1-t)})},a.filter.grayscale.toString=function(){return this()},a.filter.sepia=function(t){return a.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>',{a:.393+.607*(1-(t=null==t?1:t)),b:.769-.769*(1-t),c:.189-.189*(1-t),d:.349-.349*(1-t),e:.686+.314*(1-t),f:.168-.168*(1-t),g:.272-.272*(1-t),h:.534-.534*(1-t),i:.131+.869*(1-t)})},a.filter.sepia.toString=function(){return this()},a.filter.saturate=function(t){return a.format('<feColorMatrix type="saturate" values="{amount}"/>',{amount:1-(t=null==t?1:t)})},a.filter.saturate.toString=function(){return this()},a.filter.hueRotate=function(t){return a.format('<feColorMatrix type="hueRotate" values="{angle}"/>',{angle:t=t||0})},a.filter.hueRotate.toString=function(){return this()},a.filter.invert=function(t){return a.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>',{amount:t=null==t?1:t,amount2:1-t})},a.filter.invert.toString=function(){return this()},a.filter.brightness=function(t){return a.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>',{amount:t=null==t?1:t})},a.filter.brightness.toString=function(){return this()},a.filter.contrast=function(t){return a.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>',{amount:t=null==t?1:t,amount2:.5-t/2})},a.filter.contrast.toString=function(){return this()}}),t.plugin(function(t,e,i,n,o){function a(){return"T"+this.dx+","+this.dy}var r=t._.box,s=t.is,l=/^[^a-z]*([tbmlrc])/i;e.prototype.getAlign=function(t,e){null==e&&s(t,"string")&&(e=t,t=null);var i=(t=t||this.paper).getBBox?t.getBBox():r(t),n=this.getBBox(),o={};switch(e=(e=e&&e.match(l))?e[1].toLowerCase():"c"){case"t":o.dx=0,o.dy=i.y-n.y;break;case"b":o.dx=0,o.dy=i.y2-n.y2;break;case"m":o.dx=0,o.dy=i.cy-n.cy;break;case"l":o.dx=i.x-n.x,o.dy=0;break;case"r":o.dx=i.x2-n.x2,o.dy=0;break;default:o.dx=i.cx-n.cx,o.dy=0}return o.toString=a,o},e.prototype.align=function(t,e){return this.transform("..."+this.getAlign(t,e))}}),t}),function(Y){"use strict";var T;"undefined"!=typeof Snap&&(T=Y.setting("annotationConfig"),Snap.plugin(function(B,t,e,i){var U=Y.Utils,z=Y.Type,I=0,_=0;t.prototype.changeattr=function(t,c){var p,d,e,g,u,i=this.attr("anntype"),n=[],o={},a=z.AnnotationType;for(t["fill-opacity"]&&(t["fill-opacity"]=U.toFloat(t["fill-opacity"],1)),i===a.LINE||i===a.POLYLINE||i===a.POLYCURVE||i===a.ARROWLINE?n=["stroke-width","stroke","stroke-dashstyle","stroke-linecap","left-arrow-shape","right-arrow-shape"]:i===a.CHECKMARK?n=["stroke-width","stroke"]:i===a.ARROWLINE?n=["stroke","stroke-width","left-arrow-shape","right-arrow-shape"]:i===a.MEMO||i===a.TEXT||i===a.EDITTEXT?n=["fill","stroke","font-size","font-color","font-style","font-weight","font-family"]:i===a.EDITTEXT?(n=["font-size","font-color","font-style","font-weight","font-family"],t["stroke-width"]=0):i===a.STICKYNOTE?n=["font-size","font-color","font-style","font-weight","font-family","fill","fill-opacity"]:i===a.HIGHLIGHTER?(n=["fill","fill-opacity"],0===U.toFloat(t["fill-opacity"],1)?(t.fill="#00ffffff",t["fill-opacity"]=.1):t["fill-opacity"]=T.highlighter.fillOpacity,t.stroke=t.fill):(n=["stroke-width","stroke","fill","fill-opacity"],i===a.POLYGON&&(t.fill=0===t["fill-opacity"]?"#ffffff":t.fill)),I=0,_=n.length;I<_;I++)p=t[n[I]],U.isNotEmpty(p)&&(o[n[I]]=p);if(o){if(i===z.AnnotationType.MEMO||i===z.AnnotationType.TEXT||i===z.AnnotationType.EDITTEXT||i===z.AnnotationType.STICKYNOTE){for(r=this.select("rect"),s=this.select("text"),l=U.toInt(r.attr("x")),m=U.toInt(r.attr("y")),h=20,y=U.toInt(r.attr("width"))+h,v=((f=U.toInt(t["font-size"]))+2*h)*s.node.childNodes.length,t["font-color"]=t["font-color"]||s.attr("fill"),s.attr({x:l,y:m,fontStyle:U.toNotEmpty(t["font-style"],"normal"),fontWeight:U.toNotEmpty(t["font-weight"],"normal"),fontSize:t["font-size"],fontFamily:t["font-family"],fill:t["font-color"]}),d=s.node.childNodes,g=y,I=0,_=d.length;I<_;I+=1)e=B(d[I]),void 0!==f&&"undefined"!==f||(f=U.toInt(e.node.style.fontSize)),g<(u=e.node.textContent.length*f)&&(g=u),e.attr("x",l+h),e.attr("y",m+(f*(I+(-1!==U.IEVersion()||U.isBrowser().wEdge()?1:0))+h/2)),e.attr("fill",t["font-color"]),e.attr("font-size",f+"px");var a=s.getBBox();r.attr({width:a.width+2*h,height:a.height+2*h,x:l,y:m,fill:t.fill||r.attr("fill")}),i===z.AnnotationType.STICKYNOTE&&r.attr("fillOpacity",t["fill-opacity"])}else if(i===z.AnnotationType.MEMOPAD){var f,a=this.select("g"),r=(a.select("path"),a.select("rect")),s=a.select("text"),l=U.toInt(r.attr("x")),m=U.toInt(r.attr("y")),h=4,y=U.toInt(r.attr("width"))+h,v=((f=U.toInt(t["font-size"]))+2*h)*s.node.childNodes.length;for(s.attr({x:l,y:m,fontStyle:U.toNotEmpty(t["font-style"],"normal"),fontWeight:U.toNotEmpty(t["font-weight"],"normal"),fontSize:t["font-size"],fontFamily:t["font-family"],stroke:t["font-color"],fill:"#ffffff","fill-opacity":.5}),d=s.node.childNodes,g=y,I=0,_=d.length;I<_;I+=1)g<(u=(e=B(d[I])).node.textContent.length*f)&&(g=u),e.attr("x",l+h),e.attr("y",m+(f*(I+1)+h)),e.attr("fill",t["font-color"]),e.attr("font-size",f+"px");r.attr({stroke:t.stroke,strokeWidth:1,fill:U.toNotEmpty(t.fill,"none"),width:g+2*h,height:v,x:l,y:m})}else i===z.AnnotationType.STAMP?(h=4,null===(r=this.select("rect"))&&(r=this.rect()),l=Y.Utils.toInt(t.x),m=Y.Utils.toInt(t.y),r.attr({width:Y.Utils.toInt(t.width)+2*h,height:Y.Utils.toInt(t.height),stroke:t.stroke||"#ff0000",strokeWidth:0===t["stroke-width"]?3:0,fill:"#ffffff",fillOpacity:1}),a=this.select("image"),t["image-href"]?(a=null===a?this.image():a).attr({"xlink:href":t["image-href"],x:l,y:m,width:t.width+2*h,height:t.height-(t["font-size"]*(-1!==U.IEVersion()||U.isBrowser().wEdge())?0:1)-2*h,preserveAspectRatio:"none"}):a&&a.remove(),s=this.select("text"),t.text?(1===t["text-halign"]?l=Y.Utils.toInt(t.x)+Y.Utils.toInt(t.width)/2:2===t["text-halign"]&&(l=Y.Utils.toInt(t.x)+Y.Utils.toInt(t.width)),s.attr({x:l+h,y:m+t.height-t["font-size"]-h,strokeWidth:"bold"===t["font-weight"]?2:1,"text-anchor":Y.Type.AnnotationAttribute.TEXT_ALIGN[t["text-halign"]],stroke:t["font-color"],fill:t["font-color"],"font-size":t["font-size"],"alignment-baseline":"hanging"}),s.node.textContent=t.text):s.remove()):i===z.AnnotationType.ARROWLINE?(y=this.select("line"),v=o["left-arrow-shape"]||Y.Utils.toNotEmpty(this.data("left-arrow-shape"),-1),r=o["right-arrow-shape"]||Y.Utils.toNotEmpty(this.data("right-arrow-shape"),-1),a=o["las-size"]||Y.Utils.toNotEmpty(this.data("las-size"),-1),s=o["ras-size"]||Y.Utils.toNotEmpty(this.data("ras-size"),-1),i=A(z.MarkerType.getByIndex(z.MarkerType.DIRECTION_LEFT,v),this.paper,o,a),this.data("markerLeft")&&this.data("markerLeft").remove(),this.data("markerLeft",i),o.markerStart=i,this.data("markerRight")&&this.data("markerRight").remove(),v=A(z.MarkerType.getByIndex(z.MarkerType.DIRECTION_RIGHT,r),this.paper,o,s),this.data("markerRight",v),o.markerEnd=v,y.attr(o)):this.attr(o);c.page.trigger("page"+c.page.pageIndex()+".change.annotation",c)}};var s="#ff0000",o=3,l="5,5";function A(t,e,i,n){var o,a=z.Marker;return a.hasOwnProperty(t)&&t!==z.MarkerType.NONE&&((t=(a=a[t]).attr).fill=i.stroke,t.stroke=i.stroke,i=U.toInt(t["fill-opacity"],0)<1?0:1,t["fill-opacity"]=i,o=e.path().attr(t).marker(0,0,a.markerWidth,a.markerHeight,a.refX,a.refY).attr({orient:a.orient,viewBox:a.viewBox,fill:t.stroke,"fill-opacity":i,markerUnits:a.markerUnits,markerWidth:(n||a.markerWidth)/2,markerHeight:(n||a.markerHeight)/2,type:a.type})),o}function n(t,e){var i,n=this.transform().globalMatrix.invert();n.e=n.f=0,i=n.x(t,e),n=n.y(t,e),this.data("x",+this.data("ox")+i),this.data("y",+this.data("oy")+n),this.data("x")>this.data("maxx")-this.data("ibb").width&&this.data("x",this.data("maxx")-this.data("ibb").width),this.data("y")>this.data("maxy")-this.data("ibb").height&&this.data("y",this.data("maxy")-this.data("ibb").height),this.data("x")<this.data("minx")&&this.data("x",this.data("minx")),this.data("y")<this.data("miny")&&this.data("y",this.data("miny")),this.transform(this.data("ot")+"t"+[this.data("x"),this.data("y")])}function h(t,e,i){this.data("ox",this.data("x")),this.data("oy",this.data("y"))}t.prototype.initDrag=function(t){var e,i=B(this.node.parentNode),n=B(this.node.ownerSVGElement),o=0;n.node.viewBox.animVal?e=n.node.viewBox.animVal:n.node.viewBox.baseVal&&(e=n.node.viewBox.baseVal),e.x<0&&e.y<0?o=180:e.x<0&&0<=e.y?o=90:0<=e.x&&e.y<0&&(o=270),this.data({parent:i,initMatrix:this.transform().localMatrix,rotate:o,tEl:this,item:t}),this.drag(r,a,c)},t.prototype.limitDrag=function(t){return this.data("minx",t.minx),this.data("miny",t.miny),this.data("maxx",t.maxx),this.data("maxy",t.maxy),this.data("x",t.x),this.data("y",t.y),this.data("ibb",this.getBBox()),this.data("ot",this.transform().local),this.drag(n,h),this},t.prototype.selected=function(t){!function(e){B(this.node.parentNode);this.data("isSelected",!0),this.data("initMatrix",this.transform().localMatrix);var t,i=B(this.node.ownerSVGElement),n=0;i.node.viewBox.animVal?t=i.node.viewBox.animVal:i.node.viewBox.baseVal&&(t=i.node.viewBox.baseVal);t.x<0&&t.y<0?n=180:t.x<0&&0<=t.y?n=90:0<=t.x&&t.y<0&&(n=270);this.data("rotate",n);i=function(t,c){var e,p=0,d=0,g=0,u=0,f=0,m=0,i=B(t.node.ownerSVGElement),y=i.g().addClass("sform-handler-group"),v=(t.data("handler-group",y),t.displayBBox(),t.data("bbT")),n=v.getBBox(),o=-1,a=[],I=t.attr("anntype")||"",r=0,_=0,s=!t.attr("strokeWidth")||U.toFloat(t.attr("strokeWidth"))<16?16:U.toFloat(t.attr("strokeWidth"))+10,l=s;if(a[++o]=v,y.data("tEl",t),c.resizable())if("rect"===c.selectionHandleType)a[++o]=i.rect(n.x-s/2,n.y-l/2,s,l).attr({cursor:"nw-resize"}),a[++o]=i.rect(n.x+n.width/2-s/2,n.y-l/2,s,l).attr({cursor:"n-resize"}),a[++o]=i.rect(n.x2-s/2,n.y-l/2,s,l).attr({cursor:"ne-resize"}),a[++o]=i.rect(n.x-s/2,n.y+n.height/2-l/2,s,l).attr({cursor:"w-resize"}),a[++o]=i.rect(n.x2-s/2,n.y+n.height/2-l/2,s,l).attr({cursor:"e-resize"}),a[++o]=i.rect(n.x-s/2,n.y2-l/2,s,l).attr({cursor:"sw-resize"}),a[++o]=i.rect(n.x+n.width/2-s/2,n.y2-l/2,s,l).attr({cursor:"s-resize"}),a[++o]=i.rect(n.x2-s/2,n.y2-l/2,s,l).attr({cursor:"se-resize"});else if(t.node.points){var A=t.node.points;for(_=t.node.points.numberOfItems,(e=new B.Matrix).add(t.transform().totalMatrix),r=0;r<_;r++){var h=A.getItem(r);f=e.x(h.x,h.y),m=e.y(h.x,h.y),a[++o]=i.rect(f-s/2,m-l/2,s,l).attr({cursor:"crosshair",pointIdx:r,ox:h.x,oy:h.y})}}else-1!==I.indexOf(z.AnnotationType.LINE)?((v=t.select("line"))&&(t=v),(e=new B.Matrix).add(t.transform().totalMatrix),p=e.x(U.toInt(t.attr("x1")),U.toInt(t.attr("y1"))),d=e.y(U.toInt(t.attr("x1")),U.toInt(t.attr("y1"))),g=e.x(U.toInt(t.attr("x2")),U.toInt(t.attr("y2"))),u=e.y(U.toInt(t.attr("x2")),U.toInt(t.attr("y2"))),a[++o]=i.rect(p-s/2,d-l/2,s,l).attr({cursor:"crosshair",pointIdx:0,ox1:U.toInt(t.attr("x1")),oy1:U.toInt(t.attr("y1"))}),a[++o]=i.rect(g-s/2,u-l/2,s,l).attr({cursor:"crosshair",pointIdx:1,ox2:U.toInt(t.attr("x2")),oy2:U.toInt(t.attr("y2"))})):"small-rect"===c.selectionHandleType?(l=s=5,a[++o]=i.rect(n.x-s/2,n.y-l/2,s,l).attr({cursor:"default",position:"nw"}),a[++o]=i.rect(n.x2-s/2,n.y-l/2,s,l).attr({cursor:"default",position:"ne"}),a[++o]=i.rect(n.x-s/2,n.y2-l/2,s,l).attr({cursor:"default",position:"sw"}),a[++o]=i.rect(n.x2-s/2,n.y2-l/2,s,l).attr({cursor:"default",position:"se"})):(a[++o]=i.rect(n.x-s/2,n.y-l/2,s,l).attr({cursor:"nw-resize"}),a[++o]=i.rect(n.x2-s/2,n.y-l/2,s,l).attr({cursor:"ne-resize"}),a[++o]=i.rect(n.x-s/2,n.y2-l/2,s,l).attr({cursor:"sw-resize"}),a[++o]=i.rect(n.x2-s/2,n.y2-l/2,s,l).attr({cursor:"se-resize"}));for(r=0,_=a.length;r<_;r++)a[r].data("handlerIdx",r),0<r&&a[r].attr({fill:"rgba(0,0,0, 0.3)",class:Y.moduleClassName+"-resize-handler"}),y.add(a[r]);return y}(this,e);i.drag(r,a,c),this.data("handler",i),i.data("item",e),void 0!==e.transforms&&e.transforms.push({tx:0,ty:0,type:"translate"});i.mouseup(function(t){2===t.button&&e.contextmenu(t.pageX,t.pageY)})}.call(this,t)},t.prototype.unselected=function(){!function(){var e=this;e.data("handler")&&e.data("handler").remove();e.removeData("isSelected"),e.data("bbT")&&e.data("bbT").remove();var t=this.data("tEl"),t=t?t.data("item"):null;{var i,n;t&&(i=e.data("tx"),n=e.data("ty"),void 0===i||void 0===n||0===i&&0===n?t.transforms.pop():t.transforms[t.transforms.length-1]={tx:i,ty:n,type:"translate"})}["tx","ty","otx","oty","bb","bbT","initMatrix","handler","handler-group","parent","rotate"].forEach(function(t){e.removeData([t])})}.call(this)},t.prototype.unbind=function(){for(var t=this.events||[],e=t.length-1;0<e;e--){var i=t[e],n=i.name,i=i.f;"mousedown"===n?this.unmousedown(i):"mouseup"===n?this.unmouseup(i):"mousemove"===n?this.unmousemove(i):"mouseout"===n?this.unmouseout(i):"click"===n&&this.unclick(i)}return this.events},t.prototype.displayBBox=function(){var t=this.data("handler-group"),e=this.data("bbT"),i=this.data("tEl").attr("anntype"),n=this.transform().total.toString();return e?this.data("bbT").attr(p(this.getBBox(1))).transform(n):(e="none",-1===i.indexOf("line")&&-1===i.indexOf("pen")||(e="rgba(255,255,255, 0)"),this.data("bbT",t.rect(p(this.getBBox(1))).attr({fill:e,stroke:s,strokeWidth:o,strokeDasharray:l,class:Y.moduleClassName+"-transition-handler"}).transform(n))),this};var b=function(t,e,i,n,o){return{x:t+o,y:e+(n*(i+(-1!==U.IEVersion()||U.isBrowser().wEdge()?1:0))+o/2)}},a=function(t,e,i){var n,o,i=B(i.target),a=this.data("tEl"),r=(a.data("changed",!1),U.toNotEmpty(i.data("handlerIdx"),-1)),t=Y.Utils.svgCursorPoint(this.paper.node,t,e),e=G(a,t.x,t.y);this.data("hEl",i),this.data("op",e),this.data("ot",this.transform().localMatrix),a.data("otx",a.data("tx")||0),a.data("oty",a.data("ty")||0),-1!==r&&((t=a.attr("anntype"))===z.AnnotationType.RECT||t===z.AnnotationType.MASK||a.type===z.AnnotationType.RECT&&t===z.AnnotationType.HIGHLIGHTER||t===z.AnnotationType.ETERNITYRECT||t===z.AnnotationType.IMAGE||t===z.AnnotationType.GRID||t===z.AnnotationType.CHECKMARK&&"image"===a.type?a.data({ox:a.attr("x"),oy:a.attr("y"),ow:a.attr("width"),oh:a.attr("height")}):t===z.AnnotationType.STICKYNOTE||t===z.AnnotationType.MEMO||t===z.AnnotationType.TEXT?a.data({ox:a[0].attr("x"),oy:a[0].attr("y"),ow:a[0].attr("width"),oh:a[0].attr("height")}):t===z.AnnotationType.CIRCLE||t===z.AnnotationType.ELLIPSE?a.data({ocx:a.attr("cx"),ocy:a.attr("cy"),or:a.attr("r"),orx:a.attr("rx"),ory:a.attr("ry")}):a.node.points?(e=U.toInt(i.attr("ox"),0),r=U.toInt(i.attr("oy"),0),n=U.toInt(i.attr("tx"),0),o=U.toInt(i.attr("ty"),0),i.attr({ox:e+n,oy:r+o})):-1!==t.indexOf(z.AnnotationType.LINE)&&(i=a.select("line"),(e=a).data({ox1:(e=i?i:e).attr("x1"),oy1:e.attr("y1"),ox2:e.attr("x2"),oy2:e.attr("y2")})))};function r(t,e,i,n,c){var o=this.data("tEl")||this,p=this.data("hEl")||this,d=o.data("bbT"),g=o.attr("anntype");if(this.paper&&d){Y.UI.uncontextmenu();var a,r,s,l,u=G(o,t,e),f=U.toNotEmpty(p.data("handlerIdx"),-1);if(d.attr("strokeWidth","5"),t=u.tx,e=u.ty,o.data("changed",!0),o.data("item").draggable()){if(-1===f||Y.Element.hasClass(p.node,Y.moduleClassName+"-transition-handler")){o.data("tx",o.data("otx")+t),o.data("ty",o.data("oty")+e);d="t"+o.data("tx")+","+o.data("ty")+o.data("initMatrix").toTransformString();o.attr({transform:d})}else{if(!o.data("item").resizable()||!o.data("item").draggable())return;var u=p.node.style.cursor,f=U.toInt(p.data("handlerIdx"))-1,d=o.data("rotate");if(g===z.AnnotationType.RECT||g===z.AnnotationType.MASK||o.type===z.AnnotationType.RECT&&g===z.AnnotationType.HIGHLIGHTER||g===z.AnnotationType.ETERNITYRECT||g===z.AnnotationType.IMAGE||g===z.AnnotationType.GRID||g===z.AnnotationType.CHECKMARK&&"image"===o.type){if(i=h=U.toInt(o.data("ox")),n=N=U.toInt(o.data("oy")),s=a=U.toInt(o.data("ow")),l=r=U.toInt(o.data("oh")),90===d)switch(u){case"nw-resize":i=h+t,s=a-t,l=r+e;break;case"n-resize":i=h+t,s=a-t;break;case"ne-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"e-resize":n=N+e,l=r-e;break;case"se-resize":n=N+e,s=a+t,l=r-e;break;case"s-resize":s=a+t;break;case"sw-resize":s=a+t,l=r+e;break;case"w-resize":l=r+e;break;default:i=h+t,n=N+e}else if(180===d)switch(u){case"nw-resize":s=a+t,l=r+e;break;case"n-resize":l=r+e;break;case"ne-resize":i=h+t,s=a-t,l=r+e;break;case"e-resize":i=h+t,s=a-t;break;case"se-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"s-resize":n=N+e,l=r-e;break;case"sw-resize":n=N+e,s=a+t,l=r-e;break;case"w-resize":s=a+t;break;default:i=h+t,n=N+e}else if(270===d)switch(u){case"nw-resize":n=N+e,s=a+t,l=r-e;break;case"n-resize":s=a+t;break;case"ne-resize":s=a+t,l=r+e;break;case"e-resize":l=r+e;break;case"se-resize":i=h+t,s=a-t,l=r+e;break;case"s-resize":i=h+t,s=a-t;break;case"sw-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"w-resize":n=N+e,l=r-e;break;default:i=h+t,n=N+e}else switch(u){case"nw-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"n-resize":n=N+e,l=r-e;break;case"ne-resize":n=N+e,s=a+t,l=r-e;break;case"e-resize":s=a+t;break;case"se-resize":s=a+t,l=r+e;break;case"s-resize":l=r+e;break;case"sw-resize":i=h+t,s=a-t,l=r+e;break;case"w-resize":i=h+t,s=a-t;break;default:i=h+t,n=N+e}s<0&&(s=t<0?(i+=t+a,-(t+a)):(i=h+a,t-a)),l<0&&(l=e<0?(n+=e+r,-(e+r)):(n=N+r,e-r)),o.attr({x:i,y:n,width:s,height:l})}else if(g===z.AnnotationType.STICKYNOTE||g===z.AnnotationType.TEXT){if(i=h=U.toInt(o.data("ox")),n=N=U.toInt(o.data("oy")),s=a=U.toInt(o.data("ow")),l=r=U.toInt(o.data("oh")),90===d)switch(u){case"nw-resize":i=h-e,s=a+e,n=N+t,l=r-t;break;case"n-resize":n=N+t,l=r-t;break;case"ne-resize":n=N+t,s=a-e,l=r-t;break;case"e-resize":s=a-e;break;case"se-resize":s=a-e,l=r+t;break;case"s-resize":l=r+t;break;case"sw-resize":i=h-e,s=a+e,l=r+t;break;case"w-resize":i=h-e,s=a+e;break;default:i=h+t,n=N+e}else if(180===d)switch(u){case"nw-resize":i=h-t,s=a+t,n=N-e,l=r+e;break;case"n-resize":n=N-e,l=r+e;break;case"ne-resize":n=N-e,s=a-t,l=r+e;break;case"e-resize":s=a-t;break;case"se-resize":s=a-t,l=r-e;break;case"s-resize":l=r-e;break;case"sw-resize":i=h-t,s=a+t,l=r-e;break;case"w-resize":i=h-t,s=a+t;break;default:i=h+t,n=N+e}else if(270===d)switch(u){case"nw-resize":i=h+e,s=a-e,n=N-t,l=r+t;break;case"n-resize":n=N-t,l=r+t;break;case"ne-resize":n=N-t,s=a+e,l=r+t;break;case"e-resize":s=a+e;break;case"se-resize":s=a+e,l=r-t;break;case"s-resize":l=r-t;break;case"sw-resize":i=h+e,s=a-e,l=r-t;break;case"w-resize":i=h+e,s=a-e;break;default:i=h+t,n=N+e}else switch(u){case"nw-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"n-resize":n=N+e,l=r-e;break;case"ne-resize":n=N+e,s=a+t,l=r-e;break;case"e-resize":s=a+t;break;case"se-resize":s=a+t,l=r+e;break;case"s-resize":l=r+e;break;case"sw-resize":i=h+t,s=a-t,l=r+e;break;case"w-resize":i=h+t,s=a-t;break;default:i=h+t,n=N+e}if(s<(C=o.data("item")).minWidth||l<C.minHeight)return;H(C,o,i,n,s,l)}else if(g===z.AnnotationType.MEMO){if(i=h=U.toInt(o.data("ox")),n=N=U.toInt(o.data("oy")),s=a=U.toInt(o.data("ow")),l=r=U.toInt(o.data("oh")),90===d)switch(u){case"nw-resize":i=h+t,s=a-t,l=r+e;break;case"n-resize":i=h+t,s=a-t;break;case"ne-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"e-resize":n=N+e,l=r-e;break;case"se-resize":n=N+e,s=a+t,l=r-e;break;case"s-resize":s=a+t;break;case"sw-resize":s=a+t,l=r+e;break;case"w-resize":l=r+e;break;default:i=h+t,n=N+e}else if(180===d)switch(u){case"nw-resize":s=a+t,l=r+e;break;case"n-resize":l=r+e;break;case"ne-resize":i=h+t,s=a-t,l=r+e;break;case"e-resize":i=h+t,s=a-t;break;case"se-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"s-resize":n=N+e,l=r-e;break;case"sw-resize":n=N+e,s=a+t,l=r-e;break;case"w-resize":s=a+t;break;default:i=h+t,n=N+e}else if(270===d)switch(u){case"nw-resize":n=N+e,s=a+t,l=r-e;break;case"n-resize":s=a+t;break;case"ne-resize":s=a+t,l=r+e;break;case"e-resize":l=r+e;break;case"se-resize":i=h+t,s=a-t,l=r+e;break;case"s-resize":i=h+t,s=a-t;break;case"sw-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"w-resize":n=N+e,l=r-e;break;default:i=h+t,n=N+e}else switch(u){case"nw-resize":i=h+t,n=N+e,s=a-t,l=r-e;break;case"n-resize":n=N+e,l=r-e;break;case"ne-resize":n=N+e,s=a+t,l=r-e;break;case"e-resize":s=a+t;break;case"se-resize":s=a+t,l=r+e;break;case"s-resize":l=r+e;break;case"sw-resize":i=h+t,s=a-t,l=r+e;break;case"w-resize":i=h+t,s=a-t;break;default:i=h+t,n=N+e}if(l<0&&(l=e<0?(n+=e+r,-(e+r)):(n=N+r,e-r)),(s=s<0?t<0?(i+=t+a,-(t+a)):(i=h+a,t-a):s)<(C=o.data("item")).minWidth||l<C.minHeight)return;H(C,o,i,n,s,l)}else if(g===z.AnnotationType.CIRCLE){var m=U.toInt(o.data("or")),y=m;if(90===d)switch(u){case"n-resize":y=m-t;break;case"e-resize":y=m-e;break;case"s-resize":y=m+t;break;case"w-resize":y=m+e;break;default:y=m+t}else if(180===d)switch(u){case"n-resize":y=m+e;break;case"e-resize":y=m-t;break;case"s-resize":y=m-e;break;default:y=m+t}else if(270===d)switch(u){case"n-resize":y=m+t;break;case"e-resize":y=m+e;break;case"s-resize":y=m-t;break;case"w-resize":y=m-e;break;default:y=m+t}else switch(u){case"n-resize":y=m-e;break;case"e-resize":y=m+t;break;case"s-resize":y=m+e;break;case"w-resize":y=m-t;break;default:y=m+t}o.attr({r:y=y<0?-y:y})}else if(g===z.AnnotationType.ELLIPSE){var v=U.toInt(o.data("orx")),I=U.toInt(o.data("ory")),_=U.toInt(o.data("ocx")),A=U.toInt(o.data("ocy")),b=v,T=I,x=_,w=A,h=_-v,N=A-I;if(90===d)switch(u){case"nw-resize":x=_+t,w=A+e,b=v-t,T=I+e;break;case"n-resize":x=_+t,b=v-t;break;case"ne-resize":x=_+t,w=A+e,b=v-t,T=I-e;break;case"e-resize":w=A+e,T=I-e;break;case"se-resize":x=_+t,w=A+e,b=v+t,T=I-e;break;case"s-resize":x=_+t,b=v+t;break;case"sw-resize":x=_+t,w=A+e,b=v+t,T=I+e;break;case"w-resize":w=A+e,T=I+e}else if(180===d)switch(u){case"nw-resize":x=_+t,w=A+e,b=v+t,T=I+e;break;case"n-resize":w=A+e,T=I+e;break;case"ne-resize":x=_+t,w=A+e,b=v-t,T=I+e;break;case"e-resize":x=_+t,b=v-t;break;case"se-resize":x=_+t,w=A+e,b=v-t,T=I-e;break;case"s-resize":w=A+e,T=I-e;break;case"sw-resize":x=_+t,w=A+e,b=v+t,T=I-e;break;case"w-resize":x=_+t,b=v+t}else if(270===d)switch(u){case"nw-resize":x=_+t,w=A+e,b=v+t,T=I-e;break;case"n-resize":x=_+t,b=v+t;break;case"ne-resize":x=_+t,w=A+e,b=v+t,T=I+e;break;case"e-resize":w=A+e,T=I+e;break;case"se-resize":x=_+t,w=A+e,b=v-t,T=I+e;break;case"s-resize":x=_+t,b=v-t;break;case"sw-resize":x=_+t,w=A+e,b=v-t,T=I-e;break;case"w-resize":w=A+e,T=I-e}else switch(u){case"nw-resize":x=_+t,w=A+e,b=v-t,T=I-e;break;case"n-resize":w=A+e,T=I-e;break;case"ne-resize":x=_+t,w=A+e,b=v+t,T=I-e;break;case"e-resize":b=v+t,x=_+t;break;case"se-resize":x=_+t,w=A+e,b=v+t,T=I+e;break;case"s-resize":w=A+e,T=I+e;break;case"sw-resize":x=_+t,w=A+e,b=v-t,T=I+e;break;case"w-resize":x=_+t,b=v-t}o.attr({cx:x,cy:w,rx:b=b<0?-b:b,ry:T=T<0?-T:T})}else o.node.points?((C=o.node.points.getItem(f)).x=U.toInt(p.attr("ox"))+t,C.y=U.toInt(p.attr("oy"))+e,p.attr("tx",t),p.attr("ty",e)):-1!==g.indexOf(z.AnnotationType.LINE)&&(d=o.select("line")||o,(n=i=0)==f?(i=U.toInt(p.attr("ox1")),n=U.toInt(p.attr("oy1")),d.attr({x1:i+t,y1:n+e}),o.attr({x:i+t,y:n+e,x1:i+t,y1:n+e})):(i=U.toInt(p.attr("ox2")),n=U.toInt(p.attr("oy2")),d.attr({x2:i+t,y2:n+e}),o.attr({x2:i+t,y2:n+e})))}var u=o,E=o.data("handler"),C=p;u.displayBBox();var P,S,g=u.data("bbT").getBBox(),f=(C||u).getBBox(),M=!u.attr("strokeWidth")||U.toFloat(u.attr("strokeWidth"))<16?16:U.toFloat(u.attr("strokeWidth"))+10,k=M,d=C?U.toInt(C.data("handlerIdx"))-1:-1,o=u.attr("anntype")||"",R=0,L=0,O=("small-rect"===u.data("item").selectionHandleType&&(M=k=5),{"nw-resize":{x:g.x-M/2,y:g.y-k/2},"n-resize":{x:g.x+g.width/2-M/2,y:g.y-k/2},"ne-resize":{x:g.x2-M/2,y:g.y-k/2},"w-resize":{x:g.x-M/2,y:g.y+g.height/2-k/2},"e-resize":{x:g.x2-M/2,y:g.y+g.height/2-k/2},"sw-resize":{x:g.x-M/2,y:g.y2-k/2},"s-resize":{x:g.x+g.width/2-M/2,y:g.y2-k/2},"se-resize":{x:g.x2-M/2,y:g.y2-k/2},crosshair:{x:f.x-M/2-M/2,y:f.y-k/2},nw:{x:g.x-M/2,y:g.y-k/2},ne:{x:g.x2-M/2,y:g.y-k/2},sw:{x:g.x-M/2,y:g.y2-k/2},se:{x:g.x2-M/2,y:g.y2-k/2}});if(void 0!==u.node.points){var F=u.node.points,D=F.numberOfItems;if((P=new B.Matrix).add(u.transform().totalMatrix),-1<d)S=F.getItem(d),C.attr({x:P.x(S.x,S.y)-M/2,y:P.y(S.x,S.y)-k/2});else for(R=0;R<D;R++)S=F.getItem(R),E[R+1]=E[R+1].attr({x:P.x(S.x,S.y)-M/2,y:P.y(S.x,S.y)-k/2})}else if(-1!==o.indexOf(z.AnnotationType.LINE)){f=u.select("line"),g=(f&&(u=f),0),d=0,C=0,o=0;(P=new B.Matrix).add(u.transform().totalMatrix),g=P.x(U.toInt(u.attr("x1")),U.toInt(u.attr("y1"))),d=P.y(U.toInt(u.attr("x1")),U.toInt(u.attr("y1"))),C=P.x(U.toInt(u.attr("x2")),U.toInt(u.attr("y2"))),o=P.y(U.toInt(u.attr("x2")),U.toInt(u.attr("y2"))),E[1].attr({x:g-M/2,y:d-k/2}),E[2].attr({x:C-M/2,y:o-k/2})}else for(R=1,L=E.node.childElementCount;R<L;R++)"default"===(S=E[R].attr("cursor"))&&(S=E[R].attr("position")),E[R]=E[R].attr(O[S])}}}function H(t,e,i,c,n,o){for(var a=t.attr(),r=(e[1].remove(),a["font-size"]),p=a["font-style"],d=a["font-weight"],s=Y.Element.convertTextareaLineBreakList(a.text,n-2*t.textPadding,o,r,a["font-family"]),s=e.text(i,c,s).attr({tabindex:"-1",fill:a["font-color"]}),g=i,l=a["text-halign"]||0,u=(1===l?g=i-t.textPadding+n/2:2===l&&(g=i+n-t.textPadding),s.node.childNodes),l=u.length,f=0,m=l;f<m;f+=1){var y=B(u[f]),v=b(g,c,f,r,t.textPadding);y.attr({x:v.x,y:v.y,"text-anchor":Y.Type.AnnotationAttribute.TEXT_ALIGN[a["text-halign"]],fill:a["font-color"],"font-family":a["font-family"],"font-size":r+"px","font-style":p,"font-weight":d,strokeWidth:a["stroke-width"],"alignment-baseline":Y.Type.AnnotationAttribute.TEXT_ALIGN_BASELINE[a["text-valign"]],tabindex:"-1"})}e.add(s);var h=s.getBBox(),e=(e[0].attr({x:Math.min(i,h.x),y:Math.min(c,h.y),width:Math.max(h.width+2*t.textPadding,n),height:Math.max(r*l+2*t.textPadding,o)}),a["text-valign"]||0);0<e&&(i=0,1===e?i=(o+r-h.height)/2:2===e&&(i=o-h.height),0<i&&s.attr("transform","translate(0,"+i+")"))}function c(t){var e=this.data("tEl"),i=e.data("item"),n=e.data("bbT");n&&n.attr("strokeWidth",o),e.data("changed")&&i&&(i.attr("anntype")!==z.AnnotationType.STICKYNOTE&&i.attr("anntype")!==z.AnnotationType.TEXT&&i.attr("anntype")!==z.AnnotationType.MEMO||void 0!==this.data("tx")&&void 0!==this.data("ty")&&(i.transforms[i.transforms.length-1]={tx:this.data("tx"),ty:this.data("ty"),type:"translate"}),i.page.trigger("page"+i.page.pageIndex()+".change.annotation",i),e.data("changed",!1))}function p(t){return{x:t.x,y:t.y,width:t.width,height:t.height}}function G(t,e,i){t=t.transform().diffMatrix.invert();return t.e=t.f=0,{tx:t.x(e,i),ty:t.y(e,i)}}}))}(InziSForm),function(o,s,I){"use strict";function a(t,e,i){return setTimeout(c(t,i),e)}function n(t,e,i){return Array.isArray(t)&&(r(t,i[e],i),1)}function r(t,e,i){if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==I)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(var n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function h(i,t,e){var n="DEPRECATED METHOD: "+t+"\n"+e+" AT \n";return function(){var t=new Error("get-stack-trace"),t=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",e=o.console&&(o.console.warn||o.console.log);return e&&e.call(o.console,n,t),i.apply(this,arguments)}}function t(t,e,i){var e=e.prototype,n=t.prototype=Object.create(e);n.constructor=t,n._super=e,i&&rt(n,i)}function c(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==it?t.apply(e&&e[0]||I,e):t}function d(t,e){return t===I?e:t}function g(e,t,i){r(m(t),function(t){e.addEventListener(t,i,!1)})}function u(e,t,i){r(m(t),function(t){e.removeEventListener(t,i,!1)})}function T(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function f(t,e){return-1<t.indexOf(e)}function m(t){return t.trim().split(/\s+/g)}function y(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function v(t){return Array.prototype.slice.call(t,0)}function x(t,i,e){for(var n=[],o=[],a=0;a<t.length;){var r=i?t[a][i]:t[a];y(o,r)<0&&n.push(t[a]),o[a]=r,a++}return n=e?i?n.sort(function(t,e){return t[i]>e[i]}):n.sort():n}function w(t,e){for(var i,n=e[0].toUpperCase()+e.slice(1),o=0;o<tt.length;){if((i=(i=tt[o])?i+n:e)in t)return i;o++}return I}function N(t){t=t.ownerDocument||t;return t.defaultView||t.parentWindow||o}function e(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){p(e.options.enable,[e])&&i.handler(t)},this.init()}function E(c,t,e){var p,i,d,n,g,u,f,m=e.pointers.length,o=e.changedPointers.length,a=t&_&&m-o==0,m=t&(A|b)&&m-o==0,r=(e.isFirst=!!a,e.isFinal=!!m,a&&(c.session={}),e.eventType=t,o=e,a=(m=c).session,t=o.pointers,i=t.length,a.firstInput||(a.firstInput=C(o)),1<i&&!a.firstMultiple?a.firstMultiple=C(o):1===i&&(a.firstMultiple=!1),i=a.firstInput,d=a.firstMultiple,n=(d||i).center,r=o.center=P(t),o.timeStamp=at(),o.deltaTime=o.timeStamp-i.timeStamp,o.angle=R(n,r),o.distance=k(n,r),a),s=o,l=s.center,y=r.offsetDelta||{},h=r.prevDelta||{},v=r.prevInput||{},v=(s.eventType!==_&&v.eventType!==A||(h=r.prevDelta={x:v.deltaX||0,y:v.deltaY||0},y=r.offsetDelta={x:l.x,y:l.y}),s.deltaX=h.x+(l.x-y.x),s.deltaY=h.y+(l.y-y.y),o.offsetDirection=M(o.deltaX,o.deltaY),i=S(o.deltaTime,o.deltaX,o.deltaY),o.overallVelocityX=i.x,o.overallVelocityY=i.y,o.overallVelocity=ot(i.x)>ot(i.y)?i.x:i.y,o.scale=d?function(t,e){return k(e[0],e[1],Tt)/k(t[0],t[1],Tt)}(d.pointers,t):1,o.rotation=d?function(t,e){return R(e[1],e[0],Tt)+R(t[1],t[0],Tt)}(d.pointers,t):0,o.maxPointers=!a.prevInput||o.pointers.length>a.prevInput.maxPointers?o.pointers.length:a.prevInput.maxPointers,a),r=o,s=v.lastInterval||r,h=r.timeStamp-s.timeStamp;r.eventType!=b&&(ut<h||s.velocity===I)?(p=r.deltaX-s.deltaX,l=r.deltaY-s.deltaY,h=S(h,p,l),u=h.x,f=h.y,g=ot(h.x)>ot(h.y)?h.x:h.y,p=M(p,l),v.lastInterval=r):(g=s.velocity,u=s.velocityX,f=s.velocityY,p=s.direction),r.velocity=g,r.velocityX=u,r.velocityY=f,r.direction=p,n=m.element,T(o.srcEvent.target,n)&&(n=o.srcEvent.target),o.target=n,c.emit("hammer.input",e),c.recognize(e),c.session.prevInput=e}function C(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:nt(t.pointers[i].clientX),clientY:nt(t.pointers[i].clientY)},i++;return{timeStamp:at(),pointers:e,center:P(e),deltaX:t.deltaX,deltaY:t.deltaY}}function P(t){var e=t.length;if(1===e)return{x:nt(t[0].clientX),y:nt(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:nt(i/e),y:nt(n/e)}}function S(t,e,i){return{x:e/t||0,y:i/t||0}}function M(t,e){return t===e?ft:ot(t)>=ot(e)?t<0?mt:yt:e<0?vt:It}function k(t,e,i){var n=e[(i=i||bt)[0]]-t[i[0]],e=e[i[1]]-t[i[1]];return Math.sqrt(n*n+e*e)}function R(t,e,i){var n=e[(i=i||bt)[0]]-t[i[0]],e=e[i[1]]-t[i[1]];return 180*Math.atan2(e,n)/Math.PI}function L(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,e.apply(this,arguments)}function O(){this.evEl=Et,this.evWin=Ct,e.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function F(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,e.apply(this,arguments)}function D(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},e.apply(this,arguments)}function B(){e.apply(this,arguments);var t=c(this.handler,this);this.touch=new D(this.manager,t),this.mouse=new L(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function U(t){var e,i,t=t.changedPointers[0];t.identifier===this.primaryTouch&&(e={x:t.clientX,y:t.clientY},this.lastTouches.push(e),i=this.lastTouches,setTimeout(function(){var t=i.indexOf(e);-1<t&&i.splice(t,1)},Mt))}function z(t,e){this.manager=t,this.set(e)}function H(t){this.options=rt({},this.defaults,t||{}),this.id=ht++,this.manager=null,this.options.enable=d(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function G(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function Y(t){return t==It?"down":t==vt?"up":t==mt?"left":t==yt?"right":""}function W(t,e){e=e.manager;return e?e.get(t):t}function i(){H.apply(this,arguments)}function Q(){i.apply(this,arguments),this.pX=null,this.pY=null}function q(){i.apply(this,arguments)}function V(){H.apply(this,arguments),this._timer=null,this._input=null}function X(){i.apply(this,arguments)}function K(){i.apply(this,arguments)}function J(){H.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function j(t,e){return(e=e||{}).recognizers=d(e.recognizers,j.defaults.preset),new Z(t,e)}function Z(t,e){this.options=rt({},j.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((e=this).options.inputClass||(pt?O:dt?D:ct?B:L))(e,E),this.touchAction=new z(this,this.options.touchAction),$(this,!0),r(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function $(i,n){var o,a=i.element;a.style&&(r(i.options.cssProps,function(t,e){o=w(a.style,e),n?(i.oldCssProps[o]=a.style[o],a.style[o]=t):a.style[o]=i.oldCssProps[o]||""}),n||(i.oldCssProps={}))}var tt=["","webkit","Moz","MS","ms","o"],et=s.createElement("div"),it="function",nt=Math.round,ot=Math.abs,at=Date.now,rt="function"!=typeof Object.assign?function(t){if(t===I||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==I&&null!==n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign,st=h(function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)i&&t[n[o]]!==I||(t[n[o]]=e[n[o]]),o++;return t},"extend","Use `assign`."),lt=h(function(t,e){return st(t,e,!0)},"merge","Use `assign`."),ht=1,ct="ontouchstart"in o,pt=w(o,"PointerEvent")!==I,dt=ct&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),gt="touch",ut=25,_=1,A=4,b=8,ft=1,mt=2,yt=4,vt=8,It=16,l=mt|yt,_t=vt|It,At=l|_t,bt=["x","y"],Tt=["clientX","clientY"],xt=(e.prototype={handler:function(){},init:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&u(this.element,this.evEl,this.domHandler),this.evTarget&&u(this.target,this.evTarget,this.domHandler),this.evWin&&u(N(this.element),this.evWin,this.domHandler)}},{mousedown:_,mousemove:2,mouseup:A}),wt=(t(L,e,{handler:function(t){var e=xt[t.type];e&_&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=A),this.pressed&&(e&A&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}),{pointerdown:_,pointermove:2,pointerup:A,pointercancel:b,pointerout:b}),Nt={2:gt,3:"pen",4:"mouse",5:"kinect"},Et="pointerdown",Ct="pointermove pointerup pointercancel",Pt=(o.MSPointerEvent&&!o.PointerEvent&&(Et="MSPointerDown",Ct="MSPointerMove MSPointerUp MSPointerCancel"),t(O,e,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),n=wt[n],o=Nt[t.pointerType]||t.pointerType,a=o==gt,r=y(e,t.pointerId,"pointerId");n&_&&(0===t.button||a)?r<0&&(e.push(t),r=e.length-1):n&(A|b)&&(i=!0),r<0||(e[r]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(r,1))}}),{touchstart:_,touchmove:2,touchend:A,touchcancel:b}),St=(t(F,e,{handler:function(t){var e,i=Pt[t.type];i===_&&(this.started=!0),this.started&&(e=function(t,e){var i=v(t.touches),t=v(t.changedTouches);return[i=e&(A|b)?x(i.concat(t),"identifier",!0):i,t]}.call(this,t,i),i&(A|b)&&e[0].length-e[1].length==0&&(this.started=!1),this.callback(this.manager,i,{pointers:e[0],changedPointers:e[1],pointerType:gt,srcEvent:t}))}}),{touchstart:_,touchmove:2,touchend:A,touchcancel:b}),Mt=(t(D,e,{handler:function(t){var e=St[t.type],i=function(t,e){var i=v(t.touches),n=this.targetIds;if(e&(2|_)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var o,a=v(t.changedTouches),r=[],s=this.target,l=i.filter(function(t){return T(t.target,s)});if(e===_)for(o=0;o<l.length;)n[l[o].identifier]=!0,o++;for(o=0;o<a.length;)n[a[o].identifier]&&r.push(a[o]),e&(A|b)&&delete n[a[o].identifier],o++;return r.length?[x(l.concat(r),"identifier",!0),r]:void 0}.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:gt,srcEvent:t})}}),2500),kt=(t(B,e,{handler:function(t,e,i){var n=i.pointerType==gt,o="mouse"==i.pointerType;if(!(o&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)!function(t,e){t&_?(this.primaryTouch=e.changedPointers[0].identifier,U.call(this,e)):t&(A|b)&&U.call(this,e)}.call(this,e,i);else if(o&&function(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],a=Math.abs(e-o.x),o=Math.abs(i-o.y);if(a<=25&&o<=25)return!0}return!1}.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}}),w(et.style,"touchAction")),Rt=kt!==I,Lt="manipulation",Ot="none",Ft="pan-x",Dt="pan-y",Bt=function(){if(!Rt)return!1;var e={},i=o.CSS&&o.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){e[t]=!i||o.CSS.supports("touch-action",t)}),e}();z.prototype={set:function(t){"compute"==t&&(t=this.compute()),Rt&&this.manager.element.style&&Bt[t]&&(this.manager.element.style[kt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[],t=(r(this.manager.recognizers,function(t){p(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),e.join(" "));if(f(t,Ot))return Ot;var i=f(t,Ft),n=f(t,Dt);return i&&n?Ot:i||n?i?Ft:Dt:f(t,Lt)?Lt:"auto"},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(!this.manager.session.prevented){var n=this.actions,o=f(n,Ot)&&!Bt.none,a=f(n,Dt)&&!Bt[Dt],n=f(n,Ft)&&!Bt[Ft];if(o){var r=1===t.pointers.length,s=t.distance<2,t=t.deltaTime<250;if(r&&s&&t)return}return(!n||!a)&&(o||a&&i&l||n&&i&_t)?this.preventSrc(e):void 0}e.preventDefault()},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}},H.prototype={defaults:{},set:function(t){return rt(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(n(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=W(t,this)).id]||(e[t.id]=t).recognizeWith(this),this},dropRecognizeWith:function(t){return n(t,"dropRecognizeWith",this)||(t=W(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(n(t,"requireFailure",this))return this;var e=this.requireFail;return-1===y(e,t=W(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(n(t,"dropRequireFailure",this))return this;t=W(t,this);t=y(this.requireFail,t);return-1<t&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return 0<this.requireFail.length},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(e){function t(t){i.manager.emit(t,e)}var i=this,n=this.state;n<8&&t(i.options.event+G(n)),t(i.options.event),e.additionalEvent&&t(e.additionalEvent),8<=n&&t(i.options.event+G(n))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=32)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){t=rt({},t);return p(this.options.enable,[this,t])?(56&this.state&&(this.state=1),this.state=this.process(t),void(30&this.state&&this.tryEmit(t))):(this.reset(),void(this.state=32))},process:function(t){},getTouchAction:function(){},reset:function(){}},t(i,H,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,t=this.attrTest(t);return n&&(i&b||!t)?16|e:n||t?i&A?8|e:2&e?4|e:2:32}}),t(Q,i,{defaults:{event:"pan",threshold:10,pointers:1,direction:At},getTouchAction:function(){var t=this.options.direction,e=[];return t&l&&e.push(Dt),t&_t&&e.push(Ft),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,o=t.direction,a=t.deltaX,r=t.deltaY;return o&e.direction||(n=e.direction&l?(o=0===a?ft:a<0?mt:yt,i=a!=this.pX,Math.abs(t.deltaX)):(o=0===r?ft:r<0?vt:It,i=r!=this.pY,Math.abs(t.deltaY))),t.direction=o,i&&n>e.threshold&&o&e.direction},attrTest:function(t){return i.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Y(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),t(q,i,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ot]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){var e;1!==t.scale&&(e=t.scale<1?"in":"out",t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),t(V,H,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,o=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(A|b)&&!o)this.reset();else if(t.eventType&_)this.reset(),this._timer=a(function(){this.state=8,this.tryEmit()},e.time,this);else if(t.eventType&A)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&A?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=at(),this.manager.emit(this.options.event,this._input)))}}),t(X,i,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ot]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),t(K,i,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:l|_t,pointers:1},getTouchAction:function(){return Q.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(l|_t)?e=t.overallVelocity:i&l?e=t.overallVelocityX:i&_t&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&ot(e)>this.options.velocity&&t.eventType&A},emit:function(t){var e=Y(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),t(J,H,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Lt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,o=t.deltaTime<e.time;if(this.reset(),t.eventType&_&&0===this.count)return this.failTimeout();if(n&&o&&i){if(t.eventType!=A)return this.failTimeout();n=!this.pTime||t.timeStamp-this.pTime<e.interval,o=!this.pCenter||k(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,o&&n?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=a(function(){this.state=8,this.tryEmit()},e.interval,this),2):8}return 32},failTimeout:function(){return this._timer=a(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),j.VERSION="2.0.8",j.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[X,{enable:!1}],[q,{enable:!1},["rotate"]],[K,{direction:l}],[Q,{direction:l},["swipe"]],[J],[J,{event:"doubletap",taps:2},["tap"]],[V]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};Z.prototype={set:function(t){return rt(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var i,n=this.recognizers,o=e.curRecognizer;(!o||8&o.state)&&(o=e.curRecognizer=null);for(var a=0;a<n.length;)i=n[a],2===e.stopped||o&&i!=o&&!i.canRecognizeWith(o)?i.reset():i.recognize(t),!o&&14&i.state&&(o=e.curRecognizer=i),a++}},get:function(t){if(t instanceof H)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(n(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),(t.manager=this).touchAction.update(),t},remove:function(t){return n(t,"remove",this)||!(t=this.get(t))||-1!==(t=y(e=this.recognizers,t))&&(e.splice(t,1),this.touchAction.update()),this;var e},on:function(t,e){var i;if(t!==I&&e!==I)return i=this.handlers,r(m(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this},off:function(t,e){var i;if(t!==I)return i=this.handlers,r(m(t),function(t){e?i[t]&&i[t].splice(y(i[t],e),1):delete i[t]}),this},emit:function(t,e){this.options.domEvents&&(i=t,n=e,(o=s.createEvent("Event")).initEvent(i,!0,!0),(o.gesture=n).target.dispatchEvent(o));var i,n,o,a=this.handlers[t]&&this.handlers[t].slice();if(a&&a.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<a.length;)a[r](e),r++}},destroy:function(){this.element&&$(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},rt(j,{INPUT_START:_,INPUT_MOVE:2,INPUT_END:A,INPUT_CANCEL:b,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:ft,DIRECTION_LEFT:mt,DIRECTION_RIGHT:yt,DIRECTION_UP:vt,DIRECTION_DOWN:It,DIRECTION_HORIZONTAL:l,DIRECTION_VERTICAL:_t,DIRECTION_ALL:At,Manager:Z,Input:e,TouchAction:z,TouchInput:D,MouseInput:L,PointerEventInput:O,TouchMouseInput:B,SingleTouchInput:F,Recognizer:H,AttrRecognizer:i,Tap:J,Pan:Q,Swipe:K,Pinch:q,Rotate:X,Press:V,on:g,off:u,each:r,merge:lt,extend:st,assign:rt,inherit:t,bindFn:c,prefixed:w}),(void 0!==o?o:"undefined"!=typeof self?self:{}).Hammer=j,"function"==typeof define&&define.amd?define(function(){return j}):"undefined"!=typeof module&&module.exports?module.exports=j:o.Hammer=j}(window,document),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function e(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function F(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?e(Object(o),!0).forEach(function(t){var e,i;e=n,i=o[t=t],t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i,n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function o(t,e){if(null==t)return{};var i,n=function(t,e){if(null==t)return{};for(var i,n={},o=Object.keys(t),a=0;a<o.length;a++)i=o[a],0<=e.indexOf(i)||(n[i]=t[i]);return n}(t,e);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(t),a=0;a<o.length;a++)i=o[a],0<=e.indexOf(i)||Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i]);return n}function s(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(i="Object"===i&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?h(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var I=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),_=t(/Edge/i),c=t(/firefox/i),u=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),i=t(/iP(ad|od|hone)/i),p=t(/chrome/i)&&t(/android/i),d={capture:!1,passive:!1};function l(t,e,i){t.addEventListener(e,i,!I&&d)}function a(t,e,i){t.removeEventListener(e,i,!I&&d)}function g(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function D(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===i)&&g(t,e)||n&&t===i)return t}while(t!==i&&(t=(o=t).host&&o!==document&&o.host.nodeType?o.host:o.parentNode))}var o;return null}var f,m=/\s+/g;function B(t,e,i){var n;t&&e&&(t.classList?t.classList[i?"add":"remove"](e):(n=(" "+t.className+" ").replace(m," ").replace(" "+e+" "," "),t.className=(n+(i?" "+e:"")).replace(m," ")))}function S(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];n[e=!(e in n||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=i+("string"==typeof i?"":"px")}}function A(t,e){var i="";if("string"==typeof t)i=t;else do{var n=S(t,"transform")}while(n&&"none"!==n&&(i=n+" "+i),!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function b(t,e,i){if(t){var n=t.getElementsByTagName(e),o=0,a=n.length;if(i)for(;o<a;o++)i(n[o],o);return n}return[]}function C(){var t=document.scrollingElement;return t||document.documentElement}function M(t,e,c,i,n){if(t.getBoundingClientRect||t===window){var o,a,r,s,l,h,p=t!==window&&t.parentNode&&t!==C()?(a=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,l=o.right,h=o.height,o.width):(r=a=0,s=window.innerHeight,l=window.innerWidth,h=window.innerHeight,window.innerWidth);if((e||c)&&t!==window&&(n=n||t.parentNode,!I))do{if(n&&n.getBoundingClientRect&&("none"!==S(n,"transform")||c&&"static"!==S(n,"position"))){var d=n.getBoundingClientRect();a-=d.top+parseInt(S(n,"border-top-width")),r-=d.left+parseInt(S(n,"border-left-width")),s=a+o.height,l=r+o.width;break}}while(n=n.parentNode);return i&&t!==window&&(i=(e=A(n||t))&&e.a,t=e&&e.d,e&&(s=(a/=t)+(h/=t),l=(r/=i)+(p/=i))),{top:a,left:r,bottom:s,right:l,width:p,height:h}}}function U(t,e,i){for(var n=P(t,!0),o=M(t)[e];n;){var a=M(n)[i];if(!("top"===i||"left"===i?a<=o:o<=a))return n;if(n===C())break;n=P(n,!1)}return!1}function z(t,e,i,n){for(var o=0,a=0,r=t.children;a<r.length;){if("none"!==r[a].style.display&&r[a]!==O.ghost&&(n||r[a]!==O.dragged)&&D(r[a],i.draggable,t,!1)){if(o===e)return r[a];o++}a++}return null}function H(t,e){for(var i=t.lastElementChild;i&&(i===O.ghost||"none"===S(i,"display")||e&&!g(i,e));)i=i.previousElementSibling;return i||null}function G(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===O.clone||e&&!g(t,e)||i++;return i}function T(t){var e=0,i=0,n=C();if(t)do{var o=A(t),a=o.a,o=o.d}while(e+=t.scrollLeft*a,i+=t.scrollTop*o,t!==n&&(t=t.parentNode));return[e,i]}function P(t,e){if(!t||!t.getBoundingClientRect)return C();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var o=S(i);if(i.clientWidth<i.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!i.getBoundingClientRect||i===document.body)return C();if(n||e)return i;n=!0}}}while(i=i.parentNode);return C()}function x(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function w(e,i){return function(){var t;f||(1===(t=arguments).length?e.call(this,t[0]):e.apply(this,t),f=setTimeout(function(){f=void 0},i))}}function Y(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function N(t){var e=window.Polymer,i=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):i?i(t).clone(!0)[0]:t.cloneNode(!0)}function E(t,e){S(t,"position","absolute"),S(t,"top",e.top),S(t,"left",e.left),S(t,"width",e.width),S(t,"height",e.height)}function W(t){S(t,"position",""),S(t,"top",""),S(t,"left",""),S(t,"width",""),S(t,"height","")}var Q="Sortable"+(new Date).getTime();function q(){var e,n=[];return{captureAnimationState:function(){n=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){var e,i;"none"!==S(t,"display")&&t!==O.ghost&&(n.push({target:t,rect:M(t)}),e=F({},n[n.length-1].rect),!t.thisAnimationDuration||(i=A(t,!0))&&(e.top-=i.f,e.left-=i.e),t.fromRect=e)})},addAnimationState:function(t){n.push(t)},removeAnimationState:function(t){n.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(n,{target:t}),1)},animateAll:function(t){var h=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());var c=!1,p=0;n.forEach(function(t){var e,i=0,n=t.target,o=n.fromRect,a=M(n),r=n.prevFromRect,s=n.prevToRect,t=t.rect,l=A(n,!0);l&&(a.top-=l.f,a.left-=l.e),n.toRect=a,n.thisAnimationDuration&&x(r,a)&&!x(o,a)&&(t.top-a.top)/(t.left-a.left)==(o.top-a.top)/(o.left-a.left)&&(l=t,r=r,s=s,e=h.options,i=Math.sqrt(Math.pow(r.top-l.top,2)+Math.pow(r.left-l.left,2))/Math.sqrt(Math.pow(r.top-s.top,2)+Math.pow(r.left-s.left,2))*e.animation),x(a,o)||(n.prevFromRect=o,n.prevToRect=a,i=i||h.options.animation,h.animate(n,t,a,i)),i&&(c=!0,p=Math.max(p,i),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},i),n.thisAnimationDuration=i)}),clearTimeout(e),c?e=setTimeout(function(){"function"==typeof t&&t()},p):"function"==typeof t&&t(),n=[]},animate:function(t,e,i,n){var o,a;n&&(S(t,"transition",""),S(t,"transform",""),a=(o=A(this.el))&&o.a,o=o&&o.d,a=(e.left-i.left)/(a||1),e=(e.top-i.top)/(o||1),t.animatingX=!!a,t.animatingY=!!e,S(t,"transform","translate3d("+a+"px,"+e+"px,0)"),this.forRepaintDummy=t.offsetWidth,S(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),S(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){S(t,"transition",""),S(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},n))}}}var V=[],X={initializeByDefault:!0},K={mount:function(e){for(var t in X)!X.hasOwnProperty(t)||t in e||(e[t]=X[t]);V.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),V.push(e)},pluginEvent:function(e,i,n){var t=this,o=(this.eventCanceled=!1,n.cancel=function(){t.eventCanceled=!0},e+"Global");V.forEach(function(t){i[t.pluginName]&&(i[t.pluginName][o]&&i[t.pluginName][o](F({sortable:i},n)),i.options[t.pluginName]&&i[t.pluginName][e]&&i[t.pluginName][e](F({sortable:i},n)))})},initializePlugins:function(i,n,o,t){for(var e in V.forEach(function(t){var e=t.pluginName;(i.options[e]||t.initializeByDefault)&&((t=new t(i,n,i.options)).sortable=i,t.options=i.options,i[e]=t,r(o,t.defaults))}),i.options){var a;i.options.hasOwnProperty(e)&&(void 0!==(a=this.modifyOption(i,e,i.options[e]))&&(i.options[e]=a))}},getEventProperties:function(e,i){var n={};return V.forEach(function(t){"function"==typeof t.eventProperties&&r(n,t.eventProperties.call(i[t.pluginName],e))}),n},modifyOption:function(e,i,n){var o;return V.forEach(function(t){e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[i]&&(o=t.optionListeners[i].call(e[t.pluginName],n))}),o}};function J(t){var e=t.sortable,i=t.rootEl,n=t.name,c=t.targetEl,p=t.cloneEl,d=t.toEl,g=t.fromEl,u=t.oldIndex,f=t.newIndex,m=t.oldDraggableIndex,y=t.newDraggableIndex,v=t.originalEvent,o=t.putSortable,t=t.extraEventProperties;if(e=e||i&&i[Q]){var a,r,s=e.options,l="on"+n.charAt(0).toUpperCase()+n.substr(1),h=(!window.CustomEvent||I||_?(a=document.createEvent("Event")).initEvent(n,!0,!0):a=new CustomEvent(n,{bubbles:!0,cancelable:!0}),a.to=d||i,a.from=g||i,a.item=c||i,a.clone=p,a.oldIndex=u,a.newIndex=f,a.oldDraggableIndex=m,a.newDraggableIndex=y,a.originalEvent=v,a.pullMode=o?o.lastPutMode:void 0,F(F({},t),K.getEventProperties(n,e)));for(r in h)a[r]=h[r];i&&i.dispatchEvent(a),s[l]&&s[l].call(e,a)}}function j(t,e){var i=(n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).evt,n=o(n,Z);K.pluginEvent.bind(O)(t,e,F({dragEl:k,parentEl:rt,ghostEl:R,rootEl:L,nextEl:st,lastDownEl:lt,cloneEl:ht,cloneHidden:ct,dragStarted:Tt,putSortable:mt,activeSortable:O.active,originalEvent:i,oldIndex:pt,oldDraggableIndex:gt,newIndex:dt,newDraggableIndex:ut,hideGhostForTarget:it,unhideGhostForTarget:nt,cloneNowHidden:function(){ct=!0},cloneNowShown:function(){ct=!1},dispatchSortableEvent:function(t){$({sortable:e,name:t,originalEvent:i})}},n))}var Z=["evt"];function $(t){J(F({putSortable:mt,cloneEl:ht,targetEl:k,rootEl:L,oldIndex:pt,oldDraggableIndex:gt,newIndex:dt,newDraggableIndex:ut},t))}function tt(t,e){var i,n=S(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=z(t,0,e),t=z(t,1,e),e=a&&S(a),r=t&&S(t),s=e&&parseInt(e.marginLeft)+parseInt(e.marginRight)+M(a).width,l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+M(t).width;return"flex"===n.display?"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal":"grid"===n.display?n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":a&&e.float&&"none"!==e.float?(i="left"===e.float?"left":"right",!t||"both"!==r.clear&&r.clear!==i?"horizontal":"vertical"):a&&("block"===e.display||"flex"===e.display||"table"===e.display||"grid"===e.display||o<=s&&"none"===n[Bt]||t&&"none"===n[Bt]&&o<s+l)?"vertical":"horizontal"}function et(t){function s(a,r){return function(t,e,i,n){var o=t.options.group.name&&e.options.group.name&&t.options.group.name===e.options.group.name;return!(null!=a||!r&&!o)||null!=a&&!1!==a&&(r&&"clone"===a?a:"function"==typeof a?s(a(t,e,i,n),r)(t,e,i,n):(o=(r?t:e).options.group.name,!0===a||"string"==typeof a&&a===o||a.join&&-1<a.indexOf(o)))}}var e={},i=t.group;i&&"object"==n(i)||(i={name:i}),e.name=i.name,e.checkPull=s(i.pull,!0),e.checkPut=s(i.put),e.revertClone=i.revertClone,t.group=e}function it(){!zt&&R&&S(R,"display","none")}function nt(){!zt&&R&&S(R,"display","")}function ot(t){if(k){t=t.touches?t.touches[0]:t;o=t.clientX,a=t.clientY,St.some(function(t){var e,i,n=t[Q].options.emptyInsertThreshold;if(n&&!H(t))return i=M(t),e=o>=i.left-n&&o<=i.right+n,i=a>=i.top-n&&a<=i.bottom+n,e&&i?r=t:void 0});var e=r;if(e){var i,n={};for(i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Q]._onDragOver(n)}}var o,a,r}function at(t){k&&k.parentNode[Q]._isOutsideThisEl(t.target)}var k,rt,R,L,st,lt,ht,ct,pt,dt,gt,ut,ft,mt,yt,vt,It,_t,At,bt,Tt,xt,wt,Nt,Et,Ct=!1,Pt=!1,St=[],Mt=!1,kt=!1,Rt=[],Lt=!1,Ot=[],Ft="undefined"!=typeof document,Dt=i,Bt=_||I?"cssFloat":"float",Ut=Ft&&!p&&!i&&"draggable"in document.createElement("div")&&!I,zt=function(){if(Ft){if(I)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}();Ft&&document.addEventListener("click",function(t){if(Pt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Pt=!1},!0);function O(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=r({},e),t[Q]=this;var i,n,o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return tt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==O.supportPointer&&"PointerEvent"in window&&!u,emptyInsertThreshold:5};for(i in K.initializePlugins(this,t,o),o)i in e||(e[i]=o[i]);for(n in et(e),this)"_"===n.charAt(0)&&"function"==typeof this[n]&&(this[n]=this[n].bind(this));this.nativeDraggable=!e.forceFallback&&Ut,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?l(t,"pointerdown",this._onTapStart):(l(t,"mousedown",this._onTapStart),l(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(l(t,"dragover",this),l(t,"dragenter",this)),St.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),r(this,q())}function Ht(t,e,i,n,o,c,a,p){var r,s,l=t[Q],h=l.options.onMove;return!window.CustomEvent||I||_?(r=document.createEvent("Event")).initEvent("move",!0,!0):r=new CustomEvent("move",{bubbles:!0,cancelable:!0}),r.to=e,r.from=t,r.dragged=i,r.draggedRect=n,r.related=o||e,r.relatedRect=c||M(e),r.willInsertAfter=p,r.originalEvent=a,t.dispatchEvent(r),s=h?h.call(l,r,a):s}function Gt(t){t.draggable=!1}function Yt(){Lt=!1}function Wt(t){return setTimeout(t,0)}function Qt(t){return clearTimeout(t)}O.prototype={constructor:O,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(xt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,k):this.options.direction},_onTapStart:function(e){if(e.cancelable){for(var i=this,n=this.el,t=this.options,o=t.preventOnFilter,c=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,r=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||r,l=t.filter,p=n,h=(Ot.length=0,p.getElementsByTagName("input")),d=h.length;d--;){var g=h[d];g.checked&&Ot.push(g)}if(!k&&!(/mousedown|pointerdown/.test(c)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!r||"SELECT"!==r.tagName.toUpperCase())&&!((r=D(r,t.draggable,n,!1))&&r.animated||lt===r)){if(pt=G(r),gt=G(r,t.draggable),"function"==typeof l){if(l.call(this,e,r,this))return $({sortable:i,rootEl:s,name:"filter",targetEl:r,toEl:n,fromEl:n}),j("filter",i,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(l=l&&l.split(",").some(function(t){if(t=D(s,t.trim(),n,!1))return $({sortable:i,rootEl:t,name:"filter",targetEl:r,fromEl:n,toEl:n}),j("filter",i,{evt:e}),!0}))return void(o&&e.cancelable&&e.preventDefault());t.handle&&!D(s,t.handle,n,!1)||this._prepareDragStart(e,a,r)}}},_prepareDragStart:function(t,e,i){var n,o=this,a=o.el,r=o.options,s=a.ownerDocument;i&&!k&&i.parentNode===a&&(n=M(i),L=a,rt=(k=i).parentNode,st=k.nextSibling,lt=i,ft=r.group,yt={target:O.dragged=k,clientX:(e||t).clientX,clientY:(e||t).clientY},At=yt.clientX-n.left,bt=yt.clientY-n.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,k.style["will-change"]="all",a=function(){j("delayEnded",o,{evt:t}),O.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!c&&o.nativeDraggable&&(k.draggable=!0),o._triggerDragStart(t,e),$({sortable:o,name:"choose",originalEvent:t}),B(k,r.chosenClass,!0))},r.ignore.split(",").forEach(function(t){b(k,t.trim(),Gt)}),l(s,"dragover",ot),l(s,"mousemove",ot),l(s,"touchmove",ot),l(s,"mouseup",o._onDrop),l(s,"touchend",o._onDrop),l(s,"touchcancel",o._onDrop),c&&this.nativeDraggable&&(this.options.touchStartThreshold=4,k.draggable=!0),j("delayStart",this,{evt:t}),!r.delay||r.delayOnTouchOnly&&!e||this.nativeDraggable&&(_||I)?a():O.eventCanceled?this._onDrop():(l(s,"mouseup",o._disableDelayedDrag),l(s,"touchend",o._disableDelayedDrag),l(s,"touchcancel",o._disableDelayedDrag),l(s,"mousemove",o._delayedDragTouchMoveHandler),l(s,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&l(s,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(a,r.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){k&&Gt(k),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;a(t,"mouseup",this._disableDelayedDrag),a(t,"touchend",this._disableDelayedDrag),a(t,"touchcancel",this._disableDelayedDrag),a(t,"mousemove",this._delayedDragTouchMoveHandler),a(t,"touchmove",this._delayedDragTouchMoveHandler),a(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?l(document,"pointermove",this._onTouchMove):l(document,e?"touchmove":"mousemove",this._onTouchMove):(l(k,"dragend",this),l(L,"dragstart",this._onDragStart));try{document.selection?Wt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var i;Ct=!1,L&&k?(j("dragStarted",this,{evt:e}),this.nativeDraggable&&l(document,"dragover",at),i=this.options,t||B(k,i.dragClass,!1),B(k,i.ghostClass,!0),O.active=this,t&&this._appendGhost(),$({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(vt){this._lastX=vt.clientX,this._lastY=vt.clientY,it();for(var t=document.elementFromPoint(vt.clientX,vt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(vt.clientX,vt.clientY))!==e;)e=t;if(k.parentNode[Q]._isOutsideThisEl(t),e)do{if(e[Q])if(e[Q]._onDragOver({clientX:vt.clientX,clientY:vt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=(t=e).parentNode);nt()}},_onTouchMove:function(t){if(yt){var e=this.options,i=e.fallbackTolerance,e=e.fallbackOffset,n=t.touches?t.touches[0]:t,o=R&&A(R,!0),a=R&&o&&o.a,r=R&&o&&o.d,s=Dt&&Et&&T(Et),a=(n.clientX-yt.clientX+e.x)/(a||1)+(s?s[0]-Rt[0]:0)/(a||1),e=(n.clientY-yt.clientY+e.y)/(r||1)+(s?s[1]-Rt[1]:0)/(r||1);if(!O.active&&!Ct){if(i&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}R&&(o?(o.e+=a-(It||0),o.f+=e-(_t||0)):o={a:1,b:0,c:0,d:1,e:a,f:e},s="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")"),S(R,"webkitTransform",s),S(R,"mozTransform",s),S(R,"msTransform",s),S(R,"transform",s),It=a,_t=e,vt=n),t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!R){var t=this.options.fallbackOnBody?document.body:L,e=M(k,!0,Dt,!0,t),i=this.options;if(Dt){for(Et=t;"static"===S(Et,"position")&&"none"===S(Et,"transform")&&Et!==document;)Et=Et.parentNode;Et!==document.body&&Et!==document.documentElement?(Et===document&&(Et=C()),e.top+=Et.scrollTop,e.left+=Et.scrollLeft):Et=C(),Rt=T(Et)}B(R=k.cloneNode(!0),i.ghostClass,!1),B(R,i.fallbackClass,!0),B(R,i.dragClass,!0),S(R,"transition",""),S(R,"transform",""),S(R,"box-sizing","border-box"),S(R,"margin",0),S(R,"top",e.top),S(R,"left",e.left),S(R,"width",e.width),S(R,"height",e.height),S(R,"opacity","0.8"),S(R,"position",Dt?"absolute":"fixed"),S(R,"zIndex","100000"),S(R,"pointerEvents","none"),O.ghost=R,t.appendChild(R),S(R,"transform-origin",At/parseInt(R.style.width)*100+"% "+bt/parseInt(R.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,o=i.options;j("dragStart",this,{evt:t}),O.eventCanceled?this._onDrop():(j("setupClone",this),O.eventCanceled||((ht=N(k)).draggable=!1,ht.style["will-change"]="",this._hideClone(),B(ht,this.options.chosenClass,!1),O.clone=ht),i.cloneId=Wt(function(){j("clone",i),O.eventCanceled||(i.options.removeCloneOnHide||L.insertBefore(ht,k),i._hideClone(),$({sortable:i,name:"clone"}))}),e||B(k,o.dragClass,!0),e?(Pt=!0,i._loopId=setInterval(i._emulateDragOver,50)):(a(document,"mouseup",i._onDrop),a(document,"touchend",i._onDrop),a(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",o.setData&&o.setData.call(i,n,k)),l(document,"drop",i),S(k,"transform","translateZ(0)")),Ct=!0,i._dragStartId=Wt(i._dragStarted.bind(i,e,t)),l(document,"selectstart",i),Tt=!0,u&&S(document.body,"user-select","none"))},_onDragOver:function(i){var c,p,d,n=this.el,o=i.target,e=this.options,t=e.group,g=O.active,u=ft===t,f=e.sort,m=mt||g,a=this,y=!1;if(!Lt){if(void 0!==i.preventDefault&&i.cancelable&&i.preventDefault(),o=D(o,e.draggable,n,!0),E("dragOver"),O.eventCanceled)return y;if(k.contains(i.target)||o.animated&&o.animatingX&&o.animatingY||a._ignoreWhileAnimating===o)return h(!1);if(Pt=!1,g&&!e.disabled&&(u?f||(p=rt!==L):mt===this||(this.lastPutMode=ft.checkPull(this,g,k,i))&&t.checkPut(this,g,k,i))){if(d="vertical"===this._getDirection(i,o),c=M(k),E("dragOverValid"),O.eventCanceled)return y;if(p)return rt=L,C(),this._hideClone(),E("revert"),O.eventCanceled||(st?L.insertBefore(k,st):L.appendChild(k)),h(!0);t=H(n,e.draggable);if(!t||function(t,e,i){i=M(H(i.el,i.options.draggable));return e?t.clientX>i.right+10||t.clientX<=i.right&&t.clientY>i.bottom&&t.clientX>=i.left:t.clientX>i.right&&t.clientY>i.top||t.clientX<=i.right&&t.clientY>i.bottom+10}(i,d,this)&&!t.animated){if(t===k)return h(!1);if((o=t&&n===i.target?t:o)&&(r=M(o)),!1!==Ht(L,n,k,c,o,r,i,!!o))return C(),n.appendChild(k),rt=n,P(),h(!0)}else if(t&&function(t,e,i){i=M(z(i.el,0,i.options,!0));return e?t.clientX<i.left-10||t.clientY<i.top&&t.clientX<i.right:t.clientY<i.top-10||t.clientY<i.bottom&&t.clientX<i.left}(i,d,this)){t=z(n,0,e,!0);if(t===k)return h(!1);if(r=M(o=t),!1!==Ht(L,n,k,c,o,r,i,!1))return C(),n.insertBefore(k,t),rt=n,P(),h(!0)}else if(o.parentNode===n){var v,I,_,r=M(o),t=k.parentNode!==n,A=(s=k.animated&&k.toRect||c,A=o.animated&&o.toRect||r,x=(l=d)?s.left:s.top,b=l?s.right:s.bottom,s=l?s.width:s.height,N=l?A.left:A.top,T=l?A.right:A.bottom,l=l?A.width:A.height,!(x===N||b===T||x+s/2===N+l/2)),b=d?"top":"left",T=U(o,"top","top")||U(k,"top","top"),x=T?T.scrollTop:void 0;if(xt!==o&&(I=r[b],Mt=!1,kt=!A&&e.invertSwap||t),0!==(v=function(t,e,i,n,o,a,r,s){var t=n?t.clientY:t.clientX,l=n?i.height:i.width,h=n?i.top:i.left,n=n?i.bottom:i.right,i=!1;if(!r)if(s&&Nt<l*o){if(Mt=!Mt&&(1===wt?h+l*a/2<t:t<n-l*a/2)?!0:Mt)i=!0;else if(1===wt?t<h+Nt:n-Nt<t)return-wt}else if(h+l*(1-o)/2<t&&t<n-l*(1-o)/2)return function(t){return G(k)<G(t)?1:-1}(e);if((i=i||r)&&(t<h+l*a/2||n-l*a/2<t))return h+l/2<t?1:-1;return 0}(i,o,r,d,A?1:e.swapThreshold,null==e.invertedSwapThreshold?e.swapThreshold:e.invertedSwapThreshold,kt,xt===o)))for(var w=G(k);(_=rt.children[w-=v])&&("none"===S(_,"display")||_===R););if(0===v||_===o)return h(!1);wt=v;var s=(xt=o).nextElementSibling,N=!1,l=Ht(L,n,k,c,o,r,i,N=1===v);if(!1!==l)return 1!==l&&-1!==l||(N=1===l),Lt=!0,setTimeout(Yt,30),C(),N&&!s?n.appendChild(k):o.parentNode.insertBefore(k,N?s:o),T&&Y(T,0,x-T.scrollTop),rt=k.parentNode,void 0===I||kt||(Nt=Math.abs(I-M(o)[b])),P(),h(!0)}if(n.contains(k))return h(!1)}return!1}function E(t,e){j(t,a,F({evt:i,isOwner:u,axis:d?"vertical":"horizontal",revert:p,dragRect:c,targetRect:r,canSort:f,fromSortable:m,target:o,completed:h,onMove:function(t,e){return Ht(L,n,k,c,t,M(t),i,e)},changed:P},e))}function C(){E("dragOverAnimationCapture"),a.captureAnimationState(),a!==m&&m.captureAnimationState()}function h(t){return E("dragOverCompleted",{insertion:t}),t&&(u?g._hideClone():g._showClone(a),a!==m&&(B(k,(mt||g).options.ghostClass,!1),B(k,e.ghostClass,!0)),mt!==a&&a!==O.active?mt=a:a===O.active&&mt&&(mt=null),m===a&&(a._ignoreWhileAnimating=o),a.animateAll(function(){E("dragOverAnimationComplete"),a._ignoreWhileAnimating=null}),a!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(o===k&&!k.animated||o===n&&!o.animated)&&(xt=null),e.dragoverBubble||i.rootEl||o===document||(k.parentNode[Q]._isOutsideThisEl(i.target),t||ot(i)),!e.dragoverBubble&&i.stopPropagation&&i.stopPropagation(),y=!0}function P(){dt=G(k),ut=G(k,e.draggable),$({sortable:a,name:"change",toEl:n,newIndex:dt,newDraggableIndex:ut,originalEvent:i})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){a(document,"mousemove",this._onTouchMove),a(document,"touchmove",this._onTouchMove),a(document,"pointermove",this._onTouchMove),a(document,"dragover",ot),a(document,"mousemove",ot),a(document,"touchmove",ot)},_offUpEvents:function(){var t=this.el.ownerDocument;a(t,"mouseup",this._onDrop),a(t,"touchend",this._onDrop),a(t,"pointerup",this._onDrop),a(t,"touchcancel",this._onDrop),a(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;dt=G(k),ut=G(k,i.draggable),j("drop",this,{evt:t}),rt=k&&k.parentNode,dt=G(k),ut=G(k,i.draggable),O.eventCanceled||(Mt=kt=Ct=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Qt(this.cloneId),Qt(this._dragStartId),this.nativeDraggable&&(a(document,"drop",this),a(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),u&&S(document.body,"user-select",""),S(k,"transform",""),t&&(Tt&&(t.cancelable&&t.preventDefault(),i.dropBubble||t.stopPropagation()),R&&R.parentNode&&R.parentNode.removeChild(R),(L===rt||mt&&"clone"!==mt.lastPutMode)&&ht&&ht.parentNode&&ht.parentNode.removeChild(ht),k&&(this.nativeDraggable&&a(k,"dragend",this),Gt(k),k.style["will-change"]="",Tt&&!Ct&&B(k,(mt||this).options.ghostClass,!1),B(k,this.options.chosenClass,!1),$({sortable:this,name:"unchoose",toEl:rt,newIndex:null,newDraggableIndex:null,originalEvent:t}),L!==rt?(0<=dt&&($({rootEl:rt,name:"add",toEl:rt,fromEl:L,originalEvent:t}),$({sortable:this,name:"remove",toEl:rt,originalEvent:t}),$({rootEl:rt,name:"sort",toEl:rt,fromEl:L,originalEvent:t}),$({sortable:this,name:"sort",toEl:rt,originalEvent:t})),mt&&mt.save()):dt!==pt&&0<=dt&&($({sortable:this,name:"update",toEl:rt,originalEvent:t}),$({sortable:this,name:"sort",toEl:rt,originalEvent:t})),O.active&&(null!=dt&&-1!==dt||(dt=pt,ut=gt),$({sortable:this,name:"end",toEl:rt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){j("nulling",this),L=k=rt=R=st=ht=lt=ct=yt=vt=Tt=dt=ut=pt=gt=xt=wt=mt=ft=O.dragged=O.ghost=O.clone=O.active=null,Ot.forEach(function(t){t.checked=!0}),Ot.length=It=_t=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":var e;k&&(this._onDragOver(t),(e=t).dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault());break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,o=i.length,a=this.options;n<o;n++)D(t=i[n],a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||function(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;for(;i--;)n+=e.charCodeAt(i);return n.toString(36)}(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach(function(t,e){e=n.children[e];D(e,this.options.draggable,n,!1)&&(i[t]=e)},this),e&&this.captureAnimationState(),t.forEach(function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return D(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=K.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&et(i)},destroy:function(){j("destroy",this);var t=this.el;t[Q]=null,a(t,"mousedown",this._onTapStart),a(t,"touchstart",this._onTapStart),a(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(a(t,"dragover",this),a(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),St.splice(St.indexOf(this.el),1),this.el=t=null},_hideClone:function(){ct||(j("hideClone",this),O.eventCanceled||(S(ht,"display","none"),this.options.removeCloneOnHide&&ht.parentNode&&ht.parentNode.removeChild(ht),ct=!0))},_showClone:function(t){"clone"===t.lastPutMode?ct&&(j("showClone",this),O.eventCanceled||(k.parentNode!=L||this.options.group.revertClone?st?L.insertBefore(ht,st):L.appendChild(ht):L.insertBefore(ht,k),this.options.group.revertClone&&this.animate(k,ht),S(ht,"display",""),ct=!1)):this._hideClone()}},Ft&&l(document,"touchmove",function(t){(O.active||Ct)&&t.cancelable&&t.preventDefault()}),O.utils={on:l,off:a,css:S,find:b,is:function(t,e){return!!D(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:w,closest:D,toggleClass:B,clone:N,index:G,nextTick:Wt,cancelNextTick:Qt,detectDirection:tt,getChild:z},O.get=function(t){return t[Q]},O.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];(e=e[0].constructor===Array?e[0]:e).forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(O.utils=F(F({},O.utils),t.utils)),K.mount(t)})},O.create=function(t,e){return new O(t,e)};var qt,Vt,Xt,Kt,Jt,jt,Zt=[],$t=!(O.version="1.14.0");function te(){Zt.forEach(function(t){clearInterval(t.pid)}),Zt=[]}function ee(){clearInterval(jt)}function ie(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,o=t.activeSortable,a=t.dispatchSortableEvent,r=t.hideGhostForTarget,t=t.unhideGhostForTarget;e&&(o=i||o,r(),r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(r.clientX,r.clientY),t(),o&&!o.el.contains(e)&&(a("spill"),this.onSpill({dragEl:n,putSortable:i})))}var ne,oe=w(function(i,t,c,p){if(t.scroll){var d,g=(i.touches?i.touches[0]:i).clientX,u=(i.touches?i.touches[0]:i).clientY,e=t.scrollSensitivity,f=t.scrollSpeed,m=C(),y=!1,n=(Vt!==c&&(Vt=c,te(),qt=t.scroll,d=t.scrollFn,!0===qt&&(qt=P(c,!0))),0),o=qt;do{var a=o,r=M(a),v=r.top,I=r.bottom,_=r.left,A=r.right,b=r.width,r=r.height,s=void 0,T=void 0,x=a.scrollWidth,w=a.scrollHeight,l=S(a),N=a.scrollLeft,E=a.scrollTop,T=a===m?(s=b<x&&("auto"===l.overflowX||"scroll"===l.overflowX||"visible"===l.overflowX),r<w&&("auto"===l.overflowY||"scroll"===l.overflowY||"visible"===l.overflowY)):(s=b<x&&("auto"===l.overflowX||"scroll"===l.overflowX),r<w&&("auto"===l.overflowY||"scroll"===l.overflowY)),l=s&&(Math.abs(A-g)<=e&&N+b<x)-(Math.abs(_-g)<=e&&!!N),s=T&&(Math.abs(I-u)<=e&&E+r<w)-(Math.abs(v-u)<=e&&!!E);if(!Zt[n])for(var h=0;h<=n;h++)Zt[h]||(Zt[h]={});Zt[n].vx==l&&Zt[n].vy==s&&Zt[n].el===a||(Zt[n].el=a,Zt[n].vx=l,Zt[n].vy=s,clearInterval(Zt[n].pid),0==l&&0==s||(y=!0,Zt[n].pid=setInterval(function(){p&&0===this.layer&&O.active._onTouchMove(Jt);var t=Zt[this.layer].vy?Zt[this.layer].vy*f:0,e=Zt[this.layer].vx?Zt[this.layer].vx*f:0;"function"==typeof d&&"continue"!==d.call(O.dragged.parentNode[Q],e,t,i,Jt,Zt[this.layer].el)||Y(Zt[this.layer].el,e,t)}.bind({layer:n}),24))),n++}while(t.bubbleScroll&&o!==m&&(o=P(o,!1)));$t=y}},30);function ae(){}function re(){}ae.prototype={startIndex:null,dragStart:function(t){t=t.oldDraggableIndex;this.startIndex=t},onSpill:function(t){var e=t.dragEl,t=t.putSortable,i=(this.sortable.captureAnimationState(),t&&t.captureAnimationState(),z(this.sortable.el,this.startIndex,this.options));i?this.sortable.el.insertBefore(e,i):this.sortable.el.appendChild(e),this.sortable.animateAll(),t&&t.animateAll()},drop:ie},r(ae,{pluginName:"revertOnSpill"}),re.prototype={onSpill:function(t){var e=t.dragEl,t=t.putSortable||this.sortable;t.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),t.animateAll()},drop:ie},r(re,{pluginName:"removeOnSpill"});var se,le,y,he,ce,v=[],pe=[],de=!1,ge=!1,ue=!1;function fe(i,n){pe.forEach(function(t,e){e=n.children[t.sortableIndex+(i?Number(e):0)];e?n.insertBefore(t,e):n.appendChild(t)})}function me(){v.forEach(function(t){t!==y&&t.parentNode&&t.parentNode.removeChild(t)})}return O.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){t=t.originalEvent;this.sortable.nativeDraggable?l(document,"dragover",this._handleAutoScroll):this.options.supportPointer?l(document,"pointermove",this._handleFallbackAutoScroll):t.touches?l(document,"touchmove",this._handleFallbackAutoScroll):l(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){t=t.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?a(document,"dragover",this._handleAutoScroll):(a(document,"pointermove",this._handleFallbackAutoScroll),a(document,"touchmove",this._handleFallbackAutoScroll),a(document,"mousemove",this._handleFallbackAutoScroll)),ee(),te(),clearTimeout(f),f=void 0},nulling:function(){Jt=Vt=qt=$t=jt=Xt=Kt=null,Zt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(e,i){var n,o=this,a=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,t=document.elementFromPoint(a,r);Jt=e,i||this.options.forceAutoScrollFallback||_||I||u?(oe(e,this.options,t,i),n=P(t,!0),!$t||jt&&a===Xt&&r===Kt||(jt&&ee(),jt=setInterval(function(){var t=P(document.elementFromPoint(a,r),!0);t!==n&&(n=t,te()),oe(e,o.options,t,i)},10),Xt=a,Kt=r)):this.options.bubbleScroll&&P(t,!0)!==C()?oe(e,this.options,P(t,!1),!1):te()}},r(t,{pluginName:"scroll",initializeByDefault:!0})}),O.mount(re,ae),O.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){t=t.dragEl;ne=t},dragOverValid:function(t){var e,i=t.completed,n=t.target,o=t.onMove,a=t.activeSortable,r=t.changed,t=t.cancel;a.options.swap&&(a=this.sortable.el,e=this.options,n&&n!==a&&(a=ne,ne=!1!==o(n)?(B(n,e.swapClass,!0),n):null,a&&a!==ne&&B(a,e.swapClass,!1)),r(),i(!0),t())},drop:function(t){var e,i,n,o=t.activeSortable,a=t.putSortable,t=t.dragEl,r=a||this.sortable,s=this.options;ne&&B(ne,s.swapClass,!1),ne&&(s.swap||a&&a.options.swap)&&t!==ne&&(r.captureAnimationState(),r!==o&&o.captureAnimationState(),s=ne,t=(a=t).parentNode,n=s.parentNode,t&&n&&!t.isEqualNode(s)&&!n.isEqualNode(a)&&(e=G(a),i=G(s),t.isEqualNode(n)&&e<i&&i++,t.insertBefore(s,t.children[e]),n.insertBefore(a,n.children[i])),r.animateAll(),r!==o&&o.animateAll())},nulling:function(){ne=null}},r(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ne}}})}),O.mount(new function(){function t(n){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));n.options.supportPointer?l(document,"pointerup",this._deselectMultiDrag):(l(document,"mouseup",this._deselectMultiDrag),l(document,"touchend",this._deselectMultiDrag)),l(document,"keydown",this._checkKeyDown),l(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(t,e){var i="";v.length&&le===n?v.forEach(function(t,e){i+=(e?", ":"")+t.textContent}):i=e.textContent,t.setData("Text",i)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){t=t.dragEl;y=t},delayEnded:function(){this.isMultiDrag=~v.indexOf(y)},setupClone:function(t){var e=t.sortable,t=t.cancel;if(this.isMultiDrag){for(var i=0;i<v.length;i++)pe.push(N(v[i])),pe[i].sortableIndex=v[i].sortableIndex,pe[i].draggable=!1,pe[i].style["will-change"]="",B(pe[i],this.options.selectedClass,!1),v[i]===y&&B(pe[i],this.options.chosenClass,!1);e._hideClone(),t()}},clone:function(t){var e=t.sortable,i=t.rootEl,n=t.dispatchSortableEvent,t=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||v.length&&le===e&&(fe(!0,i),n("clone"),t()))},showClone:function(t){var e=t.cloneNowShown,i=t.rootEl,t=t.cancel;this.isMultiDrag&&(fe(!1,i),pe.forEach(function(t){S(t,"display","")}),e(),ce=!1,t())},hideClone:function(t){var e=this,i=(t.sortable,t.cloneNowHidden),t=t.cancel;this.isMultiDrag&&(pe.forEach(function(t){S(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),i(),ce=!0,t())},dragStartGlobal:function(t){t.sortable;!this.isMultiDrag&&le&&le.multiDrag._deselectMultiDrag(),v.forEach(function(t){t.sortableIndex=G(t)}),v=v.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),ue=!0},dragStarted:function(t){var e,i=this,t=t.sortable;this.isMultiDrag&&(this.options.sort&&(t.captureAnimationState(),this.options.animation&&(v.forEach(function(t){t!==y&&S(t,"position","absolute")}),e=M(y,!1,!0,!0),v.forEach(function(t){t!==y&&E(t,e)}),de=ge=!0)),t.animateAll(function(){de=ge=!1,i.options.animation&&v.forEach(function(t){W(t)}),i.options.sort&&me()}))},dragOver:function(t){var e=t.target,i=t.completed,t=t.cancel;ge&&~v.indexOf(e)&&(i(!1),t())},revert:function(t){var i,n,e=t.fromSortable,o=t.rootEl,a=t.sortable,r=t.dragRect;1<v.length&&(v.forEach(function(t){a.addAnimationState({target:t,rect:ge?M(t):r}),W(t),t.fromRect=r,e.removeAnimationState(t)}),ge=!1,i=!this.options.removeCloneOnHide,n=o,v.forEach(function(t,e){e=n.children[t.sortableIndex+(i?Number(e):0)];e?n.insertBefore(t,e):n.appendChild(t)}))},dragOverCompleted:function(t){var e,i=t.sortable,n=t.isOwner,o=t.insertion,a=t.activeSortable,r=t.parentEl,t=t.putSortable,s=this.options;o&&(n&&a._hideClone(),de=!1,s.animation&&1<v.length&&(ge||!n&&!a.options.sort&&!t)&&(e=M(y,!1,!0,!0),v.forEach(function(t){t!==y&&(E(t,e),r.appendChild(t))}),ge=!0),n||(ge||me(),1<v.length?(o=ce,a._showClone(i),a.options.animation&&!ce&&o&&pe.forEach(function(t){a.addAnimationState({target:t,rect:he}),t.fromRect=he,t.thisAnimationDuration=null})):a._showClone(i)))},dragOverAnimationCapture:function(t){var e=t.dragRect,i=t.isOwner,t=t.activeSortable;v.forEach(function(t){t.thisAnimationDuration=null}),t.options.animation&&!i&&t.multiDrag.isMultiDrag&&(he=r({},e),i=A(y,!0),he.top-=i.f,he.left-=i.e)},dragOverAnimationComplete:function(){ge&&(ge=!1,me())},drop:function(t){var e=t.originalEvent,i=t.rootEl,n=t.parentEl,c=t.sortable,p=t.dispatchSortableEvent,d=t.oldIndex,t=t.putSortable,o=t||this.sortable;if(e){var g,u,f,a=this.options,r=n.children;if(!ue)if(a.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),B(y,a.selectedClass,!~v.indexOf(y)),~v.indexOf(y))v.splice(v.indexOf(y),1),se=null,J({sortable:c,rootEl:i,name:"deselect",targetEl:y,originalEvt:e});else{if(v.push(y),J({sortable:c,rootEl:i,name:"select",targetEl:y,originalEvt:e}),e.shiftKey&&se&&c.el.contains(se)){var s=G(se),l=G(y);if(~s&&~l&&s!==l)for(var h,m=s<l?(h=s,l):(h=l,s+1);h<m;h++)~v.indexOf(r[h])||(B(r[h],a.selectedClass,!0),v.push(r[h]),J({sortable:c,rootEl:i,name:"select",targetEl:r[h],originalEvt:e}))}else se=y;le=o}ue&&this.isMultiDrag&&(ge=!1,(n[Q].options.sort||n!==i)&&1<v.length&&(g=M(y),u=G(y,":not(."+this.options.selectedClass+")"),!de&&a.animation&&(y.thisAnimationDuration=null),o.captureAnimationState(),de||(a.animation&&(y.fromRect=g,v.forEach(function(t){var e;t.thisAnimationDuration=null,t!==y&&(e=ge?M(t):g,t.fromRect=e,o.addAnimationState({target:t,rect:e}))})),me(),v.forEach(function(t){r[u]?n.insertBefore(t,r[u]):n.appendChild(t),u++}),d===G(y)&&(f=!1,v.forEach(function(t){t.sortableIndex!==G(t)&&(f=!0)}),f&&p("update"))),v.forEach(function(t){W(t)}),o.animateAll()),le=o),(i===n||t&&"clone"!==t.lastPutMode)&&pe.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)})}},nullingGlobal:function(){this.isMultiDrag=ue=!1,pe.length=0},destroyGlobal:function(){this._deselectMultiDrag(),a(document,"pointerup",this._deselectMultiDrag),a(document,"mouseup",this._deselectMultiDrag),a(document,"touchend",this._deselectMultiDrag),a(document,"keydown",this._checkKeyDown),a(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ue&&ue||le!==this.sortable||t&&D(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;v.length;){var e=v[0];B(e,this.options.selectedClass,!1),v.shift(),J({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvt:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},r(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[Q];e&&e.options.multiDrag&&!~v.indexOf(t)&&(le&&le!==e&&(le.multiDrag._deselectMultiDrag(),le=e),B(t,e.options.selectedClass,!0),v.push(t))},deselect:function(t){var e=t.parentNode[Q],i=v.indexOf(t);e&&e.options.multiDrag&&~i&&(B(t,e.options.selectedClass,!1),v.splice(i,1))}},eventProperties:function(){var i=this,n=[],o=[];return v.forEach(function(t){var e;n.push({multiDragElement:t,index:t.sortableIndex}),e=ge&&t!==y?-1:ge?G(t,":not(."+i.options.selectedClass+")"):G(t),o.push({multiDragElement:t,index:e})}),{items:s(v),clones:[].concat(pe),oldIndicies:n,newIndicies:o}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),O});