@sme.up/ketchup2 2.0.0-SNAPSHOT-20260119153236 → 2.0.0-SNAPSHOT-20260119161753

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 (119) hide show
  1. package/dist/{_baseIsEqual-F0fpp3Va.cjs → _baseIsEqual-CucAqeRB.cjs} +1 -1
  2. package/dist/{_baseIsEqual-DcMxszDD.js → _baseIsEqual-Ds_-bgCT.js} +1 -1
  3. package/dist/{_basePickBy-LIoaIE10.js → _basePickBy-BDE_gj5V.js} +3 -3
  4. package/dist/{_basePickBy-DVgMuWoX.cjs → _basePickBy-Xgrw3Dfe.cjs} +1 -1
  5. package/dist/{_baseUniq-DaNlmCwV.cjs → _baseUniq-AWMePInS.cjs} +1 -1
  6. package/dist/{_baseUniq-CJzuzp3r.js → _baseUniq-CuPz5ZnU.js} +2 -2
  7. package/dist/{arc-Bfq8nwPv.cjs → arc-CsDvBdRo.cjs} +1 -1
  8. package/dist/{arc-DSamCkOm.js → arc-DaAmAcTf.js} +1 -1
  9. package/dist/{architecture-U656AL7Q-DB8i14-y.cjs → architecture-U656AL7Q-Bv7OtYCg.cjs} +1 -1
  10. package/dist/{architecture-U656AL7Q-BoUlsrAM.js → architecture-U656AL7Q-lQeRvb4F.js} +1 -1
  11. package/dist/{architectureDiagram-VXUJARFQ-DDambLWF.cjs → architectureDiagram-VXUJARFQ-CewZQ5zM.cjs} +1 -1
  12. package/dist/{architectureDiagram-VXUJARFQ-BVmEi5yk.js → architectureDiagram-VXUJARFQ-DofeEf_r.js} +3 -3
  13. package/dist/basic-components/typography/typography.d.ts.map +1 -1
  14. package/dist/{blockDiagram-VD42YOAC-xNzyZDgZ.js → blockDiagram-VD42YOAC-BBE5cdgM.js} +5 -5
  15. package/dist/{blockDiagram-VD42YOAC--ycSH7to.cjs → blockDiagram-VD42YOAC-Df_sDpGk.cjs} +1 -1
  16. package/dist/{c4Diagram-YG6GDRKO-DrZI1Uvk.cjs → c4Diagram-YG6GDRKO-BXjyfo7C.cjs} +1 -1
  17. package/dist/{c4Diagram-YG6GDRKO-NiU3onVV.js → c4Diagram-YG6GDRKO-Cv8-r0O1.js} +2 -2
  18. package/dist/{channel-Csw7Zqp1.js → channel-Bzqh8Hm7.js} +1 -1
  19. package/dist/channel-bNuSLi4T.cjs +1 -0
  20. package/dist/{chunk-4BX2VUAB-Dygkk93v.js → chunk-4BX2VUAB-SRjs4HyE.js} +1 -1
  21. package/dist/{chunk-4BX2VUAB-kLoFdHIG.cjs → chunk-4BX2VUAB-h12Pwd1p.cjs} +1 -1
  22. package/dist/{chunk-55IACEB6-DM9PdJKC.js → chunk-55IACEB6-BOyrzjlp.js} +1 -1
  23. package/dist/{chunk-55IACEB6-Dl14ZnnM.cjs → chunk-55IACEB6-BzxtBL0X.cjs} +1 -1
  24. package/dist/{chunk-B4BG7PRW-BGlRsOef.cjs → chunk-B4BG7PRW-BwZVAZaj.cjs} +1 -1
  25. package/dist/{chunk-B4BG7PRW-tyy54bhp.js → chunk-B4BG7PRW-oJ3rpj6d.js} +4 -4
  26. package/dist/{chunk-DI55MBZ5-B_RXCmNi.cjs → chunk-DI55MBZ5-5z4SIdx5.cjs} +1 -1
  27. package/dist/{chunk-DI55MBZ5-C_uegk-G.js → chunk-DI55MBZ5-BkSxZqpx.js} +3 -3
  28. package/dist/{chunk-FMBD7UC4-DMrPWTWD.js → chunk-FMBD7UC4-CG4mSejQ.js} +1 -1
  29. package/dist/{chunk-FMBD7UC4-EgWAssio.cjs → chunk-FMBD7UC4-OTB34Xhg.cjs} +1 -1
  30. package/dist/{chunk-QN33PNHL-BUReqfqf.js → chunk-QN33PNHL-Cwk0zb-g.js} +1 -1
  31. package/dist/{chunk-QN33PNHL-DT8lVkeb.cjs → chunk-QN33PNHL-jr_X5JdF.cjs} +1 -1
  32. package/dist/{chunk-QZHKN3VN-CbOvj7Sz.cjs → chunk-QZHKN3VN-SmOFY4DV.cjs} +1 -1
  33. package/dist/{chunk-QZHKN3VN-CpTjstx-.js → chunk-QZHKN3VN-aYCw_dVk.js} +1 -1
  34. package/dist/{chunk-TZMSLE5B-BE2SGYCu.cjs → chunk-TZMSLE5B-C84HeX5r.cjs} +1 -1
  35. package/dist/{chunk-TZMSLE5B-CiGUUDcz.js → chunk-TZMSLE5B-KGGcJfao.js} +1 -1
  36. package/dist/{classDiagram-2ON5EDUG-DkLHmP89.cjs → classDiagram-2ON5EDUG-Cp-hybua.cjs} +1 -1
  37. package/dist/{classDiagram-v2-WZHVMYZB-C5SgmMzE.js → classDiagram-2ON5EDUG-Cp1eM4RM.js} +2 -2
  38. package/dist/{classDiagram-v2-WZHVMYZB-DkLHmP89.cjs → classDiagram-v2-WZHVMYZB-Cp-hybua.cjs} +1 -1
  39. package/dist/{classDiagram-2ON5EDUG-C5SgmMzE.js → classDiagram-v2-WZHVMYZB-Cp1eM4RM.js} +2 -2
  40. package/dist/{clone-B4nx3THU.js → clone-BKP4klEH.js} +1 -1
  41. package/dist/clone-DRdcsbn6.cjs +1 -0
  42. package/dist/{cloneDeep-Cvmd8iR4.js → cloneDeep-C6o--NVs.js} +1 -1
  43. package/dist/{cloneDeep-CahJxu61.cjs → cloneDeep-KfiYHuHy.cjs} +1 -1
  44. package/dist/{cose-bilkent-S5V4N54A-D8SHJxwR.cjs → cose-bilkent-S5V4N54A-C_Mlgiqw.cjs} +1 -1
  45. package/dist/{cose-bilkent-S5V4N54A-c8nrlAo7.js → cose-bilkent-S5V4N54A-bSwFLFQU.js} +1 -1
  46. package/dist/{dagre-6UL2VRFP-OBnpKrKg.js → dagre-6UL2VRFP-Beh2HdOw.js} +6 -6
  47. package/dist/{dagre-6UL2VRFP-6vYuHdR_.cjs → dagre-6UL2VRFP-C02Xcjnp.cjs} +1 -1
  48. package/dist/{diagram-PSM6KHXK-eqfCNZ2d.cjs → diagram-PSM6KHXK-BEgHaXse.cjs} +1 -1
  49. package/dist/{diagram-PSM6KHXK-ChGcXqDi.js → diagram-PSM6KHXK-OYteJq29.js} +4 -4
  50. package/dist/{diagram-QEK2KX5R-cu0g4Qvy.js → diagram-QEK2KX5R-CO8BHone.js} +3 -3
  51. package/dist/{diagram-QEK2KX5R-C906QPMu.cjs → diagram-QEK2KX5R-Dg6GB9qw.cjs} +1 -1
  52. package/dist/{diagram-S2PKOQOG-D76fbciw.js → diagram-S2PKOQOG-CHTSE0ND.js} +3 -3
  53. package/dist/{diagram-S2PKOQOG-D4SvXrtx.cjs → diagram-S2PKOQOG-DaFznCS_.cjs} +1 -1
  54. package/dist/{erDiagram-Q2GNP2WA-qlpBRr-s.cjs → erDiagram-Q2GNP2WA-D9repMF8.cjs} +1 -1
  55. package/dist/{erDiagram-Q2GNP2WA-CMYY6trp.js → erDiagram-Q2GNP2WA-O3rFQdgz.js} +4 -4
  56. package/dist/{flowDiagram-NV44I4VS-Cpsf1v-b.cjs → flowDiagram-NV44I4VS-Dah4yjjk.cjs} +1 -1
  57. package/dist/{flowDiagram-NV44I4VS-B5bO_5zw.js → flowDiagram-NV44I4VS-lz-CGkwl.js} +5 -5
  58. package/dist/{ganttDiagram-JELNMOA3-BIE0sByu.cjs → ganttDiagram-JELNMOA3-DYl-svlb.cjs} +1 -1
  59. package/dist/{ganttDiagram-JELNMOA3-BlYSzwpR.js → ganttDiagram-JELNMOA3-cY5256OM.js} +2 -2
  60. package/dist/{gitGraph-F6HP7TQM-myoH4gfI.cjs → gitGraph-F6HP7TQM-5i4FRznF.cjs} +1 -1
  61. package/dist/{gitGraph-F6HP7TQM-lRg8M3bH.js → gitGraph-F6HP7TQM-CBUS_DNc.js} +1 -1
  62. package/dist/{gitGraphDiagram-NY62KEGX-DOq4bJ39.js → gitGraphDiagram-NY62KEGX-DkcCRyzZ.js} +4 -4
  63. package/dist/{gitGraphDiagram-NY62KEGX-BWAgyf-h.cjs → gitGraphDiagram-NY62KEGX-nG_enmF1.cjs} +1 -1
  64. package/dist/{graph-gjpYjG3c.js → graph-Bt_yUbOl.js} +3 -3
  65. package/dist/{graph-ChIYLuG7.cjs → graph-Dqny_ony.cjs} +1 -1
  66. package/dist/{index-BD02XooM.cjs → index-BglI_ler.cjs} +6 -6
  67. package/dist/{index-BVDLRK-G.js → index-DMGjSdB6.js} +31 -31
  68. package/dist/info-NVLQJR56-BMamZjWv.js +5 -0
  69. package/dist/{info-NVLQJR56-elvXf3sN.cjs → info-NVLQJR56-Cy9wrXpO.cjs} +1 -1
  70. package/dist/{infoDiagram-WHAUD3N6-Dkc5lP9Z.js → infoDiagram-WHAUD3N6-DZqCS9mI.js} +2 -2
  71. package/dist/{infoDiagram-WHAUD3N6-DnN67a4x.cjs → infoDiagram-WHAUD3N6-ja1-y67k.cjs} +1 -1
  72. package/dist/{journeyDiagram-XKPGCS4Q-er3l-j2o.js → journeyDiagram-XKPGCS4Q-BaBIWg8x.js} +4 -4
  73. package/dist/{journeyDiagram-XKPGCS4Q-DFMP8dvI.cjs → journeyDiagram-XKPGCS4Q-CHlCU06J.cjs} +1 -1
  74. package/dist/{kanban-definition-3W4ZIXB7-CNLuHCOo.js → kanban-definition-3W4ZIXB7-BuQ0YHSF.js} +2 -2
  75. package/dist/{kanban-definition-3W4ZIXB7-B8u2Ynpb.cjs → kanban-definition-3W4ZIXB7-qiWoITa6.cjs} +1 -1
  76. package/dist/ketchup2.cjs.js +1 -1
  77. package/dist/ketchup2.es.js +1 -1
  78. package/dist/{layout-Dqk-iibb.cjs → layout-C9OGUDGF.cjs} +1 -1
  79. package/dist/{layout-CgJPe2HG.js → layout-Cx2Tk8sw.js} +5 -5
  80. package/dist/{linear-BViQSTPv.js → linear-CPkGxTJw.js} +1 -1
  81. package/dist/{linear-C6F_XnW1.cjs → linear-_w_wkVI8.cjs} +1 -1
  82. package/dist/{mermaid-parser.core-BHMaGvTI.cjs → mermaid-parser.core-_DHGSJ6-.cjs} +2 -2
  83. package/dist/{mermaid-parser.core-CmjA03Bh.js → mermaid-parser.core-ln6LOaQj.js} +12 -12
  84. package/dist/{mindmap-definition-VGOIOE7T-BqpvEcDc.cjs → mindmap-definition-VGOIOE7T-BFLy2xEZ.cjs} +1 -1
  85. package/dist/{mindmap-definition-VGOIOE7T-DoNY-B4t.js → mindmap-definition-VGOIOE7T-BhZ9F5WU.js} +3 -3
  86. package/dist/{packet-BFZMPI3H-C2wCOb0a.js → packet-BFZMPI3H-B4eq8WNt.js} +1 -1
  87. package/dist/{packet-BFZMPI3H-B1tmspCt.cjs → packet-BFZMPI3H-DFAzqdBd.cjs} +1 -1
  88. package/dist/{pie-7BOR55EZ-B49J8FF3.cjs → pie-7BOR55EZ-CBIDSC_y.cjs} +1 -1
  89. package/dist/pie-7BOR55EZ-Ysn436Zw.js +5 -0
  90. package/dist/{pieDiagram-ADFJNKIX-BNAHVQYa.cjs → pieDiagram-ADFJNKIX-Di5nka51.cjs} +1 -1
  91. package/dist/{pieDiagram-ADFJNKIX-BmUj9Ul0.js → pieDiagram-ADFJNKIX-kh0Yzr3t.js} +4 -4
  92. package/dist/{quadrantDiagram-AYHSOK5B-CfzsJRu9.cjs → quadrantDiagram-AYHSOK5B-BCyl7Fl4.cjs} +1 -1
  93. package/dist/{quadrantDiagram-AYHSOK5B-BK3PbmWw.js → quadrantDiagram-AYHSOK5B-Ibjx-30-.js} +2 -2
  94. package/dist/{quill-By0JHqej.js → quill-BcWjLXVT.js} +3 -3
  95. package/dist/{quill-CUO2Qthn.cjs → quill-CxKAiddw.cjs} +1 -1
  96. package/dist/radar-NHE76QYJ-BdV3By2G.js +5 -0
  97. package/dist/{radar-NHE76QYJ-B_dNTB0y.cjs → radar-NHE76QYJ-YlDmTH7E.cjs} +1 -1
  98. package/dist/{requirementDiagram-UZGBJVZJ-0FutXkXL.cjs → requirementDiagram-UZGBJVZJ-CsfDh7tr.cjs} +1 -1
  99. package/dist/{requirementDiagram-UZGBJVZJ-BPD_tRvP.js → requirementDiagram-UZGBJVZJ-l87xqfQs.js} +3 -3
  100. package/dist/{sankeyDiagram-TZEHDZUN-C6YulaKC.js → sankeyDiagram-TZEHDZUN-BGMLzXOu.js} +1 -1
  101. package/dist/{sankeyDiagram-TZEHDZUN-SgoD2ZDR.cjs → sankeyDiagram-TZEHDZUN-CYpfcUxf.cjs} +1 -1
  102. package/dist/{sequenceDiagram-WL72ISMW-Z2ANq9JZ.js → sequenceDiagram-WL72ISMW-B1FcMsGq.js} +3 -3
  103. package/dist/{sequenceDiagram-WL72ISMW-Cy9SWc2g.cjs → sequenceDiagram-WL72ISMW-D2aLqNSZ.cjs} +1 -1
  104. package/dist/{stateDiagram-FKZM4ZOC-BEZk-Axy.cjs → stateDiagram-FKZM4ZOC-BYthx-57.cjs} +1 -1
  105. package/dist/{stateDiagram-FKZM4ZOC-9TmujdNP.js → stateDiagram-FKZM4ZOC-DpE7LidW.js} +4 -4
  106. package/dist/{stateDiagram-v2-4FDKWEC3-B94Tt2An.js → stateDiagram-v2-4FDKWEC3-B3IExfXE.js} +2 -2
  107. package/dist/{stateDiagram-v2-4FDKWEC3-DvNtX3Ol.cjs → stateDiagram-v2-4FDKWEC3-H1rXnBtV.cjs} +1 -1
  108. package/dist/{timeline-definition-IT6M3QCI-B6cAJhUm.js → timeline-definition-IT6M3QCI-C9Q_MoI6.js} +2 -2
  109. package/dist/{timeline-definition-IT6M3QCI-C_WkuEAq.cjs → timeline-definition-IT6M3QCI-Cblm6BGs.cjs} +1 -1
  110. package/dist/{treemap-KMMF4GRG-BLNcbDrU.cjs → treemap-KMMF4GRG-BahQoZmz.cjs} +1 -1
  111. package/dist/{treemap-KMMF4GRG-CPMgjg1Q.js → treemap-KMMF4GRG-n6UmQ7MI.js} +1 -1
  112. package/dist/{xychartDiagram-PRI3JC2R-BZLwPIQR.js → xychartDiagram-PRI3JC2R-CaCuDTqF.js} +2 -2
  113. package/dist/{xychartDiagram-PRI3JC2R-CsQuB-D1.cjs → xychartDiagram-PRI3JC2R-VQkoLtus.cjs} +1 -1
  114. package/package.json +1 -1
  115. package/dist/channel-CgdDqtDr.cjs +0 -1
  116. package/dist/clone-D1qvW4h7.cjs +0 -1
  117. package/dist/info-NVLQJR56-B3AK-1lL.js +0 -5
  118. package/dist/pie-7BOR55EZ-C-kzHU2V.js +0 -5
  119. package/dist/radar-NHE76QYJ-B4--e9er.js +0 -5
@@ -4,7 +4,7 @@
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
6
  <%s key={someKey} {...props} />`,B,X,K,X),$[X+B]=!0)}if(X=null,j!==void 0&&(r(j),X=""+j),s(U)&&(r(U.key),X=""+U.key),"key"in U){j={};for(var G in U)G!=="key"&&(j[G]=U[G])}else j=U;return X&&o(j,typeof N=="function"?N.displayName||N.name||"Unknown":N),c(N,X,j,i(),q,W)}function h(N){f(N)?N._store&&(N._store.validated=1):typeof N=="object"&&N!==null&&N.$$typeof===T&&(N._payload.status==="fulfilled"?f(N._payload.value)&&N._payload.value._store&&(N._payload.value._store.validated=1):N._store&&(N._store.validated=1))}function f(N){return typeof N=="object"&&N!==null&&N.$$typeof===p}var d=Q,p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),b=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),I=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=Object.prototype.hasOwnProperty,M=Array.isArray,R=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(N){return N()}};var D,L={},P=d.react_stack_bottom_frame.bind(d,a)(),O=R(n(a)),$={};w1.Fragment=m,w1.jsx=function(N,U,j){var B=1e4>I.recentlyCreatedOwnerStacks++;return u(N,U,j,!1,B?Error("react-stack-top-frame"):P,B?R(n(N)):O)},w1.jsxs=function(N,U,j){var B=1e4>I.recentlyCreatedOwnerStacks++;return u(N,U,j,!0,B?Error("react-stack-top-frame"):P,B?R(n(N)):O)}})()),w1}var gR;function due(){return gR||(gR=1,process.env.NODE_ENV==="production"?t2.exports=hue():t2.exports=fue()),t2.exports}var V=due();function pue(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function hS(){return hS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hS.apply(null,arguments)}function G7(t,e){return G7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},G7(t,e)}function gue(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,G7(t,e)}function V5(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var r2={};var mR;function mue(){if(mR)return r2;mR=1;var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,i=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;r2.format=s,r2.parse=o;function s(h){if(!h||typeof h!="object")throw new TypeError("argument obj is required");var f=h.parameters,d=h.type;if(!d||!a.test(d))throw new TypeError("invalid type");var p=d;if(f&&typeof f=="object")for(var g,m=Object.keys(f).sort(),v=0;v<m.length;v++){if(g=m[v],!r.test(g))throw new TypeError("invalid parameter name");p+="; "+g+"="+c(f[g])}return p}function o(h){if(!h)throw new TypeError("argument string is required");var f=typeof h=="object"?l(h):h;if(typeof f!="string")throw new TypeError("argument string is required to be a string");var d=f.indexOf(";"),p=d!==-1?f.slice(0,d).trim():f.trim();if(!a.test(p))throw new TypeError("invalid media type");var g=new u(p.toLowerCase());if(d!==-1){var m,v,y;for(t.lastIndex=d;v=t.exec(f);){if(v.index!==d)throw new TypeError("invalid parameter format");d+=v[0].length,m=v[1].toLowerCase(),y=v[2],y.charCodeAt(0)===34&&(y=y.slice(1,-1),y.indexOf("\\")!==-1&&(y=y.replace(n,"$1"))),g.parameters[m]=y}if(d!==f.length)throw new TypeError("invalid parameter format")}return g}function l(h){var f;if(typeof h.getHeader=="function"?f=h.getHeader("content-type"):typeof h.headers=="object"&&(f=h.headers&&h.headers["content-type"]),typeof f!="string")throw new TypeError("content-type header is missing from object");return f}function c(h){var f=String(h);if(r.test(f))return f;if(f.length>0&&!e.test(f))throw new TypeError("invalid parameter value");return'"'+f.replace(i,"\\$1")+'"'}function u(h){this.parameters=Object.create(null),this.type=h}return r2}var vue=mue(),Jp=new Map,BW=function(e){return e.cloneNode(!0)},vR=function(){return window.location.protocol==="file:"},FW=function(e,r,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&i.readyState===2){var a=i.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var s=vue.parse(a).type;if(!(s==="image/svg+xml"||s==="text/plain"))throw new Error("Invalid content type: ".concat(s))}if(i.readyState===4){if(i.status===404||i.responseXML===null)throw new Error(vR()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(i.status===200||vR()&&i.status===0)n(null,i);else throw new Error("There was a problem injecting the SVG: "+i.status+" "+i.statusText)}}catch(o){if(i.abort(),o instanceof Error)n(o,i);else throw o}},i.open("GET",e),i.withCredentials=r,i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()},Sh={},yR=function(e,r){Sh[e]=Sh[e]||[],Sh[e].push(r)},yue=function(e){for(var r=function(s,o){setTimeout(function(){if(Array.isArray(Sh[e])){var l=Jp.get(e),c=Sh[e][s];l instanceof SVGSVGElement&&c(null,BW(l)),l instanceof Error&&c(l),s===Sh[e].length-1&&delete Sh[e]}},0)},n=0,i=Sh[e].length;n<i;n++)r(n)},xue=function(e,r,n){if(Jp.has(e)){var i=Jp.get(e);if(i===void 0){yR(e,n);return}if(i instanceof SVGSVGElement){n(null,BW(i));return}}Jp.set(e,void 0),yR(e,n),FW(e,r,function(a,s){var o;a?Jp.set(e,a):((o=s.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Jp.set(e,s.responseXML.documentElement),yue(e)})},bue=function(e,r,n){FW(e,r,function(i,a){var s;i?n(i):((s=a.responseXML)===null||s===void 0?void 0:s.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},wue=0,_ue=function(){return++wue},El=[],xR={},Sue="http://www.w3.org/2000/svg",U5="http://www.w3.org/1999/xlink",bR=function(e,r,n,i,a,s,o){var l=e.getAttribute("data-src")||e.getAttribute("src");if(!l){o(new Error("Invalid data-src or src attribute"));return}if(El.indexOf(e)!==-1){El.splice(El.indexOf(e),1),e=null;return}El.push(e),e.setAttribute("src","");var c=i?xue:bue;c(l,a,function(u,h){if(!h){El.splice(El.indexOf(e),1),e=null,o(u);return}var f=e.getAttribute("id");f&&h.setAttribute("id",f);var d=e.getAttribute("title");d&&h.setAttribute("title",d);var p=e.getAttribute("width");p&&h.setAttribute("width",p);var g=e.getAttribute("height");g&&h.setAttribute("height",g);var m=Array.from(new Set(V5(V5(V5([],(h.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();h.setAttribute("class",m);var v=e.getAttribute("style");v&&h.setAttribute("style",v),h.setAttribute("data-src",l);var y=[].filter.call(e.attributes,function(P){return/^data-\w[\w-]*$/.test(P.name)});if(Array.prototype.forEach.call(y,function(P){P.name&&P.value&&h.setAttribute(P.name,P.value)}),n){var x={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},b,w,_,S,C;Object.keys(x).forEach(function(P){b=P,_=x[P],w=h.querySelectorAll(b+"[id]");for(var O=function(j,B){S=w[j].id,C=S+"-"+_ue();var q;Array.prototype.forEach.call(_,function(ie){q=h.querySelectorAll("["+ie+'*="'+S+'"]');for(var me=0,oe=q.length;me<oe;me++){var ne=q[me].getAttribute(ie);ne&&!ne.match(new RegExp('url\\("?#'+S+'"?\\)'))||q[me].setAttribute(ie,"url(#"+C+")")}});for(var W=h.querySelectorAll("[*|href]"),X=[],K=0,G=W.length;K<G;K++){var H=W[K].getAttributeNS(U5,"href");H&&H.toString()==="#"+w[j].id&&X.push(W[K])}for(var Y=0,J=X.length;Y<J;Y++)X[Y].setAttributeNS(U5,"href","#"+C);w[j].id=C},$=0,N=w.length;$<N;$++)O($)})}h.removeAttribute("xmlns:a");for(var T=h.querySelectorAll("script"),A=[],k,I,E=0,M=T.length;E<M;E++)I=T[E].getAttribute("type"),(!I||I==="application/ecmascript"||I==="application/javascript"||I==="text/javascript")&&(k=T[E].innerText||T[E].textContent,k&&A.push(k),h.removeChild(T[E]));if(A.length>0&&(r==="always"||r==="once"&&!xR[l])){for(var R=0,D=A.length;R<D;R++)new Function(A[R])(window);xR[l]=!0}var L=h.querySelectorAll("style");if(Array.prototype.forEach.call(L,function(P){P.textContent+=""}),h.setAttribute("xmlns",Sue),h.setAttribute("xmlns:xlink",U5),s(h),!e.parentNode){El.splice(El.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(h,e),El.splice(El.indexOf(e),1),e=null,o(null,h)})},Cue=function(e,r){var n=r===void 0?{}:r,i=n.afterAll,a=i===void 0?function(){}:i,s=n.afterEach,o=s===void 0?function(){}:s,l=n.beforeEach,c=l===void 0?function(){}:l,u=n.cacheRequests,h=u===void 0?!0:u,f=n.evalScripts,d=f===void 0?"never":f,p=n.httpRequestWithCredentials,g=p===void 0?!1:p,m=n.renumerateIRIElements,v=m===void 0?!0:m;if(e&&"length"in e)for(var y=0,x=0,b=e.length;x<b;x++)bR(e[x],d,v,h,g,c,function(w,_){o(w,_),e&&"length"in e&&e.length===++y&&a(y)});else e?bR(e,d,v,h,g,c,function(w,_){o(w,_),a(1),e=null}):a(0)},n2={exports:{}},i2={exports:{}},$r={};var wR;function Aue(){if(wR)return $r;wR=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,o=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,d=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function x(w){if(typeof w=="object"&&w!==null){var _=w.$$typeof;switch(_){case e:switch(w=w.type,w){case l:case c:case n:case a:case i:case h:return w;default:switch(w=w&&w.$$typeof,w){case o:case u:case p:case d:case s:return w;default:return _}}case r:return _}}}function b(w){return x(w)===c}return $r.AsyncMode=l,$r.ConcurrentMode=c,$r.ContextConsumer=o,$r.ContextProvider=s,$r.Element=e,$r.ForwardRef=u,$r.Fragment=n,$r.Lazy=p,$r.Memo=d,$r.Portal=r,$r.Profiler=a,$r.StrictMode=i,$r.Suspense=h,$r.isAsyncMode=function(w){return b(w)||x(w)===l},$r.isConcurrentMode=b,$r.isContextConsumer=function(w){return x(w)===o},$r.isContextProvider=function(w){return x(w)===s},$r.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},$r.isForwardRef=function(w){return x(w)===u},$r.isFragment=function(w){return x(w)===n},$r.isLazy=function(w){return x(w)===p},$r.isMemo=function(w){return x(w)===d},$r.isPortal=function(w){return x(w)===r},$r.isProfiler=function(w){return x(w)===a},$r.isStrictMode=function(w){return x(w)===i},$r.isSuspense=function(w){return x(w)===h},$r.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===c||w===a||w===i||w===h||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===p||w.$$typeof===d||w.$$typeof===s||w.$$typeof===o||w.$$typeof===u||w.$$typeof===m||w.$$typeof===v||w.$$typeof===y||w.$$typeof===g)},$r.typeOf=x,$r}var zr={};var _R;function Tue(){return _R||(_R=1,process.env.NODE_ENV!=="production"&&(function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,o=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,d=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function x(J){return typeof J=="string"||typeof J=="function"||J===n||J===c||J===a||J===i||J===h||J===f||typeof J=="object"&&J!==null&&(J.$$typeof===p||J.$$typeof===d||J.$$typeof===s||J.$$typeof===o||J.$$typeof===u||J.$$typeof===m||J.$$typeof===v||J.$$typeof===y||J.$$typeof===g)}function b(J){if(typeof J=="object"&&J!==null){var ie=J.$$typeof;switch(ie){case e:var me=J.type;switch(me){case l:case c:case n:case a:case i:case h:return me;default:var oe=me&&me.$$typeof;switch(oe){case o:case u:case p:case d:case s:return oe;default:return ie}}case r:return ie}}}var w=l,_=c,S=o,C=s,T=e,A=u,k=n,I=p,E=d,M=r,R=a,D=i,L=h,P=!1;function O(J){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(J)||b(J)===l}function $(J){return b(J)===c}function N(J){return b(J)===o}function U(J){return b(J)===s}function j(J){return typeof J=="object"&&J!==null&&J.$$typeof===e}function B(J){return b(J)===u}function q(J){return b(J)===n}function W(J){return b(J)===p}function X(J){return b(J)===d}function K(J){return b(J)===r}function G(J){return b(J)===a}function H(J){return b(J)===i}function Y(J){return b(J)===h}zr.AsyncMode=w,zr.ConcurrentMode=_,zr.ContextConsumer=S,zr.ContextProvider=C,zr.Element=T,zr.ForwardRef=A,zr.Fragment=k,zr.Lazy=I,zr.Memo=E,zr.Portal=M,zr.Profiler=R,zr.StrictMode=D,zr.Suspense=L,zr.isAsyncMode=O,zr.isConcurrentMode=$,zr.isContextConsumer=N,zr.isContextProvider=U,zr.isElement=j,zr.isForwardRef=B,zr.isFragment=q,zr.isLazy=W,zr.isMemo=X,zr.isPortal=K,zr.isProfiler=G,zr.isStrictMode=H,zr.isSuspense=Y,zr.isValidElementType=x,zr.typeOf=b})()),zr}var SR;function $W(){return SR||(SR=1,process.env.NODE_ENV==="production"?i2.exports=Aue():i2.exports=Tue()),i2.exports}var j5,CR;function kue(){if(CR)return j5;CR=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return j5=i()?Object.assign:function(a,s){for(var o,l=n(a),c,u=1;u<arguments.length;u++){o=Object(arguments[u]);for(var h in o)e.call(o,h)&&(l[h]=o[h]);if(t){c=t(o);for(var f=0;f<c.length;f++)r.call(o,c[f])&&(l[c[f]]=o[c[f]])}}return l},j5}var H5,AR;function xI(){if(AR)return H5;AR=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return H5=t,H5}var G5,TR;function zW(){return TR||(TR=1,G5=Function.call.bind(Object.prototype.hasOwnProperty)),G5}var W5,kR;function Eue(){if(kR)return W5;kR=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=xI(),r={},n=zW();t=function(a){var s="Warning: "+a;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(a,s,o,l,c){if(process.env.NODE_ENV!=="production"){for(var u in a)if(n(a,u)){var h;try{if(typeof a[u]!="function"){var f=Error((l||"React class")+": "+o+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}h=a[u](s,u,l,o,null,e)}catch(p){h=p}if(h&&!(h instanceof Error)&&t((l||"React class")+": type specification of "+o+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in r)){r[h.message]=!0;var d=c?c():"";t("Failed "+o+" type: "+h.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},W5=i,W5}var q5,ER;function Iue(){if(ER)return q5;ER=1;var t=$W(),e=kue(),r=xI(),n=zW(),i=Eue(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return q5=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function h($){var N=$&&(c&&$[c]||$[u]);if(typeof N=="function")return N}var f="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(),arrayOf:x,element:b(),elementType:w(),instanceOf:_,node:A(),objectOf:C,oneOf:S,oneOfType:T,shape:I,exact:E};function p($,N){return $===N?$!==0||1/$===1/N:$!==$&&N!==N}function g($,N){this.message=$,this.data=N&&typeof N=="object"?N:{},this.stack=""}g.prototype=Error.prototype;function m($){if(process.env.NODE_ENV!=="production")var N={},U=0;function j(q,W,X,K,G,H,Y){if(K=K||f,H=H||X,Y!==r){if(l){var J=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw J.name="Invariant Violation",J}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ie=K+":"+X;!N[ie]&&U<3&&(a("You are manually calling a React.PropTypes validation function for the `"+H+"` prop on `"+K+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),N[ie]=!0,U++)}}return W[X]==null?q?W[X]===null?new g("The "+G+" `"+H+"` is marked as required "+("in `"+K+"`, but its value is `null`.")):new g("The "+G+" `"+H+"` is marked as required in "+("`"+K+"`, but its value is `undefined`.")):null:$(W,X,K,G,H)}var B=j.bind(null,!1);return B.isRequired=j.bind(null,!0),B}function v($){function N(U,j,B,q,W,X){var K=U[j],G=D(K);if(G!==$){var H=L(K);return new g("Invalid "+q+" `"+W+"` of type "+("`"+H+"` supplied to `"+B+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return m(N)}function y(){return m(s)}function x($){function N(U,j,B,q,W){if(typeof $!="function")return new g("Property `"+W+"` of component `"+B+"` has invalid PropType notation inside arrayOf.");var X=U[j];if(!Array.isArray(X)){var K=D(X);return new g("Invalid "+q+" `"+W+"` of type "+("`"+K+"` supplied to `"+B+"`, expected an array."))}for(var G=0;G<X.length;G++){var H=$(X,G,B,q,W+"["+G+"]",r);if(H instanceof Error)return H}return null}return m(N)}function b(){function $(N,U,j,B,q){var W=N[U];if(!o(W)){var X=D(W);return new g("Invalid "+B+" `"+q+"` of type "+("`"+X+"` supplied to `"+j+"`, expected a single ReactElement."))}return null}return m($)}function w(){function $(N,U,j,B,q){var W=N[U];if(!t.isValidElementType(W)){var X=D(W);return new g("Invalid "+B+" `"+q+"` of type "+("`"+X+"` supplied to `"+j+"`, expected a single ReactElement type."))}return null}return m($)}function _($){function N(U,j,B,q,W){if(!(U[j]instanceof $)){var X=$.name||f,K=O(U[j]);return new g("Invalid "+q+" `"+W+"` of type "+("`"+K+"` supplied to `"+B+"`, expected ")+("instance of `"+X+"`."))}return null}return m(N)}function S($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),s;function N(U,j,B,q,W){for(var X=U[j],K=0;K<$.length;K++)if(p(X,$[K]))return null;var G=JSON.stringify($,function(Y,J){var ie=L(J);return ie==="symbol"?String(J):J});return new g("Invalid "+q+" `"+W+"` of value `"+String(X)+"` "+("supplied to `"+B+"`, expected one of "+G+"."))}return m(N)}function C($){function N(U,j,B,q,W){if(typeof $!="function")return new g("Property `"+W+"` of component `"+B+"` has invalid PropType notation inside objectOf.");var X=U[j],K=D(X);if(K!=="object")return new g("Invalid "+q+" `"+W+"` of type "+("`"+K+"` supplied to `"+B+"`, expected an object."));for(var G in X)if(n(X,G)){var H=$(X,G,B,q,W+"."+G,r);if(H instanceof Error)return H}return null}return m(N)}function T($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var N=0;N<$.length;N++){var U=$[N];if(typeof U!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(U)+" at index "+N+"."),s}function j(B,q,W,X,K){for(var G=[],H=0;H<$.length;H++){var Y=$[H],J=Y(B,q,W,X,K,r);if(J==null)return null;J.data&&n(J.data,"expectedType")&&G.push(J.data.expectedType)}var ie=G.length>0?", expected one of type ["+G.join(", ")+"]":"";return new g("Invalid "+X+" `"+K+"` supplied to "+("`"+W+"`"+ie+"."))}return m(j)}function A(){function $(N,U,j,B,q){return M(N[U])?null:new g("Invalid "+B+" `"+q+"` supplied to "+("`"+j+"`, expected a ReactNode."))}return m($)}function k($,N,U,j,B){return new g(($||"React class")+": "+N+" type `"+U+"."+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+B+"`.")}function I($){function N(U,j,B,q,W){var X=U[j],K=D(X);if(K!=="object")return new g("Invalid "+q+" `"+W+"` of type `"+K+"` "+("supplied to `"+B+"`, expected `object`."));for(var G in $){var H=$[G];if(typeof H!="function")return k(B,q,W,G,L(H));var Y=H(X,G,B,q,W+"."+G,r);if(Y)return Y}return null}return m(N)}function E($){function N(U,j,B,q,W){var X=U[j],K=D(X);if(K!=="object")return new g("Invalid "+q+" `"+W+"` of type `"+K+"` "+("supplied to `"+B+"`, expected `object`."));var G=e({},U[j],$);for(var H in G){var Y=$[H];if(n($,H)&&typeof Y!="function")return k(B,q,W,H,L(Y));if(!Y)return new g("Invalid "+q+" `"+W+"` key `"+H+"` supplied to `"+B+"`.\nBad object: "+JSON.stringify(U[j],null," ")+`
7
- Valid keys: `+JSON.stringify(Object.keys($),null," "));var J=Y(X,H,B,q,W+"."+H,r);if(J)return J}return null}return m(N)}function M($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(M);if($===null||o($))return!0;var N=h($);if(N){var U=N.call($),j;if(N!==$.entries){for(;!(j=U.next()).done;)if(!M(j.value))return!1}else for(;!(j=U.next()).done;){var B=j.value;if(B&&!M(B[1]))return!1}}else return!1;return!0;default:return!1}}function R($,N){return $==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function D($){var N=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":R(N,$)?"symbol":N}function L($){if(typeof $>"u"||$===null)return""+$;var N=D($);if(N==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return N}function P($){var N=L($);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function O($){return!$.constructor||!$.constructor.name?f:$.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},q5}var X5,IR;function Due(){if(IR)return X5;IR=1;var t=xI();function e(){}function r(){}return r.resetWarningCache=e,X5=function(){function n(s,o,l,c,u,h){if(h!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},X5}var DR;function Mue(){if(DR)return n2.exports;if(DR=1,process.env.NODE_ENV!=="production"){var t=$W(),e=!0;n2.exports=Iue()(t.isElement,e)}else n2.exports=Due()();return n2.exports}var hi=Mue(),Lue=function(e){var r=e?.ownerDocument||document;return r.defaultView||window},Pue=function(e,r){for(var n in e)if(!(n in r))return!0;for(var i in r)if(e[i]!==r[i])return!0;return!1},Rue=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],a2="http://www.w3.org/2000/svg",MR="http://www.w3.org/1999/xlink",bI=(function(t){function e(){for(var n,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=t.call.apply(t,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}gue(e,t);var r=e.prototype;return r.renderSVG=function(){var i=this;if(this.reactWrapper instanceof Lue(this.reactWrapper).Node){var a=this.props,s=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,u=a.src,h=a.title,f=a.useRequestCache,d=this.props.onError,p=this.props.beforeInjection,g=this.props.afterInjection,m=this.props.wrapper,v,y;m==="svg"?(v=document.createElementNS(a2,m),v.setAttribute("xmlns",a2),v.setAttribute("xmlns:xlink",MR),y=document.createElementNS(a2,m)):(v=document.createElement(m),y=document.createElement(m)),v.appendChild(y),y.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(v);var x=function(S){if(i.removeSVG(),!i._isMounted){d(S);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){d(S)})},b=function(S,C){if(S){x(S);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{g(C)}catch(T){x(T)}})},w=function(S){if(S.setAttribute("role","img"),s){var C=S.querySelector(":scope > desc");C&&S.removeChild(C);var T=document.createElement("desc");T.innerHTML=s,S.prepend(T)}if(h){var A=S.querySelector(":scope > title");A&&S.removeChild(A);var k=document.createElement("title");k.innerHTML=h,S.prepend(k)}try{p(S)}catch(I){x(I)}};Cue(y,{afterEach:b,beforeEach:w,cacheRequests:f,evalScripts:o,httpRequestWithCredentials:l,renumerateIRIElements:c})}},r.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},r.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},r.componentDidUpdate=function(i){var a=this;Pue(hS({},i),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},r.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},r.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var a=i.fallback;i.httpRequestWithCredentials;var s=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var o=i.wrapper,l=pue(i,Rue),c=o;return e2.createElement(c,hS({},l,{ref:this.refCallback},o==="svg"?{xmlns:a2,xmlnsXlink:MR}:{}),this.state.isLoading&&s&&e2.createElement(s,null),this.state.hasError&&a&&e2.createElement(a,null))},e})(e2.Component);bI.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};bI.propTypes={afterInjection:hi.func,beforeInjection:hi.func,desc:hi.string,evalScripts:hi.oneOf(["always","once","never"]),fallback:hi.oneOfType([hi.func,hi.object,hi.string]),httpRequestWithCredentials:hi.bool,loading:hi.oneOfType([hi.func,hi.object,hi.string]),onError:hi.func,renumerateIRIElements:hi.bool,src:hi.string.isRequired,title:hi.string,useRequestCache:hi.bool,wrapper:hi.oneOf(["div","span","svg"])};let W7={assets:"/"};const Nue=t=>{W7={...W7,...t}},Oue=t=>{const e=`${W7.assets}/${t}`.replace(/\/+/g,"/");return e.endsWith(".svg")?e:e+".svg"},lp={"smp-icon":"_smp-icon_1p89h_1","smp-icon-rotated":"_smp-icon-rotated_1p89h_10","smp-icon-base":"_smp-icon-base_1p89h_14","smp-icon-interactable":"_smp-icon-interactable_1p89h_17","smp-icon-onBase":"_smp-icon-onBase_1p89h_30","smp-icon-primary":"_smp-icon-primary_1p89h_35","smp-icon-onPrimary":"_smp-icon-onPrimary_1p89h_39","smp-icon-info":"_smp-icon-info_1p89h_44","smp-icon-onInfo":"_smp-icon-onInfo_1p89h_48","smp-icon-onInfoLight":"_smp-icon-onInfoLight_1p89h_52","smp-icon-danger":"_smp-icon-danger_1p89h_58","smp-icon-onDanger":"_smp-icon-onDanger_1p89h_62","smp-icon-onDangerLight":"_smp-icon-onDangerLight_1p89h_66","smp-icon-warning":"_smp-icon-warning_1p89h_72","smp-icon-onWarning":"_smp-icon-onWarning_1p89h_76","smp-icon-onWarningLight":"_smp-icon-onWarningLight_1p89h_80","smp-icon-success":"_smp-icon-success_1p89h_85","smp-icon-onSuccess":"_smp-icon-onSuccess_1p89h_89","smp-icon-onSuccessLight":"_smp-icon-onSuccessLight_1p89h_93","smp-icon-spin":"_smp-icon-spin_1p89h_101","smp-image-interactable":"_smp-image-interactable_1p89h_106"},Dr=Q.memo(({icon:t,width:e,height:r,placeholderIcon:n,color:i,disabled:a,state:s="base",rotated:o=!1,onClick:l,isInteractable:c=!1,spin:u=!1,title:h,tabIndex:f,link:d})=>{const[p,g]=Q.useState(!1),m=I=>I?.toLowerCase().endsWith(".svg")||!I?.includes("/"),v=I=>I?.startsWith("http")||I?.startsWith("/"),y={img:`${lp[c?"smp-image-interactable":""]}`,svg:`${lp["smp-icon"]} ${s?`${lp[`smp-icon-${s}`]}`:""} ${o?lp["smp-icon-rotated"]:""} ${c?lp["smp-icon-interactable"]:""} ${u?lp["smp-icon-spin"]:""}`},x=I=>{!a&&c&&l&&l(I)},b=I=>{!a&&c&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),x(I))},w=p?n:t,_=m(w),C=v(w)?w:Oue(`assets/svg/${w}`),T=()=>V.jsx(bI,{src:C,onError:()=>g(!0),width:e||"0.875rem",height:r||"0.875rem",wrapper:"svg",title:h,role:"application",fill:i,"aria-disabled":a,className:y.svg,onClick:x,onKeyDown:b,tabIndex:f}),A=()=>V.jsx("img",{src:w,width:e||"14px",height:r||"auto",alt:h,onError:()=>g(!0),onClick:x,className:y.img,title:h,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&x(I)}});return(()=>{const I=d?.startsWith("https://")||d?.startsWith("http://")||d?.startsWith("#")||d?.startsWith("/"),E=_?T():A(),M=h?V.jsx("span",{title:h,children:E}):E;return I?V.jsx("a",{href:d,children:M}):M})()});function Po({children:t}){return Q.useSyncExternalStore(()=>()=>{},()=>!0,()=>!1)?lue.createPortal(t,document.body):null}function Ro({position:t="bottom",open:e=!1}){const r=Q.useRef(null),n=Q.useRef(null),i=Q.useRef(null),[a,s]=Q.useState(0),o=Q.useCallback(()=>{const l=r.current,c=n.current;if(!l||!c)return;const{top:u,left:h,width:f,height:d}=l.getBoundingClientRect();s(f);const p=c.offsetHeight,g=c.offsetWidth;if(g===0||p===0){i.current&&requestAnimationFrame(i.current);return}const m=window.scrollY,v=window.scrollX,y=window.innerWidth,x=window.innerHeight;let b=u+m,w=h+v,_=t;const S={top:u-p<0,bottom:u+d+p>x,left:h-g<0,right:h+f+g>y};switch(t){case"top":S.top&&!S.bottom&&(_="bottom");break;case"bottom":S.bottom&&!S.top&&(_="top");break;case"left":S.left&&!S.right&&(_="right");break;case"right":S.right&&!S.left&&(_="left");break}switch(_){case"top":b=u+m-p;break;case"bottom":b=u+m+d;break;case"left":w=h+v-g;break;case"right":w=h+v+f;break}b=Math.max(m,Math.min(b,m+x-p)),w=Math.max(v,Math.min(w,v+y-g)),requestAnimationFrame(()=>{c.style.transform=`translate(${w}px, ${b}px)`,c.style.opacity="1"})},[t]);return Q.useLayoutEffect(()=>{i.current=o},[o]),Q.useLayoutEffect(()=>{if(!e)return;let l;const c=()=>{const h=r.current,f=n.current;h&&f?o():l=requestAnimationFrame(c)};l=requestAnimationFrame(c);const u=new MutationObserver(()=>{o()});return n.current&&u.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{cancelAnimationFrame(l),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),u.disconnect()}},[o,e]),{anchorRef:r,targetRef:n,anchorWidth:a}}const Y5={"smp-label":"_smp-label_zl3eb_1","smp-label-disabled":"_smp-label-disabled_zl3eb_6","smp-label-wrapper":"_smp-label-wrapper_zl3eb_10"},K5={"smp-helper-text":"_smp-helper-text_19lg0_1","smp-helper-text-danger":"_smp-helper-text-danger_19lg0_5","smp-helper-text-success":"_smp-helper-text-success_19lg0_9","smp-helper-text-disabled":"_smp-helper-text-disabled_19lg0_13"},B0=({helperText:t,disabled:e,state:r,id:n})=>{const i={container:`${K5["smp-helper-text"]} ${e?K5["smp-helper-text-disabled"]:""} ${r?K5[`smp-helper-text-${r}`]:""}`};return V.jsx("label",{className:i.container,id:n,children:t})},Bue={"smp-helper-tooltip":"_smp-helper-tooltip_2mlq3_1"},Fue=({helperTooltip:t,ref:e})=>{const r={container:`${Bue["smp-helper-tooltip"]}`};return V.jsx("div",{className:r.container,ref:e,children:V.jsx(B0,{helperText:t})})},No=({label:t,disabled:e,htmlFor:r,helper:n=""})=>{const[i,a]=Q.useState(!1),{anchorRef:s,targetRef:o}=Ro({position:"right",open:i}),l={container:`${Y5["smp-label"]} ${e?Y5["smp-label-disabled"]:""}`,labelWrapper:Y5["smp-label-wrapper"]};return V.jsxs("div",{className:l.labelWrapper,children:[V.jsx("label",{className:l.container,htmlFor:r,children:t}),n&&V.jsx("div",{ref:s,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:V.jsx(Dr,{icon:"info_outline",tabIndex:0,width:14,isInteractable:!0,onClick:()=>{a(c=>!c)}})}),V.jsx(Po,{children:i&&n&&V.jsx(Fue,{helperTooltip:n,ref:o})})]})},us={"smp-layout":"_smp-layout_12t3b_1","smp-layout-horizontal":"_smp-layout-horizontal_12t3b_9","smp-layout-vertical":"_smp-layout-vertical_12t3b_15","smp-layout-section-grid":"_smp-layout-section-grid_12t3b_20","smp-layout-section-vertical":"_smp-layout-section-vertical_12t3b_24","smp-layout-section-horizontal":"_smp-layout-section-horizontal_12t3b_28","smp-layout-cell-container":"_smp-layout-cell-container_12t3b_33","smp-layout-section-flex":"_smp-layout-section-flex_12t3b_37","smp-grid-template-cols":"_smp-grid-template-cols_12t3b_56","smp-grid-template-rows":"_smp-grid-template-rows_12t3b_60","smp-layout-section-with-title":"_smp-layout-section-with-title_12t3b_64","smp-layout-section-title":"_smp-layout-section-title_12t3b_70","smp-layout-inline":"_smp-layout-inline_12t3b_76"},$ue=(t,e)=>{const r=[];for(let n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return r},VW=(t,e)=>t.map(r=>{if(r.sections?.length)return{...r,sections:VW(r.sections,e),content:r.content};let n=r.sections,i=r.content;return r.content?.length&&r.columns&&+r.columns>1&&(n=$ue(r.content.filter(s=>e.includes(s.id||"")),+r.columns).map((s,o)=>({...r,id:`${r.id}-${o}`,content:s,horizontal:!0})),i=[]),{...r,sections:n,content:i}}),LR=(t,e)=>{if(!e)return{};const r=t.some(n=>n.dim)?t.map(n=>n.dim||"auto").join(" "):`repeat(${t.length}, 1fr)`;return{[e]:r}},PR=t=>t.some(e=>e.dim&&!e.dim.endsWith("%")),zue=(t,e)=>t.visible===!0?!0:t.visible===void 0?e?e.visible!==!1:!0:!1,Vue=()=>({getSectionPathId:t=>`section-${t.join("-")}`}),RR=t=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[t],Uue={base:{ghost:"base",outlined:"base",raised:"base"},danger:{ghost:"danger",outlined:"danger",raised:"onDanger"},primary:{ghost:"primary",outlined:"primary",raised:"onPrimary"}},NR=(t,e)=>Uue[t][e],jc={"smp-button-container":"_smp-button-container_navqi_1","smp-button-extraSmall":"_smp-button-extraSmall_navqi_18","smp-button-small":"_smp-button-small_navqi_23","smp-button-base":"_smp-button-base_navqi_28","smp-button-large":"_smp-button-large_navqi_33","smp-button-extraLarge":"_smp-button-extraLarge_navqi_38","smp-button-FullWidth":"_smp-button-FullWidth_navqi_43","smp-button-squared":"_smp-button-squared_navqi_47","smp-buttonType-raised":"_smp-buttonType-raised_navqi_54","smp-buttonVariant-base":"_smp-buttonVariant-base_navqi_56","smp-buttonActive":"_smp-buttonActive_navqi_78","smp-buttonVariant-primary":"_smp-buttonVariant-primary_navqi_85","smp-buttonVariant-danger":"_smp-buttonVariant-danger_navqi_114","smp-buttonExt-oneButton-horizontal":"_smp-buttonExt-oneButton-horizontal_navqi_154","smp-buttonExt-oneButton-vertical":"_smp-buttonExt-oneButton-vertical_navqi_164","smp-buttonType-outlined":"_smp-buttonType-outlined_navqi_187","smp-buttonType-ghost":"_smp-buttonType-ghost_navqi_257"},Yr=t=>t==null?!1:typeof t=="string"?t.toLocaleLowerCase()=="yes"||t.toLocaleLowerCase()=="true":t,jue={success:"onSuccessLight",info:"onInfoLight",error:"onDangerLight",warning:"onWarningLight"},OR={"smp-badge":"_smp-badge_1r96t_2","smp-badge-text":"_smp-badge-text_1r96t_19"};function BR(t,e){return new RegExp(Hue(t),e)}function Hue(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q7(t){if(!t)return{};const e={};let r="",n="",i=0,a=!0;for(const s of t)a&&s!=="("&&s!==")"?r+=s:s==="("?(i===0?a=!1:n+=s,i++):s===")"?(i===1?(e[r.trim()]=n,a=!0,r="",n=""):n+=s,i--):n+=s;return e}const Gue=t=>{if(!t||typeof t!="string")return s2({});try{const e=q7(t);if(e?.B&&typeof e.B=="string"){const r=q7(e.B);return s2(r)}return s2(e)}catch(e){return console.warn("Failed to parse badge string:",t,e),s2({})}},s2=t=>{const e=t||{},r=a=>a&&["success","info","error","warning"].includes(a)?a:"info",n=a=>a&&["TopRight","TopLeft","BottomRight","BottomLeft","Inline"].includes(a)?a:"TopRight";return{bindValue:(a=>!a||typeof a!="string"?"":a.trim())(e.Txt),type:r(e.Typ),position:n(e.Pos),color:e.Col?.trim()||"",icon:e.Ico?.trim()||""}},Wue={titleLarge:"h2",title:"h3",body:"h6",label:"label",code:"code",link:"a"},su={"smp-typography":"_smp-typography_vxkf1_1","smp-typography-body":"_smp-typography-body_vxkf1_8","smp-text-number":"_smp-text-number_vxkf1_11","smp-typography-title":"_smp-typography-title_vxkf1_16","smp-typography-titleLarge":"_smp-typography-titleLarge_vxkf1_20","smp-typography-label":"_smp-typography-label_vxkf1_24","smp-typography-disabled":"_smp-typography-disabled_vxkf1_29","smp-typography-left":"_smp-typography-left_vxkf1_33","smp-typography-center":"_smp-typography-center_vxkf1_37","smp-typography-right":"_smp-typography-right_vxkf1_41","smp-typography-toolbar":"_smp-typography-toolbar_vxkf1_51","smp-text-negative":"_smp-text-negative_vxkf1_56","smp-typography-ellipsis":"_smp-typography-ellipsis_vxkf1_61"},wI="smp-toolbar",que=["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter","Escape"," "],X7=t=>t.replace(`${wI}-`,"").split("-").map(e=>parseInt(e,10)).filter(e=>!isNaN(e)),Xue=t=>`${wI}-${t.filter(e=>!isNaN(e)).join("-")}`,fS=(t,e)=>e?`${e}-${t}`:`${wI}-${t}`,Yue=(t,e)=>e?`${e}-${t}`:`toolbar-item-${t}`,dS=t=>!!t.fun&&t.forcedLeaf===!1&&!(t.children&&t.children.length>0),Y7=(t,e,r,n)=>{if(!t||e.length===0)return t;const i={...t};i.children=[...t.children??[]];let a=i.children;const s=[],o=[];for(let l=0;l<e.length;l++){const c=e[l],u=a[c];if(!u)break;const h={...u};if(l===e.length-1){if(a[c]=r(h),n){const f=a.map((d,p)=>p===c?a[p]:n({...d}));if(l===0)i.children=f;else{const d=s[s.length-1],p=o[o.length-1];d[p]={...d[p],children:f}}}}else h.children=[...h.children??[]],a[c]=h,s.push(a),o.push(c),a=h.children}return i},m_=(t,e)=>{t.current.has(e)&&requestAnimationFrame(()=>{t.current.get(e)?.focus()})},UW=t=>(t.children?.length??0)>0;function Kue(t,e,r,n){return{handleKeyDown:Q.useCallback(async(a,s,o)=>{if(!que.includes(a.key))return;a.preventDefault(),a.stopPropagation();const l=e.current.get(o),c=X7(o);if(l)switch(a.key){case"ArrowDown":case"ArrowUp":{const h=c[c.length-1]+(a.key==="ArrowDown"?1:-1);if(h>=0){const f=o.split("-");f.pop();const d=`${f.join("-")}-${h}`;m_(e,d)}break}case"ArrowRight":{r(s,o),m_(e,fS(0,o));break}case"ArrowLeft":case"Escape":{c.pop();const u=Xue(c);e.current.has(u)&&(t(h=>h&&Y7(h,c,f=>({...f,isExpanded:!1}))),m_(e,u));break}case"Enter":{!UW(s)&&!dS(s)&&n?.(s);break}}},[r,e,t,n])}}const Ke={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BREADCRUMBS:"BRD",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",EDITOR:"EDT",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",LABEL:"LBL",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",MULTI_SELECT:"SML",MULTI_COMBOBOX:"CML",MULTI_CONFIG:"CFM",RADIO:"RAD",SELECT:"SEL",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",BUTTON_GROUP:"BTO",TIME:"TIM",TIMEPICKER:"TPK",FILE_UPLOAD:"FUP",PASSWORD:"PWD",TREE:"TRE"},zv={CODE_ONLY:"CodeOnly",DESC_ONLY:"DescOnly",BOTH:"Both"},_1={INFO:"INFO",ERROR:"ERROR",QUEST:"QUEST",WARNING:"WARNING",UNAUTHORIZED:"UNAUTHORIZED"},hg={TN:"TN",TM:"TM",PM:"PM",TS:"TS",TT:"TT"},Zue={ON_LOADING:"OnLoading"},Jue={obj:{t:"",p:"",k:""},fun:"",isEditable:!1,shape:Ke.TEXT_FIELD,icon:"error",value:"No data found"};function Que(t,e,r){const n=async(o,l)=>{if(!dS(o))a(l,{isExpanded:!0});else if(e){a(l,{isLoading:!0});try{const c=await e(o);a(l,{isLoading:!1,children:c?.children&&c.children.length>0?c.children:[Jue],isExpanded:!0},{isExpanded:!1})}catch(c){console.error("Failed to load dynamic node data:",c),a(l,{isLoading:!1})}}},i=o=>{a(o,{isExpanded:!1})},a=(o,l,c)=>{t(u=>u&&Y7(u,X7(o),f=>({...f,...l}),c?f=>({...f,...c}):void 0))};return{handleNodeExpand:n,handleMouseLeave:i,onToolbarRadioLeafNodeClick:(o,l,c)=>{t(u=>u&&Y7(u,X7(l),f=>{const d={...f,obj:{t:f.obj?.t||"",p:f.obj?.p||"",k:c.obj?.k||""}};return r?.(d),d}))}}}const jW=t=>{const e=Q.useRef(null);return Q.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},t)}},fb=(t,e,r)=>{if(t==""&&(e==""||e==null))return"";if(r)switch(r){case"CodeOnly":return t||"";case"DescOnly":return e||"";case"Both":return`${t}${e?` - ${e}`:""}`}return t||""},Z5={key:"f4",ctrlKey:!1,altKey:!1},eo={"smp-textfield-wrapper":"_smp-textfield-wrapper_1ib4r_4","smp-textfield":"_smp-textfield_1ib4r_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_1ib4r_31","smp-textfield-extraSmall":"_smp-textfield-extraSmall_1ib4r_37","smp-textfield-small":"_smp-textfield-small_1ib4r_42","smp-textfield-base":"_smp-textfield-base_1ib4r_47","smp-textfield-large":"_smp-textfield-large_1ib4r_52","smp-textfield-extraLarge":"_smp-textfield-extraLarge_1ib4r_57","smp-textfield-input":"_smp-textfield-input_1ib4r_63","smp-textfield-decode-wrapper":"_smp-textfield-decode-wrapper_1ib4r_84","smp-textfield-outlined":"_smp-textfield-outlined_1ib4r_93","smp-textfield-danger":"_smp-textfield-danger_1ib4r_104","smp-textfield-disabled":"_smp-textfield-disabled_1ib4r_111","smp-textfield-FullWidth":"_smp-textfield-FullWidth_1ib4r_120","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_1ib4r_124"},Vm=Q.createContext({}),ehe=()=>Q.useContext(Vm),ia=({id:t,disabled:e=!1,bindValue:r,optionalDisplayValue:n,icon:i,placeholder:a,isEditable:s=!0,shapeIcon:o,sizing:l="base",state:c,variant:u,tooltip:h=!1,rotatedShapeIcon:f=!1,ref:d,inputRef:p,inputType:g="text",ariaLabel:m="input field",label:v,helperText:y=!1,error:x,appearance:b="base",isClearable:w=!1,FullWidth:_="No",_dataComponent:S="textfield",min:C,max:T,step:A,inputMode:k="text",width:I,autocomplete:E,size:M,maxLength:R,style:D,DescrMode:L="Both",hasAdvanceResearch:P=!0,onBlur:O,onChange:$,onKeyDown:N,onEnter:U,onShapeIconClick:j,onClick:B,onAdvanceResearchActivation:q,...W})=>{const[X,K]=Q.useState(!1),[G,H]=Q.useState(void 0),{anchorRef:Y,targetRef:J}=Ro({position:"bottom",open:X}),ie=Q.useId(),me=`${ie}-helper`,oe=x?"danger":c,ne=y||!!x,de=Ot=>{$?.({bindValue:Ot.target.value})},ve=()=>{r&&r!=""&&$?.({bindValue:""})},Ne=Ot=>{if(Ot.key.toLowerCase()===Z5.key.toLowerCase()&&Z5.ctrlKey===Ot.ctrlKey&&Z5.altKey===Ot.altKey&&P&&(Ot.preventDefault(),Ot.stopPropagation(),H(void 0),K(!0),q?.()),Ot.altKey&&Ot.key.toLowerCase()!=="alt"&&P){Ot.preventDefault(),Ot.stopPropagation();const xr=`Alt+${Ot.key===" "?"space":Ot.key.toUpperCase()}`;H(xr),K(!0),q?.()}Ot.key=="Enter"&&U?.({bindValue:r}),N?.(Ot)},{onAdvanceResearchLoadInitialData:ke,onAdvanceResearchLeafNodeClick:Le,advanceResearchAutoSelect:$e}=ehe(),Ee=Ot=>{if(Le){const Ea=p&&"current"in p&&p.current?p.current.value:r;Le(Ot,Ea)}K(!1)},pe=()=>{if(ke){const Ot=W.obj??{t:"",p:"",k:""};return ke(t||"",Ot,G)}return Promise.resolve({type:"SmeupDataTree",children:[]})},Ve={wrapper:`${eo["smp-textfield-wrapper"]} ${Yr(_)?eo["smp-textfield-FullWidth"]:""}`,container:`${eo["smp-textfield"]} ${e||!s?eo["smp-textfield-disabled"]:""} ${a?eo["smp-textfield-placeholder"]:""} ${l?eo[`smp-textfield-${l}`]:""} ${oe?eo[`smp-textfield-${oe}`]:""} ${b?eo[`smp-textfield-${b}`]:""} ${h?eo["smp-textfield-top-right-indicator"]:""}`,input:`${eo["smp-textfield-input"]}`,decodeWrapper:` ${n?eo["smp-textfield-decode-wrapper"]:""}`};if(u&&(u!=="notSelectable"||s)){const Ot=eo[`smp-textfield-variant-${u}`];Ot&&(Ve.container+=` ${Ot}`)}const qe=L==="DescOnly"?n||"":r,tt=I?{"--smp-textField-width-base":I,...D}:D,_t=V.jsxs("div",{className:Ve.container,ref:d,style:tt,children:[i&&V.jsx(Dr,{icon:i,disabled:e||!s}),V.jsx("input",{id:ie,name:t,type:g,value:qe,placeholder:a,onChange:de,onBlur:()=>O?.({bindValue:r}),className:Ve.input,disabled:e||!s,onKeyDown:Ne,"aria-label":m,ref:p,"aria-describedby":ne?me:void 0,min:C,max:T,step:A,inputMode:k,autoComplete:E,size:M,maxLength:R,onClick:B}),w&&V.jsx(Dr,{icon:"clear",onClick:ve,tabIndex:0,isInteractable:!0}),o&&V.jsx(Dr,{icon:o,disabled:e||!s,onClick:j,rotated:f,isInteractable:s,tabIndex:0})]});return V.jsxs("div",{className:Ve.wrapper,"data-component":S,children:[v&&V.jsx(No,{label:v,disabled:e||!s,htmlFor:ie,helper:W.helper}),V.jsxs("div",{className:Ve.decodeWrapper,ref:Y,children:[_t,L!="DescOnly"&&L!="CodeOnly"&&V.jsx(jn,{bindValue:n||"",disabled:e||!s,variant:"body",role:"note"}),X&&V.jsx(Po,{children:V.jsx(_I,{ref:J,autoSelect:$e,onToolbarLoadInitialData:pe,onToolbarLeafNodeClick:Ee,onToolbarClickOutside:()=>K(!1)})})]}),ne&&V.jsx(B0,{helperText:x,disabled:e||!s,state:oe,id:me})]})};function HW({items:t,itemHeight:e,containerHeight:r,overscan:n=5}){const[i,a]=Q.useState(0),s=Q.useRef(null),o=t.length*e,l=Math.max(0,Math.floor(i/e)-n),c=Math.min(t.length-1,Math.floor((i+r)/e)+n),u=[];for(let d=l;d<=c;d++)u.push({item:t[d],index:d,offsetTop:d*e});const h=Q.useCallback(d=>{const p=d.target.scrollTop;a(p)},[]),f=d=>{if(!s.current)return;const p=d*e,g=p+e,m=s.current,v=m.scrollTop,y=v+r;p<v?m.scrollTop=p:g>y&&(m.scrollTop=g-r)};return{virtualItems:u,containerProps:{ref:s,style:{maxHeight:`${r}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:h},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:i,viewportHeight:r,totalHeight:o,startIndex:l,endIndex:c},scrollToIndex:f}}function the(t,e,r="14px IBM Plex Sans, sans-serif",n=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=r;let s=0;for(const o of t){const l=fb(o.obj?.k,o.decode,e),c=a.measureText(l);s=Math.max(s,c.width)}return Math.ceil(s+n)}const cp={"smp-list":"_smp-list_krf6k_1","smp-list-floating":"_smp-list-floating_krf6k_8","smp-list-container":"_smp-list-container_krf6k_16","smp-list-listItem":"_smp-list-listItem_krf6k_23","smp-list-listItem-left":"_smp-list-listItem-left_krf6k_44"},rhe=10,V3=({id:t,options:e,DescrMode:r="Both",ref:n,showFilter:i,selectedIndex:a=null,activeIndex:s=[],width:o,onClick:l,onKeyDown:c,onOpen:u,isOpen:h,floating:f=!1,showLeadingIcon:d=!1})=>{const[p,g]=Q.useState(""),m=40,[v,y]=Q.useState(a!==null?a:-1),[x,b]=Q.useState(o||200),w=Q.useRef(null),_=Q.useRef(null),S=i!==void 0?i:e.length>rhe,C=Q.useMemo(()=>{if(!p)return e;const O=$=>typeof $=="string"&&$.toLowerCase().includes(p.toLowerCase());return e.filter($=>r==="CodeOnly"?O($.obj?.k):r==="DescOnly"?O($.decode):!!(O($.obj?.k)||O($.decode)))},[p,e,r]),T=O=>{g(O)},{virtualItems:A,containerProps:k,innerProps:I,scrollToIndex:E}=HW({items:C,itemHeight:m,containerHeight:200,overscan:5});Q.useEffect(()=>{a!==null&&a!==v&&y(a)},[a]),Q.useEffect(()=>{v>=0&&v<C.length&&E(v)},[v,C]),Q.useEffect(()=>{h&&(u?.(_?.current),w?.current&&w.current.focus())},[h,w,u]),Q.useEffect(()=>{const O=the(e,r);b(O)},[e,r]);const M=O=>{if(O.key==="ArrowDown"||O.key==="ArrowUp"){O.preventDefault();let $=v;O.key==="ArrowDown"?$=v<C.length-1?v+1:0:O.key==="ArrowUp"&&($=v>0?v-1:C.length-1),y($)}else O.key==="Enter"?v>=0&&v<C.length&&l?.(O,C[v]):O.key==="Escape"&&(O.preventDefault(),O.stopPropagation());c&&c(O)},R=O=>{M(O)},D=O=>{M(O)},L={wrapper:`${cp["smp-list"]} ${f?cp["smp-list-floating"]:""}`,container:`${cp["smp-list-container"]}`,virtualScroll:`${cp["smp-list-virtualScroll"]}`,listItem:`${cp["smp-list-listItem"]}`,listItemLeft:`${cp["smp-list-listItem-left"]}`},P=f?Math.max(o||0,200):o;return V.jsxs("div",{id:t,ref:n,className:L.wrapper,"data-component":"list",style:{width:f?x:"200px",minWidth:P},children:[S&&V.jsx(ia,{bindValue:p,placeholder:"Search...",FullWidth:"Yes",onChange:O=>T(O.bindValue),onKeyDown:R,inputRef:w}),V.jsx("div",{...k,className:L.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:D,"aria-activedescendant":v>=0&&v<C.length?C[v]?.obj?.k:void 0,children:V.jsx("div",{...I,className:L.virtualScroll,children:A.map(({item:O,index:$,offsetTop:N})=>{const U=O.obj?.k?s.includes(O.obj.k):!1;return V.jsxs("li",{ref:v===$?_:null,role:"option",id:$+"li","aria-selected":v===$?"true":"false",tabIndex:-1,className:`${L.listItem} ${v===$?"selected-item":""}`,"aria-label":O.obj?.k+"-"+O.decode,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${N}px)`},onClick:j=>{l?.(j,O),y($)},children:[V.jsxs("div",{className:L.listItemLeft,children:[d&&V.jsx(Dr,{icon:O.icon||"",width:16,placeholderIcon:O.placeholderIcon||""}),fb(O.obj?.k,O?.decode||O?.value,r)]}),U&&V.jsx(Dr,{icon:"check",width:16})]},$+"li")})})})]})},eu={"smp-floating-toolbar-container":"_smp-floating-toolbar-container_b75re_17","smp-toolbar-node-content":"_smp-toolbar-node-content_b75re_39","smp-clickable":"_smp-clickable_b75re_61","smp-not-clickable":"_smp-not-clickable_b75re_71","smp-toolbar-node-children-container":"_smp-toolbar-node-children-container_b75re_81","smp-expanded":"_smp-expanded_b75re_111","smp-toolbar-node":"_smp-toolbar-node_b75re_39","smp-toolbar-node-icon-text-container":"_smp-toolbar-node-icon-text-container_b75re_171","smp-toolbar-node-text":"_smp-toolbar-node-text_b75re_185"},nhe=({node:t,index:e,level:r,parentId:n,toolbarNodesRefs:i,handleKeyDown:a,handleNodeExpand:s,handleMouseLeave:o,onToolbarLeafNodeClick:l,onToolbarRadioLeafNodeClick:c,renderToolbarNodes:u})=>{const h=fS(e,n??""),f=UW(t),d=!f&&!t?.isLoading&&!dS(t),{anchorRef:p,targetRef:g}=Ro({open:t.isExpanded??!1,position:"right"}),m={node:eu["smp-toolbar-node"],nodeContent:eu["smp-toolbar-node-content"],clickable:eu["smp-clickable"],notClickable:eu["smp-not-clickable"],iconTextContainer:eu["smp-toolbar-node-icon-text-container"],nodeText:eu["smp-toolbar-node-text"],childrenContainer:eu["smp-toolbar-node-children-container"],expanded:eu["smp-expanded"]};return t?.shape===Ke.RADIO?V.jsx("div",{ref:v=>{v&&i.current.set(h,v)},className:m.node,role:"radiogroup","data-node-id":h,tabIndex:-1,"smp-id":Yue(e,n??""),children:V.jsx(V3,{options:t.options?t.options:[],isOpen:!0,"data-node-id":h,DescrMode:zv.DESC_ONLY,selectedIndex:t.options?.findIndex(v=>v.obj?.k===t.obj?.k),activeIndex:[t.obj.k],onClick:(v,y)=>{c(t,h,y)}},h)},h):V.jsx(V.Fragment,{children:V.jsxs("div",{ref:v=>{v&&i.current.set(h,v)},className:m.node,tabIndex:0,role:"menuitem","data-nodeid":h,"smp-id":`toolbar-item-${e}`,"aria-expanded":t?.isExpanded,onKeyDown:v=>a(v,t,h),onMouseEnter:()=>{s(t,h)},onMouseLeave:()=>{o(h)},onClick:()=>{d&&l?.(t)},children:[V.jsxs("div",{className:`${m.nodeContent} ${d?m.clickable:m.notClickable}`,ref:p,children:[V.jsxs("div",{className:m.iconTextContainer,children:[V.jsx(Dr,{icon:t.icon??""}),V.jsx("span",{className:m.nodeText,children:V.jsx(jn,{variant:"body",bindValue:t.value||""})})]}),t.isLoading?V.jsx(Dr,{icon:"spinner",spin:!0}):f||dS(t)?V.jsx(Dr,{icon:"chevron-right"}):V.jsx(Dr,{icon:""})]}),f&&V.jsx(Po,{children:V.jsx("div",{className:`${m.childrenContainer} ${t.isExpanded?m.expanded:""}`,ref:g,style:{"--smp-toolbar-z-index":`${1001+r}`},children:u(r+1,t.children??[],h)})})]},h)})},F0=(t,e,r)=>{Q.useEffect(()=>{if(!e)return;const n=i=>{t?.some(s=>{if(typeof s=="object"&&s!==null&&"current"in s){const o=s?.current;return o&&o.contains(i.target)}})||r()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t,r,e])},_I=({data:t,ref:e,autoSelect:r,onToolbarLoadNodeData:n,onToolbarLeafNodeClick:i,onToolbarLoadInitialData:a,onToolbarClickOutside:s})=>{const o=Q.useRef(new Map),[l,c]=Q.useState([]),[u,h]=Q.useState(t),f=Q.useCallback(b=>{b?.current&&c(w=>w.some(_=>_.current===b.current)?w:[...w,b])},[]);F0(l,!0,()=>{c([]),s?.()}),Q.useEffect(()=>{u&&o.current.forEach(b=>{b&&f({current:b})})},[u,f]);const{handleNodeExpand:d,handleMouseLeave:p,onToolbarRadioLeafNodeClick:g}=Que(h,n,i),{handleKeyDown:m}=Kue(h,o,d,i),v=jW(400),y={floatingContainer:eu["smp-floating-toolbar-container"]};Q.useEffect(()=>{if(!u&&a){const b=a();b&&typeof b.then=="function"&&b.then(w=>{r&&w?.children&&w.children.length===1&&typeof i=="function"?i(w.children[0]):h(w)}).finally(()=>{requestAnimationFrame(()=>m_(o,fS(0)))}).catch(w=>{console.error("Errore nel caricamento dati iniziali - Toolbar",w)})}},[t,v,a,u,r,i]);const x=Q.useCallback(function b(w,_,S=null){return _?.length?V.jsx(V.Fragment,{children:_.map((C,T)=>V.jsx(nhe,{node:C,index:T,level:w,parentId:S,toolbarNodesRefs:o,handleKeyDown:m,handleNodeExpand:d,handleMouseLeave:p,onToolbarLeafNodeClick:i,onToolbarRadioLeafNodeClick:g,renderToolbarNodes:b},fS(T,S??"")))}):null},[m,d,p,i,g]);return!u||!u?.children?.length?null:V.jsx("div",{ref:e,className:`${e?y.floatingContainer:null}`,"aria-label":"Toolbar","data-component":"toolbar","smp-id":"toolbar-menu",children:x(0,u.children)})},FR=/_G?(?:\d{2}[A-Z0-9]\d{2}_|\*(?:BOLD|ERROR|ITALIC|UNDERLINE)_)|_n_/g;function ihe(t){return/_G?(?:\d{2}[A-Z0-9]\d{2}_|\*(?:BOLD|ERROR|ITALIC|UNDERLINE)_)|_n_/.test(t)}function ahe(t){const e=[];let r=0,n,i=null;for(;n=FR.exec(t);){const a=n.index;if(a>r){const o=t.substring(r,a);i?i.content+=o:e.push({content:o})}const s=n[0];if(s==="_n_")i?(i.closed=!0,i=null):e.push({content:""});else{const o=s.replace(/^_G?/,"").replace(/_$/,"");i&&(i.closed=!0),i={tag:o,content:""},e.push(i)}r=FR.lastIndex}if(r<t.length){const a=t.substring(r);i?i.content+=a:e.push({content:a})}return i&&(i.closed=!0),e}function she(t){return ahe(t)?.map((e,r)=>{const n=e.content||"";if(e.tag){const i=lhe(e.tag);return V.jsx("span",{"data-gcell-code":e.tag,style:i,children:n},r)}return V.jsx("span",{children:n},r)})}const ohe=/^[a-zA-Z0-9]+$/,$R={"*BOLD":{fontWeight:"bold"},"*ERROR":{color:"white",backgroundColor:"red"},"*UNDERLINE":{textDecoration:"underline"},"*ITALIC":{fontStyle:"italic"}};function lhe(t){if(!t)return{};if($R[t])return $R[t];if(!ohe.test(t))return{};let e={};return t.split("").forEach((r,n)=>{switch(n){case 0:e.color=`var(--smp-gcell-color-${r})`;break;case 1:e=che(e,r);break;case 2:e.background=`var(--smp-gcell-background-color-${r})`;break;case 3:e.fontFamily=`var(--smp-gcell-font-family-${r})`;break}}),e}function che(t,e){switch(e){case"1":return{...t,fontWeight:"bold"};case"2":return{...t,fontStyle:"italic"};case"3":return{...t,textDecoration:"underline"};default:return t}}const jn=({variant:t="body",bindValue:e,color:r,role:n,className:i,style:a,toolbar:s,justifiedContent:o,ellipsis:l=!1,onToolbarLeafNodeClick:c,onToolbarLoadInitialData:u,onToolbarLoadNodeData:h,onAiIconClick:f,onTypographyRightClick:d,...p})=>{const g=Wue[t],[m,v]=Q.useState(!1),{anchorRef:y,targetRef:x}=Ro({position:"bottom",open:m}),b=C=>C?C.split(" ").filter(Boolean).map(T=>su[T]||T).join(" "):"",w={container:`${su["smp-typography"]} ${t?su[`smp-typography-${t}`]:""} ${p.disabled?su["smp-typography-disabled"]:""} ${o?su[`smp-typography-${o}`]:""} ${b(i)}`,toolbar:`${su["smp-typography-toolbar"]} `},_=C=>{c&&c(C),v(!1)},S=ihe(e)?she(e):e;return V.jsxs(V.Fragment,{children:[V.jsxs(g,{"data-component":"typography",className:w.container,disabled:p.disabled,href:t=="link"?e:void 0,target:t=="link"?"_blank":void 0,rel:t=="link"?"noopener noreferrer":void 0,style:{"--smp-typography-color-base":r,...a},role:n,onContextMenu:C=>{d&&(C.preventDefault(),d())},children:[l?V.jsx("span",{className:su["smp-typography-ellipsis"],children:S}):S,s&&V.jsx("div",{"smp-id":"toolbar-button",ref:y,className:w.toolbar,children:V.jsx(Dr,{tabIndex:0,icon:"more_vert",isInteractable:!0,onClick:C=>{C.stopPropagation(),v(!0)}})}),f&&V.jsx("div",{"smp-id":"typography-ai-icon",className:w.toolbar,children:V.jsx(Dr,{tabIndex:0,icon:"smeup-ai",title:"Smeup AI",isInteractable:!0,onClick:C=>{C.stopPropagation(),f()}})})]}),m&&V.jsx(Po,{children:V.jsx(_I,{ref:x,onToolbarLeafNodeClick:_,onToolbarLoadNodeData:h,onToolbarLoadInitialData:u,onToolbarClickOutside:()=>v(!1)})})]})},uhe=({badgeString:t})=>{const{bindValue:e,type:r,icon:n,position:i}=Gue(t??""),a={main:OR["smp-badge"],text:OR["smp-badge-text"]};return V.jsxs("div",{id:Q.useId(),className:a.main,"smp-id":"badge","data-component":"badge","data-badge-position":i,"data-badge-type":r,children:[n&&V.jsx(Dr,{icon:n,state:jue[r??"info"]}),e&&V.jsx(jn,{bindValue:e??"",variant:"label",className:a.text})]})},lr=({bindValue:t,onClick:e,ariaLabel:r,icon:n,placeholderIcon:i,disabled:a,sizing:s="base",variant:o="primary",appearance:l="raised",showIcon:c=!0,ShowText:u="Yes",FullWidth:h="No",loading:f=!1,justify:d="center",BtnTit:p,optionalDisplayValue:g,squared:m=!1,submit:v=!1,active:y=!1,buttonExt:x,Badge:b,className:w})=>{const _={container:`${jc["smp-button"]} ${jc["smp-button-container"]} ${s?jc[`smp-button-${s}`]:""} ${o?jc[`smp-buttonVariant-${o}`]:""} ${l?jc[`smp-buttonType-${l}`]:""} ${Yr(h)?jc["smp-button-FullWidth"]:""} ${`smp-justify-${d}`} ${m&&!u?jc["smp-button-squared"]:""} ${y?jc["smp-buttonActive"]:""} ${x?jc[`smp-buttonExt-${x}`]:""}`};return V.jsxs("button",{"data-component":"button",type:v?"submit":"button",className:`${_.container} ${w}`,onClick:e,"aria-label":r,disabled:a,"aria-busy":f,title:p||g,children:[f?V.jsx(Dr,{icon:"spinner",state:NR(o,l),spin:!0}):V.jsxs(V.Fragment,{children:[n&&c&&V.jsx(Dr,{icon:n,placeholderIcon:i,disabled:a,state:NR(o,l),width:RR(s),height:RR(s)}),Yr(u)&&V.jsx("span",{children:g||t})]}),b&&V.jsx(uhe,{badgeString:b})]})},Il={"smp-tabbar-container":"_smp-tabbar-container_iv2nm_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_iv2nm_9","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_iv2nm_15","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_iv2nm_19","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_iv2nm_23","smp-tabbar-list":"_smp-tabbar-list_iv2nm_23","smp-tabbar-tab":"_smp-tabbar-tab_iv2nm_40","smp-active":"_smp-active_iv2nm_66","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_iv2nm_118","smp-tabbar-tab-small":"_smp-tabbar-tab-small_iv2nm_123","smp-tabbar-tab-base":"_smp-tabbar-tab-base_iv2nm_128","smp-tabbar-tab-large":"_smp-tabbar-tab-large_iv2nm_133","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_iv2nm_138"},SI=({data:t,variant:e="base",sizing:r="large",selectedIndex:n,ref:i,onTabChange:a,onToolbarLoadInitialData:s,onToolbarLoadNodeData:o,onToolbarLeafNodeClick:l,onTabAiIconClick:c,onTypographyRightClick:u})=>{const[h,f]=Q.useState(n??0),[d,p]=Q.useState(n);n!==void 0&&n!==d&&(f(n),p(n));const[g,m]=Q.useState(!1),[v,y]=Q.useState(!1),x=100,b=2,w=()=>{const A=_.current;A&&(m(A.scrollLeft>0),y(A.scrollLeft+A.clientWidth<A.scrollWidth-b))},_=Q.useRef(null);if(Q.useEffect(()=>{const A=_.current;if(!A)return;w();const k=()=>w();return A.addEventListener("scroll",k),window.addEventListener("resize",w),()=>{A.removeEventListener("scroll",k),window.removeEventListener("resize",w)}},[]),!t.children||t.children.length===0)return V.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const S={container:Il["smp-tabbar-container"],listWrapper:Il["smp-tabbar-list-wrapper"],list:Il["smp-tabbar-list"],tab:`${Il["smp-tabbar-tab"]} ${r?Il[`smp-tabbar-tab-${r}`]:""}`,scrollButtonRight:`${Il["smp-tabbar-scroll-button"]} ${Il["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${Il["smp-tabbar-scroll-button"]} ${Il["smp-tabbar-scroll-buttonLeft"]}`,active:Il["smp-active"]},C=()=>{_.current?.scrollBy({left:-x,behavior:"smooth"})},T=()=>{_.current?.scrollBy({left:x,behavior:"smooth"})};return V.jsxs("div",{className:S.container,role:"tabpanel","data-component":"tab-bar","data-variant":e,children:[g&&V.jsx("div",{className:S.scrollButtonLeft,children:V.jsx(lr,{bindValue:"",optionalDisplayValue:"<",onClick:C,variant:"base",sizing:r})}),V.jsx("div",{className:S.listWrapper,children:V.jsx("div",{className:S.list,ref:_,role:"tablist",children:t.children.map((A,k)=>{const I=A.data?.agentCode;return V.jsxs("button",{ref:k===h?i:void 0,type:"button","data-comp-id-tab":A.data?.["data-comp-id"]??void 0,className:`${k===h?S.active:""} ${S.tab} `,role:"tab","aria-selected":k===h,onClick:()=>{a?.(k,A),f(k)},children:[A.icon&&V.jsx(Dr,{icon:A.icon,placeholderIcon:A.placeholderIcon}),V.jsx(jn,{variant:"body",bindValue:A.decode||`Tab ${k+1}`,...A.data?.toolbar===!0&&h===k?{toolbar:!0,onToolbarLeafNodeClick:l,onToolbarLoadInitialData:s,onToolbarLoadNodeData:o}:{},...I&&c&&h===k?{onAiIconClick:()=>c(I)}:{},...u&&h===k?{onTypographyRightClick:u}:{}})]},k)})})}),v&&V.jsx("div",{className:S.scrollButtonRight,children:V.jsx(lr,{bindValue:"",optionalDisplayValue:">",onClick:T,variant:"base",sizing:r})})]})};var GW=(t=>(t.Auto="auto",t.Always="always",t))(GW||{});const S1={"smp-breadcrumbs":"_smp-breadcrumbs_11pz5_6","smp-breadcrumb-item":"_smp-breadcrumb-item_11pz5_13","smp-breadcrumb-link":"_smp-breadcrumb-link_11pz5_19","smp-breadcrumb-collapse":"_smp-breadcrumb-collapse_11pz5_33","smp-breadcrumb-lastElement":"_smp-breadcrumb-lastElement_11pz5_43"},hhe=t=>t?.type==="SmeupDataTree",fhe=t=>t?.type==="SmeupDataTable",v_={obj:{t:"",p:"",k:""},decode:"",shape:void 0},WW=(t,e=1)=>t.reduce((r,n)=>{const i=n.children?.length?WW(n.children,e+1):e;return Math.max(r,i)},e),pc=t=>{if(fhe(t)){const e=t,r=e.columns.filter(a=>a.visible!==!1),n=r[0]?.name??"",i=r[1]?.name??n;return e.rows.reduce((a,s)=>{const o={...s.cells?.[n],decode:s.cells?.[i]?.value||s.cells?.[n].obj?.k};return[...a,o]},[])}else if(hhe(t))return qW(t.children??[])},qW=t=>t?.map(e=>({...e,decode:e.decode||e.value||e.obj?.k||"",children:qW(e.children??[])})),XW=({data:t,fun:e,label:r,options:n,CollapseThr:i,CollapseMode:a=GW.Auto,onOptionsRequest:s,onClick:o,onToolbarLeafNodeClick:l,onToolbarLoadNodeData:c,onToolbarLoadInitialData:u,onTypographyRightClick:h})=>{const f=Q.useId(),d=t?.children||n,[p,g]=Q.useState(d);Q.useEffect(()=>{g(d)},[d]);const m=Q.useRef(null),[v,y]=Q.useState(!1),[x,b]=Q.useState(0);Q.useEffect(()=>{!p&&s&&e&&s(e,void 0).then(O=>g(pc(O)||[])).catch(O=>{console.error("Errore nel caricamento delle opzioni per Breadcrumbs",O)})},[p,e,s]);const{anchorRef:w,targetRef:_,anchorWidth:S}=Ro({position:"bottom",open:v}),C=Q.useCallback(()=>{y(!1),m?.current?.focus()},[]);F0([_],v,()=>C());const T={breadcrumbs:S1["smp-breadcrumbs"],breacrumbItem:S1["smp-breadcrumb-item"],link:S1["smp-breadcrumb-link"],lastElement:S1["smp-breadcrumb-lastElement"],collapse:S1["smp-breadcrumb-collapse"]},A=O=>{O.key==="Escape"&&C()},k=(O,$)=>{o?.(O,$)},I=O=>{const $=Math.max(Number(i)||3,3);let N=!1,U;const j=O&&O[O.length-1];let B;return a==="always"?(B=O&&O.slice(0,O.length-1),N=!!(B&&B.length>0)):(N=O&&O.length>$,U=O&&O.length>1?O[0]:void 0,B=O&&O.slice(1,O.length-1)),{shouldCollapse:N,first:U,last:j,middleItems:B}},E=O=>{O?.focus()},M=(O,$,N)=>{if(!O)return;const U=O?.decode||O?.value||O?.obj?.k;return V.jsxs("li",{className:T.breacrumbItem,"aria-current":N?"page":void 0,children:[(O?.icon||O?.placeholderIcon)&&V.jsx(Dr,{icon:O.icon||"",placeholderIcon:O.placeholderIcon||"",width:16}),O?.fun&&!N?V.jsx("a",{href:"/",onClick:j=>{j.preventDefault(),k?.(j,O)},className:T.link,children:V.jsx(jn,{variant:"body",bindValue:U||""})}):V.jsx(jn,{variant:"title",bindValue:U||"",ellipsis:!0,className:T.lastElement,toolbar:N&&!!u,onToolbarLeafNodeClick:l,onToolbarLoadNodeData:c,onToolbarLoadInitialData:u,onTypographyRightClick:h})]},$)},{shouldCollapse:R,first:D,last:L,middleItems:P}=I(p);return V.jsxs("nav",{"aria-label":"Breadcrumbs","data-component":"breadcrumbs",children:[r&&V.jsx(No,{label:r,htmlFor:f}),V.jsxs("ol",{className:T.breadcrumbs,id:f,children:[M(D,0,!1),R&&V.jsxs("li",{ref:m,className:`${T.breacrumbItem} ${T.collapse}`,children:[V.jsx("div",{ref:w,"aria-label":"Show more breadcrumbs",children:V.jsx(Dr,{icon:"more_horiz",isInteractable:!0,tabIndex:0,onClick:O=>{O.preventDefault(),y($=>!$),b(0)}})}),v&&V.jsx(Po,{children:V.jsx(V3,{options:P||[],onClick:k,ref:_,width:S,showFilter:!1,onKeyDown:A,onOpen:E,isOpen:v,floating:!0,selectedIndex:x,DescrMode:"DescOnly",showLeadingIcon:!0})})]}),!R&&P?.map((O,$)=>M(O,$+1,!1)),M(L,p&&p.length-1||0,!0)]})]})},CI=t=>t?t.t=="D8"||t.t=="A8":!1,YW=t=>t?t.t=="NR":!1,KW=t=>t?t.t=="I1":!1,dhe=t=>t?t.t=="V2"&&t.p=="SI/NO":!1,phe=t=>t?t.t=="V2"&&t.p=="ON/OFF":!1,ghe=t=>t?t.t=="JL":!1,ZW=t=>t?t.t=="J1"&&t.p=="URL":!1,mhe=t=>t?t.t=="J1"&&t.p=="PATHFILE":!1,vhe=t=>{if(t){const e=t.split(";");if(e.length>=3)return{t:e[0],p:e[1],k:e.slice(2).join(";")}}return{t:"",p:"",k:""}};class pS{class;value;constructor(e,r){this.class=e,this.value=r}static fromDataObj(e){return new pS(e,!!(e&&(e.k=="1"||e.k=="true")))}getValue(){return this.value}getLegacyValue(){if(this.class?.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function yhe(t,e){if(fg(t)){const u=new Date(t);if(!isNaN(u.getTime()))return u}const r=new Date;let n;/[/-]/.test(t)?n=t.split(/[/-]/).map((h,f)=>f<2&&h.length===1?"0"+h:h).join(""):n=t.replaceAll("/","").replaceAll("-","");let i="DDMMYYYY";e==="en"&&(i="MMDDYYYY");const a=i.indexOf("DD"),s=i.indexOf("MM");let o=0,l=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),r.setDate(o),o2(r)?r:t;case 3:case 4:return o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),s===0?(r.setMonth(o-1),r.setDate(l)):a===0&&(r.setMonth(l-1),r.setDate(o)),o2(r)?r:t;case 5:case 6:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),Number(n.substring(4))>=50?c="19"+n.substring(4):c="20"+n.substring(4);let u=0,h=0;return s===0?(u=l,h=o-1,r.setFullYear(parseInt(c),h,u)):a===0&&(u=o,h=l-1,r.setFullYear(parseInt(c),h,u)),rm(o,h,parseInt(c))&&o2(r)?r:t}case 7:case 8:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),c=n.substring(4);let u=0,h=0;return s===0?(u=l,h=o-1,r.setFullYear(parseInt(c),h,u)):a===0&&(u=o,h=l-1,r.setFullYear(parseInt(c),h,u)),rm(u,h,parseInt(c))&&o2(r)?r:t}}return t}function fg(t){return/^\d{4}-\d{2}-\d{2}$/.test(t)&&t.length===10}function o2(t){return t instanceof Date&&!isNaN(t.getTime())}function xhe(t){if(!/^\d{8}$/.test(t))return!1;const e=parseInt(t.slice(0,4),10),r=parseInt(t.slice(4,6),10),n=parseInt(t.slice(6,8),10);return rm(n,r-1,e)}function bhe(t){if(!/^\d{6}$/.test(t))return!1;const e=parseInt(gS(t.substring(0,2))+t.substring(0,2),10),r=parseInt(t.slice(2,4),10),n=parseInt(t.slice(4,6),10);return rm(n,r-1,e)}function whe(t){if(!/^\d{6}$/.test(t))return!1;const e=parseInt(gS(t.substring(4,6))+t.substring(4,6),10),r=parseInt(t.slice(2,4),10),n=parseInt(t.slice(0,2),10);return rm(n,r-1,e)}function _he(t){if(!/^\d{8}$/.test(t))return!1;const e=parseInt(t.slice(4,8),10),r=parseInt(t.slice(2,4),10),n=parseInt(t.slice(0,2),10);return rm(n,r-1,e)}function gS(t){return parseInt(t.substring(0,2))>39?"19":"20"}function rm(t,e,r){const n=[31,She(r)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||t<1||t>n[e])}function She(t){return t%4===0&&(t%100!==0||t%400===0)}function Che(t){const e=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(r))||isNaN(Number(n))?t.toString():`${e}-${r}-${n}`}class nm{class;date;constructor(e,r){this.class=e,this.date=r}static fromDataObj(e){if(e){const r=zR.get(`${e.t}${e.p}`);if(r)return new nm(e,r.legacyToIso(e.k));throw console.error(`Date creation from ${e.t}${e.p} not implemented yet`)}else throw console.error("Date creation from obj undefined not implemented yet")}getLegacyValue(){if(this.class){const e=zR.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.date);throw console.error(`Date object not implemented ${this.class.t}${this.class.p}`)}throw console.error("Date object not implemented for obj undefined")}getValue(){return this.date}}const zR=new Map([["D8*YYMD",{legacyToIso(t){return xhe(t)&&`${t.substring(0,4)}-${t.substring(4,6)}-${t.substring(6,8)}`||t},isoToLegacy(t){return fg(t)&&t.replaceAll("-","")||t}}],["D8*YMD",{legacyToIso(t){return bhe(t)?`${gS(t.substring(0,2))+t.substring(0,2)}-${t.substring(2,4)}-${t.substring(4,6)}`:t},isoToLegacy(t){if(fg(t)){const e=t.split("-");return e[0].substring(2)+e[1]+e[2]}return t}}],["D8*DMY",{legacyToIso(t){return whe(t)?`${gS(t.substring(4,6))+t.substring(4,6)}-${t.substring(2,4)}-${t.substring(0,2)}`:t},isoToLegacy(t){if(fg(t)){const e=t.split("-");return e[2]+e[1]+e[0].substring(2)}return t}}],["D8*DMYY",{legacyToIso(t){return _he(t)?`${t.substring(4,8)}-${t.substring(2,4)}-${t.substring(0,2)}`:t},isoToLegacy(t){if(fg(t)){const e=t.split("-");return e[2]+e[1]+e[0]}return t}}],["A8",{legacyToIso(t){return t},isoToLegacy(t){return t}}]]);class h0{class;value;decimalSeparator;constructor(e,r,n="."){this.class=e,this.value=r,this.decimalSeparator=n}static fromDataObj(e,r){if(e){const n=r==="."?",":".";if(e.k==="")return new h0(e,void 0,r);let i=e.k.trim();const a=i.endsWith("-");a&&(i=i.slice(0,-1));const o=i.replace(new RegExp(`\\${n}`,"g"),"").replace(r,"."),l=parseFloat(o),c=a?-l:l;return new h0(e,c,r)}throw console.error("Number not implemented for obj undefined")}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}function Ahe(t){return typeof t=="string"&&/^\d{6}$/.test(t)}class mS{class;time;constructor(e,r){this.class=e,this.time=r}static fromDataObj(e){if(e){const r=VR.get(`${e.t}${e.p}`);if(r)return new mS(e,r.legacyToIso(e.k));throw console.error(`time creation from ${e.t}${e.p} not implemented yet`)}throw console.error("time creation from obj undefined not implemented yet")}getLegacyValue(){if(this.class){const e=VR.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw console.error(`Time object not implemented ${this.class.t}${this.class.p}`)}throw console.error("Time object not implemented for obj undefined")}getValue(){return this.time}}const VR=new Map([["I12",{legacyToIso(t){return Ahe(t)&&`${t.substring(0,2)}:${t.substring(2,4)}:${t.substring(4,6)}`||t},isoToLegacy(t){return t.replaceAll(":","")||t}}]]),Xt=t=>typeof t=="string",C1=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},UR=t=>t==null?"":""+t,The=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},khe=/###/g,jR=t=>t&&t.indexOf("###")>-1?t.replace(khe,"."):t,HR=t=>!t||Xt(t),yy=(t,e,r)=>{const n=Xt(e)?e.split("."):e;let i=0;for(;i<n.length-1;){if(HR(t))return{};const a=jR(n[i]);!t[a]&&r&&(t[a]=new r),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return HR(t)?{}:{obj:t,k:jR(n[i])}},GR=(t,e,r)=>{const{obj:n,k:i}=yy(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],s=e.slice(0,e.length-1),o=yy(t,s,Object);for(;o.obj===void 0&&s.length;)a=`${s[s.length-1]}.${a}`,s=s.slice(0,s.length-1),o=yy(t,s,Object),o?.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=r},Ehe=(t,e,r,n)=>{const{obj:i,k:a}=yy(t,e,Object);i[a]=i[a]||[],i[a].push(r)},vS=(t,e)=>{const{obj:r,k:n}=yy(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Ihe=(t,e,r)=>{const n=vS(t,r);return n!==void 0?n:vS(e,r)},JW=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?Xt(t[n])||t[n]instanceof String||Xt(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):JW(t[n],e[n],r):t[n]=e[n]);return t},up=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Dhe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Mhe=t=>Xt(t)?t.replace(/[&<>"'\/]/g,e=>Dhe[e]):t;class Lhe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Phe=[" ",",","?","!",";"],Rhe=new Lhe(20),Nhe=(t,e,r)=>{e=e||"",r=r||"";const n=Phe.filter(s=>e.indexOf(s)<0&&r.indexOf(s)<0);if(n.length===0)return!0;const i=Rhe.getRegExp(`(${n.map(s=>s==="?"?"\\?":s).join("|")})`);let a=!i.test(t);if(!a){const s=t.indexOf(r);s>0&&!i.test(t.substring(0,s))&&(a=!0)}return a},K7=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let a=0;a<n.length;){if(!i||typeof i!="object")return;let s,o="";for(let l=a;l<n.length;++l)if(l!==a&&(o+=r),o+=n[l],s=i[o],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&l<n.length-1)continue;a+=l-a+1;break}i=s}return i},Yy=t=>t?.replace("_","-"),Ohe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class yS{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||Ohe,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(Xt(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new yS(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new yS(this.logger,e)}}var oc=new yS;class U3{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,a])=>{for(let s=0;s<a;s++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,a])=>{for(let s=0;s<a;s++)i.apply(i,[e,...r])})}}class WR extends U3{constructor(e,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,r],n&&(Array.isArray(n)?o.push(...n):Xt(n)&&a?o.push(...n.split(a)):o.push(n)));const l=vS(this.data,o);return!l&&!r&&!n&&e.indexOf(".")>-1&&(e=o[0],r=o[1],n=o.slice(2).join(".")),l||!s||!Xt(n)?l:K7(this.data?.[e]?.[r],n,a)}addResource(e,r,n,i,a={silent:!1}){const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,r];n&&(o=o.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(o=e.split("."),i=r,r=o[1]),this.addNamespaces(r),GR(this.data,o,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(Xt(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a,s={silent:!1,skipCopy:!1}){let o=[e,r];e.indexOf(".")>-1&&(o=e.split("."),i=n,n=r,r=o[1]),this.addNamespaces(r);let l=vS(this.data,o)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?JW(l,n,a):l={...l,...n},GR(this.data,o,l),s.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var QW={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{e=this.processors[a]?.process(e,r,n,i)??e}),e}};const eq=Symbol("i18next/PATH_KEY");function Bhe(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>(r?.revoke?.(),i===eq?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)),Proxy.revocable(Object.create(null),e).proxy}function Z7(t,e){const{[eq]:r}=t(Bhe());return r.join(e?.keySeparator??".")}const qR={},J5=t=>!Xt(t)&&typeof t!="boolean"&&typeof t!="number";class xS extends U3{constructor(e,r={}){super(),The(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=oc.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if(i?.res===void 0)return!1;const a=J5(i.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const s=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Nhe(e,n,i);if(s&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:Xt(a)?[a]:a};const c=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(i)}return{key:e,namespaces:Xt(a)?[a]:a}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=Z7(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]);const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],i),c=l[l.length-1];let u=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const h=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return f?a?{res:`${c}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:`${c}${u}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:o;const d=this.resolve(e,i);let p=d?.res;const g=d?.usedKey||o,m=d?.exactUsedKey||o,v=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Xt(i.count),w=xS.hasDefaultValue(i),_=b?this.pluralResolver.getSuffix(h,i.count,i):"",S=i.ordinal&&b?this.pluralResolver.getSuffix(h,i.count,{ordinal:!1}):"",C=b&&!i.ordinal&&i.count===0,T=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${_}`]||i[`defaultValue${S}`]||i.defaultValue;let A=p;x&&!p&&w&&(A=T);const k=J5(A),I=Object.prototype.toString.apply(A);if(x&&A&&k&&v.indexOf(I)<0&&!(Xt(y)&&Array.isArray(A))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const E=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...i,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(d.res=E,d.usedParams=this.getUsedParamsDetails(i),d):E}if(s){const E=Array.isArray(A),M=E?[]:{},R=E?m:g;for(const D in A)if(Object.prototype.hasOwnProperty.call(A,D)){const L=`${R}${s}${D}`;w&&!p?M[D]=this.translate(L,{...i,defaultValue:J5(T)?T[D]:void 0,joinArrays:!1,ns:l}):M[D]=this.translate(L,{...i,joinArrays:!1,ns:l}),M[D]===L&&(M[D]=A[D])}p=M}}else if(x&&Xt(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,e,i,n));else{let E=!1,M=!1;!this.isValidLookup(p)&&w&&(E=!0,p=T),this.isValidLookup(p)||(M=!0,p=o);const D=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&M?void 0:p,L=w&&T!==p&&this.options.updateMissing;if(M||E||L){if(this.logger.log(L?"updateKey":"missingKey",h,c,o,L?T:p),s){const N=this.resolve(o,{...i,keySeparator:!1});N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let P=[];const O=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&O&&O[0])for(let N=0;N<O.length;N++)P.push(O[N]);else this.options.saveMissingTo==="all"?P=this.languageUtils.toResolveHierarchy(i.lng||this.language):P.push(i.lng||this.language);const $=(N,U,j)=>{const B=w&&j!==p?j:D;this.options.missingKeyHandler?this.options.missingKeyHandler(N,c,U,B,L,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(N,c,U,B,L,i),this.emit("missingKey",N,c,U,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?P.forEach(N=>{const U=this.pluralResolver.getSuffixes(N,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(j=>{$([N],o+j,i[`defaultValue${j}`]||T)})}):$(P,o,T))}p=this.extendTranslation(p,e,i,d,n),M&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${c}${u}${o}`),(M||E)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${o}`:o,E?p:void 0,i))}return a?(d.res=p,d.usedParams=this.getUsedParamsDetails(i),d):p}extendTranslation(e,r,n,i,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const l=Xt(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const h=e.match(this.interpolator.nestingRegexp);c=h&&h.length}let u=n.replace&&!Xt(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||i.usedLng,n),l){const h=e.match(this.interpolator.nestingRegexp),f=h&&h.length;c<f&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>a?.[0]===h[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${r[0]}`),null):this.translate(...h,r),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,o=Xt(s)?[s]:s;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=QW.handle(o,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,s,o;return Xt(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),u=c.key;i=u;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=r.count!==void 0&&!Xt(r.count),d=f&&!r.ordinal&&r.count===0,p=r.context!==void 0&&(Xt(r.context)||typeof r.context=="number")&&r.context!=="",g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(m=>{this.isValidLookup(n)||(o=m,!qR[`${g[0]}-${m}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(qR[`${g[0]}-${m}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(v=>{if(this.isValidLookup(n))return;s=v;const y=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(y,u,v,m,r);else{let b;f&&(b=this.pluralResolver.getSuffix(v,r.count,r));const w=`${this.options.pluralSeparator}zero`,_=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&b.indexOf(_)===0&&y.push(u+b.replace(_,this.options.pluralSeparator)),y.push(u+b),d&&y.push(u+w)),p){const S=`${u}${this.options.contextSeparator||"_"}${r.context}`;y.push(S),f&&(r.ordinal&&b.indexOf(_)===0&&y.push(S+b.replace(_,this.options.pluralSeparator)),y.push(S+b),d&&y.push(S+w))}}let x;for(;x=y.pop();)this.isValidLookup(n)||(a=x,n=this.getResource(v,m,x,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:s,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Xt(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}class XR{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=oc.create("languageUtils")}getScriptPartFromCode(e){if(e=Yy(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Yy(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(Xt(e)&&e.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(s=>{if(s===a)return s;if(!(s.indexOf("-")<0&&a.indexOf("-")<0)&&(s.indexOf("-")>0&&a.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===a||s.indexOf(a)===0&&a.length>1))return s})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),Xt(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),i=[],a=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return Xt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):Xt(e)&&a(this.formatLanguageCode(e)),n.forEach(s=>{i.indexOf(s)<0&&a(this.formatLanguageCode(s))}),i}}const YR={zero:0,one:1,two:2,few:3,many:4,other:5},KR={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Fhe{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=oc.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=Yy(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let s;try{s=new Intl.PluralRules(n,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),KR;if(!e.match(/-|_/))return KR;const l=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(l,r)}return this.pluralRulesCache[a]=s,s}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>YR[i]-YR[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const ZR=(t,e,r,n=".",i=!0)=>{let a=Ihe(t,e,r);return!a&&i&&Xt(r)&&(a=K7(t,r,n),a===void 0&&(a=K7(e,r,n))),a},Q5=t=>t.replace(/\$/g,"$$$$");class $he{constructor(e={}){this.logger=oc.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:s,suffix:o,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:d,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:m,maxReplaces:v,alwaysFormat:y}=e.interpolation;this.escape=r!==void 0?r:Mhe,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?up(a):s||"{{",this.suffix=o?up(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?up(f):d||up("$t("),this.nestingSuffix=p?up(p):g||up(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=v||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>r?.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){let a,s,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=d=>{if(d.indexOf(this.formatSeparator)<0){const v=ZR(r,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,n,{...i,...r,interpolationkey:d}):v}const p=d.split(this.formatSeparator),g=p.shift().trim(),m=p.join(this.formatSeparator).trim();return this.format(ZR(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure),m,n,{...i,...r,interpolationkey:g})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>Q5(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?Q5(this.escape(d)):Q5(d)}].forEach(d=>{for(o=0;a=d.regex.exec(e);){const p=a[1].trim();if(s=c(p),s===void 0)if(typeof u=="function"){const m=u(e,a,i);s=Xt(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))s="";else if(h){s=a[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),s="";else!Xt(s)&&!this.useRawValueToEscape&&(s=UR(s));const g=d.safeValue(s);if(e=e.replace(a[0],g),h?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=a[0].length):d.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,s;const o=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const h=l.split(new RegExp(`${u}[ ]*{`));let f=`{${h[1]}`;l=h[0],f=this.interpolate(f,s);const d=f.match(/'/g),p=f.match(/"/g);((d?.length??0)%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),c&&(s={...c,...s})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${u}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];s={...n},s=s.replace&&!Xt(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const c=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(c!==-1&&(l=i[1].slice(c).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),i[1]=i[1].slice(0,c)),a=r(o.call(this,i[1].trim(),s),s),a&&i[0]===e&&!Xt(a))return a;Xt(a)||(a=UR(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((u,h)=>this.format(u,h,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const zhe=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);e==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(s=>{if(s){const[o,...l]=s.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();r[u]||(r[u]=c),c==="false"&&(r[u]=!1),c==="true"&&(r[u]=!0),isNaN(c)||(r[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:r}},JR=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const s=n+JSON.stringify(a);let o=e[s];return o||(o=t(Yy(n),i),e[s]=o),o(r)}},Vhe=t=>(e,r,n)=>t(Yy(r),n)(e);class Uhe{constructor(e={}){this.logger=oc.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?JR:Vhe;this.formats={number:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a});return o=>s.format(o)}),currency:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a,style:"currency"});return o=>s.format(o)}),datetime:n((i,a)=>{const s=new Intl.DateTimeFormat(i,{...a});return o=>s.format(o)}),relativetime:n((i,a)=>{const s=new Intl.RelativeTimeFormat(i,{...a});return o=>s.format(o,a.range||"day")}),list:n((i,a)=>{const s=new Intl.ListFormat(i,{...a});return o=>s.format(o)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=JR(r)}format(e,r,n,i={}){const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{const{formatName:c,formatOptions:u}=zhe(l);if(this.formats[c]){let h=o;try{const f=i?.formatParams?.[i.interpolationkey]||{},d=f.locale||f.lng||i.locale||i.lng||n;h=this.formats[c](o,d,{...u,...i,...f})}catch(f){this.logger.warn(f)}return h}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const jhe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Hhe extends U3{constructor(e,r,n,i={}){super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=oc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,i.backend,i)}queueLoad(e,r,n,i){const a={},s={},o={},l={};return e.forEach(c=>{let u=!0;r.forEach(h=>{const f=`${c}|${h}`;!n.reload&&this.store.hasResourceBundle(c,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,u=!1,s[f]===void 0&&(s[f]=!0),a[f]===void 0&&(a[f]=!0),l[h]===void 0&&(l[h]=!0)))}),u||(o[c]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],s=i[1];r&&this.emit("failedLoading",a,s,r),!r&&n&&this.store.addResourceBundle(a,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const o={};this.queue.forEach(l=>{Ehe(l.loaded,[a],s),jhe(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const u=l.loaded[c];u.length&&u.forEach(h=>{o[c][h]===void 0&&(o[c][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:s});return}this.readingCalls++;const o=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,i+1,a*2,s)},a);return}s(c,u)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,r);c&&typeof c.then=="function"?c.then(u=>o(null,u)).catch(o):o(null,c)}catch(c){o(c)}return}return l(e,r,o)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Xt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Xt(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(s=>{this.loadOne(s)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(s,o)=>{s&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,s),!s&&o&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,o),this.loaded(e,s,o)})}saveMissing(e,r,n,i,a,s={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend?.create){const l={...s,isUpdate:a},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(e,r,n,i,l):u=c(e,r,n,i),u&&typeof u.then=="function"?u.then(h=>o(null,h)).catch(o):o(null,u)}catch(u){o(u)}else c(e,r,n,i,o,l)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const QR=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Xt(t[1])&&(e.defaultValue=t[1]),Xt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),eN=t=>(Xt(t.ns)&&(t.ns=[t.ns]),Xt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Xt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),l2=()=>{},Ghe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class Ky extends U3{constructor(e={},r){if(super(),this.options=eN(e),this.services={},this.logger=oc,this.modules={external:[]},Ghe(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(Xt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=QR();this.options={...n,...this.options,...eN(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const i=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?oc.init(i(this.modules.logger),this.options):oc.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Uhe;const u=new XR(this.options);this.store=new WR(this.options.resources,this.options);const h=this.services;h.logger=oc,h.resourceStore=this.store,h.languageUtils=u,h.pluralResolver=new Fhe(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(h.formatter=i(c),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new $he(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Hhe(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new xS(this.services,this.options),this.translator.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,r||(r=l2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const o=C1(),l=()=>{const c=(u,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(h),r(u,h)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,r=l2){let n=r;const i=Xt(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],s=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&a.indexOf(c)<0&&a.push(c)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload?.forEach?.(o=>s(o)),this.services.backendConnector.load(a,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(o)})}else n(null)}reloadResources(e,r,n){const i=C1();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=l2),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&QW.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,r){this.isLanguageChangingTo=e;const n=C1();this.emit("languageChanging",e);const i=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),r&&r(o,(...c)=>this.t(...c))},s=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=Xt(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(Xt(o)?[o]:o);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{a(u,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),n}getFixedT(e,r,n){const i=(a,s,...o)=>{let l;typeof s!="object"?l=this.options.overloadTranslationOptionHandler([a,s].concat(o)):l={...s},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||i.keyPrefix);const c=this.options.keySeparator||".";let u;return l.keyPrefix&&Array.isArray(a)?u=a.map(h=>(typeof h=="function"&&(h=Z7(h,{...this.options,...s})),`${l.keyPrefix}${c}${h}`)):(typeof a=="function"&&(a=Z7(a,{...this.options,...s})),u=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a),this.t(u,l)};return Xt(e)?i.lng=e:i.lngs=e,i.ns=r,i.keyPrefix=n,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(o,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];return c===-1||c===0||c===2};if(r.precheck){const o=r.precheck(this,s);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,e)&&(!i||s(a,e)))}loadNamespaces(e,r){const n=C1();return this.options.ns?(Xt(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=C1();Xt(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return a.length?(this.options.preload=i.concat(a),this.loadResources(s=>{n.resolve(),r&&r(s)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const i=new Intl.Locale(e);if(i&&i.getTextInfo){const a=i.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services?.languageUtils||new XR(QR());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){return new Ky(e,r)}cloneInstance(e={},r=l2){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new Ky(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((u,h)=>(u[h]={...l[c][h]},u),l[c]),l),{});a.store=new WR(o,i),a.services.resourceStore=a.store}return a.translator=new xS(a.services,i),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ai=Ky.createInstance();ai.createInstance=Ky.createInstance;ai.createInstance;ai.dir;ai.init;ai.loadResources;ai.reloadResources;ai.use;ai.changeLanguage;ai.getFixedT;ai.t;ai.exists;ai.setDefaultNamespace;ai.hasLoadedNamespace;ai.loadNamespaces;ai.loadLanguages;const Whe={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},qhe={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Xhe={AddSubGroup:"Aggiungi sottogruppo",AddFilter:"Aggiungi Filtro",Operator:{String:{Starts:"Inizia per",Contains:"Contiene",Equals:"È uguale a"},Number:{Greater:"Maggiore di",GreaterOrEqual:"Maggiore o uguale a",Less:"Minore di",LessOrEqual:"Minore o uguale a",Equals:"Uguale a",NotEquals:"Diverso da"},Date:{Before:"Prima del",After:"Dopo del",On:"Il giorno"}}},Yhe={SelectFiles:"Scegli",DropAreaLabel:"Trascina i file qua oppure clicca sul bottone",Upload:"Carica",Cancel:"Annulla",Retry:"Riprova",FileTooLarge:"Dimensione del file non consentita"},Khe={CalendarFor:"Calendario per",Close:"Chiudi",Apply:"Applica",Remove:"Rimuovi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione",ChipsInputDefaultPlaceholder:"Inserisci il valore e premi invio",NotificationWidgetNoMessages:"Nessuna notifica",NotificationWidgetDismissAll:"Cancella tutto",ShapeNotSupportedYet:"Forma grafica non ancora supportata: "},Zhe={DismissAll:"Cancella tutto",NoActive:"Nessuna notifica attiva"},Jhe={Bold:"Grassetto (Ctrl-B)",Italic:"Corsivo (Ctrl-I)",Underline:"Sottolineato (Ctrl-U)",Strikethrough:"Barrato (Alt-Maiusc-5)",H1:"Titolo principale",H2:"Titolo secondario",Text:"Testo",CodeBlock:"Blocco di codice",Link:"Link",ListOrdered:"Lista ordinata",ListBullet:"Lista puntata",SmeupLink:"Smeup link",SmeupLinkT:"Tipo",SmeupLinkP:"Parametro",SmeupLinkK:"Codice",SmeupLinkFUN:"FUN"},Qhe={OpenInNew:"Apri il file PDF in un nuovo tab",Download:"Scarica il file PDF",Print:"Stampa il file PDF",Missing:"File PDF mancante",Error:"Errore durante il caricamento del file PDF"},efe={OpenInNew:"Apri il link in un nuovo tab"},tfe={Collapse:"Collassa",Expand:"Espandi"},rfe={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Whe,Month:qhe,FilterBuilder:Xhe,FileUpload:Yhe,Generic:Khe,Notification:Zhe,TextEditor:Jhe,PDF:Qhe,Htm:efe,MindMap:tfe},nfe={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},ife={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},afe={AddSubGroup:"Add Sub Group",AddFilter:"Add Filter",Operator:{String:{Starts:"Starts with",Contains:"Contains",Equals:"Equal to"},Number:{Greater:"Greater than",GreaterOrEqual:"Greater or equal than",Less:"Less than",LessOrEqual:"Less or equal than",Equals:"Equal to",NotEquals:"Other than"},Date:{Before:"Before date",After:"After date",On:"On"}}},sfe={SelectFiles:"Choose",DropAreaLabel:"Drop file here or click the button to Choose",Upload:"Upload",Cancel:"Cancel",Retry:"Retry",FileTooLarge:"File too large"},ofe={CalendarFor:"Calendar for",Close:"Close",Apply:"Apply",Remove:"Remove",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description",ChipsInputDefaultPlaceholder:"Insert value and press enter",NotificationWidgetNoMessages:"No notifications",NotificationWidgetDismissAll:"Dismiss all",ShapeNotSupportedYet:"Shape not supported yet: "},lfe={DismissAll:"Dismiss all",NoActive:"No active notification"},cfe={Bold:"Bold (Ctrl-B)",Italic:"Italic (Ctrl-I)",Underline:"Underline (Ctrl-U)",Strikethrough:"Strikethrough (Alt-Maiusc-5)",H1:"Main title",H2:"Secondary title",Text:"Text",CodeBlock:"Code block",Link:"Link",ListOrdered:"List ordered",ListBullet:"List bullet",SmeupLink:"Smeup link",SmeupLinkT:"Type",SmeupLinkP:"Parameter",SmeupLinkK:"Code",SmeupLinkFUN:"FUN"},ufe={OpenInNew:"Open PDF document in a new tab",Download:"Download PDF document",Print:"Print PDF document",Missing:"Missing PDF document",Error:"Error during PDF document loading"},hfe={OpenInNew:"Open link in new tab"},ffe={Collapse:"Collapse",Expand:"Expand"},dfe={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:nfe,Month:ife,FilterBuilder:afe,FileUpload:sfe,Generic:ofe,Notification:lfe,TextEditor:cfe,PDF:ufe,Htm:hfe,MindMap:ffe},tN=(t,e,r)=>{let n=t;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),r!=null&&(n=Math.min(n,r))),n},pfe=(t,e)=>{const n=Intl.NumberFormat(t).formatToParts(1000.1),i=n.find(s=>s.type==="group")?.value??",",a=e??n.find(s=>s.type==="decimal")?.value??".";return{groupingChar:i,decimalChar:a}};function gfe(t,e,r,n){let i=e;const a=vfe(t,r);if(!i){const o=Math.abs(a);o-Math.floor(o)?i="0,0.00":i="0,0"}const s=yfe(i);return new Intl.NumberFormat(n,s).format(a)}const mfe=(t,e,r)=>{if(!t)return NaN;let n=t.replace(/\s/g,""),i=r;const a=(n.match(/\./g)||[]).length,s=(n.match(/,/g)||[]).length;if(a&&s)i=n.lastIndexOf(".")>n.lastIndexOf(",")?".":",";else if(!n.includes(r)){const l=n.includes(".")?".":",",c=l==="."?a:s;c>1||c===1&&l===e&&n.length-n.lastIndexOf(l)-1===3||(i=l)}const o=i==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),i!=="."&&(n=n.replace(new RegExp(`\\${i}`,"g"),".")),parseFloat(n)};function vfe(t,e,r,n,i){let a=t;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(BR(l,"g"),""),a=a.replace(BR(o,"g"),"."),a=Number(a)}const s=Number(a);return isNaN(s)?NaN:s}function yfe(t){const e={};t.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const r=t.indexOf(".");if(r>-1){const i=(t.substring(r+1).match(/0/g)||[]).length;e.minimumFractionDigits=i,e.maximumFractionDigits=i}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ai.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(t,e,r,n)=>{const i=n?.type??"number";try{switch(i){case"date":{const a=t instanceof Date?t:new Date(t),s=e?{dateStyle:e}:{year:"numeric",month:"2-digit",day:"2-digit"};return new Intl.DateTimeFormat(r,s).format(a)}default:case"number":{const a=n?.inputIsLocalized??!1;return gfe(t,e,a,r)}}}catch{return t}}},resources:{en:{translation:dfe},it:{translation:rfe}}});const xfe=(t,e,r,n)=>ai.format(t,e,r||ai.language,n),bfe=(t,e)=>ai.t(t,e);function Ta(){const t=Q.useCallback((n,i,a,s)=>xfe(n,i,a||void 0,s),[]),e=Q.useCallback(()=>ai.languages[0],[]),r=Q.useCallback((n,i)=>bfe(n,i),[]);return{format:t,getCurrentLanguage:e,translate:r}}var Ha=(t=>(t.CALENDAR_FOR="Date.CalendarFor",t.CLOSE="Generic.Close",t.APPLY="Generic.Apply",t.REMOVE="Generic.Remove",t.SHAPE_NOT_SUPPORTED_YET="Generic.ShapeNotSupportedYet",t.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",t.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",t.CONFIRM_BUTTON="Generic.ConfirmButton",t.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",t.CHIPS_INPUT_DEFAULT_PLACEHOLDER="Generic.ChipsInputDefaultPlaceholder",t.NOTIFICATION_WIDGET_NO_MESSAGES="Generic.NotificationWidgetNoMessages",t.NOTIFICATION_WIDGET_DISMISS_ALL="Generic.NotificationWidgetDismissAll",t))(Ha||{}),gs=(t=>(t.ADD_SUB_GROUP="FilterBuilder.AddSubGroup",t.ADD_FILTER="FilterBuilder.AddFilter",t.STRING_STARTS="FilterBuilder.Operator.String.Starts",t.STRING_CONTAINS="FilterBuilder.Operator.String.Contains",t.STRING_EQUALS="FilterBuilder.Operator.String.Equals",t.NUMBER_EQUALS="FilterBuilder.Operator.Number.Equals",t.NUMBER_NOTEQUALS="FilterBuilder.Operator.Number.NotEquals",t.NUMBER_GREATER="FilterBuilder.Operator.Number.Greater",t.NUMBER_GREATER_OR_EQUAL="FilterBuilder.Operator.Number.GreaterOrEqual",t.NUMBER_LESS="FilterBuilder.Operator.Number.Less",t.NUMBER_LESS_OR_EQUAL="FilterBuilder.Operator.Number.LessOrEqual",t.DATE_BEFORE="FilterBuilder.Operator.Date.Before",t.DATE_AFTER="FilterBuilder.Operator.Date.After",t.DATE_ON="FilterBuilder.Operator.Date.On",t))(gs||{}),Pa=(t=>(t.MONDAY="Day.Monday",t.MONDAY_SHORT="Day.MondayShort",t.TUESDAY="Day.Tuesday",t.TUESDAY_SHORT="Day.TuesdayShort",t.WEDNESDAY="Day.Wednesday",t.WEDNESDAY_SHORT="Day.WednesdayShort",t.THURSDAY="Day.Thursday",t.THURSDAY_SHORT="Day.ThursdayShort",t.FRIDAY="Day.Friday",t.FRIDAY_SHORT="Day.FridayShort",t.SATURDAY="Day.Saturday",t.SATURDAY_SHORT="Day.SaturdayShort",t.SUNDAY="Day.Sunday",t.SUNDAY_SHORT="Day.SundayShort",t))(Pa||{}),Ls=(t=>(t.JANUARY="Month.January",t.FEBRUARY="Month.February",t.MARCH="Month.March",t.APRIL="Month.April",t.MAY="Month.May",t.JUNE="Month.June",t.JULY="Month.July",t.AUGUST="Month.August",t.SEPTEMBER="Month.September",t.OCTOBER="Month.October",t.NOVEMBER="Month.November",t.DECEMBER="Month.December",t))(Ls||{}),J7=(t=>(t.PREVIOUS_DAY="Date.PreviousDay",t.PREVIOUS_WEEK="Date.PreviousWeek",t.PREVIOUS_MONTH="Date.PreviousMonth",t.PREVIOUS_YEAR="Date.PreviousYear",t.NEXT_DAY="Date.NextDay",t.NEXT_WEEK="Date.NextWeek",t.NEXT_MONTH="Date.NextMonth",t.NEXT_YEAR="Date.NextYear",t.YESTERDAY="Date.Yesterday",t.TODAY="Date.Today",t.TOMORROW="Date.Tomorrow",t))(J7||{}),Go=(t=>(t.SELECT_FILES="FileUpload.SelectFiles",t.DROP_AREA_LABEL="FileUpload.DropAreaLabel",t.UPLOAD="FileUpload.Upload",t.CANCEL="FileUpload.Cancel",t.RETRY="FileUpload.Retry",t.FILE_TOO_LARGE="FileUpload.FileTooLarge",t))(Go||{}),Q7=(t=>(t.DISMISS_ALL="Notification.DismissAll",t.NO_ACTIVE_NOTIFICATION="Notification.NoActive",t))(Q7||{}),ya=(t=>(t.BOLD="TextEditor.Bold",t.ITALIC="TextEditor.Italic",t.UNDERLINE="TextEditor.Underline",t.STRIKETHROUGH="TextEditor.Strikethrough",t.H1="TextEditor.H1",t.H2="TextEditor.H2",t.TEXT="TextEditor.Text",t.CODE_BLOCK="TextEditor.CodeBlock",t.LINK="TextEditor.Link",t.LIST_ORDERED="TextEditor.ListOrdered",t.LIST_BULLET="TextEditor.ListBullet",t.SMEUP_LINK="TextEditor.SmeupLink",t.SMEUP_LINK_T="TextEditor.SmeupLinkT",t.SMEUP_LINK_P="TextEditor.SmeupLinkP",t.SMEUP_LINK_K="TextEditor.SmeupLinkK",t.SMEUP_LINK_FUN="TextEditor.SmeupLinkFUN",t))(ya||{}),Dg=(t=>(t.OPEN_IN_NEW="PDF.OpenInNew",t.DOWNLOAD="PDF.Download",t.PRINT="PDF.Print",t.MISSING="PDF.Missing",t.ERROR="PDF.Error",t))(Dg||{}),tq=(t=>(t.OPEN_IN_NEW="Htm.OpenInNew",t))(tq||{});class f0{class;value;constructor(e,r){this.class=e,this.value=r}static fromDataObj(e){if(e)return new f0(e,e.k==""?[]:e.k.split(";"));throw console.error("time creation from obj undefined not implemented yet")}static fromString(e){return new f0({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const ld=(t,e)=>({...t,obj:{t:e.objClass?.t?e.objClass.t:t.obj?.t||"",p:e.objClass?.p?e.objClass.p:t.obj?.p||"",k:e.bindValue},decode:e.optionalDisplayValue??t.decode,fun:e.fun??t.fun}),c2=t=>{const e=f0.fromDataObj(t.obj),r=t.decode?f0.fromString(t.decode).getValue():[];return e.getValue().map((n,i)=>({bindValue:n,optionalDisplayValue:r.length>=i?r[i]:""}))},wfe=(t,e)=>{const r=new f0(t.obj,e.map(i=>i.bindValue)).getLegacyValue(),n=new f0(t.obj,e.map(i=>i.optionalDisplayValue?i.optionalDisplayValue:"")).getLegacyValue();return ld(t,{bindValue:r,optionalDisplayValue:n})},wu=t=>({bindValue:t.obj?.k||"",objClass:{t:t.obj?.t||"",p:t.obj?.p||""},fun:t.fun,optionalDisplayValue:t.decode}),AI=(t,e,r)=>{if(e)return e===Ke.TIME?Ke.TIMEPICKER:e;if(YW(t))return Ke.INPUT_NUMBER;if(CI(t))return Ke.DATE;if(KW(t))return Ke.TIMEPICKER;if(dhe(t))return Ke.CHECKBOX;if(phe(t))return Ke.SWITCH;if(ghe(t))return Ke.CHIP;if((!e||e==Ke.TEXT_FIELD)&&r&&r>=256)return Ke.MEMO},j3=({bindValue:t,optionalDisplayValue:e,options:r=[],ListDescrMode:n="Both",AcpClr:i,AcpMql:a="1",AcpWtm:s,isEditable:o=!0,fun:l,_changeOnEnter:c=!1,_disableAutocomplete:u=!1,onChange:h,onConfirmedChange:f,onOptionsRequest:d,onBlur:p,onEnter:g,_multiActiveIndex:m,autoSelectOptionIndex:v,...y})=>{const x=Q.useRef(null),[b,w]=Q.useState(t),[_,S]=Q.useState(e),{translate:C}=Ta(),[T,A]=Q.useState(!1),[k,I]=Q.useState(r),[E,M]=Q.useState(0),[R,D]=Q.useState([t]),[L,P]=Q.useState(),{anchorRef:O,targetRef:$,anchorWidth:N}=Ro({position:"bottom",open:T}),U=Q.useCallback(()=>{A(!1),x?.current?.focus()},[]);F0([$],T,()=>U());const j=jW(400);Q.useEffect(()=>{v!=null&&(d?d(l,void 0).then(H=>{const Y=pc(H)||[];I(Y),v<Y.length&&X(Y[v])}):v<r.length&&X(r[v]))},[]),Q.useEffect(()=>{c||w(t)},[t,c]);const B=H=>{u||(H.length>=parseInt(a)?q(H):U()),w(H),S(""),c||h?.({bindValue:H,optionalDisplayValue:e})},q=async H=>{if(u){if(l&&d){const Y=await d(l,void 0),J=pc(Y)||[];I(J),M(J.length>0?0:-1)}else M(r.length>0?0:-1);A(!0)}else j(async()=>{if(l&&d){const Y=await d(l,H),J=pc(Y)||[];I(J),M(J.length>0?0:-1),A(!0)}else A(Y=>!Y)})},W=()=>{T||p?.(L?wu(L):{bindValue:b})},X=H=>{P(H),c?(w(""),S("")):(w(H.obj?.k||""),S(H.decode)),h?.(wu(H)),f?.(wu(H)),M(-1),D([H.obj?.k||""]),U()},K=H=>{H.key==="Escape"&&(U(),M(-1))},G=H=>{if(!T&&H.key==="ArrowDown"&&q(b),(H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),T)){const Y=H.key==="ArrowDown"?(E+1)%k.length:(E-1+k.length)%k.length;M(Y)}switch(H.key){case"Enter":E>=0&&E<k.length?X(k[E]):(c&&(h?.({bindValue:b,optionalDisplayValue:""}),U(),w(""),S("")),g?.({bindValue:b,optionalDisplayValue:""}));break;case"Escape":U(),M(-1);break}};return V.jsxs("div",{"data-component":u?"combobox":"autocomplete",onBlur:()=>W(),children:[V.jsx(ia,{...y,bindValue:b,optionalDisplayValue:_,DescrMode:"Both",isEditable:o,shapeIcon:u?"arrow_drop_down":"magnify",placeholder:s||C(Ha.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),onBlur:()=>{},ref:O,isClearable:Yr(i),inputRef:x,onChange:H=>B(H.bindValue),onKeyDown:G,onShapeIconClick:()=>q(b),"aria-autocomplete":"list",maxLength:-1,autocomplete:"off",onAdvanceResearchActivation:()=>U()}),T&&V.jsx(Po,{children:V.jsx(V3,{options:k,DescrMode:n,onClick:(H,Y)=>X(Y),ref:$,selectedIndex:E,activeIndex:m||R,width:N,showFilter:!1,onKeyDown:K,isOpen:T,floating:!0})})]})},A1={"smp-button-group-container":"_smp-button-group-container_2xilo_1","smp-button-group-options-container":"_smp-button-group-options-container_2xilo_7","smp-button-group-danger":"_smp-button-group-danger_2xilo_16","smp-button-group-vertical":"_smp-button-group-vertical_2xilo_31"},rq=({bindValue:t,disabled:e=!1,isEditable:r=!0,label:n,DescrMode:i="DescOnly",BtoVer:a="false",BtoCol:s,options:o,onOptionsRequest:l,fun:c,helper:u,error:h,...f})=>{const[d,p]=Q.useState(o),g=Q.useId(),m=`${g}-helper`,v=h?"danger":void 0,y=!!h,x=parseInt(s??"",10),b=!isNaN(x),w=C=>{e||(f.onChange?.(wu(C)),f.onConfirmedChange?.(wu(C)))};Q.useEffect(()=>{!d&&l&&c&&l(c,void 0).then(C=>p(pc(C))).catch(C=>{console.error("Error during loading options (button group)",C)})},[d,l,c]);const _=b?{gridTemplateColumns:`repeat(${x}, 1fr)`,display:"grid"}:void 0,S={container:`${A1["smp-button-group-container"]} ${Yr(a)?A1["smp-button-group-vertical"]:""}`,optionsContainer:`${A1["smp-button-group-options-container"]} ${Yr(a)?A1["smp-button-group-vertical"]:""} ${h?A1["smp-button-group-danger"]:""}`};return V.jsxs("div",{"data-component":"button-group","smp-id":"buttonGroup-container",className:S.container,id:g,children:[n&&V.jsx(No,{label:n,disabled:e||!r,htmlFor:g,helper:u}),V.jsx("div",{className:S.optionsContainer,style:_,role:"group",children:d?.map(C=>V.jsx(lr,{appearance:"raised",variant:"base",active:t===C.obj?.k,onClick:()=>w(C),bindValue:C.obj?.k||"",optionalDisplayValue:fb(C.obj?.k,C.decode,i),disabled:e||!r,justify:Yr(a)?"start":"center",icon:C.icon,buttonExt:`oneButton-${Yr(a)?"vertical":"horizontal"}`},C.obj?.k))}),y&&V.jsx(B0,{helperText:h,state:v,disabled:e||!r,id:m})]})},e8={"smp-button-list":"_smp-button-list_1kcou_1","smp-button-list-row":"_smp-button-list-row_1kcou_6","smp-button-list-column":"_smp-button-list-column_1kcou_10","smp-button-list-fullWidth":"_smp-button-list-fullWidth_1kcou_14"},nq=({data:t,options:e,fun:r,direction:n="row",disposition:i="start",sizing:a,variant:s,appearance:o,ShowText:l,showIcon:c,FullWidth:u,disabled:h,justify:f,squared:d,onClick:p,onOptionsRequest:g})=>{const m=t?.children||e,[v,y]=Q.useState(m);Q.useEffect(()=>{y(m)},[m]),Q.useEffect(()=>{!v&&g&&r&&g(r,void 0).then(w=>y(pc(w)||[])).catch(w=>{console.error("Errore nel caricamento delle opzioni per ButtonList",w)})},[v,r,g]);const x={container:`${e8["smp-button-list"]} ${e8[`smp-button-list-${n}`]} ${`smp-justify-${i}`} ${Yr(u)?e8["smp-button-list-fullWidth"]:""}`},b=v?.map((w,_)=>{const S={bindValue:w.obj?.k||"",optionalDisplayValue:w.decode??w.value??w.obj?.k??"",fun:w.fun,icon:w.icon,variant:s,appearance:o,ShowText:l,showIcon:c,FullWidth:u,disabled:h,sizing:a,justify:f,squared:d,onClick:C=>{p?.(C,w)},...w.data};return V.jsx(lr,{...S},`button-${_}`)});return V.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:b})},t8={"smp-checkbox-container":"_smp-checkbox-container_faamk_6","smp-checkbox-wrapper":"_smp-checkbox-wrapper_faamk_14","smp-checkbox-danger":"_smp-checkbox-danger_faamk_66"},H3=({bindValue:t,_dataComponent:e="checkbox",disabled:r,label:n,isEditable:i=!0,helper:a,error:s,state:o="base",onChange:l,onConfirmedChange:c,variant:u="checkbox"})=>{const h=Q.useId(),f=m=>{i&&(l?.(m.target.checked),c?.(m.target.checked))},d=!!s,p=d?"danger":o,g={container:`${t8["smp-checkbox-container"]}`,labelAndInputWrapper:`${t8["smp-checkbox-wrapper"]}`,inputState:`${t8[`smp-checkbox-${p}`]}`};return V.jsxs("div",{className:g.container,children:[V.jsxs("div",{className:g.labelAndInputWrapper,"data-component":e,children:[V.jsx("input",{className:g.inputState,"data-component":"checkbox","data-state":p,type:"checkbox",checked:t,onChange:f,role:u==="switch"?"switch":"checkbox",id:h,disabled:r||!i}),n&&V.jsx(No,{label:n,disabled:r||!i,htmlFor:h,helper:a})]}),d&&V.jsx(B0,{helperText:s,disabled:r||!i,state:p,id:`${h}-helper`})]})};function TI(t,e){const r=Q.useRef(null);Q.useEffect(()=>{if(!t)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;r.current=document.activeElement;const i=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=i();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const s=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const u=i();if(u.length===0)return;const h=u[0],f=u[u.length-1];c.shiftKey&&document.activeElement===h?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),h.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const u=i();u.length>0&&u[0].focus()}};document.addEventListener("keydown",s),document.addEventListener("mousedown",o);const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",s),document.removeEventListener("mousedown",o),document.body.style.overflow=l,r.current&&requestAnimationFrame(()=>{r.current?.focus()})}},[t,e])}const Ho={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1u1ze_1","smp-datepickercalendar":"_smp-datepickercalendar_1u1ze_1","smp-datepickercalendar-table":"_smp-datepickercalendar-table_1u1ze_16","smp-datepickercalendar-th":"_smp-datepickercalendar-th_1u1ze_28","smp-datepickercalendar-td":"_smp-datepickercalendar-td_1u1ze_39","smp-datepickercalendar-td-today":"_smp-datepickercalendar-td-today_1u1ze_59","smp-datepickercalendar-td-selected":"_smp-datepickercalendar-td-selected_1u1ze_65","smp-datepickercalendar-td-focused":"_smp-datepickercalendar-td-focused_1u1ze_70","smp-datepickercalendar-label":"_smp-datepickercalendar-label_1u1ze_80"};function _fe({selectedDate:t,onDateChange:e,disabledDateRanges:r=[],initialValue:n,targetRef:i}){const{translate:a}=Ta(),s=()=>{if(!n)return;const O=new Date(n);return isNaN(O.getTime())?void 0:O},[o]=Q.useState(new Date),[l,c]=Q.useState(t||s()||new Date),[u,h]=Q.useState(l?l.getMonth():new Date().getMonth()),[f,d]=Q.useState(l?l.getFullYear():new Date().getFullYear()),[p,g]=Q.useState(l?l.getDate():null),m=Q.useRef(null),v=Q.useRef([]),y=[a(Ls.JANUARY),a(Ls.FEBRUARY),a(Ls.MARCH),a(Ls.APRIL),a(Ls.MAY),a(Ls.JUNE),a(Ls.JULY),a(Ls.AUGUST),a(Ls.SEPTEMBER),a(Ls.OCTOBER),a(Ls.NOVEMBER),a(Ls.DECEMBER)],x=[{value:a(Pa.SUNDAY_SHORT),full:a(Pa.SUNDAY)},{value:a(Pa.MONDAY_SHORT),full:a(Pa.MONDAY)},{value:a(Pa.TUESDAY_SHORT),full:a(Pa.TUESDAY)},{value:a(Pa.WEDNESDAY_SHORT),full:a(Pa.WEDNESDAY)},{value:a(Pa.THURSDAY_SHORT),full:a(Pa.THURSDAY)},{value:a(Pa.FRIDAY_SHORT),full:a(Pa.FRIDAY)},{value:a(Pa.SATURDAY_SHORT),full:a(Pa.SATURDAY)}],b=O=>r.some($=>{const N=$.start.getTime(),U=$.end.getTime(),j=O.getTime();return j>=N&&j<=U}),w=O=>{b(O)||(c(O),g(O.getDate()),e&&e(Che(O)))},_=()=>{u===0?(h(11),d(f-1)):h(u-1),g(1)},S=()=>{u===11?(h(0),d(f+1)):h(u+1),g(1)},C=(O,$)=>new Date(O,$+1,0).getDate(),T=(O,$)=>new Date(O,$,1).getDay(),A=O=>{const $=M.findIndex(N=>N!==null&&N.getDate()===O);$!==-1&&v.current[$]&&(v.current[$]?.focus(),g(O))},k=(O,$)=>{const N=M[$];if(!N)return;const U=C(f,u),j=N.getDate();switch(O.key){case"ArrowRight":O.preventDefault();{let B=j+1,q=new Date(f,u,B);if(B>U){const W=u===11?f+1:f,X=u===11?0:u+1;B=1,q=new Date(W,X,B),S(),setTimeout(()=>{I(1,"forward")},0);return}b(q)?I(B,"forward"):A(B)}break;case"Tab":break;case"ArrowLeft":O.preventDefault();{let B=j-1,q=new Date(f,u,B);if(B<1){const W=u===0?f-1:f,X=u===0?11:u-1,K=C(W,X);B=K,q=new Date(W,X,B),_(),setTimeout(()=>{I(K,"backward")},0);return}b(q)?I(B,"backward"):A(B)}break;case"ArrowUp":O.preventDefault();{let B=j-7,q=new Date(f,u,B);if(B<1){const W=u===0?f-1:f,X=u===0?11:u-1;B=C(W,X)+B,q=new Date(W,X,B),_(),setTimeout(()=>{I(B,"backward")},0);return}b(q)?I(B,"backward"):A(B)}break;case"ArrowDown":O.preventDefault();{let B=j+7,q=new Date(f,u,B);if(B>U){const W=u===11?f+1:f,X=u===11?0:u+1;B=B-U,q=new Date(W,X,B),S(),setTimeout(()=>{I(B,"forward")},0);return}b(q)?I(B,"forward"):A(B)}break;case"Home":O.preventDefault(),I(1,"forward");break;case"End":O.preventDefault(),I(U,"backward");break;case"PageUp":O.preventDefault(),_(),setTimeout(()=>{const B=C(u===0?f-1:f,u===0?11:u-1),q=Math.min(j,B);I(q,"forward")},0);break;case"PageDown":O.preventDefault(),S(),setTimeout(()=>{const B=C(u===11?f+1:f,u===11?0:u+1),q=Math.min(j,B);I(q,"forward")},0);break;case" ":case"Space":if(b(N))return;g(N.getDate()),c(N);break;case"Enter":O.preventDefault(),w(N);break}},I=(O,$)=>{const N=C(f,u);if($==="forward"){for(let U=O;U<=N;U++){const j=new Date(f,u,U);if(!b(j)){A(U);return}}S(),setTimeout(()=>{I(1,"forward")},0)}else{for(let q=O;q>=1;q--){const W=new Date(f,u,q);if(!b(W)){A(q);return}}const U=u===0?f-1:f,j=u===0?11:u-1,B=C(U,j);_(),setTimeout(()=>{I(B,"backward")},0)}},M=(()=>{const O=C(f,u),$=T(f,u),N=[];for(let U=0;U<$;U++)N.push(null);for(let U=1;U<=O;U++){const j=new Date(f,u,U);N.push(j)}return N})(),R=[];let D=[];M.forEach((O,$)=>{if(D.push(O),D.length===7||$===M.length-1){for(;D.length<7;)D.push(null);R.push(D),D=[]}}),Q.useEffect(()=>{if(p!==null){const O=M.findIndex($=>$!==null&&$.getDate()===p);O!==-1&&v.current[O]&&v.current[O]?.focus()}},[u,f,p,M]);const L={label:`${Ho["smp-datepickercalendar-label"]}`,wrapper:`${Ho["smp-datepickercalendar"]} ${Ho["smp-datepickercalendar-position"]}`,calendar:`${Ho["smp-datepickercalendar"]}`,table:`${Ho["smp-datepickercalendar-table"]}`,th:`${Ho["smp-datepickercalendar-th"]}`,td:(O,$,N,U)=>`${Ho["smp-datepickercalendar-td"]}
7
+ Valid keys: `+JSON.stringify(Object.keys($),null," "));var J=Y(X,H,B,q,W+"."+H,r);if(J)return J}return null}return m(N)}function M($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(M);if($===null||o($))return!0;var N=h($);if(N){var U=N.call($),j;if(N!==$.entries){for(;!(j=U.next()).done;)if(!M(j.value))return!1}else for(;!(j=U.next()).done;){var B=j.value;if(B&&!M(B[1]))return!1}}else return!1;return!0;default:return!1}}function R($,N){return $==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function D($){var N=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":R(N,$)?"symbol":N}function L($){if(typeof $>"u"||$===null)return""+$;var N=D($);if(N==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return N}function P($){var N=L($);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function O($){return!$.constructor||!$.constructor.name?f:$.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},q5}var X5,IR;function Due(){if(IR)return X5;IR=1;var t=xI();function e(){}function r(){}return r.resetWarningCache=e,X5=function(){function n(s,o,l,c,u,h){if(h!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},X5}var DR;function Mue(){if(DR)return n2.exports;if(DR=1,process.env.NODE_ENV!=="production"){var t=$W(),e=!0;n2.exports=Iue()(t.isElement,e)}else n2.exports=Due()();return n2.exports}var hi=Mue(),Lue=function(e){var r=e?.ownerDocument||document;return r.defaultView||window},Pue=function(e,r){for(var n in e)if(!(n in r))return!0;for(var i in r)if(e[i]!==r[i])return!0;return!1},Rue=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],a2="http://www.w3.org/2000/svg",MR="http://www.w3.org/1999/xlink",bI=(function(t){function e(){for(var n,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=t.call.apply(t,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}gue(e,t);var r=e.prototype;return r.renderSVG=function(){var i=this;if(this.reactWrapper instanceof Lue(this.reactWrapper).Node){var a=this.props,s=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,u=a.src,h=a.title,f=a.useRequestCache,d=this.props.onError,p=this.props.beforeInjection,g=this.props.afterInjection,m=this.props.wrapper,v,y;m==="svg"?(v=document.createElementNS(a2,m),v.setAttribute("xmlns",a2),v.setAttribute("xmlns:xlink",MR),y=document.createElementNS(a2,m)):(v=document.createElement(m),y=document.createElement(m)),v.appendChild(y),y.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(v);var x=function(S){if(i.removeSVG(),!i._isMounted){d(S);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){d(S)})},b=function(S,C){if(S){x(S);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{g(C)}catch(T){x(T)}})},w=function(S){if(S.setAttribute("role","img"),s){var C=S.querySelector(":scope > desc");C&&S.removeChild(C);var T=document.createElement("desc");T.innerHTML=s,S.prepend(T)}if(h){var A=S.querySelector(":scope > title");A&&S.removeChild(A);var k=document.createElement("title");k.innerHTML=h,S.prepend(k)}try{p(S)}catch(I){x(I)}};Cue(y,{afterEach:b,beforeEach:w,cacheRequests:f,evalScripts:o,httpRequestWithCredentials:l,renumerateIRIElements:c})}},r.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},r.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},r.componentDidUpdate=function(i){var a=this;Pue(hS({},i),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},r.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},r.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var a=i.fallback;i.httpRequestWithCredentials;var s=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var o=i.wrapper,l=pue(i,Rue),c=o;return e2.createElement(c,hS({},l,{ref:this.refCallback},o==="svg"?{xmlns:a2,xmlnsXlink:MR}:{}),this.state.isLoading&&s&&e2.createElement(s,null),this.state.hasError&&a&&e2.createElement(a,null))},e})(e2.Component);bI.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};bI.propTypes={afterInjection:hi.func,beforeInjection:hi.func,desc:hi.string,evalScripts:hi.oneOf(["always","once","never"]),fallback:hi.oneOfType([hi.func,hi.object,hi.string]),httpRequestWithCredentials:hi.bool,loading:hi.oneOfType([hi.func,hi.object,hi.string]),onError:hi.func,renumerateIRIElements:hi.bool,src:hi.string.isRequired,title:hi.string,useRequestCache:hi.bool,wrapper:hi.oneOf(["div","span","svg"])};let W7={assets:"/"};const Nue=t=>{W7={...W7,...t}},Oue=t=>{const e=`${W7.assets}/${t}`.replace(/\/+/g,"/");return e.endsWith(".svg")?e:e+".svg"},lp={"smp-icon":"_smp-icon_1p89h_1","smp-icon-rotated":"_smp-icon-rotated_1p89h_10","smp-icon-base":"_smp-icon-base_1p89h_14","smp-icon-interactable":"_smp-icon-interactable_1p89h_17","smp-icon-onBase":"_smp-icon-onBase_1p89h_30","smp-icon-primary":"_smp-icon-primary_1p89h_35","smp-icon-onPrimary":"_smp-icon-onPrimary_1p89h_39","smp-icon-info":"_smp-icon-info_1p89h_44","smp-icon-onInfo":"_smp-icon-onInfo_1p89h_48","smp-icon-onInfoLight":"_smp-icon-onInfoLight_1p89h_52","smp-icon-danger":"_smp-icon-danger_1p89h_58","smp-icon-onDanger":"_smp-icon-onDanger_1p89h_62","smp-icon-onDangerLight":"_smp-icon-onDangerLight_1p89h_66","smp-icon-warning":"_smp-icon-warning_1p89h_72","smp-icon-onWarning":"_smp-icon-onWarning_1p89h_76","smp-icon-onWarningLight":"_smp-icon-onWarningLight_1p89h_80","smp-icon-success":"_smp-icon-success_1p89h_85","smp-icon-onSuccess":"_smp-icon-onSuccess_1p89h_89","smp-icon-onSuccessLight":"_smp-icon-onSuccessLight_1p89h_93","smp-icon-spin":"_smp-icon-spin_1p89h_101","smp-image-interactable":"_smp-image-interactable_1p89h_106"},Dr=Q.memo(({icon:t,width:e,height:r,placeholderIcon:n,color:i,disabled:a,state:s="base",rotated:o=!1,onClick:l,isInteractable:c=!1,spin:u=!1,title:h,tabIndex:f,link:d})=>{const[p,g]=Q.useState(!1),m=I=>I?.toLowerCase().endsWith(".svg")||!I?.includes("/"),v=I=>I?.startsWith("http")||I?.startsWith("/"),y={img:`${lp[c?"smp-image-interactable":""]}`,svg:`${lp["smp-icon"]} ${s?`${lp[`smp-icon-${s}`]}`:""} ${o?lp["smp-icon-rotated"]:""} ${c?lp["smp-icon-interactable"]:""} ${u?lp["smp-icon-spin"]:""}`},x=I=>{!a&&c&&l&&l(I)},b=I=>{!a&&c&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),x(I))},w=p?n:t,_=m(w),C=v(w)?w:Oue(`assets/svg/${w}`),T=()=>V.jsx(bI,{src:C,onError:()=>g(!0),width:e||"0.875rem",height:r||"0.875rem",wrapper:"svg",title:h,role:"application",fill:i,"aria-disabled":a,className:y.svg,onClick:x,onKeyDown:b,tabIndex:f}),A=()=>V.jsx("img",{src:w,width:e||"14px",height:r||"auto",alt:h,onError:()=>g(!0),onClick:x,className:y.img,title:h,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&x(I)}});return(()=>{const I=d?.startsWith("https://")||d?.startsWith("http://")||d?.startsWith("#")||d?.startsWith("/"),E=_?T():A(),M=h?V.jsx("span",{title:h,children:E}):E;return I?V.jsx("a",{href:d,children:M}):M})()});function Po({children:t}){return Q.useSyncExternalStore(()=>()=>{},()=>!0,()=>!1)?lue.createPortal(t,document.body):null}function Ro({position:t="bottom",open:e=!1}){const r=Q.useRef(null),n=Q.useRef(null),i=Q.useRef(null),[a,s]=Q.useState(0),o=Q.useCallback(()=>{const l=r.current,c=n.current;if(!l||!c)return;const{top:u,left:h,width:f,height:d}=l.getBoundingClientRect();s(f);const p=c.offsetHeight,g=c.offsetWidth;if(g===0||p===0){i.current&&requestAnimationFrame(i.current);return}const m=window.scrollY,v=window.scrollX,y=window.innerWidth,x=window.innerHeight;let b=u+m,w=h+v,_=t;const S={top:u-p<0,bottom:u+d+p>x,left:h-g<0,right:h+f+g>y};switch(t){case"top":S.top&&!S.bottom&&(_="bottom");break;case"bottom":S.bottom&&!S.top&&(_="top");break;case"left":S.left&&!S.right&&(_="right");break;case"right":S.right&&!S.left&&(_="left");break}switch(_){case"top":b=u+m-p;break;case"bottom":b=u+m+d;break;case"left":w=h+v-g;break;case"right":w=h+v+f;break}b=Math.max(m,Math.min(b,m+x-p)),w=Math.max(v,Math.min(w,v+y-g)),requestAnimationFrame(()=>{c.style.transform=`translate(${w}px, ${b}px)`,c.style.opacity="1"})},[t]);return Q.useLayoutEffect(()=>{i.current=o},[o]),Q.useLayoutEffect(()=>{if(!e)return;let l;const c=()=>{const h=r.current,f=n.current;h&&f?o():l=requestAnimationFrame(c)};l=requestAnimationFrame(c);const u=new MutationObserver(()=>{o()});return n.current&&u.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{cancelAnimationFrame(l),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),u.disconnect()}},[o,e]),{anchorRef:r,targetRef:n,anchorWidth:a}}const Y5={"smp-label":"_smp-label_zl3eb_1","smp-label-disabled":"_smp-label-disabled_zl3eb_6","smp-label-wrapper":"_smp-label-wrapper_zl3eb_10"},K5={"smp-helper-text":"_smp-helper-text_19lg0_1","smp-helper-text-danger":"_smp-helper-text-danger_19lg0_5","smp-helper-text-success":"_smp-helper-text-success_19lg0_9","smp-helper-text-disabled":"_smp-helper-text-disabled_19lg0_13"},B0=({helperText:t,disabled:e,state:r,id:n})=>{const i={container:`${K5["smp-helper-text"]} ${e?K5["smp-helper-text-disabled"]:""} ${r?K5[`smp-helper-text-${r}`]:""}`};return V.jsx("label",{className:i.container,id:n,children:t})},Bue={"smp-helper-tooltip":"_smp-helper-tooltip_2mlq3_1"},Fue=({helperTooltip:t,ref:e})=>{const r={container:`${Bue["smp-helper-tooltip"]}`};return V.jsx("div",{className:r.container,ref:e,children:V.jsx(B0,{helperText:t})})},No=({label:t,disabled:e,htmlFor:r,helper:n=""})=>{const[i,a]=Q.useState(!1),{anchorRef:s,targetRef:o}=Ro({position:"right",open:i}),l={container:`${Y5["smp-label"]} ${e?Y5["smp-label-disabled"]:""}`,labelWrapper:Y5["smp-label-wrapper"]};return V.jsxs("div",{className:l.labelWrapper,children:[V.jsx("label",{className:l.container,htmlFor:r,children:t}),n&&V.jsx("div",{ref:s,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:V.jsx(Dr,{icon:"info_outline",tabIndex:0,width:14,isInteractable:!0,onClick:()=>{a(c=>!c)}})}),V.jsx(Po,{children:i&&n&&V.jsx(Fue,{helperTooltip:n,ref:o})})]})},us={"smp-layout":"_smp-layout_12t3b_1","smp-layout-horizontal":"_smp-layout-horizontal_12t3b_9","smp-layout-vertical":"_smp-layout-vertical_12t3b_15","smp-layout-section-grid":"_smp-layout-section-grid_12t3b_20","smp-layout-section-vertical":"_smp-layout-section-vertical_12t3b_24","smp-layout-section-horizontal":"_smp-layout-section-horizontal_12t3b_28","smp-layout-cell-container":"_smp-layout-cell-container_12t3b_33","smp-layout-section-flex":"_smp-layout-section-flex_12t3b_37","smp-grid-template-cols":"_smp-grid-template-cols_12t3b_56","smp-grid-template-rows":"_smp-grid-template-rows_12t3b_60","smp-layout-section-with-title":"_smp-layout-section-with-title_12t3b_64","smp-layout-section-title":"_smp-layout-section-title_12t3b_70","smp-layout-inline":"_smp-layout-inline_12t3b_76"},$ue=(t,e)=>{const r=[];for(let n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return r},VW=(t,e)=>t.map(r=>{if(r.sections?.length)return{...r,sections:VW(r.sections,e),content:r.content};let n=r.sections,i=r.content;return r.content?.length&&r.columns&&+r.columns>1&&(n=$ue(r.content.filter(s=>e.includes(s.id||"")),+r.columns).map((s,o)=>({...r,id:`${r.id}-${o}`,content:s,horizontal:!0})),i=[]),{...r,sections:n,content:i}}),LR=(t,e)=>{if(!e)return{};const r=t.some(n=>n.dim)?t.map(n=>n.dim||"auto").join(" "):`repeat(${t.length}, 1fr)`;return{[e]:r}},PR=t=>t.some(e=>e.dim&&!e.dim.endsWith("%")),zue=(t,e)=>t.visible===!0?!0:t.visible===void 0?e?e.visible!==!1:!0:!1,Vue=()=>({getSectionPathId:t=>`section-${t.join("-")}`}),RR=t=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[t],Uue={base:{ghost:"base",outlined:"base",raised:"base"},danger:{ghost:"danger",outlined:"danger",raised:"onDanger"},primary:{ghost:"primary",outlined:"primary",raised:"onPrimary"}},NR=(t,e)=>Uue[t][e],jc={"smp-button-container":"_smp-button-container_navqi_1","smp-button-extraSmall":"_smp-button-extraSmall_navqi_18","smp-button-small":"_smp-button-small_navqi_23","smp-button-base":"_smp-button-base_navqi_28","smp-button-large":"_smp-button-large_navqi_33","smp-button-extraLarge":"_smp-button-extraLarge_navqi_38","smp-button-FullWidth":"_smp-button-FullWidth_navqi_43","smp-button-squared":"_smp-button-squared_navqi_47","smp-buttonType-raised":"_smp-buttonType-raised_navqi_54","smp-buttonVariant-base":"_smp-buttonVariant-base_navqi_56","smp-buttonActive":"_smp-buttonActive_navqi_78","smp-buttonVariant-primary":"_smp-buttonVariant-primary_navqi_85","smp-buttonVariant-danger":"_smp-buttonVariant-danger_navqi_114","smp-buttonExt-oneButton-horizontal":"_smp-buttonExt-oneButton-horizontal_navqi_154","smp-buttonExt-oneButton-vertical":"_smp-buttonExt-oneButton-vertical_navqi_164","smp-buttonType-outlined":"_smp-buttonType-outlined_navqi_187","smp-buttonType-ghost":"_smp-buttonType-ghost_navqi_257"},Yr=t=>t==null?!1:typeof t=="string"?t.toLocaleLowerCase()=="yes"||t.toLocaleLowerCase()=="true":t,jue={success:"onSuccessLight",info:"onInfoLight",error:"onDangerLight",warning:"onWarningLight"},OR={"smp-badge":"_smp-badge_1r96t_2","smp-badge-text":"_smp-badge-text_1r96t_19"};function BR(t,e){return new RegExp(Hue(t),e)}function Hue(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q7(t){if(!t)return{};const e={};let r="",n="",i=0,a=!0;for(const s of t)a&&s!=="("&&s!==")"?r+=s:s==="("?(i===0?a=!1:n+=s,i++):s===")"?(i===1?(e[r.trim()]=n,a=!0,r="",n=""):n+=s,i--):n+=s;return e}const Gue=t=>{if(!t||typeof t!="string")return s2({});try{const e=q7(t);if(e?.B&&typeof e.B=="string"){const r=q7(e.B);return s2(r)}return s2(e)}catch(e){return console.warn("Failed to parse badge string:",t,e),s2({})}},s2=t=>{const e=t||{},r=a=>a&&["success","info","error","warning"].includes(a)?a:"info",n=a=>a&&["TopRight","TopLeft","BottomRight","BottomLeft","Inline"].includes(a)?a:"TopRight";return{bindValue:(a=>!a||typeof a!="string"?"":a.trim())(e.Txt),type:r(e.Typ),position:n(e.Pos),color:e.Col?.trim()||"",icon:e.Ico?.trim()||""}},Wue={titleLarge:"h2",title:"h3",body:"h6",label:"label",code:"code",link:"a"},su={"smp-typography":"_smp-typography_vxkf1_1","smp-typography-body":"_smp-typography-body_vxkf1_8","smp-text-number":"_smp-text-number_vxkf1_11","smp-typography-title":"_smp-typography-title_vxkf1_16","smp-typography-titleLarge":"_smp-typography-titleLarge_vxkf1_20","smp-typography-label":"_smp-typography-label_vxkf1_24","smp-typography-disabled":"_smp-typography-disabled_vxkf1_29","smp-typography-left":"_smp-typography-left_vxkf1_33","smp-typography-center":"_smp-typography-center_vxkf1_37","smp-typography-right":"_smp-typography-right_vxkf1_41","smp-typography-toolbar":"_smp-typography-toolbar_vxkf1_51","smp-text-negative":"_smp-text-negative_vxkf1_56","smp-typography-ellipsis":"_smp-typography-ellipsis_vxkf1_61"},wI="smp-toolbar",que=["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter","Escape"," "],X7=t=>t.replace(`${wI}-`,"").split("-").map(e=>parseInt(e,10)).filter(e=>!isNaN(e)),Xue=t=>`${wI}-${t.filter(e=>!isNaN(e)).join("-")}`,fS=(t,e)=>e?`${e}-${t}`:`${wI}-${t}`,Yue=(t,e)=>e?`${e}-${t}`:`toolbar-item-${t}`,dS=t=>!!t.fun&&t.forcedLeaf===!1&&!(t.children&&t.children.length>0),Y7=(t,e,r,n)=>{if(!t||e.length===0)return t;const i={...t};i.children=[...t.children??[]];let a=i.children;const s=[],o=[];for(let l=0;l<e.length;l++){const c=e[l],u=a[c];if(!u)break;const h={...u};if(l===e.length-1){if(a[c]=r(h),n){const f=a.map((d,p)=>p===c?a[p]:n({...d}));if(l===0)i.children=f;else{const d=s[s.length-1],p=o[o.length-1];d[p]={...d[p],children:f}}}}else h.children=[...h.children??[]],a[c]=h,s.push(a),o.push(c),a=h.children}return i},m_=(t,e)=>{t.current.has(e)&&requestAnimationFrame(()=>{t.current.get(e)?.focus()})},UW=t=>(t.children?.length??0)>0;function Kue(t,e,r,n){return{handleKeyDown:Q.useCallback(async(a,s,o)=>{if(!que.includes(a.key))return;a.preventDefault(),a.stopPropagation();const l=e.current.get(o),c=X7(o);if(l)switch(a.key){case"ArrowDown":case"ArrowUp":{const h=c[c.length-1]+(a.key==="ArrowDown"?1:-1);if(h>=0){const f=o.split("-");f.pop();const d=`${f.join("-")}-${h}`;m_(e,d)}break}case"ArrowRight":{r(s,o),m_(e,fS(0,o));break}case"ArrowLeft":case"Escape":{c.pop();const u=Xue(c);e.current.has(u)&&(t(h=>h&&Y7(h,c,f=>({...f,isExpanded:!1}))),m_(e,u));break}case"Enter":{!UW(s)&&!dS(s)&&n?.(s);break}}},[r,e,t,n])}}const Ke={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BREADCRUMBS:"BRD",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",EDITOR:"EDT",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",LABEL:"LBL",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",MULTI_SELECT:"SML",MULTI_COMBOBOX:"CML",MULTI_CONFIG:"CFM",RADIO:"RAD",SELECT:"SEL",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",BUTTON_GROUP:"BTO",TIME:"TIM",TIMEPICKER:"TPK",FILE_UPLOAD:"FUP",PASSWORD:"PWD",TREE:"TRE"},zv={CODE_ONLY:"CodeOnly",DESC_ONLY:"DescOnly",BOTH:"Both"},_1={INFO:"INFO",ERROR:"ERROR",QUEST:"QUEST",WARNING:"WARNING",UNAUTHORIZED:"UNAUTHORIZED"},hg={TN:"TN",TM:"TM",PM:"PM",TS:"TS",TT:"TT"},Zue={ON_LOADING:"OnLoading"},Jue={obj:{t:"",p:"",k:""},fun:"",isEditable:!1,shape:Ke.TEXT_FIELD,icon:"error",value:"No data found"};function Que(t,e,r){const n=async(o,l)=>{if(!dS(o))a(l,{isExpanded:!0});else if(e){a(l,{isLoading:!0});try{const c=await e(o);a(l,{isLoading:!1,children:c?.children&&c.children.length>0?c.children:[Jue],isExpanded:!0},{isExpanded:!1})}catch(c){console.error("Failed to load dynamic node data:",c),a(l,{isLoading:!1})}}},i=o=>{a(o,{isExpanded:!1})},a=(o,l,c)=>{t(u=>u&&Y7(u,X7(o),f=>({...f,...l}),c?f=>({...f,...c}):void 0))};return{handleNodeExpand:n,handleMouseLeave:i,onToolbarRadioLeafNodeClick:(o,l,c)=>{t(u=>u&&Y7(u,X7(l),f=>{const d={...f,obj:{t:f.obj?.t||"",p:f.obj?.p||"",k:c.obj?.k||""}};return r?.(d),d}))}}}const jW=t=>{const e=Q.useRef(null);return Q.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},t)}},fb=(t,e,r)=>{if(t==""&&(e==""||e==null))return"";if(r)switch(r){case"CodeOnly":return t||"";case"DescOnly":return e||"";case"Both":return`${t}${e?` - ${e}`:""}`}return t||""},Z5={key:"f4",ctrlKey:!1,altKey:!1},eo={"smp-textfield-wrapper":"_smp-textfield-wrapper_1ib4r_4","smp-textfield":"_smp-textfield_1ib4r_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_1ib4r_31","smp-textfield-extraSmall":"_smp-textfield-extraSmall_1ib4r_37","smp-textfield-small":"_smp-textfield-small_1ib4r_42","smp-textfield-base":"_smp-textfield-base_1ib4r_47","smp-textfield-large":"_smp-textfield-large_1ib4r_52","smp-textfield-extraLarge":"_smp-textfield-extraLarge_1ib4r_57","smp-textfield-input":"_smp-textfield-input_1ib4r_63","smp-textfield-decode-wrapper":"_smp-textfield-decode-wrapper_1ib4r_84","smp-textfield-outlined":"_smp-textfield-outlined_1ib4r_93","smp-textfield-danger":"_smp-textfield-danger_1ib4r_104","smp-textfield-disabled":"_smp-textfield-disabled_1ib4r_111","smp-textfield-FullWidth":"_smp-textfield-FullWidth_1ib4r_120","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_1ib4r_124"},Vm=Q.createContext({}),ehe=()=>Q.useContext(Vm),ia=({id:t,disabled:e=!1,bindValue:r,optionalDisplayValue:n,icon:i,placeholder:a,isEditable:s=!0,shapeIcon:o,sizing:l="base",state:c,variant:u,tooltip:h=!1,rotatedShapeIcon:f=!1,ref:d,inputRef:p,inputType:g="text",ariaLabel:m="input field",label:v,helperText:y=!1,error:x,appearance:b="base",isClearable:w=!1,FullWidth:_="No",_dataComponent:S="textfield",min:C,max:T,step:A,inputMode:k="text",width:I,autocomplete:E,size:M,maxLength:R,style:D,DescrMode:L="Both",hasAdvanceResearch:P=!0,onBlur:O,onChange:$,onKeyDown:N,onEnter:U,onShapeIconClick:j,onClick:B,onAdvanceResearchActivation:q,...W})=>{const[X,K]=Q.useState(!1),[G,H]=Q.useState(void 0),{anchorRef:Y,targetRef:J}=Ro({position:"bottom",open:X}),ie=Q.useId(),me=`${ie}-helper`,oe=x?"danger":c,ne=y||!!x,de=Ot=>{$?.({bindValue:Ot.target.value})},ve=()=>{r&&r!=""&&$?.({bindValue:""})},Ne=Ot=>{if(Ot.key.toLowerCase()===Z5.key.toLowerCase()&&Z5.ctrlKey===Ot.ctrlKey&&Z5.altKey===Ot.altKey&&P&&(Ot.preventDefault(),Ot.stopPropagation(),H(void 0),K(!0),q?.()),Ot.altKey&&Ot.key.toLowerCase()!=="alt"&&P){Ot.preventDefault(),Ot.stopPropagation();const xr=`Alt+${Ot.key===" "?"space":Ot.key.toUpperCase()}`;H(xr),K(!0),q?.()}Ot.key=="Enter"&&U?.({bindValue:r}),N?.(Ot)},{onAdvanceResearchLoadInitialData:ke,onAdvanceResearchLeafNodeClick:Le,advanceResearchAutoSelect:$e}=ehe(),Ee=Ot=>{if(Le){const Ea=p&&"current"in p&&p.current?p.current.value:r;Le(Ot,Ea)}K(!1)},pe=()=>{if(ke){const Ot=W.obj??{t:"",p:"",k:""};return ke(t||"",Ot,G)}return Promise.resolve({type:"SmeupDataTree",children:[]})},Ve={wrapper:`${eo["smp-textfield-wrapper"]} ${Yr(_)?eo["smp-textfield-FullWidth"]:""}`,container:`${eo["smp-textfield"]} ${e||!s?eo["smp-textfield-disabled"]:""} ${a?eo["smp-textfield-placeholder"]:""} ${l?eo[`smp-textfield-${l}`]:""} ${oe?eo[`smp-textfield-${oe}`]:""} ${b?eo[`smp-textfield-${b}`]:""} ${h?eo["smp-textfield-top-right-indicator"]:""}`,input:`${eo["smp-textfield-input"]}`,decodeWrapper:` ${n?eo["smp-textfield-decode-wrapper"]:""}`};if(u&&(u!=="notSelectable"||s)){const Ot=eo[`smp-textfield-variant-${u}`];Ot&&(Ve.container+=` ${Ot}`)}const qe=L==="DescOnly"?n||"":r,tt=I?{"--smp-textField-width-base":I,...D}:D,_t=V.jsxs("div",{className:Ve.container,ref:d,style:tt,children:[i&&V.jsx(Dr,{icon:i,disabled:e||!s}),V.jsx("input",{id:ie,name:t,type:g,value:qe,placeholder:a,onChange:de,onBlur:()=>O?.({bindValue:r}),className:Ve.input,disabled:e||!s,onKeyDown:Ne,"aria-label":m,ref:p,"aria-describedby":ne?me:void 0,min:C,max:T,step:A,inputMode:k,autoComplete:E,size:M,maxLength:R,onClick:B}),w&&V.jsx(Dr,{icon:"clear",onClick:ve,tabIndex:0,isInteractable:!0}),o&&V.jsx(Dr,{icon:o,disabled:e||!s,onClick:j,rotated:f,isInteractable:s,tabIndex:0})]});return V.jsxs("div",{className:Ve.wrapper,"data-component":S,children:[v&&V.jsx(No,{label:v,disabled:e||!s,htmlFor:ie,helper:W.helper}),V.jsxs("div",{className:Ve.decodeWrapper,ref:Y,children:[_t,L!="DescOnly"&&L!="CodeOnly"&&V.jsx(jn,{bindValue:n||"",disabled:e||!s,variant:"body",role:"note"}),X&&V.jsx(Po,{children:V.jsx(_I,{ref:J,autoSelect:$e,onToolbarLoadInitialData:pe,onToolbarLeafNodeClick:Ee,onToolbarClickOutside:()=>K(!1)})})]}),ne&&V.jsx(B0,{helperText:x,disabled:e||!s,state:oe,id:me})]})};function HW({items:t,itemHeight:e,containerHeight:r,overscan:n=5}){const[i,a]=Q.useState(0),s=Q.useRef(null),o=t.length*e,l=Math.max(0,Math.floor(i/e)-n),c=Math.min(t.length-1,Math.floor((i+r)/e)+n),u=[];for(let d=l;d<=c;d++)u.push({item:t[d],index:d,offsetTop:d*e});const h=Q.useCallback(d=>{const p=d.target.scrollTop;a(p)},[]),f=d=>{if(!s.current)return;const p=d*e,g=p+e,m=s.current,v=m.scrollTop,y=v+r;p<v?m.scrollTop=p:g>y&&(m.scrollTop=g-r)};return{virtualItems:u,containerProps:{ref:s,style:{maxHeight:`${r}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:h},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:i,viewportHeight:r,totalHeight:o,startIndex:l,endIndex:c},scrollToIndex:f}}function the(t,e,r="14px IBM Plex Sans, sans-serif",n=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=r;let s=0;for(const o of t){const l=fb(o.obj?.k,o.decode,e),c=a.measureText(l);s=Math.max(s,c.width)}return Math.ceil(s+n)}const cp={"smp-list":"_smp-list_krf6k_1","smp-list-floating":"_smp-list-floating_krf6k_8","smp-list-container":"_smp-list-container_krf6k_16","smp-list-listItem":"_smp-list-listItem_krf6k_23","smp-list-listItem-left":"_smp-list-listItem-left_krf6k_44"},rhe=10,V3=({id:t,options:e,DescrMode:r="Both",ref:n,showFilter:i,selectedIndex:a=null,activeIndex:s=[],width:o,onClick:l,onKeyDown:c,onOpen:u,isOpen:h,floating:f=!1,showLeadingIcon:d=!1})=>{const[p,g]=Q.useState(""),m=40,[v,y]=Q.useState(a!==null?a:-1),[x,b]=Q.useState(o||200),w=Q.useRef(null),_=Q.useRef(null),S=i!==void 0?i:e.length>rhe,C=Q.useMemo(()=>{if(!p)return e;const O=$=>typeof $=="string"&&$.toLowerCase().includes(p.toLowerCase());return e.filter($=>r==="CodeOnly"?O($.obj?.k):r==="DescOnly"?O($.decode):!!(O($.obj?.k)||O($.decode)))},[p,e,r]),T=O=>{g(O)},{virtualItems:A,containerProps:k,innerProps:I,scrollToIndex:E}=HW({items:C,itemHeight:m,containerHeight:200,overscan:5});Q.useEffect(()=>{a!==null&&a!==v&&y(a)},[a]),Q.useEffect(()=>{v>=0&&v<C.length&&E(v)},[v,C]),Q.useEffect(()=>{h&&(u?.(_?.current),w?.current&&w.current.focus())},[h,w,u]),Q.useEffect(()=>{const O=the(e,r);b(O)},[e,r]);const M=O=>{if(O.key==="ArrowDown"||O.key==="ArrowUp"){O.preventDefault();let $=v;O.key==="ArrowDown"?$=v<C.length-1?v+1:0:O.key==="ArrowUp"&&($=v>0?v-1:C.length-1),y($)}else O.key==="Enter"?v>=0&&v<C.length&&l?.(O,C[v]):O.key==="Escape"&&(O.preventDefault(),O.stopPropagation());c&&c(O)},R=O=>{M(O)},D=O=>{M(O)},L={wrapper:`${cp["smp-list"]} ${f?cp["smp-list-floating"]:""}`,container:`${cp["smp-list-container"]}`,virtualScroll:`${cp["smp-list-virtualScroll"]}`,listItem:`${cp["smp-list-listItem"]}`,listItemLeft:`${cp["smp-list-listItem-left"]}`},P=f?Math.max(o||0,200):o;return V.jsxs("div",{id:t,ref:n,className:L.wrapper,"data-component":"list",style:{width:f?x:"200px",minWidth:P},children:[S&&V.jsx(ia,{bindValue:p,placeholder:"Search...",FullWidth:"Yes",onChange:O=>T(O.bindValue),onKeyDown:R,inputRef:w}),V.jsx("div",{...k,className:L.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:D,"aria-activedescendant":v>=0&&v<C.length?C[v]?.obj?.k:void 0,children:V.jsx("div",{...I,className:L.virtualScroll,children:A.map(({item:O,index:$,offsetTop:N})=>{const U=O.obj?.k?s.includes(O.obj.k):!1;return V.jsxs("li",{ref:v===$?_:null,role:"option",id:$+"li","aria-selected":v===$?"true":"false",tabIndex:-1,className:`${L.listItem} ${v===$?"selected-item":""}`,"aria-label":O.obj?.k+"-"+O.decode,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${N}px)`},onClick:j=>{l?.(j,O),y($)},children:[V.jsxs("div",{className:L.listItemLeft,children:[d&&V.jsx(Dr,{icon:O.icon||"",width:16,placeholderIcon:O.placeholderIcon||""}),fb(O.obj?.k,O?.decode||O?.value,r)]}),U&&V.jsx(Dr,{icon:"check",width:16})]},$+"li")})})})]})},eu={"smp-floating-toolbar-container":"_smp-floating-toolbar-container_b75re_17","smp-toolbar-node-content":"_smp-toolbar-node-content_b75re_39","smp-clickable":"_smp-clickable_b75re_61","smp-not-clickable":"_smp-not-clickable_b75re_71","smp-toolbar-node-children-container":"_smp-toolbar-node-children-container_b75re_81","smp-expanded":"_smp-expanded_b75re_111","smp-toolbar-node":"_smp-toolbar-node_b75re_39","smp-toolbar-node-icon-text-container":"_smp-toolbar-node-icon-text-container_b75re_171","smp-toolbar-node-text":"_smp-toolbar-node-text_b75re_185"},nhe=({node:t,index:e,level:r,parentId:n,toolbarNodesRefs:i,handleKeyDown:a,handleNodeExpand:s,handleMouseLeave:o,onToolbarLeafNodeClick:l,onToolbarRadioLeafNodeClick:c,renderToolbarNodes:u})=>{const h=fS(e,n??""),f=UW(t),d=!f&&!t?.isLoading&&!dS(t),{anchorRef:p,targetRef:g}=Ro({open:t.isExpanded??!1,position:"right"}),m={node:eu["smp-toolbar-node"],nodeContent:eu["smp-toolbar-node-content"],clickable:eu["smp-clickable"],notClickable:eu["smp-not-clickable"],iconTextContainer:eu["smp-toolbar-node-icon-text-container"],nodeText:eu["smp-toolbar-node-text"],childrenContainer:eu["smp-toolbar-node-children-container"],expanded:eu["smp-expanded"]};return t?.shape===Ke.RADIO?V.jsx("div",{ref:v=>{v&&i.current.set(h,v)},className:m.node,role:"radiogroup","data-node-id":h,tabIndex:-1,"smp-id":Yue(e,n??""),children:V.jsx(V3,{options:t.options?t.options:[],isOpen:!0,"data-node-id":h,DescrMode:zv.DESC_ONLY,selectedIndex:t.options?.findIndex(v=>v.obj?.k===t.obj?.k),activeIndex:[t.obj.k],onClick:(v,y)=>{c(t,h,y)}},h)},h):V.jsx(V.Fragment,{children:V.jsxs("div",{ref:v=>{v&&i.current.set(h,v)},className:m.node,tabIndex:0,role:"menuitem","data-nodeid":h,"smp-id":`toolbar-item-${e}`,"aria-expanded":t?.isExpanded,onKeyDown:v=>a(v,t,h),onMouseEnter:()=>{s(t,h)},onMouseLeave:()=>{o(h)},onClick:()=>{d&&l?.(t)},children:[V.jsxs("div",{className:`${m.nodeContent} ${d?m.clickable:m.notClickable}`,ref:p,children:[V.jsxs("div",{className:m.iconTextContainer,children:[V.jsx(Dr,{icon:t.icon??""}),V.jsx("span",{className:m.nodeText,children:V.jsx(jn,{variant:"body",bindValue:t.value||""})})]}),t.isLoading?V.jsx(Dr,{icon:"spinner",spin:!0}):f||dS(t)?V.jsx(Dr,{icon:"chevron-right"}):V.jsx(Dr,{icon:""})]}),f&&V.jsx(Po,{children:V.jsx("div",{className:`${m.childrenContainer} ${t.isExpanded?m.expanded:""}`,ref:g,style:{"--smp-toolbar-z-index":`${1001+r}`},children:u(r+1,t.children??[],h)})})]},h)})},F0=(t,e,r)=>{Q.useEffect(()=>{if(!e)return;const n=i=>{t?.some(s=>{if(typeof s=="object"&&s!==null&&"current"in s){const o=s?.current;return o&&o.contains(i.target)}})||r()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t,r,e])},_I=({data:t,ref:e,autoSelect:r,onToolbarLoadNodeData:n,onToolbarLeafNodeClick:i,onToolbarLoadInitialData:a,onToolbarClickOutside:s})=>{const o=Q.useRef(new Map),[l,c]=Q.useState([]),[u,h]=Q.useState(t),f=Q.useCallback(b=>{b?.current&&c(w=>w.some(_=>_.current===b.current)?w:[...w,b])},[]);F0(l,!0,()=>{c([]),s?.()}),Q.useEffect(()=>{u&&o.current.forEach(b=>{b&&f({current:b})})},[u,f]);const{handleNodeExpand:d,handleMouseLeave:p,onToolbarRadioLeafNodeClick:g}=Que(h,n,i),{handleKeyDown:m}=Kue(h,o,d,i),v=jW(400),y={floatingContainer:eu["smp-floating-toolbar-container"]};Q.useEffect(()=>{if(!u&&a){const b=a();b&&typeof b.then=="function"&&b.then(w=>{r&&w?.children&&w.children.length===1&&typeof i=="function"?i(w.children[0]):h(w)}).finally(()=>{requestAnimationFrame(()=>m_(o,fS(0)))}).catch(w=>{console.error("Errore nel caricamento dati iniziali - Toolbar",w)})}},[t,v,a,u,r,i]);const x=Q.useCallback(function b(w,_,S=null){return _?.length?V.jsx(V.Fragment,{children:_.map((C,T)=>V.jsx(nhe,{node:C,index:T,level:w,parentId:S,toolbarNodesRefs:o,handleKeyDown:m,handleNodeExpand:d,handleMouseLeave:p,onToolbarLeafNodeClick:i,onToolbarRadioLeafNodeClick:g,renderToolbarNodes:b},fS(T,S??"")))}):null},[m,d,p,i,g]);return!u||!u?.children?.length?null:V.jsx("div",{ref:e,className:`${e?y.floatingContainer:null}`,"aria-label":"Toolbar","data-component":"toolbar","smp-id":"toolbar-menu",children:x(0,u.children)})},FR=/_G?(?:\d{2}[A-Z0-9]\d{2}_|\*(?:BOLD|ERROR|ITALIC|UNDERLINE)_)|_n_/g;function ihe(t){return/_G?(?:\d{2}[A-Z0-9]\d{2}_|\*(?:BOLD|ERROR|ITALIC|UNDERLINE)_)|_n_/.test(t)}function ahe(t){const e=[];let r=0,n,i=null;for(;n=FR.exec(t);){const a=n.index;if(a>r){const o=t.substring(r,a);i?i.content+=o:e.push({content:o})}const s=n[0];if(s==="_n_")i?(i.closed=!0,i=null):e.push({content:""});else{const o=s.replace(/^_G?/,"").replace(/_$/,"");i&&(i.closed=!0),i={tag:o,content:""},e.push(i)}r=FR.lastIndex}if(r<t.length){const a=t.substring(r);i?i.content+=a:e.push({content:a})}return i&&(i.closed=!0),e}function she(t){return ahe(t)?.map((e,r)=>{const n=e.content||"";if(e.tag){const i=lhe(e.tag);return V.jsx("span",{"data-gcell-code":e.tag,style:i,children:n},r)}return V.jsx("span",{children:n},r)})}const ohe=/^[a-zA-Z0-9]+$/,$R={"*BOLD":{fontWeight:"bold"},"*ERROR":{color:"white",backgroundColor:"red"},"*UNDERLINE":{textDecoration:"underline"},"*ITALIC":{fontStyle:"italic"}};function lhe(t){if(!t)return{};if($R[t])return $R[t];if(!ohe.test(t))return{};let e={};return t.split("").forEach((r,n)=>{switch(n){case 0:e.color=`var(--smp-gcell-color-${r})`;break;case 1:e=che(e,r);break;case 2:e.background=`var(--smp-gcell-background-color-${r})`;break;case 3:e.fontFamily=`var(--smp-gcell-font-family-${r})`;break}}),e}function che(t,e){switch(e){case"1":return{...t,fontWeight:"bold"};case"2":return{...t,fontStyle:"italic"};case"3":return{...t,textDecoration:"underline"};default:return t}}const jn=({variant:t="body",bindValue:e,color:r,role:n,className:i,style:a,toolbar:s,justifiedContent:o,ellipsis:l=!1,onToolbarLeafNodeClick:c,onToolbarLoadInitialData:u,onToolbarLoadNodeData:h,onAiIconClick:f,onTypographyRightClick:d,...p})=>{const g=Wue[t],[m,v]=Q.useState(!1),{anchorRef:y,targetRef:x}=Ro({position:"bottom",open:m}),b=C=>C?C.split(" ").filter(Boolean).map(T=>su[T]||T).join(" "):"",w={container:`${su["smp-typography"]} ${t?su[`smp-typography-${t}`]:""} ${p.disabled?su["smp-typography-disabled"]:""} ${o?su[`smp-typography-${o}`]:""} ${b(i)}`,toolbar:`${su["smp-typography-toolbar"]} `},_=C=>{c&&c(C),v(!1)},S=ihe(e)?she(e):e;return V.jsxs(V.Fragment,{children:[V.jsxs(g,{"data-component":"typography",className:w.container,disabled:p.disabled,href:t=="link"?e:void 0,target:t=="link"?"_blank":void 0,rel:t=="link"?"noopener noreferrer":void 0,style:{"--smp-typography-color-base":r,...a},role:n,onContextMenu:C=>{d&&(C.preventDefault(),d())},children:[l?V.jsx("span",{className:su["smp-typography-ellipsis"],title:e,children:S}):S,s&&V.jsx("div",{"smp-id":"toolbar-button",ref:y,className:w.toolbar,children:V.jsx(Dr,{tabIndex:0,icon:"more_vert",isInteractable:!0,onClick:C=>{C.stopPropagation(),v(!0)}})}),f&&V.jsx("div",{"smp-id":"typography-ai-icon",className:w.toolbar,children:V.jsx(Dr,{tabIndex:0,icon:"smeup-ai",title:"Smeup AI",isInteractable:!0,onClick:C=>{C.stopPropagation(),f()}})})]}),m&&V.jsx(Po,{children:V.jsx(_I,{ref:x,onToolbarLeafNodeClick:_,onToolbarLoadNodeData:h,onToolbarLoadInitialData:u,onToolbarClickOutside:()=>v(!1)})})]})},uhe=({badgeString:t})=>{const{bindValue:e,type:r,icon:n,position:i}=Gue(t??""),a={main:OR["smp-badge"],text:OR["smp-badge-text"]};return V.jsxs("div",{id:Q.useId(),className:a.main,"smp-id":"badge","data-component":"badge","data-badge-position":i,"data-badge-type":r,children:[n&&V.jsx(Dr,{icon:n,state:jue[r??"info"]}),e&&V.jsx(jn,{bindValue:e??"",variant:"label",className:a.text})]})},lr=({bindValue:t,onClick:e,ariaLabel:r,icon:n,placeholderIcon:i,disabled:a,sizing:s="base",variant:o="primary",appearance:l="raised",showIcon:c=!0,ShowText:u="Yes",FullWidth:h="No",loading:f=!1,justify:d="center",BtnTit:p,optionalDisplayValue:g,squared:m=!1,submit:v=!1,active:y=!1,buttonExt:x,Badge:b,className:w})=>{const _={container:`${jc["smp-button"]} ${jc["smp-button-container"]} ${s?jc[`smp-button-${s}`]:""} ${o?jc[`smp-buttonVariant-${o}`]:""} ${l?jc[`smp-buttonType-${l}`]:""} ${Yr(h)?jc["smp-button-FullWidth"]:""} ${`smp-justify-${d}`} ${m&&!u?jc["smp-button-squared"]:""} ${y?jc["smp-buttonActive"]:""} ${x?jc[`smp-buttonExt-${x}`]:""}`};return V.jsxs("button",{"data-component":"button",type:v?"submit":"button",className:`${_.container} ${w}`,onClick:e,"aria-label":r,disabled:a,"aria-busy":f,title:p||g,children:[f?V.jsx(Dr,{icon:"spinner",state:NR(o,l),spin:!0}):V.jsxs(V.Fragment,{children:[n&&c&&V.jsx(Dr,{icon:n,placeholderIcon:i,disabled:a,state:NR(o,l),width:RR(s),height:RR(s)}),Yr(u)&&V.jsx("span",{children:g||t})]}),b&&V.jsx(uhe,{badgeString:b})]})},Il={"smp-tabbar-container":"_smp-tabbar-container_iv2nm_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_iv2nm_9","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_iv2nm_15","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_iv2nm_19","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_iv2nm_23","smp-tabbar-list":"_smp-tabbar-list_iv2nm_23","smp-tabbar-tab":"_smp-tabbar-tab_iv2nm_40","smp-active":"_smp-active_iv2nm_66","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_iv2nm_118","smp-tabbar-tab-small":"_smp-tabbar-tab-small_iv2nm_123","smp-tabbar-tab-base":"_smp-tabbar-tab-base_iv2nm_128","smp-tabbar-tab-large":"_smp-tabbar-tab-large_iv2nm_133","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_iv2nm_138"},SI=({data:t,variant:e="base",sizing:r="large",selectedIndex:n,ref:i,onTabChange:a,onToolbarLoadInitialData:s,onToolbarLoadNodeData:o,onToolbarLeafNodeClick:l,onTabAiIconClick:c,onTypographyRightClick:u})=>{const[h,f]=Q.useState(n??0),[d,p]=Q.useState(n);n!==void 0&&n!==d&&(f(n),p(n));const[g,m]=Q.useState(!1),[v,y]=Q.useState(!1),x=100,b=2,w=()=>{const A=_.current;A&&(m(A.scrollLeft>0),y(A.scrollLeft+A.clientWidth<A.scrollWidth-b))},_=Q.useRef(null);if(Q.useEffect(()=>{const A=_.current;if(!A)return;w();const k=()=>w();return A.addEventListener("scroll",k),window.addEventListener("resize",w),()=>{A.removeEventListener("scroll",k),window.removeEventListener("resize",w)}},[]),!t.children||t.children.length===0)return V.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const S={container:Il["smp-tabbar-container"],listWrapper:Il["smp-tabbar-list-wrapper"],list:Il["smp-tabbar-list"],tab:`${Il["smp-tabbar-tab"]} ${r?Il[`smp-tabbar-tab-${r}`]:""}`,scrollButtonRight:`${Il["smp-tabbar-scroll-button"]} ${Il["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${Il["smp-tabbar-scroll-button"]} ${Il["smp-tabbar-scroll-buttonLeft"]}`,active:Il["smp-active"]},C=()=>{_.current?.scrollBy({left:-x,behavior:"smooth"})},T=()=>{_.current?.scrollBy({left:x,behavior:"smooth"})};return V.jsxs("div",{className:S.container,role:"tabpanel","data-component":"tab-bar","data-variant":e,children:[g&&V.jsx("div",{className:S.scrollButtonLeft,children:V.jsx(lr,{bindValue:"",optionalDisplayValue:"<",onClick:C,variant:"base",sizing:r})}),V.jsx("div",{className:S.listWrapper,children:V.jsx("div",{className:S.list,ref:_,role:"tablist",children:t.children.map((A,k)=>{const I=A.data?.agentCode;return V.jsxs("button",{ref:k===h?i:void 0,type:"button","data-comp-id-tab":A.data?.["data-comp-id"]??void 0,className:`${k===h?S.active:""} ${S.tab} `,role:"tab","aria-selected":k===h,onClick:()=>{a?.(k,A),f(k)},children:[A.icon&&V.jsx(Dr,{icon:A.icon,placeholderIcon:A.placeholderIcon}),V.jsx(jn,{variant:"body",bindValue:A.decode||`Tab ${k+1}`,...A.data?.toolbar===!0&&h===k?{toolbar:!0,onToolbarLeafNodeClick:l,onToolbarLoadInitialData:s,onToolbarLoadNodeData:o}:{},...I&&c&&h===k?{onAiIconClick:()=>c(I)}:{},...u&&h===k?{onTypographyRightClick:u}:{}})]},k)})})}),v&&V.jsx("div",{className:S.scrollButtonRight,children:V.jsx(lr,{bindValue:"",optionalDisplayValue:">",onClick:T,variant:"base",sizing:r})})]})};var GW=(t=>(t.Auto="auto",t.Always="always",t))(GW||{});const S1={"smp-breadcrumbs":"_smp-breadcrumbs_11pz5_6","smp-breadcrumb-item":"_smp-breadcrumb-item_11pz5_13","smp-breadcrumb-link":"_smp-breadcrumb-link_11pz5_19","smp-breadcrumb-collapse":"_smp-breadcrumb-collapse_11pz5_33","smp-breadcrumb-lastElement":"_smp-breadcrumb-lastElement_11pz5_43"},hhe=t=>t?.type==="SmeupDataTree",fhe=t=>t?.type==="SmeupDataTable",v_={obj:{t:"",p:"",k:""},decode:"",shape:void 0},WW=(t,e=1)=>t.reduce((r,n)=>{const i=n.children?.length?WW(n.children,e+1):e;return Math.max(r,i)},e),pc=t=>{if(fhe(t)){const e=t,r=e.columns.filter(a=>a.visible!==!1),n=r[0]?.name??"",i=r[1]?.name??n;return e.rows.reduce((a,s)=>{const o={...s.cells?.[n],decode:s.cells?.[i]?.value||s.cells?.[n].obj?.k};return[...a,o]},[])}else if(hhe(t))return qW(t.children??[])},qW=t=>t?.map(e=>({...e,decode:e.decode||e.value||e.obj?.k||"",children:qW(e.children??[])})),XW=({data:t,fun:e,label:r,options:n,CollapseThr:i,CollapseMode:a=GW.Auto,onOptionsRequest:s,onClick:o,onToolbarLeafNodeClick:l,onToolbarLoadNodeData:c,onToolbarLoadInitialData:u,onTypographyRightClick:h})=>{const f=Q.useId(),d=t?.children||n,[p,g]=Q.useState(d);Q.useEffect(()=>{g(d)},[d]);const m=Q.useRef(null),[v,y]=Q.useState(!1),[x,b]=Q.useState(0);Q.useEffect(()=>{!p&&s&&e&&s(e,void 0).then(O=>g(pc(O)||[])).catch(O=>{console.error("Errore nel caricamento delle opzioni per Breadcrumbs",O)})},[p,e,s]);const{anchorRef:w,targetRef:_,anchorWidth:S}=Ro({position:"bottom",open:v}),C=Q.useCallback(()=>{y(!1),m?.current?.focus()},[]);F0([_],v,()=>C());const T={breadcrumbs:S1["smp-breadcrumbs"],breacrumbItem:S1["smp-breadcrumb-item"],link:S1["smp-breadcrumb-link"],lastElement:S1["smp-breadcrumb-lastElement"],collapse:S1["smp-breadcrumb-collapse"]},A=O=>{O.key==="Escape"&&C()},k=(O,$)=>{o?.(O,$)},I=O=>{const $=Math.max(Number(i)||3,3);let N=!1,U;const j=O&&O[O.length-1];let B;return a==="always"?(B=O&&O.slice(0,O.length-1),N=!!(B&&B.length>0)):(N=O&&O.length>$,U=O&&O.length>1?O[0]:void 0,B=O&&O.slice(1,O.length-1)),{shouldCollapse:N,first:U,last:j,middleItems:B}},E=O=>{O?.focus()},M=(O,$,N)=>{if(!O)return;const U=O?.decode||O?.value||O?.obj?.k;return V.jsxs("li",{className:T.breacrumbItem,"aria-current":N?"page":void 0,children:[(O?.icon||O?.placeholderIcon)&&V.jsx(Dr,{icon:O.icon||"",placeholderIcon:O.placeholderIcon||"",width:16}),O?.fun&&!N?V.jsx("a",{href:"/",onClick:j=>{j.preventDefault(),k?.(j,O)},className:T.link,children:V.jsx(jn,{variant:"body",bindValue:U||""})}):V.jsx(jn,{variant:"title",bindValue:U||"",ellipsis:!0,className:T.lastElement,toolbar:N&&!!u,onToolbarLeafNodeClick:l,onToolbarLoadNodeData:c,onToolbarLoadInitialData:u,onTypographyRightClick:h})]},$)},{shouldCollapse:R,first:D,last:L,middleItems:P}=I(p);return V.jsxs("nav",{"aria-label":"Breadcrumbs","data-component":"breadcrumbs",children:[r&&V.jsx(No,{label:r,htmlFor:f}),V.jsxs("ol",{className:T.breadcrumbs,id:f,children:[M(D,0,!1),R&&V.jsxs("li",{ref:m,className:`${T.breacrumbItem} ${T.collapse}`,children:[V.jsx("div",{ref:w,"aria-label":"Show more breadcrumbs",children:V.jsx(Dr,{icon:"more_horiz",isInteractable:!0,tabIndex:0,onClick:O=>{O.preventDefault(),y($=>!$),b(0)}})}),v&&V.jsx(Po,{children:V.jsx(V3,{options:P||[],onClick:k,ref:_,width:S,showFilter:!1,onKeyDown:A,onOpen:E,isOpen:v,floating:!0,selectedIndex:x,DescrMode:"DescOnly",showLeadingIcon:!0})})]}),!R&&P?.map((O,$)=>M(O,$+1,!1)),M(L,p&&p.length-1||0,!0)]})]})},CI=t=>t?t.t=="D8"||t.t=="A8":!1,YW=t=>t?t.t=="NR":!1,KW=t=>t?t.t=="I1":!1,dhe=t=>t?t.t=="V2"&&t.p=="SI/NO":!1,phe=t=>t?t.t=="V2"&&t.p=="ON/OFF":!1,ghe=t=>t?t.t=="JL":!1,ZW=t=>t?t.t=="J1"&&t.p=="URL":!1,mhe=t=>t?t.t=="J1"&&t.p=="PATHFILE":!1,vhe=t=>{if(t){const e=t.split(";");if(e.length>=3)return{t:e[0],p:e[1],k:e.slice(2).join(";")}}return{t:"",p:"",k:""}};class pS{class;value;constructor(e,r){this.class=e,this.value=r}static fromDataObj(e){return new pS(e,!!(e&&(e.k=="1"||e.k=="true")))}getValue(){return this.value}getLegacyValue(){if(this.class?.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function yhe(t,e){if(fg(t)){const u=new Date(t);if(!isNaN(u.getTime()))return u}const r=new Date;let n;/[/-]/.test(t)?n=t.split(/[/-]/).map((h,f)=>f<2&&h.length===1?"0"+h:h).join(""):n=t.replaceAll("/","").replaceAll("-","");let i="DDMMYYYY";e==="en"&&(i="MMDDYYYY");const a=i.indexOf("DD"),s=i.indexOf("MM");let o=0,l=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),r.setDate(o),o2(r)?r:t;case 3:case 4:return o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),s===0?(r.setMonth(o-1),r.setDate(l)):a===0&&(r.setMonth(l-1),r.setDate(o)),o2(r)?r:t;case 5:case 6:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),Number(n.substring(4))>=50?c="19"+n.substring(4):c="20"+n.substring(4);let u=0,h=0;return s===0?(u=l,h=o-1,r.setFullYear(parseInt(c),h,u)):a===0&&(u=o,h=l-1,r.setFullYear(parseInt(c),h,u)),rm(o,h,parseInt(c))&&o2(r)?r:t}case 7:case 8:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),c=n.substring(4);let u=0,h=0;return s===0?(u=l,h=o-1,r.setFullYear(parseInt(c),h,u)):a===0&&(u=o,h=l-1,r.setFullYear(parseInt(c),h,u)),rm(u,h,parseInt(c))&&o2(r)?r:t}}return t}function fg(t){return/^\d{4}-\d{2}-\d{2}$/.test(t)&&t.length===10}function o2(t){return t instanceof Date&&!isNaN(t.getTime())}function xhe(t){if(!/^\d{8}$/.test(t))return!1;const e=parseInt(t.slice(0,4),10),r=parseInt(t.slice(4,6),10),n=parseInt(t.slice(6,8),10);return rm(n,r-1,e)}function bhe(t){if(!/^\d{6}$/.test(t))return!1;const e=parseInt(gS(t.substring(0,2))+t.substring(0,2),10),r=parseInt(t.slice(2,4),10),n=parseInt(t.slice(4,6),10);return rm(n,r-1,e)}function whe(t){if(!/^\d{6}$/.test(t))return!1;const e=parseInt(gS(t.substring(4,6))+t.substring(4,6),10),r=parseInt(t.slice(2,4),10),n=parseInt(t.slice(0,2),10);return rm(n,r-1,e)}function _he(t){if(!/^\d{8}$/.test(t))return!1;const e=parseInt(t.slice(4,8),10),r=parseInt(t.slice(2,4),10),n=parseInt(t.slice(0,2),10);return rm(n,r-1,e)}function gS(t){return parseInt(t.substring(0,2))>39?"19":"20"}function rm(t,e,r){const n=[31,She(r)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||t<1||t>n[e])}function She(t){return t%4===0&&(t%100!==0||t%400===0)}function Che(t){const e=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(r))||isNaN(Number(n))?t.toString():`${e}-${r}-${n}`}class nm{class;date;constructor(e,r){this.class=e,this.date=r}static fromDataObj(e){if(e){const r=zR.get(`${e.t}${e.p}`);if(r)return new nm(e,r.legacyToIso(e.k));throw console.error(`Date creation from ${e.t}${e.p} not implemented yet`)}else throw console.error("Date creation from obj undefined not implemented yet")}getLegacyValue(){if(this.class){const e=zR.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.date);throw console.error(`Date object not implemented ${this.class.t}${this.class.p}`)}throw console.error("Date object not implemented for obj undefined")}getValue(){return this.date}}const zR=new Map([["D8*YYMD",{legacyToIso(t){return xhe(t)&&`${t.substring(0,4)}-${t.substring(4,6)}-${t.substring(6,8)}`||t},isoToLegacy(t){return fg(t)&&t.replaceAll("-","")||t}}],["D8*YMD",{legacyToIso(t){return bhe(t)?`${gS(t.substring(0,2))+t.substring(0,2)}-${t.substring(2,4)}-${t.substring(4,6)}`:t},isoToLegacy(t){if(fg(t)){const e=t.split("-");return e[0].substring(2)+e[1]+e[2]}return t}}],["D8*DMY",{legacyToIso(t){return whe(t)?`${gS(t.substring(4,6))+t.substring(4,6)}-${t.substring(2,4)}-${t.substring(0,2)}`:t},isoToLegacy(t){if(fg(t)){const e=t.split("-");return e[2]+e[1]+e[0].substring(2)}return t}}],["D8*DMYY",{legacyToIso(t){return _he(t)?`${t.substring(4,8)}-${t.substring(2,4)}-${t.substring(0,2)}`:t},isoToLegacy(t){if(fg(t)){const e=t.split("-");return e[2]+e[1]+e[0]}return t}}],["A8",{legacyToIso(t){return t},isoToLegacy(t){return t}}]]);class h0{class;value;decimalSeparator;constructor(e,r,n="."){this.class=e,this.value=r,this.decimalSeparator=n}static fromDataObj(e,r){if(e){const n=r==="."?",":".";if(e.k==="")return new h0(e,void 0,r);let i=e.k.trim();const a=i.endsWith("-");a&&(i=i.slice(0,-1));const o=i.replace(new RegExp(`\\${n}`,"g"),"").replace(r,"."),l=parseFloat(o),c=a?-l:l;return new h0(e,c,r)}throw console.error("Number not implemented for obj undefined")}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}function Ahe(t){return typeof t=="string"&&/^\d{6}$/.test(t)}class mS{class;time;constructor(e,r){this.class=e,this.time=r}static fromDataObj(e){if(e){const r=VR.get(`${e.t}${e.p}`);if(r)return new mS(e,r.legacyToIso(e.k));throw console.error(`time creation from ${e.t}${e.p} not implemented yet`)}throw console.error("time creation from obj undefined not implemented yet")}getLegacyValue(){if(this.class){const e=VR.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw console.error(`Time object not implemented ${this.class.t}${this.class.p}`)}throw console.error("Time object not implemented for obj undefined")}getValue(){return this.time}}const VR=new Map([["I12",{legacyToIso(t){return Ahe(t)&&`${t.substring(0,2)}:${t.substring(2,4)}:${t.substring(4,6)}`||t},isoToLegacy(t){return t.replaceAll(":","")||t}}]]),Xt=t=>typeof t=="string",C1=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},UR=t=>t==null?"":""+t,The=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},khe=/###/g,jR=t=>t&&t.indexOf("###")>-1?t.replace(khe,"."):t,HR=t=>!t||Xt(t),yy=(t,e,r)=>{const n=Xt(e)?e.split("."):e;let i=0;for(;i<n.length-1;){if(HR(t))return{};const a=jR(n[i]);!t[a]&&r&&(t[a]=new r),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return HR(t)?{}:{obj:t,k:jR(n[i])}},GR=(t,e,r)=>{const{obj:n,k:i}=yy(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],s=e.slice(0,e.length-1),o=yy(t,s,Object);for(;o.obj===void 0&&s.length;)a=`${s[s.length-1]}.${a}`,s=s.slice(0,s.length-1),o=yy(t,s,Object),o?.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=r},Ehe=(t,e,r,n)=>{const{obj:i,k:a}=yy(t,e,Object);i[a]=i[a]||[],i[a].push(r)},vS=(t,e)=>{const{obj:r,k:n}=yy(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Ihe=(t,e,r)=>{const n=vS(t,r);return n!==void 0?n:vS(e,r)},JW=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?Xt(t[n])||t[n]instanceof String||Xt(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):JW(t[n],e[n],r):t[n]=e[n]);return t},up=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Dhe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Mhe=t=>Xt(t)?t.replace(/[&<>"'\/]/g,e=>Dhe[e]):t;class Lhe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Phe=[" ",",","?","!",";"],Rhe=new Lhe(20),Nhe=(t,e,r)=>{e=e||"",r=r||"";const n=Phe.filter(s=>e.indexOf(s)<0&&r.indexOf(s)<0);if(n.length===0)return!0;const i=Rhe.getRegExp(`(${n.map(s=>s==="?"?"\\?":s).join("|")})`);let a=!i.test(t);if(!a){const s=t.indexOf(r);s>0&&!i.test(t.substring(0,s))&&(a=!0)}return a},K7=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let a=0;a<n.length;){if(!i||typeof i!="object")return;let s,o="";for(let l=a;l<n.length;++l)if(l!==a&&(o+=r),o+=n[l],s=i[o],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&l<n.length-1)continue;a+=l-a+1;break}i=s}return i},Yy=t=>t?.replace("_","-"),Ohe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class yS{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||Ohe,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(Xt(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new yS(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new yS(this.logger,e)}}var oc=new yS;class U3{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,a])=>{for(let s=0;s<a;s++)i(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,a])=>{for(let s=0;s<a;s++)i.apply(i,[e,...r])})}}class WR extends U3{constructor(e,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,r],n&&(Array.isArray(n)?o.push(...n):Xt(n)&&a?o.push(...n.split(a)):o.push(n)));const l=vS(this.data,o);return!l&&!r&&!n&&e.indexOf(".")>-1&&(e=o[0],r=o[1],n=o.slice(2).join(".")),l||!s||!Xt(n)?l:K7(this.data?.[e]?.[r],n,a)}addResource(e,r,n,i,a={silent:!1}){const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,r];n&&(o=o.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(o=e.split("."),i=r,r=o[1]),this.addNamespaces(r),GR(this.data,o,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(Xt(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a,s={silent:!1,skipCopy:!1}){let o=[e,r];e.indexOf(".")>-1&&(o=e.split("."),i=n,n=r,r=o[1]),this.addNamespaces(r);let l=vS(this.data,o)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?JW(l,n,a):l={...l,...n},GR(this.data,o,l),s.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var QW={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{e=this.processors[a]?.process(e,r,n,i)??e}),e}};const eq=Symbol("i18next/PATH_KEY");function Bhe(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>(r?.revoke?.(),i===eq?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)),Proxy.revocable(Object.create(null),e).proxy}function Z7(t,e){const{[eq]:r}=t(Bhe());return r.join(e?.keySeparator??".")}const qR={},J5=t=>!Xt(t)&&typeof t!="boolean"&&typeof t!="number";class xS extends U3{constructor(e,r={}){super(),The(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=oc.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if(i?.res===void 0)return!1;const a=J5(i.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const s=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Nhe(e,n,i);if(s&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:Xt(a)?[a]:a};const c=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(i)}return{key:e,namespaces:Xt(a)?[a]:a}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=Z7(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]);const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],i),c=l[l.length-1];let u=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const h=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return f?a?{res:`${c}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:`${c}${u}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:o;const d=this.resolve(e,i);let p=d?.res;const g=d?.usedKey||o,m=d?.exactUsedKey||o,v=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Xt(i.count),w=xS.hasDefaultValue(i),_=b?this.pluralResolver.getSuffix(h,i.count,i):"",S=i.ordinal&&b?this.pluralResolver.getSuffix(h,i.count,{ordinal:!1}):"",C=b&&!i.ordinal&&i.count===0,T=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${_}`]||i[`defaultValue${S}`]||i.defaultValue;let A=p;x&&!p&&w&&(A=T);const k=J5(A),I=Object.prototype.toString.apply(A);if(x&&A&&k&&v.indexOf(I)<0&&!(Xt(y)&&Array.isArray(A))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const E=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...i,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(d.res=E,d.usedParams=this.getUsedParamsDetails(i),d):E}if(s){const E=Array.isArray(A),M=E?[]:{},R=E?m:g;for(const D in A)if(Object.prototype.hasOwnProperty.call(A,D)){const L=`${R}${s}${D}`;w&&!p?M[D]=this.translate(L,{...i,defaultValue:J5(T)?T[D]:void 0,joinArrays:!1,ns:l}):M[D]=this.translate(L,{...i,joinArrays:!1,ns:l}),M[D]===L&&(M[D]=A[D])}p=M}}else if(x&&Xt(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,e,i,n));else{let E=!1,M=!1;!this.isValidLookup(p)&&w&&(E=!0,p=T),this.isValidLookup(p)||(M=!0,p=o);const D=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&M?void 0:p,L=w&&T!==p&&this.options.updateMissing;if(M||E||L){if(this.logger.log(L?"updateKey":"missingKey",h,c,o,L?T:p),s){const N=this.resolve(o,{...i,keySeparator:!1});N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let P=[];const O=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&O&&O[0])for(let N=0;N<O.length;N++)P.push(O[N]);else this.options.saveMissingTo==="all"?P=this.languageUtils.toResolveHierarchy(i.lng||this.language):P.push(i.lng||this.language);const $=(N,U,j)=>{const B=w&&j!==p?j:D;this.options.missingKeyHandler?this.options.missingKeyHandler(N,c,U,B,L,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(N,c,U,B,L,i),this.emit("missingKey",N,c,U,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?P.forEach(N=>{const U=this.pluralResolver.getSuffixes(N,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(j=>{$([N],o+j,i[`defaultValue${j}`]||T)})}):$(P,o,T))}p=this.extendTranslation(p,e,i,d,n),M&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${c}${u}${o}`),(M||E)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${o}`:o,E?p:void 0,i))}return a?(d.res=p,d.usedParams=this.getUsedParamsDetails(i),d):p}extendTranslation(e,r,n,i,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const l=Xt(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const h=e.match(this.interpolator.nestingRegexp);c=h&&h.length}let u=n.replace&&!Xt(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||i.usedLng,n),l){const h=e.match(this.interpolator.nestingRegexp),f=h&&h.length;c<f&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>a?.[0]===h[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${r[0]}`),null):this.translate(...h,r),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,o=Xt(s)?[s]:s;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=QW.handle(o,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,s,o;return Xt(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),u=c.key;i=u;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=r.count!==void 0&&!Xt(r.count),d=f&&!r.ordinal&&r.count===0,p=r.context!==void 0&&(Xt(r.context)||typeof r.context=="number")&&r.context!=="",g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(m=>{this.isValidLookup(n)||(o=m,!qR[`${g[0]}-${m}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(qR[`${g[0]}-${m}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(v=>{if(this.isValidLookup(n))return;s=v;const y=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(y,u,v,m,r);else{let b;f&&(b=this.pluralResolver.getSuffix(v,r.count,r));const w=`${this.options.pluralSeparator}zero`,_=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&b.indexOf(_)===0&&y.push(u+b.replace(_,this.options.pluralSeparator)),y.push(u+b),d&&y.push(u+w)),p){const S=`${u}${this.options.contextSeparator||"_"}${r.context}`;y.push(S),f&&(r.ordinal&&b.indexOf(_)===0&&y.push(S+b.replace(_,this.options.pluralSeparator)),y.push(S+b),d&&y.push(S+w))}}let x;for(;x=y.pop();)this.isValidLookup(n)||(a=x,n=this.getResource(v,m,x,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:s,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Xt(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}class XR{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=oc.create("languageUtils")}getScriptPartFromCode(e){if(e=Yy(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Yy(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(Xt(e)&&e.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(s=>{if(s===a)return s;if(!(s.indexOf("-")<0&&a.indexOf("-")<0)&&(s.indexOf("-")>0&&a.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===a||s.indexOf(a)===0&&a.length>1))return s})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),Xt(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),i=[],a=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return Xt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):Xt(e)&&a(this.formatLanguageCode(e)),n.forEach(s=>{i.indexOf(s)<0&&a(this.formatLanguageCode(s))}),i}}const YR={zero:0,one:1,two:2,few:3,many:4,other:5},KR={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Fhe{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=oc.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=Yy(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let s;try{s=new Intl.PluralRules(n,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),KR;if(!e.match(/-|_/))return KR;const l=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(l,r)}return this.pluralRulesCache[a]=s,s}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>YR[i]-YR[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const ZR=(t,e,r,n=".",i=!0)=>{let a=Ihe(t,e,r);return!a&&i&&Xt(r)&&(a=K7(t,r,n),a===void 0&&(a=K7(e,r,n))),a},Q5=t=>t.replace(/\$/g,"$$$$");class $he{constructor(e={}){this.logger=oc.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:s,suffix:o,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:d,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:m,maxReplaces:v,alwaysFormat:y}=e.interpolation;this.escape=r!==void 0?r:Mhe,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?up(a):s||"{{",this.suffix=o?up(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?up(f):d||up("$t("),this.nestingSuffix=p?up(p):g||up(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=v||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>r?.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){let a,s,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=d=>{if(d.indexOf(this.formatSeparator)<0){const v=ZR(r,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,n,{...i,...r,interpolationkey:d}):v}const p=d.split(this.formatSeparator),g=p.shift().trim(),m=p.join(this.formatSeparator).trim();return this.format(ZR(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure),m,n,{...i,...r,interpolationkey:g})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>Q5(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?Q5(this.escape(d)):Q5(d)}].forEach(d=>{for(o=0;a=d.regex.exec(e);){const p=a[1].trim();if(s=c(p),s===void 0)if(typeof u=="function"){const m=u(e,a,i);s=Xt(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))s="";else if(h){s=a[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),s="";else!Xt(s)&&!this.useRawValueToEscape&&(s=UR(s));const g=d.safeValue(s);if(e=e.replace(a[0],g),h?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=a[0].length):d.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,s;const o=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const h=l.split(new RegExp(`${u}[ ]*{`));let f=`{${h[1]}`;l=h[0],f=this.interpolate(f,s);const d=f.match(/'/g),p=f.match(/"/g);((d?.length??0)%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),c&&(s={...c,...s})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${u}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];s={...n},s=s.replace&&!Xt(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const c=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(c!==-1&&(l=i[1].slice(c).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),i[1]=i[1].slice(0,c)),a=r(o.call(this,i[1].trim(),s),s),a&&i[0]===e&&!Xt(a))return a;Xt(a)||(a=UR(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((u,h)=>this.format(u,h,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const zhe=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);e==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(s=>{if(s){const[o,...l]=s.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();r[u]||(r[u]=c),c==="false"&&(r[u]=!1),c==="true"&&(r[u]=!0),isNaN(c)||(r[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:r}},JR=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const s=n+JSON.stringify(a);let o=e[s];return o||(o=t(Yy(n),i),e[s]=o),o(r)}},Vhe=t=>(e,r,n)=>t(Yy(r),n)(e);class Uhe{constructor(e={}){this.logger=oc.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?JR:Vhe;this.formats={number:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a});return o=>s.format(o)}),currency:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a,style:"currency"});return o=>s.format(o)}),datetime:n((i,a)=>{const s=new Intl.DateTimeFormat(i,{...a});return o=>s.format(o)}),relativetime:n((i,a)=>{const s=new Intl.RelativeTimeFormat(i,{...a});return o=>s.format(o,a.range||"day")}),list:n((i,a)=>{const s=new Intl.ListFormat(i,{...a});return o=>s.format(o)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=JR(r)}format(e,r,n,i={}){const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{const{formatName:c,formatOptions:u}=zhe(l);if(this.formats[c]){let h=o;try{const f=i?.formatParams?.[i.interpolationkey]||{},d=f.locale||f.lng||i.locale||i.lng||n;h=this.formats[c](o,d,{...u,...i,...f})}catch(f){this.logger.warn(f)}return h}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const jhe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Hhe extends U3{constructor(e,r,n,i={}){super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=oc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,i.backend,i)}queueLoad(e,r,n,i){const a={},s={},o={},l={};return e.forEach(c=>{let u=!0;r.forEach(h=>{const f=`${c}|${h}`;!n.reload&&this.store.hasResourceBundle(c,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,u=!1,s[f]===void 0&&(s[f]=!0),a[f]===void 0&&(a[f]=!0),l[h]===void 0&&(l[h]=!0)))}),u||(o[c]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],s=i[1];r&&this.emit("failedLoading",a,s,r),!r&&n&&this.store.addResourceBundle(a,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const o={};this.queue.forEach(l=>{Ehe(l.loaded,[a],s),jhe(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const u=l.loaded[c];u.length&&u.forEach(h=>{o[c][h]===void 0&&(o[c][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:s});return}this.readingCalls++;const o=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,i+1,a*2,s)},a);return}s(c,u)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,r);c&&typeof c.then=="function"?c.then(u=>o(null,u)).catch(o):o(null,c)}catch(c){o(c)}return}return l(e,r,o)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Xt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Xt(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(s=>{this.loadOne(s)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(s,o)=>{s&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,s),!s&&o&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,o),this.loaded(e,s,o)})}saveMissing(e,r,n,i,a,s={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend?.create){const l={...s,isUpdate:a},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(e,r,n,i,l):u=c(e,r,n,i),u&&typeof u.then=="function"?u.then(h=>o(null,h)).catch(o):o(null,u)}catch(u){o(u)}else c(e,r,n,i,o,l)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const QR=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Xt(t[1])&&(e.defaultValue=t[1]),Xt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),eN=t=>(Xt(t.ns)&&(t.ns=[t.ns]),Xt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Xt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),l2=()=>{},Ghe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class Ky extends U3{constructor(e={},r){if(super(),this.options=eN(e),this.services={},this.logger=oc,this.modules={external:[]},Ghe(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(Xt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=QR();this.options={...n,...this.options,...eN(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const i=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?oc.init(i(this.modules.logger),this.options):oc.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Uhe;const u=new XR(this.options);this.store=new WR(this.options.resources,this.options);const h=this.services;h.logger=oc,h.resourceStore=this.store,h.languageUtils=u,h.pluralResolver=new Fhe(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(h.formatter=i(c),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new $he(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Hhe(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new xS(this.services,this.options),this.translator.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,r||(r=l2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const o=C1(),l=()=>{const c=(u,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(h),r(u,h)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,r=l2){let n=r;const i=Xt(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],s=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&a.indexOf(c)<0&&a.push(c)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload?.forEach?.(o=>s(o)),this.services.backendConnector.load(a,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(o)})}else n(null)}reloadResources(e,r,n){const i=C1();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=l2),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&QW.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,r){this.isLanguageChangingTo=e;const n=C1();this.emit("languageChanging",e);const i=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),r&&r(o,(...c)=>this.t(...c))},s=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=Xt(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(Xt(o)?[o]:o);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{a(u,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),n}getFixedT(e,r,n){const i=(a,s,...o)=>{let l;typeof s!="object"?l=this.options.overloadTranslationOptionHandler([a,s].concat(o)):l={...s},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||i.keyPrefix);const c=this.options.keySeparator||".";let u;return l.keyPrefix&&Array.isArray(a)?u=a.map(h=>(typeof h=="function"&&(h=Z7(h,{...this.options,...s})),`${l.keyPrefix}${c}${h}`)):(typeof a=="function"&&(a=Z7(a,{...this.options,...s})),u=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a),this.t(u,l)};return Xt(e)?i.lng=e:i.lngs=e,i.ns=r,i.keyPrefix=n,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(o,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];return c===-1||c===0||c===2};if(r.precheck){const o=r.precheck(this,s);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,e)&&(!i||s(a,e)))}loadNamespaces(e,r){const n=C1();return this.options.ns?(Xt(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=C1();Xt(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return a.length?(this.options.preload=i.concat(a),this.loadResources(s=>{n.resolve(),r&&r(s)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const i=new Intl.Locale(e);if(i&&i.getTextInfo){const a=i.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services?.languageUtils||new XR(QR());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){return new Ky(e,r)}cloneInstance(e={},r=l2){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new Ky(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((u,h)=>(u[h]={...l[c][h]},u),l[c]),l),{});a.store=new WR(o,i),a.services.resourceStore=a.store}return a.translator=new xS(a.services,i),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ai=Ky.createInstance();ai.createInstance=Ky.createInstance;ai.createInstance;ai.dir;ai.init;ai.loadResources;ai.reloadResources;ai.use;ai.changeLanguage;ai.getFixedT;ai.t;ai.exists;ai.setDefaultNamespace;ai.hasLoadedNamespace;ai.loadNamespaces;ai.loadLanguages;const Whe={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},qhe={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Xhe={AddSubGroup:"Aggiungi sottogruppo",AddFilter:"Aggiungi Filtro",Operator:{String:{Starts:"Inizia per",Contains:"Contiene",Equals:"È uguale a"},Number:{Greater:"Maggiore di",GreaterOrEqual:"Maggiore o uguale a",Less:"Minore di",LessOrEqual:"Minore o uguale a",Equals:"Uguale a",NotEquals:"Diverso da"},Date:{Before:"Prima del",After:"Dopo del",On:"Il giorno"}}},Yhe={SelectFiles:"Scegli",DropAreaLabel:"Trascina i file qua oppure clicca sul bottone",Upload:"Carica",Cancel:"Annulla",Retry:"Riprova",FileTooLarge:"Dimensione del file non consentita"},Khe={CalendarFor:"Calendario per",Close:"Chiudi",Apply:"Applica",Remove:"Rimuovi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione",ChipsInputDefaultPlaceholder:"Inserisci il valore e premi invio",NotificationWidgetNoMessages:"Nessuna notifica",NotificationWidgetDismissAll:"Cancella tutto",ShapeNotSupportedYet:"Forma grafica non ancora supportata: "},Zhe={DismissAll:"Cancella tutto",NoActive:"Nessuna notifica attiva"},Jhe={Bold:"Grassetto (Ctrl-B)",Italic:"Corsivo (Ctrl-I)",Underline:"Sottolineato (Ctrl-U)",Strikethrough:"Barrato (Alt-Maiusc-5)",H1:"Titolo principale",H2:"Titolo secondario",Text:"Testo",CodeBlock:"Blocco di codice",Link:"Link",ListOrdered:"Lista ordinata",ListBullet:"Lista puntata",SmeupLink:"Smeup link",SmeupLinkT:"Tipo",SmeupLinkP:"Parametro",SmeupLinkK:"Codice",SmeupLinkFUN:"FUN"},Qhe={OpenInNew:"Apri il file PDF in un nuovo tab",Download:"Scarica il file PDF",Print:"Stampa il file PDF",Missing:"File PDF mancante",Error:"Errore durante il caricamento del file PDF"},efe={OpenInNew:"Apri il link in un nuovo tab"},tfe={Collapse:"Collassa",Expand:"Espandi"},rfe={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Whe,Month:qhe,FilterBuilder:Xhe,FileUpload:Yhe,Generic:Khe,Notification:Zhe,TextEditor:Jhe,PDF:Qhe,Htm:efe,MindMap:tfe},nfe={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},ife={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},afe={AddSubGroup:"Add Sub Group",AddFilter:"Add Filter",Operator:{String:{Starts:"Starts with",Contains:"Contains",Equals:"Equal to"},Number:{Greater:"Greater than",GreaterOrEqual:"Greater or equal than",Less:"Less than",LessOrEqual:"Less or equal than",Equals:"Equal to",NotEquals:"Other than"},Date:{Before:"Before date",After:"After date",On:"On"}}},sfe={SelectFiles:"Choose",DropAreaLabel:"Drop file here or click the button to Choose",Upload:"Upload",Cancel:"Cancel",Retry:"Retry",FileTooLarge:"File too large"},ofe={CalendarFor:"Calendar for",Close:"Close",Apply:"Apply",Remove:"Remove",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description",ChipsInputDefaultPlaceholder:"Insert value and press enter",NotificationWidgetNoMessages:"No notifications",NotificationWidgetDismissAll:"Dismiss all",ShapeNotSupportedYet:"Shape not supported yet: "},lfe={DismissAll:"Dismiss all",NoActive:"No active notification"},cfe={Bold:"Bold (Ctrl-B)",Italic:"Italic (Ctrl-I)",Underline:"Underline (Ctrl-U)",Strikethrough:"Strikethrough (Alt-Maiusc-5)",H1:"Main title",H2:"Secondary title",Text:"Text",CodeBlock:"Code block",Link:"Link",ListOrdered:"List ordered",ListBullet:"List bullet",SmeupLink:"Smeup link",SmeupLinkT:"Type",SmeupLinkP:"Parameter",SmeupLinkK:"Code",SmeupLinkFUN:"FUN"},ufe={OpenInNew:"Open PDF document in a new tab",Download:"Download PDF document",Print:"Print PDF document",Missing:"Missing PDF document",Error:"Error during PDF document loading"},hfe={OpenInNew:"Open link in new tab"},ffe={Collapse:"Collapse",Expand:"Expand"},dfe={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:nfe,Month:ife,FilterBuilder:afe,FileUpload:sfe,Generic:ofe,Notification:lfe,TextEditor:cfe,PDF:ufe,Htm:hfe,MindMap:ffe},tN=(t,e,r)=>{let n=t;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),r!=null&&(n=Math.min(n,r))),n},pfe=(t,e)=>{const n=Intl.NumberFormat(t).formatToParts(1000.1),i=n.find(s=>s.type==="group")?.value??",",a=e??n.find(s=>s.type==="decimal")?.value??".";return{groupingChar:i,decimalChar:a}};function gfe(t,e,r,n){let i=e;const a=vfe(t,r);if(!i){const o=Math.abs(a);o-Math.floor(o)?i="0,0.00":i="0,0"}const s=yfe(i);return new Intl.NumberFormat(n,s).format(a)}const mfe=(t,e,r)=>{if(!t)return NaN;let n=t.replace(/\s/g,""),i=r;const a=(n.match(/\./g)||[]).length,s=(n.match(/,/g)||[]).length;if(a&&s)i=n.lastIndexOf(".")>n.lastIndexOf(",")?".":",";else if(!n.includes(r)){const l=n.includes(".")?".":",",c=l==="."?a:s;c>1||c===1&&l===e&&n.length-n.lastIndexOf(l)-1===3||(i=l)}const o=i==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),i!=="."&&(n=n.replace(new RegExp(`\\${i}`,"g"),".")),parseFloat(n)};function vfe(t,e,r,n,i){let a=t;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(BR(l,"g"),""),a=a.replace(BR(o,"g"),"."),a=Number(a)}const s=Number(a);return isNaN(s)?NaN:s}function yfe(t){const e={};t.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const r=t.indexOf(".");if(r>-1){const i=(t.substring(r+1).match(/0/g)||[]).length;e.minimumFractionDigits=i,e.maximumFractionDigits=i}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ai.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(t,e,r,n)=>{const i=n?.type??"number";try{switch(i){case"date":{const a=t instanceof Date?t:new Date(t),s=e?{dateStyle:e}:{year:"numeric",month:"2-digit",day:"2-digit"};return new Intl.DateTimeFormat(r,s).format(a)}default:case"number":{const a=n?.inputIsLocalized??!1;return gfe(t,e,a,r)}}}catch{return t}}},resources:{en:{translation:dfe},it:{translation:rfe}}});const xfe=(t,e,r,n)=>ai.format(t,e,r||ai.language,n),bfe=(t,e)=>ai.t(t,e);function Ta(){const t=Q.useCallback((n,i,a,s)=>xfe(n,i,a||void 0,s),[]),e=Q.useCallback(()=>ai.languages[0],[]),r=Q.useCallback((n,i)=>bfe(n,i),[]);return{format:t,getCurrentLanguage:e,translate:r}}var Ha=(t=>(t.CALENDAR_FOR="Date.CalendarFor",t.CLOSE="Generic.Close",t.APPLY="Generic.Apply",t.REMOVE="Generic.Remove",t.SHAPE_NOT_SUPPORTED_YET="Generic.ShapeNotSupportedYet",t.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",t.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",t.CONFIRM_BUTTON="Generic.ConfirmButton",t.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",t.CHIPS_INPUT_DEFAULT_PLACEHOLDER="Generic.ChipsInputDefaultPlaceholder",t.NOTIFICATION_WIDGET_NO_MESSAGES="Generic.NotificationWidgetNoMessages",t.NOTIFICATION_WIDGET_DISMISS_ALL="Generic.NotificationWidgetDismissAll",t))(Ha||{}),gs=(t=>(t.ADD_SUB_GROUP="FilterBuilder.AddSubGroup",t.ADD_FILTER="FilterBuilder.AddFilter",t.STRING_STARTS="FilterBuilder.Operator.String.Starts",t.STRING_CONTAINS="FilterBuilder.Operator.String.Contains",t.STRING_EQUALS="FilterBuilder.Operator.String.Equals",t.NUMBER_EQUALS="FilterBuilder.Operator.Number.Equals",t.NUMBER_NOTEQUALS="FilterBuilder.Operator.Number.NotEquals",t.NUMBER_GREATER="FilterBuilder.Operator.Number.Greater",t.NUMBER_GREATER_OR_EQUAL="FilterBuilder.Operator.Number.GreaterOrEqual",t.NUMBER_LESS="FilterBuilder.Operator.Number.Less",t.NUMBER_LESS_OR_EQUAL="FilterBuilder.Operator.Number.LessOrEqual",t.DATE_BEFORE="FilterBuilder.Operator.Date.Before",t.DATE_AFTER="FilterBuilder.Operator.Date.After",t.DATE_ON="FilterBuilder.Operator.Date.On",t))(gs||{}),Pa=(t=>(t.MONDAY="Day.Monday",t.MONDAY_SHORT="Day.MondayShort",t.TUESDAY="Day.Tuesday",t.TUESDAY_SHORT="Day.TuesdayShort",t.WEDNESDAY="Day.Wednesday",t.WEDNESDAY_SHORT="Day.WednesdayShort",t.THURSDAY="Day.Thursday",t.THURSDAY_SHORT="Day.ThursdayShort",t.FRIDAY="Day.Friday",t.FRIDAY_SHORT="Day.FridayShort",t.SATURDAY="Day.Saturday",t.SATURDAY_SHORT="Day.SaturdayShort",t.SUNDAY="Day.Sunday",t.SUNDAY_SHORT="Day.SundayShort",t))(Pa||{}),Ls=(t=>(t.JANUARY="Month.January",t.FEBRUARY="Month.February",t.MARCH="Month.March",t.APRIL="Month.April",t.MAY="Month.May",t.JUNE="Month.June",t.JULY="Month.July",t.AUGUST="Month.August",t.SEPTEMBER="Month.September",t.OCTOBER="Month.October",t.NOVEMBER="Month.November",t.DECEMBER="Month.December",t))(Ls||{}),J7=(t=>(t.PREVIOUS_DAY="Date.PreviousDay",t.PREVIOUS_WEEK="Date.PreviousWeek",t.PREVIOUS_MONTH="Date.PreviousMonth",t.PREVIOUS_YEAR="Date.PreviousYear",t.NEXT_DAY="Date.NextDay",t.NEXT_WEEK="Date.NextWeek",t.NEXT_MONTH="Date.NextMonth",t.NEXT_YEAR="Date.NextYear",t.YESTERDAY="Date.Yesterday",t.TODAY="Date.Today",t.TOMORROW="Date.Tomorrow",t))(J7||{}),Go=(t=>(t.SELECT_FILES="FileUpload.SelectFiles",t.DROP_AREA_LABEL="FileUpload.DropAreaLabel",t.UPLOAD="FileUpload.Upload",t.CANCEL="FileUpload.Cancel",t.RETRY="FileUpload.Retry",t.FILE_TOO_LARGE="FileUpload.FileTooLarge",t))(Go||{}),Q7=(t=>(t.DISMISS_ALL="Notification.DismissAll",t.NO_ACTIVE_NOTIFICATION="Notification.NoActive",t))(Q7||{}),ya=(t=>(t.BOLD="TextEditor.Bold",t.ITALIC="TextEditor.Italic",t.UNDERLINE="TextEditor.Underline",t.STRIKETHROUGH="TextEditor.Strikethrough",t.H1="TextEditor.H1",t.H2="TextEditor.H2",t.TEXT="TextEditor.Text",t.CODE_BLOCK="TextEditor.CodeBlock",t.LINK="TextEditor.Link",t.LIST_ORDERED="TextEditor.ListOrdered",t.LIST_BULLET="TextEditor.ListBullet",t.SMEUP_LINK="TextEditor.SmeupLink",t.SMEUP_LINK_T="TextEditor.SmeupLinkT",t.SMEUP_LINK_P="TextEditor.SmeupLinkP",t.SMEUP_LINK_K="TextEditor.SmeupLinkK",t.SMEUP_LINK_FUN="TextEditor.SmeupLinkFUN",t))(ya||{}),Dg=(t=>(t.OPEN_IN_NEW="PDF.OpenInNew",t.DOWNLOAD="PDF.Download",t.PRINT="PDF.Print",t.MISSING="PDF.Missing",t.ERROR="PDF.Error",t))(Dg||{}),tq=(t=>(t.OPEN_IN_NEW="Htm.OpenInNew",t))(tq||{});class f0{class;value;constructor(e,r){this.class=e,this.value=r}static fromDataObj(e){if(e)return new f0(e,e.k==""?[]:e.k.split(";"));throw console.error("time creation from obj undefined not implemented yet")}static fromString(e){return new f0({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const ld=(t,e)=>({...t,obj:{t:e.objClass?.t?e.objClass.t:t.obj?.t||"",p:e.objClass?.p?e.objClass.p:t.obj?.p||"",k:e.bindValue},decode:e.optionalDisplayValue??t.decode,fun:e.fun??t.fun}),c2=t=>{const e=f0.fromDataObj(t.obj),r=t.decode?f0.fromString(t.decode).getValue():[];return e.getValue().map((n,i)=>({bindValue:n,optionalDisplayValue:r.length>=i?r[i]:""}))},wfe=(t,e)=>{const r=new f0(t.obj,e.map(i=>i.bindValue)).getLegacyValue(),n=new f0(t.obj,e.map(i=>i.optionalDisplayValue?i.optionalDisplayValue:"")).getLegacyValue();return ld(t,{bindValue:r,optionalDisplayValue:n})},wu=t=>({bindValue:t.obj?.k||"",objClass:{t:t.obj?.t||"",p:t.obj?.p||""},fun:t.fun,optionalDisplayValue:t.decode}),AI=(t,e,r)=>{if(e)return e===Ke.TIME?Ke.TIMEPICKER:e;if(YW(t))return Ke.INPUT_NUMBER;if(CI(t))return Ke.DATE;if(KW(t))return Ke.TIMEPICKER;if(dhe(t))return Ke.CHECKBOX;if(phe(t))return Ke.SWITCH;if(ghe(t))return Ke.CHIP;if((!e||e==Ke.TEXT_FIELD)&&r&&r>=256)return Ke.MEMO},j3=({bindValue:t,optionalDisplayValue:e,options:r=[],ListDescrMode:n="Both",AcpClr:i,AcpMql:a="1",AcpWtm:s,isEditable:o=!0,fun:l,_changeOnEnter:c=!1,_disableAutocomplete:u=!1,onChange:h,onConfirmedChange:f,onOptionsRequest:d,onBlur:p,onEnter:g,_multiActiveIndex:m,autoSelectOptionIndex:v,...y})=>{const x=Q.useRef(null),[b,w]=Q.useState(t),[_,S]=Q.useState(e),{translate:C}=Ta(),[T,A]=Q.useState(!1),[k,I]=Q.useState(r),[E,M]=Q.useState(0),[R,D]=Q.useState([t]),[L,P]=Q.useState(),{anchorRef:O,targetRef:$,anchorWidth:N}=Ro({position:"bottom",open:T}),U=Q.useCallback(()=>{A(!1),x?.current?.focus()},[]);F0([$],T,()=>U());const j=jW(400);Q.useEffect(()=>{v!=null&&(d?d(l,void 0).then(H=>{const Y=pc(H)||[];I(Y),v<Y.length&&X(Y[v])}):v<r.length&&X(r[v]))},[]),Q.useEffect(()=>{c||w(t)},[t,c]);const B=H=>{u||(H.length>=parseInt(a)?q(H):U()),w(H),S(""),c||h?.({bindValue:H,optionalDisplayValue:e})},q=async H=>{if(u){if(l&&d){const Y=await d(l,void 0),J=pc(Y)||[];I(J),M(J.length>0?0:-1)}else M(r.length>0?0:-1);A(!0)}else j(async()=>{if(l&&d){const Y=await d(l,H),J=pc(Y)||[];I(J),M(J.length>0?0:-1),A(!0)}else A(Y=>!Y)})},W=()=>{T||p?.(L?wu(L):{bindValue:b})},X=H=>{P(H),c?(w(""),S("")):(w(H.obj?.k||""),S(H.decode)),h?.(wu(H)),f?.(wu(H)),M(-1),D([H.obj?.k||""]),U()},K=H=>{H.key==="Escape"&&(U(),M(-1))},G=H=>{if(!T&&H.key==="ArrowDown"&&q(b),(H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),T)){const Y=H.key==="ArrowDown"?(E+1)%k.length:(E-1+k.length)%k.length;M(Y)}switch(H.key){case"Enter":E>=0&&E<k.length?X(k[E]):(c&&(h?.({bindValue:b,optionalDisplayValue:""}),U(),w(""),S("")),g?.({bindValue:b,optionalDisplayValue:""}));break;case"Escape":U(),M(-1);break}};return V.jsxs("div",{"data-component":u?"combobox":"autocomplete",onBlur:()=>W(),children:[V.jsx(ia,{...y,bindValue:b,optionalDisplayValue:_,DescrMode:"Both",isEditable:o,shapeIcon:u?"arrow_drop_down":"magnify",placeholder:s||C(Ha.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),onBlur:()=>{},ref:O,isClearable:Yr(i),inputRef:x,onChange:H=>B(H.bindValue),onKeyDown:G,onShapeIconClick:()=>q(b),"aria-autocomplete":"list",maxLength:-1,autocomplete:"off",onAdvanceResearchActivation:()=>U()}),T&&V.jsx(Po,{children:V.jsx(V3,{options:k,DescrMode:n,onClick:(H,Y)=>X(Y),ref:$,selectedIndex:E,activeIndex:m||R,width:N,showFilter:!1,onKeyDown:K,isOpen:T,floating:!0})})]})},A1={"smp-button-group-container":"_smp-button-group-container_2xilo_1","smp-button-group-options-container":"_smp-button-group-options-container_2xilo_7","smp-button-group-danger":"_smp-button-group-danger_2xilo_16","smp-button-group-vertical":"_smp-button-group-vertical_2xilo_31"},rq=({bindValue:t,disabled:e=!1,isEditable:r=!0,label:n,DescrMode:i="DescOnly",BtoVer:a="false",BtoCol:s,options:o,onOptionsRequest:l,fun:c,helper:u,error:h,...f})=>{const[d,p]=Q.useState(o),g=Q.useId(),m=`${g}-helper`,v=h?"danger":void 0,y=!!h,x=parseInt(s??"",10),b=!isNaN(x),w=C=>{e||(f.onChange?.(wu(C)),f.onConfirmedChange?.(wu(C)))};Q.useEffect(()=>{!d&&l&&c&&l(c,void 0).then(C=>p(pc(C))).catch(C=>{console.error("Error during loading options (button group)",C)})},[d,l,c]);const _=b?{gridTemplateColumns:`repeat(${x}, 1fr)`,display:"grid"}:void 0,S={container:`${A1["smp-button-group-container"]} ${Yr(a)?A1["smp-button-group-vertical"]:""}`,optionsContainer:`${A1["smp-button-group-options-container"]} ${Yr(a)?A1["smp-button-group-vertical"]:""} ${h?A1["smp-button-group-danger"]:""}`};return V.jsxs("div",{"data-component":"button-group","smp-id":"buttonGroup-container",className:S.container,id:g,children:[n&&V.jsx(No,{label:n,disabled:e||!r,htmlFor:g,helper:u}),V.jsx("div",{className:S.optionsContainer,style:_,role:"group",children:d?.map(C=>V.jsx(lr,{appearance:"raised",variant:"base",active:t===C.obj?.k,onClick:()=>w(C),bindValue:C.obj?.k||"",optionalDisplayValue:fb(C.obj?.k,C.decode,i),disabled:e||!r,justify:Yr(a)?"start":"center",icon:C.icon,buttonExt:`oneButton-${Yr(a)?"vertical":"horizontal"}`},C.obj?.k))}),y&&V.jsx(B0,{helperText:h,state:v,disabled:e||!r,id:m})]})},e8={"smp-button-list":"_smp-button-list_1kcou_1","smp-button-list-row":"_smp-button-list-row_1kcou_6","smp-button-list-column":"_smp-button-list-column_1kcou_10","smp-button-list-fullWidth":"_smp-button-list-fullWidth_1kcou_14"},nq=({data:t,options:e,fun:r,direction:n="row",disposition:i="start",sizing:a,variant:s,appearance:o,ShowText:l,showIcon:c,FullWidth:u,disabled:h,justify:f,squared:d,onClick:p,onOptionsRequest:g})=>{const m=t?.children||e,[v,y]=Q.useState(m);Q.useEffect(()=>{y(m)},[m]),Q.useEffect(()=>{!v&&g&&r&&g(r,void 0).then(w=>y(pc(w)||[])).catch(w=>{console.error("Errore nel caricamento delle opzioni per ButtonList",w)})},[v,r,g]);const x={container:`${e8["smp-button-list"]} ${e8[`smp-button-list-${n}`]} ${`smp-justify-${i}`} ${Yr(u)?e8["smp-button-list-fullWidth"]:""}`},b=v?.map((w,_)=>{const S={bindValue:w.obj?.k||"",optionalDisplayValue:w.decode??w.value??w.obj?.k??"",fun:w.fun,icon:w.icon,variant:s,appearance:o,ShowText:l,showIcon:c,FullWidth:u,disabled:h,sizing:a,justify:f,squared:d,onClick:C=>{p?.(C,w)},...w.data};return V.jsx(lr,{...S},`button-${_}`)});return V.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:b})},t8={"smp-checkbox-container":"_smp-checkbox-container_faamk_6","smp-checkbox-wrapper":"_smp-checkbox-wrapper_faamk_14","smp-checkbox-danger":"_smp-checkbox-danger_faamk_66"},H3=({bindValue:t,_dataComponent:e="checkbox",disabled:r,label:n,isEditable:i=!0,helper:a,error:s,state:o="base",onChange:l,onConfirmedChange:c,variant:u="checkbox"})=>{const h=Q.useId(),f=m=>{i&&(l?.(m.target.checked),c?.(m.target.checked))},d=!!s,p=d?"danger":o,g={container:`${t8["smp-checkbox-container"]}`,labelAndInputWrapper:`${t8["smp-checkbox-wrapper"]}`,inputState:`${t8[`smp-checkbox-${p}`]}`};return V.jsxs("div",{className:g.container,children:[V.jsxs("div",{className:g.labelAndInputWrapper,"data-component":e,children:[V.jsx("input",{className:g.inputState,"data-component":"checkbox","data-state":p,type:"checkbox",checked:t,onChange:f,role:u==="switch"?"switch":"checkbox",id:h,disabled:r||!i}),n&&V.jsx(No,{label:n,disabled:r||!i,htmlFor:h,helper:a})]}),d&&V.jsx(B0,{helperText:s,disabled:r||!i,state:p,id:`${h}-helper`})]})};function TI(t,e){const r=Q.useRef(null);Q.useEffect(()=>{if(!t)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;r.current=document.activeElement;const i=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=i();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const s=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const u=i();if(u.length===0)return;const h=u[0],f=u[u.length-1];c.shiftKey&&document.activeElement===h?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),h.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const u=i();u.length>0&&u[0].focus()}};document.addEventListener("keydown",s),document.addEventListener("mousedown",o);const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",s),document.removeEventListener("mousedown",o),document.body.style.overflow=l,r.current&&requestAnimationFrame(()=>{r.current?.focus()})}},[t,e])}const Ho={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1u1ze_1","smp-datepickercalendar":"_smp-datepickercalendar_1u1ze_1","smp-datepickercalendar-table":"_smp-datepickercalendar-table_1u1ze_16","smp-datepickercalendar-th":"_smp-datepickercalendar-th_1u1ze_28","smp-datepickercalendar-td":"_smp-datepickercalendar-td_1u1ze_39","smp-datepickercalendar-td-today":"_smp-datepickercalendar-td-today_1u1ze_59","smp-datepickercalendar-td-selected":"_smp-datepickercalendar-td-selected_1u1ze_65","smp-datepickercalendar-td-focused":"_smp-datepickercalendar-td-focused_1u1ze_70","smp-datepickercalendar-label":"_smp-datepickercalendar-label_1u1ze_80"};function _fe({selectedDate:t,onDateChange:e,disabledDateRanges:r=[],initialValue:n,targetRef:i}){const{translate:a}=Ta(),s=()=>{if(!n)return;const O=new Date(n);return isNaN(O.getTime())?void 0:O},[o]=Q.useState(new Date),[l,c]=Q.useState(t||s()||new Date),[u,h]=Q.useState(l?l.getMonth():new Date().getMonth()),[f,d]=Q.useState(l?l.getFullYear():new Date().getFullYear()),[p,g]=Q.useState(l?l.getDate():null),m=Q.useRef(null),v=Q.useRef([]),y=[a(Ls.JANUARY),a(Ls.FEBRUARY),a(Ls.MARCH),a(Ls.APRIL),a(Ls.MAY),a(Ls.JUNE),a(Ls.JULY),a(Ls.AUGUST),a(Ls.SEPTEMBER),a(Ls.OCTOBER),a(Ls.NOVEMBER),a(Ls.DECEMBER)],x=[{value:a(Pa.SUNDAY_SHORT),full:a(Pa.SUNDAY)},{value:a(Pa.MONDAY_SHORT),full:a(Pa.MONDAY)},{value:a(Pa.TUESDAY_SHORT),full:a(Pa.TUESDAY)},{value:a(Pa.WEDNESDAY_SHORT),full:a(Pa.WEDNESDAY)},{value:a(Pa.THURSDAY_SHORT),full:a(Pa.THURSDAY)},{value:a(Pa.FRIDAY_SHORT),full:a(Pa.FRIDAY)},{value:a(Pa.SATURDAY_SHORT),full:a(Pa.SATURDAY)}],b=O=>r.some($=>{const N=$.start.getTime(),U=$.end.getTime(),j=O.getTime();return j>=N&&j<=U}),w=O=>{b(O)||(c(O),g(O.getDate()),e&&e(Che(O)))},_=()=>{u===0?(h(11),d(f-1)):h(u-1),g(1)},S=()=>{u===11?(h(0),d(f+1)):h(u+1),g(1)},C=(O,$)=>new Date(O,$+1,0).getDate(),T=(O,$)=>new Date(O,$,1).getDay(),A=O=>{const $=M.findIndex(N=>N!==null&&N.getDate()===O);$!==-1&&v.current[$]&&(v.current[$]?.focus(),g(O))},k=(O,$)=>{const N=M[$];if(!N)return;const U=C(f,u),j=N.getDate();switch(O.key){case"ArrowRight":O.preventDefault();{let B=j+1,q=new Date(f,u,B);if(B>U){const W=u===11?f+1:f,X=u===11?0:u+1;B=1,q=new Date(W,X,B),S(),setTimeout(()=>{I(1,"forward")},0);return}b(q)?I(B,"forward"):A(B)}break;case"Tab":break;case"ArrowLeft":O.preventDefault();{let B=j-1,q=new Date(f,u,B);if(B<1){const W=u===0?f-1:f,X=u===0?11:u-1,K=C(W,X);B=K,q=new Date(W,X,B),_(),setTimeout(()=>{I(K,"backward")},0);return}b(q)?I(B,"backward"):A(B)}break;case"ArrowUp":O.preventDefault();{let B=j-7,q=new Date(f,u,B);if(B<1){const W=u===0?f-1:f,X=u===0?11:u-1;B=C(W,X)+B,q=new Date(W,X,B),_(),setTimeout(()=>{I(B,"backward")},0);return}b(q)?I(B,"backward"):A(B)}break;case"ArrowDown":O.preventDefault();{let B=j+7,q=new Date(f,u,B);if(B>U){const W=u===11?f+1:f,X=u===11?0:u+1;B=B-U,q=new Date(W,X,B),S(),setTimeout(()=>{I(B,"forward")},0);return}b(q)?I(B,"forward"):A(B)}break;case"Home":O.preventDefault(),I(1,"forward");break;case"End":O.preventDefault(),I(U,"backward");break;case"PageUp":O.preventDefault(),_(),setTimeout(()=>{const B=C(u===0?f-1:f,u===0?11:u-1),q=Math.min(j,B);I(q,"forward")},0);break;case"PageDown":O.preventDefault(),S(),setTimeout(()=>{const B=C(u===11?f+1:f,u===11?0:u+1),q=Math.min(j,B);I(q,"forward")},0);break;case" ":case"Space":if(b(N))return;g(N.getDate()),c(N);break;case"Enter":O.preventDefault(),w(N);break}},I=(O,$)=>{const N=C(f,u);if($==="forward"){for(let U=O;U<=N;U++){const j=new Date(f,u,U);if(!b(j)){A(U);return}}S(),setTimeout(()=>{I(1,"forward")},0)}else{for(let q=O;q>=1;q--){const W=new Date(f,u,q);if(!b(W)){A(q);return}}const U=u===0?f-1:f,j=u===0?11:u-1,B=C(U,j);_(),setTimeout(()=>{I(B,"backward")},0)}},M=(()=>{const O=C(f,u),$=T(f,u),N=[];for(let U=0;U<$;U++)N.push(null);for(let U=1;U<=O;U++){const j=new Date(f,u,U);N.push(j)}return N})(),R=[];let D=[];M.forEach((O,$)=>{if(D.push(O),D.length===7||$===M.length-1){for(;D.length<7;)D.push(null);R.push(D),D=[]}}),Q.useEffect(()=>{if(p!==null){const O=M.findIndex($=>$!==null&&$.getDate()===p);O!==-1&&v.current[O]&&v.current[O]?.focus()}},[u,f,p,M]);const L={label:`${Ho["smp-datepickercalendar-label"]}`,wrapper:`${Ho["smp-datepickercalendar"]} ${Ho["smp-datepickercalendar-position"]}`,calendar:`${Ho["smp-datepickercalendar"]}`,table:`${Ho["smp-datepickercalendar-table"]}`,th:`${Ho["smp-datepickercalendar-th"]}`,td:(O,$,N,U)=>`${Ho["smp-datepickercalendar-td"]}
8
8
  ${O?Ho["smp-datepickercalendar-td-today"]:""}
9
9
  ${$?Ho["smp-datepickercalendar-td-selected"]:""}
10
10
  ${N?Ho["smp-datepickercalendar-td-focused"]:""}
@@ -12,8 +12,8 @@ Valid keys: `+JSON.stringify(Object.keys($),null," "));var J=Y(X,H,B,q,W+"."+H,
12
12
  ${dp["smp-overlay-panel"]}
13
13
  ${h?dp["smp-overlay-panel-floating"]:dp[`smp-overlay-panel-${e}`]||""}
14
14
  ${m?dp["smp-overlay-panel-closing"]:""}
15
- `.trim(),x={...r&&{maxWidth:r},...i&&{minWidth:i},...n&&{maxHeight:n},...a&&{minHeight:a}},b=u?`${u} ${y}`:y;return g?V.jsxs(Po,{children:[g&&s&&V.jsx("div",{ref:p,className:`${dp["smp-overlay-panel-backdrop"]} ${m?dp["smp-backdrop-closing"]:""}`,role:"button",tabIndex:o?0:-1,"aria-label":"Close overlay",onClick:()=>{o&&l&&l()},onKeyDown:w=>{o&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),l&&l())}}),V.jsx("dialog",{ref:d,className:b,onClose:l,style:x,open:v,children:c})]}):null},Ufe=t=>{const e=t.trim();return/^(?:(?:[a-z][a-z0-9+.-]*):\/\/[^\s]+|mailto:[^\s@]+@[^\s@]+\.[^\s@]+|tel:\+?[0-9()\-\s]+)$/i.test(e)},nN=t=>{const e=t.split(";");return{t:e[0]||"",p:e[1]||"",k:e[2]||""}},jfe=t=>t.match(/^(?:<(\w+)(?:\s[^>]*)?>\s*(?:<br\s*\/?>)?\s*<\/\1>\s*)+$/g)?"":t.replaceAll("&nbsp;"," "),Hfe=t=>{const e=t.import("blots/inline");class r extends e{static blotName="smeupLink";static tagName="a";static create(i){const a=super.create();return a.setAttribute("data-args",i.dataArgs),a.setAttribute("data-type",i.dataType),a.classList.add("smp-smeup-link",`smp-smeup-link-${i.dataType}`),a}static formats(i){const a=i.getAttribute("data-args"),s=i.getAttribute("data-type");return a&&s?{dataArgs:a,dataType:s}:null}}return r},Gfe=({bindValue:t,helper:e,label:r,error:n,isEditable:i=!0,style:a,onChange:s,onEnter:o,onBlur:l,onObjectProtocol:c})=>{const u=Q.useRef(null),h=Q.useRef(null),f=Q.useRef(null),d=Q.useRef(t),p=Q.useRef(s),g=Q.useRef(l),m=Q.useId(),{translate:v}=Ta();fq(u,(G,H)=>{c?.(G,H)});const[y,x]=Q.useState({code:"text",description:v(n8.text)}),[b,w]=Q.useState(null),[_,S]=Q.useState({bold:!1,italic:!1,underline:!1,codeBlock:!1,listOrdered:!1,listBullet:!1,link:!1,smeupLink:!1}),[C,T]=Q.useState({open:!1,link:""}),[A,k]=Q.useState({open:!1,tabIndex:0,t:"",p:"",k:"",fun:""}),I={smpTextEditorWrapper:`${rh["smp-text-editor-wrapper"]} ${n?rh["smp-text-editor-danger"]:""}`,smpTextEditorContent:`${rh["smp-text-editor-content"]} `,smpTextEditorToolbar:`${rh["smp-text-editor-toolbar"]}`,smpTextEditorContentEditable:`${rh["smp-text-editor-content-editable"]}`,smpTextEditorSeparator:`${rh["smp-text-editor-separator"]}`,smpTextEditorLinkCommandOverlay:`${rh["smp-text-editor-link-command-overlay"]}`,smpTextEditorSmeupLinkCommandOverlay:`${rh["smp-text-editor-smeup-link-command-overlay"]}`},E=[{command:"bold",icon:"format_bold"},{command:"italic",icon:"format_italic"},{command:"underline",icon:"format-underline"}],M=[{command:"listBullet",icon:"format_list_bulleted"},{command:"listOrdered",icon:"format_list_numbered"},{command:"link",icon:"insert_link"},{command:"codeBlock",icon:"code"}],R=[{command:"smeupLink",icon:"smeup"}];Q.useLayoutEffect(()=>{p.current=s,g.current=l,d.current=t});const D=(G,H,Y)=>{let J=H.index,ie=H.index+H.length;for(;J>0&&G.getFormat({index:J-1,length:1})[Y];)J--;const me=G.getText({index:0,length:Number.MAX_SAFE_INTEGER}).length;for(;ie<me&&G.getFormat({index:ie,length:1})[Y];)ie++;return{index:J,length:ie-J}},L=G=>{const H=f.current;if(!H)return;let Y=H.getSelection();if(!Y&&b&&(Y=b,H.setSelection(Y,"silent")),Y){const J=H.getFormat(Y);H.format(G,!J[G]),H.focus()}},P=G=>{const H=f.current;if(!H)return;let Y=H.getSelection();if(!Y&&b&&(Y=b,H.setSelection(Y,"silent")),Y){const ie=H.getFormat(Y).list;H.format("list",ie===G?!1:G),H.focus()}},O=()=>{const G=f.current;if(!G)return;let H=G.getSelection();if(!H&&b&&(H=b,G.setSelection(H,"silent")),H){const Y=G.getFormat(H);if(Y.link){const J=D(G,H,"link");G.setSelection(J),T(ie=>({...ie,link:typeof Y.link=="string"?Y.link:"",open:!0}))}else{const J=G.getSelection(),ie=J&&J.length>0?G.getText(J):"";if(ie&&Ufe(ie)){G.format("link",ie.trim());return}T(me=>({...me,open:!0}))}G.focus()}},$=G=>{const H=f.current;H&&(H.format("link",G),H.focus(),T(Y=>({...Y,open:!1,link:""})))},N=()=>{const G=f.current;G&&(G.format("link",!1),T(H=>({...H,open:!1,link:""})))},U=()=>{const G=f.current;if(!G)return;let H=G.getSelection();if(!H&&b&&(H=b,G.setSelection(H,"silent")),H){const Y=G.getFormat(H);if(Y.smeupLink){const J=D(G,H,"smeupLink");G.setSelection(J);const ie=Y.smeupLink;if(ie.dataType==="fun")k(me=>({...me,open:!0,tabIndex:1,t:"",p:"",k:"",fun:ie.dataArgs||""}));else{const me=nN(ie.dataArgs);k(oe=>({...oe,open:!0,tabIndex:0,t:me.t,p:me.p,k:me.k}))}G.focus()}else k(J=>({...J,open:!0,tabIndex:0,t:"",p:"",k:"",fun:""})),G.focus()}},j=()=>{const G=f.current;if(!G)return;let H="",Y="fun";A.fun&&A.fun!=""?H=A.fun:(H=`${A.t};${A.p};${A.k}`,Y="obj"),G.format("smeupLink",{dataArgs:H,dataType:Y}),G.focus(),k(J=>({...J,open:!1,t:"",p:"",k:"",fun:""}))},B=()=>{const G=f.current;G&&(G.format("smeupLink",!1),k(H=>({...H,open:!1,t:"",p:"",k:"",fun:""})))},q=G=>{if(!h.current?.contains(G.relatedTarget)&&f.current){const Y=f.current.getSemanticHTML(),J=jfe(Y);p.current?.({bindValue:J}),g.current?.({bindValue:J})}};Q.useEffect(()=>{const G=u.current;if(!G)return;let H;return(async()=>{try{const ie=(await Promise.resolve().then(()=>require("./quill-CUO2Qthn.cjs"))).default,me=Hfe(ie);ie.register(me,!0);const oe=G.appendChild(document.createElement("div")),ne=new ie(oe,{theme:"snow",enable:i,modules:{toolbar:!1,keyboard:{bindings:{tab:{key:9,handler:function(){return!0}}}}},formats:["bold","italic","underline","strike","blockquote","code-block","header","list","link","smeupLink"]});if(f.current=ne,d.current){const ve=ne.clipboard.convert({html:d.current});ne.setContents(ve,"silent"),setTimeout(()=>{const Ne=ne.getSelection()||{index:0,length:0},ke=ne.getFormat(Ne);W(ke)},0)}ne.on(ie.events.SELECTION_CHANGE,ve=>{if(ve){w({index:ve.index,length:ve.length});const Ne=ne.getFormat(ve);W(Ne)}});const de=ve=>{if(ve.key==="@"&&ne.getSelection()?.length>0){ve.preventDefault();const Ne=ne.getSelection(),ke=ne.getFormat(Ne);if(ke.smeupLink){const Le=D(ne,Ne,"smeupLink");ne.setSelection(Le);const $e=ke.smeupLink;if($e.dataType==="fun")k(Ee=>({...Ee,open:!0,tabIndex:1,fun:$e.dataArgs||"",t:"",p:"",k:""}));else{const Ee=nN($e.dataArgs);k(pe=>({...pe,open:!0,tabIndex:0,t:Ee.t,p:Ee.p,k:Ee.k,fun:""}))}}else k(Le=>({...Le,open:!0,tabIndex:0,t:"",p:"",k:"",fun:""}))}};ne.root.addEventListener("keydown",de),ne.on(ie.events.TEXT_CHANGE,()=>{const ve=ne.getSelection();if(ve){const Ne=ne.getFormat(ve);W(Ne)}}),H=()=>{ne.root.removeEventListener("keydown",de),f.current=null,G.innerHTML=""}}catch(J){console.error("Failed to load Quill editor:",J)}})(),()=>{H?.()}},[]);const W=G=>{S({bold:!!G.bold,italic:!!G.italic,underline:!!G.underline,codeBlock:!!G["code-block"],listOrdered:G.list==="ordered",listBullet:G.list==="bullet",link:!!G.link,smeupLink:!!G.smeupLink});const H=G.header;let Y="text";H===1?Y="h1":H===2&&(Y="h2"),x({code:Y,description:v(n8[Y])})};Q.useEffect(()=>{if(f.current&&t!==void 0&&f.current.getSemanticHTML()!==t){const H=f.current.clipboard.convert({html:t});f.current.setContents(H,"silent")}},[t]);const X=()=>V.jsx("div",{className:I.smpTextEditorSeparator}),K=({command:G,icon:H})=>{const Y=()=>{switch(G){case"bold":case"italic":case"underline":L(G);break;case"codeBlock":L("code-block");break;case"listOrdered":P("ordered");break;case"listBullet":P("bullet");break;case"link":O();break;case"smeupLink":U();break}};return V.jsx(lr,{className:`ql-smp-${G}`,appearance:"ghost",variant:"base",icon:H,bindValue:"",active:_[G],BtnTit:v(Bfe[G]),disabled:!i,onClick:Y,ShowText:!1})};return V.jsxs("div",{"data-component":"text-editor",className:I.smpTextEditorWrapper,children:[r&&V.jsx(No,{label:r,helper:e}),V.jsxs("div",{ref:h,className:I.smpTextEditorContent,onKeyDown:G=>{G.key=="Enter"&&G.ctrlKey?o?.({bindValue:f.current?.getSemanticHTML()||""}):G.stopPropagation()},style:a,onBlur:q,children:[V.jsxs("div",{id:"toolbar",className:I.smpTextEditorToolbar,children:[V.jsx(im,{bindValue:y.code,optionalDisplayValue:y.description,isEditable:i,options:Object.keys(rN).map(G=>({obj:{t:"",p:"",k:G},decode:v(n8[G])})),onChange:G=>{x({code:G.bindValue,description:G.optionalDisplayValue});const H=f.current;if(!H)return;let Y=H.getSelection();!Y&&b&&(Y=b,H.setSelection(Y,"silent")),Y&&(G.bindValue==="text"?H.format("header",!1):H.format("header",rN[G.bindValue]),H.focus())},DescrMode:"DescOnly"}),V.jsx(X,{}),E.map(G=>V.jsx(K,{command:G.command,icon:G.icon},G.command)),V.jsx(X,{}),M.map(G=>V.jsx(K,{command:G.command,icon:G.icon},G.command)),V.jsx(X,{}),R.map(G=>V.jsx(K,{command:G.command,icon:G.icon},G.command))]}),V.jsx("div",{ref:u,className:I.smpTextEditorContentEditable})]}),n&&V.jsx(B0,{id:`${m}-helper`,helperText:n,state:"danger"}),V.jsx(bS,{open:C.open,position:"center",isModal:!0,closeOnClickOutside:!0,onClose:()=>T(G=>({...G,open:!1})),children:V.jsxs("div",{className:I.smpTextEditorLinkCommandOverlay,children:[V.jsx(ia,{bindValue:C.link,autocomplete:"off",icon:"insert_link",onChange:G=>{T(H=>({...H,link:G.bindValue}))},hasAdvanceResearch:!1}),V.jsx(lr,{bindValue:v(Ha.APPLY),onClick:()=>$(C.link)}),V.jsx(lr,{bindValue:v(Ha.REMOVE),onClick:()=>N(),variant:"danger",active:C.link!=""})]})}),V.jsxs(bS,{open:A.open,position:"center",isModal:!0,closeOnClickOutside:!0,onClose:()=>k(G=>({...G,open:!1})),children:[V.jsx(SI,{data:Ffe,selectedIndex:A.tabIndex,onTabChange:G=>{k(H=>({...H,tabIndex:G}))}}),V.jsxs("div",{className:I.smpTextEditorSmeupLinkCommandOverlay,children:[A.tabIndex==0&&V.jsxs(V.Fragment,{children:[V.jsx(ia,{label:v(ya.SMEUP_LINK_T),bindValue:A.t,autocomplete:"off",onChange:G=>{k(H=>({...H,t:G.bindValue}))},hasAdvanceResearch:!1}),V.jsx(ia,{label:v(ya.SMEUP_LINK_P),bindValue:A.p,autocomplete:"off",onChange:G=>{k(H=>({...H,p:G.bindValue}))},hasAdvanceResearch:!1}),V.jsx(ia,{label:v(ya.SMEUP_LINK_K),bindValue:A.k,autocomplete:"off",onChange:G=>{k(H=>({...H,k:G.bindValue}))},hasAdvanceResearch:!1})]}),A.tabIndex==1&&V.jsx(V.Fragment,{children:V.jsx(ia,{label:v(ya.SMEUP_LINK_FUN),bindValue:A.fun,autocomplete:"off",onChange:G=>{k(H=>({...H,fun:G.bindValue}))},hasAdvanceResearch:!1})}),V.jsx(lr,{bindValue:v(Ha.APPLY),onClick:()=>j()}),V.jsx(lr,{bindValue:v(Ha.REMOVE),onClick:()=>B(),variant:"danger",active:C.link!=""})]})]})]})},Mo=({id:t,decode:e,shape:r,obj:n,data:i,icon:a,fun:s,placeholderIcon:o,label:l,helper:c,tooltip:u,options:h,inputSettings:f,style:d,autoSelectOptionIndex:p,isVisualOnly:g=!1,onChange:m,onConfirmedChange:v,onClick:y,onEnter:x,onBlur:b,onOptionsRequest:w,onUploadRequest:_,onContextMenu:S,onObjectProtocol:C,isEditable:T,dSep:A=".",value:k})=>{const{translate:I}=Ta(),E={obj:{t:n?.t||"",p:n?.p||"",k:n?.k?f?.forceUppercase?n?.k.toLocaleUpperCase():n.k:""},shape:r,decode:e,icon:a,fun:s,data:i,isEditable:T,options:h,style:d,inputSettings:f,placeholderIcon:o,tooltip:u},M=AI(n,r,i?.size),R=e||k,D={id:t,onOptionsRequest:w,fun:s,icon:a,placeholderIcon:o,tooltip:u,obj:n,label:l,helper:c,isEditable:T,style:d,size:E.data&&E.data.size?E.data.size:20,isVisualOnly:g,options:h,autoSelectOptionIndex:p,...i},L=(j,B)=>CI(n)?ld(j,{bindValue:new nm(n,B.bindValue).getLegacyValue()}):KW(n)?ld(j,{bindValue:new mS(n,B.bindValue).getLegacyValue()}):f?.forceUppercase?ld(j,{bindValue:B.bindValue.toLocaleUpperCase(),optionalDisplayValue:B.optionalDisplayValue}):ld(j,B),P=(j,B)=>ld(j,{bindValue:new h0(n,B,A).getLegacyValue()}),O=j=>ld(E,{bindValue:new pS(n,j).getLegacyValue()}),$=j=>wfe(E,j),N=()=>{switch(M){case Ke.AUTOCOMPLETE:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R,obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(j3,{...j})}case Ke.BUTTON:{const j=i?.BtnTxt&&typeof i.BtnTxt=="string"?i.BtnTxt:void 0,B={...D,bindValue:j||"",ShowText:i?.ShowText!=null?i.ShowText:!!j,onClick:q=>{y?.(q,L(E,{bindValue:n.k}))}};return V.jsx(lr,{...B})}case Ke.BUTTON_LIST:{const j={...D,onClick:(B,q)=>{y?.(B,q)}};return V.jsx(nq,{...j})}case Ke.BREADCRUMBS:{const j={...D,onClick:(B,q)=>{y?.(B,q)}};return V.jsx(XW,{...j})}case Ke.CHECKBOX:case Ke.SWITCH:{const j=M===Ke.SWITCH,B={...D,bindValue:pS.fromDataObj(n).getValue(),optionalDisplayValue:R,onChange:q=>{m?.(O(q))},onConfirmedChange:q=>{v?.(O(q))},...j&&{variant:"switch"}};return V.jsx(H3,{...B})}case Ke.COMBOBOX:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R,obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(uq,{...j})}case Ke.DATE:{const j={...D,bindValue:nm.fromDataObj(n).getValue(),obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(kI,{...j})}case Ke.ICON:case Ke.IMAGE:{const j={...D,icon:a,isInteractable:!!D.fun,onClick:B=>{y?.(B,L(E,{bindValue:n.k}))}};return V.jsx(Dr,{...j})}case Ke.INPUT_NUMBER:{const j={...D,bindValue:h0.fromDataObj(n,A).getValue(),onChange:B=>{m?.(P(E,B))},onEnter:B=>{x?.(P(E,B))},onBlur:B=>{b?.(P(E,B))}};return V.jsx(sq,{...j})}case Ke.EDITOR:{const j={...D,onObjectProtocol:C,bindValue:n.k,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(Gfe,{...j})}case Ke.MEMO:{const j={...D,bindValue:n.k,optionalDisplayValue:R,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(II,{...j})}case Ke.CHIP:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return T?V.jsx(Nfe,{...j}):V.jsx(G3,{...j})}case Ke.MULTI_AUTOCOMPLETE:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return V.jsx(oq,{...j})}case Ke.MULTI_CONFIG:{const j={...D,bindValue:l||"",ShowText:!!l,icon:a??"list",onClick:B=>{y?.(B,L(E,{bindValue:n.k}))}};return V.jsx(lr,{...j})}case Ke.MULTI_COMBOBOX:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return V.jsx(Ofe,{...j})}case Ke.MULTI_SELECT:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return V.jsx(hq,{...j})}case Ke.PASSWORD:{const j={...D,bindValue:E.obj.k,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(lq,{...j})}case Ke.RADIO:{const j={...D,bindValue:n.k,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))}};return V.jsx(kfe,{...j})}case Ke.SELECT:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R,obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))}};return V.jsx(im,{...j})}case Ke.SPOTLIGHT:{const j={...D,bindValue:E.obj.k,obj:E.obj,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(cq,{...j})}case Ke.BUTTON_GROUP:{const j={...D,bindValue:n.k,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))}};return V.jsx(rq,{...j})}case Ke.TIMEPICKER:{const j={...D,bindValue:mS.fromDataObj(n).getValue(),onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(Mfe,{...j})}case Ke.TREE:{const j={...D,onClick:(B,q)=>{y?.(B,q)}};return V.jsx(Pfe,{...j})}case Ke.FILE_UPLOAD:{const j={...D,initialFiles:E.obj?.k?E.obj.k.split(";"):[],disabled:D.isEditable===!1,onUploadRequest:_,onChange:B=>{Array.isArray(B)?(m?.($(B.map(q=>({bindValue:q.bindValue})))),b?.($(B.map(q=>({bindValue:q.bindValue}))))):(m?.(L(E,B)),b?.(L(E,B)))}};return V.jsx(aq,{...j})}case Ke.LABEL:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R};return V.jsx(Mg,{...j})}case Ke.TEXT_FIELD:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:E.decode,obj:E.obj,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(ia,{...j})}case void 0:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R};return V.jsx(Mg,{...j})}default:return V.jsx(Mg,{bindValue:I(Ha.SHAPE_NOT_SUPPORTED_YET)+r})}},U={wrapper:`${Rfe["smp-cell-wrapper"]}`};return V.jsx("span",{className:U.wrapper,onContextMenu:j=>{S&&u&&(j.preventDefault(),S(E,j.currentTarget))},children:N()})},Zy=({children:t,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(t)?t.map(n=>({id:n.props.id})):[{id:t.props.id}]}]},columns:r})=>{const[n,i]=Q.useState(0),{getSectionPathId:a}=Vue(),s={};Q.Children.forEach(t,m=>{Q.isValidElement(m)&&(s[m.props.id]=m)});const o="--smp-grid-template-cols",l="--smp-grid-template-rows",c=VW(e.sections??[],Object.keys(s)),u=(m,v=[])=>m.reduce((y,x,b)=>{const w=[...v,b];let _="",S={},C={},T="";x.sections?.length?(_=us["smp-layout-section-grid"],S=u(x.sections,w),T=us[x.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],x.horizontal||PR(x.sections)?C=LR(x.sections,x.horizontal?o:l):C={[o]:"auto",[l]:"auto"}):x.content?.length&&(x.columns!==void 0&&+x.columns>0?(_=us["smp-layout-section-grid"],T=us["smp-grid-template-cols"],C={[o]:`repeat(${x.columns}, 1fr)`}):x.horizontal?_=us["smp-layout-section-flex"]:_=us["smp-layout-section-grid"]);const A=a(w);return{...y,...S,[A]:{classes:`${_} ${us[x.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${T} ${x.layoutAttributes?.map(k=>`smp-${k}`).join(" ")??""}`,styles:C}}},{}),h=u(c),f=`${us["smp-layout"]} ${e.horizontal?us["smp-layout-horizontal"]:us["smp-layout-vertical"]} ${e.inline?us["smp-layout-inline"]:""}`;let d={};(e.horizontal||PR(e.sections||[]))&&(d=LR(c,e.horizontal?o:l));const p=(m,v,y=[])=>{const x=a(y),b=V.jsx("div",{"smp-id":`section-${m.id}`,className:h[x].classes,style:h[x].styles,children:m.sections?.length?m.sections.map((w,_)=>p(w,!1,[...y,_])):m.content?.map(w=>g(w))},x);return m.title&&!v?V.jsxs("div",{className:us["smp-layout-section-with-title"],children:[V.jsx("span",{className:`${us["smp-layout-section-title"]}`,children:V.jsx(No,{label:m.title})}),b]},`title-${x}`):b},g=m=>{if(zue(m,m.id?r?.[m.id]:void 0)){let v=s[m.id||""];v?m.style&&(v=Q.cloneElement(v,{style:{...m.style,...v.props.style}})):v=V.jsx(Mo,{...m,id:m.id??"",style:m.style});const y=`${us["smp-layout-cell-container"]} ${m.layoutAttributes?.map(x=>`smp-${x}`).join(" ")??""}`;return V.jsx("div",{className:y,"smp-id":m.id,children:v},m.id)}};return V.jsxs("div",{className:f,style:d,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&e?.sections.length>1&&V.jsx(SI,{data:{type:"SmeupDataTree",children:c.map(m=>({decode:m.title||m.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0,toolbar:!1}))},selectedIndex:n,onTabChange:i}),e.sectionsType?p(c[n],!0,[n]):c.map((m,v)=>p(m,!1,[v]))]})},Wfe={"smp-appbar":"_smp-appbar_16wrs_1"},iN=t=>{if(!t?.rows?.length||!t?.columns?.length)return;const e=t.rows[0];return t.columns.filter(n=>n.visible??!0).reduce((n,i)=>{const s={...e.cells?.[i.name],id:i.name};return{...n,[i.name]:s}},{})},qfe=({data:t,advanceResearchAutoSelect:e,onClick:r,onEnter:n,onContextMenu:i,onAdvanceResearchLoadInitialData:a,onAdvanceResearchLeafNodeClick:s})=>{const o=iN(t),[l,c]=Q.useState(o);Q.useEffect(()=>{c(iN(t))},[t]);const u=(h,f)=>{c(d=>d&&{...d,[h]:{...d[h],obj:{t:d[h].obj?.t||"",p:d[h].obj?.p||"",k:f.obj?.k||""}}})};return V.jsx(Vm.Provider,{value:{onAdvanceResearchLoadInitialData:a,onAdvanceResearchLeafNodeClick:s,advanceResearchAutoSelect:e},children:V.jsx("header",{className:Wfe["smp-appbar"],"aria-label":"App Bar","data-component":"app-bar",children:V.jsx(Zy,{layout:t?.rows?.[0]?.layout,children:Object.values(l||{}).map(h=>Q.createElement(Mo,{...h,key:h.id,onChange:f=>u(h.id,f),onContextMenu:(f,d)=>i&&i(f,d),onEnter:f=>n&&n(f),onClick:(f,d)=>r&&r(d)}))})})})},T1={"smp-box-list-container":"_smp-box-list-container_1oks6_1","smp-box-list":"_smp-box-list_1oks6_1","smp-box-element":"_smp-box-element_1oks6_18","smp-box-element-clickable":"_smp-box-element-clickable_1oks6_27","smp-box-global-filter":"_smp-box-global-filter_1oks6_40"},Xfe=(t,e)=>{const r=e.toLowerCase();return t.rows.filter(n=>n.cells?Object.values(n.cells).some(i=>{const a=i.value?i.value.toLowerCase().includes(r):!1,s=i.obj?.k?i.obj.k.toLowerCase().includes(r):!1;return a||s}):!1)},Yfe=(t,e)=>{switch(e){case"2":return Kfe(t);case"3":return Zfe(t);case"4":return Jfe(t);case"5":return Qfe(t);case"6":return ede(t);case"7":return tde(t);case"8":return rde(t);default:return Um(t)}},Um=t=>({sections:t.map(e=>({id:`section-${e.name}`,layoutAttributes:["grid-cols-2"],content:[{id:`label-${e.name}`,obj:{t:"",p:"",k:e.title||e.name}},{id:e.name,style:{fontWeight:"bold"}}]}))}),Kfe=t=>({sections:t.map(e=>({id:`section-${e.name}`,layoutAttributes:["grid-cols-2"],content:[{id:`label-${e.name}`,obj:{t:"",p:"",k:e.title||e.name}},{layoutAttributes:["justify-end"],id:e.name,style:{fontWeight:"bold"}}]}))}),Zfe=t=>({sections:[{id:"content",layoutAttributes:[`grid-cols-${t.length}`,"justify-center"],sections:t.map(e=>({id:`section-${e.name}`,layoutAttributes:["grid-cols-2"],content:[{id:`label-${e.name}`,layoutAttributes:["justify-end"],obj:{t:"",p:"",k:e.title||e.name}},{layoutAttributes:["justify-start"],id:e.name,style:{fontWeight:"bold"}}]}))}]}),Jfe=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0||r.length==0?(console.warn("LayoutNbr 4 required at least 1 image or icon and one field"),Um(t)):{sections:[{id:"content",layoutAttributes:["grid-col-1","justify-center"],content:[{layoutAttributes:["justify-center"],id:e[0].name},{layoutAttributes:["justify-center"],id:r[0].name}]}]}},Qfe=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 5 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",layoutAttributes:["grid-cols-2"],sections:[{id:"image",content:[{layoutAttributes:["justify-center","items-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-2"],sections:[{layoutAttributes:["justify-end"],id:`label-${n.name}`,content:[{obj:{t:"",p:"",k:n.title||n.name}}]},{layoutAttributes:["justify-start"],id:`value-${n.name}`,content:[{id:n.name,style:{fontWeight:"bold"}}]}]}))}]}]}},ede=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 6 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",layoutAttributes:["grid-cols-2"],sections:[{id:"image",content:[{layoutAttributes:["justify-center","items-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-1","gap-4"],content:[{id:`label-${n.name}`,obj:{t:"",p:"",k:n.title||n.name}},{id:n.name,style:{fontWeight:"bold"}}]}))}]}]}},tde=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 7 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",sections:[{id:"image",content:[{layoutAttributes:["justify-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-2","gap-4"],content:[{id:`label-${n.name}`,obj:{t:"",p:"",k:n.title||n.name}},{id:n.name,style:{fontWeight:"bold"}}]}))}]}]}},rde=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 8 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",sections:[{id:"image",content:[{layoutAttributes:["justify-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-1","gap-4"],content:[{id:`label-${n.name}`,obj:{t:"",p:"",k:n.title||n.name}},{id:n.name,style:{fontWeight:"bold"}}]}))}]}]}},nde=["px","vh","vw","rem","em","%"];function wS(t){return t==null?"":typeof t=="number"||String(t).trim()!==""&&!isNaN(Number(t))?`${t}px`:String(t)}function _S(t){if(typeof t=="number")return!0;if(typeof t!="string")return!1;const e=nde.join("|");return new RegExp(`^-?\\d+(\\.\\d+)?(${e})?$`).test(t)}function aN(t){if(typeof t=="number")return t;const e=wS(t),r=document.createElement("div");r.style.position="absolute",r.style.visibility="hidden",r.style.height=e,r.style.padding="0",r.style.margin="0",r.style.border="none",document.body.appendChild(r);const n=parseFloat(getComputedStyle(r).height);return r.remove(),isNaN(n)?0:n}const ide=({data:t,dSep:e,SelectRow:r,SelFirst:n="No",GlobalFilter:i="No",Columns:a,Cols:s,LayoutNbr:o="1",onCellClick:l,onClick:c,BoxHeight:u})=>{const[h,f]=Q.useState(t.rows),[d,p]=Q.useState(""),g={smpBoxList:`${T1["smp-box-list"]}`,smpBoxElement:`${T1["smp-box-element"]} ${c?T1["smp-box-element-clickable"]:""}`,smpBoxGlobalFilter:`${T1["smp-box-global-filter"]}`},m=Q.useMemo(()=>{if(a){const b=a.split("|");return t.columns.filter(_=>b.includes(_.name)).sort((_,S)=>b.indexOf(_.name)-b.indexOf(S.name))}return t.columns.filter(b=>b.visible==null||b.visible==!0)},[a,t.columns]);Q.useEffect(()=>{Yr(n)&&t.rows.length>0&&c?.({row:t.rows[0]}),r&&parseInt(r)-1<=t.rows.length&&c?.({row:t.rows[parseInt(r)-1]})},[]);const v=(b,w)=>V.jsx(Mo,{id:b.name,...w.cells?.[b.name],isVisualOnly:!0,isEditable:!1,dSep:e,onClick:(_,S)=>{_.stopPropagation(),l?.({cell:S,column:b,row:w})}}),y=Q.useMemo(()=>s&&parseInt(s)>0?parseInt(s):1,[s]),x=Q.useMemo(()=>({"--smp-box-list-cols":y.toString()}),[y]);return V.jsxs("div",{"data-component":"box-list",className:T1["smp-box-list-container"],style:{height:_S(u)?wS(u):void 0},children:[Yr(i)&&V.jsx("div",{className:g.smpBoxGlobalFilter,children:V.jsx(cq,{bindValue:d,onChange:b=>{p(b.bindValue),f(Xfe(t,b.bindValue))},FullWidth:"Yes",placeholder:"Search..."})}),V.jsx("div",{"data-component":"box-list-grid",className:g.smpBoxList,style:x,children:h.map((b,w)=>b.cells?V.jsx("div",{"data-component":"box-list-element",className:g.smpBoxElement,onClick:()=>c?.({row:b}),children:V.jsx(Zy,{layout:b.layout?.sections&&b.layout.sections.length>0?b.layout:Yfe(m,o),children:m.map(_=>v(_,b))})},`box-${w}`):null)})]})},to={"smp-dash-list":"_smp-dash-list_x2rzc_1","smp-dash-list-fill-space":"_smp-dash-list-fill-space_x2rzc_8","smp-dash-list-horizontal":"_smp-dash-list-horizontal_x2rzc_13","smp-layout-1":"_smp-layout-1_x2rzc_17","smp-layout-2":"_smp-layout-2_x2rzc_21","smp-layout-3":"_smp-layout-3_x2rzc_29","smp-layout-1__descr":"_smp-layout-1__descr_x2rzc_58","smp-layout-2__descr":"_smp-layout-2__descr_x2rzc_59","smp-layout-3__descr":"_smp-layout-3__descr_x2rzc_60","smp-layout-1__value":"_smp-layout-1__value_x2rzc_68","smp-layout-2__value":"_smp-layout-2__value_x2rzc_69","smp-layout-3__value":"_smp-layout-3__value_x2rzc_70","smp-layout-2__icon":"_smp-layout-2__icon_x2rzc_77"},ade=({ColumnsNumber:t=1,data:e,ForceText:r,TextColName:n,TextColor:i="var(--smp-dashList-color-base)",Fillspace:a,FontSize:s,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:h,ForceUM:f,UmColName:d,UmColor:p="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:m,ValueColor:v="var(--smp-dashList-color-base)",SelectLayout:y="1",onClick:x})=>{const w=e?.columns||[],_=e?.rows||[],S=_.length>0,C="--smp-dashList-color",T="descr",A="icon",k="um",I="value",E=s||"1em",M="18px",R="--smp-dashList-columns",D="--smp-dashList-fontSize",L={dash:(H="1")=>({container:to[`smp-layout-${H}`]||to["smp-layout-1"],descr:to[`smp-layout-${H}__descr`]||to["smp-layout-1__descr"],icon:to[`smp-layout-${H}__icon`]||to["smp-layout-2__icon"],um:to[`smp-layout-${H}__um`]||"",value:to[`smp-layout-${H}__value`]||to["smp-layout-1__value"]}),dashList:`${to["smp-dash-list"]} ${Yr(a)?to["smp-dash-list-fill-space"]:""} ${Yr(o)?to["smp-dash-list-horizontal"]:""}`},{format:P}=Ta(),O=H=>`${C}-${H}`,$=H=>{const Y=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Y.test(H)){const ie=H.match(Y)||[];if(ie?.length>3)return"rgb("+ie[1]+","+ie[2]+","+ie[3]+")"}return H},N=H=>{if(!h)return H;const[Y,J]=U(h).map(de=>parseInt(de||"0")),ie="0,0"+(J?"."+"0".repeat(J):""),me=P(H,ie,"it");if(!Y)return me;const[oe,ne]=me.split(",");return oe+(ne?`,${ne}`:"")},U=H=>H.includes(";")?H.split(";"):[H],j=H=>{const Y=ie=>{if(ie)return H?.cells?.[ie]?.obj?.k},J=ie=>{if(!(w.length<=ie))return H?.cells?.[w[ie].name]?.obj?.k};return{descr:r||Y(n)||J(2)||"",icon:l||Y(c)||J(3)||"",um:f||Y(d)||J(1)||"",value:g||Y(m)||J(0)||""}},B=H=>{x?.(H)},q=(H,Y)=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),H.stopPropagation(),B(Y))},X=(H=>{const Y=L.dash(H);return{className:Y,descr:J=>V.jsx("div",{className:Y.descr,children:J},`${H}-${T}`),icon:J=>V.jsx("div",{className:Y.icon,children:V.jsx(Dr,{color:u,height:M,icon:J,width:M})},`${H}-${A}`),um:J=>V.jsx("div",{className:Y.um,children:J},`${H}-${k}`),value:J=>V.jsx("div",{className:Y.value,children:J},`${H}-${I}`)}})(y),K=H=>{const{descr:Y,icon:J,um:ie,value:me}=j(H),oe={[O(T)]:$(i),[O(k)]:$(p),[O(I)]:$(v)},ne=[],de=N(me);switch(y){case"2":J&&ne.push(X.icon(J)),ne.push(X.descr(Y)),ne.push(X.value(ie?de+" "+ie:de));break;default:case"1":ne.push(X.descr(Y)),ne.push(X.value(ie?de+" "+ie:de))}return V.jsx("div",{className:X.className.container,role:"button",style:oe,tabIndex:0,onClick:()=>B(H),onKeyDown:ve=>q(ve,H),children:ne},H.rowId)},G={[R]:String(t),[D]:E};return V.jsx("div",{className:L.dashList,style:G,"data-component":"dash-list",children:S?_.map(H=>K(H)):"N/A"})},sde={"smp-table":"_smp-table_1yqvn_1"};function ode(t,e){const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}function lde(t,e){return t.map(r=>{const n=e.find(i=>i.column===r.bindValue);return{column:r.bindValue,visible:n?.visible??!0}})}function dq(t){const e=[];return t?.split("|").forEach(r=>{const n=r.split(","),i=n[0],s=(n[1]??"").toUpperCase()!=="H";i.trim()&&e.push({column:i,visible:s})}),e}function cde(t){let e="";return t.forEach(r=>{r.visible?e+=`${r.column}|`:e+=`${r.column},H|`}),e.replace(new RegExp("\\|$"),"")}function ude(t){return!t||typeof t!="string"?[]:t.split("|").map(e=>e.trim()).filter(Boolean).map(e=>{const r=e.match(/^(\w+)\(([^)]+)\)$/);return r?{func:r[1].toUpperCase(),field:r[2].trim()}:null}).filter(Boolean)}function pq(t,e){const r={};for(const{func:n,field:i}of e){const a=t.map(s=>{const o=s?.cells?.[i]?.value,l=typeof o=="number"?o:parseFloat(o??"");return isNaN(l)?0:l}).filter(s=>typeof s=="number");switch(n){case"SUM":r[i]=a.reduce((s,o)=>s+o,0);break;case"COUNT":r[i]=a.length;break;case"AVG":r[i]=a.length>0?a.reduce((s,o)=>s+o,0)/a.length:0;break}}return r}function hde(t,e,r,n,i){const a=[];let s=0;return o(t,0,[]),{flatRows:a,offset:s};function o(f,d,p){if(d>=e.length){h(f);return}const g=e[d].column,m=l(f,g);let v=0;for(const[y,x]of m){const b=[...p,v.toString()],w=c(b),_=n.has(w),S=u(y,w,d,_,x);a.push(S),s+=r,_&&o(x,d+1,b),v++}}function l(f,d){const p=new Map;for(const g of f){const m=(g.cells?.[d]?.decode||g.cells?.[d]?.value)??"N/D";p.has(m)||p.set(m,[]),p.get(m).push(g)}return p}function c(f){return`${f.join("-")}`}function u(f,d,p,g,m){const v={};if(i&&m.length>0){const y=pq(m,i);for(const x in y)v[x]={value:String(y[x]),obj:{t:"NR",p:"",k:String(y[x])},options:[],decode:String(y[x]),shape:Ke.LABEL,isEditable:!1,data:{isVisualOnly:!0}}}return{isGroup:!0,value:f,cells:v,id:d,level:p,isExpanded:g}}function h(f){for(const d of f)a.push(d),s+=r}}const sN=400,fde=({columns:t,rows:e,containerRef:r,sizingMode:n})=>{const[i,a]=Q.useState(0);Q.useEffect(()=>{if(!r.current)return;const h=new ResizeObserver(f=>{for(const d of f)a(d.contentRect.width)});return h.observe(r.current),()=>h.disconnect()},[r]);const s=Q.useMemo(()=>{if(!t||t.length===0)return{};const h=3,f=7,d={};if(n==="fixed")t.forEach(p=>{d[p.name]=120});else if(n==="fit-grid"){const p=i||800,g=t.filter(v=>v.visible!==!1),m=p/Math.max(g.length,1);g.forEach(v=>{d[v.name]=m})}else if(n==="fit-content"){const p=[...e].sort(()=>.5),g=e.slice(0,100).concat(p);for(const m of t){if(m.visible===!1)continue;const v=(m.title?.length||0)+h*2,y=Math.max(v,...g.map(x=>{const b=x.cells?.[m.name];return`${b?.decode??b?.value??""}`.length}));d[m.name]=y*f+24}}return d},[t,e,n,i]),[o,l]=Q.useState({}),c=Q.useMemo(()=>({...s,...o}),[s,o]),u=Q.useCallback(h=>{l(f=>typeof h=="function"?h({...s,...f}):h)},[s]);return[c,u]},dde={EQ:{label:"eq",function:(t,e)=>t.toDateString()===e.toDateString()},ON:{label:"on",function:(t,e)=>t.toDateString()===e.toDateString()},AFTER:{label:"after",function:(t,e)=>t>e},ONORAFTER:{label:"onorafter",function:(t,e)=>t>=e},BEFORE:{label:"before",function:(t,e)=>t<e},ONORBEFORE:{label:"onorbefore",function:(t,e)=>t<=e}},pde={CONTAINS:{label:"contains",function:(t,e)=>t.includes(e)},STARTS:{label:"starts",function:(t,e)=>t.startsWith(e)},EQ:{label:"eq",function:(t,e)=>t===e},NEQ:{label:"neq",function:(t,e)=>t!==e}},gde={EQ:{label:"eq",function:(t,e)=>t===e},NEQ:{label:"neq",function:(t,e)=>t!==e},GT:{label:"gt",function:(t,e)=>t>e},GTE:{label:"ge",function:(t,e)=>t>=e},LT:{label:"lt",function:(t,e)=>t<e},LTE:{label:"le",function:(t,e)=>t<=e}},mde=t=>Object.values(dde).find(r=>r.label===t.toLowerCase())?.function??(()=>null),vde=t=>Object.values(pde).find(r=>r.label===t.toLowerCase())?.function??(()=>null),yde=t=>Object.values(gde).find(r=>r.label===t.toLowerCase())?.function??(()=>null);function xde(t,e){return t.map(r=>{const n=e?.[r.name],i=bde(r);return{obj:{t:r.obj?.t||"",p:r.obj?.p||"",k:r.name},decode:r.title,shape:void 0,type:n??i}})}function bde(t){return t.obj?YW(t.obj)?"number":CI(t.obj)?"date":"string":"string"}function oN(t,e){const r={logic:"and",filters:[]};return t?typeof t=="object"&&"logic"in t&&"filters"in t?t:typeof t=="string"?wde(t,e):r:r}function wde(t,e){const r=t.split("|").map(i=>i.trim()).filter(Boolean),n=[];for(const i of r){const a=_de(i,e);a&&n.push(a)}return{logic:"and",filters:n}}function _de(t,e){if(!t.trim())return null;if(t.includes(";OR;")){const n=t.split(";OR;").map(l=>l.trim()).filter(Boolean);if(n.length===0)return null;const i=i8(n[0],e);if(!i)return null;const a=i.field,s=i.columnsType,o=n.slice(1).map(l=>i8(l,e,a?.obj?.k,s)).filter(l=>l!==null);return{logic:"or",filters:[i,...o]}}else{const n=i8(t,e);return n?{logic:"and",filters:[n]}:null}}function i8(t,e,r,n){const i=t.split(";").map(h=>h.trim());let a,s,o;if(i.length===3)[a,s,o]=i;else if(i.length===2&&r&&n)[s,o]=i,a=r;else return null;const l=e.find(h=>h?.obj?.k===a)??(r&&n?{obj:{t:"",p:"",k:r},decode:r,type:n,shape:void 0}:null);if(!l)throw new Error(`Campo '${a}' non trovato nei FieldOption.`);const c={...v_,obj:{t:"",p:"",k:s}},u=Sde(o,l.type);return{field:l,columnsType:l.type,operator:c,value:u}}function Sde(t,e){switch(e){case"number":return Number(t);case"date":return new Date(t);case"string":return t;default:return null}}function Cde(t,e){return!e||"filters"in e&&e.filters.length===0?t:t.filter(r=>gq(e,r))}function gq(t,e){if("filters"in t){const{logic:r,filters:n}=t;if(n.length===0)return!0;const i=n.map(a=>gq(a,e));return r==="and"?i.every(Boolean):i.some(Boolean)}return Ade(t,e)}function Ade(t,e){const{field:r,operator:n,value:i,columnsType:a}=t,s=e.cells?.[r?.obj?.k||""],o=Tde(s);if(!o)return!1;switch(a){case"string":return kde(o,n.obj?.k||"",i);case"number":return Ede(o,n.obj?.k||"",i);case"date":return Ide(o,n.obj?.k||"",i);default:return!0}}function Tde(t){if(!t||typeof t!="object")return t;if("decode"in t)return t.decode;if("value"in t)return t.value}function kde(t,e,r){const n=String(t).toLowerCase(),i=String(r).toLowerCase();return vde(e)(n,i)??!0}function Ede(t,e,r){const n=Number(t),i=Number(r);return r===""?!0:isNaN(n)||isNaN(i)?!1:yde(e)(n,i)??!0}function Ide(t,e,r){const n=new Date(t),i=new Date(r);return r===""?!0:isNaN(n.getTime())||isNaN(i.getTime())?!1:mde(e)(n,i)??!0}const Dde=(t,e)=>{const r=n=>n.filters.some(i=>"filters"in i?r(i):i.field?.obj?.k===t&&i.operator&&i.value!=="");return r(e)},Mde=t=>{const e=r=>r.filters.reduce((n,i)=>"filters"in i?n+e(i):n+1,0);return e(t)};function Lde(t,e){const r=Q.useRef(null),n=Q.useCallback(s=>{r.current=s},[]),i=Q.useCallback(s=>{s.preventDefault(),s.dataTransfer.dropEffect="move"},[]),a=Q.useCallback(s=>{const o=r.current;if(!o||o===s)return;const l=t.findIndex(f=>f.name===o),c=t.findIndex(f=>f.name===s);if(l===-1||c===-1)return;const u=[...t],[h]=u.splice(l,1);u.splice(c,0,h),e(u),r.current=null},[t,e]);return{handleDragStart:n,handleDragOver:i,handleDrop:a}}function mq(t,e,r,n="."){const i=t.columns.find(s=>s.name===e);if(!i)return t;const a=[...t.rows].sort((s,o)=>{const l=s.cells?.[e].obj,c=o.cells?.[e].obj;if(l?.k==null&&c?.k!=null)return r==="asc"?1:-1;if(l?.k!=null&&c?.k==null)return r==="asc"?-1:1;if(l?.k==null&&c?.k==null)return 0;switch(i.obj?.t){case"NR":{const u=h0.fromDataObj(l,n).getValue()??NaN,h=h0.fromDataObj(c,n).getValue()??NaN;return isNaN(u)&&isNaN(h)?0:isNaN(u)?r==="asc"?-1:1:isNaN(h)?r==="asc"?1:-1:r==="asc"?u-h:h-u}case"D8":case"DATE":{const u=new Date(nm.fromDataObj(l).getValue()),h=new Date(nm.fromDataObj(c).getValue());return isNaN(u.getTime())&&isNaN(h.getTime())?0:isNaN(u.getTime())?r==="asc"?1:-1:isNaN(h.getTime())?r==="asc"?-1:1:r==="asc"?u.getTime()-h.getTime():h.getTime()-u.getTime()}default:{const u=s.cells?.[e]?.decode||s.cells?.[e]?.value||l?.k,h=o.cells?.[e]?.decode||o.cells?.[e]?.value||c?.k;return u!=null&&h!=null?r==="asc"?String(u).localeCompare(String(h)):String(h).localeCompare(String(u)):u==null&&h!=null?r==="asc"?1:-1:u!=null&&h==null?r==="asc"?-1:1:0}}});return{...t,rows:a}}function Pde(t,e){const[r,n]=Q.useState(null),[i,a]=Q.useState("asc");return{sortedRows:Q.useMemo(()=>r?mq({...t,rows:t.rows},r,i,e).rows:t.rows,[t,r,i,e]),sortBy:r,sortOrder:i,handleSort:l=>{n(c=>c===l?(a(u=>u==="asc"?"desc":"asc"),l):(a("asc"),l))}}}const lN={"smp-footer-tr":"_smp-footer-tr_22pj9_1","smp-footer-td":"_smp-footer-td_22pj9_6"},Rde=({columns:t,columnWidths:e,totals:r,rows:n=[],hasGroups:i=!1})=>{const a={td:`${lN["smp-footer-td"]}`,tr:`${lN["smp-footer-tr"]}`},s=i?n.filter(l=>l.isGroup&&l.level===0):n.filter(l=>!l.isGroup),o=r&&s.length>0?pq(s,r):{};return V.jsx("tfoot",{children:V.jsx("tr",{className:a.tr,children:t.map(l=>l.visible&&V.jsx("td",{className:a.td,style:{width:e[l.name],minWidth:e[l.name],maxWidth:e[l.name]},children:o[l.name]!=null?V.jsx(Mo,{value:String(o[l.name]),obj:{t:"NR",p:"",k:String(o[l.name])},options:[],decode:String(o[l.name]),shape:Ke.INPUT_NUMBER,id:l.name,data:{isVisualOnly:!0,style:{fontWeight:"bold"}}}):null},l.name))})})},Nde=({label:t,rowHeight:e=28,offsetTop:r=0,level:n=0,onClick:i,isExpanded:a,cells:s,columns:o,columnWidths:l})=>{const c={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return V.jsx("tr",{className:c.tr,style:{height:e,top:r,lineHeight:`${e}px`},onClick:i,children:o?.map((u,h)=>{const f=h===0,d=f?V.jsxs(V.Fragment,{children:[V.jsx(Dr,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),V.jsx(jn,{variant:"title",bindValue:t})]}):s?.[u.name]?.value!=null?V.jsx(Mo,{...s[u.name],id:u.name}):null;return V.jsx("td",{className:c.td,style:{width:l?.[u.name],paddingLeft:f?10+n*20:void 0},children:d},u.name)})})};function Ode(t){return t.split("|")}function Bde(t,e){return t.columns.map(r=>({...r,visible:e.includes(r.name)}))}const dg={"smp-filter-wrapper":"_smp-filter-wrapper_1dest_1","smp-filter-group":"_smp-filter-group_1dest_10","smp-filter-row":"_smp-filter-row_1dest_18","smp-filter-list":"_smp-filter-list_1dest_24","smp-filter-toolbar":"_smp-filter-toolbar_1dest_31","smp-filter-actionButtons":"_smp-filter-actionButtons_1dest_41"},Fde=({filter:t,onChange:e,onDelete:r,fieldOptions:n,hasCurrentColumn:i})=>{const{translate:a}=Ta(),s={string:[{obj:{t:"",p:"",k:"starts"},shape:void 0,decode:a(gs.STRING_STARTS)},{obj:{t:"",p:"",k:"contains"},shape:void 0,decode:a(gs.STRING_CONTAINS)},{obj:{t:"",p:"",k:"eq"},shape:void 0,decode:a(gs.STRING_EQUALS)}],number:[{obj:{t:"",p:"",k:"eq"},shape:void 0,decode:a(gs.NUMBER_EQUALS)},{obj:{t:"",p:"",k:"gt"},shape:void 0,decode:a(gs.NUMBER_GREATER)},{obj:{t:"",p:"",k:"ge"},shape:void 0,decode:a(gs.NUMBER_GREATER_OR_EQUAL)},{obj:{t:"",p:"",k:"lt"},shape:void 0,decode:a(gs.NUMBER_LESS)},{obj:{t:"",p:"",k:"le"},shape:void 0,decode:a(gs.NUMBER_LESS_OR_EQUAL)}],date:[{obj:{t:"",p:"",k:"before"},shape:void 0,decode:a(gs.DATE_BEFORE)},{obj:{t:"",p:"",k:"after"},shape:void 0,decode:a(gs.DATE_AFTER)},{obj:{t:"",p:"",k:"on"},shape:void 0,decode:a(gs.DATE_ON)}]},o=f=>{const d=n.find(g=>g?.obj?.k===f);if(!d)return;const p=s[d.type]?.[0]||{obj:{t:"",p:"",k:""},decode:"",shape:void 0};e({...t,field:d,columnsType:d.type,operator:p,value:""})},l=f=>{const d=s[t.columnsType]?.find(p=>p.obj.k===f);d&&e({...t,operator:d})},c=f=>{e({...t,value:f})},u=()=>{switch(t.columnsType){case"string":return V.jsx(ia,{bindValue:t.value,onChange:f=>c(f.bindValue)});case"number":return V.jsx(sq,{bindValue:t.value,onChange:f=>{f&&c(f)}});case"date":return V.jsx(kI,{bindValue:t.value,onChange:f=>c(f.bindValue)})}},h={row:`${dg["smp-filter-row"]}`};return V.jsxs("div",{className:h.row,children:[!i&&V.jsx(im,{bindValue:t.field.obj.k,options:n.map(f=>({obj:{t:"",p:"",k:f?.obj?.k||""},decode:f.decode,shape:void 0})),onChange:f=>o(f.bindValue),ListDescrMode:zv.BOTH,DescrMode:zv.CODE_ONLY,isEditable:!0}),V.jsx(im,{bindValue:t.operator?.obj.k,options:s[t.columnsType],onChange:f=>l(f.bindValue),ListDescrMode:zv.BOTH,DescrMode:zv.CODE_ONLY,isEditable:!0},t.columnsType),u(),V.jsx(lr,{bindValue:"",ShowText:!1,label:"Delete",onClick:r,appearance:"ghost",variant:"base",icon:"delete"})]})},vq=({group:t,onChange:e,onDelete:r,onClose:n,level:i=0,fieldOptions:a,hasSubGroups:s=!0,hasSubFilters:o=!0,currentColumnName:l,hasButtonGroup:c=!0})=>{const{translate:u}=Ta(),h=(v,y)=>{const x=[...t.filters];x[v]=y,e({...t,filters:x})},f=v=>{const y=[...t.filters];y.splice(v,1),e({...t,filters:y})},d=()=>{const v=a[0],y={...v_},x={field:v,columnsType:v?.type||"string",operator:y,value:""};e({...t,filters:[...t.filters,x]})},p=()=>{let v;if(l){const x=a.find(w=>w.obj?.k===l),b={...v_};v={field:x||a[0]||"",columnsType:x?.type||a[0]?.type||"string",operator:b,value:""}}else{const x={...v_};v={field:a[0]||"",columnsType:a[0]?.type||"string",operator:x,value:""}}const y={logic:"and",filters:[v]};e({...t,filters:[...t.filters,y]})},g=v=>{e({...t,logic:v})},m={filterGroup:`${dg["smp-filter-group"]}`,filterToolbar:`${dg["smp-filter-toolbar"]}`,filterList:`${dg["smp-filter-list"]}`,actionButtons:`${dg["smp-filter-actionButtons"]}`};return V.jsxs("div",{className:m.filterGroup,style:i!=0?{marginLeft:20}:void 0,"data-component":i===0?"filter":void 0,children:[V.jsxs("div",{className:m.filterToolbar,children:[c&&V.jsx(rq,{options:[{shape:void 0,decode:"AND",obj:{t:"",p:"",k:"and"}},{shape:void 0,decode:"OR",obj:{t:"",p:"",k:"or"}}],bindValue:t.logic,onChange:v=>g(v.bindValue)}),V.jsxs("div",{className:m.actionButtons,children:[o&&V.jsx(lr,{onClick:d,bindValue:u(gs.ADD_FILTER),icon:"plus",appearance:"outlined",variant:"base"}),s&&V.jsx(lr,{onClick:p,bindValue:u(gs.ADD_SUB_GROUP),icon:"plus",appearance:"outlined",variant:"base"}),r&&V.jsx(lr,{bindValue:"",ShowText:!1,label:"Delete",onClick:r,appearance:"outlined",variant:"base",icon:"delete"}),n&&V.jsx(lr,{bindValue:u(Ha.CLOSE),ShowText:!0,label:"Delete",onClick:n,icon:"close",appearance:"outlined",variant:"base"})]})]}),V.jsx("div",{className:m.filterList,children:t.filters.map((v,y)=>({filter:v,index:y})).filter(({filter:v})=>l?"logic"in v?v.filters.some(y=>"logic"in y?!1:y.field?.obj?.k===l):v.field?.obj?.k===l:!0).map(({filter:v,index:y})=>"logic"in v?V.jsx(vq,{group:v,onChange:x=>h(y,x),onDelete:()=>f(y),level:i+1,fieldOptions:a,hasSubGroups:!1,hasSubFilters:!0,currentColumnName:l,hasButtonGroup:!0},y):V.jsx(Fde,{filter:v,onChange:x=>h(y,x),onDelete:()=>f(y),fieldOptions:a,hasCurrentColumn:!!l},y))})]})},cN=({filters:t,onChange:e,fieldOptions:r,hasSubGroups:n,hasSubFilters:i,ref:a,currentColumnName:s,hasButtonGroup:o,onClose:l})=>{const c={filterWrapper:`${dg["smp-filter-wrapper"]}`};return V.jsx("div",{onClick:u=>{u.stopPropagation()},"aria-hidden":"true",children:V.jsx("div",{className:c.filterWrapper,ref:a,children:V.jsx(vq,{group:t,onChange:e,fieldOptions:r,hasSubFilters:i,hasSubGroups:n,currentColumnName:s,hasButtonGroup:o,onClose:l})})})},$de={"smp-groupBar-container":"_smp-groupBar-container_hxnfs_1"},zde=({groups:t=[],isDraggable:e=!0,isEditable:r=!0,onChange:n,onDrop:i,onDragOver:a})=>{const s=t.map(o=>({bindValue:o.column}));return V.jsxs("th",{className:$de["smp-groupBar-container"],onDragOver:a,onDrop:i,children:[V.jsx(Dr,{icon:"groups"}),V.jsx(G3,{elements:s,isEditable:r,isDraggable:e,DescrMode:"CodeOnly",onChange:n})]})},Ef={"smp-headerCell":"_smp-headerCell_laepr_1","smp-headerCell-container":"_smp-headerCell-container_laepr_9","smp-headerCell-iconNotification":"_smp-headerCell-iconNotification_laepr_16","smp-resizer":"_smp-resizer_laepr_34","smp-datatable-toolbar":"_smp-datatable-toolbar_laepr_52","smp-datatable-filter":"_smp-datatable-filter_laepr_53"},Vde=({columns:t,columnWidths:e,groups:r,showGroupBar:n,showFilter:i,filterColumn:a,activeFilters:s,fieldOptions:o,Filter:l,enableSelection:c,allVisibleRowsSelected:u,sortBy:h,sortOrder:f,onToggleFilter:d,onToggleColumnFilter:p,onFiltersChange:g,onResetFilters:m,onGroupChange:v,onGroupDrop:y,onGroupDragOver:x,onMouseDown:b,onToggleAllRows:w,onSort:_,onDragStart:S,onDragOver:C,onDrop:T})=>{const A=Q.useRef({}),{anchorRef:k,targetRef:I}=Ro({position:"bottom",open:i}),{anchorRef:E,targetRef:M}=Ro({position:"bottom",open:a!==null}),R=Q.useCallback(P=>Dde(P,s),[s]),D=Q.useMemo(()=>Mde(s),[s]),L={headerCell:`${Ef["smp-headerCell"]}`,headerCellContainer:`${Ef["smp-headerCell-container"]}`,resizer:`${Ef["smp-resizer"]}`,datatableToolbar:`${Ef["smp-datatable-toolbar"]} ${Ef["smp-headerCell-"]}`,datatableFilter:`${Ef["smp-datatable-filter"]}`};return V.jsxs("thead",{children:[V.jsxs("tr",{className:L.datatableToolbar,children:[V.jsx("th",{children:V.jsxs("div",{ref:k,className:L.datatableFilter,children:[V.jsx(lr,{onClick:d,bindValue:`${D}`,label:i?"Nascondi filtri":"Mostra filtri",icon:"filter_list",variant:"base"}),(l||D>0)&&V.jsx(V.Fragment,{children:V.jsx(lr,{onClick:m,bindValue:"Reset",icon:"cancel",appearance:"ghost",variant:"base",label:"Rimuovi tutti i filtri"})})]})}),(r||n)&&V.jsx(zde,{groups:r,onChange:v,onDrop:y,onDragOver:x})]}),i&&V.jsx(Po,{children:V.jsx(cN,{filters:s,fieldOptions:o,onChange:g,hasSubGroups:!0,ref:I,hasSubFilters:!1,onClose:d})}),V.jsxs("tr",{children:[c&&V.jsx("th",{className:L.headerCell,style:{minWidth:40,justifyContent:"center"},children:V.jsx(H3,{bindValue:u,onChange:w})}),t&&t?.map(P=>P.visible&&V.jsx("th",{tabIndex:0,role:"columnheader",onClick:()=>_(P.name),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),_(P.name))},onDragStart:()=>S(P.name),onDragOver:C,onDrop:()=>T(P.name),className:L.headerCell,style:{width:e[P.name],minWidth:e[P.name],maxWidth:e[P.name]},ref:O=>{A.current[P.name]=O,a===P.name&&O&&(typeof E=="function"?E(O):E&&"current"in E&&(E.current=O))},children:V.jsxs("div",{draggable:!0,onDragStart:O=>{O.dataTransfer.setData("text/plain",P.name)},className:L.headerCellContainer,children:[V.jsx(jn,{variant:"title",bindValue:P.title}),V.jsxs("div",{children:[h===P.name?V.jsx(Dr,{icon:f==="asc"?"arrow-up":"arrow-down",isInteractable:!0}):V.jsx("span",{style:{minWidth:"0.875rem",minHeight:"0.875rem"}}),V.jsx("span",{className:`${R(P.name)?Ef["smp-headerCell-iconNotification"]:""}`,children:V.jsx(Dr,{icon:"filter_list",onClick:O=>{p(P.name),O.stopPropagation()},tabIndex:0,isInteractable:!0})})]}),a===P.name&&V.jsx(Po,{children:V.jsx(cN,{filters:s,fieldOptions:o.filter(O=>O.obj?.k===a),onChange:g,hasSubGroups:!0,ref:M,hasSubFilters:!1,currentColumnName:a,hasButtonGroup:!1,onClose:()=>p(P.name)})}),V.jsx("div",{className:L.resizer,onMouseDown:O=>{b(O,P.name)},role:"region"})]})},P.name))]})]})},Ude=t=>({DftGroup:cde(t.groups),expandedGroups:t.expandedGroups}),jde=t=>({groups:dq(t.DftGroup),expandedGroups:t.expandedGroups??new Set}),Hde=({imperativeHandle:t,data:e,lineHeight:r=28,TableHeight:n=sN,decimalSeparator:i=".",DftGroup:a,expandedGroups:s,columnSizingMode:o="fit-content",ShowGroup:l="Yes",Filter:c,MultiSelect:u="No",Columns:h,onRowClick:f,onMultiSelectionChange:d,onContextMenu:p,onStateChange:g,DftTotal:m})=>{const[v]=Q.useState(ude(m||"")),[y,x]=Q.useState(()=>e?{columns:h?Bde(e,Ode(h)):e.columns,rows:e.rows??[]}:{columns:[],rows:[]}),[b,w]=Q.useState(dq(a)),[_,S]=Q.useState(s??new Set),[C,T]=Q.useState(!1),[A,k]=Q.useState(new Set),[I,E]=Q.useState(null),M=Q.useMemo(()=>xde(e?.columns||[]),[e?.columns]),[R,D]=Q.useState(()=>oN(c,M));Q.useEffect(()=>{g?.(Ude({groups:b,expandedGroups:_}))},[g,b,_]),Q.useImperativeHandle(t,()=>({setState:Ee=>{const pe=jde(Ee);w(pe.groups),S(pe.expandedGroups)}}),[]);const L=Q.useRef(null),[P,O]=fde({columns:y?.columns??[],rows:y?.rows??[],containerRef:L,sizingMode:o}),{handleDragStart:$,handleDragOver:N,handleDrop:U}=Lde(y.columns,Ee=>x(pe=>({...pe,columns:Ee}))),{sortBy:j,sortOrder:B,handleSort:q}=Pde({...y,rows:y.rows},i),W=Q.useMemo(()=>{let Ee=e?.rows??[];R?.filters?.length>0&&(Ee=Cde(Ee,R));let pe=Ee;j&&(pe=mq({...e??{columns:[],rows:[]},rows:Ee},j,B,i).rows);let Ve=pe;if(b?.length&&pe.length>0){const{flatRows:qe}=hde(pe,b,r,_,v);Ve=qe}return Ve},[e,R,j,b,B,i,r,_,v]),X=Q.useMemo(()=>typeof n=="number"?n:typeof n=="string"&&_S(n)?aN(n):aN(sN),[n]),{virtualItems:K,containerProps:G,innerProps:H}=HW({items:W,itemHeight:r,containerHeight:X,overscan:5}),Y=Q.useMemo(()=>{const Ee=W.map((pe,Ve)=>Ve);return Ee.every(pe=>A.has(pe))&&Ee.length>0},[A,W]);Q.useEffect(()=>{if(Yr(u)&&d){const Ee=Array.from(A).map(pe=>W[pe]).filter(Boolean);d(Ee)}},[A,u,W,d]);const J=Q.useCallback(Ee=>{D(Ee)},[]),ie=Q.useCallback(()=>{D(oN(c,M))},[c,M]),me=Q.useCallback(()=>{T(Ee=>!Ee)},[]),oe=Q.useCallback(Ee=>{E(pe=>pe===Ee?null:Ee)},[]),ne=Ee=>{w(lde(Ee,b))},de=Ee=>{Ee.preventDefault();const pe=Ee.dataTransfer.getData("text/plain");if(!pe||b.some(tt=>tt.column===pe))return;const qe=[...b,{column:pe,visible:!0}];w(qe)},ve=Ee=>{Ee.preventDefault()},Ne=(Ee,pe)=>{const Ve=Ee.clientX,qe=P[pe],tt=Ot=>{const Ea=Ot.clientX-Ve,xr=Math.max(50,qe+Ea);O(Js=>({...Js,[pe]:xr}))},_t=()=>{window.removeEventListener("mousemove",tt),window.removeEventListener("mouseup",_t)};window.addEventListener("mousemove",tt),window.addEventListener("mouseup",_t)},ke=Ee=>{k(pe=>{const Ve=new Set(pe);return Ee.every(tt=>Ve.has(tt))?Ee.forEach(tt=>Ve.delete(tt)):Ee.forEach(tt=>Ve.add(tt)),Ve})},Le=()=>{const Ee=y.rows.map((pe,Ve)=>Ve);ke(Ee)},$e={smpTable:`${sde["smp-table"]}`};return y&&V.jsx("div",{className:$e.smpTable,...G,ref:L,children:V.jsxs("table",{children:[V.jsx(Vde,{columns:y.columns,columnWidths:P,groups:b,showGroupBar:Yr(l),showFilter:C,filterColumn:I,activeFilters:R,fieldOptions:M,Filter:c,enableSelection:Yr(u),allVisibleRowsSelected:Y,sortBy:j,sortOrder:B,onToggleFilter:me,onToggleColumnFilter:oe,onFiltersChange:J,onResetFilters:ie,onGroupChange:ne,onGroupDrop:de,onGroupDragOver:ve,onMouseDown:Ne,onToggleAllRows:Le,onSort:q,onDragStart:$,onDragOver:N,onDrop:U}),V.jsx("tbody",{...H,children:K.map(({item:Ee,index:pe,offsetTop:Ve})=>Ee.isGroup?V.jsx(Nde,{label:Ee.value||"",rowHeight:r,offsetTop:Ve,level:Ee.level,cells:Ee.cells,columns:y.columns,columnWidths:P,onClick:()=>{const qe=Ee.id;qe&&S(tt=>ode(tt,qe))},isExpanded:Ee.isExpanded},pe):V.jsx(DI,{row:Ee,columns:y.columns,columnWidths:P,rowHeight:r,offsetTop:Ve,decimalSeparator:i,isGroup:!1,enableSelection:Yr(u),isSelected:A.has(pe),onToggleSelect:()=>{ke([pe])},onRowClick:f,onContextMenu:p},pe))}),V.jsx(Rde,{columns:y.columns,columnWidths:P,totals:v,rows:W,hasGroups:!!b?.length})]})})},f2={"smp-drawer":"_smp-drawer_1h5dq_1","smp-drawer-container-header":"_smp-drawer-container-header_1h5dq_22","smp-drawer-container-layout":"_smp-drawer-container-layout_1h5dq_27","smp-drawer-overlay":"_smp-drawer-overlay_1h5dq_58"},Gde=(t,e,r)=>t?!r||e?!0:t.shape===Ke.BUTTON||t.shape===Ke.BUTTON_LIST:!1,yq=Q.createContext(void 0),xq=()=>{const t=Q.useContext(yq);if(!t)throw new Error("useScaffold must be used inside ScaffoldProvider");return t},Wde=({data:t,onClick:e,onEnter:r,loadOptions:n,onContextMenu:i,onOpen:a})=>{const{isAppBarEnabled:s,isDrawerOpen:o,toggleDrawer:l,isSideBarEnabled:c}=xq(),[u,h]=Q.useState({}),f=Q.useCallback(p=>{if(!p?.rows?.length||!p?.columns?.length)return{};const g=p.rows[0];return p.columns.filter(m=>m.visible??!0).reduce((m,v)=>{const y=g.cells?.[v.name];if(!Gde(y,o,c??!1))return m;const x={...y,id:v.name,onOptionsRequest:n,onChange:b=>{h(w=>{const _={...w};return _?.[v.name]&&(_[v.name].obj.k=b.obj.k),_})},onClick:(b,w)=>w.fun&&e?.(w),onEnter:b=>r?.(b),onContextMenu:(b,w)=>i?.(b,w)};return Yr(c)&&(x.data={...x.data,ShowText:o,variant:"base",justify:"center",FullWidth:"Yes"}),{...m,[v.name]:x}},{})},[n,e,i,r,o,c]);if(Q.useEffect(()=>{if(o){const p=a?.();h(f(p||t))}else h(f(t))},[o,a,t,f]),!t?.rows?.length||!t.columns?.length)return null;const d={drawer:f2["smp-drawer"],headerContainer:f2["smp-drawer-container-header"],layoutContainer:f2["smp-drawer-container-layout"],overlay:f2["smp-drawer-overlay"]};if(u){const p=V.jsxs("aside",{className:d.drawer,"aria-label":"Drawer","data-component":"drawer","data-drawer-minified-on-close":c,"data-drawer-expanded":o,"smp-id":"drawer",children:[(!c||!s)&&V.jsx("div",{className:d.headerContainer,children:V.jsx(lr,{bindValue:"",BtnTit:o?"Collapse":"Expand",variant:"base",icon:o?"menu_close":"menu",justify:"end",ShowText:!1,onClick:()=>{l?.()},FullWidth:!0})}),V.jsx("div",{className:d.layoutContainer,children:V.jsx(Zy,{layout:t.rows[0].layout,children:Object.values(u).map(g=>V.jsx(Mo,{...g}))})})]});return c?V.jsx(V.Fragment,{children:p}):V.jsx(bS,{open:o,position:"left",isModal:!0,closeOnClickOutside:!0,onClose:()=>{l?.()},className:d.overlay,children:p})}},uN={"smp-field-container":"_smp-field-container_1y69b_1"},qde=({data:t,Type:e,ShowSubmit:r=!1,SubmitPosition:n="Right",DefaultValue:i,Label:a,LabelPosition:s="Left",Helper:o,SelFirst:l,SelectRow:c,Ext:u,advanceResearchAutoSelect:h,onChange:f,onClick:d,onOptionsRequest:p,onUploadRequest:g,onAdvanceResearchLoadInitialData:m,onAdvanceResearchLeafNodeClick:v})=>{const[y,x]=Q.useState(),b=Q.useRef(void 0);Q.useEffect(()=>{x(()=>{if(!t)return;const A={...t};return e&&(A.shape=e.toLocaleUpperCase()),i&&(A.obj=vhe(i)),u&&(A.data={...A.data,...q7(u)}),A.isEditable==null&&(A.isEditable=!0),A.shape=AI(A.obj,A.shape,A.data?.size)||Ke.TEXT_FIELD,b.current=A,A})},[t,i,u,e]);const w=A=>{b.current?.obj?.k!=A.obj?.k&&(f?.(A),b.current=A)},_=Yr(r)?`${uN["smp-field-position"]}-${n}`:"",S={container:`${uN["smp-field-container"]} ${_}`},C=l=="Yes"||l==!0,T=c?parseInt(c)-1:void 0;if(y)return V.jsx(Vm.Provider,{value:{onAdvanceResearchLoadInitialData:m,onAdvanceResearchLeafNodeClick:v,advanceResearchAutoSelect:h},children:V.jsxs("div",{className:S.container,children:[V.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:V.jsx(Mo,{...y,id:"FLD",onChange:x,onOptionsRequest:p,onConfirmedChange:w,onEnter:A=>d?.(A),onBlur:w,onUploadRequest:g,label:a,labelPosition:s,helper:o,autoSelectOptionIndex:C?0:T||void 0})}),Yr(r)&&V.jsx(lr,{optionalDisplayValue:"Confirm",onClick:()=>d?.(y),bindValue:"Confirm"})]})})},tT="command-submit",a8=(t,e)=>({before:t,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(t.columns)),rows:[{cells:JSON.parse(JSON.stringify(e)),id:"1"}]}}),Xde=(t,e)=>{const r=[...e];return{cells:Object.fromEntries(Object.entries(t).map(([i,a])=>{if(a?.data?.mappedCommandId){const s=r.findIndex(o=>o.obj?.k===a?.data?.mappedCommandId);if(s!==-1){const[o]=r.splice(s,1),l={...a.data},c={...a,fun:o.fun,data:l,obj:{t:a.obj?.t||"",p:a.obj?.p||"",k:a.data.mappedCommandId}};return[i,c]}}return[i,a]})),remainingCommands:r}},hN=(t,e,r)=>{if(!t.rows?.length||!t.columns?.length)return{state:{},commandState:[]};const n=t.rows[0],i=Xde(n.cells??{},t.setup?.commands?[...t.setup.commands]:[]);return{state:t.columns.reduce((s,o)=>{const l=i.cells[o.name]??n.cells?.[o.name],c=AI(l.obj,l.shape,l.data?.size),u={...l,id:o.name,label:o.title,dSep:e,shape:c||Ke.TEXT_FIELD,helper:o.helper,data:{...l.data,dSep:e}};return u.isEditable==null&&(u.isEditable=!0),r&&(u.isEditable=!1),{...s,[o.name]:u}},{}),commandState:i.remainingCommands??[]}},Yde=t=>{const r=[];return t.filter(n=>n.visible==!0||n.visible==null).forEach(n=>{r.push({id:n.name,content:[{id:n.name}]})}),{horizontal:!0,inline:!0,sections:r}},Kde=t=>t==Ke.CHECKBOX||t==Ke.SWITCH||t==Ke.RADIO||t==Ke.BUTTON_GROUP||t==Ke.SELECT,s8={"smp-form":"_smp-form_tncm5_1","smp-form-commands":"_smp-form-commands_tncm5_34","smp-form-content":"_smp-form-content_tncm5_38"},Zde=Q.forwardRef(({data:t,id:e,disabled:r=!1,SubmitButton:n="Yes",ShowButtons:i,UpdateOnClick:a="No",decimalSeparator:s=".",AutoFocus:o="No",AutoSkip:l="No",Position:c="COLUMNS",advanceResearchAutoSelect:u,optionsHandler:h,onSubmit:f,onCheck:d,onCheckObj:p,onContextMenu:g,onButtonClick:m,onAdvanceResearchLeafNodeClick:v,onUploadRequest:y,onAdvanceResearchLoadInitialData:x,onSaveTemporaryComponentState:b,onMountComponent:w,onObjectProtocol:_},S)=>{const C=Q.useRef(!1),T=Q.useRef([]),{state:A,commandState:k}=hN(t,s,r),[I,E]=Q.useState(A),[M,R]=Q.useState(k),{translate:D}=Ta(),L=Q.useId(),P=Q.useRef(null),O=Q.useRef(A),$=Q.useRef(!1),N=Q.useRef(!1);Q.useImperativeHandle(S,()=>({setState:oe=>{$.current=!0,E(oe)}}),[]);const U=Q.useRef(!1);Q.useEffect(()=>{if(!U.current&&w){U.current=!0;const oe=w();oe&&E(JSON.parse(oe))}},[]);const j=Q.useRef(b);Q.useEffect(()=>{j.current=b},[b]),Q.useEffect(()=>()=>{j.current&&!$.current&&!N.current&&j.current(JSON.stringify(O.current))},[]),Q.useEffect(()=>{const oe=P.current;if(!oe)return;const ne=de=>{q(de.detail.id)};return oe.addEventListener(tT,ne),()=>{oe.removeEventListener(tT,ne)}},[]),Q.useEffect(()=>{if($.current=!1,N.current=!0,C.current){const ne=hN(t,s,r);E(ne.state),R(ne.commandState)}else C.current=!0,P.current&&P.current.querySelectorAll('[type="text"]').forEach(de=>{de instanceof HTMLInputElement&&T.current.push(de)});const oe=setTimeout(()=>{N.current=!1},100);return()=>{clearTimeout(oe)}},[t]),Q.useEffect(()=>{Yr(o)&&P.current&&T.current.length>0&&T.current[0].focus()},[o]),Q.useEffect(()=>{O.current=I},[I]);const B=(oe,ne)=>{if($.current=!1,E(de=>({...de,[oe]:{...de[oe],obj:{t:de[oe].obj?.t||"",p:de[oe].obj?.p||"",k:ne.obj?.k||""},decode:ne.decode,data:{...de[oe].data,error:void 0},value:ne.obj?.k}})),Yr(a)&&(ne.shape==Ke.CHECKBOX||ne.shape==Ke.SWITCH||ne.shape==Ke.RADIO)){const de=structuredClone(I);de[oe].obj.k=ne.obj.k,de[oe].value=ne.obj.k,f({value:a8(t,de)})}if(Yr(l)&&ne.data?.maxLength&&ne.data.maxLength<=ne.obj.k.length){const de=T.current.findIndex(ve=>ve.name==oe);de<T.current.length-1&&T.current[de+1].focus()}},q=oe=>{const ne=a8(t,I);f({value:ne,cell:oe})},W=(oe,ne)=>{m?.({cellId:oe,currentState:{type:"SmeupDataTable",columns:t.columns,rows:[{cells:I,id:"1"}]},fun:ne||""})},X=async(oe,ne)=>{if(ne.obj?.k!=t.rows[0].cells?.[oe].obj?.k&&(t.rows[0].cells?.[oe].inputSettings?.checkObject&&p&&((await p({obj:ne.obj,fun:ne.fun,cellId:oe})).valid||E(ve=>({...ve,[oe]:{...ve[oe],data:{...ve[oe].data,error:D(Ha.CHECK_OBJECT_WRONG_VALIDATION)}}}))),t.rows[0].cells?.[oe].inputSettings?.checkValueOnExit)){const de=structuredClone(I);de[oe]={id:oe,...ne},de[oe].value=de[oe].obj?.k;const ve=a8(t,de);d?.({value:ve,cell:oe})}},K=(oe,ne)=>{Kde(I[oe].shape)&&X(oe,ne)},G=M?.map((oe,ne)=>Q.createElement(Mo,{...oe,decode:oe.value,data:{BtnTxt:oe.value},id:`command-${ne}`,key:`command-${ne}`,shape:Ke.BUTTON,onClick:()=>q(oe.obj?.k)}))||[];Yr(n)&&G.unshift(V.jsx(Mo,{decode:D(Ha.CONFIRM_BUTTON),shape:Ke.BUTTON,icon:"check",id:"",obj:{t:"",p:"",k:""},data:{submit:!0,BtnTxt:D(Ha.CONFIRM_BUTTON),BtnTit:D(Ha.CONFIRM_BUTTON)}},"submit-command"));const H={smpForm:`${s8["smp-form"]}`,smpFormCommands:`${s8["smp-form-commands"]}`,smpFormContent:`${s8["smp-form-content"]}`},Y=()=>i==="LEFT"||i==="RIGHT"?{sections:G.map((oe,ne)=>({id:`cmd-${ne}`,horizontal:!1,content:[{id:oe.props.id}]}))}:{sections:[{id:"1",horizontal:!0,justify:"start",content:G.map(oe=>({id:oe.props.id}))}]},J=G.length>0&&V.jsx("div",{className:H.smpFormCommands,children:V.jsx(Zy,{layout:Y(),children:G})}),ie=()=>c==="INLINE"||c==="UPINLINE"?Yde(t.columns):t.rows[0].layout,me=async(oe,ne,de)=>(b&&b(JSON.stringify(I)),x?await x(oe,ne,de):{type:"SmeupDataTree",nodes:[]});return V.jsx(Vm.Provider,{value:{onAdvanceResearchLoadInitialData:me,onAdvanceResearchLeafNodeClick:v,advanceResearchAutoSelect:u},children:I&&V.jsxs("form",{"data-component":"input-panel",className:H.smpForm,"data-command-position":i||"BOTTOM",id:e||L,onSubmit:oe=>{oe.preventDefault(),q()},ref:P,role:"form",children:[t.rows?.length>0&&V.jsx("div",{className:H.smpFormContent,children:V.jsx(Zy,{layout:ie(),columns:t.columns.reduce((oe,ne)=>({...oe,[ne.name]:ne}),{}),children:Object.values(I).map(oe=>V.jsx(Mo,{...oe,onOptionsRequest:oe.fun?async(ne,de)=>await h(ne,de,{type:"SmeupDataTable",columns:t.columns,rows:[{cells:I,id:"1"}]},oe.id):void 0,onChange:ne=>B(oe.id,ne),onBlur:ne=>X(oe.id,ne),onConfirmedChange:ne=>K(oe.id,ne),onContextMenu:g,onObjectProtocol:_,onClick:()=>{(oe.shape=="BTN"||oe.shape=="CFM")&&(oe.fun?W(oe.id,oe.fun):oe.data?.mappedCommandId&&q(oe.obj?.k))},data:{...oe.data,autocomplete:"off"},onUploadRequest:y}))})}),J]})})}),Jde=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Wd=[.001,0,0,.001,0,0],_u=1.35,SS=.35,fN=SS/_u,Ba={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},bq="pdfjs_internal_editor_",Ml={FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},dN={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},cd={TRIANGLES:1,LATTICE:2,PATCH:3},wq={FILL:0,ADD_TO_PATH_FLAG:4},Ii={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},wi={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},rT={GROUP:"Group",REPLY:"R"},Qn={INVISIBLE:1,HIDDEN:2,PRINT:4,NOROTATE:16,NOVIEW:32,LOCKED:128,LOCKEDCONTENTS:512},nl={READONLY:1,REQUIRED:2,MULTILINE:4096,PASSWORD:8192,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,FILESELECT:1048576,MULTISELECT:2097152,DONOTSCROLL:8388608,COMB:16777216},pp={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},_q={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},Qde={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},e0e={O:"PageOpen",C:"PageClose"},Jy={WARNINGS:1,INFOS:5},Z={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},qr={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},pN={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let W3=Jy.WARNINGS;function t0e(t){Number.isInteger(t)&&(W3=t)}function r0e(){return W3}function Ht(t){W3>=Jy.INFOS&&console.info(`Info: ${t}`)}function ee(t){W3>=Jy.WARNINGS&&console.warn(`Warning: ${t}`)}function tr(t){throw new Error(t)}function Ir(t,e){t||tr(e)}function n0e(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function CS(t,e=null,r=null){if(!t)return null;if(r&&typeof t=="string"&&(r.addDefaultProtocol&&t.startsWith("www.")&&t.match(/\./g)?.length>=2&&(t=`http://${t}`),r.tryConvertEncoding))try{t=sm(t)}catch{}const n=e?URL.parse(t,e):URL.parse(t);return n0e(n)?n:null}function Te(t,e,r,n=!1){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!0,writable:!1}),r}const ss=(function(){function e(r,n){this.message=r,this.name=n}return e.prototype=new Error,e.constructor=e,e})();let am=class extends ss{constructor(e,r){super(e,"PasswordException"),this.code=r}},o8=class extends ss{constructor(e,r){super(e,"UnknownErrorException"),this.details=r}},Qy=class extends ss{constructor(e){super(e,"InvalidPDFException")}},gN=class extends ss{constructor(e,r,n){super(e,"ResponseException"),this.status=r,this.missing=n}},fe=class extends ss{constructor(e){super(e,"FormatError")}},Zi=class extends ss{constructor(e){super(e,"AbortException")}};function As(t){(typeof t!="object"||t?.length===void 0)&&tr("Invalid argument for bytesToString");const e=t.length,r=8192;if(e<r)return String.fromCharCode.apply(null,t);const n=[];for(let i=0;i<e;i+=r){const a=Math.min(i+r,e),s=t.subarray(i,a);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function na(t){typeof t!="string"&&tr("Invalid argument for stringToBytes");const e=t.length,r=new Uint8Array(e);for(let n=0;n<e;++n)r[n]=t.charCodeAt(n)&255;return r}function ea(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function MI(t){return Object.keys(t).length}function i0e(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function a0e(){try{return new Function(""),!0}catch{return!1}}class oa{static get isLittleEndian(){return Te(this,"isLittleEndian",i0e())}static get isEvalSupported(){return Te(this,"isEvalSupported",a0e())}static get isOffscreenCanvasSupported(){return Te(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Te(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Te(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Te(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:r}=navigator;return Te(this,"platform",{isAndroid:r.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:r.includes("Firefox")})}static get isCSSRoundSupported(){return Te(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Lg=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));let mr=class{static makeHexColor(e,r,n){return`#${Lg[e]}${Lg[r]}${Lg[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,r){let n;e[0]?(e[0]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=e[0],r[2]*=e[0],e[3]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=e[3],r[3]*=e[3]):(n=r[0],r[0]=r[1],r[1]=n,n=r[2],r[2]=r[3],r[3]=n,e[1]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=e[1],r[3]*=e[1],e[2]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=e[2],r[2]*=e[2]),r[0]+=e[4],r[1]+=e[5],r[2]+=e[4],r[3]+=e[5]}static transform(e,r){return[e[0]*r[0]+e[2]*r[1],e[1]*r[0]+e[3]*r[1],e[0]*r[2]+e[2]*r[3],e[1]*r[2]+e[3]*r[3],e[0]*r[4]+e[2]*r[5]+e[4],e[1]*r[4]+e[3]*r[5]+e[5]]}static multiplyByDOMMatrix(e,r){return[e[0]*r.a+e[2]*r.b,e[1]*r.a+e[3]*r.b,e[0]*r.c+e[2]*r.d,e[1]*r.c+e[3]*r.d,e[0]*r.e+e[2]*r.f+e[4],e[1]*r.e+e[3]*r.f+e[5]]}static applyTransform(e,r,n=0){const i=e[n],a=e[n+1];e[n]=i*r[0]+a*r[2]+r[4],e[n+1]=i*r[1]+a*r[3]+r[5]}static applyTransformToBezier(e,r,n=0){const i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5];for(let u=0;u<6;u+=2){const h=e[n+u],f=e[n+u+1];e[n+u]=h*i+f*s+l,e[n+u+1]=h*a+f*o+c}}static applyInverseTransform(e,r){const n=e[0],i=e[1],a=r[0]*r[3]-r[1]*r[2];e[0]=(n*r[3]-i*r[2]+r[2]*r[5]-r[4]*r[3])/a,e[1]=(-n*r[1]+i*r[0]+r[4]*r[1]-r[5]*r[0])/a}static axialAlignedBoundingBox(e,r,n){const i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5],u=e[0],h=e[1],f=e[2],d=e[3];let p=i*u+l,g=p,m=i*f+l,v=m,y=o*h+c,x=y,b=o*d+c,w=b;if(a!==0||s!==0){const _=a*u,S=a*f,C=s*h,T=s*d;p+=C,v+=C,m+=T,g+=T,y+=_,w+=_,b+=S,x+=S}n[0]=Math.min(n[0],p,m,g,v),n[1]=Math.min(n[1],y,b,x,w),n[2]=Math.max(n[2],p,m,g,v),n[3]=Math.max(n[3],y,b,x,w)}static inverseTransform(e){const r=e[0]*e[3]-e[1]*e[2];return[e[3]/r,-e[1]/r,-e[2]/r,e[0]/r,(e[2]*e[5]-e[4]*e[3])/r,(e[4]*e[1]-e[5]*e[0])/r]}static singularValueDecompose2dScale(e,r){const n=e[0],i=e[1],a=e[2],s=e[3],o=n**2+i**2,l=n*a+i*s,c=a**2+s**2,u=(o+c)/2,h=Math.sqrt(u**2-(o*c-l**2));r[0]=Math.sqrt(u+h||1),r[1]=Math.sqrt(u-h||1)}static normalizeRect(e){const r=e.slice(0);return e[0]>e[2]&&(r[0]=e[2],r[2]=e[0]),e[1]>e[3]&&(r[1]=e[3],r[3]=e[1]),r}static intersect(e,r){const n=Math.max(Math.min(e[0],e[2]),Math.min(r[0],r[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(r[0],r[2]));if(n>i)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(r[1],r[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(r[1],r[3]));return a>s?null:[n,a,i,s]}static pointBoundingBox(e,r,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],r),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],r)}static rectBoundingBox(e,r,n,i,a){a[0]=Math.min(a[0],e,n),a[1]=Math.min(a[1],r,i),a[2]=Math.max(a[2],e,n),a[3]=Math.max(a[3],r,i)}static#e(e,r,n,i,a,s,o,l,c,u){if(c<=0||c>=1)return;const h=1-c,f=c*c,d=f*c,p=h*(h*(h*e+3*c*r)+3*f*n)+d*i,g=h*(h*(h*a+3*c*s)+3*f*o)+d*l;u[0]=Math.min(u[0],p),u[1]=Math.min(u[1],g),u[2]=Math.max(u[2],p),u[3]=Math.max(u[3],g)}static#t(e,r,n,i,a,s,o,l,c,u,h,f){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&this.#e(e,r,n,i,a,s,o,l,-h/u,f);return}const d=u**2-4*h*c;if(d<0)return;const p=Math.sqrt(d),g=2*c;this.#e(e,r,n,i,a,s,o,l,(-u+p)/g,f),this.#e(e,r,n,i,a,s,o,l,(-u-p)/g,f)}static bezierBoundingBox(e,r,n,i,a,s,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],r,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],r,l),this.#t(e,n,a,o,r,i,s,l,3*(-e+3*(n-a)+o),6*(e-2*n+a),3*(n-e),c),this.#t(e,n,a,o,r,i,s,l,3*(-r+3*(i-s)+l),6*(r-2*i+s),3*(i-r),c)}};const s0e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function qt(t,e=!1){if(t[0]>="ï"){let n;if(t[0]==="þ"&&t[1]==="ÿ"?(n="utf-16be",t.length%2===1&&(t=t.slice(0,-1))):t[0]==="ÿ"&&t[1]==="þ"?(n="utf-16le",t.length%2===1&&(t=t.slice(0,-1))):t[0]==="ï"&&t[1]==="»"&&t[2]==="¿"&&(n="utf-8"),n)try{const i=new TextDecoder(n,{fatal:!0}),a=na(t),s=i.decode(a);return e||!s.includes("\x1B")?s:s.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,"")}catch(i){ee(`stringToPDFString: "${i}".`)}}const r=[];for(let n=0,i=t.length;n<i;n++){const a=t.charCodeAt(n);if(!e&&a===27){for(;++n<i&&t.charCodeAt(n)!==27;);continue}const s=s0e[a];r.push(s?String.fromCharCode(s):t.charAt(n))}return r.join("")}function sm(t){return decodeURIComponent(escape(t))}function nT(t){return unescape(encodeURIComponent(t))}function ex(t,e){if(t.length!==e.length)return!1;for(let r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Qh(t=new Date){return t instanceof Date||(t=new Date(t)),[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")}let l8=null,mN=null;function o0e(t){return l8||(l8=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,mN=new Map([["ſt","ſt"]])),t.replaceAll(l8,(e,r,n)=>r?r.normalize("NFKC"):mN.get(n))}const l0e="pdfjs_internal_id_";function c0e(t,e,r){if(!Array.isArray(r)||r.length<2)return!1;const[n,i,...a]=r;if(!t(n)&&!Number.isInteger(n)||!e(i))return!1;const s=a.length;let o=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;o=!1;break;default:return!1}for(const l of a)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function Li(t,e,r){return Math.min(Math.max(t,e),r)}function vN(t){return Uint8Array.prototype.toHex?t.toHex():Array.from(t,e=>Lg[e]).join("")}function u0e(t){return Uint8Array.fromBase64?Uint8Array.fromBase64(t):na(atob(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(r=>{r(t(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(t){return t.reduce((e,r)=>e+r,0)});const h0e=Symbol("CIRCULAR_REF"),Di=Symbol("EOF");let Sq=Object.create(null),Cq=Object.create(null),y_=Object.create(null);function f0e(){Sq=Object.create(null),Cq=Object.create(null),y_=Object.create(null)}class xe{constructor(e){this.name=e}static get(e){return Cq[e]||=new xe(e)}}class Bn{constructor(e){this.cmd=e}static get(e){return Sq[e]||=new Bn(e)}}const Aq=function(){return Aq};class re{constructor(e=null){this._map=new Map,this.xref=e,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=Aq}assignXref(e){this.xref=e}get size(){return this._map.size}get(e,r,n){let i=this._map.get(e);return i===void 0&&r!==void 0&&(i=this._map.get(r),i===void 0&&n!==void 0&&(i=this._map.get(n))),i instanceof Ae&&this.xref?this.xref.fetch(i,this.suppressEncryption):i}async getAsync(e,r,n){let i=this._map.get(e);return i===void 0&&r!==void 0&&(i=this._map.get(r),i===void 0&&n!==void 0&&(i=this._map.get(n))),i instanceof Ae&&this.xref?this.xref.fetchAsync(i,this.suppressEncryption):i}getArray(e,r,n){let i=this._map.get(e);if(i===void 0&&r!==void 0&&(i=this._map.get(r),i===void 0&&n!==void 0&&(i=this._map.get(n))),i instanceof Ae&&this.xref&&(i=this.xref.fetch(i,this.suppressEncryption)),Array.isArray(i)){i=i.slice();for(let a=0,s=i.length;a<s;a++)i[a]instanceof Ae&&this.xref&&(i[a]=this.xref.fetch(i[a],this.suppressEncryption))}return i}getRaw(e){return this._map.get(e)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}getRawEntries(){return this._map.entries()}set(e,r){this._map.set(e,r)}setIfNotExists(e,r){this.has(e)||this.set(e,r)}setIfNumber(e,r){typeof r=="number"&&this.set(e,r)}setIfArray(e,r){(Array.isArray(r)||ArrayBuffer.isView(r))&&this.set(e,r)}setIfDefined(e,r){r!=null&&this.set(e,r)}setIfName(e,r){typeof r=="string"?this.set(e,xe.get(r)):r instanceof xe&&this.set(e,r)}setIfDict(e,r){r instanceof re&&this.set(e,r)}has(e){return this._map.has(e)}*[Symbol.iterator](){for(const[e,r]of this._map)yield[e,r instanceof Ae&&this.xref?this.xref.fetch(r,this.suppressEncryption):r]}static get empty(){const e=new re(null);return e.set=(r,n)=>{tr("Should not call `set` on the empty dictionary.")},Te(this,"empty",e)}static merge({xref:e,dictArray:r,mergeSubDicts:n=!1}){const i=new re(e),a=new Map;for(const s of r)if(s instanceof re)for(const[o,l]of s._map){let c=a.get(o);if(c===void 0)c=[],a.set(o,c);else if(!n||!(l instanceof re))continue;c.push(l)}for(const[s,o]of a){if(o.length===1||!(o[0]instanceof re)){i._map.set(s,o[0]);continue}const l=new re(e);for(const c of o)for(const[u,h]of c._map)l._map.has(u)||l._map.set(u,h);l.size>0&&i._map.set(s,l)}return a.clear(),i.size>0?i:re.empty}clone(){const e=new re(this.xref);for(const r of this.getKeys())e.set(r,this.getRaw(r));return e}delete(e){this._map.delete(e)}}class Ae{constructor(e,r){this.num=e,this.gen=r}toString(){return this.gen===0?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(e){const r=y_[e];if(r)return r;const n=/^(\d+)R(\d*)$/.exec(e);return!n||n[1]==="0"?null:y_[e]=new Ae(parseInt(n[1]),n[2]?parseInt(n[2]):0)}static get(e,r){const n=r===0?`${e}R`:`${e}R${r}`;return y_[n]||=new Ae(e,r)}}class yn{constructor(e=null){this._set=new Set(e?._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}class Pi{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,r){this._map.set(e.toString(),r)}putAlias(e,r){this._map.set(e.toString(),this.get(r))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(const[e,r]of this._map)yield[Ae.fromString(e),r]}*keys(){for(const e of this._map.keys())yield Ae.fromString(e)}}function br(t,e){return t instanceof xe&&(e===void 0||t.name===e)}function gi(t,e){return t instanceof Bn&&(e===void 0||t.cmd===e)}function Tq(t,e){return t instanceof re&&(e===void 0||br(t.get("Type"),e))}function AS(t,e){return t.num===e.num&&t.gen===e.gen}class Pt{get length(){tr("Abstract getter `length` accessed")}get isEmpty(){tr("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return Te(this,"isDataLoaded",!0)}getByte(){tr("Abstract method `getByte` called")}getBytes(e){tr("Abstract method `getBytes` called")}async getImageData(e,r){return this.getBytes(e,r)}async asyncGetBytes(){tr("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){const e=this.getByte();return e!==-1&&this.pos--,e}peekBytes(e){const r=this.getBytes(e);return this.pos-=r.length,r}getUint16(){const e=this.getByte(),r=this.getByte();return e===-1||r===-1?-1:(e<<8)+r}getInt32(){const e=this.getByte(),r=this.getByte(),n=this.getByte(),i=this.getByte();return(e<<24)+(r<<16)+(n<<8)+i}getByteRange(e,r){tr("Abstract method `getByteRange` called")}getString(e){return As(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){tr("Abstract method `reset` called")}moveStart(){tr("Abstract method `moveStart` called")}makeSubStream(e,r,n=null){tr("Abstract method `makeSubStream` called")}getBaseStreams(){return null}getOriginalStream(){return this.stream?.getOriginalStream()||this}}const kq=/^[1-9]\.\d$/,iT=2**31-1,d0e=-2147483648,al=[1,0,0,1,0,0],aT=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],sT=["ExtGState","Font","Properties","XObject"];function un(t){let e;return function(){return t&&(e=Object.create(null),t(e),t=null),e}}class tn extends ss{constructor(e,r){super(`Missing data [${e}, ${r})`,"MissingDataException"),this.begin=e,this.end=r}}class oT extends ss{constructor(e){super(e,"ParserEOFException")}}class kh extends ss{constructor(e){super(e,"XRefEntryException")}}class qd extends ss{constructor(e){super(e,"XRefParseException")}}function Eq(t){const e=t.length;if(e===0)return new Uint8Array(0);if(e===1)return new Uint8Array(t[0]);let r=0;for(let a=0;a<e;a++)r+=t[a].byteLength;const n=new Uint8Array(r);let i=0;for(let a=0;a<e;a++){const s=new Uint8Array(t[a]);n.set(s,i),i+=s.byteLength}return n}async function lT(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch file "${t}" with "${e.statusText}".`);return new Uint8Array(await e.arrayBuffer())}function Co({dict:t,key:e,getArray:r=!1,stopWhenFound:n=!0}){let i;const a=new yn;for(;t instanceof re&&!(t.objId&&a.has(t.objId));){t.objId&&a.put(t.objId);const s=r?t.getArray(e):t.get(e);if(s!==void 0){if(n)return s;(i||=[]).push(s)}t=t.get("Parent")}return i}function p0e(t,e,r){const n=new yn,i=t,a={dict:null,ref:null};for(;t instanceof re&&!n.has(e)&&(n.put(e),!t.has("T"));){if(e=t.getRaw("Parent"),!(e instanceof Ae))return a;t=r.fetch(e)}return t instanceof re&&t!==i&&(a.dict=t,a.ref=e),a}const c8=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function g0e(t,e=!1){Ir(Number.isInteger(t)&&t>0,"The number should be a positive integer.");const r="M".repeat(t/1e3|0)+c8[t%1e3/100|0]+c8[10+(t%100/10|0)]+c8[20+t%10];return e?r.toLowerCase():r}function LI(t){return t>0?Math.ceil(Math.log2(t)):0}function Yl(t,e){return t[e]<<24>>24}function pu(t,e){return(t[e]<<24|t[e+1]<<16)>>16}function Zt(t,e){return t[e]<<8|t[e+1]}function kr(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function Gs(t){return t===32||t===9||t===13||t===10}function m0e(t,e){return Array.isArray(t)&&t.length===e&&t.every(r=>typeof r=="boolean")}function Ua(t,e){return Array.isArray(t)?(e===null||t.length===e)&&t.every(r=>typeof r=="number"):ArrayBuffer.isView(t)&&!(t instanceof BigInt64Array||t instanceof BigUint64Array)&&(e===null||t.length===e)}function Eh(t,e){return Ua(t,6)?t:e}function cT(t,e){return Ua(t,4)?t:e}function Nu(t,e){return Ua(t,4)?mr.normalizeRect(t):e}function Iq(t){const e=/(.+)\[(\d+)\]$/;return t.split(".").map(r=>{const n=r.match(e);return n?{name:n[1],pos:parseInt(n[2],10)}:{name:r,pos:0}})}function PI(t){const e=[];let r=0;for(let n=0,i=t.length;n<i;n++){const a=t.charCodeAt(n);(a<33||a>126||a===35||a===40||a===41||a===60||a===62||a===91||a===93||a===123||a===125||a===47||a===37)&&(r<n&&e.push(t.substring(r,n)),e.push(`#${a.toString(16)}`),r=n+1)}return e.length===0?t:(r<t.length&&e.push(t.substring(r,t.length)),e.join(""))}function om(t){return t.replaceAll(/([()\\\n\r])/g,e=>e===`
16
- `?"\\n":e==="\r"?"\\r":`\\${e}`)}function TS(t,e,r,n){if(!t)return;let i=null;if(t instanceof Ae){if(n.has(t))return;i=t,n.put(i),t=e.fetch(t)}if(Array.isArray(t))for(const a of t)TS(a,e,r,n);else if(t instanceof re){if(br(t.get("S"),"JavaScript")){const a=t.get("JS");let s;a instanceof Pt?s=a.getString():typeof a=="string"&&(s=a),s&&=qt(s,!0).replaceAll("\0",""),s&&r.push(s.trim())}TS(t.getRaw("Next"),e,r,n)}i&&n.remove(i)}function q3(t,e,r){const n=Object.create(null),i=Co({dict:e,key:"AA",stopWhenFound:!1});if(i)for(let a=i.length-1;a>=0;a--){const s=i[a];if(s instanceof re)for(const o of s.getKeys()){const l=r[o];if(!l)continue;const c=s.getRaw(o),u=new yn,h=[];TS(c,t,h,u),h.length>0&&(n[l]=h)}}if(e.has("A")){const a=e.get("A"),s=new yn,o=[];TS(a,t,o,s),o.length>0&&(n.Action=o)}return MI(n)>0?n:null}const v0e={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function*y0e(t){for(let e=0,r=t.length;e<r;e++){const n=t.codePointAt(e);n>55295&&(n<57344||n>65533)&&e++,yield n}}function Pg(t){const e=[];let r=0;for(let n=0,i=t.length;n<i;n++){const a=t.codePointAt(n);if(32<=a&&a<=126){const s=v0e[a];s&&(r<n&&e.push(t.substring(r,n)),e.push(s),r=n+1)}else r<n&&e.push(t.substring(r,n)),e.push(`&#x${a.toString(16).toUpperCase()};`),a>55295&&(a<57344||a>65533)&&n++,r=n+1}return e.length===0?t:(r<t.length&&e.push(t.substring(r,t.length)),e.join(""))}function uT(t,e=!1){const r=/^("|').*("|')$/.exec(t);if(r&&r[1]===r[2]){if(new RegExp(`[^\\\\]${r[1]}`).test(t.slice(1,-1)))return e&&ee(`FontFamily contains unescaped ${r[1]}: ${t}.`),!1}else for(const n of t.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(n)||!/^[\w-\\]+$/.test(n))return e&&ee(`FontFamily contains invalid <custom-ident>: ${t}.`),!1;return!0}function x0e(t){const n=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:i,fontWeight:a,italicAngle:s}=t;if(!uT(i,!0))return!1;const o=a?a.toString():"";t.fontWeight=n.has(o)?o:"400";const l=parseFloat(s);return t.italicAngle=isNaN(l)||l<-90||l>90?"14":s.toString(),!0}function Dq(t){const e=["app.launchURL","window.open","xfa.host.gotoURL"],n=new RegExp("^\\s*("+e.join("|").replaceAll(".","\\.")+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,"i").exec(t);return n?.[2]?{url:n[2],newWindow:n[1]==="app.launchURL"&&n[3]==="true"}:null}function ir(t){if(Number.isInteger(t))return t.toString();const e=Math.round(t*100);return e%100===0?(e/100).toString():e%10===0?t.toFixed(1):t.toFixed(2)}function Mq(t){if(!t)return null;const e=new Map;for(const[r,n]of t){if(!r.startsWith(bq))continue;let i=e.get(n.pageIndex);i||(i=[],e.set(n.pageIndex,i)),i.push(n)}return e.size>0?e:null}function ja(t){return t==null||b0e(t)?t:Lq(t,!0)}function b0e(t){return typeof t!="string"?!1:!t||/^[\x00-\x7F]*$/.test(t)}function w0e(t){const e=[];for(let r=0,n=t.length;r<n;r++){const i=t.charCodeAt(r);e.push(Lg[i>>8&255],Lg[i&255])}return e.join("")}function Lq(t,e=!1){const r=[];e&&r.push("þÿ");for(let n=0,i=t.length;n<i;n++){const a=t.charCodeAt(n);r.push(String.fromCharCode(a>>8&255),String.fromCharCode(a&255))}return r.join("")}function kS(t,e,r){switch(t){case 90:return[0,1,-1,0,e,0];case 180:return[-1,0,0,-1,e,r];case 270:return[0,-1,1,0,0,r];default:throw new Error("Invalid rotation")}}function yN(t){return Math.ceil(Math.ceil(Math.log2(1+t))/8)}class Ei{static#e=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor="";static _makeHexColor=null;static get _memoryArray(){const e=this.#e;return e?.byteLength?e:this.#e=new Uint8Array(this._memory.buffer)}}function _0e(t,e){const{_mustAddAlpha:r,_destBuffer:n,_destOffset:i,_destLength:a,_memoryArray:s}=Ei;if(e===a){n.set(s.subarray(t,t+e),i);return}if(r)for(let o=t,l=t+e,c=i;o<l;o+=3,c+=4)n[c]=s[o],n[c+1]=s[o+1],n[c+2]=s[o+2],n[c+3]=255;else for(let o=t,l=t+e,c=i;o<l;o+=3,c+=4)n[c]=s[o],n[c+1]=s[o+1],n[c+2]=s[o+2]}function S0e(t){const{_destBuffer:e,_destOffset:r,_memoryArray:n}=Ei;e[r]=n[t],e[r+1]=n[t+1],e[r+2]=n[t+2]}function C0e(t){const{_memoryArray:e}=Ei;Ei._cssColor=Ei._makeHexColor(e[t],e[t+1],e[t+2])}let Ka;const Pq=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Pq.decode();let Vv=null;function Rq(){return(Vv===null||Vv.byteLength===0)&&(Vv=new Uint8Array(Ka.memory.buffer)),Vv}function A0e(t,e){return t=t>>>0,Pq.decode(Rq().subarray(t,t+e))}let RI=0;function Nq(t,e){const r=e(t.length*1,1)>>>0;return Rq().set(t,r/1),RI=t.length,r}function T0e(t,e){const r=Nq(e,Ka.__wbindgen_malloc),n=RI;Ka.qcms_convert_array(t,r,n)}function k0e(t,e,r){Ka.qcms_convert_one(t,e,r)}function E0e(t,e,r,n,i){Ka.qcms_convert_three(t,e,r,n,i)}function I0e(t,e,r,n,i,a){Ka.qcms_convert_four(t,e,r,n,i,a)}function D0e(t,e,r){const n=Nq(t,Ka.__wbindgen_malloc),i=RI;return Ka.qcms_transformer_from_memory(n,i,e,r)>>>0}function M0e(t){Ka.qcms_drop_transformer(t)}const u8=Object.freeze({RGB8:0,0:"RGB8",RGBA8:1,1:"RGBA8",BGRA8:2,2:"BGRA8",Gray8:3,3:"Gray8",GrayA8:4,4:"GrayA8",CMYK:5,5:"CMYK"}),L0e=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});function P0e(){const t={};return t.wbg={},t.wbg.__wbg_copyresult_b08ee7d273f295dd=function(e,r){_0e(e>>>0,r>>>0)},t.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(e){S0e(e>>>0)},t.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(e){C0e(e>>>0)},t.wbg.__wbindgen_init_externref_table=function(){const e=Ka.__wbindgen_export_0,r=e.grow(4);e.set(0,void 0),e.set(r+0,void 0),e.set(r+1,null),e.set(r+2,!0),e.set(r+3,!1)},t.wbg.__wbindgen_throw=function(e,r){throw new Error(A0e(e,r))},t}function R0e(t,e){return Ka=t.exports,Vv=null,Ka.__wbindgen_start(),Ka}function N0e(t){if(Ka!==void 0)return Ka;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=P0e();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));const r=new WebAssembly.Instance(t,e);return R0e(r)}function O0e(t,e,r,n,i,a,s){s=s!==1?0:s;const l=r/i,c=n/a;let u=0,h;const f=new Uint16Array(i),d=r*3;for(let p=0;p<i;p++)f[p]=Math.floor(p*l)*3;for(let p=0;p<a;p++){const g=Math.floor(p*c)*d;for(let m=0;m<i;m++)h=g+f[m],e[u++]=t[h++],e[u++]=t[h++],e[u++]=t[h++],u+=s}}function B0e(t,e,r,n,i,a,s){const o=r/i,l=n/a;let c=0;const u=new Uint16Array(i);if(s===1){for(let p=0;p<i;p++)u[p]=Math.floor(p*o);const h=new Uint32Array(t.buffer),f=new Uint32Array(e.buffer),d=oa.isLittleEndian?16777215:4294967040;for(let p=0;p<a;p++){const g=h.subarray(Math.floor(p*l)*r);for(let m=0;m<i;m++)f[c++]|=g[u[m]]&d}}else{const f=r*4;for(let d=0;d<i;d++)u[d]=Math.floor(d*o)*4;for(let d=0;d<a;d++){const p=t.subarray(Math.floor(d*l)*f);for(let g=0;g<i;g++){const m=u[g];e[c++]=p[m],e[c++]=p[m+1],e[c++]=p[m+2]}}}}function F0e(t,e,r){if(r===1){const n=new Uint32Array(t.buffer),i=new Uint32Array(e.buffer),a=oa.isLittleEndian?16777215:4294967040;for(let s=0,o=n.length;s<o;s++)i[s]|=n[s]&a}else{let n=0;for(let i=0,a=t.length;i<a;i+=4)e[n++]=t[i],e[n++]=t[i+1],e[n++]=t[i+2]}}class Ni{static#e=new Uint8ClampedArray(3);constructor(e,r){this.name=e,this.numComps=r}getRgb(e,r,n=new Uint8ClampedArray(3)){return this.getRgbItem(e,r,n,0),n}getRgbHex(e,r){const n=this.getRgb(e,r,Ni.#e);return mr.makeHexColor(n[0],n[1],n[2])}getRgbItem(e,r,n,i){tr("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,r,n,i,a,s,o){tr("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,r){tr("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,r){return Ni.isDefaultDecode(e,this.numComps)}fillRgb(e,r,n,i,a,s,o,l,c){const u=r*n;let h=null;const f=1<<o,d=n!==a||r!==i;if(this.isPassthrough(o))h=l;else if(this.numComps===1&&u>f&&this.name!=="DeviceGray"&&this.name!=="DeviceRGB"){const p=o<=8?new Uint8Array(f):new Uint16Array(f);for(let m=0;m<f;m++)p[m]=m;const g=new Uint8ClampedArray(f*3);if(this.getRgbBuffer(p,0,f,g,0,o,0),d){h=new Uint8Array(u*3);let m=0;for(let v=0;v<u;++v){const y=l[v]*3;h[m++]=g[y],h[m++]=g[y+1],h[m++]=g[y+2]}}else{let m=0;for(let v=0;v<u;++v){const y=l[v]*3;e[m++]=g[y],e[m++]=g[y+1],e[m++]=g[y+2],m+=c}}}else d?(h=new Uint8ClampedArray(u*3),this.getRgbBuffer(l,0,u,h,0,o,0)):this.getRgbBuffer(l,0,i*s,e,0,o,c);if(h)if(d)O0e(h,e,r,n,i,a,c);else{let p=0,g=0;for(let m=0,v=i*s;m<v;m++)e[p++]=h[g++],e[p++]=h[g++],e[p++]=h[g++],p+=c}}get usesZeroToOneRange(){return Te(this,"usesZeroToOneRange",!0)}static isDefaultDecode(e,r){if(!Array.isArray(e))return!0;if(r*2!==e.length)return ee("The decode map is not the correct length"),!0;for(let n=0,i=e.length;n<i;n+=2)if(e[n]!==0||e[n+1]!==1)return!1;return!0}}class $0e extends Ni{constructor(e,r,n){super("Alternate",e),this.base=r,this.tintFn=n,this.tmpBuf=new Float32Array(r.numComps)}getRgbItem(e,r,n,i){const a=this.tmpBuf;this.tintFn(e,r,a,0),this.base.getRgbItem(a,0,n,i)}getRgbBuffer(e,r,n,i,a,s,o){const l=this.tintFn,c=this.base,u=1/((1<<s)-1),h=c.numComps,f=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!f)&&o===0;let p=d?a:0;const g=d?i:new Uint8ClampedArray(h*n),m=this.numComps,v=new Float32Array(m),y=new Float32Array(h);let x,b;for(x=0;x<n;x++){for(b=0;b<m;b++)v[b]=e[r++]*u;if(l(v,0,y,0),f)for(b=0;b<h;b++)g[p++]=y[b]*255;else c.getRgbItem(y,0,g,p),p+=h}d||c.getRgbBuffer(g,0,n,i,a,8,o)}getOutputLength(e,r){return this.base.getOutputLength(e*this.base.numComps/this.numComps,r)}}class xN extends Ni{constructor(e){super("Pattern",null),this.base=e}isDefaultDecode(e,r){tr("Should not call PatternCS.isDefaultDecode")}}class z0e extends Ni{constructor(e,r,n){super("Indexed",1),this.base=e,this.highVal=r;const i=e.numComps*(r+1);if(this.lookup=new Uint8Array(i),n instanceof Pt){const a=n.getBytes(i);this.lookup.set(a)}else if(typeof n=="string")for(let a=0;a<i;++a)this.lookup[a]=n.charCodeAt(a)&255;else throw new fe(`IndexedCS - unrecognized lookup table: ${n}`)}getRgbItem(e,r,n,i){const{base:a,highVal:s,lookup:o}=this,l=Li(Math.round(e[r]),0,s)*a.numComps;a.getRgbBuffer(o,l,1,n,i,8,0)}getRgbBuffer(e,r,n,i,a,s,o){const{base:l,highVal:c,lookup:u}=this,{numComps:h}=l,f=l.getOutputLength(h,o);for(let d=0;d<n;++d){const p=Li(Math.round(e[r++]),0,c)*h;l.getRgbBuffer(u,p,1,i,a,8,o),a+=f}}getOutputLength(e,r){return this.base.getOutputLength(e*this.base.numComps,r)}isDefaultDecode(e,r){return Array.isArray(e)?e.length!==2?(ee("Decode map length is not correct"),!0):!Number.isInteger(r)||r<1?(ee("Bits per component is not correct"),!0):e[0]===0&&e[1]===(1<<r)-1:!0}}class V0e extends Ni{constructor(){super("DeviceGray",1)}getRgbItem(e,r,n,i){const a=e[r]*255;n[i]=n[i+1]=n[i+2]=a}getRgbBuffer(e,r,n,i,a,s,o){const l=255/((1<<s)-1);let c=r,u=a;for(let h=0;h<n;++h){const f=l*e[c++];i[u++]=f,i[u++]=f,i[u++]=f,u+=o}}getOutputLength(e,r){return e*(3+r)}}class U0e extends Ni{constructor(){super("DeviceRGB",3)}getRgbItem(e,r,n,i){n[i]=e[r]*255,n[i+1]=e[r+1]*255,n[i+2]=e[r+2]*255}getRgbBuffer(e,r,n,i,a,s,o){if(s===8&&o===0){i.set(e.subarray(r,r+n*3),a);return}const l=255/((1<<s)-1);let c=r,u=a;for(let h=0;h<n;++h)i[u++]=l*e[c++],i[u++]=l*e[c++],i[u++]=l*e[c++],u+=o}getOutputLength(e,r){return e*(3+r)/3|0}isPassthrough(e){return e===8}}class j0e extends Ni{constructor(){super("DeviceRGBA",4)}getOutputLength(e,r){return e*4}isPassthrough(e){return e===8}fillRgb(e,r,n,i,a,s,o,l,c){n!==a||r!==i?B0e(l,e,r,n,i,a,c):F0e(l,e,c)}}class Oq extends Ni{constructor(){super("DeviceCMYK",4)}#e(e,r,n,i,a){const s=e[r]*n,o=e[r+1]*n,l=e[r+2]*n,c=e[r+3]*n;i[a]=255+s*(-4.387332384609988*s+54.48615194189176*o+18.82290502165302*l+212.25662451639585*c+-285.2331026137004)+o*(1.7149763477362134*o-5.6096736904047315*l+-17.873870861415444*c-5.497006427196366)+l*(-2.5217340131683033*l-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747),i[a+1]=255+s*(8.841041422036149*s+60.118027045597366*o+6.871425592049007*l+31.159100130055922*c+-79.2970844816548)+o*(-15.310361306967817*o+17.575251261109482*l+131.35250912493976*c-190.9453302588951)+l*(4.444339102852739*l+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578),i[a+2]=255+s*(.8842522430003296*s+8.078677503112928*o+30.89978309703729*l-.23883238689178934*c+-14.183576799673286)+o*(10.49593273432072*o+63.02378494754052*l+50.606957656360734*c-112.23884253719248)+l*(.03296041114873217*l+115.60384449646641*c+-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}getRgbItem(e,r,n,i){this.#e(e,r,1,n,i)}getRgbBuffer(e,r,n,i,a,s,o){const l=1/((1<<s)-1);for(let c=0;c<n;c++)this.#e(e,r,l,i,a),r+=4,a+=3+o}getOutputLength(e,r){return e/4*(3+r)|0}}class H0e extends Ni{constructor(e,r,n){if(super("CalGray",1),!e)throw new fe("WhitePoint missing - required for color space CalGray");if([this.XW,this.YW,this.ZW]=e,[this.XB,this.YB,this.ZB]=r||[0,0,0],this.G=n||1,this.XW<0||this.ZW<0||this.YW!==1)throw new fe(`Invalid WhitePoint components for ${this.name}, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(Ht(`Invalid BlackPoint for ${this.name}, falling back to default.`),this.XB=this.YB=this.ZB=0),(this.XB!==0||this.YB!==0||this.ZB!==0)&&ee(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`),this.G<1&&(Ht(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`),this.G=1)}#e(e,r,n,i,a){const o=(e[r]*a)**this.G,l=this.YW*o,c=Math.max(295.8*l**.3333333333333333-40.8,0);n[i]=c,n[i+1]=c,n[i+2]=c}getRgbItem(e,r,n,i){this.#e(e,r,n,i,1)}getRgbBuffer(e,r,n,i,a,s,o){const l=1/((1<<s)-1);for(let c=0;c<n;++c)this.#e(e,r,i,a,l),r+=1,a+=3+o}getOutputLength(e,r){return e*(3+r)}}class da extends Ni{static#e=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#t=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#n=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#r=new Float32Array([1,1,1]);static#i=new Float32Array(3);static#a=new Float32Array(3);static#s=new Float32Array(3);static#o=(24/116)**3/8;constructor(e,r,n,i){if(super("CalRGB",3),!e)throw new fe("WhitePoint missing - required for color space CalRGB");const[a,s,o]=this.whitePoint=e,[l,c,u]=this.blackPoint=r||new Float32Array(3);if([this.GR,this.GG,this.GB]=n||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=i||new Float32Array([1,0,0,0,1,0,0,0,1]),a<0||o<0||s!==1)throw new fe(`Invalid WhitePoint components for ${this.name}, no fallback available`);(l<0||c<0||u<0)&&(Ht(`Invalid BlackPoint for ${this.name} [${l}, ${c}, ${u}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(Ht(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}#l(e,r,n){n[0]=e[0]*r[0]+e[1]*r[1]+e[2]*r[2],n[1]=e[3]*r[0]+e[4]*r[1]+e[5]*r[2],n[2]=e[6]*r[0]+e[7]*r[1]+e[8]*r[2]}#c(e,r,n){n[0]=r[0]*1/e[0],n[1]=r[1]*1/e[1],n[2]=r[2]*1/e[2]}#f(e,r,n){n[0]=r[0]*.95047/e[0],n[1]=r[1]*1/e[1],n[2]=r[2]*1.08883/e[2]}#h(e){return e<=.0031308?Li(12.92*e,0,1):e>=.99554525?1:Li((1+.055)*e**(1/2.4)-.055,0,1)}#d(e){return e<0?-this.#d(-e):e>8?((e+16)/116)**3:e*da.#o}#m(e,r,n){if(e[0]===0&&e[1]===0&&e[2]===0){n[0]=r[0],n[1]=r[1],n[2]=r[2];return}const i=this.#d(0),a=i,s=this.#d(e[0]),o=i,l=this.#d(e[1]),c=i,u=this.#d(e[2]),h=(1-a)/(1-s),f=1-h,d=(1-o)/(1-l),p=1-d,g=(1-c)/(1-u),m=1-g;n[0]=r[0]*h+f,n[1]=r[1]*d+p,n[2]=r[2]*g+m}#g(e,r,n){if(e[0]===1&&e[2]===1){n[0]=r[0],n[1]=r[1],n[2]=r[2];return}const i=n;this.#l(da.#e,r,i);const a=da.#i;this.#c(e,i,a),this.#l(da.#t,a,n)}#u(e,r,n){const i=n;this.#l(da.#e,r,i);const a=da.#i;this.#f(e,i,a),this.#l(da.#t,a,n)}#p(e,r,n,i,a){const s=Li(e[r]*a,0,1),o=Li(e[r+1]*a,0,1),l=Li(e[r+2]*a,0,1),c=s===1?1:s**this.GR,u=o===1?1:o**this.GG,h=l===1?1:l**this.GB,f=this.MXA*c+this.MXB*u+this.MXC*h,d=this.MYA*c+this.MYB*u+this.MYC*h,p=this.MZA*c+this.MZB*u+this.MZC*h,g=da.#a;g[0]=f,g[1]=d,g[2]=p;const m=da.#s;this.#g(this.whitePoint,g,m);const v=da.#a;this.#m(this.blackPoint,m,v);const y=da.#s;this.#u(da.#r,v,y);const x=da.#a;this.#l(da.#n,y,x),n[i]=this.#h(x[0])*255,n[i+1]=this.#h(x[1])*255,n[i+2]=this.#h(x[2])*255}getRgbItem(e,r,n,i){this.#p(e,r,n,i,1)}getRgbBuffer(e,r,n,i,a,s,o){const l=1/((1<<s)-1);for(let c=0;c<n;++c)this.#p(e,r,i,a,l),r+=3,a+=3+o}getOutputLength(e,r){return e*(3+r)/3|0}}class G0e extends Ni{constructor(e,r,n){if(super("Lab",3),!e)throw new fe("WhitePoint missing - required for color space Lab");if([this.XW,this.YW,this.ZW]=e,[this.amin,this.amax,this.bmin,this.bmax]=n||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=r||[0,0,0],this.XW<0||this.ZW<0||this.YW!==1)throw new fe("Invalid WhitePoint components, no fallback available");(this.XB<0||this.YB<0||this.ZB<0)&&(Ht("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(Ht("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}#e(e){return e>=6/29?e**3:108/841*(e-4/29)}#t(e,r,n,i){return n+e*(i-n)/r}#n(e,r,n,i,a){let s=e[r],o=e[r+1],l=e[r+2];n!==!1&&(s=this.#t(s,n,0,100),o=this.#t(o,n,this.amin,this.amax),l=this.#t(l,n,this.bmin,this.bmax)),o>this.amax?o=this.amax:o<this.amin&&(o=this.amin),l>this.bmax?l=this.bmax:l<this.bmin&&(l=this.bmin);const c=(s+16)/116,u=c+o/500,h=c-l/200,f=this.XW*this.#e(u),d=this.YW*this.#e(c),p=this.ZW*this.#e(h);let g,m,v;this.ZW<1?(g=f*3.1339+d*-1.617+p*-.4906,m=f*-.9785+d*1.916+p*.0333,v=f*.072+d*-.229+p*1.4057):(g=f*3.2406+d*-1.5372+p*-.4986,m=f*-.9689+d*1.8758+p*.0415,v=f*.0557+d*-.204+p*1.057),i[a]=Math.sqrt(g)*255,i[a+1]=Math.sqrt(m)*255,i[a+2]=Math.sqrt(v)*255}getRgbItem(e,r,n,i){this.#n(e,r,!1,n,i)}getRgbBuffer(e,r,n,i,a,s,o){const l=(1<<s)-1;for(let c=0;c<n;c++)this.#n(e,r,l,i,a),r+=3,a+=3+o}getOutputLength(e,r){return e*(3+r)/3|0}isDefaultDecode(e,r){return!0}get usesZeroToOneRange(){return Te(this,"usesZeroToOneRange",!1)}}function Bq(t){const e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),e.response}class Su extends Ni{#e;#t;static#n=!0;static#r=null;static#i=null;constructor(e,r,n){if(!Su.isUsable)throw new Error("No ICC color space support");super(r,n);let i;switch(n){case 1:i=u8.Gray8,this.#t=(a,s,o)=>k0e(this.#e,a[s]*255,o);break;case 3:i=u8.RGB8,this.#t=(a,s,o)=>E0e(this.#e,a[s]*255,a[s+1]*255,a[s+2]*255,o);break;case 4:i=u8.CMYK,this.#t=(a,s,o)=>I0e(this.#e,a[s]*255,a[s+1]*255,a[s+2]*255,a[s+3]*255,o);break;default:throw new Error(`Unsupported number of components: ${n}`)}if(this.#e=D0e(e,i,L0e.Perceptual),!this.#e)throw new Error("Failed to create ICC color space");Su.#i||=new FinalizationRegistry(a=>{M0e(a)}),Su.#i.register(this,this.#e)}getRgbHex(e,r){return this.#t(e,r,!0),Ei._cssColor}getRgbItem(e,r,n,i){Ei._destBuffer=n,Ei._destOffset=i,Ei._destLength=3,this.#t(e,r,!1),Ei._destBuffer=null}getRgbBuffer(e,r,n,i,a,s,o){if(e=e.subarray(r,r+n*this.numComps),s!==8){const l=255/((1<<s)-1);for(let c=0,u=e.length;c<u;c++)e[c]*=l}Ei._mustAddAlpha=o&&i.buffer===e.buffer,Ei._destBuffer=i,Ei._destOffset=a,Ei._destLength=n*(3+o),T0e(this.#e,e),Ei._mustAddAlpha=!1,Ei._destBuffer=null}getOutputLength(e,r){return e/this.numComps*(3+r)|0}static setOptions({useWasm:e,useWorkerFetch:r,wasmUrl:n}){if(!r){this.#n=!1;return}this.#n=e,this.#r=n}static get isUsable(){let e=!1;if(this.#n)if(this.#r)try{this._module=N0e({module:Bq(`${this.#r}qcms_bg.wasm`)}),e=!!this._module,Ei._memory=this._module.memory,Ei._makeHexColor=mr.makeHexColor}catch(r){ee(`ICCBased color space: "${r}".`)}else ee("No ICC color space support due to missing `wasmUrl` API option");return Te(this,"isUsable",e)}}class tx extends Su{static#e;constructor(){const e=new Uint8Array(Bq(`${tx.#e}CGATS001Compat-v2-micro.icc`));super(e,"DeviceCMYK",4)}static setOptions({iccUrl:e}){this.#e=e}static get isUsable(){let e=!1;return Su.isUsable&&(this.#e?e=!0:ee("No CMYK ICC profile support due to missing `iccUrl` API option")),Te(this,"isUsable",e)}}class ln extends Pt{constructor(e,r,n,i){super(),this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=r||0,this.pos=this.start,this.end=r+n||this.bytes.length,this.dict=i}get length(){return this.end-this.start}get isEmpty(){return this.length===0}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const r=this.bytes,n=this.pos,i=this.end;if(!e)return r.subarray(n,i);let a=n+e;return a>i&&(a=i),this.pos=a,r.subarray(n,a)}getByteRange(e,r){return e<0&&(e=0),r>this.end&&(r=this.end),this.bytes.subarray(e,r)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,r,n=null){return new ln(this.bytes.buffer,e,r,n)}clone(){return new ln(this.bytes.buffer,this.start,this.end-this.start,this.dict.clone())}}class _a extends ln{constructor(e){super(na(e))}}class hT extends ln{constructor(){super(new Uint8Array(0))}}class W0e extends ln{constructor(e,r,n){super(new Uint8Array(e),0,e,null),this.chunkSize=r,this._loadedChunks=new Set,this.numChunks=Math.ceil(e/r),this.manager=n,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let r=0,n=this.numChunks;r<n;++r)this._loadedChunks.has(r)||e.push(r);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,r){const n=this.chunkSize;if(e%n!==0)throw new Error(`Bad begin offset: ${e}`);const i=e+r.byteLength;if(i%n!==0&&i!==this.bytes.length)throw new Error(`Bad end offset: ${i}`);this.bytes.set(new Uint8Array(r),e);const a=Math.floor(e/n),s=Math.floor((i-1)/n)+1;for(let o=a;o<s;++o)this._loadedChunks.add(o)}onReceiveProgressiveData(e){let r=this.progressiveDataLength;const n=Math.floor(r/this.chunkSize);this.bytes.set(new Uint8Array(e),r),r+=e.byteLength,this.progressiveDataLength=r;const i=r>=this.end?this.numChunks:Math.floor(r/this.chunkSize);for(let a=n;a<i;++a)this._loadedChunks.add(a)}ensureByte(e){if(e<this.progressiveDataLength)return;const r=Math.floor(e/this.chunkSize);if(!(r>this.numChunks)&&r!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(r))throw new tn(e,e+1);this.lastSuccessfulEnsureByteChunk=r}}ensureRange(e,r){if(e>=r||r<=this.progressiveDataLength)return;const n=Math.floor(e/this.chunkSize);if(n>this.numChunks)return;const i=Math.min(Math.floor((r-1)/this.chunkSize)+1,this.numChunks);for(let a=n;a<i;++a)if(!this._loadedChunks.has(a))throw new tn(e,r)}nextEmptyChunk(e){const r=this.numChunks;for(let n=0;n<r;++n){const i=(e+n)%r;if(!this._loadedChunks.has(i))return i}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;return e>=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}getBytes(e){const r=this.bytes,n=this.pos,i=this.end;if(!e)return i>this.progressiveDataLength&&this.ensureRange(n,i),r.subarray(n,i);let a=n+e;return a>i&&(a=i),a>this.progressiveDataLength&&this.ensureRange(n,a),this.pos=a,r.subarray(n,a)}getByteRange(e,r){return e<0&&(e=0),r>this.end&&(r=this.end),r>this.progressiveDataLength&&this.ensureRange(e,r),this.bytes.subarray(e,r)}makeSubStream(e,r,n=null){r?e+r>this.progressiveDataLength&&this.ensureRange(e,e+r):e>=this.progressiveDataLength&&this.ensureByte(e);function i(){}i.prototype=Object.create(this),i.prototype.getMissingChunks=function(){const s=this.chunkSize,o=Math.floor(this.start/s),l=Math.floor((this.end-1)/s)+1,c=[];for(let u=o;u<l;++u)this._loadedChunks.has(u)||c.push(u);return c},Object.defineProperty(i.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks?!0:this.getMissingChunks().length===0},configurable:!0});const a=new i;return a.pos=a.start=e,a.end=e+r||this.end,a.dict=n,a}getBaseStreams(){return[this]}}class q0e{constructor(e,r){this.length=r.length,this.chunkSize=r.rangeChunkSize,this.stream=new W0e(this.length,this.chunkSize,this),this.pdfNetworkStream=e,this.disableAutoFetch=r.disableAutoFetch,this.msgHandler=r.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=Promise.withResolvers()}sendRequest(e,r){const n=this.pdfNetworkStream.getRangeReader(e,r);n.isStreamingSupported||(n.onProgress=this.onProgress.bind(this));let i=[],a=0;return new Promise((s,o)=>{const l=({value:c,done:u})=>{try{if(u){const h=Eq(i);i=null,s(h);return}a+=c.byteLength,n.isStreamingSupported&&this.onProgress({loaded:a}),i.push(c),n.read().then(l,o)}catch(h){o(h)}};n.read().then(l,o)}).then(s=>{this.aborted||this.onReceiveData({chunk:s,begin:e})})}requestAllChunks(e=!1){if(!e){const r=this.stream.getMissingChunks();this._requestChunks(r)}return this._loadedStreamCapability.promise}_requestChunks(e){const r=this.currRequestId++,n=new Set;this._chunksNeededByRequest.set(r,n);for(const s of e)this.stream.hasChunk(s)||n.add(s);if(n.size===0)return Promise.resolve();const i=Promise.withResolvers();this._promisesByRequest.set(r,i);const a=[];for(const s of n){let o=this._requestsByChunk.get(s);o||(o=[],this._requestsByChunk.set(s,o),a.push(s)),o.push(r)}if(a.length>0){const s=this.groupChunks(a);for(const o of s){const l=o.beginChunk*this.chunkSize,c=Math.min(o.endChunk*this.chunkSize,this.length);this.sendRequest(l,c).catch(i.reject)}}return i.promise.catch(s=>{if(!this.aborted)throw s})}getStream(){return this.stream}requestRange(e,r){r=Math.min(r,this.length);const n=this.getBeginChunk(e),i=this.getEndChunk(r),a=[];for(let s=n;s<i;++s)a.push(s);return this._requestChunks(a)}requestRanges(e=[]){const r=[];for(const n of e){const i=this.getBeginChunk(n.begin),a=this.getEndChunk(n.end);for(let s=i;s<a;++s)r.includes(s)||r.push(s)}return r.sort((n,i)=>n-i),this._requestChunks(r)}groupChunks(e){const r=[];let n=-1,i=-1;for(let a=0,s=e.length;a<s;++a){const o=e[a];n<0&&(n=o),i>=0&&i+1!==o&&(r.push({beginChunk:n,endChunk:i+1}),n=o),a+1===e.length&&r.push({beginChunk:n,endChunk:o+1}),i=o}return r}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const r=e.chunk,n=e.begin===void 0,i=n?this.progressiveDataLength:e.begin,a=i+r.byteLength,s=Math.floor(i/this.chunkSize),o=a<this.length?Math.floor(a/this.chunkSize):Math.ceil(a/this.chunkSize);n?(this.stream.onReceiveProgressiveData(r),this.progressiveDataLength=a):this.stream.onReceiveData(i,r),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const l=[];for(let c=s;c<o;++c){const u=this._requestsByChunk.get(c);if(u){this._requestsByChunk.delete(c);for(const h of u){const f=this._chunksNeededByRequest.get(h);f.has(c)&&f.delete(c),!(f.size>0)&&l.push(h)}}}if(!this.disableAutoFetch&&this._requestsByChunk.size===0){let c;if(this.stream.numChunksLoaded===1){const u=this.stream.numChunks-1;this.stream.hasChunk(u)||(c=u)}else c=this.stream.nextEmptyChunk(o);Number.isInteger(c)&&this._requestChunks([c])}for(const c of l){const u=this._promisesByRequest.get(c);this._promisesByRequest.delete(c),u.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(e);for(const r of this._promisesByRequest.values())r.reject(e)}}function Fq(t){switch(t.kind){case Ii.GRAYSCALE_1BPP:return fT(t);case Ii.RGB_24BPP:return X0e(t)}return null}function fT({src:t,srcPos:e=0,dest:r,width:n,height:i,nonBlackColor:a=4294967295,inverseDecode:s=!1}){const o=oa.isLittleEndian?4278190080:255,[l,c]=s?[a,o]:[o,a],u=n>>3,h=n&7,f=t.length;r=new Uint32Array(r.buffer);let d=0;for(let p=0;p<i;p++){for(const m=e+u;e<m;e++){const v=e<f?t[e]:255;r[d++]=v&128?c:l,r[d++]=v&64?c:l,r[d++]=v&32?c:l,r[d++]=v&16?c:l,r[d++]=v&8?c:l,r[d++]=v&4?c:l,r[d++]=v&2?c:l,r[d++]=v&1?c:l}if(h===0)continue;const g=e<f?t[e++]:255;for(let m=0;m<h;m++)r[d++]=g&1<<7-m?c:l}return{srcPos:e,destPos:d}}function X0e({src:t,srcPos:e=0,dest:r,destPos:n=0,width:i,height:a}){let s=0;const o=i*a*3,l=o>>2,c=new Uint32Array(t.buffer,e,l);if(oa.isLittleEndian){for(;s<l-2;s+=3,n+=4){const u=c[s],h=c[s+1],f=c[s+2];r[n]=u|4278190080,r[n+1]=u>>>24|h<<8|4278190080,r[n+2]=h>>>16|f<<16|4278190080,r[n+3]=f>>>8|4278190080}for(let u=s*4,h=e+o;u<h;u+=3)r[n++]=t[u]|t[u+1]<<8|t[u+2]<<16|4278190080}else{for(;s<l-2;s+=3,n+=4){const u=c[s],h=c[s+1],f=c[s+2];r[n]=u|255,r[n+1]=u<<24|h>>>8|255,r[n+2]=h<<16|f>>>16|255,r[n+3]=f<<8|255}for(let u=s*4,h=e+o;u<h;u+=3)r[n++]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|255}return{srcPos:e+o,destPos:n}}function Y0e(t,e){if(oa.isLittleEndian)for(let r=0,n=t.length;r<n;r++)e[r]=t[r]*65793|4278190080;else for(let r=0,n=t.length;r<n;r++)e[r]=t[r]*16843008|255}const bN=2048,K0e=65537,wN=128;class ys{static#e=bN;static#t=oa.isImageDecoderSupported;constructor(e,r){this._imgData=e,this._isMask=r}static get canUseImageDecoder(){return Te(this,"canUseImageDecoder",this.#t?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(e,r){if(e<=this.#e&&r<=this.#e)return!1;const{MAX_DIM:n}=this;if(e>n||r>n)return!0;const i=e*r;if(this._hasMaxArea)return i>this.MAX_AREA;if(i<this.#e**2)return!1;if(this._areGoodDims(e,r))return this.#e=Math.max(this.#e,Math.floor(Math.sqrt(e*r))),!1;this.#e=this._guessMax(this.#e,n,wN,0);const a=this.MAX_AREA=this.#e**2;return i>a}static getReducePowerForJPX(e,r,n){const i=e*r,a=2**30/(n*4);if(!this.needsToBeResized(e,r))return i>a?Math.ceil(Math.log2(i/a)):0;const{MAX_DIM:s,MAX_AREA:o}=this,l=Math.max(e/s,r/s,Math.sqrt(i/Math.min(a,o)));return Math.ceil(Math.log2(l))}static get MAX_DIM(){return Te(this,"MAX_DIM",this._guessMax(bN,K0e,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,Te(this,"MAX_AREA",this._guessMax(this.#e,this.MAX_DIM,wN,0)**2)}static set MAX_AREA(e){e>=0&&(this._hasMaxArea=!0,Te(this,"MAX_AREA",e))}static setOptions({canvasMaxAreaInBytes:e=-1,isImageDecoderSupported:r=!1}){this._hasMaxArea||(this.MAX_AREA=e>>2),this.#t=r}static _areGoodDims(e,r){try{const n=new OffscreenCanvas(e,r),i=n.getContext("2d");i.fillRect(0,0,1,1);const a=i.getImageData(0,0,1,1).data[3];return n.width=n.height=1,a!==0}catch{return!1}}static _guessMax(e,r,n,i){for(;e+n+1<r;){const a=Math.floor((e+r)/2),s=i||a;this._areGoodDims(a,s)?e=a:r=a}return e}static async createImage(e,r=!1){return new ys(e,r)._createImage()}async _createImage(){const{_imgData:e}=this,{width:r,height:n}=e;if(r*n*4>iT){const y=this.#n();if(y)return y}const i=this._encodeBMP();let a,s;await ys.canUseImageDecoder?(a=new ImageDecoder({data:i,type:"image/bmp",preferAnimation:!1,transfer:[i.buffer]}),s=a.decode().catch(y=>(ee(`BMP image decoding failed: ${y}`),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"})))).finally(()=>{a.close()})):s=createImageBitmap(new Blob([i.buffer],{type:"image/bmp"}));const{MAX_AREA:o,MAX_DIM:l}=ys,c=Math.max(r/l,n/l,Math.sqrt(r*n/o)),u=Math.max(c,2),h=Math.round(10*(c+1.25))/10/u,f=Math.floor(Math.log2(h)),d=new Array(f+2).fill(2);d[0]=u,d.splice(-1,1,h/(1<<f));let p=r,g=n;const m=await s;let v=m.image||m;for(const y of d){const x=p,b=g;p=Math.floor(p/y)-1,g=Math.floor(g/y)-1;const w=new OffscreenCanvas(p,g);w.getContext("2d").drawImage(v,0,0,x,b,0,0,p,g),v.close(),v=w.transferToImageBitmap()}return e.data=null,e.bitmap=v,e.width=p,e.height=g,e}#n(){const{_imgData:e}=this,{data:r,width:n,height:i,kind:a}=e,s=n*i*4,o=Math.ceil(Math.log2(s/iT)),l=n>>o,c=i>>o;let u,h=i;try{u=new Uint8Array(s)}catch{let b=Math.floor(Math.log2(s+1));for(;;)try{u=new Uint8Array(2**b-1);break}catch{b-=1}h=Math.floor((2**b-1)/(n*4));const w=n*h*4;w<u.length&&(u=new Uint8Array(w))}const f=new Uint32Array(u.buffer),d=new Uint32Array(l*c);let p=0,g=0;const m=Math.ceil(i/h),v=i%h===0?i:i%h;for(let b=0;b<m;b++){const w=b<m-1?h:v;({srcPos:p}=Fq({kind:a,src:r,dest:f,width:n,height:w,inverseDecode:this._isMask,srcPos:p}));for(let _=0,S=w>>o;_<S;_++){const C=f.subarray((_<<o)*n);for(let T=0;T<l;T++)d[g++]=C[T<<o]}}if(ys.needsToBeResized(l,c))return e.data=d,e.width=l,e.height=c,e.kind=Ii.RGBA_32BPP,null;const y=new OffscreenCanvas(l,c);return y.getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(d.buffer),l,c),0,0),e.data=null,e.bitmap=y.transferToImageBitmap(),e.width=l,e.height=c,e}_encodeBMP(){const{width:e,height:r,kind:n}=this._imgData;let i=this._imgData.data,a,s=new Uint8Array(0),o=s,l=0;switch(n){case Ii.GRAYSCALE_1BPP:{a=1,s=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);const g=e+7>>3,m=g+3&-4;if(g!==m){const v=new Uint8Array(m*r);let y=0;for(let x=0,b=r*g;x<b;x+=g,y+=m)v.set(i.subarray(x,x+g),y);i=v}break}case Ii.RGB_24BPP:{if(a=24,e&3){const g=3*e,m=g+3&-4,v=m-g,y=new Uint8Array(m*r);let x=0;for(let b=0,w=r*g;b<w;b+=g){const _=i.subarray(b,b+g);for(let S=0;S<g;S+=3)y[x++]=_[S+2],y[x++]=_[S+1],y[x++]=_[S];x+=v}i=y}else for(let g=0,m=i.length;g<m;g+=3){const v=i[g];i[g]=i[g+2],i[g+2]=v}break}case Ii.RGBA_32BPP:a=32,l=3,o=new Uint8Array(68);const p=new DataView(o.buffer);oa.isLittleEndian?(p.setUint32(0,255,!0),p.setUint32(4,65280,!0),p.setUint32(8,16711680,!0),p.setUint32(12,4278190080,!0)):(p.setUint32(0,4278190080,!0),p.setUint32(4,16711680,!0),p.setUint32(8,65280,!0),p.setUint32(12,255,!0));break;default:throw new Error("invalid format")}let c=0;const u=40+o.length,h=14+u+s.length+i.length,f=new Uint8Array(h),d=new DataView(f.buffer);return d.setUint16(c,19778,!0),c+=2,d.setUint32(c,h,!0),c+=4,d.setUint32(c,0,!0),c+=4,d.setUint32(c,14+u+s.length,!0),c+=4,d.setUint32(c,u,!0),c+=4,d.setInt32(c,e,!0),c+=4,d.setInt32(c,-r,!0),c+=4,d.setUint16(c,1,!0),c+=2,d.setUint16(c,a,!0),c+=2,d.setUint32(c,l,!0),c+=4,d.setUint32(c,0,!0),c+=4,d.setInt32(c,0,!0),c+=4,d.setInt32(c,0,!0),c+=4,d.setUint32(c,s.length/4,!0),c+=4,d.setUint32(c,0,!0),c+=4,f.set(o,c),c+=o.length,f.set(s,c),c+=s.length,f.set(i,c),f}}const Z0e=new Uint8Array(0);class es extends Pt{constructor(e){if(super(),this._rawMinBufferLength=e||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=Z0e,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0}ensureBuffer(e){const r=this.buffer;if(e<=r.byteLength)return r;let n=this.minBufferLength;for(;n<e;)n*=2;const i=new Uint8Array(n);return i.set(r),this.buffer=i}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e,r=null){const n=this.pos;let i;if(e){for(this.ensureBuffer(n+e),i=n+e;!this.eof&&this.bufferLength<i;)this.readBlock(r);const a=this.bufferLength;i>a&&(i=a)}else{for(;!this.eof;)this.readBlock(r);i=this.bufferLength}return this.pos=i,this.buffer.subarray(n,i)}async getImageData(e,r){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,r):this.getBytes(e,r);const n=await this.stream.asyncGetBytes();return this.decodeImage(n,r)}reset(){this.pos=0}makeSubStream(e,r,n=null){if(r===void 0)for(;!this.eof;)this.readBlock();else{const i=e+r;for(;this.bufferLength<=i&&!this.eof;)this.readBlock()}return new ln(this.buffer,e,r,n)}getBaseStreams(){return this.stream?this.stream.getBaseStreams():null}clone(){for(;!this.eof;)this.readBlock();return new ln(this.buffer,this.start,this.end-this.start,this.dict.clone())}}class J0e extends es{constructor(e,r=null){e=e.filter(i=>i instanceof Pt);let n=0;for(const i of e)n+=i instanceof es?i._rawMinBufferLength:i.length;super(n),this.streams=e,this._onError=r}readBlock(){const e=this.streams;if(e.length===0){this.eof=!0;return}const r=e.shift();let n;try{n=r.getBytes()}catch(o){if(this._onError){this._onError(o,r.dict?.objId);return}throw o}const i=this.bufferLength,a=i+n.length;this.ensureBuffer(a).set(n,i),this.bufferLength=a}getBaseStreams(){const e=[];for(const r of this.streams){const n=r.getBaseStreams();n&&e.push(...n)}return e.length>0?e:null}}class pr{static parse({cs:e,xref:r,resources:n=null,pdfFunctionFactory:i,globalColorSpaceCache:a,localColorSpaceCache:s,asyncIfNotCached:o=!1}){const l={xref:r,resources:n,pdfFunctionFactory:i,globalColorSpaceCache:a,localColorSpaceCache:s};let c,u,h;if(e instanceof Ae){u=e;const f=a.getByRef(u)||s.getByRef(u);if(f)return f;e=r.fetch(e)}if(e instanceof xe){c=e.name;const f=s.getByName(c);if(f)return f}try{h=this.#t(e,l)}catch(f){if(o&&!(f instanceof tn))return Promise.reject(f);throw f}return(c||u)&&(s.set(c,u,h),u&&a.set(null,u,h)),o?Promise.resolve(h):h}static#e(e,r){const{globalColorSpaceCache:n}=r;let i;if(e instanceof Ae){i=e;const s=n.getByRef(i);if(s)return s}const a=this.#t(e,r);return i&&n.set(null,i,a),a}static#t(e,r){const{xref:n,resources:i,pdfFunctionFactory:a,globalColorSpaceCache:s}=r;if(e=n.fetchIfRef(e),e instanceof xe)switch(e.name){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"DeviceRGBA":return this.rgba;case"CMYK":case"DeviceCMYK":return this.cmyk;case"Pattern":return new xN(null);default:if(i instanceof re){const o=i.get("ColorSpace");if(o instanceof re){const l=o.get(e.name);if(l){if(l instanceof xe)return this.#t(l,r);e=l;break}}}return ee(`Unrecognized ColorSpace: ${e.name}`),this.gray}if(Array.isArray(e)){const o=n.fetchIfRef(e[0]).name;let l,c,u,h,f,d;switch(o){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":return l=n.fetchIfRef(e[1]),h=l.getArray("WhitePoint"),f=l.getArray("BlackPoint"),d=l.get("Gamma"),new H0e(h,f,d);case"CalRGB":l=n.fetchIfRef(e[1]),h=l.getArray("WhitePoint"),f=l.getArray("BlackPoint"),d=l.getArray("Gamma");const p=l.getArray("Matrix");return new da(h,f,d,p);case"ICCBased":const g=e[1]instanceof Ae;if(g){const C=s.getByRef(e[1]);if(C)return C}const m=n.fetchIfRef(e[1]),v=m.dict;if(c=v.get("N"),Su.isUsable)try{const C=new Su(m.getBytes(),"ICCBased",c);return g&&s.set(null,e[1],C),C}catch(C){if(C instanceof tn)throw C;ee(`ICCBased color space (${e[1]}): "${C}".`)}const y=v.getRaw("Alternate");if(y){const C=this.#e(y,r);if(C.numComps===c)return C;ee("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(c===1)return this.gray;if(c===3)return this.rgb;if(c===4)return this.cmyk;break;case"Pattern":return u=e[1]||null,u&&(u=this.#e(u,r)),new xN(u);case"I":case"Indexed":u=this.#e(e[1],r);const x=Li(n.fetchIfRef(e[2]),0,255),b=n.fetchIfRef(e[3]);return new z0e(u,x,b);case"Separation":case"DeviceN":const w=n.fetchIfRef(e[1]);c=Array.isArray(w)?w.length:1,u=this.#e(e[2],r);const _=a.create(e[3]);return new $0e(c,u,_);case"Lab":l=n.fetchIfRef(e[1]),h=l.getArray("WhitePoint"),f=l.getArray("BlackPoint");const S=l.getArray("Range");return new G0e(h,f,S);default:return ee(`Unimplemented ColorSpace object: ${o}`),this.gray}}return ee(`Unrecognized ColorSpace object: ${e}`),this.gray}static get gray(){return Te(this,"gray",new V0e)}static get rgb(){return Te(this,"rgb",new U0e)}static get rgba(){return Te(this,"rgba",new j0e)}static get cmyk(){if(tx.isUsable)try{return Te(this,"cmyk",new tx)}catch{ee("CMYK fallback: DeviceCMYK")}return Te(this,"cmyk",new Oq)}}class vo extends ss{constructor(e){super(e,"JpegError")}}class dT extends ss{constructor(e,r){super(e,"DNLMarkerError"),this.scanLines=r}}class $q extends ss{constructor(e){super(e,"EOIMarkerError")}}const xy=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),d2=4017,p2=799,g2=3406,m2=2276,v2=1567,y2=3784,gp=5793,x2=2896;function Q0e(t,e){let r=0,n,i,a=16;for(;a>0&&!t[a-1];)a--;const s=[{children:[],index:0}];let o=s[0],l;for(n=0;n<a;n++){for(i=0;i<t[n];i++){for(o=s.pop(),o.children[o.index]=e[r];o.index>0;)o=s.pop();for(o.index++,s.push(o);s.length<=n;)s.push(l={children:[],index:0}),o.children[o.index]=l.children,o=l;r++}n+1<a&&(s.push(l={children:[],index:0}),o.children[o.index]=l.children,o=l)}return s[0].children}function pT(t,e,r){return 64*((t.blocksPerLine+1)*e+r)}function epe(t,e,r,n,i,a,s,o,l,c=!1){const u=r.mcusPerLine,h=r.progressive,f=e;let d=0,p=0;function g(){if(p>0)return p--,d>>p&1;if(d=t[e++],d===255){const W=t[e++];if(W){if(W===220&&c){e+=2;const X=Zt(t,e);if(e+=2,X>0&&X!==r.scanLines)throw new dT("Found DNL marker (0xFFDC) while parsing scan data",X)}else if(W===217){if(c){const X=k*(r.precision===8?8:0);if(X>0&&Math.round(r.scanLines/X)>=5)throw new dT("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",X)}throw new $q("Found EOI marker (0xFFD9) while parsing scan data")}throw new vo(`unexpected marker ${(d<<8|W).toString(16)}`)}}return p=7,d>>>7}function m(W){let X=W;for(;;){switch(X=X[g()],typeof X){case"number":return X;case"object":continue}throw new vo("invalid huffman sequence")}}function v(W){let X=0;for(;W>0;)X=X<<1|g(),W--;return X}function y(W){if(W===1)return g()===1?1:-1;const X=v(W);return X>=1<<W-1?X:X+(-1<<W)+1}function x(W,X){const K=m(W.huffmanTableDC),G=K===0?0:y(K);W.blockData[X]=W.pred+=G;let H=1;for(;H<64;){const Y=m(W.huffmanTableAC),J=Y&15,ie=Y>>4;if(J===0){if(ie<15)break;H+=16;continue}H+=ie;const me=xy[H];W.blockData[X+me]=y(J),H++}}function b(W,X){const K=m(W.huffmanTableDC),G=K===0?0:y(K)<<l;W.blockData[X]=W.pred+=G}function w(W,X){W.blockData[X]|=g()<<l}let _=0;function S(W,X){if(_>0){_--;return}let K=a;const G=s;for(;K<=G;){const H=m(W.huffmanTableAC),Y=H&15,J=H>>4;if(Y===0){if(J<15){_=v(J)+(1<<J)-1;break}K+=16;continue}K+=J;const ie=xy[K];W.blockData[X+ie]=y(Y)*(1<<l),K++}}let C=0,T;function A(W,X){let K=a;const G=s;let H=0,Y,J;for(;K<=G;){const ie=X+xy[K],me=W.blockData[ie]<0?-1:1;switch(C){case 0:if(J=m(W.huffmanTableAC),Y=J&15,H=J>>4,Y===0)H<15?(_=v(H)+(1<<H),C=4):(H=16,C=1);else{if(Y!==1)throw new vo("invalid ACn encoding");T=y(Y),C=H?2:3}continue;case 1:case 2:W.blockData[ie]?W.blockData[ie]+=me*(g()<<l):(H--,H===0&&(C=C===2?3:0));break;case 3:W.blockData[ie]?W.blockData[ie]+=me*(g()<<l):(W.blockData[ie]=T<<l,C=0);break;case 4:W.blockData[ie]&&(W.blockData[ie]+=me*(g()<<l));break}K++}C===4&&(_--,_===0&&(C=0))}let k=0;function I(W,X,K,G,H){const Y=K/u|0,J=K%u;k=Y*W.v+G;const ie=J*W.h+H,me=pT(W,k,ie);X(W,me)}function E(W,X,K){k=K/W.blocksPerLine|0;const G=K%W.blocksPerLine,H=pT(W,k,G);X(W,H)}const M=n.length;let R,D,L,P,O,$;h?a===0?$=o===0?b:w:$=o===0?S:A:$=x;let N=0,U;const j=M===1?n[0].blocksPerLine*n[0].blocksPerColumn:u*r.mcusPerColumn;let B,q;for(;N<=j;){const W=i?Math.min(j-N,i):j;if(W>0){for(D=0;D<M;D++)n[D].pred=0;if(_=0,M===1)for(R=n[0],O=0;O<W;O++)E(R,$,N),N++;else for(O=0;O<W;O++){for(D=0;D<M;D++)for(R=n[D],B=R.h,q=R.v,L=0;L<q;L++)for(P=0;P<B;P++)I(R,$,N,L,P);N++}}if(p=0,U=X3(t,e),!U)break;if(U.invalid){const X=W>0?"unexpected":"excessive";ee(`decodeScan - ${X} MCU data, current marker is: ${U.invalid}`),e=U.offset}if(U.marker>=65488&&U.marker<=65495)e+=2;else break}return e-f}function tpe(t,e,r){const n=t.quantizationTable,i=t.blockData;let a,s,o,l,c,u,h,f,d,p,g,m,v,y,x,b,w;if(!n)throw new vo("missing required Quantization Table.");for(let _=0;_<64;_+=8){if(d=i[e+_],p=i[e+_+1],g=i[e+_+2],m=i[e+_+3],v=i[e+_+4],y=i[e+_+5],x=i[e+_+6],b=i[e+_+7],d*=n[_],(p|g|m|v|y|x|b)===0){w=gp*d+512>>10,r[_]=w,r[_+1]=w,r[_+2]=w,r[_+3]=w,r[_+4]=w,r[_+5]=w,r[_+6]=w,r[_+7]=w;continue}p*=n[_+1],g*=n[_+2],m*=n[_+3],v*=n[_+4],y*=n[_+5],x*=n[_+6],b*=n[_+7],a=gp*d+128>>8,s=gp*v+128>>8,o=g,l=x,c=x2*(p-b)+128>>8,f=x2*(p+b)+128>>8,u=m<<4,h=y<<4,a=a+s+1>>1,s=a-s,w=o*y2+l*v2+128>>8,o=o*v2-l*y2+128>>8,l=w,c=c+h+1>>1,h=c-h,f=f+u+1>>1,u=f-u,a=a+l+1>>1,l=a-l,s=s+o+1>>1,o=s-o,w=c*m2+f*g2+2048>>12,c=c*g2-f*m2+2048>>12,f=w,w=u*p2+h*d2+2048>>12,u=u*d2-h*p2+2048>>12,h=w,r[_]=a+f,r[_+7]=a-f,r[_+1]=s+h,r[_+6]=s-h,r[_+2]=o+u,r[_+5]=o-u,r[_+3]=l+c,r[_+4]=l-c}for(let _=0;_<8;++_){if(d=r[_],p=r[_+8],g=r[_+16],m=r[_+24],v=r[_+32],y=r[_+40],x=r[_+48],b=r[_+56],(p|g|m|v|y|x|b)===0){w=gp*d+8192>>14,w<-2040?w=0:w>=2024?w=255:w=w+2056>>4,i[e+_]=w,i[e+_+8]=w,i[e+_+16]=w,i[e+_+24]=w,i[e+_+32]=w,i[e+_+40]=w,i[e+_+48]=w,i[e+_+56]=w;continue}a=gp*d+2048>>12,s=gp*v+2048>>12,o=g,l=x,c=x2*(p-b)+2048>>12,f=x2*(p+b)+2048>>12,u=m,h=y,a=(a+s+1>>1)+4112,s=a-s,w=o*y2+l*v2+2048>>12,o=o*v2-l*y2+2048>>12,l=w,c=c+h+1>>1,h=c-h,f=f+u+1>>1,u=f-u,a=a+l+1>>1,l=a-l,s=s+o+1>>1,o=s-o,w=c*m2+f*g2+2048>>12,c=c*g2-f*m2+2048>>12,f=w,w=u*p2+h*d2+2048>>12,u=u*d2-h*p2+2048>>12,h=w,d=a+f,b=a-f,p=s+h,x=s-h,g=o+u,y=o-u,m=l+c,v=l-c,d<16?d=0:d>=4080?d=255:d>>=4,p<16?p=0:p>=4080?p=255:p>>=4,g<16?g=0:g>=4080?g=255:g>>=4,m<16?m=0:m>=4080?m=255:m>>=4,v<16?v=0:v>=4080?v=255:v>>=4,y<16?y=0:y>=4080?y=255:y>>=4,x<16?x=0:x>=4080?x=255:x>>=4,b<16?b=0:b>=4080?b=255:b>>=4,i[e+_]=d,i[e+_+8]=p,i[e+_+16]=g,i[e+_+24]=m,i[e+_+32]=v,i[e+_+40]=y,i[e+_+48]=x,i[e+_+56]=b}}function rpe(t,e){const r=e.blocksPerLine,n=e.blocksPerColumn,i=new Int16Array(64);for(let a=0;a<n;a++)for(let s=0;s<r;s++){const o=pT(e,a,s);tpe(e,o,i)}return e.blockData}function X3(t,e,r=e){const n=t.length-1;let i=r<e?r:e;if(e>=n)return null;const a=Zt(t,e);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:e};let s=Zt(t,i);for(;!(s>=65472&&s<=65534);){if(++i>=n)return null;s=Zt(t,i)}return{invalid:a.toString(16),marker:s,offset:i}}function npe(t){const e=Math.ceil(t.samplesPerLine/8/t.maxH),r=Math.ceil(t.scanLines/8/t.maxV);for(const n of t.components){const i=Math.ceil(Math.ceil(t.samplesPerLine/8)*n.h/t.maxH),a=Math.ceil(Math.ceil(t.scanLines/8)*n.v/t.maxV),s=e*n.h,l=64*(r*n.v)*(s+1);n.blockData=new Int16Array(l),n.blocksPerLine=i,n.blocksPerColumn=a}t.mcusPerLine=e,t.mcusPerColumn=r}function _N(t,e){const r=Zt(t,e);e+=2;let n=e+r-2;const i=X3(t,n,e);i?.invalid&&(ee("readDataBlock - incorrect length, current marker is: "+i.invalid),n=i.offset);const a=t.subarray(e,n);return{appData:a,oldOffset:e,newOffset:e+a.length}}function ipe(t,e){const r=Zt(t,e);e+=2;const n=e+r-2,i=X3(t,n,e);return i?.invalid?i.offset:n}class SN{constructor({decodeTransform:e=null,colorTransform:r=-1}={}){this._decodeTransform=e,this._colorTransform=r}static canUseImageDecoder(e,r=-1){let n=null,i=0,a=null,s=Zt(e,i);if(i+=2,s!==65496)throw new vo("SOI not found");s=Zt(e,i),i+=2;e:for(;s!==65497;){switch(s){case 65505:const{appData:o,oldOffset:l,newOffset:c}=_N(e,i);if(i=c,o[0]===69&&o[1]===120&&o[2]===105&&o[3]===102&&o[4]===0&&o[5]===0){if(n)throw new vo("Duplicate EXIF-blocks found.");n={exifStart:l+6,exifEnd:c}}s=Zt(e,i),i+=2;continue;case 65472:case 65473:case 65474:a=e[i+7];break e;case 65535:e[i]!==255&&i--;break}i=ipe(e,i),s=Zt(e,i),i+=2}return a===4||a===3&&r===0?null:n||{}}parse(e,{dnlScanLines:r=null}={}){let n=0,i=null,a=null,s,o,l=0;const c=[],u=[],h=[];let f=Zt(e,n);if(n+=2,f!==65496)throw new vo("SOI not found");f=Zt(e,n),n+=2;e:for(;f!==65497;){let d,p,g;switch(f){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const{appData:m,newOffset:v}=_N(e,n);n=v,f===65504&&m[0]===74&&m[1]===70&&m[2]===73&&m[3]===70&&m[4]===0&&(i={version:{major:m[5],minor:m[6]},densityUnits:m[7],xDensity:m[8]<<8|m[9],yDensity:m[10]<<8|m[11],thumbWidth:m[12],thumbHeight:m[13],thumbData:m.subarray(14,14+3*m[12]*m[13])}),f===65518&&m[0]===65&&m[1]===100&&m[2]===111&&m[3]===98&&m[4]===101&&(a={version:m[5]<<8|m[6],flags0:m[7]<<8|m[8],flags1:m[9]<<8|m[10],transformCode:m[11]});break;case 65499:const y=Zt(e,n);n+=2;const x=y+n-2;let b;for(;n<x;){const L=e[n++],P=new Uint16Array(64);if(L>>4===0)for(p=0;p<64;p++)b=xy[p],P[b]=e[n++];else if(L>>4===1)for(p=0;p<64;p++)b=xy[p],P[b]=Zt(e,n),n+=2;else throw new vo("DQT - invalid table spec");c[L&15]=P}break;case 65472:case 65473:case 65474:if(s)throw new vo("Only single frame JPEGs supported");n+=2,s={},s.extended=f===65473,s.progressive=f===65474,s.precision=e[n++];const w=Zt(e,n);n+=2,s.scanLines=r||w,s.samplesPerLine=Zt(e,n),n+=2,s.components=[],s.componentIds={};const _=e[n++];let S=0,C=0;for(d=0;d<_;d++){const L=e[n],P=e[n+1]>>4,O=e[n+1]&15;S<P&&(S=P),C<O&&(C=O);const $=e[n+2];g=s.components.push({h:P,v:O,quantizationId:$,quantizationTable:null}),s.componentIds[L]=g-1,n+=3}s.maxH=S,s.maxV=C,npe(s);break;case 65476:const T=Zt(e,n);for(n+=2,d=2;d<T;){const L=e[n++],P=new Uint8Array(16);let O=0;for(p=0;p<16;p++,n++)O+=P[p]=e[n];const $=new Uint8Array(O);for(p=0;p<O;p++,n++)$[p]=e[n];d+=17+O,(L>>4===0?h:u)[L&15]=Q0e(P,$)}break;case 65501:n+=2,o=Zt(e,n),n+=2;break;case 65498:const A=++l===1&&!r;n+=2;const k=e[n++],I=[];for(d=0;d<k;d++){const L=e[n++],P=s.componentIds[L],O=s.components[P];O.index=L;const $=e[n++];O.huffmanTableDC=h[$>>4],O.huffmanTableAC=u[$&15],I.push(O)}const E=e[n++],M=e[n++],R=e[n++];try{const L=epe(e,n,s,I,o,E,M,R>>4,R&15,A);n+=L}catch(L){if(L instanceof dT)return ee(`${L.message} -- attempting to re-parse the JPEG image.`),this.parse(e,{dnlScanLines:L.scanLines});if(L instanceof $q){ee(`${L.message} -- ignoring the rest of the image data.`);break e}throw L}break;case 65500:n+=4;break;case 65535:e[n]!==255&&n--;break;default:const D=X3(e,n-2,n-3);if(D?.invalid){ee("JpegImage.parse - unexpected data, current marker is: "+D.invalid),n=D.offset;break}if(!D||n>=e.length-1){ee("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new vo("JpegImage.parse - unknown marker: "+f.toString(16))}f=Zt(e,n),n+=2}if(!s)throw new vo("JpegImage.parse - no frame data found.");this.width=s.samplesPerLine,this.height=s.scanLines,this.jfif=i,this.adobe=a,this.components=[];for(const d of s.components){const p=c[d.quantizationId];p&&(d.quantizationTable=p),this.components.push({index:d.index,output:rpe(s,d),scaleX:d.h/s.maxH,scaleY:d.v/s.maxV,blocksPerLine:d.blocksPerLine,blocksPerColumn:d.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,r,n=!1){const i=this.width/e,a=this.height/r;let s,o,l,c,u,h,f,d,p,g,m=0,v;const y=this.components.length,x=e*r*y,b=new Uint8ClampedArray(x),w=new Uint32Array(e),_=4294967288;let S;for(f=0;f<y;f++){if(s=this.components[f],o=s.scaleX*i,l=s.scaleY*a,m=f,v=s.output,c=s.blocksPerLine+1<<3,o!==S){for(u=0;u<e;u++)d=0|u*o,w[u]=(d&_)<<3|d&7;S=o}for(h=0;h<r;h++)for(d=0|h*l,g=c*(d&_)|(d&7)<<3,u=0;u<e;u++)b[m]=v[g+w[u]],m+=y}let C=this._decodeTransform;if(!n&&y===4&&!C&&(C=new Int32Array([-256,255,-256,255,-256,255,-256,255])),C)for(f=0;f<x;)for(d=0,p=0;d<y;d++,f++,p+=2)b[f]=(b[f]*C[p]>>8)+C[p+1];return b}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this._colorTransform===0?!1:!(this.components[0].index===82&&this.components[1].index===71&&this.components[2].index===66):this._colorTransform===1}_convertYccToRgb(e){let r,n,i;for(let a=0,s=e.length;a<s;a+=3)r=e[a],n=e[a+1],i=e[a+2],e[a]=r-179.456+1.402*i,e[a+1]=r+135.459-.344*n-.714*i,e[a+2]=r-226.816+1.772*n;return e}_convertYccToRgba(e,r){for(let n=0,i=0,a=e.length;n<a;n+=3,i+=4){const s=e[n],o=e[n+1],l=e[n+2];r[i]=s-179.456+1.402*l,r[i+1]=s+135.459-.344*o-.714*l,r[i+2]=s-226.816+1.772*o,r[i+3]=255}return r}_convertYcckToRgb(e){return this._convertYcckToCmyk(e),this._convertCmykToRgb(e)}_convertYcckToRgba(e){return this._convertYcckToCmyk(e),this._convertCmykToRgba(e)}_convertYcckToCmyk(e){let r,n,i;for(let a=0,s=e.length;a<s;a+=4)r=e[a],n=e[a+1],i=e[a+2],e[a]=434.456-r-1.402*i,e[a+1]=119.541-r+.344*n+.714*i,e[a+2]=481.816-r-1.772*n;return e}_convertCmykToRgb(e){const r=e.length/4;return pr.cmyk.getRgbBuffer(e,0,r,e,0,8,0),e.subarray(0,r*3)}_convertCmykToRgba(e){if(pr.cmyk.getRgbBuffer(e,0,e.length/4,e,0,8,1),pr.cmyk instanceof Oq)for(let r=3,n=e.length;r<n;r+=4)e[r]=255;return e}getData({width:e,height:r,forceRGBA:n=!1,forceRGB:i=!1,isSourcePDF:a=!1}){if(this.numComponents>4)throw new vo("Unsupported color mode");const s=this._getLinearizedBlockData(e,r,a);if(this.numComponents===1&&(n||i)){const o=s.length*(n?4:3),l=new Uint8ClampedArray(o);let c=0;if(n)Y0e(s,new Uint32Array(l.buffer));else for(const u of s)l[c++]=u,l[c++]=u,l[c++]=u;return l}else if(this.numComponents===3&&this._isColorConversionNeeded){if(n){const o=new Uint8ClampedArray(s.length/3*4);return this._convertYccToRgba(s,o)}return this._convertYccToRgb(s)}else if(this.numComponents===4){if(this._isColorConversionNeeded)return n?this._convertYcckToRgba(s):i?this._convertYcckToRgb(s):this._convertYcckToCmyk(s);if(n)return this._convertCmykToRgba(s);if(i)return this._convertCmykToRgb(s)}return s}}class jm extends es{static#e=oa.isImageDecoderSupported;constructor(e,r,n){super(r),this.stream=e,this.dict=e.dict,this.maybeLength=r,this.params=n}static get canUseImageDecoder(){return Te(this,"canUseImageDecoder",this.#e?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:e=!1}){this.#e=e}get bytes(){return Te(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}get jpegOptions(){const e={decodeTransform:void 0,colorTransform:void 0},r=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(r)){const n=this.dict.get("BPC","BitsPerComponent")||8,i=r.length,a=new Int32Array(i);let s=!1;const o=(1<<n)-1;for(let l=0;l<i;l+=2)a[l]=(r[l+1]-r[l])*256|0,a[l+1]=r[l]*o|0,(a[l]!==256||a[l+1]!==0)&&(s=!0);s&&(e.decodeTransform=a)}if(this.params instanceof re){const n=this.params.get("ColorTransform");Number.isInteger(n)&&(e.colorTransform=n)}return Te(this,"jpegOptions",e)}#t(e){for(let r=0,n=e.length-1;r<n;r++)if(e[r]===255&&e[r+1]===216){r>0&&(e=e.subarray(r));break}return e}decodeImage(e){if(this.eof)return this.buffer;e=this.#t(e||this.bytes);const r=new SN(this.jpegOptions);r.parse(e);const n=r.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});return this.buffer=n,this.bufferLength=n.length,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await jm.canUseImageDecoder)return null;const e=this.jpegOptions;if(e.decodeTransform)return null;let r;try{const n=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!n)return null;let i=this.#t(n);const a=SN.canUseImageDecoder(i,e.colorTransform);return a?(a.exifStart&&(i=i.slice(),i.fill(0,a.exifStart,a.exifEnd)),r=new ImageDecoder({data:i,type:"image/jpeg",preferAnimation:!1}),(await r.decode()).image):null}catch(n){return ee(`getTransferableImage - failed: "${n}".`),null}finally{r?.close()}}}async function ape(t={}){var e,r=t,n="./this.program",i=(Ce,De)=>{throw De},a=typeof document>"u"?require("url").pathToFileURL(__filename).href:Ig&&Ig.tagName.toUpperCase()==="SCRIPT"&&Ig.src||new URL("index-BD02XooM.cjs",document.baseURI).href,s="";try{s=new URL(".",a).href}catch{}var o=console.log.bind(console),l=console.error.bind(console),c=!1,u,h,f,d,p,g,m,v,y=!1;function x(){var Ce=d.buffer;p=new Int8Array(Ce),g=new Uint8Array(Ce),m=new Int32Array(Ce),v=new Uint32Array(Ce),new BigInt64Array(Ce),new BigUint64Array(Ce)}function b(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)R(r.preRun.shift());k(M)}function w(){y=!0,Qs.s()}function _(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)E(r.postRun.shift());k(I)}function S(Ce){r.onAbort?.(Ce),Ce="Aborted("+Ce+")",l(Ce),c=!0,Ce+=". Build with -sASSERTIONS for more info.";var De=new WebAssembly.RuntimeError(Ce);throw f?.(De),De}function C(){return{a:zc}}async function T(){function Ce(Re,xt){return Qs=Re.exports,d=Qs.r,x(),$c(Qs),Qs}var De=C();return new Promise((Re,xt)=>{r.instantiateWasm(De,(Vt,Er)=>{Re(Ce(Vt))})})}class A{name="ExitStatus";constructor(De){this.message=`Program terminated with exit(${De})`,this.status=De}}var k=Ce=>{for(;Ce.length>0;)Ce.shift()(r)},I=[],E=Ce=>I.push(Ce),M=[],R=Ce=>M.push(Ce),D=!0,L=()=>S(""),P=0,O=()=>{D=!1,P=0},$={},N=Ce=>{if(Ce instanceof A||Ce=="unwind")return u;i(1,Ce)},U=()=>D||P>0,j=Ce=>{u=Ce,U()||(r.onExit?.(Ce),c=!0),i(Ce,new A(Ce))},B=(Ce,De)=>{u=Ce,j(Ce)},q=B,W=()=>{if(!U())try{q(u)}catch(Ce){N(Ce)}},X=Ce=>{if(!c)try{Ce(),W()}catch(De){N(De)}},K=()=>performance.now(),G=(Ce,De)=>{if($[Ce]&&(clearTimeout($[Ce].id),delete $[Ce]),!De)return 0;var Re=setTimeout(()=>{delete $[Ce],X(()=>Tf(Ce,K()))},De);return $[Ce]={id:Re,timeout_ms:De},0};function H(Ce,De){Ce>>=2;const Re=r.imageData=new Uint8ClampedArray(De),xt=m.subarray(Ce,Ce+De);Re.set(xt)}function Y(Ce,De,Re,xt){Ce>>=2,De>>=2,Re>>=2;const Vt=r.imageData=new Uint8ClampedArray(xt*3),Er=m.subarray(Ce,Ce+xt),or=m.subarray(De,De+xt),Wr=m.subarray(Re,Re+xt);for(let Fr=0;Fr<xt;Fr++)Vt[3*Fr]=Er[Fr],Vt[3*Fr+1]=or[Fr],Vt[3*Fr+2]=Wr[Fr]}function J(Ce,De,Re,xt,Vt){Ce>>=2,De>>=2,Re>>=2,xt>>=2;const Er=r.imageData=new Uint8ClampedArray(Vt*4),or=m.subarray(Ce,Ce+Vt),Wr=m.subarray(De,De+Vt),Fr=m.subarray(Re,Re+Vt),sp=m.subarray(xt,xt+Vt);for(let Rn=0;Rn<Vt;Rn++)Er[4*Rn]=or[Rn],Er[4*Rn+1]=Wr[Rn],Er[4*Rn+2]=Fr[Rn],Er[4*Rn+3]=sp[Rn]}var ie=()=>2147483648,me=(Ce,De)=>Math.ceil(Ce/De)*De,oe=Ce=>{var De=d.buffer.byteLength,Re=(Ce-De+65535)/65536|0;try{return d.grow(Re),x(),1}catch{}},ne=Ce=>{var De=g.length;Ce>>>=0;var Re=ie();if(Ce>Re)return!1;for(var xt=1;xt<=4;xt*=2){var Vt=De*(1+.2/xt);Vt=Math.min(Vt,Ce+100663296);var Er=Math.min(Re,me(Math.max(Ce,Vt),65536)),or=oe(Er);if(or)return!0}return!1},de={},ve=()=>n||"./this.program",Ne=()=>{if(!Ne.strings){var Ce=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",De={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:Ce,_:ve()};for(var Re in de)de[Re]===void 0?delete De[Re]:De[Re]=de[Re];var xt=[];for(var Re in De)xt.push(`${Re}=${De[Re]}`);Ne.strings=xt}return Ne.strings},ke=(Ce,De,Re,xt)=>{if(!(xt>0))return 0;for(var Vt=Re,Er=Re+xt-1,or=0;or<Ce.length;++or){var Wr=Ce.codePointAt(or);if(Wr<=127){if(Re>=Er)break;De[Re++]=Wr}else if(Wr<=2047){if(Re+1>=Er)break;De[Re++]=192|Wr>>6,De[Re++]=128|Wr&63}else if(Wr<=65535){if(Re+2>=Er)break;De[Re++]=224|Wr>>12,De[Re++]=128|Wr>>6&63,De[Re++]=128|Wr&63}else{if(Re+3>=Er)break;De[Re++]=240|Wr>>18,De[Re++]=128|Wr>>12&63,De[Re++]=128|Wr>>6&63,De[Re++]=128|Wr&63,or++}}return De[Re]=0,Re-Vt},Le=(Ce,De,Re)=>ke(Ce,g,De,Re),$e=(Ce,De)=>{var Re=0,xt=0;for(var Vt of Ne()){var Er=De+Re;v[Ce+xt>>2]=Er,Re+=Le(Vt,Er,1/0)+1,xt+=4}return 0},Ee=Ce=>{for(var De=0,Re=0;Re<Ce.length;++Re){var xt=Ce.charCodeAt(Re);xt<=127?De++:xt<=2047?De+=2:xt>=55296&&xt<=57343?(De+=4,++Re):De+=3}return De},pe=(Ce,De)=>{var Re=Ne();v[Ce>>2]=Re.length;var xt=0;for(var Vt of Re)xt+=Ee(Vt)+1;return v[De>>2]=xt,0};function Ve(Ce,De,Re,xt){return 70}var qe=[null,[],[]],tt=typeof TextDecoder<"u"?new TextDecoder:void 0,_t=(Ce,De,Re,xt)=>{for(var Vt=De+Re;Ce[De]&&!(De>=Vt);)++De;return De},Ot=(Ce,De=0,Re,xt)=>{var Vt=_t(Ce,De,Re);if(Vt-De>16&&Ce.buffer&&tt)return tt.decode(Ce.subarray(De,Vt));for(var Er="";De<Vt;){var or=Ce[De++];if(!(or&128)){Er+=String.fromCharCode(or);continue}var Wr=Ce[De++]&63;if((or&224)==192){Er+=String.fromCharCode((or&31)<<6|Wr);continue}var Fr=Ce[De++]&63;if((or&240)==224?or=(or&15)<<12|Wr<<6|Fr:or=(or&7)<<18|Wr<<12|Fr<<6|Ce[De++]&63,or<65536)Er+=String.fromCharCode(or);else{var sp=or-65536;Er+=String.fromCharCode(55296|sp>>10,56320|sp&1023)}}return Er},Ea=(Ce,De)=>{var Re=qe[Ce];De===0||De===10?((Ce===1?o:l)(Ot(Re)),Re.length=0):Re.push(De)},xr=(Ce,De,Re)=>Ce?Ot(g,Ce,De):"",Js=(Ce,De,Re,xt)=>{for(var Vt=0,Er=0;Er<Re;Er++){var or=v[De>>2],Wr=v[De+4>>2];De+=8;for(var Fr=0;Fr<Wr;Fr++)Ea(Ce,g[or+Fr]);Vt+=Wr}return v[xt>>2]=Vt,0};function hn(Ce,De){Ce>>=2;const Re=r.imageData=new Uint8ClampedArray(De*4),xt=m.subarray(Ce,Ce+De);for(let Vt=0;Vt<De;Vt++)Re[4*Vt]=Re[4*Vt+1]=Re[4*Vt+2]=xt[Vt],Re[4*Vt+3]=255}function _i(Ce,De,Re){Ce>>=2,De>>=2;const xt=r.imageData=new Uint8ClampedArray(Re*4),Vt=m.subarray(Ce,Ce+Re),Er=m.subarray(De,De+Re);for(let or=0;or<Re;or++)xt[4*or]=xt[4*or+1]=xt[4*or+2]=Vt[or],xt[4*or+3]=Er[or]}function Si(Ce){const De=xr(Ce);(r.warn||console.warn)(`OpenJPEG: ${De}`)}function Al(Ce,De,Re,xt){Ce>>=2,De>>=2,Re>>=2;const Vt=r.imageData=new Uint8ClampedArray(xt*4),Er=m.subarray(Ce,Ce+xt),or=m.subarray(De,De+xt),Wr=m.subarray(Re,Re+xt);for(let Fr=0;Fr<xt;Fr++)Vt[4*Fr]=Er[Fr],Vt[4*Fr+1]=or[Fr],Vt[4*Fr+2]=Wr[Fr],Vt[4*Fr+3]=255}function eh(Ce){const De=xr(Ce);r.errorMessages?r.errorMessages+=`
15
+ `.trim(),x={...r&&{maxWidth:r},...i&&{minWidth:i},...n&&{maxHeight:n},...a&&{minHeight:a}},b=u?`${u} ${y}`:y;return g?V.jsxs(Po,{children:[g&&s&&V.jsx("div",{ref:p,className:`${dp["smp-overlay-panel-backdrop"]} ${m?dp["smp-backdrop-closing"]:""}`,role:"button",tabIndex:o?0:-1,"aria-label":"Close overlay",onClick:()=>{o&&l&&l()},onKeyDown:w=>{o&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),l&&l())}}),V.jsx("dialog",{ref:d,className:b,onClose:l,style:x,open:v,children:c})]}):null},Ufe=t=>{const e=t.trim();return/^(?:(?:[a-z][a-z0-9+.-]*):\/\/[^\s]+|mailto:[^\s@]+@[^\s@]+\.[^\s@]+|tel:\+?[0-9()\-\s]+)$/i.test(e)},nN=t=>{const e=t.split(";");return{t:e[0]||"",p:e[1]||"",k:e[2]||""}},jfe=t=>t.match(/^(?:<(\w+)(?:\s[^>]*)?>\s*(?:<br\s*\/?>)?\s*<\/\1>\s*)+$/g)?"":t.replaceAll("&nbsp;"," "),Hfe=t=>{const e=t.import("blots/inline");class r extends e{static blotName="smeupLink";static tagName="a";static create(i){const a=super.create();return a.setAttribute("data-args",i.dataArgs),a.setAttribute("data-type",i.dataType),a.classList.add("smp-smeup-link",`smp-smeup-link-${i.dataType}`),a}static formats(i){const a=i.getAttribute("data-args"),s=i.getAttribute("data-type");return a&&s?{dataArgs:a,dataType:s}:null}}return r},Gfe=({bindValue:t,helper:e,label:r,error:n,isEditable:i=!0,style:a,onChange:s,onEnter:o,onBlur:l,onObjectProtocol:c})=>{const u=Q.useRef(null),h=Q.useRef(null),f=Q.useRef(null),d=Q.useRef(t),p=Q.useRef(s),g=Q.useRef(l),m=Q.useId(),{translate:v}=Ta();fq(u,(G,H)=>{c?.(G,H)});const[y,x]=Q.useState({code:"text",description:v(n8.text)}),[b,w]=Q.useState(null),[_,S]=Q.useState({bold:!1,italic:!1,underline:!1,codeBlock:!1,listOrdered:!1,listBullet:!1,link:!1,smeupLink:!1}),[C,T]=Q.useState({open:!1,link:""}),[A,k]=Q.useState({open:!1,tabIndex:0,t:"",p:"",k:"",fun:""}),I={smpTextEditorWrapper:`${rh["smp-text-editor-wrapper"]} ${n?rh["smp-text-editor-danger"]:""}`,smpTextEditorContent:`${rh["smp-text-editor-content"]} `,smpTextEditorToolbar:`${rh["smp-text-editor-toolbar"]}`,smpTextEditorContentEditable:`${rh["smp-text-editor-content-editable"]}`,smpTextEditorSeparator:`${rh["smp-text-editor-separator"]}`,smpTextEditorLinkCommandOverlay:`${rh["smp-text-editor-link-command-overlay"]}`,smpTextEditorSmeupLinkCommandOverlay:`${rh["smp-text-editor-smeup-link-command-overlay"]}`},E=[{command:"bold",icon:"format_bold"},{command:"italic",icon:"format_italic"},{command:"underline",icon:"format-underline"}],M=[{command:"listBullet",icon:"format_list_bulleted"},{command:"listOrdered",icon:"format_list_numbered"},{command:"link",icon:"insert_link"},{command:"codeBlock",icon:"code"}],R=[{command:"smeupLink",icon:"smeup"}];Q.useLayoutEffect(()=>{p.current=s,g.current=l,d.current=t});const D=(G,H,Y)=>{let J=H.index,ie=H.index+H.length;for(;J>0&&G.getFormat({index:J-1,length:1})[Y];)J--;const me=G.getText({index:0,length:Number.MAX_SAFE_INTEGER}).length;for(;ie<me&&G.getFormat({index:ie,length:1})[Y];)ie++;return{index:J,length:ie-J}},L=G=>{const H=f.current;if(!H)return;let Y=H.getSelection();if(!Y&&b&&(Y=b,H.setSelection(Y,"silent")),Y){const J=H.getFormat(Y);H.format(G,!J[G]),H.focus()}},P=G=>{const H=f.current;if(!H)return;let Y=H.getSelection();if(!Y&&b&&(Y=b,H.setSelection(Y,"silent")),Y){const ie=H.getFormat(Y).list;H.format("list",ie===G?!1:G),H.focus()}},O=()=>{const G=f.current;if(!G)return;let H=G.getSelection();if(!H&&b&&(H=b,G.setSelection(H,"silent")),H){const Y=G.getFormat(H);if(Y.link){const J=D(G,H,"link");G.setSelection(J),T(ie=>({...ie,link:typeof Y.link=="string"?Y.link:"",open:!0}))}else{const J=G.getSelection(),ie=J&&J.length>0?G.getText(J):"";if(ie&&Ufe(ie)){G.format("link",ie.trim());return}T(me=>({...me,open:!0}))}G.focus()}},$=G=>{const H=f.current;H&&(H.format("link",G),H.focus(),T(Y=>({...Y,open:!1,link:""})))},N=()=>{const G=f.current;G&&(G.format("link",!1),T(H=>({...H,open:!1,link:""})))},U=()=>{const G=f.current;if(!G)return;let H=G.getSelection();if(!H&&b&&(H=b,G.setSelection(H,"silent")),H){const Y=G.getFormat(H);if(Y.smeupLink){const J=D(G,H,"smeupLink");G.setSelection(J);const ie=Y.smeupLink;if(ie.dataType==="fun")k(me=>({...me,open:!0,tabIndex:1,t:"",p:"",k:"",fun:ie.dataArgs||""}));else{const me=nN(ie.dataArgs);k(oe=>({...oe,open:!0,tabIndex:0,t:me.t,p:me.p,k:me.k}))}G.focus()}else k(J=>({...J,open:!0,tabIndex:0,t:"",p:"",k:"",fun:""})),G.focus()}},j=()=>{const G=f.current;if(!G)return;let H="",Y="fun";A.fun&&A.fun!=""?H=A.fun:(H=`${A.t};${A.p};${A.k}`,Y="obj"),G.format("smeupLink",{dataArgs:H,dataType:Y}),G.focus(),k(J=>({...J,open:!1,t:"",p:"",k:"",fun:""}))},B=()=>{const G=f.current;G&&(G.format("smeupLink",!1),k(H=>({...H,open:!1,t:"",p:"",k:"",fun:""})))},q=G=>{if(!h.current?.contains(G.relatedTarget)&&f.current){const Y=f.current.getSemanticHTML(),J=jfe(Y);p.current?.({bindValue:J}),g.current?.({bindValue:J})}};Q.useEffect(()=>{const G=u.current;if(!G)return;let H;return(async()=>{try{const ie=(await Promise.resolve().then(()=>require("./quill-CxKAiddw.cjs"))).default,me=Hfe(ie);ie.register(me,!0);const oe=G.appendChild(document.createElement("div")),ne=new ie(oe,{theme:"snow",enable:i,modules:{toolbar:!1,keyboard:{bindings:{tab:{key:9,handler:function(){return!0}}}}},formats:["bold","italic","underline","strike","blockquote","code-block","header","list","link","smeupLink"]});if(f.current=ne,d.current){const ve=ne.clipboard.convert({html:d.current});ne.setContents(ve,"silent"),setTimeout(()=>{const Ne=ne.getSelection()||{index:0,length:0},ke=ne.getFormat(Ne);W(ke)},0)}ne.on(ie.events.SELECTION_CHANGE,ve=>{if(ve){w({index:ve.index,length:ve.length});const Ne=ne.getFormat(ve);W(Ne)}});const de=ve=>{if(ve.key==="@"&&ne.getSelection()?.length>0){ve.preventDefault();const Ne=ne.getSelection(),ke=ne.getFormat(Ne);if(ke.smeupLink){const Le=D(ne,Ne,"smeupLink");ne.setSelection(Le);const $e=ke.smeupLink;if($e.dataType==="fun")k(Ee=>({...Ee,open:!0,tabIndex:1,fun:$e.dataArgs||"",t:"",p:"",k:""}));else{const Ee=nN($e.dataArgs);k(pe=>({...pe,open:!0,tabIndex:0,t:Ee.t,p:Ee.p,k:Ee.k,fun:""}))}}else k(Le=>({...Le,open:!0,tabIndex:0,t:"",p:"",k:"",fun:""}))}};ne.root.addEventListener("keydown",de),ne.on(ie.events.TEXT_CHANGE,()=>{const ve=ne.getSelection();if(ve){const Ne=ne.getFormat(ve);W(Ne)}}),H=()=>{ne.root.removeEventListener("keydown",de),f.current=null,G.innerHTML=""}}catch(J){console.error("Failed to load Quill editor:",J)}})(),()=>{H?.()}},[]);const W=G=>{S({bold:!!G.bold,italic:!!G.italic,underline:!!G.underline,codeBlock:!!G["code-block"],listOrdered:G.list==="ordered",listBullet:G.list==="bullet",link:!!G.link,smeupLink:!!G.smeupLink});const H=G.header;let Y="text";H===1?Y="h1":H===2&&(Y="h2"),x({code:Y,description:v(n8[Y])})};Q.useEffect(()=>{if(f.current&&t!==void 0&&f.current.getSemanticHTML()!==t){const H=f.current.clipboard.convert({html:t});f.current.setContents(H,"silent")}},[t]);const X=()=>V.jsx("div",{className:I.smpTextEditorSeparator}),K=({command:G,icon:H})=>{const Y=()=>{switch(G){case"bold":case"italic":case"underline":L(G);break;case"codeBlock":L("code-block");break;case"listOrdered":P("ordered");break;case"listBullet":P("bullet");break;case"link":O();break;case"smeupLink":U();break}};return V.jsx(lr,{className:`ql-smp-${G}`,appearance:"ghost",variant:"base",icon:H,bindValue:"",active:_[G],BtnTit:v(Bfe[G]),disabled:!i,onClick:Y,ShowText:!1})};return V.jsxs("div",{"data-component":"text-editor",className:I.smpTextEditorWrapper,children:[r&&V.jsx(No,{label:r,helper:e}),V.jsxs("div",{ref:h,className:I.smpTextEditorContent,onKeyDown:G=>{G.key=="Enter"&&G.ctrlKey?o?.({bindValue:f.current?.getSemanticHTML()||""}):G.stopPropagation()},style:a,onBlur:q,children:[V.jsxs("div",{id:"toolbar",className:I.smpTextEditorToolbar,children:[V.jsx(im,{bindValue:y.code,optionalDisplayValue:y.description,isEditable:i,options:Object.keys(rN).map(G=>({obj:{t:"",p:"",k:G},decode:v(n8[G])})),onChange:G=>{x({code:G.bindValue,description:G.optionalDisplayValue});const H=f.current;if(!H)return;let Y=H.getSelection();!Y&&b&&(Y=b,H.setSelection(Y,"silent")),Y&&(G.bindValue==="text"?H.format("header",!1):H.format("header",rN[G.bindValue]),H.focus())},DescrMode:"DescOnly"}),V.jsx(X,{}),E.map(G=>V.jsx(K,{command:G.command,icon:G.icon},G.command)),V.jsx(X,{}),M.map(G=>V.jsx(K,{command:G.command,icon:G.icon},G.command)),V.jsx(X,{}),R.map(G=>V.jsx(K,{command:G.command,icon:G.icon},G.command))]}),V.jsx("div",{ref:u,className:I.smpTextEditorContentEditable})]}),n&&V.jsx(B0,{id:`${m}-helper`,helperText:n,state:"danger"}),V.jsx(bS,{open:C.open,position:"center",isModal:!0,closeOnClickOutside:!0,onClose:()=>T(G=>({...G,open:!1})),children:V.jsxs("div",{className:I.smpTextEditorLinkCommandOverlay,children:[V.jsx(ia,{bindValue:C.link,autocomplete:"off",icon:"insert_link",onChange:G=>{T(H=>({...H,link:G.bindValue}))},hasAdvanceResearch:!1}),V.jsx(lr,{bindValue:v(Ha.APPLY),onClick:()=>$(C.link)}),V.jsx(lr,{bindValue:v(Ha.REMOVE),onClick:()=>N(),variant:"danger",active:C.link!=""})]})}),V.jsxs(bS,{open:A.open,position:"center",isModal:!0,closeOnClickOutside:!0,onClose:()=>k(G=>({...G,open:!1})),children:[V.jsx(SI,{data:Ffe,selectedIndex:A.tabIndex,onTabChange:G=>{k(H=>({...H,tabIndex:G}))}}),V.jsxs("div",{className:I.smpTextEditorSmeupLinkCommandOverlay,children:[A.tabIndex==0&&V.jsxs(V.Fragment,{children:[V.jsx(ia,{label:v(ya.SMEUP_LINK_T),bindValue:A.t,autocomplete:"off",onChange:G=>{k(H=>({...H,t:G.bindValue}))},hasAdvanceResearch:!1}),V.jsx(ia,{label:v(ya.SMEUP_LINK_P),bindValue:A.p,autocomplete:"off",onChange:G=>{k(H=>({...H,p:G.bindValue}))},hasAdvanceResearch:!1}),V.jsx(ia,{label:v(ya.SMEUP_LINK_K),bindValue:A.k,autocomplete:"off",onChange:G=>{k(H=>({...H,k:G.bindValue}))},hasAdvanceResearch:!1})]}),A.tabIndex==1&&V.jsx(V.Fragment,{children:V.jsx(ia,{label:v(ya.SMEUP_LINK_FUN),bindValue:A.fun,autocomplete:"off",onChange:G=>{k(H=>({...H,fun:G.bindValue}))},hasAdvanceResearch:!1})}),V.jsx(lr,{bindValue:v(Ha.APPLY),onClick:()=>j()}),V.jsx(lr,{bindValue:v(Ha.REMOVE),onClick:()=>B(),variant:"danger",active:C.link!=""})]})]})]})},Mo=({id:t,decode:e,shape:r,obj:n,data:i,icon:a,fun:s,placeholderIcon:o,label:l,helper:c,tooltip:u,options:h,inputSettings:f,style:d,autoSelectOptionIndex:p,isVisualOnly:g=!1,onChange:m,onConfirmedChange:v,onClick:y,onEnter:x,onBlur:b,onOptionsRequest:w,onUploadRequest:_,onContextMenu:S,onObjectProtocol:C,isEditable:T,dSep:A=".",value:k})=>{const{translate:I}=Ta(),E={obj:{t:n?.t||"",p:n?.p||"",k:n?.k?f?.forceUppercase?n?.k.toLocaleUpperCase():n.k:""},shape:r,decode:e,icon:a,fun:s,data:i,isEditable:T,options:h,style:d,inputSettings:f,placeholderIcon:o,tooltip:u},M=AI(n,r,i?.size),R=e||k,D={id:t,onOptionsRequest:w,fun:s,icon:a,placeholderIcon:o,tooltip:u,obj:n,label:l,helper:c,isEditable:T,style:d,size:E.data&&E.data.size?E.data.size:20,isVisualOnly:g,options:h,autoSelectOptionIndex:p,...i},L=(j,B)=>CI(n)?ld(j,{bindValue:new nm(n,B.bindValue).getLegacyValue()}):KW(n)?ld(j,{bindValue:new mS(n,B.bindValue).getLegacyValue()}):f?.forceUppercase?ld(j,{bindValue:B.bindValue.toLocaleUpperCase(),optionalDisplayValue:B.optionalDisplayValue}):ld(j,B),P=(j,B)=>ld(j,{bindValue:new h0(n,B,A).getLegacyValue()}),O=j=>ld(E,{bindValue:new pS(n,j).getLegacyValue()}),$=j=>wfe(E,j),N=()=>{switch(M){case Ke.AUTOCOMPLETE:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R,obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(j3,{...j})}case Ke.BUTTON:{const j=i?.BtnTxt&&typeof i.BtnTxt=="string"?i.BtnTxt:void 0,B={...D,bindValue:j||"",ShowText:i?.ShowText!=null?i.ShowText:!!j,onClick:q=>{y?.(q,L(E,{bindValue:n.k}))}};return V.jsx(lr,{...B})}case Ke.BUTTON_LIST:{const j={...D,onClick:(B,q)=>{y?.(B,q)}};return V.jsx(nq,{...j})}case Ke.BREADCRUMBS:{const j={...D,onClick:(B,q)=>{y?.(B,q)}};return V.jsx(XW,{...j})}case Ke.CHECKBOX:case Ke.SWITCH:{const j=M===Ke.SWITCH,B={...D,bindValue:pS.fromDataObj(n).getValue(),optionalDisplayValue:R,onChange:q=>{m?.(O(q))},onConfirmedChange:q=>{v?.(O(q))},...j&&{variant:"switch"}};return V.jsx(H3,{...B})}case Ke.COMBOBOX:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R,obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(uq,{...j})}case Ke.DATE:{const j={...D,bindValue:nm.fromDataObj(n).getValue(),obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(kI,{...j})}case Ke.ICON:case Ke.IMAGE:{const j={...D,icon:a,isInteractable:!!D.fun,onClick:B=>{y?.(B,L(E,{bindValue:n.k}))}};return V.jsx(Dr,{...j})}case Ke.INPUT_NUMBER:{const j={...D,bindValue:h0.fromDataObj(n,A).getValue(),onChange:B=>{m?.(P(E,B))},onEnter:B=>{x?.(P(E,B))},onBlur:B=>{b?.(P(E,B))}};return V.jsx(sq,{...j})}case Ke.EDITOR:{const j={...D,onObjectProtocol:C,bindValue:n.k,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(Gfe,{...j})}case Ke.MEMO:{const j={...D,bindValue:n.k,optionalDisplayValue:R,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(II,{...j})}case Ke.CHIP:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return T?V.jsx(Nfe,{...j}):V.jsx(G3,{...j})}case Ke.MULTI_AUTOCOMPLETE:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return V.jsx(oq,{...j})}case Ke.MULTI_CONFIG:{const j={...D,bindValue:l||"",ShowText:!!l,icon:a??"list",onClick:B=>{y?.(B,L(E,{bindValue:n.k}))}};return V.jsx(lr,{...j})}case Ke.MULTI_COMBOBOX:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return V.jsx(Ofe,{...j})}case Ke.MULTI_SELECT:{const j={...D,elements:c2(E),onChange:B=>{m?.($(B))},onConfirmedChange:B=>{v?.($(B))}};return V.jsx(hq,{...j})}case Ke.PASSWORD:{const j={...D,bindValue:E.obj.k,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(lq,{...j})}case Ke.RADIO:{const j={...D,bindValue:n.k,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))}};return V.jsx(kfe,{...j})}case Ke.SELECT:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R,obj:E.obj,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))}};return V.jsx(im,{...j})}case Ke.SPOTLIGHT:{const j={...D,bindValue:E.obj.k,obj:E.obj,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(cq,{...j})}case Ke.BUTTON_GROUP:{const j={...D,bindValue:n.k,onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))}};return V.jsx(rq,{...j})}case Ke.TIMEPICKER:{const j={...D,bindValue:mS.fromDataObj(n).getValue(),onChange:B=>{m?.(L(E,B))},onConfirmedChange:B=>{v?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(Mfe,{...j})}case Ke.TREE:{const j={...D,onClick:(B,q)=>{y?.(B,q)}};return V.jsx(Pfe,{...j})}case Ke.FILE_UPLOAD:{const j={...D,initialFiles:E.obj?.k?E.obj.k.split(";"):[],disabled:D.isEditable===!1,onUploadRequest:_,onChange:B=>{Array.isArray(B)?(m?.($(B.map(q=>({bindValue:q.bindValue})))),b?.($(B.map(q=>({bindValue:q.bindValue}))))):(m?.(L(E,B)),b?.(L(E,B)))}};return V.jsx(aq,{...j})}case Ke.LABEL:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R};return V.jsx(Mg,{...j})}case Ke.TEXT_FIELD:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:E.decode,obj:E.obj,onChange:B=>{m?.(L(E,B))},onEnter:B=>{x?.(L(E,B))},onBlur:B=>{b?.(L(E,B))}};return V.jsx(ia,{...j})}case void 0:{const j={...D,bindValue:E.obj.k,optionalDisplayValue:R};return V.jsx(Mg,{...j})}default:return V.jsx(Mg,{bindValue:I(Ha.SHAPE_NOT_SUPPORTED_YET)+r})}},U={wrapper:`${Rfe["smp-cell-wrapper"]}`};return V.jsx("span",{className:U.wrapper,onContextMenu:j=>{S&&u&&(j.preventDefault(),S(E,j.currentTarget))},children:N()})},Zy=({children:t,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(t)?t.map(n=>({id:n.props.id})):[{id:t.props.id}]}]},columns:r})=>{const[n,i]=Q.useState(0),{getSectionPathId:a}=Vue(),s={};Q.Children.forEach(t,m=>{Q.isValidElement(m)&&(s[m.props.id]=m)});const o="--smp-grid-template-cols",l="--smp-grid-template-rows",c=VW(e.sections??[],Object.keys(s)),u=(m,v=[])=>m.reduce((y,x,b)=>{const w=[...v,b];let _="",S={},C={},T="";x.sections?.length?(_=us["smp-layout-section-grid"],S=u(x.sections,w),T=us[x.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],x.horizontal||PR(x.sections)?C=LR(x.sections,x.horizontal?o:l):C={[o]:"auto",[l]:"auto"}):x.content?.length&&(x.columns!==void 0&&+x.columns>0?(_=us["smp-layout-section-grid"],T=us["smp-grid-template-cols"],C={[o]:`repeat(${x.columns}, 1fr)`}):x.horizontal?_=us["smp-layout-section-flex"]:_=us["smp-layout-section-grid"]);const A=a(w);return{...y,...S,[A]:{classes:`${_} ${us[x.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${T} ${x.layoutAttributes?.map(k=>`smp-${k}`).join(" ")??""}`,styles:C}}},{}),h=u(c),f=`${us["smp-layout"]} ${e.horizontal?us["smp-layout-horizontal"]:us["smp-layout-vertical"]} ${e.inline?us["smp-layout-inline"]:""}`;let d={};(e.horizontal||PR(e.sections||[]))&&(d=LR(c,e.horizontal?o:l));const p=(m,v,y=[])=>{const x=a(y),b=V.jsx("div",{"smp-id":`section-${m.id}`,className:h[x].classes,style:h[x].styles,children:m.sections?.length?m.sections.map((w,_)=>p(w,!1,[...y,_])):m.content?.map(w=>g(w))},x);return m.title&&!v?V.jsxs("div",{className:us["smp-layout-section-with-title"],children:[V.jsx("span",{className:`${us["smp-layout-section-title"]}`,children:V.jsx(No,{label:m.title})}),b]},`title-${x}`):b},g=m=>{if(zue(m,m.id?r?.[m.id]:void 0)){let v=s[m.id||""];v?m.style&&(v=Q.cloneElement(v,{style:{...m.style,...v.props.style}})):v=V.jsx(Mo,{...m,id:m.id??"",style:m.style});const y=`${us["smp-layout-cell-container"]} ${m.layoutAttributes?.map(x=>`smp-${x}`).join(" ")??""}`;return V.jsx("div",{className:y,"smp-id":m.id,children:v},m.id)}};return V.jsxs("div",{className:f,style:d,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&e?.sections.length>1&&V.jsx(SI,{data:{type:"SmeupDataTree",children:c.map(m=>({decode:m.title||m.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0,toolbar:!1}))},selectedIndex:n,onTabChange:i}),e.sectionsType?p(c[n],!0,[n]):c.map((m,v)=>p(m,!1,[v]))]})},Wfe={"smp-appbar":"_smp-appbar_16wrs_1"},iN=t=>{if(!t?.rows?.length||!t?.columns?.length)return;const e=t.rows[0];return t.columns.filter(n=>n.visible??!0).reduce((n,i)=>{const s={...e.cells?.[i.name],id:i.name};return{...n,[i.name]:s}},{})},qfe=({data:t,advanceResearchAutoSelect:e,onClick:r,onEnter:n,onContextMenu:i,onAdvanceResearchLoadInitialData:a,onAdvanceResearchLeafNodeClick:s})=>{const o=iN(t),[l,c]=Q.useState(o);Q.useEffect(()=>{c(iN(t))},[t]);const u=(h,f)=>{c(d=>d&&{...d,[h]:{...d[h],obj:{t:d[h].obj?.t||"",p:d[h].obj?.p||"",k:f.obj?.k||""}}})};return V.jsx(Vm.Provider,{value:{onAdvanceResearchLoadInitialData:a,onAdvanceResearchLeafNodeClick:s,advanceResearchAutoSelect:e},children:V.jsx("header",{className:Wfe["smp-appbar"],"aria-label":"App Bar","data-component":"app-bar",children:V.jsx(Zy,{layout:t?.rows?.[0]?.layout,children:Object.values(l||{}).map(h=>Q.createElement(Mo,{...h,key:h.id,onChange:f=>u(h.id,f),onContextMenu:(f,d)=>i&&i(f,d),onEnter:f=>n&&n(f),onClick:(f,d)=>r&&r(d)}))})})})},T1={"smp-box-list-container":"_smp-box-list-container_1oks6_1","smp-box-list":"_smp-box-list_1oks6_1","smp-box-element":"_smp-box-element_1oks6_18","smp-box-element-clickable":"_smp-box-element-clickable_1oks6_27","smp-box-global-filter":"_smp-box-global-filter_1oks6_40"},Xfe=(t,e)=>{const r=e.toLowerCase();return t.rows.filter(n=>n.cells?Object.values(n.cells).some(i=>{const a=i.value?i.value.toLowerCase().includes(r):!1,s=i.obj?.k?i.obj.k.toLowerCase().includes(r):!1;return a||s}):!1)},Yfe=(t,e)=>{switch(e){case"2":return Kfe(t);case"3":return Zfe(t);case"4":return Jfe(t);case"5":return Qfe(t);case"6":return ede(t);case"7":return tde(t);case"8":return rde(t);default:return Um(t)}},Um=t=>({sections:t.map(e=>({id:`section-${e.name}`,layoutAttributes:["grid-cols-2"],content:[{id:`label-${e.name}`,obj:{t:"",p:"",k:e.title||e.name}},{id:e.name,style:{fontWeight:"bold"}}]}))}),Kfe=t=>({sections:t.map(e=>({id:`section-${e.name}`,layoutAttributes:["grid-cols-2"],content:[{id:`label-${e.name}`,obj:{t:"",p:"",k:e.title||e.name}},{layoutAttributes:["justify-end"],id:e.name,style:{fontWeight:"bold"}}]}))}),Zfe=t=>({sections:[{id:"content",layoutAttributes:[`grid-cols-${t.length}`,"justify-center"],sections:t.map(e=>({id:`section-${e.name}`,layoutAttributes:["grid-cols-2"],content:[{id:`label-${e.name}`,layoutAttributes:["justify-end"],obj:{t:"",p:"",k:e.title||e.name}},{layoutAttributes:["justify-start"],id:e.name,style:{fontWeight:"bold"}}]}))}]}),Jfe=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0||r.length==0?(console.warn("LayoutNbr 4 required at least 1 image or icon and one field"),Um(t)):{sections:[{id:"content",layoutAttributes:["grid-col-1","justify-center"],content:[{layoutAttributes:["justify-center"],id:e[0].name},{layoutAttributes:["justify-center"],id:r[0].name}]}]}},Qfe=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 5 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",layoutAttributes:["grid-cols-2"],sections:[{id:"image",content:[{layoutAttributes:["justify-center","items-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-2"],sections:[{layoutAttributes:["justify-end"],id:`label-${n.name}`,content:[{obj:{t:"",p:"",k:n.title||n.name}}]},{layoutAttributes:["justify-start"],id:`value-${n.name}`,content:[{id:n.name,style:{fontWeight:"bold"}}]}]}))}]}]}},ede=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 6 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",layoutAttributes:["grid-cols-2"],sections:[{id:"image",content:[{layoutAttributes:["justify-center","items-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-1","gap-4"],content:[{id:`label-${n.name}`,obj:{t:"",p:"",k:n.title||n.name}},{id:n.name,style:{fontWeight:"bold"}}]}))}]}]}},tde=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 7 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",sections:[{id:"image",content:[{layoutAttributes:["justify-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-2","gap-4"],content:[{id:`label-${n.name}`,obj:{t:"",p:"",k:n.title||n.name}},{id:n.name,style:{fontWeight:"bold"}}]}))}]}]}},rde=t=>{const e=t.filter(n=>n.shape==Ke.IMAGE||n.shape==Ke.ICON),r=t.filter(n=>n.shape!=Ke.IMAGE&&n.shape!=Ke.ICON);return e.length==0?(console.warn("LayoutNbr 8 required at least 1 image or icon"),Um(t)):{sections:[{id:"content",sections:[{id:"image",content:[{layoutAttributes:["justify-center"],id:e[0].name}]},{sections:r.map(n=>({id:`section-${n.name}`,layoutAttributes:["grid-cols-1","gap-4"],content:[{id:`label-${n.name}`,obj:{t:"",p:"",k:n.title||n.name}},{id:n.name,style:{fontWeight:"bold"}}]}))}]}]}},nde=["px","vh","vw","rem","em","%"];function wS(t){return t==null?"":typeof t=="number"||String(t).trim()!==""&&!isNaN(Number(t))?`${t}px`:String(t)}function _S(t){if(typeof t=="number")return!0;if(typeof t!="string")return!1;const e=nde.join("|");return new RegExp(`^-?\\d+(\\.\\d+)?(${e})?$`).test(t)}function aN(t){if(typeof t=="number")return t;const e=wS(t),r=document.createElement("div");r.style.position="absolute",r.style.visibility="hidden",r.style.height=e,r.style.padding="0",r.style.margin="0",r.style.border="none",document.body.appendChild(r);const n=parseFloat(getComputedStyle(r).height);return r.remove(),isNaN(n)?0:n}const ide=({data:t,dSep:e,SelectRow:r,SelFirst:n="No",GlobalFilter:i="No",Columns:a,Cols:s,LayoutNbr:o="1",onCellClick:l,onClick:c,BoxHeight:u})=>{const[h,f]=Q.useState(t.rows),[d,p]=Q.useState(""),g={smpBoxList:`${T1["smp-box-list"]}`,smpBoxElement:`${T1["smp-box-element"]} ${c?T1["smp-box-element-clickable"]:""}`,smpBoxGlobalFilter:`${T1["smp-box-global-filter"]}`},m=Q.useMemo(()=>{if(a){const b=a.split("|");return t.columns.filter(_=>b.includes(_.name)).sort((_,S)=>b.indexOf(_.name)-b.indexOf(S.name))}return t.columns.filter(b=>b.visible==null||b.visible==!0)},[a,t.columns]);Q.useEffect(()=>{Yr(n)&&t.rows.length>0&&c?.({row:t.rows[0]}),r&&parseInt(r)-1<=t.rows.length&&c?.({row:t.rows[parseInt(r)-1]})},[]);const v=(b,w)=>V.jsx(Mo,{id:b.name,...w.cells?.[b.name],isVisualOnly:!0,isEditable:!1,dSep:e,onClick:(_,S)=>{_.stopPropagation(),l?.({cell:S,column:b,row:w})}}),y=Q.useMemo(()=>s&&parseInt(s)>0?parseInt(s):1,[s]),x=Q.useMemo(()=>({"--smp-box-list-cols":y.toString()}),[y]);return V.jsxs("div",{"data-component":"box-list",className:T1["smp-box-list-container"],style:{height:_S(u)?wS(u):void 0},children:[Yr(i)&&V.jsx("div",{className:g.smpBoxGlobalFilter,children:V.jsx(cq,{bindValue:d,onChange:b=>{p(b.bindValue),f(Xfe(t,b.bindValue))},FullWidth:"Yes",placeholder:"Search..."})}),V.jsx("div",{"data-component":"box-list-grid",className:g.smpBoxList,style:x,children:h.map((b,w)=>b.cells?V.jsx("div",{"data-component":"box-list-element",className:g.smpBoxElement,onClick:()=>c?.({row:b}),children:V.jsx(Zy,{layout:b.layout?.sections&&b.layout.sections.length>0?b.layout:Yfe(m,o),children:m.map(_=>v(_,b))})},`box-${w}`):null)})]})},to={"smp-dash-list":"_smp-dash-list_x2rzc_1","smp-dash-list-fill-space":"_smp-dash-list-fill-space_x2rzc_8","smp-dash-list-horizontal":"_smp-dash-list-horizontal_x2rzc_13","smp-layout-1":"_smp-layout-1_x2rzc_17","smp-layout-2":"_smp-layout-2_x2rzc_21","smp-layout-3":"_smp-layout-3_x2rzc_29","smp-layout-1__descr":"_smp-layout-1__descr_x2rzc_58","smp-layout-2__descr":"_smp-layout-2__descr_x2rzc_59","smp-layout-3__descr":"_smp-layout-3__descr_x2rzc_60","smp-layout-1__value":"_smp-layout-1__value_x2rzc_68","smp-layout-2__value":"_smp-layout-2__value_x2rzc_69","smp-layout-3__value":"_smp-layout-3__value_x2rzc_70","smp-layout-2__icon":"_smp-layout-2__icon_x2rzc_77"},ade=({ColumnsNumber:t=1,data:e,ForceText:r,TextColName:n,TextColor:i="var(--smp-dashList-color-base)",Fillspace:a,FontSize:s,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:h,ForceUM:f,UmColName:d,UmColor:p="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:m,ValueColor:v="var(--smp-dashList-color-base)",SelectLayout:y="1",onClick:x})=>{const w=e?.columns||[],_=e?.rows||[],S=_.length>0,C="--smp-dashList-color",T="descr",A="icon",k="um",I="value",E=s||"1em",M="18px",R="--smp-dashList-columns",D="--smp-dashList-fontSize",L={dash:(H="1")=>({container:to[`smp-layout-${H}`]||to["smp-layout-1"],descr:to[`smp-layout-${H}__descr`]||to["smp-layout-1__descr"],icon:to[`smp-layout-${H}__icon`]||to["smp-layout-2__icon"],um:to[`smp-layout-${H}__um`]||"",value:to[`smp-layout-${H}__value`]||to["smp-layout-1__value"]}),dashList:`${to["smp-dash-list"]} ${Yr(a)?to["smp-dash-list-fill-space"]:""} ${Yr(o)?to["smp-dash-list-horizontal"]:""}`},{format:P}=Ta(),O=H=>`${C}-${H}`,$=H=>{const Y=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Y.test(H)){const ie=H.match(Y)||[];if(ie?.length>3)return"rgb("+ie[1]+","+ie[2]+","+ie[3]+")"}return H},N=H=>{if(!h)return H;const[Y,J]=U(h).map(de=>parseInt(de||"0")),ie="0,0"+(J?"."+"0".repeat(J):""),me=P(H,ie,"it");if(!Y)return me;const[oe,ne]=me.split(",");return oe+(ne?`,${ne}`:"")},U=H=>H.includes(";")?H.split(";"):[H],j=H=>{const Y=ie=>{if(ie)return H?.cells?.[ie]?.obj?.k},J=ie=>{if(!(w.length<=ie))return H?.cells?.[w[ie].name]?.obj?.k};return{descr:r||Y(n)||J(2)||"",icon:l||Y(c)||J(3)||"",um:f||Y(d)||J(1)||"",value:g||Y(m)||J(0)||""}},B=H=>{x?.(H)},q=(H,Y)=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),H.stopPropagation(),B(Y))},X=(H=>{const Y=L.dash(H);return{className:Y,descr:J=>V.jsx("div",{className:Y.descr,children:J},`${H}-${T}`),icon:J=>V.jsx("div",{className:Y.icon,children:V.jsx(Dr,{color:u,height:M,icon:J,width:M})},`${H}-${A}`),um:J=>V.jsx("div",{className:Y.um,children:J},`${H}-${k}`),value:J=>V.jsx("div",{className:Y.value,children:J},`${H}-${I}`)}})(y),K=H=>{const{descr:Y,icon:J,um:ie,value:me}=j(H),oe={[O(T)]:$(i),[O(k)]:$(p),[O(I)]:$(v)},ne=[],de=N(me);switch(y){case"2":J&&ne.push(X.icon(J)),ne.push(X.descr(Y)),ne.push(X.value(ie?de+" "+ie:de));break;default:case"1":ne.push(X.descr(Y)),ne.push(X.value(ie?de+" "+ie:de))}return V.jsx("div",{className:X.className.container,role:"button",style:oe,tabIndex:0,onClick:()=>B(H),onKeyDown:ve=>q(ve,H),children:ne},H.rowId)},G={[R]:String(t),[D]:E};return V.jsx("div",{className:L.dashList,style:G,"data-component":"dash-list",children:S?_.map(H=>K(H)):"N/A"})},sde={"smp-table":"_smp-table_1yqvn_1"};function ode(t,e){const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}function lde(t,e){return t.map(r=>{const n=e.find(i=>i.column===r.bindValue);return{column:r.bindValue,visible:n?.visible??!0}})}function dq(t){const e=[];return t?.split("|").forEach(r=>{const n=r.split(","),i=n[0],s=(n[1]??"").toUpperCase()!=="H";i.trim()&&e.push({column:i,visible:s})}),e}function cde(t){let e="";return t.forEach(r=>{r.visible?e+=`${r.column}|`:e+=`${r.column},H|`}),e.replace(new RegExp("\\|$"),"")}function ude(t){return!t||typeof t!="string"?[]:t.split("|").map(e=>e.trim()).filter(Boolean).map(e=>{const r=e.match(/^(\w+)\(([^)]+)\)$/);return r?{func:r[1].toUpperCase(),field:r[2].trim()}:null}).filter(Boolean)}function pq(t,e){const r={};for(const{func:n,field:i}of e){const a=t.map(s=>{const o=s?.cells?.[i]?.value,l=typeof o=="number"?o:parseFloat(o??"");return isNaN(l)?0:l}).filter(s=>typeof s=="number");switch(n){case"SUM":r[i]=a.reduce((s,o)=>s+o,0);break;case"COUNT":r[i]=a.length;break;case"AVG":r[i]=a.length>0?a.reduce((s,o)=>s+o,0)/a.length:0;break}}return r}function hde(t,e,r,n,i){const a=[];let s=0;return o(t,0,[]),{flatRows:a,offset:s};function o(f,d,p){if(d>=e.length){h(f);return}const g=e[d].column,m=l(f,g);let v=0;for(const[y,x]of m){const b=[...p,v.toString()],w=c(b),_=n.has(w),S=u(y,w,d,_,x);a.push(S),s+=r,_&&o(x,d+1,b),v++}}function l(f,d){const p=new Map;for(const g of f){const m=(g.cells?.[d]?.decode||g.cells?.[d]?.value)??"N/D";p.has(m)||p.set(m,[]),p.get(m).push(g)}return p}function c(f){return`${f.join("-")}`}function u(f,d,p,g,m){const v={};if(i&&m.length>0){const y=pq(m,i);for(const x in y)v[x]={value:String(y[x]),obj:{t:"NR",p:"",k:String(y[x])},options:[],decode:String(y[x]),shape:Ke.LABEL,isEditable:!1,data:{isVisualOnly:!0}}}return{isGroup:!0,value:f,cells:v,id:d,level:p,isExpanded:g}}function h(f){for(const d of f)a.push(d),s+=r}}const sN=400,fde=({columns:t,rows:e,containerRef:r,sizingMode:n})=>{const[i,a]=Q.useState(0);Q.useEffect(()=>{if(!r.current)return;const h=new ResizeObserver(f=>{for(const d of f)a(d.contentRect.width)});return h.observe(r.current),()=>h.disconnect()},[r]);const s=Q.useMemo(()=>{if(!t||t.length===0)return{};const h=3,f=7,d={};if(n==="fixed")t.forEach(p=>{d[p.name]=120});else if(n==="fit-grid"){const p=i||800,g=t.filter(v=>v.visible!==!1),m=p/Math.max(g.length,1);g.forEach(v=>{d[v.name]=m})}else if(n==="fit-content"){const p=[...e].sort(()=>.5),g=e.slice(0,100).concat(p);for(const m of t){if(m.visible===!1)continue;const v=(m.title?.length||0)+h*2,y=Math.max(v,...g.map(x=>{const b=x.cells?.[m.name];return`${b?.decode??b?.value??""}`.length}));d[m.name]=y*f+24}}return d},[t,e,n,i]),[o,l]=Q.useState({}),c=Q.useMemo(()=>({...s,...o}),[s,o]),u=Q.useCallback(h=>{l(f=>typeof h=="function"?h({...s,...f}):h)},[s]);return[c,u]},dde={EQ:{label:"eq",function:(t,e)=>t.toDateString()===e.toDateString()},ON:{label:"on",function:(t,e)=>t.toDateString()===e.toDateString()},AFTER:{label:"after",function:(t,e)=>t>e},ONORAFTER:{label:"onorafter",function:(t,e)=>t>=e},BEFORE:{label:"before",function:(t,e)=>t<e},ONORBEFORE:{label:"onorbefore",function:(t,e)=>t<=e}},pde={CONTAINS:{label:"contains",function:(t,e)=>t.includes(e)},STARTS:{label:"starts",function:(t,e)=>t.startsWith(e)},EQ:{label:"eq",function:(t,e)=>t===e},NEQ:{label:"neq",function:(t,e)=>t!==e}},gde={EQ:{label:"eq",function:(t,e)=>t===e},NEQ:{label:"neq",function:(t,e)=>t!==e},GT:{label:"gt",function:(t,e)=>t>e},GTE:{label:"ge",function:(t,e)=>t>=e},LT:{label:"lt",function:(t,e)=>t<e},LTE:{label:"le",function:(t,e)=>t<=e}},mde=t=>Object.values(dde).find(r=>r.label===t.toLowerCase())?.function??(()=>null),vde=t=>Object.values(pde).find(r=>r.label===t.toLowerCase())?.function??(()=>null),yde=t=>Object.values(gde).find(r=>r.label===t.toLowerCase())?.function??(()=>null);function xde(t,e){return t.map(r=>{const n=e?.[r.name],i=bde(r);return{obj:{t:r.obj?.t||"",p:r.obj?.p||"",k:r.name},decode:r.title,shape:void 0,type:n??i}})}function bde(t){return t.obj?YW(t.obj)?"number":CI(t.obj)?"date":"string":"string"}function oN(t,e){const r={logic:"and",filters:[]};return t?typeof t=="object"&&"logic"in t&&"filters"in t?t:typeof t=="string"?wde(t,e):r:r}function wde(t,e){const r=t.split("|").map(i=>i.trim()).filter(Boolean),n=[];for(const i of r){const a=_de(i,e);a&&n.push(a)}return{logic:"and",filters:n}}function _de(t,e){if(!t.trim())return null;if(t.includes(";OR;")){const n=t.split(";OR;").map(l=>l.trim()).filter(Boolean);if(n.length===0)return null;const i=i8(n[0],e);if(!i)return null;const a=i.field,s=i.columnsType,o=n.slice(1).map(l=>i8(l,e,a?.obj?.k,s)).filter(l=>l!==null);return{logic:"or",filters:[i,...o]}}else{const n=i8(t,e);return n?{logic:"and",filters:[n]}:null}}function i8(t,e,r,n){const i=t.split(";").map(h=>h.trim());let a,s,o;if(i.length===3)[a,s,o]=i;else if(i.length===2&&r&&n)[s,o]=i,a=r;else return null;const l=e.find(h=>h?.obj?.k===a)??(r&&n?{obj:{t:"",p:"",k:r},decode:r,type:n,shape:void 0}:null);if(!l)throw new Error(`Campo '${a}' non trovato nei FieldOption.`);const c={...v_,obj:{t:"",p:"",k:s}},u=Sde(o,l.type);return{field:l,columnsType:l.type,operator:c,value:u}}function Sde(t,e){switch(e){case"number":return Number(t);case"date":return new Date(t);case"string":return t;default:return null}}function Cde(t,e){return!e||"filters"in e&&e.filters.length===0?t:t.filter(r=>gq(e,r))}function gq(t,e){if("filters"in t){const{logic:r,filters:n}=t;if(n.length===0)return!0;const i=n.map(a=>gq(a,e));return r==="and"?i.every(Boolean):i.some(Boolean)}return Ade(t,e)}function Ade(t,e){const{field:r,operator:n,value:i,columnsType:a}=t,s=e.cells?.[r?.obj?.k||""],o=Tde(s);if(!o)return!1;switch(a){case"string":return kde(o,n.obj?.k||"",i);case"number":return Ede(o,n.obj?.k||"",i);case"date":return Ide(o,n.obj?.k||"",i);default:return!0}}function Tde(t){if(!t||typeof t!="object")return t;if("decode"in t)return t.decode;if("value"in t)return t.value}function kde(t,e,r){const n=String(t).toLowerCase(),i=String(r).toLowerCase();return vde(e)(n,i)??!0}function Ede(t,e,r){const n=Number(t),i=Number(r);return r===""?!0:isNaN(n)||isNaN(i)?!1:yde(e)(n,i)??!0}function Ide(t,e,r){const n=new Date(t),i=new Date(r);return r===""?!0:isNaN(n.getTime())||isNaN(i.getTime())?!1:mde(e)(n,i)??!0}const Dde=(t,e)=>{const r=n=>n.filters.some(i=>"filters"in i?r(i):i.field?.obj?.k===t&&i.operator&&i.value!=="");return r(e)},Mde=t=>{const e=r=>r.filters.reduce((n,i)=>"filters"in i?n+e(i):n+1,0);return e(t)};function Lde(t,e){const r=Q.useRef(null),n=Q.useCallback(s=>{r.current=s},[]),i=Q.useCallback(s=>{s.preventDefault(),s.dataTransfer.dropEffect="move"},[]),a=Q.useCallback(s=>{const o=r.current;if(!o||o===s)return;const l=t.findIndex(f=>f.name===o),c=t.findIndex(f=>f.name===s);if(l===-1||c===-1)return;const u=[...t],[h]=u.splice(l,1);u.splice(c,0,h),e(u),r.current=null},[t,e]);return{handleDragStart:n,handleDragOver:i,handleDrop:a}}function mq(t,e,r,n="."){const i=t.columns.find(s=>s.name===e);if(!i)return t;const a=[...t.rows].sort((s,o)=>{const l=s.cells?.[e].obj,c=o.cells?.[e].obj;if(l?.k==null&&c?.k!=null)return r==="asc"?1:-1;if(l?.k!=null&&c?.k==null)return r==="asc"?-1:1;if(l?.k==null&&c?.k==null)return 0;switch(i.obj?.t){case"NR":{const u=h0.fromDataObj(l,n).getValue()??NaN,h=h0.fromDataObj(c,n).getValue()??NaN;return isNaN(u)&&isNaN(h)?0:isNaN(u)?r==="asc"?-1:1:isNaN(h)?r==="asc"?1:-1:r==="asc"?u-h:h-u}case"D8":case"DATE":{const u=new Date(nm.fromDataObj(l).getValue()),h=new Date(nm.fromDataObj(c).getValue());return isNaN(u.getTime())&&isNaN(h.getTime())?0:isNaN(u.getTime())?r==="asc"?1:-1:isNaN(h.getTime())?r==="asc"?-1:1:r==="asc"?u.getTime()-h.getTime():h.getTime()-u.getTime()}default:{const u=s.cells?.[e]?.decode||s.cells?.[e]?.value||l?.k,h=o.cells?.[e]?.decode||o.cells?.[e]?.value||c?.k;return u!=null&&h!=null?r==="asc"?String(u).localeCompare(String(h)):String(h).localeCompare(String(u)):u==null&&h!=null?r==="asc"?1:-1:u!=null&&h==null?r==="asc"?-1:1:0}}});return{...t,rows:a}}function Pde(t,e){const[r,n]=Q.useState(null),[i,a]=Q.useState("asc");return{sortedRows:Q.useMemo(()=>r?mq({...t,rows:t.rows},r,i,e).rows:t.rows,[t,r,i,e]),sortBy:r,sortOrder:i,handleSort:l=>{n(c=>c===l?(a(u=>u==="asc"?"desc":"asc"),l):(a("asc"),l))}}}const lN={"smp-footer-tr":"_smp-footer-tr_22pj9_1","smp-footer-td":"_smp-footer-td_22pj9_6"},Rde=({columns:t,columnWidths:e,totals:r,rows:n=[],hasGroups:i=!1})=>{const a={td:`${lN["smp-footer-td"]}`,tr:`${lN["smp-footer-tr"]}`},s=i?n.filter(l=>l.isGroup&&l.level===0):n.filter(l=>!l.isGroup),o=r&&s.length>0?pq(s,r):{};return V.jsx("tfoot",{children:V.jsx("tr",{className:a.tr,children:t.map(l=>l.visible&&V.jsx("td",{className:a.td,style:{width:e[l.name],minWidth:e[l.name],maxWidth:e[l.name]},children:o[l.name]!=null?V.jsx(Mo,{value:String(o[l.name]),obj:{t:"NR",p:"",k:String(o[l.name])},options:[],decode:String(o[l.name]),shape:Ke.INPUT_NUMBER,id:l.name,data:{isVisualOnly:!0,style:{fontWeight:"bold"}}}):null},l.name))})})},Nde=({label:t,rowHeight:e=28,offsetTop:r=0,level:n=0,onClick:i,isExpanded:a,cells:s,columns:o,columnWidths:l})=>{const c={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return V.jsx("tr",{className:c.tr,style:{height:e,top:r,lineHeight:`${e}px`},onClick:i,children:o?.map((u,h)=>{const f=h===0,d=f?V.jsxs(V.Fragment,{children:[V.jsx(Dr,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),V.jsx(jn,{variant:"title",bindValue:t})]}):s?.[u.name]?.value!=null?V.jsx(Mo,{...s[u.name],id:u.name}):null;return V.jsx("td",{className:c.td,style:{width:l?.[u.name],paddingLeft:f?10+n*20:void 0},children:d},u.name)})})};function Ode(t){return t.split("|")}function Bde(t,e){return t.columns.map(r=>({...r,visible:e.includes(r.name)}))}const dg={"smp-filter-wrapper":"_smp-filter-wrapper_1dest_1","smp-filter-group":"_smp-filter-group_1dest_10","smp-filter-row":"_smp-filter-row_1dest_18","smp-filter-list":"_smp-filter-list_1dest_24","smp-filter-toolbar":"_smp-filter-toolbar_1dest_31","smp-filter-actionButtons":"_smp-filter-actionButtons_1dest_41"},Fde=({filter:t,onChange:e,onDelete:r,fieldOptions:n,hasCurrentColumn:i})=>{const{translate:a}=Ta(),s={string:[{obj:{t:"",p:"",k:"starts"},shape:void 0,decode:a(gs.STRING_STARTS)},{obj:{t:"",p:"",k:"contains"},shape:void 0,decode:a(gs.STRING_CONTAINS)},{obj:{t:"",p:"",k:"eq"},shape:void 0,decode:a(gs.STRING_EQUALS)}],number:[{obj:{t:"",p:"",k:"eq"},shape:void 0,decode:a(gs.NUMBER_EQUALS)},{obj:{t:"",p:"",k:"gt"},shape:void 0,decode:a(gs.NUMBER_GREATER)},{obj:{t:"",p:"",k:"ge"},shape:void 0,decode:a(gs.NUMBER_GREATER_OR_EQUAL)},{obj:{t:"",p:"",k:"lt"},shape:void 0,decode:a(gs.NUMBER_LESS)},{obj:{t:"",p:"",k:"le"},shape:void 0,decode:a(gs.NUMBER_LESS_OR_EQUAL)}],date:[{obj:{t:"",p:"",k:"before"},shape:void 0,decode:a(gs.DATE_BEFORE)},{obj:{t:"",p:"",k:"after"},shape:void 0,decode:a(gs.DATE_AFTER)},{obj:{t:"",p:"",k:"on"},shape:void 0,decode:a(gs.DATE_ON)}]},o=f=>{const d=n.find(g=>g?.obj?.k===f);if(!d)return;const p=s[d.type]?.[0]||{obj:{t:"",p:"",k:""},decode:"",shape:void 0};e({...t,field:d,columnsType:d.type,operator:p,value:""})},l=f=>{const d=s[t.columnsType]?.find(p=>p.obj.k===f);d&&e({...t,operator:d})},c=f=>{e({...t,value:f})},u=()=>{switch(t.columnsType){case"string":return V.jsx(ia,{bindValue:t.value,onChange:f=>c(f.bindValue)});case"number":return V.jsx(sq,{bindValue:t.value,onChange:f=>{f&&c(f)}});case"date":return V.jsx(kI,{bindValue:t.value,onChange:f=>c(f.bindValue)})}},h={row:`${dg["smp-filter-row"]}`};return V.jsxs("div",{className:h.row,children:[!i&&V.jsx(im,{bindValue:t.field.obj.k,options:n.map(f=>({obj:{t:"",p:"",k:f?.obj?.k||""},decode:f.decode,shape:void 0})),onChange:f=>o(f.bindValue),ListDescrMode:zv.BOTH,DescrMode:zv.CODE_ONLY,isEditable:!0}),V.jsx(im,{bindValue:t.operator?.obj.k,options:s[t.columnsType],onChange:f=>l(f.bindValue),ListDescrMode:zv.BOTH,DescrMode:zv.CODE_ONLY,isEditable:!0},t.columnsType),u(),V.jsx(lr,{bindValue:"",ShowText:!1,label:"Delete",onClick:r,appearance:"ghost",variant:"base",icon:"delete"})]})},vq=({group:t,onChange:e,onDelete:r,onClose:n,level:i=0,fieldOptions:a,hasSubGroups:s=!0,hasSubFilters:o=!0,currentColumnName:l,hasButtonGroup:c=!0})=>{const{translate:u}=Ta(),h=(v,y)=>{const x=[...t.filters];x[v]=y,e({...t,filters:x})},f=v=>{const y=[...t.filters];y.splice(v,1),e({...t,filters:y})},d=()=>{const v=a[0],y={...v_},x={field:v,columnsType:v?.type||"string",operator:y,value:""};e({...t,filters:[...t.filters,x]})},p=()=>{let v;if(l){const x=a.find(w=>w.obj?.k===l),b={...v_};v={field:x||a[0]||"",columnsType:x?.type||a[0]?.type||"string",operator:b,value:""}}else{const x={...v_};v={field:a[0]||"",columnsType:a[0]?.type||"string",operator:x,value:""}}const y={logic:"and",filters:[v]};e({...t,filters:[...t.filters,y]})},g=v=>{e({...t,logic:v})},m={filterGroup:`${dg["smp-filter-group"]}`,filterToolbar:`${dg["smp-filter-toolbar"]}`,filterList:`${dg["smp-filter-list"]}`,actionButtons:`${dg["smp-filter-actionButtons"]}`};return V.jsxs("div",{className:m.filterGroup,style:i!=0?{marginLeft:20}:void 0,"data-component":i===0?"filter":void 0,children:[V.jsxs("div",{className:m.filterToolbar,children:[c&&V.jsx(rq,{options:[{shape:void 0,decode:"AND",obj:{t:"",p:"",k:"and"}},{shape:void 0,decode:"OR",obj:{t:"",p:"",k:"or"}}],bindValue:t.logic,onChange:v=>g(v.bindValue)}),V.jsxs("div",{className:m.actionButtons,children:[o&&V.jsx(lr,{onClick:d,bindValue:u(gs.ADD_FILTER),icon:"plus",appearance:"outlined",variant:"base"}),s&&V.jsx(lr,{onClick:p,bindValue:u(gs.ADD_SUB_GROUP),icon:"plus",appearance:"outlined",variant:"base"}),r&&V.jsx(lr,{bindValue:"",ShowText:!1,label:"Delete",onClick:r,appearance:"outlined",variant:"base",icon:"delete"}),n&&V.jsx(lr,{bindValue:u(Ha.CLOSE),ShowText:!0,label:"Delete",onClick:n,icon:"close",appearance:"outlined",variant:"base"})]})]}),V.jsx("div",{className:m.filterList,children:t.filters.map((v,y)=>({filter:v,index:y})).filter(({filter:v})=>l?"logic"in v?v.filters.some(y=>"logic"in y?!1:y.field?.obj?.k===l):v.field?.obj?.k===l:!0).map(({filter:v,index:y})=>"logic"in v?V.jsx(vq,{group:v,onChange:x=>h(y,x),onDelete:()=>f(y),level:i+1,fieldOptions:a,hasSubGroups:!1,hasSubFilters:!0,currentColumnName:l,hasButtonGroup:!0},y):V.jsx(Fde,{filter:v,onChange:x=>h(y,x),onDelete:()=>f(y),fieldOptions:a,hasCurrentColumn:!!l},y))})]})},cN=({filters:t,onChange:e,fieldOptions:r,hasSubGroups:n,hasSubFilters:i,ref:a,currentColumnName:s,hasButtonGroup:o,onClose:l})=>{const c={filterWrapper:`${dg["smp-filter-wrapper"]}`};return V.jsx("div",{onClick:u=>{u.stopPropagation()},"aria-hidden":"true",children:V.jsx("div",{className:c.filterWrapper,ref:a,children:V.jsx(vq,{group:t,onChange:e,fieldOptions:r,hasSubFilters:i,hasSubGroups:n,currentColumnName:s,hasButtonGroup:o,onClose:l})})})},$de={"smp-groupBar-container":"_smp-groupBar-container_hxnfs_1"},zde=({groups:t=[],isDraggable:e=!0,isEditable:r=!0,onChange:n,onDrop:i,onDragOver:a})=>{const s=t.map(o=>({bindValue:o.column}));return V.jsxs("th",{className:$de["smp-groupBar-container"],onDragOver:a,onDrop:i,children:[V.jsx(Dr,{icon:"groups"}),V.jsx(G3,{elements:s,isEditable:r,isDraggable:e,DescrMode:"CodeOnly",onChange:n})]})},Ef={"smp-headerCell":"_smp-headerCell_laepr_1","smp-headerCell-container":"_smp-headerCell-container_laepr_9","smp-headerCell-iconNotification":"_smp-headerCell-iconNotification_laepr_16","smp-resizer":"_smp-resizer_laepr_34","smp-datatable-toolbar":"_smp-datatable-toolbar_laepr_52","smp-datatable-filter":"_smp-datatable-filter_laepr_53"},Vde=({columns:t,columnWidths:e,groups:r,showGroupBar:n,showFilter:i,filterColumn:a,activeFilters:s,fieldOptions:o,Filter:l,enableSelection:c,allVisibleRowsSelected:u,sortBy:h,sortOrder:f,onToggleFilter:d,onToggleColumnFilter:p,onFiltersChange:g,onResetFilters:m,onGroupChange:v,onGroupDrop:y,onGroupDragOver:x,onMouseDown:b,onToggleAllRows:w,onSort:_,onDragStart:S,onDragOver:C,onDrop:T})=>{const A=Q.useRef({}),{anchorRef:k,targetRef:I}=Ro({position:"bottom",open:i}),{anchorRef:E,targetRef:M}=Ro({position:"bottom",open:a!==null}),R=Q.useCallback(P=>Dde(P,s),[s]),D=Q.useMemo(()=>Mde(s),[s]),L={headerCell:`${Ef["smp-headerCell"]}`,headerCellContainer:`${Ef["smp-headerCell-container"]}`,resizer:`${Ef["smp-resizer"]}`,datatableToolbar:`${Ef["smp-datatable-toolbar"]} ${Ef["smp-headerCell-"]}`,datatableFilter:`${Ef["smp-datatable-filter"]}`};return V.jsxs("thead",{children:[V.jsxs("tr",{className:L.datatableToolbar,children:[V.jsx("th",{children:V.jsxs("div",{ref:k,className:L.datatableFilter,children:[V.jsx(lr,{onClick:d,bindValue:`${D}`,label:i?"Nascondi filtri":"Mostra filtri",icon:"filter_list",variant:"base"}),(l||D>0)&&V.jsx(V.Fragment,{children:V.jsx(lr,{onClick:m,bindValue:"Reset",icon:"cancel",appearance:"ghost",variant:"base",label:"Rimuovi tutti i filtri"})})]})}),(r||n)&&V.jsx(zde,{groups:r,onChange:v,onDrop:y,onDragOver:x})]}),i&&V.jsx(Po,{children:V.jsx(cN,{filters:s,fieldOptions:o,onChange:g,hasSubGroups:!0,ref:I,hasSubFilters:!1,onClose:d})}),V.jsxs("tr",{children:[c&&V.jsx("th",{className:L.headerCell,style:{minWidth:40,justifyContent:"center"},children:V.jsx(H3,{bindValue:u,onChange:w})}),t&&t?.map(P=>P.visible&&V.jsx("th",{tabIndex:0,role:"columnheader",onClick:()=>_(P.name),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),_(P.name))},onDragStart:()=>S(P.name),onDragOver:C,onDrop:()=>T(P.name),className:L.headerCell,style:{width:e[P.name],minWidth:e[P.name],maxWidth:e[P.name]},ref:O=>{A.current[P.name]=O,a===P.name&&O&&(typeof E=="function"?E(O):E&&"current"in E&&(E.current=O))},children:V.jsxs("div",{draggable:!0,onDragStart:O=>{O.dataTransfer.setData("text/plain",P.name)},className:L.headerCellContainer,children:[V.jsx(jn,{variant:"title",bindValue:P.title}),V.jsxs("div",{children:[h===P.name?V.jsx(Dr,{icon:f==="asc"?"arrow-up":"arrow-down",isInteractable:!0}):V.jsx("span",{style:{minWidth:"0.875rem",minHeight:"0.875rem"}}),V.jsx("span",{className:`${R(P.name)?Ef["smp-headerCell-iconNotification"]:""}`,children:V.jsx(Dr,{icon:"filter_list",onClick:O=>{p(P.name),O.stopPropagation()},tabIndex:0,isInteractable:!0})})]}),a===P.name&&V.jsx(Po,{children:V.jsx(cN,{filters:s,fieldOptions:o.filter(O=>O.obj?.k===a),onChange:g,hasSubGroups:!0,ref:M,hasSubFilters:!1,currentColumnName:a,hasButtonGroup:!1,onClose:()=>p(P.name)})}),V.jsx("div",{className:L.resizer,onMouseDown:O=>{b(O,P.name)},role:"region"})]})},P.name))]})]})},Ude=t=>({DftGroup:cde(t.groups),expandedGroups:t.expandedGroups}),jde=t=>({groups:dq(t.DftGroup),expandedGroups:t.expandedGroups??new Set}),Hde=({imperativeHandle:t,data:e,lineHeight:r=28,TableHeight:n=sN,decimalSeparator:i=".",DftGroup:a,expandedGroups:s,columnSizingMode:o="fit-content",ShowGroup:l="Yes",Filter:c,MultiSelect:u="No",Columns:h,onRowClick:f,onMultiSelectionChange:d,onContextMenu:p,onStateChange:g,DftTotal:m})=>{const[v]=Q.useState(ude(m||"")),[y,x]=Q.useState(()=>e?{columns:h?Bde(e,Ode(h)):e.columns,rows:e.rows??[]}:{columns:[],rows:[]}),[b,w]=Q.useState(dq(a)),[_,S]=Q.useState(s??new Set),[C,T]=Q.useState(!1),[A,k]=Q.useState(new Set),[I,E]=Q.useState(null),M=Q.useMemo(()=>xde(e?.columns||[]),[e?.columns]),[R,D]=Q.useState(()=>oN(c,M));Q.useEffect(()=>{g?.(Ude({groups:b,expandedGroups:_}))},[g,b,_]),Q.useImperativeHandle(t,()=>({setState:Ee=>{const pe=jde(Ee);w(pe.groups),S(pe.expandedGroups)}}),[]);const L=Q.useRef(null),[P,O]=fde({columns:y?.columns??[],rows:y?.rows??[],containerRef:L,sizingMode:o}),{handleDragStart:$,handleDragOver:N,handleDrop:U}=Lde(y.columns,Ee=>x(pe=>({...pe,columns:Ee}))),{sortBy:j,sortOrder:B,handleSort:q}=Pde({...y,rows:y.rows},i),W=Q.useMemo(()=>{let Ee=e?.rows??[];R?.filters?.length>0&&(Ee=Cde(Ee,R));let pe=Ee;j&&(pe=mq({...e??{columns:[],rows:[]},rows:Ee},j,B,i).rows);let Ve=pe;if(b?.length&&pe.length>0){const{flatRows:qe}=hde(pe,b,r,_,v);Ve=qe}return Ve},[e,R,j,b,B,i,r,_,v]),X=Q.useMemo(()=>typeof n=="number"?n:typeof n=="string"&&_S(n)?aN(n):aN(sN),[n]),{virtualItems:K,containerProps:G,innerProps:H}=HW({items:W,itemHeight:r,containerHeight:X,overscan:5}),Y=Q.useMemo(()=>{const Ee=W.map((pe,Ve)=>Ve);return Ee.every(pe=>A.has(pe))&&Ee.length>0},[A,W]);Q.useEffect(()=>{if(Yr(u)&&d){const Ee=Array.from(A).map(pe=>W[pe]).filter(Boolean);d(Ee)}},[A,u,W,d]);const J=Q.useCallback(Ee=>{D(Ee)},[]),ie=Q.useCallback(()=>{D(oN(c,M))},[c,M]),me=Q.useCallback(()=>{T(Ee=>!Ee)},[]),oe=Q.useCallback(Ee=>{E(pe=>pe===Ee?null:Ee)},[]),ne=Ee=>{w(lde(Ee,b))},de=Ee=>{Ee.preventDefault();const pe=Ee.dataTransfer.getData("text/plain");if(!pe||b.some(tt=>tt.column===pe))return;const qe=[...b,{column:pe,visible:!0}];w(qe)},ve=Ee=>{Ee.preventDefault()},Ne=(Ee,pe)=>{const Ve=Ee.clientX,qe=P[pe],tt=Ot=>{const Ea=Ot.clientX-Ve,xr=Math.max(50,qe+Ea);O(Js=>({...Js,[pe]:xr}))},_t=()=>{window.removeEventListener("mousemove",tt),window.removeEventListener("mouseup",_t)};window.addEventListener("mousemove",tt),window.addEventListener("mouseup",_t)},ke=Ee=>{k(pe=>{const Ve=new Set(pe);return Ee.every(tt=>Ve.has(tt))?Ee.forEach(tt=>Ve.delete(tt)):Ee.forEach(tt=>Ve.add(tt)),Ve})},Le=()=>{const Ee=y.rows.map((pe,Ve)=>Ve);ke(Ee)},$e={smpTable:`${sde["smp-table"]}`};return y&&V.jsx("div",{className:$e.smpTable,...G,ref:L,children:V.jsxs("table",{children:[V.jsx(Vde,{columns:y.columns,columnWidths:P,groups:b,showGroupBar:Yr(l),showFilter:C,filterColumn:I,activeFilters:R,fieldOptions:M,Filter:c,enableSelection:Yr(u),allVisibleRowsSelected:Y,sortBy:j,sortOrder:B,onToggleFilter:me,onToggleColumnFilter:oe,onFiltersChange:J,onResetFilters:ie,onGroupChange:ne,onGroupDrop:de,onGroupDragOver:ve,onMouseDown:Ne,onToggleAllRows:Le,onSort:q,onDragStart:$,onDragOver:N,onDrop:U}),V.jsx("tbody",{...H,children:K.map(({item:Ee,index:pe,offsetTop:Ve})=>Ee.isGroup?V.jsx(Nde,{label:Ee.value||"",rowHeight:r,offsetTop:Ve,level:Ee.level,cells:Ee.cells,columns:y.columns,columnWidths:P,onClick:()=>{const qe=Ee.id;qe&&S(tt=>ode(tt,qe))},isExpanded:Ee.isExpanded},pe):V.jsx(DI,{row:Ee,columns:y.columns,columnWidths:P,rowHeight:r,offsetTop:Ve,decimalSeparator:i,isGroup:!1,enableSelection:Yr(u),isSelected:A.has(pe),onToggleSelect:()=>{ke([pe])},onRowClick:f,onContextMenu:p},pe))}),V.jsx(Rde,{columns:y.columns,columnWidths:P,totals:v,rows:W,hasGroups:!!b?.length})]})})},f2={"smp-drawer":"_smp-drawer_1h5dq_1","smp-drawer-container-header":"_smp-drawer-container-header_1h5dq_22","smp-drawer-container-layout":"_smp-drawer-container-layout_1h5dq_27","smp-drawer-overlay":"_smp-drawer-overlay_1h5dq_58"},Gde=(t,e,r)=>t?!r||e?!0:t.shape===Ke.BUTTON||t.shape===Ke.BUTTON_LIST:!1,yq=Q.createContext(void 0),xq=()=>{const t=Q.useContext(yq);if(!t)throw new Error("useScaffold must be used inside ScaffoldProvider");return t},Wde=({data:t,onClick:e,onEnter:r,loadOptions:n,onContextMenu:i,onOpen:a})=>{const{isAppBarEnabled:s,isDrawerOpen:o,toggleDrawer:l,isSideBarEnabled:c}=xq(),[u,h]=Q.useState({}),f=Q.useCallback(p=>{if(!p?.rows?.length||!p?.columns?.length)return{};const g=p.rows[0];return p.columns.filter(m=>m.visible??!0).reduce((m,v)=>{const y=g.cells?.[v.name];if(!Gde(y,o,c??!1))return m;const x={...y,id:v.name,onOptionsRequest:n,onChange:b=>{h(w=>{const _={...w};return _?.[v.name]&&(_[v.name].obj.k=b.obj.k),_})},onClick:(b,w)=>w.fun&&e?.(w),onEnter:b=>r?.(b),onContextMenu:(b,w)=>i?.(b,w)};return Yr(c)&&(x.data={...x.data,ShowText:o,variant:"base",justify:"center",FullWidth:"Yes"}),{...m,[v.name]:x}},{})},[n,e,i,r,o,c]);if(Q.useEffect(()=>{if(o){const p=a?.();h(f(p||t))}else h(f(t))},[o,a,t,f]),!t?.rows?.length||!t.columns?.length)return null;const d={drawer:f2["smp-drawer"],headerContainer:f2["smp-drawer-container-header"],layoutContainer:f2["smp-drawer-container-layout"],overlay:f2["smp-drawer-overlay"]};if(u){const p=V.jsxs("aside",{className:d.drawer,"aria-label":"Drawer","data-component":"drawer","data-drawer-minified-on-close":c,"data-drawer-expanded":o,"smp-id":"drawer",children:[(!c||!s)&&V.jsx("div",{className:d.headerContainer,children:V.jsx(lr,{bindValue:"",BtnTit:o?"Collapse":"Expand",variant:"base",icon:o?"menu_close":"menu",justify:"end",ShowText:!1,onClick:()=>{l?.()},FullWidth:!0})}),V.jsx("div",{className:d.layoutContainer,children:V.jsx(Zy,{layout:t.rows[0].layout,children:Object.values(u).map(g=>V.jsx(Mo,{...g}))})})]});return c?V.jsx(V.Fragment,{children:p}):V.jsx(bS,{open:o,position:"left",isModal:!0,closeOnClickOutside:!0,onClose:()=>{l?.()},className:d.overlay,children:p})}},uN={"smp-field-container":"_smp-field-container_1y69b_1"},qde=({data:t,Type:e,ShowSubmit:r=!1,SubmitPosition:n="Right",DefaultValue:i,Label:a,LabelPosition:s="Left",Helper:o,SelFirst:l,SelectRow:c,Ext:u,advanceResearchAutoSelect:h,onChange:f,onClick:d,onOptionsRequest:p,onUploadRequest:g,onAdvanceResearchLoadInitialData:m,onAdvanceResearchLeafNodeClick:v})=>{const[y,x]=Q.useState(),b=Q.useRef(void 0);Q.useEffect(()=>{x(()=>{if(!t)return;const A={...t};return e&&(A.shape=e.toLocaleUpperCase()),i&&(A.obj=vhe(i)),u&&(A.data={...A.data,...q7(u)}),A.isEditable==null&&(A.isEditable=!0),A.shape=AI(A.obj,A.shape,A.data?.size)||Ke.TEXT_FIELD,b.current=A,A})},[t,i,u,e]);const w=A=>{b.current?.obj?.k!=A.obj?.k&&(f?.(A),b.current=A)},_=Yr(r)?`${uN["smp-field-position"]}-${n}`:"",S={container:`${uN["smp-field-container"]} ${_}`},C=l=="Yes"||l==!0,T=c?parseInt(c)-1:void 0;if(y)return V.jsx(Vm.Provider,{value:{onAdvanceResearchLoadInitialData:m,onAdvanceResearchLeafNodeClick:v,advanceResearchAutoSelect:h},children:V.jsxs("div",{className:S.container,children:[V.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:V.jsx(Mo,{...y,id:"FLD",onChange:x,onOptionsRequest:p,onConfirmedChange:w,onEnter:A=>d?.(A),onBlur:w,onUploadRequest:g,label:a,labelPosition:s,helper:o,autoSelectOptionIndex:C?0:T||void 0})}),Yr(r)&&V.jsx(lr,{optionalDisplayValue:"Confirm",onClick:()=>d?.(y),bindValue:"Confirm"})]})})},tT="command-submit",a8=(t,e)=>({before:t,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(t.columns)),rows:[{cells:JSON.parse(JSON.stringify(e)),id:"1"}]}}),Xde=(t,e)=>{const r=[...e];return{cells:Object.fromEntries(Object.entries(t).map(([i,a])=>{if(a?.data?.mappedCommandId){const s=r.findIndex(o=>o.obj?.k===a?.data?.mappedCommandId);if(s!==-1){const[o]=r.splice(s,1),l={...a.data},c={...a,fun:o.fun,data:l,obj:{t:a.obj?.t||"",p:a.obj?.p||"",k:a.data.mappedCommandId}};return[i,c]}}return[i,a]})),remainingCommands:r}},hN=(t,e,r)=>{if(!t.rows?.length||!t.columns?.length)return{state:{},commandState:[]};const n=t.rows[0],i=Xde(n.cells??{},t.setup?.commands?[...t.setup.commands]:[]);return{state:t.columns.reduce((s,o)=>{const l=i.cells[o.name]??n.cells?.[o.name],c=AI(l.obj,l.shape,l.data?.size),u={...l,id:o.name,label:o.title,dSep:e,shape:c||Ke.TEXT_FIELD,helper:o.helper,data:{...l.data,dSep:e}};return u.isEditable==null&&(u.isEditable=!0),r&&(u.isEditable=!1),{...s,[o.name]:u}},{}),commandState:i.remainingCommands??[]}},Yde=t=>{const r=[];return t.filter(n=>n.visible==!0||n.visible==null).forEach(n=>{r.push({id:n.name,content:[{id:n.name}]})}),{horizontal:!0,inline:!0,sections:r}},Kde=t=>t==Ke.CHECKBOX||t==Ke.SWITCH||t==Ke.RADIO||t==Ke.BUTTON_GROUP||t==Ke.SELECT,s8={"smp-form":"_smp-form_tncm5_1","smp-form-commands":"_smp-form-commands_tncm5_34","smp-form-content":"_smp-form-content_tncm5_38"},Zde=Q.forwardRef(({data:t,id:e,disabled:r=!1,SubmitButton:n="Yes",ShowButtons:i,UpdateOnClick:a="No",decimalSeparator:s=".",AutoFocus:o="No",AutoSkip:l="No",Position:c="COLUMNS",advanceResearchAutoSelect:u,optionsHandler:h,onSubmit:f,onCheck:d,onCheckObj:p,onContextMenu:g,onButtonClick:m,onAdvanceResearchLeafNodeClick:v,onUploadRequest:y,onAdvanceResearchLoadInitialData:x,onSaveTemporaryComponentState:b,onMountComponent:w,onObjectProtocol:_},S)=>{const C=Q.useRef(!1),T=Q.useRef([]),{state:A,commandState:k}=hN(t,s,r),[I,E]=Q.useState(A),[M,R]=Q.useState(k),{translate:D}=Ta(),L=Q.useId(),P=Q.useRef(null),O=Q.useRef(A),$=Q.useRef(!1),N=Q.useRef(!1);Q.useImperativeHandle(S,()=>({setState:oe=>{$.current=!0,E(oe)}}),[]);const U=Q.useRef(!1);Q.useEffect(()=>{if(!U.current&&w){U.current=!0;const oe=w();oe&&E(JSON.parse(oe))}},[]);const j=Q.useRef(b);Q.useEffect(()=>{j.current=b},[b]),Q.useEffect(()=>()=>{j.current&&!$.current&&!N.current&&j.current(JSON.stringify(O.current))},[]),Q.useEffect(()=>{const oe=P.current;if(!oe)return;const ne=de=>{q(de.detail.id)};return oe.addEventListener(tT,ne),()=>{oe.removeEventListener(tT,ne)}},[]),Q.useEffect(()=>{if($.current=!1,N.current=!0,C.current){const ne=hN(t,s,r);E(ne.state),R(ne.commandState)}else C.current=!0,P.current&&P.current.querySelectorAll('[type="text"]').forEach(de=>{de instanceof HTMLInputElement&&T.current.push(de)});const oe=setTimeout(()=>{N.current=!1},100);return()=>{clearTimeout(oe)}},[t]),Q.useEffect(()=>{Yr(o)&&P.current&&T.current.length>0&&T.current[0].focus()},[o]),Q.useEffect(()=>{O.current=I},[I]);const B=(oe,ne)=>{if($.current=!1,E(de=>({...de,[oe]:{...de[oe],obj:{t:de[oe].obj?.t||"",p:de[oe].obj?.p||"",k:ne.obj?.k||""},decode:ne.decode,data:{...de[oe].data,error:void 0},value:ne.obj?.k}})),Yr(a)&&(ne.shape==Ke.CHECKBOX||ne.shape==Ke.SWITCH||ne.shape==Ke.RADIO)){const de=structuredClone(I);de[oe].obj.k=ne.obj.k,de[oe].value=ne.obj.k,f({value:a8(t,de)})}if(Yr(l)&&ne.data?.maxLength&&ne.data.maxLength<=ne.obj.k.length){const de=T.current.findIndex(ve=>ve.name==oe);de<T.current.length-1&&T.current[de+1].focus()}},q=oe=>{const ne=a8(t,I);f({value:ne,cell:oe})},W=(oe,ne)=>{m?.({cellId:oe,currentState:{type:"SmeupDataTable",columns:t.columns,rows:[{cells:I,id:"1"}]},fun:ne||""})},X=async(oe,ne)=>{if(ne.obj?.k!=t.rows[0].cells?.[oe].obj?.k&&(t.rows[0].cells?.[oe].inputSettings?.checkObject&&p&&((await p({obj:ne.obj,fun:ne.fun,cellId:oe})).valid||E(ve=>({...ve,[oe]:{...ve[oe],data:{...ve[oe].data,error:D(Ha.CHECK_OBJECT_WRONG_VALIDATION)}}}))),t.rows[0].cells?.[oe].inputSettings?.checkValueOnExit)){const de=structuredClone(I);de[oe]={id:oe,...ne},de[oe].value=de[oe].obj?.k;const ve=a8(t,de);d?.({value:ve,cell:oe})}},K=(oe,ne)=>{Kde(I[oe].shape)&&X(oe,ne)},G=M?.map((oe,ne)=>Q.createElement(Mo,{...oe,decode:oe.value,data:{BtnTxt:oe.value},id:`command-${ne}`,key:`command-${ne}`,shape:Ke.BUTTON,onClick:()=>q(oe.obj?.k)}))||[];Yr(n)&&G.unshift(V.jsx(Mo,{decode:D(Ha.CONFIRM_BUTTON),shape:Ke.BUTTON,icon:"check",id:"",obj:{t:"",p:"",k:""},data:{submit:!0,BtnTxt:D(Ha.CONFIRM_BUTTON),BtnTit:D(Ha.CONFIRM_BUTTON)}},"submit-command"));const H={smpForm:`${s8["smp-form"]}`,smpFormCommands:`${s8["smp-form-commands"]}`,smpFormContent:`${s8["smp-form-content"]}`},Y=()=>i==="LEFT"||i==="RIGHT"?{sections:G.map((oe,ne)=>({id:`cmd-${ne}`,horizontal:!1,content:[{id:oe.props.id}]}))}:{sections:[{id:"1",horizontal:!0,justify:"start",content:G.map(oe=>({id:oe.props.id}))}]},J=G.length>0&&V.jsx("div",{className:H.smpFormCommands,children:V.jsx(Zy,{layout:Y(),children:G})}),ie=()=>c==="INLINE"||c==="UPINLINE"?Yde(t.columns):t.rows[0].layout,me=async(oe,ne,de)=>(b&&b(JSON.stringify(I)),x?await x(oe,ne,de):{type:"SmeupDataTree",nodes:[]});return V.jsx(Vm.Provider,{value:{onAdvanceResearchLoadInitialData:me,onAdvanceResearchLeafNodeClick:v,advanceResearchAutoSelect:u},children:I&&V.jsxs("form",{"data-component":"input-panel",className:H.smpForm,"data-command-position":i||"BOTTOM",id:e||L,onSubmit:oe=>{oe.preventDefault(),q()},ref:P,role:"form",children:[t.rows?.length>0&&V.jsx("div",{className:H.smpFormContent,children:V.jsx(Zy,{layout:ie(),columns:t.columns.reduce((oe,ne)=>({...oe,[ne.name]:ne}),{}),children:Object.values(I).map(oe=>V.jsx(Mo,{...oe,onOptionsRequest:oe.fun?async(ne,de)=>await h(ne,de,{type:"SmeupDataTable",columns:t.columns,rows:[{cells:I,id:"1"}]},oe.id):void 0,onChange:ne=>B(oe.id,ne),onBlur:ne=>X(oe.id,ne),onConfirmedChange:ne=>K(oe.id,ne),onContextMenu:g,onObjectProtocol:_,onClick:()=>{(oe.shape=="BTN"||oe.shape=="CFM")&&(oe.fun?W(oe.id,oe.fun):oe.data?.mappedCommandId&&q(oe.obj?.k))},data:{...oe.data,autocomplete:"off"},onUploadRequest:y}))})}),J]})})}),Jde=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Wd=[.001,0,0,.001,0,0],_u=1.35,SS=.35,fN=SS/_u,Ba={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},bq="pdfjs_internal_editor_",Ml={FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},dN={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},cd={TRIANGLES:1,LATTICE:2,PATCH:3},wq={FILL:0,ADD_TO_PATH_FLAG:4},Ii={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},wi={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},rT={GROUP:"Group",REPLY:"R"},Qn={INVISIBLE:1,HIDDEN:2,PRINT:4,NOROTATE:16,NOVIEW:32,LOCKED:128,LOCKEDCONTENTS:512},nl={READONLY:1,REQUIRED:2,MULTILINE:4096,PASSWORD:8192,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,FILESELECT:1048576,MULTISELECT:2097152,DONOTSCROLL:8388608,COMB:16777216},pp={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},_q={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},Qde={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},e0e={O:"PageOpen",C:"PageClose"},Jy={WARNINGS:1,INFOS:5},Z={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},qr={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},pN={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let W3=Jy.WARNINGS;function t0e(t){Number.isInteger(t)&&(W3=t)}function r0e(){return W3}function Ht(t){W3>=Jy.INFOS&&console.info(`Info: ${t}`)}function ee(t){W3>=Jy.WARNINGS&&console.warn(`Warning: ${t}`)}function tr(t){throw new Error(t)}function Ir(t,e){t||tr(e)}function n0e(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function CS(t,e=null,r=null){if(!t)return null;if(r&&typeof t=="string"&&(r.addDefaultProtocol&&t.startsWith("www.")&&t.match(/\./g)?.length>=2&&(t=`http://${t}`),r.tryConvertEncoding))try{t=sm(t)}catch{}const n=e?URL.parse(t,e):URL.parse(t);return n0e(n)?n:null}function Te(t,e,r,n=!1){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!0,writable:!1}),r}const ss=(function(){function e(r,n){this.message=r,this.name=n}return e.prototype=new Error,e.constructor=e,e})();let am=class extends ss{constructor(e,r){super(e,"PasswordException"),this.code=r}},o8=class extends ss{constructor(e,r){super(e,"UnknownErrorException"),this.details=r}},Qy=class extends ss{constructor(e){super(e,"InvalidPDFException")}},gN=class extends ss{constructor(e,r,n){super(e,"ResponseException"),this.status=r,this.missing=n}},fe=class extends ss{constructor(e){super(e,"FormatError")}},Zi=class extends ss{constructor(e){super(e,"AbortException")}};function As(t){(typeof t!="object"||t?.length===void 0)&&tr("Invalid argument for bytesToString");const e=t.length,r=8192;if(e<r)return String.fromCharCode.apply(null,t);const n=[];for(let i=0;i<e;i+=r){const a=Math.min(i+r,e),s=t.subarray(i,a);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function na(t){typeof t!="string"&&tr("Invalid argument for stringToBytes");const e=t.length,r=new Uint8Array(e);for(let n=0;n<e;++n)r[n]=t.charCodeAt(n)&255;return r}function ea(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function MI(t){return Object.keys(t).length}function i0e(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function a0e(){try{return new Function(""),!0}catch{return!1}}class oa{static get isLittleEndian(){return Te(this,"isLittleEndian",i0e())}static get isEvalSupported(){return Te(this,"isEvalSupported",a0e())}static get isOffscreenCanvasSupported(){return Te(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Te(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Te(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Te(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:r}=navigator;return Te(this,"platform",{isAndroid:r.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:r.includes("Firefox")})}static get isCSSRoundSupported(){return Te(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Lg=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));let mr=class{static makeHexColor(e,r,n){return`#${Lg[e]}${Lg[r]}${Lg[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,r){let n;e[0]?(e[0]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=e[0],r[2]*=e[0],e[3]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=e[3],r[3]*=e[3]):(n=r[0],r[0]=r[1],r[1]=n,n=r[2],r[2]=r[3],r[3]=n,e[1]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=e[1],r[3]*=e[1],e[2]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=e[2],r[2]*=e[2]),r[0]+=e[4],r[1]+=e[5],r[2]+=e[4],r[3]+=e[5]}static transform(e,r){return[e[0]*r[0]+e[2]*r[1],e[1]*r[0]+e[3]*r[1],e[0]*r[2]+e[2]*r[3],e[1]*r[2]+e[3]*r[3],e[0]*r[4]+e[2]*r[5]+e[4],e[1]*r[4]+e[3]*r[5]+e[5]]}static multiplyByDOMMatrix(e,r){return[e[0]*r.a+e[2]*r.b,e[1]*r.a+e[3]*r.b,e[0]*r.c+e[2]*r.d,e[1]*r.c+e[3]*r.d,e[0]*r.e+e[2]*r.f+e[4],e[1]*r.e+e[3]*r.f+e[5]]}static applyTransform(e,r,n=0){const i=e[n],a=e[n+1];e[n]=i*r[0]+a*r[2]+r[4],e[n+1]=i*r[1]+a*r[3]+r[5]}static applyTransformToBezier(e,r,n=0){const i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5];for(let u=0;u<6;u+=2){const h=e[n+u],f=e[n+u+1];e[n+u]=h*i+f*s+l,e[n+u+1]=h*a+f*o+c}}static applyInverseTransform(e,r){const n=e[0],i=e[1],a=r[0]*r[3]-r[1]*r[2];e[0]=(n*r[3]-i*r[2]+r[2]*r[5]-r[4]*r[3])/a,e[1]=(-n*r[1]+i*r[0]+r[4]*r[1]-r[5]*r[0])/a}static axialAlignedBoundingBox(e,r,n){const i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5],u=e[0],h=e[1],f=e[2],d=e[3];let p=i*u+l,g=p,m=i*f+l,v=m,y=o*h+c,x=y,b=o*d+c,w=b;if(a!==0||s!==0){const _=a*u,S=a*f,C=s*h,T=s*d;p+=C,v+=C,m+=T,g+=T,y+=_,w+=_,b+=S,x+=S}n[0]=Math.min(n[0],p,m,g,v),n[1]=Math.min(n[1],y,b,x,w),n[2]=Math.max(n[2],p,m,g,v),n[3]=Math.max(n[3],y,b,x,w)}static inverseTransform(e){const r=e[0]*e[3]-e[1]*e[2];return[e[3]/r,-e[1]/r,-e[2]/r,e[0]/r,(e[2]*e[5]-e[4]*e[3])/r,(e[4]*e[1]-e[5]*e[0])/r]}static singularValueDecompose2dScale(e,r){const n=e[0],i=e[1],a=e[2],s=e[3],o=n**2+i**2,l=n*a+i*s,c=a**2+s**2,u=(o+c)/2,h=Math.sqrt(u**2-(o*c-l**2));r[0]=Math.sqrt(u+h||1),r[1]=Math.sqrt(u-h||1)}static normalizeRect(e){const r=e.slice(0);return e[0]>e[2]&&(r[0]=e[2],r[2]=e[0]),e[1]>e[3]&&(r[1]=e[3],r[3]=e[1]),r}static intersect(e,r){const n=Math.max(Math.min(e[0],e[2]),Math.min(r[0],r[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(r[0],r[2]));if(n>i)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(r[1],r[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(r[1],r[3]));return a>s?null:[n,a,i,s]}static pointBoundingBox(e,r,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],r),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],r)}static rectBoundingBox(e,r,n,i,a){a[0]=Math.min(a[0],e,n),a[1]=Math.min(a[1],r,i),a[2]=Math.max(a[2],e,n),a[3]=Math.max(a[3],r,i)}static#e(e,r,n,i,a,s,o,l,c,u){if(c<=0||c>=1)return;const h=1-c,f=c*c,d=f*c,p=h*(h*(h*e+3*c*r)+3*f*n)+d*i,g=h*(h*(h*a+3*c*s)+3*f*o)+d*l;u[0]=Math.min(u[0],p),u[1]=Math.min(u[1],g),u[2]=Math.max(u[2],p),u[3]=Math.max(u[3],g)}static#t(e,r,n,i,a,s,o,l,c,u,h,f){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&this.#e(e,r,n,i,a,s,o,l,-h/u,f);return}const d=u**2-4*h*c;if(d<0)return;const p=Math.sqrt(d),g=2*c;this.#e(e,r,n,i,a,s,o,l,(-u+p)/g,f),this.#e(e,r,n,i,a,s,o,l,(-u-p)/g,f)}static bezierBoundingBox(e,r,n,i,a,s,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],r,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],r,l),this.#t(e,n,a,o,r,i,s,l,3*(-e+3*(n-a)+o),6*(e-2*n+a),3*(n-e),c),this.#t(e,n,a,o,r,i,s,l,3*(-r+3*(i-s)+l),6*(r-2*i+s),3*(i-r),c)}};const s0e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function qt(t,e=!1){if(t[0]>="ï"){let n;if(t[0]==="þ"&&t[1]==="ÿ"?(n="utf-16be",t.length%2===1&&(t=t.slice(0,-1))):t[0]==="ÿ"&&t[1]==="þ"?(n="utf-16le",t.length%2===1&&(t=t.slice(0,-1))):t[0]==="ï"&&t[1]==="»"&&t[2]==="¿"&&(n="utf-8"),n)try{const i=new TextDecoder(n,{fatal:!0}),a=na(t),s=i.decode(a);return e||!s.includes("\x1B")?s:s.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,"")}catch(i){ee(`stringToPDFString: "${i}".`)}}const r=[];for(let n=0,i=t.length;n<i;n++){const a=t.charCodeAt(n);if(!e&&a===27){for(;++n<i&&t.charCodeAt(n)!==27;);continue}const s=s0e[a];r.push(s?String.fromCharCode(s):t.charAt(n))}return r.join("")}function sm(t){return decodeURIComponent(escape(t))}function nT(t){return unescape(encodeURIComponent(t))}function ex(t,e){if(t.length!==e.length)return!1;for(let r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Qh(t=new Date){return t instanceof Date||(t=new Date(t)),[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")}let l8=null,mN=null;function o0e(t){return l8||(l8=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,mN=new Map([["ſt","ſt"]])),t.replaceAll(l8,(e,r,n)=>r?r.normalize("NFKC"):mN.get(n))}const l0e="pdfjs_internal_id_";function c0e(t,e,r){if(!Array.isArray(r)||r.length<2)return!1;const[n,i,...a]=r;if(!t(n)&&!Number.isInteger(n)||!e(i))return!1;const s=a.length;let o=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;o=!1;break;default:return!1}for(const l of a)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function Li(t,e,r){return Math.min(Math.max(t,e),r)}function vN(t){return Uint8Array.prototype.toHex?t.toHex():Array.from(t,e=>Lg[e]).join("")}function u0e(t){return Uint8Array.fromBase64?Uint8Array.fromBase64(t):na(atob(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(r=>{r(t(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(t){return t.reduce((e,r)=>e+r,0)});const h0e=Symbol("CIRCULAR_REF"),Di=Symbol("EOF");let Sq=Object.create(null),Cq=Object.create(null),y_=Object.create(null);function f0e(){Sq=Object.create(null),Cq=Object.create(null),y_=Object.create(null)}class xe{constructor(e){this.name=e}static get(e){return Cq[e]||=new xe(e)}}class Bn{constructor(e){this.cmd=e}static get(e){return Sq[e]||=new Bn(e)}}const Aq=function(){return Aq};class re{constructor(e=null){this._map=new Map,this.xref=e,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=Aq}assignXref(e){this.xref=e}get size(){return this._map.size}get(e,r,n){let i=this._map.get(e);return i===void 0&&r!==void 0&&(i=this._map.get(r),i===void 0&&n!==void 0&&(i=this._map.get(n))),i instanceof Ae&&this.xref?this.xref.fetch(i,this.suppressEncryption):i}async getAsync(e,r,n){let i=this._map.get(e);return i===void 0&&r!==void 0&&(i=this._map.get(r),i===void 0&&n!==void 0&&(i=this._map.get(n))),i instanceof Ae&&this.xref?this.xref.fetchAsync(i,this.suppressEncryption):i}getArray(e,r,n){let i=this._map.get(e);if(i===void 0&&r!==void 0&&(i=this._map.get(r),i===void 0&&n!==void 0&&(i=this._map.get(n))),i instanceof Ae&&this.xref&&(i=this.xref.fetch(i,this.suppressEncryption)),Array.isArray(i)){i=i.slice();for(let a=0,s=i.length;a<s;a++)i[a]instanceof Ae&&this.xref&&(i[a]=this.xref.fetch(i[a],this.suppressEncryption))}return i}getRaw(e){return this._map.get(e)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}getRawEntries(){return this._map.entries()}set(e,r){this._map.set(e,r)}setIfNotExists(e,r){this.has(e)||this.set(e,r)}setIfNumber(e,r){typeof r=="number"&&this.set(e,r)}setIfArray(e,r){(Array.isArray(r)||ArrayBuffer.isView(r))&&this.set(e,r)}setIfDefined(e,r){r!=null&&this.set(e,r)}setIfName(e,r){typeof r=="string"?this.set(e,xe.get(r)):r instanceof xe&&this.set(e,r)}setIfDict(e,r){r instanceof re&&this.set(e,r)}has(e){return this._map.has(e)}*[Symbol.iterator](){for(const[e,r]of this._map)yield[e,r instanceof Ae&&this.xref?this.xref.fetch(r,this.suppressEncryption):r]}static get empty(){const e=new re(null);return e.set=(r,n)=>{tr("Should not call `set` on the empty dictionary.")},Te(this,"empty",e)}static merge({xref:e,dictArray:r,mergeSubDicts:n=!1}){const i=new re(e),a=new Map;for(const s of r)if(s instanceof re)for(const[o,l]of s._map){let c=a.get(o);if(c===void 0)c=[],a.set(o,c);else if(!n||!(l instanceof re))continue;c.push(l)}for(const[s,o]of a){if(o.length===1||!(o[0]instanceof re)){i._map.set(s,o[0]);continue}const l=new re(e);for(const c of o)for(const[u,h]of c._map)l._map.has(u)||l._map.set(u,h);l.size>0&&i._map.set(s,l)}return a.clear(),i.size>0?i:re.empty}clone(){const e=new re(this.xref);for(const r of this.getKeys())e.set(r,this.getRaw(r));return e}delete(e){this._map.delete(e)}}class Ae{constructor(e,r){this.num=e,this.gen=r}toString(){return this.gen===0?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(e){const r=y_[e];if(r)return r;const n=/^(\d+)R(\d*)$/.exec(e);return!n||n[1]==="0"?null:y_[e]=new Ae(parseInt(n[1]),n[2]?parseInt(n[2]):0)}static get(e,r){const n=r===0?`${e}R`:`${e}R${r}`;return y_[n]||=new Ae(e,r)}}class yn{constructor(e=null){this._set=new Set(e?._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}class Pi{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,r){this._map.set(e.toString(),r)}putAlias(e,r){this._map.set(e.toString(),this.get(r))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(const[e,r]of this._map)yield[Ae.fromString(e),r]}*keys(){for(const e of this._map.keys())yield Ae.fromString(e)}}function br(t,e){return t instanceof xe&&(e===void 0||t.name===e)}function gi(t,e){return t instanceof Bn&&(e===void 0||t.cmd===e)}function Tq(t,e){return t instanceof re&&(e===void 0||br(t.get("Type"),e))}function AS(t,e){return t.num===e.num&&t.gen===e.gen}class Pt{get length(){tr("Abstract getter `length` accessed")}get isEmpty(){tr("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return Te(this,"isDataLoaded",!0)}getByte(){tr("Abstract method `getByte` called")}getBytes(e){tr("Abstract method `getBytes` called")}async getImageData(e,r){return this.getBytes(e,r)}async asyncGetBytes(){tr("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){const e=this.getByte();return e!==-1&&this.pos--,e}peekBytes(e){const r=this.getBytes(e);return this.pos-=r.length,r}getUint16(){const e=this.getByte(),r=this.getByte();return e===-1||r===-1?-1:(e<<8)+r}getInt32(){const e=this.getByte(),r=this.getByte(),n=this.getByte(),i=this.getByte();return(e<<24)+(r<<16)+(n<<8)+i}getByteRange(e,r){tr("Abstract method `getByteRange` called")}getString(e){return As(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){tr("Abstract method `reset` called")}moveStart(){tr("Abstract method `moveStart` called")}makeSubStream(e,r,n=null){tr("Abstract method `makeSubStream` called")}getBaseStreams(){return null}getOriginalStream(){return this.stream?.getOriginalStream()||this}}const kq=/^[1-9]\.\d$/,iT=2**31-1,d0e=-2147483648,al=[1,0,0,1,0,0],aT=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],sT=["ExtGState","Font","Properties","XObject"];function un(t){let e;return function(){return t&&(e=Object.create(null),t(e),t=null),e}}class tn extends ss{constructor(e,r){super(`Missing data [${e}, ${r})`,"MissingDataException"),this.begin=e,this.end=r}}class oT extends ss{constructor(e){super(e,"ParserEOFException")}}class kh extends ss{constructor(e){super(e,"XRefEntryException")}}class qd extends ss{constructor(e){super(e,"XRefParseException")}}function Eq(t){const e=t.length;if(e===0)return new Uint8Array(0);if(e===1)return new Uint8Array(t[0]);let r=0;for(let a=0;a<e;a++)r+=t[a].byteLength;const n=new Uint8Array(r);let i=0;for(let a=0;a<e;a++){const s=new Uint8Array(t[a]);n.set(s,i),i+=s.byteLength}return n}async function lT(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch file "${t}" with "${e.statusText}".`);return new Uint8Array(await e.arrayBuffer())}function Co({dict:t,key:e,getArray:r=!1,stopWhenFound:n=!0}){let i;const a=new yn;for(;t instanceof re&&!(t.objId&&a.has(t.objId));){t.objId&&a.put(t.objId);const s=r?t.getArray(e):t.get(e);if(s!==void 0){if(n)return s;(i||=[]).push(s)}t=t.get("Parent")}return i}function p0e(t,e,r){const n=new yn,i=t,a={dict:null,ref:null};for(;t instanceof re&&!n.has(e)&&(n.put(e),!t.has("T"));){if(e=t.getRaw("Parent"),!(e instanceof Ae))return a;t=r.fetch(e)}return t instanceof re&&t!==i&&(a.dict=t,a.ref=e),a}const c8=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function g0e(t,e=!1){Ir(Number.isInteger(t)&&t>0,"The number should be a positive integer.");const r="M".repeat(t/1e3|0)+c8[t%1e3/100|0]+c8[10+(t%100/10|0)]+c8[20+t%10];return e?r.toLowerCase():r}function LI(t){return t>0?Math.ceil(Math.log2(t)):0}function Yl(t,e){return t[e]<<24>>24}function pu(t,e){return(t[e]<<24|t[e+1]<<16)>>16}function Zt(t,e){return t[e]<<8|t[e+1]}function kr(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function Gs(t){return t===32||t===9||t===13||t===10}function m0e(t,e){return Array.isArray(t)&&t.length===e&&t.every(r=>typeof r=="boolean")}function Ua(t,e){return Array.isArray(t)?(e===null||t.length===e)&&t.every(r=>typeof r=="number"):ArrayBuffer.isView(t)&&!(t instanceof BigInt64Array||t instanceof BigUint64Array)&&(e===null||t.length===e)}function Eh(t,e){return Ua(t,6)?t:e}function cT(t,e){return Ua(t,4)?t:e}function Nu(t,e){return Ua(t,4)?mr.normalizeRect(t):e}function Iq(t){const e=/(.+)\[(\d+)\]$/;return t.split(".").map(r=>{const n=r.match(e);return n?{name:n[1],pos:parseInt(n[2],10)}:{name:r,pos:0}})}function PI(t){const e=[];let r=0;for(let n=0,i=t.length;n<i;n++){const a=t.charCodeAt(n);(a<33||a>126||a===35||a===40||a===41||a===60||a===62||a===91||a===93||a===123||a===125||a===47||a===37)&&(r<n&&e.push(t.substring(r,n)),e.push(`#${a.toString(16)}`),r=n+1)}return e.length===0?t:(r<t.length&&e.push(t.substring(r,t.length)),e.join(""))}function om(t){return t.replaceAll(/([()\\\n\r])/g,e=>e===`
16
+ `?"\\n":e==="\r"?"\\r":`\\${e}`)}function TS(t,e,r,n){if(!t)return;let i=null;if(t instanceof Ae){if(n.has(t))return;i=t,n.put(i),t=e.fetch(t)}if(Array.isArray(t))for(const a of t)TS(a,e,r,n);else if(t instanceof re){if(br(t.get("S"),"JavaScript")){const a=t.get("JS");let s;a instanceof Pt?s=a.getString():typeof a=="string"&&(s=a),s&&=qt(s,!0).replaceAll("\0",""),s&&r.push(s.trim())}TS(t.getRaw("Next"),e,r,n)}i&&n.remove(i)}function q3(t,e,r){const n=Object.create(null),i=Co({dict:e,key:"AA",stopWhenFound:!1});if(i)for(let a=i.length-1;a>=0;a--){const s=i[a];if(s instanceof re)for(const o of s.getKeys()){const l=r[o];if(!l)continue;const c=s.getRaw(o),u=new yn,h=[];TS(c,t,h,u),h.length>0&&(n[l]=h)}}if(e.has("A")){const a=e.get("A"),s=new yn,o=[];TS(a,t,o,s),o.length>0&&(n.Action=o)}return MI(n)>0?n:null}const v0e={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function*y0e(t){for(let e=0,r=t.length;e<r;e++){const n=t.codePointAt(e);n>55295&&(n<57344||n>65533)&&e++,yield n}}function Pg(t){const e=[];let r=0;for(let n=0,i=t.length;n<i;n++){const a=t.codePointAt(n);if(32<=a&&a<=126){const s=v0e[a];s&&(r<n&&e.push(t.substring(r,n)),e.push(s),r=n+1)}else r<n&&e.push(t.substring(r,n)),e.push(`&#x${a.toString(16).toUpperCase()};`),a>55295&&(a<57344||a>65533)&&n++,r=n+1}return e.length===0?t:(r<t.length&&e.push(t.substring(r,t.length)),e.join(""))}function uT(t,e=!1){const r=/^("|').*("|')$/.exec(t);if(r&&r[1]===r[2]){if(new RegExp(`[^\\\\]${r[1]}`).test(t.slice(1,-1)))return e&&ee(`FontFamily contains unescaped ${r[1]}: ${t}.`),!1}else for(const n of t.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(n)||!/^[\w-\\]+$/.test(n))return e&&ee(`FontFamily contains invalid <custom-ident>: ${t}.`),!1;return!0}function x0e(t){const n=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:i,fontWeight:a,italicAngle:s}=t;if(!uT(i,!0))return!1;const o=a?a.toString():"";t.fontWeight=n.has(o)?o:"400";const l=parseFloat(s);return t.italicAngle=isNaN(l)||l<-90||l>90?"14":s.toString(),!0}function Dq(t){const e=["app.launchURL","window.open","xfa.host.gotoURL"],n=new RegExp("^\\s*("+e.join("|").replaceAll(".","\\.")+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,"i").exec(t);return n?.[2]?{url:n[2],newWindow:n[1]==="app.launchURL"&&n[3]==="true"}:null}function ir(t){if(Number.isInteger(t))return t.toString();const e=Math.round(t*100);return e%100===0?(e/100).toString():e%10===0?t.toFixed(1):t.toFixed(2)}function Mq(t){if(!t)return null;const e=new Map;for(const[r,n]of t){if(!r.startsWith(bq))continue;let i=e.get(n.pageIndex);i||(i=[],e.set(n.pageIndex,i)),i.push(n)}return e.size>0?e:null}function ja(t){return t==null||b0e(t)?t:Lq(t,!0)}function b0e(t){return typeof t!="string"?!1:!t||/^[\x00-\x7F]*$/.test(t)}function w0e(t){const e=[];for(let r=0,n=t.length;r<n;r++){const i=t.charCodeAt(r);e.push(Lg[i>>8&255],Lg[i&255])}return e.join("")}function Lq(t,e=!1){const r=[];e&&r.push("þÿ");for(let n=0,i=t.length;n<i;n++){const a=t.charCodeAt(n);r.push(String.fromCharCode(a>>8&255),String.fromCharCode(a&255))}return r.join("")}function kS(t,e,r){switch(t){case 90:return[0,1,-1,0,e,0];case 180:return[-1,0,0,-1,e,r];case 270:return[0,-1,1,0,0,r];default:throw new Error("Invalid rotation")}}function yN(t){return Math.ceil(Math.ceil(Math.log2(1+t))/8)}class Ei{static#e=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor="";static _makeHexColor=null;static get _memoryArray(){const e=this.#e;return e?.byteLength?e:this.#e=new Uint8Array(this._memory.buffer)}}function _0e(t,e){const{_mustAddAlpha:r,_destBuffer:n,_destOffset:i,_destLength:a,_memoryArray:s}=Ei;if(e===a){n.set(s.subarray(t,t+e),i);return}if(r)for(let o=t,l=t+e,c=i;o<l;o+=3,c+=4)n[c]=s[o],n[c+1]=s[o+1],n[c+2]=s[o+2],n[c+3]=255;else for(let o=t,l=t+e,c=i;o<l;o+=3,c+=4)n[c]=s[o],n[c+1]=s[o+1],n[c+2]=s[o+2]}function S0e(t){const{_destBuffer:e,_destOffset:r,_memoryArray:n}=Ei;e[r]=n[t],e[r+1]=n[t+1],e[r+2]=n[t+2]}function C0e(t){const{_memoryArray:e}=Ei;Ei._cssColor=Ei._makeHexColor(e[t],e[t+1],e[t+2])}let Ka;const Pq=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Pq.decode();let Vv=null;function Rq(){return(Vv===null||Vv.byteLength===0)&&(Vv=new Uint8Array(Ka.memory.buffer)),Vv}function A0e(t,e){return t=t>>>0,Pq.decode(Rq().subarray(t,t+e))}let RI=0;function Nq(t,e){const r=e(t.length*1,1)>>>0;return Rq().set(t,r/1),RI=t.length,r}function T0e(t,e){const r=Nq(e,Ka.__wbindgen_malloc),n=RI;Ka.qcms_convert_array(t,r,n)}function k0e(t,e,r){Ka.qcms_convert_one(t,e,r)}function E0e(t,e,r,n,i){Ka.qcms_convert_three(t,e,r,n,i)}function I0e(t,e,r,n,i,a){Ka.qcms_convert_four(t,e,r,n,i,a)}function D0e(t,e,r){const n=Nq(t,Ka.__wbindgen_malloc),i=RI;return Ka.qcms_transformer_from_memory(n,i,e,r)>>>0}function M0e(t){Ka.qcms_drop_transformer(t)}const u8=Object.freeze({RGB8:0,0:"RGB8",RGBA8:1,1:"RGBA8",BGRA8:2,2:"BGRA8",Gray8:3,3:"Gray8",GrayA8:4,4:"GrayA8",CMYK:5,5:"CMYK"}),L0e=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});function P0e(){const t={};return t.wbg={},t.wbg.__wbg_copyresult_b08ee7d273f295dd=function(e,r){_0e(e>>>0,r>>>0)},t.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(e){S0e(e>>>0)},t.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(e){C0e(e>>>0)},t.wbg.__wbindgen_init_externref_table=function(){const e=Ka.__wbindgen_export_0,r=e.grow(4);e.set(0,void 0),e.set(r+0,void 0),e.set(r+1,null),e.set(r+2,!0),e.set(r+3,!1)},t.wbg.__wbindgen_throw=function(e,r){throw new Error(A0e(e,r))},t}function R0e(t,e){return Ka=t.exports,Vv=null,Ka.__wbindgen_start(),Ka}function N0e(t){if(Ka!==void 0)return Ka;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=P0e();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));const r=new WebAssembly.Instance(t,e);return R0e(r)}function O0e(t,e,r,n,i,a,s){s=s!==1?0:s;const l=r/i,c=n/a;let u=0,h;const f=new Uint16Array(i),d=r*3;for(let p=0;p<i;p++)f[p]=Math.floor(p*l)*3;for(let p=0;p<a;p++){const g=Math.floor(p*c)*d;for(let m=0;m<i;m++)h=g+f[m],e[u++]=t[h++],e[u++]=t[h++],e[u++]=t[h++],u+=s}}function B0e(t,e,r,n,i,a,s){const o=r/i,l=n/a;let c=0;const u=new Uint16Array(i);if(s===1){for(let p=0;p<i;p++)u[p]=Math.floor(p*o);const h=new Uint32Array(t.buffer),f=new Uint32Array(e.buffer),d=oa.isLittleEndian?16777215:4294967040;for(let p=0;p<a;p++){const g=h.subarray(Math.floor(p*l)*r);for(let m=0;m<i;m++)f[c++]|=g[u[m]]&d}}else{const f=r*4;for(let d=0;d<i;d++)u[d]=Math.floor(d*o)*4;for(let d=0;d<a;d++){const p=t.subarray(Math.floor(d*l)*f);for(let g=0;g<i;g++){const m=u[g];e[c++]=p[m],e[c++]=p[m+1],e[c++]=p[m+2]}}}}function F0e(t,e,r){if(r===1){const n=new Uint32Array(t.buffer),i=new Uint32Array(e.buffer),a=oa.isLittleEndian?16777215:4294967040;for(let s=0,o=n.length;s<o;s++)i[s]|=n[s]&a}else{let n=0;for(let i=0,a=t.length;i<a;i+=4)e[n++]=t[i],e[n++]=t[i+1],e[n++]=t[i+2]}}class Ni{static#e=new Uint8ClampedArray(3);constructor(e,r){this.name=e,this.numComps=r}getRgb(e,r,n=new Uint8ClampedArray(3)){return this.getRgbItem(e,r,n,0),n}getRgbHex(e,r){const n=this.getRgb(e,r,Ni.#e);return mr.makeHexColor(n[0],n[1],n[2])}getRgbItem(e,r,n,i){tr("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,r,n,i,a,s,o){tr("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,r){tr("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,r){return Ni.isDefaultDecode(e,this.numComps)}fillRgb(e,r,n,i,a,s,o,l,c){const u=r*n;let h=null;const f=1<<o,d=n!==a||r!==i;if(this.isPassthrough(o))h=l;else if(this.numComps===1&&u>f&&this.name!=="DeviceGray"&&this.name!=="DeviceRGB"){const p=o<=8?new Uint8Array(f):new Uint16Array(f);for(let m=0;m<f;m++)p[m]=m;const g=new Uint8ClampedArray(f*3);if(this.getRgbBuffer(p,0,f,g,0,o,0),d){h=new Uint8Array(u*3);let m=0;for(let v=0;v<u;++v){const y=l[v]*3;h[m++]=g[y],h[m++]=g[y+1],h[m++]=g[y+2]}}else{let m=0;for(let v=0;v<u;++v){const y=l[v]*3;e[m++]=g[y],e[m++]=g[y+1],e[m++]=g[y+2],m+=c}}}else d?(h=new Uint8ClampedArray(u*3),this.getRgbBuffer(l,0,u,h,0,o,0)):this.getRgbBuffer(l,0,i*s,e,0,o,c);if(h)if(d)O0e(h,e,r,n,i,a,c);else{let p=0,g=0;for(let m=0,v=i*s;m<v;m++)e[p++]=h[g++],e[p++]=h[g++],e[p++]=h[g++],p+=c}}get usesZeroToOneRange(){return Te(this,"usesZeroToOneRange",!0)}static isDefaultDecode(e,r){if(!Array.isArray(e))return!0;if(r*2!==e.length)return ee("The decode map is not the correct length"),!0;for(let n=0,i=e.length;n<i;n+=2)if(e[n]!==0||e[n+1]!==1)return!1;return!0}}class $0e extends Ni{constructor(e,r,n){super("Alternate",e),this.base=r,this.tintFn=n,this.tmpBuf=new Float32Array(r.numComps)}getRgbItem(e,r,n,i){const a=this.tmpBuf;this.tintFn(e,r,a,0),this.base.getRgbItem(a,0,n,i)}getRgbBuffer(e,r,n,i,a,s,o){const l=this.tintFn,c=this.base,u=1/((1<<s)-1),h=c.numComps,f=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!f)&&o===0;let p=d?a:0;const g=d?i:new Uint8ClampedArray(h*n),m=this.numComps,v=new Float32Array(m),y=new Float32Array(h);let x,b;for(x=0;x<n;x++){for(b=0;b<m;b++)v[b]=e[r++]*u;if(l(v,0,y,0),f)for(b=0;b<h;b++)g[p++]=y[b]*255;else c.getRgbItem(y,0,g,p),p+=h}d||c.getRgbBuffer(g,0,n,i,a,8,o)}getOutputLength(e,r){return this.base.getOutputLength(e*this.base.numComps/this.numComps,r)}}class xN extends Ni{constructor(e){super("Pattern",null),this.base=e}isDefaultDecode(e,r){tr("Should not call PatternCS.isDefaultDecode")}}class z0e extends Ni{constructor(e,r,n){super("Indexed",1),this.base=e,this.highVal=r;const i=e.numComps*(r+1);if(this.lookup=new Uint8Array(i),n instanceof Pt){const a=n.getBytes(i);this.lookup.set(a)}else if(typeof n=="string")for(let a=0;a<i;++a)this.lookup[a]=n.charCodeAt(a)&255;else throw new fe(`IndexedCS - unrecognized lookup table: ${n}`)}getRgbItem(e,r,n,i){const{base:a,highVal:s,lookup:o}=this,l=Li(Math.round(e[r]),0,s)*a.numComps;a.getRgbBuffer(o,l,1,n,i,8,0)}getRgbBuffer(e,r,n,i,a,s,o){const{base:l,highVal:c,lookup:u}=this,{numComps:h}=l,f=l.getOutputLength(h,o);for(let d=0;d<n;++d){const p=Li(Math.round(e[r++]),0,c)*h;l.getRgbBuffer(u,p,1,i,a,8,o),a+=f}}getOutputLength(e,r){return this.base.getOutputLength(e*this.base.numComps,r)}isDefaultDecode(e,r){return Array.isArray(e)?e.length!==2?(ee("Decode map length is not correct"),!0):!Number.isInteger(r)||r<1?(ee("Bits per component is not correct"),!0):e[0]===0&&e[1]===(1<<r)-1:!0}}class V0e extends Ni{constructor(){super("DeviceGray",1)}getRgbItem(e,r,n,i){const a=e[r]*255;n[i]=n[i+1]=n[i+2]=a}getRgbBuffer(e,r,n,i,a,s,o){const l=255/((1<<s)-1);let c=r,u=a;for(let h=0;h<n;++h){const f=l*e[c++];i[u++]=f,i[u++]=f,i[u++]=f,u+=o}}getOutputLength(e,r){return e*(3+r)}}class U0e extends Ni{constructor(){super("DeviceRGB",3)}getRgbItem(e,r,n,i){n[i]=e[r]*255,n[i+1]=e[r+1]*255,n[i+2]=e[r+2]*255}getRgbBuffer(e,r,n,i,a,s,o){if(s===8&&o===0){i.set(e.subarray(r,r+n*3),a);return}const l=255/((1<<s)-1);let c=r,u=a;for(let h=0;h<n;++h)i[u++]=l*e[c++],i[u++]=l*e[c++],i[u++]=l*e[c++],u+=o}getOutputLength(e,r){return e*(3+r)/3|0}isPassthrough(e){return e===8}}class j0e extends Ni{constructor(){super("DeviceRGBA",4)}getOutputLength(e,r){return e*4}isPassthrough(e){return e===8}fillRgb(e,r,n,i,a,s,o,l,c){n!==a||r!==i?B0e(l,e,r,n,i,a,c):F0e(l,e,c)}}class Oq extends Ni{constructor(){super("DeviceCMYK",4)}#e(e,r,n,i,a){const s=e[r]*n,o=e[r+1]*n,l=e[r+2]*n,c=e[r+3]*n;i[a]=255+s*(-4.387332384609988*s+54.48615194189176*o+18.82290502165302*l+212.25662451639585*c+-285.2331026137004)+o*(1.7149763477362134*o-5.6096736904047315*l+-17.873870861415444*c-5.497006427196366)+l*(-2.5217340131683033*l-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747),i[a+1]=255+s*(8.841041422036149*s+60.118027045597366*o+6.871425592049007*l+31.159100130055922*c+-79.2970844816548)+o*(-15.310361306967817*o+17.575251261109482*l+131.35250912493976*c-190.9453302588951)+l*(4.444339102852739*l+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578),i[a+2]=255+s*(.8842522430003296*s+8.078677503112928*o+30.89978309703729*l-.23883238689178934*c+-14.183576799673286)+o*(10.49593273432072*o+63.02378494754052*l+50.606957656360734*c-112.23884253719248)+l*(.03296041114873217*l+115.60384449646641*c+-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}getRgbItem(e,r,n,i){this.#e(e,r,1,n,i)}getRgbBuffer(e,r,n,i,a,s,o){const l=1/((1<<s)-1);for(let c=0;c<n;c++)this.#e(e,r,l,i,a),r+=4,a+=3+o}getOutputLength(e,r){return e/4*(3+r)|0}}class H0e extends Ni{constructor(e,r,n){if(super("CalGray",1),!e)throw new fe("WhitePoint missing - required for color space CalGray");if([this.XW,this.YW,this.ZW]=e,[this.XB,this.YB,this.ZB]=r||[0,0,0],this.G=n||1,this.XW<0||this.ZW<0||this.YW!==1)throw new fe(`Invalid WhitePoint components for ${this.name}, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(Ht(`Invalid BlackPoint for ${this.name}, falling back to default.`),this.XB=this.YB=this.ZB=0),(this.XB!==0||this.YB!==0||this.ZB!==0)&&ee(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`),this.G<1&&(Ht(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`),this.G=1)}#e(e,r,n,i,a){const o=(e[r]*a)**this.G,l=this.YW*o,c=Math.max(295.8*l**.3333333333333333-40.8,0);n[i]=c,n[i+1]=c,n[i+2]=c}getRgbItem(e,r,n,i){this.#e(e,r,n,i,1)}getRgbBuffer(e,r,n,i,a,s,o){const l=1/((1<<s)-1);for(let c=0;c<n;++c)this.#e(e,r,i,a,l),r+=1,a+=3+o}getOutputLength(e,r){return e*(3+r)}}class da extends Ni{static#e=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#t=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#n=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#r=new Float32Array([1,1,1]);static#i=new Float32Array(3);static#a=new Float32Array(3);static#s=new Float32Array(3);static#o=(24/116)**3/8;constructor(e,r,n,i){if(super("CalRGB",3),!e)throw new fe("WhitePoint missing - required for color space CalRGB");const[a,s,o]=this.whitePoint=e,[l,c,u]=this.blackPoint=r||new Float32Array(3);if([this.GR,this.GG,this.GB]=n||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=i||new Float32Array([1,0,0,0,1,0,0,0,1]),a<0||o<0||s!==1)throw new fe(`Invalid WhitePoint components for ${this.name}, no fallback available`);(l<0||c<0||u<0)&&(Ht(`Invalid BlackPoint for ${this.name} [${l}, ${c}, ${u}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(Ht(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}#l(e,r,n){n[0]=e[0]*r[0]+e[1]*r[1]+e[2]*r[2],n[1]=e[3]*r[0]+e[4]*r[1]+e[5]*r[2],n[2]=e[6]*r[0]+e[7]*r[1]+e[8]*r[2]}#c(e,r,n){n[0]=r[0]*1/e[0],n[1]=r[1]*1/e[1],n[2]=r[2]*1/e[2]}#f(e,r,n){n[0]=r[0]*.95047/e[0],n[1]=r[1]*1/e[1],n[2]=r[2]*1.08883/e[2]}#h(e){return e<=.0031308?Li(12.92*e,0,1):e>=.99554525?1:Li((1+.055)*e**(1/2.4)-.055,0,1)}#d(e){return e<0?-this.#d(-e):e>8?((e+16)/116)**3:e*da.#o}#m(e,r,n){if(e[0]===0&&e[1]===0&&e[2]===0){n[0]=r[0],n[1]=r[1],n[2]=r[2];return}const i=this.#d(0),a=i,s=this.#d(e[0]),o=i,l=this.#d(e[1]),c=i,u=this.#d(e[2]),h=(1-a)/(1-s),f=1-h,d=(1-o)/(1-l),p=1-d,g=(1-c)/(1-u),m=1-g;n[0]=r[0]*h+f,n[1]=r[1]*d+p,n[2]=r[2]*g+m}#g(e,r,n){if(e[0]===1&&e[2]===1){n[0]=r[0],n[1]=r[1],n[2]=r[2];return}const i=n;this.#l(da.#e,r,i);const a=da.#i;this.#c(e,i,a),this.#l(da.#t,a,n)}#u(e,r,n){const i=n;this.#l(da.#e,r,i);const a=da.#i;this.#f(e,i,a),this.#l(da.#t,a,n)}#p(e,r,n,i,a){const s=Li(e[r]*a,0,1),o=Li(e[r+1]*a,0,1),l=Li(e[r+2]*a,0,1),c=s===1?1:s**this.GR,u=o===1?1:o**this.GG,h=l===1?1:l**this.GB,f=this.MXA*c+this.MXB*u+this.MXC*h,d=this.MYA*c+this.MYB*u+this.MYC*h,p=this.MZA*c+this.MZB*u+this.MZC*h,g=da.#a;g[0]=f,g[1]=d,g[2]=p;const m=da.#s;this.#g(this.whitePoint,g,m);const v=da.#a;this.#m(this.blackPoint,m,v);const y=da.#s;this.#u(da.#r,v,y);const x=da.#a;this.#l(da.#n,y,x),n[i]=this.#h(x[0])*255,n[i+1]=this.#h(x[1])*255,n[i+2]=this.#h(x[2])*255}getRgbItem(e,r,n,i){this.#p(e,r,n,i,1)}getRgbBuffer(e,r,n,i,a,s,o){const l=1/((1<<s)-1);for(let c=0;c<n;++c)this.#p(e,r,i,a,l),r+=3,a+=3+o}getOutputLength(e,r){return e*(3+r)/3|0}}class G0e extends Ni{constructor(e,r,n){if(super("Lab",3),!e)throw new fe("WhitePoint missing - required for color space Lab");if([this.XW,this.YW,this.ZW]=e,[this.amin,this.amax,this.bmin,this.bmax]=n||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=r||[0,0,0],this.XW<0||this.ZW<0||this.YW!==1)throw new fe("Invalid WhitePoint components, no fallback available");(this.XB<0||this.YB<0||this.ZB<0)&&(Ht("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(Ht("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}#e(e){return e>=6/29?e**3:108/841*(e-4/29)}#t(e,r,n,i){return n+e*(i-n)/r}#n(e,r,n,i,a){let s=e[r],o=e[r+1],l=e[r+2];n!==!1&&(s=this.#t(s,n,0,100),o=this.#t(o,n,this.amin,this.amax),l=this.#t(l,n,this.bmin,this.bmax)),o>this.amax?o=this.amax:o<this.amin&&(o=this.amin),l>this.bmax?l=this.bmax:l<this.bmin&&(l=this.bmin);const c=(s+16)/116,u=c+o/500,h=c-l/200,f=this.XW*this.#e(u),d=this.YW*this.#e(c),p=this.ZW*this.#e(h);let g,m,v;this.ZW<1?(g=f*3.1339+d*-1.617+p*-.4906,m=f*-.9785+d*1.916+p*.0333,v=f*.072+d*-.229+p*1.4057):(g=f*3.2406+d*-1.5372+p*-.4986,m=f*-.9689+d*1.8758+p*.0415,v=f*.0557+d*-.204+p*1.057),i[a]=Math.sqrt(g)*255,i[a+1]=Math.sqrt(m)*255,i[a+2]=Math.sqrt(v)*255}getRgbItem(e,r,n,i){this.#n(e,r,!1,n,i)}getRgbBuffer(e,r,n,i,a,s,o){const l=(1<<s)-1;for(let c=0;c<n;c++)this.#n(e,r,l,i,a),r+=3,a+=3+o}getOutputLength(e,r){return e*(3+r)/3|0}isDefaultDecode(e,r){return!0}get usesZeroToOneRange(){return Te(this,"usesZeroToOneRange",!1)}}function Bq(t){const e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),e.response}class Su extends Ni{#e;#t;static#n=!0;static#r=null;static#i=null;constructor(e,r,n){if(!Su.isUsable)throw new Error("No ICC color space support");super(r,n);let i;switch(n){case 1:i=u8.Gray8,this.#t=(a,s,o)=>k0e(this.#e,a[s]*255,o);break;case 3:i=u8.RGB8,this.#t=(a,s,o)=>E0e(this.#e,a[s]*255,a[s+1]*255,a[s+2]*255,o);break;case 4:i=u8.CMYK,this.#t=(a,s,o)=>I0e(this.#e,a[s]*255,a[s+1]*255,a[s+2]*255,a[s+3]*255,o);break;default:throw new Error(`Unsupported number of components: ${n}`)}if(this.#e=D0e(e,i,L0e.Perceptual),!this.#e)throw new Error("Failed to create ICC color space");Su.#i||=new FinalizationRegistry(a=>{M0e(a)}),Su.#i.register(this,this.#e)}getRgbHex(e,r){return this.#t(e,r,!0),Ei._cssColor}getRgbItem(e,r,n,i){Ei._destBuffer=n,Ei._destOffset=i,Ei._destLength=3,this.#t(e,r,!1),Ei._destBuffer=null}getRgbBuffer(e,r,n,i,a,s,o){if(e=e.subarray(r,r+n*this.numComps),s!==8){const l=255/((1<<s)-1);for(let c=0,u=e.length;c<u;c++)e[c]*=l}Ei._mustAddAlpha=o&&i.buffer===e.buffer,Ei._destBuffer=i,Ei._destOffset=a,Ei._destLength=n*(3+o),T0e(this.#e,e),Ei._mustAddAlpha=!1,Ei._destBuffer=null}getOutputLength(e,r){return e/this.numComps*(3+r)|0}static setOptions({useWasm:e,useWorkerFetch:r,wasmUrl:n}){if(!r){this.#n=!1;return}this.#n=e,this.#r=n}static get isUsable(){let e=!1;if(this.#n)if(this.#r)try{this._module=N0e({module:Bq(`${this.#r}qcms_bg.wasm`)}),e=!!this._module,Ei._memory=this._module.memory,Ei._makeHexColor=mr.makeHexColor}catch(r){ee(`ICCBased color space: "${r}".`)}else ee("No ICC color space support due to missing `wasmUrl` API option");return Te(this,"isUsable",e)}}class tx extends Su{static#e;constructor(){const e=new Uint8Array(Bq(`${tx.#e}CGATS001Compat-v2-micro.icc`));super(e,"DeviceCMYK",4)}static setOptions({iccUrl:e}){this.#e=e}static get isUsable(){let e=!1;return Su.isUsable&&(this.#e?e=!0:ee("No CMYK ICC profile support due to missing `iccUrl` API option")),Te(this,"isUsable",e)}}class ln extends Pt{constructor(e,r,n,i){super(),this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=r||0,this.pos=this.start,this.end=r+n||this.bytes.length,this.dict=i}get length(){return this.end-this.start}get isEmpty(){return this.length===0}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const r=this.bytes,n=this.pos,i=this.end;if(!e)return r.subarray(n,i);let a=n+e;return a>i&&(a=i),this.pos=a,r.subarray(n,a)}getByteRange(e,r){return e<0&&(e=0),r>this.end&&(r=this.end),this.bytes.subarray(e,r)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,r,n=null){return new ln(this.bytes.buffer,e,r,n)}clone(){return new ln(this.bytes.buffer,this.start,this.end-this.start,this.dict.clone())}}class _a extends ln{constructor(e){super(na(e))}}class hT extends ln{constructor(){super(new Uint8Array(0))}}class W0e extends ln{constructor(e,r,n){super(new Uint8Array(e),0,e,null),this.chunkSize=r,this._loadedChunks=new Set,this.numChunks=Math.ceil(e/r),this.manager=n,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let r=0,n=this.numChunks;r<n;++r)this._loadedChunks.has(r)||e.push(r);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,r){const n=this.chunkSize;if(e%n!==0)throw new Error(`Bad begin offset: ${e}`);const i=e+r.byteLength;if(i%n!==0&&i!==this.bytes.length)throw new Error(`Bad end offset: ${i}`);this.bytes.set(new Uint8Array(r),e);const a=Math.floor(e/n),s=Math.floor((i-1)/n)+1;for(let o=a;o<s;++o)this._loadedChunks.add(o)}onReceiveProgressiveData(e){let r=this.progressiveDataLength;const n=Math.floor(r/this.chunkSize);this.bytes.set(new Uint8Array(e),r),r+=e.byteLength,this.progressiveDataLength=r;const i=r>=this.end?this.numChunks:Math.floor(r/this.chunkSize);for(let a=n;a<i;++a)this._loadedChunks.add(a)}ensureByte(e){if(e<this.progressiveDataLength)return;const r=Math.floor(e/this.chunkSize);if(!(r>this.numChunks)&&r!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(r))throw new tn(e,e+1);this.lastSuccessfulEnsureByteChunk=r}}ensureRange(e,r){if(e>=r||r<=this.progressiveDataLength)return;const n=Math.floor(e/this.chunkSize);if(n>this.numChunks)return;const i=Math.min(Math.floor((r-1)/this.chunkSize)+1,this.numChunks);for(let a=n;a<i;++a)if(!this._loadedChunks.has(a))throw new tn(e,r)}nextEmptyChunk(e){const r=this.numChunks;for(let n=0;n<r;++n){const i=(e+n)%r;if(!this._loadedChunks.has(i))return i}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;return e>=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}getBytes(e){const r=this.bytes,n=this.pos,i=this.end;if(!e)return i>this.progressiveDataLength&&this.ensureRange(n,i),r.subarray(n,i);let a=n+e;return a>i&&(a=i),a>this.progressiveDataLength&&this.ensureRange(n,a),this.pos=a,r.subarray(n,a)}getByteRange(e,r){return e<0&&(e=0),r>this.end&&(r=this.end),r>this.progressiveDataLength&&this.ensureRange(e,r),this.bytes.subarray(e,r)}makeSubStream(e,r,n=null){r?e+r>this.progressiveDataLength&&this.ensureRange(e,e+r):e>=this.progressiveDataLength&&this.ensureByte(e);function i(){}i.prototype=Object.create(this),i.prototype.getMissingChunks=function(){const s=this.chunkSize,o=Math.floor(this.start/s),l=Math.floor((this.end-1)/s)+1,c=[];for(let u=o;u<l;++u)this._loadedChunks.has(u)||c.push(u);return c},Object.defineProperty(i.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks?!0:this.getMissingChunks().length===0},configurable:!0});const a=new i;return a.pos=a.start=e,a.end=e+r||this.end,a.dict=n,a}getBaseStreams(){return[this]}}class q0e{constructor(e,r){this.length=r.length,this.chunkSize=r.rangeChunkSize,this.stream=new W0e(this.length,this.chunkSize,this),this.pdfNetworkStream=e,this.disableAutoFetch=r.disableAutoFetch,this.msgHandler=r.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=Promise.withResolvers()}sendRequest(e,r){const n=this.pdfNetworkStream.getRangeReader(e,r);n.isStreamingSupported||(n.onProgress=this.onProgress.bind(this));let i=[],a=0;return new Promise((s,o)=>{const l=({value:c,done:u})=>{try{if(u){const h=Eq(i);i=null,s(h);return}a+=c.byteLength,n.isStreamingSupported&&this.onProgress({loaded:a}),i.push(c),n.read().then(l,o)}catch(h){o(h)}};n.read().then(l,o)}).then(s=>{this.aborted||this.onReceiveData({chunk:s,begin:e})})}requestAllChunks(e=!1){if(!e){const r=this.stream.getMissingChunks();this._requestChunks(r)}return this._loadedStreamCapability.promise}_requestChunks(e){const r=this.currRequestId++,n=new Set;this._chunksNeededByRequest.set(r,n);for(const s of e)this.stream.hasChunk(s)||n.add(s);if(n.size===0)return Promise.resolve();const i=Promise.withResolvers();this._promisesByRequest.set(r,i);const a=[];for(const s of n){let o=this._requestsByChunk.get(s);o||(o=[],this._requestsByChunk.set(s,o),a.push(s)),o.push(r)}if(a.length>0){const s=this.groupChunks(a);for(const o of s){const l=o.beginChunk*this.chunkSize,c=Math.min(o.endChunk*this.chunkSize,this.length);this.sendRequest(l,c).catch(i.reject)}}return i.promise.catch(s=>{if(!this.aborted)throw s})}getStream(){return this.stream}requestRange(e,r){r=Math.min(r,this.length);const n=this.getBeginChunk(e),i=this.getEndChunk(r),a=[];for(let s=n;s<i;++s)a.push(s);return this._requestChunks(a)}requestRanges(e=[]){const r=[];for(const n of e){const i=this.getBeginChunk(n.begin),a=this.getEndChunk(n.end);for(let s=i;s<a;++s)r.includes(s)||r.push(s)}return r.sort((n,i)=>n-i),this._requestChunks(r)}groupChunks(e){const r=[];let n=-1,i=-1;for(let a=0,s=e.length;a<s;++a){const o=e[a];n<0&&(n=o),i>=0&&i+1!==o&&(r.push({beginChunk:n,endChunk:i+1}),n=o),a+1===e.length&&r.push({beginChunk:n,endChunk:o+1}),i=o}return r}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const r=e.chunk,n=e.begin===void 0,i=n?this.progressiveDataLength:e.begin,a=i+r.byteLength,s=Math.floor(i/this.chunkSize),o=a<this.length?Math.floor(a/this.chunkSize):Math.ceil(a/this.chunkSize);n?(this.stream.onReceiveProgressiveData(r),this.progressiveDataLength=a):this.stream.onReceiveData(i,r),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const l=[];for(let c=s;c<o;++c){const u=this._requestsByChunk.get(c);if(u){this._requestsByChunk.delete(c);for(const h of u){const f=this._chunksNeededByRequest.get(h);f.has(c)&&f.delete(c),!(f.size>0)&&l.push(h)}}}if(!this.disableAutoFetch&&this._requestsByChunk.size===0){let c;if(this.stream.numChunksLoaded===1){const u=this.stream.numChunks-1;this.stream.hasChunk(u)||(c=u)}else c=this.stream.nextEmptyChunk(o);Number.isInteger(c)&&this._requestChunks([c])}for(const c of l){const u=this._promisesByRequest.get(c);this._promisesByRequest.delete(c),u.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(e);for(const r of this._promisesByRequest.values())r.reject(e)}}function Fq(t){switch(t.kind){case Ii.GRAYSCALE_1BPP:return fT(t);case Ii.RGB_24BPP:return X0e(t)}return null}function fT({src:t,srcPos:e=0,dest:r,width:n,height:i,nonBlackColor:a=4294967295,inverseDecode:s=!1}){const o=oa.isLittleEndian?4278190080:255,[l,c]=s?[a,o]:[o,a],u=n>>3,h=n&7,f=t.length;r=new Uint32Array(r.buffer);let d=0;for(let p=0;p<i;p++){for(const m=e+u;e<m;e++){const v=e<f?t[e]:255;r[d++]=v&128?c:l,r[d++]=v&64?c:l,r[d++]=v&32?c:l,r[d++]=v&16?c:l,r[d++]=v&8?c:l,r[d++]=v&4?c:l,r[d++]=v&2?c:l,r[d++]=v&1?c:l}if(h===0)continue;const g=e<f?t[e++]:255;for(let m=0;m<h;m++)r[d++]=g&1<<7-m?c:l}return{srcPos:e,destPos:d}}function X0e({src:t,srcPos:e=0,dest:r,destPos:n=0,width:i,height:a}){let s=0;const o=i*a*3,l=o>>2,c=new Uint32Array(t.buffer,e,l);if(oa.isLittleEndian){for(;s<l-2;s+=3,n+=4){const u=c[s],h=c[s+1],f=c[s+2];r[n]=u|4278190080,r[n+1]=u>>>24|h<<8|4278190080,r[n+2]=h>>>16|f<<16|4278190080,r[n+3]=f>>>8|4278190080}for(let u=s*4,h=e+o;u<h;u+=3)r[n++]=t[u]|t[u+1]<<8|t[u+2]<<16|4278190080}else{for(;s<l-2;s+=3,n+=4){const u=c[s],h=c[s+1],f=c[s+2];r[n]=u|255,r[n+1]=u<<24|h>>>8|255,r[n+2]=h<<16|f>>>16|255,r[n+3]=f<<8|255}for(let u=s*4,h=e+o;u<h;u+=3)r[n++]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|255}return{srcPos:e+o,destPos:n}}function Y0e(t,e){if(oa.isLittleEndian)for(let r=0,n=t.length;r<n;r++)e[r]=t[r]*65793|4278190080;else for(let r=0,n=t.length;r<n;r++)e[r]=t[r]*16843008|255}const bN=2048,K0e=65537,wN=128;class ys{static#e=bN;static#t=oa.isImageDecoderSupported;constructor(e,r){this._imgData=e,this._isMask=r}static get canUseImageDecoder(){return Te(this,"canUseImageDecoder",this.#t?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(e,r){if(e<=this.#e&&r<=this.#e)return!1;const{MAX_DIM:n}=this;if(e>n||r>n)return!0;const i=e*r;if(this._hasMaxArea)return i>this.MAX_AREA;if(i<this.#e**2)return!1;if(this._areGoodDims(e,r))return this.#e=Math.max(this.#e,Math.floor(Math.sqrt(e*r))),!1;this.#e=this._guessMax(this.#e,n,wN,0);const a=this.MAX_AREA=this.#e**2;return i>a}static getReducePowerForJPX(e,r,n){const i=e*r,a=2**30/(n*4);if(!this.needsToBeResized(e,r))return i>a?Math.ceil(Math.log2(i/a)):0;const{MAX_DIM:s,MAX_AREA:o}=this,l=Math.max(e/s,r/s,Math.sqrt(i/Math.min(a,o)));return Math.ceil(Math.log2(l))}static get MAX_DIM(){return Te(this,"MAX_DIM",this._guessMax(bN,K0e,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,Te(this,"MAX_AREA",this._guessMax(this.#e,this.MAX_DIM,wN,0)**2)}static set MAX_AREA(e){e>=0&&(this._hasMaxArea=!0,Te(this,"MAX_AREA",e))}static setOptions({canvasMaxAreaInBytes:e=-1,isImageDecoderSupported:r=!1}){this._hasMaxArea||(this.MAX_AREA=e>>2),this.#t=r}static _areGoodDims(e,r){try{const n=new OffscreenCanvas(e,r),i=n.getContext("2d");i.fillRect(0,0,1,1);const a=i.getImageData(0,0,1,1).data[3];return n.width=n.height=1,a!==0}catch{return!1}}static _guessMax(e,r,n,i){for(;e+n+1<r;){const a=Math.floor((e+r)/2),s=i||a;this._areGoodDims(a,s)?e=a:r=a}return e}static async createImage(e,r=!1){return new ys(e,r)._createImage()}async _createImage(){const{_imgData:e}=this,{width:r,height:n}=e;if(r*n*4>iT){const y=this.#n();if(y)return y}const i=this._encodeBMP();let a,s;await ys.canUseImageDecoder?(a=new ImageDecoder({data:i,type:"image/bmp",preferAnimation:!1,transfer:[i.buffer]}),s=a.decode().catch(y=>(ee(`BMP image decoding failed: ${y}`),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"})))).finally(()=>{a.close()})):s=createImageBitmap(new Blob([i.buffer],{type:"image/bmp"}));const{MAX_AREA:o,MAX_DIM:l}=ys,c=Math.max(r/l,n/l,Math.sqrt(r*n/o)),u=Math.max(c,2),h=Math.round(10*(c+1.25))/10/u,f=Math.floor(Math.log2(h)),d=new Array(f+2).fill(2);d[0]=u,d.splice(-1,1,h/(1<<f));let p=r,g=n;const m=await s;let v=m.image||m;for(const y of d){const x=p,b=g;p=Math.floor(p/y)-1,g=Math.floor(g/y)-1;const w=new OffscreenCanvas(p,g);w.getContext("2d").drawImage(v,0,0,x,b,0,0,p,g),v.close(),v=w.transferToImageBitmap()}return e.data=null,e.bitmap=v,e.width=p,e.height=g,e}#n(){const{_imgData:e}=this,{data:r,width:n,height:i,kind:a}=e,s=n*i*4,o=Math.ceil(Math.log2(s/iT)),l=n>>o,c=i>>o;let u,h=i;try{u=new Uint8Array(s)}catch{let b=Math.floor(Math.log2(s+1));for(;;)try{u=new Uint8Array(2**b-1);break}catch{b-=1}h=Math.floor((2**b-1)/(n*4));const w=n*h*4;w<u.length&&(u=new Uint8Array(w))}const f=new Uint32Array(u.buffer),d=new Uint32Array(l*c);let p=0,g=0;const m=Math.ceil(i/h),v=i%h===0?i:i%h;for(let b=0;b<m;b++){const w=b<m-1?h:v;({srcPos:p}=Fq({kind:a,src:r,dest:f,width:n,height:w,inverseDecode:this._isMask,srcPos:p}));for(let _=0,S=w>>o;_<S;_++){const C=f.subarray((_<<o)*n);for(let T=0;T<l;T++)d[g++]=C[T<<o]}}if(ys.needsToBeResized(l,c))return e.data=d,e.width=l,e.height=c,e.kind=Ii.RGBA_32BPP,null;const y=new OffscreenCanvas(l,c);return y.getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(d.buffer),l,c),0,0),e.data=null,e.bitmap=y.transferToImageBitmap(),e.width=l,e.height=c,e}_encodeBMP(){const{width:e,height:r,kind:n}=this._imgData;let i=this._imgData.data,a,s=new Uint8Array(0),o=s,l=0;switch(n){case Ii.GRAYSCALE_1BPP:{a=1,s=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);const g=e+7>>3,m=g+3&-4;if(g!==m){const v=new Uint8Array(m*r);let y=0;for(let x=0,b=r*g;x<b;x+=g,y+=m)v.set(i.subarray(x,x+g),y);i=v}break}case Ii.RGB_24BPP:{if(a=24,e&3){const g=3*e,m=g+3&-4,v=m-g,y=new Uint8Array(m*r);let x=0;for(let b=0,w=r*g;b<w;b+=g){const _=i.subarray(b,b+g);for(let S=0;S<g;S+=3)y[x++]=_[S+2],y[x++]=_[S+1],y[x++]=_[S];x+=v}i=y}else for(let g=0,m=i.length;g<m;g+=3){const v=i[g];i[g]=i[g+2],i[g+2]=v}break}case Ii.RGBA_32BPP:a=32,l=3,o=new Uint8Array(68);const p=new DataView(o.buffer);oa.isLittleEndian?(p.setUint32(0,255,!0),p.setUint32(4,65280,!0),p.setUint32(8,16711680,!0),p.setUint32(12,4278190080,!0)):(p.setUint32(0,4278190080,!0),p.setUint32(4,16711680,!0),p.setUint32(8,65280,!0),p.setUint32(12,255,!0));break;default:throw new Error("invalid format")}let c=0;const u=40+o.length,h=14+u+s.length+i.length,f=new Uint8Array(h),d=new DataView(f.buffer);return d.setUint16(c,19778,!0),c+=2,d.setUint32(c,h,!0),c+=4,d.setUint32(c,0,!0),c+=4,d.setUint32(c,14+u+s.length,!0),c+=4,d.setUint32(c,u,!0),c+=4,d.setInt32(c,e,!0),c+=4,d.setInt32(c,-r,!0),c+=4,d.setUint16(c,1,!0),c+=2,d.setUint16(c,a,!0),c+=2,d.setUint32(c,l,!0),c+=4,d.setUint32(c,0,!0),c+=4,d.setInt32(c,0,!0),c+=4,d.setInt32(c,0,!0),c+=4,d.setUint32(c,s.length/4,!0),c+=4,d.setUint32(c,0,!0),c+=4,f.set(o,c),c+=o.length,f.set(s,c),c+=s.length,f.set(i,c),f}}const Z0e=new Uint8Array(0);class es extends Pt{constructor(e){if(super(),this._rawMinBufferLength=e||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=Z0e,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0}ensureBuffer(e){const r=this.buffer;if(e<=r.byteLength)return r;let n=this.minBufferLength;for(;n<e;)n*=2;const i=new Uint8Array(n);return i.set(r),this.buffer=i}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e,r=null){const n=this.pos;let i;if(e){for(this.ensureBuffer(n+e),i=n+e;!this.eof&&this.bufferLength<i;)this.readBlock(r);const a=this.bufferLength;i>a&&(i=a)}else{for(;!this.eof;)this.readBlock(r);i=this.bufferLength}return this.pos=i,this.buffer.subarray(n,i)}async getImageData(e,r){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,r):this.getBytes(e,r);const n=await this.stream.asyncGetBytes();return this.decodeImage(n,r)}reset(){this.pos=0}makeSubStream(e,r,n=null){if(r===void 0)for(;!this.eof;)this.readBlock();else{const i=e+r;for(;this.bufferLength<=i&&!this.eof;)this.readBlock()}return new ln(this.buffer,e,r,n)}getBaseStreams(){return this.stream?this.stream.getBaseStreams():null}clone(){for(;!this.eof;)this.readBlock();return new ln(this.buffer,this.start,this.end-this.start,this.dict.clone())}}class J0e extends es{constructor(e,r=null){e=e.filter(i=>i instanceof Pt);let n=0;for(const i of e)n+=i instanceof es?i._rawMinBufferLength:i.length;super(n),this.streams=e,this._onError=r}readBlock(){const e=this.streams;if(e.length===0){this.eof=!0;return}const r=e.shift();let n;try{n=r.getBytes()}catch(o){if(this._onError){this._onError(o,r.dict?.objId);return}throw o}const i=this.bufferLength,a=i+n.length;this.ensureBuffer(a).set(n,i),this.bufferLength=a}getBaseStreams(){const e=[];for(const r of this.streams){const n=r.getBaseStreams();n&&e.push(...n)}return e.length>0?e:null}}class pr{static parse({cs:e,xref:r,resources:n=null,pdfFunctionFactory:i,globalColorSpaceCache:a,localColorSpaceCache:s,asyncIfNotCached:o=!1}){const l={xref:r,resources:n,pdfFunctionFactory:i,globalColorSpaceCache:a,localColorSpaceCache:s};let c,u,h;if(e instanceof Ae){u=e;const f=a.getByRef(u)||s.getByRef(u);if(f)return f;e=r.fetch(e)}if(e instanceof xe){c=e.name;const f=s.getByName(c);if(f)return f}try{h=this.#t(e,l)}catch(f){if(o&&!(f instanceof tn))return Promise.reject(f);throw f}return(c||u)&&(s.set(c,u,h),u&&a.set(null,u,h)),o?Promise.resolve(h):h}static#e(e,r){const{globalColorSpaceCache:n}=r;let i;if(e instanceof Ae){i=e;const s=n.getByRef(i);if(s)return s}const a=this.#t(e,r);return i&&n.set(null,i,a),a}static#t(e,r){const{xref:n,resources:i,pdfFunctionFactory:a,globalColorSpaceCache:s}=r;if(e=n.fetchIfRef(e),e instanceof xe)switch(e.name){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"DeviceRGBA":return this.rgba;case"CMYK":case"DeviceCMYK":return this.cmyk;case"Pattern":return new xN(null);default:if(i instanceof re){const o=i.get("ColorSpace");if(o instanceof re){const l=o.get(e.name);if(l){if(l instanceof xe)return this.#t(l,r);e=l;break}}}return ee(`Unrecognized ColorSpace: ${e.name}`),this.gray}if(Array.isArray(e)){const o=n.fetchIfRef(e[0]).name;let l,c,u,h,f,d;switch(o){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":return l=n.fetchIfRef(e[1]),h=l.getArray("WhitePoint"),f=l.getArray("BlackPoint"),d=l.get("Gamma"),new H0e(h,f,d);case"CalRGB":l=n.fetchIfRef(e[1]),h=l.getArray("WhitePoint"),f=l.getArray("BlackPoint"),d=l.getArray("Gamma");const p=l.getArray("Matrix");return new da(h,f,d,p);case"ICCBased":const g=e[1]instanceof Ae;if(g){const C=s.getByRef(e[1]);if(C)return C}const m=n.fetchIfRef(e[1]),v=m.dict;if(c=v.get("N"),Su.isUsable)try{const C=new Su(m.getBytes(),"ICCBased",c);return g&&s.set(null,e[1],C),C}catch(C){if(C instanceof tn)throw C;ee(`ICCBased color space (${e[1]}): "${C}".`)}const y=v.getRaw("Alternate");if(y){const C=this.#e(y,r);if(C.numComps===c)return C;ee("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(c===1)return this.gray;if(c===3)return this.rgb;if(c===4)return this.cmyk;break;case"Pattern":return u=e[1]||null,u&&(u=this.#e(u,r)),new xN(u);case"I":case"Indexed":u=this.#e(e[1],r);const x=Li(n.fetchIfRef(e[2]),0,255),b=n.fetchIfRef(e[3]);return new z0e(u,x,b);case"Separation":case"DeviceN":const w=n.fetchIfRef(e[1]);c=Array.isArray(w)?w.length:1,u=this.#e(e[2],r);const _=a.create(e[3]);return new $0e(c,u,_);case"Lab":l=n.fetchIfRef(e[1]),h=l.getArray("WhitePoint"),f=l.getArray("BlackPoint");const S=l.getArray("Range");return new G0e(h,f,S);default:return ee(`Unimplemented ColorSpace object: ${o}`),this.gray}}return ee(`Unrecognized ColorSpace object: ${e}`),this.gray}static get gray(){return Te(this,"gray",new V0e)}static get rgb(){return Te(this,"rgb",new U0e)}static get rgba(){return Te(this,"rgba",new j0e)}static get cmyk(){if(tx.isUsable)try{return Te(this,"cmyk",new tx)}catch{ee("CMYK fallback: DeviceCMYK")}return Te(this,"cmyk",new Oq)}}class vo extends ss{constructor(e){super(e,"JpegError")}}class dT extends ss{constructor(e,r){super(e,"DNLMarkerError"),this.scanLines=r}}class $q extends ss{constructor(e){super(e,"EOIMarkerError")}}const xy=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),d2=4017,p2=799,g2=3406,m2=2276,v2=1567,y2=3784,gp=5793,x2=2896;function Q0e(t,e){let r=0,n,i,a=16;for(;a>0&&!t[a-1];)a--;const s=[{children:[],index:0}];let o=s[0],l;for(n=0;n<a;n++){for(i=0;i<t[n];i++){for(o=s.pop(),o.children[o.index]=e[r];o.index>0;)o=s.pop();for(o.index++,s.push(o);s.length<=n;)s.push(l={children:[],index:0}),o.children[o.index]=l.children,o=l;r++}n+1<a&&(s.push(l={children:[],index:0}),o.children[o.index]=l.children,o=l)}return s[0].children}function pT(t,e,r){return 64*((t.blocksPerLine+1)*e+r)}function epe(t,e,r,n,i,a,s,o,l,c=!1){const u=r.mcusPerLine,h=r.progressive,f=e;let d=0,p=0;function g(){if(p>0)return p--,d>>p&1;if(d=t[e++],d===255){const W=t[e++];if(W){if(W===220&&c){e+=2;const X=Zt(t,e);if(e+=2,X>0&&X!==r.scanLines)throw new dT("Found DNL marker (0xFFDC) while parsing scan data",X)}else if(W===217){if(c){const X=k*(r.precision===8?8:0);if(X>0&&Math.round(r.scanLines/X)>=5)throw new dT("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",X)}throw new $q("Found EOI marker (0xFFD9) while parsing scan data")}throw new vo(`unexpected marker ${(d<<8|W).toString(16)}`)}}return p=7,d>>>7}function m(W){let X=W;for(;;){switch(X=X[g()],typeof X){case"number":return X;case"object":continue}throw new vo("invalid huffman sequence")}}function v(W){let X=0;for(;W>0;)X=X<<1|g(),W--;return X}function y(W){if(W===1)return g()===1?1:-1;const X=v(W);return X>=1<<W-1?X:X+(-1<<W)+1}function x(W,X){const K=m(W.huffmanTableDC),G=K===0?0:y(K);W.blockData[X]=W.pred+=G;let H=1;for(;H<64;){const Y=m(W.huffmanTableAC),J=Y&15,ie=Y>>4;if(J===0){if(ie<15)break;H+=16;continue}H+=ie;const me=xy[H];W.blockData[X+me]=y(J),H++}}function b(W,X){const K=m(W.huffmanTableDC),G=K===0?0:y(K)<<l;W.blockData[X]=W.pred+=G}function w(W,X){W.blockData[X]|=g()<<l}let _=0;function S(W,X){if(_>0){_--;return}let K=a;const G=s;for(;K<=G;){const H=m(W.huffmanTableAC),Y=H&15,J=H>>4;if(Y===0){if(J<15){_=v(J)+(1<<J)-1;break}K+=16;continue}K+=J;const ie=xy[K];W.blockData[X+ie]=y(Y)*(1<<l),K++}}let C=0,T;function A(W,X){let K=a;const G=s;let H=0,Y,J;for(;K<=G;){const ie=X+xy[K],me=W.blockData[ie]<0?-1:1;switch(C){case 0:if(J=m(W.huffmanTableAC),Y=J&15,H=J>>4,Y===0)H<15?(_=v(H)+(1<<H),C=4):(H=16,C=1);else{if(Y!==1)throw new vo("invalid ACn encoding");T=y(Y),C=H?2:3}continue;case 1:case 2:W.blockData[ie]?W.blockData[ie]+=me*(g()<<l):(H--,H===0&&(C=C===2?3:0));break;case 3:W.blockData[ie]?W.blockData[ie]+=me*(g()<<l):(W.blockData[ie]=T<<l,C=0);break;case 4:W.blockData[ie]&&(W.blockData[ie]+=me*(g()<<l));break}K++}C===4&&(_--,_===0&&(C=0))}let k=0;function I(W,X,K,G,H){const Y=K/u|0,J=K%u;k=Y*W.v+G;const ie=J*W.h+H,me=pT(W,k,ie);X(W,me)}function E(W,X,K){k=K/W.blocksPerLine|0;const G=K%W.blocksPerLine,H=pT(W,k,G);X(W,H)}const M=n.length;let R,D,L,P,O,$;h?a===0?$=o===0?b:w:$=o===0?S:A:$=x;let N=0,U;const j=M===1?n[0].blocksPerLine*n[0].blocksPerColumn:u*r.mcusPerColumn;let B,q;for(;N<=j;){const W=i?Math.min(j-N,i):j;if(W>0){for(D=0;D<M;D++)n[D].pred=0;if(_=0,M===1)for(R=n[0],O=0;O<W;O++)E(R,$,N),N++;else for(O=0;O<W;O++){for(D=0;D<M;D++)for(R=n[D],B=R.h,q=R.v,L=0;L<q;L++)for(P=0;P<B;P++)I(R,$,N,L,P);N++}}if(p=0,U=X3(t,e),!U)break;if(U.invalid){const X=W>0?"unexpected":"excessive";ee(`decodeScan - ${X} MCU data, current marker is: ${U.invalid}`),e=U.offset}if(U.marker>=65488&&U.marker<=65495)e+=2;else break}return e-f}function tpe(t,e,r){const n=t.quantizationTable,i=t.blockData;let a,s,o,l,c,u,h,f,d,p,g,m,v,y,x,b,w;if(!n)throw new vo("missing required Quantization Table.");for(let _=0;_<64;_+=8){if(d=i[e+_],p=i[e+_+1],g=i[e+_+2],m=i[e+_+3],v=i[e+_+4],y=i[e+_+5],x=i[e+_+6],b=i[e+_+7],d*=n[_],(p|g|m|v|y|x|b)===0){w=gp*d+512>>10,r[_]=w,r[_+1]=w,r[_+2]=w,r[_+3]=w,r[_+4]=w,r[_+5]=w,r[_+6]=w,r[_+7]=w;continue}p*=n[_+1],g*=n[_+2],m*=n[_+3],v*=n[_+4],y*=n[_+5],x*=n[_+6],b*=n[_+7],a=gp*d+128>>8,s=gp*v+128>>8,o=g,l=x,c=x2*(p-b)+128>>8,f=x2*(p+b)+128>>8,u=m<<4,h=y<<4,a=a+s+1>>1,s=a-s,w=o*y2+l*v2+128>>8,o=o*v2-l*y2+128>>8,l=w,c=c+h+1>>1,h=c-h,f=f+u+1>>1,u=f-u,a=a+l+1>>1,l=a-l,s=s+o+1>>1,o=s-o,w=c*m2+f*g2+2048>>12,c=c*g2-f*m2+2048>>12,f=w,w=u*p2+h*d2+2048>>12,u=u*d2-h*p2+2048>>12,h=w,r[_]=a+f,r[_+7]=a-f,r[_+1]=s+h,r[_+6]=s-h,r[_+2]=o+u,r[_+5]=o-u,r[_+3]=l+c,r[_+4]=l-c}for(let _=0;_<8;++_){if(d=r[_],p=r[_+8],g=r[_+16],m=r[_+24],v=r[_+32],y=r[_+40],x=r[_+48],b=r[_+56],(p|g|m|v|y|x|b)===0){w=gp*d+8192>>14,w<-2040?w=0:w>=2024?w=255:w=w+2056>>4,i[e+_]=w,i[e+_+8]=w,i[e+_+16]=w,i[e+_+24]=w,i[e+_+32]=w,i[e+_+40]=w,i[e+_+48]=w,i[e+_+56]=w;continue}a=gp*d+2048>>12,s=gp*v+2048>>12,o=g,l=x,c=x2*(p-b)+2048>>12,f=x2*(p+b)+2048>>12,u=m,h=y,a=(a+s+1>>1)+4112,s=a-s,w=o*y2+l*v2+2048>>12,o=o*v2-l*y2+2048>>12,l=w,c=c+h+1>>1,h=c-h,f=f+u+1>>1,u=f-u,a=a+l+1>>1,l=a-l,s=s+o+1>>1,o=s-o,w=c*m2+f*g2+2048>>12,c=c*g2-f*m2+2048>>12,f=w,w=u*p2+h*d2+2048>>12,u=u*d2-h*p2+2048>>12,h=w,d=a+f,b=a-f,p=s+h,x=s-h,g=o+u,y=o-u,m=l+c,v=l-c,d<16?d=0:d>=4080?d=255:d>>=4,p<16?p=0:p>=4080?p=255:p>>=4,g<16?g=0:g>=4080?g=255:g>>=4,m<16?m=0:m>=4080?m=255:m>>=4,v<16?v=0:v>=4080?v=255:v>>=4,y<16?y=0:y>=4080?y=255:y>>=4,x<16?x=0:x>=4080?x=255:x>>=4,b<16?b=0:b>=4080?b=255:b>>=4,i[e+_]=d,i[e+_+8]=p,i[e+_+16]=g,i[e+_+24]=m,i[e+_+32]=v,i[e+_+40]=y,i[e+_+48]=x,i[e+_+56]=b}}function rpe(t,e){const r=e.blocksPerLine,n=e.blocksPerColumn,i=new Int16Array(64);for(let a=0;a<n;a++)for(let s=0;s<r;s++){const o=pT(e,a,s);tpe(e,o,i)}return e.blockData}function X3(t,e,r=e){const n=t.length-1;let i=r<e?r:e;if(e>=n)return null;const a=Zt(t,e);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:e};let s=Zt(t,i);for(;!(s>=65472&&s<=65534);){if(++i>=n)return null;s=Zt(t,i)}return{invalid:a.toString(16),marker:s,offset:i}}function npe(t){const e=Math.ceil(t.samplesPerLine/8/t.maxH),r=Math.ceil(t.scanLines/8/t.maxV);for(const n of t.components){const i=Math.ceil(Math.ceil(t.samplesPerLine/8)*n.h/t.maxH),a=Math.ceil(Math.ceil(t.scanLines/8)*n.v/t.maxV),s=e*n.h,l=64*(r*n.v)*(s+1);n.blockData=new Int16Array(l),n.blocksPerLine=i,n.blocksPerColumn=a}t.mcusPerLine=e,t.mcusPerColumn=r}function _N(t,e){const r=Zt(t,e);e+=2;let n=e+r-2;const i=X3(t,n,e);i?.invalid&&(ee("readDataBlock - incorrect length, current marker is: "+i.invalid),n=i.offset);const a=t.subarray(e,n);return{appData:a,oldOffset:e,newOffset:e+a.length}}function ipe(t,e){const r=Zt(t,e);e+=2;const n=e+r-2,i=X3(t,n,e);return i?.invalid?i.offset:n}class SN{constructor({decodeTransform:e=null,colorTransform:r=-1}={}){this._decodeTransform=e,this._colorTransform=r}static canUseImageDecoder(e,r=-1){let n=null,i=0,a=null,s=Zt(e,i);if(i+=2,s!==65496)throw new vo("SOI not found");s=Zt(e,i),i+=2;e:for(;s!==65497;){switch(s){case 65505:const{appData:o,oldOffset:l,newOffset:c}=_N(e,i);if(i=c,o[0]===69&&o[1]===120&&o[2]===105&&o[3]===102&&o[4]===0&&o[5]===0){if(n)throw new vo("Duplicate EXIF-blocks found.");n={exifStart:l+6,exifEnd:c}}s=Zt(e,i),i+=2;continue;case 65472:case 65473:case 65474:a=e[i+7];break e;case 65535:e[i]!==255&&i--;break}i=ipe(e,i),s=Zt(e,i),i+=2}return a===4||a===3&&r===0?null:n||{}}parse(e,{dnlScanLines:r=null}={}){let n=0,i=null,a=null,s,o,l=0;const c=[],u=[],h=[];let f=Zt(e,n);if(n+=2,f!==65496)throw new vo("SOI not found");f=Zt(e,n),n+=2;e:for(;f!==65497;){let d,p,g;switch(f){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const{appData:m,newOffset:v}=_N(e,n);n=v,f===65504&&m[0]===74&&m[1]===70&&m[2]===73&&m[3]===70&&m[4]===0&&(i={version:{major:m[5],minor:m[6]},densityUnits:m[7],xDensity:m[8]<<8|m[9],yDensity:m[10]<<8|m[11],thumbWidth:m[12],thumbHeight:m[13],thumbData:m.subarray(14,14+3*m[12]*m[13])}),f===65518&&m[0]===65&&m[1]===100&&m[2]===111&&m[3]===98&&m[4]===101&&(a={version:m[5]<<8|m[6],flags0:m[7]<<8|m[8],flags1:m[9]<<8|m[10],transformCode:m[11]});break;case 65499:const y=Zt(e,n);n+=2;const x=y+n-2;let b;for(;n<x;){const L=e[n++],P=new Uint16Array(64);if(L>>4===0)for(p=0;p<64;p++)b=xy[p],P[b]=e[n++];else if(L>>4===1)for(p=0;p<64;p++)b=xy[p],P[b]=Zt(e,n),n+=2;else throw new vo("DQT - invalid table spec");c[L&15]=P}break;case 65472:case 65473:case 65474:if(s)throw new vo("Only single frame JPEGs supported");n+=2,s={},s.extended=f===65473,s.progressive=f===65474,s.precision=e[n++];const w=Zt(e,n);n+=2,s.scanLines=r||w,s.samplesPerLine=Zt(e,n),n+=2,s.components=[],s.componentIds={};const _=e[n++];let S=0,C=0;for(d=0;d<_;d++){const L=e[n],P=e[n+1]>>4,O=e[n+1]&15;S<P&&(S=P),C<O&&(C=O);const $=e[n+2];g=s.components.push({h:P,v:O,quantizationId:$,quantizationTable:null}),s.componentIds[L]=g-1,n+=3}s.maxH=S,s.maxV=C,npe(s);break;case 65476:const T=Zt(e,n);for(n+=2,d=2;d<T;){const L=e[n++],P=new Uint8Array(16);let O=0;for(p=0;p<16;p++,n++)O+=P[p]=e[n];const $=new Uint8Array(O);for(p=0;p<O;p++,n++)$[p]=e[n];d+=17+O,(L>>4===0?h:u)[L&15]=Q0e(P,$)}break;case 65501:n+=2,o=Zt(e,n),n+=2;break;case 65498:const A=++l===1&&!r;n+=2;const k=e[n++],I=[];for(d=0;d<k;d++){const L=e[n++],P=s.componentIds[L],O=s.components[P];O.index=L;const $=e[n++];O.huffmanTableDC=h[$>>4],O.huffmanTableAC=u[$&15],I.push(O)}const E=e[n++],M=e[n++],R=e[n++];try{const L=epe(e,n,s,I,o,E,M,R>>4,R&15,A);n+=L}catch(L){if(L instanceof dT)return ee(`${L.message} -- attempting to re-parse the JPEG image.`),this.parse(e,{dnlScanLines:L.scanLines});if(L instanceof $q){ee(`${L.message} -- ignoring the rest of the image data.`);break e}throw L}break;case 65500:n+=4;break;case 65535:e[n]!==255&&n--;break;default:const D=X3(e,n-2,n-3);if(D?.invalid){ee("JpegImage.parse - unexpected data, current marker is: "+D.invalid),n=D.offset;break}if(!D||n>=e.length-1){ee("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new vo("JpegImage.parse - unknown marker: "+f.toString(16))}f=Zt(e,n),n+=2}if(!s)throw new vo("JpegImage.parse - no frame data found.");this.width=s.samplesPerLine,this.height=s.scanLines,this.jfif=i,this.adobe=a,this.components=[];for(const d of s.components){const p=c[d.quantizationId];p&&(d.quantizationTable=p),this.components.push({index:d.index,output:rpe(s,d),scaleX:d.h/s.maxH,scaleY:d.v/s.maxV,blocksPerLine:d.blocksPerLine,blocksPerColumn:d.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,r,n=!1){const i=this.width/e,a=this.height/r;let s,o,l,c,u,h,f,d,p,g,m=0,v;const y=this.components.length,x=e*r*y,b=new Uint8ClampedArray(x),w=new Uint32Array(e),_=4294967288;let S;for(f=0;f<y;f++){if(s=this.components[f],o=s.scaleX*i,l=s.scaleY*a,m=f,v=s.output,c=s.blocksPerLine+1<<3,o!==S){for(u=0;u<e;u++)d=0|u*o,w[u]=(d&_)<<3|d&7;S=o}for(h=0;h<r;h++)for(d=0|h*l,g=c*(d&_)|(d&7)<<3,u=0;u<e;u++)b[m]=v[g+w[u]],m+=y}let C=this._decodeTransform;if(!n&&y===4&&!C&&(C=new Int32Array([-256,255,-256,255,-256,255,-256,255])),C)for(f=0;f<x;)for(d=0,p=0;d<y;d++,f++,p+=2)b[f]=(b[f]*C[p]>>8)+C[p+1];return b}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this._colorTransform===0?!1:!(this.components[0].index===82&&this.components[1].index===71&&this.components[2].index===66):this._colorTransform===1}_convertYccToRgb(e){let r,n,i;for(let a=0,s=e.length;a<s;a+=3)r=e[a],n=e[a+1],i=e[a+2],e[a]=r-179.456+1.402*i,e[a+1]=r+135.459-.344*n-.714*i,e[a+2]=r-226.816+1.772*n;return e}_convertYccToRgba(e,r){for(let n=0,i=0,a=e.length;n<a;n+=3,i+=4){const s=e[n],o=e[n+1],l=e[n+2];r[i]=s-179.456+1.402*l,r[i+1]=s+135.459-.344*o-.714*l,r[i+2]=s-226.816+1.772*o,r[i+3]=255}return r}_convertYcckToRgb(e){return this._convertYcckToCmyk(e),this._convertCmykToRgb(e)}_convertYcckToRgba(e){return this._convertYcckToCmyk(e),this._convertCmykToRgba(e)}_convertYcckToCmyk(e){let r,n,i;for(let a=0,s=e.length;a<s;a+=4)r=e[a],n=e[a+1],i=e[a+2],e[a]=434.456-r-1.402*i,e[a+1]=119.541-r+.344*n+.714*i,e[a+2]=481.816-r-1.772*n;return e}_convertCmykToRgb(e){const r=e.length/4;return pr.cmyk.getRgbBuffer(e,0,r,e,0,8,0),e.subarray(0,r*3)}_convertCmykToRgba(e){if(pr.cmyk.getRgbBuffer(e,0,e.length/4,e,0,8,1),pr.cmyk instanceof Oq)for(let r=3,n=e.length;r<n;r+=4)e[r]=255;return e}getData({width:e,height:r,forceRGBA:n=!1,forceRGB:i=!1,isSourcePDF:a=!1}){if(this.numComponents>4)throw new vo("Unsupported color mode");const s=this._getLinearizedBlockData(e,r,a);if(this.numComponents===1&&(n||i)){const o=s.length*(n?4:3),l=new Uint8ClampedArray(o);let c=0;if(n)Y0e(s,new Uint32Array(l.buffer));else for(const u of s)l[c++]=u,l[c++]=u,l[c++]=u;return l}else if(this.numComponents===3&&this._isColorConversionNeeded){if(n){const o=new Uint8ClampedArray(s.length/3*4);return this._convertYccToRgba(s,o)}return this._convertYccToRgb(s)}else if(this.numComponents===4){if(this._isColorConversionNeeded)return n?this._convertYcckToRgba(s):i?this._convertYcckToRgb(s):this._convertYcckToCmyk(s);if(n)return this._convertCmykToRgba(s);if(i)return this._convertCmykToRgb(s)}return s}}class jm extends es{static#e=oa.isImageDecoderSupported;constructor(e,r,n){super(r),this.stream=e,this.dict=e.dict,this.maybeLength=r,this.params=n}static get canUseImageDecoder(){return Te(this,"canUseImageDecoder",this.#e?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:e=!1}){this.#e=e}get bytes(){return Te(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}get jpegOptions(){const e={decodeTransform:void 0,colorTransform:void 0},r=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(r)){const n=this.dict.get("BPC","BitsPerComponent")||8,i=r.length,a=new Int32Array(i);let s=!1;const o=(1<<n)-1;for(let l=0;l<i;l+=2)a[l]=(r[l+1]-r[l])*256|0,a[l+1]=r[l]*o|0,(a[l]!==256||a[l+1]!==0)&&(s=!0);s&&(e.decodeTransform=a)}if(this.params instanceof re){const n=this.params.get("ColorTransform");Number.isInteger(n)&&(e.colorTransform=n)}return Te(this,"jpegOptions",e)}#t(e){for(let r=0,n=e.length-1;r<n;r++)if(e[r]===255&&e[r+1]===216){r>0&&(e=e.subarray(r));break}return e}decodeImage(e){if(this.eof)return this.buffer;e=this.#t(e||this.bytes);const r=new SN(this.jpegOptions);r.parse(e);const n=r.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});return this.buffer=n,this.bufferLength=n.length,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await jm.canUseImageDecoder)return null;const e=this.jpegOptions;if(e.decodeTransform)return null;let r;try{const n=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!n)return null;let i=this.#t(n);const a=SN.canUseImageDecoder(i,e.colorTransform);return a?(a.exifStart&&(i=i.slice(),i.fill(0,a.exifStart,a.exifEnd)),r=new ImageDecoder({data:i,type:"image/jpeg",preferAnimation:!1}),(await r.decode()).image):null}catch(n){return ee(`getTransferableImage - failed: "${n}".`),null}finally{r?.close()}}}async function ape(t={}){var e,r=t,n="./this.program",i=(Ce,De)=>{throw De},a=typeof document>"u"?require("url").pathToFileURL(__filename).href:Ig&&Ig.tagName.toUpperCase()==="SCRIPT"&&Ig.src||new URL("index-BglI_ler.cjs",document.baseURI).href,s="";try{s=new URL(".",a).href}catch{}var o=console.log.bind(console),l=console.error.bind(console),c=!1,u,h,f,d,p,g,m,v,y=!1;function x(){var Ce=d.buffer;p=new Int8Array(Ce),g=new Uint8Array(Ce),m=new Int32Array(Ce),v=new Uint32Array(Ce),new BigInt64Array(Ce),new BigUint64Array(Ce)}function b(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)R(r.preRun.shift());k(M)}function w(){y=!0,Qs.s()}function _(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)E(r.postRun.shift());k(I)}function S(Ce){r.onAbort?.(Ce),Ce="Aborted("+Ce+")",l(Ce),c=!0,Ce+=". Build with -sASSERTIONS for more info.";var De=new WebAssembly.RuntimeError(Ce);throw f?.(De),De}function C(){return{a:zc}}async function T(){function Ce(Re,xt){return Qs=Re.exports,d=Qs.r,x(),$c(Qs),Qs}var De=C();return new Promise((Re,xt)=>{r.instantiateWasm(De,(Vt,Er)=>{Re(Ce(Vt))})})}class A{name="ExitStatus";constructor(De){this.message=`Program terminated with exit(${De})`,this.status=De}}var k=Ce=>{for(;Ce.length>0;)Ce.shift()(r)},I=[],E=Ce=>I.push(Ce),M=[],R=Ce=>M.push(Ce),D=!0,L=()=>S(""),P=0,O=()=>{D=!1,P=0},$={},N=Ce=>{if(Ce instanceof A||Ce=="unwind")return u;i(1,Ce)},U=()=>D||P>0,j=Ce=>{u=Ce,U()||(r.onExit?.(Ce),c=!0),i(Ce,new A(Ce))},B=(Ce,De)=>{u=Ce,j(Ce)},q=B,W=()=>{if(!U())try{q(u)}catch(Ce){N(Ce)}},X=Ce=>{if(!c)try{Ce(),W()}catch(De){N(De)}},K=()=>performance.now(),G=(Ce,De)=>{if($[Ce]&&(clearTimeout($[Ce].id),delete $[Ce]),!De)return 0;var Re=setTimeout(()=>{delete $[Ce],X(()=>Tf(Ce,K()))},De);return $[Ce]={id:Re,timeout_ms:De},0};function H(Ce,De){Ce>>=2;const Re=r.imageData=new Uint8ClampedArray(De),xt=m.subarray(Ce,Ce+De);Re.set(xt)}function Y(Ce,De,Re,xt){Ce>>=2,De>>=2,Re>>=2;const Vt=r.imageData=new Uint8ClampedArray(xt*3),Er=m.subarray(Ce,Ce+xt),or=m.subarray(De,De+xt),Wr=m.subarray(Re,Re+xt);for(let Fr=0;Fr<xt;Fr++)Vt[3*Fr]=Er[Fr],Vt[3*Fr+1]=or[Fr],Vt[3*Fr+2]=Wr[Fr]}function J(Ce,De,Re,xt,Vt){Ce>>=2,De>>=2,Re>>=2,xt>>=2;const Er=r.imageData=new Uint8ClampedArray(Vt*4),or=m.subarray(Ce,Ce+Vt),Wr=m.subarray(De,De+Vt),Fr=m.subarray(Re,Re+Vt),sp=m.subarray(xt,xt+Vt);for(let Rn=0;Rn<Vt;Rn++)Er[4*Rn]=or[Rn],Er[4*Rn+1]=Wr[Rn],Er[4*Rn+2]=Fr[Rn],Er[4*Rn+3]=sp[Rn]}var ie=()=>2147483648,me=(Ce,De)=>Math.ceil(Ce/De)*De,oe=Ce=>{var De=d.buffer.byteLength,Re=(Ce-De+65535)/65536|0;try{return d.grow(Re),x(),1}catch{}},ne=Ce=>{var De=g.length;Ce>>>=0;var Re=ie();if(Ce>Re)return!1;for(var xt=1;xt<=4;xt*=2){var Vt=De*(1+.2/xt);Vt=Math.min(Vt,Ce+100663296);var Er=Math.min(Re,me(Math.max(Ce,Vt),65536)),or=oe(Er);if(or)return!0}return!1},de={},ve=()=>n||"./this.program",Ne=()=>{if(!Ne.strings){var Ce=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",De={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:Ce,_:ve()};for(var Re in de)de[Re]===void 0?delete De[Re]:De[Re]=de[Re];var xt=[];for(var Re in De)xt.push(`${Re}=${De[Re]}`);Ne.strings=xt}return Ne.strings},ke=(Ce,De,Re,xt)=>{if(!(xt>0))return 0;for(var Vt=Re,Er=Re+xt-1,or=0;or<Ce.length;++or){var Wr=Ce.codePointAt(or);if(Wr<=127){if(Re>=Er)break;De[Re++]=Wr}else if(Wr<=2047){if(Re+1>=Er)break;De[Re++]=192|Wr>>6,De[Re++]=128|Wr&63}else if(Wr<=65535){if(Re+2>=Er)break;De[Re++]=224|Wr>>12,De[Re++]=128|Wr>>6&63,De[Re++]=128|Wr&63}else{if(Re+3>=Er)break;De[Re++]=240|Wr>>18,De[Re++]=128|Wr>>12&63,De[Re++]=128|Wr>>6&63,De[Re++]=128|Wr&63,or++}}return De[Re]=0,Re-Vt},Le=(Ce,De,Re)=>ke(Ce,g,De,Re),$e=(Ce,De)=>{var Re=0,xt=0;for(var Vt of Ne()){var Er=De+Re;v[Ce+xt>>2]=Er,Re+=Le(Vt,Er,1/0)+1,xt+=4}return 0},Ee=Ce=>{for(var De=0,Re=0;Re<Ce.length;++Re){var xt=Ce.charCodeAt(Re);xt<=127?De++:xt<=2047?De+=2:xt>=55296&&xt<=57343?(De+=4,++Re):De+=3}return De},pe=(Ce,De)=>{var Re=Ne();v[Ce>>2]=Re.length;var xt=0;for(var Vt of Re)xt+=Ee(Vt)+1;return v[De>>2]=xt,0};function Ve(Ce,De,Re,xt){return 70}var qe=[null,[],[]],tt=typeof TextDecoder<"u"?new TextDecoder:void 0,_t=(Ce,De,Re,xt)=>{for(var Vt=De+Re;Ce[De]&&!(De>=Vt);)++De;return De},Ot=(Ce,De=0,Re,xt)=>{var Vt=_t(Ce,De,Re);if(Vt-De>16&&Ce.buffer&&tt)return tt.decode(Ce.subarray(De,Vt));for(var Er="";De<Vt;){var or=Ce[De++];if(!(or&128)){Er+=String.fromCharCode(or);continue}var Wr=Ce[De++]&63;if((or&224)==192){Er+=String.fromCharCode((or&31)<<6|Wr);continue}var Fr=Ce[De++]&63;if((or&240)==224?or=(or&15)<<12|Wr<<6|Fr:or=(or&7)<<18|Wr<<12|Fr<<6|Ce[De++]&63,or<65536)Er+=String.fromCharCode(or);else{var sp=or-65536;Er+=String.fromCharCode(55296|sp>>10,56320|sp&1023)}}return Er},Ea=(Ce,De)=>{var Re=qe[Ce];De===0||De===10?((Ce===1?o:l)(Ot(Re)),Re.length=0):Re.push(De)},xr=(Ce,De,Re)=>Ce?Ot(g,Ce,De):"",Js=(Ce,De,Re,xt)=>{for(var Vt=0,Er=0;Er<Re;Er++){var or=v[De>>2],Wr=v[De+4>>2];De+=8;for(var Fr=0;Fr<Wr;Fr++)Ea(Ce,g[or+Fr]);Vt+=Wr}return v[xt>>2]=Vt,0};function hn(Ce,De){Ce>>=2;const Re=r.imageData=new Uint8ClampedArray(De*4),xt=m.subarray(Ce,Ce+De);for(let Vt=0;Vt<De;Vt++)Re[4*Vt]=Re[4*Vt+1]=Re[4*Vt+2]=xt[Vt],Re[4*Vt+3]=255}function _i(Ce,De,Re){Ce>>=2,De>>=2;const xt=r.imageData=new Uint8ClampedArray(Re*4),Vt=m.subarray(Ce,Ce+Re),Er=m.subarray(De,De+Re);for(let or=0;or<Re;or++)xt[4*or]=xt[4*or+1]=xt[4*or+2]=Vt[or],xt[4*or+3]=Er[or]}function Si(Ce){const De=xr(Ce);(r.warn||console.warn)(`OpenJPEG: ${De}`)}function Al(Ce,De,Re,xt){Ce>>=2,De>>=2,Re>>=2;const Vt=r.imageData=new Uint8ClampedArray(xt*4),Er=m.subarray(Ce,Ce+xt),or=m.subarray(De,De+xt),Wr=m.subarray(Re,Re+xt);for(let Fr=0;Fr<xt;Fr++)Vt[4*Fr]=Er[Fr],Vt[4*Fr+1]=or[Fr],Vt[4*Fr+2]=Wr[Fr],Vt[4*Fr+3]=255}function eh(Ce){const De=xr(Ce);r.errorMessages?r.errorMessages+=`
17
17
  `+De:r.errorMessages=De}var th=(Ce,De)=>{p.set(Ce,De)};if(r.noExitRuntime&&(D=r.noExitRuntime),r.print&&(o=r.print),r.printErr&&(l=r.printErr),r.wasmBinary&&r.wasmBinary,r.arguments&&r.arguments,r.thisProgram&&(n=r.thisProgram),r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.shift()();r.writeArrayToMemory=th;var Tf;function $c(Ce){r._malloc=Ce.t,r._free=Ce.u,r._jp2_decode=Ce.v,Tf=Ce.w}var zc={k:L,j:O,l:G,f:H,e:Y,d:J,m:ne,o:$e,p:pe,n:Ve,b:Js,q:hn,h:_i,c:Si,i:j,g:Al,a:eh};function x1(){b();function Ce(){r.calledRun=!0,!c&&(w(),h?.(r),r.onRuntimeInitialized?.(),_())}r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),Ce()},1)):Ce()}var Qs;return Qs=await T(),x1(),y?e=r:e=new Promise((Ce,De)=>{h=Ce,f=De}),e}const spe=ape;class b2 extends ss{constructor(e){super(e,"JpxError")}}class Y3{static#e=null;static#t=null;static#n=null;static#r=!0;static#i=!0;static#a=null;static setOptions({handler:e,useWasm:r,useWorkerFetch:n,wasmUrl:i}){this.#r=r,this.#i=n,this.#a=i,n||(this.#t=e)}static async#s(e){const r=`${this.#a}openjpeg_nowasm_fallback.js`;let n=null;try{n=(await import(r)).default()}catch(i){ee(`JpxImage#getJsModule: ${i}`)}e(n)}static async#o(e,r,n){const i="openjpeg.wasm";try{this.#e||(this.#i?this.#e=await lT(`${this.#a}${i}`):this.#e=await this.#t.sendWithPromise("FetchBinaryData",{type:"wasmFactory",filename:i}));const a=await WebAssembly.instantiate(this.#e,r);return n(a.instance)}catch(a){return ee(`JpxImage#instantiateWasm: ${a}`),this.#s(e),null}finally{this.#t=null}}static async decode(e,{numComponents:r=4,isIndexedColormap:n=!1,smaskInData:i=!1,reducePower:a=0}={}){if(!this.#n){const{promise:l,resolve:c}=Promise.withResolvers(),u=[l];this.#r?u.push(spe({warn:ee,instantiateWasm:this.#o.bind(this,c)})):this.#s(c),this.#n=Promise.race(u)}const s=await this.#n;if(!s)throw new b2("OpenJPEG failed to initialize");let o;try{const l=e.length;if(o=s._malloc(l),s.writeArrayToMemory(e,o),s._jp2_decode(o,l,r>0?r:0,!!n,!!i,a)){const{errorMessages:h}=s;throw h?(delete s.errorMessages,new b2(h)):new b2("Unknown error")}const{imageData:u}=s;return s.imageData=null,u}finally{o&&s._free(o)}}static cleanup(){this.#n=null}static parseImageProperties(e){let r=e.getByte();for(;r>=0;){const n=r;if(r=e.getByte(),(n<<8|r)===65361){e.skip(4);const a=e.getInt32()>>>0,s=e.getInt32()>>>0,o=e.getInt32()>>>0,l=e.getInt32()>>>0;e.skip(16);const c=e.getUint16();return{width:a-o,height:s-l,bitsPerComponent:8,componentsCount:c}}}throw new b2("No size marker found in JPX stream")}}function db(t,e,r,n,i){let a=t;for(let s=0,o=e.length-1;s<o;s++){const l=e[s];a=a[l]||=[]}a[e.at(-1)]={checkFn:r,iterateFn:n,processFn:i}}const d0=[];db(d0,[Z.save,Z.transform,Z.paintInlineImageXObject,Z.restore],null,function(e,r){const n=e.fnArray,i=e.iCurr-3,a=(r-i)%4;switch(a){case 0:return n[r]===Z.save;case 1:return n[r]===Z.transform;case 2:return n[r]===Z.paintInlineImageXObject;case 3:return n[r]===Z.restore}throw new Error(`iterateInlineImageGroup - invalid pos: ${a}`)},function(e,r){const o=e.fnArray,l=e.argsArray,c=e.iCurr,u=c-3,h=c-2,f=c-1,d=Math.min(Math.floor((r-u)/4),200);if(d<10)return r-(r-u)%4;let p=0;const g=[];let m=0,v=1,y=1;for(let C=0;C<d;C++){const T=l[h+(C<<2)],A=l[f+(C<<2)][0];v+A.width>1e3&&(p=Math.max(p,v),y+=m+2,v=0,m=0),g.push({transform:T,x:v,y,w:A.width,h:A.height}),v+=A.width+2,m=Math.max(m,A.height)}const x=Math.max(p,v)+1,b=y+m+1,w=new Uint8Array(x*b*4),_=x<<2;for(let C=0;C<d;C++){const T=l[f+(C<<2)][0].data,A=g[C].w<<2;let k=0,I=g[C].x+g[C].y*x<<2;w.set(T.subarray(0,A),I-_);for(let E=0,M=g[C].h;E<M;E++)w.set(T.subarray(k,k+A),I),k+=A,I+=_;for(w.set(T.subarray(k-A,k),I);I>=0;)T[I-4]=T[I],T[I-3]=T[I+1],T[I-2]=T[I+2],T[I-1]=T[I+3],T[I+A]=T[I+A-4],T[I+A+1]=T[I+A-3],T[I+A+2]=T[I+A-2],T[I+A+3]=T[I+A-1],I-=_}const S={width:x,height:b};if(e.isOffscreenCanvasSupported){const C=new OffscreenCanvas(x,b);C.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(w.buffer),x,b),0,0),S.bitmap=C.transferToImageBitmap(),S.data=null}else S.kind=Ii.RGBA_32BPP,S.data=w;return o.splice(u,d*4,Z.paintInlineImageXObjectGroup),l.splice(u,d*4,[S,g]),u+1});db(d0,[Z.save,Z.transform,Z.paintImageMaskXObject,Z.restore],null,function(e,r){const n=e.fnArray,i=e.iCurr-3,a=(r-i)%4;switch(a){case 0:return n[r]===Z.save;case 1:return n[r]===Z.transform;case 2:return n[r]===Z.paintImageMaskXObject;case 3:return n[r]===Z.restore}throw new Error(`iterateImageMaskGroup - invalid pos: ${a}`)},function(e,r){const s=e.fnArray,o=e.argsArray,l=e.iCurr,c=l-3,u=l-2,h=l-1;let f=Math.floor((r-c)/4);if(f<10)return r-(r-c)%4;let d=!1,p,g;const m=o[h][0],v=o[u][0],y=o[u][1],x=o[u][2],b=o[u][3];if(y===x){d=!0,p=u+4;let w=h+4;for(let _=1;_<f;_++,p+=4,w+=4)if(g=o[p],o[w][0]!==m||g[0]!==v||g[1]!==y||g[2]!==x||g[3]!==b){_<10?d=!1:f=_;break}}if(d){f=Math.min(f,1e3);const w=new Float32Array(f*2);p=u;for(let _=0;_<f;_++,p+=4)g=o[p],w[_<<1]=g[4],w[(_<<1)+1]=g[5];s.splice(c,f*4,Z.paintImageMaskXObjectRepeat),o.splice(c,f*4,[m,v,y,x,b,w])}else{f=Math.min(f,100);const w=[];for(let _=0;_<f;_++){g=o[u+(_<<2)];const S=o[h+(_<<2)][0];w.push({data:S.data,width:S.width,height:S.height,interpolate:S.interpolate,count:S.count,transform:g})}s.splice(c,f*4,Z.paintImageMaskXObjectGroup),o.splice(c,f*4,[w])}return c+1});db(d0,[Z.save,Z.transform,Z.paintImageXObject,Z.restore],function(t){const e=t.argsArray,r=t.iCurr-2;return e[r][1]===0&&e[r][2]===0},function(e,r){const n=e.fnArray,i=e.argsArray,a=e.iCurr-3,s=(r-a)%4;switch(s){case 0:return n[r]===Z.save;case 1:if(n[r]!==Z.transform)return!1;const o=e.iCurr-2,l=i[o][0],c=i[o][3];return!(i[r][0]!==l||i[r][1]!==0||i[r][2]!==0||i[r][3]!==c);case 2:if(n[r]!==Z.paintImageXObject)return!1;const u=e.iCurr-1,h=i[u][0];return i[r][0]===h;case 3:return n[r]===Z.restore}throw new Error(`iterateImageGroup - invalid pos: ${s}`)},function(t,e){const i=t.fnArray,a=t.argsArray,s=t.iCurr,o=s-3,l=s-2,c=s-1,u=a[c][0],h=a[l][0],f=a[l][3],d=Math.min(Math.floor((e-o)/4),1e3);if(d<3)return e-(e-o)%4;const p=new Float32Array(d*2);let g=l;for(let v=0;v<d;v++,g+=4){const y=a[g];p[v<<1]=y[4],p[(v<<1)+1]=y[5]}const m=[u,h,f,p];return i.splice(o,d*4,Z.paintImageXObjectRepeat),a.splice(o,d*4,m),o+1});db(d0,[Z.beginText,Z.setFont,Z.setTextMatrix,Z.showText,Z.endText],null,function(e,r){const n=e.fnArray,i=e.argsArray,a=e.iCurr-4,s=(r-a)%5;switch(s){case 0:return n[r]===Z.beginText;case 1:return n[r]===Z.setFont;case 2:return n[r]===Z.setTextMatrix;case 3:if(n[r]!==Z.showText)return!1;const o=e.iCurr-3,l=i[o][0],c=i[o][1];return!(i[r][0]!==l||i[r][1]!==c);case 4:return n[r]===Z.endText}throw new Error(`iterateShowTextGroup - invalid pos: ${s}`)},function(t,e){const i=t.fnArray,a=t.argsArray,s=t.iCurr,o=s-4,l=s-3,c=s-2,u=s-1,h=s,f=a[l][0],d=a[l][1];let p=Math.min(Math.floor((e-o)/5),1e3);if(p<3)return e-(e-o)%5;let g=o;o>=4&&i[o-4]===i[l]&&i[o-3]===i[c]&&i[o-2]===i[u]&&i[o-1]===i[h]&&a[o-4][0]===f&&a[o-4][1]===d&&(p++,g-=5);let m=g+4;for(let v=1;v<p;v++)i.splice(m,3),a.splice(m,3),m+=2;return m+1});db(d0,[Z.save,Z.transform,Z.constructPath,Z.restore],t=>{const e=t.argsArray,r=t.iCurr-1,n=e[r][0];if(n!==Z.stroke&&n!==Z.closeStroke&&n!==Z.fillStroke&&n!==Z.eoFillStroke&&n!==Z.closeFillStroke&&n!==Z.closeEOFillStroke)return!0;const i=t.iCurr-2,a=e[i];return a[0]===1&&a[1]===0&&a[2]===0&&a[3]===1},()=>!1,(t,e)=>{const{fnArray:r,argsArray:n}=t,i=t.iCurr,a=i-3,s=i-2,o=i-1,l=n[o],c=n[s],[,[u],h]=l;if(h){mr.scaleMinMax(c,h);for(let f=0,d=u.length;f<d;)switch(u[f++]){case qr.moveTo:case qr.lineTo:mr.applyTransform(u,c,f),f+=2;break;case qr.curveTo:mr.applyTransformToBezier(u,c,f),f+=6;break}}return r.splice(a,4,Z.constructPath),n.splice(a,4,l),a+1});class zq{constructor(e){this.queue=e}_optimize(){}push(e,r){this.queue.fnArray.push(e),this.queue.argsArray.push(r),this._optimize()}flush(){}reset(){}}class ope extends zq{constructor(e){super(e),this.state=null,this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray,isOffscreenCanvasSupported:Oi.isOffscreenCanvasSupported},this.match=null,this.lastProcessed=0}_optimize(){const e=this.queue.fnArray;let r=this.lastProcessed,n=e.length,i=this.state,a=this.match;if(!i&&!a&&r+1===n&&!d0[e[r]]){this.lastProcessed=n;return}const s=this.context;for(;r<n;){if(a){if((0,a.iterateFn)(s,r)){r++;continue}if(r=(0,a.processFn)(s,r+1),n=e.length,a=null,i=null,r>=n)break}if(i=(i||d0)[e[r]],!i||Array.isArray(i)){r++;continue}if(s.iCurr=r,r++,i.checkFn&&!(0,i.checkFn)(s)){i=null;continue}a=i,i=null}this.state=i,this.match=a,this.lastProcessed=r}flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e),this.match=null,this.state=null,this._optimize()}}reset(){this.state=null,this.match=null,this.lastProcessed=0}}class Oi{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(e=0,r){this._streamSink=r,this.fnArray=[],this.argsArray=[],this.optimizer=r&&!(e&Ba.OPLIST)?new ope(this):new zq(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=r?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:e}){this.isOffscreenCanvasSupported=e}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(e,r){this.optimizer.push(e,r),this.weight++,this._streamSink&&(this.weight>=Oi.CHUNK_SIZE?this.flush():this.weight>=Oi.CHUNK_SIZE_ABOUT&&(e===Z.restore||e===Z.endText)&&this.flush())}addImageOps(e,r,n,i=!1){i&&(this.addOp(Z.save),this.addOp(Z.setGState,[[["SMask",!1]]])),n!==void 0&&this.addOp(Z.beginMarkedContentProps,["OC",n]),this.addOp(e,r),n!==void 0&&this.addOp(Z.endMarkedContent,[]),i&&this.addOp(Z.restore)}addDependency(e){this.dependencies.has(e)||(this.dependencies.add(e),this.addOp(Z.dependency,[e]))}addDependencies(e){for(const r of e)this.addDependency(r)}addOpList(e){if(!(e instanceof Oi)){ee('addOpList - ignoring invalid "opList" parameter.');return}for(const r of e.dependencies)this.dependencies.add(r);for(let r=0,n=e.length;r<n;r++)this.addOp(e.fnArray[r],e.argsArray[r])}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const e=[],{fnArray:r,argsArray:n,length:i}=this;for(let a=0;a<i;a++)switch(r[a]){case Z.paintInlineImageXObject:case Z.paintInlineImageXObjectGroup:case Z.paintImageMaskXObject:{const{bitmap:l,data:c}=n[a][0];(l||c?.buffer)&&e.push(l||c.buffer);break}case Z.constructPath:{const[,[l],c]=n[a];l&&e.push(l.buffer,c.buffer);break}case Z.paintFormXObjectBegin:const[s,o]=n[a];s&&e.push(s.buffer),o&&e.push(o.buffer);break;case Z.setTextMatrix:e.push(n[a][0].buffer);break}return e}flush(e=!1,r=null){this.optimizer.flush();const n=this.length;this._totalLength+=n,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:r,length:n},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}}function ha(t,e){let r=0;for(let n=0;n<=e;n++)r=r<<8|t[n];return r>>>0}function w2(t,e){return e===1?String.fromCharCode(t[0],t[1]):e===3?String.fromCharCode(t[0],t[1],t[2],t[3]):String.fromCharCode(...t.subarray(0,e+1))}function Ia(t,e,r){let n=0;for(let i=r;i>=0;i--)n+=t[i]+e[i],t[i]=n&255,n>>=8}function If(t,e){let r=1;for(let n=e;n>=0&&r>0;n--)r+=t[n],t[n]=r&255,r>>=8}const mp=16,lpe=19;class cpe{constructor(e){this.buffer=e,this.pos=0,this.end=e.length,this.tmpBuf=new Uint8Array(lpe)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e=0,r;do{const n=this.readByte();if(n<0)throw new fe("unexpected EOF in bcmap");r=!(n&128),e=e<<7|n&127}while(!r);return e}readSigned(){const e=this.readNumber();return e&1?~(e>>>1):e>>>1}readHex(e,r){e.set(this.buffer.subarray(this.pos,this.pos+r+1)),this.pos+=r+1}readHexNumber(e,r){let n;const i=this.tmpBuf;let a=0;do{const c=this.readByte();if(c<0)throw new fe("unexpected EOF in bcmap");n=!(c&128),i[a++]=c&127}while(!n);let s=r,o=0,l=0;for(;s>=0;){for(;l<8&&i.length>0;)o|=i[--a]<<l,l+=7;e[s]=o&255,s--,o>>=8,l-=8}}readHexSigned(e,r){this.readHexNumber(e,r);const n=e[r]&1?255:0;let i=0;for(let a=0;a<=r;a++)i=(i&1)<<8|e[a],e[a]=i>>1^n}readString(){const e=this.readNumber(),r=new Array(e);for(let n=0;n<e;n++)r[n]=this.readNumber();return String.fromCharCode(...r)}}class upe{async process(e,r,n){const i=new cpe(e),a=i.readByte();r.vertical=!!(a&1);let s=null;const o=new Uint8Array(mp),l=new Uint8Array(mp),c=new Uint8Array(mp),u=new Uint8Array(mp),h=new Uint8Array(mp);let f,d;for(;(d=i.readByte())>=0;){const p=d>>5;if(p===7){switch(d&31){case 0:i.readString();break;case 1:s=i.readString();break}continue}const g=!!(d&16),m=d&15;if(m+1>mp)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const v=1,y=i.readNumber();switch(p){case 0:i.readHex(o,m),i.readHexNumber(l,m),Ia(l,o,m),r.addCodespaceRange(m+1,ha(o,m),ha(l,m));for(let x=1;x<y;x++)If(l,m),i.readHexNumber(o,m),Ia(o,l,m),i.readHexNumber(l,m),Ia(l,o,m),r.addCodespaceRange(m+1,ha(o,m),ha(l,m));break;case 1:i.readHex(o,m),i.readHexNumber(l,m),Ia(l,o,m),i.readNumber();for(let x=1;x<y;x++)If(l,m),i.readHexNumber(o,m),Ia(o,l,m),i.readHexNumber(l,m),Ia(l,o,m),i.readNumber();break;case 2:i.readHex(c,m),f=i.readNumber(),r.mapOne(ha(c,m),f);for(let x=1;x<y;x++)If(c,m),g||(i.readHexNumber(h,m),Ia(c,h,m)),f=i.readSigned()+(f+1),r.mapOne(ha(c,m),f);break;case 3:i.readHex(o,m),i.readHexNumber(l,m),Ia(l,o,m),f=i.readNumber(),r.mapCidRange(ha(o,m),ha(l,m),f);for(let x=1;x<y;x++)If(l,m),g?o.set(l):(i.readHexNumber(o,m),Ia(o,l,m)),i.readHexNumber(l,m),Ia(l,o,m),f=i.readNumber(),r.mapCidRange(ha(o,m),ha(l,m),f);break;case 4:i.readHex(c,v),i.readHex(u,m),r.mapOne(ha(c,v),w2(u,m));for(let x=1;x<y;x++)If(c,v),g||(i.readHexNumber(h,v),Ia(c,h,v)),If(u,m),i.readHexSigned(h,m),Ia(u,h,m),r.mapOne(ha(c,v),w2(u,m));break;case 5:i.readHex(o,v),i.readHexNumber(l,v),Ia(l,o,v),i.readHex(u,m),r.mapBfRange(ha(o,v),ha(l,v),w2(u,m));for(let x=1;x<y;x++)If(l,v),g?o.set(l):(i.readHexNumber(o,v),Ia(o,l,v)),i.readHexNumber(l,v),Ia(l,o,v),i.readHex(u,m),r.mapBfRange(ha(o,v),ha(l,v),w2(u,m));break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${p}`)}}return s?n(s):r}}class hpe extends es{constructor(e,r){r&&(r*=.8),super(r),this.stream=e,this.dict=e.dict,this.input=new Uint8Array(5)}readBlock(){const i=this.stream;let a=i.getByte();for(;Gs(a);)a=i.getByte();if(a===-1||a===126){this.eof=!0;return}const s=this.bufferLength;let o,l;if(a===122){for(o=this.ensureBuffer(s+4),l=0;l<4;++l)o[s+l]=0;this.bufferLength+=4}else{const c=this.input;for(c[0]=a,l=1;l<5;++l){for(a=i.getByte();Gs(a);)a=i.getByte();if(c[l]=a,a===-1||a===126)break}if(o=this.ensureBuffer(s+l-1),this.bufferLength+=l-1,l<5){for(;l<5;++l)c[l]=117;this.eof=!0}let u=0;for(l=0;l<5;++l)u=u*85+(c[l]-33);for(l=3;l>=0;--l)o[s+l]=u&255,u>>=8}}}class fpe extends es{constructor(e,r){r&&(r*=.5),super(r),this.stream=e,this.dict=e.dict,this.firstDigit=-1}readBlock(){const r=this.stream.getBytes(8e3);if(!r.length){this.eof=!0;return}const n=r.length+1>>1,i=this.ensureBuffer(this.bufferLength+n);let a=this.bufferLength,s=this.firstDigit;for(const o of r){let l;if(o>=48&&o<=57)l=o&15;else if(o>=65&&o<=70||o>=97&&o<=102)l=(o&15)+9;else if(o===62){this.eof=!0;break}else continue;s<0?s=l:(i[a++]=s<<4|l,s=-1)}s>=0&&this.eof&&(i[a++]=s<<4,s=-1),this.firstDigit=s,this.bufferLength=a}}const gT=-2,Hc=-1,tu=0,Hi=1,ut=2,Gi=3,Wi=4,mT=5,vT=6,Vq=7,Uq=8,CN=[[-1,-1],[-1,-1],[7,Uq],[7,Vq],[6,vT],[6,vT],[6,mT],[6,mT],[4,tu],[4,tu],[4,tu],[4,tu],[4,tu],[4,tu],[4,tu],[4,tu],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Hi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Wi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[3,Gi],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut],[1,ut]],AN=[[-1,-1],[12,gT],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],TN=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],kN=[[-1,-1],[-1,-1],[12,gT],[12,gT],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],EN=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],IN=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];class jq{constructor(e,r={}){if(typeof e?.next!="function")throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=e,this.eof=!1,this.encoding=r.K||0,this.eoline=r.EndOfLine||!1,this.byteAlign=r.EncodedByteAlign||!1,this.columns=r.Columns||1728,this.rows=r.Rows||0,this.eoblock=r.EndOfBlock??!0,this.black=r.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;let n;for(;(n=this._lookBits(12))===0;)this._eatBits(1);n===1&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}readNextChar(){if(this.eof)return-1;const e=this.refLine,r=this.codingLine,n=this.columns;let i,a,s,o;if(this.outputBits===0){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;this.err=!1;let c,u,h;if(this.nextLine2D){for(o=0;r[o]<n;++o)e[o]=r[o];for(e[o++]=n,e[o]=n,r[0]=0,this.codingPos=0,i=0,a=0;r[this.codingPos]<n;)switch(c=this._getTwoDimCode(),c){case tu:this._addPixels(e[i+1],a),e[i+1]<n&&(i+=2);break;case Hi:if(c=u=0,a){do c+=h=this._getBlackCode();while(h>=64);do u+=h=this._getWhiteCode();while(h>=64)}else{do c+=h=this._getWhiteCode();while(h>=64);do u+=h=this._getBlackCode();while(h>=64)}for(this._addPixels(r[this.codingPos]+c,a),r[this.codingPos]<n&&this._addPixels(r[this.codingPos]+u,a^1);e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case Vq:if(this._addPixels(e[i]+3,a),a^=1,r[this.codingPos]<n)for(++i;e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case mT:if(this._addPixels(e[i]+2,a),a^=1,r[this.codingPos]<n)for(++i;e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case Gi:if(this._addPixels(e[i]+1,a),a^=1,r[this.codingPos]<n)for(++i;e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case ut:if(this._addPixels(e[i],a),a^=1,r[this.codingPos]<n)for(++i;e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case Uq:if(this._addPixelsNeg(e[i]-3,a),a^=1,r[this.codingPos]<n)for(i>0?--i:++i;e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case vT:if(this._addPixelsNeg(e[i]-2,a),a^=1,r[this.codingPos]<n)for(i>0?--i:++i;e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case Wi:if(this._addPixelsNeg(e[i]-1,a),a^=1,r[this.codingPos]<n)for(i>0?--i:++i;e[i]<=r[this.codingPos]&&e[i]<n;)i+=2;break;case Hc:this._addPixels(n,0),this.eof=!0;break;default:Ht("bad 2d code"),this._addPixels(n,0),this.err=!0}}else for(r[0]=0,this.codingPos=0,a=0;r[this.codingPos]<n;){if(c=0,a)do c+=h=this._getBlackCode();while(h>=64);else do c+=h=this._getWhiteCode();while(h>=64);this._addPixels(r[this.codingPos]+c,a),a^=1}let f=!1;if(this.byteAlign&&(this.inputBits&=-8),!this.eoblock&&this.row===this.rows-1)this.rowsDone=!0;else{if(c=this._lookBits(12),this.eoline)for(;c!==Hc&&c!==1;)this._eatBits(1),c=this._lookBits(12);else for(;c===0;)this._eatBits(1),c=this._lookBits(12);c===1?(this._eatBits(12),f=!0):c===Hc&&(this.eof=!0)}if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&f&&this.byteAlign){if(c=this._lookBits(12),c===1){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(o=0;o<4;++o)c=this._lookBits(12),c!==1&&Ht("bad rtc code: "+c),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(c=this._lookBits(13),c===Hc)return this.eof=!0,-1;if(c>>1===1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(c&1))}this.outputBits=r[0]>0?r[this.codingPos=0]:r[this.codingPos=1],this.row++}let l;if(this.outputBits>=8)l=this.codingPos&1?0:255,this.outputBits-=8,this.outputBits===0&&r[this.codingPos]<n&&(this.codingPos++,this.outputBits=r[this.codingPos]-r[this.codingPos-1]);else{s=8,l=0;do{if(typeof this.outputBits!="number")throw new fe('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');this.outputBits>s?(l<<=s,this.codingPos&1||(l|=255>>8-s),this.outputBits-=s,s=0):(l<<=this.outputBits,this.codingPos&1||(l|=255>>8-this.outputBits),s-=this.outputBits,this.outputBits=0,r[this.codingPos]<n?(this.codingPos++,this.outputBits=r[this.codingPos]-r[this.codingPos-1]):s>0&&(l<<=s,s=0))}while(s)}return this.black&&(l^=255),l}_addPixels(e,r){const n=this.codingLine;let i=this.codingPos;e>n[i]&&(e>this.columns&&(Ht("row is wrong length"),this.err=!0,e=this.columns),i&1^r&&++i,n[i]=e),this.codingPos=i}_addPixelsNeg(e,r){const n=this.codingLine;let i=this.codingPos;if(e>n[i])e>this.columns&&(Ht("row is wrong length"),this.err=!0,e=this.columns),i&1^r&&++i,n[i]=e;else if(e<n[i]){for(e<0&&(Ht("invalid code"),this.err=!0,e=0);i>0&&e<n[i-1];)--i;n[i]=e}this.codingPos=i}_findTableCode(e,r,n,i){const a=i||0;for(let s=e;s<=r;++s){let o=this._lookBits(s);if(o===Hc)return[!0,1,!1];if(s<r&&(o<<=r-s),!a||o>=a){const l=n[o-a];if(l[0]===s)return this._eatBits(s),[!0,l[1],!0]}}return[!1,0,!1]}_getTwoDimCode(){let e=0,r;if(this.eoblock){if(e=this._lookBits(7),r=CN[e],r?.[0]>0)return this._eatBits(r[0]),r[1]}else{const n=this._findTableCode(1,7,CN);if(n[0]&&n[2])return n[1]}return Ht("Bad two dim code"),Hc}_getWhiteCode(){let e=0,r;if(this.eoblock){if(e=this._lookBits(12),e===Hc)return 1;if(r=e>>5===0?AN[e]:TN[e>>3],r[0]>0)return this._eatBits(r[0]),r[1]}else{let n=this._findTableCode(1,9,TN);if(n[0]||(n=this._findTableCode(11,12,AN),n[0]))return n[1]}return Ht("bad white code"),this._eatBits(1),1}_getBlackCode(){let e,r;if(this.eoblock){if(e=this._lookBits(13),e===Hc)return 1;if(e>>7===0?r=kN[e]:e>>9===0&&e>>7!==0?r=EN[(e>>1)-64]:r=IN[e>>7],r[0]>0)return this._eatBits(r[0]),r[1]}else{let n=this._findTableCode(2,6,IN);if(n[0]||(n=this._findTableCode(7,12,EN,64),n[0])||(n=this._findTableCode(10,13,kN),n[0]))return n[1]}return Ht("bad black code"),this._eatBits(1),1}_lookBits(e){let r;for(;this.inputBits<e;){if((r=this.source.next())===-1)return this.inputBits===0?Hc:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|r,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}}class dpe extends es{constructor(e,r,n){super(r),this.stream=e,this.dict=e.dict,n instanceof re||(n=re.empty);const i={next(){return e.getByte()}};this.ccittFaxDecoder=new jq(i,{K:n.get("K"),EndOfLine:n.get("EndOfLine"),EncodedByteAlign:n.get("EncodedByteAlign"),Columns:n.get("Columns"),Rows:n.get("Rows"),EndOfBlock:n.get("EndOfBlock"),BlackIs1:n.get("BlackIs1")})}readBlock(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(e===-1){this.eof=!0;return}this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=e}}}const DN=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ppe=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),gpe=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),mpe=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],vpe=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];class MN extends es{constructor(e,r){super(r),this.stream=e,this.dict=e.dict;const n=e.getByte(),i=e.getByte();if(n===-1||i===-1)throw new fe(`Invalid header in flate stream: ${n}, ${i}`);if((n&15)!==8)throw new fe(`Unknown compression method in flate stream: ${n}, ${i}`);if(((n<<8)+i)%31!==0)throw new fe(`Bad FCHECK in flate stream: ${n}, ${i}`);if(i&32)throw new fe(`FDICT bit set in flate stream: ${n}, ${i}`);this.codeSize=0,this.codeBuf=0}async getImageData(e,r){const n=await this.asyncGetBytes();return n?n.length<=e?n:n.subarray(0,e):this.getBytes(e)}async asyncGetBytes(){this.stream.reset();const e=this.stream.getBytes();try{const{readable:r,writable:n}=new DecompressionStream("deflate"),i=n.getWriter();await i.ready,i.write(e).then(async()=>{await i.ready,await i.close()}).catch(()=>{});const a=[];let s=0;for await(const c of r)a.push(c),s+=c.byteLength;const o=new Uint8Array(s);let l=0;for(const c of a)o.set(c,l),l+=c.byteLength;return o}catch{return this.stream=new ln(e,2,e.length,this.stream.dict),this.reset(),null}}get isAsync(){return!0}getBits(e){const r=this.stream;let n=this.codeSize,i=this.codeBuf,a;for(;n<e;){if((a=r.getByte())===-1)throw new fe("Bad encoding in flate stream");i|=a<<n,n+=8}return a=i&(1<<e)-1,this.codeBuf=i>>e,this.codeSize=n-=e,a}getCode(e){const r=this.stream,n=e[0],i=e[1];let a=this.codeSize,s=this.codeBuf,o;for(;a<i&&(o=r.getByte())!==-1;)s|=o<<a,a+=8;const l=n[s&(1<<i)-1],c=l>>16,u=l&65535;if(c<1||a<c)throw new fe("Bad encoding in flate stream");return this.codeBuf=s>>c,this.codeSize=a-c,u}generateHuffmanTable(e){const r=e.length;let n=0,i;for(i=0;i<r;++i)e[i]>n&&(n=e[i]);const a=1<<n,s=new Int32Array(a);for(let o=1,l=0,c=2;o<=n;++o,l<<=1,c<<=1)for(let u=0;u<r;++u)if(e[u]===o){let h=0,f=l;for(i=0;i<o;++i)h=h<<1|f&1,f>>=1;for(i=h;i<a;i+=c)s[i]=o<<16|u;++l}return[s,n]}#e(e){Ht(e),this.eof=!0}readBlock(){let e,r,n;const i=this.stream;try{r=this.getBits(3)}catch(c){this.#e(c.message);return}if(r&1&&(this.eof=!0),r>>=1,r===0){let c;if((c=i.getByte())===-1){this.#e("Bad block header in flate stream");return}let u=c;if((c=i.getByte())===-1){this.#e("Bad block header in flate stream");return}if(u|=c<<8,(c=i.getByte())===-1){this.#e("Bad block header in flate stream");return}let h=c;if((c=i.getByte())===-1){this.#e("Bad block header in flate stream");return}if(h|=c<<8,h!==(~u&65535)&&(u!==0||h!==0))throw new fe("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;const f=this.bufferLength,d=f+u;if(e=this.ensureBuffer(d),this.bufferLength=d,u===0)i.peekByte()===-1&&(this.eof=!0);else{const p=i.getBytes(u);e.set(p,f),p.length<u&&(this.eof=!0)}return}let a,s;if(r===1)a=mpe,s=vpe;else if(r===2){const c=this.getBits(5)+257,u=this.getBits(5)+1,h=this.getBits(4)+4,f=new Uint8Array(DN.length);let d;for(d=0;d<h;++d)f[DN[d]]=this.getBits(3);const p=this.generateHuffmanTable(f);n=0,d=0;const g=c+u,m=new Uint8Array(g);let v,y,x;for(;d<g;){const b=this.getCode(p);if(b===16)v=2,y=3,x=n;else if(b===17)v=3,y=3,x=n=0;else if(b===18)v=7,y=11,x=n=0;else{m[d++]=n=b;continue}let w=this.getBits(v)+y;for(;w-- >0;)m[d++]=x}a=this.generateHuffmanTable(m.subarray(0,c)),s=this.generateHuffmanTable(m.subarray(c,g))}else throw new fe("Unknown block type in flate stream");e=this.buffer;let o=e?e.length:0,l=this.bufferLength;for(;;){let c=this.getCode(a);if(c<256){l+1>=o&&(e=this.ensureBuffer(l+1),o=e.length),e[l++]=c;continue}if(c===256){this.bufferLength=l;return}c-=257,c=ppe[c];let u=c>>16;u>0&&(u=this.getBits(u)),n=(c&65535)+u,c=this.getCode(s),c=gpe[c],u=c>>16,u>0&&(u=this.getBits(u));const h=(c&65535)+u;l+n>=o&&(e=this.ensureBuffer(l+n),o=e.length);for(let f=0;f<n;++f,++l)e[l]=e[l-h]}}}const ype=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];class xpe{constructor(e,r,n){this.data=e,this.bp=r,this.dataEnd=n,this.chigh=e[r],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){const e=this.data;let r=this.bp;e[r]===255?e[r+1]>143?(this.clow+=65280,this.ct=8):(r++,this.clow+=e[r]<<9,this.ct=7,this.bp=r):(r++,this.clow+=r<this.dataEnd?e[r]<<8:65280,this.ct=8,this.bp=r),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(e,r){let n=e[r]>>1,i=e[r]&1;const a=ype[n],s=a.qe;let o,l=this.a-s;if(this.chigh<s)l<s?(l=s,o=i,n=a.nmps):(l=s,o=1^i,a.switchFlag===1&&(i=o),n=a.nlps);else{if(this.chigh-=s,(l&32768)!==0)return this.a=l,i;l<s?(o=1^i,a.switchFlag===1&&(i=o),n=a.nlps):(o=i,n=a.nmps)}do this.ct===0&&this.byteIn(),l<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while((l&32768)===0);return this.a=l,e[r]=n<<1|i,o}}class mn extends ss{constructor(e){super(e,"Jbig2Error")}}class bpe{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}}class k1{constructor(e,r,n){this.data=e,this.start=r,this.end=n}get decoder(){const e=new xpe(this.data,this.start,this.end);return Te(this,"decoder",e)}get contextCache(){const e=new bpe;return Te(this,"contextCache",e)}}function ma(t,e,r){const n=t.getContexts(e);let i=1;function a(c){let u=0;for(let h=0;h<c;h++){const f=r.readBit(n,i);i=i<256?i<<1|f:(i<<1|f)&511|256,u=u<<1|f}return u>>>0}const s=a(1),o=a(1)?a(1)?a(1)?a(1)?a(1)?a(32)+4436:a(12)+340:a(8)+84:a(6)+20:a(4)+4:a(2);let l;return s===0?l=o:o>0&&(l=-o),l>=d0e&&l<=iT?l:null}function Hq(t,e,r){const n=t.getContexts("IAID");let i=1;for(let a=0;a<r;a++){const s=e.readBit(n,i);i=i<<1|s}return r<31?i&(1<<r)-1:i&2147483647}const LN=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],wpe=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],PN=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],_pe=[39717,1941,229,405];function Spe(t,e,r){const n=r.decoder,i=r.contextCache.getContexts("GB"),a=[];let s,o,l,c,u,h,f;const d=31735;for(o=0;o<e;o++)for(u=a[o]=new Uint8Array(t),h=o<1?u:a[o-1],f=o<2?u:a[o-2],s=f[0]<<13|f[1]<<12|f[2]<<11|h[0]<<7|h[1]<<6|h[2]<<5|h[3]<<4,l=0;l<t;l++)u[l]=c=n.readBit(i,s),s=(s&d)<<1|(l+3<t?f[l+3]<<11:0)|(l+4<t?h[l+4]<<4:0)|c;return a}function K3(t,e,r,n,i,a,s,o){if(t){const U=new rx(o.data,o.start,o.end);return NI(U,e,r,!1)}if(n===0&&!i&&s.length===4&&s[0].x===3&&s[0].y===-1&&s[1].x===-3&&s[1].y===-1&&s[2].x===2&&s[2].y===-2&&s[3].x===-2&&s[3].y===-2)return Spe(e,r,o);const l=wpe[n].concat(s);l.sort((U,j)=>U.y-j.y||U.x-j.x);const c=l.length,u=new Int8Array(c),h=new Int8Array(c),f=[];let d=0,p=0,g=0,m=0,v,y;for(y=0;y<c;y++)u[y]=l[y].x,h[y]=l[y].y,p=Math.min(p,l[y].x),g=Math.max(g,l[y].x),m=Math.min(m,l[y].y),y<c-1&&l[y].y===l[y+1].y&&l[y].x===l[y+1].x-1?d|=1<<c-1-y:f.push(y);const x=f.length,b=new Int8Array(x),w=new Int8Array(x),_=new Uint16Array(x);for(v=0;v<x;v++)y=f[v],b[v]=l[y].x,w[v]=l[y].y,_[v]=1<<c-1-y;const S=-p,C=-m,T=e-g,A=_pe[n];let k=new Uint8Array(e);const I=[],E=o.decoder,M=o.contextCache.getContexts("GB");let R=0,D,L,P,O=0,$,N;for(let U=0;U<r;U++){if(i){const j=E.readBit(M,A);if(R^=j,R){I.push(k);continue}}for(k=new Uint8Array(k),I.push(k),D=0;D<e;D++){if(D>=S&&D<T&&U>=C)for(O=O<<1&d,y=0;y<x;y++)L=U+w[y],P=D+b[y],$=I[L][P],$&&($=_[y],O|=$);else for(O=0,N=c-1,y=0;y<c;y++,N--)P=D+u[y],P>=0&&P<e&&(L=U+h[y],L>=0&&($=I[L][P],$&&(O|=$<<N)));const j=E.readBit(M,O);k[D]=j}}return I}function Gq(t,e,r,n,i,a,s,o,l){let c=PN[r].coding;r===0&&(c=c.concat([o[0]]));const u=c.length,h=new Int32Array(u),f=new Int32Array(u);let d;for(d=0;d<u;d++)h[d]=c[d].x,f[d]=c[d].y;let p=PN[r].reference;r===0&&(p=p.concat([o[1]]));const g=p.length,m=new Int32Array(g),v=new Int32Array(g);for(d=0;d<g;d++)m[d]=p[d].x,v[d]=p[d].y;const y=n[0].length,x=n.length,b=[],w=l.decoder,_=l.contextCache.getContexts("GR");for(let S=0;S<e;S++){const C=new Uint8Array(t);b.push(C);for(let T=0;T<t;T++){let A,k,I=0;for(d=0;d<u;d++)A=S+f[d],k=T+h[d],A<0||k<0||k>=t?I<<=1:I=I<<1|b[A][k];for(d=0;d<g;d++)A=S+v[d]-a,k=T+m[d]-i,A<0||A>=x||k<0||k>=y?I<<=1:I=I<<1|n[A][k];const E=w.readBit(_,I);C[T]=E}}return b}function Cpe(t,e,r,n,i,a,s,o,l,c,u,h){if(t&&e)throw new mn("symbol refinement with Huffman is not supported");const f=[];let d=0,p=LI(r.length+n);const g=u.decoder,m=u.contextCache;let v,y;for(t&&(v=Dh(1),y=[],p=Math.max(p,1));f.length<n;){const T=t?a.tableDeltaHeight.decode(h):ma(m,"IADH",g);d+=T;let A=0,k=0;const I=t?y.length:0;for(;;){const E=t?a.tableDeltaWidth.decode(h):ma(m,"IADW",g);if(E===null)break;A+=E,k+=A;let M;if(e){const R=ma(m,"IAAI",g);if(R>1)M=Wq(t,e,A,d,0,R,1,r.concat(f),p,0,0,1,0,a,l,c,u,0,h);else{const D=Hq(m,g,p),L=ma(m,"IARDX",g),P=ma(m,"IARDY",g),O=D<r.length?r[D]:f[D-r.length];M=Gq(A,d,l,O,L,P,!1,c,u)}f.push(M)}else t?y.push(A):(M=K3(!1,A,d,s,!1,null,o,u),f.push(M))}if(t&&!e){const E=a.tableBitmapSize.decode(h);h.byteAlign();let M;if(E===0)M=Ope(h,k,d);else{const D=h.end,L=h.position+E;h.end=L,M=NI(h,k,d,!1),h.end=D,h.position=L}const R=y.length;if(I===R-1)f.push(M);else{let D,L,P=0,O,$,N;for(D=I;D<R;D++){for($=y[D],O=P+$,N=[],L=0;L<d;L++)N.push(M[L].subarray(P,O));f.push(N),P=O}}}}const x=[],b=[];let w=!1,_,S;const C=r.length+n;for(;b.length<C;){let T=t?v.decode(h):ma(m,"IAEX",g);for(;T--;)b.push(w);w=!w}for(_=0,S=r.length;_<S;_++)b[_]&&x.push(r[_]);for(let T=0;T<n;_++,T++)b[_]&&x.push(f[T]);return x}function Wq(t,e,r,n,i,a,s,o,l,c,u,h,f,d,p,g,m,v,y){if(t&&e)throw new mn("refinement with Huffman is not supported");const x=[];let b,w;for(b=0;b<n;b++)w=new Uint8Array(r),i&&w.fill(i),x.push(w);const _=m.decoder,S=m.contextCache;let C=t?-d.tableDeltaT.decode(y):-ma(S,"IADT",_),T=0;for(b=0;b<a;){const A=t?d.tableDeltaT.decode(y):ma(S,"IADT",_);C+=A;const k=t?d.tableFirstS.decode(y):ma(S,"IAFS",_);T+=k;let I=T;do{let E=0;s>1&&(E=t?y.readBits(v):ma(S,"IAIT",_));const M=s*C+E,R=t?d.symbolIDTable.decode(y):Hq(S,_,l),D=e&&(t?y.readBit():ma(S,"IARI",_));let L=o[R],P=L[0].length,O=L.length;if(D){const X=ma(S,"IARDW",_),K=ma(S,"IARDH",_),G=ma(S,"IARDX",_),H=ma(S,"IARDY",_);P+=X,O+=K,L=Gq(P,O,p,L,(X>>1)+G,(K>>1)+H,!1,g,m)}let $=0;c?h&1?$=O-1:I+=O-1:h>1?I+=P-1:$=P-1;const N=M-(h&1?0:O-1),U=I-(h&2?P-1:0);let j,B,q;if(c)for(j=0;j<O;j++){if(w=x[U+j],!w)continue;q=L[j];const X=Math.min(r-N,P);switch(f){case 0:for(B=0;B<X;B++)w[N+B]|=q[B];break;case 2:for(B=0;B<X;B++)w[N+B]^=q[B];break;default:throw new mn(`operator ${f} is not supported`)}}else for(B=0;B<O;B++)if(w=x[N+B],!!w)switch(q=L[B],f){case 0:for(j=0;j<P;j++)w[U+j]|=q[j];break;case 2:for(j=0;j<P;j++)w[U+j]^=q[j];break;default:throw new mn(`operator ${f} is not supported`)}b++;const W=t?d.tableDeltaS.decode(y):ma(S,"IADS",_);if(W===null)break;I+=$+W+u}while(!0)}return x}function Ape(t,e,r,n,i,a){const s=[];t||(s.push({x:-e,y:0}),i===0&&s.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const o=(n+1)*e,l=K3(t,o,r,i,!1,null,s,a),c=[];for(let u=0;u<=n;u++){const h=[],f=e*u,d=f+e;for(let p=0;p<r;p++)h.push(l[p].subarray(f,d));c.push(h)}return c}function Tpe(t,e,r,n,i,a,s,o,l,c,u,h,f,d,p){if(s)throw new mn("skip is not supported");if(o!==0)throw new mn(`operator "${o}" is not supported in halftone region`);const m=[];let v,y,x;for(v=0;v<i;v++)x=new Uint8Array(n),a&&x.fill(a),m.push(x);const b=e.length,w=e[0],_=w[0].length,S=w.length,C=LI(b),T=[];t||(T.push({x:r<=1?3:2,y:-1}),r===0&&T.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const A=[];let k,I;for(t&&(k=new rx(p.data,p.start,p.end)),v=C-1;v>=0;v--)t?I=NI(k,l,c,!0):I=K3(!1,l,c,r,!1,null,T,p),A[v]=I;let E,M,R,D,L,P,O,$,N;for(E=0;E<c;E++)for(M=0;M<l;M++){for(R=0,D=0,y=C-1;y>=0;y--)R^=A[y][E][M],D|=R<<y;if(L=e[D],P=u+E*d+M*f>>8,O=h+E*f-M*d>>8,P>=0&&P+_<=n&&O>=0&&O+S<=i)for(v=0;v<S;v++)for(N=m[O+v],$=L[v],y=0;y<_;y++)N[P+y]|=$[y];else{let U,j;for(v=0;v<S;v++)if(j=O+v,!(j<0||j>=i))for(N=m[j],$=L[v],y=0;y<_;y++)U=P+y,U>=0&&U<n&&(N[U]|=$[y])}}return m}function kpe(t,e){const r={};r.number=kr(t,e);const n=t[e+4],i=n&63;if(!LN[i])throw new mn("invalid segment type: "+i);r.type=i,r.typeName=LN[i],r.deferredNonRetain=!!(n&128);const a=!!(n&64),s=t[e+5];let o=s>>5&7;const l=[s&31];let c=e+6;if(o===7){o=kr(t,c-1)&536870911,c+=3;let p=o+8>>3;for(l[0]=t[c++];--p>0;)l.push(t[c++])}else if(o===5||o===6)throw new mn("invalid referred-to flags");r.retainBits=l;let u=4;r.number<=256?u=1:r.number<=65536&&(u=2);const h=[];let f,d;for(f=0;f<o;f++){let p;u===1?p=t[c]:u===2?p=Zt(t,c):p=kr(t,c),h.push(p),c+=u}if(r.referredTo=h,a?(r.pageAssociation=kr(t,c),c+=4):r.pageAssociation=t[c++],r.length=kr(t,c),c+=4,r.length===4294967295)if(i===38){const p=x_(t,c),m=!!(t[c+b_]&1),v=6,y=new Uint8Array(v);for(m||(y[0]=255,y[1]=172),y[2]=p.height>>>24&255,y[3]=p.height>>16&255,y[4]=p.height>>8&255,y[5]=p.height&255,f=c,d=t.length;f<d;f++){let x=0;for(;x<v&&y[x]===t[f+x];)x++;if(x===v){r.length=f+v;break}}if(r.length===4294967295)throw new mn("segment end was not found")}else throw new mn("invalid unknown segment length");return r.headerEnd=c,r}function Epe(t,e,r,n){const i=[];let a=r;for(;a<n;){const s=kpe(e,a);a=s.headerEnd;const o={header:s,data:e};if(t.randomAccess||(o.start=a,a+=s.length,o.end=a),i.push(o),s.type===51)break}if(t.randomAccess)for(let s=0,o=i.length;s<o;s++)i[s].start=a,a+=i[s].header.length,i[s].end=a;return i}function x_(t,e){return{width:kr(t,e),height:kr(t,e+4),x:kr(t,e+8),y:kr(t,e+12),combinationOperator:t[e+16]&7}}const b_=17;function Ipe(t,e){const r=t.header,n=t.data,i=t.end;let a=t.start,s,o,l,c;switch(r.type){case 0:const h={},f=Zt(n,a);if(h.huffman=!!(f&1),h.refinement=!!(f&2),h.huffmanDHSelector=f>>2&3,h.huffmanDWSelector=f>>4&3,h.bitmapSizeSelector=f>>6&1,h.aggregationInstancesSelector=f>>7&1,h.bitmapCodingContextUsed=!!(f&256),h.bitmapCodingContextRetained=!!(f&512),h.template=f>>10&3,h.refinementTemplate=f>>12&1,a+=2,!h.huffman){for(c=h.template===0?4:1,o=[],l=0;l<c;l++)o.push({x:Yl(n,a),y:Yl(n,a+1)}),a+=2;h.at=o}if(h.refinement&&!h.refinementTemplate){for(o=[],l=0;l<2;l++)o.push({x:Yl(n,a),y:Yl(n,a+1)}),a+=2;h.refinementAt=o}h.numberOfExportedSymbols=kr(n,a),a+=4,h.numberOfNewSymbols=kr(n,a),a+=4,s=[h,r.number,r.referredTo,n,a,i];break;case 6:case 7:const d={};d.info=x_(n,a),a+=b_;const p=Zt(n,a);if(a+=2,d.huffman=!!(p&1),d.refinement=!!(p&2),d.logStripSize=p>>2&3,d.stripSize=1<<d.logStripSize,d.referenceCorner=p>>4&3,d.transposed=!!(p&64),d.combinationOperator=p>>7&3,d.defaultPixelValue=p>>9&1,d.dsOffset=p<<17>>27,d.refinementTemplate=p>>15&1,d.huffman){const S=Zt(n,a);a+=2,d.huffmanFS=S&3,d.huffmanDS=S>>2&3,d.huffmanDT=S>>4&3,d.huffmanRefinementDW=S>>6&3,d.huffmanRefinementDH=S>>8&3,d.huffmanRefinementDX=S>>10&3,d.huffmanRefinementDY=S>>12&3,d.huffmanRefinementSizeSelector=!!(S&16384)}if(d.refinement&&!d.refinementTemplate){for(o=[],l=0;l<2;l++)o.push({x:Yl(n,a),y:Yl(n,a+1)}),a+=2;d.refinementAt=o}d.numberOfSymbolInstances=kr(n,a),a+=4,s=[d,r.referredTo,n,a,i];break;case 16:const g={},m=n[a++];g.mmr=!!(m&1),g.template=m>>1&3,g.patternWidth=n[a++],g.patternHeight=n[a++],g.maxPatternIndex=kr(n,a),a+=4,s=[g,r.number,n,a,i];break;case 22:case 23:const v={};v.info=x_(n,a),a+=b_;const y=n[a++];v.mmr=!!(y&1),v.template=y>>1&3,v.enableSkip=!!(y&8),v.combinationOperator=y>>4&7,v.defaultPixelValue=y>>7&1,v.gridWidth=kr(n,a),a+=4,v.gridHeight=kr(n,a),a+=4,v.gridOffsetX=kr(n,a)&4294967295,a+=4,v.gridOffsetY=kr(n,a)&4294967295,a+=4,v.gridVectorX=Zt(n,a),a+=2,v.gridVectorY=Zt(n,a),a+=2,s=[v,r.referredTo,n,a,i];break;case 38:case 39:const x={};x.info=x_(n,a),a+=b_;const b=n[a++];if(x.mmr=!!(b&1),x.template=b>>1&3,x.prediction=!!(b&8),!x.mmr){for(c=x.template===0?4:1,o=[],l=0;l<c;l++)o.push({x:Yl(n,a),y:Yl(n,a+1)}),a+=2;x.at=o}s=[x,n,a,i];break;case 48:const w={width:kr(n,a),height:kr(n,a+4),resolutionX:kr(n,a+8),resolutionY:kr(n,a+12)};w.height===4294967295&&delete w.height;const _=n[a+16];Zt(n,a+17),w.lossless=!!(_&1),w.refinement=!!(_&2),w.defaultPixelValue=_>>2&1,w.combinationOperator=_>>3&3,w.requiresBuffer=!!(_&32),w.combinationOperatorOverride=!!(_&64),s=[w];break;case 49:break;case 50:break;case 51:break;case 53:s=[r.number,n,a,i];break;case 62:break;default:throw new mn(`segment type ${r.typeName}(${r.type}) is not implemented`)}const u="on"+r.typeName;u in e&&e[u].apply(e,s)}function Dpe(t,e){for(let r=0,n=t.length;r<n;r++)Ipe(t[r],e)}function Mpe(t){const e=new Lpe;for(let r=0,n=t.length;r<n;r++){const i=t[r],a=Epe({},i.data,i.start,i.end);Dpe(a,e)}return e.buffer}class Lpe{onPageInformation(e){this.currentPageInfo=e;const r=e.width+7>>3,n=new Uint8ClampedArray(r*e.height);e.defaultPixelValue&&n.fill(255),this.buffer=n}drawBitmap(e,r){const n=this.currentPageInfo,i=e.width,a=e.height,s=n.width+7>>3,o=n.combinationOperatorOverride?e.combinationOperator:n.combinationOperator,l=this.buffer,c=128>>(e.x&7);let u=e.y*s+(e.x>>3),h,f,d,p;switch(o){case 0:for(h=0;h<a;h++){for(d=c,p=u,f=0;f<i;f++)r[h][f]&&(l[p]|=d),d>>=1,d||(d=128,p++);u+=s}break;case 2:for(h=0;h<a;h++){for(d=c,p=u,f=0;f<i;f++)r[h][f]&&(l[p]^=d),d>>=1,d||(d=128,p++);u+=s}break;default:throw new mn(`operator ${o} is not supported`)}}onImmediateGenericRegion(e,r,n,i){const a=e.info,s=new k1(r,n,i),o=K3(e.mmr,a.width,a.height,e.template,e.prediction,null,e.at,s);this.drawBitmap(a,o)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,r,n,i,a,s){let o,l;e.huffman&&(o=Npe(e,n,this.customTables),l=new rx(i,a,s));let c=this.symbols;c||(this.symbols=c={});const u=[];for(const f of n){const d=c[f];d&&u.push(...d)}const h=new k1(i,a,s);c[r]=Cpe(e.huffman,e.refinement,u,e.numberOfNewSymbols,e.numberOfExportedSymbols,o,e.template,e.at,e.refinementTemplate,e.refinementAt,h,l)}onImmediateTextRegion(e,r,n,i,a){const s=e.info;let o,l;const c=this.symbols,u=[];for(const p of r){const g=c[p];g&&u.push(...g)}const h=LI(u.length);e.huffman&&(l=new rx(n,i,a),o=Rpe(e,r,this.customTables,u.length,l));const f=new k1(n,i,a),d=Wq(e.huffman,e.refinement,s.width,s.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,u,h,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,o,e.refinementTemplate,e.refinementAt,f,e.logStripSize,l);this.drawBitmap(s,d)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,r,n,i,a){let s=this.patterns;s||(this.patterns=s={});const o=new k1(n,i,a);s[r]=Ape(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,o)}onImmediateHalftoneRegion(e,r,n,i,a){const s=this.patterns[r[0]],o=e.info,l=new k1(n,i,a),c=Tpe(e.mmr,s,e.template,o.width,o.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,l);this.drawBitmap(o,c)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,r,n,i){let a=this.customTables;a||(this.customTables=a={}),a[e]=Ppe(r,n,i)}}class Ih{constructor(e){e.length===2?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=e[0],this.rangeLength=0,this.prefixCode=e[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=e[0],this.prefixLength=e[1],this.rangeLength=e[2],this.prefixCode=e[3],this.isLowerRange=e[4]==="lower")}}class ES{constructor(e){this.children=[],e?(this.isLeaf=!0,this.rangeLength=e.rangeLength,this.rangeLow=e.rangeLow,this.isLowerRange=e.isLowerRange,this.isOOB=e.isOOB):this.isLeaf=!1}buildTree(e,r){const n=e.prefixCode>>r&1;if(r<=0)this.children[n]=new ES(e);else{let i=this.children[n];i||(this.children[n]=i=new ES(null)),i.buildTree(e,r-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const n=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-n:n)}const r=this.children[e.readBit()];if(!r)throw new mn("invalid Huffman data");return r.decodeNode(e)}}class IS{constructor(e,r){r||this.assignPrefixCodes(e),this.rootNode=new ES(null);for(let n=0,i=e.length;n<i;n++){const a=e[n];a.prefixLength>0&&this.rootNode.buildTree(a,a.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){const r=e.length;let n=0;for(let u=0;u<r;u++)n=Math.max(n,e[u].prefixLength);const i=new Uint32Array(n+1);for(let u=0;u<r;u++)i[e[u].prefixLength]++;let a=1,s=0,o,l,c;for(i[0]=0;a<=n;){for(s=s+i[a-1]<<1,o=s,l=0;l<r;)c=e[l],c.prefixLength===a&&(c.prefixCode=o,o++),l++;a++}}}function Ppe(t,e,r){const n=t[e],i=kr(t,e+1)&4294967295,a=kr(t,e+5)&4294967295,s=new rx(t,e+9,r),o=(n>>1&7)+1,l=(n>>4&7)+1,c=[];let u,h,f=i;do u=s.readBits(o),h=s.readBits(l),c.push(new Ih([f,u,h,0])),f+=1<<h;while(f<a);return u=s.readBits(o),c.push(new Ih([i-1,u,32,0,"lower"])),u=s.readBits(o),c.push(new Ih([a,u,32,0])),n&1&&(u=s.readBits(o),c.push(new Ih([u,0]))),new IS(c,!1)}const RN={};function Dh(t){let e=RN[t];if(e)return e;let r;switch(t){case 1:r=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:r=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:r=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:r=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:r=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:r=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:r=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:r=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:r=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:r=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:r=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:r=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:r=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:r=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:r=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new mn(`standard table B.${t} does not exist`)}for(let n=0,i=r.length;n<i;n++)r[n]=new Ih(r[n]);return e=new IS(r,!0),RN[t]=e,e}class rx{constructor(e,r,n){this.data=e,this.start=r,this.end=n,this.position=r,this.shift=-1,this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new mn("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}const e=this.currentByte>>this.shift&1;return this.shift--,e}readBits(e){let r=0,n;for(n=e-1;n>=0;n--)r|=this.readBit()<<n;return r}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function Ed(t,e,r){let n=0;for(let i=0,a=e.length;i<a;i++){const s=r[e[i]];if(s){if(t===n)return s;n++}}throw new mn("can't find custom Huffman table")}function Rpe(t,e,r,n,i){const a=[];for(let f=0;f<=34;f++){const d=i.readBits(4);a.push(new Ih([f,d,0,0]))}const s=new IS(a,!1);a.length=0;for(let f=0;f<n;){const d=s.decode(i);if(d>=32){let p,g,m;switch(d){case 32:if(f===0)throw new mn("no previous value in symbol ID table");g=i.readBits(2)+3,p=a[f-1].prefixLength;break;case 33:g=i.readBits(3)+3,p=0;break;case 34:g=i.readBits(7)+11,p=0;break;default:throw new mn("invalid code length in symbol ID table")}for(m=0;m<g;m++)a.push(new Ih([f,p,0,0])),f++}else a.push(new Ih([f,d,0,0])),f++}i.byteAlign();const o=new IS(a,!1);let l=0,c,u,h;switch(t.huffmanFS){case 0:case 1:c=Dh(t.huffmanFS+6);break;case 3:c=Ed(l,e,r),l++;break;default:throw new mn("invalid Huffman FS selector")}switch(t.huffmanDS){case 0:case 1:case 2:u=Dh(t.huffmanDS+8);break;case 3:u=Ed(l,e,r),l++;break;default:throw new mn("invalid Huffman DS selector")}switch(t.huffmanDT){case 0:case 1:case 2:h=Dh(t.huffmanDT+11);break;case 3:h=Ed(l,e,r),l++;break;default:throw new mn("invalid Huffman DT selector")}if(t.refinement)throw new mn("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:c,tableDeltaS:u,tableDeltaT:h}}function Npe(t,e,r){let n=0,i,a;switch(t.huffmanDHSelector){case 0:case 1:i=Dh(t.huffmanDHSelector+4);break;case 3:i=Ed(n,e,r),n++;break;default:throw new mn("invalid Huffman DH selector")}switch(t.huffmanDWSelector){case 0:case 1:a=Dh(t.huffmanDWSelector+2);break;case 3:a=Ed(n,e,r),n++;break;default:throw new mn("invalid Huffman DW selector")}let s,o;return t.bitmapSizeSelector?(s=Ed(n,e,r),n++):s=Dh(1),t.aggregationInstancesSelector?o=Ed(n,e,r):o=Dh(1),{tableDeltaHeight:i,tableDeltaWidth:a,tableBitmapSize:s,tableAggregateInstances:o}}function Ope(t,e,r){const n=[];for(let i=0;i<r;i++){const a=new Uint8Array(e);n.push(a);for(let s=0;s<e;s++)a[s]=t.readBit();t.byteAlign()}return n}function NI(t,e,r,n){const i={K:-1,Columns:e,Rows:r,BlackIs1:!0,EndOfBlock:n},a=new jq(t,i),s=[];let o,l=!1;for(let c=0;c<r;c++){const u=new Uint8Array(e);s.push(u);let h=-1;for(let f=0;f<e;f++)h<0&&(o=a.readNextChar(),o===-1&&(o=0,l=!0),h=7),u[f]=o>>h&1,h--}if(n&&!l)for(let u=0;u<5&&a.readNextChar()!==-1;u++);return s}class Bpe{parseChunks(e){return Mpe(e)}parse(e){throw new Error("Not implemented: Jbig2Image.parse")}}class Fpe extends es{constructor(e,r,n){super(r),this.stream=e,this.dict=e.dict,this.maybeLength=r,this.params=n}get bytes(){return Te(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}decodeImage(e){if(this.eof)return this.buffer;e||=this.bytes;const r=new Bpe,n=[];if(this.params instanceof re){const s=this.params.get("JBIG2Globals");if(s instanceof Pt){const o=s.getBytes();n.push({data:o,start:0,end:o.length})}}n.push({data:e,start:0,end:e.length});const i=r.parseChunks(n),a=i.length;for(let s=0;s<a;s++)i[s]^=255;return this.buffer=i,this.bufferLength=a,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class $pe extends es{constructor(e,r,n){super(r),this.stream=e,this.dict=e.dict,this.maybeLength=r,this.params=n}get bytes(){return Te(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(e){tr("JpxStream.readBlock")}get isAsyncDecoder(){return!0}async decodeImage(e,r){return this.eof?this.buffer:(e||=this.bytes,this.buffer=await Y3.decode(e,r),this.bufferLength=this.buffer.length,this.eof=!0,this.buffer)}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class NN extends es{constructor(e,r,n){super(r),this.stream=e,this.dict=e.dict,this.cachedData=0,this.bitsCached=0;const i=4096,a={earlyChange:n,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(i),dictionaryLengths:new Uint16Array(i),dictionaryPrevCodes:new Uint16Array(i),currentSequence:new Uint8Array(i),currentSequenceLength:0};for(let s=0;s<256;++s)a.dictionaryValues[s]=s,a.dictionaryLengths[s]=1;this.lzwState=a}readBits(e){let r=this.bitsCached,n=this.cachedData;for(;r<e;){const i=this.stream.getByte();if(i===-1)return this.eof=!0,null;n=n<<8|i,r+=8}return this.bitsCached=r-=e,this.cachedData=n,this.lastCode=null,n>>>r&(1<<e)-1}readBlock(){let n=1024,i,a,s;const o=this.lzwState;if(!o)return;const l=o.earlyChange;let c=o.nextCode;const u=o.dictionaryValues,h=o.dictionaryLengths,f=o.dictionaryPrevCodes;let d=o.codeLength,p=o.prevCode;const g=o.currentSequence;let m=o.currentSequenceLength,v=0,y=this.bufferLength,x=this.ensureBuffer(this.bufferLength+n);for(i=0;i<512;i++){const b=this.readBits(d),w=m>0;if(b<256)g[0]=b,m=1;else if(b>=258)if(b<c)for(m=h[b],a=m-1,s=b;a>=0;a--)g[a]=u[s],s=f[s];else g[m++]=g[0];else if(b===256){d=9,c=258,m=0;continue}else{this.eof=!0,delete this.lzwState;break}if(w&&(f[c]=p,h[c]=h[p]+1,u[c]=g[0],c++,d=c+l&c+l-1?d:Math.min(Math.log(c+l)/.6931471805599453+1,12)|0),p=b,v+=m,n<v){do n+=512;while(n<v);x=this.ensureBuffer(this.bufferLength+n)}for(a=0;a<m;a++)x[y++]=g[a]}o.nextCode=c,o.codeLength=d,o.prevCode=p,o.currentSequenceLength=m,this.bufferLength=y}}class ON extends es{constructor(e,r,n){if(super(r),!(n instanceof re))return e;const i=this.predictor=n.get("Predictor")||1;if(i<=1)return e;if(i!==2&&(i<10||i>15))throw new fe(`Unsupported predictor: ${i}`);this.readBlock=i===2?this.readBlockTiff:this.readBlockPng,this.stream=e,this.dict=e.dict;const a=this.colors=n.get("Colors")||1,s=this.bits=n.get("BPC","BitsPerComponent")||8,o=this.columns=n.get("Columns")||1;return this.pixBytes=a*s+7>>3,this.rowBytes=o*a*s+7>>3,this}readBlockTiff(){const e=this.rowBytes,r=this.bufferLength,n=this.ensureBuffer(r+e),i=this.bits,a=this.colors,s=this.stream.getBytes(e);if(this.eof=!s.length,this.eof)return;let o=0,l=0,c=0,u=0,h=r,f;if(i===1&&a===1)for(f=0;f<e;++f){let d=s[f]^o;d^=d>>1,d^=d>>2,d^=d>>4,o=(d&1)<<7,n[h++]=d}else if(i===8){for(f=0;f<a;++f)n[h++]=s[f];for(;f<e;++f)n[h]=n[h-a]+s[f],h++}else if(i===16){const d=a*2;for(f=0;f<d;++f)n[h++]=s[f];for(;f<e;f+=2){const p=((s[f]&255)<<8)+(s[f+1]&255)+((n[h-d]&255)<<8)+(n[h-d+1]&255);n[h++]=p>>8&255,n[h++]=p&255}}else{const d=new Uint8Array(a+1),p=(1<<i)-1;let g=0,m=r;const v=this.columns;for(f=0;f<v;++f)for(let y=0;y<a;++y)c<i&&(o=o<<8|s[g++]&255,c+=8),d[y]=d[y]+(o>>c-i)&p,c-=i,l=l<<i|d[y],u+=i,u>=8&&(n[m++]=l>>u-8&255,u-=8);u>0&&(n[m++]=(l<<8-u)+(o&(1<<8-u)-1))}this.bufferLength+=e}readBlockPng(){const e=this.rowBytes,r=this.pixBytes,n=this.stream.getByte(),i=this.stream.getBytes(e);if(this.eof=!i.length,this.eof)return;const a=this.bufferLength,s=this.ensureBuffer(a+e);let o=s.subarray(a-e,a);o.length===0&&(o=new Uint8Array(e));let l,c=a,u,h;switch(n){case 0:for(l=0;l<e;++l)s[c++]=i[l];break;case 1:for(l=0;l<r;++l)s[c++]=i[l];for(;l<e;++l)s[c]=s[c-r]+i[l]&255,c++;break;case 2:for(l=0;l<e;++l)s[c++]=o[l]+i[l]&255;break;case 3:for(l=0;l<r;++l)s[c++]=(o[l]>>1)+i[l];for(;l<e;++l)s[c]=(o[l]+s[c-r]>>1)+i[l]&255,c++;break;case 4:for(l=0;l<r;++l)u=o[l],h=i[l],s[c++]=u+h;for(;l<e;++l){u=o[l];const f=o[l-r],d=s[c-r],p=d+u-f;let g=p-d;g<0&&(g=-g);let m=p-u;m<0&&(m=-m);let v=p-f;v<0&&(v=-v),h=i[l],g<=m&&g<=v?s[c++]=d+h:m<=v?s[c++]=u+h:s[c++]=f+h}break;default:throw new fe(`Unsupported predictor: ${n}`)}this.bufferLength+=e}}class zpe extends es{constructor(e,r){super(r),this.stream=e,this.dict=e.dict}readBlock(){const e=this.stream.getBytes(2);if(!e||e.length<2||e[0]===128){this.eof=!0;return}let r,n=this.bufferLength,i=e[0];if(i<128){if(r=this.ensureBuffer(n+i+1),r[n++]=e[1],i>0){const a=this.stream.getBytes(i);r.set(a,n),n+=i}}else i=257-i,r=this.ensureBuffer(n+i+1),r.fill(e[1],n,n+i),n+=i;this.bufferLength=n}}const Vpe=1e3;function Upe(t){const e=[],r=t.length;let n=0;for(;n<r-1;)e.push(t[n++]<<8|t[n++]);return n<r&&e.push(t[n]),r+"_"+String.fromCharCode.apply(null,e)}class vh{constructor({lexer:e,xref:r,allowStreams:n=!1,recoveryMode:i=!1}){this.lexer=e,this.xref=r,this.allowStreams=n,this.recoveryMode=i,this.imageCache=Object.create(null),this._imageId=0,this.refill()}refill(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()}shift(){this.buf2 instanceof Bn&&this.buf2.cmd==="ID"?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}tryShift(){try{return this.shift(),!0}catch(e){if(e instanceof tn)throw e;return!1}}getObj(e=null){const r=this.buf1;if(this.shift(),r instanceof Bn)switch(r.cmd){case"BI":return this.makeInlineImage(e);case"[":const n=[];for(;!gi(this.buf1,"]")&&this.buf1!==Di;)n.push(this.getObj(e));if(this.buf1===Di){if(this.recoveryMode)return n;throw new oT("End of file inside array.")}return this.shift(),n;case"<<":const i=new re(this.xref);for(;!gi(this.buf1,">>")&&this.buf1!==Di;){if(!(this.buf1 instanceof xe)){Ht("Malformed dictionary: key must be a name object"),this.shift();continue}const a=this.buf1.name;if(this.shift(),this.buf1===Di)break;i.set(a,this.getObj(e))}if(this.buf1===Di){if(this.recoveryMode)return i;throw new oT("End of file inside dictionary.")}return gi(this.buf2,"stream")?this.allowStreams?this.makeStream(i,e):i:(this.shift(),i);default:return r}if(Number.isInteger(r)){if(Number.isInteger(this.buf1)&&gi(this.buf2,"R")){const n=Ae.get(r,this.buf1);return this.shift(),this.shift(),n}return r}return typeof r=="string"&&e?e.decryptString(r):r}findDefaultInlineStreamEnd(e){const{knownCommands:l}=this.lexer,c=e.pos,u=15;let h=0,f,d;for(;(f=e.getByte())!==-1;)if(h===0)h=f===69?1:0;else if(h===1)h=f===73?2:0;else if(f===32||f===10||f===13){d=e.pos;const g=e.peekBytes(u),m=g.length;if(m===0)break;for(let x=0;x<m;x++)if(f=g[x],!(f===0&&g[x+1]!==0)&&f!==10&&f!==13&&(f<32||f>127)){h=0;break}if(h!==2)continue;if(!l){ee("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const v=new el(new ln(e.peekBytes(5*u)),l);v._hexStringWarn=()=>{};let y=0;for(;;){const x=v.getObj();if(x===Di){h=0;break}if(x instanceof Bn){const b=l[x.cmd];if(b){if(b.variableArgs?y<=b.numArgs:y===b.numArgs)break}else{h=0;break}y=0;continue}y++}if(h===2)break}else h=0;f===-1&&(ee("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),d&&(ee('... trying to recover by using the last "EI" occurrence.'),e.skip(-(e.pos-d))));let p=4;return e.skip(-p),f=e.peekByte(),e.skip(p),Gs(f)||p--,e.pos-p-c}findDCTDecodeInlineStreamEnd(e){const r=e.pos;let n=!1,i,a;for(;(i=e.getByte())!==-1;)if(i===255){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:n=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:a=e.getUint16(),a>2?e.skip(a-2):e.skip(-2);break}if(n)break}const s=e.pos-r;return i===-1?(ee("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),e.skip(-s),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),s)}findASCII85DecodeInlineStreamEnd(e){const i=e.pos;let a;for(;(a=e.getByte())!==-1;)if(a===126){const o=e.pos;for(a=e.peekByte();Gs(a);)e.skip(),a=e.peekByte();if(a===62){e.skip();break}if(e.pos>o){const l=e.peekBytes(2);if(l[0]===69&&l[1]===73)break}}const s=e.pos-i;return a===-1?(ee("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-s),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),s)}findASCIIHexDecodeInlineStreamEnd(e){const n=e.pos;let i;for(;(i=e.getByte())!==-1&&i!==62;);const a=e.pos-n;return i===-1?(ee("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-a),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),a)}inlineStreamSkipEI(e){let i=0,a;for(;(a=e.getByte())!==-1;)if(i===0)i=a===69?1:0;else if(i===1)i=a===73?2:0;else if(i===2)break}makeInlineImage(e){const r=this.lexer,n=r.stream,i=Object.create(null);let a;for(;!gi(this.buf1,"ID")&&this.buf1!==Di;){if(!(this.buf1 instanceof xe))throw new fe("Dictionary key must be a name object");const d=this.buf1.name;if(this.shift(),this.buf1===Di)break;i[d]=this.getObj(e)}r.beginInlineImagePos!==-1&&(a=n.pos-r.beginInlineImagePos);const s=this.xref.fetchIfRef(i.F||i.Filter);let o;if(s instanceof xe)o=s.name;else if(Array.isArray(s)){const d=this.xref.fetchIfRef(s[0]);d instanceof xe&&(o=d.name)}const l=n.pos;let c;switch(o){case"DCT":case"DCTDecode":c=this.findDCTDecodeInlineStreamEnd(n);break;case"A85":case"ASCII85Decode":c=this.findASCII85DecodeInlineStreamEnd(n);break;case"AHx":case"ASCIIHexDecode":c=this.findASCIIHexDecodeInlineStreamEnd(n);break;default:c=this.findDefaultInlineStreamEnd(n)}let u;if(c<Vpe&&a>0){const d=n.pos;n.pos=r.beginInlineImagePos,u=Upe(n.getBytes(a+c)),n.pos=d;const p=this.imageCache[u];if(p!==void 0)return this.buf2=Bn.get("EI"),this.shift(),p.reset(),p}const h=new re(this.xref);for(const d in i)h.set(d,i[d]);let f=n.makeSubStream(l,c,h);return e&&(f=e.createStream(f,c)),f=this.filter(f,h,c),f.dict=h,u!==void 0&&(f.cacheKey=`inline_img_${++this._imageId}`,this.imageCache[u]=f),this.buf2=Bn.get("EI"),this.shift(),f}#e(e){const{stream:r}=this.lexer;r.pos=e;const n=2048,i=9,a=new Uint8Array([101,110,100]),s=a.length,o=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],l=i-s;for(;r.pos<r.end;){const c=r.peekBytes(n),u=c.length-i;if(u<=0)break;let h=0;for(;h<u;){let f=0;for(;f<s&&c[h+f]===a[f];)f++;if(f>=s){let d=!1;for(const p of o){const g=p.length;let m=0;for(;m<g&&c[h+f+m]===p[m];)m++;if(m>=l){d=!0;break}if(m>=g){const v=c[h+f+m];Gs(v)&&(Ht(`Found "${As([...a,...p])}" when searching for endstream command.`),d=!0);break}}if(d)return r.pos+=h,r.pos-e}h++}r.pos+=u}return-1}makeStream(e,r){const n=this.lexer;let i=n.stream;n.skipToNextLine();const a=i.pos-1;let s=e.get("Length");if(Number.isInteger(s)||(Ht(`Bad length "${s&&s.toString()}" in stream.`),s=0),i.pos=a+s,n.nextChar(),this.tryShift()&&gi(this.buf2,"endstream"))this.shift();else{if(s=this.#e(a),s<0)throw new fe("Missing endstream command.");n.nextChar(),this.shift(),this.shift()}return this.shift(),i=i.makeSubStream(a,s,e),r&&(i=r.createStream(i,s)),i=this.filter(i,e,s),i.dict=e,i}filter(e,r,n){let i=r.get("F","Filter"),a=r.get("DP","DecodeParms");if(i instanceof xe)return Array.isArray(a)&&ee("/DecodeParms should not be an Array, when /Filter is a Name."),this.makeFilter(e,i.name,n,a);let s=n;if(Array.isArray(i)){const o=i,l=a;for(let c=0,u=o.length;c<u;++c){if(i=this.xref.fetchIfRef(o[c]),!(i instanceof xe))throw new fe(`Bad filter name "${i}"`);a=null,Array.isArray(l)&&c in l&&(a=this.xref.fetchIfRef(l[c])),e=this.makeFilter(e,i.name,s,a),s=null}}return e}makeFilter(e,r,n,i){if(n===0)return ee(`Empty "${r}" stream.`),new hT;try{switch(r){case"Fl":case"FlateDecode":return i?new ON(new MN(e,n),n,i):new MN(e,n);case"LZW":case"LZWDecode":let a=1;return i?(i.has("EarlyChange")&&(a=i.get("EarlyChange")),new ON(new NN(e,n,a),n,i)):new NN(e,n,a);case"DCT":case"DCTDecode":return new jm(e,n,i);case"JPX":case"JPXDecode":return new $pe(e,n,i);case"A85":case"ASCII85Decode":return new hpe(e,n);case"AHx":case"ASCIIHexDecode":return new fpe(e,n);case"CCF":case"CCITTFaxDecode":return new dpe(e,n,i);case"RL":case"RunLengthDecode":return new zpe(e,n);case"JBIG2Decode":return new Fpe(e,n,i)}return ee(`Filter "${r}" is not supported.`),e}catch(a){if(a instanceof tn)throw a;return ee(`Invalid stream: "${a}"`),new hT}}}const vp=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function h8(t){return t>=48&&t<=57?t&15:t>=65&&t<=70||t>=97&&t<=102?(t&15)+9:-1}class el{constructor(e,r=null){this.stream=e,this.nextChar(),this.strBuf=[],this.knownCommands=r,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,r=!1,n=0,i=1;if(e===45?(i=-1,e=this.nextChar(),e===45&&(e=this.nextChar())):e===43&&(e=this.nextChar()),e===10||e===13)do e=this.nextChar();while(e===10||e===13);if(e===46&&(n=10,e=this.nextChar()),e<48||e>57){const l=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if(Gs(e)||e===40||e===60||e===-1)return Ht(`Lexer.getNumber - "${l}".`),0;throw new fe(l)}let a=e-48,s=0,o=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const l=e-48;r?s=s*10+l:(n!==0&&(n*=10),a=a*10+l)}else if(e===46)if(n===0)n=1;else break;else if(e===45)ee("Badly formatted number: minus sign in the middle");else if(e===69||e===101){if(e=this.peekChar(),e===43||e===45)o=e===45?-1:1,this.nextChar();else if(e<48||e>57)break;r=!0}else break;return n!==0&&(a/=n),r&&(a*=10**(o*s)),i*a}getString(){let e=1,r=!1;const n=this.strBuf;n.length=0;let i=this.nextChar();for(;;){let a=!1;switch(i|0){case-1:ee("Unterminated string"),r=!0;break;case 40:++e,n.push("(");break;case 41:--e===0?(this.nextChar(),r=!0):n.push(")");break;case 92:switch(i=this.nextChar(),i){case-1:ee("Unterminated string"),r=!0;break;case 110:n.push(`
18
18
  `);break;case 114:n.push("\r");break;case 116:n.push(" ");break;case 98:n.push("\b");break;case 102:n.push("\f");break;case 92:case 40:case 41:n.push(String.fromCharCode(i));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let s=i&15;i=this.nextChar(),a=!0,i>=48&&i<=55&&(s=(s<<3)+(i&15),i=this.nextChar(),i>=48&&i<=55&&(a=!1,s=(s<<3)+(i&15))),n.push(String.fromCharCode(s));break;case 13:this.peekChar()===10&&this.nextChar();break;case 10:break;default:n.push(String.fromCharCode(i));break}break;default:n.push(String.fromCharCode(i));break}if(r)break;a||(i=this.nextChar())}return n.join("")}getName(){let e,r;const n=this.strBuf;for(n.length=0;(e=this.nextChar())>=0&&!vp[e];)if(e===35){if(e=this.nextChar(),vp[e]){ee("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),n.push("#");break}const i=h8(e);if(i!==-1){r=e,e=this.nextChar();const a=h8(e);if(a===-1){if(ee(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`),n.push("#",String.fromCharCode(r)),vp[e])break;n.push(String.fromCharCode(e));continue}n.push(String.fromCharCode(i<<4|a))}else n.push("#",String.fromCharCode(e))}else n.push(String.fromCharCode(e));return n.length>127&&ee(`Name token is longer than allowed by the spec: ${n.length}`),xe.get(n.join(""))}_hexStringWarn(e){if(this._hexStringNumWarn++===5){ee("getHexString - ignoring additional invalid characters.");return}this._hexStringNumWarn>5||ee(`getHexString - ignoring invalid character: ${e}`)}getHexString(){const e=this.strBuf;e.length=0;let r=this.currentChar,n=-1,i=-1;for(this._hexStringNumWarn=0;;)if(r<0){ee("Unterminated hex string");break}else if(r===62){this.nextChar();break}else if(vp[r]===1){r=this.nextChar();continue}else i=h8(r),i===-1?this._hexStringWarn(r):n===-1?n=i:(e.push(String.fromCharCode(n<<4|i)),n=-1),r=this.nextChar();return n!==-1&&e.push(String.fromCharCode(n<<4)),e.join("")}getObj(){let e=!1,r=this.currentChar;for(;;){if(r<0)return Di;if(e)(r===10||r===13)&&(e=!1);else if(r===37)e=!0;else if(vp[r]!==1)break;r=this.nextChar()}switch(r|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),Bn.get("[");case 93:return this.nextChar(),Bn.get("]");case 60:return r=this.nextChar(),r===60?(this.nextChar(),Bn.get("<<")):this.getHexString();case 62:return r=this.nextChar(),r===62?(this.nextChar(),Bn.get(">>")):Bn.get(">");case 123:return this.nextChar(),Bn.get("{");case 125:return this.nextChar(),Bn.get("}");case 41:throw this.nextChar(),new fe(`Illegal character: ${r}`)}let n=String.fromCharCode(r);if(r<32||r>127){const s=this.peekChar();if(s>=32&&s<=127)return this.nextChar(),Bn.get(n)}const i=this.knownCommands;let a=i?.[n]!==void 0;for(;(r=this.nextChar())>=0&&!vp[r];){const s=n+String.fromCharCode(r);if(a&&i[s]===void 0)break;if(n.length===128)throw new fe(`Command token too long: ${n.length}`);n=s,a=i?.[n]!==void 0}return n==="true"?!0:n==="false"?!1:n==="null"?null:(n==="BI"&&(this.beginInlineImagePos=this.stream.pos),Bn.get(n))}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(e===13){e=this.nextChar(),e===10&&this.nextChar();break}else if(e===10){this.nextChar();break}e=this.nextChar()}}}class jpe{static create(e){function r(h,f,d=!1){const p=h.get(f);if(Number.isInteger(p)&&(d?p>=0:p>0))return p;throw new Error(`The "${f}" parameter in the linearization dictionary is invalid.`)}function n(h){const f=h.get("H");let d;if(Array.isArray(f)&&((d=f.length)===2||d===4)){for(let p=0;p<d;p++){const g=f[p];if(!(Number.isInteger(g)&&g>0))throw new Error(`Hint (${p}) in the linearization dictionary is invalid.`)}return f}throw new Error("Hint array in the linearization dictionary is invalid.")}const i=new vh({lexer:new el(e),xref:null}),a=i.getObj(),s=i.getObj(),o=i.getObj(),l=i.getObj();let c,u;if(Number.isInteger(a)&&Number.isInteger(s)&&gi(o,"obj")&&l instanceof re&&typeof(c=l.get("Linearized"))=="number"&&c>0){if((u=r(l,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.')}else return null;return{length:u,hints:n(l),objectNumberFirst:r(l,"O"),endFirst:r(l,"E"),numPages:r(l,"N"),mainXRefEntriesOffset:r(l,"T"),pageFirst:l.has("P")?r(l,"P",!0):0}}}const Hpe=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],f8=2**24-1;class OI{constructor(e=!1){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name="",this.vertical=!1,this.useCMap=null,this.builtInCMap=e}addCodespaceRange(e,r,n){this.codespaceRanges[e-1].push(r,n),this.numCodespaceRanges++}mapCidRange(e,r,n){if(r-e>f8)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=r;)this._map[e++]=n++}mapBfRange(e,r,n){if(r-e>f8)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const i=n.length-1;for(;e<=r;){this._map[e++]=n;const a=n.charCodeAt(i)+1;if(a>255){n=n.substring(0,i-1)+String.fromCharCode(n.charCodeAt(i-1)+1)+"\0";continue}n=n.substring(0,i)+String.fromCharCode(a)}}mapBfRangeToArray(e,r,n){if(r-e>f8)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const i=n.length;let a=0;for(;e<=r&&a<i;)this._map[e]=n[a++],++e}mapOne(e,r){this._map[e]=r}lookup(e){return this._map[e]}contains(e){return this._map[e]!==void 0}forEach(e){const r=this._map,n=r.length;if(n<=65536)for(let i=0;i<n;i++)r[i]!==void 0&&e(i,r[i]);else for(const i in r)e(i,r[i])}charCodeOf(e){const r=this._map;if(r.length<=65536)return r.indexOf(e);for(const n in r)if(r[n]===e)return n|0;return-1}getMap(){return this._map}readCharCode(e,r,n){let i=0;const a=this.codespaceRanges;for(let s=0,o=a.length;s<o;s++){i=(i<<8|e.charCodeAt(r+s))>>>0;const l=a[s];for(let c=0,u=l.length;c<u;){const h=l[c++],f=l[c++];if(i>=h&&i<=f){n.charcode=i,n.length=s+1;return}}}n.charcode=0,n.length=1}getCharCodeLength(e){const r=this.codespaceRanges;for(let n=0,i=r.length;n<i;n++){const a=r[n];for(let s=0,o=a.length;s<o;){const l=a[s++],c=a[s++];if(e>=l&&e<=c)return n+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if(!(this.name==="Identity-H"||this.name==="Identity-V")||this._map.length!==65536)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}class by extends OI{constructor(e,r){super(),this.vertical=e,this.addCodespaceRange(r,0,65535)}mapCidRange(e,r,n){tr("should not call mapCidRange")}mapBfRange(e,r,n){tr("should not call mapBfRange")}mapBfRangeToArray(e,r,n){tr("should not call mapBfRangeToArray")}mapOne(e,r){tr("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let r=0;r<=65535;r++)e(r,r)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let r=0;r<=65535;r++)e[r]=r;return e}get length(){return 65536}get isIdentityCMap(){tr("should not access .isIdentityCMap")}}function ef(t){let e=0;for(let r=0;r<t.length;r++)e=e<<8|t.charCodeAt(r);return e>>>0}function p0(t){if(typeof t!="string")throw new fe("Malformed CMap: expected string.")}function qq(t){if(!Number.isInteger(t))throw new fe("Malformed CMap: expected int.")}function Gpe(t,e){for(;;){let r=e.getObj();if(r===Di)break;if(gi(r,"endbfchar"))return;p0(r);const n=ef(r);r=e.getObj(),p0(r);const i=r;t.mapOne(n,i)}}function Wpe(t,e){for(;;){let r=e.getObj();if(r===Di)break;if(gi(r,"endbfrange"))return;p0(r);const n=ef(r);r=e.getObj(),p0(r);const i=ef(r);if(r=e.getObj(),Number.isInteger(r)||typeof r=="string"){const a=Number.isInteger(r)?String.fromCharCode(r):r;t.mapBfRange(n,i,a)}else if(gi(r,"[")){r=e.getObj();const a=[];for(;!gi(r,"]")&&r!==Di;)a.push(r),r=e.getObj();t.mapBfRangeToArray(n,i,a)}else break}throw new fe("Invalid bf range.")}function qpe(t,e){for(;;){let r=e.getObj();if(r===Di)break;if(gi(r,"endcidchar"))return;p0(r);const n=ef(r);r=e.getObj(),qq(r);const i=r;t.mapOne(n,i)}}function Xpe(t,e){for(;;){let r=e.getObj();if(r===Di)break;if(gi(r,"endcidrange"))return;p0(r);const n=ef(r);r=e.getObj(),p0(r);const i=ef(r);r=e.getObj(),qq(r);const a=r;t.mapCidRange(n,i,a)}}function Ype(t,e){for(;;){let r=e.getObj();if(r===Di)break;if(gi(r,"endcodespacerange"))return;if(typeof r!="string")break;const n=ef(r);if(r=e.getObj(),typeof r!="string")break;const i=ef(r);t.addCodespaceRange(r.length,n,i)}throw new fe("Invalid codespace range.")}function Kpe(t,e){const r=e.getObj();Number.isInteger(r)&&(t.vertical=!!r)}function Zpe(t,e){const r=e.getObj();r instanceof xe&&(t.name=r.name)}async function Xq(t,e,r,n){let i,a;e:for(;;)try{const s=e.getObj();if(s===Di)break;if(s instanceof xe)s.name==="WMode"?Kpe(t,e):s.name==="CMapName"&&Zpe(t,e),i=s;else if(s instanceof Bn)switch(s.cmd){case"endcmap":break e;case"usecmap":i instanceof xe&&(a=i.name);break;case"begincodespacerange":Ype(t,e);break;case"beginbfchar":Gpe(t,e);break;case"begincidchar":qpe(t,e);break;case"beginbfrange":Wpe(t,e);break;case"begincidrange":Xpe(t,e);break}}catch(s){if(s instanceof tn)throw s;ee("Invalid cMap data: "+s);continue}return!n&&a&&(n=a),n?Yq(t,r,n):t}async function Yq(t,e,r){if(t.useCMap=await yT(r,e),t.numCodespaceRanges===0){const n=t.useCMap.codespaceRanges;for(let i=0;i<n.length;i++)t.codespaceRanges[i]=n[i].slice();t.numCodespaceRanges=t.useCMap.numCodespaceRanges}return t.useCMap.forEach(function(n,i){t.contains(n)||t.mapOne(n,i)}),t}async function yT(t,e){if(t==="Identity-H")return new by(!1,2);if(t==="Identity-V")return new by(!0,2);if(!Hpe.includes(t))throw new Error("Unknown CMap name: "+t);if(!e)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:r,isCompressed:n}=await e(t),i=new OI(!0);if(n)return new upe().process(r,i,s=>Yq(i,e,s));const a=new el(new ln(r));return Xq(i,a,e,null)}class E1{static async create({encoding:e,fetchBuiltInCMap:r,useCMap:n}){if(e instanceof xe)return yT(e.name,r);if(e instanceof Pt){const i=await Xq(new OI,new el(e),r,n);return i.isIdentityCMap?yT(i.name,r):i}throw new Error("Encoding required.")}}const Kq=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Jpe=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],BI=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"],Cu=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""],nx=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"],FI=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""],$I=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];function ix(t){switch(t){case"WinAnsiEncoding":return nx;case"StandardEncoding":return Cu;case"MacRomanEncoding":return BI;case"SymbolSetEncoding":return FI;case"ZapfDingbatsEncoding":return $I;case"ExpertEncoding":return Kq;case"MacExpertEncoding":return Jpe;default:return null}}const nc=un(function(t){t.A=65,t.AE=198,t.AEacute=508,t.AEmacron=482,t.AEsmall=63462,t.Aacute=193,t.Aacutesmall=63457,t.Abreve=258,t.Abreveacute=7854,t.Abrevecyrillic=1232,t.Abrevedotbelow=7862,t.Abrevegrave=7856,t.Abrevehookabove=7858,t.Abrevetilde=7860,t.Acaron=461,t.Acircle=9398,t.Acircumflex=194,t.Acircumflexacute=7844,t.Acircumflexdotbelow=7852,t.Acircumflexgrave=7846,t.Acircumflexhookabove=7848,t.Acircumflexsmall=63458,t.Acircumflextilde=7850,t.Acute=63177,t.Acutesmall=63412,t.Acyrillic=1040,t.Adblgrave=512,t.Adieresis=196,t.Adieresiscyrillic=1234,t.Adieresismacron=478,t.Adieresissmall=63460,t.Adotbelow=7840,t.Adotmacron=480,t.Agrave=192,t.Agravesmall=63456,t.Ahookabove=7842,t.Aiecyrillic=1236,t.Ainvertedbreve=514,t.Alpha=913,t.Alphatonos=902,t.Amacron=256,t.Amonospace=65313,t.Aogonek=260,t.Aring=197,t.Aringacute=506,t.Aringbelow=7680,t.Aringsmall=63461,t.Asmall=63329,t.Atilde=195,t.Atildesmall=63459,t.Aybarmenian=1329,t.B=66,t.Bcircle=9399,t.Bdotaccent=7682,t.Bdotbelow=7684,t.Becyrillic=1041,t.Benarmenian=1330,t.Beta=914,t.Bhook=385,t.Blinebelow=7686,t.Bmonospace=65314,t.Brevesmall=63220,t.Bsmall=63330,t.Btopbar=386,t.C=67,t.Caarmenian=1342,t.Cacute=262,t.Caron=63178,t.Caronsmall=63221,t.Ccaron=268,t.Ccedilla=199,t.Ccedillaacute=7688,t.Ccedillasmall=63463,t.Ccircle=9400,t.Ccircumflex=264,t.Cdot=266,t.Cdotaccent=266,t.Cedillasmall=63416,t.Chaarmenian=1353,t.Cheabkhasiancyrillic=1212,t.Checyrillic=1063,t.Chedescenderabkhasiancyrillic=1214,t.Chedescendercyrillic=1206,t.Chedieresiscyrillic=1268,t.Cheharmenian=1347,t.Chekhakassiancyrillic=1227,t.Cheverticalstrokecyrillic=1208,t.Chi=935,t.Chook=391,t.Circumflexsmall=63222,t.Cmonospace=65315,t.Coarmenian=1361,t.Csmall=63331,t.D=68,t.DZ=497,t.DZcaron=452,t.Daarmenian=1332,t.Dafrican=393,t.Dcaron=270,t.Dcedilla=7696,t.Dcircle=9401,t.Dcircumflexbelow=7698,t.Dcroat=272,t.Ddotaccent=7690,t.Ddotbelow=7692,t.Decyrillic=1044,t.Deicoptic=1006,t.Delta=8710,t.Deltagreek=916,t.Dhook=394,t.Dieresis=63179,t.DieresisAcute=63180,t.DieresisGrave=63181,t.Dieresissmall=63400,t.Digammagreek=988,t.Djecyrillic=1026,t.Dlinebelow=7694,t.Dmonospace=65316,t.Dotaccentsmall=63223,t.Dslash=272,t.Dsmall=63332,t.Dtopbar=395,t.Dz=498,t.Dzcaron=453,t.Dzeabkhasiancyrillic=1248,t.Dzecyrillic=1029,t.Dzhecyrillic=1039,t.E=69,t.Eacute=201,t.Eacutesmall=63465,t.Ebreve=276,t.Ecaron=282,t.Ecedillabreve=7708,t.Echarmenian=1333,t.Ecircle=9402,t.Ecircumflex=202,t.Ecircumflexacute=7870,t.Ecircumflexbelow=7704,t.Ecircumflexdotbelow=7878,t.Ecircumflexgrave=7872,t.Ecircumflexhookabove=7874,t.Ecircumflexsmall=63466,t.Ecircumflextilde=7876,t.Ecyrillic=1028,t.Edblgrave=516,t.Edieresis=203,t.Edieresissmall=63467,t.Edot=278,t.Edotaccent=278,t.Edotbelow=7864,t.Efcyrillic=1060,t.Egrave=200,t.Egravesmall=63464,t.Eharmenian=1335,t.Ehookabove=7866,t.Eightroman=8551,t.Einvertedbreve=518,t.Eiotifiedcyrillic=1124,t.Elcyrillic=1051,t.Elevenroman=8554,t.Emacron=274,t.Emacronacute=7702,t.Emacrongrave=7700,t.Emcyrillic=1052,t.Emonospace=65317,t.Encyrillic=1053,t.Endescendercyrillic=1186,t.Eng=330,t.Enghecyrillic=1188,t.Enhookcyrillic=1223,t.Eogonek=280,t.Eopen=400,t.Epsilon=917,t.Epsilontonos=904,t.Ercyrillic=1056,t.Ereversed=398,t.Ereversedcyrillic=1069,t.Escyrillic=1057,t.Esdescendercyrillic=1194,t.Esh=425,t.Esmall=63333,t.Eta=919,t.Etarmenian=1336,t.Etatonos=905,t.Eth=208,t.Ethsmall=63472,t.Etilde=7868,t.Etildebelow=7706,t.Euro=8364,t.Ezh=439,t.Ezhcaron=494,t.Ezhreversed=440,t.F=70,t.Fcircle=9403,t.Fdotaccent=7710,t.Feharmenian=1366,t.Feicoptic=996,t.Fhook=401,t.Fitacyrillic=1138,t.Fiveroman=8548,t.Fmonospace=65318,t.Fourroman=8547,t.Fsmall=63334,t.G=71,t.GBsquare=13191,t.Gacute=500,t.Gamma=915,t.Gammaafrican=404,t.Gangiacoptic=1002,t.Gbreve=286,t.Gcaron=486,t.Gcedilla=290,t.Gcircle=9404,t.Gcircumflex=284,t.Gcommaaccent=290,t.Gdot=288,t.Gdotaccent=288,t.Gecyrillic=1043,t.Ghadarmenian=1346,t.Ghemiddlehookcyrillic=1172,t.Ghestrokecyrillic=1170,t.Gheupturncyrillic=1168,t.Ghook=403,t.Gimarmenian=1331,t.Gjecyrillic=1027,t.Gmacron=7712,t.Gmonospace=65319,t.Grave=63182,t.Gravesmall=63328,t.Gsmall=63335,t.Gsmallhook=667,t.Gstroke=484,t.H=72,t.H18533=9679,t.H18543=9642,t.H18551=9643,t.H22073=9633,t.HPsquare=13259,t.Haabkhasiancyrillic=1192,t.Hadescendercyrillic=1202,t.Hardsigncyrillic=1066,t.Hbar=294,t.Hbrevebelow=7722,t.Hcedilla=7720,t.Hcircle=9405,t.Hcircumflex=292,t.Hdieresis=7718,t.Hdotaccent=7714,t.Hdotbelow=7716,t.Hmonospace=65320,t.Hoarmenian=1344,t.Horicoptic=1e3,t.Hsmall=63336,t.Hungarumlaut=63183,t.Hungarumlautsmall=63224,t.Hzsquare=13200,t.I=73,t.IAcyrillic=1071,t.IJ=306,t.IUcyrillic=1070,t.Iacute=205,t.Iacutesmall=63469,t.Ibreve=300,t.Icaron=463,t.Icircle=9406,t.Icircumflex=206,t.Icircumflexsmall=63470,t.Icyrillic=1030,t.Idblgrave=520,t.Idieresis=207,t.Idieresisacute=7726,t.Idieresiscyrillic=1252,t.Idieresissmall=63471,t.Idot=304,t.Idotaccent=304,t.Idotbelow=7882,t.Iebrevecyrillic=1238,t.Iecyrillic=1045,t.Ifraktur=8465,t.Igrave=204,t.Igravesmall=63468,t.Ihookabove=7880,t.Iicyrillic=1048,t.Iinvertedbreve=522,t.Iishortcyrillic=1049,t.Imacron=298,t.Imacroncyrillic=1250,t.Imonospace=65321,t.Iniarmenian=1339,t.Iocyrillic=1025,t.Iogonek=302,t.Iota=921,t.Iotaafrican=406,t.Iotadieresis=938,t.Iotatonos=906,t.Ismall=63337,t.Istroke=407,t.Itilde=296,t.Itildebelow=7724,t.Izhitsacyrillic=1140,t.Izhitsadblgravecyrillic=1142,t.J=74,t.Jaarmenian=1345,t.Jcircle=9407,t.Jcircumflex=308,t.Jecyrillic=1032,t.Jheharmenian=1355,t.Jmonospace=65322,t.Jsmall=63338,t.K=75,t.KBsquare=13189,t.KKsquare=13261,t.Kabashkircyrillic=1184,t.Kacute=7728,t.Kacyrillic=1050,t.Kadescendercyrillic=1178,t.Kahookcyrillic=1219,t.Kappa=922,t.Kastrokecyrillic=1182,t.Kaverticalstrokecyrillic=1180,t.Kcaron=488,t.Kcedilla=310,t.Kcircle=9408,t.Kcommaaccent=310,t.Kdotbelow=7730,t.Keharmenian=1364,t.Kenarmenian=1343,t.Khacyrillic=1061,t.Kheicoptic=998,t.Khook=408,t.Kjecyrillic=1036,t.Klinebelow=7732,t.Kmonospace=65323,t.Koppacyrillic=1152,t.Koppagreek=990,t.Ksicyrillic=1134,t.Ksmall=63339,t.L=76,t.LJ=455,t.LL=63167,t.Lacute=313,t.Lambda=923,t.Lcaron=317,t.Lcedilla=315,t.Lcircle=9409,t.Lcircumflexbelow=7740,t.Lcommaaccent=315,t.Ldot=319,t.Ldotaccent=319,t.Ldotbelow=7734,t.Ldotbelowmacron=7736,t.Liwnarmenian=1340,t.Lj=456,t.Ljecyrillic=1033,t.Llinebelow=7738,t.Lmonospace=65324,t.Lslash=321,t.Lslashsmall=63225,t.Lsmall=63340,t.M=77,t.MBsquare=13190,t.Macron=63184,t.Macronsmall=63407,t.Macute=7742,t.Mcircle=9410,t.Mdotaccent=7744,t.Mdotbelow=7746,t.Menarmenian=1348,t.Mmonospace=65325,t.Msmall=63341,t.Mturned=412,t.Mu=924,t.N=78,t.NJ=458,t.Nacute=323,t.Ncaron=327,t.Ncedilla=325,t.Ncircle=9411,t.Ncircumflexbelow=7754,t.Ncommaaccent=325,t.Ndotaccent=7748,t.Ndotbelow=7750,t.Nhookleft=413,t.Nineroman=8552,t.Nj=459,t.Njecyrillic=1034,t.Nlinebelow=7752,t.Nmonospace=65326,t.Nowarmenian=1350,t.Nsmall=63342,t.Ntilde=209,t.Ntildesmall=63473,t.Nu=925,t.O=79,t.OE=338,t.OEsmall=63226,t.Oacute=211,t.Oacutesmall=63475,t.Obarredcyrillic=1256,t.Obarreddieresiscyrillic=1258,t.Obreve=334,t.Ocaron=465,t.Ocenteredtilde=415,t.Ocircle=9412,t.Ocircumflex=212,t.Ocircumflexacute=7888,t.Ocircumflexdotbelow=7896,t.Ocircumflexgrave=7890,t.Ocircumflexhookabove=7892,t.Ocircumflexsmall=63476,t.Ocircumflextilde=7894,t.Ocyrillic=1054,t.Odblacute=336,t.Odblgrave=524,t.Odieresis=214,t.Odieresiscyrillic=1254,t.Odieresissmall=63478,t.Odotbelow=7884,t.Ogoneksmall=63227,t.Ograve=210,t.Ogravesmall=63474,t.Oharmenian=1365,t.Ohm=8486,t.Ohookabove=7886,t.Ohorn=416,t.Ohornacute=7898,t.Ohorndotbelow=7906,t.Ohorngrave=7900,t.Ohornhookabove=7902,t.Ohorntilde=7904,t.Ohungarumlaut=336,t.Oi=418,t.Oinvertedbreve=526,t.Omacron=332,t.Omacronacute=7762,t.Omacrongrave=7760,t.Omega=8486,t.Omegacyrillic=1120,t.Omegagreek=937,t.Omegaroundcyrillic=1146,t.Omegatitlocyrillic=1148,t.Omegatonos=911,t.Omicron=927,t.Omicrontonos=908,t.Omonospace=65327,t.Oneroman=8544,t.Oogonek=490,t.Oogonekmacron=492,t.Oopen=390,t.Oslash=216,t.Oslashacute=510,t.Oslashsmall=63480,t.Osmall=63343,t.Ostrokeacute=510,t.Otcyrillic=1150,t.Otilde=213,t.Otildeacute=7756,t.Otildedieresis=7758,t.Otildesmall=63477,t.P=80,t.Pacute=7764,t.Pcircle=9413,t.Pdotaccent=7766,t.Pecyrillic=1055,t.Peharmenian=1354,t.Pemiddlehookcyrillic=1190,t.Phi=934,t.Phook=420,t.Pi=928,t.Piwrarmenian=1363,t.Pmonospace=65328,t.Psi=936,t.Psicyrillic=1136,t.Psmall=63344,t.Q=81,t.Qcircle=9414,t.Qmonospace=65329,t.Qsmall=63345,t.R=82,t.Raarmenian=1356,t.Racute=340,t.Rcaron=344,t.Rcedilla=342,t.Rcircle=9415,t.Rcommaaccent=342,t.Rdblgrave=528,t.Rdotaccent=7768,t.Rdotbelow=7770,t.Rdotbelowmacron=7772,t.Reharmenian=1360,t.Rfraktur=8476,t.Rho=929,t.Ringsmall=63228,t.Rinvertedbreve=530,t.Rlinebelow=7774,t.Rmonospace=65330,t.Rsmall=63346,t.Rsmallinverted=641,t.Rsmallinvertedsuperior=694,t.S=83,t.SF010000=9484,t.SF020000=9492,t.SF030000=9488,t.SF040000=9496,t.SF050000=9532,t.SF060000=9516,t.SF070000=9524,t.SF080000=9500,t.SF090000=9508,t.SF100000=9472,t.SF110000=9474,t.SF190000=9569,t.SF200000=9570,t.SF210000=9558,t.SF220000=9557,t.SF230000=9571,t.SF240000=9553,t.SF250000=9559,t.SF260000=9565,t.SF270000=9564,t.SF280000=9563,t.SF360000=9566,t.SF370000=9567,t.SF380000=9562,t.SF390000=9556,t.SF400000=9577,t.SF410000=9574,t.SF420000=9568,t.SF430000=9552,t.SF440000=9580,t.SF450000=9575,t.SF460000=9576,t.SF470000=9572,t.SF480000=9573,t.SF490000=9561,t.SF500000=9560,t.SF510000=9554,t.SF520000=9555,t.SF530000=9579,t.SF540000=9578,t.Sacute=346,t.Sacutedotaccent=7780,t.Sampigreek=992,t.Scaron=352,t.Scarondotaccent=7782,t.Scaronsmall=63229,t.Scedilla=350,t.Schwa=399,t.Schwacyrillic=1240,t.Schwadieresiscyrillic=1242,t.Scircle=9416,t.Scircumflex=348,t.Scommaaccent=536,t.Sdotaccent=7776,t.Sdotbelow=7778,t.Sdotbelowdotaccent=7784,t.Seharmenian=1357,t.Sevenroman=8550,t.Shaarmenian=1351,t.Shacyrillic=1064,t.Shchacyrillic=1065,t.Sheicoptic=994,t.Shhacyrillic=1210,t.Shimacoptic=1004,t.Sigma=931,t.Sixroman=8549,t.Smonospace=65331,t.Softsigncyrillic=1068,t.Ssmall=63347,t.Stigmagreek=986,t.T=84,t.Tau=932,t.Tbar=358,t.Tcaron=356,t.Tcedilla=354,t.Tcircle=9417,t.Tcircumflexbelow=7792,t.Tcommaaccent=354,t.Tdotaccent=7786,t.Tdotbelow=7788,t.Tecyrillic=1058,t.Tedescendercyrillic=1196,t.Tenroman=8553,t.Tetsecyrillic=1204,t.Theta=920,t.Thook=428,t.Thorn=222,t.Thornsmall=63486,t.Threeroman=8546,t.Tildesmall=63230,t.Tiwnarmenian=1359,t.Tlinebelow=7790,t.Tmonospace=65332,t.Toarmenian=1337,t.Tonefive=444,t.Tonesix=388,t.Tonetwo=423,t.Tretroflexhook=430,t.Tsecyrillic=1062,t.Tshecyrillic=1035,t.Tsmall=63348,t.Twelveroman=8555,t.Tworoman=8545,t.U=85,t.Uacute=218,t.Uacutesmall=63482,t.Ubreve=364,t.Ucaron=467,t.Ucircle=9418,t.Ucircumflex=219,t.Ucircumflexbelow=7798,t.Ucircumflexsmall=63483,t.Ucyrillic=1059,t.Udblacute=368,t.Udblgrave=532,t.Udieresis=220,t.Udieresisacute=471,t.Udieresisbelow=7794,t.Udieresiscaron=473,t.Udieresiscyrillic=1264,t.Udieresisgrave=475,t.Udieresismacron=469,t.Udieresissmall=63484,t.Udotbelow=7908,t.Ugrave=217,t.Ugravesmall=63481,t.Uhookabove=7910,t.Uhorn=431,t.Uhornacute=7912,t.Uhorndotbelow=7920,t.Uhorngrave=7914,t.Uhornhookabove=7916,t.Uhorntilde=7918,t.Uhungarumlaut=368,t.Uhungarumlautcyrillic=1266,t.Uinvertedbreve=534,t.Ukcyrillic=1144,t.Umacron=362,t.Umacroncyrillic=1262,t.Umacrondieresis=7802,t.Umonospace=65333,t.Uogonek=370,t.Upsilon=933,t.Upsilon1=978,t.Upsilonacutehooksymbolgreek=979,t.Upsilonafrican=433,t.Upsilondieresis=939,t.Upsilondieresishooksymbolgreek=980,t.Upsilonhooksymbol=978,t.Upsilontonos=910,t.Uring=366,t.Ushortcyrillic=1038,t.Usmall=63349,t.Ustraightcyrillic=1198,t.Ustraightstrokecyrillic=1200,t.Utilde=360,t.Utildeacute=7800,t.Utildebelow=7796,t.V=86,t.Vcircle=9419,t.Vdotbelow=7806,t.Vecyrillic=1042,t.Vewarmenian=1358,t.Vhook=434,t.Vmonospace=65334,t.Voarmenian=1352,t.Vsmall=63350,t.Vtilde=7804,t.W=87,t.Wacute=7810,t.Wcircle=9420,t.Wcircumflex=372,t.Wdieresis=7812,t.Wdotaccent=7814,t.Wdotbelow=7816,t.Wgrave=7808,t.Wmonospace=65335,t.Wsmall=63351,t.X=88,t.Xcircle=9421,t.Xdieresis=7820,t.Xdotaccent=7818,t.Xeharmenian=1341,t.Xi=926,t.Xmonospace=65336,t.Xsmall=63352,t.Y=89,t.Yacute=221,t.Yacutesmall=63485,t.Yatcyrillic=1122,t.Ycircle=9422,t.Ycircumflex=374,t.Ydieresis=376,t.Ydieresissmall=63487,t.Ydotaccent=7822,t.Ydotbelow=7924,t.Yericyrillic=1067,t.Yerudieresiscyrillic=1272,t.Ygrave=7922,t.Yhook=435,t.Yhookabove=7926,t.Yiarmenian=1349,t.Yicyrillic=1031,t.Yiwnarmenian=1362,t.Ymonospace=65337,t.Ysmall=63353,t.Ytilde=7928,t.Yusbigcyrillic=1130,t.Yusbigiotifiedcyrillic=1132,t.Yuslittlecyrillic=1126,t.Yuslittleiotifiedcyrillic=1128,t.Z=90,t.Zaarmenian=1334,t.Zacute=377,t.Zcaron=381,t.Zcaronsmall=63231,t.Zcircle=9423,t.Zcircumflex=7824,t.Zdot=379,t.Zdotaccent=379,t.Zdotbelow=7826,t.Zecyrillic=1047,t.Zedescendercyrillic=1176,t.Zedieresiscyrillic=1246,t.Zeta=918,t.Zhearmenian=1338,t.Zhebrevecyrillic=1217,t.Zhecyrillic=1046,t.Zhedescendercyrillic=1174,t.Zhedieresiscyrillic=1244,t.Zlinebelow=7828,t.Zmonospace=65338,t.Zsmall=63354,t.Zstroke=437,t.a=97,t.aabengali=2438,t.aacute=225,t.aadeva=2310,t.aagujarati=2694,t.aagurmukhi=2566,t.aamatragurmukhi=2622,t.aarusquare=13059,t.aavowelsignbengali=2494,t.aavowelsigndeva=2366,t.aavowelsigngujarati=2750,t.abbreviationmarkarmenian=1375,t.abbreviationsigndeva=2416,t.abengali=2437,t.abopomofo=12570,t.abreve=259,t.abreveacute=7855,t.abrevecyrillic=1233,t.abrevedotbelow=7863,t.abrevegrave=7857,t.abrevehookabove=7859,t.abrevetilde=7861,t.acaron=462,t.acircle=9424,t.acircumflex=226,t.acircumflexacute=7845,t.acircumflexdotbelow=7853,t.acircumflexgrave=7847,t.acircumflexhookabove=7849,t.acircumflextilde=7851,t.acute=180,t.acutebelowcmb=791,t.acutecmb=769,t.acutecomb=769,t.acutedeva=2388,t.acutelowmod=719,t.acutetonecmb=833,t.acyrillic=1072,t.adblgrave=513,t.addakgurmukhi=2673,t.adeva=2309,t.adieresis=228,t.adieresiscyrillic=1235,t.adieresismacron=479,t.adotbelow=7841,t.adotmacron=481,t.ae=230,t.aeacute=509,t.aekorean=12624,t.aemacron=483,t.afii00208=8213,t.afii08941=8356,t.afii10017=1040,t.afii10018=1041,t.afii10019=1042,t.afii10020=1043,t.afii10021=1044,t.afii10022=1045,t.afii10023=1025,t.afii10024=1046,t.afii10025=1047,t.afii10026=1048,t.afii10027=1049,t.afii10028=1050,t.afii10029=1051,t.afii10030=1052,t.afii10031=1053,t.afii10032=1054,t.afii10033=1055,t.afii10034=1056,t.afii10035=1057,t.afii10036=1058,t.afii10037=1059,t.afii10038=1060,t.afii10039=1061,t.afii10040=1062,t.afii10041=1063,t.afii10042=1064,t.afii10043=1065,t.afii10044=1066,t.afii10045=1067,t.afii10046=1068,t.afii10047=1069,t.afii10048=1070,t.afii10049=1071,t.afii10050=1168,t.afii10051=1026,t.afii10052=1027,t.afii10053=1028,t.afii10054=1029,t.afii10055=1030,t.afii10056=1031,t.afii10057=1032,t.afii10058=1033,t.afii10059=1034,t.afii10060=1035,t.afii10061=1036,t.afii10062=1038,t.afii10063=63172,t.afii10064=63173,t.afii10065=1072,t.afii10066=1073,t.afii10067=1074,t.afii10068=1075,t.afii10069=1076,t.afii10070=1077,t.afii10071=1105,t.afii10072=1078,t.afii10073=1079,t.afii10074=1080,t.afii10075=1081,t.afii10076=1082,t.afii10077=1083,t.afii10078=1084,t.afii10079=1085,t.afii10080=1086,t.afii10081=1087,t.afii10082=1088,t.afii10083=1089,t.afii10084=1090,t.afii10085=1091,t.afii10086=1092,t.afii10087=1093,t.afii10088=1094,t.afii10089=1095,t.afii10090=1096,t.afii10091=1097,t.afii10092=1098,t.afii10093=1099,t.afii10094=1100,t.afii10095=1101,t.afii10096=1102,t.afii10097=1103,t.afii10098=1169,t.afii10099=1106,t.afii10100=1107,t.afii10101=1108,t.afii10102=1109,t.afii10103=1110,t.afii10104=1111,t.afii10105=1112,t.afii10106=1113,t.afii10107=1114,t.afii10108=1115,t.afii10109=1116,t.afii10110=1118,t.afii10145=1039,t.afii10146=1122,t.afii10147=1138,t.afii10148=1140,t.afii10192=63174,t.afii10193=1119,t.afii10194=1123,t.afii10195=1139,t.afii10196=1141,t.afii10831=63175,t.afii10832=63176,t.afii10846=1241,t.afii299=8206,t.afii300=8207,t.afii301=8205,t.afii57381=1642,t.afii57388=1548,t.afii57392=1632,t.afii57393=1633,t.afii57394=1634,t.afii57395=1635,t.afii57396=1636,t.afii57397=1637,t.afii57398=1638,t.afii57399=1639,t.afii57400=1640,t.afii57401=1641,t.afii57403=1563,t.afii57407=1567,t.afii57409=1569,t.afii57410=1570,t.afii57411=1571,t.afii57412=1572,t.afii57413=1573,t.afii57414=1574,t.afii57415=1575,t.afii57416=1576,t.afii57417=1577,t.afii57418=1578,t.afii57419=1579,t.afii57420=1580,t.afii57421=1581,t.afii57422=1582,t.afii57423=1583,t.afii57424=1584,t.afii57425=1585,t.afii57426=1586,t.afii57427=1587,t.afii57428=1588,t.afii57429=1589,t.afii57430=1590,t.afii57431=1591,t.afii57432=1592,t.afii57433=1593,t.afii57434=1594,t.afii57440=1600,t.afii57441=1601,t.afii57442=1602,t.afii57443=1603,t.afii57444=1604,t.afii57445=1605,t.afii57446=1606,t.afii57448=1608,t.afii57449=1609,t.afii57450=1610,t.afii57451=1611,t.afii57452=1612,t.afii57453=1613,t.afii57454=1614,t.afii57455=1615,t.afii57456=1616,t.afii57457=1617,t.afii57458=1618,t.afii57470=1607,t.afii57505=1700,t.afii57506=1662,t.afii57507=1670,t.afii57508=1688,t.afii57509=1711,t.afii57511=1657,t.afii57512=1672,t.afii57513=1681,t.afii57514=1722,t.afii57519=1746,t.afii57534=1749,t.afii57636=8362,t.afii57645=1470,t.afii57658=1475,t.afii57664=1488,t.afii57665=1489,t.afii57666=1490,t.afii57667=1491,t.afii57668=1492,t.afii57669=1493,t.afii57670=1494,t.afii57671=1495,t.afii57672=1496,t.afii57673=1497,t.afii57674=1498,t.afii57675=1499,t.afii57676=1500,t.afii57677=1501,t.afii57678=1502,t.afii57679=1503,t.afii57680=1504,t.afii57681=1505,t.afii57682=1506,t.afii57683=1507,t.afii57684=1508,t.afii57685=1509,t.afii57686=1510,t.afii57687=1511,t.afii57688=1512,t.afii57689=1513,t.afii57690=1514,t.afii57694=64298,t.afii57695=64299,t.afii57700=64331,t.afii57705=64287,t.afii57716=1520,t.afii57717=1521,t.afii57718=1522,t.afii57723=64309,t.afii57793=1460,t.afii57794=1461,t.afii57795=1462,t.afii57796=1467,t.afii57797=1464,t.afii57798=1463,t.afii57799=1456,t.afii57800=1458,t.afii57801=1457,t.afii57802=1459,t.afii57803=1474,t.afii57804=1473,t.afii57806=1465,t.afii57807=1468,t.afii57839=1469,t.afii57841=1471,t.afii57842=1472,t.afii57929=700,t.afii61248=8453,t.afii61289=8467,t.afii61352=8470,t.afii61573=8236,t.afii61574=8237,t.afii61575=8238,t.afii61664=8204,t.afii63167=1645,t.afii64937=701,t.agrave=224,t.agujarati=2693,t.agurmukhi=2565,t.ahiragana=12354,t.ahookabove=7843,t.aibengali=2448,t.aibopomofo=12574,t.aideva=2320,t.aiecyrillic=1237,t.aigujarati=2704,t.aigurmukhi=2576,t.aimatragurmukhi=2632,t.ainarabic=1593,t.ainfinalarabic=65226,t.aininitialarabic=65227,t.ainmedialarabic=65228,t.ainvertedbreve=515,t.aivowelsignbengali=2504,t.aivowelsigndeva=2376,t.aivowelsigngujarati=2760,t.akatakana=12450,t.akatakanahalfwidth=65393,t.akorean=12623,t.alef=1488,t.alefarabic=1575,t.alefdageshhebrew=64304,t.aleffinalarabic=65166,t.alefhamzaabovearabic=1571,t.alefhamzaabovefinalarabic=65156,t.alefhamzabelowarabic=1573,t.alefhamzabelowfinalarabic=65160,t.alefhebrew=1488,t.aleflamedhebrew=64335,t.alefmaddaabovearabic=1570,t.alefmaddaabovefinalarabic=65154,t.alefmaksuraarabic=1609,t.alefmaksurafinalarabic=65264,t.alefmaksurainitialarabic=65267,t.alefmaksuramedialarabic=65268,t.alefpatahhebrew=64302,t.alefqamatshebrew=64303,t.aleph=8501,t.allequal=8780,t.alpha=945,t.alphatonos=940,t.amacron=257,t.amonospace=65345,t.ampersand=38,t.ampersandmonospace=65286,t.ampersandsmall=63270,t.amsquare=13250,t.anbopomofo=12578,t.angbopomofo=12580,t.angbracketleft=12296,t.angbracketright=12297,t.angkhankhuthai=3674,t.angle=8736,t.anglebracketleft=12296,t.anglebracketleftvertical=65087,t.anglebracketright=12297,t.anglebracketrightvertical=65088,t.angleleft=9001,t.angleright=9002,t.angstrom=8491,t.anoteleia=903,t.anudattadeva=2386,t.anusvarabengali=2434,t.anusvaradeva=2306,t.anusvaragujarati=2690,t.aogonek=261,t.apaatosquare=13056,t.aparen=9372,t.apostrophearmenian=1370,t.apostrophemod=700,t.apple=63743,t.approaches=8784,t.approxequal=8776,t.approxequalorimage=8786,t.approximatelyequal=8773,t.araeaekorean=12686,t.araeakorean=12685,t.arc=8978,t.arighthalfring=7834,t.aring=229,t.aringacute=507,t.aringbelow=7681,t.arrowboth=8596,t.arrowdashdown=8675,t.arrowdashleft=8672,t.arrowdashright=8674,t.arrowdashup=8673,t.arrowdblboth=8660,t.arrowdbldown=8659,t.arrowdblleft=8656,t.arrowdblright=8658,t.arrowdblup=8657,t.arrowdown=8595,t.arrowdownleft=8601,t.arrowdownright=8600,t.arrowdownwhite=8681,t.arrowheaddownmod=709,t.arrowheadleftmod=706,t.arrowheadrightmod=707,t.arrowheadupmod=708,t.arrowhorizex=63719,t.arrowleft=8592,t.arrowleftdbl=8656,t.arrowleftdblstroke=8653,t.arrowleftoverright=8646,t.arrowleftwhite=8678,t.arrowright=8594,t.arrowrightdblstroke=8655,t.arrowrightheavy=10142,t.arrowrightoverleft=8644,t.arrowrightwhite=8680,t.arrowtableft=8676,t.arrowtabright=8677,t.arrowup=8593,t.arrowupdn=8597,t.arrowupdnbse=8616,t.arrowupdownbase=8616,t.arrowupleft=8598,t.arrowupleftofdown=8645,t.arrowupright=8599,t.arrowupwhite=8679,t.arrowvertex=63718,t.asciicircum=94,t.asciicircummonospace=65342,t.asciitilde=126,t.asciitildemonospace=65374,t.ascript=593,t.ascriptturned=594,t.asmallhiragana=12353,t.asmallkatakana=12449,t.asmallkatakanahalfwidth=65383,t.asterisk=42,t.asteriskaltonearabic=1645,t.asteriskarabic=1645,t.asteriskmath=8727,t.asteriskmonospace=65290,t.asterisksmall=65121,t.asterism=8258,t.asuperior=63209,t.asymptoticallyequal=8771,t.at=64,t.atilde=227,t.atmonospace=65312,t.atsmall=65131,t.aturned=592,t.aubengali=2452,t.aubopomofo=12576,t.audeva=2324,t.augujarati=2708,t.augurmukhi=2580,t.aulengthmarkbengali=2519,t.aumatragurmukhi=2636,t.auvowelsignbengali=2508,t.auvowelsigndeva=2380,t.auvowelsigngujarati=2764,t.avagrahadeva=2365,t.aybarmenian=1377,t.ayin=1506,t.ayinaltonehebrew=64288,t.ayinhebrew=1506,t.b=98,t.babengali=2476,t.backslash=92,t.backslashmonospace=65340,t.badeva=2348,t.bagujarati=2732,t.bagurmukhi=2604,t.bahiragana=12400,t.bahtthai=3647,t.bakatakana=12496,t.bar=124,t.barmonospace=65372,t.bbopomofo=12549,t.bcircle=9425,t.bdotaccent=7683,t.bdotbelow=7685,t.beamedsixteenthnotes=9836,t.because=8757,t.becyrillic=1073,t.beharabic=1576,t.behfinalarabic=65168,t.behinitialarabic=65169,t.behiragana=12409,t.behmedialarabic=65170,t.behmeeminitialarabic=64671,t.behmeemisolatedarabic=64520,t.behnoonfinalarabic=64621,t.bekatakana=12505,t.benarmenian=1378,t.bet=1489,t.beta=946,t.betasymbolgreek=976,t.betdagesh=64305,t.betdageshhebrew=64305,t.bethebrew=1489,t.betrafehebrew=64332,t.bhabengali=2477,t.bhadeva=2349,t.bhagujarati=2733,t.bhagurmukhi=2605,t.bhook=595,t.bihiragana=12403,t.bikatakana=12499,t.bilabialclick=664,t.bindigurmukhi=2562,t.birusquare=13105,t.blackcircle=9679,t.blackdiamond=9670,t.blackdownpointingtriangle=9660,t.blackleftpointingpointer=9668,t.blackleftpointingtriangle=9664,t.blacklenticularbracketleft=12304,t.blacklenticularbracketleftvertical=65083,t.blacklenticularbracketright=12305,t.blacklenticularbracketrightvertical=65084,t.blacklowerlefttriangle=9699,t.blacklowerrighttriangle=9698,t.blackrectangle=9644,t.blackrightpointingpointer=9658,t.blackrightpointingtriangle=9654,t.blacksmallsquare=9642,t.blacksmilingface=9787,t.blacksquare=9632,t.blackstar=9733,t.blackupperlefttriangle=9700,t.blackupperrighttriangle=9701,t.blackuppointingsmalltriangle=9652,t.blackuppointingtriangle=9650,t.blank=9251,t.blinebelow=7687,t.block=9608,t.bmonospace=65346,t.bobaimaithai=3610,t.bohiragana=12412,t.bokatakana=12508,t.bparen=9373,t.bqsquare=13251,t.braceex=63732,t.braceleft=123,t.braceleftbt=63731,t.braceleftmid=63730,t.braceleftmonospace=65371,t.braceleftsmall=65115,t.bracelefttp=63729,t.braceleftvertical=65079,t.braceright=125,t.bracerightbt=63742,t.bracerightmid=63741,t.bracerightmonospace=65373,t.bracerightsmall=65116,t.bracerighttp=63740,t.bracerightvertical=65080,t.bracketleft=91,t.bracketleftbt=63728,t.bracketleftex=63727,t.bracketleftmonospace=65339,t.bracketlefttp=63726,t.bracketright=93,t.bracketrightbt=63739,t.bracketrightex=63738,t.bracketrightmonospace=65341,t.bracketrighttp=63737,t.breve=728,t.brevebelowcmb=814,t.brevecmb=774,t.breveinvertedbelowcmb=815,t.breveinvertedcmb=785,t.breveinverteddoublecmb=865,t.bridgebelowcmb=810,t.bridgeinvertedbelowcmb=826,t.brokenbar=166,t.bstroke=384,t.bsuperior=63210,t.btopbar=387,t.buhiragana=12406,t.bukatakana=12502,t.bullet=8226,t.bulletinverse=9688,t.bulletoperator=8729,t.bullseye=9678,t.c=99,t.caarmenian=1390,t.cabengali=2458,t.cacute=263,t.cadeva=2330,t.cagujarati=2714,t.cagurmukhi=2586,t.calsquare=13192,t.candrabindubengali=2433,t.candrabinducmb=784,t.candrabindudeva=2305,t.candrabindugujarati=2689,t.capslock=8682,t.careof=8453,t.caron=711,t.caronbelowcmb=812,t.caroncmb=780,t.carriagereturn=8629,t.cbopomofo=12568,t.ccaron=269,t.ccedilla=231,t.ccedillaacute=7689,t.ccircle=9426,t.ccircumflex=265,t.ccurl=597,t.cdot=267,t.cdotaccent=267,t.cdsquare=13253,t.cedilla=184,t.cedillacmb=807,t.cent=162,t.centigrade=8451,t.centinferior=63199,t.centmonospace=65504,t.centoldstyle=63394,t.centsuperior=63200,t.chaarmenian=1401,t.chabengali=2459,t.chadeva=2331,t.chagujarati=2715,t.chagurmukhi=2587,t.chbopomofo=12564,t.cheabkhasiancyrillic=1213,t.checkmark=10003,t.checyrillic=1095,t.chedescenderabkhasiancyrillic=1215,t.chedescendercyrillic=1207,t.chedieresiscyrillic=1269,t.cheharmenian=1395,t.chekhakassiancyrillic=1228,t.cheverticalstrokecyrillic=1209,t.chi=967,t.chieuchacirclekorean=12919,t.chieuchaparenkorean=12823,t.chieuchcirclekorean=12905,t.chieuchkorean=12618,t.chieuchparenkorean=12809,t.chochangthai=3594,t.chochanthai=3592,t.chochingthai=3593,t.chochoethai=3596,t.chook=392,t.cieucacirclekorean=12918,t.cieucaparenkorean=12822,t.cieuccirclekorean=12904,t.cieuckorean=12616,t.cieucparenkorean=12808,t.cieucuparenkorean=12828,t.circle=9675,t.circlecopyrt=169,t.circlemultiply=8855,t.circleot=8857,t.circleplus=8853,t.circlepostalmark=12342,t.circlewithlefthalfblack=9680,t.circlewithrighthalfblack=9681,t.circumflex=710,t.circumflexbelowcmb=813,t.circumflexcmb=770,t.clear=8999,t.clickalveolar=450,t.clickdental=448,t.clicklateral=449,t.clickretroflex=451,t.club=9827,t.clubsuitblack=9827,t.clubsuitwhite=9831,t.cmcubedsquare=13220,t.cmonospace=65347,t.cmsquaredsquare=13216,t.coarmenian=1409,t.colon=58,t.colonmonetary=8353,t.colonmonospace=65306,t.colonsign=8353,t.colonsmall=65109,t.colontriangularhalfmod=721,t.colontriangularmod=720,t.comma=44,t.commaabovecmb=787,t.commaaboverightcmb=789,t.commaaccent=63171,t.commaarabic=1548,t.commaarmenian=1373,t.commainferior=63201,t.commamonospace=65292,t.commareversedabovecmb=788,t.commareversedmod=701,t.commasmall=65104,t.commasuperior=63202,t.commaturnedabovecmb=786,t.commaturnedmod=699,t.compass=9788,t.congruent=8773,t.contourintegral=8750,t.control=8963,t.controlACK=6,t.controlBEL=7,t.controlBS=8,t.controlCAN=24,t.controlCR=13,t.controlDC1=17,t.controlDC2=18,t.controlDC3=19,t.controlDC4=20,t.controlDEL=127,t.controlDLE=16,t.controlEM=25,t.controlENQ=5,t.controlEOT=4,t.controlESC=27,t.controlETB=23,t.controlETX=3,t.controlFF=12,t.controlFS=28,t.controlGS=29,t.controlHT=9,t.controlLF=10,t.controlNAK=21,t.controlNULL=0,t.controlRS=30,t.controlSI=15,t.controlSO=14,t.controlSOT=2,t.controlSTX=1,t.controlSUB=26,t.controlSYN=22,t.controlUS=31,t.controlVT=11,t.copyright=169,t.copyrightsans=63721,t.copyrightserif=63193,t.cornerbracketleft=12300,t.cornerbracketlefthalfwidth=65378,t.cornerbracketleftvertical=65089,t.cornerbracketright=12301,t.cornerbracketrighthalfwidth=65379,t.cornerbracketrightvertical=65090,t.corporationsquare=13183,t.cosquare=13255,t.coverkgsquare=13254,t.cparen=9374,t.cruzeiro=8354,t.cstretched=663,t.curlyand=8911,t.curlyor=8910,t.currency=164,t.cyrBreve=63185,t.cyrFlex=63186,t.cyrbreve=63188,t.cyrflex=63189,t.d=100,t.daarmenian=1380,t.dabengali=2470,t.dadarabic=1590,t.dadeva=2342,t.dadfinalarabic=65214,t.dadinitialarabic=65215,t.dadmedialarabic=65216,t.dagesh=1468,t.dageshhebrew=1468,t.dagger=8224,t.daggerdbl=8225,t.dagujarati=2726,t.dagurmukhi=2598,t.dahiragana=12384,t.dakatakana=12480,t.dalarabic=1583,t.dalet=1491,t.daletdagesh=64307,t.daletdageshhebrew=64307,t.dalethebrew=1491,t.dalfinalarabic=65194,t.dammaarabic=1615,t.dammalowarabic=1615,t.dammatanaltonearabic=1612,t.dammatanarabic=1612,t.danda=2404,t.dargahebrew=1447,t.dargalefthebrew=1447,t.dasiapneumatacyrilliccmb=1157,t.dblGrave=63187,t.dblanglebracketleft=12298,t.dblanglebracketleftvertical=65085,t.dblanglebracketright=12299,t.dblanglebracketrightvertical=65086,t.dblarchinvertedbelowcmb=811,t.dblarrowleft=8660,t.dblarrowright=8658,t.dbldanda=2405,t.dblgrave=63190,t.dblgravecmb=783,t.dblintegral=8748,t.dbllowline=8215,t.dbllowlinecmb=819,t.dbloverlinecmb=831,t.dblprimemod=698,t.dblverticalbar=8214,t.dblverticallineabovecmb=782,t.dbopomofo=12553,t.dbsquare=13256,t.dcaron=271,t.dcedilla=7697,t.dcircle=9427,t.dcircumflexbelow=7699,t.dcroat=273,t.ddabengali=2465,t.ddadeva=2337,t.ddagujarati=2721,t.ddagurmukhi=2593,t.ddalarabic=1672,t.ddalfinalarabic=64393,t.dddhadeva=2396,t.ddhabengali=2466,t.ddhadeva=2338,t.ddhagujarati=2722,t.ddhagurmukhi=2594,t.ddotaccent=7691,t.ddotbelow=7693,t.decimalseparatorarabic=1643,t.decimalseparatorpersian=1643,t.decyrillic=1076,t.degree=176,t.dehihebrew=1453,t.dehiragana=12391,t.deicoptic=1007,t.dekatakana=12487,t.deleteleft=9003,t.deleteright=8998,t.delta=948,t.deltaturned=397,t.denominatorminusonenumeratorbengali=2552,t.dezh=676,t.dhabengali=2471,t.dhadeva=2343,t.dhagujarati=2727,t.dhagurmukhi=2599,t.dhook=599,t.dialytikatonos=901,t.dialytikatonoscmb=836,t.diamond=9830,t.diamondsuitwhite=9826,t.dieresis=168,t.dieresisacute=63191,t.dieresisbelowcmb=804,t.dieresiscmb=776,t.dieresisgrave=63192,t.dieresistonos=901,t.dihiragana=12386,t.dikatakana=12482,t.dittomark=12291,t.divide=247,t.divides=8739,t.divisionslash=8725,t.djecyrillic=1106,t.dkshade=9619,t.dlinebelow=7695,t.dlsquare=13207,t.dmacron=273,t.dmonospace=65348,t.dnblock=9604,t.dochadathai=3598,t.dodekthai=3604,t.dohiragana=12393,t.dokatakana=12489,t.dollar=36,t.dollarinferior=63203,t.dollarmonospace=65284,t.dollaroldstyle=63268,t.dollarsmall=65129,t.dollarsuperior=63204,t.dong=8363,t.dorusquare=13094,t.dotaccent=729,t.dotaccentcmb=775,t.dotbelowcmb=803,t.dotbelowcomb=803,t.dotkatakana=12539,t.dotlessi=305,t.dotlessj=63166,t.dotlessjstrokehook=644,t.dotmath=8901,t.dottedcircle=9676,t.doubleyodpatah=64287,t.doubleyodpatahhebrew=64287,t.downtackbelowcmb=798,t.downtackmod=725,t.dparen=9375,t.dsuperior=63211,t.dtail=598,t.dtopbar=396,t.duhiragana=12389,t.dukatakana=12485,t.dz=499,t.dzaltone=675,t.dzcaron=454,t.dzcurl=677,t.dzeabkhasiancyrillic=1249,t.dzecyrillic=1109,t.dzhecyrillic=1119,t.e=101,t.eacute=233,t.earth=9793,t.ebengali=2447,t.ebopomofo=12572,t.ebreve=277,t.ecandradeva=2317,t.ecandragujarati=2701,t.ecandravowelsigndeva=2373,t.ecandravowelsigngujarati=2757,t.ecaron=283,t.ecedillabreve=7709,t.echarmenian=1381,t.echyiwnarmenian=1415,t.ecircle=9428,t.ecircumflex=234,t.ecircumflexacute=7871,t.ecircumflexbelow=7705,t.ecircumflexdotbelow=7879,t.ecircumflexgrave=7873,t.ecircumflexhookabove=7875,t.ecircumflextilde=7877,t.ecyrillic=1108,t.edblgrave=517,t.edeva=2319,t.edieresis=235,t.edot=279,t.edotaccent=279,t.edotbelow=7865,t.eegurmukhi=2575,t.eematragurmukhi=2631,t.efcyrillic=1092,t.egrave=232,t.egujarati=2703,t.eharmenian=1383,t.ehbopomofo=12573,t.ehiragana=12360,t.ehookabove=7867,t.eibopomofo=12575,t.eight=56,t.eightarabic=1640,t.eightbengali=2542,t.eightcircle=9319,t.eightcircleinversesansserif=10129,t.eightdeva=2414,t.eighteencircle=9329,t.eighteenparen=9349,t.eighteenperiod=9369,t.eightgujarati=2798,t.eightgurmukhi=2670,t.eighthackarabic=1640,t.eighthangzhou=12328,t.eighthnotebeamed=9835,t.eightideographicparen=12839,t.eightinferior=8328,t.eightmonospace=65304,t.eightoldstyle=63288,t.eightparen=9339,t.eightperiod=9359,t.eightpersian=1784,t.eightroman=8567,t.eightsuperior=8312,t.eightthai=3672,t.einvertedbreve=519,t.eiotifiedcyrillic=1125,t.ekatakana=12456,t.ekatakanahalfwidth=65396,t.ekonkargurmukhi=2676,t.ekorean=12628,t.elcyrillic=1083,t.element=8712,t.elevencircle=9322,t.elevenparen=9342,t.elevenperiod=9362,t.elevenroman=8570,t.ellipsis=8230,t.ellipsisvertical=8942,t.emacron=275,t.emacronacute=7703,t.emacrongrave=7701,t.emcyrillic=1084,t.emdash=8212,t.emdashvertical=65073,t.emonospace=65349,t.emphasismarkarmenian=1371,t.emptyset=8709,t.enbopomofo=12579,t.encyrillic=1085,t.endash=8211,t.endashvertical=65074,t.endescendercyrillic=1187,t.eng=331,t.engbopomofo=12581,t.enghecyrillic=1189,t.enhookcyrillic=1224,t.enspace=8194,t.eogonek=281,t.eokorean=12627,t.eopen=603,t.eopenclosed=666,t.eopenreversed=604,t.eopenreversedclosed=606,t.eopenreversedhook=605,t.eparen=9376,t.epsilon=949,t.epsilontonos=941,t.equal=61,t.equalmonospace=65309,t.equalsmall=65126,t.equalsuperior=8316,t.equivalence=8801,t.erbopomofo=12582,t.ercyrillic=1088,t.ereversed=600,t.ereversedcyrillic=1101,t.escyrillic=1089,t.esdescendercyrillic=1195,t.esh=643,t.eshcurl=646,t.eshortdeva=2318,t.eshortvowelsigndeva=2374,t.eshreversedloop=426,t.eshsquatreversed=645,t.esmallhiragana=12359,t.esmallkatakana=12455,t.esmallkatakanahalfwidth=65386,t.estimated=8494,t.esuperior=63212,t.eta=951,t.etarmenian=1384,t.etatonos=942,t.eth=240,t.etilde=7869,t.etildebelow=7707,t.etnahtafoukhhebrew=1425,t.etnahtafoukhlefthebrew=1425,t.etnahtahebrew=1425,t.etnahtalefthebrew=1425,t.eturned=477,t.eukorean=12641,t.euro=8364,t.evowelsignbengali=2503,t.evowelsigndeva=2375,t.evowelsigngujarati=2759,t.exclam=33,t.exclamarmenian=1372,t.exclamdbl=8252,t.exclamdown=161,t.exclamdownsmall=63393,t.exclammonospace=65281,t.exclamsmall=63265,t.existential=8707,t.ezh=658,t.ezhcaron=495,t.ezhcurl=659,t.ezhreversed=441,t.ezhtail=442,t.f=102,t.fadeva=2398,t.fagurmukhi=2654,t.fahrenheit=8457,t.fathaarabic=1614,t.fathalowarabic=1614,t.fathatanarabic=1611,t.fbopomofo=12552,t.fcircle=9429,t.fdotaccent=7711,t.feharabic=1601,t.feharmenian=1414,t.fehfinalarabic=65234,t.fehinitialarabic=65235,t.fehmedialarabic=65236,t.feicoptic=997,t.female=9792,t.ff=64256,t.f_f=64256,t.ffi=64259,t.f_f_i=64259,t.ffl=64260,t.f_f_l=64260,t.fi=64257,t.f_i=64257,t.fifteencircle=9326,t.fifteenparen=9346,t.fifteenperiod=9366,t.figuredash=8210,t.filledbox=9632,t.filledrect=9644,t.finalkaf=1498,t.finalkafdagesh=64314,t.finalkafdageshhebrew=64314,t.finalkafhebrew=1498,t.finalmem=1501,t.finalmemhebrew=1501,t.finalnun=1503,t.finalnunhebrew=1503,t.finalpe=1507,t.finalpehebrew=1507,t.finaltsadi=1509,t.finaltsadihebrew=1509,t.firsttonechinese=713,t.fisheye=9673,t.fitacyrillic=1139,t.five=53,t.fivearabic=1637,t.fivebengali=2539,t.fivecircle=9316,t.fivecircleinversesansserif=10126,t.fivedeva=2411,t.fiveeighths=8541,t.fivegujarati=2795,t.fivegurmukhi=2667,t.fivehackarabic=1637,t.fivehangzhou=12325,t.fiveideographicparen=12836,t.fiveinferior=8325,t.fivemonospace=65301,t.fiveoldstyle=63285,t.fiveparen=9336,t.fiveperiod=9356,t.fivepersian=1781,t.fiveroman=8564,t.fivesuperior=8309,t.fivethai=3669,t.fl=64258,t.f_l=64258,t.florin=402,t.fmonospace=65350,t.fmsquare=13209,t.fofanthai=3615,t.fofathai=3613,t.fongmanthai=3663,t.forall=8704,t.four=52,t.fourarabic=1636,t.fourbengali=2538,t.fourcircle=9315,t.fourcircleinversesansserif=10125,t.fourdeva=2410,t.fourgujarati=2794,t.fourgurmukhi=2666,t.fourhackarabic=1636,t.fourhangzhou=12324,t.fourideographicparen=12835,t.fourinferior=8324,t.fourmonospace=65300,t.fournumeratorbengali=2551,t.fouroldstyle=63284,t.fourparen=9335,t.fourperiod=9355,t.fourpersian=1780,t.fourroman=8563,t.foursuperior=8308,t.fourteencircle=9325,t.fourteenparen=9345,t.fourteenperiod=9365,t.fourthai=3668,t.fourthtonechinese=715,t.fparen=9377,t.fraction=8260,t.franc=8355,t.g=103,t.gabengali=2455,t.gacute=501,t.gadeva=2327,t.gafarabic=1711,t.gaffinalarabic=64403,t.gafinitialarabic=64404,t.gafmedialarabic=64405,t.gagujarati=2711,t.gagurmukhi=2583,t.gahiragana=12364,t.gakatakana=12460,t.gamma=947,t.gammalatinsmall=611,t.gammasuperior=736,t.gangiacoptic=1003,t.gbopomofo=12557,t.gbreve=287,t.gcaron=487,t.gcedilla=291,t.gcircle=9430,t.gcircumflex=285,t.gcommaaccent=291,t.gdot=289,t.gdotaccent=289,t.gecyrillic=1075,t.gehiragana=12370,t.gekatakana=12466,t.geometricallyequal=8785,t.gereshaccenthebrew=1436,t.gereshhebrew=1523,t.gereshmuqdamhebrew=1437,t.germandbls=223,t.gershayimaccenthebrew=1438,t.gershayimhebrew=1524,t.getamark=12307,t.ghabengali=2456,t.ghadarmenian=1394,t.ghadeva=2328,t.ghagujarati=2712,t.ghagurmukhi=2584,t.ghainarabic=1594,t.ghainfinalarabic=65230,t.ghaininitialarabic=65231,t.ghainmedialarabic=65232,t.ghemiddlehookcyrillic=1173,t.ghestrokecyrillic=1171,t.gheupturncyrillic=1169,t.ghhadeva=2394,t.ghhagurmukhi=2650,t.ghook=608,t.ghzsquare=13203,t.gihiragana=12366,t.gikatakana=12462,t.gimarmenian=1379,t.gimel=1490,t.gimeldagesh=64306,t.gimeldageshhebrew=64306,t.gimelhebrew=1490,t.gjecyrillic=1107,t.glottalinvertedstroke=446,t.glottalstop=660,t.glottalstopinverted=662,t.glottalstopmod=704,t.glottalstopreversed=661,t.glottalstopreversedmod=705,t.glottalstopreversedsuperior=740,t.glottalstopstroke=673,t.glottalstopstrokereversed=674,t.gmacron=7713,t.gmonospace=65351,t.gohiragana=12372,t.gokatakana=12468,t.gparen=9378,t.gpasquare=13228,t.gradient=8711,t.grave=96,t.gravebelowcmb=790,t.gravecmb=768,t.gravecomb=768,t.gravedeva=2387,t.gravelowmod=718,t.gravemonospace=65344,t.gravetonecmb=832,t.greater=62,t.greaterequal=8805,t.greaterequalorless=8923,t.greatermonospace=65310,t.greaterorequivalent=8819,t.greaterorless=8823,t.greateroverequal=8807,t.greatersmall=65125,t.gscript=609,t.gstroke=485,t.guhiragana=12368,t.guillemotleft=171,t.guillemotright=187,t.guilsinglleft=8249,t.guilsinglright=8250,t.gukatakana=12464,t.guramusquare=13080,t.gysquare=13257,t.h=104,t.haabkhasiancyrillic=1193,t.haaltonearabic=1729,t.habengali=2489,t.hadescendercyrillic=1203,t.hadeva=2361,t.hagujarati=2745,t.hagurmukhi=2617,t.haharabic=1581,t.hahfinalarabic=65186,t.hahinitialarabic=65187,t.hahiragana=12399,t.hahmedialarabic=65188,t.haitusquare=13098,t.hakatakana=12495,t.hakatakanahalfwidth=65418,t.halantgurmukhi=2637,t.hamzaarabic=1569,t.hamzalowarabic=1569,t.hangulfiller=12644,t.hardsigncyrillic=1098,t.harpoonleftbarbup=8636,t.harpoonrightbarbup=8640,t.hasquare=13258,t.hatafpatah=1458,t.hatafpatah16=1458,t.hatafpatah23=1458,t.hatafpatah2f=1458,t.hatafpatahhebrew=1458,t.hatafpatahnarrowhebrew=1458,t.hatafpatahquarterhebrew=1458,t.hatafpatahwidehebrew=1458,t.hatafqamats=1459,t.hatafqamats1b=1459,t.hatafqamats28=1459,t.hatafqamats34=1459,t.hatafqamatshebrew=1459,t.hatafqamatsnarrowhebrew=1459,t.hatafqamatsquarterhebrew=1459,t.hatafqamatswidehebrew=1459,t.hatafsegol=1457,t.hatafsegol17=1457,t.hatafsegol24=1457,t.hatafsegol30=1457,t.hatafsegolhebrew=1457,t.hatafsegolnarrowhebrew=1457,t.hatafsegolquarterhebrew=1457,t.hatafsegolwidehebrew=1457,t.hbar=295,t.hbopomofo=12559,t.hbrevebelow=7723,t.hcedilla=7721,t.hcircle=9431,t.hcircumflex=293,t.hdieresis=7719,t.hdotaccent=7715,t.hdotbelow=7717,t.he=1492,t.heart=9829,t.heartsuitblack=9829,t.heartsuitwhite=9825,t.hedagesh=64308,t.hedageshhebrew=64308,t.hehaltonearabic=1729,t.heharabic=1607,t.hehebrew=1492,t.hehfinalaltonearabic=64423,t.hehfinalalttwoarabic=65258,t.hehfinalarabic=65258,t.hehhamzaabovefinalarabic=64421,t.hehhamzaaboveisolatedarabic=64420,t.hehinitialaltonearabic=64424,t.hehinitialarabic=65259,t.hehiragana=12408,t.hehmedialaltonearabic=64425,t.hehmedialarabic=65260,t.heiseierasquare=13179,t.hekatakana=12504,t.hekatakanahalfwidth=65421,t.hekutaarusquare=13110,t.henghook=615,t.herutusquare=13113,t.het=1495,t.hethebrew=1495,t.hhook=614,t.hhooksuperior=689,t.hieuhacirclekorean=12923,t.hieuhaparenkorean=12827,t.hieuhcirclekorean=12909,t.hieuhkorean=12622,t.hieuhparenkorean=12813,t.hihiragana=12402,t.hikatakana=12498,t.hikatakanahalfwidth=65419,t.hiriq=1460,t.hiriq14=1460,t.hiriq21=1460,t.hiriq2d=1460,t.hiriqhebrew=1460,t.hiriqnarrowhebrew=1460,t.hiriqquarterhebrew=1460,t.hiriqwidehebrew=1460,t.hlinebelow=7830,t.hmonospace=65352,t.hoarmenian=1392,t.hohipthai=3627,t.hohiragana=12411,t.hokatakana=12507,t.hokatakanahalfwidth=65422,t.holam=1465,t.holam19=1465,t.holam26=1465,t.holam32=1465,t.holamhebrew=1465,t.holamnarrowhebrew=1465,t.holamquarterhebrew=1465,t.holamwidehebrew=1465,t.honokhukthai=3630,t.hookabovecomb=777,t.hookcmb=777,t.hookpalatalizedbelowcmb=801,t.hookretroflexbelowcmb=802,t.hoonsquare=13122,t.horicoptic=1001,t.horizontalbar=8213,t.horncmb=795,t.hotsprings=9832,t.house=8962,t.hparen=9379,t.hsuperior=688,t.hturned=613,t.huhiragana=12405,t.huiitosquare=13107,t.hukatakana=12501,t.hukatakanahalfwidth=65420,t.hungarumlaut=733,t.hungarumlautcmb=779,t.hv=405,t.hyphen=45,t.hypheninferior=63205,t.hyphenmonospace=65293,t.hyphensmall=65123,t.hyphensuperior=63206,t.hyphentwo=8208,t.i=105,t.iacute=237,t.iacyrillic=1103,t.ibengali=2439,t.ibopomofo=12583,t.ibreve=301,t.icaron=464,t.icircle=9432,t.icircumflex=238,t.icyrillic=1110,t.idblgrave=521,t.ideographearthcircle=12943,t.ideographfirecircle=12939,t.ideographicallianceparen=12863,t.ideographiccallparen=12858,t.ideographiccentrecircle=12965,t.ideographicclose=12294,t.ideographiccomma=12289,t.ideographiccommaleft=65380,t.ideographiccongratulationparen=12855,t.ideographiccorrectcircle=12963,t.ideographicearthparen=12847,t.ideographicenterpriseparen=12861,t.ideographicexcellentcircle=12957,t.ideographicfestivalparen=12864,t.ideographicfinancialcircle=12950,t.ideographicfinancialparen=12854,t.ideographicfireparen=12843,t.ideographichaveparen=12850,t.ideographichighcircle=12964,t.ideographiciterationmark=12293,t.ideographiclaborcircle=12952,t.ideographiclaborparen=12856,t.ideographicleftcircle=12967,t.ideographiclowcircle=12966,t.ideographicmedicinecircle=12969,t.ideographicmetalparen=12846,t.ideographicmoonparen=12842,t.ideographicnameparen=12852,t.ideographicperiod=12290,t.ideographicprintcircle=12958,t.ideographicreachparen=12867,t.ideographicrepresentparen=12857,t.ideographicresourceparen=12862,t.ideographicrightcircle=12968,t.ideographicsecretcircle=12953,t.ideographicselfparen=12866,t.ideographicsocietyparen=12851,t.ideographicspace=12288,t.ideographicspecialparen=12853,t.ideographicstockparen=12849,t.ideographicstudyparen=12859,t.ideographicsunparen=12848,t.ideographicsuperviseparen=12860,t.ideographicwaterparen=12844,t.ideographicwoodparen=12845,t.ideographiczero=12295,t.ideographmetalcircle=12942,t.ideographmooncircle=12938,t.ideographnamecircle=12948,t.ideographsuncircle=12944,t.ideographwatercircle=12940,t.ideographwoodcircle=12941,t.ideva=2311,t.idieresis=239,t.idieresisacute=7727,t.idieresiscyrillic=1253,t.idotbelow=7883,t.iebrevecyrillic=1239,t.iecyrillic=1077,t.ieungacirclekorean=12917,t.ieungaparenkorean=12821,t.ieungcirclekorean=12903,t.ieungkorean=12615,t.ieungparenkorean=12807,t.igrave=236,t.igujarati=2695,t.igurmukhi=2567,t.ihiragana=12356,t.ihookabove=7881,t.iibengali=2440,t.iicyrillic=1080,t.iideva=2312,t.iigujarati=2696,t.iigurmukhi=2568,t.iimatragurmukhi=2624,t.iinvertedbreve=523,t.iishortcyrillic=1081,t.iivowelsignbengali=2496,t.iivowelsigndeva=2368,t.iivowelsigngujarati=2752,t.ij=307,t.ikatakana=12452,t.ikatakanahalfwidth=65394,t.ikorean=12643,t.ilde=732,t.iluyhebrew=1452,t.imacron=299,t.imacroncyrillic=1251,t.imageorapproximatelyequal=8787,t.imatragurmukhi=2623,t.imonospace=65353,t.increment=8710,t.infinity=8734,t.iniarmenian=1387,t.integral=8747,t.integralbottom=8993,t.integralbt=8993,t.integralex=63733,t.integraltop=8992,t.integraltp=8992,t.intersection=8745,t.intisquare=13061,t.invbullet=9688,t.invcircle=9689,t.invsmileface=9787,t.iocyrillic=1105,t.iogonek=303,t.iota=953,t.iotadieresis=970,t.iotadieresistonos=912,t.iotalatin=617,t.iotatonos=943,t.iparen=9380,t.irigurmukhi=2674,t.ismallhiragana=12355,t.ismallkatakana=12451,t.ismallkatakanahalfwidth=65384,t.issharbengali=2554,t.istroke=616,t.isuperior=63213,t.iterationhiragana=12445,t.iterationkatakana=12541,t.itilde=297,t.itildebelow=7725,t.iubopomofo=12585,t.iucyrillic=1102,t.ivowelsignbengali=2495,t.ivowelsigndeva=2367,t.ivowelsigngujarati=2751,t.izhitsacyrillic=1141,t.izhitsadblgravecyrillic=1143,t.j=106,t.jaarmenian=1393,t.jabengali=2460,t.jadeva=2332,t.jagujarati=2716,t.jagurmukhi=2588,t.jbopomofo=12560,t.jcaron=496,t.jcircle=9433,t.jcircumflex=309,t.jcrossedtail=669,t.jdotlessstroke=607,t.jecyrillic=1112,t.jeemarabic=1580,t.jeemfinalarabic=65182,t.jeeminitialarabic=65183,t.jeemmedialarabic=65184,t.jeharabic=1688,t.jehfinalarabic=64395,t.jhabengali=2461,t.jhadeva=2333,t.jhagujarati=2717,t.jhagurmukhi=2589,t.jheharmenian=1403,t.jis=12292,t.jmonospace=65354,t.jparen=9381,t.jsuperior=690,t.k=107,t.kabashkircyrillic=1185,t.kabengali=2453,t.kacute=7729,t.kacyrillic=1082,t.kadescendercyrillic=1179,t.kadeva=2325,t.kaf=1499,t.kafarabic=1603,t.kafdagesh=64315,t.kafdageshhebrew=64315,t.kaffinalarabic=65242,t.kafhebrew=1499,t.kafinitialarabic=65243,t.kafmedialarabic=65244,t.kafrafehebrew=64333,t.kagujarati=2709,t.kagurmukhi=2581,t.kahiragana=12363,t.kahookcyrillic=1220,t.kakatakana=12459,t.kakatakanahalfwidth=65398,t.kappa=954,t.kappasymbolgreek=1008,t.kapyeounmieumkorean=12657,t.kapyeounphieuphkorean=12676,t.kapyeounpieupkorean=12664,t.kapyeounssangpieupkorean=12665,t.karoriisquare=13069,t.kashidaautoarabic=1600,t.kashidaautonosidebearingarabic=1600,t.kasmallkatakana=12533,t.kasquare=13188,t.kasraarabic=1616,t.kasratanarabic=1613,t.kastrokecyrillic=1183,t.katahiraprolongmarkhalfwidth=65392,t.kaverticalstrokecyrillic=1181,t.kbopomofo=12558,t.kcalsquare=13193,t.kcaron=489,t.kcedilla=311,t.kcircle=9434,t.kcommaaccent=311,t.kdotbelow=7731,t.keharmenian=1412,t.kehiragana=12369,t.kekatakana=12465,t.kekatakanahalfwidth=65401,t.kenarmenian=1391,t.kesmallkatakana=12534,t.kgreenlandic=312,t.khabengali=2454,t.khacyrillic=1093,t.khadeva=2326,t.khagujarati=2710,t.khagurmukhi=2582,t.khaharabic=1582,t.khahfinalarabic=65190,t.khahinitialarabic=65191,t.khahmedialarabic=65192,t.kheicoptic=999,t.khhadeva=2393,t.khhagurmukhi=2649,t.khieukhacirclekorean=12920,t.khieukhaparenkorean=12824,t.khieukhcirclekorean=12906,t.khieukhkorean=12619,t.khieukhparenkorean=12810,t.khokhaithai=3586,t.khokhonthai=3589,t.khokhuatthai=3587,t.khokhwaithai=3588,t.khomutthai=3675,t.khook=409,t.khorakhangthai=3590,t.khzsquare=13201,t.kihiragana=12365,t.kikatakana=12461,t.kikatakanahalfwidth=65399,t.kiroguramusquare=13077,t.kiromeetorusquare=13078,t.kirosquare=13076,t.kiyeokacirclekorean=12910,t.kiyeokaparenkorean=12814,t.kiyeokcirclekorean=12896,t.kiyeokkorean=12593,t.kiyeokparenkorean=12800,t.kiyeoksioskorean=12595,t.kjecyrillic=1116,t.klinebelow=7733,t.klsquare=13208,t.kmcubedsquare=13222,t.kmonospace=65355,t.kmsquaredsquare=13218,t.kohiragana=12371,t.kohmsquare=13248,t.kokaithai=3585,t.kokatakana=12467,t.kokatakanahalfwidth=65402,t.kooposquare=13086,t.koppacyrillic=1153,t.koreanstandardsymbol=12927,t.koroniscmb=835,t.kparen=9382,t.kpasquare=13226,t.ksicyrillic=1135,t.ktsquare=13263,t.kturned=670,t.kuhiragana=12367,t.kukatakana=12463,t.kukatakanahalfwidth=65400,t.kvsquare=13240,t.kwsquare=13246,t.l=108,t.labengali=2482,t.lacute=314,t.ladeva=2354,t.lagujarati=2738,t.lagurmukhi=2610,t.lakkhangyaothai=3653,t.lamaleffinalarabic=65276,t.lamalefhamzaabovefinalarabic=65272,t.lamalefhamzaaboveisolatedarabic=65271,t.lamalefhamzabelowfinalarabic=65274,t.lamalefhamzabelowisolatedarabic=65273,t.lamalefisolatedarabic=65275,t.lamalefmaddaabovefinalarabic=65270,t.lamalefmaddaaboveisolatedarabic=65269,t.lamarabic=1604,t.lambda=955,t.lambdastroke=411,t.lamed=1500,t.lameddagesh=64316,t.lameddageshhebrew=64316,t.lamedhebrew=1500,t.lamfinalarabic=65246,t.lamhahinitialarabic=64714,t.laminitialarabic=65247,t.lamjeeminitialarabic=64713,t.lamkhahinitialarabic=64715,t.lamlamhehisolatedarabic=65010,t.lammedialarabic=65248,t.lammeemhahinitialarabic=64904,t.lammeeminitialarabic=64716,t.largecircle=9711,t.lbar=410,t.lbelt=620,t.lbopomofo=12556,t.lcaron=318,t.lcedilla=316,t.lcircle=9435,t.lcircumflexbelow=7741,t.lcommaaccent=316,t.ldot=320,t.ldotaccent=320,t.ldotbelow=7735,t.ldotbelowmacron=7737,t.leftangleabovecmb=794,t.lefttackbelowcmb=792,t.less=60,t.lessequal=8804,t.lessequalorgreater=8922,t.lessmonospace=65308,t.lessorequivalent=8818,t.lessorgreater=8822,t.lessoverequal=8806,t.lesssmall=65124,t.lezh=622,t.lfblock=9612,t.lhookretroflex=621,t.lira=8356,t.liwnarmenian=1388,t.lj=457,t.ljecyrillic=1113,t.ll=63168,t.lladeva=2355,t.llagujarati=2739,t.llinebelow=7739,t.llladeva=2356,t.llvocalicbengali=2529,t.llvocalicdeva=2401,t.llvocalicvowelsignbengali=2531,t.llvocalicvowelsigndeva=2403,t.lmiddletilde=619,t.lmonospace=65356,t.lmsquare=13264,t.lochulathai=3628,t.logicaland=8743,t.logicalnot=172,t.logicalnotreversed=8976,t.logicalor=8744,t.lolingthai=3621,t.longs=383,t.lowlinecenterline=65102,t.lowlinecmb=818,t.lowlinedashed=65101,t.lozenge=9674,t.lparen=9383,t.lslash=322,t.lsquare=8467,t.lsuperior=63214,t.ltshade=9617,t.luthai=3622,t.lvocalicbengali=2444,t.lvocalicdeva=2316,t.lvocalicvowelsignbengali=2530,t.lvocalicvowelsigndeva=2402,t.lxsquare=13267,t.m=109,t.mabengali=2478,t.macron=175,t.macronbelowcmb=817,t.macroncmb=772,t.macronlowmod=717,t.macronmonospace=65507,t.macute=7743,t.madeva=2350,t.magujarati=2734,t.magurmukhi=2606,t.mahapakhhebrew=1444,t.mahapakhlefthebrew=1444,t.mahiragana=12414,t.maichattawalowleftthai=63637,t.maichattawalowrightthai=63636,t.maichattawathai=3659,t.maichattawaupperleftthai=63635,t.maieklowleftthai=63628,t.maieklowrightthai=63627,t.maiekthai=3656,t.maiekupperleftthai=63626,t.maihanakatleftthai=63620,t.maihanakatthai=3633,t.maitaikhuleftthai=63625,t.maitaikhuthai=3655,t.maitholowleftthai=63631,t.maitholowrightthai=63630,t.maithothai=3657,t.maithoupperleftthai=63629,t.maitrilowleftthai=63634,t.maitrilowrightthai=63633,t.maitrithai=3658,t.maitriupperleftthai=63632,t.maiyamokthai=3654,t.makatakana=12510,t.makatakanahalfwidth=65423,t.male=9794,t.mansyonsquare=13127,t.maqafhebrew=1470,t.mars=9794,t.masoracirclehebrew=1455,t.masquare=13187,t.mbopomofo=12551,t.mbsquare=13268,t.mcircle=9436,t.mcubedsquare=13221,t.mdotaccent=7745,t.mdotbelow=7747,t.meemarabic=1605,t.meemfinalarabic=65250,t.meeminitialarabic=65251,t.meemmedialarabic=65252,t.meemmeeminitialarabic=64721,t.meemmeemisolatedarabic=64584,t.meetorusquare=13133,t.mehiragana=12417,t.meizierasquare=13182,t.mekatakana=12513,t.mekatakanahalfwidth=65426,t.mem=1502,t.memdagesh=64318,t.memdageshhebrew=64318,t.memhebrew=1502,t.menarmenian=1396,t.merkhahebrew=1445,t.merkhakefulahebrew=1446,t.merkhakefulalefthebrew=1446,t.merkhalefthebrew=1445,t.mhook=625,t.mhzsquare=13202,t.middledotkatakanahalfwidth=65381,t.middot=183,t.mieumacirclekorean=12914,t.mieumaparenkorean=12818,t.mieumcirclekorean=12900,t.mieumkorean=12609,t.mieumpansioskorean=12656,t.mieumparenkorean=12804,t.mieumpieupkorean=12654,t.mieumsioskorean=12655,t.mihiragana=12415,t.mikatakana=12511,t.mikatakanahalfwidth=65424,t.minus=8722,t.minusbelowcmb=800,t.minuscircle=8854,t.minusmod=727,t.minusplus=8723,t.minute=8242,t.miribaarusquare=13130,t.mirisquare=13129,t.mlonglegturned=624,t.mlsquare=13206,t.mmcubedsquare=13219,t.mmonospace=65357,t.mmsquaredsquare=13215,t.mohiragana=12418,t.mohmsquare=13249,t.mokatakana=12514,t.mokatakanahalfwidth=65427,t.molsquare=13270,t.momathai=3617,t.moverssquare=13223,t.moverssquaredsquare=13224,t.mparen=9384,t.mpasquare=13227,t.mssquare=13235,t.msuperior=63215,t.mturned=623,t.mu=181,t.mu1=181,t.muasquare=13186,t.muchgreater=8811,t.muchless=8810,t.mufsquare=13196,t.mugreek=956,t.mugsquare=13197,t.muhiragana=12416,t.mukatakana=12512,t.mukatakanahalfwidth=65425,t.mulsquare=13205,t.multiply=215,t.mumsquare=13211,t.munahhebrew=1443,t.munahlefthebrew=1443,t.musicalnote=9834,t.musicalnotedbl=9835,t.musicflatsign=9837,t.musicsharpsign=9839,t.mussquare=13234,t.muvsquare=13238,t.muwsquare=13244,t.mvmegasquare=13241,t.mvsquare=13239,t.mwmegasquare=13247,t.mwsquare=13245,t.n=110,t.nabengali=2472,t.nabla=8711,t.nacute=324,t.nadeva=2344,t.nagujarati=2728,t.nagurmukhi=2600,t.nahiragana=12394,t.nakatakana=12490,t.nakatakanahalfwidth=65413,t.napostrophe=329,t.nasquare=13185,t.nbopomofo=12555,t.nbspace=160,t.ncaron=328,t.ncedilla=326,t.ncircle=9437,t.ncircumflexbelow=7755,t.ncommaaccent=326,t.ndotaccent=7749,t.ndotbelow=7751,t.nehiragana=12397,t.nekatakana=12493,t.nekatakanahalfwidth=65416,t.newsheqelsign=8362,t.nfsquare=13195,t.ngabengali=2457,t.ngadeva=2329,t.ngagujarati=2713,t.ngagurmukhi=2585,t.ngonguthai=3591,t.nhiragana=12435,t.nhookleft=626,t.nhookretroflex=627,t.nieunacirclekorean=12911,t.nieunaparenkorean=12815,t.nieuncieuckorean=12597,t.nieuncirclekorean=12897,t.nieunhieuhkorean=12598,t.nieunkorean=12596,t.nieunpansioskorean=12648,t.nieunparenkorean=12801,t.nieunsioskorean=12647,t.nieuntikeutkorean=12646,t.nihiragana=12395,t.nikatakana=12491,t.nikatakanahalfwidth=65414,t.nikhahitleftthai=63641,t.nikhahitthai=3661,t.nine=57,t.ninearabic=1641,t.ninebengali=2543,t.ninecircle=9320,t.ninecircleinversesansserif=10130,t.ninedeva=2415,t.ninegujarati=2799,t.ninegurmukhi=2671,t.ninehackarabic=1641,t.ninehangzhou=12329,t.nineideographicparen=12840,t.nineinferior=8329,t.ninemonospace=65305,t.nineoldstyle=63289,t.nineparen=9340,t.nineperiod=9360,t.ninepersian=1785,t.nineroman=8568,t.ninesuperior=8313,t.nineteencircle=9330,t.nineteenparen=9350,t.nineteenperiod=9370,t.ninethai=3673,t.nj=460,t.njecyrillic=1114,t.nkatakana=12531,t.nkatakanahalfwidth=65437,t.nlegrightlong=414,t.nlinebelow=7753,t.nmonospace=65358,t.nmsquare=13210,t.nnabengali=2467,t.nnadeva=2339,t.nnagujarati=2723,t.nnagurmukhi=2595,t.nnnadeva=2345,t.nohiragana=12398,t.nokatakana=12494,t.nokatakanahalfwidth=65417,t.nonbreakingspace=160,t.nonenthai=3603,t.nonuthai=3609,t.noonarabic=1606,t.noonfinalarabic=65254,t.noonghunnaarabic=1722,t.noonghunnafinalarabic=64415,t.nooninitialarabic=65255,t.noonjeeminitialarabic=64722,t.noonjeemisolatedarabic=64587,t.noonmedialarabic=65256,t.noonmeeminitialarabic=64725,t.noonmeemisolatedarabic=64590,t.noonnoonfinalarabic=64653,t.notcontains=8716,t.notelement=8713,t.notelementof=8713,t.notequal=8800,t.notgreater=8815,t.notgreaternorequal=8817,t.notgreaternorless=8825,t.notidentical=8802,t.notless=8814,t.notlessnorequal=8816,t.notparallel=8742,t.notprecedes=8832,t.notsubset=8836,t.notsucceeds=8833,t.notsuperset=8837,t.nowarmenian=1398,t.nparen=9385,t.nssquare=13233,t.nsuperior=8319,t.ntilde=241,t.nu=957,t.nuhiragana=12396,t.nukatakana=12492,t.nukatakanahalfwidth=65415,t.nuktabengali=2492,t.nuktadeva=2364,t.nuktagujarati=2748,t.nuktagurmukhi=2620,t.numbersign=35,t.numbersignmonospace=65283,t.numbersignsmall=65119,t.numeralsigngreek=884,t.numeralsignlowergreek=885,t.numero=8470,t.nun=1504,t.nundagesh=64320,t.nundageshhebrew=64320,t.nunhebrew=1504,t.nvsquare=13237,t.nwsquare=13243,t.nyabengali=2462,t.nyadeva=2334,t.nyagujarati=2718,t.nyagurmukhi=2590,t.o=111,t.oacute=243,t.oangthai=3629,t.obarred=629,t.obarredcyrillic=1257,t.obarreddieresiscyrillic=1259,t.obengali=2451,t.obopomofo=12571,t.obreve=335,t.ocandradeva=2321,t.ocandragujarati=2705,t.ocandravowelsigndeva=2377,t.ocandravowelsigngujarati=2761,t.ocaron=466,t.ocircle=9438,t.ocircumflex=244,t.ocircumflexacute=7889,t.ocircumflexdotbelow=7897,t.ocircumflexgrave=7891,t.ocircumflexhookabove=7893,t.ocircumflextilde=7895,t.ocyrillic=1086,t.odblacute=337,t.odblgrave=525,t.odeva=2323,t.odieresis=246,t.odieresiscyrillic=1255,t.odotbelow=7885,t.oe=339,t.oekorean=12634,t.ogonek=731,t.ogonekcmb=808,t.ograve=242,t.ogujarati=2707,t.oharmenian=1413,t.ohiragana=12362,t.ohookabove=7887,t.ohorn=417,t.ohornacute=7899,t.ohorndotbelow=7907,t.ohorngrave=7901,t.ohornhookabove=7903,t.ohorntilde=7905,t.ohungarumlaut=337,t.oi=419,t.oinvertedbreve=527,t.okatakana=12458,t.okatakanahalfwidth=65397,t.okorean=12631,t.olehebrew=1451,t.omacron=333,t.omacronacute=7763,t.omacrongrave=7761,t.omdeva=2384,t.omega=969,t.omega1=982,t.omegacyrillic=1121,t.omegalatinclosed=631,t.omegaroundcyrillic=1147,t.omegatitlocyrillic=1149,t.omegatonos=974,t.omgujarati=2768,t.omicron=959,t.omicrontonos=972,t.omonospace=65359,t.one=49,t.onearabic=1633,t.onebengali=2535,t.onecircle=9312,t.onecircleinversesansserif=10122,t.onedeva=2407,t.onedotenleader=8228,t.oneeighth=8539,t.onefitted=63196,t.onegujarati=2791,t.onegurmukhi=2663,t.onehackarabic=1633,t.onehalf=189,t.onehangzhou=12321,t.oneideographicparen=12832,t.oneinferior=8321,t.onemonospace=65297,t.onenumeratorbengali=2548,t.oneoldstyle=63281,t.oneparen=9332,t.oneperiod=9352,t.onepersian=1777,t.onequarter=188,t.oneroman=8560,t.onesuperior=185,t.onethai=3665,t.onethird=8531,t.oogonek=491,t.oogonekmacron=493,t.oogurmukhi=2579,t.oomatragurmukhi=2635,t.oopen=596,t.oparen=9386,t.openbullet=9702,t.option=8997,t.ordfeminine=170,t.ordmasculine=186,t.orthogonal=8735,t.oshortdeva=2322,t.oshortvowelsigndeva=2378,t.oslash=248,t.oslashacute=511,t.osmallhiragana=12361,t.osmallkatakana=12457,t.osmallkatakanahalfwidth=65387,t.ostrokeacute=511,t.osuperior=63216,t.otcyrillic=1151,t.otilde=245,t.otildeacute=7757,t.otildedieresis=7759,t.oubopomofo=12577,t.overline=8254,t.overlinecenterline=65098,t.overlinecmb=773,t.overlinedashed=65097,t.overlinedblwavy=65100,t.overlinewavy=65099,t.overscore=175,t.ovowelsignbengali=2507,t.ovowelsigndeva=2379,t.ovowelsigngujarati=2763,t.p=112,t.paampssquare=13184,t.paasentosquare=13099,t.pabengali=2474,t.pacute=7765,t.padeva=2346,t.pagedown=8671,t.pageup=8670,t.pagujarati=2730,t.pagurmukhi=2602,t.pahiragana=12401,t.paiyannoithai=3631,t.pakatakana=12497,t.palatalizationcyrilliccmb=1156,t.palochkacyrillic=1216,t.pansioskorean=12671,t.paragraph=182,t.parallel=8741,t.parenleft=40,t.parenleftaltonearabic=64830,t.parenleftbt=63725,t.parenleftex=63724,t.parenleftinferior=8333,t.parenleftmonospace=65288,t.parenleftsmall=65113,t.parenleftsuperior=8317,t.parenlefttp=63723,t.parenleftvertical=65077,t.parenright=41,t.parenrightaltonearabic=64831,t.parenrightbt=63736,t.parenrightex=63735,t.parenrightinferior=8334,t.parenrightmonospace=65289,t.parenrightsmall=65114,t.parenrightsuperior=8318,t.parenrighttp=63734,t.parenrightvertical=65078,t.partialdiff=8706,t.paseqhebrew=1472,t.pashtahebrew=1433,t.pasquare=13225,t.patah=1463,t.patah11=1463,t.patah1d=1463,t.patah2a=1463,t.patahhebrew=1463,t.patahnarrowhebrew=1463,t.patahquarterhebrew=1463,t.patahwidehebrew=1463,t.pazerhebrew=1441,t.pbopomofo=12550,t.pcircle=9439,t.pdotaccent=7767,t.pe=1508,t.pecyrillic=1087,t.pedagesh=64324,t.pedageshhebrew=64324,t.peezisquare=13115,t.pefinaldageshhebrew=64323,t.peharabic=1662,t.peharmenian=1402,t.pehebrew=1508,t.pehfinalarabic=64343,t.pehinitialarabic=64344,t.pehiragana=12410,t.pehmedialarabic=64345,t.pekatakana=12506,t.pemiddlehookcyrillic=1191,t.perafehebrew=64334,t.percent=37,t.percentarabic=1642,t.percentmonospace=65285,t.percentsmall=65130,t.period=46,t.periodarmenian=1417,t.periodcentered=183,t.periodhalfwidth=65377,t.periodinferior=63207,t.periodmonospace=65294,t.periodsmall=65106,t.periodsuperior=63208,t.perispomenigreekcmb=834,t.perpendicular=8869,t.perthousand=8240,t.peseta=8359,t.pfsquare=13194,t.phabengali=2475,t.phadeva=2347,t.phagujarati=2731,t.phagurmukhi=2603,t.phi=966,t.phi1=981,t.phieuphacirclekorean=12922,t.phieuphaparenkorean=12826,t.phieuphcirclekorean=12908,t.phieuphkorean=12621,t.phieuphparenkorean=12812,t.philatin=632,t.phinthuthai=3642,t.phisymbolgreek=981,t.phook=421,t.phophanthai=3614,t.phophungthai=3612,t.phosamphaothai=3616,t.pi=960,t.pieupacirclekorean=12915,t.pieupaparenkorean=12819,t.pieupcieuckorean=12662,t.pieupcirclekorean=12901,t.pieupkiyeokkorean=12658,t.pieupkorean=12610,t.pieupparenkorean=12805,t.pieupsioskiyeokkorean=12660,t.pieupsioskorean=12612,t.pieupsiostikeutkorean=12661,t.pieupthieuthkorean=12663,t.pieuptikeutkorean=12659,t.pihiragana=12404,t.pikatakana=12500,t.pisymbolgreek=982,t.piwrarmenian=1411,t.planckover2pi=8463,t.planckover2pi1=8463,t.plus=43,t.plusbelowcmb=799,t.pluscircle=8853,t.plusminus=177,t.plusmod=726,t.plusmonospace=65291,t.plussmall=65122,t.plussuperior=8314,t.pmonospace=65360,t.pmsquare=13272,t.pohiragana=12413,t.pointingindexdownwhite=9759,t.pointingindexleftwhite=9756,t.pointingindexrightwhite=9758,t.pointingindexupwhite=9757,t.pokatakana=12509,t.poplathai=3611,t.postalmark=12306,t.postalmarkface=12320,t.pparen=9387,t.precedes=8826,t.prescription=8478,t.primemod=697,t.primereversed=8245,t.product=8719,t.projective=8965,t.prolongedkana=12540,t.propellor=8984,t.propersubset=8834,t.propersuperset=8835,t.proportion=8759,t.proportional=8733,t.psi=968,t.psicyrillic=1137,t.psilipneumatacyrilliccmb=1158,t.pssquare=13232,t.puhiragana=12407,t.pukatakana=12503,t.pvsquare=13236,t.pwsquare=13242,t.q=113,t.qadeva=2392,t.qadmahebrew=1448,t.qafarabic=1602,t.qaffinalarabic=65238,t.qafinitialarabic=65239,t.qafmedialarabic=65240,t.qamats=1464,t.qamats10=1464,t.qamats1a=1464,t.qamats1c=1464,t.qamats27=1464,t.qamats29=1464,t.qamats33=1464,t.qamatsde=1464,t.qamatshebrew=1464,t.qamatsnarrowhebrew=1464,t.qamatsqatanhebrew=1464,t.qamatsqatannarrowhebrew=1464,t.qamatsqatanquarterhebrew=1464,t.qamatsqatanwidehebrew=1464,t.qamatsquarterhebrew=1464,t.qamatswidehebrew=1464,t.qarneyparahebrew=1439,t.qbopomofo=12561,t.qcircle=9440,t.qhook=672,t.qmonospace=65361,t.qof=1511,t.qofdagesh=64327,t.qofdageshhebrew=64327,t.qofhebrew=1511,t.qparen=9388,t.quarternote=9833,t.qubuts=1467,t.qubuts18=1467,t.qubuts25=1467,t.qubuts31=1467,t.qubutshebrew=1467,t.qubutsnarrowhebrew=1467,t.qubutsquarterhebrew=1467,t.qubutswidehebrew=1467,t.question=63,t.questionarabic=1567,t.questionarmenian=1374,t.questiondown=191,t.questiondownsmall=63423,t.questiongreek=894,t.questionmonospace=65311,t.questionsmall=63295,t.quotedbl=34,t.quotedblbase=8222,t.quotedblleft=8220,t.quotedblmonospace=65282,t.quotedblprime=12318,t.quotedblprimereversed=12317,t.quotedblright=8221,t.quoteleft=8216,t.quoteleftreversed=8219,t.quotereversed=8219,t.quoteright=8217,t.quoterightn=329,t.quotesinglbase=8218,t.quotesingle=39,t.quotesinglemonospace=65287,t.r=114,t.raarmenian=1404,t.rabengali=2480,t.racute=341,t.radeva=2352,t.radical=8730,t.radicalex=63717,t.radoverssquare=13230,t.radoverssquaredsquare=13231,t.radsquare=13229,t.rafe=1471,t.rafehebrew=1471,t.ragujarati=2736,t.ragurmukhi=2608,t.rahiragana=12425,t.rakatakana=12521,t.rakatakanahalfwidth=65431,t.ralowerdiagonalbengali=2545,t.ramiddlediagonalbengali=2544,t.ramshorn=612,t.ratio=8758,t.rbopomofo=12566,t.rcaron=345,t.rcedilla=343,t.rcircle=9441,t.rcommaaccent=343,t.rdblgrave=529,t.rdotaccent=7769,t.rdotbelow=7771,t.rdotbelowmacron=7773,t.referencemark=8251,t.reflexsubset=8838,t.reflexsuperset=8839,t.registered=174,t.registersans=63720,t.registerserif=63194,t.reharabic=1585,t.reharmenian=1408,t.rehfinalarabic=65198,t.rehiragana=12428,t.rekatakana=12524,t.rekatakanahalfwidth=65434,t.resh=1512,t.reshdageshhebrew=64328,t.reshhebrew=1512,t.reversedtilde=8765,t.reviahebrew=1431,t.reviamugrashhebrew=1431,t.revlogicalnot=8976,t.rfishhook=638,t.rfishhookreversed=639,t.rhabengali=2525,t.rhadeva=2397,t.rho=961,t.rhook=637,t.rhookturned=635,t.rhookturnedsuperior=693,t.rhosymbolgreek=1009,t.rhotichookmod=734,t.rieulacirclekorean=12913,t.rieulaparenkorean=12817,t.rieulcirclekorean=12899,t.rieulhieuhkorean=12608,t.rieulkiyeokkorean=12602,t.rieulkiyeoksioskorean=12649,t.rieulkorean=12601,t.rieulmieumkorean=12603,t.rieulpansioskorean=12652,t.rieulparenkorean=12803,t.rieulphieuphkorean=12607,t.rieulpieupkorean=12604,t.rieulpieupsioskorean=12651,t.rieulsioskorean=12605,t.rieulthieuthkorean=12606,t.rieultikeutkorean=12650,t.rieulyeorinhieuhkorean=12653,t.rightangle=8735,t.righttackbelowcmb=793,t.righttriangle=8895,t.rihiragana=12426,t.rikatakana=12522,t.rikatakanahalfwidth=65432,t.ring=730,t.ringbelowcmb=805,t.ringcmb=778,t.ringhalfleft=703,t.ringhalfleftarmenian=1369,t.ringhalfleftbelowcmb=796,t.ringhalfleftcentered=723,t.ringhalfright=702,t.ringhalfrightbelowcmb=825,t.ringhalfrightcentered=722,t.rinvertedbreve=531,t.rittorusquare=13137,t.rlinebelow=7775,t.rlongleg=636,t.rlonglegturned=634,t.rmonospace=65362,t.rohiragana=12429,t.rokatakana=12525,t.rokatakanahalfwidth=65435,t.roruathai=3619,t.rparen=9389,t.rrabengali=2524,t.rradeva=2353,t.rragurmukhi=2652,t.rreharabic=1681,t.rrehfinalarabic=64397,t.rrvocalicbengali=2528,t.rrvocalicdeva=2400,t.rrvocalicgujarati=2784,t.rrvocalicvowelsignbengali=2500,t.rrvocalicvowelsigndeva=2372,t.rrvocalicvowelsigngujarati=2756,t.rsuperior=63217,t.rtblock=9616,t.rturned=633,t.rturnedsuperior=692,t.ruhiragana=12427,t.rukatakana=12523,t.rukatakanahalfwidth=65433,t.rupeemarkbengali=2546,t.rupeesignbengali=2547,t.rupiah=63197,t.ruthai=3620,t.rvocalicbengali=2443,t.rvocalicdeva=2315,t.rvocalicgujarati=2699,t.rvocalicvowelsignbengali=2499,t.rvocalicvowelsigndeva=2371,t.rvocalicvowelsigngujarati=2755,t.s=115,t.sabengali=2488,t.sacute=347,t.sacutedotaccent=7781,t.sadarabic=1589,t.sadeva=2360,t.sadfinalarabic=65210,t.sadinitialarabic=65211,t.sadmedialarabic=65212,t.sagujarati=2744,t.sagurmukhi=2616,t.sahiragana=12373,t.sakatakana=12469,t.sakatakanahalfwidth=65403,t.sallallahoualayhewasallamarabic=65018,t.samekh=1505,t.samekhdagesh=64321,t.samekhdageshhebrew=64321,t.samekhhebrew=1505,t.saraaathai=3634,t.saraaethai=3649,t.saraaimaimalaithai=3652,t.saraaimaimuanthai=3651,t.saraamthai=3635,t.saraathai=3632,t.saraethai=3648,t.saraiileftthai=63622,t.saraiithai=3637,t.saraileftthai=63621,t.saraithai=3636,t.saraothai=3650,t.saraueeleftthai=63624,t.saraueethai=3639,t.saraueleftthai=63623,t.sarauethai=3638,t.sarauthai=3640,t.sarauuthai=3641,t.sbopomofo=12569,t.scaron=353,t.scarondotaccent=7783,t.scedilla=351,t.schwa=601,t.schwacyrillic=1241,t.schwadieresiscyrillic=1243,t.schwahook=602,t.scircle=9442,t.scircumflex=349,t.scommaaccent=537,t.sdotaccent=7777,t.sdotbelow=7779,t.sdotbelowdotaccent=7785,t.seagullbelowcmb=828,t.second=8243,t.secondtonechinese=714,t.section=167,t.seenarabic=1587,t.seenfinalarabic=65202,t.seeninitialarabic=65203,t.seenmedialarabic=65204,t.segol=1462,t.segol13=1462,t.segol1f=1462,t.segol2c=1462,t.segolhebrew=1462,t.segolnarrowhebrew=1462,t.segolquarterhebrew=1462,t.segoltahebrew=1426,t.segolwidehebrew=1462,t.seharmenian=1405,t.sehiragana=12379,t.sekatakana=12475,t.sekatakanahalfwidth=65406,t.semicolon=59,t.semicolonarabic=1563,t.semicolonmonospace=65307,t.semicolonsmall=65108,t.semivoicedmarkkana=12444,t.semivoicedmarkkanahalfwidth=65439,t.sentisquare=13090,t.sentosquare=13091,t.seven=55,t.sevenarabic=1639,t.sevenbengali=2541,t.sevencircle=9318,t.sevencircleinversesansserif=10128,t.sevendeva=2413,t.seveneighths=8542,t.sevengujarati=2797,t.sevengurmukhi=2669,t.sevenhackarabic=1639,t.sevenhangzhou=12327,t.sevenideographicparen=12838,t.seveninferior=8327,t.sevenmonospace=65303,t.sevenoldstyle=63287,t.sevenparen=9338,t.sevenperiod=9358,t.sevenpersian=1783,t.sevenroman=8566,t.sevensuperior=8311,t.seventeencircle=9328,t.seventeenparen=9348,t.seventeenperiod=9368,t.seventhai=3671,t.sfthyphen=173,t.shaarmenian=1399,t.shabengali=2486,t.shacyrillic=1096,t.shaddaarabic=1617,t.shaddadammaarabic=64609,t.shaddadammatanarabic=64606,t.shaddafathaarabic=64608,t.shaddakasraarabic=64610,t.shaddakasratanarabic=64607,t.shade=9618,t.shadedark=9619,t.shadelight=9617,t.shademedium=9618,t.shadeva=2358,t.shagujarati=2742,t.shagurmukhi=2614,t.shalshelethebrew=1427,t.shbopomofo=12565,t.shchacyrillic=1097,t.sheenarabic=1588,t.sheenfinalarabic=65206,t.sheeninitialarabic=65207,t.sheenmedialarabic=65208,t.sheicoptic=995,t.sheqel=8362,t.sheqelhebrew=8362,t.sheva=1456,t.sheva115=1456,t.sheva15=1456,t.sheva22=1456,t.sheva2e=1456,t.shevahebrew=1456,t.shevanarrowhebrew=1456,t.shevaquarterhebrew=1456,t.shevawidehebrew=1456,t.shhacyrillic=1211,t.shimacoptic=1005,t.shin=1513,t.shindagesh=64329,t.shindageshhebrew=64329,t.shindageshshindot=64300,t.shindageshshindothebrew=64300,t.shindageshsindot=64301,t.shindageshsindothebrew=64301,t.shindothebrew=1473,t.shinhebrew=1513,t.shinshindot=64298,t.shinshindothebrew=64298,t.shinsindot=64299,t.shinsindothebrew=64299,t.shook=642,t.sigma=963,t.sigma1=962,t.sigmafinal=962,t.sigmalunatesymbolgreek=1010,t.sihiragana=12375,t.sikatakana=12471,t.sikatakanahalfwidth=65404,t.siluqhebrew=1469,t.siluqlefthebrew=1469,t.similar=8764,t.sindothebrew=1474,t.siosacirclekorean=12916,t.siosaparenkorean=12820,t.sioscieuckorean=12670,t.sioscirclekorean=12902,t.sioskiyeokkorean=12666,t.sioskorean=12613,t.siosnieunkorean=12667,t.siosparenkorean=12806,t.siospieupkorean=12669,t.siostikeutkorean=12668,t.six=54,t.sixarabic=1638,t.sixbengali=2540,t.sixcircle=9317,t.sixcircleinversesansserif=10127,t.sixdeva=2412,t.sixgujarati=2796,t.sixgurmukhi=2668,t.sixhackarabic=1638,t.sixhangzhou=12326,t.sixideographicparen=12837,t.sixinferior=8326,t.sixmonospace=65302,t.sixoldstyle=63286,t.sixparen=9337,t.sixperiod=9357,t.sixpersian=1782,t.sixroman=8565,t.sixsuperior=8310,t.sixteencircle=9327,t.sixteencurrencydenominatorbengali=2553,t.sixteenparen=9347,t.sixteenperiod=9367,t.sixthai=3670,t.slash=47,t.slashmonospace=65295,t.slong=383,t.slongdotaccent=7835,t.smileface=9786,t.smonospace=65363,t.sofpasuqhebrew=1475,t.softhyphen=173,t.softsigncyrillic=1100,t.sohiragana=12381,t.sokatakana=12477,t.sokatakanahalfwidth=65407,t.soliduslongoverlaycmb=824,t.solidusshortoverlaycmb=823,t.sorusithai=3625,t.sosalathai=3624,t.sosothai=3595,t.sosuathai=3626,t.space=32,t.spacehackarabic=32,t.spade=9824,t.spadesuitblack=9824,t.spadesuitwhite=9828,t.sparen=9390,t.squarebelowcmb=827,t.squarecc=13252,t.squarecm=13213,t.squarediagonalcrosshatchfill=9641,t.squarehorizontalfill=9636,t.squarekg=13199,t.squarekm=13214,t.squarekmcapital=13262,t.squareln=13265,t.squarelog=13266,t.squaremg=13198,t.squaremil=13269,t.squaremm=13212,t.squaremsquared=13217,t.squareorthogonalcrosshatchfill=9638,t.squareupperlefttolowerrightfill=9639,t.squareupperrighttolowerleftfill=9640,t.squareverticalfill=9637,t.squarewhitewithsmallblack=9635,t.srsquare=13275,t.ssabengali=2487,t.ssadeva=2359,t.ssagujarati=2743,t.ssangcieuckorean=12617,t.ssanghieuhkorean=12677,t.ssangieungkorean=12672,t.ssangkiyeokkorean=12594,t.ssangnieunkorean=12645,t.ssangpieupkorean=12611,t.ssangsioskorean=12614,t.ssangtikeutkorean=12600,t.ssuperior=63218,t.sterling=163,t.sterlingmonospace=65505,t.strokelongoverlaycmb=822,t.strokeshortoverlaycmb=821,t.subset=8834,t.subsetnotequal=8842,t.subsetorequal=8838,t.succeeds=8827,t.suchthat=8715,t.suhiragana=12377,t.sukatakana=12473,t.sukatakanahalfwidth=65405,t.sukunarabic=1618,t.summation=8721,t.sun=9788,t.superset=8835,t.supersetnotequal=8843,t.supersetorequal=8839,t.svsquare=13276,t.syouwaerasquare=13180,t.t=116,t.tabengali=2468,t.tackdown=8868,t.tackleft=8867,t.tadeva=2340,t.tagujarati=2724,t.tagurmukhi=2596,t.taharabic=1591,t.tahfinalarabic=65218,t.tahinitialarabic=65219,t.tahiragana=12383,t.tahmedialarabic=65220,t.taisyouerasquare=13181,t.takatakana=12479,t.takatakanahalfwidth=65408,t.tatweelarabic=1600,t.tau=964,t.tav=1514,t.tavdages=64330,t.tavdagesh=64330,t.tavdageshhebrew=64330,t.tavhebrew=1514,t.tbar=359,t.tbopomofo=12554,t.tcaron=357,t.tccurl=680,t.tcedilla=355,t.tcheharabic=1670,t.tchehfinalarabic=64379,t.tchehinitialarabic=64380,t.tchehmedialarabic=64381,t.tcircle=9443,t.tcircumflexbelow=7793,t.tcommaaccent=355,t.tdieresis=7831,t.tdotaccent=7787,t.tdotbelow=7789,t.tecyrillic=1090,t.tedescendercyrillic=1197,t.teharabic=1578,t.tehfinalarabic=65174,t.tehhahinitialarabic=64674,t.tehhahisolatedarabic=64524,t.tehinitialarabic=65175,t.tehiragana=12390,t.tehjeeminitialarabic=64673,t.tehjeemisolatedarabic=64523,t.tehmarbutaarabic=1577,t.tehmarbutafinalarabic=65172,t.tehmedialarabic=65176,t.tehmeeminitialarabic=64676,t.tehmeemisolatedarabic=64526,t.tehnoonfinalarabic=64627,t.tekatakana=12486,t.tekatakanahalfwidth=65411,t.telephone=8481,t.telephoneblack=9742,t.telishagedolahebrew=1440,t.telishaqetanahebrew=1449,t.tencircle=9321,t.tenideographicparen=12841,t.tenparen=9341,t.tenperiod=9361,t.tenroman=8569,t.tesh=679,t.tet=1496,t.tetdagesh=64312,t.tetdageshhebrew=64312,t.tethebrew=1496,t.tetsecyrillic=1205,t.tevirhebrew=1435,t.tevirlefthebrew=1435,t.thabengali=2469,t.thadeva=2341,t.thagujarati=2725,t.thagurmukhi=2597,t.thalarabic=1584,t.thalfinalarabic=65196,t.thanthakhatlowleftthai=63640,t.thanthakhatlowrightthai=63639,t.thanthakhatthai=3660,t.thanthakhatupperleftthai=63638,t.theharabic=1579,t.thehfinalarabic=65178,t.thehinitialarabic=65179,t.thehmedialarabic=65180,t.thereexists=8707,t.therefore=8756,t.theta=952,t.theta1=977,t.thetasymbolgreek=977,t.thieuthacirclekorean=12921,t.thieuthaparenkorean=12825,t.thieuthcirclekorean=12907,t.thieuthkorean=12620,t.thieuthparenkorean=12811,t.thirteencircle=9324,t.thirteenparen=9344,t.thirteenperiod=9364,t.thonangmonthothai=3601,t.thook=429,t.thophuthaothai=3602,t.thorn=254,t.thothahanthai=3607,t.thothanthai=3600,t.thothongthai=3608,t.thothungthai=3606,t.thousandcyrillic=1154,t.thousandsseparatorarabic=1644,t.thousandsseparatorpersian=1644,t.three=51,t.threearabic=1635,t.threebengali=2537,t.threecircle=9314,t.threecircleinversesansserif=10124,t.threedeva=2409,t.threeeighths=8540,t.threegujarati=2793,t.threegurmukhi=2665,t.threehackarabic=1635,t.threehangzhou=12323,t.threeideographicparen=12834,t.threeinferior=8323,t.threemonospace=65299,t.threenumeratorbengali=2550,t.threeoldstyle=63283,t.threeparen=9334,t.threeperiod=9354,t.threepersian=1779,t.threequarters=190,t.threequartersemdash=63198,t.threeroman=8562,t.threesuperior=179,t.threethai=3667,t.thzsquare=13204,t.tihiragana=12385,t.tikatakana=12481,t.tikatakanahalfwidth=65409,t.tikeutacirclekorean=12912,t.tikeutaparenkorean=12816,t.tikeutcirclekorean=12898,t.tikeutkorean=12599,t.tikeutparenkorean=12802,t.tilde=732,t.tildebelowcmb=816,t.tildecmb=771,t.tildecomb=771,t.tildedoublecmb=864,t.tildeoperator=8764,t.tildeoverlaycmb=820,t.tildeverticalcmb=830,t.timescircle=8855,t.tipehahebrew=1430,t.tipehalefthebrew=1430,t.tippigurmukhi=2672,t.titlocyrilliccmb=1155,t.tiwnarmenian=1407,t.tlinebelow=7791,t.tmonospace=65364,t.toarmenian=1385,t.tohiragana=12392,t.tokatakana=12488,t.tokatakanahalfwidth=65412,t.tonebarextrahighmod=741,t.tonebarextralowmod=745,t.tonebarhighmod=742,t.tonebarlowmod=744,t.tonebarmidmod=743,t.tonefive=445,t.tonesix=389,t.tonetwo=424,t.tonos=900,t.tonsquare=13095,t.topatakthai=3599,t.tortoiseshellbracketleft=12308,t.tortoiseshellbracketleftsmall=65117,t.tortoiseshellbracketleftvertical=65081,t.tortoiseshellbracketright=12309,t.tortoiseshellbracketrightsmall=65118,t.tortoiseshellbracketrightvertical=65082,t.totaothai=3605,t.tpalatalhook=427,t.tparen=9391,t.trademark=8482,t.trademarksans=63722,t.trademarkserif=63195,t.tretroflexhook=648,t.triagdn=9660,t.triaglf=9668,t.triagrt=9658,t.triagup=9650,t.ts=678,t.tsadi=1510,t.tsadidagesh=64326,t.tsadidageshhebrew=64326,t.tsadihebrew=1510,t.tsecyrillic=1094,t.tsere=1461,t.tsere12=1461,t.tsere1e=1461,t.tsere2b=1461,t.tserehebrew=1461,t.tserenarrowhebrew=1461,t.tserequarterhebrew=1461,t.tserewidehebrew=1461,t.tshecyrillic=1115,t.tsuperior=63219,t.ttabengali=2463,t.ttadeva=2335,t.ttagujarati=2719,t.ttagurmukhi=2591,t.tteharabic=1657,t.ttehfinalarabic=64359,t.ttehinitialarabic=64360,t.ttehmedialarabic=64361,t.tthabengali=2464,t.tthadeva=2336,t.tthagujarati=2720,t.tthagurmukhi=2592,t.tturned=647,t.tuhiragana=12388,t.tukatakana=12484,t.tukatakanahalfwidth=65410,t.tusmallhiragana=12387,t.tusmallkatakana=12483,t.tusmallkatakanahalfwidth=65391,t.twelvecircle=9323,t.twelveparen=9343,t.twelveperiod=9363,t.twelveroman=8571,t.twentycircle=9331,t.twentyhangzhou=21316,t.twentyparen=9351,t.twentyperiod=9371,t.two=50,t.twoarabic=1634,t.twobengali=2536,t.twocircle=9313,t.twocircleinversesansserif=10123,t.twodeva=2408,t.twodotenleader=8229,t.twodotleader=8229,t.twodotleadervertical=65072,t.twogujarati=2792,t.twogurmukhi=2664,t.twohackarabic=1634,t.twohangzhou=12322,t.twoideographicparen=12833,t.twoinferior=8322,t.twomonospace=65298,t.twonumeratorbengali=2549,t.twooldstyle=63282,t.twoparen=9333,t.twoperiod=9353,t.twopersian=1778,t.tworoman=8561,t.twostroke=443,t.twosuperior=178,t.twothai=3666,t.twothirds=8532,t.u=117,t.uacute=250,t.ubar=649,t.ubengali=2441,t.ubopomofo=12584,t.ubreve=365,t.ucaron=468,t.ucircle=9444,t.ucircumflex=251,t.ucircumflexbelow=7799,t.ucyrillic=1091,t.udattadeva=2385,t.udblacute=369,t.udblgrave=533,t.udeva=2313,t.udieresis=252,t.udieresisacute=472,t.udieresisbelow=7795,t.udieresiscaron=474,t.udieresiscyrillic=1265,t.udieresisgrave=476,t.udieresismacron=470,t.udotbelow=7909,t.ugrave=249,t.ugujarati=2697,t.ugurmukhi=2569,t.uhiragana=12358,t.uhookabove=7911,t.uhorn=432,t.uhornacute=7913,t.uhorndotbelow=7921,t.uhorngrave=7915,t.uhornhookabove=7917,t.uhorntilde=7919,t.uhungarumlaut=369,t.uhungarumlautcyrillic=1267,t.uinvertedbreve=535,t.ukatakana=12454,t.ukatakanahalfwidth=65395,t.ukcyrillic=1145,t.ukorean=12636,t.umacron=363,t.umacroncyrillic=1263,t.umacrondieresis=7803,t.umatragurmukhi=2625,t.umonospace=65365,t.underscore=95,t.underscoredbl=8215,t.underscoremonospace=65343,t.underscorevertical=65075,t.underscorewavy=65103,t.union=8746,t.universal=8704,t.uogonek=371,t.uparen=9392,t.upblock=9600,t.upperdothebrew=1476,t.upsilon=965,t.upsilondieresis=971,t.upsilondieresistonos=944,t.upsilonlatin=650,t.upsilontonos=973,t.uptackbelowcmb=797,t.uptackmod=724,t.uragurmukhi=2675,t.uring=367,t.ushortcyrillic=1118,t.usmallhiragana=12357,t.usmallkatakana=12453,t.usmallkatakanahalfwidth=65385,t.ustraightcyrillic=1199,t.ustraightstrokecyrillic=1201,t.utilde=361,t.utildeacute=7801,t.utildebelow=7797,t.uubengali=2442,t.uudeva=2314,t.uugujarati=2698,t.uugurmukhi=2570,t.uumatragurmukhi=2626,t.uuvowelsignbengali=2498,t.uuvowelsigndeva=2370,t.uuvowelsigngujarati=2754,t.uvowelsignbengali=2497,t.uvowelsigndeva=2369,t.uvowelsigngujarati=2753,t.v=118,t.vadeva=2357,t.vagujarati=2741,t.vagurmukhi=2613,t.vakatakana=12535,t.vav=1493,t.vavdagesh=64309,t.vavdagesh65=64309,t.vavdageshhebrew=64309,t.vavhebrew=1493,t.vavholam=64331,t.vavholamhebrew=64331,t.vavvavhebrew=1520,t.vavyodhebrew=1521,t.vcircle=9445,t.vdotbelow=7807,t.vecyrillic=1074,t.veharabic=1700,t.vehfinalarabic=64363,t.vehinitialarabic=64364,t.vehmedialarabic=64365,t.vekatakana=12537,t.venus=9792,t.verticalbar=124,t.verticallineabovecmb=781,t.verticallinebelowcmb=809,t.verticallinelowmod=716,t.verticallinemod=712,t.vewarmenian=1406,t.vhook=651,t.vikatakana=12536,t.viramabengali=2509,t.viramadeva=2381,t.viramagujarati=2765,t.visargabengali=2435,t.visargadeva=2307,t.visargagujarati=2691,t.vmonospace=65366,t.voarmenian=1400,t.voicediterationhiragana=12446,t.voicediterationkatakana=12542,t.voicedmarkkana=12443,t.voicedmarkkanahalfwidth=65438,t.vokatakana=12538,t.vparen=9393,t.vtilde=7805,t.vturned=652,t.vuhiragana=12436,t.vukatakana=12532,t.w=119,t.wacute=7811,t.waekorean=12633,t.wahiragana=12431,t.wakatakana=12527,t.wakatakanahalfwidth=65436,t.wakorean=12632,t.wasmallhiragana=12430,t.wasmallkatakana=12526,t.wattosquare=13143,t.wavedash=12316,t.wavyunderscorevertical=65076,t.wawarabic=1608,t.wawfinalarabic=65262,t.wawhamzaabovearabic=1572,t.wawhamzaabovefinalarabic=65158,t.wbsquare=13277,t.wcircle=9446,t.wcircumflex=373,t.wdieresis=7813,t.wdotaccent=7815,t.wdotbelow=7817,t.wehiragana=12433,t.weierstrass=8472,t.wekatakana=12529,t.wekorean=12638,t.weokorean=12637,t.wgrave=7809,t.whitebullet=9702,t.whitecircle=9675,t.whitecircleinverse=9689,t.whitecornerbracketleft=12302,t.whitecornerbracketleftvertical=65091,t.whitecornerbracketright=12303,t.whitecornerbracketrightvertical=65092,t.whitediamond=9671,t.whitediamondcontainingblacksmalldiamond=9672,t.whitedownpointingsmalltriangle=9663,t.whitedownpointingtriangle=9661,t.whiteleftpointingsmalltriangle=9667,t.whiteleftpointingtriangle=9665,t.whitelenticularbracketleft=12310,t.whitelenticularbracketright=12311,t.whiterightpointingsmalltriangle=9657,t.whiterightpointingtriangle=9655,t.whitesmallsquare=9643,t.whitesmilingface=9786,t.whitesquare=9633,t.whitestar=9734,t.whitetelephone=9743,t.whitetortoiseshellbracketleft=12312,t.whitetortoiseshellbracketright=12313,t.whiteuppointingsmalltriangle=9653,t.whiteuppointingtriangle=9651,t.wihiragana=12432,t.wikatakana=12528,t.wikorean=12639,t.wmonospace=65367,t.wohiragana=12434,t.wokatakana=12530,t.wokatakanahalfwidth=65382,t.won=8361,t.wonmonospace=65510,t.wowaenthai=3623,t.wparen=9394,t.wring=7832,t.wsuperior=695,t.wturned=653,t.wynn=447,t.x=120,t.xabovecmb=829,t.xbopomofo=12562,t.xcircle=9447,t.xdieresis=7821,t.xdotaccent=7819,t.xeharmenian=1389,t.xi=958,t.xmonospace=65368,t.xparen=9395,t.xsuperior=739,t.y=121,t.yaadosquare=13134,t.yabengali=2479,t.yacute=253,t.yadeva=2351,t.yaekorean=12626,t.yagujarati=2735,t.yagurmukhi=2607,t.yahiragana=12420,t.yakatakana=12516,t.yakatakanahalfwidth=65428,t.yakorean=12625,t.yamakkanthai=3662,t.yasmallhiragana=12419,t.yasmallkatakana=12515,t.yasmallkatakanahalfwidth=65388,t.yatcyrillic=1123,t.ycircle=9448,t.ycircumflex=375,t.ydieresis=255,t.ydotaccent=7823,t.ydotbelow=7925,t.yeharabic=1610,t.yehbarreearabic=1746,t.yehbarreefinalarabic=64431,t.yehfinalarabic=65266,t.yehhamzaabovearabic=1574,t.yehhamzaabovefinalarabic=65162,t.yehhamzaaboveinitialarabic=65163,t.yehhamzaabovemedialarabic=65164,t.yehinitialarabic=65267,t.yehmedialarabic=65268,t.yehmeeminitialarabic=64733,t.yehmeemisolatedarabic=64600,t.yehnoonfinalarabic=64660,t.yehthreedotsbelowarabic=1745,t.yekorean=12630,t.yen=165,t.yenmonospace=65509,t.yeokorean=12629,t.yeorinhieuhkorean=12678,t.yerahbenyomohebrew=1450,t.yerahbenyomolefthebrew=1450,t.yericyrillic=1099,t.yerudieresiscyrillic=1273,t.yesieungkorean=12673,t.yesieungpansioskorean=12675,t.yesieungsioskorean=12674,t.yetivhebrew=1434,t.ygrave=7923,t.yhook=436,t.yhookabove=7927,t.yiarmenian=1397,t.yicyrillic=1111,t.yikorean=12642,t.yinyang=9775,t.yiwnarmenian=1410,t.ymonospace=65369,t.yod=1497,t.yoddagesh=64313,t.yoddageshhebrew=64313,t.yodhebrew=1497,t.yodyodhebrew=1522,t.yodyodpatahhebrew=64287,t.yohiragana=12424,t.yoikorean=12681,t.yokatakana=12520,t.yokatakanahalfwidth=65430,t.yokorean=12635,t.yosmallhiragana=12423,t.yosmallkatakana=12519,t.yosmallkatakanahalfwidth=65390,t.yotgreek=1011,t.yoyaekorean=12680,t.yoyakorean=12679,t.yoyakthai=3618,t.yoyingthai=3597,t.yparen=9396,t.ypogegrammeni=890,t.ypogegrammenigreekcmb=837,t.yr=422,t.yring=7833,t.ysuperior=696,t.ytilde=7929,t.yturned=654,t.yuhiragana=12422,t.yuikorean=12684,t.yukatakana=12518,t.yukatakanahalfwidth=65429,t.yukorean=12640,t.yusbigcyrillic=1131,t.yusbigiotifiedcyrillic=1133,t.yuslittlecyrillic=1127,t.yuslittleiotifiedcyrillic=1129,t.yusmallhiragana=12421,t.yusmallkatakana=12517,t.yusmallkatakanahalfwidth=65389,t.yuyekorean=12683,t.yuyeokorean=12682,t.yyabengali=2527,t.yyadeva=2399,t.z=122,t.zaarmenian=1382,t.zacute=378,t.zadeva=2395,t.zagurmukhi=2651,t.zaharabic=1592,t.zahfinalarabic=65222,t.zahinitialarabic=65223,t.zahiragana=12374,t.zahmedialarabic=65224,t.zainarabic=1586,t.zainfinalarabic=65200,t.zakatakana=12470,t.zaqefgadolhebrew=1429,t.zaqefqatanhebrew=1428,t.zarqahebrew=1432,t.zayin=1494,t.zayindagesh=64310,t.zayindageshhebrew=64310,t.zayinhebrew=1494,t.zbopomofo=12567,t.zcaron=382,t.zcircle=9449,t.zcircumflex=7825,t.zcurl=657,t.zdot=380,t.zdotaccent=380,t.zdotbelow=7827,t.zecyrillic=1079,t.zedescendercyrillic=1177,t.zedieresiscyrillic=1247,t.zehiragana=12380,t.zekatakana=12476,t.zero=48,t.zeroarabic=1632,t.zerobengali=2534,t.zerodeva=2406,t.zerogujarati=2790,t.zerogurmukhi=2662,t.zerohackarabic=1632,t.zeroinferior=8320,t.zeromonospace=65296,t.zerooldstyle=63280,t.zeropersian=1776,t.zerosuperior=8304,t.zerothai=3664,t.zerowidthjoiner=65279,t.zerowidthnonjoiner=8204,t.zerowidthspace=8203,t.zeta=950,t.zhbopomofo=12563,t.zhearmenian=1386,t.zhebrevecyrillic=1218,t.zhecyrillic=1078,t.zhedescendercyrillic=1175,t.zhedieresiscyrillic=1245,t.zihiragana=12376,t.zikatakana=12472,t.zinorhebrew=1454,t.zlinebelow=7829,t.zmonospace=65370,t.zohiragana=12382,t.zokatakana=12478,t.zparen=9397,t.zretroflexhook=656,t.zstroke=438,t.zuhiragana=12378,t.zukatakana=12474,t[".notdef"]=0,t.angbracketleftbig=9001,t.angbracketleftBig=9001,t.angbracketleftbigg=9001,t.angbracketleftBigg=9001,t.angbracketrightBig=9002,t.angbracketrightbig=9002,t.angbracketrightBigg=9002,t.angbracketrightbigg=9002,t.arrowhookleft=8618,t.arrowhookright=8617,t.arrowlefttophalf=8636,t.arrowleftbothalf=8637,t.arrownortheast=8599,t.arrownorthwest=8598,t.arrowrighttophalf=8640,t.arrowrightbothalf=8641,t.arrowsoutheast=8600,t.arrowsouthwest=8601,t.backslashbig=8726,t.backslashBig=8726,t.backslashBigg=8726,t.backslashbigg=8726,t.bardbl=8214,t.bracehtipdownleft=65079,t.bracehtipdownright=65079,t.bracehtipupleft=65080,t.bracehtipupright=65080,t.braceleftBig=123,t.braceleftbig=123,t.braceleftbigg=123,t.braceleftBigg=123,t.bracerightBig=125,t.bracerightbig=125,t.bracerightbigg=125,t.bracerightBigg=125,t.bracketleftbig=91,t.bracketleftBig=91,t.bracketleftbigg=91,t.bracketleftBigg=91,t.bracketrightBig=93,t.bracketrightbig=93,t.bracketrightbigg=93,t.bracketrightBigg=93,t.ceilingleftbig=8968,t.ceilingleftBig=8968,t.ceilingleftBigg=8968,t.ceilingleftbigg=8968,t.ceilingrightbig=8969,t.ceilingrightBig=8969,t.ceilingrightbigg=8969,t.ceilingrightBigg=8969,t.circledotdisplay=8857,t.circledottext=8857,t.circlemultiplydisplay=8855,t.circlemultiplytext=8855,t.circleplusdisplay=8853,t.circleplustext=8853,t.contintegraldisplay=8750,t.contintegraltext=8750,t.coproductdisplay=8720,t.coproducttext=8720,t.floorleftBig=8970,t.floorleftbig=8970,t.floorleftbigg=8970,t.floorleftBigg=8970,t.floorrightbig=8971,t.floorrightBig=8971,t.floorrightBigg=8971,t.floorrightbigg=8971,t.hatwide=770,t.hatwider=770,t.hatwidest=770,t.intercal=7488,t.integraldisplay=8747,t.integraltext=8747,t.intersectiondisplay=8898,t.intersectiontext=8898,t.logicalanddisplay=8743,t.logicalandtext=8743,t.logicalordisplay=8744,t.logicalortext=8744,t.parenleftBig=40,t.parenleftbig=40,t.parenleftBigg=40,t.parenleftbigg=40,t.parenrightBig=41,t.parenrightbig=41,t.parenrightBigg=41,t.parenrightbigg=41,t.prime=8242,t.productdisplay=8719,t.producttext=8719,t.radicalbig=8730,t.radicalBig=8730,t.radicalBigg=8730,t.radicalbigg=8730,t.radicalbt=8730,t.radicaltp=8730,t.radicalvertex=8730,t.slashbig=47,t.slashBig=47,t.slashBigg=47,t.slashbigg=47,t.summationdisplay=8721,t.summationtext=8721,t.tildewide=732,t.tildewider=732,t.tildewidest=732,t.uniondisplay=8899,t.unionmultidisplay=8846,t.unionmultitext=8846,t.unionsqdisplay=8852,t.unionsqtext=8852,t.uniontext=8899,t.vextenddouble=8741,t.vextendsingle=8739}),Qpe=un(function(t){t.space=32,t.a1=9985,t.a2=9986,t.a202=9987,t.a3=9988,t.a4=9742,t.a5=9990,t.a119=9991,t.a118=9992,t.a117=9993,t.a11=9755,t.a12=9758,t.a13=9996,t.a14=9997,t.a15=9998,t.a16=9999,t.a105=1e4,t.a17=10001,t.a18=10002,t.a19=10003,t.a20=10004,t.a21=10005,t.a22=10006,t.a23=10007,t.a24=10008,t.a25=10009,t.a26=10010,t.a27=10011,t.a28=10012,t.a6=10013,t.a7=10014,t.a8=10015,t.a9=10016,t.a10=10017,t.a29=10018,t.a30=10019,t.a31=10020,t.a32=10021,t.a33=10022,t.a34=10023,t.a35=9733,t.a36=10025,t.a37=10026,t.a38=10027,t.a39=10028,t.a40=10029,t.a41=10030,t.a42=10031,t.a43=10032,t.a44=10033,t.a45=10034,t.a46=10035,t.a47=10036,t.a48=10037,t.a49=10038,t.a50=10039,t.a51=10040,t.a52=10041,t.a53=10042,t.a54=10043,t.a55=10044,t.a56=10045,t.a57=10046,t.a58=10047,t.a59=10048,t.a60=10049,t.a61=10050,t.a62=10051,t.a63=10052,t.a64=10053,t.a65=10054,t.a66=10055,t.a67=10056,t.a68=10057,t.a69=10058,t.a70=10059,t.a71=9679,t.a72=10061,t.a73=9632,t.a74=10063,t.a203=10064,t.a75=10065,t.a204=10066,t.a76=9650,t.a77=9660,t.a78=9670,t.a79=10070,t.a81=9687,t.a82=10072,t.a83=10073,t.a84=10074,t.a97=10075,t.a98=10076,t.a99=10077,t.a100=10078,t.a101=10081,t.a102=10082,t.a103=10083,t.a104=10084,t.a106=10085,t.a107=10086,t.a108=10087,t.a112=9827,t.a111=9830,t.a110=9829,t.a109=9824,t.a120=9312,t.a121=9313,t.a122=9314,t.a123=9315,t.a124=9316,t.a125=9317,t.a126=9318,t.a127=9319,t.a128=9320,t.a129=9321,t.a130=10102,t.a131=10103,t.a132=10104,t.a133=10105,t.a134=10106,t.a135=10107,t.a136=10108,t.a137=10109,t.a138=10110,t.a139=10111,t.a140=10112,t.a141=10113,t.a142=10114,t.a143=10115,t.a144=10116,t.a145=10117,t.a146=10118,t.a147=10119,t.a148=10120,t.a149=10121,t.a150=10122,t.a151=10123,t.a152=10124,t.a153=10125,t.a154=10126,t.a155=10127,t.a156=10128,t.a157=10129,t.a158=10130,t.a159=10131,t.a160=10132,t.a161=8594,t.a163=8596,t.a164=8597,t.a196=10136,t.a165=10137,t.a192=10138,t.a166=10139,t.a167=10140,t.a168=10141,t.a169=10142,t.a170=10143,t.a171=10144,t.a172=10145,t.a173=10146,t.a162=10147,t.a174=10148,t.a175=10149,t.a176=10150,t.a177=10151,t.a178=10152,t.a179=10153,t.a193=10154,t.a180=10155,t.a199=10156,t.a181=10157,t.a200=10158,t.a182=10159,t.a201=10161,t.a183=10162,t.a184=10163,t.a197=10164,t.a185=10165,t.a194=10166,t.a198=10167,t.a186=10168,t.a195=10169,t.a187=10170,t.a188=10171,t.a189=10172,t.a190=10173,t.a191=10174,t.a89=10088,t.a90=10089,t.a93=10090,t.a94=10091,t.a91=10092,t.a92=10093,t.a205=10094,t.a85=10095,t.a206=10096,t.a86=10097,t.a87=10098,t.a88=10099,t.a95=10100,t.a96=10101,t[".notdef"]=0}),ege=un(function(t){t[63721]=169,t[63193]=169,t[63720]=174,t[63194]=174,t[63722]=8482,t[63195]=8482,t[63729]=9127,t[63730]=9128,t[63731]=9129,t[63740]=9131,t[63741]=9132,t[63742]=9133,t[63726]=9121,t[63727]=9122,t[63728]=9123,t[63737]=9124,t[63738]=9125,t[63739]=9126,t[63723]=9115,t[63724]=9116,t[63725]=9117,t[63734]=9118,t[63735]=9119,t[63736]=9120});function tge(t){return t>=65520&&t<=65535?0:t>=62976&&t<=63743?ege()[t]||t:t===173?45:t}function lm(t,e){let r=e[t];if(r!==void 0)return r;if(!t)return-1;if(t[0]==="u"){const n=t.length;let i;if(n===7&&t[1]==="n"&&t[2]==="i")i=t.substring(3);else if(n>=5&&n<=7)i=t.substring(1);else return-1;if(i===i.toUpperCase()&&(r=parseInt(i,16),r>=0))return r}return-1}const d8=[[0,127],[128,255],[256,383],[384,591],[592,687,7424,7551,7552,7615],[688,767,42752,42783],[768,879,7616,7679],[880,1023],[11392,11519],[1024,1279,1280,1327,11744,11775,42560,42655],[1328,1423],[1424,1535],[42240,42559],[1536,1791,1872,1919],[1984,2047],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3584,3711],[3712,3839],[4256,4351,11520,11567],[6912,7039],[4352,4607],[7680,7935,11360,11391,42784,43007],[7936,8191],[8192,8303,11776,11903],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703,10224,10239,10496,10623,11008,11263],[8704,8959,10752,11007,10176,10223,10624,10751],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[12288,12351],[12352,12447],[12448,12543,12784,12799],[12544,12591,12704,12735],[12592,12687],[43072,43135],[12800,13055],[13056,13311],[44032,55215],[55296,57343],[67840,67871],[19968,40959,11904,12031,12032,12255,12272,12287,13312,19903,131072,173791,12688,12703],[57344,63743],[12736,12783,63744,64255,194560,195103],[64256,64335],[64336,65023],[65056,65071],[65040,65055],[65104,65135],[65136,65279],[65280,65519],[65520,65535],[3840,4095],[1792,1871],[1920,1983],[3456,3583],[4096,4255],[4608,4991,4992,5023,11648,11743],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[10240,10495],[40960,42127],[5888,5919,5920,5951,5952,5983,5984,6015],[66304,66351],[66352,66383],[66560,66639],[118784,119039,119040,119295,119296,119375],[119808,120831],[1044480,1048573],[65024,65039,917760,917999],[917504,917631],[6400,6479],[6480,6527],[6528,6623],[6656,6687],[11264,11359],[11568,11647],[19904,19967],[43008,43055],[65536,65663,65664,65791,65792,65855],[65856,65935],[66432,66463],[66464,66527],[66640,66687],[66688,66735],[67584,67647],[68096,68191],[119552,119647],[73728,74751,74752,74879],[119648,119679],[7040,7103],[7168,7247],[7248,7295],[43136,43231],[43264,43311],[43312,43359],[43520,43615],[65936,65999],[66e3,66047],[66208,66271,66176,66207,67872,67903],[127024,127135,126976,127023]];function rge(t,e=-1){if(e!==-1){const r=d8[e];for(let n=0,i=r.length;n<i;n+=2)if(t>=r[n]&&t<=r[n+1])return e}for(let r=0,n=d8.length;r<n;r++){const i=d8[r];for(let a=0,s=i.length;a<s;a+=2)if(t>=i[a]&&t<=i[a+1])return r}return-1}const nge=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),xT=new Map;function ige(t){const e=xT.get(t);if(e)return e;const r=t.match(nge),n={isWhitespace:!!r?.[1],isZeroWidthDiacritic:!!r?.[2],isInvisibleFormatMark:!!r?.[3]};return xT.set(t,n),n}function age(){xT.clear()}const Rg=!0,Jo={FixedPitch:1,Serif:2,Symbolic:4,Nonsymbolic:32},BN=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function Zq(t,e){if(e[t]!==void 0)return t;const r=lm(t,e);if(r!==-1){for(const n in e)if(e[n]===r)return n}return Ht("Unable to recover a standard glyph name for: "+t),t}function Jq(t,e,r){const n=Object.create(null);let i,a,s;const o=!!(t.flags&Jo.Symbolic);if(t.isInternalFont)for(s=e,a=0;a<s.length;a++)i=r.indexOf(s[a]),n[a]=i>=0?i:0;else if(t.baseEncodingName)for(s=ix(t.baseEncodingName),a=0;a<s.length;a++)i=r.indexOf(s[a]),n[a]=i>=0?i:0;else if(o)for(a in e)n[a]=e[a];else for(s=Cu,a=0;a<s.length;a++)i=r.indexOf(s[a]),n[a]=i>=0?i:0;const l=t.differences;let c;if(l)for(a in l){const u=l[a];if(i=r.indexOf(u),i===-1){c||(c=nc());const h=Zq(u,c);h!==u&&(i=r.indexOf(h))}n[a]=i>=0?i:0}return n}function pb(t){return t.replaceAll(/[,_]/g,"-").replaceAll(/\s/g,"")}const sge=un(t=>{t[8211]=65074,t[8212]=65073,t[8229]=65072,t[8230]=65049,t[12289]=65041,t[12290]=65042,t[12296]=65087,t[12297]=65088,t[12298]=65085,t[12299]=65086,t[12300]=65089,t[12301]=65090,t[12302]=65091,t[12303]=65092,t[12304]=65083,t[12305]=65084,t[12308]=65081,t[12309]=65082,t[12310]=65047,t[12311]=65048,t[65103]=65076,t[65281]=65045,t[65288]=65077,t[65289]=65078,t[65292]=65040,t[65306]=65043,t[65307]=65044,t[65311]=65046,t[65339]=65095,t[65341]=65096,t[65343]=65075,t[65371]=65079,t[65373]=65080}),FN=1e3;function oge({data:t,width:e,height:r}){if(e>FN||r>FN)return null;const n=1e3,i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),a=e+1,s=new Uint8Array(a*(r+1));let o,l,c;const u=e+7&-8,h=new Uint8Array(u*r);let f=0;for(const _ of t){let S=128;for(;S>0;)h[f++]=_&S?0:255,S>>=1}let d=0;for(f=0,h[f]!==0&&(s[0]=1,++d),l=1;l<e;l++)h[f]!==h[f+1]&&(s[l]=h[f]?2:1,++d),f++;for(h[f]!==0&&(s[l]=2,++d),o=1;o<r;o++){f=o*u,c=o*a,h[f-u]!==h[f]&&(s[c]=h[f]?1:8,++d);let _=(h[f]?4:0)+(h[f-u]?8:0);for(l=1;l<e;l++)_=(_>>2)+(h[f+1]?4:0)+(h[f-u+1]?8:0),i[_]&&(s[c+l]=i[_],++d),f++;if(h[f-u]!==h[f]&&(s[c+l]=h[f]?2:4,++d),d>n)return null}for(f=u*(r-1),c=o*a,h[f]!==0&&(s[c]=8,++d),l=1;l<e;l++)h[f]!==h[f+1]&&(s[c+l]=h[f]?4:8,++d),f++;if(h[f]!==0&&(s[c+l]=4,++d),d>n)return null;const p=new Int32Array([0,a,-1,0,-a,0,0,0,1]),g=[],{a:m,b:v,c:y,d:x,e:b,f:w}=new DOMMatrix().scaleSelf(1/e,-1/r).translateSelf(0,-r);for(o=0;d&&o<=r;o++){let _=o*a;const S=_+e;for(;_<S&&!s[_];)_++;if(_===S)continue;let C=_%a,T=o;g.push(qr.moveTo,m*C+y*T+b,v*C+x*T+w);const A=_;let k=s[_];do{const I=p[k];do _+=I;while(!s[_]);const E=s[_];E!==5&&E!==10?(k=E,s[_]=0):(k=E&51*k>>4,s[_]&=k>>2|k<<2),C=_%a,T=_/a|0,g.push(qr.lineTo,m*C+y*T+b,v*C+x*T+w),s[_]||--d}while(A!==_);--o}return[Z.rawFillPath,[new Float32Array(g)],new Float32Array([0,0,e,r])]}const lge=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],cge=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],uge=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"],hge=10,w_=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],_2=391,yp=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1},{id:"return",min:0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],fge=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]+t[e-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]-t[e-1]}},{id:"div",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]/t[e-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(t,e){t[e-1]=-t[e-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]*t[e-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];class zI{constructor(e,r,n){this.bytes=e.getBytes(),this.properties=r,this.seacAnalysisEnabled=!!n}parse(){const e=this.properties,r=new Qq;this.cff=r;const n=this.parseHeader(),i=this.parseIndex(n.endPos),a=this.parseIndex(i.endPos),s=this.parseIndex(a.endPos),o=this.parseIndex(s.endPos),l=this.parseDict(a.obj.get(0)),c=this.createDict(ax,l,r.strings);r.header=n.obj,r.names=this.parseNameIndex(i.obj),r.strings=this.parseStringIndex(s.obj),r.topDict=c,r.globalSubrIndex=o.obj,this.parsePrivateDict(r.topDict),r.isCIDFont=c.hasName("ROS");const u=c.getByName("CharStrings"),h=this.parseIndex(u).obj;r.charStringCount=h.count;const f=c.getByName("FontMatrix");f&&(e.fontMatrix=f);const d=c.getByName("FontBBox");d&&(e.ascent=Math.max(d[3],d[1]),e.descent=Math.min(d[1],d[3]),e.ascentScaled=!0);let p,g;if(r.isCIDFont){const v=this.parseIndex(c.getByName("FDArray")).obj;for(let y=0,x=v.count;y<x;++y){const b=v.get(y),w=this.createDict(ax,this.parseDict(b),r.strings);this.parsePrivateDict(w),r.fdArray.push(w)}g=null,p=this.parseCharsets(c.getByName("charset"),h.count,r.strings,!0),r.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),h.count)}else p=this.parseCharsets(c.getByName("charset"),h.count,r.strings,!1),g=this.parseEncoding(c.getByName("Encoding"),e,r.strings,p.charset);r.charset=p,r.encoding=g;const m=this.parseCharStrings({charStrings:h,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:o.obj,fdSelect:r.fdSelect,fdArray:r.fdArray,privateDict:c.privateDict});return r.charStrings=m.charStrings,r.seacs=m.seacs,r.widths=m.widths,r}parseHeader(){let e=this.bytes;const r=e.length;let n=0;for(;n<r&&e[n]!==1;)++n;if(n>=r)throw new fe("Invalid CFF header");n!==0&&(Ht("cff data is shifted"),e=e.subarray(n),this.bytes=e);const i=e[0],a=e[1],s=e[2],o=e[3];return{obj:new eX(i,a,s,o),endPos:s}}parseDict(e){let r=0;function n(){let l=e[r++];return l===30?i():l===28?(l=pu(e,r),r+=2,l):l===29?(l=e[r++],l=l<<8|e[r++],l=l<<8|e[r++],l=l<<8|e[r++],l):l>=32&&l<=246?l-139:l>=247&&l<=250?(l-247)*256+e[r++]+108:l>=251&&l<=254?-((l-251)*256)-e[r++]-108:(ee('CFFParser_parseDict: "'+l+'" is a reserved command.'),NaN)}function i(){let l="";const u=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],h=e.length;for(;r<h;){const f=e[r++],d=f>>4,p=f&15;if(d===15||(l+=u[d],p===15))break;l+=u[p]}return parseFloat(l)}let a=[];const s=[];r=0;const o=e.length;for(;r<o;){let l=e[r];l<=21?(l===12&&(l=l<<8|e[++r]),s.push([l,a]),a=[],++r):a.push(n())}return s}parseIndex(e){const r=new Mh,n=this.bytes,i=n[e++]<<8|n[e++],a=[];let s=e,o,l;if(i!==0){const c=n[e++],u=e+(i+1)*c-1;for(o=0,l=i+1;o<l;++o){let h=0;for(let f=0;f<c;++f)h<<=8,h+=n[e++];a.push(u+h)}s=a[i]}for(o=0,l=a.length-1;o<l;++o){const c=a[o],u=a[o+1];r.add(n.subarray(c,u))}return{obj:r,endPos:s}}parseNameIndex(e){const r=[];for(let n=0,i=e.count;n<i;++n){const a=e.get(n);r.push(As(a))}return r}parseStringIndex(e){const r=new VI;for(let n=0,i=e.count;n<i;++n){const a=e.get(n);r.add(As(a))}return r}createDict(e,r,n){const i=new e(n);for(const[a,s]of r)i.setByKey(a,s);return i}parseCharString(e,r,n,i){if(!r||e.callDepth>hge)return!1;let a=e.stackSize;const s=e.stack;let o=r.length;for(let l=0;l<o;){const c=r[l++];let u=null;if(c===12){const h=r[l++];h===0?(r[l-2]=139,r[l-1]=22,a=0):u=fge[h]}else if(c===28)s[a]=pu(r,l),l+=2,a++;else if(c===14){if(a>=4&&(a-=4,this.seacAnalysisEnabled))return e.seac=s.slice(a,a+4),!1;u=yp[c]}else if(c>=32&&c<=246)s[a]=c-139,a++;else if(c>=247&&c<=254)s[a]=c<251?(c-247<<8)+r[l]+108:-(c-251<<8)-r[l]-108,l++,a++;else if(c===255)s[a]=(r[l]<<24|r[l+1]<<16|r[l+2]<<8|r[l+3])/65536,l+=4,a++;else if(c===19||c===20){if(e.hints+=a>>1,e.hints===0){r.copyWithin(l-1,l,-1),l-=1,o-=1;continue}l+=e.hints+7>>3,a%=2,u=yp[c]}else if(c===10||c===29){const h=c===10?n:i;if(!h)return u=yp[c],ee("Missing subrsIndex for "+u.id),!1;let f=32768;h.count<1240?f=107:h.count<33900&&(f=1131);const d=s[--a]+f;if(d<0||d>=h.count||isNaN(d))return u=yp[c],ee("Out of bounds subrIndex for "+u.id),!1;if(e.stackSize=a,e.callDepth++,!this.parseCharString(e,h.get(d),n,i))return!1;e.callDepth--,a=e.stackSize;continue}else{if(c===11)return e.stackSize=a,!0;if(c===0&&l===r.length)r[l-1]=14,u=yp[14];else if(c===9){r.copyWithin(l-1,l,-1),l-=1,o-=1;continue}else u=yp[c]}if(u){if(u.stem&&(e.hints+=a>>1,c===3||c===23?e.hasVStems=!0:e.hasVStems&&(c===1||c===18)&&(ee("CFF stem hints are in wrong order"),r[l-1]=c===1?3:23)),a<u.min)return ee("Not enough parameters for "+u.id+"; actual: "+a+", expected: "+u.min),a===0?(r[l-1]=14,!0):!1;e.firstStackClearing&&u.stackClearing&&(e.firstStackClearing=!1,a-=u.min,a>=2&&u.stem?a%=2:a>1&&ee("Found too many parameters for stack-clearing command"),a>0&&(e.width=s[a-1])),"stackDelta"in u?("stackFn"in u&&u.stackFn(s,a),a+=u.stackDelta):(u.stackClearing||u.resetStack)&&(a=0)}}return o<r.length&&r.fill(14,o),e.stackSize=a,!0}parseCharStrings({charStrings:e,localSubrIndex:r,globalSubrIndex:n,fdSelect:i,fdArray:a,privateDict:s}){const o=[],l=[],c=e.count;for(let u=0;u<c;u++){const h=e.get(u),f={callDepth:0,stackSize:0,stack:[],hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let d=!0,p=null,g=s;if(i&&a.length){const m=i.getFDIndex(u);m===-1&&(ee("Glyph index is not in fd select."),d=!1),m>=a.length&&(ee("Invalid fd index for glyph index."),d=!1),d&&(g=a[m].privateDict,p=g.subrsIndex)}else r&&(p=r);if(d&&(d=this.parseCharString(f,h,p,n)),f.width!==null){const m=g.getByName("nominalWidthX");l[u]=m+f.width}else{const m=g.getByName("defaultWidthX");l[u]=m}f.seac!==null&&(o[u]=f.seac),d||e.set(u,new Uint8Array([14]))}return{charStrings:e,seacs:o,widths:l}}emptyPrivateDictionary(e){const r=this.createDict(sx,[],e.strings);e.setByKey(18,[0,0]),e.privateDict=r}parsePrivateDict(e){if(!e.hasName("Private")){this.emptyPrivateDictionary(e);return}const r=e.getByName("Private");if(!Array.isArray(r)||r.length!==2){e.removeByName("Private");return}const n=r[0],i=r[1];if(n===0||i>=this.bytes.length){this.emptyPrivateDictionary(e);return}const a=i+n,s=this.bytes.subarray(i,a),o=this.parseDict(s),l=this.createDict(sx,o,e.strings);if(e.privateDict=l,l.getByName("ExpansionFactor")===0&&l.setByName("ExpansionFactor",.06),!l.getByName("Subrs"))return;const c=l.getByName("Subrs"),u=i+c;if(c===0||u>=this.bytes.length){this.emptyPrivateDictionary(e);return}const h=this.parseIndex(u);l.subrsIndex=h.obj}parseCharsets(e,r,n,i){if(e===0)return new Uv(!0,p8.ISO_ADOBE,lge);if(e===1)return new Uv(!0,p8.EXPERT,cge);if(e===2)return new Uv(!0,p8.EXPERT_SUBSET,uge);const a=this.bytes,s=e,o=a[e++],l=[i?0:".notdef"];let c,u,h;switch(r-=1,o){case 0:for(h=0;h<r;h++)c=a[e++]<<8|a[e++],l.push(i?c:n.get(c));break;case 1:for(;l.length<=r;)for(c=a[e++]<<8|a[e++],u=a[e++],h=0;h<=u;h++)l.push(i?c++:n.get(c++));break;case 2:for(;l.length<=r;)for(c=a[e++]<<8|a[e++],u=a[e++]<<8|a[e++],h=0;h<=u;h++)l.push(i?c++:n.get(c++));break;default:throw new fe("Unknown charset format")}const f=e,d=a.subarray(s,f);return new Uv(!1,o,l,d)}parseEncoding(e,r,n,i){const a=Object.create(null),s=this.bytes;let o=!1,l,c,u,h=null;function f(){const d=s[e++];for(c=0;c<d;c++){const p=s[e++],g=(s[e++]<<8)+(s[e++]&255);a[p]=i.indexOf(n.get(g))}}if(e===0||e===1){o=!0,l=e;const d=e?Kq:Cu;for(c=0,u=i.length;c<u;c++){const p=d.indexOf(i[c]);p!==-1&&(a[p]=c)}}else{const d=e;switch(l=s[e++],l&127){case 0:const g=s[e++];for(c=1;c<=g;c++)a[s[e++]]=c;break;case 1:const m=s[e++];let v=1;for(c=0;c<m;c++){const y=s[e++],x=s[e++];for(let b=y;b<=y+x;b++)a[b]=v++}break;default:throw new fe(`Unknown encoding format: ${l} in CFF`)}const p=e;l&128&&(s[d]&=127,f()),h=s.subarray(d,p)}return l&=127,new gge(o,l,a,h)}parseFDSelect(e,r){const n=this.bytes,i=n[e++],a=[];let s;switch(i){case 0:for(s=0;s<r;++s){const l=n[e++];a.push(l)}break;case 3:const o=n[e++]<<8|n[e++];for(s=0;s<o;++s){let l=n[e++]<<8|n[e++];s===0&&l!==0&&(ee("parseFDSelect: The first range must have a first GID of 0 -- trying to recover."),l=0);const c=n[e++],u=n[e]<<8|n[e+1];for(let h=l;h<u;++h)a.push(c)}e+=2;break;default:throw new fe(`parseFDSelect: Unknown format "${i}".`)}if(a.length!==r)throw new fe("parseFDSelect: Invalid font data.");return new mge(i,a)}}class Qq{constructor(){this.header=null,this.names=[],this.topDict=null,this.strings=new VI,this.globalSubrIndex=null,this.encoding=null,this.charset=null,this.charStrings=null,this.fdArray=[],this.fdSelect=null,this.isCIDFont=!1,this.charStringCount=0}duplicateFirstGlyph(){if(this.charStrings.count>=65535){ee("Not enough space in charstrings to duplicate first glyph.");return}const e=this.charStrings.get(0);this.charStrings.add(e),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){return e<0||e>=this.charStrings.count?!1:this.charStrings.get(e).length>0}}class eX{constructor(e,r,n,i){this.major=e,this.minor=r,this.hdrSize=n,this.offSize=i}}class VI{constructor(){this.strings=[]}get(e){return e>=0&&e<=_2-1?w_[e]:e-_2<=this.strings.length?this.strings[e-_2]:w_[0]}getSID(e){let r=w_.indexOf(e);return r!==-1?r:(r=this.strings.indexOf(e),r!==-1?r+_2:-1)}add(e){this.strings.push(e)}get count(){return this.strings.length}}class Mh{constructor(){this.objects=[],this.length=0}add(e){this.length+=e.length,this.objects.push(e)}set(e,r){this.length+=r.length-this.objects[e].length,this.objects[e]=r}get(e){return this.objects[e]}get count(){return this.objects.length}}class tX{constructor(e,r){this.keyToNameMap=e.keyToNameMap,this.nameToKeyMap=e.nameToKeyMap,this.defaults=e.defaults,this.types=e.types,this.opcodes=e.opcodes,this.order=e.order,this.strings=r,this.values=Object.create(null)}setByKey(e,r){if(!(e in this.keyToNameMap))return!1;if(r.length===0)return!0;for(const i of r)if(isNaN(i))return ee(`Invalid CFFDict value: "${r}" for key "${e}".`),!0;const n=this.types[e];return(n==="num"||n==="sid"||n==="offset")&&(r=r[0]),this.values[e]=r,!0}setByName(e,r){if(!(e in this.nameToKeyMap))throw new fe(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=r}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new fe(`Invalid dictionary name ${e}"`);const r=this.nameToKeyMap[e];return r in this.values?this.values[r]:this.defaults[r]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){const r={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const n of e){const i=Array.isArray(n[0])?(n[0][0]<<8)+n[0][1]:n[0];r.keyToNameMap[i]=n[1],r.nameToKeyMap[n[1]]=i,r.types[i]=n[2],r.defaults[i]=n[3],r.opcodes[i]=Array.isArray(n[0])?n[0]:[n[0]],r.order.push(i)}return r}}const dge=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]];class ax extends tX{static get tables(){return Te(this,"tables",this.createTables(dge))}constructor(e){super(ax.tables,e),this.privateDict=null}}const pge=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]];class sx extends tX{static get tables(){return Te(this,"tables",this.createTables(pge))}constructor(e){super(sx.tables,e),this.subrsIndex=null}}const p8={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class Uv{constructor(e,r,n,i){this.predefined=e,this.format=r,this.charset=n,this.raw=i}}class gge{constructor(e,r,n,i){this.predefined=e,this.format=r,this.encoding=n,this.raw=i}}class mge{constructor(e,r){this.format=e,this.fdSelect=r}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}}class $N{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,r){if(e in this.offsets)throw new fe(`Already tracking location of ${e}`);this.offsets[e]=r}offset(e){for(const r in this.offsets)this.offsets[r]+=e}setEntryLocation(e,r,n){if(!(e in this.offsets))throw new fe(`Not tracking location of ${e}`);const i=n.data,a=this.offsets[e],s=5;for(let o=0,l=r.length;o<l;++o){const c=o*s+a,u=c+1,h=c+2,f=c+3,d=c+4;if(i[c]!==29||i[u]!==0||i[h]!==0||i[f]!==0||i[d]!==0)throw new fe("writing to an offset that is not empty");const p=r[o];i[c]=29,i[u]=p>>24&255,i[h]=p>>16&255,i[f]=p>>8&255,i[d]=p&255}}}class gb{constructor(e){this.cff=e}compile(){const e=this.cff,r={data:[],length:0,add(f){try{this.data.push(...f)}catch{this.data=this.data.concat(f)}this.length=this.data.length}},n=this.compileHeader(e.header);r.add(n);const i=this.compileNameIndex(e.names);if(r.add(i),e.isCIDFont&&e.topDict.hasName("FontMatrix")){const f=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(const d of e.fdArray){let p=f.slice(0);d.hasName("FontMatrix")&&(p=mr.transform(p,d.getByName("FontMatrix"))),d.setByName("FontMatrix",p)}}e.topDict.getByName("XUID")?.length>16&&e.topDict.removeByName("XUID"),e.topDict.setByName("charset",0);let s=this.compileTopDicts([e.topDict],r.length,e.isCIDFont);r.add(s.output);const o=s.trackers[0],l=this.compileStringIndex(e.strings.strings);r.add(l);const c=this.compileIndex(e.globalSubrIndex);if(r.add(c),e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)o.setEntryLocation("Encoding",[e.encoding.format],r);else{const f=this.compileEncoding(e.encoding);o.setEntryLocation("Encoding",[r.length],r),r.add(f)}const u=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);o.setEntryLocation("charset",[r.length],r),r.add(u);const h=this.compileCharStrings(e.charStrings);if(o.setEntryLocation("CharStrings",[r.length],r),r.add(h),e.isCIDFont){o.setEntryLocation("FDSelect",[r.length],r);const f=this.compileFDSelect(e.fdSelect);r.add(f),s=this.compileTopDicts(e.fdArray,r.length,!0),o.setEntryLocation("FDArray",[r.length],r),r.add(s.output);const d=s.trackers;this.compilePrivateDicts(e.fdArray,d,r)}return this.compilePrivateDicts([e.topDict],[o],r),r.add([0]),r.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return Te(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(e){let r=e.toString();const n=gb.EncodeFloatRegExp.exec(r);if(n){const l=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));r=(Math.round(e*l)/l).toString()}let i="",a,s;for(a=0,s=r.length;a<s;++a){const l=r[a];l==="e"?i+=r[++a]==="-"?"c":"b":l==="."?i+="a":l==="-"?i+="e":i+=l}i+=i.length&1?"f":"ff";const o=[30];for(a=0,s=i.length;a<s;a+=2)o.push(parseInt(i.substring(a,a+2),16));return o}encodeInteger(e){let r;return e>=-107&&e<=107?r=[e+139]:e>=108&&e<=1131?(e-=108,r=[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,r=[(e>>8)+251,e&255]):e>=-32768&&e<=32767?r=[28,e>>8&255,e&255]:r=[29,e>>24&255,e>>16&255,e>>8&255,e&255],r}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){const r=new Mh;for(const n of e){const i=Math.min(n.length,127);let a=new Array(i);for(let s=0;s<i;s++){let o=n[s];(o<"!"||o>"~"||o==="["||o==="]"||o==="("||o===")"||o==="{"||o==="}"||o==="<"||o===">"||o==="/"||o==="%")&&(o="_"),a[s]=o}a=a.join(""),a===""&&(a="Bad_Font_Name"),r.add(na(a))}return this.compileIndex(r)}compileTopDicts(e,r,n){const i=[];let a=new Mh;for(const s of e){n&&(s.removeByName("CIDFontVersion"),s.removeByName("CIDFontRevision"),s.removeByName("CIDFontType"),s.removeByName("CIDCount"),s.removeByName("UIDBase"));const o=new $N,l=this.compileDict(s,o);i.push(o),a.add(l),o.offset(r)}return a=this.compileIndex(a,i),{trackers:i,output:a}}compilePrivateDicts(e,r,n){for(let i=0,a=e.length;i<a;++i){const s=e[i],o=s.privateDict;if(!o||!s.hasName("Private"))throw new fe("There must be a private dictionary.");const l=new $N,c=this.compileDict(o,l);let u=n.length;if(l.offset(u),c.length||(u=0),r[i].setEntryLocation("Private",[c.length,u],n),n.add(c),o.subrsIndex&&o.hasName("Subrs")){const h=this.compileIndex(o.subrsIndex);l.setEntryLocation("Subrs",[c.length],n),n.add(h)}}}compileDict(e,r){const n=[];for(const i of e.order){if(!(i in e.values))continue;let a=e.values[i],s=e.types[i];if(Array.isArray(s)||(s=[s]),Array.isArray(a)||(a=[a]),a.length!==0){for(let o=0,l=s.length;o<l;++o){const c=s[o],u=a[o];switch(c){case"num":case"sid":n.push(...this.encodeNumber(u));break;case"offset":const h=e.keyToNameMap[i];r.isTracking(h)||r.track(h,n.length),n.push(29,0,0,0,0);break;case"array":case"delta":n.push(...this.encodeNumber(u));for(let f=1,d=a.length;f<d;++f)n.push(...this.encodeNumber(a[f]));break;default:throw new fe(`Unknown data type of ${c}`)}}n.push(...e.opcodes[i])}}return n}compileStringIndex(e){const r=new Mh;for(const n of e)r.add(na(n));return this.compileIndex(r)}compileCharStrings(e){const r=new Mh;for(let n=0;n<e.count;n++){const i=e.get(n);if(i.length===0){r.add(new Uint8Array([139,14]));continue}r.add(i)}return this.compileIndex(r)}compileCharset(e,r,n,i){let a;const s=r-1;if(i){const o=s-1;a=new Uint8Array([2,0,1,o>>8&255,o&255])}else{const o=1+s*2;a=new Uint8Array(o),a[0]=0;let l=0;const c=e.charset.length;let u=!1;for(let h=1;h<a.length;h+=2){let f=0;if(l<c){const d=e.charset[l++];f=n.getSID(d),f===-1&&(f=0,u||(u=!0,ee(`Couldn't find ${d} in CFF strings`)))}a[h]=f>>8&255,a[h+1]=f&255}}return this.compileTypedArray(a)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){const r=e.format;let n,i;switch(r){case 0:for(n=new Uint8Array(1+e.fdSelect.length),n[0]=r,i=0;i<e.fdSelect.length;i++)n[i+1]=e.fdSelect[i];break;case 3:const a=0;let s=e.fdSelect[0];const o=[r,0,0,a>>8&255,a&255,s];for(i=1;i<e.fdSelect.length;i++){const c=e.fdSelect[i];c!==s&&(o.push(i>>8&255,i&255,c),s=c)}const l=(o.length-3)/3;o[1]=l>>8&255,o[2]=l&255,o.push(i>>8&255,i&255),n=new Uint8Array(o);break}return this.compileTypedArray(n)}compileTypedArray(e){return Array.from(e)}compileIndex(e,r=[]){const n=e.objects,i=n.length;if(i===0)return[0,0];const a=[i>>8&255,i&255];let s=1,o;for(o=0;o<i;++o)s+=n[o].length;let l;s<256?l=1:s<65536?l=2:s<16777216?l=3:l=4,a.push(l);let c=1;for(o=0;o<i+1;o++)l===1?a.push(c&255):l===2?a.push(c>>8&255,c&255):l===3?a.push(c>>16&255,c>>8&255,c&255):a.push(c>>>24&255,c>>16&255,c>>8&255,c&255),n[o]&&(c+=n[o].length);for(o=0;o<i;o++)r[o]&&r[o].offset(a.length),a.push(...n[o]);return a}}const ox=un(function(t){t["Times-Roman"]="Times-Roman",t.Helvetica="Helvetica",t.Courier="Courier",t.Symbol="Symbol",t["Times-Bold"]="Times-Bold",t["Helvetica-Bold"]="Helvetica-Bold",t["Courier-Bold"]="Courier-Bold",t.ZapfDingbats="ZapfDingbats",t["Times-Italic"]="Times-Italic",t["Helvetica-Oblique"]="Helvetica-Oblique",t["Courier-Oblique"]="Courier-Oblique",t["Times-BoldItalic"]="Times-BoldItalic",t["Helvetica-BoldOblique"]="Helvetica-BoldOblique",t["Courier-BoldOblique"]="Courier-BoldOblique",t.ArialNarrow="Helvetica",t["ArialNarrow-Bold"]="Helvetica-Bold",t["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique",t["ArialNarrow-Italic"]="Helvetica-Oblique",t.ArialBlack="Helvetica",t["ArialBlack-Bold"]="Helvetica-Bold",t["ArialBlack-BoldItalic"]="Helvetica-BoldOblique",t["ArialBlack-Italic"]="Helvetica-Oblique",t["Arial-Black"]="Helvetica",t["Arial-Black-Bold"]="Helvetica-Bold",t["Arial-Black-BoldItalic"]="Helvetica-BoldOblique",t["Arial-Black-Italic"]="Helvetica-Oblique",t.Arial="Helvetica",t["Arial-Bold"]="Helvetica-Bold",t["Arial-BoldItalic"]="Helvetica-BoldOblique",t["Arial-Italic"]="Helvetica-Oblique",t.ArialMT="Helvetica",t["Arial-BoldItalicMT"]="Helvetica-BoldOblique",t["Arial-BoldMT"]="Helvetica-Bold",t["Arial-ItalicMT"]="Helvetica-Oblique",t["Arial-BoldItalicMT-BoldItalic"]="Helvetica-BoldOblique",t["Arial-BoldMT-Bold"]="Helvetica-Bold",t["Arial-ItalicMT-Italic"]="Helvetica-Oblique",t.ArialUnicodeMS="Helvetica",t["ArialUnicodeMS-Bold"]="Helvetica-Bold",t["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique",t["ArialUnicodeMS-Italic"]="Helvetica-Oblique",t["Courier-BoldItalic"]="Courier-BoldOblique",t["Courier-Italic"]="Courier-Oblique",t.CourierNew="Courier",t["CourierNew-Bold"]="Courier-Bold",t["CourierNew-BoldItalic"]="Courier-BoldOblique",t["CourierNew-Italic"]="Courier-Oblique",t["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique",t["CourierNewPS-BoldMT"]="Courier-Bold",t["CourierNewPS-ItalicMT"]="Courier-Oblique",t.CourierNewPSMT="Courier",t["Helvetica-BoldItalic"]="Helvetica-BoldOblique",t["Helvetica-Italic"]="Helvetica-Oblique",t["HelveticaLTStd-Bold"]="Helvetica-Bold",t["Symbol-Bold"]="Symbol",t["Symbol-BoldItalic"]="Symbol",t["Symbol-Italic"]="Symbol",t.TimesNewRoman="Times-Roman",t["TimesNewRoman-Bold"]="Times-Bold",t["TimesNewRoman-BoldItalic"]="Times-BoldItalic",t["TimesNewRoman-Italic"]="Times-Italic",t.TimesNewRomanPS="Times-Roman",t["TimesNewRomanPS-Bold"]="Times-Bold",t["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic",t["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic",t["TimesNewRomanPS-BoldMT"]="Times-Bold",t["TimesNewRomanPS-Italic"]="Times-Italic",t["TimesNewRomanPS-ItalicMT"]="Times-Italic",t.TimesNewRomanPSMT="Times-Roman",t["TimesNewRomanPSMT-Bold"]="Times-Bold",t["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic",t["TimesNewRomanPSMT-Italic"]="Times-Italic"}),vge=un(function(t){t.Courier="FoxitFixed.pfb",t["Courier-Bold"]="FoxitFixedBold.pfb",t["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb",t["Courier-Oblique"]="FoxitFixedItalic.pfb",t.Helvetica="LiberationSans-Regular.ttf",t["Helvetica-Bold"]="LiberationSans-Bold.ttf",t["Helvetica-BoldOblique"]="LiberationSans-BoldItalic.ttf",t["Helvetica-Oblique"]="LiberationSans-Italic.ttf",t["Times-Roman"]="FoxitSerif.pfb",t["Times-Bold"]="FoxitSerifBold.pfb",t["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb",t["Times-Italic"]="FoxitSerifItalic.pfb",t.Symbol="FoxitSymbol.pfb",t.ZapfDingbats="FoxitDingbats.pfb",t["LiberationSans-Regular"]="LiberationSans-Regular.ttf",t["LiberationSans-Bold"]="LiberationSans-Bold.ttf",t["LiberationSans-Italic"]="LiberationSans-Italic.ttf",t["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}),bT=un(function(t){t.Calibri="Helvetica",t["Calibri-Bold"]="Helvetica-Bold",t["Calibri-BoldItalic"]="Helvetica-BoldOblique",t["Calibri-Italic"]="Helvetica-Oblique",t.CenturyGothic="Helvetica",t["CenturyGothic-Bold"]="Helvetica-Bold",t["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique",t["CenturyGothic-Italic"]="Helvetica-Oblique",t.ComicSansMS="Comic Sans MS",t["ComicSansMS-Bold"]="Comic Sans MS-Bold",t["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic",t["ComicSansMS-Italic"]="Comic Sans MS-Italic",t.GillSansMT="Helvetica",t["GillSansMT-Bold"]="Helvetica-Bold",t["GillSansMT-BoldItalic"]="Helvetica-BoldOblique",t["GillSansMT-Italic"]="Helvetica-Oblique",t.Impact="Helvetica",t["ItcSymbol-Bold"]="Helvetica-Bold",t["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique",t["ItcSymbol-Book"]="Helvetica",t["ItcSymbol-BookItalic"]="Helvetica-Oblique",t["ItcSymbol-Medium"]="Helvetica",t["ItcSymbol-MediumItalic"]="Helvetica-Oblique",t.LucidaConsole="Courier",t["LucidaConsole-Bold"]="Courier-Bold",t["LucidaConsole-BoldItalic"]="Courier-BoldOblique",t["LucidaConsole-Italic"]="Courier-Oblique",t["LucidaSans-Demi"]="Helvetica-Bold",t["MS-Gothic"]="MS Gothic",t["MS-Gothic-Bold"]="MS Gothic-Bold",t["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic",t["MS-Gothic-Italic"]="MS Gothic-Italic",t["MS-Mincho"]="MS Mincho",t["MS-Mincho-Bold"]="MS Mincho-Bold",t["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic",t["MS-Mincho-Italic"]="MS Mincho-Italic",t["MS-PGothic"]="MS PGothic",t["MS-PGothic-Bold"]="MS PGothic-Bold",t["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic",t["MS-PGothic-Italic"]="MS PGothic-Italic",t["MS-PMincho"]="MS PMincho",t["MS-PMincho-Bold"]="MS PMincho-Bold",t["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic",t["MS-PMincho-Italic"]="MS PMincho-Italic",t.NuptialScript="Times-Italic",t.SegoeUISymbol="Helvetica"}),UI=un(function(t){t["Adobe Jenson"]=!0,t["Adobe Text"]=!0,t.Albertus=!0,t.Aldus=!0,t.Alexandria=!0,t.Algerian=!0,t["American Typewriter"]=!0,t.Antiqua=!0,t.Apex=!0,t.Arno=!0,t.Aster=!0,t.Aurora=!0,t.Baskerville=!0,t.Bell=!0,t.Bembo=!0,t["Bembo Schoolbook"]=!0,t.Benguiat=!0,t["Berkeley Old Style"]=!0,t["Bernhard Modern"]=!0,t["Berthold City"]=!0,t.Bodoni=!0,t["Bauer Bodoni"]=!0,t["Book Antiqua"]=!0,t.Bookman=!0,t["Bordeaux Roman"]=!0,t["Californian FB"]=!0,t.Calisto=!0,t.Calvert=!0,t.Capitals=!0,t.Cambria=!0,t.Cartier=!0,t.Caslon=!0,t.Catull=!0,t.Centaur=!0,t["Century Old Style"]=!0,t["Century Schoolbook"]=!0,t.Chaparral=!0,t["Charis SIL"]=!0,t.Cheltenham=!0,t["Cholla Slab"]=!0,t.Clarendon=!0,t.Clearface=!0,t.Cochin=!0,t.Colonna=!0,t["Computer Modern"]=!0,t["Concrete Roman"]=!0,t.Constantia=!0,t["Cooper Black"]=!0,t.Corona=!0,t.Ecotype=!0,t.Egyptienne=!0,t.Elephant=!0,t.Excelsior=!0,t.Fairfield=!0,t["FF Scala"]=!0,t.Folkard=!0,t.Footlight=!0,t.FreeSerif=!0,t["Friz Quadrata"]=!0,t.Garamond=!0,t.Gentium=!0,t.Georgia=!0,t.Gloucester=!0,t["Goudy Old Style"]=!0,t["Goudy Schoolbook"]=!0,t["Goudy Pro Font"]=!0,t.Granjon=!0,t["Guardian Egyptian"]=!0,t.Heather=!0,t.Hercules=!0,t["High Tower Text"]=!0,t.Hiroshige=!0,t["Hoefler Text"]=!0,t["Humana Serif"]=!0,t.Imprint=!0,t["Ionic No. 5"]=!0,t.Janson=!0,t.Joanna=!0,t.Korinna=!0,t.Lexicon=!0,t.LiberationSerif=!0,t["Liberation Serif"]=!0,t["Linux Libertine"]=!0,t.Literaturnaya=!0,t.Lucida=!0,t["Lucida Bright"]=!0,t.Melior=!0,t.Memphis=!0,t.Miller=!0,t.Minion=!0,t.Modern=!0,t["Mona Lisa"]=!0,t["Mrs Eaves"]=!0,t["MS Serif"]=!0,t["Museo Slab"]=!0,t["New York"]=!0,t["Nimbus Roman"]=!0,t["NPS Rawlinson Roadway"]=!0,t.NuptialScript=!0,t.Palatino=!0,t.Perpetua=!0,t.Plantin=!0,t["Plantin Schoolbook"]=!0,t.Playbill=!0,t["Poor Richard"]=!0,t["Rawlinson Roadway"]=!0,t.Renault=!0,t.Requiem=!0,t.Rockwell=!0,t.Roman=!0,t["Rotis Serif"]=!0,t.Sabon=!0,t.Scala=!0,t.Seagull=!0,t.Sistina=!0,t.Souvenir=!0,t.STIX=!0,t["Stone Informal"]=!0,t["Stone Serif"]=!0,t.Sylfaen=!0,t.Times=!0,t.Trajan=!0,t.Trinité=!0,t["Trump Mediaeval"]=!0,t.Utopia=!0,t["Vale Type"]=!0,t["Bitstream Vera"]=!0,t["Vera Serif"]=!0,t.Versailles=!0,t.Wanted=!0,t.Weiss=!0,t["Wide Latin"]=!0,t.Windsor=!0,t.XITS=!0}),wT=un(function(t){t.Dingbats=!0,t.Symbol=!0,t.ZapfDingbats=!0,t.Wingdings=!0,t["Wingdings-Bold"]=!0,t["Wingdings-Regular"]=!0}),zN=un(function(t){t[2]=10,t[3]=32,t[4]=33,t[5]=34,t[6]=35,t[7]=36,t[8]=37,t[9]=38,t[10]=39,t[11]=40,t[12]=41,t[13]=42,t[14]=43,t[15]=44,t[16]=45,t[17]=46,t[18]=47,t[19]=48,t[20]=49,t[21]=50,t[22]=51,t[23]=52,t[24]=53,t[25]=54,t[26]=55,t[27]=56,t[28]=57,t[29]=58,t[30]=894,t[31]=60,t[32]=61,t[33]=62,t[34]=63,t[35]=64,t[36]=65,t[37]=66,t[38]=67,t[39]=68,t[40]=69,t[41]=70,t[42]=71,t[43]=72,t[44]=73,t[45]=74,t[46]=75,t[47]=76,t[48]=77,t[49]=78,t[50]=79,t[51]=80,t[52]=81,t[53]=82,t[54]=83,t[55]=84,t[56]=85,t[57]=86,t[58]=87,t[59]=88,t[60]=89,t[61]=90,t[62]=91,t[63]=92,t[64]=93,t[65]=94,t[66]=95,t[67]=96,t[68]=97,t[69]=98,t[70]=99,t[71]=100,t[72]=101,t[73]=102,t[74]=103,t[75]=104,t[76]=105,t[77]=106,t[78]=107,t[79]=108,t[80]=109,t[81]=110,t[82]=111,t[83]=112,t[84]=113,t[85]=114,t[86]=115,t[87]=116,t[88]=117,t[89]=118,t[90]=119,t[91]=120,t[92]=121,t[93]=122,t[94]=123,t[95]=124,t[96]=125,t[97]=126,t[98]=196,t[99]=197,t[100]=199,t[101]=201,t[102]=209,t[103]=214,t[104]=220,t[105]=225,t[106]=224,t[107]=226,t[108]=228,t[109]=227,t[110]=229,t[111]=231,t[112]=233,t[113]=232,t[114]=234,t[115]=235,t[116]=237,t[117]=236,t[118]=238,t[119]=239,t[120]=241,t[121]=243,t[122]=242,t[123]=244,t[124]=246,t[125]=245,t[126]=250,t[127]=249,t[128]=251,t[129]=252,t[130]=8224,t[131]=176,t[132]=162,t[133]=163,t[134]=167,t[135]=8226,t[136]=182,t[137]=223,t[138]=174,t[139]=169,t[140]=8482,t[141]=180,t[142]=168,t[143]=8800,t[144]=198,t[145]=216,t[146]=8734,t[147]=177,t[148]=8804,t[149]=8805,t[150]=165,t[151]=181,t[152]=8706,t[153]=8721,t[154]=8719,t[156]=8747,t[157]=170,t[158]=186,t[159]=8486,t[160]=230,t[161]=248,t[162]=191,t[163]=161,t[164]=172,t[165]=8730,t[166]=402,t[167]=8776,t[168]=8710,t[169]=171,t[170]=187,t[171]=8230,t[179]=8220,t[180]=8221,t[181]=8216,t[182]=8217,t[200]=193,t[203]=205,t[207]=211,t[210]=218,t[223]=711,t[224]=321,t[225]=322,t[226]=352,t[227]=353,t[228]=381,t[229]=382,t[233]=221,t[234]=253,t[252]=263,t[253]=268,t[254]=269,t[258]=258,t[260]=260,t[261]=261,t[265]=280,t[266]=281,t[267]=282,t[268]=283,t[269]=313,t[275]=323,t[276]=324,t[278]=328,t[283]=344,t[284]=345,t[285]=346,t[286]=347,t[292]=367,t[295]=377,t[296]=378,t[298]=380,t[305]=963,t[306]=964,t[307]=966,t[308]=8215,t[309]=8252,t[310]=8319,t[311]=8359,t[312]=8592,t[313]=8593,t[337]=9552,t[493]=1039,t[494]=1040,t[570]=1040,t[571]=1041,t[572]=1042,t[573]=1043,t[574]=1044,t[575]=1045,t[576]=1046,t[577]=1047,t[578]=1048,t[579]=1049,t[580]=1050,t[581]=1051,t[582]=1052,t[583]=1053,t[584]=1054,t[585]=1055,t[586]=1056,t[587]=1057,t[588]=1058,t[589]=1059,t[590]=1060,t[591]=1061,t[592]=1062,t[593]=1063,t[594]=1064,t[595]=1065,t[596]=1066,t[597]=1067,t[598]=1068,t[599]=1069,t[600]=1070,t[601]=1071,t[602]=1072,t[603]=1073,t[604]=1074,t[605]=1075,t[606]=1076,t[607]=1077,t[608]=1078,t[609]=1079,t[610]=1080,t[611]=1081,t[612]=1082,t[613]=1083,t[614]=1084,t[615]=1085,t[616]=1086,t[617]=1087,t[618]=1088,t[619]=1089,t[620]=1090,t[621]=1091,t[622]=1092,t[623]=1093,t[624]=1094,t[625]=1095,t[626]=1096,t[627]=1097,t[628]=1098,t[629]=1099,t[630]=1100,t[631]=1101,t[632]=1102,t[633]=1103,t[672]=1488,t[673]=1489,t[674]=1490,t[675]=1491,t[676]=1492,t[677]=1493,t[678]=1494,t[679]=1495,t[680]=1496,t[681]=1497,t[682]=1498,t[683]=1499,t[684]=1500,t[685]=1501,t[686]=1502,t[687]=1503,t[688]=1504,t[689]=1505,t[690]=1506,t[691]=1507,t[692]=1508,t[693]=1509,t[694]=1510,t[695]=1511,t[696]=1512,t[697]=1513,t[698]=1514,t[705]=1524,t[706]=8362,t[710]=64288,t[711]=64298,t[759]=1617,t[761]=1776,t[763]=1778,t[775]=1652,t[777]=1764,t[778]=1780,t[779]=1781,t[780]=1782,t[782]=771,t[783]=64726,t[786]=8363,t[788]=8532,t[790]=768,t[791]=769,t[792]=768,t[795]=803,t[797]=64336,t[798]=64337,t[799]=64342,t[800]=64343,t[801]=64344,t[802]=64345,t[803]=64362,t[804]=64363,t[805]=64364,t[2424]=7821,t[2425]=7822,t[2426]=7823,t[2427]=7824,t[2428]=7825,t[2429]=7826,t[2430]=7827,t[2433]=7682,t[2678]=8045,t[2679]=8046,t[2830]=1552,t[2838]=686,t[2840]=751,t[2842]=753,t[2843]=754,t[2844]=755,t[2846]=757,t[2856]=767,t[2857]=848,t[2858]=849,t[2862]=853,t[2863]=854,t[2864]=855,t[2865]=861,t[2866]=862,t[2906]=7460,t[2908]=7462,t[2909]=7463,t[2910]=7464,t[2912]=7466,t[2913]=7467,t[2914]=7468,t[2916]=7470,t[2917]=7471,t[2918]=7472,t[2920]=7474,t[2921]=7475,t[2922]=7476,t[2924]=7478,t[2925]=7479,t[2926]=7480,t[2928]=7482,t[2929]=7483,t[2930]=7484,t[2932]=7486,t[2933]=7487,t[2934]=7488,t[2936]=7490,t[2937]=7491,t[2938]=7492,t[2940]=7494,t[2941]=7495,t[2942]=7496,t[2944]=7498,t[2946]=7500,t[2948]=7502,t[2950]=7504,t[2951]=7505,t[2952]=7506,t[2954]=7508,t[2955]=7509,t[2956]=7510,t[2958]=7512,t[2959]=7513,t[2960]=7514,t[2962]=7516,t[2963]=7517,t[2964]=7518,t[2966]=7520,t[2967]=7521,t[2968]=7522,t[2970]=7524,t[2971]=7525,t[2972]=7526,t[2974]=7528,t[2975]=7529,t[2976]=7530,t[2978]=1537,t[2979]=1538,t[2980]=1539,t[2982]=1549,t[2983]=1551,t[2984]=1552,t[2986]=1554,t[2987]=1555,t[2988]=1556,t[2990]=1623,t[2991]=1624,t[2995]=1775,t[2999]=1791,t[3002]=64290,t[3003]=64291,t[3004]=64292,t[3006]=64294,t[3007]=64295,t[3008]=64296,t[3011]=1900,t[3014]=8223,t[3015]=8244,t[3017]=7532,t[3018]=7533,t[3019]=7534,t[3075]=7590,t[3076]=7591,t[3079]=7594,t[3080]=7595,t[3083]=7598,t[3084]=7599,t[3087]=7602,t[3088]=7603,t[3091]=7606,t[3092]=7607,t[3095]=7610,t[3096]=7611,t[3099]=7614,t[3100]=7615,t[3103]=7618,t[3104]=7619,t[3107]=8337,t[3108]=8338,t[3116]=1884,t[3119]=1885,t[3120]=1885,t[3123]=1886,t[3124]=1886,t[3127]=1887,t[3128]=1887,t[3131]=1888,t[3132]=1888,t[3135]=1889,t[3136]=1889,t[3139]=1890,t[3140]=1890,t[3143]=1891,t[3144]=1891,t[3147]=1892,t[3148]=1892,t[3153]=580,t[3154]=581,t[3157]=584,t[3158]=585,t[3161]=588,t[3162]=589,t[3165]=891,t[3166]=892,t[3169]=1274,t[3170]=1275,t[3173]=1278,t[3174]=1279,t[3181]=7622,t[3182]=7623,t[3282]=11799,t[3316]=578,t[3379]=42785,t[3393]=1159,t[3416]=8377}),yge=un(function(t){t[227]=322,t[264]=261,t[291]=346}),xge=un(function(t){t[1]=32,t[4]=65,t[5]=192,t[6]=193,t[9]=196,t[17]=66,t[18]=67,t[21]=268,t[24]=68,t[28]=69,t[29]=200,t[30]=201,t[32]=282,t[38]=70,t[39]=71,t[44]=72,t[47]=73,t[48]=204,t[49]=205,t[58]=74,t[60]=75,t[62]=76,t[68]=77,t[69]=78,t[75]=79,t[76]=210,t[80]=214,t[87]=80,t[89]=81,t[90]=82,t[92]=344,t[94]=83,t[97]=352,t[100]=84,t[104]=85,t[109]=220,t[115]=86,t[116]=87,t[121]=88,t[122]=89,t[124]=221,t[127]=90,t[129]=381,t[258]=97,t[259]=224,t[260]=225,t[263]=228,t[268]=261,t[271]=98,t[272]=99,t[273]=263,t[275]=269,t[282]=100,t[286]=101,t[287]=232,t[288]=233,t[290]=283,t[295]=281,t[296]=102,t[336]=103,t[346]=104,t[349]=105,t[350]=236,t[351]=237,t[361]=106,t[364]=107,t[367]=108,t[371]=322,t[373]=109,t[374]=110,t[381]=111,t[382]=242,t[383]=243,t[386]=246,t[393]=112,t[395]=113,t[396]=114,t[398]=345,t[400]=115,t[401]=347,t[403]=353,t[410]=116,t[437]=117,t[442]=252,t[448]=118,t[449]=119,t[454]=120,t[455]=121,t[457]=253,t[460]=122,t[462]=382,t[463]=380,t[853]=44,t[855]=58,t[856]=46,t[876]=47,t[878]=45,t[882]=45,t[894]=40,t[895]=41,t[896]=91,t[897]=93,t[923]=64,t[940]=163,t[1004]=48,t[1005]=49,t[1006]=50,t[1007]=51,t[1008]=52,t[1009]=53,t[1010]=54,t[1011]=55,t[1012]=56,t[1013]=57,t[1081]=37,t[1085]=43,t[1086]=45});function VN(t){const e=pb(t);return ox()[e]}function UN(t){const e=pb(t);return!!(ox()[e]||bT()[e]||UI()[e]||wT()[e])}class jv{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(const r in this._map)e(r,this._map[r].codePointAt(0))}has(e){return this._map[e]!==void 0}get(e){return this._map[e]}charCodeOf(e){const r=this._map;if(r.length<=65536)return r.indexOf(e);for(const n in r)if(r[n]===e)return n|0;return-1}amend(e){for(const r in e)this._map[r]=e[r]}}class wo{constructor(e,r){this.firstChar=e,this.lastChar=r}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let r=this.firstChar,n=this.lastChar;r<=n;r++)e(r,r)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){tr("Should not call amend()")}}class g8{constructor(e,r){this.properties=r;const n=new zI(e,r,Rg);this.cff=n.parse(),this.cff.duplicateFirstGlyph();const i=new gb(this.cff);this.seacs=this.cff.seacs;try{this.data=i.compile()}catch{ee("Failed to compile font "+r.loadedName),this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const e=this.cff,r=this.properties,{cidToGidMap:n,cMap:i}=r,a=e.charset.charset;let s,o;if(r.composite){let c;if(n?.length>0){c=Object.create(null);for(let h=0,f=n.length;h<f;h++){const d=n[h];d!==void 0&&(c[d]=h)}}s=Object.create(null);let u;if(e.isCIDFont)for(o=0;o<a.length;o++){const h=a[o];u=i.charCodeOf(h),c?.[u]!==void 0&&(u=c[u]),s[u]=o}else for(o=0;o<e.charStrings.count;o++)u=i.charCodeOf(o),s[u]=o;return s}let l=e.encoding?e.encoding.encoding:null;return r.isInternalFont&&(l=r.defaultEncoding),s=Jq(r,l,a),s}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){const{charset:e,encoding:r}=this.cff;if(!e||!r)return;const n=e.charset,i=r.encoding,a=[];for(const s in i){const o=i[s];if(o>=0){const l=n[o];l&&(a[s]=l)}}a.length>0&&(this.properties.builtInEncoding=a)}}function Df(t,e){return pu(t,e)/16384}function _T(t){const e=t.length;let r=32768;return e<1240?r=107:e<33900&&(r=1131),r}function bge(t,e,r){const n=Zt(t,e+2)===1?kr(t,e+8):kr(t,e+16),i=Zt(t,e+n);let a,s,o;if(i===4){Zt(t,e+n+2);const l=Zt(t,e+n+6)>>1;for(s=e+n+14,a=[],o=0;o<l;o++,s+=2)a[o]={end:Zt(t,s)};for(s+=2,o=0;o<l;o++,s+=2)a[o].start=Zt(t,s);for(o=0;o<l;o++,s+=2)a[o].idDelta=Zt(t,s);for(o=0;o<l;o++,s+=2){let c=Zt(t,s);if(c!==0){a[o].ids=[];for(let u=0,h=a[o].end-a[o].start+1;u<h;u++)a[o].ids[u]=Zt(t,s+c),c+=2}}return a}else if(i===12){const l=kr(t,e+n+12);for(s=e+n+16,a=[],o=0;o<l;o++)e=kr(t,s),a.push({start:e,end:kr(t,s+4),idDelta:kr(t,s+8)-e}),s+=12;return a}throw new fe(`unsupported cmap: ${i}`)}function wge(t,e,r,n){const i={},s=new zI(new ln(t,e,r-e),i,n).parse();return{glyphs:s.charStrings.objects,subrs:s.topDict.privateDict?.subrsIndex?.objects,gsubrs:s.globalSubrIndex?.objects,isCFFCIDFont:s.isCIDFont,fdSelect:s.fdSelect,fdArray:s.fdArray}}function _ge(t,e,r){let n,i;r?(n=4,i=kr):(n=2,i=(o,l)=>2*Zt(o,l));const a=[];let s=i(e,0);for(let o=n;o<e.length;o+=n){const l=i(e,o);a.push(t.subarray(s,l)),s=l}return a}function DS(t,e){const r=e.codePointAt(0);let n=0,i=0,a=t.length-1;for(;i<a;){const s=i+a+1>>1;r<t[s].start?a=s-1:i=s}return t[i].start<=r&&r<=t[i].end&&(n=t[i].idDelta+(t[i].ids?t[i].ids[r-t[i].start]:r)&65535),{charCode:r,glyphId:n}}function rX(t,e,r){function n(f,d){c&&e.add(qr.lineTo,c),c=[f,d],e.add(qr.moveTo,[f,d])}function i(f,d){e.add(qr.lineTo,[f,d])}function a(f,d,p,g){e.add(qr.quadraticCurveTo,[f,d,p,g])}let s=0;const o=pu(t,s);let l,c=null,u=0,h=0;if(s+=10,o<0)do{l=Zt(t,s);const f=Zt(t,s+2);s+=4;let d,p;l&1?(l&2?(d=pu(t,s),p=pu(t,s+2)):(d=Zt(t,s),p=Zt(t,s+2)),s+=4):l&2?(d=Yl(t,s++),p=Yl(t,s++)):(d=t[s++],p=t[s++]),l&2?(u=d,h=p):(u=0,h=0);let g=1,m=1,v=0,y=0;l&8?(g=m=Df(t,s),s+=2):l&64?(g=Df(t,s),m=Df(t,s+2),s+=4):l&128&&(g=Df(t,s),v=Df(t,s+2),y=Df(t,s+4),m=Df(t,s+6),s+=8);const x=r.glyphs[f];x&&(e.save(),e.transform([g,v,y,m,u,h]),rX(x,e,r),e.restore())}while(l&32);else{const f=[];let d,p;for(d=0;d<o;d++)f.push(Zt(t,s)),s+=2;const g=Zt(t,s);s+=2+g;const m=f.at(-1)+1,v=[];for(;v.length<m;){l=t[s++];let x=1;for(l&8&&(x+=t[s++]);x-- >0;)v.push({flags:l})}for(d=0;d<m;d++){switch(v[d].flags&18){case 0:u+=pu(t,s),s+=2;break;case 2:u-=t[s++];break;case 18:u+=t[s++];break}v[d].x=u}for(d=0;d<m;d++){switch(v[d].flags&36){case 0:h+=pu(t,s),s+=2;break;case 4:h-=t[s++];break;case 36:h+=t[s++];break}v[d].y=h}let y=0;for(s=0;s<o;s++){const x=f[s],b=v.slice(y,x+1);if(b[0].flags&1)b.push(b[0]);else if(b.at(-1).flags&1)b.unshift(b.at(-1));else{const w={flags:1,x:(b[0].x+b.at(-1).x)/2,y:(b[0].y+b.at(-1).y)/2};b.unshift(w),b.push(w)}for(n(b[0].x,b[0].y),d=1,p=b.length;d<p;d++)b[d].flags&1?i(b[d].x,b[d].y):b[d+1].flags&1?(a(b[d].x,b[d].y,b[d+1].x,b[d+1].y),d++):a(b[d].x,b[d].y,(b[d].x+b[d+1].x)/2,(b[d].y+b[d+1].y)/2);y=x+1}}}function ST(t,e,r,n){function i(d,p){h&&e.add(qr.lineTo,h),h=[d,p],e.add(qr.moveTo,[d,p])}function a(d,p){e.add(qr.lineTo,[d,p])}function s(d,p,g,m,v,y){e.add(qr.curveTo,[d,p,g,m,v,y])}const o=[];let l=0,c=0,u=0,h=null;function f(d){let p=0;for(;p<d.length;){let g=!1,m=d[p++],v,y,x,b,w,_,S,C,T;switch(m){case 1:u+=o.length>>1,g=!0;break;case 3:u+=o.length>>1,g=!0;break;case 4:c+=o.pop(),i(l,c),g=!0;break;case 5:for(;o.length>0;)l+=o.shift(),c+=o.shift(),a(l,c);break;case 6:for(;o.length>0&&(l+=o.shift(),a(l,c),o.length!==0);)c+=o.shift(),a(l,c);break;case 7:for(;o.length>0&&(c+=o.shift(),a(l,c),o.length!==0);)l+=o.shift(),a(l,c);break;case 8:for(;o.length>0;)v=l+o.shift(),x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+o.shift(),s(v,x,y,b,l,c);break;case 10:if(C=o.pop(),T=null,r.isCFFCIDFont){const A=r.fdSelect.getFDIndex(n);if(A>=0&&A<r.fdArray.length){const k=r.fdArray[A];let I;k.privateDict?.subrsIndex&&(I=k.privateDict.subrsIndex.objects),I&&(C+=_T(I),T=I[C])}else ee("Invalid fd index for glyph index.")}else T=r.subrs[C+r.subrsBias];T&&f(T);break;case 11:return;case 12:switch(m=d[p++],m){case 34:v=l+o.shift(),y=v+o.shift(),w=c+o.shift(),l=y+o.shift(),s(v,c,y,w,l,w),v=l+o.shift(),y=v+o.shift(),l=y+o.shift(),s(v,w,y,c,l,c);break;case 35:v=l+o.shift(),x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+o.shift(),s(v,x,y,b,l,c),v=l+o.shift(),x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+o.shift(),s(v,x,y,b,l,c),o.pop();break;case 36:v=l+o.shift(),w=c+o.shift(),y=v+o.shift(),_=w+o.shift(),l=y+o.shift(),s(v,w,y,_,l,_),v=l+o.shift(),y=v+o.shift(),S=_+o.shift(),l=y+o.shift(),s(v,_,y,S,l,c);break;case 37:const A=l,k=c;v=l+o.shift(),x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+o.shift(),s(v,x,y,b,l,c),v=l+o.shift(),x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y,c=b,Math.abs(l-A)>Math.abs(c-k)?l+=o.shift():c+=o.shift(),s(v,x,y,b,l,c);break;default:throw new fe(`unknown operator: 12 ${m}`)}break;case 14:if(o.length>=4){const A=o.pop(),k=o.pop();c=o.pop(),l=o.pop(),e.save(),e.translate(l,c);let I=DS(r.cmap,String.fromCharCode(r.glyphNameMap[Cu[A]]));ST(r.glyphs[I.glyphId],e,r,I.glyphId),e.restore(),I=DS(r.cmap,String.fromCharCode(r.glyphNameMap[Cu[k]])),ST(r.glyphs[I.glyphId],e,r,I.glyphId)}return;case 18:u+=o.length>>1,g=!0;break;case 19:u+=o.length>>1,p+=u+7>>3,g=!0;break;case 20:u+=o.length>>1,p+=u+7>>3,g=!0;break;case 21:c+=o.pop(),l+=o.pop(),i(l,c),g=!0;break;case 22:l+=o.pop(),i(l,c),g=!0;break;case 23:u+=o.length>>1,g=!0;break;case 24:for(;o.length>2;)v=l+o.shift(),x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+o.shift(),s(v,x,y,b,l,c);l+=o.shift(),c+=o.shift(),a(l,c);break;case 25:for(;o.length>6;)l+=o.shift(),c+=o.shift(),a(l,c);v=l+o.shift(),x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+o.shift(),s(v,x,y,b,l,c);break;case 26:for(o.length%2&&(l+=o.shift());o.length>0;)v=l,x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y,c=b+o.shift(),s(v,x,y,b,l,c);break;case 27:for(o.length%2&&(c+=o.shift());o.length>0;)v=l+o.shift(),x=c,y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b,s(v,x,y,b,l,c);break;case 28:o.push(pu(d,p)),p+=2;break;case 29:C=o.pop()+r.gsubrsBias,T=r.gsubrs[C],T&&f(T);break;case 30:for(;o.length>0&&(v=l,x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+(o.length===1?o.shift():0),s(v,x,y,b,l,c),o.length!==0);)v=l+o.shift(),x=c,y=v+o.shift(),b=x+o.shift(),c=b+o.shift(),l=y+(o.length===1?o.shift():0),s(v,x,y,b,l,c);break;case 31:for(;o.length>0&&(v=l+o.shift(),x=c,y=v+o.shift(),b=x+o.shift(),c=b+o.shift(),l=y+(o.length===1?o.shift():0),s(v,x,y,b,l,c),o.length!==0);)v=l,x=c+o.shift(),y=v+o.shift(),b=x+o.shift(),l=y+o.shift(),c=b+(o.length===1?o.shift():0),s(v,x,y,b,l,c);break;default:if(m<32)throw new fe(`unknown operator: ${m}`);m<247?o.push(m-139):m<251?o.push((m-247)*256+d[p++]+108):m<255?o.push(-(m-251)*256-d[p++]-108):(o.push((d[p]<<24|d[p+1]<<16|d[p+2]<<8|d[p+3])/65536),p+=4);break}g&&(o.length=0)}}f(t)}const jN="";class Sge{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(e,r){if(r){const{currentTransform:n}=this;for(let i=0,a=r.length;i<a;i+=2)mr.applyTransform(r,n,i);this.cmds.push(e,...r)}else this.cmds.push(e)}transform(e){this.currentTransform=mr.transform(this.currentTransform,e)}translate(e,r){this.transform([1,0,0,1,e,r])}save(){this.transformStack.push(this.currentTransform.slice())}restore(){this.currentTransform=this.transformStack.pop()||[1,0,0,1,0,0]}getPath(){return new(oa.isFloat16ArraySupported?Float16Array:Float32Array)(this.cmds)}}class nX{constructor(e){this.fontMatrix=e,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const{charCode:r,glyphId:n}=DS(this.cmap,e);let i=this.compiledGlyphs[n],a;if(i===void 0){try{i=this.compileGlyph(this.glyphs[n],n)}catch(s){i=jN,a=s}this.compiledGlyphs[n]=i}if(this.compiledCharCodeToGlyphId[r]??=n,a)throw a;return i}compileGlyph(e,r){if(!e?.length||e[0]===14)return jN;let n=this.fontMatrix;if(this.isCFFCIDFont){const a=this.fdSelect.getFDIndex(r);a>=0&&a<this.fdArray.length?n=this.fdArray[a].getByName("FontMatrix")||Wd:ee("Invalid fd index for glyph index.")}Ir(Ua(n,6),"Expected a valid fontMatrix.");const i=new Sge;return i.transform(n.slice()),this.compileGlyphImpl(e,i,r),i.add(qr.closePath),i.getPath()}compileGlyphImpl(){tr("Children classes should implement this.")}hasBuiltPath(e){const{charCode:r,glyphId:n}=DS(this.cmap,e);return this.compiledGlyphs[n]!==void 0&&this.compiledCharCodeToGlyphId[r]!==void 0}}class Cge extends nX{constructor(e,r,n){super(n||[488e-6,0,0,488e-6,0,0]),this.glyphs=e,this.cmap=r}compileGlyphImpl(e,r){rX(e,r,this)}}class Age extends nX{constructor(e,r,n){super(n||[.001,0,0,.001,0,0]),this.glyphs=e.glyphs,this.gsubrs=e.gsubrs||[],this.subrs=e.subrs||[],this.cmap=r,this.glyphNameMap=nc(),this.gsubrsBias=_T(this.gsubrs),this.subrsBias=_T(this.subrs),this.isCFFCIDFont=e.isCFFCIDFont,this.fdSelect=e.fdSelect,this.fdArray=e.fdArray}compileGlyphImpl(e,r,n){ST(e,r,this,n)}}class Tge{static create(e,r){const n=new Uint8Array(e.data);let i,a,s,o,l,c;const u=Zt(n,4);for(let h=0,f=12;h<u;h++,f+=16){const d=As(n.subarray(f,f+4)),p=kr(n,f+8),g=kr(n,f+12);switch(d){case"cmap":i=bge(n,p);break;case"glyf":a=n.subarray(p,p+g);break;case"loca":s=n.subarray(p,p+g);break;case"head":c=Zt(n,p+18),l=Zt(n,p+50);break;case"CFF ":o=wge(n,p,p+g,r);break}}if(a){const h=c?[1/c,0,0,1/c,0,0]:e.fontMatrix;return new Cge(_ge(a,s,l),i,h)}return new Age(o,i,e.fontMatrix)}}const kge=un(function(t){t.Courier=600,t["Courier-Bold"]=600,t["Courier-BoldOblique"]=600,t["Courier-Oblique"]=600,t.Helvetica=un(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),t["Helvetica-Bold"]=un(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),t["Helvetica-BoldOblique"]=un(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),t["Helvetica-Oblique"]=un(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),t.Symbol=un(function(e){e.space=250,e.exclam=333,e.universal=713,e.numbersign=500,e.existential=549,e.percent=833,e.ampersand=778,e.suchthat=439,e.parenleft=333,e.parenright=333,e.asteriskmath=500,e.plus=549,e.comma=250,e.minus=549,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=549,e.equal=549,e.greater=549,e.question=444,e.congruent=549,e.Alpha=722,e.Beta=667,e.Chi=722,e.Delta=612,e.Epsilon=611,e.Phi=763,e.Gamma=603,e.Eta=722,e.Iota=333,e.theta1=631,e.Kappa=722,e.Lambda=686,e.Mu=889,e.Nu=722,e.Omicron=722,e.Pi=768,e.Theta=741,e.Rho=556,e.Sigma=592,e.Tau=611,e.Upsilon=690,e.sigma1=439,e.Omega=768,e.Xi=645,e.Psi=795,e.Zeta=611,e.bracketleft=333,e.therefore=863,e.bracketright=333,e.perpendicular=658,e.underscore=500,e.radicalex=500,e.alpha=631,e.beta=549,e.chi=549,e.delta=494,e.epsilon=439,e.phi=521,e.gamma=411,e.eta=603,e.iota=329,e.phi1=603,e.kappa=549,e.lambda=549,e.mu=576,e.nu=521,e.omicron=549,e.pi=549,e.theta=521,e.rho=549,e.sigma=603,e.tau=439,e.upsilon=576,e.omega1=713,e.omega=686,e.xi=493,e.psi=686,e.zeta=494,e.braceleft=480,e.bar=200,e.braceright=480,e.similar=549,e.Euro=750,e.Upsilon1=620,e.minute=247,e.lessequal=549,e.fraction=167,e.infinity=713,e.florin=500,e.club=753,e.diamond=753,e.heart=753,e.spade=753,e.arrowboth=1042,e.arrowleft=987,e.arrowup=603,e.arrowright=987,e.arrowdown=603,e.degree=400,e.plusminus=549,e.second=411,e.greaterequal=549,e.multiply=549,e.proportional=713,e.partialdiff=494,e.bullet=460,e.divide=549,e.notequal=549,e.equivalence=549,e.approxequal=549,e.ellipsis=1e3,e.arrowvertex=603,e.arrowhorizex=1e3,e.carriagereturn=658,e.aleph=823,e.Ifraktur=686,e.Rfraktur=795,e.weierstrass=987,e.circlemultiply=768,e.circleplus=768,e.emptyset=823,e.intersection=768,e.union=768,e.propersuperset=713,e.reflexsuperset=713,e.notsubset=713,e.propersubset=713,e.reflexsubset=713,e.element=713,e.notelement=713,e.angle=768,e.gradient=713,e.registerserif=790,e.copyrightserif=790,e.trademarkserif=890,e.product=823,e.radical=549,e.dotmath=250,e.logicalnot=713,e.logicaland=603,e.logicalor=603,e.arrowdblboth=1042,e.arrowdblleft=987,e.arrowdblup=603,e.arrowdblright=987,e.arrowdbldown=603,e.lozenge=494,e.angleleft=329,e.registersans=790,e.copyrightsans=790,e.trademarksans=786,e.summation=713,e.parenlefttp=384,e.parenleftex=384,e.parenleftbt=384,e.bracketlefttp=384,e.bracketleftex=384,e.bracketleftbt=384,e.bracelefttp=494,e.braceleftmid=494,e.braceleftbt=494,e.braceex=494,e.angleright=329,e.integral=274,e.integraltp=686,e.integralex=686,e.integralbt=686,e.parenrighttp=384,e.parenrightex=384,e.parenrightbt=384,e.bracketrighttp=384,e.bracketrightex=384,e.bracketrightbt=384,e.bracerighttp=494,e.bracerightmid=494,e.bracerightbt=494,e.apple=790}),t["Times-Roman"]=un(function(e){e.space=250,e.exclam=333,e.quotedbl=408,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=564,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=564,e.equal=564,e.greater=564,e.question=444,e.at=921,e.A=722,e.B=667,e.C=667,e.D=722,e.E=611,e.F=556,e.G=722,e.H=722,e.I=333,e.J=389,e.K=722,e.L=611,e.M=889,e.N=722,e.O=722,e.P=556,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=722,e.W=944,e.X=722,e.Y=722,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=469,e.underscore=500,e.quoteleft=333,e.a=444,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=500,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=500,e.o=500,e.p=500,e.q=500,e.r=333,e.s=389,e.t=278,e.u=500,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=480,e.bar=200,e.braceright=480,e.asciitilde=541,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=180,e.quotedblleft=444,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=453,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=444,e.quotedblright=444,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=444,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=889,e.ordfeminine=276,e.Lslash=611,e.Oslash=722,e.OE=889,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=444,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=722,e.divide=564,e.Yacute=722,e.Acircumflex=722,e.aacute=444,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=444,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=444,e.Ncommaaccent=722,e.lacute=278,e.agrave=444,e.Tcommaaccent=611,e.Cacute=667,e.atilde=444,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=444,e.Amacron=722,e.rcaron=333,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=556,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=588,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=722,e.Abreve=722,e.multiply=564,e.uacute=500,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=444,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=722,e.Iacute=333,e.plusminus=564,e.brokenbar=200,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=333,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=326,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=444,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=344,e.Kcommaaccent=722,e.Lacute=611,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=722,e.zdotaccent=444,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=500,e.minus=564,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=564,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),t["Times-Bold"]=un(function(e){e.space=250,e.exclam=333,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=1e3,e.ampersand=833,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=930,e.A=722,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=778,e.I=389,e.J=500,e.K=778,e.L=667,e.M=944,e.N=722,e.O=778,e.P=611,e.Q=778,e.R=722,e.S=556,e.T=667,e.U=722,e.V=722,e.W=1e3,e.X=722,e.Y=722,e.Z=667,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=581,e.underscore=500,e.quoteleft=333,e.a=500,e.b=556,e.c=444,e.d=556,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=333,e.k=556,e.l=278,e.m=833,e.n=556,e.o=500,e.p=556,e.q=556,e.r=444,e.s=389,e.t=333,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=394,e.bar=220,e.braceright=394,e.asciitilde=520,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=540,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=300,e.Lslash=667,e.Oslash=778,e.OE=1e3,e.ordmasculine=330,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=556,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=722,e.divide=570,e.Yacute=722,e.Acircumflex=722,e.aacute=500,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=667,e.Cacute=722,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=500,e.Amacron=722,e.rcaron=444,e.ccedilla=444,e.Zdotaccent=667,e.Thorn=611,e.Omacron=778,e.Racute=722,e.Sacute=556,e.dcaron=672,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=570,e.uacute=556,e.Tcaron=667,e.partialdiff=494,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=778,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=444,e.omacron=500,e.Zacute=667,e.Zcaron=667,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=416,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=778,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=300,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=556,e.threequarters=750,e.Scedilla=556,e.lcaron=394,e.Kcommaaccent=778,e.Lacute=667,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=667,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=778,e.degree=400,e.ograve=500,e.Ccaron=722,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=444,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=722,e.Lcommaaccent=667,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=444,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=556,e.minus=570,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=333,e.logicalnot=570,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),t["Times-BoldItalic"]=un(function(e){e.space=250,e.exclam=389,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=832,e.A=667,e.B=667,e.C=667,e.D=722,e.E=667,e.F=667,e.G=722,e.H=778,e.I=389,e.J=500,e.K=667,e.L=611,e.M=889,e.N=722,e.O=722,e.P=611,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=667,e.W=889,e.X=667,e.Y=611,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=570,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=556,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=556,e.v=444,e.w=667,e.x=500,e.y=444,e.z=389,e.braceleft=348,e.bar=220,e.braceright=348,e.asciitilde=570,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=500,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=944,e.ordfeminine=266,e.Lslash=611,e.Oslash=722,e.OE=944,e.ordmasculine=300,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=611,e.divide=570,e.Yacute=611,e.Acircumflex=667,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=611,e.Cacute=667,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=556,e.acircumflex=500,e.Amacron=667,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=611,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=608,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=722,e.Agrave=667,e.Abreve=667,e.multiply=570,e.uacute=556,e.Tcaron=611,e.partialdiff=494,e.ydieresis=444,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=722,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=366,e.eogonek=444,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=576,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=382,e.Kcommaaccent=667,e.Lacute=611,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=722,e.zdotaccent=389,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=500,e.minus=606,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=606,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),t["Times-Italic"]=un(function(e){e.space=250,e.exclam=333,e.quotedbl=420,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=675,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=675,e.equal=675,e.greater=675,e.question=500,e.at=920,e.A=611,e.B=611,e.C=667,e.D=722,e.E=611,e.F=611,e.G=722,e.H=722,e.I=333,e.J=444,e.K=667,e.L=556,e.M=833,e.N=667,e.O=722,e.P=611,e.Q=722,e.R=611,e.S=500,e.T=556,e.U=722,e.V=611,e.W=833,e.X=611,e.Y=556,e.Z=556,e.bracketleft=389,e.backslash=278,e.bracketright=389,e.asciicircum=422,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=278,e.g=500,e.h=500,e.i=278,e.j=278,e.k=444,e.l=278,e.m=722,e.n=500,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=500,e.v=444,e.w=667,e.x=444,e.y=444,e.z=389,e.braceleft=400,e.bar=275,e.braceright=400,e.asciitilde=541,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=214,e.quotedblleft=556,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=523,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=556,e.quotedblright=556,e.guillemotright=500,e.ellipsis=889,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=889,e.AE=889,e.ordfeminine=276,e.Lslash=556,e.Oslash=722,e.OE=944,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=667,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=500,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=556,e.divide=675,e.Yacute=556,e.Acircumflex=611,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=500,e.Ncommaaccent=667,e.lacute=278,e.agrave=500,e.Tcommaaccent=556,e.Cacute=667,e.atilde=500,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=611,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=500,e.Amacron=611,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=556,e.Thorn=611,e.Omacron=722,e.Racute=611,e.Sacute=500,e.dcaron=544,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=611,e.Abreve=611,e.multiply=675,e.uacute=500,e.Tcaron=556,e.partialdiff=476,e.ydieresis=444,e.Nacute=667,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=667,e.Iacute=333,e.plusminus=675,e.brokenbar=275,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=389,e.omacron=500,e.Zacute=556,e.Zcaron=556,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=300,e.eogonek=444,e.Uogonek=722,e.Aacute=611,e.Adieresis=611,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=500,e.lcaron=300,e.Kcommaaccent=667,e.Lacute=556,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=500,e.Scommaaccent=500,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=667,e.otilde=500,e.Rcommaaccent=611,e.Lcommaaccent=556,e.Atilde=611,e.Aogonek=611,e.Aring=611,e.Otilde=722,e.zdotaccent=389,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=444,e.minus=675,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=675,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),t.ZapfDingbats=un(function(e){e.space=278,e.a1=974,e.a2=961,e.a202=974,e.a3=980,e.a4=719,e.a5=789,e.a119=790,e.a118=791,e.a117=690,e.a11=960,e.a12=939,e.a13=549,e.a14=855,e.a15=911,e.a16=933,e.a105=911,e.a17=945,e.a18=974,e.a19=755,e.a20=846,e.a21=762,e.a22=761,e.a23=571,e.a24=677,e.a25=763,e.a26=760,e.a27=759,e.a28=754,e.a6=494,e.a7=552,e.a8=537,e.a9=577,e.a10=692,e.a29=786,e.a30=788,e.a31=788,e.a32=790,e.a33=793,e.a34=794,e.a35=816,e.a36=823,e.a37=789,e.a38=841,e.a39=823,e.a40=833,e.a41=816,e.a42=831,e.a43=923,e.a44=744,e.a45=723,e.a46=749,e.a47=790,e.a48=792,e.a49=695,e.a50=776,e.a51=768,e.a52=792,e.a53=759,e.a54=707,e.a55=708,e.a56=682,e.a57=701,e.a58=826,e.a59=815,e.a60=789,e.a61=789,e.a62=707,e.a63=687,e.a64=696,e.a65=689,e.a66=786,e.a67=787,e.a68=713,e.a69=791,e.a70=785,e.a71=791,e.a72=873,e.a73=761,e.a74=762,e.a203=762,e.a75=759,e.a204=759,e.a76=892,e.a77=892,e.a78=788,e.a79=784,e.a81=438,e.a82=138,e.a83=277,e.a84=415,e.a97=392,e.a98=392,e.a99=668,e.a100=668,e.a89=390,e.a90=390,e.a93=317,e.a94=317,e.a91=276,e.a92=276,e.a205=509,e.a85=509,e.a206=410,e.a86=410,e.a87=234,e.a88=234,e.a95=334,e.a96=334,e.a101=732,e.a102=544,e.a103=544,e.a104=910,e.a106=667,e.a107=760,e.a108=760,e.a112=776,e.a111=595,e.a110=694,e.a109=626,e.a120=788,e.a121=788,e.a122=788,e.a123=788,e.a124=788,e.a125=788,e.a126=788,e.a127=788,e.a128=788,e.a129=788,e.a130=788,e.a131=788,e.a132=788,e.a133=788,e.a134=788,e.a135=788,e.a136=788,e.a137=788,e.a138=788,e.a139=788,e.a140=788,e.a141=788,e.a142=788,e.a143=788,e.a144=788,e.a145=788,e.a146=788,e.a147=788,e.a148=788,e.a149=788,e.a150=788,e.a151=788,e.a152=788,e.a153=788,e.a154=788,e.a155=788,e.a156=788,e.a157=788,e.a158=788,e.a159=788,e.a160=894,e.a161=838,e.a163=1016,e.a164=458,e.a196=748,e.a165=924,e.a192=748,e.a166=918,e.a167=927,e.a168=928,e.a169=928,e.a170=834,e.a171=873,e.a172=828,e.a173=924,e.a162=924,e.a174=917,e.a175=930,e.a176=931,e.a177=463,e.a178=883,e.a179=836,e.a193=836,e.a180=867,e.a199=867,e.a181=696,e.a200=696,e.a182=874,e.a201=874,e.a183=760,e.a184=946,e.a197=771,e.a185=865,e.a194=771,e.a198=888,e.a186=967,e.a195=888,e.a187=831,e.a188=873,e.a189=927,e.a190=970,e.a191=918})}),Ege=un(function(t){t.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426},t["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439},t["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},t["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},t.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523},t["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532},t["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523},t["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532},t["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450},t["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461},t["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441},t["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462},t.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN},t.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}),Ige=1,S2=2,C2=4,HN=8,I1=16,D1=32,Dge=64,M1=1,A2=2,Mge=8,Lge=32,Pge=64,Rge=128,m8=256;class Nge{constructor({glyfTable:e,isGlyphLocationsLong:r,locaTable:n,numGlyphs:i}){this.glyphs=[];const a=new DataView(n.buffer,n.byteOffset,n.byteLength),s=new DataView(e.buffer,e.byteOffset,e.byteLength),o=r?4:2;let l=r?a.getUint32(0):2*a.getUint16(0),c=0;for(let u=0;u<i;u++){c+=o;const h=r?a.getUint32(c):2*a.getUint16(c);if(h===l){this.glyphs.push(new lx({}));continue}const f=lx.parse(l,s);this.glyphs.push(f),l=h}}getSize(){return Math.sumPrecise(this.glyphs.map(e=>e.getSize()+3&-4))}write(){const e=this.getSize(),r=new DataView(new ArrayBuffer(e)),n=e>131070,i=n?4:2,a=new DataView(new ArrayBuffer((this.glyphs.length+1)*i));n?a.setUint32(0,0):a.setUint16(0,0);let s=0,o=0;for(const l of this.glyphs)s+=l.write(s,r),s=s+3&-4,o+=i,n?a.setUint32(o,s):a.setUint16(o,s>>1);return{isLocationLong:n,loca:new Uint8Array(a.buffer),glyf:new Uint8Array(r.buffer)}}scale(e){for(let r=0,n=this.glyphs.length;r<n;r++)this.glyphs[r].scale(e[r])}}class lx{constructor({header:e=null,simple:r=null,composites:n=null}){this.header=e,this.simple=r,this.composites=n}static parse(e,r){const[n,i]=jI.parse(e,r);if(e+=n,i.numberOfContours<0){const s=[];for(;;){const[o,l]=GI.parse(e,r);if(e+=o,s.push(l),!(l.flags&Lge))break}return new lx({header:i,composites:s})}const a=HI.parse(e,r,i.numberOfContours);return new lx({header:i,simple:a})}getSize(){if(!this.header)return 0;const e=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map(r=>r.getSize()));return this.header.getSize()+e}write(e,r){if(!this.header)return 0;const n=e;if(e+=this.header.write(e,r),this.simple)e+=this.simple.write(e,r);else for(const i of this.composites)e+=i.write(e,r);return e-n}scale(e){if(!this.header)return;const r=(this.header.xMin+this.header.xMax)/2;if(this.header.scale(r,e),this.simple)this.simple.scale(r,e);else for(const n of this.composites)n.scale(r,e)}}class jI{constructor({numberOfContours:e,xMin:r,yMin:n,xMax:i,yMax:a}){this.numberOfContours=e,this.xMin=r,this.yMin=n,this.xMax=i,this.yMax=a}static parse(e,r){return[10,new jI({numberOfContours:r.getInt16(e),xMin:r.getInt16(e+2),yMin:r.getInt16(e+4),xMax:r.getInt16(e+6),yMax:r.getInt16(e+8)})]}getSize(){return 10}write(e,r){return r.setInt16(e,this.numberOfContours),r.setInt16(e+2,this.xMin),r.setInt16(e+4,this.yMin),r.setInt16(e+6,this.xMax),r.setInt16(e+8,this.yMax),10}scale(e,r){this.xMin=Math.round(e+(this.xMin-e)*r),this.xMax=Math.round(e+(this.xMax-e)*r)}}class Oge{constructor({flags:e,xCoordinates:r,yCoordinates:n}){this.xCoordinates=r,this.yCoordinates=n,this.flags=e}}class HI{constructor({contours:e,instructions:r}){this.contours=e,this.instructions=r}static parse(e,r,n){const i=[];for(let m=0;m<n;m++){const v=r.getUint16(e);e+=2,i.push(v)}const a=i[n-1]+1,s=r.getUint16(e);e+=2;const o=new Uint8Array(r).slice(e,e+s);e+=s;const l=[];for(let m=0;m<a;e++,m++){let v=r.getUint8(e);if(l.push(v),v&HN){const y=r.getUint8(++e);v^=HN;for(let x=0;x<y;x++)l.push(v);m+=y}}const c=[];let u=[],h=[],f=[];const d=[];let p=0,g=0;for(let m=0;m<a;m++){const v=l[m];if(v&S2){const y=r.getUint8(e++);g+=v&I1?y:-y,u.push(g)}else v&I1||(g+=r.getInt16(e),e+=2),u.push(g);i[p]===m&&(p++,c.push(u),u=[])}g=0,p=0;for(let m=0;m<a;m++){const v=l[m];if(v&C2){const y=r.getUint8(e++);g+=v&D1?y:-y,h.push(g)}else v&D1||(g+=r.getInt16(e),e+=2),h.push(g);f.push(v&Ige|v&Dge),i[p]===m&&(u=c[p],p++,d.push(new Oge({flags:f,xCoordinates:u,yCoordinates:h})),h=[],f=[])}return new HI({contours:d,instructions:o})}getSize(){let e=this.contours.length*2+2+this.instructions.length,r=0,n=0;for(const i of this.contours){e+=i.flags.length;for(let a=0,s=i.xCoordinates.length;a<s;a++){const o=i.xCoordinates[a],l=i.yCoordinates[a];let c=Math.abs(o-r);c>255?e+=2:c>0&&(e+=1),r=o,c=Math.abs(l-n),c>255?e+=2:c>0&&(e+=1),n=l}}return e}write(e,r){const n=e,i=[],a=[],s=[];let o=0,l=0;for(const c of this.contours){for(let u=0,h=c.xCoordinates.length;u<h;u++){let f=c.flags[u];const d=c.xCoordinates[u];let p=d-o;if(p===0)f|=I1,i.push(0);else{const m=Math.abs(p);m<=255?(f|=p>=0?S2|I1:S2,i.push(m)):i.push(p)}o=d;const g=c.yCoordinates[u];if(p=g-l,p===0)f|=D1,a.push(0);else{const m=Math.abs(p);m<=255?(f|=p>=0?C2|D1:C2,a.push(m)):a.push(p)}l=g,s.push(f)}r.setUint16(e,i.length-1),e+=2}r.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(r.buffer,0,r.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length);for(const c of s)r.setUint8(e++,c);for(let c=0,u=i.length;c<u;c++){const h=i[c],f=s[c];f&S2?r.setUint8(e++,h):f&I1||(r.setInt16(e,h),e+=2)}for(let c=0,u=a.length;c<u;c++){const h=a[c],f=s[c];f&C2?r.setUint8(e++,h):f&D1||(r.setInt16(e,h),e+=2)}return e-n}scale(e,r){for(const n of this.contours)if(n.xCoordinates.length!==0)for(let i=0,a=n.xCoordinates.length;i<a;i++)n.xCoordinates[i]=Math.round(e+(n.xCoordinates[i]-e)*r)}}class GI{constructor({flags:e,glyphIndex:r,argument1:n,argument2:i,transf:a,instructions:s}){this.flags=e,this.glyphIndex=r,this.argument1=n,this.argument2=i,this.transf=a,this.instructions=s}static parse(e,r){const n=e,i=[];let a=r.getUint16(e);const s=r.getUint16(e+2);e+=4;let o,l;a&M1?(a&A2?(o=r.getInt16(e),l=r.getInt16(e+2)):(o=r.getUint16(e),l=r.getUint16(e+2)),e+=4,a^=M1):(a&A2?(o=r.getInt8(e),l=r.getInt8(e+1)):(o=r.getUint8(e),l=r.getUint8(e+1)),e+=2),a&Mge?(i.push(r.getUint16(e)),e+=2):a&Pge?(i.push(r.getUint16(e),r.getUint16(e+2)),e+=4):a&Rge&&(i.push(r.getUint16(e),r.getUint16(e+2),r.getUint16(e+4),r.getUint16(e+6)),e+=8);let c=null;if(a&m8){const u=r.getUint16(e);e+=2,c=new Uint8Array(r).slice(e,e+u),e+=u}return[e-n,new GI({flags:a,glyphIndex:s,argument1:o,argument2:l,transf:i,instructions:c})]}getSize(){let e=4+this.transf.length*2;return this.flags&m8&&(e+=2+this.instructions.length),e+=2,this.flags&2?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2),e}write(e,r){const n=e;return this.flags&A2?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=M1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=M1),r.setUint16(e,this.flags),r.setUint16(e+2,this.glyphIndex),e+=4,this.flags&M1?(this.flags&A2?(r.setInt16(e,this.argument1),r.setInt16(e+2,this.argument2)):(r.setUint16(e,this.argument1),r.setUint16(e+2,this.argument2)),e+=4):(r.setUint8(e,this.argument1),r.setUint8(e+1,this.argument2),e+=2),this.flags&m8&&(r.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(r.buffer,0,r.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length)),e-n}scale(e,r){}}function T2(t,e,r){t[e]=r>>8&255,t[e+1]=r&255}function v8(t,e,r){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=r&255}function Bge(t,e,r){if(r instanceof Uint8Array)t.set(r,e);else if(typeof r=="string")for(let n=0,i=r.length;n<i;n++)t[e++]=r.charCodeAt(n)&255;else for(const n of r)t[e++]=n&255}const GN=12,WN=16;class cx{constructor(e){this.sfnt=e,this.tables=Object.create(null)}static getSearchParams(e,r){let n=1,i=0;for(;(n^e)>n;)n<<=1,i++;const a=n*r;return{range:a,entry:i,rangeShift:r*e-a}}toArray(){let e=this.sfnt;const r=this.tables,n=Object.keys(r);n.sort();const i=n.length;let a,s,o,l,c,u=GN+i*WN;const h=[u];for(a=0;a<i;a++){l=r[n[a]];const p=(l.length+3&-4)>>>0;u+=p,h.push(u)}const f=new Uint8Array(u);for(a=0;a<i;a++)l=r[n[a]],Bge(f,h[a],l);e==="true"&&(e=ea(65536)),f[0]=e.charCodeAt(0)&255,f[1]=e.charCodeAt(1)&255,f[2]=e.charCodeAt(2)&255,f[3]=e.charCodeAt(3)&255,T2(f,4,i);const d=cx.getSearchParams(i,16);for(T2(f,6,d.range),T2(f,8,d.entry),T2(f,10,d.rangeShift),u=GN,a=0;a<i;a++){c=n[a],f[u]=c.charCodeAt(0)&255,f[u+1]=c.charCodeAt(1)&255,f[u+2]=c.charCodeAt(2)&255,f[u+3]=c.charCodeAt(3)&255;let p=0;for(s=h[a],o=h[a+1];s<o;s+=4){const g=kr(f,s);p=p+g>>>0}v8(f,u+4,p),v8(f,u+8,h[a]),v8(f,u+12,r[c].length),u+=WN}return f}addTable(e,r){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=r}}const Fge=!1,Da={vmoveto:[4],rlineto:[5],hlineto:[6],vlineto:[7],rrcurveto:[8],flex:[12,35],endchar:[14],rmoveto:[21],hmoveto:[22],vhcurveto:[30],hvcurveto:[31]};class $ge{constructor(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}convert(e,r,n){const i=e.length;let a=!1,s,o,l;for(let c=0;c<i;c++){let u=e[c];if(u<32){switch(u===12&&(u=(u<<8)+e[++c]),u){case 1:{this.stack=[];break}case 3:{this.stack=[];break}case 4:if(this.flexing){if(this.stack.length<1){a=!0;break}const g=this.stack.pop();this.stack.push(0,g);break}a=this.executeCommand(1,Da.vmoveto);break;case 5:a=this.executeCommand(2,Da.rlineto);break;case 6:a=this.executeCommand(1,Da.hlineto);break;case 7:a=this.executeCommand(1,Da.vlineto);break;case 8:a=this.executeCommand(6,Da.rrcurveto);break;case 9:this.stack=[];break;case 10:if(this.stack.length<1){a=!0;break}if(l=this.stack.pop(),!r[l]){a=!0;break}a=this.convert(r[l],r,n);break;case 11:return a;case 13:if(this.stack.length<2){a=!0;break}s=this.stack.pop(),o=this.stack.pop(),this.lsb=o,this.width=s,this.stack.push(s,o),a=this.executeCommand(2,Da.hmoveto);break;case 14:this.output.push(Da.endchar[0]);break;case 21:if(this.flexing)break;a=this.executeCommand(2,Da.rmoveto);break;case 22:if(this.flexing){this.stack.push(0);break}a=this.executeCommand(1,Da.hmoveto);break;case 30:a=this.executeCommand(4,Da.vhcurveto);break;case 31:a=this.executeCommand(4,Da.hvcurveto);break;case 3072:this.stack=[];break;case 3073:{this.stack=[];break}case 3074:{this.stack=[];break}case 3078:if(n){const g=this.stack.at(-5);this.seac=this.stack.splice(-4,4),this.seac[0]+=this.lsb-g,a=this.executeCommand(0,Da.endchar)}else a=this.executeCommand(4,Da.endchar);break;case 3079:if(this.stack.length<4){a=!0;break}this.stack.pop(),s=this.stack.pop();const h=this.stack.pop();o=this.stack.pop(),this.lsb=o,this.width=s,this.stack.push(s,o,h),a=this.executeCommand(3,Da.rmoveto);break;case 3084:if(this.stack.length<2){a=!0;break}const f=this.stack.pop(),d=this.stack.pop();this.stack.push(d/f);break;case 3088:if(this.stack.length<2){a=!0;break}l=this.stack.pop();const p=this.stack.pop();if(l===0&&p===3){const g=this.stack.splice(-17,17);this.stack.push(g[2]+g[0],g[3]+g[1],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14]),a=this.executeCommand(13,Da.flex,!0),this.flexing=!1,this.stack.push(g[15],g[16])}else l===1&&p===0&&(this.flexing=!0);break;case 3089:break;case 3105:this.stack=[];break;default:ee('Unknown type 1 charstring command of "'+u+'"');break}if(a)break;continue}else u<=246?u-=139:u<=250?u=(u-247)*256+e[++c]+108:u<=254?u=-((u-251)*256)-e[++c]-108:u=(e[++c]&255)<<24|(e[++c]&255)<<16|(e[++c]&255)<<8|(e[++c]&255)<<0;this.stack.push(u)}return a}executeCommand(e,r,n){const i=this.stack.length;if(e>i)return!0;const a=i-e;for(let s=a;s<i;s++){let o=this.stack[s];Number.isInteger(o)?this.output.push(28,o>>8&255,o&255):(o=65536*o|0,this.output.push(255,o>>24&255,o>>16&255,o>>8&255,o&255))}return this.output.push(...r),n?this.stack.splice(a,e):this.stack.length=0,!1}}const qN=55665,zge=4330;function Kl(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function XN(t,e,r){if(r>=t.length)return new Uint8Array(0);const n=52845,i=22719;let a=e|0,s,o;for(s=0;s<r;s++)a=(t[s]+a)*n+i&65535;const l=t.length-r,c=new Uint8Array(l);for(s=r,o=0;o<l;s++,o++){const u=t[s];c[o]=u^a>>8,a=(u+a)*n+i&65535}return c}function Vge(t,e,r){let a=e|0;const s=t.length,o=s>>>1,l=new Uint8Array(o);let c,u;for(c=0,u=0;c<s;c++){const h=t[c];if(!Kl(h))continue;c++;let f;for(;c<s&&!Kl(f=t[c]);)c++;if(c<s){const d=parseInt(String.fromCharCode(h,f),16);l[u++]=d^a>>8,a=(d+a)*52845+22719&65535}}return l.slice(r,u)}function YN(t){return t===47||t===91||t===93||t===123||t===125||t===40||t===41}class KN{constructor(e,r,n){if(r){const i=e.getBytes(),a=!((Kl(i[0])||Gs(i[0]))&&Kl(i[1])&&Kl(i[2])&&Kl(i[3])&&Kl(i[4])&&Kl(i[5])&&Kl(i[6])&&Kl(i[7]));e=new ln(a?XN(i,qN,4):Vge(i,qN,4))}this.seacAnalysisEnabled=!!n,this.stream=e,this.nextChar()}readNumberArray(){this.getToken();const e=[];for(;;){const r=this.getToken();if(r===null||r==="]"||r==="}")break;e.push(parseFloat(r||0))}return e}readNumber(){const e=this.getToken();return parseFloat(e||0)}readInt(){const e=this.getToken();return parseInt(e||0,10)|0}readBoolean(){return this.getToken()==="true"?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){return this.stream.skip(-2),this.currentChar=this.stream.getByte()}getToken(){let e=!1,r=this.currentChar;for(;;){if(r===-1)return null;if(e)(r===10||r===13)&&(e=!1);else if(r===37)e=!0;else if(!Gs(r))break;r=this.nextChar()}if(YN(r))return this.nextChar(),String.fromCharCode(r);let n="";do n+=String.fromCharCode(r),r=this.nextChar();while(r>=0&&!Gs(r)&&!YN(r));return n}readCharStrings(e,r){return r===-1?e:XN(e,zge,r)}extractFontProgram(e){const r=this.stream,n=[],i=[],a=Object.create(null);a.lenIV=4;const s={subrs:[],charstrings:[],properties:{privateData:a}};let o,l,c,u;for(;(o=this.getToken())!==null;)if(o==="/")switch(o=this.getToken(),o){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();o=this.getToken(),!(o===null||o==="end");){if(o!=="/")continue;const f=this.getToken();l=this.readInt(),this.getToken(),c=l>0?r.getBytes(l):new Uint8Array(0),u=s.properties.privateData.lenIV;const d=this.readCharStrings(c,u);this.nextChar(),o=this.getToken(),o==="noaccess"?this.getToken():o==="/"&&this.prevChar(),i.push({glyph:f,encoded:d})}break;case"Subrs":for(this.readInt(),this.getToken();this.getToken()==="dup";){const f=this.readInt();l=this.readInt(),this.getToken(),c=l>0?r.getBytes(l):new Uint8Array(0),u=s.properties.privateData.lenIV;const d=this.readCharStrings(c,u);this.nextChar(),o=this.getToken(),o==="noaccess"&&this.getToken(),n[f]=d}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const h=this.readNumberArray();h.length>0&&h.length%2;break;case"StemSnapH":case"StemSnapV":s.properties.privateData[o]=this.readNumberArray();break;case"StdHW":case"StdVW":s.properties.privateData[o]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":s.properties.privateData[o]=this.readNumber();break;case"ExpansionFactor":s.properties.privateData[o]=this.readNumber()||.06;break;case"ForceBold":s.properties.privateData[o]=this.readBoolean();break}for(const{encoded:h,glyph:f}of i){const d=new $ge,p=d.convert(h,n,this.seacAnalysisEnabled);let g=d.output;p&&(g=[14]);const m={glyphName:f,charstring:g,width:d.width,lsb:d.lsb,seac:d.seac};if(f===".notdef"?s.charstrings.unshift(m):s.charstrings.push(m),e.builtInEncoding){const v=e.builtInEncoding.indexOf(f);v>-1&&e.widths[v]===void 0&&v>=e.firstChar&&v<=e.lastChar&&(e.widths[v]=d.width)}}return s}extractFontHeader(e){let r;for(;(r=this.getToken())!==null;)if(r==="/")switch(r=this.getToken(),r){case"FontMatrix":const n=this.readNumberArray();e.fontMatrix=n;break;case"Encoding":const i=this.getToken();let a;if(!/^\d+$/.test(i))a=ix(i);else{a=[];const o=parseInt(i,10)|0;this.getToken();for(let l=0;l<o;l++){for(r=this.getToken();r!=="dup"&&r!=="def";)if(r=this.getToken(),r===null)return;if(r==="def")break;const c=this.readInt();this.getToken();const u=this.getToken();a[c]=u,this.getToken()}}e.builtInEncoding=a;break;case"FontBBox":const s=this.readNumberArray();e.ascent=Math.max(s[3],s[1]),e.descent=Math.min(s[1],s[3]),e.ascentScaled=!0;break}}}function ZN(t,e,r){const n=t.length,i=e.length,a=n-i;let s=r,o=!1;for(;s<a;){let l=0;for(;l<i&&t[s+l]===e[l];)l++;if(l>=i){for(s+=l;s<n&&Gs(t[s]);)s++;o=!0;break}s++}return{found:o,length:s}}function Uge(t,e){const r=[101,101,120,101,99],n=t.pos;let i,a,s;try{i=t.getBytes(e),a=i.length}catch{}if(a===e&&(s=ZN(i,r,e-2*r.length),s.found&&s.length===e))return{stream:new ln(i),length:e};ee('Invalid "Length1" property in Type1 font -- trying to recover.'),t.pos=n;const o=2048;let l;for(;;){const c=t.peekBytes(o);if(s=ZN(c,r,0),s.length===0)break;if(t.pos+=s.length,s.found){l=t.pos-n;break}}return t.pos=n,l?{stream:new ln(t.getBytes(l)),length:l}:(ee('Unable to recover "Length1" property in Type1 font -- using as is.'),{stream:new ln(t.getBytes(e)),length:e})}function jge(t,e){const r=t.getBytes();if(r.length===0)throw new fe("getEexecBlock - no font program found.");return{stream:new ln(r),length:r.length}}class Hge{constructor(e,r,n){let a=n.length1;n.length2;let s=r.peekBytes(6);const o=s[0]===128&&s[1]===1;o&&(r.skip(6),a=s[5]<<24|s[4]<<16|s[3]<<8|s[2]);const l=Uge(r,a);new KN(l.stream,!1,Rg).extractFontHeader(n),o&&(s=r.getBytes(6),s[5]<<24|s[4]<<16|s[3]<<8|s[2]);const u=jge(r),f=new KN(u.stream,!0,Rg).extractFontProgram(n);for(const m in f.properties)n[m]=f.properties[m];const d=f.charstrings,p=this.getType2Charstrings(d),g=this.getType2Subrs(f.subrs);this.charstrings=d,this.data=this.wrap(e,p,this.charstrings,g,n),this.seacs=this.getSeacs(f.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const e=[".notdef"];for(const{glyphName:r}of this.charstrings)e.push(r);return e}getGlyphMapping(e){const r=this.charstrings;if(e.composite){const o=Object.create(null);for(let l=0,c=r.length;l<c;l++){const u=e.cMap.charCodeOf(l);o[u]=l+1}return o}const n=[".notdef"];let i,a;for(a=0;a<r.length;a++)n.push(r[a].glyphName);const s=e.builtInEncoding;if(s){i=Object.create(null);for(const o in s)a=n.indexOf(s[o]),a>=0&&(i[o]=a)}return Jq(e,i,n)}hasGlyphId(e){return e<0||e>=this.numGlyphs?!1:e===0?!0:this.charstrings[e-1].charstring.length>0}getSeacs(e){const r=[];for(let n=0,i=e.length;n<i;n++){const a=e[n];a.seac&&(r[n+1]=a.seac)}return r}getType2Charstrings(e){const r=[];for(const n of e)r.push(n.charstring);return r}getType2Subrs(e){let r=0;const n=e.length;n<1133?r=107:n<33769?r=1131:r=32768;const i=[];let a;for(a=0;a<r;a++)i.push([11]);for(a=0;a<n;a++)i.push(e[a]);return i}wrap(e,r,n,i,a){const s=new Qq;s.header=new eX(1,0,4,4),s.names=[e];const o=new ax;o.setByName("version",391),o.setByName("Notice",392),o.setByName("FullName",393),o.setByName("FamilyName",394),o.setByName("Weight",395),o.setByName("Encoding",null),o.setByName("FontMatrix",a.fontMatrix),o.setByName("FontBBox",a.bbox),o.setByName("charset",null),o.setByName("CharStrings",null),o.setByName("Private",null),s.topDict=o;const l=new VI;l.add("Version 0.11"),l.add("See original notice"),l.add(e),l.add(e),l.add("Medium"),s.strings=l,s.globalSubrIndex=new Mh;const c=r.length,u=[".notdef"];let h,f;for(h=0;h<c;h++){const y=n[h].glyphName;w_.indexOf(y)===-1&&l.add(y),u.push(y)}s.charset=new Uv(!1,0,u);const d=new Mh;for(d.add([139,14]),h=0;h<c;h++)d.add(r[h]);s.charStrings=d;const p=new sx;p.setByName("Subrs",null);const g=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(h=0,f=g.length;h<f;h++){const y=g[h];if(!(y in a.privateData))continue;const x=a.privateData[y];if(Array.isArray(x))for(let b=x.length-1;b>0;b--)x[b]-=x[b-1];p.setByName(y,x)}s.topDict.privateDict=p;const m=new Mh;for(h=0,f=i.length;h<f;h++)m.add(i[h]);return p.subrsIndex=m,new gb(s).compile()}}const Gc=[[57344,63743],[1048576,1114109]],ud=1e3,Gge=["ascent","bbox","black","bold","charProcOperatorList","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","disableFontFace","fallbackName","fontExtraProperties","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","systemFontInfo","vertical"],Wge=["cMap","composite","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","subtype","toFontChar","toUnicode","type","vmetrics","widths"];function JN(t){if(!t.fontMatrix||t.fontMatrix[0]===Wd[0])return;const e=.001/t.fontMatrix[0],r=t.widths;for(const n in r)r[n]*=e;t.defaultWidth*=e}function qge(t,e,r){if(t.isInternalFont||t.hasIncludedToUnicodeMap||t.hasEncoding||t.toUnicode instanceof wo||!e||r.length===0||t.defaultEncoding===nx)return;for(const s of r)if(!aX(s))return;const n=nx,i=[],a=nc();for(const s in n){const o=n[s];if(o==="")continue;const l=a[o];l!==void 0&&(i[s]=String.fromCharCode(l))}i.length>0&&t.toUnicode.amend(i)}function Xge(t,e){if(t.isInternalFont||t.hasIncludedToUnicodeMap||e===t.defaultEncoding||t.toUnicode instanceof wo)return;const r=[],n=nc();for(const i in e){if(t.hasEncoding&&(t.baseEncodingName||t.differences[i]!==void 0))continue;const a=e[i],s=lm(a,n);s!==-1&&(r[i]=String.fromCharCode(s))}r.length>0&&t.toUnicode.amend(r)}function QN(t){if(!t.fallbackToUnicode||t.toUnicode instanceof wo)return;const e=[];for(const r in t.fallbackToUnicode)t.toUnicode.has(r)||(e[r]=t.fallbackToUnicode[r]);e.length>0&&t.toUnicode.amend(e)}class Yge{constructor(e,r,n,i,a,s,o,l,c){this.originalCharCode=e,this.fontChar=r,this.unicode=n,this.accent=i,this.width=a,this.vmetric=s,this.operatorListId=o,this.isSpace=l,this.isInFont=c}get category(){return Te(this,"category",ige(this.unicode),!0)}}function xp(t,e){return(t<<8)+e}function L1(t,e,r){t[e+1]=r,t[e]=r>>>8}function Is(t,e){const r=(t<<8)+e;return r&32768?r-65536:r}function Kge(t,e,r){t[e+3]=r&255,t[e+2]=r>>>8,t[e+1]=r>>>16,t[e]=r>>>24}function Zge(t,e,r,n){return(t<<24)+(e<<16)+(r<<8)+n}function wr(t){return String.fromCharCode(t>>8&255,t&255)}function Mf(t){return t>32767?t=32767:t<-32768&&(t=-32768),String.fromCharCode(t>>8&255,t&255)}function Jge(t){const e=t.peekBytes(4);return kr(e,0)===65536||As(e)==="true"}function iX(t){const e=t.peekBytes(4);return As(e)==="ttcf"}function Qge(t){const e=t.peekBytes(4);return As(e)==="OTTO"}function eme(t){const e=t.peekBytes(2);return e[0]===37&&e[1]===33||e[0]===128&&e[1]===1}function tme(t){const e=t.peekBytes(4);return e[0]>=1&&e[3]>=1&&e[3]<=4}function rme(t,{type:e,subtype:r,composite:n}){let i,a;return Jge(t)||iX(t)?i=n?"CIDFontType2":"TrueType":Qge(t)?i=n?"CIDFontType2":"OpenType":eme(t)?n?i="CIDFontType0":i=e==="MMType1"?"MMType1":"Type1":tme(t)?n?(i="CIDFontType0",a="CIDFontType0C"):(i=e==="MMType1"?"MMType1":"Type1",a="Type1C"):(ee("getFontFileType: Unable to detect correct font file Type/Subtype."),i=e,a=r),[i,a]}function k2(t,e){for(const r in e)t[+r]=e[r]}function y8(t,e,r){const n=[];let i;for(let a=0,s=t.length;a<s;a++)i=lm(t[a],e),i!==-1&&(n[a]=i);for(const a in r)i=lm(r[a],e),i!==-1&&(n[+a]=i);return n}function nme(t){return t.platform===1&&t.encoding===0&&t.language===0}function aX(t){return t.platform===3&&t.encoding===1&&t.language===1033}function x8(t,e,r=!1){switch(e.length){case 1:return e.charCodeAt(0);case 2:return e.charCodeAt(0)<<8|e.charCodeAt(1)}const n=`Unsupported CID string (charCode ${t}): "${e}".`;if(r)throw new fe(n);return ee(n),e}function eO(t,e,r,n){const i=Object.create(null),a=new Map,s=[],o=new Set;let l=0,u=Gc[l][0],h=Gc[l][1];const f=p=>Gc[0][0]<=p&&p<=Gc[0][1]||Gc[1][0]<=p&&p<=Gc[1][1];let d=null;for(const p in t){let g=t[p];if(!e(g))continue;if(u>h){if(l++,l>=Gc.length){ee("Ran out of space in font private use area.");break}u=Gc[l][0],h=Gc[l][1]}const m=u++;g===0&&(g=r);let v=n.get(p);if(typeof v=="string")if(v.length===1)v=v.codePointAt(0);else{if(!d){d=new Map;for(let y=64256;y<=64335;y++){const x=String.fromCharCode(y).normalize("NFKD");x.length>1&&d.set(x,y)}}v=d.get(v)||v.codePointAt(0)}v&&!f(v)&&!o.has(g)&&(a.set(v,g),o.add(g)),i[m]=g,s[p]=m}return{toFontChar:s,charCodeToGlyphId:i,toUnicodeExtraMap:a,nextAvailableFontCharCode:u}}function ime(t,e,r){const n=[];for(const s in t)t[s]>=r||n.push({fontCharCode:s|0,glyphId:t[s]});if(e)for(const[s,o]of e)o>=r||n.push({fontCharCode:s,glyphId:o});n.length===0&&n.push({fontCharCode:0,glyphId:0}),n.sort((s,o)=>s.fontCharCode-o.fontCharCode);const i=[],a=n.length;for(let s=0;s<a;){const o=n[s].fontCharCode,l=[n[s].glyphId];++s;let c=o;for(;s<a&&c+1===n[s].fontCharCode&&(l.push(n[s].glyphId),++c,++s,c!==65535););i.push([o,c,l])}return i}function tO(t,e,r){const n=ime(t,e,r),i=n.at(-1)[1]>65535?2:1;let a="\0\0"+wr(i)+"\0\0"+ea(4+i*8),s,o,l,c;for(s=n.length-1;s>=0&&!(n[s][0]<=65535);--s);const u=s+1;n[s][0]<65535&&n[s][1]===65535&&(n[s][1]=65534);const h=n[s][1]<65535?1:0,f=u+h,d=cx.getSearchParams(f,2);let p="",g="",m="",v="",y="",x=0,b,w,_,S;for(s=0,o=u;s<o;s++){b=n[s],w=b[0],_=b[1],p+=wr(w),g+=wr(_),S=b[2];let k=!0;for(l=1,c=S.length;l<c;++l)if(S[l]!==S[l-1]+1){k=!1;break}if(k){const I=S[0];m+=wr(I-w&65535),v+=wr(0)}else{const I=(f-s)*2+x*2;for(x+=_-w+1,m+=wr(0),v+=wr(I),l=0,c=S.length;l<c;++l)y+=wr(S[l])}}h>0&&(g+="ÿÿ",p+="ÿÿ",m+="\0",v+="\0\0");const C="\0\0"+wr(2*f)+wr(d.range)+wr(d.entry)+wr(d.rangeShift)+g+"\0\0"+p+m+v+y;let T="",A="";if(i>1){for(a+=`\0\0
19
19
  `+ea(4+i*8+4+C.length),T="",s=0,o=n.length;s<o;s++){b=n[s],w=b[0],S=b[2];let k=S[0];for(l=1,c=S.length;l<c;++l)S[l]!==S[l-1]+1&&(_=b[0]+l-1,T+=ea(w)+ea(_)+ea(k),w=_+1,k=S[l]);T+=ea(w)+ea(b[1])+ea(k)}A="\0\f\0\0"+ea(T.length+16)+"\0\0\0\0"+ea(T.length/12)}return a+"\0"+wr(C.length+4)+C+A+T}function ame(t,e){e.pos=(e.start||0)+t.offset;const r=e.getUint16();e.skip(60);const n=e.getUint16();if(r<4&&n&768)return!1;const i=e.getUint16(),a=e.getUint16();return i>a||(e.skip(6),e.getUint16()===0)?!1:(t.data[8]=t.data[9]=0,!0)}function rO(t,e,r){r||={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let n=0,i=0,a=0,s=0,o=null,l=0,c=-1;if(e){for(let v in e)if(v|=0,(o>v||!o)&&(o=v),l<v&&(l=v),c=rge(v,c),c<32)n|=1<<c;else if(c<64)i|=1<<c-32;else if(c<96)a|=1<<c-64;else if(c<123)s|=1<<c-96;else throw new fe("Unicode ranges Bits > 123 are reserved for internal usage");l>65535&&(l=65535)}else o=0,l=255;const u=t.bbox||[0,0,0,0],h=r.unitsPerEm||(t.fontMatrix?1/Math.max(...t.fontMatrix.slice(0,4).map(Math.abs)):1e3),f=t.ascentScaled?1:h/ud,d=r.ascent||Math.round(f*(t.ascent||u[3]));let p=r.descent||Math.round(f*(t.descent||u[1]));p>0&&t.descent>0&&u[1]<0&&(p=-p);const g=r.yMax||d,m=-r.yMin||-p;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(t.fixedPitch?9:0)+"\0\0\0\0\0\0"+ea(n)+ea(i)+ea(a)+ea(s)+"*21*"+wr(t.italicAngle?1:0)+wr(o||t.firstChar)+wr(l||t.lastChar)+wr(d)+wr(p)+"\0d"+wr(g)+wr(m)+"\0\0\0\0\0\0\0\0"+wr(t.xHeight)+wr(t.capHeight)+wr(0)+wr(o||t.firstChar)+"\0"}function nO(t){const e=Math.floor(t.italicAngle*65536);return"\0\0\0"+ea(e)+"\0\0\0\0"+ea(t.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function sme(t){return t.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function b8(t,e){e||(e=[[],[]]);const r=[e[0][0]||"Original licence",e[0][1]||t,e[0][2]||"Unknown",e[0][3]||"uniqueID",e[0][4]||t,e[0][5]||"Version 0.11",e[0][6]||sme(t),e[0][7]||"Unknown",e[0][8]||"Unknown",e[0][9]||"Unknown"],n=[];let i,a,s,o,l;for(i=0,a=r.length;i<a;i++){l=e[1][i]||r[i];const m=[];for(s=0,o=l.length;s<o;s++)m.push(wr(l.charCodeAt(s)));n.push(m.join(""))}const c=[r,n],u=["\0","\0"],h=["\0\0","\0"],f=["\0\0"," "],d=r.length*u.length;let p="\0\0"+wr(d)+wr(d*12+6),g=0;for(i=0,a=u.length;i<a;i++){const m=c[i];for(s=0,o=m.length;s<o;s++){l=m[s];const v=u[i]+h[i]+f[i]+wr(s)+wr(l.length)+wr(g);p+=v,g+=l.length}}return p+=r.join("")+n.join(""),p}class iO{constructor(e,r,n,i){this.name=e,this.psName=null,this.mimetype=null,this.disableFontFace=i.disableFontFace,this.fontExtraProperties=i.fontExtraProperties,this.loadedName=n.loadedName,this.isType3Font=n.isType3Font,this.missingFile=!1,this.cssFontInfo=n.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);let a=!!(n.flags&Jo.Serif);if(!a&&!n.isSimulatedFlags){const u=ox(),h=bT(),f=UI();for(const d of e.split("+")){let p=d.replaceAll(/[,_]/g,"-");if(p=u[p]||h[p]||p,p=p.split("-",1)[0],f[p]){a=!0;break}}}this.isSerifFont=a,this.isSymbolicFont=!!(n.flags&Jo.Symbolic),this.isMonospace=!!(n.flags&Jo.FixedPitch);let{type:s,subtype:o}=n;this.type=s,this.subtype=o,this.systemFontInfo=n.systemFontInfo;const l=e.match(/^InvalidPDFjsFont_(.*)_\d+$/);if(this.isInvalidPDFjsFont=!!l,this.isInvalidPDFjsFont?this.fallbackName=l[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif",this.systemFontInfo?.guessFallback&&(this.systemFontInfo.guessFallback=!1,this.systemFontInfo.css+=`,${this.fallbackName}`),this.differences=n.differences,this.widths=n.widths,this.defaultWidth=n.defaultWidth,this.composite=n.composite,this.cMap=n.cMap,this.capHeight=n.capHeight/ud,this.ascent=n.ascent/ud,this.descent=n.descent/ud,this.lineHeight=this.ascent-this.descent,this.fontMatrix=n.fontMatrix,this.bbox=n.bbox,this.defaultEncoding=n.defaultEncoding,this.toUnicode=n.toUnicode,this.toFontChar=[],n.type==="Type3"){for(let u=0;u<256;u++)this.toFontChar[u]=this.differences[u]||n.defaultEncoding[u];return}if(this.cidEncoding=n.cidEncoding||"",this.vertical=!!n.vertical,this.vertical&&(this.vmetrics=n.vmetrics,this.defaultVMetrics=n.defaultVMetrics),!r||r.isEmpty){r&&ee('Font file is empty in "'+e+'" ('+this.loadedName+")"),this.fallbackToSystemFont(n);return}[s,o]=rme(r,n),(s!==this.type||o!==this.subtype)&&Ht(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${s}/${o}.`);let c;try{switch(s){case"MMType1":Ht("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const u=o==="Type1C"||o==="CIDFontType0C"?new g8(r,n):new Hge(e,r,n);JN(n),c=this.convert(e,u,n);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",c=this.checkAndRepair(e,r,n),JN(n),this.isOpenType&&(s="OpenType");break;default:throw new fe(`Font ${s} is not supported`)}}catch(u){ee(u),this.fallbackToSystemFont(n);return}QN(n),this.data=c,this.type=s,this.subtype=o,this.fontMatrix=n.fontMatrix,this.widths=n.widths,this.defaultWidth=n.defaultWidth,this.toUnicode=n.toUnicode,this.seacMap=n.seacMap}get renderer(){const e=Tge.create(this,Rg);return Te(this,"renderer",e)}exportData(){const e=Object.create(null);for(const n of Gge){const i=this[n];i!==void 0&&(e[n]=i)}if(!this.fontExtraProperties)return{data:e};const r=Object.create(null);for(const n of Wge){const i=this[n];i!==void 0&&(r[n]=i)}return{data:e,extra:r}}fallbackToSystemFont(e){this.missingFile=!0;const{name:r,type:n}=this;let i=pb(r);const a=ox(),s=bT(),o=!!a[i],l=!!(s[i]&&a[s[i]]);i=a[i]||s[i]||i;const u=Ege()[i];u&&(isNaN(this.ascent)&&(this.ascent=u.ascent/ud),isNaN(this.descent)&&(this.descent=u.descent/ud),isNaN(this.capHeight)&&(this.capHeight=u.capHeight/ud)),this.bold=/bold/gi.test(i),this.italic=/oblique|italic/gi.test(i),this.black=/Black/g.test(r);const h=/Narrow/g.test(r);if(this.remeasure=(!o||h)&&Object.keys(this.widths).length>0,(o||l)&&n==="CIDFontType2"&&this.cidEncoding.startsWith("Identity-")){const f=e.cidToGidMap,d=[];if(k2(d,zN()),/Arial-?Black/i.test(r)?k2(d,yge()):/Calibri/i.test(r)&&k2(d,xge()),f){for(const p in d){const g=d[p];f[g]!==void 0&&(d[+p]=f[g])}f.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof wo&&this.toUnicode.forEach(function(p,g){const m=d[p];f[m]===void 0&&(d[+p]=g)})}this.toUnicode instanceof wo||this.toUnicode.forEach(function(p,g){d[+p]=g}),this.toFontChar=d,this.toUnicode=new jv(d)}else if(/Symbol/i.test(i))this.toFontChar=y8(FI,nc(),this.differences);else if(/Dingbats/i.test(i))this.toFontChar=y8($I,Qpe(),this.differences);else if(o||l){const f=y8(this.defaultEncoding,nc(),this.differences);n==="CIDFontType2"&&!this.cidEncoding.startsWith("Identity-")&&!(this.toUnicode instanceof wo)&&this.toUnicode.forEach(function(d,p){f[+d]=p}),this.toFontChar=f}else{const f=nc(),d=[];this.toUnicode.forEach((p,g)=>{if(!this.composite){const m=this.differences[p]||this.defaultEncoding[p],v=lm(m,f);v!==-1&&(g=v)}d[+p]=g}),this.composite&&this.toUnicode instanceof wo&&/Tahoma|Verdana/i.test(r)&&k2(d,zN()),this.toFontChar=d}QN(e),this.loadedName=i.split("-",1)[0]}checkAndRepair(e,r,n){const i=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function a(B,q){const W=Object.create(null);W["OS/2"]=null,W.cmap=null,W.head=null,W.hhea=null,W.hmtx=null,W.maxp=null,W.name=null,W.post=null;for(let X=0;X<q;X++){const K=s(B);i.includes(K.tag)&&K.length!==0&&(W[K.tag]=K)}return W}function s(B){const q=B.getString(4),W=B.getInt32()>>>0,X=B.getInt32()>>>0,K=B.getInt32()>>>0,G=B.pos;B.pos=B.start||0,B.skip(X);const H=B.getBytes(K);return B.pos=G,q==="head"&&(H[8]=H[9]=H[10]=H[11]=0,H[17]|=32),{tag:q,checksum:W,length:K,offset:X,data:H}}function o(B){return{version:B.getString(4),numTables:B.getUint16(),searchRange:B.getUint16(),entrySelector:B.getUint16(),rangeShift:B.getUint16()}}function l(B){const q=B.getString(4);Ir(q==="ttcf","Must be a TrueType Collection font.");const W=B.getUint16(),X=B.getUint16(),K=B.getInt32()>>>0,G=[];for(let Y=0;Y<K;Y++)G.push(B.getInt32()>>>0);const H={ttcTag:q,majorVersion:W,minorVersion:X,numFonts:K,offsetTable:G};switch(W){case 1:return H;case 2:return H.dsigTag=B.getInt32()>>>0,H.dsigLength=B.getInt32()>>>0,H.dsigOffset=B.getInt32()>>>0,H}throw new fe(`Invalid TrueType Collection majorVersion: ${W}.`)}function c(B,q){const{numFonts:W,offsetTable:X}=l(B),K=q.split("+");let G;for(let H=0;H<W;H++){B.pos=(B.start||0)+X[H];const Y=o(B),J=a(B,Y.numTables);if(!J.name)throw new fe('TrueType Collection font must contain a "name" table.');const[ie]=m(J.name);for(let me=0,oe=ie.length;me<oe;me++)for(let ne=0,de=ie[me].length;ne<de;ne++){const ve=ie[me][ne]?.replaceAll(/\s/g,"");if(ve){if(ve===q)return{header:Y,tables:J};if(!(K.length<2))for(const Ne of K)ve===Ne&&(G={name:Ne,header:Y,tables:J})}}}if(G)return ee(`TrueType Collection does not contain "${q}" font, falling back to "${G.name}" font instead.`),{header:G.header,tables:G.tables};throw new fe(`TrueType Collection does not contain "${q}" font.`)}function u(B,q,W,X){if(!B)return ee("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};let K,G=(q.start||0)+B.offset;q.pos=G,q.skip(2);const H=q.getUint16();let Y,J=!1;for(let ke=0;ke<H;ke++){const Le=q.getUint16(),$e=q.getUint16(),Ee=q.getInt32()>>>0;let pe=!1;if(!(Y?.platformId===Le&&Y?.encodingId===$e)){if(Le===0&&($e===0||$e===1||$e===3))pe=!0;else if(Le===1&&$e===0)pe=!0;else if(Le===3&&$e===1&&(X||!Y))pe=!0,W||(J=!0);else if(W&&Le===3&&$e===0){pe=!0;let Ve=!0;if(ke<H-1){const qe=q.peekBytes(2);xp(qe[0],qe[1])<Le&&(Ve=!1)}Ve&&(J=!0)}if(pe&&(Y={platformId:Le,encodingId:$e,offset:Ee}),J)break}}if(Y&&(q.pos=G+Y.offset),!Y||q.peekByte()===-1)return ee("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};const ie=q.getUint16();let me=!1;const oe=[];let ne,de;if(ie===0){for(q.skip(4),ne=0;ne<256;ne++){const ke=q.getByte();ke&&oe.push({charCode:ne,glyphId:ke})}me=!0}else if(ie===2){q.skip(4);const ke=[];let Le=0;for(let Ee=0;Ee<256;Ee++){const pe=q.getUint16()>>3;ke.push(pe),Le=Math.max(pe,Le)}const $e=[];for(let Ee=0;Ee<=Le;Ee++)$e.push({firstCode:q.getUint16(),entryCount:q.getUint16(),idDelta:Is(q.getByte(),q.getByte()),idRangePos:q.pos+q.getUint16()});for(let Ee=0;Ee<256;Ee++)if(ke[Ee]===0)q.pos=$e[0].idRangePos+2*Ee,de=q.getUint16(),oe.push({charCode:Ee,glyphId:de});else{const pe=$e[ke[Ee]];for(ne=0;ne<pe.entryCount;ne++){const Ve=(Ee<<8)+ne+pe.firstCode;q.pos=pe.idRangePos+2*ne,de=q.getUint16(),de!==0&&(de=(de+pe.idDelta)%65536),oe.push({charCode:Ve,glyphId:de})}}}else if(ie===4){q.skip(4);const ke=q.getUint16()>>1;q.skip(6);const Le=[];let $e;for($e=0;$e<ke;$e++)Le.push({end:q.getUint16()});for(q.skip(2),$e=0;$e<ke;$e++)Le[$e].start=q.getUint16();for($e=0;$e<ke;$e++)Le[$e].delta=q.getUint16();let Ee=0,pe;for($e=0;$e<ke;$e++){K=Le[$e];const qe=q.getUint16();if(!qe){K.offsetIndex=-1;continue}pe=(qe>>1)-(ke-$e),K.offsetIndex=pe,Ee=Math.max(Ee,pe+K.end-K.start+1)}const Ve=[];for(ne=0;ne<Ee;ne++)Ve.push(q.getUint16());for($e=0;$e<ke;$e++){K=Le[$e],G=K.start;const qe=K.end,tt=K.delta;for(pe=K.offsetIndex,ne=G;ne<=qe;ne++)ne!==65535&&(de=pe<0?ne:Ve[pe+ne-G],de=de+tt&65535,oe.push({charCode:ne,glyphId:de}))}}else if(ie===6){q.skip(4);const ke=q.getUint16(),Le=q.getUint16();for(ne=0;ne<Le;ne++){de=q.getUint16();const $e=ke+ne;oe.push({charCode:$e,glyphId:de})}}else if(ie===12){q.skip(10);const ke=q.getInt32()>>>0;for(ne=0;ne<ke;ne++){const Le=q.getInt32()>>>0,$e=q.getInt32()>>>0;let Ee=q.getInt32()>>>0;for(let pe=Le;pe<=$e;pe++)oe.push({charCode:pe,glyphId:Ee++})}}else return ee("cmap table has unsupported format: "+ie),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};oe.sort((ke,Le)=>ke.charCode-Le.charCode);const ve=[],Ne=new Set;for(const ke of oe){const{charCode:Le}=ke;Ne.has(Le)||(Ne.add(Le),ve.push(ke))}return{platformId:Y.platformId,encodingId:Y.encodingId,mappings:ve,hasShortCmap:me}}function h(B,q,W,X,K,G){if(!q){W&&(W.data=null);return}B.pos=(B.start||0)+q.offset,B.pos+=4,B.pos+=2,B.pos+=2,B.pos+=2,B.pos+=2,B.pos+=2,B.pos+=2,B.pos+=2,B.pos+=2,B.pos+=2;const H=B.getUint16();B.pos+=8,B.pos+=2;let Y=B.getUint16();H!==0&&(xp(X.data[44],X.data[45])&2||(q.data[22]=0,q.data[23]=0)),Y>K&&(Ht(`The numOfMetrics (${Y}) should not be greater than the numGlyphs (${K}).`),Y=K,q.data[34]=(Y&65280)>>8,q.data[35]=Y&255);const ie=K-Y-(W.length-Y*4>>1);if(ie>0){const me=new Uint8Array(W.length+ie*2);me.set(W.data),G&&(me[W.length]=W.data[2],me[W.length+1]=W.data[3]),W.data=me}}function f(B,q,W,X,K,G){const H={length:0,sizeOfInstructions:0};if(q<0||q>=B.length||W>B.length||W-q<=12)return H;const Y=B.subarray(q,W),J=Is(Y[2],Y[3]),ie=Is(Y[4],Y[5]),me=Is(Y[6],Y[7]),oe=Is(Y[8],Y[9]);J>me&&(L1(Y,2,me),L1(Y,6,J)),ie>oe&&(L1(Y,4,oe),L1(Y,8,ie));const ne=Is(Y[0],Y[1]);if(ne<0)return ne<-1||(X.set(Y,K),H.length=Y.length),H;let de,ve=10,Ne=0;for(de=0;de<ne;de++)Ne=(Y[ve]<<8|Y[ve+1])+1,ve+=2;const ke=ve,Le=Y[ve]<<8|Y[ve+1];H.sizeOfInstructions=Le,ve+=2+Le;const $e=ve;let Ee=0;for(de=0;de<Ne;de++){const Ve=Y[ve++];Ve&192&&(Y[ve-1]=Ve&63);let qe=2;Ve&2?qe=1:Ve&16&&(qe=0);let tt=2;Ve&4?tt=1:Ve&32&&(tt=0);const _t=qe+tt;if(Ee+=_t,Ve&8){const Ot=Y[ve++];Ot===0&&(Y[ve-1]^=8),de+=Ot,Ee+=Ot*_t}}if(Ee===0)return H;let pe=ve+Ee;return pe>Y.length?H:!G&&Le>0?(X.set(Y.subarray(0,ke),K),X.set([0,0],K+ke),X.set(Y.subarray($e,pe),K+ke+2),pe-=Le,Y.length-pe>3&&(pe=pe+3&-4),H.length=pe,H):Y.length-pe>3?(pe=pe+3&-4,X.set(Y.subarray(0,pe),K),H.length=pe,H):(X.set(Y,K),H.length=Y.length,H)}function d(B,q,W){const X=B.data,K=Zge(X[0],X[1],X[2],X[3]);K>>16!==1&&(Ht("Attempting to fix invalid version in head table: "+K),X[0]=0,X[1]=1,X[2]=0,X[3]=0);const G=xp(X[50],X[51]);if(G<0||G>1){Ht("Attempting to fix invalid indexToLocFormat in head table: "+G);const H=q+1;if(W===H<<1)X[50]=0,X[51]=0;else if(W===H<<2)X[50]=0,X[51]=1;else throw new fe("Could not fix indexToLocFormat: "+G)}}function p(B,q,W,X,K,G,H){let Y,J,ie;X?(Y=4,J=function(tt,_t){return tt[_t]<<24|tt[_t+1]<<16|tt[_t+2]<<8|tt[_t+3]},ie=function(tt,_t,Ot){tt[_t]=Ot>>>24&255,tt[_t+1]=Ot>>16&255,tt[_t+2]=Ot>>8&255,tt[_t+3]=Ot&255}):(Y=2,J=function(tt,_t){return tt[_t]<<9|tt[_t+1]<<1},ie=function(tt,_t,Ot){tt[_t]=Ot>>9&255,tt[_t+1]=Ot>>1&255});const me=G?W+1:W,oe=Y*(1+me),ne=new Uint8Array(oe);ne.set(B.data.subarray(0,oe)),B.data=ne;const de=q.data,ve=de.length,Ne=new Uint8Array(ve);let ke,Le;const $e=[];for(ke=0,Le=0;ke<W+1;ke++,Le+=Y){let qe=J(ne,Le);qe>ve&&(qe=ve),$e.push({index:ke,offset:qe,endOffset:0})}for($e.sort((qe,tt)=>qe.offset-tt.offset),ke=0;ke<W;ke++)$e[ke].endOffset=$e[ke+1].offset;for($e.sort((qe,tt)=>qe.index-tt.index),ke=0;ke<W;ke++){const{offset:qe,endOffset:tt}=$e[ke];if(qe!==0||tt!==0)break;const _t=$e[ke+1].offset;if(_t!==0){$e[ke].endOffset=_t;break}}const Ee=$e.at(-2);Ee.offset!==0&&Ee.endOffset===0&&(Ee.endOffset=ve);const pe=Object.create(null);let Ve=0;for(ie(ne,0,Ve),ke=0,Le=Y;ke<W;ke++,Le+=Y){const qe=f(de,$e[ke].offset,$e[ke].endOffset,Ne,Ve,K),tt=qe.length;tt===0&&(pe[ke]=!0),qe.sizeOfInstructions>H&&(H=qe.sizeOfInstructions),Ve+=tt,ie(ne,Le,Ve)}if(Ve===0){const qe=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(ke=0,Le=Y;ke<me;ke++,Le+=Y)ie(ne,Le,qe.length);q.data=qe}else if(G){const qe=J(ne,Y);Ne.length>qe+Ve?q.data=Ne.subarray(0,qe+Ve):(q.data=new Uint8Array(qe+Ve),q.data.set(Ne.subarray(0,Ve))),q.data.set(Ne.subarray(0,qe),Ve),ie(B.data,ne.length-Y,Ve+qe)}else q.data=Ne.subarray(0,Ve);return{missingGlyphs:pe,maxSizeOfInstructions:H}}function g(B,q,W){const X=(r.start||0)+B.offset;r.pos=X;const K=B.length,G=X+K,H=r.getInt32();r.skip(28);let Y,J=!0,ie;switch(H){case 65536:Y=BN;break;case 131072:const me=r.getUint16();if(me!==W){J=!1;break}const oe=[];for(ie=0;ie<me;++ie){const ve=r.getUint16();if(ve>=32768){J=!1;break}oe.push(ve)}if(!J)break;const ne=[],de=[];for(;r.pos<G;){const ve=r.getByte();for(de.length=ve,ie=0;ie<ve;++ie)de[ie]=String.fromCharCode(r.getByte());ne.push(de.join(""))}for(Y=[],ie=0;ie<me;++ie){const ve=oe[ie];if(ve<258){Y.push(BN[ve]);continue}Y.push(ne[ve-258])}break;case 196608:break;default:ee("Unknown/unsupported post table version "+H),J=!1,q.defaultEncoding&&(Y=q.defaultEncoding);break}return q.glyphNames=Y,J}function m(B){const q=(r.start||0)+B.offset;r.pos=q;const W=[[],[]],X=[],K=B.length,G=q+K;if(r.getUint16()!==0||K<6)return[W,X];const J=r.getUint16(),ie=r.getUint16(),me=12;let oe,ne;for(oe=0;oe<J&&r.pos+me<=G;oe++){const de={platform:r.getUint16(),encoding:r.getUint16(),language:r.getUint16(),name:r.getUint16(),length:r.getUint16(),offset:r.getUint16()};(nme(de)||aX(de))&&X.push(de)}for(oe=0,ne=X.length;oe<ne;oe++){const de=X[oe];if(de.length<=0)continue;const ve=q+ie+de.offset;if(ve+de.length>G)continue;r.pos=ve;const Ne=de.name;if(de.encoding){let ke="";for(let Le=0,$e=de.length;Le<$e;Le+=2)ke+=String.fromCharCode(r.getUint16());W[1][Ne]=ke}else W[0][Ne]=r.getString(de.length)}return[W,X]}const v=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function y(B,q){let W=B.data,X=0,K,G,H,Y,J,ie=0,me=0;const oe=[],ne=[],de=[];let ve=q.tooComplexToFollowFunctions,Ne=!1,ke=0,Le=0;for(let Ee=W.length;X<Ee;){const pe=W[X++];if(pe===64)if(G=W[X++],Ne||Le)X+=G;else for(K=0;K<G;K++)oe.push(W[X++]);else if(pe===65)if(G=W[X++],Ne||Le)X+=G*2;else for(K=0;K<G;K++)H=W[X++],oe.push(H<<8|W[X++]);else if((pe&248)===176)if(G=pe-176+1,Ne||Le)X+=G;else for(K=0;K<G;K++)oe.push(W[X++]);else if((pe&248)===184)if(G=pe-184+1,Ne||Le)X+=G*2;else for(K=0;K<G;K++)H=W[X++],oe.push(Is(H,W[X++]));else if(pe===43&&!ve){if(!Ne&&!Le){if(Y=oe.at(-1),isNaN(Y))Ht("TT: CALL empty stack (or invalid entry).");else if(q.functionsUsed[Y]=!0,Y in q.functionsStackDeltas){const Ve=oe.length+q.functionsStackDeltas[Y];if(Ve<0){ee("TT: CALL invalid functions stack delta."),q.hintsValid=!1;return}oe.length=Ve}else if(Y in q.functionsDefined&&!de.includes(Y)){if(ne.push({data:W,i:X,stackTop:oe.length-1}),de.push(Y),J=q.functionsDefined[Y],!J){ee("TT: CALL non-existent function"),q.hintsValid=!1;return}W=J.data,X=J.i}}}else if(pe===44&&!ve)(Ne||Le)&&(ee("TT: nested FDEFs not allowed"),ve=!0),Ne=!0,me=X,Y=oe.pop(),q.functionsDefined[Y]={data:W,i:X};else if(pe===45)if(Ne)Ne=!1,ie=X;else{if(J=ne.pop(),!J){ee("TT: ENDF bad stack"),q.hintsValid=!1;return}Y=de.pop(),W=J.data,X=J.i,q.functionsStackDeltas[Y]=oe.length-J.stackTop}else if(pe===137)(Ne||Le)&&(ee("TT: nested IDEFs not allowed"),ve=!0),Ne=!0,me=X;else if(pe===88)++ke;else if(pe===27)Le=ke;else if(pe===89)Le===ke&&(Le=0),--ke;else if(pe===28&&!Ne&&!Le){const Ve=oe.at(-1);Ve>0&&(X+=Ve-1)}if(!Ne&&!Le){let Ve=0;for(pe<=142?Ve=v[pe]:pe>=192&&pe<=223?Ve=-1:pe>=224&&(Ve=-2),pe>=113&&pe<=117&&(G=oe.pop(),isNaN(G)||(Ve=-G*2));Ve<0&&oe.length>0;)oe.pop(),Ve++;for(;Ve>0;)oe.push(NaN),Ve--}}q.tooComplexToFollowFunctions=ve;const $e=[W];X>W.length&&$e.push(new Uint8Array(X-W.length)),me>ie&&(ee("TT: complementing a missing function tail"),$e.push(new Uint8Array([34,45]))),b(B,$e)}function x(B,q){if(!B.tooComplexToFollowFunctions){if(B.functionsDefined.length>q){ee("TT: more functions defined than expected"),B.hintsValid=!1;return}for(let W=0,X=B.functionsUsed.length;W<X;W++){if(W>q){ee("TT: invalid function id: "+W),B.hintsValid=!1;return}if(B.functionsUsed[W]&&!B.functionsDefined[W]){ee("TT: undefined function: "+W),B.hintsValid=!1;return}}}}function b(B,q){if(q.length>1){let W=0,X,K;for(X=0,K=q.length;X<K;X++)W+=q[X].length;W=W+3&-4;const G=new Uint8Array(W);let H=0;for(X=0,K=q.length;X<K;X++)G.set(q[X],H),H+=q[X].length;B.data=G,B.length=W}}function w(B,q,W,X){const K={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(B&&y(B,K),q&&y(q,K),B&&x(K,X),W&&W.length&1){const G=new Uint8Array(W.length+1);G.set(W.data),W.data=G}return K.hintsValid}r=new ln(new Uint8Array(r.getBytes()));let _,S;if(iX(r)){const B=c(r,this.name);_=B.header,S=B.tables}else _=o(r),S=a(r,_.numTables);const C=!S["CFF "];if(C){if(!S.loca)throw new fe('Required "loca" table is not found');S.glyf||(ee('Required "glyf" table is not found -- trying to recover.'),S.glyf={tag:"glyf",data:new Uint8Array(0)}),this.isOpenType=!1}else{if(_.version==="OTTO"&&!n.composite||!S.head||!S.hhea||!S.maxp||!S.post)return this.convert(e,new g8(new ln(S["CFF "].data),n),n);delete S.glyf,delete S.loca,delete S.fpgm,delete S.prep,delete S["cvt "],this.isOpenType=!0}if(!S.maxp)throw new fe('Required "maxp" table is not found');let T;if(!C)try{const q=new zI(new ln(S["CFF "].data),n,Rg).parse();q.duplicateFirstGlyph();const W=new gb(q);S["CFF "].data=W.compile(),T=q.charStringCount}catch{ee("Failed to compile font "+n.loadedName)}r.pos=(r.start||0)+S.maxp.offset;let A=r.getInt32();const k=T??r.getUint16();if(A===20480&&S.maxp.length!==6&&(S.maxp.data=S.maxp.data.subarray(0,6),S.maxp.length=6),A!==65536&&A!==20480){if(S.maxp.length===6)A=20480;else if(S.maxp.length>=32)A=65536;else throw new fe('"maxp" table has a wrong version number');Kge(S.maxp.data,0,A)}let I=xp(S.head.data[50],S.head.data[51]);if(S.loca){const B=I?(k+1)*4:(k+1)*2;if(S.loca.length!==B){ee("Incorrect 'loca' table length -- attempting to fix it.");const q=Object.values(S).filter(Boolean).sort((K,G)=>K.offset-G.offset),W=q.indexOf(S.loca),X=q[W+1]||null;if(X&&S.loca.offset+B<X.offset){const K=r.pos;r.pos=r.start||0,r.skip(S.loca.offset),S.loca.data=r.getBytes(B),S.loca.length=B,r.pos=K}}}if(n.scaleFactors?.length===k&&C){const{scaleFactors:B}=n,q=new Nge({glyfTable:S.glyf.data,isGlyphLocationsLong:I,locaTable:S.loca.data,numGlyphs:k});q.scale(B);const{glyf:W,loca:X,isLocationLong:K}=q.write();S.glyf.data=W,S.loca.data=X,K!==!!I&&(S.head.data[50]=0,I=S.head.data[51]=K?1:0);const G=S.hmtx.data;for(let H=0;H<k;H++){const Y=4*H,J=Math.round(B[H]*xp(G[Y],G[Y+1]));G[Y]=J>>8&255,G[Y+1]=J&255;const ie=Math.round(B[H]*Is(G[Y+2],G[Y+3]));L1(G,Y+2,ie)}}let E=k+1,M=!0;E>65535&&(M=!1,E=k,ee("Not enough space in glyfs to duplicate first glyph."));let R=0,D=0;A>=65536&&S.maxp.length>=32&&(r.pos+=8,r.getUint16()>2&&(S.maxp.data[14]=0,S.maxp.data[15]=2),r.pos+=4,R=r.getUint16(),r.pos+=4,D=r.getUint16()),S.maxp.data[4]=E>>8,S.maxp.data[5]=E&255;const L=w(S.fpgm,S.prep,S["cvt "],R);if(L||(delete S.fpgm,delete S.prep,delete S["cvt "]),h(r,S.hhea,S.hmtx,S.head,E,M),!S.head)throw new fe('Required "head" table is not found');d(S.head,k,C?S.loca.length:0);let P=Object.create(null);if(C){const B=p(S.loca,S.glyf,k,I,L,M,D);P=B.missingGlyphs,A>=65536&&S.maxp.length>=32&&(S.maxp.data[26]=B.maxSizeOfInstructions>>8,S.maxp.data[27]=B.maxSizeOfInstructions&255)}if(!S.hhea)throw new fe('Required "hhea" table is not found');S.hhea.data[10]===0&&S.hhea.data[11]===0&&(S.hhea.data[10]=255,S.hhea.data[11]=255);const O={unitsPerEm:xp(S.head.data[18],S.head.data[19]),yMax:Is(S.head.data[42],S.head.data[43]),yMin:Is(S.head.data[38],S.head.data[39]),ascent:Is(S.hhea.data[4],S.hhea.data[5]),descent:Is(S.hhea.data[6],S.hhea.data[7]),lineGap:Is(S.hhea.data[8],S.hhea.data[9])};this.ascent=O.ascent/O.unitsPerEm,this.descent=O.descent/O.unitsPerEm,this.lineGap=O.lineGap/O.unitsPerEm,this.cssFontInfo?.lineHeight?(this.lineHeight=this.cssFontInfo.metrics.lineHeight,this.lineGap=this.cssFontInfo.metrics.lineGap):this.lineHeight=this.ascent-this.descent+this.lineGap,S.post&&g(S.post,n,k),S.post={tag:"post",data:nO(n)};const $=Object.create(null);function N(B){return!P[B]}if(n.composite){const B=n.cidToGidMap||[],q=B.length===0;n.cMap.forEach(function(W,X){if(typeof X=="string"&&(X=x8(W,X,!0)),X>65535)throw new fe("Max size of CID is 65,535");let K=-1;q?K=X:B[X]!==void 0&&(K=B[X]),K>=0&&K<k&&N(K)&&($[W]=K)})}else{const B=u(S.cmap,r,this.isSymbolicFont,n.hasEncoding),q=B.platformId,W=B.encodingId,X=B.mappings;let K=[],G=!1;if(n.hasEncoding&&(n.baseEncodingName==="MacRomanEncoding"||n.baseEncodingName==="WinAnsiEncoding")&&(K=ix(n.baseEncodingName)),n.hasEncoding&&!this.isSymbolicFont&&(q===3&&W===1||q===1&&W===0)){const H=nc();for(let Y=0;Y<256;Y++){let J;if(this.differences[Y]!==void 0?J=this.differences[Y]:K.length&&K[Y]!==""?J=K[Y]:J=Cu[Y],!J)continue;const ie=Zq(J,H);let me;if(q===3&&W===1?me=H[ie]:q===1&&W===0&&(me=BI.indexOf(ie)),me===void 0){if(!n.glyphNames&&n.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof wo)){const oe=this.toUnicode.get(Y);oe&&(me=oe.codePointAt(0))}if(me===void 0)continue}for(const oe of X)if(oe.charCode===me){$[Y]=oe.glyphId;break}}}else if(q===0){for(const H of X)$[H.charCode]=H.glyphId;G=!0}else if(q===3&&W===0)for(const H of X){let Y=H.charCode;Y>=61440&&Y<=61695&&(Y&=255),$[Y]=H.glyphId}else for(const H of X)$[H.charCode]=H.glyphId;if(n.glyphNames&&(K.length||this.differences.length))for(let H=0;H<256;++H){if(!G&&$[H]!==void 0)continue;const Y=this.differences[H]||K[H];if(!Y)continue;const J=n.glyphNames.indexOf(Y);J>0&&N(J)&&($[H]=J)}}$.length===0&&($[0]=0);let U=E-1;if(M||(U=0),!n.cssFontInfo){const B=eO($,N,U,this.toUnicode);this.toFontChar=B.toFontChar,S.cmap={tag:"cmap",data:tO(B.charCodeToGlyphId,B.toUnicodeExtraMap,E)},(!S["OS/2"]||!ame(S["OS/2"],r))&&(S["OS/2"]={tag:"OS/2",data:rO(n,B.charCodeToGlyphId,O)})}if(!S.name)S.name={tag:"name",data:b8(this.name)};else{const[B,q]=m(S.name);S.name.data=b8(e,B),this.psName=B[0][6]||null,n.composite||qge(n,this.isSymbolicFont,q)}const j=new cx(_.version);for(const B in S)j.addTable(B,S[B].data);return j.toArray()}convert(e,r,n){n.fixedPitch=!1,n.builtInEncoding&&Xge(n,n.builtInEncoding);let i=1;r instanceof g8&&(i=r.numGlyphs-1);const a=r.getGlyphMapping(n);let s=null,o=a,l=null;n.cssFontInfo||(s=eO(a,r.hasGlyphId.bind(r),i,this.toUnicode),this.toFontChar=s.toFontChar,o=s.charCodeToGlyphId,l=s.toUnicodeExtraMap);const c=r.numGlyphs;function u(g,m){let v=null;for(const y in g)m===g[y]&&(v||=[]).push(y|0);return v}function h(g,m){for(const v in g)if(m===g[v])return v|0;return s.charCodeToGlyphId[s.nextAvailableFontCharCode]=m,s.nextAvailableFontCharCode++}const f=r.seacs;if(s&&Rg&&f?.length){const g=n.fontMatrix||Wd,m=r.getCharset(),v=Object.create(null);for(let y in f){y|=0;const x=f[y],b=Cu[x[2]],w=Cu[x[3]],_=m.indexOf(b),S=m.indexOf(w);if(_<0||S<0)continue;const C={x:x[0]*g[0]+x[1]*g[2]+g[4],y:x[0]*g[1]+x[1]*g[3]+g[5]},T=u(a,y);if(T)for(const A of T){const k=s.charCodeToGlyphId,I=h(k,_),E=h(k,S);v[A]={baseFontCharCode:I,accentFontCharCode:E,accentOffset:C}}}n.seacMap=v}const d=n.fontMatrix?1/Math.max(...n.fontMatrix.slice(0,4).map(Math.abs)):1e3,p=new cx("OTTO");return p.addTable("CFF ",r.data),p.addTable("OS/2",rO(n,o)),p.addTable("cmap",tO(o,l,c)),p.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+Mf(d)+"\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0"+Mf(n.descent)+"ÿ"+Mf(n.ascent)+wr(n.italicAngle?2:0)+"\0\0\0\0\0\0\0"),p.addTable("hhea","\0\0\0"+Mf(n.ascent)+Mf(n.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+Mf(n.capHeight)+Mf(Math.tan(n.italicAngle)*n.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+wr(c)),p.addTable("hmtx",(function(){const m=r.charstrings,v=r.cff?r.cff.widths:null;let y="\0\0\0\0";for(let x=1,b=c;x<b;x++){let w=0;if(m){const _=m[x-1];w="width"in _?_.width:0}else v&&(w=Math.ceil(v[x]||0));y+=wr(w)+wr(0)}return y})()),p.addTable("maxp","\0\0P\0"+wr(c)),p.addTable("name",b8(e)),p.addTable("post",nO(n)),p.toArray()}get _spaceWidth(){const e=["space","minus","one","i","I"];let r;for(const n of e){if(n in this.widths){r=this.widths[n];break}const a=nc()[n];let s=0;if(this.composite&&this.cMap.contains(a)&&(s=this.cMap.lookup(a),typeof s=="string"&&(s=x8(a,s))),!s&&this.toUnicode&&(s=this.toUnicode.charCodeOf(a)),s<=0&&(s=a),r=this.widths[s],r)break}return Te(this,"_spaceWidth",r||this.defaultWidth)}_charToGlyph(e,r=!1){let n=this._glyphCache[e];if(n?.isSpace===r)return n;let i,a,s,o=e;this.cMap?.contains(e)&&(o=this.cMap.lookup(e),typeof o=="string"&&(o=x8(e,o))),a=this.widths[o],typeof a!="number"&&(a=this.defaultWidth);const l=this.vmetrics?.[o];let c=this.toUnicode.get(e)||e;typeof c=="number"&&(c=String.fromCharCode(c));let u=this.toFontChar[e]!==void 0;if(i=this.toFontChar[e]||e,this.missingFile){const d=this.differences[e]||this.defaultEncoding[e];(d===".notdef"||d==="")&&this.type==="Type1"&&(i=32,d===""&&(a||=this._spaceWidth,c=String.fromCharCode(i))),i=tge(i)}this.isType3Font&&(s=i);let h=null;if(this.seacMap?.[e]){u=!0;const d=this.seacMap[e];i=d.baseFontCharCode,h={fontChar:String.fromCodePoint(d.accentFontCharCode),offset:d.accentOffset}}let f="";if(typeof i=="number"&&(i<=1114111?f=String.fromCodePoint(i):ee(`charToGlyph - invalid fontCharCode: ${i}`)),this.missingFile&&this.vertical&&f.length===1){const d=sge()[f.charCodeAt(0)];d&&(f=c=String.fromCharCode(d))}return n=new Yge(e,f,c,h,a,l,s,r,u),this._glyphCache[e]=n}charsToGlyphs(e){let r=this._charsCache[e];if(r)return r;if(r=[],this.cMap){const n=Object.create(null),i=e.length;let a=0;for(;a<i;){this.cMap.readCharCode(e,a,n);const{charcode:s,length:o}=n;a+=o;const l=this._charToGlyph(s,o===1&&e.charCodeAt(a-1)===32);r.push(l)}}else for(let n=0,i=e.length;n<i;++n){const a=e.charCodeAt(n),s=this._charToGlyph(a,a===32);r.push(s)}return this._charsCache[e]=r}getCharPositions(e){const r=[];if(this.cMap){const n=Object.create(null);let i=0;for(;i<e.length;){this.cMap.readCharCode(e,i,n);const a=n.length;r.push([i,i+a]),i+=a}}else for(let n=0,i=e.length;n<i;++n)r.push([n,n+1]);return r}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){const r=[],n=[],i=()=>r.length%2===1,a=this.toUnicode instanceof wo?s=>this.toUnicode.charCodeOf(s):s=>this.toUnicode.charCodeOf(String.fromCodePoint(s));for(let s=0,o=e.length;s<o;s++){const l=e.codePointAt(s);if(l>55295&&(l<57344||l>65533)&&s++,this.toUnicode){const c=a(l);if(c!==-1){i()&&(r.push(n.join("")),n.length=0);const u=this.cMap?this.cMap.getCharCodeLength(c):1;for(let h=u-1;h>=0;h--)n.push(String.fromCharCode(c>>8*h&255));continue}}i()||(r.push(n.join("")),n.length=0),n.push(String.fromCodePoint(l))}return r.push(n.join("")),r}}class aO{constructor(e){this.error=e,this.loadedName="g_font_error",this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(){return{error:this.error}}}let sO=class __{#e;#t;#n;static strings=["fontFamily","fontWeight","italicAngle"];static write(e){const r=new TextEncoder,n={};let i=0;for(const c of __.strings){const u=r.encode(e[c]);n[c]=u,i+=4+u.length}const a=new ArrayBuffer(i),s=new Uint8Array(a),o=new DataView(a);let l=0;for(const c of __.strings){const u=n[c],h=u.length;o.setUint32(l,h),s.set(u,l+4),l+=4+h}return Ir(l===a.byteLength,"CssFontInfo.write: Buffer overflow"),a}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}#r(e){Ir(e<__.strings.length,"Invalid string index");let r=0;for(let i=0;i<e;i++)r+=this.#t.getUint32(r)+4;const n=this.#t.getUint32(r);return this.#n.decode(new Uint8Array(this.#e,r+4,n))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}},oO=class S_{#e;#t;#n;static strings=["css","loadedName","baseFontName","src"];static write(e){const r=new TextEncoder,n={};let i=0;for(const f of S_.strings){const d=r.encode(e[f]);n[f]=d,i+=4+d.length}i+=4;let a,s,o=1+i;e.style&&(a=r.encode(e.style.style),s=r.encode(e.style.weight),o+=4+a.length+4+s.length);const l=new ArrayBuffer(o),c=new Uint8Array(l),u=new DataView(l);let h=0;u.setUint8(h++,e.guessFallback?1:0),u.setUint32(h,0),h+=4,i=0;for(const f of S_.strings){const d=n[f],p=d.length;i+=4+p,u.setUint32(h,p),c.set(d,h+4),h+=4+p}return u.setUint32(h-i-4,i),e.style&&(u.setUint32(h,a.length),c.set(a,h+4),h+=4+a.length,u.setUint32(h,s.length),c.set(s,h+4),h+=4+s.length),Ir(h<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(h)}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}get guessFallback(){return this.#t.getUint8(0)!==0}#r(e){Ir(e<S_.strings.length,"Invalid string index");let r=5;for(let i=0;i<e;i++)r+=this.#t.getUint32(r)+4;const n=this.#t.getUint32(r);return this.#n.decode(new Uint8Array(this.#e,r+4,n))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let e=1;e+=4+this.#t.getUint32(e);const r=this.#t.getUint32(e),n=this.#n.decode(new Uint8Array(this.#e,e+4,r));e+=4+r;const i=this.#t.getUint32(e),a=this.#n.decode(new Uint8Array(this.#e,e+4,i));return{style:n,weight:a}}},ome=class en{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#e=Math.ceil(this.bools.length*2/8);static#t=this.#e+this.numbers.length*8;static#n=this.#t+1+8;static#r=this.#n+1+48;static#i=this.#r+1+6;#a;#s;#o;constructor({data:e,extra:r}){this.#a=e,this.#s=new TextDecoder,this.#o=new DataView(this.#a),r&&Object.assign(this,r)}#l(e){Ir(e<en.bools.length,"Invalid boolean index");const r=Math.floor(e/4),n=e*2%8,i=this.#o.getUint8(r)>>n&3;return i===0?void 0:i===2}get black(){return this.#l(0)}get bold(){return this.#l(1)}get disableFontFace(){return this.#l(2)}get fontExtraProperties(){return this.#l(3)}get isInvalidPDFjsFont(){return this.#l(4)}get isType3Font(){return this.#l(5)}get italic(){return this.#l(6)}get missingFile(){return this.#l(7)}get remeasure(){return this.#l(8)}get vertical(){return this.#l(9)}#c(e){return Ir(e<en.numbers.length,"Invalid number index"),this.#o.getFloat64(en.#e+e*8)}get ascent(){return this.#c(0)}get defaultWidth(){return this.#c(1)}get descent(){return this.#c(2)}get bbox(){let e=en.#t;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<4;i++)n.push(this.#o.getInt16(e,!0)),e+=2;return n}get fontMatrix(){let e=en.#n;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<6;i++)n.push(this.#o.getFloat64(e,!0)),e+=8;return n}get defaultVMetrics(){let e=en.#r;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<3;i++)n.push(this.#o.getInt16(e,!0)),e+=2;return n}#f(e){Ir(e<en.strings.length,"Invalid string index");let r=en.#i+4;for(let a=0;a<e;a++)r+=this.#o.getUint32(r)+4;const n=this.#o.getUint32(r),i=new Uint8Array(n);return i.set(new Uint8Array(this.#a,r+4,n)),this.#s.decode(i)}get fallbackName(){return this.#f(0)}get loadedName(){return this.#f(1)}get mimetype(){return this.#f(2)}get name(){return this.#f(3)}get data(){let e=en.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);e+=4+i;const a=this.#o.getUint32(e);if(a!==0)return new Uint8Array(this.#a,e+4,a)}clearData(){let e=en.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);e+=4+i;const a=this.#o.getUint32(e);new Uint8Array(this.#a,e+4,a).fill(0),this.#o.setUint32(e,0)}get cssFontInfo(){let e=en.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);if(i===0)return null;const a=new Uint8Array(i);return a.set(new Uint8Array(this.#a,e+4,i)),new sO(a.buffer)}get systemFontInfo(){let e=en.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);if(n===0)return null;const i=new Uint8Array(n);return i.set(new Uint8Array(this.#a,e+4,n)),new oO(i.buffer)}static write(e){const r=e.systemFontInfo?oO.write(e.systemFontInfo):null,n=e.cssFontInfo?sO.write(e.cssFontInfo):null,i=new TextEncoder,a={};let s=0;for(const g of en.strings)a[g]=i.encode(e[g]),s+=4+a[g].length;const o=en.#i+4+s+4+(r?r.byteLength:0)+4+(n?n.byteLength:0)+4+(e.data?e.data.length:0),l=new ArrayBuffer(o),c=new Uint8Array(l),u=new DataView(l);let h=0;const f=en.bools.length;let d=0,p=0;for(let g=0;g<f;g++){const m=e[en.bools[g]];d|=(m===void 0?0:m?2:1)<<p,p+=2,(p===8||g===f-1)&&(u.setUint8(h++,d),d=0,p=0)}Ir(h===en.#e,"FontInfo.write: Boolean properties offset mismatch");for(const g of en.numbers)u.setFloat64(h,e[g]),h+=8;if(Ir(h===en.#t,"FontInfo.write: Number properties offset mismatch"),e.bbox){u.setUint8(h++,4);for(const g of e.bbox)u.setInt16(h,g,!0),h+=2}else u.setUint8(h++,0),h+=8;if(Ir(h===en.#n,"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){u.setUint8(h++,6);for(const g of e.fontMatrix)u.setFloat64(h,g,!0),h+=8}else u.setUint8(h++,0),h+=48;if(Ir(h===en.#r,"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){u.setUint8(h++,1);for(const g of e.defaultVMetrics)u.setInt16(h,g,!0),h+=2}else u.setUint8(h++,0),h+=6;Ir(h===en.#i,"FontInfo.write: DefaultVMetrics properties offset mismatch"),u.setUint32(en.#i,0),h+=4;for(const g of en.strings){const m=a[g],v=m.length;u.setUint32(h,v),c.set(m,h+4),h+=4+v}if(u.setUint32(en.#i,h-en.#i-4),!r)u.setUint32(h,0),h+=4;else{const g=r.byteLength;u.setUint32(h,g),Ir(h+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(r),h+4),h+=4+g}if(!n)u.setUint32(h,0),h+=4;else{const g=n.byteLength;u.setUint32(h,g),Ir(h+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(n),h+4),h+=4+g}return e.data===void 0?(u.setUint32(h,0),h+=4):(u.setUint32(h,e.data.length),c.set(e.data,h+4),h+=4+e.data.length),Ir(h<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(h)}},lme=class qi{static#e=0;static#t=1;static#n=2;static#r=3;static#i=4;static#a=8;static#s=12;static#o=16;constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let r,n=null,i=[],a=[],s=[],o=[],l=null,c=null;switch(e[0]){case"RadialAxial":r=e[1]==="axial"?1:2,n=e[2],s=e[3],r===1?i.push(...e[4],...e[5]):i.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":r=3,l=e[1],i=e[2],a=e[3],o=e[4]||[],n=e[6],c=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}const u=Math.floor(i.length/2),h=Math.floor(a.length/3),f=s.length,d=o.length;let p=0;for(const w of o)p+=1,p=Math.ceil(p/4)*4,p+=4+w.coords.length*4,p+=4+w.colors.length*4,w.verticesPerRow!==void 0&&(p+=4);const g=20+u*8+h*3+f*8+(n?16:0)+(c?3:0)+p,m=new ArrayBuffer(g),v=new DataView(m),y=new Uint8Array(m);v.setUint8(qi.#e,r),v.setUint8(qi.#t,n?1:0),v.setUint8(qi.#n,c?1:0),v.setUint8(qi.#r,l),v.setUint32(qi.#i,u,!0),v.setUint32(qi.#a,h,!0),v.setUint32(qi.#s,f,!0),v.setUint32(qi.#o,d,!0);let x=20;new Float32Array(m,x,u*2).set(i),x+=u*8,y.set(a,x),x+=h*3;for(const[w,_]of s)v.setFloat32(x,w,!0),x+=4,v.setUint32(x,parseInt(_.slice(1),16),!0),x+=4;if(n)for(const w of n)v.setFloat32(x,w,!0),x+=4;c&&(y.set(c,x),x+=3);for(let w=0;w<o.length;w++){const _=o[w];v.setUint8(x,_.type),x+=1,x=Math.ceil(x/4)*4,v.setUint32(x,_.coords.length,!0),x+=4,new Int32Array(m,x,_.coords.length).set(_.coords),x+=_.coords.length*4,v.setUint32(x,_.colors.length,!0),x+=4,new Int32Array(m,x,_.colors.length).set(_.colors),x+=_.colors.length*4,_.verticesPerRow!==void 0&&(v.setUint32(x,_.verticesPerRow,!0),x+=4)}return m}getIR(){const e=this.view,r=this.data[qi.#e],n=!!this.data[qi.#t],i=!!this.data[qi.#n],a=e.getUint32(qi.#i,!0),s=e.getUint32(qi.#a,!0),o=e.getUint32(qi.#s,!0),l=e.getUint32(qi.#o,!0);let c=20;const u=new Float32Array(this.buffer,c,a*2);c+=a*8;const h=new Uint8Array(this.buffer,c,s*3);c+=s*3;const f=[];for(let m=0;m<o;++m){const v=e.getFloat32(c,!0);c+=4;const y=e.getUint32(c,!0);c+=4,f.push([v,`#${y.toString(16).padStart(6,"0")}`])}let d=null;if(n){d=[];for(let m=0;m<4;++m)d.push(e.getFloat32(c,!0)),c+=4}let p=null;i&&(p=new Uint8Array(this.buffer,c,3),c+=3);const g=[];for(let m=0;m<l;++m){const v=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;const y=e.getUint32(c,!0);c+=4;const x=new Int32Array(this.buffer,c,y);c+=y*4;const b=e.getUint32(c,!0);c+=4;const w=new Int32Array(this.buffer,c,b);c+=b*4;const _={type:v,coords:x,colors:w};v===cd.LATTICE&&(_.verticesPerRow=e.getUint32(c,!0),c+=4),g.push(_)}if(r===1)return["RadialAxial","axial",d,f,Array.from(u.slice(0,2)),Array.from(u.slice(2,4)),null,null];if(r===2)return["RadialAxial","radial",d,f,[u[0],u[1]],[u[3],u[4]],u[2],u[5]];if(r===3){const m=this.data[qi.#r];let v=null;if(u.length>0){let y=u[0],x=u[0],b=u[1],w=u[1];for(let _=0;_<u.length;_+=2){const S=u[_],C=u[_+1];y=y>S?S:y,b=b>C?C:b,x=x<S?S:x,w=w<C?C:w}v=[y,b,x,w]}return["Mesh",m,u,h,g,v,d,p]}throw new Error(`Unsupported pattern kind: ${r}`)}},cme=class{static write(e){let r,n;return oa.isFloat16ArraySupported?(n=new ArrayBuffer(e.length*2),r=new Float16Array(n)):(n=new ArrayBuffer(e.length*4),r=new Float32Array(n)),r.set(e),n}#e;constructor(e){this.#e=e}get path(){return oa.isFloat16ArraySupported?new Float16Array(this.#e):new Float32Array(this.#e)}};const za={FUNCTION_BASED:1,AXIAL:2,RADIAL:3,FREE_FORM_MESH:4,LATTICE_FORM_MESH:5,COONS_PATCH_MESH:6,TENSOR_PATCH_MESH:7};class ume{constructor(){tr("Cannot initialize Pattern.")}static parseShading(e,r,n,i,a,s){const o=e instanceof Pt?e.dict:e,l=o.get("ShadingType");try{switch(l){case za.AXIAL:case za.RADIAL:return new hme(o,r,n,i,a,s);case za.FREE_FORM_MESH:case za.LATTICE_FORM_MESH:case za.COONS_PATCH_MESH:case za.TENSOR_PATCH_MESH:return new yh(e,r,n,i,a,s);default:throw new fe("Unsupported ShadingType: "+l)}}catch(c){if(c instanceof tn)throw c;return ee(c),new gme}}}class wy{static SMALL_NUMBER=1e-6;getIR(){tr("Abstract method `getIR` called.")}}class hme extends wy{constructor(e,r,n,i,a,s){super(),this.shadingType=e.get("ShadingType");let o=0;if(this.shadingType===za.AXIAL?o=4:this.shadingType===za.RADIAL&&(o=6),this.coordsArr=e.getArray("Coords"),!Ua(this.coordsArr,o))throw new fe("RadialAxialShading: Invalid /Coords array.");const l=pr.parse({cs:e.getRaw("CS")||e.getRaw("ColorSpace"),xref:r,resources:n,pdfFunctionFactory:i,globalColorSpaceCache:a,localColorSpaceCache:s});this.bbox=Nu(e.getArray("BBox"),null);let c=0,u=1;const h=e.getArray("Domain");Ua(h,2)&&([c,u]=h);let f=!1,d=!1;const p=e.getArray("Extend");if(m0e(p,2)&&([f,d]=p),this.shadingType===za.RADIAL&&(!f||!d)){const[U,j,B,q,W,X]=this.coordsArr,K=Math.hypot(U-q,j-W);B<=X+K&&X<=B+K&&ee("Unsupported radial gradient.")}this.extendStart=f,this.extendEnd=d;const g=e.getRaw("Function"),m=i.create(g,!0),v=840,y=(u-c)/v,x=this.colorStops=[];if(c>=u||y<=0){Ht("Bad shading domain.");return}const b=new Float32Array(l.numComps),w=new Float32Array(1);let _=0;w[0]=c,m(w,0,b,0);const S=new Uint8ClampedArray(3);l.getRgb(b,0,S);let[C,T,A]=S;x.push([0,mr.makeHexColor(C,T,A)]);let k=1;w[0]=c+y,m(w,0,b,0),l.getRgb(b,0,S);let[I,E,M]=S,R=I-C+1,D=E-T+1,L=M-A+1,P=I-C-1,O=E-T-1,$=M-A-1;for(let U=2;U<v;U++){w[0]=c+U*y,m(w,0,b,0),l.getRgb(b,0,S);const[j,B,q]=S,W=U-_;if(R=Math.min(R,(j-C+1)/W),D=Math.min(D,(B-T+1)/W),L=Math.min(L,(q-A+1)/W),P=Math.max(P,(j-C-1)/W),O=Math.max(O,(B-T-1)/W),$=Math.max($,(q-A-1)/W),!(P<=R&&O<=D&&$<=L)){const K=mr.makeHexColor(I,E,M);x.push([k/v,K]),R=j-I+1,D=B-E+1,L=q-M+1,P=j-I-1,O=B-E-1,$=q-M-1,_=k,C=I,T=E,A=M}k=U,I=j,E=B,M=q}x.push([1,mr.makeHexColor(I,E,M)]);let N="transparent";e.has("Background")&&(N=l.getRgbHex(e.get("Background"),0)),f||(x.unshift([0,N]),x[1][0]+=wy.SMALL_NUMBER),d||(x.at(-1)[0]-=wy.SMALL_NUMBER,x.push([1,N])),this.colorStops=x}getIR(){const{coordsArr:e,shadingType:r}=this;let n,i,a,s,o;return r===za.AXIAL?(i=[e[0],e[1]],a=[e[2],e[3]],s=null,o=null,n="axial"):r===za.RADIAL?(i=[e[0],e[1]],a=[e[3],e[4]],s=e[2],o=e[5],n="radial"):tr(`getPattern type unknown: ${r}`),["RadialAxial",n,this.bbox,this.colorStops,i,a,s,o]}}class fme{constructor(e,r){this.stream=e,this.context=r,this.buffer=0,this.bufferLength=0;const n=r.numComps;this.tmpCompsBuf=new Float32Array(n);const i=r.colorSpace.numComps;this.tmpCsCompsBuf=r.colorFn?new Float32Array(i):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const e=this.stream.getByte();return e<0?!1:(this.buffer=e,this.bufferLength=8,!0)}readBits(e){const{stream:r}=this;let{buffer:n,bufferLength:i}=this;if(e===32){if(i===0)return r.getInt32()>>>0;n=n<<24|r.getByte()<<16|r.getByte()<<8|r.getByte();const a=r.getByte();return this.buffer=a&(1<<i)-1,(n<<8-i|(a&255)>>i)>>>0}if(e===8&&i===0)return r.getByte();for(;i<e;)n=n<<8|r.getByte(),i+=8;return i-=e,this.bufferLength=i,this.buffer=n&(1<<i)-1,n>>i}align(){this.buffer=0,this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const{bitsPerCoordinate:e,decode:r}=this.context,n=this.readBits(e),i=this.readBits(e),a=e<32?1/((1<<e)-1):23283064365386963e-26;return[n*a*(r[1]-r[0])+r[0],i*a*(r[3]-r[2])+r[2]]}readComponents(){const{bitsPerComponent:e,colorFn:r,colorSpace:n,decode:i,numComps:a}=this.context,s=e<32?1/((1<<e)-1):23283064365386963e-26,o=this.tmpCompsBuf;for(let c=0,u=4;c<a;c++,u+=2){const h=this.readBits(e);o[c]=h*s*(i[u+1]-i[u])+i[u]}const l=this.tmpCsCompsBuf;return r?.(o,0,l,0),n.getRgb(l,0)}}let sX=Object.create(null);function dme(t){const e=[];for(let r=0;r<=t;r++){const n=r/t,i=1-n;e.push(new Float32Array([i**3,3*n*i**2,3*n**2*i,n**3]))}return e}function lO(t){return sX[t]||=dme(t)}function pme(){sX=Object.create(null)}class yh extends wy{static MIN_SPLIT_PATCH_CHUNKS_AMOUNT=3;static MAX_SPLIT_PATCH_CHUNKS_AMOUNT=20;static TRIANGLE_DENSITY=20;constructor(e,r,n,i,a,s){if(super(),!(e instanceof Pt))throw new fe("Mesh data is not a stream");const o=e.dict;this.shadingType=o.get("ShadingType"),this.bbox=Nu(o.getArray("BBox"),null);const l=pr.parse({cs:o.getRaw("CS")||o.getRaw("ColorSpace"),xref:r,resources:n,pdfFunctionFactory:i,globalColorSpaceCache:a,localColorSpaceCache:s});this.background=o.has("Background")?l.getRgb(o.get("Background"),0):null;const c=o.getRaw("Function"),u=c?i.create(c,!0):null;this.coords=[],this.colors=[],this.figures=[];const h={bitsPerCoordinate:o.get("BitsPerCoordinate"),bitsPerComponent:o.get("BitsPerComponent"),bitsPerFlag:o.get("BitsPerFlag"),decode:o.getArray("Decode"),colorFn:u,colorSpace:l,numComps:u?1:l.numComps},f=new fme(e,h);let d=!1;switch(this.shadingType){case za.FREE_FORM_MESH:this._decodeType4Shading(f);break;case za.LATTICE_FORM_MESH:const p=o.get("VerticesPerRow")|0;if(p<2)throw new fe("Invalid VerticesPerRow");this._decodeType5Shading(f,p);break;case za.COONS_PATCH_MESH:this._decodeType6Shading(f),d=!0;break;case za.TENSOR_PATCH_MESH:this._decodeType7Shading(f),d=!0;break;default:tr("Unsupported mesh type.");break}if(d){this._updateBounds();for(let p=0,g=this.figures.length;p<g;p++)this._buildFigureFromPatch(p)}this._updateBounds(),this._packData()}_decodeType4Shading(e){const r=this.coords,n=this.colors,i=[];let a=0;for(;e.hasData;){const s=e.readFlag(),o=e.readCoordinate(),l=e.readComponents();if(a===0){if(!(0<=s&&s<=2))throw new fe("Unknown type4 flag");switch(s){case 0:a=3;break;case 1:i.push(i.at(-2),i.at(-1)),a=1;break;case 2:i.push(i.at(-3),i.at(-1)),a=1;break}}i.push(r.length),r.push(o),n.push(l),a--,e.align()}this.figures.push({type:cd.TRIANGLES,coords:new Int32Array(i),colors:new Int32Array(i)})}_decodeType5Shading(e,r){const n=this.coords,i=this.colors,a=[];for(;e.hasData;){const s=e.readCoordinate(),o=e.readComponents();a.push(n.length),n.push(s),i.push(o)}this.figures.push({type:cd.LATTICE,coords:new Int32Array(a),colors:new Int32Array(a),verticesPerRow:r})}_decodeType6Shading(e){const r=this.coords,n=this.colors,i=new Int32Array(16),a=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new fe("Unknown type6 flag");const o=r.length;for(let d=0,p=s!==0?8:12;d<p;d++)r.push(e.readCoordinate());const l=n.length;for(let d=0,p=s!==0?2:4;d<p;d++)n.push(e.readComponents());let c,u,h,f;switch(s){case 0:i[12]=o+3,i[13]=o+4,i[14]=o+5,i[15]=o+6,i[8]=o+2,i[11]=o+7,i[4]=o+1,i[7]=o+8,i[0]=o,i[1]=o+11,i[2]=o+10,i[3]=o+9,a[2]=l+1,a[3]=l+2,a[0]=l,a[1]=l+3;break;case 1:c=i[12],u=i[13],h=i[14],f=i[15],i[12]=f,i[13]=o+0,i[14]=o+1,i[15]=o+2,i[8]=h,i[11]=o+3,i[4]=u,i[7]=o+4,i[0]=c,i[1]=o+7,i[2]=o+6,i[3]=o+5,c=a[2],u=a[3],a[2]=u,a[3]=l,a[0]=c,a[1]=l+1;break;case 2:c=i[15],u=i[11],i[12]=i[3],i[13]=o+0,i[14]=o+1,i[15]=o+2,i[8]=i[7],i[11]=o+3,i[4]=u,i[7]=o+4,i[0]=c,i[1]=o+7,i[2]=o+6,i[3]=o+5,c=a[3],a[2]=a[1],a[3]=l,a[0]=c,a[1]=l+1;break;case 3:i[12]=i[0],i[13]=o+0,i[14]=o+1,i[15]=o+2,i[8]=i[1],i[11]=o+3,i[4]=i[2],i[7]=o+4,i[0]=i[3],i[1]=o+7,i[2]=o+6,i[3]=o+5,a[2]=a[0],a[3]=l,a[0]=a[1],a[1]=l+1;break}i[5]=r.length,r.push([(-4*r[i[0]][0]-r[i[15]][0]+6*(r[i[4]][0]+r[i[1]][0])-2*(r[i[12]][0]+r[i[3]][0])+3*(r[i[13]][0]+r[i[7]][0]))/9,(-4*r[i[0]][1]-r[i[15]][1]+6*(r[i[4]][1]+r[i[1]][1])-2*(r[i[12]][1]+r[i[3]][1])+3*(r[i[13]][1]+r[i[7]][1]))/9]),i[6]=r.length,r.push([(-4*r[i[3]][0]-r[i[12]][0]+6*(r[i[2]][0]+r[i[7]][0])-2*(r[i[0]][0]+r[i[15]][0])+3*(r[i[4]][0]+r[i[14]][0]))/9,(-4*r[i[3]][1]-r[i[12]][1]+6*(r[i[2]][1]+r[i[7]][1])-2*(r[i[0]][1]+r[i[15]][1])+3*(r[i[4]][1]+r[i[14]][1]))/9]),i[9]=r.length,r.push([(-4*r[i[12]][0]-r[i[3]][0]+6*(r[i[8]][0]+r[i[13]][0])-2*(r[i[0]][0]+r[i[15]][0])+3*(r[i[11]][0]+r[i[1]][0]))/9,(-4*r[i[12]][1]-r[i[3]][1]+6*(r[i[8]][1]+r[i[13]][1])-2*(r[i[0]][1]+r[i[15]][1])+3*(r[i[11]][1]+r[i[1]][1]))/9]),i[10]=r.length,r.push([(-4*r[i[15]][0]-r[i[0]][0]+6*(r[i[11]][0]+r[i[14]][0])-2*(r[i[12]][0]+r[i[3]][0])+3*(r[i[2]][0]+r[i[8]][0]))/9,(-4*r[i[15]][1]-r[i[0]][1]+6*(r[i[11]][1]+r[i[14]][1])-2*(r[i[12]][1]+r[i[3]][1])+3*(r[i[2]][1]+r[i[8]][1]))/9]),this.figures.push({type:cd.PATCH,coords:new Int32Array(i),colors:new Int32Array(a)})}}_decodeType7Shading(e){const r=this.coords,n=this.colors,i=new Int32Array(16),a=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new fe("Unknown type7 flag");const o=r.length;for(let d=0,p=s!==0?12:16;d<p;d++)r.push(e.readCoordinate());const l=n.length;for(let d=0,p=s!==0?2:4;d<p;d++)n.push(e.readComponents());let c,u,h,f;switch(s){case 0:i[12]=o+3,i[13]=o+4,i[14]=o+5,i[15]=o+6,i[8]=o+2,i[9]=o+13,i[10]=o+14,i[11]=o+7,i[4]=o+1,i[5]=o+12,i[6]=o+15,i[7]=o+8,i[0]=o,i[1]=o+11,i[2]=o+10,i[3]=o+9,a[2]=l+1,a[3]=l+2,a[0]=l,a[1]=l+3;break;case 1:c=i[12],u=i[13],h=i[14],f=i[15],i[12]=f,i[13]=o+0,i[14]=o+1,i[15]=o+2,i[8]=h,i[9]=o+9,i[10]=o+10,i[11]=o+3,i[4]=u,i[5]=o+8,i[6]=o+11,i[7]=o+4,i[0]=c,i[1]=o+7,i[2]=o+6,i[3]=o+5,c=a[2],u=a[3],a[2]=u,a[3]=l,a[0]=c,a[1]=l+1;break;case 2:c=i[15],u=i[11],i[12]=i[3],i[13]=o+0,i[14]=o+1,i[15]=o+2,i[8]=i[7],i[9]=o+9,i[10]=o+10,i[11]=o+3,i[4]=u,i[5]=o+8,i[6]=o+11,i[7]=o+4,i[0]=c,i[1]=o+7,i[2]=o+6,i[3]=o+5,c=a[3],a[2]=a[1],a[3]=l,a[0]=c,a[1]=l+1;break;case 3:i[12]=i[0],i[13]=o+0,i[14]=o+1,i[15]=o+2,i[8]=i[1],i[9]=o+9,i[10]=o+10,i[11]=o+3,i[4]=i[2],i[5]=o+8,i[6]=o+11,i[7]=o+4,i[0]=i[3],i[1]=o+7,i[2]=o+6,i[3]=o+5,a[2]=a[0],a[3]=l,a[0]=a[1],a[1]=l+1;break}this.figures.push({type:cd.PATCH,coords:new Int32Array(i),colors:new Int32Array(a)})}}_buildFigureFromPatch(e){const r=this.figures[e];Ir(r.type===cd.PATCH,"Unexpected patch mesh figure");const n=this.coords,i=this.colors,a=r.coords,s=r.colors,o=Math.min(n[a[0]][0],n[a[3]][0],n[a[12]][0],n[a[15]][0]),l=Math.min(n[a[0]][1],n[a[3]][1],n[a[12]][1],n[a[15]][1]),c=Math.max(n[a[0]][0],n[a[3]][0],n[a[12]][0],n[a[15]][0]),u=Math.max(n[a[0]][1],n[a[3]][1],n[a[12]][1],n[a[15]][1]);let h=Math.ceil((c-o)*yh.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));h=Li(h,yh.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,yh.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let f=Math.ceil((u-l)*yh.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));f=Li(f,yh.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,yh.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);const d=h+1,p=new Int32Array((f+1)*d),g=new Int32Array((f+1)*d);let m=0;const v=new Uint8Array(3),y=new Uint8Array(3),x=i[s[0]],b=i[s[1]],w=i[s[2]],_=i[s[3]],S=lO(f),C=lO(h);for(let T=0;T<=f;T++){v[0]=(x[0]*(f-T)+w[0]*T)/f|0,v[1]=(x[1]*(f-T)+w[1]*T)/f|0,v[2]=(x[2]*(f-T)+w[2]*T)/f|0,y[0]=(b[0]*(f-T)+_[0]*T)/f|0,y[1]=(b[1]*(f-T)+_[1]*T)/f|0,y[2]=(b[2]*(f-T)+_[2]*T)/f|0;for(let A=0;A<=h;A++,m++){if((T===0||T===f)&&(A===0||A===h))continue;let k=0,I=0,E=0;for(let R=0;R<=3;R++)for(let D=0;D<=3;D++,E++){const L=S[T][R]*C[A][D];k+=n[a[E]][0]*L,I+=n[a[E]][1]*L}p[m]=n.length,n.push([k,I]),g[m]=i.length;const M=new Uint8Array(3);M[0]=(v[0]*(h-A)+y[0]*A)/h|0,M[1]=(v[1]*(h-A)+y[1]*A)/h|0,M[2]=(v[2]*(h-A)+y[2]*A)/h|0,i.push(M)}}p[0]=a[0],g[0]=s[0],p[h]=a[3],g[h]=s[1],p[d*f]=a[12],g[d*f]=s[2],p[d*f+h]=a[15],g[d*f+h]=s[3],this.figures[e]={type:cd.LATTICE,coords:p,colors:g,verticesPerRow:d}}_updateBounds(){let e=this.coords[0][0],r=this.coords[0][1],n=e,i=r;for(let a=1,s=this.coords.length;a<s;a++){const o=this.coords[a][0],l=this.coords[a][1];e=e>o?o:e,r=r>l?l:r,n=n<o?o:n,i=i<l?l:i}this.bounds=[e,r,n,i]}_packData(){let e,r,n,i;const a=this.coords,s=new Float32Array(a.length*2);for(e=0,n=0,r=a.length;e<r;e++){const u=a[e];s[n++]=u[0],s[n++]=u[1]}this.coords=s;const o=this.colors,l=new Uint8Array(o.length*3);for(e=0,n=0,r=o.length;e<r;e++){const u=o[e];l[n++]=u[0],l[n++]=u[1],l[n++]=u[2]}this.colors=l;const c=this.figures;for(e=0,r=c.length;e<r;e++){const u=c[e],h=u.coords,f=u.colors;for(n=0,i=h.length;n<i;n++)h[n]*=2,f[n]*=3}}getIR(){const{bounds:e}=this;if(e[2]-e[0]===0||e[3]-e[1]===0)throw new fe(`Invalid MeshShading bounds: [${e}].`);return["Mesh",this.shadingType,this.coords,this.colors,this.figures,e,this.bbox,this.background]}}class gme extends wy{getIR(){return["Dummy"]}}function cO(t,e,r){const n=Eh(e.getArray("Matrix"),al),i=Nu(e.getArray("BBox"),null);if(!i||i[2]-i[0]===0||i[3]-i[1]===0)throw new fe("Invalid getTilingPatternIR /BBox array.");const a=e.get("XStep");if(typeof a!="number")throw new fe("Invalid getTilingPatternIR /XStep value.");const s=e.get("YStep");if(typeof s!="number")throw new fe("Invalid getTilingPatternIR /YStep value.");const o=e.get("PaintType");if(!Number.isInteger(o))throw new fe("Invalid getTilingPatternIR /PaintType value.");const l=e.get("TilingType");if(!Number.isInteger(l))throw new fe("Invalid getTilingPatternIR /TilingType value.");return["TilingPattern",r,t,n,i,a,s,o,l]}const mme=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],vme={lineHeight:1.2207,lineGap:.2207},yme=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],xme={lineHeight:1.2207,lineGap:.2207},bme=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],wme={lineHeight:1.2207,lineGap:.2207},_me=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1],Sme={lineHeight:1.2207,lineGap:.2207},Cme=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Ame={lineHeight:1.2,lineGap:.2},Tme=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],kme={lineHeight:1.35,lineGap:.2},Eme=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Ime={lineHeight:1.35,lineGap:.2},Dme=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Mme={lineHeight:1.2,lineGap:.2},P1=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],R1=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],N1=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],O1=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],B1=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],F1=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],$1=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],z1=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Lme=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Pme={lineHeight:1.2,lineGap:.2},Rme=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Nme={lineHeight:1.2,lineGap:.2},Ome=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Bme={lineHeight:1.2,lineGap:.2},Fme=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],$me={lineHeight:1.2,lineGap:.2},zme=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Vme={lineHeight:1.33008,lineGap:0},Ume=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],jme={lineHeight:1.33008,lineGap:0},Hme=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Gme={lineHeight:1.33008,lineGap:0},Wme=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1],qme={lineHeight:1.33008,lineGap:0},Xme=un(function(t){t["MyriadPro-Regular"]=t["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:Fme,baseWidths:$1,baseMapping:z1,metrics:$me},t["MyriadPro-Bold"]=t["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:Lme,baseWidths:P1,baseMapping:R1,metrics:Pme},t["MyriadPro-It"]=t["MyriadPro-Italic"]=t["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:Ome,baseWidths:B1,baseMapping:F1,metrics:Bme},t["MyriadPro-BoldIt"]=t["MyriadPro-BoldItalic"]=t["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Rme,baseWidths:N1,baseMapping:O1,metrics:Nme},t.ArialMT=t.Arial=t["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:$1,baseMapping:z1},t["Arial-BoldMT"]=t["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:P1,baseMapping:R1},t["Arial-ItalicMT"]=t["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:B1,baseMapping:F1},t["Arial-BoldItalicMT"]=t["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:N1,baseMapping:O1},t["Calibri-Regular"]={name:"LiberationSans-Regular",factors:_me,baseWidths:$1,baseMapping:z1,metrics:Sme},t["Calibri-Bold"]={name:"LiberationSans-Bold",factors:mme,baseWidths:P1,baseMapping:R1,metrics:vme},t["Calibri-Italic"]={name:"LiberationSans-Italic",factors:bme,baseWidths:B1,baseMapping:F1,metrics:wme},t["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:yme,baseWidths:N1,baseMapping:O1,metrics:xme},t["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:Wme,baseWidths:$1,baseMapping:z1,metrics:qme},t["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:zme,baseWidths:P1,baseMapping:R1,metrics:Vme},t["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:Hme,baseWidths:B1,baseMapping:F1,metrics:Gme},t["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Ume,baseWidths:N1,baseMapping:O1,metrics:jme},t["Helvetica-Regular"]=t.Helvetica={name:"LiberationSans-Regular",factors:Dme,baseWidths:$1,baseMapping:z1,metrics:Mme},t["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:Cme,baseWidths:P1,baseMapping:R1,metrics:Ame},t["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:Eme,baseWidths:B1,baseMapping:F1,metrics:Ime},t["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Tme,baseWidths:N1,baseMapping:O1,metrics:kme}});function WI(t){const e=pb(t);return Xme()[e]}function Yme(t){const e=WI(t);if(!e)return null;const{baseWidths:r,baseMapping:n,factors:i}=e,a=i?r.map((c,u)=>c*i[u]):r;let s=-2,o;const l=[];for(const[c,u]of n.map((h,f)=>[h,f]).sort(([h],[f])=>h-f))c!==-1&&(c===s+1?(o.push(a[u]),s+=1):(s=c,o=[a[u]],l.push(c,o)));return l}function oX(t){const e=Yme(t),r=new re(null);r.set("BaseFont",xe.get(t)),r.set("Type",xe.get("Font")),r.set("Subtype",xe.get("CIDFontType2")),r.set("Encoding",xe.get("Identity-H")),r.set("CIDToGIDMap",xe.get("Identity")),r.set("W",e),r.set("FirstChar",e[0]),r.set("LastChar",e.at(-2)+e.at(-1).length-1);const n=new re(null);r.set("FontDescriptor",n);const i=new re(null);return i.set("Ordering","Identity"),i.set("Registry","Adobe"),i.set("Supplement",0),r.set("CIDSystemInfo",i),r}class Kme{constructor(e){this.lexer=e,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(e){return this.token.type===e?(this.nextToken(),!0):!1}expect(e){if(this.accept(e))return!0;throw new fe(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){return this.nextToken(),this.expect(va.LBRACE),this.parseBlock(),this.expect(va.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(va.NUMBER))this.operators.push(this.prev.value);else if(this.accept(va.OPERATOR))this.operators.push(this.prev.value);else if(this.accept(va.LBRACE))this.parseCondition();else return}parseCondition(){const e=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(va.RBRACE),this.accept(va.IF))this.operators[e]=this.operators.length,this.operators[e+1]="jz";else if(this.accept(va.LBRACE)){const r=this.operators.length;this.operators.push(null,null);const n=this.operators.length;this.parseBlock(),this.expect(va.RBRACE),this.expect(va.IFELSE),this.operators[r]=this.operators.length,this.operators[r+1]="j",this.operators[e]=n,this.operators[e+1]="jz"}else throw new fe("PS Function: error parsing conditional.")}}const va={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class zs{static get opCache(){return Te(this,"opCache",Object.create(null))}constructor(e,r){this.type=e,this.value=r}static getOperator(e){return zs.opCache[e]||=new zs(va.OPERATOR,e)}static get LBRACE(){return Te(this,"LBRACE",new zs(va.LBRACE,"{"))}static get RBRACE(){return Te(this,"RBRACE",new zs(va.RBRACE,"}"))}static get IF(){return Te(this,"IF",new zs(va.IF,"IF"))}static get IFELSE(){return Te(this,"IFELSE",new zs(va.IFELSE,"IFELSE"))}}class Zme{constructor(e){this.stream=e,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,r=this.currentChar;for(;;){if(r<0)return Di;if(e)(r===10||r===13)&&(e=!1);else if(r===37)e=!0;else if(!Gs(r))break;r=this.nextChar()}switch(r|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new zs(va.NUMBER,this.getNumber());case 123:return this.nextChar(),zs.LBRACE;case 125:return this.nextChar(),zs.RBRACE}const n=this.strBuf;for(n.length=0,n[0]=String.fromCharCode(r);(r=this.nextChar())>=0&&(r>=65&&r<=90||r>=97&&r<=122);)n.push(String.fromCharCode(r));const i=n.join("");switch(i.toLowerCase()){case"if":return zs.IF;case"ifelse":return zs.IFELSE;default:return zs.getOperator(i)}}getNumber(){let e=this.currentChar;const r=this.strBuf;for(r.length=0,r[0]=String.fromCharCode(e);(e=this.nextChar())>=0&&(e>=48&&e<=57||e===45||e===46);)r.push(String.fromCharCode(e));const n=parseFloat(r.join(""));if(isNaN(n))throw new fe(`Invalid floating point number: ${n}`);return n}}class $0{constructor(e){this._onlyRefs=e?.onlyRefs===!0,this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new Pi}getByName(e){this._onlyRefs&&tr("Should not call `getByName` method.");const r=this._nameRefMap.get(e);return r?this.getByRef(r):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,r,n){tr("Abstract method `set` called.")}}class uO extends $0{set(e,r=null,n){if(typeof e!="string")throw new Error('LocalImageCache.set - expected "name" argument.');if(r){if(this._imageCache.has(r))return;this._nameRefMap.set(e,r),this._imageCache.put(r,n);return}this._imageMap.has(e)||this._imageMap.set(e,n)}}class lX extends $0{set(e=null,r=null,n){if(typeof e!="string"&&!r)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(r){if(this._imageCache.has(r))return;e!==null&&this._nameRefMap.set(e,r),this._imageCache.put(r,n);return}this._imageMap.has(e)||this._imageMap.set(e,n)}}class Jme extends $0{constructor(e){super({onlyRefs:!0})}set(e=null,r,n){if(!r)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(r)||this._imageCache.put(r,n)}}class hO extends $0{set(e,r=null,n){if(typeof e!="string")throw new Error('LocalGStateCache.set - expected "name" argument.');if(r){if(this._imageCache.has(r))return;this._nameRefMap.set(e,r),this._imageCache.put(r,n);return}this._imageMap.has(e)||this._imageMap.set(e,n)}}class Qme extends $0{constructor(e){super({onlyRefs:!0})}set(e=null,r,n){if(!r)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(r)||this._imageCache.put(r,n)}}class e1e extends $0{constructor(e){super({onlyRefs:!0})}set(e=null,r,n){if(!r)throw new Error('RegionalImageCache.set - expected "ref" argument.');this._imageCache.has(r)||this._imageCache.put(r,n)}}class t1e extends $0{constructor(e){super({onlyRefs:!0})}set(e=null,r,n){if(!r)throw new Error('GlobalColorSpaceCache.set - expected "ref" argument.');this._imageCache.has(r)||this._imageCache.put(r,n)}clear(){this._imageCache.clear()}}class pg{static NUM_PAGES_THRESHOLD=2;static MIN_IMAGES_TO_CACHE=10;static MAX_BYTE_SIZE=5e7;#e=new yn;constructor(){this._refCache=new Pi,this._imageCache=new Pi}get#t(){let e=0;for(const r of this._imageCache)e+=r.byteSize;return e}get#n(){return!(this._imageCache.size<pg.MIN_IMAGES_TO_CACHE||this.#t<pg.MAX_BYTE_SIZE)}shouldCache(e,r){let n=this._refCache.get(e);return n||(n=new Set,this._refCache.put(e,n)),n.add(r),!(n.size<pg.NUM_PAGES_THRESHOLD||!this._imageCache.has(e)&&this.#n)}addDecodeFailed(e){this.#e.put(e)}hasDecodeFailed(e){return this.#e.has(e)}addByteSize(e,r){const n=this._imageCache.get(e);n&&(n.byteSize||(n.byteSize=r))}getData(e,r){const n=this._refCache.get(e);if(!n||n.size<pg.NUM_PAGES_THRESHOLD)return null;const i=this._imageCache.get(e);return i?(n.add(r),i):null}setData(e,r){if(!this._refCache.has(e))throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');if(!this._imageCache.has(e)){if(this.#n){ee("GlobalImageCache.setData - cache limit reached.");return}this._imageCache.put(e,r)}}clear(e=!1){e||(this.#e.clear(),this._refCache.clear()),this._imageCache.clear()}}class cX{constructor({xref:e,isEvalSupported:r=!0}){this.xref=e,this.isEvalSupported=r!==!1}create(e,r=!1){let n,i;if(e instanceof Ae?n=e:e instanceof re?n=e.objId:e instanceof Pt&&(n=e.dict?.objId),n){const s=this._localFunctionCache.getByRef(n);if(s)return s}const a=this.xref.fetchIfRef(e);if(Array.isArray(a)){if(!r)throw new Error('PDFFunctionFactory.create - expected "parseArray" argument.');i=fO.parseArray(this,a)}else i=fO.parse(this,a);return n&&this._localFunctionCache.set(null,n,i),i}get _localFunctionCache(){return Te(this,"_localFunctionCache",new Jme)}}function ro(t){return Array.isArray(t)?Ua(t,null)?t:t.map(e=>+e):null}class fO{static getSampleArray(e,r,n,i){let a,s,o=1;for(a=0,s=e.length;a<s;a++)o*=e[a];o*=r;const l=new Array(o);let c=0,u=0;const h=1/(2**n-1),f=i.getBytes((o*n+7)/8);let d=0;for(a=0;a<o;a++){for(;c<n;)u<<=8,u|=f[d++],c+=8;c-=n,l[a]=(u>>c)*h,u&=(1<<c)-1}return l}static parse(e,r){const n=r.dict||r;switch(n.get("FunctionType")){case 0:return this.constructSampled(e,r,n);case 1:break;case 2:return this.constructInterpolated(e,n);case 3:return this.constructStiched(e,n);case 4:return this.constructPostScript(e,r,n)}throw new fe("Unknown type of function")}static parseArray(e,r){const{xref:n}=e,i=[];for(const a of r)i.push(this.parse(e,n.fetchIfRef(a)));return function(a,s,o,l){for(let c=0,u=i.length;c<u;c++)i[c](a,s,o,l+c)}}static constructSampled(e,r,n){function i(m){const v=m.length,y=[];let x=0;for(let b=0;b<v;b+=2)y[x++]=[m[b],m[b+1]];return y}function a(m,v,y,x,b){return x+(m-v)*((b-x)/(y-v))}let s=ro(n.getArray("Domain")),o=ro(n.getArray("Range"));if(!s||!o)throw new fe("No domain or range");const l=s.length/2,c=o.length/2;s=i(s),o=i(o);const u=ro(n.getArray("Size")),h=n.get("BitsPerSample"),f=n.get("Order")||1;f!==1&&Ht("No support for cubic spline interpolation: "+f);let d=ro(n.getArray("Encode"));if(d)d=i(d);else{d=[];for(let m=0;m<l;++m)d.push([0,u[m]-1])}let p=ro(n.getArray("Decode"));p=p?i(p):o;const g=this.getSampleArray(u,c,h,r);return function(v,y,x,b){const w=1<<l,_=new Float64Array(w).fill(1),S=new Uint32Array(w);let C,T,A=c,k=1;for(C=0;C<l;++C){const I=s[C][0],E=s[C][1],M=Li(v[y+C],I,E);let R=a(M,I,E,d[C][0],d[C][1]);const D=u[C];R=Li(R,0,D-1);const L=R<D-1?Math.floor(R):R-1,P=L+1-R,O=R-L,$=L*A,N=$+A;for(T=0;T<w;T++)T&k?(_[T]*=O,S[T]+=N):(_[T]*=P,S[T]+=$);A*=D,k<<=1}for(T=0;T<c;++T){let I=0;for(C=0;C<w;C++)I+=g[S[C]+T]*_[C];I=a(I,0,1,p[T][0],p[T][1]),x[b+T]=Li(I,o[T][0],o[T][1])}}}static constructInterpolated(e,r){const n=ro(r.getArray("C0"))||[0],i=ro(r.getArray("C1"))||[1],a=r.get("N"),s=[];for(let l=0,c=n.length;l<c;++l)s.push(i[l]-n[l]);const o=s.length;return function(c,u,h,f){const d=a===1?c[u]:c[u]**a;for(let p=0;p<o;++p)h[f+p]=n[p]+d*s[p]}}static constructStiched(e,r){const n=ro(r.getArray("Domain"));if(!n)throw new fe("No domain");if(n.length/2!==1)throw new fe("Bad domain for stiched function");const{xref:a}=e,s=[];for(const u of r.get("Functions"))s.push(this.parse(e,a.fetchIfRef(u)));const o=ro(r.getArray("Bounds")),l=ro(r.getArray("Encode")),c=new Float32Array(1);return function(h,f,d,p){const g=Li(h[f],n[0],n[1]),m=o.length;let v;for(v=0;v<m&&!(g<o[v]);++v);let y=n[0];v>0&&(y=o[v-1]);let x=n[1];v<o.length&&(x=o[v]);const b=l[2*v],w=l[2*v+1];c[0]=y===x?b:b+(g-y)*(w-b)/(x-y),s[v](c,0,d,p)}}static constructPostScript(e,r,n){const i=ro(n.getArray("Domain")),a=ro(n.getArray("Range"));if(!i)throw new fe("No domain.");if(!a)throw new fe("No range.");const s=new Zme(r),l=new Kme(s).parse();if(e.isEvalSupported&&oa.isEvalSupported){const m=new c1e().compile(l,i,a);if(m)return new Function("src","srcOffset","dest","destOffset",m)}Ht("Unable to compile PS function");const c=a.length>>1,u=i.length>>1,h=new r1e(l),f=Object.create(null);let p=2048*4;const g=new Float32Array(u);return function(v,y,x,b){let w,_,S="";const C=g;for(w=0;w<u;w++)_=v[y+w],C[w]=_,S+=_+"_";const T=f[S];if(T!==void 0){x.set(T,b);return}const A=new Float32Array(c),k=h.execute(C),I=k.length-c;for(w=0;w<c;w++){_=k[I+w];let E=a[w*2];_<E?_=E:(E=a[w*2+1],_>E&&(_=E)),A[w]=_}p>0&&(p--,f[S]=A),x.set(A,b)}}}function w8(t){let e;if(t instanceof re)e=t;else if(t instanceof Pt)e=t.dict;else return!1;return e.has("FunctionType")}class MS{static MAX_STACK_SIZE=100;constructor(e){this.stack=e?Array.from(e):[]}push(e){if(this.stack.length>=MS.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(e)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(e){if(this.stack.length+e>=MS.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const r=this.stack;for(let n=r.length-e,i=e-1;i>=0;i--,n++)r.push(r[n])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,r){const n=this.stack,i=n.length-e,a=n.length-1,s=i+(r-Math.floor(r/e)*e);for(let o=i,l=a;o<l;o++,l--){const c=n[o];n[o]=n[l],n[l]=c}for(let o=i,l=s-1;o<l;o++,l--){const c=n[o];n[o]=n[l],n[l]=c}for(let o=s,l=a;o<l;o++,l--){const c=n[o];n[o]=n[l],n[l]=c}}}class r1e{constructor(e){this.operators=e}execute(e){const r=new MS(e);let n=0;const i=this.operators,a=i.length;let s,o,l;for(;n<a;){if(s=i[n++],typeof s=="number"){r.push(s);continue}switch(s){case"jz":l=r.pop(),o=r.pop(),o||(n=l);break;case"j":o=r.pop(),n=o;break;case"abs":o=r.pop(),r.push(Math.abs(o));break;case"add":l=r.pop(),o=r.pop(),r.push(o+l);break;case"and":l=r.pop(),o=r.pop(),typeof o=="boolean"&&typeof l=="boolean"?r.push(o&&l):r.push(o&l);break;case"atan":l=r.pop(),o=r.pop(),o=Math.atan2(o,l)/Math.PI*180,o<0&&(o+=360),r.push(o);break;case"bitshift":l=r.pop(),o=r.pop(),o>0?r.push(o<<l):r.push(o>>l);break;case"ceiling":o=r.pop(),r.push(Math.ceil(o));break;case"copy":o=r.pop(),r.copy(o);break;case"cos":o=r.pop(),r.push(Math.cos(o%360/180*Math.PI));break;case"cvi":o=r.pop()|0,r.push(o);break;case"cvr":break;case"div":l=r.pop(),o=r.pop(),r.push(o/l);break;case"dup":r.copy(1);break;case"eq":l=r.pop(),o=r.pop(),r.push(o===l);break;case"exch":r.roll(2,1);break;case"exp":l=r.pop(),o=r.pop(),r.push(o**l);break;case"false":r.push(!1);break;case"floor":o=r.pop(),r.push(Math.floor(o));break;case"ge":l=r.pop(),o=r.pop(),r.push(o>=l);break;case"gt":l=r.pop(),o=r.pop(),r.push(o>l);break;case"idiv":l=r.pop(),o=r.pop(),r.push(o/l|0);break;case"index":o=r.pop(),r.index(o);break;case"le":l=r.pop(),o=r.pop(),r.push(o<=l);break;case"ln":o=r.pop(),r.push(Math.log(o));break;case"log":o=r.pop(),r.push(Math.log10(o));break;case"lt":l=r.pop(),o=r.pop(),r.push(o<l);break;case"mod":l=r.pop(),o=r.pop(),r.push(o%l);break;case"mul":l=r.pop(),o=r.pop(),r.push(o*l);break;case"ne":l=r.pop(),o=r.pop(),r.push(o!==l);break;case"neg":o=r.pop(),r.push(-o);break;case"not":o=r.pop(),typeof o=="boolean"?r.push(!o):r.push(~o);break;case"or":l=r.pop(),o=r.pop(),typeof o=="boolean"&&typeof l=="boolean"?r.push(o||l):r.push(o|l);break;case"pop":r.pop();break;case"roll":l=r.pop(),o=r.pop(),r.roll(o,l);break;case"round":o=r.pop(),r.push(Math.round(o));break;case"sin":o=r.pop(),r.push(Math.sin(o%360/180*Math.PI));break;case"sqrt":o=r.pop(),r.push(Math.sqrt(o));break;case"sub":l=r.pop(),o=r.pop(),r.push(o-l);break;case"true":r.push(!0);break;case"truncate":o=r.pop(),o=o<0?Math.ceil(o):Math.floor(o),r.push(o);break;case"xor":l=r.pop(),o=r.pop(),typeof o=="boolean"&&typeof l=="boolean"?r.push(o!==l):r.push(o^l);break;default:throw new fe(`Unknown operator ${s}`)}}return r.stack}}class Hm{constructor(e){this.type=e}visit(e){tr("abstract method")}}class n1e extends Hm{constructor(e,r,n){super("args"),this.index=e,this.min=r,this.max=n}visit(e){e.visitArgument(this)}}class Xd extends Hm{constructor(e){super("literal"),this.number=e,this.min=e,this.max=e}visit(e){e.visitLiteral(this)}}class qI extends Hm{constructor(e,r,n,i,a){super("binary"),this.op=e,this.arg1=r,this.arg2=n,this.min=i,this.max=a}visit(e){e.visitBinaryOperation(this)}}class i1e extends Hm{constructor(e,r){super("max"),this.arg=e,this.min=e.min,this.max=r}visit(e){e.visitMin(this)}}class dO extends Hm{constructor(e,r,n){super("var"),this.index=e,this.min=r,this.max=n}visit(e){e.visitVariable(this)}}class pO extends Hm{constructor(e,r){super("definition"),this.variable=e,this.arg=r}visit(e){e.visitVariableDefinition(this)}}class gO{constructor(){this.parts=[]}visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")}visitVariable(e){this.parts.push("v",e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push("("),e.arg1.visit(this),this.parts.push(" ",e.op," "),e.arg2.visit(this),this.parts.push(")")}visitVariableDefinition(e){this.parts.push("var "),e.variable.visit(this),this.parts.push(" = "),e.arg.visit(this),this.parts.push(";")}visitMin(e){this.parts.push("Math.min("),e.arg.visit(this),this.parts.push(", ",e.max,")")}toString(){return this.parts.join("")}}function a1e(t,e){return e.type==="literal"&&e.number===0?t:t.type==="literal"&&t.number===0?e:e.type==="literal"&&t.type==="literal"?new Xd(t.number+e.number):new qI("+",t,e,t.min+e.min,t.max+e.max)}function s1e(t,e){if(e.type==="literal"){if(e.number===0)return new Xd(0);if(e.number===1)return t;if(t.type==="literal")return new Xd(t.number*e.number)}if(t.type==="literal"){if(t.number===0)return new Xd(0);if(t.number===1)return e}const r=Math.min(t.min*e.min,t.min*e.max,t.max*e.min,t.max*e.max),n=Math.max(t.min*e.min,t.min*e.max,t.max*e.min,t.max*e.max);return new qI("*",t,e,r,n)}function o1e(t,e){if(e.type==="literal"){if(e.number===0)return t;if(t.type==="literal")return new Xd(t.number-e.number)}return e.type==="binary"&&e.op==="-"&&t.type==="literal"&&t.number===1&&e.arg1.type==="literal"&&e.arg1.number===1?e.arg2:new qI("-",t,e,t.min-e.max,t.max-e.min)}function l1e(t,e){return t.min>=e?new Xd(e):t.max<=e?t:new i1e(t,e)}class c1e{compile(e,r,n){const i=[],a=[],s=r.length>>1,o=n.length>>1;let l=0,c,u,h,f,d,p,g,m;for(let y=0;y<s;y++)i.push(new n1e(y,r[y*2],r[y*2+1]));for(let y=0,x=e.length;y<x;y++){if(m=e[y],typeof m=="number"){i.push(new Xd(m));continue}switch(m){case"add":if(i.length<2)return null;f=i.pop(),h=i.pop(),i.push(a1e(h,f));break;case"cvr":if(i.length<1)return null;break;case"mul":if(i.length<2)return null;f=i.pop(),h=i.pop(),i.push(s1e(h,f));break;case"sub":if(i.length<2)return null;f=i.pop(),h=i.pop(),i.push(o1e(h,f));break;case"exch":if(i.length<2)return null;d=i.pop(),p=i.pop(),i.push(d,p);break;case"pop":if(i.length<1)return null;i.pop();break;case"index":if(i.length<1||(h=i.pop(),h.type!=="literal")||(c=h.number,c<0||!Number.isInteger(c)||i.length<c))return null;if(d=i[i.length-c-1],d.type==="literal"||d.type==="var"){i.push(d);break}g=new dO(l++,d.min,d.max),i[i.length-c-1]=g,i.push(g),a.push(new pO(g,d));break;case"dup":if(i.length<1)return null;if(typeof e[y+1]=="number"&&e[y+2]==="gt"&&e[y+3]===y+7&&e[y+4]==="jz"&&e[y+5]==="pop"&&e[y+6]===e[y+1]){h=i.pop(),i.push(l1e(h,e[y+1])),y+=6;break}if(d=i.at(-1),d.type==="literal"||d.type==="var"){i.push(d);break}g=new dO(l++,d.min,d.max),i[i.length-1]=g,i.push(g),a.push(new pO(g,d));break;case"roll":if(i.length<2||(f=i.pop(),h=i.pop(),f.type!=="literal"||h.type!=="literal")||(u=f.number,c=h.number,c<=0||!Number.isInteger(c)||!Number.isInteger(u)||i.length<c))return null;if(u=(u%c+c)%c,u===0)break;i.push(...i.splice(i.length-c,c-u));break;default:return null}}if(i.length!==o)return null;const v=[];for(const y of a){const x=new gO;y.visit(x),v.push(x.toString())}for(let y=0,x=i.length;y<x;y++){const b=i[y],w=new gO;b.visit(w);const _=n[y*2],S=n[y*2+1],C=[w.toString()];_>b.min&&(C.unshift("Math.max(",_,", "),C.push(")")),S<b.max&&(C.unshift("Math.min(",S,", "),C.push(")")),C.unshift("dest[destOffset + ",y,"] = "),C.push(";"),v.push(C.join(""))}return v.join(`
@@ -64,7 +64,7 @@ startxref
64
64
  `);const l=new _a(i.join(`
65
65
  `)),c=l.dict=new re;c.setIfName("Type","ObjStm"),c.set("N",r.length),c.set("First",i[0].length+1),n.put(e,{data:l})}async writePDF(){await this.#y();const e=this.#C(),[r,n,i]=await this.#S(),[a,s]=await this.#b(),o=[...`%PDF-${this.version}
66
66
  %`.split("").map(l=>l.charCodeAt(0)),250,222,250,206];return cY({originalData:new Uint8Array(o),changes:a,xrefInfo:{startXRef:null,rootRef:this.rootRef,infoRef:this.infoRef,encryptRef:r,newRef:s,fileIds:i||[null,null],infoMap:e},useXrefStream:this.useObjectStreams,xref:{encrypt:n,encryptRef:r}})}}class I_e{constructor(e){this._msgHandler=e,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return Ir(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new D_e(this._msgHandler),this._fullRequestReader}getRangeReader(e,r){const n=new M_e(e,r,this._msgHandler);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class D_e{constructor(e){this._msgHandler=e,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;const r=this._msgHandler.sendWithStream("GetReader");this._reader=r.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then(n=>{this._isStreamingSupported=n.isStreamingSupported,this._isRangeSupported=n.isRangeSupported,this._contentLength=n.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:e,done:r}=await this._reader.read();return r?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class M_e{constructor(e,r,n){this._msgHandler=n,this.onProgress=null;const i=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:r});this._reader=i.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:r}=await this._reader.read();return r?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class Wc{constructor(e){this.name=e,this.terminated=!1,this._capability=Promise.withResolvers()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}const tR=class tR{static setup(e,r){let n=!1;e.on("test",i=>{n||(n=!0,e.send("test",i instanceof Uint8Array))}),e.on("configure",i=>{t0e(i.verbosity)}),e.on("GetDocRequest",i=>this.createDocumentHandler(i,r))}static createDocumentHandler(e,r){let n,i=!1,a=null;const s=new Set,o=r0e(),{docId:l,apiVersion:c}=e,u="5.4.530";if(c!==u)throw new Error(`The API version "${c}" does not match the Worker version "${u}".`);const h=(b,w)=>`The \`${b}.prototype\` contains unexpected enumerable property "${w}", thus breaking e.g. \`for...in\` iteration of ${b}s.`;for(const b in{})throw new Error(h("Object",b));for(const b in[])throw new Error(h("Array",b));const f=l+"_worker";let d=new XO(f,l,r);function p(){if(i)throw new Error("Worker was terminated")}function g(b){s.add(b)}function m(b){b.finish(),s.delete(b)}async function v(b){await n.ensureDoc("checkHeader"),await n.ensureDoc("parseStartXRef"),await n.ensureDoc("parse",[b]),await n.ensureDoc("checkFirstPage",[b]),await n.ensureDoc("checkLastPage",[b]);const w=await n.ensureDoc("isPureXfa");if(w){const T=new Wc("loadXfaResources");g(T),await n.ensureDoc("loadXfaResources",[d,T]),m(T)}const[_,S]=await Promise.all([n.ensureDoc("numPages"),n.ensureDoc("fingerprints")]),C=w?await n.ensureDoc("htmlForXfa"):null;return{numPages:_,fingerprints:S,htmlForXfa:C}}async function y({data:b,password:w,disableAutoFetch:_,rangeChunkSize:S,length:C,docBaseUrl:T,enableXfa:A,evaluatorOptions:k}){const I={source:null,disableAutoFetch:_,docBaseUrl:T,docId:l,enableXfa:A,evaluatorOptions:k,handler:d,length:C,password:w,rangeChunkSize:S};if(b)return I.source=b,new R8(I);const E=new I_e(d),M=E.getFullReader(),R=Promise.withResolvers();let D,L=[],P=0;return M.headersReady.then(function(){if(M.isRangeSupported){I.source=E,I.length=M.contentLength,I.disableAutoFetch||=M.isStreamingSupported,D=new f_e(I);for(const O of L)D.sendProgressiveData(O);L=[],R.resolve(D),a=null}}).catch(function(O){R.reject(O),a=null}),new Promise(function(O,$){const N=function({value:U,done:j}){try{if(p(),j){if(!D){const B=Eq(L);L=[],C&&B.length!==C&&ee("reported HTTP length is different from actual"),I.source=B,D=new R8(I),R.resolve(D)}a=null;return}P+=U.byteLength,M.isStreamingSupported||d.send("DocProgress",{loaded:P,total:Math.max(P,M.contentLength||0)}),D?D.sendProgressiveData(U):L.push(U),M.read().then(N,$)}catch(B){$(B)}};M.read().then(N,$)}).catch(function(O){R.reject(O),a=null}),a=O=>{E.cancelAllRequests(O)},R.promise}function x(b){function w(C){p(),d.send("GetDoc",{pdfInfo:C})}function _(C){if(p(),C instanceof am){const T=new Wc(`PasswordException: response ${C.code}`);g(T),d.sendWithPromise("PasswordRequest",C).then(function({password:A}){m(T),n.updatePassword(A),S()}).catch(function(){m(T),d.send("DocException",C)})}else d.send("DocException",Ps(C))}function S(){p(),v(!1).then(w,function(C){if(p(),!(C instanceof qd)){_(C);return}n.requestLoadedStream().then(function(){p(),v(!0).then(w,_)})})}p(),y(b).then(function(C){if(i)throw C.terminate(new Zi("Worker was terminated.")),new Error("Worker was terminated");n=C,n.requestLoadedStream(!0).then(T=>{d.send("DataLoaded",{length:T.bytes.byteLength})})}).then(S,_)}return d.on("GetPage",function(b){return n.getPage(b.pageIndex).then(function(w){return Promise.all([n.ensure(w,"rotate"),n.ensure(w,"ref"),n.ensure(w,"userUnit"),n.ensure(w,"view")]).then(function([_,S,C,T]){return{rotate:_,ref:S,refStr:S?.toString()??null,userUnit:C,view:T}})})}),d.on("GetPageIndex",function(b){const w=Ae.get(b.num,b.gen);return n.ensureCatalog("getPageIndex",[w])}),d.on("GetDestinations",function(b){return n.ensureCatalog("destinations")}),d.on("GetDestination",function(b){return n.ensureCatalog("getDestination",[b.id])}),d.on("GetPageLabels",function(b){return n.ensureCatalog("pageLabels")}),d.on("GetPageLayout",function(b){return n.ensureCatalog("pageLayout")}),d.on("GetPageMode",function(b){return n.ensureCatalog("pageMode")}),d.on("GetViewerPreferences",function(b){return n.ensureCatalog("viewerPreferences")}),d.on("GetOpenAction",function(b){return n.ensureCatalog("openAction")}),d.on("GetAttachments",function(b){return n.ensureCatalog("attachments")}),d.on("GetDocJSActions",function(b){return n.ensureCatalog("jsActions")}),d.on("GetPageJSActions",function({pageIndex:b}){return n.getPage(b).then(w=>n.ensure(w,"jsActions"))}),d.on("GetAnnotationsByType",async function({types:b,pageIndexesToSkip:w}){const[_,S]=await Promise.all([n.ensureDoc("numPages"),n.ensureDoc("annotationGlobals")]);if(!S)return null;const C=[],T=[];let A=null;try{for(let I=0,E=_;I<E;I++)w?.has(I)||(A||(A=new Wc("GetAnnotationsByType"),g(A)),C.push(n.getPage(I).then(async M=>M?M.collectAnnotationsByType(d,A,b,T,S)||[]:[])));return await Promise.all(C),(await Promise.all(T)).filter(I=>!!I)}finally{A&&m(A)}}),d.on("GetOutline",function(b){return n.ensureCatalog("documentOutline")}),d.on("GetOptionalContentConfig",function(b){return n.ensureCatalog("optionalContentConfig")}),d.on("GetPermissions",function(b){return n.ensureCatalog("permissions")}),d.on("GetMetadata",function(b){return Promise.all([n.ensureDoc("documentInfo"),n.ensureCatalog("metadata"),n.ensureCatalog("hasStructTree")])}),d.on("GetMarkInfo",function(b){return n.ensureCatalog("markInfo")}),d.on("GetData",function(b){return n.requestLoadedStream().then(w=>w.bytes)}),d.on("GetAnnotations",function({pageIndex:b,intent:w}){return n.getPage(b).then(function(_){const S=new Wc(`GetAnnotations: page ${b}`);return g(S),_.getAnnotationsData(d,S,w).then(C=>(m(S),C),C=>{throw m(S),C})})}),d.on("GetFieldObjects",function(b){return n.ensureDoc("fieldObjects").then(w=>w?.allFields||null)}),d.on("HasJSActions",function(b){return n.ensureDoc("hasJSActions")}),d.on("GetCalculationOrderIds",function(b){return n.ensureDoc("calculationOrderIds")}),d.on("ExtractPages",async function({pageInfos:b}){if(!b)return ee("extractPages: nothing to extract."),null;Array.isArray(b)||(b=[b]);let w=0;for(const _ of b)if(_.document===null)_.document=n.pdfDocument;else if(ArrayBuffer.isView(_.document)){const S=new R8({source:_.document,docId:`${l}_extractPages_${w++}`,handler:d,password:_.password??null,evaluatorOptions:Object.assign({},n.evaluatorOptions)});let C=!1,T=!0;for(;;)try{await S.requestLoadedStream(),await S.ensureDoc("checkHeader"),await S.ensureDoc("parseStartXRef"),await S.ensureDoc("parse",[C]);break}catch(k){if(k instanceof qd)if(C===!1){C=!0;continue}else T=!1,ee("extractPages: XRefParseException.");else if(k instanceof am){const I=new Wc(`PasswordException: response ${k.code}`);g(I);try{const{password:E}=await d.sendWithPromise("PasswordRequest",k);S.updatePassword(E)}catch{T=!1,ee("extractPages: invalid password.")}finally{m(I)}}else T=!1,ee("extractPages: invalid document.");if(!T)break}T||(_.document=null),await S.ensureDoc("isPureXfa")?(_.document=null,ee("extractPages does not support pure XFA documents.")):_.document=S.pdfDocument}else ee("extractPages: invalid document.");try{return await new E_e().extractPages(b)}catch(_){return console.error(_),null}}),d.on("SaveDocument",async function({isPureXfa:b,numPages:w,annotationStorage:_,filename:S}){const C=[n.requestLoadedStream(),n.ensureCatalog("acroForm"),n.ensureCatalog("acroFormRef"),n.ensureDoc("startXRef"),n.ensureDoc("xref"),n.ensureCatalog("structTreeRoot")],T=new Pi,A=[],k=b?null:Mq(_),[I,E,M,R,D,L]=await Promise.all(C),P=D.trailer.getRaw("Root")||null;let O;if(k){L?await L.canUpdateStructTree({pdfManager:n,newAnnotationsByPage:k})&&(O=L):await Ph.canCreateStructureTree({catalogRef:P,pdfManager:n,newAnnotationsByPage:k})&&(O=null);const X=hu.generateImages(_.values(),D,n.evaluatorOptions.isOffscreenCanvasSupported),K=O===void 0?A:[];for(const[G,H]of k)K.push(n.getPage(G).then(Y=>{const J=new Wc(`Save (editor): page ${G}`);return g(J),Y.saveNewAnnotations(d,J,H,X,T).finally(function(){m(J)})}));O===null?A.push(Promise.all(K).then(async()=>{await Ph.createStructureTree({newAnnotationsByPage:k,xref:D,catalogRef:P,pdfManager:n,changes:T})})):O&&A.push(Promise.all(K).then(async()=>{await O.updateStructureTree({newAnnotationsByPage:k,pdfManager:n,changes:T})}))}if(b)A.push(n.ensureDoc("serializeXfaData",[_]));else for(let X=0;X<w;X++)A.push(n.getPage(X).then(function(K){const G=new Wc(`Save: page ${X}`);return g(G),K.save(d,G,_,T).finally(function(){m(G)})}));const $=await Promise.all(A);let N=null;if(b){if(N=$[0],!N)return I.bytes}else if(T.size===0)return I.bytes;const U=M&&E instanceof re&&T.values().some(X=>X.needAppearances),j=E instanceof re&&E.get("XFA")||null;let B=null,q=!1;if(Array.isArray(j)){for(let X=0,K=j.length;X<K;X+=2)j[X]==="datasets"&&(B=j[X+1],q=!0);B===null&&(B=D.getNewTemporaryRef())}else j&&ee("Unsupported XFA type.");let W=Object.create(null);if(D.trailer){const X=new Map,K=D.trailer.get("Info")||null;if(K instanceof re)for(const[G,H]of K)typeof H=="string"&&X.set(G,qt(H));W={rootRef:P,encryptRef:D.trailer.getRaw("Encrypt")||null,newRef:D.getNewTemporaryRef(),infoRef:D.trailer.getRaw("Info")||null,infoMap:X,fileIds:D.trailer.get("ID")||null,startXRef:R,filename:S}}return cY({originalData:I.bytes,xrefInfo:W,changes:T,xref:D,hasXfa:!!j,xfaDatasetsRef:B,hasXfaDatasetsEntry:q,needAppearances:U,acroFormRef:M,acroForm:E,xfaData:N,useXrefStream:Tq(D.topDict,"XRef")}).finally(()=>{D.resetNewTemporaryRef()})}),d.on("GetOperatorList",function(b,w){const _=b.pageIndex;n.getPage(_).then(function(S){const C=new Wc(`GetOperatorList: page ${_}`);g(C);const T=o>=Jy.INFOS?Date.now():0;S.getOperatorList({handler:d,sink:w,task:C,intent:b.intent,cacheKey:b.cacheKey,annotationStorage:b.annotationStorage,modifiedIds:b.modifiedIds}).then(function(A){m(C),T&&Ht(`page=${_+1} - getOperatorList: time=${Date.now()-T}ms, len=${A.length}`),w.close()},function(A){m(C),!C.terminated&&w.error(A)})})}),d.on("GetTextContent",function(b,w){const{pageIndex:_,includeMarkedContent:S,disableNormalization:C}=b;n.getPage(_).then(function(T){const A=new Wc("GetTextContent: page "+_);g(A);const k=o>=Jy.INFOS?Date.now():0;T.extractTextContent({handler:d,task:A,sink:w,includeMarkedContent:S,disableNormalization:C}).then(function(){m(A),k&&Ht(`page=${_+1} - getTextContent: time=${Date.now()-k}ms`),w.close()},function(I){m(A),!A.terminated&&w.error(I)})})}),d.on("GetStructTree",function(b){return n.getPage(b.pageIndex).then(w=>n.ensure(w,"getStructTree"))}),d.on("FontFallback",function(b){return n.fontFallback(b.id,d)}),d.on("Cleanup",function(b){return n.cleanup(!0)}),d.on("Terminate",function(b){i=!0;const w=[];if(n){n.terminate(new Zi("Worker was terminated."));const _=n.cleanup();w.push(_),n=null}else YI();a?.(new Zi("Worker was terminated."));for(const _ of s)w.push(_.finished),_.terminate();return Promise.all(w).then(function(){d.destroy(),d=null})}),d.on("Ready",function(b){x(e),e=null}),f}static initializeFromPort(e){const r=new XO("worker","main",e);this.setup(r,e),r.send("ready",null)}};typeof window>"u"&&!Jde&&typeof self<"u"&&typeof self.postMessage=="function"&&"onmessage"in self&&tR.initializeFromPort(self);let FT=tR;globalThis.pdfjsWorker={WorkerMessageHandler:FT};const O8={"smp-pdf":"_smp-pdf_1bgho_1","smp-pdf-toolbar":"_smp-pdf-toolbar_1bgho_5","smp-pdf-error":"_smp-pdf-error_1bgho_10"},L_e=(t,e,r)=>{const n=!t;return V.jsxs(V.Fragment,{children:[V.jsx(lr,{disabled:n||e,bindValue:"",ShowText:!1,icon:"open_in_new",BtnTit:B8(n,e,Dg.OPEN_IN_NEW,r),onClick:()=>{window.open(t,"_blank")}}),V.jsx(lr,{disabled:n||e,bindValue:"",ShowText:!1,icon:"download",BtnTit:B8(n,e,Dg.DOWNLOAD,r),onClick:()=>{const i=document.createElement("a");i.href=t,i.download=t.split("/").pop()||"document.pdf",i.target="_blank",i.click()}}),V.jsx(lr,{disabled:n||e,bindValue:"",ShowText:!1,icon:"print",BtnTit:B8(n,e,Dg.PRINT,r),onClick:()=>{const i=window.open(t,"_blank");i&&(i.onload=()=>{i.focus(),i.print()})}})]})},B8=(t,e,r,n)=>n(t?Dg.MISSING:e?Dg.ERROR:r),Ra=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),$T=[.001,0,0,.001,0,0],F8=1.35,Rs={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Ah={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},vx="pdfjs_internal_editor_",er={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},_r={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},P_e={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},zT={TRIANGLES:1,LATTICE:2},di={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},k_={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Jn={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},rg={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},cC={ERRORS:0,WARNINGS:1,INFOS:5},yx={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},H1={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},R_e={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let uC=cC.WARNINGS;function N_e(t){Number.isInteger(t)&&(uC=t)}function O_e(){return uC}function hC(t){uC>=cC.INFOS&&console.info(`Info: ${t}`)}function Jt(t){uC>=cC.WARNINGS&&console.warn(`Warning: ${t}`)}function rn(t){throw new Error(t)}function Sr(t,e){t||rn(e)}function B_e(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function uY(t,e=null,r=null){if(!t)return null;if(r&&typeof t=="string"&&(r.addDefaultProtocol&&t.startsWith("www.")&&t.match(/\./g)?.length>=2&&(t=`http://${t}`),r.tryConvertEncoding))try{t=U_e(t)}catch{}const n=e?URL.parse(t,e):URL.parse(t);return B_e(n)?n:null}function hY(t,e,r=!1){const n=URL.parse(t);return n?(n.hash=e,n.href):r&&uY(t,"http://example.com")?t.split("#",1)[0]+`${e?`#${e}`:""}`:""}function Qt(t,e,r,n=!1){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!0,writable:!1}),r}const V0=(function(){function e(r,n){this.message=r,this.name=n}return e.prototype=new Error,e.constructor=e,e})();class YO extends V0{constructor(e,r){super(e,"PasswordException"),this.code=r}}class $8 extends V0{constructor(e,r){super(e,"UnknownErrorException"),this.details=r}}class VT extends V0{constructor(e){super(e,"InvalidPDFException")}}class HS extends V0{constructor(e,r,n){super(e,"ResponseException"),this.status=r,this.missing=n}}class F_e extends V0{constructor(e){super(e,"FormatError")}}class rf extends V0{constructor(e){super(e,"AbortException")}}function fY(t){(typeof t!="object"||t?.length===void 0)&&rn("Invalid argument for bytesToString");const e=t.length,r=8192;if(e<r)return String.fromCharCode.apply(null,t);const n=[];for(let i=0;i<e;i+=r){const a=Math.min(i+r,e),s=t.subarray(i,a);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function _b(t){typeof t!="string"&&rn("Invalid argument for stringToBytes");const e=t.length,r=new Uint8Array(e);for(let n=0;n<e;++n)r[n]=t.charCodeAt(n)&255;return r}function $_e(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function z_e(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function V_e(){try{return new Function(""),!0}catch{return!1}}class yi{static get isLittleEndian(){return Qt(this,"isLittleEndian",z_e())}static get isEvalSupported(){return Qt(this,"isEvalSupported",V_e())}static get isOffscreenCanvasSupported(){return Qt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Qt(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Qt(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Qt(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:r}=navigator;return Qt(this,"platform",{isAndroid:r.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:r.includes("Firefox")})}static get isCSSRoundSupported(){return Qt(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const z8=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class ot{static makeHexColor(e,r,n){return`#${z8[e]}${z8[r]}${z8[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,r){let n;e[0]?(e[0]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=e[0],r[2]*=e[0],e[3]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=e[3],r[3]*=e[3]):(n=r[0],r[0]=r[1],r[1]=n,n=r[2],r[2]=r[3],r[3]=n,e[1]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=e[1],r[3]*=e[1],e[2]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=e[2],r[2]*=e[2]),r[0]+=e[4],r[1]+=e[5],r[2]+=e[4],r[3]+=e[5]}static transform(e,r){return[e[0]*r[0]+e[2]*r[1],e[1]*r[0]+e[3]*r[1],e[0]*r[2]+e[2]*r[3],e[1]*r[2]+e[3]*r[3],e[0]*r[4]+e[2]*r[5]+e[4],e[1]*r[4]+e[3]*r[5]+e[5]]}static multiplyByDOMMatrix(e,r){return[e[0]*r.a+e[2]*r.b,e[1]*r.a+e[3]*r.b,e[0]*r.c+e[2]*r.d,e[1]*r.c+e[3]*r.d,e[0]*r.e+e[2]*r.f+e[4],e[1]*r.e+e[3]*r.f+e[5]]}static applyTransform(e,r,n=0){const i=e[n],a=e[n+1];e[n]=i*r[0]+a*r[2]+r[4],e[n+1]=i*r[1]+a*r[3]+r[5]}static applyTransformToBezier(e,r,n=0){const i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5];for(let u=0;u<6;u+=2){const h=e[n+u],f=e[n+u+1];e[n+u]=h*i+f*s+l,e[n+u+1]=h*a+f*o+c}}static applyInverseTransform(e,r){const n=e[0],i=e[1],a=r[0]*r[3]-r[1]*r[2];e[0]=(n*r[3]-i*r[2]+r[2]*r[5]-r[4]*r[3])/a,e[1]=(-n*r[1]+i*r[0]+r[4]*r[1]-r[5]*r[0])/a}static axialAlignedBoundingBox(e,r,n){const i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5],u=e[0],h=e[1],f=e[2],d=e[3];let p=i*u+l,g=p,m=i*f+l,v=m,y=o*h+c,x=y,b=o*d+c,w=b;if(a!==0||s!==0){const _=a*u,S=a*f,C=s*h,T=s*d;p+=C,v+=C,m+=T,g+=T,y+=_,w+=_,b+=S,x+=S}n[0]=Math.min(n[0],p,m,g,v),n[1]=Math.min(n[1],y,b,x,w),n[2]=Math.max(n[2],p,m,g,v),n[3]=Math.max(n[3],y,b,x,w)}static inverseTransform(e){const r=e[0]*e[3]-e[1]*e[2];return[e[3]/r,-e[1]/r,-e[2]/r,e[0]/r,(e[2]*e[5]-e[4]*e[3])/r,(e[4]*e[1]-e[5]*e[0])/r]}static singularValueDecompose2dScale(e,r){const n=e[0],i=e[1],a=e[2],s=e[3],o=n**2+i**2,l=n*a+i*s,c=a**2+s**2,u=(o+c)/2,h=Math.sqrt(u**2-(o*c-l**2));r[0]=Math.sqrt(u+h||1),r[1]=Math.sqrt(u-h||1)}static normalizeRect(e){const r=e.slice(0);return e[0]>e[2]&&(r[0]=e[2],r[2]=e[0]),e[1]>e[3]&&(r[1]=e[3],r[3]=e[1]),r}static intersect(e,r){const n=Math.max(Math.min(e[0],e[2]),Math.min(r[0],r[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(r[0],r[2]));if(n>i)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(r[1],r[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(r[1],r[3]));return a>s?null:[n,a,i,s]}static pointBoundingBox(e,r,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],r),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],r)}static rectBoundingBox(e,r,n,i,a){a[0]=Math.min(a[0],e,n),a[1]=Math.min(a[1],r,i),a[2]=Math.max(a[2],e,n),a[3]=Math.max(a[3],r,i)}static#e(e,r,n,i,a,s,o,l,c,u){if(c<=0||c>=1)return;const h=1-c,f=c*c,d=f*c,p=h*(h*(h*e+3*c*r)+3*f*n)+d*i,g=h*(h*(h*a+3*c*s)+3*f*o)+d*l;u[0]=Math.min(u[0],p),u[1]=Math.min(u[1],g),u[2]=Math.max(u[2],p),u[3]=Math.max(u[3],g)}static#t(e,r,n,i,a,s,o,l,c,u,h,f){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&this.#e(e,r,n,i,a,s,o,l,-h/u,f);return}const d=u**2-4*h*c;if(d<0)return;const p=Math.sqrt(d),g=2*c;this.#e(e,r,n,i,a,s,o,l,(-u+p)/g,f),this.#e(e,r,n,i,a,s,o,l,(-u-p)/g,f)}static bezierBoundingBox(e,r,n,i,a,s,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],r,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],r,l),this.#t(e,n,a,o,r,i,s,l,3*(-e+3*(n-a)+o),6*(e-2*n+a),3*(n-e),c),this.#t(e,n,a,o,r,i,s,l,3*(-r+3*(i-s)+l),6*(r-2*i+s),3*(i-r),c)}}function U_e(t){return decodeURIComponent(escape(t))}let V8=null,KO=null;function j_e(t){return V8||(V8=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,KO=new Map([["ſt","ſt"]])),t.replaceAll(V8,(e,r,n)=>r?r.normalize("NFKC"):KO.get(n))}function dY(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),fY(t)}const yg="pdfjs_internal_id_";function H_e(t,e,r){if(!Array.isArray(r)||r.length<2)return!1;const[n,i,...a]=r;if(!t(n)&&!Number.isInteger(n)||!e(i))return!1;const s=a.length;let o=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;o=!1;break;default:return!1}for(const l of a)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function Na(t,e,r){return Math.min(Math.max(t,e),r)}function pY(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(fY(t))}function G_e(t){return Uint8Array.fromBase64?Uint8Array.fromBase64(t):_b(atob(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(r=>{r(t(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(t){return t.reduce((e,r)=>e+r,0)});class xx{static textContent(e){const r=[],n={items:r,styles:Object.create(null)};function i(a){if(!a)return;let s=null;const o=a.name;if(o==="#text")s=a.value;else if(xx.shouldBuildText(o))a?.attributes?.textContent?s=a.attributes.textContent:a.value&&(s=a.value);else return;if(s!==null&&r.push({str:s}),!!a.children)for(const l of a.children)i(l)}return i(e),n}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}class gY{static setupStorage(e,r,n,i,a){const s=i.getValue(r,{value:null});switch(n.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),a==="print")break;e.addEventListener("input",o=>{i.setValue(r,{value:o.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(s.value===n.attributes.xfaOn?e.setAttribute("checked",!0):s.value===n.attributes.xfaOff&&e.removeAttribute("checked"),a==="print")break;e.addEventListener("change",o=>{i.setValue(r,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),a==="print")break;e.addEventListener("input",o=>{i.setValue(r,{value:o.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const o of n.children)o.attributes.value===s.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(r,{value:c})});break}}static setAttributes({html:e,element:r,storage:n=null,intent:i,linkService:a}){const{attributes:s}=r,o=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${i}`);for(const[l,c]of Object.entries(s))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}o&&a.addLinkAttributes(e,s.href,s.newWindow),n&&s.dataId&&this.setupStorage(e,s.dataId,r,n)}static render(e){const r=e.annotationStorage,n=e.linkService,i=e.xfaHtml,a=e.intent||"display",s=document.createElement(i.name);i.attributes&&this.setAttributes({html:s,element:i,intent:a,linkService:n});const o=a!=="richText",l=e.div;if(l.append(s),e.viewport){const h=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=h}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(i.children.length===0){if(i.value){const h=document.createTextNode(i.value);s.append(h),o&&xx.shouldBuildText(i.name)&&c.push(h)}return{textDivs:c}}const u=[[i,-1,s]];for(;u.length>0;){const[h,f,d]=u.at(-1);if(f+1===h.children.length){u.pop();continue}const p=h.children[++u.at(-1)[1]];if(p===null)continue;const{name:g}=p;if(g==="#text"){const v=document.createTextNode(p.value);c.push(v),d.append(v);continue}const m=p?.attributes?.xmlns?document.createElementNS(p.attributes.xmlns,g):document.createElement(g);if(d.append(m),p.attributes&&this.setAttributes({html:m,element:p,storage:r,intent:a,linkService:n}),p.children?.length>0)u.push([p,-1,m]);else if(p.value){const v=document.createTextNode(p.value);o&&xx.shouldBuildText(g)&&c.push(v),m.append(v)}}for(const h of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const r=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=r,e.div.hidden=!1}}const ru="http://www.w3.org/2000/svg";class mm{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Sb(t,e="text"){if(Wv(t,document.baseURI)){const r=await fetch(t);if(!r.ok)throw new Error(r.statusText);switch(e){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"json":return r.json()}return r.text()}return new Promise((r,n)=>{const i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"arraybuffer":case"blob":case"json":r(i.response);return}r(i.responseText);return}n(new Error(i.statusText))}},i.send(null)})}class Cb{constructor({viewBox:e,userUnit:r,scale:n,rotation:i,offsetX:a=0,offsetY:s=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=r,this.scale=n,this.rotation=i,this.offsetX=a,this.offsetY=s,n*=r;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let u,h,f,d;switch(i%=360,i<0&&(i+=360),i){case 180:u=-1,h=0,f=0,d=1;break;case 90:u=0,h=1,f=1,d=0;break;case 270:u=0,h=-1,f=-1,d=0;break;case 0:u=1,h=0,f=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(f=-f,d=-d);let p,g,m,v;u===0?(p=Math.abs(c-e[1])*n+a,g=Math.abs(l-e[0])*n+s,m=(e[3]-e[1])*n,v=(e[2]-e[0])*n):(p=Math.abs(l-e[0])*n+a,g=Math.abs(c-e[1])*n+s,m=(e[2]-e[0])*n,v=(e[3]-e[1])*n),this.transform=[u*n,h*n,f*n,d*n,p-u*n*l-f*n*c,g-h*n*l-d*n*c],this.width=m,this.height=v}get rawDims(){const e=this.viewBox;return Qt(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:r=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new Cb({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:r,offsetX:n,offsetY:i,dontFlip:a})}convertToViewportPoint(e,r){const n=[e,r];return ot.applyTransform(n,this.transform),n}convertToViewportRectangle(e){const r=[e[0],e[1]];ot.applyTransform(r,this.transform);const n=[e[2],e[3]];return ot.applyTransform(n,this.transform),[r[0],r[1],n[0],n[1]]}convertToPdfPoint(e,r){const n=[e,r];return ot.applyInverseTransform(n,this.transform),n}}class pD extends V0{constructor(e,r=0){super(e,"RenderingCancelledException"),this.extraDelay=r}}function fC(t){const e=t.length;let r=0;for(;r<e&&t[r].trim()==="";)r++;return t.substring(r,r+5).toLowerCase()==="data:"}function gD(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function W_e(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function q_e(t,e="document.pdf"){if(typeof t!="string")return e;if(fC(t))return Jt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(t);if(!n)return e;const i=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch{return o}},a=/\.pdf$/i,s=n.pathname.split("/").at(-1);if(a.test(s))return i(s);if(n.searchParams.size>0){const o=Array.from(n.searchParams.values()).reverse();for(const c of o)if(a.test(c))return i(c);const l=Array.from(n.searchParams.keys()).reverse();for(const c of l)if(a.test(c))return i(c)}if(n.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(l)return i(l[0])}return e}class ZO{started=Object.create(null);times=[];time(e){e in this.started&&Jt(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||Jt(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let r=0;for(const{name:n}of this.times)r=Math.max(n.length,r);for(const{name:n,start:i,end:a}of this.times)e.push(`${n.padEnd(r)} ${a-i}ms
67
- `);return e.join("")}}function Wv(t,e){const r=e?URL.parse(t,e):URL.parse(t);return r?.protocol==="http:"||r?.protocol==="https:"}function Bo(t){t.preventDefault()}function Tn(t){t.preventDefault(),t.stopPropagation()}function X_e(t){console.log("Deprecated API usage: "+t)}class UT{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=this.#e.exec(e);if(!r)return null;const n=parseInt(r[1],10);let i=parseInt(r[2],10);i=i>=1&&i<=12?i-1:0;let a=parseInt(r[3],10);a=a>=1&&a<=31?a:1;let s=parseInt(r[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(r[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(r[6],10);l=l>=0&&l<=59?l:0;const c=r[7]||"Z";let u=parseInt(r[8],10);u=u>=0&&u<=23?u:0;let h=parseInt(r[9],10)||0;return h=h>=0&&h<=59?h:0,c==="-"?(s+=u,o+=h):c==="+"&&(s-=u,o-=h),new Date(Date.UTC(n,i,a,s,o,l))}}function Y_e(t,{scale:e=1,rotation:r=0}){const{width:n,height:i}=t.attributes.style,a=[0,0,parseInt(n),parseInt(i)];return new Cb({viewBox:a,userUnit:1,scale:e,rotation:r})}function Ab(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Jt(`Not a valid color format: "${t}"`),[0,0,0])}function K_e(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const r of t.keys()){e.style.color=r;const n=window.getComputedStyle(e).color;t.set(r,Ab(n))}e.remove()}function _n(t){const{a:e,b:r,c:n,d:i,e:a,f:s}=t.getTransform();return[e,r,n,i,a,s]}function Pl(t){const{a:e,b:r,c:n,d:i,e:a,f:s}=t.getTransform().invertSelf();return[e,r,n,i,a,s]}function m0(t,e,r=!1,n=!0){if(e instanceof Cb){const{pageWidth:i,pageHeight:a}=e.rawDims,{style:s}=t,o=yi.isCSSRoundSupported,l=`var(--total-scale-factor) * ${i}px`,c=`var(--total-scale-factor) * ${a}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,h=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!r||e.rotation%180===0?(s.width=u,s.height=h):(s.width=h,s.height=u)}n&&t.setAttribute("data-main-rotation",e.rotation)}class Ac{constructor(){const{pixelRatio:e}=Ac;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,r,n,i,a=-1){let s=1/0,o=1/0,l=1/0;n=Ac.capPixels(n,a),n>0&&(s=Math.sqrt(n/(e*r))),i!==-1&&(o=i/e,l=i/r);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,r){if(r>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+r/100));return e>0?Math.min(e,n):n}return e}}const jT=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Z_e{static get isDarkMode(){return Qt(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class J_e{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:r}=e;r.width=r.height="0",r.display="none",r.color="var(--comment-fg-color)",document.body.append(e);const{color:n}=window.getComputedStyle(e);return e.remove(),Qt(this,"commentForegroundColor",Ab(n))}}function Q_e(t,e,r,n){n=Math.min(Math.max(n??1,0),1);const i=255*(1-n);return t=Math.round(t*n+i),e=Math.round(e*n+i),r=Math.round(r*n+i),[t,e,r]}function JO(t,e){const r=t[0]/255,n=t[1]/255,i=t[2]/255,a=Math.max(r,n,i),s=Math.min(r,n,i),o=(a+s)/2;if(a===s)e[0]=e[1]=0;else{const l=a-s;switch(e[1]=o<.5?l/(a+s):l/(2-a-s),a){case r:e[0]=((n-i)/l+(n<i?6:0))*60;break;case n:e[0]=((i-r)/l+2)*60;break;case i:e[0]=((r-n)/l+4)*60;break}}e[2]=o}function HT(t,e){const r=t[0],n=t[1],i=t[2],a=(1-Math.abs(2*i-1))*n,s=a*(1-Math.abs(r/60%2-1)),o=i-a/2;switch(Math.floor(r/60)){case 0:e[0]=a+o,e[1]=s+o,e[2]=o;break;case 1:e[0]=s+o,e[1]=a+o,e[2]=o;break;case 2:e[0]=o,e[1]=a+o,e[2]=s+o;break;case 3:e[0]=o,e[1]=s+o,e[2]=a+o;break;case 4:e[0]=s+o,e[1]=o,e[2]=a+o;break;case 5:case 6:e[0]=a+o,e[1]=o,e[2]=s+o;break}}function QO(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function eB(t,e,r){HT(t,r),r.map(QO);const n=.2126*r[0]+.7152*r[1]+.0722*r[2];HT(e,r),r.map(QO);const i=.2126*r[0]+.7152*r[1]+.0722*r[2];return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)}const tB=new Map;function eSe(t,e){const r=t[0]+t[1]*256+t[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let n=tB.get(r);if(n)return n;const i=new Float32Array(9),a=i.subarray(0,3),s=i.subarray(3,6);JO(t,s);const o=i.subarray(6,9);JO(e,o);const l=o[2]<.5,c=l?12:4.5;if(s[2]=l?Math.sqrt(s[2]):1-Math.sqrt(1-s[2]),eB(s,o,a)<c){let u,h;l?(u=s[2],h=1):(u=0,h=s[2]);const f=.005;for(;h-u>f;){const d=s[2]=(u+h)/2;l===eB(s,o,a)<c?u=d:h=d}s[2]=l?h:u}return HT(s,a),n=ot.makeHexColor(Math.round(a[0]*255),Math.round(a[1]*255),Math.round(a[2]*255)),tB.set(r,n),n}function mY({html:t,dir:e,className:r},n){const i=document.createDocumentFragment();if(typeof t=="string"){const a=document.createElement("p");a.dir=e||"auto";const s=t.split(/(?:\r\n?|\n)/);for(let o=0,l=s.length;o<l;++o){const c=s[o];a.append(document.createTextNode(c)),o<l-1&&a.append(document.createElement("br"))}i.append(a)}else gY.render({xfaHtml:t,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",r),n.append(i)}function vY(t){const e=new Path2D;if(!t)return e;for(let r=0,n=t.length;r<n;)switch(t[r++]){case H1.moveTo:e.moveTo(t[r++],t[r++]);break;case H1.lineTo:e.lineTo(t[r++],t[r++]);break;case H1.curveTo:e.bezierCurveTo(t[r++],t[r++],t[r++],t[r++],t[r++],t[r++]);break;case H1.quadraticCurveTo:e.quadraticCurveTo(t[r++],t[r++],t[r++],t[r++]);break;case H1.closePath:e.closePath();break;default:Jt(`Unrecognized drawing path operator: ${t[r-1]}`);break}return e}class Ey{#e=null;#t=null;#n;#r=null;#i=null;#a=null;#s=null;#o=null;static#l=null;constructor(e){this.#n=e,Ey.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const r=this.#n._uiManager._signal;r instanceof AbortSignal&&!r.aborted&&(e.addEventListener("contextmenu",Bo,{signal:r}),e.addEventListener("pointerdown",Ey.#c,{signal:r}));const n=this.#r=document.createElement("div");n.className="buttons",e.append(n);const i=this.#n.toolbarPosition;if(i){const{style:a}=e,s=this.#n._uiManager.direction==="ltr"?1-i[0]:i[0];a.insetInlineEnd=`${100*s}%`,a.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#c(e){e.stopPropagation()}#f(e){this.#n._focusEventsAllowed=!1,Tn(e)}#h(e){this.#n._focusEventsAllowed=!0,Tn(e)}#d(e){const r=this.#n._uiManager._signal;return!(r instanceof AbortSignal)||r.aborted?!1:(e.addEventListener("focusin",this.#f.bind(this),{capture:!0,signal:r}),e.addEventListener("focusout",this.#h.bind(this),{capture:!0,signal:r}),e.addEventListener("contextmenu",Bo,{signal:r}),!0)}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:r}=this.#n,n=document.createElement("button");n.classList.add("basic","deleteButton"),n.tabIndex=0,n.setAttribute("data-l10n-id",Ey.#l[e]),this.#d(n)&&n.addEventListener("click",i=>{r.delete()},{signal:r._signal}),this.#r.append(n)}get#m(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const r=await e.render();this.#d(r),this.#r.append(r,this.#m),this.#i=e}addComment(e,r=null){if(this.#a)return;const n=e.renderForToolbar();if(!n)return;this.#d(n);const i=this.#s=this.#m;r?(this.#r.insertBefore(n,r),this.#r.insertBefore(i,r)):this.#r.append(n,i),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;const r=e.renderButton();this.#d(r),this.#r.append(r,this.#m)}async addEditSignatureButton(e){const r=this.#o=await e.renderEditButton(this.#n);this.#d(r),this.#r.append(r,this.#m)}removeButton(e){e==="comment"&&(this.#a?.removeToolbarCommentButton(),this.#a=null,this.#s?.remove(),this.#s=null)}async addButton(e,r){switch(e){case"colorPicker":r&&this.addColorPicker(r);break;case"altText":r&&await this.addAltText(r);break;case"editSignature":r&&await this.addEditSignatureButton(r);break;case"delete":this.addDeleteButton();break;case"comment":r&&this.addComment(r);break}}async addButtonBefore(e,r,n){if(!r&&e==="comment")return;const i=this.#r.querySelector(n);i&&e==="comment"&&this.addComment(r,i)}updateEditSignatureButton(e){this.#o&&(this.#o.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class tSe{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){const e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar");const r=this.#n._signal;r instanceof AbortSignal&&!r.aborted&&e.addEventListener("contextmenu",Bo,{signal:r});const n=this.#e=document.createElement("div");return n.className="buttons",e.append(n),this.#n.hasCommentManager()&&this.#a("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#n.commentSelection("floating_button")}),this.#a("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#n.highlightSelection("floating_button")}),e}#i(e,r){let n=0,i=0;for(const a of e){const s=a.y+a.height;if(s<n)continue;const o=a.x+(r?a.width:0);if(s>n){i=o,n=s;continue}r?o>i&&(i=o):o<i&&(i=o)}return[r?1-i:i,n]}show(e,r,n){const[i,a]=this.#i(r,n),{style:s}=this.#t||=this.#r();e.append(this.#t),s.insetInlineEnd=`${100*i}%`,s.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(e,r,n,i){const a=document.createElement("button");a.classList.add("basic",e),a.tabIndex=0,a.setAttribute("data-l10n-id",r);const s=document.createElement("span");a.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",n);const o=this.#n._signal;o instanceof AbortSignal&&!o.aborted&&(a.addEventListener("contextmenu",Bo,{signal:o}),a.addEventListener("click",i,{signal:o})),this.#e.append(a)}}function yY(t,e,r){for(const n of r)e.addEventListener(n,t[n].bind(t))}class Nr{static#e=NaN;static#t=null;static#n=NaN;static#r=null;static initializeAndAddPointerId(e){(Nr.#t||=new Set).add(e)}static setPointer(e,r){Nr.#e||=r,Nr.#r??=e}static setTimeStamp(e){Nr.#n=e}static isSamePointerId(e){return Nr.#e===e}static isSamePointerIdOrRemove(e){return Nr.#e===e?!0:(Nr.#t?.delete(e),!1)}static isSamePointerType(e){return Nr.#r===e}static isInitializedAndDifferentPointerType(e){return Nr.#r!==null&&!Nr.isSamePointerType(e)}static isSameTimeStamp(e){return Nr.#n===e}static isUsingMultiplePointers(){return Nr.#t?.size>=1}static clearPointerType(){Nr.#r=null}static clearPointerIds(){Nr.#e=NaN,Nr.#t=null}static clearTimeStamp(){Nr.#n=NaN}}class rSe{#e=0;get id(){return`${vx}${this.#e++}`}}class mD{#e=dY();#t=0;#n=null;static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;const a=i.decode().then(()=>(n.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return Qt(this,"_isSVGFittingCanvas",a)}async#r(e,r){this.#n||=new Map;let n=this.#n.get(e);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let i;if(typeof r=="string"?(n.url=r,i=await Sb(r,"blob")):r instanceof File?i=n.file=r:r instanceof Blob&&(i=r),i.type==="image/svg+xml"){const a=mD._isSVGFittingCanvas,s=new FileReader,o=new Image,l=new Promise((c,u)=>{o.onload=()=>{n.bitmap=o,n.isSvg=!0,c()},s.onload=async()=>{const h=n.svgUrl=s.result;o.src=await a?`${h}#svgView(preserveAspectRatio(none))`:h},o.onerror=s.onerror=u});s.readAsDataURL(i),await l}else n.bitmap=await createImageBitmap(i);n.refCounter=1}catch(i){Jt(i),n=null}return this.#n.set(e,n),n&&this.#n.set(n.id,n),n}async getFromFile(e){const{lastModified:r,name:n,size:i,type:a}=e;return this.#r(`${r}_${n}_${i}_${a}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,r){const n=await r;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;const r=this.#n.get(e);if(!r)return null;if(r.bitmap)return r.refCounter+=1,r;if(r.file)return this.getFromFile(r.file);if(r.blobPromise){const{blobPromise:n}=r;return delete r.blobPromise,this.getFromBlob(r.id,n)}return this.getFromUrl(r.url)}getFromCanvas(e,r){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;const i=new OffscreenCanvas(r.width,r.height);return i.getContext("2d").drawImage(r,0,0),n={bitmap:i.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){const r=this.#n.get(e);return r?.isSvg?r.svgUrl:null}deleteId(e){this.#n||=new Map;const r=this.#n.get(e);if(!r||(r.refCounter-=1,r.refCounter!==0))return;const{bitmap:n}=r;if(!r.url&&!r.file){const i=new OffscreenCanvas(n.width,n.height);i.getContext("bitmaprenderer").transferFromImageBitmap(n),r.blobPromise=i.convertToBlob()}n.close?.(),r.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}}class nSe{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:r,post:n,mustExec:i,type:a=NaN,overwriteIfSameType:s=!1,keepUndo:o=!1}){if(i&&e(),this.#t)return;const l={cmd:e,undo:r,post:n,type:a};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(l);return}if(s&&this.#e[this.#r].type===a){o&&(l.undo=this.#e[this.#r].undo),this.#e[this.#r]=l;return}const c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(l)}undo(){if(this.#r===-1)return;this.#t=!0;const{undo:e,post:r}=this.#e[this.#r];e(),r?.(),this.#t=!1,this.#r-=1}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;const{cmd:e,post:r}=this.#e[this.#r];e(),r?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}cleanType(e){if(this.#r!==-1){for(let r=this.#r;r>=0;r--)if(this.#e[r].type!==e){this.#e.splice(r+1,this.#r-r),this.#r=r;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}}class Tb{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:r}=yi.platform;for(const[n,i,a={}]of e)for(const s of n){const o=s.startsWith("mac+");r&&o?(this.callbacks.set(s.slice(4),{callback:i,options:a}),this.allKeys.add(s.split("+").at(-1))):!r&&!o&&(this.callbacks.set(s,{callback:i,options:a}),this.allKeys.add(s.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const r=this.buffer.join("+");return this.buffer.length=0,r}exec(e,r){if(!this.allKeys.has(r.key))return;const n=this.callbacks.get(this.#e(r));if(!n)return;const{callback:i,options:{bubbles:a=!1,args:s=[],checker:o=null}}=n;o&&!o(e,r)||(i.bind(e,...s,r)(),a||Tn(r))}}class vD{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return K_e(e),Qt(this,"_colors",e)}convert(e){const r=Ab(e);if(!window.matchMedia("(forced-colors: active)").matches)return r;for(const[n,i]of this._colors)if(i.every((a,s)=>a===r[s]))return vD._colorsMapping.get(n);return r}getHexCode(e){const r=this._colors.get(e);return r?ot.makeHexColor(...r):e}}class nf{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#s=null;#o=null;#l=new nSe;#c=null;#f=null;#h=null;#d=0;#m=new Set;#g=null;#u=null;#p=new Set;_editorUndoBar=null;#v=!1;#x=!1;#y=!1;#C=null;#S=null;#b=null;#T=null;#w=!1;#A=null;#D=new rSe;#E=!1;#I=!1;#B=!1;#L=null;#R=null;#F=null;#N=null;#H=null;#k=er.NONE;#_=new Set;#P=null;#$=null;#V=null;#q=null;#W=null;#X={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#U=[0,0];#O=null;#G=null;#J=null;#Q=null;#z=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=nf.prototype,r=s=>s.#G.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),n=(s,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return Qt(this,"_keyboardManager",new Tb([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&s.#G.contains(o)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&s.#G.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:r}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:r}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:r}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:r}]]))}constructor(e,r,n,i,a,s,o,l,c,u,h,f,d,p,g,m){const v=this._signal=this.#e.signal;this.#G=e,this.#J=r,this.#Q=n,this.#a=i,this.#c=a,this.#$=s,this.#W=l,this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:v}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:v}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:v}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:v}),o._on("setpreference",this.onSetPreference.bind(this),{signal:v}),o._on("switchannotationeditorparams",y=>this.updateParams(y.type,y.value),{signal:v}),window.addEventListener("pointerdown",()=>{this.#I=!0},{capture:!0,signal:v}),window.addEventListener("pointerup",()=>{this.#I=!1},{capture:!0,signal:v}),this.#se(),this.#fe(),this.#te(),this.#s=l.annotationStorage,this.#C=l.filterFactory,this.#V=c,this.#T=u||null,this.#v=h,this.#x=f,this.#y=d,this.#H=p||null,this.viewParameters={realScale:mm.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=m!==!1,a?.setSidebarUiManager(this)}destroy(){this.#z?.resolve(),this.#z=null,this.#e?.abort(),this.#e=null,this._signal=null;for(const e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#p.clear(),this.#N?.clear(),this.#t=null,this.#_.clear(),this.#l.destroy(),this.#a?.destroy(),this.#c?.destroy(),this.#$?.destroy(),this.#A?.hide(),this.#A=null,this.#F?.destroy(),this.#F=null,this.#n=null,this.#S&&(clearTimeout(this.#S),this.#S=null),this.#O&&(clearTimeout(this.#O),this.#O=null),this._editorUndoBar?.destroy(),this.#W=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#H}get useNewAltTextFlow(){return this.#x}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return Qt(this,"hcmFilter",this.#V?this.#C.addHCMFilter(this.#V.foreground,this.#V.background):"none")}get direction(){return Qt(this,"direction",getComputedStyle(this.#G).direction)}get _highlightColors(){return Qt(this,"_highlightColors",this.#T?new Map(this.#T.split(",").map(e=>(e=e.split("=").map(r=>r.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return Qt(this,"highlightColors",null);const r=new Map,n=!!this.#V;for(const[i,a]of e){const s=i.endsWith("_HCM");if(n&&s){r.set(i.replace("_HCM",""),a);continue}!n&&!s&&r.set(i,a)}return Qt(this,"highlightColors",r)}get highlightColorNames(){return Qt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const r=this.highlightColorNames.get(e);return this._highlightColors.get(r)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#h=e}setMainHighlightColorPicker(e){this.#F=e}editAltText(e,r=!1){this.#a?.editAltText(this,e,r)}hasCommentManager(){return!!this.#c}editComment(e,r,n,i){this.#c?.showDialog(this,e,r,n,i)}selectComment(e,r){this.#i.get(e)?.getEditorByUID(r)?.toggleComment(!0,!0)}updateComment(e){this.#c?.updateComment(e.getData())}updatePopupColor(e){this.#c?.updatePopupColor(e)}removeComment(e){this.#c?.removeComments([e.uid])}toggleComment(e,r,n=void 0){this.#c?.toggleCommentPopup(e,r,n)}makeCommentColor(e,r){return e&&this.#c?.makeCommentColor(e,r)||null}getCommentDialogElement(){return this.#c?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;const{resolve:r,promise:n}=Promise.withResolvers(),i=a=>{a.pageNumber===e&&(this._eventBus._off("editorsrendered",i),r())};this._eventBus.on("editorsrendered",i),await n}getSignature(e){this.#$?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#$}switchToMode(e,r){this._eventBus.on("annotationeditormodechanged",r,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,r){this._eventBus.dispatch("setpreference",{source:this,name:e,value:r})}onSetPreference({name:e,value:r}){e==="enableNewAltTextWhenAddingImage"&&(this.#y=r)}onPageChanging({pageNumber:e}){this.#d=e-1}focusMainContainer(){this.#G.focus()}findParent(e,r){for(const n of this.#i.values()){const{x:i,y:a,width:s,height:o}=n.div.getBoundingClientRect();if(e>=i&&e<=i+s&&r>=a&&r<=a+o)return n}return null}disableUserSelect(e=!1){this.#J.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#p.add(e)}removeShouldRescale(e){this.#p.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*mm.PDF_TO_CSS_UNITS;for(const r of this.#p)r.onScaleChanging();this.#h?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Z({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#ee(e){const{currentLayer:r}=this;if(r.hasTextLayer(e))return r;for(const n of this.#i.values())if(n.hasTextLayer(e))return n;return null}highlightSelection(e="",r=!1){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:i,anchorOffset:a,focusNode:s,focusOffset:o}=n,l=n.toString(),u=this.#Z(n).closest(".textLayer"),h=this.getSelectionBoxes(u);if(!h)return;n.empty();const f=this.#ee(u),d=this.#k===er.NONE,p=()=>{const g=f?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:h,anchorNode:i,anchorOffset:a,focusNode:s,focusOffset:o,text:l});d&&this.showAllEditors("highlight",!0,!0),r&&g?.editComment()};if(d){this.switchToMode(er.HIGHLIGHT,p);return}p()}commentSelection(e=""){this.highlightSelection(e,!0)}#ie(){const e=document.getSelection();if(!e||e.isCollapsed)return;const n=this.#Z(e).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(this.#A||=new tSe(this),this.#A.show(n,i,this.direction==="ltr"))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#s)return null;const r=`${vx}${e}`,n=this.#s.getRawValue(r);return n&&this.#s.remove(r),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#s&&!this.#s.has(e.id)&&this.#s.setValue(e.id,e)}a11yAlert(e,r=null){const n=this.#Q;n&&(n.setAttribute("data-l10n-id",e),r?n.setAttribute("data-l10n-args",JSON.stringify(r)):n.removeAttribute("data-l10n-args"))}#ae(){const e=document.getSelection();if(!e||e.isCollapsed){this.#P&&(this.#A?.hide(),this.#P=null,this.#M({hasSelectedText:!1}));return}const{anchorNode:r}=e;if(r===this.#P)return;const i=this.#Z(e).closest(".textLayer");if(!i){this.#P&&(this.#A?.hide(),this.#P=null,this.#M({hasSelectedText:!1}));return}if(this.#A?.hide(),this.#P=r,this.#M({hasSelectedText:!0}),!(this.#k!==er.HIGHLIGHT&&this.#k!==er.NONE)&&(this.#k===er.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#w=this.isShiftKeyDown,!this.isShiftKeyDown)){const a=this.#k===er.HIGHLIGHT?this.#ee(i):null;if(a?.toggleDrawing(),this.#I){const s=new AbortController,o=this.combinedSignal(s),l=c=>{c.type==="pointerup"&&c.button!==0||(s.abort(),a?.toggleDrawing(!0),c.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",l,{signal:o}),window.addEventListener("blur",l,{signal:o})}else a?.toggleDrawing(!0),this.#Y("main_toolbar")}}#Y(e=""){this.#k===er.HIGHLIGHT?this.highlightSelection(e):this.#v&&this.#ie()}#se(){document.addEventListener("selectionchange",this.#ae.bind(this),{signal:this._signal})}#oe(){if(this.#b)return;this.#b=new AbortController;const e=this.combinedSignal(this.#b);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#le(){this.#b?.abort(),this.#b=null}blur(){if(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const r of this.#_)if(r.div.contains(e)){this.#R=[r,e],r._focusEventsAllowed=!1;break}}focus(){if(!this.#R)return;const[e,r]=this.#R;this.#R=null,r.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),r.focus()}#te(){if(this.#L)return;this.#L=new AbortController;const e=this.combinedSignal(this.#L);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#ce(){this.#L?.abort(),this.#L=null}#ue(){if(this.#f)return;this.#f=new AbortController;const e=this.combinedSignal(this.#f);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#he(){this.#f?.abort(),this.#f=null}#fe(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#te(),this.setEditingState(!0)}removeEditListeners(){this.#ce(),this.setEditingState(!1)}dragOver(e){for(const{type:r}of e.dataTransfer.items)for(const n of this.#u)if(n.isHandlingMimeForPasting(r)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const r of e.dataTransfer.items)for(const n of this.#u)if(n.isHandlingMimeForPasting(r.type)){n.paste(r,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const r=[];for(const n of this.#_){const i=n.serialize(!0);i&&r.push(i)}r.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:r}=e;for(const a of r.items)for(const s of this.#u)if(s.isHandlingMimeForPasting(a.type)){s.paste(a,this.currentLayer);return}let n=r.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(a){Jt(`paste: "${a.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const i=this.currentLayer;try{const a=[];for(const l of n){const c=await i.deserialize(l);if(!c)return;a.push(c)}const s=()=>{for(const l of a)this.#re(l);this.#ne(a)},o=()=>{for(const l of a)l.remove()};this.addCommands({cmd:s,undo:o,mustExec:!0})}catch(a){Jt(`paste: "${a.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#k!==er.NONE&&!this.isEditorHandlingKeyboard&&nf._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#Y("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}#M(e){Object.entries(e).some(([n,i])=>this.#X[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#X,e)}),this.#k===er.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#j([[_r.HIGHLIGHT_FREE,!0]]))}#j(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#oe(),this.#ue(),this.#M({isEditing:this.#k!==er.NONE,isEmpty:this.#K(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#le(),this.#he(),this.#M({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#u){this.#u=e;for(const r of this.#u)this.#j(r.defaultPropertiesToUpdate)}}getId(){return this.#D.id}get currentLayer(){return this.#i.get(this.#d)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#d}addLayer(e){this.#i.set(e.pageIndex,e),this.#E?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,r=null,n=!1,i=!1,a=!1,s=!1){if(this.#k!==e&&!(this.#z&&(await this.#z.promise,!this.#z))){if(this.#z=Promise.withResolvers(),this.#h?.commitOrRemove(),this.#k===er.POPUP&&this.#c?.hideSidebar(),this.#c?.destroyPopup(),this.#k=e,e===er.NONE){this.setEditingState(!1),this.#pe();for(const o of this.#r.values())o.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#z.resolve();return}for(const o of this.#r.values())o.addStandaloneCommentButton();e===er.SIGNATURE&&await this.#$?.loadSignatures(),n&&Nr.clearPointerType(),this.setEditingState(!0),await this.#de(),this.unselectAll();for(const o of this.#i.values())o.updateMode(e);if(e===er.POPUP){this.#n||=await this.#W.getAnnotationsByType(new Set(this.#u.map(c=>c._editorType)));const o=new Set,l=[];for(const c of this.#r.values()){const{annotationElementId:u,hasComment:h,deleted:f}=c;u&&o.add(u),h&&!f&&l.push(c.getData())}for(const c of this.#n){const{id:u,popupRef:h,contentsObj:f}=c;h&&f?.str&&!o.has(u)&&!this.#m.has(u)&&l.push(c)}this.#c?.showSidebar(l)}if(!r){i&&this.addNewEditorFromKeyboard(),this.#z.resolve();return}for(const o of this.#r.values())o.uid===r?(this.setSelected(o),s?o.editComment():a?o.enterInEditMode():o.focus()):o.unselect();this.#z.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#k&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,r){if(this.#u){switch(e){case _r.CREATE:this.currentLayer.addNewEditor(r);return;case _r.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#q||=new Map).set(e,r),this.showAllEditors("highlight",r);break}if(this.hasSelection)for(const n of this.#_)n.updateParams(e,r);else for(const n of this.#u)n.updateDefaultParams(e,r)}}showAllEditors(e,r,n=!1){for(const a of this.#r.values())a.editorType===e&&a.show(r);(this.#q?.get(_r.HIGHLIGHT_SHOW_ALL)??!0)!==r&&this.#j([[_r.HIGHLIGHT_SHOW_ALL,r]])}enableWaiting(e=!1){if(this.#B!==e){this.#B=e;for(const r of this.#i.values())e?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",e)}}async#de(){if(!this.#E){this.#E=!0;const e=[];for(const r of this.#i.values())e.push(r.enable());await Promise.all(e);for(const r of this.#r.values())r.enable()}}#pe(){if(this.unselectAll(),this.#E){this.#E=!1;for(const e of this.#i.values())e.disable();for(const e of this.#r.values())e.disable()}}*getEditors(e){for(const r of this.#r.values())r.pageIndex===e&&(yield r)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.focusMainContainer(),this.#S=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#N?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#m.has(e.annotationElementId))&&this.#s?.remove(e.id)}addDeletedAnnotationElement(e){this.#m.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#m.has(e)}removeDeletedAnnotationElement(e){this.#m.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#re(e){const r=this.#i.get(e.pageIndex);r?r.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#j(e.propertiesToUpdate))}get#ge(){let e=null;for(e of this.#_);return e}updateUI(e){this.#ge===e&&this.#j(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#j(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#_.has(e)){this.#_.delete(e),e.unselect(),this.#M({hasSelectedEditor:this.hasSelection});return}this.#_.add(e),e.select(),this.#j(e.propertiesToUpdate),this.#M({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#h?.commitOrRemove();for(const r of this.#_)r!==e&&r.unselect();this.#_.clear(),this.#_.add(e),e.select(),this.#j(e.propertiesToUpdate),this.#M({hasSelectedEditor:!0})}isSelected(e){return this.#_.has(e)}get firstSelectedEditor(){return this.#_.values().next().value}unselect(e){e.unselect(),this.#_.delete(e),this.#M({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#_.size!==0}get isEnterHandled(){return this.#_.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#M({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#K()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#M({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#K()})}addCommands(e){this.#l.add(e),this.#M({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#K()})}cleanUndoStack(e){this.#l.cleanType(e)}#K(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(const e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();const e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const r=e?[e]:[...this.#_],n=()=>{this._editorUndoBar?.show(i,r.length===1?r[0].editorType:r.length);for(const a of r)a.remove()},i=()=>{for(const a of r)this.#re(a)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#ne(e){for(const r of this.#_)r.unselect();this.#_.clear();for(const r of e)r.isEmpty()||(this.#_.add(r),r.select());this.#M({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#_)e.commit();this.#ne(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#k!==er.NONE))&&!this.#h?.commitOrRemove()&&this.hasSelection){for(const e of this.#_)e.unselect();this.#_.clear(),this.#M({hasSelectedEditor:!1})}}translateSelectedEditors(e,r,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#U[0]+=e,this.#U[1]+=r;const[i,a]=this.#U,s=[...this.#_],o=1e3;this.#O&&clearTimeout(this.#O),this.#O=setTimeout(()=>{this.#O=null,this.#U[0]=this.#U[1]=0,this.addCommands({cmd:()=>{for(const l of s)this.#r.has(l.id)&&(l.translateInPage(i,a),l.translationDone())},undo:()=>{for(const l of s)this.#r.has(l.id)&&(l.translateInPage(-i,-a),l.translationDone())},mustExec:!1})},o);for(const l of s)l.translateInPage(e,r),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(const e of this.#_)this.#g.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);const e=this.#g;this.#g=null;let r=!1;for(const[{x:i,y:a,pageIndex:s},o]of e)o.newX=i,o.newY=a,o.newPageIndex=s,r||=i!==o.savedX||a!==o.savedY||s!==o.savedPageIndex;if(!r)return!1;const n=(i,a,s,o)=>{if(this.#r.has(i.id)){const l=this.#i.get(o);l?i._setParentAndPosition(l,a,s):(i.pageIndex=o,i.x=a,i.y=s)}};return this.addCommands({cmd:()=>{for(const[i,{newX:a,newY:s,newPageIndex:o}]of e)n(i,a,s,o)},undo:()=>{for(const[i,{savedX:a,savedY:s,savedPageIndex:o}]of e)n(i,a,s,o)},mustExec:!0}),!0}dragSelectedEditors(e,r){if(this.#g)for(const n of this.#g.keys())n.drag(e,r)}rebuild(e){if(e.parent===null){const r=this.getLayer(e.pageIndex);r?(r.changeParent(e),r.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#_.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#k}isEditingMode(){return this.#k!==er.NONE}get imageManager(){return Qt(this,"imageManager",new mD)}getSelectionBoxes(e){if(!e)return null;const r=document.getSelection();for(let c=0,u=r.rangeCount;c<u;c++)if(!e.contains(r.getRangeAt(c).commonAncestorContainer))return null;const{x:n,y:i,width:a,height:s}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,u,h,f)=>({x:(u-i)/s,y:1-(c+h-n)/a,width:f/s,height:h/a});break;case"180":o=(c,u,h,f)=>({x:1-(c+h-n)/a,y:1-(u+f-i)/s,width:h/a,height:f/s});break;case"270":o=(c,u,h,f)=>({x:1-(u+f-i)/s,y:(c-n)/a,width:f/s,height:h/a});break;default:o=(c,u,h,f)=>({x:(c-n)/a,y:(u-i)/s,width:h/a,height:f/s});break}const l=[];for(let c=0,u=r.rangeCount;c<u;c++){const h=r.getRangeAt(c);if(!h.collapsed)for(const{x:f,y:d,width:p,height:g}of h.getClientRects())p===0||g===0||l.push(o(f,d,p,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:r}){(this.#o||=new Map).set(e,r)}removeChangedExistingAnnotation({annotationElementId:e}){this.#o?.delete(e)}renderAnnotationElement(e){const r=this.#o?.get(e.data.id);if(!r)return;const n=this.#s.getRawValue(r);n&&(this.#k===er.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,r,n){const i=this.#N?.get(e);i&&(i.setCanvas(r,n),this.#N.delete(e))}addMissingCanvas(e,r){(this.#N||=new Map).set(e,r)}}class Jl{#e=null;#t=!1;#n=null;#r=null;#i=null;#a=null;#s=!1;#o=null;#l=null;#c=null;#f=null;#h=!1;static#d=null;static _l10n=null;constructor(e){this.#l=e,this.#h=e._uiManager.useNewAltTextFlow,Jl.#d||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){Jl._l10n??=e}async render(){const e=this.#n=document.createElement("button");e.className="altText",e.tabIndex="0";const r=this.#r=document.createElement("span");e.append(r),this.#h?(e.classList.add("new"),e.setAttribute("data-l10n-id",Jl.#d.missing),r.setAttribute("data-l10n-id",Jl.#d["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const n=this.#l._uiManager._signal;e.addEventListener("contextmenu",Bo,{signal:n}),e.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:n});const i=a=>{a.preventDefault(),this.#l._uiManager.editAltText(this.#l),this.#h&&this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#m}})};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",a=>{a.target===e&&a.key==="Enter"&&(this.#s=!0,i(a))},{signal:n}),await this.#g(),e}get#m(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#s}),this.#s=!1)}isEmpty(){return this.#h?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#h?this.#e!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(e){this.#e===null&&(this.#c=e,this.#f=await Jl._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#g())}toggleAltTextBadge(e=!1){if(!this.#h||this.#e){this.#o?.remove(),this.#o=null;return}if(!this.#o){const r=this.#o=document.createElement("div");r.className="noAltTextBadge",this.#l.div.append(r)}this.#o.classList.toggle("hidden",!e)}serialize(e){let r=this.#e;return!e&&this.#c===r&&(r=this.#f),{altText:r,decorative:this.#t,guessedText:this.#c,textWithDisclaimer:this.#f}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:r,guessedText:n,textWithDisclaimer:i,cancel:a=!1}){n&&(this.#c=n,this.#f=i),!(this.#e===e&&this.#t===r)&&(a||(this.#e=e,this.#t=r),this.#g())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#m}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#o?.remove(),this.#o=null}async#g(){const e=this.#n;if(!e)return;if(this.#h){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",Jl.#d[this.#m]),this.#r?.setAttribute("data-l10n-id",Jl.#d[`${this.#m}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#i?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let r=this.#i;if(!r){this.#i=r=document.createElement("span"),r.className="tooltip",r.setAttribute("role","tooltip"),r.id=`alt-text-tooltip-${this.#l.id}`;const i=100,a=this.#l._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add("show"),this.#l._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:a}),e.addEventListener("mouseleave",()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.#i?.classList.remove("show")},{signal:a})}this.#t?r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(r.removeAttribute("data-l10n-id"),r.textContent=this.#e),r.parentNode||e.append(r),this.#l.getElementForAltText()?.setAttribute("aria-describedby",r.id)}}class R2{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#s=null;#o=null;#l=!1;#c=null;constructor(e){this.#r=e}renderForToolbar(){const e=this.#t=document.createElement("button");return e.className="comment",this.#f(e,!1)}renderForStandalone(){const e=this.#e=document.createElement("button");e.className="annotationCommentButton";const r=this.#r.commentButtonPosition;if(r){const{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction==="ltr"?1-r[0]:r[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*r[1]}% - var(--comment-button-dim))`;const i=this.#r.commentButtonColor;i&&(n.backgroundColor=i)}return this.#f(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;const e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#c)return this.#c;if(!this.#e)return null;const{x:e,y:r,height:n}=this.#e.getBoundingClientRect(),{x:i,y:a,width:s,height:o}=this.#r.parent.boundingClientRect;return[(e-i)/s,(r+n-a)/o]}set commentPopupPositionInLayer(e){this.#c=e}hasDefaultPopupPosition(){return this.#c===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:r}){this.#e&&(this.#e.classList.toggle("selected",e),this.#e.ariaExpanded=r)}#f(e,r){if(!this.#r._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",r?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener("contextmenu",Bo,{signal:n}),r&&(e.addEventListener("focusin",a=>{this.#r._focusEventsAllowed=!1,Tn(a)},{capture:!0,signal:n}),e.addEventListener("focusout",a=>{this.#r._focusEventsAllowed=!0,Tn(a)},{capture:!0,signal:n})),e.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:n});const i=a=>{a.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",a=>{a.target===e&&a.key==="Enter"&&(this.#n=!0,i(a))},{signal:n}),e.addEventListener("pointerenter",()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener("pointerleave",()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){const r=this.commentPopupPositionInLayer;let n,i;if(r)[n,i]=r;else{[n,i]=this.#r.commentButtonPosition;const{width:u,height:h,x:f,y:d}=this.#r;n=f+n*u,i=d+i*h}const a=this.#r.parent.boundingClientRect,{x:s,y:o,width:l,height:c}=a;this.#r._uiManager.editComment(this.#r,s+n*l,o+i*c,{...e,parentDimensions:a})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#l||this.#s===""}isEmpty(){return this.#s===null}hasBeenEdited(){return this.isDeleted()||this.#s!==this.#i}serialize(){return this.data}get data(){return{text:this.#s,richText:this.#a,date:this.#o,deleted:this.isDeleted()}}set data(e){if(e!==this.#s&&(this.#a=null),e===null){this.#s="",this.#l=!0;return}this.#s=e,this.#o=new Date,this.#l=!1}setInitialText(e,r=null){this.#i=e,this.data=e,this.#o=null,this.#a=r}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#s="",this.#a=null,this.#o=null,this.#r=null,this.#n=!1,this.#l=!1}}class dC{#e;#t=!1;#n=null;#r;#i;#a;#s;#o=null;#l;#c=null;#f;#h=null;constructor({container:e,isPinchingDisabled:r=null,isPinchingStopped:n=null,onPinchStart:i=null,onPinching:a=null,onPinchEnd:s=null,signal:o}){this.#e=e,this.#n=n,this.#r=r,this.#i=i,this.#a=a,this.#s=s,this.#f=new AbortController,this.#l=AbortSignal.any([o,this.#f.signal]),e.addEventListener("touchstart",this.#d.bind(this),{passive:!1,signal:this.#l})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Ac.pixelRatio}#d(e){if(this.#r?.())return;if(e.touches.length===1){if(this.#o)return;const i=this.#o=new AbortController,a=AbortSignal.any([this.#l,i.signal]),s=this.#e,o={capture:!0,signal:a,passive:!1},l=c=>{c.pointerType==="touch"&&(this.#o?.abort(),this.#o=null)};s.addEventListener("pointerdown",c=>{c.pointerType==="touch"&&(Tn(c),l(c))},o),s.addEventListener("pointerup",l,o),s.addEventListener("pointercancel",l,o);return}if(!this.#h){this.#h=new AbortController;const i=AbortSignal.any([this.#l,this.#h.signal]),a=this.#e,s={signal:i,capture:!1,passive:!1};a.addEventListener("touchmove",this.#m.bind(this),s);const o=this.#g.bind(this);a.addEventListener("touchend",o,s),a.addEventListener("touchcancel",o,s),s.capture=!0,a.addEventListener("pointerdown",Tn,s),a.addEventListener("pointermove",Tn,s),a.addEventListener("pointercancel",Tn,s),a.addEventListener("pointerup",Tn,s),this.#i?.()}if(Tn(e),e.touches.length!==2||this.#n?.()){this.#c=null;return}let[r,n]=e.touches;r.identifier>n.identifier&&([r,n]=[n,r]),this.#c={touch0X:r.screenX,touch0Y:r.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#m(e){if(!this.#c||e.touches.length!==2)return;Tn(e);let[r,n]=e.touches;r.identifier>n.identifier&&([r,n]=[n,r]);const{screenX:i,screenY:a}=r,{screenX:s,screenY:o}=n,l=this.#c,{touch0X:c,touch0Y:u,touch1X:h,touch1Y:f}=l,d=h-c,p=f-u,g=s-i,m=o-a,v=Math.hypot(g,m)||1,y=Math.hypot(d,p)||1;if(!this.#t&&Math.abs(y-v)<=dC.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=a,l.touch1X=s,l.touch1Y=o,!this.#t){this.#t=!0;return}const x=[(i+s)/2,(a+o)/2];this.#a?.(x,y,v)}#g(e){e.touches.length>=2||(this.#h&&(this.#h.abort(),this.#h=null,this.#s?.()),this.#c&&(Tn(e),this.#c=null,this.#t=!1))}destroy(){this.#f?.abort(),this.#f=null,this.#o?.abort(),this.#o=null}}class It{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#s=null;#o="";#l=null;#c=null;#f=null;#h=null;#d=null;#m="";#g=!1;#u=null;#p=!1;#v=!1;#x=!1;#y=null;#C=0;#S=0;#b=null;#T=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#w=!1;#A=It._zIndex++;static _borderLineWidth=-1;static _colorManager=new vD;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=It.prototype._resizeWithKeyboard,r=nf.TRANSLATE_SMALL,n=nf.TRANSLATE_BIG;return Qt(this,"_resizerKeyboardManager",new Tb([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],It.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;const{rotation:r,rawDims:{pageWidth:n,pageHeight:i,pageX:a,pageY:s}}=this.parent.viewport;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[a,s];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Qt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const r=new iSe({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});r.annotationElementId=e.annotationElementId,r.deleted=!0,r._uiManager.addToAnnotationStorage(r)}static initialize(e,r){if(It._l10n??=e,It._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),It._borderLineWidth!==-1)return;const n=getComputedStyle(document.documentElement);It._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,r){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,r){rn("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,r]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*r/(e*2),this.y+=this.width*e/(r*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*r/(e*2),this.y-=this.width*e/(r*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#A}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(this.#O(),this.#h?.remove(),this.#h=null),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#g?this.#g=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,r,n,i){const[a,s]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(e+n)/a,this.y=(r+i)/s,this.fixAndSetPosition()}_moveAfterPaste(e,r){const[n,i]=this.parentDimensions;this.setAt(e*n,r*i,this.width*n,this.height*i),this._onTranslated()}#D([e,r],n,i){[n,i]=this.screenToPageTranslation(n,i),this.x+=n/e,this.y+=i/r,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,r){this.#D(this.parentDimensions,e,r)}translateInPage(e,r){this.#u||=[this.x,this.y,this.width,this.height],this.#D(this.pageDimensions,e,r),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,r){this.#u||=[this.x,this.y,this.width,this.height];const{div:n,parentDimensions:[i,a]}=this;if(this.x+=e/i,this.y+=r/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:h,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:o}=this;const[l,c]=this.getBaseTranslation();s+=l,o+=c;const{style:u}=n;u.left=`${(100*s).toFixed(2)}%`,u.top=`${(100*o).toFixed(2)}%`,this._onTranslating(s,o),n.scrollIntoView({block:"nearest"})}_onTranslating(e,r){}_onTranslated(e,r){}get _hasBeenMoved(){return!!this.#u&&(this.#u[0]!==this.x||this.#u[1]!==this.y)}get _hasBeenResized(){return!!this.#u&&(this.#u[2]!==this.width||this.#u[3]!==this.height)}getBaseTranslation(){const[e,r]=this.parentDimensions,{_borderLineWidth:n}=It,i=n/e,a=n/r;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:r},pageDimensions:[n,i]}=this;let{x:a,y:s,width:o,height:l}=this;if(o*=n,l*=i,a*=n,s*=i,this._mustFixPosition)switch(e){case 0:a=Na(a,0,n-o),s=Na(s,0,i-l);break;case 90:a=Na(a,0,n-l),s=Na(s,o,i);break;case 180:a=Na(a,o,n),s=Na(s,l,i);break;case 270:a=Na(a,l,n),s=Na(s,0,i-o);break}this.x=a/=n,this.y=s/=i;const[c,u]=this.getBaseTranslation();a+=c,s+=u,r.left=`${(100*a).toFixed(2)}%`,r.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#E(e,r,n){switch(n){case 90:return[r,-e];case 180:return[-e,-r];case 270:return[-r,e];default:return[e,r]}}screenToPageTranslation(e,r){return It.#E(e,r,this.parentRotation)}pageTranslationToScreen(e,r){return It.#E(e,r,360-this.parentRotation)}#I(e){switch(e){case 90:{const[r,n]=this.pageDimensions;return[0,-r/n,n/r,0]}case 180:return[-1,0,0,-1];case 270:{const[r,n]=this.pageDimensions;return[0,r/n,-n/r,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[r,n]}=this;return[r*e,n*e]}setDims(){const{div:{style:e},width:r,height:n}=this;e.width=`${(100*r).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#B(){if(this.#l)return;this.#l=document.createElement("div"),this.#l.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],r=this._uiManager._signal;for(const n of e){const i=document.createElement("div");this.#l.append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",this.#L.bind(this,n),{signal:r}),i.addEventListener("contextmenu",Bo,{signal:r}),i.tabIndex=-1}this.div.prepend(this.#l)}#L(e,r){r.preventDefault();const{isMac:n}=yi.platform;if(r.button!==0||r.ctrlKey&&n)return;this.#n?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,this.#c=[r.screenX,r.screenY];const a=new AbortController,s=this._uiManager.combinedSignal(a);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#N.bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Tn,{passive:!1,signal:s}),window.addEventListener("contextmenu",Bo,{signal:s}),this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(r.target).cursor;const c=()=>{a.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=l,this.#F()};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})}#R(e,r,n,i){this.width=n,this.height=i,this.x=e,this.y=r,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#F(){if(!this.#f)return;const{savedX:e,savedY:r,savedWidth:n,savedHeight:i}=this.#f;this.#f=null;const a=this.x,s=this.y,o=this.width,l=this.height;a===e&&s===r&&o===n&&l===i||this.addCommands({cmd:this.#R.bind(this,a,s,o,l),undo:this.#R.bind(this,e,r,n,i),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(e,r){const[n,i]=this.parentDimensions,a=this.x,s=this.y,o=this.width,l=this.height,c=It.MIN_SIZE/n,u=It.MIN_SIZE/i,h=this.#I(this.rotation),f=(D,L)=>[h[0]*D+h[2]*L,h[1]*D+h[3]*L],d=this.#I(360-this.rotation),p=(D,L)=>[d[0]*D+d[2]*L,d[1]*D+d[3]*L];let g,m,v=!1,y=!1;switch(e){case"topLeft":v=!0,g=(D,L)=>[0,0],m=(D,L)=>[D,L];break;case"topMiddle":g=(D,L)=>[D/2,0],m=(D,L)=>[D/2,L];break;case"topRight":v=!0,g=(D,L)=>[D,0],m=(D,L)=>[0,L];break;case"middleRight":y=!0,g=(D,L)=>[D,L/2],m=(D,L)=>[0,L/2];break;case"bottomRight":v=!0,g=(D,L)=>[D,L],m=(D,L)=>[0,0];break;case"bottomMiddle":g=(D,L)=>[D/2,L],m=(D,L)=>[D/2,0];break;case"bottomLeft":v=!0,g=(D,L)=>[0,L],m=(D,L)=>[D,0];break;case"middleLeft":y=!0,g=(D,L)=>[0,L/2],m=(D,L)=>[D,L/2];break}const x=g(o,l),b=m(o,l);let w=f(...b);const _=It._round(a+w[0]),S=It._round(s+w[1]);let C=1,T=1,A,k;if(r.fromKeyboard)({deltaX:A,deltaY:k}=r);else{const{screenX:D,screenY:L}=r,[P,O]=this.#c;[A,k]=this.screenToPageTranslation(D-P,L-O),this.#c[0]=D,this.#c[1]=L}if([A,k]=p(A/n,k/i),v){const D=Math.hypot(o,l);C=T=Math.max(Math.min(Math.hypot(b[0]-x[0]-A,b[1]-x[1]-k)/D,1/o,1/l),c/o,u/l)}else y?C=Na(Math.abs(b[0]-x[0]-A),c,1)/o:T=Na(Math.abs(b[1]-x[1]-k),u,1)/l;const I=It._round(o*C),E=It._round(l*T);w=f(...m(I,E));const M=_-w[0],R=S-w[1];this.#u||=[this.x,this.y,this.width,this.height],this.width=I,this.height=E,this.x=M,this.y=R,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#v)return this._editToolbar;this._editToolbar=new Ey(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[r,n]of e)await this._editToolbar.addButton(r,n);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){const r=this._editToolbar?.div;r?r.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(Jl.initialize(It._l10n),this.#n=new Jl(this),this.#e&&(this.#n.data=this.#e,this.#e=null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new R2(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#i){this._uiManager.isEditingMode()&&this.#i.classList.remove("hidden");return}this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i))}}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add("hidden")}get comment(){const{data:{richText:e,text:r,date:n,deleted:i}}=this.#r;return{text:r,richText:e,date:n,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new R2(this),this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:r,richText:n}){if(!r||(this.#r||=new R2(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new R2(this),this.#r.edit(e)}toggleComment(e,r=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,r)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,i]=e.rect,[a]=this.pageDimensions,[s]=this.pageTranslation,o=s+a+1,l=i-100,c=o+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,c,i]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:r}}){this.#r.data=r?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=this.#a?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#V();const[r,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*n/r).toFixed(2)}%`,e.style.maxHeight=`${(100*r/n).toFixed(2)}%`);const[i,a]=this.getInitialTranslation();return this.translate(i,a),yY(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#T||=new dC({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#H.bind(this),onPinching:this.#k.bind(this),onPinchEnd:this.#_.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#H(){this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#k(e,r,n){let a=.7*(n/r)+1-.7;if(a===1)return;const s=this.#I(this.rotation),o=(_,S)=>[s[0]*_+s[2]*S,s[1]*_+s[3]*S],[l,c]=this.parentDimensions,u=this.x,h=this.y,f=this.width,d=this.height,p=It.MIN_SIZE/l,g=It.MIN_SIZE/c;a=Math.max(Math.min(a,1/f,1/d),p/f,g/d);const m=It._round(f*a),v=It._round(d*a);if(m===f&&v===d)return;this.#u||=[u,h,f,d];const y=o(f/2,d/2),x=It._round(u+y[0]),b=It._round(h+y[1]),w=o(m/2,v/2);this.x=x-w[0],this.y=b-w[1],this.width=m,this.height=v,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#_(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#F()}pointerdown(e){const{isMac:r}=yi.platform;if(e.button!==0||e.ctrlKey&&r){e.preventDefault();return}if(this.#g=!0,this._isDraggable){this.#$(e);return}this.#P(e)}#P(e){const{isMac:r}=yi.platform;e.ctrlKey&&!r||e.shiftKey||e.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}#$(e){const{isSelected:r}=this;this._uiManager.setUpDragSession();let n=!1;const i=new AbortController,a=this._uiManager.combinedSignal(i),s={capture:!0,passive:!1,signal:a},o=c=>{i.abort(),this.#s=null,this.#g=!1,this._uiManager.endDragSession()||this.#P(c),n&&this._onStopDragging()};r&&(this.#C=e.clientX,this.#S=e.clientY,this.#s=e.pointerId,this.#o=e.pointerType,window.addEventListener("pointermove",c=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:u,clientY:h,pointerId:f}=c;if(f!==this.#s){Tn(c);return}const[d,p]=this.screenToPageTranslation(u-this.#C,h-this.#S);this.#C=u,this.#S=h,this._uiManager.dragSelectedEditors(d,p)},s),window.addEventListener("touchmove",Tn,s),window.addEventListener("pointerdown",c=>{c.pointerType===this.#o&&(this.#T||c.isPrimary)&&o(c),Tn(c)},s));const l=c=>{if(!this.#s||this.#s===c.pointerId){o(c);return}Tn(c)};window.addEventListener("pointerup",l,{signal:a}),window.addEventListener("blur",l,{signal:a})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,r,n){e.changeParent(this),this.x=r,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,r,n=this.rotation){const i=this.parentScale,[a,s]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/i,u=r/i,h=this.x*a,f=this.y*s,d=this.width*a,p=this.height*s;switch(n){case 0:return[h+c+o,s-f-u-p+l,h+c+d+o,s-f-u+l];case 90:return[h+u+o,s-f+c+l,h+u+p+o,s-f+c+d+l];case 180:return[h-c-d+o,s-f+u+l,h-c+o,s-f+u+p+l];case 270:return[h-u-p+o,s-f-c-d+l,h-u+o,s-f-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,r){const[n,i,a,s]=e,o=a-n,l=s-i;switch(this.rotation){case 0:return[n,r-s,o,l];case 90:return[n,r-i,l,o];case 180:return[a,r-i,o,l];case 270:return[a,r-s,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&It._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){const{comment:{text:e,color:r,date:n,opacity:i,deleted:a,richText:s},uid:o,pageIndex:l,creationDate:c,modificationDate:u}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:s,contentsObj:{str:e},creationDate:c,modificationDate:n||u,popupRef:!a,color:r,opacity:i}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#v=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#v=!1,!0):!1}isInEditMode(){return this.#v}shouldGetKeyboardEvents(){return this.#x}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:r,bottom:n,right:i}=this.getClientDimensions(),{innerHeight:a,innerWidth:s}=window;return r<s&&i>0&&e<a&&n>0}#V(){if(this.#d||!this.div)return;this.#d=new AbortController;const e=this._uiManager.combinedSignal(this.#d);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#V()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,r=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(e,r,n){const i=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});i.rotation=e.rotation,i.#e=e.accessibilityData,i._isCopy=e.isCopy||!1;const[a,s]=i.pageDimensions,[o,l,c,u]=i.getRectInCurrentCoords(e.rect,s);return i.x=o/a,i.y=l/s,i.width=c/a,i.height=u/s,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#d?.abort(),this.#d=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#O(),this.removeEditToolbar(),this.#b){for(const e of this.#b.values())clearTimeout(e);this.#b=null}this.parent=null,this.#T?.destroy(),this.#T=null,this.#h?.remove(),this.#h=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#B(),this.#l.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,r]}=this,[n,i,a,s]=this.getPDFRect();return[It._round(n+(a-n)*e),It._round(i+(s-i)*(1-r))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const r=this.#l.children;if(!this.#t){this.#t=Array.from(r);const s=this.#q.bind(this),o=this.#W.bind(this),l=this._uiManager._signal;for(const c of this.#t){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",this.#X.bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",It._l10nResizer[u])}}const n=this.#t[0];let i=0;for(const s of r){if(s===n)break;i++}const a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let o=0;o<i-a;o++)this.#l.append(this.#l.firstElementChild);else if(a>i)for(let o=0;o<a-i;o++)this.#l.firstElementChild.before(this.#l.lastElementChild);let s=0;for(const o of r){const c=this.#t[s++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",It._l10nResizer[c])}}this.#U(0),this.#x=!0,this.#l.firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#q(e){It._resizerKeyboardManager.exec(this,e)}#W(e){this.#x&&e.relatedTarget?.parentNode!==this.#l&&this.#O()}#X(e){this.#m=this.#x?e:""}#U(e){if(this.#t)for(const r of this.#t)r.tabIndex=e}_resizeWithKeyboard(e,r){this.#x&&this.#N(this.#m,{deltaX:e,deltaY:r,fromKeyboard:!0})}#O(){this.#x=!1,this.#U(-1),this.#F()}_stopResizingWithKeyboard(){this.#O(),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#l?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,r){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#p}set isEditing(e){this.#p=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,r=!1){if(r){this.#b||=new Map;const{action:n}=e;let i=this.#b.get(n);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#b.delete(n),this.#b.size===0&&(this.#b=null)},It._telemetryTimeout),this.#b.set(n,i);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){if(!this.#h&&!this.deleted){this.#h=e.addFakeAnnotation(this);return}if(this.deleted){this.#h.remove(),this.#h=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#h.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let r=e.container.querySelector(".annotationContent");if(!r)r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),e.container.prepend(r);else if(r.nodeName==="CANVAS"){const n=r;r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),n.before(r)}return r}resetAnnotationElement(e){const{firstElementChild:r}=e.container;r?.nodeName==="DIV"&&r.classList.contains("annotationContent")&&r.remove()}}class iSe extends It{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const rB=3285377520,io=4294901760,Rl=65535;class xY{constructor(e){this.h1=e?e&4294967295:rB,this.h2=e?e&4294967295:rB}update(e){let r,n;if(typeof e=="string"){r=new Uint8Array(e.length*2),n=0;for(let g=0,m=e.length;g<m;g++){const v=e.charCodeAt(g);v<=255?r[n++]=v:(r[n++]=v>>>8,r[n++]=v&255)}}else if(ArrayBuffer.isView(e))r=e.slice(),n=r.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=n>>2,a=n-i*4,s=new Uint32Array(r.buffer,0,i);let o=0,l=0,c=this.h1,u=this.h2;const h=3432918353,f=461845907,d=h&Rl,p=f&Rl;for(let g=0;g<i;g++)g&1?(o=s[g],o=o*h&io|o*d&Rl,o=o<<15|o>>>17,o=o*f&io|o*p&Rl,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=s[g],l=l*h&io|l*d&Rl,l=l<<15|l>>>17,l=l*f&io|l*p&Rl,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(o=0,a){case 3:o^=r[i*4+2]<<16;case 2:o^=r[i*4+1]<<8;case 1:o^=r[i*4],o=o*h&io|o*d&Rl,o=o<<15|o>>>17,o=o*f&io|o*p&Rl,i&1?c^=o:u^=o}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,r=this.h2;return e^=r>>>1,e=e*3981806797&io|e*36045&Rl,r=r*4283543511&io|((r<<16|e>>>16)*2950163797&io)>>>16,e^=r>>>1,e=e*444984403&io|e*60499&Rl,r=r*3301882366&io|((r<<16|e>>>16)*3120437893&io)>>>16,e^=r>>>1,(e>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}const GT=Object.freeze({map:null,hash:"",transfer:void 0});class yD{#e=!1;#t=null;#n=null;#r=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,r){const n=this.#r.get(e);return n===void 0?r:Object.assign(r,n)}getRawValue(e){return this.#r.get(e)}remove(e){const r=this.#r.get(e);if(r!==void 0&&(r instanceof It&&this.#n.delete(r.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const n of this.#r.values())if(n instanceof It)return;this.onAnnotationEditor(null)}}setValue(e,r){const n=this.#r.get(e);let i=!1;if(n!==void 0)for(const[a,s]of Object.entries(r))n[a]!==s&&(i=!0,n[a]=s);else i=!0,this.#r.set(e,r);i&&this.#i(),r instanceof It&&((this.#n||=new Map).set(r.annotationElementId,r),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(r.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new bY(this)}get serializable(){if(this.#r.size===0)return GT;const e=new Map,r=new xY,n=[],i=Object.create(null);let a=!1;for(const[s,o]of this.#r){const l=o instanceof It?o.serialize(!1,i):o;l&&(e.set(s,l),r.update(`${s}:${JSON.stringify(l)}`),a||=!!l.bitmap)}if(a)for(const s of e.values())s.bitmap&&n.push(s.bitmap);return e.size>0?{map:e,hash:r.hexdigest(),transfer:n}:GT}get editorStats(){let e=null;const r=new Map;let n=0,i=0;for(const a of this.#r.values()){if(!(a instanceof It)){a.popup&&(a.popup.deleted?i+=1:n+=1);continue}a.isCommentDeleted?i+=1:a.hasEditedComment&&(n+=1);const s=a.telemetryFinalData;if(!s)continue;const{type:o}=s;r.has(o)||r.set(o,Object.getPrototypeOf(a).constructor),e||=Object.create(null);const l=e[o]||=new Map;for(const[c,u]of Object.entries(s)){if(c==="type")continue;let h=l.get(c);h||(h=new Map,l.set(c,h));const f=h.get(u)??0;h.set(u,f+1)}}if((i>0||n>0)&&(e||=Object.create(null),e.comments={deleted:i,edited:n}),!e)return null;for(const[a,s]of r)e[a]=s.computeTelemetryFinalData(e[a]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,r){const n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(r),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;const e=[];if(this.#n)for(const r of this.#n.values())r.serialize()&&e.push(r.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#r.entries()}}class bY extends yD{#e;constructor(e){super();const{map:r,hash:n,transfer:i}=e.serializable,a=structuredClone(r,i?{transfer:i}:null);this.#e={map:a,hash:n,transfer:i}}get print(){rn("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return Qt(this,"modifiedIds",{ids:new Set,hash:""})}}class aSe{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:r=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const r=this.styleElement.sheet;r.insertRule(e,r.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:r,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(Sr(!r,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:s}=e,o=new FontFace(i,a,s);this.addNativeFontFace(o);try{await o.load(),this.#e.add(i),n?.(e)}catch{Jt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}rn("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const n=e.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(i){throw Jt(`Failed to load font '${n.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const r=e.createFontFaceRule();if(r){if(this.insertRule(r),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const i=this._queueLoadingCallback(n);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return Qt(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return Qt(this,"isSyncFontLoadingSupported",Ra||yi.platform.isFirefox)}_queueLoadingCallback(e){function r(){for(Sr(!i.done,"completeRequest() cannot be called twice."),i.done=!0;n.length>0&&n[0].done;){const a=n.shift();setTimeout(a.callback,0)}}const{loadingRequests:n}=this,i={done:!1,complete:r,callback:e};return n.push(i),i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Qt(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,r){function n(b,w){return b.charCodeAt(w)<<24|b.charCodeAt(w+1)<<16|b.charCodeAt(w+2)<<8|b.charCodeAt(w+3)&255}function i(b,w,_,S){const C=b.substring(0,w),T=b.substring(w+_);return C+S+T}let a,s;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function u(b,w){if(++c>30){Jt("Load test font never loaded."),w();return}if(l.font="30px "+b,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){w();return}setTimeout(u.bind(null,b,w))}const h=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=i(f,976,h.length,h);const p=16,g=1482184792;let m=n(f,p);for(a=0,s=h.length-3;a<s;a+=4)m=m-g+n(h,a)|0;a<h.length&&(m=m-g+n(h+"XXX",a)|0),f=i(f,p,4,$_e(m));const v=`url(data:font/opentype;base64,${btoa(f)});`,y=`@font-face {font-family:"${h}";src:${v}}`;this.insertRule(y);const x=this._document.createElement("div");x.style.visibility="hidden",x.style.width=x.style.height="10px",x.style.position="absolute",x.style.top=x.style.left="0px";for(const b of[e.loadedName,h]){const w=this._document.createElement("span");w.textContent="Hi",w.style.fontFamily=b,x.append(w)}this._document.body.append(x),u(h,()=>{x.remove(),r.complete()})}}class sSe{#e;constructor(e,r=null,n,i){this.compiledGlyphs=Object.create(null),this.#e=e,this._inspectFont=r,n&&Object.assign(this,n),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${pY(this.data)});`;let r;if(!this.cssFontInfo)r=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),r}getPathGenerator(e,r){if(this.compiledGlyphs[r]!==void 0)return this.compiledGlyphs[r];const n=this.loadedName+"_path_"+r;let i;try{i=e.get(n)}catch(s){Jt(`getPathGenerator - ignoring character: "${s}".`)}const a=vY(i?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[r]=a}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace??!1}set disableFontFace(e){Qt(this,"disableFontFace",!!e)}get fontExtraProperties(){return this.#e.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}set bbox(e){Qt(this,"bbox",e)}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}}class Ng{#e;#t;#n;static strings=["fontFamily","fontWeight","italicAngle"];static write(e){const r=new TextEncoder,n={};let i=0;for(const c of Ng.strings){const u=r.encode(e[c]);n[c]=u,i+=4+u.length}const a=new ArrayBuffer(i),s=new Uint8Array(a),o=new DataView(a);let l=0;for(const c of Ng.strings){const u=n[c],h=u.length;o.setUint32(l,h),s.set(u,l+4),l+=4+h}return Sr(l===a.byteLength,"CssFontInfo.write: Buffer overflow"),a}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}#r(e){Sr(e<Ng.strings.length,"Invalid string index");let r=0;for(let i=0;i<e;i++)r+=this.#t.getUint32(r)+4;const n=this.#t.getUint32(r);return this.#n.decode(new Uint8Array(this.#e,r+4,n))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}}class Og{#e;#t;#n;static strings=["css","loadedName","baseFontName","src"];static write(e){const r=new TextEncoder,n={};let i=0;for(const f of Og.strings){const d=r.encode(e[f]);n[f]=d,i+=4+d.length}i+=4;let a,s,o=1+i;e.style&&(a=r.encode(e.style.style),s=r.encode(e.style.weight),o+=4+a.length+4+s.length);const l=new ArrayBuffer(o),c=new Uint8Array(l),u=new DataView(l);let h=0;u.setUint8(h++,e.guessFallback?1:0),u.setUint32(h,0),h+=4,i=0;for(const f of Og.strings){const d=n[f],p=d.length;i+=4+p,u.setUint32(h,p),c.set(d,h+4),h+=4+p}return u.setUint32(h-i-4,i),e.style&&(u.setUint32(h,a.length),c.set(a,h+4),h+=4+a.length,u.setUint32(h,s.length),c.set(s,h+4),h+=4+s.length),Sr(h<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(h)}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}get guessFallback(){return this.#t.getUint8(0)!==0}#r(e){Sr(e<Og.strings.length,"Invalid string index");let r=5;for(let i=0;i<e;i++)r+=this.#t.getUint32(r)+4;const n=this.#t.getUint32(r);return this.#n.decode(new Uint8Array(this.#e,r+4,n))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let e=1;e+=4+this.#t.getUint32(e);const r=this.#t.getUint32(e),n=this.#n.decode(new Uint8Array(this.#e,e+4,r));e+=4+r;const i=this.#t.getUint32(e),a=this.#n.decode(new Uint8Array(this.#e,e+4,i));return{style:n,weight:a}}}class Kr{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#e=Math.ceil(this.bools.length*2/8);static#t=this.#e+this.numbers.length*8;static#n=this.#t+1+8;static#r=this.#n+1+48;static#i=this.#r+1+6;#a;#s;#o;constructor({data:e,extra:r}){this.#a=e,this.#s=new TextDecoder,this.#o=new DataView(this.#a),r&&Object.assign(this,r)}#l(e){Sr(e<Kr.bools.length,"Invalid boolean index");const r=Math.floor(e/4),n=e*2%8,i=this.#o.getUint8(r)>>n&3;return i===0?void 0:i===2}get black(){return this.#l(0)}get bold(){return this.#l(1)}get disableFontFace(){return this.#l(2)}get fontExtraProperties(){return this.#l(3)}get isInvalidPDFjsFont(){return this.#l(4)}get isType3Font(){return this.#l(5)}get italic(){return this.#l(6)}get missingFile(){return this.#l(7)}get remeasure(){return this.#l(8)}get vertical(){return this.#l(9)}#c(e){return Sr(e<Kr.numbers.length,"Invalid number index"),this.#o.getFloat64(Kr.#e+e*8)}get ascent(){return this.#c(0)}get defaultWidth(){return this.#c(1)}get descent(){return this.#c(2)}get bbox(){let e=Kr.#t;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<4;i++)n.push(this.#o.getInt16(e,!0)),e+=2;return n}get fontMatrix(){let e=Kr.#n;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<6;i++)n.push(this.#o.getFloat64(e,!0)),e+=8;return n}get defaultVMetrics(){let e=Kr.#r;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<3;i++)n.push(this.#o.getInt16(e,!0)),e+=2;return n}#f(e){Sr(e<Kr.strings.length,"Invalid string index");let r=Kr.#i+4;for(let a=0;a<e;a++)r+=this.#o.getUint32(r)+4;const n=this.#o.getUint32(r),i=new Uint8Array(n);return i.set(new Uint8Array(this.#a,r+4,n)),this.#s.decode(i)}get fallbackName(){return this.#f(0)}get loadedName(){return this.#f(1)}get mimetype(){return this.#f(2)}get name(){return this.#f(3)}get data(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);e+=4+i;const a=this.#o.getUint32(e);if(a!==0)return new Uint8Array(this.#a,e+4,a)}clearData(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);e+=4+i;const a=this.#o.getUint32(e);new Uint8Array(this.#a,e+4,a).fill(0),this.#o.setUint32(e,0)}get cssFontInfo(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);if(i===0)return null;const a=new Uint8Array(i);return a.set(new Uint8Array(this.#a,e+4,i)),new Ng(a.buffer)}get systemFontInfo(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);if(n===0)return null;const i=new Uint8Array(n);return i.set(new Uint8Array(this.#a,e+4,n)),new Og(i.buffer)}static write(e){const r=e.systemFontInfo?Og.write(e.systemFontInfo):null,n=e.cssFontInfo?Ng.write(e.cssFontInfo):null,i=new TextEncoder,a={};let s=0;for(const g of Kr.strings)a[g]=i.encode(e[g]),s+=4+a[g].length;const o=Kr.#i+4+s+4+(r?r.byteLength:0)+4+(n?n.byteLength:0)+4+(e.data?e.data.length:0),l=new ArrayBuffer(o),c=new Uint8Array(l),u=new DataView(l);let h=0;const f=Kr.bools.length;let d=0,p=0;for(let g=0;g<f;g++){const m=e[Kr.bools[g]];d|=(m===void 0?0:m?2:1)<<p,p+=2,(p===8||g===f-1)&&(u.setUint8(h++,d),d=0,p=0)}Sr(h===Kr.#e,"FontInfo.write: Boolean properties offset mismatch");for(const g of Kr.numbers)u.setFloat64(h,e[g]),h+=8;if(Sr(h===Kr.#t,"FontInfo.write: Number properties offset mismatch"),e.bbox){u.setUint8(h++,4);for(const g of e.bbox)u.setInt16(h,g,!0),h+=2}else u.setUint8(h++,0),h+=8;if(Sr(h===Kr.#n,"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){u.setUint8(h++,6);for(const g of e.fontMatrix)u.setFloat64(h,g,!0),h+=8}else u.setUint8(h++,0),h+=48;if(Sr(h===Kr.#r,"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){u.setUint8(h++,1);for(const g of e.defaultVMetrics)u.setInt16(h,g,!0),h+=2}else u.setUint8(h++,0),h+=6;Sr(h===Kr.#i,"FontInfo.write: DefaultVMetrics properties offset mismatch"),u.setUint32(Kr.#i,0),h+=4;for(const g of Kr.strings){const m=a[g],v=m.length;u.setUint32(h,v),c.set(m,h+4),h+=4+v}if(u.setUint32(Kr.#i,h-Kr.#i-4),!r)u.setUint32(h,0),h+=4;else{const g=r.byteLength;u.setUint32(h,g),Sr(h+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(r),h+4),h+=4+g}if(!n)u.setUint32(h,0),h+=4;else{const g=n.byteLength;u.setUint32(h,g),Sr(h+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(n),h+4),h+=4+g}return e.data===void 0?(u.setUint32(h,0),h+=4):(u.setUint32(h,e.data.length),c.set(e.data,h+4),h+=4+e.data.length),Sr(h<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(h)}}class Ai{static#e=0;static#t=1;static#n=2;static#r=3;static#i=4;static#a=8;static#s=12;static#o=16;constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let r,n=null,i=[],a=[],s=[],o=[],l=null,c=null;switch(e[0]){case"RadialAxial":r=e[1]==="axial"?1:2,n=e[2],s=e[3],r===1?i.push(...e[4],...e[5]):i.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":r=3,l=e[1],i=e[2],a=e[3],o=e[4]||[],n=e[6],c=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}const u=Math.floor(i.length/2),h=Math.floor(a.length/3),f=s.length,d=o.length;let p=0;for(const w of o)p+=1,p=Math.ceil(p/4)*4,p+=4+w.coords.length*4,p+=4+w.colors.length*4,w.verticesPerRow!==void 0&&(p+=4);const g=20+u*8+h*3+f*8+(n?16:0)+(c?3:0)+p,m=new ArrayBuffer(g),v=new DataView(m),y=new Uint8Array(m);v.setUint8(Ai.#e,r),v.setUint8(Ai.#t,n?1:0),v.setUint8(Ai.#n,c?1:0),v.setUint8(Ai.#r,l),v.setUint32(Ai.#i,u,!0),v.setUint32(Ai.#a,h,!0),v.setUint32(Ai.#s,f,!0),v.setUint32(Ai.#o,d,!0);let x=20;new Float32Array(m,x,u*2).set(i),x+=u*8,y.set(a,x),x+=h*3;for(const[w,_]of s)v.setFloat32(x,w,!0),x+=4,v.setUint32(x,parseInt(_.slice(1),16),!0),x+=4;if(n)for(const w of n)v.setFloat32(x,w,!0),x+=4;c&&(y.set(c,x),x+=3);for(let w=0;w<o.length;w++){const _=o[w];v.setUint8(x,_.type),x+=1,x=Math.ceil(x/4)*4,v.setUint32(x,_.coords.length,!0),x+=4,new Int32Array(m,x,_.coords.length).set(_.coords),x+=_.coords.length*4,v.setUint32(x,_.colors.length,!0),x+=4,new Int32Array(m,x,_.colors.length).set(_.colors),x+=_.colors.length*4,_.verticesPerRow!==void 0&&(v.setUint32(x,_.verticesPerRow,!0),x+=4)}return m}getIR(){const e=this.view,r=this.data[Ai.#e],n=!!this.data[Ai.#t],i=!!this.data[Ai.#n],a=e.getUint32(Ai.#i,!0),s=e.getUint32(Ai.#a,!0),o=e.getUint32(Ai.#s,!0),l=e.getUint32(Ai.#o,!0);let c=20;const u=new Float32Array(this.buffer,c,a*2);c+=a*8;const h=new Uint8Array(this.buffer,c,s*3);c+=s*3;const f=[];for(let m=0;m<o;++m){const v=e.getFloat32(c,!0);c+=4;const y=e.getUint32(c,!0);c+=4,f.push([v,`#${y.toString(16).padStart(6,"0")}`])}let d=null;if(n){d=[];for(let m=0;m<4;++m)d.push(e.getFloat32(c,!0)),c+=4}let p=null;i&&(p=new Uint8Array(this.buffer,c,3),c+=3);const g=[];for(let m=0;m<l;++m){const v=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;const y=e.getUint32(c,!0);c+=4;const x=new Int32Array(this.buffer,c,y);c+=y*4;const b=e.getUint32(c,!0);c+=4;const w=new Int32Array(this.buffer,c,b);c+=b*4;const _={type:v,coords:x,colors:w};v===zT.LATTICE&&(_.verticesPerRow=e.getUint32(c,!0),c+=4),g.push(_)}if(r===1)return["RadialAxial","axial",d,f,Array.from(u.slice(0,2)),Array.from(u.slice(2,4)),null,null];if(r===2)return["RadialAxial","radial",d,f,[u[0],u[1]],[u[3],u[4]],u[2],u[5]];if(r===3){const m=this.data[Ai.#r];let v=null;if(u.length>0){let y=u[0],x=u[0],b=u[1],w=u[1];for(let _=0;_<u.length;_+=2){const S=u[_],C=u[_+1];y=y>S?S:y,b=b>C?C:b,x=x<S?S:x,w=w<C?C:w}v=[y,b,x,w]}return["Mesh",m,u,h,g,v,d,p]}throw new Error(`Unsupported pattern kind: ${r}`)}}class oSe{static write(e){let r,n;return yi.isFloat16ArraySupported?(n=new ArrayBuffer(e.length*2),r=new Float16Array(n)):(n=new ArrayBuffer(e.length*4),r=new Float32Array(n)),r.set(e),n}#e;constructor(e){this.#e=e}get path(){return yi.isFloat16ArraySupported?new Float16Array(this.#e):new Float32Array(this.#e)}}function lSe(t){if(t instanceof URL)return t.href;if(typeof t=="string"){if(Ra)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function cSe(t){if(Ra&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return _b(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function N2(t){if(typeof t!="string")return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const WT=t=>typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,uSe=t=>typeof t=="object"&&typeof t?.name=="string",hSe=H_e.bind(null,WT,uSe);class fSe{#e=new Map;#t=Promise.resolve();postMessage(e,r){const n={data:structuredClone(e,r?{transfer:r}:null)};this.#t.then(()=>{for(const[i]of this.#e)i.call(this,n)})}addEventListener(e,r,n=null){let i=null;if(n?.signal instanceof AbortSignal){const{signal:a}=n;if(a.aborted){Jt("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,r);i=()=>a.removeEventListener("abort",s),a.addEventListener("abort",s)}this.#e.set(r,i)}removeEventListener(e,r){this.#e.get(r)?.(),this.#e.delete(r)}terminate(){for(const[,e]of this.#e)e?.();this.#e.clear()}}const O2={DATA:1,ERROR:2},Kn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function nB(){}function ps(t){if(t instanceof rf||t instanceof VT||t instanceof YO||t instanceof HS||t instanceof $8)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||rn('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new rf(t.message);case"InvalidPDFException":return new VT(t.message);case"PasswordException":return new YO(t.message,t.code);case"ResponseException":return new HS(t.message,t.status,t.missing);case"UnknownErrorException":return new $8(t.message,t.details)}return new $8(t.message,t.toString())}class qv{#e=new AbortController;constructor(e,r,n){this.sourceName=e,this.targetName=r,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){const n=e.callbackId,i=this.callbackCapabilities[n];if(!i)throw new Error(`Cannot resolve callback ${n}`);if(delete this.callbackCapabilities[n],e.callback===O2.DATA)i.resolve(e.data);else if(e.callback===O2.ERROR)i.reject(ps(e.reason));else throw new Error("Unexpected callback case");return}const r=this.actionHandler[e.action];if(!r)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const n=this.sourceName,i=e.sourceName,a=this.comObj;Promise.try(r,e.data).then(function(s){a.postMessage({sourceName:n,targetName:i,callback:O2.DATA,callbackId:e.callbackId,data:s})},function(s){a.postMessage({sourceName:n,targetName:i,callback:O2.ERROR,callbackId:e.callbackId,reason:ps(s)})});return}if(e.streamId){this.#n(e);return}r(e.data)}on(e,r){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=r}send(e,r,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:r},n)}sendWithPromise(e,r,n){const i=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:r},n)}catch(s){a.reject(s)}return a.promise}sendWithStream(e,r,n,i){const a=this.streamId++,s=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[a]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:s,targetName:o,action:e,streamId:a,data:r,desiredSize:c.desiredSize},i),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[a].pullCall=u,l.postMessage({sourceName:s,targetName:o,stream:Kn.PULL,streamId:a,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Sr(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[a].cancelCall=u,this.streamControllers[a].isClosed=!0,l.postMessage({sourceName:s,targetName:o,stream:Kn.CANCEL,streamId:a,reason:ps(c)}),u.promise}},n)}#n(e){const r=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,s=this,o=this.actionHandler[e.action],l={enqueue(c,u=1,h){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=u,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:n,targetName:i,stream:Kn.ENQUEUE,streamId:r,chunk:c},h)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:Kn.CLOSE,streamId:r}),delete s.streamSinks[r])},error(c){Sr(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:Kn.ERROR,streamId:r,reason:ps(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[r]=l,Promise.try(o,e.data,l).then(function(){a.postMessage({sourceName:n,targetName:i,stream:Kn.START_COMPLETE,streamId:r,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:Kn.START_COMPLETE,streamId:r,reason:ps(c)})})}#r(e){const r=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,s=this.streamControllers[r],o=this.streamSinks[r];switch(e.stream){case Kn.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(ps(e.reason));break;case Kn.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(ps(e.reason));break;case Kn.PULL:if(!o){a.postMessage({sourceName:n,targetName:i,stream:Kn.PULL_COMPLETE,streamId:r,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||nB).then(function(){a.postMessage({sourceName:n,targetName:i,stream:Kn.PULL_COMPLETE,streamId:r,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:Kn.PULL_COMPLETE,streamId:r,reason:ps(c)})});break;case Kn.ENQUEUE:if(Sr(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Kn.CLOSE:if(Sr(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this.#i(s,r);break;case Kn.ERROR:Sr(s,"error should have stream controller"),s.controller.error(ps(e.reason)),this.#i(s,r);break;case Kn.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(ps(e.reason)),this.#i(s,r);break;case Kn.CANCEL:if(!o)break;const l=ps(e.reason);Promise.try(o.onCancel||nB,l).then(function(){a.postMessage({sourceName:n,targetName:i,stream:Kn.CANCEL_COMPLETE,streamId:r,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:Kn.CANCEL_COMPLETE,streamId:r,reason:ps(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}async#i(e,r){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[r]}destroy(){this.#e?.abort(),this.#e=null}}class wY{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,r){if(e<=0||r<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,r);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,r,n){if(!e.canvas)throw new Error("Canvas is not specified");if(r<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=r,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,r){rn("Abstract method `_createCanvas` called.")}}class dSe extends wY{constructor({ownerDocument:e=globalThis.document,enableHWA:r=!1}){super({enableHWA:r}),this._document=e}_createCanvas(e,r){const n=this._document.createElement("canvas");return n.width=e,n.height=r,n}}class _Y{constructor({baseUrl:e=null,isCompressed:r=!0}){this.baseUrl=e,this.isCompressed=r}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const r=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(r).then(n=>({cMapData:n,isCompressed:this.isCompressed})).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${r}`)})}async _fetch(e){rn("Abstract method `_fetch` called.")}}class iB extends _Y{async _fetch(e){const r=await Sb(e,this.isCompressed?"arraybuffer":"text");return r instanceof ArrayBuffer?new Uint8Array(r):_b(r)}}class SY{addFilter(e){return"none"}addHCMFilter(e,r){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,r,n,i,a){return"none"}destroy(e=!1){}}class pSe extends SY{#e;#t;#n;#r;#i;#a;#s=0;constructor({docId:e,ownerDocument:r=globalThis.document}){super(),this.#r=e,this.#i=r}get#o(){return this.#t||=new Map}get#l(){return this.#a||=new Map}get#c(){if(!this.#n){const e=this.#i.createElement("div"),{style:r}=e;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const n=this.#i.createElementNS(ru,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#n=this.#i.createElementNS(ru,"defs"),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#f(e){if(e.length===1){const l=e[0],c=new Array(256);for(let h=0;h<256;h++)c[h]=l[h]/255;const u=c.join(",");return[u,u,u]}const[r,n,i]=e,a=new Array(256),s=new Array(256),o=new Array(256);for(let l=0;l<256;l++)a[l]=r[l]/255,s[l]=n[l]/255,o[l]=i[l]/255;return[a.join(","),s.join(","),o.join(",")]}#h(e){if(this.#e===void 0){this.#e="";const r=this.#i.URL;r!==this.#i.baseURI&&(fC(r)?Jt('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=hY(r,""))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let r=this.#o.get(e);if(r)return r;const[n,i,a]=this.#f(e),s=e.length===1?n:`${n}${i}${a}`;if(r=this.#o.get(s),r)return this.#o.set(e,r),r;const o=`g_${this.#r}_transfer_map_${this.#s++}`,l=this.#h(o);this.#o.set(e,l),this.#o.set(s,l);const c=this.#g(o);return this.#p(n,i,a,c),l}addHCMFilter(e,r){const n=`${e}-${r}`,i="base";let a=this.#l.get(i);if(a?.key===n||(a?(a.filter?.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},this.#l.set(i,a)),!e||!r))return a.url;const s=this.#x(e);e=ot.makeHexColor(...s);const o=this.#x(r);if(r=ot.makeHexColor(...o),this.#c.style.color="",e==="#000000"&&r==="#ffffff"||e===r)return a.url;const l=new Array(256);for(let d=0;d<=255;d++){const p=d/255;l[d]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}const c=l.join(","),u=`g_${this.#r}_hcm_filter`,h=a.filter=this.#g(u);this.#p(c,c,c,h),this.#m(h);const f=(d,p)=>{const g=s[d]/255,m=o[d]/255,v=new Array(p+1);for(let y=0;y<=p;y++)v[y]=g+y/p*(m-g);return v.join(",")};return this.#p(f(0,5),f(1,5),f(2,5),h),a.url=this.#h(u),a.url}addAlphaFilter(e){let r=this.#o.get(e);if(r)return r;const[n]=this.#f([e]),i=`alpha_${n}`;if(r=this.#o.get(i),r)return this.#o.set(e,r),r;const a=`g_${this.#r}_alpha_map_${this.#s++}`,s=this.#h(a);this.#o.set(e,s),this.#o.set(i,s);const o=this.#g(a);return this.#v(n,o),s}addLuminosityFilter(e){let r=this.#o.get(e||"luminosity");if(r)return r;let n,i;if(e?([n]=this.#f([e]),i=`luminosity_${n}`):i="luminosity",r=this.#o.get(i),r)return this.#o.set(e,r),r;const a=`g_${this.#r}_luminosity_map_${this.#s++}`,s=this.#h(a);this.#o.set(e,s),this.#o.set(i,s);const o=this.#g(a);return this.#d(o),e&&this.#v(n,o),s}addHighlightHCMFilter(e,r,n,i,a){const s=`${r}-${n}-${i}-${a}`;let o=this.#l.get(e);if(o?.key===s||(o?(o.filter?.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},this.#l.set(e,o)),!r||!n))return o.url;const[l,c]=[r,n].map(this.#x.bind(this));let u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),h=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[f,d]=[i,a].map(this.#x.bind(this));h<u&&([u,h,f,d]=[h,u,d,f]),this.#c.style.color="";const p=(v,y,x)=>{const b=new Array(256),w=(h-u)/x,_=v/255,S=(y-v)/(255*x);let C=0;for(let T=0;T<=x;T++){const A=Math.round(u+T*w),k=_+T*S;for(let I=C;I<=A;I++)b[I]=k;C=A+1}for(let T=C;T<256;T++)b[T]=b[C-1];return b.join(",")},g=`g_${this.#r}_hcm_${e}_filter`,m=o.filter=this.#g(g);return this.#m(m),this.#p(p(f[0],d[0],5),p(f[1],d[1],5),p(f[2],d[2],5),m),o.url=this.#h(g),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#s=0)}#d(e){const r=this.#i.createElementNS(ru,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(r)}#m(e){const r=this.#i.createElementNS(ru,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(r)}#g(e){const r=this.#i.createElementNS(ru,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",e),this.#c.append(r),r}#u(e,r,n){const i=this.#i.createElementNS(ru,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",n),e.append(i)}#p(e,r,n,i){const a=this.#i.createElementNS(ru,"feComponentTransfer");i.append(a),this.#u(a,"feFuncR",e),this.#u(a,"feFuncG",r),this.#u(a,"feFuncB",n)}#v(e,r){const n=this.#i.createElementNS(ru,"feComponentTransfer");r.append(n),this.#u(n,"feFuncA",e)}#x(e){return this.#c.style.color=e,Ab(getComputedStyle(this.#c).getPropertyValue("color"))}}class CY{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const r=`${this.baseUrl}${e}`;return this._fetch(r).catch(n=>{throw new Error(`Unable to load font data at: ${r}`)})}async _fetch(e){rn("Abstract method `_fetch` called.")}}class aB extends CY{async _fetch(e){const r=await Sb(e,"arraybuffer");return new Uint8Array(r)}}class AY{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const r=`${this.baseUrl}${e}`;return this._fetch(r).catch(n=>{throw new Error(`Unable to load wasm data at: ${r}`)})}async _fetch(e){rn("Abstract method `_fetch` called.")}}class sB extends AY{async _fetch(e){const r=await Sb(e,"arraybuffer");return new Uint8Array(r)}}Ra&&Jt("Please use the `legacy` build in Node.js environments.");async function xD(t){const r=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(r)}class gSe extends SY{}class mSe extends wY{_createCanvas(e,r){return process.getBuiltinModule("module").createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:Ig&&Ig.tagName.toUpperCase()==="SCRIPT"&&Ig.src||new URL("index-BD02XooM.cjs",document.baseURI).href)("@napi-rs/canvas").createCanvas(e,r)}}class vSe extends _Y{async _fetch(e){return xD(e)}}class ySe extends CY{async _fetch(e){return xD(e)}}class xSe extends AY{async _fetch(e){return xD(e)}}const _p="__forcedDependency",{floor:oB,ceil:lB}=Math;function B2(t,e,r,n,i,a){t[e*4+0]=Math.min(t[e*4+0],r),t[e*4+1]=Math.min(t[e*4+1],n),t[e*4+2]=Math.max(t[e*4+2],i),t[e*4+3]=Math.max(t[e*4+3],a)}const qT=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class bSe{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===qT}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}}const F2=(t,e)=>{if(!t)return;let r=t.get(e);return r||(r={dependencies:new Set,isRenderingOperation:!1},t.set(e,r)),r};class wSe{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[_p]:[]};#n=new Map;#r=[];#i=[];#a=[[1,0,0,1,0,0]];#s=[-1/0,-1/0,1/0,1/0];#o=new Float64Array([1/0,1/0,-1/0,-1/0]);#l=-1;#c=new Set;#f=new Map;#h=new Map;#d;#m;#g;#u;#p;constructor(e,r,n=!1){this.#d=e.width,this.#m=e.height,this.#v(r),n&&(this.#p=new Map)}growOperationsCount(e){e>=this.#u.length&&this.#v(e,this.#u)}#v(e,r){const n=new ArrayBuffer(e*4);this.#g=new Uint8ClampedArray(n),this.#u=new Uint32Array(n),r&&r.length>0?(this.#u.set(r),this.#u.fill(qT,r.length)):this.#u.fill(qT)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[_p]:{__proto__:this.#t[_p]}},this.#s={__proto__:this.#s},this.#r.push(e),this}restore(e){const r=Object.getPrototypeOf(this.#e);if(r===null)return this;this.#e=r,this.#t=Object.getPrototypeOf(this.#t),this.#s=Object.getPrototypeOf(this.#s);const n=this.#r.pop();return n!==void 0&&(F2(this.#p,e)?.dependencies.add(n),this.#u[e]=this.#u[n]),this}recordOpenMarker(e){return this.#r.push(e),this}getOpenMarker(){return this.#r.length===0?null:this.#r.at(-1)}recordCloseMarker(e){const r=this.#r.pop();return r!==void 0&&(F2(this.#p,e)?.dependencies.add(r),this.#u[e]=this.#u[r]),this}beginMarkedContent(e){return this.#i.push(e),this}endMarkedContent(e){const r=this.#i.pop();return r!==void 0&&(F2(this.#p,e)?.dependencies.add(r),this.#u[e]=this.#u[r]),this}pushBaseTransform(e){return this.#a.push(ot.multiplyByDOMMatrix(this.#a.at(-1),e.getTransform())),this}popBaseTransform(){return this.#a.length>1&&this.#a.pop(),this}recordSimpleData(e,r){return this.#e[e]=r,this}recordIncrementalData(e,r){return this.#t[e].push(r),this}resetIncrementalData(e,r){return this.#t[e].length=0,this}recordNamedData(e,r){return this.#n.set(e,r),this}recordSimpleDataFromNamed(e,r,n){this.#e[e]=this.#n.get(r)??n}recordFutureForcedDependency(e,r){return this.recordIncrementalData(_p,r),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const r of e)r in this.#e&&this.recordFutureForcedDependency(r,this.#e[r]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of this.#c)this.recordFutureForcedDependency(_p,e);return this}resetBBox(e){return this.#l!==e&&(this.#l=e,this.#o[0]=1/0,this.#o[1]=1/0,this.#o[2]=-1/0,this.#o[3]=-1/0),this}recordClipBox(e,r,n,i,a,s){const o=ot.multiplyByDOMMatrix(this.#a.at(-1),r.getTransform()),l=[1/0,1/0,-1/0,-1/0];ot.axialAlignedBoundingBox([n,a,i,s],o,l);const c=ot.intersect(this.#s,l);return c?(this.#s[0]=c[0],this.#s[1]=c[1],this.#s[2]=c[2],this.#s[3]=c[3]):(this.#s[0]=this.#s[1]=1/0,this.#s[2]=this.#s[3]=-1/0),this}recordBBox(e,r,n,i,a,s){const o=this.#s;if(o[0]===1/0)return this;const l=ot.multiplyByDOMMatrix(this.#a.at(-1),r.getTransform());if(o[0]===-1/0)return ot.axialAlignedBoundingBox([n,a,i,s],l,this.#o),this;const c=[1/0,1/0,-1/0,-1/0];return ot.axialAlignedBoundingBox([n,a,i,s],l,c),this.#o[0]=Math.min(this.#o[0],Math.max(c[0],o[0])),this.#o[1]=Math.min(this.#o[1],Math.max(c[1],o[1])),this.#o[2]=Math.max(this.#o[2],Math.min(c[2],o[2])),this.#o[3]=Math.max(this.#o[3],Math.min(c[3],o[3])),this}recordCharacterBBox(e,r,n,i=1,a=0,s=0,o){const l=n.bbox;let c,u;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&this.#h.get(n),c!==!1&&(u=[0,0,0,0],ot.axialAlignedBoundingBox(l,n.fontMatrix,u),(i!==1||a!==0||s!==0)&&ot.scaleMinMax([i,0,0,-i,a,s],u),c)))return this.recordBBox(e,r,u[0],u[2],u[1],u[3]);if(!o)return this.recordFullPageBBox(e);const h=o();return l&&u&&c===void 0&&(c=u[0]<=a-h.actualBoundingBoxLeft&&u[2]>=a+h.actualBoundingBoxRight&&u[1]<=s-h.actualBoundingBoxAscent&&u[3]>=s+h.actualBoundingBoxDescent,this.#h.set(n,c),c)?this.recordBBox(e,r,u[0],u[2],u[1],u[3]):this.recordBBox(e,r,a-h.actualBoundingBoxLeft,a+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#o[0]=Math.max(0,this.#s[0]),this.#o[1]=Math.max(0,this.#s[1]),this.#o[2]=Math.min(this.#d,this.#s[2]),this.#o[3]=Math.min(this.#m,this.#s[3]),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,r){const n=this.#c,i=this.#e,a=this.#t;for(const s of r)s in this.#e?n.add(i[s]):s in a&&a[s].forEach(n.add,n);return this}recordNamedDependency(e,r){return this.#n.has(r)&&this.#c.add(this.#n.get(r)),this}recordOperation(e,r=!1){if(this.recordDependencies(e,[_p]),this.#p){const n=F2(this.#p,e),{dependencies:i}=n;this.#c.forEach(i.add,i),this.#r.forEach(i.add,i),this.#i.forEach(i.add,i),i.delete(e),n.isRenderingOperation=!0}if(this.#l===e){const n=oB(this.#o[0]*256/this.#d),i=oB(this.#o[1]*256/this.#m),a=lB(this.#o[2]*256/this.#d),s=lB(this.#o[3]*256/this.#m);B2(this.#g,e,n,i,a,s);for(const o of this.#c)o!==e&&B2(this.#g,o,n,i,a,s);for(const o of this.#r)o!==e&&B2(this.#g,o,n,i,a,s);for(const o of this.#i)o!==e&&B2(this.#g,o,n,i,a,s);r||(this.#c.clear(),this.#l=-1)}return this}recordShowTextOperation(e,r=!1){const n=Array.from(this.#c);this.recordOperation(e,r),this.recordIncrementalData("sameLineText",e);for(const i of n)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(e,r=!1){return this.#l===e&&(this.#l=-1,this.#s[0]=Math.max(this.#s[0],this.#o[0]),this.#s[1]=Math.max(this.#s[1],this.#o[1]),this.#s[2]=Math.min(this.#s[2],this.#o[2]),this.#s[3]=Math.min(this.#s[3],this.#o[3]),r||this.#c.clear()),this}_takePendingDependencies(){const e=this.#c;return this.#c=new Set,e}_extractOperation(e){const r=this.#f.get(e);return this.#f.delete(e),r}_pushPendingDependencies(e){for(const r of e)this.#c.add(r)}take(){return this.#h.clear(),new bSe(this.#u,this.#g)}takeDebugMetadata(){return this.#p}}class GS{#e;#t;#n;#r=0;#i=0;constructor(e,r,n){if(e instanceof GS&&e.#n===!!n)return e;this.#e=e,this.#t=r,this.#n=!!n}growOperationsCount(){throw new Error("Unreachable")}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,r){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,r){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,r){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,r){return this}recordSimpleDataFromNamed(e,r,n){return this.#e.recordSimpleDataFromNamed(e,r,this.#t),this}recordFutureForcedDependency(e,r){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,r,n,i,a,s){return this.#n||this.#e.recordClipBox(this.#t,r,n,i,a,s),this}recordBBox(e,r,n,i,a,s){return this.#n||this.#e.recordBBox(this.#t,r,n,i,a,s),this}recordCharacterBBox(e,r,n,i,a,s,o){return this.#n||this.#e.recordCharacterBBox(this.#t,r,n,i,a,s,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,r){return this.#e.recordDependencies(this.#t,r),this}recordNamedDependency(e,r){return this.#e.recordNamedDependency(this.#t,r),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const ao={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},ra={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function XT(t,e){if(!e)return;const r=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],r,n),t.clip(i)}class bD{isModifyingCurrentTransform(){return!1}getPattern(){rn("Abstract method `getPattern` called.")}}class _Se extends bD{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}_createGradient(e,r=null){let n,i=this._p0,a=this._p1;if(r&&(i=i.slice(),a=a.slice(),ot.applyTransform(i,r),ot.applyTransform(a,r)),this._type==="axial")n=e.createLinearGradient(i[0],i[1],a[0],a[1]);else if(this._type==="radial"){let s=this._r0,o=this._r1;if(r){const l=new Float32Array(2);ot.singularValueDecompose2dScale(r,l),s*=l[0],o*=l[0]}n=e.createRadialGradient(i[0],i[1],s,a[0],a[1],o)}for(const s of this._colorStops)n.addColorStop(s[0],s[1]);return n}getPattern(e,r,n,i){let a;if(i===ra.STROKE||i===ra.FILL){if(this.isOriginBased()){let f=ot.transform(n,r.baseTransform);this.matrix&&(f=ot.transform(f,this.matrix));const d=.001,p=Math.hypot(f[0],f[1]),g=Math.hypot(f[2],f[3]),m=(f[0]*f[2]+f[1]*f[3])/(p*g);if(Math.abs(m)<d)if(this.isRadial()){if(Math.abs(p-g)<d)return this._createGradient(e,f)}else return this._createGradient(e,f)}const s=r.current.getClippedPathBoundingBox(i,_n(e))||[0,0,0,0],o=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,c=r.cachedCanvases.getCanvas("pattern",o,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-s[0],-s[1]),n=ot.transform(n,[1,0,0,1,s[0],s[1]]),u.transform(...r.baseTransform),this.matrix&&u.transform(...this.matrix),XT(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),a=e.createPattern(c.canvas,"no-repeat");const h=new DOMMatrix(n);a.setTransform(h)}else XT(e,this._bbox),a=this._createGradient(e);return a}}function U8(t,e,r,n,i,a,s,o){const l=e.coords,c=e.colors,u=t.data,h=t.width*4;let f;l[r+1]>l[n+1]&&(f=r,r=n,n=f,f=a,a=s,s=f),l[n+1]>l[i+1]&&(f=n,n=i,i=f,f=s,s=o,o=f),l[r+1]>l[n+1]&&(f=r,r=n,n=f,f=a,a=s,s=f);const d=(l[r]+e.offsetX)*e.scaleX,p=(l[r+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[i]+e.offsetX)*e.scaleX,y=(l[i+1]+e.offsetY)*e.scaleY;if(p>=y)return;const x=c[a],b=c[a+1],w=c[a+2],_=c[s],S=c[s+1],C=c[s+2],T=c[o],A=c[o+1],k=c[o+2],I=Math.round(p),E=Math.round(y);let M,R,D,L,P,O,$,N;for(let U=I;U<=E;U++){if(U<m){const X=U<p?0:(p-U)/(p-m);M=d-(d-g)*X,R=x-(x-_)*X,D=b-(b-S)*X,L=w-(w-C)*X}else{let X;U>y?X=1:m===y?X=0:X=(m-U)/(m-y),M=g-(g-v)*X,R=_-(_-T)*X,D=S-(S-A)*X,L=C-(C-k)*X}let j;U<p?j=0:U>y?j=1:j=(p-U)/(p-y),P=d-(d-v)*j,O=x-(x-T)*j,$=b-(b-A)*j,N=w-(w-k)*j;const B=Math.round(Math.min(M,P)),q=Math.round(Math.max(M,P));let W=h*U+B*4;for(let X=B;X<=q;X++)j=(M-X)/(M-P),j<0?j=0:j>1&&(j=1),u[W++]=R-(R-O)*j|0,u[W++]=D-(D-$)*j|0,u[W++]=L-(L-N)*j|0,u[W++]=255}}function SSe(t,e,r){const n=e.coords,i=e.colors;let a,s;switch(e.type){case zT.LATTICE:const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a<l;a++){let u=a*o;for(let h=0;h<c;h++,u++)U8(t,r,n[u],n[u+1],n[u+o],i[u],i[u+1],i[u+o]),U8(t,r,n[u+o+1],n[u+1],n[u+o],i[u+o+1],i[u+1],i[u+o])}break;case zT.TRIANGLES:for(a=0,s=n.length;a<s;a+=3)U8(t,r,n[a],n[a+1],n[a+2],i[a],i[a+1],i[a+2]);break;default:throw new Error("illegal figure")}}class CSe extends bD{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,r,n){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,u=Math.ceil(this._bounds[3])-l,h=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(u*e[1]*1.1)),3e3),d=c/h,p=u/f,g={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/d,scaleY:1/p},m=h+4,v=f+4,y=n.getCanvas("mesh",m,v),x=y.context,b=x.createImageData(h,f);if(r){const _=b.data;for(let S=0,C=_.length;S<C;S+=4)_[S]=r[0],_[S+1]=r[1],_[S+2]=r[2],_[S+3]=255}for(const _ of this._figures)SSe(b,_,g);return x.putImageData(b,2,2),{canvas:y.canvas,offsetX:o-2*d,offsetY:l-2*p,scaleX:d,scaleY:p}}isModifyingCurrentTransform(){return!0}getPattern(e,r,n,i){XT(e,this._bbox);const a=new Float32Array(2);if(i===ra.SHADING)ot.singularValueDecompose2dScale(_n(e),a);else if(this.matrix){ot.singularValueDecompose2dScale(this.matrix,a);const[o,l]=a;ot.singularValueDecompose2dScale(r.baseTransform,a),a[0]*=o,a[1]*=l}else ot.singularValueDecompose2dScale(r.baseTransform,a);const s=this._createMeshCanvas(a,i===ra.SHADING?null:this._background,r.cachedCanvases);return i!==ra.SHADING&&(e.setTransform(...r.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class ASe extends bD{getPattern(){return"hotpink"}}function TSe(t){switch(t[0]){case"RadialAxial":return new _Se(t);case"Mesh":return new CSe(t);case"Dummy":return new ASe}throw new Error(`Unknown IR type: ${t[0]}`)}const cB={COLORED:1,UNCOLORED:2};class wD{static MAX_PATTERN_SIZE=3e3;constructor(e,r,n,i){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=r,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(e,r){const{bbox:n,operatorList:i,paintType:a,tilingType:s,color:o,canvasGraphicsFactory:l}=this;let{xstep:c,ystep:u}=this;c=Math.abs(c),u=Math.abs(u),hC("TilingType: "+s);const h=n[0],f=n[1],d=n[2],p=n[3],g=d-h,m=p-f,v=new Float32Array(2);ot.singularValueDecompose2dScale(this.matrix,v);const[y,x]=v;ot.singularValueDecompose2dScale(this.baseTransform,v);const b=y*v[0],w=x*v[1];let _=g,S=m,C=!1,T=!1;const A=Math.ceil(c*b),k=Math.ceil(u*w),I=Math.ceil(g*b),E=Math.ceil(m*w);A>=I?_=c:C=!0,k>=E?S=u:T=!0;const M=this.getSizeAndScale(_,this.ctx.canvas.width,b),R=this.getSizeAndScale(S,this.ctx.canvas.height,w),D=e.cachedCanvases.getCanvas("pattern",M.size,R.size),L=D.context,P=l.createCanvasGraphics(L,r);if(P.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(P,a,o),L.translate(-M.scale*h,-R.scale*f),P.transform(0,M.scale,0,0,R.scale,0,0),L.save(),P.dependencyTracker?.save(),this.clipBbox(P,h,f,d,p),P.baseTransform=_n(P.ctx),P.executeOperatorList(i),P.endDrawing(),P.dependencyTracker?.restore(),L.restore(),C||T){const O=D.canvas;C&&(_=c),T&&(S=u);const $=this.getSizeAndScale(_,this.ctx.canvas.width,b),N=this.getSizeAndScale(S,this.ctx.canvas.height,w),U=$.size,j=N.size,B=e.cachedCanvases.getCanvas("pattern-workaround",U,j),q=B.context,W=C?Math.floor(g/c):0,X=T?Math.floor(m/u):0;for(let K=0;K<=W;K++)for(let G=0;G<=X;G++)q.drawImage(O,U*K,j*G,U,j,0,0,U,j);return{canvas:B.canvas,scaleX:$.scale,scaleY:N.scale,offsetX:h,offsetY:f}}return{canvas:D.canvas,scaleX:M.scale,scaleY:R.scale,offsetX:h,offsetY:f}}getSizeAndScale(e,r,n){const i=Math.max(wD.MAX_PATTERN_SIZE,r);let a=Math.ceil(e*n);return a>=i?a=i:n=a/e,{scale:n,size:a}}clipBbox(e,r,n,i,a){const s=i-r,o=a-n;e.ctx.rect(r,n,s,o),ot.axialAlignedBoundingBox([r,n,i,a],_n(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,r,n){const i=e.ctx,a=e.current;switch(r){case cB.COLORED:const{fillStyle:s,strokeStyle:o}=this.ctx;i.fillStyle=a.fillColor=s,i.strokeStyle=a.strokeColor=o;break;case cB.UNCOLORED:i.fillStyle=i.strokeStyle=n,a.fillColor=a.strokeColor=n;break;default:throw new F_e(`Unsupported paint type: ${r}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,r,n,i,a){let s=n;i!==ra.SHADING&&(s=ot.transform(s,r.baseTransform),this.matrix&&(s=ot.transform(s,this.matrix)));const o=this.createPatternCanvas(r,a);let l=new DOMMatrix(s);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}function kSe({src:t,srcPos:e=0,dest:r,width:n,height:i,nonBlackColor:a=4294967295,inverseDecode:s=!1}){const o=yi.isLittleEndian?4278190080:255,[l,c]=s?[a,o]:[o,a],u=n>>3,h=n&7,f=t.length;r=new Uint32Array(r.buffer);let d=0;for(let p=0;p<i;p++){for(const m=e+u;e<m;e++){const v=e<f?t[e]:255;r[d++]=v&128?c:l,r[d++]=v&64?c:l,r[d++]=v&32?c:l,r[d++]=v&16?c:l,r[d++]=v&8?c:l,r[d++]=v&4?c:l,r[d++]=v&2?c:l,r[d++]=v&1?c:l}if(h===0)continue;const g=e<f?t[e++]:255;for(let m=0;m<h;m++)r[d++]=g&1<<7-m?c:l}return{srcPos:e,destPos:d}}const uB=16,hB=100,ESe=15,fB=10,vs=16,j8=new DOMMatrix,Fs=new Float32Array(2),xg=new Float32Array([1/0,1/0,-1/0,-1/0]);function ISe(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(r,n){e.translate(r,n),this.__originalTranslate(r,n)},t.scale=function(r,n){e.scale(r,n),this.__originalScale(r,n)},t.transform=function(r,n,i,a,s,o){e.transform(r,n,i,a,s,o),this.__originalTransform(r,n,i,a,s,o)},t.setTransform=function(r,n,i,a,s,o){e.setTransform(r,n,i,a,s,o),this.__originalSetTransform(r,n,i,a,s,o)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(r){e.rotate(r),this.__originalRotate(r)},t.clip=function(r){e.clip(r),this.__originalClip(r)},t.moveTo=function(r,n){e.moveTo(r,n),this.__originalMoveTo(r,n)},t.lineTo=function(r,n){e.lineTo(r,n),this.__originalLineTo(r,n)},t.bezierCurveTo=function(r,n,i,a,s,o){e.bezierCurveTo(r,n,i,a,s,o),this.__originalBezierCurveTo(r,n,i,a,s,o)},t.rect=function(r,n,i,a){e.rect(r,n,i,a),this.__originalRect(r,n,i,a)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class DSe{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,r,n){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,r,n)):(i=this.canvasFactory.create(r,n),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const r=this.cache[e];this.canvasFactory.destroy(r),delete this.cache[e]}}}function $2(t,e,r,n,i,a,s,o,l,c){const[u,h,f,d,p,g]=_n(t);if(h===0&&f===0){const y=s*u+p,x=Math.round(y),b=o*d+g,w=Math.round(b),_=(s+l)*u+p,S=Math.abs(Math.round(_)-x)||1,C=(o+c)*d+g,T=Math.abs(Math.round(C)-w)||1;return t.setTransform(Math.sign(u),0,0,Math.sign(d),x,w),t.drawImage(e,r,n,i,a,0,0,S,T),t.setTransform(u,h,f,d,p,g),[S,T]}if(u===0&&d===0){const y=o*f+p,x=Math.round(y),b=s*h+g,w=Math.round(b),_=(o+c)*f+p,S=Math.abs(Math.round(_)-x)||1,C=(s+l)*h+g,T=Math.abs(Math.round(C)-w)||1;return t.setTransform(0,Math.sign(h),Math.sign(f),0,x,w),t.drawImage(e,r,n,i,a,0,0,T,S),t.setTransform(u,h,f,d,p,g),[T,S]}t.drawImage(e,r,n,i,a,s,o,l,c);const m=Math.hypot(u,h),v=Math.hypot(f,d);return[m*l,v*c]}class dB{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=$T;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=di.FILL;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(e,r,n){n?.(this),this.clipBox=new Float32Array([0,0,e,r]),this.minMax=xg.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=ra.FILL,r=null){const n=this.minMax.slice();if(e===ra.STROKE){r||rn("Stroke bounding box must include transform."),ot.singularValueDecompose2dScale(r,Fs);const i=Fs[0]*this.lineWidth/2,a=Fs[1]*this.lineWidth/2;n[0]-=i,n[1]-=a,n[2]+=i,n[3]+=a}return n}updateClipFromPath(){const e=ot.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(xg,0)}getClippedPathBoundingBox(e=ra.FILL,r=null){return ot.intersect(this.clipBox,this.getPathBoundingBox(e,r))}}function pB(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const r=e.height,n=e.width,i=r%vs,a=(r-i)/vs,s=i===0?a:a+1,o=t.createImageData(n,vs);let l=0,c;const u=e.data,h=o.data;let f,d,p,g;if(e.kind===k_.GRAYSCALE_1BPP){const m=u.byteLength,v=new Uint32Array(h.buffer,0,h.byteLength>>2),y=v.length,x=n+7>>3,b=4294967295,w=yi.isLittleEndian?4278190080:255;for(f=0;f<s;f++){for(p=f<a?vs:i,c=0,d=0;d<p;d++){const _=m-l;let S=0;const C=_>x?n:_*8-7,T=C&-8;let A=0,k=0;for(;S<T;S+=8)k=u[l++],v[c++]=k&128?b:w,v[c++]=k&64?b:w,v[c++]=k&32?b:w,v[c++]=k&16?b:w,v[c++]=k&8?b:w,v[c++]=k&4?b:w,v[c++]=k&2?b:w,v[c++]=k&1?b:w;for(;S<C;S++)A===0&&(k=u[l++],A=128),v[c++]=k&A?b:w,A>>=1}for(;c<y;)v[c++]=0;t.putImageData(o,0,f*vs)}}else if(e.kind===k_.RGBA_32BPP){for(d=0,g=n*vs*4,f=0;f<a;f++)h.set(u.subarray(l,l+g)),l+=g,t.putImageData(o,0,d),d+=vs;f<s&&(g=n*i*4,h.set(u.subarray(l,l+g)),t.putImageData(o,0,d))}else if(e.kind===k_.RGB_24BPP)for(p=vs,g=n*p,f=0;f<s;f++){for(f>=a&&(p=i,g=n*p),c=0,d=g;d--;)h[c++]=u[l++],h[c++]=u[l++],h[c++]=u[l++],h[c++]=255;t.putImageData(o,0,f*vs)}else throw new Error(`bad image kind: ${e.kind}`)}function gB(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const r=e.height,n=e.width,i=r%vs,a=(r-i)/vs,s=i===0?a:a+1,o=t.createImageData(n,vs);let l=0;const c=e.data,u=o.data;for(let h=0;h<s;h++){const f=h<a?vs:i;({srcPos:l}=kSe({src:c,srcPos:l,dest:u,width:n,height:f,nonBlackColor:0})),t.putImageData(o,0,h*vs)}}function G1(t,e){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)t[n]!==void 0&&(e[n]=t[n]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function z2(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}function mB(t,e){if(e)return!0;ot.singularValueDecompose2dScale(t,Fs);const r=Math.fround(Ac.pixelRatio*mm.PDF_TO_CSS_UNITS);return Fs[0]<=r&&Fs[1]<=r}const MSe=["butt","round","square"],LSe=["miter","round","bevel"],PSe={},vB={};class Bg{constructor(e,r,n,i,a,{optionalContentConfig:s,markedContentStack:o=null},l,c,u){this.ctx=e,this.current=new dB(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=r,this.objs=n,this.canvasFactory=i,this.filterFactory=a,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=s,this.cachedCanvases=new DSe(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=u??null}getObject(e,r,n=null){return typeof r=="string"?(this.dependencyTracker?.recordNamedDependency(e,r),r.startsWith("g_")?this.commonObjs.get(r):this.objs.get(r)):n}beginDrawing({transform:e,viewport:r,transparency:n=!1,background:i=null}){const a=this.ctx.canvas.width,s=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,a,s),this.ctx.fillStyle=o,n){const l=this.cachedCanvases.getCanvas("transparent",a,s);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(..._n(this.compositeCtx))}this.ctx.save(),z2(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=_n(this.ctx)}executeOperatorList(e,r,n,i,a){const s=e.argsArray,o=e.fnArray;let l=r||0;const c=s.length;if(c===l)return l;const u=c-l>fB&&typeof n=="function",h=u?Date.now()+ESe:0;let f=0;const d=this.commonObjs,p=this.objs;let g,m;for(;;){if(i!==void 0&&l===i.nextBreakPoint)return i.breakIt(l,n),l;if(!a||a(l))if(g=o[l],m=s[l]??null,g!==yx.dependency)m===null?this[g](l):this[g](l,...m);else for(const v of m){this.dependencyTracker?.recordNamedData(v,l);const y=v.startsWith("g_")?d:p;if(!y.has(v))return y.get(v,n),l}if(l++,l===c)return l;if(u&&++f>fB){if(Date.now()>h)return n(),l;f=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const r of e.values())typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&(r.width=r.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const r=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=r}}}_scaleImage(e,r){const n=e.width??e.displayWidth,i=e.height??e.displayHeight;let a=Math.max(Math.hypot(r[0],r[1]),1),s=Math.max(Math.hypot(r[2],r[3]),1),o=n,l=i,c="prescale1",u,h;for(;a>2&&o>1||s>2&&l>1;){let f=o,d=l;a>2&&o>1&&(f=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),a/=o/f),s>2&&l>1&&(d=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/d),u=this.cachedCanvases.getCanvas(c,f,d),h=u.context,h.clearRect(0,0,f,d),h.drawImage(e,0,0,o,l,0,0,f,d),e=u.canvas,o=f,l=d,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e,r){const n=this.ctx,{width:i,height:a}=r,s=this.current.fillColor,o=this.current.patternFill,l=_n(n);let c,u,h,f;if((r.bitmap||r.data)&&r.count>1){const A=r.bitmap||r.data.buffer;u=JSON.stringify(o?l:[l.slice(0,4),s]),c=this._cachedBitmapsMap.get(A),c||(c=new Map,this._cachedBitmapsMap.set(A,c));const k=c.get(u);if(k&&!o){const I=Math.round(Math.min(l[0],l[2])+l[4]),E=Math.round(Math.min(l[1],l[3])+l[5]);return this.dependencyTracker?.recordDependencies(e,ao.transformAndFill),{canvas:k,offsetX:I,offsetY:E}}h=k}h||(f=this.cachedCanvases.getCanvas("maskCanvas",i,a),gB(f.context,r));let d=ot.transform(l,[1/i,0,0,-1/a,0,0]);d=ot.transform(d,[1,0,0,1,0,-a]);const p=xg.slice();ot.axialAlignedBoundingBox([0,0,i,a],d,p);const[g,m,v,y]=p,x=Math.round(v-g)||1,b=Math.round(y-m)||1,w=this.cachedCanvases.getCanvas("fillCanvas",x,b),_=w.context,S=g,C=m;_.translate(-S,-C),_.transform(...d),h||(h=this._scaleImage(f.canvas,Pl(_)),h=h.img,c&&o&&c.set(u,h)),_.imageSmoothingEnabled=mB(_n(_),r.interpolate),$2(_,h,0,0,h.width,h.height,0,0,i,a),_.globalCompositeOperation="source-in";const T=ot.transform(Pl(_),[1,0,0,1,-S,-C]);return _.fillStyle=o?s.getPattern(n,this,T,ra.FILL,e):s,_.fillRect(0,0,i,a),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(u,w.canvas)),this.dependencyTracker?.recordDependencies(e,ao.transformAndFill),{canvas:w.canvas,offsetX:Math.round(S),offsetY:Math.round(C)}}setLineWidth(e,r){this.dependencyTracker?.recordSimpleData("lineWidth",e),r!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=r,this.ctx.lineWidth=r}setLineCap(e,r){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=MSe[r]}setLineJoin(e,r){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=LSe[r]}setMiterLimit(e,r){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=r}setDash(e,r,n){this.dependencyTracker?.recordSimpleData("dash",e);const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(r),i.lineDashOffset=n)}setRenderingIntent(e,r){}setFlatness(e,r){}setGState(e,r){for(const[n,i]of r)switch(n){case"LW":this.setLineWidth(e,i);break;case"LC":this.setLineCap(e,i);break;case"LJ":this.setLineJoin(e,i);break;case"ML":this.setMiterLimit(e,i);break;case"D":this.setDash(e,i[0],i[1]);break;case"RI":this.setRenderingIntent(e,i);break;case"FL":this.setFlatness(e,i);break;case"Font":this.setFont(e,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const r=this.ctx.canvas.width,n=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,r,n);this.suspendedCtx=this.ctx;const s=this.ctx=a.context;s.setTransform(this.suspendedCtx.getTransform()),G1(this.suspendedCtx,s),ISe(s,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),G1(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const r=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,r,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,r,n,i){const a=i[0],s=i[1],o=i[2]-a,l=i[3]-s;o===0||l===0||(this.genericComposeSMask(r.context,n,o,l,r.subtype,r.backdrop,r.transferMap,a,s,r.offsetX,r.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,r,n,i,a,s,o,l,c,u,h){let f=e.canvas,d=l-u,p=c-h;if(s)if(d<0||p<0||d+n>f.width||p+i>f.height){const m=this.cachedCanvases.getCanvas("maskExtension",n,i),v=m.context;v.drawImage(f,-d,-p),v.globalCompositeOperation="destination-atop",v.fillStyle=s,v.fillRect(0,0,n,i),v.globalCompositeOperation="source-over",f=m.canvas,d=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const m=new Path2D;m.rect(d,p,n,i),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(d,p,n,i),e.restore()}r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0),a==="Alpha"&&o?r.filter=this.filterFactory.addAlphaFilter(o):a==="Luminosity"&&(r.filter=this.filterFactory.addLuminosityFilter(o));const g=new Path2D;g.rect(l,c,n,i),r.clip(g),r.globalCompositeOperation="destination-in",r.drawImage(f,d,p,n,i,l,c,n,i),r.restore()}save(e){this.inSMaskMode&&G1(this.ctx,this.suspendedCtx),this.ctx.save();const r=this.current;this.stateStack.push(r),this.current=r.clone(),this.dependencyTracker?.save(e)}restore(e){if(this.dependencyTracker?.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&G1(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,r,n,i,a,s,o){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(r,n,i,a,s,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,r,n,i){let[a]=n;if(!i){a||=n[0]=new Path2D,this[r](e,a);return}if(this.dependencyTracker!==null){const s=r===yx.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,i[0]-s,i[2]+s,i[1]-s,i[3]+s).recordDependencies(e,["transform"])}a instanceof Path2D||(a=n[0]=vY(a)),ot.axialAlignedBoundingBox(i,_n(this.ctx),this.current.minMax),this[r](e,a),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,r,n=!0){const i=this.ctx,a=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof a=="object"&&a?.getPattern){const s=a.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=a.getPattern(i,this,Pl(i),ra.STROKE,e),s){const o=new Path2D;o.addPath(r,i.getTransform().invertSelf().multiplySelf(s)),r=o}this.rescaleAndStroke(r,!1),i.restore()}else this.rescaleAndStroke(r,!0);this.dependencyTracker?.recordDependencies(e,ao.stroke),n&&this.consumePath(e,r,this.current.getClippedPathBoundingBox(ra.STROKE,_n(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(e,r){this.stroke(e,r)}fill(e,r,n=!0){const i=this.ctx,a=this.current.fillColor,s=this.current.patternFill;let o=!1;if(s){const c=a.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=a.getPattern(i,this,Pl(i),ra.FILL,e),c){const u=new Path2D;u.addPath(r,i.getTransform().invertSelf().multiplySelf(c)),r=u}o=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(i.fill(r,"evenodd"),this.pendingEOFill=!1):i.fill(r)),this.dependencyTracker?.recordDependencies(e,ao.fill),o&&(i.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,r,l)}eoFill(e,r){this.pendingEOFill=!0,this.fill(e,r)}fillStroke(e,r){this.fill(e,r,!1),this.stroke(e,r,!1),this.consumePath(e,r)}eoFillStroke(e,r){this.pendingEOFill=!0,this.fillStroke(e,r)}closeFillStroke(e,r){this.fillStroke(e,r)}closeEOFillStroke(e,r){this.pendingEOFill=!0,this.fillStroke(e,r)}endPath(e,r){this.consumePath(e,r)}rawFillPath(e,r){this.ctx.fill(r),this.dependencyTracker?.recordDependencies(e,ao.rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=PSe}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=vB}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){const r=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;r!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",e),i.recordCloseMarker(e)}if(r!==void 0){const i=new Path2D,a=n.getTransform().invertSelf();for(const{transform:s,x:o,y:l,fontSize:c,path:u}of r)u&&i.addPath(u,new DOMMatrix(s).preMultiplySelf(a).translate(o,l).scale(c,-c));n.clip(i)}delete this.pendingTextPaths}setCharSpacing(e,r){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=r}setWordSpacing(e,r){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=r}setHScale(e,r){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=r/100}setLeading(e,r){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-r}setFont(e,r,n){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",r,e);const i=this.commonObjs.get(r),a=this.current;if(!i)throw new Error(`Can't find font for ${r}`);if(a.fontMatrix=i.fontMatrix||$T,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Jt("Invalid font matrix for font "+r),n<0?(n=-n,a.fontDirection=-1):a.fontDirection=1,this.current.font=i,this.current.fontSize=n,i.isType3Font)return;const s=i.loadedName||"sans-serif",o=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let l="normal";i.black?l="900":i.bold&&(l="bold");const c=i.italic?"italic":"normal";let u=n;n<uB?u=uB:n>hB&&(u=hB),this.current.fontSizeScale=n/u,this.ctx.font=`${c} ${l} ${u}px ${o}`}setTextRenderingMode(e,r){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=r}setTextRise(e,r){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=r}moveText(e,r,n){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=r,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,r,n){this.setLeading(e,-n),this.moveText(e,r,n)}setTextMatrix(e,r){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);const{current:n}=this;n.textMatrix=r,n.textMatrixScale=Math.hypot(r[0],r[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}#n(e,r,n){const i=new Path2D;return i.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(r)),i}paintChar(e,r,n,i,a,s){const o=this.ctx,l=this.current,c=l.font,u=l.textRenderingMode,h=l.fontSize/l.fontSizeScale,f=u&di.FILL_STROKE_MASK,d=!!(u&di.ADD_TO_PATH_FLAG),p=l.patternFill&&!c.missingFile,g=l.patternStroke&&!c.missingFile;let m;if((c.disableFontFace||d||p||g)&&!c.missingFile&&(m=c.getPathGenerator(this.commonObjs,r)),m&&(c.disableFontFace||p||g)){o.save(),o.translate(n,i),o.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(e,o,c);let v;if(f===di.FILL||f===di.FILL_STROKE)if(a){v=o.getTransform(),o.setTransform(...a);const y=this.#n(m,v,a);o.fill(y)}else o.fill(m);if(f===di.STROKE||f===di.FILL_STROKE)if(s){v||=o.getTransform(),o.setTransform(...s);const{a:y,b:x,c:b,d:w}=v,_=ot.inverseTransform(s),S=ot.transform([y,x,b,w,0,0],_);ot.singularValueDecompose2dScale(S,Fs),o.lineWidth*=Math.max(Fs[0],Fs[1])/h,o.stroke(this.#n(m,v,s))}else o.lineWidth/=h,o.stroke(m);o.restore()}else(f===di.FILL||f===di.FILL_STROKE)&&(o.fillText(r,n,i),this.dependencyTracker?.recordCharacterBBox(e,o,c,h,n,i,()=>o.measureText(r))),(f===di.STROKE||f===di.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,h,n,i,()=>o.measureText(r)).recordDependencies(e,ao.stroke),o.strokeText(r,n,i));d&&((this.pendingTextPaths||=[]).push({transform:_n(o),x:n,y:i,fontSize:h,path:m}),this.dependencyTracker?.recordCharacterBBox(e,o,c,h,n,i))}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const r=e.getImageData(0,0,10,10).data;let n=!1;for(let i=3;i<r.length;i+=4)if(r[i]>0&&r[i]<255){n=!0;break}return Qt(this,"isFontSubpixelAAEnabled",n)}showText(e,r){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,ao.showText).resetBBox(e),this.current.textRenderingMode&di.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const n=this.current,i=n.font;if(i.isType3Font){this.showType3Text(e,r),this.dependencyTracker?.recordShowTextOperation(e);return}const a=n.fontSize;if(a===0){this.dependencyTracker?.recordOperation(e);return}const s=this.ctx,o=n.fontSizeScale,l=n.charSpacing,c=n.wordSpacing,u=n.fontDirection,h=n.textHScale*u,f=r.length,d=i.vertical,p=d?1:-1,g=i.defaultVMetrics,m=a*n.fontMatrix[0],v=n.textRenderingMode===di.FILL&&!i.disableFontFace&&!n.patternFill;s.save(),n.textMatrix&&s.transform(...n.textMatrix),s.translate(n.x,n.y+n.textRise),u>0?s.scale(h,-1):s.scale(h,1);let y,x;const b=n.textRenderingMode&di.FILL_STROKE_MASK,w=b===di.FILL||b===di.FILL_STROKE,_=b===di.STROKE||b===di.FILL_STROKE;if(w&&n.patternFill){s.save();const k=n.fillColor.getPattern(s,this,Pl(s),ra.FILL,e);y=_n(s),s.restore(),s.fillStyle=k}if(_&&n.patternStroke){s.save();const k=n.strokeColor.getPattern(s,this,Pl(s),ra.STROKE,e);x=_n(s),s.restore(),s.strokeStyle=k}let S=n.lineWidth;const C=n.textMatrixScale;if(C===0||S===0?_&&(S=this.getSinglePixelWidth()):S/=C,o!==1&&(s.scale(o,o),S/=o),s.lineWidth=S,i.isInvalidPDFjsFont){const k=[];let I=0;for(const M of r)k.push(M.unicode),I+=M.width;const E=k.join("");if(s.fillText(E,0,0),this.dependencyTracker!==null){const M=s.measureText(E);this.dependencyTracker.recordBBox(e,this.ctx,-M.actualBoundingBoxLeft,M.actualBoundingBoxRight,-M.actualBoundingBoxAscent,M.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=I*m*h,s.restore(),this.compose();return}let T=0,A;for(A=0;A<f;++A){const k=r[A];if(typeof k=="number"){T+=p*k*a/1e3;continue}let I=!1;const E=(k.isSpace?c:0)+l,M=k.fontChar,R=k.accent;let D,L,P=k.width;if(d){const N=k.vmetric||g,U=-(k.vmetric?N[1]:P*.5)*m,j=N[2]*m;P=N?-N[0]:P,D=U/o,L=(T+j)/o}else D=T/o,L=0;let O;if(i.remeasure&&P>0){O=s.measureText(M);const N=O.width*1e3/a*o;if(P<N&&this.isFontSubpixelAAEnabled){const U=P/N;I=!0,s.save(),s.scale(U,1),D/=U}else P!==N&&(D+=(P-N)/2e3*a/o)}if(this.contentVisible&&(k.isInFont||i.missingFile)){if(v&&!R)s.fillText(M,D,L),this.dependencyTracker?.recordCharacterBBox(e,s,O?{bbox:null}:i,a/o,D,L,()=>O??s.measureText(M));else if(this.paintChar(e,M,D,L,y,x),R){const N=D+a*R.offset.x/o,U=L-a*R.offset.y/o;this.paintChar(e,R.fontChar,N,U,y,x)}}const $=d?P*m-E*u:P*m+E*u;T+=$,I&&s.restore()}d?n.y-=T:n.x+=T*h,s.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,r){const n=this.ctx,i=this.current,a=i.font,s=i.fontSize,o=i.fontDirection,l=a.vertical?1:-1,c=i.charSpacing,u=i.wordSpacing,h=i.textHScale*o,f=i.fontMatrix||$T,d=r.length,p=i.textRenderingMode===di.INVISIBLE;let g,m,v,y;if(p||s===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),i.textMatrix&&n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),n.scale(h,o);const x=this.dependencyTracker;for(this.dependencyTracker=x?new GS(x,e):null,g=0;g<d;++g){if(m=r[g],typeof m=="number"){y=l*m*s/1e3,this.ctx.translate(y,0),i.x+=y*h;continue}const b=(m.isSpace?u:0)+c,w=a.charProcOperatorList[m.operatorListId];w?this.contentVisible&&(this.save(),n.scale(s,s),n.transform(...f),this.executeOperatorList(w),this.restore()):Jt(`Type3 character "${m.operatorListId}" is not available.`);const _=[m.width,0];ot.applyTransform(_,f),v=_[0]*s+b,n.translate(v,0),i.x+=v*h}n.restore(),x&&(this.dependencyTracker=x)}setCharWidth(e,r,n){}setCharWidthAndBounds(e,r,n,i,a,s,o){const l=new Path2D;l.rect(i,a,s-i,o-a),this.ctx.clip(l),this.dependencyTracker?.recordBBox(e,this.ctx,i,s,a,o).recordClipBox(e,this.ctx,i,s,a,o),this.endPath(e)}getColorN_Pattern(e,r){let n;if(r[0]==="TilingPattern"){const i=this.baseTransform||_n(this.ctx),a={createCanvasGraphics:(s,o)=>new Bg(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new GS(this.dependencyTracker,o,!0):null)};n=new wD(r,this.ctx,a,i)}else n=this._getPattern(e,r[1],r[2]);return n}setStrokeColorN(e,...r){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,r),this.current.patternStroke=!0}setFillColorN(e,...r){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,r),this.current.patternFill=!0}setStrokeRGBColor(e,r){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=r,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,r){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=r,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,r,n=null){let i;return this.cachedPatterns.has(r)?i=this.cachedPatterns.get(r):(i=TSe(this.getObject(e,r)),this.cachedPatterns.set(r,i)),n&&(i.matrix=n),i}shadingFill(e,r){if(!this.contentVisible)return;const n=this.ctx;this.save(e);const i=this._getPattern(e,r);n.fillStyle=i.getPattern(n,this,Pl(n),ra.SHADING,e);const a=Pl(n);if(a){const{width:s,height:o}=n.canvas,l=xg.slice();ot.axialAlignedBoundingBox([0,0,s,o],a,l);const[c,u,h,f]=l;this.ctx.fillRect(c,u,h-c,f-u)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,ao.transform).recordDependencies(e,ao.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){rn("Should not call beginInlineImage")}beginImageData(){rn("Should not call beginImageData")}paintFormXObjectBegin(e,r,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),r&&this.transform(e,...r),this.baseTransform=_n(this.ctx),n)){ot.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);const[i,a,s,o]=n,l=new Path2D;l.rect(i,a,s-i,o-a),this.ctx.clip(l),this.dependencyTracker?.recordClipBox(e,this.ctx,i,s,a,o),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,r){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;r.isolated||hC("TODO: Support non-isolated groups."),r.knockout&&Jt("Knockout groups not supported.");const i=_n(n);if(r.matrix&&n.transform(...r.matrix),!r.bbox)throw new Error("Bounding box is required.");let a=xg.slice();ot.axialAlignedBoundingBox(r.bbox,_n(n),a);const s=[0,0,n.canvas.width,n.canvas.height];a=ot.intersect(a,s)||[0,0,0,0];const o=Math.floor(a[0]),l=Math.floor(a[1]),c=Math.max(Math.ceil(a[2])-o,1),u=Math.max(Math.ceil(a[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,u]);let h="groupAt"+this.groupLevel;r.smask&&(h+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(h,c,u),d=f.context;d.translate(-o,-l),d.transform(...i);let p=new Path2D;const[g,m,v,y]=r.bbox;if(p.rect(g,m,v-g,y-m),r.matrix){const x=new Path2D;x.addPath(p,new DOMMatrix(r.matrix)),p=x}d.clip(p),r.smask&&this.smaskStack.push({canvas:f.canvas,context:d,offsetX:o,offsetY:l,subtype:r.smask.subtype,backdrop:r.smask.backdrop,transferMap:r.smask.transferMap||null,startTransformInverse:null}),(!r.smask||this.dependencyTracker)&&(n.setTransform(1,0,0,1,0,0),n.translate(o,l),n.save()),G1(n,d),this.ctx=d,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e,r){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),r.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=_n(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...a);const s=xg.slice();ot.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],a,s),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,r,n,i,a,s){if(this.#e(),z2(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const o=n[2]-n[0],l=n[3]-n[1];if(s&&this.annotationCanvasMap){i=i.slice(),i[4]-=n[0],i[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=o,n[3]=l,ot.singularValueDecompose2dScale(_n(this.ctx),Fs);const{viewportScale:c}=this,u=Math.ceil(o*this.outputScaleX*c),h=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,h);const{canvas:f,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(r,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(Fs[0],0,0,-Fs[1],0,l*Fs[1]),z2(this.ctx)}else{z2(this.ctx),this.endPath(e);const c=new Path2D;c.rect(n[0],n[1],o,l),this.ctx.clip(c)}}this.current=new dB(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...i),this.transform(e,...a)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,r){if(!this.contentVisible)return;const n=r.count;r=this.getObject(e,r.data,r),r.count=n;const i=this.ctx,a=this._createMaskCanvas(e,r),s=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(s,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+s.width,a.offsetY,a.offsetY+s.height).recordOperation(e),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,r,n,i=0,a=0,s,o){if(!this.contentVisible)return;r=this.getObject(e,r.data,r);const l=this.ctx;l.save();const c=_n(l);l.transform(n,i,a,s,0,0);const u=this._createMaskCanvas(e,r);l.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let h=0,f=o.length;h<f;h+=2){const d=ot.transform(c,[n,i,a,s,o[h],o[h+1]]);l.drawImage(u.canvas,d[4],d[5]),this.dependencyTracker?.recordBBox(e,this.ctx,d[4],d[4]+u.canvas.width,d[5],d[5]+u.canvas.height)}l.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,r){if(!this.contentVisible)return;const n=this.ctx,i=this.current.fillColor,a=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,ao.transformAndFill);for(const s of r){const{data:o,width:l,height:c,transform:u}=s,h=this.cachedCanvases.getCanvas("maskCanvas",l,c),f=h.context;f.save();const d=this.getObject(e,o,s);gB(f,d),f.globalCompositeOperation="source-in",f.fillStyle=a?i.getPattern(f,this,Pl(n),ra.FILL,e):i,f.fillRect(0,0,l,c),f.restore(),n.save(),n.transform(...u),n.scale(1,-1),$2(n,h.canvas,0,0,l,c,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,l,0,c),n.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,r){if(!this.contentVisible)return;const n=this.getObject(e,r);if(!n){Jt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,n)}paintImageXObjectRepeat(e,r,n,i,a){if(!this.contentVisible)return;const s=this.getObject(e,r);if(!s){Jt("Dependent image isn't ready yet");return}const o=s.width,l=s.height,c=[];for(let u=0,h=a.length;u<h;u+=2)c.push({transform:[n,0,0,i,a[u],a[u+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(e,s,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:r,width:n,height:i}=e,a=this.cachedCanvases.getCanvas("inlineImage",n,i),s=a.context;return s.filter=this.current.transferMaps,s.drawImage(r,0,0),s.filter="none",a.canvas}paintInlineImageXObject(e,r){if(!this.contentVisible)return;const n=r.width,i=r.height,a=this.ctx;this.save(e);const{filter:s}=a;s!=="none"&&s!==""&&(a.filter="none"),a.scale(1/n,-1/i);let o;if(r.bitmap)o=this.applyTransferMapsToBitmap(r);else if(typeof HTMLElement=="function"&&r instanceof HTMLElement||!r.data)o=r;else{const u=this.cachedCanvases.getCanvas("inlineImage",n,i).context;pB(u,r),o=this.applyTransferMapsToCanvas(u)}const l=this._scaleImage(o,Pl(a));a.imageSmoothingEnabled=mB(_n(a),r.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,a,0,n,-i,0).recordDependencies(e,ao.imageXObject).recordOperation(e),$2(a,l.img,0,0,l.paintWidth,l.paintHeight,0,-i,n,i),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,r,n){if(!this.contentVisible)return;const i=this.ctx;let a;if(r.bitmap)a=r.bitmap;else{const s=r.width,o=r.height,c=this.cachedCanvases.getCanvas("inlineImage",s,o).context;pB(c,r),a=this.applyTransferMapsToCanvas(c)}this.dependencyTracker?.resetBBox(e);for(const s of n)i.save(),i.transform(...s.transform),i.scale(1,-1),$2(i,a,s.x,s.y,s.w,s.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,ao.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,r){}markPointProps(e,r,n){}beginMarkedContent(e,r){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,r,n){this.dependencyTracker?.beginMarkedContent(e),r==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,r,n){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);const a=this.ctx;this.pendingClip?(i||(this.pendingClip===vB?a.clip(r,"evenodd"):a.clip(r)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=_n(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const r=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/r}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:r,b:n,c:i,d:a}=this.ctx.getTransform();let s,o;if(n===0&&i===0){const l=Math.abs(r),c=Math.abs(a);if(l===c)if(e===0)s=o=1/l;else{const u=l*e;s=o=u<1?1/u:1}else if(e===0)s=1/l,o=1/c;else{const u=l*e,h=c*e;s=u<1?1/u:1,o=h<1?1/h:1}}else{const l=Math.abs(r*a-n*i),c=Math.hypot(r,n),u=Math.hypot(i,a);if(e===0)s=u/l,o=c/l;else{const h=e*l;s=u>h?u/h:1,o=c>h?c/h:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,r){const{ctx:n,current:{lineWidth:i}}=this,[a,s]=this.getScaleForStroking();if(a===s){n.lineWidth=(i||1)*a,n.stroke(e);return}const o=n.getLineDash();r&&n.save(),n.scale(a,s),j8.a=1/a,j8.d=1/s;const l=new Path2D;if(l.addPath(e,j8),o.length>0){const c=Math.max(a,s);n.setLineDash(o.map(u=>u/c)),n.lineDashOffset/=c}n.lineWidth=i||1,n.stroke(l),r&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const t in yx)Bg.prototype[t]!==void 0&&(Bg.prototype[yx[t]]=Bg.prototype[t]);class Iy{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}}class RSe{#e;#t;constructor({parsedData:e,rawData:r}){this.#e=e,this.#t=r}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}}const ng=Symbol("INTERNAL");class NSe{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:r,intent:n,usage:i,rbGroups:a}){this.#e=!!(e&Rs.DISPLAY),this.#t=!!(e&Rs.PRINT),this.name=r,this.intent=n,this.usage=i,this.rbGroups=a}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;const{print:e,view:r}=this.usage;return this.#e?r?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,r,n=!1){e!==ng&&rn("Internal method `_setVisible` called."),this.#n=n,this.#r=r}}class OSe{#e=null;#t=new Map;#n=null;#r=null;constructor(e,r=Rs.DISPLAY){if(this.renderingIntent=r,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(const n of e.groups)this.#t.set(n.id,new NSe(r,n));if(e.baseState==="OFF")for(const n of this.#t.values())n._setVisible(ng,!1);for(const n of e.on)this.#t.get(n)._setVisible(ng,!0);for(const n of e.off)this.#t.get(n)._setVisible(ng,!1);this.#n=this.getHash()}}#i(e){const r=e.length;if(r<2)return!0;const n=e[0];for(let i=1;i<r;i++){const a=e[i];let s;if(Array.isArray(a))s=this.#i(a);else if(this.#t.has(a))s=this.#t.get(a).visible;else return Jt(`Optional content group not found: ${a}`),!0;switch(n){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return n==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return hC("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(Jt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#i(e.expression);if(!e.policy||e.policy==="AnyOn"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!1}return!0}return Jt(`Unknown optional content policy ${e.policy}.`),!0}return Jt(`Unknown group type ${e.type}.`),!0}setVisibility(e,r=!0,n=!0){const i=this.#t.get(e);if(!i){Jt(`Optional content group not found: ${e}`);return}if(n&&r&&i.rbGroups.length)for(const a of i.rbGroups)for(const s of a)s!==e&&this.#t.get(s)?._setVisible(ng,!1,!0);i._setVisible(ng,!!r,!0),this.#e=null}setOCGState({state:e,preserveRB:r}){let n;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":n=i;continue}const a=this.#t.get(i);if(a)switch(n){case"ON":this.setVisibility(i,!0,r);break;case"OFF":this.setVisibility(i,!1,r);break;case"Toggle":this.setVisibility(i,!a.visible,r);break}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;const e=new xY;for(const[r,n]of this.#t)e.update(`${r}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}}class BSe{constructor(e,{disableRange:r=!1,disableStream:n=!1}){Sr(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:a,progressiveDone:s,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=o,a?.length>0){const l=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!r,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:r}){const n=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const i=this._rangeReaders.some(function(a){return a._begin!==e?!1:(a._enqueue(n),!0)});Sr(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const r=this._rangeReaders.indexOf(e);r>=0&&this._rangeReaders.splice(r,1)}getFullReader(){Sr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new FSe(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,r){if(r<=this._progressiveDataLength)return null;const n=new $Se(this,e,r);return this._pdfDataRangeTransport.requestDataRange(e,r),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class FSe{constructor(e,r,n=!1,i=null){this._stream=e,this._done=n||!1,this._filename=gD(i)?i:null,this._queuedChunks=r||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class $Se{constructor(e,r,n){this._stream=e,this._begin=r,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function zSe(t){let e=!0,r=n("filename\\*","i").exec(t);if(r){r=r[1];let u=o(r);return u=unescape(u),u=l(u),u=c(u),a(u)}if(r=s(t),r){const u=c(r);return a(u)}if(r=n("filename","i").exec(t),r){r=r[1];let u=o(r);return u=c(u),a(u)}function n(u,h){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',h)}function i(u,h){if(u){if(!/^[\x00-\xFF]+$/.test(h))return h;try{const f=new TextDecoder(u,{fatal:!0}),d=_b(h);h=f.decode(d),e=!1}catch{}}return h}function a(u){return e&&/[\x80-\xff]/.test(u)&&(u=i("utf-8",u),e&&(u=i("iso-8859-1",u))),u}function s(u){const h=[];let f;const d=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=d.exec(u))!==null;){let[,g,m,v]=f;if(g=parseInt(g,10),g in h){if(g===0)break;continue}h[g]=[m,v]}const p=[];for(let g=0;g<h.length&&g in h;++g){let[m,v]=h[g];v=o(v),m&&(v=unescape(v),g===0&&(v=l(v))),p.push(v)}return p.join("")}function o(u){if(u.startsWith('"')){const h=u.slice(1).split('\\"');for(let f=0;f<h.length;++f){const d=h[f].indexOf('"');d!==-1&&(h[f]=h[f].slice(0,d),h.length=f+1),h[f]=h[f].replaceAll(/\\(.)/g,"$1")}u=h.join('"')}return u}function l(u){const h=u.indexOf("'");if(h===-1)return u;const f=u.slice(0,h),p=u.slice(h+1).replace(/^[^']*'/,"");return i(f,p)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(h,f,d,p){if(d==="q"||d==="Q")return p=p.replaceAll("_"," "),p=p.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,m){return String.fromCharCode(parseInt(m,16))}),i(f,p);try{p=atob(p)}catch{}return i(f,p)})}return""}function TY(t,e){const r=new Headers;if(!t||!e||typeof e!="object")return r;for(const n in e){const i=e[n];i!==void 0&&r.append(n,i)}return r}function pC(t){return URL.parse(t)?.origin??null}function kY({responseHeaders:t,isHttp:e,rangeChunkSize:r,disableRange:n}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t.get("Content-Length"),10);return!Number.isInteger(a)||(i.suggestedLength=a,a<=2*r)||n||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function EY(t){const e=t.get("Content-Disposition");if(e){let r=zSe(e);if(r.includes("%"))try{r=decodeURIComponent(r)}catch{}if(gD(r))return r}return null}function kb(t,e){return new HS(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,t===404||t===0&&e.startsWith("file:"))}function IY(t){return t===200||t===206}function DY(t,e,r){return{method:"GET",headers:t,signal:r.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function MY(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Jt(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class VSe{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=TY(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Sr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new USe(this),this._fullRequestReader}getRangeReader(e,r){if(r<=this._progressiveDataLength)return null;const n=new jSe(this,e,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class USe{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const r=e.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange;const n=new Headers(e.headers),i=r.url;fetch(i,DY(n,this._withCredentials,this._abortController)).then(a=>{if(e._responseOrigin=pC(a.url),!IY(a.status))throw kb(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const s=a.headers,{allowRangeRequests:o,suggestedLength:l}=kY({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=EY(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new rf("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:r}=await this._reader.read();return r?{value:e,done:r}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:MY(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class jSe{constructor(e,r,n){this._stream=e,this._reader=null,this._loaded=0;const i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const a=new Headers(e.headers);a.append("Range",`bytes=${r}-${n-1}`);const s=i.url;fetch(s,DY(a,this._withCredentials,this._abortController)).then(o=>{const l=pC(o.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!IY(o.status))throw kb(o.status,s);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:r}=await this._reader.read();return r?{value:e,done:r}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:MY(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}const H8=200,G8=206;function HSe(t){const e=t.response;return typeof e!="string"?e:_b(e).buffer}class GSe{_responseOrigin=null;constructor({url:e,httpHeaders:r,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=TY(this.isHttp,r),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const r=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const[a,s]of this.headers)r.setRequestHeader(a,s);return this.isHttp&&"begin"in e&&"end"in e?(r.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=G8):i.expectedStatus=H8,r.responseType="arraybuffer",Sr(e.onError,"Expected `onError` callback to be provided."),r.onerror=()=>{e.onError(r.status)},r.onreadystatechange=this.onStateChange.bind(this,n),r.onprogress=this.onProgress.bind(this,n),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,r.send(null),n}onProgress(e,r){const n=this.pendingRequests[e];n&&n.onProgress?.(r)}onStateChange(e,r){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){n.onError(i.status);return}const a=i.status||H8;if(!(a===H8&&n.expectedStatus===G8)&&a!==n.expectedStatus){n.onError(i.status);return}const o=HSe(i);if(a===G8){const l=i.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);c?n.onDone({begin:parseInt(c[1],10),chunk:o}):(Jt('Missing or invalid "Content-Range" header.'),n.onError(0))}else o?n.onDone({begin:0,chunk:o}):n.onError(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const r=this.pendingRequests[e].xhr;delete this.pendingRequests[e],r.abort()}}class WSe{constructor(e){this._source=e,this._manager=new GSe(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const r=this._rangeRequestReaders.indexOf(e);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return Sr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new qSe(this._manager,this._source),this._fullRequestReader}getRangeReader(e,r){const n=new XSe(this._manager,e,r);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class qSe{constructor(e,r){this._manager=e,this._url=r.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,r=this._manager.getRequestXhr(e);this._manager._responseOrigin=pC(r.responseURL);const n=r.getAllResponseHeaders(),i=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...c]=o.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:a,suggestedLength:s}=kY({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=EY(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=kb(e,this._url),this._headersCapability.reject(this._storedError);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class XSe{constructor(e,r,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:r,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const e=pC(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){const r=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=kb(e,this._url);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const YSe=/^[a-z][a-z0-9\-+.]+:/i;function KSe(t){if(YSe.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class ZSe{constructor(e){this.source=e,this.url=KSe(e.url),Sr(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Sr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new JSe(this),this._fullRequestReader}getRangeReader(e,r){if(r<=this._progressiveDataLength)return null;const n=new QSe(this,e,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class JSe{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const r=e.source;this._contentLength=r.length,this._loaded=0,this._filename=null,this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const n=process.getBuiltinModule("fs");n.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=kb(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",r=>{this._error(r)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new rf("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class QSe{constructor(e,r,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const i=e.source;this._isStreamingSupported=!i.disableStream;const a=process.getBuiltinModule("fs");this._setReadableStream(a.createReadStream(this._url,{start:r,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",r=>{this._error(r)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const W1=Symbol("INITIAL_DATA");class LY{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:W1}}get(e,r=null){if(r){const i=this.#t(e);return i.promise.then(()=>r(i.data)),null}const n=this.#e[e];if(!n||n.data===W1)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const r=this.#e[e];return!!r&&r.data!==W1}delete(e){const r=this.#e[e];return!r||r.data===W1?!1:(delete this.#e[e],!0)}resolve(e,r=null){const n=this.#t(e);n.data=r,n.resolve()}clear(){for(const e in this.#e){const{data:r}=this.#e[e];r?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const e in this.#e){const{data:r}=this.#e[e];r!==W1&&(yield[e,r])}}}const e9e=1e5,yB=30;class Ns{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#s=0;#o=0;#l=null;#c=null;#f=0;#h=0;#d=Object.create(null);#m=[];#g=null;#u=[];#p=new WeakMap;#v=null;static#x=new Map;static#y=new Map;static#C=new WeakMap;static#S=null;static#b=new Set;constructor({textContentSource:e,container:r,viewport:n}){if(e instanceof ReadableStream)this.#g=e;else if(typeof e=="object")this.#g=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#c=r,this.#h=n.scale*Ac.pixelRatio,this.#f=n.rotation,this.#a={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:a,pageX:s,pageY:o}=n.rawDims;this.#v=[1,0,0,-1,-s,o+a],this.#o=i,this.#s=a,Ns.#I(),r.style.setProperty("--min-font-size",Ns.#S),m0(r,n),this.#e.promise.finally(()=>{Ns.#b.delete(this),this.#a=null,this.#d=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:r}=yi.platform;return Qt(this,"fontFamilyMap",new Map([["sans-serif",`${e&&r?"Calibri, ":""}sans-serif`],["monospace",`${e&&r?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{this.#l.read().then(({value:r,done:n})=>{if(n){this.#e.resolve();return}this.#i??=r.lang,Object.assign(this.#d,r.styles),this.#T(r.items),e()},this.#e.reject)};return this.#l=this.#g.getReader(),Ns.#b.add(this),e(),this.#e.promise}update({viewport:e,onBefore:r=null}){const n=e.scale*Ac.pixelRatio,i=e.rotation;if(i!==this.#f&&(r?.(),this.#f=i,m0(this.#c,{rotation:i})),n!==this.#h){r?.(),this.#h=n;const a={div:null,properties:null,ctx:Ns.#D(this.#i)};for(const s of this.#u)a.properties=this.#p.get(s),a.div=s,this.#A(a)}}cancel(){const e=new rf("TextLayer task cancelled.");this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#T(e){if(this.#n)return;this.#a.ctx??=Ns.#D(this.#i);const r=this.#u,n=this.#m;for(const i of e){if(r.length>e9e){Jt("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){const a=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),i.id&&this.#t.setAttribute("id",`${i.id}`),a.append(this.#t)}else i.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}n.push(i.str),this.#w(i)}}#w(e){const r=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#u.push(r);const i=ot.transform(this.#v,e.transform);let a=Math.atan2(i[1],i[0]);const s=this.#d[e.fontName];s.vertical&&(a+=Math.PI/2);let o=this.#r&&s.fontSubstitution||s.fontFamily;o=Ns.fontFamilyMap.get(o)||o;const l=Math.hypot(i[2],i[3]),c=l*Ns.#B(o,s,this.#i);let u,h;a===0?(u=i[4],h=i[5]-c):(u=i[4]+c*Math.sin(a),h=i[5]-c*Math.cos(a));const f=r.style;f.left=`${(100*u/this.#o).toFixed(2)}%`,f.top=`${(100*h/this.#s).toFixed(2)}%`,f.setProperty("--font-height",`${l.toFixed(2)}px`),f.fontFamily=o,n.fontSize=l,r.setAttribute("role","presentation"),r.textContent=e.str,r.dir=e.dir,this.#r&&(r.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),a!==0&&(n.angle=a*(180/Math.PI));let d=!1;if(e.str.length>1)d=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const p=Math.abs(e.transform[0]),g=Math.abs(e.transform[3]);p!==g&&Math.max(p,g)/Math.min(p,g)>1.5&&(d=!0)}if(d&&(n.canvasWidth=s.vertical?e.height:e.width),this.#p.set(r,n),this.#a.div=r,this.#a.properties=n,this.#A(this.#a),n.hasText&&this.#t.append(r),n.hasEOL){const p=document.createElement("br");p.setAttribute("role","presentation"),this.#t.append(p)}}#A(e){const{div:r,properties:n,ctx:i}=e,{style:a}=r;if(n.canvasWidth!==0&&n.hasText){const{fontFamily:s}=a,{canvasWidth:o,fontSize:l}=n;Ns.#E(i,l*this.#h,s);const{width:c}=i.measureText(r.textContent);c>0&&a.setProperty("--scale-x",o*this.#h/c)}n.angle!==0&&a.setProperty("--rotate",`${n.angle}deg`)}static cleanup(){if(!(this.#b.size>0)){this.#x.clear();for(const{canvas:e}of this.#y.values())e.remove();this.#y.clear()}}static#D(e=null){let r=this.#y.get(e||="");if(!r){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=e,document.body.append(n),r=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#y.set(e,r),this.#C.set(r,{size:0,family:""})}return r}static#E(e,r,n){const i=this.#C.get(e);r===i.size&&n===i.family||(e.font=`${r}px ${n}`,i.size=r,i.family=n)}static#I(){if(this.#S!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#S=e.getBoundingClientRect().height,e.remove()}static#B(e,r,n){const i=this.#x.get(e);if(i)return i;const a=this.#D(n);a.canvas.width=a.canvas.height=yB,this.#E(a,yB,e);const s=a.measureText(""),o=s.fontBoundingBoxAscent,l=Math.abs(s.fontBoundingBoxDescent);a.canvas.width=a.canvas.height=0;let c=.8;return o?c=o/(o+l):(yi.platform.isFirefox&&Jt("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),r.ascent?c=r.ascent:r.descent&&(c=1+r.descent)),this.#x.set(e,c),c}}const t9e=100;function PY(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new _D,{docId:r}=e,n=t.url?lSe(t.url):null,i=t.data?cSe(t.data):null,a=t.httpHeaders||null,s=t.withCredentials===!0,o=t.password??null,l=t.range instanceof RY?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:2**16;let u=t.worker instanceof bx?t.worker:null;const h=t.verbosity,f=typeof t.docBaseUrl=="string"&&!fC(t.docBaseUrl)?t.docBaseUrl:null,d=N2(t.cMapUrl),p=t.cMapPacked!==!1,g=t.CMapReaderFactory||(Ra?vSe:iB),m=N2(t.iccUrl),v=N2(t.standardFontDataUrl),y=t.StandardFontDataFactory||(Ra?ySe:aB),x=N2(t.wasmUrl),b=t.WasmFactory||(Ra?xSe:sB),w=t.stopAtErrors!==!0,_=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,S=t.isEvalSupported!==!1,C=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Ra,T=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!Ra&&(yi.platform.isFirefox||!globalThis.chrome),A=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,k=typeof t.disableFontFace=="boolean"?t.disableFontFace:Ra,I=t.fontExtraProperties===!0,E=t.enableXfa===!0,M=t.ownerDocument||globalThis.document,R=t.disableRange===!0,D=t.disableStream===!0,L=t.disableAutoFetch===!0,P=t.pdfBug===!0,O=t.CanvasFactory||(Ra?mSe:dSe),$=t.FilterFactory||(Ra?gSe:pSe),N=t.enableHWA===!0,U=t.useWasm!==!1,j=l?l.length:t.length??NaN,B=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Ra&&!k,q=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:!!(g===iB&&y===aB&&b===sB&&d&&v&&x&&Wv(d,document.baseURI)&&Wv(v,document.baseURI)&&Wv(x,document.baseURI)),W=null;N_e(h);const X={canvasFactory:new O({ownerDocument:M,enableHWA:N}),filterFactory:new $({docId:r,ownerDocument:M}),cMapReaderFactory:q?null:new g({baseUrl:d,isCompressed:p}),standardFontDataFactory:q?null:new y({baseUrl:v}),wasmFactory:q?null:new b({baseUrl:x})};u||(u=bx.create({verbosity:h,port:Iy.workerPort}),e._worker=u);const K={docId:r,apiVersion:"5.4.530",data:i,password:o,disableAutoFetch:L,rangeChunkSize:c,length:j,docBaseUrl:f,enableXfa:E,evaluatorOptions:{maxImageSize:_,disableFontFace:k,ignoreErrors:w,isEvalSupported:S,isOffscreenCanvasSupported:C,isImageDecoderSupported:T,canvasMaxAreaInBytes:A,fontExtraProperties:I,useSystemFonts:B,useWasm:U,useWorkerFetch:q,cMapUrl:d,iccUrl:m,standardFontDataUrl:v,wasmUrl:x}},G={ownerDocument:M,pdfBug:P,styleElement:W,loadingParams:{disableAutoFetch:L,enableXfa:E}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const H=u.messageHandler.sendWithPromise("GetDocRequest",K,i?[i.buffer]:null);let Y;if(l)Y=new BSe(l,{disableRange:R,disableStream:D});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");const J=Wv(n)?VSe:Ra?ZSe:WSe;Y=new J({url:n,length:j,httpHeaders:a,withCredentials:s,rangeChunkSize:c,disableRange:R,disableStream:D})}return H.then(J=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const ie=new qv(r,J,u.port),me=new i9e(ie,e,Y,G,X,N);e._transport=me,ie.send("Ready",null)})}).catch(e._capability.reject),e}class _D{static#e=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${_D.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class RY{#e=Promise.withResolvers();#t=[];#n=[];#r=[];#i=[];constructor(e,r,n=!1,i=null){this.length=e,this.initialData=r,this.progressiveDone=n,this.contentDispositionFilename=i}addRangeListener(e){this.#i.push(e)}addProgressListener(e){this.#r.push(e)}addProgressiveReadListener(e){this.#n.push(e)}addProgressiveDoneListener(e){this.#t.push(e)}onDataRange(e,r){for(const n of this.#i)n(e,r)}onDataProgress(e,r){this.#e.promise.then(()=>{for(const n of this.#r)n(e,r)})}onDataProgressiveRead(e){this.#e.promise.then(()=>{for(const r of this.#n)r(e)})}onDataProgressiveDone(){this.#e.promise.then(()=>{for(const e of this.#t)e()})}transportReady(){this.#e.resolve()}requestDataRange(e,r){rn("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class r9e{constructor(e,r){this._pdfInfo=e,this._transport=r}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Qt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(e,r){return this._transport.getAnnotationsByType(e,r)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(r)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}extractPages(e){return this._transport.extractPages(e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class n9e{#e=!1;constructor(e,r,n,i=!1){this._pageIndex=e,this._pageInfo=r,this._transport=n,this._stats=i?new ZO:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new LY,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:r=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:a=!1}={}){return new Cb({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:r,offsetX:n,offsetY:i,dontFlip:a})}getAnnotations({intent:e="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,r)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Qt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:r=e.canvas,viewport:n,intent:i="display",annotationMode:a=Ah.ENABLE,transform:s=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:h=null,isEditing:f=!1,recordOperations:d=!1,operationsFilter:p=null}){this._stats?.time("Overall");const g=this._transport.getRenderingIntent(i,a,h,f),{renderingIntent:m,cacheKey:v}=g;this.#e=!1,l||=this._transport.getOptionalContentConfig(m);let y=this._intentStates.get(v);y||(y=Object.create(null),this._intentStates.set(v,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const x=!!(m&Rs.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(g));const b=!!(this._pdfBug&&globalThis.StepperManager?.enabled),w=!this.recordedBBoxes&&(d||b),_=T=>{if(y.renderTasks.delete(S),w){const A=S.gfx?.dependencyTracker.take();A&&(S.stepper&&S.stepper.setOperatorBBoxes(A,S.gfx.dependencyTracker.takeDebugMetadata()),d&&(this.recordedBBoxes=A))}x&&(this.#e=!0),this.#t(),T?(S.capability.reject(T),this._abortOperatorList({intentState:y,reason:T instanceof Error?T:new Error(T)})):S.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new bg({callback:_,params:{canvas:r,canvasContext:e,dependencyTracker:w?new wSe(r,y.operatorList.length,b):null,viewport:n,transform:s,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!x,pdfBug:this._pdfBug,pageColors:u,enableHWA:this._transport.enableHWA,operationsFilter:p});(y.renderTasks||=new Set).add(S);const C=S.task;return Promise.all([y.displayReadyCapability.promise,l]).then(([T,A])=>{if(this.destroyed){_();return}if(this._stats?.time("Rendering"),!(A.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:T,optionalContentConfig:A}),S.operatorListChanged()}).catch(_),C}getOperatorList({intent:e="display",annotationMode:r=Ah.ENABLE,printAnnotationStorage:n=null,isEditing:i=!1}={}){function a(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const s=this._transport.getRenderingIntent(e,r,n,i,!0);let o=this._intentStates.get(s.cacheKey);o||(o=Object.create(null),this._intentStates.set(s.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=a,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:r===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>xx.textContent(n));const r=this.streamTextContent(e);return new Promise(function(n,i){function a(){s.read().then(function({value:l,done:c}){if(c){n(o);return}o.lang??=l.lang,Object.assign(o.styles,l.styles),o.items.push(...l.items),a()},i)}const s=r.getReader(),o={items:[],styles:Object.create(null),lang:null};a()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const r of this._intentStates.values())if(this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),!r.opListReadCapability)for(const n of r.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;const r=this.#t();return e&&r&&(this._stats&&=new ZO),r}#t(){if(!this.#e||this.destroyed)return!1;for(const{renderTasks:e,operatorList:r}of this._intentStates.values())if(e.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,r){const n=this._intentStates.get(r);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,r){for(let n=0,i=e.length;n<i;n++)r.operatorList.fnArray.push(e.fnArray[n]),r.operatorList.argsArray.push(e.argsArray[n]);r.operatorList.lastChunk=e.lastChunk,r.operatorList.separateAnnots=e.separateAnnots;for(const n of r.renderTasks)n.operatorListChanged();e.lastChunk&&this.#t()}_pumpOperatorList({renderingIntent:e,cacheKey:r,annotationStorageSerializable:n,modifiedIds:i}){const{map:a,transfer:s}=n,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:r,annotationStorage:a,modifiedIds:i},s).getReader(),c=this._intentStates.get(r);c.streamReader=l;const u=()=>{l.read().then(({value:h,done:f})=>{if(f){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,c),u())},h=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const f of c.renderTasks)f.operatorListChanged();this.#t()}if(c.displayReadyCapability)c.displayReadyCapability.reject(h);else if(c.opListReadCapability)c.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:e,reason:r,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(r instanceof pD){let i=t9e;r.extraDelay>0&&r.extraDelay<1e3&&(i+=r.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:r,force:!0})},i);return}}if(e.streamReader.cancel(new rf(r.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,a]of this._intentStates)if(a===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}var Th,Zo,du,jd,z3,Hd,Gd,Ya,E_,NY,OY,Xv,qg,I_;const gn=class gn{constructor({name:e=null,port:r=null,verbosity:n=O_e()}={}){Tl(this,Ya);Tl(this,Th,Promise.withResolvers());Tl(this,Zo,null);Tl(this,du,null);Tl(this,jd,null);if(this.name=e,this.destroyed=!1,this.verbosity=n,r){if(dn(gn,Gd).has(r))throw new Error("Cannot use more than one PDFWorker per port.");dn(gn,Gd).set(r,this),kl(this,Ya,NY).call(this,r)}else kl(this,Ya,OY).call(this)}get promise(){return dn(this,Th).promise}get port(){return dn(this,du)}get messageHandler(){return dn(this,Zo)}destroy(){this.destroyed=!0,dn(this,jd)?.terminate(),cs(this,jd,null),dn(gn,Gd).delete(dn(this,du)),cs(this,du,null),dn(this,Zo)?.destroy(),cs(this,Zo,null)}static create(e){const r=dn(this,Gd).get(e?.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new gn(e)}static get workerSrc(){if(Iy.workerSrc)return Iy.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Qt(this,"_setupFakeWorkerGlobal",(async()=>dn(this,qg,I_)?dn(this,qg,I_):(await import(this.workerSrc)).WorkerMessageHandler)())}};Th=new WeakMap,Zo=new WeakMap,du=new WeakMap,jd=new WeakMap,z3=new WeakMap,Hd=new WeakMap,Gd=new WeakMap,Ya=new WeakSet,E_=function(){dn(this,Th).resolve(),dn(this,Zo).send("configure",{verbosity:this.verbosity})},NY=function(e){cs(this,du,e),cs(this,Zo,new qv("main","worker",e)),dn(this,Zo).on("ready",()=>{}),kl(this,Ya,E_).call(this)},OY=function(){if(dn(gn,Hd)||dn(gn,qg,I_)){kl(this,Ya,Xv).call(this);return}let{workerSrc:e}=gn;try{gn._isSameOrigin(window.location,e)||(e=gn._createCDNWrapper(new URL(e,window.location).href));const r=new Worker(e,{type:"module"}),n=new qv("main","worker",r),i=()=>{a.abort(),n.destroy(),r.terminate(),this.destroyed?dn(this,Th).reject(new Error("Worker was destroyed")):kl(this,Ya,Xv).call(this)},a=new AbortController;r.addEventListener("error",()=>{dn(this,jd)||i()},{signal:a.signal}),n.on("test",o=>{if(a.abort(),this.destroyed||!o){i();return}cs(this,Zo,n),cs(this,du,r),cs(this,jd,r),kl(this,Ya,E_).call(this)}),n.on("ready",o=>{if(a.abort(),this.destroyed){i();return}try{s()}catch{kl(this,Ya,Xv).call(this)}});const s=()=>{const o=new Uint8Array;n.send("test",o,[o.buffer])};s();return}catch{hC("The worker has been disabled.")}kl(this,Ya,Xv).call(this)},Xv=function(){dn(gn,Hd)||(Jt("Setting up fake worker."),cs(gn,Hd,!0)),gn._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){dn(this,Th).reject(new Error("Worker was destroyed"));return}const r=new fSe;cs(this,du,r);const n=`fake${fR(gn,z3)._++}`,i=new qv(n+"_worker",n,r);e.setup(i,r),cs(this,Zo,new qv(n,n+"_worker",r)),kl(this,Ya,E_).call(this)}).catch(e=>{dn(this,Th).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},qg=new WeakSet,I_=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},Tl(gn,qg),Tl(gn,z3,0),Tl(gn,Hd,!1),Tl(gn,Gd,new WeakMap),Ra&&(cs(gn,Hd,!0),Iy.workerSrc||="./pdf.worker.mjs"),gn._isSameOrigin=(e,r)=>{const n=URL.parse(e);if(!n?.origin||n.origin==="null")return!1;const i=new URL(r,n);return n.origin===i.origin},gn._createCDNWrapper=e=>{const r=`await import("${e}");`;return URL.createObjectURL(new Blob([r],{type:"text/javascript"}))},gn.fromPort=e=>{if(X_e("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return gn.create(e)};let bx=gn;class i9e{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#i=null;constructor(e,r,n,i,a,s){this.messageHandler=e,this.loadingTask=r,this.commonObjs=new LY,this.fontLoader=new aSe({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.wasmFactory=a.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=s,this.setupMessageHandler()}#a(e,r=null){const n=this.#e.get(e);if(n)return n;const i=this.messageHandler.sendWithPromise(e,r);return this.#e.set(e,i),i}get annotationStorage(){return Qt(this,"annotationStorage",new yD)}getRenderingIntent(e,r=Ah.ENABLE,n=null,i=!1,a=!1){let s=Rs.DISPLAY,o=GT;switch(e){case"any":s=Rs.ANY;break;case"display":break;case"print":s=Rs.PRINT;break;default:Jt(`getRenderingIntent - invalid intent: ${e}`)}const l=s&Rs.PRINT&&n instanceof bY?n:this.annotationStorage;switch(r){case Ah.DISABLE:s+=Rs.ANNOTATIONS_DISABLE;break;case Ah.ENABLE:break;case Ah.ENABLE_FORMS:s+=Rs.ANNOTATIONS_FORMS;break;case Ah.ENABLE_STORAGE:s+=Rs.ANNOTATIONS_STORAGE,o=l.serializable;break;default:Jt(`getRenderingIntent - invalid annotationMode: ${r}`)}i&&(s+=Rs.IS_EDITING),a&&(s+=Rs.OPLIST);const{ids:c,hash:u}=l.modifiedIds,h=[s,o.hash,u];return{renderingIntent:s,cacheKey:h.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#i?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of this.#t.values())e.push(n._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return e.push(r),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),Ns.cleanup(),this._networkStream?.cancelAllRequests(new rf("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:r}=this;e.on("GetReader",(n,i)=>{Sr(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},i.onPull=()=>{this._fullReader.read().then(function({value:a,done:s}){if(s){i.close();return}Sr(a instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{this._fullReader.cancel(a),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async n=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:a,contentLength:s}=this._fullReader;return(!i||!a)&&(this._lastProgress&&r.onProgress?.(this._lastProgress),this._fullReader.onProgress=o=>{r.onProgress?.({loaded:o.loaded,total:o.total})}),{isStreamingSupported:i,isRangeSupported:a,contentLength:s}}),e.on("GetRangeReader",(n,i)=>{Sr(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(n.begin,n.end);if(!a){i.close();return}i.onPull=()=>{a.read().then(function({value:s,done:o}){if(o){i.close();return}Sr(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{a.cancel(s),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,r._capability.resolve(new r9e(n,this))}),e.on("DocException",n=>{r._capability.reject(ps(n))}),e.on("PasswordRequest",n=>{this.#i=Promise.withResolvers();try{if(!r.onPassword)throw ps(n);const i=a=>{a instanceof Error?this.#i.reject(a):this.#i.resolve({password:a})};r.onPassword(i,n.code)}catch(i){this.#i.reject(i)}return this.#i.promise}),e.on("DataLoaded",n=>{r.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,i,a])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(i){case"Font":if("error"in a){const h=a.error;Jt(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}const s=new Kr(a),o=this._params.pdfBug&&globalThis.FontInspector?.enabled?(h,f)=>globalThis.FontInspector.fontAdded(h,f):null,l=new sSe(s,o,a.extra,a.charProcOperatorList);this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!l.fontExtraProperties&&l.data&&l.clearData(),this.commonObjs.resolve(n,l)});break;case"CopyLocalImage":const{imageRef:c}=a;Sr(c,"The imageRef must be defined.");for(const h of this.#t.values())for(const[,f]of h.objs)if(f?.ref===c)return f.dataLen?(this.commonObjs.resolve(n,structuredClone(f)),f.dataLen):null;break;case"FontPath":this.commonObjs.resolve(n,new oSe(a));break;case"Image":this.commonObjs.resolve(n,a);break;case"Pattern":const u=new Ai(a);this.commonObjs.resolve(n,u.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([n,i,a,s])=>{if(this.destroyed)return;const o=this.#t.get(i);if(!o.objs.has(n)){if(o._intentStates.size===0){s?.bitmap?.close();return}switch(a){case"Image":case"Pattern":o.objs.resolve(n,s);break;default:throw new Error(`Got unknown object type ${a}`)}}}),e.on("DocProgress",n=>{this.destroyed||r.onProgress?.({loaded:n.loaded,total:n.total})}),e.on("FetchBinaryData",async n=>{if(this.destroyed)throw new Error("Worker was destroyed.");const i=this[n.type];if(!i)throw new Error(`${n.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(n)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Jt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},r).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:e})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const r=e-1,n=this.#n.get(r);if(n)return n;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&this.#r.set(a.refStr,e);const s=new n9e(r,a,this,this._params.pdfBug);return this.#t.set(r,s),s});return this.#n.set(r,i),i}getPageIndex(e){return WT(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:r})}getFieldObjects(){return this.#a("GetFieldObjects")}hasJSActions(){return this.#a("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,r){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:r})}getDocJSActions(){return this.#a("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#a("GetOptionalContentConfig").then(r=>new OSe(r,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",r=this.#e.get(e);if(r)return r;const n=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new RSe(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null,hasStructTree:i[2]}));return this.#e.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const r of this.#t.values())if(!r.cleanup())throw new Error(`startCleanup: Page ${r.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),Ns.cleanup()}}cachedPageNumber(e){if(!WT(e))return null;const r=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(r)??null}}class a9e{#e=null;onContinue=null;onError=null;constructor(e){this.#e=e}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;const{annotationCanvasMap:r}=this.#e;return e.form||e.canvas&&r?.size>0}}class bg{#e=null;static#t=new WeakSet;constructor({callback:e,params:r,objs:n,commonObjs:i,annotationCanvasMap:a,operatorList:s,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:h=!1,pageColors:f=null,enableHWA:d=!1,operationsFilter:p=null}){this.callback=e,this.params=r,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=h,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new a9e(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=r.canvas,this._canvasContext=r.canvas?null:r.canvasContext,this._enableHWA=d,this._dependencyTracker=r.dependencyTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:r}){if(this.cancelled)return;if(this._canvas){if(bg.#t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");bg.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:n,transform:i,background:a,dependencyTracker:s}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Bg(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors,s),this.gfx.beginDrawing({transform:i,viewport:n,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,r=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),bg.#t.delete(this._canvas),e||=new pD(`Rendering cancelled, page ${this._pageIndex+1}`,r),this.callback(e),this.task.onError?.(e)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bg.#t.delete(this._canvas),this.callback())))}}const s9e="5.4.530",o9e="50cc4adac";class po{#e=null;#t=null;#n;#r=null;#i=!1;#a=!1;#s=null;#o;#l=null;#c=null;static#f=null;static get _keyboardManager(){return Qt(this,"_keyboardManager",new Tb([[["Escape","mac+Escape"],po.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],po.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],po.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],po.prototype._moveToPrevious],[["Home","mac+Home"],po.prototype._moveToBeginning],[["End","mac+End"],po.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:r=null}){e?(this.#a=!1,this.#s=e):this.#a=!0,this.#c=e?._uiManager||r,this.#o=this.#c._eventBus,this.#n=e?.color?.toUpperCase()||this.#c?.highlightColors.values().next().value||"#FFFF98",po.#f||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#e=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#s&&(e.ariaControls=`${this.#s.id}_colorpicker_dropdown`);const r=this.#c._signal;e.addEventListener("click",this.#g.bind(this),{signal:r}),e.addEventListener("keydown",this.#m.bind(this),{signal:r});const n=this.#t=document.createElement("span");return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=this.#n,e.append(n),e}renderMainDropdown(){const e=this.#r=this.#h();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#h(){const e=document.createElement("div"),r=this.#c._signal;e.addEventListener("contextmenu",Bo,{signal:r}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#s&&(e.id=`${this.#s.id}_colorpicker_dropdown`);for(const[n,i]of this.#c.highlightColors){const a=document.createElement("button");a.tabIndex="0",a.role="option",a.setAttribute("data-color",i),a.title=n,a.setAttribute("data-l10n-id",po.#f[n]);const s=document.createElement("span");a.append(s),s.className="swatch",s.style.backgroundColor=i,a.ariaSelected=i===this.#n,a.addEventListener("click",this.#d.bind(this,i),{signal:r}),e.append(a)}return e.addEventListener("keydown",this.#m.bind(this),{signal:r}),e}#d(e,r){r.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:_r.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#g(e);return}const r=e.target.getAttribute("data-color");r&&this.#d(r,e)}_moveToNext(e){if(!this.#p){this.#g(e);return}if(e.target===this.#e){this.#r.firstElementChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#r?.firstElementChild||e.target===this.#e){this.#p&&this._hideDropdownFromKeyboard();return}this.#p||this.#g(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#p){this.#g(e);return}this.#r.firstElementChild?.focus()}_moveToEnd(e){if(!this.#p){this.#g(e);return}this.#r.lastElementChild?.focus()}#m(e){po._keyboardManager.exec(this,e)}#g(e){if(this.#p){this.hideDropdown();return}if(this.#i=e.detail===0,this.#l||(this.#l=new AbortController,window.addEventListener("pointerdown",this.#u.bind(this),{signal:this.#c.combinedSignal(this.#l)})),this.#e.ariaExpanded="true",this.#r){this.#r.classList.remove("hidden");return}const r=this.#r=this.#h();this.#e.append(r)}#u(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add("hidden"),this.#e.ariaExpanded="false",this.#l?.abort(),this.#l=null}get#p(){return this.#r&&!this.#r.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#a){if(!this.#p){this.#s?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#i})}}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;const r=this.#c.highlightColors.values();for(const n of this.#r.children)n.ariaSelected=r.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}}class _x{#e=null;#t=null;#n=null;static#r=null;constructor(e){this.#t=e,this.#n=e._uiManager,_x.#r||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#e)return this.#e;const{editorType:e,colorType:r,color:n}=this.#t,i=this.#e=document.createElement("input");return i.type="color",i.value=n||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",_x.#r[e]),i.addEventListener("input",()=>{this.#n.updateParams(r,i.value)},{signal:this.#n._signal}),i}update(e){this.#e&&(this.#e.value=e)}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}}function xB(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function q1(t){return Math.max(0,Math.min(255,255*t))}class bB{static CMYK_G([e,r,n,i]){return["G",1-Math.min(1,.3*e+.59*n+.11*r+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=q1(e),[e,e,e]}static G_HTML([e]){const r=xB(e);return`#${r}${r}${r}`}static RGB_G([e,r,n]){return["G",.3*e+.59*r+.11*n]}static RGB_rgb(e){return e.map(q1)}static RGB_HTML(e){return`#${e.map(xB).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,r,n,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,n+i),1-Math.min(1,r+i)]}static CMYK_rgb([e,r,n,i]){return[q1(1-Math.min(1,e+i)),q1(1-Math.min(1,n+i)),q1(1-Math.min(1,r+i))]}static CMYK_HTML(e){const r=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(r)}static RGB_CMYK([e,r,n]){const i=1-e,a=1-r,s=1-n,o=Math.min(i,a,s);return["CMYK",i,a,s,o]}}class l9e{create(e,r,n=!1){if(e<=0||r<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${r}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${r}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){rn("Abstract method `_createSVG` called.")}}class WS extends l9e{_createSVG(e){return document.createElementNS(ru,e)}}const c9e=9,v0=new WeakSet,u9e=new Date().getTimezoneOffset()*60*1e3;class W8{static create(e){switch(e.data.annotationType){case Jn.LINK:return new SD(e);case Jn.TEXT:return new f9e(e);case Jn.WIDGET:switch(e.data.fieldType){case"Tx":return new d9e(e);case"Btn":return e.data.radioButton?new BY(e):e.data.checkBox?new g9e(e):new m9e(e);case"Ch":return new v9e(e);case"Sig":return new p9e(e)}return new U0(e);case Jn.POPUP:return new YT(e);case Jn.FREETEXT:return new FY(e);case Jn.LINE:return new x9e(e);case Jn.SQUARE:return new b9e(e);case Jn.CIRCLE:return new w9e(e);case Jn.POLYLINE:return new $Y(e);case Jn.CARET:return new S9e(e);case Jn.INK:return new CD(e);case Jn.POLYGON:return new _9e(e);case Jn.HIGHLIGHT:return new zY(e);case Jn.UNDERLINE:return new C9e(e);case Jn.SQUIGGLY:return new A9e(e);case Jn.STRIKEOUT:return new T9e(e);case Jn.STAMP:return new VY(e);case Jn.FILEATTACHMENT:return new k9e(e);default:return new Sn(e)}}}class Sn{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:r=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=r,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,r&&(this.contentElement=this.container=this._createContainer(n)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:r}){return!!(e?.str||r?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Sn._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:e}=this,r=this.annotationStorage?.getEditor(e.id);return r?r.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:r,inkLists:n,rect:i}=this.data;let a=-1/0,s=-1/0;if(r?.length>=8){for(let o=0;o<r.length;o+=8)r[o+1]>s?(s=r[o+1],a=r[o+2]):r[o+1]===s&&(a=Math.max(a,r[o+2]));return[a,s]}if(n?.length>=1){for(const o of n)for(let l=0,c=o.length;l<c;l+=2)o[l+1]>s?(s=o[l+1],a=o[l]):o[l+1]===s&&(a=Math.max(a,o[l]));if(a!==1/0)return[a,s]}return i?[i[2],i[3]]:null}_normalizePoint(e){const{page:{view:r},viewport:{rawDims:{pageWidth:n,pageHeight:i,pageX:a,pageY:s}}}=this.parent;return e[1]=r[3]-e[1]+r[1],e[0]=100*(e[0]-a)/n,e[1]=100*(e[1]-s)/i,e}get commentText(){const{data:e}=this;return this.annotationStorage.getRawValue(`${vx}${e.id}`)?.popup?.contents||e.contentsObj?.str||""}set commentText(e){const{data:r}=this,n={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(r.id,{popup:n})||this.annotationStorage.setValue(`${vx}${r.id}`,{id:r.id,annotationType:r.annotationType,pageIndex:this.parent.page._pageIndex,popup:n,popupRef:r.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});const{rect:r,popup:n}=e;r&&this.#r(r);let i=this.#n?.popup||this.popup;!i&&n?.text&&(this._createPopup(n),i=this.#n.popup),i&&(i.updateEdited(e),n?.deleted&&(i.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#e&&(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),this.#e=null)}#r(e){const{container:{style:r},data:{rect:n,rotation:i},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:s,pageX:o,pageY:l}}}}=this;n?.splice(0,4,...e),r.left=`${100*(e[0]-o)/a}%`,r.top=`${100*(s-e[3]+l)/s}%`,i===0?(r.width=`${100*(e[2]-e[0])/a}%`,r.height=`${100*(e[3]-e[1])/s}%`):this.setRotation(i)}_createContainer(e){const{data:r,parent:{page:n,viewport:i}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",r.id),!(this instanceof U0)&&!(this instanceof SD)&&(a.tabIndex=0);const{style:s}=a;if(s.zIndex=this.parent.zIndex,this.parent.zIndex+=2,r.alternativeText&&(a.title=r.alternativeText),r.noRotate&&a.classList.add("norotate"),!r.rect||this instanceof YT){const{rotation:g}=r;return!r.hasOwnCanvas&&g!==0&&this.setRotation(g,a),a}const{width:o,height:l}=this;if(!e&&r.borderStyle.width>0){s.borderWidth=`${r.borderStyle.width}px`;const g=r.borderStyle.horizontalCornerRadius,m=r.borderStyle.verticalCornerRadius;if(g>0||m>0){const y=`calc(${g}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`;s.borderRadius=y}else if(this instanceof BY){const y=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;s.borderRadius=y}switch(r.borderStyle.style){case rg.SOLID:s.borderStyle="solid";break;case rg.DASHED:s.borderStyle="dashed";break;case rg.BEVELED:Jt("Unimplemented border style: beveled");break;case rg.INSET:Jt("Unimplemented border style: inset");break;case rg.UNDERLINE:s.borderBottomStyle="solid";break}const v=r.borderColor||null;v?(this.#t=!0,s.borderColor=ot.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):s.borderWidth=0}const c=ot.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]),{pageWidth:u,pageHeight:h,pageX:f,pageY:d}=i.rawDims;s.left=`${100*(c[0]-f)/u}%`,s.top=`${100*(c[1]-d)/h}%`;const{rotation:p}=r;return r.hasOwnCanvas||p===0?(s.width=`${100*o/u}%`,s.height=`${100*l/h}%`):this.setRotation(p,a),a}setRotation(e,r=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims;let{width:a,height:s}=this;e%180!==0&&([a,s]=[s,a]),r.style.width=`${100*a/n}%`,r.style.height=`${100*s/i}%`,r.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(r,n,i)=>{const a=i.detail[r],s=a[0],o=a.slice(1);i.target.style[n]=bB[`${s}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[n]:bB[`${s}_rgb`](o)})};return Qt(this,"_commonActions",{display:r=>{const{display:n}=r.detail,i=n%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:n===1||n===2})},print:r=>{this.annotationStorage.setValue(this.data.id,{noPrint:!r.detail.print})},hidden:r=>{const{hidden:n}=r.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:r=>{setTimeout(()=>r.target.focus({preventScroll:!1}),0)},userName:r=>{r.target.title=r.detail.userName},readonly:r=>{r.target.disabled=r.detail.readonly},required:r=>{this._setRequired(r.target,r.detail.required)},bgColor:r=>{e("bgColor","backgroundColor",r)},fillColor:r=>{e("fillColor","backgroundColor",r)},fgColor:r=>{e("fgColor","color",r)},textColor:r=>{e("textColor","color",r)},borderColor:r=>{e("borderColor","borderColor",r)},strokeColor:r=>{e("strokeColor","borderColor",r)},rotation:r=>{const n=r.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(e,r){const n=this._commonActions;for(const i of Object.keys(r.detail))(e[i]||n[i])?.(r)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const r=this.annotationStorage.getRawValue(this.data.id);if(!r)return;const n=this._commonActions;for(const[i,a]of Object.entries(r)){const s=n[i];if(s){const o={detail:{[i]:a},target:e};s(o),delete r[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[r,n,i,a]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){const[g,m,v,y]=e.subarray(2,6);if(i===g&&a===m&&r===v&&n===y)return}const{style:s}=this.container;let o;if(this.#t){const{borderColor:g,borderWidth:m}=s;s.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${g}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const l=i-r,c=a-n,{svgFactory:u}=this,h=u.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const f=u.createElement("defs");h.append(f);const d=u.createElement("clipPath"),p=`clippath_${this.data.id}`;d.setAttribute("id",p),d.setAttribute("clipPathUnits","objectBoundingBox"),f.append(d);for(let g=2,m=e.length;g<m;g+=8){const v=e[g],y=e[g+1],x=e[g+2],b=e[g+3],w=u.createElement("rect"),_=(x-r)/l,S=(a-y)/c,C=(v-x)/l,T=(y-b)/c;w.setAttribute("x",_),w.setAttribute("y",S),w.setAttribute("width",C),w.setAttribute("height",T),d.append(w),o?.push(`<rect vector-effect="non-scaling-stroke" x="${_}" y="${S}" width="${C}" height="${T}"/>`)}this.#t&&(o.push("</g></svg>')"),s.backgroundImage=o.join("")),this.container.append(h),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){const{data:r}=this;let n,i;e?(n={str:e.text},i=e.date):(n=r.contentsObj,i=r.modificationDate),this.#n=new YT({data:{color:r.color,titleObj:r.titleObj,modificationDate:i,contentsObj:n,richText:r.richText,parentRect:r.rect,borderStyle:0,id:`popup_${r.id}`,rotation:r.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){rn("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,r=null){const n=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:a,id:s,exportValues:o}of i){if(a===-1||s===r)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!v0.has(c)){Jt(`_getElementsByName - element not allowed: ${s}`);continue}n.push({id:s,exportValue:l,domElement:c})}return n}for(const i of document.getElementsByName(e)){const{exportValue:a}=i,s=i.getAttribute("data-element-id");s!==r&&v0.has(i)&&n.push({id:s,exportValue:a,domElement:i})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const r of e)r.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:r}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:r,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class h9e extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}}class SD extends Sn{constructor(e,r=null){super(e,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let i=!1;return e.url?(r.addLinkAttributes(n,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),i=!0):e.attachment?(this.#t(n,e.attachment,e.overlaidText,e.attachmentDest),i=!0):e.setOCGState?(this.#n(n,e.setOCGState,e.overlaidText),i=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),i=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(n,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&(this.contentElement=n,this.container.append(n)),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,r,n=""){e.href=this.linkService.getDestinationHash(r),e.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&this.#e(),n&&(e.title=n)}_bindNamedAction(e,r,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(r),!1),n&&(e.title=n),this.#e()}#t(e,r,n="",i=null){e.href=this.linkService.getAnchorUrl(""),r.description?e.title=r.description:n&&(e.title=n),e.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,i),!1),this.#e()}#n(e,r,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(r),!1),n&&(e.title=n),this.#e()}_bindJSAction(e,r){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(r.actions)){const a=n.get(i);a&&(e[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:i}}),!1))}r.overlaidText&&(e.title=r.overlaidText),e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,r){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Jt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1);return}e.onclick=()=>{n?.();const{fields:i,refs:a,include:s}=r,o=[];if(i.length!==0||a.length!==0){const u=new Set(a);for(const h of i){const f=this._fieldObjects[h]||[];for(const{id:d}of f)u.add(d)}for(const h of Object.values(this._fieldObjects))for(const f of h)u.has(f.id)===s&&o.push(f)}else for(const u of Object.values(this._fieldObjects))o.push(...u);const l=this.annotationStorage,c=[];for(const u of o){const{id:h}=u;switch(c.push(h),u.type){case"text":{const d=u.defaultValue||"";l.setValue(h,{value:d});break}case"checkbox":case"radiobutton":{const d=u.defaultValue===u.exportValues;l.setValue(h,{value:d});break}case"combobox":case"listbox":{const d=u.defaultValue||"";l.setValue(h,{value:d});break}default:continue}const f=document.querySelector(`[data-element-id="${h}"]`);if(f){if(!v0.has(f)){Jt(`_bindResetFormAction - element not allowed: ${h}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}}class f9e extends Sn{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}}class U0 extends Sn{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return yi.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,r,n,i,a){n.includes("mouse")?e.addEventListener(n,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(n,s=>{if(n==="blur"){if(!r.focused||!s.relatedTarget)return;r.focused=!1}else if(n==="focus"){if(r.focused)return;r.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(s)}})})}_setEventListeners(e,r,n,i){for(const[a,s]of n)(s==="Action"||this.data.actions?.[s])&&((s==="Focus"||s==="Blur")&&(r||={focused:!1}),this._setEventListener(e,r,a,s,i),s==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,r,"blur","Blur",null):s==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,r,"focus","Focus",null))}_setBackgroundColor(e){const r=this.data.backgroundColor||null;e.style.backgroundColor=r===null?"transparent":ot.makeHexColor(r[0],r[1],r[2])}_setTextStyle(e){const r=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||c9e,a=e.style;let s;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),u=Math.round(c/(F8*i))||1,h=c/u;s=Math.min(i,l(h/F8))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);s=Math.min(i,l(c/F8))}a.fontSize=`calc(${s}px * var(--total-scale-factor))`,a.color=ot.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(a.textAlign=r[this.data.textAlignment])}_setRequired(e,r){r?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",r)}}class d9e extends U0{constructor(e){const r=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:r})}setPropertyOnSiblings(e,r,n,i){const a=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[r]=n),a.setValue(s.id,{[i]:n})}render(){const e=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const i=e.getValue(r,{value:this.data.fieldValue});let a=i.value||"";const s=e.getValue(r,{charLimit:this.data.maxLen}).charLimit;s&&a.length>s&&(a=a.slice(0,s));let o=i.formattedValue||this.data.textContent?.join(`
67
+ `);return e.join("")}}function Wv(t,e){const r=e?URL.parse(t,e):URL.parse(t);return r?.protocol==="http:"||r?.protocol==="https:"}function Bo(t){t.preventDefault()}function Tn(t){t.preventDefault(),t.stopPropagation()}function X_e(t){console.log("Deprecated API usage: "+t)}class UT{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=this.#e.exec(e);if(!r)return null;const n=parseInt(r[1],10);let i=parseInt(r[2],10);i=i>=1&&i<=12?i-1:0;let a=parseInt(r[3],10);a=a>=1&&a<=31?a:1;let s=parseInt(r[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(r[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(r[6],10);l=l>=0&&l<=59?l:0;const c=r[7]||"Z";let u=parseInt(r[8],10);u=u>=0&&u<=23?u:0;let h=parseInt(r[9],10)||0;return h=h>=0&&h<=59?h:0,c==="-"?(s+=u,o+=h):c==="+"&&(s-=u,o-=h),new Date(Date.UTC(n,i,a,s,o,l))}}function Y_e(t,{scale:e=1,rotation:r=0}){const{width:n,height:i}=t.attributes.style,a=[0,0,parseInt(n),parseInt(i)];return new Cb({viewBox:a,userUnit:1,scale:e,rotation:r})}function Ab(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Jt(`Not a valid color format: "${t}"`),[0,0,0])}function K_e(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const r of t.keys()){e.style.color=r;const n=window.getComputedStyle(e).color;t.set(r,Ab(n))}e.remove()}function _n(t){const{a:e,b:r,c:n,d:i,e:a,f:s}=t.getTransform();return[e,r,n,i,a,s]}function Pl(t){const{a:e,b:r,c:n,d:i,e:a,f:s}=t.getTransform().invertSelf();return[e,r,n,i,a,s]}function m0(t,e,r=!1,n=!0){if(e instanceof Cb){const{pageWidth:i,pageHeight:a}=e.rawDims,{style:s}=t,o=yi.isCSSRoundSupported,l=`var(--total-scale-factor) * ${i}px`,c=`var(--total-scale-factor) * ${a}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,h=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!r||e.rotation%180===0?(s.width=u,s.height=h):(s.width=h,s.height=u)}n&&t.setAttribute("data-main-rotation",e.rotation)}class Ac{constructor(){const{pixelRatio:e}=Ac;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,r,n,i,a=-1){let s=1/0,o=1/0,l=1/0;n=Ac.capPixels(n,a),n>0&&(s=Math.sqrt(n/(e*r))),i!==-1&&(o=i/e,l=i/r);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,r){if(r>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+r/100));return e>0?Math.min(e,n):n}return e}}const jT=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Z_e{static get isDarkMode(){return Qt(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class J_e{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:r}=e;r.width=r.height="0",r.display="none",r.color="var(--comment-fg-color)",document.body.append(e);const{color:n}=window.getComputedStyle(e);return e.remove(),Qt(this,"commentForegroundColor",Ab(n))}}function Q_e(t,e,r,n){n=Math.min(Math.max(n??1,0),1);const i=255*(1-n);return t=Math.round(t*n+i),e=Math.round(e*n+i),r=Math.round(r*n+i),[t,e,r]}function JO(t,e){const r=t[0]/255,n=t[1]/255,i=t[2]/255,a=Math.max(r,n,i),s=Math.min(r,n,i),o=(a+s)/2;if(a===s)e[0]=e[1]=0;else{const l=a-s;switch(e[1]=o<.5?l/(a+s):l/(2-a-s),a){case r:e[0]=((n-i)/l+(n<i?6:0))*60;break;case n:e[0]=((i-r)/l+2)*60;break;case i:e[0]=((r-n)/l+4)*60;break}}e[2]=o}function HT(t,e){const r=t[0],n=t[1],i=t[2],a=(1-Math.abs(2*i-1))*n,s=a*(1-Math.abs(r/60%2-1)),o=i-a/2;switch(Math.floor(r/60)){case 0:e[0]=a+o,e[1]=s+o,e[2]=o;break;case 1:e[0]=s+o,e[1]=a+o,e[2]=o;break;case 2:e[0]=o,e[1]=a+o,e[2]=s+o;break;case 3:e[0]=o,e[1]=s+o,e[2]=a+o;break;case 4:e[0]=s+o,e[1]=o,e[2]=a+o;break;case 5:case 6:e[0]=a+o,e[1]=o,e[2]=s+o;break}}function QO(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function eB(t,e,r){HT(t,r),r.map(QO);const n=.2126*r[0]+.7152*r[1]+.0722*r[2];HT(e,r),r.map(QO);const i=.2126*r[0]+.7152*r[1]+.0722*r[2];return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)}const tB=new Map;function eSe(t,e){const r=t[0]+t[1]*256+t[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let n=tB.get(r);if(n)return n;const i=new Float32Array(9),a=i.subarray(0,3),s=i.subarray(3,6);JO(t,s);const o=i.subarray(6,9);JO(e,o);const l=o[2]<.5,c=l?12:4.5;if(s[2]=l?Math.sqrt(s[2]):1-Math.sqrt(1-s[2]),eB(s,o,a)<c){let u,h;l?(u=s[2],h=1):(u=0,h=s[2]);const f=.005;for(;h-u>f;){const d=s[2]=(u+h)/2;l===eB(s,o,a)<c?u=d:h=d}s[2]=l?h:u}return HT(s,a),n=ot.makeHexColor(Math.round(a[0]*255),Math.round(a[1]*255),Math.round(a[2]*255)),tB.set(r,n),n}function mY({html:t,dir:e,className:r},n){const i=document.createDocumentFragment();if(typeof t=="string"){const a=document.createElement("p");a.dir=e||"auto";const s=t.split(/(?:\r\n?|\n)/);for(let o=0,l=s.length;o<l;++o){const c=s[o];a.append(document.createTextNode(c)),o<l-1&&a.append(document.createElement("br"))}i.append(a)}else gY.render({xfaHtml:t,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",r),n.append(i)}function vY(t){const e=new Path2D;if(!t)return e;for(let r=0,n=t.length;r<n;)switch(t[r++]){case H1.moveTo:e.moveTo(t[r++],t[r++]);break;case H1.lineTo:e.lineTo(t[r++],t[r++]);break;case H1.curveTo:e.bezierCurveTo(t[r++],t[r++],t[r++],t[r++],t[r++],t[r++]);break;case H1.quadraticCurveTo:e.quadraticCurveTo(t[r++],t[r++],t[r++],t[r++]);break;case H1.closePath:e.closePath();break;default:Jt(`Unrecognized drawing path operator: ${t[r-1]}`);break}return e}class Ey{#e=null;#t=null;#n;#r=null;#i=null;#a=null;#s=null;#o=null;static#l=null;constructor(e){this.#n=e,Ey.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const r=this.#n._uiManager._signal;r instanceof AbortSignal&&!r.aborted&&(e.addEventListener("contextmenu",Bo,{signal:r}),e.addEventListener("pointerdown",Ey.#c,{signal:r}));const n=this.#r=document.createElement("div");n.className="buttons",e.append(n);const i=this.#n.toolbarPosition;if(i){const{style:a}=e,s=this.#n._uiManager.direction==="ltr"?1-i[0]:i[0];a.insetInlineEnd=`${100*s}%`,a.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#c(e){e.stopPropagation()}#f(e){this.#n._focusEventsAllowed=!1,Tn(e)}#h(e){this.#n._focusEventsAllowed=!0,Tn(e)}#d(e){const r=this.#n._uiManager._signal;return!(r instanceof AbortSignal)||r.aborted?!1:(e.addEventListener("focusin",this.#f.bind(this),{capture:!0,signal:r}),e.addEventListener("focusout",this.#h.bind(this),{capture:!0,signal:r}),e.addEventListener("contextmenu",Bo,{signal:r}),!0)}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:r}=this.#n,n=document.createElement("button");n.classList.add("basic","deleteButton"),n.tabIndex=0,n.setAttribute("data-l10n-id",Ey.#l[e]),this.#d(n)&&n.addEventListener("click",i=>{r.delete()},{signal:r._signal}),this.#r.append(n)}get#m(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const r=await e.render();this.#d(r),this.#r.append(r,this.#m),this.#i=e}addComment(e,r=null){if(this.#a)return;const n=e.renderForToolbar();if(!n)return;this.#d(n);const i=this.#s=this.#m;r?(this.#r.insertBefore(n,r),this.#r.insertBefore(i,r)):this.#r.append(n,i),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;const r=e.renderButton();this.#d(r),this.#r.append(r,this.#m)}async addEditSignatureButton(e){const r=this.#o=await e.renderEditButton(this.#n);this.#d(r),this.#r.append(r,this.#m)}removeButton(e){e==="comment"&&(this.#a?.removeToolbarCommentButton(),this.#a=null,this.#s?.remove(),this.#s=null)}async addButton(e,r){switch(e){case"colorPicker":r&&this.addColorPicker(r);break;case"altText":r&&await this.addAltText(r);break;case"editSignature":r&&await this.addEditSignatureButton(r);break;case"delete":this.addDeleteButton();break;case"comment":r&&this.addComment(r);break}}async addButtonBefore(e,r,n){if(!r&&e==="comment")return;const i=this.#r.querySelector(n);i&&e==="comment"&&this.addComment(r,i)}updateEditSignatureButton(e){this.#o&&(this.#o.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class tSe{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){const e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar");const r=this.#n._signal;r instanceof AbortSignal&&!r.aborted&&e.addEventListener("contextmenu",Bo,{signal:r});const n=this.#e=document.createElement("div");return n.className="buttons",e.append(n),this.#n.hasCommentManager()&&this.#a("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#n.commentSelection("floating_button")}),this.#a("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#n.highlightSelection("floating_button")}),e}#i(e,r){let n=0,i=0;for(const a of e){const s=a.y+a.height;if(s<n)continue;const o=a.x+(r?a.width:0);if(s>n){i=o,n=s;continue}r?o>i&&(i=o):o<i&&(i=o)}return[r?1-i:i,n]}show(e,r,n){const[i,a]=this.#i(r,n),{style:s}=this.#t||=this.#r();e.append(this.#t),s.insetInlineEnd=`${100*i}%`,s.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(e,r,n,i){const a=document.createElement("button");a.classList.add("basic",e),a.tabIndex=0,a.setAttribute("data-l10n-id",r);const s=document.createElement("span");a.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",n);const o=this.#n._signal;o instanceof AbortSignal&&!o.aborted&&(a.addEventListener("contextmenu",Bo,{signal:o}),a.addEventListener("click",i,{signal:o})),this.#e.append(a)}}function yY(t,e,r){for(const n of r)e.addEventListener(n,t[n].bind(t))}class Nr{static#e=NaN;static#t=null;static#n=NaN;static#r=null;static initializeAndAddPointerId(e){(Nr.#t||=new Set).add(e)}static setPointer(e,r){Nr.#e||=r,Nr.#r??=e}static setTimeStamp(e){Nr.#n=e}static isSamePointerId(e){return Nr.#e===e}static isSamePointerIdOrRemove(e){return Nr.#e===e?!0:(Nr.#t?.delete(e),!1)}static isSamePointerType(e){return Nr.#r===e}static isInitializedAndDifferentPointerType(e){return Nr.#r!==null&&!Nr.isSamePointerType(e)}static isSameTimeStamp(e){return Nr.#n===e}static isUsingMultiplePointers(){return Nr.#t?.size>=1}static clearPointerType(){Nr.#r=null}static clearPointerIds(){Nr.#e=NaN,Nr.#t=null}static clearTimeStamp(){Nr.#n=NaN}}class rSe{#e=0;get id(){return`${vx}${this.#e++}`}}class mD{#e=dY();#t=0;#n=null;static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;const a=i.decode().then(()=>(n.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return Qt(this,"_isSVGFittingCanvas",a)}async#r(e,r){this.#n||=new Map;let n=this.#n.get(e);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let i;if(typeof r=="string"?(n.url=r,i=await Sb(r,"blob")):r instanceof File?i=n.file=r:r instanceof Blob&&(i=r),i.type==="image/svg+xml"){const a=mD._isSVGFittingCanvas,s=new FileReader,o=new Image,l=new Promise((c,u)=>{o.onload=()=>{n.bitmap=o,n.isSvg=!0,c()},s.onload=async()=>{const h=n.svgUrl=s.result;o.src=await a?`${h}#svgView(preserveAspectRatio(none))`:h},o.onerror=s.onerror=u});s.readAsDataURL(i),await l}else n.bitmap=await createImageBitmap(i);n.refCounter=1}catch(i){Jt(i),n=null}return this.#n.set(e,n),n&&this.#n.set(n.id,n),n}async getFromFile(e){const{lastModified:r,name:n,size:i,type:a}=e;return this.#r(`${r}_${n}_${i}_${a}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,r){const n=await r;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;const r=this.#n.get(e);if(!r)return null;if(r.bitmap)return r.refCounter+=1,r;if(r.file)return this.getFromFile(r.file);if(r.blobPromise){const{blobPromise:n}=r;return delete r.blobPromise,this.getFromBlob(r.id,n)}return this.getFromUrl(r.url)}getFromCanvas(e,r){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;const i=new OffscreenCanvas(r.width,r.height);return i.getContext("2d").drawImage(r,0,0),n={bitmap:i.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){const r=this.#n.get(e);return r?.isSvg?r.svgUrl:null}deleteId(e){this.#n||=new Map;const r=this.#n.get(e);if(!r||(r.refCounter-=1,r.refCounter!==0))return;const{bitmap:n}=r;if(!r.url&&!r.file){const i=new OffscreenCanvas(n.width,n.height);i.getContext("bitmaprenderer").transferFromImageBitmap(n),r.blobPromise=i.convertToBlob()}n.close?.(),r.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}}class nSe{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:r,post:n,mustExec:i,type:a=NaN,overwriteIfSameType:s=!1,keepUndo:o=!1}){if(i&&e(),this.#t)return;const l={cmd:e,undo:r,post:n,type:a};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(l);return}if(s&&this.#e[this.#r].type===a){o&&(l.undo=this.#e[this.#r].undo),this.#e[this.#r]=l;return}const c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(l)}undo(){if(this.#r===-1)return;this.#t=!0;const{undo:e,post:r}=this.#e[this.#r];e(),r?.(),this.#t=!1,this.#r-=1}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;const{cmd:e,post:r}=this.#e[this.#r];e(),r?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}cleanType(e){if(this.#r!==-1){for(let r=this.#r;r>=0;r--)if(this.#e[r].type!==e){this.#e.splice(r+1,this.#r-r),this.#r=r;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}}class Tb{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:r}=yi.platform;for(const[n,i,a={}]of e)for(const s of n){const o=s.startsWith("mac+");r&&o?(this.callbacks.set(s.slice(4),{callback:i,options:a}),this.allKeys.add(s.split("+").at(-1))):!r&&!o&&(this.callbacks.set(s,{callback:i,options:a}),this.allKeys.add(s.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const r=this.buffer.join("+");return this.buffer.length=0,r}exec(e,r){if(!this.allKeys.has(r.key))return;const n=this.callbacks.get(this.#e(r));if(!n)return;const{callback:i,options:{bubbles:a=!1,args:s=[],checker:o=null}}=n;o&&!o(e,r)||(i.bind(e,...s,r)(),a||Tn(r))}}class vD{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return K_e(e),Qt(this,"_colors",e)}convert(e){const r=Ab(e);if(!window.matchMedia("(forced-colors: active)").matches)return r;for(const[n,i]of this._colors)if(i.every((a,s)=>a===r[s]))return vD._colorsMapping.get(n);return r}getHexCode(e){const r=this._colors.get(e);return r?ot.makeHexColor(...r):e}}class nf{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#s=null;#o=null;#l=new nSe;#c=null;#f=null;#h=null;#d=0;#m=new Set;#g=null;#u=null;#p=new Set;_editorUndoBar=null;#v=!1;#x=!1;#y=!1;#C=null;#S=null;#b=null;#T=null;#w=!1;#A=null;#D=new rSe;#E=!1;#I=!1;#B=!1;#L=null;#R=null;#F=null;#N=null;#H=null;#k=er.NONE;#_=new Set;#P=null;#$=null;#V=null;#q=null;#W=null;#X={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#U=[0,0];#O=null;#G=null;#J=null;#Q=null;#z=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=nf.prototype,r=s=>s.#G.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),n=(s,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return Qt(this,"_keyboardManager",new Tb([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&s.#G.contains(o)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&s.#G.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:r}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:r}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:r}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:r}]]))}constructor(e,r,n,i,a,s,o,l,c,u,h,f,d,p,g,m){const v=this._signal=this.#e.signal;this.#G=e,this.#J=r,this.#Q=n,this.#a=i,this.#c=a,this.#$=s,this.#W=l,this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:v}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:v}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:v}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:v}),o._on("setpreference",this.onSetPreference.bind(this),{signal:v}),o._on("switchannotationeditorparams",y=>this.updateParams(y.type,y.value),{signal:v}),window.addEventListener("pointerdown",()=>{this.#I=!0},{capture:!0,signal:v}),window.addEventListener("pointerup",()=>{this.#I=!1},{capture:!0,signal:v}),this.#se(),this.#fe(),this.#te(),this.#s=l.annotationStorage,this.#C=l.filterFactory,this.#V=c,this.#T=u||null,this.#v=h,this.#x=f,this.#y=d,this.#H=p||null,this.viewParameters={realScale:mm.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=m!==!1,a?.setSidebarUiManager(this)}destroy(){this.#z?.resolve(),this.#z=null,this.#e?.abort(),this.#e=null,this._signal=null;for(const e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#p.clear(),this.#N?.clear(),this.#t=null,this.#_.clear(),this.#l.destroy(),this.#a?.destroy(),this.#c?.destroy(),this.#$?.destroy(),this.#A?.hide(),this.#A=null,this.#F?.destroy(),this.#F=null,this.#n=null,this.#S&&(clearTimeout(this.#S),this.#S=null),this.#O&&(clearTimeout(this.#O),this.#O=null),this._editorUndoBar?.destroy(),this.#W=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#H}get useNewAltTextFlow(){return this.#x}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return Qt(this,"hcmFilter",this.#V?this.#C.addHCMFilter(this.#V.foreground,this.#V.background):"none")}get direction(){return Qt(this,"direction",getComputedStyle(this.#G).direction)}get _highlightColors(){return Qt(this,"_highlightColors",this.#T?new Map(this.#T.split(",").map(e=>(e=e.split("=").map(r=>r.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return Qt(this,"highlightColors",null);const r=new Map,n=!!this.#V;for(const[i,a]of e){const s=i.endsWith("_HCM");if(n&&s){r.set(i.replace("_HCM",""),a);continue}!n&&!s&&r.set(i,a)}return Qt(this,"highlightColors",r)}get highlightColorNames(){return Qt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const r=this.highlightColorNames.get(e);return this._highlightColors.get(r)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#h=e}setMainHighlightColorPicker(e){this.#F=e}editAltText(e,r=!1){this.#a?.editAltText(this,e,r)}hasCommentManager(){return!!this.#c}editComment(e,r,n,i){this.#c?.showDialog(this,e,r,n,i)}selectComment(e,r){this.#i.get(e)?.getEditorByUID(r)?.toggleComment(!0,!0)}updateComment(e){this.#c?.updateComment(e.getData())}updatePopupColor(e){this.#c?.updatePopupColor(e)}removeComment(e){this.#c?.removeComments([e.uid])}toggleComment(e,r,n=void 0){this.#c?.toggleCommentPopup(e,r,n)}makeCommentColor(e,r){return e&&this.#c?.makeCommentColor(e,r)||null}getCommentDialogElement(){return this.#c?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;const{resolve:r,promise:n}=Promise.withResolvers(),i=a=>{a.pageNumber===e&&(this._eventBus._off("editorsrendered",i),r())};this._eventBus.on("editorsrendered",i),await n}getSignature(e){this.#$?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#$}switchToMode(e,r){this._eventBus.on("annotationeditormodechanged",r,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,r){this._eventBus.dispatch("setpreference",{source:this,name:e,value:r})}onSetPreference({name:e,value:r}){e==="enableNewAltTextWhenAddingImage"&&(this.#y=r)}onPageChanging({pageNumber:e}){this.#d=e-1}focusMainContainer(){this.#G.focus()}findParent(e,r){for(const n of this.#i.values()){const{x:i,y:a,width:s,height:o}=n.div.getBoundingClientRect();if(e>=i&&e<=i+s&&r>=a&&r<=a+o)return n}return null}disableUserSelect(e=!1){this.#J.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#p.add(e)}removeShouldRescale(e){this.#p.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*mm.PDF_TO_CSS_UNITS;for(const r of this.#p)r.onScaleChanging();this.#h?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Z({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#ee(e){const{currentLayer:r}=this;if(r.hasTextLayer(e))return r;for(const n of this.#i.values())if(n.hasTextLayer(e))return n;return null}highlightSelection(e="",r=!1){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:i,anchorOffset:a,focusNode:s,focusOffset:o}=n,l=n.toString(),u=this.#Z(n).closest(".textLayer"),h=this.getSelectionBoxes(u);if(!h)return;n.empty();const f=this.#ee(u),d=this.#k===er.NONE,p=()=>{const g=f?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:h,anchorNode:i,anchorOffset:a,focusNode:s,focusOffset:o,text:l});d&&this.showAllEditors("highlight",!0,!0),r&&g?.editComment()};if(d){this.switchToMode(er.HIGHLIGHT,p);return}p()}commentSelection(e=""){this.highlightSelection(e,!0)}#ie(){const e=document.getSelection();if(!e||e.isCollapsed)return;const n=this.#Z(e).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(this.#A||=new tSe(this),this.#A.show(n,i,this.direction==="ltr"))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#s)return null;const r=`${vx}${e}`,n=this.#s.getRawValue(r);return n&&this.#s.remove(r),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#s&&!this.#s.has(e.id)&&this.#s.setValue(e.id,e)}a11yAlert(e,r=null){const n=this.#Q;n&&(n.setAttribute("data-l10n-id",e),r?n.setAttribute("data-l10n-args",JSON.stringify(r)):n.removeAttribute("data-l10n-args"))}#ae(){const e=document.getSelection();if(!e||e.isCollapsed){this.#P&&(this.#A?.hide(),this.#P=null,this.#M({hasSelectedText:!1}));return}const{anchorNode:r}=e;if(r===this.#P)return;const i=this.#Z(e).closest(".textLayer");if(!i){this.#P&&(this.#A?.hide(),this.#P=null,this.#M({hasSelectedText:!1}));return}if(this.#A?.hide(),this.#P=r,this.#M({hasSelectedText:!0}),!(this.#k!==er.HIGHLIGHT&&this.#k!==er.NONE)&&(this.#k===er.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#w=this.isShiftKeyDown,!this.isShiftKeyDown)){const a=this.#k===er.HIGHLIGHT?this.#ee(i):null;if(a?.toggleDrawing(),this.#I){const s=new AbortController,o=this.combinedSignal(s),l=c=>{c.type==="pointerup"&&c.button!==0||(s.abort(),a?.toggleDrawing(!0),c.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",l,{signal:o}),window.addEventListener("blur",l,{signal:o})}else a?.toggleDrawing(!0),this.#Y("main_toolbar")}}#Y(e=""){this.#k===er.HIGHLIGHT?this.highlightSelection(e):this.#v&&this.#ie()}#se(){document.addEventListener("selectionchange",this.#ae.bind(this),{signal:this._signal})}#oe(){if(this.#b)return;this.#b=new AbortController;const e=this.combinedSignal(this.#b);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#le(){this.#b?.abort(),this.#b=null}blur(){if(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const r of this.#_)if(r.div.contains(e)){this.#R=[r,e],r._focusEventsAllowed=!1;break}}focus(){if(!this.#R)return;const[e,r]=this.#R;this.#R=null,r.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),r.focus()}#te(){if(this.#L)return;this.#L=new AbortController;const e=this.combinedSignal(this.#L);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#ce(){this.#L?.abort(),this.#L=null}#ue(){if(this.#f)return;this.#f=new AbortController;const e=this.combinedSignal(this.#f);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#he(){this.#f?.abort(),this.#f=null}#fe(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#te(),this.setEditingState(!0)}removeEditListeners(){this.#ce(),this.setEditingState(!1)}dragOver(e){for(const{type:r}of e.dataTransfer.items)for(const n of this.#u)if(n.isHandlingMimeForPasting(r)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const r of e.dataTransfer.items)for(const n of this.#u)if(n.isHandlingMimeForPasting(r.type)){n.paste(r,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const r=[];for(const n of this.#_){const i=n.serialize(!0);i&&r.push(i)}r.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:r}=e;for(const a of r.items)for(const s of this.#u)if(s.isHandlingMimeForPasting(a.type)){s.paste(a,this.currentLayer);return}let n=r.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(a){Jt(`paste: "${a.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const i=this.currentLayer;try{const a=[];for(const l of n){const c=await i.deserialize(l);if(!c)return;a.push(c)}const s=()=>{for(const l of a)this.#re(l);this.#ne(a)},o=()=>{for(const l of a)l.remove()};this.addCommands({cmd:s,undo:o,mustExec:!0})}catch(a){Jt(`paste: "${a.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#k!==er.NONE&&!this.isEditorHandlingKeyboard&&nf._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#Y("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}#M(e){Object.entries(e).some(([n,i])=>this.#X[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#X,e)}),this.#k===er.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#j([[_r.HIGHLIGHT_FREE,!0]]))}#j(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#oe(),this.#ue(),this.#M({isEditing:this.#k!==er.NONE,isEmpty:this.#K(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#le(),this.#he(),this.#M({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#u){this.#u=e;for(const r of this.#u)this.#j(r.defaultPropertiesToUpdate)}}getId(){return this.#D.id}get currentLayer(){return this.#i.get(this.#d)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#d}addLayer(e){this.#i.set(e.pageIndex,e),this.#E?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,r=null,n=!1,i=!1,a=!1,s=!1){if(this.#k!==e&&!(this.#z&&(await this.#z.promise,!this.#z))){if(this.#z=Promise.withResolvers(),this.#h?.commitOrRemove(),this.#k===er.POPUP&&this.#c?.hideSidebar(),this.#c?.destroyPopup(),this.#k=e,e===er.NONE){this.setEditingState(!1),this.#pe();for(const o of this.#r.values())o.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#z.resolve();return}for(const o of this.#r.values())o.addStandaloneCommentButton();e===er.SIGNATURE&&await this.#$?.loadSignatures(),n&&Nr.clearPointerType(),this.setEditingState(!0),await this.#de(),this.unselectAll();for(const o of this.#i.values())o.updateMode(e);if(e===er.POPUP){this.#n||=await this.#W.getAnnotationsByType(new Set(this.#u.map(c=>c._editorType)));const o=new Set,l=[];for(const c of this.#r.values()){const{annotationElementId:u,hasComment:h,deleted:f}=c;u&&o.add(u),h&&!f&&l.push(c.getData())}for(const c of this.#n){const{id:u,popupRef:h,contentsObj:f}=c;h&&f?.str&&!o.has(u)&&!this.#m.has(u)&&l.push(c)}this.#c?.showSidebar(l)}if(!r){i&&this.addNewEditorFromKeyboard(),this.#z.resolve();return}for(const o of this.#r.values())o.uid===r?(this.setSelected(o),s?o.editComment():a?o.enterInEditMode():o.focus()):o.unselect();this.#z.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#k&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,r){if(this.#u){switch(e){case _r.CREATE:this.currentLayer.addNewEditor(r);return;case _r.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#q||=new Map).set(e,r),this.showAllEditors("highlight",r);break}if(this.hasSelection)for(const n of this.#_)n.updateParams(e,r);else for(const n of this.#u)n.updateDefaultParams(e,r)}}showAllEditors(e,r,n=!1){for(const a of this.#r.values())a.editorType===e&&a.show(r);(this.#q?.get(_r.HIGHLIGHT_SHOW_ALL)??!0)!==r&&this.#j([[_r.HIGHLIGHT_SHOW_ALL,r]])}enableWaiting(e=!1){if(this.#B!==e){this.#B=e;for(const r of this.#i.values())e?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",e)}}async#de(){if(!this.#E){this.#E=!0;const e=[];for(const r of this.#i.values())e.push(r.enable());await Promise.all(e);for(const r of this.#r.values())r.enable()}}#pe(){if(this.unselectAll(),this.#E){this.#E=!1;for(const e of this.#i.values())e.disable();for(const e of this.#r.values())e.disable()}}*getEditors(e){for(const r of this.#r.values())r.pageIndex===e&&(yield r)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.focusMainContainer(),this.#S=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#N?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#m.has(e.annotationElementId))&&this.#s?.remove(e.id)}addDeletedAnnotationElement(e){this.#m.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#m.has(e)}removeDeletedAnnotationElement(e){this.#m.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#re(e){const r=this.#i.get(e.pageIndex);r?r.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#j(e.propertiesToUpdate))}get#ge(){let e=null;for(e of this.#_);return e}updateUI(e){this.#ge===e&&this.#j(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#j(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#_.has(e)){this.#_.delete(e),e.unselect(),this.#M({hasSelectedEditor:this.hasSelection});return}this.#_.add(e),e.select(),this.#j(e.propertiesToUpdate),this.#M({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#h?.commitOrRemove();for(const r of this.#_)r!==e&&r.unselect();this.#_.clear(),this.#_.add(e),e.select(),this.#j(e.propertiesToUpdate),this.#M({hasSelectedEditor:!0})}isSelected(e){return this.#_.has(e)}get firstSelectedEditor(){return this.#_.values().next().value}unselect(e){e.unselect(),this.#_.delete(e),this.#M({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#_.size!==0}get isEnterHandled(){return this.#_.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#M({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#K()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#M({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#K()})}addCommands(e){this.#l.add(e),this.#M({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#K()})}cleanUndoStack(e){this.#l.cleanType(e)}#K(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(const e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();const e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const r=e?[e]:[...this.#_],n=()=>{this._editorUndoBar?.show(i,r.length===1?r[0].editorType:r.length);for(const a of r)a.remove()},i=()=>{for(const a of r)this.#re(a)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#ne(e){for(const r of this.#_)r.unselect();this.#_.clear();for(const r of e)r.isEmpty()||(this.#_.add(r),r.select());this.#M({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#_)e.commit();this.#ne(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#k!==er.NONE))&&!this.#h?.commitOrRemove()&&this.hasSelection){for(const e of this.#_)e.unselect();this.#_.clear(),this.#M({hasSelectedEditor:!1})}}translateSelectedEditors(e,r,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#U[0]+=e,this.#U[1]+=r;const[i,a]=this.#U,s=[...this.#_],o=1e3;this.#O&&clearTimeout(this.#O),this.#O=setTimeout(()=>{this.#O=null,this.#U[0]=this.#U[1]=0,this.addCommands({cmd:()=>{for(const l of s)this.#r.has(l.id)&&(l.translateInPage(i,a),l.translationDone())},undo:()=>{for(const l of s)this.#r.has(l.id)&&(l.translateInPage(-i,-a),l.translationDone())},mustExec:!1})},o);for(const l of s)l.translateInPage(e,r),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(const e of this.#_)this.#g.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);const e=this.#g;this.#g=null;let r=!1;for(const[{x:i,y:a,pageIndex:s},o]of e)o.newX=i,o.newY=a,o.newPageIndex=s,r||=i!==o.savedX||a!==o.savedY||s!==o.savedPageIndex;if(!r)return!1;const n=(i,a,s,o)=>{if(this.#r.has(i.id)){const l=this.#i.get(o);l?i._setParentAndPosition(l,a,s):(i.pageIndex=o,i.x=a,i.y=s)}};return this.addCommands({cmd:()=>{for(const[i,{newX:a,newY:s,newPageIndex:o}]of e)n(i,a,s,o)},undo:()=>{for(const[i,{savedX:a,savedY:s,savedPageIndex:o}]of e)n(i,a,s,o)},mustExec:!0}),!0}dragSelectedEditors(e,r){if(this.#g)for(const n of this.#g.keys())n.drag(e,r)}rebuild(e){if(e.parent===null){const r=this.getLayer(e.pageIndex);r?(r.changeParent(e),r.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#_.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#k}isEditingMode(){return this.#k!==er.NONE}get imageManager(){return Qt(this,"imageManager",new mD)}getSelectionBoxes(e){if(!e)return null;const r=document.getSelection();for(let c=0,u=r.rangeCount;c<u;c++)if(!e.contains(r.getRangeAt(c).commonAncestorContainer))return null;const{x:n,y:i,width:a,height:s}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,u,h,f)=>({x:(u-i)/s,y:1-(c+h-n)/a,width:f/s,height:h/a});break;case"180":o=(c,u,h,f)=>({x:1-(c+h-n)/a,y:1-(u+f-i)/s,width:h/a,height:f/s});break;case"270":o=(c,u,h,f)=>({x:1-(u+f-i)/s,y:(c-n)/a,width:f/s,height:h/a});break;default:o=(c,u,h,f)=>({x:(c-n)/a,y:(u-i)/s,width:h/a,height:f/s});break}const l=[];for(let c=0,u=r.rangeCount;c<u;c++){const h=r.getRangeAt(c);if(!h.collapsed)for(const{x:f,y:d,width:p,height:g}of h.getClientRects())p===0||g===0||l.push(o(f,d,p,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:r}){(this.#o||=new Map).set(e,r)}removeChangedExistingAnnotation({annotationElementId:e}){this.#o?.delete(e)}renderAnnotationElement(e){const r=this.#o?.get(e.data.id);if(!r)return;const n=this.#s.getRawValue(r);n&&(this.#k===er.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,r,n){const i=this.#N?.get(e);i&&(i.setCanvas(r,n),this.#N.delete(e))}addMissingCanvas(e,r){(this.#N||=new Map).set(e,r)}}class Jl{#e=null;#t=!1;#n=null;#r=null;#i=null;#a=null;#s=!1;#o=null;#l=null;#c=null;#f=null;#h=!1;static#d=null;static _l10n=null;constructor(e){this.#l=e,this.#h=e._uiManager.useNewAltTextFlow,Jl.#d||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){Jl._l10n??=e}async render(){const e=this.#n=document.createElement("button");e.className="altText",e.tabIndex="0";const r=this.#r=document.createElement("span");e.append(r),this.#h?(e.classList.add("new"),e.setAttribute("data-l10n-id",Jl.#d.missing),r.setAttribute("data-l10n-id",Jl.#d["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const n=this.#l._uiManager._signal;e.addEventListener("contextmenu",Bo,{signal:n}),e.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:n});const i=a=>{a.preventDefault(),this.#l._uiManager.editAltText(this.#l),this.#h&&this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#m}})};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",a=>{a.target===e&&a.key==="Enter"&&(this.#s=!0,i(a))},{signal:n}),await this.#g(),e}get#m(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#s}),this.#s=!1)}isEmpty(){return this.#h?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#h?this.#e!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(e){this.#e===null&&(this.#c=e,this.#f=await Jl._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#g())}toggleAltTextBadge(e=!1){if(!this.#h||this.#e){this.#o?.remove(),this.#o=null;return}if(!this.#o){const r=this.#o=document.createElement("div");r.className="noAltTextBadge",this.#l.div.append(r)}this.#o.classList.toggle("hidden",!e)}serialize(e){let r=this.#e;return!e&&this.#c===r&&(r=this.#f),{altText:r,decorative:this.#t,guessedText:this.#c,textWithDisclaimer:this.#f}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:r,guessedText:n,textWithDisclaimer:i,cancel:a=!1}){n&&(this.#c=n,this.#f=i),!(this.#e===e&&this.#t===r)&&(a||(this.#e=e,this.#t=r),this.#g())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#m}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#o?.remove(),this.#o=null}async#g(){const e=this.#n;if(!e)return;if(this.#h){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",Jl.#d[this.#m]),this.#r?.setAttribute("data-l10n-id",Jl.#d[`${this.#m}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#i?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let r=this.#i;if(!r){this.#i=r=document.createElement("span"),r.className="tooltip",r.setAttribute("role","tooltip"),r.id=`alt-text-tooltip-${this.#l.id}`;const i=100,a=this.#l._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add("show"),this.#l._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:a}),e.addEventListener("mouseleave",()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.#i?.classList.remove("show")},{signal:a})}this.#t?r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(r.removeAttribute("data-l10n-id"),r.textContent=this.#e),r.parentNode||e.append(r),this.#l.getElementForAltText()?.setAttribute("aria-describedby",r.id)}}class R2{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#s=null;#o=null;#l=!1;#c=null;constructor(e){this.#r=e}renderForToolbar(){const e=this.#t=document.createElement("button");return e.className="comment",this.#f(e,!1)}renderForStandalone(){const e=this.#e=document.createElement("button");e.className="annotationCommentButton";const r=this.#r.commentButtonPosition;if(r){const{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction==="ltr"?1-r[0]:r[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*r[1]}% - var(--comment-button-dim))`;const i=this.#r.commentButtonColor;i&&(n.backgroundColor=i)}return this.#f(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;const e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#c)return this.#c;if(!this.#e)return null;const{x:e,y:r,height:n}=this.#e.getBoundingClientRect(),{x:i,y:a,width:s,height:o}=this.#r.parent.boundingClientRect;return[(e-i)/s,(r+n-a)/o]}set commentPopupPositionInLayer(e){this.#c=e}hasDefaultPopupPosition(){return this.#c===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:r}){this.#e&&(this.#e.classList.toggle("selected",e),this.#e.ariaExpanded=r)}#f(e,r){if(!this.#r._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",r?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener("contextmenu",Bo,{signal:n}),r&&(e.addEventListener("focusin",a=>{this.#r._focusEventsAllowed=!1,Tn(a)},{capture:!0,signal:n}),e.addEventListener("focusout",a=>{this.#r._focusEventsAllowed=!0,Tn(a)},{capture:!0,signal:n})),e.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:n});const i=a=>{a.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",a=>{a.target===e&&a.key==="Enter"&&(this.#n=!0,i(a))},{signal:n}),e.addEventListener("pointerenter",()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener("pointerleave",()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){const r=this.commentPopupPositionInLayer;let n,i;if(r)[n,i]=r;else{[n,i]=this.#r.commentButtonPosition;const{width:u,height:h,x:f,y:d}=this.#r;n=f+n*u,i=d+i*h}const a=this.#r.parent.boundingClientRect,{x:s,y:o,width:l,height:c}=a;this.#r._uiManager.editComment(this.#r,s+n*l,o+i*c,{...e,parentDimensions:a})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#l||this.#s===""}isEmpty(){return this.#s===null}hasBeenEdited(){return this.isDeleted()||this.#s!==this.#i}serialize(){return this.data}get data(){return{text:this.#s,richText:this.#a,date:this.#o,deleted:this.isDeleted()}}set data(e){if(e!==this.#s&&(this.#a=null),e===null){this.#s="",this.#l=!0;return}this.#s=e,this.#o=new Date,this.#l=!1}setInitialText(e,r=null){this.#i=e,this.data=e,this.#o=null,this.#a=r}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#s="",this.#a=null,this.#o=null,this.#r=null,this.#n=!1,this.#l=!1}}class dC{#e;#t=!1;#n=null;#r;#i;#a;#s;#o=null;#l;#c=null;#f;#h=null;constructor({container:e,isPinchingDisabled:r=null,isPinchingStopped:n=null,onPinchStart:i=null,onPinching:a=null,onPinchEnd:s=null,signal:o}){this.#e=e,this.#n=n,this.#r=r,this.#i=i,this.#a=a,this.#s=s,this.#f=new AbortController,this.#l=AbortSignal.any([o,this.#f.signal]),e.addEventListener("touchstart",this.#d.bind(this),{passive:!1,signal:this.#l})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Ac.pixelRatio}#d(e){if(this.#r?.())return;if(e.touches.length===1){if(this.#o)return;const i=this.#o=new AbortController,a=AbortSignal.any([this.#l,i.signal]),s=this.#e,o={capture:!0,signal:a,passive:!1},l=c=>{c.pointerType==="touch"&&(this.#o?.abort(),this.#o=null)};s.addEventListener("pointerdown",c=>{c.pointerType==="touch"&&(Tn(c),l(c))},o),s.addEventListener("pointerup",l,o),s.addEventListener("pointercancel",l,o);return}if(!this.#h){this.#h=new AbortController;const i=AbortSignal.any([this.#l,this.#h.signal]),a=this.#e,s={signal:i,capture:!1,passive:!1};a.addEventListener("touchmove",this.#m.bind(this),s);const o=this.#g.bind(this);a.addEventListener("touchend",o,s),a.addEventListener("touchcancel",o,s),s.capture=!0,a.addEventListener("pointerdown",Tn,s),a.addEventListener("pointermove",Tn,s),a.addEventListener("pointercancel",Tn,s),a.addEventListener("pointerup",Tn,s),this.#i?.()}if(Tn(e),e.touches.length!==2||this.#n?.()){this.#c=null;return}let[r,n]=e.touches;r.identifier>n.identifier&&([r,n]=[n,r]),this.#c={touch0X:r.screenX,touch0Y:r.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#m(e){if(!this.#c||e.touches.length!==2)return;Tn(e);let[r,n]=e.touches;r.identifier>n.identifier&&([r,n]=[n,r]);const{screenX:i,screenY:a}=r,{screenX:s,screenY:o}=n,l=this.#c,{touch0X:c,touch0Y:u,touch1X:h,touch1Y:f}=l,d=h-c,p=f-u,g=s-i,m=o-a,v=Math.hypot(g,m)||1,y=Math.hypot(d,p)||1;if(!this.#t&&Math.abs(y-v)<=dC.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=a,l.touch1X=s,l.touch1Y=o,!this.#t){this.#t=!0;return}const x=[(i+s)/2,(a+o)/2];this.#a?.(x,y,v)}#g(e){e.touches.length>=2||(this.#h&&(this.#h.abort(),this.#h=null,this.#s?.()),this.#c&&(Tn(e),this.#c=null,this.#t=!1))}destroy(){this.#f?.abort(),this.#f=null,this.#o?.abort(),this.#o=null}}class It{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#s=null;#o="";#l=null;#c=null;#f=null;#h=null;#d=null;#m="";#g=!1;#u=null;#p=!1;#v=!1;#x=!1;#y=null;#C=0;#S=0;#b=null;#T=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#w=!1;#A=It._zIndex++;static _borderLineWidth=-1;static _colorManager=new vD;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=It.prototype._resizeWithKeyboard,r=nf.TRANSLATE_SMALL,n=nf.TRANSLATE_BIG;return Qt(this,"_resizerKeyboardManager",new Tb([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],It.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;const{rotation:r,rawDims:{pageWidth:n,pageHeight:i,pageX:a,pageY:s}}=this.parent.viewport;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[a,s];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Qt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const r=new iSe({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});r.annotationElementId=e.annotationElementId,r.deleted=!0,r._uiManager.addToAnnotationStorage(r)}static initialize(e,r){if(It._l10n??=e,It._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),It._borderLineWidth!==-1)return;const n=getComputedStyle(document.documentElement);It._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,r){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,r){rn("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,r]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*r/(e*2),this.y+=this.width*e/(r*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*r/(e*2),this.y-=this.width*e/(r*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#A}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(this.#O(),this.#h?.remove(),this.#h=null),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#g?this.#g=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,r,n,i){const[a,s]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(e+n)/a,this.y=(r+i)/s,this.fixAndSetPosition()}_moveAfterPaste(e,r){const[n,i]=this.parentDimensions;this.setAt(e*n,r*i,this.width*n,this.height*i),this._onTranslated()}#D([e,r],n,i){[n,i]=this.screenToPageTranslation(n,i),this.x+=n/e,this.y+=i/r,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,r){this.#D(this.parentDimensions,e,r)}translateInPage(e,r){this.#u||=[this.x,this.y,this.width,this.height],this.#D(this.pageDimensions,e,r),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,r){this.#u||=[this.x,this.y,this.width,this.height];const{div:n,parentDimensions:[i,a]}=this;if(this.x+=e/i,this.y+=r/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:h,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:o}=this;const[l,c]=this.getBaseTranslation();s+=l,o+=c;const{style:u}=n;u.left=`${(100*s).toFixed(2)}%`,u.top=`${(100*o).toFixed(2)}%`,this._onTranslating(s,o),n.scrollIntoView({block:"nearest"})}_onTranslating(e,r){}_onTranslated(e,r){}get _hasBeenMoved(){return!!this.#u&&(this.#u[0]!==this.x||this.#u[1]!==this.y)}get _hasBeenResized(){return!!this.#u&&(this.#u[2]!==this.width||this.#u[3]!==this.height)}getBaseTranslation(){const[e,r]=this.parentDimensions,{_borderLineWidth:n}=It,i=n/e,a=n/r;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:r},pageDimensions:[n,i]}=this;let{x:a,y:s,width:o,height:l}=this;if(o*=n,l*=i,a*=n,s*=i,this._mustFixPosition)switch(e){case 0:a=Na(a,0,n-o),s=Na(s,0,i-l);break;case 90:a=Na(a,0,n-l),s=Na(s,o,i);break;case 180:a=Na(a,o,n),s=Na(s,l,i);break;case 270:a=Na(a,l,n),s=Na(s,0,i-o);break}this.x=a/=n,this.y=s/=i;const[c,u]=this.getBaseTranslation();a+=c,s+=u,r.left=`${(100*a).toFixed(2)}%`,r.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#E(e,r,n){switch(n){case 90:return[r,-e];case 180:return[-e,-r];case 270:return[-r,e];default:return[e,r]}}screenToPageTranslation(e,r){return It.#E(e,r,this.parentRotation)}pageTranslationToScreen(e,r){return It.#E(e,r,360-this.parentRotation)}#I(e){switch(e){case 90:{const[r,n]=this.pageDimensions;return[0,-r/n,n/r,0]}case 180:return[-1,0,0,-1];case 270:{const[r,n]=this.pageDimensions;return[0,r/n,-n/r,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[r,n]}=this;return[r*e,n*e]}setDims(){const{div:{style:e},width:r,height:n}=this;e.width=`${(100*r).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#B(){if(this.#l)return;this.#l=document.createElement("div"),this.#l.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],r=this._uiManager._signal;for(const n of e){const i=document.createElement("div");this.#l.append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",this.#L.bind(this,n),{signal:r}),i.addEventListener("contextmenu",Bo,{signal:r}),i.tabIndex=-1}this.div.prepend(this.#l)}#L(e,r){r.preventDefault();const{isMac:n}=yi.platform;if(r.button!==0||r.ctrlKey&&n)return;this.#n?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,this.#c=[r.screenX,r.screenY];const a=new AbortController,s=this._uiManager.combinedSignal(a);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#N.bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Tn,{passive:!1,signal:s}),window.addEventListener("contextmenu",Bo,{signal:s}),this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(r.target).cursor;const c=()=>{a.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=l,this.#F()};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})}#R(e,r,n,i){this.width=n,this.height=i,this.x=e,this.y=r,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#F(){if(!this.#f)return;const{savedX:e,savedY:r,savedWidth:n,savedHeight:i}=this.#f;this.#f=null;const a=this.x,s=this.y,o=this.width,l=this.height;a===e&&s===r&&o===n&&l===i||this.addCommands({cmd:this.#R.bind(this,a,s,o,l),undo:this.#R.bind(this,e,r,n,i),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(e,r){const[n,i]=this.parentDimensions,a=this.x,s=this.y,o=this.width,l=this.height,c=It.MIN_SIZE/n,u=It.MIN_SIZE/i,h=this.#I(this.rotation),f=(D,L)=>[h[0]*D+h[2]*L,h[1]*D+h[3]*L],d=this.#I(360-this.rotation),p=(D,L)=>[d[0]*D+d[2]*L,d[1]*D+d[3]*L];let g,m,v=!1,y=!1;switch(e){case"topLeft":v=!0,g=(D,L)=>[0,0],m=(D,L)=>[D,L];break;case"topMiddle":g=(D,L)=>[D/2,0],m=(D,L)=>[D/2,L];break;case"topRight":v=!0,g=(D,L)=>[D,0],m=(D,L)=>[0,L];break;case"middleRight":y=!0,g=(D,L)=>[D,L/2],m=(D,L)=>[0,L/2];break;case"bottomRight":v=!0,g=(D,L)=>[D,L],m=(D,L)=>[0,0];break;case"bottomMiddle":g=(D,L)=>[D/2,L],m=(D,L)=>[D/2,0];break;case"bottomLeft":v=!0,g=(D,L)=>[0,L],m=(D,L)=>[D,0];break;case"middleLeft":y=!0,g=(D,L)=>[0,L/2],m=(D,L)=>[D,L/2];break}const x=g(o,l),b=m(o,l);let w=f(...b);const _=It._round(a+w[0]),S=It._round(s+w[1]);let C=1,T=1,A,k;if(r.fromKeyboard)({deltaX:A,deltaY:k}=r);else{const{screenX:D,screenY:L}=r,[P,O]=this.#c;[A,k]=this.screenToPageTranslation(D-P,L-O),this.#c[0]=D,this.#c[1]=L}if([A,k]=p(A/n,k/i),v){const D=Math.hypot(o,l);C=T=Math.max(Math.min(Math.hypot(b[0]-x[0]-A,b[1]-x[1]-k)/D,1/o,1/l),c/o,u/l)}else y?C=Na(Math.abs(b[0]-x[0]-A),c,1)/o:T=Na(Math.abs(b[1]-x[1]-k),u,1)/l;const I=It._round(o*C),E=It._round(l*T);w=f(...m(I,E));const M=_-w[0],R=S-w[1];this.#u||=[this.x,this.y,this.width,this.height],this.width=I,this.height=E,this.x=M,this.y=R,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#v)return this._editToolbar;this._editToolbar=new Ey(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[r,n]of e)await this._editToolbar.addButton(r,n);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){const r=this._editToolbar?.div;r?r.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(Jl.initialize(It._l10n),this.#n=new Jl(this),this.#e&&(this.#n.data=this.#e,this.#e=null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new R2(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#i){this._uiManager.isEditingMode()&&this.#i.classList.remove("hidden");return}this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i))}}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add("hidden")}get comment(){const{data:{richText:e,text:r,date:n,deleted:i}}=this.#r;return{text:r,richText:e,date:n,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new R2(this),this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:r,richText:n}){if(!r||(this.#r||=new R2(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new R2(this),this.#r.edit(e)}toggleComment(e,r=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,r)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,i]=e.rect,[a]=this.pageDimensions,[s]=this.pageTranslation,o=s+a+1,l=i-100,c=o+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,c,i]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:r}}){this.#r.data=r?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=this.#a?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#V();const[r,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*n/r).toFixed(2)}%`,e.style.maxHeight=`${(100*r/n).toFixed(2)}%`);const[i,a]=this.getInitialTranslation();return this.translate(i,a),yY(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#T||=new dC({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#H.bind(this),onPinching:this.#k.bind(this),onPinchEnd:this.#_.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#H(){this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#k(e,r,n){let a=.7*(n/r)+1-.7;if(a===1)return;const s=this.#I(this.rotation),o=(_,S)=>[s[0]*_+s[2]*S,s[1]*_+s[3]*S],[l,c]=this.parentDimensions,u=this.x,h=this.y,f=this.width,d=this.height,p=It.MIN_SIZE/l,g=It.MIN_SIZE/c;a=Math.max(Math.min(a,1/f,1/d),p/f,g/d);const m=It._round(f*a),v=It._round(d*a);if(m===f&&v===d)return;this.#u||=[u,h,f,d];const y=o(f/2,d/2),x=It._round(u+y[0]),b=It._round(h+y[1]),w=o(m/2,v/2);this.x=x-w[0],this.y=b-w[1],this.width=m,this.height=v,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#_(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#F()}pointerdown(e){const{isMac:r}=yi.platform;if(e.button!==0||e.ctrlKey&&r){e.preventDefault();return}if(this.#g=!0,this._isDraggable){this.#$(e);return}this.#P(e)}#P(e){const{isMac:r}=yi.platform;e.ctrlKey&&!r||e.shiftKey||e.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}#$(e){const{isSelected:r}=this;this._uiManager.setUpDragSession();let n=!1;const i=new AbortController,a=this._uiManager.combinedSignal(i),s={capture:!0,passive:!1,signal:a},o=c=>{i.abort(),this.#s=null,this.#g=!1,this._uiManager.endDragSession()||this.#P(c),n&&this._onStopDragging()};r&&(this.#C=e.clientX,this.#S=e.clientY,this.#s=e.pointerId,this.#o=e.pointerType,window.addEventListener("pointermove",c=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:u,clientY:h,pointerId:f}=c;if(f!==this.#s){Tn(c);return}const[d,p]=this.screenToPageTranslation(u-this.#C,h-this.#S);this.#C=u,this.#S=h,this._uiManager.dragSelectedEditors(d,p)},s),window.addEventListener("touchmove",Tn,s),window.addEventListener("pointerdown",c=>{c.pointerType===this.#o&&(this.#T||c.isPrimary)&&o(c),Tn(c)},s));const l=c=>{if(!this.#s||this.#s===c.pointerId){o(c);return}Tn(c)};window.addEventListener("pointerup",l,{signal:a}),window.addEventListener("blur",l,{signal:a})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,r,n){e.changeParent(this),this.x=r,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,r,n=this.rotation){const i=this.parentScale,[a,s]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/i,u=r/i,h=this.x*a,f=this.y*s,d=this.width*a,p=this.height*s;switch(n){case 0:return[h+c+o,s-f-u-p+l,h+c+d+o,s-f-u+l];case 90:return[h+u+o,s-f+c+l,h+u+p+o,s-f+c+d+l];case 180:return[h-c-d+o,s-f+u+l,h-c+o,s-f+u+p+l];case 270:return[h-u-p+o,s-f-c-d+l,h-u+o,s-f-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,r){const[n,i,a,s]=e,o=a-n,l=s-i;switch(this.rotation){case 0:return[n,r-s,o,l];case 90:return[n,r-i,l,o];case 180:return[a,r-i,o,l];case 270:return[a,r-s,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&It._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){const{comment:{text:e,color:r,date:n,opacity:i,deleted:a,richText:s},uid:o,pageIndex:l,creationDate:c,modificationDate:u}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:s,contentsObj:{str:e},creationDate:c,modificationDate:n||u,popupRef:!a,color:r,opacity:i}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#v=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#v=!1,!0):!1}isInEditMode(){return this.#v}shouldGetKeyboardEvents(){return this.#x}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:r,bottom:n,right:i}=this.getClientDimensions(),{innerHeight:a,innerWidth:s}=window;return r<s&&i>0&&e<a&&n>0}#V(){if(this.#d||!this.div)return;this.#d=new AbortController;const e=this._uiManager.combinedSignal(this.#d);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#V()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,r=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(e,r,n){const i=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});i.rotation=e.rotation,i.#e=e.accessibilityData,i._isCopy=e.isCopy||!1;const[a,s]=i.pageDimensions,[o,l,c,u]=i.getRectInCurrentCoords(e.rect,s);return i.x=o/a,i.y=l/s,i.width=c/a,i.height=u/s,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#d?.abort(),this.#d=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#O(),this.removeEditToolbar(),this.#b){for(const e of this.#b.values())clearTimeout(e);this.#b=null}this.parent=null,this.#T?.destroy(),this.#T=null,this.#h?.remove(),this.#h=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#B(),this.#l.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,r]}=this,[n,i,a,s]=this.getPDFRect();return[It._round(n+(a-n)*e),It._round(i+(s-i)*(1-r))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const r=this.#l.children;if(!this.#t){this.#t=Array.from(r);const s=this.#q.bind(this),o=this.#W.bind(this),l=this._uiManager._signal;for(const c of this.#t){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",this.#X.bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",It._l10nResizer[u])}}const n=this.#t[0];let i=0;for(const s of r){if(s===n)break;i++}const a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let o=0;o<i-a;o++)this.#l.append(this.#l.firstElementChild);else if(a>i)for(let o=0;o<a-i;o++)this.#l.firstElementChild.before(this.#l.lastElementChild);let s=0;for(const o of r){const c=this.#t[s++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",It._l10nResizer[c])}}this.#U(0),this.#x=!0,this.#l.firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#q(e){It._resizerKeyboardManager.exec(this,e)}#W(e){this.#x&&e.relatedTarget?.parentNode!==this.#l&&this.#O()}#X(e){this.#m=this.#x?e:""}#U(e){if(this.#t)for(const r of this.#t)r.tabIndex=e}_resizeWithKeyboard(e,r){this.#x&&this.#N(this.#m,{deltaX:e,deltaY:r,fromKeyboard:!0})}#O(){this.#x=!1,this.#U(-1),this.#F()}_stopResizingWithKeyboard(){this.#O(),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#l?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,r){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#p}set isEditing(e){this.#p=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,r=!1){if(r){this.#b||=new Map;const{action:n}=e;let i=this.#b.get(n);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#b.delete(n),this.#b.size===0&&(this.#b=null)},It._telemetryTimeout),this.#b.set(n,i);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){if(!this.#h&&!this.deleted){this.#h=e.addFakeAnnotation(this);return}if(this.deleted){this.#h.remove(),this.#h=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#h.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let r=e.container.querySelector(".annotationContent");if(!r)r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),e.container.prepend(r);else if(r.nodeName==="CANVAS"){const n=r;r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),n.before(r)}return r}resetAnnotationElement(e){const{firstElementChild:r}=e.container;r?.nodeName==="DIV"&&r.classList.contains("annotationContent")&&r.remove()}}class iSe extends It{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const rB=3285377520,io=4294901760,Rl=65535;class xY{constructor(e){this.h1=e?e&4294967295:rB,this.h2=e?e&4294967295:rB}update(e){let r,n;if(typeof e=="string"){r=new Uint8Array(e.length*2),n=0;for(let g=0,m=e.length;g<m;g++){const v=e.charCodeAt(g);v<=255?r[n++]=v:(r[n++]=v>>>8,r[n++]=v&255)}}else if(ArrayBuffer.isView(e))r=e.slice(),n=r.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=n>>2,a=n-i*4,s=new Uint32Array(r.buffer,0,i);let o=0,l=0,c=this.h1,u=this.h2;const h=3432918353,f=461845907,d=h&Rl,p=f&Rl;for(let g=0;g<i;g++)g&1?(o=s[g],o=o*h&io|o*d&Rl,o=o<<15|o>>>17,o=o*f&io|o*p&Rl,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=s[g],l=l*h&io|l*d&Rl,l=l<<15|l>>>17,l=l*f&io|l*p&Rl,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(o=0,a){case 3:o^=r[i*4+2]<<16;case 2:o^=r[i*4+1]<<8;case 1:o^=r[i*4],o=o*h&io|o*d&Rl,o=o<<15|o>>>17,o=o*f&io|o*p&Rl,i&1?c^=o:u^=o}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,r=this.h2;return e^=r>>>1,e=e*3981806797&io|e*36045&Rl,r=r*4283543511&io|((r<<16|e>>>16)*2950163797&io)>>>16,e^=r>>>1,e=e*444984403&io|e*60499&Rl,r=r*3301882366&io|((r<<16|e>>>16)*3120437893&io)>>>16,e^=r>>>1,(e>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}const GT=Object.freeze({map:null,hash:"",transfer:void 0});class yD{#e=!1;#t=null;#n=null;#r=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,r){const n=this.#r.get(e);return n===void 0?r:Object.assign(r,n)}getRawValue(e){return this.#r.get(e)}remove(e){const r=this.#r.get(e);if(r!==void 0&&(r instanceof It&&this.#n.delete(r.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const n of this.#r.values())if(n instanceof It)return;this.onAnnotationEditor(null)}}setValue(e,r){const n=this.#r.get(e);let i=!1;if(n!==void 0)for(const[a,s]of Object.entries(r))n[a]!==s&&(i=!0,n[a]=s);else i=!0,this.#r.set(e,r);i&&this.#i(),r instanceof It&&((this.#n||=new Map).set(r.annotationElementId,r),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(r.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new bY(this)}get serializable(){if(this.#r.size===0)return GT;const e=new Map,r=new xY,n=[],i=Object.create(null);let a=!1;for(const[s,o]of this.#r){const l=o instanceof It?o.serialize(!1,i):o;l&&(e.set(s,l),r.update(`${s}:${JSON.stringify(l)}`),a||=!!l.bitmap)}if(a)for(const s of e.values())s.bitmap&&n.push(s.bitmap);return e.size>0?{map:e,hash:r.hexdigest(),transfer:n}:GT}get editorStats(){let e=null;const r=new Map;let n=0,i=0;for(const a of this.#r.values()){if(!(a instanceof It)){a.popup&&(a.popup.deleted?i+=1:n+=1);continue}a.isCommentDeleted?i+=1:a.hasEditedComment&&(n+=1);const s=a.telemetryFinalData;if(!s)continue;const{type:o}=s;r.has(o)||r.set(o,Object.getPrototypeOf(a).constructor),e||=Object.create(null);const l=e[o]||=new Map;for(const[c,u]of Object.entries(s)){if(c==="type")continue;let h=l.get(c);h||(h=new Map,l.set(c,h));const f=h.get(u)??0;h.set(u,f+1)}}if((i>0||n>0)&&(e||=Object.create(null),e.comments={deleted:i,edited:n}),!e)return null;for(const[a,s]of r)e[a]=s.computeTelemetryFinalData(e[a]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,r){const n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(r),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;const e=[];if(this.#n)for(const r of this.#n.values())r.serialize()&&e.push(r.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#r.entries()}}class bY extends yD{#e;constructor(e){super();const{map:r,hash:n,transfer:i}=e.serializable,a=structuredClone(r,i?{transfer:i}:null);this.#e={map:a,hash:n,transfer:i}}get print(){rn("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return Qt(this,"modifiedIds",{ids:new Set,hash:""})}}class aSe{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:r=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const r=this.styleElement.sheet;r.insertRule(e,r.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:r,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(Sr(!r,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:s}=e,o=new FontFace(i,a,s);this.addNativeFontFace(o);try{await o.load(),this.#e.add(i),n?.(e)}catch{Jt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}rn("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const n=e.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(i){throw Jt(`Failed to load font '${n.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const r=e.createFontFaceRule();if(r){if(this.insertRule(r),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const i=this._queueLoadingCallback(n);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return Qt(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return Qt(this,"isSyncFontLoadingSupported",Ra||yi.platform.isFirefox)}_queueLoadingCallback(e){function r(){for(Sr(!i.done,"completeRequest() cannot be called twice."),i.done=!0;n.length>0&&n[0].done;){const a=n.shift();setTimeout(a.callback,0)}}const{loadingRequests:n}=this,i={done:!1,complete:r,callback:e};return n.push(i),i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Qt(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,r){function n(b,w){return b.charCodeAt(w)<<24|b.charCodeAt(w+1)<<16|b.charCodeAt(w+2)<<8|b.charCodeAt(w+3)&255}function i(b,w,_,S){const C=b.substring(0,w),T=b.substring(w+_);return C+S+T}let a,s;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function u(b,w){if(++c>30){Jt("Load test font never loaded."),w();return}if(l.font="30px "+b,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){w();return}setTimeout(u.bind(null,b,w))}const h=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=i(f,976,h.length,h);const p=16,g=1482184792;let m=n(f,p);for(a=0,s=h.length-3;a<s;a+=4)m=m-g+n(h,a)|0;a<h.length&&(m=m-g+n(h+"XXX",a)|0),f=i(f,p,4,$_e(m));const v=`url(data:font/opentype;base64,${btoa(f)});`,y=`@font-face {font-family:"${h}";src:${v}}`;this.insertRule(y);const x=this._document.createElement("div");x.style.visibility="hidden",x.style.width=x.style.height="10px",x.style.position="absolute",x.style.top=x.style.left="0px";for(const b of[e.loadedName,h]){const w=this._document.createElement("span");w.textContent="Hi",w.style.fontFamily=b,x.append(w)}this._document.body.append(x),u(h,()=>{x.remove(),r.complete()})}}class sSe{#e;constructor(e,r=null,n,i){this.compiledGlyphs=Object.create(null),this.#e=e,this._inspectFont=r,n&&Object.assign(this,n),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${pY(this.data)});`;let r;if(!this.cssFontInfo)r=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),r}getPathGenerator(e,r){if(this.compiledGlyphs[r]!==void 0)return this.compiledGlyphs[r];const n=this.loadedName+"_path_"+r;let i;try{i=e.get(n)}catch(s){Jt(`getPathGenerator - ignoring character: "${s}".`)}const a=vY(i?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[r]=a}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace??!1}set disableFontFace(e){Qt(this,"disableFontFace",!!e)}get fontExtraProperties(){return this.#e.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}set bbox(e){Qt(this,"bbox",e)}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}}class Ng{#e;#t;#n;static strings=["fontFamily","fontWeight","italicAngle"];static write(e){const r=new TextEncoder,n={};let i=0;for(const c of Ng.strings){const u=r.encode(e[c]);n[c]=u,i+=4+u.length}const a=new ArrayBuffer(i),s=new Uint8Array(a),o=new DataView(a);let l=0;for(const c of Ng.strings){const u=n[c],h=u.length;o.setUint32(l,h),s.set(u,l+4),l+=4+h}return Sr(l===a.byteLength,"CssFontInfo.write: Buffer overflow"),a}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}#r(e){Sr(e<Ng.strings.length,"Invalid string index");let r=0;for(let i=0;i<e;i++)r+=this.#t.getUint32(r)+4;const n=this.#t.getUint32(r);return this.#n.decode(new Uint8Array(this.#e,r+4,n))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}}class Og{#e;#t;#n;static strings=["css","loadedName","baseFontName","src"];static write(e){const r=new TextEncoder,n={};let i=0;for(const f of Og.strings){const d=r.encode(e[f]);n[f]=d,i+=4+d.length}i+=4;let a,s,o=1+i;e.style&&(a=r.encode(e.style.style),s=r.encode(e.style.weight),o+=4+a.length+4+s.length);const l=new ArrayBuffer(o),c=new Uint8Array(l),u=new DataView(l);let h=0;u.setUint8(h++,e.guessFallback?1:0),u.setUint32(h,0),h+=4,i=0;for(const f of Og.strings){const d=n[f],p=d.length;i+=4+p,u.setUint32(h,p),c.set(d,h+4),h+=4+p}return u.setUint32(h-i-4,i),e.style&&(u.setUint32(h,a.length),c.set(a,h+4),h+=4+a.length,u.setUint32(h,s.length),c.set(s,h+4),h+=4+s.length),Sr(h<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(h)}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}get guessFallback(){return this.#t.getUint8(0)!==0}#r(e){Sr(e<Og.strings.length,"Invalid string index");let r=5;for(let i=0;i<e;i++)r+=this.#t.getUint32(r)+4;const n=this.#t.getUint32(r);return this.#n.decode(new Uint8Array(this.#e,r+4,n))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let e=1;e+=4+this.#t.getUint32(e);const r=this.#t.getUint32(e),n=this.#n.decode(new Uint8Array(this.#e,e+4,r));e+=4+r;const i=this.#t.getUint32(e),a=this.#n.decode(new Uint8Array(this.#e,e+4,i));return{style:n,weight:a}}}class Kr{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#e=Math.ceil(this.bools.length*2/8);static#t=this.#e+this.numbers.length*8;static#n=this.#t+1+8;static#r=this.#n+1+48;static#i=this.#r+1+6;#a;#s;#o;constructor({data:e,extra:r}){this.#a=e,this.#s=new TextDecoder,this.#o=new DataView(this.#a),r&&Object.assign(this,r)}#l(e){Sr(e<Kr.bools.length,"Invalid boolean index");const r=Math.floor(e/4),n=e*2%8,i=this.#o.getUint8(r)>>n&3;return i===0?void 0:i===2}get black(){return this.#l(0)}get bold(){return this.#l(1)}get disableFontFace(){return this.#l(2)}get fontExtraProperties(){return this.#l(3)}get isInvalidPDFjsFont(){return this.#l(4)}get isType3Font(){return this.#l(5)}get italic(){return this.#l(6)}get missingFile(){return this.#l(7)}get remeasure(){return this.#l(8)}get vertical(){return this.#l(9)}#c(e){return Sr(e<Kr.numbers.length,"Invalid number index"),this.#o.getFloat64(Kr.#e+e*8)}get ascent(){return this.#c(0)}get defaultWidth(){return this.#c(1)}get descent(){return this.#c(2)}get bbox(){let e=Kr.#t;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<4;i++)n.push(this.#o.getInt16(e,!0)),e+=2;return n}get fontMatrix(){let e=Kr.#n;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<6;i++)n.push(this.#o.getFloat64(e,!0)),e+=8;return n}get defaultVMetrics(){let e=Kr.#r;if(this.#o.getUint8(e)===0)return;e+=1;const n=[];for(let i=0;i<3;i++)n.push(this.#o.getInt16(e,!0)),e+=2;return n}#f(e){Sr(e<Kr.strings.length,"Invalid string index");let r=Kr.#i+4;for(let a=0;a<e;a++)r+=this.#o.getUint32(r)+4;const n=this.#o.getUint32(r),i=new Uint8Array(n);return i.set(new Uint8Array(this.#a,r+4,n)),this.#s.decode(i)}get fallbackName(){return this.#f(0)}get loadedName(){return this.#f(1)}get mimetype(){return this.#f(2)}get name(){return this.#f(3)}get data(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);e+=4+i;const a=this.#o.getUint32(e);if(a!==0)return new Uint8Array(this.#a,e+4,a)}clearData(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);e+=4+i;const a=this.#o.getUint32(e);new Uint8Array(this.#a,e+4,a).fill(0),this.#o.setUint32(e,0)}get cssFontInfo(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);e+=4+n;const i=this.#o.getUint32(e);if(i===0)return null;const a=new Uint8Array(i);return a.set(new Uint8Array(this.#a,e+4,i)),new Ng(a.buffer)}get systemFontInfo(){let e=Kr.#i;const r=this.#o.getUint32(e);e+=4+r;const n=this.#o.getUint32(e);if(n===0)return null;const i=new Uint8Array(n);return i.set(new Uint8Array(this.#a,e+4,n)),new Og(i.buffer)}static write(e){const r=e.systemFontInfo?Og.write(e.systemFontInfo):null,n=e.cssFontInfo?Ng.write(e.cssFontInfo):null,i=new TextEncoder,a={};let s=0;for(const g of Kr.strings)a[g]=i.encode(e[g]),s+=4+a[g].length;const o=Kr.#i+4+s+4+(r?r.byteLength:0)+4+(n?n.byteLength:0)+4+(e.data?e.data.length:0),l=new ArrayBuffer(o),c=new Uint8Array(l),u=new DataView(l);let h=0;const f=Kr.bools.length;let d=0,p=0;for(let g=0;g<f;g++){const m=e[Kr.bools[g]];d|=(m===void 0?0:m?2:1)<<p,p+=2,(p===8||g===f-1)&&(u.setUint8(h++,d),d=0,p=0)}Sr(h===Kr.#e,"FontInfo.write: Boolean properties offset mismatch");for(const g of Kr.numbers)u.setFloat64(h,e[g]),h+=8;if(Sr(h===Kr.#t,"FontInfo.write: Number properties offset mismatch"),e.bbox){u.setUint8(h++,4);for(const g of e.bbox)u.setInt16(h,g,!0),h+=2}else u.setUint8(h++,0),h+=8;if(Sr(h===Kr.#n,"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){u.setUint8(h++,6);for(const g of e.fontMatrix)u.setFloat64(h,g,!0),h+=8}else u.setUint8(h++,0),h+=48;if(Sr(h===Kr.#r,"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){u.setUint8(h++,1);for(const g of e.defaultVMetrics)u.setInt16(h,g,!0),h+=2}else u.setUint8(h++,0),h+=6;Sr(h===Kr.#i,"FontInfo.write: DefaultVMetrics properties offset mismatch"),u.setUint32(Kr.#i,0),h+=4;for(const g of Kr.strings){const m=a[g],v=m.length;u.setUint32(h,v),c.set(m,h+4),h+=4+v}if(u.setUint32(Kr.#i,h-Kr.#i-4),!r)u.setUint32(h,0),h+=4;else{const g=r.byteLength;u.setUint32(h,g),Sr(h+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(r),h+4),h+=4+g}if(!n)u.setUint32(h,0),h+=4;else{const g=n.byteLength;u.setUint32(h,g),Sr(h+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(n),h+4),h+=4+g}return e.data===void 0?(u.setUint32(h,0),h+=4):(u.setUint32(h,e.data.length),c.set(e.data,h+4),h+=4+e.data.length),Sr(h<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(h)}}class Ai{static#e=0;static#t=1;static#n=2;static#r=3;static#i=4;static#a=8;static#s=12;static#o=16;constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let r,n=null,i=[],a=[],s=[],o=[],l=null,c=null;switch(e[0]){case"RadialAxial":r=e[1]==="axial"?1:2,n=e[2],s=e[3],r===1?i.push(...e[4],...e[5]):i.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":r=3,l=e[1],i=e[2],a=e[3],o=e[4]||[],n=e[6],c=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}const u=Math.floor(i.length/2),h=Math.floor(a.length/3),f=s.length,d=o.length;let p=0;for(const w of o)p+=1,p=Math.ceil(p/4)*4,p+=4+w.coords.length*4,p+=4+w.colors.length*4,w.verticesPerRow!==void 0&&(p+=4);const g=20+u*8+h*3+f*8+(n?16:0)+(c?3:0)+p,m=new ArrayBuffer(g),v=new DataView(m),y=new Uint8Array(m);v.setUint8(Ai.#e,r),v.setUint8(Ai.#t,n?1:0),v.setUint8(Ai.#n,c?1:0),v.setUint8(Ai.#r,l),v.setUint32(Ai.#i,u,!0),v.setUint32(Ai.#a,h,!0),v.setUint32(Ai.#s,f,!0),v.setUint32(Ai.#o,d,!0);let x=20;new Float32Array(m,x,u*2).set(i),x+=u*8,y.set(a,x),x+=h*3;for(const[w,_]of s)v.setFloat32(x,w,!0),x+=4,v.setUint32(x,parseInt(_.slice(1),16),!0),x+=4;if(n)for(const w of n)v.setFloat32(x,w,!0),x+=4;c&&(y.set(c,x),x+=3);for(let w=0;w<o.length;w++){const _=o[w];v.setUint8(x,_.type),x+=1,x=Math.ceil(x/4)*4,v.setUint32(x,_.coords.length,!0),x+=4,new Int32Array(m,x,_.coords.length).set(_.coords),x+=_.coords.length*4,v.setUint32(x,_.colors.length,!0),x+=4,new Int32Array(m,x,_.colors.length).set(_.colors),x+=_.colors.length*4,_.verticesPerRow!==void 0&&(v.setUint32(x,_.verticesPerRow,!0),x+=4)}return m}getIR(){const e=this.view,r=this.data[Ai.#e],n=!!this.data[Ai.#t],i=!!this.data[Ai.#n],a=e.getUint32(Ai.#i,!0),s=e.getUint32(Ai.#a,!0),o=e.getUint32(Ai.#s,!0),l=e.getUint32(Ai.#o,!0);let c=20;const u=new Float32Array(this.buffer,c,a*2);c+=a*8;const h=new Uint8Array(this.buffer,c,s*3);c+=s*3;const f=[];for(let m=0;m<o;++m){const v=e.getFloat32(c,!0);c+=4;const y=e.getUint32(c,!0);c+=4,f.push([v,`#${y.toString(16).padStart(6,"0")}`])}let d=null;if(n){d=[];for(let m=0;m<4;++m)d.push(e.getFloat32(c,!0)),c+=4}let p=null;i&&(p=new Uint8Array(this.buffer,c,3),c+=3);const g=[];for(let m=0;m<l;++m){const v=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;const y=e.getUint32(c,!0);c+=4;const x=new Int32Array(this.buffer,c,y);c+=y*4;const b=e.getUint32(c,!0);c+=4;const w=new Int32Array(this.buffer,c,b);c+=b*4;const _={type:v,coords:x,colors:w};v===zT.LATTICE&&(_.verticesPerRow=e.getUint32(c,!0),c+=4),g.push(_)}if(r===1)return["RadialAxial","axial",d,f,Array.from(u.slice(0,2)),Array.from(u.slice(2,4)),null,null];if(r===2)return["RadialAxial","radial",d,f,[u[0],u[1]],[u[3],u[4]],u[2],u[5]];if(r===3){const m=this.data[Ai.#r];let v=null;if(u.length>0){let y=u[0],x=u[0],b=u[1],w=u[1];for(let _=0;_<u.length;_+=2){const S=u[_],C=u[_+1];y=y>S?S:y,b=b>C?C:b,x=x<S?S:x,w=w<C?C:w}v=[y,b,x,w]}return["Mesh",m,u,h,g,v,d,p]}throw new Error(`Unsupported pattern kind: ${r}`)}}class oSe{static write(e){let r,n;return yi.isFloat16ArraySupported?(n=new ArrayBuffer(e.length*2),r=new Float16Array(n)):(n=new ArrayBuffer(e.length*4),r=new Float32Array(n)),r.set(e),n}#e;constructor(e){this.#e=e}get path(){return yi.isFloat16ArraySupported?new Float16Array(this.#e):new Float32Array(this.#e)}}function lSe(t){if(t instanceof URL)return t.href;if(typeof t=="string"){if(Ra)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function cSe(t){if(Ra&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return _b(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function N2(t){if(typeof t!="string")return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const WT=t=>typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,uSe=t=>typeof t=="object"&&typeof t?.name=="string",hSe=H_e.bind(null,WT,uSe);class fSe{#e=new Map;#t=Promise.resolve();postMessage(e,r){const n={data:structuredClone(e,r?{transfer:r}:null)};this.#t.then(()=>{for(const[i]of this.#e)i.call(this,n)})}addEventListener(e,r,n=null){let i=null;if(n?.signal instanceof AbortSignal){const{signal:a}=n;if(a.aborted){Jt("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,r);i=()=>a.removeEventListener("abort",s),a.addEventListener("abort",s)}this.#e.set(r,i)}removeEventListener(e,r){this.#e.get(r)?.(),this.#e.delete(r)}terminate(){for(const[,e]of this.#e)e?.();this.#e.clear()}}const O2={DATA:1,ERROR:2},Kn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function nB(){}function ps(t){if(t instanceof rf||t instanceof VT||t instanceof YO||t instanceof HS||t instanceof $8)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||rn('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new rf(t.message);case"InvalidPDFException":return new VT(t.message);case"PasswordException":return new YO(t.message,t.code);case"ResponseException":return new HS(t.message,t.status,t.missing);case"UnknownErrorException":return new $8(t.message,t.details)}return new $8(t.message,t.toString())}class qv{#e=new AbortController;constructor(e,r,n){this.sourceName=e,this.targetName=r,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){const n=e.callbackId,i=this.callbackCapabilities[n];if(!i)throw new Error(`Cannot resolve callback ${n}`);if(delete this.callbackCapabilities[n],e.callback===O2.DATA)i.resolve(e.data);else if(e.callback===O2.ERROR)i.reject(ps(e.reason));else throw new Error("Unexpected callback case");return}const r=this.actionHandler[e.action];if(!r)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const n=this.sourceName,i=e.sourceName,a=this.comObj;Promise.try(r,e.data).then(function(s){a.postMessage({sourceName:n,targetName:i,callback:O2.DATA,callbackId:e.callbackId,data:s})},function(s){a.postMessage({sourceName:n,targetName:i,callback:O2.ERROR,callbackId:e.callbackId,reason:ps(s)})});return}if(e.streamId){this.#n(e);return}r(e.data)}on(e,r){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=r}send(e,r,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:r},n)}sendWithPromise(e,r,n){const i=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:r},n)}catch(s){a.reject(s)}return a.promise}sendWithStream(e,r,n,i){const a=this.streamId++,s=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[a]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:s,targetName:o,action:e,streamId:a,data:r,desiredSize:c.desiredSize},i),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[a].pullCall=u,l.postMessage({sourceName:s,targetName:o,stream:Kn.PULL,streamId:a,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Sr(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[a].cancelCall=u,this.streamControllers[a].isClosed=!0,l.postMessage({sourceName:s,targetName:o,stream:Kn.CANCEL,streamId:a,reason:ps(c)}),u.promise}},n)}#n(e){const r=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,s=this,o=this.actionHandler[e.action],l={enqueue(c,u=1,h){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=u,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:n,targetName:i,stream:Kn.ENQUEUE,streamId:r,chunk:c},h)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:Kn.CLOSE,streamId:r}),delete s.streamSinks[r])},error(c){Sr(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:Kn.ERROR,streamId:r,reason:ps(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[r]=l,Promise.try(o,e.data,l).then(function(){a.postMessage({sourceName:n,targetName:i,stream:Kn.START_COMPLETE,streamId:r,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:Kn.START_COMPLETE,streamId:r,reason:ps(c)})})}#r(e){const r=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,s=this.streamControllers[r],o=this.streamSinks[r];switch(e.stream){case Kn.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(ps(e.reason));break;case Kn.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(ps(e.reason));break;case Kn.PULL:if(!o){a.postMessage({sourceName:n,targetName:i,stream:Kn.PULL_COMPLETE,streamId:r,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||nB).then(function(){a.postMessage({sourceName:n,targetName:i,stream:Kn.PULL_COMPLETE,streamId:r,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:Kn.PULL_COMPLETE,streamId:r,reason:ps(c)})});break;case Kn.ENQUEUE:if(Sr(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Kn.CLOSE:if(Sr(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this.#i(s,r);break;case Kn.ERROR:Sr(s,"error should have stream controller"),s.controller.error(ps(e.reason)),this.#i(s,r);break;case Kn.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(ps(e.reason)),this.#i(s,r);break;case Kn.CANCEL:if(!o)break;const l=ps(e.reason);Promise.try(o.onCancel||nB,l).then(function(){a.postMessage({sourceName:n,targetName:i,stream:Kn.CANCEL_COMPLETE,streamId:r,success:!0})},function(c){a.postMessage({sourceName:n,targetName:i,stream:Kn.CANCEL_COMPLETE,streamId:r,reason:ps(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}async#i(e,r){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[r]}destroy(){this.#e?.abort(),this.#e=null}}class wY{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,r){if(e<=0||r<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,r);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,r,n){if(!e.canvas)throw new Error("Canvas is not specified");if(r<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=r,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,r){rn("Abstract method `_createCanvas` called.")}}class dSe extends wY{constructor({ownerDocument:e=globalThis.document,enableHWA:r=!1}){super({enableHWA:r}),this._document=e}_createCanvas(e,r){const n=this._document.createElement("canvas");return n.width=e,n.height=r,n}}class _Y{constructor({baseUrl:e=null,isCompressed:r=!0}){this.baseUrl=e,this.isCompressed=r}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const r=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(r).then(n=>({cMapData:n,isCompressed:this.isCompressed})).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${r}`)})}async _fetch(e){rn("Abstract method `_fetch` called.")}}class iB extends _Y{async _fetch(e){const r=await Sb(e,this.isCompressed?"arraybuffer":"text");return r instanceof ArrayBuffer?new Uint8Array(r):_b(r)}}class SY{addFilter(e){return"none"}addHCMFilter(e,r){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,r,n,i,a){return"none"}destroy(e=!1){}}class pSe extends SY{#e;#t;#n;#r;#i;#a;#s=0;constructor({docId:e,ownerDocument:r=globalThis.document}){super(),this.#r=e,this.#i=r}get#o(){return this.#t||=new Map}get#l(){return this.#a||=new Map}get#c(){if(!this.#n){const e=this.#i.createElement("div"),{style:r}=e;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const n=this.#i.createElementNS(ru,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#n=this.#i.createElementNS(ru,"defs"),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#f(e){if(e.length===1){const l=e[0],c=new Array(256);for(let h=0;h<256;h++)c[h]=l[h]/255;const u=c.join(",");return[u,u,u]}const[r,n,i]=e,a=new Array(256),s=new Array(256),o=new Array(256);for(let l=0;l<256;l++)a[l]=r[l]/255,s[l]=n[l]/255,o[l]=i[l]/255;return[a.join(","),s.join(","),o.join(",")]}#h(e){if(this.#e===void 0){this.#e="";const r=this.#i.URL;r!==this.#i.baseURI&&(fC(r)?Jt('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=hY(r,""))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let r=this.#o.get(e);if(r)return r;const[n,i,a]=this.#f(e),s=e.length===1?n:`${n}${i}${a}`;if(r=this.#o.get(s),r)return this.#o.set(e,r),r;const o=`g_${this.#r}_transfer_map_${this.#s++}`,l=this.#h(o);this.#o.set(e,l),this.#o.set(s,l);const c=this.#g(o);return this.#p(n,i,a,c),l}addHCMFilter(e,r){const n=`${e}-${r}`,i="base";let a=this.#l.get(i);if(a?.key===n||(a?(a.filter?.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},this.#l.set(i,a)),!e||!r))return a.url;const s=this.#x(e);e=ot.makeHexColor(...s);const o=this.#x(r);if(r=ot.makeHexColor(...o),this.#c.style.color="",e==="#000000"&&r==="#ffffff"||e===r)return a.url;const l=new Array(256);for(let d=0;d<=255;d++){const p=d/255;l[d]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}const c=l.join(","),u=`g_${this.#r}_hcm_filter`,h=a.filter=this.#g(u);this.#p(c,c,c,h),this.#m(h);const f=(d,p)=>{const g=s[d]/255,m=o[d]/255,v=new Array(p+1);for(let y=0;y<=p;y++)v[y]=g+y/p*(m-g);return v.join(",")};return this.#p(f(0,5),f(1,5),f(2,5),h),a.url=this.#h(u),a.url}addAlphaFilter(e){let r=this.#o.get(e);if(r)return r;const[n]=this.#f([e]),i=`alpha_${n}`;if(r=this.#o.get(i),r)return this.#o.set(e,r),r;const a=`g_${this.#r}_alpha_map_${this.#s++}`,s=this.#h(a);this.#o.set(e,s),this.#o.set(i,s);const o=this.#g(a);return this.#v(n,o),s}addLuminosityFilter(e){let r=this.#o.get(e||"luminosity");if(r)return r;let n,i;if(e?([n]=this.#f([e]),i=`luminosity_${n}`):i="luminosity",r=this.#o.get(i),r)return this.#o.set(e,r),r;const a=`g_${this.#r}_luminosity_map_${this.#s++}`,s=this.#h(a);this.#o.set(e,s),this.#o.set(i,s);const o=this.#g(a);return this.#d(o),e&&this.#v(n,o),s}addHighlightHCMFilter(e,r,n,i,a){const s=`${r}-${n}-${i}-${a}`;let o=this.#l.get(e);if(o?.key===s||(o?(o.filter?.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},this.#l.set(e,o)),!r||!n))return o.url;const[l,c]=[r,n].map(this.#x.bind(this));let u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),h=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[f,d]=[i,a].map(this.#x.bind(this));h<u&&([u,h,f,d]=[h,u,d,f]),this.#c.style.color="";const p=(v,y,x)=>{const b=new Array(256),w=(h-u)/x,_=v/255,S=(y-v)/(255*x);let C=0;for(let T=0;T<=x;T++){const A=Math.round(u+T*w),k=_+T*S;for(let I=C;I<=A;I++)b[I]=k;C=A+1}for(let T=C;T<256;T++)b[T]=b[C-1];return b.join(",")},g=`g_${this.#r}_hcm_${e}_filter`,m=o.filter=this.#g(g);return this.#m(m),this.#p(p(f[0],d[0],5),p(f[1],d[1],5),p(f[2],d[2],5),m),o.url=this.#h(g),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#s=0)}#d(e){const r=this.#i.createElementNS(ru,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(r)}#m(e){const r=this.#i.createElementNS(ru,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(r)}#g(e){const r=this.#i.createElementNS(ru,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",e),this.#c.append(r),r}#u(e,r,n){const i=this.#i.createElementNS(ru,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",n),e.append(i)}#p(e,r,n,i){const a=this.#i.createElementNS(ru,"feComponentTransfer");i.append(a),this.#u(a,"feFuncR",e),this.#u(a,"feFuncG",r),this.#u(a,"feFuncB",n)}#v(e,r){const n=this.#i.createElementNS(ru,"feComponentTransfer");r.append(n),this.#u(n,"feFuncA",e)}#x(e){return this.#c.style.color=e,Ab(getComputedStyle(this.#c).getPropertyValue("color"))}}class CY{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const r=`${this.baseUrl}${e}`;return this._fetch(r).catch(n=>{throw new Error(`Unable to load font data at: ${r}`)})}async _fetch(e){rn("Abstract method `_fetch` called.")}}class aB extends CY{async _fetch(e){const r=await Sb(e,"arraybuffer");return new Uint8Array(r)}}class AY{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const r=`${this.baseUrl}${e}`;return this._fetch(r).catch(n=>{throw new Error(`Unable to load wasm data at: ${r}`)})}async _fetch(e){rn("Abstract method `_fetch` called.")}}class sB extends AY{async _fetch(e){const r=await Sb(e,"arraybuffer");return new Uint8Array(r)}}Ra&&Jt("Please use the `legacy` build in Node.js environments.");async function xD(t){const r=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(r)}class gSe extends SY{}class mSe extends wY{_createCanvas(e,r){return process.getBuiltinModule("module").createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:Ig&&Ig.tagName.toUpperCase()==="SCRIPT"&&Ig.src||new URL("index-BglI_ler.cjs",document.baseURI).href)("@napi-rs/canvas").createCanvas(e,r)}}class vSe extends _Y{async _fetch(e){return xD(e)}}class ySe extends CY{async _fetch(e){return xD(e)}}class xSe extends AY{async _fetch(e){return xD(e)}}const _p="__forcedDependency",{floor:oB,ceil:lB}=Math;function B2(t,e,r,n,i,a){t[e*4+0]=Math.min(t[e*4+0],r),t[e*4+1]=Math.min(t[e*4+1],n),t[e*4+2]=Math.max(t[e*4+2],i),t[e*4+3]=Math.max(t[e*4+3],a)}const qT=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class bSe{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===qT}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}}const F2=(t,e)=>{if(!t)return;let r=t.get(e);return r||(r={dependencies:new Set,isRenderingOperation:!1},t.set(e,r)),r};class wSe{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[_p]:[]};#n=new Map;#r=[];#i=[];#a=[[1,0,0,1,0,0]];#s=[-1/0,-1/0,1/0,1/0];#o=new Float64Array([1/0,1/0,-1/0,-1/0]);#l=-1;#c=new Set;#f=new Map;#h=new Map;#d;#m;#g;#u;#p;constructor(e,r,n=!1){this.#d=e.width,this.#m=e.height,this.#v(r),n&&(this.#p=new Map)}growOperationsCount(e){e>=this.#u.length&&this.#v(e,this.#u)}#v(e,r){const n=new ArrayBuffer(e*4);this.#g=new Uint8ClampedArray(n),this.#u=new Uint32Array(n),r&&r.length>0?(this.#u.set(r),this.#u.fill(qT,r.length)):this.#u.fill(qT)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[_p]:{__proto__:this.#t[_p]}},this.#s={__proto__:this.#s},this.#r.push(e),this}restore(e){const r=Object.getPrototypeOf(this.#e);if(r===null)return this;this.#e=r,this.#t=Object.getPrototypeOf(this.#t),this.#s=Object.getPrototypeOf(this.#s);const n=this.#r.pop();return n!==void 0&&(F2(this.#p,e)?.dependencies.add(n),this.#u[e]=this.#u[n]),this}recordOpenMarker(e){return this.#r.push(e),this}getOpenMarker(){return this.#r.length===0?null:this.#r.at(-1)}recordCloseMarker(e){const r=this.#r.pop();return r!==void 0&&(F2(this.#p,e)?.dependencies.add(r),this.#u[e]=this.#u[r]),this}beginMarkedContent(e){return this.#i.push(e),this}endMarkedContent(e){const r=this.#i.pop();return r!==void 0&&(F2(this.#p,e)?.dependencies.add(r),this.#u[e]=this.#u[r]),this}pushBaseTransform(e){return this.#a.push(ot.multiplyByDOMMatrix(this.#a.at(-1),e.getTransform())),this}popBaseTransform(){return this.#a.length>1&&this.#a.pop(),this}recordSimpleData(e,r){return this.#e[e]=r,this}recordIncrementalData(e,r){return this.#t[e].push(r),this}resetIncrementalData(e,r){return this.#t[e].length=0,this}recordNamedData(e,r){return this.#n.set(e,r),this}recordSimpleDataFromNamed(e,r,n){this.#e[e]=this.#n.get(r)??n}recordFutureForcedDependency(e,r){return this.recordIncrementalData(_p,r),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const r of e)r in this.#e&&this.recordFutureForcedDependency(r,this.#e[r]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of this.#c)this.recordFutureForcedDependency(_p,e);return this}resetBBox(e){return this.#l!==e&&(this.#l=e,this.#o[0]=1/0,this.#o[1]=1/0,this.#o[2]=-1/0,this.#o[3]=-1/0),this}recordClipBox(e,r,n,i,a,s){const o=ot.multiplyByDOMMatrix(this.#a.at(-1),r.getTransform()),l=[1/0,1/0,-1/0,-1/0];ot.axialAlignedBoundingBox([n,a,i,s],o,l);const c=ot.intersect(this.#s,l);return c?(this.#s[0]=c[0],this.#s[1]=c[1],this.#s[2]=c[2],this.#s[3]=c[3]):(this.#s[0]=this.#s[1]=1/0,this.#s[2]=this.#s[3]=-1/0),this}recordBBox(e,r,n,i,a,s){const o=this.#s;if(o[0]===1/0)return this;const l=ot.multiplyByDOMMatrix(this.#a.at(-1),r.getTransform());if(o[0]===-1/0)return ot.axialAlignedBoundingBox([n,a,i,s],l,this.#o),this;const c=[1/0,1/0,-1/0,-1/0];return ot.axialAlignedBoundingBox([n,a,i,s],l,c),this.#o[0]=Math.min(this.#o[0],Math.max(c[0],o[0])),this.#o[1]=Math.min(this.#o[1],Math.max(c[1],o[1])),this.#o[2]=Math.max(this.#o[2],Math.min(c[2],o[2])),this.#o[3]=Math.max(this.#o[3],Math.min(c[3],o[3])),this}recordCharacterBBox(e,r,n,i=1,a=0,s=0,o){const l=n.bbox;let c,u;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&this.#h.get(n),c!==!1&&(u=[0,0,0,0],ot.axialAlignedBoundingBox(l,n.fontMatrix,u),(i!==1||a!==0||s!==0)&&ot.scaleMinMax([i,0,0,-i,a,s],u),c)))return this.recordBBox(e,r,u[0],u[2],u[1],u[3]);if(!o)return this.recordFullPageBBox(e);const h=o();return l&&u&&c===void 0&&(c=u[0]<=a-h.actualBoundingBoxLeft&&u[2]>=a+h.actualBoundingBoxRight&&u[1]<=s-h.actualBoundingBoxAscent&&u[3]>=s+h.actualBoundingBoxDescent,this.#h.set(n,c),c)?this.recordBBox(e,r,u[0],u[2],u[1],u[3]):this.recordBBox(e,r,a-h.actualBoundingBoxLeft,a+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#o[0]=Math.max(0,this.#s[0]),this.#o[1]=Math.max(0,this.#s[1]),this.#o[2]=Math.min(this.#d,this.#s[2]),this.#o[3]=Math.min(this.#m,this.#s[3]),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,r){const n=this.#c,i=this.#e,a=this.#t;for(const s of r)s in this.#e?n.add(i[s]):s in a&&a[s].forEach(n.add,n);return this}recordNamedDependency(e,r){return this.#n.has(r)&&this.#c.add(this.#n.get(r)),this}recordOperation(e,r=!1){if(this.recordDependencies(e,[_p]),this.#p){const n=F2(this.#p,e),{dependencies:i}=n;this.#c.forEach(i.add,i),this.#r.forEach(i.add,i),this.#i.forEach(i.add,i),i.delete(e),n.isRenderingOperation=!0}if(this.#l===e){const n=oB(this.#o[0]*256/this.#d),i=oB(this.#o[1]*256/this.#m),a=lB(this.#o[2]*256/this.#d),s=lB(this.#o[3]*256/this.#m);B2(this.#g,e,n,i,a,s);for(const o of this.#c)o!==e&&B2(this.#g,o,n,i,a,s);for(const o of this.#r)o!==e&&B2(this.#g,o,n,i,a,s);for(const o of this.#i)o!==e&&B2(this.#g,o,n,i,a,s);r||(this.#c.clear(),this.#l=-1)}return this}recordShowTextOperation(e,r=!1){const n=Array.from(this.#c);this.recordOperation(e,r),this.recordIncrementalData("sameLineText",e);for(const i of n)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(e,r=!1){return this.#l===e&&(this.#l=-1,this.#s[0]=Math.max(this.#s[0],this.#o[0]),this.#s[1]=Math.max(this.#s[1],this.#o[1]),this.#s[2]=Math.min(this.#s[2],this.#o[2]),this.#s[3]=Math.min(this.#s[3],this.#o[3]),r||this.#c.clear()),this}_takePendingDependencies(){const e=this.#c;return this.#c=new Set,e}_extractOperation(e){const r=this.#f.get(e);return this.#f.delete(e),r}_pushPendingDependencies(e){for(const r of e)this.#c.add(r)}take(){return this.#h.clear(),new bSe(this.#u,this.#g)}takeDebugMetadata(){return this.#p}}class GS{#e;#t;#n;#r=0;#i=0;constructor(e,r,n){if(e instanceof GS&&e.#n===!!n)return e;this.#e=e,this.#t=r,this.#n=!!n}growOperationsCount(){throw new Error("Unreachable")}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,r){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,r){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,r){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,r){return this}recordSimpleDataFromNamed(e,r,n){return this.#e.recordSimpleDataFromNamed(e,r,this.#t),this}recordFutureForcedDependency(e,r){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,r,n,i,a,s){return this.#n||this.#e.recordClipBox(this.#t,r,n,i,a,s),this}recordBBox(e,r,n,i,a,s){return this.#n||this.#e.recordBBox(this.#t,r,n,i,a,s),this}recordCharacterBBox(e,r,n,i,a,s,o){return this.#n||this.#e.recordCharacterBBox(this.#t,r,n,i,a,s,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,r){return this.#e.recordDependencies(this.#t,r),this}recordNamedDependency(e,r){return this.#e.recordNamedDependency(this.#t,r),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const ao={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},ra={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function XT(t,e){if(!e)return;const r=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],r,n),t.clip(i)}class bD{isModifyingCurrentTransform(){return!1}getPattern(){rn("Abstract method `getPattern` called.")}}class _Se extends bD{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}_createGradient(e,r=null){let n,i=this._p0,a=this._p1;if(r&&(i=i.slice(),a=a.slice(),ot.applyTransform(i,r),ot.applyTransform(a,r)),this._type==="axial")n=e.createLinearGradient(i[0],i[1],a[0],a[1]);else if(this._type==="radial"){let s=this._r0,o=this._r1;if(r){const l=new Float32Array(2);ot.singularValueDecompose2dScale(r,l),s*=l[0],o*=l[0]}n=e.createRadialGradient(i[0],i[1],s,a[0],a[1],o)}for(const s of this._colorStops)n.addColorStop(s[0],s[1]);return n}getPattern(e,r,n,i){let a;if(i===ra.STROKE||i===ra.FILL){if(this.isOriginBased()){let f=ot.transform(n,r.baseTransform);this.matrix&&(f=ot.transform(f,this.matrix));const d=.001,p=Math.hypot(f[0],f[1]),g=Math.hypot(f[2],f[3]),m=(f[0]*f[2]+f[1]*f[3])/(p*g);if(Math.abs(m)<d)if(this.isRadial()){if(Math.abs(p-g)<d)return this._createGradient(e,f)}else return this._createGradient(e,f)}const s=r.current.getClippedPathBoundingBox(i,_n(e))||[0,0,0,0],o=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,c=r.cachedCanvases.getCanvas("pattern",o,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-s[0],-s[1]),n=ot.transform(n,[1,0,0,1,s[0],s[1]]),u.transform(...r.baseTransform),this.matrix&&u.transform(...this.matrix),XT(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),a=e.createPattern(c.canvas,"no-repeat");const h=new DOMMatrix(n);a.setTransform(h)}else XT(e,this._bbox),a=this._createGradient(e);return a}}function U8(t,e,r,n,i,a,s,o){const l=e.coords,c=e.colors,u=t.data,h=t.width*4;let f;l[r+1]>l[n+1]&&(f=r,r=n,n=f,f=a,a=s,s=f),l[n+1]>l[i+1]&&(f=n,n=i,i=f,f=s,s=o,o=f),l[r+1]>l[n+1]&&(f=r,r=n,n=f,f=a,a=s,s=f);const d=(l[r]+e.offsetX)*e.scaleX,p=(l[r+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[i]+e.offsetX)*e.scaleX,y=(l[i+1]+e.offsetY)*e.scaleY;if(p>=y)return;const x=c[a],b=c[a+1],w=c[a+2],_=c[s],S=c[s+1],C=c[s+2],T=c[o],A=c[o+1],k=c[o+2],I=Math.round(p),E=Math.round(y);let M,R,D,L,P,O,$,N;for(let U=I;U<=E;U++){if(U<m){const X=U<p?0:(p-U)/(p-m);M=d-(d-g)*X,R=x-(x-_)*X,D=b-(b-S)*X,L=w-(w-C)*X}else{let X;U>y?X=1:m===y?X=0:X=(m-U)/(m-y),M=g-(g-v)*X,R=_-(_-T)*X,D=S-(S-A)*X,L=C-(C-k)*X}let j;U<p?j=0:U>y?j=1:j=(p-U)/(p-y),P=d-(d-v)*j,O=x-(x-T)*j,$=b-(b-A)*j,N=w-(w-k)*j;const B=Math.round(Math.min(M,P)),q=Math.round(Math.max(M,P));let W=h*U+B*4;for(let X=B;X<=q;X++)j=(M-X)/(M-P),j<0?j=0:j>1&&(j=1),u[W++]=R-(R-O)*j|0,u[W++]=D-(D-$)*j|0,u[W++]=L-(L-N)*j|0,u[W++]=255}}function SSe(t,e,r){const n=e.coords,i=e.colors;let a,s;switch(e.type){case zT.LATTICE:const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a<l;a++){let u=a*o;for(let h=0;h<c;h++,u++)U8(t,r,n[u],n[u+1],n[u+o],i[u],i[u+1],i[u+o]),U8(t,r,n[u+o+1],n[u+1],n[u+o],i[u+o+1],i[u+1],i[u+o])}break;case zT.TRIANGLES:for(a=0,s=n.length;a<s;a+=3)U8(t,r,n[a],n[a+1],n[a+2],i[a],i[a+1],i[a+2]);break;default:throw new Error("illegal figure")}}class CSe extends bD{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,r,n){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,u=Math.ceil(this._bounds[3])-l,h=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(u*e[1]*1.1)),3e3),d=c/h,p=u/f,g={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/d,scaleY:1/p},m=h+4,v=f+4,y=n.getCanvas("mesh",m,v),x=y.context,b=x.createImageData(h,f);if(r){const _=b.data;for(let S=0,C=_.length;S<C;S+=4)_[S]=r[0],_[S+1]=r[1],_[S+2]=r[2],_[S+3]=255}for(const _ of this._figures)SSe(b,_,g);return x.putImageData(b,2,2),{canvas:y.canvas,offsetX:o-2*d,offsetY:l-2*p,scaleX:d,scaleY:p}}isModifyingCurrentTransform(){return!0}getPattern(e,r,n,i){XT(e,this._bbox);const a=new Float32Array(2);if(i===ra.SHADING)ot.singularValueDecompose2dScale(_n(e),a);else if(this.matrix){ot.singularValueDecompose2dScale(this.matrix,a);const[o,l]=a;ot.singularValueDecompose2dScale(r.baseTransform,a),a[0]*=o,a[1]*=l}else ot.singularValueDecompose2dScale(r.baseTransform,a);const s=this._createMeshCanvas(a,i===ra.SHADING?null:this._background,r.cachedCanvases);return i!==ra.SHADING&&(e.setTransform(...r.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class ASe extends bD{getPattern(){return"hotpink"}}function TSe(t){switch(t[0]){case"RadialAxial":return new _Se(t);case"Mesh":return new CSe(t);case"Dummy":return new ASe}throw new Error(`Unknown IR type: ${t[0]}`)}const cB={COLORED:1,UNCOLORED:2};class wD{static MAX_PATTERN_SIZE=3e3;constructor(e,r,n,i){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=r,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(e,r){const{bbox:n,operatorList:i,paintType:a,tilingType:s,color:o,canvasGraphicsFactory:l}=this;let{xstep:c,ystep:u}=this;c=Math.abs(c),u=Math.abs(u),hC("TilingType: "+s);const h=n[0],f=n[1],d=n[2],p=n[3],g=d-h,m=p-f,v=new Float32Array(2);ot.singularValueDecompose2dScale(this.matrix,v);const[y,x]=v;ot.singularValueDecompose2dScale(this.baseTransform,v);const b=y*v[0],w=x*v[1];let _=g,S=m,C=!1,T=!1;const A=Math.ceil(c*b),k=Math.ceil(u*w),I=Math.ceil(g*b),E=Math.ceil(m*w);A>=I?_=c:C=!0,k>=E?S=u:T=!0;const M=this.getSizeAndScale(_,this.ctx.canvas.width,b),R=this.getSizeAndScale(S,this.ctx.canvas.height,w),D=e.cachedCanvases.getCanvas("pattern",M.size,R.size),L=D.context,P=l.createCanvasGraphics(L,r);if(P.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(P,a,o),L.translate(-M.scale*h,-R.scale*f),P.transform(0,M.scale,0,0,R.scale,0,0),L.save(),P.dependencyTracker?.save(),this.clipBbox(P,h,f,d,p),P.baseTransform=_n(P.ctx),P.executeOperatorList(i),P.endDrawing(),P.dependencyTracker?.restore(),L.restore(),C||T){const O=D.canvas;C&&(_=c),T&&(S=u);const $=this.getSizeAndScale(_,this.ctx.canvas.width,b),N=this.getSizeAndScale(S,this.ctx.canvas.height,w),U=$.size,j=N.size,B=e.cachedCanvases.getCanvas("pattern-workaround",U,j),q=B.context,W=C?Math.floor(g/c):0,X=T?Math.floor(m/u):0;for(let K=0;K<=W;K++)for(let G=0;G<=X;G++)q.drawImage(O,U*K,j*G,U,j,0,0,U,j);return{canvas:B.canvas,scaleX:$.scale,scaleY:N.scale,offsetX:h,offsetY:f}}return{canvas:D.canvas,scaleX:M.scale,scaleY:R.scale,offsetX:h,offsetY:f}}getSizeAndScale(e,r,n){const i=Math.max(wD.MAX_PATTERN_SIZE,r);let a=Math.ceil(e*n);return a>=i?a=i:n=a/e,{scale:n,size:a}}clipBbox(e,r,n,i,a){const s=i-r,o=a-n;e.ctx.rect(r,n,s,o),ot.axialAlignedBoundingBox([r,n,i,a],_n(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,r,n){const i=e.ctx,a=e.current;switch(r){case cB.COLORED:const{fillStyle:s,strokeStyle:o}=this.ctx;i.fillStyle=a.fillColor=s,i.strokeStyle=a.strokeColor=o;break;case cB.UNCOLORED:i.fillStyle=i.strokeStyle=n,a.fillColor=a.strokeColor=n;break;default:throw new F_e(`Unsupported paint type: ${r}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,r,n,i,a){let s=n;i!==ra.SHADING&&(s=ot.transform(s,r.baseTransform),this.matrix&&(s=ot.transform(s,this.matrix)));const o=this.createPatternCanvas(r,a);let l=new DOMMatrix(s);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}function kSe({src:t,srcPos:e=0,dest:r,width:n,height:i,nonBlackColor:a=4294967295,inverseDecode:s=!1}){const o=yi.isLittleEndian?4278190080:255,[l,c]=s?[a,o]:[o,a],u=n>>3,h=n&7,f=t.length;r=new Uint32Array(r.buffer);let d=0;for(let p=0;p<i;p++){for(const m=e+u;e<m;e++){const v=e<f?t[e]:255;r[d++]=v&128?c:l,r[d++]=v&64?c:l,r[d++]=v&32?c:l,r[d++]=v&16?c:l,r[d++]=v&8?c:l,r[d++]=v&4?c:l,r[d++]=v&2?c:l,r[d++]=v&1?c:l}if(h===0)continue;const g=e<f?t[e++]:255;for(let m=0;m<h;m++)r[d++]=g&1<<7-m?c:l}return{srcPos:e,destPos:d}}const uB=16,hB=100,ESe=15,fB=10,vs=16,j8=new DOMMatrix,Fs=new Float32Array(2),xg=new Float32Array([1/0,1/0,-1/0,-1/0]);function ISe(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(r,n){e.translate(r,n),this.__originalTranslate(r,n)},t.scale=function(r,n){e.scale(r,n),this.__originalScale(r,n)},t.transform=function(r,n,i,a,s,o){e.transform(r,n,i,a,s,o),this.__originalTransform(r,n,i,a,s,o)},t.setTransform=function(r,n,i,a,s,o){e.setTransform(r,n,i,a,s,o),this.__originalSetTransform(r,n,i,a,s,o)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(r){e.rotate(r),this.__originalRotate(r)},t.clip=function(r){e.clip(r),this.__originalClip(r)},t.moveTo=function(r,n){e.moveTo(r,n),this.__originalMoveTo(r,n)},t.lineTo=function(r,n){e.lineTo(r,n),this.__originalLineTo(r,n)},t.bezierCurveTo=function(r,n,i,a,s,o){e.bezierCurveTo(r,n,i,a,s,o),this.__originalBezierCurveTo(r,n,i,a,s,o)},t.rect=function(r,n,i,a){e.rect(r,n,i,a),this.__originalRect(r,n,i,a)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class DSe{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,r,n){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,r,n)):(i=this.canvasFactory.create(r,n),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const r=this.cache[e];this.canvasFactory.destroy(r),delete this.cache[e]}}}function $2(t,e,r,n,i,a,s,o,l,c){const[u,h,f,d,p,g]=_n(t);if(h===0&&f===0){const y=s*u+p,x=Math.round(y),b=o*d+g,w=Math.round(b),_=(s+l)*u+p,S=Math.abs(Math.round(_)-x)||1,C=(o+c)*d+g,T=Math.abs(Math.round(C)-w)||1;return t.setTransform(Math.sign(u),0,0,Math.sign(d),x,w),t.drawImage(e,r,n,i,a,0,0,S,T),t.setTransform(u,h,f,d,p,g),[S,T]}if(u===0&&d===0){const y=o*f+p,x=Math.round(y),b=s*h+g,w=Math.round(b),_=(o+c)*f+p,S=Math.abs(Math.round(_)-x)||1,C=(s+l)*h+g,T=Math.abs(Math.round(C)-w)||1;return t.setTransform(0,Math.sign(h),Math.sign(f),0,x,w),t.drawImage(e,r,n,i,a,0,0,T,S),t.setTransform(u,h,f,d,p,g),[T,S]}t.drawImage(e,r,n,i,a,s,o,l,c);const m=Math.hypot(u,h),v=Math.hypot(f,d);return[m*l,v*c]}class dB{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=$T;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=di.FILL;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(e,r,n){n?.(this),this.clipBox=new Float32Array([0,0,e,r]),this.minMax=xg.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=ra.FILL,r=null){const n=this.minMax.slice();if(e===ra.STROKE){r||rn("Stroke bounding box must include transform."),ot.singularValueDecompose2dScale(r,Fs);const i=Fs[0]*this.lineWidth/2,a=Fs[1]*this.lineWidth/2;n[0]-=i,n[1]-=a,n[2]+=i,n[3]+=a}return n}updateClipFromPath(){const e=ot.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(xg,0)}getClippedPathBoundingBox(e=ra.FILL,r=null){return ot.intersect(this.clipBox,this.getPathBoundingBox(e,r))}}function pB(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const r=e.height,n=e.width,i=r%vs,a=(r-i)/vs,s=i===0?a:a+1,o=t.createImageData(n,vs);let l=0,c;const u=e.data,h=o.data;let f,d,p,g;if(e.kind===k_.GRAYSCALE_1BPP){const m=u.byteLength,v=new Uint32Array(h.buffer,0,h.byteLength>>2),y=v.length,x=n+7>>3,b=4294967295,w=yi.isLittleEndian?4278190080:255;for(f=0;f<s;f++){for(p=f<a?vs:i,c=0,d=0;d<p;d++){const _=m-l;let S=0;const C=_>x?n:_*8-7,T=C&-8;let A=0,k=0;for(;S<T;S+=8)k=u[l++],v[c++]=k&128?b:w,v[c++]=k&64?b:w,v[c++]=k&32?b:w,v[c++]=k&16?b:w,v[c++]=k&8?b:w,v[c++]=k&4?b:w,v[c++]=k&2?b:w,v[c++]=k&1?b:w;for(;S<C;S++)A===0&&(k=u[l++],A=128),v[c++]=k&A?b:w,A>>=1}for(;c<y;)v[c++]=0;t.putImageData(o,0,f*vs)}}else if(e.kind===k_.RGBA_32BPP){for(d=0,g=n*vs*4,f=0;f<a;f++)h.set(u.subarray(l,l+g)),l+=g,t.putImageData(o,0,d),d+=vs;f<s&&(g=n*i*4,h.set(u.subarray(l,l+g)),t.putImageData(o,0,d))}else if(e.kind===k_.RGB_24BPP)for(p=vs,g=n*p,f=0;f<s;f++){for(f>=a&&(p=i,g=n*p),c=0,d=g;d--;)h[c++]=u[l++],h[c++]=u[l++],h[c++]=u[l++],h[c++]=255;t.putImageData(o,0,f*vs)}else throw new Error(`bad image kind: ${e.kind}`)}function gB(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const r=e.height,n=e.width,i=r%vs,a=(r-i)/vs,s=i===0?a:a+1,o=t.createImageData(n,vs);let l=0;const c=e.data,u=o.data;for(let h=0;h<s;h++){const f=h<a?vs:i;({srcPos:l}=kSe({src:c,srcPos:l,dest:u,width:n,height:f,nonBlackColor:0})),t.putImageData(o,0,h*vs)}}function G1(t,e){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)t[n]!==void 0&&(e[n]=t[n]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function z2(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}function mB(t,e){if(e)return!0;ot.singularValueDecompose2dScale(t,Fs);const r=Math.fround(Ac.pixelRatio*mm.PDF_TO_CSS_UNITS);return Fs[0]<=r&&Fs[1]<=r}const MSe=["butt","round","square"],LSe=["miter","round","bevel"],PSe={},vB={};class Bg{constructor(e,r,n,i,a,{optionalContentConfig:s,markedContentStack:o=null},l,c,u){this.ctx=e,this.current=new dB(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=r,this.objs=n,this.canvasFactory=i,this.filterFactory=a,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=s,this.cachedCanvases=new DSe(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=u??null}getObject(e,r,n=null){return typeof r=="string"?(this.dependencyTracker?.recordNamedDependency(e,r),r.startsWith("g_")?this.commonObjs.get(r):this.objs.get(r)):n}beginDrawing({transform:e,viewport:r,transparency:n=!1,background:i=null}){const a=this.ctx.canvas.width,s=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,a,s),this.ctx.fillStyle=o,n){const l=this.cachedCanvases.getCanvas("transparent",a,s);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(..._n(this.compositeCtx))}this.ctx.save(),z2(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=_n(this.ctx)}executeOperatorList(e,r,n,i,a){const s=e.argsArray,o=e.fnArray;let l=r||0;const c=s.length;if(c===l)return l;const u=c-l>fB&&typeof n=="function",h=u?Date.now()+ESe:0;let f=0;const d=this.commonObjs,p=this.objs;let g,m;for(;;){if(i!==void 0&&l===i.nextBreakPoint)return i.breakIt(l,n),l;if(!a||a(l))if(g=o[l],m=s[l]??null,g!==yx.dependency)m===null?this[g](l):this[g](l,...m);else for(const v of m){this.dependencyTracker?.recordNamedData(v,l);const y=v.startsWith("g_")?d:p;if(!y.has(v))return y.get(v,n),l}if(l++,l===c)return l;if(u&&++f>fB){if(Date.now()>h)return n(),l;f=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const r of e.values())typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&(r.width=r.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const r=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=r}}}_scaleImage(e,r){const n=e.width??e.displayWidth,i=e.height??e.displayHeight;let a=Math.max(Math.hypot(r[0],r[1]),1),s=Math.max(Math.hypot(r[2],r[3]),1),o=n,l=i,c="prescale1",u,h;for(;a>2&&o>1||s>2&&l>1;){let f=o,d=l;a>2&&o>1&&(f=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),a/=o/f),s>2&&l>1&&(d=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/d),u=this.cachedCanvases.getCanvas(c,f,d),h=u.context,h.clearRect(0,0,f,d),h.drawImage(e,0,0,o,l,0,0,f,d),e=u.canvas,o=f,l=d,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e,r){const n=this.ctx,{width:i,height:a}=r,s=this.current.fillColor,o=this.current.patternFill,l=_n(n);let c,u,h,f;if((r.bitmap||r.data)&&r.count>1){const A=r.bitmap||r.data.buffer;u=JSON.stringify(o?l:[l.slice(0,4),s]),c=this._cachedBitmapsMap.get(A),c||(c=new Map,this._cachedBitmapsMap.set(A,c));const k=c.get(u);if(k&&!o){const I=Math.round(Math.min(l[0],l[2])+l[4]),E=Math.round(Math.min(l[1],l[3])+l[5]);return this.dependencyTracker?.recordDependencies(e,ao.transformAndFill),{canvas:k,offsetX:I,offsetY:E}}h=k}h||(f=this.cachedCanvases.getCanvas("maskCanvas",i,a),gB(f.context,r));let d=ot.transform(l,[1/i,0,0,-1/a,0,0]);d=ot.transform(d,[1,0,0,1,0,-a]);const p=xg.slice();ot.axialAlignedBoundingBox([0,0,i,a],d,p);const[g,m,v,y]=p,x=Math.round(v-g)||1,b=Math.round(y-m)||1,w=this.cachedCanvases.getCanvas("fillCanvas",x,b),_=w.context,S=g,C=m;_.translate(-S,-C),_.transform(...d),h||(h=this._scaleImage(f.canvas,Pl(_)),h=h.img,c&&o&&c.set(u,h)),_.imageSmoothingEnabled=mB(_n(_),r.interpolate),$2(_,h,0,0,h.width,h.height,0,0,i,a),_.globalCompositeOperation="source-in";const T=ot.transform(Pl(_),[1,0,0,1,-S,-C]);return _.fillStyle=o?s.getPattern(n,this,T,ra.FILL,e):s,_.fillRect(0,0,i,a),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(u,w.canvas)),this.dependencyTracker?.recordDependencies(e,ao.transformAndFill),{canvas:w.canvas,offsetX:Math.round(S),offsetY:Math.round(C)}}setLineWidth(e,r){this.dependencyTracker?.recordSimpleData("lineWidth",e),r!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=r,this.ctx.lineWidth=r}setLineCap(e,r){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=MSe[r]}setLineJoin(e,r){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=LSe[r]}setMiterLimit(e,r){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=r}setDash(e,r,n){this.dependencyTracker?.recordSimpleData("dash",e);const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(r),i.lineDashOffset=n)}setRenderingIntent(e,r){}setFlatness(e,r){}setGState(e,r){for(const[n,i]of r)switch(n){case"LW":this.setLineWidth(e,i);break;case"LC":this.setLineCap(e,i);break;case"LJ":this.setLineJoin(e,i);break;case"ML":this.setMiterLimit(e,i);break;case"D":this.setDash(e,i[0],i[1]);break;case"RI":this.setRenderingIntent(e,i);break;case"FL":this.setFlatness(e,i);break;case"Font":this.setFont(e,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const r=this.ctx.canvas.width,n=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,r,n);this.suspendedCtx=this.ctx;const s=this.ctx=a.context;s.setTransform(this.suspendedCtx.getTransform()),G1(this.suspendedCtx,s),ISe(s,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),G1(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const r=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,r,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,r,n,i){const a=i[0],s=i[1],o=i[2]-a,l=i[3]-s;o===0||l===0||(this.genericComposeSMask(r.context,n,o,l,r.subtype,r.backdrop,r.transferMap,a,s,r.offsetX,r.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,r,n,i,a,s,o,l,c,u,h){let f=e.canvas,d=l-u,p=c-h;if(s)if(d<0||p<0||d+n>f.width||p+i>f.height){const m=this.cachedCanvases.getCanvas("maskExtension",n,i),v=m.context;v.drawImage(f,-d,-p),v.globalCompositeOperation="destination-atop",v.fillStyle=s,v.fillRect(0,0,n,i),v.globalCompositeOperation="source-over",f=m.canvas,d=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const m=new Path2D;m.rect(d,p,n,i),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(d,p,n,i),e.restore()}r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0),a==="Alpha"&&o?r.filter=this.filterFactory.addAlphaFilter(o):a==="Luminosity"&&(r.filter=this.filterFactory.addLuminosityFilter(o));const g=new Path2D;g.rect(l,c,n,i),r.clip(g),r.globalCompositeOperation="destination-in",r.drawImage(f,d,p,n,i,l,c,n,i),r.restore()}save(e){this.inSMaskMode&&G1(this.ctx,this.suspendedCtx),this.ctx.save();const r=this.current;this.stateStack.push(r),this.current=r.clone(),this.dependencyTracker?.save(e)}restore(e){if(this.dependencyTracker?.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&G1(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,r,n,i,a,s,o){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(r,n,i,a,s,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,r,n,i){let[a]=n;if(!i){a||=n[0]=new Path2D,this[r](e,a);return}if(this.dependencyTracker!==null){const s=r===yx.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,i[0]-s,i[2]+s,i[1]-s,i[3]+s).recordDependencies(e,["transform"])}a instanceof Path2D||(a=n[0]=vY(a)),ot.axialAlignedBoundingBox(i,_n(this.ctx),this.current.minMax),this[r](e,a),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,r,n=!0){const i=this.ctx,a=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof a=="object"&&a?.getPattern){const s=a.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=a.getPattern(i,this,Pl(i),ra.STROKE,e),s){const o=new Path2D;o.addPath(r,i.getTransform().invertSelf().multiplySelf(s)),r=o}this.rescaleAndStroke(r,!1),i.restore()}else this.rescaleAndStroke(r,!0);this.dependencyTracker?.recordDependencies(e,ao.stroke),n&&this.consumePath(e,r,this.current.getClippedPathBoundingBox(ra.STROKE,_n(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(e,r){this.stroke(e,r)}fill(e,r,n=!0){const i=this.ctx,a=this.current.fillColor,s=this.current.patternFill;let o=!1;if(s){const c=a.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=a.getPattern(i,this,Pl(i),ra.FILL,e),c){const u=new Path2D;u.addPath(r,i.getTransform().invertSelf().multiplySelf(c)),r=u}o=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(i.fill(r,"evenodd"),this.pendingEOFill=!1):i.fill(r)),this.dependencyTracker?.recordDependencies(e,ao.fill),o&&(i.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,r,l)}eoFill(e,r){this.pendingEOFill=!0,this.fill(e,r)}fillStroke(e,r){this.fill(e,r,!1),this.stroke(e,r,!1),this.consumePath(e,r)}eoFillStroke(e,r){this.pendingEOFill=!0,this.fillStroke(e,r)}closeFillStroke(e,r){this.fillStroke(e,r)}closeEOFillStroke(e,r){this.pendingEOFill=!0,this.fillStroke(e,r)}endPath(e,r){this.consumePath(e,r)}rawFillPath(e,r){this.ctx.fill(r),this.dependencyTracker?.recordDependencies(e,ao.rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=PSe}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=vB}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){const r=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;r!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",e),i.recordCloseMarker(e)}if(r!==void 0){const i=new Path2D,a=n.getTransform().invertSelf();for(const{transform:s,x:o,y:l,fontSize:c,path:u}of r)u&&i.addPath(u,new DOMMatrix(s).preMultiplySelf(a).translate(o,l).scale(c,-c));n.clip(i)}delete this.pendingTextPaths}setCharSpacing(e,r){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=r}setWordSpacing(e,r){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=r}setHScale(e,r){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=r/100}setLeading(e,r){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-r}setFont(e,r,n){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",r,e);const i=this.commonObjs.get(r),a=this.current;if(!i)throw new Error(`Can't find font for ${r}`);if(a.fontMatrix=i.fontMatrix||$T,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Jt("Invalid font matrix for font "+r),n<0?(n=-n,a.fontDirection=-1):a.fontDirection=1,this.current.font=i,this.current.fontSize=n,i.isType3Font)return;const s=i.loadedName||"sans-serif",o=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let l="normal";i.black?l="900":i.bold&&(l="bold");const c=i.italic?"italic":"normal";let u=n;n<uB?u=uB:n>hB&&(u=hB),this.current.fontSizeScale=n/u,this.ctx.font=`${c} ${l} ${u}px ${o}`}setTextRenderingMode(e,r){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=r}setTextRise(e,r){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=r}moveText(e,r,n){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=r,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,r,n){this.setLeading(e,-n),this.moveText(e,r,n)}setTextMatrix(e,r){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);const{current:n}=this;n.textMatrix=r,n.textMatrixScale=Math.hypot(r[0],r[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}#n(e,r,n){const i=new Path2D;return i.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(r)),i}paintChar(e,r,n,i,a,s){const o=this.ctx,l=this.current,c=l.font,u=l.textRenderingMode,h=l.fontSize/l.fontSizeScale,f=u&di.FILL_STROKE_MASK,d=!!(u&di.ADD_TO_PATH_FLAG),p=l.patternFill&&!c.missingFile,g=l.patternStroke&&!c.missingFile;let m;if((c.disableFontFace||d||p||g)&&!c.missingFile&&(m=c.getPathGenerator(this.commonObjs,r)),m&&(c.disableFontFace||p||g)){o.save(),o.translate(n,i),o.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(e,o,c);let v;if(f===di.FILL||f===di.FILL_STROKE)if(a){v=o.getTransform(),o.setTransform(...a);const y=this.#n(m,v,a);o.fill(y)}else o.fill(m);if(f===di.STROKE||f===di.FILL_STROKE)if(s){v||=o.getTransform(),o.setTransform(...s);const{a:y,b:x,c:b,d:w}=v,_=ot.inverseTransform(s),S=ot.transform([y,x,b,w,0,0],_);ot.singularValueDecompose2dScale(S,Fs),o.lineWidth*=Math.max(Fs[0],Fs[1])/h,o.stroke(this.#n(m,v,s))}else o.lineWidth/=h,o.stroke(m);o.restore()}else(f===di.FILL||f===di.FILL_STROKE)&&(o.fillText(r,n,i),this.dependencyTracker?.recordCharacterBBox(e,o,c,h,n,i,()=>o.measureText(r))),(f===di.STROKE||f===di.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,h,n,i,()=>o.measureText(r)).recordDependencies(e,ao.stroke),o.strokeText(r,n,i));d&&((this.pendingTextPaths||=[]).push({transform:_n(o),x:n,y:i,fontSize:h,path:m}),this.dependencyTracker?.recordCharacterBBox(e,o,c,h,n,i))}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const r=e.getImageData(0,0,10,10).data;let n=!1;for(let i=3;i<r.length;i+=4)if(r[i]>0&&r[i]<255){n=!0;break}return Qt(this,"isFontSubpixelAAEnabled",n)}showText(e,r){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,ao.showText).resetBBox(e),this.current.textRenderingMode&di.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const n=this.current,i=n.font;if(i.isType3Font){this.showType3Text(e,r),this.dependencyTracker?.recordShowTextOperation(e);return}const a=n.fontSize;if(a===0){this.dependencyTracker?.recordOperation(e);return}const s=this.ctx,o=n.fontSizeScale,l=n.charSpacing,c=n.wordSpacing,u=n.fontDirection,h=n.textHScale*u,f=r.length,d=i.vertical,p=d?1:-1,g=i.defaultVMetrics,m=a*n.fontMatrix[0],v=n.textRenderingMode===di.FILL&&!i.disableFontFace&&!n.patternFill;s.save(),n.textMatrix&&s.transform(...n.textMatrix),s.translate(n.x,n.y+n.textRise),u>0?s.scale(h,-1):s.scale(h,1);let y,x;const b=n.textRenderingMode&di.FILL_STROKE_MASK,w=b===di.FILL||b===di.FILL_STROKE,_=b===di.STROKE||b===di.FILL_STROKE;if(w&&n.patternFill){s.save();const k=n.fillColor.getPattern(s,this,Pl(s),ra.FILL,e);y=_n(s),s.restore(),s.fillStyle=k}if(_&&n.patternStroke){s.save();const k=n.strokeColor.getPattern(s,this,Pl(s),ra.STROKE,e);x=_n(s),s.restore(),s.strokeStyle=k}let S=n.lineWidth;const C=n.textMatrixScale;if(C===0||S===0?_&&(S=this.getSinglePixelWidth()):S/=C,o!==1&&(s.scale(o,o),S/=o),s.lineWidth=S,i.isInvalidPDFjsFont){const k=[];let I=0;for(const M of r)k.push(M.unicode),I+=M.width;const E=k.join("");if(s.fillText(E,0,0),this.dependencyTracker!==null){const M=s.measureText(E);this.dependencyTracker.recordBBox(e,this.ctx,-M.actualBoundingBoxLeft,M.actualBoundingBoxRight,-M.actualBoundingBoxAscent,M.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=I*m*h,s.restore(),this.compose();return}let T=0,A;for(A=0;A<f;++A){const k=r[A];if(typeof k=="number"){T+=p*k*a/1e3;continue}let I=!1;const E=(k.isSpace?c:0)+l,M=k.fontChar,R=k.accent;let D,L,P=k.width;if(d){const N=k.vmetric||g,U=-(k.vmetric?N[1]:P*.5)*m,j=N[2]*m;P=N?-N[0]:P,D=U/o,L=(T+j)/o}else D=T/o,L=0;let O;if(i.remeasure&&P>0){O=s.measureText(M);const N=O.width*1e3/a*o;if(P<N&&this.isFontSubpixelAAEnabled){const U=P/N;I=!0,s.save(),s.scale(U,1),D/=U}else P!==N&&(D+=(P-N)/2e3*a/o)}if(this.contentVisible&&(k.isInFont||i.missingFile)){if(v&&!R)s.fillText(M,D,L),this.dependencyTracker?.recordCharacterBBox(e,s,O?{bbox:null}:i,a/o,D,L,()=>O??s.measureText(M));else if(this.paintChar(e,M,D,L,y,x),R){const N=D+a*R.offset.x/o,U=L-a*R.offset.y/o;this.paintChar(e,R.fontChar,N,U,y,x)}}const $=d?P*m-E*u:P*m+E*u;T+=$,I&&s.restore()}d?n.y-=T:n.x+=T*h,s.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,r){const n=this.ctx,i=this.current,a=i.font,s=i.fontSize,o=i.fontDirection,l=a.vertical?1:-1,c=i.charSpacing,u=i.wordSpacing,h=i.textHScale*o,f=i.fontMatrix||$T,d=r.length,p=i.textRenderingMode===di.INVISIBLE;let g,m,v,y;if(p||s===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),i.textMatrix&&n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),n.scale(h,o);const x=this.dependencyTracker;for(this.dependencyTracker=x?new GS(x,e):null,g=0;g<d;++g){if(m=r[g],typeof m=="number"){y=l*m*s/1e3,this.ctx.translate(y,0),i.x+=y*h;continue}const b=(m.isSpace?u:0)+c,w=a.charProcOperatorList[m.operatorListId];w?this.contentVisible&&(this.save(),n.scale(s,s),n.transform(...f),this.executeOperatorList(w),this.restore()):Jt(`Type3 character "${m.operatorListId}" is not available.`);const _=[m.width,0];ot.applyTransform(_,f),v=_[0]*s+b,n.translate(v,0),i.x+=v*h}n.restore(),x&&(this.dependencyTracker=x)}setCharWidth(e,r,n){}setCharWidthAndBounds(e,r,n,i,a,s,o){const l=new Path2D;l.rect(i,a,s-i,o-a),this.ctx.clip(l),this.dependencyTracker?.recordBBox(e,this.ctx,i,s,a,o).recordClipBox(e,this.ctx,i,s,a,o),this.endPath(e)}getColorN_Pattern(e,r){let n;if(r[0]==="TilingPattern"){const i=this.baseTransform||_n(this.ctx),a={createCanvasGraphics:(s,o)=>new Bg(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new GS(this.dependencyTracker,o,!0):null)};n=new wD(r,this.ctx,a,i)}else n=this._getPattern(e,r[1],r[2]);return n}setStrokeColorN(e,...r){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,r),this.current.patternStroke=!0}setFillColorN(e,...r){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,r),this.current.patternFill=!0}setStrokeRGBColor(e,r){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=r,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,r){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=r,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,r,n=null){let i;return this.cachedPatterns.has(r)?i=this.cachedPatterns.get(r):(i=TSe(this.getObject(e,r)),this.cachedPatterns.set(r,i)),n&&(i.matrix=n),i}shadingFill(e,r){if(!this.contentVisible)return;const n=this.ctx;this.save(e);const i=this._getPattern(e,r);n.fillStyle=i.getPattern(n,this,Pl(n),ra.SHADING,e);const a=Pl(n);if(a){const{width:s,height:o}=n.canvas,l=xg.slice();ot.axialAlignedBoundingBox([0,0,s,o],a,l);const[c,u,h,f]=l;this.ctx.fillRect(c,u,h-c,f-u)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,ao.transform).recordDependencies(e,ao.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){rn("Should not call beginInlineImage")}beginImageData(){rn("Should not call beginImageData")}paintFormXObjectBegin(e,r,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),r&&this.transform(e,...r),this.baseTransform=_n(this.ctx),n)){ot.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);const[i,a,s,o]=n,l=new Path2D;l.rect(i,a,s-i,o-a),this.ctx.clip(l),this.dependencyTracker?.recordClipBox(e,this.ctx,i,s,a,o),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,r){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;r.isolated||hC("TODO: Support non-isolated groups."),r.knockout&&Jt("Knockout groups not supported.");const i=_n(n);if(r.matrix&&n.transform(...r.matrix),!r.bbox)throw new Error("Bounding box is required.");let a=xg.slice();ot.axialAlignedBoundingBox(r.bbox,_n(n),a);const s=[0,0,n.canvas.width,n.canvas.height];a=ot.intersect(a,s)||[0,0,0,0];const o=Math.floor(a[0]),l=Math.floor(a[1]),c=Math.max(Math.ceil(a[2])-o,1),u=Math.max(Math.ceil(a[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,u]);let h="groupAt"+this.groupLevel;r.smask&&(h+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(h,c,u),d=f.context;d.translate(-o,-l),d.transform(...i);let p=new Path2D;const[g,m,v,y]=r.bbox;if(p.rect(g,m,v-g,y-m),r.matrix){const x=new Path2D;x.addPath(p,new DOMMatrix(r.matrix)),p=x}d.clip(p),r.smask&&this.smaskStack.push({canvas:f.canvas,context:d,offsetX:o,offsetY:l,subtype:r.smask.subtype,backdrop:r.smask.backdrop,transferMap:r.smask.transferMap||null,startTransformInverse:null}),(!r.smask||this.dependencyTracker)&&(n.setTransform(1,0,0,1,0,0),n.translate(o,l),n.save()),G1(n,d),this.ctx=d,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e,r){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),r.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=_n(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...a);const s=xg.slice();ot.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],a,s),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,r,n,i,a,s){if(this.#e(),z2(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const o=n[2]-n[0],l=n[3]-n[1];if(s&&this.annotationCanvasMap){i=i.slice(),i[4]-=n[0],i[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=o,n[3]=l,ot.singularValueDecompose2dScale(_n(this.ctx),Fs);const{viewportScale:c}=this,u=Math.ceil(o*this.outputScaleX*c),h=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,h);const{canvas:f,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(r,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(Fs[0],0,0,-Fs[1],0,l*Fs[1]),z2(this.ctx)}else{z2(this.ctx),this.endPath(e);const c=new Path2D;c.rect(n[0],n[1],o,l),this.ctx.clip(c)}}this.current=new dB(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...i),this.transform(e,...a)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,r){if(!this.contentVisible)return;const n=r.count;r=this.getObject(e,r.data,r),r.count=n;const i=this.ctx,a=this._createMaskCanvas(e,r),s=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(s,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+s.width,a.offsetY,a.offsetY+s.height).recordOperation(e),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,r,n,i=0,a=0,s,o){if(!this.contentVisible)return;r=this.getObject(e,r.data,r);const l=this.ctx;l.save();const c=_n(l);l.transform(n,i,a,s,0,0);const u=this._createMaskCanvas(e,r);l.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let h=0,f=o.length;h<f;h+=2){const d=ot.transform(c,[n,i,a,s,o[h],o[h+1]]);l.drawImage(u.canvas,d[4],d[5]),this.dependencyTracker?.recordBBox(e,this.ctx,d[4],d[4]+u.canvas.width,d[5],d[5]+u.canvas.height)}l.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,r){if(!this.contentVisible)return;const n=this.ctx,i=this.current.fillColor,a=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,ao.transformAndFill);for(const s of r){const{data:o,width:l,height:c,transform:u}=s,h=this.cachedCanvases.getCanvas("maskCanvas",l,c),f=h.context;f.save();const d=this.getObject(e,o,s);gB(f,d),f.globalCompositeOperation="source-in",f.fillStyle=a?i.getPattern(f,this,Pl(n),ra.FILL,e):i,f.fillRect(0,0,l,c),f.restore(),n.save(),n.transform(...u),n.scale(1,-1),$2(n,h.canvas,0,0,l,c,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,l,0,c),n.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,r){if(!this.contentVisible)return;const n=this.getObject(e,r);if(!n){Jt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,n)}paintImageXObjectRepeat(e,r,n,i,a){if(!this.contentVisible)return;const s=this.getObject(e,r);if(!s){Jt("Dependent image isn't ready yet");return}const o=s.width,l=s.height,c=[];for(let u=0,h=a.length;u<h;u+=2)c.push({transform:[n,0,0,i,a[u],a[u+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(e,s,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:r,width:n,height:i}=e,a=this.cachedCanvases.getCanvas("inlineImage",n,i),s=a.context;return s.filter=this.current.transferMaps,s.drawImage(r,0,0),s.filter="none",a.canvas}paintInlineImageXObject(e,r){if(!this.contentVisible)return;const n=r.width,i=r.height,a=this.ctx;this.save(e);const{filter:s}=a;s!=="none"&&s!==""&&(a.filter="none"),a.scale(1/n,-1/i);let o;if(r.bitmap)o=this.applyTransferMapsToBitmap(r);else if(typeof HTMLElement=="function"&&r instanceof HTMLElement||!r.data)o=r;else{const u=this.cachedCanvases.getCanvas("inlineImage",n,i).context;pB(u,r),o=this.applyTransferMapsToCanvas(u)}const l=this._scaleImage(o,Pl(a));a.imageSmoothingEnabled=mB(_n(a),r.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,a,0,n,-i,0).recordDependencies(e,ao.imageXObject).recordOperation(e),$2(a,l.img,0,0,l.paintWidth,l.paintHeight,0,-i,n,i),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,r,n){if(!this.contentVisible)return;const i=this.ctx;let a;if(r.bitmap)a=r.bitmap;else{const s=r.width,o=r.height,c=this.cachedCanvases.getCanvas("inlineImage",s,o).context;pB(c,r),a=this.applyTransferMapsToCanvas(c)}this.dependencyTracker?.resetBBox(e);for(const s of n)i.save(),i.transform(...s.transform),i.scale(1,-1),$2(i,a,s.x,s.y,s.w,s.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,ao.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,r){}markPointProps(e,r,n){}beginMarkedContent(e,r){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,r,n){this.dependencyTracker?.beginMarkedContent(e),r==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,r,n){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);const a=this.ctx;this.pendingClip?(i||(this.pendingClip===vB?a.clip(r,"evenodd"):a.clip(r)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=_n(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const r=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/r}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:r,b:n,c:i,d:a}=this.ctx.getTransform();let s,o;if(n===0&&i===0){const l=Math.abs(r),c=Math.abs(a);if(l===c)if(e===0)s=o=1/l;else{const u=l*e;s=o=u<1?1/u:1}else if(e===0)s=1/l,o=1/c;else{const u=l*e,h=c*e;s=u<1?1/u:1,o=h<1?1/h:1}}else{const l=Math.abs(r*a-n*i),c=Math.hypot(r,n),u=Math.hypot(i,a);if(e===0)s=u/l,o=c/l;else{const h=e*l;s=u>h?u/h:1,o=c>h?c/h:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,r){const{ctx:n,current:{lineWidth:i}}=this,[a,s]=this.getScaleForStroking();if(a===s){n.lineWidth=(i||1)*a,n.stroke(e);return}const o=n.getLineDash();r&&n.save(),n.scale(a,s),j8.a=1/a,j8.d=1/s;const l=new Path2D;if(l.addPath(e,j8),o.length>0){const c=Math.max(a,s);n.setLineDash(o.map(u=>u/c)),n.lineDashOffset/=c}n.lineWidth=i||1,n.stroke(l),r&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const t in yx)Bg.prototype[t]!==void 0&&(Bg.prototype[yx[t]]=Bg.prototype[t]);class Iy{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}}class RSe{#e;#t;constructor({parsedData:e,rawData:r}){this.#e=e,this.#t=r}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}}const ng=Symbol("INTERNAL");class NSe{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:r,intent:n,usage:i,rbGroups:a}){this.#e=!!(e&Rs.DISPLAY),this.#t=!!(e&Rs.PRINT),this.name=r,this.intent=n,this.usage=i,this.rbGroups=a}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;const{print:e,view:r}=this.usage;return this.#e?r?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,r,n=!1){e!==ng&&rn("Internal method `_setVisible` called."),this.#n=n,this.#r=r}}class OSe{#e=null;#t=new Map;#n=null;#r=null;constructor(e,r=Rs.DISPLAY){if(this.renderingIntent=r,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(const n of e.groups)this.#t.set(n.id,new NSe(r,n));if(e.baseState==="OFF")for(const n of this.#t.values())n._setVisible(ng,!1);for(const n of e.on)this.#t.get(n)._setVisible(ng,!0);for(const n of e.off)this.#t.get(n)._setVisible(ng,!1);this.#n=this.getHash()}}#i(e){const r=e.length;if(r<2)return!0;const n=e[0];for(let i=1;i<r;i++){const a=e[i];let s;if(Array.isArray(a))s=this.#i(a);else if(this.#t.has(a))s=this.#t.get(a).visible;else return Jt(`Optional content group not found: ${a}`),!0;switch(n){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return n==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return hC("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(Jt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#i(e.expression);if(!e.policy||e.policy==="AnyOn"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const r of e.ids){if(!this.#t.has(r))return Jt(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!1}return!0}return Jt(`Unknown optional content policy ${e.policy}.`),!0}return Jt(`Unknown group type ${e.type}.`),!0}setVisibility(e,r=!0,n=!0){const i=this.#t.get(e);if(!i){Jt(`Optional content group not found: ${e}`);return}if(n&&r&&i.rbGroups.length)for(const a of i.rbGroups)for(const s of a)s!==e&&this.#t.get(s)?._setVisible(ng,!1,!0);i._setVisible(ng,!!r,!0),this.#e=null}setOCGState({state:e,preserveRB:r}){let n;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":n=i;continue}const a=this.#t.get(i);if(a)switch(n){case"ON":this.setVisibility(i,!0,r);break;case"OFF":this.setVisibility(i,!1,r);break;case"Toggle":this.setVisibility(i,!a.visible,r);break}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;const e=new xY;for(const[r,n]of this.#t)e.update(`${r}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}}class BSe{constructor(e,{disableRange:r=!1,disableStream:n=!1}){Sr(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:a,progressiveDone:s,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=o,a?.length>0){const l=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!r,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:r}){const n=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const i=this._rangeReaders.some(function(a){return a._begin!==e?!1:(a._enqueue(n),!0)});Sr(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const r=this._rangeReaders.indexOf(e);r>=0&&this._rangeReaders.splice(r,1)}getFullReader(){Sr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new FSe(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,r){if(r<=this._progressiveDataLength)return null;const n=new $Se(this,e,r);return this._pdfDataRangeTransport.requestDataRange(e,r),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class FSe{constructor(e,r,n=!1,i=null){this._stream=e,this._done=n||!1,this._filename=gD(i)?i:null,this._queuedChunks=r||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class $Se{constructor(e,r,n){this._stream=e,this._begin=r,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function zSe(t){let e=!0,r=n("filename\\*","i").exec(t);if(r){r=r[1];let u=o(r);return u=unescape(u),u=l(u),u=c(u),a(u)}if(r=s(t),r){const u=c(r);return a(u)}if(r=n("filename","i").exec(t),r){r=r[1];let u=o(r);return u=c(u),a(u)}function n(u,h){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',h)}function i(u,h){if(u){if(!/^[\x00-\xFF]+$/.test(h))return h;try{const f=new TextDecoder(u,{fatal:!0}),d=_b(h);h=f.decode(d),e=!1}catch{}}return h}function a(u){return e&&/[\x80-\xff]/.test(u)&&(u=i("utf-8",u),e&&(u=i("iso-8859-1",u))),u}function s(u){const h=[];let f;const d=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=d.exec(u))!==null;){let[,g,m,v]=f;if(g=parseInt(g,10),g in h){if(g===0)break;continue}h[g]=[m,v]}const p=[];for(let g=0;g<h.length&&g in h;++g){let[m,v]=h[g];v=o(v),m&&(v=unescape(v),g===0&&(v=l(v))),p.push(v)}return p.join("")}function o(u){if(u.startsWith('"')){const h=u.slice(1).split('\\"');for(let f=0;f<h.length;++f){const d=h[f].indexOf('"');d!==-1&&(h[f]=h[f].slice(0,d),h.length=f+1),h[f]=h[f].replaceAll(/\\(.)/g,"$1")}u=h.join('"')}return u}function l(u){const h=u.indexOf("'");if(h===-1)return u;const f=u.slice(0,h),p=u.slice(h+1).replace(/^[^']*'/,"");return i(f,p)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(h,f,d,p){if(d==="q"||d==="Q")return p=p.replaceAll("_"," "),p=p.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,m){return String.fromCharCode(parseInt(m,16))}),i(f,p);try{p=atob(p)}catch{}return i(f,p)})}return""}function TY(t,e){const r=new Headers;if(!t||!e||typeof e!="object")return r;for(const n in e){const i=e[n];i!==void 0&&r.append(n,i)}return r}function pC(t){return URL.parse(t)?.origin??null}function kY({responseHeaders:t,isHttp:e,rangeChunkSize:r,disableRange:n}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t.get("Content-Length"),10);return!Number.isInteger(a)||(i.suggestedLength=a,a<=2*r)||n||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function EY(t){const e=t.get("Content-Disposition");if(e){let r=zSe(e);if(r.includes("%"))try{r=decodeURIComponent(r)}catch{}if(gD(r))return r}return null}function kb(t,e){return new HS(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,t===404||t===0&&e.startsWith("file:"))}function IY(t){return t===200||t===206}function DY(t,e,r){return{method:"GET",headers:t,signal:r.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function MY(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Jt(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class VSe{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=TY(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Sr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new USe(this),this._fullRequestReader}getRangeReader(e,r){if(r<=this._progressiveDataLength)return null;const n=new jSe(this,e,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class USe{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const r=e.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange;const n=new Headers(e.headers),i=r.url;fetch(i,DY(n,this._withCredentials,this._abortController)).then(a=>{if(e._responseOrigin=pC(a.url),!IY(a.status))throw kb(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const s=a.headers,{allowRangeRequests:o,suggestedLength:l}=kY({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=EY(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new rf("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:r}=await this._reader.read();return r?{value:e,done:r}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:MY(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class jSe{constructor(e,r,n){this._stream=e,this._reader=null,this._loaded=0;const i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const a=new Headers(e.headers);a.append("Range",`bytes=${r}-${n-1}`);const s=i.url;fetch(s,DY(a,this._withCredentials,this._abortController)).then(o=>{const l=pC(o.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!IY(o.status))throw kb(o.status,s);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:r}=await this._reader.read();return r?{value:e,done:r}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:MY(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}const H8=200,G8=206;function HSe(t){const e=t.response;return typeof e!="string"?e:_b(e).buffer}class GSe{_responseOrigin=null;constructor({url:e,httpHeaders:r,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=TY(this.isHttp,r),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const r=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const[a,s]of this.headers)r.setRequestHeader(a,s);return this.isHttp&&"begin"in e&&"end"in e?(r.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=G8):i.expectedStatus=H8,r.responseType="arraybuffer",Sr(e.onError,"Expected `onError` callback to be provided."),r.onerror=()=>{e.onError(r.status)},r.onreadystatechange=this.onStateChange.bind(this,n),r.onprogress=this.onProgress.bind(this,n),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,r.send(null),n}onProgress(e,r){const n=this.pendingRequests[e];n&&n.onProgress?.(r)}onStateChange(e,r){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){n.onError(i.status);return}const a=i.status||H8;if(!(a===H8&&n.expectedStatus===G8)&&a!==n.expectedStatus){n.onError(i.status);return}const o=HSe(i);if(a===G8){const l=i.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);c?n.onDone({begin:parseInt(c[1],10),chunk:o}):(Jt('Missing or invalid "Content-Range" header.'),n.onError(0))}else o?n.onDone({begin:0,chunk:o}):n.onError(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const r=this.pendingRequests[e].xhr;delete this.pendingRequests[e],r.abort()}}class WSe{constructor(e){this._source=e,this._manager=new GSe(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const r=this._rangeRequestReaders.indexOf(e);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return Sr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new qSe(this._manager,this._source),this._fullRequestReader}getRangeReader(e,r){const n=new XSe(this._manager,e,r);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class qSe{constructor(e,r){this._manager=e,this._url=r.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,r=this._manager.getRequestXhr(e);this._manager._responseOrigin=pC(r.responseURL);const n=r.getAllResponseHeaders(),i=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...c]=o.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:a,suggestedLength:s}=kY({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=EY(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=kb(e,this._url),this._headersCapability.reject(this._storedError);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class XSe{constructor(e,r,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:r,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const e=pC(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){const r=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=kb(e,this._url);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const YSe=/^[a-z][a-z0-9\-+.]+:/i;function KSe(t){if(YSe.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class ZSe{constructor(e){this.source=e,this.url=KSe(e.url),Sr(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Sr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new JSe(this),this._fullRequestReader}getRangeReader(e,r){if(r<=this._progressiveDataLength)return null;const n=new QSe(this,e,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class JSe{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const r=e.source;this._contentLength=r.length,this._loaded=0,this._filename=null,this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const n=process.getBuiltinModule("fs");n.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=kb(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",r=>{this._error(r)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new rf("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class QSe{constructor(e,r,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const i=e.source;this._isStreamingSupported=!i.disableStream;const a=process.getBuiltinModule("fs");this._setReadableStream(a.createReadStream(this._url,{start:r,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",r=>{this._error(r)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const W1=Symbol("INITIAL_DATA");class LY{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:W1}}get(e,r=null){if(r){const i=this.#t(e);return i.promise.then(()=>r(i.data)),null}const n=this.#e[e];if(!n||n.data===W1)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const r=this.#e[e];return!!r&&r.data!==W1}delete(e){const r=this.#e[e];return!r||r.data===W1?!1:(delete this.#e[e],!0)}resolve(e,r=null){const n=this.#t(e);n.data=r,n.resolve()}clear(){for(const e in this.#e){const{data:r}=this.#e[e];r?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const e in this.#e){const{data:r}=this.#e[e];r!==W1&&(yield[e,r])}}}const e9e=1e5,yB=30;class Ns{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#s=0;#o=0;#l=null;#c=null;#f=0;#h=0;#d=Object.create(null);#m=[];#g=null;#u=[];#p=new WeakMap;#v=null;static#x=new Map;static#y=new Map;static#C=new WeakMap;static#S=null;static#b=new Set;constructor({textContentSource:e,container:r,viewport:n}){if(e instanceof ReadableStream)this.#g=e;else if(typeof e=="object")this.#g=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#c=r,this.#h=n.scale*Ac.pixelRatio,this.#f=n.rotation,this.#a={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:a,pageX:s,pageY:o}=n.rawDims;this.#v=[1,0,0,-1,-s,o+a],this.#o=i,this.#s=a,Ns.#I(),r.style.setProperty("--min-font-size",Ns.#S),m0(r,n),this.#e.promise.finally(()=>{Ns.#b.delete(this),this.#a=null,this.#d=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:r}=yi.platform;return Qt(this,"fontFamilyMap",new Map([["sans-serif",`${e&&r?"Calibri, ":""}sans-serif`],["monospace",`${e&&r?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{this.#l.read().then(({value:r,done:n})=>{if(n){this.#e.resolve();return}this.#i??=r.lang,Object.assign(this.#d,r.styles),this.#T(r.items),e()},this.#e.reject)};return this.#l=this.#g.getReader(),Ns.#b.add(this),e(),this.#e.promise}update({viewport:e,onBefore:r=null}){const n=e.scale*Ac.pixelRatio,i=e.rotation;if(i!==this.#f&&(r?.(),this.#f=i,m0(this.#c,{rotation:i})),n!==this.#h){r?.(),this.#h=n;const a={div:null,properties:null,ctx:Ns.#D(this.#i)};for(const s of this.#u)a.properties=this.#p.get(s),a.div=s,this.#A(a)}}cancel(){const e=new rf("TextLayer task cancelled.");this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#T(e){if(this.#n)return;this.#a.ctx??=Ns.#D(this.#i);const r=this.#u,n=this.#m;for(const i of e){if(r.length>e9e){Jt("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){const a=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),i.id&&this.#t.setAttribute("id",`${i.id}`),a.append(this.#t)}else i.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}n.push(i.str),this.#w(i)}}#w(e){const r=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#u.push(r);const i=ot.transform(this.#v,e.transform);let a=Math.atan2(i[1],i[0]);const s=this.#d[e.fontName];s.vertical&&(a+=Math.PI/2);let o=this.#r&&s.fontSubstitution||s.fontFamily;o=Ns.fontFamilyMap.get(o)||o;const l=Math.hypot(i[2],i[3]),c=l*Ns.#B(o,s,this.#i);let u,h;a===0?(u=i[4],h=i[5]-c):(u=i[4]+c*Math.sin(a),h=i[5]-c*Math.cos(a));const f=r.style;f.left=`${(100*u/this.#o).toFixed(2)}%`,f.top=`${(100*h/this.#s).toFixed(2)}%`,f.setProperty("--font-height",`${l.toFixed(2)}px`),f.fontFamily=o,n.fontSize=l,r.setAttribute("role","presentation"),r.textContent=e.str,r.dir=e.dir,this.#r&&(r.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),a!==0&&(n.angle=a*(180/Math.PI));let d=!1;if(e.str.length>1)d=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const p=Math.abs(e.transform[0]),g=Math.abs(e.transform[3]);p!==g&&Math.max(p,g)/Math.min(p,g)>1.5&&(d=!0)}if(d&&(n.canvasWidth=s.vertical?e.height:e.width),this.#p.set(r,n),this.#a.div=r,this.#a.properties=n,this.#A(this.#a),n.hasText&&this.#t.append(r),n.hasEOL){const p=document.createElement("br");p.setAttribute("role","presentation"),this.#t.append(p)}}#A(e){const{div:r,properties:n,ctx:i}=e,{style:a}=r;if(n.canvasWidth!==0&&n.hasText){const{fontFamily:s}=a,{canvasWidth:o,fontSize:l}=n;Ns.#E(i,l*this.#h,s);const{width:c}=i.measureText(r.textContent);c>0&&a.setProperty("--scale-x",o*this.#h/c)}n.angle!==0&&a.setProperty("--rotate",`${n.angle}deg`)}static cleanup(){if(!(this.#b.size>0)){this.#x.clear();for(const{canvas:e}of this.#y.values())e.remove();this.#y.clear()}}static#D(e=null){let r=this.#y.get(e||="");if(!r){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=e,document.body.append(n),r=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#y.set(e,r),this.#C.set(r,{size:0,family:""})}return r}static#E(e,r,n){const i=this.#C.get(e);r===i.size&&n===i.family||(e.font=`${r}px ${n}`,i.size=r,i.family=n)}static#I(){if(this.#S!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#S=e.getBoundingClientRect().height,e.remove()}static#B(e,r,n){const i=this.#x.get(e);if(i)return i;const a=this.#D(n);a.canvas.width=a.canvas.height=yB,this.#E(a,yB,e);const s=a.measureText(""),o=s.fontBoundingBoxAscent,l=Math.abs(s.fontBoundingBoxDescent);a.canvas.width=a.canvas.height=0;let c=.8;return o?c=o/(o+l):(yi.platform.isFirefox&&Jt("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),r.ascent?c=r.ascent:r.descent&&(c=1+r.descent)),this.#x.set(e,c),c}}const t9e=100;function PY(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new _D,{docId:r}=e,n=t.url?lSe(t.url):null,i=t.data?cSe(t.data):null,a=t.httpHeaders||null,s=t.withCredentials===!0,o=t.password??null,l=t.range instanceof RY?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:2**16;let u=t.worker instanceof bx?t.worker:null;const h=t.verbosity,f=typeof t.docBaseUrl=="string"&&!fC(t.docBaseUrl)?t.docBaseUrl:null,d=N2(t.cMapUrl),p=t.cMapPacked!==!1,g=t.CMapReaderFactory||(Ra?vSe:iB),m=N2(t.iccUrl),v=N2(t.standardFontDataUrl),y=t.StandardFontDataFactory||(Ra?ySe:aB),x=N2(t.wasmUrl),b=t.WasmFactory||(Ra?xSe:sB),w=t.stopAtErrors!==!0,_=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,S=t.isEvalSupported!==!1,C=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Ra,T=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!Ra&&(yi.platform.isFirefox||!globalThis.chrome),A=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,k=typeof t.disableFontFace=="boolean"?t.disableFontFace:Ra,I=t.fontExtraProperties===!0,E=t.enableXfa===!0,M=t.ownerDocument||globalThis.document,R=t.disableRange===!0,D=t.disableStream===!0,L=t.disableAutoFetch===!0,P=t.pdfBug===!0,O=t.CanvasFactory||(Ra?mSe:dSe),$=t.FilterFactory||(Ra?gSe:pSe),N=t.enableHWA===!0,U=t.useWasm!==!1,j=l?l.length:t.length??NaN,B=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Ra&&!k,q=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:!!(g===iB&&y===aB&&b===sB&&d&&v&&x&&Wv(d,document.baseURI)&&Wv(v,document.baseURI)&&Wv(x,document.baseURI)),W=null;N_e(h);const X={canvasFactory:new O({ownerDocument:M,enableHWA:N}),filterFactory:new $({docId:r,ownerDocument:M}),cMapReaderFactory:q?null:new g({baseUrl:d,isCompressed:p}),standardFontDataFactory:q?null:new y({baseUrl:v}),wasmFactory:q?null:new b({baseUrl:x})};u||(u=bx.create({verbosity:h,port:Iy.workerPort}),e._worker=u);const K={docId:r,apiVersion:"5.4.530",data:i,password:o,disableAutoFetch:L,rangeChunkSize:c,length:j,docBaseUrl:f,enableXfa:E,evaluatorOptions:{maxImageSize:_,disableFontFace:k,ignoreErrors:w,isEvalSupported:S,isOffscreenCanvasSupported:C,isImageDecoderSupported:T,canvasMaxAreaInBytes:A,fontExtraProperties:I,useSystemFonts:B,useWasm:U,useWorkerFetch:q,cMapUrl:d,iccUrl:m,standardFontDataUrl:v,wasmUrl:x}},G={ownerDocument:M,pdfBug:P,styleElement:W,loadingParams:{disableAutoFetch:L,enableXfa:E}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const H=u.messageHandler.sendWithPromise("GetDocRequest",K,i?[i.buffer]:null);let Y;if(l)Y=new BSe(l,{disableRange:R,disableStream:D});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");const J=Wv(n)?VSe:Ra?ZSe:WSe;Y=new J({url:n,length:j,httpHeaders:a,withCredentials:s,rangeChunkSize:c,disableRange:R,disableStream:D})}return H.then(J=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const ie=new qv(r,J,u.port),me=new i9e(ie,e,Y,G,X,N);e._transport=me,ie.send("Ready",null)})}).catch(e._capability.reject),e}class _D{static#e=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${_D.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class RY{#e=Promise.withResolvers();#t=[];#n=[];#r=[];#i=[];constructor(e,r,n=!1,i=null){this.length=e,this.initialData=r,this.progressiveDone=n,this.contentDispositionFilename=i}addRangeListener(e){this.#i.push(e)}addProgressListener(e){this.#r.push(e)}addProgressiveReadListener(e){this.#n.push(e)}addProgressiveDoneListener(e){this.#t.push(e)}onDataRange(e,r){for(const n of this.#i)n(e,r)}onDataProgress(e,r){this.#e.promise.then(()=>{for(const n of this.#r)n(e,r)})}onDataProgressiveRead(e){this.#e.promise.then(()=>{for(const r of this.#n)r(e)})}onDataProgressiveDone(){this.#e.promise.then(()=>{for(const e of this.#t)e()})}transportReady(){this.#e.resolve()}requestDataRange(e,r){rn("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class r9e{constructor(e,r){this._pdfInfo=e,this._transport=r}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Qt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(e,r){return this._transport.getAnnotationsByType(e,r)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(r)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}extractPages(e){return this._transport.extractPages(e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class n9e{#e=!1;constructor(e,r,n,i=!1){this._pageIndex=e,this._pageInfo=r,this._transport=n,this._stats=i?new ZO:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new LY,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:r=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:a=!1}={}){return new Cb({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:r,offsetX:n,offsetY:i,dontFlip:a})}getAnnotations({intent:e="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,r)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Qt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:r=e.canvas,viewport:n,intent:i="display",annotationMode:a=Ah.ENABLE,transform:s=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:h=null,isEditing:f=!1,recordOperations:d=!1,operationsFilter:p=null}){this._stats?.time("Overall");const g=this._transport.getRenderingIntent(i,a,h,f),{renderingIntent:m,cacheKey:v}=g;this.#e=!1,l||=this._transport.getOptionalContentConfig(m);let y=this._intentStates.get(v);y||(y=Object.create(null),this._intentStates.set(v,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const x=!!(m&Rs.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(g));const b=!!(this._pdfBug&&globalThis.StepperManager?.enabled),w=!this.recordedBBoxes&&(d||b),_=T=>{if(y.renderTasks.delete(S),w){const A=S.gfx?.dependencyTracker.take();A&&(S.stepper&&S.stepper.setOperatorBBoxes(A,S.gfx.dependencyTracker.takeDebugMetadata()),d&&(this.recordedBBoxes=A))}x&&(this.#e=!0),this.#t(),T?(S.capability.reject(T),this._abortOperatorList({intentState:y,reason:T instanceof Error?T:new Error(T)})):S.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new bg({callback:_,params:{canvas:r,canvasContext:e,dependencyTracker:w?new wSe(r,y.operatorList.length,b):null,viewport:n,transform:s,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!x,pdfBug:this._pdfBug,pageColors:u,enableHWA:this._transport.enableHWA,operationsFilter:p});(y.renderTasks||=new Set).add(S);const C=S.task;return Promise.all([y.displayReadyCapability.promise,l]).then(([T,A])=>{if(this.destroyed){_();return}if(this._stats?.time("Rendering"),!(A.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:T,optionalContentConfig:A}),S.operatorListChanged()}).catch(_),C}getOperatorList({intent:e="display",annotationMode:r=Ah.ENABLE,printAnnotationStorage:n=null,isEditing:i=!1}={}){function a(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const s=this._transport.getRenderingIntent(e,r,n,i,!0);let o=this._intentStates.get(s.cacheKey);o||(o=Object.create(null),this._intentStates.set(s.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=a,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:r===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>xx.textContent(n));const r=this.streamTextContent(e);return new Promise(function(n,i){function a(){s.read().then(function({value:l,done:c}){if(c){n(o);return}o.lang??=l.lang,Object.assign(o.styles,l.styles),o.items.push(...l.items),a()},i)}const s=r.getReader(),o={items:[],styles:Object.create(null),lang:null};a()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const r of this._intentStates.values())if(this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),!r.opListReadCapability)for(const n of r.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;const r=this.#t();return e&&r&&(this._stats&&=new ZO),r}#t(){if(!this.#e||this.destroyed)return!1;for(const{renderTasks:e,operatorList:r}of this._intentStates.values())if(e.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,r){const n=this._intentStates.get(r);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,r){for(let n=0,i=e.length;n<i;n++)r.operatorList.fnArray.push(e.fnArray[n]),r.operatorList.argsArray.push(e.argsArray[n]);r.operatorList.lastChunk=e.lastChunk,r.operatorList.separateAnnots=e.separateAnnots;for(const n of r.renderTasks)n.operatorListChanged();e.lastChunk&&this.#t()}_pumpOperatorList({renderingIntent:e,cacheKey:r,annotationStorageSerializable:n,modifiedIds:i}){const{map:a,transfer:s}=n,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:r,annotationStorage:a,modifiedIds:i},s).getReader(),c=this._intentStates.get(r);c.streamReader=l;const u=()=>{l.read().then(({value:h,done:f})=>{if(f){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,c),u())},h=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const f of c.renderTasks)f.operatorListChanged();this.#t()}if(c.displayReadyCapability)c.displayReadyCapability.reject(h);else if(c.opListReadCapability)c.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:e,reason:r,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(r instanceof pD){let i=t9e;r.extraDelay>0&&r.extraDelay<1e3&&(i+=r.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:r,force:!0})},i);return}}if(e.streamReader.cancel(new rf(r.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,a]of this._intentStates)if(a===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}var Th,Zo,du,jd,z3,Hd,Gd,Ya,E_,NY,OY,Xv,qg,I_;const gn=class gn{constructor({name:e=null,port:r=null,verbosity:n=O_e()}={}){Tl(this,Ya);Tl(this,Th,Promise.withResolvers());Tl(this,Zo,null);Tl(this,du,null);Tl(this,jd,null);if(this.name=e,this.destroyed=!1,this.verbosity=n,r){if(dn(gn,Gd).has(r))throw new Error("Cannot use more than one PDFWorker per port.");dn(gn,Gd).set(r,this),kl(this,Ya,NY).call(this,r)}else kl(this,Ya,OY).call(this)}get promise(){return dn(this,Th).promise}get port(){return dn(this,du)}get messageHandler(){return dn(this,Zo)}destroy(){this.destroyed=!0,dn(this,jd)?.terminate(),cs(this,jd,null),dn(gn,Gd).delete(dn(this,du)),cs(this,du,null),dn(this,Zo)?.destroy(),cs(this,Zo,null)}static create(e){const r=dn(this,Gd).get(e?.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new gn(e)}static get workerSrc(){if(Iy.workerSrc)return Iy.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Qt(this,"_setupFakeWorkerGlobal",(async()=>dn(this,qg,I_)?dn(this,qg,I_):(await import(this.workerSrc)).WorkerMessageHandler)())}};Th=new WeakMap,Zo=new WeakMap,du=new WeakMap,jd=new WeakMap,z3=new WeakMap,Hd=new WeakMap,Gd=new WeakMap,Ya=new WeakSet,E_=function(){dn(this,Th).resolve(),dn(this,Zo).send("configure",{verbosity:this.verbosity})},NY=function(e){cs(this,du,e),cs(this,Zo,new qv("main","worker",e)),dn(this,Zo).on("ready",()=>{}),kl(this,Ya,E_).call(this)},OY=function(){if(dn(gn,Hd)||dn(gn,qg,I_)){kl(this,Ya,Xv).call(this);return}let{workerSrc:e}=gn;try{gn._isSameOrigin(window.location,e)||(e=gn._createCDNWrapper(new URL(e,window.location).href));const r=new Worker(e,{type:"module"}),n=new qv("main","worker",r),i=()=>{a.abort(),n.destroy(),r.terminate(),this.destroyed?dn(this,Th).reject(new Error("Worker was destroyed")):kl(this,Ya,Xv).call(this)},a=new AbortController;r.addEventListener("error",()=>{dn(this,jd)||i()},{signal:a.signal}),n.on("test",o=>{if(a.abort(),this.destroyed||!o){i();return}cs(this,Zo,n),cs(this,du,r),cs(this,jd,r),kl(this,Ya,E_).call(this)}),n.on("ready",o=>{if(a.abort(),this.destroyed){i();return}try{s()}catch{kl(this,Ya,Xv).call(this)}});const s=()=>{const o=new Uint8Array;n.send("test",o,[o.buffer])};s();return}catch{hC("The worker has been disabled.")}kl(this,Ya,Xv).call(this)},Xv=function(){dn(gn,Hd)||(Jt("Setting up fake worker."),cs(gn,Hd,!0)),gn._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){dn(this,Th).reject(new Error("Worker was destroyed"));return}const r=new fSe;cs(this,du,r);const n=`fake${fR(gn,z3)._++}`,i=new qv(n+"_worker",n,r);e.setup(i,r),cs(this,Zo,new qv(n,n+"_worker",r)),kl(this,Ya,E_).call(this)}).catch(e=>{dn(this,Th).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},qg=new WeakSet,I_=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},Tl(gn,qg),Tl(gn,z3,0),Tl(gn,Hd,!1),Tl(gn,Gd,new WeakMap),Ra&&(cs(gn,Hd,!0),Iy.workerSrc||="./pdf.worker.mjs"),gn._isSameOrigin=(e,r)=>{const n=URL.parse(e);if(!n?.origin||n.origin==="null")return!1;const i=new URL(r,n);return n.origin===i.origin},gn._createCDNWrapper=e=>{const r=`await import("${e}");`;return URL.createObjectURL(new Blob([r],{type:"text/javascript"}))},gn.fromPort=e=>{if(X_e("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return gn.create(e)};let bx=gn;class i9e{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#i=null;constructor(e,r,n,i,a,s){this.messageHandler=e,this.loadingTask=r,this.commonObjs=new LY,this.fontLoader=new aSe({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.wasmFactory=a.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=s,this.setupMessageHandler()}#a(e,r=null){const n=this.#e.get(e);if(n)return n;const i=this.messageHandler.sendWithPromise(e,r);return this.#e.set(e,i),i}get annotationStorage(){return Qt(this,"annotationStorage",new yD)}getRenderingIntent(e,r=Ah.ENABLE,n=null,i=!1,a=!1){let s=Rs.DISPLAY,o=GT;switch(e){case"any":s=Rs.ANY;break;case"display":break;case"print":s=Rs.PRINT;break;default:Jt(`getRenderingIntent - invalid intent: ${e}`)}const l=s&Rs.PRINT&&n instanceof bY?n:this.annotationStorage;switch(r){case Ah.DISABLE:s+=Rs.ANNOTATIONS_DISABLE;break;case Ah.ENABLE:break;case Ah.ENABLE_FORMS:s+=Rs.ANNOTATIONS_FORMS;break;case Ah.ENABLE_STORAGE:s+=Rs.ANNOTATIONS_STORAGE,o=l.serializable;break;default:Jt(`getRenderingIntent - invalid annotationMode: ${r}`)}i&&(s+=Rs.IS_EDITING),a&&(s+=Rs.OPLIST);const{ids:c,hash:u}=l.modifiedIds,h=[s,o.hash,u];return{renderingIntent:s,cacheKey:h.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#i?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of this.#t.values())e.push(n._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return e.push(r),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),Ns.cleanup(),this._networkStream?.cancelAllRequests(new rf("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:r}=this;e.on("GetReader",(n,i)=>{Sr(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},i.onPull=()=>{this._fullReader.read().then(function({value:a,done:s}){if(s){i.close();return}Sr(a instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{this._fullReader.cancel(a),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async n=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:a,contentLength:s}=this._fullReader;return(!i||!a)&&(this._lastProgress&&r.onProgress?.(this._lastProgress),this._fullReader.onProgress=o=>{r.onProgress?.({loaded:o.loaded,total:o.total})}),{isStreamingSupported:i,isRangeSupported:a,contentLength:s}}),e.on("GetRangeReader",(n,i)=>{Sr(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(n.begin,n.end);if(!a){i.close();return}i.onPull=()=>{a.read().then(function({value:s,done:o}){if(o){i.close();return}Sr(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{a.cancel(s),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,r._capability.resolve(new r9e(n,this))}),e.on("DocException",n=>{r._capability.reject(ps(n))}),e.on("PasswordRequest",n=>{this.#i=Promise.withResolvers();try{if(!r.onPassword)throw ps(n);const i=a=>{a instanceof Error?this.#i.reject(a):this.#i.resolve({password:a})};r.onPassword(i,n.code)}catch(i){this.#i.reject(i)}return this.#i.promise}),e.on("DataLoaded",n=>{r.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,i,a])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(i){case"Font":if("error"in a){const h=a.error;Jt(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}const s=new Kr(a),o=this._params.pdfBug&&globalThis.FontInspector?.enabled?(h,f)=>globalThis.FontInspector.fontAdded(h,f):null,l=new sSe(s,o,a.extra,a.charProcOperatorList);this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!l.fontExtraProperties&&l.data&&l.clearData(),this.commonObjs.resolve(n,l)});break;case"CopyLocalImage":const{imageRef:c}=a;Sr(c,"The imageRef must be defined.");for(const h of this.#t.values())for(const[,f]of h.objs)if(f?.ref===c)return f.dataLen?(this.commonObjs.resolve(n,structuredClone(f)),f.dataLen):null;break;case"FontPath":this.commonObjs.resolve(n,new oSe(a));break;case"Image":this.commonObjs.resolve(n,a);break;case"Pattern":const u=new Ai(a);this.commonObjs.resolve(n,u.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([n,i,a,s])=>{if(this.destroyed)return;const o=this.#t.get(i);if(!o.objs.has(n)){if(o._intentStates.size===0){s?.bitmap?.close();return}switch(a){case"Image":case"Pattern":o.objs.resolve(n,s);break;default:throw new Error(`Got unknown object type ${a}`)}}}),e.on("DocProgress",n=>{this.destroyed||r.onProgress?.({loaded:n.loaded,total:n.total})}),e.on("FetchBinaryData",async n=>{if(this.destroyed)throw new Error("Worker was destroyed.");const i=this[n.type];if(!i)throw new Error(`${n.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(n)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Jt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},r).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:e})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const r=e-1,n=this.#n.get(r);if(n)return n;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&this.#r.set(a.refStr,e);const s=new n9e(r,a,this,this._params.pdfBug);return this.#t.set(r,s),s});return this.#n.set(r,i),i}getPageIndex(e){return WT(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:r})}getFieldObjects(){return this.#a("GetFieldObjects")}hasJSActions(){return this.#a("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,r){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:r})}getDocJSActions(){return this.#a("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#a("GetOptionalContentConfig").then(r=>new OSe(r,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",r=this.#e.get(e);if(r)return r;const n=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new RSe(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null,hasStructTree:i[2]}));return this.#e.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const r of this.#t.values())if(!r.cleanup())throw new Error(`startCleanup: Page ${r.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),Ns.cleanup()}}cachedPageNumber(e){if(!WT(e))return null;const r=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(r)??null}}class a9e{#e=null;onContinue=null;onError=null;constructor(e){this.#e=e}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;const{annotationCanvasMap:r}=this.#e;return e.form||e.canvas&&r?.size>0}}class bg{#e=null;static#t=new WeakSet;constructor({callback:e,params:r,objs:n,commonObjs:i,annotationCanvasMap:a,operatorList:s,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:h=!1,pageColors:f=null,enableHWA:d=!1,operationsFilter:p=null}){this.callback=e,this.params=r,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=h,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new a9e(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=r.canvas,this._canvasContext=r.canvas?null:r.canvasContext,this._enableHWA=d,this._dependencyTracker=r.dependencyTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:r}){if(this.cancelled)return;if(this._canvas){if(bg.#t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");bg.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:n,transform:i,background:a,dependencyTracker:s}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Bg(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors,s),this.gfx.beginDrawing({transform:i,viewport:n,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,r=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),bg.#t.delete(this._canvas),e||=new pD(`Rendering cancelled, page ${this._pageIndex+1}`,r),this.callback(e),this.task.onError?.(e)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bg.#t.delete(this._canvas),this.callback())))}}const s9e="5.4.530",o9e="50cc4adac";class po{#e=null;#t=null;#n;#r=null;#i=!1;#a=!1;#s=null;#o;#l=null;#c=null;static#f=null;static get _keyboardManager(){return Qt(this,"_keyboardManager",new Tb([[["Escape","mac+Escape"],po.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],po.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],po.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],po.prototype._moveToPrevious],[["Home","mac+Home"],po.prototype._moveToBeginning],[["End","mac+End"],po.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:r=null}){e?(this.#a=!1,this.#s=e):this.#a=!0,this.#c=e?._uiManager||r,this.#o=this.#c._eventBus,this.#n=e?.color?.toUpperCase()||this.#c?.highlightColors.values().next().value||"#FFFF98",po.#f||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#e=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#s&&(e.ariaControls=`${this.#s.id}_colorpicker_dropdown`);const r=this.#c._signal;e.addEventListener("click",this.#g.bind(this),{signal:r}),e.addEventListener("keydown",this.#m.bind(this),{signal:r});const n=this.#t=document.createElement("span");return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=this.#n,e.append(n),e}renderMainDropdown(){const e=this.#r=this.#h();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#h(){const e=document.createElement("div"),r=this.#c._signal;e.addEventListener("contextmenu",Bo,{signal:r}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#s&&(e.id=`${this.#s.id}_colorpicker_dropdown`);for(const[n,i]of this.#c.highlightColors){const a=document.createElement("button");a.tabIndex="0",a.role="option",a.setAttribute("data-color",i),a.title=n,a.setAttribute("data-l10n-id",po.#f[n]);const s=document.createElement("span");a.append(s),s.className="swatch",s.style.backgroundColor=i,a.ariaSelected=i===this.#n,a.addEventListener("click",this.#d.bind(this,i),{signal:r}),e.append(a)}return e.addEventListener("keydown",this.#m.bind(this),{signal:r}),e}#d(e,r){r.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:_r.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#g(e);return}const r=e.target.getAttribute("data-color");r&&this.#d(r,e)}_moveToNext(e){if(!this.#p){this.#g(e);return}if(e.target===this.#e){this.#r.firstElementChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#r?.firstElementChild||e.target===this.#e){this.#p&&this._hideDropdownFromKeyboard();return}this.#p||this.#g(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#p){this.#g(e);return}this.#r.firstElementChild?.focus()}_moveToEnd(e){if(!this.#p){this.#g(e);return}this.#r.lastElementChild?.focus()}#m(e){po._keyboardManager.exec(this,e)}#g(e){if(this.#p){this.hideDropdown();return}if(this.#i=e.detail===0,this.#l||(this.#l=new AbortController,window.addEventListener("pointerdown",this.#u.bind(this),{signal:this.#c.combinedSignal(this.#l)})),this.#e.ariaExpanded="true",this.#r){this.#r.classList.remove("hidden");return}const r=this.#r=this.#h();this.#e.append(r)}#u(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add("hidden"),this.#e.ariaExpanded="false",this.#l?.abort(),this.#l=null}get#p(){return this.#r&&!this.#r.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#a){if(!this.#p){this.#s?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#i})}}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;const r=this.#c.highlightColors.values();for(const n of this.#r.children)n.ariaSelected=r.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}}class _x{#e=null;#t=null;#n=null;static#r=null;constructor(e){this.#t=e,this.#n=e._uiManager,_x.#r||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#e)return this.#e;const{editorType:e,colorType:r,color:n}=this.#t,i=this.#e=document.createElement("input");return i.type="color",i.value=n||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",_x.#r[e]),i.addEventListener("input",()=>{this.#n.updateParams(r,i.value)},{signal:this.#n._signal}),i}update(e){this.#e&&(this.#e.value=e)}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}}function xB(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function q1(t){return Math.max(0,Math.min(255,255*t))}class bB{static CMYK_G([e,r,n,i]){return["G",1-Math.min(1,.3*e+.59*n+.11*r+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=q1(e),[e,e,e]}static G_HTML([e]){const r=xB(e);return`#${r}${r}${r}`}static RGB_G([e,r,n]){return["G",.3*e+.59*r+.11*n]}static RGB_rgb(e){return e.map(q1)}static RGB_HTML(e){return`#${e.map(xB).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,r,n,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,n+i),1-Math.min(1,r+i)]}static CMYK_rgb([e,r,n,i]){return[q1(1-Math.min(1,e+i)),q1(1-Math.min(1,n+i)),q1(1-Math.min(1,r+i))]}static CMYK_HTML(e){const r=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(r)}static RGB_CMYK([e,r,n]){const i=1-e,a=1-r,s=1-n,o=Math.min(i,a,s);return["CMYK",i,a,s,o]}}class l9e{create(e,r,n=!1){if(e<=0||r<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${r}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${r}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){rn("Abstract method `_createSVG` called.")}}class WS extends l9e{_createSVG(e){return document.createElementNS(ru,e)}}const c9e=9,v0=new WeakSet,u9e=new Date().getTimezoneOffset()*60*1e3;class W8{static create(e){switch(e.data.annotationType){case Jn.LINK:return new SD(e);case Jn.TEXT:return new f9e(e);case Jn.WIDGET:switch(e.data.fieldType){case"Tx":return new d9e(e);case"Btn":return e.data.radioButton?new BY(e):e.data.checkBox?new g9e(e):new m9e(e);case"Ch":return new v9e(e);case"Sig":return new p9e(e)}return new U0(e);case Jn.POPUP:return new YT(e);case Jn.FREETEXT:return new FY(e);case Jn.LINE:return new x9e(e);case Jn.SQUARE:return new b9e(e);case Jn.CIRCLE:return new w9e(e);case Jn.POLYLINE:return new $Y(e);case Jn.CARET:return new S9e(e);case Jn.INK:return new CD(e);case Jn.POLYGON:return new _9e(e);case Jn.HIGHLIGHT:return new zY(e);case Jn.UNDERLINE:return new C9e(e);case Jn.SQUIGGLY:return new A9e(e);case Jn.STRIKEOUT:return new T9e(e);case Jn.STAMP:return new VY(e);case Jn.FILEATTACHMENT:return new k9e(e);default:return new Sn(e)}}}class Sn{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:r=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=r,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,r&&(this.contentElement=this.container=this._createContainer(n)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:r}){return!!(e?.str||r?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Sn._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:e}=this,r=this.annotationStorage?.getEditor(e.id);return r?r.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:r,inkLists:n,rect:i}=this.data;let a=-1/0,s=-1/0;if(r?.length>=8){for(let o=0;o<r.length;o+=8)r[o+1]>s?(s=r[o+1],a=r[o+2]):r[o+1]===s&&(a=Math.max(a,r[o+2]));return[a,s]}if(n?.length>=1){for(const o of n)for(let l=0,c=o.length;l<c;l+=2)o[l+1]>s?(s=o[l+1],a=o[l]):o[l+1]===s&&(a=Math.max(a,o[l]));if(a!==1/0)return[a,s]}return i?[i[2],i[3]]:null}_normalizePoint(e){const{page:{view:r},viewport:{rawDims:{pageWidth:n,pageHeight:i,pageX:a,pageY:s}}}=this.parent;return e[1]=r[3]-e[1]+r[1],e[0]=100*(e[0]-a)/n,e[1]=100*(e[1]-s)/i,e}get commentText(){const{data:e}=this;return this.annotationStorage.getRawValue(`${vx}${e.id}`)?.popup?.contents||e.contentsObj?.str||""}set commentText(e){const{data:r}=this,n={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(r.id,{popup:n})||this.annotationStorage.setValue(`${vx}${r.id}`,{id:r.id,annotationType:r.annotationType,pageIndex:this.parent.page._pageIndex,popup:n,popupRef:r.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});const{rect:r,popup:n}=e;r&&this.#r(r);let i=this.#n?.popup||this.popup;!i&&n?.text&&(this._createPopup(n),i=this.#n.popup),i&&(i.updateEdited(e),n?.deleted&&(i.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#e&&(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),this.#e=null)}#r(e){const{container:{style:r},data:{rect:n,rotation:i},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:s,pageX:o,pageY:l}}}}=this;n?.splice(0,4,...e),r.left=`${100*(e[0]-o)/a}%`,r.top=`${100*(s-e[3]+l)/s}%`,i===0?(r.width=`${100*(e[2]-e[0])/a}%`,r.height=`${100*(e[3]-e[1])/s}%`):this.setRotation(i)}_createContainer(e){const{data:r,parent:{page:n,viewport:i}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",r.id),!(this instanceof U0)&&!(this instanceof SD)&&(a.tabIndex=0);const{style:s}=a;if(s.zIndex=this.parent.zIndex,this.parent.zIndex+=2,r.alternativeText&&(a.title=r.alternativeText),r.noRotate&&a.classList.add("norotate"),!r.rect||this instanceof YT){const{rotation:g}=r;return!r.hasOwnCanvas&&g!==0&&this.setRotation(g,a),a}const{width:o,height:l}=this;if(!e&&r.borderStyle.width>0){s.borderWidth=`${r.borderStyle.width}px`;const g=r.borderStyle.horizontalCornerRadius,m=r.borderStyle.verticalCornerRadius;if(g>0||m>0){const y=`calc(${g}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`;s.borderRadius=y}else if(this instanceof BY){const y=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;s.borderRadius=y}switch(r.borderStyle.style){case rg.SOLID:s.borderStyle="solid";break;case rg.DASHED:s.borderStyle="dashed";break;case rg.BEVELED:Jt("Unimplemented border style: beveled");break;case rg.INSET:Jt("Unimplemented border style: inset");break;case rg.UNDERLINE:s.borderBottomStyle="solid";break}const v=r.borderColor||null;v?(this.#t=!0,s.borderColor=ot.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):s.borderWidth=0}const c=ot.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]),{pageWidth:u,pageHeight:h,pageX:f,pageY:d}=i.rawDims;s.left=`${100*(c[0]-f)/u}%`,s.top=`${100*(c[1]-d)/h}%`;const{rotation:p}=r;return r.hasOwnCanvas||p===0?(s.width=`${100*o/u}%`,s.height=`${100*l/h}%`):this.setRotation(p,a),a}setRotation(e,r=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims;let{width:a,height:s}=this;e%180!==0&&([a,s]=[s,a]),r.style.width=`${100*a/n}%`,r.style.height=`${100*s/i}%`,r.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(r,n,i)=>{const a=i.detail[r],s=a[0],o=a.slice(1);i.target.style[n]=bB[`${s}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[n]:bB[`${s}_rgb`](o)})};return Qt(this,"_commonActions",{display:r=>{const{display:n}=r.detail,i=n%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:n===1||n===2})},print:r=>{this.annotationStorage.setValue(this.data.id,{noPrint:!r.detail.print})},hidden:r=>{const{hidden:n}=r.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:r=>{setTimeout(()=>r.target.focus({preventScroll:!1}),0)},userName:r=>{r.target.title=r.detail.userName},readonly:r=>{r.target.disabled=r.detail.readonly},required:r=>{this._setRequired(r.target,r.detail.required)},bgColor:r=>{e("bgColor","backgroundColor",r)},fillColor:r=>{e("fillColor","backgroundColor",r)},fgColor:r=>{e("fgColor","color",r)},textColor:r=>{e("textColor","color",r)},borderColor:r=>{e("borderColor","borderColor",r)},strokeColor:r=>{e("strokeColor","borderColor",r)},rotation:r=>{const n=r.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(e,r){const n=this._commonActions;for(const i of Object.keys(r.detail))(e[i]||n[i])?.(r)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const r=this.annotationStorage.getRawValue(this.data.id);if(!r)return;const n=this._commonActions;for(const[i,a]of Object.entries(r)){const s=n[i];if(s){const o={detail:{[i]:a},target:e};s(o),delete r[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[r,n,i,a]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){const[g,m,v,y]=e.subarray(2,6);if(i===g&&a===m&&r===v&&n===y)return}const{style:s}=this.container;let o;if(this.#t){const{borderColor:g,borderWidth:m}=s;s.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${g}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const l=i-r,c=a-n,{svgFactory:u}=this,h=u.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const f=u.createElement("defs");h.append(f);const d=u.createElement("clipPath"),p=`clippath_${this.data.id}`;d.setAttribute("id",p),d.setAttribute("clipPathUnits","objectBoundingBox"),f.append(d);for(let g=2,m=e.length;g<m;g+=8){const v=e[g],y=e[g+1],x=e[g+2],b=e[g+3],w=u.createElement("rect"),_=(x-r)/l,S=(a-y)/c,C=(v-x)/l,T=(y-b)/c;w.setAttribute("x",_),w.setAttribute("y",S),w.setAttribute("width",C),w.setAttribute("height",T),d.append(w),o?.push(`<rect vector-effect="non-scaling-stroke" x="${_}" y="${S}" width="${C}" height="${T}"/>`)}this.#t&&(o.push("</g></svg>')"),s.backgroundImage=o.join("")),this.container.append(h),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){const{data:r}=this;let n,i;e?(n={str:e.text},i=e.date):(n=r.contentsObj,i=r.modificationDate),this.#n=new YT({data:{color:r.color,titleObj:r.titleObj,modificationDate:i,contentsObj:n,richText:r.richText,parentRect:r.rect,borderStyle:0,id:`popup_${r.id}`,rotation:r.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){rn("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,r=null){const n=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:a,id:s,exportValues:o}of i){if(a===-1||s===r)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!v0.has(c)){Jt(`_getElementsByName - element not allowed: ${s}`);continue}n.push({id:s,exportValue:l,domElement:c})}return n}for(const i of document.getElementsByName(e)){const{exportValue:a}=i,s=i.getAttribute("data-element-id");s!==r&&v0.has(i)&&n.push({id:s,exportValue:a,domElement:i})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const r of e)r.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:r}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:r,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class h9e extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}}class SD extends Sn{constructor(e,r=null){super(e,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let i=!1;return e.url?(r.addLinkAttributes(n,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),i=!0):e.attachment?(this.#t(n,e.attachment,e.overlaidText,e.attachmentDest),i=!0):e.setOCGState?(this.#n(n,e.setOCGState,e.overlaidText),i=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),i=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(n,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&(this.contentElement=n,this.container.append(n)),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,r,n=""){e.href=this.linkService.getDestinationHash(r),e.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&this.#e(),n&&(e.title=n)}_bindNamedAction(e,r,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(r),!1),n&&(e.title=n),this.#e()}#t(e,r,n="",i=null){e.href=this.linkService.getAnchorUrl(""),r.description?e.title=r.description:n&&(e.title=n),e.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,i),!1),this.#e()}#n(e,r,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(r),!1),n&&(e.title=n),this.#e()}_bindJSAction(e,r){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(r.actions)){const a=n.get(i);a&&(e[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:i}}),!1))}r.overlaidText&&(e.title=r.overlaidText),e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,r){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Jt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1);return}e.onclick=()=>{n?.();const{fields:i,refs:a,include:s}=r,o=[];if(i.length!==0||a.length!==0){const u=new Set(a);for(const h of i){const f=this._fieldObjects[h]||[];for(const{id:d}of f)u.add(d)}for(const h of Object.values(this._fieldObjects))for(const f of h)u.has(f.id)===s&&o.push(f)}else for(const u of Object.values(this._fieldObjects))o.push(...u);const l=this.annotationStorage,c=[];for(const u of o){const{id:h}=u;switch(c.push(h),u.type){case"text":{const d=u.defaultValue||"";l.setValue(h,{value:d});break}case"checkbox":case"radiobutton":{const d=u.defaultValue===u.exportValues;l.setValue(h,{value:d});break}case"combobox":case"listbox":{const d=u.defaultValue||"";l.setValue(h,{value:d});break}default:continue}const f=document.querySelector(`[data-element-id="${h}"]`);if(f){if(!v0.has(f)){Jt(`_bindResetFormAction - element not allowed: ${h}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}}class f9e extends Sn{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}}class U0 extends Sn{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return yi.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,r,n,i,a){n.includes("mouse")?e.addEventListener(n,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(n,s=>{if(n==="blur"){if(!r.focused||!s.relatedTarget)return;r.focused=!1}else if(n==="focus"){if(r.focused)return;r.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(s)}})})}_setEventListeners(e,r,n,i){for(const[a,s]of n)(s==="Action"||this.data.actions?.[s])&&((s==="Focus"||s==="Blur")&&(r||={focused:!1}),this._setEventListener(e,r,a,s,i),s==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,r,"blur","Blur",null):s==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,r,"focus","Focus",null))}_setBackgroundColor(e){const r=this.data.backgroundColor||null;e.style.backgroundColor=r===null?"transparent":ot.makeHexColor(r[0],r[1],r[2])}_setTextStyle(e){const r=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||c9e,a=e.style;let s;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),u=Math.round(c/(F8*i))||1,h=c/u;s=Math.min(i,l(h/F8))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);s=Math.min(i,l(c/F8))}a.fontSize=`calc(${s}px * var(--total-scale-factor))`,a.color=ot.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(a.textAlign=r[this.data.textAlignment])}_setRequired(e,r){r?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",r)}}class d9e extends U0{constructor(e){const r=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:r})}setPropertyOnSiblings(e,r,n,i){const a=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[r]=n),a.setValue(s.id,{[i]:n})}render(){const e=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const i=e.getValue(r,{value:this.data.fieldValue});let a=i.value||"";const s=e.getValue(r,{charLimit:this.data.maxLen}).charLimit;s&&a.length>s&&(a=a.slice(0,s));let o=i.formattedValue||this.data.textContent?.join(`
68
68
  `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:a,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",o??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),v0.add(n),this.contentElement=n,n.setAttribute("data-element-id",r),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:c,datetimeType:u,timeStep:h}=this.data,f=!!u&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",p=>{e.setValue(r,{value:p.target.value}),this.setPropertyOnSiblings(n,"value",p.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",p=>{const g=this.data.defaultFieldValue??"";n.value=l.userValue=g,l.formattedValue=null});let d=p=>{const{formattedValue:g}=l;g!=null&&(p.target.value=g),p.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",g=>{if(l.focused)return;const{target:m}=g;if(f&&(m.type=u,h&&(m.step=h)),l.userValue){const v=l.userValue;if(f)if(u==="time"){const y=new Date(v),x=[y.getHours(),y.getMinutes(),y.getSeconds()];m.value=x.map(b=>b.toString().padStart(2,"0")).join(":")}else m.value=new Date(v-u9e).toISOString().split(u==="date"?"T":".",1)[0];else m.value=v}l.lastCommittedValue=m.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target);const m={value(v){l.userValue=v.detail.value??"",f||e.setValue(r,{value:l.userValue.toString()}),v.target.value=l.userValue},formattedValue(v){const{formattedValue:y}=v.detail;l.formattedValue=y,y!=null&&v.target!==document.activeElement&&(v.target.value=y);const x={formattedValue:y};f&&(x.value=y),e.setValue(r,x)},selRange(v){v.target.setSelectionRange(...v.detail.selRange)},charLimit:v=>{const{charLimit:y}=v.detail,{target:x}=v;if(y===0){x.removeAttribute("maxLength");return}x.setAttribute("maxLength",y);let b=l.userValue;!b||b.length<=y||(b=b.slice(0,y),x.value=l.userValue=b,e.setValue(r,{value:b}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:b,willCommit:!0,commitKey:1,selStart:x.selectionStart,selEnd:x.selectionEnd}}))}};this._dispatchEventFromSandbox(m,g)}),n.addEventListener("keydown",g=>{l.commitKey=1;let m=-1;if(g.key==="Escape"?m=0:g.key==="Enter"&&!this.data.multiLine?m=2:g.key==="Tab"&&(l.commitKey=3),m===-1)return;const{value:v}=g.target;l.lastCommittedValue!==v&&(l.lastCommittedValue=v,l.userValue=v,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:v,willCommit:!0,commitKey:m,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const p=d;d=null,n.addEventListener("blur",g=>{if(!l.focused||!g.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:m}=g;let{value:v}=m;if(f){if(v&&u==="time"){const y=v.split(":").map(x=>parseInt(x,10));v=new Date(2e3,0,1,y[0],y[1],y[2]||0).valueOf(),m.step=""}else v.includes("T")||(v=`${v}T00:00`),v=new Date(v).valueOf();m.type="text"}l.userValue=v,l.lastCommittedValue!==v&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:v,willCommit:!0,commitKey:l.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}),p(g)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",g=>{l.lastCommittedValue=null;const{data:m,target:v}=g,{value:y,selectionStart:x,selectionEnd:b}=v;let w=x,_=b;switch(g.inputType){case"deleteWordBackward":{const S=y.substring(0,x).match(/\w*[^\w]*$/);S&&(w-=S[0].length);break}case"deleteWordForward":{const S=y.substring(x).match(/^[^\w]*\w*/);S&&(_+=S[0].length);break}case"deleteContentBackward":x===b&&(w-=1);break;case"deleteContentForward":x===b&&(_+=1);break}g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:y,change:m||"",willCommit:!1,selStart:w,selEnd:_}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(d&&n.addEventListener("blur",d),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class p9e extends U0{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class g9e extends U0{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,r=this.data,n=r.id;let i=e.getValue(n,{value:r.exportValue===r.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(n,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return v0.add(a),a.setAttribute("data-element-id",n),a.disabled=r.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=r.fieldName,i&&a.setAttribute("checked",!0),a.setAttribute("exportValue",r.exportValue),a.tabIndex=0,a.addEventListener("change",s=>{const{name:o,checked:l}=s.target;for(const c of this._getElementsByName(o,n)){const u=l&&c.exportValue===r.exportValue;c.domElement&&(c.domElement.checked=u),e.setValue(c.id,{value:u})}e.setValue(n,{value:l})}),a.addEventListener("resetform",s=>{const o=r.defaultFieldValue||"Off";s.target.checked=o===r.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",s=>{const o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(n,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,s)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class BY extends U0{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,r=this.data,n=r.id;let i=e.getValue(n,{value:r.fieldValue===r.buttonValue}).value;if(typeof i=="string"&&(i=i!==r.buttonValue,e.setValue(n,{value:i})),i)for(const s of this._getElementsByName(r.fieldName,n))e.setValue(s.id,{value:!1});const a=document.createElement("input");if(v0.add(a),a.setAttribute("data-element-id",n),a.disabled=r.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=r.fieldName,i&&a.setAttribute("checked",!0),a.tabIndex=0,a.addEventListener("change",s=>{const{name:o,checked:l}=s.target;for(const c of this._getElementsByName(o,n))e.setValue(c.id,{value:!1});e.setValue(n,{value:l})}),a.addEventListener("resetform",s=>{const o=r.defaultFieldValue;s.target.checked=o!=null&&o===r.buttonValue}),this.enableScripting&&this.hasJSActions){const s=r.buttonValue;a.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const u=s===c.detail.value;for(const h of this._getElementsByName(c.target.name)){const f=u&&h.id===n;h.domElement&&(h.domElement.checked=f),e.setValue(h.id,{value:f})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class m9e extends SD{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const r=e.lastChild;return this.enableScripting&&this.hasJSActions&&r&&(this._setDefaultPropertiesFromJS(r),r.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({},n)})),e}}class v9e extends U0{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,r=this.data.id,n=e.getValue(r,{value:this.data.fieldValue}),i=document.createElement("select");v0.add(i),i.setAttribute("data-element-id",r),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",u=>{const h=this.data.defaultFieldValue;for(const f of i.options)f.selected=f.value===h});for(const u of this.data.options){const h=document.createElement("option");h.textContent=u.displayValue,h.value=u.exportValue,n.value.includes(u.exportValue)&&(h.setAttribute("selected",!0),a=!1),i.append(h)}let s=null;if(a){const u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),i.prepend(u),s=()=>{u.remove(),i.removeEventListener("input",s),s=null},i.addEventListener("input",s)}const o=u=>{const h=u?"value":"textContent",{options:f,multiple:d}=i;return d?Array.prototype.filter.call(f,p=>p.selected).map(p=>p[h]):f.selectedIndex===-1?null:f[f.selectedIndex][h]};let l=o(!1);const c=u=>{const h=u.target.options;return Array.prototype.map.call(h,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",u=>{const h={value(f){s?.();const d=f.detail.value,p=new Set(Array.isArray(d)?d:[d]);for(const g of i.options)g.selected=p.has(g.value);e.setValue(r,{value:o(!0)}),l=o(!1)},multipleSelection(f){i.multiple=!0},remove(f){const d=i.options,p=f.detail.remove;d[p].selected=!1,i.remove(p),d.length>0&&Array.prototype.findIndex.call(d,m=>m.selected)===-1&&(d[0].selected=!0),e.setValue(r,{value:o(!0),items:c(f)}),l=o(!1)},clear(f){for(;i.length!==0;)i.remove(0);e.setValue(r,{value:null,items:[]}),l=o(!1)},insert(f){const{index:d,displayValue:p,exportValue:g}=f.detail.insert,m=i.children[d],v=document.createElement("option");v.textContent=p,v.value=g,m?m.before(v):i.append(v),e.setValue(r,{value:o(!0),items:c(f)}),l=o(!1)},items(f){const{items:d}=f.detail;for(;i.length!==0;)i.remove(0);for(const p of d){const{displayValue:g,exportValue:m}=p,v=document.createElement("option");v.textContent=g,v.value=m,i.append(v)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(r,{value:o(!0),items:c(f)}),l=o(!1)},indices(f){const d=new Set(f.detail.indices);for(const p of f.target.options)p.selected=d.has(p.index);e.setValue(r,{value:o(!0)}),l=o(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(h,u)}),i.addEventListener("input",u=>{const h=o(!0),f=o(!1);e.setValue(r,{value:h}),u.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:l,change:f,changeEx:h,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):i.addEventListener("input",function(u){e.setValue(r,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class YT extends Sn{constructor(e){const{data:r,elements:n,parent:i}=e,a=!!i._commentManager;if(super(e,{isRenderable:!a&&Sn._hasPopupData(r)}),this.elements=n,a&&Sn._hasPopupData(r)){const s=this.popup=this.#e();for(const o of n)o.popup=s}else this.popup=null}#e(){return new y9e({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";const r=this.popup=this.#e(),n=[];for(const i of this.elements)i.popup=r,i.container.ariaHasPopup="dialog",n.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(i=>`${yg}${i}`).join(",")),this.container}}class y9e{#e=null;#t=this.#H.bind(this);#n=this.#$.bind(this);#r=this.#P.bind(this);#i=this.#_.bind(this);#a=null;#s=null;#o=null;#l=null;#c=null;#f=null;#h=null;#d=!1;#m=null;#g=null;#u=null;#p=null;#v=null;#x=null;#y=null;#C=null;#S=null;#b=null;#T=!1;#w=null;#A=null;constructor({container:e,color:r,elements:n,titleObj:i,modificationDate:a,contentsObj:s,richText:o,parent:l,rect:c,parentRect:u,open:h,commentManager:f=null}){this.#s=e,this.#S=i,this.#o=s,this.#C=o,this.#f=l,this.#a=r,this.#y=c,this.#h=u,this.#c=n,this.#e=f,this.#w=n[0],this.#l=UT.toDateObject(a),this.trigger=n.flatMap(d=>d.getElementsToTriggerPopup()),f||(this.#D(),this.#s.hidden=!0,h&&this.#_())}#D(){if(this.#g)return;this.#g=new AbortController;const{signal:e}=this.#g;for(const r of this.trigger)r.addEventListener("click",this.#i,{signal:e}),r.addEventListener("pointerenter",this.#r,{signal:e}),r.addEventListener("pointerleave",this.#n,{signal:e}),r.classList.add("popupTriggerArea");for(const r of this.#c)r.container?.addEventListener("keydown",this.#t,{signal:e})}#E(){const e=this.#c.find(r=>r.hasCommentButton);e&&(this.#v=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#p){this.#p.parentNode||this.#w.container.after(this.#p);return}if(this.#v||this.#E(),!this.#v)return;const{signal:e}=this.#g=new AbortController,r=this.#w.hasOwnCommentButton,n=()=>{this.#e.toggleCommentPopup(this,!0,void 0,!r)},i=()=>{this.#e.toggleCommentPopup(this,!1,!0,!r)},a=()=>{this.#e.toggleCommentPopup(this,!1,!1)};if(r){this.#p=this.#w.container;for(const s of this.trigger)s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.addEventListener("keydown",this.#t,{signal:e}),s.addEventListener("click",n,{signal:e}),s.addEventListener("pointerenter",i,{signal:e}),s.addEventListener("pointerleave",a,{signal:e}),s.classList.add("popupTriggerArea")}else{const s=this.#p=document.createElement("button");s.className="annotationCommentButton";const o=this.#w.container;s.style.zIndex=o.style.zIndex+1,s.tabIndex=0,s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#B(),this.#I(),s.addEventListener("keydown",this.#t,{signal:e}),s.addEventListener("click",n,{signal:e}),s.addEventListener("pointerenter",i,{signal:e}),s.addEventListener("pointerleave",a,{signal:e}),o.after(s)}}#I(){if(this.#w.extraPopupElement&&!this.#w.editor)return;this.#p||this.renderCommentButton();const[e,r]=this.#v,{style:n}=this.#p;n.left=`calc(${e}%)`,n.top=`calc(${r}% - var(--comment-button-dim))`}#B(){this.#w.extraPopupElement||(this.#p||this.renderCommentButton(),this.#p.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:e,opacity:r}=this.#w.commentData;return e?this.#f._commentManager.makeCommentColor(e,r):null}focusCommentButton(){setTimeout(()=>{this.#p?.focus()},0)}getData(){const{richText:e,color:r,opacity:n,creationDate:i,modificationDate:a}=this.#w.commentData;return{contentsObj:{str:this.comment},richText:e,color:r,opacity:n,creationDate:i,modificationDate:a}}get elementBeforePopup(){return this.#p}get comment(){return this.#A||=this.#w.commentText,this.#A}set comment(e){e!==this.comment&&(this.#w.commentText=this.#A=e)}focus(){this.#w.container?.focus()}get parentBoundingClientRect(){return this.#w.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:r}){this.#p&&(this.#p.classList.toggle("selected",e),this.#p.ariaExpanded=r)}setSelectedCommentButton(e){this.#p.classList.toggle("selected",e)}get commentPopupPosition(){if(this.#x)return this.#x;const{x:e,y:r,height:n}=this.#p.getBoundingClientRect(),{x:i,y:a,width:s,height:o}=this.#w.layer.getBoundingClientRect();return[(e-i)/s,(r+n-a)/o]}set commentPopupPosition(e){this.#x=e}hasDefaultPopupPosition(){return this.#x===null}get commentButtonPosition(){return this.#v}get commentButtonWidth(){return this.#p.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[r,n]=this.#x||this.commentButtonPosition.map(c=>c/100),i=this.parentBoundingClientRect,{x:a,y:s,width:o,height:l}=i;this.#e.showDialog(null,this,a+r*o,s+n*l,{...e,parentDimensions:i})}render(){if(this.#m)return;const e=this.#m=document.createElement("div");if(e.className="popup",this.#a){const n=e.style.outlineColor=ot.makeHexColor(...this.#a);e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`}const r=document.createElement("span");if(r.className="header",this.#S?.str){const n=document.createElement("span");n.className="title",r.append(n),{dir:n.dir,str:n.textContent}=this.#S}if(e.append(r),this.#l){const n=document.createElement("time");n.className="popupDate",n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#l.valueOf()})),n.dateTime=this.#l.toISOString(),r.append(n)}mY({html:this.#L||this.#o.str,dir:this.#o?.dir,className:"popupContent"},e),this.#s.append(e)}get#L(){const e=this.#C,r=this.#o;return e?.str&&(!r?.str||r.str===e.str)&&this.#C.html||null}get#R(){return this.#L?.attributes?.style?.fontSize||0}get#F(){return this.#L?.attributes?.style?.color||null}#N(e){const r=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:r}]}},i={style:{color:this.#F,fontSize:this.#R?`calc(${this.#R}px * var(--total-scale-factor))`:""}};for(const a of e.split(`
69
69
  `))r.push({name:"span",value:a,attributes:i});return n}#H(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#d)&&this.#_()}updateEdited({rect:e,popup:r,deleted:n}){if(this.#e){n?(this.remove(),this.#A=null):r&&(r.deleted?this.remove():(this.#B(),this.#A=r.text)),e&&(this.#v=null,this.#E(),this.#I());return}if(n||r?.deleted){this.remove();return}this.#D(),this.#b||={contentsObj:this.#o,richText:this.#C},e&&(this.#u=null),r&&r.text&&(this.#C=this.#N(r.text),this.#l=UT.toDateObject(r.date),this.#o=null),this.#m?.remove(),this.#m=null}resetEdited(){this.#b&&({contentsObj:this.#o,richText:this.#C}=this.#b,this.#b=null,this.#m?.remove(),this.#m=null,this.#u=null)}remove(){if(this.#g?.abort(),this.#g=null,this.#m?.remove(),this.#m=null,this.#T=!1,this.#d=!1,this.#p?.remove(),this.#p=null,this.trigger)for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#k(){if(this.#u!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:r,pageHeight:n,pageX:i,pageY:a}}}=this.#f;let s=!!this.#h,o=s?this.#h:this.#y;for(const p of this.#c)if(!o||ot.intersect(p.data.rect,o)!==null){o=p.data.rect,s=!0;break}const l=ot.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,h=l[0]+u,f=l[1];this.#u=[100*(h-i)/r,100*(f-a)/n];const{style:d}=this.#s;d.left=`${this.#u[0]}%`,d.top=`${this.#u[1]}%`}#_(){if(this.#e){this.#e.toggleCommentPopup(this,!1);return}this.#d=!this.#d,this.#d?(this.#P(),this.#s.addEventListener("click",this.#i),this.#s.addEventListener("keydown",this.#t)):(this.#$(),this.#s.removeEventListener("click",this.#i),this.#s.removeEventListener("keydown",this.#t))}#P(){this.#m||this.render(),this.isVisible?this.#d&&this.#s.classList.add("focused"):(this.#k(),this.#s.hidden=!1,this.#s.style.zIndex=parseInt(this.#s.style.zIndex)+1e3)}#$(){this.#s.classList.remove("focused"),!(this.#d||!this.isVisible)&&(this.#s.hidden=!0,this.#s.style.zIndex=parseInt(this.#s.style.zIndex)-1e3)}forceHide(){this.#T=this.isVisible,this.#T&&(this.#s.hidden=!0)}maybeShow(){this.#e||(this.#D(),this.#T&&(this.#m||this.#P(),this.#T=!1,this.#s.hidden=!1))}get isVisible(){return this.#e?!1:this.#s.hidden===!1}}class FY extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=er.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=this.contentElement=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const r of this.textContent){const n=document.createElement("span");n.textContent=r,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}class x9e extends Sn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:r,height:n}=this,i=this.svgFactory.create(r,n,!0),a=this.#e=this.svgFactory.createElement("svg:line");return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class b9e extends Sn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:r,height:n}=this,i=this.svgFactory.create(r,n,!0),a=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",a/2),s.setAttribute("y",a/2),s.setAttribute("width",r-a),s.setAttribute("height",n-a),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class w9e extends Sn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:r,height:n}=this,i=this.svgFactory.create(r,n,!0),a=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",r/2),s.setAttribute("cy",n/2),s.setAttribute("rx",r/2-a/2),s.setAttribute("ry",n/2-a/2),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class $Y extends Sn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:r,borderStyle:n,popupRef:i},width:a,height:s}=this;if(!r)return this.container;const o=this.svgFactory.create(a,s,!0);let l=[];for(let u=0,h=r.length;u<h;u+=2){const f=r[u]-e[0],d=e[3]-r[u+1];l.push(`${f},${d}`)}l=l.join(" ");const c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute("points",l),c.setAttribute("stroke-width",n.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),o.append(c),this.container.append(o),!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class _9e extends $Y{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class S9e extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}}class CD extends Sn{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?er.HIGHLIGHT:er.INK}#n(e,r){switch(e){case 90:return{transform:`rotate(90) translate(${-r[0]},${r[1]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};case 180:return{transform:`rotate(180) translate(${-r[2]},${r[1]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]};case 270:return{transform:`rotate(270) translate(${-r[2]},${r[3]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};default:return{transform:`translate(${-r[0]},${r[3]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:r,inkLists:n,borderStyle:i,popupRef:a}}=this,{transform:s,width:o,height:l}=this.#n(r,e),c=this.svgFactory.create(o,l,!0),u=this.#e=this.svgFactory.createElement("svg:g");c.append(u),u.setAttribute("stroke-width",i.width||1),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("stroke-miterlimit",10),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),u.setAttribute("transform",s);for(let h=0,f=n.length;h<f;h++){const d=this.svgFactory.createElement(this.svgElementName);this.#t.push(d),d.setAttribute("points",n[h].join(",")),u.append(d)}return!a&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:r,points:n,rect:i}=e,a=this.#e;if(r>=0&&a.setAttribute("stroke-width",r||1),n)for(let s=0,o=this.#t.length;s<o;s++)this.#t[s].setAttribute("points",n[s].join(","));if(i){const{transform:s,width:o,height:l}=this.#n(this.data.rotation,i);a.parentElement.setAttribute("viewBox",`0 0 ${o} ${l}`),a.setAttribute("transform",s)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class zY extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=er.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:r}}=this;if(!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){const n=document.createElement("mark");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class C9e extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:r}}=this;if(!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),e){const n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class A9e extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:r}}=this;if(!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),e){const n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class T9e extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:r}}=this;if(!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),e){const n=document.createElement("s");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class VY extends Sn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=er.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}class k9e extends Sn{#e=null;constructor(e){super(e,{isRenderable:!0});const{file:r}=this.data;this.filename=r.filename,this.content=r.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:r}=this;let n;r.hasAppearance||r.fillAlpha===0?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),n.addEventListener("dblclick",this.#t.bind(this)),this.#e=n;const{isMac:i}=yi.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(i?a.metaKey:a.ctrlKey)&&this.#t()}),!r.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class AD{#e=null;#t=null;#n=null;#r=new Map;#i=null;#a=null;#s=[];#o=!1;constructor({div:e,accessibilityManager:r,annotationCanvasMap:n,annotationEditorUIManager:i,page:a,viewport:s,structTreeLayer:o,commentManager:l,linkService:c,annotationStorage:u}){this.div=e,this.#e=r,this.#t=n,this.#i=o||null,this.#a=c||null,this.#n=u||new yD,this.page=a,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=l||null}hasEditableAnnotations(){return this.#r.size>0}async render(e){const{annotations:r}=e,n=this.div;m0(n,this.viewport);const i=new Map,a=[],s={data:null,layer:n,linkService:this.#a,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new WS,annotationStorage:this.#n,enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const o of r){if(o.noHTML)continue;const l=o.annotationType===Jn.POPUP;if(l){const h=i.get(o.id);if(!h)continue;if(!this._commentManager){a.push(o);continue}s.elements=h}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;s.data=o;const c=W8.create(s);if(!c.isRenderable)continue;if(!l&&(this.#s.push(c),o.popupRef)){const h=i.get(o.popupRef);h?h.push(c):i.set(o.popupRef,[c])}const u=c.render();o.hidden&&(u.style.visibility="hidden"),c._isEditable&&(this.#r.set(c.data.id,c),this._annotationEditorUIManager?.renderAnnotationElement(c))}await this.#l();for(const o of a){const l=s.elements=i.get(o.id);s.data=o;const c=W8.create(s);if(!c.isRenderable)continue;const u=c.render();c.contentElement.id=`${yg}${o.id}`,o.hidden&&(u.style.visibility="hidden"),l.at(-1).container.after(u)}this.#c()}async#l(){if(this.#s.length===0)return;this.div.replaceChildren();const e=[];if(!this.#o){this.#o=!0;for(const{contentElement:n,data:{id:i}}of this.#s){const a=n.id=`${yg}${i}`;e.push(this.#i?.getAriaAttributes(a).then(s=>{if(s)for(const[o,l]of s)n.setAttribute(o,l)}))}}this.#s.sort(({data:{rect:[n,i,a,s]}},{data:{rect:[o,l,c,u]}})=>{if(n===a&&i===s)return 1;if(o===c&&l===u)return-1;const h=s,f=i,d=(i+s)/2,p=u,g=l,m=(l+u)/2;if(d>=p&&m<=f)return-1;if(m>=h&&d<=g)return 1;const v=(n+a)/2,y=(o+c)/2;return v-y});const r=document.createDocumentFragment();for(const n of this.#s)r.append(n.container),this._commentManager?(n.extraPopupElement?.popup||n.popup)?.renderCommentButton():n.extraPopupElement&&r.append(n.extraPopupElement.render());if(this.div.append(r),await Promise.all(e),this.#e)for(const n of this.#s)this.#e.addPointerInTextLayer(n.contentElement,!1)}async addLinkAnnotations(e){const r={data:null,layer:this.div,linkService:this.#a,svgFactory:new WS,parent:this};for(const n of e){n.borderStyle||=AD._defaultBorderStyle,r.data=n;const i=W8.create(r);i.isRenderable&&(i.render(),i.contentElement.id=`${yg}${n.id}`,this.#s.push(i))}await this.#l()}update({viewport:e}){const r=this.div;this.viewport=e,m0(r,{rotation:e.rotation}),this.#c(),r.hidden=!1}#c(){if(!this.#t)return;const e=this.div;for(const[r,n]of this.#t){const i=e.querySelector(`[data-annotation-id="${r}"]`);if(!i)continue;n.className="annotationContent";const{firstChild:a}=i;a?a.nodeName==="CANVAS"?a.replaceWith(n):a.classList.contains("annotationContent")?a.after(n):a.before(n):i.append(n);const s=this.#r.get(r);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(r,i.id,n),s._hasNoCanvas=!1):s.canvas=n)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#r.values())}getEditableAnnotation(e){return this.#r.get(e)}addFakeAnnotation(e){const{div:r}=this,{id:n,rotation:i}=e,a=new h9e({data:{id:n,rect:e.getPDFRect(),rotation:i},editor:e,layer:r,parent:this,enableComment:!!this._commentManager,linkService:this.#a,annotationStorage:this.#n});return a.render(),a.contentElement.id=`${yg}${n}`,a.createOrUpdatePopup(),this.#s.push(a),a}removeAnnotation(e){const r=this.#s.findIndex(i=>i.data.id===e);if(r<0)return;const[n]=this.#s.splice(r,1);this.#e?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(const r of e)r.updateFakeAnnotationElement(this);this.#l()}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return Qt(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:rg.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const V2=/\r\n?|\n/g;class Ti extends It{#e="";#t=`${this.id}-editor`;#n=null;#r;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=Ti.prototype,r=a=>a.isEmpty(),n=nf.TRANSLATE_SMALL,i=nf.TRANSLATE_BIG;return Qt(this,"_keyboardManager",new Tb([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:r}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:r}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:r}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:r}]]))}static _type="freetext";static _editorType=er.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.color=e.color||Ti._defaultColor||It._defaultLineColor,this.#r=e.fontSize||Ti._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static initialize(e,r){It.initialize(e,r);const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,r){switch(e){case _r.FREETEXT_SIZE:Ti._defaultFontSize=r;break;case _r.FREETEXT_COLOR:Ti._defaultColor=r;break}}updateParams(e,r){switch(e){case _r.FREETEXT_SIZE:this.#i(r);break;case _r.FREETEXT_COLOR:this.#a(r);break}}static get defaultPropertiesToUpdate(){return[[_r.FREETEXT_SIZE,Ti._defaultFontSize],[_r.FREETEXT_COLOR,Ti._defaultColor||It._defaultLineColor]]}get propertiesToUpdate(){return[[_r.FREETEXT_SIZE,this.#r],[_r.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new _x(this),[["colorPicker",this._colorPicker]]}get colorType(){return _r.FREETEXT_COLOR}#i(e){const r=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--total-scale-factor))`,this.translate(0,-(i-this.#r)*this.parentScale),this.#r=i,this.#o()},n=this.#r;this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_r.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#a(e){const r=i=>{this.color=i,this.onUpdatedColor()},n=this.color;this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_r.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,r){this._uiManager.translateSelectedEditors(e,r,!0)}getInitialTranslation(){const e=this.parentScale;return[-Ti._internalPadding*e,-(Ti._internalPadding+this.#r)*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#n=new AbortController;const e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#t),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#s(){const e=[];this.editorDiv.normalize();let r=null;for(const n of this.editorDiv.childNodes)r?.nodeType===Node.TEXT_NODE&&n.nodeName==="BR"||(e.push(Ti.#l(n)),r=n);return e.join(`
70
70
  `)}#o(){const[e,r]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:i,div:a}=this,s=a.style.display,o=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",i.div.append(this.div),n=a.getBoundingClientRect(),a.remove(),a.style.display=s,a.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/r):(this.width=n.height/e,this.height=n.width/r),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#e,r=this.#e=this.#s().trimEnd();if(e===r)return;const n=i=>{if(this.#e=i,!i){this.remove();return}this.#c(),this._uiManager.rebuild(this),this.#o()};this.addCommands({cmd:()=>{n(r)},undo:()=>{n(e)},mustExec:!1}),this.#o()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){Ti._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,r;(this._isCopy||this.annotationElementId)&&(e=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#t),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,a]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,u]=this.pageDimensions,[h,f]=this.pageTranslation;let d,p;switch(this.rotation){case 0:d=e+(s[0]-h)/c,p=r+this.height-(s[1]-f)/u;break;case 90:d=e+(s[0]-h)/c,p=r-(s[1]-f)/u,[o,l]=[l,-o];break;case 180:d=e-this.width+(s[0]-h)/c,p=r-(s[1]-f)/u,[o,l]=[-o,-l];break;case 270:d=e+(s[0]-h-this.height*u)/c,p=r+(s[1]-f-this.width*c)/u,[o,l]=[-l,o];break}this.setAt(d*i,p*a,o,l)}else this._moveAfterPaste(e,r);this.#c(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#l(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(V2,"")}editorDivPaste(e){const r=e.clipboardData||window.clipboardData,{types:n}=r;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();const i=Ti.#h(r.getData("text")||"").replaceAll(V2,`
@@ -313,8 +313,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error
313
313
  node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.x<e.x?s-a:s+a;const l=t.height/2,c=Math.abs(e.y-r.y),u=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(n-e.x)*l){let h=r.y<e.y?e.y-l-i:i-l-e.y;o=u*h/c;const f={x:r.x<e.x?r.x+o:r.x-u+o,y:r.y<e.y?r.y+c-h:r.y-c+h};return o===0&&(f.x=e.x,f.y=e.y),u===0&&(f.x=e.x),c===0&&(f.y=e.y),Me.debug(`abc89 top/bottom calc, Q ${c}, q ${h}, R ${u}, r ${o}`,f),f}else{r.x<e.x?o=e.x-s-n:o=n-s-e.x;let h=c*o/u,f=r.x<e.x?r.x+u-o:r.x-u+o,d=r.y<e.y?r.y+h:r.y-h;return Me.debug(`sides calc abc89, Q ${c}, q ${h}, R ${u}, r ${o}`,{_x:f,_y:d}),o===0&&(f=e.x,d=e.y),u===0&&(f=e.x),c===0&&(d=e.y),{x:f,y:d}}},"intersection"),RF=F((t,e)=>{Me.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(Me.info("abc88 checking point",a,e),!fEe(e,a)&&!i){const s=dEe(e,n,a);Me.debug("abc88 inside",a,n,s),Me.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?Me.warn("abc88 no intersect",s,r):r.push(s),i=!0}else Me.warn("abc88 outside",a,n),n=a,i||r.push(a)}),Me.debug("returning points",r),r},"cutPathAtIntersect");function Xte(t){const e=[],r=[];for(let n=1;n<t.length-1;n++){const i=t[n-1],a=t[n],s=t[n+1];(i.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}F(Xte,"extractCornerPoints");var NF=F(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),pEe=F(function(t){const{cornerPointPositions:e}=Xte(t),r=[];for(let n=0;n<t.length;n++)if(e.includes(n)){const i=t[n-1],a=t[n+1],s=t[n],o=NF(i,s,5),l=NF(a,s,5),c=l.x-o.x,u=l.y-o.y;r.push(o);const h=Math.sqrt(2)*2;let f={x:s.x,y:s.y};if(Math.abs(a.x-i.x)>10&&Math.abs(a.y-i.y)>=10){Me.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const d=5;s.x===o.x?f={x:c<0?o.x-d+h:o.x+d-h,y:u<0?o.y-h:o.y+h}:f={x:c<0?o.x-h:o.x+h,y:u<0?o.y-d+h:o.y+d-h}}else Me.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),gEe=F((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),Yte=F(function(t,e,r,n,i,a,s,o=!1){const{handDrawnSeed:l}=Or();let c=e.points,u=!1;const h=i;var f=a;const d=[];for(const M in e.cssCompiledStyles)nM(M)||d.push(e.cssCompiledStyles[M]);Me.debug("UIO intersect check",e.points,f.x,h.x),f.intersect&&h.intersect&&!o&&(c=c.slice(1,e.points.length-1),c.unshift(h.intersect(c[0])),Me.debug("Last point UIO",e.start,"-->",e.end,c[c.length-1],f,f.intersect(c[c.length-1])),c.push(f.intersect(c[c.length-1])));const p=btoa(JSON.stringify(c));e.toCluster&&(Me.info("to cluster abc88",r.get(e.toCluster)),c=RF(e.points,r.get(e.toCluster).node),u=!0),e.fromCluster&&(Me.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(c,null,2)),c=RF(c.reverse(),r.get(e.fromCluster).node).reverse(),u=!0);let g=c.filter(M=>!Number.isNaN(M.y));g=pEe(g);let m=Py;switch(m=i9,e.curve){case"linear":m=i9;break;case"basis":m=Py;break;case"cardinal":m=aZ;break;case"bumpX":m=eZ;break;case"bumpY":m=tZ;break;case"catmullRom":m=oZ;break;case"monotoneX":m=dZ;break;case"monotoneY":m=pZ;break;case"natural":m=mZ;break;case"step":m=vZ;break;case"stepAfter":m=xZ;break;case"stepBefore":m=yZ;break;default:m=Py}const{x:v,y}=iQ(e),x=JK().x(v).y(y).curve(m);let b;switch(e.thickness){case"normal":b="edge-thickness-normal";break;case"thick":b="edge-thickness-thick";break;case"invisible":b="edge-thickness-invisible";break;default:b="edge-thickness-normal"}switch(e.pattern){case"solid":b+=" edge-pattern-solid";break;case"dotted":b+=" edge-pattern-dotted";break;case"dashed":b+=" edge-pattern-dashed";break;default:b+=" edge-pattern-solid"}let w,_=e.curve==="rounded"?Kte(Zte(g,e),5):x(g);const S=Array.isArray(e.style)?e.style:[e.style];let C=S.find(M=>M?.startsWith("stroke:")),T=!1;if(e.look==="handDrawn"){const M=pt.svg(t);Object.assign([],g);const R=M.path(_,{roughness:.3,seed:l});b+=" transition",w=Cr(R).select("path").attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")).attr("style",S?S.reduce((L,P)=>L+";"+P,""):"");let D=w.attr("d");w.attr("d",D),t.node().appendChild(w.node())}else{const M=d.join(";"),R=S?S.reduce((U,j)=>U+j+";",""):"";let D="";e.animate&&(D=" edge-animation-fast"),e.animation&&(D=" edge-animation-"+e.animation);const L=(M?M+";"+R+";":R)+";"+(S?S.reduce((U,j)=>U+";"+j,""):"");w=t.append("path").attr("d",_).attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")+(D??"")).attr("style",L),C=L.match(/stroke:([^;]+)/)?.[1],T=e.animate===!0||!!e.animation||M.includes("animation");const P=w.node(),O=typeof P.getTotalLength=="function"?P.getTotalLength():0,$=tF[e.arrowTypeStart]||0,N=tF[e.arrowTypeEnd]||0;if(e.look==="neo"&&!T){const j=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?gEe(O,$,N):`0 ${$} ${O-$-N} ${N}`}; stroke-dashoffset: 0;`;w.attr("style",j+w.attr("style"))}}w.attr("data-edge",!0),w.attr("data-et","edge"),w.attr("data-id",e.id),w.attr("data-points",p),e.showPoints&&g.forEach(M=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",M.x).attr("cy",M.y)});let A="";(Or().flowchart.arrowMarkerAbsolute||Or().state.arrowMarkerAbsolute)&&(A=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,A=A.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Me.info("arrowTypeStart",e.arrowTypeStart),Me.info("arrowTypeEnd",e.arrowTypeEnd),cEe(w,e,A,s,n,C);const k=Math.floor(c.length/2),I=c[k];To.isLabelCoordinateInPath(I,w.attr("d"))||(u=!0);let E={};return u&&(E.updatedPath=c),E.originalPath=e.points,E},"insertEdge");function Kte(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a<n;a++){const s=t[a],o=t[a-1],l=t[a+1];if(a===0)r+=`M${s.x},${s.y}`;else if(a===n-1)r+=`L${s.x},${s.y}`;else{const c=s.x-o.x,u=s.y-o.y,h=l.x-s.x,f=l.y-s.y,d=Math.hypot(c,u),p=Math.hypot(h,f);if(d<i||p<i){r+=`L${s.x},${s.y}`;continue}const g=c/d,m=u/d,v=h/p,y=f/p,x=g*v+m*y,b=Math.max(-1,Math.min(1,x)),w=Math.acos(b);if(w<i||Math.abs(Math.PI-w)<i){r+=`L${s.x},${s.y}`;continue}const _=Math.min(e/Math.sin(w/2),d/2,p/2),S=s.x-g*_,C=s.y-m*_,T=s.x+v*_,A=s.y+y*_;r+=`L${S},${C}`,r+=`Q${s.x},${s.y} ${T},${A}`}}return r}F(Kte,"generateRoundedPath");function Kk(t,e){if(!t||!e)return{angle:0,deltaX:0,deltaY:0};const r=e.x-t.x,n=e.y-t.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}F(Kk,"calculateDeltaAndAngle");function Zte(t,e){const r=t.map(i=>({...i}));if(t.length>=2&&ga[e.arrowTypeStart]){const i=ga[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=Kk(a,s),l=i*Math.cos(o),c=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+c}const n=t.length;if(n>=2&&ga[e.arrowTypeEnd]){const i=ga[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=Kk(s,a),l=i*Math.cos(o),c=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-c}return r}F(Zte,"applyMarkerOffsetsToPoints");var mEe=F((t,e,r,n)=>{e.forEach(i=>{LEe[i](t,r,n)})},"insertMarkers"),vEe=F((t,e,r)=>{Me.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),yEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),xEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),bEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),wEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),_Ee=F((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),SEe=F((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),CEe=F((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),AEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),TEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),kEe=F((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),EEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),IEe=F((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),DEe=F((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
314
314
  L20,10
315
315
  M20,10
316
- L0,20`)},"requirement_arrow"),MEe=F((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),LEe={extension:vEe,composition:yEe,aggregation:xEe,dependency:bEe,lollipop:wEe,point:_Ee,circle:SEe,cross:CEe,barb:AEe,only_one:TEe,zero_or_one:kEe,one_or_more:EEe,zero_or_more:IEe,requirement_arrow:DEe,requirement_contains:MEe},Jte=mEe,PEe={common:j0,getConfig:sa,insertCluster:kee,insertEdge:Yte,insertEdgeLabel:Wte,insertMarkers:Jte,insertNode:MM,interpolateToCurve:cM,labelHelper:Nt,log:Me,positionEdgeLabel:qte},Ox={},Qte=F(t=>{for(const e of t)Ox[e.name]=e},"registerLayoutLoaders"),REe=F(()=>{Qte([{name:"dagre",loader:F(async()=>await Promise.resolve().then(()=>require("./dagre-6UL2VRFP-6vYuHdR_.cjs")),"loader")},{name:"cose-bilkent",loader:F(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-S5V4N54A-D8SHJxwR.cjs")),"loader")}])},"registerDefaultLayoutLoaders");REe();var NEe=F(async(t,e)=>{if(!(t.layoutAlgorithm in Ox))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=Ox[t.layoutAlgorithm];return(await r.loader()).render(t,e,PEe,{algorithm:r.algorithm})},"render"),OEe=F((t="",{fallback:e="dagre"}={})=>{if(t in Ox)return t;if(e in Ox)return Me.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),ere="comm",tre="rule",rre="decl",BEe="@import",FEe="@namespace",$Ee="@keyframes",zEe="@layer",nre=Math.abs,LM=String.fromCharCode;function ire(t){return t.trim()}function V_(t,e,r){return t.replace(e,r)}function VEe(t,e,r){return t.indexOf(e,r)}function Vg(t,e){return t.charCodeAt(e)|0}function Sm(t,e,r){return t.slice(e,r)}function Ql(t){return t.length}function UEe(t){return t.length}function ew(t,e){return e.push(t),t}var WC=1,Cm=1,are=0,$o=0,ei=0,t1="";function PM(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:WC,column:Cm,length:s,return:"",siblings:o}}function jEe(){return ei}function HEe(){return ei=$o>0?Vg(t1,--$o):0,Cm--,ei===10&&(Cm=1,WC--),ei}function ol(){return ei=$o<are?Vg(t1,$o++):0,Cm++,ei===10&&(Cm=1,WC++),ei}function Nh(){return Vg(t1,$o)}function U_(){return $o}function qC(t,e){return Sm(t1,t,e)}function Bx(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function GEe(t){return WC=Cm=1,are=Ql(t1=t),$o=0,[]}function WEe(t){return t1="",t}function fA(t){return ire(qC($o-1,Zk(t===91?t+2:t===40?t+1:t)))}function qEe(t){for(;(ei=Nh())&&ei<33;)ol();return Bx(t)>2||Bx(ei)>3?"":" "}function XEe(t,e){for(;--e&&ol()&&!(ei<48||ei>102||ei>57&&ei<65||ei>70&&ei<97););return qC(t,U_()+(e<6&&Nh()==32&&ol()==32))}function Zk(t){for(;ol();)switch(ei){case t:return $o;case 34:case 39:t!==34&&t!==39&&Zk(ei);break;case 40:t===41&&Zk(t);break;case 92:ol();break}return $o}function YEe(t,e){for(;ol()&&t+ei!==57;)if(t+ei===84&&Nh()===47)break;return"/*"+qC(e,$o-1)+"*"+LM(t===47?t:ol())}function KEe(t){for(;!Bx(Nh());)ol();return qC(t,$o)}function ZEe(t){return WEe(j_("",null,null,null,[""],t=GEe(t),0,[0],t))}function j_(t,e,r,n,i,a,s,o,l){for(var c=0,u=0,h=s,f=0,d=0,p=0,g=1,m=1,v=1,y=0,x="",b=i,w=a,_=n,S=x;m;)switch(p=y,y=ol()){case 40:if(p!=108&&Vg(S,h-1)==58){VEe(S+=V_(fA(y),"&","&\f"),"&\f",nre(c?o[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:S+=fA(y);break;case 9:case 10:case 13:case 32:S+=qEe(p);break;case 92:S+=XEe(U_()-1,7);continue;case 47:switch(Nh()){case 42:case 47:ew(JEe(YEe(ol(),U_()),e,r,l),l),(Bx(p||1)==5||Bx(Nh()||1)==5)&&Ql(S)&&Sm(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*g:o[c++]=Ql(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(S=V_(S,/\f/g,"")),d>0&&(Ql(S)-h||g===0&&p===47)&&ew(d>32?BF(S+";",n,r,h-1,l):BF(V_(S," ","")+";",n,r,h-2,l),l);break;case 59:S+=";";default:if(ew(_=OF(S,e,r,c,u,i,o,x,b=[],w=[],h,a),a),y===123)if(u===0)j_(S,e,_,_,b,a,h,o,w);else{switch(f){case 99:if(Vg(S,3)===110)break;case 108:if(Vg(S,2)===97)break;default:u=0;case 100:case 109:case 115:}u?j_(t,_,_,n&&ew(OF(t,_,_,0,0,i,o,x,i,b=[],h,w),w),i,w,h,o,n?b:w):j_(S,_,_,_,[""],w,0,o,w)}}c=u=d=0,g=v=1,x=S="",h=s;break;case 58:h=1+Ql(S),d=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&HEe()==125)continue}switch(S+=LM(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:o[c++]=(Ql(S)-1)*v,v=1;break;case 64:Nh()===45&&(S+=fA(ol())),f=Nh(),u=h=Ql(x=S+=KEe(U_())),y++;break;case 45:p===45&&Ql(S)==2&&(g=0)}}return a}function OF(t,e,r,n,i,a,s,o,l,c,u,h){for(var f=i-1,d=i===0?a:[""],p=UEe(d),g=0,m=0,v=0;g<n;++g)for(var y=0,x=Sm(t,f+1,f=nre(m=s[g])),b=t;y<p;++y)(b=ire(m>0?d[y]+" "+x:V_(x,/&\f/g,d[y])))&&(l[v++]=b);return PM(t,e,r,i===0?tre:o,l,c,u,h)}function JEe(t,e,r,n){return PM(t,e,r,ere,LM(jEe()),Sm(t,2,-2),0,n)}function BF(t,e,r,n,i){return PM(t,e,r,rre,Sm(t,0,n),Sm(t,n+1,-1),n,i)}function Jk(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function QEe(t,e,r,n){switch(t.type){case zEe:if(t.children.length)break;case BEe:case FEe:case rre:return t.return=t.return||t.value;case ere:return"";case $Ee:return t.return=t.value+"{"+Jk(t.children,n)+"}";case tre:if(!Ql(t.value=t.props.join(",")))return""}return Ql(r=Jk(t.children,n))?t.return=t.value+"{"+r+"}":""}var eIe=pQ(Object.keys,Object),tIe=Object.prototype,rIe=tIe.hasOwnProperty;function sre(t){if(!Lb(t))return eIe(t);var e=[];for(var r in Object(t))rIe.call(t,r)&&r!="constructor"&&e.push(r);return e}var Qk=W0(Bc,"DataView"),e4=W0(Bc,"Promise"),A9=W0(Bc,"Set"),t4=W0(Bc,"WeakMap"),FF="[object Map]",nIe="[object Object]",$F="[object Promise]",zF="[object Set]",VF="[object WeakMap]",UF="[object DataView]",iIe=G0(Qk),aIe=G0(Lx),sIe=G0(e4),oIe=G0(A9),lIe=G0(t4);exports.getTag=H0;(Qk&&exports.getTag(new Qk(new ArrayBuffer(1)))!=UF||Lx&&exports.getTag(new Lx)!=FF||e4&&exports.getTag(e4.resolve())!=$F||A9&&exports.getTag(new A9)!=zF||t4&&exports.getTag(new t4)!=VF)&&(exports.getTag=function(t){var e=H0(t),r=e==nIe?t.constructor:void 0,n=r?G0(r):"";if(n)switch(n){case iIe:return UF;case aIe:return FF;case sIe:return $F;case oIe:return zF;case lIe:return VF}return e});var cIe="[object Map]",uIe="[object Set]",hIe=Object.prototype,fIe=hIe.hasOwnProperty;function r4(t){if(t==null)return!0;if(Pb(t)&&(Rx(t)||typeof t=="string"||typeof t.splice=="function"||OC(t)||BC(t)||Px(t)))return!t.length;var e=exports.getTag(t);if(e==cIe||e==uIe)return!t.size;if(Lb(t))return!sre(t).length;for(var r in t)if(fIe.call(t,r))return!1;return!0}var ore="c4",dIe=F(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),pIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./c4Diagram-YG6GDRKO-DrZI1Uvk.cjs"));return{id:ore,diagram:t}},"loader"),gIe={id:ore,detector:dIe,loader:pIe},mIe=gIe,lre="flowchart",vIe=F((t,e)=>e?.flowchart?.defaultRenderer==="dagre-wrapper"||e?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(t),"detector"),yIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./flowDiagram-NV44I4VS-Cpsf1v-b.cjs"));return{id:lre,diagram:t}},"loader"),xIe={id:lre,detector:vIe,loader:yIe},bIe=xIe,cre="flowchart-v2",wIe=F((t,e)=>e?.flowchart?.defaultRenderer==="dagre-d3"?!1:(e?.flowchart?.defaultRenderer==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&e?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(t)),"detector"),_Ie=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./flowDiagram-NV44I4VS-Cpsf1v-b.cjs"));return{id:cre,diagram:t}},"loader"),SIe={id:cre,detector:wIe,loader:_Ie},CIe=SIe,ure="er",AIe=F(t=>/^\s*erDiagram/.test(t),"detector"),TIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./erDiagram-Q2GNP2WA-qlpBRr-s.cjs"));return{id:ure,diagram:t}},"loader"),kIe={id:ure,detector:AIe,loader:TIe},EIe=kIe,hre="gitGraph",IIe=F(t=>/^\s*gitGraph/.test(t),"detector"),DIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./gitGraphDiagram-NY62KEGX-BWAgyf-h.cjs"));return{id:hre,diagram:t}},"loader"),MIe={id:hre,detector:IIe,loader:DIe},LIe=MIe,fre="gantt",PIe=F(t=>/^\s*gantt/.test(t),"detector"),RIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./ganttDiagram-JELNMOA3-BIE0sByu.cjs"));return{id:fre,diagram:t}},"loader"),NIe={id:fre,detector:PIe,loader:RIe},OIe=NIe,dre="info",BIe=F(t=>/^\s*info/.test(t),"detector"),FIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./infoDiagram-WHAUD3N6-DnN67a4x.cjs"));return{id:dre,diagram:t}},"loader"),$Ie={id:dre,detector:BIe,loader:FIe},pre="pie",zIe=F(t=>/^\s*pie/.test(t),"detector"),VIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./pieDiagram-ADFJNKIX-BNAHVQYa.cjs"));return{id:pre,diagram:t}},"loader"),UIe={id:pre,detector:zIe,loader:VIe},gre="quadrantChart",jIe=F(t=>/^\s*quadrantChart/.test(t),"detector"),HIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./quadrantDiagram-AYHSOK5B-CfzsJRu9.cjs"));return{id:gre,diagram:t}},"loader"),GIe={id:gre,detector:jIe,loader:HIe},WIe=GIe,mre="xychart",qIe=F(t=>/^\s*xychart(-beta)?/.test(t),"detector"),XIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./xychartDiagram-PRI3JC2R-CsQuB-D1.cjs"));return{id:mre,diagram:t}},"loader"),YIe={id:mre,detector:qIe,loader:XIe},KIe=YIe,vre="requirement",ZIe=F(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),JIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./requirementDiagram-UZGBJVZJ-0FutXkXL.cjs"));return{id:vre,diagram:t}},"loader"),QIe={id:vre,detector:ZIe,loader:JIe},eDe=QIe,yre="sequence",tDe=F(t=>/^\s*sequenceDiagram/.test(t),"detector"),rDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./sequenceDiagram-WL72ISMW-Cy9SWc2g.cjs"));return{id:yre,diagram:t}},"loader"),nDe={id:yre,detector:tDe,loader:rDe},iDe=nDe,xre="class",aDe=F((t,e)=>e?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t),"detector"),sDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./classDiagram-2ON5EDUG-DkLHmP89.cjs"));return{id:xre,diagram:t}},"loader"),oDe={id:xre,detector:aDe,loader:sDe},lDe=oDe,bre="classDiagram",cDe=F((t,e)=>/^\s*classDiagram/.test(t)&&e?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t),"detector"),uDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./classDiagram-v2-WZHVMYZB-DkLHmP89.cjs"));return{id:bre,diagram:t}},"loader"),hDe={id:bre,detector:cDe,loader:uDe},fDe=hDe,wre="state",dDe=F((t,e)=>e?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t),"detector"),pDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./stateDiagram-FKZM4ZOC-BEZk-Axy.cjs"));return{id:wre,diagram:t}},"loader"),gDe={id:wre,detector:dDe,loader:pDe},mDe=gDe,_re="stateDiagram",vDe=F((t,e)=>!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&e?.state?.defaultRenderer==="dagre-wrapper"),"detector"),yDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./stateDiagram-v2-4FDKWEC3-DvNtX3Ol.cjs"));return{id:_re,diagram:t}},"loader"),xDe={id:_re,detector:vDe,loader:yDe},bDe=xDe,Sre="journey",wDe=F(t=>/^\s*journey/.test(t),"detector"),_De=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./journeyDiagram-XKPGCS4Q-DFMP8dvI.cjs"));return{id:Sre,diagram:t}},"loader"),SDe={id:Sre,detector:wDe,loader:_De},CDe=SDe,ADe=F((t,e,r)=>{Me.debug(`rendering svg for syntax error
317
- `);const n=bZ(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),LD(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Cre={draw:ADe},TDe=Cre,kDe={db:{},renderer:Cre,parser:{parse:F(()=>{},"parse")}},EDe=kDe,Are="flowchart-elk",IDe=F((t,e={})=>/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&e?.flowchart?.defaultRenderer==="elk"?(e.layout="elk",!0):!1,"detector"),DDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./flowDiagram-NV44I4VS-Cpsf1v-b.cjs"));return{id:Are,diagram:t}},"loader"),MDe={id:Are,detector:IDe,loader:DDe},LDe=MDe,Tre="timeline",PDe=F(t=>/^\s*timeline/.test(t),"detector"),RDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./timeline-definition-IT6M3QCI-C_WkuEAq.cjs"));return{id:Tre,diagram:t}},"loader"),NDe={id:Tre,detector:PDe,loader:RDe},ODe=NDe,kre="mindmap",BDe=F(t=>/^\s*mindmap/.test(t),"detector"),FDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./mindmap-definition-VGOIOE7T-BqpvEcDc.cjs"));return{id:kre,diagram:t}},"loader"),$De={id:kre,detector:BDe,loader:FDe},zDe=$De,Ere="kanban",VDe=F(t=>/^\s*kanban/.test(t),"detector"),UDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./kanban-definition-3W4ZIXB7-B8u2Ynpb.cjs"));return{id:Ere,diagram:t}},"loader"),jDe={id:Ere,detector:VDe,loader:UDe},HDe=jDe,Ire="sankey",GDe=F(t=>/^\s*sankey(-beta)?/.test(t),"detector"),WDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./sankeyDiagram-TZEHDZUN-SgoD2ZDR.cjs"));return{id:Ire,diagram:t}},"loader"),qDe={id:Ire,detector:GDe,loader:WDe},XDe=qDe,Dre="packet",YDe=F(t=>/^\s*packet(-beta)?/.test(t),"detector"),KDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./diagram-S2PKOQOG-D4SvXrtx.cjs"));return{id:Dre,diagram:t}},"loader"),ZDe={id:Dre,detector:YDe,loader:KDe},Mre="radar",JDe=F(t=>/^\s*radar-beta/.test(t),"detector"),QDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./diagram-QEK2KX5R-C906QPMu.cjs"));return{id:Mre,diagram:t}},"loader"),eMe={id:Mre,detector:JDe,loader:QDe},Lre="block",tMe=F(t=>/^\s*block(-beta)?/.test(t),"detector"),rMe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./blockDiagram-VD42YOAC--ycSH7to.cjs"));return{id:Lre,diagram:t}},"loader"),nMe={id:Lre,detector:tMe,loader:rMe},iMe=nMe,Pre="architecture",aMe=F(t=>/^\s*architecture/.test(t),"detector"),sMe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./architectureDiagram-VXUJARFQ-DDambLWF.cjs"));return{id:Pre,diagram:t}},"loader"),oMe={id:Pre,detector:aMe,loader:sMe},lMe=oMe,Rre="treemap",cMe=F(t=>/^\s*treemap/.test(t),"detector"),uMe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./diagram-PSM6KHXK-eqfCNZ2d.cjs"));return{id:Rre,diagram:t}},"loader"),hMe={id:Rre,detector:cMe,loader:uMe},jF=!1,XC=F(()=>{jF||(jF=!0,ZS("error",EDe,t=>t.toLowerCase().trim()==="error"),ZS("---",{db:{clear:F(()=>{},"clear")},styles:{},renderer:{draw:F(()=>{},"draw")},parser:{parse:F(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:F(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),nk(LDe,zDe,lMe),nk(mIe,HDe,fDe,lDe,EIe,OIe,$Ie,UIe,eDe,iDe,CIe,bIe,ODe,LIe,bDe,mDe,CDe,WIe,XDe,ZDe,KIe,iMe,eMe,hMe))},"addDiagrams"),fMe=F(async()=>{Me.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(x0).map(async([r,{detector:n,loader:i}])=>{if(i)try{lk(r)}catch{try{const{diagram:a,id:s}=await i();ZS(s,a,n)}catch(a){throw Me.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete x0[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){Me.error(`Failed to load ${e.length} external diagrams`);for(const r of e)Me.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),dMe="graphics-document document";function Nre(t,e){t.attr("role",dMe),e!==""&&t.attr("aria-roledescription",e)}F(Nre,"setA11yDiagramInfo");function Ore(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}F(Ore,"addSVGa11yTitleDescription");var u0,n4=(u0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){const n=sa(),i=DD(e,n);e=dke(e)+`
316
+ L0,20`)},"requirement_arrow"),MEe=F((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),LEe={extension:vEe,composition:yEe,aggregation:xEe,dependency:bEe,lollipop:wEe,point:_Ee,circle:SEe,cross:CEe,barb:AEe,only_one:TEe,zero_or_one:kEe,one_or_more:EEe,zero_or_more:IEe,requirement_arrow:DEe,requirement_contains:MEe},Jte=mEe,PEe={common:j0,getConfig:sa,insertCluster:kee,insertEdge:Yte,insertEdgeLabel:Wte,insertMarkers:Jte,insertNode:MM,interpolateToCurve:cM,labelHelper:Nt,log:Me,positionEdgeLabel:qte},Ox={},Qte=F(t=>{for(const e of t)Ox[e.name]=e},"registerLayoutLoaders"),REe=F(()=>{Qte([{name:"dagre",loader:F(async()=>await Promise.resolve().then(()=>require("./dagre-6UL2VRFP-C02Xcjnp.cjs")),"loader")},{name:"cose-bilkent",loader:F(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-S5V4N54A-C_Mlgiqw.cjs")),"loader")}])},"registerDefaultLayoutLoaders");REe();var NEe=F(async(t,e)=>{if(!(t.layoutAlgorithm in Ox))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=Ox[t.layoutAlgorithm];return(await r.loader()).render(t,e,PEe,{algorithm:r.algorithm})},"render"),OEe=F((t="",{fallback:e="dagre"}={})=>{if(t in Ox)return t;if(e in Ox)return Me.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),ere="comm",tre="rule",rre="decl",BEe="@import",FEe="@namespace",$Ee="@keyframes",zEe="@layer",nre=Math.abs,LM=String.fromCharCode;function ire(t){return t.trim()}function V_(t,e,r){return t.replace(e,r)}function VEe(t,e,r){return t.indexOf(e,r)}function Vg(t,e){return t.charCodeAt(e)|0}function Sm(t,e,r){return t.slice(e,r)}function Ql(t){return t.length}function UEe(t){return t.length}function ew(t,e){return e.push(t),t}var WC=1,Cm=1,are=0,$o=0,ei=0,t1="";function PM(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:WC,column:Cm,length:s,return:"",siblings:o}}function jEe(){return ei}function HEe(){return ei=$o>0?Vg(t1,--$o):0,Cm--,ei===10&&(Cm=1,WC--),ei}function ol(){return ei=$o<are?Vg(t1,$o++):0,Cm++,ei===10&&(Cm=1,WC++),ei}function Nh(){return Vg(t1,$o)}function U_(){return $o}function qC(t,e){return Sm(t1,t,e)}function Bx(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function GEe(t){return WC=Cm=1,are=Ql(t1=t),$o=0,[]}function WEe(t){return t1="",t}function fA(t){return ire(qC($o-1,Zk(t===91?t+2:t===40?t+1:t)))}function qEe(t){for(;(ei=Nh())&&ei<33;)ol();return Bx(t)>2||Bx(ei)>3?"":" "}function XEe(t,e){for(;--e&&ol()&&!(ei<48||ei>102||ei>57&&ei<65||ei>70&&ei<97););return qC(t,U_()+(e<6&&Nh()==32&&ol()==32))}function Zk(t){for(;ol();)switch(ei){case t:return $o;case 34:case 39:t!==34&&t!==39&&Zk(ei);break;case 40:t===41&&Zk(t);break;case 92:ol();break}return $o}function YEe(t,e){for(;ol()&&t+ei!==57;)if(t+ei===84&&Nh()===47)break;return"/*"+qC(e,$o-1)+"*"+LM(t===47?t:ol())}function KEe(t){for(;!Bx(Nh());)ol();return qC(t,$o)}function ZEe(t){return WEe(j_("",null,null,null,[""],t=GEe(t),0,[0],t))}function j_(t,e,r,n,i,a,s,o,l){for(var c=0,u=0,h=s,f=0,d=0,p=0,g=1,m=1,v=1,y=0,x="",b=i,w=a,_=n,S=x;m;)switch(p=y,y=ol()){case 40:if(p!=108&&Vg(S,h-1)==58){VEe(S+=V_(fA(y),"&","&\f"),"&\f",nre(c?o[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:S+=fA(y);break;case 9:case 10:case 13:case 32:S+=qEe(p);break;case 92:S+=XEe(U_()-1,7);continue;case 47:switch(Nh()){case 42:case 47:ew(JEe(YEe(ol(),U_()),e,r,l),l),(Bx(p||1)==5||Bx(Nh()||1)==5)&&Ql(S)&&Sm(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*g:o[c++]=Ql(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(S=V_(S,/\f/g,"")),d>0&&(Ql(S)-h||g===0&&p===47)&&ew(d>32?BF(S+";",n,r,h-1,l):BF(V_(S," ","")+";",n,r,h-2,l),l);break;case 59:S+=";";default:if(ew(_=OF(S,e,r,c,u,i,o,x,b=[],w=[],h,a),a),y===123)if(u===0)j_(S,e,_,_,b,a,h,o,w);else{switch(f){case 99:if(Vg(S,3)===110)break;case 108:if(Vg(S,2)===97)break;default:u=0;case 100:case 109:case 115:}u?j_(t,_,_,n&&ew(OF(t,_,_,0,0,i,o,x,i,b=[],h,w),w),i,w,h,o,n?b:w):j_(S,_,_,_,[""],w,0,o,w)}}c=u=d=0,g=v=1,x=S="",h=s;break;case 58:h=1+Ql(S),d=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&HEe()==125)continue}switch(S+=LM(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:o[c++]=(Ql(S)-1)*v,v=1;break;case 64:Nh()===45&&(S+=fA(ol())),f=Nh(),u=h=Ql(x=S+=KEe(U_())),y++;break;case 45:p===45&&Ql(S)==2&&(g=0)}}return a}function OF(t,e,r,n,i,a,s,o,l,c,u,h){for(var f=i-1,d=i===0?a:[""],p=UEe(d),g=0,m=0,v=0;g<n;++g)for(var y=0,x=Sm(t,f+1,f=nre(m=s[g])),b=t;y<p;++y)(b=ire(m>0?d[y]+" "+x:V_(x,/&\f/g,d[y])))&&(l[v++]=b);return PM(t,e,r,i===0?tre:o,l,c,u,h)}function JEe(t,e,r,n){return PM(t,e,r,ere,LM(jEe()),Sm(t,2,-2),0,n)}function BF(t,e,r,n,i){return PM(t,e,r,rre,Sm(t,0,n),Sm(t,n+1,-1),n,i)}function Jk(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function QEe(t,e,r,n){switch(t.type){case zEe:if(t.children.length)break;case BEe:case FEe:case rre:return t.return=t.return||t.value;case ere:return"";case $Ee:return t.return=t.value+"{"+Jk(t.children,n)+"}";case tre:if(!Ql(t.value=t.props.join(",")))return""}return Ql(r=Jk(t.children,n))?t.return=t.value+"{"+r+"}":""}var eIe=pQ(Object.keys,Object),tIe=Object.prototype,rIe=tIe.hasOwnProperty;function sre(t){if(!Lb(t))return eIe(t);var e=[];for(var r in Object(t))rIe.call(t,r)&&r!="constructor"&&e.push(r);return e}var Qk=W0(Bc,"DataView"),e4=W0(Bc,"Promise"),A9=W0(Bc,"Set"),t4=W0(Bc,"WeakMap"),FF="[object Map]",nIe="[object Object]",$F="[object Promise]",zF="[object Set]",VF="[object WeakMap]",UF="[object DataView]",iIe=G0(Qk),aIe=G0(Lx),sIe=G0(e4),oIe=G0(A9),lIe=G0(t4);exports.getTag=H0;(Qk&&exports.getTag(new Qk(new ArrayBuffer(1)))!=UF||Lx&&exports.getTag(new Lx)!=FF||e4&&exports.getTag(e4.resolve())!=$F||A9&&exports.getTag(new A9)!=zF||t4&&exports.getTag(new t4)!=VF)&&(exports.getTag=function(t){var e=H0(t),r=e==nIe?t.constructor:void 0,n=r?G0(r):"";if(n)switch(n){case iIe:return UF;case aIe:return FF;case sIe:return $F;case oIe:return zF;case lIe:return VF}return e});var cIe="[object Map]",uIe="[object Set]",hIe=Object.prototype,fIe=hIe.hasOwnProperty;function r4(t){if(t==null)return!0;if(Pb(t)&&(Rx(t)||typeof t=="string"||typeof t.splice=="function"||OC(t)||BC(t)||Px(t)))return!t.length;var e=exports.getTag(t);if(e==cIe||e==uIe)return!t.size;if(Lb(t))return!sre(t).length;for(var r in t)if(fIe.call(t,r))return!1;return!0}var ore="c4",dIe=F(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),pIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./c4Diagram-YG6GDRKO-BXjyfo7C.cjs"));return{id:ore,diagram:t}},"loader"),gIe={id:ore,detector:dIe,loader:pIe},mIe=gIe,lre="flowchart",vIe=F((t,e)=>e?.flowchart?.defaultRenderer==="dagre-wrapper"||e?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(t),"detector"),yIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./flowDiagram-NV44I4VS-Dah4yjjk.cjs"));return{id:lre,diagram:t}},"loader"),xIe={id:lre,detector:vIe,loader:yIe},bIe=xIe,cre="flowchart-v2",wIe=F((t,e)=>e?.flowchart?.defaultRenderer==="dagre-d3"?!1:(e?.flowchart?.defaultRenderer==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&e?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(t)),"detector"),_Ie=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./flowDiagram-NV44I4VS-Dah4yjjk.cjs"));return{id:cre,diagram:t}},"loader"),SIe={id:cre,detector:wIe,loader:_Ie},CIe=SIe,ure="er",AIe=F(t=>/^\s*erDiagram/.test(t),"detector"),TIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./erDiagram-Q2GNP2WA-D9repMF8.cjs"));return{id:ure,diagram:t}},"loader"),kIe={id:ure,detector:AIe,loader:TIe},EIe=kIe,hre="gitGraph",IIe=F(t=>/^\s*gitGraph/.test(t),"detector"),DIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./gitGraphDiagram-NY62KEGX-nG_enmF1.cjs"));return{id:hre,diagram:t}},"loader"),MIe={id:hre,detector:IIe,loader:DIe},LIe=MIe,fre="gantt",PIe=F(t=>/^\s*gantt/.test(t),"detector"),RIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./ganttDiagram-JELNMOA3-DYl-svlb.cjs"));return{id:fre,diagram:t}},"loader"),NIe={id:fre,detector:PIe,loader:RIe},OIe=NIe,dre="info",BIe=F(t=>/^\s*info/.test(t),"detector"),FIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./infoDiagram-WHAUD3N6-ja1-y67k.cjs"));return{id:dre,diagram:t}},"loader"),$Ie={id:dre,detector:BIe,loader:FIe},pre="pie",zIe=F(t=>/^\s*pie/.test(t),"detector"),VIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./pieDiagram-ADFJNKIX-Di5nka51.cjs"));return{id:pre,diagram:t}},"loader"),UIe={id:pre,detector:zIe,loader:VIe},gre="quadrantChart",jIe=F(t=>/^\s*quadrantChart/.test(t),"detector"),HIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./quadrantDiagram-AYHSOK5B-BCyl7Fl4.cjs"));return{id:gre,diagram:t}},"loader"),GIe={id:gre,detector:jIe,loader:HIe},WIe=GIe,mre="xychart",qIe=F(t=>/^\s*xychart(-beta)?/.test(t),"detector"),XIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./xychartDiagram-PRI3JC2R-VQkoLtus.cjs"));return{id:mre,diagram:t}},"loader"),YIe={id:mre,detector:qIe,loader:XIe},KIe=YIe,vre="requirement",ZIe=F(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),JIe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./requirementDiagram-UZGBJVZJ-CsfDh7tr.cjs"));return{id:vre,diagram:t}},"loader"),QIe={id:vre,detector:ZIe,loader:JIe},eDe=QIe,yre="sequence",tDe=F(t=>/^\s*sequenceDiagram/.test(t),"detector"),rDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./sequenceDiagram-WL72ISMW-D2aLqNSZ.cjs"));return{id:yre,diagram:t}},"loader"),nDe={id:yre,detector:tDe,loader:rDe},iDe=nDe,xre="class",aDe=F((t,e)=>e?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t),"detector"),sDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./classDiagram-2ON5EDUG-Cp-hybua.cjs"));return{id:xre,diagram:t}},"loader"),oDe={id:xre,detector:aDe,loader:sDe},lDe=oDe,bre="classDiagram",cDe=F((t,e)=>/^\s*classDiagram/.test(t)&&e?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t),"detector"),uDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./classDiagram-v2-WZHVMYZB-Cp-hybua.cjs"));return{id:bre,diagram:t}},"loader"),hDe={id:bre,detector:cDe,loader:uDe},fDe=hDe,wre="state",dDe=F((t,e)=>e?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t),"detector"),pDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./stateDiagram-FKZM4ZOC-BYthx-57.cjs"));return{id:wre,diagram:t}},"loader"),gDe={id:wre,detector:dDe,loader:pDe},mDe=gDe,_re="stateDiagram",vDe=F((t,e)=>!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&e?.state?.defaultRenderer==="dagre-wrapper"),"detector"),yDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./stateDiagram-v2-4FDKWEC3-H1rXnBtV.cjs"));return{id:_re,diagram:t}},"loader"),xDe={id:_re,detector:vDe,loader:yDe},bDe=xDe,Sre="journey",wDe=F(t=>/^\s*journey/.test(t),"detector"),_De=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./journeyDiagram-XKPGCS4Q-CHlCU06J.cjs"));return{id:Sre,diagram:t}},"loader"),SDe={id:Sre,detector:wDe,loader:_De},CDe=SDe,ADe=F((t,e,r)=>{Me.debug(`rendering svg for syntax error
317
+ `);const n=bZ(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),LD(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Cre={draw:ADe},TDe=Cre,kDe={db:{},renderer:Cre,parser:{parse:F(()=>{},"parse")}},EDe=kDe,Are="flowchart-elk",IDe=F((t,e={})=>/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&e?.flowchart?.defaultRenderer==="elk"?(e.layout="elk",!0):!1,"detector"),DDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./flowDiagram-NV44I4VS-Dah4yjjk.cjs"));return{id:Are,diagram:t}},"loader"),MDe={id:Are,detector:IDe,loader:DDe},LDe=MDe,Tre="timeline",PDe=F(t=>/^\s*timeline/.test(t),"detector"),RDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./timeline-definition-IT6M3QCI-Cblm6BGs.cjs"));return{id:Tre,diagram:t}},"loader"),NDe={id:Tre,detector:PDe,loader:RDe},ODe=NDe,kre="mindmap",BDe=F(t=>/^\s*mindmap/.test(t),"detector"),FDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./mindmap-definition-VGOIOE7T-BFLy2xEZ.cjs"));return{id:kre,diagram:t}},"loader"),$De={id:kre,detector:BDe,loader:FDe},zDe=$De,Ere="kanban",VDe=F(t=>/^\s*kanban/.test(t),"detector"),UDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./kanban-definition-3W4ZIXB7-qiWoITa6.cjs"));return{id:Ere,diagram:t}},"loader"),jDe={id:Ere,detector:VDe,loader:UDe},HDe=jDe,Ire="sankey",GDe=F(t=>/^\s*sankey(-beta)?/.test(t),"detector"),WDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./sankeyDiagram-TZEHDZUN-CYpfcUxf.cjs"));return{id:Ire,diagram:t}},"loader"),qDe={id:Ire,detector:GDe,loader:WDe},XDe=qDe,Dre="packet",YDe=F(t=>/^\s*packet(-beta)?/.test(t),"detector"),KDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./diagram-S2PKOQOG-DaFznCS_.cjs"));return{id:Dre,diagram:t}},"loader"),ZDe={id:Dre,detector:YDe,loader:KDe},Mre="radar",JDe=F(t=>/^\s*radar-beta/.test(t),"detector"),QDe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./diagram-QEK2KX5R-Dg6GB9qw.cjs"));return{id:Mre,diagram:t}},"loader"),eMe={id:Mre,detector:JDe,loader:QDe},Lre="block",tMe=F(t=>/^\s*block(-beta)?/.test(t),"detector"),rMe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./blockDiagram-VD42YOAC-Df_sDpGk.cjs"));return{id:Lre,diagram:t}},"loader"),nMe={id:Lre,detector:tMe,loader:rMe},iMe=nMe,Pre="architecture",aMe=F(t=>/^\s*architecture/.test(t),"detector"),sMe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./architectureDiagram-VXUJARFQ-CewZQ5zM.cjs"));return{id:Pre,diagram:t}},"loader"),oMe={id:Pre,detector:aMe,loader:sMe},lMe=oMe,Rre="treemap",cMe=F(t=>/^\s*treemap/.test(t),"detector"),uMe=F(async()=>{const{diagram:t}=await Promise.resolve().then(()=>require("./diagram-PSM6KHXK-BEgHaXse.cjs"));return{id:Rre,diagram:t}},"loader"),hMe={id:Rre,detector:cMe,loader:uMe},jF=!1,XC=F(()=>{jF||(jF=!0,ZS("error",EDe,t=>t.toLowerCase().trim()==="error"),ZS("---",{db:{clear:F(()=>{},"clear")},styles:{},renderer:{draw:F(()=>{},"draw")},parser:{parse:F(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:F(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),nk(LDe,zDe,lMe),nk(mIe,HDe,fDe,lDe,EIe,OIe,$Ie,UIe,eDe,iDe,CIe,bIe,ODe,LIe,bDe,mDe,CDe,WIe,XDe,ZDe,KIe,iMe,eMe,hMe))},"addDiagrams"),fMe=F(async()=>{Me.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(x0).map(async([r,{detector:n,loader:i}])=>{if(i)try{lk(r)}catch{try{const{diagram:a,id:s}=await i();ZS(s,a,n)}catch(a){throw Me.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete x0[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){Me.error(`Failed to load ${e.length} external diagrams`);for(const r of e)Me.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),dMe="graphics-document document";function Nre(t,e){t.attr("role",dMe),e!==""&&t.attr("aria-roledescription",e)}F(Nre,"setA11yDiagramInfo");function Ore(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}F(Ore,"addSVGa11yTitleDescription");var u0,n4=(u0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){const n=sa(),i=DD(e,n);e=dke(e)+`
318
318
  `;try{lk(i)}catch{const c=h3e(i);if(!c)throw new eK(`Diagram ${i} not found.`);const{id:u,diagram:h}=await c();ZS(u,h)}const{db:a,parser:s,renderer:o,init:l}=lk(i);return s.parser&&(s.parser.yy=a),a.clear?.(),l?.(n),r.title&&a.setDiagramTitle?.(r.title),await s.parse(e),new u0(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},F(u0,"Diagram"),u0),HF=[],pMe=F(()=>{HF.forEach(t=>{t()}),HF=[]},"attachFunctions"),gMe=F(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Bre(t){const e=t.match(QY);if(!e)return{text:t,metadata:{}};let r=nQ(e[1],{schema:rQ})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}F(Bre,"extractFrontMatter");var mMe=F(t=>t.replace(/\r\n?/g,`
319
319
  `).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),vMe=F(t=>{const{text:e,metadata:r}=Bre(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),yMe=F(t=>{const e=To.detectInit(t)??{},r=To.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):r?.type==="wrap"&&(e.wrap=!0),{text:nke(t),directive:e}},"processDirectives");function RM(t){const e=mMe(t),r=vMe(e),n=yMe(r.text),i=FC(r.config,n.directive);return t=gMe(n.text),{code:t,title:r.title,config:i}}F(RM,"preprocessDiagram");function Fre(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}F(Fre,"toBase64");var xMe=5e4,bMe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",wMe="sandbox",_Me="loose",SMe="http://www.w3.org/2000/svg",CMe="http://www.w3.org/1999/xlink",AMe="http://www.w3.org/1999/xhtml",TMe="100%",kMe="100%",EMe="border:0;margin:0;",IMe="margin:0",DMe="allow-top-navigation-by-user-activation allow-popups",MMe='The "iframe" tag is not supported by your browser.',LMe=["foreignobject"],PMe=["dominant-baseline"];function NM(t){const e=RM(t);return YS(),T3e(e.config??{}),e}F(NM,"processAndSetConfigs");async function $re(t,e){XC();try{const{code:r,config:n}=NM(t);return{diagramType:(await Vre(r)).type,config:n}}catch(r){if(e?.suppressErrors)return!1;throw r}}F($re,"parse");var GF=F((t,e,r=[])=>`
320
320
  .${t} ${e} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),RMe=F((t,e=new Map)=>{let r="";if(t.themeCSS!==void 0&&(r+=`