hzzt-kfb-slide 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/components/{annotateCnEsVKZh.js → annotateC6KKIN-C.js} +1 -1
  2. package/dist/components/annotateCH4GAooA.js +1 -0
  3. package/dist/components/{annotateBqmjdjvz.js → annotateCriDzoRR.js} +37 -36
  4. package/dist/components/{annotateBVEx-rya.js → annotateDrBDAiwJ.js} +1 -1
  5. package/dist/components/{arrowK6nDwd7R.js → arrowDPk76wAe.js} +1 -1
  6. package/dist/components/{arrowDownCPhRTVmw.js → arrowDownBdM08C-k.js} +1 -1
  7. package/dist/components/{arrowDownB5-0ALxZ.js → arrowDownDI6AMcyz.js} +1 -1
  8. package/dist/components/{arrowDu4kVbgE.js → arrowFPEB8W4f.js} +1 -1
  9. package/dist/components/{arrowLeftCU3T3r30.js → arrowLeftCHTZ9DsM.js} +1 -1
  10. package/dist/components/{arrowLeftBpJAKYIU.js → arrowLeftM_OyaeGe.js} +1 -1
  11. package/dist/components/{arrowRightmZqySSay.js → arrowRightCxryh7mK.js} +1 -1
  12. package/dist/components/{arrowRightClWKIUuS.js → arrowRightDjW4cZXc.js} +1 -1
  13. package/dist/components/{arrowUpt5FuC3FU.js → arrowUpBBOMqRwJ.js} +1 -1
  14. package/dist/components/{arrowUpBou4eMQV.js → arrowUpDoHvHUV6.js} +1 -1
  15. package/dist/components/{channelC2Ri97Of.js → channel0jNldMsg.js} +1 -1
  16. package/dist/components/{channelCwUVeFpV.js → channelCsDQbKiD.js} +1 -1
  17. package/dist/components/{check0RJobaJ4.js → check0Zxvds83.js} +1 -1
  18. package/dist/components/{checkDfZPSwE6.js → checkBWJi9_a6.js} +1 -1
  19. package/dist/components/{configCgTZWYHR.js → config6VhhjpQh.js} +1 -1
  20. package/dist/components/{configC6FKsyN9.js → configCQX8ZTs2.js} +1 -1
  21. package/dist/components/{customB30kJ3DX.js → customDNzwsLNR.js} +5 -6
  22. package/dist/components/customs0nLjsaE.js +1 -0
  23. package/dist/components/{deleteBXoB6UTd.js → deleteCgLqIVRl.js} +1 -1
  24. package/dist/components/{deleteBaA_lSdx.js → deleteDnKSpkZO.js} +1 -1
  25. package/dist/components/{dotB8_2mIMY.js → dotBeWq5BYs.js} +1 -1
  26. package/dist/components/dotBi2ivVYX.js +1 -0
  27. package/dist/components/{dotCQaSpfEa.js → dotCi0WBjE9.js} +23 -22
  28. package/dist/components/{dotR12-Fs6I.js → dotxBw0mBnq.js} +1 -1
  29. package/dist/components/{downloadDSy6Lx_1.js → downloadBnTQzA4j.js} +11 -11
  30. package/dist/components/{downloadDIRWuAsZ.js → downloadDF2_6Y-f.js} +1 -1
  31. package/dist/components/{downloadL7bwn8r7.js → downloadDNe3qbJ7.js} +1 -1
  32. package/dist/components/{downloadZXx1by-2.js → downloadDeswf8ql.js} +1 -1
  33. package/dist/components/{flipzeRs4WK2.js → flipB4UaXh-c.js} +1 -1
  34. package/dist/components/{flipBWJDgBtU.js → flipDkEX3ZQH.js} +1 -1
  35. package/dist/components/fullscreenBIXfsULV.js +1 -0
  36. package/dist/components/{fullscreenCNn3z9l_.js → fullscreenC9wvJxvO.js} +6 -7
  37. package/dist/components/{fullscreenBHPtTX2M.js → fullscreenCGx_0CaO.js} +1 -1
  38. package/dist/components/{fullscreenBdMJB4PD.js → fullscreenDbpR9B7w.js} +1 -1
  39. package/dist/components/{indexCJCVhkFm.js → indexBm-HXbj3.js} +5474 -5291
  40. package/dist/components/indexCa2d-Wjt.js +30 -0
  41. package/dist/components/{infoBltXncgb.js → infoCjs_wSRJ.js} +1 -1
  42. package/dist/components/{infoDtaFyr6c.js → infogZMbfIdS.js} +1 -1
  43. package/dist/components/{levelCdq1V4Yc.js → level9TdUqGzt.js} +1 -1
  44. package/dist/components/{level0fz2ixaa.js → levelCY1NlHIe.js} +1 -1
  45. package/dist/components/{microscope4jUbJj-C.js → microscope4FIRB1UB.js} +1 -1
  46. package/dist/components/{microscopeCJSAsiIQ.js → microscopeC2JZ0eI2.js} +13 -13
  47. package/dist/components/{microscope6R__I7ur.js → microscopeDRt26GBO.js} +1 -1
  48. package/dist/components/{microscope8r-_ZsCK.js → microscopeDUGvuln-.js} +1 -1
  49. package/dist/components/{moveDg8vDZ98.js → moveBhV9kg6L.js} +1 -1
  50. package/dist/components/{moveCXbqdVKV.js → moveCu3V3JqI.js} +1 -1
  51. package/dist/components/{moveJ_q2x0EZ.js → moveD38V2VTD.js} +1 -1
  52. package/dist/components/{movelpGiPnJ5.js → movebkPadei-.js} +12 -12
  53. package/dist/components/{nextCMCmaDTi.js → nextClAf7xMw.js} +1 -1
  54. package/dist/components/{nextC0vHwAp5.js → nextCoqEdtnZ.js} +1 -1
  55. package/dist/components/{prevuRCPUsG0.js → prevB3w5Xo5F.js} +1 -1
  56. package/dist/components/{prevBzXgP68U.js → prevJkp-fUef.js} +1 -1
  57. package/dist/components/{processD1EQvj3k.js → processB578krhc.js} +1 -1
  58. package/dist/components/{processC0vYuwue.js → processBS-P5qTF.js} +1 -1
  59. package/dist/components/{processBpBLPw3-.js → process_4OLLR3I.js} +1 -1
  60. package/dist/components/{processFuA_wiCf.js → processdjntnqTL.js} +21 -21
  61. package/dist/components/{rotateBb7eL6EN.js → rotateBtBfaYlt.js} +1 -1
  62. package/dist/components/{rotatea8JeBygQ.js → rotateCGoD_DlO.js} +1 -1
  63. package/dist/components/{rotateEKM-FQDQ.js → rotateDlOeZK_Y.js} +9 -9
  64. package/dist/components/{rotateBtvqvLPE.js → rotateDzNJl50p.js} +1 -1
  65. package/dist/components/{settingCPNMWWj9.js → settingB87fba2e.js} +12 -12
  66. package/dist/components/{settingBOwtgZSJ.js → settingCBl44H7B.js} +1 -1
  67. package/dist/components/{settingBf-9h3FW.js → settingCE2-cMN2.js} +1 -1
  68. package/dist/components/{settingC-mv7W3Q.js → settingDKu9dgXl.js} +1 -1
  69. package/dist/components/{tailorCwnyDUsI.js → tailorIfjKVe1q.js} +1 -1
  70. package/dist/components/{tailorDGEwHYjf.js → tailorrql5Z5dC.js} +1 -1
  71. package/dist/components/useCommonCm7rhO60.js +1 -0
  72. package/dist/components/{useCommonCBKfFiqW.js → useCommonDGun_T6i.js} +10 -5
  73. package/dist/components/{zoomDc8tU8Zx.js → zoomDRHWcY_A.js} +1 -1
  74. package/dist/components/{zoomInBD6Lg2YX.js → zoomInBtOl0w7G.js} +1 -1
  75. package/dist/components/{zoomInCJguF0C1.js → zoomInDBLRbkSc.js} +1 -1
  76. package/dist/components/{zoomOutVGTP5fYm.js → zoomOutBii_59lh.js} +1 -1
  77. package/dist/components/{zoomOutDV9dPg1z.js → zoomOutD6o_vR_h.js} +1 -1
  78. package/dist/components/{zoomDRrzKbUt.js → zoomrgQT7EYg.js} +1 -1
  79. package/dist/index.cjs.js +1 -1
  80. package/dist/index.css +1 -1
  81. package/dist/index.es.js +3 -3
  82. package/package.json +6 -6
  83. package/types/components/KfbToolbox.vue.d.ts +4 -0
  84. package/types/components/KfbView/index.d.ts +16 -8
  85. package/types/components/KfbView/index.vue.d.ts +10 -5
  86. package/types/components/KfbView/useImageProcess.d.ts +1 -2
  87. package/types/components/KfbView/useLabel.d.ts +90 -3
  88. package/types/components/KfbView/useVoice.d.ts +8 -0
  89. package/types/components/ai/useAi.d.ts +6 -2
  90. package/types/components/toolbox/instances.d.ts +1 -10
  91. package/types/components/toolbox/process.vue.d.ts +2 -1
  92. package/types/index.d.ts +910 -0
  93. package/types/index.vue.d.ts +5 -0
  94. package/types/instances.d.ts +7 -3
  95. package/dist/components/annotateSkfOL59Z.js +0 -1
  96. package/dist/components/customDiZEAr4q.js +0 -1
  97. package/dist/components/dot_nBePo5G.js +0 -1
  98. package/dist/components/fullscreenBNpKNuBF.js +0 -1
  99. package/dist/components/indexBI9sOqLg.js +0 -30
  100. package/dist/components/useCommoney7551no.js +0 -1
@@ -0,0 +1,30 @@
1
+ "use strict";const r=require("vue"),Ee=require("element-plus");function xt(){const I=r.inject("i18n"),R=l=>l;return{locale:I==null?void 0:I.locale,t:(I==null?void 0:I.t)||R}}const Vr={install(I,R){I.provide("i18n",R==null?void 0:R.global)}},Pt=r.ref({annotate:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./annotateDrBDAiwJ.js")))),arrow:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowDPk76wAe.js")))),check:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./checkBWJi9_a6.js")))),dot:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dotxBw0mBnq.js")))),flip:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./flipDkEX3ZQH.js")))),info:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./infogZMbfIdS.js")))),microscope:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./microscopeDUGvuln-.js")))),move:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./moveD38V2VTD.js")))),next:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./nextClAf7xMw.js")))),prev:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./prevJkp-fUef.js")))),process:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./process_4OLLR3I.js")))),rotate:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rotateCGoD_DlO.js")))),fullscreen:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fullscreenDbpR9B7w.js")))),setting:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./settingCE2-cMN2.js")))),tailor:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./tailorrql5Z5dC.js")))),download:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./downloadDeswf8ql.js")))),config:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./config6VhhjpQh.js")))),arrowDown:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowDownBdM08C-k.js")))),arrowUp:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowUpBBOMqRwJ.js")))),arrowLeft:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowLeftCHTZ9DsM.js")))),arrowRight:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowRightCxryh7mK.js")))),zoomIn:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomInBtOl0w7G.js")))),zoomOut:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomOutD6o_vR_h.js")))),level:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./level9TdUqGzt.js")))),channel:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./channel0jNldMsg.js")))),delete:r.markRaw(r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./deleteDnKSpkZO.js"))))}),ht=r.defineComponent({__name:"KfbIcon",props:{name:{type:[String,Number],required:!0}},setup(I){return(R,l)=>(r.openBlock(),r.createBlock(r.unref(Ee.ElIcon),r.normalizeProps(r.guardReactiveProps(R.$attrs)),{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(Pt)[I.name])))]),_:1},16))}}),Fr={class:"hzzt-kfb-tool-config"},Ur={class:"hzzt-kfb-tool-config__title margin-b-2"},Wr={class:"hzzt-kfb-tool-config__block flex align-items-center"},Gr={class:"hzzt-kfb-tool-config__icon flex align-items-center justify-content-center"},$r={class:"margin-l-4 flex-1"},qr={class:"hzzt-kfb-tool-config__title"},Zr={class:"flex align-items-center"},Kr={class:"margin-t-2 margin-b-2",style:{width:"160px"}},Xr={class:"flex align-items-center"},Yr={class:"margin-t-2 margin-b-2",style:{width:"160px"}},Jr=r.defineComponent({name:"KfbToolConfig",__name:"KfbToolConfig",props:{menus:{default:()=>[]},menusModifiers:{},showText:{type:Boolean},showTextModifiers:{}},emits:["update:menus","update:showText"],setup(I){const R=r.useModel(I,"menus"),l=r.useModel(I,"showText"),{t:g}=xt(),y=r.computed(()=>R.value.filter(e=>e.name!=="line"&&e.name!=="config"&&e.name!=="zoom")),E={fullscreen:g("全屏"),next:g("上一张"),prev:g("上一张"),flip:g("镜像翻转"),setting:g("工具"),rotate:g("旋转"),dot:g("打点"),annotate:g("标注"),tailor:g("截图"),process:g("图像处理"),microscope:g("镜下"),move:g("快速移动"),info:g("信息"),download:g("下载")},k=r.inject("show-keyboard",r.ref(!1));function P(e){return e in E}function b(e){var t;return((t=e.props)==null?void 0:t.text)||(P(e.name)?E[e.name]:"")}return(e,t)=>(r.openBlock(),r.createElementBlock("div",Fr,[r.createElementVNode("h3",Ur,r.toDisplayString(r.unref(g)("显示管理")),1),r.createVNode(r.unref(Ee.ElRow),{gutter:10},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,i=>(r.openBlock(),r.createBlock(r.unref(Ee.ElCol),{key:i.name,span:8},{default:r.withCtx(()=>{var u,n;return[r.createElementVNode("div",Wr,[r.createElementVNode("div",Gr,[(u=i.props)!=null&&u.component?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((n=i.props)==null?void 0:n.component),{key:1,size:24})):(r.openBlock(),r.createBlock(ht,{key:0,size:24,name:i.name},null,8,["name"]))]),r.createElementVNode("p",$r,r.toDisplayString(b(i)),1),r.createVNode(r.unref(Ee.ElSwitch),{modelValue:i.show,"onUpdate:modelValue":o=>i.show=o,"active-text":"","inactive-text":""},null,8,["modelValue","onUpdate:modelValue"])])]}),_:2},1024))),128))]),_:1}),r.createElementVNode("div",null,[r.createElementVNode("h3",qr,r.toDisplayString(r.unref(g)("其他设置")),1),r.createElementVNode("div",Zr,[r.createElementVNode("p",Kr,r.toDisplayString(r.unref(g)("工具列表显示切换")),1),r.createVNode(r.unref(Ee.ElRadioGroup),{modelValue:l.value,"onUpdate:modelValue":t[0]||(t[0]=i=>l.value=i)},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElRadio),{value:!0},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(g)("显示工具名称")),1)]),_:1}),r.createVNode(r.unref(Ee.ElRadio),{value:!1},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(g)("隐藏工具名称")),1)]),_:1})]),_:1},8,["modelValue"])]),r.createElementVNode("div",Xr,[r.createElementVNode("p",Yr,r.toDisplayString(r.unref(g)("小键盘显示切换")),1),r.createVNode(r.unref(Ee.ElRadioGroup),{modelValue:r.unref(k),"onUpdate:modelValue":t[1]||(t[1]=i=>r.isRef(k)?k.value=i:null)},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElRadio),{value:!0},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(g)("显示小键盘")),1)]),_:1}),r.createVNode(r.unref(Ee.ElRadio),{value:!1},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(g)("隐藏小键盘")),1)]),_:1})]),_:1},8,["modelValue"])])])]))}}),Qr={class:"hzzt-kfb-toolbox"},es={class:"hzzt-kfb-toolbox__component"},kt=r.defineComponent({name:"KfbToolbox",__name:"KfbToolbox",props:{menu:{},process:{},microscope:{},showMenuText:{type:Boolean}},emits:["tool"],setup(I,{emit:R}){const l=I,g=R,{t:y}=xt(),E={prev:y("上一张"),next:y("下一张"),config:y("配置"),info:y("信息"),flip:y("镜像"),tailor:y("截图")},k=r.inject("kfbViewRef"),P=r.ref(!1),b=r.ref(l.showMenuText),e=r.ref(u(l.menu)),t={fullscreen:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fullscreenBIXfsULV.js"))),line:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./lineCzuS7Giu.js"))),setting:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./settingDKu9dgXl.js"))),rotate:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rotateDzNJl50p.js"))),dot:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dotBi2ivVYX.js"))),annotate:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./annotateCH4GAooA.js"))),process:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./processBS-P5qTF.js"))),microscope:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./microscopeDRt26GBO.js"))),move:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./moveCu3V3JqI.js"))),custom:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./customs0nLjsaE.js"))),zoom:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomDRHWcY_A.js"))),download:r.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./downloadDF2_6Y-f.js")))},i=r.computed(()=>e.value.filter(o=>o.show!==!1).map(o=>({component:t[o.name],props:o.props,slots:o.slots})));r.watch(()=>l.menu,o=>{e.value=u(o)});function u(o){return o.map(s=>{const c=typeof s=="string"?s:s.name;return E[c]?{name:"custom",show:typeof s=="string"?!0:s.show!==!1,props:{text:E[c],...typeof s=="string"?{}:s.props,name:c,component:r.h(ht,{name:c})}}:c==="process"?{name:c,props:typeof s=="string"?{process:l.process}:{process:l.process,...s.props},slots:typeof s=="string"?void 0:s.slots,show:typeof s=="string"?!0:s.show!==!1}:c==="microscope"?{name:c,props:typeof s=="string"?{process:l.process}:{microscope:l.microscope,...s.props},slots:typeof s=="string"?void 0:s.slots,show:typeof s=="string"?!0:s.show!==!1}:{name:c,props:typeof s=="string"?{}:s.props,slots:typeof s=="string"?void 0:s.slots,show:typeof s=="string"?!0:s.show!==!1}})}function n(o,s){const c={annotate:()=>k.value.startDraw(s),tailor:()=>k.value.shotScreen(s),process:()=>k.value.forceRedraw(s),microscope:()=>k.value.scopeChange(s),move:()=>k.value.fastMove(s),endDraw:()=>k.value.endDraw(),info:()=>k.value.info(),zoom:()=>k.value.zoomTo(s),flip:()=>k.value.toggleFlip(s),config:()=>P.value=!0,grid:()=>k.value.updateGrid(s),ruler:()=>k.value.updateGrid(s),graduation:()=>k.value.updateGraduation(s),navigator:()=>k.value.updateNavigator(s),tool:()=>{k.value.updateGrid({show:s}),k.value.updateGraduation({show:s}),k.value.updateGrid({ruler:s}),k.value.updateNavigator(s)}};c[o]?c[o]():g("tool",o,s)}return r.provide("show-text",b),(o,s)=>(r.openBlock(),r.createElementBlock("div",Qr,[r.renderSlot(o.$slots,"left"),r.createElementVNode("div",es,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(c,m)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.component),r.mergeProps({ref_for:!0},c.props,{key:m,onTool:n}),{default:r.withCtx(()=>[c.slots?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(c.slots,_=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(_)))),256)):r.createCommentVNode("",!0)]),_:2},1040))),128))]),r.renderSlot(o.$slots,"right"),r.createVNode(r.unref(Ee.ElDialog),{modelValue:P.value,"onUpdate:modelValue":s[2]||(s[2]=c=>P.value=c),width:"800px",title:r.unref(y)("阅片工具设置中心")},{default:r.withCtx(()=>[r.createVNode(Jr,{menus:e.value,"onUpdate:menus":s[0]||(s[0]=c=>e.value=c),showText:b.value,"onUpdate:showText":s[1]||(s[1]=c=>b.value=c)},null,8,["menus","showText"])]),_:1},8,["modelValue","title"])]))}}),ii="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20d='M556.45%20126.8H904.7c31.31%200%2056.26%2025.47%2057.3%2056.78v656.85c-0.68%2031.26-26.03%2056.35-57.3%2056.72H617.28l74.32-291.24-77.38-56.14%2032.3-27.32c8.28-6.66%2015.51-11.46%2025.7-11.46%209.96%200.24%2019.33%204.77%2025.7%2012.45h-0.06l198.87%20214.09-0.58-522.46c-0.75-13.7-12.21-24.35-25.93-24.08H542.45l14-64.19z%20m-118.47%200l-14.01%2064.24H152.41c-13.6%200-24.31%209.84-26.22%2023.44v522.63l242.33-292.28-13.08%2060.14%20204.6%20148.46-62.22%20243.77H118.15a56.398%2056.398%200%200%201-39.86-16.73A56.35%2056.35%200%200%201%2062%20840.43V183.57c0-31.25%2024.89-56.72%2056.14-56.72h319.83v-0.05z%20m203.67%20224.68c-0.86-34.98%2017.31-67.68%2047.47-85.42%2030.16-17.74%2067.56-17.74%2097.73%200%2030.16%2017.74%2048.33%2050.44%2047.47%2085.42%200%2053.22-43.15%2096.37-96.37%2096.37-53.22%200-96.37-43.14-96.37-96.37h0.07z%20m0%200'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",on={shape:"50%",width:.3,color:"#FA0404",borderWidth:5},oi={r:0,g:0,b:0,c:0,s:0,l:0,ga:1};var Fe=function(I){var R={};function l(g){if(R[g])return R[g].exports;var y=R[g]={i:g,l:!1,exports:{}};return I[g].call(y.exports,y,y.exports,l),y.l=!0,y.exports}return l.m=I,l.c=R,l.d=function(g,y,E){l.o(g,y)||Object.defineProperty(g,y,{enumerable:!0,get:E})},l.r=function(g){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},l.t=function(g,y){if(1&y&&(g=l(g)),8&y||4&y&&typeof g=="object"&&g&&g.__esModule)return g;var E=Object.create(null);if(l.r(E),Object.defineProperty(E,"default",{enumerable:!0,value:g}),2&y&&typeof g!="string")for(var k in g)l.d(E,k,(function(P){return g[P]}).bind(null,k));return E},l.n=function(g){var y=g&&g.__esModule?function(){return g.default}:function(){return g};return l.d(y,"a",y),y},l.o=function(g,y){return Object.prototype.hasOwnProperty.call(g,y)},l.p="",l(l.s=151)}([function(I,R,l){var g=l(17),y=l(47).f,E=l(25),k=l(39),P=l(72),b=l(88),e=l(117);I.exports=function(t,i){var u,n,o,s,c,m=t.target,_=t.global,S=t.stat;if(u=_?g:S?g[m]||P(m,{}):(g[m]||{}).prototype)for(n in i){if(s=i[n],o=t.noTargetGet?(c=y(u,n))&&c.value:u[n],!e(_?n:m+(S?".":"#")+n,t.forced)&&o!==void 0){if(typeof s==typeof o)continue;b(s,o)}(t.sham||o&&o.sham)&&E(s,"sham",!0),k(u,n,s,t)}}},function(I,R,l){var g=l(0),y=l(17),E=l(49),k=l(61),P=l(21),b=l(78),e=l(93),t=l(9),i=l(19),u=l(50),n=l(18),o=l(20),s=l(22),c=l(23),m=l(58),_=l(48),S=l(64),O=l(65),N=l(75),B=l(120),U=l(92),W=l(47),H=l(26),$=l(71),K=l(25),Q=l(39),re=l(73),Y=l(60),he=l(62),ve=l(74),Se=l(10),ke=l(94),Me=l(95),Ve=l(79),Ue=l(59),$e=l(36).forEach,Ae=Y("hidden"),qe="Symbol",Re=Se("toPrimitive"),ot=Ue.set,Qe=Ue.getterFor(qe),Ke=Object.prototype,Ze=y.Symbol,it=E("JSON","stringify"),ft=W.f,Ge=H.f,dt=B.f,vt=$.f,Xe=re("symbols"),rt=re("op-symbols"),Je=re("string-to-symbol-registry"),et=re("symbol-to-string-registry"),w=re("wks"),j=y.QObject,oe=!j||!j.prototype||!j.prototype.findChild,pe=P&&t(function(){return S(Ge({},"a",{get:function(){return Ge(this,"a",{value:7}).a}})).a!=7})?function(le,ye,me){var Te=ft(Ke,ye);Te&&delete Ke[ye],Ge(le,ye,me),Te&&le!==Ke&&Ge(Ke,ye,Te)}:Ge,ce=function(le,ye){var me=Xe[le]=S(Ze.prototype);return ot(me,{type:qe,tag:le,description:ye}),P||(me.description=ye),me},we=e?function(le){return typeof le=="symbol"}:function(le){return Object(le)instanceof Ze},ge=function(le,ye,me){le===Ke&&ge(rt,ye,me),o(le);var Te=m(ye,!0);return o(me),i(Xe,Te)?(me.enumerable?(i(le,Ae)&&le[Ae][Te]&&(le[Ae][Te]=!1),me=S(me,{enumerable:_(0,!1)})):(i(le,Ae)||Ge(le,Ae,_(1,{})),le[Ae][Te]=!0),pe(le,Te,me)):Ge(le,Te,me)},be=function(le,ye){o(le);var me=c(ye),Te=O(me).concat(Pe(me));return $e(Te,function(De){P&&!Oe.call(me,De)||ge(le,De,me[De])}),le},Oe=function(le){var ye=m(le,!0),me=vt.call(this,ye);return!(this===Ke&&i(Xe,ye)&&!i(rt,ye))&&(!(me||!i(this,ye)||!i(Xe,ye)||i(this,Ae)&&this[Ae][ye])||me)},de=function(le,ye){var me=c(le),Te=m(ye,!0);if(me!==Ke||!i(Xe,Te)||i(rt,Te)){var De=ft(me,Te);return!De||!i(Xe,Te)||i(me,Ae)&&me[Ae][Te]||(De.enumerable=!0),De}},se=function(le){var ye=dt(c(le)),me=[];return $e(ye,function(Te){i(Xe,Te)||i(he,Te)||me.push(Te)}),me},Pe=function(le){var ye=le===Ke,me=dt(ye?rt:c(le)),Te=[];return $e(me,function(De){!i(Xe,De)||ye&&!i(Ke,De)||Te.push(Xe[De])}),Te};b||(Ze=function(){if(this instanceof Ze)throw TypeError("Symbol is not a constructor");var le=arguments.length&&arguments[0]!==void 0?String(arguments[0]):void 0,ye=ve(le),me=function(Te){this===Ke&&me.call(rt,Te),i(this,Ae)&&i(this[Ae],ye)&&(this[Ae][ye]=!1),pe(this,ye,_(1,Te))};return P&&oe&&pe(Ke,ye,{configurable:!0,set:me}),ce(ye,le)},Q(Ze.prototype,"toString",function(){return Qe(this).tag}),Q(Ze,"withoutSetter",function(le){return ce(ve(le),le)}),$.f=Oe,H.f=ge,W.f=de,N.f=B.f=se,U.f=Pe,ke.f=function(le){return ce(Se(le),le)},P&&(Ge(Ze.prototype,"description",{configurable:!0,get:function(){return Qe(this).description}}),k||Q(Ke,"propertyIsEnumerable",Oe,{unsafe:!0}))),g({global:!0,wrap:!0,forced:!b,sham:!b},{Symbol:Ze}),$e(O(w),function(le){Me(le)}),g({target:qe,stat:!0,forced:!b},{for:function(le){var ye=String(le);if(i(Je,ye))return Je[ye];var me=Ze(ye);return Je[ye]=me,et[me]=ye,me},keyFor:function(le){if(!we(le))throw TypeError(le+" is not a symbol");if(i(et,le))return et[le]},useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),g({target:"Object",stat:!0,forced:!b,sham:!P},{create:function(le,ye){return ye===void 0?S(le):be(S(le),ye)},defineProperty:ge,defineProperties:be,getOwnPropertyDescriptor:de}),g({target:"Object",stat:!0,forced:!b},{getOwnPropertyNames:se,getOwnPropertySymbols:Pe}),g({target:"Object",stat:!0,forced:t(function(){U.f(1)})},{getOwnPropertySymbols:function(le){return U.f(s(le))}}),it&&g({target:"JSON",stat:!0,forced:!b||t(function(){var le=Ze();return it([le])!="[null]"||it({a:le})!="{}"||it(Object(le))!="{}"})},{stringify:function(le,ye,me){for(var Te,De=[le],tt=1;arguments.length>tt;)De.push(arguments[tt++]);if(Te=ye,(n(ye)||le!==void 0)&&!we(le))return u(ye)||(ye=function(D,C){if(typeof Te=="function"&&(C=Te.call(this,D,C)),!we(C))return C}),De[1]=ye,it.apply(null,De)}}),Ze.prototype[Re]||K(Ze.prototype,Re,Ze.prototype.valueOf),Ve(Ze,qe),he[Ae]=!0},function(I,R,l){var g=l(81),y=l(39),E=l(133);g||y(Object.prototype,"toString",E,{unsafe:!0})},function(I,R,l){var g=l(39),y=l(20),E=l(9),k=l(103),P="toString",b=RegExp.prototype,e=b.toString,t=E(function(){return e.call({source:"a",flags:"b"})!="/a/b"}),i=e.name!=P;(t||i)&&g(RegExp.prototype,P,function(){var u=y(this),n=String(u.source),o=u.flags;return"/"+n+"/"+String(o===void 0&&u instanceof RegExp&&!("flags"in b)?k.call(u):o)},{unsafe:!0})},function(I,R,l){var g=l(0),y=l(21),E=l(17),k=l(19),P=l(18),b=l(26).f,e=l(88),t=E.Symbol;if(y&&typeof t=="function"&&(!("description"in t.prototype)||t().description!==void 0)){var i={},u=function(){var m=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),_=this instanceof u?new t(m):m===void 0?t():t(m);return m===""&&(i[_]=!0),_};e(u,t);var n=u.prototype=t.prototype;n.constructor=u;var o=n.toString,s=String(t("test"))=="Symbol(test)",c=/^Symbol\((.*)\)[^)]+$/;b(n,"description",{configurable:!0,get:function(){var m=P(this)?this.valueOf():this,_=o.call(m);if(k(i,m))return"";var S=s?_.slice(7,-1):_.replace(c,"$1");return S===""?void 0:S}}),g({global:!0,forced:!0},{Symbol:u})}},function(I,R,l){var g=l(23),y=l(53),E=l(51),k=l(59),P=l(98),b="Array Iterator",e=k.set,t=k.getterFor(b);I.exports=P(Array,"Array",function(i,u){e(this,{type:b,target:g(i),index:0,kind:u})},function(){var i=t(this),u=i.target,n=i.kind,o=i.index++;return!u||o>=u.length?(i.target=void 0,{value:void 0,done:!0}):n=="keys"?{value:o,done:!1}:n=="values"?{value:u[o],done:!1}:{value:[o,u[o]],done:!1}},"values"),E.Arguments=E.Array,y("keys"),y("values"),y("entries")},function(I,R,l){l(95)("iterator")},function(I,R,l){var g=l(104).charAt,y=l(59),E=l(98),k="String Iterator",P=y.set,b=y.getterFor(k);E(String,"String",function(e){P(this,{type:k,string:String(e),index:0})},function(){var e,t=b(this),i=t.string,u=t.index;return u>=i.length?{value:void 0,done:!0}:(e=g(i,u),t.index+=e.length,{value:e,done:!1})})},function(I,R,l){var g=l(17),y=l(105),E=l(5),k=l(25),P=l(10),b=P("iterator"),e=P("toStringTag"),t=E.values;for(var i in y){var u=g[i],n=u&&u.prototype;if(n){if(n[b]!==t)try{k(n,b,t)}catch{n[b]=t}if(n[e]||k(n,e,i),y[i]){for(var o in E)if(n[o]!==E[o])try{k(n,o,E[o])}catch{n[o]=E[o]}}}}},function(I,R){I.exports=function(l){try{return!!l()}catch{return!0}}},function(I,R,l){var g=l(17),y=l(73),E=l(19),k=l(74),P=l(78),b=l(93),e=y("wks"),t=g.Symbol,i=b?t:t&&t.withoutSetter||k;I.exports=function(u){return E(e,u)||(P&&E(t,u)?e[u]=t[u]:e[u]=i("Symbol."+u)),e[u]}},function(I,R,l){var g=l(0),y=l(9),E=l(22),k=l(82),P=l(100);g({target:"Object",stat:!0,forced:y(function(){k(1)}),sham:!P},{getPrototypeOf:function(b){return k(E(b))}})},function(I,R,l){l(0)({target:"Object",stat:!0},{setPrototypeOf:l(101)})},function(I,R,l){var g=l(0),y=l(49),E=l(40),k=l(20),P=l(18),b=l(64),e=l(136),t=l(9),i=y("Reflect","construct"),u=t(function(){function s(){}return!(i(function(){},[],s)instanceof s)}),n=!t(function(){i(function(){})}),o=u||n;g({target:"Reflect",stat:!0,forced:o,sham:o},{construct:function(s,c){E(s),k(c);var m=arguments.length<3?s:E(arguments[2]);if(n&&!u)return i(s,c,m);if(s==m){switch(c.length){case 0:return new s;case 1:return new s(c[0]);case 2:return new s(c[0],c[1]);case 3:return new s(c[0],c[1],c[2]);case 4:return new s(c[0],c[1],c[2],c[3])}var _=[null];return _.push.apply(_,c),new(e.apply(s,_))}var S=m.prototype,O=b(P(S)?S:Object.prototype),N=Function.apply.call(s,O,c);return P(N)?N:O}})},function(I,R,l){var g,y,E,k,P;function b(e){return new b.Viewer(e)}(function(e){e.version={versionStr:"4.1.1",major:parseInt("4",10),minor:parseInt("1",10),revision:parseInt("1",10)};var t,i={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object AsyncFunction]":"function","[object Promise]":"promise","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},u=Object.prototype.toString,n=Object.prototype.hasOwnProperty;e.isFunction=function(o){return e.type(o)==="function"},e.isArray=Array.isArray||function(o){return e.type(o)==="array"},e.isWindow=function(o){return o&&typeof o=="object"&&"setInterval"in o},e.type=function(o){return o==null?String(o):i[u.call(o)]||"object"},e.isPlainObject=function(o){if(!o||b.type(o)!=="object"||o.nodeType||e.isWindow(o)||o.constructor&&!n.call(o,"constructor")&&!n.call(o.constructor.prototype,"isPrototypeOf"))return!1;var s;for(var c in o)s=c;return s===void 0||n.call(o,s)},e.isEmptyObject=function(o){for(var s in o)return!1;return!0},e.freezeObject=function(o){return Object.freeze?e.freezeObject=Object.freeze:e.freezeObject=function(s){return s},e.freezeObject(o)},e.supportsCanvas=(t=document.createElement("canvas"),!(!e.isFunction(t.getContext)||!t.getContext("2d"))),e.isCanvasTainted=function(o){var s=!1;try{o.getContext("2d").getImageData(0,0,1,1)}catch{s=!0}return s},e.supportsAddEventListener=!(!document.documentElement.addEventListener||!document.addEventListener),e.supportsRemoveEventListener=!(!document.documentElement.removeEventListener||!document.removeEventListener),e.supportsEventListenerOptions=function(){var o=0;if(e.supportsAddEventListener)try{var s={get capture(){return o++,!1},get once(){return o++,!1},get passive(){return o++,!1}};window.addEventListener("test",null,s),window.removeEventListener("test",null,s)}catch{o=0}return o>=3}(),e.getCurrentPixelDensityRatio=function(){if(e.supportsCanvas){var o=document.createElement("canvas").getContext("2d"),s=window.devicePixelRatio||1,c=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;return Math.max(s,1)/c}return 1},e.pixelDensityRatio=e.getCurrentPixelDensityRatio()})(b),function(e){e.extend=function(){var o,s,c,m,_,S,O=arguments[0]||{},N=arguments.length,B=!1,U=1;for(typeof O=="boolean"&&(B=O,O=arguments[1]||{},U=2),typeof O=="object"||b.isFunction(O)||(O={}),N===U&&(O=this,--U);U<N;U++)if((o=arguments[U])!==null||o!==void 0)for(s in o){var W=Object.getOwnPropertyDescriptor(o,s);W!==void 0?W.get||W.set?Object.defineProperty(O,s,W):O!==(m=W.value)&&(B&&m&&(b.isPlainObject(m)||(_=b.isArray(m)))?(c=O[s],_?(_=!1,S=c&&b.isArray(c)?c:[]):S=c&&b.isPlainObject(c)?c:{},O[s]=b.extend(B,S,m)):m!==void 0&&(O[s]=m)):e.console.warn('Could not copy inherited property "'+s+'".')}return O},e.extend(e,{DEFAULT_SETTINGS:{xmlPath:null,tileSources:null,tileHost:null,initialPage:0,crossOriginPolicy:!1,ajaxWithCredentials:!1,loadTilesWithAjax:!1,ajaxHeaders:{},splitHashDataForPost:!1,panHorizontal:!0,panVertical:!0,constrainDuringPan:!1,wrapHorizontal:!1,wrapVertical:!1,visibilityRatio:.5,minPixelRatio:.5,defaultZoomLevel:0,minZoomLevel:null,maxZoomLevel:null,homeFillsViewer:!1,clickTimeThreshold:300,clickDistThreshold:5,dblClickTimeThreshold:300,dblClickDistThreshold:20,springStiffness:6.5,animationTime:1.2,gestureSettingsMouse:{dragToPan:!0,scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsTouch:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!0,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsPen:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsUnknown:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!1,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},zoomPerClick:2,zoomPerScroll:1.2,zoomPerDblClickDrag:1.2,zoomPerSecond:1,blendTime:0,alwaysBlend:!1,autoHideControls:!0,immediateRender:!1,minZoomImageRatio:.9,maxZoomPixelRatio:1.1,smoothTileEdgesMinZoom:1.1,iOSDevice:function(){if(typeof navigator!="object")return!1;var o=navigator.userAgent;return typeof o=="string"&&(o.indexOf("iPhone")!==-1||o.indexOf("iPad")!==-1||o.indexOf("iPod")!==-1)}(),pixelsPerWheelLine:40,pixelsPerArrowPress:40,autoResize:!0,preserveImageSizeOnResize:!1,minScrollDeltaTime:50,rotationIncrement:90,showSequenceControl:!0,sequenceControlAnchor:null,preserveViewport:!1,preserveOverlays:!1,navPrevNextWrap:!1,showNavigationControl:!0,navigationControlAnchor:null,showZoomControl:!0,showHomeControl:!0,showFullPageControl:!0,showRotationControl:!1,showFlipControl:!1,controlsFadeDelay:2e3,controlsFadeLength:1500,mouseNavEnabled:!0,showNavigator:!1,navigatorElement:null,navigatorId:null,navigatorPosition:null,navigatorSizeRatio:.2,navigatorMaintainSizeRatio:!1,navigatorTop:null,navigatorLeft:null,navigatorHeight:null,navigatorWidth:null,navigatorAutoResize:!0,navigatorAutoFade:!0,navigatorRotate:!0,navigatorBackground:"#000",navigatorOpacity:.8,navigatorBorderColor:"#555",navigatorDisplayRegionColor:"#900",degrees:0,flipped:!1,opacity:1,preload:!1,compositeOperation:null,imageSmoothingEnabled:!0,placeholderFillStyle:null,subPixelRoundingForTransparency:null,showReferenceStrip:!1,referenceStripScroll:"horizontal",referenceStripElement:null,referenceStripHeight:null,referenceStripWidth:null,referenceStripPosition:"BOTTOM_LEFT",referenceStripSizeRatio:.2,collectionRows:3,collectionColumns:0,collectionLayout:"horizontal",collectionMode:!1,collectionTileSize:800,collectionTileMargin:80,imageLoaderLimit:0,maxImageCacheCount:200,timeout:3e4,useCanvas:!0,tileRetryMax:0,tileRetryDelay:2500,prefixUrl:"/images/",navImages:{zoomIn:{REST:"zoomin_rest.png",GROUP:"zoomin_grouphover.png",HOVER:"zoomin_hover.png",DOWN:"zoomin_pressed.png"},zoomOut:{REST:"zoomout_rest.png",GROUP:"zoomout_grouphover.png",HOVER:"zoomout_hover.png",DOWN:"zoomout_pressed.png"},home:{REST:"home_rest.png",GROUP:"home_grouphover.png",HOVER:"home_hover.png",DOWN:"home_pressed.png"},fullpage:{REST:"fullpage_rest.png",GROUP:"fullpage_grouphover.png",HOVER:"fullpage_hover.png",DOWN:"fullpage_pressed.png"},rotateleft:{REST:"rotateleft_rest.png",GROUP:"rotateleft_grouphover.png",HOVER:"rotateleft_hover.png",DOWN:"rotateleft_pressed.png"},rotateright:{REST:"rotateright_rest.png",GROUP:"rotateright_grouphover.png",HOVER:"rotateright_hover.png",DOWN:"rotateright_pressed.png"},flip:{REST:"flip_rest.png",GROUP:"flip_grouphover.png",HOVER:"flip_hover.png",DOWN:"flip_pressed.png"},previous:{REST:"previous_rest.png",GROUP:"previous_grouphover.png",HOVER:"previous_hover.png",DOWN:"previous_pressed.png"},next:{REST:"next_rest.png",GROUP:"next_grouphover.png",HOVER:"next_hover.png",DOWN:"next_pressed.png"}},debugMode:!1,debugGridColor:["#437AB2","#1B9E77","#D95F02","#7570B3","#E7298A","#66A61E","#E6AB02","#A6761D","#666666"],silenceMultiImageWarnings:!1},SIGNAL:"----seadragon----",delegate:function(o,s){return function(){var c=arguments;return c===void 0&&(c=[]),s.apply(o,c)}},BROWSERS:{UNKNOWN:0,IE:1,FIREFOX:2,SAFARI:3,CHROME:4,OPERA:5,EDGE:6,CHROMEEDGE:7},SUBPIXEL_ROUNDING_OCCURRENCES:{NEVER:0,ONLY_AT_REST:1,ALWAYS:2},_viewers:new Map,getViewer:function(o){return e._viewers.get(this.getElement(o))},getElement:function(o){return typeof o=="string"&&(o=document.getElementById(o)),o},getElementPosition:function(o){var s,c,m=new e.Point;for(c=n(o=e.getElement(o),s=e.getElementStyle(o).position==="fixed");c;)m.x+=o.offsetLeft,m.y+=o.offsetTop,s&&(m=m.plus(e.getPageScroll())),c=n(o=c,s=e.getElementStyle(o).position==="fixed");return m},getElementOffset:function(o){var s,c,m=(o=e.getElement(o))&&o.ownerDocument,_={top:0,left:0};return m?(s=m.documentElement,o.getBoundingClientRect!==void 0&&(_=o.getBoundingClientRect()),c=m===m.window?m:m.nodeType===9&&(m.defaultView||m.parentWindow),new e.Point(_.left+(c.pageXOffset||s.scrollLeft)-(s.clientLeft||0),_.top+(c.pageYOffset||s.scrollTop)-(s.clientTop||0))):new e.Point},getElementSize:function(o){return o=e.getElement(o),new e.Point(o.clientWidth,o.clientHeight)},getElementStyle:document.documentElement.currentStyle?function(o){return(o=e.getElement(o)).currentStyle}:function(o){return o=e.getElement(o),window.getComputedStyle(o,"")},getCssPropertyWithVendorPrefix:function(o){var s={};return e.getCssPropertyWithVendorPrefix=function(c){if(s[c]!==void 0)return s[c];var m=document.createElement("div").style,_=null;if(m[c]!==void 0)_=c;else for(var S=["Webkit","Moz","MS","O","webkit","moz","ms","o"],O=e.capitalizeFirstLetter(c),N=0;N<S.length;N++){var B=S[N]+O;if(m[B]!==void 0){_=B;break}}return s[c]=_,_},e.getCssPropertyWithVendorPrefix(o)},capitalizeFirstLetter:function(o){return o.charAt(0).toUpperCase()+o.slice(1)},positiveModulo:function(o,s){var c=o%s;return c<0&&(c+=s),c},pointInElement:function(o,s){o=e.getElement(o);var c=e.getElementOffset(o),m=e.getElementSize(o);return s.x>=c.x&&s.x<c.x+m.x&&s.y<c.y+m.y&&s.y>=c.y},getMousePosition:function(o){if(typeof o.pageX=="number")e.getMousePosition=function(s){var c=new e.Point;return c.x=s.pageX,c.y=s.pageY,c};else{if(typeof o.clientX!="number")throw new Error("Unknown event mouse position, no known technique.");e.getMousePosition=function(s){var c=new e.Point;return c.x=s.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c.y=s.clientY+document.body.scrollTop+document.documentElement.scrollTop,c}}return e.getMousePosition(o)},getPageScroll:function(){var o=document.documentElement||{},s=document.body||{};if(typeof window.pageXOffset=="number")e.getPageScroll=function(){return new e.Point(window.pageXOffset,window.pageYOffset)};else if(s.scrollLeft||s.scrollTop)e.getPageScroll=function(){return new e.Point(document.body.scrollLeft,document.body.scrollTop)};else{if(!o.scrollLeft&&!o.scrollTop)return new e.Point(0,0);e.getPageScroll=function(){return new e.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)}}return e.getPageScroll()},setPageScroll:function(o){if(window.scrollTo!==void 0)e.setPageScroll=function(m){window.scrollTo(m.x,m.y)};else{var s=e.getPageScroll();if(s.x===o.x&&s.y===o.y)return;document.body.scrollLeft=o.x,document.body.scrollTop=o.y;var c=e.getPageScroll();if(c.x!==s.x&&c.y!==s.y)return void(e.setPageScroll=function(m){document.body.scrollLeft=m.x,document.body.scrollTop=m.y});if(document.documentElement.scrollLeft=o.x,document.documentElement.scrollTop=o.y,(c=e.getPageScroll()).x!==s.x&&c.y!==s.y)return void(e.setPageScroll=function(m){document.documentElement.scrollLeft=m.x,document.documentElement.scrollTop=m.y});e.setPageScroll=function(m){}}e.setPageScroll(o)},getWindowSize:function(){var o=document.documentElement||{},s=document.body||{};if(typeof window.innerWidth=="number")e.getWindowSize=function(){return new e.Point(window.innerWidth,window.innerHeight)};else if(o.clientWidth||o.clientHeight)e.getWindowSize=function(){return new e.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else{if(!s.clientWidth&&!s.clientHeight)throw new Error("Unknown window size, no known technique.");e.getWindowSize=function(){return new e.Point(document.body.clientWidth,document.body.clientHeight)}}return e.getWindowSize()},makeCenteredNode:function(o){o=e.getElement(o);var s=[e.makeNeutralElement("div"),e.makeNeutralElement("div"),e.makeNeutralElement("div")];return e.extend(s[0].style,{display:"table",height:"100%",width:"100%"}),e.extend(s[1].style,{display:"table-row"}),e.extend(s[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),s[0].appendChild(s[1]),s[1].appendChild(s[2]),s[2].appendChild(o),s[0]},makeNeutralElement:function(o){var s=document.createElement(o),c=s.style;return c.background="transparent none",c.border="none",c.margin="0px",c.padding="0px",c.position="static",s},now:function(){return Date.now?e.now=Date.now:e.now=function(){return new Date().getTime()},e.now()},makeTransparentImage:function(o){var s=e.makeNeutralElement("img");return s.src=o,s},setElementOpacity:function(o,s,c){var m;o=e.getElement(o),c&&!e.Browser.alpha&&(s=Math.round(s)),e.Browser.opacity?o.style.opacity=s<1?s:"":s<1?(m="alpha(opacity="+Math.round(100*s)+")",o.style.filter=m):o.style.filter=""},setElementTouchActionNone:function(o){(o=e.getElement(o)).style.touchAction!==void 0?o.style.touchAction="none":o.style.msTouchAction!==void 0&&(o.style.msTouchAction="none")},setElementPointerEvents:function(o,s){(o=e.getElement(o)).style!==void 0&&o.style.pointerEvents!==void 0&&(o.style.pointerEvents=s)},setElementPointerEventsNone:function(o){e.setElementPointerEvents(o,"none")},addClass:function(o,s){(o=e.getElement(o)).className?(" "+o.className+" ").indexOf(" "+s+" ")===-1&&(o.className+=" "+s):o.className=s},indexOf:function(o,s,c){return Array.prototype.indexOf?this.indexOf=function(m,_,S){return m.indexOf(_,S)}:this.indexOf=function(m,_,S){var O,N,B=S||0;if(!m)throw new TypeError;if((N=m.length)===0||B>=N)return-1;for(B<0&&(B=N-Math.abs(B)),O=B;O<N;O++)if(m[O]===_)return O;return-1},this.indexOf(o,s,c)},removeClass:function(o,s){var c,m,_=[];for(c=(o=e.getElement(o)).className.split(/\s+/),m=0;m<c.length;m++)c[m]&&c[m]!==s&&_.push(c[m]);o.className=_.join(" ")},normalizeEventListenerOptions:function(o){return o!==void 0?typeof o=="boolean"?e.supportsEventListenerOptions?{capture:o}:o:e.supportsEventListenerOptions?o:o.capture!==void 0&&o.capture:!!e.supportsEventListenerOptions&&{capture:!1}},addEvent:function(){if(e.supportsAddEventListener)return function(o,s,c,m){m=e.normalizeEventListenerOptions(m),(o=e.getElement(o)).addEventListener(s,c,m)};if(document.documentElement.attachEvent&&document.attachEvent)return function(o,s,c){(o=e.getElement(o)).attachEvent("on"+s,c)};throw new Error("No known event model.")}(),removeEvent:function(){if(e.supportsRemoveEventListener)return function(o,s,c,m){m=e.normalizeEventListenerOptions(m),(o=e.getElement(o)).removeEventListener(s,c,m)};if(document.documentElement.detachEvent&&document.detachEvent)return function(o,s,c){(o=e.getElement(o)).detachEvent("on"+s,c)};throw new Error("No known event model.")}(),cancelEvent:function(o){o.preventDefault()},eventIsCanceled:function(o){return o.defaultPrevented},stopEvent:function(o){o.stopPropagation()},createCallback:function(o,s){var c,m=[];for(c=2;c<arguments.length;c++)m.push(arguments[c]);return function(){var _,S=m.concat([]);for(_=0;_<arguments.length;_++)S.push(arguments[_]);return s.apply(o,S)}},getUrlParameter:function(o){var s=u[o];return s||null},getUrlProtocol:function(o){var s=o.match(/^([a-z]+:)\/\//i);return s===null?window.location.protocol:s[1].toLowerCase()},createAjaxRequest:function(o){var s;try{s=!!new ActiveXObject("Microsoft.XMLHTTP")}catch{s=!1}if(s)window.XMLHttpRequest?e.createAjaxRequest=function(c){return c?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest}:e.createAjaxRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")};else{if(!window.XMLHttpRequest)throw new Error("Browser doesn't support XMLHttpRequest.");e.createAjaxRequest=function(){return new XMLHttpRequest}}return e.createAjaxRequest(o)},makeAjaxRequest:function(o,s,c){var m,_,S,O;e.isPlainObject(o)&&(s=o.success,c=o.error,m=o.withCredentials,_=o.headers,S=o.responseType||null,O=o.postData||null,o=o.url);var N=e.getUrlProtocol(o),B=e.createAjaxRequest(N==="file:");if(!e.isFunction(s))throw new Error("makeAjaxRequest requires a success callback");B.onreadystatechange=function(){B.readyState===4&&(B.onreadystatechange=function(){},B.status>=200&&B.status<300||B.status===0&&N!=="http:"&&N!=="https:"?s(B):e.isFunction(c)?c(B):e.console.error("AJAX request returned %d: %s",B.status,o))};var U=O?"POST":"GET";try{if(B.open(U,o,!0),S&&(B.responseType=S),_)for(var W in _)Object.prototype.hasOwnProperty.call(_,W)&&_[W]&&B.setRequestHeader(W,_[W]);m&&(B.withCredentials=!0),B.send(O)}catch(H){e.console.error("%s while making AJAX request: %s",H.name,H.message),B.onreadystatechange=function(){},e.isFunction(c)&&c(B,H)}return B},jsonp:function(o){var s,c=o.url,m=document.head||document.getElementsByTagName("head")[0]||document.documentElement,_=o.callbackName||"openseadragon"+e.now(),S=window[_],O="$1"+_+"$2",N=o.param||"callback",B=o.callback;c=c.replace(/(=)\?(&|$)|\?\?/i,O),c+=(/\?/.test(c)?"&":"?")+N+"="+_,window[_]=function(U){if(S)window[_]=S;else try{delete window[_]}catch{}B&&e.isFunction(B)&&B(U)},s=document.createElement("script"),o.async===void 0&&o.async===!1||(s.async="async"),o.scriptCharset&&(s.charset=o.scriptCharset),s.src=c,s.onload=s.onreadystatechange=function(U,W){(W||!s.readyState||/loaded|complete/.test(s.readyState))&&(s.onload=s.onreadystatechange=null,m&&s.parentNode&&m.removeChild(s),s=void 0)},m.insertBefore(s,m.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(o){if(window.DOMParser)e.parseXml=function(s){return new DOMParser().parseFromString(s,"text/xml")};else{if(!window.ActiveXObject)throw new Error("Browser doesn't support XML DOM.");e.parseXml=function(s){var c=null;return(c=new ActiveXObject("Microsoft.XMLDOM")).async=!1,c.loadXML(s),c}}return e.parseXml(o)},parseJSON:function(o){return e.parseJSON=window.JSON.parse,e.parseJSON(o)},imageFormatSupported:function(o){return!!i[(o=o||"").toLowerCase()]},setImageFormatsSupported:function(o){e.extend(i,o)}});var t=function(o){};e.console=window.console||{log:t,debug:t,info:t,warn:t,error:t,assert:t},e.Browser={vendor:e.BROWSERS.UNKNOWN,version:0,alpha:!0};var i={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},u={};function n(o,s){return s&&o!==document.body?document.body:o.offsetParent}(function(){var o=navigator.appVersion,s=navigator.userAgent;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(s.substring(s.indexOf("MSIE")+5,s.indexOf(";",s.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(s.indexOf("Edge")>=0?(e.Browser.vendor=e.BROWSERS.EDGE,e.Browser.version=parseFloat(s.substring(s.indexOf("Edge")+5))):s.indexOf("Edg")>=0?(e.Browser.vendor=e.BROWSERS.CHROMEEDGE,e.Browser.version=parseFloat(s.substring(s.indexOf("Edg")+4))):s.indexOf("Firefox")>=0?(e.Browser.vendor=e.BROWSERS.FIREFOX,e.Browser.version=parseFloat(s.substring(s.indexOf("Firefox")+8))):s.indexOf("Safari")>=0?(e.Browser.vendor=s.indexOf("Chrome")>=0?e.BROWSERS.CHROME:e.BROWSERS.SAFARI,e.Browser.version=parseFloat(s.substring(s.substring(0,s.indexOf("Safari")).lastIndexOf("/")+1,s.indexOf("Safari")))):new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(s)!==null&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(RegExp.$1)));break;case"Opera":e.Browser.vendor=e.BROWSERS.OPERA,e.Browser.version=parseFloat(o)}var c,m,_,S=window.location.search.substring(1).split("&");for(_=0;_<S.length;_++)if((m=(c=S[_]).indexOf("="))>0){var O=c.substring(0,m),N=c.substring(m+1);try{u[O]=decodeURIComponent(N)}catch{e.console.error("Ignoring malformed URL parameter: %s=%s",O,N)}}e.Browser.alpha=!(e.Browser.vendor===e.BROWSERS.CHROME&&e.Browser.version<2),e.Browser.opacity=!0,e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version<11&&e.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(o){var s=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||o.msRequestAnimationFrame,c=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||o.msCancelAnimationFrame;if(s&&c)e.requestAnimationFrame=function(){return s.apply(o,arguments)},e.cancelAnimationFrame=function(){return c.apply(o,arguments)};else{var m,_=[],S=[],O=0;e.requestAnimationFrame=function(N){return _.push([++O,N]),m||(m=setInterval(function(){if(_.length){var B=e.now(),U=S;for(S=_,_=U;S.length;)S.shift()[1](B)}else clearInterval(m),m=void 0},20)),O},e.cancelAnimationFrame=function(N){var B,U;for(B=0,U=_.length;B<U;B+=1)if(_[B][0]===N)return void _.splice(B,1);for(B=0,U=S.length;B<U;B+=1)if(S[B][0]===N)return void S.splice(B,1)}}}(window)}(b),y=[],(E=typeof(g=function(){return b})=="function"?g.apply(R,y):g)===void 0||(I.exports=E),k=b,P={supportsFullScreen:!1,isFullScreen:function(){return!1},getFullScreenElement:function(){return null},requestFullScreen:function(){},exitFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",fullScreenErrorEventName:""},document.exitFullscreen?(P.supportsFullScreen=!0,P.getFullScreenElement=function(){return document.fullscreenElement},P.requestFullScreen=function(e){return e.requestFullscreen()},P.exitFullScreen=function(){document.exitFullscreen()},P.fullScreenEventName="fullscreenchange",P.fullScreenErrorEventName="fullscreenerror"):document.msExitFullscreen?(P.supportsFullScreen=!0,P.getFullScreenElement=function(){return document.msFullscreenElement},P.requestFullScreen=function(e){return e.msRequestFullscreen()},P.exitFullScreen=function(){document.msExitFullscreen()},P.fullScreenEventName="MSFullscreenChange",P.fullScreenErrorEventName="MSFullscreenError"):document.webkitExitFullscreen?(P.supportsFullScreen=!0,P.getFullScreenElement=function(){return document.webkitFullscreenElement},P.requestFullScreen=function(e){return e.webkitRequestFullscreen()},P.exitFullScreen=function(){document.webkitExitFullscreen()},P.fullScreenEventName="webkitfullscreenchange",P.fullScreenErrorEventName="webkitfullscreenerror"):document.webkitCancelFullScreen?(P.supportsFullScreen=!0,P.getFullScreenElement=function(){return document.webkitCurrentFullScreenElement},P.requestFullScreen=function(e){return e.webkitRequestFullScreen()},P.exitFullScreen=function(){document.webkitCancelFullScreen()},P.fullScreenEventName="webkitfullscreenchange",P.fullScreenErrorEventName="webkitfullscreenerror"):document.mozCancelFullScreen&&(P.supportsFullScreen=!0,P.getFullScreenElement=function(){return document.mozFullScreenElement},P.requestFullScreen=function(e){return e.mozRequestFullScreen()},P.exitFullScreen=function(){document.mozCancelFullScreen()},P.fullScreenEventName="mozfullscreenchange",P.fullScreenErrorEventName="mozfullscreenerror"),P.isFullScreen=function(){return P.getFullScreenElement()!==null},P.cancelFullScreen=function(){k.console.error("cancelFullScreen is deprecated. Use exitFullScreen instead."),P.exitFullScreen()},k.extend(k,P),function(e){e.EventSource=function(){this.events={}},e.EventSource.prototype={addOnceHandler:function(t,i,u,n,o){var s=this;n=n||1;var c=0,m=function(_){return++c===n&&s.removeHandler(t,m),i(_)};this.addHandler(t,m,u,o)},addHandler:function(t,i,u,n){var o=this.events[t];if(o||(this.events[t]=o=[]),i&&e.isFunction(i)){var s=o.length,c={handler:i,userData:u||null,priority:n||0};for(o[s]=c;s>0&&o[s-1].priority<o[s].priority;)o[s]=o[s-1],o[s-1]=c,s--}},removeHandler:function(t,i){var u,n=this.events[t],o=[];if(n&&e.isArray(n)){for(u=0;u<n.length;u++)n[u].handler!==i&&o.push(n[u]);this.events[t]=o}},numberOfHandlers:function(t){var i=this.events[t];return i?i.length:0},removeAllHandlers:function(t){if(t)this.events[t]=[];else for(var i in this.events)this.events[i]=[]},getHandler:function(t){var i=this.events[t];return i&&i.length?(i=i.length===1?[i[0]]:Array.apply(null,i),function(u,n){var o,s=i.length;for(o=0;o<s;o++)i[o]&&(n.eventSource=u,n.userData=i[o].userData,i[o].handler(n))}):null},raiseEvent:function(t,i){var u=this.getHandler(t);if(u)return u(this,i||{})}}}(b),function(e){var t=[],i={};e.MouseTracker=function(D){t.push(this);var C=arguments;e.isPlainObject(D)||(D={element:C[0],clickTimeThreshold:C[1],clickDistThreshold:C[2]}),this.hash=Math.random(),this.element=e.getElement(D.element),this.clickTimeThreshold=D.clickTimeThreshold||e.DEFAULT_SETTINGS.clickTimeThreshold,this.clickDistThreshold=D.clickDistThreshold||e.DEFAULT_SETTINGS.clickDistThreshold,this.dblClickTimeThreshold=D.dblClickTimeThreshold||e.DEFAULT_SETTINGS.dblClickTimeThreshold,this.dblClickDistThreshold=D.dblClickDistThreshold||e.DEFAULT_SETTINGS.dblClickDistThreshold,this.userData=D.userData||null,this.stopDelay=D.stopDelay||50,this.preProcessEventHandler=D.preProcessEventHandler||null,this.contextMenuHandler=D.contextMenuHandler||null,this.enterHandler=D.enterHandler||null,this.leaveHandler=D.leaveHandler||null,this.exitHandler=D.exitHandler||null,this.overHandler=D.overHandler||null,this.outHandler=D.outHandler||null,this.pressHandler=D.pressHandler||null,this.nonPrimaryPressHandler=D.nonPrimaryPressHandler||null,this.releaseHandler=D.releaseHandler||null,this.nonPrimaryReleaseHandler=D.nonPrimaryReleaseHandler||null,this.moveHandler=D.moveHandler||null,this.scrollHandler=D.scrollHandler||null,this.clickHandler=D.clickHandler||null,this.dblClickHandler=D.dblClickHandler||null,this.dragHandler=D.dragHandler||null,this.dragEndHandler=D.dragEndHandler||null,this.pinchHandler=D.pinchHandler||null,this.stopHandler=D.stopHandler||null,this.keyDownHandler=D.keyDownHandler||null,this.keyUpHandler=D.keyUpHandler||null,this.keyHandler=D.keyHandler||null,this.focusHandler=D.focusHandler||null,this.blurHandler=D.blurHandler||null;var A=this;i[this.hash]={click:function(M){he(A,M)},dblclick:function(M){ve(A,M)},keydown:function(M){Se(A,M)},keyup:function(M){ke(A,M)},keypress:function(M){Me(A,M)},focus:function(M){Ve(A,M)},blur:function(M){Ue(A,M)},contextmenu:function(M){$e(A,M)},wheel:function(M){Ae(A,M)},mousewheel:function(M){qe(A,M)},DOMMouseScroll:function(M){qe(A,M)},MozMousePixelScroll:function(M){qe(A,M)},losecapture:function(M){ot(A,M)},mouseenter:function(M){Xe(A,M)},mouseleave:function(M){rt(A,M)},mouseover:function(M){Je(A,M)},mouseout:function(M){et(A,M)},mousedown:function(M){w(A,M)},mouseup:function(M){j(A,M)},mousemove:function(M){ce(A,M)},touchstart:function(M){Qe(A,M)},touchend:function(M){Ke(A,M)},touchmove:function(M){Ze(A,M)},touchcancel:function(M){it(A,M)},gesturestart:function(M){ft(A,M)},gesturechange:function(M){Ge(A,M)},gotpointercapture:function(M){dt(A,M)},lostpointercapture:function(M){vt(A,M)},pointerenter:function(M){Xe(A,M)},pointerleave:function(M){rt(A,M)},pointerover:function(M){Je(A,M)},pointerout:function(M){et(A,M)},pointerdown:function(M){w(A,M)},pointerup:function(M){j(A,M)},pointermove:function(M){ce(A,M)},pointercancel:function(M){be(A,M)},pointerupcaptured:function(M){oe(A,M)},pointermovecaptured:function(M){we(A,M)},tracking:!1,activePointersLists:[],lastClickPos:null,dblClickTimeOut:null,pinchGPoints:[],lastPinchDist:0,currentPinchDist:0,lastPinchCenter:null,currentPinchCenter:null,sentDragEvent:!1},this.hasGestureHandlers=!!(this.pressHandler||this.nonPrimaryPressHandler||this.releaseHandler||this.nonPrimaryReleaseHandler||this.clickHandler||this.dblClickHandler||this.dragHandler||this.dragEndHandler||this.pinchHandler),this.hasScrollHandler=!!this.scrollHandler,e.MouseTracker.havePointerEvents&&e.setElementPointerEvents(this.element,"auto"),this.exitHandler&&e.console.error("MouseTracker.exitHandler is deprecated. Use MouseTracker.leaveHandler instead."),D.startDisabled||this.setTracking(!0)},e.MouseTracker.prototype={destroy:function(){var D;for(N(this),this.element=null,D=0;D<t.length;D++)if(t[D]===this){t.splice(D,1);break}i[this.hash]=null,delete i[this.hash]},isTracking:function(){return i[this.hash].tracking},setTracking:function(D){return D?function(C){var A,M,ue=i[C.hash];if(!ue.tracking){for(M=0;M<e.MouseTracker.subscribeEvents.length;M++)A=e.MouseTracker.subscribeEvents[M],e.addEvent(C.element,A,ue[A],A===e.MouseTracker.wheelEventName&&{passive:!1,capture:!1});O(C),ue.tracking=!0}}(this):N(this),this},getActivePointersListByType:function(D){var C,A,M=i[this.hash],ue=M.activePointersLists.length;for(C=0;C<ue;C++)if(M.activePointersLists[C].type===D)return M.activePointersLists[C];return A=new e.MouseTracker.GesturePointList(D),M.activePointersLists.push(A),A},getActivePointerCount:function(){var D,C=i[this.hash],A=C.activePointersLists.length,M=0;for(D=0;D<A;D++)M+=C.activePointersLists[D].getLength();return M},preProcessEventHandler:function(){},contextMenuHandler:function(){},enterHandler:function(){},leaveHandler:function(){},exitHandler:function(){},overHandler:function(){},outHandler:function(){},pressHandler:function(){},nonPrimaryPressHandler:function(){},releaseHandler:function(){},nonPrimaryReleaseHandler:function(){},moveHandler:function(){},scrollHandler:function(){},clickHandler:function(){},dblClickHandler:function(){},dragHandler:function(){},dragEndHandler:function(){},pinchHandler:function(){},stopHandler:function(){},keyDownHandler:function(){},keyUpHandler:function(){},keyHandler:function(){},focusHandler:function(){},blurHandler:function(){}};var u,n,o,s,c,m,_=function(){try{return window.self!==window.top}catch{return!0}}();function S(D){try{return D.addEventListener&&D.removeEventListener}catch{return!1}}function O(D){var C,A,M,ue,Ce,ae=i[D.hash],Ie=ae.activePointersLists.length;for(C=0;C<Ie;C++)if((M=ae.activePointersLists[C]).getLength()>0){for(Ce=[],ue=M.asArray(),A=0;A<ue.length;A++)Ce.push(ue[A]);for(A=0;A<Ce.length;A++)de(D,M,Ce[A])}for(C=0;C<Ie;C++)ae.activePointersLists.pop();ae.sentDragEvent=!1}function N(D){var C,A,M=i[D.hash];if(M.tracking){for(A=0;A<e.MouseTracker.subscribeEvents.length;A++)C=e.MouseTracker.subscribeEvents[A],e.removeEvent(D.element,C,M[C],!1);O(D),M.tracking=!1}}function B(D,C){var A=i[D.hash];if(C==="pointerevent")return{upName:"pointerup",upHandler:A.pointerupcaptured,moveName:"pointermove",moveHandler:A.pointermovecaptured};if(C==="mouse")return{upName:"pointerup",upHandler:A.pointerupcaptured,moveName:"pointermove",moveHandler:A.pointermovecaptured};if(C==="touch")return{upName:"touchend",upHandler:A.touchendcaptured,moveName:"touchmove",moveHandler:A.touchmovecaptured};throw new Error("MouseTracker.getCaptureEventParams: Unknown pointer type.")}function U(D,C){var A,M;if(e.MouseTracker.havePointerCapture)if(e.MouseTracker.havePointerEvents){if(!(M=D.getActivePointersListByType(C.type).getById(C.id))||!M.captured)return;try{D.element.releasePointerCapture(C.id)}catch{}}else D.element.releaseCapture();else A=B(D,e.MouseTracker.havePointerEvents?"pointerevent":C.type),_&&S(window.top)&&e.removeEvent(window.top,A.upName,A.upHandler,!0),e.removeEvent(e.MouseTracker.captureElement,A.moveName,A.moveHandler,!0),e.removeEvent(e.MouseTracker.captureElement,A.upName,A.upHandler,!0);Pe(D,C,!1)}function W(D){return e.MouseTracker.havePointerEvents?D.pointerId:e.MouseTracker.mousePointerId}function H(D){return e.MouseTracker.havePointerEvents?D.pointerType||(e.Browser.vendor===e.BROWSERS.IE?"mouse":""):"mouse"}function $(D){return!e.MouseTracker.havePointerEvents||D.isPrimary}function K(D){return e.getMousePosition(D)}function Q(D,C){return re(K(D),C)}function re(D,C){var A=e.getElementOffset(C);return D.minus(A)}function Y(D,C){return new e.Point((D.x+C.x)/2,(D.y+C.y)/2)}function he(D,C){var A={originalEvent:C,eventType:"click",pointerType:"mouse",isEmulated:!1};se(D,A),A.preventDefault&&!A.defaultPrevented&&e.cancelEvent(C),A.stopPropagation&&e.stopEvent(C)}function ve(D,C){var A={originalEvent:C,eventType:"dblclick",pointerType:"mouse",isEmulated:!1};se(D,A),A.preventDefault&&!A.defaultPrevented&&e.cancelEvent(C),A.stopPropagation&&e.stopEvent(C)}function Se(D,C){var A=null,M={originalEvent:C,eventType:"keydown",pointerType:"",isEmulated:!1};se(D,M),!D.keyDownHandler||M.preventGesture||M.defaultPrevented||(A={eventSource:D,keyCode:C.keyCode?C.keyCode:C.charCode,ctrl:C.ctrlKey,shift:C.shiftKey,alt:C.altKey,meta:C.metaKey,originalEvent:C,preventDefault:M.preventDefault||M.defaultPrevented,userData:D.userData},D.keyDownHandler(A)),(A&&A.preventDefault||M.preventDefault&&!M.defaultPrevented)&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C)}function ke(D,C){var A=null,M={originalEvent:C,eventType:"keyup",pointerType:"",isEmulated:!1};se(D,M),!D.keyUpHandler||M.preventGesture||M.defaultPrevented||(A={eventSource:D,keyCode:C.keyCode?C.keyCode:C.charCode,ctrl:C.ctrlKey,shift:C.shiftKey,alt:C.altKey,meta:C.metaKey,originalEvent:C,preventDefault:M.preventDefault||M.defaultPrevented,userData:D.userData},D.keyUpHandler(A)),(A&&A.preventDefault||M.preventDefault&&!M.defaultPrevented)&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C)}function Me(D,C){var A=null,M={originalEvent:C,eventType:"keypress",pointerType:"",isEmulated:!1};se(D,M),!D.keyHandler||M.preventGesture||M.defaultPrevented||(A={eventSource:D,keyCode:C.keyCode?C.keyCode:C.charCode,ctrl:C.ctrlKey,shift:C.shiftKey,alt:C.altKey,meta:C.metaKey,originalEvent:C,preventDefault:M.preventDefault||M.defaultPrevented,userData:D.userData},D.keyHandler(A)),(A&&A.preventDefault||M.preventDefault&&!M.defaultPrevented)&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C)}function Ve(D,C){var A={originalEvent:C,eventType:"focus",pointerType:"",isEmulated:!1};se(D,A),D.focusHandler&&!A.preventGesture&&D.focusHandler({eventSource:D,originalEvent:C,userData:D.userData})}function Ue(D,C){var A={originalEvent:C,eventType:"blur",pointerType:"",isEmulated:!1};se(D,A),D.blurHandler&&!A.preventGesture&&D.blurHandler({eventSource:D,originalEvent:C,userData:D.userData})}function $e(D,C){var A=null,M={originalEvent:C,eventType:"contextmenu",pointerType:"mouse",isEmulated:!1};se(D,M),!D.contextMenuHandler||M.preventGesture||M.defaultPrevented||(A={eventSource:D,position:re(K(C),D.element),originalEvent:M.originalEvent,preventDefault:M.preventDefault||M.defaultPrevented,userData:D.userData},D.contextMenuHandler(A)),(A&&A.preventDefault||M.preventDefault&&!M.defaultPrevented)&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C)}function Ae(D,C){Re(D,C,C)}function qe(D,C){var A={target:C.target||C.srcElement,type:"wheel",shiftKey:C.shiftKey||!1,clientX:C.clientX,clientY:C.clientY,pageX:C.pageX?C.pageX:C.clientX,pageY:C.pageY?C.pageY:C.clientY,deltaMode:C.type==="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0};e.MouseTracker.wheelEventName==="mousewheel"?A.deltaY=-C.wheelDelta/e.DEFAULT_SETTINGS.pixelsPerWheelLine:A.deltaY=C.detail,Re(D,A,C)}function Re(D,C,A){var M,ue,Ce=null;M=C.deltaY<0?1:-1,se(D,ue={originalEvent:C,eventType:"wheel",pointerType:"mouse",isEmulated:C!==A}),!D.scrollHandler||ue.preventGesture||ue.defaultPrevented||(Ce={eventSource:D,pointerType:"mouse",position:Q(C,D.element),scroll:M,shift:C.shiftKey,isTouchEvent:!1,originalEvent:A,preventDefault:ue.preventDefault||ue.defaultPrevented,userData:D.userData},D.scrollHandler(Ce)),ue.stopPropagation&&e.stopEvent(A),(Ce&&Ce.preventDefault||ue.preventDefault&&!ue.defaultPrevented)&&e.cancelEvent(A)}function ot(D,C){var A={id:e.MouseTracker.mousePointerId,type:"mouse"},M={originalEvent:C,eventType:"lostpointercapture",pointerType:"mouse",isEmulated:!1};se(D,M),C.target===D.element&&Pe(D,A,!1),M.stopPropagation&&e.stopEvent(C)}function Qe(D,C){var A,M,ue,Ce=C.changedTouches.length,ae=D.getActivePointersListByType("touch");A=e.now(),ae.getLength()>C.touches.length-Ce&&e.console.warn("Tracked touch contact count doesn't match event.touches.length");var Ie={originalEvent:C,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(se(D,Ie),M=0;M<Ce;M++)le(D,Ie,ue={id:C.changedTouches[M].identifier,type:"touch",isPrimary:ae.getLength()===0,currentPos:K(C.changedTouches[M]),currentTime:A}),me(D,Ie,ue,0),Pe(D,ue,!0);Ie.preventDefault&&!Ie.defaultPrevented&&e.cancelEvent(C),Ie.stopPropagation&&e.stopEvent(C)}function Ke(D,C){var A,M,ue,Ce=C.changedTouches.length;A=e.now();var ae={originalEvent:C,eventType:"pointerup",pointerType:"touch",isEmulated:!1};for(se(D,ae),M=0;M<Ce;M++)Te(D,ae,ue={id:C.changedTouches[M].identifier,type:"touch",currentPos:K(C.changedTouches[M]),currentTime:A},0),Pe(D,ue,!1),ye(D,ae,ue);ae.preventDefault&&!ae.defaultPrevented&&e.cancelEvent(C),ae.stopPropagation&&e.stopEvent(C)}function Ze(D,C){var A,M,ue=C.changedTouches.length;A=e.now();var Ce={originalEvent:C,eventType:"pointermove",pointerType:"touch",isEmulated:!1};for(se(D,Ce),M=0;M<ue;M++)De(D,Ce,{id:C.changedTouches[M].identifier,type:"touch",currentPos:K(C.changedTouches[M]),currentTime:A});Ce.preventDefault&&!Ce.defaultPrevented&&e.cancelEvent(C),Ce.stopPropagation&&e.stopEvent(C)}function it(D,C){var A,M=C.changedTouches.length,ue={originalEvent:C,eventType:"pointercancel",pointerType:"touch",isEmulated:!1};for(se(D,ue),A=0;A<M;A++)tt(D,ue,{id:C.changedTouches[A].identifier,type:"touch"});ue.stopPropagation&&e.stopEvent(C)}function ft(D,C){return e.eventIsCanceled(C)||C.preventDefault(),!1}function Ge(D,C){return e.eventIsCanceled(C)||C.preventDefault(),!1}function dt(D,C){var A={originalEvent:C,eventType:"gotpointercapture",pointerType:H(C),isEmulated:!1};se(D,A),C.target===D.element&&Pe(D,{id:C.pointerId,type:H(C)},!0),A.stopPropagation&&e.stopEvent(C)}function vt(D,C){var A={originalEvent:C,eventType:"lostpointercapture",pointerType:H(C),isEmulated:!1};se(D,A),C.target===D.element&&Pe(D,{id:C.pointerId,type:H(C)},!1),A.stopPropagation&&e.stopEvent(C)}function Xe(D,C){var A={id:W(C),type:H(C),isPrimary:$(C),currentPos:K(C),currentTime:e.now()},M={originalEvent:C,eventType:"pointerenter",pointerType:A.type,isEmulated:!1};se(D,M),le(D,M,A)}function rt(D,C){var A={id:W(C),type:H(C),isPrimary:$(C),currentPos:K(C),currentTime:e.now()},M={originalEvent:C,eventType:"pointerleave",pointerType:A.type,isEmulated:!1};se(D,M),ye(D,M,A)}function Je(D,C){var A={id:W(C),type:H(C),isPrimary:$(C),currentPos:K(C),currentTime:e.now()},M={originalEvent:C,eventType:"pointerover",pointerType:A.type,isEmulated:!1};se(D,M),function(ue,Ce,ae){var Ie,He;Ie=ue.getActivePointersListByType(ae.type),(He=Ie.getById(ae.id))?ae=He:(ae.captured=!1,ae.insideElementPressed=!1),ue.overHandler&&ue.overHandler({eventSource:ue,pointerType:ae.type,position:re(ae.currentPos,ue.element),buttons:Ie.buttons,pointers:ue.getActivePointerCount(),insideElementPressed:ae.insideElementPressed,buttonDownAny:Ie.buttons!==0,isTouchEvent:ae.type==="touch",originalEvent:Ce.originalEvent,userData:ue.userData})}(D,M,A),M.preventDefault&&!M.defaultPrevented&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C)}function et(D,C){var A={id:W(C),type:H(C),isPrimary:$(C),currentPos:K(C),currentTime:e.now()},M={originalEvent:C,eventType:"pointerout",pointerType:A.type,isEmulated:!1};se(D,M),function(ue,Ce,ae){var Ie,He;Ie=ue.getActivePointersListByType(ae.type),(He=Ie.getById(ae.id))?ae=He:(ae.captured=!1,ae.insideElementPressed=!1),ue.outHandler&&ue.outHandler({eventSource:ue,pointerType:ae.type,position:ae.currentPos&&re(ae.currentPos,ue.element),buttons:Ie.buttons,pointers:ue.getActivePointerCount(),insideElementPressed:ae.insideElementPressed,buttonDownAny:Ie.buttons!==0,isTouchEvent:ae.type==="touch",originalEvent:Ce.originalEvent,userData:ue.userData})}(D,M,A),M.preventDefault&&!M.defaultPrevented&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C)}function w(D,C){var A={id:W(C),type:H(C),isPrimary:$(C),currentPos:K(C),currentTime:e.now()},M=e.MouseTracker.havePointerEvents&&A.type==="touch"&&e.Browser.vendor!==e.BROWSERS.IE,ue={originalEvent:C,eventType:"pointerdown",pointerType:A.type,isEmulated:!1};se(D,ue),me(D,ue,A,C.button),ue.preventDefault&&!ue.defaultPrevented&&e.cancelEvent(C),ue.stopPropagation&&e.stopEvent(C),ue.shouldCapture&&(M?Pe(D,A,!0):function(Ce,ae){var Ie;if(e.MouseTracker.havePointerCapture)if(e.MouseTracker.havePointerEvents)try{Ce.element.setPointerCapture(ae.id)}catch{return void e.console.warn("setPointerCapture() called on invalid pointer ID")}else Ce.element.setCapture(!0);else Ie=B(Ce,e.MouseTracker.havePointerEvents?"pointerevent":ae.type),_&&S(window.top)&&e.addEvent(window.top,Ie.upName,Ie.upHandler,!0),e.addEvent(e.MouseTracker.captureElement,Ie.upName,Ie.upHandler,!0),e.addEvent(e.MouseTracker.captureElement,Ie.moveName,Ie.moveHandler,!0);Pe(Ce,ae,!0)}(D,A))}function j(D,C){pe(D,C)}function oe(D,C){D.getActivePointersListByType(H(C)).getById(C.pointerId)&&pe(D,C),e.stopEvent(C)}function pe(D,C){var A,M={originalEvent:C,eventType:"pointerup",pointerType:(A={id:W(C),type:H(C),isPrimary:$(C),currentPos:K(C),currentTime:e.now()}).type,isEmulated:!1};se(D,M),Te(D,M,A,C.button),M.preventDefault&&!M.defaultPrevented&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C),M.shouldReleaseCapture&&(C.target===D.element?U(D,A):Pe(D,A,!1))}function ce(D,C){ge(D,C)}function we(D,C){D.getActivePointersListByType(H(C)).getById(C.pointerId)&&ge(D,C),e.stopEvent(C)}function ge(D,C){var A={id:W(C),type:H(C),isPrimary:$(C),currentPos:K(C),currentTime:e.now()},M={originalEvent:C,eventType:"pointermove",pointerType:A.type,isEmulated:!1};se(D,M),De(D,M,A),M.preventDefault&&!M.defaultPrevented&&e.cancelEvent(C),M.stopPropagation&&e.stopEvent(C)}function be(D,C){var A={id:C.pointerId,type:H(C)},M={originalEvent:C,eventType:"pointercancel",pointerType:A.type,isEmulated:!1};se(D,M),tt(D,M,A),M.stopPropagation&&e.stopEvent(C)}function Oe(D,C){return C.speed=0,C.direction=0,C.contactPos=C.currentPos,C.contactTime=C.currentTime,C.lastPos=C.currentPos,C.lastTime=C.currentTime,D.add(C)}function de(D,C,A){var M,ue=C.getById(A.id);return ue?(ue.captured&&(e.console.warn("stopTrackingPointer() called on captured pointer"),U(D,ue)),C.removeContact(),M=C.removeById(A.id)):M=C.getLength(),M}function se(D,C){C.eventSource=D,C.eventPhase=C.originalEvent&&C.originalEvent.eventPhase!==void 0?C.originalEvent.eventPhase:0,C.defaultPrevented=e.eventIsCanceled(C.originalEvent),C.shouldCapture=!1,C.shouldReleaseCapture=!1,C.userData=D.userData,function(A,M){switch(M.eventType){case"pointermove":case"pointerdown":case"pointerup":M.isStoppable=!0,M.isCancelable=!0,M.preventDefault=!1,M.preventGesture=!A.hasGestureHandlers,M.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":M.isStoppable=!0,M.isCancelable=!0,M.preventDefault=!1,M.preventGesture=!1,M.stopPropagation=!1;break;case"wheel":M.isStoppable=!0,M.isCancelable=!0,M.preventDefault=!1,M.preventGesture=!A.hasScrollHandler,M.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":M.isStoppable=!0,M.isCancelable=!1,M.preventDefault=!1,M.preventGesture=!1,M.stopPropagation=!1;break;case"click":M.isStoppable=!0,M.isCancelable=!0,M.preventDefault=!!A.clickHandler,M.preventGesture=!1,M.stopPropagation=!1;break;case"dblclick":M.isStoppable=!0,M.isCancelable=!0,M.preventDefault=!!A.dblClickHandler,M.preventGesture=!1,M.stopPropagation=!1;break;default:M.isStoppable=!1,M.isCancelable=!1,M.preventDefault=!1,M.preventGesture=!1,M.stopPropagation=!1}}(D,C),D.preProcessEventHandler&&D.preProcessEventHandler(C)}function Pe(D,C,A){var M=D.getActivePointersListByType(C.type),ue=M.getById(C.id);ue?A&&!ue.captured?(ue.captured=!0,M.captureCount++):!A&&ue.captured&&(ue.captured=!1,M.captureCount--,M.captureCount<0&&(M.captureCount=0,e.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):e.console.warn("updatePointerCaptured() called on untracked pointer")}function le(D,C,A){var M,ue=D.getActivePointersListByType(A.type);(M=ue.getById(A.id))?(M.insideElement=!0,M.lastPos=M.currentPos,M.lastTime=M.currentTime,M.currentPos=A.currentPos,M.currentTime=A.currentTime,A=M):(A.captured=!1,A.insideElementPressed=!1,A.insideElement=!0,Oe(ue,A)),D.enterHandler&&D.enterHandler({eventSource:D,pointerType:A.type,position:re(A.currentPos,D.element),buttons:ue.buttons,pointers:D.getActivePointerCount(),insideElementPressed:A.insideElementPressed,buttonDownAny:ue.buttons!==0,isTouchEvent:A.type==="touch",originalEvent:C.originalEvent,userData:D.userData})}function ye(D,C,A){var M,ue,Ce=D.getActivePointersListByType(A.type);(M=Ce.getById(A.id))?(M.captured?(M.insideElement=!1,M.lastPos=M.currentPos,M.lastTime=M.currentTime,M.currentPos=A.currentPos,M.currentTime=A.currentTime):de(D,Ce,M),A=M):(A.captured=!1,A.insideElementPressed=!1),(D.leaveHandler||D.exitHandler)&&(ue={eventSource:D,pointerType:A.type,position:A.currentPos&&re(A.currentPos,D.element),buttons:Ce.buttons,pointers:D.getActivePointerCount(),insideElementPressed:A.insideElementPressed,buttonDownAny:Ce.buttons!==0,isTouchEvent:A.type==="touch",originalEvent:C.originalEvent,userData:D.userData},D.leaveHandler&&D.leaveHandler(ue),D.exitHandler&&D.exitHandler(ue))}function me(D,C,A,M){var ue,Ce=i[D.hash],ae=D.getActivePointersListByType(A.type);if(C.originalEvent.buttons!==void 0?ae.buttons=C.originalEvent.buttons:M===0?ae.buttons|=1:M===1?ae.buttons|=4:M===2?ae.buttons|=2:M===3?ae.buttons|=8:M===4?ae.buttons|=16:M===5&&(ae.buttons|=32),M!==0)return C.shouldCapture=!1,C.shouldReleaseCapture=!1,void(!D.nonPrimaryPressHandler||C.preventGesture||C.defaultPrevented||(C.preventDefault=!0,D.nonPrimaryPressHandler({eventSource:D,pointerType:A.type,position:re(A.currentPos,D.element),button:M,buttons:ae.buttons,isTouchEvent:A.type==="touch",originalEvent:C.originalEvent,userData:D.userData})));(ue=ae.getById(A.id))?(ue.insideElementPressed=!0,ue.insideElement=!0,ue.originalTarget=C.originalEvent.target,ue.contactPos=A.currentPos,ue.contactTime=A.currentTime,ue.lastPos=ue.currentPos,ue.lastTime=ue.currentTime,ue.currentPos=A.currentPos,ue.currentTime=A.currentTime,A=ue):(A.captured=!1,A.insideElementPressed=!0,A.insideElement=!0,A.originalTarget=C.originalEvent.target,Oe(ae,A)),ae.addContact(),C.preventGesture||C.defaultPrevented?(C.shouldCapture=!1,C.shouldReleaseCapture=!1):(C.shouldCapture=!0,C.shouldReleaseCapture=!1,C.preventDefault=!0,(D.dragHandler||D.dragEndHandler||D.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.addPoint(D,A),ae.contacts===1?D.pressHandler&&!C.preventGesture&&D.pressHandler({eventSource:D,pointerType:A.type,position:re(A.contactPos,D.element),buttons:ae.buttons,isTouchEvent:A.type==="touch",originalEvent:C.originalEvent,userData:D.userData}):ae.contacts===2&&D.pinchHandler&&A.type==="touch"&&(Ce.pinchGPoints=ae.asArray(),Ce.lastPinchDist=Ce.currentPinchDist=Ce.pinchGPoints[0].currentPos.distanceTo(Ce.pinchGPoints[1].currentPos),Ce.lastPinchCenter=Ce.currentPinchCenter=Y(Ce.pinchGPoints[0].currentPos,Ce.pinchGPoints[1].currentPos)))}function Te(D,C,A,M){var ue,Ce,ae,Ie,He=i[D.hash],We=D.getActivePointersListByType(A.type),mt=!1;if(C.originalEvent.buttons!==void 0?We.buttons=C.originalEvent.buttons:M===0?We.buttons^=-2:M===1?We.buttons^=-5:M===2?We.buttons^=-3:M===3?We.buttons^=-9:M===4?We.buttons^=-17:M===5&&(We.buttons^=-33),C.shouldCapture=!1,M!==0)return C.shouldReleaseCapture=!1,void(!D.nonPrimaryReleaseHandler||C.preventGesture||C.defaultPrevented||(C.preventDefault=!0,D.nonPrimaryReleaseHandler({eventSource:D,pointerType:A.type,position:re(A.currentPos,D.element),button:M,buttons:We.buttons,isTouchEvent:A.type==="touch",originalEvent:C.originalEvent,userData:D.userData})));(ae=We.getById(A.id))?(We.removeContact(),ae.captured&&(mt=!0),ae.lastPos=ae.currentPos,ae.lastTime=ae.currentTime,ae.currentPos=A.currentPos,ae.currentTime=A.currentTime,ae.insideElement||de(D,We,ae),ue=ae.currentPos,Ce=ae.currentTime):(A.captured=!1,A.insideElementPressed=!1,A.insideElement=!0,Oe(We,A),ae=A),C.preventGesture||C.defaultPrevented||(mt?(C.shouldReleaseCapture=!0,C.preventDefault=!0,(D.dragHandler||D.dragEndHandler||D.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.removePoint(D,ae),We.contacts===0?(D.releaseHandler&&ue&&D.releaseHandler({eventSource:D,pointerType:ae.type,position:re(ue,D.element),buttons:We.buttons,insideElementPressed:ae.insideElementPressed,insideElementReleased:ae.insideElement,isTouchEvent:ae.type==="touch",originalEvent:C.originalEvent,userData:D.userData}),D.dragEndHandler&&He.sentDragEvent&&D.dragEndHandler({eventSource:D,pointerType:ae.type,position:re(ae.currentPos,D.element),speed:ae.speed,direction:ae.direction,shift:C.originalEvent.shiftKey,isTouchEvent:ae.type==="touch",originalEvent:C.originalEvent,userData:D.userData}),He.sentDragEvent=!1,(D.clickHandler||D.dblClickHandler)&&ae.insideElement&&(Ie=Ce-ae.contactTime<=D.clickTimeThreshold&&ae.contactPos.distanceTo(ue)<=D.clickDistThreshold,D.clickHandler&&D.clickHandler({eventSource:D,pointerType:ae.type,position:re(ae.currentPos,D.element),quick:Ie,shift:C.originalEvent.shiftKey,isTouchEvent:ae.type==="touch",originalEvent:C.originalEvent,originalTarget:ae.originalTarget,userData:D.userData}),D.dblClickHandler&&Ie&&(We.clicks++,We.clicks===1?(He.lastClickPos=ue,He.dblClickTimeOut=setTimeout(function(){We.clicks=0},D.dblClickTimeThreshold)):We.clicks===2&&(clearTimeout(He.dblClickTimeOut),We.clicks=0,He.lastClickPos.distanceTo(ue)<=D.dblClickDistThreshold&&D.dblClickHandler({eventSource:D,pointerType:ae.type,position:re(ae.currentPos,D.element),shift:C.originalEvent.shiftKey,isTouchEvent:ae.type==="touch",originalEvent:C.originalEvent,userData:D.userData}),He.lastClickPos=null)))):We.contacts===2&&D.pinchHandler&&ae.type==="touch"&&(He.pinchGPoints=We.asArray(),He.lastPinchDist=He.currentPinchDist=He.pinchGPoints[0].currentPos.distanceTo(He.pinchGPoints[1].currentPos),He.lastPinchCenter=He.currentPinchCenter=Y(He.pinchGPoints[0].currentPos,He.pinchGPoints[1].currentPos))):(C.shouldReleaseCapture=!1,D.releaseHandler&&ue&&(D.releaseHandler({eventSource:D,pointerType:ae.type,position:re(ue,D.element),buttons:We.buttons,insideElementPressed:ae.insideElementPressed,insideElementReleased:ae.insideElement,isTouchEvent:ae.type==="touch",originalEvent:C.originalEvent,userData:D.userData}),C.preventDefault=!0)))}function De(D,C,A){var M,ue,Ce,ae=i[D.hash],Ie=D.getActivePointersListByType(A.type);C.originalEvent.buttons!==void 0&&(Ie.buttons=C.originalEvent.buttons),(M=Ie.getById(A.id))&&(M.lastPos=M.currentPos,M.lastTime=M.currentTime,M.currentPos=A.currentPos,M.currentTime=A.currentTime,C.shouldCapture=!1,C.shouldReleaseCapture=!1,D.stopHandler&&A.type==="mouse"&&(clearTimeout(D.stopTimeOut),D.stopTimeOut=setTimeout(function(){(function(He,We,mt){He.stopHandler&&He.stopHandler({eventSource:He,pointerType:mt,position:Q(We,He.element),buttons:He.getActivePointersListByType(mt).buttons,isTouchEvent:mt==="touch",originalEvent:We,userData:He.userData})})(D,C.originalEvent,A.type)},D.stopDelay)),Ie.contacts===0?D.moveHandler&&D.moveHandler({eventSource:D,pointerType:A.type,position:re(A.currentPos,D.element),buttons:Ie.buttons,isTouchEvent:A.type==="touch",originalEvent:C.originalEvent,userData:D.userData}):Ie.contacts===1?(D.moveHandler&&(M=Ie.asArray()[0],D.moveHandler({eventSource:D,pointerType:M.type,position:re(M.currentPos,D.element),buttons:Ie.buttons,isTouchEvent:M.type==="touch",originalEvent:C.originalEvent,userData:D.userData})),!D.dragHandler||C.preventGesture||C.defaultPrevented||(Ce=(M=Ie.asArray()[0]).currentPos.minus(M.lastPos),D.dragHandler({eventSource:D,pointerType:M.type,position:re(M.currentPos,D.element),buttons:Ie.buttons,delta:Ce,speed:M.speed,direction:M.direction,shift:C.originalEvent.shiftKey,isTouchEvent:M.type==="touch",originalEvent:C.originalEvent,userData:D.userData}),C.preventDefault=!0,ae.sentDragEvent=!0)):Ie.contacts===2&&(D.moveHandler&&(ue=Ie.asArray(),D.moveHandler({eventSource:D,pointerType:ue[0].type,position:re(Y(ue[0].currentPos,ue[1].currentPos),D.element),buttons:Ie.buttons,isTouchEvent:ue[0].type==="touch",originalEvent:C.originalEvent,userData:D.userData})),!D.pinchHandler||A.type!=="touch"||C.preventGesture||C.defaultPrevented||(Ce=ae.pinchGPoints[0].currentPos.distanceTo(ae.pinchGPoints[1].currentPos))!==ae.currentPinchDist&&(ae.lastPinchDist=ae.currentPinchDist,ae.currentPinchDist=Ce,ae.lastPinchCenter=ae.currentPinchCenter,ae.currentPinchCenter=Y(ae.pinchGPoints[0].currentPos,ae.pinchGPoints[1].currentPos),D.pinchHandler({eventSource:D,pointerType:"touch",gesturePoints:ae.pinchGPoints,lastCenter:re(ae.lastPinchCenter,D.element),center:re(ae.currentPinchCenter,D.element),lastDistance:ae.lastPinchDist,distance:ae.currentPinchDist,shift:C.originalEvent.shiftKey,originalEvent:C.originalEvent,userData:D.userData}),C.preventDefault=!0)))}function tt(D,C,A){var M,ue=D.getActivePointersListByType(A.type);(M=ue.getById(A.id))&&de(D,ue,M)}e.MouseTracker.gesturePointVelocityTracker=(u=[],n=0,o=0,s=function(D,C){return D.hash.toString()+C.type+C.id.toString()},c=function(){var D,C,A,M,ue,Ce,ae=u.length,Ie=e.now();for(M=Ie-o,o=Ie,D=0;D<ae;D++)(A=(C=u[D]).gPoint).direction=Math.atan2(A.currentPos.y-C.lastPos.y,A.currentPos.x-C.lastPos.x),ue=C.lastPos.distanceTo(A.currentPos),C.lastPos=A.currentPos,Ce=1e3*ue/(M+1),A.speed=.75*Ce+.25*A.speed},{addPoint:function(D,C){var A=s(D,C);u.push({guid:A,gPoint:C,lastPos:C.currentPos}),u.length===1&&(o=e.now(),n=window.setInterval(c,50))},removePoint:function(D,C){var A,M=s(D,C),ue=u.length;for(A=0;A<ue;A++)if(u[A].guid===M){u.splice(A,1),--ue==0&&window.clearInterval(n);break}}}),e.MouseTracker.captureElement=document,e.MouseTracker.wheelEventName=e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version>8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",e.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",e.MouseTracker.wheelEventName],e.MouseTracker.wheelEventName==="DOMMouseScroll"&&e.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),e.MouseTracker.havePointerCapture=(m=document.createElement("div"),e.isFunction(m.setPointerCapture)&&e.isFunction(m.releasePointerCapture)),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(e.MouseTracker.havePointerEvents=!1,e.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),e.MouseTracker.mousePointerId="legacy-mouse",e.MouseTracker.havePointerCapture=function(){var D=document.createElement("div");return e.isFunction(D.setCapture)&&e.isFunction(D.releaseCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&e.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&e.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),e.MouseTracker.GesturePointList=function(D){this._gPoints=[],this.type=D,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},e.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(D){return this._gPoints.push(D)},removeById:function(D){var C,A=this._gPoints.length;for(C=0;C<A;C++)if(this._gPoints[C].id===D){this._gPoints.splice(C,1);break}return this._gPoints.length},getByIndex:function(D){return D<this._gPoints.length?this._gPoints[D]:null},getById:function(D){var C,A=this._gPoints.length;for(C=0;C<A;C++)if(this._gPoints[C].id===D)return this._gPoints[C];return null},getPrimary:function(D){var C,A=this._gPoints.length;for(C=0;C<A;C++)if(this._gPoints[C].isPrimary)return this._gPoints[C];return null},addContact:function(){++this.contacts,this.contacts>1&&(this.type==="mouse"||this.type==="pen")&&(e.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(this.contacts=0)}}}(b),function(e){e.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},e.Control=function(t,i,u){var n=t.parentNode;typeof i=="number"&&(e.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),i={anchor:i}),i.attachToViewer=i.attachToViewer===void 0||i.attachToViewer,this.autoFade=i.autoFade===void 0||i.autoFade,this.element=t,this.anchor=i.anchor,this.container=u,this.anchor===e.ControlAnchor.ABSOLUTE?(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof i.top=="number"?i.top+"px":i.top,this.wrapper.style.left=typeof i.left=="number"?i.left+"px":i.left,this.wrapper.style.height=typeof i.height=="number"?i.height+"px":i.height,this.wrapper.style.width=typeof i.width=="number"?i.width+"px":i.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===e.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),i.attachToViewer?this.anchor===e.ControlAnchor.TOP_RIGHT||this.anchor===e.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):n.appendChild(this.wrapper)},e.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==e.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(t){this.wrapper.style.display=t?this.anchor===e.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(t){this.element[e.SIGNAL]&&e.Browser.vendor===e.BROWSERS.IE?e.setElementOpacity(this.element,t,!0):e.setElementOpacity(this.wrapper,t,!0)}}}(b),function(e){function t(i,u){var n,o=i.controls;for(n=o.length-1;n>=0;n--)if(o[n].element===u)return n;return-1}e.ControlDock=function(i){var u,n,o=["topleft","topright","bottomright","bottomleft"];for(e.extend(!0,this,{id:"controldock-"+e.now()+"-"+Math.floor(1e6*Math.random()),container:e.makeNeutralElement("div"),controls:[]},i),this.container.onsubmit=function(){return!1},this.element&&(this.element=e.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),n=0;n<o.length;n++)u=o[n],this.controls[u]=e.makeNeutralElement("div"),this.controls[u].style.position="absolute",u.match("left")&&(this.controls[u].style.left="0px"),u.match("right")&&(this.controls[u].style.right="0px"),u.match("top")&&(this.controls[u].style.top="0px"),u.match("bottom")&&(this.controls[u].style.bottom="0px");this.container.appendChild(this.controls.topleft),this.container.appendChild(this.controls.topright),this.container.appendChild(this.controls.bottomright),this.container.appendChild(this.controls.bottomleft)},e.ControlDock.prototype={addControl:function(i,u){var n=null;if(!(t(this,i=e.getElement(i))>=0)){switch(u.anchor){case e.ControlAnchor.TOP_RIGHT:n=this.controls.topright,i.style.position="relative",i.style.paddingRight="0px",i.style.paddingTop="0px";break;case e.ControlAnchor.BOTTOM_RIGHT:n=this.controls.bottomright,i.style.position="relative",i.style.paddingRight="0px",i.style.paddingBottom="0px";break;case e.ControlAnchor.BOTTOM_LEFT:n=this.controls.bottomleft,i.style.position="relative",i.style.paddingLeft="0px",i.style.paddingBottom="0px";break;case e.ControlAnchor.TOP_LEFT:n=this.controls.topleft,i.style.position="relative",i.style.paddingLeft="0px",i.style.paddingTop="0px";break;case e.ControlAnchor.ABSOLUTE:default:case e.ControlAnchor.NONE:n=this.container,i.style.margin="0px",i.style.padding="0px"}this.controls.push(new e.Control(i,u,n)),i.style.display="inline-block"}},removeControl:function(i){var u=t(this,i=e.getElement(i));return u>=0&&(this.controls[u].destroy(),this.controls.splice(u,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var i;for(i=this.controls.length-1;i>=0;i--)if(this.controls[i].isVisible())return!0;return!1},setControlsEnabled:function(i){var u;for(u=this.controls.length-1;u>=0;u--)this.controls[u].setVisible(i);return this}}}(b),function(e){e.Placement=e.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(b),function(e){var t={},i=1;function u(w){return w=e.getElement(w),new e.Point(w.clientWidth===0?1:w.clientWidth,w.clientHeight===0?1:w.clientHeight)}function n(w,j){if(j instanceof e.Overlay)return j;var oe=null;if(j.element)oe=e.getElement(j.element);else{var pe=j.id?j.id:"openseadragon-overlay-"+Math.floor(1e7*Math.random());(oe=e.getElement(j.id))||((oe=document.createElement("a")).href="#/overlay/"+pe),oe.id=pe,e.addClass(oe,j.className?j.className:"openseadragon-overlay")}var ce=j.location,we=j.width,ge=j.height;if(!ce){var be=j.x,Oe=j.y;if(j.px!==void 0){var de=w.viewport.imageToViewportRectangle(new e.Rect(j.px,j.py,we||0,ge||0));be=de.x,Oe=de.y,we=we!==void 0?de.width:void 0,ge=ge!==void 0?de.height:void 0}ce=new e.Point(be,Oe)}var se=j.placement;return se&&e.type(se)==="string"&&(se=e.Placement[j.placement.toUpperCase()]),new e.Overlay({element:oe,location:ce,placement:se,onDraw:j.onDraw,checkResize:j.checkResize,width:we,height:ge,rotationMode:j.rotationMode})}function o(w,j){var oe;for(oe=w.length-1;oe>=0;oe--)if(w[oe].element===j)return oe;return-1}function s(w,j){return e.requestAnimationFrame(function(){j(w)})}function c(w){e.requestAnimationFrame(function(){(function(j){var oe,pe;if(j.controlsShouldFade){for(oe=1-(e.now()-j.controlsFadeBeginTime)/j.controlsFadeLength,oe=Math.min(1,oe),oe=Math.max(0,oe),pe=j.controls.length-1;pe>=0;pe--)j.controls[pe].autoFade&&j.controls[pe].setOpacity(oe);oe>0&&c(j)}})(w)})}function m(w){w.autoHideControls&&(w.controlsShouldFade=!0,w.controlsFadeBeginTime=e.now()+w.controlsFadeDelay,window.setTimeout(function(){c(w)},w.controlsFadeDelay))}function _(w){var j;for(w.controlsShouldFade=!1,j=w.controls.length-1;j>=0;j--)w.controls[j].setOpacity(1)}function S(){_(this)}function O(){m(this)}function N(w){var j={tracker:w.eventSource,position:w.position,originalEvent:w.originalEvent,preventDefault:w.preventDefault};this.raiseEvent("canvas-contextmenu",j),w.preventDefault=j.preventDefault}function B(w){var j={originalEvent:w.originalEvent,preventDefaultAction:!1,preventVerticalPan:w.preventVerticalPan||!this.panVertical,preventHorizontalPan:w.preventHorizontalPan||!this.panHorizontal};if(this.raiseEvent("canvas-key",j),j.preventDefaultAction||w.ctrl||w.alt||w.meta)w.preventDefault=!1;else switch(w.keyCode){case 38:j.preventVerticalPan||(w.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 40:j.preventVerticalPan||(w.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 37:j.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 39:j.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 69:case 187:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 81:case 189:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 87:j.preventVerticalPan||(w.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-40))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 83:j.preventVerticalPan||(w.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,40))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 65:j.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-40,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 68:j.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(40,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 82:w.shift?this.viewport.flipped?this.viewport.setRotation(this.viewport.getRotation()+this.rotationIncrement):this.viewport.setRotation(this.viewport.getRotation()-this.rotationIncrement):this.viewport.flipped?this.viewport.setRotation(this.viewport.getRotation()-this.rotationIncrement):this.viewport.setRotation(this.viewport.getRotation()+this.rotationIncrement),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 70:this.viewport.toggleFlip(),w.preventDefault=!0;break;case 74:this.goToPreviousPage();break;case 75:this.goToNextPage();break;default:w.preventDefault=!1}}function U(w){var j={originalEvent:w.originalEvent};this.raiseEvent("canvas-key-press",j)}function W(w){var j;document.activeElement===this.canvas||this.canvas.focus(),this.viewport.flipped&&(w.position.x=this.viewport.getContainerSize().x-w.position.x);var oe={tracker:w.eventSource,position:w.position,quick:w.quick,shift:w.shift,originalEvent:w.originalEvent,originalTarget:w.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",oe),!oe.preventDefaultAction&&this.viewport&&w.quick&&((j=this.gestureSettingsByDeviceType(w.pointerType)).clickToZoom===!0&&(this.viewport.zoomBy(w.shift?1/this.zoomPerClick:this.zoomPerClick,j.zoomToRefPoint?this.viewport.pointFromPixel(w.position,!0):null),this.viewport.applyConstraints()),j.dblClickDragToZoom&&(t[this.hash].draggingToZoom===!0?(t[this.hash].lastClickTime=null,t[this.hash].draggingToZoom=!1):t[this.hash].lastClickTime=e.now()))}function H(w){var j,oe={tracker:w.eventSource,position:w.position,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",oe),!oe.preventDefaultAction&&this.viewport&&(j=this.gestureSettingsByDeviceType(w.pointerType)).dblClickToZoom&&(this.viewport.zoomBy(w.shift?1/this.zoomPerClick:this.zoomPerClick,j.zoomToRefPoint?this.viewport.pointFromPixel(w.position,!0):null),this.viewport.applyConstraints())}function $(w){var j,oe={tracker:w.eventSource,pointerType:w.pointerType,position:w.position,delta:w.delta,speed:w.speed,direction:w.direction,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",oe),j=this.gestureSettingsByDeviceType(w.pointerType),!oe.preventDefaultAction&&this.viewport){if(j.dblClickDragToZoom&&t[this.hash].draggingToZoom){var pe=Math.pow(this.zoomPerDblClickDrag,w.delta.y/50);this.viewport.zoomBy(pe)}else if(j.dragToPan&&!t[this.hash].draggingToZoom){if(this.panHorizontal||(w.delta.x=0),this.panVertical||(w.delta.y=0),this.viewport.flipped&&(w.delta.x=-w.delta.x),this.constrainDuringPan){var ce=this.viewport.deltaPointsFromPixels(w.delta.negate());this.viewport.centerSpringX.target.value+=ce.x,this.viewport.centerSpringY.target.value+=ce.y;var we=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=ce.x,this.viewport.centerSpringY.target.value-=ce.y,we.xConstrained&&(w.delta.x=0),we.yConstrained&&(w.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(w.delta.negate()),j.flickEnabled&&!this.constrainDuringPan)}}}function K(w){var j,oe={tracker:w.eventSource,pointerType:w.pointerType,position:w.position,speed:w.speed,direction:w.direction,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",oe),j=this.gestureSettingsByDeviceType(w.pointerType),!oe.preventDefaultAction&&this.viewport){if(!t[this.hash].draggingToZoom&&j.flickEnabled&&w.speed>=j.flickMinSpeed){var pe=0;this.panHorizontal&&(pe=j.flickMomentum*w.speed*Math.cos(w.direction));var ce=0;this.panVertical&&(ce=j.flickMomentum*w.speed*Math.sin(w.direction));var we=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),ge=this.viewport.pointFromPixel(new e.Point(we.x-pe,we.y-ce));this.viewport.panTo(ge,!1)}this.viewport.applyConstraints()}j.dblClickDragToZoom&&t[this.hash].draggingToZoom===!0&&(t[this.hash].draggingToZoom=!1)}function Q(w){this.raiseEvent("canvas-enter",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function re(w){this.raiseEvent("canvas-exit",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function Y(w){if(this.raiseEvent("canvas-press",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,insideElementPressed:w.insideElementPressed,insideElementReleased:w.insideElementReleased,originalEvent:w.originalEvent}),this.gestureSettingsByDeviceType(w.pointerType).dblClickDragToZoom){var j=t[this.hash].lastClickTime,oe=e.now();if(j===null)return;oe-j<this.dblClickTimeThreshold&&(t[this.hash].draggingToZoom=!0),t[this.hash].lastClickTime=null}}function he(w){this.raiseEvent("canvas-release",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,insideElementPressed:w.insideElementPressed,insideElementReleased:w.insideElementReleased,originalEvent:w.originalEvent})}function ve(w){this.raiseEvent("canvas-nonprimary-press",{tracker:w.eventSource,position:w.position,pointerType:w.pointerType,button:w.button,buttons:w.buttons,originalEvent:w.originalEvent})}function Se(w){this.raiseEvent("canvas-nonprimary-release",{tracker:w.eventSource,position:w.position,pointerType:w.pointerType,button:w.button,buttons:w.buttons,originalEvent:w.originalEvent})}function ke(w){var j,oe,pe,ce={tracker:w.eventSource,pointerType:w.pointerType,gesturePoints:w.gesturePoints,lastCenter:w.lastCenter,center:w.center,lastDistance:w.lastDistance,distance:w.distance,shift:w.shift,originalEvent:w.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",ce),this.viewport&&(!(j=this.gestureSettingsByDeviceType(w.pointerType)).pinchToZoom||ce.preventDefaultPanAction&&ce.preventDefaultZoomAction||(oe=this.viewport.pointFromPixel(w.center,!0),j.zoomToRefPoint&&!ce.preventDefaultPanAction&&(pe=this.viewport.pointFromPixel(w.lastCenter,!0).minus(oe),this.panHorizontal||(pe.x=0),this.panVertical||(pe.y=0),this.viewport.panBy(pe,!0)),ce.preventDefaultZoomAction||this.viewport.zoomBy(w.distance/w.lastDistance,oe,!0),this.viewport.applyConstraints()),j.pinchRotate&&!ce.preventDefaultRotateAction)){var we=Math.atan2(w.gesturePoints[0].currentPos.y-w.gesturePoints[1].currentPos.y,w.gesturePoints[0].currentPos.x-w.gesturePoints[1].currentPos.x),ge=Math.atan2(w.gesturePoints[0].lastPos.y-w.gesturePoints[1].lastPos.y,w.gesturePoints[0].lastPos.x-w.gesturePoints[1].lastPos.x);oe=this.viewport.pointFromPixel(w.center,!0),this.viewport.rotateTo(this.viewport.getRotation(!0)+(we-ge)*(180/Math.PI),oe,!0)}}function Me(w){this.raiseEvent("canvas-focus",{tracker:w.eventSource,originalEvent:w.originalEvent})}function Ve(w){this.raiseEvent("canvas-blur",{tracker:w.eventSource,originalEvent:w.originalEvent})}function Ue(w){var j,oe,pe,ce;(ce=e.now())-this._lastScrollTime>this.minScrollDeltaTime?(this._lastScrollTime=ce,j={tracker:w.eventSource,position:w.position,scroll:w.scroll,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",j),!j.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(w.position.x=this.viewport.getContainerSize().x-w.position.x),(oe=this.gestureSettingsByDeviceType(w.pointerType)).scrollToZoom&&(pe=Math.pow(this.zoomPerScroll,w.scroll),this.viewport.zoomBy(pe,oe.zoomToRefPoint?this.viewport.pointFromPixel(w.position,!0):null),this.viewport.applyConstraints())),w.preventDefault=j.preventDefault):w.preventDefault=!0}function $e(w){t[this.hash].mouseInside=!0,_(this),this.raiseEvent("container-enter",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function Ae(w){w.pointers<1&&(t[this.hash].mouseInside=!1,t[this.hash].animating||m(this)),this.raiseEvent("container-exit",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function qe(w){(function(j){if(!(j._opening||!t[j.hash])){if(j.autoResize||t[j.hash].forceResize){var oe;if(j._autoResizePolling){oe=u(j.container);var pe=t[j.hash].prevContainerSize;oe.equals(pe)||(t[j.hash].needsResize=!0)}t[j.hash].needsResize&&function(Oe,de){var se,Pe=Oe.viewport,le=Pe.getZoom(),ye=Pe.getCenter();if(Pe.resize(de,Oe.preserveImageSizeOnResize),Pe.panTo(ye,!0),Oe.preserveImageSizeOnResize)se=t[Oe.hash].prevContainerSize.x/de.x;else{var me=new e.Point(0,0),Te=new e.Point(t[Oe.hash].prevContainerSize.x,t[Oe.hash].prevContainerSize.y).distanceTo(me);se=new e.Point(de.x,de.y).distanceTo(me)/Te*t[Oe.hash].prevContainerSize.x/de.x}Pe.zoomTo(le*se,null,!0),t[Oe.hash].prevContainerSize=de,t[Oe.hash].forceRedraw=!0,t[Oe.hash].needsResize=!1,t[Oe.hash].forceResize=!1}(j,oe||u(j.container))}var ce=j.viewport.update(),we=j.world.update()||ce;ce&&j.raiseEvent("viewport-change"),j.referenceStrip&&(we=j.referenceStrip.update(j.viewport)||we);var ge=t[j.hash].animating;!ge&&we&&(j.raiseEvent("animation-start"),_(j));var be=ge&&!we;be&&(t[j.hash].animating=!1),(we||be||t[j.hash].forceRedraw||j.world.needsDraw())&&(function(Oe){Oe.imageLoader.clear(),Oe.drawer.clear(),Oe.world.draw(),Oe.raiseEvent("update-viewport",{})}(j),j._drawOverlays(),j.navigator&&j.navigator.update(j.viewport),t[j.hash].forceRedraw=!1,we&&j.raiseEvent("animation")),be&&(j.raiseEvent("animation-finish"),t[j.hash].mouseInside||m(j)),t[j.hash].animating=we}})(w),w.isOpen()?w._updateRequestId=s(w,qe):w._updateRequestId=!1}function Re(w,j){return w?w+j:j}function ot(){t[this.hash].lastZoomTime=e.now(),t[this.hash].zoomFactor=this.zoomPerSecond,t[this.hash].zooming=!0,Ze(this)}function Qe(){t[this.hash].lastZoomTime=e.now(),t[this.hash].zoomFactor=1/this.zoomPerSecond,t[this.hash].zooming=!0,Ze(this)}function Ke(){t[this.hash].zooming=!1}function Ze(w){e.requestAnimationFrame(e.delegate(w,it))}function it(){var w,j,oe;t[this.hash].zooming&&this.viewport&&(j=(w=e.now())-t[this.hash].lastZoomTime,oe=Math.pow(t[this.hash].zoomFactor,j/1e3),this.viewport.zoomBy(oe),this.viewport.applyConstraints(),t[this.hash].lastZoomTime=w,Ze(this))}function ft(){this.viewport&&(t[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function Ge(){this.viewport&&(t[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function dt(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function vt(){this.viewport&&this.viewport.goHome()}function Xe(){this.isFullPage()&&!e.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function rt(){if(this.viewport){var w=this.viewport.getRotation();this.viewport.flipped?w+=this.rotationIncrement:w-=this.rotationIncrement,this.viewport.setRotation(w)}}function Je(){if(this.viewport){var w=this.viewport.getRotation();this.viewport.flipped?w-=this.rotationIncrement:w+=this.rotationIncrement,this.viewport.setRotation(w)}}function et(){this.viewport.toggleFlip()}e.Viewer=function(w){var j,oe,pe=arguments,ce=this;if(e.isPlainObject(w)||(w={id:pe[0],xmlPath:pe.length>1?pe[1]:void 0,prefixUrl:pe.length>2?pe[2]:void 0,controls:pe.length>3?pe[3]:void 0,overlays:pe.length>4?pe[4]:void 0}),w.config&&(e.extend(!0,w,w.config),delete w.config),e.extend(!0,this,{id:w.id,hash:w.hash||i++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttonGroup:null,profiler:null},e.DEFAULT_SETTINGS,w),this.hash===void 0)throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(t[this.hash]!==void 0&&e.console.warn("Hash "+this.hash+" has already been used."),t[this.hash]={fsBoundsDelta:new e.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,needsResize:!1,forceResize:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null,lastClickTime:null,draggingToZoom:!1},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=e.now(),e.EventSource.call(this),this.addHandler("open-failed",function(we){var ge=e.getString("Errors.OpenFailed",we.eventSource,we.message);ce._showMessage(ge)}),e.ControlDock.call(this,w),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=e.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",(oe=this.canvas.style).width="100%",oe.height="100%",oe.overflow="hidden",oe.position="absolute",oe.top="0px",oe.left="0px",e.setElementTouchActionNone(this.canvas),w.tabIndex!==""&&(this.canvas.tabIndex=w.tabIndex===void 0?0:w.tabIndex),this.container.className="openseadragon-container",function(we){we.width="100%",we.height="100%",we.position="relative",we.overflow="hidden",we.left="0px",we.top="0px",we.textAlign="left"}(this.container.style),e.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new e.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:e.delegate(this,N),keyDownHandler:e.delegate(this,B),keyHandler:e.delegate(this,U),clickHandler:e.delegate(this,W),dblClickHandler:e.delegate(this,H),dragHandler:e.delegate(this,$),dragEndHandler:e.delegate(this,K),enterHandler:e.delegate(this,Q),leaveHandler:e.delegate(this,re),pressHandler:e.delegate(this,Y),releaseHandler:e.delegate(this,he),nonPrimaryPressHandler:e.delegate(this,ve),nonPrimaryReleaseHandler:e.delegate(this,Se),scrollHandler:e.delegate(this,Ue),pinchHandler:e.delegate(this,ke),focusHandler:e.delegate(this,Me),blurHandler:e.delegate(this,Ve)}),this.outerTracker=new e.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:e.delegate(this,$e),leaveHandler:e.delegate(this,Ae)}),this.toolbar&&(this.toolbar=new e.ControlDock({element:this.toolbar})),this.bindStandardControls(),t[this.hash].prevContainerSize=u(this.container),window.ResizeObserver?(this._autoResizePolling=!1,this._resizeObserver=new ResizeObserver(function(){t[ce.hash].needsResize=!0}),this._resizeObserver.observe(this.container,{})):this._autoResizePolling=!0,this.world=new e.World({viewer:this}),this.world.addHandler("add-item",function(we){ce.source=ce.world.getItemAt(0).source,t[ce.hash].forceRedraw=!0,ce._updateRequestId||(ce._updateRequestId=s(ce,qe))}),this.world.addHandler("remove-item",function(we){ce.world.getItemCount()?ce.source=ce.world.getItemAt(0).source:ce.source=null,t[ce.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(we){ce.viewport&&ce.viewport._setContentBounds(ce.world.getHomeBounds(),ce.world.getContentFactor())}),this.world.addHandler("item-index-change",function(we){ce.source=ce.world.getItemAt(0).source}),this.viewport=new e.Viewport({containerSize:t[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins,silenceMultiImageWarnings:this.silenceMultiImageWarnings}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new e.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:w.timeout,tileRetryMax:this.tileRetryMax,tileRetryDelay:this.tileRetryDelay}),this.tileCache=new e.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new e.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=e.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(j=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(j,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(j=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(j,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new e.Navigator({element:this.navigatorElement,id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy,animationTime:this.animationTime})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),j=0;j<this.customControls.length;j++)this.addControl(this.customControls[j].id,{anchor:this.customControls[j].anchor});e.requestAnimationFrame(function(){m(ce)}),this.imageSmoothingEnabled===void 0||this.imageSmoothingEnabled||this.drawer.setImageSmoothingEnabled(this.imageSmoothingEnabled),e._viewers.set(this.element,this)},e.extend(e.Viewer.prototype,e.EventSource.prototype,e.ControlDock.prototype,{isOpen:function(){return!!this.world.getItemCount()},openDzi:function(w){return e.console.error("[Viewer.openDzi] this function is deprecated; use Viewer.open() instead."),this.open(w)},openTileSource:function(w){return e.console.error("[Viewer.openTileSource] this function is deprecated; use Viewer.open() instead."),this.open(w)},get buttons(){return e.console.warn("Viewer.buttons is deprecated; Please use Viewer.buttonGroup"),this.buttonGroup},open:function(w,j){var oe=this;if(this.close(),!w)return this;if(this.sequenceMode&&e.isArray(w))return this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),j===void 0||isNaN(j)||(this.initialPage=j),this.tileSources=w,this._sequenceIndex=Math.max(0,Math.min(this.tileSources.length-1,this.initialPage)),this.tileSources.length&&(this.open(this.tileSources[this._sequenceIndex]),this.showReferenceStrip&&this.addReferenceStrip()),this._updateSequenceButtons(this._sequenceIndex),this;if(e.isArray(w)||(w=[w]),!w.length)return this;this._opening=!0;for(var pe,ce=w.length,we=0,ge=0,be=function(){if(we+ge===ce)if(we){!oe._firstOpen&&oe.preserveViewport||(oe.viewport.goHome(!0),oe.viewport.update()),oe._firstOpen=!1;var se=w[0];if(se.tileSource&&(se=se.tileSource),oe.overlays&&!oe.preserveOverlays)for(var Pe=0;Pe<oe.overlays.length;Pe++)oe.currentOverlays[Pe]=n(oe,oe.overlays[Pe]);oe._drawOverlays(),oe._opening=!1,oe.raiseEvent("open",{source:se})}else oe._opening=!1,oe.raiseEvent("open-failed",pe)},Oe=function(se){e.isPlainObject(se)&&se.tileSource||(se={tileSource:se}),se.index!==void 0&&(e.console.error("[Viewer.open] setting indexes here is not supported; use addTiledImage instead"),delete se.index),se.collectionImmediately===void 0&&(se.collectionImmediately=!0);var Pe=se.success;se.success=function(ye){if(we++,se.tileSource.overlays)for(var me=0;me<se.tileSource.overlays.length;me++)oe.addOverlay(se.tileSource.overlays[me]);Pe&&Pe(ye),be()};var le=se.error;se.error=function(ye){ge++,pe||(pe=ye),le&&le(ye),be()},oe.addTiledImage(se)},de=0;de<w.length;de++)Oe(w[de]);return this},close:function(){return t[this.hash]?(this._opening=!1,this.navigator&&this.navigator.close(),this.preserveOverlays||(this.clearOverlays(),this.overlaysContainer.innerHTML=""),t[this.hash].animating=!1,this.world.removeAll(),this.imageLoader.clear(),this.raiseEvent("close"),this):this},destroy:function(){if(t[this.hash]){if(this.raiseEvent("before-destroy"),this._removeUpdatePixelDensityRatioEvent(),this.close(),this.clearOverlays(),this.overlaysContainer.innerHTML="",this._resizeObserver&&this._resizeObserver.disconnect(),this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),this._updateRequestId!==null&&(e.cancelAnimationFrame(this._updateRequestId),this._updateRequestId=null),this.drawer&&this.drawer.destroy(),this.navigator&&(this.navigator.destroy(),t[this.navigator.hash]=null,delete t[this.navigator.hash],this.navigator=null),this.buttonGroup)this.buttonGroup.destroy();else if(this.customButtons)for(;this.customButtons.length;)this.customButtons.pop().destroy();if(this.paging&&this.paging.destroy(),this.element)for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.container.onsubmit=null,this.clearControls(),this.innerTracker&&this.innerTracker.destroy(),this.outerTracker&&this.outerTracker.destroy(),t[this.hash]=null,delete t[this.hash],this.canvas=null,this.container=null,e._viewers.delete(this.element),this.element=null,this.raiseEvent("destroy"),this.removeAllHandlers()}},isMouseNavEnabled:function(){return this.innerTracker.isTracking()},setMouseNavEnabled:function(w){return this.innerTracker.setTracking(w),this.outerTracker.setTracking(w),this.raiseEvent("mouse-enabled",{enabled:w}),this},areControlsEnabled:function(){var w,j=this.controls.length;for(w=0;w<this.controls.length;w++)j=j&&this.controls[w].isVisible();return j},setControlsEnabled:function(w){return w?_(this):m(this),this.raiseEvent("controls-enabled",{enabled:w}),this},setDebugMode:function(w){for(var j=0;j<this.world.getItemCount();j++)this.world.getItemAt(j).debugMode=w;this.debugMode=w,this.forceRedraw()},setAjaxHeaders:function(w,j){if(w===null&&(w={}),e.isPlainObject(w)&&(j===void 0&&(j=!0),this.ajaxHeaders=w,j)){for(var oe=0;oe<this.world.getItemCount();oe++)this.world.getItemAt(oe)._updateAjaxHeaders(!0);if(this.navigator&&this.navigator.setAjaxHeaders(this.ajaxHeaders,!0),this.referenceStrip&&this.referenceStrip.miniViewers)for(var pe in this.referenceStrip.miniViewers)this.referenceStrip.miniViewers[pe].setAjaxHeaders(this.ajaxHeaders,!0)}},addButton:function(w){this.buttonGroup.addButton(w)},isFullPage:function(){return t[this.hash].fullPage},setFullPage:function(w){var j,oe,pe=document.body,ce=pe.style,we=document.documentElement.style,ge=this;if(w===this.isFullPage())return this;var be={fullPage:w,preventDefaultAction:!1};if(this.raiseEvent("pre-full-page",be),be.preventDefaultAction)return this;if(w){for(this.elementSize=e.getElementSize(this.element),this.pageScroll=e.getPageScroll(),this.elementMargin=this.element.style.margin,this.element.style.margin="0",this.elementPadding=this.element.style.padding,this.element.style.padding="0",this.bodyMargin=ce.margin,this.docMargin=we.margin,ce.margin="0",we.margin="0",this.bodyPadding=ce.padding,this.docPadding=we.padding,ce.padding="0",we.padding="0",this.bodyWidth=ce.width,this.docWidth=we.width,ce.width="100%",we.width="100%",this.bodyHeight=ce.height,this.docHeight=we.height,ce.height="100%",we.height="100%",this.bodyDisplay=ce.display,ce.display="block",this.previousBody=[],t[this.hash].prevElementParent=this.element.parentNode,t[this.hash].prevNextSibling=this.element.nextSibling,t[this.hash].prevElementWidth=this.element.style.width,t[this.hash].prevElementHeight=this.element.style.height,j=pe.childNodes.length,oe=0;oe<j;oe++)this.previousBody.push(pe.childNodes[0]),pe.removeChild(pe.childNodes[0]);this.toolbar&&this.toolbar.element&&(this.toolbar.parentNode=this.toolbar.element.parentNode,this.toolbar.nextSibling=this.toolbar.element.nextSibling,pe.appendChild(this.toolbar.element),e.addClass(this.toolbar.element,"fullpage")),e.addClass(this.element,"fullpage"),pe.appendChild(this.element),this.element.style.height="100vh",this.element.style.width="100vw",this.toolbar&&this.toolbar.element&&(this.element.style.height=e.getElementSize(this.element).y-e.getElementSize(this.toolbar.element).y+"px"),t[this.hash].fullPage=!0,e.delegate(this,$e)({})}else{for(this.element.style.margin=this.elementMargin,this.element.style.padding=this.elementPadding,ce.margin=this.bodyMargin,we.margin=this.docMargin,ce.padding=this.bodyPadding,we.padding=this.docPadding,ce.width=this.bodyWidth,we.width=this.docWidth,ce.height=this.bodyHeight,we.height=this.docHeight,ce.display=this.bodyDisplay,pe.removeChild(this.element),j=this.previousBody.length,oe=0;oe<j;oe++)pe.appendChild(this.previousBody.shift());e.removeClass(this.element,"fullpage"),t[this.hash].prevElementParent.insertBefore(this.element,t[this.hash].prevNextSibling),this.toolbar&&this.toolbar.element&&(pe.removeChild(this.toolbar.element),e.removeClass(this.toolbar.element,"fullpage"),this.toolbar.parentNode.insertBefore(this.toolbar.element,this.toolbar.nextSibling),delete this.toolbar.parentNode,delete this.toolbar.nextSibling),this.element.style.width=t[this.hash].prevElementWidth,this.element.style.height=t[this.hash].prevElementHeight;var Oe=0,de=function(){e.setPageScroll(ge.pageScroll);var se=e.getPageScroll();++Oe<10&&(se.x!==ge.pageScroll.x||se.y!==ge.pageScroll.y)&&e.requestAnimationFrame(de)};e.requestAnimationFrame(de),t[this.hash].fullPage=!1,e.delegate(this,Ae)({})}return this.navigator&&this.viewport&&this.navigator.update(this.viewport),this.raiseEvent("full-page",{fullPage:w}),this},setFullScreen:function(w){var j=this;if(!e.supportsFullScreen)return this.setFullPage(w);if(e.isFullScreen()===w)return this;var oe={fullScreen:w,preventDefaultAction:!1};if(this.raiseEvent("pre-full-screen",oe),oe.preventDefaultAction)return this;if(w){if(this.setFullPage(!0),!this.isFullPage())return this;this.fullPageStyleWidth=this.element.style.width,this.fullPageStyleHeight=this.element.style.height,this.element.style.width="100%",this.element.style.height="100%";var pe=function(){var ce=e.isFullScreen();ce||(e.removeEvent(document,e.fullScreenEventName,pe),e.removeEvent(document,e.fullScreenErrorEventName,pe),j.setFullPage(!1),j.isFullPage()&&(j.element.style.width=j.fullPageStyleWidth,j.element.style.height=j.fullPageStyleHeight)),j.navigator&&j.viewport&&setTimeout(function(){j.navigator.update(j.viewport)}),j.raiseEvent("full-screen",{fullScreen:ce})};e.addEvent(document,e.fullScreenEventName,pe),e.addEvent(document,e.fullScreenErrorEventName,pe),e.requestFullScreen(document.body)}else e.exitFullScreen();return this},isVisible:function(){return this.container.style.visibility!=="hidden"},isFullScreen:function(){return e.isFullScreen()&&this.isFullPage()},setVisible:function(w){return this.container.style.visibility=w?"":"hidden",this.raiseEvent("visible",{visible:w}),this},addTiledImage:function(w){e.console.assert(w,"[Viewer.addTiledImage] options is required"),e.console.assert(w.tileSource,"[Viewer.addTiledImage] options.tileSource is required"),e.console.assert(!w.replace||w.index>-1&&w.index<this.world.getItemCount(),"[Viewer.addTiledImage] if options.replace is used, options.index must be a valid index in Viewer.world");var j=this;w.replace&&(w.replaceItem=j.world.getItemAt(w.index)),this._hideMessage(),w.placeholderFillStyle===void 0&&(w.placeholderFillStyle=this.placeholderFillStyle),w.opacity===void 0&&(w.opacity=this.opacity),w.preload===void 0&&(w.preload=this.preload),w.compositeOperation===void 0&&(w.compositeOperation=this.compositeOperation),w.crossOriginPolicy===void 0&&(w.crossOriginPolicy=w.tileSource.crossOriginPolicy!==void 0?w.tileSource.crossOriginPolicy:this.crossOriginPolicy),w.ajaxWithCredentials===void 0&&(w.ajaxWithCredentials=this.ajaxWithCredentials),w.loadTilesWithAjax===void 0&&(w.loadTilesWithAjax=this.loadTilesWithAjax),e.isPlainObject(w.ajaxHeaders)||(w.ajaxHeaders={});var oe={options:w};function pe(ge){for(var be=0;be<j._loadQueue.length;be++)if(j._loadQueue[be]===oe){j._loadQueue.splice(be,1);break}j._loadQueue.length===0&&ce(oe),j.raiseEvent("add-item-failed",ge),w.error&&w.error(ge)}function ce(ge){j.collectionMode&&(j.world.arrange({immediately:ge.options.collectionImmediately,rows:j.collectionRows,columns:j.collectionColumns,layout:j.collectionLayout,tileSize:j.collectionTileSize,tileMargin:j.collectionTileMargin}),j.world.setAutoRefigureSizes(!0))}function we(){for(var ge,be,Oe;j._loadQueue.length&&(ge=j._loadQueue[0]).tileSource;){if(j._loadQueue.splice(0,1),ge.options.replace){var de=j.world.getIndexOfItem(ge.options.replaceItem);de!==-1&&(ge.options.index=de),j.world.removeItem(ge.options.replaceItem)}be=new e.TiledImage({viewer:j,source:ge.tileSource,viewport:j.viewport,drawer:j.drawer,tileCache:j.tileCache,imageLoader:j.imageLoader,x:ge.options.x,y:ge.options.y,width:ge.options.width,height:ge.options.height,fitBounds:ge.options.fitBounds,fitBoundsPlacement:ge.options.fitBoundsPlacement,clip:ge.options.clip,placeholderFillStyle:ge.options.placeholderFillStyle,opacity:ge.options.opacity,preload:ge.options.preload,degrees:ge.options.degrees,flipped:ge.options.flipped,compositeOperation:ge.options.compositeOperation,springStiffness:j.springStiffness,animationTime:j.animationTime,minZoomImageRatio:j.minZoomImageRatio,wrapHorizontal:j.wrapHorizontal,wrapVertical:j.wrapVertical,immediateRender:j.immediateRender,blendTime:j.blendTime,alwaysBlend:j.alwaysBlend,minPixelRatio:j.minPixelRatio,smoothTileEdgesMinZoom:j.smoothTileEdgesMinZoom,iOSDevice:j.iOSDevice,crossOriginPolicy:ge.options.crossOriginPolicy,ajaxWithCredentials:ge.options.ajaxWithCredentials,loadTilesWithAjax:ge.options.loadTilesWithAjax,ajaxHeaders:ge.options.ajaxHeaders,debugMode:j.debugMode,subPixelRoundingForTransparency:j.subPixelRoundingForTransparency}),j.collectionMode&&j.world.setAutoRefigureSizes(!1),j.navigator&&(Oe=e.extend({},ge.options,{replace:!1,originalTiledImage:be,tileSource:ge.tileSource}),j.navigator.addTiledImage(Oe)),j.world.addItem(be,{index:ge.options.index}),j._loadQueue.length===0&&ce(ge),j.world.getItemCount()!==1||j.preserveViewport||j.viewport.goHome(!0),ge.options.success&&ge.options.success({item:be})}}e.isArray(w.tileSource)?setTimeout(function(){pe({message:"[Viewer.addTiledImage] Sequences can not be added; add them one at a time instead.",source:w.tileSource,options:w})}):(this._loadQueue.push(oe),function(ge,be,Oe,de,se){var Pe=ge;if(e.type(be)==="string"){if(be.match(/^\s*<.*>\s*$/))be=e.parseXml(be);else if(be.match(/^\s*[{[].*[}\]]\s*$/))try{var le=e.parseJSON(be);be=le}catch{}}function ye(me,Te){me.ready?de(me):(me.addHandler("ready",function(){de(me)}),me.addHandler("open-failed",function(De){se({message:De.message,source:Te})}))}setTimeout(function(){if(e.type(be)==="string")(be=new e.TileSource({url:be,crossOriginPolicy:Oe.crossOriginPolicy!==void 0?Oe.crossOriginPolicy:ge.crossOriginPolicy,ajaxWithCredentials:ge.ajaxWithCredentials,ajaxHeaders:Oe.ajaxHeaders?Oe.ajaxHeaders:ge.ajaxHeaders,splitHashDataForPost:ge.splitHashDataForPost,useCanvas:ge.useCanvas,success:function(tt){de(tt.tileSource)}})).addHandler("open-failed",function(tt){se(tt)});else if(e.isPlainObject(be)||be.nodeType)if(be.crossOriginPolicy!==void 0||Oe.crossOriginPolicy===void 0&&ge.crossOriginPolicy===void 0||(be.crossOriginPolicy=Oe.crossOriginPolicy!==void 0?Oe.crossOriginPolicy:ge.crossOriginPolicy),be.ajaxWithCredentials===void 0&&(be.ajaxWithCredentials=ge.ajaxWithCredentials),be.useCanvas===void 0&&(be.useCanvas=ge.useCanvas),e.isFunction(be.getTileUrl)){var me=new e.TileSource(be);me.getTileUrl=be.getTileUrl,de(me)}else{var Te=e.TileSource.determineType(Pe,be);if(!Te)return void se({message:"Unable to load TileSource",source:be});var De=Te.prototype.configure.apply(Pe,[be]);ye(new Te(De),be)}else ye(be,be)})}(this,w.tileSource,w,function(ge){oe.tileSource=ge,we()},function(ge){ge.options=w,pe(ge),we()}))},addSimpleImage:function(w){e.console.assert(w,"[Viewer.addSimpleImage] options is required"),e.console.assert(w.url,"[Viewer.addSimpleImage] options.url is required");var j=e.extend({},w,{tileSource:{type:"image",url:w.url}});delete j.url,this.addTiledImage(j)},addLayer:function(w){var j=this;e.console.error("[Viewer.addLayer] this function is deprecated; use Viewer.addTiledImage() instead.");var oe=e.extend({},w,{success:function(pe){j.raiseEvent("add-layer",{options:w,drawer:pe.item})},error:function(pe){j.raiseEvent("add-layer-failed",pe)}});return this.addTiledImage(oe),this},getLayerAtLevel:function(w){return e.console.error("[Viewer.getLayerAtLevel] this function is deprecated; use World.getItemAt() instead."),this.world.getItemAt(w)},getLevelOfLayer:function(w){return e.console.error("[Viewer.getLevelOfLayer] this function is deprecated; use World.getIndexOfItem() instead."),this.world.getIndexOfItem(w)},getLayersCount:function(){return e.console.error("[Viewer.getLayersCount] this function is deprecated; use World.getItemCount() instead."),this.world.getItemCount()},setLayerLevel:function(w,j){return e.console.error("[Viewer.setLayerLevel] this function is deprecated; use World.setItemIndex() instead."),this.world.setItemIndex(w,j)},removeLayer:function(w){return e.console.error("[Viewer.removeLayer] this function is deprecated; use World.removeItem() instead."),this.world.removeItem(w)},forceRedraw:function(){return t[this.hash].forceRedraw=!0,this},forceResize:function(){t[this.hash].needsResize=!0,t[this.hash].forceResize=!0},bindSequenceControls:function(){var w=e.delegate(this,S),j=e.delegate(this,O),oe=e.delegate(this,this.goToNextPage),pe=e.delegate(this,this.goToPreviousPage),ce=this.navImages,we=!0;return this.showSequenceControl&&((this.previousButton||this.nextButton)&&(we=!1),this.previousButton=new e.Button({element:this.previousButton?e.getElement(this.previousButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.PreviousPage"),srcRest:Re(this.prefixUrl,ce.previous.REST),srcGroup:Re(this.prefixUrl,ce.previous.GROUP),srcHover:Re(this.prefixUrl,ce.previous.HOVER),srcDown:Re(this.prefixUrl,ce.previous.DOWN),onRelease:pe,onFocus:w,onBlur:j}),this.nextButton=new e.Button({element:this.nextButton?e.getElement(this.nextButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.NextPage"),srcRest:Re(this.prefixUrl,ce.next.REST),srcGroup:Re(this.prefixUrl,ce.next.GROUP),srcHover:Re(this.prefixUrl,ce.next.HOVER),srcDown:Re(this.prefixUrl,ce.next.DOWN),onRelease:oe,onFocus:w,onBlur:j}),this.navPrevNextWrap||this.previousButton.disable(),this.tileSources&&this.tileSources.length||this.nextButton.disable(),we&&(this.paging=new e.ButtonGroup({buttons:[this.previousButton,this.nextButton],clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.pagingControl=this.paging.element,this.toolbar?this.toolbar.addControl(this.pagingControl,{anchor:e.ControlAnchor.BOTTOM_RIGHT}):this.addControl(this.pagingControl,{anchor:this.sequenceControlAnchor||e.ControlAnchor.TOP_LEFT}))),this},bindStandardControls:function(){var w=e.delegate(this,ot),j=e.delegate(this,Ke),oe=e.delegate(this,ft),pe=e.delegate(this,Qe),ce=e.delegate(this,Ge),we=e.delegate(this,vt),ge=e.delegate(this,Xe),be=e.delegate(this,rt),Oe=e.delegate(this,Je),de=e.delegate(this,et),se=e.delegate(this,S),Pe=e.delegate(this,O),le=this.navImages,ye=[],me=!0;return this.showNavigationControl&&((this.zoomInButton||this.zoomOutButton||this.homeButton||this.fullPageButton||this.rotateLeftButton||this.rotateRightButton||this.flipButton)&&(me=!1),this.showZoomControl&&(ye.push(this.zoomInButton=new e.Button({element:this.zoomInButton?e.getElement(this.zoomInButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomIn"),srcRest:Re(this.prefixUrl,le.zoomIn.REST),srcGroup:Re(this.prefixUrl,le.zoomIn.GROUP),srcHover:Re(this.prefixUrl,le.zoomIn.HOVER),srcDown:Re(this.prefixUrl,le.zoomIn.DOWN),onPress:w,onRelease:j,onClick:oe,onEnter:w,onExit:j,onFocus:se,onBlur:Pe})),ye.push(this.zoomOutButton=new e.Button({element:this.zoomOutButton?e.getElement(this.zoomOutButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomOut"),srcRest:Re(this.prefixUrl,le.zoomOut.REST),srcGroup:Re(this.prefixUrl,le.zoomOut.GROUP),srcHover:Re(this.prefixUrl,le.zoomOut.HOVER),srcDown:Re(this.prefixUrl,le.zoomOut.DOWN),onPress:pe,onRelease:j,onClick:ce,onEnter:pe,onExit:j,onFocus:se,onBlur:Pe}))),this.showHomeControl&&ye.push(this.homeButton=new e.Button({element:this.homeButton?e.getElement(this.homeButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Home"),srcRest:Re(this.prefixUrl,le.home.REST),srcGroup:Re(this.prefixUrl,le.home.GROUP),srcHover:Re(this.prefixUrl,le.home.HOVER),srcDown:Re(this.prefixUrl,le.home.DOWN),onRelease:we,onFocus:se,onBlur:Pe})),this.showFullPageControl&&ye.push(this.fullPageButton=new e.Button({element:this.fullPageButton?e.getElement(this.fullPageButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.FullPage"),srcRest:Re(this.prefixUrl,le.fullpage.REST),srcGroup:Re(this.prefixUrl,le.fullpage.GROUP),srcHover:Re(this.prefixUrl,le.fullpage.HOVER),srcDown:Re(this.prefixUrl,le.fullpage.DOWN),onRelease:ge,onFocus:se,onBlur:Pe})),this.showRotationControl&&(ye.push(this.rotateLeftButton=new e.Button({element:this.rotateLeftButton?e.getElement(this.rotateLeftButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateLeft"),srcRest:Re(this.prefixUrl,le.rotateleft.REST),srcGroup:Re(this.prefixUrl,le.rotateleft.GROUP),srcHover:Re(this.prefixUrl,le.rotateleft.HOVER),srcDown:Re(this.prefixUrl,le.rotateleft.DOWN),onRelease:be,onFocus:se,onBlur:Pe})),ye.push(this.rotateRightButton=new e.Button({element:this.rotateRightButton?e.getElement(this.rotateRightButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateRight"),srcRest:Re(this.prefixUrl,le.rotateright.REST),srcGroup:Re(this.prefixUrl,le.rotateright.GROUP),srcHover:Re(this.prefixUrl,le.rotateright.HOVER),srcDown:Re(this.prefixUrl,le.rotateright.DOWN),onRelease:Oe,onFocus:se,onBlur:Pe}))),this.showFlipControl&&ye.push(this.flipButton=new e.Button({element:this.flipButton?e.getElement(this.flipButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Flip"),srcRest:Re(this.prefixUrl,le.flip.REST),srcGroup:Re(this.prefixUrl,le.flip.GROUP),srcHover:Re(this.prefixUrl,le.flip.HOVER),srcDown:Re(this.prefixUrl,le.flip.DOWN),onRelease:de,onFocus:se,onBlur:Pe})),me?(this.buttonGroup=new e.ButtonGroup({buttons:ye,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.navControl=this.buttonGroup.element,this.addHandler("open",e.delegate(this,dt)),this.toolbar?this.toolbar.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT}):this.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT})):this.customButtons=ye),this},currentPage:function(){return this._sequenceIndex},goToPage:function(w){return this.tileSources&&w>=0&&w<this.tileSources.length&&(this._sequenceIndex=w,this._updateSequenceButtons(w),this.open(this.tileSources[w]),this.referenceStrip&&this.referenceStrip.setFocus(w),this.raiseEvent("page",{page:w})),this},addOverlay:function(w,j,oe,pe){var ce;if(ce=e.isPlainObject(w)?w:{element:w,location:j,placement:oe,onDraw:pe},w=e.getElement(ce.element),o(this.currentOverlays,w)>=0)return this;var we=n(this,ce);return this.currentOverlays.push(we),we.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:w,location:ce.location,placement:ce.placement}),this},updateOverlay:function(w,j,oe){var pe;return w=e.getElement(w),(pe=o(this.currentOverlays,w))>=0&&(this.currentOverlays[pe].update(j,oe),t[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:w,location:j,placement:oe})),this},removeOverlay:function(w){var j;return w=e.getElement(w),(j=o(this.currentOverlays,w))>=0&&(this.currentOverlays[j].destroy(),this.currentOverlays.splice(j,1),t[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:w})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return t[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(w){var j;return w=e.getElement(w),(j=o(this.currentOverlays,w))>=0?this.currentOverlays[j]:null},_updateSequenceButtons:function(w){this.nextButton&&(this.tileSources&&this.tileSources.length-1!==w?this.nextButton.enable():this.navPrevNextWrap||this.nextButton.disable()),this.previousButton&&(w>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(w){this._hideMessage();var j=e.makeNeutralElement("div");j.appendChild(document.createTextNode(w)),this.messageDiv=e.makeCenteredNode(j),e.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var w=this.messageDiv;w&&(w.parentNode.removeChild(w),delete this.messageDiv)},gestureSettingsByDeviceType:function(w){switch(w){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var w,j=this.currentOverlays.length;for(w=0;w<j;w++)this.currentOverlays[w].drawHTML(this.overlaysContainer,this.viewport)},_cancelPendingImages:function(){this._loadQueue=[]},removeReferenceStrip:function(){this.showReferenceStrip=!1,this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null)},addReferenceStrip:function(){if(this.showReferenceStrip=!0,this.sequenceMode){if(this.referenceStrip)return;this.tileSources.length&&this.tileSources.length>1&&(this.referenceStrip=new e.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else e.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),e.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){e.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var w=e.pixelDensityRatio,j=e.getCurrentPixelDensityRatio();w!==j&&(e.pixelDensityRatio=j,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var w=this._sequenceIndex-1;this.navPrevNextWrap&&w<0&&(w+=this.tileSources.length),this.goToPage(w)},goToNextPage:function(){var w=this._sequenceIndex+1;this.navPrevNextWrap&&w>=this.tileSources.length&&(w=0),this.goToPage(w)},isAnimating:function(){return t[this.hash].animating}})}(b),function(e){function t(c){var m={tracker:c.eventSource,position:c.position,quick:c.quick,shift:c.shift,originalEvent:c.originalEvent,preventDefaultAction:!1};if(this.viewer.raiseEvent("navigator-click",m),!m.preventDefaultAction&&c.quick&&this.viewer.viewport&&(this.panVertical||this.panHorizontal)){this.viewer.viewport.flipped&&(c.position.x=this.viewport.getContainerSize().x-c.position.x);var _=this.viewport.pointFromPixel(c.position);this.panVertical?this.panHorizontal||(_.x=this.viewer.viewport.getCenter(!0).x):_.y=this.viewer.viewport.getCenter(!0).y,this.viewer.viewport.panTo(_),this.viewer.viewport.applyConstraints()}}function i(c){var m={tracker:c.eventSource,position:c.position,delta:c.delta,speed:c.speed,direction:c.direction,shift:c.shift,originalEvent:c.originalEvent,preventDefaultAction:!1};this.viewer.raiseEvent("navigator-drag",m),!m.preventDefaultAction&&this.viewer.viewport&&(this.panHorizontal||(c.delta.x=0),this.panVertical||(c.delta.y=0),this.viewer.viewport.flipped&&(c.delta.x=-c.delta.x),this.viewer.viewport.panBy(this.viewport.deltaPointsFromPixels(c.delta)),this.viewer.constrainDuringPan&&this.viewer.viewport.applyConstraints())}function u(c){c.insideElementPressed&&this.viewer.viewport&&this.viewer.viewport.applyConstraints()}function n(c){var m={tracker:c.eventSource,position:c.position,scroll:c.scroll,shift:c.shift,originalEvent:c.originalEvent,preventDefault:c.preventDefault};this.viewer.raiseEvent("navigator-scroll",m),c.preventDefault=m.preventDefault}function o(c,m){s(c,"rotate("+m+"deg)")}function s(c,m){c.style.webkitTransform=m,c.style.mozTransform=m,c.style.msTransform=m,c.style.oTransform=m,c.style.transform=m}e.Navigator=function(c){var m,_,S,O,N=c.viewer,B=this;function U(W,H){o(B.displayRegionContainer,W),o(B.displayRegion,-W),B.viewport.setRotation(W,H)}c.element||c.id?(c.element?(c.id&&e.console.warn("Given option.id for Navigator was ignored since option.element was provided and is being used instead."),c.element.id?c.id=c.element.id:c.id="navigator-"+e.now(),this.element=c.element):this.element=document.getElementById(c.id),c.controlOptions={anchor:e.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(c.id="navigator-"+e.now(),this.element=e.makeNeutralElement("div"),c.controlOptions={anchor:e.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:c.autoFade},c.position&&(c.position==="BOTTOM_RIGHT"?c.controlOptions.anchor=e.ControlAnchor.BOTTOM_RIGHT:c.position==="BOTTOM_LEFT"?c.controlOptions.anchor=e.ControlAnchor.BOTTOM_LEFT:c.position==="TOP_RIGHT"?c.controlOptions.anchor=e.ControlAnchor.TOP_RIGHT:c.position==="TOP_LEFT"?c.controlOptions.anchor=e.ControlAnchor.TOP_LEFT:c.position==="ABSOLUTE"&&(c.controlOptions.anchor=e.ControlAnchor.ABSOLUTE,c.controlOptions.top=c.top,c.controlOptions.left=c.left,c.controlOptions.height=c.height,c.controlOptions.width=c.width))),this.element.id=c.id,this.element.className+=" navigator",(c=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.navigatorSizeRatio},c,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:c.animationTime,autoResize:!1,minZoomImageRatio:1,background:c.background,opacity:c.opacity,borderColor:c.borderColor,displayRegionColor:c.displayRegionColor})).minPixelRatio=this.minPixelRatio=N.minPixelRatio,e.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new e.Point(1,1),this.totalBorderWidths=new e.Point(2*this.borderWidth,2*this.borderWidth).minus(this.fudge),c.controlOptions.anchor!==e.ControlAnchor.NONE&&(S=this.element.style,O=this.borderWidth,S.margin="0px",S.border=O+"px solid "+c.borderColor,S.padding="0px",S.background=c.background,S.opacity=c.opacity,S.overflow="hidden"),this.displayRegion=e.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(W,H){W.position="relative",W.top="0px",W.left="0px",W.fontSize="0px",W.overflow="hidden",W.border=H+"px solid "+c.displayRegionColor,W.margin="0px",W.padding="0px",W.background="transparent",W.float="left",W.cssFloat="left",W.styleFloat="left",W.zIndex=999999999,W.cursor="default",W.boxSizing="content-box"}(this.displayRegion.style,this.borderWidth),e.setElementPointerEventsNone(this.displayRegion),e.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=e.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",e.setElementPointerEventsNone(this.displayRegionContainer),e.setElementTouchActionNone(this.displayRegionContainer),N.addControl(this.element,c.controlOptions),this._resizeWithViewer=c.controlOptions.anchor!==e.ControlAnchor.ABSOLUTE&&c.controlOptions.anchor!==e.ControlAnchor.NONE,c.width&&c.height?(this.setWidth(c.width),this.setHeight(c.height)):this._resizeWithViewer&&(m=e.getElementSize(N.element),this.element.style.height=Math.round(m.y*c.sizeRatio)+"px",this.element.style.width=Math.round(m.x*c.sizeRatio)+"px",this.oldViewerSize=m,_=e.getElementSize(this.element),this.elementArea=_.x*_.y),this.oldContainerSize=new e.Point(0,0),e.Viewer.apply(this,[c]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer),c.navigatorRotate&&(U(c.viewer.viewport?c.viewer.viewport.getRotation():c.viewer.degrees||0,!0),c.viewer.addHandler("rotate",function(W){U(W.degrees,W.immediately)})),this.innerTracker.destroy(),this.innerTracker=new e.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:e.delegate(this,i),clickHandler:e.delegate(this,t),releaseHandler:e.delegate(this,u),scrollHandler:e.delegate(this,n),preProcessEventHandler:function(W){W.eventType==="wheel"&&(W.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",e.setElementPointerEventsNone(this.canvas),e.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){B.viewport&&B.viewport.goHome(!0)}),N.world.addHandler("item-index-change",function(W){window.setTimeout(function(){var H=B.world.getItemAt(W.previousIndex);B.world.setItemIndex(H,W.newIndex)},1)}),N.world.addHandler("remove-item",function(W){var H=W.item,$=B._getMatchingItem(H);$&&B.world.removeItem($)}),this.update(N.viewport)},e.extend(e.Navigator.prototype,e.EventSource.prototype,e.Viewer.prototype,{updateSize:function(){if(this.viewport){var c=new e.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);c.equals(this.oldContainerSize)||(this.viewport.resize(c,!0),this.viewport.goHome(!0),this.oldContainerSize=c,this.drawer.clear(),this.world.draw())}},setWidth:function(c){this.width=c,this.element.style.width=typeof c=="number"?c+"px":c,this._resizeWithViewer=!1,this.updateSize()},setHeight:function(c){this.height=c,this.element.style.height=typeof c=="number"?c+"px":c,this._resizeWithViewer=!1,this.updateSize()},setFlip:function(c){return this.viewport.setFlip(c),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(c){s(this.displayRegion,c),s(this.canvas,c),s(this.element,c)},update:function(c){var m,_,S,O,N,B;if(m=e.getElementSize(this.viewer.element),this._resizeWithViewer&&m.x&&m.y&&!m.equals(this.oldViewerSize)&&(this.oldViewerSize=m,this.maintainSizeRatio||!this.elementArea?(_=m.x*this.sizeRatio,S=m.y*this.sizeRatio):(_=Math.sqrt(this.elementArea*(m.x/m.y)),S=this.elementArea/_),this.element.style.width=Math.round(_)+"px",this.element.style.height=Math.round(S)+"px",this.elementArea||(this.elementArea=_*S),this.updateSize()),c&&this.viewport){if(O=c.getBoundsNoRotate(!0),N=this.viewport.pixelFromPointNoRotate(O.getTopLeft(),!1),B=this.viewport.pixelFromPointNoRotate(O.getBottomRight(),!1).minus(this.totalBorderWidths),!this.navigatorRotate){var U=c.getRotation(!0);o(this.displayRegion,-U)}var W=this.displayRegion.style;W.display=this.world.getItemCount()?"block":"none",W.top=N.y.toFixed(2)+"px",W.left=N.x.toFixed(2)+"px";var H=B.x-N.x,$=B.y-N.y;W.width=Math.round(Math.max(H,0))+"px",W.height=Math.round(Math.max($,0))+"px"}},addTiledImage:function(c){var m=this,_=c.originalTiledImage;delete c.original;var S=e.extend({},c,{success:function(O){var N=O.item;function B(){m._matchBounds(N,_)}N._originalForNavigator=_,m._matchBounds(N,_,!0),m._matchOpacity(N,_),m._matchCompositeOperation(N,_),_.addHandler("bounds-change",B),_.addHandler("clip-change",B),_.addHandler("opacity-change",function(){m._matchOpacity(N,_)}),_.addHandler("composite-operation-change",function(){m._matchCompositeOperation(N,_)})}});return e.Viewer.prototype.addTiledImage.apply(this,[S])},destroy:function(){return e.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(c){for(var m,_=this.world.getItemCount(),S=0;S<_;S++)if((m=this.world.getItemAt(S))._originalForNavigator===c)return m;return null},_matchBounds:function(c,m,_){var S=m.getBoundsNoRotate();c.setPosition(S.getTopLeft(),_),c.setWidth(S.width,_),c.setRotation(m.getRotation(),_),c.setClip(m.getClip()),c.setFlip(m.getFlip())},_matchOpacity:function(c,m){c.setOpacity(m.opacity)},_matchCompositeOperation:function(c,m){c.setCompositeOperation(m.compositeOperation)}})}(b),function(e){var t={Errors:{Dzc:"Sorry, we don't support Deep Zoom Collections!",Dzi:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",Xml:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",ImageFormat:"Sorry, we don't support {0}-based Deep Zoom Images.",Security:"It looks like a security restriction stopped us from loading this Deep Zoom Image.",Status:"This space unintentionally left blank ({0} {1}).",OpenFailed:"Unable to open {0}: {1}"},Tooltips:{FullPage:"Toggle full page",Home:"Go home",ZoomIn:"Zoom in",ZoomOut:"Zoom out",NextPage:"Next page",PreviousPage:"Previous page",RotateLeft:"Rotate left",RotateRight:"Rotate right",Flip:"Flip Horizontally"}};e.extend(e,{getString:function(i){var u,n=i.split("."),o=null,s=arguments,c=t;for(u=0;u<n.length-1;u++)c=c[n[u]]||{};return typeof(o=c[n[u]])!="string"&&(e.console.error("Untranslated source string:",i),o=""),o.replace(/\{\d+\}/g,function(m){var _=parseInt(m.match(/\d+/),10)+1;return _<s.length?s[_]:""})},setString:function(i,u){var n,o=i.split("."),s=t;for(n=0;n<o.length-1;n++)s[o[n]]||(s[o[n]]={}),s=s[o[n]];s[o[n]]=u}})}(b),function(e){e.Point=function(t,i){this.x=typeof t=="number"?t:0,this.y=typeof i=="number"?i:0},e.Point.prototype={clone:function(){return new e.Point(this.x,this.y)},plus:function(t){return new e.Point(this.x+t.x,this.y+t.y)},minus:function(t){return new e.Point(this.x-t.x,this.y-t.y)},times:function(t){return new e.Point(this.x*t,this.y*t)},divide:function(t){return new e.Point(this.x/t,this.y/t)},negate:function(){return new e.Point(-this.x,-this.y)},distanceTo:function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},squaredDistanceTo:function(t){return Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2)},apply:function(t){return new e.Point(t(this.x),t(this.y))},equals:function(t){return t instanceof e.Point&&this.x===t.x&&this.y===t.y},rotate:function(t,i){var u,n;if(i=i||new e.Point(0,0),t%90==0)switch(e.positiveModulo(t,360)){case 0:u=1,n=0;break;case 90:u=0,n=1;break;case 180:u=-1,n=0;break;case 270:u=0,n=-1}else{var o=t*Math.PI/180;u=Math.cos(o),n=Math.sin(o)}var s=u*(this.x-i.x)-n*(this.y-i.y)+i.x,c=n*(this.x-i.x)+u*(this.y-i.y)+i.y;return new e.Point(s,c)},toString:function(){return"("+Math.round(100*this.x)/100+","+Math.round(100*this.y)/100+")"}}}(b),function(e){e.TileSource=function(t,i,u,n,o,s){var c,m,_=this,S=arguments;if(c=e.isPlainObject(t)?t:{width:S[0],height:S[1],tileSize:S[2],tileOverlap:S[3],minLevel:S[4],maxLevel:S[5]},e.EventSource.call(this),e.extend(!0,this,c),!this.success){for(m=0;m<arguments.length;m++)if(e.isFunction(arguments[m])){this.success=arguments[m];break}}this.success&&this.addHandler("ready",function(O){_.success(O)}),e.type(arguments[0])==="string"&&(this.url=arguments[0]),this.url?(this.aspectRatio=1,this.dimensions=new e.Point(10,10),this._tileWidth=0,this._tileHeight=0,this.tileOverlap=0,this.minLevel=0,this.maxLevel=0,this.ready=!1,this.getImageInfo(this.url)):(this.ready=!0,this.aspectRatio=c.width&&c.height?c.width/c.height:1,this.dimensions=new e.Point(c.width,c.height),this.tileSize?(this._tileWidth=this._tileHeight=this.tileSize,delete this.tileSize):(this.tileWidth?(this._tileWidth=this.tileWidth,delete this.tileWidth):this._tileWidth=0,this.tileHeight?(this._tileHeight=this.tileHeight,delete this.tileHeight):this._tileHeight=0),this.tileOverlap=c.tileOverlap?c.tileOverlap:0,this.minLevel=c.minLevel?c.minLevel:0,this.maxLevel=c.maxLevel!==void 0&&c.maxLevel!==null?c.maxLevel:c.width&&c.height?Math.ceil(Math.log(Math.max(c.width,c.height))/Math.log(2)):0,this.success&&e.isFunction(this.success)&&this.success(this))},e.TileSource.prototype={getTileSize:function(t){return e.console.error("[TileSource.getTileSize] is deprecated. Use TileSource.getTileWidth() and TileSource.getTileHeight() instead"),this._tileWidth},getTileWidth:function(t){return this._tileWidth?this._tileWidth:this.getTileSize(t)},getTileHeight:function(t){return this._tileHeight?this._tileHeight:this.getTileSize(t)},setMaxLevel:function(t){this.maxLevel=t,this._memoizeLevelScale()},getLevelScale:function(t){return this._memoizeLevelScale(),this.getLevelScale(t)},_memoizeLevelScale:function(){var t,i={};for(t=0;t<=this.maxLevel;t++)i[t]=1/Math.pow(2,this.maxLevel-t);this.getLevelScale=function(u){return i[u]}},getNumTiles:function(t){var i=this.getLevelScale(t),u=Math.ceil(i*this.dimensions.x/this.getTileWidth(t)),n=Math.ceil(i*this.dimensions.y/this.getTileHeight(t));return new e.Point(u,n)},getPixelRatio:function(t){var i=this.dimensions.times(this.getLevelScale(t)),u=1/i.x*e.pixelDensityRatio,n=1/i.y*e.pixelDensityRatio;return new e.Point(u,n)},getClosestLevel:function(){var t,i;for(t=this.minLevel+1;t<=this.maxLevel&&!((i=this.getNumTiles(t)).x>1||i.y>1);t++);return t-1},getTileAtPoint:function(t,i){var u=i.x>=0&&i.x<=1&&i.y>=0&&i.y<=1/this.aspectRatio;e.console.assert(u,"[TileSource.getTileAtPoint] must be called with a valid point.");var n=this.dimensions.x*this.getLevelScale(t),o=i.x*n,s=i.y*n,c=Math.floor(o/this.getTileWidth(t)),m=Math.floor(s/this.getTileHeight(t));return i.x>=1&&(c=this.getNumTiles(t).x-1),i.y>=1/this.aspectRatio-1e-15&&(m=this.getNumTiles(t).y-1),new e.Point(c,m)},getTileBounds:function(t,i,u,n){var o=this.dimensions.times(this.getLevelScale(t)),s=this.getTileWidth(t),c=this.getTileHeight(t),m=i===0?0:s*i-this.tileOverlap,_=u===0?0:c*u-this.tileOverlap,S=s+(i===0?1:2)*this.tileOverlap,O=c+(u===0?1:2)*this.tileOverlap,N=1/o.x;return S=Math.min(S,o.x-m),O=Math.min(O,o.y-_),n?new e.Rect(0,0,S,O):new e.Rect(m*N,_*N,S*N,O*N)},getImageInfo:function(t){var i,u,n,o,s,c,m,_=this;t&&(m=(c=(s=t.split("/"))[s.length-1]).lastIndexOf("."))>-1&&(s[s.length-1]=c.slice(0,m));var S=null;if(this.splitHashDataForPost){var O=t.indexOf("#");O!==-1&&(S=t.substring(O+1),t=t.substr(0,O))}u=function(N){typeof N=="string"&&(N=e.parseXml(N));var B=e.TileSource.determineType(_,N,t);B?((o=B.prototype.configure.apply(_,[N,t,S])).ajaxWithCredentials===void 0&&(o.ajaxWithCredentials=_.ajaxWithCredentials),n=new B(o),_.ready=!0,_.raiseEvent("ready",{tileSource:n})):_.raiseEvent("open-failed",{message:"Unable to load TileSource",source:t})},t.match(/\.js$/)?(i=t.split("/").pop().replace(".js",""),e.jsonp({url:t,async:!1,callbackName:i,callback:u})):e.makeAjaxRequest({url:t,postData:S,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(N){var B=function(U){var W,H,$=U.responseText,K=U.status;if(!U)throw new Error(e.getString("Errors.Security"));if(U.status!==200&&U.status!==0)throw W=(K=U.status)===404?"Not Found":U.statusText,new Error(e.getString("Errors.Status",K,W));if($.match(/^\s*<.*/))try{H=U.responseXML&&U.responseXML.documentElement?U.responseXML:e.parseXml($)}catch{H=U.responseText}else if($.match(/\s*[{[].*/))try{H=e.parseJSON($)}catch{H=$}else H=$;return H}(N);u(B)},error:function(N,B){var U;try{U="HTTP "+N.status+" attempting to load TileSource: "+t}catch{U=(B!==void 0&&B.toString?B.toString():"Unknown error")+" attempting to load TileSource: "+t}e.console.error(U),_.raiseEvent("open-failed",{message:U,source:t,postData:S})}})},supports:function(t,i){return!1},configure:function(t,i,u){throw new Error("Method not implemented.")},getTileUrl:function(t,i,u){throw new Error("Method not implemented.")},getTilePostData:function(t,i,u){return null},getTileAjaxHeaders:function(t,i,u){return{}},getTileHashKey:function(t,i,u,n,o,s){function c(m){return o?m+"+"+JSON.stringify(o):m}return c(typeof n!="string"?t+"/"+i+"_"+u:n)},tileExists:function(t,i,u){var n=this.getNumTiles(t);return t>=this.minLevel&&t<=this.maxLevel&&i>=0&&u>=0&&i<n.x&&u<n.y},hasTransparency:function(t,i,u,n){return!!t||i.match(".png")},downloadTileStart:function(t){var i=t.userData,u=new Image;i.image=u,i.request=null;var n=function(o){u?(u.onload=u.onerror=u.onabort=null,t.finish(o?null:u,i.request,o)):t.finish(null,i.request,"Image load failed: undefined Image instance.")};u.onload=function(){n()},u.onabort=u.onerror=function(){n("Image load aborted.")},t.loadWithAjax?i.request=e.makeAjaxRequest({url:t.src,withCredentials:t.ajaxWithCredentials,headers:t.ajaxHeaders,responseType:"arraybuffer",postData:t.postData,success:function(o){var s;try{s=new window.Blob([o.response])}catch(_){var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(_.name==="TypeError"&&c){var m=new c;m.append(o.response),s=m.getBlob()}}s.size===0?n("Empty image response."):u.src=(window.URL||window.webkitURL).createObjectURL(s)},error:function(o){n("Image load aborted - XHR error")}}):(t.crossOriginPolicy!==!1&&(u.crossOrigin=t.crossOriginPolicy),u.src=t.src)},downloadTileAbort:function(t){t.userData.request&&t.userData.request.abort();var i=t.userData.image;t.userData.image&&(i.onload=i.onerror=i.onabort=null)},createTileCache:function(t,i,u){t._data=i},destroyTileCache:function(t){t._data=null,t._renderedContext=null},getTileCacheData:function(t){return t._data},getTileCacheDataAsImage:function(t){return t._data},getTileCacheDataAsContext2D:function(t){if(!t._renderedContext){var i=document.createElement("canvas");i.width=t._data.width,i.height=t._data.height,t._renderedContext=i.getContext("2d"),t._renderedContext.drawImage(t._data,0,0),t._data=null;const u=i.cloneNode(!0);t._copyRenderedContext=u.getContext("2d"),t._copyRenderedContext.drawImage(i,0,0)}return t._renderedContext},getCopyTileCacheDataAsContext2D:function(t){return t._copyRenderedContext||t._renderedContext}},e.extend(!0,e.TileSource.prototype,e.EventSource.prototype),e.TileSource.determineType=function(t,i,u){var n;for(n in b)if(n.match(/.+TileSource$/)&&e.isFunction(b[n])&&e.isFunction(b[n].prototype.supports)&&b[n].prototype.supports.call(t,i,u))return b[n];return e.console.error("No TileSource was able to open %s %s",u,i),null}}(b),function(e){function t(i,u){var n,o,s=u.Image,c=s.Url,m=s.Format,_=s.Size,S=s.DisplayRect||[],O=parseInt(_.Width,10),N=parseInt(_.Height,10),B=parseInt(s.TileSize,10),U=parseInt(s.Overlap,10),W=[];for(o=0;o<S.length;o++)n=S[o].Rect,W.push(new e.DisplayRect(parseInt(n.X,10),parseInt(n.Y,10),parseInt(n.Width,10),parseInt(n.Height,10),parseInt(n.MinLevel,10),parseInt(n.MaxLevel,10)));return e.extend(!0,{width:O,height:N,tileSize:B,tileOverlap:U,minLevel:null,maxLevel:null,tilesUrl:c,fileFormat:m,displayRects:W},u)}e.DziTileSource=function(i,u,n,o,s,c,m,_,S){var O,N,B,U;if(U=e.isPlainObject(i)?i:{width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4],fileFormat:arguments[5],displayRects:arguments[6],minLevel:arguments[7],maxLevel:arguments[8]},this._levelRects={},this.tilesUrl=U.tilesUrl,this.fileFormat=U.fileFormat,this.displayRects=U.displayRects,this.displayRects)for(O=this.displayRects.length-1;O>=0;O--)for(B=(N=this.displayRects[O]).minLevel;B<=N.maxLevel;B++)this._levelRects[B]||(this._levelRects[B]=[]),this._levelRects[B].push(N);e.TileSource.apply(this,[U])},e.extend(e.DziTileSource.prototype,e.TileSource.prototype,{supports:function(i,u){var n;return i.Image?n=i.Image.xmlns:i.documentElement&&(i.documentElement.localName!=="Image"&&i.documentElement.tagName!=="Image"||(n=i.documentElement.namespaceURI)),(n=(n||"").toLowerCase()).indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||n.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(i,u,n){var o;return o=e.isPlainObject(i)?t(this,i):function(s,c){if(!c||!c.documentElement)throw new Error(e.getString("Errors.Xml"));var m,_,S,O,N,B=c.documentElement,U=B.localName||B.tagName,W=c.documentElement.namespaceURI,H=null,$=[];if(U==="Image")try{if((O=B.getElementsByTagName("Size")[0])===void 0&&(O=B.getElementsByTagNameNS(W,"Size")[0]),H={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:B.getAttribute("Url"),Format:B.getAttribute("Format"),DisplayRect:null,Overlap:parseInt(B.getAttribute("Overlap"),10),TileSize:parseInt(B.getAttribute("TileSize"),10),Size:{Height:parseInt(O.getAttribute("Height"),10),Width:parseInt(O.getAttribute("Width"),10)}}},!e.imageFormatSupported(H.Image.Format))throw new Error(e.getString("Errors.ImageFormat",H.Image.Format.toUpperCase()));for((m=B.getElementsByTagName("DisplayRect"))===void 0&&(m=B.getElementsByTagNameNS(W,"DisplayRect")[0]),N=0;N<m.length;N++)(S=(_=m[N]).getElementsByTagName("Rect")[0])===void 0&&(S=_.getElementsByTagNameNS(W,"Rect")[0]),$.push({Rect:{X:parseInt(S.getAttribute("X"),10),Y:parseInt(S.getAttribute("Y"),10),Width:parseInt(S.getAttribute("Width"),10),Height:parseInt(S.getAttribute("Height"),10),MinLevel:parseInt(_.getAttribute("MinLevel"),10),MaxLevel:parseInt(_.getAttribute("MaxLevel"),10)}});return $.length&&(H.Image.DisplayRect=$),t(s,H)}catch(Q){throw Q instanceof Error?Q:new Error(e.getString("Errors.Dzi"))}else{if(U==="Collection")throw new Error(e.getString("Errors.Dzc"));if(U==="Error"){var K=B.getElementsByTagName("Message")[0].firstChild.nodeValue;throw new Error(K)}}throw new Error(e.getString("Errors.Dzi"))}(this,i),u&&!o.tilesUrl&&(o.tilesUrl=u.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),u.search(/\.(dzi|xml|js)\?/)!==-1?o.queryParams=u.match(/\?.*/):o.queryParams=""),o},getTileUrl:function(i,u,n){return[this.tilesUrl,i,"/",u,"_",n,".",this.fileFormat,this.queryParams].join("")},tileExists:function(i,u,n){var o,s,c,m,_,S,O,N=this._levelRects[i];if(this.minLevel&&i<this.minLevel||this.maxLevel&&i>this.maxLevel)return!1;if(!N||!N.length)return!0;for(O=N.length-1;O>=0;O--)if(!(i<(o=N[O]).minLevel||i>o.maxLevel)&&(s=this.getLevelScale(i),c=o.x*s,m=o.y*s,_=c+o.width*s,S=m+o.height*s,c=Math.floor(c/this._tileWidth),m=Math.floor(m/this._tileWidth),_=Math.ceil(_/this._tileWidth),S=Math.ceil(S/this._tileWidth),c<=u&&u<_&&m<=n&&n<S))return!0;return!1}})}(b),function(e){function t(n){var o=Array.isArray(n.profile)?n.profile[0]:n.profile,s=["http://library.stanford.edu/iiif/image-api/compliance.html#level0","http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0","http://iiif.io/api/image/2/level0.json","level0","https://iiif.io/api/image/3/level0.json"].indexOf(o)!==-1,c=!1;return n.version===2&&n.profile.length>1&&n.profile[1].supports&&(c=n.profile[1].supports.indexOf("sizeByW")!==-1),n.version===3&&n.extraFeatures&&(c=n.extraFeatures.indexOf("sizeByWh")!==-1),!s||c}function i(n){for(var o=[],s=0;s<n.sizes.length;s++)o.push({url:n._id+"/full/"+n.sizes[s].width+","+(n.version===3?n.sizes[s].height:"")+"/0/default."+n.tileFormat,width:n.sizes[s].width,height:n.sizes[s].height});return o.sort(function(c,m){return c.width-m.width})}function u(n,o,s){var c,m;if(n.nodeType===3&&s)(m=n.nodeValue.trim()).match(/^\d*$/)&&(m=Number(m)),o[s]?(e.isArray(o[s])||(o[s]=[o[s]]),o[s].push(m)):o[s]=m;else if(n.nodeType===1)for(c=0;c<n.childNodes.length;c++)u(n.childNodes[c],o,n.nodeName)}e.IIIFTileSource=function(n){if(e.extend(!0,this,n),this._id=this["@id"]||this.id||this.identifier||null,!(this.height&&this.width&&this._id))throw new Error("IIIF required parameters (width, height, or id) not provided.");if(n.tileSizePerScaleFactor={},this.tileFormat=this.tileFormat||"jpg",this.version=n.version,this.tile_width&&this.tile_height)n.tileWidth=this.tile_width,n.tileHeight=this.tile_height;else if(this.tile_width)n.tileSize=this.tile_width;else if(this.tile_height)n.tileSize=this.tile_height;else if(this.tiles)if(this.tiles.length===1)n.tileWidth=this.tiles[0].width,n.tileHeight=this.tiles[0].height||this.tiles[0].width,this.scale_factors=this.tiles[0].scaleFactors;else{this.scale_factors=[];for(var o=0;o<this.tiles.length;o++)for(var s=0;s<this.tiles[o].scaleFactors.length;s++){var c=this.tiles[o].scaleFactors[s];this.scale_factors.push(c),n.tileSizePerScaleFactor[c]={width:this.tiles[o].width,height:this.tiles[o].height||this.tiles[o].width}}}else if(t(n)){for(var m=Math.min(this.height,this.width),_=[256,512,1024],S=[],O=0;O<_.length;O++)_[O]<=m&&S.push(_[O]);S.length>0?n.tileSize=Math.max.apply(null,S):n.tileSize=m}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,n.levels=i(this),e.extend(!0,n,{width:n.levels[n.levels.length-1].width,height:n.levels[n.levels.length-1].height,tileSize:Math.max(n.height,n.width),tileOverlap:0,minLevel:0,maxLevel:n.levels.length-1}),this.levels=n.levels):e.console.error("Nothing in the info.json to construct image pyramids from");if(!n.maxLevel&&!this.emulateLegacyImagePyramid)if(this.scale_factors){var N=Math.max.apply(null,this.scale_factors);n.maxLevel=Math.round(Math.log(N)*Math.LOG2E)}else n.maxLevel=Number(Math.round(Math.log(Math.max(this.width,this.height),2)));if(this.sizes){var B=this.sizes.length;B!==n.maxLevel&&B!==n.maxLevel+1||(this.levelSizes=this.sizes.slice().sort(function(U,W){return U.width-W.width}),B===n.maxLevel&&this.levelSizes.push({width:this.width,height:this.height}))}e.TileSource.apply(this,[n])},e.extend(e.IIIFTileSource.prototype,e.TileSource.prototype,{supports:function(n,o){return!(!n.protocol||n.protocol!=="http://iiif.io/api/image")||!(!n["@context"]||n["@context"]!=="http://library.stanford.edu/iiif/image-api/1.1/context.json"&&n["@context"]!=="http://iiif.io/api/image/1/context.json")||!(!n.profile||n.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")!==0)||!!(n.identifier&&n.width&&n.height)||!(!n.documentElement||n.documentElement.tagName!=="info"||n.documentElement.namespaceURI!=="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(n,o,s){if(e.isPlainObject(n)){if(n["@context"]){var c=n["@context"];if(Array.isArray(c)){for(var m=0;m<c.length;m++)if(typeof c[m]=="string"&&(/^http:\/\/iiif\.io\/api\/image\/[1-3]\/context\.json$/.test(c[m])||c[m]==="http://library.stanford.edu/iiif/image-api/1.1/context.json")){c=c[m];break}}switch(c){case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":n.version=1;break;case"http://iiif.io/api/image/2/context.json":n.version=2;break;case"http://iiif.io/api/image/3/context.json":n.version=3;break;default:e.console.error("Data has a @context property which contains no known IIIF context URI.")}}else n["@context"]="http://iiif.io/api/image/1.0/context.json",n["@id"]=o.replace("/info.json",""),n.version=1;if(n.preferredFormats){for(var _=0;_<n.preferredFormats.length;_++)if(b.imageFormatSupported(n.preferredFormats[_])){n.tileFormat=n.preferredFormats[_];break}}return n}var S=function(O){if(!O||!O.documentElement)throw new Error(e.getString("Errors.Xml"));var N=O.documentElement,B=N.tagName,U=null;if(B==="info")try{return u(N,U={}),U}catch(W){throw W instanceof Error?W:new Error(e.getString("Errors.IIIF"))}throw new Error(e.getString("Errors.IIIF"))}(n);return S["@context"]="http://iiif.io/api/image/1.0/context.json",S["@id"]=o.replace("/info.xml",""),S.version=1,S},getTileWidth:function(n){if(this.emulateLegacyImagePyramid)return e.TileSource.prototype.getTileWidth.call(this,n);var o=Math.pow(2,this.maxLevel-n);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[o]?this.tileSizePerScaleFactor[o].width:this._tileWidth},getTileHeight:function(n){if(this.emulateLegacyImagePyramid)return e.TileSource.prototype.getTileHeight.call(this,n);var o=Math.pow(2,this.maxLevel-n);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[o]?this.tileSizePerScaleFactor[o].height:this._tileHeight},getLevelScale:function(n){if(this.emulateLegacyImagePyramid){var o=NaN;return this.levels.length>0&&n>=this.minLevel&&n<=this.maxLevel&&(o=this.levels[n].width/this.levels[this.maxLevel].width),o}return e.TileSource.prototype.getLevelScale.call(this,n)},getNumTiles:function(n){if(this.emulateLegacyImagePyramid)return this.getLevelScale(n)?new e.Point(1,1):new e.Point(0,0);if(this.levelSizes){var o=this.levelSizes[n],s=Math.ceil(o.width/this.getTileWidth(n)),c=Math.ceil(o.height/this.getTileHeight(n));return new e.Point(s,c)}return e.TileSource.prototype.getNumTiles.call(this,n)},getTileAtPoint:function(n,o){if(this.emulateLegacyImagePyramid)return new e.Point(0,0);if(this.levelSizes){var s=o.x>=0&&o.x<=1&&o.y>=0&&o.y<=1/this.aspectRatio;e.console.assert(s,"[TileSource.getTileAtPoint] must be called with a valid point.");var c=this.levelSizes[n].width,m=o.x*c,_=o.y*c,S=Math.floor(m/this.getTileWidth(n)),O=Math.floor(_/this.getTileHeight(n));return o.x>=1&&(S=this.getNumTiles(n).x-1),o.y>=1/this.aspectRatio-1e-15&&(O=this.getNumTiles(n).y-1),new e.Point(S,O)}return e.TileSource.prototype.getTileAtPoint.call(this,n,o)},getTileUrl:function(n,o,s){if(this.emulateLegacyImagePyramid){var c=null;return this.levels.length>0&&n>=this.minLevel&&n<=this.maxLevel&&(c=this.levels[n].url),c}var m,_,S,O,N,B,U,W,H,$,K,Q,re,Y,he,ve=Math.pow(.5,this.maxLevel-n);return this.levelSizes?(m=this.levelSizes[n].width,_=this.levelSizes[n].height):(m=Math.ceil(this.width*ve),_=Math.ceil(this.height*ve)),S=this.getTileWidth(n),O=this.getTileHeight(n),N=Math.round(S/ve),B=Math.round(O/ve),he=this.version===1?"native."+this.tileFormat:"default."+this.tileFormat,m<S&&_<O?(Q=this.version===2&&m===this.width?"full":this.version===3&&m===this.width&&_===this.height?"max":this.version===3?m+","+_:m+",",U="full"):(W=o*N,H=s*B,$=Math.min(N,this.width-W),K=Math.min(B,this.height-H),U=o===0&&s===0&&$===this.width&&K===this.height?"full":[W,H,$,K].join(","),re=Math.min(S,m-o*S),Y=Math.min(O,_-s*O),Q=this.version===2&&re===this.width?"full":this.version===3&&re===this.width&&Y===this.height?"max":this.version===3?re+","+Y:re+","),[this._id,U,Q,"0",he].join("/")},__testonly__:{canBeTiled:t,constructLevels:i}})}(b),function(e){e.OsmTileSource=function(t,i,u,n,o){var s;(s=e.isPlainObject(t)?t:{width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]}).width&&s.height||(s.width=65572864,s.height=65572864),s.tileSize||(s.tileSize=256,s.tileOverlap=0),s.tilesUrl||(s.tilesUrl="http://tile.openstreetmap.org/"),s.minLevel=8,e.TileSource.apply(this,[s])},e.extend(e.OsmTileSource.prototype,e.TileSource.prototype,{supports:function(t,i){return t.type&&t.type==="openstreetmaps"},configure:function(t,i,u){return t},getTileUrl:function(t,i,u){return this.tilesUrl+(t-8)+"/"+i+"/"+u+".png"}})}(b),function(e){e.TmsTileSource=function(t,i,u,n,o){var s;s=e.isPlainObject(t)?t:{width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]};var c,m=256*Math.ceil(s.width/256),_=256*Math.ceil(s.height/256);c=m>_?m/256:_/256,s.maxLevel=Math.ceil(Math.log(c)/Math.log(2))-1,s.tileSize=256,s.width=m,s.height=_,e.TileSource.apply(this,[s])},e.extend(e.TmsTileSource.prototype,e.TileSource.prototype,{supports:function(t,i){return t.type&&t.type==="tiledmapservice"},configure:function(t,i,u){return t},getTileUrl:function(t,i,u){var n=this.getNumTiles(t).y-1;return this.tilesUrl+t+"/"+i+"/"+(n-u)+".png"}})}(b),function(e){e.ZoomifyTileSource=function(t){t.tileSize===void 0&&(t.tileSize=256),t.fileFormat===void 0&&(t.fileFormat="jpg",this.fileFormat=t.fileFormat);var i={x:t.width,y:t.height};for(t.imageSizes=[{x:t.width,y:t.height}],t.gridSize=[this._getGridSize(t.width,t.height,t.tileSize)];parseInt(i.x,10)>t.tileSize||parseInt(i.y,10)>t.tileSize;)i.x=Math.floor(i.x/2),i.y=Math.floor(i.y/2),t.imageSizes.push({x:i.x,y:i.y}),t.gridSize.push(this._getGridSize(i.x,i.y,t.tileSize));t.imageSizes.reverse(),t.gridSize.reverse(),t.minLevel=0,t.maxLevel=t.gridSize.length-1,b.TileSource.apply(this,[t])},e.extend(e.ZoomifyTileSource.prototype,e.TileSource.prototype,{_getGridSize:function(t,i,u){return{x:Math.ceil(t/u),y:Math.ceil(i/u)}},_calculateAbsoluteTileNumber:function(t,i,u){for(var n=0,o={},s=0;s<t;s++)n+=(o=this.gridSize[s]).x*o.y;return n+=(o=this.gridSize[t]).x*u+i},supports:function(t,i){return t.type&&t.type==="zoomifytileservice"},configure:function(t,i,u){return t},getTileUrl:function(t,i,u){var n,o=this._calculateAbsoluteTileNumber(t,i,u);return n=Math.floor(o/256),this.tilesUrl+"TileGroup"+n+"/"+t+"-"+i+"-"+u+"."+this.fileFormat}})}(b),function(e){function t(i,u){return u.levels}e.LegacyTileSource=function(i){var u,n,o;e.isArray(i)&&(u={type:"legacy-image-pyramid",levels:i}),u.levels=function(s){var c,m,_=[];for(m=0;m<s.length;m++)(c=s[m]).height&&c.width&&c.url?_.push({url:c.url,width:Number(c.width),height:Number(c.height)}):e.console.error("Unsupported image format: %s",c.url?c.url:"<no URL>");return _.sort(function(S,O){return S.height-O.height})}(u.levels),u.levels.length>0?(n=u.levels[u.levels.length-1].width,o=u.levels[u.levels.length-1].height):(n=0,o=0,e.console.error("No supported image formats found")),e.extend(!0,u,{width:n,height:o,tileSize:Math.max(o,n),tileOverlap:0,minLevel:0,maxLevel:u.levels.length>0?u.levels.length-1:0}),e.TileSource.apply(this,[u]),this.levels=u.levels},e.extend(e.LegacyTileSource.prototype,e.TileSource.prototype,{supports:function(i,u){return i.type&&i.type==="legacy-image-pyramid"||i.documentElement&&i.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(i,u,n){return e.isPlainObject(i)?t(this,i):function(o,s){if(!s||!s.documentElement)throw new Error(e.getString("Errors.Xml"));var c,m,_=s.documentElement,S=_.tagName,O=null,N=[];if(S==="image")try{for(O={type:_.getAttribute("type"),levels:[]},N=_.getElementsByTagName("level"),m=0;m<N.length;m++)c=N[m],O.levels.push({url:c.getAttribute("url"),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10)});return t(o,O)}catch(B){throw B instanceof Error?B:new Error("Unknown error parsing Legacy Image Pyramid XML.")}else{if(S==="collection")throw new Error("Legacy Image Pyramid Collections not yet supported.");if(S==="error")throw new Error("Error: "+s)}throw new Error("Unknown element "+S)}(this,i)},getLevelScale:function(i){var u=NaN;return this.levels.length>0&&i>=this.minLevel&&i<=this.maxLevel&&(u=this.levels[i].width/this.levels[this.maxLevel].width),u},getNumTiles:function(i){return this.getLevelScale(i)?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(i,u,n){var o=null;return this.levels.length>0&&i>=this.minLevel&&i<=this.maxLevel&&(o=this.levels[i].url),o}})}(b),function(e){e.ImageTileSource=function(t){t=e.extend({buildPyramid:!0,crossOriginPolicy:!1,ajaxWithCredentials:!1,useCanvas:!0},t),e.TileSource.apply(this,[t])},e.extend(e.ImageTileSource.prototype,e.TileSource.prototype,{supports:function(t,i){return t.type&&t.type==="image"},configure:function(t,i,u){return t},getImageInfo:function(t){var i=this._image=new Image,u=this;this.crossOriginPolicy&&(i.crossOrigin=this.crossOriginPolicy),this.ajaxWithCredentials&&(i.useCredentials=this.ajaxWithCredentials),e.addEvent(i,"load",function(){u.width=i.naturalWidth,u.height=i.naturalHeight,u.aspectRatio=u.width/u.height,u.dimensions=new e.Point(u.width,u.height),u._tileWidth=u.width,u._tileHeight=u.height,u.tileOverlap=0,u.minLevel=0,u.levels=u._buildLevels(),u.maxLevel=u.levels.length-1,u.ready=!0,u.raiseEvent("ready",{tileSource:u})}),e.addEvent(i,"error",function(){u.raiseEvent("open-failed",{message:"Error loading image at "+t,source:t})}),i.src=t},getLevelScale:function(t){var i=NaN;return t>=this.minLevel&&t<=this.maxLevel&&(i=this.levels[t].width/this.levels[this.maxLevel].width),i},getNumTiles:function(t){return this.getLevelScale(t)?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(t,i,u){var n=null;return t>=this.minLevel&&t<=this.maxLevel&&(n=this.levels[t].url),n},getContext2D:function(t,i,u){var n=null;return t>=this.minLevel&&t<=this.maxLevel&&(n=this.levels[t].context2D),n},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var t=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!e.supportsCanvas||!this.useCanvas)return delete this._image,t;var i=this._image.naturalWidth,u=this._image.naturalHeight,n=document.createElement("canvas"),o=n.getContext("2d");if(n.width=i,n.height=u,o.drawImage(this._image,0,0,i,u),t[0].context2D=o,delete this._image,e.isCanvasTainted(n))return t;for(;i>=2&&u>=2;){i=Math.floor(i/2),u=Math.floor(u/2);var s=document.createElement("canvas"),c=s.getContext("2d");s.width=i,s.height=u,c.drawImage(n,0,0,i,u),t.splice(0,0,{context2D:c,width:i,height:u}),n=s,o=c}return t},_freeupCanvasMemory:function(){for(var t=0;t<this.levels.length;t++)this.levels[t].context2D&&(this.levels[t].context2D.canvas.height=0,this.levels[t].context2D.canvas.width=0)}})}(b),function(e){e.TileSourceCollection=function(t,i,u,n){e.console.error("TileSourceCollection is deprecated; use World instead")}}(b),function(e){function t(n){e.requestAnimationFrame(function(){(function(o){var s;o.shouldFade&&(s=1-(e.now()-o.fadeBeginTime)/o.fadeLength,s=Math.min(1,s),s=Math.max(0,s),o.imgGroup&&e.setElementOpacity(o.imgGroup,s,!0),s>0&&t(o))})(n)})}function i(n,o){n.element.disabled||(o>=e.ButtonState.GROUP&&n.currentState===e.ButtonState.REST&&(function(s){s.shouldFade=!1,s.imgGroup&&e.setElementOpacity(s.imgGroup,1,!0)}(n),n.currentState=e.ButtonState.GROUP),o>=e.ButtonState.HOVER&&n.currentState===e.ButtonState.GROUP&&(n.imgHover&&(n.imgHover.style.visibility=""),n.currentState=e.ButtonState.HOVER),o>=e.ButtonState.DOWN&&n.currentState===e.ButtonState.HOVER&&(n.imgDown&&(n.imgDown.style.visibility=""),n.currentState=e.ButtonState.DOWN))}function u(n,o){n.element.disabled||(o<=e.ButtonState.HOVER&&n.currentState===e.ButtonState.DOWN&&(n.imgDown&&(n.imgDown.style.visibility="hidden"),n.currentState=e.ButtonState.HOVER),o<=e.ButtonState.GROUP&&n.currentState===e.ButtonState.HOVER&&(n.imgHover&&(n.imgHover.style.visibility="hidden"),n.currentState=e.ButtonState.GROUP),o<=e.ButtonState.REST&&n.currentState===e.ButtonState.GROUP&&(function(s){s.shouldFade=!0,s.fadeBeginTime=e.now()+s.fadeDelay,window.setTimeout(function(){t(s)},s.fadeDelay)}(n),n.currentState=e.ButtonState.REST))}e.ButtonState={REST:0,GROUP:1,HOVER:2,DOWN:3},e.Button=function(n){var o=this;e.EventSource.call(this),e.extend(!0,this,{tooltip:null,srcRest:null,srcGroup:null,srcHover:null,srcDown:null,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,fadeDelay:0,fadeLength:2e3,onPress:null,onRelease:null,onClick:null,onEnter:null,onExit:null,onFocus:null,onBlur:null,userData:null},n),this.element=n.element||e.makeNeutralElement("div"),n.element||(this.imgRest=e.makeTransparentImage(this.srcRest),this.imgGroup=e.makeTransparentImage(this.srcGroup),this.imgHover=e.makeTransparentImage(this.srcHover),this.imgDown=e.makeTransparentImage(this.srcDown),this.imgRest.alt=this.imgGroup.alt=this.imgHover.alt=this.imgDown.alt=this.tooltip,e.setElementPointerEventsNone(this.imgRest),e.setElementPointerEventsNone(this.imgGroup),e.setElementPointerEventsNone(this.imgHover),e.setElementPointerEventsNone(this.imgDown),this.element.style.position="relative",e.setElementTouchActionNone(this.element),this.imgGroup.style.position=this.imgHover.style.position=this.imgDown.style.position="absolute",this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top="0px",this.imgGroup.style.left=this.imgHover.style.left=this.imgDown.style.left="0px",this.imgHover.style.visibility=this.imgDown.style.visibility="hidden",e.Browser.vendor===e.BROWSERS.FIREFOX&&e.Browser.version<3&&(this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top=""),this.element.appendChild(this.imgRest),this.element.appendChild(this.imgGroup),this.element.appendChild(this.imgHover),this.element.appendChild(this.imgDown)),this.addHandler("press",this.onPress),this.addHandler("release",this.onRelease),this.addHandler("click",this.onClick),this.addHandler("enter",this.onEnter),this.addHandler("exit",this.onExit),this.addHandler("focus",this.onFocus),this.addHandler("blur",this.onBlur),this.currentState=e.ButtonState.GROUP,this.fadeBeginTime=null,this.shouldFade=!1,this.element.style.display="inline-block",this.element.style.position="relative",this.element.title=this.tooltip,this.tracker=new e.MouseTracker({userData:"Button.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(s){s.insideElementPressed?(i(o,e.ButtonState.DOWN),o.raiseEvent("enter",{originalEvent:s.originalEvent})):s.buttonDownAny||i(o,e.ButtonState.HOVER)},focusHandler:function(s){o.tracker.enterHandler(s),o.raiseEvent("focus",{originalEvent:s.originalEvent})},leaveHandler:function(s){u(o,e.ButtonState.GROUP),s.insideElementPressed&&o.raiseEvent("exit",{originalEvent:s.originalEvent})},blurHandler:function(s){o.tracker.leaveHandler(s),o.raiseEvent("blur",{originalEvent:s.originalEvent})},pressHandler:function(s){i(o,e.ButtonState.DOWN),o.raiseEvent("press",{originalEvent:s.originalEvent})},releaseHandler:function(s){s.insideElementPressed&&s.insideElementReleased?(u(o,e.ButtonState.HOVER),o.raiseEvent("release",{originalEvent:s.originalEvent})):s.insideElementPressed?u(o,e.ButtonState.GROUP):i(o,e.ButtonState.HOVER)},clickHandler:function(s){s.quick&&o.raiseEvent("click",{originalEvent:s.originalEvent})},keyHandler:function(s){s.keyCode===13?(o.raiseEvent("click",{originalEvent:s.originalEvent}),o.raiseEvent("release",{originalEvent:s.originalEvent}),s.preventDefault=!0):s.preventDefault=!1}}),u(this,e.ButtonState.REST)},e.extend(e.Button.prototype,e.EventSource.prototype,{notifyGroupEnter:function(){i(this,e.ButtonState.GROUP)},notifyGroupExit:function(){u(this,e.ButtonState.REST)},disable:function(){this.notifyGroupExit(),this.element.disabled=!0,this.tracker.setTracking(!1),e.setElementOpacity(this.element,.2,!0)},enable:function(){this.element.disabled=!1,this.tracker.setTracking(!0),e.setElementOpacity(this.element,1,!0),this.notifyGroupEnter()},destroy:function(){this.imgRest&&(this.element.removeChild(this.imgRest),this.imgRest=null),this.imgGroup&&(this.element.removeChild(this.imgGroup),this.imgGroup=null),this.imgHover&&(this.element.removeChild(this.imgHover),this.imgHover=null),this.imgDown&&(this.element.removeChild(this.imgDown),this.imgDown=null),this.removeAllHandlers(),this.tracker.destroy(),this.element=null}})}(b),function(e){e.ButtonGroup=function(t){e.extend(!0,this,{buttons:[],clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},t);var i,u=this.buttons.concat([]),n=this;if(this.element=t.element||e.makeNeutralElement("div"),!t.group)for(this.element.style.display="inline-block",i=0;i<u.length;i++)this.element.appendChild(u[i].element);e.setElementTouchActionNone(this.element),this.tracker=new e.MouseTracker({userData:"ButtonGroup.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(o){var s;for(s=0;s<n.buttons.length;s++)n.buttons[s].notifyGroupEnter()},leaveHandler:function(o){var s;if(!o.insideElementPressed)for(s=0;s<n.buttons.length;s++)n.buttons[s].notifyGroupExit()}})},e.ButtonGroup.prototype={addButton:function(t){this.buttons.push(t),this.element.appendChild(t.element)},emulateEnter:function(){this.tracker.enterHandler({eventSource:this.tracker})},emulateLeave:function(){this.tracker.leaveHandler({eventSource:this.tracker})},destroy:function(){for(;this.buttons.length;){var t=this.buttons.pop();this.element.removeChild(t.element),t.destroy()}this.tracker.destroy(),this.element=null}}}(b),function(e){e.Rect=function(t,i,u,n,o){var s,c;this.x=typeof t=="number"?t:0,this.y=typeof i=="number"?i:0,this.width=typeof u=="number"?u:0,this.height=typeof n=="number"?n:0,this.degrees=typeof o=="number"?o:0,this.degrees=e.positiveModulo(this.degrees,360),this.degrees>=270?(s=this.getTopRight(),this.x=s.x,this.y=s.y,c=this.height,this.height=this.width,this.width=c,this.degrees-=270):this.degrees>=180?(s=this.getBottomRight(),this.x=s.x,this.y=s.y,this.degrees-=180):this.degrees>=90&&(s=this.getBottomLeft(),this.x=s.x,this.y=s.y,c=this.height,this.height=this.width,this.width=c,this.degrees-=90)},e.Rect.fromSummits=function(t,i,u){var n=t.distanceTo(i),o=t.distanceTo(u),s=i.minus(t),c=Math.atan(s.y/s.x);return s.x<0?c+=Math.PI:s.y<0&&(c+=2*Math.PI),new e.Rect(t.x,t.y,n,o,c/Math.PI*180)},e.Rect.prototype={clone:function(){return new e.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new e.Point(this.x,this.y)},getBottomRight:function(){return new e.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new e.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new e.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new e.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new e.Point(this.width,this.height)},equals:function(t){return t instanceof e.Rect&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.degrees===t.degrees},times:function(t){return new e.Rect(this.x*t,this.y*t,this.width*t,this.height*t,this.degrees)},translate:function(t){return new e.Rect(this.x+t.x,this.y+t.y,this.width,this.height,this.degrees)},union:function(t){var i=this.getBoundingBox(),u=t.getBoundingBox(),n=Math.min(i.x,u.x),o=Math.min(i.y,u.y),s=Math.max(i.x+i.width,u.x+u.width),c=Math.max(i.y+i.height,u.y+u.height);return new e.Rect(n,o,s-n,c-o)},intersection:function(t){var i=1e-10,u=[],n=this.getTopLeft();t.containsPoint(n,i)&&u.push(n);var o=this.getTopRight();t.containsPoint(o,i)&&u.push(o);var s=this.getBottomLeft();t.containsPoint(s,i)&&u.push(s);var c=this.getBottomRight();t.containsPoint(c,i)&&u.push(c);var m=t.getTopLeft();this.containsPoint(m,i)&&u.push(m);var _=t.getTopRight();this.containsPoint(_,i)&&u.push(_);var S=t.getBottomLeft();this.containsPoint(S,i)&&u.push(S);var O=t.getBottomRight();this.containsPoint(O,i)&&u.push(O);for(var N=this._getSegments(),B=t._getSegments(),U=0;U<N.length;U++)for(var W=N[U],H=0;H<B.length;H++){var $=B[H],K=Q(W[0],W[1],$[0],$[1]);K&&u.push(K)}function Q(Me,Ve,Ue,$e){var Ae=Ve.minus(Me),qe=$e.minus(Ue),Re=-qe.x*Ae.y+Ae.x*qe.y;if(Re===0)return null;var ot=(Ae.x*(Me.y-Ue.y)-Ae.y*(Me.x-Ue.x))/Re,Qe=(qe.x*(Me.y-Ue.y)-qe.y*(Me.x-Ue.x))/Re;return-1e-10<=ot&&ot<=1-i&&-1e-10<=Qe&&Qe<=1-i?new e.Point(Me.x+Qe*Ae.x,Me.y+Qe*Ae.y):null}if(u.length===0)return null;for(var re=u[0].x,Y=u[0].x,he=u[0].y,ve=u[0].y,Se=1;Se<u.length;Se++){var ke=u[Se];ke.x<re&&(re=ke.x),ke.x>Y&&(Y=ke.x),ke.y<he&&(he=ke.y),ke.y>ve&&(ve=ke.y)}return new e.Rect(re,he,Y-re,ve-he)},_getSegments:function(){var t=this.getTopLeft(),i=this.getTopRight(),u=this.getBottomLeft(),n=this.getBottomRight();return[[t,i],[i,n],[n,u],[u,t]]},rotate:function(t,i){if((t=e.positiveModulo(t,360))===0)return this.clone();i=i||this.getCenter();var u=this.getTopLeft().rotate(t,i),n=this.getTopRight().rotate(t,i).minus(u);n=n.apply(function(s){return Math.abs(s)<1e-15?0:s});var o=Math.atan(n.y/n.x);return n.x<0?o+=Math.PI:n.y<0&&(o+=2*Math.PI),new e.Rect(u.x,u.y,this.width,this.height,o/Math.PI*180)},getBoundingBox:function(){if(this.degrees===0)return this.clone();var t=this.getTopLeft(),i=this.getTopRight(),u=this.getBottomLeft(),n=this.getBottomRight(),o=Math.min(t.x,i.x,u.x,n.x),s=Math.max(t.x,i.x,u.x,n.x),c=Math.min(t.y,i.y,u.y,n.y),m=Math.max(t.y,i.y,u.y,n.y);return new e.Rect(o,c,s-o,m-c)},getIntegerBoundingBox:function(){var t=this.getBoundingBox(),i=Math.floor(t.x),u=Math.floor(t.y),n=Math.ceil(t.width+t.x-i),o=Math.ceil(t.height+t.y-u);return new e.Rect(i,u,n,o)},containsPoint:function(t,i){i=i||0;var u=this.getTopLeft(),n=this.getTopRight(),o=this.getBottomLeft(),s=n.minus(u),c=o.minus(u);return(t.x-u.x)*s.x+(t.y-u.y)*s.y>=-i&&(t.x-n.x)*s.x+(t.y-n.y)*s.y<=i&&(t.x-u.x)*c.x+(t.y-u.y)*c.y>=-i&&(t.x-o.x)*c.x+(t.y-o.y)*c.y<=i},toString:function(){return"["+Math.round(100*this.x)/100+", "+Math.round(100*this.y)/100+", "+Math.round(100*this.width)/100+"x"+Math.round(100*this.height)/100+", "+Math.round(100*this.degrees)/100+"deg]"}}}(b),function(e){var t={};function i(S){var O;S.quick&&(O=this.scroll==="horizontal"?Math.floor(S.position.x/(this.panelWidth+4)):Math.floor(S.position.y/this.panelHeight),this.viewer.goToPage(O)),this.element.focus()}function u(S){if(this.dragging=!0,this.element){var O=Number(this.element.style.marginLeft.replace("px","")),N=Number(this.element.style.marginTop.replace("px","")),B=Number(this.element.style.width.replace("px","")),U=Number(this.element.style.height.replace("px","")),W=e.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?-S.delta.x>0?O>-(B-W.x)&&(this.element.style.marginLeft=O+2*S.delta.x+"px",o(this,W.x,O+2*S.delta.x)):-S.delta.x<0&&O<0&&(this.element.style.marginLeft=O+2*S.delta.x+"px",o(this,W.x,O+2*S.delta.x)):-S.delta.y>0?N>-(U-W.y)&&(this.element.style.marginTop=N+2*S.delta.y+"px",o(this,W.y,N+2*S.delta.y)):-S.delta.y<0&&N<0&&(this.element.style.marginTop=N+2*S.delta.y+"px",o(this,W.y,N+2*S.delta.y))}}function n(S){if(this.element){var O=Number(this.element.style.marginLeft.replace("px","")),N=Number(this.element.style.marginTop.replace("px","")),B=Number(this.element.style.width.replace("px","")),U=Number(this.element.style.height.replace("px","")),W=e.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?S.scroll>0?O>-(B-W.x)&&(this.element.style.marginLeft=O-60*S.scroll+"px",o(this,W.x,O-60*S.scroll)):S.scroll<0&&O<0&&(this.element.style.marginLeft=O-60*S.scroll+"px",o(this,W.x,O-60*S.scroll)):S.scroll<0?N>W.y-U&&(this.element.style.marginTop=N+60*S.scroll+"px",o(this,W.y,N+60*S.scroll)):S.scroll>0&&N<0&&(this.element.style.marginTop=N+60*S.scroll+"px",o(this,W.y,N+60*S.scroll)),S.preventDefault=!0}}function o(S,O,N){var B,U,W,H,$,K;for(B=S.scroll==="horizontal"?S.panelWidth:S.panelHeight,U=Math.ceil(O/B)+5,$=U=(U=(W=Math.ceil((Math.abs(N)+O)/B)+1)-U)<0?0:U;$<W&&$<S.panels.length;$++)if(!(K=S.panels[$]).activePanel){var Q,re=S.viewer.tileSources[$];Q=re.referenceStripThumbnailUrl?{type:"image",url:re.referenceStripThumbnailUrl}:re,H=new e.Viewer({id:K.id,tileSources:[Q],element:K,navigatorSizeRatio:S.sizeRatio,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,loadTilesWithAjax:S.viewer.loadTilesWithAjax,ajaxHeaders:S.viewer.ajaxHeaders,useCanvas:S.useCanvas}),e.setElementPointerEventsNone(H.canvas),e.setElementPointerEventsNone(H.container),H.innerTracker.setTracking(!1),H.outerTracker.setTracking(!1),S.miniViewers[K.id]=H,K.activePanel=!0}}function s(S){var O=S.eventSource.element;this.scroll==="horizontal"?O.style.marginBottom="0px":O.style.marginLeft="0px"}function c(S){var O=S.eventSource.element;this.scroll==="horizontal"?O.style.marginBottom="-"+e.getElementSize(O).y/2+"px":O.style.marginLeft="-"+e.getElementSize(O).x/2+"px"}function m(S){if(S.ctrl||S.alt||S.meta)S.preventDefault=!1;else switch(S.keyCode){case 38:case 39:n.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),S.preventDefault=!0;break;case 40:case 37:n.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),S.preventDefault=!0;break;default:S.preventDefault=!1}}function _(S){if(S.ctrl||S.alt||S.meta)S.preventDefault=!1;else switch(S.keyCode){case 61:case 48:case 119:case 87:case 100:n.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),S.preventDefault=!0;break;case 45:case 115:case 83:case 97:n.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),S.preventDefault=!0;break;default:S.preventDefault=!1}}e.ReferenceStrip=function(S){var O,N,B,U=S.viewer,W=e.getElementSize(U.element);for(S.id||(S.id="referencestrip-"+e.now(),this.element=e.makeNeutralElement("div"),this.element.id=S.id,this.element.className="referencestrip"),S=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.referenceStripSizeRatio,position:e.DEFAULT_SETTINGS.referenceStripPosition,scroll:e.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold},S,{element:this.element}),e.extend(this,S),t[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,(N=this.element.style).marginTop="0px",N.marginRight="0px",N.marginBottom="0px",N.marginLeft="0px",N.left="0px",N.bottom="0px",N.border="0px",N.background="#000",N.position="relative",e.setElementTouchActionNone(this.element),e.setElementOpacity(this.element,.8),this.viewer=U,this.tracker=new e.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:e.delegate(this,i),dragHandler:e.delegate(this,u),scrollHandler:e.delegate(this,n),enterHandler:e.delegate(this,s),leaveHandler:e.delegate(this,c),keyDownHandler:e.delegate(this,m),keyHandler:e.delegate(this,_),preProcessEventHandler:function(H){H.eventType==="wheel"&&(H.preventDefault=!0)}}),S.width&&S.height?(this.element.style.width=S.width+"px",this.element.style.height=S.height+"px",U.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):S.scroll==="horizontal"?(this.element.style.width=W.x*S.sizeRatio*U.tileSources.length+12*U.tileSources.length+"px",this.element.style.height=W.y*S.sizeRatio+"px",U.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=W.y*S.sizeRatio*U.tileSources.length+12*U.tileSources.length+"px",this.element.style.width=W.x*S.sizeRatio+"px",U.addControl(this.element,{anchor:e.ControlAnchor.TOP_LEFT})),this.panelWidth=W.x*this.sizeRatio+8,this.panelHeight=W.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},B=0;B<U.tileSources.length;B++)(O=e.makeNeutralElement("div")).id=this.element.id+"-"+B,O.style.width=this.panelWidth+"px",O.style.height=this.panelHeight+"px",O.style.display="inline",O.style.float="left",O.style.cssFloat="left",O.style.styleFloat="left",O.style.padding="2px",e.setElementTouchActionNone(O),e.setElementPointerEventsNone(O),this.element.appendChild(O),O.activePanel=!1,this.panels.push(O);o(this,this.scroll==="vertical"?W.y:W.x,0),this.setFocus(0)},e.ReferenceStrip.prototype={setFocus:function(S){var O,N=this.element.querySelector("#"+this.element.id+"-"+S),B=e.getElementSize(this.viewer.canvas),U=Number(this.element.style.width.replace("px","")),W=Number(this.element.style.height.replace("px","")),H=-Number(this.element.style.marginLeft.replace("px","")),$=-Number(this.element.style.marginTop.replace("px",""));this.currentSelected!==N&&(this.currentSelected&&(this.currentSelected.style.background="#000"),this.currentSelected=N,this.currentSelected.style.background="#999",this.scroll==="horizontal"?(O=Number(S)*(this.panelWidth+3))>H+B.x-this.panelWidth?(O=Math.min(O,U-B.x),this.element.style.marginLeft=-O+"px",o(this,B.x,-O)):O<H&&(O=Math.max(0,O-B.x/2),this.element.style.marginLeft=-O+"px",o(this,B.x,-O)):(O=Number(S)*(this.panelHeight+3))>$+B.y-this.panelHeight?(O=Math.min(O,W-B.y),this.element.style.marginTop=-O+"px",o(this,B.y,-O)):O<$&&(O=Math.max(0,O-B.y/2),this.element.style.marginTop=-O+"px",o(this,B.y,-O)),this.currentPage=S,s.call(this,{eventSource:this.tracker}))},update:function(){return!!t[this.id].animating},destroy:function(){if(this.miniViewers)for(var S in this.miniViewers)this.miniViewers[S].destroy();this.tracker.destroy(),this.element&&this.viewer.removeControl(this.element)}}}(b),function(e){e.DisplayRect=function(t,i,u,n,o,s){e.Rect.apply(this,[t,i,u,n]),this.minLevel=o,this.maxLevel=s},e.extend(e.DisplayRect.prototype,e.Rect.prototype)}(b),function(e){e.Spring=function(t){var i=arguments;typeof t!="object"&&(t={initial:i.length&&typeof i[0]=="number"?i[0]:void 0,springStiffness:i.length>1?i[1].springStiffness:5,animationTime:i.length>1?i[1].animationTime:1.5}),e.console.assert(typeof t.springStiffness=="number"&&t.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),e.console.assert(typeof t.animationTime=="number"&&t.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),t.exponential&&(this._exponential=!0,delete t.exponential),e.extend(!0,this,t),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:e.now()},e.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},e.Spring.prototype={resetTo:function(t){e.console.assert(!this._exponential||t!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=t,this.start.time=this.target.time=this.current.time=e.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(t){e.console.assert(!this._exponential||t!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=t,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(t){this.start.value+=t,this.target.value+=t,this._exponential&&(e.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(t){this._exponential=t,this._exponential&&(e.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){var t,i;this.current.time=e.now(),this._exponential?(t=this.start._logValue,i=this.target._logValue):(t=this.start.value,i=this.target.value);var u,n,o=this.current.time>=this.target.time?i:t+(i-t)*(u=this.springStiffness,n=(this.current.time-this.start.time)/(this.target.time-this.start.time),(1-Math.exp(u*-n))/(1-Math.exp(-u))),s=this.current.value;return this._exponential?this.current.value=Math.exp(o):this.current.value=o,s!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}}}(b),function(e){e.ImageJob=function(t){e.extend(!0,this,{timeout:e.DEFAULT_SETTINGS.timeout,jobId:null,tries:0},t),this.data=null,this.userData={},this.errorMsg=null},e.ImageJob.prototype={start:function(){this.tries++;var t=this,i=this.abort;this.jobId=window.setTimeout(function(){t.finish(null,null,"Image load exceeded timeout ("+t.timeout+" ms)")},this.timeout),this.abort=function(){t.source.downloadTileAbort(t),typeof i=="function"&&i()},this.source.downloadTileStart(this)},finish:function(t,i,u){this.data=t,this.request=i,this.errorMsg=u,this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},e.ImageLoader=function(t){e.extend(!0,this,{jobLimit:e.DEFAULT_SETTINGS.imageLoaderLimit,timeout:e.DEFAULT_SETTINGS.timeout,jobQueue:[],failedTiles:[],jobsInProgress:0},t)},e.ImageLoader.prototype={addJob:function(t){if(!t.source){e.console.error("ImageLoader.prototype.addJob() requires [options.source]. TileSource since new API defines how images are fetched. Creating a dummy TileSource.");var i=e.TileSource.prototype;t.source={downloadTileStart:i.downloadTileStart,downloadTileAbort:i.downloadTileAbort}}var u=this,n={src:t.src,tile:t.tile||{},source:t.source,loadWithAjax:t.loadWithAjax,ajaxHeaders:t.loadWithAjax?t.ajaxHeaders:null,crossOriginPolicy:t.crossOriginPolicy,ajaxWithCredentials:t.ajaxWithCredentials,postData:t.postData,callback:function(s){(function(c,m,_){m.errorMsg!==""&&(m.data===null||m.data===void 0)&&m.tries<1+c.tileRetryMax&&c.failedTiles.push(m);var S;c.jobsInProgress--,(!c.jobLimit||c.jobsInProgress<c.jobLimit)&&c.jobQueue.length>0&&((S=c.jobQueue.shift()).start(),c.jobsInProgress++),c.tileRetryMax>0&&c.jobQueue.length===0&&(!c.jobLimit||c.jobsInProgress<c.jobLimit)&&c.failedTiles.length>0&&(S=c.failedTiles.shift(),setTimeout(function(){S.start()},c.tileRetryDelay),c.jobsInProgress++),_(m.data,m.errorMsg,m.request)})(u,s,t.callback)},abort:t.abort,timeout:this.timeout},o=new e.ImageJob(n);!this.jobLimit||this.jobsInProgress<this.jobLimit?(o.start(),this.jobsInProgress++):this.jobQueue.push(o)},clear:function(){for(var t=0;t<this.jobQueue.length;t++){var i=this.jobQueue[t];typeof i.abort=="function"&&i.abort()}this.jobQueue=[]}}}(b),function(e){e.Tile=function(t,i,u,n,o,s,c,m,_,S,O,N){this.level=t,this.x=i,this.y=u,this.bounds=n,this.sourceBounds=S,this.exists=o,this._url=s,this.postData=O,this.context2D=c,this.loadWithAjax=m,this.ajaxHeaders=_,N===void 0&&(e.console.warn("Tile constructor needs 'cacheKey' variable: creation tile cache in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used."),N=e.TileSource.prototype.getTileHashKey(t,i,u,s,_,O)),this.cacheKey=N,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.hasTransparency=!1,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},e.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.getUrl().match(".png")},drawHTML:function(t){if(this.cacheImageRecord)if(this.loaded){if(!this.element){var i=this.getImage();if(!i)return;this.element=e.makeNeutralElement("div"),this.imgElement=i.cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"}this.element.parentNode!==t&&t.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),e.setElementOpacity(this.element,this.opacity)}else e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());else e.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString())},get image(){return e.console.error("[Tile.image] property has been deprecated. Use [Tile.prototype.getImage] instead."),this.getImage()},get url(){return e.console.error("[Tile.url] property has been deprecated. Use [Tile.prototype.getUrl] instead."),this.getUrl()},getImage:function(){return this.cacheImageRecord.getImage()},getUrl:function(){return typeof this._url=="function"?this._url():this._url},getCanvasContext:function(){return this.context2D||this.cacheImageRecord.getRenderedContext()},drawCanvas:function(t,i,u,n,o,s){var c,m,_,S=this.position.times(e.pixelDensityRatio),O=this.size.times(e.pixelDensityRatio);this.context2D||this.cacheImageRecord?(c=this.getCanvasContext(),this.loaded&&c?(t.save(),t.globalAlpha=this.opacity,typeof u=="number"&&u!==1&&(S=S.times(u),O=O.times(u)),n instanceof e.Point&&(S=S.plus(n)),t.globalAlpha===1&&this.hasTransparency&&(o&&(S.x=Math.round(S.x),S.y=Math.round(S.y),O.x=Math.round(O.x),O.y=Math.round(O.y)),t.clearRect(S.x,S.y,O.x,O.y)),this.sourceBounds?(m=Math.min(this.sourceBounds.width,c.canvas.width),_=Math.min(this.sourceBounds.height,c.canvas.height)):(m=c.canvas.width,_=c.canvas.height),t.translate(S.x+O.x/2,0),this.flipped&&t.scale(-1,1),i({context:t,tile:this,rendered:c,initRendered:this.cacheImageRecord?this.cacheImageRecord.getCopyRenderedContext():void 0,sourceWidth:m,sourceHeight:_,position:{original:S,x:-O.x/2,y:S.y},size:O,pixelDensityRatio:e.pixelDensityRatio}),t.restore()):e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString())):e.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString())},getScaleForEdgeSmoothing:function(){var t;if(this.cacheImageRecord)t=this.cacheImageRecord.getRenderedContext();else{if(!this.context2D)return e.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;t=this.context2D}return t.canvas.width/(this.size.x*e.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(t,i,u){var n=Math.max(1,Math.ceil((u.x-i.x)/2)),o=Math.max(1,Math.ceil((u.y-i.y)/2));return new e.Point(n,o).minus(this.position.times(e.pixelDensityRatio).times(t||1).apply(function(s){return s%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(b),function(e){e.OverlayPlacement=e.Placement,e.OverlayRotationMode=e.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),e.Overlay=function(t,i,u){var n;n=e.isPlainObject(t)?t:{element:t,location:i,placement:u},this.element=n.element,this.style=n.element.style,this._init(n)},e.Overlay.prototype={_init:function(t){this.location=t.location,this.placement=t.placement===void 0?e.Placement.TOP_LEFT:t.placement,this.onDraw=t.onDraw,this.checkResize=t.checkResize===void 0||t.checkResize,this.width=t.width===void 0?null:t.width,this.height=t.height===void 0?null:t.height,this.rotationMode=t.rotationMode||e.OverlayRotationMode.EXACT,this.location instanceof e.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=e.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new e.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(t,i){var u=e.Placement.properties[this.placement];u&&(u.isHorizontallyCentered?t.x-=i.x/2:u.isRight&&(t.x-=i.x),u.isVerticallyCentered?t.y-=i.y/2:u.isBottom&&(t.y-=i.y))},destroy:function(){var t=this.element,i=this.style;t.parentNode&&(t.parentNode.removeChild(t),t.prevElementParent&&(i.display="none",document.body.appendChild(t))),this.onDraw=null,i.top="",i.left="",i.position="",this.width!==null&&(i.width=""),this.height!==null&&(i.height="");var u=e.getCssPropertyWithVendorPrefix("transformOrigin"),n=e.getCssPropertyWithVendorPrefix("transform");u&&n&&(i[u]="",i[n]="")},drawHTML:function(t,i){var u=this.element;u.parentNode!==t&&(u.prevElementParent=u.parentNode,u.prevNextSibling=u.nextSibling,t.appendChild(u),this.style.position="absolute",this.size=e.getElementSize(u));var n=this._getOverlayPositionAndSize(i),o=n.position,s=this.size=n.size,c=n.rotate;if(this.onDraw)this.onDraw(o,s,this.element);else{var m=this.style;m.left=o.x+"px",m.top=o.y+"px",this.width!==null&&(m.width=s.x+"px"),this.height!==null&&(m.height=s.y+"px");var _=e.getCssPropertyWithVendorPrefix("transformOrigin"),S=e.getCssPropertyWithVendorPrefix("transform");_&&S&&(c?(m[_]=this._getTransformOrigin(),m[S]="rotate("+c+"deg)"):(m[_]="",m[S]="")),m.display="block"}},_getOverlayPositionAndSize:function(t){var i=t.pixelFromPoint(this.location,!0),u=this._getSizeInPixels(t);this.adjust(i,u);var n=0;if(t.getRotation(!0)&&this.rotationMode!==e.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var o=new e.Rect(i.x,i.y,u.x,u.y),s=this._getBoundingBox(o,t.getRotation(!0));i=s.getTopLeft(),u=s.getSize()}else n=t.getRotation(!0);return{position:i,size:u,rotate:n}},_getSizeInPixels:function(t){var i=this.size.x,u=this.size.y;if(this.width!==null||this.height!==null){var n=t.deltaPixelsFromPointsNoRotate(new e.Point(this.width||0,this.height||0),!0);this.width!==null&&(i=n.x),this.height!==null&&(u=n.y)}if(this.checkResize&&(this.width===null||this.height===null)){var o=this.size=e.getElementSize(this.element);this.width===null&&(i=o.x),this.height===null&&(u=o.y)}return new e.Point(i,u)},_getBoundingBox:function(t,i){var u=this._getPlacementPoint(t);return t.rotate(i,u).getBoundingBox()},_getPlacementPoint:function(t){var i=new e.Point(t.x,t.y),u=e.Placement.properties[this.placement];return u&&(u.isHorizontallyCentered?i.x+=t.width/2:u.isRight&&(i.x+=t.width),u.isVerticallyCentered?i.y+=t.height/2:u.isBottom&&(i.y+=t.height)),i},_getTransformOrigin:function(){var t="",i=e.Placement.properties[this.placement];return i&&(i.isLeft?t="left":i.isRight&&(t="right"),i.isTop?t+=" top":i.isBottom&&(t+=" bottom")),t},update:function(t,i){var u=e.isPlainObject(t)?t:{location:t,placement:i};this._init({location:u.location||this.location,placement:u.placement!==void 0?u.placement:this.placement,onDraw:u.onDraw||this.onDraw,checkResize:u.checkResize||this.checkResize,width:u.width!==void 0?u.width:this.width,height:u.height!==void 0?u.height:this.height,rotationMode:u.rotationMode||this.rotationMode})},getBounds:function(t){e.console.assert(t,"A viewport must now be passed to Overlay.getBounds.");var i=this.width,u=this.height;if(i===null||u===null){var n=t.deltaPointsFromPixelsNoRotate(this.size,!0);i===null&&(i=n.x),u===null&&(u=n.y)}var o=this.location.clone();return this.adjust(o,new e.Point(i,u)),this._adjustBoundsForRotation(t,new e.Rect(o.x,o.y,i,u))},_adjustBoundsForRotation:function(t,i){if(!t||t.getRotation(!0)===0||this.rotationMode===e.OverlayRotationMode.EXACT)return i;if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return i;var u=this._getOverlayPositionAndSize(t);return t.viewerElementToViewportRectangle(new e.Rect(u.position.x,u.position.y,u.size.x,u.size.y))}return i.rotate(-t.getRotation(!0),this._getPlacementPoint(i))}}}(b),function(e){e.Drawer=function(t){e.console.assert(t.viewer,"[Drawer] options.viewer is required");var i=arguments;if(e.isPlainObject(t)||(t={source:i[0],viewport:i[1],element:i[2]}),e.console.assert(t.viewport,"[Drawer] options.viewport is required"),e.console.assert(t.element,"[Drawer] options.element is required"),t.source&&e.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=t.viewer,this.viewport=t.viewport,this.debugGridColor=typeof t.debugGridColor=="string"?[t.debugGridColor]:t.debugGridColor||e.DEFAULT_SETTINGS.debugGridColor,t.opacity&&e.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=e.supportsCanvas&&(!this.viewer||this.viewer.useCanvas),this.container=e.getElement(t.element),this.canvas=e.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var u=this._calculateCanvasSize();this.canvas.width=u.x,this.canvas.height=u.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",e.setElementOpacity(this.canvas,this.opacity,!0),e.setElementPointerEventsNone(this.canvas),e.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},e.Drawer.prototype={addOverlay:function(t,i,u,n){return e.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(t,i,u,n),this},updateOverlay:function(t,i,u){return e.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(t,i,u),this},removeOverlay:function(t){return e.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(t),this},clearOverlays:function(){return e.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(t){var i=this.viewport.pixelFromPointNoRotate(t,!0);return new e.Point(i.x*e.pixelDensityRatio,i.y*e.pixelDensityRatio)},clipWithPolygons:function(t,i){if(this.useCanvas){var u=this._getContext(i);u.beginPath(),t.forEach(function(n){n.forEach(function(o,s){u[s===0?"moveTo":"lineTo"](o.x,o.y)})}),u.clip()}},setOpacity:function(t){e.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var i=this.viewer.world,u=0;u<i.getItemCount();u++)i.getItemAt(u).setOpacity(t);return this},getOpacity:function(){e.console.error("drawer.getOpacity is deprecated. Use tiledImage.getOpacity instead.");for(var t=this.viewer.world,i=0,u=0;u<t.getItemCount();u++){var n=t.getItemAt(u).getOpacity();n>i&&(i=n)}return i},needsUpdate:function(){return e.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return e.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return e.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return e.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var t=this._calculateCanvasSize();if((this.canvas.width!==t.x||this.canvas.height!==t.y)&&(this.canvas.width=t.x,this.canvas.height=t.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var i=this._calculateSketchCanvasSize();this.sketchCanvas.width=i.x,this.sketchCanvas.height=i.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(t,i){if(this.useCanvas){var u=this._getContext(t);if(i)u.clearRect(i.x,i.y,i.width,i.height);else{var n=u.canvas;u.clearRect(0,0,n.width,n.height)}}},viewportToDrawerRectangle:function(t){var i=this.viewport.pixelFromPointNoRotate(t.getTopLeft(),!0),u=this.viewport.deltaPixelsFromPointsNoRotate(t.getSize(),!0);return new e.Rect(i.x*e.pixelDensityRatio,i.y*e.pixelDensityRatio,u.x*e.pixelDensityRatio,u.y*e.pixelDensityRatio)},drawTile:function(t,i,u,n,o,s,c){if(e.console.assert(t,"[Drawer.drawTile] tile is required"),e.console.assert(i,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var m=this._getContext(u);n=n||1,t.drawCanvas(m,i,n,o,s,c)}else t.drawHTML(this.canvas)},_getContext:function(t){var i=this.context;if(t){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var u=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=u.x,this.sketchCanvas.height=u.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var n=this;this.viewer.addHandler("rotate",function o(){if(n.viewport.getRotation()!==0){n.viewer.removeHandler("rotate",o);var s=n._calculateSketchCanvasSize();n.sketchCanvas.width=s.x,n.sketchCanvas.height=s.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}i=this.sketchContext}return i},saveContext:function(t){this.useCanvas&&this._getContext(t).save()},restoreContext:function(t){this.useCanvas&&this._getContext(t).restore()},setClip:function(t,i){if(this.useCanvas){var u=this._getContext(i);u.beginPath(),u.rect(t.x,t.y,t.width,t.height),u.clip()}},drawRectangle:function(t,i,u){if(this.useCanvas){var n=this._getContext(u);n.save(),n.fillStyle=i,n.fillRect(t.x,t.y,t.width,t.height),n.restore()}},blendSketch:function(t,i,u,n){var o=t;if(e.isPlainObject(o)||(o={opacity:t,scale:i,translate:u,compositeOperation:n}),this.useCanvas&&this.sketchCanvas){t=o.opacity,n=o.compositeOperation;var s=o.bounds;if(this.context.save(),this.context.globalAlpha=t,n&&(this.context.globalCompositeOperation=n),s)s.x<0&&(s.width+=s.x,s.x=0),s.x+s.width>this.canvas.width&&(s.width=this.canvas.width-s.x),s.y<0&&(s.height+=s.y,s.y=0),s.y+s.height>this.canvas.height&&(s.height=this.canvas.height-s.y),this.context.drawImage(this.sketchCanvas,s.x,s.y,s.width,s.height,s.x,s.y,s.width,s.height);else{i=o.scale||1;var c=(u=o.translate)instanceof e.Point?u:new e.Point(0,0),m=0,_=0;if(u){var S=this.sketchCanvas.width-this.canvas.width,O=this.sketchCanvas.height-this.canvas.height;m=Math.round(S/2),_=Math.round(O/2)}this.context.drawImage(this.sketchCanvas,c.x-m*i,c.y-_*i,(this.canvas.width+2*m)*i,(this.canvas.height+2*_)*i,-m,-_,this.canvas.width+2*m,this.canvas.height+2*_)}this.context.restore()}},drawDebugInfo:function(t,i,u,n){if(this.useCanvas){var o=this.viewer.world.getIndexOfItem(n)%this.debugGridColor.length,s=this.context;s.save(),s.lineWidth=2*e.pixelDensityRatio,s.font="small-caps bold "+13*e.pixelDensityRatio+"px arial",s.strokeStyle=this.debugGridColor[o],s.fillStyle=this.debugGridColor[o],this.viewport.getRotation(!0)%360!=0&&this._offsetForRotation({degrees:this.viewport.getRotation(!0)}),n.getRotation(!0)%360!=0&&this._offsetForRotation({degrees:n.getRotation(!0),point:n.viewport.pixelFromPointNoRotate(n._getRotationPoint(!0),!0)}),n.viewport.getRotation(!0)%360==0&&n.getRotation(!0)%360==0&&n._drawer.viewer.viewport.getFlip()&&n._drawer._flip(),s.strokeRect(t.position.x*e.pixelDensityRatio,t.position.y*e.pixelDensityRatio,t.size.x*e.pixelDensityRatio,t.size.y*e.pixelDensityRatio);var c=(t.position.x+t.size.x/2)*e.pixelDensityRatio,m=(t.position.y+t.size.y/2)*e.pixelDensityRatio;s.translate(c,m),s.rotate(Math.PI/180*-this.viewport.getRotation(!0)),s.translate(-c,-m),t.x===0&&t.y===0&&(s.fillText("Zoom: "+this.viewport.getZoom(),t.position.x*e.pixelDensityRatio,(t.position.y-30)*e.pixelDensityRatio),s.fillText("Pan: "+this.viewport.getBounds().toString(),t.position.x*e.pixelDensityRatio,(t.position.y-20)*e.pixelDensityRatio)),s.fillText("Level: "+t.level,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+20)*e.pixelDensityRatio),s.fillText("Column: "+t.x,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+30)*e.pixelDensityRatio),s.fillText("Row: "+t.y,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+40)*e.pixelDensityRatio),s.fillText("Order: "+u+" of "+i,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+50)*e.pixelDensityRatio),s.fillText("Size: "+t.size.toString(),(t.position.x+10)*e.pixelDensityRatio,(t.position.y+60)*e.pixelDensityRatio),s.fillText("Position: "+t.position.toString(),(t.position.x+10)*e.pixelDensityRatio,(t.position.y+70)*e.pixelDensityRatio),this.viewport.getRotation(!0)%360!=0&&this._restoreRotationChanges(),n.getRotation(!0)%360!=0&&this._restoreRotationChanges(),n.viewport.getRotation(!0)%360==0&&n.getRotation(!0)%360==0&&n._drawer.viewer.viewport.getFlip()&&n._drawer._flip(),s.restore()}},debugRect:function(t){if(this.useCanvas){var i=this.context;i.save(),i.lineWidth=2*e.pixelDensityRatio,i.strokeStyle=this.debugGridColor[0],i.fillStyle=this.debugGridColor[0],i.strokeRect(t.x*e.pixelDensityRatio,t.y*e.pixelDensityRatio,t.width*e.pixelDensityRatio,t.height*e.pixelDensityRatio),i.restore()}},setImageSmoothingEnabled:function(t){this.useCanvas&&(this._imageSmoothingEnabled=t,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(t){t.msImageSmoothingEnabled=this._imageSmoothingEnabled,t.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(t){var i=this._getContext(t).canvas;return new e.Point(i.width,i.height)},getCanvasCenter:function(){return new e.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(t){var i=t.point?t.point.times(e.pixelDensityRatio):this.getCanvasCenter(),u=this._getContext(t.useSketch);u.save(),u.translate(i.x,i.y),this.viewer.viewport.flipped?(u.rotate(Math.PI/180*-t.degrees),u.scale(-1,1)):u.rotate(Math.PI/180*t.degrees),u.translate(-i.x,-i.y)},_flip:function(t){var i=(t=t||{}).point?t.point.times(e.pixelDensityRatio):this.getCanvasCenter(),u=this._getContext(t.useSketch);u.translate(i.x,0),u.scale(-1,1),u.translate(-i.x,0)},_restoreRotationChanges:function(t){this._getContext(t).restore()},_calculateCanvasSize:function(){var t=e.pixelDensityRatio,i=this.viewport.getContainerSize();return{x:Math.round(i.x*t),y:Math.round(i.y*t)}},_calculateSketchCanvasSize:function(){var t=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return t;var i=Math.ceil(Math.sqrt(t.x*t.x+t.y*t.y));return{x:i,y:i}}}}(b),function(e){e.Viewport=function(t){var i=arguments;i.length&&i[0]instanceof e.Point&&(t={containerSize:i[0],contentSize:i[1],config:i[2]}),t.config&&(e.extend(!0,t,t.config),delete t.config),this._margins=e.extend({left:0,top:0,right:0,bottom:0},t.margins||{}),delete t.margins,t.initialDegrees=t.degrees,delete t.degrees,e.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,rotationPivot:null,viewer:null,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:e.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:e.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:e.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:e.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:e.DEFAULT_SETTINGS.maxZoomLevel,initialDegrees:e.DEFAULT_SETTINGS.degrees,flipped:e.DEFAULT_SETTINGS.flipped,homeFillsViewer:e.DEFAULT_SETTINGS.homeFillsViewer,silenceMultiImageWarnings:e.DEFAULT_SETTINGS.silenceMultiImageWarnings},t),this._updateContainerInnerSize(),this.centerSpringX=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new e.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.degreesSpring=new e.Spring({initial:t.initialDegrees,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._oldDegrees=this.degreesSpring.current.value,this._setContentBounds(new e.Rect(0,0,1,1),1),this.goHome(!0),this.update()},e.Viewport.prototype={get degrees(){return e.console.warn("Accessing [Viewport.degrees] is deprecated. Use viewport.getRotation instead."),this.getRotation()},set degrees(t){e.console.warn("Setting [Viewport.degrees] is deprecated. Use viewport.rotateTo, viewport.rotateBy, or viewport.setRotation instead."),this.rotateTo(t)},resetContentSize:function(t){return e.console.assert(t,"[Viewport.resetContentSize] contentSize is required"),e.console.assert(t instanceof e.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),e.console.assert(t.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),e.console.assert(t.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new e.Rect(0,0,1,t.y/t.x),t.x),this},setHomeBounds:function(t,i){e.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(t,i)},_setContentBounds:function(t,i){e.console.assert(t,"[Viewport._setContentBounds] bounds is required"),e.console.assert(t instanceof e.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),e.console.assert(t.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),e.console.assert(t.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=t.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(i),this._contentBounds=t.rotate(this.getRotation()).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(i),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:i,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var t=this._contentAspectRatio/this.getAspectRatio();return(this.homeFillsViewer?t>=1?t:1:t>=1?1:t)/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var t=this._contentBounds.getCenter(),i=1/this.getHomeZoom(),u=i/this.getAspectRatio();return new e.Rect(t.x-i/2,t.y-u/2,i,u)},goHome:function(t){return this.viewer&&this.viewer.raiseEvent("home",{immediately:t}),this.fitBounds(this.getHomeBounds(),t)},getMinZoom:function(){var t=this.getHomeZoom();return this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*t},getMaxZoom:function(){var t=this.maxZoomLevel;return t||(t=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,t/=this._contentBounds.width),Math.max(t,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new e.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return e.extend({},this._margins)},setMargins:function(t){e.console.assert(e.type(t)==="object","[Viewport.setMargins] margins must be an object"),this._margins=e.extend({left:0,top:0,right:0,bottom:0},t),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(t){return this.getBoundsNoRotate(t).rotate(-this.getRotation(t))},getBoundsNoRotate:function(t){var i=this.getCenter(t),u=1/this.getZoom(t),n=u/this.getAspectRatio();return new e.Rect(i.x-u/2,i.y-n/2,u,n)},getBoundsWithMargins:function(t){return this.getBoundsNoRotateWithMargins(t).rotate(-this.getRotation(t),this.getCenter(t))},getBoundsNoRotateWithMargins:function(t){var i=this.getBoundsNoRotate(t),u=this._containerInnerSize.x*this.getZoom(t);return i.x-=this._margins.left/u,i.y-=this._margins.top/u,i.width+=(this._margins.left+this._margins.right)/u,i.height+=(this._margins.top+this._margins.bottom)/u,i},getCenter:function(t){var i,u,n,o,s,c,m=new e.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),_=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return t?m:this.zoomPoint?(i=this.pixelFromPoint(this.zoomPoint,!0),o=(n=1/(u=this.getZoom()))/this.getAspectRatio(),s=new e.Rect(m.x-n/2,m.y-o/2,n,o),c=this._pixelFromPoint(this.zoomPoint,s).minus(i).rotate(-this.getRotation(!0)).divide(this._containerInnerSize.x*u),_.plus(c)):_},getZoom:function(t){return t?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(t){return Math.max(Math.min(t,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(t){var i=this.viewportToViewerElementRectangle(t).getBoundingBox(),u=this.viewportToViewerElementRectangle(this._contentBoundsNoRotate).getBoundingBox(),n=!1,o=!1;if(!this.wrapHorizontal){var s,c,m,_=i.x+i.width,S=u.x+u.width;s=i.width>u.width?this.visibilityRatio*u.width:this.visibilityRatio*i.width,c=u.x-_+s,m=S-i.x-s,s>u.width?(i.x+=(c+m)/2,n=!0):m<0?(i.x+=m,n=!0):c>0&&(i.x+=c,n=!0)}if(!this.wrapVertical){var O,N,B,U=i.y+i.height,W=u.y+u.height;O=i.height>u.height?this.visibilityRatio*u.height:this.visibilityRatio*i.height,N=u.y-U+O,B=W-i.y-O,O>u.height?(i.y+=(N+B)/2,o=!0):B<0?(i.y+=B,o=!0):N>0&&(i.y+=N,o=!0)}var H=n||o,$=H?this.viewerElementToViewportRectangle(i):t.clone();return $.xConstrained=n,$.yConstrained=o,$.constraintApplied=H,$},_raiseConstraintsEvent:function(t){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:t})},applyConstraints:function(t){var i=this.getZoom(),u=this._applyZoomConstraints(i);i!==u&&this.zoomTo(u,this.zoomPoint,t);var n=this.getConstrainedBounds(!1);return n.constraintApplied&&(this.fitBounds(n,t),this._raiseConstraintsEvent(t)),this},ensureVisible:function(t){return this.applyConstraints(t)},_fitBounds:function(t,i){var u=(i=i||{}).immediately||!1,n=i.constraints||!1,o=this.getAspectRatio(),s=t.getCenter(),c=new e.Rect(t.x,t.y,t.width,t.height,t.degrees+this.getRotation()).getBoundingBox();c.getAspectRatio()>=o?c.height=c.width/o:c.width=c.height*o,c.x=s.x-c.width/2,c.y=s.y-c.height/2;var m=1/c.width;if(u)return this.panTo(s,!0),this.zoomTo(m,null,!0),n&&this.applyConstraints(!0),this;var _=this.getCenter(!0),S=this.getZoom(!0);this.panTo(_,!0),this.zoomTo(S,null,!0);var O=this.getBounds(),N=this.getZoom();if(N===0||Math.abs(m/N-1)<1e-8)return this.zoomTo(m,null,!0),this.panTo(s,u),n&&this.applyConstraints(!1),this;if(n){this.panTo(s,!1),m=this._applyZoomConstraints(m),this.zoomTo(m,null,!1);var B=this.getConstrainedBounds();this.panTo(_,!0),this.zoomTo(S,null,!0),this.fitBounds(B)}else{var U=c.rotate(-this.getRotation()).getTopLeft().times(m).minus(O.getTopLeft().times(N)).divide(m-N);this.zoomTo(m,U,u)}return this},fitBounds:function(t,i){return this._fitBounds(t,{immediately:i,constraints:!1})},fitBoundsWithConstraints:function(t,i){return this._fitBounds(t,{immediately:i,constraints:!0})},fitVertically:function(t){var i=new e.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(i,t)},fitHorizontally:function(t){var i=new e.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(i,t)},getConstrainedBounds:function(t){var i;return i=this.getBounds(t),this._applyBoundaryConstraints(i)},panBy:function(t,i){var u=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(u.plus(t),i)},panTo:function(t,i){return i?(this.centerSpringX.resetTo(t.x),this.centerSpringY.resetTo(t.y)):(this.centerSpringX.springTo(t.x),this.centerSpringY.springTo(t.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:t,immediately:i}),this},zoomBy:function(t,i,u){return this.zoomTo(this.zoomSpring.target.value*t,i,u)},zoomTo:function(t,i,u){var n=this;return this.zoomPoint=i instanceof e.Point&&!isNaN(i.x)&&!isNaN(i.y)?i:null,u?this._adjustCenterSpringsForZoomPoint(function(){n.zoomSpring.resetTo(t)}):this.zoomSpring.springTo(t),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:t,refPoint:i,immediately:u}),this},setRotation:function(t,i){return this.rotateTo(t,null,i)},getRotation:function(t){return t?this.degreesSpring.current.value:this.degreesSpring.target.value},setRotationWithPivot:function(t,i,u){return this.rotateTo(t,i,u)},rotateTo:function(t,i,u){if(!this.viewer||!this.viewer.drawer.canRotate())return this;if(this.degreesSpring.target.value===t&&this.degreesSpring.isAtTargetValue())return this;if(this.rotationPivot=i instanceof e.Point&&!isNaN(i.x)&&!isNaN(i.y)?i:null,u)if(this.rotationPivot){if(!(t-this._oldDegrees))return this.rotationPivot=null,this;this._rotateAboutPivot(t)}else this.degreesSpring.resetTo(t);else{var n=e.positiveModulo(this.degreesSpring.current.value,360),o=e.positiveModulo(t,360),s=o-n;s>180?o-=360:s<-180&&(o+=360);var c=n-o;this.degreesSpring.resetTo(t+c),this.degreesSpring.springTo(t)}return this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:t,immediately:!!u,pivot:this.rotationPivot||this.getCenter()}),this},rotateBy:function(t,i,u){return this.rotateTo(this.degreesSpring.target.value+t,i,u)},resize:function(t,i){var u,n=this.getBoundsNoRotate(),o=n;this.containerSize.x=t.x,this.containerSize.y=t.y,this._updateContainerInnerSize(),i&&(u=t.x/this.containerSize.x,o.width=n.width*u,o.height=o.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:t,maintain:i});var s=this.fitBounds(o,!0);return this.viewer&&this.viewer.raiseEvent("after-resize",{newContainerSize:t,maintain:i}),s},_updateContainerInnerSize:function(){this._containerInnerSize=new e.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var t=this;this._adjustCenterSpringsForZoomPoint(function(){t.zoomSpring.update()}),this.degreesSpring.isAtTargetValue()&&(this.rotationPivot=null),this.centerSpringX.update(),this.centerSpringY.update(),this.rotationPivot?this._rotateAboutPivot(!0):this.degreesSpring.update();var i=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom||this.degreesSpring.current.value!==this._oldDegrees;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._oldDegrees=this.degreesSpring.current.value,i},_rotateAboutPivot:function(t){var i=t===!0,u=this.rotationPivot.minus(this.getCenter());this.centerSpringX.shiftBy(u.x),this.centerSpringY.shiftBy(u.y),i?this.degreesSpring.update():this.degreesSpring.resetTo(t);var n=this.degreesSpring.current.value-this._oldDegrees,o=u.rotate(-1*n).times(-1);this.centerSpringX.shiftBy(o.x),this.centerSpringY.shiftBy(o.y)},_adjustCenterSpringsForZoomPoint:function(t){if(this.zoomPoint){var i=this.pixelFromPoint(this.zoomPoint,!0);t();var u=this.pixelFromPoint(this.zoomPoint,!0).minus(i),n=this.deltaPointsFromPixels(u,!0);this.centerSpringX.shiftBy(n.x),this.centerSpringY.shiftBy(n.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else t()},deltaPixelsFromPointsNoRotate:function(t,i){return t.times(this._containerInnerSize.x*this.getZoom(i))},deltaPixelsFromPoints:function(t,i){return this.deltaPixelsFromPointsNoRotate(t.rotate(this.getRotation(i)),i)},deltaPointsFromPixelsNoRotate:function(t,i){return t.divide(this._containerInnerSize.x*this.getZoom(i))},deltaPointsFromPixels:function(t,i){return this.deltaPointsFromPixelsNoRotate(t,i).rotate(-this.getRotation(i))},pixelFromPointNoRotate:function(t,i){return this._pixelFromPointNoRotate(t,this.getBoundsNoRotate(i))},pixelFromPoint:function(t,i){return this._pixelFromPoint(t,this.getBoundsNoRotate(i))},_pixelFromPointNoRotate:function(t,i){return t.minus(i.getTopLeft()).times(this._containerInnerSize.x/i.width).plus(new e.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(t,i){return this._pixelFromPointNoRotate(t.rotate(this.getRotation(!0),this.getCenter(!0)),i)},pointFromPixelNoRotate:function(t,i){var u=this.getBoundsNoRotate(i);return t.minus(new e.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/u.width).plus(u.getTopLeft())},pointFromPixel:function(t,i){return this.pointFromPixelNoRotate(t,i).rotate(-this.getRotation(i),this.getCenter(i))},_viewportToImageDelta:function(t,i){var u=this._contentBoundsNoRotate.width;return new e.Point(t*this._contentSizeNoRotate.x/u,i*this._contentSizeNoRotate.x/u)},viewportToImageCoordinates:function(t,i){if(t instanceof e.Point)return this.viewportToImageCoordinates(t.x,t.y);if(this.viewer){var u=this.viewer.world.getItemCount();if(u>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(u===1)return this.viewer.world.getItemAt(0).viewportToImageCoordinates(t,i,!0)}return this._viewportToImageDelta(t-this._contentBoundsNoRotate.x,i-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(t,i){var u=this._contentBoundsNoRotate.width;return new e.Point(t/this._contentSizeNoRotate.x*u,i/this._contentSizeNoRotate.x*u)},imageToViewportCoordinates:function(t,i){if(t instanceof e.Point)return this.imageToViewportCoordinates(t.x,t.y);if(this.viewer){var u=this.viewer.world.getItemCount();if(u>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(u===1)return this.viewer.world.getItemAt(0).imageToViewportCoordinates(t,i,!0)}var n=this._imageToViewportDelta(t,i);return n.x+=this._contentBoundsNoRotate.x,n.y+=this._contentBoundsNoRotate.y,n},imageToViewportRectangle:function(t,i,u,n){var o=t;if(o instanceof e.Rect||(o=new e.Rect(t,i,u,n)),this.viewer){var s=this.viewer.world.getItemCount();if(s>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(s===1)return this.viewer.world.getItemAt(0).imageToViewportRectangle(t,i,u,n,!0)}var c=this.imageToViewportCoordinates(o.x,o.y),m=this._imageToViewportDelta(o.width,o.height);return new e.Rect(c.x,c.y,m.x,m.y,o.degrees)},viewportToImageRectangle:function(t,i,u,n){var o=t;if(o instanceof e.Rect||(o=new e.Rect(t,i,u,n)),this.viewer){var s=this.viewer.world.getItemCount();if(s>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(s===1)return this.viewer.world.getItemAt(0).viewportToImageRectangle(t,i,u,n,!0)}var c=this.viewportToImageCoordinates(o.x,o.y),m=this._viewportToImageDelta(o.width,o.height);return new e.Rect(c.x,c.y,m.x,m.y,o.degrees)},viewerElementToImageCoordinates:function(t){var i=this.pointFromPixel(t,!0);return this.viewportToImageCoordinates(i)},imageToViewerElementCoordinates:function(t){var i=this.imageToViewportCoordinates(t);return this.pixelFromPoint(i,!0)},windowToImageCoordinates:function(t){e.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var i=t.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(i)},imageToWindowCoordinates:function(t){return e.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer."),this.imageToViewerElementCoordinates(t).plus(e.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(t){return this.pointFromPixel(t,!0)},viewportToViewerElementCoordinates:function(t){return this.pixelFromPoint(t,!0)},viewerElementToViewportRectangle:function(t){return e.Rect.fromSummits(this.pointFromPixel(t.getTopLeft(),!0),this.pointFromPixel(t.getTopRight(),!0),this.pointFromPixel(t.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(t){return e.Rect.fromSummits(this.pixelFromPoint(t.getTopLeft(),!0),this.pixelFromPoint(t.getTopRight(),!0),this.pixelFromPoint(t.getBottomLeft(),!0))},windowToViewportCoordinates:function(t){e.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var i=t.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(i)},viewportToWindowCoordinates:function(t){return e.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer."),this.viewportToViewerElementCoordinates(t).plus(e.getElementPosition(this.viewer.element))},viewportToImageZoom:function(t){if(this.viewer){var i=this.viewer.world.getItemCount();if(i>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(i===1)return this.viewer.world.getItemAt(0).viewportToImageZoom(t)}var u=this._contentSizeNoRotate.x;return t*(this._containerInnerSize.x/u*this._contentBoundsNoRotate.width)},imageToViewportZoom:function(t){if(this.viewer){var i=this.viewer.world.getItemCount();if(i>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(i===1)return this.viewer.world.getItemAt(0).imageToViewportZoom(t)}return t*(this._contentSizeNoRotate.x/this._containerInnerSize.x/this._contentBoundsNoRotate.width)},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(t){return this.flipped===t||(this.flipped=t,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:t})),this}}}(b),function(e){e.TiledImage=function(n){var o=this;e.console.assert(n.tileCache,"[TiledImage] options.tileCache is required"),e.console.assert(n.drawer,"[TiledImage] options.drawer is required"),e.console.assert(n.viewer,"[TiledImage] options.viewer is required"),e.console.assert(n.imageLoader,"[TiledImage] options.imageLoader is required"),e.console.assert(n.source,"[TiledImage] options.source is required"),e.console.assert(!n.clip||n.clip instanceof e.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),e.EventSource.call(this),this._tileCache=n.tileCache,delete n.tileCache,this._drawer=n.drawer,delete n.drawer,this._imageLoader=n.imageLoader,delete n.imageLoader,n.clip instanceof e.Rect&&(this._clip=n.clip.clone()),delete n.clip;var s=n.x||0;delete n.x;var c=n.y||0;delete n.y,this.normHeight=n.source.dimensions.y/n.source.dimensions.x,this.contentAspectX=n.source.dimensions.x/n.source.dimensions.y;var m=1;n.width?(m=n.width,delete n.width,n.height&&(e.console.error("specifying both width and height to a tiledImage is not supported"),delete n.height)):n.height&&(m=n.height/this.normHeight,delete n.height);var _=n.fitBounds;delete n.fitBounds;var S=n.fitBoundsPlacement||b.Placement.CENTER;delete n.fitBoundsPlacement;var O=n.degrees||0;delete n.degrees;var N=n.ajaxHeaders;delete n.ajaxHeaders,e.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,immediateRender:e.DEFAULT_SETTINGS.immediateRender,blendTime:e.DEFAULT_SETTINGS.blendTime,alwaysBlend:e.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:e.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:e.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:e.DEFAULT_SETTINGS.iOSDevice,debugMode:e.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:e.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:e.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:e.DEFAULT_SETTINGS.placeholderFillStyle,opacity:e.DEFAULT_SETTINGS.opacity,preload:e.DEFAULT_SETTINGS.preload,compositeOperation:e.DEFAULT_SETTINGS.compositeOperation,subPixelRoundingForTransparency:e.DEFAULT_SETTINGS.subPixelRoundingForTransparency},n),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new e.Spring({initial:s,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new e.Spring({initial:c,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new e.Spring({initial:m,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new e.Spring({initial:O,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),_&&this.fitBounds(_,S,!0),this._drawingHandler=function(B){o.viewer.raiseEvent("tile-drawing",e.extend({tiledImage:o},B))},this._ownAjaxHeaders={},this.setAjaxHeaders(N,!1)},e.extend(e.TiledImage.prototype,e.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(n){n!==this._fullyLoaded&&(this._fullyLoaded=n,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=e.now(),this._needsDraw=!0},update:function(){var n=this._xSpring.update(),o=this._ySpring.update(),s=this._scaleSpring.update(),c=this._degreesSpring.update();return!!(n||o||s||c)&&(this._updateForScale(),this._needsDraw=!0,!0)},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(n){return this.getBoundsNoRotate(n).rotate(this.getRotation(n),this._getRotationPoint(n))},getBoundsNoRotate:function(n){return n?new e.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new e.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return e.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(n){var o=this.getBoundsNoRotate(n);if(this._clip){var s=(n?this._worldWidthCurrent:this._worldWidthTarget)/this.source.dimensions.x,c=this._clip.times(s);o=new e.Rect(o.x+c.x,o.y+c.y,c.width,c.height)}return o.rotate(this.getRotation(n),this._getRotationPoint(n))},getTileBounds:function(n,o,s){var c=this.source.getNumTiles(n),m=(c.x+o%c.x)%c.x,_=(c.y+s%c.y)%c.y,S=this.source.getTileBounds(n,m,_);return this.getFlip()&&(S.x=1-S.x-S.width),S.x+=(o-m)/c.x,S.y+=this._worldHeightCurrent/this._worldWidthCurrent*((s-_)/c.y),S},getContentSize:function(){return new e.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var n=this.imageToWindowCoordinates(new e.Point(0,0)),o=this.imageToWindowCoordinates(this.getContentSize());return new e.Point(o.x-n.x,o.y-n.y)},_viewportToImageDelta:function(n,o,s){var c=s?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(n*(this.source.dimensions.x/c),o*(this.source.dimensions.y*this.contentAspectX/c))},viewportToImageCoordinates:function(n,o,s){var c;return n instanceof e.Point?(s=o,c=n):c=new e.Point(n,o),c=c.rotate(-this.getRotation(s),this._getRotationPoint(s)),s?this._viewportToImageDelta(c.x-this._xSpring.current.value,c.y-this._ySpring.current.value):this._viewportToImageDelta(c.x-this._xSpring.target.value,c.y-this._ySpring.target.value)},_imageToViewportDelta:function(n,o,s){var c=s?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(n/this.source.dimensions.x*c,o/this.source.dimensions.y/this.contentAspectX*c)},imageToViewportCoordinates:function(n,o,s){n instanceof e.Point&&(s=o,o=n.y,n=n.x);var c=this._imageToViewportDelta(n,o);return s?(c.x+=this._xSpring.current.value,c.y+=this._ySpring.current.value):(c.x+=this._xSpring.target.value,c.y+=this._ySpring.target.value),c.rotate(this.getRotation(s),this._getRotationPoint(s))},imageToViewportRectangle:function(n,o,s,c,m){var _=n;_ instanceof e.Rect?m=o:_=new e.Rect(n,o,s,c);var S=this.imageToViewportCoordinates(_.getTopLeft(),m),O=this._imageToViewportDelta(_.width,_.height,m);return new e.Rect(S.x,S.y,O.x,O.y,_.degrees+this.getRotation(m))},viewportToImageRectangle:function(n,o,s,c,m){var _=n;n instanceof e.Rect?m=o:_=new e.Rect(n,o,s,c);var S=this.viewportToImageCoordinates(_.getTopLeft(),m),O=this._viewportToImageDelta(_.width,_.height,m);return new e.Rect(S.x,S.y,O.x,O.y,_.degrees-this.getRotation(m))},viewerElementToImageCoordinates:function(n){var o=this.viewport.pointFromPixel(n,!0);return this.viewportToImageCoordinates(o)},imageToViewerElementCoordinates:function(n){var o=this.imageToViewportCoordinates(n);return this.viewport.pixelFromPoint(o,!0)},windowToImageCoordinates:function(n){var o=n.minus(b.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(o)},imageToWindowCoordinates:function(n){return this.imageToViewerElementCoordinates(n).plus(b.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(n){var o=this._scaleSpring.current.value;return n=n.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new e.Rect((n.x-this._xSpring.current.value)/o,(n.y-this._ySpring.current.value)/o,n.width/o,n.height/o,n.degrees)},viewportToImageZoom:function(n){return this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x*n},imageToViewportZoom:function(n){return n/(this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x)},setPosition:function(n,o){var s=this._xSpring.target.value===n.x&&this._ySpring.target.value===n.y;if(o){if(s&&this._xSpring.current.value===n.x&&this._ySpring.current.value===n.y)return;this._xSpring.resetTo(n.x),this._ySpring.resetTo(n.y),this._needsDraw=!0}else{if(s)return;this._xSpring.springTo(n.x),this._ySpring.springTo(n.y),this._needsDraw=!0}s||this._raiseBoundsChange()},setWidth:function(n,o){this._setScale(n,o)},setHeight:function(n,o){this._setScale(n/this.normHeight,o)},setCroppingPolygons:function(n){var o=function(s){return s.map(function(c){try{if(function(m){return m instanceof e.Point||typeof m.x=="number"&&typeof m.y=="number"}(c))return{x:c.x,y:c.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!e.isArray(n))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=n.map(function(s){return o(s)})}catch(s){e.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),e.console.error(s),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(n,o,s){o=o||e.Placement.CENTER;var c=e.Placement.properties[o],m=this.contentAspectX,_=0,S=0,O=1,N=1;if(this._clip&&(m=this._clip.getAspectRatio(),O=this._clip.width/this.source.dimensions.x,N=this._clip.height/this.source.dimensions.y,n.getAspectRatio()>m?(_=this._clip.x/this._clip.height*n.height,S=this._clip.y/this._clip.height*n.height):(_=this._clip.x/this._clip.width*n.width,S=this._clip.y/this._clip.width*n.width)),n.getAspectRatio()>m){var B=n.height/N,U=0;c.isHorizontallyCentered?U=(n.width-n.height*m)/2:c.isRight&&(U=n.width-n.height*m),this.setPosition(new e.Point(n.x-_+U,n.y-S),s),this.setHeight(B,s)}else{var W=n.width/O,H=0;c.isVerticallyCentered?H=(n.height-n.width/m)/2:c.isBottom&&(H=n.height-n.width/m),this.setPosition(new e.Point(n.x-_,n.y-S+H),s),this.setWidth(W,s)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(n){e.console.assert(!n||n instanceof e.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),n instanceof e.Rect?this._clip=n.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(n){this.flipped=!!n,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(n){n!==this.opacity&&(this.opacity=n,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(n){this._preload=!!n,this._needsDraw=!0},getRotation:function(n){return n?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(n,o){this._degreesSpring.target.value===n&&this._degreesSpring.isAtTargetValue()||(o?this._degreesSpring.resetTo(n):this._degreesSpring.springTo(n),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(n){return this.getBoundsNoRotate(n).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(n){n!==this.compositeOperation&&(this.compositeOperation=n,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},setAjaxHeaders:function(n,o){n===null&&(n={}),e.isPlainObject(n)&&(this._ownAjaxHeaders=n,this._updateAjaxHeaders(o))},_updateAjaxHeaders:function(n){if(n===void 0&&(n=!0),e.isPlainObject(this.viewer.ajaxHeaders)?this.ajaxHeaders=e.extend({},this.viewer.ajaxHeaders,this._ownAjaxHeaders):this.ajaxHeaders=this._ownAjaxHeaders,n){var o,s,c,m;for(var _ in this.tilesMatrix)for(var S in o=this.source.getNumTiles(_),this.tilesMatrix[_])for(var O in s=(o.x+S%o.x)%o.x,this.tilesMatrix[_][S])if(c=(o.y+O%o.y)%o.y,(m=this.tilesMatrix[_][S][O]).loadWithAjax=this.loadTilesWithAjax,m.loadWithAjax){var N=this.source.getTileAjaxHeaders(_,s,c);m.ajaxHeaders=e.extend({},this.ajaxHeaders,N)}else m.ajaxHeaders=null;for(var B=0;B<this._imageLoader.jobQueue.length;B++){var U=this._imageLoader.jobQueue[B];U.loadWithAjax=U.tile.loadWithAjax,U.ajaxHeaders=U.tile.loadWithAjax?U.tile.ajaxHeaders:null}}},_setScale:function(n,o){var s=this._scaleSpring.target.value===n;if(o){if(s&&this._scaleSpring.current.value===n)return;this._scaleSpring.resetTo(n),this._updateForScale(),this._needsDraw=!0}else{if(s)return;this._scaleSpring.springTo(n),this._updateForScale(),this._needsDraw=!0}s||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var n=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),o=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,s=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(o/this.minPixelRatio)/Math.log(2))));return s=Math.max(s,this.source.minLevel||0),{lowestLevel:n=Math.min(n,s),highestLevel:s}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;)this.lastDrawn.pop().beingDrawn=!1;var n=this.viewport,o=this._viewportToTiledImageRectangle(n.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var s=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if((o=o.intersection(s))===null)return}for(var c=this._getLevelsInterval(),m=c.lowestLevel,_=c.highestLevel,S=null,O=!1,N=e.now(),B=_;B>=m;B--){var U=!1,W=n.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(B),!0).x*this._scaleSpring.current.value;if(B===m||!O&&W>=this.minPixelRatio)U=!0,O=!0;else if(!O)continue;var H=n.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(B),!1).x*this._scaleSpring.current.value,$=n.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,K=this.immediateRender?1:$,Q=Math.min(1,(W-.5)/.5),re=K/Math.abs(K-H);if(S=this._updateLevel(O,U,B,Q,re,o,N,S),this._providesCoverage(this.coverage,B))break}this._drawTiles(this.lastDrawn),S&&!S.context2D?(this._loadTile(S,N),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(n,o,s){var c,m,_,S;this.wrapHorizontal?(c=e.positiveModulo(o.x,1),m=e.positiveModulo(s.x,1)):(c=Math.max(0,o.x),m=Math.min(1,s.x));var O=1/this.source.aspectRatio;this.wrapVertical?(_=e.positiveModulo(o.y,O),S=e.positiveModulo(s.y,O)):(_=Math.max(0,o.y),S=Math.min(O,s.y));var N=this.source.getTileAtPoint(n,new e.Point(c,_)),B=this.source.getTileAtPoint(n,new e.Point(m,S)),U=this.source.getNumTiles(n);return this.wrapHorizontal&&(N.x+=U.x*Math.floor(o.x),B.x+=U.x*Math.floor(s.x)),this.wrapVertical&&(N.y+=U.y*Math.floor(o.y/O),B.y+=U.y*Math.floor(s.y/O)),{topLeft:N,bottomRight:B}},_updateLevel:function(n,o,s,c,m,_,S,O){var N=_.getBoundingBox().getTopLeft(),B=_.getBoundingBox().getBottomRight();this.viewer&&this.viewer.raiseEvent("update-level",{tiledImage:this,havedrawn:n,level:s,opacity:c,visibility:m,drawArea:_,topleft:N,bottomright:B,currenttime:S,best:O}),this._resetCoverage(this.coverage,s),this._resetCoverage(this.loadingCoverage,s);var U=this._getCornerTiles(s,N,B),W=U.topLeft,H=U.bottomRight,$=this.source.getNumTiles(s),K=this.viewport.pixelFromPoint(this.viewport.getCenter());this.getFlip()&&(H.x+=1,this.wrapHorizontal||(H.x=Math.min(H.x,$.x-1)));for(var Q=W.x;Q<=H.x;Q++)for(var re=W.y;re<=H.y;re++){var Y;if(this.getFlip()){var he=($.x+Q%$.x)%$.x;Y=Q+$.x-he-he-1}else Y=Q;_.intersection(this.getTileBounds(s,Y,re))!==null&&(O=this._updateTile(o,n,Y,re,s,c,m,K,$,S,O))}return O},_updateTile:function(n,o,s,c,m,_,S,O,N,B,U){var W=this._getTile(s,c,m,B,N,this._worldWidthCurrent,this._worldHeightCurrent),H=o;this.viewer&&this.viewer.raiseEvent("update-tile",{tiledImage:this,tile:W}),this._setCoverage(this.coverage,m,s,c,!1);var $=W.loaded||W.loading||this._isCovered(this.loadingCoverage,m,s,c);if(this._setCoverage(this.loadingCoverage,m,s,c,$),!W.exists||(n&&!H&&(this._isCovered(this.coverage,m,s,c)?this._setCoverage(this.coverage,m,s,c,!0):H=!0),!H))return U;if(this._positionTile(W,this.source.tileOverlap,this.viewport,O,S),!W.loaded)if(W.context2D)this._setTileLoaded(W);else{var K=this._tileCache.getImageRecord(W.cacheKey);K&&this._setTileLoaded(W,K.getData())}return W.loaded?this._blendTile(W,s,c,m,_,B)&&(this._needsDraw=!0):W.loading?this._tilesLoading++:$||(U=this._compareTiles(U,W)),U},_getTile:function(n,o,s,c,m,_,S){var O,N,B,U,W,H,$,K,Q,re,Y=this.tilesMatrix,he=this.source;return Y[s]||(Y[s]={}),Y[s][n]||(Y[s][n]={}),Y[s][n][o]&&!Y[s][n][o].flipped==!this.flipped||(O=(m.x+n%m.x)%m.x,N=(m.y+o%m.y)%m.y,B=this.getTileBounds(s,n,o),U=he.getTileBounds(s,O,N,!0),W=he.tileExists(s,O,N),H=he.getTileUrl(s,O,N),$=he.getTilePostData(s,O,N),this.loadTilesWithAjax?(K=he.getTileAjaxHeaders(s,O,N),e.isPlainObject(this.ajaxHeaders)&&(K=e.extend({},this.ajaxHeaders,K))):K=null,Q=he.getContext2D?he.getContext2D(s,O,N):void 0,re=new e.Tile(s,n,o,B,W,H,Q,this.loadTilesWithAjax,K,U,$,he.getTileHashKey(s,O,N,H,K,$)),this.getFlip()?O===0&&(re.isRightMost=!0):O===m.x-1&&(re.isRightMost=!0),N===m.y-1&&(re.isBottomMost=!0),re.flipped=this.flipped,Y[s][n][o]=re),(re=Y[s][n][o]).lastTouchTime=c,re},_loadTile:function(n,o){var s=this;n.loading=!0,this._imageLoader.addJob({src:n.getUrl(),tile:n,source:this.source,postData:n.postData,loadWithAjax:n.loadWithAjax,ajaxHeaders:n.ajaxHeaders,crossOriginPolicy:this.crossOriginPolicy,ajaxWithCredentials:this.ajaxWithCredentials,callback:function(c,m,_){s._onTileLoad(n,o,c,m,_)},abort:function(){n.loading=!1}})},_onTileLoad:function(n,o,s,c,m){if(!s)return e.console.error("Tile %s failed to load: %s - error: %s",n,n.getUrl(),c),this.viewer.raiseEvent("tile-load-failed",{tile:n,tiledImage:this,time:o,message:c,tileRequest:m}),n.loading=!1,void(n.exists=!1);if(n.exists=!0,o<this.lastResetTime)return e.console.warn("Ignoring tile %s loaded before reset: %s",n,n.getUrl()),void(n.loading=!1);var _=this,S=function(){var O=_.source.getClosestLevel();_._setTileLoaded(n,s,O,m)};this._midDraw?window.setTimeout(S,1):S()},_setTileLoaded:function(n,o,s,c){var m=0,_=!1,S=this;function O(){return _&&e.console.error("Event 'tile-loaded' argument getCompletionCallback must be called synchronously. Its return value should be called asynchronously."),m++,N}function N(){--m===0&&(n.loading=!1,n.loaded=!0,n.hasTransparency=S.source.hasTransparency(n.context2D,n.getUrl(),n.ajaxHeaders,n.postData),n.context2D||S._tileCache.cacheTile({data:o,tile:n,cutoff:s,tiledImage:S}),S._needsDraw=!0)}var B=O();this.viewer.raiseEvent("tile-loaded",{tile:n,tiledImage:this,tileRequest:c,get image(){return e.console.error("[tile-loaded] event 'image' has been deprecated. Use 'data' property instead."),o},data:o,getCompletionCallback:O}),_=!0,B()},_positionTile:function(n,o,s,c,m){var _=n.bounds.getTopLeft();_.x*=this._scaleSpring.current.value,_.y*=this._scaleSpring.current.value,_.x+=this._xSpring.current.value,_.y+=this._ySpring.current.value;var S=n.bounds.getSize();S.x*=this._scaleSpring.current.value,S.y*=this._scaleSpring.current.value;var O=s.pixelFromPointNoRotate(_,!0),N=s.pixelFromPointNoRotate(_,!1),B=s.deltaPixelsFromPointsNoRotate(S,!0),U=s.deltaPixelsFromPointsNoRotate(S,!1),W=N.plus(U.divide(2)),H=c.squaredDistanceTo(W);o||(B=B.plus(new e.Point(1,1))),n.isRightMost&&this.wrapHorizontal&&(B.x+=.75),n.isBottomMost&&this.wrapVertical&&(B.y+=.75),n.position=O,n.size=B,n.squaredDistance=H,n.visibility=m},_blendTile:function(n,o,s,c,m,_){var S,O,N=1e3*this.blendTime;if(n.blendStart||(n.blendStart=_),S=_-n.blendStart,O=N?Math.min(1,S/N):1,this.alwaysBlend&&(O*=m),n.opacity=O,this.lastDrawn.push(n),O===1)this._setCoverage(this.coverage,c,o,s,!0),this._hasOpaqueTile=!0;else if(S<N)return!0;return!1},_compareTiles:function(n,o){return n?o.visibility>n.visibility||o.visibility===n.visibility&&o.squaredDistance<n.squaredDistance?o:n:o},_drawTiles:function(n){if(this.opacity!==0&&(n.length!==0||this.placeholderFillStyle)){var o,s,c,m=n[0];m&&(o=this.opacity<1||this.compositeOperation&&this.compositeOperation!=="source-over"||!this._isBottomItem()&&this.source.hasTransparency(m.context2D,m.getUrl(),m.ajaxHeaders,m.postData));var _,S=this.viewport.getZoom(!0),O=this.viewportToImageZoom(S);n.length>1&&O>this.smoothTileEdgesMinZoom&&!this.iOSDevice&&this.getRotation(!0)%360==0&&e.supportsCanvas&&this.viewer.useCanvas&&(o=!0,s=m.getScaleForEdgeSmoothing(),c=m.getTranslationForEdgeSmoothing(s,this._drawer.getCanvasSize(!1),this._drawer.getCanvasSize(!0))),o&&(s||(_=this.viewport.viewportToViewerElementRectangle(this.getClippedBounds(!0)).getIntegerBoundingBox(),this._drawer.viewer.viewport.getFlip()&&(this.viewport.getRotation(!0)%360==0&&this.getRotation(!0)%360==0||(_.x=this._drawer.viewer.container.clientWidth-(_.x+_.width))),_=_.times(e.pixelDensityRatio)),this._drawer._clear(!0,_)),s||(this.viewport.getRotation(!0)%360!=0&&this._drawer._offsetForRotation({degrees:this.viewport.getRotation(!0),useSketch:o}),this.getRotation(!0)%360!=0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:o}),this.viewport.getRotation(!0)%360==0&&this.getRotation(!0)%360==0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip());var N=!1;if(this._clip){this._drawer.saveContext(o);var B=this.imageToViewportRectangle(this._clip,!0);B=B.rotate(-this.getRotation(!0),this._getRotationPoint(!0));var U=this._drawer.viewportToDrawerRectangle(B);s&&(U=U.times(s)),c&&(U=U.translate(c)),this._drawer.setClip(U,o),N=!0}if(this._croppingPolygons){var W=this;this._drawer.saveContext(o);try{var H=this._croppingPolygons.map(function(he){return he.map(function(ve){var Se=W.imageToViewportCoordinates(ve.x,ve.y,!0).rotate(-W.getRotation(!0),W._getRotationPoint(!0)),ke=W._drawer.viewportCoordToDrawerCoord(Se);return s&&(ke=ke.times(s)),c&&(ke=ke.plus(c)),ke})});this._drawer.clipWithPolygons(H,o)}catch(he){e.console.error(he)}N=!0}if(this.placeholderFillStyle&&this._hasOpaqueTile===!1){var $=this._drawer.viewportToDrawerRectangle(this.getBounds(!0));s&&($=$.times(s)),c&&($=$.translate(c));var K=null;K=typeof this.placeholderFillStyle=="function"?this.placeholderFillStyle(this,this._drawer.context):this.placeholderFillStyle,this._drawer.drawRectangle($,K,o)}var Q=function(he){if(typeof he=="number")return u(he);if(!he||!e.Browser)return t;var ve=he[e.Browser.vendor];return i(ve)&&(ve=he["*"]),u(ve)}(this.subPixelRoundingForTransparency),re=!1;Q===e.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS?re=!0:Q===e.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST&&(re=!(this.viewer&&this.viewer.isAnimating()));for(var Y=n.length-1;Y>=0;Y--)m=n[Y],this._drawer.drawTile(m,this._drawingHandler,o,s,c,re,this.source),m.beingDrawn=!0,this.viewer&&this.viewer.raiseEvent("tile-drawn",{tiledImage:this,tile:m});N&&this._drawer.restoreContext(o),s||(this.getRotation(!0)%360!=0&&this._drawer._restoreRotationChanges(o),this.viewport.getRotation(!0)%360!=0&&this._drawer._restoreRotationChanges(o)),o&&(s&&(this.viewport.getRotation(!0)%360!=0&&this._drawer._offsetForRotation({degrees:this.viewport.getRotation(!0),useSketch:!1}),this.getRotation(!0)%360!=0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:!1})),this._drawer.blendSketch({opacity:this.opacity,scale:s,translate:c,compositeOperation:this.compositeOperation,bounds:_}),s&&(this.getRotation(!0)%360!=0&&this._drawer._restoreRotationChanges(!1),this.viewport.getRotation(!0)%360!=0&&this._drawer._restoreRotationChanges(!1))),s||this.viewport.getRotation(!0)%360==0&&this.getRotation(!0)%360==0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip(),this._drawDebugInfo(n)}},_drawDebugInfo:function(n){if(this.debugMode)for(var o=n.length-1;o>=0;o--){var s=n[o];try{this._drawer.drawDebugInfo(s,n.length,o,this)}catch(c){e.console.error(c)}}},_providesCoverage:function(n,o,s,c){var m,_,S,O;if(!n[o])return!1;if(s===void 0||c===void 0){for(S in m=n[o])if(Object.prototype.hasOwnProperty.call(m,S)){for(O in _=m[S])if(Object.prototype.hasOwnProperty.call(_,O)&&!_[O])return!1}return!0}return n[o][s]===void 0||n[o][s][c]===void 0||n[o][s][c]===!0},_isCovered:function(n,o,s,c){return s===void 0||c===void 0?this._providesCoverage(n,o+1):this._providesCoverage(n,o+1,2*s,2*c)&&this._providesCoverage(n,o+1,2*s,2*c+1)&&this._providesCoverage(n,o+1,2*s+1,2*c)&&this._providesCoverage(n,o+1,2*s+1,2*c+1)},_setCoverage:function(n,o,s,c,m){n[o]?(n[o][s]||(n[o][s]={}),n[o][s][c]=m):e.console.warn("Setting coverage for a tile before its level's coverage has been reset: %s",o)},_resetCoverage:function(n,o){n[o]={}}});var t=e.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER;function i(n){return n!==e.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS&&n!==e.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST&&n!==e.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER}function u(n){return i(n)?t:n}}(b),function(e){var t=function(u){e.console.assert(u,"[TileCache.cacheTile] options is required"),e.console.assert(u.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(u.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=u.tile,this.tiledImage=u.tiledImage},i=function(u){e.console.assert(u,"[ImageRecord] options is required"),e.console.assert(u.data,"[ImageRecord] options.data is required"),this._tiles=[],u.create.apply(null,[this,u.data,u.ownerTile]),this._destroyImplementation=u.destroy.bind(null,this),this.getImage=u.getImage.bind(null,this),this.getData=u.getData.bind(null,this),this.getRenderedContext=u.getRenderedContext.bind(null,this),this.getCopyRenderedContext=u.getCopyRenderedContext.bind(null,this)};i.prototype={destroy:function(){this._destroyImplementation(),this._tiles=null},addTile:function(u){e.console.assert(u,"[ImageRecord.addTile] tile is required"),this._tiles.push(u)},removeTile:function(u){for(var n=0;n<this._tiles.length;n++)if(this._tiles[n]===u)return void this._tiles.splice(n,1);e.console.warn("[ImageRecord.removeTile] trying to remove unknown tile",u)},getTileCount:function(){return this._tiles.length}},e.TileCache=function(u){u=u||{},this._maxImageCacheCount=u.maxImageCacheCount||e.DEFAULT_SETTINGS.maxImageCacheCount,this._tilesLoaded=[],this._imagesLoaded=[],this._imagesLoadedCount=0},e.TileCache.prototype={numTilesLoaded:function(){return this._tilesLoaded.length},cacheTile:function(u){e.console.assert(u,"[TileCache.cacheTile] options is required"),e.console.assert(u.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(u.tile.cacheKey,"[TileCache.cacheTile] options.tile.cacheKey is required"),e.console.assert(u.tiledImage,"[TileCache.cacheTile] options.tiledImage is required");var n=u.cutoff||0,o=this._tilesLoaded.length,s=this._imagesLoaded[u.tile.cacheKey];if(s||(u.data||(e.console.error("[TileCache.cacheTile] options.image was renamed to options.data. '.image' attribute has been deprecated and will be removed in the future."),u.data=u.image),e.console.assert(u.data,"[TileCache.cacheTile] options.data is required to create an ImageRecord"),s=this._imagesLoaded[u.tile.cacheKey]=new i({data:u.data,ownerTile:u.tile,create:u.tiledImage.source.createTileCache,destroy:u.tiledImage.source.destroyTileCache,getImage:u.tiledImage.source.getTileCacheDataAsImage,getData:u.tiledImage.source.getTileCacheData,getRenderedContext:u.tiledImage.source.getTileCacheDataAsContext2D,getCopyRenderedContext:u.tiledImage.source.getCopyTileCacheDataAsContext2D}),this._imagesLoadedCount++),s.addTile(u.tile),u.tile.cacheImageRecord=s,this._imagesLoadedCount>this._maxImageCacheCount){for(var c,m,_,S,O,N,B=null,U=-1,W=null,H=this._tilesLoaded.length-1;H>=0;H--)(c=(N=this._tilesLoaded[H]).tile).level<=n||c.beingDrawn||(B?(S=c.lastTouchTime,m=B.lastTouchTime,O=c.level,_=B.level,(S<m||S===m&&O>_)&&(B=c,U=H,W=N)):(B=c,U=H,W=N));B&&U>=0&&(this._unloadTile(W),o=U)}this._tilesLoaded[o]=new t({tile:u.tile,tiledImage:u.tiledImage})},clearTilesFor:function(u){var n;e.console.assert(u,"[TileCache.clearTilesFor] tiledImage is required");for(var o=0;o<this._tilesLoaded.length;++o)(n=this._tilesLoaded[o]).tiledImage===u&&(this._unloadTile(n),this._tilesLoaded.splice(o,1),o--)},getImageRecord:function(u){return e.console.assert(u,"[TileCache.getImageRecord] cacheKey is required"),this._imagesLoaded[u]},_unloadTile:function(u){e.console.assert(u,"[TileCache._unloadTile] tileRecord is required");var n=u.tile,o=u.tiledImage;n.unload(),n.cacheImageRecord=null;var s=this._imagesLoaded[n.cacheKey];s.removeTile(n),s.getTileCount()||(s.destroy(),delete this._imagesLoaded[n.cacheKey],this._imagesLoadedCount--),o.viewer.raiseEvent("tile-unloaded",{tile:n,tiledImage:o})}}}(b),function(e){e.World=function(t){var i=this;e.console.assert(t.viewer,"[World] options.viewer is required"),e.EventSource.call(this),this.viewer=t.viewer,this._items=[],this._needsDraw=!1,this._autoRefigureSizes=!0,this._needsSizesFigured=!1,this._delegatedFigureSizes=function(u){i._autoRefigureSizes?i._figureSizes():i._needsSizesFigured=!0},this._figureSizes()},e.extend(e.World.prototype,e.EventSource.prototype,{addItem:function(t,i){if(e.console.assert(t,"[World.addItem] item is required"),e.console.assert(t instanceof e.TiledImage,"[World.addItem] only TiledImages supported at this time"),(i=i||{}).index!==void 0){var u=Math.max(0,Math.min(this._items.length,i.index));this._items.splice(u,0,t)}else this._items.push(t);this._autoRefigureSizes?this._figureSizes():this._needsSizesFigured=!0,this._needsDraw=!0,t.addHandler("bounds-change",this._delegatedFigureSizes),t.addHandler("clip-change",this._delegatedFigureSizes),this.raiseEvent("add-item",{item:t})},getItemAt:function(t){return e.console.assert(t!==void 0,"[World.getItemAt] index is required"),this._items[t]},getIndexOfItem:function(t){return e.console.assert(t,"[World.getIndexOfItem] item is required"),e.indexOf(this._items,t)},getItemCount:function(){return this._items.length},setItemIndex:function(t,i){e.console.assert(t,"[World.setItemIndex] item is required"),e.console.assert(i!==void 0,"[World.setItemIndex] index is required");var u=this.getIndexOfItem(t);if(i>=this._items.length)throw new Error("Index bigger than number of layers.");i!==u&&u!==-1&&(this._items.splice(u,1),this._items.splice(i,0,t),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:t,previousIndex:u,newIndex:i}))},removeItem:function(t){e.console.assert(t,"[World.removeItem] item is required");var i=e.indexOf(this._items,t);i!==-1&&(t.removeHandler("bounds-change",this._delegatedFigureSizes),t.removeHandler("clip-change",this._delegatedFigureSizes),t.destroy(),this._items.splice(i,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(t))},removeAll:function(){var t,i;for(this.viewer._cancelPendingImages(),i=0;i<this._items.length;i++)(t=this._items[i]).removeHandler("bounds-change",this._delegatedFigureSizes),t.removeHandler("clip-change",this._delegatedFigureSizes),t.destroy();var u=this._items;for(this._items=[],this._figureSizes(),this._needsDraw=!0,i=0;i<u.length;i++)t=u[i],this._raiseRemoveItem(t)},resetItems:function(){for(var t=0;t<this._items.length;t++)this._items[t].reset()},update:function(){for(var t=!1,i=0;i<this._items.length;i++)t=this._items[i].update()||t;return t},draw:function(){for(var t=0;t<this._items.length;t++)this._items[t].draw();this._needsDraw=!1},needsDraw:function(){for(var t=0;t<this._items.length;t++)if(this._items[t].needsDraw())return!0;return this._needsDraw},getHomeBounds:function(){return this._homeBounds.clone()},getContentFactor:function(){return this._contentFactor},setAutoRefigureSizes:function(t){this._autoRefigureSizes=t,t&this._needsSizesFigured&&(this._figureSizes(),this._needsSizesFigured=!1)},arrange:function(t){var i,u=(t=t||{}).immediately||!1,n=t.layout||e.DEFAULT_SETTINGS.collectionLayout,o=t.rows||e.DEFAULT_SETTINGS.collectionRows,s=t.columns||e.DEFAULT_SETTINGS.collectionColumns,c=t.tileSize||e.DEFAULT_SETTINGS.collectionTileSize,m=c+(t.tileMargin||e.DEFAULT_SETTINGS.collectionTileMargin);i=!t.rows&&s?s:Math.ceil(this._items.length/o);var _,S,O,N,B,U=0,W=0;this.setAutoRefigureSizes(!1);for(var H=0;H<this._items.length;H++)H&&H%i==0&&(n==="horizontal"?(W+=m,U=0):(U+=m,W=0)),N=(O=(S=(_=this._items[H]).getBounds()).width>S.height?c:c*(S.width/S.height))*(S.height/S.width),B=new e.Point(U+(c-O)/2,W+(c-N)/2),_.setPosition(B,u),_.setWidth(O,u),n==="horizontal"?U+=m:W+=m;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var t=this._homeBounds?this._homeBounds.clone():null,i=this._contentSize?this._contentSize.clone():null,u=this._contentFactor||0;if(this._items.length){var n=this._items[0],o=n.getBounds();this._contentFactor=n.getContentSize().x/o.width;for(var s=n.getClippedBounds().getBoundingBox(),c=s.x,m=s.y,_=s.x+s.width,S=s.y+s.height,O=1;O<this._items.length;O++)o=(n=this._items[O]).getBounds(),this._contentFactor=Math.max(this._contentFactor,n.getContentSize().x/o.width),s=n.getClippedBounds().getBoundingBox(),c=Math.min(c,s.x),m=Math.min(m,s.y),_=Math.max(_,s.x+s.width),S=Math.max(S,s.y+s.height);this._homeBounds=new e.Rect(c,m,_-c,S-m),this._contentSize=new e.Point(this._homeBounds.width*this._contentFactor,this._homeBounds.height*this._contentFactor)}else this._homeBounds=new e.Rect(0,0,1,1),this._contentSize=new e.Point(1,1),this._contentFactor=1;this._contentFactor===u&&this._homeBounds.equals(t)&&this._contentSize.equals(i)||this.raiseEvent("metrics-change",{})},_raiseRemoveItem:function(t){this.raiseEvent("remove-item",{item:t})}})}(b)},function(I,R,l){var g=l(0),y=l(106);g({target:"Array",proto:!0,forced:[].forEach!=y},{forEach:y})},function(I,R,l){var g=l(17),y=l(105),E=l(106),k=l(25);for(var P in y){var b=g[P],e=b&&b.prototype;if(e&&e.forEach!==E)try{k(e,"forEach",E)}catch{e.forEach=E}}},function(I,R,l){(function(g){var y=function(E){return E&&E.Math==Math&&E};I.exports=y(typeof globalThis=="object"&&globalThis)||y(typeof window=="object"&&window)||y(typeof self=="object"&&self)||y(typeof g=="object"&&g)||Function("return this")()}).call(this,l(115))},function(I,R){I.exports=function(l){return typeof l=="object"?l!==null:typeof l=="function"}},function(I,R){var l={}.hasOwnProperty;I.exports=function(g,y){return l.call(g,y)}},function(I,R,l){var g=l(18);I.exports=function(y){if(!g(y))throw TypeError(String(y)+" is not an object");return y}},function(I,R,l){var g=l(9);I.exports=!g(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},function(I,R,l){var g=l(34);I.exports=function(y){return Object(g(y))}},function(I,R,l){var g=l(57),y=l(34);I.exports=function(E){return g(y(E))}},function(I,R,l){var g=l(21),y=l(9),E=l(19),k=Object.defineProperty,P={},b=function(e){throw e};I.exports=function(e,t){if(E(P,e))return P[e];t||(t={});var i=[][e],u=!!E(t,"ACCESSORS")&&t.ACCESSORS,n=E(t,0)?t[0]:b,o=E(t,1)?t[1]:void 0;return P[e]=!!i&&!y(function(){if(u&&!g)return!0;var s={length:-1};u?k(s,1,{enumerable:!0,get:b}):s[1]=1,i.call(s,n,o)})}},function(I,R,l){var g=l(21),y=l(26),E=l(48);I.exports=g?function(k,P,b){return y.f(k,P,E(1,b))}:function(k,P,b){return k[P]=b,k}},function(I,R,l){var g=l(21),y=l(84),E=l(20),k=l(58),P=Object.defineProperty;R.f=g?P:function(b,e,t){if(E(b),e=k(e,!0),E(t),y)try{return P(b,e,t)}catch{}if("get"in t||"set"in t)throw TypeError("Accessors not supported");return"value"in t&&(b[e]=t.value),b}},function(I,R,l){var g=l(35),y=Math.min;I.exports=function(E){return E>0?y(g(E),9007199254740991):0}},function(I,R,l){var g=l(0),y=l(36).map,E=l(54),k=l(24),P=E("map"),b=k("map");g({target:"Array",proto:!0,forced:!P||!b},{map:function(e){return y(this,e,arguments.length>1?arguments[1]:void 0)}})},function(I,R,l){var g=l(0),y=l(36).filter,E=l(54),k=l(24),P=E("filter"),b=k("filter");g({target:"Array",proto:!0,forced:!P||!b},{filter:function(e){return y(this,e,arguments.length>1?arguments[1]:void 0)}})},function(I,R,l){var g=l(0),y=l(135),E=l(53);g({target:"Array",proto:!0},{fill:y}),E("fill")},function(I,R,l){var g=l(0),y=l(9),E=l(23),k=l(47).f,P=l(21),b=y(function(){k(1)});g({target:"Object",stat:!0,forced:!P||b,sham:!P},{getOwnPropertyDescriptor:function(e,t){return k(E(e),t)}})},function(I,R,l){var g=l(0),y=l(21),E=l(89),k=l(23),P=l(47),b=l(52);g({target:"Object",stat:!0,sham:!y},{getOwnPropertyDescriptors:function(e){for(var t,i,u=k(e),n=P.f,o=E(u),s={},c=0;o.length>c;)(i=n(u,t=o[c++]))!==void 0&&b(s,t,i);return s}})},function(I,R,l){var g=l(0),y=l(22),E=l(65);g({target:"Object",stat:!0,forced:l(9)(function(){E(1)})},{keys:function(k){return E(y(k))}})},function(I,R){I.exports=function(l){if(l==null)throw TypeError("Can't call method on "+l);return l}},function(I,R){var l=Math.ceil,g=Math.floor;I.exports=function(y){return isNaN(y=+y)?0:(y>0?g:l)(y)}},function(I,R,l){var g=l(96),y=l(57),E=l(22),k=l(27),P=l(80),b=[].push,e=function(t){var i=t==1,u=t==2,n=t==3,o=t==4,s=t==6,c=t==5||s;return function(m,_,S,O){for(var N,B,U=E(m),W=y(U),H=g(_,S,3),$=k(W.length),K=0,Q=O||P,re=i?Q(m,$):u?Q(m,0):void 0;$>K;K++)if((c||K in W)&&(B=H(N=W[K],K,U),t)){if(i)re[K]=B;else if(B)switch(t){case 3:return!0;case 5:return N;case 6:return K;case 2:b.call(re,N)}else if(o)return!1}return s?-1:n||o?o:re}};I.exports={forEach:e(0),map:e(1),filter:e(2),some:e(3),every:e(4),find:e(5),findIndex:e(6)}},function(I,R,l){var g=l(0),y=l(9),E=l(50),k=l(18),P=l(22),b=l(27),e=l(52),t=l(80),i=l(54),u=l(10),n=l(102),o=u("isConcatSpreadable"),s=9007199254740991,c="Maximum allowed index exceeded",m=n>=51||!y(function(){var O=[];return O[o]=!1,O.concat()[0]!==O}),_=i("concat"),S=function(O){if(!k(O))return!1;var N=O[o];return N!==void 0?!!N:E(O)};g({target:"Array",proto:!0,forced:!m||!_},{concat:function(O){var N,B,U,W,H,$=P(this),K=t($,0),Q=0;for(N=-1,U=arguments.length;N<U;N++)if(S(H=N===-1?$:arguments[N])){if(Q+(W=b(H.length))>s)throw TypeError(c);for(B=0;B<W;B++,Q++)B in H&&e(K,Q,H[B])}else{if(Q>=s)throw TypeError(c);e(K,Q++,H)}return K.length=Q,K}})},function(I,R){var l={}.toString;I.exports=function(g){return l.call(g).slice(8,-1)}},function(I,R,l){var g=l(17),y=l(25),E=l(19),k=l(72),P=l(86),b=l(59),e=b.get,t=b.enforce,i=String(String).split("String");(I.exports=function(u,n,o,s){var c=!!s&&!!s.unsafe,m=!!s&&!!s.enumerable,_=!!s&&!!s.noTargetGet;typeof o=="function"&&(typeof n!="string"||E(o,"name")||y(o,"name",n),t(o).source=i.join(typeof n=="string"?n:"")),u!==g?(c?!_&&u[n]&&(m=!0):delete u[n],m?u[n]=o:y(u,n,o)):m?u[n]=o:k(n,o)})(Function.prototype,"toString",function(){return typeof this=="function"&&e(this).source||P(this)})},function(I,R){I.exports=function(l){if(typeof l!="function")throw TypeError(String(l)+" is not a function");return l}},function(I,R,l){var g=l(0),y=l(121);g({target:"Array",stat:!0,forced:!l(125)(function(E){Array.from(E)})},{from:y})},function(I,R,l){var g=l(0),y=l(18),E=l(50),k=l(63),P=l(27),b=l(23),e=l(52),t=l(10),i=l(54),u=l(24),n=i("slice"),o=u("slice",{ACCESSORS:!0,0:0,1:2}),s=t("species"),c=[].slice,m=Math.max;g({target:"Array",proto:!0,forced:!n||!o},{slice:function(_,S){var O,N,B,U=b(this),W=P(U.length),H=k(_,W),$=k(S===void 0?W:S,W);if(E(U)&&(typeof(O=U.constructor)!="function"||O!==Array&&!E(O.prototype)?y(O)&&(O=O[s])===null&&(O=void 0):O=void 0,O===Array||O===void 0))return c.call(U,H,$);for(N=new(O===void 0?Array:O)(m($-H,0)),B=0;H<$;H++,B++)H in U&&e(N,B,U[H]);return N.length=B,N}})},function(I,R,l){var g=l(9);I.exports=function(y,E){var k=[][y];return!!k&&g(function(){k.call(null,E||function(){throw 1},1)})}},function(I,R,l){var g=l(21),y=l(26).f,E=Function.prototype,k=E.toString,P=/^\s*function ([^ (]*)/,b="name";g&&!(b in E)&&y(E,b,{configurable:!0,get:function(){try{return k.call(this).match(P)[1]}catch{return""}}})},function(I,R,l){var g=l(0),y=l(35),E=l(129),k=l(130),P=l(9),b=1 .toFixed,e=Math.floor,t=function(i,u,n){return u===0?n:u%2==1?t(i,u-1,n*i):t(i*i,u/2,n)};g({target:"Number",proto:!0,forced:b&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128")||!P(function(){b.call({})})},{toFixed:function(i){var u,n,o,s,c=E(this),m=y(i),_=[0,0,0,0,0,0],S="",O="0",N=function(W,H){for(var $=-1,K=H;++$<6;)K+=W*_[$],_[$]=K%1e7,K=e(K/1e7)},B=function(W){for(var H=6,$=0;--H>=0;)$+=_[H],_[H]=e($/W),$=$%W*1e7},U=function(){for(var W=6,H="";--W>=0;)if(H!==""||W===0||_[W]!==0){var $=String(_[W]);H=H===""?$:H+k.call("0",7-$.length)+$}return H};if(m<0||m>20)throw RangeError("Incorrect fraction digits");if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(S="-",c=-c),c>1e-21)if(n=(u=function(W){for(var H=0,$=W;$>=4096;)H+=12,$/=4096;for(;$>=2;)H+=1,$/=2;return H}(c*t(2,69,1))-69)<0?c*t(2,-u,1):c/t(2,u,1),n*=4503599627370496,(u=52-u)>0){for(N(0,n),o=m;o>=7;)N(1e7,0),o-=7;for(N(t(10,o,1),0),o=u-1;o>=23;)B(1<<23),o-=23;B(1<<o),N(1,1),B(2),O=U()}else N(0,n),N(1<<-u,0),O=U()+k.call("0",m);return O=m>0?S+((s=O.length)<=m?"0."+k.call("0",m-s)+O:O.slice(0,s-m)+"."+O.slice(s-m)):S+O}})},function(I,R,l){var g=l(0),y=l(36).findIndex,E=l(53),k=l(24),P="findIndex",b=!0,e=k(P);P in[]&&Array(1).findIndex(function(){b=!1}),g({target:"Array",proto:!0,forced:b||!e},{findIndex:function(t){return y(this,t,arguments.length>1?arguments[1]:void 0)}}),E(P)},function(I,R,l){var g=l(21),y=l(71),E=l(48),k=l(23),P=l(58),b=l(19),e=l(84),t=Object.getOwnPropertyDescriptor;R.f=g?t:function(i,u){if(i=k(i),u=P(u,!0),e)try{return t(i,u)}catch{}if(b(i,u))return E(!y.f.call(i,u),i[u])}},function(I,R){I.exports=function(l,g){return{enumerable:!(1&l),configurable:!(2&l),writable:!(4&l),value:g}}},function(I,R,l){var g=l(90),y=l(17),E=function(k){return typeof k=="function"?k:void 0};I.exports=function(k,P){return arguments.length<2?E(g[k])||E(y[k]):g[k]&&g[k][P]||y[k]&&y[k][P]}},function(I,R,l){var g=l(38);I.exports=Array.isArray||function(y){return g(y)=="Array"}},function(I,R){I.exports={}},function(I,R,l){var g=l(58),y=l(26),E=l(48);I.exports=function(k,P,b){var e=g(P);e in k?y.f(k,e,E(0,b)):k[e]=b}},function(I,R,l){var g=l(10),y=l(64),E=l(26),k=g("unscopables"),P=Array.prototype;P[k]==null&&E.f(P,k,{configurable:!0,value:y(null)}),I.exports=function(b){P[k][b]=!0}},function(I,R,l){var g=l(9),y=l(10),E=l(102),k=y("species");I.exports=function(P){return E>=51||!g(function(){var b=[];return(b.constructor={})[k]=function(){return{foo:1}},b[P](Boolean).foo!==1})}},function(I,R,l){var g=l(0),y=l(63),E=l(35),k=l(27),P=l(22),b=l(80),e=l(52),t=l(54),i=l(24),u=t("splice"),n=i("splice",{ACCESSORS:!0,0:0,1:2}),o=Math.max,s=Math.min,c=9007199254740991,m="Maximum allowed length exceeded";g({target:"Array",proto:!0,forced:!u||!n},{splice:function(_,S){var O,N,B,U,W,H,$=P(this),K=k($.length),Q=y(_,K),re=arguments.length;if(re===0?O=N=0:re===1?(O=0,N=K-Q):(O=re-2,N=s(o(E(S),0),K-Q)),K+O-N>c)throw TypeError(m);for(B=b($,N),U=0;U<N;U++)(W=Q+U)in $&&e(B,U,$[W]);if(B.length=N,O<N){for(U=Q;U<K-N;U++)H=U+O,(W=U+N)in $?$[H]=$[W]:delete $[H];for(U=K;U>K-N+O;U--)delete $[U-1]}else if(O>N)for(U=K-N;U>Q;U--)H=U+O-1,(W=U+N-1)in $?$[H]=$[W]:delete $[H];for(U=0;U<O;U++)$[U+Q]=arguments[U+2];return $.length=K-N+O,B}})},function(I,R,l){var g=l(0),y=l(76).includes,E=l(53);g({target:"Array",proto:!0,forced:!l(24)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(k){return y(this,k,arguments.length>1?arguments[1]:void 0)}}),E("includes")},function(I,R,l){var g=l(9),y=l(38),E="".split;I.exports=g(function(){return!Object("z").propertyIsEnumerable(0)})?function(k){return y(k)=="String"?E.call(k,""):Object(k)}:Object},function(I,R,l){var g=l(18);I.exports=function(y,E){if(!g(y))return y;var k,P;if(E&&typeof(k=y.toString)=="function"&&!g(P=k.call(y))||typeof(k=y.valueOf)=="function"&&!g(P=k.call(y))||!E&&typeof(k=y.toString)=="function"&&!g(P=k.call(y)))return P;throw TypeError("Can't convert object to primitive value")}},function(I,R,l){var g,y,E,k=l(116),P=l(17),b=l(18),e=l(25),t=l(19),i=l(60),u=l(62),n=P.WeakMap;if(k){var o=new n,s=o.get,c=o.has,m=o.set;g=function(S,O){return m.call(o,S,O),O},y=function(S){return s.call(o,S)||{}},E=function(S){return c.call(o,S)}}else{var _=i("state");u[_]=!0,g=function(S,O){return e(S,_,O),O},y=function(S){return t(S,_)?S[_]:{}},E=function(S){return t(S,_)}}I.exports={set:g,get:y,has:E,enforce:function(S){return E(S)?y(S):g(S,{})},getterFor:function(S){return function(O){var N;if(!b(O)||(N=y(O)).type!==S)throw TypeError("Incompatible receiver, "+S+" required");return N}}}},function(I,R,l){var g=l(73),y=l(74),E=g("keys");I.exports=function(k){return E[k]||(E[k]=y(k))}},function(I,R){I.exports=!1},function(I,R){I.exports={}},function(I,R,l){var g=l(35),y=Math.max,E=Math.min;I.exports=function(k,P){var b=g(k);return b<0?y(b+P,0):E(b,P)}},function(I,R,l){var g,y=l(20),E=l(118),k=l(77),P=l(62),b=l(119),e=l(85),t=l(60),i=t("IE_PROTO"),u=function(){},n=function(s){return"<script>"+s+"<\/script>"},o=function(){try{g=document.domain&&new ActiveXObject("htmlfile")}catch{}var s,c;o=g?function(_){_.write(n("")),_.close();var S=_.parentWindow.Object;return _=null,S}(g):((c=e("iframe")).style.display="none",b.appendChild(c),c.src="javascript:",(s=c.contentWindow.document).open(),s.write(n("document.F=Object")),s.close(),s.F);for(var m=k.length;m--;)delete o.prototype[k[m]];return o()};P[i]=!0,I.exports=Object.create||function(s,c){var m;return s!==null?(u.prototype=y(s),m=new u,u.prototype=null,m[i]=s):m=o(),c===void 0?m:E(m,c)}},function(I,R,l){var g=l(91),y=l(77);I.exports=Object.keys||function(E){return g(E,y)}},function(I,R,l){var g=l(0),y=l(40),E=l(22),k=l(9),P=l(43),b=[],e=b.sort,t=k(function(){b.sort(void 0)}),i=k(function(){b.sort(null)}),u=P("sort");g({target:"Array",proto:!0,forced:t||!i||!u},{sort:function(n){return n===void 0?e.call(E(this)):e.call(E(this),y(n))}})},function(I,R,l){var g=l(0),y=l(36).find,E=l(53),k=l(24),P="find",b=!0,e=k(P);P in[]&&Array(1).find(function(){b=!1}),g({target:"Array",proto:!0,forced:b||!e},{find:function(t){return y(this,t,arguments.length>1?arguments[1]:void 0)}}),E(P)},function(I,R,l){var g=l(0),y=l(69);g({target:"RegExp",proto:!0,forced:/./.exec!==y},{exec:y})},function(I,R,l){var g,y,E=l(103),k=l(139),P=RegExp.prototype.exec,b=String.prototype.replace,e=P,t=(g=/a/,y=/b*/g,P.call(g,"a"),P.call(y,"a"),g.lastIndex!==0||y.lastIndex!==0),i=k.UNSUPPORTED_Y||k.BROKEN_CARET,u=/()??/.exec("")[1]!==void 0;(t||u||i)&&(e=function(n){var o,s,c,m,_=this,S=i&&_.sticky,O=E.call(_),N=_.source,B=0,U=n;return S&&((O=O.replace("y","")).indexOf("g")===-1&&(O+="g"),U=String(n).slice(_.lastIndex),_.lastIndex>0&&(!_.multiline||_.multiline&&n[_.lastIndex-1]!==`
2
+ `)&&(N="(?: "+N+")",U=" "+U,B++),s=new RegExp("^(?:"+N+")",O)),u&&(s=new RegExp("^"+N+"$(?!\\s)",O)),t&&(o=_.lastIndex),c=P.call(S?s:_,U),S?c?(c.input=c.input.slice(B),c[0]=c[0].slice(B),c.index=_.lastIndex,_.lastIndex+=c[0].length):_.lastIndex=0:t&&c&&(_.lastIndex=_.global?c.index+c[0].length:o),u&&c&&c.length>1&&b.call(c[0],s,function(){for(m=1;m<arguments.length-2;m++)arguments[m]===void 0&&(c[m]=void 0)}),c}),I.exports=e},function(I,R,l){var g=l(0),y=l(142),E=l(34);g({target:"String",proto:!0,forced:!l(143)("includes")},{includes:function(k){return!!~String(E(this)).indexOf(y(k),arguments.length>1?arguments[1]:void 0)}})},function(I,R,l){var g={}.propertyIsEnumerable,y=Object.getOwnPropertyDescriptor,E=y&&!g.call({1:2},1);R.f=E?function(k){var P=y(this,k);return!!P&&P.enumerable}:g},function(I,R,l){var g=l(17),y=l(25);I.exports=function(E,k){try{y(g,E,k)}catch{g[E]=k}return k}},function(I,R,l){var g=l(61),y=l(87);(I.exports=function(E,k){return y[E]||(y[E]=k!==void 0?k:{})})("versions",[]).push({version:"3.6.5",mode:g?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(I,R){var l=0,g=Math.random();I.exports=function(y){return"Symbol("+String(y===void 0?"":y)+")_"+(++l+g).toString(36)}},function(I,R,l){var g=l(91),y=l(77).concat("length","prototype");R.f=Object.getOwnPropertyNames||function(E){return g(E,y)}},function(I,R,l){var g=l(23),y=l(27),E=l(63),k=function(P){return function(b,e,t){var i,u=g(b),n=y(u.length),o=E(t,n);if(P&&e!=e){for(;n>o;)if((i=u[o++])!=i)return!0}else for(;n>o;o++)if((P||o in u)&&u[o]===e)return P||o||0;return!P&&-1}};I.exports={includes:k(!0),indexOf:k(!1)}},function(I,R){I.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(I,R,l){var g=l(9);I.exports=!!Object.getOwnPropertySymbols&&!g(function(){return!String(Symbol())})},function(I,R,l){var g=l(26).f,y=l(19),E=l(10)("toStringTag");I.exports=function(k,P,b){k&&!y(k=b?k:k.prototype,E)&&g(k,E,{configurable:!0,value:P})}},function(I,R,l){var g=l(18),y=l(50),E=l(10)("species");I.exports=function(k,P){var b;return y(k)&&(typeof(b=k.constructor)!="function"||b!==Array&&!y(b.prototype)?g(b)&&(b=b[E])===null&&(b=void 0):b=void 0),new(b===void 0?Array:b)(P===0?0:P)}},function(I,R,l){var g={};g[l(10)("toStringTag")]="z",I.exports=String(g)==="[object z]"},function(I,R,l){var g=l(19),y=l(22),E=l(60),k=l(100),P=E("IE_PROTO"),b=Object.prototype;I.exports=k?Object.getPrototypeOf:function(e){return e=y(e),g(e,P)?e[P]:typeof e.constructor=="function"&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?b:null}},function(I,R,l){var g=l(0),y=l(50),E=[].reverse,k=[1,2];g({target:"Array",proto:!0,forced:String(k)===String(k.reverse())},{reverse:function(){return y(this)&&(this.length=this.length),E.call(this)}})},function(I,R,l){var g=l(21),y=l(9),E=l(85);I.exports=!g&&!y(function(){return Object.defineProperty(E("div"),"a",{get:function(){return 7}}).a!=7})},function(I,R,l){var g=l(17),y=l(18),E=g.document,k=y(E)&&y(E.createElement);I.exports=function(P){return k?E.createElement(P):{}}},function(I,R,l){var g=l(87),y=Function.toString;typeof g.inspectSource!="function"&&(g.inspectSource=function(E){return y.call(E)}),I.exports=g.inspectSource},function(I,R,l){var g=l(17),y=l(72),E="__core-js_shared__",k=g[E]||y(E,{});I.exports=k},function(I,R,l){var g=l(19),y=l(89),E=l(47),k=l(26);I.exports=function(P,b){for(var e=y(b),t=k.f,i=E.f,u=0;u<e.length;u++){var n=e[u];g(P,n)||t(P,n,i(b,n))}}},function(I,R,l){var g=l(49),y=l(75),E=l(92),k=l(20);I.exports=g("Reflect","ownKeys")||function(P){var b=y.f(k(P)),e=E.f;return e?b.concat(e(P)):b}},function(I,R,l){var g=l(17);I.exports=g},function(I,R,l){var g=l(19),y=l(23),E=l(76).indexOf,k=l(62);I.exports=function(P,b){var e,t=y(P),i=0,u=[];for(e in t)!g(k,e)&&g(t,e)&&u.push(e);for(;b.length>i;)g(t,e=b[i++])&&(~E(u,e)||u.push(e));return u}},function(I,R){R.f=Object.getOwnPropertySymbols},function(I,R,l){var g=l(78);I.exports=g&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},function(I,R,l){var g=l(10);R.f=g},function(I,R,l){var g=l(90),y=l(19),E=l(94),k=l(26).f;I.exports=function(P){var b=g.Symbol||(g.Symbol={});y(b,P)||k(b,P,{value:E.f(P)})}},function(I,R,l){var g=l(40);I.exports=function(y,E,k){if(g(y),E===void 0)return y;switch(k){case 0:return function(){return y.call(E)};case 1:return function(P){return y.call(E,P)};case 2:return function(P,b){return y.call(E,P,b)};case 3:return function(P,b,e){return y.call(E,P,b,e)}}return function(){return y.apply(E,arguments)}}},function(I,R,l){var g=l(81),y=l(38),E=l(10)("toStringTag"),k=y(function(){return arguments}())=="Arguments";I.exports=g?y:function(P){var b,e,t;return P===void 0?"Undefined":P===null?"Null":typeof(e=function(i,u){try{return i[u]}catch{}}(b=Object(P),E))=="string"?e:k?y(b):(t=y(b))=="Object"&&typeof b.callee=="function"?"Arguments":t}},function(I,R,l){var g=l(0),y=l(126),E=l(82),k=l(101),P=l(79),b=l(25),e=l(39),t=l(10),i=l(61),u=l(51),n=l(99),o=n.IteratorPrototype,s=n.BUGGY_SAFARI_ITERATORS,c=t("iterator"),m="keys",_="values",S="entries",O=function(){return this};I.exports=function(N,B,U,W,H,$,K){y(U,B,W);var Q,re,Y,he=function($e){if($e===H&&Ve)return Ve;if(!s&&$e in ke)return ke[$e];switch($e){case m:case _:case S:return function(){return new U(this,$e)}}return function(){return new U(this)}},ve=B+" Iterator",Se=!1,ke=N.prototype,Me=ke[c]||ke["@@iterator"]||H&&ke[H],Ve=!s&&Me||he(H),Ue=B=="Array"&&ke.entries||Me;if(Ue&&(Q=E(Ue.call(new N)),o!==Object.prototype&&Q.next&&(i||E(Q)===o||(k?k(Q,o):typeof Q[c]!="function"&&b(Q,c,O)),P(Q,ve,!0,!0),i&&(u[ve]=O))),H==_&&Me&&Me.name!==_&&(Se=!0,Ve=function(){return Me.call(this)}),i&&!K||ke[c]===Ve||b(ke,c,Ve),u[B]=Ve,H)if(re={values:he(_),keys:$?Ve:he(m),entries:he(S)},K)for(Y in re)(s||Se||!(Y in ke))&&e(ke,Y,re[Y]);else g({target:B,proto:!0,forced:s||Se},re);return re}},function(I,R,l){var g,y,E,k=l(82),P=l(25),b=l(19),e=l(10),t=l(61),i=e("iterator"),u=!1;[].keys&&("next"in(E=[].keys())?(y=k(k(E)))!==Object.prototype&&(g=y):u=!0),g==null&&(g={}),t||b(g,i)||P(g,i,function(){return this}),I.exports={IteratorPrototype:g,BUGGY_SAFARI_ITERATORS:u}},function(I,R,l){var g=l(9);I.exports=!g(function(){function y(){}return y.prototype.constructor=null,Object.getPrototypeOf(new y)!==y.prototype})},function(I,R,l){var g=l(20),y=l(127);I.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var E,k=!1,P={};try{(E=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(P,[]),k=P instanceof Array}catch{}return function(b,e){return g(b),y(e),k?E.call(b,e):b.__proto__=e,b}}():void 0)},function(I,R,l){var g,y,E=l(17),k=l(128),P=E.process,b=P&&P.versions,e=b&&b.v8;e?y=(g=e.split("."))[0]+g[1]:k&&(!(g=k.match(/Edge\/(\d+)/))||g[1]>=74)&&(g=k.match(/Chrome\/(\d+)/))&&(y=g[1]),I.exports=y&&+y},function(I,R,l){var g=l(20);I.exports=function(){var y=g(this),E="";return y.global&&(E+="g"),y.ignoreCase&&(E+="i"),y.multiline&&(E+="m"),y.dotAll&&(E+="s"),y.unicode&&(E+="u"),y.sticky&&(E+="y"),E}},function(I,R,l){var g=l(35),y=l(34),E=function(k){return function(P,b){var e,t,i=String(y(P)),u=g(b),n=i.length;return u<0||u>=n?k?"":void 0:(e=i.charCodeAt(u))<55296||e>56319||u+1===n||(t=i.charCodeAt(u+1))<56320||t>57343?k?i.charAt(u):e:k?i.slice(u,u+2):t-56320+(e-55296<<10)+65536}};I.exports={codeAt:E(!1),charAt:E(!0)}},function(I,R){I.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(I,R,l){var g=l(36).forEach,y=l(43),E=l(24),k=y("forEach"),P=E("forEach");I.exports=k&&P?[].forEach:function(b){return g(this,b,arguments.length>1?arguments[1]:void 0)}},function(I,R,l){var g=l(0),y=l(76).indexOf,E=l(43),k=l(24),P=[].indexOf,b=!!P&&1/[1].indexOf(1,-0)<0,e=E("indexOf"),t=k("indexOf",{ACCESSORS:!0,1:0});g({target:"Array",proto:!0,forced:b||!e||!t},{indexOf:function(i){return b?P.apply(this,arguments)||0:y(this,i,arguments.length>1?arguments[1]:void 0)}})},function(I,R,l){var g=l(109),y=l(110),E=l(20),k=l(34),P=l(140),b=l(111),e=l(27),t=l(112),i=l(69),u=l(9),n=[].push,o=Math.min,s=4294967295,c=!u(function(){return!RegExp(s,"y")});g("split",2,function(m,_,S){var O;return O="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(N,B){var U=String(k(this)),W=B===void 0?s:B>>>0;if(W===0)return[];if(N===void 0)return[U];if(!y(N))return _.call(U,N,W);for(var H,$,K,Q=[],re=(N.ignoreCase?"i":"")+(N.multiline?"m":"")+(N.unicode?"u":"")+(N.sticky?"y":""),Y=0,he=new RegExp(N.source,re+"g");(H=i.call(he,U))&&!(($=he.lastIndex)>Y&&(Q.push(U.slice(Y,H.index)),H.length>1&&H.index<U.length&&n.apply(Q,H.slice(1)),K=H[0].length,Y=$,Q.length>=W));)he.lastIndex===H.index&&he.lastIndex++;return Y===U.length?!K&&he.test("")||Q.push(""):Q.push(U.slice(Y)),Q.length>W?Q.slice(0,W):Q}:"0".split(void 0,0).length?function(N,B){return N===void 0&&B===0?[]:_.call(this,N,B)}:_,[function(N,B){var U=k(this),W=N==null?void 0:N[m];return W!==void 0?W.call(N,U,B):O.call(String(U),N,B)},function(N,B){var U=S(O,N,this,B,O!==_);if(U.done)return U.value;var W=E(N),H=String(this),$=P(W,RegExp),K=W.unicode,Q=(W.ignoreCase?"i":"")+(W.multiline?"m":"")+(W.unicode?"u":"")+(c?"y":"g"),re=new $(c?W:"^(?:"+W.source+")",Q),Y=B===void 0?s:B>>>0;if(Y===0)return[];if(H.length===0)return t(re,H)===null?[H]:[];for(var he=0,ve=0,Se=[];ve<H.length;){re.lastIndex=c?ve:0;var ke,Me=t(re,c?H:H.slice(ve));if(Me===null||(ke=o(e(re.lastIndex+(c?0:ve)),H.length))===he)ve=b(H,ve,K);else{if(Se.push(H.slice(he,ve)),Se.length===Y)return Se;for(var Ve=1;Ve<=Me.length-1;Ve++)if(Se.push(Me[Ve]),Se.length===Y)return Se;ve=he=ke}}return Se.push(H.slice(he)),Se}]},!c)},function(I,R,l){l(68);var g=l(39),y=l(9),E=l(10),k=l(69),P=l(25),b=E("species"),e=!y(function(){var o=/./;return o.exec=function(){var s=[];return s.groups={a:"7"},s},"".replace(o,"$<a>")!=="7"}),t="a".replace(/./,"$0")==="$0",i=E("replace"),u=!!/./[i]&&/./[i]("a","$0")==="",n=!y(function(){var o=/(?:)/,s=o.exec;o.exec=function(){return s.apply(this,arguments)};var c="ab".split(o);return c.length!==2||c[0]!=="a"||c[1]!=="b"});I.exports=function(o,s,c,m){var _=E(o),S=!y(function(){var H={};return H[_]=function(){return 7},""[o](H)!=7}),O=S&&!y(function(){var H=!1,$=/a/;return o==="split"&&(($={}).constructor={},$.constructor[b]=function(){return $},$.flags="",$[_]=/./[_]),$.exec=function(){return H=!0,null},$[_](""),!H});if(!S||!O||o==="replace"&&(!e||!t||u)||o==="split"&&!n){var N=/./[_],B=c(_,""[o],function(H,$,K,Q,re){return $.exec===k?S&&!re?{done:!0,value:N.call($,K,Q)}:{done:!0,value:H.call(K,$,Q)}:{done:!1}},{REPLACE_KEEPS_$0:t,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:u}),U=B[0],W=B[1];g(String.prototype,o,U),g(RegExp.prototype,_,s==2?function(H,$){return W.call(H,this,$)}:function(H){return W.call(H,this)})}m&&P(RegExp.prototype[_],"sham",!0)}},function(I,R,l){var g=l(18),y=l(38),E=l(10)("match");I.exports=function(k){var P;return g(k)&&((P=k[E])!==void 0?!!P:y(k)=="RegExp")}},function(I,R,l){var g=l(104).charAt;I.exports=function(y,E,k){return E+(k?g(y,E).length:1)}},function(I,R,l){var g=l(38),y=l(69);I.exports=function(E,k){var P=E.exec;if(typeof P=="function"){var b=P.call(E,k);if(typeof b!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return b}if(g(E)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return y.call(E,k)}},function(I,R,l){var g=l(0),y=l(141).values;g({target:"Object",stat:!0},{values:function(E){return y(E)}})},function(I,R){I.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAASCAYAAADVCrdsAAAAAXNSR0IArs4c6QAAAzFJREFUSA2tVc9Lk3Ecbo4tE7FgOBNtIFhd5kWZsQm7JEkLvNRIAju4gyfREPwLJHBs1WFnSfAPGB0EDyoKqcw86UGw6GJ62SiIzM3Yp+f58P2ONadm9sDD99fz+TzP++593zmuXAAicgvy52AQ9IMe8Cr4DdwDP4CL4DuHw3GI8f8B5g/ANPgL/Bt8h+gN2HTpFGhyA6S54ujoqDgzMyODg4PS09Mjzc3N4na7xev1SigUkvHxcdne3rZyjgwT/ecgKA6An0HJZrPFiYkJ8Xg8gobnsre3V+bm5lhqMYWJ89QwOGwCX4EJ8DaFGO+DeVBWV1eltbW1ZOz3+yWRSKjJzs6OHBwcqGZ2dlaGhoaktra2pB0eHpZCoVBkH2AedJn+dzCnH32baLgEWtA4CWa5kUqlxOVyadPu7m5ZWVnh9pnI5XLFyclJ/Zl4PcFgkEFtkBSKX4J6gabREkPoxvT0NPesWNLptOAJ1wBjY2NyfHxsz75C9xp8CN4Fb4JBMAa+BxWZTEZ8Pp/Wd3Z2Sj6ft/U8Lxo/zvMMcchZXV2d8Go3NjaEt7mhoUEbxONxHhNswsU13tLTgPN74C6oz1JbW5v2GRkZ4Zb2pw/9DH4wRI4L+9DV1NRIY2OjFg4MDBidDs9OM67ch/o6OM+qzc3N0nPS398v7A+9+vEcyDLEF85aWlr0kALLZDIpRYDnAHWPKw2rraF7YvRaH41GSz1tbz7sBnsM8ZGL9vb2E0IWdHV1ydramtHrTxKpZmz3IHwEanDWsd4al4/0M9hliC0uOjo6qopZWF9fL+vr66ZGEtaw2ggRXz3Vs67cuHxOP4MthshwEQgEThQ4nU6JxWKyv79vf5ICpOFq5naP5yB1Wsd69ikPwDn9DDIMscxFOBz+QxiJRCo/wQwbsmZnjdSBenEYtQ/7lQehn8EyQ+hT3NfXpyK+0wsLC1bA8RP4FHScZVx5Rr2pY72CfdmfYehnMM8Q+gc1Ojoq/PQC9tbz1X0BuisNLrJmvemjnwLMi/Shn0GaIeJ2ZcafZu/GRczO06In/5Hpxf7lmGIIL7gIMulb0Hdew8ucs7/xoR99vb8Be6xf/B8l0bwAAAAASUVORK5CYII="},function(I,R){var l;l=function(){return this}();try{l=l||new Function("return this")()}catch{typeof window=="object"&&(l=window)}I.exports=l},function(I,R,l){var g=l(17),y=l(86),E=g.WeakMap;I.exports=typeof E=="function"&&/native code/.test(y(E))},function(I,R,l){var g=l(9),y=/#|\.prototype\./,E=function(t,i){var u=P[k(t)];return u==e||u!=b&&(typeof i=="function"?g(i):!!i)},k=E.normalize=function(t){return String(t).replace(y,".").toLowerCase()},P=E.data={},b=E.NATIVE="N",e=E.POLYFILL="P";I.exports=E},function(I,R,l){var g=l(21),y=l(26),E=l(20),k=l(65);I.exports=g?Object.defineProperties:function(P,b){E(P);for(var e,t=k(b),i=t.length,u=0;i>u;)y.f(P,e=t[u++],b[e]);return P}},function(I,R,l){var g=l(49);I.exports=g("document","documentElement")},function(I,R,l){var g=l(23),y=l(75).f,E={}.toString,k=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];I.exports.f=function(P){return k&&E.call(P)=="[object Window]"?function(b){try{return y(b)}catch{return k.slice()}}(P):y(g(P))}},function(I,R,l){var g=l(96),y=l(22),E=l(122),k=l(123),P=l(27),b=l(52),e=l(124);I.exports=function(t){var i,u,n,o,s,c,m=y(t),_=typeof this=="function"?this:Array,S=arguments.length,O=S>1?arguments[1]:void 0,N=O!==void 0,B=e(m),U=0;if(N&&(O=g(O,S>2?arguments[2]:void 0,2)),B==null||_==Array&&k(B))for(u=new _(i=P(m.length));i>U;U++)c=N?O(m[U],U):m[U],b(u,U,c);else for(s=(o=B.call(m)).next,u=new _;!(n=s.call(o)).done;U++)c=N?E(o,O,[n.value,U],!0):n.value,b(u,U,c);return u.length=U,u}},function(I,R,l){var g=l(20);I.exports=function(y,E,k,P){try{return P?E(g(k)[0],k[1]):E(k)}catch(e){var b=y.return;throw b!==void 0&&g(b.call(y)),e}}},function(I,R,l){var g=l(10),y=l(51),E=g("iterator"),k=Array.prototype;I.exports=function(P){return P!==void 0&&(y.Array===P||k[E]===P)}},function(I,R,l){var g=l(97),y=l(51),E=l(10)("iterator");I.exports=function(k){if(k!=null)return k[E]||k["@@iterator"]||y[g(k)]}},function(I,R,l){var g=l(10)("iterator"),y=!1;try{var E=0,k={next:function(){return{done:!!E++}},return:function(){y=!0}};k[g]=function(){return this},Array.from(k,function(){throw 2})}catch{}I.exports=function(P,b){if(!b&&!y)return!1;var e=!1;try{var t={};t[g]=function(){return{next:function(){return{done:e=!0}}}},P(t)}catch{}return e}},function(I,R,l){var g=l(99).IteratorPrototype,y=l(64),E=l(48),k=l(79),P=l(51),b=function(){return this};I.exports=function(e,t,i){var u=t+" Iterator";return e.prototype=y(g,{next:E(1,i)}),k(e,u,!1,!0),P[u]=b,e}},function(I,R,l){var g=l(18);I.exports=function(y){if(!g(y)&&y!==null)throw TypeError("Can't set "+String(y)+" as a prototype");return y}},function(I,R,l){var g=l(49);I.exports=g("navigator","userAgent")||""},function(I,R,l){var g=l(38);I.exports=function(y){if(typeof y!="number"&&g(y)!="Number")throw TypeError("Incorrect invocation");return+y}},function(I,R,l){var g=l(35),y=l(34);I.exports="".repeat||function(E){var k=String(y(this)),P="",b=g(E);if(b<0||b==1/0)throw RangeError("Wrong number of repetitions");for(;b>0;(b>>>=1)&&(k+=k))1&b&&(P+=k);return P}},function(I,R,l){l(0)({target:"Object",stat:!0},{is:l(132)})},function(I,R){I.exports=Object.is||function(l,g){return l===g?l!==0||1/l==1/g:l!=l&&g!=g}},function(I,R,l){var g=l(81),y=l(97);I.exports=g?{}.toString:function(){return"[object "+y(this)+"]"}},function(I,R,l){var g=l(0),y=l(57),E=l(23),k=l(43),P=[].join,b=y!=Object,e=k("join",",");g({target:"Array",proto:!0,forced:b||!e},{join:function(t){return P.call(E(this),t===void 0?",":t)}})},function(I,R,l){var g=l(22),y=l(63),E=l(27);I.exports=function(k){for(var P=g(this),b=E(P.length),e=arguments.length,t=y(e>1?arguments[1]:void 0,b),i=e>2?arguments[2]:void 0,u=i===void 0?b:y(i,b);u>t;)P[t++]=k;return P}},function(I,R,l){var g=l(40),y=l(18),E=[].slice,k={},P=function(b,e,t){if(!(e in k)){for(var i=[],u=0;u<e;u++)i[u]="a["+u+"]";k[e]=Function("C,a","return new C("+i.join(",")+")")}return k[e](b,t)};I.exports=Function.bind||function(b){var e=g(this),t=E.call(arguments,1),i=function(){var u=t.concat(E.call(arguments));return this instanceof i?P(e,u.length,u):e.apply(b,u)};return y(e.prototype)&&(i.prototype=e.prototype),i}},function(I,R,l){var g=l(0),y=l(138).left,E=l(43),k=l(24),P=E("reduce"),b=k("reduce",{1:0});g({target:"Array",proto:!0,forced:!P||!b},{reduce:function(e){return y(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(I,R,l){var g=l(40),y=l(22),E=l(57),k=l(27),P=function(b){return function(e,t,i,u){g(t);var n=y(e),o=E(n),s=k(n.length),c=b?s-1:0,m=b?-1:1;if(i<2)for(;;){if(c in o){u=o[c],c+=m;break}if(c+=m,b?c<0:s<=c)throw TypeError("Reduce of empty array with no initial value")}for(;b?c>=0:s>c;c+=m)c in o&&(u=t(u,o[c],c,n));return u}};I.exports={left:P(!1),right:P(!0)}},function(I,R,l){var g=l(9);function y(E,k){return RegExp(E,k)}R.UNSUPPORTED_Y=g(function(){var E=y("a","y");return E.lastIndex=2,E.exec("abcd")!=null}),R.BROKEN_CARET=g(function(){var E=y("^r","gy");return E.lastIndex=2,E.exec("str")!=null})},function(I,R,l){var g=l(20),y=l(40),E=l(10)("species");I.exports=function(k,P){var b,e=g(k).constructor;return e===void 0||(b=g(e)[E])==null?P:y(b)}},function(I,R,l){var g=l(21),y=l(65),E=l(23),k=l(71).f,P=function(b){return function(e){for(var t,i=E(e),u=y(i),n=u.length,o=0,s=[];n>o;)t=u[o++],g&&!k.call(i,t)||s.push(b?[t,i[t]]:i[t]);return s}};I.exports={entries:P(!0),values:P(!1)}},function(I,R,l){var g=l(110);I.exports=function(y){if(g(y))throw TypeError("The method doesn't accept regular expressions");return y}},function(I,R,l){var g=l(10)("match");I.exports=function(y){var E=/./;try{"/./"[y](E)}catch{try{return E[g]=!1,"/./"[y](E)}catch{}}return!1}},function(I,R,l){var g=l(145);typeof g=="string"&&(g=[[I.i,g,""]]);var y={hmr:!0,transform:void 0,insertInto:void 0};l(147)(g,y),g.locals&&(I.exports=g.locals)},function(I,R,l){(I.exports=l(146)(!1)).push([I.i,`.openseadragon-navigator{position:absolute;z-index:1}.openseadragon-navigator .navigator-main{position:relative;overflow:hidden;display:block;font-size:0}.openseadragon-navigator .navigator-main .v-line{height:100%;width:1px;line-height:1px;position:absolute;top:0}.openseadragon-navigator .navigator-main .h-line{width:100%;height:1px;line-height:1px;position:absolute;left:0}.openseadragon-navigator .navigator-main .view-rect{top:-1px;background-color:#fff;position:absolute;cursor:pointer;opacity:0.5;-webkit-box-sizing:border-box;box-sizing:border-box}.openseadragon-navigator .navigator-main .navigator-color-rect{position:absolute;top:0;left:0;z-index:1}
3
+ `,""])},function(I,R){I.exports=function(l){var g=[];return g.toString=function(){return this.map(function(y){var E=function(k,P){var b=k[1]||"",e=k[3];if(!e)return b;if(P&&typeof btoa=="function"){var t=(u=e,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(u))))+" */"),i=e.sources.map(function(n){return"/*# sourceURL="+e.sourceRoot+n+" */"});return[b].concat(i).concat([t]).join(`
4
+ `)}var u;return[b].join(`
5
+ `)}(y,l);return y[2]?"@media "+y[2]+"{"+E+"}":E}).join("")},g.i=function(y,E){typeof y=="string"&&(y=[[null,y,""]]);for(var k={},P=0;P<this.length;P++){var b=this[P][0];typeof b=="number"&&(k[b]=!0)}for(P=0;P<y.length;P++){var e=y[P];typeof e[0]=="number"&&k[e[0]]||(E&&!e[2]?e[2]=E:E&&(e[2]="("+e[2]+") and ("+E+")"),g.push(e))}},g}},function(I,R,l){var g,y,E={},k=(g=function(){return window&&document&&document.all&&!window.atob},function(){return y===void 0&&(y=g.apply(this,arguments)),y}),P=function(H){return document.querySelector(H)},b=function(H){var $={};return function(K){if(typeof K=="function")return K();if($[K]===void 0){var Q=P.call(this,K);if(window.HTMLIFrameElement&&Q instanceof window.HTMLIFrameElement)try{Q=Q.contentDocument.head}catch{Q=null}$[K]=Q}return $[K]}}(),e=null,t=0,i=[],u=l(148);function n(H,$){for(var K=0;K<H.length;K++){var Q=H[K],re=E[Q.id];if(re){re.refs++;for(var Y=0;Y<re.parts.length;Y++)re.parts[Y](Q.parts[Y]);for(;Y<Q.parts.length;Y++)re.parts.push(S(Q.parts[Y],$))}else{var he=[];for(Y=0;Y<Q.parts.length;Y++)he.push(S(Q.parts[Y],$));E[Q.id]={id:Q.id,refs:1,parts:he}}}}function o(H,$){for(var K=[],Q={},re=0;re<H.length;re++){var Y=H[re],he=$.base?Y[0]+$.base:Y[0],ve={css:Y[1],media:Y[2],sourceMap:Y[3]};Q[he]?Q[he].parts.push(ve):K.push(Q[he]={id:he,parts:[ve]})}return K}function s(H,$){var K=b(H.insertInto);if(!K)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var Q=i[i.length-1];if(H.insertAt==="top")Q?Q.nextSibling?K.insertBefore($,Q.nextSibling):K.appendChild($):K.insertBefore($,K.firstChild),i.push($);else if(H.insertAt==="bottom")K.appendChild($);else{if(typeof H.insertAt!="object"||!H.insertAt.before)throw new Error(`[Style Loader]
6
+
7
+ Invalid value for parameter 'insertAt' ('options.insertAt') found.
8
+ Must be 'top', 'bottom', or Object.
9
+ (https://github.com/webpack-contrib/style-loader#insertat)
10
+ `);var re=b(H.insertInto+" "+H.insertAt.before);K.insertBefore($,re)}}function c(H){if(H.parentNode===null)return!1;H.parentNode.removeChild(H);var $=i.indexOf(H);$>=0&&i.splice($,1)}function m(H){var $=document.createElement("style");return H.attrs.type===void 0&&(H.attrs.type="text/css"),_($,H.attrs),s(H,$),$}function _(H,$){Object.keys($).forEach(function(K){H.setAttribute(K,$[K])})}function S(H,$){var K,Q,re,Y;if($.transform&&H.css){if(!(Y=$.transform(H.css)))return function(){};H.css=Y}if($.singleton){var he=t++;K=e||(e=m($)),Q=B.bind(null,K,he,!1),re=B.bind(null,K,he,!0)}else H.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(K=function(ve){var Se=document.createElement("link");return ve.attrs.type===void 0&&(ve.attrs.type="text/css"),ve.attrs.rel="stylesheet",_(Se,ve.attrs),s(ve,Se),Se}($),Q=W.bind(null,K,$),re=function(){c(K),K.href&&URL.revokeObjectURL(K.href)}):(K=m($),Q=U.bind(null,K),re=function(){c(K)});return Q(H),function(ve){if(ve){if(ve.css===H.css&&ve.media===H.media&&ve.sourceMap===H.sourceMap)return;Q(H=ve)}else re()}}I.exports=function(H,$){if(typeof DEBUG<"u"&&DEBUG&&typeof document!="object")throw new Error("The style-loader cannot be used in a non-browser environment");($=$||{}).attrs=typeof $.attrs=="object"?$.attrs:{},$.singleton||typeof $.singleton=="boolean"||($.singleton=k()),$.insertInto||($.insertInto="head"),$.insertAt||($.insertAt="bottom");var K=o(H,$);return n(K,$),function(Q){for(var re=[],Y=0;Y<K.length;Y++){var he=K[Y];(ve=E[he.id]).refs--,re.push(ve)}for(Q&&n(o(Q,$),$),Y=0;Y<re.length;Y++){var ve;if((ve=re[Y]).refs===0){for(var Se=0;Se<ve.parts.length;Se++)ve.parts[Se]();delete E[ve.id]}}}};var O,N=(O=[],function(H,$){return O[H]=$,O.filter(Boolean).join(`
11
+ `)});function B(H,$,K,Q){var re=K?"":Q.css;if(H.styleSheet)H.styleSheet.cssText=N($,re);else{var Y=document.createTextNode(re),he=H.childNodes;he[$]&&H.removeChild(he[$]),he.length?H.insertBefore(Y,he[$]):H.appendChild(Y)}}function U(H,$){var K=$.css,Q=$.media;if(Q&&H.setAttribute("media",Q),H.styleSheet)H.styleSheet.cssText=K;else{for(;H.firstChild;)H.removeChild(H.firstChild);H.appendChild(document.createTextNode(K))}}function W(H,$,K){var Q=K.css,re=K.sourceMap,Y=$.convertToAbsoluteUrls===void 0&&re;($.convertToAbsoluteUrls||Y)&&(Q=u(Q)),re&&(Q+=`
12
+ /*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(re))))+" */");var he=new Blob([Q],{type:"text/css"}),ve=H.href;H.href=URL.createObjectURL(he),ve&&URL.revokeObjectURL(ve)}},function(I,R){I.exports=function(l){var g=typeof window<"u"&&window.location;if(!g)throw new Error("fixUrls requires window.location");if(!l||typeof l!="string")return l;var y=g.protocol+"//"+g.host,E=y+g.pathname.replace(/\/[^\/]*$/,"/");return l.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(k,P){var b,e=P.trim().replace(/^"(.*)"$/,function(t,i){return i}).replace(/^'(.*)'$/,function(t,i){return i});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(e)?k:(b=e.indexOf("//")===0?e:e.indexOf("/")===0?y+e:E+e.replace(/^\.\//,""),"url("+JSON.stringify(b)+")")})}},function(I,R,l){var g=l(0),y=l(36).every,E=l(43),k=l(24),P=E("every"),b=k("every");g({target:"Array",proto:!0,forced:!P||!b},{every:function(e){return y(this,e,arguments.length>1?arguments[1]:void 0)}})},function(I,R,l){var g=l(109),y=l(20),E=l(22),k=l(27),P=l(35),b=l(34),e=l(111),t=l(112),i=Math.max,u=Math.min,n=Math.floor,o=/\$([$&'`]|\d\d?|<[^>]*>)/g,s=/\$([$&'`]|\d\d?)/g;g("replace",2,function(c,m,_,S){var O=S.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,N=S.REPLACE_KEEPS_$0,B=O?"$":"$0";return[function(W,H){var $=b(this),K=W==null?void 0:W[c];return K!==void 0?K.call(W,$,H):m.call(String($),W,H)},function(W,H){if(!O&&N||typeof H=="string"&&H.indexOf(B)===-1){var $=_(m,W,this,H);if($.done)return $.value}var K=y(W),Q=String(this),re=typeof H=="function";re||(H=String(H));var Y=K.global;if(Y){var he=K.unicode;K.lastIndex=0}for(var ve=[];;){var Se=t(K,Q);if(Se===null||(ve.push(Se),!Y))break;String(Se[0])===""&&(K.lastIndex=e(Q,k(K.lastIndex),he))}for(var ke,Me="",Ve=0,Ue=0;Ue<ve.length;Ue++){Se=ve[Ue];for(var $e=String(Se[0]),Ae=i(u(P(Se.index),Q.length),0),qe=[],Re=1;Re<Se.length;Re++)qe.push((ke=Se[Re])===void 0?ke:String(ke));var ot=Se.groups;if(re){var Qe=[$e].concat(qe,Ae,Q);ot!==void 0&&Qe.push(ot);var Ke=String(H.apply(void 0,Qe))}else Ke=U($e,Q,Ae,qe,ot,H);Ae>=Ve&&(Me+=Q.slice(Ve,Ae)+Ke,Ve=Ae+$e.length)}return Me+Q.slice(Ve)}];function U(W,H,$,K,Q,re){var Y=$+W.length,he=K.length,ve=s;return Q!==void 0&&(Q=E(Q),ve=o),m.call(re,ve,function(Se,ke){var Me;switch(ke.charAt(0)){case"$":return"$";case"&":return W;case"`":return H.slice(0,$);case"'":return H.slice(Y);case"<":Me=Q[ke.slice(1,-1)];break;default:var Ve=+ke;if(Ve===0)return Se;if(Ve>he){var Ue=n(Ve/10);return Ue===0?Se:Ue<=he?K[Ue-1]===void 0?ke.charAt(1):K[Ue-1]+ke.charAt(1):Se}Me=K[Ve-1]}return Me===void 0?"":Me})}})},function(I,R,l){l.r(R),l.d(R,"getRectPoint",function(){return e}),l.d(R,"isPointInMatrix",function(){return n}),l.d(R,"pointInOtherPoint",function(){return s}),l.d(R,"isPointInEllipse",function(){return o}),l.d(R,"pointsToRegion",function(){return _}),l.d(R,"regionToPoint",function(){return S}),l.d(R,"isPointInPolygon",function(){return c}),l.d(R,"isPointInLine",function(){return m}),l.d(R,"isNegNumber",function(){return O}),l.d(R,"baseNumber",function(){return N}),l.d(R,"getPoint",function(){return B}),l.d(R,"getAngle",function(){return W}),l.d(R,"getDistance",function(){return H}),l.d(R,"calculatePolygonArea",function(){return $}),l.d(R,"getRandomId",function(){return K}),l.d(R,"getRectPoints",function(){return U}),l.d(R,"getRectPointV2",function(){return t}),l.d(R,"getUnitNumber",function(){return Q}),l.d(R,"rgbToHsl",function(){return re}),l.d(R,"hslToRgb",function(){return Y}),l.d(R,"toGamma",function(){return ve}),l.d(R,"cacheGammaTable",function(){return Se}),l.d(R,"Cache",function(){return Qe}),l.d(R,"Rotation",function(){return Ti}),l.d(R,"Navigator",function(){return zn}),l.d(R,"Tailoring",function(){return Pi}),l.d(R,"Shape",function(){return Ri}),l.d(R,"Area",function(){return Oi}),l.d(R,"Board",function(){return Di}),l.d(R,"Graduation",function(){return Li}),l.d(R,"Grid",function(){return zi}),l.d(R,"KfbView",function(){return Qt}),l.d(R,"OpenSeadragon",function(){return dt.a});var g={};l.r(g),l.d(g,"EVENT_START_PAINTING",function(){return si}),l.d(g,"EVENT_IN_PAINTING",function(){return jt}),l.d(g,"EVENT_END_PAINTING",function(){return Tn}),l.d(g,"EVENT_STOP_PAINTING",function(){return Sn}),l.d(g,"EVENT_TAILORING_REGION",function(){return ai}),l.d(g,"EVENT_TAILORING_SCREENSHOT",function(){return li}),l.d(g,"EVENT_AREA_MOVE_START",function(){return ui}),l.d(g,"EVENT_AREA_MOVING",function(){return ci}),l.d(g,"EVENT_AREA_MOVE_END",function(){return hi}),l.d(g,"EVENT_SELECT_LABEL",function(){return En}),l.d(g,"EVENT_CANCEL_SELECT_LABEL",function(){return Pn}),l.d(g,"EVENT_DB_CLICK_LABEL",function(){return Cn}),l.d(g,"EVENT_CACHE_BACK",function(){return di}),l.d(g,"EVENT_CACHE_FORWARD",function(){return fi}),l.d(g,"EVENT_HIDDEN_LABEL",function(){return pi}),l.d(g,"EVENT_DELETE_LABEL",function(){return _n}),l.d(g,"EVENT_DELETE_POLYGON_POINT",function(){return vi}),l.d(g,"EVENT_ADD_POLYGON_POINT",function(){return gi}),l.d(g,"EVENT_NAVIGATOR_VESTIGE",function(){return mi}),l.d(g,"EVENT_GRADUATION_CHANGE",function(){return yi});var y={};l.r(y),l.d(y,"Brush",function(){return A}),l.d(y,"Arrow",function(){return We}),l.d(y,"Bilateral",function(){return io}),l.d(y,"Line",function(){return ao}),l.d(y,"Polygon",function(){return fo}),l.d(y,"Ellipse",function(){return mo}),l.d(y,"Rectangle",function(){return ri}),l.d(y,"Font",function(){return Eo}),l.d(y,"Star",function(){return Ro}),l.d(y,"Flag",function(){return Lo}),l.d(y,"Dot",function(){return No}),l.d(y,"Image",function(){return Wo});var E={};l.r(E),l.d(E,"Cache",function(){return Qe}),l.d(E,"Rotation",function(){return Ti}),l.d(E,"Navigator",function(){return zn}),l.d(E,"Tailoring",function(){return Pi}),l.d(E,"Shape",function(){return Ri}),l.d(E,"Area",function(){return Oi}),l.d(E,"Board",function(){return Di}),l.d(E,"Graduation",function(){return Li}),l.d(E,"Grid",function(){return zi});var k={};l.r(k),l.d(k,"COMPONENT_SHAPE",function(){return kr}),l.d(k,"COMPONENT_AREA",function(){return Or}),l.d(k,"COMPONENT_BOARD",function(){return Ir}),l.d(k,"COMPONENT_GRADUATION",function(){return Dr}),l.d(k,"COMPONENT_ROTATION",function(){return Lr}),l.d(k,"COMPONENT_TAILORING",function(){return zr}),l.d(k,"COMPONENT_NAVIGATOR",function(){return Ni}),l.d(k,"COMPONENT_CACHE",function(){return Ai}),l.d(k,"COMPONENT_FRID",function(){return Mr}),l(1),l(4),l(6),l(41),l(5),l(83),l(42),l(66),l(44),l(45),l(131),l(2),l(3),l(7),l(8);function P(d){return function(a){if(Array.isArray(a))return b(a)}(d)||function(a){if(typeof Symbol<"u"&&Symbol.iterator in Object(a))return Array.from(a)}(d)||function(a,f){if(a){if(typeof a=="string")return b(a,f);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return b(a,f)}}(d)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function b(d,a){(a==null||a>d.length)&&(a=d.length);for(var f=0,h=new Array(a);f<a;f++)h[f]=d[f];return h}function e(d,a){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,h=(d.x+a.x)/2,x=(d.y+a.y)/2,p=Math.PI/180*f;return[{x:(d.x-h)*Math.cos(p)-(d.y-x)*Math.sin(p)+h,y:(d.x-h)*Math.sin(p)+(d.y-x)*Math.cos(p)+x},{x:-(d.y-x)*Math.sin(p)+h,y:(d.y-x)*Math.cos(p)+x},{x:(a.x-h)*Math.cos(p)-(d.y-x)*Math.sin(p)+h,y:(a.x-h)*Math.sin(p)+(d.y-x)*Math.cos(p)+x},{x:(d.x-h)*Math.cos(p)-(x-x)*Math.sin(p)+h,y:(d.x-h)*Math.sin(p)+x},{x:h,y:x},{x:(a.x-h)*Math.cos(p)+h,y:(a.x-h)*Math.sin(p)+x},{x:(d.x-h)*Math.cos(p)-(a.y-x)*Math.sin(p)+h,y:(d.x-h)*Math.sin(p)+(a.y-x)*Math.cos(p)+x},{x:-(a.y-x)*Math.sin(p)+h,y:(a.y-x)*Math.cos(p)+x},{x:(a.x-h)*Math.cos(p)-(a.y-x)*Math.sin(p)+h,y:(a.x-h)*Math.sin(p)+(a.y-x)*Math.cos(p)+x}]}function t(d){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(d.length===2)return e(d[0],d[1],a);var f=(d[0].x+d[3].x)/2,h=(d[0].y+d[3].y)/2;return[d[0],{x:(d[1].x+d[0].x)/2,y:(d[1].y+d[0].y)/2},d[1],{x:(d[2].x+d[0].x)/2,y:(d[2].y+d[0].y)/2},{x:f,y:h},{x:(d[1].x+d[3].x)/2,y:(d[1].y+d[3].y)/2},d[2],{x:(d[2].x+d[3].x)/2,y:(d[2].y+d[3].y)/2},d[3]]}function i(d,a){return d.x*a.y-a.x*d.y}function u(d,a,f){return(a.x-d.x)*(f.y-d.y)-(f.x-d.x)*(a.y-d.y)}function n(d,a,f,h,x){return u(d,a,x)*u(f,h,x)<=0&&u(a,h,x)*u(d,f,x)<=0}function o(d,a,f,h){return(d.x-a.x)*(d.x-a.x)/(f*f)+(d.y-a.y)*(d.y-a.y)/(h*h)<1}function s(d,a){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,h={x:d.x-f,y:d.y-f},x={x:d.x+f,y:d.y-f},p={x:d.x-f,y:d.y+f},v={x:d.x+f,y:d.y+f};return n(h,x,p,v,a)}function c(d,a){for(var f=d.x,h=d.y,x=0,p=0,v=a.length,z=v-1;p<v;z=p,p++){var T=a[z].x,L=a[z].y,F=a[p].x,V=a[p].y,q=Math.min(L,V),G=Math.max(L,V),ne=Math.min(T,F),J=Math.max(T,F);if(!(h>G)){if(!(h<q)){if(!(f>J))if(f<ne)q===h&&h<G?x++:q<h&&h===G||q===h&&h===G||x++;else{var Z={x:F-T,y:V-L},te={x:F-T-1e5,y:V-L};i({x:T-f,y:L-h},Z)*i(te,Z)>0||(q===h&&h<G?x++:q<h&&h===G||q===h&&h===G||x++)}}}}return x%2==1}function m(d,a){var f=a[0],h=a[1];if(f.y<d.y&&h.y>=d.y||f.y>=d.y&&h.y<d.y){var x=f.x+(d.y-f.y)*(h.x-f.x)/(h.y-f.y);if(Math.abs(x-d.x)<8)return!0}return!1}function _(d){if(!Array.isArray(d)||d.length===0)return{x:0,y:0,width:0,height:0};if(d.length===2)return{x:d[0].x,y:d[0].y,width:d[1].x-d[0].x,height:d[1].y-d[0].y};if(d.length===4)return{x:d[0].x,y:d[0].y,width:H(d[1],d[0])*(d[0].x<d[1].x?1:-1),height:H(d[2],d[0])*(d[0].y<d[2].y?1:-1)};var a=P(d).sort(function(v,z){return v.x-z.x}),f=P(d).sort(function(v,z){return v.y-z.y}),h={x:a[0].x,y:f[0].y},x=a.reverse()[0].x,p=f.reverse()[0].y;return{x:h.x,y:h.y,width:x-h.x,height:p-h.y}}function S(d){var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return a?{startPoint:{x:d.width<0?d.x+d.width:d.x,y:d.height<0?d.y+d.height:d.y},endPoint:{x:d.width>0?d.x+d.width:d.x,y:d.height>0?d.y+d.height:d.y}}:{startPoint:{x:d.x,y:d.y},endPoint:{x:d.x+d.width,y:d.y+d.height}}}function O(d){if(typeof d!="number")throw new Error("".concat(d," is not a number"));return d===0?Object.is(d,-0):d<0}function N(d){if(typeof d!="number")throw new Error("".concat(d," is not a number"));return d===0?0:d<0?-1:1}function B(d,a,f){return f=f/180*Math.PI,{x:(a.x-d.x)*Math.cos(f)-(a.y-d.y)*Math.sin(f)+d.x,y:(a.x-d.x)*Math.sin(f)+(a.y-d.y)*Math.cos(f)+d.y}}function U(d){return[d[0],{x:d[1].x,y:d[0].y},{x:d[0].x,y:d[1].y},d[1]]}function W(d,a,f){var h={x:a.x-d.x,y:a.y-d.y},x={x:f.x-d.x,y:f.y-d.y},p=Math.atan2(x.y,x.x)-Math.atan2(h.y,h.x);return p>Math.PI?p-2*Math.PI:p<-Math.PI?p+2*Math.PI:p}function H(d,a){var f=Math.pow(a.x-d.x,2),h=Math.pow(a.y-d.y,2);return Math.sqrt(f+h)}function $(d,a){var f=d.length;if(f<3)return 0;for(var h=0,x=0;x<f;x++){var p=d[x],v=d[(x+1)%f],z=p.x*a,T=p.y*a,L=v.x*a;h+=z*(v.y*a)-L*T}return Math.abs(h/2)}var K=function(){return(4294967296*(1+Math.random())|0).toString(16).substring(1)};function Q(d,a,f){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(h)return(d/Math.pow(f,h)).toFixed(2)/1+a[h];for(var x=d;x>=f;)x/=f,h++;return a[h]||(h=a.length-1),(d/Math.pow(f,h)).toFixed(2)/1+a[h]}var re=function(d,a,f){var h=(d/=255)>(a/=255)?d:a,x=h>(f/=255)?h:f,p=d>a?a:d,v=p>f?f:p,z=x-v,T=x+v,L=(x+v)/2,F=0,V=0;return z===0?{l:L,s:F,h:V}:(d===x&&(V=(a-f)/6/z),a===x&&(V=1/3+(f-d)/6/z),f===x&&(V=2/3+(d-a)/6/z),V<0&&(V+=1),V>1&&(V-=1),{l:L,s:F=L<.5?z/T:z/(2-T),h:V})},Y=function(d,a,f){if(a===0)return{r:255*(f>1?1:f),g:255*(f>1?1:f),b:255*(f>1?1:f)};a>1&&(a=1);var h=0,x=2*f-(h=f<.5?f*(1+a):f+a-f*a),p=255*he(x,h,d+1/3),v=255*he(x,h,d),z=255*he(x,h,d-1/3);return{r:p>255?255:p,g:v>255?255:v,b:z>255?255:z}};function he(d,a,f){return f<0&&(f+=1),f>1&&(f-=1),6*f<1?d+6*(a-d)*f:2*f<1?a:3*f<2?d+(a-d)*(2/3-f)*6:d}for(var ve=function(d,a){return d>255&&(d=255),d<0&&(d=0),d/=255,255*Math.pow(d,1/a)},Se={},ke=0;ke<256;ke++)for(var Me=.01;Me<=2;Me=(Me+.01).toFixed(3)/1)Se["".concat(Me)]?Se["".concat(Me)].push(ve(ke,Me)):Se["".concat(Me)]=[ve(ke,Me)];l(55),l(134),l(28);var Ve=function(d){return(d=d.toString())[1]?d:"0"+d},Ue=function(d){var a,f=Object.prototype.toString;if(d)return(a=d,f).call(a)==="[object String]"&&(d=new Date(d)),[d.getHours(),d.getMinutes(),d.getSeconds()].map(Ve).join(":")},$e=function(d){var a,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"/",h=Object.prototype.toString;if(d){(a=d,h).call(a)==="[object String]"&&(d=new Date(d)),typeof d=="number"&&(d=new Date(d));var x=d.getFullYear(),p=d.getMonth()+1,v=d.getDate();return[x,p,v].map(Ve).join(f)}},Ae=function(d){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-";if(d)return $e(d,a)+" "+Ue(d)};function qe(d){return function(a){if(Array.isArray(a))return Re(a)}(d)||function(a){if(typeof Symbol<"u"&&Symbol.iterator in Object(a))return Array.from(a)}(d)||function(a,f){if(a){if(typeof a=="string")return Re(a,f);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Re(a,f)}}(d)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Re(d,a){(a==null||a>d.length)&&(a=d.length);for(var f=0,h=new Array(a);f<a;f++)h[f]=d[f];return h}function ot(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}var Qe=function(){function d(){(function(h,x){if(!(h instanceof x))throw new TypeError("Cannot call a class as a function")})(this,d),this.cacheList=[],this.currentIndex=-1}var a,f;return a=d,(f=[{key:"init",value:function(h,x){this.cacheList=qe(h),this.currentIndex=x}},{key:"add",value:function(h,x){this.currentIndex===this.cacheList.length-1||(this.cacheList=this.cacheList.slice(0,this.currentIndex+1)),this.cacheList.push({type:h,options:x,time:Ae(new Date)}),this.currentIndex=this.cacheList.length-1}},{key:"getCache",value:function(h){return this.cacheList[h]}},{key:"removeIndex",value:function(h){this.cacheList.splice(h,1)}},{key:"removeAll",value:function(){this.cacheList=[],this.currentIndex=-1}}])&&ot(a.prototype,f),d}();l(30),l(67),l(15),l(11),l(12),l(13),l(16),l(37),l(29),l(107),l(137),l(31),l(32),l(33),l(68),l(108);function Ke(d,a){if(!(d instanceof a))throw new TypeError("Cannot call a class as a function")}function Ze(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}var it={lineWidth:2,radius:5,fillStyle:"rgba(255, 255, 255, 1)",strokeStyle:"#01d0b0"},ft=function(){function d(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:it;Ke(this,d),this.getConfig(h)}var a,f;return a=d,f=[{key:"getConfig",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:it;for(var x in it)Object.prototype.hasOwnProperty.call(it,x)&&(h[x]=h[x]||it[x]);return h}},{key:"setCanvas",value:function(h){this.canvas=h}},{key:"draw",value:function(h,x){var p=this.canvas.getContext("2d"),v=h.x,z=h.y;x=this.getConfig(x),p.beginPath(),p.lineWidth=x.lineWidth,p.arc(v,z,x.radius,0,2*Math.PI,!1),p.fillStyle=x.fillStyle,p.fill(),p.strokeStyle=x.strokeStyle,p.stroke()}}],f&&Ze(a.prototype,f),d}(),Ge=l(14),dt=l.n(Ge),vt="Line",Xe="Arrow",rt="Bilateral",Je="Rectangle",et="Ellipse",w="Polygon",j="Font",oe="Star",pe="Flag",ce="Dot",we="Image",ge=[j,oe,pe,ce],be=[Je,et],Oe=[vt,Xe,rt],de=[w,j,oe,pe,ce],se=[].concat(Oe,[j,pe,we]),Pe=[vt,Xe,rt,Je,et,w,j,oe,pe,ce,we],le={en:{length:"Length",width:"Width",perimeter:"Perimeter",area:"Area",long_axis:"Long Axis",short_axis:"Short Axis",complete_screenshot:"Double-click within the area to complete screenshot",cancel_screenshot:"Double-click outside or press ESC to cancel screenshot",area_size:"Area size is ",drag_resize:"drag resize"},"zh-cn":{length:"长",width:"宽",perimeter:"周长",area:"面积",long_axis:"长轴",short_axis:"短轴",complete_screenshot:"双击区域内表示完成截图",cancel_screenshot:"双击区域外或按ESC表示取消截图",area_size:"区域大小为:",drag_resize:"拖动调整"}};function ye(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function me(d){for(var a=1;a<arguments.length;a++){var f=arguments[a]!=null?arguments[a]:{};a%2?ye(Object(f),!0).forEach(function(h){Te(d,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):ye(Object(f)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(f,h))})}return d}function Te(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function De(d,a){if(d==null)return{};var f,h,x=function(v,z){if(v==null)return{};var T,L,F={},V=Object.keys(v);for(L=0;L<V.length;L++)T=V[L],z.indexOf(T)>=0||(F[T]=v[T]);return F}(d,a);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);for(h=0;h<p.length;h++)f=p[h],a.indexOf(f)>=0||Object.prototype.propertyIsEnumerable.call(d,f)&&(x[f]=d[f])}return x}function tt(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}var D=function(){function d(h,x,p,v){(function(F,V){if(!(F instanceof V))throw new TypeError("Cannot call a class as a function")})(this,d);var z=v||{},T=z.mitt,L=De(z,["mitt"]);this.mitt=T,this.viewer=h,this.cache=p,this.viewport=h.viewport,this.canvas=x,this.options=L||{},this.thumb=new ft,this.thumb.setCanvas(x)}var a,f;return a=d,f=[{key:"init",value:function(){}},{key:"getCenterPoint",value:function(h){var x=this.viewport.imageToViewportRectangle(h.x,h.y,h.width,h.height);return e({x:x.x,y:x.y},{x:x.x+x.width,y:x.y+x.height})[4]}},{key:"moveToLabel",value:function(h){var x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.viewport.panTo(new Ge.Point(h.x,h.y),x)}},{key:"isContainerLabel",value:function(h,x){var p=this;return!!x.find(function(v){return p.isContainerInRegion(h,v)})}},{key:"isContainerInRegion",value:function(h,x){var p=x.region,v=x.tool,z=x.points,T=x.isClose;if(v===w&&T)return c(h,z);var L={x:p.x,y:p.y},F={x:p.x+p.width,y:p.y},V={x:p.x,y:p.y+p.height},q={x:p.x+p.width,y:p.y+p.height},G={x:p.x+p.width/2,y:p.y+p.height/2};return v===et?o(h,G,Math.abs(p.width/2),Math.abs(p.height/2>>0)):v===Je&&n(L,F,V,q,h)}},{key:"imageToViewerElementRectangle",value:function(h){var x=h.x,p=h.y,v=h.width,z=h.height,T=this.viewport.imageToViewportRectangle(x,p,v,z);return this.viewport.viewportToViewerElementRectangle(T)}},{key:"imageToViewerElementCoordinates",value:function(h,x){return this.viewport.imageToViewerElementCoordinates(new Ge.Point(h,x))}},{key:"viewerElementToImageRectangle",value:function(h){var x=h.x,p=h.y,v=h.width,z=h.height,T=this.viewport.viewerElementToViewportRectangle(new Ge.Rect(x,p,v,z,0));return this.viewport.viewportToImageRectangle(T.x,T.y,T.width,T.height)}},{key:"viewerElementToImageCoordinates",value:function(h,x){return this.viewport.viewerElementToImageCoordinates(new Ge.Point(h,x))}},{key:"imageToViewerElementPoints",value:function(h){var x=this;return(h||[]).map(function(p){var v=x.imageToViewerElementCoordinates(p.x,p.y);return{canMove:p.canMove,x:v.x,y:v.y}})}},{key:"viewerElementToImagePoints",value:function(h){var x=this;return(h||[]).map(function(p){var v=x.viewerElementToImageCoordinates(p.x,p.y);return{canMove:p.canMove,x:v.x,y:v.y}})}},{key:"getImageZoom",value:function(h){return this.viewport.viewportToImageZoom(this.viewport.getZoom(h))}},{key:"translate",value:function(h){var x;return le[((x=this.options.lang)!==null&&x!==void 0?x:"zh-cn").toLocaleLowerCase()][h]}},{key:"getMeasureContent",value:function(h){var x={left:0,top:0,angle:0,texts:[]};if(h.points.length<=1)return x;var p=this.getImageZoom(!0)/h.scale,v=_(h.points),z={x:v.x,y:v.y},T={x:v.x+v.width,y:v.y+v.height},L={x:z.x<T.x?z.x:T.x,y:z.y<T.y?z.y:T.y},F={x:z.x>T.x?z.x:T.x,y:z.y>T.y?z.y:T.y};switch(h.tool){case Xe:case rt:case vt:var V={x:z.x<T.x?z.x:T.x,y:z.x<T.x?z.y:T.y},q={x:z.x>T.x?z.x:T.x,y:z.x>T.x?z.y:T.y},G=Math.abs(q.x-V.x),ne=Math.abs(q.y-V.y),J=this.imageToViewerElementCoordinates(q.x,q.y);x={left:J.x+10*p,top:J.y,angle:0,texts:["".concat(this.translate("length"),":").concat(this.getUnitNumber(Math.sqrt(G*G+ne*ne)*this.options.imageCapRes))]};break;case et:var Z=Math.abs(F.x-L.x)/2,te=Math.abs(F.y-L.y)/2,ee=(Z>te?Z:te)*this.options.imageCapRes,X=(Z>te?te:Z)*this.options.imageCapRes,ie=e(L,F)[2],fe=this.imageToViewerElementCoordinates(ie.x,ie.y);x={left:fe.x+10*p,top:fe.y,angle:0,texts:["".concat(this.translate("long_axis"),":").concat(this.getUnitNumber(ee)),"".concat(this.translate("short_axis"),":").concat(this.getUnitNumber(X)),"".concat(this.translate("perimeter"),":").concat(this.getUnitNumber(4*(ee-X)+2*Math.PI*X)),"".concat(this.translate("area"),":").concat(this.getUnitNumber(Math.PI*ee*X/this.options.binary),"²")]};break;case Je:var xe=Math.abs(F.x-L.x)*this.options.imageCapRes,_e=Math.abs(F.y-L.y)*this.options.imageCapRes,Le=2*(xe+_e),Be=xe*_e/this.options.binary,ze=e(L,F)[2],je=this.imageToViewerElementCoordinates(ze.x,ze.y);x={left:je.x+10*p,top:je.y,angle:0,texts:["".concat(this.translate("length"),":").concat(this.getUnitNumber(xe)),"".concat(this.translate("width"),":").concat(this.getUnitNumber(_e)),"".concat(this.translate("perimeter"),":").concat(this.getUnitNumber(Le)),"".concat(this.translate("area"),":").concat(this.getUnitNumber(Be),"²")]};break;case w:var nt=h.points,ut=e(L,F)[2],ct=this.imageToViewerElementCoordinates(ut.x,ut.y),yt=0;nt.reduce(function(Ne,Ye){return yt+=Math.sqrt(Math.pow(Ye.x-Ne.x,2)+Math.pow(Ye.y-Ne.y,2)),Ye}),x={left:ct.x,top:ct.y,angle:0,texts:["".concat(this.translate("perimeter"),":").concat(this.getUnitNumber((yt*this.options.imageCapRes).toFixed(2))),"".concat(this.translate("area"),":").concat(this.getUnitNumber($(nt,this.options.imageCapRes)/this.options.binary),"²")]};break;default:x={left:0,right:0,angle:0,texts:[]}}var at=h.select&&this.options.measure.selectHandler||this.options.measure.handler;return me(me({},x),{},{texts:at?at(x.texts,h):x.texts})}},{key:"getUnitNumber",value:function(h,x){return Q(h,this.options.units,this.options.binary,x)}},{key:"isInCanvas",value:function(h,x){var p=h.x,v=h.y,z=h.x+h.width,T=h.y+h.height;return!(p>x.x+x.width||v>x.y+x.height||z<x.x||T<x.y)}},{key:"getFontWidth",value:function(h,x){var p=this.canvas.getContext("2d");p.beginPath(),p.font="".concat(x,"px Arial");var v=h.split(`
15
+ `).sort(function(z,T){return z.length>T.length?-1:1})[0];return p.measureText(v).width}},{key:"change",value:function(){}},{key:"updated",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=me(me({},this.options),h),this.change()}},{key:"clearCanvas",value:function(){var h=this.canvas.getContext("2d");h.beginPath(),h.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"resetCanvasSize",value:function(h){var x=this,p=h.width,v=h.height;this.canvas.width=p,this.canvas.height=v,setTimeout(function(){x.change()},100)}},{key:"destroy",value:function(){this.mitt.$off()}}],f&&tt(a.prototype,f),d}();function C(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}var A=function(){function d(){(function(h,x){if(!(h instanceof x))throw new TypeError("Cannot call a class as a function")})(this,d),this.thumb=new ft,this.options={}}var a,f;return a=d,(f=[{key:"setContent",value:function(h,x){this.canvas=h,this.thumb.setCanvas(h),this.options=x}},{key:"startDraw",value:function(){this.canvas.getContext("2d").beginPath()}},{key:"endDraw",value:function(){var h=this.canvas.getContext("2d");h.stroke(),this.options.fillStyle&&h.fill()}},{key:"drawThumb",value:function(h,x){this.thumb.draw(h,x)}},{key:"drawPoints",value:function(h,x){var p=this;h.forEach(function(v){p.drawThumb(v,x)})}},{key:"draw",value:function(h){}},{key:"drawMeasureInfo",value:function(h,x){var p=x.left,v=x.top,z=x.texts,T=x.angle;if(z.length){var L=this.canvas.getContext("2d");L.save(),L.beginPath(),L.translate(p,v),L.rotate(T);var F=[];L.font="".concat(this.options.measure.fontSize,"px Arial"),z.forEach(function(G){F.push(L.measureText(G).width)});var V=Math.max.apply(Math,F);L.fillStyle=this.options.measure.backgroundColor;var q=20*z.length+16+4*(z.length-1);L.rect(0,0,V+22,q),L.fill(),L.beginPath(),L.fillStyle=this.options.measure.color,z.forEach(function(G,ne){L.fillText(G,11,22+24*ne)}),L.fill(),L.restore()}}},{key:"clearCanvas",value:function(){this.canvas&&this.canvas.getContext&&this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)}}])&&C(a.prototype,f),d}();function M(d){return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},M(d)}function ue(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Ce(d,a){return Ce=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},Ce(d,a)}function ae(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=He(d);if(a){var x=He(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Ie(this,f)}}function Ie(d,a){return!a||M(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function He(d){return He=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},He(d)}var We=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&Ce(p,v)})(x,d);var a,f,h=ae(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,(f=[{key:"draw",value:function(p){var v=p[0],z=p[p.length-1],T=this.canvas.getContext("2d");T.lineWidth=this.options.lineWidth,T.strokeStyle=this.options.strokeStyle,T.moveTo(v.x,v.y),T.lineTo(z.x,z.y),T.drawArrow(v,z)}}])&&ue(a.prototype,f),x}(A);function mt(d){return mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},mt(d)}function eo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function rn(d,a){return rn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},rn(d,a)}function to(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=It(d);if(a){var x=It(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return no(this,f)}}function no(d,a){return!a||mt(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function It(d){return It=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},It(d)}var io=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&rn(p,v)})(x,d);var a,f,h=to(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,(f=[{key:"draw",value:function(p){var v=p[0],z=p[p.length-1],T=this.canvas.getContext("2d");T.lineWidth=this.options.lineWidth,T.strokeStyle=this.options.strokeStyle,T.moveTo(v.x,v.y),T.lineTo(z.x,z.y),T.drawArrow(v,z),T.drawArrow(z,v)}}])&&eo(a.prototype,f),x}(A);function sn(d){return sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},sn(d)}function oo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function an(d,a){return an=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},an(d,a)}function ro(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Dt(d);if(a){var x=Dt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return so(this,f)}}function so(d,a){return!a||sn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Dt(d){return Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Dt(d)}var ao=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&an(p,v)})(x,d);var a,f,h=ro(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,(f=[{key:"draw",value:function(p){var v=p[0],z=p[p.length-1],T=this.canvas.getContext("2d");T.lineWidth=this.options.lineWidth,T.strokeStyle=this.options.strokeStyle,T.moveTo(v.x,v.y),T.lineTo(z.x,z.y);var L=Math.atan2(z.y-v.y,z.x-v.x),F=5*Math.sin(L),V=5*Math.cos(L);T.moveTo(v.x+F,v.y-V),T.lineTo(v.x-F,v.y+V),T.moveTo(z.x+F,z.y-V),T.lineTo(z.x-F,z.y+V)}}])&&oo(a.prototype,f),x}(A);function ln(d){return ln=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},ln(d)}function lo(d,a){if(!(d instanceof a))throw new TypeError("Cannot call a class as a function")}function uo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function un(d,a){return un=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},un(d,a)}function co(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Lt(d);if(a){var x=Lt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return ho(this,f)}}function ho(d,a){return!a||ln(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Lt(d){return Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Lt(d)}var fo=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&un(p,v)})(x,d);var a,f,h=co(x);function x(){return lo(this,x),h.apply(this,arguments)}return a=x,(f=[{key:"draw",value:function(p){var v=this.canvas.getContext("2d");v.lineWidth=this.options.lineWidth,v.strokeStyle=this.options.strokeStyle,v.moveTo(p[0].x,p[0].y),p.forEach(function(z,T){T!==0&&v.lineTo(z.x,z.y)}),this.options.isClose&&(v.lineTo(p[0].x,p[0].y),this.options.fillStyle&&(v.fillStyle=this.options.fillStyle))}}])&&uo(a.prototype,f),x}(A);function cn(d){return cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},cn(d)}function po(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function hn(d,a){return hn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},hn(d,a)}function vo(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=zt(d);if(a){var x=zt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return go(this,f)}}function go(d,a){return!a||cn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function zt(d){return zt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},zt(d)}var mo=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&hn(p,v)})(x,d);var a,f,h=vo(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,f=[{key:"draw",value:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=p[0],T=p[p.length-1],L=this.canvas.getContext("2d");L.lineWidth=this.options.lineWidth,L.strokeStyle=this.options.strokeStyle,this.options.fillStyle&&(L.fillStyle=this.options.fillStyle),p.length===2&&(p=U(p)),L.save();var F={x:(z.x+T.x)/2,y:(z.y+T.y)/2},V=H(p[1],p[0]),q=H(p[2],p[0]);L.translate(F.x,F.y),v<0&&(v+=360);var G=v%360;L.rotate(G*Math.PI/180),L.drawOval(0,0,V/2,q/2),L.restore()}}],f&&po(a.prototype,f),x}(A);function dn(d){return dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},dn(d)}function yo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function fn(d,a){return fn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},fn(d,a)}function wo(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Mt(d);if(a){var x=Mt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return xo(this,f)}}function xo(d,a){return!a||dn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Mt(d){return Mt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Mt(d)}var ri=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&fn(p,v)})(x,d);var a,f,h=wo(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,(f=[{key:"draw",value:function(p){p.length===2&&(p=U(p));var v=this.canvas.getContext("2d");v.lineWidth=this.options.lineWidth,v.strokeStyle=this.options.strokeStyle,this.options.fillStyle&&(v.fillStyle=this.options.fillStyle),v.save(),v.moveTo(p[0].x,p[0].y),v.lineTo(p[1].x,p[1].y),v.lineTo(p[3].x,p[3].y),v.lineTo(p[2].x,p[2].y),v.lineTo(p[0].x,p[0].y),v.restore()}}])&&yo(a.prototype,f),x}(A);function pn(d){return pn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},pn(d)}function bo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function vn(d,a){return vn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},vn(d,a)}function To(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Bt(d);if(a){var x=Bt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return So(this,f)}}function So(d,a){return!a||pn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Bt(d){return Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Bt(d)}var Eo=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&vn(p,v)})(x,d);var a,f,h=To(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,f=[{key:"draw",value:function(p){var v=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,L=p[0],F=this.options.text||"编辑文字",V=this.canvas.getContext("2d");V.fillStyle=this.options.strokeStyle,V.save();var q=T%360;V.translate(L.x,L.y),V.rotate(q*Math.PI/180),V.scale(z,z),V.font="".concat(this.options.fontSize,"px Arial");var G=F.split(`
16
+ `);G.forEach(function(ne,J){V.fillText(ne,0,0+J*v.options.fontSize)}),V.restore()}}],f&&bo(a.prototype,f),x}(A);function gn(d){return gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},gn(d)}function Po(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function mn(d,a){return mn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},mn(d,a)}function Co(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Nt(d);if(a){var x=Nt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return _o(this,f)}}function _o(d,a){return!a||gn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Nt(d){return Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Nt(d)}var Ro=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&mn(p,v)})(x,d);var a,f,h=Co(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,f=[{key:"draw",value:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.options.lineWidth,T=p[0];z*=v;var L=.2*Math.PI,F=.3*Math.PI,V=Math.sin(L)*z*2,q=z/2/Math.cos(L),G={x:T.x,y:T.y-z},ne={x:T.x+q*Math.sin(L),y:T.y-z+q*Math.cos(L)},J={x:T.x+V*Math.sin(F),y:T.y-z+V*Math.cos(F)},Z={x:T.x+q*Math.sin(2*L),y:T.y+q*Math.cos(2*L)},te={x:T.x+z*Math.sin(L),y:T.y+z*Math.cos(L)},ee={x:T.x,y:T.y+q},X={x:T.x-z*Math.sin(L),y:T.y+z*Math.cos(L)},ie={x:T.x-q*Math.sin(2*L),y:T.y+q*Math.cos(2*L)},fe={x:T.x-V*Math.sin(F),y:T.y-z+V*Math.cos(F)},xe={x:T.x-q*Math.sin(L),y:T.y-z+q*Math.cos(L)},_e=this.canvas.getContext("2d");_e.lineWidth=2,_e.moveTo(G.x,G.y),_e.lineTo(ne.x,ne.y),_e.lineTo(J.x,J.y),_e.lineTo(Z.x,Z.y),_e.lineTo(te.x,te.y),_e.lineTo(ee.x,ee.y),_e.lineTo(X.x,X.y),_e.lineTo(ie.x,ie.y),_e.lineTo(fe.x,fe.y),_e.lineTo(xe.x,xe.y),_e.lineTo(G.x,G.y),_e.strokeStyle=this.options.strokeStyle,this.options.fillStyle&&(_e.fillStyle=this.options.fillStyle)}}],f&&Po(a.prototype,f),x}(A);function yn(d){return yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},yn(d)}function ko(d,a){if(!(d instanceof a))throw new TypeError("Cannot call a class as a function")}function Oo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function wn(d,a){return wn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},wn(d,a)}function Io(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=At(d);if(a){var x=At(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Do(this,f)}}function Do(d,a){return!a||yn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function At(d){return At=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},At(d)}var Lo=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&wn(p,v)})(x,d);var a,f,h=Io(x);function x(){return ko(this,x),h.apply(this,arguments)}return a=x,f=[{key:"draw",value:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.options.lineWidth;z*=v;var T=p[0],L=this.canvas.getContext("2d");L.lineWidth=2,L.strokeStyle=this.options.strokeStyle,L.moveTo(T.x,T.y),L.lineTo(T.x,T.y-z);var F=z/5,V={x:T.x+F,y:T.y-z},q={x:T.x+2*F,y:T.y-z-F},G={x:T.x+4*F,y:T.y-z+F},ne={x:T.x+z,y:T.y-z};L.bezierCurve([V,q,G,ne]),L.moveTo(ne.x,ne.y),L.lineTo(ne.x,ne.y+z/2);var J={x:T.x+F,y:T.y-z/2},Z={x:T.x+2*F,y:T.y-z/2-F},te={x:T.x+4*F,y:T.y-z/2+F},ee={x:T.x+z,y:T.y-z/2};L.bezierCurve([J,Z,te,ee]),L.moveTo(V.x,V.y),L.lineTo(J.x,J.y)}}],f&&Oo(a.prototype,f),x}(A);function xn(d){return xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},xn(d)}function zo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function bn(d,a){return bn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},bn(d,a)}function Mo(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Ht(d);if(a){var x=Ht(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Bo(this,f)}}function Bo(d,a){return!a||xn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Ht(d){return Ht=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Ht(d)}var No=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&bn(p,v)})(x,d);var a,f,h=Mo(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,f=[{key:"draw",value:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.options.lineWidth;z*=v;var T=p[0],L=this.canvas.getContext("2d"),F=T.x,V=T.y;L.lineWidth=2,L.moveTo(F+z,V),L.arc(F,V,z,0,2*Math.PI,!1),this.options.fillStyle&&(L.fillStyle=this.options.fillStyle),L.strokeStyle=this.options.strokeStyle}}],f&&zo(a.prototype,f),x}(A),si=(l(46),l(56),l(113),l(70),"start-painting"),jt="in-painting",Tn="end-painting",Sn="stop-painting",ai="tailoring-region",li="tailoring-screenshot",ui="area-move-start",ci="area-moving",hi="area-move-end",En="select-label",Pn="cancel-select-label",Cn="db-click-label",di="cache-back",fi="cache-forward",pi="hidden-label",_n="delete-label",vi="delete-polygon-point",gi="add-polygon-point",mi="navigator-vestige",yi="graduation-change";function Ao(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}var bt,Vt={all:bt=bt||new Map,on:function(d,a){var f=bt.get(d);f?f.push(a):bt.set(d,[a])},off:function(d,a){var f=bt.get(d);f&&(a?f.splice(f.indexOf(a)>>>0,1):bt.set(d,[]))},emit:function(d,a){var f=bt.get(d);f&&f.slice().map(function(h){h(a)}),(f=bt.get("*"))&&f.slice().map(function(h){h(d,a)})}},wi=function(){function d(){(function(h,x){if(!(h instanceof x))throw new TypeError("Cannot call a class as a function")})(this,d),this.eventList=[],this.key=K()}var a,f;return a=d,f=[{key:"$emit",value:function(h,x){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document;if(Object.values(g).includes(h))Vt.emit("".concat(this.key,"_").concat(h),x);else{var v=new CustomEvent(h,{bubbles:!0,detail:x});p.dispatchEvent(v)}}},{key:"$on",value:function(h,x){var p=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:document;Object.values(g).includes(h)?Vt.on("".concat(this.key,"_").concat(h),x):(v.addEventListener(h,x,p),this.eventList.push({target:v,eventName:h,callback:x,options:p}))}},{key:"$once",value:function(h,x){var p=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:document,z=function T(L){x(L),v.removeEventListener(h,T,p)};v.addEventListener(h,z,p)}},{key:"$off",value:function(h,x,p){var v=this,z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:document;if(Object.values(g).includes(h))Vt.off("".concat(this.key,"_").concat(h),x);else{var T=this.eventList.filter(function(L){return!(L.target!==z&&z&&z!==document||L.eventName!==h&&h||L.options!==p&&p!=null||L.callback!==x&&x)});T.forEach(function(L){L.target.removeEventListener(L.eventName,L.callback,L.options);var F=v.eventList.findIndex(function(V){return V===L});~F&&v.eventList.splice(F,1)})}}},{key:"destroy",value:function(){this.$off(),Vt.all.clear()}}],f&&Ao(a.prototype,f),d}();function Rn(d){return Rn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Rn(d)}function xi(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function bi(d){for(var a=1;a<arguments.length;a++){var f=arguments[a]!=null?arguments[a]:{};a%2?xi(Object(f),!0).forEach(function(h){Ho(d,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):xi(Object(f)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(f,h))})}return d}function Ho(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function jo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function kn(d,a){return kn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},kn(d,a)}function Vo(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Ft(d);if(a){var x=Ft(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Fo(this,f)}}function Fo(d,a){return!a||Rn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Ft(d){return Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Ft(d)}var Uo=new wi,Wo=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&kn(p,v)})(x,d);var a,f,h=Vo(x);function x(){return function(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}(this,x),h.call(this)}return a=x,f=[{key:"draw",value:function(p){var v=this,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;p.length===2&&(p=U(p));var T=H(p[1],p[0]),L=H(p[2],p[0]),F=bi(bi({},p[0]),{},{width:T,height:L});if(this.options.imgLoadSuccess)this.drawImage(this.options.img,F,z);else if(this.options.img){var V=this.options.img;Uo.$once("load",function(){v.drawImage(V,F,z)},!0,V)}}},{key:"drawImage",value:function(p,v){var z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=this.canvas.getContext("2d");T.beginPath(),T.save(),T.translate(v.x,v.y),z<0&&(z+=360);var L=z%360;T.rotate(L*Math.PI/180),T.drawImage(p,0,0,v.width,v.height),T.restore()}}],f&&jo(a.prototype,f),x}(A),Go=l(114),$o=l.n(Go);function On(d){return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},On(d)}function qo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function In(d,a){return In=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},In(d,a)}function Zo(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Ut(d);if(a){var x=Ut(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Ko(this,f)}}function Ko(d,a){return!a||On(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Ut(d){return Ut=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Ut(d)}var Ti=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&In(p,v)})(x,d);var a,f,h=Zo(x);function x(p){var v,z=p.viewer,T=p.canvas,L=p.cache,F=p.options;return function(V,q){if(!(V instanceof q))throw new TypeError("Cannot call a class as a function")}(this,x),(v=h.call(this,z,T,L,F)).isInRotation=!1,v.pointList=[],v.img=new Image(33,18),v.img.src=$o.a,v}return a=x,(f=[{key:"init",value:function(p){var v=p.width,z=p.height;this.isInRotation=!0,this.imgWidth=v,this.imgHeight=z,this.rect=new ri,this.rect.setContent(this.canvas,{lineWidth:1,strokeStyle:"#989898"}),this.change()}},{key:"drawRect",value:function(p,v){var z=this.viewport.imageToViewportRectangle(0,0,this.imgWidth,this.imgHeight);this.rect.startDraw(),this.rect.draw([p,v],this.viewport.getRotation(),this.viewport.viewportToViewerElementRectangle(z)),this.rect.endDraw(),this.drawThumbPoint()}},{key:"drawRotation",value:function(){var p=this.imageToViewerElementCoordinates(this.imgWidth/2,-this.imgHeight/15),v=this.imageToViewerElementCoordinates(this.imgWidth/2,this.imgHeight/15),z=this.viewport.getRotation(),T=this.canvas.getContext("2d");T.save(),T.beginPath(),T.translate(v.x,v.y),T.rotate(z/180*Math.PI),T.font="14px Arial";var L=z+"°",F=T.measureText(L).width;T.fillStyle="rgba(0, 0, 0, 0.5)",T.rect(-F/2-10,0,F+20,24),T.fill(),T.beginPath(),T.fillStyle="#FDFDFD",T.fillText(L,-F/2,18),T.restore(),T.save(),T.beginPath(),T.translate(p.x,p.y),T.rotate(z/180*Math.PI),T.drawImage(this.img,-16.5,0,33,18),T.restore()}},{key:"drawPoint",value:function(p,v){this.thumb.draw(p,v)}},{key:"drawThumbPoint",value:function(){var p=this;this.pointList.forEach(function(v,z){p.drawPoint({x:v.x,y:v.y},{radius:5})})}},{key:"onCanvasPress",value:function(p){var v=p.x,z=p.y,T=this.imageToViewerElementCoordinates(this.imgWidth/2,-this.imgHeight/15),L=!!e({x:T.x-16.5,y:T.y},{x:T.x+16.5,y:T.y-18}).find(function(F){return s(F,{x:v,y:z})});this.rotatePoint=L?{x:v,y:z}:void 0}},{key:"onCanvasRelease",value:function(p){p.x,p.y,this.rotatePoint=void 0,this.lastPoint=void 0}},{key:"onCanvasDrag",value:function(p){var v=p.x,z=p.y;if(this.rotatePoint){this.lastPoint||(this.lastPoint={x:v,y:z});var T=W(this.pointList[4],this.lastPoint,{x:v,y:z});if(!isNaN(T/Math.PI*180)){var L=(T/Math.PI*180).toFixed(1)/1;this.viewport.setRotation((this.viewport.getRotation()+L).toFixed(1)/1),this.lastPoint={x:v,y:z}}}}},{key:"onCanvasKey",value:function(p){p.originalEvent.key==="Escape"&&(this.viewport.setRotation(0),this.stopRotation())}},{key:"stopRotation",value:function(){this.clearCanvas(),this.rotatePoint=void 0,this.lastPoint=void 0,this.pointList=[],this.isInRotation=!1}},{key:"change",value:function(){var p=this;this.isInRotation&&(this.clearCanvas(),this.pointList=e({x:0,y:0},{x:this.imgWidth,y:this.imgHeight}).map(function(v){var z=v.x,T=v.y;return p.imageToViewerElementCoordinates(z,T)}),this.drawRect(this.pointList[0],this.pointList[8]),this.drawRotation())}}])&&qo(a.prototype,f),x}(D);l(144);function Dn(d){return function(a){if(Array.isArray(a))return Ln(a)}(d)||function(a){if(typeof Symbol<"u"&&Symbol.iterator in Object(a))return Array.from(a)}(d)||function(a,f){if(a){if(typeof a=="string")return Ln(a,f);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Ln(a,f)}}(d)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ln(d,a){(a==null||a>d.length)&&(a=d.length);for(var f=0,h=new Array(a);f<a;f++)h[f]=d[f];return h}function Si(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function Xo(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function Yo(d,a){if(d==null)return{};var f,h,x=function(v,z){if(v==null)return{};var T,L,F={},V=Object.keys(v);for(L=0;L<V.length;L++)T=V[L],z.indexOf(T)>=0||(F[T]=v[T]);return F}(d,a);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);for(h=0;h<p.length;h++)f=p[h],a.indexOf(f)>=0||Object.prototype.propertyIsEnumerable.call(d,f)&&(x[f]=d[f])}return x}function Jo(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}var zn=function(){function d(h){var x=h.mitt,p=Yo(h,["mitt"]);(function(v,z){if(!(v instanceof z))throw new TypeError("Cannot call a class as a function")})(this,d),this.mitt=x,this.options=p,this.viewport=p.viewer.viewport,this.viewer=p.viewer,this.el=p.el,this.height=p.height||150,this.width=p.width||150,this.containerHeight=p.containerHeight||window.innerHeight,this.containerWidth=p.containerWidth||window.innerWidth,this.element=p.element,this.canvas=document.createElement("canvas"),this.pointList=p.pointList||[],this.loadStatus=!1,this.init(),this.vestige=this.options.vestige?function(v){for(var z=1;z<arguments.length;z++){var T=arguments[z]!=null?arguments[z]:{};z%2?Si(Object(T),!0).forEach(function(L){Xo(v,L,T[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(T)):Si(Object(T)).forEach(function(L){Object.defineProperty(v,L,Object.getOwnPropertyDescriptor(T,L))})}return v}({show:!0,delay:1e3,colors:["rgba(255, 255, 0, .5)","rgba(0, 255, 255, .5)","rgba(255, 0, 255, .5)"],zooms:[5,10,20]},this.options.vestige):{show:!0,delay:1e3,colors:["rgba(255, 255, 0, .5)","rgba(0, 255, 255, .5)","rgba(255, 0, 255, .5)"],zooms:[5,10,20]}}var a,f;return a=d,f=[{key:"init",value:function(){var h=this;this.element.innerHTML=`<main class="navigator-main">
18
+ <div class="v-line"></div>
19
+ <div class="h-line"></div>
20
+ <div class="view-rect"></div>
21
+ <canvas class="navigator-color-rect"></canvas>
22
+ </main>`;var x=this.element.getElementsByClassName("navigator-main")[0];this.rect=this.element.getElementsByClassName("view-rect")[0],this.updateNavigatorImg(this.options.thumbnail),x.appendChild(this.canvas),this.handleMouseDrag(x),this.viewer.addHandler("pan",function(p){h.navigatorChange(h.viewport.getZoom(!0),p.center)}),this.viewer.addHandler("zoom",function(p){h.navigatorChange(p.zoom,p.refPoint)})}},{key:"rectChange",value:function(){var h=this.element.getElementsByClassName("navigator-main")[0],x=this.rect,p=h.getElementsByClassName("v-line")[0],v=h.getElementsByClassName("h-line")[0];p.style.left=Math.round(x.getBoundingClientRect().width/2+x.offsetLeft)+"px",v.style.top=Math.round(x.getBoundingClientRect().height/2+x.offsetTop)+"px",p.style.backgroundColor="red",v.style.backgroundColor="red"}},{key:"rectDraw",value:function(h){var x=this.rect,p={left:x.offsetLeft,top:x.offsetTop,width:x.clientWidth,height:x.clientHeight,scale:Dn(this.vestige.zooms).reverse()[h],color:Dn(this.vestige.colors).reverse()[h]};this.pointList.push(p),this.drawPointList(this.pointList),this.mitt.$emit(mi,this.pointList)}},{key:"drawPointList",value:function(){var h=this,x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pointList;this.pointList=x;var p=this.element.getElementsByClassName("navigator-color-rect")[0],v=p.getContext("2d");this.pointList.sort(function(z,T){return z.scale>T.scale?1:-1}).forEach(function(z){h.drawRect(v,z)})}},{key:"drawRect",value:function(h,x){h.beginPath(),h.fillStyle=x.color,h.clearRect(x.left,x.top,x.width+1,x.height+1),h.fillRect(x.left,x.top,x.width+1,x.height+1)}},{key:"navigatorChange",value:function(h,x){this.loadStatus&&(x||(x=this.viewport.getCenter(!0)),this.setViewRect(x))}},{key:"panTo",value:function(h,x){var p=h.x,v=h.y,z=this.viewport.getHomeBounds(),T=this.viewport.viewportToImageRectangle(z),L=2*T.y+T.height,F=2*T.x+T.width,V={x:p/this.canvas.width*F,y:v/this.canvas.height*L};this.viewport.panTo(this.viewport.imageToViewportCoordinates(new Ge.Point(V.x,V.y)),!1)}},{key:"handleMouseDrag",value:function(h){var x,p,v=this,z=function(V){var q=V.x,G=V.y;p||(p={x:q,y:G}),x||(x={x:q,y:G});var ne=q-x.x,J=G-x.y;v.panTo({x:p.x+ne,y:p.y+J},h)},T=function V(){x="",p={x:v.centerPoint.x,y:v.centerPoint.y},v.mitt.$off("mousemove",z),v.mitt.$off("mouseup",V)},L=function V(){x="",p={x:v.centerPoint.x,y:v.centerPoint.y},v.mitt.$off("touchmove",F),v.mitt.$off("touchend",V)},F=function(V){var q=V.touches[0].clientX,G=V.touches[0].clientY;p||(p={x:q,y:G}),x||(x={x:q,y:G});var ne=q-x.x,J=G-x.y;v.panTo({x:p.x+ne,y:p.y+J},h)};this.mitt.$on("mousedown",function(V){v.mitt.$on("selectstart",function(){return 1}),v.mitt.$on("dragstart",function(){return 1}),v.panTo({x:V.x-h.getBoundingClientRect().left,y:V.y-h.getBoundingClientRect().top},h),p={x:v.centerPoint.x,y:v.centerPoint.y},v.mitt.$on("mousemove",z),v.mitt.$on("mouseup",T)},!0,h),this.mitt.$on("touchstart",function(V){var q=V.touches[0].clientX,G=V.touches[0].clientY;v.panTo({x:q-h.getBoundingClientRect().left,y:G-h.getBoundingClientRect().top},h),p={x:v.centerPoint.x,y:v.centerPoint.y},v.mitt.$on("touchmove",F),v.mitt.$on("touchend",L)},!0,h)}},{key:"setViewRect",value:function(h){var x=this;if(!this.rect)throw new Error("找不到对应的导航器遮罩元素");h||(h=this.viewport.getCenter(!0));var p=this.viewport.getHomeBounds(),v=this.viewport.viewportToImageRectangle(p),z=2*v.y+v.height,T=2*v.x+v.width,L=1,F=this.canvas.height,V=this.canvas.width;L=z<=T?F/z:V/T;var q=this.viewport.getHomeZoom(),G=this.viewport.getZoom(),ne=z*q/G,J=T*q/G;this.rect.style.cssText="height:".concat(ne*L,`px;
23
+ width: `).concat(J*L,"px;");var Z=this.viewport.viewportToImageCoordinates(h);this.centerPoint={x:Z.x*V/T,y:Z.y*F/z};var te=this.centerPoint.y-ne*L/2,ee=this.centerPoint.x-J*L/2;if(this.rect.style.left=ee+"px",this.rect.style.top=te+"px",this.rect.style.border="1px solid red",this.rectChange(),this.vestige.show!==!1){this.clearTimeId&&window.clearTimeout(this.clearTimeId);var X=this.viewport.viewportToImageZoom(G),ie=Dn(this.vestige.zooms).reverse().findIndex(function(fe){return X>=fe/(x.options.scale||40)});ie!==-1&&(this.clearTimeId=window.setTimeout(function(){x.rectDraw(ie)},this.vestige.delay||1e3))}}},{key:"updateNavigatorImg",value:function(h){var x=this;this.options.thumbnail=h;var p=this.canvas.getContext("2d"),v=new Image;v.onload=function(){var z=v.width,T=v.height;if(z>=T){var L=T/(z/x.width);x.canvas.width=x.width,x.canvas.height=L,p.clearRect(0,0,x.canvas.width,x.canvas.height),p.drawImage(v,0,0,x.canvas.width,L)}if(T>z){var F=z/(T/x.height);x.canvas.height=x.height,x.canvas.width=F,p.clearRect(0,0,x.canvas.width,x.canvas.height),p.drawImage(v,0,0,F,x.canvas.height)}x.setViewRect();var V=x.element.getElementsByClassName("navigator-color-rect")[0];V.width=x.canvas.width,V.height=x.canvas.height,x.loadStatus=!0},v.src=this.options.thumbnail}}],f&&Jo(a.prototype,f),d}();function Mn(d){return Mn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Mn(d)}function pt(d){return function(a){if(Array.isArray(a))return Bn(a)}(d)||function(a){if(typeof Symbol<"u"&&Symbol.iterator in Object(a))return Array.from(a)}(d)||function(a,f){if(a){if(typeof a=="string")return Bn(a,f);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Bn(a,f)}}(d)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Bn(d,a){(a==null||a>d.length)&&(a=d.length);for(var f=0,h=new Array(a);f<a;f++)h[f]=d[f];return h}function Ei(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function Qo(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function er(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Nn(d,a){return Nn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},Nn(d,a)}function tr(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Wt(d);if(a){var x=Wt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return nr(this,f)}}function nr(d,a){return!a||Mn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Wt(d){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Wt(d)}var Pi=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&Nn(p,v)})(x,d);var a,f,h=tr(x);function x(p){var v,z=p.kv,T=p.viewer,L=p.canvas,F=p.cache,V=p.options;return function(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}(this,x),(v=h.call(this,T,L,F,V)).kv=z,v.isInTailoring=!1,v.tailoringPoints=[],v.movePointIndex=-1,v.color="#FFF",v.contents=[],v.options=function(q){for(var G=1;G<arguments.length;G++){var ne=arguments[G]!=null?arguments[G]:{};G%2?Ei(Object(ne),!0).forEach(function(J){Qo(q,J,ne[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors(ne)):Ei(Object(ne)).forEach(function(J){Object.defineProperty(q,J,Object.getOwnPropertyDescriptor(ne,J))})}return q}({suffix:"jpeg",quality:.92,resolution:1200,shape:!0},v.options),v}return a=x,(f=[{key:"init",value:function(p){var v=p.width,z=p.height,T=p.left,L=p.top,F=p.color,V=p.now,q=V!==void 0&&V,G=p.contents,ne=G===void 0?[]:G;this.isInTailoring=!0,this.movePointIndex=-1;var J=e({x:T,y:L},{x:T+v,y:L+z});this.tailoringPoints=[J[0],J[2],J[6],J[8]],q?(this.emitScreenShot(),this.stopTailoring()):(this.color=F||"#FFF",this.contents=ne!=null&&ne.length?ne:[],this.change())}},{key:"emitTailoringRegion",value:function(){this.mitt.$emit(ai,this.viewerElementToImageRectangle({x:this.tailoringPoints[0].x,y:this.tailoringPoints[0].y,width:this.tailoringPoints[3].x-this.tailoringPoints[0].x,height:this.tailoringPoints[3].y-this.tailoringPoints[0].y}))}},{key:"drawRect",value:function(){var p=this.canvas.getContext("2d");p.beginPath(),p.strokeStyle=this.color,p.lineWidth=1,p.rect(this.tailoringPoints[0].x,this.tailoringPoints[0].y,this.tailoringPoints[3].x-this.tailoringPoints[0].x,this.tailoringPoints[3].y-this.tailoringPoints[0].y),p.stroke()}},{key:"drawTailoring",value:function(){var p,v,z,T,L,F=Math.min.apply(Math,pt(this.tailoringPoints.map(function(Be){return Be.x}))),V=Math.min.apply(Math,pt(this.tailoringPoints.map(function(Be){return Be.y}))),q=Math.max.apply(Math,pt(this.tailoringPoints.map(function(Be){return Be.x}))),G=Math.max.apply(Math,pt(this.tailoringPoints.map(function(Be){return Be.y}))),ne={x:F,y:V},J={x:q,y:V},Z={x:F,y:G},te={x:q,y:G},ee=q-F>30?30:q-F,X=G-V>30?30:G-V,ie=this.canvas.getContext("2d");ie.beginPath(),ie.strokeStyle=this.color,ie.lineWidth=4,ie.moveTo(ne.x,ne.y),ie.lineTo(ne.x+ee,ne.y),ie.moveTo(ne.x,ne.y),ie.lineTo(ne.x,ne.y+X),ie.moveTo(J.x,J.y),ie.lineTo(J.x-ee,J.y),ie.moveTo(J.x,J.y),ie.lineTo(J.x,J.y+X),ie.moveTo(Z.x,Z.y),ie.lineTo(Z.x+ee,Z.y),ie.moveTo(Z.x,Z.y),ie.lineTo(Z.x,Z.y-X),ie.moveTo(te.x,te.y),ie.lineTo(te.x-ee,te.y),ie.moveTo(te.x,te.y),ie.lineTo(te.x,te.y-X),ie.stroke(),ie.beginPath(),ie.fillStyle=this.color,ie.font="18px Arial";var fe=(J.x-ne.x).toFixed(2)/1,xe=(te.y-J.y).toFixed(2)/1;ie.fillText(!((p=this.contents)===null||p===void 0)&&p[2]?this.contents[2](fe,xe):"".concat(this.translate("area_size")).concat(fe,"*").concat(xe,",").concat(this.translate("drag_resize")),ne.x,ne.y-50),ie.fillText((v=(z=this.contents)===null||z===void 0?void 0:z[0])!==null&&v!==void 0?v:"".concat(this.translate("complete_screenshot")),ne.x,ne.y-30),ie.fillText((T=(L=this.contents)===null||L===void 0?void 0:L[1])!==null&&T!==void 0?T:"".concat(this.translate("cancel_screenshot")),ne.x,ne.y-10),ie.stroke(),ie.beginPath(),ie.fillStyle="#000000";var _e=4,Le=100;J.x+Le+_e>this.canvas.width&&(Le=-100,_e=-4),ie.rect(J.x+_e,J.y,Le,40),ie.fill(),ie.save(),ie.beginPath(),ie.translate(J.x+_e+Le/2,J.y-5),ie.fillStyle="#ffffff",ie.drawConfirm(),ie.restore(),ie.save(),ie.beginPath(),Le<0?ie.translate(J.x+Le+_e,J.y-5):ie.translate(J.x+_e,J.y-5),ie.fillStyle="#ffffff",ie.drawCancel(),ie.restore()}},{key:"onCanvasPress",value:function(p){var v=p.x,z=p.y;this.movePointIndex=this.tailoringPoints.findIndex(function(q){return s(q,{x:v,y:z},30)});var T=this.tailoringPoints[1],L=new Ge.Rect(T.x+14,T.y,30,40),F=new Ge.Rect(T.x+64,T.y,30,40);T.x+100+4>this.canvas.width&&(L=new Ge.Rect(T.x-94,T.y,30,40),F=new Ge.Rect(T.x-44,T.y,30,40));var V=new Ge.Point(v,z);L.containsPoint(V)&&this.stopTailoring(),F.containsPoint(V)&&(this.emitScreenShot(),this.stopTailoring())}},{key:"onCanvasRelease",value:function(p){p.x,p.y,this.movePointIndex=-1,this.lastPoint=void 0}},{key:"onCanvasDrag",value:function(p){var v=this,z=p.x,T=p.y;if(this.movePointIndex!==-1){this.lastPoint||(this.lastPoint={x:z,y:T});var L=z-this.lastPoint.x,F=T-this.lastPoint.y;switch(this.movePointIndex){case 0:this.tailoringPoints[0]={x:this.tailoringPoints[0].x+L,y:this.tailoringPoints[0].y+F},this.tailoringPoints[1]={x:this.tailoringPoints[1].x,y:this.tailoringPoints[1].y+F},this.tailoringPoints[2]={x:this.tailoringPoints[2].x+L,y:this.tailoringPoints[2].y};break;case 1:this.tailoringPoints[0]={x:this.tailoringPoints[0].x,y:this.tailoringPoints[0].y+F},this.tailoringPoints[1]={x:this.tailoringPoints[1].x+L,y:this.tailoringPoints[1].y+F},this.tailoringPoints[3]={x:this.tailoringPoints[3].x+L,y:this.tailoringPoints[3].y};break;case 2:this.tailoringPoints[0]={x:this.tailoringPoints[0].x+L,y:this.tailoringPoints[0].y},this.tailoringPoints[2]={x:this.tailoringPoints[2].x+L,y:this.tailoringPoints[2].y+F},this.tailoringPoints[3]={x:this.tailoringPoints[3].x,y:this.tailoringPoints[3].y+F};break;case 3:this.tailoringPoints[1]={x:this.tailoringPoints[1].x+L,y:this.tailoringPoints[1].y},this.tailoringPoints[2]={x:this.tailoringPoints[2].x,y:this.tailoringPoints[2].y+F},this.tailoringPoints[3]={x:this.tailoringPoints[3].x+L,y:this.tailoringPoints[3].y+F}}this.tailoringPoints.forEach(function(V){V.x<0&&(V.x=0),V.y<0&&(V.y=0),V.x>v.canvas.width&&(V.x=v.canvas.width),V.y>v.canvas.height&&(V.y=v.canvas.height)}),this.clearCanvas(),this.drawRect(),this.drawTailoring(),this.lastPoint={x:z,y:T},this.emitTailoringRegion()}}},{key:"onCanvasKey",value:function(p){p.originalEvent.key==="Escape"&&this.stopTailoring()}},{key:"onCanvasDblClick",value:function(p){this.tailoringPoints.length>0&&this.isPointInMatrix(p)&&this.emitScreenShot(),this.stopTailoring()}},{key:"emitScreenShot",value:function(){this.emitTailoringRegion(),this.mitt.$emit(li,{base64:this.getScreenCanvasImage(),region:this.viewerElementToImageRectangle({x:this.tailoringPoints[0].x,y:this.tailoringPoints[0].y,width:this.tailoringPoints[3].x-this.tailoringPoints[0].x,height:this.tailoringPoints[3].y-this.tailoringPoints[0].y})})}},{key:"isPointInMatrix",value:function(p){var v=Math.min.apply(Math,pt(this.tailoringPoints.map(function(F){return F.x}))),z=Math.min.apply(Math,pt(this.tailoringPoints.map(function(F){return F.y}))),T=Math.max.apply(Math,pt(this.tailoringPoints.map(function(F){return F.x}))),L=Math.max.apply(Math,pt(this.tailoringPoints.map(function(F){return F.y})));return n({x:v,y:z},{x:T,y:z},{x:v,y:L},{x:T,y:L},p)}},{key:"getScreenCanvasImage",value:function(){var p=this.viewer.drawer.canvas,v=Math.min.apply(Math,pt(this.tailoringPoints.map(function(je){return je.x}))),z=Math.min.apply(Math,pt(this.tailoringPoints.map(function(je){return je.y}))),T=Math.max.apply(Math,pt(this.tailoringPoints.map(function(je){return je.x}))),L=Math.max.apply(Math,pt(this.tailoringPoints.map(function(je){return je.y}))),F=p.getContext("2d"),V=p.getBoundingClientRect(),q=V.width,G=V.height,ne=[p.width,p.height],J=ne[0]/q,Z=ne[1]/G,te=Math.abs(T-v)*J,ee=Math.abs(L-z)*Z;if(te.toFixed(5)/1!=0&&ee.toFixed(5)/1!=0)try{for(var X,ie=F.getImageData(v*J,z*Z,te,ee),fe=0;fe<ie.data.length;fe+=4)ie.data[fe+3]===0&&(ie.data[fe]=255,ie.data[fe+1]=255,ie.data[fe+2]=255,ie.data[fe+3]=255);var xe=document.createElement("canvas");xe.width=te,xe.height=ee;var _e=xe.getContext("2d");_e.fillstyle="#fff",_e.fillRect(0,0,xe.width,xe.height),_e.putImageData(ie,0,0,0,0,te,ee);var Le=(X=this.kv.shape)===null||X===void 0?void 0:X.canvas;if(Le&&this.options.shape&&_e.drawImage(Le,v*J,z*Z,te,ee,0,0,te,ee),xe.width>this.options.resolution){var Be=document.createElement("canvas");Be.width=this.options.resolution,Be.height=this.options.resolution/xe.width*xe.height;var ze=Be.getContext("2d");return ze.fillstyle="#fff",ze.fillRect(0,0,Be.width,Be.height),ze.drawImage(xe,0,0,xe.width,xe.height,0,0,Be.width,Be.height),Be.toDataURL("image/".concat(this.options.suffix||"jpeg"),this.options.quality)}return xe.toDataURL("image/".concat(this.options.suffix||"jpeg"),this.options.quality)}catch{}}},{key:"stopTailoring",value:function(){this.clearCanvas(),this.tailoringPoints=[],this.isInTailoring=!1,this.movePointIndex=-1,this.lastPoint=void 0}},{key:"change",value:function(){this.isInTailoring&&(this.clearCanvas(),this.emitTailoringRegion(),this.drawRect(),this.drawTailoring())}}])&&er(a.prototype,f),x}(D);l(149);function An(d){return An=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},An(d)}function ir(d,a){if(!(d instanceof a))throw new TypeError("Cannot call a class as a function")}function or(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Hn(d,a){return Hn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},Hn(d,a)}function rr(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Gt(d);if(a){var x=Gt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return sr(this,f)}}function sr(d,a){return!a||An(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Gt(d){return Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Gt(d)}var ar=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&Hn(p,v)})(x,d);var a,f,h=rr(x);function x(){return ir(this,x),h.apply(this,arguments)}return a=x,f=[{key:"draw",value:function(p,v){var z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=this.canvas.getContext("2d"),L=p.tool,F=p.points;T.beginPath(),T.save(),F.length===2&&(F=U(F));var V=_(F),q={x:V.x+V.width/2,y:V.y+V.height/2};T.translate(q.x,q.y),z<0&&(z+=360);var G=z%360;T.rotate(G*Math.PI/180),L===w?T.drawPolygon(F.map(function(ne){return{x:ne.x-q.x,y:ne.y-q.y}}),!0,!1):L===Je?(T.moveTo(F[0].x-q.x,F[0].y-q.y),T.lineTo(F[0].x+V.width-q.x,F[0].y-q.y),T.lineTo(F[0].x+V.width-q.x,F[0].y+V.height-q.y),T.lineTo(F[0].x-q.x,F[0].y+V.height-q.y),T.lineTo(F[0].x-q.x,F[0].y-q.y)):L===et&&T.drawOval(0,0,Math.abs(V.width/2),Math.abs(V.height/2),!1),T.closePath(),T.restore(),v.forEach(function(ne){var J=ne.tool,Z=ne.points;Z.length===2&&(Z=U(Z)),T.save();var te=_(Z),ee={x:te.x+te.width/2,y:te.y+te.height/2};T.translate(ee.x,ee.y),T.rotate(G*Math.PI/180),J===w?T.drawPolygon(Z.map(function(X){return{x:X.x-ee.x,y:X.y-ee.y}}),!0,!0):J===Je?(T.moveTo(Z[0].x-ee.x,Z[0].y-ee.y),T.lineTo(Z[0].x-ee.x,Z[0].y+te.height-ee.y),T.lineTo(Z[0].x+te.width-ee.x,Z[0].y+te.height-ee.y),T.lineTo(Z[0].x+te.width-ee.x,Z[0].y-ee.y),T.lineTo(Z[0].x-ee.x,Z[0].y-ee.y)):J===et&&T.drawOval(0,0,Math.abs(te.width/2),Math.abs(te.height/2),!0),T.closePath(),T.restore()}),this.options.fillStyle&&(T.fillStyle=this.options.fillStyle,T.fill())}}],f&&or(a.prototype,f),x}(A);function jn(d){return jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},jn(d)}function Ci(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function _i(d){for(var a=1;a<arguments.length;a++){var f=arguments[a]!=null?arguments[a]:{};a%2?Ci(Object(f),!0).forEach(function(h){lr(d,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):Ci(Object(f)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(f,h))})}return d}function lr(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function ur(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Vn(d,a){return Vn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},Vn(d,a)}function cr(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=$t(d);if(a){var x=$t(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return hr(this,f)}}function hr(d,a){return!a||jn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function $t(d){return $t=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},$t(d)}var Ri=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&Vn(p,v)})(x,d);var a,f,h=cr(x);function x(p){var v,z=p.viewer,T=p.canvas,L=p.cache,F=p.options;return function(V,q){if(!(V instanceof q))throw new TypeError("Cannot call a class as a function")}(this,x),(v=h.call(this,z,T,L,F)).labelList=[],Pe.forEach(function(V){v[V]=new y[V]}),v.combination=new ar,v.delaytimer=[],v}return a=x,(f=[{key:"onCanvasKey",value:function(p){}},{key:"setLabelList",value:function(p){this.labelList=p,this.change()}},{key:"change",value:function(){var p=this;this.clearCanvas();var v=this.viewport.viewportToImageRectangle(this.viewport.getBoundsNoRotate()),z={},T={},L=[],F=[],V=this.labelList.filter(function(q){var G,ne,J,Z,te;if(q.show===!1||q.custom||!p[q.tool]||!p.isInCanvas(q.region,v))return!1;if((be.includes(q.tool)||q.isClose&&q.tool===w)&&q.fillStyle)L.push(_i(_i({},q),{},{child:[],self:q}));else if(q.tool===we)return F.push(q),!1;var ee="".concat((G=q.strokeStyle)!==null&&G!==void 0?G:"","_").concat((ne=q.lineWidth)!==null&&ne!==void 0?ne:"","_").concat((J=q.fillStyle)!==null&&J!==void 0?J:""),X="".concat((Z=q.strokeStyle)!==null&&Z!==void 0?Z:"","_").concat((te=q.lineWidth)!==null&&te!==void 0?te:"");return ge.includes(q.tool)?z[ee]?z[ee].push(q):z[ee]=[q]:T[X]?T[X].push(q):T[X]=[q],!se.includes(q.tool)});L.length>0&&V.forEach(function(q){var G=L.find(function(ne){return ne.self!==q&&q.points.every(function(J){return p.isContainerInRegion(J,ne)})});G&&G.child.push(q)}),this.delaytimer&&(clearTimeout(this.delaytimer),this.delaytimer=void 0),F.forEach(function(q){p.drawLabel(q)}),this.deepDrawLabel(z,T,L,1,v)}},{key:"deepDrawLabel",value:function(p,v,z,T,L){var F=this,V=0,q=this.canvas.getContext("2d"),G={};Object.keys(p).forEach(function(J){var Z=p[J];q.beginPath(),Z.forEach(function(ee){V>=4e3?G[J]?G[J].push(ee):G[J]=[ee]:F.drawLabel(ee),V+=ee.points.length});var te=Z==null?void 0:Z[0];te!=null&&te.fillStyle&&(q.fillStyle=te.fillStyle,q.fill()),q.strokeStyle=te.strokeStyle,q.stroke()});var ne={};Object.keys(v).forEach(function(J){var Z=v[J];q.beginPath(),Z.forEach(function(ee){V>=4e3?ne[J]?ne[J].push(ee):ne[J]=[ee]:F.drawLabel(ee),V+=ee.points.length});var te=Z==null?void 0:Z[0];q.lineWidth=te.lineWidth,q.strokeStyle=te.strokeStyle,q.stroke()}),Object.keys(G).length===0&&Object.keys(ne).length===0?(this.delaytimer=void 0,z.forEach(function(J){F.combination.setContent(F.canvas,J),F.combination.draw({points:F.imageToViewerElementPoints(J.points),tool:J.tool},J.child.map(function(Z){var te=Z.points,ee=Z.tool;return{points:F.imageToViewerElementPoints(te),tool:ee}}),F.getAngle(J.angle))})):this.delaytimer=setTimeout(function(){F.deepDrawLabel(G,ne,z,T+1,L)},100)}},{key:"getAngle",value:function(p){var v=this.viewport.getRotation()%360;return p?p>v?v-p+360:v-p:v}},{key:"drawLabel",value:function(p){p.viewerElementPoints=this.imageToViewerElementPoints(p.points);var v=p.viewerElementPoints;if(this[p.tool].setContent(this.canvas,p),be.includes(p.tool))this[p.tool].draw(v,this.getAngle(p.angle));else{var z=this.getImageZoom(!0)/p.scale;this[p.tool].draw(v,z,this.getAngle(p.angle))}}}])&&ur(a.prototype,f),x}(D);function Fn(d){return Fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Fn(d)}function ki(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function lt(d){for(var a=1;a<arguments.length;a++){var f=arguments[a]!=null?arguments[a]:{};a%2?ki(Object(f),!0).forEach(function(h){dr(d,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):ki(Object(f)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(f,h))})}return d}function dr(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function fr(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Un(d,a){return Un=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},Un(d,a)}function pr(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=qt(d);if(a){var x=qt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return vr(this,f)}}function vr(d,a){return!a||Fn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function qt(d){return qt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},qt(d)}var Oi=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&Un(p,v)})(x,d);var a,f,h=pr(x);function x(p){var v,z=p.viewer,T=p.canvas,L=p.cache,F=p.options;return function(V,q){if(!(V instanceof q))throw new TypeError("Cannot call a class as a function")}(this,x),(v=h.call(this,z,T,L,F)).labelList=[],v.movePoint=void 0,v.currentPressPoint=void 0,v.lastPoint=void 0,v.draging=!1,v.isHover=!1,Pe.forEach(function(V){v[V]=new y[V]}),v}return a=x,(f=[{key:"drawPoint",value:function(p,v){this.thumb.draw(p,{radius:v?this.options.thumb.activeRadius:this.options.thumb.radius,strokeStyle:v?this.options.thumb.activeColor:this.options.thumb.color,fillStyle:v?this.options.thumb.activeBgColor:this.options.thumb.bgColor})}},{key:"drawLines",value:function(p,v){var z=this,T=this.canvas.getContext("2d");p.forEach(function(L,F){T.beginPath(),T.strokeStyle=q||"#01d0b0",T.lineWidth=2;var V=F===v,q=V?z.options.thumb.activeColor:z.options.thumb.color,G=2*(V?z.options.thumb.activeRadius:z.options.thumb.radius);if(F===0||F===2){var ne=p[1],J=F===2?p[5]:p[3],Z=ne.x>L.x?-1:1,te=J.y>L.y?-1:1;T.moveTo(L.x+5*Z,L.y+5*te),T.lineTo(L.x+(5-G)*Z,L.y+5*te),T.moveTo(L.x+5*Z,L.y+5*te),T.lineTo(L.x+5*Z,L.y+(5-G)*te)}else if(F===1||F===7){var ee=p[4].y>L.y?-1:1;T.moveTo(L.x,L.y+5*ee),T.lineTo(L.x-G/2,L.y+5*ee),T.moveTo(L.x,L.y+5*ee),T.lineTo(L.x+G/2,L.y+5*ee)}else if(F===3||F===5){var X=p[4].x>L.x?-1:1;T.moveTo(L.x+5*X,L.y),T.lineTo(L.x+5*X,L.y-G/2),T.moveTo(L.x+5*X,L.y),T.lineTo(L.x+5*X,L.y+G/2)}else if(F===4&&V)z.drawPoint(L,V);else if(F===6||F===8){var ie=F===8?p[5]:p[3],fe=p[7],xe=ie.y>L.y?-1:1,_e=fe.x>L.x?-1:1;T.moveTo(L.x+5*_e,L.y+5*xe),T.lineTo(L.x+5*_e,L.y+(5-G)*xe),T.moveTo(L.x+5*_e,L.y+5*xe),T.lineTo(L.x+(5-G)*_e,L.y+5*xe)}T.stroke()})}},{key:"setLabelList",value:function(p){this.labelList=p,this.change()}},{key:"onCanvasPress",value:function(p){var v=this,z=p.x,T=p.y;this.movePoint=void 0,this.currentPressPoint=void 0,this.lastPoint=void 0,this.draging=!1;var L,F=[],V=void 0,q=this.viewport.viewportToImageRectangle(this.viewport.getBoundsNoRotate());this.labelList.forEach(function(G){if(G.tool!==we&&(G.select&&(V=G),G.select=!1,!v.movePoint)){if(!v.isInCanvas(G.region,q))return!1;var ne=-1,J=[],Z=v.getImageZoom(!0)/G.scale,te=v.imageToViewerElementPoints(G.points),ee={x:te[0].x,y:te[0].y},X={x:te[te.length-1].x,y:te[te.length-1].y};if(be.includes(G.tool))ne=(J=t(te)).findIndex(function(ze){return s(ze,{x:z,y:T})});else if(G.tool===w)ne=(J=v.setPointsMove(G,te)).findIndex(function(ze){return ze.canMove&&s(ze,{x:z,y:T})});else if(Oe.includes(G.tool)){var ie=G.lineWidth||2;J=[ee,X],ne=s(ee,{x:z,y:T},10+ie)?1:s(X,{x:z,y:T},10+ie)?7:s({x:(X.x+ee.x)/2,y:(X.y+ee.y)/2},{x:z,y:T},10+ie)?4:-1}else if(G.tool===j){var fe=v.getFontWidth(G.text,G.fontSize);J=e({x:X.x,y:X.y-G.fontSize*Z},{x:X.x+fe*Z,y:X.y});var xe=B(X,{x:z,y:T},-G.angle);ne=J.findIndex(function(ze,je){return s(ze,xe)&&je===4})}else if(G.tool===oe){var _e=G.lineWidth*Z;ne=(J=e({x:X.x-_e,y:X.y-_e},{x:X.x+_e,y:X.y+_e})).findIndex(function(ze){return s(ze,{x:z,y:T})})}if(G.tool===ce){var Le=G.lineWidth*Z;ne=(J=e({x:X.x-Le,y:X.y-Le},{x:X.x+Le,y:X.y+Le})).findIndex(function(ze,je){return s(ze,{x:z,y:T})&&je===4})}else if(G.tool===pe){var Be=G.lineWidth*Z;ne=(J=e({x:X.x,y:X.y-Be},{x:X.x+Be,y:X.y})).findIndex(function(ze){return s(ze,{x:z,y:T})})}~ne?(v.movePoint={position:ne,label:G},v.currentPressPoint={x:z,y:T}):G.tool===w?c({x:z,y:T},J)&&F.push(G):Oe.includes(G.tool)?m({x:z,y:T},J)&&F.push(G):n(J[0],J[2],J[6],J[8],{x:z,y:T})&&F.push(G)}}),this.movePoint?(this.movePoint.label.select=!0,this.mitt.$emit(En,this.movePoint.label),this.mitt.$emit(ui,this.movePoint.label),this.draging=!0):F.length>0&&(F.sort(function(G,ne){return G.tool===ce?-1:G.tool===j?ne.tool===ce?1:-1:G.tool===oe?ne.tool===ce||ne.tool===j?1:-1:G.tool===pe?ne.tool===ce||ne.tool===j||ne.tool===oe?1:-1:Math.abs(G.region.width)-Math.abs(ne.region.width)}),(L=F[0]).select=!0),L?this.mitt.$emit(En,L):!this.movePoint&&V&&this.mitt.$emit(Pn,V),this.change()}},{key:"onCanvasDblClick",value:function(p){var v=this,z=p.x,T=p.y;setTimeout(function(){var L=v.labelList.find(function(ee){return ee.select});if((L==null?void 0:L.tool)===w){for(var F=v.imageToViewerElementPoints(L.points),V=-1,q=0,G=F.length,ne=G-1;q<G;ne=q,q++){var J=F[q],Z=F[ne];if(m({x:z,y:T},[J,Z])){V=q;break}}if(V>-1){var te=v.viewerElementToImageCoordinates(z,T);L.points.splice(V,0,lt(lt({},te),{},{canMove:!0})),v.mitt.$emit(gi,L),v.change()}else v.mitt.$emit(Cn,L)}else v.mitt.$emit(Cn,L)})}},{key:"onCanvasMove",value:function(p){var v=p.x,z=p.y,T=this.labelList.find(function(V){var q=V.tool,G=V.select;return q===Je&&G});if(T&&!this.movePoint){var L=this.imageToViewerElementPoints(T.points);if(this.isContainerInRegion({x:v,y:z},{isClose:!0,points:L,tool:Je,region:_(L)})){var F={x:(L[L.length-1].x+L[0].x)/2,y:(L[L.length-1].y+L[0].y)/2};s(F,{x:v,y:z})?(this.isHover=!0,this.drawPoint(F,!!this.movePoint)):this.isHover&&(this.isHover=!1,this.change())}}}},{key:"onCanvasRelease",value:function(p){var v=p.x,z=p.y;if(this.movePoint&&this.options.drag!==!1){var T=H(this.currentPressPoint,{x:v,y:z});if(Math.abs(T)>1){var L=this.movePoint.label;this.mitt.$emit(hi,L)}}this.movePoint=void 0,this.currentPressPoint=void 0,this.lastPoint=void 0,this.draging=!1,this.change()}},{key:"onCanvasDrag",value:function(p,v){var z=this,T=p.x,L=p.y;if(this.options.drag!==!1){this.lastPoint||(this.lastPoint={x:T,y:L});var F=this.movePoint.label,V=this.movePoint.position,q=F.move!==!1,G=F.resize!==!1;if((q||G)&&(V!==4||q)&&(V===4||G)){v.preventDefaultAction=!0;var ne=this.getImageZoom(!0)/F.scale,J=F.tool,Z=this.imageToViewerElementPoints(F.points),te=Z[0],ee=Z[Z.length-1],X=T-this.lastPoint.x,ie=L-this.lastPoint.y;if(Oe.includes(J))V===4&&(Z[0]={x:te.x+X,y:te.y+ie},Z[1]={x:ee.x+X,y:ee.y+ie}),V===1&&(Z[0]={x:te.x+X,y:te.y+ie}),V===7&&(Z[1]={x:ee.x+X,y:ee.y+ie});else if(be.includes(J)){var fe=t(Z);switch(V){case 0:Z[0]={x:fe[0].x+X,y:fe[0].y+ie},Z[1]={x:fe[2].x,y:fe[2].y+ie},Z[2]={x:fe[6].x+X,y:fe[6].y};break;case 1:Z[0]={x:fe[0].x,y:fe[0].y+ie},Z[1]={x:fe[2].x,y:fe[2].y+ie};break;case 2:Z[0]={x:fe[0].x,y:fe[0].y+ie},Z[1]={x:fe[2].x+X,y:fe[2].y+ie},Z[3]={x:fe[8].x+X,y:fe[8].y};break;case 3:Z[0]={x:fe[0].x+X,y:fe[0].y},Z[2]={x:fe[6].x+X,y:fe[6].y};break;case 4:Z[0]={x:fe[0].x+X,y:fe[0].y+ie},Z[1]={x:fe[2].x+X,y:fe[2].y+ie},Z[2]={x:fe[6].x+X,y:fe[6].y+ie},Z[3]={x:fe[8].x+X,y:fe[8].y+ie};break;case 5:Z[1]={x:fe[2].x+X,y:fe[2].y},Z[3]={x:fe[8].x+X,y:fe[8].y};break;case 6:Z[0]={x:fe[0].x+X,y:fe[0].y},Z[2]={x:fe[6].x+X,y:fe[6].y+ie},Z[3]={x:fe[8].x,y:fe[8].y+ie};break;case 7:Z[2]={x:fe[6].x,y:fe[6].y+ie},Z[3]={x:fe[8].x,y:fe[8].y+ie};break;case 8:Z[1]={x:fe[2].x+X,y:fe[2].y},Z[2]={x:fe[6].x,y:fe[6].y+ie},Z[3]={x:fe[8].x+X,y:fe[8].y+ie}}}else if(J===w){for(var xe=Z.map(function(Ne,Ye){return lt(lt({},Ne),{},{index:Ye})}).filter(function(Ne){return Ne.canMove}),_e=void 0,Le=void 0,Be=0;Be<xe.length-1;Be++){if(V===0){_e=xe[xe.length-1].index,Le=xe[1].index;break}if(V===xe[xe.length-1].index){_e=xe[xe.length-2].index,Le=xe[0].index;break}if(V===xe[Be].index){_e=xe[Be-1].index,Le=xe[Be+1].index;break}}if(!_e&&_e!==0||!Le&&Le!==0)return;var ze=Z[_e],je=Z[Le],nt=Z[V],ut=W(je,nt,{x:T,y:L}),ct=W(ze,nt,{x:T,y:L}),yt=H({x:T,y:L},je)/H(nt,je),at=H({x:T,y:L},ze)/H(nt,ze);F.points=Z.map(function(Ne,Ye){if(V===0&&Ye>=V&&Ye<=Le||V===xe[xe.length-1].index&&Ye>=V&&Ye>=Le||V!==0&&V!==xe[xe.length-1].index&&Ye>=V&&Ye<=Le){if(yt===1/0)return lt(lt({},Ne),z.viewerElementToImageCoordinates(je.x,je.y));var gt=B(je,Ne,180*ut/Math.PI);return lt(lt({},Ne),z.viewerElementToImageCoordinates((gt.x-je.x)*yt+je.x,(gt.y-je.y)*yt+je.y))}if(V===0&&Ye>=_e||V===xe[xe.length-1].index&&Ye<=V&&Ye>=_e||V!==0&&V!==xe[xe.length-1].index&&Ye>=_e&&Ye<=V){if(at===1/0)return lt(lt({},Ne),z.viewerElementToImageCoordinates(ze.x,ze.y));var _t=B(ze,Ne,180*ct/Math.PI);return lt(lt({},Ne),z.viewerElementToImageCoordinates((_t.x-ze.x)*at+ze.x,(_t.y-ze.y)*at+ze.y))}return lt(lt({},Ne),z.viewerElementToImageCoordinates(Ne.x,Ne.y))})}else J===j||J===ce?V===4&&(Z[0]={x:ee.x+X,y:ee.y+ie},Z[1]={x:ee.x+X,y:ee.y+ie}):J===oe?V===4?(Z[0]={x:ee.x+X,y:ee.y+ie},Z[1]={x:ee.x+X,y:ee.y+ie}):V===0||V===2?F.lineWidth-=ie/ne:V!==6&&V!==8||(F.lineWidth+=ie/ne):J===pe&&(V===4?(Z[0]={x:ee.x+X,y:ee.y+ie},Z[1]={x:ee.x+X,y:ee.y+ie}):V===0||V===2?F.lineWidth-=ie/ne:V!==6&&V!==8||(F.lineWidth+=ie/ne,Z[1]={x:ee.x,y:ee.y+ie},Z[0]={x:ee.x,y:ee.y+ie}));J!==w&&(F.points=this.viewerElementToImagePoints(Z)),F.region=_(F.points),this.mitt.$emit(ci,F),this.lastPoint={x:T,y:L}}}}},{key:"drawThumbPoints",value:function(p,v){var z,T=this;if(this.options.thumb.show!==!1){var L=(z=this.movePoint)===null||z===void 0?void 0:z.position;Oe.includes(v)?(this.drawPoint(p[0],L===1),this.drawPoint({x:(p[0].x+p[1].x)/2,y:(p[0].y+p[1].y)/2},L===4),this.drawPoint(p[1],L===7)):v===Je?this.drawLines(t(p),L):be.includes(v)?t(p).forEach(function(F,V){T.drawPoint(F,L===V)}):v===w?p.forEach(function(F,V){F.canMove&&T.drawPoint(F,L===V)}):v===j||v===ce?this.drawPoint(p[0],L===4):v!==oe&&v!==pe||e(p[0],p[1]).forEach(function(F,V){V!==0&&V!==2&&V!==4&&V!==6&&V!==8||T.drawPoint(F,L===V)})}}},{key:"change",value:function(){this.clearCanvas(),this.showLabelMeasure();var p=this.labelList.find(function(G){return G.select});if(p&&p.show!==!1){var v=this.imageToViewerElementPoints(p.points),z=v[0],T=this.getImageZoom(!0)/p.scale;if(de.includes(p.tool))if(p.tool===j){var L=this.getFontWidth(p.text,p.fontSize),F=B(z,{x:z.x+L/2*T,y:z.y-p.fontSize/2*T+4},p.angle);this.drawThumbPoints([F],p.tool)}else if(p.tool===oe){var V=p.lineWidth*T;this.drawThumbPoints([{x:z.x-V,y:z.y-V},{x:z.x+V,y:z.y+V}],p.tool)}else if(p.tool===ce)this.drawThumbPoints([{x:z.x,y:z.y}],p.tool);else if(p.tool===pe){var q=p.lineWidth*T;this.drawThumbPoints([{x:z.x,y:z.y-q},{x:z.x+q,y:z.y}],p.tool)}else p.tool===w&&(this.draging?this.drawThumbPoints(v,p.tool):this.drawThumbPoints(this.setPointsMove(p,v),p.tool));else this.drawThumbPoints(this.imageToViewerElementPoints(p.points),p.tool);this[p.tool].setContent(this.canvas,lt({},p))}}},{key:"showLabelMeasure",value:function(){var p=this,v=this.viewport.viewportToImageRectangle(this.viewport.getBoundsNoRotate()),z=this.getImageZoom(!0)*this.options.scale;this.labelList.forEach(function(T){T.show!==!1&&p.isInCanvas(T.region,v)&&(p.labelDrawingFunc(T),T.measure!==!1&&(T.select||z>=p.options.measure.scale&&p.options.measure.defaultShow)&&p[T.tool].drawMeasureInfo.call(p,T,p.getMeasureContent(T)))})}},{key:"labelDrawingFunc",value:function(p){var v,z;(this.options.labelDrawing||!((v=this.options.label)===null||v===void 0)&&v.drawing)&&(((z=this.options.label)===null||z===void 0?void 0:z.drawing)||this.options.labelDrawing)(this.canvas,p,this.imageToViewerElementRectangle(p.region))}},{key:"setPointsMove",value:function(p,v){var z,T=v[0],L=((z=this.options.label)===null||z===void 0?void 0:z.polygonWidth)||30;return v.forEach(function(F,V){F.canMove=!1,p.points[V].canMove=!1,V!==0&&(s(T,F,L)||s(v[0],F,L))&&V!==v.length-1||(T=F,F.canMove=!0,p.points[V].canMove=!0)}),v}}])&&fr(a.prototype,f),x}(D);function gr(d,a){if(!(d instanceof a))throw new TypeError("Cannot call a class as a function")}var Wn=function d(){var a,f,h,x,p,v,z,T=this,L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gr(this,d),L||(L={}),this.id=L.id,this.parent_id=L.parent_id,this.lineWidth=L.lineWidth?L.lineWidth:L.tool===oe?15:L.tool===pe?30:L.tool===ce?10:2,this.strokeStyle=L.strokeStyle||"#027AFF",this.fillStyle=L.fillStyle,this.description=L.description,this.fontSize=L.fontSize||14,this.text=L.text,this.angle=(a=L.angle)!==null&&a!==void 0?a:0,this.measure=L.measure,this.points=L.points,this.tool=L.tool,this.src=L.src,this.scale=L.scale,this.region=L.region,this.move=L.move,this.resize=L.resize,this.isROI=(f=L.isROI)!==null&&f!==void 0&&f,this.isClose=(h=L.isClose)===null||h===void 0||h,this.custom=(x=L.custom)!==null&&x!==void 0&&x,this.select=(p=L.select)!==null&&p!==void 0&&p,this.show=(v=L.show)===null||v===void 0||v,this.__other__=L.__other__||{},this.__data__=(z=L.__data__)!==null&&z!==void 0?z:L,this.src&&(this.img=new Image,this.img.src=this.src,this.imgLoadSuccess=!1,this.img.onload=function(){T.imgLoadSuccess=!0})};function Gn(d){return Gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Gn(d)}function Ii(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function Tt(d){for(var a=1;a<arguments.length;a++){var f=arguments[a]!=null?arguments[a]:{};a%2?Ii(Object(f),!0).forEach(function(h){mr(d,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):Ii(Object(f)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(f,h))})}return d}function mr(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function yr(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function $n(d,a){return $n=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},$n(d,a)}function wr(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Zt(d);if(a){var x=Zt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return xr(this,f)}}function xr(d,a){return!a||Gn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Zt(d){return Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Zt(d)}var Di=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&$n(p,v)})(x,d);var a,f,h=wr(x);function x(p){var v,z=p.viewer,T=p.canvas,L=p.cache,F=p.options;return function(V,q){if(!(V instanceof q))throw new TypeError("Cannot call a class as a function")}(this,x),v=h.call(this,z,T,L,F),Pe.forEach(function(V){v[V]=new y[V]}),v.ROIList=[],v.points=[],v.tool=void 0,v.isInDraw=!1,v}return a=x,f=[{key:"startDraw",value:function(p){if(!p.tool)throw new Error("options.tool must not bu null");if(p.tool==="curve")throw new Error("Curve is obsolete. Please use polygon instead");if(!Pe.includes(p.tool))throw new Error("".concat(p.tool," is not a effective drawing tool"));this.viewer.canvas.focus(),this.points=[],this.tool=p.tool,this[this.tool].setContent(this.canvas,Tt(Tt({strokeStyle:"#027AFF",fillStyle:"",description:"",text:"",measure:!0,clear:!0,isClose:!0,enableDbClickClose:!0},p),{},{lineWidth:p.lineWidth?p.lineWidth:this.tool===oe?15:this.tool===pe?30:this.tool===ce?10:2,tool:void 0})),this.isInDraw=!0}},{key:"updateOptions",value:function(p){if(!p.tool)throw new Error("options.tool must not bu null");if(p.tool==="curve")throw new Error("Curve is obsolete. Please use polygon instead");if(!Pe.includes(p.tool))throw new Error("".concat(p.tool," is not a effective drawing tool"));this.viewer.canvas.focus(),this.tool=p.tool,this[this.tool].setContent(this.canvas,Tt(Tt({strokeStyle:"#027AFF",fillStyle:"",description:"",text:"",measure:!0,clear:!0,isClose:!0,enableDbClickClose:!0},p),{},{lineWidth:p.lineWidth?p.lineWidth:this.tool===oe?15:this.tool===pe?30:this.tool===ce?10:2,tool:void 0}))}},{key:"setLabelList",value:function(p){this.ROIList=p.filter(function(v){return v.isROI})}},{key:"onCanvasPress",value:function(p){var v=p.x,z=p.y,T=this.viewerElementToImageCoordinates(v,z);if(!this.isInROI(T))return this.points=[],void this.clearCanvas();var L=this.tool;L===w?this.points.push(T):be.includes(L)?this.points=[T,T,T,T]:this.points=[T],this.clearCanvas(),this[L].startDraw();var F=this.imageToViewerElementPoints(this.points);this[L].draw(F),this[L].endDraw(),this[L].drawPoints(F,{radius:this.options.thumb.radius,strokeStyle:this.options.thumb.color,fillStyle:this.options.thumb.bgColor}),this.mitt.$emit(si,this.getPaintOptions())}},{key:"onCanvasDrag",value:function(p){var v=p.position,z=v.x,T=v.y,L=this.viewerElementToImageCoordinates(z,T);if(!this.isInROI(L))return this.points=[],void this.clearCanvas();p.preventDefaultAction=!0;var F=this.tool;if(be.includes(F)){var V=this.imageToViewerElementCoordinates(this.points[0].x,this.points[0].y);this.points=this.viewerElementToImagePoints(U([V,{x:z,y:T}]))}else de.includes(F)?F===w?(this.points.push(L),this.setEnablePoints(!1)):ge.includes(F)&&(this.points=[L,L]):this.points=[this.points[0]||L,L];this.clearCanvas(),this[F].startDraw();var q=this.imageToViewerElementPoints(this.points);this[F].draw(q),this[F].endDraw(),this[F].drawPoints(q,{radius:this.options.thumb.radius,strokeStyle:this.options.thumb.color,fillStyle:this.options.thumb.bgColor}),this.mitt.$emit(jt,this.getPaintOptions())}},{key:"onCanvasRelease",value:function(p){var v=p.x,z=p.y,T=this.viewerElementToImageCoordinates(v,z);if(!this.isInROI(T)||this.points.length===0)return this.points=[],void this.clearCanvas();var L=this.tool;if(de.includes(L)){if(ge.includes(L))this.points=[T,T];else if(L===w){var F=this.imageToViewerElementCoordinates(this.points[0].x,this.points[0].y),V=this[this.tool].options.enableDbClickClose,q=this[this.tool].options.isClose;if(V){if(!q||!s(F,{x:v,y:z})||(this.setEnablePoints(),this.points.length<5))return}else if(this.setEnablePoints(),this.points.length<5)return this.points=[],void this.clearCanvas()}}else{var G=H(this.imageToViewerElementCoordinates(this.points[0].x,this.points[0].y),{x:v,y:z});if(Math.abs(G)<10)return this.points=[],void this.clearCanvas()}this.mitt.$emit(Tn,this.getPaintOptions()),this[this.tool].options.once?this.endDraw():this[this.tool].options.clear&&(this.points=[],this.clearCanvas())}},{key:"onCanvasDblClick",value:function(p){var v=p.x,z=p.y,T=this.viewerElementToImageCoordinates(v,z);return this.isInROI(T)&&this.points.length!==0?this.tool===w&&(this.setEnablePoints(),this.points.length<5)?(this.points=[],void this.clearCanvas()):(this.mitt.$emit(Tn,this.getPaintOptions()),void(this[this.tool].options.once?(this.mitt.$emit(Sn,this.getPaintOptions()),this.endDraw()):this[this.tool].options.clear&&(this.points=[],this.clearCanvas()))):(this.points=[],void this.clearCanvas())}},{key:"onCanvasMove",value:function(p){var v=p.target,z=p.x,T=p.y,L=v.getBoundingClientRect(),F=L.left,V=L.top,q=this.viewerElementToImageCoordinates(z-F,T-V);if(!this.isInROI(q))return this.points=[],void this.clearCanvas();var G=this.tool;if(G===w&&this.points.length>0){this.points.length>1&&this.points.pop(),this.points.push(q),this.clearCanvas(),this[G].startDraw();var ne=this.imageToViewerElementPoints(this.points);this[G].draw(ne),this[G].endDraw(),this[G].drawPoints(ne,{radius:this.options.thumb.radius,strokeStyle:this.options.thumb.color,fillStyle:this.options.thumb.bgColor}),this.mitt.$emit(jt,this.getPaintOptions())}}},{key:"onCanvasKey",value:function(p){var v=p.originalEvent;v.key==="Escape"&&this.isInDraw&&(this.mitt.$emit(Sn,this.getPaintOptions()),this.endDraw()),v.key!=="Delete"&&v.key!=="Backspace"||this.tool===w&&this.points.length>1&&(this.points.splice(this.points.length-2,1),this.change())}},{key:"setEnablePoints",value:function(){var p,v=this,z=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],T=this.imageToViewerElementPoints(this.points),L=T[0],F=((p=this.options.label)===null||p===void 0?void 0:p.polygonWidth)||30;if(this.points=this.points.filter(function(G,ne){var J=T[ne];if(ne===0||ne===v.points.length-1)return!0;if(s(L,J,F)){var Z=T[ne+1];return!!Z&&180*Math.abs(W(J,L,Z))/Math.PI<90&&(L=J,!0)}return L=J,!0}),z&&this.points.length>1){var V=this.points[this.points.length-1],q=this.points[this.points.length-2];s(this.imageToViewerElementCoordinates(V.x,V.y),this.imageToViewerElementCoordinates(q.x,q.y))&&this.points.splice(this.points.length-2,1)}}},{key:"getPaintOptions",value:function(){var p=new Wn(Tt(Tt({},this[this.tool].options),{},{points:this.points,scale:this.getImageZoom(!0),region:_(this.points),tool:this.tool,angle:this.viewport.getRotation()%360}));return p.measure&&this[this.tool].drawMeasureInfo.call(this,p,this.getMeasureContent(Tt(Tt({},p),{},{select:!0}))),p}},{key:"isInROI",value:function(p){return this.options.ROI?this[this.tool].options.isROI||this.isContainerLabel(p,this.ROIList):!(this.ROIList.length>0)||this[this.tool].options.isROI||this.isContainerLabel(p,this.ROIList)}},{key:"clearCanvas",value:function(){var p,v;this==null||(p=this[this.tool])===null||p===void 0||(v=p.clearCanvas)===null||v===void 0||v.call(p)}},{key:"endDraw",value:function(){this.clearCanvas(),this.points=[],this.tool=void 0,this.isInDraw=!1}},{key:"change",value:function(){if(this.isInDraw&&this.points.length!==0){var p=this.imageToViewerElementPoints(this.points);this.clearCanvas(),this[this.tool].startDraw(),this[this.tool].draw(p),this[this.tool].endDraw(),this[this.tool].drawPoints(p,{radius:this.options.thumb.radius,strokeStyle:this.options.thumb.color,fillStyle:this.options.thumb.bgColor}),this.mitt.$emit(jt,this.getPaintOptions())}}}],f&&yr(a.prototype,f),x}(D);l(150);function qn(d){return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},qn(d)}function br(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Zn(d,a){return Zn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},Zn(d,a)}function Tr(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Kt(d);if(a){var x=Kt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Sr(this,f)}}function Sr(d,a){return!a||qn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Kt(d){return Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Kt(d)}var Li=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&Zn(p,v)})(x,d);var a,f,h=Tr(x);function x(p){var v,z=p.viewer,T=p.canvas,L=p.cache,F=p.options;return function(V,q){if(!(V instanceof q))throw new TypeError("Cannot call a class as a function")}(this,x),(v=h.call(this,z,T,L,F)).microns=F.microns||[5e3,2e3,1500,1250,1e3,800,500,400,250,200,150,125,100,80,60,40,20,10,8,5,4,2,1],v}return a=x,(f=[{key:"change",value:function(){var p=this.microns,v=this.viewerElementToImageCoordinates(0,0),z=this.viewerElementToImageCoordinates(50,0).distanceTo(v)*this.options.imageCapRes,T=this.microns.findIndex(function(L){return L<=z});~T?this.setScaleLine(p[T],p[T]/this.options.imageCapRes):this.setScaleLine(p[p.length-1],p[p.length-1]/this.options.imageCapRes)}},{key:"setScaleLine",value:function(p,v){var z=this.imageToViewerElementCoordinates(0,0),T=this.imageToViewerElementCoordinates(v,0).distanceTo(z);this.options.custom?this.mitt.$emit(yi,{width:T,txt:p}):this.paintGraduation({width:T,txt:p})}},{key:"paintGraduation",value:function(p){var v=this,z=p.width,T=p.txt,L=this.canvas.getContext("2d"),F=this.canvas.width,V=this.canvas.height;if(L.beginPath(),L.clearRect(0,0,F,V),this.options.show){var q=this.options,G=q.left,ne=q.top,J=q.right,Z=q.bottom,te=10,ee=V-10;G?te=G:J&&(te=F-J-z),ne?ee=ne:Z&&(ee=V-Z),L.beginPath(),L.strokeStyle="#000000",L.lineWidth=3,L.fillStyle="#000000",L.font="bold 14px Arial";var X=this.options.tick||{height:8,number:5},ie=this.getUnitIndex(T*X.number,this.options.units,this.options.binary),fe=Q(T*X.number,this.options.units,this.options.binary,ie),xe=L.measureText(fe).width;L.fillText(fe,te+z*X.number-xe/2,ee+20),new Array(X.number).fill(1).forEach(function(_e,Le){L.moveTo(te+z*Le,ee-X.height),L.lineTo(te+z*Le,ee),L.lineTo(te+z*(Le+1),ee),L.lineTo(te+z*(Le+1),ee-X.height);var Be=Q(T*Le,v.options.units,v.options.binary,ie).replace(v.options.units[ie],""),ze=L.measureText(Be).width;L.fillText(Be,te+z*Le-ze/2,ee+20)}),L.stroke()}}},{key:"getUnitIndex",value:function(p,v,z){for(var T=p,L=0;T>=z;)T/=z,L++;return v[L]||(L=v.length-1),L}}])&&br(a.prototype,f),x}(D);function Kn(d){return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Kn(d)}function Er(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Xn(d,a){return Xn=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},Xn(d,a)}function Pr(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Xt(d);if(a){var x=Xt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Cr(this,f)}}function Cr(d,a){return!a||Kn(a)!=="object"&&typeof a!="function"?function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}(d):a}function Xt(d){return Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Xt(d)}var zi=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&Xn(p,v)})(x,d);var a,f,h=Pr(x);function x(p){var v,z=p.viewer,T=p.canvas,L=p.cache,F=p.options;return function(V,q){if(!(V instanceof q))throw new TypeError("Cannot call a class as a function")}(this,x),(v=h.call(this,z,T,L,F)).options.scale||(v.options.scale=20),v}return a=x,(f=[{key:"change",value:function(){var p=this.viewerElementToImageCoordinates(0,0),v=this.viewerElementToImageCoordinates(this.canvas.width,0),z=this.viewerElementToImageCoordinates(0,this.canvas.height),T=this.getImageZoom(!0)*this.options.scale,L=this.options.pxConversion?this.options.imageCapRes:1,F=Math.pow(this.options.binary,this.options.unitsIndex||0),V=this.options.scale===40?this.options.pxConversion?1600/this.options.imageCapRes:3200:this.options.pxConversion?800/this.options.imageCapRes:1600,q=0;if(T>=1){for(;T/2>=1;)q++,T/=2;q&&(V/=Math.pow(2,q))}else if(T<1){for(;2*T<=1;)q++,T*=2;q&&(V*=Math.pow(2,q))}var G=v.distanceTo(p),ne=z.distanceTo(p),J=Math.floor(p.x/V),Z=Math.floor((v.x+G)/V),te=Math.floor(p.y/V),ee=Math.floor((z.y+ne)/V),X=this.canvas.getContext("2d");if(X.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.show){X.beginPath(),X.lineWidth=1;for(var ie=J;ie<=Z+1;ie++){var fe=this.imageToViewerElementCoordinates(ie*V,0);X.moveTo(fe.x,0),X.lineTo(fe.x,this.canvas.height)}for(var xe=te;xe<=ee+1;xe++){var _e=this.imageToViewerElementCoordinates(0,xe*V);X.moveTo(0,_e.y),X.lineTo(this.canvas.width,_e.y)}X.stroke()}if(this.options.ruler){var Le=this.imageToViewerElementCoordinates(V,0).minus(this.imageToViewerElementCoordinates(0,0)).x;X.beginPath(),X.font="14px Arial",X.fillStyle="#fff",X.fillRect(0,0,20,this.canvas.height),X.fillRect(0,0,this.canvas.width,20),X.beginPath(),X.fillStyle="rgba(0, 0, 0, .3)",X.strokeStyle="rgba(0, 0, 0, .8)",X.moveTo(20,20),X.lineTo(20,this.canvas.height),X.moveTo(20,20),X.lineTo(this.canvas.width,20);for(var Be=J;Be<=Z+1;Be++){var ze=this.imageToViewerElementCoordinates(Be*V,0);X.moveTo(ze.x,0),X.lineTo(ze.x,20);for(var je=1;je<5;je++)X.moveTo(ze.x+Le/5*je,16),X.lineTo(ze.x+Le/5*je,20),Be!==J&&X.fillText((Be*V*L/F).toFixed(2)/1,ze.x+5,13)}for(var nt=te;nt<=ee+1;nt++){var ut=this.imageToViewerElementCoordinates(0,nt*V);X.moveTo(0,ut.y),X.lineTo(20,ut.y);for(var ct=1;ct<5;ct++)X.moveTo(16,ut.y+Le/5*ct),X.lineTo(20,ut.y+Le/5*ct),nt!==te&&(X.save(),X.translate(3,ut.y+5),X.rotate(Math.PI/2),X.fillText((nt*V*L/F).toFixed(0),0,0),X.restore())}X.stroke(),X.beginPath(),X.fillStyle="#fff",X.fillRect(0,0,20,20)}}}])&&Er(a.prototype,f),x}(D);function _r(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function Mi(d){return function(a){if(Array.isArray(a))return Yn(a)}(d)||function(a){if(typeof Symbol<"u"&&Symbol.iterator in Object(a))return Array.from(a)}(d)||function(a,f){if(a){if(typeof a=="string")return Yn(a,f);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Yn(a,f)}}(d)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Yn(d,a){(a==null||a>d.length)&&(a=d.length);for(var f=0,h=new Array(a);f<a;f++)h[f]=d[f];return h}CanvasRenderingContext2D.prototype.clearArc=function(d,a,f){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2*Math.PI;this.beginPath(),this.save(),this.arc(d,a,f,h,x),this.clip(),this.clearRect(d-f,a-f,2*f,2*f),this.restore(),this.closePath()},CanvasRenderingContext2D.prototype.drawArrow=function(d,a){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:10,x=180*Math.atan2(d.y-a.y,d.x-a.x)/Math.PI,p=(x+f)*Math.PI/180,v=(x-f)*Math.PI/180,z=h*Math.cos(p),T=h*Math.sin(p),L=h*Math.cos(v),F=h*Math.sin(v),V=d.x-z,q=a.y-T;this.moveTo(V,q),this.moveTo(d.x,d.y),this.lineTo(a.x,a.y),V=a.x+z,q=a.y+T,this.moveTo(V,q),this.lineTo(a.x,a.y),V=a.x+L,q=a.y+F,this.lineTo(V,q)},CanvasRenderingContext2D.prototype.drawOval=function(d,a,f,h){var x=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];this.save();var p=f>h?f:h,v=f/p,z=h/p;this.scale(v,z),this.moveTo((d+f)/v,a/z),this.arc(d/v,a/z,p,0,2*Math.PI,x),this.closePath(),this.restore()},CanvasRenderingContext2D.prototype.drawPolygon=function(d){for(var a=this,f=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],h=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],x=Mi(d),p=0,v=0;v<d.length-1;v++)p+=-.5*(d[v+1].y+d[v].y)*(d[v+1].x-d[v].x);p>0?h&&x.reverse():h||x.reverse(),this.moveTo(x[0].x,x[0].y),x.forEach(function(z){a.lineTo(z.x,z.y)}),f&&this.lineTo(x[0].x,x[0].y)};var Rr=function(){function d(h){(function(x,p){if(!(x instanceof p))throw new TypeError("Cannot call a class as a function")})(this,d),this.points=h}var a,f;return a=d,f=[{key:"calculationPoint",value:function(h){var x=this,p=this.points.length-1,v={x:0,y:0};return this.points.forEach(function(z,T){T?(v.x+=x.factorial(p)/x.factorial(T)/x.factorial(p-T)*z.x*Math.pow(1-h,p-T)*Math.pow(h,T),v.y+=x.factorial(p)/x.factorial(T)/x.factorial(p-T)*z.y*Math.pow(1-h,p-T)*Math.pow(h,T)):(v.x+=z.x*Math.pow(1-h,p-T)*Math.pow(h,T),v.y+=z.y*Math.pow(1-h,p-T)*Math.pow(h,T))}),v}},{key:"factorial",value:function(h){return h<=1?1:h*this.factorial(h-1)}}],f&&_r(a.prototype,f),d}();CanvasRenderingContext2D.prototype.bezierCurve=function(){if(arguments.length===1){var d=arguments.length<=0?void 0:arguments[0];if(!Array.isArray(d))throw new SyntaxError("parameter error");if(d.length===1||d.length===0)throw new SyntaxError("Parameter length greater than 1");if(d.length===2&&(this.moveTo(d[0].x,d[0].y),this.lineTo(d[1].x,d[1].y),this.stroke()),d.length===3){var a=d[0];this.moveTo(a.x,a.y),this.quadraticCurveTo(d[1].x,d[1].y,d[2].x,d[2].y),this.stroke()}else if(d.length===4){var f=d[0];this.moveTo(f.x,f.y),this.bezierCurveTo(d[1].x,d[1].y,d[2].x,d[2].y,d[3].x,d[3].y),this.stroke()}else for(var h=new Rr(d),x=Mi(new Array(101)).map(function(v,z){return h.calculationPoint(z/100)}),p=1;p<101;p++)this.moveTo(x[p-1].x,x[p-1].y),this.lineTo(x[p].x,x[p].y),this.stroke()}else if(arguments.length===4)this.quadraticCurveTo(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],arguments.length<=3?void 0:arguments[3]);else{if(arguments.length!==6)throw new SyntaxError("parameter error");this.bezierCurveTo(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],arguments.length<=3?void 0:arguments[3],arguments.length<=4?void 0:arguments[4],arguments.length<=5?void 0:arguments[5])}},CanvasRenderingContext2D.prototype.drawConfirm=function(){this.save(),this.miterLimit=4,this.scale(.046875,.046875),this.save(),this.beginPath(),this.moveTo(836.266667,311.466667),this.lineTo(806.4,281.59999999999997),this.bezierCurveTo(797.866667,273.06666699999994,785.0666669999999,273.06666699999994,776.533333,281.59999999999997),this.lineTo(435.2,622.933333),this.bezierCurveTo(430.933333,627.1999999999999,430.933333,627.1999999999999,426.66666699999996,622.933333),this.lineTo(264.53333399999997,460.79999999999995),this.bezierCurveTo(256.00000099999994,452.2666669999999,243.20000099999996,452.2666669999999,234.66666699999996,460.79999999999995),this.lineTo(204.79999999999995,490.66666699999996),this.bezierCurveTo(196.26666699999996,499.2,196.26666699999996,511.99999999999994,204.79999999999995,520.533334),this.lineTo(422.4,738.133334),this.bezierCurveTo(426.66666699999996,742.400001,435.2,742.400001,439.466667,738.133334),this.lineTo(836.266667,341.333333),this.bezierCurveTo(844.8,332.8,844.8,320,836.266667,311.466667),this.closePath(),this.fill(),this.stroke(),this.restore(),this.restore()},CanvasRenderingContext2D.prototype.drawCancel=function(){this.save(),this.miterLimit=4,this.scale(.046875,.046875),this.save(),this.beginPath(),this.moveTo(768,307.552),this.lineTo(716.448,256),this.lineTo(512,460.448),this.lineTo(307.552,256),this.lineTo(256,307.552),this.lineTo(460.448,512),this.lineTo(256,716.448),this.lineTo(307.552,768),this.lineTo(512,563.552),this.lineTo(716.448,768),this.lineTo(768,716.448),this.lineTo(563.552,512),this.lineTo(768,307.552),this.closePath(),this.fill(),this.stroke(),this.restore(),this.restore()};var Et=function(d){var a=Object.prototype.toString;return d instanceof Element?"element":{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[a.call(d)]},Bi=function d(a){var f=Et(a)==="array"?[]:{};for(var h in a)a.hasOwnProperty(h)&&(a[h]&&Et(a[h])==="object"||a[h]&&Et(a[h])==="array"?f[h]=d(a[h]):a[h]&&Et(a[h])==="date"?f[h]=new Date(a[h].valueOf()):f[h]=a[h]);return f},kr="shape",Or="area",Ir="board",Dr="graduation",Lr="rotation",zr="tailoring",Ni="navigator",Ai="cache",Mr="grid";function Jn(d){return Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Jn(d)}function Hi(d){return function(a){if(Array.isArray(a))return Qn(a)}(d)||function(a){if(typeof Symbol<"u"&&Symbol.iterator in Object(a))return Array.from(a)}(d)||function(a,f){if(a){if(typeof a=="string")return Qn(a,f);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Qn(a,f)}}(d)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Qn(d,a){(a==null||a>d.length)&&(a=d.length);for(var f=0,h=new Array(a);f<a;f++)h[f]=d[f];return h}function ji(d,a){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);a&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),f.push.apply(f,h)}return f}function st(d){for(var a=1;a<arguments.length;a++){var f=arguments[a]!=null?arguments[a]:{};a%2?ji(Object(f),!0).forEach(function(h){Br(d,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):ji(Object(f)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(f,h))})}return d}function Br(d,a,f){return a in d?Object.defineProperty(d,a,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[a]=f,d}function Nr(d,a){for(var f=0;f<a.length;f++){var h=a[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function ei(d,a){return ei=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},ei(d,a)}function Ar(d){var a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var f,h=Jt(d);if(a){var x=Jt(this).constructor;f=Reflect.construct(h,arguments,x)}else f=h.apply(this,arguments);return Hr(this,f)}}function Hr(d,a){return!a||Jn(a)!=="object"&&typeof a!="function"?Yt(d):a}function Yt(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function Jt(d){return Jt=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},Jt(d)}var Qt=function(d){(function(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),v&&ei(p,v)})(x,d);var a,f,h=Ar(x);function x(p){var v,z;if(function(G,ne){if(!(G instanceof ne))throw new TypeError("Cannot call a class as a function")}(this,x),v=h.call(this),!p.el)throw new Error("el must not be null");if(!p.openSeadragonOptions)throw new Error("no openSeadragon options");if(Et(p.el)==="string"&&(v.$el=(z=p.el,document.querySelector(z))),Et(p.el)==="element"&&(v.$el=p.el),!v.$el)throw new Error("el is not a valid selector string or element object");v.$el.style.position="relative";var T,L,F=v.$el.getBoundingClientRect(),V=F.height,q=F.width;return v.$options=st(st({},p),{},{width:q,height:V}),v.mitt={$on:v.$on,$emit:v.$emit,$off:v.$off,$once:v.$once,key:v.key,eventList:v.eventList},T=Yt(v),L=st(st(st({},{showNavigationControl:!1,navigatorSizeRatio:.25,wrapHorizontal:!1,minScrollDeltaTime:10,zoomPerClick:1,gestureSettingsMouse:{clickToZoom:!1}}),T.$options.openSeadragonOptions),{},{element:T.$el}),T.viewer=dt()(L),T.viewer.addHandler("tile-drawing",function(G){if(Et(T.$options.tileDrawing)==="function")T.$options.tileDrawing(G);else{var ne=G.context,J=G.rendered,Z=G.sourceWidth,te=G.sourceHeight,ee=G.position,X=G.size;ne.drawImage(J.canvas,0,0,Z,te,ee.x,ee.y,X.x,X.y)}}),function(G){var ne=G.$options;Object.values(k).forEach(function(J){var Z=J[0].toLocaleUpperCase()+J.substring(1);J===Ni?function(te){var ee=te.$options;if(ee.navigator=ee.navigator||{disabled:!1},ee.navigator.disabled!==!0){ee.navigator.style||(ee.navigator.style="bottom: 0;left: 0;");var X=document.createElement("div");X.setAttribute("class","openseadragon-navigator"),X.style.cssText+=ee.navigator.style,te.viewer.container.appendChild(X),te.navigator=new zn(st({viewer:te.viewer,containerHeight:ee.height,containerWidth:ee.width,element:X,scale:ee.scale,mitt:te.mitt},ee.navigator))}}(G):J===Ai?G.cache=new E[Z]:(ne[J]=ne[J]||{disabled:!1},ne[J].disabled!==!0&&(G[J]=new E[Z](function(te,ee){var X,ie,fe=te.$options,xe=fe.pxConversion||{imageCapRes:1,units:[]};return{kv:te,viewer:te.viewer,cache:te.cache,canvas:jr(te),options:st(st(st({mitt:te.mitt,scale:fe.scale,lang:fe.lang,labelDrawing:fe.labelDrawing,label:fe.label||{},measure:st({backgroundColor:"rgba(0,0,0,.5)",color:"#FFF",fontSize:14,scale:10,defaultShow:!1},fe.measure||{})},fe[ee]),xe),{},{units:(X=xe.units)!==null&&X!==void 0?X:[(ie=xe.unit)!==null&&ie!==void 0?ie:""],thumb:fe.thumb?st({radius:5,activeRadius:7,activeBgColor:"#01d0b0"},fe.thumb):{radius:5,activeRadius:7,activeBgColor:"#01d0b0"}})}}(G,J))))})}(Yt(v)),function(G){G.viewer.addHandler("animation",function(){var Z;G.change(),!((Z=G.tailoring)===null||Z===void 0)&&Z.isInTailoring&&G.tailoring.emitTailoringRegion()}),G.viewer.addHandler("canvas-press",function(Z){var te,ee,X,ie;!((te=G.board)===null||te===void 0)&&te.isInDraw?G.board.onCanvasPress(Z.position):!((ee=G.rotation)===null||ee===void 0)&&ee.isInRotation?G.rotation.onCanvasPress(Z.position):!((X=G.tailoring)===null||X===void 0)&&X.isInTailoring?G.tailoring.onCanvasPress(Z.position):!((ie=G.area)===null||ie===void 0)&&ie.onCanvasPress&&G.area.onCanvasPress(Z.position)}),G.viewer.addHandler("canvas-drag",function(Z){var te,ee,X,ie;if(!((te=G.board)===null||te===void 0)&&te.isInDraw)G.board.onCanvasDrag(Z);else if(!((ee=G.rotation)===null||ee===void 0)&&ee.rotatePoint)Z.preventDefaultAction=!0,G.rotation.onCanvasDrag(Z.position),G.change();else if(((X=G.tailoring)===null||X===void 0?void 0:X.movePointIndex)>-1)Z.preventDefaultAction=!0,G.tailoring.onCanvasDrag(Z.position);else if(!((ie=G.area)===null||ie===void 0)&&ie.movePoint){var fe,xe;G.area.onCanvasDrag(Z.position,Z),G.area.change(),G==null||(fe=G.shape)===null||fe===void 0||(xe=fe.change)===null||xe===void 0||xe.call(fe)}}),G.viewer.addHandler("canvas-release",function(Z){var te,ee,X,ie;!((te=G.board)===null||te===void 0)&&te.isInDraw?G.board.onCanvasRelease(Z.position):!((ee=G.rotation)===null||ee===void 0)&&ee.isInRotation?G.rotation.onCanvasRelease(Z.position):!((X=G.tailoring)===null||X===void 0)&&X.isInTailoring?G.tailoring.onCanvasRelease(Z.position):!((ie=G.area)===null||ie===void 0)&&ie.onCanvasRelease&&G.area.onCanvasRelease(Z.position)}),G.viewer.addHandler("canvas-key",function(Z){var te,ee,X,ie,fe,xe,_e=Z.originalEvent;if(Z.preventDefaultAction=G.$options.handleKey?G.$options.handleKey(_e.key):(ie=_e.key,["Escape","Delete","Backspace","z","y"].includes(ie)),function(at,Ne){if(at.key==="z"&&at.ctrlKey){if(Ne.cache.currentIndex===0)return;Ne.cache.currentIndex--,Ne.$emit(di,Ne.cache.currentIndex)}if(at.key==="y"&&at.ctrlKey){if(Ne.cache.currentIndex===Ne.cache.cacheList.length-1)return;Ne.cache.currentIndex++,Ne.$emit(fi,Ne.cache.currentIndex)}}(_e,G),(te=G.board)===null||te===void 0?void 0:te.isInDraw)(fe=G.board)===null||fe===void 0||(xe=fe.onCanvasKey)===null||xe===void 0||xe.call(fe,Z);else if(!((ee=G.rotation)===null||ee===void 0)&&ee.isInRotation){var Le,Be;(Le=G.rotation)===null||Le===void 0||(Be=Le.onCanvasKey)===null||Be===void 0||Be.call(Le,Z)}else if(!((X=G.tailoring)===null||X===void 0)&&X.isInTailoring){var ze,je;(ze=G.tailoring)===null||ze===void 0||(je=ze.onCanvasKey)===null||je===void 0||je.call(ze,Z)}else{var nt,ut,ct,yt;(function(at,Ne){var Ye=Ne.labelList.findIndex(function(tn){return tn.select}),gt=Ne.labelList[Ye];if(at.key==="h"){if(!gt)return;gt.show=!1,Ne.$emit(pi,gt)}else if(at.key==="Delete"||at.key==="Backspace"){var _t,ti,ni;if(!gt)return;if(((_t=Ne.area)===null||_t===void 0||(ti=_t.movePoint)===null||ti===void 0||(ni=ti.label)===null||ni===void 0?void 0:ni.tool)===w){var en=Ne.area.movePoint;en.label.points.splice(en.position,1),en.label.points.length===0?(Ne.$emit(_n,gt),Ne.labelList.splice(Ye,1)):Ne.$emit(vi,en.label),Ne.area.movePoint=void 0}else Ne.$emit(_n,gt),Ne.labelList.splice(Ye,1)}else at.key==="Escape"&&(gt&&Ne.$emit(Pn,gt),Ne.labelList.forEach(function(tn){tn.select=!1,tn.show=!0}))})(_e,G),(nt=G.area)===null||nt===void 0||(ut=nt.change)===null||ut===void 0||ut.call(nt,Z),(ct=G.shape)===null||ct===void 0||(yt=ct.change)===null||yt===void 0||yt.call(ct,Z)}}),G.viewer.addHandler("canvas-double-click",function(Z){var te,ee;if(!((te=G.board)===null||te===void 0)&&te.isInDraw)G.board.onCanvasDblClick(Z.position);else if(!((ee=G.tailoring)===null||ee===void 0)&&ee.isInTailoring){var X,ie;(X=G.tailoring)===null||X===void 0||(ie=X.onCanvasDblClick)===null||ie===void 0||ie.call(X,Z.position)}else{var fe,xe;(fe=G.area)===null||fe===void 0||(xe=fe.onCanvasDblClick)===null||xe===void 0||xe.call(fe,Z.position)}}),G.viewer.addHandler("resize",function(Z){var te=Z.newContainerSize,ee=te.x,X=te.y;G.resizeViewContainer({width:ee,height:X})}),G.$on("mousemove",function(Z){var te;!((te=G.board)===null||te===void 0)&&te.isInDraw&&G.board.onCanvasMove(Z)},!0,G.$el);var ne,J=!1;G.viewer.addHandler("canvas-contextmenu",function(Z){var te;!((te=G.board)===null||te===void 0)&&te.isInDraw&&(Z.preventDefault=!0)}),G.viewer.addHandler("canvas-nonprimary-press",function(Z){Z.button===2&&(J=!0),ne=Z.position.clone()}),G.viewer.addHandler("canvas-nonprimary-release",function(Z){Z.button===2&&(J=!1)}),new dt.a.MouseTracker({element:G.viewer.canvas,moveHandler:function(Z){var te,ee;if(J&&(!((te=G.board)===null||te===void 0)&&te.isInDraw)){if(Z.buttons!==2)return void(J=!1);var X=Z.position.minus(ne);ne=Z.position.clone(),G.viewer.viewport.panBy(G.viewer.viewport.deltaPointsFromPixels(X.negate()))}else!((ee=G.area)===null||ee===void 0)&&ee.onCanvasMove&&G.area.onCanvasMove(Z.position)}})}(Yt(v)),v.initLabelList(p.labelList||[]),v.resizeViewContainer(v.$options),v}return a=x,(f=[{key:"initLabelList",value:function(p){var v,z,T,L,F,V;this.labelList=p.map(function(q){var G;if(!(!((G=q.points)===null||G===void 0)&&G.length)){var ne=S(q.region),J=ne.startPoint,Z=ne.endPoint;q.points=[J,Z]}return new Wn(st(st({},q),{},{region:q.region||_(q.points),__data__:Bi(q)}))}),(v=this.board)===null||v===void 0||(z=v.setLabelList)===null||z===void 0||z.call(v,this.labelList),(T=this.shape)===null||T===void 0||(L=T.setLabelList)===null||L===void 0||L.call(T,this.labelList),(F=this.area)===null||F===void 0||(V=F.setLabelList)===null||V===void 0||V.call(F,this.labelList)}},{key:"appendLabelList",value:function(p){var v,z,T,L,F,V;this.labelList=[].concat(Hi(this.labelList),Hi(p.map(function(q){var G;if(!(!((G=q.points)===null||G===void 0)&&G.length)){var ne=S(q.region),J=ne.startPoint,Z=ne.endPoint;q.points=[J,Z]}return new Wn(st(st({},q),{},{region:q.region||_(q.points),__data__:Bi(q)}))}))),(v=this.board)===null||v===void 0||(z=v.setLabelList)===null||z===void 0||z.call(v,this.labelList),(T=this.shape)===null||T===void 0||(L=T.setLabelList)===null||L===void 0||L.call(T,this.labelList),(F=this.area)===null||F===void 0||(V=F.setLabelList)===null||V===void 0||V.call(F,this.labelList)}},{key:"resizeViewContainer",value:function(p){var v=this,z=p.width,T=p.height;this.$options.width=z,this.$options.height=T,Object.values(k).forEach(function(L){var F;!((F=v[L])===null||F===void 0)&&F.resetCanvasSize&&v[L].resetCanvasSize({width:z,height:T})})}},{key:"change",value:function(){var p=this;Object.values(k).forEach(function(v){var z;!((z=p[v])===null||z===void 0)&&z.change&&p[v].change()})}},{key:"destroy",value:function(){var p,v,z=this;this.$off(),(p=this.viewer)===null||p===void 0||(v=p.destroy)===null||v===void 0||v.call(p),this.viewer=void 0,this.$el=void 0,Object.values(k).forEach(function(T){var L,F;(L=z[T])===null||L===void 0||(F=L.destroy)===null||F===void 0||F.call(L),z[T]=void 0})}}])&&Nr(a.prototype,f),x}(wi);function jr(d){var a=d.$options,f=document.createElement("canvas");return f.style.cssText=`position: absolute; top: 0;
27
+ left: 0; width: 100%; height: 100%;`,f.width=a.width,f.height=a.height,d.viewer.canvas.appendChild(f),f}Qt.marks={},Pe.forEach(function(d){Qt.marks[d.toLocaleUpperCase()]=d}),Qt.events=st({},g)}]);Fe.getRectPoint;Fe.isPointInMatrix;Fe.pointInOtherPoint;const ts=Fe.isPointInEllipse;Fe.pointsToRegion;Fe.regionToPoint;Fe.isPointInPolygon;Fe.isPointInLine;Fe.isNegNumber;Fe.baseNumber;Fe.getPoint;const ns=Fe.getAngle;Fe.getDistance;Fe.calculatePolygonArea;Fe.getRandomId;Fe.getRectPoints;Fe.getRectPointV2;Fe.getUnitNumber;Fe.rgbToHsl;Fe.hslToRgb;Fe.toGamma;Fe.cacheGammaTable;Fe.Cache;Fe.Rotation;Fe.Navigator;Fe.Tailoring;Fe.Shape;Fe.Area;Fe.Board;Fe.Graduation;Fe.Grid;const wt=Fe.KfbView,Rt=Fe.OpenSeadragon;function is(I){const R=r.reactive({...oi,...I.process});r.watch(()=>I.process,E=>{y(E)});const l=r.computed(()=>{const E=[1+R.r+R.l+.5*R.c,0,0,0,-.25*R.c],k=[0,1+R.g+R.l+.5*R.c,0,0,-.25*R.c],P=[0,0,1+R.b+R.l+.5*R.c,0,-.25*R.c],b=[0,0,0,1,0];return`${E.join(" ")}
28
+ ${k.join(" ")}
29
+ ${P.join(" ")}
30
+ ${b.join(" ")}`}),g=r.computed(()=>String(1+R.s));function y(E){E&&Object.assign(R,E)}return{imageProcess:R,matrixValues:l,saturateValues:g,forceRedraw:y}}function os(I,R){function l(){R.value.$on(wt.events.EVENT_TAILORING_SCREENSHOT,g)}function g({base64:k,region:P}){if(window.ClipboardItem&&(navigator!=null&&navigator.clipboard)){const b=y(k,"image/png");navigator.clipboard.write([new window.ClipboardItem({[b.type]:b})])}I("tool","screen-shot",{base64:k,region:P})}function y(k,P){var u,n;const b=k.split(",");(n=(u=b[0])==null?void 0:u.match(/:(.*?);/))==null||n[1];const e=atob(b==null?void 0:b[1]);let t=e.length;const i=new Uint8Array(t);for(;t--;)i[t]=e.charCodeAt(t);return new Blob([i],{type:P})}function E(k){const{width:P,height:b}=R.value.$options;k?P>b?R.value.tailoring.init({left:(P-b)/2,top:0,height:b,width:b,now:!0}):R.value.tailoring.init({left:0,top:(b-P)/2,height:P,width:P,now:!0}):R.value.tailoring.init({left:P/2-100,top:b/2-100,height:200,width:200,color:"#ff0000"})}return{tailorEvent:l,shotScreen:E}}const Ui="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e@font-face%20{%20font-family:%20feedback-iconfont;%20src:%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944')%20format('woff2'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944')%20format('woff'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944')%20format('truetype');%20}%20%3c/style%3e%3c/defs%3e%3cpath%20fill='currentColor'%20d='M848%20432a80.064%2080.064%200%200%200-73.216%2048H217.216A80.096%2080.096%200%200%200%20144%20432%2080.096%2080.096%200%200%200%2064%20512c0%2044.128%2035.904%2080%2080%2080A80%2080%200%200%200%20217.216%20544h557.536a80%2080%200%200%200%2073.216%2048c44.128%200%2080-35.872%2080-80a80.032%2080.032%200%200%200-79.968-80z'%20%3e%3c/path%3e%3c/svg%3e",Wi="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e@font-face%20{%20font-family:%20feedback-iconfont;%20src:%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944')%20format('woff2'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944')%20format('woff'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944')%20format('truetype');%20}%20%3c/style%3e%3c/defs%3e%3cpath%20fill='currentColor'%20d='M462%20881V81c0-27.6%2022.4-50%2050-50s50%2022.4%2050%2050v800c0%2027.6-22.4%2050-50%2050s-50-22.4-50-50z'%3e%3c/path%3e%3cpath%20fill='currentColor'%20d='M483.3%20907.6l212.1-212.1c19.5-19.5%2051.2-19.5%2070.7%200s19.5%2051.2%200%2070.7L554%20978.4c-19.5%2019.5-51.2%2019.5-70.7%200-19.6-19.6-19.6-51.2%200-70.8z'%20%3e%3c/path%3e%3cpath%20fill='currentColor'%20d='M328.6%20695.5l212.1%20212.1c19.5%2019.5%2019.5%2051.2%200%2070.7s-51.2%2019.5-70.7%200L257.9%20766.2c-19.5-19.5-19.5-51.2%200-70.7s51.2-19.5%2070.7%200z'%20%3e%3c/path%3e%3c/svg%3e",Gi="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e@font-face%20{%20font-family:%20feedback-iconfont;%20src:%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944')%20format('woff2'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944')%20format('woff'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944')%20format('truetype');%20}%20%3c/style%3e%3c/defs%3e%3cpath%20fill='currentColor'%20d='M474.3%20480.7L113.9%20836.6c-20.2%2019-21.2%2050.7-2.3%2071%200.7%200.8%201.5%201.5%202.3%202.3%209.5%2010.4%2023%2016.1%2037.1%2015.7%2014.1%200.4%2027.6-5.3%2037.1-15.7l323.3-319.1%20323.3%20319.1c9.5%2010.4%2023.1%2016.1%2037.1%2015.7%2014.1%200.4%2027.6-5.3%2037.1-15.7%2020.2-19%2021.2-50.7%202.3-71-0.7-0.8-1.5-1.5-2.3-2.3L548.5%20480.7c-19.9-20.5-52.6-21-73.1-1.1-0.4%200.3-0.8%200.7-1.1%201.1z%20m0-366.3L113.9%20470.2c-20.2%2019-21.2%2050.7-2.3%2071%200.7%200.8%201.5%201.5%202.3%202.3%209.5%2010.4%2023%2016.1%2037.1%2015.7%2014.1%200.4%2027.6-5.3%2037.1-15.6l323.3-319.2%20323.3%20319.2c9.5%2010.4%2023.1%2016.1%2037.1%2015.6%2014%200.4%2027.6-5.3%2037.1-15.6%2020.2-19%2021.2-50.7%202.3-71-0.7-0.8-1.5-1.5-2.3-2.3L548.5%20114.4c-19.9-20.5-52.6-21-73.1-1.1l-1.1%201.1z'%3e%3c/path%3e%3c/svg%3e",$i="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='333.426'%20height='331.939'%20viewBox='0%200%20333.426%20331.939'%3e%3cg%20id='_10矩形'%20transform='translate(-63.7%20-66.2)'%3e%3cpath%20fill='currentColor'%20id='路径_2'%20d='M205.976,168.3H378.8v13.786H205.976Zm0,242.015H378.8V424.1H205.976ZM165.812,381.07V208.245H179.6V381.07Zm243.5,0V208.244H423.1V381.07Z'%20transform='translate(-64.168%20-64.161)'/%3e%3cpath%20fill='currentColor'%20id='路径_3'%20d='M108.662,66.2a44.962,44.962,0,1,0,44.962,44.962A44.975,44.975,0,0,0,108.662,66.2Zm-.037,75.618a30.73,30.73,0,1,1,30.73-30.73A30.718,30.718,0,0,1,108.625,141.818Zm.037,166.4a44.962,44.962,0,1,0,44.962,44.962,44.975,44.975,0,0,0-44.962-44.962Zm-.037,75.655a30.73,30.73,0,1,1,30.73-30.73A30.718,30.718,0,0,1,108.625,383.87Zm243.539-75.655a44.962,44.962,0,1,0,44.962,44.962A44.975,44.975,0,0,0,352.164,308.215Zm-.037,75.655a30.73,30.73,0,1,1,30.73-30.73A30.718,30.718,0,0,1,352.126,383.87Zm.037-317.67a44.962,44.962,0,1,0,44.962,44.962A44.975,44.975,0,0,0,352.164,66.2Zm-.037,75.618a30.73,30.73,0,1,1,30.73-30.73A30.718,30.718,0,0,1,352.126,141.818Z'/%3e%3c/g%3e%3c/svg%3e",qi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='333'%20height='332'%20viewBox='0%200%20333%20332'%3e%3cg%20id='椭圆_1'%20fill='none'%20stroke='currentColor'%20stroke-width='30'%3e%3cellipse%20cx='166.5'%20cy='166'%20rx='156.5'%20ry='156'%20stroke='none'/%3e%3cellipse%20cx='166.5'%20cy='166'%20rx='149'%20ry='148.5'%20fill='none'/%3e%3c/g%3e%3c/svg%3e",Zi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='322.663'%20height='322.663'%20viewBox='0%200%20322.663%20144.368'%3e%3cg%20id='组_1'%20transform='translate(-17.337%20-208.632)'%3e%3cpath%20id='路径_1'%20d='M21,254.606s69.664-74.994,139.621-8.395'%20fill='none'%20stroke='currentColor'%20stroke-width='20'/%3e%3cg%20id='椭圆_2'%20transform='translate(153%20233)'%20fill='%23fff'%20stroke='currentColor'%20stroke-width='20'%3e%3ccircle%20cx='22.5'%20cy='22.5'%20r='25.5'%20stroke='none'/%3e%3ccircle%20cx='22.5'%20cy='22.5'%20r='22.5'%20fill='none'/%3e%3c/g%3e%3cpath%20id='路径_2'%20d='M187.5,274.23s15.48,96.483,113.05,65.285'%20transform='translate(-4.814%20-5.239)'%20fill='none'%20stroke='currentColor'%20stroke-width='20'/%3e%3cg%20id='椭圆_3'%20transform='translate(295%20308)'%20fill='%23fff'%20stroke='currentColor'%20stroke-width='20'%3e%3ccircle%20cx='12.5'%20cy='12.5'%20r='22.5'%20stroke='none'/%3e%3ccircle%20cx='12.5'%20cy='12.5'%20r='22.5'%20fill='none'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ki="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e@font-face%20{%20font-family:%20feedback-iconfont;%20src:%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944')%20format('woff2'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944')%20format('woff'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944')%20format('truetype');%20}%20%3c/style%3e%3c/defs%3e%3cpath%20fill='currentColor'%20d='M575.852903%20115.426402L661.092435%20288.054362c10.130509%2020.465674%2029.675227%2034.689317%2052.289797%2037.963825l190.433097%2027.62866c56.996902%208.288598%2079.7138%2078.281203%2038.475467%20118.496253l-137.836314%20134.35715c-16.372539%2015.963226-23.84251%2038.987109-19.954032%2061.49935l32.540421%20189.716799c9.721195%2056.792245-49.833916%20100.077146-100.793444%2073.267113L545.870691%20841.446188a69.491196%2069.491196%200%200%200-64.67153%200l-170.376737%2089.537324c-50.959528%2026.810033-110.51464-16.474868-100.793444-73.267113L242.569401%20667.9996c3.888478-22.512241-3.581493-45.536125-19.954032-61.49935L84.779055%20472.245428c-41.238333-40.215049-18.521435-110.207655%2038.475467-118.496252l190.433097-27.62866c22.61457-3.274508%2042.159288-17.498151%2052.289797-37.963826L451.319277%20115.426402c25.479764-51.675827%2099.053862-51.675827%20124.533626%200z'%20%3e%3c/path%3e%3c/svg%3e",Xi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='320.756'%20height='350.074'%20viewBox='0%200%20320.756%20350.074'%3e%3cpath%20fill='currentColor'%20id='排除_1'%20d='M21.624,350.074a22.1,22.1,0,0,1-7.779-1.492A24.658,24.658,0,0,1,6.9,344.519,20.489,20.489,0,0,1,1.912,338.5,15.465,15.465,0,0,1,0,331.144V18.933a15.279,15.279,0,0,1,1.952-7.376A20.6,20.6,0,0,1,7.032,5.54,25.191,25.191,0,0,1,14.07,1.486,22.529,22.529,0,0,1,21.9,0a22.226,22.226,0,0,1,7.777,1.488,24.613,24.613,0,0,1,6.944,4.054,20.429,20.429,0,0,1,4.989,6.017,15.515,15.515,0,0,1,1.912,7.376v312.2a15.216,15.216,0,0,1-1.956,7.358,20.7,20.7,0,0,1-5.085,6.019,25.282,25.282,0,0,1-7.039,4.064A22.421,22.421,0,0,1,21.624,350.074ZM320.756,205.783H60.764L61.02,17.351l259.736,1.585v.728l-63.48,96.82,63.48,88.425v.873h0Z'%20transform='translate(0)'/%3e%3c/svg%3e",Yi="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e@font-face%20{%20font-family:%20feedback-iconfont;%20src:%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944')%20format('woff2'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944')%20format('woff'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944')%20format('truetype');%20}%20%3c/style%3e%3c/defs%3e%3cpath%20fill='currentColor'%20d='M512%20690a112%20112%200%201%200%200-350%20112%20112%200%200%200%200%20350z'%3e%3c/path%3e%3c/svg%3e",Ji="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e@font-face%20{%20font-family:%20feedback-iconfont;%20src:%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944')%20format('woff2'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944')%20format('woff'),%20url('//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944')%20format('truetype');%20}%20%3c/style%3e%3c/defs%3e%3cpath%20d='M563.2%20281.6V870.4a51.2%2051.2%200%200%201-102.4%200V281.6H179.2a51.2%2051.2%200%201%201%200-102.4h665.6a51.2%2051.2%200%200%201%200%20102.4H563.2z'%20fill='currentColor'%3e%3c/path%3e%3c/svg%3e",Qi="data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='200'%20height='200'%3e%3cpath%20d='M515.041727%20670.617766c91.584167%200%20166.095647-74.504255%20166.095647-166.095646V229.350568c0-91.584167-74.51148-166.095647-166.095647-166.095647-91.598617%200-166.102872%2074.51148-166.102871%20166.095647V504.52212c0%2091.591392%2074.504255%20166.095647%20166.102871%20166.095646z'%20fill='currentColor'%3e%3c/path%3e%3cpath%20d='M801.643237%20874.001665H558.391759v-45.423608c161.507768-21.313766%20286.60151-159.788217%20286.60151-327.01819a43.350032%2043.350032%200%200%200-86.700064%200c0%20134.124998-109.12648%20243.251478-243.258703%20243.251479-134.124998%200-243.244253-109.12648-243.244253-243.251479a43.350032%2043.350032%200%200%200-86.700063%200c0%20167.229972%20125.100967%20305.711649%20286.601509%20327.01819v45.423608H228.440217a43.350032%2043.350032%200%200%200%200%2086.700064h573.20302a43.350032%2043.350032%200%200%200%200-86.700064z'%20fill='currentColor'%3e%3c/path%3e%3c/svg%3e",rs=["onClick"],ss=["src"],as={key:2,style:{width:"18px"},class:"margin-r-3"},ls={key:1,class:"hzzt-kfb-sub-menu"},us=["onClick"],cs={class:"flex align-items-center"},hs=["src"],ds={key:2,style:{width:"18px"},class:"margin-r-2"},fs=r.defineComponent({__name:"KfbMenu",props:{menus:{}},emits:["tool"],setup(I,{emit:R}){const l=r.ref({top:"0",left:"0",display:"none"}),g=r.inject("kfbView",r.ref({})),y=r.inject("currentLabel"),E=I,k=R,{t:P}=xt(),b=[{label:P("直线"),value:"line",icon:Ui},{label:P("箭头"),value:"arrow",icon:Wi},{label:P("双箭头"),value:"bilateral",icon:Gi},{label:P("矩形"),value:"rectangle",icon:$i},{label:P("圆形"),value:"ellipse",icon:qi},{label:P("曲线"),value:"polygon",icon:Zi},{label:P("星星"),value:"star",icon:Ki},{label:P("旗帜"),value:"flag",icon:Xi},{label:P("点"),value:"dot",icon:Yi},{label:P("文字"),value:"font",icon:Ji},{label:P("语音"),value:"voice",icon:Qi}],e=r.computed(()=>{var o;return y!=null&&y.value?[{label:P("删除"),value:"delete",icon:Pt.value.delete}]:(o=E.menus)!=null&&o.length?E.menus.map(s=>s.value==="annotate"?{...s,children:b}:{...s,icon:s.icon||Pt.value[s.value]}):[{label:P("上一张"),value:"prev"},{label:P("下一张"),value:"next"},{label:P("标注"),value:"annotate",icon:Pt.value.annotate,children:b},{label:P("一键截图"),value:"tailor_now",icon:Pt.value.tailor},{label:P("区域截图"),value:"tailor"},{label:P("镜像翻转"),value:"flip",icon:Pt.value.flip},{label:P("切片信息"),value:"info",icon:Pt.value.info}]});r.watch(()=>g.value,(o,s)=>{s!=null&&s.viewer&&(s.viewer.removeHandler("canvas-contextmenu",t),s.viewer.removeHandler("canvas-click",i)),o!=null&&o.viewer&&(o.viewer.addHandler("canvas-contextmenu",t),o.viewer.addHandler("canvas-click",i))}),r.onMounted(()=>{var o;(o=g.value)!=null&&o.viewer&&(g.value.viewer.addHandler("canvas-contextmenu",t),g.value.viewer.addHandler("canvas-click",i)),document.body.addEventListener("click",i)}),r.onBeforeUnmount(()=>{var o;(o=g.value)!=null&&o.viewer&&(g.value.viewer.removeHandler("canvas-contextmenu",t),g.value.viewer.removeHandler("canvas-click",i)),document.body.removeEventListener("click",i)});function t(o){o.preventDefault=!0,l.value.top=`${o.position.y}px`,l.value.left=`${o.position.x}px`,l.value.display==="block"?l.value.display="none":l.value.display="block"}function i(){l.value.display="none"}function u(o,s){o.children||((s==null?void 0:s.value)==="annotate"?k("tool","annotate",{tool:o.value.substring(0,1).toLocaleUpperCase()+o.value.substring(1),once:!0}):o.value==="tailor_now"?k("tool","tailor",!0):k("tool",o.value),i())}function n(o){return o==null||typeof o!="object"&&typeof o!="function"?!1:typeof o=="function"||"render"in o||"setup"in o}return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"hzzt-kfb-menu",style:r.normalizeStyle(l.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.value,(c,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:"hzzt-kfb-menu-item"},[r.createElementVNode("div",{class:"flex align-items-center",onClick:_=>u(c)},[n(c.icon)?(r.openBlock(),r.createBlock(r.unref(Ee.ElIcon),{key:0,class:"margin-r-3",size:18},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.icon)))]),_:2},1024)):c.icon?(r.openBlock(),r.createElementBlock("img",{key:1,style:{width:"18px"},class:"margin-r-2",src:c.icon},null,8,ss)):(r.openBlock(),r.createElementBlock("div",as)),r.createElementVNode("span",null,r.toDisplayString(c.label),1)],8,rs),c.children?(r.openBlock(),r.createBlock(ht,{key:0,name:"arrowRight",class:"margin-r-2",size:14})):r.createCommentVNode("",!0),c.children?(r.openBlock(),r.createElementBlock("div",ls,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.children,(_,S)=>(r.openBlock(),r.createElementBlock("div",{key:S,class:"hzzt-kfb-menu-item",onClick:O=>u(_,c)},[r.createElementVNode("div",cs,[n(_.icon)?(r.openBlock(),r.createBlock(r.unref(Ee.ElIcon),{key:0,class:"margin-r-2",size:18},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(_.icon)))]),_:2},1024)):_.icon?(r.openBlock(),r.createElementBlock("img",{key:1,style:{width:"18px"},class:"margin-r-2",src:_.icon},null,8,hs)):(r.openBlock(),r.createElementBlock("div",ds)),r.createElementVNode("span",null,r.toDisplayString(_.label),1)])],8,us))),128))])):r.createCommentVNode("",!0)]))),128))],4))}}),St=(I,R)=>{const l=I.__vccOpts||I;for(const[g,y]of R)l[g]=y;return l},ps=St(fs,[["__scopeId","data-v-739aad62"]]),vs={key:0,class:"hzzt-kfb-microscope"},gs=r.defineComponent({__name:"KfbMicroscope",props:r.mergeDefaults({shape:{},width:{},color:{},borderWidth:{}},{...on}),setup(I,{expose:R}){const l=I,g=r.reactive({...on,...l});r.watch(()=>l,i=>{t({name:"change",value:i})});const y=r.ref("200px"),E=r.ref(!1),k=r.computed(()=>({borderRadius:g.shape,borderColor:g.color,borderWidth:g.borderWidth+"px",width:y.value,height:y.value})),P=r.inject("kfbView",r.ref({}));r.watch(()=>P.value,(i,u)=>{u!=null&&u.viewer&&u.viewer.removeHandler("zoom",b),i!=null&&i.viewer&&i.viewer.addHandler("zoom",b)}),r.onMounted(()=>{var i;(i=P.value)!=null&&i.viewer&&P.value.viewer.addHandler("zoom",b)}),r.onBeforeUnmount(()=>{var i;(i=P.value)!=null&&i.viewer&&P.value.viewer.removeHandler("zoom",b)});function b(){setTimeout(()=>{t({name:"change",value:g})},100)}function e(i){let{x:u,y:n}=P.value.viewer.viewport.getCenter(!0);i==="top"?n-=.006:i==="bottom"?n+=.006:i==="left"?u-=.006:i==="right"&&(u+=.006),P.value.area.moveToLabel({x:u,y:n})}function t({name:i,value:u}){var o,s;const n=(s=(o=P.value.$options)==null?void 0:o.pxConversion)==null?void 0:s.imageCapRes;if(i==="visible"){if(E.value=u,u){const c=P.value.area.imageToViewerElementRectangle({x:0,y:0,width:g.width*1e3/n,height:g.width*1e3/n});y.value=c.width+"px"}}else if(i==="change"){Object.assign(g,u);const c=P.value.area.imageToViewerElementRectangle({x:0,y:0,width:g.width*1e3/n,height:g.width*1e3/n});y.value=c.width+"px"}}return R({scopeChange:t}),(i,u)=>E.value?(r.openBlock(),r.createElementBlock("div",vs,[r.createElementVNode("div",{class:"hzzt-kfb-microscope__container",style:r.normalizeStyle(k.value)},null,4),r.createElementVNode("div",{class:"hzzt-kfb-microscope__top",onClick:u[0]||(u[0]=n=>e("top"))},[r.createVNode(ht,{size:"24",name:"arrowUp"})]),r.createElementVNode("div",{class:"hzzt-kfb-microscope__bottom",onClick:u[1]||(u[1]=n=>e("bottom"))},[r.createVNode(ht,{size:"24",name:"arrowDown"})]),r.createElementVNode("div",{class:"hzzt-kfb-microscope__left",onClick:u[2]||(u[2]=n=>e("left"))},[r.createVNode(ht,{size:"24",name:"arrowLeft"})]),r.createElementVNode("div",{class:"hzzt-kfb-microscope__right",onClick:u[3]||(u[3]=n=>e("right"))},[r.createVNode(ht,{size:"24",name:"arrowRight"})])])):r.createCommentVNode("",!0)}}),ms=St(gs,[["__scopeId","data-v-e8b36101"]]),ys={class:"hzzt-kfb-label flex column"},ws={class:"hzzt-kfb-label__img flex justify-content-center"},xs=["src"],bs={class:"ellipsis flex-1"},Ts={class:"flex margin-b-4",style:{width:"100%"}},Ss={class:"flex margin overflow-hidden",style:{height:"132px"}},Es=["src"],Ps=["src"],Cs=r.defineComponent({__name:"KfbLabel",props:{info:{},slide:{},pathologyHandle:{type:Function}},emits:["tool"],setup(I,{emit:R}){const{t:l}=xt(),g=I,y=R,E=r.ref(!0),k=r.ref(!1),P=r.computed(()=>g.slide.pathology_id?l("修改病理号"):l("绑定病理号"));function b(){g.slide.angle||(g.slide.angle=0),g.slide.angle+=90,g.slide.angle>360&&(g.slide.angle=g.slide.angle%360),y("tool","rotate",g.slide.angle)}function e(){k.value=!0}function t(){g.pathologyHandle&&g.pathologyHandle(g.slide).then(()=>{k.value=!1})}return(i,u)=>(r.openBlock(),r.createElementBlock("div",ys,[r.withDirectives(r.createElementVNode("div",{class:"hzzt-kfb-label__title"},r.toDisplayString(r.unref(l)(`点击标签旋转${i.pathologyHandle?",点击病理号重绑":""}`)),513),[[r.vShow,E.value]]),r.withDirectives(r.createElementVNode("div",ws,[r.createElementVNode("img",{src:i.info.labelImg,style:r.normalizeStyle({transform:`rotate(${i.slide.angle}deg)`}),onClick:b},null,12,xs)],512),[[r.vShow,E.value]]),i.pathologyHandle?r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:0,class:"hzzt-kfb-label__pathology flex align-items-center justify-content-between",onClick:e},[r.createElementVNode("span",bs,r.toDisplayString(i.slide.pathology_number),1),r.createVNode(ht,{size:"14",name:"annotate"})],512)),[[r.vShow,E.value]]):r.createCommentVNode("",!0),r.createElementVNode("span",{onClick:u[0]||(u[0]=n=>E.value=!E.value),style:r.normalizeStyle({transform:`translateY(${E.value?"-50%":0})`}),class:"hzzt-kfb-label__expend flex align-items-center justify-content-center"},[E.value?(r.openBlock(),r.createBlock(ht,{key:0,size:"10",name:"arrowLeft"})):(r.openBlock(),r.createBlock(ht,{key:1,size:"10",name:"arrowRight"}))],4),r.createVNode(r.unref(Ee.ElDialog),{modelValue:k.value,"onUpdate:modelValue":u[5]||(u[5]=n=>k.value=n),"append-to-body":!0,title:P.value,width:"450px"},{footer:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElButton),{onClick:u[4]||(u[4]=n=>k.value=!1)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(l)("取消")),1)]),_:1}),r.createVNode(r.unref(Ee.ElButton),{type:"primary",onClick:t},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(l)("确认")),1)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",Ts,[r.createElementVNode("div",Ss,[r.createElementVNode("img",{src:i.slide.labelImg},null,8,Es),r.createElementVNode("img",{src:i.slide.previewImg},null,8,Ps)])]),r.createVNode(r.unref(Ee.ElForm),{class:"margin-t-2"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElFormItem),{label:r.unref(l)("病理号")},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElInput),{modelValue:i.slide.pathology_number,"onUpdate:modelValue":u[1]||(u[1]=n=>i.slide.pathology_number=n),placeholder:r.unref(l)("输入病理号"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),r.createVNode(r.unref(Ee.ElFormItem),{label:r.unref(l)("蜡块号")},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElInput),{modelValue:i.slide.paraffin_block_number,"onUpdate:modelValue":u[2]||(u[2]=n=>i.slide.paraffin_block_number=n),placeholder:r.unref(l)("输入蜡块号"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),i.slide.slide_id?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(Ee.ElFormItem),{key:0,label:r.unref(l)("试剂")},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElInput),{modelValue:i.slide.reagent,"onUpdate:modelValue":u[3]||(u[3]=n=>i.slide.reagent=n),placeholder:r.unref(l)("输入试剂"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]))]),_:1})]),_:1},8,["modelValue","title"])]))}}),_s=St(Cs,[["__scopeId","data-v-7397de48"]]);function Rs(I,R){const l=r.ref(1),g=r.ref(null),y=r.ref(null);function E(){I.value.viewer.addHandler("canvas-drag",P=>{g.value||(g.value=P.position)}),I.value.viewer.addHandler("canvas-drag-end",P=>{if(l.value!==1){y.value=P.position;const b=I.value.viewer.viewport.containerSize.x,e=I.value.viewer.viewport.containerSize.y,t=(y.value.x-g.value.x)/(b*R.value)*(l.value-1),i=(y.value.y-g.value.y)/(e*R.value)*(l.value-1),u=I.value.viewer.viewport.getCenter(),n=new Rt.Point(u.x-t,u.y-i);I.value.viewer.viewport.panTo(n),g.value=null}})}function k({name:P,value:b}){P==="ratio"&&(l.value=b/1)}return{moveEvent:E,fastMove:k}}function ks(I,R){const l=r.ref(!1),g=r.ref(void 0),y=r.ref(void 0),E=r.ref([]);r.watch(()=>I.aiLabelList,e);function k(){R.value.$on(wt.events.EVENT_END_PAINTING,P("add")),R.value.$on(wt.events.EVENT_AREA_MOVE_END,P("move")),R.value.$on(wt.events.EVENT_ADD_POLYGON_POINT,P("add-point")),R.value.$on(wt.events.EVENT_DELETE_POLYGON_POINT,P("delete-point")),R.value.$on(wt.events.EVENT_DELETE_LABEL,P("delete")),R.value.$on(wt.events.EVENT_SELECT_LABEL,u=>{var o,s,c,m;g.value=u,(((o=g.value)==null?void 0:o.subType)==="voice"||((c=(s=g.value)==null?void 0:s.__data__)==null?void 0:c.subType))==="voice"&&((m=g.value)!=null&&m.src)&&new Audio(g.value.src).play()}),R.value.$on(wt.events.EVENT_CANCEL_SELECT_LABEL,()=>{g.value=void 0}),P("list")()}function P(u){return n=>b(u,n)}function b(u,n){var o;if(u==="add"&&((n==null?void 0:n.subType)||((o=n==null?void 0:n.__data__)==null?void 0:o.subType))==="voice")y.value=n,l.value=!0;else return I.labelHandle(u,I.slide,n).then(s=>{E.value=s,e()}).catch(()=>{e()})}function e(){var u;if((u=R.value)!=null&&u.initLabelList){const n=[...E.value,...I.aiLabelList||[]];n.find(({id:o})=>{var s;return o===((s=g.value)==null?void 0:s.id)})||(g.value=void 0),R.value.initLabelList(n)}}function t(u){var o;g.value&&(g.value.select=!1);const n=(R.value.labelList||[]).findIndex(s=>s.id===u.id);if(n>-1){g.value=(o=R.value.labelList)==null?void 0:o[n],g.value.select=!0;const s=R.value.area.getCenterPoint(u.region);R.value.area.moveToLabel(s)}}function i(u){return l.value=!1,I.labelHandle("add",I.slide,u).then(n=>{E.value=n,e()}).catch(()=>{e()})}return{currentLabel:g,voiceVisible:l,labelForm:y,initLabel:k,selectLabel:t,reloadLabelList:e,eventHandel:P,addHandle:i}}function Os(){function I(R,l){R.save(),R.strokeStyle="rgba(0,0,0,0)",R.miterLimit=4,R.font="15px",R.fillStyle=l,R.font="15px",R.scale(.02734375,.02734375),R.save(),R.font="15px",R.beginPath(),R.moveTo(512,427.023),R.moveTo(422,427.023),R.translate(512,427.023),R.rotate(0),R.arc(0,0,90,3.141592653589793,6.283185307179586,!0),R.rotate(0),R.translate(-512,-427.023),R.translate(512,427.023),R.rotate(0),R.arc(0,0,90,0,3.141592653589793,!0),R.rotate(0),R.translate(-512,-427.023),R.fill(),R.stroke(),R.restore(),R.save(),R.font="15px",R.beginPath(),R.moveTo(512,910.402),R.bezierCurveTo(492.86,910.402,474.51800000000003,904.548,458.95799999999997,893.4730000000001),R.bezierCurveTo(444.895,883.4630000000001,434.032,869.8770000000001,427.36899999999997,854.013),R.lineTo(255.043,585.177),R.lineTo(254.889,584.927),R.bezierCurveTo(225.522,537.209,210,482.605,210,427.021),R.bezierCurveTo(210,346.35400000000004,241.414,270.515,298.454,213.47500000000002),R.bezierCurveTo(355.494,156.43500000000006,431.333,125.021,512,125.021),R.bezierCurveTo(592.6669999999999,125.021,668.506,156.435,725.546,213.475),R.bezierCurveTo(782.587,270.515,814,346.354,814,427.021),R.bezierCurveTo(814,482.87,798.345,537.692,768.726,585.56),R.lineTo(768.462,585.9789999999999),R.lineTo(596.381,854.6949999999999),R.bezierCurveTo(589.626,870.4209999999999,578.721,883.871,564.677,893.7499999999999),R.bezierCurveTo(549.192,904.6449999999999,530.977,910.4019999999999,512,910.4019999999999),R.closePath(),R.moveTo(309.246,551.141),R.lineTo(484.74,824.9209999999999),R.lineTo(485.934,828.1179999999999),R.bezierCurveTo(490.083,839.2249999999999,500.31500000000005,846.4019999999999,512,846.4019999999999),R.bezierCurveTo(523.584,846.4019999999999,533.791,839.3309999999999,538.004,828.387),R.lineTo(539.169,825.3589999999999),R.lineTo(714.43,551.678),R.bezierCurveTo(737.701,513.983,750,470.884,750,427.021),R.bezierCurveTo(750,363.449,725.244,303.682,680.2909999999999,258.72900000000004),R.bezierCurveTo(635.3389999999999,213.77800000000005,575.5719999999999,189.02100000000004,511.99999999999994,189.02100000000004),R.bezierCurveTo(448.428,189.02100000000004,388.66099999999994,213.77700000000004,343.70799999999997,258.72900000000004),R.bezierCurveTo(298.755,303.68100000000004,274,363.449,274,427.021),R.bezierCurveTo(274,470.661,286.186,513.573,309.246,551.1410000000001),R.closePath(),R.fill(),R.stroke(),R.restore(),R.restore()}return{drawDot:I}}function Is(I,R){const l=r.ref();let g=null;const y=r.ref(!1);function E(b,e){b.save(),b.strokeStyle="rgba(0,0,0,0)",b.miterLimit=4,b.font="15px ''",b.fillStyle=e,b.font=" 15px ''",b.scale(.03125,.03125),b.save(),b.font=" 15px ''",b.beginPath(),b.moveTo(515.041727,670.617766),b.bezierCurveTo(606.625894,670.617766,681.137374,596.113511,681.137374,504.52212),b.lineTo(681.137374,229.350568),b.bezierCurveTo(681.137374,137.76640100000003,606.625894,63.254920999999996,515.041727,63.254920999999996),b.bezierCurveTo(423.44311000000005,63.254920999999996,348.93885500000005,137.766401,348.93885600000004,229.350568),b.lineTo(348.93885600000004,504.52212),b.bezierCurveTo(348.93885600000004,596.113512,423.44311100000004,670.617767,515.041727,670.617766),b.closePath(),b.fill(),b.stroke(),b.restore(),b.save(),b.font=" 15px ''",b.beginPath(),b.moveTo(801.643237,874.001665),b.lineTo(558.391759,874.001665),b.lineTo(558.391759,828.578057),b.bezierCurveTo(719.899527,807.264291,844.993269,668.7898399999999,844.993269,501.55986699999994),b.translate(801.643237,501.55986699999994),b.rotate(0),b.arc(0,0,43.350032,0,3.141592653589793,!0),b.rotate(0),b.translate(-801.643237,-501.55986699999994),b.bezierCurveTo(758.2932050000001,635.684865,649.166725,744.811345,515.0345020000001,744.811346),b.bezierCurveTo(380.9095040000001,744.811346,271.79024900000013,635.6848659999999,271.79024900000013,501.55986699999994),b.translate(228.44021750000013,501.5664510740879),b.rotate(0),b.arc(0,0,43.350032,-.00015188164315591997,-3.1414407719461273,!0),b.rotate(0),b.translate(-228.44021750000013,-501.5664510740879),b.bezierCurveTo(185.09018600000013,668.7898389999999,310.1911530000001,807.271516,471.69169500000015,828.578057),b.lineTo(471.69169500000015,874.001665),b.lineTo(228.440217,874.001665),b.translate(228.440217,917.3516970000001),b.rotate(0),b.arc(0,0,43.350032,-1.5707963267948966,1.5707963267948966,!0),b.rotate(0),b.translate(-228.440217,-917.3516970000001),b.lineTo(801.643237,960.701729),b.translate(801.643237,917.3516970000001),b.rotate(0),b.arc(0,0,43.350032,1.5707963267948966,4.71238898038469,!0),b.rotate(0),b.translate(-801.643237,-917.3516970000001),b.closePath(),b.fill(),b.stroke(),b.restore(),b.restore()}async function k(){try{l.value=await navigator.mediaDevices.getUserMedia({audio:!0}),g=new MediaRecorder(l.value);const b=[];g.addEventListener("dataavailable",e=>{b.push(e.data)}),g.addEventListener("stop",()=>{const e=new Blob(b,{type:"audio/wav"});R.value&&(R.value.src=URL.createObjectURL(e)),I.uploadHandle&&R.value&&I.uploadHandle(I.slide,R.value,e).then(t=>{R.value.src=t}),y.value=!1}),g.start(),y.value=!0}catch(b){console.error("录音错误:",b)}}function P(){l.value&&g?(g.stop(),l.value.getTracks().forEach(b=>b.stop()),g=null,l.value=void 0):(g=null,l.value=void 0),y.value=!1}return{drawVoice:E,isRecording:y,startRecording:k,stopRecording:P}}function Ds(I,R){const l=r.ref([]),g=r.ref(0),y=r.ref(!1);let E=null;r.watch(()=>{var u;return(u=I.hotmap)==null?void 0:u.enable},()=>{var u,n;if((n=(u=R.value)==null?void 0:u.viewer)!=null&&n.world){g.value=0;const o=R.value.viewer.world.getItemAt(0);o&&(o.tilesMatrix={},o.draw())}}),r.onMounted(()=>{window.addEventListener("mousemove",b),window.addEventListener("mouseup",t)}),r.onBeforeUnmount(()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",t)});function k(u,n,o){var c,m,_,S,O,N;const s={...n,file:(c=I.hotmap)==null?void 0:c.file};if((m=I.hotmap)!=null&&m.info){if(o[n.x+"_"+n.y+"_"+Number(n.scale)]){if(((_=I.hotmap)==null?void 0:_.type)==="switch")return I.tileHandle(s);if(((S=I.hotmap)==null?void 0:S.type)==="drag")return P(u,s),u}}else return((O=I.hotmap)==null?void 0:O.type)==="switch"?I.tileHandle(s):(((N=I.hotmap)==null?void 0:N.type)==="drag"&&P(u,s),u)}function P(u,n){const o=l.value.find(s=>s.url===u)||{url:u,x:n.x,y:n.y,img:void 0,load:""};if(!(o!=null&&o.img)&&(l.value.push(o),o.load!=="success")){const s=new Image;s.src=I.tileHandle(n),s.onload=()=>{o.load="success"},o.img=s}}function b(u){y.value&&E&&(g.value+=u.x-E.x,g.value<0?g.value=0:g.value>R.value.$options.width&&(g.value=R.value.$options.width,y.value=!1),R.value.viewer.forceRedraw()),E={x:u.x,y:u.y}}function e(u){const{x:n,y:o}=u;y.value=!0,E={x:n,y:o}}function t(){y.value=!1,E=null}function i(u){const{context:n,sourceWidth:o,sourceHeight:s,position:c,size:m,initRendered:_,tile:S,pixelDensityRatio:O}=u,N=S.getUrl(),B=g.value*O,U=c.original.x;if(U<B&&U+m.x>B){const W=B-U,H=m.x-W,$=l.value.find(Q=>Q.url===N),K=($==null?void 0:$.load)==="success"?$.img:_.canvas;n.drawImage(K,0,0,o*W/m.x,s,c.x,c.y,W,m.y),n.drawImage(_.canvas,o*W/m.x,0,o*H/m.x,s,c.x+W,c.y,H,m.y)}else if(U+m.x<=B){const W=l.value.find($=>$.url===N),H=(W==null?void 0:W.load)==="success"?W.img:_.canvas;n.drawImage(H,0,0,o,s,c.x,c.y,m.x,m.y)}else U>=B&&n.drawImage(_.canvas,0,0,o,s,c.x,c.y,m.x,m.y)}return{getHotmapUrl:k,hotmapImgs:l,handlerImage:i,hotmapLine:g,lineMouseDown:e}}function Ls(I,R,l){const g=r.getCurrentInstance(),y=r.ref(!1),E=new BroadcastChannel("sync_kfb_view");E.onmessage=i=>{const u=i.data;e(u)},r.onMounted(()=>{var i,u,n;(i=l.value)==null||i.addEventListener("mouseenter",k),(u=l.value)==null||u.addEventListener("mousemove",k),(n=l.value)==null||n.addEventListener("mouseleave",P)}),r.onBeforeUnmount(()=>{var i,u,n;(i=l.value)==null||i.removeEventListener("mouseenter",k),(u=l.value)==null||u.removeEventListener("mousemove",k),(n=l.value)==null||n.removeEventListener("mouseleave",P),E.close()});function k(){y.value=!0}function P(){y.value=!1}function b(){let i;R.value.viewer.addHandler("pan",u=>{var s,c,m,_;if(!i){i=(c=(s=u.center)==null?void 0:s.clone)==null?void 0:c.call(s);return}const n=u.center,o=(m=n==null?void 0:n.minus)==null?void 0:m.call(n,i);i=(_=n==null?void 0:n.clone)==null?void 0:_.call(n),I.syncPosition&&t({position:o,type:"sync_position"})}),R.value.viewer.addHandler("zoom",u=>{I.syncZoom&&t({zoom:u.zoom,type:"sync_zoom"})}),R.value.viewer.addHandler("animation-finish",()=>{var o;if(I.syncZoom&&t({zoom:R.value.viewer.viewport.getZoom(!0),type:"sync_zoom"}),!i)return;const u=R.value.viewer.viewport.getCenter(!0),n=(o=u==null?void 0:u.minus)==null?void 0:o.call(u,i);i=void 0,I.syncPosition&&t({position:n,type:"sync_position"})})}function e(i){i.uuid&&i.type==="sync_position"&&i.uuid!==(g==null?void 0:g.uid)?R.value&&R.value.viewer.viewport.panBy(i.position,!0):i.uuid&&i.type==="sync_zoom"&&i.uuid!==(g==null?void 0:g.uid)&&R.value&&R.value.viewer.viewport.zoomTo(i.zoom)}function t(i){var u;y.value&&E.postMessage({...i,uuid:g==null?void 0:g.uid,fileName:(u=I.slide)==null?void 0:u.file})}return{initSync:b}}const zs={class:"hzzt-kfb-keyword flex wrap"},Ms=["onMouseenter"],Bs=r.defineComponent({__name:"KfbKeyword",setup(I){const R=r.ref([{code:"Q",icon:"zoomIn"},{code:"W",icon:"arrowUp"},{code:"E",icon:"zoomOut"},{code:"A",icon:"arrowLeft"},{code:"S",icon:"arrowDown"},{code:"D",icon:"arrowRight"}]),l=r.inject("kfbView",r.ref({}));let g=null;function y(k,P){k.preventDefault(),g&&clearTimeout(g),g=setInterval(()=>{P==="E"&&(l.value.viewer.viewport.zoomBy(1.1),l.value.viewer.viewport.applyConstraints()),P==="Q"&&(l.value.viewer.viewport.zoomBy(.9),l.value.viewer.viewport.applyConstraints()),P==="W"&&(l.value.viewer.viewport.panBy(l.value.viewer.viewport.deltaPointsFromPixels(new Rt.Point(0,-40))),l.value.viewer.viewport.applyConstraints()),P==="S"&&(l.value.viewer.viewport.panBy(l.value.viewer.viewport.deltaPointsFromPixels(new Rt.Point(0,40))),l.value.viewer.viewport.applyConstraints()),P==="A"&&(l.value.viewer.viewport.panBy(l.value.viewer.viewport.deltaPointsFromPixels(new Rt.Point(-40,0))),l.value.viewer.viewport.applyConstraints()),P==="D"&&(l.value.viewer.viewport.panBy(l.value.viewer.viewport.deltaPointsFromPixels(new Rt.Point(40,0))),l.value.viewer.viewport.applyConstraints())},120)}function E(){g&&(clearInterval(g),g=null)}return r.onBeforeUnmount(()=>{clearTimeout(g)}),(k,P)=>(r.openBlock(),r.createElementBlock("div",zs,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(R.value,b=>(r.openBlock(),r.createElementBlock("div",{key:b.code,class:"hzzt-kfb-keyword__code flex column align-items-center justify-content-center",onMouseenter:e=>y(e,b.code),onMouseleave:E},[r.createElementVNode("p",null,r.toDisplayString(b.code),1),r.createVNode(ht,{size:"14",name:b.icon},null,8,["name"])],40,Ms))),128))]))}}),Ns=St(Bs,[["__scopeId","data-v-c8d940f0"]]);function As(I,R,l={}){const{panSensitivity:g=.2,zoomSensitivity:y=1.1,damping:E=.6,minThreshold:k=.05}=l;let P=!1,b=null,e=0,t=0,i=!1;const u=()=>{P=document.pointerLockElement===R.value,P||n()},n=()=>{e=0,t=0,b&&(cancelAnimationFrame(b),b=null),i=!1},o=async S=>{try{S.key==="l"&&R.value&&(document.pointerLockElement?(document.exitPointerLock(),console.log("鼠标已解锁!")):(await R.value.requestPointerLock(),console.log("鼠标已锁定!")))}catch(O){console.error("无法锁定鼠标:",O)}},s=S=>{if(P){S.preventDefault();const O=Math.pow(y,Math.sign(S.deltaY)*-1);I.value.viewer.viewport.zoomBy(O),I.value.viewer.viewport.applyConstraints()}},c=S=>{P&&(e+=S.movementX*g,t+=S.movementY*g,!i&&(Math.abs(e)>1||Math.abs(t)>1)&&(i=!0,b=requestAnimationFrame(m)))},m=()=>{const S=I.value.viewer.viewport;if(Math.abs(e)>k||Math.abs(t)>k){const O=S.deltaPointsFromPixels(new Rt.Point(e,t));S.panBy(O),S.applyConstraints()}e*=E,t*=E,Math.abs(e)>k||Math.abs(t)>k?b=requestAnimationFrame(m):n()},_=()=>{P&&document.exitPointerLock()};return r.onMounted(()=>{var S;(S=R.value)==null||S.addEventListener("keydown",o),document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("click",_),document.addEventListener("mousemove",c),document.addEventListener("pointerlockchange",u)}),r.onBeforeUnmount(()=>{var S;(S=R.value)==null||S.removeEventListener("keydown",o),document.removeEventListener("click",_),document.removeEventListener("wheel",s),document.removeEventListener("mousemove",c),document.removeEventListener("pointerlockchange",u),n()}),{setConfig:S=>{Object.assign(l,S)}}}const Hs=r.defineComponent({__name:"KfbLevel",props:r.mergeModels({slides:{default:()=>[]}},{"model-value":{default:0},"model-valueModifiers":{}}),emits:["update:model-value"],setup(I){const R=I,l=r.useModel(I,"model-value"),g=r.inject("kfbView",r.ref({})),y=r.computed(()=>Array.from(new Array(R.slides.length+1)).map((k,P)=>P));function E(){const k=g.value.viewer.world.getItemAt(0),P=Object.keys(k.tilesMatrix);P.forEach((b,e)=>{e>P.length-4&&(k.tilesMatrix[b]={})}),k.draw()}return(k,P)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["hzzt-kfb-level flex column align-items-center",k.slides.length>5?"hzzt-kfb-level--large":""])},[r.createVNode(ht,{name:"level",size:"24",class:"margin-b-4 margin-t-2"}),r.createVNode(r.unref(Ee.ElSlider),{modelValue:l.value,"onUpdate:modelValue":P[0]||(P[0]=b=>l.value=b),vertical:"",min:y.value[0],step:1,max:y.value[y.value.length-1],"show-stops":"","show-tooltip":!0,placement:"left",height:k.slides.length>5?"180px":"130px",onInput:E},null,8,["modelValue","min","max","height"])],2))}}),js={key:0,class:"flex hzzt-kfb-channel"},Vs=["onClick"],Fs=r.defineComponent({__name:"KfbChannel",props:r.mergeModels({info:{}},{"model-value":{default:()=>[]},"model-valueModifiers":{}}),emits:r.mergeModels(["load"],["update:model-value"]),setup(I,{emit:R}){const l=I,g=R,y=r.useModel(I,"model-value"),E=[{key:"DAPI",color:"#4A6CF7"},{key:"480",color:"#00BFFF"},{key:"520",color:"#32CD32"},{key:"570",color:"#FFAA33"},{key:"620",color:"#FF6347"},{key:"670",color:"#DC143C"},{key:"780",color:"#4B0082"}],k=r.computed(()=>{var b;return(((b=l.info)==null?void 0:b.channel)||[]).map(e=>{const t=E.find(i=>i.key===e.eqt_num);return{label:e.eqt_num,color:e.r?`rgb(${e.r}, ${e.g}, ${e.b})`:t==null?void 0:t.color}})});function P(b){y.value.includes(b)?y.value=y.value.filter(e=>e!==b):y.value.push(b),g("load")}return(b,e)=>k.value.length>0?(r.openBlock(),r.createElementBlock("div",js,[r.createVNode(ht,{name:"channel",size:"32"}),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,t=>(r.openBlock(),r.createElementBlock("div",{key:t.label,style:r.normalizeStyle({background:t.color}),class:r.normalizeClass(["hzzt-kfb-channel__box",y.value.includes(t.label)?"":"hzzt-kfb-channel__box--unactive"]),onClick:i=>P(t.label)},r.toDisplayString(t.label),15,Vs))),128))])):r.createCommentVNode("",!0)}}),Us=["element-loading-text"],Ws={key:1,class:"hzzt-kfb-view__main flex align-items-center justify-content-center"},Gs={class:"hzzt-kfb-view__filter",height:"0",width:"0"},$s={id:"colorMatrixFilter"},qs=["values"],Zs=["values"],Ks=["exponent"],Xs=["exponent"],Ys=["exponent"],Js={class:"flex nowrap justify-content-center overflow-hidden"},Qs=["src"],ea=["src"],ta={class:"flex-1"},na={class:"flex-1"},ia={class:"flex-1"},oa={class:"flex-1"},ra={class:"flex-1"},sa={class:"flex-1"},aa=["src"],Ct=r.defineComponent({name:"HzztKfbView",__name:"index",props:{slide:{},fileHandle:{},labelHandle:{},tileHandle:{},navigatorHandle:{},pathologyHandle:{},uploadHandle:{},options:{},labelDrawing:{},process:{default:()=>({...oi})},microscope:{default:()=>({...on})},menus:{},aiLabelList:{},hotmap:{},syncPosition:{type:Boolean},syncZoom:{type:Boolean}},emits:["tool"],setup(I,{expose:R,emit:l}){const g=I,y=l,{t:E,locale:k}=xt(),P=r.ref(),b=r.ref(),e=r.ref(),t=r.ref(!1),i=r.ref({}),u=r.ref(!1),n=r.ref(0),o=r.ref(0),s=r.ref(0),c=r.ref([]),m=r.ref({width:0,height:0,fileNum:0,scanScale:1,fileName:"",ratiomap:{}}),_=r.inject("show-kfb-label",r.ref(!0)),S=r.inject("show-keyboard",r.ref(!1)),O=r.inject("hidden-all-label",r.ref(!1)),N=Ee.ElLoading.directive;r.watch(()=>{var de;return(de=g.slide)==null?void 0:de.file},()=>{Je(),setTimeout(()=>{dt()},100)}),r.onMounted(()=>{dt()});const{imageProcess:B,matrixValues:U,saturateValues:W,forceRedraw:H}=is(g),{tailorEvent:$,shotScreen:K}=os(y,i),{moveEvent:Q,fastMove:re}=Rs(i,o),{currentLabel:Y,voiceVisible:he,labelForm:ve,initLabel:Se,selectLabel:ke,reloadLabelList:Me,eventHandel:Ve,addHandle:Ue}=ks(g,i),{initSync:$e}=Ls(g,i,P);As(i,P);const{drawDot:Ae}=Os(),{drawVoice:qe,isRecording:Re,startRecording:ot,stopRecording:Qe}=Is(g,ve),{getHotmapUrl:Ke,handlerImage:Ze,hotmapLine:it,lineMouseDown:ft,hotmapImgs:Ge}=Ds(g,i);function dt(){var de;(de=g.slide)!=null&&de.file&&g.fileHandle&&(u.value||(u.value=!0,g.fileHandle(g.slide).then(se=>{var Pe,le,ye,me;m.value=se,c.value=(((Pe=m.value)==null?void 0:Pe.channel)??[]).map(Te=>Te.eqt_num),i.value=new wt({el:b.value,fileName:(le=g.slide)==null?void 0:le.file,scale:m.value.scanScale,lang:(k==null?void 0:k.value)==="en-US"?"en":k==null?void 0:k.value,navigator:{style:"left: 0;bottom: 0",thumbnail:m.value.thumbnailImg,width:200,height:180},grid:{show:!1,ruler:!1,pxConversion:!0},thumb:{bgColor:"rgba(0,0,0,0)"},graduation:{show:!0,right:120,bottom:(me=(ye=m.value)==null?void 0:ye.channel)!=null&&me.length?120:30,tick:{number:3,height:8}},pxConversion:{units:["um","mm"],binary:1e3,imageCapRes:m.value.imageCapRes||m.value.scanResolution||1},openSeadragonOptions:{maxZoomLevel:m.value.scanScale*20,pixelsPerArrowPress:200,animationTime:0,tileSources:Xe()},tileDrawing:Ze,label:{drawing:(Te,De,tt)=>{var D;if(De!=null&&De.custom){const C=Te.getContext("2d");C.save(),C.beginPath();const A=(De==null?void 0:De.subType)||((D=De==null?void 0:De.__data__)==null?void 0:D.subType);A==="count"?(C.translate(tt.x-14,tt.y-22),Ae(C,(De==null?void 0:De.strokeStyle)||"")):A==="voice"?(C.translate(tt.x-16,tt.y-18),qe(C,(De==null?void 0:De.strokeStyle)||"")):g.labelDrawing&&g.labelDrawing(C,De),C.restore()}}},...g.options??{}}),i.value.viewer.drawer.canvas.style.filter="url(#colorMatrixFilter)",Se(),rt(),$e()}).finally(()=>{u.value=!1,O.value&&(we({show:!1,ruler:!1}),ge({show:!1}),setTimeout(()=>{be(!1)},100))})))}function vt(){const de=i.value.viewer;if(de.world){const se=de.world.getItemAt(0),Pe=de.viewport.getZoom(),le=de.viewport.getCenter();de.world.removeItem(se),de.addTiledImage({tileSource:Xe(),success:function(){de.viewport.zoomTo(Pe),de.viewport.panTo(le)}})}}function Xe(){var ye,me;const de=m.value.tileWidth||m.value.imageBlockLen||256,se=m.value.tileHeight||m.value.imageBlockLen||256,Pe={};(ye=g.hotmap)!=null&&ye.enable&&(((me=g.hotmap)==null?void 0:me.info)??[]).forEach(Te=>{Pe[Te[0]/de+"_"+Te[1]/se+"_"+Te[2]]=!0});let le=10;return Object.keys(m.value.ratiomap).forEach(Te=>{const De=m.value.fileNum-Math.sqrt(m.value.scanScale/Number(Te));De>0&&(le=le?Math.min(le,De):De)}),{height:m.value.height,width:m.value.width,tileWidth:de,tileHeight:se,minLevel:Math.floor(le||8),getTileUrl:(Te,De,tt)=>{var M,ue,Ce,ae;const D=Te,C={file:((M=g.slide)==null?void 0:M.file)||"",x:De,y:tt,scale:"0",level:Te,channel:JSON.stringify(c.value)};m.value.fileNum===Te?(Te=m.value.scanScale,C.scale=Te.toFixed(6)):(Te=m.value.scanScale/Math.pow(2,m.value.fileNum-Te),C.scale=Te.toFixed(6)),C.level=D,C.file=s.value===0?C.file:((Ce=(ue=g.slide)==null?void 0:ue.children)==null?void 0:Ce[s.value-1])||"";const A=g.tileHandle(C);return(ae=g.hotmap)!=null&&ae.enable?Ke(A,C,Pe):A}}}function rt(){i.value.viewer.addHandler("rotate",de=>{n.value=de.degrees||0}),i.value.viewer.addHandler("zoom",de=>{const se=i.value.viewer.viewport.viewportToImageZoom(de.zoom||0)*Number(i.value.$options.scale);o.value=Number(se.toFixed(2))}),i.value.$on(wt.events.EVENT_NAVIGATOR_VESTIGE,de=>{g.navigatorHandle&&g.navigatorHandle("add",g.slide,de)}),g.navigatorHandle&&g.navigatorHandle("list",g.slide).then(de=>{var se,Pe;(Pe=(se=i.value.navigator)==null?void 0:se.drawPointList)==null||Pe.call(se,de)}),$(),Q()}function Je(){var de;(de=i.value)!=null&&de.destroy&&(i.value.destroy(),i.value={},m.value={width:0,height:0,fileNum:0,scanScale:1,fileName:"",ratiomap:{}},Ge.value=[],c.value=[],o.value=0,n.value=0,s.value=0)}function et(de,se){de==="annotate"?w(se):de==="tailor"?K(se):de==="info"?t.value=!0:de==="flip"?oe():de==="delete"?Ve("delete")(Y.value):y("tool",de,se)}function w(de){de.tool==="Voice"&&(de.subType="voice",de.tool="Dot",de.custom=!0),i.value.board.startDraw(de)}function j(){i.value.board.endDraw()}function oe(){i.value.viewer.viewport.toggleFlip()}function pe(de){var se,Pe;(Pe=(se=e.value)==null?void 0:se.scopeChange)==null||Pe.call(se,de)}function ce(){t.value=!0}function we(de){i.value.grid.updated(de)}function ge(de){i.value.graduation.updated(de)}function be(de){i.value.navigator.element.style.display=de?"flex":"none"}function Oe(de){const se=i.value.viewer.viewport.imageToViewportZoom(Number(de/i.value.$options.scale));i.value.viewer.viewport.zoomTo(se)}return r.provide("kfbView",i),r.provide("currentLabel",Y),R({kfbView:i,degrees:n,zoom:o,forceRedraw:H,toggleFlip:oe,startDraw:w,endDraw:j,shotScreen:K,info:ce,scopeChange:pe,updateGrid:we,updateGraduation:ge,updateNavigator:be,fastMove:re,zoomTo:Oe,selectLabel:ke,reloadLabelList:Me}),(de,se)=>{var Pe,le,ye;return r.openBlock(),r.createElementBlock("div",{ref_key:"mainKfbViewRef",ref:P,class:"hzzt-kfb-view"},[de.slide.file?r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"kfbViewMainRef",ref:b,class:"hzzt-kfb-view__main","element-loading-text":r.unref(E)("加载中"),"element-loading-background":"rgba(0, 0, 0, 0.8)"},null,8,Us)),[[r.unref(N),u.value]]):(r.openBlock(),r.createElementBlock("div",Ws,se[6]||(se[6]=[r.createElementVNode("img",{style:{width:"50%"},src:ii},null,-1)]))),de.slide.analysis&&de.slide.analysis.result?(r.openBlock(),r.createBlock(r.unref(Ee.ElTag),{key:2,class:"hzzt-kfb-view__tag"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(de.slide.analysis.result),1)]),_:1})):r.createCommentVNode("",!0),(r.openBlock(),r.createElementBlock("svg",Gs,[r.createElementVNode("filter",$s,[r.createElementVNode("feColorMatrix",{values:r.unref(U),type:"matrix"},null,8,qs),r.createElementVNode("feColorMatrix",{values:r.unref(W),type:"saturate"},null,8,Zs),r.createElementVNode("feComponentTransfer",null,[r.createElementVNode("feFuncR",{id:"feFuncR",type:"gamma",exponent:r.unref(B).ga,amplitude:"1",offset:"0"},null,8,Ks),r.createElementVNode("feFuncG",{id:"feFuncG",type:"gamma",exponent:r.unref(B).ga,amplitude:"1",offset:"0"},null,8,Xs),r.createElementVNode("feFuncB",{id:"feFuncB",type:"gamma",exponent:r.unref(B).ga,amplitude:"1",offset:"0"},null,8,Ys)])])])),r.createVNode(ps,{menus:de.menus,onTool:et},null,8,["menus"]),r.createVNode(ms,r.mergeProps(de.microscope,{ref_key:"microscopeRef",ref:e}),null,16),r.unref(_)&&de.slide.file?(r.openBlock(),r.createBlock(_s,{key:3,info:m.value,slide:de.slide,pathologyHandle:de.pathologyHandle,onTool:et},null,8,["info","slide","pathologyHandle"])):r.createCommentVNode("",!0),r.unref(S)?(r.openBlock(),r.createBlock(Ns,{key:4})):r.createCommentVNode("",!0),(Pe=de.slide.children)!=null&&Pe.length?(r.openBlock(),r.createBlock(Hs,{key:5,modelValue:s.value,"onUpdate:modelValue":se[0]||(se[0]=me=>s.value=me),slides:de.slide.children},null,8,["modelValue","slides"])):r.createCommentVNode("",!0),(ye=(le=m.value)==null?void 0:le.channel)!=null&&ye.length?(r.openBlock(),r.createBlock(Fs,{key:6,modelValue:c.value,"onUpdate:modelValue":se[1]||(se[1]=me=>c.value=me),info:m.value,onLoad:vt},null,8,["modelValue","info"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Ee.ElDialog),{modelValue:t.value,"onUpdate:modelValue":se[2]||(se[2]=me=>t.value=me),"append-to-body":!0,title:r.unref(E)("图像信息"),width:"700px",top:"5vh"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElForm),{"label-position":"left"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElFormItem),{class:"flex","label-width":"0px"},{default:r.withCtx(()=>[r.createElementVNode("div",Js,[r.createElementVNode("img",{src:m.value.labelImg,style:{height:"180px"}},null,8,Qs),r.createElementVNode("img",{src:m.value.previewImg,style:{height:"180px"},class:"flex-1"},null,8,ea)])]),_:1}),r.createVNode(r.unref(Ee.ElFormItem),{label:r.unref(E)("文件名")},{default:r.withCtx(()=>[r.createElementVNode("span",ta,r.toDisplayString(m.value.fileName),1)]),_:1},8,["label"]),r.createVNode(r.unref(Ee.ElFormItem),{label:r.unref(E)("图像像素")},{default:r.withCtx(()=>[r.createElementVNode("span",na,r.toDisplayString(m.value.width)+"Pixel - "+r.toDisplayString(m.value.height)+"Pixel",1)]),_:1},8,["label"]),r.createVNode(r.unref(Ee.ElFormItem),{label:r.unref(E)("扫描倍率")},{default:r.withCtx(()=>[r.createElementVNode("span",ia,r.toDisplayString(m.value.scanScale),1)]),_:1},8,["label"]),r.createVNode(r.unref(Ee.ElFormItem),{label:r.unref(E)("扫描时刻")},{default:r.withCtx(()=>[r.createElementVNode("span",oa,r.toDisplayString(m.value.scanTime),1)]),_:1},8,["label"]),r.createVNode(r.unref(Ee.ElFormItem),{label:r.unref(E)("扫描时间")},{default:r.withCtx(()=>[r.createElementVNode("span",ra,r.toDisplayString(m.value.scanDuration||0)+"s",1)]),_:1},8,["label"]),m.value.ext?(r.openBlock(),r.createBlock(r.unref(Ee.ElFormItem),{key:0,label:r.unref(E)("扫描设备")},{default:r.withCtx(()=>[r.createElementVNode("span",sa,r.toDisplayString(m.value.ext.machineNum||""),1)]),_:1},8,["label"])):r.createCommentVNode("",!0)]),_:1})]),_:1},8,["modelValue","title"]),r.createVNode(r.unref(Ee.ElDialog),{modelValue:r.unref(he),"onUpdate:modelValue":se[5]||(se[5]=me=>r.isRef(he)?he.value=me:null),"append-to-body":!0,title:r.unref(E)("语音输入"),width:"500px",top:"5vh"},{footer:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElButton),{onClick:se[3]||(se[3]=me=>he.value=!1)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(E)("取消")),1)]),_:1}),r.createVNode(r.unref(Ee.ElButton),{type:"primary",onClick:se[4]||(se[4]=me=>r.unref(Ue)(r.unref(ve)))},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(E)("确定")),1)]),_:1})]),default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElForm),{"label-position":"left"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElFormItem),null,{default:r.withCtx(()=>{var me;return[(me=r.unref(ve))!=null&&me.src?(r.openBlock(),r.createElementBlock("audio",{key:0,class:"width-100%",src:r.unref(ve).src,controls:"",preload:"auto"},null,8,aa)):r.createCommentVNode("",!0)]}),_:1}),r.createVNode(r.unref(Ee.ElFormItem),null,{default:r.withCtx(()=>[r.unref(Re)?(r.openBlock(),r.createBlock(r.unref(Ee.ElButton),{key:1,type:"danger",onClick:r.unref(Qe)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(E)("结束录音")),1)]),_:1},8,["onClick"])):(r.openBlock(),r.createBlock(r.unref(Ee.ElButton),{key:0,type:"primary",onClick:r.unref(ot)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(E)("开始录音")),1)]),_:1},8,["onClick"]))]),_:1})]),_:1})]),_:1},8,["modelValue","title"]),de.hotmap&&de.hotmap.enable&&de.hotmap.type!=="switch"?(r.openBlock(),r.createElementBlock("div",{key:7,class:"hzzt-kfb-view__hotmap",style:r.normalizeStyle({left:r.unref(it)+"px"})},[r.createVNode(r.unref(Ee.ElIcon),{class:"icon-caret-left",size:"30",onMousedown:r.unref(ft)},{default:r.withCtx(()=>se[7]||(se[7]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[r.createElementVNode("path",{fill:"currentColor",d:"M672 192 288 511.936 672 832z"})],-1)])),_:1,__:[7]},8,["onMousedown"]),r.createVNode(r.unref(Ee.ElIcon),{class:"icon-caret-right",size:"30",onMousedown:r.unref(ft)},{default:r.withCtx(()=>se[8]||(se[8]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[r.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})],-1)])),_:1,__:[8]},8,["onMousedown"])],4)):r.createCommentVNode("",!0),r.renderSlot(de.$slots,"default")],512)}}});function la(I,R){var t,i;const l=r.ref(!!((t=I.ai)!=null&&t.default)),g=r.ref(!!((i=I.ai)!=null&&i.default)),y=r.ref([]),E=r.computed(()=>{var u,n,o,s;return(n=(u=R.value)==null?void 0:u.analysis)!=null&&n.id?((s=(o=R.value)==null?void 0:o.analysis)==null?void 0:s.class)||"auto":""});r.watch(()=>{var u;return(u=I.ai)==null?void 0:u.default},u=>{l.value=!!u,g.value=!!u}),r.watch(()=>{var u;return(u=R==null?void 0:R.value)==null?void 0:u.id},k),r.onMounted(()=>{var u,n;l.value=!!((u=I.ai)!=null&&u.default),g.value=!!((n=I.ai)!=null&&n.default),k()});function k(){var u;(u=R.value)!=null&&u.id&&E.value?l.value||g.value?P():y.value=[]:y.value=[]}function P(){I.ai.handle(E.value,R.value).then(u=>{y.value=u}).catch(()=>{y.value=[],E.value==="IQC"?g.value=!1:l.value=!1})}function b(){g.value=!1,k()}function e(){l.value=!1,k()}return{analysisClass:E,aiLabelList:y,enableAi:l,enableIqc:g,toggleIqc:e,toggleAi:b}}const ua=["src","fit"],ca=["src","fit"],nn=r.defineComponent({name:"KfbImage",__name:"KfbImage",props:{src:{type:String,required:!0,default:""},fit:{type:String,validator:I=>["","contain","cover","fill","none","scale-down"].includes(I),default:""},retryTimes:{type:Number,default:0},load:{type:Function,default:()=>({})}},setup(I){const R=I;let l=0;const g=r.ref(!1),y=r.reactive({x:0,y:0}),E=r.computed(()=>({top:`${y.y+10}px`,left:`${y.x}px`,transform:"translateY(-50%)",width:`${4*300/3}px`,height:"300px",background:"rgba(0,0,0,0.8)",zIndex:"10000"}));function k(t){const i=t.target;l<R.retryTimes?(i.src=R.src,l++):i.src=ii}function P(t){const{x:i,y:u}=b(t),n=4*300/3,o=300;y.x=Math.min(Math.max(i,n/2),window.innerWidth-n/2),y.y=Math.min(Math.max(u,o/2),window.innerHeight-o/2),g.value=!0}function b(t){const i=t.target,u=t.offsetX,n=t.offsetY,o=i.clientWidth,s=i.clientHeight;return{x:t.clientX+o-u,y:t.clientY-n+s/2}}function e(){g.value=!1}return(t,i)=>(r.openBlock(),r.createElementBlock("div",{class:"relative",onMouseenter:P,onMouseleave:e},[r.createElementVNode("img",{src:I.src,fit:I.fit,onError:k,style:{height:"100%",width:"100%"}},null,40,ua),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[g.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"fixed hzzt-kfb-img-triangle-left",style:r.normalizeStyle(E.value)},[r.createElementVNode("img",{src:I.src,fit:I.fit,style:{objectFit:"contain",height:"100%",width:"100%"},onMouseenter:i[0]||(i[0]=()=>{g.value=!0}),onMouseleave:e},null,40,ca)],4)):r.createCommentVNode("",!0)]))],32))}}),ha={},da={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function fa(I,R){return r.openBlock(),r.createElementBlock("svg",da,R[0]||(R[0]=[r.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"},null,-1)]))}const pa=St(ha,[["render",fa]]),va={},ga={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ma(I,R){return r.openBlock(),r.createElementBlock("svg",ga,R[0]||(R[0]=[r.createElementVNode("g",{id:"Frame"},[r.createElementVNode("path",{id:"Vector",d:"M5.33333 2.66659H14V3.99992H5.33333V2.66659ZM2 2.33325H4V4.33325H2V2.33325ZM2 6.99992H4V8.99992H2V6.99992ZM2 11.6666H4V13.6666H2V11.6666ZM5.33333 7.33325H14V8.66659H5.33333V7.33325ZM5.33333 11.9999H14V13.3333H5.33333V11.9999Z",fill:"currentColor","fill-opacity":"0.9"})],-1)]))}const ya=St(va,[["render",ma]]),wa={class:"hzzt-kfb-slides"},xa={class:"hzzt-kfb-slides__row"},ba={class:"hzzt-kfb-slides__top"},Ta={class:"text-primary"},Sa={class:"flex align-items-center"},Ea={class:"flex-1 overflow-auto",style:{width:"100%"}},Pa={key:0},Ca=["onClick"],_a={class:"hzzt-kfb-slides__gallery"},Ra=["onClick"],ka={key:0,class:"hzzt-kfb-slides__read"},Oa=["onClick"],Ia={key:1,class:"flex column"},Da={class:"hzzt-kfb-slides__header"},La={class:"w-30%"},za={class:"w-40%"},Ma={class:"w-20%"},Ba=["onClick"],Na={class:"w-30% flex"},Aa={class:"hzzt-kfb-slides__gallery"},Ha={key:0,class:"hzzt-kfb-slides__read"},ja={class:"w-40% flex"},Va=["onClick"],Fa=["onClick"],Ua={key:0,class:"flex column py-2"},Wa={class:"flex align-items-center justify-content-center"},Ga={class:"margin-r-1"},$a={key:0,class:"margin-r-1 margin-l-2"},qa=r.defineComponent({__name:"KfbSlideList",props:{slides:{}},emits:["select","tool"],setup(I,{emit:R}){const l=I,g=R,y=r.inject("file-index",{value:0}),E=r.inject("divide",{value:!1}),k=r.inject("sync",{value:!1}),P=r.ref(!1),b=r.computed(()=>l.slides.filter(({read:n})=>n)),e=r.computed(()=>l.slides.filter(({check:n})=>n)),{t}=xt();function i(n){y.value=n,g("select",n)}function u(n){n.check=!n.check}return(n,o)=>(r.openBlock(),r.createElementBlock("div",wa,[r.createElementVNode("div",xa,[r.createElementVNode("div",ba,[r.createElementVNode("span",null,[o[4]||(o[4]=r.createTextVNode("已读:")),r.createElementVNode("span",Ta,r.toDisplayString(b.value.length),1),r.createTextVNode("/"+r.toDisplayString(n.slides.length),1)]),r.createElementVNode("div",Sa,[r.createVNode(r.unref(Ee.ElIcon),{class:"margin-r-2 pointer",size:"16",color:P.value?"#999":"#000",onClick:o[0]||(o[0]=s=>P.value=!P.value)},{default:r.withCtx(()=>[r.createVNode(pa)]),_:1},8,["color"]),r.createVNode(r.unref(Ee.ElIcon),{class:"pointer",name:"cus-list",size:"16",color:P.value?"#000":"#999",onClick:o[1]||(o[1]=s=>P.value=!P.value)},{default:r.withCtx(()=>[r.createVNode(ya)]),_:1},8,["color"])])]),r.createElementVNode("div",Ea,[P.value?(r.openBlock(),r.createElementBlock("ul",Ia,[r.createElementVNode("li",Da,[o[5]||(o[5]=r.createElementVNode("div",{class:"w-10%"},null,-1)),r.createElementVNode("div",La,r.toDisplayString(r.unref(t)("缩略图")),1),r.createElementVNode("div",za,r.toDisplayString(r.unref(t)("切片名")),1),r.createElementVNode("div",Ma,r.toDisplayString(r.unref(t)("评分")),1)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.slides,(s,c)=>(r.openBlock(),r.createElementBlock("li",{key:c,class:"flex align-items-center overflow-hidden",style:r.normalizeStyle({backgroundColor:r.unref(y)===c?"rgba(6, 85, 195, 0.1)":"#fff"}),onClick:m=>i(c)},[r.createElementVNode("div",{class:"w-10% text-center",onClick:r.withModifiers(()=>{},["stop"])},[r.createVNode(r.unref(Ee.ElCheckbox),{modelValue:s.check,"onUpdate:modelValue":m=>s.check=m,style:{width:"14px",height:"16px"}},null,8,["modelValue","onUpdate:modelValue"])]),r.createElementVNode("div",Na,[r.createElementVNode("div",Aa,[r.createVNode(nn,{"retry-times":1,src:s.labelImg,fit:"cover",style:{height:"45px"},class:"flex-1"},null,8,["src"]),r.createVNode(nn,{"retry-times":1,fit:"cover",src:s.previewImg,style:{height:"45px"},class:"flex-1"},null,8,["src"]),s.read?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Ha,r.toDisplayString(r.unref(t)("未读")),1))])]),r.createElementVNode("div",ja,[r.createVNode(r.unref(Ee.ElTooltip),{effect:"dark",placement:"bottom",content:`${s.name}`},{default:r.withCtx(()=>[r.createElementVNode("span",{style:{"line-height":"16px"},class:"margin-l-1 ellipsis hzzt-kfb-slides__text",dir:"rtl",onClick:r.withModifiers(m=>u(s),["stop"])},r.toDisplayString(s.name),9,Va)]),_:2},1032,["content"])]),r.createElementVNode("div",{class:"w-20% flex text-center pointer",style:r.normalizeStyle({color:s.gradeColor}),onClick:m=>g("tool","grade",s)},r.toDisplayString(s.grade),13,Fa)],12,Ba))),128))])):(r.openBlock(),r.createElementBlock("div",Pa,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.slides,(s,c)=>(r.openBlock(),r.createElementBlock("div",{key:c,class:r.normalizeClass(["hzzt-kfb-slides__box",r.unref(y)===c?"hzzt-kfb-slides__box--active":""]),onClick:m=>i(c)},[r.createElementVNode("div",_a,[r.createVNode(nn,{"retry-times":1,src:s.labelImg,class:"hzzt-kfb-slides__img",fit:"cover"},null,8,["src"]),r.createVNode(nn,{"retry-times":1,src:s.previewImg,class:"flex-1 hzzt-kfb-slides__img1",fit:"cover"},null,8,["src"])]),r.createElementVNode("div",{class:"flex justify-content-between align-items-center",onClick:r.withModifiers(()=>{},["stop"])},[r.createVNode(r.unref(Ee.ElCheckbox),{modelValue:s.check,"onUpdate:modelValue":m=>s.check=m,style:{width:"14px",height:"16px"}},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ee.ElTooltip),{effect:"dark",placement:"bottom",content:`${s.name}`},{default:r.withCtx(()=>[r.createElementVNode("span",{style:{"line-height":"16px","text-align":"center",width:"calc(100% - 14px)"},class:"margin-l-1 ellipsis",dir:"rtl",onClick:r.withModifiers(m=>u(s),["stop"])},r.toDisplayString(s.name),9,Ra)]),_:2},1032,["content"])]),s.read?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ka,r.toDisplayString(r.unref(t)("未读")),1)),s.grade?(r.openBlock(),r.createElementBlock("div",{key:1,class:"hzzt-kfb-slides__grade",style:r.normalizeStyle({background:s.gradeColor}),onClick:m=>g("tool","grade",s)},r.toDisplayString(s.grade),13,Oa)):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"slide",{slide:s},void 0,!0)],10,Ca))),128))]))]),e.value.length>1?(r.openBlock(),r.createElementBlock("div",Ua,[r.createElementVNode("div",Wa,[r.createElementVNode("span",Ga,r.toDisplayString(r.unref(t)("分屏")),1),r.createVNode(r.unref(Ee.ElSwitch),{modelValue:r.unref(E),"onUpdate:modelValue":o[2]||(o[2]=s=>r.isRef(E)?E.value=s:null)},null,8,["modelValue"]),r.unref(E)?(r.openBlock(),r.createElementBlock("span",$a,r.toDisplayString(r.unref(t)("同步")),1)):r.createCommentVNode("",!0),r.unref(E)?(r.openBlock(),r.createBlock(r.unref(Ee.ElSwitch),{key:1,modelValue:r.unref(k),"onUpdate:modelValue":o[3]||(o[3]=s=>r.isRef(k)?k.value=s:null)},null,8,["modelValue"])):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)])]))}}),Za=St(qa,[["__scopeId","data-v-c2a1a22e"]]);var Ka=Object.defineProperty,Xa=Object.defineProperties,Ya=Object.getOwnPropertyDescriptors,Vi=Object.getOwnPropertySymbols,Ja=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Fi=(I,R,l)=>R in I?Ka(I,R,{enumerable:!0,configurable:!0,writable:!0,value:l}):I[R]=l,el=(I,R)=>{for(var l in R||(R={}))Ja.call(R,l)&&Fi(I,l,R[l]);if(Vi)for(var l of Vi(R))Qa.call(R,l)&&Fi(I,l,R[l]);return I},tl=(I,R)=>Xa(I,Ya(R)),nl={props:{src:{type:String,required:!0},srcPlaceholder:{type:String,default:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},srcset:{type:String},intersectionOptions:{type:Object,default:()=>({})},usePicture:{type:Boolean,default:!1}},inheritAttrs:!1,setup(I,{attrs:R,slots:l,emit:g}){const y=r.ref(null),E=r.reactive({observer:null,intersected:!1,loaded:!1}),k=r.computed(()=>E.intersected&&I.src?I.src:I.srcPlaceholder),P=r.computed(()=>E.intersected&&I.srcset?I.srcset:!1),b=()=>{y.value&&y.value.getAttribute("src")!==I.srcPlaceholder&&(E.loaded=!0,g("load",y.value))},e=()=>g("error",y.value);return r.onMounted(()=>{"IntersectionObserver"in window&&(E.observer=new IntersectionObserver(t=>{t[0].isIntersecting&&(E.intersected=!0,E.observer.disconnect(),g("intersect"))},I.intersectionOptions),E.observer.observe(y.value))}),r.onBeforeUnmount(()=>{"IntersectionObserver"in window&&E.observer&&E.observer.disconnect()}),()=>{const t=r.h("img",tl(el({ref:y,src:k.value,srcset:P.value||null},R),{class:[R.class,"v-lazy-image",{"v-lazy-image-loaded":E.loaded}],onLoad:b,onError:e}));return I.usePicture?r.h("picture",{ref:y,onLoad:b},E.intersected?[l.default,t]:[t]):t}}};const il={class:"hzzt-kfb-ai overflow-hidden"},ol={class:"flex align-items-center margin-t-1"},rl={style:{color:"var(--el-color-success)"}},sl={class:"flex-1 flex overflow-auto wrap margin-t-1"},al=["onClick"],ll={key:0,style:{"margin-left":"2px"}},ul=r.defineComponent({name:"KfbAiList",__name:"list",props:{data:{default:()=>[]},slide:{default:()=>({})}},setup(I,{expose:R}){const l=I,{t:g}=xt(),y=r.inject("kfbViewRef"),E=r.ref(-1),k=r.ref(1),P=r.ref(100),b=r.ref(!0),e=r.ref([]),t=r.computed(()=>l.data.filter(O=>e.value.includes(O.cls||""))),i=r.computed(()=>t.value.slice((k.value-1)*P.value,k.value*P.value)),u=r.computed(()=>{var N,B;const O=((B=(N=l.slide)==null?void 0:N.analysis)==null?void 0:B.result)||"";return O.indexOf("疑似阳性")>-1?{type:"warning",name:O}:O.indexOf("阳性")>-1?{type:"danger",name:O}:O.indexOf("阴性")>-1?{type:"success",name:O}:{type:"info",name:O||g("未知")}}),n=r.computed(()=>{const O=new Set;return l.data.forEach(N=>{const B=N.cls||"";B&&!O.has(B)&&O.add(B)}),Array.from(O)}),o=r.computed(()=>e.value.length!==0&&e.value.length!==n.value.length);r.watch(()=>n.value,O=>{s(),e.value=[...O]}),r.onMounted(()=>{e.value=[...n.value]});function s(){E.value=-1,k.value=1,P.value=100,b.value=!0}function c(O){const N=t.value.findIndex(B=>B.id===O.id);E.value=N,y.value.selectLabel(O)}function m(O){const N=l.data.filter(B=>B.cls===O);return N.length?`(${N.length})`:""}function _(){E.value=-1,b.value=e.value.length==n.value.length}function S(O){e.value=O?[...n.value]:[],E.value=-1}return R({labelList:t}),(O,N)=>(r.openBlock(),r.createElementBlock("div",il,[r.createElementVNode("div",ol,[r.createVNode(r.unref(Ee.ElPopover),{placement:"bottom",trigger:"click",width:"160"},{reference:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElButton),{class:"margin-r-1",type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(g)("分类"))+" ",1),r.createVNode(ht,{name:"arrowDown"})]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.createVNode(r.unref(Ee.ElCheckbox),{modelValue:b.value,"onUpdate:modelValue":N[0]||(N[0]=B=>b.value=B),indeterminate:o.value,onChange:S},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(g)("全选")),1)]),_:1},8,["modelValue","indeterminate"]),r.createVNode(r.unref(Ee.ElCheckboxGroup),{modelValue:e.value,"onUpdate:modelValue":N[1]||(N[1]=B=>e.value=B),class:"flex column",onChange:_},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,B=>(r.openBlock(),r.createBlock(r.unref(Ee.ElCheckbox),{key:B,value:B},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(B)+" ",1),r.createElementVNode("span",rl,r.toDisplayString(m(B)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])]),_:1}),r.createVNode(r.unref(Ee.ElTag),{type:u.value.type,class:"margin-l-1"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(u.value.name),1)]),_:1},8,["type"])]),r.createElementVNode("div",sl,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(B,U)=>(r.openBlock(),r.createElementBlock("div",{key:U+(k.value-1)*P.value,class:r.normalizeClass(`hzzt-kfb-ai__img ${E.value===U+(k.value-1)*P.value?"hzzt-kfb-ai__img--active":""}`),onClick:W=>c(B)},[r.createVNode(r.unref(nl),{"retry-times":1,src:B.imageUrl,"error-src":r.unref(ii)},null,8,["src","error-src"]),r.createElementVNode("div",{style:r.normalizeStyle({color:B.strokeStyle}),class:"ellipsis"},[r.createTextVNode(r.toDisplayString(B.cls)+" ",1),B.score?(r.openBlock(),r.createElementBlock("span",ll,r.toDisplayString(B.score),1)):r.createCommentVNode("",!0)],4)],10,al))),128))]),r.createVNode(r.unref(Ee.ElPagination),{class:"wrap","current-page":k.value,"onUpdate:currentPage":N[2]||(N[2]=B=>k.value=B),"page-size":P.value,"onUpdate:pageSize":N[3]||(N[3]=B=>P.value=B),"page-sizes":[100,200,300,400],layout:"total, sizes, prev, pager, next",total:t.value.length},null,8,["current-page","page-size","total"])]))}}),cl={class:"hzzt-kfb-slide"},hl={class:"flex flex-1 overflow-hidden"},dl={class:"flex flex-1"},fl={key:0,style:{height:"100%",width:"100%"},class:"flex wrap"},pl=["onClick"],Ot=r.defineComponent({name:"HzztKfbSlide",__name:"index",props:r.mergeModels({menus:{default:()=>[]},kfb:{},slides:{default:()=>[]},ai:{},teleport:{type:Boolean,default:!1},process:{},microscope:{},showList:{type:Boolean,default:!0},showKfbLabel:{type:Boolean,default:!0},showKeyboard:{type:Boolean,default:!1},showMenuText:{type:Boolean,default:!0}},{index:{default:0},indexModifiers:{}}),emits:r.mergeModels(["tool"],["update:index"]),setup(I,{expose:R,emit:l}){const g=I,y=l,E=r.useModel(I,"index"),k=r.computed(()=>g.slides[E.value]),P=r.computed(()=>g.slides.filter(({check:Y})=>Y)),b=r.ref(),e=r.ref(),t=r.ref(),i=r.ref(g.showKeyboard),u=r.ref(g.showKfbLabel),n=r.ref(!1),o=r.ref(!1),s=r.ref(!1),{t:c}=xt(),m=r.computed(()=>{var Y;if(n.value){const he=P.value.findIndex(({id:ve})=>{var Se;return ve===((Se=k.value)==null?void 0:Se.id)});return((Y=e.value)==null?void 0:Y[he])||b.value}else return b.value}),_=r.computed(()=>P.value.length<=1?{height:"100%",width:"100%"}:P.value.length<=2?{height:"100%",width:"calc((100% - 4px) / 2)"}:P.value.length<=4?{height:"calc((100% - 4px) / 2)",width:"calc((100% - 4px) / 2)"}:P.value.length<=6?{height:"calc((100% - 4px) / 2)",width:"calc((100% - 4px * 2) / 3)"}:P.value.length<=9?{height:"calc((100% - 4px * 2) / 3)",width:"calc((100% - 4px * 2) / 3)"}:{height:"100%",width:"100%"});r.watch(()=>P.value,Y=>{n.value&&Y.length<=1&&(n.value=!1)}),r.watch(()=>k.value,Y=>{if(Y){const he=Y.read;Y.read=!0,y("tool","choose",{slide:Y,read:he})}});const{analysisClass:S,aiLabelList:O,enableAi:N,enableIqc:B,toggleIqc:U,toggleAi:W}=la(g,k);function H(Y,he){Y==="next"&&g.slides[E.value+1]&&E.value++,Y==="prev"&&g.slides[E.value-1]&&E.value--,(Y==="label"||Y==="tool")&&(u.value=he),y("tool",Y,he)}function $(Y){var ve,Se,ke;const he={...g.kfb,process:g.process,microscope:g.microscope,slide:Y,aiLabelList:k.value.id===Y.id?((ve=t.value)==null?void 0:ve.labelList)||[]:[],hotmap:(Se=Y==null?void 0:Y.hotmap)!=null&&Se.file?{...(Y==null?void 0:Y.hotmap)||{},enable:N.value}:void 0,syncPosition:o.value,syncZoom:o.value,handle:void 0};return(ke=g.kfb)!=null&&ke.handle?g.kfb.handle(Y,he):he}function K(Y){E.value=g.slides.findIndex(he=>he.id===Y.id)}function Q(Y){n.value&&(g.slides[Y].check=!0)}function re(){var Y;u.value=!s.value,(Y=n.value?e.value:[b.value])==null||Y.forEach(he=>{s.value&&(he.updateGrid({show:!s.value,ruler:!s.value}),i.value=!s.value),he.updateGraduation({show:!s.value}),he.updateNavigator(!s.value)})}return r.provide("kfbViewRef",m),r.provide("show-keyboard",i),r.provide("show-kfb-label",u),r.provide("hidden-all-label",s),r.provide("file-index",E),r.provide("divide",n),r.provide("sync",o),R({divide:n,slide:k,kfbViewRef:m,enableAI:r.computed(()=>{var Y;return((Y=g.ai)==null?void 0:Y.enable)&&O.value.length})}),(Y,he)=>(r.openBlock(),r.createElementBlock("div",cl,[Y.menus.length?(r.openBlock(),r.createBlock(kt,{key:0,menu:Y.menus,"show-menu-text":Y.showMenuText,process:Y.process,microscope:Y.microscope,onTool:H},{left:r.withCtx(()=>[r.renderSlot(Y.$slots,"left")]),right:r.withCtx(()=>[r.createVNode(r.unref(Ee.ElSwitch),{modelValue:s.value,"onUpdate:modelValue":he[0]||(he[0]=ve=>s.value=ve),"active-text":r.unref(c)("隐藏标签"),class:"margin-r-2",onChange:re},null,8,["modelValue","active-text"]),Y.ai&&Y.ai.enable&&r.unref(S)==="IQC"?(r.openBlock(),r.createBlock(r.unref(Ee.ElSwitch),{key:0,modelValue:r.unref(B),"onUpdate:modelValue":he[1]||(he[1]=ve=>r.isRef(B)?B.value=ve:null),"active-text":r.unref(c)("AI质控"),class:"margin-r-2",onChange:r.unref(U)},null,8,["modelValue","active-text","onChange"])):Y.ai&&Y.ai.enable&&r.unref(S)?(r.openBlock(),r.createBlock(r.unref(Ee.ElSwitch),{key:1,modelValue:r.unref(N),"onUpdate:modelValue":he[2]||(he[2]=ve=>r.isRef(N)?N.value=ve:null),"active-text":r.unref(c)("AI分析"),class:"margin-r-2",onChange:r.unref(W)},null,8,["modelValue","active-text","onChange"])):r.createCommentVNode("",!0),r.renderSlot(Y.$slots,"right")]),_:3},8,["menu","show-menu-text","process","microscope"])):r.createCommentVNode("",!0),r.createElementVNode("div",hl,[Y.showList?(r.openBlock(),r.createBlock(r.Teleport,{key:0,defer:"",to:"#kfb-slide-list",disabled:!Y.teleport},[r.createVNode(Za,{style:r.normalizeStyle(Y.teleport?"":"width: 250px"),slides:Y.slides,onSelect:Q,onTool:H},{slide:r.withCtx(({slide:ve})=>[r.renderSlot(Y.$slots,"list",{slide:ve})]),_:3},8,["style","slides"])],8,["disabled"])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.Teleport,{defer:"",to:"#kfb-slide-view",disabled:!Y.teleport},[r.createElementVNode("div",dl,[P.value.length&&n.value?(r.openBlock(),r.createElementBlock("ul",fl,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(P.value,(ve,Se)=>(r.openBlock(),r.createElementBlock("li",{key:Se,style:r.normalizeStyle(_.value),class:r.normalizeClass(k.value.id===ve.id?"hzzt-kfb-view-screen-active":""),onClick:ke=>K(ve)},[(r.openBlock(),r.createBlock(Ct,r.mergeProps({ref_for:!0,ref_key:"kfbViewRefs",ref:e,key:`kfb-${Se}`},{ref_for:!0},$(ve),{onTool:H}),{default:r.withCtx(()=>[r.renderSlot(Y.$slots,"kfb",{slide:ve})]),_:2},1040))],14,pl))),128))])):k.value?(r.openBlock(),r.createBlock(Ct,r.mergeProps({key:1,ref_key:"kfbViewRef",ref:b},$(k.value),{onTool:H}),{default:r.withCtx(()=>[r.renderSlot(Y.$slots,"kfb",{slide:k.value})]),_:3},16)):r.createCommentVNode("",!0)])],8,["disabled"])),Y.ai&&Y.ai.enable&&r.unref(O).length?(r.openBlock(),r.createBlock(r.Teleport,{key:1,defer:"",to:"#kfb-slide-ai",disabled:!Y.teleport},[r.createVNode(ul,{style:r.normalizeStyle(Y.teleport?"":"width: 350px"),ref_key:"kfbAiRef",ref:t,data:r.unref(O),slide:k.value},null,8,["style","data","slide"])],8,["disabled"])):r.createCommentVNode("",!0),r.renderSlot(Y.$slots,"default")])]))}});Ot.name="HzztKfbSlide";Ct.name="HzztKfbView";kt.name="HzztKfbToolbox";const vl=(I,R)=>{I.use(Vr,R==null?void 0:R.i18n),I.component(Ot.name,Ot),I.component(Ct.name,Ct),I.component(kt.name,kt)},gl={install:vl,HzztKfbSlide:Ot,HzztKfbView:Ct,HzztKfbToolbox:kt};exports.DEFAULT_MICROSCOPE=on;exports.DEFAULT_PROCESS=oi;exports._KfbView$getAngle=ns;exports._KfbView$isPointInEllipse=ts;exports._export_sfc=St;exports._sfc_main=Ot;exports._sfc_main$1=Ct;exports._sfc_main$2=kt;exports.arrow=Wi;exports.bilateral=Gi;exports.dot=Yi;exports.ellipse=qi;exports.flag=Xi;exports.font=Ji;exports.index=gl;exports.line=Ui;exports.polygon=Zi;exports.rectangle=$i;exports.star=Ki;exports.useLocalI18n=xt;exports.voice=Qi;