termdock 1.4.336 → 1.4.337

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 (337) hide show
  1. package/dist/client/assets/App-DhHRFEY2.js +187 -0
  2. package/dist/client/assets/App-DhHRFEY2.js.br +0 -0
  3. package/dist/client/assets/App-DhHRFEY2.js.gz +0 -0
  4. package/dist/client/assets/{ArchitecturePanel-BOq2FG6t.js → ArchitecturePanel-DeMEq2Yq.js} +2 -2
  5. package/dist/client/assets/ArchitecturePanel-DeMEq2Yq.js.br +0 -0
  6. package/dist/client/assets/ArchitecturePanel-DeMEq2Yq.js.gz +0 -0
  7. package/dist/client/assets/{ChangeWalkthroughPanel-CxqwQxYc.js → ChangeWalkthroughPanel-DG4TnQvn.js} +1 -1
  8. package/dist/client/assets/ChangeWalkthroughPanel-DG4TnQvn.js.br +0 -0
  9. package/dist/client/assets/ChangeWalkthroughPanel-DG4TnQvn.js.gz +0 -0
  10. package/dist/client/assets/{CollaborationMainWorkspace-vvAVjIlQ.js → CollaborationMainWorkspace-D_yEJJy_.js} +1 -1
  11. package/dist/client/assets/CollaborationMainWorkspace-D_yEJJy_.js.br +0 -0
  12. package/dist/client/assets/CollaborationMainWorkspace-D_yEJJy_.js.gz +0 -0
  13. package/dist/client/assets/CollaborationTaskContent-BtFTzMVY.js +2 -0
  14. package/dist/client/assets/{ComputerControlView-mR6vlp9k.js → ComputerControlView-DGoBNNRA.js} +3 -3
  15. package/dist/client/assets/ComputerControlView-DGoBNNRA.js.br +0 -0
  16. package/dist/client/assets/ComputerControlView-DGoBNNRA.js.gz +0 -0
  17. package/dist/client/assets/{DagPlayground-nUK9xIql.js → DagPlayground-CiCwopwo.js} +1 -1
  18. package/dist/client/assets/DagPlayground-CiCwopwo.js.br +0 -0
  19. package/dist/client/assets/DagPlayground-CiCwopwo.js.gz +0 -0
  20. package/dist/client/assets/{DiffLab-D6XhZtPW.js → DiffLab-C8ItelM8.js} +1 -1
  21. package/dist/client/assets/DiffLab-C8ItelM8.js.br +0 -0
  22. package/dist/client/assets/DiffLab-C8ItelM8.js.gz +0 -0
  23. package/dist/client/assets/{DiffReview-BhyYqkD4.js → DiffReview-riYMjjAA.js} +1 -1
  24. package/dist/client/assets/DiffReview-riYMjjAA.js.br +0 -0
  25. package/dist/client/assets/DiffReview-riYMjjAA.js.gz +0 -0
  26. package/dist/client/assets/{DiffReviewLab-CvNWVrbl.js → DiffReviewLab-CXlrQWLJ.js} +1 -1
  27. package/dist/client/assets/DiffReviewLab-CXlrQWLJ.js.br +0 -0
  28. package/dist/client/assets/DiffReviewLab-CXlrQWLJ.js.gz +0 -0
  29. package/dist/client/assets/{DiffViewer-BSbMa2mq.js → DiffViewer-BxcK2w41.js} +1 -1
  30. package/dist/client/assets/DiffViewer-BxcK2w41.js.br +0 -0
  31. package/dist/client/assets/DiffViewer-BxcK2w41.js.gz +0 -0
  32. package/dist/client/assets/{ModelPreview-B_VPlNYr.js → ModelPreview-HzxWwmh4.js} +1 -1
  33. package/dist/client/assets/ModelPreview-HzxWwmh4.js.br +0 -0
  34. package/dist/client/assets/ModelPreview-HzxWwmh4.js.gz +0 -0
  35. package/dist/client/assets/{RightSidebar-Cakd9qUZ.js → RightSidebar-ChmJQUxz.js} +10 -10
  36. package/dist/client/assets/RightSidebar-ChmJQUxz.js.br +0 -0
  37. package/dist/client/assets/RightSidebar-ChmJQUxz.js.gz +0 -0
  38. package/dist/client/assets/{abnfDiagram-VCTEODGH-vWK7F-r_.js → abnfDiagram-VCTEODGH-BUDaRwTy.js} +1 -1
  39. package/dist/client/assets/abnfDiagram-VCTEODGH-BUDaRwTy.js.br +0 -0
  40. package/dist/client/assets/abnfDiagram-VCTEODGH-BUDaRwTy.js.gz +0 -0
  41. package/dist/client/assets/{app-BZBIr89q.js → app-D2M53LZx.js} +3 -3
  42. package/dist/client/assets/app-D2M53LZx.js.br +0 -0
  43. package/dist/client/assets/app-D2M53LZx.js.gz +0 -0
  44. package/dist/client/assets/{arc-Bdjvby9b.js → arc-DO-aRhWz.js} +1 -1
  45. package/dist/client/assets/arc-DO-aRhWz.js.br +0 -0
  46. package/dist/client/assets/arc-DO-aRhWz.js.gz +0 -0
  47. package/dist/client/assets/{architectureDiagram-5GKGNRK7-DTR5hJkG.js → architectureDiagram-5GKGNRK7-CMImzZR-.js} +1 -1
  48. package/dist/client/assets/architectureDiagram-5GKGNRK7-CMImzZR-.js.br +0 -0
  49. package/dist/client/assets/architectureDiagram-5GKGNRK7-CMImzZR-.js.gz +0 -0
  50. package/dist/client/assets/{blockDiagram-I7D4REHJ-DPz3axsu.js → blockDiagram-I7D4REHJ-DPC_EssA.js} +1 -1
  51. package/dist/client/assets/blockDiagram-I7D4REHJ-DPC_EssA.js.br +0 -0
  52. package/dist/client/assets/blockDiagram-I7D4REHJ-DPC_EssA.js.gz +0 -0
  53. package/dist/client/assets/{c4Diagram-7LVT6UL2-d5ZwPpcN.js → c4Diagram-7LVT6UL2-DJazaM0T.js} +1 -1
  54. package/dist/client/assets/c4Diagram-7LVT6UL2-DJazaM0T.js.br +0 -0
  55. package/dist/client/assets/c4Diagram-7LVT6UL2-DJazaM0T.js.gz +0 -0
  56. package/dist/client/assets/channel-BKGmfJ01.js +1 -0
  57. package/dist/client/assets/{chunk-2Q5K7J3B-BpEmNpto.js → chunk-2Q5K7J3B-BxDoppAq.js} +1 -1
  58. package/dist/client/assets/{chunk-5VM5RSS4-CXDCiEbN.js → chunk-5VM5RSS4-DFunSKh5.js} +1 -1
  59. package/dist/client/assets/{chunk-F27PBJKO-C1L__gXc.js → chunk-F27PBJKO-bLBUcK9l.js} +1 -1
  60. package/dist/client/assets/chunk-F27PBJKO-bLBUcK9l.js.br +0 -0
  61. package/dist/client/assets/chunk-F27PBJKO-bLBUcK9l.js.gz +0 -0
  62. package/dist/client/assets/{chunk-IMKFNOWR-CX0r7pV5.js → chunk-IMKFNOWR-CQzRDG_F.js} +1 -1
  63. package/dist/client/assets/chunk-IMKFNOWR-CQzRDG_F.js.br +0 -0
  64. package/dist/client/assets/chunk-IMKFNOWR-CQzRDG_F.js.gz +0 -0
  65. package/dist/client/assets/{chunk-JWPE2WC7-DkbhnrKh.js → chunk-JWPE2WC7-oYEx3lo8.js} +1 -1
  66. package/dist/client/assets/{chunk-POPQ4Y6H-CH-o5PVe.js → chunk-POPQ4Y6H-DiElQN3B.js} +1 -1
  67. package/dist/client/assets/{chunk-SVP7TREG-C1x5c5cy.js → chunk-SVP7TREG-Cf1eK48Z.js} +1 -1
  68. package/dist/client/assets/chunk-SVP7TREG-Cf1eK48Z.js.br +0 -0
  69. package/dist/client/assets/chunk-SVP7TREG-Cf1eK48Z.js.gz +0 -0
  70. package/dist/client/assets/{chunk-TICWLB2K-DAktkamN.js → chunk-TICWLB2K-CAsKSnF3.js} +1 -1
  71. package/dist/client/assets/chunk-TICWLB2K-CAsKSnF3.js.br +0 -0
  72. package/dist/client/assets/chunk-TICWLB2K-CAsKSnF3.js.gz +0 -0
  73. package/dist/client/assets/{chunk-XXDRQBXY-emNetBN1.js → chunk-XXDRQBXY-CnELf36-.js} +1 -1
  74. package/dist/client/assets/classDiagram-ZZMXUADV-M1OSgOBU.js +1 -0
  75. package/dist/client/assets/classDiagram-v2-VYDZK3BY-M1OSgOBU.js +1 -0
  76. package/dist/client/assets/{cose-bilkent-JH36ORCC-kBGroiho.js → cose-bilkent-JH36ORCC-BjkkSzWB.js} +1 -1
  77. package/dist/client/assets/cose-bilkent-JH36ORCC-BjkkSzWB.js.br +0 -0
  78. package/dist/client/assets/cose-bilkent-JH36ORCC-BjkkSzWB.js.gz +0 -0
  79. package/dist/client/assets/{cynefin-OW5HDTMX-C0TjwB46.js → cynefin-OW5HDTMX-DL9YtN7p.js} +1 -1
  80. package/dist/client/assets/cynefin-OW5HDTMX-DL9YtN7p.js.br +0 -0
  81. package/dist/client/assets/cynefin-OW5HDTMX-DL9YtN7p.js.gz +0 -0
  82. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CbLSUTuV.js → cynefinDiagram-5FMLGOSQ-vSIBJhoT.js} +1 -1
  83. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-vSIBJhoT.js.br +0 -0
  84. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-vSIBJhoT.js.gz +0 -0
  85. package/dist/client/assets/{dagre-GXQ25YYZ-BoznXKfa.js → dagre-GXQ25YYZ-CJ8Milln.js} +1 -1
  86. package/dist/client/assets/dagre-GXQ25YYZ-CJ8Milln.js.br +0 -0
  87. package/dist/client/assets/dagre-GXQ25YYZ-CJ8Milln.js.gz +0 -0
  88. package/dist/client/assets/{diagram-S7CK7UJ4-iY9ia7F5.js → diagram-S7CK7UJ4-Ci6Vle0S.js} +1 -1
  89. package/dist/client/assets/diagram-S7CK7UJ4-Ci6Vle0S.js.br +0 -0
  90. package/dist/client/assets/diagram-S7CK7UJ4-Ci6Vle0S.js.gz +0 -0
  91. package/dist/client/assets/{diagram-UQ7AKVKN-DhnC8gBw.js → diagram-UQ7AKVKN-Cf1bxglx.js} +1 -1
  92. package/dist/client/assets/diagram-UQ7AKVKN-Cf1bxglx.js.br +0 -0
  93. package/dist/client/assets/diagram-UQ7AKVKN-Cf1bxglx.js.gz +0 -0
  94. package/dist/client/assets/{diagram-VSXAHHWV-JFg8cbqX.js → diagram-VSXAHHWV-MPVKDZTF.js} +1 -1
  95. package/dist/client/assets/diagram-VSXAHHWV-MPVKDZTF.js.br +0 -0
  96. package/dist/client/assets/diagram-VSXAHHWV-MPVKDZTF.js.gz +0 -0
  97. package/dist/client/assets/{diagram-VX7I27RA-dvyXUTpo.js → diagram-VX7I27RA-C9VznNFM.js} +1 -1
  98. package/dist/client/assets/diagram-VX7I27RA-C9VznNFM.js.br +0 -0
  99. package/dist/client/assets/diagram-VX7I27RA-C9VznNFM.js.gz +0 -0
  100. package/dist/client/assets/{diagram-Z3DM3KII-DmjwsCUU.js → diagram-Z3DM3KII-D3Z39FXB.js} +1 -1
  101. package/dist/client/assets/diagram-Z3DM3KII-D3Z39FXB.js.br +0 -0
  102. package/dist/client/assets/diagram-Z3DM3KII-D3Z39FXB.js.gz +0 -0
  103. package/dist/client/assets/{ebnfDiagram-PWID7BFC-BxCdDL0c.js → ebnfDiagram-PWID7BFC-CB6iYj5F.js} +1 -1
  104. package/dist/client/assets/ebnfDiagram-PWID7BFC-CB6iYj5F.js.br +0 -0
  105. package/dist/client/assets/ebnfDiagram-PWID7BFC-CB6iYj5F.js.gz +0 -0
  106. package/dist/client/assets/{erDiagram-RLTQ6QDP-BWvvnoz1.js → erDiagram-RLTQ6QDP-BbywGzIs.js} +1 -1
  107. package/dist/client/assets/erDiagram-RLTQ6QDP-BbywGzIs.js.br +0 -0
  108. package/dist/client/assets/erDiagram-RLTQ6QDP-BbywGzIs.js.gz +0 -0
  109. package/dist/client/assets/{flowDiagram-HODETNUW-CVU0l_6c.js → flowDiagram-HODETNUW-BIhsRkKW.js} +1 -1
  110. package/dist/client/assets/flowDiagram-HODETNUW-BIhsRkKW.js.br +0 -0
  111. package/dist/client/assets/flowDiagram-HODETNUW-BIhsRkKW.js.gz +0 -0
  112. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CjO521RP.js → ganttDiagram-EL5Y4UJY-0ov1Ht5f.js} +1 -1
  113. package/dist/client/assets/ganttDiagram-EL5Y4UJY-0ov1Ht5f.js.br +0 -0
  114. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CjO521RP.js.gz → ganttDiagram-EL5Y4UJY-0ov1Ht5f.js.gz} +0 -0
  115. package/dist/client/assets/{gestureArbiter-D_fs_PXp.js → gestureArbiter-DPFs4a-w.js} +1 -1
  116. package/dist/client/assets/gestureArbiter-DPFs4a-w.js.br +0 -0
  117. package/dist/client/assets/{gestureArbiter-D_fs_PXp.js.gz → gestureArbiter-DPFs4a-w.js.gz} +0 -0
  118. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-DbxNhHiO.js → gitGraphDiagram-WWUBYQGX-DPmWc8PK.js} +1 -1
  119. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DPmWc8PK.js.br +0 -0
  120. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DPmWc8PK.js.gz +0 -0
  121. package/dist/client/assets/{infoDiagram-27XIBGKW-DRcGAFqT.js → infoDiagram-27XIBGKW-CiGxOtMe.js} +1 -1
  122. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BPbgDJUg.js → ishikawaDiagram-5VMMS53U-CVQw2h65.js} +1 -1
  123. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CVQw2h65.js.br +0 -0
  124. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CVQw2h65.js.gz +0 -0
  125. package/dist/client/assets/{journeyDiagram-3NMN7TZE-D1nSzyjD.js → journeyDiagram-3NMN7TZE-CWyQl9rp.js} +1 -1
  126. package/dist/client/assets/journeyDiagram-3NMN7TZE-CWyQl9rp.js.br +0 -0
  127. package/dist/client/assets/journeyDiagram-3NMN7TZE-CWyQl9rp.js.gz +0 -0
  128. package/dist/client/assets/{kanban-definition-UXKFOSKX-CSCXZnir.js → kanban-definition-UXKFOSKX-QYWm-bRz.js} +1 -1
  129. package/dist/client/assets/kanban-definition-UXKFOSKX-QYWm-bRz.js.br +0 -0
  130. package/dist/client/assets/kanban-definition-UXKFOSKX-QYWm-bRz.js.gz +0 -0
  131. package/dist/client/assets/{layout-DTNe7C08.js → layout-wWwHCqP-.js} +1 -1
  132. package/dist/client/assets/layout-wWwHCqP-.js.br +0 -0
  133. package/dist/client/assets/layout-wWwHCqP-.js.gz +0 -0
  134. package/dist/client/assets/{linear-DELStaU_.js → linear-CxAeiA5o.js} +1 -1
  135. package/dist/client/assets/linear-CxAeiA5o.js.br +0 -0
  136. package/dist/client/assets/linear-CxAeiA5o.js.gz +0 -0
  137. package/dist/client/assets/{mermaid.core-D7uvx0E2.js → mermaid.core-Dy-VIGNi.js} +5 -5
  138. package/dist/client/assets/mermaid.core-Dy-VIGNi.js.br +0 -0
  139. package/dist/client/assets/mermaid.core-Dy-VIGNi.js.gz +0 -0
  140. package/dist/client/assets/{mindmap-definition-YA3MSWOX-C_fF6Gnh.js → mindmap-definition-YA3MSWOX-CaOlKAQP.js} +1 -1
  141. package/dist/client/assets/mindmap-definition-YA3MSWOX-CaOlKAQP.js.br +0 -0
  142. package/dist/client/assets/mindmap-definition-YA3MSWOX-CaOlKAQP.js.gz +0 -0
  143. package/dist/client/assets/{passwordBootstrap-Co17Xh3M.js → passwordBootstrap-DADiddYD.js} +1 -1
  144. package/dist/client/assets/passwordBootstrap-DADiddYD.js.br +0 -0
  145. package/dist/client/assets/passwordBootstrap-DADiddYD.js.gz +0 -0
  146. package/dist/client/assets/{pegDiagram-XKGWAZYB-BFOfbHg1.js → pegDiagram-XKGWAZYB-DbMiTSC0.js} +1 -1
  147. package/dist/client/assets/pegDiagram-XKGWAZYB-DbMiTSC0.js.br +0 -0
  148. package/dist/client/assets/pegDiagram-XKGWAZYB-DbMiTSC0.js.gz +0 -0
  149. package/dist/client/assets/{pieDiagram-E7YTZNPT-BkLXgY2Y.js → pieDiagram-E7YTZNPT-DHsbRsqO.js} +1 -1
  150. package/dist/client/assets/pieDiagram-E7YTZNPT-DHsbRsqO.js.br +0 -0
  151. package/dist/client/assets/pieDiagram-E7YTZNPT-DHsbRsqO.js.gz +0 -0
  152. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DIF7ynjD.js → quadrantDiagram-AXDQQJYC-ivXNY01m.js} +1 -1
  153. package/dist/client/assets/quadrantDiagram-AXDQQJYC-ivXNY01m.js.br +0 -0
  154. package/dist/client/assets/quadrantDiagram-AXDQQJYC-ivXNY01m.js.gz +0 -0
  155. package/dist/client/assets/{railroadDiagram-O6MQD6OU-DGeuv8o1.js → railroadDiagram-O6MQD6OU-B6XiBJ2p.js} +1 -1
  156. package/dist/client/assets/railroadDiagram-O6MQD6OU-B6XiBJ2p.js.br +0 -0
  157. package/dist/client/assets/railroadDiagram-O6MQD6OU-B6XiBJ2p.js.gz +0 -0
  158. package/dist/client/assets/{rdpSession-DZCrSxpu.js → rdpSession-tZqbe3lc.js} +1 -1
  159. package/dist/client/assets/rdpSession-tZqbe3lc.js.br +0 -0
  160. package/dist/client/assets/rdpSession-tZqbe3lc.js.gz +0 -0
  161. package/dist/client/assets/{referenceLongPress-DrY73BHe.js → referenceLongPress-l-iC26Y4.js} +1 -1
  162. package/dist/client/assets/referenceLongPress-l-iC26Y4.js.br +0 -0
  163. package/dist/client/assets/referenceLongPress-l-iC26Y4.js.gz +0 -0
  164. package/dist/client/assets/{requirementDiagram-BXWQKSXE-CoVdyMn3.js → requirementDiagram-BXWQKSXE-BVuulzR5.js} +1 -1
  165. package/dist/client/assets/requirementDiagram-BXWQKSXE-BVuulzR5.js.br +0 -0
  166. package/dist/client/assets/requirementDiagram-BXWQKSXE-BVuulzR5.js.gz +0 -0
  167. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BF-YvoEZ.js → sankeyDiagram-P5KCCOFB-DCiS6hhT.js} +1 -1
  168. package/dist/client/assets/sankeyDiagram-P5KCCOFB-DCiS6hhT.js.br +0 -0
  169. package/dist/client/assets/sankeyDiagram-P5KCCOFB-DCiS6hhT.js.gz +0 -0
  170. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-CMkePZOj.js → sequenceDiagram-WJ2MYXX4-vobocfD-.js} +1 -1
  171. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-vobocfD-.js.br +0 -0
  172. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-vobocfD-.js.gz +0 -0
  173. package/dist/client/assets/{sizeCapture-INFHLROL-C9N9vqvo.js → sizeCapture-INFHLROL-DY_P3bTc.js} +1 -1
  174. package/dist/client/assets/sizeCapture-INFHLROL-DY_P3bTc.js.br +0 -0
  175. package/dist/client/assets/sizeCapture-INFHLROL-DY_P3bTc.js.gz +0 -0
  176. package/dist/client/assets/{sparkles-DQ-Y24Kv.js → sparkles-iFcvD4yM.js} +1 -1
  177. package/dist/client/assets/{stateDiagram-D77RDMKH-DFk62G9u.js → stateDiagram-D77RDMKH-g9dDzGJR.js} +1 -1
  178. package/dist/client/assets/stateDiagram-D77RDMKH-g9dDzGJR.js.br +0 -0
  179. package/dist/client/assets/stateDiagram-D77RDMKH-g9dDzGJR.js.gz +0 -0
  180. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Bxp20Ww7.js +1 -0
  181. package/dist/client/assets/{swimlanes-42K2YHIH-CNpYAR3d.js → swimlanes-42K2YHIH-CC39tzCY.js} +1 -1
  182. package/dist/client/assets/swimlanes-42K2YHIH-CC39tzCY.js.br +0 -0
  183. package/dist/client/assets/swimlanes-42K2YHIH-CC39tzCY.js.gz +0 -0
  184. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-bz2A714u.js +8 -0
  185. package/dist/client/assets/{timeline-definition-24CTP7MA-BVEhKc3h.js → timeline-definition-24CTP7MA-Bf-Np1KC.js} +1 -1
  186. package/dist/client/assets/timeline-definition-24CTP7MA-Bf-Np1KC.js.br +0 -0
  187. package/dist/client/assets/timeline-definition-24CTP7MA-Bf-Np1KC.js.gz +0 -0
  188. package/dist/client/assets/{triangle-alert-BIwj1bIH.js → triangle-alert-BeIpvW9N.js} +1 -1
  189. package/dist/client/assets/{vennDiagram-4TSXK5OY-DqKMbCx0.js → vennDiagram-4TSXK5OY-BA9Lil5m.js} +1 -1
  190. package/dist/client/assets/vennDiagram-4TSXK5OY-BA9Lil5m.js.br +0 -0
  191. package/dist/client/assets/vennDiagram-4TSXK5OY-BA9Lil5m.js.gz +0 -0
  192. package/dist/client/assets/{videoCompression-DhppheEu.js → videoCompression-ESn5rZIR.js} +1 -1
  193. package/dist/client/assets/videoCompression-ESn5rZIR.js.br +0 -0
  194. package/dist/client/assets/videoCompression-ESn5rZIR.js.gz +0 -0
  195. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-Bnhg0vB7.js → wardleyDiagram-VM6X3IG4-BCDzPgJu.js} +1 -1
  196. package/dist/client/assets/wardleyDiagram-VM6X3IG4-BCDzPgJu.js.br +0 -0
  197. package/dist/client/assets/wardleyDiagram-VM6X3IG4-BCDzPgJu.js.gz +0 -0
  198. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BBRqvRXj.js → xychartDiagram-S5SC5T6Z-CXvxPVbT.js} +1 -1
  199. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CXvxPVbT.js.br +0 -0
  200. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CXvxPVbT.js.gz +0 -0
  201. package/dist/client/index.html +1 -1
  202. package/dist/client/index.html.br +0 -0
  203. package/dist/client/index.html.gz +0 -0
  204. package/dist/client/sw.js +1 -1
  205. package/dist/client/sw.js.br +0 -0
  206. package/dist/client/sw.js.gz +0 -0
  207. package/package.json +1 -1
  208. package/runtime-manifest.json +2 -2
  209. package/dist/client/assets/App-B1lqBSPB.js +0 -187
  210. package/dist/client/assets/App-B1lqBSPB.js.br +0 -0
  211. package/dist/client/assets/App-B1lqBSPB.js.gz +0 -0
  212. package/dist/client/assets/ArchitecturePanel-BOq2FG6t.js.br +0 -0
  213. package/dist/client/assets/ArchitecturePanel-BOq2FG6t.js.gz +0 -0
  214. package/dist/client/assets/ChangeWalkthroughPanel-CxqwQxYc.js.br +0 -0
  215. package/dist/client/assets/ChangeWalkthroughPanel-CxqwQxYc.js.gz +0 -0
  216. package/dist/client/assets/CollaborationMainWorkspace-vvAVjIlQ.js.br +0 -0
  217. package/dist/client/assets/CollaborationMainWorkspace-vvAVjIlQ.js.gz +0 -0
  218. package/dist/client/assets/CollaborationTaskContent-Bx6Z5gEL.js +0 -2
  219. package/dist/client/assets/ComputerControlView-mR6vlp9k.js.br +0 -0
  220. package/dist/client/assets/ComputerControlView-mR6vlp9k.js.gz +0 -0
  221. package/dist/client/assets/DagPlayground-nUK9xIql.js.br +0 -0
  222. package/dist/client/assets/DagPlayground-nUK9xIql.js.gz +0 -0
  223. package/dist/client/assets/DiffLab-D6XhZtPW.js.br +0 -0
  224. package/dist/client/assets/DiffLab-D6XhZtPW.js.gz +0 -0
  225. package/dist/client/assets/DiffReview-BhyYqkD4.js.br +0 -0
  226. package/dist/client/assets/DiffReview-BhyYqkD4.js.gz +0 -0
  227. package/dist/client/assets/DiffReviewLab-CvNWVrbl.js.br +0 -0
  228. package/dist/client/assets/DiffReviewLab-CvNWVrbl.js.gz +0 -0
  229. package/dist/client/assets/DiffViewer-BSbMa2mq.js.br +0 -0
  230. package/dist/client/assets/DiffViewer-BSbMa2mq.js.gz +0 -0
  231. package/dist/client/assets/ModelPreview-B_VPlNYr.js.br +0 -0
  232. package/dist/client/assets/ModelPreview-B_VPlNYr.js.gz +0 -0
  233. package/dist/client/assets/RightSidebar-Cakd9qUZ.js.br +0 -0
  234. package/dist/client/assets/RightSidebar-Cakd9qUZ.js.gz +0 -0
  235. package/dist/client/assets/abnfDiagram-VCTEODGH-vWK7F-r_.js.br +0 -0
  236. package/dist/client/assets/abnfDiagram-VCTEODGH-vWK7F-r_.js.gz +0 -0
  237. package/dist/client/assets/app-BZBIr89q.js.br +0 -0
  238. package/dist/client/assets/app-BZBIr89q.js.gz +0 -0
  239. package/dist/client/assets/arc-Bdjvby9b.js.br +0 -0
  240. package/dist/client/assets/arc-Bdjvby9b.js.gz +0 -0
  241. package/dist/client/assets/architectureDiagram-5GKGNRK7-DTR5hJkG.js.br +0 -0
  242. package/dist/client/assets/architectureDiagram-5GKGNRK7-DTR5hJkG.js.gz +0 -0
  243. package/dist/client/assets/blockDiagram-I7D4REHJ-DPz3axsu.js.br +0 -0
  244. package/dist/client/assets/blockDiagram-I7D4REHJ-DPz3axsu.js.gz +0 -0
  245. package/dist/client/assets/c4Diagram-7LVT6UL2-d5ZwPpcN.js.br +0 -0
  246. package/dist/client/assets/c4Diagram-7LVT6UL2-d5ZwPpcN.js.gz +0 -0
  247. package/dist/client/assets/channel-M_h_h55d.js +0 -1
  248. package/dist/client/assets/chunk-F27PBJKO-C1L__gXc.js.br +0 -0
  249. package/dist/client/assets/chunk-F27PBJKO-C1L__gXc.js.gz +0 -0
  250. package/dist/client/assets/chunk-IMKFNOWR-CX0r7pV5.js.br +0 -0
  251. package/dist/client/assets/chunk-IMKFNOWR-CX0r7pV5.js.gz +0 -0
  252. package/dist/client/assets/chunk-SVP7TREG-C1x5c5cy.js.br +0 -0
  253. package/dist/client/assets/chunk-SVP7TREG-C1x5c5cy.js.gz +0 -0
  254. package/dist/client/assets/chunk-TICWLB2K-DAktkamN.js.br +0 -0
  255. package/dist/client/assets/chunk-TICWLB2K-DAktkamN.js.gz +0 -0
  256. package/dist/client/assets/classDiagram-ZZMXUADV-BVuw_2Ox.js +0 -1
  257. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BVuw_2Ox.js +0 -1
  258. package/dist/client/assets/cose-bilkent-JH36ORCC-kBGroiho.js.br +0 -0
  259. package/dist/client/assets/cose-bilkent-JH36ORCC-kBGroiho.js.gz +0 -0
  260. package/dist/client/assets/cynefin-OW5HDTMX-C0TjwB46.js.br +0 -0
  261. package/dist/client/assets/cynefin-OW5HDTMX-C0TjwB46.js.gz +0 -0
  262. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CbLSUTuV.js.br +0 -0
  263. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CbLSUTuV.js.gz +0 -0
  264. package/dist/client/assets/dagre-GXQ25YYZ-BoznXKfa.js.br +0 -0
  265. package/dist/client/assets/dagre-GXQ25YYZ-BoznXKfa.js.gz +0 -0
  266. package/dist/client/assets/diagram-S7CK7UJ4-iY9ia7F5.js.br +0 -0
  267. package/dist/client/assets/diagram-S7CK7UJ4-iY9ia7F5.js.gz +0 -0
  268. package/dist/client/assets/diagram-UQ7AKVKN-DhnC8gBw.js.br +0 -0
  269. package/dist/client/assets/diagram-UQ7AKVKN-DhnC8gBw.js.gz +0 -0
  270. package/dist/client/assets/diagram-VSXAHHWV-JFg8cbqX.js.br +0 -0
  271. package/dist/client/assets/diagram-VSXAHHWV-JFg8cbqX.js.gz +0 -0
  272. package/dist/client/assets/diagram-VX7I27RA-dvyXUTpo.js.br +0 -0
  273. package/dist/client/assets/diagram-VX7I27RA-dvyXUTpo.js.gz +0 -0
  274. package/dist/client/assets/diagram-Z3DM3KII-DmjwsCUU.js.br +0 -0
  275. package/dist/client/assets/diagram-Z3DM3KII-DmjwsCUU.js.gz +0 -0
  276. package/dist/client/assets/ebnfDiagram-PWID7BFC-BxCdDL0c.js.br +0 -0
  277. package/dist/client/assets/ebnfDiagram-PWID7BFC-BxCdDL0c.js.gz +0 -0
  278. package/dist/client/assets/erDiagram-RLTQ6QDP-BWvvnoz1.js.br +0 -0
  279. package/dist/client/assets/erDiagram-RLTQ6QDP-BWvvnoz1.js.gz +0 -0
  280. package/dist/client/assets/flowDiagram-HODETNUW-CVU0l_6c.js.br +0 -0
  281. package/dist/client/assets/flowDiagram-HODETNUW-CVU0l_6c.js.gz +0 -0
  282. package/dist/client/assets/ganttDiagram-EL5Y4UJY-CjO521RP.js.br +0 -0
  283. package/dist/client/assets/gestureArbiter-D_fs_PXp.js.br +0 -0
  284. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DbxNhHiO.js.br +0 -0
  285. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DbxNhHiO.js.gz +0 -0
  286. package/dist/client/assets/ishikawaDiagram-5VMMS53U-BPbgDJUg.js.br +0 -0
  287. package/dist/client/assets/ishikawaDiagram-5VMMS53U-BPbgDJUg.js.gz +0 -0
  288. package/dist/client/assets/journeyDiagram-3NMN7TZE-D1nSzyjD.js.br +0 -0
  289. package/dist/client/assets/journeyDiagram-3NMN7TZE-D1nSzyjD.js.gz +0 -0
  290. package/dist/client/assets/kanban-definition-UXKFOSKX-CSCXZnir.js.br +0 -0
  291. package/dist/client/assets/kanban-definition-UXKFOSKX-CSCXZnir.js.gz +0 -0
  292. package/dist/client/assets/layout-DTNe7C08.js.br +0 -0
  293. package/dist/client/assets/layout-DTNe7C08.js.gz +0 -0
  294. package/dist/client/assets/linear-DELStaU_.js.br +0 -0
  295. package/dist/client/assets/linear-DELStaU_.js.gz +0 -0
  296. package/dist/client/assets/mermaid.core-D7uvx0E2.js.br +0 -0
  297. package/dist/client/assets/mermaid.core-D7uvx0E2.js.gz +0 -0
  298. package/dist/client/assets/mindmap-definition-YA3MSWOX-C_fF6Gnh.js.br +0 -0
  299. package/dist/client/assets/mindmap-definition-YA3MSWOX-C_fF6Gnh.js.gz +0 -0
  300. package/dist/client/assets/passwordBootstrap-Co17Xh3M.js.br +0 -0
  301. package/dist/client/assets/passwordBootstrap-Co17Xh3M.js.gz +0 -0
  302. package/dist/client/assets/pegDiagram-XKGWAZYB-BFOfbHg1.js.br +0 -0
  303. package/dist/client/assets/pegDiagram-XKGWAZYB-BFOfbHg1.js.gz +0 -0
  304. package/dist/client/assets/pieDiagram-E7YTZNPT-BkLXgY2Y.js.br +0 -0
  305. package/dist/client/assets/pieDiagram-E7YTZNPT-BkLXgY2Y.js.gz +0 -0
  306. package/dist/client/assets/quadrantDiagram-AXDQQJYC-DIF7ynjD.js.br +0 -0
  307. package/dist/client/assets/quadrantDiagram-AXDQQJYC-DIF7ynjD.js.gz +0 -0
  308. package/dist/client/assets/railroadDiagram-O6MQD6OU-DGeuv8o1.js.br +0 -0
  309. package/dist/client/assets/railroadDiagram-O6MQD6OU-DGeuv8o1.js.gz +0 -0
  310. package/dist/client/assets/rdpSession-DZCrSxpu.js.br +0 -0
  311. package/dist/client/assets/rdpSession-DZCrSxpu.js.gz +0 -0
  312. package/dist/client/assets/referenceLongPress-DrY73BHe.js.br +0 -0
  313. package/dist/client/assets/referenceLongPress-DrY73BHe.js.gz +0 -0
  314. package/dist/client/assets/requirementDiagram-BXWQKSXE-CoVdyMn3.js.br +0 -0
  315. package/dist/client/assets/requirementDiagram-BXWQKSXE-CoVdyMn3.js.gz +0 -0
  316. package/dist/client/assets/sankeyDiagram-P5KCCOFB-BF-YvoEZ.js.br +0 -0
  317. package/dist/client/assets/sankeyDiagram-P5KCCOFB-BF-YvoEZ.js.gz +0 -0
  318. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-CMkePZOj.js.br +0 -0
  319. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-CMkePZOj.js.gz +0 -0
  320. package/dist/client/assets/sizeCapture-INFHLROL-C9N9vqvo.js.br +0 -0
  321. package/dist/client/assets/sizeCapture-INFHLROL-C9N9vqvo.js.gz +0 -0
  322. package/dist/client/assets/stateDiagram-D77RDMKH-DFk62G9u.js.br +0 -0
  323. package/dist/client/assets/stateDiagram-D77RDMKH-DFk62G9u.js.gz +0 -0
  324. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Bnyl10vy.js +0 -1
  325. package/dist/client/assets/swimlanes-42K2YHIH-CNpYAR3d.js.br +0 -0
  326. package/dist/client/assets/swimlanes-42K2YHIH-CNpYAR3d.js.gz +0 -0
  327. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BwjcVbFS.js +0 -8
  328. package/dist/client/assets/timeline-definition-24CTP7MA-BVEhKc3h.js.br +0 -0
  329. package/dist/client/assets/timeline-definition-24CTP7MA-BVEhKc3h.js.gz +0 -0
  330. package/dist/client/assets/vennDiagram-4TSXK5OY-DqKMbCx0.js.br +0 -0
  331. package/dist/client/assets/vennDiagram-4TSXK5OY-DqKMbCx0.js.gz +0 -0
  332. package/dist/client/assets/videoCompression-DhppheEu.js.br +0 -0
  333. package/dist/client/assets/videoCompression-DhppheEu.js.gz +0 -0
  334. package/dist/client/assets/wardleyDiagram-VM6X3IG4-Bnhg0vB7.js.br +0 -0
  335. package/dist/client/assets/wardleyDiagram-VM6X3IG4-Bnhg0vB7.js.gz +0 -0
  336. package/dist/client/assets/xychartDiagram-S5SC5T6Z-BBRqvRXj.js.br +0 -0
  337. package/dist/client/assets/xychartDiagram-S5SC5T6Z-BBRqvRXj.js.gz +0 -0
@@ -1 +1 @@
1
- import{g as l,r as m,d as a}from"./chunk-SVP7TREG-C1x5c5cy.js";import{p}from"./chunk-JWPE2WC7-DkbhnrKh.js";import{d as t,bg as o}from"./mermaid.core-D7uvx0E2.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-C0TjwB46.js";import"./app-BZBIr89q.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(g);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),g=t(e=>{const r=P(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),P=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},C={parser:b,db:a,renderer:m,styles:l};export{C as diagram};
1
+ import{g as l,r as m,d as a}from"./chunk-SVP7TREG-Cf1eK48Z.js";import{p}from"./chunk-JWPE2WC7-oYEx3lo8.js";import{d as t,bg as o}from"./mermaid.core-Dy-VIGNi.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-DL9YtN7p.js";import"./app-D2M53LZx.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(g);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),g=t(e=>{const r=P(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),P=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},C={parser:b,db:a,renderer:m,styles:l};export{C as diagram};
@@ -1,4 +1,4 @@
1
- import{p as at}from"./chunk-JWPE2WC7-DkbhnrKh.js";import{Y as D,b_ as G,j as rt,ao as nt,bK as it,ap as ot,bL as st,at as lt,bN as ct,d as g,bg as B,as as ut,N as dt,bJ as gt,bt as pt,X as ht,O as ft,ab as mt}from"./mermaid.core-D7uvx0E2.js";import{p as vt}from"./cynefin-OW5HDTMX-C0TjwB46.js";import{d as K}from"./arc-Bdjvby9b.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./app-BZBIr89q.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";import"./init-Gi6I4Gst.js";function St(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,T=D(0),l=D(G),p=D(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),b=+T.apply(this,arguments),E=Math.min(G,Math.max(-G,l.apply(this,arguments)-b)),k,N=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=N*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,b=k)h=f[r],A=o[h],k=b+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:b,endAngle:k,padAngle:N};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:D(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(T=typeof e=="function"?e:D(+e),i):T},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:D(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:D(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},W=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),bt=g(()=>{W=new Map,V=I.showData,ft()},"clear"),Dt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);W.has(t)||(W.set(t,n),B.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),Tt=g(()=>W,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),Y={getConfig:$t,clear:bt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Dt,getSections:Tt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);B.debug(n),Et(n,Y)},"parse")},Lt=g(t=>`
1
+ import{p as at}from"./chunk-JWPE2WC7-oYEx3lo8.js";import{Y as D,b_ as G,j as rt,ao as nt,bK as it,ap as ot,bL as st,at as lt,bN as ct,d as g,bg as B,as as ut,N as dt,bJ as gt,bt as pt,X as ht,O as ft,ab as mt}from"./mermaid.core-Dy-VIGNi.js";import{p as vt}from"./cynefin-OW5HDTMX-DL9YtN7p.js";import{d as K}from"./arc-DO-aRhWz.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./app-D2M53LZx.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";import"./init-Gi6I4Gst.js";function St(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,T=D(0),l=D(G),p=D(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),b=+T.apply(this,arguments),E=Math.min(G,Math.max(-G,l.apply(this,arguments)-b)),k,N=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=N*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,b=k)h=f[r],A=o[h],k=b+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:b,endAngle:k,padAngle:N};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:D(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(T=typeof e=="function"?e:D(+e),i):T},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:D(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:D(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},W=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),bt=g(()=>{W=new Map,V=I.showData,ft()},"clear"),Dt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);W.has(t)||(W.set(t,n),B.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),Tt=g(()=>W,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),Y={getConfig:$t,clear:bt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Dt,getSections:Tt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);B.debug(n),Et(n,Y)},"parse")},Lt=g(t=>`
2
2
  .pieCircle{
3
3
  stroke: ${t.pieStrokeColor};
4
4
  stroke-width : ${t.pieStrokeWidth};
@@ -1,4 +1,4 @@
1
- import{bK as Ae,ao as ke,at as ae,bN as Fe,ap as Pe,bL as ve,d as o,as as zt,bg as bt,bI as Lt,X as Ce,O as Le,ab as z,bH as Ee,aB as De}from"./mermaid.core-D7uvx0E2.js";import{l as ie}from"./linear-DELStaU_.js";import"./app-BZBIr89q.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-CrowFXzY.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:m,12:q,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:m,12:q,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:m,12:q,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:m,12:q,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,mt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";mt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>qe&&mt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
1
+ import{bK as Ae,ao as ke,at as ae,bN as Fe,ap as Pe,bL as ve,d as o,as as zt,bg as bt,bI as Lt,X as Ce,O as Le,ab as z,bH as Ee,aB as De}from"./mermaid.core-Dy-VIGNi.js";import{l as ie}from"./linear-CxAeiA5o.js";import"./app-D2M53LZx.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-CrowFXzY.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:m,12:q,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:m,12:q,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:m,12:q,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:m,12:q,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,mt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";mt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>qe&&mt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+mt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:mt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},me=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{g as s,r as l,d as t}from"./chunk-SVP7TREG-C1x5c5cy.js";import{p as m}from"./chunk-JWPE2WC7-DkbhnrKh.js";import{d as n,bg as i}from"./mermaid.core-D7uvx0E2.js";import{M as p,d}from"./cynefin-OW5HDTMX-C0TjwB46.js";import"./app-BZBIr89q.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";var u=d().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=u.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},S={parser:y,db:t,renderer:l,styles:s};export{S as diagram};
1
+ import{g as s,r as l,d as t}from"./chunk-SVP7TREG-Cf1eK48Z.js";import{p as m}from"./chunk-JWPE2WC7-oYEx3lo8.js";import{d as n,bg as i}from"./mermaid.core-Dy-VIGNi.js";import{M as p,d}from"./cynefin-OW5HDTMX-DL9YtN7p.js";import"./app-D2M53LZx.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./purify.es-4eNOHKSq.js";var u=d().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=u.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},S={parser:y,db:t,renderer:l,styles:s};export{S as diagram};
@@ -1 +1 @@
1
- import{cz as V}from"./app-BZBIr89q.js";import{b as q,C as Y,c as J}from"./ComputerControlView-mR6vlp9k.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./ChangeWalkthroughPanel-CxqwQxYc.js";import"./sparkles-DQ-Y24Kv.js";import"./triangle-alert-BIwj1bIH.js";import"./App-B1lqBSPB.js";import"./gestureArbiter-D_fs_PXp.js";import"./referenceLongPress-DrY73BHe.js";var n=n||{};n.ArrayBufferReader=function(u){var e=this;u.onblob=function(t){for(var a=window.atob(t),o=new ArrayBuffer(a.length),l=new Uint8Array(o),y=0;y<a.length;y++)l[y]=a.charCodeAt(y);e.ondata&&e.ondata(o)},u.onend=function(){e.onend&&e.onend()},this.ondata=null,this.onend=null};var n=n||{};n.ArrayBufferWriter=function(u){var e=this;u.onack=function(a){e.onack&&e.onack(a)};function t(a){for(var o="",l=0;l<a.byteLength;l++)o+=String.fromCharCode(a[l]);u.sendBlob(window.btoa(o))}this.blobLength=n.ArrayBufferWriter.DEFAULT_BLOB_LENGTH,this.sendData=function(a){var o=new Uint8Array(a);if(o.length<=e.blobLength)t(o);else for(var l=0;l<o.length;l+=e.blobLength)t(o.subarray(l,l+e.blobLength))},this.sendEnd=function(){u.sendEnd()},this.onack=null};n.ArrayBufferWriter.DEFAULT_BLOB_LENGTH=6048;var n=n||{};n.AudioContextFactory={singleton:null,getAudioContext:function(){var e=window.AudioContext||window.webkitAudioContext;if(e)try{return n.AudioContextFactory.singleton||(n.AudioContextFactory.singleton=new e),n.AudioContextFactory.singleton}catch{}return null}};var n=n||{};n.AudioPlayer=function(){this.sync=function(){}};n.AudioPlayer.isSupportedType=function(e){return n.RawAudioPlayer.isSupportedType(e)};n.AudioPlayer.getSupportedTypes=function(){return n.RawAudioPlayer.getSupportedTypes()};n.AudioPlayer.getInstance=function(e,t){return n.RawAudioPlayer.isSupportedType(t)?new n.RawAudioPlayer(e,t):null};n.RawAudioPlayer=function(e,t){var a=n.RawAudioFormat.parse(t),o=n.AudioContextFactory.getAudioContext(),l=o.currentTime,y=new n.ArrayBufferReader(e),g=.02,v=.3,c=a.bytesPerSample===1?window.Int8Array:window.Int16Array,m=a.bytesPerSample===1?128:32768,C=[],E=function(x){if(x.length<=1)return x[0];var s=0;x.forEach(function(w){s+=w.length});var f=0,p=new c(s);return x.forEach(function(w){p.set(w,f),f+=w.length}),p},d=function(x){for(var s=Number.MAX_VALUE,f=x.length,p=Math.floor(x.length/a.channels),T=Math.floor(a.rate*g),w=Math.max(a.channels*T,a.channels*(p-T)),P=w;P<x.length;P+=a.channels){for(var k=0,D=0;D<a.channels;D++)k+=Math.abs(x[P+D]);k<=s&&(f=P+a.channels,s=k)}return f===x.length?[x]:[new c(x.buffer.slice(0,f*a.bytesPerSample)),new c(x.buffer.slice(f*a.bytesPerSample))]},I=function(x){C.push(new c(x))},L=function(){var x=E(C);return x?(C=d(x),x=C.shift(),x):null},O=function(x){var s=x.length/a.channels,f=o.currentTime;l<f&&(l=f);for(var p=o.createBuffer(a.channels,s,a.rate),T=0;T<a.channels;T++)for(var w=p.getChannelData(T),P=T,k=0;k<s;k++)w[k]=x[P]/m,P+=a.channels;return p};y.ondata=function(x){I(new c(x));var s=L();if(s){var f=o.currentTime;l<f&&(l=f);var p=o.createBufferSource();p.connect(o.destination),p.start||(p.start=p.noteOn),p.buffer=O(s),p.start(l),l+=s.length/a.channels/a.rate}},this.sync=function(){var x=o.currentTime;l=Math.min(l,x+v)}};n.RawAudioPlayer.prototype=new n.AudioPlayer;n.RawAudioPlayer.isSupportedType=function(e){return n.AudioContextFactory.getAudioContext()?n.RawAudioFormat.parse(e)!==null:!1};n.RawAudioPlayer.getSupportedTypes=function(){return n.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]};var n=n||{};n.AudioRecorder=function(){this.onclose=null,this.onerror=null};n.AudioRecorder.isSupportedType=function(e){return n.RawAudioRecorder.isSupportedType(e)};n.AudioRecorder.getSupportedTypes=function(){return n.RawAudioRecorder.getSupportedTypes()};n.AudioRecorder.getInstance=function(e,t){return n.RawAudioRecorder.isSupportedType(t)?new n.RawAudioRecorder(e,t):null};n.RawAudioRecorder=function(e,t){var a=this,o=2048,l=3,y=n.RawAudioFormat.parse(t),g=n.AudioContextFactory.getAudioContext();navigator.mediaDevices||(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia||(navigator.mediaDevices.getUserMedia=(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia).bind(navigator));var v=new n.ArrayBufferWriter(e),c=y.bytesPerSample===1?window.Int8Array:window.Int16Array,m=y.bytesPerSample===1?128:32768,C=0,E=0,d=null,I=null,L=null,O=function(k){if(k===0)return 1;var D=Math.PI*k;return Math.sin(D)/D},A=function(k,D){return-D<k&&k<D?O(k)*O(k/D):0},x=function(k,D){for(var r=(k.length-1)*D,i=Math.floor(r)-l+1,h=Math.floor(r)+l,S=0,M=i;M<=h;M++)S+=(k[M]||0)*A(r-M,l);return S},s=function(k){var D=k.length;C+=D;var r=Math.round(C*y.rate/k.sampleRate),i=r-E;E+=i;for(var h=new c(i*y.channels),S=0;S<y.channels;S++)for(var M=k.getChannelData(S),_=S,R=0;R<i;R++)h[_]=x(M,R/(i-1))*m,_+=y.channels;return h},f=function(k){L=g.createScriptProcessor(o,y.channels,y.channels),L.connect(g.destination),L.onaudioprocess=function(r){v.sendData(s(r.inputBuffer).buffer)},I=g.createMediaStreamSource(k),I.connect(L),g.state==="suspended"&&g.resume(),d=k},p=function(){v.sendEnd(),a.onerror&&a.onerror()},T=function(){var k=navigator.mediaDevices.getUserMedia({audio:!0},f,p);k&&k.then&&k.then(f,p)},w=function(){if(I&&I.disconnect(),L&&L.disconnect(),d)for(var k=d.getTracks(),D=0;D<k.length;D++)k[D].stop();L=null,I=null,d=null,v.sendEnd()};v.onack=function(k){k.code===n.Status.Code.SUCCESS&&!d?T():(w(),v.onack=null,k.code===n.Status.Code.RESOURCE_CLOSED?a.onclose&&a.onclose():a.onerror&&a.onerror())}};n.RawAudioRecorder.prototype=new n.AudioRecorder;n.RawAudioRecorder.isSupportedType=function(e){return n.AudioContextFactory.getAudioContext()?n.RawAudioFormat.parse(e)!==null:!1};n.RawAudioRecorder.getSupportedTypes=function(){return n.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]};var n=n||{};n.BlobReader=function(u,e){var t=this,a=0,o;window.BlobBuilder?o=new BlobBuilder:window.WebKitBlobBuilder?o=new WebKitBlobBuilder:window.MozBlobBuilder?o=new MozBlobBuilder:o=new(function(){var l=[];this.append=function(y){l.push(new Blob([y],{type:e}))},this.getBlob=function(){return new Blob(l,{type:e})}}),u.onblob=function(l){for(var y=window.atob(l),g=new ArrayBuffer(y.length),v=new Uint8Array(g),c=0;c<y.length;c++)v[c]=y.charCodeAt(c);o.append(g),a+=g.byteLength,t.onprogress&&t.onprogress(g.byteLength),u.sendAck("OK",0)},u.onend=function(){t.onend&&t.onend()},this.getLength=function(){return a},this.getBlob=function(){return o.getBlob()},this.onprogress=null,this.onend=null};var n=n||{};n.BlobWriter=function(e){var t=this,a=new n.ArrayBufferWriter(e);a.onack=function(l){t.onack&&t.onack(l)};var o=function(y,g,v){var c=(y.slice||y.webkitSlice||y.mozSlice).bind(y),m=v-g;if(m!==v){var C=c(g,m);if(C.size===m)return C}return c(g,v)};this.sendBlob=function(y){var g=0,v=new FileReader,c=function(){if(g>=y.size){t.oncomplete&&t.oncomplete(y);return}var C=o(y,g,g+a.blobLength);g+=a.blobLength,v.readAsArrayBuffer(C)};v.onload=function(){a.sendData(v.result),a.onack=function(E){t.onack&&t.onack(E),!E.isError()&&(t.onprogress&&t.onprogress(y,g-a.blobLength),c())}},v.onerror=function(){t.onerror&&t.onerror(y,g,v.error)},c()},this.sendEnd=function(){a.sendEnd()},this.onack=null,this.onerror=null,this.onprogress=null,this.oncomplete=null};var n=n||{};n.Client=function(u){var e=this,t=n.Client.State.IDLE,a=0,o=5e3,l=null,y=0,g={0:"butt",1:"round",2:"square"},v={0:"bevel",1:"miter",2:"round"},c=new n.Display,m={},C={},E=[],d=[],I=[],L=new n.IntegerPool,O=[];function A(r){r!=t&&(t=r,e.onstatechange&&e.onstatechange(t))}function x(){return t==n.Client.State.CONNECTED||t==n.Client.State.WAITING}this.exportState=function(i){var h={currentState:t,currentTimestamp:a,layers:{}},S={};for(var M in m)S[M]=m[M];c.flush(function(){for(var R in S){var b=parseInt(R),F=S[R],N=F.toCanvas(),B={width:F.width,height:F.height};F.width&&F.height&&(B.url=N.toDataURL("image/png")),b>0&&(B.x=F.x,B.y=F.y,B.z=F.z,B.alpha=F.alpha,B.matrix=F.matrix,B.parent=f(F.parent)),h.layers[R]=B}i(h)})},this.importState=function(i,h){var S,M;t=i.currentState,a=i.currentTimestamp,c.cancel();for(S in m)M=parseInt(S),M>0&&m[S].dispose();m={};for(S in i.layers){M=parseInt(S);var _=i.layers[S],R=s(M);if(c.resize(R,_.width,_.height),_.url&&(c.setChannelMask(R,n.Layer.SRC),c.draw(R,0,0,_.url)),M>0&&_.parent>=0){var b=s(_.parent);c.move(R,b,_.x,_.y,_.z),c.shade(R,_.alpha);var F=_.matrix;c.distort(R,F[0],F[1],F[2],F[3],F[4],F[5])}}c.flush(h)},this.getDisplay=function(){return c},this.sendSize=function(r,i){x()&&u.sendMessage("size",r,i)},this.sendKeyEvent=function(r,i){x()&&u.sendMessage("key",i,r)},this.sendMouseState=function(i,h){if(x()){var S=i.x,M=i.y;h&&(S/=c.getScale(),M/=c.getScale()),c.moveCursor(Math.floor(S),Math.floor(M));var _=0;i.left&&(_|=1),i.middle&&(_|=2),i.right&&(_|=4),i.up&&(_|=8),i.down&&(_|=16),u.sendMessage("mouse",Math.floor(S),Math.floor(M),_)}},this.sendTouchState=function(i,h){if(x()){var S=i.x,M=i.y;h&&(S/=c.getScale(),M/=c.getScale()),u.sendMessage("touch",i.id,Math.floor(S),Math.floor(M),Math.floor(i.radiusX),Math.floor(i.radiusY),i.angle,i.force)}},this.createOutputStream=function(){var i=L.next(),h=O[i]=new n.OutputStream(e,i);return h},this.createAudioStream=function(r){var i=e.createOutputStream();return u.sendMessage("audio",i.index,r),i},this.createFileStream=function(r,i){var h=e.createOutputStream();return u.sendMessage("file",h.index,r,i),h},this.createPipeStream=function(r,i){var h=e.createOutputStream();return u.sendMessage("pipe",h.index,r,i),h},this.createClipboardStream=function(r){var i=e.createOutputStream();return u.sendMessage("clipboard",i.index,r),i},this.createArgumentValueStream=function(i,h){var S=e.createOutputStream();return u.sendMessage("argv",S.index,i,h),S},this.createObjectOutputStream=function(i,h,S){var M=e.createOutputStream();return u.sendMessage("put",i,M.index,h,S),M},this.requestObjectInputStream=function(i,h){x()&&u.sendMessage("get",i,h)},this.sendAck=function(r,i,h){x()&&u.sendMessage("ack",r,i,h)},this.sendBlob=function(r,i){x()&&u.sendMessage("blob",r,i)},this.endStream=function(r){x()&&(u.sendMessage("end",r),O[r]&&(L.free(r),delete O[r]))},this.onstatechange=null,this.onname=null,this.onerror=null,this.onmsg=null,this.onjoin=null,this.onleave=null,this.onaudio=null,this.onvideo=null,this.onmultitouch=null,this.onargv=null,this.onclipboard=null,this.onfile=null,this.onfilesystem=null,this.onpipe=null,this.onrequired=null,this.onsync=null;var s=function(i){var h=m[i];return h||(i===0?h=c.getDefaultLayer():i>0?h=c.createLayer():h=c.createBuffer(),m[i]=h),h},f=function(i){if(!i)return null;for(var h in m)if(i===m[h])return parseInt(h);return null};function p(r){var i=E[r];return i==null&&(i=E[r]=new n.Parser,i.oninstruction=u.oninstruction),i}var T={"miter-limit":function(r,i){c.setMiterLimit(r,parseFloat(i))},"multi-touch":function(i,h){e.onmultitouch&&i instanceof n.Display.VisibleLayer&&e.onmultitouch(i,parseInt(h))}},w={ack:function(r){var i=parseInt(r[0]),h=r[1],S=parseInt(r[2]),M=O[i];M&&(M.onack&&M.onack(new n.Status(S,h)),S>=256&&O[i]===M&&(L.free(i),delete O[i]))},arc:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseFloat(r[4]),R=parseFloat(r[5]),b=parseInt(r[6]);c.arc(i,h,S,M,_,R,b!=0)},argv:function(r){var i=parseInt(r[0]),h=r[1],S=r[2];if(e.onargv){var M=d[i]=new n.InputStream(e,i);e.onargv(M,h,S)}else e.sendAck(i,"Receiving argument values unsupported",256)},audio:function(r){var i=parseInt(r[0]),h=r[1],S=d[i]=new n.InputStream(e,i),M=null;e.onaudio&&(M=e.onaudio(S,h)),M||(M=n.AudioPlayer.getInstance(S,h)),M?(C[i]=M,e.sendAck(i,"OK",0)):e.sendAck(i,"BAD TYPE",783)},blob:function(r){var i=parseInt(r[0]),h=r[1],S=d[i];S&&S.onblob&&S.onblob(h)},body:function(i){var h=parseInt(i[0]),S=I[h],M=parseInt(i[1]),_=i[2],R=i[3];if(S&&S.onbody){var b=d[M]=new n.InputStream(e,M);S.onbody(b,_,R)}else e.sendAck(M,"Receipt of body unsupported",256)},cfill:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]);c.setChannelMask(h,i),c.fillColor(h,S,M,_,R)},clip:function(r){var i=s(parseInt(r[0]));c.clip(i)},clipboard:function(r){var i=parseInt(r[0]),h=r[1];if(e.onclipboard){var S=d[i]=new n.InputStream(e,i);e.onclipboard(S,h)}else e.sendAck(i,"Clipboard unsupported",256)},close:function(r){var i=s(parseInt(r[0]));c.close(i)},copy:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=s(parseInt(r[6])),F=parseInt(r[7]),N=parseInt(r[8]);c.setChannelMask(b,R),c.copy(i,h,S,M,_,b,F,N)},cstroke:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=g[parseInt(r[2])],M=v[parseInt(r[3])],_=parseInt(r[4]),R=parseInt(r[5]),b=parseInt(r[6]),F=parseInt(r[7]),N=parseInt(r[8]);c.setChannelMask(h,i),c.strokeColor(h,S,M,_,R,b,F,N)},cursor:function(r){var i=parseInt(r[0]),h=parseInt(r[1]),S=s(parseInt(r[2])),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=parseInt(r[6]);c.setCursor(i,h,S,M,_,R,b)},curve:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=parseInt(r[6]);c.curveTo(i,h,S,M,_,R,b)},disconnect:function(i){e.disconnect()},dispose:function(r){var i=parseInt(r[0]);if(i>0){var h=s(i);c.dispose(h),delete m[i]}else i<0&&delete m[i]},distort:function(r){var i=parseInt(r[0]),h=parseFloat(r[1]),S=parseFloat(r[2]),M=parseFloat(r[3]),_=parseFloat(r[4]),R=parseFloat(r[5]),b=parseFloat(r[6]);if(i>=0){var F=s(i);c.distort(F,h,S,M,_,R,b)}},error:function(r){var i=r[0],h=parseInt(r[1]);e.onerror&&e.onerror(new n.Status(h,i)),e.disconnect()},end:function(r){var i=parseInt(r[0]),h=d[i];h&&(h.onend&&h.onend(),delete d[i])},file:function(r){var i=parseInt(r[0]),h=r[1],S=r[2];if(e.onfile){var M=d[i]=new n.InputStream(e,i);e.onfile(M,h,S)}else e.sendAck(i,"File transfer unsupported",256)},filesystem:function(i){var h=parseInt(i[0]),S=i[1];if(e.onfilesystem){var M=I[h]=new n.Object(e,h);e.onfilesystem(M,S)}},identity:function(r){var i=s(parseInt(r[0]));c.setTransform(i,1,0,0,1,0,0)},img:function(r){var i=parseInt(r[0]),h=parseInt(r[1]),S=s(parseInt(r[2])),M=r[3],_=parseInt(r[4]),R=parseInt(r[5]),b=d[i]=new n.InputStream(e,i);c.setChannelMask(S,h),c.drawStream(S,_,R,b,M)},jpeg:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=parseInt(r[2]),M=parseInt(r[3]),_=r[4];c.setChannelMask(h,i),c.draw(h,S,M,"data:image/jpeg;base64,"+_)},lfill:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=s(parseInt(r[2]));c.setChannelMask(h,i),c.fillLayer(h,S)},line:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]);c.lineTo(i,h,S)},lstroke:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=s(parseInt(r[2]));c.setChannelMask(h,i),c.strokeLayer(h,S)},mouse:function(i){var h=parseInt(i[0]),S=parseInt(i[1]);c.showCursor(!0),c.moveCursor(h,S)},move:function(r){var i=parseInt(r[0]),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]);if(i>0&&h>=0){var R=s(i),b=s(h);c.move(R,b,S,M,_)}},msg:function(r){var i,h,S=!0,M=parseInt(r[0]);if(e.onmsg&&(S=e.onmsg(M,r.slice(1)),S===void 0&&(S=!0)),S)switch(M){case n.Client.Message.USER_JOINED:i=r[1],h=r[2],e.onjoin&&e.onjoin(i,h);break;case n.Client.Message.USER_LEFT:i=r[1],h=r[2],e.onleave&&e.onleave(i,h);break}},name:function(r){e.onname&&e.onname(r[0])},nest:function(r){var i=p(parseInt(r[0]));i.receive(r[1])},pipe:function(r){var i=parseInt(r[0]),h=r[1],S=r[2];if(e.onpipe){var M=d[i]=new n.InputStream(e,i);e.onpipe(M,h,S)}else e.sendAck(i,"Named pipes unsupported",256)},png:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=parseInt(r[2]),M=parseInt(r[3]),_=r[4];c.setChannelMask(h,i),c.draw(h,S,M,"data:image/png;base64,"+_)},pop:function(r){var i=s(parseInt(r[0]));c.pop(i)},push:function(r){var i=s(parseInt(r[0]));c.push(i)},rect:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]);c.rect(i,h,S,M,_)},required:function(i){e.onrequired&&e.onrequired(i)},reset:function(r){var i=s(parseInt(r[0]));c.reset(i)},set:function(r){var i=s(parseInt(r[0])),h=r[1],S=r[2],M=T[h];M&&M(i,S)},shade:function(r){var i=parseInt(r[0]),h=parseInt(r[1]);if(i>=0){var S=s(i);c.shade(S,h)}},size:function(r){var i=parseInt(r[0]),h=s(i),S=parseInt(r[1]),M=parseInt(r[2]);c.resize(h,S,M)},start:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]);c.moveTo(i,h,S)},sync:function(r){var i=parseInt(r[0]),h=r[1]?parseInt(r[1]):0;c.flush(function(){for(var M in C){var _=C[M];_&&_.sync()}i!==a&&(u.sendMessage("sync",i),a=i)},i,h),t===n.Client.State.WAITING&&A(n.Client.State.CONNECTED),e.onsync&&e.onsync(i,h)},transfer:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=s(parseInt(r[6])),F=parseInt(r[7]),N=parseInt(r[8]);R===3?c.put(i,h,S,M,_,b,F,N):R!==5&&c.transfer(i,h,S,M,_,b,F,N,n.Client.DefaultTransferFunction[R])},transform:function(r){var i=s(parseInt(r[0])),h=parseFloat(r[1]),S=parseFloat(r[2]),M=parseFloat(r[3]),_=parseFloat(r[4]),R=parseFloat(r[5]),b=parseFloat(r[6]);c.transform(i,h,S,M,_,R,b)},undefine:function(i){var h=parseInt(i[0]),S=I[h];S&&S.onundefine&&S.onundefine()},video:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=r[2],M=d[i]=new n.InputStream(e,i),_=null;e.onvideo&&(_=e.onvideo(M,h,S)),_||(_=n.VideoPlayer.getInstance(M,h,S)),_?e.sendAck(i,"OK",0):e.sendAck(i,"BAD TYPE",783)}},P=function(){u.sendMessage("nop"),y=new Date().getTime()},k=function(){window.clearTimeout(l);var i=new Date().getTime(),h=Math.max(y+o-i,0);h>0?l=window.setTimeout(P,h):P()},D=function(){window.clearTimeout(l)};u.oninstruction=function(r,i){var h=w[r];h&&h(i),k()},this.disconnect=function(){t!=n.Client.State.DISCONNECTED&&t!=n.Client.State.DISCONNECTING&&(A(n.Client.State.DISCONNECTING),D(),u.sendMessage("disconnect"),u.disconnect(),A(n.Client.State.DISCONNECTED))},this.connect=function(r){A(n.Client.State.CONNECTING);try{u.connect(r)}catch(i){throw A(n.Client.State.IDLE),i}k(),A(n.Client.State.WAITING)}};n.Client.State={IDLE:0,CONNECTING:1,WAITING:2,CONNECTED:3,DISCONNECTING:4,DISCONNECTED:5};n.Client.DefaultTransferFunction={0:function(u,e){e.red=e.green=e.blue=0},15:function(u,e){e.red=e.green=e.blue=255},3:function(u,e){e.red=u.red,e.green=u.green,e.blue=u.blue,e.alpha=u.alpha},5:function(u,e){},12:function(u,e){e.red=255&~u.red,e.green=255&~u.green,e.blue=255&~u.blue,e.alpha=u.alpha},10:function(u,e){e.red=255&~e.red,e.green=255&~e.green,e.blue=255&~e.blue},1:function(u,e){e.red=u.red&e.red,e.green=u.green&e.green,e.blue=u.blue&e.blue},14:function(u,e){e.red=255&~(u.red&e.red),e.green=255&~(u.green&e.green),e.blue=255&~(u.blue&e.blue)},7:function(u,e){e.red=u.red|e.red,e.green=u.green|e.green,e.blue=u.blue|e.blue},8:function(u,e){e.red=255&~(u.red|e.red),e.green=255&~(u.green|e.green),e.blue=255&~(u.blue|e.blue)},6:function(u,e){e.red=u.red^e.red,e.green=u.green^e.green,e.blue=u.blue^e.blue},9:function(u,e){e.red=255&~(u.red^e.red),e.green=255&~(u.green^e.green),e.blue=255&~(u.blue^e.blue)},4:function(u,e){e.red=255&(~u.red&e.red),e.green=255&(~u.green&e.green),e.blue=255&(~u.blue&e.blue)},13:function(u,e){e.red=255&(~u.red|e.red),e.green=255&(~u.green|e.green),e.blue=255&(~u.blue|e.blue)},2:function(u,e){e.red=255&(u.red&~e.red),e.green=255&(u.green&~e.green),e.blue=255&(u.blue&~e.blue)},11:function(u,e){e.red=255&(u.red|~e.red),e.green=255&(u.green|~e.green),e.blue=255&(u.blue|~e.blue)}};n.Client.Message={USER_JOINED:1,USER_LEFT:2};var n=n||{};n.DataURIReader=function(u,e){var t=this,a="data:"+e+";base64,";u.onblob=function(l){a+=l},u.onend=function(){t.onend&&t.onend()},this.getURI=function(){return a},this.onend=null};var n=n||{};n.Display=function(){var u=this,e=0,t=0,a=1,o=document.createElement("div");o.style.position="relative",o.style.width=e+"px",o.style.height=t+"px",o.style.transformOrigin=o.style.webkitTransformOrigin=o.style.MozTransformOrigin=o.style.OTransformOrigin=o.style.msTransformOrigin="0 0";var l=new n.Display.VisibleLayer(e,t),y=new n.Display.VisibleLayer(0,0);y.setChannelMask(n.Layer.SRC),o.appendChild(l.getElement()),o.appendChild(y.getElement());var g=document.createElement("div");g.style.position="relative",g.style.width=e*a+"px",g.style.height=t*a+"px",g.appendChild(o),this.cursorHotspotX=0,this.cursorHotspotY=0,this.cursorX=0,this.cursorY=0,this.statisticWindow=0,this.onresize=null,this.oncursor=null,this.onstatistics=null;var v=[],c=[],m=null,C=function(){for(var f=0,p=0,T=0,w=0;w<c.length;){var P=c[w];if(!P.isReady())break;P.flush(),f=P.localTimestamp,p=P.remoteTimestamp,T+=P.logicalFrames,w++}c.splice(0,w),w&&I(f,p,T)},E=function(){var f=function p(){if(m=null,!!c.length){if(c[0].isReady()){var T=c.shift();T.flush(),I(T.localTimestamp,T.remoteTimestamp,T.logicalFrames)}c.length&&(m=window.requestAnimationFrame(p))}};m||(m=window.requestAnimationFrame(f))},d=[],I=function(f,p,T){if(u.statisticWindow){for(var w=new Date().getTime(),P=0;P<d.length&&!(w-d[P].timestamp<=u.statisticWindow);P++);d.splice(0,P-1),d.push({localTimestamp:f,remoteTimestamp:p,timestamp:w,frames:T});var k=(d[d.length-1].timestamp-d[0].timestamp)/1e3,D=(d[d.length-1].remoteTimestamp-d[0].remoteTimestamp)/1e3,r=d.length,i=d.reduce(function(_,R){return _+R.frames},0),h=d.reduce(function(_,R){return _+Math.max(0,R.frames-1)},0),S=new n.Display.Statistics({processingLag:w-f,desktopFps:D&&i?i/D:null,clientFps:k?r/k:null,serverFps:D?r/D:null,dropRate:D?h/D:null});u.onstatistics&&u.onstatistics(S)}};window.addEventListener("blur",function(){m&&!document.hasFocus()&&(window.cancelAnimationFrame(m),m=null,C())},!0);function L(){window.requestAnimationFrame&&document.hasFocus()?E():C()}var O=function(f,p,T,w){this.localTimestamp=new Date().getTime(),this.remoteTimestamp=T||this.localTimestamp,this.logicalFrames=w||0,this.cancel=function(){f=null,p.forEach(function(D){D.cancel()}),p=[]},this.isReady=function(){for(var P=0;P<p.length;P++)if(p[P].blocked)return!1;return!0},this.flush=function(){for(var P=0;P<p.length;P++)p[P].execute();f&&f()}};function A(s,f){var p=this;this.blocked=f,this.cancel=function(){p.blocked=!1,s=null},this.unblock=function(){p.blocked&&(p.blocked=!1,L())},this.execute=function(){s&&s()}}function x(s,f){var p=new A(s,f);return v.push(p),p}this.getElement=function(){return g},this.getWidth=function(){return e},this.getHeight=function(){return t},this.getDefaultLayer=function(){return l},this.getCursorLayer=function(){return y},this.createLayer=function(){var s=new n.Display.VisibleLayer(e,t);return s.move(l,0,0,0),s},this.createBuffer=function(){var s=new n.Layer(0,0);return s.autosize=1,s},this.flush=function(s,f,p){c.push(new O(s,v,f,p)),v=[],L()},this.cancel=function(){c.forEach(function(p){p.cancel()}),c=[],v.forEach(function(p){p.cancel()}),v=[]},this.setCursor=function(s,f,p,T,w,P,k){x(function(){u.cursorHotspotX=s,u.cursorHotspotY=f,y.resize(P,k),y.copy(p,T,w,P,k,0,0),u.moveCursor(u.cursorX,u.cursorY),u.oncursor&&u.oncursor(y.toCanvas(),s,f)})},this.showCursor=function(s){var f=y.getElement(),p=f.parentNode;s===!1?p&&p.removeChild(f):p!==o&&o.appendChild(f)},this.moveCursor=function(s,f){y.translate(s-u.cursorHotspotX,f-u.cursorHotspotY),u.cursorX=s,u.cursorY=f},this.resize=function(s,f,p){x(function(){s.resize(f,p),s===l&&(e=f,t=p,o.style.width=e+"px",o.style.height=t+"px",g.style.width=e*a+"px",g.style.height=t*a+"px",u.onresize&&u.onresize(f,p))})},this.drawImage=function(s,f,p,T){x(function(){s.drawImage(f,p,T)})},this.drawBlob=function(s,f,p,T){var w;if(window.createImageBitmap){var P;w=x(function(){s.drawImage(f,p,P)},!0),window.createImageBitmap(T).then(function(i){P=i,w.unblock()})}else{var k=URL.createObjectURL(T);w=x(function(){D.width&&D.height&&s.drawImage(f,p,D),URL.revokeObjectURL(k)},!0);var D=new Image;D.onload=w.unblock,D.onerror=w.unblock,D.src=k}},this.drawStream=function(f,p,T,w,P){if(window.createImageBitmap){var k=new n.BlobReader(w,P);k.onend=function(){u.drawBlob(f,p,T,k.getBlob())}}else{var k=new n.DataURIReader(w,P);k.onend=function(){u.draw(f,p,T,k.getURI())}}},this.draw=function(s,f,p,T){var w=x(function(){P.width&&P.height&&s.drawImage(f,p,P)},!0),P=new Image;P.onload=w.unblock,P.onerror=w.unblock,P.src=T},this.play=function(s,f,p,T){var w=document.createElement("video");w.type=f,w.src=T,w.addEventListener("play",function(){function P(){s.drawImage(0,0,w),w.ended||window.setTimeout(P,20)}P()},!1),x(w.play)},this.transfer=function(s,f,p,T,w,P,k,D,r){x(function(){P.transfer(s,f,p,T,w,k,D,r)})},this.put=function(s,f,p,T,w,P,k,D){x(function(){P.put(s,f,p,T,w,k,D)})},this.copy=function(s,f,p,T,w,P,k,D){x(function(){P.copy(s,f,p,T,w,k,D)})},this.moveTo=function(s,f,p){x(function(){s.moveTo(f,p)})},this.lineTo=function(s,f,p){x(function(){s.lineTo(f,p)})},this.arc=function(s,f,p,T,w,P,k){x(function(){s.arc(f,p,T,w,P,k)})},this.curveTo=function(s,f,p,T,w,P,k){x(function(){s.curveTo(f,p,T,w,P,k)})},this.close=function(s){x(function(){s.close()})},this.rect=function(s,f,p,T,w){x(function(){s.rect(f,p,T,w)})},this.clip=function(s){x(function(){s.clip()})},this.strokeColor=function(s,f,p,T,w,P,k,D){x(function(){s.strokeColor(f,p,T,w,P,k,D)})},this.fillColor=function(s,f,p,T,w){x(function(){s.fillColor(f,p,T,w)})},this.strokeLayer=function(s,f,p,T,w){x(function(){s.strokeLayer(f,p,T,w)})},this.fillLayer=function(s,f){x(function(){s.fillLayer(f)})},this.push=function(s){x(function(){s.push()})},this.pop=function(s){x(function(){s.pop()})},this.reset=function(s){x(function(){s.reset()})},this.setTransform=function(s,f,p,T,w,P,k){x(function(){s.setTransform(f,p,T,w,P,k)})},this.transform=function(s,f,p,T,w,P,k){x(function(){s.transform(f,p,T,w,P,k)})},this.setChannelMask=function(s,f){x(function(){s.setChannelMask(f)})},this.setMiterLimit=function(s,f){x(function(){s.setMiterLimit(f)})},this.dispose=function(f){x(function(){f.dispose()})},this.distort=function(f,p,T,w,P,k,D){x(function(){f.distort(p,T,w,P,k,D)})},this.move=function(f,p,T,w,P){x(function(){f.move(p,T,w,P)})},this.shade=function(f,p){x(function(){f.shade(p)})},this.scale=function(s){o.style.transform=o.style.WebkitTransform=o.style.MozTransform=o.style.OTransform=o.style.msTransform="scale("+s+","+s+")",a=s,g.style.width=e*a+"px",g.style.height=t*a+"px"},this.getScale=function(){return a},this.flatten=function(){var s=document.createElement("canvas");s.width=l.width,s.height=l.height;var f=s.getContext("2d");function p(w){var P=[];for(var k in w.children)P.push(w.children[k]);return P.sort(function(r,i){var h=r.z-i.z;if(h!==0)return h;var S=r.getElement(),M=i.getElement(),_=M.compareDocumentPosition(S);return _&Node.DOCUMENT_POSITION_PRECEDING?-1:_&Node.DOCUMENT_POSITION_FOLLOWING?1:0}),P}function T(w,P,k){if(w.width>0&&w.height>0){var D=f.globalAlpha;f.globalAlpha*=w.alpha/255,f.drawImage(w.getCanvas(),P,k);for(var r=p(w),i=0;i<r.length;i++){var h=r[i];T(h,P+h.x,k+h.y)}f.globalAlpha=D}}return T(l,0,0),s}};n.Display.VisibleLayer=function(u,e){n.Layer.apply(this,[u,e]);var t=this;this.__unique_id=n.Display.VisibleLayer.__next_id++,this.alpha=255,this.x=0,this.y=0,this.z=0,this.matrix=[1,0,0,1,0,0],this.parent=null,this.children={};var a=t.getCanvas();a.style.position="absolute",a.style.left="0px",a.style.top="0px";var o=document.createElement("div");o.appendChild(a),o.style.width=u+"px",o.style.height=e+"px",o.style.position="absolute",o.style.left="0px",o.style.top="0px",o.style.overflow="hidden";var l=this.resize;this.resize=function(v,c){o.style.width=v+"px",o.style.height=c+"px",l(v,c)},this.getElement=function(){return o};var y="translate(0px, 0px)",g="matrix(1, 0, 0, 1, 0, 0)";this.translate=function(v,c){t.x=v,t.y=c,y="translate("+v+"px,"+c+"px)",o.style.transform=o.style.WebkitTransform=o.style.MozTransform=o.style.OTransform=o.style.msTransform=y+" "+g},this.move=function(v,c,m,C){if(t.parent!==v){t.parent&&delete t.parent.children[t.__unique_id],t.parent=v,v.children[t.__unique_id]=t;var E=v.getElement();E.appendChild(o)}t.translate(c,m),t.z=C,o.style.zIndex=C},this.shade=function(v){t.alpha=v,o.style.opacity=v/255},this.dispose=function(){t.parent&&(delete t.parent.children[t.__unique_id],t.parent=null),o.parentNode&&o.parentNode.removeChild(o)},this.distort=function(v,c,m,C,E,d){t.matrix=[v,c,m,C,E,d],g="matrix("+v+","+c+","+m+","+C+","+E+","+d+")",o.style.transform=o.style.WebkitTransform=o.style.MozTransform=o.style.OTransform=o.style.msTransform=y+" "+g}};n.Display.VisibleLayer.__next_id=0;n.Display.Statistics=function(e){e=e||{},this.processingLag=e.processingLag,this.desktopFps=e.desktopFps,this.serverFps=e.serverFps,this.clientFps=e.clientFps,this.dropRate=e.dropRate};var n=n||{};n.Event=function(e){this.type=e,this.timestamp=new Date().getTime(),this.getAge=function(){return new Date().getTime()-this.timestamp},this.invokeLegacyHandler=function(a){}};n.Event.DOMEvent=function(e,t){n.Event.call(this,e),t=t||[],Array.isArray(t)||(t=[t]),this.preventDefault=function(){t.forEach(function(l){l.preventDefault&&l.preventDefault(),l.returnValue=!1})},this.stopPropagation=function(){t.forEach(function(l){l.stopPropagation()})}};n.Event.DOMEvent.cancelEvent=function(e){e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1};n.Event.Target=function(){var e={};this.on=function(a,o){var l=e[a];l||(e[a]=l=[]),l.push(o)},this.onEach=function(a,o){a.forEach(function(y){this.on(y,o)},this)},this.dispatch=function(a){a.invokeLegacyHandler(this);var o=e[a.type];if(o)for(var l=0;l<o.length;l++)o[l](a,this)},this.off=function(a,o){var l=e[a];if(!l)return!1;for(var y=0;y<l.length;y++)if(l[y]===o)return l.splice(y,1),!0;return!1},this.offEach=function(a,o){var l=!1;return a.forEach(function(g){l|=this.off(g,o)},this),l}};var n=n||{};n.InputSink=function(){var e=this,t=document.createElement("textarea");t.style.position="fixed",t.style.outline="none",t.style.border="none",t.style.margin="0",t.style.padding="0",t.style.height="0",t.style.width="0",t.style.left="0",t.style.bottom="0",t.style.resize="none",t.style.background="transparent",t.style.color="transparent",t.addEventListener("keypress",function(o){t.value=""},!1),t.addEventListener("compositionend",function(o){o.data&&(t.value="")},!1),t.addEventListener("input",function(o){o.data&&!o.isComposing&&(t.value="")},!1),t.addEventListener("focus",function(){window.setTimeout(function(){t.click(),t.select()},0)},!0),this.focus=function(){window.setTimeout(function(){t.focus()},0)},this.getElement=function(){return t},document.addEventListener("keydown",function(o){var l=document.activeElement;if(l&&l!==document.body){var y=l.getBoundingClientRect();if(y.left+y.width>0&&y.top+y.height>0)return}e.focus()},!0)};var n=n||{};n.InputStream=function(u,e){var t=this;this.index=e,this.onblob=null,this.onend=null,this.sendAck=function(a,o){u.sendAck(t.index,a,o)}};var n=n||{};n.IntegerPool=function(){var u=this,e=[];this.next_int=0,this.next=function(){return e.length>0?e.shift():u.next_int++},this.free=function(t){e.push(t)}};var n=n||{};n.JSONReader=function(e){var t=this,a=new n.StringReader(e),o="";this.getLength=function(){return o.length},this.getJSON=function(){return JSON.parse(o)},a.ontext=function(y){o+=y,t.onprogress&&t.onprogress(y.length)},a.onend=function(){t.onend&&t.onend()},this.onprogress=null,this.onend=null};var n=n||{};n.Keyboard=function(e){var t=this,a=n.Keyboard._nextID++,o="_GUAC_KEYBOARD_HANDLED_BY_"+a;this.onkeydown=null,this.onkeyup=null;var l={keyupUnreliable:!1,altIsTypableOnly:!1,capsLockKeyupUnreliable:!1};navigator&&navigator.platform&&(navigator.platform.match(/ipad|iphone|ipod/i)?l.keyupUnreliable=!0:navigator.platform.match(/^mac/i)&&(l.altIsTypableOnly=!0,l.capsLockKeyupUnreliable=!0));var y=function(F){var N=this;this.keyCode=F?F.which||F.keyCode:0,this.keyIdentifier=F&&F.keyIdentifier,this.key=F&&F.key,this.location=F?_(F):0,this.modifiers=F?n.Keyboard.ModifierState.fromKeyboardEvent(F):new n.Keyboard.ModifierState,this.timestamp=new Date().getTime(),this.defaultPrevented=!1,this.keysym=null,this.reliable=!1,this.getAge=function(){return new Date().getTime()-N.timestamp}},g=function(F){y.call(this,F),this.keysym=p(this.key,this.location)||P(this.keyCode,this.location),this.keyupReliable=!l.keyupUnreliable,this.keysym&&!f(this.keysym)&&(this.reliable=!0),!this.keysym&&k(this.keyCode,this.keyIdentifier)&&(this.keysym=p(this.keyIdentifier,this.location,this.modifiers.shift)),this.modifiers.meta&&this.keysym!==65511&&this.keysym!==65512?this.keyupReliable=!1:this.keysym===65509&&l.capsLockKeyupUnreliable&&(this.keyupReliable=!1);var N=!this.modifiers.ctrl&&!l.altIsTypableOnly,B=!this.modifiers.alt;(B&&this.modifiers.ctrl||N&&this.modifiers.alt||this.modifiers.meta||this.modifiers.hyper)&&(this.reliable=!0),O[this.keyCode]=this.keysym};g.prototype=new y;var v=function(F){y.call(this,F),this.keysym=w(this.keyCode),this.reliable=!0};v.prototype=new y;var c=function(F){y.call(this,F),this.keysym=P(this.keyCode,this.location)||p(this.key,this.location),t.pressed[this.keysym]||(this.keysym=O[this.keyCode]||this.keysym),this.reliable=!0};c.prototype=new y;var m=[],C={8:[65288],9:[65289],12:[65291,65291,65291,65461],13:[65293],16:[65505,65505,65506],17:[65507,65507,65508],18:[65513,65513,65027],19:[65299],20:[65509],27:[65307],32:[32],33:[65365,65365,65365,65465],34:[65366,65366,65366,65459],35:[65367,65367,65367,65457],36:[65360,65360,65360,65463],37:[65361,65361,65361,65460],38:[65362,65362,65362,65464],39:[65363,65363,65363,65462],40:[65364,65364,65364,65458],45:[65379,65379,65379,65456],46:[65535,65535,65535,65454],91:[65511],92:[65512],93:[65383],96:[65456],97:[65457],98:[65458],99:[65459],100:[65460],101:[65461],102:[65462],103:[65463],104:[65464],105:[65465],106:[65450],107:[65451],109:[65453],110:[65454],111:[65455],112:[65470],113:[65471],114:[65472],115:[65473],116:[65474],117:[65475],118:[65476],119:[65477],120:[65478],121:[65479],122:[65480],123:[65481],144:[65407],145:[65300],225:[65027]},E={Again:[65382],AllCandidates:[65341],Alphanumeric:[65328],Alt:[65513,65513,65027],Attn:[64782],AltGraph:[65027],ArrowDown:[65364],ArrowLeft:[65361],ArrowRight:[65363],ArrowUp:[65362],Backspace:[65288],CapsLock:[65509],Cancel:[65385],Clear:[65291],Convert:[65313],Copy:[64789],Crsel:[64796],CrSel:[64796],CodeInput:[65335],Compose:[65312],Control:[65507,65507,65508],ContextMenu:[65383],Delete:[65535],Down:[65364],End:[65367],Enter:[65293],EraseEof:[64774],Escape:[65307],Execute:[65378],Exsel:[64797],ExSel:[64797],F1:[65470],F2:[65471],F3:[65472],F4:[65473],F5:[65474],F6:[65475],F7:[65476],F8:[65477],F9:[65478],F10:[65479],F11:[65480],F12:[65481],F13:[65482],F14:[65483],F15:[65484],F16:[65485],F17:[65486],F18:[65487],F19:[65488],F20:[65489],F21:[65490],F22:[65491],F23:[65492],F24:[65493],Find:[65384],GroupFirst:[65036],GroupLast:[65038],GroupNext:[65032],GroupPrevious:[65034],FullWidth:null,HalfWidth:null,HangulMode:[65329],Hankaku:[65321],HanjaMode:[65332],Help:[65386],Hiragana:[65317],HiraganaKatakana:[65319],Home:[65360],Hyper:[65517,65517,65518],Insert:[65379],JapaneseHiragana:[65317],JapaneseKatakana:[65318],JapaneseRomaji:[65316],JunjaMode:[65336],KanaMode:[65325],KanjiMode:[65313],Katakana:[65318],Left:[65361],Meta:[65511,65511,65512],ModeChange:[65406],NumLock:[65407],PageDown:[65366],PageUp:[65365],Pause:[65299],Play:[64790],PreviousCandidate:[65342],PrintScreen:[65377],Redo:[65382],Right:[65363],RomanCharacters:null,Scroll:[65300],Select:[65376],Separator:[65452],Shift:[65505,65505,65506],SingleCandidate:[65340],Super:[65515,65515,65516],Tab:[65289],UIKeyInputDownArrow:[65364],UIKeyInputEscape:[65307],UIKeyInputLeftArrow:[65361],UIKeyInputRightArrow:[65363],UIKeyInputUpArrow:[65362],Up:[65362],Undo:[65381],Win:[65511,65511,65512],Zenkaku:[65320],ZenkakuHankaku:[65322]},d={65027:!0,65505:!0,65506:!0,65507:!0,65508:!0,65509:!0,65511:!0,65512:!0,65513:!0,65514:!0,65515:!0,65516:!0};this.modifiers=new n.Keyboard.ModifierState,this.pressed={};var I={},L={},O={},A=null,x=null,s=function(F,N){return F?F[N]||F[0]:null},f=function(F){return F>=0&&F<=255||(F&4294901760)===16777216};function p(b,F,N){if(!b)return null;var B,U=b.indexOf("U+");if(U>=0){var z=b.substring(U+2);B=String.fromCharCode(parseInt(z,16))}else if(b.length===1&&F!==3)B=b;else return s(E[b],F);N===!0?B=B.toUpperCase():N===!1&&(B=B.toLowerCase());var K=B.charCodeAt(0);return w(K)}function T(b){return b<=31||b>=127&&b<=159}function w(b){return T(b)?65280|b:b>=0&&b<=255?b:b>=256&&b<=1114111?16777216|b:null}function P(b,F){return s(C[b],F)}var k=function(F,N){if(!N)return!1;var B=N.indexOf("U+");if(B===-1)return!0;var U=parseInt(N.substring(B+2),16);return F!==U||F>=65&&F<=90||F>=48&&F<=57};this.press=function(b){if(b!==null){if(!t.pressed[b]&&(t.pressed[b]=!0,t.onkeydown)){var F=t.onkeydown(b);return L[b]=F,window.clearTimeout(A),window.clearInterval(x),d[b]||(A=window.setTimeout(function(){x=window.setInterval(function(){t.onkeyup(b),t.onkeydown(b)},50)},500)),F}return L[b]||!1}},this.release=function(b){t.pressed[b]&&(delete t.pressed[b],delete I[b],window.clearTimeout(A),window.clearInterval(x),b!==null&&t.onkeyup&&t.onkeyup(b))},this.type=function(F){for(var N=0;N<F.length;N++){var B=F.codePointAt?F.codePointAt(N):F.charCodeAt(N),U=w(B);t.press(U),t.release(U)}},this.reset=function(){for(var b in t.pressed)t.release(parseInt(b));m=[]};var D=function(F,N,B){var U=B.modifiers[F],z=t.modifiers[F],K;if(N.indexOf(B.keysym)===-1){if(z&&U===!1)for(K=0;K<N.length;K++)t.release(N[K]);else if(!z&&U){for(K=0;K<N.length;K++)if(t.pressed[N[K]])return;var H=N[0];B.keysym&&(I[H]=!0),t.press(H)}}},r=function(F){D("alt",[65513,65514,65027],F),D("shift",[65505,65506],F),D("ctrl",[65507,65508],F),D("meta",[65511,65512],F),D("hyper",[65515,65516],F),t.modifiers=F.modifiers},i=function(){for(var F in t.pressed)if(!I[F])return!1;return!0};function h(){var b=M();if(!b)return!1;var F;do F=b,b=M();while(b!==null);return i()&&t.reset(),F.defaultPrevented}var S=function(F){!t.modifiers.ctrl||!t.modifiers.alt||F>=65&&F<=90||F>=97&&F<=122||(F<=255||(F&4278190080)===16777216)&&(t.release(65507),t.release(65508),t.release(65513),t.release(65514))},M=function(){var F=m[0];if(!F)return null;if(F instanceof g){var N=null,B=[];if(F.keysym===65511||F.keysym===65512){if(m.length===1)return null;if(m[1].keysym!==F.keysym){if(!m[1].modifiers.meta)return m.shift()}else if(m[1]instanceof g)return m.shift()}if(F.reliable?(N=F.keysym,B=m.splice(0,1)):m[1]instanceof v?(N=m[1].keysym,B=m.splice(0,2)):m[1]&&(N=F.keysym,B=m.splice(0,1)),B.length>0){if(r(F),N){S(N);var U=!t.press(N);O[F.keyCode]=N,F.keyupReliable||t.release(N);for(var z=0;z<B.length;z++)B[z].defaultPrevented=U}return F}}else if(F instanceof c&&!l.keyupUnreliable){var N=F.keysym;if(N)t.release(N),delete O[F.keyCode],F.defaultPrevented=!0;else return t.reset(),F;return r(F),m.shift()}else return m.shift();return null},_=function(F){return"location"in F?F.location:"keyLocation"in F?F.keyLocation:0},R=function(F){return F[o]?!1:(F[o]=!0,!0)};this.listenTo=function(F){F.addEventListener("keydown",function(U){if(t.onkeydown&&R(U)){var z=new g(U);z.keyCode!==229&&(m.push(z),h()&&U.preventDefault())}},!0),F.addEventListener("keypress",function(U){!t.onkeydown&&!t.onkeyup||R(U)&&(m.push(new v(U)),h()&&U.preventDefault())},!0),F.addEventListener("keyup",function(U){t.onkeyup&&R(U)&&(U.preventDefault(),m.push(new c(U)),h())},!0);var N=function(z){!t.onkeydown&&!t.onkeyup||R(z)&&z.data&&!z.isComposing&&(F.removeEventListener("compositionend",B,!1),t.type(z.data))},B=function(z){!t.onkeydown&&!t.onkeyup||R(z)&&z.data&&(F.removeEventListener("input",N,!1),t.type(z.data))};F.addEventListener("input",N,!1),F.addEventListener("compositionend",B,!1)},e&&t.listenTo(e)};n.Keyboard._nextID=0;n.Keyboard.ModifierState=function(){this.shift=!1,this.ctrl=!1,this.alt=!1,this.meta=!1,this.hyper=!1};n.Keyboard.ModifierState.fromKeyboardEvent=function(u){var e=new n.Keyboard.ModifierState;return e.shift=u.shiftKey,e.ctrl=u.ctrlKey,e.alt=u.altKey,e.meta=u.metaKey,u.getModifierState&&(e.hyper=u.getModifierState("OS")||u.getModifierState("Super")||u.getModifierState("Hyper")||u.getModifierState("Win")),e};var n=n||{};n.Layer=function(u,e){var t=this,a=64,o=document.createElement("canvas"),l=o.getContext("2d");l.save();var y=!0,g=!0,v=0,c={1:"destination-in",2:"destination-out",4:"source-in",6:"source-atop",8:"source-out",9:"destination-atop",10:"xor",11:"destination-over",12:"copy",14:"source-over",15:"lighter"},m=function(d,I){d=d||0,I=I||0;var L=Math.ceil(d/a)*a,O=Math.ceil(I/a)*a;if(o.width!==L||o.height!==O){var A=null;if(!y&&o.width!==0&&o.height!==0){A=document.createElement("canvas"),A.width=Math.min(t.width,d),A.height=Math.min(t.height,I);var x=A.getContext("2d");x.drawImage(o,0,0,A.width,A.height,0,0,A.width,A.height)}var s=l.globalCompositeOperation;o.width=L,o.height=O,A&&l.drawImage(A,0,0,A.width,A.height,0,0,A.width,A.height),l.globalCompositeOperation=s,v=0,l.save()}else t.reset();t.width=d,t.height=I};function C(E,d,I,L){var O=I+E,A=L+d,x;O>t.width?x=O:x=t.width;var s;A>t.height?s=A:s=t.height,t.resize(x,s)}this.autosize=!1,this.width=u,this.height=e,this.getCanvas=function(){return o},this.toCanvas=function(){var d=document.createElement("canvas");d.width=t.width,d.height=t.height;var I=d.getContext("2d");return I.drawImage(t.getCanvas(),0,0),d},this.resize=function(E,d){(E!==t.width||d!==t.height)&&m(E,d)},this.drawImage=function(E,d,I){t.autosize&&C(E,d,I.width,I.height),l.drawImage(I,E,d),y=!1},this.transfer=function(E,d,I,L,O,A,x,s){var f=E.getCanvas();if(!(d>=f.width||I>=f.height)&&(d+L>f.width&&(L=f.width-d),I+O>f.height&&(O=f.height-I),!(L===0||O===0))){t.autosize&&C(A,x,L,O);for(var p=E.getCanvas().getContext("2d").getImageData(d,I,L,O),T=l.getImageData(A,x,L,O),w=0;w<L*O*4;w+=4){var P=new n.Layer.Pixel(p.data[w],p.data[w+1],p.data[w+2],p.data[w+3]),k=new n.Layer.Pixel(T.data[w],T.data[w+1],T.data[w+2],T.data[w+3]);s(P,k),T.data[w]=k.red,T.data[w+1]=k.green,T.data[w+2]=k.blue,T.data[w+3]=k.alpha}l.putImageData(T,A,x),y=!1}},this.put=function(E,d,I,L,O,A,x){var s=E.getCanvas();if(!(d>=s.width||I>=s.height)&&(d+L>s.width&&(L=s.width-d),I+O>s.height&&(O=s.height-I),!(L===0||O===0))){t.autosize&&C(A,x,L,O);var f=E.getCanvas().getContext("2d").getImageData(d,I,L,O);l.putImageData(f,A,x),y=!1}},this.copy=function(E,d,I,L,O,A,x){var s=E.getCanvas();d>=s.width||I>=s.height||(d+L>s.width&&(L=s.width-d),I+O>s.height&&(O=s.height-I),!(L===0||O===0)&&(t.autosize&&C(A,x,L,O),l.drawImage(s,d,I,L,O,A,x,L,O),y=!1))},this.moveTo=function(E,d){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,0,0),l.moveTo(E,d)},this.lineTo=function(E,d){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,0,0),l.lineTo(E,d)},this.arc=function(E,d,I,L,O,A){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,0,0),l.arc(E,d,I,L,O,A)},this.curveTo=function(E,d,I,L,O,A){g&&(l.beginPath(),g=!1),t.autosize&&C(O,A,0,0),l.bezierCurveTo(E,d,I,L,O,A)},this.close=function(){l.closePath(),g=!0},this.rect=function(E,d,I,L){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,I,L),l.rect(E,d,I,L)},this.clip=function(){l.clip(),g=!0},this.strokeColor=function(E,d,I,L,O,A,x){l.lineCap=E,l.lineJoin=d,l.lineWidth=I,l.strokeStyle="rgba("+L+","+O+","+A+","+x/255+")",l.stroke(),y=!1,g=!0},this.fillColor=function(E,d,I,L){l.fillStyle="rgba("+E+","+d+","+I+","+L/255+")",l.fill(),y=!1,g=!0},this.strokeLayer=function(E,d,I,L){l.lineCap=E,l.lineJoin=d,l.lineWidth=I,l.strokeStyle=l.createPattern(L.getCanvas(),"repeat"),l.stroke(),y=!1,g=!0},this.fillLayer=function(E){l.fillStyle=l.createPattern(E.getCanvas(),"repeat"),l.fill(),y=!1,g=!0},this.push=function(){l.save(),v++},this.pop=function(){v>0&&(l.restore(),v--)},this.reset=function(){for(;v>0;)l.restore(),v--;l.restore(),l.save(),l.beginPath(),g=!1},this.setTransform=function(E,d,I,L,O,A){l.setTransform(E,d,I,L,O,A)},this.transform=function(E,d,I,L,O,A){l.transform(E,d,I,L,O,A)},this.setChannelMask=function(E){l.globalCompositeOperation=c[E]},this.setMiterLimit=function(E){l.miterLimit=E},m(u,e),o.style.zIndex=-1};n.Layer.ROUT=2;n.Layer.ATOP=6;n.Layer.XOR=10;n.Layer.ROVER=11;n.Layer.OVER=14;n.Layer.PLUS=15;n.Layer.RIN=1;n.Layer.IN=4;n.Layer.OUT=8;n.Layer.RATOP=9;n.Layer.SRC=12;n.Layer.Pixel=function(u,e,t,a){this.red=u,this.green=e,this.blue=t,this.alpha=a};var n=n||{};n.Mouse=function(e){n.Mouse.Event.Target.call(this);var t=this;this.touchMouseThreshold=3,this.scrollThreshold=53,this.PIXELS_PER_LINE=18,this.PIXELS_PER_PAGE=this.PIXELS_PER_LINE*16;var a=[n.Mouse.State.Buttons.LEFT,n.Mouse.State.Buttons.MIDDLE,n.Mouse.State.Buttons.RIGHT],o=0,l=0;e.addEventListener("contextmenu",function(c){n.Event.DOMEvent.cancelEvent(c)},!1),e.addEventListener("mousemove",function(c){if(o){n.Event.DOMEvent.cancelEvent(c),o--;return}t.move(n.Position.fromClientPosition(e,c.clientX,c.clientY),c)},!1),e.addEventListener("mousedown",function(c){if(o){n.Event.DOMEvent.cancelEvent(c);return}var m=a[c.button];m&&t.press(m,c)},!1),e.addEventListener("mouseup",function(c){if(o){n.Event.DOMEvent.cancelEvent(c);return}var m=a[c.button];m&&t.release(m,c)},!1),e.addEventListener("mouseout",function(c){c||(c=window.event);for(var m=c.relatedTarget||c.toElement;m;){if(m===e)return;m=m.parentNode}t.reset(c),t.out(c)},!1),e.addEventListener("selectstart",function(c){n.Event.DOMEvent.cancelEvent(c)},!1);function y(){o=t.touchMouseThreshold}e.addEventListener("touchmove",y,!1),e.addEventListener("touchstart",y,!1),e.addEventListener("touchend",y,!1);function g(c){var m=c.deltaY||-c.wheelDeltaY||-c.wheelDelta;if(m?c.deltaMode===1?m=c.deltaY*t.PIXELS_PER_LINE:c.deltaMode===2&&(m=c.deltaY*t.PIXELS_PER_PAGE):m=c.detail*t.PIXELS_PER_LINE,l+=m,l<=-t.scrollThreshold){do t.click(n.Mouse.State.Buttons.UP),l+=t.scrollThreshold;while(l<=-t.scrollThreshold);l=0}if(l>=t.scrollThreshold){do t.click(n.Mouse.State.Buttons.DOWN),l-=t.scrollThreshold;while(l>=t.scrollThreshold);l=0}n.Event.DOMEvent.cancelEvent(c)}e.addEventListener("DOMMouseScroll",g,!1),e.addEventListener("mousewheel",g,!1),e.addEventListener("wheel",g,!1);var v=(function(){var c=document.createElement("div");if(!("cursor"in c.style))return!1;try{c.style.cursor="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX///+nxBvIAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==) 0 0, auto"}catch{return!1}return/\burl\([^()]*\)\s+0\s+0\b/.test(c.style.cursor||"")})();this.setCursor=function(c,m,C){if(v){var E=c.toDataURL("image/png");return e.style.cursor="url("+E+") "+m+" "+C+", auto",!0}return!1}};n.Mouse.State=function(e){var t=function(o,l,y,g,v,c,m){return{x:o,y:l,left:y,middle:g,right:v,up:c,down:m}};arguments.length>1?e=t.apply(this,arguments):e=e||{},n.Position.call(this,e),this.left=e.left||!1,this.middle=e.middle||!1,this.right=e.right||!1,this.up=e.up||!1,this.down=e.down||!1};n.Mouse.State.Buttons={LEFT:"left",MIDDLE:"middle",RIGHT:"right",UP:"up",DOWN:"down"};n.Mouse.Event=function(e,t,a){n.Event.DOMEvent.call(this,e,a);var o="on"+this.type;this.state=t,this.invokeLegacyHandler=function(y){y[o]&&(this.preventDefault(),this.stopPropagation(),y[o](this.state))}};n.Mouse.Event.Target=function(){n.Event.Target.call(this),this.currentState=new n.Mouse.State,this.press=function(t,a){this.currentState[t]||(this.currentState[t]=!0,this.dispatch(new n.Mouse.Event("mousedown",this.currentState,a)))},this.release=function(t,a){this.currentState[t]&&(this.currentState[t]=!1,this.dispatch(new n.Mouse.Event("mouseup",this.currentState,a)))},this.click=function(t,a){this.press(t,a),this.release(t,a)},this.move=function(t,a){(this.currentState.x!==t.x||this.currentState.y!==t.y)&&(this.currentState.x=t.x,this.currentState.y=t.y,this.dispatch(new n.Mouse.Event("mousemove",this.currentState,a)))},this.out=function(t){this.dispatch(new n.Mouse.Event("mouseout",this.currentState,t))},this.reset=function(t){for(var a in n.Mouse.State.Buttons)this.release(n.Mouse.State.Buttons[a],t)}};n.Mouse.Touchpad=function(e){n.Mouse.Event.Target.call(this);var t=this;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=10*(window.devicePixelRatio||1),this.currentState=new n.Mouse.State;var a=0,o=0,l=0,y=0,g=0,v={1:"left",2:"right",3:"middle"},c=!1,m=null;e.addEventListener("touchend",function(C){if(C.preventDefault(),c&&C.touches.length===0){var E=new Date().getTime(),d=v[a];t.currentState[d]&&(t.release(d,C),m&&(window.clearTimeout(m),m=null)),E-y<=t.clickTimingThreshold&&g<t.clickMoveThreshold&&(t.press(d,C),m=window.setTimeout(function(){t.release(d,C),c=!1},t.clickTimingThreshold)),m||(c=!1)}},!1),e.addEventListener("touchstart",function(C){if(C.preventDefault(),a=Math.min(C.touches.length,3),m&&(window.clearTimeout(m),m=null),!c){c=!0;var E=C.touches[0];o=E.clientX,l=E.clientY,y=new Date().getTime(),g=0}},!1),e.addEventListener("touchmove",function(C){C.preventDefault();var E=C.touches[0],d=E.clientX-o,I=E.clientY-l;if(g+=Math.abs(d)+Math.abs(I),a===1){var L=g/(new Date().getTime()-y),O=1+L,A=new n.Position(t.currentState);A.x+=d*O,A.y+=I*O,A.x=Math.min(Math.max(0,A.x),e.offsetWidth-1),A.y=Math.min(Math.max(0,A.y),e.offsetHeight-1),t.move(A,C),o=E.clientX,l=E.clientY}else if(a===2&&Math.abs(I)>=t.scrollThreshold){var x;I>0?x="down":x="up",t.click(x,C),o=E.clientX,l=E.clientY}},!1)};n.Mouse.Touchscreen=function(e){n.Mouse.Event.Target.call(this);var t=this,a=!1,o=null,l=null,y=null,g=null;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=16*(window.devicePixelRatio||1),this.longPressThreshold=500;function v(C){var E=C.touches[0]||C.changedTouches[0],d=E.clientX-o,I=E.clientY-l;return Math.sqrt(d*d+I*I)>=t.clickMoveThreshold}function c(C){var E=C.touches[0];a=!0,o=E.clientX,l=E.clientY}function m(){window.clearTimeout(y),window.clearTimeout(g),a=!1}e.addEventListener("touchend",function(C){if(a){if(C.touches.length!==0||C.changedTouches.length!==1){m();return}if(window.clearTimeout(g),t.release(n.Mouse.State.Buttons.LEFT,C),!v(C)&&(C.preventDefault(),!t.currentState.left)){var E=C.changedTouches[0];t.move(n.Position.fromClientPosition(e,E.clientX,E.clientY)),t.press(n.Mouse.State.Buttons.LEFT,C),y=window.setTimeout(function(){t.release(n.Mouse.State.Buttons.LEFT,C),m()},t.clickTimingThreshold)}}},!1),e.addEventListener("touchstart",function(C){if(C.touches.length!==1){m();return}C.preventDefault(),c(C),window.clearTimeout(y),g=window.setTimeout(function(){var E=C.touches[0];t.move(n.Position.fromClientPosition(e,E.clientX,E.clientY)),t.click(n.Mouse.State.Buttons.RIGHT,C),m()},t.longPressThreshold)},!1),e.addEventListener("touchmove",function(C){if(a){if(v(C)&&window.clearTimeout(g),C.touches.length!==1){m();return}if(t.currentState.left){C.preventDefault();var E=C.touches[0];t.move(n.Position.fromClientPosition(e,E.clientX,E.clientY),C)}}},!1)};var n=n||{},n=n||{};n.Object=function(e,t){var a=this,o={},l=function(v){var c=o[v];if(!c)return null;var m=c.shift();return c.length===0&&delete o[v],m},y=function(v,c){var m=o[v];m||(m=[],o[v]=m),m.push(c)};this.index=t,this.onbody=function(v,c,m){var C=l(m);C&&C(v,c)},this.onundefine=null,this.requestInputStream=function(v,c){c&&y(v,c),e.requestObjectInputStream(a.index,v)},this.createOutputStream=function(v,c){return e.createObjectOutputStream(a.index,v,c)}};n.Object.ROOT_STREAM="/";n.Object.STREAM_INDEX_MIMETYPE="application/vnd.glyptodon.guacamole.stream-index+json";var n=n||{};n.OnScreenKeyboard=function(u){var e=this,t={},a={},o=[],l=function(s,f){s.classList?s.classList.add(f):s.className+=" "+f},y=function(s,f){s.classList?s.classList.remove(f):s.className=s.className.replace(/([^ ]+)[ ]*/g,function(T,w){return w===f?"":T})},g=0,v=function(s,f,p,T){this.width=f,this.height=p,this.scale=function(w){s.style.width=f*w+"px",s.style.height=p*w+"px",T&&(s.style.lineHeight=p*w+"px",s.style.fontSize=w+"px")}},c=function(s){for(var f=0;f<s.length;f++){var p=s[f];if(!(p in t))return!1}return!0},m=function(s){var f=e.keys[s];if(!f)return null;for(var p=f.length-1;p>=0;p--){var T=f[p];if(c(T.requires))return T}return null},C=function(s,f){if(!a[s]){l(f,"guac-keyboard-pressed");var p=m(s);if(p.modifier){var T="guac-keyboard-modifier-"+O(p.modifier),w=t[p.modifier];w===void 0?(l(d,T),t[p.modifier]=p.keysym,p.keysym&&e.onkeydown&&e.onkeydown(p.keysym)):(y(d,T),delete t[p.modifier],w&&e.onkeyup&&e.onkeyup(w))}else e.onkeydown&&e.onkeydown(p.keysym);a[s]=!0}},E=function(s,f){if(a[s]){y(f,"guac-keyboard-pressed");var p=m(s);!p.modifier&&e.onkeyup&&e.onkeyup(p.keysym),a[s]=!1}},d=document.createElement("div");d.className="guac-keyboard",d.onselectstart=d.onmousemove=d.onmouseup=d.onmousedown=function(s){return g&&g--,s.stopPropagation(),!1},this.touchMouseThreshold=3,this.onkeydown=null,this.onkeyup=null,this.layout=new n.OnScreenKeyboard.Layout(u),this.getElement=function(){return d},this.resize=function(x){for(var s=Math.floor(x*10/e.layout.width)/10,f=0;f<o.length;f++){var p=o[f];p.scale(s)}};var I=function(s,f){if(f instanceof Array){for(var p=[],T=0;T<f.length;T++)p.push(new n.OnScreenKeyboard.Key(f[T],s));return p}return typeof f=="number"?[new n.OnScreenKeyboard.Key({name:s,keysym:f})]:typeof f=="string"?[new n.OnScreenKeyboard.Key({name:s,title:f})]:[new n.OnScreenKeyboard.Key(f,s)]},L=function(s){var f={};for(var p in u.keys)f[p]=I(p,s[p]);return f};this.keys=L(u.keys);var O=function(s){var f=s.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^A-Za-z0-9]+/g,"-").toLowerCase();return f},A=function x(s,f,p){var T,w=document.createElement("div");if(p&&l(w,"guac-keyboard-"+O(p)),f instanceof Array)for(l(w,"guac-keyboard-group"),T=0;T<f.length;T++)x(w,f[T]);else if(f instanceof Object){l(w,"guac-keyboard-group");var P=Object.keys(f).sort();for(T=0;T<P.length;T++){var p=P[T];x(w,f[p],p)}}else if(typeof f=="number")l(w,"guac-keyboard-gap"),o.push(new v(w,f,f));else if(typeof f=="string"){var k=f;k.length===1&&(k="0x"+k.charCodeAt(0).toString(16)),l(w,"guac-keyboard-key-container");var D=document.createElement("div");D.className="guac-keyboard-key guac-keyboard-key-"+O(k);var r=e.keys[f];if(r)for(T=0;T<r.length;T++){var i=r[T],h=document.createElement("div");h.className="guac-keyboard-cap",h.textContent=i.title;for(var S=0;S<i.requires.length;S++){var M=i.requires[S];l(h,"guac-keyboard-requires-"+O(M)),l(D,"guac-keyboard-uses-"+O(M))}D.appendChild(h)}w.appendChild(D),o.push(new v(w,e.layout.keyWidths[f]||1,1,!0));var _=function(B){B.preventDefault(),g=e.touchMouseThreshold,C(f,D)},R=function(B){B.preventDefault(),g=e.touchMouseThreshold,E(f,D)},b=function(B){B.preventDefault(),g===0&&C(f,D)},F=function(B){B.preventDefault(),g===0&&E(f,D)};D.addEventListener("touchstart",_,!0),D.addEventListener("touchend",R,!0),D.addEventListener("mousedown",b,!0),D.addEventListener("mouseup",F,!0),D.addEventListener("mouseout",F,!0)}s.appendChild(w)};A(d,u.layout)};n.OnScreenKeyboard.Layout=function(u){this.language=u.language,this.type=u.type,this.keys=u.keys,this.layout=u.layout,this.width=u.width,this.keyWidths=u.keyWidths||{}};n.OnScreenKeyboard.Key=function(u,e){this.name=e||u.name,this.title=u.title||this.name,this.keysym=u.keysym||(function(a){if(!a||a.length!==1)return null;var o=a.charCodeAt(0);return o>=0&&o<=255?o:o>=256&&o<=1114111?16777216|o:null})(this.title),this.modifier=u.modifier,this.requires=u.requires||[]};var n=n||{};n.OutputStream=function(u,e){var t=this;this.index=e,this.onack=null,this.sendBlob=function(a){u.sendBlob(t.index,a)},this.sendEnd=function(){u.endStream(t.index)}};var n=n||{};n.Parser=function(){var u=this,e="",t=[],a=-1,o=0;this.receive=function(l){for(o>4096&&a>=o&&(e=e.substring(o),a-=o,o=0),e+=l;a<e.length;){if(a>=o){var y=e.substring(o,a),g=e.substring(a,a+1);if(t.push(y),g==";"){var v=t.shift();u.oninstruction!=null&&u.oninstruction(v,t),t.length=0}else if(g!=",")throw new Error("Illegal terminator.");o=a+1}var c=e.indexOf(".",o);if(c!=-1){var m=parseInt(e.substring(a+1,c));if(isNaN(m))throw new Error("Non-numeric character in element length.");o=c+1,a=o+m}else{o=e.length;break}}},this.oninstruction=null};var n=n||{};n.Position=function(e){e=e||{},this.x=e.x||0,this.y=e.y||0,this.fromClientPosition=function(a,o,l){this.x=o-a.offsetLeft,this.y=l-a.offsetTop;for(var y=a.offsetParent;y&&y!==document.body;)this.x-=y.offsetLeft-y.scrollLeft,this.y-=y.offsetTop-y.scrollTop,y=y.offsetParent;if(y){var g=document.body.scrollLeft||document.documentElement.scrollLeft,v=document.body.scrollTop||document.documentElement.scrollTop;this.x-=y.offsetLeft-g,this.y-=y.offsetTop-v}}};n.Position.fromClientPosition=function(e,t,a){var o=new n.Position;return o.fromClientPosition(e,t,a),o};var n=n||{};n.RawAudioFormat=function(e){this.bytesPerSample=e.bytesPerSample,this.channels=e.channels,this.rate=e.rate};n.RawAudioFormat.parse=function(e){var t,a=null,o=1;if(e.substring(0,9)==="audio/L8;")e=e.substring(9),t=1;else if(e.substring(0,10)==="audio/L16;")e=e.substring(10),t=2;else return null;for(var l=e.split(","),y=0;y<l.length;y++){var g=l[y],v=g.indexOf("=");if(v===-1)return null;var c=g.substring(0,v),m=g.substring(v+1);switch(c){case"channels":o=parseInt(m);break;case"rate":a=parseInt(m);break;default:return null}}return a===null?null:new n.RawAudioFormat({bytesPerSample:t,channels:o,rate:a})};var n=n||{};n.SessionRecording=function(e){var t=this,a,o=null,l=262144,y=16384,g=5e3,v=[],c=0,m=new n.SessionRecording._PlaybackTunnel,C=new n.Client(m),E=-1,d=null,I=null,L=null,O=0,A=0,x=!1,s=null,f=function(R,b,F){if(!(x&&R===a)){var N=new n.Parser;N.oninstruction=b;var B=0,U=new FileReader,z=function(){if(!(x&&R===a)){if(U.readyState===2)try{N.receive(U.result)}catch(W){t.onerror&&t.onerror(W.message);return}if(B>=R.size)F&&F();else{var H=R.slice(B,B+l);B+=H.size,U.readAsText(H)}}};U.onload=z,z()}},p=function(R){for(var b=R.length,F=b+3;b>=10;)F++,b=Math.floor(b/10);return F};C.connect(),C.getDisplay().showCursor(!1);var T=function(R,b){A+=p(R);for(var F=0;F<b.length;F++)A+=p(b[F]);if(R==="sync"){var N=parseInt(b[0]),B=new n.SessionRecording._Frame(N,O,A);v.push(B),O=A,(v.length===1||A-v[c].start>=y&&N-v[c].timestamp>=g)&&(B.keyframe=!0,c=v.length-1),t.onprogress&&t.onprogress(t.getDuration(),A)}},w=function(){t.onload&&t.onload()};if(e instanceof Blob)f(a,T,w);else{o=e,a=new Blob;var P=!1,k="";o.oninstruction=function(R,b){k+=R.length+"."+R,b.forEach(function(N){k+=","+N.length+"."+N}),k+=";",k.length>=l&&(a=new Blob([a,k]),k=""),T(R,b)},o.onerror=function(R){P=!0,t.onerror&&t.onerror(R.message)},o.onstatechange=function(R){R===n.Tunnel.State.CLOSED&&(k.length&&(a=new Blob([a,k]),k=""),P||w())}}var D=function(R){return v.length===0?0:R-v[0].timestamp},r=function _(R,b,F){if(R===b)return R;var N=Math.floor((R+b)/2),B=D(v[N].timestamp);return F<B&&N>R?_(R,N-1,F):F>B&&N<b?_(N+1,b,F):N},i=function(R,b){var F=v[R];f(a.slice(F.start,F.end),function(B,U){m.receiveInstruction(B,U)},function(){F.keyframe&&!F.clientState&&C.exportState(function(U){F.clientState=new Blob([JSON.stringify(U)])}),E=R,b&&b()})},h=function(R,b,F){S();for(var N=L={aborted:!1},B=R,U=function H(){t.onseek&&E>B&&t.onseek(D(v[E].timestamp),E-B,R-B),!N.aborted&&(E<R?i(E+1,H):b())},z=function(){var W=F?Math.max(F-new Date().getTime(),0):0;W?window.setTimeout(U,W):U()};B>=0;B--){var K=v[B];if(B===E)break;if(K.clientState){K.clientState.text().then(function(W){C.importState(JSON.parse(W)),E=B,z()});return}}z()},S=function(){L&&(L.aborted=!0,L=null)},M=function _(){if(E+1<v.length){var R=v[E+1],b=R.timestamp-d+I;h(E+1,function(){_()},b)}else t.pause()};this.onload=null,this.onerror=null,this.onabort=null,this.onprogress=null,this.onplay=null,this.onpause=null,this.onseek=null,this.connect=function(R){o&&o.connect(R)},this.disconnect=function(){o&&o.disconnect()},this.abort=function(){x||(x=!0,t.onabort&&t.onabort(),o&&o.disconnect())},this.getDisplay=function(){return C.getDisplay()},this.isPlaying=function(){return!!d},this.getPosition=function(){return E===-1?0:D(v[E].timestamp)},this.getDuration=function(){return v.length===0?0:D(v[v.length-1].timestamp)},this.play=function(){if(!t.isPlaying()&&E+1<v.length){t.onplay&&t.onplay();var R=v[E+1];d=R.timestamp,I=new Date().getTime(),M()}},this.seek=function(R,b){if(v.length!==0){t.cancel();var F=t.isPlaying();t.pause(),s=function(){s=null,F&&(t.play(),F=null),b&&b()},h(r(0,v.length-1,R),s)}},this.cancel=function(){s&&(S(),s())},this.pause=function(){S(),t.isPlaying()&&(t.onpause&&t.onpause(),d=null,I=null)}};n.SessionRecording._Frame=function(e,t,a){this.keyframe=!1,this.timestamp=e,this.start=t,this.end=a,this.clientState=null};n.SessionRecording._PlaybackTunnel=function(){var e=this;this.connect=function(a){},this.sendMessage=function(a){},this.disconnect=function(){},this.receiveInstruction=function(a,o){e.oninstruction&&e.oninstruction(a,o)}};var n=n||{};n.Status=function(u,e){var t=this;this.code=u,this.message=e,this.isError=function(){return t.code<0||t.code>255}};n.Status.Code={SUCCESS:0,UNSUPPORTED:256,SERVER_ERROR:512,SERVER_BUSY:513,UPSTREAM_TIMEOUT:514,UPSTREAM_ERROR:515,RESOURCE_NOT_FOUND:516,RESOURCE_CONFLICT:517,RESOURCE_CLOSED:518,UPSTREAM_NOT_FOUND:519,UPSTREAM_UNAVAILABLE:520,SESSION_CONFLICT:521,SESSION_TIMEOUT:522,SESSION_CLOSED:523,CLIENT_BAD_REQUEST:768,CLIENT_UNAUTHORIZED:769,CLIENT_FORBIDDEN:771,CLIENT_TIMEOUT:776,CLIENT_OVERRUN:781,CLIENT_BAD_TYPE:783,CLIENT_TOO_MANY:797};n.Status.Code.fromHTTPCode=function(e){switch(e){case 400:return n.Status.Code.CLIENT_BAD_REQUEST;case 403:return n.Status.Code.CLIENT_FORBIDDEN;case 404:return n.Status.Code.RESOURCE_NOT_FOUND;case 429:return n.Status.Code.CLIENT_TOO_MANY;case 503:return n.Status.Code.SERVER_BUSY}return n.Status.Code.SERVER_ERROR};n.Status.Code.fromWebSocketCode=function(e){switch(e){case 1e3:return n.Status.Code.SUCCESS;case 1006:case 1015:return n.Status.Code.UPSTREAM_NOT_FOUND;case 1001:case 1012:case 1013:case 1014:return n.Status.Code.UPSTREAM_UNAVAILABLE}return n.Status.Code.SERVER_ERROR};var n=n||{};n.StringReader=function(u){var e=this,t=new n.UTF8Parser,a=new n.ArrayBufferReader(u);a.ondata=function(o){var l=t.decode(o);e.ontext&&e.ontext(l)},a.onend=function(){e.onend&&e.onend()},this.ontext=null,this.onend=null};var n=n||{};n.StringWriter=function(u){var e=this,t=new n.ArrayBufferWriter(u),a=new Uint8Array(8192),o=0;t.onack=function(v){e.onack&&e.onack(v)};function l(v){if(o+v>=a.length){var c=new Uint8Array((o+v)*2);c.set(a),a=c}o+=v}function y(v){var c,m;if(v<=127)c=0,m=1;else if(v<=2047)c=192,m=2;else if(v<=65535)c=224,m=3;else if(v<=2097151)c=240,m=4;else{y(65533);return}l(m);for(var C=o-1,E=1;E<m;E++)a[C--]=128|v&63,v>>=6;a[C]=c|v}function g(v){for(var c=0;c<v.length;c++){var m=v.charCodeAt(c);y(m)}if(o>0){var C=a.subarray(0,o);return o=0,C}}this.sendText=function(v){v.length&&t.sendData(g(v))},this.sendEnd=function(){t.sendEnd()},this.onack=null};var n=n||{};n.Touch=function(e){n.Event.Target.call(this);var t=this,a=Math.floor(16*window.devicePixelRatio);this.touches={},this.activeTouches=0,e.addEventListener("touchstart",function(l){for(var y=0;y<l.changedTouches.length;y++){var g=l.changedTouches[y],v=g.identifier;if(!t.touches[v]){var c=t.touches[v]=new n.Touch.State({id:v,radiusX:g.radiusX||a,radiusY:g.radiusY||a,angle:g.angle||0,force:g.force||1});t.activeTouches++,c.fromClientPosition(e,g.clientX,g.clientY),t.dispatch(new n.Touch.Event("touchmove",l,c))}}},!1),e.addEventListener("touchmove",function(l){for(var y=0;y<l.changedTouches.length;y++){var g=l.changedTouches[y],v=g.identifier,c=t.touches[v];c&&(g.force&&(c.force=g.force),c.angle=g.angle||0,c.radiusX=g.radiusX||a,c.radiusY=g.radiusY||a,c.fromClientPosition(e,g.clientX,g.clientY),t.dispatch(new n.Touch.Event("touchmove",l,c)))}},!1),e.addEventListener("touchend",function(l){for(var y=0;y<l.changedTouches.length;y++){var g=l.changedTouches[y],v=g.identifier,c=t.touches[v];c&&(delete t.touches[v],t.activeTouches--,c.force=0,c.fromClientPosition(e,g.clientX,g.clientY),t.dispatch(new n.Touch.Event("touchend",l,c)))}},!1)};n.Touch.State=function(e){e=e||{},n.Position.call(this,e),this.id=e.id||0,this.radiusX=e.radiusX||0,this.radiusY=e.radiusY||0,this.angle=e.angle||0,this.force=e.force||1};n.Touch.Event=function(e,t,a){n.Event.DOMEvent.call(this,e,[t]),this.state=a};var n=n||{};n.Tunnel=function(){this.connect=function(u){},this.disconnect=function(){},this.sendMessage=function(u){},this.setState=function(u){u!==this.state&&(this.state=u,this.onstatechange&&this.onstatechange(u))},this.setUUID=function(e){this.uuid=e,this.onuuid&&this.onuuid(e)},this.isConnected=function(){return this.state===n.Tunnel.State.OPEN||this.state===n.Tunnel.State.UNSTABLE},this.state=n.Tunnel.State.CLOSED,this.receiveTimeout=15e3,this.unstableThreshold=1500,this.uuid=null,this.onuuid=null,this.onerror=null,this.onstatechange=null,this.oninstruction=null};n.Tunnel.INTERNAL_DATA_OPCODE="";n.Tunnel.State={CONNECTING:0,OPEN:1,CLOSED:2,UNSTABLE:3};n.HTTPTunnel=function(u,e,t){var a=this,o=u+"?connect",l=u+"?read:",y=u+"?write:",g=1,v=0,c=g,m=!1,C="",E=!!e,d=null,I=null,L=null,O=500,A=t||{},x="Guacamole-Tunnel-Token",s=null;function f(i,h){for(var S in h)i.setRequestHeader(S,h[S])}var p=function(){window.clearTimeout(d),window.clearTimeout(I),a.state===n.Tunnel.State.UNSTABLE&&a.setState(n.Tunnel.State.OPEN),d=window.setTimeout(function(){T(new n.Status(n.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},a.receiveTimeout),I=window.setTimeout(function(){a.setState(n.Tunnel.State.UNSTABLE)},a.unstableThreshold)};function T(i){window.clearTimeout(d),window.clearTimeout(I),window.clearInterval(L),a.state!==n.Tunnel.State.CLOSED&&(i.code!==n.Status.Code.SUCCESS&&a.onerror&&(a.state===n.Tunnel.State.CONNECTING||i.code!==n.Status.Code.RESOURCE_NOT_FOUND)&&a.onerror(i),m=!1,a.setState(n.Tunnel.State.CLOSED))}this.sendMessage=function(){if(!a.isConnected()||arguments.length===0)return;function i(M){var _=new String(M);return _.length+"."+_}for(var h=i(arguments[0]),S=1;S<arguments.length;S++)h+=","+i(arguments[S]);h+=";",C+=h,m||w()};function w(){if(a.isConnected())if(C.length>0){m=!0;var i=new XMLHttpRequest;i.open("POST",y+a.uuid),i.withCredentials=E,f(i,A),i.setRequestHeader("Content-type","application/octet-stream"),i.setRequestHeader(x,s),i.onreadystatechange=function(){i.readyState===4&&(p(),i.status!==200?P(i):w())},i.send(C),C=""}else m=!1}function P(i){var h=parseInt(i.getResponseHeader("Guacamole-Status-Code"));if(h){var S=i.getResponseHeader("Guacamole-Error-Message");T(new n.Status(h,S))}else i.status?T(new n.Status(n.Status.Code.fromHTTPCode(i.status),i.statusText)):T(new n.Status(n.Status.Code.UPSTREAM_NOT_FOUND))}function k(i){var h=null,S=null,M=0,_=-1,R=0,b=new Array;function F(){if(!a.isConnected()){h!==null&&clearInterval(h);return}if(!(i.readyState<2)){var N;try{N=i.status}catch{N=200}if(!S&&N===200&&(S=r()),i.readyState===3||i.readyState===4){if(p(),c===g&&(i.readyState===3&&!h?h=setInterval(F,30):i.readyState===4&&h&&clearInterval(h)),i.status===0){a.disconnect();return}else if(i.status!==200){P(i);return}var B;try{B=i.responseText}catch{return}for(;_<B.length;){if(_>=R){var U=B.substring(R,_),z=B.substring(_,_+1);if(b.push(U),z===";"){var K=b.shift();a.oninstruction&&a.oninstruction(K,b),b.length=0}R=_+1}var H=B.indexOf(".",R);if(H!==-1){var W=parseInt(B.substring(_+1,H));if(W===0){h&&clearInterval(h),i.onreadystatechange=null,i.abort(),S&&k(S);break}R=H+1,_=R+W}else{R=B.length;break}}}}}c===g?i.onreadystatechange=function(){i.readyState===3&&(M++,M>=2&&(c=v,i.onreadystatechange=F)),F()}:i.onreadystatechange=F,F()}var D=0;function r(){var i=new XMLHttpRequest;return i.open("GET",l+a.uuid+":"+D++),i.setRequestHeader(x,s),i.withCredentials=E,f(i,A),i.send(null),i}this.connect=function(i){p(),a.setState(n.Tunnel.State.CONNECTING);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(h.readyState===4){if(h.status!==200){P(h);return}if(p(),a.setUUID(h.responseText),s=h.getResponseHeader(x),!s){T(new n.Status(n.Status.Code.UPSTREAM_NOT_FOUND));return}a.setState(n.Tunnel.State.OPEN),L=setInterval(function(){a.sendMessage("nop")},O),k(r())}},h.open("POST",o,!0),h.withCredentials=E,f(h,A),h.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),h.send(i)},this.disconnect=function(){T(new n.Status(n.Status.Code.SUCCESS,"Manually closed."))}};n.HTTPTunnel.prototype=new n.Tunnel;n.WebSocketTunnel=function(u){var e=this,t=null,a=null,o=null,l=null,y={"http:":"ws:","https:":"wss:"},g=500,v=0;if(u.substring(0,3)!=="ws:"&&u.substring(0,4)!=="wss:"){var c=y[window.location.protocol];if(u.substring(0,1)==="/")u=c+"//"+window.location.host+u;else{var m=window.location.pathname.lastIndexOf("/"),C=window.location.pathname.substring(0,m+1);u=c+"//"+window.location.host+C+u}}var E=function(){var O=new Date().getTime();e.sendMessage(n.Tunnel.INTERNAL_DATA_OPCODE,"ping",O),v=O},d=function(){window.clearTimeout(a),window.clearTimeout(o),window.clearTimeout(l),e.state===n.Tunnel.State.UNSTABLE&&e.setState(n.Tunnel.State.OPEN),a=window.setTimeout(function(){I(new n.Status(n.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},e.receiveTimeout),o=window.setTimeout(function(){e.setState(n.Tunnel.State.UNSTABLE)},e.unstableThreshold);var O=new Date().getTime(),A=Math.max(v+g-O,0);A>0?l=window.setTimeout(E,A):E()};function I(L){window.clearTimeout(a),window.clearTimeout(o),window.clearTimeout(l),e.state!==n.Tunnel.State.CLOSED&&(L.code!==n.Status.Code.SUCCESS&&e.onerror&&e.onerror(L),e.setState(n.Tunnel.State.CLOSED),t.close())}this.sendMessage=function(L){if(!e.isConnected()||arguments.length===0)return;function O(s){var f=new String(s);return f.length+"."+f}for(var A=O(arguments[0]),x=1;x<arguments.length;x++)A+=","+O(arguments[x]);A+=";",t.send(A)},this.connect=function(L){d(),e.setState(n.Tunnel.State.CONNECTING),t=new WebSocket(u+"?"+L,"guacamole"),t.onopen=function(O){d()},t.onclose=function(O){O.reason?I(new n.Status(parseInt(O.reason),O.reason)):O.code?I(new n.Status(n.Status.Code.fromWebSocketCode(O.code))):I(new n.Status(n.Status.Code.UPSTREAM_NOT_FOUND))},t.onmessage=function(O){d();var A=O.data,x=0,s,f=[];do{var p=A.indexOf(".",x);if(p!==-1){var T=parseInt(A.substring(s+1,p));x=p+1,s=x+T}else I(new n.Status(n.Status.Code.SERVER_ERROR,"Incomplete instruction."));var w=A.substring(x,s),P=A.substring(s,s+1);if(f.push(w),P===";"){var k=f.shift();e.uuid===null&&(k===n.Tunnel.INTERNAL_DATA_OPCODE&&f.length===1&&e.setUUID(f[0]),e.setState(n.Tunnel.State.OPEN)),k!==n.Tunnel.INTERNAL_DATA_OPCODE&&e.oninstruction&&e.oninstruction(k,f),f.length=0}x=s+1}while(x<A.length)}},this.disconnect=function(){I(new n.Status(n.Status.Code.SUCCESS,"Manually closed."))}};n.WebSocketTunnel.prototype=new n.Tunnel;n.ChainedTunnel=function(u){for(var e=this,t,a=[],o=null,l=0;l<arguments.length;l++)a.push(arguments[l]);function y(g){e.disconnect=g.disconnect,e.sendMessage=g.sendMessage;var v=function(C){if(C&&C.code===n.Status.Code.UPSTREAM_TIMEOUT)return a=[],null;var E=a.shift();return E&&(g.onerror=null,g.oninstruction=null,g.onstatechange=null,y(E)),E};function c(){g.onstatechange=e.onstatechange,g.oninstruction=e.oninstruction,g.onerror=e.onerror,g.uuid&&e.setUUID(g.uuid),g.onuuid=function(C){e.setUUID(C)},o=g}g.onstatechange=function(m){switch(m){case n.Tunnel.State.OPEN:c(),e.onstatechange&&e.onstatechange(m);break;case n.Tunnel.State.CLOSED:!v()&&e.onstatechange&&e.onstatechange(m);break}},g.oninstruction=function(m,C){c(),e.oninstruction&&e.oninstruction(m,C)},g.onerror=function(m){!v(m)&&e.onerror&&e.onerror(m)},g.connect(t)}this.connect=function(g){t=g;var v=o||a.shift();v?y(v):e.onerror&&e.onerror(n.Status.Code.SERVER_ERROR,"No tunnels to try.")}};n.ChainedTunnel.prototype=new n.Tunnel;n.StaticHTTPTunnel=function(e,t,a){var o=this,l=null,y=a||{};this.size=null,this.sendMessage=function(v){},this.connect=function(v){o.disconnect(),o.setState(n.Tunnel.State.CONNECTING);var c=new n.Parser,m=new n.UTF8Parser;c.oninstruction=function(E,d){o.oninstruction&&o.oninstruction(E,d)},l=new AbortController,fetch(e,{headers:y,credentials:t?"include":"same-origin",signal:l.signal}).then(function(E){if(!E.ok){o.onerror&&o.onerror(new n.Status(n.Status.Code.fromHTTPCode(E.status),E.statusText)),o.disconnect();return}o.size=E.headers.get("Content-Length"),o.setState(n.Tunnel.State.OPEN);var d=E.body.getReader(),I=function L(O){if(O.done){o.disconnect();return}c.receive(m.decode(O.value)),d.read().then(L)};d.read().then(I)})},this.disconnect=function(){l&&(l.abort(),l=null),o.setState(n.Tunnel.State.CLOSED)}};n.StaticHTTPTunnel.prototype=new n.Tunnel;var n=n||{};n.UTF8Parser=function(){var e=0,t=0;this.decode=function(o){for(var l="",y=new Uint8Array(o),g=0;g<y.length;g++){var v=y[g];e===0?(v|127)===127?l+=String.fromCharCode(v):(v|31)===223?(t=v&31,e=1):(v|15)===239?(t=v&15,e=2):(v|7)===247?(t=v&7,e=3):l+="�":(v|63)===191?(t=t<<6|v&63,e--,e===0&&(l+=String.fromCharCode(t))):(e=0,l+="�")}return l}};var n=n||{};n.API_VERSION="1.5.0";var n=n||{};n.VideoPlayer=function(){this.sync=function(){}};n.VideoPlayer.isSupportedType=function(e){return!1};n.VideoPlayer.getSupportedTypes=function(){return[]};n.VideoPlayer.getInstance=function(e,t,a){return null};const G=n;class j extends G.Tunnel{socket=null;cancelPointerMoves;sendPointer;oninstructionbatch;onauthentication;constructor(e,t,a=()=>!1,o){super();let l=null,y=null,g="0";const v=()=>{y!==null&&cancelAnimationFrame(y),y=null,l=null};this.cancelPointerMoves=v;const c=d=>{this.socket?.readyState!==1||this.state!==G.Tunnel.State.OPEN||this.socket.send(JSON.stringify({type:"instruction",opcode:d[0],args:d.slice(1)}))};this.sendPointer=(d,I,L)=>{v(),g=String(L),c(["mouse",String(d),String(I),g])};const m=()=>{const d=l;v(),d&&c(d)},C=()=>{const d=l;y=null,l=null,d&&(c(d),y=requestAnimationFrame(C))},E=d=>{this.state!==d&&(this.state=d,this.onstatechange?.(d))};this.connect=()=>{E(G.Tunnel.State.CONNECTING);let d=0;const I=new URLSearchParams({host:e.host,protocol:"rdp",port:String(e.port)}),L=this.socket=V(`/api/computer/ws?${I}`);L.onopen=()=>{L.send(JSON.stringify({type:"start",username:e.username,password:e.password,domain:e.domain,ignoreCert:e.ignoreCert,width:e.width,height:e.height,verifyLogin:!0})),e.password=""},L.onmessage=O=>{try{const A=JSON.parse(O.data);if(A.type==="authentication"){if(!["pending","authenticated","unavailable"].includes(A.state))throw new Error("Invalid authentication state");this.onauthentication?.(A.state);return}if(A.type!=="instructions"||A.seq!==d+1||!Array.isArray(A.instructions))throw new Error("Invalid RDP record");d=A.seq;for(const f of A.instructions)if(!Array.isArray(f)||!f.length||f.some(p=>typeof p!="string"))throw new Error("Invalid RDP instruction");const x=()=>{for(const f of A.instructions){const[p,...T]=f;if(p==="ready")this.uuid=T[0],this.onuuid?.(T[0]),E(G.Tunnel.State.OPEN),this.sendMessage("nop");else{const w=p==="mouse"&&a();p==="mouse"&&o?.record("rdp-server-mouse",{x:Number(T[0]),y:Number(T[1]),ignored:w}),w||this.oninstruction?.(p,T)}}},s=A.instructions.filter(f=>f[0]==="sync").length;this.oninstructionbatch&&s>1?this.oninstructionbatch(x,s):x(),L.readyState===1&&L.send(JSON.stringify({type:"ack",seq:A.seq}))}catch{t("COMPUTER_INVALID_MESSAGE"),this.disconnect()}},L.onerror=()=>{},L.onclose=O=>{v(),e.password="",t(O.reason||"COMPUTER_DISCONNECTED"),E(G.Tunnel.State.CLOSED)}},this.disconnect=()=>{v(),e.password="";const d=this.socket;this.socket=null,d&&(d.onclose=null,d.onerror=null,d.onmessage=null,d.onopen=null,d.close()),E(G.Tunnel.State.CLOSED)},this.sendMessage=(...d)=>{if(this.socket?.readyState!==1||this.state!==G.Tunnel.State.OPEN)return;const I=d.map(String);I[0]==="mouse"&&I.length===4&&I[3]===g?y===null?(c(I),y=requestAnimationFrame(C)):l=I:(m(),I[0]==="mouse"&&(g=I[3]),c(I))}}}function Z(u){const e=u.flush;let t=0,a=[],o=0,l=!1;return u.flush=(y,g,v)=>{if(!t){e.call(u,y,g,v);return}if(t--,a.push(y),o+=v||0,t&&a.length<64)return;const c=a,m=o;a=[],o=0,e.call(u,()=>{l||c.forEach(C=>C())},g,m)},{run(y,g){t=g;try{y()}finally{t=0,a=[],o=0}},cancel(){l=!0,t=0,a=[],u.flush=e}}}class le extends EventTarget{constructor(e,t,a,o){super(),this.target=e,this.trace=o,this.requestedSize=`${t.width}x${t.height}`,o?.record("rdp-start",{width:t.width,height:t.height});const l=this.tunnel=new j(t,a,()=>this.localPointer&&!this.readonlyMode,o);l.onauthentication=d=>{this.authenticationPending=d==="pending",this.notifyConnected()},this.client=new G.Client(l),this.display=this.client.getDisplay();const y=this.display.getCursorLayer().getElement();y.style.transition="none",y.style.pointerEvents="none";const g=Z(this.display);this.cancelDisplayBatch=()=>g.cancel(),l.oninstructionbatch=(d,I)=>g.run(d,I),this.container=document.createElement("div"),this.container.className="flex h-full w-full overflow-auto outline-none",this.container.tabIndex=0,this.container.appendChild(this.display.getElement()),e.appendChild(this.container);const v=this.keyboardInput=document.createElement("textarea");v.tabIndex=-1,v.setAttribute("aria-label","Remote desktop keyboard"),v.autocapitalize="off",v.autocomplete="off",v.spellcheck=!1,Object.assign(v.style,{position:"absolute",left:"0",top:"0",width:"1px",height:"1px",fontSize:"16px",opacity:"0",pointerEvents:"none"}),this.container.append(v),v.addEventListener("input",d=>{d.isComposing||(v.value="")},{signal:this.listeners.signal}),v.addEventListener("compositionend",()=>{v.value=""},{signal:this.listeners.signal}),this.keyboard=new G.Keyboard(this.container),this.keyboard.onkeydown=d=>(this.readonlyMode||this.client.sendKeyEvent(1,d),!1),this.keyboard.type=d=>{if(!(this.readonlyMode||this.disposed||!this.connected))for(const I of q(d))this.keyboard.press(I),this.keyboard.release(I)},this.keyboard.onkeyup=d=>{this.readonlyMode||this.client.sendKeyEvent(0,d)};const c=this.display.getElement();c.className="m-auto shrink-0";const m=d=>{this.touchpadPointer||this.readonlyMode||(this.touchpadPointer=!1,this.localPointer=!0,this.client.sendMouseState(d.state,!0))},C=this.mouse=new G.Mouse(c);C.onEach(["mousedown","mousemove","mouseup"],d=>{const I=d.state;o?.record("rdp-native-mouse",{x:I.x,y:I.y,ignored:this.touchpadPointer}),!this.touchpadPointer&&(m(d),this.readonlyMode||this.display.showCursor(!this.nativeCursor))}),C.on("mouseout",()=>{this.touchpadPointer||(this.localPointer=!1,this.display.showCursor(!1))});const E=d=>{o?.record("rdp-pointer-event",{type:d.type,pointerType:d.pointerType,x:d.clientX,y:d.clientY}),d.pointerType==="mouse"&&(this.touchpadPointer=!1)};this.container.addEventListener("pointermove",E,{capture:!0,signal:this.listeners.signal}),this.container.addEventListener("pointerdown",E,{capture:!0,signal:this.listeners.signal}),this.display.oncursor=(d,I,L)=>{o?.record("rdp-cursor-shape",{width:d.width,height:d.height,hotspot:[I,L],actual:[this.display.cursorX,this.display.cursorY]}),this.nativeCursor=C.setCursor(d,I,L),this.localPointer&&!this.readonlyMode&&this.display.showCursor(this.touchpadPointer||!this.nativeCursor)},new G.Mouse.Touchscreen(c).onEach(["mousedown","mousemove","mouseup"],d=>{m(d),this.readonlyMode||this.display.showCursor(!0)}),this.container.addEventListener("pointerdown",d=>{this.phoneKeyboardActive?d.preventDefault():this.keyboardInput.focus({preventScroll:!0})},{signal:this.listeners.signal}),this.container.addEventListener("blur",()=>this.keyboard.reset(),{capture:!0,signal:this.listeners.signal}),window.addEventListener("blur",()=>{this.keyboard.reset(),C.reset()},{signal:this.listeners.signal}),this.observer=new ResizeObserver(()=>{this.scale(),this.scheduleResize()}),this.observer.observe(e),this.display.onresize=()=>{this.scale(),this.notifyConnected()},this.client.onstatechange=d=>{this.disposed||(d===G.Client.State.CONNECTED&&(this.connected=!0,this.notifyConnected(),this.scheduleResize()),d===G.Client.State.DISCONNECTED&&a("COMPUTER_DISCONNECTED"))},this.client.onclipboard=(d,I)=>{const L=++this.clipboardGeneration;if(!/^text\/plain(?:;|$)/i.test(I)){d.sendAck("Only plain text clipboard is supported",256);return}const O=new G.ArrayBufferReader(d),A=new TextDecoder("utf-8",{fatal:!0});let x="",s=!1,f=0;const p=()=>{s||(s=!0,x="",d.sendAck("Invalid or oversized text clipboard",768),this.dispatchEvent(new Event("clipboarderror")))};O.ondata=T=>{if(!(s||this.disposed||L!==this.clipboardGeneration)){f+=T.byteLength;try{if(f>Y*4){p();return}x+=A.decode(T,{stream:!0}),x.length>Y&&p()}catch{p()}}},O.onend=()=>{if(!(s||this.disposed||L!==this.clipboardGeneration)){try{x+=A.decode()}catch{p();return}if(x.length>Y){p();return}this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:x}}))}}},this.client.onname=d=>this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:d}})),this.client.onerror=d=>{const I=/certificate/i.test(d.message||"")?"COMPUTER_RDP_CERTIFICATE":[769,771].includes(d.code)?"COMPUTER_AUTH_FAILED":d.code===514?"COMPUTER_CONNECT_TIMEOUT":"COMPUTER_RDP_FAILED";a(I)},this.client.connect()}target;trace;client;tunnel;keyboard;mouse;keyboardInput;display;container;observer;listeners=new AbortController;readonlyMode=!1;fit=!0;zoom=1;resizePaused=!1;disposed=!1;connected=!1;authenticationPending=!1;connectionNotified=!1;phoneKeyboardActive=!1;viewportScale=1;keyboardScale=null;resizeTimer;requestedSize;clipboardGeneration=0;localPointer=!1;nativeCursor=!1;touchpadPointer=!1;cancelDisplayBatch;notifyConnected(){!this.connected||!this.display.getWidth()||!this.display.getHeight()||this.authenticationPending||this.connectionNotified||this.disposed||(this.connectionNotified=!0,this.dispatchEvent(new Event("connect")),this.scheduleResize())}scale(){const e=this.display.getWidth(),t=this.display.getHeight();!this.target.clientWidth||!this.target.clientHeight||(this.viewportScale=this.fit&&e&&t?Math.min(this.target.clientWidth/e,this.keyboardScale??this.target.clientHeight/t):1,this.display.scale(this.viewportScale*this.zoom),this.trace?.record("rdp-scale",{desktop:[e,t],viewport:[this.target.clientWidth,this.target.clientHeight],scale:this.viewportScale,zoom:this.zoom}))}scheduleResize(){clearTimeout(this.resizeTimer),!(!this.connected||!this.connectionNotified||this.disposed||!this.fit||this.resizePaused)&&(this.resizeTimer=setTimeout(()=>{const e=this.target.clientWidth,t=this.target.clientHeight;if(!e||!t||!this.connectionNotified||this.disposed||!this.fit||this.resizePaused)return;const{width:a,height:o}=J(e,t),l=`${a}x${o}`;l!==this.requestedSize&&(this.requestedSize=l,this.client.sendSize(a,o))},150))}set scaleViewport(e){this.fit=e,this.scale(),this.scheduleResize()}set viewportZoom(e){this.zoom=e,this.scale()}get viewportZoom(){return this.zoom}get viewportScroller(){return this.container}set pauseResize(e){this.resizePaused=e,this.scheduleResize()}set keyboardActive(e){e!==this.phoneKeyboardActive&&(this.keyboardScale=e?this.viewportScale:null,this.phoneKeyboardActive=e,this.keyboard.reset(),this.scale())}get pointerTarget(){return{position:()=>({x:this.display.cursorX,y:this.display.cursorY}),observeCursor:()=>{const e=this.display.getCursorLayer().getElement();return{transform:e.style.transform,connected:e.isConnected,scale:this.viewportScale*this.zoom,hotspot:[this.display.cursorHotspotX,this.display.cursorHotspotY]}},size:()=>({width:this.display.getWidth(),height:this.display.getHeight()}),surface:()=>this.display.getElement(),send:(e,t,a)=>{this.readonlyMode||this.disposed||!this.connected||(this.localPointer=!0,this.touchpadPointer=!0,this.display.moveCursor(e,t),this.display.showCursor(!0),this.tunnel.sendPointer(e,t,a))}}}set viewOnly(e){this.tunnel.cancelPointerMoves(),this.keyboard.reset(),this.mouse.reset(),this.readonlyMode=e,this.localPointer=!1,e&&this.display.showCursor(!1)}focus(e={preventScroll:!0}){!this.phoneKeyboardActive&&!this.readonlyMode&&!this.disposed&&this.keyboardInput.focus(e)}sendKey(e,t,a=!0){!this.readonlyMode&&!this.disposed&&this.client.sendKeyEvent(a?1:0,e)}clipboardPasteFrom(e){if(this.readonlyMode||this.disposed)return;if(e.length>Y)throw new RangeError("Clipboard is too large");const t=new G.ArrayBufferWriter(this.client.createClipboardStream("text/plain"));t.onack=a=>{a.isError()&&!this.disposed&&this.dispatchEvent(new Event("clipboarderror"))},t.sendData(new TextEncoder().encode(e)),t.sendEnd()}disconnect(){this.disposed||(this.disposed=!0,this.tunnel.cancelPointerMoves(),this.keyboard.reset(),this.mouse.reset(),this.listeners.abort(),this.observer.disconnect(),this.cancelDisplayBatch(),this.display.cancel?.(),clearTimeout(this.resizeTimer),this.trace?.record("rdp-disconnect"),this.trace?.flush("rdp-disconnect"),this.client.disconnect(),this.container.remove())}}export{le as RdpSession};
1
+ import{cz as V}from"./app-D2M53LZx.js";import{b as q,C as Y,c as J}from"./ComputerControlView-DGoBNNRA.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./ChangeWalkthroughPanel-DG4TnQvn.js";import"./sparkles-iFcvD4yM.js";import"./triangle-alert-BeIpvW9N.js";import"./App-DhHRFEY2.js";import"./gestureArbiter-DPFs4a-w.js";import"./referenceLongPress-l-iC26Y4.js";var n=n||{};n.ArrayBufferReader=function(u){var e=this;u.onblob=function(t){for(var a=window.atob(t),o=new ArrayBuffer(a.length),l=new Uint8Array(o),y=0;y<a.length;y++)l[y]=a.charCodeAt(y);e.ondata&&e.ondata(o)},u.onend=function(){e.onend&&e.onend()},this.ondata=null,this.onend=null};var n=n||{};n.ArrayBufferWriter=function(u){var e=this;u.onack=function(a){e.onack&&e.onack(a)};function t(a){for(var o="",l=0;l<a.byteLength;l++)o+=String.fromCharCode(a[l]);u.sendBlob(window.btoa(o))}this.blobLength=n.ArrayBufferWriter.DEFAULT_BLOB_LENGTH,this.sendData=function(a){var o=new Uint8Array(a);if(o.length<=e.blobLength)t(o);else for(var l=0;l<o.length;l+=e.blobLength)t(o.subarray(l,l+e.blobLength))},this.sendEnd=function(){u.sendEnd()},this.onack=null};n.ArrayBufferWriter.DEFAULT_BLOB_LENGTH=6048;var n=n||{};n.AudioContextFactory={singleton:null,getAudioContext:function(){var e=window.AudioContext||window.webkitAudioContext;if(e)try{return n.AudioContextFactory.singleton||(n.AudioContextFactory.singleton=new e),n.AudioContextFactory.singleton}catch{}return null}};var n=n||{};n.AudioPlayer=function(){this.sync=function(){}};n.AudioPlayer.isSupportedType=function(e){return n.RawAudioPlayer.isSupportedType(e)};n.AudioPlayer.getSupportedTypes=function(){return n.RawAudioPlayer.getSupportedTypes()};n.AudioPlayer.getInstance=function(e,t){return n.RawAudioPlayer.isSupportedType(t)?new n.RawAudioPlayer(e,t):null};n.RawAudioPlayer=function(e,t){var a=n.RawAudioFormat.parse(t),o=n.AudioContextFactory.getAudioContext(),l=o.currentTime,y=new n.ArrayBufferReader(e),g=.02,v=.3,c=a.bytesPerSample===1?window.Int8Array:window.Int16Array,m=a.bytesPerSample===1?128:32768,C=[],E=function(x){if(x.length<=1)return x[0];var s=0;x.forEach(function(w){s+=w.length});var f=0,p=new c(s);return x.forEach(function(w){p.set(w,f),f+=w.length}),p},d=function(x){for(var s=Number.MAX_VALUE,f=x.length,p=Math.floor(x.length/a.channels),T=Math.floor(a.rate*g),w=Math.max(a.channels*T,a.channels*(p-T)),P=w;P<x.length;P+=a.channels){for(var k=0,D=0;D<a.channels;D++)k+=Math.abs(x[P+D]);k<=s&&(f=P+a.channels,s=k)}return f===x.length?[x]:[new c(x.buffer.slice(0,f*a.bytesPerSample)),new c(x.buffer.slice(f*a.bytesPerSample))]},I=function(x){C.push(new c(x))},L=function(){var x=E(C);return x?(C=d(x),x=C.shift(),x):null},O=function(x){var s=x.length/a.channels,f=o.currentTime;l<f&&(l=f);for(var p=o.createBuffer(a.channels,s,a.rate),T=0;T<a.channels;T++)for(var w=p.getChannelData(T),P=T,k=0;k<s;k++)w[k]=x[P]/m,P+=a.channels;return p};y.ondata=function(x){I(new c(x));var s=L();if(s){var f=o.currentTime;l<f&&(l=f);var p=o.createBufferSource();p.connect(o.destination),p.start||(p.start=p.noteOn),p.buffer=O(s),p.start(l),l+=s.length/a.channels/a.rate}},this.sync=function(){var x=o.currentTime;l=Math.min(l,x+v)}};n.RawAudioPlayer.prototype=new n.AudioPlayer;n.RawAudioPlayer.isSupportedType=function(e){return n.AudioContextFactory.getAudioContext()?n.RawAudioFormat.parse(e)!==null:!1};n.RawAudioPlayer.getSupportedTypes=function(){return n.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]};var n=n||{};n.AudioRecorder=function(){this.onclose=null,this.onerror=null};n.AudioRecorder.isSupportedType=function(e){return n.RawAudioRecorder.isSupportedType(e)};n.AudioRecorder.getSupportedTypes=function(){return n.RawAudioRecorder.getSupportedTypes()};n.AudioRecorder.getInstance=function(e,t){return n.RawAudioRecorder.isSupportedType(t)?new n.RawAudioRecorder(e,t):null};n.RawAudioRecorder=function(e,t){var a=this,o=2048,l=3,y=n.RawAudioFormat.parse(t),g=n.AudioContextFactory.getAudioContext();navigator.mediaDevices||(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia||(navigator.mediaDevices.getUserMedia=(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia).bind(navigator));var v=new n.ArrayBufferWriter(e),c=y.bytesPerSample===1?window.Int8Array:window.Int16Array,m=y.bytesPerSample===1?128:32768,C=0,E=0,d=null,I=null,L=null,O=function(k){if(k===0)return 1;var D=Math.PI*k;return Math.sin(D)/D},A=function(k,D){return-D<k&&k<D?O(k)*O(k/D):0},x=function(k,D){for(var r=(k.length-1)*D,i=Math.floor(r)-l+1,h=Math.floor(r)+l,S=0,M=i;M<=h;M++)S+=(k[M]||0)*A(r-M,l);return S},s=function(k){var D=k.length;C+=D;var r=Math.round(C*y.rate/k.sampleRate),i=r-E;E+=i;for(var h=new c(i*y.channels),S=0;S<y.channels;S++)for(var M=k.getChannelData(S),_=S,R=0;R<i;R++)h[_]=x(M,R/(i-1))*m,_+=y.channels;return h},f=function(k){L=g.createScriptProcessor(o,y.channels,y.channels),L.connect(g.destination),L.onaudioprocess=function(r){v.sendData(s(r.inputBuffer).buffer)},I=g.createMediaStreamSource(k),I.connect(L),g.state==="suspended"&&g.resume(),d=k},p=function(){v.sendEnd(),a.onerror&&a.onerror()},T=function(){var k=navigator.mediaDevices.getUserMedia({audio:!0},f,p);k&&k.then&&k.then(f,p)},w=function(){if(I&&I.disconnect(),L&&L.disconnect(),d)for(var k=d.getTracks(),D=0;D<k.length;D++)k[D].stop();L=null,I=null,d=null,v.sendEnd()};v.onack=function(k){k.code===n.Status.Code.SUCCESS&&!d?T():(w(),v.onack=null,k.code===n.Status.Code.RESOURCE_CLOSED?a.onclose&&a.onclose():a.onerror&&a.onerror())}};n.RawAudioRecorder.prototype=new n.AudioRecorder;n.RawAudioRecorder.isSupportedType=function(e){return n.AudioContextFactory.getAudioContext()?n.RawAudioFormat.parse(e)!==null:!1};n.RawAudioRecorder.getSupportedTypes=function(){return n.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]};var n=n||{};n.BlobReader=function(u,e){var t=this,a=0,o;window.BlobBuilder?o=new BlobBuilder:window.WebKitBlobBuilder?o=new WebKitBlobBuilder:window.MozBlobBuilder?o=new MozBlobBuilder:o=new(function(){var l=[];this.append=function(y){l.push(new Blob([y],{type:e}))},this.getBlob=function(){return new Blob(l,{type:e})}}),u.onblob=function(l){for(var y=window.atob(l),g=new ArrayBuffer(y.length),v=new Uint8Array(g),c=0;c<y.length;c++)v[c]=y.charCodeAt(c);o.append(g),a+=g.byteLength,t.onprogress&&t.onprogress(g.byteLength),u.sendAck("OK",0)},u.onend=function(){t.onend&&t.onend()},this.getLength=function(){return a},this.getBlob=function(){return o.getBlob()},this.onprogress=null,this.onend=null};var n=n||{};n.BlobWriter=function(e){var t=this,a=new n.ArrayBufferWriter(e);a.onack=function(l){t.onack&&t.onack(l)};var o=function(y,g,v){var c=(y.slice||y.webkitSlice||y.mozSlice).bind(y),m=v-g;if(m!==v){var C=c(g,m);if(C.size===m)return C}return c(g,v)};this.sendBlob=function(y){var g=0,v=new FileReader,c=function(){if(g>=y.size){t.oncomplete&&t.oncomplete(y);return}var C=o(y,g,g+a.blobLength);g+=a.blobLength,v.readAsArrayBuffer(C)};v.onload=function(){a.sendData(v.result),a.onack=function(E){t.onack&&t.onack(E),!E.isError()&&(t.onprogress&&t.onprogress(y,g-a.blobLength),c())}},v.onerror=function(){t.onerror&&t.onerror(y,g,v.error)},c()},this.sendEnd=function(){a.sendEnd()},this.onack=null,this.onerror=null,this.onprogress=null,this.oncomplete=null};var n=n||{};n.Client=function(u){var e=this,t=n.Client.State.IDLE,a=0,o=5e3,l=null,y=0,g={0:"butt",1:"round",2:"square"},v={0:"bevel",1:"miter",2:"round"},c=new n.Display,m={},C={},E=[],d=[],I=[],L=new n.IntegerPool,O=[];function A(r){r!=t&&(t=r,e.onstatechange&&e.onstatechange(t))}function x(){return t==n.Client.State.CONNECTED||t==n.Client.State.WAITING}this.exportState=function(i){var h={currentState:t,currentTimestamp:a,layers:{}},S={};for(var M in m)S[M]=m[M];c.flush(function(){for(var R in S){var b=parseInt(R),F=S[R],N=F.toCanvas(),B={width:F.width,height:F.height};F.width&&F.height&&(B.url=N.toDataURL("image/png")),b>0&&(B.x=F.x,B.y=F.y,B.z=F.z,B.alpha=F.alpha,B.matrix=F.matrix,B.parent=f(F.parent)),h.layers[R]=B}i(h)})},this.importState=function(i,h){var S,M;t=i.currentState,a=i.currentTimestamp,c.cancel();for(S in m)M=parseInt(S),M>0&&m[S].dispose();m={};for(S in i.layers){M=parseInt(S);var _=i.layers[S],R=s(M);if(c.resize(R,_.width,_.height),_.url&&(c.setChannelMask(R,n.Layer.SRC),c.draw(R,0,0,_.url)),M>0&&_.parent>=0){var b=s(_.parent);c.move(R,b,_.x,_.y,_.z),c.shade(R,_.alpha);var F=_.matrix;c.distort(R,F[0],F[1],F[2],F[3],F[4],F[5])}}c.flush(h)},this.getDisplay=function(){return c},this.sendSize=function(r,i){x()&&u.sendMessage("size",r,i)},this.sendKeyEvent=function(r,i){x()&&u.sendMessage("key",i,r)},this.sendMouseState=function(i,h){if(x()){var S=i.x,M=i.y;h&&(S/=c.getScale(),M/=c.getScale()),c.moveCursor(Math.floor(S),Math.floor(M));var _=0;i.left&&(_|=1),i.middle&&(_|=2),i.right&&(_|=4),i.up&&(_|=8),i.down&&(_|=16),u.sendMessage("mouse",Math.floor(S),Math.floor(M),_)}},this.sendTouchState=function(i,h){if(x()){var S=i.x,M=i.y;h&&(S/=c.getScale(),M/=c.getScale()),u.sendMessage("touch",i.id,Math.floor(S),Math.floor(M),Math.floor(i.radiusX),Math.floor(i.radiusY),i.angle,i.force)}},this.createOutputStream=function(){var i=L.next(),h=O[i]=new n.OutputStream(e,i);return h},this.createAudioStream=function(r){var i=e.createOutputStream();return u.sendMessage("audio",i.index,r),i},this.createFileStream=function(r,i){var h=e.createOutputStream();return u.sendMessage("file",h.index,r,i),h},this.createPipeStream=function(r,i){var h=e.createOutputStream();return u.sendMessage("pipe",h.index,r,i),h},this.createClipboardStream=function(r){var i=e.createOutputStream();return u.sendMessage("clipboard",i.index,r),i},this.createArgumentValueStream=function(i,h){var S=e.createOutputStream();return u.sendMessage("argv",S.index,i,h),S},this.createObjectOutputStream=function(i,h,S){var M=e.createOutputStream();return u.sendMessage("put",i,M.index,h,S),M},this.requestObjectInputStream=function(i,h){x()&&u.sendMessage("get",i,h)},this.sendAck=function(r,i,h){x()&&u.sendMessage("ack",r,i,h)},this.sendBlob=function(r,i){x()&&u.sendMessage("blob",r,i)},this.endStream=function(r){x()&&(u.sendMessage("end",r),O[r]&&(L.free(r),delete O[r]))},this.onstatechange=null,this.onname=null,this.onerror=null,this.onmsg=null,this.onjoin=null,this.onleave=null,this.onaudio=null,this.onvideo=null,this.onmultitouch=null,this.onargv=null,this.onclipboard=null,this.onfile=null,this.onfilesystem=null,this.onpipe=null,this.onrequired=null,this.onsync=null;var s=function(i){var h=m[i];return h||(i===0?h=c.getDefaultLayer():i>0?h=c.createLayer():h=c.createBuffer(),m[i]=h),h},f=function(i){if(!i)return null;for(var h in m)if(i===m[h])return parseInt(h);return null};function p(r){var i=E[r];return i==null&&(i=E[r]=new n.Parser,i.oninstruction=u.oninstruction),i}var T={"miter-limit":function(r,i){c.setMiterLimit(r,parseFloat(i))},"multi-touch":function(i,h){e.onmultitouch&&i instanceof n.Display.VisibleLayer&&e.onmultitouch(i,parseInt(h))}},w={ack:function(r){var i=parseInt(r[0]),h=r[1],S=parseInt(r[2]),M=O[i];M&&(M.onack&&M.onack(new n.Status(S,h)),S>=256&&O[i]===M&&(L.free(i),delete O[i]))},arc:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseFloat(r[4]),R=parseFloat(r[5]),b=parseInt(r[6]);c.arc(i,h,S,M,_,R,b!=0)},argv:function(r){var i=parseInt(r[0]),h=r[1],S=r[2];if(e.onargv){var M=d[i]=new n.InputStream(e,i);e.onargv(M,h,S)}else e.sendAck(i,"Receiving argument values unsupported",256)},audio:function(r){var i=parseInt(r[0]),h=r[1],S=d[i]=new n.InputStream(e,i),M=null;e.onaudio&&(M=e.onaudio(S,h)),M||(M=n.AudioPlayer.getInstance(S,h)),M?(C[i]=M,e.sendAck(i,"OK",0)):e.sendAck(i,"BAD TYPE",783)},blob:function(r){var i=parseInt(r[0]),h=r[1],S=d[i];S&&S.onblob&&S.onblob(h)},body:function(i){var h=parseInt(i[0]),S=I[h],M=parseInt(i[1]),_=i[2],R=i[3];if(S&&S.onbody){var b=d[M]=new n.InputStream(e,M);S.onbody(b,_,R)}else e.sendAck(M,"Receipt of body unsupported",256)},cfill:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]);c.setChannelMask(h,i),c.fillColor(h,S,M,_,R)},clip:function(r){var i=s(parseInt(r[0]));c.clip(i)},clipboard:function(r){var i=parseInt(r[0]),h=r[1];if(e.onclipboard){var S=d[i]=new n.InputStream(e,i);e.onclipboard(S,h)}else e.sendAck(i,"Clipboard unsupported",256)},close:function(r){var i=s(parseInt(r[0]));c.close(i)},copy:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=s(parseInt(r[6])),F=parseInt(r[7]),N=parseInt(r[8]);c.setChannelMask(b,R),c.copy(i,h,S,M,_,b,F,N)},cstroke:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=g[parseInt(r[2])],M=v[parseInt(r[3])],_=parseInt(r[4]),R=parseInt(r[5]),b=parseInt(r[6]),F=parseInt(r[7]),N=parseInt(r[8]);c.setChannelMask(h,i),c.strokeColor(h,S,M,_,R,b,F,N)},cursor:function(r){var i=parseInt(r[0]),h=parseInt(r[1]),S=s(parseInt(r[2])),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=parseInt(r[6]);c.setCursor(i,h,S,M,_,R,b)},curve:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=parseInt(r[6]);c.curveTo(i,h,S,M,_,R,b)},disconnect:function(i){e.disconnect()},dispose:function(r){var i=parseInt(r[0]);if(i>0){var h=s(i);c.dispose(h),delete m[i]}else i<0&&delete m[i]},distort:function(r){var i=parseInt(r[0]),h=parseFloat(r[1]),S=parseFloat(r[2]),M=parseFloat(r[3]),_=parseFloat(r[4]),R=parseFloat(r[5]),b=parseFloat(r[6]);if(i>=0){var F=s(i);c.distort(F,h,S,M,_,R,b)}},error:function(r){var i=r[0],h=parseInt(r[1]);e.onerror&&e.onerror(new n.Status(h,i)),e.disconnect()},end:function(r){var i=parseInt(r[0]),h=d[i];h&&(h.onend&&h.onend(),delete d[i])},file:function(r){var i=parseInt(r[0]),h=r[1],S=r[2];if(e.onfile){var M=d[i]=new n.InputStream(e,i);e.onfile(M,h,S)}else e.sendAck(i,"File transfer unsupported",256)},filesystem:function(i){var h=parseInt(i[0]),S=i[1];if(e.onfilesystem){var M=I[h]=new n.Object(e,h);e.onfilesystem(M,S)}},identity:function(r){var i=s(parseInt(r[0]));c.setTransform(i,1,0,0,1,0,0)},img:function(r){var i=parseInt(r[0]),h=parseInt(r[1]),S=s(parseInt(r[2])),M=r[3],_=parseInt(r[4]),R=parseInt(r[5]),b=d[i]=new n.InputStream(e,i);c.setChannelMask(S,h),c.drawStream(S,_,R,b,M)},jpeg:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=parseInt(r[2]),M=parseInt(r[3]),_=r[4];c.setChannelMask(h,i),c.draw(h,S,M,"data:image/jpeg;base64,"+_)},lfill:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=s(parseInt(r[2]));c.setChannelMask(h,i),c.fillLayer(h,S)},line:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]);c.lineTo(i,h,S)},lstroke:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=s(parseInt(r[2]));c.setChannelMask(h,i),c.strokeLayer(h,S)},mouse:function(i){var h=parseInt(i[0]),S=parseInt(i[1]);c.showCursor(!0),c.moveCursor(h,S)},move:function(r){var i=parseInt(r[0]),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]);if(i>0&&h>=0){var R=s(i),b=s(h);c.move(R,b,S,M,_)}},msg:function(r){var i,h,S=!0,M=parseInt(r[0]);if(e.onmsg&&(S=e.onmsg(M,r.slice(1)),S===void 0&&(S=!0)),S)switch(M){case n.Client.Message.USER_JOINED:i=r[1],h=r[2],e.onjoin&&e.onjoin(i,h);break;case n.Client.Message.USER_LEFT:i=r[1],h=r[2],e.onleave&&e.onleave(i,h);break}},name:function(r){e.onname&&e.onname(r[0])},nest:function(r){var i=p(parseInt(r[0]));i.receive(r[1])},pipe:function(r){var i=parseInt(r[0]),h=r[1],S=r[2];if(e.onpipe){var M=d[i]=new n.InputStream(e,i);e.onpipe(M,h,S)}else e.sendAck(i,"Named pipes unsupported",256)},png:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=parseInt(r[2]),M=parseInt(r[3]),_=r[4];c.setChannelMask(h,i),c.draw(h,S,M,"data:image/png;base64,"+_)},pop:function(r){var i=s(parseInt(r[0]));c.pop(i)},push:function(r){var i=s(parseInt(r[0]));c.push(i)},rect:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]);c.rect(i,h,S,M,_)},required:function(i){e.onrequired&&e.onrequired(i)},reset:function(r){var i=s(parseInt(r[0]));c.reset(i)},set:function(r){var i=s(parseInt(r[0])),h=r[1],S=r[2],M=T[h];M&&M(i,S)},shade:function(r){var i=parseInt(r[0]),h=parseInt(r[1]);if(i>=0){var S=s(i);c.shade(S,h)}},size:function(r){var i=parseInt(r[0]),h=s(i),S=parseInt(r[1]),M=parseInt(r[2]);c.resize(h,S,M)},start:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]);c.moveTo(i,h,S)},sync:function(r){var i=parseInt(r[0]),h=r[1]?parseInt(r[1]):0;c.flush(function(){for(var M in C){var _=C[M];_&&_.sync()}i!==a&&(u.sendMessage("sync",i),a=i)},i,h),t===n.Client.State.WAITING&&A(n.Client.State.CONNECTED),e.onsync&&e.onsync(i,h)},transfer:function(r){var i=s(parseInt(r[0])),h=parseInt(r[1]),S=parseInt(r[2]),M=parseInt(r[3]),_=parseInt(r[4]),R=parseInt(r[5]),b=s(parseInt(r[6])),F=parseInt(r[7]),N=parseInt(r[8]);R===3?c.put(i,h,S,M,_,b,F,N):R!==5&&c.transfer(i,h,S,M,_,b,F,N,n.Client.DefaultTransferFunction[R])},transform:function(r){var i=s(parseInt(r[0])),h=parseFloat(r[1]),S=parseFloat(r[2]),M=parseFloat(r[3]),_=parseFloat(r[4]),R=parseFloat(r[5]),b=parseFloat(r[6]);c.transform(i,h,S,M,_,R,b)},undefine:function(i){var h=parseInt(i[0]),S=I[h];S&&S.onundefine&&S.onundefine()},video:function(r){var i=parseInt(r[0]),h=s(parseInt(r[1])),S=r[2],M=d[i]=new n.InputStream(e,i),_=null;e.onvideo&&(_=e.onvideo(M,h,S)),_||(_=n.VideoPlayer.getInstance(M,h,S)),_?e.sendAck(i,"OK",0):e.sendAck(i,"BAD TYPE",783)}},P=function(){u.sendMessage("nop"),y=new Date().getTime()},k=function(){window.clearTimeout(l);var i=new Date().getTime(),h=Math.max(y+o-i,0);h>0?l=window.setTimeout(P,h):P()},D=function(){window.clearTimeout(l)};u.oninstruction=function(r,i){var h=w[r];h&&h(i),k()},this.disconnect=function(){t!=n.Client.State.DISCONNECTED&&t!=n.Client.State.DISCONNECTING&&(A(n.Client.State.DISCONNECTING),D(),u.sendMessage("disconnect"),u.disconnect(),A(n.Client.State.DISCONNECTED))},this.connect=function(r){A(n.Client.State.CONNECTING);try{u.connect(r)}catch(i){throw A(n.Client.State.IDLE),i}k(),A(n.Client.State.WAITING)}};n.Client.State={IDLE:0,CONNECTING:1,WAITING:2,CONNECTED:3,DISCONNECTING:4,DISCONNECTED:5};n.Client.DefaultTransferFunction={0:function(u,e){e.red=e.green=e.blue=0},15:function(u,e){e.red=e.green=e.blue=255},3:function(u,e){e.red=u.red,e.green=u.green,e.blue=u.blue,e.alpha=u.alpha},5:function(u,e){},12:function(u,e){e.red=255&~u.red,e.green=255&~u.green,e.blue=255&~u.blue,e.alpha=u.alpha},10:function(u,e){e.red=255&~e.red,e.green=255&~e.green,e.blue=255&~e.blue},1:function(u,e){e.red=u.red&e.red,e.green=u.green&e.green,e.blue=u.blue&e.blue},14:function(u,e){e.red=255&~(u.red&e.red),e.green=255&~(u.green&e.green),e.blue=255&~(u.blue&e.blue)},7:function(u,e){e.red=u.red|e.red,e.green=u.green|e.green,e.blue=u.blue|e.blue},8:function(u,e){e.red=255&~(u.red|e.red),e.green=255&~(u.green|e.green),e.blue=255&~(u.blue|e.blue)},6:function(u,e){e.red=u.red^e.red,e.green=u.green^e.green,e.blue=u.blue^e.blue},9:function(u,e){e.red=255&~(u.red^e.red),e.green=255&~(u.green^e.green),e.blue=255&~(u.blue^e.blue)},4:function(u,e){e.red=255&(~u.red&e.red),e.green=255&(~u.green&e.green),e.blue=255&(~u.blue&e.blue)},13:function(u,e){e.red=255&(~u.red|e.red),e.green=255&(~u.green|e.green),e.blue=255&(~u.blue|e.blue)},2:function(u,e){e.red=255&(u.red&~e.red),e.green=255&(u.green&~e.green),e.blue=255&(u.blue&~e.blue)},11:function(u,e){e.red=255&(u.red|~e.red),e.green=255&(u.green|~e.green),e.blue=255&(u.blue|~e.blue)}};n.Client.Message={USER_JOINED:1,USER_LEFT:2};var n=n||{};n.DataURIReader=function(u,e){var t=this,a="data:"+e+";base64,";u.onblob=function(l){a+=l},u.onend=function(){t.onend&&t.onend()},this.getURI=function(){return a},this.onend=null};var n=n||{};n.Display=function(){var u=this,e=0,t=0,a=1,o=document.createElement("div");o.style.position="relative",o.style.width=e+"px",o.style.height=t+"px",o.style.transformOrigin=o.style.webkitTransformOrigin=o.style.MozTransformOrigin=o.style.OTransformOrigin=o.style.msTransformOrigin="0 0";var l=new n.Display.VisibleLayer(e,t),y=new n.Display.VisibleLayer(0,0);y.setChannelMask(n.Layer.SRC),o.appendChild(l.getElement()),o.appendChild(y.getElement());var g=document.createElement("div");g.style.position="relative",g.style.width=e*a+"px",g.style.height=t*a+"px",g.appendChild(o),this.cursorHotspotX=0,this.cursorHotspotY=0,this.cursorX=0,this.cursorY=0,this.statisticWindow=0,this.onresize=null,this.oncursor=null,this.onstatistics=null;var v=[],c=[],m=null,C=function(){for(var f=0,p=0,T=0,w=0;w<c.length;){var P=c[w];if(!P.isReady())break;P.flush(),f=P.localTimestamp,p=P.remoteTimestamp,T+=P.logicalFrames,w++}c.splice(0,w),w&&I(f,p,T)},E=function(){var f=function p(){if(m=null,!!c.length){if(c[0].isReady()){var T=c.shift();T.flush(),I(T.localTimestamp,T.remoteTimestamp,T.logicalFrames)}c.length&&(m=window.requestAnimationFrame(p))}};m||(m=window.requestAnimationFrame(f))},d=[],I=function(f,p,T){if(u.statisticWindow){for(var w=new Date().getTime(),P=0;P<d.length&&!(w-d[P].timestamp<=u.statisticWindow);P++);d.splice(0,P-1),d.push({localTimestamp:f,remoteTimestamp:p,timestamp:w,frames:T});var k=(d[d.length-1].timestamp-d[0].timestamp)/1e3,D=(d[d.length-1].remoteTimestamp-d[0].remoteTimestamp)/1e3,r=d.length,i=d.reduce(function(_,R){return _+R.frames},0),h=d.reduce(function(_,R){return _+Math.max(0,R.frames-1)},0),S=new n.Display.Statistics({processingLag:w-f,desktopFps:D&&i?i/D:null,clientFps:k?r/k:null,serverFps:D?r/D:null,dropRate:D?h/D:null});u.onstatistics&&u.onstatistics(S)}};window.addEventListener("blur",function(){m&&!document.hasFocus()&&(window.cancelAnimationFrame(m),m=null,C())},!0);function L(){window.requestAnimationFrame&&document.hasFocus()?E():C()}var O=function(f,p,T,w){this.localTimestamp=new Date().getTime(),this.remoteTimestamp=T||this.localTimestamp,this.logicalFrames=w||0,this.cancel=function(){f=null,p.forEach(function(D){D.cancel()}),p=[]},this.isReady=function(){for(var P=0;P<p.length;P++)if(p[P].blocked)return!1;return!0},this.flush=function(){for(var P=0;P<p.length;P++)p[P].execute();f&&f()}};function A(s,f){var p=this;this.blocked=f,this.cancel=function(){p.blocked=!1,s=null},this.unblock=function(){p.blocked&&(p.blocked=!1,L())},this.execute=function(){s&&s()}}function x(s,f){var p=new A(s,f);return v.push(p),p}this.getElement=function(){return g},this.getWidth=function(){return e},this.getHeight=function(){return t},this.getDefaultLayer=function(){return l},this.getCursorLayer=function(){return y},this.createLayer=function(){var s=new n.Display.VisibleLayer(e,t);return s.move(l,0,0,0),s},this.createBuffer=function(){var s=new n.Layer(0,0);return s.autosize=1,s},this.flush=function(s,f,p){c.push(new O(s,v,f,p)),v=[],L()},this.cancel=function(){c.forEach(function(p){p.cancel()}),c=[],v.forEach(function(p){p.cancel()}),v=[]},this.setCursor=function(s,f,p,T,w,P,k){x(function(){u.cursorHotspotX=s,u.cursorHotspotY=f,y.resize(P,k),y.copy(p,T,w,P,k,0,0),u.moveCursor(u.cursorX,u.cursorY),u.oncursor&&u.oncursor(y.toCanvas(),s,f)})},this.showCursor=function(s){var f=y.getElement(),p=f.parentNode;s===!1?p&&p.removeChild(f):p!==o&&o.appendChild(f)},this.moveCursor=function(s,f){y.translate(s-u.cursorHotspotX,f-u.cursorHotspotY),u.cursorX=s,u.cursorY=f},this.resize=function(s,f,p){x(function(){s.resize(f,p),s===l&&(e=f,t=p,o.style.width=e+"px",o.style.height=t+"px",g.style.width=e*a+"px",g.style.height=t*a+"px",u.onresize&&u.onresize(f,p))})},this.drawImage=function(s,f,p,T){x(function(){s.drawImage(f,p,T)})},this.drawBlob=function(s,f,p,T){var w;if(window.createImageBitmap){var P;w=x(function(){s.drawImage(f,p,P)},!0),window.createImageBitmap(T).then(function(i){P=i,w.unblock()})}else{var k=URL.createObjectURL(T);w=x(function(){D.width&&D.height&&s.drawImage(f,p,D),URL.revokeObjectURL(k)},!0);var D=new Image;D.onload=w.unblock,D.onerror=w.unblock,D.src=k}},this.drawStream=function(f,p,T,w,P){if(window.createImageBitmap){var k=new n.BlobReader(w,P);k.onend=function(){u.drawBlob(f,p,T,k.getBlob())}}else{var k=new n.DataURIReader(w,P);k.onend=function(){u.draw(f,p,T,k.getURI())}}},this.draw=function(s,f,p,T){var w=x(function(){P.width&&P.height&&s.drawImage(f,p,P)},!0),P=new Image;P.onload=w.unblock,P.onerror=w.unblock,P.src=T},this.play=function(s,f,p,T){var w=document.createElement("video");w.type=f,w.src=T,w.addEventListener("play",function(){function P(){s.drawImage(0,0,w),w.ended||window.setTimeout(P,20)}P()},!1),x(w.play)},this.transfer=function(s,f,p,T,w,P,k,D,r){x(function(){P.transfer(s,f,p,T,w,k,D,r)})},this.put=function(s,f,p,T,w,P,k,D){x(function(){P.put(s,f,p,T,w,k,D)})},this.copy=function(s,f,p,T,w,P,k,D){x(function(){P.copy(s,f,p,T,w,k,D)})},this.moveTo=function(s,f,p){x(function(){s.moveTo(f,p)})},this.lineTo=function(s,f,p){x(function(){s.lineTo(f,p)})},this.arc=function(s,f,p,T,w,P,k){x(function(){s.arc(f,p,T,w,P,k)})},this.curveTo=function(s,f,p,T,w,P,k){x(function(){s.curveTo(f,p,T,w,P,k)})},this.close=function(s){x(function(){s.close()})},this.rect=function(s,f,p,T,w){x(function(){s.rect(f,p,T,w)})},this.clip=function(s){x(function(){s.clip()})},this.strokeColor=function(s,f,p,T,w,P,k,D){x(function(){s.strokeColor(f,p,T,w,P,k,D)})},this.fillColor=function(s,f,p,T,w){x(function(){s.fillColor(f,p,T,w)})},this.strokeLayer=function(s,f,p,T,w){x(function(){s.strokeLayer(f,p,T,w)})},this.fillLayer=function(s,f){x(function(){s.fillLayer(f)})},this.push=function(s){x(function(){s.push()})},this.pop=function(s){x(function(){s.pop()})},this.reset=function(s){x(function(){s.reset()})},this.setTransform=function(s,f,p,T,w,P,k){x(function(){s.setTransform(f,p,T,w,P,k)})},this.transform=function(s,f,p,T,w,P,k){x(function(){s.transform(f,p,T,w,P,k)})},this.setChannelMask=function(s,f){x(function(){s.setChannelMask(f)})},this.setMiterLimit=function(s,f){x(function(){s.setMiterLimit(f)})},this.dispose=function(f){x(function(){f.dispose()})},this.distort=function(f,p,T,w,P,k,D){x(function(){f.distort(p,T,w,P,k,D)})},this.move=function(f,p,T,w,P){x(function(){f.move(p,T,w,P)})},this.shade=function(f,p){x(function(){f.shade(p)})},this.scale=function(s){o.style.transform=o.style.WebkitTransform=o.style.MozTransform=o.style.OTransform=o.style.msTransform="scale("+s+","+s+")",a=s,g.style.width=e*a+"px",g.style.height=t*a+"px"},this.getScale=function(){return a},this.flatten=function(){var s=document.createElement("canvas");s.width=l.width,s.height=l.height;var f=s.getContext("2d");function p(w){var P=[];for(var k in w.children)P.push(w.children[k]);return P.sort(function(r,i){var h=r.z-i.z;if(h!==0)return h;var S=r.getElement(),M=i.getElement(),_=M.compareDocumentPosition(S);return _&Node.DOCUMENT_POSITION_PRECEDING?-1:_&Node.DOCUMENT_POSITION_FOLLOWING?1:0}),P}function T(w,P,k){if(w.width>0&&w.height>0){var D=f.globalAlpha;f.globalAlpha*=w.alpha/255,f.drawImage(w.getCanvas(),P,k);for(var r=p(w),i=0;i<r.length;i++){var h=r[i];T(h,P+h.x,k+h.y)}f.globalAlpha=D}}return T(l,0,0),s}};n.Display.VisibleLayer=function(u,e){n.Layer.apply(this,[u,e]);var t=this;this.__unique_id=n.Display.VisibleLayer.__next_id++,this.alpha=255,this.x=0,this.y=0,this.z=0,this.matrix=[1,0,0,1,0,0],this.parent=null,this.children={};var a=t.getCanvas();a.style.position="absolute",a.style.left="0px",a.style.top="0px";var o=document.createElement("div");o.appendChild(a),o.style.width=u+"px",o.style.height=e+"px",o.style.position="absolute",o.style.left="0px",o.style.top="0px",o.style.overflow="hidden";var l=this.resize;this.resize=function(v,c){o.style.width=v+"px",o.style.height=c+"px",l(v,c)},this.getElement=function(){return o};var y="translate(0px, 0px)",g="matrix(1, 0, 0, 1, 0, 0)";this.translate=function(v,c){t.x=v,t.y=c,y="translate("+v+"px,"+c+"px)",o.style.transform=o.style.WebkitTransform=o.style.MozTransform=o.style.OTransform=o.style.msTransform=y+" "+g},this.move=function(v,c,m,C){if(t.parent!==v){t.parent&&delete t.parent.children[t.__unique_id],t.parent=v,v.children[t.__unique_id]=t;var E=v.getElement();E.appendChild(o)}t.translate(c,m),t.z=C,o.style.zIndex=C},this.shade=function(v){t.alpha=v,o.style.opacity=v/255},this.dispose=function(){t.parent&&(delete t.parent.children[t.__unique_id],t.parent=null),o.parentNode&&o.parentNode.removeChild(o)},this.distort=function(v,c,m,C,E,d){t.matrix=[v,c,m,C,E,d],g="matrix("+v+","+c+","+m+","+C+","+E+","+d+")",o.style.transform=o.style.WebkitTransform=o.style.MozTransform=o.style.OTransform=o.style.msTransform=y+" "+g}};n.Display.VisibleLayer.__next_id=0;n.Display.Statistics=function(e){e=e||{},this.processingLag=e.processingLag,this.desktopFps=e.desktopFps,this.serverFps=e.serverFps,this.clientFps=e.clientFps,this.dropRate=e.dropRate};var n=n||{};n.Event=function(e){this.type=e,this.timestamp=new Date().getTime(),this.getAge=function(){return new Date().getTime()-this.timestamp},this.invokeLegacyHandler=function(a){}};n.Event.DOMEvent=function(e,t){n.Event.call(this,e),t=t||[],Array.isArray(t)||(t=[t]),this.preventDefault=function(){t.forEach(function(l){l.preventDefault&&l.preventDefault(),l.returnValue=!1})},this.stopPropagation=function(){t.forEach(function(l){l.stopPropagation()})}};n.Event.DOMEvent.cancelEvent=function(e){e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1};n.Event.Target=function(){var e={};this.on=function(a,o){var l=e[a];l||(e[a]=l=[]),l.push(o)},this.onEach=function(a,o){a.forEach(function(y){this.on(y,o)},this)},this.dispatch=function(a){a.invokeLegacyHandler(this);var o=e[a.type];if(o)for(var l=0;l<o.length;l++)o[l](a,this)},this.off=function(a,o){var l=e[a];if(!l)return!1;for(var y=0;y<l.length;y++)if(l[y]===o)return l.splice(y,1),!0;return!1},this.offEach=function(a,o){var l=!1;return a.forEach(function(g){l|=this.off(g,o)},this),l}};var n=n||{};n.InputSink=function(){var e=this,t=document.createElement("textarea");t.style.position="fixed",t.style.outline="none",t.style.border="none",t.style.margin="0",t.style.padding="0",t.style.height="0",t.style.width="0",t.style.left="0",t.style.bottom="0",t.style.resize="none",t.style.background="transparent",t.style.color="transparent",t.addEventListener("keypress",function(o){t.value=""},!1),t.addEventListener("compositionend",function(o){o.data&&(t.value="")},!1),t.addEventListener("input",function(o){o.data&&!o.isComposing&&(t.value="")},!1),t.addEventListener("focus",function(){window.setTimeout(function(){t.click(),t.select()},0)},!0),this.focus=function(){window.setTimeout(function(){t.focus()},0)},this.getElement=function(){return t},document.addEventListener("keydown",function(o){var l=document.activeElement;if(l&&l!==document.body){var y=l.getBoundingClientRect();if(y.left+y.width>0&&y.top+y.height>0)return}e.focus()},!0)};var n=n||{};n.InputStream=function(u,e){var t=this;this.index=e,this.onblob=null,this.onend=null,this.sendAck=function(a,o){u.sendAck(t.index,a,o)}};var n=n||{};n.IntegerPool=function(){var u=this,e=[];this.next_int=0,this.next=function(){return e.length>0?e.shift():u.next_int++},this.free=function(t){e.push(t)}};var n=n||{};n.JSONReader=function(e){var t=this,a=new n.StringReader(e),o="";this.getLength=function(){return o.length},this.getJSON=function(){return JSON.parse(o)},a.ontext=function(y){o+=y,t.onprogress&&t.onprogress(y.length)},a.onend=function(){t.onend&&t.onend()},this.onprogress=null,this.onend=null};var n=n||{};n.Keyboard=function(e){var t=this,a=n.Keyboard._nextID++,o="_GUAC_KEYBOARD_HANDLED_BY_"+a;this.onkeydown=null,this.onkeyup=null;var l={keyupUnreliable:!1,altIsTypableOnly:!1,capsLockKeyupUnreliable:!1};navigator&&navigator.platform&&(navigator.platform.match(/ipad|iphone|ipod/i)?l.keyupUnreliable=!0:navigator.platform.match(/^mac/i)&&(l.altIsTypableOnly=!0,l.capsLockKeyupUnreliable=!0));var y=function(F){var N=this;this.keyCode=F?F.which||F.keyCode:0,this.keyIdentifier=F&&F.keyIdentifier,this.key=F&&F.key,this.location=F?_(F):0,this.modifiers=F?n.Keyboard.ModifierState.fromKeyboardEvent(F):new n.Keyboard.ModifierState,this.timestamp=new Date().getTime(),this.defaultPrevented=!1,this.keysym=null,this.reliable=!1,this.getAge=function(){return new Date().getTime()-N.timestamp}},g=function(F){y.call(this,F),this.keysym=p(this.key,this.location)||P(this.keyCode,this.location),this.keyupReliable=!l.keyupUnreliable,this.keysym&&!f(this.keysym)&&(this.reliable=!0),!this.keysym&&k(this.keyCode,this.keyIdentifier)&&(this.keysym=p(this.keyIdentifier,this.location,this.modifiers.shift)),this.modifiers.meta&&this.keysym!==65511&&this.keysym!==65512?this.keyupReliable=!1:this.keysym===65509&&l.capsLockKeyupUnreliable&&(this.keyupReliable=!1);var N=!this.modifiers.ctrl&&!l.altIsTypableOnly,B=!this.modifiers.alt;(B&&this.modifiers.ctrl||N&&this.modifiers.alt||this.modifiers.meta||this.modifiers.hyper)&&(this.reliable=!0),O[this.keyCode]=this.keysym};g.prototype=new y;var v=function(F){y.call(this,F),this.keysym=w(this.keyCode),this.reliable=!0};v.prototype=new y;var c=function(F){y.call(this,F),this.keysym=P(this.keyCode,this.location)||p(this.key,this.location),t.pressed[this.keysym]||(this.keysym=O[this.keyCode]||this.keysym),this.reliable=!0};c.prototype=new y;var m=[],C={8:[65288],9:[65289],12:[65291,65291,65291,65461],13:[65293],16:[65505,65505,65506],17:[65507,65507,65508],18:[65513,65513,65027],19:[65299],20:[65509],27:[65307],32:[32],33:[65365,65365,65365,65465],34:[65366,65366,65366,65459],35:[65367,65367,65367,65457],36:[65360,65360,65360,65463],37:[65361,65361,65361,65460],38:[65362,65362,65362,65464],39:[65363,65363,65363,65462],40:[65364,65364,65364,65458],45:[65379,65379,65379,65456],46:[65535,65535,65535,65454],91:[65511],92:[65512],93:[65383],96:[65456],97:[65457],98:[65458],99:[65459],100:[65460],101:[65461],102:[65462],103:[65463],104:[65464],105:[65465],106:[65450],107:[65451],109:[65453],110:[65454],111:[65455],112:[65470],113:[65471],114:[65472],115:[65473],116:[65474],117:[65475],118:[65476],119:[65477],120:[65478],121:[65479],122:[65480],123:[65481],144:[65407],145:[65300],225:[65027]},E={Again:[65382],AllCandidates:[65341],Alphanumeric:[65328],Alt:[65513,65513,65027],Attn:[64782],AltGraph:[65027],ArrowDown:[65364],ArrowLeft:[65361],ArrowRight:[65363],ArrowUp:[65362],Backspace:[65288],CapsLock:[65509],Cancel:[65385],Clear:[65291],Convert:[65313],Copy:[64789],Crsel:[64796],CrSel:[64796],CodeInput:[65335],Compose:[65312],Control:[65507,65507,65508],ContextMenu:[65383],Delete:[65535],Down:[65364],End:[65367],Enter:[65293],EraseEof:[64774],Escape:[65307],Execute:[65378],Exsel:[64797],ExSel:[64797],F1:[65470],F2:[65471],F3:[65472],F4:[65473],F5:[65474],F6:[65475],F7:[65476],F8:[65477],F9:[65478],F10:[65479],F11:[65480],F12:[65481],F13:[65482],F14:[65483],F15:[65484],F16:[65485],F17:[65486],F18:[65487],F19:[65488],F20:[65489],F21:[65490],F22:[65491],F23:[65492],F24:[65493],Find:[65384],GroupFirst:[65036],GroupLast:[65038],GroupNext:[65032],GroupPrevious:[65034],FullWidth:null,HalfWidth:null,HangulMode:[65329],Hankaku:[65321],HanjaMode:[65332],Help:[65386],Hiragana:[65317],HiraganaKatakana:[65319],Home:[65360],Hyper:[65517,65517,65518],Insert:[65379],JapaneseHiragana:[65317],JapaneseKatakana:[65318],JapaneseRomaji:[65316],JunjaMode:[65336],KanaMode:[65325],KanjiMode:[65313],Katakana:[65318],Left:[65361],Meta:[65511,65511,65512],ModeChange:[65406],NumLock:[65407],PageDown:[65366],PageUp:[65365],Pause:[65299],Play:[64790],PreviousCandidate:[65342],PrintScreen:[65377],Redo:[65382],Right:[65363],RomanCharacters:null,Scroll:[65300],Select:[65376],Separator:[65452],Shift:[65505,65505,65506],SingleCandidate:[65340],Super:[65515,65515,65516],Tab:[65289],UIKeyInputDownArrow:[65364],UIKeyInputEscape:[65307],UIKeyInputLeftArrow:[65361],UIKeyInputRightArrow:[65363],UIKeyInputUpArrow:[65362],Up:[65362],Undo:[65381],Win:[65511,65511,65512],Zenkaku:[65320],ZenkakuHankaku:[65322]},d={65027:!0,65505:!0,65506:!0,65507:!0,65508:!0,65509:!0,65511:!0,65512:!0,65513:!0,65514:!0,65515:!0,65516:!0};this.modifiers=new n.Keyboard.ModifierState,this.pressed={};var I={},L={},O={},A=null,x=null,s=function(F,N){return F?F[N]||F[0]:null},f=function(F){return F>=0&&F<=255||(F&4294901760)===16777216};function p(b,F,N){if(!b)return null;var B,U=b.indexOf("U+");if(U>=0){var z=b.substring(U+2);B=String.fromCharCode(parseInt(z,16))}else if(b.length===1&&F!==3)B=b;else return s(E[b],F);N===!0?B=B.toUpperCase():N===!1&&(B=B.toLowerCase());var K=B.charCodeAt(0);return w(K)}function T(b){return b<=31||b>=127&&b<=159}function w(b){return T(b)?65280|b:b>=0&&b<=255?b:b>=256&&b<=1114111?16777216|b:null}function P(b,F){return s(C[b],F)}var k=function(F,N){if(!N)return!1;var B=N.indexOf("U+");if(B===-1)return!0;var U=parseInt(N.substring(B+2),16);return F!==U||F>=65&&F<=90||F>=48&&F<=57};this.press=function(b){if(b!==null){if(!t.pressed[b]&&(t.pressed[b]=!0,t.onkeydown)){var F=t.onkeydown(b);return L[b]=F,window.clearTimeout(A),window.clearInterval(x),d[b]||(A=window.setTimeout(function(){x=window.setInterval(function(){t.onkeyup(b),t.onkeydown(b)},50)},500)),F}return L[b]||!1}},this.release=function(b){t.pressed[b]&&(delete t.pressed[b],delete I[b],window.clearTimeout(A),window.clearInterval(x),b!==null&&t.onkeyup&&t.onkeyup(b))},this.type=function(F){for(var N=0;N<F.length;N++){var B=F.codePointAt?F.codePointAt(N):F.charCodeAt(N),U=w(B);t.press(U),t.release(U)}},this.reset=function(){for(var b in t.pressed)t.release(parseInt(b));m=[]};var D=function(F,N,B){var U=B.modifiers[F],z=t.modifiers[F],K;if(N.indexOf(B.keysym)===-1){if(z&&U===!1)for(K=0;K<N.length;K++)t.release(N[K]);else if(!z&&U){for(K=0;K<N.length;K++)if(t.pressed[N[K]])return;var H=N[0];B.keysym&&(I[H]=!0),t.press(H)}}},r=function(F){D("alt",[65513,65514,65027],F),D("shift",[65505,65506],F),D("ctrl",[65507,65508],F),D("meta",[65511,65512],F),D("hyper",[65515,65516],F),t.modifiers=F.modifiers},i=function(){for(var F in t.pressed)if(!I[F])return!1;return!0};function h(){var b=M();if(!b)return!1;var F;do F=b,b=M();while(b!==null);return i()&&t.reset(),F.defaultPrevented}var S=function(F){!t.modifiers.ctrl||!t.modifiers.alt||F>=65&&F<=90||F>=97&&F<=122||(F<=255||(F&4278190080)===16777216)&&(t.release(65507),t.release(65508),t.release(65513),t.release(65514))},M=function(){var F=m[0];if(!F)return null;if(F instanceof g){var N=null,B=[];if(F.keysym===65511||F.keysym===65512){if(m.length===1)return null;if(m[1].keysym!==F.keysym){if(!m[1].modifiers.meta)return m.shift()}else if(m[1]instanceof g)return m.shift()}if(F.reliable?(N=F.keysym,B=m.splice(0,1)):m[1]instanceof v?(N=m[1].keysym,B=m.splice(0,2)):m[1]&&(N=F.keysym,B=m.splice(0,1)),B.length>0){if(r(F),N){S(N);var U=!t.press(N);O[F.keyCode]=N,F.keyupReliable||t.release(N);for(var z=0;z<B.length;z++)B[z].defaultPrevented=U}return F}}else if(F instanceof c&&!l.keyupUnreliable){var N=F.keysym;if(N)t.release(N),delete O[F.keyCode],F.defaultPrevented=!0;else return t.reset(),F;return r(F),m.shift()}else return m.shift();return null},_=function(F){return"location"in F?F.location:"keyLocation"in F?F.keyLocation:0},R=function(F){return F[o]?!1:(F[o]=!0,!0)};this.listenTo=function(F){F.addEventListener("keydown",function(U){if(t.onkeydown&&R(U)){var z=new g(U);z.keyCode!==229&&(m.push(z),h()&&U.preventDefault())}},!0),F.addEventListener("keypress",function(U){!t.onkeydown&&!t.onkeyup||R(U)&&(m.push(new v(U)),h()&&U.preventDefault())},!0),F.addEventListener("keyup",function(U){t.onkeyup&&R(U)&&(U.preventDefault(),m.push(new c(U)),h())},!0);var N=function(z){!t.onkeydown&&!t.onkeyup||R(z)&&z.data&&!z.isComposing&&(F.removeEventListener("compositionend",B,!1),t.type(z.data))},B=function(z){!t.onkeydown&&!t.onkeyup||R(z)&&z.data&&(F.removeEventListener("input",N,!1),t.type(z.data))};F.addEventListener("input",N,!1),F.addEventListener("compositionend",B,!1)},e&&t.listenTo(e)};n.Keyboard._nextID=0;n.Keyboard.ModifierState=function(){this.shift=!1,this.ctrl=!1,this.alt=!1,this.meta=!1,this.hyper=!1};n.Keyboard.ModifierState.fromKeyboardEvent=function(u){var e=new n.Keyboard.ModifierState;return e.shift=u.shiftKey,e.ctrl=u.ctrlKey,e.alt=u.altKey,e.meta=u.metaKey,u.getModifierState&&(e.hyper=u.getModifierState("OS")||u.getModifierState("Super")||u.getModifierState("Hyper")||u.getModifierState("Win")),e};var n=n||{};n.Layer=function(u,e){var t=this,a=64,o=document.createElement("canvas"),l=o.getContext("2d");l.save();var y=!0,g=!0,v=0,c={1:"destination-in",2:"destination-out",4:"source-in",6:"source-atop",8:"source-out",9:"destination-atop",10:"xor",11:"destination-over",12:"copy",14:"source-over",15:"lighter"},m=function(d,I){d=d||0,I=I||0;var L=Math.ceil(d/a)*a,O=Math.ceil(I/a)*a;if(o.width!==L||o.height!==O){var A=null;if(!y&&o.width!==0&&o.height!==0){A=document.createElement("canvas"),A.width=Math.min(t.width,d),A.height=Math.min(t.height,I);var x=A.getContext("2d");x.drawImage(o,0,0,A.width,A.height,0,0,A.width,A.height)}var s=l.globalCompositeOperation;o.width=L,o.height=O,A&&l.drawImage(A,0,0,A.width,A.height,0,0,A.width,A.height),l.globalCompositeOperation=s,v=0,l.save()}else t.reset();t.width=d,t.height=I};function C(E,d,I,L){var O=I+E,A=L+d,x;O>t.width?x=O:x=t.width;var s;A>t.height?s=A:s=t.height,t.resize(x,s)}this.autosize=!1,this.width=u,this.height=e,this.getCanvas=function(){return o},this.toCanvas=function(){var d=document.createElement("canvas");d.width=t.width,d.height=t.height;var I=d.getContext("2d");return I.drawImage(t.getCanvas(),0,0),d},this.resize=function(E,d){(E!==t.width||d!==t.height)&&m(E,d)},this.drawImage=function(E,d,I){t.autosize&&C(E,d,I.width,I.height),l.drawImage(I,E,d),y=!1},this.transfer=function(E,d,I,L,O,A,x,s){var f=E.getCanvas();if(!(d>=f.width||I>=f.height)&&(d+L>f.width&&(L=f.width-d),I+O>f.height&&(O=f.height-I),!(L===0||O===0))){t.autosize&&C(A,x,L,O);for(var p=E.getCanvas().getContext("2d").getImageData(d,I,L,O),T=l.getImageData(A,x,L,O),w=0;w<L*O*4;w+=4){var P=new n.Layer.Pixel(p.data[w],p.data[w+1],p.data[w+2],p.data[w+3]),k=new n.Layer.Pixel(T.data[w],T.data[w+1],T.data[w+2],T.data[w+3]);s(P,k),T.data[w]=k.red,T.data[w+1]=k.green,T.data[w+2]=k.blue,T.data[w+3]=k.alpha}l.putImageData(T,A,x),y=!1}},this.put=function(E,d,I,L,O,A,x){var s=E.getCanvas();if(!(d>=s.width||I>=s.height)&&(d+L>s.width&&(L=s.width-d),I+O>s.height&&(O=s.height-I),!(L===0||O===0))){t.autosize&&C(A,x,L,O);var f=E.getCanvas().getContext("2d").getImageData(d,I,L,O);l.putImageData(f,A,x),y=!1}},this.copy=function(E,d,I,L,O,A,x){var s=E.getCanvas();d>=s.width||I>=s.height||(d+L>s.width&&(L=s.width-d),I+O>s.height&&(O=s.height-I),!(L===0||O===0)&&(t.autosize&&C(A,x,L,O),l.drawImage(s,d,I,L,O,A,x,L,O),y=!1))},this.moveTo=function(E,d){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,0,0),l.moveTo(E,d)},this.lineTo=function(E,d){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,0,0),l.lineTo(E,d)},this.arc=function(E,d,I,L,O,A){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,0,0),l.arc(E,d,I,L,O,A)},this.curveTo=function(E,d,I,L,O,A){g&&(l.beginPath(),g=!1),t.autosize&&C(O,A,0,0),l.bezierCurveTo(E,d,I,L,O,A)},this.close=function(){l.closePath(),g=!0},this.rect=function(E,d,I,L){g&&(l.beginPath(),g=!1),t.autosize&&C(E,d,I,L),l.rect(E,d,I,L)},this.clip=function(){l.clip(),g=!0},this.strokeColor=function(E,d,I,L,O,A,x){l.lineCap=E,l.lineJoin=d,l.lineWidth=I,l.strokeStyle="rgba("+L+","+O+","+A+","+x/255+")",l.stroke(),y=!1,g=!0},this.fillColor=function(E,d,I,L){l.fillStyle="rgba("+E+","+d+","+I+","+L/255+")",l.fill(),y=!1,g=!0},this.strokeLayer=function(E,d,I,L){l.lineCap=E,l.lineJoin=d,l.lineWidth=I,l.strokeStyle=l.createPattern(L.getCanvas(),"repeat"),l.stroke(),y=!1,g=!0},this.fillLayer=function(E){l.fillStyle=l.createPattern(E.getCanvas(),"repeat"),l.fill(),y=!1,g=!0},this.push=function(){l.save(),v++},this.pop=function(){v>0&&(l.restore(),v--)},this.reset=function(){for(;v>0;)l.restore(),v--;l.restore(),l.save(),l.beginPath(),g=!1},this.setTransform=function(E,d,I,L,O,A){l.setTransform(E,d,I,L,O,A)},this.transform=function(E,d,I,L,O,A){l.transform(E,d,I,L,O,A)},this.setChannelMask=function(E){l.globalCompositeOperation=c[E]},this.setMiterLimit=function(E){l.miterLimit=E},m(u,e),o.style.zIndex=-1};n.Layer.ROUT=2;n.Layer.ATOP=6;n.Layer.XOR=10;n.Layer.ROVER=11;n.Layer.OVER=14;n.Layer.PLUS=15;n.Layer.RIN=1;n.Layer.IN=4;n.Layer.OUT=8;n.Layer.RATOP=9;n.Layer.SRC=12;n.Layer.Pixel=function(u,e,t,a){this.red=u,this.green=e,this.blue=t,this.alpha=a};var n=n||{};n.Mouse=function(e){n.Mouse.Event.Target.call(this);var t=this;this.touchMouseThreshold=3,this.scrollThreshold=53,this.PIXELS_PER_LINE=18,this.PIXELS_PER_PAGE=this.PIXELS_PER_LINE*16;var a=[n.Mouse.State.Buttons.LEFT,n.Mouse.State.Buttons.MIDDLE,n.Mouse.State.Buttons.RIGHT],o=0,l=0;e.addEventListener("contextmenu",function(c){n.Event.DOMEvent.cancelEvent(c)},!1),e.addEventListener("mousemove",function(c){if(o){n.Event.DOMEvent.cancelEvent(c),o--;return}t.move(n.Position.fromClientPosition(e,c.clientX,c.clientY),c)},!1),e.addEventListener("mousedown",function(c){if(o){n.Event.DOMEvent.cancelEvent(c);return}var m=a[c.button];m&&t.press(m,c)},!1),e.addEventListener("mouseup",function(c){if(o){n.Event.DOMEvent.cancelEvent(c);return}var m=a[c.button];m&&t.release(m,c)},!1),e.addEventListener("mouseout",function(c){c||(c=window.event);for(var m=c.relatedTarget||c.toElement;m;){if(m===e)return;m=m.parentNode}t.reset(c),t.out(c)},!1),e.addEventListener("selectstart",function(c){n.Event.DOMEvent.cancelEvent(c)},!1);function y(){o=t.touchMouseThreshold}e.addEventListener("touchmove",y,!1),e.addEventListener("touchstart",y,!1),e.addEventListener("touchend",y,!1);function g(c){var m=c.deltaY||-c.wheelDeltaY||-c.wheelDelta;if(m?c.deltaMode===1?m=c.deltaY*t.PIXELS_PER_LINE:c.deltaMode===2&&(m=c.deltaY*t.PIXELS_PER_PAGE):m=c.detail*t.PIXELS_PER_LINE,l+=m,l<=-t.scrollThreshold){do t.click(n.Mouse.State.Buttons.UP),l+=t.scrollThreshold;while(l<=-t.scrollThreshold);l=0}if(l>=t.scrollThreshold){do t.click(n.Mouse.State.Buttons.DOWN),l-=t.scrollThreshold;while(l>=t.scrollThreshold);l=0}n.Event.DOMEvent.cancelEvent(c)}e.addEventListener("DOMMouseScroll",g,!1),e.addEventListener("mousewheel",g,!1),e.addEventListener("wheel",g,!1);var v=(function(){var c=document.createElement("div");if(!("cursor"in c.style))return!1;try{c.style.cursor="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX///+nxBvIAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==) 0 0, auto"}catch{return!1}return/\burl\([^()]*\)\s+0\s+0\b/.test(c.style.cursor||"")})();this.setCursor=function(c,m,C){if(v){var E=c.toDataURL("image/png");return e.style.cursor="url("+E+") "+m+" "+C+", auto",!0}return!1}};n.Mouse.State=function(e){var t=function(o,l,y,g,v,c,m){return{x:o,y:l,left:y,middle:g,right:v,up:c,down:m}};arguments.length>1?e=t.apply(this,arguments):e=e||{},n.Position.call(this,e),this.left=e.left||!1,this.middle=e.middle||!1,this.right=e.right||!1,this.up=e.up||!1,this.down=e.down||!1};n.Mouse.State.Buttons={LEFT:"left",MIDDLE:"middle",RIGHT:"right",UP:"up",DOWN:"down"};n.Mouse.Event=function(e,t,a){n.Event.DOMEvent.call(this,e,a);var o="on"+this.type;this.state=t,this.invokeLegacyHandler=function(y){y[o]&&(this.preventDefault(),this.stopPropagation(),y[o](this.state))}};n.Mouse.Event.Target=function(){n.Event.Target.call(this),this.currentState=new n.Mouse.State,this.press=function(t,a){this.currentState[t]||(this.currentState[t]=!0,this.dispatch(new n.Mouse.Event("mousedown",this.currentState,a)))},this.release=function(t,a){this.currentState[t]&&(this.currentState[t]=!1,this.dispatch(new n.Mouse.Event("mouseup",this.currentState,a)))},this.click=function(t,a){this.press(t,a),this.release(t,a)},this.move=function(t,a){(this.currentState.x!==t.x||this.currentState.y!==t.y)&&(this.currentState.x=t.x,this.currentState.y=t.y,this.dispatch(new n.Mouse.Event("mousemove",this.currentState,a)))},this.out=function(t){this.dispatch(new n.Mouse.Event("mouseout",this.currentState,t))},this.reset=function(t){for(var a in n.Mouse.State.Buttons)this.release(n.Mouse.State.Buttons[a],t)}};n.Mouse.Touchpad=function(e){n.Mouse.Event.Target.call(this);var t=this;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=10*(window.devicePixelRatio||1),this.currentState=new n.Mouse.State;var a=0,o=0,l=0,y=0,g=0,v={1:"left",2:"right",3:"middle"},c=!1,m=null;e.addEventListener("touchend",function(C){if(C.preventDefault(),c&&C.touches.length===0){var E=new Date().getTime(),d=v[a];t.currentState[d]&&(t.release(d,C),m&&(window.clearTimeout(m),m=null)),E-y<=t.clickTimingThreshold&&g<t.clickMoveThreshold&&(t.press(d,C),m=window.setTimeout(function(){t.release(d,C),c=!1},t.clickTimingThreshold)),m||(c=!1)}},!1),e.addEventListener("touchstart",function(C){if(C.preventDefault(),a=Math.min(C.touches.length,3),m&&(window.clearTimeout(m),m=null),!c){c=!0;var E=C.touches[0];o=E.clientX,l=E.clientY,y=new Date().getTime(),g=0}},!1),e.addEventListener("touchmove",function(C){C.preventDefault();var E=C.touches[0],d=E.clientX-o,I=E.clientY-l;if(g+=Math.abs(d)+Math.abs(I),a===1){var L=g/(new Date().getTime()-y),O=1+L,A=new n.Position(t.currentState);A.x+=d*O,A.y+=I*O,A.x=Math.min(Math.max(0,A.x),e.offsetWidth-1),A.y=Math.min(Math.max(0,A.y),e.offsetHeight-1),t.move(A,C),o=E.clientX,l=E.clientY}else if(a===2&&Math.abs(I)>=t.scrollThreshold){var x;I>0?x="down":x="up",t.click(x,C),o=E.clientX,l=E.clientY}},!1)};n.Mouse.Touchscreen=function(e){n.Mouse.Event.Target.call(this);var t=this,a=!1,o=null,l=null,y=null,g=null;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=16*(window.devicePixelRatio||1),this.longPressThreshold=500;function v(C){var E=C.touches[0]||C.changedTouches[0],d=E.clientX-o,I=E.clientY-l;return Math.sqrt(d*d+I*I)>=t.clickMoveThreshold}function c(C){var E=C.touches[0];a=!0,o=E.clientX,l=E.clientY}function m(){window.clearTimeout(y),window.clearTimeout(g),a=!1}e.addEventListener("touchend",function(C){if(a){if(C.touches.length!==0||C.changedTouches.length!==1){m();return}if(window.clearTimeout(g),t.release(n.Mouse.State.Buttons.LEFT,C),!v(C)&&(C.preventDefault(),!t.currentState.left)){var E=C.changedTouches[0];t.move(n.Position.fromClientPosition(e,E.clientX,E.clientY)),t.press(n.Mouse.State.Buttons.LEFT,C),y=window.setTimeout(function(){t.release(n.Mouse.State.Buttons.LEFT,C),m()},t.clickTimingThreshold)}}},!1),e.addEventListener("touchstart",function(C){if(C.touches.length!==1){m();return}C.preventDefault(),c(C),window.clearTimeout(y),g=window.setTimeout(function(){var E=C.touches[0];t.move(n.Position.fromClientPosition(e,E.clientX,E.clientY)),t.click(n.Mouse.State.Buttons.RIGHT,C),m()},t.longPressThreshold)},!1),e.addEventListener("touchmove",function(C){if(a){if(v(C)&&window.clearTimeout(g),C.touches.length!==1){m();return}if(t.currentState.left){C.preventDefault();var E=C.touches[0];t.move(n.Position.fromClientPosition(e,E.clientX,E.clientY),C)}}},!1)};var n=n||{},n=n||{};n.Object=function(e,t){var a=this,o={},l=function(v){var c=o[v];if(!c)return null;var m=c.shift();return c.length===0&&delete o[v],m},y=function(v,c){var m=o[v];m||(m=[],o[v]=m),m.push(c)};this.index=t,this.onbody=function(v,c,m){var C=l(m);C&&C(v,c)},this.onundefine=null,this.requestInputStream=function(v,c){c&&y(v,c),e.requestObjectInputStream(a.index,v)},this.createOutputStream=function(v,c){return e.createObjectOutputStream(a.index,v,c)}};n.Object.ROOT_STREAM="/";n.Object.STREAM_INDEX_MIMETYPE="application/vnd.glyptodon.guacamole.stream-index+json";var n=n||{};n.OnScreenKeyboard=function(u){var e=this,t={},a={},o=[],l=function(s,f){s.classList?s.classList.add(f):s.className+=" "+f},y=function(s,f){s.classList?s.classList.remove(f):s.className=s.className.replace(/([^ ]+)[ ]*/g,function(T,w){return w===f?"":T})},g=0,v=function(s,f,p,T){this.width=f,this.height=p,this.scale=function(w){s.style.width=f*w+"px",s.style.height=p*w+"px",T&&(s.style.lineHeight=p*w+"px",s.style.fontSize=w+"px")}},c=function(s){for(var f=0;f<s.length;f++){var p=s[f];if(!(p in t))return!1}return!0},m=function(s){var f=e.keys[s];if(!f)return null;for(var p=f.length-1;p>=0;p--){var T=f[p];if(c(T.requires))return T}return null},C=function(s,f){if(!a[s]){l(f,"guac-keyboard-pressed");var p=m(s);if(p.modifier){var T="guac-keyboard-modifier-"+O(p.modifier),w=t[p.modifier];w===void 0?(l(d,T),t[p.modifier]=p.keysym,p.keysym&&e.onkeydown&&e.onkeydown(p.keysym)):(y(d,T),delete t[p.modifier],w&&e.onkeyup&&e.onkeyup(w))}else e.onkeydown&&e.onkeydown(p.keysym);a[s]=!0}},E=function(s,f){if(a[s]){y(f,"guac-keyboard-pressed");var p=m(s);!p.modifier&&e.onkeyup&&e.onkeyup(p.keysym),a[s]=!1}},d=document.createElement("div");d.className="guac-keyboard",d.onselectstart=d.onmousemove=d.onmouseup=d.onmousedown=function(s){return g&&g--,s.stopPropagation(),!1},this.touchMouseThreshold=3,this.onkeydown=null,this.onkeyup=null,this.layout=new n.OnScreenKeyboard.Layout(u),this.getElement=function(){return d},this.resize=function(x){for(var s=Math.floor(x*10/e.layout.width)/10,f=0;f<o.length;f++){var p=o[f];p.scale(s)}};var I=function(s,f){if(f instanceof Array){for(var p=[],T=0;T<f.length;T++)p.push(new n.OnScreenKeyboard.Key(f[T],s));return p}return typeof f=="number"?[new n.OnScreenKeyboard.Key({name:s,keysym:f})]:typeof f=="string"?[new n.OnScreenKeyboard.Key({name:s,title:f})]:[new n.OnScreenKeyboard.Key(f,s)]},L=function(s){var f={};for(var p in u.keys)f[p]=I(p,s[p]);return f};this.keys=L(u.keys);var O=function(s){var f=s.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^A-Za-z0-9]+/g,"-").toLowerCase();return f},A=function x(s,f,p){var T,w=document.createElement("div");if(p&&l(w,"guac-keyboard-"+O(p)),f instanceof Array)for(l(w,"guac-keyboard-group"),T=0;T<f.length;T++)x(w,f[T]);else if(f instanceof Object){l(w,"guac-keyboard-group");var P=Object.keys(f).sort();for(T=0;T<P.length;T++){var p=P[T];x(w,f[p],p)}}else if(typeof f=="number")l(w,"guac-keyboard-gap"),o.push(new v(w,f,f));else if(typeof f=="string"){var k=f;k.length===1&&(k="0x"+k.charCodeAt(0).toString(16)),l(w,"guac-keyboard-key-container");var D=document.createElement("div");D.className="guac-keyboard-key guac-keyboard-key-"+O(k);var r=e.keys[f];if(r)for(T=0;T<r.length;T++){var i=r[T],h=document.createElement("div");h.className="guac-keyboard-cap",h.textContent=i.title;for(var S=0;S<i.requires.length;S++){var M=i.requires[S];l(h,"guac-keyboard-requires-"+O(M)),l(D,"guac-keyboard-uses-"+O(M))}D.appendChild(h)}w.appendChild(D),o.push(new v(w,e.layout.keyWidths[f]||1,1,!0));var _=function(B){B.preventDefault(),g=e.touchMouseThreshold,C(f,D)},R=function(B){B.preventDefault(),g=e.touchMouseThreshold,E(f,D)},b=function(B){B.preventDefault(),g===0&&C(f,D)},F=function(B){B.preventDefault(),g===0&&E(f,D)};D.addEventListener("touchstart",_,!0),D.addEventListener("touchend",R,!0),D.addEventListener("mousedown",b,!0),D.addEventListener("mouseup",F,!0),D.addEventListener("mouseout",F,!0)}s.appendChild(w)};A(d,u.layout)};n.OnScreenKeyboard.Layout=function(u){this.language=u.language,this.type=u.type,this.keys=u.keys,this.layout=u.layout,this.width=u.width,this.keyWidths=u.keyWidths||{}};n.OnScreenKeyboard.Key=function(u,e){this.name=e||u.name,this.title=u.title||this.name,this.keysym=u.keysym||(function(a){if(!a||a.length!==1)return null;var o=a.charCodeAt(0);return o>=0&&o<=255?o:o>=256&&o<=1114111?16777216|o:null})(this.title),this.modifier=u.modifier,this.requires=u.requires||[]};var n=n||{};n.OutputStream=function(u,e){var t=this;this.index=e,this.onack=null,this.sendBlob=function(a){u.sendBlob(t.index,a)},this.sendEnd=function(){u.endStream(t.index)}};var n=n||{};n.Parser=function(){var u=this,e="",t=[],a=-1,o=0;this.receive=function(l){for(o>4096&&a>=o&&(e=e.substring(o),a-=o,o=0),e+=l;a<e.length;){if(a>=o){var y=e.substring(o,a),g=e.substring(a,a+1);if(t.push(y),g==";"){var v=t.shift();u.oninstruction!=null&&u.oninstruction(v,t),t.length=0}else if(g!=",")throw new Error("Illegal terminator.");o=a+1}var c=e.indexOf(".",o);if(c!=-1){var m=parseInt(e.substring(a+1,c));if(isNaN(m))throw new Error("Non-numeric character in element length.");o=c+1,a=o+m}else{o=e.length;break}}},this.oninstruction=null};var n=n||{};n.Position=function(e){e=e||{},this.x=e.x||0,this.y=e.y||0,this.fromClientPosition=function(a,o,l){this.x=o-a.offsetLeft,this.y=l-a.offsetTop;for(var y=a.offsetParent;y&&y!==document.body;)this.x-=y.offsetLeft-y.scrollLeft,this.y-=y.offsetTop-y.scrollTop,y=y.offsetParent;if(y){var g=document.body.scrollLeft||document.documentElement.scrollLeft,v=document.body.scrollTop||document.documentElement.scrollTop;this.x-=y.offsetLeft-g,this.y-=y.offsetTop-v}}};n.Position.fromClientPosition=function(e,t,a){var o=new n.Position;return o.fromClientPosition(e,t,a),o};var n=n||{};n.RawAudioFormat=function(e){this.bytesPerSample=e.bytesPerSample,this.channels=e.channels,this.rate=e.rate};n.RawAudioFormat.parse=function(e){var t,a=null,o=1;if(e.substring(0,9)==="audio/L8;")e=e.substring(9),t=1;else if(e.substring(0,10)==="audio/L16;")e=e.substring(10),t=2;else return null;for(var l=e.split(","),y=0;y<l.length;y++){var g=l[y],v=g.indexOf("=");if(v===-1)return null;var c=g.substring(0,v),m=g.substring(v+1);switch(c){case"channels":o=parseInt(m);break;case"rate":a=parseInt(m);break;default:return null}}return a===null?null:new n.RawAudioFormat({bytesPerSample:t,channels:o,rate:a})};var n=n||{};n.SessionRecording=function(e){var t=this,a,o=null,l=262144,y=16384,g=5e3,v=[],c=0,m=new n.SessionRecording._PlaybackTunnel,C=new n.Client(m),E=-1,d=null,I=null,L=null,O=0,A=0,x=!1,s=null,f=function(R,b,F){if(!(x&&R===a)){var N=new n.Parser;N.oninstruction=b;var B=0,U=new FileReader,z=function(){if(!(x&&R===a)){if(U.readyState===2)try{N.receive(U.result)}catch(W){t.onerror&&t.onerror(W.message);return}if(B>=R.size)F&&F();else{var H=R.slice(B,B+l);B+=H.size,U.readAsText(H)}}};U.onload=z,z()}},p=function(R){for(var b=R.length,F=b+3;b>=10;)F++,b=Math.floor(b/10);return F};C.connect(),C.getDisplay().showCursor(!1);var T=function(R,b){A+=p(R);for(var F=0;F<b.length;F++)A+=p(b[F]);if(R==="sync"){var N=parseInt(b[0]),B=new n.SessionRecording._Frame(N,O,A);v.push(B),O=A,(v.length===1||A-v[c].start>=y&&N-v[c].timestamp>=g)&&(B.keyframe=!0,c=v.length-1),t.onprogress&&t.onprogress(t.getDuration(),A)}},w=function(){t.onload&&t.onload()};if(e instanceof Blob)f(a,T,w);else{o=e,a=new Blob;var P=!1,k="";o.oninstruction=function(R,b){k+=R.length+"."+R,b.forEach(function(N){k+=","+N.length+"."+N}),k+=";",k.length>=l&&(a=new Blob([a,k]),k=""),T(R,b)},o.onerror=function(R){P=!0,t.onerror&&t.onerror(R.message)},o.onstatechange=function(R){R===n.Tunnel.State.CLOSED&&(k.length&&(a=new Blob([a,k]),k=""),P||w())}}var D=function(R){return v.length===0?0:R-v[0].timestamp},r=function _(R,b,F){if(R===b)return R;var N=Math.floor((R+b)/2),B=D(v[N].timestamp);return F<B&&N>R?_(R,N-1,F):F>B&&N<b?_(N+1,b,F):N},i=function(R,b){var F=v[R];f(a.slice(F.start,F.end),function(B,U){m.receiveInstruction(B,U)},function(){F.keyframe&&!F.clientState&&C.exportState(function(U){F.clientState=new Blob([JSON.stringify(U)])}),E=R,b&&b()})},h=function(R,b,F){S();for(var N=L={aborted:!1},B=R,U=function H(){t.onseek&&E>B&&t.onseek(D(v[E].timestamp),E-B,R-B),!N.aborted&&(E<R?i(E+1,H):b())},z=function(){var W=F?Math.max(F-new Date().getTime(),0):0;W?window.setTimeout(U,W):U()};B>=0;B--){var K=v[B];if(B===E)break;if(K.clientState){K.clientState.text().then(function(W){C.importState(JSON.parse(W)),E=B,z()});return}}z()},S=function(){L&&(L.aborted=!0,L=null)},M=function _(){if(E+1<v.length){var R=v[E+1],b=R.timestamp-d+I;h(E+1,function(){_()},b)}else t.pause()};this.onload=null,this.onerror=null,this.onabort=null,this.onprogress=null,this.onplay=null,this.onpause=null,this.onseek=null,this.connect=function(R){o&&o.connect(R)},this.disconnect=function(){o&&o.disconnect()},this.abort=function(){x||(x=!0,t.onabort&&t.onabort(),o&&o.disconnect())},this.getDisplay=function(){return C.getDisplay()},this.isPlaying=function(){return!!d},this.getPosition=function(){return E===-1?0:D(v[E].timestamp)},this.getDuration=function(){return v.length===0?0:D(v[v.length-1].timestamp)},this.play=function(){if(!t.isPlaying()&&E+1<v.length){t.onplay&&t.onplay();var R=v[E+1];d=R.timestamp,I=new Date().getTime(),M()}},this.seek=function(R,b){if(v.length!==0){t.cancel();var F=t.isPlaying();t.pause(),s=function(){s=null,F&&(t.play(),F=null),b&&b()},h(r(0,v.length-1,R),s)}},this.cancel=function(){s&&(S(),s())},this.pause=function(){S(),t.isPlaying()&&(t.onpause&&t.onpause(),d=null,I=null)}};n.SessionRecording._Frame=function(e,t,a){this.keyframe=!1,this.timestamp=e,this.start=t,this.end=a,this.clientState=null};n.SessionRecording._PlaybackTunnel=function(){var e=this;this.connect=function(a){},this.sendMessage=function(a){},this.disconnect=function(){},this.receiveInstruction=function(a,o){e.oninstruction&&e.oninstruction(a,o)}};var n=n||{};n.Status=function(u,e){var t=this;this.code=u,this.message=e,this.isError=function(){return t.code<0||t.code>255}};n.Status.Code={SUCCESS:0,UNSUPPORTED:256,SERVER_ERROR:512,SERVER_BUSY:513,UPSTREAM_TIMEOUT:514,UPSTREAM_ERROR:515,RESOURCE_NOT_FOUND:516,RESOURCE_CONFLICT:517,RESOURCE_CLOSED:518,UPSTREAM_NOT_FOUND:519,UPSTREAM_UNAVAILABLE:520,SESSION_CONFLICT:521,SESSION_TIMEOUT:522,SESSION_CLOSED:523,CLIENT_BAD_REQUEST:768,CLIENT_UNAUTHORIZED:769,CLIENT_FORBIDDEN:771,CLIENT_TIMEOUT:776,CLIENT_OVERRUN:781,CLIENT_BAD_TYPE:783,CLIENT_TOO_MANY:797};n.Status.Code.fromHTTPCode=function(e){switch(e){case 400:return n.Status.Code.CLIENT_BAD_REQUEST;case 403:return n.Status.Code.CLIENT_FORBIDDEN;case 404:return n.Status.Code.RESOURCE_NOT_FOUND;case 429:return n.Status.Code.CLIENT_TOO_MANY;case 503:return n.Status.Code.SERVER_BUSY}return n.Status.Code.SERVER_ERROR};n.Status.Code.fromWebSocketCode=function(e){switch(e){case 1e3:return n.Status.Code.SUCCESS;case 1006:case 1015:return n.Status.Code.UPSTREAM_NOT_FOUND;case 1001:case 1012:case 1013:case 1014:return n.Status.Code.UPSTREAM_UNAVAILABLE}return n.Status.Code.SERVER_ERROR};var n=n||{};n.StringReader=function(u){var e=this,t=new n.UTF8Parser,a=new n.ArrayBufferReader(u);a.ondata=function(o){var l=t.decode(o);e.ontext&&e.ontext(l)},a.onend=function(){e.onend&&e.onend()},this.ontext=null,this.onend=null};var n=n||{};n.StringWriter=function(u){var e=this,t=new n.ArrayBufferWriter(u),a=new Uint8Array(8192),o=0;t.onack=function(v){e.onack&&e.onack(v)};function l(v){if(o+v>=a.length){var c=new Uint8Array((o+v)*2);c.set(a),a=c}o+=v}function y(v){var c,m;if(v<=127)c=0,m=1;else if(v<=2047)c=192,m=2;else if(v<=65535)c=224,m=3;else if(v<=2097151)c=240,m=4;else{y(65533);return}l(m);for(var C=o-1,E=1;E<m;E++)a[C--]=128|v&63,v>>=6;a[C]=c|v}function g(v){for(var c=0;c<v.length;c++){var m=v.charCodeAt(c);y(m)}if(o>0){var C=a.subarray(0,o);return o=0,C}}this.sendText=function(v){v.length&&t.sendData(g(v))},this.sendEnd=function(){t.sendEnd()},this.onack=null};var n=n||{};n.Touch=function(e){n.Event.Target.call(this);var t=this,a=Math.floor(16*window.devicePixelRatio);this.touches={},this.activeTouches=0,e.addEventListener("touchstart",function(l){for(var y=0;y<l.changedTouches.length;y++){var g=l.changedTouches[y],v=g.identifier;if(!t.touches[v]){var c=t.touches[v]=new n.Touch.State({id:v,radiusX:g.radiusX||a,radiusY:g.radiusY||a,angle:g.angle||0,force:g.force||1});t.activeTouches++,c.fromClientPosition(e,g.clientX,g.clientY),t.dispatch(new n.Touch.Event("touchmove",l,c))}}},!1),e.addEventListener("touchmove",function(l){for(var y=0;y<l.changedTouches.length;y++){var g=l.changedTouches[y],v=g.identifier,c=t.touches[v];c&&(g.force&&(c.force=g.force),c.angle=g.angle||0,c.radiusX=g.radiusX||a,c.radiusY=g.radiusY||a,c.fromClientPosition(e,g.clientX,g.clientY),t.dispatch(new n.Touch.Event("touchmove",l,c)))}},!1),e.addEventListener("touchend",function(l){for(var y=0;y<l.changedTouches.length;y++){var g=l.changedTouches[y],v=g.identifier,c=t.touches[v];c&&(delete t.touches[v],t.activeTouches--,c.force=0,c.fromClientPosition(e,g.clientX,g.clientY),t.dispatch(new n.Touch.Event("touchend",l,c)))}},!1)};n.Touch.State=function(e){e=e||{},n.Position.call(this,e),this.id=e.id||0,this.radiusX=e.radiusX||0,this.radiusY=e.radiusY||0,this.angle=e.angle||0,this.force=e.force||1};n.Touch.Event=function(e,t,a){n.Event.DOMEvent.call(this,e,[t]),this.state=a};var n=n||{};n.Tunnel=function(){this.connect=function(u){},this.disconnect=function(){},this.sendMessage=function(u){},this.setState=function(u){u!==this.state&&(this.state=u,this.onstatechange&&this.onstatechange(u))},this.setUUID=function(e){this.uuid=e,this.onuuid&&this.onuuid(e)},this.isConnected=function(){return this.state===n.Tunnel.State.OPEN||this.state===n.Tunnel.State.UNSTABLE},this.state=n.Tunnel.State.CLOSED,this.receiveTimeout=15e3,this.unstableThreshold=1500,this.uuid=null,this.onuuid=null,this.onerror=null,this.onstatechange=null,this.oninstruction=null};n.Tunnel.INTERNAL_DATA_OPCODE="";n.Tunnel.State={CONNECTING:0,OPEN:1,CLOSED:2,UNSTABLE:3};n.HTTPTunnel=function(u,e,t){var a=this,o=u+"?connect",l=u+"?read:",y=u+"?write:",g=1,v=0,c=g,m=!1,C="",E=!!e,d=null,I=null,L=null,O=500,A=t||{},x="Guacamole-Tunnel-Token",s=null;function f(i,h){for(var S in h)i.setRequestHeader(S,h[S])}var p=function(){window.clearTimeout(d),window.clearTimeout(I),a.state===n.Tunnel.State.UNSTABLE&&a.setState(n.Tunnel.State.OPEN),d=window.setTimeout(function(){T(new n.Status(n.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},a.receiveTimeout),I=window.setTimeout(function(){a.setState(n.Tunnel.State.UNSTABLE)},a.unstableThreshold)};function T(i){window.clearTimeout(d),window.clearTimeout(I),window.clearInterval(L),a.state!==n.Tunnel.State.CLOSED&&(i.code!==n.Status.Code.SUCCESS&&a.onerror&&(a.state===n.Tunnel.State.CONNECTING||i.code!==n.Status.Code.RESOURCE_NOT_FOUND)&&a.onerror(i),m=!1,a.setState(n.Tunnel.State.CLOSED))}this.sendMessage=function(){if(!a.isConnected()||arguments.length===0)return;function i(M){var _=new String(M);return _.length+"."+_}for(var h=i(arguments[0]),S=1;S<arguments.length;S++)h+=","+i(arguments[S]);h+=";",C+=h,m||w()};function w(){if(a.isConnected())if(C.length>0){m=!0;var i=new XMLHttpRequest;i.open("POST",y+a.uuid),i.withCredentials=E,f(i,A),i.setRequestHeader("Content-type","application/octet-stream"),i.setRequestHeader(x,s),i.onreadystatechange=function(){i.readyState===4&&(p(),i.status!==200?P(i):w())},i.send(C),C=""}else m=!1}function P(i){var h=parseInt(i.getResponseHeader("Guacamole-Status-Code"));if(h){var S=i.getResponseHeader("Guacamole-Error-Message");T(new n.Status(h,S))}else i.status?T(new n.Status(n.Status.Code.fromHTTPCode(i.status),i.statusText)):T(new n.Status(n.Status.Code.UPSTREAM_NOT_FOUND))}function k(i){var h=null,S=null,M=0,_=-1,R=0,b=new Array;function F(){if(!a.isConnected()){h!==null&&clearInterval(h);return}if(!(i.readyState<2)){var N;try{N=i.status}catch{N=200}if(!S&&N===200&&(S=r()),i.readyState===3||i.readyState===4){if(p(),c===g&&(i.readyState===3&&!h?h=setInterval(F,30):i.readyState===4&&h&&clearInterval(h)),i.status===0){a.disconnect();return}else if(i.status!==200){P(i);return}var B;try{B=i.responseText}catch{return}for(;_<B.length;){if(_>=R){var U=B.substring(R,_),z=B.substring(_,_+1);if(b.push(U),z===";"){var K=b.shift();a.oninstruction&&a.oninstruction(K,b),b.length=0}R=_+1}var H=B.indexOf(".",R);if(H!==-1){var W=parseInt(B.substring(_+1,H));if(W===0){h&&clearInterval(h),i.onreadystatechange=null,i.abort(),S&&k(S);break}R=H+1,_=R+W}else{R=B.length;break}}}}}c===g?i.onreadystatechange=function(){i.readyState===3&&(M++,M>=2&&(c=v,i.onreadystatechange=F)),F()}:i.onreadystatechange=F,F()}var D=0;function r(){var i=new XMLHttpRequest;return i.open("GET",l+a.uuid+":"+D++),i.setRequestHeader(x,s),i.withCredentials=E,f(i,A),i.send(null),i}this.connect=function(i){p(),a.setState(n.Tunnel.State.CONNECTING);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(h.readyState===4){if(h.status!==200){P(h);return}if(p(),a.setUUID(h.responseText),s=h.getResponseHeader(x),!s){T(new n.Status(n.Status.Code.UPSTREAM_NOT_FOUND));return}a.setState(n.Tunnel.State.OPEN),L=setInterval(function(){a.sendMessage("nop")},O),k(r())}},h.open("POST",o,!0),h.withCredentials=E,f(h,A),h.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),h.send(i)},this.disconnect=function(){T(new n.Status(n.Status.Code.SUCCESS,"Manually closed."))}};n.HTTPTunnel.prototype=new n.Tunnel;n.WebSocketTunnel=function(u){var e=this,t=null,a=null,o=null,l=null,y={"http:":"ws:","https:":"wss:"},g=500,v=0;if(u.substring(0,3)!=="ws:"&&u.substring(0,4)!=="wss:"){var c=y[window.location.protocol];if(u.substring(0,1)==="/")u=c+"//"+window.location.host+u;else{var m=window.location.pathname.lastIndexOf("/"),C=window.location.pathname.substring(0,m+1);u=c+"//"+window.location.host+C+u}}var E=function(){var O=new Date().getTime();e.sendMessage(n.Tunnel.INTERNAL_DATA_OPCODE,"ping",O),v=O},d=function(){window.clearTimeout(a),window.clearTimeout(o),window.clearTimeout(l),e.state===n.Tunnel.State.UNSTABLE&&e.setState(n.Tunnel.State.OPEN),a=window.setTimeout(function(){I(new n.Status(n.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},e.receiveTimeout),o=window.setTimeout(function(){e.setState(n.Tunnel.State.UNSTABLE)},e.unstableThreshold);var O=new Date().getTime(),A=Math.max(v+g-O,0);A>0?l=window.setTimeout(E,A):E()};function I(L){window.clearTimeout(a),window.clearTimeout(o),window.clearTimeout(l),e.state!==n.Tunnel.State.CLOSED&&(L.code!==n.Status.Code.SUCCESS&&e.onerror&&e.onerror(L),e.setState(n.Tunnel.State.CLOSED),t.close())}this.sendMessage=function(L){if(!e.isConnected()||arguments.length===0)return;function O(s){var f=new String(s);return f.length+"."+f}for(var A=O(arguments[0]),x=1;x<arguments.length;x++)A+=","+O(arguments[x]);A+=";",t.send(A)},this.connect=function(L){d(),e.setState(n.Tunnel.State.CONNECTING),t=new WebSocket(u+"?"+L,"guacamole"),t.onopen=function(O){d()},t.onclose=function(O){O.reason?I(new n.Status(parseInt(O.reason),O.reason)):O.code?I(new n.Status(n.Status.Code.fromWebSocketCode(O.code))):I(new n.Status(n.Status.Code.UPSTREAM_NOT_FOUND))},t.onmessage=function(O){d();var A=O.data,x=0,s,f=[];do{var p=A.indexOf(".",x);if(p!==-1){var T=parseInt(A.substring(s+1,p));x=p+1,s=x+T}else I(new n.Status(n.Status.Code.SERVER_ERROR,"Incomplete instruction."));var w=A.substring(x,s),P=A.substring(s,s+1);if(f.push(w),P===";"){var k=f.shift();e.uuid===null&&(k===n.Tunnel.INTERNAL_DATA_OPCODE&&f.length===1&&e.setUUID(f[0]),e.setState(n.Tunnel.State.OPEN)),k!==n.Tunnel.INTERNAL_DATA_OPCODE&&e.oninstruction&&e.oninstruction(k,f),f.length=0}x=s+1}while(x<A.length)}},this.disconnect=function(){I(new n.Status(n.Status.Code.SUCCESS,"Manually closed."))}};n.WebSocketTunnel.prototype=new n.Tunnel;n.ChainedTunnel=function(u){for(var e=this,t,a=[],o=null,l=0;l<arguments.length;l++)a.push(arguments[l]);function y(g){e.disconnect=g.disconnect,e.sendMessage=g.sendMessage;var v=function(C){if(C&&C.code===n.Status.Code.UPSTREAM_TIMEOUT)return a=[],null;var E=a.shift();return E&&(g.onerror=null,g.oninstruction=null,g.onstatechange=null,y(E)),E};function c(){g.onstatechange=e.onstatechange,g.oninstruction=e.oninstruction,g.onerror=e.onerror,g.uuid&&e.setUUID(g.uuid),g.onuuid=function(C){e.setUUID(C)},o=g}g.onstatechange=function(m){switch(m){case n.Tunnel.State.OPEN:c(),e.onstatechange&&e.onstatechange(m);break;case n.Tunnel.State.CLOSED:!v()&&e.onstatechange&&e.onstatechange(m);break}},g.oninstruction=function(m,C){c(),e.oninstruction&&e.oninstruction(m,C)},g.onerror=function(m){!v(m)&&e.onerror&&e.onerror(m)},g.connect(t)}this.connect=function(g){t=g;var v=o||a.shift();v?y(v):e.onerror&&e.onerror(n.Status.Code.SERVER_ERROR,"No tunnels to try.")}};n.ChainedTunnel.prototype=new n.Tunnel;n.StaticHTTPTunnel=function(e,t,a){var o=this,l=null,y=a||{};this.size=null,this.sendMessage=function(v){},this.connect=function(v){o.disconnect(),o.setState(n.Tunnel.State.CONNECTING);var c=new n.Parser,m=new n.UTF8Parser;c.oninstruction=function(E,d){o.oninstruction&&o.oninstruction(E,d)},l=new AbortController,fetch(e,{headers:y,credentials:t?"include":"same-origin",signal:l.signal}).then(function(E){if(!E.ok){o.onerror&&o.onerror(new n.Status(n.Status.Code.fromHTTPCode(E.status),E.statusText)),o.disconnect();return}o.size=E.headers.get("Content-Length"),o.setState(n.Tunnel.State.OPEN);var d=E.body.getReader(),I=function L(O){if(O.done){o.disconnect();return}c.receive(m.decode(O.value)),d.read().then(L)};d.read().then(I)})},this.disconnect=function(){l&&(l.abort(),l=null),o.setState(n.Tunnel.State.CLOSED)}};n.StaticHTTPTunnel.prototype=new n.Tunnel;var n=n||{};n.UTF8Parser=function(){var e=0,t=0;this.decode=function(o){for(var l="",y=new Uint8Array(o),g=0;g<y.length;g++){var v=y[g];e===0?(v|127)===127?l+=String.fromCharCode(v):(v|31)===223?(t=v&31,e=1):(v|15)===239?(t=v&15,e=2):(v|7)===247?(t=v&7,e=3):l+="�":(v|63)===191?(t=t<<6|v&63,e--,e===0&&(l+=String.fromCharCode(t))):(e=0,l+="�")}return l}};var n=n||{};n.API_VERSION="1.5.0";var n=n||{};n.VideoPlayer=function(){this.sync=function(){}};n.VideoPlayer.isSupportedType=function(e){return!1};n.VideoPlayer.getSupportedTypes=function(){return[]};n.VideoPlayer.getInstance=function(e,t,a){return null};const G=n;class j extends G.Tunnel{socket=null;cancelPointerMoves;sendPointer;oninstructionbatch;onauthentication;constructor(e,t,a=()=>!1,o){super();let l=null,y=null,g="0";const v=()=>{y!==null&&cancelAnimationFrame(y),y=null,l=null};this.cancelPointerMoves=v;const c=d=>{this.socket?.readyState!==1||this.state!==G.Tunnel.State.OPEN||this.socket.send(JSON.stringify({type:"instruction",opcode:d[0],args:d.slice(1)}))};this.sendPointer=(d,I,L)=>{v(),g=String(L),c(["mouse",String(d),String(I),g])};const m=()=>{const d=l;v(),d&&c(d)},C=()=>{const d=l;y=null,l=null,d&&(c(d),y=requestAnimationFrame(C))},E=d=>{this.state!==d&&(this.state=d,this.onstatechange?.(d))};this.connect=()=>{E(G.Tunnel.State.CONNECTING);let d=0;const I=new URLSearchParams({host:e.host,protocol:"rdp",port:String(e.port)}),L=this.socket=V(`/api/computer/ws?${I}`);L.onopen=()=>{L.send(JSON.stringify({type:"start",username:e.username,password:e.password,domain:e.domain,ignoreCert:e.ignoreCert,width:e.width,height:e.height,verifyLogin:!0})),e.password=""},L.onmessage=O=>{try{const A=JSON.parse(O.data);if(A.type==="authentication"){if(!["pending","authenticated","unavailable"].includes(A.state))throw new Error("Invalid authentication state");this.onauthentication?.(A.state);return}if(A.type!=="instructions"||A.seq!==d+1||!Array.isArray(A.instructions))throw new Error("Invalid RDP record");d=A.seq;for(const f of A.instructions)if(!Array.isArray(f)||!f.length||f.some(p=>typeof p!="string"))throw new Error("Invalid RDP instruction");const x=()=>{for(const f of A.instructions){const[p,...T]=f;if(p==="ready")this.uuid=T[0],this.onuuid?.(T[0]),E(G.Tunnel.State.OPEN),this.sendMessage("nop");else{const w=p==="mouse"&&a();p==="mouse"&&o?.record("rdp-server-mouse",{x:Number(T[0]),y:Number(T[1]),ignored:w}),w||this.oninstruction?.(p,T)}}},s=A.instructions.filter(f=>f[0]==="sync").length;this.oninstructionbatch&&s>1?this.oninstructionbatch(x,s):x(),L.readyState===1&&L.send(JSON.stringify({type:"ack",seq:A.seq}))}catch{t("COMPUTER_INVALID_MESSAGE"),this.disconnect()}},L.onerror=()=>{},L.onclose=O=>{v(),e.password="",t(O.reason||"COMPUTER_DISCONNECTED"),E(G.Tunnel.State.CLOSED)}},this.disconnect=()=>{v(),e.password="";const d=this.socket;this.socket=null,d&&(d.onclose=null,d.onerror=null,d.onmessage=null,d.onopen=null,d.close()),E(G.Tunnel.State.CLOSED)},this.sendMessage=(...d)=>{if(this.socket?.readyState!==1||this.state!==G.Tunnel.State.OPEN)return;const I=d.map(String);I[0]==="mouse"&&I.length===4&&I[3]===g?y===null?(c(I),y=requestAnimationFrame(C)):l=I:(m(),I[0]==="mouse"&&(g=I[3]),c(I))}}}function Z(u){const e=u.flush;let t=0,a=[],o=0,l=!1;return u.flush=(y,g,v)=>{if(!t){e.call(u,y,g,v);return}if(t--,a.push(y),o+=v||0,t&&a.length<64)return;const c=a,m=o;a=[],o=0,e.call(u,()=>{l||c.forEach(C=>C())},g,m)},{run(y,g){t=g;try{y()}finally{t=0,a=[],o=0}},cancel(){l=!0,t=0,a=[],u.flush=e}}}class le extends EventTarget{constructor(e,t,a,o){super(),this.target=e,this.trace=o,this.requestedSize=`${t.width}x${t.height}`,o?.record("rdp-start",{width:t.width,height:t.height});const l=this.tunnel=new j(t,a,()=>this.localPointer&&!this.readonlyMode,o);l.onauthentication=d=>{this.authenticationPending=d==="pending",this.notifyConnected()},this.client=new G.Client(l),this.display=this.client.getDisplay();const y=this.display.getCursorLayer().getElement();y.style.transition="none",y.style.pointerEvents="none";const g=Z(this.display);this.cancelDisplayBatch=()=>g.cancel(),l.oninstructionbatch=(d,I)=>g.run(d,I),this.container=document.createElement("div"),this.container.className="flex h-full w-full overflow-auto outline-none",this.container.tabIndex=0,this.container.appendChild(this.display.getElement()),e.appendChild(this.container);const v=this.keyboardInput=document.createElement("textarea");v.tabIndex=-1,v.setAttribute("aria-label","Remote desktop keyboard"),v.autocapitalize="off",v.autocomplete="off",v.spellcheck=!1,Object.assign(v.style,{position:"absolute",left:"0",top:"0",width:"1px",height:"1px",fontSize:"16px",opacity:"0",pointerEvents:"none"}),this.container.append(v),v.addEventListener("input",d=>{d.isComposing||(v.value="")},{signal:this.listeners.signal}),v.addEventListener("compositionend",()=>{v.value=""},{signal:this.listeners.signal}),this.keyboard=new G.Keyboard(this.container),this.keyboard.onkeydown=d=>(this.readonlyMode||this.client.sendKeyEvent(1,d),!1),this.keyboard.type=d=>{if(!(this.readonlyMode||this.disposed||!this.connected))for(const I of q(d))this.keyboard.press(I),this.keyboard.release(I)},this.keyboard.onkeyup=d=>{this.readonlyMode||this.client.sendKeyEvent(0,d)};const c=this.display.getElement();c.className="m-auto shrink-0";const m=d=>{this.touchpadPointer||this.readonlyMode||(this.touchpadPointer=!1,this.localPointer=!0,this.client.sendMouseState(d.state,!0))},C=this.mouse=new G.Mouse(c);C.onEach(["mousedown","mousemove","mouseup"],d=>{const I=d.state;o?.record("rdp-native-mouse",{x:I.x,y:I.y,ignored:this.touchpadPointer}),!this.touchpadPointer&&(m(d),this.readonlyMode||this.display.showCursor(!this.nativeCursor))}),C.on("mouseout",()=>{this.touchpadPointer||(this.localPointer=!1,this.display.showCursor(!1))});const E=d=>{o?.record("rdp-pointer-event",{type:d.type,pointerType:d.pointerType,x:d.clientX,y:d.clientY}),d.pointerType==="mouse"&&(this.touchpadPointer=!1)};this.container.addEventListener("pointermove",E,{capture:!0,signal:this.listeners.signal}),this.container.addEventListener("pointerdown",E,{capture:!0,signal:this.listeners.signal}),this.display.oncursor=(d,I,L)=>{o?.record("rdp-cursor-shape",{width:d.width,height:d.height,hotspot:[I,L],actual:[this.display.cursorX,this.display.cursorY]}),this.nativeCursor=C.setCursor(d,I,L),this.localPointer&&!this.readonlyMode&&this.display.showCursor(this.touchpadPointer||!this.nativeCursor)},new G.Mouse.Touchscreen(c).onEach(["mousedown","mousemove","mouseup"],d=>{m(d),this.readonlyMode||this.display.showCursor(!0)}),this.container.addEventListener("pointerdown",d=>{this.phoneKeyboardActive?d.preventDefault():this.keyboardInput.focus({preventScroll:!0})},{signal:this.listeners.signal}),this.container.addEventListener("blur",()=>this.keyboard.reset(),{capture:!0,signal:this.listeners.signal}),window.addEventListener("blur",()=>{this.keyboard.reset(),C.reset()},{signal:this.listeners.signal}),this.observer=new ResizeObserver(()=>{this.scale(),this.scheduleResize()}),this.observer.observe(e),this.display.onresize=()=>{this.scale(),this.notifyConnected()},this.client.onstatechange=d=>{this.disposed||(d===G.Client.State.CONNECTED&&(this.connected=!0,this.notifyConnected(),this.scheduleResize()),d===G.Client.State.DISCONNECTED&&a("COMPUTER_DISCONNECTED"))},this.client.onclipboard=(d,I)=>{const L=++this.clipboardGeneration;if(!/^text\/plain(?:;|$)/i.test(I)){d.sendAck("Only plain text clipboard is supported",256);return}const O=new G.ArrayBufferReader(d),A=new TextDecoder("utf-8",{fatal:!0});let x="",s=!1,f=0;const p=()=>{s||(s=!0,x="",d.sendAck("Invalid or oversized text clipboard",768),this.dispatchEvent(new Event("clipboarderror")))};O.ondata=T=>{if(!(s||this.disposed||L!==this.clipboardGeneration)){f+=T.byteLength;try{if(f>Y*4){p();return}x+=A.decode(T,{stream:!0}),x.length>Y&&p()}catch{p()}}},O.onend=()=>{if(!(s||this.disposed||L!==this.clipboardGeneration)){try{x+=A.decode()}catch{p();return}if(x.length>Y){p();return}this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:x}}))}}},this.client.onname=d=>this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:d}})),this.client.onerror=d=>{const I=/certificate/i.test(d.message||"")?"COMPUTER_RDP_CERTIFICATE":[769,771].includes(d.code)?"COMPUTER_AUTH_FAILED":d.code===514?"COMPUTER_CONNECT_TIMEOUT":"COMPUTER_RDP_FAILED";a(I)},this.client.connect()}target;trace;client;tunnel;keyboard;mouse;keyboardInput;display;container;observer;listeners=new AbortController;readonlyMode=!1;fit=!0;zoom=1;resizePaused=!1;disposed=!1;connected=!1;authenticationPending=!1;connectionNotified=!1;phoneKeyboardActive=!1;viewportScale=1;keyboardScale=null;resizeTimer;requestedSize;clipboardGeneration=0;localPointer=!1;nativeCursor=!1;touchpadPointer=!1;cancelDisplayBatch;notifyConnected(){!this.connected||!this.display.getWidth()||!this.display.getHeight()||this.authenticationPending||this.connectionNotified||this.disposed||(this.connectionNotified=!0,this.dispatchEvent(new Event("connect")),this.scheduleResize())}scale(){const e=this.display.getWidth(),t=this.display.getHeight();!this.target.clientWidth||!this.target.clientHeight||(this.viewportScale=this.fit&&e&&t?Math.min(this.target.clientWidth/e,this.keyboardScale??this.target.clientHeight/t):1,this.display.scale(this.viewportScale*this.zoom),this.trace?.record("rdp-scale",{desktop:[e,t],viewport:[this.target.clientWidth,this.target.clientHeight],scale:this.viewportScale,zoom:this.zoom}))}scheduleResize(){clearTimeout(this.resizeTimer),!(!this.connected||!this.connectionNotified||this.disposed||!this.fit||this.resizePaused)&&(this.resizeTimer=setTimeout(()=>{const e=this.target.clientWidth,t=this.target.clientHeight;if(!e||!t||!this.connectionNotified||this.disposed||!this.fit||this.resizePaused)return;const{width:a,height:o}=J(e,t),l=`${a}x${o}`;l!==this.requestedSize&&(this.requestedSize=l,this.client.sendSize(a,o))},150))}set scaleViewport(e){this.fit=e,this.scale(),this.scheduleResize()}set viewportZoom(e){this.zoom=e,this.scale()}get viewportZoom(){return this.zoom}get viewportScroller(){return this.container}set pauseResize(e){this.resizePaused=e,this.scheduleResize()}set keyboardActive(e){e!==this.phoneKeyboardActive&&(this.keyboardScale=e?this.viewportScale:null,this.phoneKeyboardActive=e,this.keyboard.reset(),this.scale())}get pointerTarget(){return{position:()=>({x:this.display.cursorX,y:this.display.cursorY}),observeCursor:()=>{const e=this.display.getCursorLayer().getElement();return{transform:e.style.transform,connected:e.isConnected,scale:this.viewportScale*this.zoom,hotspot:[this.display.cursorHotspotX,this.display.cursorHotspotY]}},size:()=>({width:this.display.getWidth(),height:this.display.getHeight()}),surface:()=>this.display.getElement(),send:(e,t,a)=>{this.readonlyMode||this.disposed||!this.connected||(this.localPointer=!0,this.touchpadPointer=!0,this.display.moveCursor(e,t),this.display.showCursor(!0),this.tunnel.sendPointer(e,t,a))}}}set viewOnly(e){this.tunnel.cancelPointerMoves(),this.keyboard.reset(),this.mouse.reset(),this.readonlyMode=e,this.localPointer=!1,e&&this.display.showCursor(!1)}focus(e={preventScroll:!0}){!this.phoneKeyboardActive&&!this.readonlyMode&&!this.disposed&&this.keyboardInput.focus(e)}sendKey(e,t,a=!0){!this.readonlyMode&&!this.disposed&&this.client.sendKeyEvent(a?1:0,e)}clipboardPasteFrom(e){if(this.readonlyMode||this.disposed)return;if(e.length>Y)throw new RangeError("Clipboard is too large");const t=new G.ArrayBufferWriter(this.client.createClipboardStream("text/plain"));t.onack=a=>{a.isError()&&!this.disposed&&this.dispatchEvent(new Event("clipboarderror"))},t.sendData(new TextEncoder().encode(e)),t.sendEnd()}disconnect(){this.disposed||(this.disposed=!0,this.tunnel.cancelPointerMoves(),this.keyboard.reset(),this.mouse.reset(),this.listeners.abort(),this.observer.disconnect(),this.cancelDisplayBatch(),this.display.cancel?.(),clearTimeout(this.resizeTimer),this.trace?.record("rdp-disconnect"),this.trace?.flush("rdp-disconnect"),this.client.disconnect(),this.container.remove())}}export{le as RdpSession};