@baasix/baasix 0.1.0

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 (666) hide show
  1. package/LICENSE.MD +85 -0
  2. package/README.md +526 -0
  3. package/assets/banner.jpg +0 -0
  4. package/assets/banner_small.jpg +0 -0
  5. package/assets/logo_icon.svg +20 -0
  6. package/assets/logo_icon_rounded.svg +20 -0
  7. package/dist/LICENSE.MD +85 -0
  8. package/dist/README.md +526 -0
  9. package/dist/app/404/index.html +1 -0
  10. package/dist/app/404.html +1 -0
  11. package/dist/app/_next/static/chunks/041e1f03-56ae8a902a7f2fe6.js +24 -0
  12. package/dist/app/_next/static/chunks/1117-05479929a8da73e3.js +1 -0
  13. package/dist/app/_next/static/chunks/1299.77cc7b7b76b75cba.js +1 -0
  14. package/dist/app/_next/static/chunks/1303-35a96e9c9cdeab9d.js +1 -0
  15. package/dist/app/_next/static/chunks/1509-56ac00cdaaecdf53.js +1 -0
  16. package/dist/app/_next/static/chunks/1668-e3eabd0f6753c780.js +1 -0
  17. package/dist/app/_next/static/chunks/1783-d9fb550fd324300c.js +1 -0
  18. package/dist/app/_next/static/chunks/2117-29b5fa47421595ad.js +2 -0
  19. package/dist/app/_next/static/chunks/2344.35b46d2179a765b5.js +1 -0
  20. package/dist/app/_next/static/chunks/257.990da16794a31292.js +1 -0
  21. package/dist/app/_next/static/chunks/2676-73b0ee7c80073a84.js +1 -0
  22. package/dist/app/_next/static/chunks/3563-b8842744384391fe.js +1 -0
  23. package/dist/app/_next/static/chunks/363642f4-933b579ed3c85f60.js +1 -0
  24. package/dist/app/_next/static/chunks/3817-e20c8f0a0810fc95.js +1 -0
  25. package/dist/app/_next/static/chunks/3834.84944e390d902509.js +2 -0
  26. package/dist/app/_next/static/chunks/4043-3a30c8a75896f241.js +1 -0
  27. package/dist/app/_next/static/chunks/4225-14090c7c0cd9dec6.js +1 -0
  28. package/dist/app/_next/static/chunks/4438-c9a12ca15b6e9160.js +1 -0
  29. package/dist/app/_next/static/chunks/4458-679fd0c6884f456a.js +1 -0
  30. package/dist/app/_next/static/chunks/4475-8bdfbd536fba8c48.js +1 -0
  31. package/dist/app/_next/static/chunks/4883-8a924721bb21b3b0.js +1 -0
  32. package/dist/app/_next/static/chunks/489-683ab07188f9df2b.js +1 -0
  33. package/dist/app/_next/static/chunks/4952-1b97320cf61f3f21.js +1 -0
  34. package/dist/app/_next/static/chunks/5094-8d53e403235d4ca6.js +1 -0
  35. package/dist/app/_next/static/chunks/5101-3a146e0625747ad1.js +1 -0
  36. package/dist/app/_next/static/chunks/54a60aa6-d9747982e0a81f58.js +79 -0
  37. package/dist/app/_next/static/chunks/5650-f096291df402bfc2.js +1 -0
  38. package/dist/app/_next/static/chunks/600-539045311240f579.js +1 -0
  39. package/dist/app/_next/static/chunks/6170-803b82e19d3ade6d.js +89 -0
  40. package/dist/app/_next/static/chunks/6241-30d7169d1010e5a4.js +1 -0
  41. package/dist/app/_next/static/chunks/6530-a91e10cffa4200c4.js +1 -0
  42. package/dist/app/_next/static/chunks/6547-4bbbdb5c399aef1e.js +1 -0
  43. package/dist/app/_next/static/chunks/6712-781937c53a2c49da.js +1 -0
  44. package/dist/app/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js +1 -0
  45. package/dist/app/_next/static/chunks/70e0d97a-aeaf0cdc26ba1a58.js +1 -0
  46. package/dist/app/_next/static/chunks/7214-5154a89d08d24dde.js +1 -0
  47. package/dist/app/_next/static/chunks/7324-b53229c59a640880.js +10 -0
  48. package/dist/app/_next/static/chunks/7636-66424f0b51d350e9.js +1 -0
  49. package/dist/app/_next/static/chunks/7874-39a3f2541165a675.js +1 -0
  50. package/dist/app/_next/static/chunks/7982-9da12b83f11e3f5f.js +1 -0
  51. package/dist/app/_next/static/chunks/8213a2eb-da25a3b3c5521b2b.js +1 -0
  52. package/dist/app/_next/static/chunks/8473-6598318371eca31b.js +1 -0
  53. package/dist/app/_next/static/chunks/8640fa6b-72e43370f68e5587.js +1 -0
  54. package/dist/app/_next/static/chunks/9090-3ef676f29c95f1c7.js +1 -0
  55. package/dist/app/_next/static/chunks/9124-a02f9e209e6e3cce.js +1 -0
  56. package/dist/app/_next/static/chunks/926-156f32067d111d6b.js +1 -0
  57. package/dist/app/_next/static/chunks/9487-b17481605e513b83.js +1 -0
  58. package/dist/app/_next/static/chunks/9599-a7e572bb88c3392b.js +1 -0
  59. package/dist/app/_next/static/chunks/9881-419697138376e755.js +1 -0
  60. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/all-activity/page-8917930b4d663405.js +1 -0
  61. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/email-log/page-b27a6ee32782d7df.js +1 -0
  62. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/notifications/page-b7eda523ede2702c.js +1 -0
  63. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/page-1cfa62d1caedaed0.js +1 -0
  64. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/sessions/page-3e21e20db90aeff7.js +1 -0
  65. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-executions/page-27bcc26b747fb29b.js +1 -0
  66. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-logs/page-9f9e9e952aef436e.js +1 -0
  67. package/dist/app/_next/static/chunks/app/(authenticated)/change-password/page-8d61aa499eabb127.js +1 -0
  68. package/dist/app/_next/static/chunks/app/(authenticated)/dashboard/page-1ceeac9e72997a8a.js +1 -0
  69. package/dist/app/_next/static/chunks/app/(authenticated)/data-browser/page-8cda2b57759dd670.js +1 -0
  70. package/dist/app/_next/static/chunks/app/(authenticated)/file-manager/page-8c6f1b1da66ad7e4.js +1 -0
  71. package/dist/app/_next/static/chunks/app/(authenticated)/layout-f70d225b2759c998.js +1 -0
  72. package/dist/app/_next/static/chunks/app/(authenticated)/settings/migrations/page-aacec8f7cfb40ab2.js +1 -0
  73. package/dist/app/_next/static/chunks/app/(authenticated)/settings/permissions/page-828110cfcde429c6.js +1 -0
  74. package/dist/app/_next/static/chunks/app/(authenticated)/settings/project/page-420e794bb76bd204.js +1 -0
  75. package/dist/app/_next/static/chunks/app/(authenticated)/settings/roles/page-9001d02b28f70708.js +1 -0
  76. package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-899574f35091dd58.js +1 -0
  77. package/dist/app/_next/static/chunks/app/(authenticated)/settings/tasks/page-ad7ab3e27c83f44f.js +1 -0
  78. package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/edit/page-bd83414cb8c4cb04.js +1 -0
  79. package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/page-3181447f8772b1d3.js +1 -0
  80. package/dist/app/_next/static/chunks/app/(authenticated)/settings/tenants/page-ef9bfbacef5a1d73.js +1 -0
  81. package/dist/app/_next/static/chunks/app/(authenticated)/users/invites/page-480306b7b2bbac7e.js +1 -0
  82. package/dist/app/_next/static/chunks/app/(authenticated)/users/list/page-74da51254c2606b3.js +1 -0
  83. package/dist/app/_next/static/chunks/app/(authenticated)/users/page-e99c6f0b915001b2.js +1 -0
  84. package/dist/app/_next/static/chunks/app/(authenticated)/users/preferences/page-1a935630ce8f2b12.js +1 -0
  85. package/dist/app/_next/static/chunks/app/(authenticated)/users/user-roles/page-901dfb8ea1f39ca8.js +1 -0
  86. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/detail/page-9a6b839aea688ca4.js +1 -0
  87. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/edit/page-11774efbc2fecae2.js +1 -0
  88. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/execution/page-8ec1aea90412c03d.js +1 -0
  89. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/page-88bc5b36ccb0a1f7.js +1 -0
  90. package/dist/app/_next/static/chunks/app/(public)/forgot-password/page-ed263fd46ef81c20.js +1 -0
  91. package/dist/app/_next/static/chunks/app/(public)/layout-f538977545844af8.js +1 -0
  92. package/dist/app/_next/static/chunks/app/(public)/login/page-c0a10b137f346096.js +1 -0
  93. package/dist/app/_next/static/chunks/app/(public)/register/page-4cb7644893efd9b3.js +1 -0
  94. package/dist/app/_next/static/chunks/app/_not-found/page-653f8815b78256cc.js +1 -0
  95. package/dist/app/_next/static/chunks/app/layout-591ca7a3e16528a1.js +1 -0
  96. package/dist/app/_next/static/chunks/app/page-dd19d124b5fa2577.js +1 -0
  97. package/dist/app/_next/static/chunks/c37d3baf.c2ff165f5b02c692.js +1 -0
  98. package/dist/app/_next/static/chunks/d0deef33.0379166a4ec23470.js +1 -0
  99. package/dist/app/_next/static/chunks/fd9d1056-54169f07cd680d6c.js +1 -0
  100. package/dist/app/_next/static/chunks/framework-8e0e0f4a6b83a956.js +1 -0
  101. package/dist/app/_next/static/chunks/main-324e91f5a430cddf.js +1 -0
  102. package/dist/app/_next/static/chunks/main-app-55bcae20c77aaf0e.js +1 -0
  103. package/dist/app/_next/static/chunks/pages/_app-3c9ca398d360b709.js +1 -0
  104. package/dist/app/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js +1 -0
  105. package/dist/app/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  106. package/dist/app/_next/static/chunks/webpack-2c306566f7ee1b63.js +1 -0
  107. package/dist/app/_next/static/css/6c4002bae4e236b2.css +3 -0
  108. package/dist/app/_next/static/css/a275cc2b185e04f8.css +1 -0
  109. package/dist/app/_next/static/eCWhKA8XHqmB1zgFcEtN2/_buildManifest.js +1 -0
  110. package/dist/app/_next/static/eCWhKA8XHqmB1zgFcEtN2/_ssgManifest.js +1 -0
  111. package/dist/app/activity-log/all-activity/index.html +1 -0
  112. package/dist/app/activity-log/all-activity/index.txt +14 -0
  113. package/dist/app/activity-log/email-log/index.html +1 -0
  114. package/dist/app/activity-log/email-log/index.txt +14 -0
  115. package/dist/app/activity-log/index.html +1 -0
  116. package/dist/app/activity-log/index.txt +14 -0
  117. package/dist/app/activity-log/notifications/index.html +1 -0
  118. package/dist/app/activity-log/notifications/index.txt +14 -0
  119. package/dist/app/activity-log/sessions/index.html +1 -0
  120. package/dist/app/activity-log/sessions/index.txt +14 -0
  121. package/dist/app/activity-log/workflow-executions/index.html +1 -0
  122. package/dist/app/activity-log/workflow-executions/index.txt +14 -0
  123. package/dist/app/activity-log/workflow-logs/index.html +1 -0
  124. package/dist/app/activity-log/workflow-logs/index.txt +14 -0
  125. package/dist/app/change-password/index.html +1 -0
  126. package/dist/app/change-password/index.txt +14 -0
  127. package/dist/app/dashboard/index.html +1 -0
  128. package/dist/app/dashboard/index.txt +14 -0
  129. package/dist/app/data-browser/index.html +1 -0
  130. package/dist/app/data-browser/index.txt +14 -0
  131. package/dist/app/file-manager/index.html +1 -0
  132. package/dist/app/file-manager/index.txt +14 -0
  133. package/dist/app/forgot-password/index.html +1 -0
  134. package/dist/app/forgot-password/index.txt +13 -0
  135. package/dist/app/index.html +1 -0
  136. package/dist/app/index.txt +9 -0
  137. package/dist/app/login/index.html +1 -0
  138. package/dist/app/login/index.txt +13 -0
  139. package/dist/app/logo-dark.png +0 -0
  140. package/dist/app/logo-icon.svg +81 -0
  141. package/dist/app/logo-light.png +0 -0
  142. package/dist/app/register/index.html +1 -0
  143. package/dist/app/register/index.txt +13 -0
  144. package/dist/app/settings/migrations/index.html +1 -0
  145. package/dist/app/settings/migrations/index.txt +14 -0
  146. package/dist/app/settings/permissions/index.html +1 -0
  147. package/dist/app/settings/permissions/index.txt +14 -0
  148. package/dist/app/settings/project/index.html +1 -0
  149. package/dist/app/settings/project/index.txt +14 -0
  150. package/dist/app/settings/roles/index.html +1 -0
  151. package/dist/app/settings/roles/index.txt +14 -0
  152. package/dist/app/settings/schema/index.html +1 -0
  153. package/dist/app/settings/schema/index.txt +14 -0
  154. package/dist/app/settings/tasks/index.html +1 -0
  155. package/dist/app/settings/tasks/index.txt +14 -0
  156. package/dist/app/settings/templates/edit/index.html +1 -0
  157. package/dist/app/settings/templates/edit/index.txt +14 -0
  158. package/dist/app/settings/templates/index.html +1 -0
  159. package/dist/app/settings/templates/index.txt +14 -0
  160. package/dist/app/settings/tenants/index.html +1 -0
  161. package/dist/app/settings/tenants/index.txt +14 -0
  162. package/dist/app/users/index.html +1 -0
  163. package/dist/app/users/index.txt +14 -0
  164. package/dist/app/users/invites/index.html +1 -0
  165. package/dist/app/users/invites/index.txt +14 -0
  166. package/dist/app/users/list/index.html +1 -0
  167. package/dist/app/users/list/index.txt +14 -0
  168. package/dist/app/users/preferences/index.html +1 -0
  169. package/dist/app/users/preferences/index.txt +14 -0
  170. package/dist/app/users/user-roles/index.html +1 -0
  171. package/dist/app/users/user-roles/index.txt +14 -0
  172. package/dist/app/workflows/detail/index.html +1 -0
  173. package/dist/app/workflows/detail/index.txt +14 -0
  174. package/dist/app/workflows/edit/index.html +1 -0
  175. package/dist/app/workflows/edit/index.txt +14 -0
  176. package/dist/app/workflows/execution/index.html +1 -0
  177. package/dist/app/workflows/execution/index.txt +14 -0
  178. package/dist/app/workflows/index.html +1 -0
  179. package/dist/app/workflows/index.txt +14 -0
  180. package/dist/app.d.ts +36 -0
  181. package/dist/app.d.ts.map +1 -0
  182. package/dist/app.js +546 -0
  183. package/dist/app.js.map +1 -0
  184. package/dist/auth/adapters/baasix-adapter.d.ts +12 -0
  185. package/dist/auth/adapters/baasix-adapter.d.ts.map +1 -0
  186. package/dist/auth/adapters/baasix-adapter.js +318 -0
  187. package/dist/auth/adapters/baasix-adapter.js.map +1 -0
  188. package/dist/auth/adapters/index.d.ts +6 -0
  189. package/dist/auth/adapters/index.d.ts.map +1 -0
  190. package/dist/auth/adapters/index.js +5 -0
  191. package/dist/auth/adapters/index.js.map +1 -0
  192. package/dist/auth/core.d.ts +73 -0
  193. package/dist/auth/core.d.ts.map +1 -0
  194. package/dist/auth/core.js +528 -0
  195. package/dist/auth/core.js.map +1 -0
  196. package/dist/auth/index.d.ts +56 -0
  197. package/dist/auth/index.d.ts.map +1 -0
  198. package/dist/auth/index.js +58 -0
  199. package/dist/auth/index.js.map +1 -0
  200. package/dist/auth/oauth2/index.d.ts +5 -0
  201. package/dist/auth/oauth2/index.d.ts.map +1 -0
  202. package/dist/auth/oauth2/index.js +5 -0
  203. package/dist/auth/oauth2/index.js.map +1 -0
  204. package/dist/auth/oauth2/utils.d.ts +90 -0
  205. package/dist/auth/oauth2/utils.d.ts.map +1 -0
  206. package/dist/auth/oauth2/utils.js +167 -0
  207. package/dist/auth/oauth2/utils.js.map +1 -0
  208. package/dist/auth/providers/apple.d.ts +28 -0
  209. package/dist/auth/providers/apple.d.ts.map +1 -0
  210. package/dist/auth/providers/apple.js +192 -0
  211. package/dist/auth/providers/apple.js.map +1 -0
  212. package/dist/auth/providers/credential.d.ts +87 -0
  213. package/dist/auth/providers/credential.d.ts.map +1 -0
  214. package/dist/auth/providers/credential.js +162 -0
  215. package/dist/auth/providers/credential.js.map +1 -0
  216. package/dist/auth/providers/facebook.d.ts +26 -0
  217. package/dist/auth/providers/facebook.d.ts.map +1 -0
  218. package/dist/auth/providers/facebook.js +112 -0
  219. package/dist/auth/providers/facebook.js.map +1 -0
  220. package/dist/auth/providers/github.d.ts +29 -0
  221. package/dist/auth/providers/github.d.ts.map +1 -0
  222. package/dist/auth/providers/github.js +144 -0
  223. package/dist/auth/providers/github.js.map +1 -0
  224. package/dist/auth/providers/google.d.ts +32 -0
  225. package/dist/auth/providers/google.d.ts.map +1 -0
  226. package/dist/auth/providers/google.js +145 -0
  227. package/dist/auth/providers/google.js.map +1 -0
  228. package/dist/auth/providers/index.d.ts +22 -0
  229. package/dist/auth/providers/index.d.ts.map +1 -0
  230. package/dist/auth/providers/index.js +17 -0
  231. package/dist/auth/providers/index.js.map +1 -0
  232. package/dist/auth/routes.d.ts +63 -0
  233. package/dist/auth/routes.d.ts.map +1 -0
  234. package/dist/auth/routes.js +827 -0
  235. package/dist/auth/routes.js.map +1 -0
  236. package/dist/auth/services/index.d.ts +10 -0
  237. package/dist/auth/services/index.d.ts.map +1 -0
  238. package/dist/auth/services/index.js +7 -0
  239. package/dist/auth/services/index.js.map +1 -0
  240. package/dist/auth/services/session.d.ts +81 -0
  241. package/dist/auth/services/session.d.ts.map +1 -0
  242. package/dist/auth/services/session.js +186 -0
  243. package/dist/auth/services/session.js.map +1 -0
  244. package/dist/auth/services/token.d.ts +41 -0
  245. package/dist/auth/services/token.d.ts.map +1 -0
  246. package/dist/auth/services/token.js +44 -0
  247. package/dist/auth/services/token.js.map +1 -0
  248. package/dist/auth/services/verification.d.ts +77 -0
  249. package/dist/auth/services/verification.d.ts.map +1 -0
  250. package/dist/auth/services/verification.js +143 -0
  251. package/dist/auth/services/verification.js.map +1 -0
  252. package/dist/auth/types.d.ts +318 -0
  253. package/dist/auth/types.d.ts.map +1 -0
  254. package/dist/auth/types.js +6 -0
  255. package/dist/auth/types.js.map +1 -0
  256. package/dist/customTypes/arrays.d.ts +200 -0
  257. package/dist/customTypes/arrays.d.ts.map +1 -0
  258. package/dist/customTypes/arrays.js +309 -0
  259. package/dist/customTypes/arrays.js.map +1 -0
  260. package/dist/customTypes/index.d.ts +8 -0
  261. package/dist/customTypes/index.d.ts.map +1 -0
  262. package/dist/customTypes/index.js +11 -0
  263. package/dist/customTypes/index.js.map +1 -0
  264. package/dist/customTypes/postgis.d.ts +146 -0
  265. package/dist/customTypes/postgis.d.ts.map +1 -0
  266. package/dist/customTypes/postgis.js +315 -0
  267. package/dist/customTypes/postgis.js.map +1 -0
  268. package/dist/customTypes/ranges.d.ts +128 -0
  269. package/dist/customTypes/ranges.d.ts.map +1 -0
  270. package/dist/customTypes/ranges.js +257 -0
  271. package/dist/customTypes/ranges.js.map +1 -0
  272. package/dist/index.d.ts +37 -0
  273. package/dist/index.d.ts.map +1 -0
  274. package/dist/index.js +42 -0
  275. package/dist/index.js.map +1 -0
  276. package/dist/migrations/0.1.0-alpha.0_initial_setup.d.ts +29 -0
  277. package/dist/migrations/0.1.0-alpha.0_initial_setup.d.ts.map +1 -0
  278. package/dist/migrations/0.1.0-alpha.0_initial_setup.js +72 -0
  279. package/dist/migrations/0.1.0-alpha.0_initial_setup.js.map +1 -0
  280. package/dist/migrations/_example_migration.d.ts +31 -0
  281. package/dist/migrations/_example_migration.d.ts.map +1 -0
  282. package/dist/migrations/_example_migration.js +75 -0
  283. package/dist/migrations/_example_migration.js.map +1 -0
  284. package/dist/plugins/definePlugin.d.ts +49 -0
  285. package/dist/plugins/definePlugin.d.ts.map +1 -0
  286. package/dist/plugins/definePlugin.js +131 -0
  287. package/dist/plugins/definePlugin.js.map +1 -0
  288. package/dist/plugins/softDelete.d.ts +179 -0
  289. package/dist/plugins/softDelete.d.ts.map +1 -0
  290. package/dist/plugins/softDelete.js +235 -0
  291. package/dist/plugins/softDelete.js.map +1 -0
  292. package/dist/routes/auth.route.d.ts +14 -0
  293. package/dist/routes/auth.route.d.ts.map +1 -0
  294. package/dist/routes/auth.route.js +421 -0
  295. package/dist/routes/auth.route.js.map +1 -0
  296. package/dist/routes/file.route.d.ts +7 -0
  297. package/dist/routes/file.route.d.ts.map +1 -0
  298. package/dist/routes/file.route.js +274 -0
  299. package/dist/routes/file.route.js.map +1 -0
  300. package/dist/routes/items.route.d.ts +7 -0
  301. package/dist/routes/items.route.d.ts.map +1 -0
  302. package/dist/routes/items.route.js +369 -0
  303. package/dist/routes/items.route.js.map +1 -0
  304. package/dist/routes/migration.route.d.ts +7 -0
  305. package/dist/routes/migration.route.d.ts.map +1 -0
  306. package/dist/routes/migration.route.js +225 -0
  307. package/dist/routes/migration.route.js.map +1 -0
  308. package/dist/routes/notification.route.d.ts +7 -0
  309. package/dist/routes/notification.route.d.ts.map +1 -0
  310. package/dist/routes/notification.route.js +124 -0
  311. package/dist/routes/notification.route.js.map +1 -0
  312. package/dist/routes/openapi.route.d.ts +7 -0
  313. package/dist/routes/openapi.route.d.ts.map +1 -0
  314. package/dist/routes/openapi.route.js +2169 -0
  315. package/dist/routes/openapi.route.js.map +1 -0
  316. package/dist/routes/permission.route.d.ts +7 -0
  317. package/dist/routes/permission.route.d.ts.map +1 -0
  318. package/dist/routes/permission.route.js +158 -0
  319. package/dist/routes/permission.route.js.map +1 -0
  320. package/dist/routes/realtime.route.d.ts +21 -0
  321. package/dist/routes/realtime.route.d.ts.map +1 -0
  322. package/dist/routes/realtime.route.js +243 -0
  323. package/dist/routes/realtime.route.js.map +1 -0
  324. package/dist/routes/reports.route.d.ts +7 -0
  325. package/dist/routes/reports.route.d.ts.map +1 -0
  326. package/dist/routes/reports.route.js +95 -0
  327. package/dist/routes/reports.route.js.map +1 -0
  328. package/dist/routes/schema.route.d.ts +7 -0
  329. package/dist/routes/schema.route.d.ts.map +1 -0
  330. package/dist/routes/schema.route.js +1780 -0
  331. package/dist/routes/schema.route.js.map +1 -0
  332. package/dist/routes/settings.route.d.ts +7 -0
  333. package/dist/routes/settings.route.d.ts.map +1 -0
  334. package/dist/routes/settings.route.js +154 -0
  335. package/dist/routes/settings.route.js.map +1 -0
  336. package/dist/routes/templates.route.d.ts +7 -0
  337. package/dist/routes/templates.route.d.ts.map +1 -0
  338. package/dist/routes/templates.route.js +91 -0
  339. package/dist/routes/templates.route.js.map +1 -0
  340. package/dist/routes/utils.route.d.ts +7 -0
  341. package/dist/routes/utils.route.d.ts.map +1 -0
  342. package/dist/routes/utils.route.js +33 -0
  343. package/dist/routes/utils.route.js.map +1 -0
  344. package/dist/routes/workflow.route.d.ts +7 -0
  345. package/dist/routes/workflow.route.d.ts.map +1 -0
  346. package/dist/routes/workflow.route.js +787 -0
  347. package/dist/routes/workflow.route.js.map +1 -0
  348. package/dist/services/AssetsService.d.ts +39 -0
  349. package/dist/services/AssetsService.d.ts.map +1 -0
  350. package/dist/services/AssetsService.js +255 -0
  351. package/dist/services/AssetsService.js.map +1 -0
  352. package/dist/services/CacheService.d.ts +169 -0
  353. package/dist/services/CacheService.d.ts.map +1 -0
  354. package/dist/services/CacheService.js +722 -0
  355. package/dist/services/CacheService.js.map +1 -0
  356. package/dist/services/FilesService.d.ts +30 -0
  357. package/dist/services/FilesService.d.ts.map +1 -0
  358. package/dist/services/FilesService.js +268 -0
  359. package/dist/services/FilesService.js.map +1 -0
  360. package/dist/services/HooksManager.d.ts +38 -0
  361. package/dist/services/HooksManager.d.ts.map +1 -0
  362. package/dist/services/HooksManager.js +165 -0
  363. package/dist/services/HooksManager.js.map +1 -0
  364. package/dist/services/ItemsService.d.ts +273 -0
  365. package/dist/services/ItemsService.d.ts.map +1 -0
  366. package/dist/services/ItemsService.js +2458 -0
  367. package/dist/services/ItemsService.js.map +1 -0
  368. package/dist/services/MailService.d.ts +76 -0
  369. package/dist/services/MailService.d.ts.map +1 -0
  370. package/dist/services/MailService.js +585 -0
  371. package/dist/services/MailService.js.map +1 -0
  372. package/dist/services/MigrationService.d.ts +243 -0
  373. package/dist/services/MigrationService.d.ts.map +1 -0
  374. package/dist/services/MigrationService.js +914 -0
  375. package/dist/services/MigrationService.js.map +1 -0
  376. package/dist/services/NotificationService.d.ts +35 -0
  377. package/dist/services/NotificationService.d.ts.map +1 -0
  378. package/dist/services/NotificationService.js +159 -0
  379. package/dist/services/NotificationService.js.map +1 -0
  380. package/dist/services/PermissionService.d.ts +128 -0
  381. package/dist/services/PermissionService.d.ts.map +1 -0
  382. package/dist/services/PermissionService.js +373 -0
  383. package/dist/services/PermissionService.js.map +1 -0
  384. package/dist/services/PluginManager.d.ts +138 -0
  385. package/dist/services/PluginManager.d.ts.map +1 -0
  386. package/dist/services/PluginManager.js +463 -0
  387. package/dist/services/PluginManager.js.map +1 -0
  388. package/dist/services/RealtimeService.d.ts +209 -0
  389. package/dist/services/RealtimeService.d.ts.map +1 -0
  390. package/dist/services/RealtimeService.js +978 -0
  391. package/dist/services/RealtimeService.js.map +1 -0
  392. package/dist/services/ReportService.d.ts +13 -0
  393. package/dist/services/ReportService.d.ts.map +1 -0
  394. package/dist/services/ReportService.js +91 -0
  395. package/dist/services/ReportService.js.map +1 -0
  396. package/dist/services/SettingsService.d.ts +60 -0
  397. package/dist/services/SettingsService.d.ts.map +1 -0
  398. package/dist/services/SettingsService.js +474 -0
  399. package/dist/services/SettingsService.js.map +1 -0
  400. package/dist/services/SocketService.d.ts +129 -0
  401. package/dist/services/SocketService.d.ts.map +1 -0
  402. package/dist/services/SocketService.js +600 -0
  403. package/dist/services/SocketService.js.map +1 -0
  404. package/dist/services/StatsService.d.ts +10 -0
  405. package/dist/services/StatsService.d.ts.map +1 -0
  406. package/dist/services/StatsService.js +40 -0
  407. package/dist/services/StatsService.js.map +1 -0
  408. package/dist/services/StorageService.d.ts +20 -0
  409. package/dist/services/StorageService.d.ts.map +1 -0
  410. package/dist/services/StorageService.js +164 -0
  411. package/dist/services/StorageService.js.map +1 -0
  412. package/dist/services/TasksService.d.ts +74 -0
  413. package/dist/services/TasksService.d.ts.map +1 -0
  414. package/dist/services/TasksService.js +404 -0
  415. package/dist/services/TasksService.js.map +1 -0
  416. package/dist/services/WorkflowService.d.ts +305 -0
  417. package/dist/services/WorkflowService.d.ts.map +1 -0
  418. package/dist/services/WorkflowService.js +1811 -0
  419. package/dist/services/WorkflowService.js.map +1 -0
  420. package/dist/templates/logo/logo.png +0 -0
  421. package/dist/templates/mails/default.liquid +23 -0
  422. package/dist/types/aggregation.d.ts +40 -0
  423. package/dist/types/aggregation.d.ts.map +1 -0
  424. package/dist/types/aggregation.js +6 -0
  425. package/dist/types/aggregation.js.map +1 -0
  426. package/dist/types/assets.d.ts +32 -0
  427. package/dist/types/assets.d.ts.map +1 -0
  428. package/dist/types/assets.js +6 -0
  429. package/dist/types/assets.js.map +1 -0
  430. package/dist/types/auth.d.ts +50 -0
  431. package/dist/types/auth.d.ts.map +1 -0
  432. package/dist/types/auth.js +6 -0
  433. package/dist/types/auth.js.map +1 -0
  434. package/dist/types/cache.d.ts +47 -0
  435. package/dist/types/cache.d.ts.map +1 -0
  436. package/dist/types/cache.js +6 -0
  437. package/dist/types/cache.js.map +1 -0
  438. package/dist/types/database.d.ts +16 -0
  439. package/dist/types/database.d.ts.map +1 -0
  440. package/dist/types/database.js +6 -0
  441. package/dist/types/database.js.map +1 -0
  442. package/dist/types/fields.d.ts +71 -0
  443. package/dist/types/fields.d.ts.map +1 -0
  444. package/dist/types/fields.js +6 -0
  445. package/dist/types/fields.js.map +1 -0
  446. package/dist/types/files.d.ts +33 -0
  447. package/dist/types/files.d.ts.map +1 -0
  448. package/dist/types/files.js +6 -0
  449. package/dist/types/files.js.map +1 -0
  450. package/dist/types/hooks.d.ts +29 -0
  451. package/dist/types/hooks.d.ts.map +1 -0
  452. package/dist/types/hooks.js +6 -0
  453. package/dist/types/hooks.js.map +1 -0
  454. package/dist/types/import-export.d.ts +62 -0
  455. package/dist/types/import-export.d.ts.map +1 -0
  456. package/dist/types/import-export.js +6 -0
  457. package/dist/types/import-export.js.map +1 -0
  458. package/dist/types/index.d.ts +31 -0
  459. package/dist/types/index.d.ts.map +1 -0
  460. package/dist/types/index.js +58 -0
  461. package/dist/types/index.js.map +1 -0
  462. package/dist/types/mail.d.ts +34 -0
  463. package/dist/types/mail.d.ts.map +1 -0
  464. package/dist/types/mail.js +6 -0
  465. package/dist/types/mail.js.map +1 -0
  466. package/dist/types/notifications.d.ts +16 -0
  467. package/dist/types/notifications.d.ts.map +1 -0
  468. package/dist/types/notifications.js +6 -0
  469. package/dist/types/notifications.js.map +1 -0
  470. package/dist/types/plugin.d.ts +351 -0
  471. package/dist/types/plugin.d.ts.map +1 -0
  472. package/dist/types/plugin.js +8 -0
  473. package/dist/types/plugin.js.map +1 -0
  474. package/dist/types/query.d.ts +71 -0
  475. package/dist/types/query.d.ts.map +1 -0
  476. package/dist/types/query.js +6 -0
  477. package/dist/types/query.js.map +1 -0
  478. package/dist/types/relations.d.ts +111 -0
  479. package/dist/types/relations.d.ts.map +1 -0
  480. package/dist/types/relations.js +6 -0
  481. package/dist/types/relations.js.map +1 -0
  482. package/dist/types/reports.d.ts +17 -0
  483. package/dist/types/reports.d.ts.map +1 -0
  484. package/dist/types/reports.js +6 -0
  485. package/dist/types/reports.js.map +1 -0
  486. package/dist/types/schema.d.ts +26 -0
  487. package/dist/types/schema.d.ts.map +1 -0
  488. package/dist/types/schema.js +6 -0
  489. package/dist/types/schema.js.map +1 -0
  490. package/dist/types/seed.d.ts +27 -0
  491. package/dist/types/seed.d.ts.map +1 -0
  492. package/dist/types/seed.js +6 -0
  493. package/dist/types/seed.js.map +1 -0
  494. package/dist/types/services.d.ts +68 -0
  495. package/dist/types/services.d.ts.map +1 -0
  496. package/dist/types/services.js +6 -0
  497. package/dist/types/services.js.map +1 -0
  498. package/dist/types/settings.d.ts +36 -0
  499. package/dist/types/settings.d.ts.map +1 -0
  500. package/dist/types/settings.js +6 -0
  501. package/dist/types/settings.js.map +1 -0
  502. package/dist/types/sockets.d.ts +26 -0
  503. package/dist/types/sockets.d.ts.map +1 -0
  504. package/dist/types/sockets.js +6 -0
  505. package/dist/types/sockets.js.map +1 -0
  506. package/dist/types/sort.d.ts +25 -0
  507. package/dist/types/sort.d.ts.map +1 -0
  508. package/dist/types/sort.js +6 -0
  509. package/dist/types/sort.js.map +1 -0
  510. package/dist/types/spatial.d.ts +19 -0
  511. package/dist/types/spatial.d.ts.map +1 -0
  512. package/dist/types/spatial.js +6 -0
  513. package/dist/types/spatial.js.map +1 -0
  514. package/dist/types/stats.d.ts +21 -0
  515. package/dist/types/stats.d.ts.map +1 -0
  516. package/dist/types/stats.js +6 -0
  517. package/dist/types/stats.js.map +1 -0
  518. package/dist/types/storage.d.ts +19 -0
  519. package/dist/types/storage.d.ts.map +1 -0
  520. package/dist/types/storage.js +6 -0
  521. package/dist/types/storage.js.map +1 -0
  522. package/dist/types/tasks.d.ts +14 -0
  523. package/dist/types/tasks.d.ts.map +1 -0
  524. package/dist/types/tasks.js +6 -0
  525. package/dist/types/tasks.js.map +1 -0
  526. package/dist/types/utils.d.ts +54 -0
  527. package/dist/types/utils.d.ts.map +1 -0
  528. package/dist/types/utils.js +6 -0
  529. package/dist/types/utils.js.map +1 -0
  530. package/dist/types/workflow.d.ts +17 -0
  531. package/dist/types/workflow.d.ts.map +1 -0
  532. package/dist/types/workflow.js +6 -0
  533. package/dist/types/workflow.js.map +1 -0
  534. package/dist/utils/aggregationUtils.d.ts +192 -0
  535. package/dist/utils/aggregationUtils.d.ts.map +1 -0
  536. package/dist/utils/aggregationUtils.js +450 -0
  537. package/dist/utils/aggregationUtils.js.map +1 -0
  538. package/dist/utils/auth.d.ts +93 -0
  539. package/dist/utils/auth.d.ts.map +1 -0
  540. package/dist/utils/auth.js +557 -0
  541. package/dist/utils/auth.js.map +1 -0
  542. package/dist/utils/cache.d.ts +64 -0
  543. package/dist/utils/cache.d.ts.map +1 -0
  544. package/dist/utils/cache.js +464 -0
  545. package/dist/utils/cache.js.map +1 -0
  546. package/dist/utils/common.d.ts +53 -0
  547. package/dist/utils/common.d.ts.map +1 -0
  548. package/dist/utils/common.js +162 -0
  549. package/dist/utils/common.js.map +1 -0
  550. package/dist/utils/db.d.ts +101 -0
  551. package/dist/utils/db.d.ts.map +1 -0
  552. package/dist/utils/db.js +413 -0
  553. package/dist/utils/db.js.map +1 -0
  554. package/dist/utils/dirname.d.ts +30 -0
  555. package/dist/utils/dirname.d.ts.map +1 -0
  556. package/dist/utils/dirname.js +95 -0
  557. package/dist/utils/dirname.js.map +1 -0
  558. package/dist/utils/dynamicVariableResolver.d.ts +17 -0
  559. package/dist/utils/dynamicVariableResolver.d.ts.map +1 -0
  560. package/dist/utils/dynamicVariableResolver.js +262 -0
  561. package/dist/utils/dynamicVariableResolver.js.map +1 -0
  562. package/dist/utils/env.d.ts +38 -0
  563. package/dist/utils/env.d.ts.map +1 -0
  564. package/dist/utils/env.js +80 -0
  565. package/dist/utils/env.js.map +1 -0
  566. package/dist/utils/errorHandler.d.ts +14 -0
  567. package/dist/utils/errorHandler.d.ts.map +1 -0
  568. package/dist/utils/errorHandler.js +79 -0
  569. package/dist/utils/errorHandler.js.map +1 -0
  570. package/dist/utils/fieldExpansion.d.ts +30 -0
  571. package/dist/utils/fieldExpansion.d.ts.map +1 -0
  572. package/dist/utils/fieldExpansion.js +145 -0
  573. package/dist/utils/fieldExpansion.js.map +1 -0
  574. package/dist/utils/fieldUtils.d.ts +179 -0
  575. package/dist/utils/fieldUtils.d.ts.map +1 -0
  576. package/dist/utils/fieldUtils.js +424 -0
  577. package/dist/utils/fieldUtils.js.map +1 -0
  578. package/dist/utils/filterOperators.d.ts +472 -0
  579. package/dist/utils/filterOperators.d.ts.map +1 -0
  580. package/dist/utils/filterOperators.js +1229 -0
  581. package/dist/utils/filterOperators.js.map +1 -0
  582. package/dist/utils/importUtils.d.ts +127 -0
  583. package/dist/utils/importUtils.d.ts.map +1 -0
  584. package/dist/utils/importUtils.js +437 -0
  585. package/dist/utils/importUtils.js.map +1 -0
  586. package/dist/utils/index.d.ts +75 -0
  587. package/dist/utils/index.d.ts.map +1 -0
  588. package/dist/utils/index.js +101 -0
  589. package/dist/utils/index.js.map +1 -0
  590. package/dist/utils/logger.d.ts +41 -0
  591. package/dist/utils/logger.d.ts.map +1 -0
  592. package/dist/utils/logger.js +217 -0
  593. package/dist/utils/logger.js.map +1 -0
  594. package/dist/utils/orderUtils.d.ts +117 -0
  595. package/dist/utils/orderUtils.d.ts.map +1 -0
  596. package/dist/utils/orderUtils.js +249 -0
  597. package/dist/utils/orderUtils.js.map +1 -0
  598. package/dist/utils/queryBuilder.d.ts +118 -0
  599. package/dist/utils/queryBuilder.d.ts.map +1 -0
  600. package/dist/utils/queryBuilder.js +489 -0
  601. package/dist/utils/queryBuilder.js.map +1 -0
  602. package/dist/utils/relationLoader.d.ts +65 -0
  603. package/dist/utils/relationLoader.d.ts.map +1 -0
  604. package/dist/utils/relationLoader.js +1081 -0
  605. package/dist/utils/relationLoader.js.map +1 -0
  606. package/dist/utils/relationPathResolver.d.ts +30 -0
  607. package/dist/utils/relationPathResolver.d.ts.map +1 -0
  608. package/dist/utils/relationPathResolver.js +173 -0
  609. package/dist/utils/relationPathResolver.js.map +1 -0
  610. package/dist/utils/relationUtils.d.ts +139 -0
  611. package/dist/utils/relationUtils.d.ts.map +1 -0
  612. package/dist/utils/relationUtils.js +711 -0
  613. package/dist/utils/relationUtils.js.map +1 -0
  614. package/dist/utils/router.d.ts +6 -0
  615. package/dist/utils/router.d.ts.map +1 -0
  616. package/dist/utils/router.js +95 -0
  617. package/dist/utils/router.js.map +1 -0
  618. package/dist/utils/schema.d.ts +88 -0
  619. package/dist/utils/schema.d.ts.map +1 -0
  620. package/dist/utils/schema.js +24 -0
  621. package/dist/utils/schema.js.map +1 -0
  622. package/dist/utils/schemaManager.d.ts +238 -0
  623. package/dist/utils/schemaManager.d.ts.map +1 -0
  624. package/dist/utils/schemaManager.js +1992 -0
  625. package/dist/utils/schemaManager.js.map +1 -0
  626. package/dist/utils/schemaValidator.d.ts +83 -0
  627. package/dist/utils/schemaValidator.d.ts.map +1 -0
  628. package/dist/utils/schemaValidator.js +491 -0
  629. package/dist/utils/schemaValidator.js.map +1 -0
  630. package/dist/utils/seed.d.ts +45 -0
  631. package/dist/utils/seed.d.ts.map +1 -0
  632. package/dist/utils/seed.js +248 -0
  633. package/dist/utils/seed.js.map +1 -0
  634. package/dist/utils/sessionCleanup.d.ts +10 -0
  635. package/dist/utils/sessionCleanup.d.ts.map +1 -0
  636. package/dist/utils/sessionCleanup.js +49 -0
  637. package/dist/utils/sessionCleanup.js.map +1 -0
  638. package/dist/utils/sortUtils.d.ts +117 -0
  639. package/dist/utils/sortUtils.d.ts.map +1 -0
  640. package/dist/utils/sortUtils.js +232 -0
  641. package/dist/utils/sortUtils.js.map +1 -0
  642. package/dist/utils/spatialUtils.d.ts +244 -0
  643. package/dist/utils/spatialUtils.d.ts.map +1 -0
  644. package/dist/utils/spatialUtils.js +359 -0
  645. package/dist/utils/spatialUtils.js.map +1 -0
  646. package/dist/utils/systemschema.d.ts +11040 -0
  647. package/dist/utils/systemschema.d.ts.map +1 -0
  648. package/dist/utils/systemschema.js +1777 -0
  649. package/dist/utils/systemschema.js.map +1 -0
  650. package/dist/utils/tenantUtils.d.ts +34 -0
  651. package/dist/utils/tenantUtils.d.ts.map +1 -0
  652. package/dist/utils/tenantUtils.js +124 -0
  653. package/dist/utils/tenantUtils.js.map +1 -0
  654. package/dist/utils/typeMapper.d.ts +25 -0
  655. package/dist/utils/typeMapper.d.ts.map +1 -0
  656. package/dist/utils/typeMapper.js +282 -0
  657. package/dist/utils/typeMapper.js.map +1 -0
  658. package/dist/utils/valueValidator.d.ts +60 -0
  659. package/dist/utils/valueValidator.d.ts.map +1 -0
  660. package/dist/utils/valueValidator.js +303 -0
  661. package/dist/utils/valueValidator.js.map +1 -0
  662. package/dist/utils/workflow.d.ts +87 -0
  663. package/dist/utils/workflow.d.ts.map +1 -0
  664. package/dist/utils/workflow.js +205 -0
  665. package/dist/utils/workflow.js.map +1 -0
  666. package/package.json +115 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[129],{8567:function(t,e,n){n.r(e),n.d(e,{default:function(){return gz},grapesjs:function(){return gW},usePlugin:function(){return g$}});var o,r,i,a,s,l,c,u,p,d,f,h,g,v,y,m,b,w,_,C,x,S,O,T,P,E,k,A,j,M,D,L,I,N,R,V,F,H,U,B,z,W,$,q,G,K,Y,J,X,Z,Q,tt,te,tn,to,tr,ti,ta,ts,tl,tc,tu,tp,td,tf,th,tg=n(82957).lW,tv={4729:(t,e,n)=>{var o,r,i;i=function(t,e){var n,o,r=Array.prototype.slice;function i(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function a(t,e){return r.call(t,e)}function s(e,n){return null!=e&&(t.isArray(n)||(n=a(arguments,1)),t.all(n,function(t){return t in e}))}var l=(n=!1,o=-1,function(){return n||(o++,n=!0,t.defer(function(){n=!1})),o});function c(){this.registeredObjects=[],this.cidIndexes=[]}function u(e,n,o,r){for(var i,a=0,s=n.length;a<s;a++)if(i=n[a]){if("on"===e){if(!r.objectRegistry.register(i))continue}else if(!r.objectRegistry.unregister(i))continue;t.isFunction(i[e])&&i[e]("all",o,r)}}function p(e,n){var o=n.type,r=n.undoTypes,i=!r[o]||r[o][e];t.isFunction(i)&&i(n.object,n.before,n.after,n.options)}function d(e,n,o,i,a){if(!o.isCurrentlyUndoRedoing&&("undo"!==e||-1!==o.pointer)&&("redo"!==e||o.pointer!==o.length-1)){o.isCurrentlyUndoRedoing=!0;var s,l,c="undo"===e;for(a?l=c&&o.pointer===o.length-1||!c&&-1===o.pointer?t.clone(o.models):r.apply(o.models,c?[0,o.pointer]:[o.pointer,o.length-1]):(s=o.at(c?o.pointer:o.pointer+1),l=i?o.where({magicFusionIndex:s.get("magicFusionIndex")}):[s]),o.pointer+=(c?-1:1)*l.length;s=c?l.pop():l.shift();)s[e]();o.isCurrentlyUndoRedoing=!1,n.trigger(e,n)}}c.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,function(t){return this.registeredObjects[t]},this).concat(this.registeredObjects)}};var f={add:{undo:function(t,e,n,o){t.remove(n,o)},redo:function(t,e,n,o){o.index&&(o.at=o.index),t.add(n,o)},on:function(e,n,o){return{object:n,before:void 0,after:e,options:t.clone(o)}}},remove:{undo:function(t,e,n,o){"index"in o&&(o.at=o.index),t.add(e,o)},redo:function(t,e,n,o){t.remove(e,o)},on:function(e,n,o){return{object:n,before:e,after:void 0,options:t.clone(o)}}},change:{undo:function(e,n,o,r){t.isEmpty(n)?t.each(t.keys(o),e.unset,e):(e.set(n),r&&r.unsetData&&r.unsetData.before&&r.unsetData.before.length&&t.each(r.unsetData.before,e.unset,e))},redo:function(e,n,o,r){t.isEmpty(o)?t.each(t.keys(n),e.unset,e):(e.set(o),r&&r.unsetData&&r.unsetData.after&&r.unsetData.after.length&&t.each(r.unsetData.after,e.unset,e))},on:function(e,n){var o=e.changedAttributes(),r=t.keys(o),i=t.pick(e.previousAttributes(),r),a=t.keys(i),s=(n||(n={})).unsetData={after:[],before:[]};return r.length!=a.length&&(r.length>a.length?t.each(r,function(t){t in i||s.before.push(t)},this):t.each(a,function(t){t in o||s.after.push(t)})),{object:e,before:i,after:o,options:t.clone(n)}}},reset:{undo:function(t,e,n){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};function h(){}function g(e,n,o,r){if("object"==typeof n)return t.each(n,function(t,n){2===e?g(e,t,o,r):g(e,n,t,o)});switch(e){case 0:s(o,"undo","redo","on")&&t.all(t.pick(o,"undo","redo","on"),t.isFunction)&&(r[n]=o);break;case 1:r[n]&&t.isObject(o)&&(r[n]=t.extend({},r[n],o));break;case 2:delete r[n]}return this}h.prototype=f;var v=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){p("undo",this.attributes)},redo:function(t){p("redo",this.attributes)}}),y=e.Collection.extend({model:v,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),m=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new y,this.objectRegistry=new c,this.undoTypes=new h,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(t,e){this.stack.setMaxLength(e)},this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?i(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){!function(t,e,n,o){if(t.track&&!t.isCurrentlyUndoRedoing&&e in o&&("function"==(c=typeof(a=(r=o[e]).condition))?!!i(a,r,n):"boolean"!==c||a)){var r,a,c,u,p=i(o[e].on,o[e],n);if(s(p,"object","before","after")){if(p.type=e,p.magicFusionIndex=l(),p.undoTypes=o,t.pointer<t.length-1)for(var u=t.length-t.pointer-1;u--;)t.pop();t.pointer=t.length,t.add(p),t.length>t.maximumStackLength&&(t.shift(),t.pointer--)}}}(this.stack,t,a(arguments,1),this.undoTypes)},register:function(){u("on",arguments,this._addToStack,this)},unregister:function(){u("off",arguments,this._addToStack,this)},unregisterAll:function(){i(this.unregister,this,this.objectRegistry.get())},undo:function(t){d("undo",this,this.stack,t)},undoAll:function(){d("undo",this,this.stack,!1,!0)},redo:function(t){d("redo",this,this.stack,t)},redoAll:function(){d("redo",this,this.stack,!1,!0)},isAvailable:function(t){var e=this.stack,n=e.length;switch(t){case"undo":return n>0&&e.pointer>-1;case"redo":return n>0&&e.pointer<n-1;default:return!1}},merge:function(e){for(var n,o=t.isArray(e)?e:a(arguments);n=o.pop();)n instanceof m&&n.stack instanceof y&&(n.stack=this.stack)},addUndoType:function(t,e){g(0,t,e,this.undoTypes)},changeUndoType:function(t,e){g(1,t,e,this.undoTypes)},removeUndoType:function(t){g(2,t,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return t.extend(m,{defaults:function(e){t.extend(m.prototype.defaults,e)},addUndoType:function(t,e){g(0,t,e,f)},changeUndoType:function(t,e){g(1,t,e,f)},removeUndoType:function(t){g(2,t,void 0,f)}}),e.UndoManager=m},o=[n(5706),n(4193)],void 0!==(r=i.apply(e,o))&&(t.exports=r)},4193:(t,e,n)=>{var o,r,i,a;i=function(t,e,n,o){var r,i=t.Backbone,a=Array.prototype.slice;e.VERSION="1.4.1",e.$=o,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=e.Events={},l=/\s+/,c=function(t,e,o,r,i){var a,s=0;if(o&&"object"==typeof o)for(void 0!==r&&("context"in i)&&void 0===i.context&&(i.context=r),a=n.keys(o);s<a.length;s++)e=c(t,e,a[s],o[a[s]],i);else if(o&&l.test(o))for(a=o.split(l);s<a.length;s++)e=t(e,a[s],r,i);else e=t(e,o,r,i);return e};s.on=function(t,e,n){return this._events=c(u,this._events||{},t,e,{context:n,ctx:this,listening:r}),r&&((this._listeners||(this._listeners={}))[r.id]=r,r.interop=!1),this},s.listenTo=function(t,e,o){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId("l")),a=this._listeningTo||(this._listeningTo={}),s=r=a[i];s||(this._listenId||(this._listenId=n.uniqueId("l")),s=r=a[i]=new v(this,t));var l=p(t,e,o,this);if(r=void 0,l)throw l;return s.interop&&s.on(e,o),this};var u=function(t,e,n,o){if(n){var r=t[e]||(t[e]=[]),i=o.context,a=o.ctx,s=o.listening;s&&s.count++,r.push({callback:n,context:i,ctx:i||a,listening:s})}return t},p=function(t,e,n,o){try{t.on(e,n,o)}catch(t){return t}};s.off=function(t,e,n){return this._events&&(this._events=c(d,this._events,t,e,{context:n,listeners:this._listeners})),this},s.stopListening=function(t,e,o){var r=this._listeningTo;if(!r)return this;for(var i=t?[t._listenId]:n.keys(r),a=0;a<i.length;a++){var s=r[i[a]];if(!s)break;s.obj.off(e,o,this),s.interop&&s.off(e,o)}return n.isEmpty(r)&&(this._listeningTo=void 0),this};var d=function(t,e,o,r){if(t){var i,a=r.context,s=r.listeners,l=0;if(!e&&!a&&!o){for(i=n.keys(s);l<i.length;l++)s[i[l]].cleanup();return}for(i=e?[e]:n.keys(t);l<i.length;l++){var c=t[e=i[l]];if(!c)break;for(var u=[],p=0;p<c.length;p++){var d=c[p];if(o&&o!==d.callback&&o!==d.callback._callback||a&&a!==d.context)u.push(d);else{var f=d.listening;f&&f.off(e,o)}}u.length?t[e]=u:delete t[e]}return t}};s.once=function(t,e,n){var o=c(f,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(o,e,n)},s.listenToOnce=function(t,e,n){var o=c(f,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,o)};var f=function(t,e,o,r){if(o){var i=t[e]=n.once(function(){r(e,i),o.apply(this,arguments)});i._callback=o}return t};s.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),o=0;o<e;o++)n[o]=arguments[o+1];return c(h,this._events,t,void 0,n),this};var h=function(t,e,n,o){if(t){var r=t[e],i=t.all;r&&i&&(i=i.slice()),r&&g(r,o),i&&g(i,[e].concat(o))}return t},g=function(t,e){var n,o=-1,r=t.length,i=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++o<r;)(n=t[o]).callback.call(n.ctx);return;case 1:for(;++o<r;)(n=t[o]).callback.call(n.ctx,i);return;case 2:for(;++o<r;)(n=t[o]).callback.call(n.ctx,i,a);return;case 3:for(;++o<r;)(n=t[o]).callback.call(n.ctx,i,a,s);return;default:for(;++o<r;)(n=t[o]).callback.apply(n.ctx,e);return}},v=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};v.prototype.on=s.on,v.prototype.off=function(t,e){var n;this.interop?(this._events=c(d,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},s.bind=s.on,s.unbind=s.off,n.extend(e,s);var y=e.Model=function(t,e){var o=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(o=this.parse(o,e)||{});var r=n.result(this,"defaults");o=n.defaults(n.extend({},r,o),r),this.set(o,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(y.prototype,s,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,o){if(null==t)return this;if("object"==typeof t?(r=t,o=e):(r={})[t]=e,o||(o={}),!this._validate(r,o))return!1;var r,i=o.unset,a=o.silent,s=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,p=this._previousAttributes;for(var d in r)e=r[d],n.isEqual(c[d],e)||s.push(d),n.isEqual(p[d],e)?delete u[d]:u[d]=e,i?delete c[d]:c[d]=e;if(this.idAttribute in r){var f=this.id;this.id=this.get(this.idAttribute),this.trigger("changeId",this,f,o)}if(!a){s.length&&(this._pending=o);for(var h=0;h<s.length;h++)this.trigger("change:"+s[h],this,c[s[h]],o)}if(l)return this;if(!a)for(;this._pending;)o=this._pending,this._pending=!1,this.trigger("change",this,o);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var o in this.attributes)e[o]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e,o=this._changing?this._previousAttributes:this.attributes,r={};for(var i in t){var a=t[i];n.isEqual(o[i],a)||(r[i]=a,e=!0)}return!!e&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,o=t.success;return t.success=function(n){var r=t.parse?e.parse(n,t):n;if(!e.set(r,t))return!1;o&&o.call(t.context,e,n,t),e.trigger("sync",e,n,t)},$(this,t),this.sync("read",this,t)},save:function(t,e,o){null==t||"object"==typeof t?(r=t,o=e):(r={})[t]=e;var r,i=(o=n.extend({validate:!0,parse:!0},o)).wait;if(r&&!i){if(!this.set(r,o))return!1}else if(!this._validate(r,o))return!1;var a=this,s=o.success,l=this.attributes;o.success=function(t){a.attributes=l;var e=o.parse?a.parse(t,o):t;if(i&&(e=n.extend({},r,e)),e&&!a.set(e,o))return!1;s&&s.call(o.context,a,t,o),a.trigger("sync",a,t,o)},$(this,o),r&&i&&(this.attributes=n.extend({},l,r));var c=this.isNew()?"create":o.patch?"patch":"update";"patch"!==c||o.attrs||(o.attrs=r);var u=this.sync(c,this,o);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,o=t.success,r=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){r&&i(),o&&o.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var a=!1;return this.isNew()?n.defer(t.success):($(this,t),a=this.sync("delete",this,t)),r||i(),a},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||W();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var o=this.validationError=this.validate(t,e)||null;return!o||(this.trigger("invalid",this,o,n.extend(e,{validationError:o})),!1)}});var m=e.Collection=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},b={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},_=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var o,r=Array(t.length-n),i=e.length;for(o=0;o<r.length;o++)r[o]=t[o+n];for(o=0;o<i;o++)t[o+n]=e[o];for(o=0;o<r.length;o++)t[o+i+n]=r[o]};n.extend(m.prototype,s,{model:y,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,w))},remove:function(t,e){e=n.extend({},e);var o=!n.isArray(t);t=o?[t]:t.slice();var r=this._removeModels(t,e);return!e.silent&&r.length&&(e.changes={added:[],merged:[],removed:r},this.trigger("update",this,e)),o?r[0]:r},set:function(t,e){if(null!=t){(e=n.extend({},b,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var o,r,i=!n.isArray(t);t=i?[t]:t.slice();var a=e.at;null!=a&&(a=+a),a>this.length&&(a=this.length),a<0&&(a+=this.length+1);var s=[],l=[],c=[],u=[],p={},d=e.add,f=e.merge,h=e.remove,g=!1,v=this.comparator&&null==a&&!1!==e.sort,y=n.isString(this.comparator)?this.comparator:null;for(r=0;r<t.length;r++){o=t[r];var m=this.get(o);if(m){if(f&&o!==m){var w=this._isModel(o)?o.attributes:o;e.parse&&(w=m.parse(w,e)),m.set(w,e),c.push(m),v&&!g&&(g=m.hasChanged(y))}p[m.cid]||(p[m.cid]=!0,s.push(m)),t[r]=m}else d&&(o=t[r]=this._prepareModel(o,e))&&(l.push(o),this._addReference(o,e),p[o.cid]=!0,s.push(o))}if(h){for(r=0;r<this.length;r++)p[(o=this.models[r]).cid]||u.push(o);u.length&&this._removeModels(u,e)}var C=!1;if(s.length&&!v&&d&&h?(C=this.length!==s.length||n.some(this.models,function(t,e){return t!==s[e]}),this.models.length=0,_(this.models,s,0),this.length=this.models.length):l.length&&(v&&(g=!0),_(this.models,l,null==a?this.length:a),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(r=0;r<l.length;r++)null!=a&&(e.index=a+r),(o=l[r]).trigger("add",o,this,e);(g||C)&&this.trigger("sort",this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},this.trigger("update",this,e))}return i?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var o=0;o<this.models.length;o++)this._removeReference(this.models[o],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return a.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t,t.idAttribute)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw Error("Cannot sort a set without a comparator");t||(t={});var o=e.length;return n.isFunction(e)&&(e=e.bind(this)),1===o||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){var e=(t=n.extend({parse:!0},t)).success,o=this;return t.success=function(n){o[t.reset?"reset":"set"](n,t),e&&e.call(t.context,o,n,t),o.trigger("sync",o,n,t)},$(this,t),this.sync("read",this,t)},create:function(t,e){var o=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;o||this.add(t,e);var r=this,i=e.success;return e.success=function(t,e,n){o&&r.add(t,n),i&&i.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t,e){return t[e||this.model.prototype.idAttribute||"id"]},values:function(){return new x(this,S)},keys:function(){return new x(this,O)},entries:function(){return new x(this,T)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){var o;return this._isModel(t)?(t.collection||(t.collection=this),t):((e=e?n.clone(e):{}).collection=this,(o=this.model.prototype?new this.model(t,e):this.model(t,e)).validationError)?(this.trigger("invalid",this,o.validationError,e),!1):o},_removeModels:function(t,e){for(var n=[],o=0;o<t.length;o++){var r=this.get(t[o]);if(r){var i=this.indexOf(r);this.models.splice(i,1),this.length--,delete this._byId[r.cid];var a=this.modelId(r.attributes,r.idAttribute);null!=a&&delete this._byId[a],e.silent||(e.index=i,r.trigger("remove",r,this,e)),n.push(r),this._removeReference(r,e)}}return n},_isModel:function(t){return t instanceof y},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes,t.idAttribute);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes,t.idAttribute);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,o){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,o),"changeId"===t){var r=this.modelId(e.previousAttributes(),e.idAttribute),i=this.modelId(e.attributes,e.idAttribute);null!=r&&delete this._byId[r],null!=i&&(this._byId[i]=e)}}this.trigger.apply(this,arguments)}});var C="function"==typeof Symbol&&Symbol.iterator;C&&(m.prototype[C]=m.prototype.values);var x=function(t,e){this._collection=t,this._kind=e,this._index=0},S=1,O=2,T=3;C&&(x.prototype[C]=function(){return this}),x.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var t,e=this._collection.at(this._index);if(this._index++,this._kind===S)t=e;else{var n=this._collection.modelId(e.attributes,e.idAttribute);t=this._kind===O?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var P=e.View=function(t){this.cid=n.uniqueId("view"),this.preinitialize.apply(this,arguments),n.extend(this,n.pick(t,k)),this._ensureElement(),this.initialize.apply(this,arguments)},E=/^(\S+)\s*(.*)$/,k=["model","collection","el","id","attributes","className","tagName","events"];n.extend(P.prototype,s,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var o=t[e];if(n.isFunction(o)||(o=this[o]),o){var r=e.match(E);this.delegate(r[1],r[2],o.bind(this))}}return this},delegate:function(t,e,n){return this.$el.on(t+".delegateEvents"+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+".delegateEvents"+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t.class=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}});var A=function(t,e,n,o){switch(e){case 1:return function(){return t[n](this[o])};case 2:return function(e){return t[n](this[o],e)};case 3:return function(e,r){return t[n](this[o],M(e,this),r)};case 4:return function(e,r,i){return t[n](this[o],M(e,this),r,i)};default:return function(){var e=a.call(arguments);return e.unshift(this[o]),t[n].apply(t,e)}}},j=function(t,e,o,r){n.each(o,function(n,o){e[o]&&(t.prototype[o]=A(e,n,o,r))})},M=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?D(t):n.isString(t)?function(e){return e.get(t)}:t},D=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}};n.each([[m,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models"],[y,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],function(t){var e=t[0],o=t[1],r=t[2];e.mixin=function(t){var o=n.reduce(n.functions(t),function(t,e){return t[e]=0,t},{});j(e,t,o,r)},j(e,n,o,r)}),e.sync=function(t,o,r){var i=L[t];n.defaults(r||(r={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:i,dataType:"json"};if(r.url||(a.url=n.result(o,"url")||W()),null==r.data&&o&&("create"===t||"update"===t||"patch"===t)&&(a.contentType="application/json",a.data=JSON.stringify(r.attrs||o.toJSON(r))),r.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),r.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){a.type="POST",r.emulateJSON&&(a.data._method=i);var s=r.beforeSend;r.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",i),s)return s.apply(this,arguments)}}"GET"===a.type||r.emulateJSON||(a.processData=!1);var l=r.error;r.error=function(t,e,n){r.textStatus=e,r.errorThrown=n,l&&l.call(r.context,t,e,n)};var c=r.xhr=e.ajax(n.extend(a,r));return o.trigger("request",o,c,r),c};var L={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var I=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},N=/\((.*?)\)/g,R=/(\(\?)?:\w+/g,V=/\*\w+/g,F=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(I.prototype,s,{preinitialize:function(){},initialize:function(){},route:function(t,o,r){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(o)&&(r=o,o=""),r||(r=this[o]);var i=this;return e.history.route(t,function(n){var a=i._extractParameters(t,n);!1!==i.execute(r,a,o)&&(i.trigger.apply(i,["route:"+o].concat(a)),i.trigger("route",o,a),e.history.trigger("route",i,o,a))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return RegExp("^"+(t=t.replace(F,"\\$&").replace(N,"(?:$1)?").replace(R,function(t,e){return e?t:"([^/?]+)"}).replace(V,"([^?]*?)"))+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var o=t.exec(e).slice(1);return n.map(o,function(t,e){return e===o.length-1?t||null:t?decodeURIComponent(t):null})}});var H=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},U=/^[#\/]|\s+$/g,B=/^\/+|\/+$/g,z=/#.*$/;H.started=!1,n.extend(H.prototype,s,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(U,"")},start:function(t){if(H.started)throw Error("Backbone.history has already been started");if(H.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.history&&this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(B,"/"),this._wantsHashChange&&this._wantsPushState){if(this._hasPushState||this.atRoot())this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0});else{var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var o=document.body,r=o.insertBefore(this.iframe,o.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash="#"+this.fragment}var i=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?i("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?i("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),H.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!H.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;(""===t||"?"===t.charAt(0))&&(n=n.slice(0,-1)||"/");var o=n+t;t=t.replace(z,"");var r=this.decodeFragment(t);if(this.fragment!==r){if(this.fragment=r,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,o);else if(!this._wantsHashChange)return this.location.assign(o);else if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}if(e.trigger)return this.loadUrl(t)}},_updateHash:function(t,e,n){if(n){var o=t.href.replace(/(javascript:|#).*$/,"");t.replace(o+"#"+e)}else t.hash="#"+e}}),e.history=new H,y.extend=m.extend=I.extend=P.extend=H.extend=function(t,e){var o,r=this;return o=t&&n.has(t,"constructor")?t.constructor:function(){return r.apply(this,arguments)},n.extend(o,r,e),o.prototype=n.create(r.prototype,t),o.prototype.constructor=o,o.__super__=r.prototype,o};var W=function(){throw Error('A "url" property or function must be specified')},$=function(t,e){var n=e.error;e.error=function(o){n&&n.call(e.context,t,o,e),t.trigger("error",t,o,e)}};return e},a="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,o=[n(5706),n(7774),e],void 0!==(r=(function(t,e,n){a.Backbone=i(a,n,t,e)}).apply(e,o))&&(t.exports=r)},3640:(t,e,n)=>{var o,r;(o=n(4408)).extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),o.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,o){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!o.lexical||")"!=o.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}}),r=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/,o.extendMode("xml",{commentStart:"<!--",commentEnd:"-->",newlineAfterToken:function(t,e,n,o){var i=!1;return"html"==this.configuration&&(i=!!o.context&&r.test(o.context.tagName)),!i&&("tag"==t&&/>$/.test(e)&&o.context||/^</.test(n))}}),o.defineExtension("commentRange",function(t,e,n){var r=this,i=o.innerMode(r.getMode(),r.getTokenAt(e).state).mode;r.operation(function(){if(t)r.replaceRange(i.commentEnd,n),r.replaceRange(i.commentStart,e),e.line==n.line&&e.ch==n.ch&&r.setCursor(e.line,e.ch+i.commentStart.length);else{var o=r.getRange(e,n),a=o.indexOf(i.commentStart),s=o.lastIndexOf(i.commentEnd);a>-1&&s>-1&&s>a&&(o=o.substr(0,a)+o.substring(a+i.commentStart.length,s)+o.substr(s+i.commentEnd.length)),r.replaceRange(o,e,n)}})}),o.defineExtension("autoIndentRange",function(t,e){var n=this;this.operation(function(){for(var o=t.line;o<=e.line;o++)n.indentLine(o,"smart")})}),o.defineExtension("autoFormatRange",function(t,e){var n=this,r=n.getMode(),i=n.getRange(t,e).split("\n"),a=o.copyState(r,n.getTokenAt(t).state),s=n.getOption("tabSize"),l="",c=0,u=0===t.ch;function p(){l+="\n",u=!0,++c}for(var d=0;d<i.length;++d){for(var f=new o.StringStream(i[d],s);!f.eol();){var h=o.innerMode(r,a),g=r.token(f,a),v=f.current();f.start=f.pos,(!u||/\S/.test(v))&&(l+=v,u=!1),!u&&h.mode.newlineAfterToken&&h.mode.newlineAfterToken(g,v,f.string.slice(f.pos)||i[d+1]||"",h.state)&&p()}!f.pos&&r.blankLine&&r.blankLine(a),!u&&d<i.length-1&&p()}n.operation(function(){n.replaceRange(l,t,e);for(var o=t.line+1,r=t.line+c;o<=r;++o)n.indentLine(o,"smart");n.setSelection(t,n.getCursor(!1))})})},4408:function(t){var e;e=function(){var t,e,n,o,r,i,a,s,l,c=navigator.userAgent,u=navigator.platform,p=/gecko\/\d/i.test(c),d=/MSIE \d/.test(c),f=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(c),h=/Edge\/(\d+)/.exec(c),g=d||f||h,v=g&&(d?document.documentMode||6:+(h||f)[1]),y=!h&&/WebKit\//.test(c),m=y&&/Qt\/\d+\.\d+/.test(c),b=!h&&/Chrome\//.test(c),w=/Opera\//.test(c),_=/Apple Computer/.test(navigator.vendor),C=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(c),x=/PhantomJS/.test(c),S=_&&(/Mobile\/\w+/.test(c)||navigator.maxTouchPoints>2),O=/Android/.test(c),T=S||O||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(c),P=S||/Mac/.test(u),E=/\bCrOS\b/.test(c),k=/win/i.test(u),A=w&&c.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(w=!1,y=!0);var j=P&&(m||w&&(null==A||A<12.11)),M=p||g&&v>=9;function D(t){return RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var L=function(t,e){var n=t.className,o=D(e).exec(n);if(o){var r=n.slice(o.index+o[0].length);t.className=n.slice(0,o.index)+(r?o[1]+r:"")}};function I(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function N(t,e){return I(t).appendChild(e)}function R(t,e,n,o){var r=document.createElement(t);if(n&&(r.className=n),o&&(r.style.cssText=o),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var i=0;i<e.length;++i)r.appendChild(e[i]);return r}function V(t,e,n,o){var r=R(t,e,n,o);return r.setAttribute("role","presentation"),r}function F(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do if(11==e.nodeType&&(e=e.host),e==t)return!0;while(e=e.parentNode)}function H(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function U(t,e){var n=t.className;D(e).test(n)||(t.className+=(n?" ":"")+e)}function B(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)n[o]&&!D(n[o]).test(e)&&(e+=" "+n[o]);return e}document.createRange?o=function(t,e,n,o){var r=document.createRange();return r.setEnd(o||t,n),r.setStart(t,e),r}:o=function(t,e,n){var o=document.body.createTextRange();try{o.moveToElementText(t.parentNode)}catch(t){return o}return o.collapse(!0),o.moveEnd("character",n),o.moveStart("character",e),o};var z=function(t){t.select()};function W(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function $(t,e,n){for(var o in e||(e={}),t)t.hasOwnProperty(o)&&(!1!==n||!e.hasOwnProperty(o))&&(e[o]=t[o]);return e}function q(t,e,n,o,r){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var i=o||0,a=r||0;;){var s=t.indexOf(" ",i);if(s<0||s>=e)return a+(e-i);a+=s-i,a+=n-a%n,i=s+1}}S?z=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:g&&(z=function(t){try{t.select()}catch(t){}});var G=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};function K(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return -1}G.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},G.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var Y={toString:function(){return"CodeMirror.Pass"}},J={scroll:!1},X={origin:"*mouse"},Z={origin:"+move"};function Q(t,e,n){for(var o=0,r=0;;){var i=t.indexOf(" ",o);-1==i&&(i=t.length);var a=i-o;if(i==t.length||r+a>=e)return o+Math.min(a,e-r);if(r+=i-o,r+=n-r%n,o=i+1,r>=e)return o}}var tt=[""];function te(t){for(;tt.length<=t;)tt.push(tn(tt)+" ");return tt[t]}function tn(t){return t[t.length-1]}function to(t,e){for(var n=[],o=0;o<t.length;o++)n[o]=e(t[o],o);return n}function tr(){}function ti(t,e){var n;return Object.create?n=Object.create(t):(tr.prototype=t,n=new tr),e&&$(e,n),n}var ta=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ts(t){return/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||ta.test(t))}function tl(t,e){return e?!!(e.source.indexOf("\\w")>-1&&ts(t))||e.test(t):ts(t)}function tc(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var tu=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function tp(t){return t.charCodeAt(0)>=768&&tu.test(t)}function td(t,e,n){for(;(n<0?e>0:e<t.length)&&tp(t.charAt(e));)e+=n;return e}function tf(t,e,n){for(var o=e>n?-1:1;;){if(e==n)return e;var r=(e+n)/2,i=o<0?Math.ceil(r):Math.floor(r);if(i==e)return t(i)?e:n;t(i)?n=i:e=i+o}}var th=null;function tg(t,e,n){var o;th=null;for(var r=0;r<t.length;++r){var i=t[r];if(i.from<e&&i.to>e)return r;i.to==e&&(i.from!=i.to&&"before"==n?o=r:th=r),i.from==e&&(i.from!=i.to&&"before"!=n?o=r:th=r)}return null!=o?o:th}var tv=function(){var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,n=/[LRr]/,o=/[Lb1n]/,r=/[1n]/;function i(t,e,n){this.level=t,this.from=e,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!t.test(a))return!1;for(var c=a.length,u=[],p=0;p<c;++p){u.push((L=a.charCodeAt(p))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(L):1424<=L&&L<=1524?"R":1536<=L&&L<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(L-1536):1774<=L&&L<=2220?"r":8192<=L&&L<=8203?"w":8204==L?"b":"L")}for(var d=0,f=l;d<c;++d){var h=u[d];"m"==h?u[d]=f:f=h}for(var g=0,v=l;g<c;++g){var y=u[g];"1"==y&&"r"==v?u[g]="n":n.test(y)&&(v=y,"r"==y&&(u[g]="R"))}for(var m=1,b=u[0];m<c-1;++m){var w=u[m];"+"==w&&"1"==b&&"1"==u[m+1]?u[m]="1":","==w&&b==u[m+1]&&("1"==b||"n"==b)&&(u[m]=b),b=w}for(var _=0;_<c;++_){var C=u[_];if(","==C)u[_]="N";else if("%"==C){var x=void 0;for(x=_+1;x<c&&"%"==u[x];++x);for(var S=_&&"!"==u[_-1]||x<c&&"1"==u[x]?"1":"N",O=_;O<x;++O)u[O]=S;_=x-1}}for(var T=0,P=l;T<c;++T){var E=u[T];"L"==P&&"1"==E?u[T]="L":n.test(E)&&(P=E)}for(var k=0;k<c;++k)if(e.test(u[k])){var A=void 0;for(A=k+1;A<c&&e.test(u[A]);++A);for(var j=(k?u[k-1]:l)=="L",M=j==((A<c?u[A]:l)=="L")?j?"L":"R":l,D=k;D<A;++D)u[D]=M;k=A-1}for(var L,I,N=[],R=0;R<c;)if(o.test(u[R])){var V=R;for(++R;R<c&&o.test(u[R]);++R);N.push(new i(0,V,R))}else{var F=R,H=N.length,U="rtl"==s?1:0;for(++R;R<c&&"L"!=u[R];++R);for(var B=F;B<R;)if(r.test(u[B])){F<B&&(N.splice(H,0,new i(1,F,B)),H+=U);var z=B;for(++B;B<R&&r.test(u[B]);++B);N.splice(H,0,new i(2,z,B)),H+=U,F=B}else++B;F<R&&N.splice(H,0,new i(1,F,R))}return"ltr"==s&&(1==N[0].level&&(I=a.match(/^\s+/))&&(N[0].from=I[0].length,N.unshift(new i(0,0,I[0].length))),1==tn(N).level&&(I=a.match(/\s+$/))&&(tn(N).to-=I[0].length,N.push(new i(0,c-I[0].length,c)))),"rtl"==s?N.reverse():N}}();function ty(t,e){var n=t.order;return null==n&&(n=t.order=tv(t.text,e)),n}var tm=[],tb=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var o=t._handlers||(t._handlers={});o[e]=(o[e]||tm).concat(n)}};function tw(t,e){return t._handlers&&t._handlers[e]||tm}function t_(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var o=t._handlers,r=o&&o[e];if(r){var i=K(r,n);i>-1&&(o[e]=r.slice(0,i).concat(r.slice(i+1)))}}}function tC(t,e){var n=tw(t,e);if(n.length)for(var o=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,o)}function tx(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),tC(t,n||e.type,t,e),tk(e)||e.codemirrorIgnore}function tS(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),o=0;o<e.length;++o)-1==K(n,e[o])&&n.push(e[o])}function tO(t,e){return tw(t,e).length>0}function tT(t){t.prototype.on=function(t,e){tb(this,t,e)},t.prototype.off=function(t,e){t_(this,t,e)}}function tP(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function tE(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function tk(t){return null!=t.defaultPrevented?t.defaultPrevented:!1==t.returnValue}function tA(t){tP(t),tE(t)}function tj(t){return t.target||t.srcElement}function tM(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),P&&t.ctrlKey&&1==e&&(e=3),e}var tD=function(){if(g&&v<9)return!1;var t=R("div");return"draggable"in t||"dragDrop"in t}(),tL=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],o=t.length;e<=o;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var i=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),e+=a+1):(n.push(i),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},tI=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!!e&&e.parentElement()==t&&0!=e.compareEndPoints("StartToEnd",e)},tN="oncopy"in(t=R("div"))||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy),tR=null,tV={},tF={};function tH(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),tV[t]=e}function tU(t){if("string"==typeof t&&tF.hasOwnProperty(t))t=tF[t];else if(t&&"string"==typeof t.name&&tF.hasOwnProperty(t.name)){var e=tF[t.name];"string"==typeof e&&(e={name:e}),(t=ti(e,t)).name=e.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return tU("application/xml");else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return tU("application/json");return"string"==typeof t?{name:t}:t||{name:"null"}}function tB(t,e){var n=tV[(e=tU(e)).name];if(!n)return tB(t,"text/plain");var o=n(t,e);if(tz.hasOwnProperty(e.name)){var r=tz[e.name];for(var i in r)r.hasOwnProperty(i)&&(o.hasOwnProperty(i)&&(o["_"+i]=o[i]),o[i]=r[i])}if(o.name=e.name,e.helperType&&(o.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)o[a]=e.modeProps[a];return o}var tz={};function tW(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var o in e){var r=e[o];r instanceof Array&&(r=r.concat([])),n[o]=r}return n}function t$(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function tq(t,e,n){return!t.startState||t.startState(e,n)}var tG=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function tK(t,e){if((e-=t.first)<0||e>=t.size)throw Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var o=0;;++o){var r=n.children[o],i=r.chunkSize();if(e<i){n=r;break}e-=i}return n.lines[e]}function tY(t,e,n){var o=[],r=e.line;return t.iter(e.line,n.line+1,function(t){var i=t.text;r==n.line&&(i=i.slice(0,n.ch)),r==e.line&&(i=i.slice(e.ch)),o.push(i),++r}),o}function tJ(t,e,n){var o=[];return t.iter(e,n,function(t){o.push(t.text)}),o}function tX(t,e){var n=e-t.height;if(n)for(var o=t;o;o=o.parent)o.height+=n}function tZ(t){if(null==t.parent)return null;for(var e=t.parent,n=K(e.lines,t),o=e.parent;o;e=o,o=o.parent)for(var r=0;o.children[r]!=e;++r)n+=o.children[r].chunkSize();return n+e.first}function tQ(t,e){var n=t.first;t:do{for(var o=0;o<t.children.length;++o){var r=t.children[o],i=r.height;if(e<i){t=r;continue t}e-=i,n+=r.chunkSize()}return n}while(!t.lines);for(var a=0;a<t.lines.length;++a){var s=t.lines[a].height;if(e<s)break;e-=s}return n+a}function t0(t,e){return e>=t.first&&e<t.first+t.size}function t1(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function t2(t,e,n){if(void 0===n&&(n=null),!(this instanceof t2))return new t2(t,e,n);this.line=t,this.ch=e,this.sticky=n}function t5(t,e){return t.line-e.line||t.ch-e.ch}function t3(t,e){return t.sticky==e.sticky&&0==t5(t,e)}function t4(t){return t2(t.line,t.ch)}function t6(t,e){return 0>t5(t,e)?e:t}function t7(t,e){return 0>t5(t,e)?t:e}function t9(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function t8(t,e){if(e.line<t.first)return t2(t.first,0);var n,o,r=t.first+t.size-1;return e.line>r?t2(r,tK(t,r).text.length):(n=tK(t,e.line).text.length,null==(o=e.ch)||o>n?t2(e.line,n):o<0?t2(e.line,0):e)}function et(t,e){for(var n=[],o=0;o<e.length;o++)n[o]=t8(t,e[o]);return n}tG.prototype.eol=function(){return this.pos>=this.string.length},tG.prototype.sol=function(){return this.pos==this.lineStart},tG.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},tG.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},tG.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},tG.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},tG.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},tG.prototype.skipToEnd=function(){this.pos=this.string.length},tG.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},tG.prototype.backUp=function(t){this.pos-=t},tG.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=q(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},tG.prototype.indentation=function(){return q(this.string,null,this.tabSize)-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},tG.prototype.match=function(t,e,n){if("string"==typeof t){var o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0}else{var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}},tG.prototype.current=function(){return this.string.slice(this.start,this.pos)},tG.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},tG.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},tG.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ee=function(t,e){this.state=t,this.lookAhead=e},en=function(t,e,n,o){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=o||0,this.baseTokens=null,this.baseTokenPos=1};function eo(t,e,n,o){var r=[t.state.modeGen],i={};ed(t,e.text,t.doc.mode,n,function(t,e){return r.push(t,e)},i,o);for(var a=n.state,s=0;s<t.state.overlays.length;++s)!function(o){n.baseTokens=r;var s=t.state.overlays[o],l=1,c=0;n.state=!0,ed(t,e.text,s.mode,n,function(t,e){for(var n=l;c<t;){var o=r[l];o>t&&r.splice(l,1,t,r[l+1],o),l+=2,c=Math.min(t,o)}if(e){if(s.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var i=r[n+1];r[n+1]=(i?i+" ":"")+"overlay "+e}}},i),n.state=a,n.baseTokens=null,n.baseTokenPos=1}(s);return{styles:r,classes:i.bgClass||i.textClass?i:null}}function er(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var o=ei(t,tZ(e)),r=e.text.length>t.options.maxHighlightLength&&tW(t.doc.mode,o.state),i=eo(t,e,o);r&&(o.state=r),e.stateAfter=o.save(!r),e.styles=i.styles,i.classes?e.styleClasses=i.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function ei(t,e,n){var o=t.doc,r=t.display;if(!o.mode.startState)return new en(o,!0,e);var i=function(t,e,n){for(var o,r,i=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=i.first)return i.first;var l=tK(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ee?c.lookAhead:0)<=i.modeFrontier))return s;var u=q(l.text,null,t.options.tabSize);(null==r||o>u)&&(r=s-1,o=u)}return r}(t,e,n),a=i>o.first&&tK(o,i-1).stateAfter,s=a?en.fromSaved(o,a,i):new en(o,tq(o.mode),i);return o.iter(i,e,function(n){ea(t,n.text,s);var o=s.line;n.stateAfter=o==e-1||o%5==0||o>=r.viewFrom&&o<r.viewTo?s.save():null,s.nextLine()}),n&&(o.modeFrontier=s.line),s}function ea(t,e,n,o){var r=t.doc.mode,i=new tG(e,t.options.tabSize,n);for(i.start=i.pos=o||0,""==e&&es(r,n.state);!i.eol();)el(r,i,n.state),i.start=i.pos}function es(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=t$(t,e);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function el(t,e,n,o){for(var r=0;r<10;r++){o&&(o[0]=t$(t,n).mode);var i=t.token(e,n);if(e.pos>e.start)return i}throw Error("Mode "+t.name+" failed to advance stream.")}en.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},en.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},en.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},en.fromSaved=function(t,e,n){return e instanceof ee?new en(t,tW(t.mode,e.state),n,e.lookAhead):new en(t,tW(t.mode,e),n)},en.prototype.save=function(t){var e=!1!==t?tW(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(e,this.maxLookAhead):e};var ec=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function eu(t,e,n,o){var r,i=t.doc,a=i.mode;e=t8(i,e);var s,l=tK(i,e.line),c=ei(t,e.line,n),u=new tG(l.text,t.options.tabSize,c);for(o&&(s=[]);(o||u.pos<e.ch)&&!u.eol();)u.start=u.pos,r=el(a,u,c.state),o&&s.push(new ec(u,r,tW(i.mode,c.state)));return o?s:new ec(u,r,c.state)}function ep(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var o=n[1]?"bgClass":"textClass";null==e[o]?e[o]=n[2]:RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[o])||(e[o]+=" "+n[2])}return t}function ed(t,e,n,o,r,i,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,c=0,u=null,p=new tG(e,t.options.tabSize,o),d=t.options.addModeClass&&[null];for(""==e&&ep(es(n,o.state),i);!p.eol();){if(p.pos>t.options.maxHighlightLength?(s=!1,a&&ea(t,e,o,p.pos),p.pos=e.length,l=null):l=ep(el(n,p,o.state,d),i),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;c<p.start;)r(c=Math.min(p.start,c+5e3),u);u=l}p.start=p.pos}for(;c<p.pos;){var h=Math.min(p.pos,c+5e3);r(h,u),c=h}}var ef=!1,eh=!1;function eg(t,e,n){this.marker=t,this.from=e,this.to=n}function ev(t,e){if(t)for(var n=0;n<t.length;++n){var o=t[n];if(o.marker==e)return o}}function ey(t,e){if(e.full)return null;var n=t0(t,e.from.line)&&tK(t,e.from.line).markedSpans,o=t0(t,e.to.line)&&tK(t,e.to.line).markedSpans;if(!n&&!o)return null;var r=e.from.ch,i=e.to.ch,a=0==t5(e.from,e.to),s=function(t,e,n){var o;if(t)for(var r=0;r<t.length;++r){var i=t[r],a=i.marker;if(null==i.from||(a.inclusiveLeft?i.from<=e:i.from<e)||i.from==e&&"bookmark"==a.type&&(!n||!i.marker.insertLeft)){var s=null==i.to||(a.inclusiveRight?i.to>=e:i.to>e);(o||(o=[])).push(new eg(a,i.from,s?null:i.to))}}return o}(n,r,a),l=function(t,e,n){var o;if(t)for(var r=0;r<t.length;++r){var i=t[r],a=i.marker;if(null==i.to||(a.inclusiveRight?i.to>=e:i.to>e)||i.from==e&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=e:i.from<e);(o||(o=[])).push(new eg(a,s?null:i.from-e,null==i.to?null:i.to-e))}}return o}(o,i,a),c=1==e.text.length,u=tn(e.text).length+(c?r:0);if(s)for(var p=0;p<s.length;++p){var d=s[p];if(null==d.to){var f=ev(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=r}}if(l)for(var h=0;h<l.length;++h){var g=l[h];null!=g.to&&(g.to+=u),null==g.from?!ev(s,g.marker)&&(g.from=u,c&&(s||(s=[])).push(g)):(g.from+=u,c&&(s||(s=[])).push(g))}s&&(s=em(s)),l&&l!=s&&(l=em(l));var v=[s];if(!c){var y,m=e.text.length-2;if(m>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(y||(y=[])).push(new eg(s[b].marker,null,null));for(var w=0;w<m;++w)v.push(y);v.push(l)}return v}function em(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function eb(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function ew(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function e_(t){return t.inclusiveLeft?-1:0}function eC(t){return t.inclusiveRight?1:0}function ex(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var o=t.find(),r=e.find(),i=t5(o.from,r.from)||e_(t)-e_(e);return i?-i:t5(o.to,r.to)||eC(t)-eC(e)||e.id-t.id}function eS(t,e){var n,o=eh&&t.markedSpans;if(o)for(var r=void 0,i=0;i<o.length;++i)(r=o[i]).marker.collapsed&&(e?r.from:r.to)==null&&(!n||0>ex(n,r.marker))&&(n=r.marker);return n}function eO(t,e,n,o,r){var i=tK(t,e),a=eh&&i.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=t5(c.from,n)||e_(l.marker)-e_(r),p=t5(c.to,o)||eC(l.marker)-eC(r);if((!(u>=0)||!(p<=0))&&(!(u<=0)||!(p>=0))&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?t5(c.to,n)>=0:t5(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?0>=t5(c.from,o):0>t5(c.from,o))))return!0}}}function eT(t){for(var e;e=eS(t,!0);)t=e.find(-1,!0).line;return t}function eP(t,e){var n=tK(t,e),o=eT(n);return n==o?e:tZ(o)}function eE(t,e){if(e>t.lastLine())return e;var n,o=tK(t,e);if(!ek(t,o))return e;for(;n=eS(o,!1);)o=n.find(1,!0).line;return tZ(o)+1}function ek(t,e){var n=eh&&e.markedSpans;if(n){for(var o=void 0,r=0;r<n.length;++r)if((o=n[r]).marker.collapsed&&(null==o.from||!o.marker.widgetNode&&0==o.from&&o.marker.inclusiveLeft&&function t(e,n,o){if(null==o.to){var r=o.marker.find(1,!0);return t(e,r.line,ev(r.line.markedSpans,o.marker))}if(o.marker.inclusiveRight&&o.to==n.text.length)return!0;for(var i=void 0,a=0;a<n.markedSpans.length;++a)if((i=n.markedSpans[a]).marker.collapsed&&!i.marker.widgetNode&&i.from==o.to&&(null==i.to||i.to!=o.from)&&(i.marker.inclusiveLeft||o.marker.inclusiveRight)&&t(e,n,i))return!0}(t,e,o)))return!0}}function eA(t){t=eT(t);for(var e=0,n=t.parent,o=0;o<n.lines.length;++o){var r=n.lines[o];if(r==t)break;e+=r.height}for(var i=n.parent;i;i=(n=i).parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==n)break;e+=s.height}return e}function ej(t){if(0==t.height)return 0;for(var e,n=t.text.length,o=t;e=eS(o,!0);){var r=e.find(0,!0);o=r.from.line,n+=r.from.ch-r.to.ch}for(o=t;e=eS(o,!1);){var i=e.find(0,!0);n-=o.text.length-i.from.ch,n+=(o=i.to.line).text.length-i.to.ch}return n}function eM(t){var e=t.display,n=t.doc;e.maxLine=tK(n,n.first),e.maxLineLength=ej(e.maxLine),e.maxLineChanged=!0,n.iter(function(t){var n=ej(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}var eD=function(t,e,n){this.text=t,ew(this,e),this.height=n?n(this):1};eD.prototype.lineNo=function(){return tZ(this)},tT(eD);var eL={},eI={};function eN(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?eI:eL;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function eR(t,e){var n=V("span",null,null,y?"padding-right: .1px":null),a={pre:V("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var s=0;s<=(e.rest?e.rest.length:0);s++){var l=s?e.rest[s-1]:e.line,c=void 0;a.pos=0,a.addToken=eF,function(t){if(null!=i)return i;var e=N(t,document.createTextNode("AخA")),n=o(e,0,1).getBoundingClientRect(),r=o(e,1,2).getBoundingClientRect();return I(t),!!n&&n.left!=n.right&&(i=r.right-n.right<3)}(t.display.measure)&&(c=ty(l,t.doc.direction))&&(a.addToken=function(t,e){return function(n,o,r,i,a,s,l){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+o.length;;){for(var p=void 0,d=0;d<e.length&&(!((p=e[d]).to>c)||!(p.from<=c));d++);if(p.to>=u)return t(n,o,r,i,a,s,l);t(n,o.slice(0,p.to-c),r,i,null,s,l),i=null,o=o.slice(p.to-c),c=p.to}}}(a.addToken,c)),a.map=[];var u=e!=t.display.externalMeasured&&tZ(l);(function(t,e,n){var o=t.markedSpans,r=t.text,i=0;if(!o){for(var a=1;a<n.length;a+=2)e.addToken(e,r.slice(i,i=n[a]),eN(n[a+1],e.cm.options));return}for(var s,l,c,u,p,d,f,h=r.length,g=0,v=1,y="",m=0;;){if(m==g){c=u=p=l="",f=null,d=null,m=1/0;for(var b=[],w=void 0,_=0;_<o.length;++_){var C=o[_],x=C.marker;if("bookmark"==x.type&&C.from==g&&x.widgetNode)b.push(x);else if(C.from<=g&&(null==C.to||C.to>g||x.collapsed&&C.to==g&&C.from==g)){if(null!=C.to&&C.to!=g&&m>C.to&&(m=C.to,u=""),x.className&&(c+=" "+x.className),x.css&&(l=(l?l+";":"")+x.css),x.startStyle&&C.from==g&&(p+=" "+x.startStyle),x.endStyle&&C.to==m&&(w||(w=[])).push(x.endStyle,C.to),x.title&&((f||(f={})).title=x.title),x.attributes)for(var S in x.attributes)(f||(f={}))[S]=x.attributes[S];x.collapsed&&(!d||0>ex(d.marker,x))&&(d=C)}else C.from>g&&m>C.from&&(m=C.from)}if(w)for(var O=0;O<w.length;O+=2)w[O+1]==m&&(u+=" "+w[O]);if(!d||d.from==g)for(var T=0;T<b.length;++T)eH(e,0,b[T]);if(d&&(d.from||0)==g){if(eH(e,(null==d.to?h+1:d.to)-g,d.marker,null==d.from),null==d.to)return;d.to==g&&(d=!1)}}if(g>=h)break;for(var P=Math.min(h,m);;){if(y){var E=g+y.length;if(!d){var k=E>P?y.slice(0,P-g):y;e.addToken(e,k,s?s+c:c,p,g+k.length==m?u:"",l,f)}if(E>=P){y=y.slice(P-g),g=P;break}g=E,p=""}y=r.slice(i,i=n[v++]),s=eN(n[v++],e.cm.options)}}})(l,a,er(t,l,u)),l.styleClasses&&(l.styleClasses.bgClass&&(a.bgClass=B(l.styleClasses.bgClass,a.bgClass||"")),l.styleClasses.textClass&&(a.textClass=B(l.styleClasses.textClass,a.textClass||""))),0==a.map.length&&a.map.push(0,0,a.content.appendChild(function(t){if(null==r){var e=R("span","​");N(t,R("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(r=e.offsetWidth<=1&&e.offsetHeight>2&&!(g&&v<8))}var n=r?R("span","​"):R("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}(t.display.measure))),0==s?(e.measure.map=a.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(a.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(y){var p=a.content.lastChild;(/\bcm-tab\b/.test(p.className)||p.querySelector&&p.querySelector(".cm-tab"))&&(a.content.className="cm-tab-wrap-hack")}return tC(t,"renderLine",t,e.line,a.pre),a.pre.className&&(a.textClass=B(a.pre.className,a.textClass||"")),a}function eV(t){var e=R("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function eF(t,e,n,o,r,i,a){if(e){var s,l=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,o="",r=0;r<t.length;r++){var i=t.charAt(r);" "==i&&n&&(r==t.length-1||32==t.charCodeAt(r+1))&&(i="\xa0"),o+=i,n=" "==i}return o}(e,t.trailingSpace):e,c=t.cm.state.specialChars,u=!1;if(c.test(e)){s=document.createDocumentFragment();for(var p=0;;){c.lastIndex=p;var d=c.exec(e),f=d?d.index-p:e.length-p;if(f){var h=document.createTextNode(l.slice(p,p+f));g&&v<9?s.appendChild(R("span",[h])):s.appendChild(h),t.map.push(t.pos,t.pos+f,h),t.col+=f,t.pos+=f}if(!d)break;p+=f+1;var y=void 0;if(" "==d[0]){var m=t.cm.options.tabSize,b=m-t.col%m;(y=s.appendChild(R("span",te(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text"," "),t.col+=b}else"\r"==d[0]||"\n"==d[0]?(y=s.appendChild(R("span","\r"==d[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",d[0]):((y=t.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),g&&v<9?s.appendChild(R("span",[y])):s.appendChild(y)),t.col+=1;t.map.push(t.pos,t.pos+1,y),t.pos++}}else t.col+=e.length,s=document.createTextNode(l),t.map.push(t.pos,t.pos+e.length,s),g&&v<9&&(u=!0),t.pos+=e.length;if(t.trailingSpace=32==l.charCodeAt(e.length-1),n||o||r||u||i||a){var w=n||"";o&&(w+=o),r&&(w+=r);var _=R("span",[s],w,i);if(a)for(var C in a)a.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&_.setAttribute(C,a[C]);return t.content.appendChild(_)}t.content.appendChild(s)}}function eH(t,e,n,o){var r=!o&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!o&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function eU(t,e,n){this.line=e,this.rest=function(t){for(var e,n;e=eS(t,!1);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}(e),this.size=this.rest?tZ(tn(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ek(t,e)}function eB(t,e,n){for(var o,r=[],i=e;i<n;i=o){var a=new eU(t.doc,tK(t.doc,i),i);o=i+a.size,r.push(a)}return r}var ez=null,eW=null;function e$(t,e){var n=tw(t,e);if(n.length){var o,r=Array.prototype.slice.call(arguments,2);ez?o=ez.delayedCallbacks:eW?o=eW:(o=eW=[],setTimeout(eq,0));for(var i=function(t){o.push(function(){return n[t].apply(null,r)})},a=0;a<n.length;++a)i(a)}}function eq(){var t=eW;eW=null;for(var e=0;e<t.length;++e)t[e]()}function eG(t,e,n,o){for(var r=0;r<e.changes.length;r++){var i=e.changes[r];"text"==i?function(t,e){var n=e.text.className,o=eY(t,e);e.text==e.node&&(e.node=o.pre),e.text.parentNode.replaceChild(o.pre,e.text),e.text=o.pre,o.bgClass!=e.bgClass||o.textClass!=e.textClass?(e.bgClass=o.bgClass,e.textClass=o.textClass,eJ(t,e)):n&&(e.text.className=n)}(t,e):"gutter"==i?eX(t,e,n,o):"class"==i?eJ(t,e):"widget"==i&&function(t,e,n){e.alignable&&(e.alignable=null);for(var o=D("CodeMirror-linewidget"),r=e.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,o.test(r.className)&&e.node.removeChild(r);eZ(t,e,n)}(t,e,o)}e.changes=null}function eK(t){return t.node==t.text&&(t.node=R("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),g&&v<8&&(t.node.style.zIndex=2)),t.node}function eY(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):eR(t,e)}function eJ(t,e){(function(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var o=eK(e);e.background=o.insertBefore(R("div",null,n),o.firstChild),t.display.input.setUneditable(e.background)}})(t,e),e.line.wrapClass?eK(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function eX(t,e,n,o){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var r=eK(e);e.gutterBackground=R("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px; width: "+o.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),r.insertBefore(e.gutterBackground,e.text)}var i=e.line.gutterMarkers;if(t.options.lineNumbers||i){var a=eK(e),s=e.gutter=R("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),t.display.input.setUneditable(s),a.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(R("div",t1(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+o.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<t.display.gutterSpecs.length;++l){var c=t.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(R("div",[u],"CodeMirror-gutter-elt","left: "+o.gutterLeft[c]+"px; width: "+o.gutterWidth[c]+"px"))}}}function eZ(t,e,n){if(eQ(t,e.line,e,n,!0),e.rest)for(var o=0;o<e.rest.length;o++)eQ(t,e.rest[o],e,n,!1)}function eQ(t,e,n,o,r){if(e.widgets)for(var i=eK(n),a=0,s=e.widgets;a<s.length;++a){var l=s[a],c=R("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),function(t,e,n,o){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var r=o.wrapperWidth;e.style.left=o.fixedPos+"px",t.coverGutter||(r-=o.gutterTotalWidth,e.style.paddingLeft=o.gutterTotalWidth+"px"),e.style.width=r+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-o.gutterTotalWidth+"px"))}(l,c,n,o),t.display.input.setUneditable(c),r&&l.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),e$(l,"redraw")}}function e0(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!F(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),N(e.display.measure,R("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function e1(t,e){for(var n=tj(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function e2(t){return t.lineSpace.offsetTop}function e5(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function e3(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=N(t.measure,R("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,o={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(t.cachedPaddingH=o),o}function e4(t){return 50-t.display.nativeBarWidth}function e6(t){return t.display.scroller.clientWidth-e4(t)-t.display.barWidth}function e7(t){return t.display.scroller.clientHeight-e4(t)-t.display.barHeight}function e9(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var o=0;o<t.rest.length;o++)if(t.rest[o]==e)return{map:t.measure.maps[o],cache:t.measure.caches[o]};for(var r=0;r<t.rest.length;r++)if(tZ(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function e8(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[nP(t,e)];var n=t.display.externalMeasured;if(n&&e>=n.lineN&&e<n.lineN+n.size)return n}function nt(t,e){var n,o,r,i,a=tZ(e),s=e8(t,a);s&&!s.text?s=null:s&&s.changes&&(eG(t,s,a,nC(t)),t.curOp.forceUpdate=!0),s||(o=tZ(n=eT(n=e)),(r=t.display.externalMeasured=new eU(t.doc,n,o)).lineN=o,i=r.built=eR(t,r),r.text=i.pre,N(t.display.lineMeasure,i.pre),s=r);var l=e9(s,e,a);return{line:e,view:s,rect:null,map:l.map,cache:l.cache,before:l.before,hasHeights:!1}}function ne(t,e,n,r,i){e.before&&(n=-1);var a,s=n+(r||"");return e.cache.hasOwnProperty(s)?a=e.cache[s]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,n){var o=t.options.lineWrapping,r=o&&e6(t);if(!e.measure.heights||o&&e.measure.width!=r){var i=e.measure.heights=[];if(o){e.measure.width=r;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(a=function(t,e,n,r){var i,a,s=no(e.map,n,r),l=s.node,c=s.start,u=s.end,p=s.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&tp(e.line.text.charAt(s.coverStart+c));)--c;for(;s.coverStart+u<s.coverEnd&&tp(e.line.text.charAt(s.coverStart+u));)++u;if((i=g&&v<9&&0==c&&u==s.coverEnd-s.coverStart?l.parentNode.getBoundingClientRect():function(t,e){var n=nn;if("left"==e)for(var o=0;o<t.length&&(n=t[o]).left==n.right;o++);else for(var r=t.length-1;r>=0&&(n=t[r]).left==n.right;r--);return n}(o(l,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,p="right"}g&&v<11&&(i=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=tR)return tR;var e=N(t,R("span","x")),n=e.getBoundingClientRect(),r=o(e,0,1).getBoundingClientRect();return tR=Math.abs(n.left-r.left)>1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}(t.display.measure,i))}else c>0&&(p=r="right"),i=t.options.lineWrapping&&(a=l.getClientRects()).length>1?a["right"==r?a.length-1:0]:l.getBoundingClientRect();if(g&&v<9&&!c&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+n_(t.display),top:f.top,bottom:f.bottom}:nn}for(var h=i.top-e.rect.top,y=i.bottom-e.rect.top,m=(h+y)/2,b=e.view.measure.heights,w=0;w<b.length-1&&!(m<b[w]);w++);var _=w?b[w-1]:0,C=b[w],x={left:("right"==p?i.right:i.left)-e.rect.left,right:("left"==p?i.left:i.right)-e.rect.left,top:_,bottom:C};return i.left||i.right||(x.bogus=!0),t.options.singleCursorHeightPerLine||(x.rtop=h,x.rbottom=y),x}(t,e,n,r)).bogus||(e.cache[s]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var nn={left:0,right:0,top:0,bottom:0};function no(t,e,n){for(var o,r,i,a,s,l,c=0;c<t.length;c+=3)if(s=t[c],l=t[c+1],e<s?(r=0,i=1,a="left"):e<l?i=(r=e-s)+1:(c==t.length-3||e==l&&t[c+3]>e)&&(r=(i=l-s)-1,e>=l&&(a="right")),null!=r){if(o=t[c+2],s==l&&n==(o.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)o=t[(c-=3)+2],a="left";if("right"==n&&r==l-s)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)o=t[(c+=3)+2],a="right";break}return{node:o,start:r,end:i,collapse:a,coverStart:s,coverEnd:l}}function nr(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function ni(t){t.display.externalMeasure=null,I(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)nr(t.display.view[e])}function na(t){ni(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function ns(){return b&&O?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function nl(){return b&&O?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function nc(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=e0(t.widgets[n]));return e}function nu(t,e,n,o,r){if(!r){var i=nc(e);n.top+=i,n.bottom+=i}if("line"==o)return n;o||(o="local");var a=eA(e);if("local"==o?a+=e2(t.display):a-=t.display.viewOffset,"page"==o||"window"==o){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==o?0:nl());var l=s.left+("window"==o?0:ns());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function np(t,e,n){if("div"==n)return e;var o=e.left,r=e.top;if("page"==n)o-=ns(),r-=nl();else if("local"==n||!n){var i=t.display.sizer.getBoundingClientRect();o+=i.left,r+=i.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:o-a.left,top:r-a.top}}function nd(t,e,n,o,r){var i,a;return o||(o=tK(t.doc,e.line)),nu(t,o,(i=o,a=e.ch,ne(t,nt(t,i),a,r)),n)}function nf(t,e,n,o,r,i){function a(e,a){var s=ne(t,r,e,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,nu(t,o,s,n)}o=o||tK(t.doc,e.line),r||(r=nt(t,o));var s=ty(o,t.doc.direction),l=e.ch,c=e.sticky;if(l>=o.text.length?(l=o.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var p=tg(s,l,c),d=th,f=u(l,p,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function nh(t,e){var n=0;e=t8(t.doc,e),t.options.lineWrapping||(n=n_(t.display)*e.ch);var o=tK(t.doc,e.line),r=eA(o)+e2(t.display);return{left:n,right:n,top:r,bottom:r+o.height}}function ng(t,e,n,o,r){var i=t2(t,e,n);return i.xRel=r,o&&(i.outside=o),i}function nv(t,e,n){var o=t.doc;if((n+=t.display.viewOffset)<0)return ng(o.first,0,null,-1,-1);var r=tQ(o,n),i=o.first+o.size-1;if(r>i)return ng(o.first+o.size-1,tK(o,i).text.length,null,1,1);e<0&&(e=0);for(var a=tK(o,r);;){var s=function(t,e,n,o,r){r-=eA(e);var i=nt(t,e),a=nc(e),s=0,l=e.text.length,c=!0,u=ty(e,t.doc.direction);if(u){var p=(t.options.lineWrapping?function(t,e,n,o,r,i,a){var s=ny(t,e,o,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,p=null,d=0;d<r.length;d++){var f=r[d];if(!(f.from>=c)&&!(f.to<=l)){var h=ne(t,o,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=h<i?i-h+1e9:h-i;(!u||p>g)&&(u=f,p=g)}}return u||(u=r[r.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}:function(t,e,n,o,r,i,a){var s=tf(function(s){var l=r[s],c=1!=l.level;return nb(nf(t,t2(n,c?l.to:l.from,c?"before":"after"),"line",e,o),i,a,!0)},0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=nf(t,t2(n,c?l.from:l.to,c?"after":"before"),"line",e,o);nb(u,i,a,!0)&&u.top>a&&(l=r[s-1])}return l})(t,e,n,i,u,o,r);s=(c=1!=p.level)?p.from:p.to-1,l=c?p.to:p.from-1}var d,f,h=null,g=null,v=tf(function(e){var n=ne(t,i,e);return n.top+=a,n.bottom+=a,!!nb(n,o,r,!1)&&(n.top<=r&&n.left<=o&&(h=e,g=n),!0)},s,l),y=!1;if(g){var m=o-g.left<g.right-o,b=m==c;v=h+(b?0:1),f=b?"after":"before",d=m?g.left:g.right}else{!c&&(v==l||v==s)&&v++,f=0==v?"after":v==e.text.length?"before":ne(t,i,v-(c?1:0)).bottom+a<=r==c?"after":"before";var w=nf(t,t2(n,v,f),"line",e,i);d=w.left,y=r<w.top?-1:r>=w.bottom?1:0}return ng(n,v=td(e.text,v,1),f,y,o-d)}(t,a,r,e,n),l=function(t,e){var n,o=eh&&t.markedSpans;if(o)for(var r=0;r<o.length;++r){var i=o[r];i.marker.collapsed&&(null==i.from||i.from<e)&&(null==i.to||i.to>e)&&(!n||0>ex(n,i.marker))&&(n=i.marker)}return n}(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=tK(o,r=c.line)}}function ny(t,e,n,o){o-=nc(e);var r=e.text.length,i=tf(function(e){return ne(t,n,e-1).bottom<=o},r,0);return r=tf(function(e){return ne(t,n,e).top>o},i,r),{begin:i,end:r}}function nm(t,e,n,o){n||(n=nt(t,e));var r=nu(t,e,ne(t,n,o),"line").top;return ny(t,e,n,r)}function nb(t,e,n,o){return!(t.bottom<=n)&&(t.top>n||(o?t.left:t.right)>e)}function nw(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==a){a=R("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)a.appendChild(document.createTextNode("x")),a.appendChild(R("br"));a.appendChild(document.createTextNode("x"))}N(t.measure,a);var n=a.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),I(t.measure),n||1}function n_(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=R("span","xxxxxxxxxx"),n=R("pre",[e],"CodeMirror-line-like");N(t.measure,n);var o=e.getBoundingClientRect(),r=(o.right-o.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function nC(t){for(var e=t.display,n={},o={},r=e.gutters.clientLeft,i=e.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+r,o[s]=i.clientWidth}return{fixedPos:nx(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:o,wrapperWidth:e.wrapper.clientWidth}}function nx(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function nS(t){var e=nw(t.display),n=t.options.lineWrapping,o=n&&Math.max(5,t.display.scroller.clientWidth/n_(t.display)-3);return function(r){if(ek(t.doc,r))return 0;var i=0;if(r.widgets)for(var a=0;a<r.widgets.length;a++)r.widgets[a].height&&(i+=r.widgets[a].height);return n?i+(Math.ceil(r.text.length/o)||1)*e:i+e}}function nO(t){var e=t.doc,n=nS(t);e.iter(function(t){var e=n(t);e!=t.height&&tX(t,e)})}function nT(t,e,n,o){var r=t.display;if(!n&&"true"==tj(e).getAttribute("cm-not-content"))return null;var i,a,s=r.lineSpace.getBoundingClientRect();try{i=e.clientX-s.left,a=e.clientY-s.top}catch(t){return null}var l,c=nv(t,i,a);if(o&&c.xRel>0&&(l=tK(t.doc,c.line).text).length==c.ch){var u=q(l,l.length,t.options.tabSize)-l.length;c=t2(c.line,Math.max(0,Math.round((i-e3(t.display).left)/n_(t.display))-u))}return c}function nP(t,e){if(e>=t.display.viewTo||(e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,o=0;o<n.length;o++)if((e-=n[o].size)<0)return o}function nE(t,e,n,o){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),o||(o=0);var r=t.display;if(o&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>e)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)eh&&eP(t.doc,e)<r.viewTo&&nA(t);else if(n<=r.viewFrom)eh&&eE(t.doc,n+o)>r.viewFrom?nA(t):(r.viewFrom+=o,r.viewTo+=o);else if(e<=r.viewFrom&&n>=r.viewTo)nA(t);else if(e<=r.viewFrom){var i=nj(t,n,n+o,1);i?(r.view=r.view.slice(i.index),r.viewFrom=i.lineN,r.viewTo+=o):nA(t)}else if(n>=r.viewTo){var a=nj(t,e,e,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):nA(t)}else{var s=nj(t,e,e,-1),l=nj(t,n,n+o,1);s&&l?(r.view=r.view.slice(0,s.index).concat(eB(t,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=o):nA(t)}var c=r.externalMeasured;c&&(n<c.lineN?c.lineN+=o:e<c.lineN+c.size&&(r.externalMeasured=null))}function nk(t,e,n){t.curOp.viewChanged=!0;var o=t.display,r=t.display.externalMeasured;if(r&&e>=r.lineN&&e<r.lineN+r.size&&(o.externalMeasured=null),!(e<o.viewFrom)&&!(e>=o.viewTo)){var i=o.view[nP(t,e)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==K(a,n)&&a.push(n)}}}function nA(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function nj(t,e,n,o){var r,i=nP(t,e),a=t.display.view;if(!eh||n==t.doc.first+t.doc.size)return{index:i,lineN:n};for(var s=t.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=e){if(o>0){if(i==a.length-1)return null;r=s+a[i].size-e,i++}else r=s-e;e+=r,n+=r}for(;eP(t.doc,n)!=n;){if(i==(o<0?0:a.length-1))return null;n+=o*a[i-(o<0?1:0)].size,i+=o}return{index:i,lineN:n}}function nM(t){for(var e=t.display.view,n=0,o=0;o<e.length;o++){var r=e[o];!r.hidden&&(!r.node||r.changes)&&++n}return n}function nD(t){t.display.input.showSelection(t.display.input.prepareSelection())}function nL(t,e){void 0===e&&(e=!0);for(var n=t.doc,o={},r=o.cursors=document.createDocumentFragment(),i=o.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(e||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=t.display.viewTo)&&!(s.to().line<t.display.viewFrom)){var l=s.empty();(l||t.options.showCursorWhenSelecting)&&nI(t,s.head,r),l||function(t,e,n){var o=t.display,r=t.doc,i=document.createDocumentFragment(),a=e3(t.display),s=a.left,l=Math.max(o.sizerWidth,e6(t)-o.sizer.offsetLeft)-a.right,c="ltr"==r.direction;function u(t,e,n,o){e<0&&(e=0),e=Math.round(e),o=Math.round(o),i.appendChild(R("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(o-e)+"px"))}function p(e,n,o){var i,a,p=tK(r,e),d=p.text.length;function f(n,o){return nd(t,t2(e,n),"div",p,o)}function h(e,n,o){var r=nm(t,p,null,e),i="ltr"==n==("after"==o)?"left":"right";return f("after"==o?r.begin:r.end-(/\s/.test(p.text.charAt(r.end-1))?2:1),i)[i]}var g=ty(p,r.direction);return function(t,e,n,o){if(!t)return o(e,n,"ltr",0);for(var r=!1,i=0;i<t.length;++i){var a=t[i];(a.from<n&&a.to>e||e==n&&a.to==e)&&(o(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),r=!0)}r||o(e,n,"ltr")}(g,n||0,null==o?d:o,function(t,e,r,p){var v,y,m,b,w="ltr"==r,_=f(t,w?"left":"right"),C=f(e-1,w?"right":"left"),x=null==n&&0==t,S=null==o&&e==d,O=0==p,T=!g||p==g.length-1;if(C.top-_.top<=3){var P=(c?x:S)&&O,E=(c?S:x)&&T,k=P?s:(w?_:C).left,A=E?l:(w?C:_).right;u(k,_.top,A-k,_.bottom)}else w?(v=c&&x&&O?s:_.left,y=c?l:h(t,r,"before"),m=c?s:h(e,r,"after"),b=c&&S&&T?l:C.right):(v=c?h(t,r,"before"):s,y=!c&&x&&O?l:_.right,m=!c&&S&&T?s:C.left,b=c?h(e,r,"after"):l),u(v,_.top,y-v,_.bottom),_.bottom<C.top&&u(s,_.bottom,null,C.top),u(m,C.top,b-m,C.bottom);(!i||0>nN(_,i))&&(i=_),0>nN(C,i)&&(i=C),(!a||0>nN(_,a))&&(a=_),0>nN(C,a)&&(a=C)}),{start:i,end:a}}var d=e.from(),f=e.to();if(d.line==f.line)p(d.line,d.ch,f.ch);else{var h=tK(r,d.line),g=tK(r,f.line),v=eT(h)==eT(g),y=p(d.line,d.ch,v?h.text.length+1:null).end,m=p(f.line,v?0:null,f.ch).start;v&&(y.top<m.top-2?(u(y.right,y.top,null,y.bottom),u(s,m.top,m.left,m.bottom)):u(y.right,y.top,m.left-y.right,y.bottom)),y.bottom<m.top&&u(s,y.bottom,null,m.top)}n.appendChild(i)}(t,s,i)}}return o}function nI(t,e,n){var o=nf(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),r=n.appendChild(R("div","\xa0","CodeMirror-cursor"));if(r.style.left=o.left+"px",r.style.top=o.top+"px",r.style.height=Math.max(0,o.bottom-o.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var i=nd(t,e,"div",null,null);i.right-i.left>0&&(r.style.width=i.right-i.left+"px")}if(o.other){var a=n.appendChild(R("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=o.other.left+"px",a.style.top=o.other.top+"px",a.style.height=(o.other.bottom-o.other.top)*.85+"px"}}function nN(t,e){return t.top-e.top||t.left-e.left}function nR(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval(function(){t.hasFocus()||nU(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function nV(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||nH(t))}function nF(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&nU(t))},100)}function nH(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(tC(t,"focus",t,e),t.state.focused=!0,U(t.display.wrapper,"CodeMirror-focused"),!t.curOp&&t.display.selForContextMenu!=t.doc.sel&&(t.display.input.reset(),y&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),nR(t))}function nU(t,e){t.state.delayingBlurEvent||(t.state.focused&&(tC(t,"blur",t,e),t.state.focused=!1,L(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function nB(t){for(var e=t.display,n=e.lineDiv.offsetTop,o=Math.max(0,e.scroller.getBoundingClientRect().top),r=e.lineDiv.getBoundingClientRect().top,i=0,a=0;a<e.view.length;a++){var s=e.view[a],l=t.options.lineWrapping,c=void 0,u=0;if(!s.hidden){if(r+=s.line.height,g&&v<8){var p=s.node.offsetTop+s.node.offsetHeight;c=p-n,n=p}else{var d=s.node.getBoundingClientRect();c=d.bottom-d.top,!l&&s.text.firstChild&&(u=s.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=s.line.height-c;if((f>.005||f<-.005)&&(r<o&&(i-=f),tX(s.line,c),nz(s.line),s.rest))for(var h=0;h<s.rest.length;h++)nz(s.rest[h]);if(u>t.display.sizerWidth){var y=Math.ceil(u/n_(t.display));y>t.display.maxLineLength&&(t.display.maxLineLength=y,t.display.maxLine=s.line,t.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(e.scroller.scrollTop+=i)}function nz(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],o=n.node.parentNode;o&&(n.height=o.offsetHeight)}}function nW(t,e,n){var o=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;o=Math.floor(o-e2(t));var r=n&&null!=n.bottom?n.bottom:o+t.wrapper.clientHeight,i=tQ(e,o),a=tQ(e,r);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<i?(i=s,a=tQ(e,eA(tK(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=a&&(i=tQ(e,eA(tK(e,l))-t.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function n$(t,e){var n=t.display,o=nw(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,i=e7(t),a={};e.bottom-e.top>i&&(e.bottom=e.top+i);var s=t.doc.height+e5(n),l=e.top<o,c=e.bottom>s-o;if(e.top<r)a.scrollTop=l?0:e.top;else if(e.bottom>r+i){var u=Math.min(e.top,(c?s:e.bottom)-i);u!=r&&(a.scrollTop=u)}var p=t.options.fixedGutter?0:n.gutters.offsetWidth,d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-p,f=e6(t)-n.gutters.offsetWidth,h=e.right-e.left>f;return h&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.left<d?a.scrollLeft=Math.max(0,e.left+p-(h?0:10)):e.right>f+d-3&&(a.scrollLeft=e.right+(h?0:10)-f),a}function nq(t,e){null!=e&&(nY(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function nG(t){nY(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function nK(t,e,n){(null!=e||null!=n)&&nY(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function nY(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=nh(t,e.from),o=nh(t,e.to);nJ(t,n,o,e.margin)}}function nJ(t,e,n,o){var r=n$(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-o,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+o});nK(t,r.scrollLeft,r.scrollTop)}function nX(t,e){2>Math.abs(t.doc.scrollTop-e)||(p||oc(t,{top:e}),nZ(t,e,!0),p&&oc(t),or(t,100))}function nZ(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function nQ(t,e,n,o){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),((n?e!=t.doc.scrollLeft:!(2>Math.abs(t.doc.scrollLeft-e)))||o)&&(t.doc.scrollLeft=e,od(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function n0(t){var e=t.display,n=e.gutters.offsetWidth,o=Math.round(t.doc.height+e5(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:o,scrollHeight:o+e4(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var n1=function(t,e,n){this.cm=n;var o=this.vert=R("div",[R("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=R("div",[R("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=r.tabIndex=-1,t(o),t(r),tb(o,"scroll",function(){o.clientHeight&&e(o.scrollTop,"vertical")}),tb(r,"scroll",function(){r.clientWidth&&e(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&v<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};n1.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,o=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?o+"px":"0";var r=t.viewHeight-(e?o:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=t.barLeft+"px";var i=t.viewWidth-t.barLeft-(n?o:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?o:0,bottom:e?o:0}},n1.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},n1.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},n1.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=P&&!C?"12px":"18px",this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new G,this.disableVert=new G},n1.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,function o(){var r=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,o)})},n1.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var n2=function(){};function n5(t,e){e||(e=n0(t));var n=t.display.barWidth,o=t.display.barHeight;n3(t,e);for(var r=0;r<4&&n!=t.display.barWidth||o!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&nB(t),n3(t,n0(t)),n=t.display.barWidth,o=t.display.barHeight}function n3(t,e){var n=t.display,o=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=o.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=o.bottom)+"px",n.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=o.bottom+"px",n.scrollbarFiller.style.width=o.right+"px"):n.scrollbarFiller.style.display="",o.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=o.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}n2.prototype.update=function(){return{bottom:0,right:0}},n2.prototype.setScrollLeft=function(){},n2.prototype.setScrollTop=function(){},n2.prototype.clear=function(){};var n4={native:n1,null:n2};function n6(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&L(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new n4[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),tb(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?nQ(t,e):nX(t,e)},t),t.display.scrollbars.addClass&&U(t.display.wrapper,t.display.scrollbars.addClass)}var n7=0;function n9(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++n7,markArrays:null},e=t.curOp,ez?ez.ops.push(e):e.ownsGroup=ez={ops:[e],delayedCallbacks:[]}}function n8(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var o=0;o<t.ops.length;o++){var r=t.ops[o];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<e.length)}(n)}finally{ez=null,e(n)}}(e,function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;(function(t){for(var e,n=t.ops,o=0;o<n.length;o++)(function(t){var e=t.cm,n=e.display;(function(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=e4(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=e4(t)+"px",e.scrollbarsClipped=!0)})(e),t.updateMaxLine&&eM(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new oa(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)})(n[o]);for(var r=0;r<n.length;r++)(e=n[r]).updatedDisplay=e.mustUpdate&&os(e.cm,e.update);for(var i=0;i<n.length;i++)(function(t){var e,n,o=t.cm,r=o.display;t.updatedDisplay&&nB(o),t.barMeasure=n0(o),r.maxLineChanged&&!o.options.lineWrapping&&(t.adjustWidthTo=(e=r.maxLine,n=r.maxLine.text.length,ne(o,nt(o,e),n,void 0)).left+3,o.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+t.adjustWidthTo+e4(o)+o.display.barWidth),t.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+t.adjustWidthTo-e6(o))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=r.input.prepareSelection())})(n[i]);for(var a=0;a<n.length;a++)(function(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&nQ(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==H();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&n5(e,t.barMeasure),t.updatedDisplay&&op(e,t.barMeasure),t.selectionChanged&&nR(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&nV(t.cm)})(n[a]);for(var s=0;s<n.length;s++)(function(t){var e=t.cm,n=e.display,o=e.doc;if(t.updatedDisplay&&ol(e,t.update),null!=n.wheelStartX&&(null!=t.scrollTop||null!=t.scrollLeft||t.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&nZ(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&nQ(e,t.scrollLeft,!0,!0),t.scrollToPos){var r=function(t,e,n,o){null==o&&(o=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?t2(e.line,e.ch+1,"before"):e,e=e.ch?t2(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var r,i=0;i<5;i++){var a=!1,s=nf(t,e),l=n&&n!=e?nf(t,n):s,c=n$(t,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-o,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+o}),u=t.doc.scrollTop,p=t.doc.scrollLeft;if(null!=c.scrollTop&&(nX(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(nQ(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return r}(e,t8(o,t.scrollToPos.from),t8(o,t.scrollToPos.to),t.scrollToPos.margin);!function(t,e){if(!tx(t,"scrollCursorIntoView")){var n=t.display,o=n.sizer.getBoundingClientRect(),r=null;if(e.top+o.top<0?r=!0:e.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!x){var i=R("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-e2(t.display))+"px;\n height: "+(e.bottom-e.top+e4(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(i),i.scrollIntoView(r),t.display.lineSpace.removeChild(i)}}}(e,r)}var i=t.maybeHiddenMarkers,a=t.maybeUnhiddenMarkers;if(i)for(var s=0;s<i.length;++s)i[s].lines.length||tC(i[s],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&tC(a[l],"unhide");n.wrapper.offsetHeight&&(o.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&tC(e,"changes",e,t.changeObjs),t.update&&t.update.finish()})(n[s])})(t)})}function ot(t,e){if(t.curOp)return e();n9(t);try{return e()}finally{n8(t)}}function oe(t,e){return function(){if(t.curOp)return e.apply(t,arguments);n9(t);try{return e.apply(t,arguments)}finally{n8(t)}}}function on(t){return function(){if(this.curOp)return t.apply(this,arguments);n9(this);try{return t.apply(this,arguments)}finally{n8(this)}}}function oo(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);n9(e);try{return t.apply(this,arguments)}finally{n8(e)}}}function or(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,W(oi,t))}function oi(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,o=ei(t,e.highlightFrontier),r=[];e.iter(o.line,Math.min(e.first+e.size,t.display.viewTo+500),function(i){if(o.line>=t.display.viewFrom){var a=i.styles,s=i.text.length>t.options.maxHighlightLength?tW(e.mode,o.state):null,l=eo(t,i,o,!0);s&&(o.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var p=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!p&&d<a.length;++d)p=a[d]!=i.styles[d];p&&r.push(o.line),i.stateAfter=o.save(),o.nextLine()}else i.text.length<=t.options.maxHighlightLength&&ea(t,i.text,o),i.stateAfter=o.line%5==0?o.save():null,o.nextLine();if(+new Date>n)return or(t,t.options.workDelay),!0}),e.highlightFrontier=o.line,e.modeFrontier=Math.max(e.modeFrontier,o.line),r.length&&ot(t,function(){for(var e=0;e<r.length;e++)nk(t,r[e],"text")})}}var oa=function(t,e,n){var o=t.display;this.viewport=e,this.visible=nW(o,t.doc,e),this.editorIsHidden=!o.wrapper.offsetWidth,this.wrapperHeight=o.wrapper.clientHeight,this.wrapperWidth=o.wrapper.clientWidth,this.oldDisplayWidth=e6(t),this.force=n,this.dims=nC(t),this.events=[]};function os(t,e){var n,o,r,i=t.display,a=t.doc;if(e.editorIsHidden)return nA(t),!1;if(!e.force&&e.visible.from>=i.viewFrom&&e.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==nM(t))return!1;of(t)&&(nA(t),e.dims=nC(t));var s=a.first+a.size,l=Math.max(e.visible.from-t.options.viewportMargin,a.first),c=Math.min(s,e.visible.to+t.options.viewportMargin);i.viewFrom<l&&l-i.viewFrom<20&&(l=Math.max(a.first,i.viewFrom)),i.viewTo>c&&i.viewTo-c<20&&(c=Math.min(s,i.viewTo)),eh&&(l=eP(t.doc,l),c=eE(t.doc,c));var u=l!=i.viewFrom||c!=i.viewTo||i.lastWrapHeight!=e.wrapperHeight||i.lastWrapWidth!=e.wrapperWidth;n=l,o=c,0==(r=t.display).view.length||n>=r.viewTo||o<=r.viewFrom?(r.view=eB(t,n,o),r.viewFrom=n):(r.viewFrom>n?r.view=eB(t,n,r.viewFrom).concat(r.view):r.viewFrom<n&&(r.view=r.view.slice(nP(t,n))),r.viewFrom=n,r.viewTo<o?r.view=r.view.concat(eB(t,r.viewTo,o)):r.viewTo>o&&(r.view=r.view.slice(0,nP(t,o)))),r.viewTo=o,i.viewOffset=eA(tK(t.doc,i.viewFrom)),t.display.mover.style.top=i.viewOffset+"px";var p=nM(t);if(!u&&0==p&&!e.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var d=function(t){if(t.hasFocus())return null;var e=H();if(!e||!F(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var o=window.getSelection();o.anchorNode&&o.extend&&F(t.display.lineDiv,o.anchorNode)&&(n.anchorNode=o.anchorNode,n.anchorOffset=o.anchorOffset,n.focusNode=o.focusNode,n.focusOffset=o.focusOffset)}return n}(t);return p>4&&(i.lineDiv.style.display="none"),function(t,e,n){var o=t.display,r=t.options.lineNumbers,i=o.lineDiv,a=i.firstChild;function s(e){var n=e.nextSibling;return y&&P&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var l=o.view,c=o.viewFrom,u=0;u<l.length;u++){var p=l[u];if(p.hidden);else if(p.node&&p.node.parentNode==i){for(;a!=p.node;)a=s(a);var d=r&&null!=e&&e<=c&&p.lineNumber;p.changes&&(K(p.changes,"gutter")>-1&&(d=!1),eG(t,p,c,n)),d&&(I(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(t1(t.options,c)))),a=p.node.nextSibling}else{var f=function(t,e,n,o){var r=eY(t,e);return e.text=e.node=r.pre,r.bgClass&&(e.bgClass=r.bgClass),r.textClass&&(e.textClass=r.textClass),eJ(t,e),eX(t,e,n,o),eZ(t,e,o),e.node}(t,p,c,n);i.insertBefore(f,a)}c+=p.size}for(;a;)a=s(a)}(t,i.updateLineNumbers,e.dims),p>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,function(t){if(t&&t.activeElt&&t.activeElt!=H()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&F(document.body,t.anchorNode)&&F(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(d),I(i.cursorDiv),I(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,u&&(i.lastWrapHeight=e.wrapperHeight,i.lastWrapWidth=e.wrapperWidth,or(t,400)),i.updateLineNumbers=null,!0}function ol(t,e){for(var n=e.viewport,o=!0;;o=!1){if(o&&t.options.lineWrapping&&e.oldDisplayWidth!=e6(t))o&&(e.visible=nW(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+e5(t.display)-e7(t),n.top)}),e.visible=nW(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!os(t,e))break;nB(t);var r=n0(t);nD(t),n5(t,r),op(t,r),e.force=!1}e.signal(t,"update",t),(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo)&&(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function oc(t,e){var n=new oa(t,e);if(os(t,n)){nB(t),ol(t,n);var o=n0(t);nD(t),n5(t,o),op(t,o),n.finish()}}function ou(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",e$(t,"gutterChanged",t)}function op(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+e4(t)+"px"}function od(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var o=nx(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,i=o+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=i),n[a].gutterBackground&&(n[a].gutterBackground.style.left=i));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}t.options.fixedGutter&&(e.gutters.style.left=o+r+"px")}}function of(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=t1(t.options,e.first+e.size-1),o=t.display;if(n.length!=o.lineNumChars){var r=o.measure.appendChild(R("div",[R("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=r.firstChild.offsetWidth,a=r.offsetWidth-i;return o.lineGutter.style.width="",o.lineNumInnerWidth=Math.max(i,o.lineGutter.offsetWidth-a)+1,o.lineNumWidth=o.lineNumInnerWidth+a,o.lineNumChars=o.lineNumInnerWidth?n.length:-1,o.lineGutter.style.width=o.lineNumWidth+"px",ou(t.display),!0}return!1}function oh(t,e){for(var n=[],o=!1,r=0;r<t.length;r++){var i=t[r],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!e)continue;o=!0}n.push({className:i,style:a})}return e&&!o&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function og(t){var e=t.gutters,n=t.gutterSpecs;I(e),t.lineGutter=null;for(var o=0;o<n.length;++o){var r=n[o],i=r.className,a=r.style,s=e.appendChild(R("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",ou(t)}function ov(t){og(t.display),nE(t),od(t)}function oy(t,e,n,o){this.input=n,this.scrollbarFiller=R("div",null,"CodeMirror-scrollbar-filler"),this.scrollbarFiller.setAttribute("cm-not-content","true"),this.gutterFiller=R("div",null,"CodeMirror-gutter-filler"),this.gutterFiller.setAttribute("cm-not-content","true"),this.lineDiv=V("div",null,"CodeMirror-code"),this.selectionDiv=R("div",null,null,"position: relative; z-index: 1"),this.cursorDiv=R("div",null,"CodeMirror-cursors"),this.measure=R("div",null,"CodeMirror-measure"),this.lineMeasure=R("div",null,"CodeMirror-measure"),this.lineSpace=V("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var r=V("div",[this.lineSpace],"CodeMirror-lines");this.mover=R("div",[r],null,"position: relative"),this.sizer=R("div",[this.mover],"CodeMirror-sizer"),this.sizerWidth=null,this.heightForcer=R("div",null,null,"position: absolute; height: 50px; width: 1px;"),this.gutters=R("div",null,"CodeMirror-gutters"),this.lineGutter=null,this.scroller=R("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll"),this.scroller.setAttribute("tabIndex","-1"),this.wrapper=R("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror"),this.wrapper.setAttribute("translate","no"),g&&v<8&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0),y||p&&T||(this.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(this.wrapper):t(this.wrapper)),this.viewFrom=this.viewTo=e.first,this.reportedViewFrom=this.reportedViewTo=e.first,this.view=[],this.renderedView=null,this.externalMeasured=null,this.viewOffset=0,this.lastWrapHeight=this.lastWrapWidth=0,this.updateLineNumbers=null,this.nativeBarWidth=this.barHeight=this.barWidth=0,this.scrollbarsClipped=!1,this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null,this.alignWidgets=!1,this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null,this.maxLine=null,this.maxLineLength=0,this.maxLineChanged=!1,this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null,this.shift=!1,this.selForContextMenu=null,this.activeTouch=null,this.gutterSpecs=oh(o.gutters,o.lineNumbers),og(this),n.init(this)}oa.prototype.signal=function(t,e){tO(t,e)&&this.events.push(arguments)},oa.prototype.finish=function(){for(var t=0;t<this.events.length;t++)tC.apply(null,this.events[t])};var om=0,ob=null;function ow(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function o_(t,e){var n=ow(e),o=n.x,r=n.y,i=t.display,a=i.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(o&&s||r&&l){if(r&&P&&y){t:for(var c=e.target,u=i.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){t.display.currentWheelTarget=c;break t}}if(o&&!p&&!w&&null!=ob){r&&l&&nX(t,Math.max(0,a.scrollTop+r*ob)),nQ(t,Math.max(0,a.scrollLeft+o*ob)),(!r||r&&l)&&tP(e),i.wheelStartX=null;return}if(r&&null!=ob){var f=r*ob,h=t.doc.scrollTop,g=h+i.wrapper.clientHeight;f<0?h=Math.max(0,h+f-50):g=Math.min(t.doc.height,g+f+50),oc(t,{top:h,bottom:g})}om<20&&(null==i.wheelStartX?(i.wheelStartX=a.scrollLeft,i.wheelStartY=a.scrollTop,i.wheelDX=o,i.wheelDY=r,setTimeout(function(){if(null!=i.wheelStartX){var t=a.scrollLeft-i.wheelStartX,e=a.scrollTop-i.wheelStartY,n=e&&i.wheelDY&&e/i.wheelDY||t&&i.wheelDX&&t/i.wheelDX;i.wheelStartX=i.wheelStartY=null,n&&(ob=(ob*om+n)/(om+1),++om)}},200)):(i.wheelDX+=o,i.wheelDY+=r))}}g?ob=-.53:p?ob=15:b?ob=-.7:_&&(ob=-1/3);var oC=function(t,e){this.ranges=t,this.primIndex=e};oC.prototype.primary=function(){return this.ranges[this.primIndex]},oC.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],o=t.ranges[e];if(!t3(n.anchor,o.anchor)||!t3(n.head,o.head))return!1}return!0},oC.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new ox(t4(this.ranges[e].anchor),t4(this.ranges[e].head));return new oC(t,this.primIndex)},oC.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},oC.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var o=this.ranges[n];if(t5(e,o.from())>=0&&0>=t5(t,o.to()))return n}return -1};var ox=function(t,e){this.anchor=t,this.head=e};function oS(t,e,n){var o=t&&t.options.selectionsMayTouch,r=e[n];e.sort(function(t,e){return t5(t.from(),e.from())}),n=K(e,r);for(var i=1;i<e.length;i++){var a=e[i],s=e[i-1],l=t5(s.to(),a.from());if(o&&!a.empty()?l>0:l>=0){var c=t7(s.from(),a.from()),u=t6(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,e.splice(--i,2,new ox(p?u:c,p?c:u))}}return new oC(e,n)}function oO(t,e){return new oC([new ox(t,e||t)],0)}function oT(t){return t.text?t2(t.from.line+t.text.length-1,tn(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function oP(t,e){if(0>t5(t,e.from))return t;if(0>=t5(t,e.to))return oT(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,o=t.ch;return t.line==e.to.line&&(o+=oT(e).ch-e.to.ch),t2(n,o)}function oE(t,e){for(var n=[],o=0;o<t.sel.ranges.length;o++){var r=t.sel.ranges[o];n.push(new ox(oP(r.anchor,e),oP(r.head,e)))}return oS(t.cm,n,t.sel.primIndex)}function ok(t,e,n){return t.line==e.line?t2(n.line,t.ch-e.ch+n.ch):t2(n.line+(t.line-e.line),t.ch)}function oA(t){t.doc.mode=tB(t.options,t.doc.modeOption),oj(t)}function oj(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,or(t,100),t.state.modeGen++,t.curOp&&nE(t)}function oM(t,e){return 0==e.from.ch&&0==e.to.ch&&""==tn(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function oD(t,e,n,o){function r(t){return n?n[t]:null}function i(t,n,r){var i;t.text=n,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),eb(t),ew(t,r),(i=o?o(t):1)!=t.height&&tX(t,i),e$(t,"change",t,e)}function a(t,e){for(var n=[],i=t;i<e;++i)n.push(new eD(c[i],r(i),o));return n}var s=e.from,l=e.to,c=e.text,u=tK(t,s.line),p=tK(t,l.line),d=tn(c),f=r(c.length-1),h=l.line-s.line;if(e.full)t.insert(0,a(0,c.length)),t.remove(c.length,t.size-c.length);else if(oM(t,e)){var g=a(0,c.length-1);i(p,p.text,f),h&&t.remove(s.line,h),g.length&&t.insert(s.line,g)}else if(u==p){if(1==c.length)i(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),f);else{var v=a(1,c.length-1);v.push(new eD(d+u.text.slice(l.ch),f,o)),i(u,u.text.slice(0,s.ch)+c[0],r(0)),t.insert(s.line+1,v)}}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+p.text.slice(l.ch),r(0)),t.remove(s.line+1,h);else{i(u,u.text.slice(0,s.ch)+c[0],r(0)),i(p,d+p.text.slice(l.ch),f);var y=a(1,c.length-1);h>1&&t.remove(s.line+1,h-1),t.insert(s.line+1,y)}e$(t,"change",t,e)}function oL(t,e,n){!function t(o,r,i){if(o.linked)for(var a=0;a<o.linked.length;++a){var s=o.linked[a];if(s.doc!=r){var l=i&&s.sharedHist;(!n||l)&&(e(s.doc,l),t(s.doc,o,l))}}}(t,null,!0)}function oI(t,e){if(e.cm)throw Error("This document is already in use.");t.doc=e,e.cm=t,nO(t),oA(t),oN(t),t.options.direction=e.direction,t.options.lineWrapping||eM(t),t.options.mode=e.modeOption,nE(t)}function oN(t){("rtl"==t.doc.direction?U:L)(t.display.lineDiv,"CodeMirror-rtl")}function oR(t){this.done=[],this.undone=[],this.undoDepth=t?t.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t?t.maxGeneration:1}function oV(t,e){var n={from:t4(e.from),to:oT(e),text:tY(t,e.from,e.to)};return oB(t,n,e.from.line,e.to.line+1),oL(t,function(t){return oB(t,n,e.from.line,e.to.line+1)},!0),n}function oF(t){for(;t.length;)if(tn(t).ranges)t.pop();else break}function oH(t,e,n,o){var r,i=t.history;i.undone.length=0;var a,s=+new Date;if((i.lastOp==o||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(a=i.lastOp==o?(oF(i.done),tn(i.done)):i.done.length&&!tn(i.done).ranges?tn(i.done):i.done.length>1&&!i.done[i.done.length-2].ranges?(i.done.pop(),tn(i.done)):void 0))r=tn(a.changes),0==t5(e.from,e.to)&&0==t5(e.from,r.to)?r.to=oT(e):a.changes.push(oV(t,e));else{var l=tn(i.done);for(l&&l.ranges||oU(t.sel,i.done),a={changes:[oV(t,e)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=o,i.lastOrigin=i.lastSelOrigin=e.origin,r||tC(t,"historyAdded")}function oU(t,e){var n=tn(e);n&&n.ranges&&n.equals(t)||e.push(t)}function oB(t,e,n,o){var r=e["spans_"+t.id],i=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,o),function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[i]=n.markedSpans),++i})}function oz(t,e){var n=function(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var o=[],r=0;r<e.text.length;++r)o.push(function(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}(n[r]));return o}(t,e),o=ey(t,e);if(!n)return o;if(!o)return n;for(var r=0;r<n.length;++r){var i=n[r],a=o[r];if(i&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue e;i.push(l)}else a&&(n[r]=a)}return n}function oW(t,e,n){for(var o=[],r=0;r<t.length;++r){var i=t[r];if(i.ranges){o.push(n?oC.prototype.deepCopy.call(i):i);continue}var a=i.changes,s=[];o.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),e)for(var p in c)(u=p.match(/^spans_(\d+)$/))&&K(e,Number(u[1]))>-1&&(tn(s)[p]=c[p],delete c[p])}}return o}function o$(t,e,n,o){if(!o)return new ox(n||e,e);var r=t.anchor;if(n){var i=0>t5(e,r);i!=0>t5(n,r)?(r=e,e=n):i!=0>t5(e,n)&&(e=n)}return new ox(r,e)}function oq(t,e,n,o,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),oJ(t,new oC([o$(t.sel.primary(),e,n,r)],0),o)}function oG(t,e,n){for(var o=[],r=t.cm&&(t.cm.display.shift||t.extend),i=0;i<t.sel.ranges.length;i++)o[i]=o$(t.sel.ranges[i],e[i],null,r);var a=oS(t.cm,o,t.sel.primIndex);oJ(t,a,n)}function oK(t,e,n,o){var r=t.sel.ranges.slice(0);r[e]=n,oJ(t,oS(t.cm,r,t.sel.primIndex),o)}function oY(t,e,n){var o=t.history.done,r=tn(o);r&&r.ranges?(o[o.length-1]=e,oX(t,e,n)):oJ(t,e,n)}function oJ(t,e,n){var o,r,i,a,s,l,c,u;oX(t,e,n),o=t,r=t.sel,i=t.cm?t.cm.curOp.id:NaN,a=n,c=o.history,u=a&&a.origin,i==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(s=tn(c.done),"*"==(l=u.charAt(0))||"+"==l&&s.ranges.length==r.ranges.length&&s.somethingSelected()==r.somethingSelected()&&new Date-o.history.lastSelTime<=(o.cm?o.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=r:oU(r,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=i,a&&!1!==a.clearRedo&&oF(c.undone)}function oX(t,e,n){if(tO(t,"beforeSelectionChange")||t.cm&&tO(t.cm,"beforeSelectionChange")){var o,r;r={ranges:(o=e).ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new ox(t8(t,e[n].anchor),t8(t,e[n].head))},origin:n&&n.origin},tC(t,"beforeSelectionChange",t,r),t.cm&&tC(t.cm,"beforeSelectionChange",t.cm,r),e=r.ranges!=o.ranges?oS(t.cm,r.ranges,r.ranges.length-1):o}var i=n&&n.bias||(0>t5(e.primary().head,t.sel.primary().head)?-1:1);oZ(t,o0(t,e,i,!0)),!(n&&!1===n.scroll)&&t.cm&&"nocursor"!=t.cm.getOption("readOnly")&&nG(t.cm)}function oZ(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,tS(t.cm)),e$(t,"cursorActivity",t))}function oQ(t){oZ(t,o0(t,t.sel,null,!1))}function o0(t,e,n,o){for(var r,i=0;i<e.ranges.length;i++){var a=e.ranges[i],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[i],l=o2(t,a.anchor,s&&s.anchor,n,o),c=o2(t,a.head,s&&s.head,n,o);(r||l!=a.anchor||c!=a.head)&&(r||(r=e.ranges.slice(0,i)),r[i]=new ox(l,c))}return r?oS(t.cm,r,e.primIndex):e}function o1(t,e,n,o,r){var i=tK(t,e.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(u?s.to>=e.ch:s.to>e.ch))){if(r&&(tC(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var p=l.find(o<0?1:-1),d=void 0;if((o<0?u:c)&&(p=o5(t,p,-o,p&&p.line==e.line?i:null)),p&&p.line==e.line&&(d=t5(p,n))&&(o<0?d<0:d>0))return o1(t,p,e,o,r)}var f=l.find(o<0?-1:1);return(o<0?c:u)&&(f=o5(t,f,o,f.line==e.line?i:null)),f?o1(t,f,e,o,r):null}}return e}function o2(t,e,n,o,r){var i=o||1;return o1(t,e,n,i,r)||!r&&o1(t,e,n,i,!0)||o1(t,e,n,-i,r)||!r&&o1(t,e,n,-i,!0)||(t.cantEdit=!0,t2(t.first,0))}function o5(t,e,n,o){return n<0&&0==e.ch?e.line>t.first?t8(t,t2(e.line-1)):null:n>0&&e.ch==(o||tK(t,e.line)).text.length?e.line<t.first+t.size-1?t2(e.line+1,0):null:new t2(e.line,e.ch+n)}function o3(t){t.setSelection(t2(t.firstLine(),0),t2(t.lastLine()),J)}function o4(t,e,n){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return(n&&(o.update=function(e,n,r,i){e&&(o.from=t8(t,e)),n&&(o.to=t8(t,n)),r&&(o.text=r),void 0!==i&&(o.origin=i)}),tC(t,"beforeChange",t,o),t.cm&&tC(t.cm,"beforeChange",t.cm,o),o.canceled)?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function o6(t,e,n){if(t.cm){if(!t.cm.curOp)return oe(t.cm,o6)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(tO(t,"beforeChange")||t.cm&&tO(t.cm,"beforeChange"))||(e=o4(t,e,!0))){var o=ef&&!n&&function(t,e,n){var o=null;if(t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;n.readOnly&&(!o||-1==K(o,n))&&(o||(o=[])).push(n)}}),!o)return null;for(var r=[{from:e,to:n}],i=0;i<o.length;++i)for(var a=o[i],s=a.find(0),l=0;l<r.length;++l){var c=r[l];if(!(0>t5(c.to,s.from)||t5(c.from,s.to)>0)){var u=[l,1],p=t5(c.from,s.from),d=t5(c.to,s.to);!(p<0)&&(a.inclusiveLeft||p)||u.push({from:c.from,to:s.from}),!(d>0)&&(a.inclusiveRight||d)||u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}(t,e.from,e.to);if(o)for(var r=o.length-1;r>=0;--r)o7(t,{from:o[r].from,to:o[r].to,text:r?[""]:e.text,origin:e.origin});else o7(t,e)}}function o7(t,e){if(1!=e.text.length||""!=e.text[0]||0!=t5(e.from,e.to)){var n=oE(t,e);oH(t,e,n,t.cm?t.cm.curOp.id:NaN),rt(t,e,n,ey(t,e));var o=[];oL(t,function(t,n){n||-1!=K(o,t.history)||(rr(t.history,e),o.push(t.history)),rt(t,e,null,ey(t,e))})}}function o9(t,e,n){var o=t.cm&&t.cm.state.suppressEdits;if(!o||n){for(var r,i=t.history,a=t.sel,s="undo"==e?i.done:i.undone,l="undo"==e?i.undone:i.done,c=0;c<s.length&&(r=s[c],n?!r.ranges||r.equals(t.sel):r.ranges);c++);if(c!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if((r=s.pop()).ranges){if(oU(r,l),n&&!r.equals(t.sel)){oJ(t,r,{clearRedo:!1});return}a=r}else if(o){s.push(r);return}else break;var u=[];oU(a,l),l.push({changes:u,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var p=tO(t,"beforeChange")||t.cm&&tO(t.cm,"beforeChange"),d=r.changes.length-1;d>=0;--d){var f=function(n){var o=r.changes[n];if(o.origin=e,p&&!o4(t,o,!1))return s.length=0,{};u.push(oV(t,o));var i=n?oE(t,o):tn(s);rt(t,o,i,oz(t,o)),!n&&t.cm&&t.cm.scrollIntoView({from:o.from,to:oT(o)});var a=[];oL(t,function(t,e){e||-1!=K(a,t.history)||(rr(t.history,o),a.push(t.history)),rt(t,o,null,oz(t,o))})}(d);if(f)return f.v}}}}function o8(t,e){if(0!=e&&(t.first+=e,t.sel=new oC(to(t.sel.ranges,function(t){return new ox(t2(t.anchor.line+e,t.anchor.ch),t2(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){nE(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,o=n.viewFrom;o<n.viewTo;o++)nk(t.cm,o,"gutter")}}function rt(t,e,n,o){if(t.cm&&!t.cm.curOp)return oe(t.cm,rt)(t,e,n,o);if(e.to.line<t.first){o8(t,e.text.length-1-(e.to.line-e.from.line));return}if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var r=e.text.length-1-(t.first-e.from.line);o8(t,r),e={from:t2(t.first,0),to:t2(e.to.line+r,e.to.ch),text:[tn(e.text)],origin:e.origin}}var i=t.lastLine();e.to.line>i&&(e={from:e.from,to:t2(i,tK(t,i).text.length),text:[e.text[0]],origin:e.origin}),e.removed=tY(t,e.from,e.to),n||(n=oE(t,e)),t.cm?function(t,e,n){var o=t.doc,r=t.display,i=e.from,a=e.to,s=!1,l=i.line;t.options.lineWrapping||(l=tZ(eT(tK(o,i.line))),o.iter(l,a.line+1,function(t){if(t==r.maxLine)return s=!0,!0})),o.sel.contains(e.from,e.to)>-1&&tS(t),oD(o,e,n,nS(t)),!t.options.lineWrapping&&(o.iter(l,i.line+e.text.length,function(t){var e=ej(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,s=!1)}),s&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,o=e-1;o>n;o--){var r=tK(t,o).stateAfter;if(r&&(!(r instanceof ee)||o+r.lookAhead<e)){n=o+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}(o,i.line),or(t,400);var c=e.text.length-(a.line-i.line)-1;e.full?nE(t):i.line!=a.line||1!=e.text.length||oM(t.doc,e)?nE(t,i.line,a.line+1,c):nk(t,i.line,"text");var u=tO(t,"changes"),p=tO(t,"change");if(p||u){var d={from:i,to:a,text:e.text,removed:e.removed,origin:e.origin};p&&e$(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}(t.cm,e,o):oD(t,e,o),oX(t,n,J),t.cantEdit&&o2(t,t2(t.firstLine(),0))&&(t.cantEdit=!1)}}function re(t,e,n,o,r){var i;o||(o=n),0>t5(o,n)&&(n=(i=[o,n])[0],o=i[1]),"string"==typeof e&&(e=t.splitLines(e)),o6(t,{from:n,to:o,text:e,origin:r})}function rn(t,e,n,o){n<t.line?t.line+=o:e<t.line&&(t.line=e,t.ch=0)}function ro(t,e,n,o){for(var r=0;r<t.length;++r){var i=t[r],a=!0;if(i.ranges){i.copied||((i=t[r]=i.deepCopy()).copied=!0);for(var s=0;s<i.ranges.length;s++)rn(i.ranges[s].anchor,e,n,o),rn(i.ranges[s].head,e,n,o);continue}for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(n<c.from.line)c.from=t2(c.from.line+o,c.from.ch),c.to=t2(c.to.line+o,c.to.ch);else if(e<=c.to.line){a=!1;break}}a||(t.splice(0,r+1),r=0)}}function rr(t,e){var n=e.from.line,o=e.to.line,r=e.text.length-(o-n)-1;ro(t.done,n,o,r),ro(t.undone,n,o,r)}function ri(t,e,n,o){var r=e,i=e;return("number"==typeof e?i=tK(t,t9(t,e)):r=tZ(e),null==r)?null:(o(i,r)&&t.cm&&nk(t.cm,r,n),i)}function ra(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function rs(t){this.children=t;for(var e=0,n=0,o=0;o<t.length;++o){var r=t[o];e+=r.chunkSize(),n+=r.height,r.parent=this}this.size=e,this.height=n,this.parent=null}ox.prototype.from=function(){return t7(this.anchor,this.head)},ox.prototype.to=function(){return t6(this.anchor,this.head)},ox.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ra.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,o=t+e;n<o;++n){var r=this.lines[n];this.height-=r.height,r.parent=null,eb(r),e$(r,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var o=0;o<e.length;++o)e[o].parent=this},iterN:function(t,e,n){for(var o=t+e;t<o;++t)if(n(this.lines[t]))return!0}},rs.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var o=this.children[n],r=o.chunkSize();if(t<r){var i=Math.min(e,r-t),a=o.height;if(o.removeInner(t,i),this.height-=a-o.height,r==i&&(this.children.splice(n--,1),o.parent=null),0==(e-=i))break;t=0}else t-=r}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof ra))){var s=[];this.collapse(s),this.children=[new ra(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var o=0;o<this.children.length;++o){var r=this.children[o],i=r.chunkSize();if(t<=i){if(r.insertInner(t,e,n),r.lines&&r.lines.length>50){for(var a=r.lines.length%25+25,s=a;s<r.lines.length;){var l=new ra(r.lines.slice(s,s+=25));r.height-=l.height,this.children.splice(++o,0,l),l.parent=this}r.lines=r.lines.slice(0,a),this.maybeSpill()}break}t-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new rs(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=K(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var o=new rs(t.children);o.parent=t,t.children=[o,e],t=o}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var o=0;o<this.children.length;++o){var r=this.children[o],i=r.chunkSize();if(t<i){var a=Math.min(e,i-t);if(r.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=i}}};var rl=function(t,e,n){if(n)for(var o in n)n.hasOwnProperty(o)&&(this[o]=n[o]);this.doc=t,this.node=e};function rc(t,e,n){eA(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&nq(t,n)}rl.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,o=tZ(n);if(null!=o&&e){for(var r=0;r<e.length;++r)e[r]==this&&e.splice(r--,1);e.length||(n.widgets=null);var i=e0(this);tX(n,Math.max(0,n.height-i)),t&&(ot(t,function(){rc(t,n,-i),nk(t,o,"widget")}),e$(t,"lineWidgetCleared",t,this,o))}},rl.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,o=this.line;this.height=null;var r=e0(this)-e;r&&(ek(this.doc,o)||tX(o,o.height+r),n&&ot(n,function(){n.curOp.forceUpdate=!0,rc(n,o,r),e$(n,"lineWidgetChanged",n,t,tZ(o))}))},tT(rl);var ru=0,rp=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++ru};function rd(t,e,n,o,r){if(o&&o.shared){var i,a,s,l;return(i=$(i=o)).shared=!1,s=(a=[rd(t,e,n,i,r)])[0],l=i.widgetNode,oL(t,function(t){l&&(i.widgetNode=l.cloneNode(!0)),a.push(rd(t,t8(t,e),t8(t,n),i,r));for(var o=0;o<t.linked.length;++o)if(t.linked[o].isParent)return;s=tn(a)}),new rf(a,s)}if(t.cm&&!t.cm.curOp)return oe(t.cm,rd)(t,e,n,o,r);var c=new rp(t,r),u=t5(e,n);if(o&&$(o,c,!1),u>0||0==u&&!1!==c.clearWhenEmpty)return c;if(c.replacedWith&&(c.collapsed=!0,c.widgetNode=V("span",[c.replacedWith],"CodeMirror-widget"),o.handleMouseEvents||c.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(c.widgetNode.insertLeft=!0)),c.collapsed){if(eO(t,e.line,e,n,c)||e.line!=n.line&&eO(t,n.line,e,n,c))throw Error("Inserting collapsed marker partially overlapping an existing one");eh=!0}c.addToHistory&&oH(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var p,d=e.line,f=t.cm;if(t.iter(d,n.line+1,function(o){var r,i,a;f&&c.collapsed&&!f.options.lineWrapping&&eT(o)==f.display.maxLine&&(p=!0),c.collapsed&&d!=e.line&&tX(o,0),r=new eg(c,d==e.line?e.ch:null,d==n.line?n.ch:null),(a=(i=t.cm&&t.cm.curOp)&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet)))&&a.has(o.markedSpans)?o.markedSpans.push(r):(o.markedSpans=o.markedSpans?o.markedSpans.concat([r]):[r],a&&a.add(o.markedSpans)),r.marker.attachLine(o),++d}),c.collapsed&&t.iter(e.line,n.line+1,function(e){ek(t,e)&&tX(e,0)}),c.clearOnEnter&&tb(c,"beforeCursorEnter",function(){return c.clear()}),c.readOnly&&(ef=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),c.collapsed&&(c.id=++ru,c.atomic=!0),f){if(p&&(f.curOp.updateMaxLine=!0),c.collapsed)nE(f,e.line,n.line+1);else if(c.className||c.startStyle||c.endStyle||c.css||c.attributes||c.title)for(var h=e.line;h<=n.line;h++)nk(f,h,"text");c.atomic&&oQ(f.doc),e$(f,"markerAdded",f,c)}return c}rp.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&n9(t),tO(this,"clear")){var n=this.find();n&&e$(this,"clear",n.from,n.to)}for(var o=null,r=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=ev(a.markedSpans,this);t&&!this.collapsed?nk(t,tZ(a),"text"):t&&(null!=s.to&&(r=tZ(a)),null!=s.from&&(o=tZ(a))),a.markedSpans=function(t,e){for(var n,o=0;o<t.length;++o)t[o]!=e&&(n||(n=[])).push(t[o]);return n}(a.markedSpans,s),null==s.from&&this.collapsed&&!ek(this.doc,a)&&t&&tX(a,nw(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=eT(this.lines[l]),u=ej(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=o&&t&&this.collapsed&&nE(t,o,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&oQ(t.doc)),t&&e$(t,"markerCleared",t,this,o,r),e&&n8(t),this.parent&&this.parent.clear()}},rp.prototype.find=function(t,e){null==t&&"bookmark"==this.type&&(t=1);for(var n,o,r=0;r<this.lines.length;++r){var i=this.lines[r],a=ev(i.markedSpans,this);if(null!=a.from&&(n=t2(e?i:tZ(i),a.from),-1==t))return n;if(null!=a.to&&(o=t2(e?i:tZ(i),a.to),1==t))return o}return n&&{from:n,to:o}},rp.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,o=this.doc.cm;e&&o&&ot(o,function(){var r=e.line,i=e8(o,tZ(e.line));if(i&&(nr(i),o.curOp.selectionChanged=o.curOp.forceUpdate=!0),o.curOp.updateMaxLine=!0,!ek(n.doc,r)&&null!=n.height){var a=n.height;n.height=null;var s=e0(n)-a;s&&tX(r,r.height+s)}e$(o,"markerChanged",o,t)})},rp.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=K(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},rp.prototype.detachLine=function(t){if(this.lines.splice(K(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},tT(rp);var rf=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function rh(t){return t.findMarks(t2(t.first,0),t.clipPos(t2(t.lastLine())),function(t){return t.parent})}rf.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();e$(this,"clear")}},rf.prototype.find=function(t,e){return this.primary.find(t,e)},tT(rf);var rg=0,rv=function(t,e,n,o,r){if(!(this instanceof rv))return new rv(t,e,n,o,r);null==n&&(n=0),rs.call(this,[new ra([new eD("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=t2(n,0);this.sel=oO(i),this.history=new oR(null),this.id=++rg,this.modeOption=e,this.lineSep=o,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),oD(this,{from:i,to:i,text:t}),oJ(this,oO(i),J)};rv.prototype=ti(rs.prototype,{constructor:rv,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,o=0;o<e.length;++o)n+=e[o].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=tJ(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:oo(function(t){var e=t2(this.first,0),n=this.first+this.size-1;o6(this,{from:e,to:t2(n,tK(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&nK(this.cm,0,0),oJ(this,oO(e),J)}),replaceRange:function(t,e,n,o){e=t8(this,e),n=n?t8(this,n):e,re(this,t,e,n,o)},getRange:function(t,e,n){var o=tY(this,t8(this,t),t8(this,e));return!1===n?o:""===n?o.join(""):o.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(t0(this,t))return tK(this,t)},getLineNumber:function(t){return tZ(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=tK(this,t)),eT(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return t8(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:oo(function(t,e,n){oJ(this,oO(t8(this,"number"==typeof t?t2(t,e||0):t),null),n)}),setSelection:oo(function(t,e,n){oJ(this,oO(t8(this,t),t8(this,e||t)),n)}),extendSelection:oo(function(t,e,n){oq(this,t8(this,t),e&&t8(this,e),n)}),extendSelections:oo(function(t,e){oG(this,et(this,t),e)}),extendSelectionsBy:oo(function(t,e){oG(this,et(this,to(this.sel.ranges,t)),e)}),setSelections:oo(function(t,e,n){if(t.length){for(var o=[],r=0;r<t.length;r++)o[r]=new ox(t8(this,t[r].anchor),t8(this,t[r].head||t[r].anchor));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),oJ(this,oS(this.cm,o,e),n)}}),addSelection:oo(function(t,e,n){var o=this.sel.ranges.slice(0);o.push(new ox(t8(this,t),t8(this,e||t))),oJ(this,oS(this.cm,o,o.length-1),n)}),getSelection:function(t){for(var e,n=this.sel.ranges,o=0;o<n.length;o++){var r=tY(this,n[o].from(),n[o].to());e=e?e.concat(r):r}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,o=0;o<n.length;o++){var r=tY(this,n[o].from(),n[o].to());!1!==t&&(r=r.join(t||this.lineSeparator())),e[o]=r}return e},replaceSelection:function(t,e,n){for(var o=[],r=0;r<this.sel.ranges.length;r++)o[r]=t;this.replaceSelections(o,e,n||"+input")},replaceSelections:oo(function(t,e,n){for(var o=[],r=this.sel,i=0;i<r.ranges.length;i++){var a=r.ranges[i];o[i]={from:a.from(),to:a.to(),text:this.splitLines(t[i]),origin:n}}for(var s=e&&"end"!=e&&function(t,e,n){for(var o=[],r=t2(t.first,0),i=r,a=0;a<e.length;a++){var s=e[a],l=ok(s.from,r,i),c=ok(oT(s),r,i);if(r=s.to,i=c,"around"==n){var u=t.sel.ranges[a],p=0>t5(u.head,u.anchor);o[a]=new ox(p?c:l,p?l:c)}else o[a]=new ox(l,l)}return new oC(o,t.sel.primIndex)}(this,o,e),l=o.length-1;l>=0;l--)o6(this,o[l]);s?oY(this,s):this.cm&&nG(this.cm)}),undo:oo(function(){o9(this,"undo")}),redo:oo(function(){o9(this,"redo")}),undoSelection:oo(function(){o9(this,"undo",!0)}),redoSelection:oo(function(){o9(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,o=0;o<t.done.length;o++)!t.done[o].ranges&&++e;for(var r=0;r<t.undone.length;r++)!t.undone[r].ranges&&++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new oR(this.history),oL(this,function(e){return e.history=t.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:oW(this.history.done),undone:oW(this.history.undone)}},setHistory:function(t){var e=this.history=new oR(this.history);e.done=oW(t.done.slice(0),null,!0),e.undone=oW(t.undone.slice(0),null,!0)},setGutterMarker:oo(function(t,e,n){return ri(this,t,"gutter",function(t){var o=t.gutterMarkers||(t.gutterMarkers={});return o[e]=n,!n&&tc(o)&&(t.gutterMarkers=null),!0})}),clearGutter:oo(function(t){var e=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[t]&&ri(e,n,"gutter",function(){return n.gutterMarkers[t]=null,tc(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(t){var e;if("number"==typeof t){if(!t0(this,t)||(e=t,!(t=tK(this,t))))return null}else if(null==(e=tZ(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:oo(function(t,e,n){return ri(this,t,"gutter"==e?"gutter":"class",function(t){var o="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[o]){if(D(n).test(t[o]))return!1;t[o]+=" "+n}else t[o]=n;return!0})}),removeLineClass:oo(function(t,e,n){return ri(this,t,"gutter"==e?"gutter":"class",function(t){var o="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",r=t[o];if(!r)return!1;if(null==n)t[o]=null;else{var i=r.match(D(n));if(!i)return!1;var a=i.index+i[0].length;t[o]=r.slice(0,i.index)+(i.index&&a!=r.length?" ":"")+r.slice(a)||null}return!0})}),addLineWidget:oo(function(t,e,n){var o,r,i;return o=this,r=new rl(o,e,n),(i=o.cm)&&r.noHScroll&&(i.display.alignWidgets=!0),ri(o,t,"widget",function(t){var e=t.widgets||(t.widgets=[]);if(null==r.insertAt?e.push(r):e.splice(Math.min(e.length,Math.max(0,r.insertAt)),0,r),r.line=t,i&&!ek(o,t)){var n=eA(t)<o.scrollTop;tX(t,t.height+e0(r)),n&&nq(i,r.height),i.curOp.forceUpdate=!0}return!0}),i&&e$(i,"lineWidgetAdded",i,r,"number"==typeof t?t:tZ(t)),r}),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return rd(this,t8(this,t),t8(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return rd(this,t=t8(this,t),t,n,"bookmark")},findMarksAt:function(t){t=t8(this,t);var e=[],n=tK(this,t.line).markedSpans;if(n)for(var o=0;o<n.length;++o){var r=n[o];(null==r.from||r.from<=t.ch)&&(null==r.to||r.to>=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=t8(this,t),e=t8(this,e);var o=[],r=t.line;return this.iter(t.line,e.line+1,function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];!(null!=l.to&&r==t.line&&t.ch>=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch)&&(!n||n(l.marker))&&o.push(l.marker.parent||l.marker)}++r}),o},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var o=0;o<n.length;++o)null!=n[o].from&&t.push(n[o].marker)}),t},posFromIndex:function(t){var e,n=this.first,o=this.lineSeparator().length;return this.iter(function(r){var i=r.text.length+o;if(i>t)return e=t,!0;t-=i,++n}),t8(this,t2(n,e))},indexFromPos:function(t){var e=(t=t8(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,function(t){e+=t.text.length+n}),e},copy:function(t){var e=new rv(tJ(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var o=new rv(tJ(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(o.history=this.history),(this.linked||(this.linked=[])).push({doc:o,sharedHist:t.sharedHist}),o.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],function(t,e){for(var n=0;n<e.length;n++){var o=e[n],r=o.find(),i=t.clipPos(r.from),a=t.clipPos(r.to);if(t5(i,a)){var s=rd(t,i,a,o.primary,o.primary.type);o.markers.push(s),s.parent=o}}}(o,rh(this)),o},unlinkDoc:function(t){if(t instanceof r9&&(t=t.doc),this.linked){for(var e=0;e<this.linked.length;++e)if(this.linked[e].doc==t){this.linked.splice(e,1),t.unlinkDoc(this),function(t){for(var e=0;e<t.length;e++)!function(e){var n=t[e],o=[n.primary.doc];oL(n.primary.doc,function(t){return o.push(t)});for(var r=0;r<n.markers.length;r++){var i=n.markers[r];-1==K(o,i.doc)&&(i.parent=null,n.markers.splice(r--,1))}}(e)}(rh(this));break}}if(t.history==this.history){var n=[t.id];oL(t,function(t){return n.push(t.id)},!0),t.history=new oR(null),t.history.done=oW(this.history.done,n),t.history.undone=oW(this.history.undone,n)}},iterLinkedDocs:function(t){oL(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):tL(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:oo(function(t){if("rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter(function(t){return t.order=null}),this.cm)){var e;ot(e=this.cm,function(){oN(e),nE(e)})}})}),rv.prototype.eachLine=rv.prototype.iter;var ry=0;function rm(t){var e=this;if(rb(e),!(tx(e,t)||e1(e.display,t))){tP(t),g&&(ry=+new Date);var n=nT(e,t,!0),o=t.dataTransfer.files;if(!(!n||e.isReadOnly())){if(o&&o.length&&window.FileReader&&window.File)for(var r=o.length,i=Array(r),a=0,s=function(){++a==r&&oe(e,function(){var t={from:n=t8(e.doc,n),to:n,text:e.doc.splitLines(i.filter(function(t){return null!=t}).join(e.doc.lineSeparator())),origin:"paste"};o6(e.doc,t),oY(e.doc,oO(t8(e.doc,n),t8(e.doc,oT(t))))})()},l=function(t,n){if(e.options.allowDropFileTypes&&-1==K(e.options.allowDropFileTypes,t.type)){s();return}var o=new FileReader;o.onerror=function(){return s()},o.onload=function(){var t=o.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)){s();return}i[n]=t,s()},o.readAsText(t)},c=0;c<o.length;c++)l(o[c],c);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1){e.state.draggingText(t),setTimeout(function(){return e.display.input.focus()},20);return}try{var u,p=t.dataTransfer.getData("Text");if(p){if(e.state.draggingText&&!e.state.draggingText.copy&&(u=e.listSelections()),oX(e.doc,oO(n,n)),u)for(var d=0;d<u.length;++d)re(e.doc,"",u[d].anchor,u[d].head,"drag");e.replaceSelection(p,"around","paste"),e.display.input.focus()}}catch(t){}}}}}function rb(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function rw(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],o=0;o<e.length;o++){var r=e[o].CodeMirror;r&&n.push(r)}n.length&&n[0].operation(function(){for(var e=0;e<n.length;e++)t(n[e])})}}var r_=!1;function rC(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var rx={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},rS=0;rS<10;rS++)rx[rS+48]=rx[rS+96]=String(rS);for(var rO=65;rO<=90;rO++)rx[rO]=String.fromCharCode(rO);for(var rT=1;rT<=12;rT++)rx[rT+111]=rx[rT+63235]="F"+rT;var rP={};function rE(t){var e,n,o,r,i=t.split(/-(?!$)/);t=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))o=!0;else throw Error("Unrecognized modifier name: "+s)}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),r&&(t="Cmd-"+t),o&&(t="Shift-"+t),t}function rk(t,e,n,o){var r=(e=rD(e)).call?e.call(t,o):e[t];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return rk(t,e.fallthrough,n,o);for(var i=0;i<e.fallthrough.length;i++){var a=rk(t,e.fallthrough[i],n,o);if(a)return a}}}function rA(t){var e="string"==typeof t?t:rx[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function rj(t,e,n){var o=t;return e.altKey&&"Alt"!=o&&(t="Alt-"+t),(j?e.metaKey:e.ctrlKey)&&"Ctrl"!=o&&(t="Ctrl-"+t),(j?e.ctrlKey:e.metaKey)&&"Mod"!=o&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=o&&(t="Shift-"+t),t}function rM(t,e){if(w&&34==t.keyCode&&t.char)return!1;var n=rx[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),rj(n,t,e))}function rD(t){return"string"==typeof t?rP[t]:t}function rL(t,e){for(var n=t.doc.sel.ranges,o=[],r=0;r<n.length;r++){for(var i=e(n[r]);o.length&&0>=t5(i.from,tn(o).to);){var a=o.pop();if(0>t5(a.from,i.from)){i.from=a.from;break}}o.push(i)}ot(t,function(){for(var e=o.length-1;e>=0;e--)re(t.doc,"",o[e].from,o[e].to,"+delete");nG(t)})}function rI(t,e,n){var o=td(t.text,e+n,n);return o<0||o>t.text.length?null:o}function rN(t,e,n){var o=rI(t,e.ch,n);return null==o?null:new t2(e.line,o,n<0?"after":"before")}function rR(t,e,n,o,r){if(t){"rtl"==e.doc.direction&&(r=-r);var i=ty(n,e.doc.direction);if(i){var a,s=r<0?tn(i):i[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=nt(e,n),u=ne(e,c,a=r<0?n.text.length-1:0).top;a=tf(function(t){return ne(e,c,t).top==u},r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=rI(n,a,1))}else a=r<0?s.to:s.from;return new t2(o,a,l)}}return new t2(o,r<0?n.text.length:0,r<0?"before":"after")}rP.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},rP.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},rP.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},rP.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},rP.default=P?rP.macDefault:rP.pcDefault;var rV={selectAll:o3,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),J)},killLine:function(t){return rL(t,function(e){if(!e.empty())return{from:e.from(),to:e.to()};var n=tK(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:t2(e.head.line+1,0)}:{from:e.head,to:t2(e.head.line,n)}})},deleteLine:function(t){return rL(t,function(e){return{from:t2(e.from().line,0),to:t8(t.doc,t2(e.to().line+1,0))}})},delLineLeft:function(t){return rL(t,function(t){return{from:t2(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(t){return rL(t,function(e){var n=t.charCoords(e.head,"div").top+5;return{from:t.coordsChar({left:0,top:n},"div"),to:e.from()}})},delWrappedLineRight:function(t){return rL(t,function(e){var n=t.charCoords(e.head,"div").top+5,o=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:o}})},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(t2(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(t2(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return rF(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return rH(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){var n,o,r;return n=e.head.line,(r=function(t){for(var e;e=eS(t,!1);)t=e.find(1,!0).line;return t}(o=tK(t.doc,n)))!=o&&(n=tZ(r)),rR(!0,t,o,n,-1)},{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")},Z)},goLineLeft:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")},Z)},goLineLeftSmart:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5,o=t.coordsChar({left:0,top:n},"div");return o.ch<t.getLine(o.line).search(/\S/)?rH(t,e.head):o},Z)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection(" ")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),o=t.options.tabSize,r=0;r<n.length;r++){var i=n[r].from(),a=q(t.getLine(i.line),i.ch,o);e.push(te(o-a%o))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return ot(t,function(){for(var e=t.listSelections(),n=[],o=0;o<e.length;o++)if(e[o].empty()){var r=e[o].head,i=tK(t.doc,r.line).text;if(i){if(r.ch==i.length&&(r=new t2(r.line,r.ch-1)),r.ch>0)r=new t2(r.line,r.ch+1),t.replaceRange(i.charAt(r.ch-1)+i.charAt(r.ch-2),t2(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var a=tK(t.doc,r.line-1).text;a&&(r=new t2(r.line,1),t.replaceRange(i.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),t2(r.line-1,a.length-1),r,"+transpose"))}}n.push(new ox(r,r))}t.setSelections(n)})},newlineAndIndent:function(t){return ot(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var o=0;o<e.length;o++)t.indentLine(e[o].from().line,null,!0);nG(t)})},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function rF(t,e){var n=tK(t.doc,e),o=eT(n);return o!=n&&(e=tZ(o)),rR(!0,t,o,e,1)}function rH(t,e){var n=rF(t,e.line),o=tK(t.doc,n.line),r=ty(o,t.doc.direction);if(!r||0==r[0].level){var i=Math.max(n.ch,o.text.search(/\S/)),a=e.line==n.line&&e.ch<=i&&e.ch;return t2(n.line,a?0:i,n.sticky)}return n}function rU(t,e,n){if("string"==typeof e&&!(e=rV[e]))return!1;t.display.input.ensurePolled();var o=t.display.shift,r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),r=e(t)!=Y}finally{t.display.shift=o,t.state.suppressEdits=!1}return r}var rB=new G;function rz(t,e,n,o){var r=t.state.keySeq;if(r){if(rA(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:rB.set(50,function(){t.state.keySeq==r&&(t.state.keySeq=null,t.display.input.reset())}),rW(t,r+" "+e,n,o))return!0}return rW(t,e,n,o)}function rW(t,e,n,o){var r=function(t,e,n){for(var o=0;o<t.state.keyMaps.length;o++){var r=rk(e,t.state.keyMaps[o],n,t);if(r)return r}return t.options.extraKeys&&rk(e,t.options.extraKeys,n,t)||rk(e,t.options.keyMap,n,t)}(t,e,o);return"multi"==r&&(t.state.keySeq=e),"handled"==r&&e$(t,"keyHandled",t,e,n),("handled"==r||"multi"==r)&&(tP(n),nR(t)),!!r}function r$(t,e){var n=rM(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?rz(t,"Shift-"+n,e,function(e){return rU(t,e,!0)})||rz(t,n,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return rU(t,e)}):rz(t,n,e,function(e){return rU(t,e)}))}var rq=null;function rG(t){if((!t.target||t.target==this.display.input.getField())&&(this.curOp.focus=H(),!tx(this,t))){g&&v<11&&27==t.keyCode&&(t.returnValue=!1);var e=t.keyCode;this.display.shift=16==e||t.shiftKey;var n=r$(this,t);w&&(rq=n?e:null,!n&&88==e&&!tN&&(P?t.metaKey:t.ctrlKey)&&this.replaceSelection("",null,"cut")),p&&!P&&!n&&46==e&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=e||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(L(e,"CodeMirror-crosshair"),t_(document,"keyup",n),t_(document,"mouseover",n))}U(e,"CodeMirror-crosshair"),tb(document,"keyup",n),tb(document,"mouseover",n)}(this)}}function rK(t){16==t.keyCode&&(this.doc.sel.shift=!1),tx(this,t)}function rY(t){if(!(t.target&&t.target!=this.display.input.getField()||e1(this.display,t)||tx(this,t))&&(!t.ctrlKey||t.altKey)&&(!P||!t.metaKey)){var e,n=t.keyCode,o=t.charCode;if(w&&n==rq){rq=null,tP(t);return}if(!(w&&(!t.which||t.which<10)&&r$(this,t))){var r=String.fromCharCode(null==o?n:o);"\b"!=r&&(e=this,rz(e,"'"+r+"'",t,function(t){return rU(e,t,!0)})||this.display.input.onKeyPress(t))}}}var rJ=function(t,e,n){this.time=t,this.pos=e,this.button=n};function rX(t){var e,n,o,r,i,a,c,u,p,d,f,h,m=this.display;if(!(tx(this,t)||m.activeTouch&&m.input.supportsTouch())){if(m.input.ensurePolled(),m.shift=t.shiftKey,e1(m,t)){y||(m.scroller.draggable=!1,setTimeout(function(){return m.scroller.draggable=!0},100));return}if(!r0(this,t)){var b=nT(this,t),w=tM(t),C=b?(h=+new Date,l&&l.compare(h,b,w)?(s=l=null,"triple"):s&&s.compare(h,b,w)?(l=new rJ(h,b,w),s=null,"double"):(s=new rJ(h,b,w),l=null,"single")):"single";window.focus(),1==w&&this.state.selectingText&&this.state.selectingText(t),!(b&&(e=this,n="Click","double"==C?n="Double"+n:"triple"==C&&(n="Triple"+n),rz(e,rj(n=(1==w?"Left":2==w?"Middle":"Right")+n,t),t,function(t){if("string"==typeof t&&(t=rV[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,b)!=Y}finally{e.state.suppressEdits=!1}return n})))&&(1==w?b?(g?setTimeout(W(nV,this),0):this.curOp.focus=H(),o=function(t,e,n){var o=t.getOption("configureMouse"),r=o?o(t,e,n):{};if(null==r.unit){var i=E?n.shiftKey&&n.metaKey:n.altKey;r.unit=i?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==r.extend||t.doc.extend)&&(r.extend=t.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=P?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(P?n.altKey:n.ctrlKey)),r}(this,C,t),i=this.doc.sel,this.options.dragDrop&&tD&&!this.isReadOnly()&&"single"==C&&(r=i.contains(b))>-1&&(0>t5((r=i.ranges[r]).from(),b)||b.xRel>0)&&(t5(r.to(),b)>0||b.xRel<0)?(a=this,c=a.display,u=!1,p=oe(a,function(t){y&&(c.scroller.draggable=!1),a.state.draggingText=!1,a.state.delayingBlurEvent&&(a.hasFocus()?a.state.delayingBlurEvent=!1:nF(a)),t_(c.wrapper.ownerDocument,"mouseup",p),t_(c.wrapper.ownerDocument,"mousemove",d),t_(c.scroller,"dragstart",f),t_(c.scroller,"drop",p),u||(tP(t),o.addNew||oq(a.doc,b,null,null,o.extend),y&&!_||g&&9==v?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),d=function(e){u=u||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return u=!0},y&&(c.scroller.draggable=!0),a.state.draggingText=p,p.copy=!o.moveOnDrag,tb(c.wrapper.ownerDocument,"mouseup",p),tb(c.wrapper.ownerDocument,"mousemove",d),tb(c.scroller,"dragstart",f),tb(c.scroller,"drop",p),a.state.delayingBlurEvent=!0,setTimeout(function(){return c.input.focus()},20),c.scroller.dragDrop&&c.scroller.dragDrop()):function(t,e,n,o){g&&nF(t);var r=t.display,i=t.doc;tP(e);var a,s,l=i.sel,c=l.ranges;if(o.addNew&&!o.extend?a=(s=i.sel.contains(n))>-1?c[s]:new ox(n,n):(a=i.sel.primary(),s=i.sel.primIndex),"rectangle"==o.unit)o.addNew||(a=new ox(n,n)),n=nT(t,e,!0,!0),s=-1;else{var u=rZ(t,n,o.unit);a=o.extend?o$(a,u.anchor,u.head,o.extend):u}o.addNew?-1==s?(s=c.length,oJ(i,oS(t,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==o.unit&&!o.extend?(oJ(i,oS(t,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=i.sel):oK(i,s,a,X):(s=0,oJ(i,new oC([a],0),X),l=i.sel);var p=n,d=r.wrapper.getBoundingClientRect(),f=0;function h(e){t.state.selectingText=!1,f=1/0,e&&(tP(e),r.input.focus()),t_(r.wrapper.ownerDocument,"mousemove",v),t_(r.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var v=oe(t,function(e){0!==e.buttons&&tM(e)?function e(c){var u=++f,h=nT(t,c,!0,"rectangle"==o.unit);if(h){if(0!=t5(h,p)){t.curOp.focus=H(),function(e){if(0!=t5(p,e)){if(p=e,"rectangle"==o.unit){for(var r=[],c=t.options.tabSize,u=q(tK(i,n.line).text,n.ch,c),d=q(tK(i,e.line).text,e.ch,c),f=Math.min(u,d),h=Math.max(u,d),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var y=tK(i,g).text,m=Q(y,f,c);f==h?r.push(new ox(t2(g,m),t2(g,m))):y.length>m&&r.push(new ox(t2(g,m),t2(g,Q(y,h,c))))}r.length||r.push(new ox(n,n)),oJ(i,oS(t,l.ranges.slice(0,s).concat(r),s),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=a,_=rZ(t,e,o.unit),C=w.anchor;t5(_.anchor,C)>0?(b=_.head,C=t7(w.from(),_.anchor)):(b=_.anchor,C=t6(w.to(),_.head));var x=l.ranges.slice(0);x[s]=function(t,e){var n,o=e.anchor,r=e.head,i=tK(t.doc,o.line);if(0==t5(o,r)&&o.sticky==r.sticky)return e;var a=ty(i);if(!a)return e;var s=tg(a,o.ch,o.sticky),l=a[s];if(l.from!=o.ch&&l.to!=o.ch)return e;var c=s+(l.from==o.ch==(1!=l.level)?0:1);if(0==c||c==a.length)return e;if(r.line!=o.line)n=(r.line-o.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=tg(a,r.ch,r.sticky),p=u-s||(r.ch-o.ch)*(1==l.level?-1:1);n=u==c-1||u==c?p<0:p>0}var d=a[c+(n?-1:0)],f=n==(1==d.level),h=f?d.from:d.to,g=f?"after":"before";return o.ch==h&&o.sticky==g?e:new ox(new t2(o.line,h,g),r)}(t,new ox(t8(i,C),b)),oJ(i,oS(t,x,s),X)}}}(h);var g=nW(r,i);(h.line>=g.to||h.line<g.from)&&setTimeout(oe(t,function(){f==u&&e(c)}),150)}else{var v=c.clientY<d.top?-20:c.clientY>d.bottom?20:0;v&&setTimeout(oe(t,function(){f==u&&(r.scroller.scrollTop+=v,e(c))}),50)}}}(e):h(e)}),y=oe(t,h);t.state.selectingText=y,tb(r.wrapper.ownerDocument,"mousemove",v),tb(r.wrapper.ownerDocument,"mouseup",y)}(this,t,b,o)):tj(t)==m.scroller&&tP(t):2==w?(b&&oq(this.doc,b),setTimeout(function(){return m.input.focus()},20)):3==w&&(M?this.display.input.onContextMenu(t):nF(this)))}}}function rZ(t,e,n){if("char"==n)return new ox(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ox(t2(e.line,0),t8(t.doc,t2(e.line+1,0)));var o=n(t,e);return new ox(o.from,o.to)}function rQ(t,e,n,o){if(e.touches)r=e.touches[0].clientX,i=e.touches[0].clientY;else try{r=e.clientX,i=e.clientY}catch(t){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;o&&tP(e);var r,i,a=t.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!tO(t,n))return tk(e);i-=s.top-a.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=r){var u=tQ(t.doc,i),p=t.display.gutterSpecs[l];return tC(t,n,t,u,p.className,e),tk(e)}}}function r0(t,e){return rQ(t,e,"gutterClick",!0)}function r1(t,e){!(e1(t.display,e)||tO(t,"gutterContextMenu")&&rQ(t,e,"gutterContextMenu",!1)||tx(t,e,"contextmenu"))&&(M||t.display.input.onContextMenu(e))}function r2(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),na(t)}rJ.prototype.compare=function(t,e,n){return this.time+400>t&&0==t5(e,this.pos)&&n==this.button};var r5={toString:function(){return"CodeMirror.Init"}},r3={},r4={};function r6(t,e,n){if(!e!=!(n&&n!=r5)){var o=t.display.dragFunctions,r=e?tb:t_;r(t.display.scroller,"dragstart",o.start),r(t.display.scroller,"dragenter",o.enter),r(t.display.scroller,"dragover",o.over),r(t.display.scroller,"dragleave",o.leave),r(t.display.scroller,"drop",o.drop)}}function r7(t){t.options.lineWrapping?(U(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(L(t.display.wrapper,"CodeMirror-wrap"),eM(t)),nO(t),nE(t),na(t),setTimeout(function(){return n5(t)},100)}function r9(t,e){var n=this;if(!(this instanceof r9))return new r9(t,e);this.options=e=e?$(e):{},$(r3,e,!1);var o=e.value;"string"==typeof o?o=new rv(o,e.mode,null,e.lineSeparator,e.direction):e.mode&&(o.modeOption=e.mode),this.doc=o;var r=new r9.inputStyles[e.inputStyle](this),i=this.display=new oy(t,o,r,e);for(var a in i.wrapper.CodeMirror=this,r2(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n6(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new G,keySeq:null,specialChars:null},e.autofocus&&!T&&i.input.focus(),g&&v<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(t){var e=t.display;tb(e.scroller,"mousedown",oe(t,rX)),g&&v<11?tb(e.scroller,"dblclick",oe(t,function(e){if(!tx(t,e)){var n=nT(t,e);if(!(!n||r0(t,e)||e1(t.display,e))){tP(e);var o=t.findWordAt(n);oq(t.doc,o.anchor,o.head)}}})):tb(e.scroller,"dblclick",function(e){return tx(t,e)||tP(e)}),tb(e.scroller,"contextmenu",function(e){return r1(t,e)}),tb(e.input.getField(),"contextmenu",function(n){e.scroller.contains(n.target)||r1(t,n)});var n,o={end:0};function r(){e.activeTouch&&(n=setTimeout(function(){return e.activeTouch=null},1e3),(o=e.activeTouch).end=+new Date)}function i(t,e){if(null==e.left)return!0;var n=e.left-t.left,o=e.top-t.top;return n*n+o*o>400}tb(e.scroller,"touchstart",function(r){if(!tx(t,r)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(r)&&!r0(t,r)){e.input.ensurePolled(),clearTimeout(n);var i=+new Date;e.activeTouch={start:i,moved:!1,prev:i-o.end<=300?o:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}}),tb(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),tb(e.scroller,"touchend",function(n){var o=e.activeTouch;if(o&&!e1(e,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,s=t.coordsChar(e.activeTouch,"page");a=!o.prev||i(o,o.prev)?new ox(s,s):!o.prev.prev||i(o,o.prev.prev)?t.findWordAt(s):new ox(t2(s.line,0),t8(t.doc,t2(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),tP(n)}r()}),tb(e.scroller,"touchcancel",r),tb(e.scroller,"scroll",function(){e.scroller.clientHeight&&(nX(t,e.scroller.scrollTop),nQ(t,e.scroller.scrollLeft,!0),tC(t,"scroll",t))}),tb(e.scroller,"mousewheel",function(e){return o_(t,e)}),tb(e.scroller,"DOMMouseScroll",function(e){return o_(t,e)}),tb(e.wrapper,"scroll",function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(e){tx(t,e)||tA(e)},over:function(e){tx(t,e)||(function(t,e){var n=nT(t,e);if(n){var o=document.createDocumentFragment();nI(t,n,o),t.display.dragCursor||(t.display.dragCursor=R("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),N(t.display.dragCursor,o)}}(t,e),tA(e))},start:function(e){return function(t,e){if(g&&(!t.state.draggingText||+new Date-ry<100)){tA(e);return}if(!(tx(t,e)||e1(t.display,e))&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!_)){var n=R("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",w&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),w&&n.parentNode.removeChild(n)}}(t,e)},drop:oe(t,rm),leave:function(e){tx(t,e)||rb(t)}};var a=e.input.getField();tb(a,"keyup",function(e){return rK.call(t,e)}),tb(a,"keydown",oe(t,rG)),tb(a,"keypress",oe(t,rY)),tb(a,"focus",function(e){return nH(t,e)}),tb(a,"blur",function(e){return nU(t,e)})}(this),function(){if(!r_){var t;tb(window,"resize",function(){null==t&&(t=setTimeout(function(){t=null,rw(rC)},100))}),tb(window,"blur",function(){return rw(nU)}),r_=!0}}(),n9(this),this.curOp.forceUpdate=!0,oI(this,o),e.autofocus&&!T||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&nH(n)},20):nU(this),r4)r4.hasOwnProperty(a)&&r4[a](this,e[a],r5);of(this),e.finishInit&&e.finishInit(this);for(var s=0;s<r8.length;++s)r8[s](this);n8(this),y&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}r9.defaults=r3,r9.optionHandlers=r4;var r8=[];function it(t,e,n,o){var r,i=t.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?r=ei(t,e).state:n="prev");var a=t.options.tabSize,s=tK(i,e),l=q(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(o||/\S/.test(s.text)){if("smart"==n&&((c=i.mode.indent(r,s.text.slice(u.length),s.text))==Y||c>150)){if(!o)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>i.first?q(tK(i,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var p="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)d+=a,p+=" ";if(d<c&&(p+=te(c-d)),p!=u)return re(i,p,t2(e,0),t2(e,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var g=i.sel.ranges[h];if(g.head.line==e&&g.head.ch<u.length){var v=t2(e,u.length);oK(i,h,new ox(v,v));break}}}r9.defineInitHook=function(t){return r8.push(t)};var ie=null;function io(t,e,n,o,r){var i=t.doc;t.display.shift=!1,o||(o=i.sel);var a=+new Date-200,s="paste"==r||t.state.pasteIncoming>a,l=tL(e),c=null;if(s&&o.ranges.length>1){if(ie&&ie.text.join("\n")==e){if(o.ranges.length%ie.text.length==0){c=[];for(var u=0;u<ie.text.length;u++)c.push(i.splitLines(ie.text[u]))}}else l.length==o.ranges.length&&t.options.pasteLinesPerSelection&&(c=to(l,function(t){return[t]}))}for(var p=t.curOp.updateInput,d=o.ranges.length-1;d>=0;d--){var f=o.ranges[d],h=f.from(),g=f.to();f.empty()&&(n&&n>0?h=t2(h.line,h.ch-n):t.state.overwrite&&!s?g=t2(g.line,Math.min(tK(i,g.line).text.length,g.ch+tn(l).length)):s&&ie&&ie.lineWise&&ie.text.join("\n")==l.join("\n")&&(h=g=t2(h.line,0)));var v={from:h,to:g,text:c?c[d%c.length]:l,origin:r||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};o6(t.doc,v),e$(t,"inputRead",t,v)}e&&!s&&ii(t,e),nG(t),t.curOp.updateInput<2&&(t.curOp.updateInput=p),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function ir(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||ot(e,function(){return io(e,n,0,null,"paste")}),!0}function ii(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,o=n.ranges.length-1;o>=0;o--){var r=n.ranges[o];if(!(r.head.ch>100)&&(!o||n.ranges[o-1].head.line!=r.head.line)){var i=t.getModeAt(r.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(e.indexOf(i.electricChars.charAt(s))>-1){a=it(t,r.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(tK(t.doc,r.head.line).text.slice(0,r.head.ch))&&(a=it(t,r.head.line,"smart"));a&&e$(t,"electricInput",t,r.head.line)}}}function ia(t){for(var e=[],n=[],o=0;o<t.doc.sel.ranges.length;o++){var r=t.doc.sel.ranges[o].head.line,i={anchor:t2(r,0),head:t2(r+1,0)};n.push(i),e.push(t.getRange(i.anchor,i.head))}return{text:e,ranges:n}}function is(t,e,n,o){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",o?"":"off"),t.setAttribute("spellcheck",!!e)}function il(){var t=R("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=R("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return y?t.style.width="1000px":t.setAttribute("wrap","off"),S&&(t.style.border="1px solid black"),is(t),e}function ic(t,e,n,o,r){var i=e,a=n,s=tK(t,e.line),l=r&&"rtl"==t.direction?-n:n;function c(i){if("codepoint"==o){var a,c,u=s.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var p=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new t2(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(p?2:1))),-n)}}else a=r?function(t,e,n,o){var r,i=ty(e,t.doc.direction);if(!i)return rN(e,n,o);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=tg(i,n.ch,n.sticky),s=i[a];if("ltr"==t.doc.direction&&s.level%2==0&&(o>0?s.to>n.ch:s.from<n.ch))return rN(e,n,o);var l=function(t,n){return rI(e,t instanceof t2?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(r=r||nt(t,e),nm(t,e,r,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==s.level){var p=1==s.level==o<0,d=l(n,p?1:-1);if(null!=d&&(p?d<=s.to&&d<=u.end:d>=s.from&&d>=u.begin))return new t2(n.line,d,p?"before":"after")}var f=function(t,e,o){for(;t>=0&&t<i.length;t+=e){var r,a=i[t],s=e>0==(1!=a.level),c=s?o.begin:l(o.end,-1);if(a.from<=c&&c<a.to||(c=s?a.from:l(a.to,-1),o.begin<=c&&c<o.end)){return r=c,s?new t2(n.line,l(r,1),"before"):new t2(n.line,r,"after")}}},h=f(a+o,o,u);if(h)return h;var g=o>0?u.end:l(u.begin,-1);return null!=g&&!(o>0&&g==e.text.length)&&(h=f(o>0?0:i.length-1,o,c(g)))?h:null}(t.cm,s,e,n):rN(s,e,n);if(null==a){if(!(!i&&!((c=e.line+l)<t.first)&&!(c>=t.first+t.size)&&(e=new t2(c,e.ch,e.sticky),s=tK(t,c))))return!1;e=rR(r,t.cm,s,e.line,l)}else e=a;return!0}if("char"==o||"codepoint"==o)c();else if("column"==o)c(!0);else if("word"==o||"group"==o)for(var u=null,p="group"==o,d=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||c(!f);f=!1){var h=s.text.charAt(e.ch)||"\n",g=tl(h,d)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||f||g||(g="s"),u&&u!=g){n<0&&(n=1,c(),e.sticky="after");break}if(g&&(u=g),n>0&&!c(!f))break}var v=o2(t,e,i,a,!0);return t3(i,v)&&(v.hitSide=!0),v}function iu(t,e,n,o){var r,i,a=t.doc,s=e.left;if("page"==o){var l=Math.max(Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-.5*nw(t.display),3);i=(n>0?e.bottom:e.top)+n*l}else"line"==o&&(i=n>0?e.bottom+3:e.top-3);for(;(r=nv(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){r.hitSide=!0;break}i+=5*n}return r}var ip=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new G,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function id(t,e){var n=e8(t,e.line);if(!n||n.hidden)return null;var o=tK(t.doc,e.line),r=e9(n,o,e.line),i=ty(o,t.doc.direction),a="left";i&&(a=tg(i,e.ch)%2?"right":"left");var s=no(r.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function ih(t,e){return e&&(t.bad=!0),t}function ig(t,e,n){var o;if(e==t.display.lineDiv){if(!(o=t.display.lineDiv.childNodes[n]))return ih(t.clipPos(t2(t.display.viewTo-1)),!0);e=null,n=0}else for(o=e;;o=o.parentNode){if(!o||o==t.display.lineDiv)return null;if(o.parentNode&&o.parentNode==t.display.lineDiv)break}for(var r=0;r<t.display.view.length;r++){var i=t.display.view[r];if(i.node==o)return function(t,e,n){var o=t.text.firstChild,r=!1;if(!e||!F(o,e))return ih(t2(tZ(t.line),0),!0);if(e==o&&(r=!0,e=o.childNodes[n],n=0,!e)){var i=t.rest?tn(t.rest):t.line;return ih(t2(tZ(i),i.text.length),r)}var a=3==e.nodeType?e:null,s=e;for(!a&&1==e.childNodes.length&&3==e.firstChild.nodeType&&(a=e.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=o;)s=s.parentNode;var l=t.measure,c=l.maps;function u(e,n,o){for(var r=-1;r<(c?c.length:0);r++)for(var i=r<0?l.map:c[r],a=0;a<i.length;a+=3){var s=i[a+2];if(s==e||s==n){var u=tZ(r<0?t.line:t.rest[r]),p=i[a]+o;return(o<0||s!=e)&&(p=i[a+(o?1:0)]),t2(u,p)}}}var p=u(a,s,n);if(p)return ih(p,r);for(var d=s.nextSibling,f=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(p=u(d,d.firstChild,0))return ih(t2(p.line,p.ch-f),r);f+=d.textContent.length}for(var h=s.previousSibling,g=n;h;h=h.previousSibling){if(p=u(h,h.firstChild,-1))return ih(t2(p.line,p.ch+g),r);g+=h.textContent.length}}(i,e,n)}}ip.prototype.init=function(t){var e=this,n=this,o=n.cm,r=n.div=t.lineDiv;function i(t){for(var e=t.target;e;e=e.parentNode){if(e==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function a(t){if(!(!i(t)||tx(o,t))){if(o.somethingSelected())ie={lineWise:!1,text:o.getSelections()},"cut"==t.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;var e=ia(o);ie={lineWise:!0,text:e.text},"cut"==t.type&&o.operation(function(){o.setSelections(e.ranges,0,J),o.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var a=ie.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a){t.preventDefault();return}}var s=il(),l=s.firstChild;o.display.lineSpace.insertBefore(s,o.display.lineSpace.firstChild),l.value=ie.text.join("\n");var c=H();z(l),setTimeout(function(){o.display.lineSpace.removeChild(s),c.focus(),c==r&&n.showPrimarySelection()},50)}}r.contentEditable=!0,is(r,o.options.spellcheck,o.options.autocorrect,o.options.autocapitalize),tb(r,"paste",function(t){!(!i(t)||tx(o,t)||ir(t,o))&&v<=11&&setTimeout(oe(o,function(){return e.updateFromDOM()}),20)}),tb(r,"compositionstart",function(t){e.composing={data:t.data,done:!1}}),tb(r,"compositionupdate",function(t){e.composing||(e.composing={data:t.data,done:!1})}),tb(r,"compositionend",function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)}),tb(r,"touchstart",function(){return n.forceCompositionEnd()}),tb(r,"input",function(){e.composing||e.readFromDOMSoon()}),tb(r,"copy",a),tb(r,"cut",a)},ip.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},ip.prototype.prepareSelection=function(){var t=nL(this.cm,!1);return t.focus=H()==this.div,t},ip.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},ip.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ip.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(e.display.viewTo==e.display.viewFrom||r.line>=e.display.viewTo||i.line<e.display.viewFrom){t.removeAllRanges();return}var a=ig(e,t.anchorNode,t.anchorOffset),s=ig(e,t.focusNode,t.focusOffset);if(!a||a.bad||!s||s.bad||0!=t5(t7(a,s),r)||0!=t5(t6(a,s),i)){var l=e.display.view,c=r.line>=e.display.viewFrom&&id(e,r)||{node:l[0].measure.map[2],offset:0},u=i.line<e.display.viewTo&&id(e,i);if(!u){var d=l[l.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!c||!u){t.removeAllRanges();return}var h,g=t.rangeCount&&t.getRangeAt(0);try{h=o(c.node,c.offset,u.offset,u.node)}catch(t){}h&&(!p&&e.state.focused?(t.collapse(c.node,c.offset),h.collapsed||(t.removeAllRanges(),t.addRange(h))):(t.removeAllRanges(),t.addRange(h)),g&&null==t.anchorNode?t.addRange(g):p&&this.startGracePeriod()),this.rememberSelection()}},ip.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation(function(){return t.cm.curOp.selectionChanged=!0})},20)},ip.prototype.showMultipleSelections=function(t){N(this.cm.display.cursorDiv,t.cursors),N(this.cm.display.selectionDiv,t.selection)},ip.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},ip.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return F(this.div,e)},ip.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&H()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ip.prototype.blur=function(){this.div.blur()},ip.prototype.getField=function(){return this.div},ip.prototype.supportsTouch=function(){return!0},ip.prototype.receivedFocus=function(){var t=this,e=this;this.selectionInEditor()?setTimeout(function(){return t.pollSelection()},20):ot(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},ip.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},ip.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(O&&b&&this.cm.display.gutterSpecs.length&&function(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}(t.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=ig(e,t.anchorNode,t.anchorOffset),o=ig(e,t.focusNode,t.focusOffset);n&&o&&ot(e,function(){oJ(e.doc,oO(n,o),J),(n.bad||o.bad)&&(e.curOp.selectionChanged=!0)})}}},ip.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,o,r,i=this.cm,a=i.display,s=i.doc.sel.primary(),l=s.from(),c=s.to();if(0==l.ch&&l.line>i.firstLine()&&(l=t2(l.line-1,tK(i.doc,l.line-1).length)),c.ch==tK(i.doc,c.line).text.length&&c.line<i.lastLine()&&(c=t2(c.line+1,0)),l.line<a.viewFrom||c.line>a.viewTo-1)return!1;l.line==a.viewFrom||0==(t=nP(i,l.line))?(e=tZ(a.view[0].line),n=a.view[0].node):(e=tZ(a.view[t].line),n=a.view[t-1].node.nextSibling);var u=nP(i,c.line);if(u==a.view.length-1?(o=a.viewTo-1,r=a.lineDiv.lastChild):(o=tZ(a.view[u+1].line)-1,r=a.view[u+1].node.previousSibling),!n)return!1;for(var p=i.doc.splitLines(function(t,e,n,o,r){var i="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(){a&&(i+=s,l&&(i+=s),a=l=!1)}function u(t){t&&(c(),i+=t)}for(;function e(n){if(1==n.nodeType){var i=n.getAttribute("cm-text");if(i){u(i);return}var p,d=n.getAttribute("cm-marker");if(d){var f,h=t.findMarks(t2(o,0),t2(r+1,0),(f=+d,function(t){return t.id==f}));h.length&&(p=h[0].find(0))&&u(tY(t.doc,p.from,p.to).join(s));return}if("false"!=n.getAttribute("contenteditable")){var g=/^(pre|div|p|li|table|br)$/i.test(n.nodeName);if(/^br$/i.test(n.nodeName)||0!=n.textContent.length){g&&c();for(var v=0;v<n.childNodes.length;v++)e(n.childNodes[v]);/^(pre|p)$/i.test(n.nodeName)&&(l=!0),g&&(a=!0)}}}else 3==n.nodeType&&u(n.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}(e),e!=n;)e=e.nextSibling,l=!1;return i}(i,n,r,e,o)),d=tY(i.doc,t2(e,0),t2(o,tK(i.doc,o).text.length));p.length>1&&d.length>1;)if(tn(p)==tn(d))p.pop(),d.pop(),o--;else if(p[0]==d[0])p.shift(),d.shift(),e++;else break;for(var f=0,h=0,g=p[0],v=d[0],y=Math.min(g.length,v.length);f<y&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var m=tn(p),b=tn(d),w=Math.min(m.length-(1==p.length?f:0),b.length-(1==d.length?f:0));h<w&&m.charCodeAt(m.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==p.length&&1==d.length&&e==l.line)for(;f&&f>l.ch&&m.charCodeAt(m.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;p[p.length-1]=m.slice(0,m.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var _=t2(e,f),C=t2(o,d.length?tn(d).length-h:0);if(p.length>1||p[0]||t5(_,C))return re(i.doc,p,_,C,"+input"),!0},ip.prototype.ensurePolled=function(){this.forceCompositionEnd()},ip.prototype.reset=function(){this.forceCompositionEnd()},ip.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ip.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},ip.prototype.updateFromDOM=function(){var t=this;(this.cm.isReadOnly()||!this.pollContent())&&ot(this.cm,function(){return nE(t.cm)})},ip.prototype.setUneditable=function(t){t.contentEditable="false"},ip.prototype.onKeyPress=function(t){0!=t.charCode&&!this.composing&&(t.preventDefault(),this.cm.isReadOnly()||oe(this.cm,io)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},ip.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},ip.prototype.onContextMenu=function(){},ip.prototype.resetPosition=function(){},ip.prototype.needsContentAttribute=!0;var iv=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new G,this.hasSelection=!1,this.composing=null};iv.prototype.init=function(t){var e=this,n=this,o=this.cm;this.createField(t);var r=this.textarea;function i(t){if(!tx(o,t)){if(o.somethingSelected())ie={lineWise:!1,text:o.getSelections()};else{if(!o.options.lineWiseCopyCut)return;var e=ia(o);ie={lineWise:!0,text:e.text},"cut"==t.type?o.setSelections(e.ranges,null,J):(n.prevInput="",r.value=e.text.join("\n"),z(r))}"cut"==t.type&&(o.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),S&&(r.style.width="0px"),tb(r,"input",function(){g&&v>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()}),tb(r,"paste",function(t){tx(o,t)||ir(t,o)||(o.state.pasteIncoming=+new Date,n.fastPoll())}),tb(r,"cut",i),tb(r,"copy",i),tb(t.scroller,"paste",function(e){if(!(e1(t,e)||tx(o,e))){if(!r.dispatchEvent){o.state.pasteIncoming=+new Date,n.focus();return}var i=new Event("paste");i.clipboardData=e.clipboardData,r.dispatchEvent(i)}}),tb(t.lineSpace,"selectstart",function(e){e1(t,e)||tP(e)}),tb(r,"compositionstart",function(){var t=o.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:o.markText(t,o.getCursor("to"),{className:"CodeMirror-composing"})}}),tb(r,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},iv.prototype.createField=function(t){this.wrapper=il(),this.textarea=this.wrapper.firstChild},iv.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},iv.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,o=nL(t);if(t.options.moveInputWithCursor){var r=nf(t,n.sel.primary().head,"div"),i=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();o.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+a.top-i.top)),o.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+a.left-i.left))}return o},iv.prototype.showSelection=function(t){var e=this.cm.display;N(e.cursorDiv,t.cursors),N(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},iv.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&z(this.textarea),g&&v>=9&&(this.hasSelection=n)}else!t&&(this.prevInput=this.textarea.value="",g&&v>=9&&(this.hasSelection=null))}},iv.prototype.getField=function(){return this.textarea},iv.prototype.supportsTouch=function(){return!1},iv.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!T||H()!=this.textarea))try{this.textarea.focus()}catch(t){}},iv.prototype.blur=function(){this.textarea.blur()},iv.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},iv.prototype.receivedFocus=function(){this.slowPoll()},iv.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},iv.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))})},iv.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,o=this.prevInput;if(this.contextMenuPending||!e.state.focused||tI(n)&&!o&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==o&&!e.somethingSelected())return!1;if(g&&v>=9&&this.hasSelection===r||P&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||o||(o="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(o.length,r.length);a<s&&o.charCodeAt(a)==r.charCodeAt(a);)++a;return ot(e,function(){io(e,r.slice(a),o.length-a,null,t.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},iv.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},iv.prototype.onKeyPress=function(){g&&v>=9&&(this.hasSelection=null),this.fastPoll()},iv.prototype.onContextMenu=function(t){var e,n=this,o=n.cm,r=o.display,i=n.textarea;n.contextMenuPending&&n.contextMenuPending();var a=nT(o,t),s=r.scroller.scrollTop;if(a&&!w){o.options.resetSelectionOnContextMenu&&-1==o.doc.sel.contains(a)&&oe(o,oJ)(o.doc,oO(a),J);var l=i.style.cssText,c=n.wrapper.style.cssText,u=n.wrapper.offsetParent.getBoundingClientRect();if(n.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-u.top-5)+"px; left: "+(t.clientX-u.left-5)+"px;\n z-index: 1000; background: "+(g?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",y&&(e=window.scrollY),r.input.focus(),y&&window.scrollTo(null,e),r.input.reset(),o.somethingSelected()||(i.value=n.prevInput=" "),n.contextMenuPending=f,r.selForContextMenu=o.doc.sel,clearTimeout(r.detectingSelectAll),g&&v>=9&&d(),M){tA(t);var p=function(){t_(window,"mouseup",p),setTimeout(f,20)};tb(window,"mouseup",p)}else setTimeout(f,50)}function d(){if(null!=i.selectionStart){var t=o.somethingSelected(),e="​"+(t?i.value:"");i.value="⇚",i.value=e,n.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=e.length,r.selForContextMenu=o.doc.sel}}function f(){if(n.contextMenuPending==f&&(n.contextMenuPending=!1,n.wrapper.style.cssText=c,i.style.cssText=l,g&&v<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=s),null!=i.selectionStart)){(!g||g&&v<9)&&d();var t=0,e=function(){r.selForContextMenu==o.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==n.prevInput?oe(o,o3)(o):t++<10?r.detectingSelectAll=setTimeout(e,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(e,200)}}},iv.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},iv.prototype.setUneditable=function(){},iv.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,o,r,i){t.defaults[n]=o,r&&(e[n]=i?function(t,e,n){n!=r5&&r(t,e,n)}:r)}t.defineOption=n,t.Init=r5,n("value","",function(t,e){return t.setValue(e)},!0),n("mode",null,function(t,e){t.doc.modeOption=e,oA(t)},!0),n("indentUnit",2,oA,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(t){oj(t),na(t),nE(t)},!0),n("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],o=t.doc.first;t.doc.iter(function(t){for(var r=0;;){var i=t.text.indexOf(e,r);if(-1==i)break;r=i+e.length,n.push(t2(o,i))}o++});for(var r=n.length-1;r>=0;r--)re(t.doc,e,n[r],t2(n[r].line,n[r].ch+e.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(t,e,n){t.state.specialChars=RegExp(e.source+(e.test(" ")?"":"| "),"g"),n!=r5&&t.refresh()}),n("specialCharPlaceholder",eV,function(t){return t.refresh()},!0),n("electricChars",!0),n("inputStyle",T?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),n("autocorrect",!1,function(t,e){return t.getInputField().autocorrect=e},!0),n("autocapitalize",!1,function(t,e){return t.getInputField().autocapitalize=e},!0),n("rtlMoveVisually",!k),n("wholeLineUpdateBefore",!0),n("theme","default",function(t){r2(t),ov(t)},!0),n("keyMap","default",function(t,e,n){var o=rD(e),r=n!=r5&&rD(n);r&&r.detach&&r.detach(t,o),o.attach&&o.attach(t,r||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,r7,!0),n("gutters",[],function(t,e){t.display.gutterSpecs=oh(e,t.options.lineNumbers),ov(t)},!0),n("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?nx(t.display)+"px":"0",t.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(t){return n5(t)},!0),n("scrollbarStyle","native",function(t){n6(t),n5(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),n("lineNumbers",!1,function(t,e){t.display.gutterSpecs=oh(t.options.gutters,e),ov(t)},!0),n("firstLineNumber",1,ov,!0),n("lineNumberFormatter",function(t){return t},ov,!0),n("showCursorWhenSelecting",!1,nD,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(t,e){"nocursor"==e&&(nU(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),n("screenReaderLabel",null,function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)}),n("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),n("dragDrop",!0,r6),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,nD,!0),n("singleCursorHeightPerLine",!0,nD,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,oj,!0),n("addModeClass",!1,oj,!0),n("pollInterval",100),n("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),n("historyEventDelay",1250),n("viewportMargin",10,function(t){return t.refresh()},!0),n("maxHighlightLength",1e4,oj,!0),n("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),n("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),n("autofocus",null),n("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0),n("phrases",null)}(r9),e=r9.optionHandlers,n=r9.helpers={},r9.prototype={constructor:r9,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var o=this.options,r=o[t];(o[t]!=n||"mode"==t)&&(o[t]=n,e.hasOwnProperty(t)&&oe(this,e[t])(this,n,r),tC(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](rD(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:on(function(t,e){var n=t.token?t:r9.getMode(this.options,t);if(n.startState)throw Error("Overlays may not be stateful.");(function(t,e,n){for(var o=0,r=n(e);o<t.length&&n(t[o])<=r;)o++;t.splice(o,0,e)})(this.state.overlays,{mode:n,modeSpec:t,opaque:e&&e.opaque,priority:e&&e.priority||0},function(t){return t.priority}),this.state.modeGen++,nE(this)}),removeOverlay:on(function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var o=e[n].modeSpec;if(o==t||"string"==typeof t&&o.name==t){e.splice(n,1),this.state.modeGen++,nE(this);return}}}),indentLine:on(function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),t0(this.doc,t)&&it(this,t,e,n)}),indentSelection:on(function(t){for(var e=this.doc.sel.ranges,n=-1,o=0;o<e.length;o++){var r=e[o];if(r.empty())r.head.line>n&&(it(this,r.head.line,t,!0),n=r.head.line,o==this.doc.sel.primIndex&&nG(this));else{var i=r.from(),a=r.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)it(this,l,t);var c=this.doc.sel.ranges;0==i.ch&&e.length==c.length&&c[o].from().ch>0&&oK(this.doc,o,new ox(i,c[o].to()),J)}}}),getTokenAt:function(t,e){return eu(this,t,e)},getLineTokens:function(t,e){return eu(this,t2(t),e,!0)},getTokenTypeAt:function(t){t=t8(this.doc,t);var e,n=er(this,tK(this.doc,t.line)),o=0,r=(n.length-1)/2,i=t.ch;if(0==i)e=n[2];else for(;;){var a=o+r>>1;if((a?n[2*a-1]:0)>=i)r=a;else if(n[2*a+1]<i)o=a+1;else{e=n[2*a+2];break}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(t){var e=this.doc.mode;return e.innerMode?r9.innerMode(e,this.getTokenAt(t).state).mode:e},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var o=[];if(!n.hasOwnProperty(e))return o;var r=n[e],i=this.getModeAt(t);if("string"==typeof i[e])r[i[e]]&&o.push(r[i[e]]);else if(i[e])for(var a=0;a<i[e].length;a++){var s=r[i[e][a]];s&&o.push(s)}else i.helperType&&r[i.helperType]?o.push(r[i.helperType]):r[i.name]&&o.push(r[i.name]);for(var l=0;l<r._global.length;l++){var c=r._global[l];c.pred(i,this)&&-1==K(o,c.val)&&o.push(c.val)}return o},getStateAfter:function(t,e){var n=this.doc;return ei(this,(t=t9(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return nf(this,null==t?n.head:"object"==typeof t?t8(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return nd(this,t8(this.doc,t),e||"page")},coordsChar:function(t,e){return nv(this,(t=np(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=np(this,{top:t,left:0},e||"page").top,tQ(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var o,r=!1;if("number"==typeof t){var i=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>i&&(t=i,r=!0),o=tK(this.doc,t)}else o=t;return nu(this,o,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-eA(o):0)},defaultTextHeight:function(){return nw(this.display)},defaultCharWidth:function(){return n_(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,o,r){var i,a=this.display,s=(t=nf(this,t8(this.doc,t))).bottom,l=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),a.sizer.appendChild(e),"over"==o)s=t.top;else if("above"==o||"near"==o){var c=Math.max(a.wrapper.clientHeight,this.doc.height),u=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==o||t.bottom+e.offsetHeight>c)&&t.top>e.offsetHeight?s=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=c&&(s=t.bottom),l+e.offsetWidth>u&&(l=u-e.offsetWidth)}e.style.top=s+"px",e.style.left=e.style.right="","right"==r?(l=a.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?l=0:"middle"==r&&(l=(a.sizer.clientWidth-e.offsetWidth)/2),e.style.left=l+"px"),n&&(null!=(i=n$(this,{left:l,top:s,right:l+e.offsetWidth,bottom:s+e.offsetHeight})).scrollTop&&nX(this,i.scrollTop),null!=i.scrollLeft&&nQ(this,i.scrollLeft))},triggerOnKeyDown:on(rG),triggerOnKeyPress:on(rY),triggerOnKeyUp:rK,triggerOnMouseDown:on(rX),execCommand:function(t){if(rV.hasOwnProperty(t))return rV[t].call(null,this)},triggerElectric:on(function(t){ii(this,t)}),findPosH:function(t,e,n,o){var r=1;e<0&&(r=-1,e=-e);for(var i=t8(this.doc,t),a=0;a<e&&!(i=ic(this.doc,i,r,n,o)).hitSide;++a);return i},moveH:on(function(t,e){var n=this;this.extendSelectionsBy(function(o){return n.display.shift||n.doc.extend||o.empty()?ic(n.doc,o.head,t,e,n.options.rtlMoveVisually):t<0?o.from():o.to()},Z)}),deleteH:on(function(t,e){var n=this.doc.sel,o=this.doc;n.somethingSelected()?o.replaceSelection("",null,"+delete"):rL(this,function(n){var r=ic(o,n.head,t,e,!1);return t<0?{from:r,to:n.head}:{from:n.head,to:r}})}),findPosV:function(t,e,n,o){var r=1,i=o;e<0&&(r=-1,e=-e);for(var a=t8(this.doc,t),s=0;s<e;++s){var l=nf(this,a,"div");if(null==i?i=l.left:l.left=i,(a=iu(this,l,r,n)).hitSide)break}return a},moveV:on(function(t,e){var n=this,o=this.doc,r=[],i=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(a){if(i)return t<0?a.from():a.to();var s=nf(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),r.push(s.left);var l=iu(n,s,t,e);return"page"==e&&a==o.sel.primary()&&nq(n,nd(n,l,"div").top-s.top),l},Z),r.length)for(var a=0;a<o.sel.ranges.length;a++)o.sel.ranges[a].goalColumn=r[a]}),findWordAt:function(t){var e=tK(this.doc,t.line).text,n=t.ch,o=t.ch;if(e){var r=this.getHelper(t,"wordChars");("before"==t.sticky||o==e.length)&&n?--n:++o;for(var i=e.charAt(n),a=tl(i,r)?function(t){return tl(t,r)}:/\s/.test(i)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!tl(t)};n>0&&a(e.charAt(n-1));)--n;for(;o<e.length&&a(e.charAt(o));)++o}return new ox(t2(t.line,n),t2(t.line,o))},toggleOverwrite:function(t){(null==t||t!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),tC(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==H()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:on(function(t,e){nK(this,t,e)}),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-e4(this)-this.display.barHeight,width:t.scrollWidth-e4(this)-this.display.barWidth,clientHeight:e7(this),clientWidth:e6(this)}},scrollIntoView:on(function(t,e){if(null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:t2(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line){var n;n=t,nY(this),this.curOp.scrollToPos=n}else nJ(this,t.from,t.to,t.margin)}),setSize:on(function(t,e){var n=this,o=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=o(t)),null!=e&&(this.display.wrapper.style.height=o(e)),this.options.lineWrapping&&ni(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,function(t){if(t.widgets){for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){nk(n,r,"widget");break}}++r}),this.curOp.forceUpdate=!0,tC(this,"refresh",this)}),operation:function(t){return ot(this,t)},startOperation:function(){return n9(this)},endOperation:function(){return n8(this)},refresh:on(function(){var t=this.display.cachedTextHeight;nE(this),this.curOp.forceUpdate=!0,na(this),nK(this,this.doc.scrollLeft,this.doc.scrollTop),ou(this.display),(null==t||Math.abs(t-nw(this.display))>.5||this.options.lineWrapping)&&nO(this),tC(this,"refresh",this)}),swapDoc:on(function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),oI(this,t),na(this),this.display.input.reset(),nK(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,e$(this,"swapDoc",this,e),e}),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},tT(r9),r9.registerHelper=function(t,e,o){n.hasOwnProperty(t)||(n[t]=r9[t]={_global:[]}),n[t][e]=o},r9.registerGlobalHelper=function(t,e,o,r){r9.registerHelper(t,e,r),n[t]._global.push({pred:o,val:r})};var iy="iter insert remove copy getEditor constructor".split(" ");for(var im in rv.prototype)rv.prototype.hasOwnProperty(im)&&0>K(iy,im)&&(r9.prototype[im]=function(t){return function(){return t.apply(this.doc,arguments)}}(rv.prototype[im]));return tT(rv),r9.inputStyles={textarea:iv,contenteditable:ip},r9.defineMode=function(t){r9.defaults.mode||"null"==t||(r9.defaults.mode=t),tH.apply(this,arguments)},r9.defineMIME=function(t,e){tF[t]=e},r9.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),r9.defineMIME("text/plain","null"),r9.defineExtension=function(t,e){r9.prototype[t]=e},r9.defineDocExtension=function(t,e){rv.prototype[t]=e},r9.fromTextArea=function(t,e){if((e=e?$(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n,o=H();e.autofocus=o==t||null!=t.getAttribute("autofocus")&&o==document.body}function r(){t.value=s.getValue()}if(t.form&&(tb(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var i=t.form;n=i.submit;try{var a=i.submit=function(){r(),i.submit=n,i.submit(),i.submit=a}}catch(t){}}e.finishInit=function(o){o.save=r,o.getTextArea=function(){return t},o.toTextArea=function(){o.toTextArea=isNaN,r(),t.parentNode.removeChild(o.getWrapperElement()),t.style.display="",t.form&&(t_(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=n))}},t.style.display="none";var s=r9(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return s},r9.off=t_,r9.on=tb,r9.wheelEventPixels=function(t){var e=ow(t);return e.x*=ob,e.y*=ob,e},r9.Doc=rv,r9.splitLines=tL,r9.countColumn=q,r9.findColumn=Q,r9.isWordChar=ts,r9.Pass=Y,r9.signal=tC,r9.Line=eD,r9.changeEnd=oT,r9.scrollbarModel=n4,r9.Pos=t2,r9.cmpPos=t5,r9.modes=tV,r9.mimeModes=tF,r9.resolveMode=tU,r9.getMode=tB,r9.modeExtensions=tz,r9.extendMode=function(t,e){$(e,tz.hasOwnProperty(t)?tz[t]:tz[t]={})},r9.copyState=tW,r9.startState=tq,r9.innerMode=t$,r9.commands=rV,r9.keyMap=rP,r9.keyName=rM,r9.isModifierKey=rA,r9.lookupKey=rk,r9.normalizeKeyMap=function(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==o){delete t[n];continue}for(var r=to(n.split(" "),rE),i=0;i<r.length;i++){var a=void 0,s=void 0;i==r.length-1?(s=r.join(" "),a=o):(s=r.slice(0,i+1).join(" "),a="...");var l=e[s];if(l){if(l!=a)throw Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var c in e)t[c]=e[c];return t},r9.StringStream=tG,r9.SharedTextMarker=rf,r9.TextMarker=rp,r9.LineWidget=rl,r9.e_preventDefault=tP,r9.e_stopPropagation=tE,r9.e_stop=tA,r9.addClass=U,r9.contains=F,r9.rmClass=L,r9.keyNames=rx,r9.version="5.63.0",r9},t.exports=e()},7389:(t,e,n)=>{!function(t){function e(t){for(var e={},n=0;n<t.length;++n)e[t[n].toLowerCase()]=!0;return e}t.defineMode("css",function(e,n){var o,r,i=n.inline;n.propertyKeywords||(n=t.resolveMode("text/css"));var a=e.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},p=n.mediaValueKeywords||{},d=n.propertyKeywords||{},f=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},g=n.counterDescriptors||{},v=n.colorKeywords||{},y=n.valueKeywords||{},m=n.allowNested,b=n.lineComment,w=!0===n.supportsAtComponent,_=!1!==e.highlightNonStandardPropertyKeywords;function C(t){return function(e,n){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){")"==t&&e.backUp(1);break}i=!i&&"\\"==r}return r!=t&&(i||")"==t)||(n.tokenize=null),o="string","string"}}function x(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=C(")"),o="(",null}function S(t,e,n){this.type=t,this.indent=e,this.prev=n}function O(t,e,n,o){return t.context=new S(n,e.indentation()+(!1===o?0:a),t.context),n}function T(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function P(t,e,n){return A[n.context.type](t,e,n)}function E(t,e,n,o){for(var r=o||1;r>0;r--)n.context=n.context.prev;return P(t,e,n)}function k(t){var e=t.current().toLowerCase();r=y.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var A={};return A.top=function(t,e,n){if("{"==t)return O(n,e,"block");if("}"==t&&n.context.prev)return T(n);if(w&&/@component/i.test(t))return O(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return O(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return O(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";else if(t&&"@"==t.charAt(0))return O(n,e,"at");else if("hash"==t)r="builtin";else if("word"==t)r="tag";else if("variable-definition"==t)return"maybeprop";else if("interpolation"==t)return O(n,e,"interpolation");else if(":"==t)return"pseudo";else if(m&&"("==t)return O(n,e,"parens");return n.context.type},A.block=function(t,e,n){if("word"==t){var o=e.current().toLowerCase();return d.hasOwnProperty(o)?(r="property","maybeprop"):f.hasOwnProperty(o)?(r=_?"string-2":"property","maybeprop"):m?(r=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(r+=" error","maybeprop")}return"meta"==t?"block":m||"hash"!=t&&"qualifier"!=t?A.top(t,e,n):(r="error","block")},A.maybeprop=function(t,e,n){return":"==t?O(n,e,"prop"):P(t,e,n)},A.prop=function(t,e,n){if(";"==t)return T(n);if("{"==t&&m)return O(n,e,"propBlock");if("}"==t||"{"==t)return E(t,e,n);if("("==t)return O(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)k(e);else if("interpolation"==t)return O(n,e,"interpolation")}else r+=" error";return"prop"},A.propBlock=function(t,e,n){return"}"==t?T(n):"word"==t?(r="property","maybeprop"):n.context.type},A.parens=function(t,e,n){return"{"==t||"}"==t?E(t,e,n):")"==t?T(n):"("==t?O(n,e,"parens"):"interpolation"==t?O(n,e,"interpolation"):("word"==t&&k(e),"parens")},A.pseudo=function(t,e,n){return"meta"==t?"pseudo":"word"==t?(r="variable-3",n.context.type):P(t,e,n)},A.documentTypes=function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(r="tag",n.context.type):A.atBlock(t,e,n)},A.atBlock=function(t,e,n){if("("==t)return O(n,e,"atBlock_parens");if("}"==t||";"==t)return E(t,e,n);if("{"==t)return T(n)&&O(n,e,m?"block":"top");if("interpolation"==t)return O(n,e,"interpolation");if("word"==t){var o=e.current().toLowerCase();r="only"==o||"not"==o||"and"==o||"or"==o?"keyword":c.hasOwnProperty(o)?"attribute":u.hasOwnProperty(o)?"property":p.hasOwnProperty(o)?"keyword":d.hasOwnProperty(o)?"property":f.hasOwnProperty(o)?_?"string-2":"property":y.hasOwnProperty(o)?"atom":v.hasOwnProperty(o)?"keyword":"error"}return n.context.type},A.atComponentBlock=function(t,e,n){return"}"==t?E(t,e,n):"{"==t?T(n)&&O(n,e,m?"block":"top",!1):("word"==t&&(r="error"),n.context.type)},A.atBlock_parens=function(t,e,n){return")"==t?T(n):"{"==t||"}"==t?E(t,e,n,2):A.atBlock(t,e,n)},A.restricted_atBlock_before=function(t,e,n){return"{"==t?O(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(r="variable","restricted_atBlock_before"):P(t,e,n)},A.restricted_atBlock=function(t,e,n){return"}"==t?(n.stateArg=null,T(n)):"word"==t?(r=("@font-face"!=n.stateArg||h.hasOwnProperty(e.current().toLowerCase()))&&("@counter-style"!=n.stateArg||g.hasOwnProperty(e.current().toLowerCase()))?"property":"error","maybeprop"):"restricted_atBlock"},A.keyframes=function(t,e,n){return"word"==t?(r="variable","keyframes"):"{"==t?O(n,e,"top"):P(t,e,n)},A.at=function(t,e,n){return";"==t?T(n):"{"==t||"}"==t?E(t,e,n):("word"==t?r="tag":"hash"==t&&(r="builtin"),"at")},A.interpolation=function(t,e,n){return"}"==t?T(n):"{"==t||";"==t?E(t,e,n):("word"==t?r="variable":"variable"!=t&&"("!=t&&")"!=t&&(r="error"),"interpolation")},{startState:function(t){return{tokenize:null,state:i?"block":"top",stateArg:null,context:new S(i?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||function(t,e){var n=t.next();if(s[n]){var r=s[n](t,e);if(!1!==r)return r}if("@"==n)return t.eatWhile(/[\w\\\-]/),o=t.current(),"def";if("="==n||("~"==n||"|"==n)&&t.eat("="))return o="compare",null;if('"'==n||"'"==n)return e.tokenize=C(n),e.tokenize(t,e);if("#"==n)return t.eatWhile(/[\w\\\-]/),o="hash","atom";if("!"==n)return t.match(/^\s*\w*/),o="important","keyword";if(/\d/.test(n)||"."==n&&t.eat(/\d/))return t.eatWhile(/[\w.%]/),o="unit","number";if("-"===n){if(/[\d.]/.test(t.peek()))return t.eatWhile(/[\w.%]/),o="unit","number";if(t.match(/^-[\w\\\-]*/))return t.eatWhile(/[\w\\\-]/),o=t.match(/^\s*:/,!1)?"variable-definition":"variable","variable-2";if(t.match(/^\w+-/))return o="meta","meta"}else if(/[,+>*\/]/.test(n))return o="select-op",null;else if("."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i))return o="qualifier","qualifier";else if(/[:;{}\[\]\(\)]/.test(n))return o=n,null;else return t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=x),o="variable","variable callee"):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),o="word","property"):(o=null,null)})(t,e);return n&&"object"==typeof n&&(o=n[1],n=n[0]),r=n,"comment"!=o&&(e.state=A[e.state](o,t,e)),r},indent:function(t,e){var n=t.context,o=e&&e.charAt(0),r=n.indent;return"prop"==n.type&&("}"==o||")"==o)&&(n=n.prev),n.prev&&("}"==o&&("block"==n.type||"top"==n.type||"interpolation"==n.type||"restricted_atBlock"==n.type)?r=(n=n.prev).indent:(")"==o&&("parens"==n.type||"atBlock_parens"==n.type)||"{"==o&&("at"==n.type||"atBlock"==n.type))&&(r=Math.max(0,n.indent-a))),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],o=e(n),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(r),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],p=e(u),d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],f=e(d),h=e(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=e(v),m=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=e(m),w=n.concat(r).concat(a).concat(l).concat(u).concat(d).concat(v).concat(m);function _(t,e){for(var n,o=!1;null!=(n=t.next());){if(o&&"/"==n){e.tokenize=null;break}o="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",w),t.defineMIME("text/css",{documentTypes:o,mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=_,_(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=_,_(t,e)):["operator","operator"]},":":function(t){return!!t.match(/^\s*\{/,!1)&&[null,null]},$:function(t){return(t.match(/^[\w-]+/),t.match(/^\s*:/,!1))?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=_,_(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&((t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1))?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:o,mediaTypes:i,mediaFeatures:s,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=_,_(t,e))}},name:"css",helperType:"gss"})}(n(4408))},8253:(t,e,n)=>{!function(t){var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},n={};function o(t,e){return RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function r(t,e){for(var n in t)for(var o=e[n]||(e[n]=[]),r=t[n],i=r.length-1;i>=0;i--)o.unshift(r[i])}t.defineMode("htmlmixed",function(i,a){var s=t.getMode(i,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag,allowMissingTagName:a.allowMissingTagName}),l={},c=a&&a.tags,u=a&&a.scriptTypes;if(r(e,l),c&&r(c,l),u)for(var p=u.length-1;p>=0;p--)l.script.unshift(["type",u[p].matches,u[p].mode]);function d(e,r){var a,c=s.token(e,r.htmlState),u=/\btag\b/.test(c);if(u&&!/[<>\s\/]/.test(e.current())&&(a=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(a))r.inTag=a+" ";else if(r.inTag&&u&&/>$/.test(e.current())){var p=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var f=">"==e.current()&&function(t,e){for(var o=0;o<t.length;o++){var r=t[o];if(!r[0]||r[1].test(function(t,e){var o,r=t.match((o=n[e])?o:n[e]=RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}(e,r[0])))return r[2]}}(l[p[1]],p[2]),h=t.getMode(i,f),g=o(p[1],!0),v=o(p[1],!1);r.token=function(t,e){var n,o,r;return t.match(g,!1)?(e.token=d,e.localState=e.localMode=null,null):(n=e.localMode.token(t,e.localState),(r=(o=t.current()).search(v))>-1?t.backUp(o.length-r):o.match(/<\/?$/)&&(t.backUp(o.length),t.match(v,!1)||t.match(o)),n)},r.localMode=h,r.localState=t.startState(h,s.indent(r.htmlState,"",""))}else r.inTag&&(r.inTag+=e.current(),e.eol()&&(r.inTag+=" "));return c}return{startState:function(){return{token:d,inTag:null,localMode:null,localState:null,htmlState:t.startState(s)}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(s,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,o){return!e.localMode||/^\s*<\//.test(n)?s.indent(e.htmlState,n,o):e.localMode.indent?e.localMode.indent(e.localState,n,o):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||s}}}},"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(4408),n(9701),n(6061),n(7389))},6061:(t,e,n)=>{var o;(o=n(4408)).defineMode("javascript",function(t,e){var n,r,i=t.indentUnit,a=e.statementIndent,s=e.jsonld,l=e.json||s,c=!1!==e.trackScope,u=e.typescript,p=e.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),o=t("keyword c"),r=t("keyword d"),i=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:t("new"),delete:o,void:o,throw:o,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:o,export:t("export"),import:t("import"),extends:o,await:o}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t,e,o){return n=t,r=o,e}function v(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=function(t,e){var o,r=!1;if(s&&"@"==t.peek()&&t.match(h))return e.tokenize=v,g("jsonld-keyword","meta");for(;null!=(o=t.next())&&(o!=n||r);)r=!r&&"\\"==o;return r||(e.tokenize=v),g("string","string")},e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==n&&t.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if("="==n&&t.eat(">"))return g("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");else if("/"==n)return t.eat("*")?(e.tokenize=y,y(t,e)):t.eat("/")?(t.skipToEnd(),g("comment","comment")):tX(t,e,1)?(function(t){for(var e,n=!1,o=!1;null!=(e=t.next());){if(!n){if("/"==e&&!o)return;"["==e?o=!0:o&&"]"==e&&(o=!1)}n=!n&&"\\"==e}}(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(t.eat("="),g("operator","operator",t.current()));else if("`"==n)return e.tokenize=m,m(t,e);else if("#"==n&&"!"==t.peek())return t.skipToEnd(),g("meta","meta");else if("#"==n&&t.eatWhile(p))return g("variable","property");else if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),g("comment","comment");else if(f.test(n))return((">"!=n||!e.lexical||">"!=e.lexical.type)&&(t.eat("=")?("!"==n||"="==n)&&t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat("."))?g("."):g("operator","operator",t.current());else if(p.test(n)){t.eatWhile(p);var o=t.current();if("."!=e.lastType){if(d.propertyIsEnumerable(o)){var r=d[o];return g(r.type,r.style,o)}if("async"==o&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",o)}return g("variable","variable",o)}}function y(t,e){for(var n,o=!1;n=t.next();){if("/"==n&&o){e.tokenize=v;break}o="*"==n}return g("comment","comment")}function m(t,e){for(var n,o=!1;null!=(n=t.next());){if(!o&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=v;break}o=!o&&"\\"==n}return g("quasi","string-2",t.current())}function b(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var o=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));o&&(n=o.index)}for(var r=0,i=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!r){++a;break}if(0==--r){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++r;else if(p.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(t.string.charAt(a-1)==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(i&&!r){++a;break}}i&&!r&&(e.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function _(t,e,n,o,r,i){this.indented=t,this.column=e,this.type=n,this.prev=r,this.info=i,null!=o&&(this.align=o)}function C(t,e,n,o,r){var i=t.cc;for(x.state=t,x.stream=r,x.marked=null,x.cc=i,x.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;)if((i.length?i.pop():l?H:V)(n,o)){for(;i.length&&i[i.length-1].lex;)i.pop()();if(x.marked)return x.marked;if("variable"==n&&function(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var o=t.context;o;o=o.prev)for(var n=o.vars;n;n=n.next)if(n.name==e)return!0}(t,o))return"variable-2";return e}}var x={state:null,column:null,marked:null,cc:null};function S(){for(var t=arguments.length-1;t>=0;t--)x.cc.push(arguments[t])}function O(){return S.apply(null,arguments),!0}function T(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function P(t){var n=x.state;if(x.marked="def",c){if(n.context){if("var"==n.lexical.info&&n.context&&n.context.block){var o=function t(e,n){if(!n)return null;if(n.block){var o=t(e,n.prev);return o?o==n.prev?n:new k(o,n.vars,!0):null}return T(e,n.vars)?n:new k(n.prev,new A(e,n.vars),!1)}(t,n.context);if(null!=o){n.context=o;return}}else if(!T(t,n.localVars)){n.localVars=new A(t,n.localVars);return}}e.globalVars&&!T(t,n.globalVars)&&(n.globalVars=new A(t,n.globalVars))}}function E(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function k(t,e,n){this.prev=t,this.vars=e,this.block=n}function A(t,e){this.name=t,this.next=e}var j=new A("this",new A("arguments",null));function M(){x.state.context=new k(x.state.context,x.state.localVars,!1),x.state.localVars=j}function D(){x.state.context=new k(x.state.context,x.state.localVars,!0),x.state.localVars=null}function L(){x.state.localVars=x.state.context.vars,x.state.context=x.state.context.prev}function I(t,e){var n=function(){var n=x.state,o=n.indented;if("stat"==n.lexical.type)o=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)o=r.indented;n.lexical=new _(o,x.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function N(){var t=x.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function R(t){return function e(n){return n==t?O():";"==t||"}"==n||")"==n||"]"==n?S():O(e)}}function V(t,e){if("var"==t)return O(I("vardef",e),tC,R(";"),N);if("keyword a"==t)return O(I("form"),B,V,N);if("keyword b"==t)return O(I("form"),V,N);if("keyword d"==t)return x.stream.match(/^\s*$/,!1)?O():O(I("stat"),W,R(";"),N);if("debugger"==t)return O(R(";"));if("{"==t)return O(I("}"),D,ta,N,L);if(";"==t)return O();if("if"==t)return"else"==x.state.lexical.info&&x.state.cc[x.state.cc.length-1]==N&&x.state.cc.pop()(),O(I("form"),B,V,N,tE);if("function"==t)return O(tM);if("for"==t)return O(I("form"),D,tk,V,L,N);if("class"==t||u&&"interface"==e)return x.marked="keyword",O(I("form","class"==t?t:e),tR,N);if("variable"==t)return u&&"declare"==e?(x.marked="keyword",O(V)):u&&("module"==e||"enum"==e||"type"==e)&&x.stream.match(/^\s*\w/,!1)?(x.marked="keyword","enum"==e)?O(tY):"type"==e?O(tL,R("operator"),tp,R(";")):O(I("form"),tx,R("{"),I("}"),ta,N,N):u&&"namespace"==e?(x.marked="keyword",O(I("form"),H,V,N)):u&&"abstract"==e?(x.marked="keyword",O(V)):O(I("stat"),Q);return"switch"==t?O(I("form"),B,R("{"),I("}","switch"),D,ta,N,N,L):"case"==t?O(H,R(":")):"default"==t?O(R(":")):"catch"==t?O(I("form"),M,F,V,N,L):"export"==t?O(I("stat"),tU,N):"import"==t?O(I("stat"),tz,N):"async"==t?O(V):"@"==e?O(H,V):S(I("stat"),H,R(";"),N)}function F(t){if("("==t)return O(tI,R(")"))}function H(t,e){return z(t,e,!1)}function U(t,e){return z(t,e,!0)}function B(t){return"("!=t?S():O(I(")"),W,R(")"),N)}function z(t,e,n){if(x.state.fatArrowAt==x.stream.start){var o=n?J:Y;if("("==t)return O(M,I(")"),tr(tI,")"),N,R("=>"),o,L);if("variable"==t)return S(M,tx,R("=>"),o,L)}var r=n?q:$;return w.hasOwnProperty(t)?O(r):"function"==t?O(tM,r):"class"==t||u&&"interface"==e?(x.marked="keyword",O(I("form"),tN,N)):"keyword c"==t||"async"==t?O(n?U:H):"("==t?O(I(")"),W,R(")"),N,r):"operator"==t||"spread"==t?O(n?U:H):"["==t?O(I("]"),tK,N,r):"{"==t?ti(te,"}",null,r):"quasi"==t?S(G,r):"new"==t?O(function(t){return"."==t?O(n?Z:X):"variable"==t&&u?O(tb,n?q:$):S(n?U:H)}):O()}function W(t){return t.match(/[;\}\)\],]/)?S():S(H)}function $(t,e){return","==t?O(W):q(t,e,!1)}function q(t,e,n){var o=!1==n?$:q,r=!1==n?H:U;if("=>"==t)return O(M,n?J:Y,L);if("operator"==t)return/\+\+|--/.test(e)||u&&"!"==e?O(o):u&&"<"==e&&x.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?O(I(">"),tr(tp,">"),N,o):"?"==e?O(H,R(":"),r):O(r);if("quasi"==t)return S(G,o);if(";"!=t){if("("==t)return ti(U,")","call",o);if("."==t)return O(tt,o);if("["==t)return O(I("]"),W,R("]"),N,o);if(u&&"as"==e)return x.marked="keyword",O(tp,o);if("regexp"==t)return x.state.lastType=x.marked="operator",x.stream.backUp(x.stream.pos-x.stream.start-1),O(r)}}function G(t,e){return"quasi"!=t?S():"${"!=e.slice(e.length-2)?O(G):O(W,K)}function K(t){if("}"==t)return x.marked="string-2",x.state.tokenize=m,O(G)}function Y(t){return b(x.stream,x.state),S("{"==t?V:H)}function J(t){return b(x.stream,x.state),S("{"==t?V:U)}function X(t,e){if("target"==e)return x.marked="keyword",O($)}function Z(t,e){if("target"==e)return x.marked="keyword",O(q)}function Q(t){return":"==t?O(N,V):S($,R(";"),N)}function tt(t){if("variable"==t)return x.marked="property",O()}function te(t,e){if("async"==t)return x.marked="property",O(te);if("variable"==t||"keyword"==x.style){var n;return(x.marked="property","get"==e||"set"==e)?O(tn):(u&&x.state.fatArrowAt==x.stream.start&&(n=x.stream.match(/^\s*:\s*/,!1))&&(x.state.fatArrowAt=x.stream.pos+n[0].length),O(to))}if("number"==t||"string"==t)return x.marked=s?"property":x.style+" property",O(to);if("jsonld-keyword"==t)return O(to);if(u&&E(e))return x.marked="keyword",O(te);if("["==t)return O(H,ts,R("]"),to);if("spread"==t)return O(U,to);else if("*"==e)return x.marked="keyword",O(te);else if(":"==t)return S(to)}function tn(t){return"variable"!=t?S(to):(x.marked="property",O(tM))}function to(t){return":"==t?O(U):"("==t?S(tM):void 0}function tr(t,e,n){function o(r,i){if(n?n.indexOf(r)>-1:","==r){var a=x.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),O(function(n,o){return n==e||o==e?S():S(t)},o)}return r==e||i==e?O():n&&n.indexOf(";")>-1?S(t):O(R(e))}return function(n,r){return n==e||r==e?O():S(t,o)}}function ti(t,e,n){for(var o=3;o<arguments.length;o++)x.cc.push(arguments[o]);return O(I(e,n),tr(t,e),N)}function ta(t){return"}"==t?O():S(V,ta)}function ts(t,e){if(u){if(":"==t)return O(tp);if("?"==e)return O(ts)}}function tl(t,e){if(u&&(":"==t||"in"==e))return O(tp)}function tc(t){if(u&&":"==t)return x.stream.match(/^\s*\w+\s+is\b/,!1)?O(H,tu,tp):O(tp)}function tu(t,e){if("is"==e)return x.marked="keyword",O()}function tp(t,e){return"keyof"==e||"typeof"==e||"infer"==e||"readonly"==e?(x.marked="keyword",O("typeof"==e?U:tp)):"variable"==t||"void"==e?(x.marked="type",O(tm)):"|"==e||"&"==e?O(tp):"string"==t||"number"==t||"atom"==t?O(tm):"["==t?O(I("]"),tr(tp,"]",","),N,tm):"{"==t?O(I("}"),tf,N,tm):"("==t?O(tr(ty,")"),td,tm):"<"==t?O(tr(tp,">"),tp):"quasi"==t?S(tg,tm):void 0}function td(t){if("=>"==t)return O(tp)}function tf(t){return t.match(/[\}\)\]]/)?O():","==t||";"==t?O(tf):S(th,tf)}function th(t,e){return"variable"==t||"keyword"==x.style?(x.marked="property",O(th)):"?"==e||"number"==t||"string"==t?O(th):":"==t?O(tp):"["==t?O(R("variable"),tl,R("]"),th):"("==t?S(tD,th):t.match(/[;\}\)\],]/)?void 0:O()}function tg(t,e){return"quasi"!=t?S():"${"!=e.slice(e.length-2)?O(tg):O(tp,tv)}function tv(t){if("}"==t)return x.marked="string-2",x.state.tokenize=m,O(tg)}function ty(t,e){return"variable"==t&&x.stream.match(/^\s*[?:]/,!1)||"?"==e?O(ty):":"==t?O(tp):"spread"==t?O(ty):S(tp)}function tm(t,e){return"<"==e?O(I(">"),tr(tp,">"),N,tm):"|"==e||"."==t||"&"==e?O(tp):"["==t?O(tp,R("]"),tm):"extends"==e||"implements"==e?(x.marked="keyword",O(tp)):"?"==e?O(tp,R(":"),tp):void 0}function tb(t,e){if("<"==e)return O(I(">"),tr(tp,">"),N,tm)}function tw(){return S(tp,t_)}function t_(t,e){if("="==e)return O(tp)}function tC(t,e){return"enum"==e?(x.marked="keyword",O(tY)):S(tx,ts,tT,tP)}function tx(t,e){return u&&E(e)?(x.marked="keyword",O(tx)):"variable"==t?(P(e),O()):"spread"==t?O(tx):"["==t?ti(tO,"]"):"{"==t?ti(tS,"}"):void 0}function tS(t,e){return"variable"!=t||x.stream.match(/^\s*:/,!1)?("variable"==t&&(x.marked="property"),"spread"==t)?O(tx):"}"==t?S():"["==t?O(H,R("]"),R(":"),tS):O(R(":"),tx,tT):(P(e),O(tT))}function tO(){return S(tx,tT)}function tT(t,e){if("="==e)return O(U)}function tP(t){if(","==t)return O(tC)}function tE(t,e){if("keyword b"==t&&"else"==e)return O(I("form","else"),V,N)}function tk(t,e){return"await"==e?O(tk):"("==t?O(I(")"),tA,N):void 0}function tA(t){return"var"==t?O(tC,tj):"variable"==t?O(tj):S(tj)}function tj(t,e){return")"==t?O():";"==t?O(tj):"in"==e||"of"==e?(x.marked="keyword",O(H,tj)):S(H,tj)}function tM(t,e){return"*"==e?(x.marked="keyword",O(tM)):"variable"==t?(P(e),O(tM)):"("==t?O(M,I(")"),tr(tI,")"),N,tc,V,L):u&&"<"==e?O(I(">"),tr(tw,">"),N,tM):void 0}function tD(t,e){return"*"==e?(x.marked="keyword",O(tD)):"variable"==t?(P(e),O(tD)):"("==t?O(M,I(")"),tr(tI,")"),N,tc,L):u&&"<"==e?O(I(">"),tr(tw,">"),N,tD):void 0}function tL(t,e){return"keyword"==t||"variable"==t?(x.marked="type",O(tL)):"<"==e?O(I(">"),tr(tw,">"),N):void 0}function tI(t,e){return("@"==e&&O(H,tI),"spread"==t)?O(tI):u&&E(e)?(x.marked="keyword",O(tI)):u&&"this"==t?O(ts,tT):S(tx,ts,tT)}function tN(t,e){return"variable"==t?tR(t,e):tV(t,e)}function tR(t,e){if("variable"==t)return P(e),O(tV)}function tV(t,e){return"<"==e?O(I(">"),tr(tw,">"),N,tV):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(x.marked="keyword"),O(u?tp:H,tV)):"{"==t?O(I("}"),tF,N):void 0}function tF(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&E(e))&&x.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(x.marked="keyword",O(tF)):"variable"==t||"keyword"==x.style?(x.marked="property",O(tH,tF)):"number"==t||"string"==t?O(tH,tF):"["==t?O(H,ts,R("]"),tH,tF):"*"==e?(x.marked="keyword",O(tF)):u&&"("==t?S(tD,tF):";"==t||","==t?O(tF):"}"==t?O():"@"==e?O(H,tF):void 0}function tH(t,e){if("!"==e||"?"==e)return O(tH);if(":"==t)return O(tp,tT);if("="==e)return O(U);var n=x.state.lexical.prev;return S(n&&"interface"==n.info?tD:tM)}function tU(t,e){return"*"==e?(x.marked="keyword",O(tG,R(";"))):"default"==e?(x.marked="keyword",O(H,R(";"))):"{"==t?O(tr(tB,"}"),tG,R(";")):S(V)}function tB(t,e){return"as"==e?(x.marked="keyword",O(R("variable"))):"variable"==t?S(U,tB):void 0}function tz(t){return"string"==t?O():"("==t?S(H):"."==t?S($):S(tW,t$,tG)}function tW(t,e){return"{"==t?ti(tW,"}"):("variable"==t&&P(e),"*"==e&&(x.marked="keyword"),O(tq))}function t$(t){if(","==t)return O(tW,t$)}function tq(t,e){if("as"==e)return x.marked="keyword",O(tW)}function tG(t,e){if("from"==e)return x.marked="keyword",O(H)}function tK(t){return"]"==t?O():S(tr(U,"]"))}function tY(){return S(I("form"),tx,R("{"),I("}"),tr(tJ,"}"),N,N)}function tJ(){return S(tx,tT)}function tX(t,e,n){return e.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return L.lex=!0,N.lex=!0,{startState:function(t){var n={tokenize:v,lastType:"sof",cc:[],lexical:new _((t||0)-i,0,"block",!1),localVars:e.localVars,context:e.localVars&&new k(null,null,!1),indented:t||0};return e.globalVars&&"object"==typeof e.globalVars&&(n.globalVars=e.globalVars),n},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),b(t,e)),e.tokenize!=y&&t.eatSpace())return null;var o=e.tokenize(t,e);return"comment"==n?o:(e.lastType="operator"==n&&("++"==r||"--"==r)?"incdec":n,C(e,o,n,r,t))},indent:function(t,n){if(t.tokenize==y||t.tokenize==m)return o.Pass;if(t.tokenize!=v)return 0;var r,s=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==N)l=l.prev;else if(u!=tE&&u!=L)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(r=t.cc[t.cc.length-1])&&(r==$||r==q)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var p=l.type,d=s==p;return"vardef"==p?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==p&&"{"==s?l.indented:"form"==p?l.indented+i:"stat"==p?l.indented+("operator"==t.lastType||","==t.lastType||f.test(n.charAt(0))||/[,.]/.test(n.charAt(0))?a||i:0):"switch"!=l.info||d||!1==e.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:i):l.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:tX,skipExpression:function(t){C(t,"atom","atom","true",new o.StringStream("",2,null))}}}),o.registerHelper("wordChars","javascript",/[\w$]/),o.defineMIME("text/javascript","javascript"),o.defineMIME("text/ecmascript","javascript"),o.defineMIME("application/javascript","javascript"),o.defineMIME("application/x-javascript","javascript"),o.defineMIME("application/ecmascript","javascript"),o.defineMIME("application/json",{name:"javascript",json:!0}),o.defineMIME("application/x-json",{name:"javascript",json:!0}),o.defineMIME("application/manifest+json",{name:"javascript",json:!0}),o.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),o.defineMIME("text/typescript",{name:"javascript",typescript:!0}),o.defineMIME("application/typescript",{name:"javascript",typescript:!0})},9701:(t,e,n)=>{var o,r,i;o=n(4408),r={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},o.defineMode("xml",function(t,e){var n,a,s=t.indentUnit,l={},c=e.htmlMode?r:i;for(var u in c)l[u]=c[u];for(var u in e)l[u]=e[u];function p(t,e){function o(n){return e.tokenize=n,n(t,e)}var r=t.next();if("<"==r)return t.eat("!")?t.eat("[")?t.match("CDATA[")?o(f("atom","]]>")):null:t.match("--")?o(f("comment","-->")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),o(function t(e){return function(n,o){for(var r;null!=(r=n.next());){if("<"==r)return o.tokenize=t(e+1),o.tokenize(n,o);if(">"==r){if(1!=e)return o.tokenize=t(e-1),o.tokenize(n,o);o.tokenize=p;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(n=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket");return"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function d(t,e){var o,r=t.next();if(">"==r||"/"==r&&t.eat(">"))return e.tokenize=p,n=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return n="equals",null;if("<"==r){e.tokenize=p,e.state=m,e.tagName=e.tagStart=null;var i=e.tokenize(t,e);return i?i+" tag error":"tag error"}return/[\'\"]/.test(r)?(e.tokenize=((o=function(t,e){for(;!t.eol();)if(t.next()==r){e.tokenize=d;break}return"string"}).isInAttribute=!0,o),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t,e){return function(n,o){for(;!n.eol();){if(n.match(e)){o.tokenize=p;break}n.next()}return t}}function h(t){return t&&t.toLowerCase()}function g(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function v(t){t.context&&(t.context=t.context.prev)}function y(t,e){for(var n;;){if(!t.context||(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(h(n))||!l.contextGrabbers[h(n)].hasOwnProperty(h(e))))return;v(t)}}function m(t,e,n){return"openTag"==t?(n.tagStart=e.column(),b):"closeTag"==t?w:m}function b(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",x):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",x(t,e,n)):(a="error",b)}function w(t,e,n){if("word"==t){var o=e.current();return(n.context&&n.context.tagName!=o&&l.implicitlyClosed.hasOwnProperty(h(n.context.tagName))&&v(n),n.context&&n.context.tagName==o||!1===l.matchClosing)?(a="tag",_):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",_(t,e,n)):(a="error",C)}function _(t,e,n){return"endTag"!=t?(a="error",_):(v(n),m)}function C(t,e,n){return a="error",_(t,e,n)}function x(t,e,n){if("word"==t)return a="attribute",S;if("endTag"==t||"selfcloseTag"==t){var o=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(h(o))?y(n,o):(y(n,o),n.context=new g(n,o,r==n.indented)),m}return a="error",x}function S(t,e,n){return"equals"==t?O:(l.allowMissing||(a="error"),x(t,e,n))}function O(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",x):(a="error",x(t,e,n))}function T(t,e,n){return"string"==t?T:x(t,e,n)}return p.isInText=!0,{startState:function(t){var e={tokenize:p,state:m,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;n=null;var o=e.tokenize(t,e);return(o||n)&&"comment"!=o&&(a=null,e.state=e.state(n||o,t,e),a&&(o="error"==a?o+" error":a)),o},indent:function(t,e,n){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(r&&r.noIndent)return o.Pass;if(t.tokenize!=d&&t.tokenize!=p)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(e))return 0;var i=e&&/^<(\/)?([\w_:\.-]*)/.exec(e);if(i&&i[1])for(;r;){if(r.tagName==i[2]){r=r.prev;break}if(l.implicitlyClosed.hasOwnProperty(h(r.tagName)))r=r.prev;else break}else if(i)for(;r;){var a=l.contextGrabbers[h(r.tagName)];if(a&&a.hasOwnProperty(h(i[2])))r=r.prev;else break}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==O&&(t.state=x)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}}),o.defineMIME("text/xml","xml"),o.defineMIME("application/xml","xml"),o.mimeModes.hasOwnProperty("text/html")||o.defineMIME("text/html",{name:"xml",htmlMode:!0})},7058:(t,e,n)=>{n.d(e,{A:()=>a});var o,r=n(9156),i=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});let a=function(t){function e(e,n,o){var r=t.call(this,n,o)||this;return r._module=e,r}return i(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),e}(r.Kx)},179:(t,e,n)=>{n.d(e,{A:()=>l,F:()=>i});var o,r,i,a=n(7058),s=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});(r=i||(i={})).Select="select",r.Hover="hover",r.Spacing="spacing",r.Target="target",r.Resize="resize";let l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.defaults=function(){return{id:"",type:""}},Object.defineProperty(e.prototype,"type",{get:function(){return this.get("type")||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){var t;return this.get("component")||(null===(t=this.get("componentView"))||void 0===t?void 0:t.model)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"componentView",{get:function(){var t;return this.get("componentView")||(null===(t=this.get("component"))||void 0===t?void 0:t.getView())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"el",{get:function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.el},enumerable:!1,configurable:!0}),e.prototype.getBoxRect=function(t){var e=this.el,n=this.em.Canvas.getCanvasView();return this.get("boxRect")||(e&&n?n.getElBoxRect(e,t):{x:0,y:0,width:0,height:0})},e.prototype.getStyle=function(t){void 0===t&&(t={});var e=t.boxRect||this.getBoxRect(t),n=e.width,o=e.height,r=e.x,i=e.y;return{width:"".concat(n,"px"),height:"".concat(o,"px"),top:"0",left:"0",position:"absolute",translate:"".concat(r,"px ").concat(i,"px")}},e.prototype.isType=function(t){return this.type===t},e}(a.A)},1738:(t,e,n)=>{var o,r;n.d(e,{A:()=>i}),(r=o||(o={})).run="command:run",r.runCommand="command:run:",r.runBeforeCommand="command:run:before:",r.abort="command:abort:",r.stop="command:stop",r.stopCommand="command:stop:",r.stopBeforeCommand="command:stop:before:",r.call="command:call",r.callCommand="command:call:";let i=o},9484:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});let o={run:function(t){t.Components.clear(),t.Css.clear()}}},9516:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});var o=n(5706),r=n(9966),i=n(6294);let a={run:function(t){(0,o.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(t){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){" "===(0,i.Ch)(t)&&this.editor.stopCommand(this.id)},enableDragger:function(t){this.toggleDragger(1,t)},disableDragger:function(t){this.toggleDragger(0,t)},toggleDragger:function(t,e){var n=this.canvasModel,o=this.em,i=this.dragger;this.getCanvas().classList[t?"add":"remove"]("".concat(this.ppfx,"is__grabbing")),i||(i=new r.A({getPosition:function(){return{x:n.get("x"),y:n.get("y")}},setPosition:function(t){var e=t.x,o=t.y;n.set({x:e,y:o})},onStart:function(t,e){o.trigger("canvas:move:start",e)},onDrag:function(t,e){o.trigger("canvas:move",e)},onEnd:function(t,e){o.trigger("canvas:move:end",e)}}),this.dragger=i),t?i.start(e):i.stop()},toggleMove:function(t){var e=this.ppfx,n=t?"add":"remove",o=t?"on":"off",r={on:i.on,off:i.AU},a=this.getCanvas(),s=["".concat(e,"is__grab")];t||s.push("".concat(e,"is__grabbing")),s.forEach(function(t){return a.classList[n](t)}),r[o](document,"keyup",this.onKeyUp),r[o](a,"mousedown",this.enableDragger),r[o](document,"mouseup",this.disableDragger)}}},9946:(t,e,n)=>{n.r(e),n.d(e,{default:()=>c,defineCommand:()=>l});var o,r=n(9156),i=n(1738),a=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(){return(s=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function l(t){return t}let c=function(t){function e(e){var n=t.call(this,0)||this;n.config=e||{},n.em=n.config.em||{};var o=n.config.stylePrefix;return n.pfx=o,n.ppfx=n.config.pStylePrefix,n.hoverClass="".concat(o,"hover"),n.badgeClass="".concat(o,"badge"),n.plhClass="".concat(o,"placeholder"),n.freezClass="".concat(n.ppfx,"freezed"),n.canvas=n.em.Canvas,n.init(n.config),n}return a(e,t),e.prototype.onFrameScroll=function(t){},e.prototype.getCanvas=function(){return this.canvas.getElement()},e.prototype.getCanvasBody=function(){return this.canvas.getBody()},e.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},e.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},e.prototype.init=function(t){},e.prototype.callRun=function(t,e){void 0===e&&(e={});var n=this.id;if(t.trigger("".concat(i.A.runBeforeCommand).concat(n),{options:e}),e.abort){t.trigger("".concat(i.A.abort).concat(n),{options:e});return}var o=e.sender||t,r=this.run(t,o,e),a={id:n,result:r,options:e},l=s(s({},a),{type:"run"});return this.noStop||(t.Commands.active[n]=r),t.trigger("".concat(i.A.runCommand).concat(n),a),t.trigger("".concat(i.A.callCommand).concat(n),l),t.trigger(i.A.run,a),t.trigger(i.A.call,l),r},e.prototype.callStop=function(t,e){void 0===e&&(e={});var n=this.id,o=e.sender||t;t.trigger("".concat(i.A.stopBeforeCommand).concat(n),{options:e});var r=this.stop(t,o,e),a={id:n,result:r,options:e},l=s(s({},a),{type:"stop"});return delete t.Commands.active[n],t.trigger("".concat(i.A.stopCommand).concat(n),a),t.trigger("".concat(i.A.callCommand).concat(n),l),t.trigger(i.A.stop,a),t.trigger(i.A.call,l),r},e.prototype.stopCommand=function(t){this.em.Commands.stop(this.id,t)},e.prototype.run=function(t,e,n){},e.prototype.stop=function(t,e,n){},e}(r.Kx)},7801:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var o=n(5706),r=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};let i={run:function(t,e,n){var i=this;void 0===n&&(n={});var a=[],s=n.component||t.getSelectedAll();return(s=(0,o.isArray)(s)?r([],s,!0):[s]).filter(Boolean).forEach(function(t){var e,n;if(!t.get("removable"))return i.em.logWarning("The element is not removable",{component:t});a.push(t),((null===(n=null===(e=t.delegate)||void 0===e?void 0:e.remove)||void 0===n?void 0:n.call(e,t))||t).remove()}),t.selectRemove(a),a}}},4864:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var o=n(5706),r=n(9966),i=n(1166),a=function(){return(a=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s="dmode";let l={run:function(t,e,n){var i,l,c=this;if(void 0===n&&(n={}),(0,o.bindAll)(this,"setPosition","onStart","onDrag","onEnd","getPosition","getGuidesStatic","renderGuide","getGuidesTarget"),!n.target)throw Error("Target option is required");var u=a({doc:null===(i=n.target.getEl())||void 0===i?void 0:i.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){var t;return null!==(t=c.guidesStatic)&&void 0!==t?t:[]},guidesTarget:function(){var t;return null!==(t=c.guidesTarget)&&void 0!==t?t:[]}},null!==(l=n.dragger)&&void 0!==l?l:{});this.setupGuides(),this.opts=n,this.editor=t,this.em=t.getModel(),this.target=n.target,this.isTran="translate"==n.mode,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var p=this.dragger;return p?p.setOptions(u):(p=new r.A(u),this.dragger=p),n.event&&p.start(n.event),this.toggleDrag(!0),this.em.trigger("".concat(s,":start"),this.getEventOpts()),p},getEventOpts:function(){var t,e,n=null!==(e=null===(t=this.guidesTarget)||void 0===t?void 0:t.filter(function(t){return t.active}))&&void 0!==e?e:[];return{mode:this.opts.mode,component:this.target,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic,guidesMatched:this.getGuidesMatched(n),command:this}},stop:function(){this.toggleDrag()},setupGuides:function(){var t;(null!==(t=this.guides)&&void 0!==t?t:[]).forEach(function(t){var e,n=t.guide;null===(e=null==n?void 0:n.parentNode)||void 0===e||e.removeChild(n)}),this.guides=[]},getGuidesContainer:function(){var t,e,n,r,i=this,a=this.guidesEl;if(!a){var s=this.editor,l=this.em,c=this.opts,u=null!==(t=s.getConfig().stylePrefix)&&void 0!==t?t:"",p=document.createElement("div"),d=document.createElement("div"),f='<div class="'.concat(u,"guide-info__line ").concat(u,'danger-bg">\n <div class="').concat(u,"guide-info__content ").concat(u,'danger-color"></div>\n </div>');(a=document.createElement("div")).className="".concat(u,"guides"),p.className="".concat(u,"guide-info ").concat(u,"guide-info__x"),d.className="".concat(u,"guide-info ").concat(u,"guide-info__y"),p.innerHTML=f,d.innerHTML=f,a.appendChild(p),a.appendChild(d),null===(e=s.Canvas.getGlobalToolsEl())||void 0===e||e.appendChild(a),this.guidesEl=a,this.elGuideInfoX=p,this.elGuideInfoY=d,this.elGuideInfoContentX=null!==(n=p.querySelector(".".concat(u,"guide-info__content")))&&void 0!==n?n:void 0,this.elGuideInfoContentY=null!==(r=d.querySelector(".".concat(u,"guide-info__content")))&&void 0!==r?r:void 0,l.on("canvas:update frame:scroll",(0,o.debounce)(function(){var t;i.updateGuides(),c.debug&&(null===(t=i.guides)||void 0===t||t.forEach(function(t){return i.renderGuide(t)}))},200))}return a},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=null==n?void 0:n.parentElement;return r?((0,o.each)(r.children,function(o){return e=e.concat(n!==o?t.getElementGuides(o):[])}),e.concat(this.getElementGuides(r))):[]},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,r,i=this;(null!==(e=null!=t?t:this.guides)&&void 0!==e?e:[]).forEach(function(t){var e=t.origin,a=n===e?r:i.getElementPos(e);n=e,r=a,(0,o.each)(i.getGuidePosUpdate(t,a),function(e,n){t[n]=e}),t.originRect=a})},getGuidePosUpdate:function(t,e){var n={},o=e.top,r=e.height,i=e.left,a=e.width;switch(t.type){case"t":n.y=o;break;case"b":n.y=o+r;break;case"l":n.x=i;break;case"r":n.x=i+a;break;case"x":n.x=i+a/2;break;case"y":n.y=o+r/2}return n},renderGuide:function(t){if(!this.opts.skipGuidesRender){var e,n,o=null!==(e=t.guide)&&void 0!==e?e:document.createElement("div"),r=t.active?2:1;if(o.style.cssText="position: absolute; background-color: ".concat(t.active?"green":"red",";"),!o.children.length){var i=document.createElement("div");i.style.cssText="position: absolute; color: red; padding: 5px; top: 0; left: 0;",o.appendChild(i)}return t.y?(o.style.width="100%",o.style.height="".concat(r).concat("px"),o.style.top="".concat(t.y).concat("px"),o.style.left="0"):(o.style.width="".concat(r).concat("px"),o.style.height="100%",o.style.left="".concat(t.x).concat("px"),o.style.top="0".concat("px")),t.guide||null===(n=this.guidesContainer)||void 0===n||n.appendChild(o),o}},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,o=this.getElementPos(t),r=(0,i.getComponentModel)(t),s=(0,i.getComponentView)(t),l=o.top,c=o.height,u=o.left,p=o.width,d=[{type:"t",y:l},{type:"b",y:l+c},{type:"l",x:u},{type:"r",x:u+p},{type:"x",x:u+p/2},{type:"y",y:l+c/2}].map(function(i){var l=n.debug?e.renderGuide(i):void 0;return a(a({},i),{component:r,componentView:s,componentEl:t,origin:t,componentElRect:o,originRect:o,guideEl:l,guide:l})});return d.forEach(function(t){var n;return null===(n=e.guides)||void 0===n?void 0:n.push(t)}),d},getTranslate:function(t,e){void 0===e&&(e="x");var n=0;return(t||"").split(" ").forEach(function(t){var o=t.trim(),r="translate".concat(e.toUpperCase(),"(");0===o.indexOf(r)&&(n=parseFloat(o.replace(r,"")))}),n},setTranslate:function(t,e,n){var o="translate".concat(e.toUpperCase(),"("),r="".concat(o).concat(n,")"),i=(t||"").split(" ").map(function(t){return 0===t.trim().indexOf(o)&&(t=r),t}).join(" ");return 0>i.indexOf(o)&&(i+=" ".concat(r)),i},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),o=n.transform,r=n.left,i=n.top,a=0,s=0;return e&&o?(a=this.getTranslate(o),s=this.getTranslate(o,"y")):(a=parseFloat(null!=r?r:"0"),s=parseFloat(null!=i?i:"0")),{x:a,y:s}},setPosition:function(t){var e,n,r=t.x,i=t.y,a=t.end,s=t.position,l=t.width,c=t.height,u=this.target,p=this.isTran,d=this.em,f=this.opts,h=!a,g="".concat(parseInt("".concat(r),10)).concat("px"),v="".concat(parseInt("".concat(i),10)).concat("px"),y={};if(p){var m=null!==(n=null===(e=u.getStyle())||void 0===e?void 0:e.transform)&&void 0!==n?n:"";m=this.setTranslate(m,"x",g),y={transform:m=this.setTranslate(m,"y",v),__p:h}}else{var b={position:s,width:l,height:c},w={left:g,top:v,__p:h};(0,o.keys)(b).forEach(function(t){var e=b[t];e&&(w[t]=e)}),y=w}f.addStyle?f.addStyle({component:u,styles:y,partial:!a}):u.addStyle(y,{avoidStore:!a}),d.Styles.__emitCmpStyleUpdate(y,{components:d.getSelected()})},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e,n=this.target,o=this.editor,r=this.isTran,i=this.opts,a=o.Canvas,s=n.getStyle(),l="absolute",c=[l,"relative"];if(null===(e=i.onStart)||void 0===e||e.call(i,this._getDragData()),!r){if(s.position!==l){var u=a.offset(n.getEl()),p=u.left,d=u.top,f=u.width,h=u.height,g=n.parent(),v=null;do{var y=null==g?void 0:g.getStyle(),m=null==y?void 0:y.position;m&&(v=c.indexOf(m)>=0?g:null),g=null==g?void 0:g.parent()}while(g&&!v);if(i.center){var b=a.getMouseRelativeCanvas(t),w=b.x,_=b.y;p=w,d=_}else if(v){var C=a.offset(v.getEl());p-=C.left,d-=C.top}this.setPosition({x:p,y:d,width:"".concat(f,"px"),height:"".concat(h,"px"),position:l})}this.guidesStatic=this.getGuidesStatic()}},onDrag:function(t){var e,n,o=this,r=this.guidesTarget,i=this.opts;this.updateGuides(r),i.debug&&(null==r||r.forEach(function(t){return o.renderGuide(t)})),i.guidesInfo&&this.renderGuideInfo(null!==(e=null==r?void 0:r.filter(function(t){return t.active}))&&void 0!==e?e:[]),null===(n=i.onDrag)||void 0===n||n.call(i,this._getDragData()),this.opts.event=t,this.em.trigger("".concat(s,":move"),this.getEventOpts())},onEnd:function(t,e,n){var o,r=this.editor,i=this.opts,l=this.id;null===(o=i.onEnd)||void 0===o||o.call(i,t,n,a(a({event:t},n),this._getDragData())),r.stopCommand("".concat(l)),this.hideGuidesInfo(),this.em.trigger("".concat(s,":end"),this.getEventOpts())},hideGuidesInfo:function(){var t=this;["X","Y"].forEach(function(e){var n=t["elGuideInfo".concat(e)];n&&(n.style.display="none")})},renderGuideInfo:function(t){var e=this;void 0===t&&(t=[]),this.hideGuidesInfo(),this.getGuidesMatched(t).forEach(function(t){e.opts.skipGuidesRender||e.renderSingleGuideInfo(t),e.em.trigger("".concat(s,":active"),a(a({},e.getEventOpts()),t))})},renderSingleGuideInfo:function(t){var e=t.posFirst,n=t.posSecond,r=t.size,i=t.sizeRaw,a=t.guide,s=t.elGuideInfo,l=t.elGuideInfoCnt,c="y"==((0,o.isUndefined)(a.x)?"y":"x"),u=s.style;u.display="",u[c?"top":"left"]="".concat(e,"px"),u[c?"left":"top"]="".concat(n,"px"),u[c?"width":"height"]="".concat(r,"px"),l.innerHTML="".concat(Math.round(i),"px")},getGuidesMatched:function(t){var e=this;void 0===t&&(t=[]);var n=this.guidesStatic,r=void 0===n?[]:n;return t.map(function(t){var n=t.origin,i=t.x,a=e.getElementPos(n),s=(0,o.isUndefined)(i)?"y":"x",l="y"===s,c=a[l?"left":"top"],u=a.rect[l?"left":"top"],p=l?c+a.width:c+a.height,d=l?u+a.rect.width:u+a.rect.height,f=r.filter(function(e){var n;return e.type===t.type||(null===(n=({l:["r","x"],r:["l","x"],x:["l","r"],t:["b","y"],b:["t","y"],y:["t","b"]})[t.type])||void 0===n?void 0:n.includes(e.type))}).map(function(t){var e=t.originRect,n=e.left,o=e.width,r=e.top,i=e.height,a=l?n+o:r+i;return{gap:a<c?c-a:(l?n:r)-p,guide:t}}).filter(function(t){return t.gap>0}).sort(function(t,e){return t.gap-e.gap}).map(function(t){return t.guide}).filter(function(e){switch(t.type){case"l":case"r":case"x":return 1>Math.abs(e.x-t.x);case"t":case"b":case"y":return 1>Math.abs(e.y-t.y);default:return!1}})[0];if(!f)return null;var h=f.originRect,g=h.left,v=h.width,y=h.top,m=h.height,b=h.rect,w=l?g<a.left:y<a.top,_=l?b.left:b.top,C=l?g+v:y+m,x=l?b.left+b.width:b.top+b.height,S=l?t.y:t.x;return{guide:t,guidesStatic:r,matched:f,posFirst:S,posSecond:w?C:p,size:w?c-C:(l?g:y)-p,sizeRaw:w?u-x:_-d,elGuideInfo:e["elGuideInfo".concat(s.toUpperCase())],elGuideInfoCnt:e["elGuideInfoContent".concat(s.toUpperCase())]}}).filter(Boolean)},toggleDrag:function(t){var e=this.ppfx,n=this.editor,o=t?"add":"remove",r=n.Canvas,i=r.getBody();["".concat(e,"is__grabbing")].forEach(function(t){return i.classList[o](t)}),r[t?"startAutoscroll":"stopAutoscroll"]()},editor:void 0,em:void 0,opts:void 0,target:void 0}},6134:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});let o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach(function(t){var n=t.components(),o=n&&n.filter(function(t){return t.get("selectable")})[0];o&&e.push(o)}),e.length&&t.select(e)}}}},914:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});let o={run:function(t,e,n){if(void 0===n&&(n={}),t.Canvas.hasFocus()||n.force){var o=[];t.getSelectedAll().forEach(function(t){for(var e=t.parent();e&&!e.get("selectable");)e=e.parent();e&&o.push(e)}),o.length&&t.select(o)}}}},5547:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});let o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach(function(t){var n,o=t.parent();if(o){var r=o.components().length,i=0,a=0;do i++,n=(a=t.index()+i)<=r?o.getChildAt(a):null;while(n&&!n.get("selectable"));e.push(n||t)}}),e.length&&t.select(e)}}}},8655:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});let o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach(function(t){var n,o=t.parent();if(o){var r=0,i=0;do r++,n=(i=t.index()-r)>=0?o.getChildAt(i):null;while(n&&!n.get("selectable"));e.push(n||t)}}),e.length&&t.select(e)}}}},7640:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=n(5706);let r={run:function(t,e,n){void 0===n&&(n={});var r=n.target,i=[];if(!r.get("styles"))return i;var a=r.get("type"),s=t.Pages.getAllWrappers();if(!(0,o.flatten)(s.map(function(t){return t.findType(a)})).length){var l=t.CssComposer.getAll();i=l.filter(function(t){return t.get("group")==="cmp:".concat(a)}),l.remove(i)}return i}}},5837:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};let r={run:function(t){var e=t.getModel(),n=o([],t.getSelectedAll(),!0).map(function(t){var e,n;return(null===(n=null===(e=t.delegate)||void 0===e?void 0:e.copy)||void 0===n?void 0:n.call(e,t))||t}).filter(Boolean);n.length&&e.set("clipboard",n)}}},6477:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=n(6294);let r={run:function(t,e,n){var r=this;void 0===n&&(n={}),e&&e.set&&e.set("active",0);var i=t.getConfig(),a=t.Modal,s=i.stylePrefix;if(this.cm=t.CodeManager||null,!this.editors){var l=this.buildEditor("htmlmixed","hopscotch","HTML"),c=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=l.model,this.cssEditor=c.model;var u=(0,o.a_)("div",{class:"".concat(s,"export-dl")});u.appendChild(l.el),u.appendChild(c.el),this.editors=u}a.open({title:i.textViewCode,content:this.editors}).getModel().once("change:open",function(){return t.stopCommand("".concat(r.id))}),this.htmlEditor.setContent(t.getHtml(n.optsHtml)),this.cssEditor.setContent(t.getCss(n.optsCss))},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var o=this.em.CodeManager,r=o.createViewer({label:n,codeName:t,theme:e}),i=new o.EditorView({model:r,config:o.getConfig()}).render().el;return{model:r,el:i}}}},1772:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=n(5706);let r={isEnabled:function(){var t=document;return!!t.fullscreenElement||!!t.webkitFullscreenElement||!!t.mozFullScreenElement},enable:function(t){var e="";return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e="webkit",t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e="moz",t.mozRequestFullScreen()):t.msRequestFullscreen&&t.msRequestFullscreen(),e},disable:function(){var t=document;this.isEnabled()&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},fsChanged:function(t){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(t||"","fullscreenchange"),this.fsChanged))},run:function(t,e,n){void 0===n&&(n={}),this.sender=e;var r=n.target,i=(0,o.isElement)(r)?r:document.querySelector(r),a=this.enable(i||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+"fullscreenchange",this.fsChanged)},stop:function(t,e){e&&e.set&&e.set("active",!1),this.disable()}}},741:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var o=n(5706),r=n(7774),i=n(6294),a=n(9317),s=n(1406);let l=(0,o.extend)({},s.default,a.default,{init:function(t){a.default.init.apply(this,arguments),(0,o.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=t,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a.default.enable.apply(this,t),this.getBadgeEl().addClass(this.badgeClass),this.getHighlighterEl().addClass(this.hoverClass);var n=this.$wrapper;n.css("cursor","move"),n.on("mousedown",this.initSorter),n.addClass(this.noSelClass)},toggleClipboard:function(){},initSorter:function(t){var e=(0,r.default)(t.target).data("model").get("draggable");e&&(this.cacheEl=null,this.startSelectPosition(t.target,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.eventHandlers.legacyOnEndMove=this.onEndMove.bind(this),this.stopSelectComponent(),this.$wrapper.off("mousedown",this.initSorter),(0,i.on)(this.getContentWindow(),"keydown",this.rollback))},initSorterFromModel:function(t){var e=t.get("draggable");if(e){this.cacheEl=null;var n=t.view.el;this.startSelectPosition(n,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.eventHandlers.legacyOnEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)}},initSorterFromModels:function(t){this.cacheEl=null;var e=t[t.length-1],n=this.em.getCurrentFrame(),o=e.getEl(null==n?void 0:n.model).ownerDocument,r=t.map(function(t){var e;return null===(e=null==t?void 0:t.view)||void 0===e?void 0:e.el});this.startSelectPosition(r,o,{onStart:this.onStart}),this.sorter.eventHandlers.legacyOnMoveClb=this.onDrag,this.sorter.eventHandlers.legacyOnEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)},onEndMoveFromModel:function(){(0,i.AU)(this.getContentWindow(),"keydown",this.rollback)},onEndMove:function(){this.enable(),(0,i.AU)(this.getContentWindow(),"keydown",this.rollback)},onSelect:function(t,e){},rollback:function(t,e){(27==(t.which||t.keyCode)||e)&&this.sorter.cancelDrag()},getBadgeEl:function(){return this.$badge||(this.$badge=(0,r.default)(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=(0,r.default)(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a.default.stop.apply(this,t),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass),this.$wrapper.css("cursor","").unbind().removeClass(this.noSelClass)}})},2924:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var o=n(5706),r=n(6294);let i={open:function(t){var e=this,n=this.editor,r=this.title,i=this.config,a=this.am,s=i.custom;if((0,o.isFunction)(s.open))return s.open(a.__customData());n.Modal.open({title:r,content:t}).onceClose(function(){return n.stopCommand(e.id)})},close:function(){var t=this.config.custom;if((0,o.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e,n){void 0===n&&(n={});var o=t.AssetManager,i=o.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t("assetManager.modalTitle")||"",this.editor=t,this.config=i,this.am=o,o.setTarget(n.target),o.onClick(n.onClick),o.onDblClick(n.onDblClick),o.onSelect(n.onSelect),o.__behaviour({select:c,types:s,options:n}),i.custom)this.rendered=this.rendered||(0,r.a_)("div"),this.rendered.className="".concat(i.stylePrefix,"custom-wrp"),o.__behaviour({container:this.rendered}),o.__trgCustom();else{if(!this.rendered||s){var u=o.getAll().filter(function(t){return t});s&&s.length&&(u=u.filter(function(t){return -1!==s.indexOf(t.get("type"))})),o.render(u),this.rendered=o.getContainer()}if(l){var p=this.rendered.querySelector("input#".concat(i.stylePrefix,"uploadFile"));p&&p.setAttribute("accept",l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},3963:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var o=n(5706),r=n(6294);let i={open:function(){var t=this.container,e=this.editor,n=this.bm,r=this.config,i=r.custom,a=r.appendTo;if((0,o.isFunction)(i.open))return i.open(n.__customData());if(this.firstRender&&!a){var s="views-container",l=e.Panels;(l.getPanel(s)||l.addPanel({id:s})).set("appendContent",t).trigger("change:appendContent"),i||t.appendChild(n.render())}t&&(t.style.display="block")},close:function(){var t=this.container,e=this.config.custom;if((0,o.isFunction)(e.close))return e.close(this.bm.__customData());t&&(t.style.display="none")},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,r.a_)("div"),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},1479:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});let o={run:function(t){var e=t.LayerManager,n=t.Panels,o=e.getConfig();if(!o.appendTo){if(!this.layers){var r="views-container",i=document.createElement("div"),a=n.getPanel(r)||n.addPanel({id:r});o.custom?e.__trgCustom({container:i}):i.appendChild(e.render()),a.set("appendContent",i).trigger("change:appendContent"),this.layers=i}this.layers.style.display="block"}},stop:function(){var t=this.layers;t&&(t.style.display="none")}}},3473:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=n(7774);let r={run:function(t,e){if(this.sender=e,!this.$cnt){var n=t.getConfig(),r=t.Panels,i=t.DeviceManager,a=t.SelectorManager,s=t.StyleManager,l="change:appendContent",c=(0,o.default)("<div></div>"),u=(0,o.default)("<div></div>"),p=(0,o.default)("<div></div>"),d=(0,o.default)("<div></div>");if(this.$cnt=c,this.$cntInner=u,u.append(p),u.append(d),c.append(u),i&&n.showDevices){var f=r.addPanel({id:"devices-c"}),h=i.render();f.set("appendContent",h).trigger(l)}var g=a.getConfig();g.custom?a.__trgCustom({container:p.get(0)}):g.appendTo||p.append(a.render([])),this.sm=s;var v=s.getConfig(),y=v.stylePrefix;this.$header=(0,o.default)('<div class="'.concat(y,'header">').concat(t.t("styleManager.empty"),"</div>")),c.append(this.$header),v.custom?s.__trgCustom({container:d.get(0)}):v.appendTo||d.append(s.render());var m="views-container";(r.getPanel(m)||r.addPanel({id:m})).set("appendContent",c).trigger(l);var b=t.getModel();this.listenTo(b,s.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this.sender,e=this.sm,n=this.$cntInner,o=this.$header;(!t||!t.get||t.get("active"))&&e&&(e.getSelected()?(null==n||n.show(),null==o||o.hide()):(null==n||n.hide(),null==o||o.show()))},stop:function(){var t,e;null===(t=this.$cntInner)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},5054:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=n(7774);let r={run:function(t,e){this.sender=e;var n,r=t.getModel(),i=t.Config.stylePrefix,a=t.TraitManager,s=a.getConfig();if(!s.appendTo){if(!this.$cn){this.$cn=(0,o.default)("<div></div>"),this.$cn2=(0,o.default)("<div></div>"),this.$cn.append(this.$cn2),this.$header=(0,o.default)("<div>").append('<div class="'.concat(s.stylePrefix,'header">').concat(r.t("traitManager.empty"),"</div>")),this.$cn.append(this.$header),s.custom?a.__trgCustom({container:this.$cn2.get(0)}):(this.$cn2.append('<div class="'.concat(i,'traits-label">').concat(r.t("traitManager.label"),"</div>")),this.$cn2.append(a.render()));var l=t.Panels;null==(n=l.getPanel("views-container")?l.getPanel("views-container"):l.addPanel({id:"views-container"}))||n.set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=t.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()}},toggleTm:function(){var t=this.sender;(!t||!t.get||t.get("active"))&&(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},6979:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=n(5706);let r={run:function(t,e,n){void 0===n&&(n={});var r=t.getModel(),a=r.get("clipboard"),s=t.getSelected();(null==a?void 0:a.length)&&s&&(t.getSelectedAll().forEach(function(e){var s,l,c,u,p=(null===(l=null===(s=e.delegate)||void 0===s?void 0:s.copy)||void 0===l?void 0:l.call(s,e))||e,d=p.collection;if(d){var f={at:p.index()+1,action:n.action||"paste-component"};u=(0,o.contains)(a,p)&&p.get("copyable")?d.add(p.clone(),f):i(t,a,p.parent(),f)}else{var h=null===(c=r.Pages.getSelected())||void 0===c?void 0:c.getMainComponent(),f={at:(null==h?void 0:h.components().length)||0,action:n.action||"paste-component"};u=i(t,a,h,f)}(u=(0,o.isArray)(u)?u:[u]).forEach(function(e){return t.trigger("component:paste",e)})}),s.emitUpdate())}};function i(t,e,n,o){var r=e.filter(function(t){return t.get("copyable")}).filter(function(e){return t.Components.canMove(n,e).result});return n.components().add(r.map(function(t){return t.clone()}),o)}},4457:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});var o=n(5706),r=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},i="core:component-outline";let a={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanels()),this.panels},preventDrag:function(t){t.abort=1},tglEffects:function(t){var e=this.em;if(e){var n=e.Canvas,r=n.getBody(),i=n.getToolbarEl();i&&(i.style.display=t?"none":"");var a=r.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,o.each)(a,function(e){return e.style.pointerEvents=t?"all":""}),e[t?"on":"off"]("run:tlb-move:before",this.preventDrag)}},run:function(t,e){var n=this;this.sender=e,this.selected=r([],t.getSelectedAll(),!0),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(i)),this.shouldRunSwVisibility&&t.stopCommand(i),t.getModel().stopDefault();var o=this.getPanels(t),a=t.Canvas.getElement(),s=t.getEl(),l=t.Config.stylePrefix;if(!this.helper){var c=document.createElement("span");c.className="".concat(l,"off-prv fa fa-eye-slash"),s.appendChild(c),c.onclick=function(){return n.stopCommand()},this.helper=c}this.helper.style.display="inline-block",o.forEach(function(t){return t.set("visible",!1)});var u=a.style;u.width="100%",u.height="100%",u.top="0",u.left="0",u.padding="0",u.margin="0",t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,o=this.selected;n.set&&n.set("active",0);var r=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(i),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),r.forEach(function(t){return t.set("visible",!0)}),t.Canvas.getElement().setAttribute("style",""),o&&t.select(o),delete this.selected,this.helper&&(this.helper.style.display="none"),t.refresh(),this.tglEffects()}}},5493:(t,e,n)=>{n.r(e),n.d(e,{ConvertUnitsToPx:()=>r,default:()=>c});var o,r,i=n(2225),a=n(1166),s=function(){return(s=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},l=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n};(o=r||(r={})).pt="pt",o.pc="pc",o.in="in",o.cm="cm",o.mm="mm",o.vw="vw",o.vh="vh",o.vmin="vmin",o.vmax="vmax",o.svw="svw",o.lvw="lvw",o.dvw="dvw",o.svh="svh",o.lvh="lvh",o.dvh="dvh",o.perc="%";let c={run:function(t,e,n){var o,r,c=this,u=t.Canvas,p=t.Utils,d=t.em,f=u.getCanvasView(),h=d.config.stylePrefix||"",g="".concat(h,"resizing"),v=n.onStart,y=void 0===v?function(){}:v,m=n.onMove,b=void 0===m?function(){}:m,w=n.onEnd,_=void 0===w?function(){}:w,C=n.updateTarget,x=void 0===C?function(){}:C,S=n.el,O=n.componentView,T=n.component,P=n.skipPositionUpdate,E=l(n,["onStart","onMove","onEnd","updateTarget","el","componentView","component","skipPositionUpdate"]),k=S||(null==O?void 0:O.el)||T.getEl(),A={component:T,el:k},j=function(t,e,n){var o=n.docs;o&&o.forEach(function(e){var n=e.body,o=n.className||"";n.className=("add"==t?"".concat(o," ").concat(g):o.replace(g,"")).trim()})},M=s(s({appendTo:u.getResizerEl(),prefix:t.getConfig().stylePrefix,posFetcher:f.getElementPos.bind(f),mousePosFetcher:u.getMouseRelativePos.bind(u),docs:[document],updateOnMove:!0,skipUnitAdjustments:!0,onStart:function(e,l){y(e,l);var c,u=l.el,p=l.config,f=l.resizer,h=p.keyHeight,g=p.keyWidth,v=p.currentUnit,m=p.keepAutoHeight,b=p.keepAutoWidth;j("add",e,l),o=d.Styles.getModelToStyle(T),r=getComputedStyle(u);var w=o.getStyle(),_=s({},f.startDim),C=w[g];p.autoWidth=b&&"auto"===C,isNaN(parseFloat(C))&&(C=r[g]);var x=w[h];p.autoHeight=m&&"auto"===x,isNaN(parseFloat(x))&&(x=r[h]);var S=parseFloat(C),O=parseFloat(x),P=(0,a.getUnitFromValue)(C),E=(0,a.getUnitFromValue)(x);v&&(p.unitWidth=P,p.unitHeight=E);var k=s(s({},A),{event:e,rect:_,model:o,modelWidth:{value:C,property:g,number:S,unit:P},modelHeight:{value:x,property:h,number:O,unit:E}});t.trigger(i.I.resizeStart,k),t.trigger(i.I.resize,s(s({},k),{type:"start"})),null===(c=n.afterStart)||void 0===c||c.call(n)},onMove:function(e,n){b(e,n);var o=n.resizer,r=s(s({},A),{event:e,delta:o.delta,pointer:o.currentPos,rect:o.rectDim});t.trigger(i.I.resizeStart,r),t.trigger(i.I.resize,s(s({},r),{type:"move"}))},onEnd:function(e,o){_(e,o),j("remove",e,o);var r,a=o.resizer,l=s(s({},A),{event:e,rect:a.rectDim,moved:a.moved});t.trigger(i.I.resizeEnd,l),t.trigger(i.I.resize,s(s({},A),{type:"end"})),null===(r=n.afterEnd)||void 0===r||r.call(n)},updateTarget:function(e,n,a){if(x(e,n,a),o){var l,p=a.store,f=a.selectedHandler,h=a.config,g=a.resizer,v=a.event,y=h.keyHeight,m=h.keyWidth,b=h.autoHeight,w=h.autoWidth,_=h.unitWidth,C=h.unitHeight,S=["tc","bc"].indexOf(f)>=0,O=["cl","cr"].indexOf(f)>=0,E=!p,j={};if(!S){var M=(null===(l=u.getBody())||void 0===l?void 0:l.offsetWidth)||0,D=n.w<M?n.w:M;j[m]=w?"auto":c.convertPxToUnit({el:k,elComputedStyle:r,valuePx:D,unit:_})}O||(j[y]=b?"auto":c.convertPxToUnit({el:k,elComputedStyle:r,valuePx:n.h,unit:C,isHeight:!0})),!P&&d.getDragMode(T)&&(j.top="".concat(n.t,"px"),j.left="".concat(n.l,"px"));var L=!1,I=function(t){L=!0;var e=s(s({},t||j),{__p:E});o.addStyle(e,{avoidStore:E}),d.Styles.__emitCmpStyleUpdate(e,{components:T})},N=s(s({},A),{rect:n,partial:E,event:v,style:j,updateStyle:I,convertPxToUnit:function(t){return c.convertPxToUnit(s({el:k,elComputedStyle:r},t))},delta:g.delta,pointer:g.currentPos});t.trigger(i.I.resizeUpdate,N),L||I()}}},E),n.options),D=this.canvasResizer;return D||(this.canvasResizer=new p.Resizer(M),D=this.canvasResizer),D.setOptions(M,!0),D.blur(),D.focus(k),D},stop:function(){var t;null===(t=this.canvasResizer)||void 0===t||t.blur()},convertPxToUnit:function(t){var e=t.el,n=t.valuePx,o=t.unit,i=t.dpi,a=void 0===i?96:i,s=t.roundDecimals,l=t.isHeight,c=t.elComputedStyle,u=e.ownerDocument.defaultView,p=(null==u?void 0:u.innerWidth)||1,d=window.innerHeight||1,f=n,h=o;switch(o){case r.pt:f=72/a*n;break;case r.pc:f=6/a*n;break;case r.in:f=n/a;break;case r.cm:f=n/(a/2.54);break;case r.mm:f=n/(a/25.4);break;case r.vw:f=n/p*100;break;case r.vh:f=n/d*100;break;case r.vmin:f=n/Math.min(p,d)*100;break;case r.vmax:f=n/Math.max(p,d)*100;break;case r.perc:var g=e.parentElement,v=e.offsetParent,y=(null==c?void 0:c.position)==="absolute"?v:g,m=(null==y?void 0:y.offsetWidth)||1,b=(null==y?void 0:y.offsetHeight)||1;f=n/(l?b:m)*100;break;case r.svw:case r.lvw:case r.dvw:f=n/p*100;break;case r.svh:case r.lvh:case r.dvh:f=n/d*100;break;default:h="px"}return"".concat(+f.toFixed(void 0===s?3:s)).concat(h)}}},9317:(t,e,n)=>{n.r(e),n.d(e,{default:()=>O});var o,r,i,a,s,l=n(5706),c=n(179),u=n(9156),p=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e.prototype.defaults=function(){return{command:"",attributes:{}}},e}(u.Kx),f=(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(u.pM);h.prototype.model=d;var g=n(2225),v=n(8242),y=(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(){return(m=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},b=function(t){function e(e){var n=t.call(this,e)||this;return n.em=e.config.em,n}return y(e,t),e.prototype.events=function(){return this.model.get("events")||{mousedown:"handleClick"}},e.prototype.attributes=function(){return this.model.get("attributes")},e.prototype.handleClick=function(t){t.preventDefault(),t.stopPropagation();var e=this.em,n=e.Canvas.getFrameEl().getBoundingClientRect(),o=n.left,r=n.top,i=m(m({},t),{clientX:t.clientX-o,clientY:t.clientY-r});e.trigger("toolbar:run:before",{event:i}),this.execCommand(i)},e.prototype.execCommand=function(t){var e=this.em,n=this.model,o={event:t},r=n.get("command"),i=e.Editor;(0,l.isFunction)(r)&&r(i,null,o),(0,l.isString)(r)&&i.runCommand(r,o)},e.prototype.render=function(){var t=this.em,e=this.$el,n=this.model,o=n.get("id"),r=n.get("label"),i=t.getConfig().stylePrefix;return e.addClass("".concat(i,"toolbar-item")),o&&e.addClass("".concat(i,"toolbar-item__").concat(o)),r&&e.append(r),this},e}(u.Ss),w=(a=function(t,e){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t){function e(e){var n=t.call(this,e)||this,o=e.em;return n.em=o,n.config={em:o},n.listenTo(n.collection,"reset",n.render),n}return w(e,t),e.prototype.onRender=function(){var t=this.em.config.stylePrefix;this.el.className="".concat(t,"toolbar-items")},e}(v.A);_.prototype.itemView=b;var C=n(6294),x=n(1166),S=function(){return(S=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};let O={activeResizer:!1,init:function(){this.onSelect=(0,l.debounce)(this.onSelect,0),(0,l.bindAll)(this,"onHover","onOut","onClick","onCanvasScroll","onFrameScroll","onFrameResize","onFrameUpdated","onContainerChange")},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent(),s=!0},startSelectComponent:function(){this.toggleSelectComponent(1),this.em.getSelected()&&this.onSelect()},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(t){var e=this,n=this.em,o=this.canvas.getCanvasView().el,r=n.getConfig().listenToEl,i=n.getContainer().parentNode,a=t?"on":"off",s={on:C.on,off:C.AU},l=g.I.update;!r.length&&i&&r.push(i);var c=function(t,n,o){s[a](o,"scroll",e.onCanvasScroll,!0),s[a](n,"mouseover",e.onHover),s[a](n,"mouseleave",e.onOut),s[a](n,"click",e.onClick),s[a](t,"scroll",e.onFrameScroll,!0),s[a](t,"resize",e.onFrameResize)};s[a](window,"resize",this.onFrameUpdated),s[a](r,"scroll",this.onContainerChange),n[a]("component:toggled ".concat(l," undo redo"),this.onSelect,this),n[a]("change:componentHovered",this.onHovered,this),n[a]("".concat(g.I.resize," styleable:change ").concat(g.I.input),this.updateGlobalPos,this),n[a]("".concat(l,":toolbar"),this._upToolbar,this),n[a]("frame:updated",this.onFrameUpdated,this),n[a]("canvas:updateTools",this.onFrameUpdated,this),n[a](n.Canvas.events.refresh,this.updateAttached,this),n.Canvas.getFrames().forEach(function(t){var e=t.view,n=null==e?void 0:e.getWindow();n&&c(n,null==e?void 0:e.getBody(),o)})},onHover:function(t){t.stopPropagation();var e=this.em,n=t.target,o=(0,x.getComponentView)(n),r=null==o?void 0:o.frameView,i=null==o?void 0:o.model;if(!i)for(var a=n.parentNode;!i&&a&&!(0,C.ZQ)(a);)i=(0,x.getComponentModel)(a),a=a.parentNode;this.currentDoc=n.ownerDocument,e.setHovered(i,{useValid:!0}),r&&e.setCurrentFrame(r)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(t,e){var n,o=this,r={};e?null===(n=e.views)||void 0===n||n.forEach(function(t){var n=t.el,i=o.getElementPos(n);r={el:n,pos:i,component:e,view:t},n.ownerDocument===o.currentDoc&&(o.elHovered=r),o.updateToolsLocal(r)}):(this.currentDoc=null,this.elHovered=0,this.updateToolsLocal(),this.canvas.getFrames().forEach(function(t){var e=t.view,n=e&&e.getToolsEl();n&&o.toggleToolsEl(0,0,{el:n})}))},onSelect:function(){var t=this.em,e=t.getSelected(),n=t.getCurrentFrame(),o=e&&e.getView(null==n?void 0:n.model),r=null==o?void 0:o.el,i={};if(r&&(0,C.zN)(r)){var a=this.getElementPos(r);i={el:r,pos:a,component:e,view:o}}this.elSelected=i,this.updateToolsGlobal(),this.updateLocalPos(i),this.initResize(e)},updateGlobalPos:function(){var t=this.getElSelected();t.el&&(t.pos=this.getElementPos(t.el),this.updateToolsGlobal())},updateLocalPos:function(t){var e=this.getElHovered();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsLocal(t))},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){this.em.setHovered()},toggleToolsEl:function(t,e,n){void 0===n&&(n={});var o=n.el||this.canvas.getToolsEl(e);return o&&(o.style.display=t?"":"none"),o||{}},showElementOffset:function(t,e,n){void 0===n&&(n={}),s&&this.editor.runCommand("show-offset",{el:t,elPos:e,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(t){this.editor.stopCommand("show-offset",{view:t})},showFixedElementOffset:function(t,e){this.editor.runCommand("show-offset",{el:t,elPos:e,state:"Fixed"})},hideFixedElementOffset:function(){this.editor&&this.editor.stopCommand("show-offset",{state:"Fixed"})},hideHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=0},onClick:function(t){t.stopPropagation(),t.preventDefault();var e=this.em;if(e.get("_cmpDrag"))return e.set("_cmpDrag");var n=t.target,o=(0,x.getComponentModel)(n);if(!o)for(var r=n.parentNode;!o&&r&&!(0,C.ZQ)(r);)o=(0,x.getComponentModel)(r),r=r.parentNode;if(o){if(e.isEditing()&&(!o.get("textable")&&o.isChildOf("text")||e.getEditing()!==o))return;this.select(o,t)}},select:function(t,e){if(t){var n=this.em;n.setSelected(t,{event:e,useValid:!0}),this.initResize(n.getSelected())}},updateBadge:function(t,e,n){void 0===n&&(n={});var o=this.canvas,r=(0,x.getComponentModel)(t),i=this.getBadge(n),a=i.style;if(!r||!r.get("badgable")){a.display="none";return}if(!n.posOnly){var s=this.canvas.getConfig(),l=r.getIcon(),c=s.pStylePrefix||"",u="".concat(c,"badge"),p=s.customBadgeLabel,d="".concat(l?'<div class="'.concat(u,'__icon">').concat(l,"</div>"):"",'\n <div class="').concat(u,'__name">').concat(r.getName(),"</div>");i.innerHTML=p?p(r):d}a.display="block";var f=o.getTargetToElementFixed(t,i,{pos:e}).top,h=n.leftOff<0?-n.leftOff:0;a.top=f+"px",a.left=h+"px"},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=""},initResize:function(t){var e,n=this,o=this.em,r=this.canvas,i=o.Editor,a=!(0,l.isElement)(t)&&(0,C.GW)(t)?t:o.getSelected(),u=null===(e=null==a?void 0:a.get)||void 0===e?void 0:e.call(a,"resizable"),p=c.F.Resize,d=r.hasCustomSpot(p);r.removeSpots({type:p});var f={component:a,hasCustomResize:d,resizable:u};a&&o.trigger(g.I.resizeInit,f);var h=f.resizable;if(a&&h){r.addSpot({type:p,component:a});var v=(0,l.isElement)(t)?t:a.getEl(),y=(0,x.isObject)(h)?h:{};if(d||!v||this.activeResizer)return;this.resizer=i.runCommand("resize",S(S({},y),{el:v,component:a,force:!0,afterStart:function(){s=!1,n.activeResizer=!0},afterEnd:function(){s=!0,n.activeResizer=!1}}))}else{if(d)return;i.stopCommand("resize"),this.resizer=null}},updateToolbar:function(t){var e=this.canvas,n=this.config.em,o=t===n?n.getSelected():t,r=e.getToolbarEl(),i=r.style,a=o.get("toolbar"),s=n.config.showToolbar,l=!e.hasCustomSpot(c.F.Select);if(o&&s&&a&&a.length&&l){if(i.display="",!this.toolbar){r.innerHTML="",this.toolbar=new h(a);var u=new _({collection:this.toolbar,em:n});r.appendChild(u.render().el)}this.toolbar.reset(a),i.top="-100px",i.left="0"}else i.display="none"},updateToolbarPos:function(t){var e=this.canvas.getToolbarEl().style;e.top="".concat(t.top).concat("px"),e.left="".concat(t.left).concat("px"),e.opacity=""},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(t){return void 0===t&&(t={}),this.canvas.getBadgeEl(t.view)},onCanvasScroll:function(t){this.onFrameScroll(t),this.onContainerChange()},onFrameScroll:function(){this.updateTools(),this.canvas.refreshSpots()},onFrameResize:function(){this.canvas.refresh({all:!0})},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(t){return t&&"selected"===t.get("status")},updateToolsLocal:function(t){var e=this.em.getConfig(),n=t||this.getElHovered(),o=n.el,r=n.pos,i=n.view,a=n.component;if(!o){this.lastHovered=0;return}var s=a.get("hoverable"),l=this.lastHovered!==o,u=this.canvas.hasCustomSpot(c.F.Hover);l&&s&&(this.lastHovered=o,u?this.hideHighlighter(i):this.showHighlighter(i),this.showElementOffset(o,r,{view:i})),this.isCompSelected(a)&&(this.hideHighlighter(i),e.showOffsetsSelected||this.hideElementOffset(i));var p=this.toggleToolsEl(1,i),d=p.style,f=this.canvas.canvasRectOffset(o,r),h=f.top,g=f.left;u||this.updateBadge(o,r,S(S({},l?{}:{posOnly:1}),{view:i,topOff:h,leftOff:g})),d.top=h+"px",d.left=g+"px",d.width=r.width+"px",d.height=r.height+"px",this._trgToolUp("local",{component:a,el:p,top:h,left:g,width:r.width,height:r.height})},_upToolbar:(0,l.debounce)(function(){this.updateToolsGlobal({force:1})},0),_trgToolUp:function(t,e){void 0===e&&(e={}),this.em.trigger("canvas:tools:update",S({type:t},e))},updateToolsGlobal:function(t){void 0===t&&(t={});var e=this.getElSelected(),n=e.el,o=e.pos,r=e.component;if(!n){this.toggleToolsEl(),this.lastSelected=0;return}var i=this.canvas;(this.lastSelected!==n||t.force)&&(this.lastSelected=n,this.updateToolbar(r));var a=this.toggleToolsEl(1),s=a.style,l=i.getTargetToElementFixed(n,i.getToolbarEl(),{pos:o}),c=l.canvasOffsetTop,u=l.canvasOffsetLeft;s.top=c+"px",s.left=u+"px",s.width=o.width+"px",s.height=o.height+"px",this.updateToolbarPos({top:l.top,left:l.left}),this._trgToolUp("global",{component:r,el:a,top:c,left:u,width:o.width,height:o.height})},updateAttached:(0,l.debounce)(function(){this.updateGlobalPos()},0),onContainerChange:(0,l.debounce)(function(){this.em.refreshCanvas()},150),getElementPos:function(t){return this.canvas.getCanvasView().getElementPos(t,{noScroll:!0})},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(t){t&&t.set({status:"",state:""})},getContentWindow:function(){return this.canvas.getWindow()},run:function(t){(0,x.hasWin)()&&(this.editor=t&&t.get("Editor"),this.enable())},stop:function(t,e,n){if(void 0===n&&(n={}),(0,x.hasWin)()){var o=this.em,r=this.editor;this.onHovered(),this.stopSelectComponent(),n.preserveSelected||o.setSelected(),this.toggleToolsEl(),this.updateAttached.cancel(),r&&r.stopCommand("resize")}}}},1406:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});var o=n(7774),r=n(1447),i=n(8433);let a={startSelectPosition:function(t,e,n){void 0===n&&(n={}),this.isPointed=!1;var o=this.em.Utils,a=t[0].ownerDocument.body;o&&(this.sorter=new o.ComponentSorter({em:this.em,treeClass:r.A,containerContext:{container:a,containerSel:"*",itemSel:"*",pfx:this.ppfx,document:e,placeholderElement:this.canvas.getPlacerEl()},positionOptions:{windowMargin:1,canvasRelative:!0},dragBehavior:{dragDirection:i.A.BothDirections,nested:!0}})),n.onStart&&(this.sorter.eventHandlers.legacyOnStartSort=n.onStart),t&&t.length>0&&this.sorter.startSort(t.map(function(t){return{element:t}}))},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex="after"==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&this.sorter.cancelDrag(),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&"after"==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?(0,o.default)(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,o.default)(this.cDim[this.posIndex][5]).parent():(0,o.default)(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var o=t||0,r=n.length,i=0!==r&&"after"==(e||"before")&&o==r;return 0===r||(i||n[o][4])&&(!n[o-1]||n[o-1][4])&&(!i||n[o-1][4])?0:1},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},9395:(t,e,n)=>{n.r(e),n.d(e,{default:()=>s});var o=n(5706),r=n(179),i=n(7774),a=function(){return(a=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};let s={getOffsetMethod:function(t){return"get"+(t||"")+"OffsetViewerEl"},run:function(t,e,n){var s=this.canvas,l=n||{},c=l.state||"",u=t.getConfig(),p=this.em.getZoomDecimal(),d=l.el;if(!u.showOffsets||!(d instanceof HTMLElement)||!u.showOffsetsSelected&&"Fixed"==c){t.stopCommand("".concat(this.id),n);return}if(!s.hasCustomSpot(r.F.Spacing)){var f=a({},l.elPos||s.getElementPos(d));(0,o.isUndefined)(l.top)||(f.top=l.top),(0,o.isUndefined)(l.left)||(f.left=l.left);var h=window.getComputedStyle(d),g=this.ppfx,v=c+"State",y=s[this.getOffsetMethod(c)](n.view);y.style.opacity="";var m=this["marginT"+c],b=this["marginB"+c],w=this["marginL"+c],_=this["marginR"+c],C=this["padT"+c],x=this["padB"+c],S=this["padL"+c],O=this["padR"+c];if(y.childNodes.length&&(this[v]="1",m=y.querySelector("[data-offset-m-t]"),b=y.querySelector("[data-offset-m-b]"),w=y.querySelector("[data-offset-m-l]"),_=y.querySelector("[data-offset-m-r]"),C=y.querySelector("[data-offset-p-t]"),x=y.querySelector("[data-offset-p-b]"),S=y.querySelector("[data-offset-p-l]"),O=y.querySelector("[data-offset-p-r]")),!this[v]){var T=c.toLowerCase(),P=T+"margin-v",E=T+"padding-v",k=(0,i.default)('<div class="'.concat(g,'marginName">')).get(0),A=(0,i.default)('<div class="'.concat(g,'paddingName">')).get(0),j="".concat(g+P+"-el"," ").concat(g+P),M="".concat(g+E+"-el"," ").concat(g+E);m=(0,i.default)('<div class="'.concat(j,'-top"></div>')).get(0),b=(0,i.default)('<div class="'.concat(j,'-bottom"></div>')).get(0),w=(0,i.default)('<div class="'.concat(j,'-left"></div>')).get(0),_=(0,i.default)('<div class="'.concat(j,'-right"></div>')).get(0),C=(0,i.default)('<div class="'.concat(M,'-top"></div>')).get(0),x=(0,i.default)('<div class="'.concat(M,'-bottom"></div>')).get(0),S=(0,i.default)('<div class="'.concat(M,'-left"></div>')).get(0),O=(0,i.default)('<div class="'.concat(M,'-right"></div>')).get(0),this["marginT"+c]=m,this["marginB"+c]=b,this["marginL"+c]=w,this["marginR"+c]=_,this["padT"+c]=C,this["padB"+c]=x,this["padL"+c]=S,this["padR"+c]=O,k.appendChild(m),k.appendChild(b),k.appendChild(w),k.appendChild(_),A.appendChild(C),A.appendChild(x),A.appendChild(S),A.appendChild(O),y.appendChild(k),y.appendChild(A),this[v]="1"}var D=parseFloat(h.marginLeft.replace("px",""))*p,L=parseFloat(h.marginRight.replace("px",""))*p,I=parseFloat(h.marginTop.replace("px",""))*p,N=parseFloat(h.marginBottom.replace("px",""))*p,R=m.style,V=b.style,F=w.style,H=_.style,U=C.style,B=x.style,z=S.style,W=O.style,$=parseFloat(f.left),q=parseFloat(h.width)*p+"px";R.height=I+"px",R.width=q,R.top=f.top-I+"px",R.left=$+"px",V.height=N+"px",V.width=q,V.top=f.top+f.height+"px",V.left=$+"px";var G=f.height+I+N+"px",K=f.top-I+"px";F.height=G,F.width=D+"px",F.top=K,F.left=$-D+"px",H.height=G,H.width=L+"px",H.top=K,H.left=$+f.width+"px";var Y=parseFloat(h.paddingTop)*p;U.height=Y+"px";var J=parseFloat(h.paddingBottom)*p;B.height=J+"px";var X=f.height-J-Y+"px",Z=f.top+Y+"px";z.height=X,z.width=parseFloat(h.paddingLeft)*p+"px",z.top=Z;var Q=parseFloat(h.paddingRight)*p;W.height=X,W.width=Q+"px",W.top=Z}},stop:function(t,e,n){void 0===n&&(n={});var o=(n||{}).state||"",r=this.getOffsetMethod(o),i=n.view;this.canvas[r](i).style.opacity=0}}},7285:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var o=n(5706),r=n(1166);let i={init:function(){(0,o.bindAll)(this,"_onFramesChange")},run:function(t){this.toggleVis(t,!0)},stop:function(t){this.toggleVis(t,!1)},toggleVis:function(t,e){if(void 0===e&&(e=!0),!t.Commands.isActive("preview")){var n=t.Canvas,o=e?"on":"off";n.getModel()[o]("change:frames",this._onFramesChange),this.handleFrames(n.getFrames(),e)}},handleFrames:function(t,e){var n=this;t.forEach(function(t){var o;(null===(o=t.view)||void 0===o?void 0:o.loaded)&&n._upFrame(t,e),t.__ol||(t.on("loaded",function(){return n._upFrame(t)}),t.__ol=!0)})},_onFramesChange:function(t,e){this.handleFrames(e)},_upFrame:function(t,e){var n,o=this.ppfx,i=this.em,a=this.id,s=(0,r.isDef)(e)?e:i.Commands.isActive(a);null===(n=t.view)||void 0===n||n.getBody().classList[s?"add":"remove"]("".concat(o,"dashed"))}}},9156:(t,e,n)=>{n.d(e,{Kx:()=>p,Ss:()=>f,e2:()=>u,lK:()=>h,pM:()=>d,x2:()=>i});var o,r,i,a=n(4193),s=n.n(a),l=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(){return(c=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},u="add remove reset change",p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e}(s().Model),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e}(s().Collection),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e}(s().View);(r=i||(i={})).Screen="screen",r.World="world";var h={x:0,y:0};c(c({},h),{width:0,height:0})},2225:(t,e,n)=>{var o,r,i,a;n.d(e,{I:()=>r,t:()=>o}),(i=o||(o={})).remove="component:remove",i.add="component:add",i.move="component:move",(a=r||(r={})).add="component:add",a.remove="component:remove",a.removeBefore="component:remove:before",a.removed="component:removed",a.create="component:create",a.update="component:update",a.updateInside="component:update-inside",a.styleUpdate="component:styleUpdate",a.styleUpdateProperty="component:styleUpdate:",a.select="component:select",a.selectBefore="component:select:before",a.mount="component:mount",a.scriptMount="component:script:mount",a.scriptMountBefore="component:script:mount:before",a.scriptUnmount="component:script:unmount",a.render="component:render",a.input="component:input",a.resize="component:resize",a.resizeStart="component:resize:start",a.resizeMove="component:resize:move",a.resizeEnd="component:resize:end",a.resizeUpdate="component:resize:update",a.resizeInit="component:resize:init",a.symbolMainAdd="symbol:main:add",a.symbolMainUpdate="symbol:main:update",a.symbolMainUpdateDeep="symbol:main:update-deep",a.symbolMainRemove="symbol:main:remove",a.symbolMain="symbol:main",a.symbolInstanceAdd="symbol:instance:add",a.symbolInstanceRemove="symbol:instance:remove",a.symbolInstance="symbol:instance",a.symbol="symbol"},8242:(t,e,n)=>{n.d(e,{A:()=>l});var o,r=n(5706),i=n(9156),a=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,o){void 0===e&&(e={}),void 0===o&&(o=!1);var r=t.call(this,e)||this;return r.itemsView="",r.itemType="type",r.reuseView=!1,r.config=n||e.config||{},o&&r.listenTo(r.collection,"add",r.addTo),r.items=[],r}return a(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){var e=this.config,n=this.ns,o=e.em,r="".concat(n?"[".concat(n,"]: "):"","'").concat(t,"' type not found");o&&o.logWarning(r)},e.prototype.add=function(t,e){var n,o=this.config,i=this.reuseView,a=this.items,s=this.itemsView||{},l=e||null,c=this.itemView,u=t.get(this.itemType);s[u]?c=s[u]:!u||s[u]||(0,r.includes)(["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"],u)||this.itemViewNotFound(u),n=t.view&&i?t.view:new c({model:t,config:o},o),a&&a.push(n);var p=n.render().el;l?l.appendChild(p):this.$el.append(p)},e.prototype.render=function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each(function(e){this.add(e,t)},this),this.$el.append(t),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(e){void 0===e&&(e={});var n=this.items;return this.onRemoveBefore(n,e),this.clearItems(),t.prototype.remove.call(this),this.onRemove(n,e),this},e.prototype.clearItems=function(){this.items},e}(i.Ss);let l=s;s.prototype.itemView=""},9966:(t,e,n)=>{n.d(e,{A:()=>l});var o=n(5706),r=n(6294),i=function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},a=function(){return{x:0,y:0}},s=["x","y"];let l=function(){function t(t){return void 0===t&&(t={}),this.opts={snapGuides:{x:5,y:5},snapOffset:5,scale:1},(0,o.bindAll)(this,"drag","stop","keyHandle","handleScroll"),this.setOptions(t),this.delta=a(),this.lastScroll=a(),this.lastScrollDiff=a(),this.startPointer=a(),this.startPosition=a(),this.globScrollDiff=a(),this.currentPointer=a(),this.position=a(),this.guidesStatic=[],this.guidesTarget=[],this.docs=[],this}return t.prototype.setOptions=function(t){void 0===t&&(t={}),this.opts=i(i({},this.opts),t)},t.prototype.toggleDrag=function(t){var e=this.getDocumentEl(),n=this.getContainerEl(),o=this.getWindowEl(),i=t?"on":"off",a={on:r.on,off:r.AU};a[i](n,"mousemove dragover",this.drag),a[i](e,"mouseup dragend touchend",this.stop),a[i](e,"keydown",this.keyHandle),a[i](o,"scroll",this.handleScroll)},t.prototype.handleScroll=function(){var t=this.lastScroll,e=this.delta,n=this.getScrollInfo(),o={x:n.x-t.x,y:n.y-t.y};this.move(e.x+o.x,e.y+o.y),this.lastScrollDiff=o},t.prototype.start=function(t){var e=this.opts,n=e.onStart;this.toggleDrag(!0),this.startPointer=this.getPointerPos(t),this.guidesStatic=(0,o.result)(e,"guidesStatic")||[],this.guidesTarget=(0,o.result)(e,"guidesTarget")||[],(0,o.isFunction)(n)&&n(t,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff=a(),this.globScrollDiff=a(),this.drag(t)},t.prototype.drag=function(t){var e=this,n=this.opts,r=this.lastScrollDiff,l=this.globScrollDiff,c=n.onDrag,u=this.startPointer,p=this.getPointerPos(t),d={x:l.x+r.x,y:l.y+r.y};this.globScrollDiff=d;var f={x:p.x-u.x+d.x,y:p.y-u.y+d.y};this.lastScrollDiff=a();var h=function(r){s.forEach(function(t){return r[t]=r[t]*(0,o.result)(n,"scale")}),e.delta=r,e.move(r.x,r.y),(0,o.isFunction)(c)&&c(t,e)},g=i({},f);if(this.currentPointer=p,this.lastScroll=this.getScrollInfo(),h(f),this.guidesTarget.length){var v=this.snapGuides(g),y=v.newDelta,m=v.trgX,b=v.trgY;(m||b)&&h(y)}0===t.which&&this.stop(t)},t.prototype.snapGuides=function(t){var e=this,n=i({},t),r=this.trgX,a=this.trgY;return this.guidesTarget.forEach(function(n){n.x&&e.trgX||n.y&&e.trgY||(n.active=!1,e.guidesStatic.forEach(function(i){if((!n.y||!i.x)&&(!n.x||!i.y)){var s=n.y&&i.y,l=s?"y":"x",c=n[l],u=i[l],p=t[l],d=s?a:r;e.isPointIn(c,u,{axis:l})&&(0,o.isUndefined)(d)&&e.setGuideLock(n,p-(c-u))}}))}),r=this.trgX,a=this.trgY,s.forEach(function(r){var i=r.toUpperCase(),a=e["trg".concat(i)];a&&!e.isPointIn(t[r],a.lock,{axis:r})&&(e.setGuideLock(a,null),a=null),a&&!(0,o.isUndefined)(a.lock)&&(n[r]=a.lock)}),{newDelta:n,trgX:this.trgX,trgY:this.trgY}},t.prototype.isPointIn=function(t,e,n){var o,r=void 0===n?{}:n,i=r.offset,a=r.axis,s=this.opts,l=s.snapGuides,c=void 0===l?{}:l,u=s.snapOffset,p="x"===a?c.x:"y"===a?c.y:void 0,d=0===p?0:null!==(o=null!=i?i:p)&&void 0!==o?o:void 0===u?0:u;return 0!==d&&(t>=e&&t<=e+d||t<=e&&t>=e-d)},t.prototype.setGuideLock=function(t,e){var n=(0,o.isUndefined)(t.x)?"Y":"X",r="trg".concat(n);return null!==e?(t.active=!0,t.lock=e,this[r]=t):(delete t.active,delete t.lock,delete this[r]),t},t.prototype.stop=function(t,e){void 0===e&&(e={});var n=this.delta,r=!!e.cancel,i=r?0:n.x,a=r?0:n.y;this.toggleDrag(),this.move(i,a,!0);var s=this.opts.onEnd;(0,o.isFunction)(s)&&s(t,this,{cancelled:r})},t.prototype.keyHandle=function(t){(0,r.v$)(t)&&this.stop(t,{cancel:!0})},t.prototype.move=function(t,e,n){var r=this.el,i=this.opts,a=this.startPosition;if(a){var s=i.setPosition,l=a.x+t,c=a.y+e;this.position={x:l,y:c,end:n},(0,o.isFunction)(s)&&s(this.position),r&&(r.style.left="".concat(l,"px"),r.style.top="".concat(c,"px"))}},t.prototype.getContainerEl=function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()},t.prototype.getWindowEl=function(){return this.getContainerEl().map(function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow})},t.prototype.getDocumentEl=function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs.length){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs},t.prototype.getPointerPos=function(t){var e=this.opts.getPointerPosition,n=(0,r.G2)(t);return e?e(t):{x:n.clientX,y:n.clientY}},t.prototype.getStartPosition=function(){var t=this.el,e=this.opts.getPosition,n=a();return(0,o.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n},t.prototype.getScrollInfo=function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}},t.prototype.detectAxisLock=function(t,e){var n=Math.abs(t),o=Math.abs(e);return e>=n||e<=-n?"x":t>o||t<-o?"y":void 0},t}()},7774:(t,e,n)=>{n.r(e),n.d(e,{default:()=>th});var o,r="undefined"!=typeof document?document:null,i="undefined"!=typeof window?window:null,a=Array.prototype,s=a.filter,l=a.indexOf,c=a.map,u=a.push,p=a.reverse,d=a.slice,f=a.splice,h=/^#[\w-]*$/,g=/^\.[\w-]*$/,v=/<.+>/,y=/^\w+$/;function m(t,e){return void 0===e&&(e=r),g.test(t)?e.getElementsByClassName(t.slice(1)):y.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function b(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(k(t)){if(e.__cash&&(e=e[0]),!(n=h.test(t)?e.getElementById(t.slice(1)):v.test(t)?tp(t):m(t,e)))return}else if(E(t))return this.ready(t);(n.nodeType||n===i)&&(n=[n]),this.length=n.length;for(var o=0,a=this.length;o<a;o++)this[o]=n[o]}}function w(t,e){return new b(t,e)}var _=w.fn=w.prototype=b.prototype={constructor:w,__cash:!0,length:0,splice:f};_.get=function(t){return void 0===t?d.call(this):this[t<0?t+this.length:t]},_.eq=function(t){return w(this.get(t))},_.first=function(){return this.eq(0)},_.last=function(){return this.eq(-1)},_.map=function(t){return w(c.call(this,function(e,n){return t.call(e,n,e)}))},_.slice=function(){return w(d.apply(this,arguments))};var C=/(?:^\w|[A-Z]|\b\w)/g,x=/[\s-_]+/g;function S(t){return t.replace(C,function(t,e){return t[e?"toUpperCase":"toLowerCase"]()}).replace(x,"")}function O(t,e){for(var n=0,o=t.length;n<o&&!1!==e.call(t[n],t[n],n,t);n++);}w.camelCase=S,w.each=O,_.each=function(t){return O(this,function(e,n){return t.call(e,n,e)}),this},_.removeProp=function(t){return this.each(function(e,n){delete n[t]})},w.extend=_.extend=function(t){void 0===t&&(t=this);for(var e=arguments,n=e.length,o=n<2?0:1;o<n;o++)for(var r in e[o])t[r]=e[o][r];return t};var T=1;function P(t,e){var n=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!n&&n.call(t,e)}function E(t){return"function"==typeof t}function k(t){return"string"==typeof t}function A(t){return!isNaN(parseFloat(t))&&isFinite(t)}w.guid=T,w.matches=P,w.isFunction=E,w.isString=k,w.isNumeric=A;var j=Array.isArray;function M(t){return k(t)?function(e,n){return P(n,t)}:t.__cash?function(e,n){return t.is(n)}:function(t,e,n){return e===n}}w.isArray=j,_.prop=function(t,e){if(t){if(k(t))return arguments.length<2?this[0]&&this[0][t]:this.each(function(n,o){o[t]=e});for(var n in t)this.prop(n,t[n]);return this}},_.filter=function(t){if(!t)return w();var e=E(t)?t:M(t);return w(s.call(this,function(n,o){return e.call(n,o,n,t)}))};var D=/\S+/g;function L(t){return k(t)&&t.match(D)||[]}function I(t){return t.filter(function(t,e,n){return n.indexOf(t)===e})}function N(t,e,n){if(1===t.nodeType){var o=i.getComputedStyle(t,null);return e?n?o.getPropertyValue(e):o[e]:o}}function R(t,e){return parseInt(N(t,e),10)||0}_.hasClass=function(t){var e=L(t),n=!1;return e.length&&this.each(function(t,o){return!(n=o.classList.contains(e[0]))}),n},_.removeAttr=function(t){var e=L(t);return e.length?this.each(function(t,n){O(e,function(t){n.removeAttribute(t)})}):this},_.attr=function(t,e){if(t){if(k(t)){if(arguments.length<2){if(!this[0])return;var n=this[0].getAttribute(t);return null===n?void 0:n}return null===e?this.removeAttr(t):this.each(function(n,o){o.setAttribute(t,e)})}for(var o in t)this.attr(o,t[o]);return this}},_.toggleClass=function(t,e){var n=L(t),o=void 0!==e;return n.length?this.each(function(t,r){O(n,function(t){o?e?r.classList.add(t):r.classList.remove(t):r.classList.toggle(t)})}):this},_.addClass=function(t){return this.toggleClass(t,!0)},_.removeClass=function(t){return arguments.length?this.toggleClass(t,!1):this.attr("class","")},w.unique=I,_.add=function(t,e){return w(I(this.get().concat(w(t,e).get())))};var V=/^--/;function F(t){return V.test(t)}var H={},U=r&&r.createElement("div"),B=U?U.style:{},z=["webkit","moz","ms","o"];function W(t,e){if(void 0===e&&(e=F(t)),e)return t;if(!H[t]){var n=S(t),o=""+n.charAt(0).toUpperCase()+n.slice(1);O((n+" "+z.join(o+" ")+o).split(" "),function(e){if(e in B)return H[t]=e,!1})}return H[t]}w.prefixedProp=W;var $={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function q(t,e,n){return void 0===n&&(n=F(t)),!n&&!$[t]&&A(e)?e+"px":e}_.css=function(t,e){if(k(t)){var n=F(t);return(t=W(t,n),arguments.length<2)?this[0]&&N(this[0],t,n):t?(e=q(t,e,n),this.each(function(o,r){1===r.nodeType&&(n?r.style.setProperty(t,e):r.style[t]=e)})):this}for(var o in t)this.css(o,t[o]);return this};var G="__cashData",K=/^data-(.*)/;function Y(t){return t[G]=t[G]||{}}function J(t,e){var n=Y(t);if(e){if(!(e in n)){var o=t.dataset?t.dataset[e]||t.dataset[S(e)]:w(t).attr("data-"+e);if(void 0!==o){try{o=JSON.parse(o)}catch(t){}n[e]=o}}return n[e]}return n}function X(t,e){return R(t,"border"+(e?"Left":"Top")+"Width")+R(t,"padding"+(e?"Left":"Top"))+R(t,"padding"+(e?"Right":"Bottom"))+R(t,"border"+(e?"Right":"Bottom")+"Width")}function Z(t,e){for(var n=0,o=e.length;n<o;n++)if(0>t.indexOf(e[n]))return!1;return!0}w.hasData=function(t){return G in t},_.data=function(t,e){var n=this;if(!t){if(!this[0])return;return O(this[0].attributes,function(t){var e=t.name.match(K);e&&n.data(e[1])}),J(this[0])}if(k(t))return void 0===e?this[0]&&J(this[0],t):this.each(function(n,o){Y(o)[t]=e});for(var o in t)this.data(o,t[o]);return this},_.removeData=function(t){return this.each(function(e,n){void 0===t?delete n[G]:delete Y(n)[t]})},O(["Width","Height"],function(t){_["inner"+t]=function(){if(this[0])return this[0]===i?i["inner"+t]:this[0]["client"+t]}}),O(["width","height"],function(t,e){_[t]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each(function(o,r){if(1===r.nodeType){var i=N(r,"boxSizing");r.style[t]=q(t,n+("border-box"===i?X(r,!e):0))}})):this[0]===i?this[0][S("outer-"+t)]:this[0].getBoundingClientRect()[t]-X(this[0],!e):void 0===n?void 0:this}}),O(["Width","Height"],function(t,e){_["outer"+t]=function(n){if(this[0])return this[0]===i?i["outer"+t]:this[0]["offset"+t]+(n?R(this[0],"margin"+(e?"Top":"Left"))+R(this[0],"margin"+(e?"Bottom":"Right")):0)}});var Q="__cashEvents";function tt(t){return t[Q]=t[Q]||{}}function te(t){var e=t.split(".");return[e[0],e.slice(1).sort()]}function tn(t,e,n,o){var r=tt(t);if(e){var i=r[e];if(!i)return;o&&(o.guid=o.guid||T++),r[e]=i.filter(function(r){var i=r[0],a=r[1];if(o&&a.guid!==o.guid||!Z(i,n))return!0;t.removeEventListener(e,a)})}else if(n&&n.length)for(e in r)tn(t,e,n,o);else for(e in r)!function(t,e,n){O(t[n],function(t){t[0];var o=t[1];e.removeEventListener(n,o)}),delete t[n]}(r,t,e)}_.off=function(t,e){var n=this;return void 0===t?this.each(function(t,e){return tn(e)}):O(L(t),function(t){var o=te(t),r=o[0],i=o[1];n.each(function(t,n){return tn(n,r,i,e)})}),this},_.on=function(t,e,n,o){var r=this;if(!k(t)){for(var i in t)this.on(i,e,t[i]);return this}return E(e)&&(n=e,e=!1),O(L(t),function(t){var i=te(t),a=i[0],s=i[1];r.each(function(t,r){var i,l=function t(i){if(!i.namespace||Z(s,i.namespace.split("."))){var l=r;if(e){for(var c=i.target;!P(c,e);)if(c===r||!(c=c.parentNode))return;l=c}i.namespace=i.namespace||"";var u=n.call(l,i,i.data);o&&tn(r,a,s,t),!1===u&&(i.preventDefault(),i.stopPropagation())}};l.guid=n.guid=n.guid||T++,l.guid=l.guid||T++,(i=tt(r))[a]=i[a]||[],i[a].push([s,l]),r.addEventListener(a,l)})}),this},_.one=function(t,e,n){return this.on(t,e,n,!0)},_.ready=function(t){var e=function(){return t(w)};return"loading"!==r.readyState?setTimeout(e):r.addEventListener("DOMContentLoaded",e),this},_.trigger=function(t,e){var n=t;if(k(t)){var o=te(t),i=o[0],a=o[1];(n=r.createEvent("HTMLEvents")).initEvent(i,!0,!0),n.namespace=a.join(".")}return n.data=e,this.each(function(t,e){e.dispatchEvent(n)})};var to=/select-one/i,tr=/select-multiple/i;function ti(t){var e,n=t.type;return to.test(n)?t.selectedIndex<0?null:t.options[t.selectedIndex].value:tr.test(n)?(e=[],O(t.options,function(t){!t.selected||t.disabled||t.parentNode.disabled||e.push(t.value)}),e):t.value}var ta=/%20/g,ts=/file|reset|submit|button|image/i,tl=/radio|checkbox/i;_.serialize=function(){var t="";return this.each(function(e,n){O(n.elements||[n],function(e){if(!(e.disabled||!e.name||"FIELDSET"===e.tagName||ts.test(e.type)||tl.test(e.type)&&!e.checked)){var n=ti(e);void 0!==n&&O(j(n)?n:[n],function(n){t+="&"+encodeURIComponent(e.name)+"="+encodeURIComponent(n).replace(ta,"+")})}})}),t.substr(1)},_.val=function(t){return void 0===t?this[0]&&ti(this[0]):this.each(function(e,n){var o=tr.test(n.type),r=null===t?o?[]:"":t;o&&j(r)?O(n.options,function(t){t.selected=r.indexOf(t.value)>=0}):n.value=r})},_.clone=function(){return this.map(function(t,e){return e.cloneNode(!0)})},_.detach=function(){return this.each(function(t,e){e.parentNode&&e.parentNode.removeChild(e)})};var tc=/^\s*<(\w+)[^>]*>/,tu=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function tp(t){if(!function(){if(!o){var t=r.createElement("table"),e=r.createElement("tr");o={"*":r.createElement("div"),tr:r.createElement("tbody"),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!k(t))return[];if(tu.test(t))return[r.createElement(RegExp.$1)];var e=o[tc.test(t)&&RegExp.$1]||o["*"];return e.innerHTML=t,w(e.childNodes).detach().get()}function td(t,e,n){if(void 0!==e){var o=k(e);!o&&e.length?O(e,function(e){return td(t,e,n)}):O(t,o?function(t){t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,o){var r;return r=o?e.cloneNode(!0):e,void(n?t.insertBefore(r,t.childNodes[0]):t.appendChild(r))})}}w.parseHTML=tp,_.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},_.append=function(){var t=this;return O(arguments,function(e){td(t,e)}),this},_.appendTo=function(t){return td(w(t),this),this},_.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each(function(t,n){n.innerHTML=e})},_.insertAfter=function(t){var e=this;return w(t).each(function(t,n){var o=n.parentNode;e.each(function(e,r){o.insertBefore(t?r.cloneNode(!0):r,n.nextSibling)})}),this},_.after=function(){var t=this;return O(p.apply(arguments),function(e){p.apply(w(e).slice()).insertAfter(t)}),this},_.insertBefore=function(t){var e=this;return w(t).each(function(t,n){var o=n.parentNode;e.each(function(e,r){o.insertBefore(t?r.cloneNode(!0):r,n)})}),this},_.before=function(){var t=this;return O(arguments,function(e){w(e).insertBefore(t)}),this},_.prepend=function(){var t=this;return O(arguments,function(e){td(t,e,!0)}),this},_.prependTo=function(t){return td(w(t),p.apply(this.slice()),!0),this},_.remove=function(){return this.detach().off()},_.replaceWith=function(t){var e=this;return this.each(function(n,o){var r=o.parentNode;if(r){var i=n?w(t).clone():w(t);if(!i[0])return e.remove(),!1;r.replaceChild(i[0],o),w(i[0]).after(i.slice(1))}})},_.replaceAll=function(t){return w(t).replaceWith(this),this},_.text=function(t){return void 0===t?this[0]?this[0].textContent:"":this.each(function(e,n){n.textContent=t})};var tf=r&&r.documentElement;_.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+i.pageYOffset-tf.clientTop,left:e.left+i.pageXOffset-tf.clientLeft}}},_.offsetParent=function(){return w(this[0]&&this[0].offsetParent)},_.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},_.children=function(t){var e=[];return(this.each(function(t,n){u.apply(e,n.children)}),e=w(I(e)),t)?e.filter(function(e,n){return P(n,t)}):e},_.contents=function(){var t=[];return this.each(function(e,n){u.apply(t,"IFRAME"===n.tagName?[n.contentDocument]:n.childNodes)}),w(t.length&&I(t))},_.find=function(t){for(var e=[],n=0,o=this.length;n<o;n++){var r=m(t,this[n]);r.length&&u.apply(e,r)}return w(e.length&&I(e))},_.has=function(t){var e=k(t)?function(e,n){return!!m(t,n).length}:function(e,n){return n.contains(t)};return this.filter(e)},_.is=function(t){if(!t||!this[0])return!1;var e=M(t),n=!1;return this.each(function(o,r){return!(n=e(o,r,t))}),n},_.next=function(){return w(this[0]&&this[0].nextElementSibling)},_.not=function(t){if(!t||!this[0])return this;var e=M(t);return this.filter(function(n,o){return!e(n,o,t)})},_.parent=function(){var t=[];return this.each(function(e,n){n&&n.parentNode&&t.push(n.parentNode)}),w(I(t))},_.index=function(t){var e=t?w(t)[0]:this[0],n=t?this:w(e).parent().children();return l.call(n,e)},_.closest=function(t){return t&&this[0]?this.is(t)?this.filter(t):this.parent().closest(t):w()},_.parents=function(t){var e,n=[];return this.each(function(o,i){for(e=i;e&&e.parentNode&&e!==r.body.parentNode;)e=e.parentNode,(!t||t&&P(e,t))&&n.push(e)}),w(I(n))},_.prev=function(){return w(this[0]&&this[0].previousElementSibling)},_.siblings=function(){var t=this[0];return this.parent().children().filter(function(e,n){return n!==t})};let th=w},6294:(t,e,n)=>{n.d(e,{AU:()=>M,BC:()=>h,C8:()=>_,Ch:()=>S,Ci:()=>P,D8:()=>i,G2:()=>O,GW:()=>w,GZ:()=>v,I6:()=>c,LJ:()=>k,Sc:()=>f,X6:()=>u,Xy:()=>C,YZ:()=>s,ZQ:()=>a,_I:()=>D,a_:()=>g,af:()=>m,bG:()=>d,cx:()=>l,ir:()=>b,kk:()=>A,on:()=>j,rp:()=>E,v$:()=>T,yL:()=>y,zN:()=>p});var o=n(5706),r=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},i="transitionend oTransitionEnd transitionend webkitTransitionEnd",a=function(t){return(null==t?void 0:t.nodeType)===Node.DOCUMENT_NODE},s=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)};function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(Array.isArray(t[0])?t[0]:r([],t,!0)).filter(Boolean).join(" ")}var c=function(t,e){return t.querySelectorAll(e)},u=function(t,e){return void 0===e&&(e={}),t&&t.setAttribute&&(0,o.each)(e,function(e,n){return t.setAttribute(n,e)})},p=function(t){var e;return t&&!!(t.offsetWidth||t.offsetHeight||(null===(e=t.getClientRects)||void 0===e?void 0:e.call(t).length))},d=function(t,e){var n;null===(n=t.parentNode)||void 0===n||n.replaceChild(e,t)},f=function(t,e,n){var r=t.childNodes,i=r.length,a=(0,o.isUndefined)(n)?i:n;(0,o.isString)(e)&&(t.insertAdjacentHTML("beforeEnd",e),e=t.lastChild,t.removeChild(e)),a>=i?t.appendChild(e):t.insertBefore(e,r[a])},h=function(t,e){return f(t,e)},g=function(t,e,n){void 0===e&&(e={});var r=document.createElement(t);return e&&(0,o.each)(e,function(t,e){return r.setAttribute(e,t)}),n&&((0,o.isString)(n)?r.innerHTML=n:r.appendChild(n)),r},v=function(t){return document.createTextNode(t)},y=function(t,e){var n,o=t.type;try{n=new window[e](o,t)}catch(t){(n=document.createEvent(e)).initEvent(o,!0,!0)}return n._parentEvent=t,0===o.indexOf("key")&&(n.keyCodeVal=t.keyCode,["keyCode","which"].forEach(function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})})),n},m=function(t,e){void 0===e&&(e=[]),(Array.isArray(e)?e:[e]).forEach(function(e){var n=e.tag||"div",r=e.attributes||{},i=document.createElement(n);(0,o.each)(r,function(t,e){i.setAttribute(e,t)}),t.appendChild(i)})},b=function(t){return(null==t?void 0:t.nodeType)===Node.TEXT_NODE},w=function(t){return t&&!b(t)&&(null==t?void 0:t.nodeType)!==Node.COMMENT_NODE},_=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(b(t)){var o=document.createRange();o.selectNode(t),e=o.getBoundingClientRect(),o.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},C=function(t){var e=(null==t?void 0:t.ownerDocument)||document,n=e.documentElement,o=e.defaultView||window;return{x:(o.pageXOffset||n.scrollLeft||0)-(n.clientLeft||0),y:(o.pageYOffset||n.scrollTop||0)-(n.clientTop||0)}},x=function(t){return t.which||t.keyCode},S=function(t){return String.fromCharCode(x(t))},O=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},T=function(t){return 27===x(t)},P=function(t){return 13===x(t)},E=function(t){return t.ctrlKey||t.metaKey},k=function(t){if(!t)return"";var e=t.name,n=t.publicId,o=t.systemId;return"<!DOCTYPE ".concat(e).concat(n?' PUBLIC "'.concat(n,'"'):"").concat(!n&&o?' SYSTEM "'.concat(o,'"'):"",">")},A=function(t){void 0===t&&(t={});var e=[];return(0,o.each)(t,function(t,n){return e.push("".concat(n,'="').concat(t,'"'))}),e.join(" ")},j=function(t,e,n,r){var i=e.split(/\s+/),a=(0,o.isArray)(t)?t:[t];i.forEach(function(t){a.forEach(function(e){return null==e?void 0:e.addEventListener(t,n,r)})})},M=function(t,e,n,r){var i=e.split(/\s+/),a=(0,o.isArray)(t)?t:[t];i.forEach(function(t){a.forEach(function(e){return null==e?void 0:e.removeEventListener(t,n,r)})})},D=function(t){return t.replace(/-([a-zA-Z0-9])/g,function(t,e){return e.toUpperCase()})}},1166:(t,e,n)=>{n.r(e),n.d(e,{appendStyles:()=>O,buildBase64UrlFromSvg:()=>J,camelCase:()=>k,capitalize:()=>B,createId:()=>Y,deepMerge:()=>V,escape:()=>L,escapeAltQuoteAttrValue:()=>R,escapeAttrValue:()=>N,escapeNodeContent:()=>I,find:()=>D,get:()=>d,getComponentModel:()=>G,getComponentView:()=>q,getElement:()=>M,getGlobal:()=>w,getModel:()=>F,getUiClass:()=>S,getUnitFromValue:()=>P,getViewEl:()=>W,hasDnd:()=>j,hasWin:()=>b,isBultInMethod:()=>g,isComponent:()=>$,isDef:()=>m,isEmptyObj:()=>U,isObject:()=>H,isRule:()=>z,matches:()=>x,normalizeFloat:()=>A,normalizeKey:()=>v,serialize:()=>h,set:()=>f,setViewEl:()=>K,shallowDiff:()=>T,stringToPath:()=>u,toLowerCase:()=>_,upFirst:()=>E,wait:()=>y});var o=n(5706),r=n(6294),i=function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},a=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},s={},l=/\\(\\)?/g,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(c,function(t,n,o,r){return e.push(o?r.replace(l,"$1"):n||t),""}),e};function p(t,e){return(0,o.isArray)(t)?t:e.hasOwnProperty(t)?[t]:u(t)}var d=function(t,e,n){for(var o,r=p(e,t),i=r.length,a=0;null!=t&&a<i;)t=t["".concat(r[a++])];return null!==(o=a&&a==i?t:void 0)&&void 0!==o?o:n},f=function(t,e,n){if(!H(t))return!1;var o=p(e,t),r=o.length;if(0===r)return!1;if(1===r)return t[o[0]]=n,!0;var i=o.slice(0,-1),a=o[r-1],s=d(t,i);if(s){if(Array.isArray(s)){var l=+a;if(!isNaN(l))return s[l]=n,!0}else if(H(s))return s[a]=n,!0}return!1},h=function(t){return JSON.parse(JSON.stringify(t))},g=function(t){return(0,o.isFunction)(s[t])},v=function(t){return g(t)?"_".concat(t):t},y=function(t){return void 0===t&&(t=0),new Promise(function(e){return setTimeout(e,t)})},m=function(t){return void 0!==t},b=function(){return"undefined"!=typeof window},w=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:n.g},_=function(t){return(t||"").toLowerCase()},C=b()?window.Element.prototype:{},x=C.matches||C.webkitMatchesSelector||C.mozMatchesSelector||C.msMatchesSelector,S=function(t,e){var n=t.getConfig(),o=n.stylePrefix;return[n.customUI&&"".concat(o,"cui"),e].filter(function(t){return t}).join(" ")},O=function(t,e){void 0===e&&(e={});var n=(0,o.isArray)(t)?a([],t,!0):[t];if(n.length){var r=n.shift();if(r&&(!e.unique||!document.querySelector('link[href="'.concat(r,'"]')))){var i=document.head,s=document.createElement("link");s.href=r,s.rel="stylesheet",e.prepand?i.insertBefore(s,i.firstChild):i.appendChild(s)}O(n)}},T=function(t,e){var n={},r=(0,o.keys)(e);for(var i in t)if(t.hasOwnProperty(i)){var a=t[i],s=e[i];r.indexOf(i)>=0?a!==s&&(n[i]=s):n[i]=null}for(var i in e)e.hasOwnProperty(i)&&(0,o.isUndefined)(t[i])&&(n[i]=e[i]);return n},P=function(t){return t.replace(parseFloat(t),"")},E=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},k=function(t){return t.replace(/-./g,function(t){return t[1].toUpperCase()})},A=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var o=0;if(isNaN(t))return n;if(Math.floor(t=parseFloat(t))!==t){var r=e.toString().split(".")[1];o=r?r.length:0}return o?parseFloat(t.toFixed(o)):t},j=function(t){return"draggable"in document.createElement("i")&&(!t||t.config.nativeDnD)},M=function(t){return(0,o.isElement)(t)||(0,r.ir)(t)?t:t&&t.getEl?t.getEl():void 0},D=function(t,e){var n=null;return t.some(function(o,r){return e(o,r,t)?(n=o,1):0}),n},L=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#96;")},I=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},N=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},R=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;")},V=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=i({},t[0]),o=1;o<t.length;o++){var r=i({},t[o]);for(var a in r){var s=n[a],l=r[a];H(s)&&H(l)?n[a]=V(s,l):n[a]=l}}return n},F=function(t,e){var n;return!e&&t&&t.__cashData?n=t.__cashData.model:e&&(0,o.isElement)(t)&&(n=e(t).data("model")),n},H=function(t){return t&&!Array.isArray(t)&&"object"==typeof t},U=function(t){return Object.keys(t).length<=0},B=function(t){return void 0===t&&(t=""),t&&t.charAt(0).toUpperCase()+t.substring(1)},z=function(t){return t&&t.toCSS},W=function(t){return null==t?void 0:t.__gjsv},$=function(t){return!!(null==t?void 0:t.toHTML)},q=function(t){return W(t)},G=function(t){var e;return null===(e=q(t))||void 0===e?void 0:e.model},K=function(t,e){t.__gjsv=e},Y=function(t){void 0===t&&(t=16);for(var e="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=n.length,r=0;r<t;r++)e+=n.charAt(Math.floor(Math.random()*o));return e},J=function(t){if(t&&"<svg"===t.substr(0,4)){var e="";return b()?e=window.btoa(t):void 0!==tg&&(e=tg.from(t,"utf8").toString("base64")),e?"data:image/svg+xml;base64,".concat(e):t}return t}},6756:(t,e,n)=>{n.d(e,{h:()=>a});var o,r=n(3178),i=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displayCache=new Map,e}return i(e,t),e.prototype.getChildren=function(){return this.getDisplayedChildren()},e.prototype.getDisplayedChildren=function(){var t=this;return this.model.components().filter(function(e){return t.isChildDisplayed(e)}).map(function(e){return new t.constructor(e)})},e.prototype.isChildDisplayed=function(t){if(this.displayCache.has(t))return this.displayCache.get(t);var e,n=!!(e=t.getEl())&&"object"==typeof e&&e.nodeType===Node.ELEMENT_NODE&&"none"!==window.getComputedStyle(e).display&&e.offsetWidth>0&&e.offsetHeight>0;return this.displayCache.set(t,n),n},e.prototype.getParent=function(){var t=this.model.parent();return t?new this.constructor(t):null},e.prototype.addChildAt=function(t,e,n){if(void 0===n&&(n={action:"add-component"}),(null===(r=null===(o=this.model)||void 0===o?void 0:o.isInstanceOf)||void 0===r?void 0:r.call(o,"text"))&&(null===(a=null===(i=null==t?void 0:t.model)||void 0===i?void 0:i.get)||void 0===a?void 0:a.call(i,"textable")))return null===(u=null===(c=null===(l=null===(s=this.model)||void 0===s?void 0:s.getView)||void 0===l?void 0:l.call(s))||void 0===c?void 0:c.insertComponent)||void 0===u?void 0:u.call(c,null==t?void 0:t.model,{action:n.action});var o,r,i,a,s,l,c,u,p=this.model.components().add(t.model,{at:this.getRealIndex(e),action:n.action});return new this.constructor(p)},e.prototype.removeChildAt=function(t,e){void 0===e&&(e={temporary:!1});var n=this.model.components().at(this.getRealIndex(t));n&&this.model.components().remove(n,e)},e.prototype.indexOfChild=function(t){return this.getDisplayIndex(t)},e.prototype.getDisplayIndex=function(t){var e=this.getDisplayedChildren();return e?e.findIndex(function(e){return e.model===t.model}):-1},e.prototype.getRealIndex=function(t){if(-1===t)return -1;for(var e=0,n=this.model.components(),o=0;o<n.length;o++){var r=n.at(o);if(this.isChildDisplayed(r)&&e++,e===t+1)return o}return -1},e.prototype.canMove=function(t,e){return this.model.em.Components.canMove(this.model,t.model,this.getRealIndex(e)).result},e.prototype.equals=function(t){return!!(null==t?void 0:t._model)&&this._model.getId()===t._model.getId()},e.prototype.restNodeState=function(){this.clearState();var t=this.model;this.setContentEditable(!1),t.em.getEditing()===t&&this.disableEditing()},e.prototype.setContentEditable=function(t){this.element&&this.isTextNode()&&(this.element.contentEditable=t?"true":"false")},e.prototype.disableEditing=function(){var t,e;null===(e=null===(t=this.view)||void 0===t?void 0:t.disableEditing)||void 0===e||e.call(t)},e.prototype.clearState=function(){var t,e;null===(e=(t=this.model).set)||void 0===e||e.call(t,"status","")},e.prototype.setSelectedParentState=function(){var t,e;null===(e=(t=this.model).set)||void 0===e||e.call(t,"status","selected-parent")},e.prototype.isTextNode=function(){var t,e;return null===(e=(t=this.model).isInstanceOf)||void 0===e?void 0:e.call(t,"text")},e.prototype.isTextable=function(){var t,e;return null===(e=(t=this.model).get)||void 0===e?void 0:e.call(t,"textable")},e}(r.$)},1447:(t,e,n)=>{n.d(e,{A:()=>a});var o,r=n(6756),i=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});let a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._dropAreaConfig={ratio:.8,minUndroppableDimension:1,maxUndroppableDimension:15},e}return i(e,t),Object.defineProperty(e.prototype,"view",{get:function(){var t,e;return null===(e=(t=this.model).getView)||void 0===e?void 0:e.call(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){var t,e;return null===(e=(t=this.model).getEl)||void 0===e?void 0:e.call(t)},enumerable:!1,configurable:!0}),e}(r.h)},3178:(t,e,n)=>{n.d(e,{$:()=>o});var o=function(){function t(t,e){void 0===e&&(e={}),this._dropAreaConfig={ratio:1,minUndroppableDimension:0,maxUndroppableDimension:0},this._model=t,this._dragSource=e}return Object.defineProperty(t.prototype,"model",{get:function(){return this._model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dragSource",{get:function(){return this._dragSource},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropArea",{get:function(){var t,e;return this.getParent()?null===(e=this.nodeDimensions)||void 0===e?void 0:e.getDropArea(this._dropAreaConfig):null===(t=this.nodeDimensions)||void 0===t?void 0:t.clone()},enumerable:!1,configurable:!0}),t.prototype.isWithinDropBounds=function(t,e){return!!this.dropArea&&this.dropArea.isWithinBounds(t,e)},t.prototype.equals=function(t){return!!(null==t?void 0:t._model)&&this._model===t._model},t.prototype.adjustDimensions=function(t){var e,n;(0!==t.topDifference||0!==t.leftDifference)&&(null===(e=this.nodeDimensions)||void 0===e||e.adjustDimensions(t),null===(n=this.childrenDimensions)||void 0===n||n.forEach(function(e){return e.adjustDimensions(t)}))},t}()},8433:(t,e,n)=>{var o,r;n.d(e,{A:()=>o}),(r=o||(o={})).Vertical="Vertical",r.Horizontal="Horizontal",r.BothDirections="BothDirections"},585:(t,e,n)=>{var o={"./CanvasClear":9484,"./CanvasClear.ts":9484,"./CanvasMove":9516,"./CanvasMove.ts":9516,"./CommandAbstract":9946,"./CommandAbstract.ts":9946,"./ComponentDelete":7801,"./ComponentDelete.ts":7801,"./ComponentDrag":4864,"./ComponentDrag.ts":4864,"./ComponentEnter":6134,"./ComponentEnter.ts":6134,"./ComponentExit":914,"./ComponentExit.ts":914,"./ComponentNext":5547,"./ComponentNext.ts":5547,"./ComponentPrev":8655,"./ComponentPrev.ts":8655,"./ComponentStyleClear":7640,"./ComponentStyleClear.ts":7640,"./CopyComponent":5837,"./CopyComponent.ts":5837,"./ExportTemplate":6477,"./ExportTemplate.ts":6477,"./Fullscreen":1772,"./Fullscreen.ts":1772,"./MoveComponent":741,"./MoveComponent.ts":741,"./OpenAssets":2924,"./OpenAssets.ts":2924,"./OpenBlocks":3963,"./OpenBlocks.ts":3963,"./OpenLayers":1479,"./OpenLayers.ts":1479,"./OpenStyleManager":3473,"./OpenStyleManager.ts":3473,"./OpenTraitManager":5054,"./OpenTraitManager.ts":5054,"./PasteComponent":6979,"./PasteComponent.ts":6979,"./Preview":4457,"./Preview.ts":4457,"./Resize":5493,"./Resize.ts":5493,"./SelectComponent":9317,"./SelectComponent.ts":9317,"./SelectPosition":1406,"./SelectPosition.ts":1406,"./ShowOffset":9395,"./ShowOffset.ts":9395,"./SwitchVisibility":7285,"./SwitchVisibility.ts":7285};function r(t){return n(i(t))}function i(t){if(!n.o(o,t)){var e=Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return o[t]}r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=585},5706:(t,e,n)=>{n.r(e),n.d(e,{VERSION:()=>r,after:()=>e_,all:()=>eU,allKeys:()=>tf,any:()=>eB,assign:()=>tj,before:()=>eC,bind:()=>ec,bindAll:()=>ed,chain:()=>ei,chunk:()=>nh,clone:()=>tI,collect:()=>eI,compact:()=>no,compose:()=>ew,constant:()=>X,contains:()=>ez,countBy:()=>e1,create:()=>tL,debounce:()=>ey,default:()=>nb,defaults:()=>tM,defer:()=>eg,delay:()=>eh,detect:()=>eM,difference:()=>ni,drop:()=>ne,each:()=>eL,escape:()=>t5,every:()=>eU,extend:()=>tA,extendOwn:()=>tj,filter:()=>eF,find:()=>eM,findIndex:()=>eT,findKey:()=>eS,findLastIndex:()=>eP,findWhere:()=>eD,first:()=>nt,flatten:()=>nr,foldl:()=>eR,foldr:()=>eV,forEach:()=>eL,functions:()=>tE,get:()=>tH,groupBy:()=>eQ,has:()=>tU,head:()=>nt,identity:()=>tB,include:()=>ez,includes:()=>ez,indexBy:()=>e0,indexOf:()=>eA,initial:()=>e8,inject:()=>eR,intersection:()=>nc,invert:()=>tP,invoke:()=>eW,isArguments:()=>K,isArray:()=>$,isArrayBuffer:()=>N,isBoolean:()=>P,isDataView:()=>W,isDate:()=>M,isElement:()=>E,isEmpty:()=>ts,isEqual:()=>td,isError:()=>L,isFinite:()=>Y,isFunction:()=>F,isMap:()=>t_,isMatch:()=>tl,isNaN:()=>J,isNull:()=>O,isNumber:()=>j,isObject:()=>S,isRegExp:()=>D,isSet:()=>tx,isString:()=>A,isSymbol:()=>I,isTypedArray:()=>to,isUndefined:()=>T,isWeakMap:()=>tC,isWeakSet:()=>tS,iteratee:()=>tG,keys:()=>ta,last:()=>nn,lastIndexOf:()=>ej,map:()=>eI,mapObject:()=>tY,matcher:()=>tz,matches:()=>tz,max:()=>eG,memoize:()=>ef,methods:()=>tE,min:()=>eK,mixin:()=>nv,negate:()=>eb,noop:()=>tJ,now:()=>t0,object:()=>nd,omit:()=>e9,once:()=>ex,pairs:()=>tT,partial:()=>el,partition:()=>e2,pick:()=>e7,pluck:()=>e$,property:()=>tW,propertyOf:()=>tX,random:()=>tQ,range:()=>nf,reduce:()=>eR,reduceRight:()=>eV,reject:()=>eH,rest:()=>ne,restArguments:()=>x,result:()=>en,sample:()=>eY,select:()=>eF,shuffle:()=>eJ,size:()=>e4,some:()=>eB,sortBy:()=>eX,sortedIndex:()=>eE,tail:()=>ne,take:()=>nt,tap:()=>tN,template:()=>ee,templateSettings:()=>t4,throttle:()=>ev,times:()=>tZ,toArray:()=>e3,toPath:()=>tR,transpose:()=>nu,unescape:()=>t3,union:()=>nl,uniq:()=>ns,unique:()=>ns,uniqueId:()=>er,unzip:()=>nu,values:()=>tO,where:()=>eq,without:()=>na,wrap:()=>em,zip:()=>np});var o={};n.r(o),n.d(o,{VERSION:()=>r,after:()=>e_,all:()=>eU,allKeys:()=>tf,any:()=>eB,assign:()=>tj,before:()=>eC,bind:()=>ec,bindAll:()=>ed,chain:()=>ei,chunk:()=>nh,clone:()=>tI,collect:()=>eI,compact:()=>no,compose:()=>ew,constant:()=>X,contains:()=>ez,countBy:()=>e1,create:()=>tL,debounce:()=>ey,default:()=>ny,defaults:()=>tM,defer:()=>eg,delay:()=>eh,detect:()=>eM,difference:()=>ni,drop:()=>ne,each:()=>eL,escape:()=>t5,every:()=>eU,extend:()=>tA,extendOwn:()=>tj,filter:()=>eF,find:()=>eM,findIndex:()=>eT,findKey:()=>eS,findLastIndex:()=>eP,findWhere:()=>eD,first:()=>nt,flatten:()=>nr,foldl:()=>eR,foldr:()=>eV,forEach:()=>eL,functions:()=>tE,get:()=>tH,groupBy:()=>eQ,has:()=>tU,head:()=>nt,identity:()=>tB,include:()=>ez,includes:()=>ez,indexBy:()=>e0,indexOf:()=>eA,initial:()=>e8,inject:()=>eR,intersection:()=>nc,invert:()=>tP,invoke:()=>eW,isArguments:()=>K,isArray:()=>$,isArrayBuffer:()=>N,isBoolean:()=>P,isDataView:()=>W,isDate:()=>M,isElement:()=>E,isEmpty:()=>ts,isEqual:()=>td,isError:()=>L,isFinite:()=>Y,isFunction:()=>F,isMap:()=>t_,isMatch:()=>tl,isNaN:()=>J,isNull:()=>O,isNumber:()=>j,isObject:()=>S,isRegExp:()=>D,isSet:()=>tx,isString:()=>A,isSymbol:()=>I,isTypedArray:()=>to,isUndefined:()=>T,isWeakMap:()=>tC,isWeakSet:()=>tS,iteratee:()=>tG,keys:()=>ta,last:()=>nn,lastIndexOf:()=>ej,map:()=>eI,mapObject:()=>tY,matcher:()=>tz,matches:()=>tz,max:()=>eG,memoize:()=>ef,methods:()=>tE,min:()=>eK,mixin:()=>nv,negate:()=>eb,noop:()=>tJ,now:()=>t0,object:()=>nd,omit:()=>e9,once:()=>ex,pairs:()=>tT,partial:()=>el,partition:()=>e2,pick:()=>e7,pluck:()=>e$,property:()=>tW,propertyOf:()=>tX,random:()=>tQ,range:()=>nf,reduce:()=>eR,reduceRight:()=>eV,reject:()=>eH,rest:()=>ne,restArguments:()=>x,result:()=>en,sample:()=>eY,select:()=>eF,shuffle:()=>eJ,size:()=>e4,some:()=>eB,sortBy:()=>eX,sortedIndex:()=>eE,tail:()=>ne,take:()=>nt,tap:()=>tN,template:()=>ee,templateSettings:()=>t4,throttle:()=>ev,times:()=>tZ,toArray:()=>e3,toPath:()=>tR,transpose:()=>nu,unescape:()=>t3,union:()=>nl,uniq:()=>ns,unique:()=>ns,uniqueId:()=>er,unzip:()=>nu,values:()=>tO,where:()=>eq,without:()=>na,wrap:()=>em,zip:()=>np});var r="1.13.1",i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},a=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=a.push,u=a.slice,p=s.toString,d=s.hasOwnProperty,f="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof DataView,g=Array.isArray,v=Object.keys,y=Object.create,m=f&&ArrayBuffer.isView,b=isNaN,w=isFinite,_=!({toString:null}).propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function x(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),o=Array(n),r=0;r<n;r++)o[r]=arguments[r+e];switch(e){case 0:return t.call(this,o);case 1:return t.call(this,arguments[0],o);case 2:return t.call(this,arguments[0],arguments[1],o)}var i=Array(e+1);for(r=0;r<e;r++)i[r]=arguments[r];return i[e]=o,t.apply(this,i)}}function S(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function O(t){return null===t}function T(t){return void 0===t}function P(t){return!0===t||!1===t||"[object Boolean]"===p.call(t)}function E(t){return!!(t&&1===t.nodeType)}function k(t){var e="[object "+t+"]";return function(t){return p.call(t)===e}}let A=k("String"),j=k("Number"),M=k("Date"),D=k("RegExp"),L=k("Error"),I=k("Symbol"),N=k("ArrayBuffer");var R=k("Function"),V=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof V&&(R=function(t){return"function"==typeof t});let F=R,H=k("Object");var U=h&&H(new DataView(new ArrayBuffer(8))),B="undefined"!=typeof Map&&H(new Map),z=k("DataView");let W=U?function(t){return null!=t&&F(t.getInt8)&&N(t.buffer)}:z,$=g||k("Array");function q(t,e){return null!=t&&d.call(t,e)}var G=k("Arguments");!function(){G(arguments)||(G=function(t){return q(t,"callee")})}();let K=G;function Y(t){return!I(t)&&w(t)&&!isNaN(parseFloat(t))}function J(t){return j(t)&&b(t)}function X(t){return function(){return t}}function Z(t){return function(e){var n=t(e);return"number"==typeof n&&n>=0&&n<=9007199254740991}}function Q(t){return function(e){return null==e?void 0:e[t]}}let tt=Q("byteLength"),te=Z(tt);var tn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;let to=f?function(t){return m?m(t)&&!W(t):te(t)&&tn.test(p.call(t))}:X(!1),tr=Q("length");function ti(t,e){e=function(t){for(var e={},n=t.length,o=0;o<n;++o)e[t[o]]=!0;return{contains:function(t){return e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=C.length,o=t.constructor,r=F(o)&&o.prototype||s,i="constructor";for(q(t,i)&&!e.contains(i)&&e.push(i);n--;)(i=C[n])in t&&t[i]!==r[i]&&!e.contains(i)&&e.push(i)}function ta(t){if(!S(t))return[];if(v)return v(t);var e=[];for(var n in t)q(t,n)&&e.push(n);return _&&ti(t,e),e}function ts(t){if(null==t)return!0;var e=tr(t);return"number"==typeof e&&($(t)||A(t)||K(t))?0===e:0===tr(ta(t))}function tl(t,e){var n=ta(e),o=n.length;if(null==t)return!o;for(var r=Object(t),i=0;i<o;i++){var a=n[i];if(e[a]!==r[a]||!(a in r))return!1}return!0}function tc(t){return t instanceof tc?t:this instanceof tc?void(this._wrapped=t):new tc(t)}function tu(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,tt(t))}tc.VERSION=r,tc.prototype.value=function(){return this._wrapped},tc.prototype.valueOf=tc.prototype.toJSON=tc.prototype.value,tc.prototype.toString=function(){return String(this._wrapped)};var tp="[object DataView]";function td(t,e){return function t(e,n,o,r){if(e===n)return 0!==e||1/e==1/n;if(null==e||null==n)return!1;if(e!=e)return n!=n;var i=typeof e;return("function"===i||"object"===i||"object"==typeof n)&&function e(n,o,r,i){n instanceof tc&&(n=n._wrapped),o instanceof tc&&(o=o._wrapped);var a=p.call(n);if(a!==p.call(o))return!1;if(U&&"[object Object]"==a&&W(n)){if(!W(o))return!1;a=tp}switch(a){case"[object RegExp]":case"[object String]":return""+n==""+o;case"[object Number]":if(+n!=+n)return+o!=+o;return 0==+n?1/+n==1/o:+n==+o;case"[object Date]":case"[object Boolean]":return+n==+o;case"[object Symbol]":return l.valueOf.call(n)===l.valueOf.call(o);case"[object ArrayBuffer]":case tp:return e(tu(n),tu(o),r,i)}var s="[object Array]"===a;if(!s&&to(n)){if(tt(n)!==tt(o))return!1;if(n.buffer===o.buffer&&n.byteOffset===o.byteOffset)return!0;s=!0}if(!s){if("object"!=typeof n||"object"!=typeof o)return!1;var c=n.constructor,u=o.constructor;if(c!==u&&!(F(c)&&c instanceof c&&F(u)&&u instanceof u)&&"constructor"in n&&"constructor"in o)return!1}i=i||[];for(var d=(r=r||[]).length;d--;)if(r[d]===n)return i[d]===o;if(r.push(n),i.push(o),s){if((d=n.length)!==o.length)return!1;for(;d--;)if(!t(n[d],o[d],r,i))return!1}else{var f,h=ta(n);if(d=h.length,ta(o).length!==d)return!1;for(;d--;)if(!(q(o,f=h[d])&&t(n[f],o[f],r,i)))return!1}return r.pop(),i.pop(),!0}(e,n,o,r)}(t,e)}function tf(t){if(!S(t))return[];var e=[];for(var n in t)e.push(n);return _&&ti(t,e),e}function th(t){var e=tr(t);return function(n){if(null==n||tr(tf(n)))return!1;for(var o=0;o<e;o++)if(!F(n[t[o]]))return!1;return t!==tb||!F(n[tg])}}var tg="forEach",tv=["clear","delete"],ty=["get","has","set"],tm=tv.concat(tg,ty),tb=tv.concat(ty),tw=["add"].concat(tv,tg,"has");let t_=B?th(tm):k("Map"),tC=B?th(tb):k("WeakMap"),tx=B?th(tw):k("Set"),tS=k("WeakSet");function tO(t){for(var e=ta(t),n=e.length,o=Array(n),r=0;r<n;r++)o[r]=t[e[r]];return o}function tT(t){for(var e=ta(t),n=e.length,o=Array(n),r=0;r<n;r++)o[r]=[e[r],t[e[r]]];return o}function tP(t){for(var e={},n=ta(t),o=0,r=n.length;o<r;o++)e[t[n[o]]]=n[o];return e}function tE(t){var e=[];for(var n in t)F(t[n])&&e.push(n);return e.sort()}function tk(t,e){return function(n){var o=arguments.length;if(e&&(n=Object(n)),o<2||null==n)return n;for(var r=1;r<o;r++)for(var i=arguments[r],a=t(i),s=a.length,l=0;l<s;l++){var c=a[l];e&&void 0!==n[c]||(n[c]=i[c])}return n}}let tA=tk(tf),tj=tk(ta),tM=tk(tf,!0);function tD(t){if(!S(t))return{};if(y)return y(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function tL(t,e){var n=tD(t);return e&&tj(n,e),n}function tI(t){return S(t)?$(t)?t.slice():tA({},t):t}function tN(t,e){return e(t),t}function tR(t){return $(t)?t:[t]}function tV(t){return tc.toPath(t)}function tF(t,e){for(var n=e.length,o=0;o<n;o++){if(null==t)return;t=t[e[o]]}return n?t:void 0}function tH(t,e,n){var o=tF(t,tV(e));return T(o)?n:o}function tU(t,e){for(var n=(e=tV(e)).length,o=0;o<n;o++){var r=e[o];if(!q(t,r))return!1;t=t[r]}return!!n}function tB(t){return t}function tz(t){return t=tj({},t),function(e){return tl(e,t)}}function tW(t){return t=tV(t),function(e){return tF(e,t)}}function t$(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,o,r){return t.call(e,n,o,r)};case 4:return function(n,o,r,i){return t.call(e,n,o,r,i)}}return function(){return t.apply(e,arguments)}}function tq(t,e,n){return null==t?tB:F(t)?t$(t,e,n):S(t)&&!$(t)?tz(t):tW(t)}function tG(t,e){return tq(t,e,1/0)}function tK(t,e,n){return tc.iteratee!==tG?tc.iteratee(t,e):tq(t,e,n)}function tY(t,e,n){e=tK(e,n);for(var o=ta(t),r=o.length,i={},a=0;a<r;a++){var s=o[a];i[s]=e(t[s],s,t)}return i}function tJ(){}function tX(t){return null==t?tJ:function(e){return tH(t,e)}}function tZ(t,e,n){var o=Array(Math.max(0,t));e=t$(e,n,1);for(var r=0;r<t;r++)o[r]=e(r);return o}function tQ(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}tc.toPath=tR,tc.iteratee=tG;let t0=Date.now||function(){return new Date().getTime()};function t1(t){var e=function(e){return t[e]},n="(?:"+ta(t).join("|")+")",o=RegExp(n),r=RegExp(n,"g");return function(t){return t=null==t?"":""+t,o.test(t)?t.replace(r,e):t}}let t2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},t5=t1(t2),t3=t1(tP(t2)),t4=tc.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t6=/(.)^/,t7={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},t9=/\\|'|\r|\n|\u2028|\u2029/g;function t8(t){return"\\"+t7[t]}var et=/^\s*(\w|\$)+\s*$/;function ee(t,e,n){!e&&n&&(e=n);var o,r=RegExp([((e=tM({},e,tc.templateSettings)).escape||t6).source,(e.interpolate||t6).source,(e.evaluate||t6).source].join("|")+"|$","g"),i=0,a="__p+='";t.replace(r,function(e,n,o,r,s){return a+=t.slice(i,s).replace(t9,t8),i=s+e.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":o?a+="'+\n((__t=("+o+"))==null?'':__t)+\n'":r&&(a+="';\n"+r+"\n__p+='"),e}),a+="';\n";var s=e.variable;if(s){if(!et.test(s))throw Error("variable is not a bare identifier: "+s)}else a="with(obj||{}){\n"+a+"}\n",s="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{o=Function(s,"_",a)}catch(t){throw t.source=a,t}var l=function(t){return o.call(this,t,tc)};return l.source="function("+s+"){\n"+a+"}",l}function en(t,e,n){var o=(e=tV(e)).length;if(!o)return F(n)?n.call(t):n;for(var r=0;r<o;r++){var i=null==t?void 0:t[e[r]];void 0===i&&(i=n,r=o),t=F(i)?i.call(t):i}return t}var eo=0;function er(t){var e=++eo+"";return t?t+e:e}function ei(t){var e=tc(t);return e._chain=!0,e}function ea(t,e,n,o,r){if(!(o instanceof e))return t.apply(n,r);var i=tD(t.prototype),a=t.apply(i,r);return S(a)?a:i}var es=x(function(t,e){var n=es.placeholder,o=function(){for(var r=0,i=e.length,a=Array(i),s=0;s<i;s++)a[s]=e[s]===n?arguments[r++]:e[s];for(;r<arguments.length;)a.push(arguments[r++]);return ea(t,o,this,this,a)};return o});es.placeholder=tc;let el=es,ec=x(function(t,e,n){if(!F(t))throw TypeError("Bind must be called on a function");var o=x(function(r){return ea(t,o,e,this,n.concat(r))});return o}),eu=Z(tr);function ep(t,e,n,o){if(o=o||[],e||0===e){if(e<=0)return o.concat(t)}else e=1/0;for(var r=o.length,i=0,a=tr(t);i<a;i++){var s=t[i];if(eu(s)&&($(s)||K(s))){if(e>1)ep(s,e-1,n,o),r=o.length;else for(var l=0,c=s.length;l<c;)o[r++]=s[l++]}else n||(o[r++]=s)}return o}let ed=x(function(t,e){var n=(e=ep(e,!1,!1)).length;if(n<1)throw Error("bindAll must be passed function names");for(;n--;){var o=e[n];t[o]=ec(t[o],t)}return t});function ef(t,e){var n=function(o){var r=n.cache,i=""+(e?e.apply(this,arguments):o);return q(r,i)||(r[i]=t.apply(this,arguments)),r[i]};return n.cache={},n}let eh=x(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),eg=el(eh,tc,1);function ev(t,e,n){var o,r,i,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:t0(),o=null,a=t.apply(r,i),o||(r=i=null)},c=function(){var c=t0();s||!1!==n.leading||(s=c);var u=e-(c-s);return r=this,i=arguments,u<=0||u>e?(o&&(clearTimeout(o),o=null),s=c,a=t.apply(r,i),o||(r=i=null)):o||!1===n.trailing||(o=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(o),s=0,o=r=i=null},c}function ey(t,e,n){var o,r,i,a,s,l=function(){var c=t0()-r;e>c?o=setTimeout(l,e-c):(o=null,n||(a=t.apply(s,i)),o||(i=s=null))},c=x(function(c){return s=this,i=c,r=t0(),!o&&(o=setTimeout(l,e),n&&(a=t.apply(s,i))),a});return c.cancel=function(){clearTimeout(o),o=i=s=null},c}function em(t,e){return el(e,t)}function eb(t){return function(){return!t.apply(this,arguments)}}function ew(){var t=arguments,e=t.length-1;return function(){for(var n=e,o=t[e].apply(this,arguments);n--;)o=t[n].call(this,o);return o}}function e_(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function eC(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}let ex=el(eC,2);function eS(t,e,n){e=tK(e,n);for(var o,r=ta(t),i=0,a=r.length;i<a;i++)if(e(t[o=r[i]],o,t))return o}function eO(t){return function(e,n,o){n=tK(n,o);for(var r=tr(e),i=t>0?0:r-1;i>=0&&i<r;i+=t)if(n(e[i],i,e))return i;return -1}}let eT=eO(1),eP=eO(-1);function eE(t,e,n,o){for(var r=(n=tK(n,o,1))(e),i=0,a=tr(t);i<a;){var s=Math.floor((i+a)/2);n(t[s])<r?i=s+1:a=s}return i}function ek(t,e,n){return function(o,r,i){var a=0,s=tr(o);if("number"==typeof i)t>0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return i=n(o,r),o[i]===r?i:-1;if(r!=r)return(i=e(u.call(o,a,s),J))>=0?i+a:-1;for(i=t>0?a:s-1;i>=0&&i<s;i+=t)if(o[i]===r)return i;return -1}}let eA=ek(1,eT,eE),ej=ek(-1,eP);function eM(t,e,n){var o=(eu(t)?eT:eS)(t,e,n);if(void 0!==o&&-1!==o)return t[o]}function eD(t,e){return eM(t,tz(e))}function eL(t,e,n){if(e=t$(e,n),eu(t))for(o=0,r=t.length;o<r;o++)e(t[o],o,t);else{var o,r,i=ta(t);for(o=0,r=i.length;o<r;o++)e(t[i[o]],i[o],t)}return t}function eI(t,e,n){e=tK(e,n);for(var o=!eu(t)&&ta(t),r=(o||t).length,i=Array(r),a=0;a<r;a++){var s=o?o[a]:a;i[a]=e(t[s],s,t)}return i}function eN(t){var e=function(e,n,o,r){var i=!eu(e)&&ta(e),a=(i||e).length,s=t>0?0:a-1;for(r||(o=e[i?i[s]:s],s+=t);s>=0&&s<a;s+=t){var l=i?i[s]:s;o=n(o,e[l],l,e)}return o};return function(t,n,o,r){var i=arguments.length>=3;return e(t,t$(n,r,4),o,i)}}let eR=eN(1),eV=eN(-1);function eF(t,e,n){var o=[];return e=tK(e,n),eL(t,function(t,n,r){e(t,n,r)&&o.push(t)}),o}function eH(t,e,n){return eF(t,eb(tK(e)),n)}function eU(t,e,n){e=tK(e,n);for(var o=!eu(t)&&ta(t),r=(o||t).length,i=0;i<r;i++){var a=o?o[i]:i;if(!e(t[a],a,t))return!1}return!0}function eB(t,e,n){e=tK(e,n);for(var o=!eu(t)&&ta(t),r=(o||t).length,i=0;i<r;i++){var a=o?o[i]:i;if(e(t[a],a,t))return!0}return!1}function ez(t,e,n,o){return eu(t)||(t=tO(t)),("number"!=typeof n||o)&&(n=0),eA(t,e,n)>=0}let eW=x(function(t,e,n){var o,r;return F(e)?r=e:(o=(e=tV(e)).slice(0,-1),e=e[e.length-1]),eI(t,function(t){var i=r;if(!i){if(o&&o.length&&(t=tF(t,o)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)})});function e$(t,e){return eI(t,tW(e))}function eq(t,e){return eF(t,tz(e))}function eG(t,e,n){var o,r,i=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t){t=eu(t)?t:tO(t);for(var s=0,l=t.length;s<l;s++)null!=(o=t[s])&&o>i&&(i=o)}else e=tK(e,n),eL(t,function(t,n,o){((r=e(t,n,o))>a||r===-1/0&&i===-1/0)&&(i=t,a=r)});return i}function eK(t,e,n){var o,r,i=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t){t=eu(t)?t:tO(t);for(var s=0,l=t.length;s<l;s++)null!=(o=t[s])&&o<i&&(i=o)}else e=tK(e,n),eL(t,function(t,n,o){((r=e(t,n,o))<a||r===1/0&&i===1/0)&&(i=t,a=r)});return i}function eY(t,e,n){if(null==e||n)return eu(t)||(t=tO(t)),t[tQ(t.length-1)];var o=eu(t)?tI(t):tO(t),r=tr(o);e=Math.max(Math.min(e,r),0);for(var i=r-1,a=0;a<e;a++){var s=tQ(a,i),l=o[a];o[a]=o[s],o[s]=l}return o.slice(0,e)}function eJ(t){return eY(t,1/0)}function eX(t,e,n){var o=0;return e=tK(e,n),e$(eI(t,function(t,n,r){return{value:t,index:o++,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,o=e.criteria;if(n!==o){if(n>o||void 0===n)return 1;if(n<o||void 0===o)return -1}return t.index-e.index}),"value")}function eZ(t,e){return function(n,o,r){var i=e?[[],[]]:{};return o=tK(o,r),eL(n,function(e,r){var a=o(e,r,n);t(i,e,a)}),i}}let eQ=eZ(function(t,e,n){q(t,n)?t[n].push(e):t[n]=[e]}),e0=eZ(function(t,e,n){t[n]=e}),e1=eZ(function(t,e,n){q(t,n)?t[n]++:t[n]=1}),e2=eZ(function(t,e,n){t[n?0:1].push(e)},!0);var e5=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function e3(t){return t?$(t)?u.call(t):A(t)?t.match(e5):eu(t)?eI(t,tB):tO(t):[]}function e4(t){return null==t?0:eu(t)?t.length:ta(t).length}function e6(t,e,n){return e in n}let e7=x(function(t,e){var n={},o=e[0];if(null==t)return n;F(o)?(e.length>1&&(o=t$(o,e[1])),e=tf(t)):(o=e6,e=ep(e,!1,!1),t=Object(t));for(var r=0,i=e.length;r<i;r++){var a=e[r],s=t[a];o(s,a,t)&&(n[a]=s)}return n}),e9=x(function(t,e){var n,o=e[0];return F(o)?(o=eb(o),e.length>1&&(n=e[1])):(e=eI(ep(e,!1,!1),String),o=function(t,n){return!ez(e,n)}),e7(t,o,n)});function e8(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function nt(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:e8(t,t.length-e)}function ne(t,e,n){return u.call(t,null==e||n?1:e)}function nn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:ne(t,Math.max(0,t.length-e))}function no(t){return eF(t,Boolean)}function nr(t,e){return ep(t,e,!1)}let ni=x(function(t,e){return e=ep(e,!0,!0),eF(t,function(t){return!ez(e,t)})}),na=x(function(t,e){return ni(t,e)});function ns(t,e,n,o){P(e)||(o=n,n=e,e=!1),null!=n&&(n=tK(n,o));for(var r=[],i=[],a=0,s=tr(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&i===c||r.push(l),i=c):n?ez(i,c)||(i.push(c),r.push(l)):ez(r,l)||r.push(l)}return r}let nl=x(function(t){return ns(ep(t,!0,!0))});function nc(t){for(var e=[],n=arguments.length,o=0,r=tr(t);o<r;o++){var i,a=t[o];if(!ez(e,a)){for(i=1;i<n&&ez(arguments[i],a);i++);i===n&&e.push(a)}}return e}function nu(t){for(var e=t&&eG(t,tr).length||0,n=Array(e),o=0;o<e;o++)n[o]=e$(t,o);return n}let np=x(nu);function nd(t,e){for(var n={},o=0,r=tr(t);o<r;o++)e?n[t[o]]=e[o]:n[t[o][0]]=t[o][1];return n}function nf(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var o=Math.max(Math.ceil((e-t)/n),0),r=Array(o),i=0;i<o;i++,t+=n)r[i]=t;return r}function nh(t,e){if(null==e||e<1)return[];for(var n=[],o=0,r=t.length;o<r;)n.push(u.call(t,o,o+=e));return n}function ng(t,e){return t._chain?tc(e).chain():e}function nv(t){return eL(tE(t),function(e){var n=tc[e]=t[e];tc.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),ng(this,n.apply(tc,t))}}),tc}eL(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=a[t];tc.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),("shift"===t||"splice"===t)&&0===n.length&&delete n[0]),ng(this,n)}}),eL(["concat","join","slice"],function(t){var e=a[t];tc.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),ng(this,t)}});let ny=tc;var nm=nv(o);nm._=nm;let nb=nm}},ty={};function tm(t){var e=ty[t];if(void 0!==e)return e.exports;var n=ty[t]={exports:{}};return tv[t].call(n.exports,n,n.exports,tm),n.exports}tm.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return tm.d(e,{a:e}),e},tm.d=(t,e)=>{for(var n in e)tm.o(e,n)&&!tm.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},tm.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),tm.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),tm.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var tb={};tm.d(tb,{Ay:()=>gB,I0:()=>gU,nu:()=>gH});var tw=tm(5706),t_=tm(1166);function tC(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=t.raw;return o.reduce(function(t,n,r){var i=e[r-1],a=o[r-1];return Array.isArray(i)?i=i.join(""):a&&"$"===a.slice(-1)?t=t.slice(0,-1):i=(0,t_.escape)(i),t+i+n})}var tx=tm(4193),tS=tm.n(tx),tO=tm(7774),tT=tm(9156),tP=(co=function(t,e){return(co=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}co(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),tE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return tP(e,t),e}(tT.Kx),tk=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return tP(e,t),e.prototype.getByComponent=function(t){var e=this;return this.filter(function(n){return e.getComponent(n)===t})[0]},e.prototype.addComponent=function(t,e){var n=this,o=((0,tw.isArray)(t)?t:[t]).filter(function(t){return!n.hasComponent(t)}).map(function(t){return new tE({component:t})})[0];return this.push(o,e)},e.prototype.getComponent=function(t){return t.get("component")},e.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},e.prototype.lastComponent=function(){var t=this.last();return t?this.getComponent(t):void 0},e.prototype.allComponents=function(){var t=this;return this.map(function(e){return t.getComponent(e)}).filter(function(t){return t})},e.prototype.removeComponent=function(t,e){var n=this,o=((0,tw.isArray)(t)?t:[t]).map(function(t){return n.getByComponent(t)});return this.remove(o,e)},e}(tT.pM),tA=(cr=function(t,e){return(cr=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),tj=function(){return(tj=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},tM=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},tD=function(){function t(t,e,n){this.debounced=[],this.collections=[],this.cls=[],this.events={},this._em=t,this._name=e;var o=this.name.charAt(0).toLowerCase()+this.name.slice(1),r=(0,tw.isUndefined)(t.config[o])?t.config[this.name]:t.config[o],i=!0===r?{}:r||{};i.pStylePrefix=t.config.pStylePrefix||"",(0,tw.isUndefined)(r)||r||(i._disable=1),i.em=t,this._config=(0,t_.deepMerge)(n||{},i)}return Object.defineProperty(t.prototype,"em",{get:function(){return this._em},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),t.prototype.render=function(t){},t.prototype.postLoad=function(t){},t.prototype.onInit=function(){},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t){return t?this.config[t]:this.config},t.prototype.__logWarn=function(t,e){void 0===e&&(e={}),this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)},t.prototype.destroy=function(){this.__destroy()},t.prototype.__destroy=function(){var t,e,n;null===(t=this.view)||void 0===t||t.remove(),null===(e=this.state)||void 0===e||e.stopListening(),null===(n=this.state)||void 0===n||n.clear(),this.debounced.forEach(function(t){return t.cancel()}),this.collections.forEach(function(t){t.stopListening(),t.reset()})},t.prototype.__appendTo=function(){var t=this.getConfig().appendTo;if(t){var e=(0,tw.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},t}(),tL=function(t){function e(e,n,o,r,i,a){void 0===a&&(a={});var s=t.call(this,e,n,i)||this;return s.cls=[],s._itemCache=new Map,s.private=!1,s.all=o,r&&(s.events=r),a.skipListen||s.__initListen(),s}return tA(e,t),e.prototype.postLoad=function(t){},e.prototype.render=function(t){},e.prototype.getProjectData=function(t){var e={},n=this.storageKey;return n&&(e[n]=t||this.getAll()),e},e.prototype.loadProjectData=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=e.all,o=e.onResult,r=e.reset,i=this.storageKey,a={action:"load"},s=n||this.all,l=t[i];if("string"==typeof l)try{l=JSON.parse(l)}catch(t){this.__logWarn("Data parsing failed",{input:l})}return r&&l&&s.reset(void 0,a),o?l&&o(l,a):l&&(0,t_.isDef)(l.length)&&s.reset(l,a),l},e.prototype.clear=function(t){void 0===t&&(t={});var e=this.all;return e&&e.reset(void 0,t),this},e.prototype.getAll=function(){return tM([],this.all.models,!0)},e.prototype.getAllMap=function(){return this.getAll().reduce(function(t,e){return t[e.get(e.idAttribute)]=e,t},{})},e.prototype._makeCacheKey=function(t){return""},e.prototype._cacheItem=function(t){var e=this._makeCacheKey(t);e&&this._itemCache.set(e,t)},e.prototype._uncacheItem=function(t){var e=this._makeCacheKey(t);e&&this._itemCache.delete(e)},e.prototype._clearItemCache=function(){this._itemCache.clear()},e.prototype._onItemsResetCache=function(t){var e=this;this._clearItemCache(),t.each(function(t){return e._cacheItem(t)})},e.prototype._onItemKeyChange=function(t){for(var e,n=0,o=this._itemCache.entries();n<o.length;n++){var r=o[n],i=r[0];if(r[1]===t){e=i;break}}e&&this._itemCache.delete(e),this._cacheItem(t)},e.prototype._setupCacheListeners=function(){this.em.listenTo(this.all,"add",this._cacheItem.bind(this)),this.em.listenTo(this.all,"remove",this._uncacheItem.bind(this)),this.em.listenTo(this.all,"reset",this._onItemsResetCache.bind(this))},e.prototype.__initListen=function(t){void 0===t&&(t={});var e=this.all,n=this.em,o=this.events;e&&n&&e.on("add",function(t,e,r){return n.trigger(o.add,t,r)}).on("remove",function(t,e,r){return n.trigger(o.remove,t,r)}).on("change",function(t,e){return n.trigger(o.update,t,t.changedAttributes(),e)}).on("all",this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach(function(t){var o=t.entity,r=t.event;o.on("all",function(t,o,i,a){var s=tj({event:t},a||i);[n,e].map(function(t){return t.trigger(r,o,s)})})})},e.prototype.__remove=function(t,e){var n=this;void 0===e&&(e={});var o=this.em,r=(0,tw.isString)(t)?this.get(t):t,i=function(){return r&&n.all.remove(r,e),r};return e.silent||null==o||o.trigger(this.events.removeBefore,r,i,e),!e.abort&&i()},e.prototype.__catchAllEvent=function(t,e,n,o){var r=this.em,i=this.events;r&&i.all&&r.trigger(i.all,{event:t,model:e,options:o||n}),this.__onAllEvent()},e.prototype.__appendTo=function(t){var e=this.config.appendTo;if(e){var n=(0,tw.isElement)(e)?e:document.querySelector(e);if(!n)return this.__logWarn('"appendTo" element not found');n.appendChild(this.render(t))}},e.prototype.__onAllEvent=function(){},e.prototype._createId=function(t){void 0===t&&(t=16);var e,n=this.getAll().length+t,o=this.getAllMap();do e=(0,t_.createId)(n);while(o[e]);return e},e.prototype.__listenAdd=function(t,e){var n=this;t.on("add",function(t,o,r){return n.em.trigger(e,t,r)})},e.prototype.__listenRemove=function(t,e){var n=this;t.on("remove",function(t,o,r){return n.em.trigger(e,t,r)})},e.prototype.__listenUpdate=function(t,e){var n=this;t.on("change",function(t,o){return n.em.trigger(e,t,t.changedAttributes(),o)})},e.prototype.__destroy=function(){var t;this.cls.forEach(function(t){t.stopListening(),t.reset()}),null===(t=this.view)||void 0===t||t.remove(),this.view=void 0},e}(tD),tI=tm(7058);(ci=pH||(pH={})).add="device:add",ci.addBefore="device:add:before",ci.remove="device:remove",ci.removeBefore="device:remove:before",ci.select="device:select",ci.selectBefore="device:select:before",ci.update="device:update",ci.all="device";let tN=pH;(ca=pU||(pU={})).add="page:add",ca.addBefore="page:add:before",ca.remove="page:remove",ca.removeBefore="page:remove:before",ca.select="page:select",ca.selectBefore="page:select:before",ca.update="page:update",ca.all="page";let tR=pU;var tV=(cs=function(t,e){return(cs=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cs(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),tF=function(t){function e(e,n,o){return t.call(this,n,{module:e,modelConstructor:o})||this}return tV(e,t),e.prototype.add=function(e,n){var o,r=this,i=(0,tw.isArray)(e)?e:(0,tw.isUndefined)(e)?void 0:[e];return i=null!==(o=null==i?void 0:i.map(function(t){return t instanceof r.newModel?t:new r.newModel(r.module,t)}))&&void 0!==o?o:[void 0],t.prototype.add.call(this,(0,tw.isArray)(e)?i:i[0],n)},e.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},e}(tT.pM);(cl=pB||(pB={})).dragEnter="canvas:dragenter",cl.dragOver="canvas:dragover",cl.dragEnd="canvas:dragend",cl.dragData="canvas:dragdata",cl.drop="canvas:drop",cl.spot="canvas:spot",cl.spotAdd="canvas:spot:add",cl.spotUpdate="canvas:spot:update",cl.spotRemove="canvas:spot:remove",cl.coords="canvas:coords",cl.zoom="canvas:zoom",cl.pointer="canvas:pointer",cl.refresh="canvas:refresh",cl.frameLoad="canvas:frame:load",cl.frameLoadHead="canvas:frame:load:head",cl.frameLoadBody="canvas:frame:load:body",cl.frameUnload="canvas:frame:unload";let tH=pB;var tU=(cc=function(t,e){return(cc=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cc(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),tB=function(){return(tB=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},tz=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},tW="__aw",t$="__ah",tq=function(t,e){var n,o=t.get(e),r=null===(n=t.view)||void 0===n?void 0:n.el["width"===e?"offsetWidth":"offsetHeight"];return(0,tw.isNumber)(o)?o:(0,tw.isString)(o)&&o.endsWith("px")?parseFloat(o):r||0},tG=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=o.em,i=o.attributes,a=i.styles,s=i.component,l=r.Components,c=l.getConfig(),u=r.Css.getAll(),p={};if(!(0,t_.isComponent)(s)){var d=(0,t_.isObject)(s)?s:{components:s};d.type||(d.type="wrapper");var f=l.getType("wrapper").model;o.set("component",new f(d,{em:r,config:c,frame:o,idMap:p}))}if(a){if(!(0,t_.isObject)(a)){var h=a;(0,tw.keys)(p).length&&(h=(0,tw.isString)(h)?r.Parser.parseCss(h):h,r.Css.checkId(h,{idMap:p})),u.add(h),o.set("styles",u)}}else o.set("styles",u);return n.width||o.set(tW,1),n.height||o.set(t$,1),o.id||o.set("id",(0,t_.createId)()),o}return tU(e,t),e.prototype.defaults=function(){return{x:0,y:0,changesCount:0,attributes:{},width:null,height:null,head:[],component:"",styles:"",refFrame:null,_undo:!0,_undoexc:["changesCount"]}},Object.defineProperty(e.prototype,"width",{get:function(){return tq(this,"width")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return tq(this,"height")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"head",{get:function(){return this.get("head")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refFrame",{get:function(){return this.get("refFrame")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){var t=this.refFrame;return(null==t?void 0:t.getComponent())||this.getComponent()},enumerable:!1,configurable:!0}),e.prototype.initRefs=function(){var t=this.refFrame;if((0,tw.isString)(t)){var e=this.module.framesById[t];e&&this.set({refFrame:e},{silent:!0})}},e.prototype.getBoxRect=function(){var t=this.attributes;return{x:t.x,y:t.y,width:this.width,height:this.height}},e.prototype.onRemove=function(){this.refFrame||this.getComponent().remove({root:1})},e.prototype.changesUp=function(t){void 0===t&&(t={}),t.temporary||t.noCount||t.avoidStore||this.set("changesCount",this.get("changesCount")+1)},e.prototype.getComponent=function(){return this.get("component")},e.prototype.getStyles=function(){return this.get("styles")},e.prototype.disable=function(){this.trigger("disable")},e.prototype.remove=function(){null===(t=this.view)||void 0===t||t.remove(),this.view=void 0;var t,e=this.collection;return e&&e.remove(this)},e.prototype.getHead=function(){return tz([],this.head,!0)},e.prototype.setHead=function(t){return this.set("head",tz([],t,!0))},e.prototype.addHeadItem=function(t){this.head.push(t)},e.prototype.getHeadByAttr=function(t,e,n){return this.head.filter(function(o){return o.attributes&&o.attributes[t]==e&&(!n||n===o.tag)})[0]},e.prototype.removeHeadByAttr=function(t,e,n){var o=this.getHeadByAttr(t,e,n),r=this.head.indexOf(o);r>=0&&this.head.splice(r,1)},e.prototype.addLink=function(t){var e="link";this.getHeadByAttr("href",t,e)||this.addHeadItem({tag:e,attributes:{href:t,rel:"stylesheet"}})},e.prototype.removeLink=function(t){this.removeHeadByAttr("href",t,"link")},e.prototype.addScript=function(t){var e="script";this.getHeadByAttr("src",t,e)||this.addHeadItem({tag:e,attributes:{src:t}})},e.prototype.removeScript=function(t){this.removeHeadByAttr("src",t,"script")},e.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},e.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger("frame:updated",tB({frame:this},t))},e.prototype._emitUnload=function(){this._emitWithEditor(tH.frameUnload,{frame:this})},e.prototype._emitWithEditor=function(t,e){[this.em,this].forEach(function(n){return null==n?void 0:n.trigger(t,e)})},e.prototype.hasAutoHeight=function(){return"auto"===this.attributes.height||!!this.config.infiniteCanvas},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=tI.A.prototype.toJSON.call(this,t),n=(0,tw.result)(this,"defaults");return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[tW]&&delete e.width,e[t$]&&delete e.height,e.refFrame&&(e.refFrame=e.refFrame.id,delete e.component),(0,tw.forEach)(e,function(t,n){0===n.indexOf("_")&&delete e[n]}),(0,tw.forEach)(n,function(t,n){e[n]===t&&delete e[n]}),(0,tw.forEach)(["attributes","head"],function(t){(0,tw.isEmpty)(e[t])&&delete e[t]}),e},e}(tI.A),tK=(cu=function(t,e){return(cu=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cu(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),tY=function(t){function e(e,n){void 0===n&&(n=[]);var o=t.call(this,e,n,tG)||this;return o.loadedItems=0,o.itemsToLoad=0,(0,tw.bindAll)(o,"itemLoaded"),o.on("add",o.onAdd),o.on("reset",o.onReset),o.on("remove",o.onRemove),o.forEach(function(t){return o.onAdd(t)}),o}return tK(e,t),e.prototype.onAdd=function(t){this.module.framesById[t.id]=t},e.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map(function(t){return n.onRemove(t)})},e.prototype.onRemove=function(t){t.onRemove(),delete this.module.framesById[t.id]},e.prototype.initRefs=function(){this.forEach(function(t){return t.initRefs()})},e.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger("loaded:all"),this.listenToLoadItems(!1))},e.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},e.prototype.listenToLoadItems=function(t){var e=this;this.forEach(function(n){return n[t?"on":"off"]("loaded",e.itemLoaded)})},e}(tF),tJ=(cp=function(t,e){return(cp=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cp(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),tX=function(t){function e(e){var n=this,o=e.em,r=e.config,i=r.scripts,a=r.styles;return(n=t.call(this,e,{scripts:i,styles:a})||this).set("frames",new tY(e)),n.on("change:zoom",n.onZoomChange),n.on("change:x change:y",n.onCoordsChange),n.on("change:pointer change:pointerScreen",n.onPointerChange),n.listenTo(o,"change:device ".concat(tN.update),n.updateDevice),n.listenTo(o,tR.select,n._pageUpdated),n}return tJ(e,t),e.prototype.defaults=function(){return{frame:"",frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[],pointer:tT.lK,pointerScreen:tT.lK}},Object.defineProperty(e.prototype,"frames",{get:function(){return this.get("frames")},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.em.Pages._initPage();this.set("frames",t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype._pageUpdated=function(t,e){var n=this.em;n.setSelected(),n.get("readyCanvas")&&n.stopDefault(),null==e||e.getFrames().map(function(t){t.disable(),t._emitUnload()}),this.set("frames",t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype.updateDevice=function(t){void 0===t&&(t={});var e=this.em,n=e.getDeviceModel(),o=t.frame||e.getCurrentFrameModel();if(o&&n){var r=n.attributes,i=r.width,a=r.height,s=r.minHeight;o.set({width:i,height:a,minHeight:s},{noUndo:1})}},e.prototype.onZoomChange=function(t,e,n){var o=this.em,r=this.module;1>this.get("zoom")&&this.set("zoom",1),o.trigger(r.events.zoom,{options:n})},e.prototype.onCoordsChange=function(){var t=this.em,e=this.module;t.trigger(e.events.coords)},e.prototype.onPointerChange=function(){var t=this.em,e=this.module;t.trigger(e.events.pointer)},e.prototype.getPointerCoords=function(t){void 0===t&&(t=tT.x2.World);var e=this.attributes,n=e.pointer,o=e.pointerScreen;return t===tT.x2.World?n:o},e}(tI.A),tZ=tm(179),tQ=tm(2225),t0=(cd=function(t,e){return(cd=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cd(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),t1=function(t){function e(e,n){void 0===n&&(n=[]);var o=t.call(this,e,n,tZ.A)||this;o.on("add",o.onAdd),o.on("change",o.onChange),o.on("remove",o.onRemove);var r=o.em;o.refreshDbn=(0,tw.debounce)(function(){return o.refresh()},0);var i="".concat(tQ.I.resize," styleable:change ").concat(tQ.I.input," ").concat(tQ.I.update," frame:updated undo redo");return o.listenTo(r,i,function(){return o.refreshDbn()}),o}return t0(e,t),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this.module.events},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){var t=this.em,e=this.events;t.trigger(e.spot)},e.prototype.onAdd=function(t){this.__trgEvent(this.events.spotAdd,{spot:t})},e.prototype.onChange=function(t){this.__trgEvent(this.events.spotUpdate,{spot:t})},e.prototype.onRemove=function(t){this.__trgEvent(this.events.spotRemove,{spot:t})},e.prototype.__trgEvent=function(t,e){this.module.em.trigger(t,e),this.refreshDbn()},e}(tF),t2=(cf=function(t,e){return(cf=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),t5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return t2(e,t),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"module",{get:function(){var t,e;return null!==(e=null===(t=this.model)||void 0===t?void 0:t.module)&&void 0!==e?e:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),e.prototype.preinitialize=function(t){this.className=""},e}(tT.Ss),t3=tm(6294),t4=(ch=function(t,e){return(ch=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ch(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),t6=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var o=t.call(this,e)||this;return o.itemsView="",o.itemType="type",o.reuseView=!1,o.viewCollection=[],n&&o.listenTo(o.collection,"add",o.addTo),o}return t4(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,o=this.reuseView,r=this.viewCollection,i=e||null,a=t.get(this.itemType);n=t.view&&o?t.view:this.renderView(t,a),r.push(n);var s=n.render().el;i?i.appendChild(s):this.$el.append(s)},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each(function(n){return t.add(n,e)}),this.$el.append(e),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(t){void 0===t&&(t={});var e=this.viewCollection;return this.onRemoveBefore(e,t),this.clearItems(),tT.Ss.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(t5);(cg=pz||(pz={})).mount="css:mount",cg.mountBefore="css:mount:before";var t7=(cv=function(t,e){return(cv=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cv(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),t9=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{};var o=n.model;return n.listenTo(o,"change",n.render),n.listenTo(o,"destroy remove",n.remove),n.listenTo(o.get("selectors"),"change",n.render),o.setView(n),n}return t7(e,t),Object.defineProperty(e.prototype,"frameView",{get:function(){return this.config.frameView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.model.em},enumerable:!1,configurable:!0}),e.prototype.remove=function(){return t.prototype.remove.call(this),this.model.removeView(this),this},e.prototype.updateStyles=function(){this.render()},e.prototype.tagName=function(){return"style"},e.prototype.render=function(){var t=this.model,e=this.el,n=this.em,o=t.get("important"),r=t.toCSS({important:o}),i={rule:t,ruleView:this,css:r};return null==n||n.trigger(pz.mountBefore,i),e.innerHTML=i.css,null==n||n.trigger(pz.mount,i),this},e}(tT.Ss),t8=(cy=function(t,e){return(cy=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cy(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return t8(e,t),e.prototype._createElement=function(){return document.createTextNode("")},e.prototype.render=function(){var t=this.model,e=t.get("important");return this.el.textContent=t.getDeclaration({important:e}),this},e}(t9),ee=(cm=function(t,e){return(cm=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cm(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),en=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):"")},eo=function(t){function e(e){var n=t.call(this,e)||this;(0,tw.bindAll)(n,"sortRules");var o=e.config||{};n.atRules={},n.config=o,n.em=o.em,n.pfx=o.stylePrefix||"",n.className=n.pfx+"rules";var r=n.collection;return n.listenTo(r,"add",n.addTo),n.listenTo(r,"reset",n.render),n}return ee(e,t),e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){if(this.renderStarted){var n,o,r={model:t,config:this.config};if("keyframes"===t.get("atRuleType")){var i=t.getAtRule(),a=this.atRules[i];if(!a){var s=document.createElement("style");a=document.createTextNode(""),s.appendChild(document.createTextNode("".concat(i,"{"))),s.appendChild(a),s.appendChild(document.createTextNode("}")),this.atRules[i]=a,n=s}o=new et(r),a.appendData(o.render().el.textContent)}else n=(o=new t9(r)).render().el;var l=this.className,c=t.get("mediaText"),u=en(l),p=u;if(c&&(p=en(l,this.getMediaWidth(c))),n){var d=e||this.el,f=void 0;try{f=d.querySelector("#".concat(p))}catch(t){}f||(f=d.querySelector("#".concat(u))),null==f||f.appendChild(n)}return n}},e.prototype.getMediaWidth=function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),"").replace(")","")},e.prototype.sortRules=function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||"").indexOf("min-width");return n?(n?t:e)-(n?e:t):0},e.prototype.render=function(){var t=this;this.renderStarted=!0,this.atRules={};var e=this.em,n=this.$el,o=this.collection,r=this.className,i=document.createDocumentFragment();n.empty();var a=e.Devices.getAll().pluck("priority").sort(this.sortRules);return a.every(function(t){return t})&&a.unshift(0),a.forEach(function(t){return i.appendChild((0,t3.a_)("div",{id:en(r,t)}))}),o.each(function(e){return t.addToCollection(e,i)}),n.append(i),n.attr("class",r),this},e}(tT.Ss);(cb=pW||(pW={})).variable="data-variable",cb.condition="data-condition",cb.conditionTrue="data-condition-true-content",cb.conditionFalse="data-condition-false-content",cb.collection="data-collection",cb.collectionItem="data-collection-item",(p$||(p$={})).rootData="__rootData",(cw=pq||(pq={})).string="string",cw.number="number",cw.boolean="boolean",cw.date="date",cw.json="json",cw.relation="relation",(c_=pG||(pG={})).add="data:add",c_.addBefore="data:add:before",c_.remove="data:remove",c_.removeBefore="data:remove:before",c_.update="data:update",c_.path="data:path",c_.pathSource="data:pathSource:",c_.providerLoad="data:provider:load",c_.providerLoadBefore="data:provider:load:before",c_.providerLoadError="data:provider:load:error",c_.providerLoadAll="data:provider:loadAll",c_.providerLoadAllBefore="data:provider:loadAll:before",c_.all="data";var er=(cC=function(t,e){return(cC=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cC(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ei=function(){return(ei=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ea=pW.variable,es=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.em=n.em,o.collectionsStateMap=n.collectionsStateMap,o}return er(e,t),e.prototype.defaults=function(){return{type:ea,defaultValue:"",path:"",collectionId:void 0,variableType:void 0,asPlainText:void 0}},Object.defineProperty(e.prototype,"path",{get:function(){var t;return null!==(t=this.get("path"))&&void 0!==t?t:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultValue",{get:function(){var t;return null!==(t=this.get("defaultValue"))&&void 0!==t?t:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collectionId",{get:function(){return this.get("collectionId")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variableType",{get:function(){return this.get("variableType")},enumerable:!1,configurable:!0}),e.prototype.resolvesFromCollection=function(){return!!this.collectionId},e.prototype.updateCollectionsStateMap=function(t){this.collectionsStateMap=t,this.trigger("change")},e.prototype.getResolverPath=function(){var t;if(this.resolvesFromCollection()){var e=this.resolveCollectionVariable();return!!eK(e)&&(null!==(t=e.path)&&void 0!==t?t:"")}return this.path},e.prototype.toJSON=function(e){var n=this.defaults(),o=Object.fromEntries(Object.entries(t.prototype.toJSON.call(this,e)).filter(function(t){var e=t[0];return t[1]!==n[e]}));return ei(ei({},o),{type:ea})},e.prototype.getDataValue=function(){var t={em:this.em,collectionsStateMap:this.collectionsStateMap};return e.resolveDataResolver({path:this.path,defaultValue:this.defaultValue,collectionId:this.collectionId,variableType:this.variableType},t)},e.resolveDataSourceVariable=function(t,e){var n,o;return e.em.DataSources.getValue(null!==(n=t.path)&&void 0!==n?n:"",null!==(o=t.defaultValue)&&void 0!==o?o:"")},e.resolveDataResolver=function(t,n){var o,r,i,a;if(t.collectionId){var s=e.resolveCollectionVariable(t,n);return eK(s)?e.resolveDataSourceVariable({path:null!==(o=s.path)&&void 0!==o?o:"",defaultValue:null!==(r=t.defaultValue)&&void 0!==r?r:""},{em:n.em}):s}return e.resolveDataSourceVariable({path:null!==(i=t.path)&&void 0!==i?i:"",defaultValue:null!==(a=t.defaultValue)&&void 0!==a?a:""},{em:n.em})},e.prototype.resolveCollectionVariable=function(){var t=this.em,n=this.collectionsStateMap;return e.resolveCollectionVariable(this.attributes,{em:t,collectionsStateMap:n})},e.resolveCollectionVariable=function(t,n){var o,r,i=t.collectionId,a=void 0===i?"":i,s=t.variableType,l=t.path,c=t.defaultValue,u=void 0===c?"":c,p=n.em,d=n.collectionsStateMap;if(!d)return u;var f=d[a];return f?s?"currentItem"===s?null!==(o=e.resolveCurrentItem(f,l,a,p))&&void 0!==o?o:u:null!==(r=f[s])&&void 0!==r?r:u:(p.logError("Missing collection variable type for collection: ".concat(a)),u):u},e.resolveCurrentItem=function(t,e,n,o){var r=t.currentItem;if(!r){o.logError("Current item is missing for collection: ".concat(n));return}return r.type===ea?{type:ea,path:r.path?"".concat(r.path,".").concat(e):e}:!e||r[e]?e?r[e]:r:void 0},e}(tT.Kx),el=function(){function t(t){var e=this;this.listeners=[],this.model=new tT.Kx,this.onChange=function(){var t=e.resolver.getDataValue();e.onUpdate(t)},this.em=t.em,this.resolver=t.resolver,this.onUpdate=t.onUpdate,this.listenToResolver()}return t.prototype.createListener=function(t,e,n){return void 0===n&&(n=this.onChange),{obj:t,event:e,callback:n}},t.prototype.listenToResolver=function(){var t=this.resolver,e=this.model;this.removeListeners();var n=[];switch(t.attributes.type){case ea:n=this.listenToDataVariable(t);break;case eC:n=this.listenToConditionalVariable(t)}n.forEach(function(t){return e.listenTo(t.obj,t.event,t.callback)}),this.listeners=n},t.prototype.listenToConditionalVariable=function(t){return[{obj:t,event:ex,callback:this.onChange}]},t.prototype.listenToDataVariable=function(t){var e=this,n=this.em,o=[],r=function(){e.listenToResolver(),e.onChange()};o.push(this.createListener(t,"change",r));var i=t.getResolverPath();if(!i)return o;var a=(0,t_.stringToPath)(i||"").join("."),s=n.DataSources.fromPath(i),l=s[0],c=s[1];return l&&o.push(this.createListener(l.records,"add remove reset",r)),c&&o.push(this.createListener(c,"change")),o.push(this.createListener(n.DataSources.all,"add remove reset",r),this.createListener(n,"".concat(pG.path,":").concat(a)),this.createListener(n,pG.path,function(t){var n=t.path;n!==i&&n.startsWith(i)&&e.onChange()})),o},t.prototype.removeListeners=function(){var t=this;this.listeners.forEach(function(e){return t.model.stopListening(e.obj,e.event,e.callback)}),this.listeners=[]},t.prototype.destroy=function(){this.removeListeners()},t}(),ec=function(){function t(t,e,n){this.operator=t,this.statements=e,this.opts=n}return t.prototype.evaluate=function(){var t=this,e=this.statements.map(function(e){return new ew({condition:e},t.opts).evaluate()});return this.operator.evaluate(e)},t}(),eu=function(){function t(t,e){this.operationString=t,this.em=e.em}return t.prototype.getOperations=function(){var t;return Object.keys(t=this.operationsEnum).filter(function(t){return isNaN(Number(t))}).map(function(e){return t[e]})},t}(),ep=(cx=function(t,e){return(cx=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cx(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});(cS=pK||(pK={})).equals="equals",cS.isTruthy="isTruthy",cS.isFalsy="isFalsy",cS.isDefined="isDefined",cS.isNull="isNull",cS.isUndefined="isUndefined",cS.isArray="isArray",cS.isObject="isObject",cS.isString="isString",cS.isNumber="isNumber",cS.isBoolean="isBoolean",cS.isDefaultValue="isDefaultValue";var ed=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.operationsEnum=pK,e}return ep(e,t),e.prototype.evaluate=function(t,e){var n;switch(this.operationString){case"equals":return t===e;case"isTruthy":return!!t;case"isFalsy":return!t;case"isDefined":return null!=t;case"isNull":return null===t;case"isUndefined":return void 0===t;case"isArray":return Array.isArray(t);case"isObject":return"object"==typeof t&&null!==t;case"isString":return"string"==typeof t;case"isNumber":return"number"==typeof t;case"isBoolean":return"boolean"==typeof t;case"isDefaultValue":return t instanceof es&&t.get("defaultValue")===e;default:return null===(n=this.em)||void 0===n||n.logWarning("Unsupported generic operation: ".concat(this.operationString)),!1}},e}(eu),ef=(cO=function(t,e){return(cO=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cO(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});(cT=pY||(pY={})).and="and",cT.or="or",cT.xor="xor";var eh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.operationsEnum=pY,e}return ef(e,t),e.prototype.evaluate=function(t){if(!(null==t?void 0:t.length))return!1;switch(this.operationString){case pY.and:return t.every(Boolean);case pY.or:return t.some(Boolean);case pY.xor:return 1===t.filter(Boolean).length;default:return this.em.logWarning("Unsupported boolean operation: ".concat(this.operationString)),!1}},e}(eu),eg=(cP=function(t,e){return(cP=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cP(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});(cE=pJ||(pJ={})).greaterThan=">",cE.lessThan="<",cE.greaterThanOrEqual=">=",cE.lessThanOrEqual="<=",cE.equals="=",cE.notEquals="!=";var ev=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.operationsEnum=pJ,e}return eg(e,t),e.prototype.evaluate=function(t,e){if("number"!=typeof t)return!1;switch(this.operationString){case pJ.greaterThan:return t>e;case pJ.lessThan:return t<e;case pJ.greaterThanOrEqual:return t>=e;case pJ.lessThanOrEqual:return t<=e;case pJ.equals:return t===e;case pJ.notEquals:return t!==e;default:return this.em.logWarning("Unsupported number operation: ".concat(this.operationString)),!1}},e}(eu),ey=(ck=function(t,e){return(ck=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ck(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});(cA=pX||(pX={})).contains="contains",cA.startsWith="startsWith",cA.endsWith="endsWith",cA.matchesRegex="matchesRegex",cA.equalsIgnoreCase="equalsIgnoreCase",cA.trimEquals="trimEquals";var em=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.operationsEnum=pX,e}return ey(e,t),e.prototype.evaluate=function(t,e){if("string"!=typeof t)return!1;switch(this.operationString){case pX.contains:return t.includes(e);case pX.startsWith:return t.startsWith(e);case pX.endsWith:return t.endsWith(e);case pX.matchesRegex:return e||this.em.logWarning("Regex pattern must be provided."),new RegExp(null!=e?e:"").test(t);case pX.equalsIgnoreCase:return t.toLowerCase()===e.toLowerCase();case pX.trimEquals:return t.trim()===e.trim();default:return this.em.logWarning("Unsupported string operation: ".concat(this.operationString)),!1}},e}(eu),eb=(cj=function(t,e){return(cj=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cj(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ew=function(t){function e(e,n){var o,r=t.call(this,e)||this;return r.collectionsStateMap={},r.em=n.em,r.collectionsStateMap=null!==(o=n.collectionsStateMap)&&void 0!==o?o:{},r}return eb(e,t),e.prototype.evaluate=function(){var t=this.get("condition");if(!t||(0,tw.isBoolean)(t))return!!t;var e=this.getOperator();return!!e&&e.evaluate(this.getResolvedLeftValue(),this.getResolvedRightValue())},e.prototype.getDependentDataVariables=function(){var t=this.get("condition");return t?this.extractDataVariables(t):[]},e.prototype.getOperations=function(){var t=this.getOperator();return!t||t instanceof ec?[]:t.getOperations()},e.prototype.updateCollectionStateMap=function(t){this.collectionsStateMap=t},e.prototype.getOperator=function(){var t,e={em:this.em,collectionsStateMap:this.collectionsStateMap},n=this.get("condition");if(!(!n||(0,tw.isBoolean)(n))){if(this.isLogicGroup(n)){var o=n.logicalOperator,r=n.statements,i=new eh(o,e);t=new ec(i,r,e)}if(this.isExpression(n)){var a=n.left,i=n.operator,s=eY(a,e);t=this.resolveOperator(s,i)}return t}},e.prototype.resolveOperator=function(t,e){var n=this.em;return this.isOperatorInEnum(e,pK)?new ed(e,{em:n}):"number"==typeof t?new ev(e,{em:n}):"string"==typeof t?new em(e,{em:n}):void 0},e.prototype.extractDataVariables=function(t){var e=this,n=[];return this.isExpression(t)?(eK(t.left)&&n.push(t.left),eK(t.right)&&n.push(t.right)):this.isLogicGroup(t)&&t.statements.forEach(function(t){return n.push.apply(n,e.extractDataVariables(t))}),n},e.prototype.isLogicGroup=function(t){return t&&void 0!==t.logicalOperator&&Array.isArray(t.statements)},e.prototype.isExpression=function(t){return t&&void 0!==t.left&&"string"==typeof t.operator},e.prototype.isOperatorInEnum=function(t,e){return Object.values(e).includes(t)},e.prototype.resolveExpressionSide=function(t){var e=this.get("condition"),n=this.em,o=this.collectionsStateMap;return e&&"boolean"!=typeof e?e&&"object"==typeof e&&t in e?eY(e[t],{em:n,collectionsStateMap:o}):void 0:e},e.prototype.getResolvedLeftValue=function(){return this.resolveExpressionSide("left")},e.prototype.getResolvedRightValue=function(){return this.resolveExpressionSide("right")},e.prototype.toJSON=function(t){var e=this.get("condition");return"object"==typeof e?JSON.parse(JSON.stringify(e)):e},e}(tT.Kx),e_=(cM=function(t,e){return(cM=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cM(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),eC="data-condition",ex="data-condition-output-changed",eS=function(t){function e(e,n){var o,r=t.call(this,e,n)||this;r.collectionsStateMap={},r.resolverListeners=[],r._previousEvaluationResult=null,r.em=n.em,r.collectionsStateMap=null!==(o=n.collectionsStateMap)&&void 0!==o?o:{};var i=e.condition,a=new ew({condition:void 0===i?{}:i},{em:r.em});return r._conditionEvaluator=a,r.listenToDataVariables(),r.listenToPropsChange(),r}return e_(e,t),e.prototype.defaults=function(){return{type:eC,condition:{left:"",operator:pX.equalsIgnoreCase,right:""},ifTrue:{},ifFalse:{}}},e.prototype.getCondition=function(){return this._conditionEvaluator.get("condition")},e.prototype.getIfTrue=function(){return this.get("ifTrue")},e.prototype.getIfFalse=function(){return this.get("ifFalse")},e.prototype.getOperations=function(){return this._conditionEvaluator.getOperations()},e.prototype.setCondition=function(t){this.set("condition",t),this._conditionEvaluator.set("condition",t),this.trigger(ex,this.getDataValue())},e.prototype.setIfTrue=function(t){this.set("ifTrue",t)},e.prototype.setIfFalse=function(t){this.set("ifFalse",t)},e.prototype.isTrue=function(){return this._conditionEvaluator.evaluate()},e.prototype.getDataValue=function(t){void 0===t&&(t=!1);var e={em:this.em,collectionsStateMap:this.collectionsStateMap},n=this.getIfTrue(),o=this.getIfFalse(),r=this.isTrue();return t?r?n:o:r?eY(n,e):eY(o,e)},e.prototype.resolvesFromCollection=function(){return!1},e.prototype.updateCollectionsStateMap=function(t){this.collectionsStateMap=t,this._conditionEvaluator.updateCollectionStateMap(t),this.listenToDataVariables(),this.emitConditionEvaluationChange()},e.prototype.listenToPropsChange=function(){var t=this;this.on("change:condition",this.handleConditionChange.bind(this)),this.on("change:condition change:ifTrue change:ifFalse",function(){t.listenToDataVariables()})},e.prototype.handleConditionChange=function(){this.setCondition(this.get("condition"))},e.prototype.listenToDataVariables=function(){this.cleanupListeners(),this.setupConditionDataVariableListeners(),this.setupOutputDataVariableListeners()},e.prototype.setupConditionDataVariableListeners=function(){var t=this;this._conditionEvaluator.getDependentDataVariables().forEach(function(e){t.addListener(e,function(){t.emitConditionEvaluationChange()})})},e.prototype.setupOutputDataVariableListeners=function(){var t=this.isTrue();this.setupOutputVariableListener(this.getIfTrue(),t),this.setupOutputVariableListener(this.getIfFalse(),!t)},e.prototype.setupOutputVariableListener=function(t,e){var n=this;eK(t)&&this.addListener(t,function(){e&&n.trigger(ex,t)})},e.prototype.addListener=function(t,e){var n=new el({em:this.em,resolver:new es(t,{em:this.em,collectionsStateMap:this.collectionsStateMap}),onUpdate:e});this.resolverListeners.push(n)},e.prototype.emitConditionEvaluationChange=function(){var t=this.isTrue();this._previousEvaluationResult!==t&&(this._previousEvaluationResult=t,this.trigger("data-condition-evaluation-changed",t),this.emitOutputValueChange())},e.prototype.emitOutputValueChange=function(){var t=this.getDataValue();this.trigger(ex,t)},e.prototype.cleanupListeners=function(){this.resolverListeners.forEach(function(t){return t.destroy()}),this.resolverListeners=[]},e.prototype.toJSON=function(){var t=this.getIfTrue(),e=this.getIfFalse();return{type:eC,condition:this._conditionEvaluator.toJSON(),ifTrue:t,ifFalse:e}},e}(tT.Kx),eO="dataResolver",eT=function(){return(eT=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eP=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},eE=function(t){return(0,tw.isArray)(t.get(nF))},ek=function(t){return!!t.get(nH)},eA=function(t){return!!(eE(t)||ek(t))},ej=function(t){var e=t.parent();return eA(t)&&(!e||!eA(e))},eM=function(t){t.__symbReady||(t.on("change",t.__upSymbProps),t.__symbReady=!0)},eD=function(t){var e=t.get(nH);if(e&&(0,tw.isString)(e)){var n=t.__getAllById()[e];n?(e=n,t.set(nH,n)):e=0}return e||void 0},eL=function(t){var e=null==t?void 0:t.get(nF);return e&&(0,tw.isArray)(e)&&(e.forEach(function(n,o){n&&(0,tw.isString)(n)&&(e[o]=t.__getAllById()[n])}),e=e.filter(function(t){return t&&!(0,tw.isString)(t)})),e||void 0},eI=function(t,e){void 0===e&&(e="");var n=null==t?void 0:t.get(nU),o=e.split(":")[0],r=e!==o?[e,o]:[e];return!0===n||(0,tw.isArray)(n)&&r.some(function(t){return n.indexOf(t)>=0})},eN=function(t,e){void 0===e&&(e={});var n=e.changed;if(e.fromInstance||e.noPropagate||e.fromUndo||n&&eI(t,n))return[];var o=eL(t)||[],r=eD(t);return(r?eP([r],eL(r)||[],!0):o).filter(function(e){return e!==t}).filter(function(t){return!(n&&eI(t,n))})},eR=function(t,e){for(var n=t,o=t.parent(e);o&&eA(o);)n=o,o=o.parent(e);return n},eV=function(t,e){void 0===e&&(e={});var n=eD(t),o=n&&eL(n);!e.skipRefs&&o&&n.set(nF,o.filter(function(e){return e!==t})),t.set(nH,0),t.components().forEach(function(t){return eV(t,e)})},eF=function(t,e,n,o){void 0===o&&(o={});var r=eD(t),i=eL(t);(r||i)&&t.em.log(e,{model:t,toUp:n,context:"symbols",opts:o})},eH=function(t,e){void 0===e&&(e={});var n=t.changedAttributes();if(n){var o=t.dataResolverWatchers.getProps(n);if(eU(o),!(0,t_.isEmptyObj)(o)){var r=eN(t,e);o=eB(o,t),eF(t,"props",r,{opts:e,changed:o}),r.forEach(function(n){var r=eB(o,n);n.set(r,eT({fromInstance:t},e))})}}},eU=function(t){var e,n;["status","open",nF,nH,nU].forEach(function(e){return delete t[e]}),null===(e=t.attributes)||void 0===e||delete e.id,(0,t_.isEmptyObj)(null!==(n=t.attributes)&&void 0!==n?n:{})&&delete t.attributes},eB=function(t,e){var n=eT({},t);return(0,tw.keys)(t).forEach(function(o){eW(t,o,e)||delete n[o]}),n},ez=function(t,e){var n,o;switch(e){case"attributes":case"style":return!!(o=t[e])&&Object.values(o).some(function(t){return!!(null==t?void 0:t.collectionId)});default:return!!(null===(n=t[e])||void 0===n?void 0:n.collectionId)}},eW=function(t,e,n){var o=ez(t,e);return!eI(n,e)||o},e$=function(t,e){void 0===e&&(e={});var n=eN(t,e);eF(t,"classes",n,{opts:e}),n.forEach(function(e){e.set("classes",t.get("classes"),{fromInstance:t})}),t.__changesUp(e)},eq=function(t,e,n,o){var r=o||n||{},i={fromInstance:r.fromInstance,fromUndo:r.fromUndo},a=e.opt.temporary;if(o){if(o.add){var s=[],l=!!eL(t),c=eN(t,eT(eT({},i),{changed:"components:add"}));if(c.length){var u=eD(e);(s=eP([],s=(u?eL(u):eL(e))||[],!0)).push(u||e)}a||eF(t,"add",c,{opts:o,addedInstances:s.map(function(t){return t.cid}),added:e.cid}),c.forEach(function(n){var r=eR(n),i=s.filter(function(t){var e=eR(t,{prev:1});return r&&e&&e===r})[0]||e.clone({symbol:!0,symbolInv:l});n.append(i,eT({fromInstance:t},o))})}else{var p=eD(e);if(p&&!o.temporary&&p.set(nF,eL(p).filter(function(t){return t!==e})),!ej(e)&&!o.skipRefsUp){var d="components:remove",f=o.index,h=e.parent(),g=eT({fromInstance:e},o),v=ej(e),y=function(t){var e=t.parent();e&&!eI(e,d)&&t.remove(g)},c=eI(h,d)?[]:eN(e,i);v&&(c=h&&eN(h,eT(eT({},i),{changed:d})),y=function(t){var e=t.components().at(f);e&&e.remove(eT({fromInstance:h},g))}),a||eF(t,"remove",c,{opts:o,removed:e.cid,isSymbNested:v}),c.forEach(y)}}}else{var c=eN(t,eT(eT({},i),{changed:"components:reset"})),m=e.models,b=new Set;eF(t,"reset",c,{components:m}),c.forEach(function(e){var o=e.components(),r=m.map(function(e,n){return t.get(eO)?e.clone({symbol:eA(e)}):!eA(e)||b.has(e)?(b.add(e),e.clone({symbol:!0})):o.at(n)});o.reset(r,eT({fromInstance:t},n))})}t.__changesUp(r)};function eG(t){return"object"==typeof t&&[ea,eC].includes(null==t?void 0:t.type)}function eK(t){return(null==t?void 0:t.type)===ea}function eY(t,e){return eG(t)?(eK(t)&&es.resolveDataResolver(t,e),eX(t,e)):t}function eJ(t,e){var n,o,r=t.type;switch(r){case ea:o=new es(t,e);break;case eC:o=new eS(t,e);break;default:null===(n=e.em)||void 0===n||n.logWarning("Unsupported resolver type: ".concat(r));return}return o}function eX(t,e){var n=eJ(t,e);return null==n?void 0:n.getDataValue()}var eZ="text/html";let eQ=function(t,e){void 0===e&&(e={});var n,o=new DOMParser,r=e.htmlType||eZ,i=r===eZ,a=o.parseFromString(i?t:"<div>".concat(t,"</div>"),r);if(i){if(e.asDocument)return a;var s=a.head,l=a.body,c=s.querySelectorAll("script");(0,tw.each)(c,function(t){return l.appendChild(t)});var u=[];(0,tw.each)(s.children,function(t){return u.push(t)}),(0,tw.each)(u,function(t,e){return l.insertBefore(t,l.children[e])}),n=l}else n=a.firstChild;return n};(cD=pZ||(pZ={})).html="parse:html",cD.htmlRoot="parse:html:root",cD.htmlBefore="parse:html:before",cD.css="parse:css",cD.cssBefore="parse:css:before",cD.all="parse";var e0=function(){return(e0=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};let e1=function(t,e){return void 0===e&&(e={}),{compTypes:[],modelAttrStart:"data-gjs-",getPropAttribute:function(t,e){var n=t.replace(this.modelAttrStart,""),o=(null==e?void 0:e.length)||0,r=null==e?void 0:e.substring(0,1),i=null==e?void 0:e.substring(o-1),a="true"===e||"false"!==e&&e;try{a="{"==r&&"}"==i||"["==r&&"]"==i?JSON.parse(a):a}catch(t){}return{name:n,value:a}},splitPropsFromAttr:function(t){var e=this;void 0===t&&(t={});var n={},o={};return(0,tw.each)(t,function(t,r){if(0===r.indexOf(e.modelAttrStart)){var i=e.getPropAttribute(r,t);n[i.name]=i.value}else o[r]=t}),{props:n,attrs:o}},parseStyle:function(t){for(var e={};t.indexOf("/*")>=0;){var n=t.indexOf("/*"),o=t.indexOf("*/"),r=o>-1?o+2:void 0;t=t.replace(t.slice(n,r),"")}for(var i=t.split(";"),a=0,s=i.length;a<s;a++){var l=i[a].trim();if(l){var c=l.split(":"),u=c[0].trim(),p=c.slice(1).join(":").trim();e[u]?((0,tw.isArray)(e[u])||(e[u]=[e[u]]),e[u].push(p)):e[u]=p}}return e},parseClass:function(t){for(var e=[],n=t.split(" "),o=0,r=n.length;o<r;o++){var i=n[o].trim();i&&e.push(i)}return e},parseNodeAttr:function(n,o){for(var r,i,a=o||{},s=n.attributes||[],l=s.length,c=!!(null===(r=null==e?void 0:e.optionsHtml)||void 0===r?void 0:r.convertDataGjsAttributesHyphens),u=c&&!!a.type&&(0,tw.result)(null===(i=null==t?void 0:t.Components.getType(a.type))||void 0===i?void 0:i.model.prototype,"defaults")||{},p=0;p<l;p++){var d=s[p].nodeName,f=s[p].nodeValue;if("style"==d)a.style=this.parseStyle(f);else if("class"==d)a.classes=this.parseClass(f);else if("contenteditable"==d)continue;else if(0===d.indexOf(this.modelAttrStart)){var h=this.getPropAttribute(d,f),g=h.name;if(c&&!(g in u)){var v=(0,t3._I)(g);g=v in u?v:g}a[g]=h.value}else""===f&&!0===n[d]&&(f=!0),a.attributes||(a.attributes={}),a.attributes[d]=f}return a},detectNode:function(t,e){void 0===e&&(e={});var n,o=this.compTypes,r={};if(o){var i=null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"".concat(this.modelAttrStart,"type"));if(i)r={type:i};else for(var a=0;a<o.length;a++){var s=o[a],l=s.model.isComponent(t,e);if(l){"object"!=typeof l&&(l={type:s.id}),r=l;break}}}return r},parseNode:function(t,n){void 0===n&&(n={});var o,r=(null===(o=t.content)||void 0===o?void 0:o.childNodes)||t.childNodes,i=r.length,a=this.detectNode(t,n);if(!a.tagName){var s=t.tagName||"",l=t.namespaceURI||"";a.tagName=s&&"http://www.w3.org/1999/xhtml"===l?s.toLowerCase():s}if(a=this.parseNodeAttr(t,a),i||"/>"!=="".concat(t.outerHTML).slice(-2)||(a.void=!0),i&&!a.components&&!n.skipChildren){var c=r[0];1===i&&3===c.nodeType?(a.type||(a.type="text"),a.components={type:"textnode",content:c.nodeValue}):a.components=this.parseNodes(t,e0(e0({},n),{inSvg:n.inSvg||"svg"===a.type}))}var u=a.components;if(!a.type&&(null==u?void 0:u.length)){for(var p=e.textTypes,d=void 0===p?[]:p,f=e.textTags,h=void 0===f?[]:f,g=!0,v=!1,y=0;y<u.length;y++){var m=u[y],b=m.type;if(!d.includes(b)&&!h.includes(m.tagName)){g=!1;break}"textnode"===b&&(v=!0)}g&&v&&(a.type="text")}return a},parseNodes:function(t,e){void 0===e&&(e={});for(var n,o=[],r=(null===(n=t.content)||void 0===n?void 0:n.childNodes)||t.childNodes,i=r.length,a=0;a<i;a++){var s=r[a],l=o[o.length-1],c=this.parseNode(s,e);if("textnode"===c.type){if((null==l?void 0:l.type)==="textnode"){l.content+=c.content;continue}if(!e.keepEmptyTextNodes){var u=s.nodeValue||"",p=0===a||a===i-1,d=u.includes("\n");if(" "!=u&&!u.trim()&&(p||d))continue}}!c.tagName&&(0,tw.isUndefined)(c.content)||o.push(c)}return o},parse:function(n,o,r){void 0===r&&(r={});var i,a,s,l=(null==t?void 0:t.get("Config"))||{},c=null==t?void 0:t.Parser,u={html:[]},p=e0(e0(e0({},e.optionsHtml),{htmlType:(null===(i=e.optionsHtml)||void 0===i?void 0:i.htmlType)||e.htmlType}),r),d=e0(e0({},p),{asDocument:this.__checkAsDocument(n,p)}),f=e0(e0({},e),d),h=d.preParser,g=d.asDocument,v={input:(0,tw.isFunction)(h)?h(n,{editor:null==t?void 0:t.getEditor()}):n};null==c||c.__emitEvent(pZ.htmlBefore,v);var y=v.input,m=(0,tw.isFunction)(f.parserHtml)?f.parserHtml(y,d):eQ(y,d),b=m;g&&(b=m.documentElement,u.doctype=(0,t3.LJ)(m.doctype));var w=b.querySelectorAll("script"),_=w.length;if(!((0,tw.isUndefined)(l.allowScripts)?d.allowScripts:l.allowScripts))for(;_--;)null===(a=w[_].parentNode)||void 0===a||a.removeChild(w[_]);if(d.allowUnsafeAttr&&d.allowUnsafeAttrValue||this.__sanitizeNode(b,d),o){for(var C=b.querySelectorAll("style"),x=C.length,S="";x--;)S=C[x].innerHTML+S,null===(s=C[x].parentNode)||void 0===s||s.removeChild(C[x]);S&&(u.css=o.parse(S))}null==c||c.__emitEvent(pZ.htmlRoot,{input:y,root:b});var O=[];if(g)u.head=this.parseNode(m.head,f),u.root=this.parseNodeAttr(b),O=this.parseNode(m.body,f);else{var T=this.parseNodes(b,f);O=1!==T.length||f.returnArray?T:T[0]}return u.html=O,null==c||c.__emitEvent(pZ.html,{input:y,output:u,options:d}),u},__sanitizeNode:function(t,e){var n=this,o=t.attributes||[],r=t.childNodes||[],i=[];(0,tw.each)(o,function(t){var n=t.nodeName||"",o=t.nodeValue||"";!e.allowUnsafeAttr&&n.startsWith("on")&&i.push(n),!e.allowUnsafeAttrValue&&o.startsWith("javascript:")&&i.push(n)}),i.map(function(e){return t.removeAttribute(e)}),(0,tw.each)(r,function(t){return n.__sanitizeNode(t,e)})},__checkAsDocument:function(t,e){return(0,t_.isDef)(e.asDocument)?e.asDocument:(0,tw.isFunction)(e.detectDocument)?!!e.detectDocument(t):e.detectDocument?t.toLowerCase().trim().startsWith("<!doctype"):void 0}}};var e2=function(){return(e2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e5=function(){function t(t,e,n){this.model=t,this.updateFn=e,this.resolverListeners={},this.em=n.em}return t.prototype.bindModel=function(t){this.model=t},t.prototype.setDataValues=function(t,e){return void 0===e&&(e={}),e.skipWatcherUpdates||e.fromDataSource||this.removeListeners(),this.addDataValues(t,e)},t.prototype.addDataValues=function(t,e){if(void 0===e&&(e={}),!t)return{};var n=this.evaluateValues(t);return e.skipWatcherUpdates||e.fromDataSource||this.updateListeners(t),n},t.prototype.onCollectionsStateMapUpdate=function(){var t=this,e=this.getValuesResolvingFromCollections();e.length&&Object.entries(this.addDataValues(this.getValuesOrResolver(Object.fromEntries(e.map(function(t){return[t,""]}))))).forEach(function(e){var n=e[0],o=e[1];return t.updateFn(t.model,n,o)})},Object.defineProperty(t.prototype,"collectionsStateMap",{get:function(){var t,e=this.model;return null!==(t=null==e?void 0:e.collectionsStateMap)&&void 0!==t?t:{}},enumerable:!1,configurable:!0}),t.prototype.updateListeners=function(t){var e=this,n=this.em,o=this.collectionsStateMap;this.removeListeners(Object.keys(t));for(var r=Object.keys(t),i=this,a=0;a<r.length;a++)!function(a){var s=r[a],l=t[s];if(eG(l)){var c=eJ(l,{em:n,collectionsStateMap:o});i.resolverListeners[s]=new el({em:n,resolver:c,onUpdate:function(t){return e.updateFn(e.model,s,t)}})}}(a)},t.prototype.evaluateValues=function(t){for(var e=this.em,n=this.collectionsStateMap,o=e2({},t),r=Object.keys(t),i=0;i<r.length;i++){var a=r[i],s=t[a];eG(s)&&(o[a]=eX(s,{em:e,collectionsStateMap:n}))}return o},t.prototype.removeListeners=function(t){var e=this,n=t||Object.keys(this.resolverListeners);return n.forEach(function(t){var n,o;e.resolverListeners[t]&&(null===(o=(n=e.resolverListeners[t]).destroy)||void 0===o||o.call(n),delete e.resolverListeners[t])}),n},t.prototype.getValuesOrResolver=function(t){if(!t)return{};for(var e=e2({},t),n=Object.keys(e),o=0;o<n.length;o++){var r=n[o],i=this.resolverListeners[r];i&&(e[r]=i.resolver.toJSON())}return e},t.prototype.getAllDataResolvers=function(){for(var t={},e=Object.keys(this.resolverListeners),n=0;n<e.length;n++){var o=e[n];t[o]=this.resolverListeners[o].resolver.toJSON()}return t},t.prototype.getValuesResolvingFromCollections=function(){var t=this;return Object.keys(this.resolverListeners).filter(function(e){return t.resolverListeners[e].resolver.resolvesFromCollection()})},t.prototype.destroy=function(){this.removeListeners()},t}(),e3=function(){return(e3=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e4=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},e6={fromDataSource:!0,avoidStore:!0},e7="__data_values",e9=function(){function t(t,e){var n=this;this.model=t,this.options=e,this.onPropertyUpdate=function(t,e,n){null==t||t.set(e,n,e6)},this.onAttributeUpdate=function(t,e,o){var r;n.isComponent(t)&&(null==t||t.addAttributes(((r={})[e]=o,r),e6))},this.onStyleUpdate=function(t,e,n){var o;null==t||t.addStyle(((o={})[e]=n,o),e3(e3({},e6),{partial:!0,avoidStore:!0}))},this.propertyWatcher=new e5(t,this.onPropertyUpdate,e),this.attributeWatcher=new e5(t,this.onAttributeUpdate,e),this.styleWatcher=new e5(t,this.onStyleUpdate,e)}return t.prototype.bindModel=function(t){this.model=t,this.watchers.forEach(function(e){return e.bindModel(t)}),this.updateSymbolOverride()},t.prototype.addProps=function(t,e){void 0===e&&(e={});var n,o=null!==(n=t[e7])&&void 0!==n?n:{},r=this.filterProps(t),i=e3(e3({},t),this.propertyWatcher.addDataValues(e3(e3({},r),o.props),e));return this.shouldProcessProp("attributes",t,o)&&(i.attributes=this.processAttributes(t,o,e)),this.shouldProcessProp("style",t,o)&&(i.style=this.processStyles(t,o,e)),e.skipWatcherUpdates||e.fromDataSource||(this.updateSymbolOverride(),i[e7]={props:this.propertyWatcher.getAllDataResolvers(),style:this.styleWatcher.getAllDataResolvers(),attributes:this.attributeWatcher.getAllDataResolvers()}),i},t.prototype.getProps=function(t){var e=this.getValueOrResolver("props",t),n=e3({},e);return delete n[e7],(0,tw.isEmpty)(t.attributes)||(n.attributes=this.getValueOrResolver("attributes",t.attributes)),(0,tw.isObject)(t.style)&&!(0,tw.isEmpty)(t.style)&&(n.style=this.getValueOrResolver("styles",t.style)),n},t.prototype.getValueOrResolver=function(t,e){var n;switch(t){case"props":n=this.propertyWatcher;break;case"styles":n=this.styleWatcher;break;case"attributes":n=this.attributeWatcher;break;default:var o=this.options.em;return null==o||o.logError("Invalid target '".concat(t,"'. Must be 'props', 'styles', or 'attributes'.")),{}}return e?n.getValuesOrResolver(e):n.getAllDataResolvers()},t.prototype.removeAttributes=function(t){this.attributeWatcher.removeListeners(t),this.updateSymbolOverride()},t.prototype.disableStyles=function(){this.styleWatcher.removeListeners(),this.styleWatcher.destroy()},t.prototype.onCollectionsStateMapUpdate=function(){this.watchers.forEach(function(t){return t.onCollectionsStateMapUpdate()})},t.prototype.destroy=function(){this.watchers.forEach(function(t){return t.destroy()})},Object.defineProperty(t.prototype,"watchers",{get:function(){return[this.propertyWatcher,this.styleWatcher,this.attributeWatcher]},enumerable:!1,configurable:!0}),t.prototype.isComponent=function(t){return t instanceof nW},t.prototype.shouldProcessProp=function(t,e,n){var o="attributes"===t?this.attributeWatcher:this.styleWatcher,r=n[t],i=!!e[t],a=r&&Object.keys(r).length>0,s=r&&Object.keys(o.getAllDataResolvers()).length>0;return i||a||s},t.prototype.updateSymbolOverride=function(){var t,e=this.model;if(this.isComponent(e)&&eA(e)&&Object.keys(null!==(t=null==e?void 0:e.collectionsStateMap)&&void 0!==t?t:{}).length){var n=this.propertyWatcher.getValuesResolvingFromCollections(),o=this.attributeWatcher.getValuesResolvingFromCollections(),r=e4(["locked","layerable",e7],n,!0);Object.keys(o).length&&r.push("attributes"),eN(e).forEach(function(t){t.setSymbolOverride(r,{fromDataSource:!0})}),e.setSymbolOverride(r,{fromDataSource:!0})}},t.prototype.filterProps=function(t){var e=["components","dataResolver","status","state","open",nU,e7];return Object.fromEntries(Object.entries(t).filter(function(t){var n=t[0];return!e.includes(n)}))},t.prototype.processAttributes=function(t,e,n){var o;return void 0===n&&(n={}),this.attributeWatcher.setDataValues(e3(e3({},t.attributes),null!==(o=e.attributes)&&void 0!==o?o:{}),n)},t.prototype.processStyles=function(t,e,n){var o;return(void 0===n&&(n={}),"string"==typeof t)?(this.styleWatcher.removeListeners(),t):this.styleWatcher.setDataValues(e3(e3({},t.style),null!==(o=e.style)&&void 0!==o?o:{}),n)},t}(),e8=(cL=function(t,e){return(cL=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cL(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nt=function(){return(nt=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ne=e1(),nn=function(t){return(0,tw.isArray)(t)?t[t.length-1]:t},no=function(t){function e(e,n){void 0===n&&(n={});var o=this,r=new e9(void 0,{em:n.em});return(o=t.call(this,e,nt(nt({},n),{dataResolverWatchers:r}))||this).views=[],o.collectionsStateMap={},r.bindModel(o),o.dataResolverWatchers=r,o.em=n.em,o.opt=n,o}return e8(e,t),e.prototype.get=function(e,n){return(null==n?void 0:n.skipResolve)?this.dataResolverWatchers.getValueOrResolver("props")[e]:t.prototype.get.call(this,e)},e.prototype.set=function(e,n,o){var r,i,a,s,l={skipWatcherUpdates:!1,fromDataSource:!1};"object"==typeof e?(a=e,s=n||l):"string"==typeof e?((r={})[e]=n,a=r,s=o||l):(a={},s=l),this.dataResolverWatchers=null!==(i=this.dataResolverWatchers)&&void 0!==i?i:s.dataResolverWatchers;var c=this.dataResolverWatchers.addProps(a,s);return t.prototype.set.call(this,c,s)},e.prototype.parseStyle=function(t){return ne.parseStyle(t)},e.prototype.extendStyle=function(t){return nt(nt({},this.getStyle("",{skipResolve:!0})),t)},e.prototype.getStyle=function(t,e){void 0===e&&(e={});var n=this.get("style"),o=(0,tw.isString)(n)?this.parseStyle(n):(0,tw.isObject)(n)?nt({},n):{};delete o.__p;var r=!t||""===t||(0,tw.isObject)(t);if(!e.skipResolve)return r?o:o[t];var i=this.dataResolverWatchers.getValueOrResolver("styles",o);return r?i:i[t]},e.prototype.setStyle=function(t,e){var n=this;void 0===t&&(t={}),void 0===e&&(e={}),(0,tw.isString)(t)&&(t=this.parseStyle(t));var o=this.getStyle("",{skipResolve:!0});e.partial||e.avoidStore?(e.avoidStore=!0,t.__p=!0):delete t.__p;var r=nt({},t),i=nt({},r);(0,tw.keys)(i).forEach(function(t){if(""===i[t]){delete i[t];return}}),this.set({style:i},e),i=this.attributes.style;var a=Object.keys((0,t_.shallowDiff)(o,r)).reduce(function(t,e){var n;return nt(nt({},t),((n={})[e]=i[e],n))},{});return delete a.__p,(0,tw.keys)(a).forEach(function(t){var o=n.em;!e.noEvent&&(n.trigger("change:style:".concat(t)),o&&(o.trigger("styleable:change",n,t,e),o.trigger("styleable:change:".concat(t),n,t,e)))}),i},e.prototype.getView=function(t){var e=this.views,n=this.em,o=t||(null==n?void 0:n.getCurrentFrameModel());return o?e.find(function(t){return t.frameView===o.view}):e[0]},e.prototype.setView=function(t){var e=this.views;e.includes(t)||e.push(t)},e.prototype.removeView=function(t){var e=this.views;e.splice(e.indexOf(t),1)},e.prototype.updateView=function(){this.views.forEach(function(t){return t.updateStyles()})},e.prototype.addStyle=function(t,e,n){var o;void 0===e&&(e=""),void 0===n&&(n={}),"string"==typeof t?((o={})[t]=e,t=o):n=e||{},n.addStyle=t,t=this.extendStyle(t),this.setStyle(t,n)},e.prototype.removeStyle=function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},e.prototype.styleToString=function(t){void 0===t&&(t={});var e=[],n=t.style||this.getStyle(t),o=t.important,r=function(t){var r=(0,tw.isArray)(o)?o.indexOf(t)>=0:o;if("__"===t.substring(0,2))return"continue";var i=n[t];((0,tw.isArray)(i)?i:[i]).forEach(function(n){var o="".concat(n).concat(r?" !important":"");o&&e.push("".concat(t,":").concat(o,";"))})};for(var i in n)r(i);return e.join("")},e.prototype.getSelectors=function(){return this.get("selectors")||this.get("classes")},e.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},e.prototype.onCollectionsStateMapUpdate=function(t){this.collectionsStateMap=t,this.dataResolverWatchers.onCollectionsStateMapUpdate()},e.prototype.clone=function(t,e){var n=this.dataResolverWatchers.getProps(this.attributes),o=nt(nt({},n),t),r=nt(nt({},this.opt),e);return new this.constructor(o,r)},e.prototype.toJSON=function(e,n){if(null==e?void 0:e.fromUndo)return nt({},t.prototype.toJSON.call(this,e));var o=nt(nt({},this.attributes),n);return this.dataResolverWatchers.getProps(o)},e}(tT.Kx),nr=(cI=function(t,e){return(cI=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cI(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ni=function(t){function e(n,o){void 0===o&&(o={});var r=t.call(this,n,o)||this,i=o.config,a=r.get("name"),s=r.get("label");a?s||r.set("label",a):r.set("name",s);var l=r.get("name"),c=(void 0===i?{}:i).escapeName,u=c?c(l):e.escapeName(l);return r.set("name",u),r.em=o.em,r}return nr(e,t),e.prototype.defaults=function(){return{name:"",label:"",type:1,active:!0,private:!1,protected:!1,_undo:!0}},e.prototype.isId=function(){return 2===this.get("type")},e.prototype.isClass=function(){return 1===this.get("type")},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.escape,n=this.get("name"),o="";switch(this.get("type")){case 1:o=".";break;case 2:o="#"}return o+(e?e(n):n)},e.prototype.toString=function(){return this.getFullName()},e.prototype.getName=function(){return this.get("name")||""},e.prototype.getLabel=function(){return this.get("label")||""},e.prototype.setLabel=function(t){return this.set("label",t)},e.prototype.getActive=function(){return!!this.get("active")},e.prototype.setActive=function(t){return this.set("active",t)},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=this.em,n=tT.Kx.prototype.toJSON.call(this,[t]),o=(0,tw.result)(this,"defaults");if(null==e?void 0:e.getConfig().avoidDefaults){(0,tw.forEach)(o,function(t,e){n[e]===t&&delete n[e]}),n.label===n.name&&delete n.label;var r=(0,tw.keys)(n).length;1===r&&n.name&&(n=n.name),2===r&&n.name&&n.type&&(n=this.getFullName())}return n},e.escapeName=function(t){return"".concat(t).trim().replace(/\s+/g,"-")},e.TYPE_CLASS=1,e.TYPE_ID=2,e}(tT.Kx);ni.prototype.idAttribute="name";var na=(cN=function(t,e){return(cN=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cN(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ns=function(t,e){return t.reduce(function(n,o,r){return n.concat(ns(t.slice(r+1),"".concat(e).concat(o)))},[e])},nl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return na(e,t),e.prototype.modelId=function(t){return"".concat(t.name,"_").concat(t.type||ni.TYPE_CLASS)},e.prototype.getStyleable=function(){return(0,tw.filter)(this.models,function(t){return t.getActive()&&!t.get("private")})},e.prototype.getValid=function(t){var e=(void 0===t?{}:t).noDisabled;return(0,tw.filter)(this.models,function(t){return!t.get("private")}).filter(function(t){return e?t.get("active"):1})},e.prototype.getFullString=function(t,e){void 0===e&&(e={});var n=[];return(t||this).forEach(function(t){return n.push(t.getFullName(e))}),e.sort&&n.sort(),n.join("").trim()},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.combination,n=t.array,o=[],r=this.map(function(e){return e.getFullName(t)}).sort();return e?r.forEach(function(t,e){o=o.concat(ns(r.slice(e+1),t))}):o=r,n?o:e?o.join(","):o.join("")},e}(tT.pM);nl.prototype.model=ni;var nc=(cR=function(t,e){return(cR=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cR(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nu=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},np=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nc(e,t),e.prototype.defaults=function(){return{id:"",label:"",open:!0,attributes:{}}},e.prototype.getId=function(){return this.get("id")},e.prototype.getLabel=function(){return this.get("label")},e}(tT.Kx);function nd(t){var e=new Set,n=new Map,o={items:[]};return t.forEach(function(t){var r=t.category;if(r){e.add(r);var i=n.get(r);i?i.push(t):n.set(r,[t])}else o.items.push(t)}),nu(nu([],Array.from(e).map(function(t){return{category:t,items:n.get(t)||[]}}),!0),[o],!1)}var nf=(cV=function(t,e){return(cV=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cV(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nh="category",ng=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nf(e,t),e.prototype.initCategory=function(t){var e=t.get(nh),n=e instanceof np;if(e&&!n){(0,tw.isString)(e)?e={id:e,label:e}:(0,t_.isObject)(e)&&!e.id&&(e.id=e.label);var o=this.getCategories().add(e);return t.set(nh,o,{silent:!0}),o}if(n){var o=e;return this.getCategories().add(o),o}},e}(tT.pM),nv=(cF=function(t,e){return(cF=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cF(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ny=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e,n)||this,r=n.events,i=n.em,a=null==r?void 0:r.update;return i&&a&&o.on("change",function(t,e){return i.trigger(a,{category:t,changes:t.changedAttributes(),options:e})}),o}return nv(e,t),e.prototype.add=function(e,n){return((0,tw.isArray)(e)?e:[e]).forEach(function(t){return t&&(t.id=(0,t_.normalizeKey)("".concat(t.id)))}),t.prototype.add.call(this,e,n)},e.prototype.get=function(e){return t.prototype.get.call(this,(0,tw.isString)(e)?(0,t_.normalizeKey)(e):e)},e}(tT.pM);ny.prototype.model=np,(cH=pQ||(pQ={})).select="trait:select",cH.value="trait:value",cH.categoryUpdate="trait:category:update",cH.custom="trait:custom",cH.all="trait";let nm=pQ;var nb=(cU=function(t,e){return(cU=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cU(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nw=function(){return(nw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},n_=function(t){function e(e,n){var o=t.call(this,e)||this,r=o.attributes,i=r.target,a=r.name;return o.get("id")||o.set("id",a),i&&o.setTarget(i),o.em=n,o}return nb(e,t),e.prototype.defaults=function(){return{type:"text",label:"",name:"",unit:"",step:1,value:"",default:"",placeholder:"",category:"",changeProp:!1,options:[]}},Object.defineProperty(e.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){var t=this.get("category");return t instanceof np?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){return this.target},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeProp",{get:function(){return!!this.get("changeProp")},enumerable:!1,configurable:!0}),e.prototype.setTarget=function(t){if(t){var e=this.attributes,n=e.name,o=e.changeProp,r=e.value,i=e.getValue;this.target=t,this.unset("target"),this.listenTo(t,o?"change:".concat(n):"change:attributes:".concat(n),this.targetUpdated);var a=r||(i?void 0:this.getValue());(0,tw.isUndefined)(a)||this.set({value:a},{silent:!0})}},e.prototype.getId=function(){return this.get("id")},e.prototype.getType=function(){return this.get("type")},e.prototype.getName=function(){return this.get("name")},e.prototype.getLabel=function(t){void 0===t&&(t={});var e,n=t.locale,o=this.getId(),r=this.get("label")||this.getName();return(void 0===n||n)&&(null===(e=this.em)||void 0===e?void 0:e.t("traitManager.traits.labels.".concat(o)))||r},e.prototype.getValue=function(t){return this.getTargetValue(t)},e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={});var o=this.component,r=this.em,i=e.partial,a={},s=this.attributes.setValue;if(s){s({value:t,component:o,editor:null==r?void 0:r.getEditor(),trait:this,partial:!!i,options:e,emitUpdate:function(){return n.targetUpdated()}});return}i&&(a.avoidStore=!0),this.setTargetValue(t,a)},e.prototype.getDefault=function(){return this.get("default")},e.prototype.getOptions=function(){return this.get("options")||[]},e.prototype.getOption=function(t){var e=this,n=(0,t_.isDef)(t)?t:this.getValue();return this.getOptions().filter(function(t){return e.getOptionId(t)===n})[0]},e.prototype.getOptionId=function(t){return t.id||t.value},e.prototype.getOptionLabel=function(t,e){void 0===e&&(e={});var n,o=e.locale,r=(0,tw.isString)(t)?this.getOption(t):t,i=this.getOptionId(r),a=r.label||r.name||i,s=this.getName();return(void 0===o||o)&&(null===(n=this.em)||void 0===n?void 0:n.t("traitManager.traits.options.".concat(s,".").concat(i)))||a},e.prototype.getCategoryLabel=function(t){void 0===t&&(t={});var e=this.em,n=this.category,o=t.locale,r=null==n?void 0:n.getId(),i=null==n?void 0:n.getLabel();return(void 0===o||o)&&(null==e?void 0:e.t("traitManager.categories.".concat(r)))||i||""},e.prototype.runCommand=function(){var t=this.em,e=this.attributes.command;if(e&&t)return(0,tw.isString)(e)?t.Commands.run(e):e(t.Editor,this)},e.prototype.props=function(){return this.attributes},e.prototype.targetUpdated=function(){var t=this.component,e=this.em,n=this.getTargetValue({useType:!0});this.set({value:n},{fromTarget:1});var o={trait:this,component:t,value:n};t.trigger(nm.value,o),null==e||e.trigger(nm.value,o),null==e||e.trigger("trait:update",o)},e.prototype.getTargetValue=function(t){void 0===t&&(t={});var e,n,o=this.component,r=this.em,i=this.getName(),a=this.get("getValue"),s=t.skipResolve;if(a?n=a({editor:null==r?void 0:r.getEditor(),trait:this,component:o}):this.changeProp?(n=o.get(i),s&&(n=o.dataResolverWatchers.getValueOrResolver("props",((e={})[i]=n,e))[i])):n=o.getAttributes({skipResolve:s})[i],t.useType&&"checkbox"===this.getType()){var l=this.attributes,c=l.valueTrue,u=l.valueFalse;(0,tw.isUndefined)(c)||c!==n?(0,tw.isUndefined)(u)||u!==n||(n=!1):n=!0}return(0,tw.isUndefined)(n)?"":n},e.prototype.setTargetValue=function(t,e){void 0===e&&(e={});var n,o=this.component,r=this.attributes,i=this.getName();if(!(0,tw.isUndefined)(t)){var a=t;if("false"===t?a=!1:"true"===t&&(a=!0),"checkbox"===this.getType()){var s=r.valueTrue,l=r.valueFalse;a&&!(0,tw.isUndefined)(s)&&(a=s),a||(0,tw.isUndefined)(l)||(a=l)}var c=((n={})[i]=a,n);c.__p=e.avoidStore?null:void 0,this.changeProp?o.set(c,e):o.addAttributes(c,e)}},e.prototype.setValueFromInput=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var o={value:t};this.set(o,nw(nw({},n),{avoidStore:1})),e&&(this.set("value","",n),this.set(o,n))},e.prototype.getInitValue=function(){var t,e=this.component,n=this.getName();if(e){var o=e.get("attributes");t=this.changeProp?e.get(n):o[n]}return t||this.get("value")||this.get("default")},e}(tT.Kx),nC=function(){function t(t){void 0===t&&(t={}),this.config=t}return t.prototype.build=function(t,e){return(0,tw.isString)(t)?this.buildFromString(t,e):new n_(t,e)},t.prototype.buildFromString=function(t,e){var n={name:t,type:"text"};return"target"===t&&(n.type="select",n.default=!1,n.options=this.config.optionsTarget),new n_(n,e)},t}(),nx=(cB=function(t,e){return(cB=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cB(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nS=function(t){function e(e,n){var o=t.call(this,e)||this;o.categories=new ny;var r=n.em;o.em=r,o.categories=new ny([],{em:r,events:{update:nm.categoryUpdate}}),o.on("add",o.handleAdd),o.on("reset",o.handleReset);var i=o.module,a=null==i?void 0:i.getConfig();return o.tf=new nC(a),o}return nx(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),e.prototype.getCategories=function(){return this.categories},e.prototype.handleReset=function(t,e){var n=(void 0===e?{}:e).previousModels;(void 0===n?[]:n).forEach(function(t){return t.trigger("remove")})},e.prototype.handleAdd=function(t){t.em=this.em;var e=this.target;e&&(t.target=e),this.initCategory(t)},e.prototype.setTarget=function(t){this.target=t,this.models.forEach(function(e){return e.setTarget(t)})},e.prototype.add=function(e,n){if(void 0!=e){var o=this.target,r=this.em;if((0,tw.isArray)(e)){for(var i=[],a=0,s=e.length;a<s;a++){var l=e[a];i[a]=l instanceof n_?l:this.tf.build(l,r),i[a].setTarget(o)}return t.prototype.add.call(this,i,n)}var c=e instanceof n_?e:this.tf.build(e,r);return c.setTarget(o),t.prototype.add.call(this,c,n)}},e}(ng),nO=(cz=function(t,e){return(cz=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cz(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nT=function(){return(nT=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nP=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},nE=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},nk=function(t,e){return(void 0===e&&(e=[]),t)?(((0,tw.isArray)(t)||(0,tw.isFunction)(t.map)?t:[t]).map(function(t){e.push(t.getId()),nk(t.components().models,e)}),e):[]},nA=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={}),n.visitedCmps=n.visitedCmps||{};var o=n.visitedCmps,r=n.updateOptions||{};return((0,tw.isArray)(t)?t:[t]).map(function(t){var i=t.attributes,a=void 0===i?{}:i,s=t.components,l=t.tagName,c=t.style,u=a.id,p=(a.draggable,nP(a,["id","draggable"])),d=t;if(u){if(o[u])o[u].push(d),u=nW.getNewId(e),d.attributes.id=u;else if(o[u]=[],e[u]){d=e[u];var f=r.onAttributes,h=r.onStyle,g=d;l&&g.set({tagName:l},nT(nT({},n),{silent:!0})),f?f({item:t,component:g,attributes:p,options:n}):(0,tw.keys)(p).length&&g.addAttributes(p,nT({},n)),h?h({item:t,component:g,style:c,options:n}):(0,tw.keys)(c).length&&g.addStyle(c,n)}}var v=(0,tw.isFunction)(d.components)?d:null;if(s){var y=nA(s,e,n);v?v.components().reset(y,n):d.components=y}else v&&v.components().reset([],n);return d})},nj=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.opt=n,o.listenTo(o,"add",o.onAdd),o.listenTo(o,"remove",o.removeChildren),o.listenTo(o,"reset",o.resetChildren);var r=n.em,i=n.config;return o.config=i,o.em=r,o.domc=n.domc||(null==r?void 0:r.Components),o}return nO(e,t),Object.defineProperty(e.prototype,"events",{get:function(){var t;return null===(t=this.domc)||void 0===t?void 0:t.events},enumerable:!1,configurable:!0}),e.prototype.resetChildren=function(t,e){var n=this;void 0===e&&(e={});var o=this,r=e.previousModels||[],i=r.filter(function(e){return!t.get(e.cid)}),a=nk(t),s=nk(r).filter(function(t){return a.indexOf(t)>=0});e.keepIds=(e.keepIds||[]).concat(s),i.forEach(function(t){return n.removeChildren(t,o,e)}),t.each(function(t){return n.onAdd(t)})},e.prototype.resetFromString=function(t,n){void 0===t&&(t=""),void 0===n&&(n={}),n.keepIds=nk(this);var o,r=this.domc,i=this.em,a=this.parent,s=(null==r?void 0:r.allById())||{},l=this.parseString(t,nT(nT({},n),{cloneRules:!0})),c=nT({skipViewUpdate:!0},n),u=nA(l,s,c);e.cloneCssRules(i,c.visitedCmps),this.reset(u,n),null==i||i.trigger("component:content",a,n,t),null===(o=a.__checkInnerChilds)||void 0===o||o.call(a)},e.prototype.removeChildren=function(t,e,n){var o=this;if(void 0===n&&(n={}),t){var r=this.domc,i=this.em,a=n.temporary||n.fromUndo;if(t.prevColl=this,!a){var s=t.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=0>(n.keepIds||[]).indexOf(s),p=r?r.allById():{};delete p[s];var d=u?c.remove(c.filter(function(t){return t.getSelectors().getFullString()==="#".concat(s)}),n):[];l.remove(d.map(function(t){return t.getSelectors().at(0)})),!t.opt.temporary&&(i.Commands.run("core:component-style-clear",{target:t}),t.views.forEach(function(e){e.scriptContainer&&t.emitWithEditor(tQ.I.scriptUnmount,{component:t,view:e,el:e.el})}),t.removed(),t.trigger("removed"),i.trigger(tQ.I.remove,t),r&&ek(t)&&ej(t)&&r.symbols.__trgEvent(r.events.symbolInstanceRemove,{component:t},!0));var f=t.components();f.forEach(function(t){eq(t,t,f,nT(nT({},n),{skipRefsUp:!0})),o.removeChildren(t,e,n)})}var h=t.components();if(i.stopListening(h),i.stopListening(t),i.stopListening(t.get("classes")),t.__postRemove(),!t.opt.temporary){var g=function(t){t.emitWithEditor(tQ.I.removed,t,{removeOptions:n}),t.components().forEach(function(t){return g(t)})};g(t)}}},e.prototype.model=function(t,e){var n,o=e.collection.opt,r=o.em,i=r.Components.componentTypes;e.em=r,e.config=o.config,e.componentTypes=i,e.domc=o.domc;for(var a=0;a<i.length;a++)if(i[a].id==t.type){n=i[a].model;break}return!n&&(n=i[i.length-1].model,r&&t.type&&r.logWarning("Component type '".concat(t.type,"' not found"),{attrs:t,options:e})),new n(t,e)},e.prototype.parseString=function(t,n){void 0===n&&(n={});var o=this.em,r=this.domc,i=this.parent,a=null==i?void 0:i.is("wrapper"),s=n.asDocument&&a,l=o.Css,c=o.Parser.parseHtml(t,nT({asDocument:s},n.parserOptions)),u=c.html;if(a&&c.doctype){var p=c.html||{},d=p.components,f=nP(p,["components"]),h=c.head||{},g=h.components,v=nP(h,["components"]);u=void 0===d?[]:d,i.set(f,n),i.head.set(v,n),i.head.components(g,n),i.docEl.set(c.root,n),i.set({doctype:c.doctype})}var y=nW.checkId(u,c.css,r.componentsById,n);if(n.cloneRules&&e.cloneCssRules(o,y.updatedIds),c.css&&l&&!n.temporary){n.at;var m=nP(n,["at"]);l.addCollection(c.css,nT(nT({},m),{extend:1}))}return u},e.prototype.add=function(e,n){var o=this;if(void 0===n&&(n={}),void 0!=e){n.keepIds=nE(nE([],n.keepIds||[],!0),nk(n.previousModels),!0),(0,tw.isString)(e)?e=this.parseString(e,n):(0,tw.isArray)(e)&&(e=nE([],e,!0)).forEach(function(t,r){if((0,tw.isString)(t)){var i=o.parseString(t,n);e[r]=(0,tw.isArray)(i)&&!i.length?null:i}});var r=((0,tw.isArray)(e)?e:[e]).filter(Boolean).map(function(t){return o.processDef(t)});return e=(0,tw.isArray)(e)?(0,tw.flatten)(r,1):r[0],t.prototype.add.call(this,e,n)}},e.prototype.processDef=function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,o=(void 0===n?{}:n).processor,r=t;if(o){var i=o(r=nT({},r));i&&((0,tw.each)(r,function(t,e){return delete r[e]}),(0,tw.extend)(r,i))}if(r.$$typeof&&"object"==typeof r.props){(r=nT({},r)).props=nT({},r.props);var a=e.Components,s=e.Parser.parserHtml;(0,tw.each)(r,function(t,e){(0,tw.includes)(["props","type"],e)||delete r[e]});var l=r.props,c=l.children;delete l.children,delete r.props;var u=s.splitPropsFromAttr(l);r.attributes=u.attrs,c&&(r.components=c),r.type?a.getType(r.type)||(r.tagName=r.type,delete r.type):r.type="textnode",(0,tw.extend)(r,u.props)}return r},e.prototype.onAdd=function(t,e,n){void 0===n&&(n={});var o=this.domc,r=this.em,i=r.config.avoidInlineStyle;if(o&&o.Component.ensureInList(t),!i&&r.config.forceClass&&!n.temporary){var a=t.getStyle();if(!(0,tw.isEmpty)(a)){var s=t.cid;r.Css.setClassRule(s,a),t.setStyle({}),t.addClass(s)}}if(t.__postAdd({recursive:!0}),r&&!n.temporary){var l=function(t){r.trigger(tQ.I.add,t,n),t.components().forEach(function(t){return l(t)})};l(t),o&&ek(t)&&ej(t)&&o.symbols.__trgEvent(o.events.symbolInstanceAdd,{component:t},!0)}},e.cloneCssRules=function(t,e){void 0===e&&(e={});var n=t.Css;Object.keys(e).forEach(function(t){var o=e[t];if(o.length){var r=(n.getRules("#".concat(t))||[]).filter(function(t){return!(0,tw.isEmpty)(t.attributes.style)});if(r.length){var i=n.getAll();o.forEach(function(t){r.forEach(function(e){var n=e.clone();n.set("selectors",["#".concat(t.attributes.id)]),i.add(n)})})}}})},e}(tT.pM),nM=(cW=function(t,e){return(cW=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cW(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nD=function(){return(nD=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nL=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},nI=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},nN=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},nR=function(t){return!!(null==t?void 0:t.getConfig().avoidInlineStyle)},nV="component:drag",nF="__symbols",nH="__symbol",nU="__symbol_ovrd",nB=tQ.I.update,nz=tQ.I.updateInside;let nW=function(t){function e(n,o){void 0===n&&(n={});var r=this,i=o.em;r=t.call(this,n,o)||this,(0,tw.bindAll)(r,"__upSymbProps","__upSymbCls","__upSymbComps","syncOnComponentChange");var a=r.parent(),s=null==a?void 0:a.attributes,l=r.get("propagate");if(l&&r.set("propagate",(0,tw.isArray)(l)?l:[l]),s&&s.propagate&&!l){var c={},u=s.propagate;u.forEach(function(t){return c[t]=a.get(t)}),c.propagate=u,r.set(nD(nD({},c),n))}o&&o.config&&o.config.voidElements.indexOf(r.get("tagName"))>=0&&r.set("void",!0),o.em=i,r.opt=o,r.em=i,r.config=o.config||{};var p=nD(nD({},(0,tw.result)(r,"defaults").attributes||{}),r.get("attributes")||{}),d=r.dataResolverWatchers.getValueOrResolver("attributes",p);if(r.setAttributes(d),r.ccid=e.createId(r,o),r.preInit(),r.initClasses(),r.initComponents(),r.initTraits(),r.initToolbar(),r.initScriptProps(),r.listenTo(r,"change:script",r.scriptUpdated),r.listenTo(r,"change:tagName",r.tagUpdated),r.listenTo(r,"change:attributes",r.attrUpdated),r.listenTo(r,"change:attributes:id",r._idUpdated),r.on("change:toolbar",r.__emitUpdateTlb),r.on("change",r.__onChange),r.on(nz,r.__propToParent),r.set("status",""),r.views=[],["classes","traits","components"].forEach(function(t){var e="add remove reset ".concat("components"!==t?"change":"");r.listenTo(r.get(t),e.trim(),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return r.emitUpdate.apply(r,nI([t],e,!1))})}),!o.temporary){var f=i&&i.Css,h=r.attributes,g=h.styles,v=h.type;g&&f&&f.addCollection(g,{avoidUpdateStyle:!0},{group:"cmp:".concat(v)}),r._moveInlineStyleToRule(),r.__postAdd(),r.init(),eA(r)&&eM(r),null==i||i.trigger(tQ.I.create,r,o)}return nR(i)&&r.dataResolverWatchers.disableStyles(),r}return nM(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){var t;return(t={tagName:"div",type:"",name:"",removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,"stylable-require":"","style-signature":"",unstylable:"",highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,void:!1,state:"",status:"",content:"",icon:"",style:"",styles:"",classes:"",script:"","script-props":"","script-export":"",attributes:{},traits:["id","title"],propagate:"",dmode:"",toolbar:null,delegate:null})[nH]=0,t[nF]=0,t[nU]=0,t._undo=!0,t._undoexc=["status","open"],t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.get("tagName")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classes",{get:function(){return this.get("classes")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"traits",{get:function(){return this.get("traits")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){var t;return null!==(t=this.get("content"))&&void 0!==t?t:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolbar",{get:function(){return this.get("toolbar")||[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resizable",{get:function(){return this.get("resizable")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"delegate",{get:function(){return this.get("delegate")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this.get("locked")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this.opt.frame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){var t;return null===(t=this.frame)||void 0===t?void 0:t.getPage()},enumerable:!1,configurable:!0}),e.prototype.getType=function(){return this.get("type")||"default"},e.prototype.preInit=function(){},e.prototype.init=function(){},e.prototype.updated=function(t,e,n){},e.prototype.removed=function(){},e.prototype.onCollectionsStateMapUpdate=function(e){var n;t.prototype.onCollectionsStateMapUpdate.call(this,e),null===(n=this._getStyleRule())||void 0===n||n.onCollectionsStateMapUpdate(e),this.components().forEach(function(t){return t.onCollectionsStateMapUpdate(e)})},e.prototype.syncComponentsCollectionState=function(){this.stopListening(this.components(),"add remove reset",this.syncOnComponentChange),this.listenTo(this.components(),"add remove reset",this.syncOnComponentChange),this.components().forEach(function(t){return t.syncComponentsCollectionState()})},e.prototype.stopSyncComponentCollectionState=function(){this.stopListening(this.components(),"add remove reset",this.syncOnComponentChange),this.collectionsStateMap={},this.components().forEach(function(t){return t.stopSyncComponentCollectionState()})},e.prototype.syncOnComponentChange=function(t,e,n){var o=this;if(this.collectionsStateMap&&Object.keys(this.collectionsStateMap).length){var r=n||e||{};n?r.add?(t.syncComponentsCollectionState(),t.onCollectionsStateMapUpdate(this.collectionsStateMap)):t.stopSyncComponentCollectionState():((r.previousModels||[]).forEach(function(t){return t.stopSyncComponentCollectionState()}),this.components().forEach(function(t){t.syncComponentsCollectionState(),t.onCollectionsStateMapUpdate(o.collectionsStateMap)}))}},e.prototype.__postAdd=function(t){void 0===t&&(t={});var e=this.em,n=null==e?void 0:e.UndoManager,o=this.components();n&&!this.__hasUm&&(n.add(o),n.add(this.getSelectors()),this.__hasUm=!0),t.recursive&&o.map(function(e){return e.__postAdd(t)})},e.prototype.__postRemove=function(){var t=this.em,e=null==t?void 0:t.UndoManager;e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)},e.prototype.__onChange=function(t,e){var n=this,o=this.changedAttributes()||{};(0,tw.keys)(o).forEach(function(t){return n.emitUpdate(t)}),["status","open","toolbar","traits"].forEach(function(t){return delete o[t]}),(0,t_.isEmptyObj)(o)||(this.__changesUp(e,{changed:o}),this.__propSelfToParent({component:this,changed:o,options:e}))},e.prototype.__onStyleChange=function(t,e){var n=this,o=this.collectionsStateMap;if(this.em&&(null==e||!e.noEvent)){var r=(0,tw.keys)(t),i={style:t};this.emitWithEditor(tQ.I.styleUpdate,this,i),r.forEach(function(t){return n.emitWithEditor("".concat(tQ.I.styleUpdateProperty).concat(t),n,i)});var a=Object.keys(o).filter(function(t){return t!==p$.rootData});0!==a.length&&a.every(function(t){var e=o[t];return e.currentIndex===e.startIndex})&&eN(this).forEach(function(e){Object.keys(e.collectionsStateMap).every(function(t){return a.includes(t)})&&e.addStyle(nD({},t),{noEvent:!0})})}},e.prototype.__changesUp=function(t,e){var n=this;void 0===e&&(e={});var o=this.em;[this.frame,o].forEach(function(o){null==o||o.changesUp(t,nD({component:n,options:t},e))})},e.prototype.__propSelfToParent=function(t){this.trigger(nB,t),this.__propToParent(t)},e.prototype.__propToParent=function(t){var e=this.parent();e&&e.trigger(nz,t)},e.prototype.__emitUpdateTlb=function(){this.emitUpdate("toolbar")},e.prototype.__getAllById=function(){var t=this.em;return t?t.Components.allById():{}},e.prototype.__upSymbProps=function(t,e){void 0===e&&(e={}),eH(this,e)},e.prototype.__upSymbCls=function(t,e,n){void 0===n&&(n={}),e$(this,n)},e.prototype.__upSymbComps=function(t,e,n){eq(this,t,e,n)},e.prototype.__onDestroy=function(){},e.prototype.is=function(t){return!(this.get("type")!=t)},e.prototype.props=function(){return this.attributes},e.prototype.index=function(){var t=this.collection;return t?t.indexOf(this):0},e.prototype.setDragMode=function(t){return this.set("dmode",t)},e.prototype.getDragMode=function(){return this.get("dmode")||""},e.prototype.setSymbolOverride=function(t,e){var n,o;void 0===e&&(e={}),this.set(((n={})[nU]=null!==(o=(0,tw.isString)(t)?[t]:t)&&void 0!==o?o:0,n),e)},e.prototype.getSymbolOverride=function(){return this.get(nU)},e.prototype.find=function(t){var e,n=[],o=null===(e=this.view)||void 0===e?void 0:e.$el.find(t);return null==o||o.each(function(t){var e=o.eq(t).data("model");e&&n.push(e)}),n},e.prototype.findType=function(t){var e=[],n=function(o){return o.forEach(function(o){o.is(t)&&e.push(o),n(o.components())})};return n(this.components()),e},e.prototype.findFirstType=function(t){return this.findType(t).at(0)},e.prototype.closest=function(t){var e,n=null===(e=this.view)||void 0===e?void 0:e.$el.closest(t);return(null==n?void 0:n.length)?n.data("model"):void 0},e.prototype.closestType=function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e},e.prototype.contains=function(t){var e=!1;if(!t)return e;var n=function(o){e||o.forEach(function(o){o===t&&(e=!0),e||n(o.components())})};return n(this.components()),e},e.prototype.tagUpdated=function(){this.trigger("rerender")},e.prototype.replaceWith=function(t,e){void 0===e&&(e={});var n=this.collection,o=n.indexOf(this);n.remove(this);var r=n.add(t,nD(nD({},e),{at:o}));return(0,tw.isArray)(r)?r:[r]},e.prototype.attrUpdated=function(t,e,n){var o=this;void 0===n&&(n={});var r=this.get("attributes"),i=r.class;i&&this.setClass(i),delete r.class;var a=r.style;a&&this.setStyle(a,n),delete r.style;var s=nD({},this.previous("attributes")),l=(0,t_.shallowDiff)(s,this.get("attributes"));(0,tw.keys)(l).forEach(function(t){var e,r="attributes:".concat(t);o.trigger("change:".concat(r),o,l[t],n),null===(e=o.em)||void 0===e||e.trigger("".concat(nB,":").concat(r),o,l[t],n)})},e.prototype.setAttributes=function(t,e){return void 0===e&&(e={skipWatcherUpdates:!1,fromDataSource:!1}),this.set("attributes",nD({},t),e),this},e.prototype.addAttributes=function(t,e){void 0===e&&(e={});var n=this.dataResolverWatchers.getValueOrResolver("attributes",this.getAttributes({noClass:!0,noStyle:!0}));return this.setAttributes(nD(nD({},n),t),e)},e.prototype.removeAttributes=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var n=Array.isArray(t)?t:[t],o=this.getAttributes();return n.map(function(t){return delete o[t]}),this.setAttributes(o,e)},e.prototype.getStyle=function(e,n){var o=this.em,r=(0,tw.isString)(e),i=r?e:"",a=r?n:e,s=!!(null==a?void 0:a.skipResolve);if(nR(o)&&!(null==a?void 0:a.inline)){var l=o.get("state"),c=o.Css.getIdRule(this.getId(),nD({state:l},a));return(this.rule=c,c)?c.getStyle(i,{skipResolve:s}):{}}return t.prototype.getStyle.call(this,i,{skipResolve:s})},e.prototype.setStyle=function(e,n){var o=this;void 0===e&&(e={}),void 0===n&&(n={});var r=this.opt,i=this.em;if(!nR(i)||r.temporary||n.inline)e=t.prototype.setStyle.apply(this,arguments);else{var a=this.get("style")||{};e=(0,tw.isString)(e)?this.parseStyle(e):e,e=nD(nD({},a),e);var s=i.get("state"),l=i.Css,c=this.getStyle(nD(nD({},n),{skipResolve:!0}));this.rule=l.setIdRule(this.getId(),e,nD({state:s},n));var u=(0,t_.shallowDiff)(c,e);this.set("style","",{silent:!0}),(0,tw.keys)(u).forEach(function(t){return o.trigger("change:style:".concat(t))})}return r.temporary||this.__onStyleChange(n.addStyle||e,n),e},e.prototype.getAttributes=function(t){void 0===t&&(t={});var e=this.em,n=[],o=nD({},this.get("attributes")),r=(null==t?void 0:t.skipResolve)?this.dataResolverWatchers.getValueOrResolver("attributes",o):o,i=null==e?void 0:e.Selectors,a=this.getId();if(t.noClass?delete r.class:(this.classes.forEach(function(t){return n.push((0,tw.isString)(t)?t:t.getName())}),n.length&&(r.class=n.join(" "))),!t.noStyle){var s=this.getStyle({inline:!0});(0,t_.isObject)(s)&&!(0,t_.isEmptyObj)(s)&&(r.style=this.styleToString({inline:!0}))}if(!(0,tw.has)(r,"id")){var l=!1;(nR(e)||!(0,tw.isEmpty)(this.getStyle()))&&(l=!!(null==i?void 0:i.get(a,i.Selector.TYPE_ID))),(eA(this)||this.get("script-export")||this.get("script"))&&(l=!0),l&&(r.id=a)}return r},e.prototype.addClass=function(t){var e=this.em.Selectors.addClass(t);return this.classes.add(e)},e.prototype.setClass=function(t){return this.classes.reset(),this.addClass(t)},e.prototype.removeClass=function(t){var e=[];t=(0,tw.isArray)(t)?t:[t];var n=this.classes,o=ni.TYPE_CLASS;return t.forEach(function(t){t.split(" ").forEach(function(t){var r=n.where({name:t,type:o})[0];r&&e.push(n.remove(r))})}),e},e.prototype.getClasses=function(){var t=this.getAttributes().class;return t?t.split(" "):[]},e.prototype.initClasses=function(t,e,n){void 0===n&&(n={});var o=this.get("attributes")||{},r=o.class,i=nL(o,["class"]),a=[this,"change:classes",this.initClasses],s=this.get("classes")||r||[],l=(0,tw.isString)(s)?s.split(" "):s;this.stopListening.apply(this,a);var c=this.normalizeClasses(l),u=new nl([]);return this.set("classes",u,n),u.add(c),u.on("add remove reset",this.__upSymbCls),r&&c.length&&this.set("attributes",i),this.listenTo.apply(this,a),this},e.prototype.initComponents=function(){var t=[this,"change:components",this.initComponents];this.stopListening.apply(this,t);var e=new nj([],this.opt);e.parent=this;var n=this.get("components"),o=!this.opt.avoidChildren;return this.set("components",e),o&&n&&e.add((0,tw.isFunction)(n)?n(this):n,this.opt),e.on("add remove reset",this.__upSymbComps),this.listenTo.apply(this,t),this},e.prototype.initTraits=function(t){var e=this,n=this.em,o="change:traits";this.off(o,this.initTraits),this.__loadTraits();var r=nD({},this.get("attributes")),i=this.traits;i.each(function(t){var n=t.getName(),o=t.getInitValue();t.changeProp?(0,tw.isUndefined)(e.get(n))&&e.set(n,o):n&&o&&(r[n]=o)});var a=this.dataResolverWatchers.getValueOrResolver("attributes",r);return i.length&&this.setAttributes(a),this.on(o,this.initTraits),t&&n&&n.trigger("component:toggled"),this},e.prototype.initScriptProps=function(){if(!this.opt.temporary){var t="script-props",e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],o=this.get(t)||[],r=n.map(function(t){return"change:".concat(t)}).join(" "),i=o.map(function(t){return"change:".concat(t)}).join(" ");r&&this.off(r,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,e)}},e.prototype.__scriptPropsChange=function(t,e,n){void 0===n&&(n={}),n.avoidStore||this.trigger("rerender")},e.prototype.append=function(t,e){void 0===e&&(e={});var n=((0,tw.isArray)(t)?nI([],t,!0):[t]).map(function(t){return(0,tw.isString)(t)||t.collection&&t.collection.remove(t,{temporary:!0}),t});return this.components().add(n,nD({action:tQ.t.add},e))},e.prototype.components=function(t,e){void 0===e&&(e={});var n=this.get("components");return(0,tw.isUndefined)(t)?n:(n.reset(void 0,e),t?this.append(t,e):[])},e.prototype.getChildAt=function(t){return this.components().at(t||0)||void 0},e.prototype.getLastChild=function(){var t=this.components();return t.at(t.length-1)||null},e.prototype.empty=function(t){return void 0===t&&(t={}),this.components().reset(void 0,t),this},e.prototype.parent=function(t){void 0===t&&(t={});var e=this.collection||t.prev&&this.prevColl;return e?e.parent:void 0},e.prototype.parents=function(){var t=this.parent();return t?[t].concat(t.parents()):[]},e.prototype.scriptUpdated=function(){this.set("scriptUpdated",1)},e.prototype.initToolbar=function(){var t=this.em,e=t&&t.getConfig().stylePrefix||"";if(!this.get("toolbar")&&t){var n=[];this.collection&&n.push({label:t.getIcon("arrowUp"),command:function(t){return t.runCommand("core:component-exit",{force:1})}}),this.get("draggable")&&n.push({attributes:{class:"".concat(e,"no-touch-actions"),draggable:!0},label:t.getIcon("move"),command:"tlb-move"}),this.get("copyable")&&n.push({label:t.getIcon("copy"),command:"tlb-clone"}),this.get("removable")&&n.push({label:t.getIcon("delete"),command:"tlb-delete"}),this.set("toolbar",n)}},e.prototype.__loadTraits=function(t,e){void 0===e&&(e={});var n=t||this.traits;if(!(n instanceof nS)){n=(0,tw.isFunction)(n)?n(this):n;var o=new nS([],this.opt);o.setTarget(this),n.length&&o.add(n),this.set({traits:o},e)}return this},e.prototype.getTraits=function(){return this.__loadTraits(),nI([],this.traits.models,!0)},e.prototype.setTraits=function(t){var e=(0,tw.isArray)(t)?t:[t];return this.set({traits:e}),this.getTraits()},e.prototype.getTrait=function(t){return this.getTraits().filter(function(e){return e.get("id")===t||e.get("name")===t})[0]||null},e.prototype.updateTrait=function(t,e){var n,o=this.getTrait(t);return o&&o.set(e),null===(n=this.em)||void 0===n||n.trigger("component:toggled"),this},e.prototype.getTraitIndex=function(t){var e=this.getTrait(t);return e?this.traits.indexOf(e):-1},e.prototype.removeTrait=function(t){var e,n=this,o=((0,tw.isArray)(t)?t:[t]).map(function(t){return n.getTrait(t)}),r=this.traits,i=o.length?r.remove(o):[];return null===(e=this.em)||void 0===e||e.trigger("component:toggled"),(0,tw.isArray)(i)?i:[i]},e.prototype.addTrait=function(t,e){void 0===e&&(e={}),this.__loadTraits();var n,o=this.traits.add(t,e);return null===(n=this.em)||void 0===n||n.trigger("component:toggled"),(0,tw.isArray)(o)?o:[o]},e.prototype.normalizeClasses=function(t){var e=[],n=this.em,o=null==n?void 0:n.Selectors;return o?t.models?nI([],t.models,!0):(t.forEach(function(t){return e.push(o.add(t))}),e):[]},e.prototype.clone=function(t){void 0===t&&(t={});var e,n=this.em,o=this.dataResolverWatchers.getProps(this.attributes),r=nD({},this.opt),i=this.getId(),a=null==n?void 0:n.Css;o.components=[],o.classes=[],o.traits=[],ej(this)&&(t.symbol=!0),this.get("components").each(function(e,n){o.components[n]=e.clone(nD(nD({},t),{_inner:1}))}),this.get("traits").each(function(t,e){o.traits[e]=t.clone()}),this.get("classes").each(function(t,e){o.classes[e]=t.get("name")}),o.status="",r.collection=null,r.forCloning=!0;var s=new this.constructor(o,r),l="#".concat(s.getId());(a?a.getRules("#".concat(i)):[]).forEach(function(t){var e=t.clone();e.set("selectors",[l]),a.getAll().add(e)}),s.set(nF,0);var c=eD(this),u=eL(this);if(!t.symbol&&(c||u))s.set(nH,0),s.set(nF,0);else if(c){var p=null!==(e=eL(c))&&void 0!==e?e:[];c.set(nF,nI(nI([],p,!0),[s],!1)),eM(s)}else t.symbol&&(eE(this)?(this.set(nF,nI(nI([],u,!0),[s],!1)),s.set(nH,this),eM(s)):t.symbolInv?(this.set(nF,[s]),s.set(nH,this),[this,s].map(function(t){return eM(t)})):(s.set(nF,[this]),[this,s].map(function(t){return eM(t)}),this.set(nH,s)));var d="component:clone";return n&&n.trigger(d,s),this.trigger(d,s),s},e.prototype.getName=function(t){void 0===t&&(t={});var e=this.em,n=this.attributes,o=n.type,r=n.tagName,i=n.name,a=o||r,s=o?"":r,l="domComponents.names.",c=i&&(null==e?void 0:e.t("".concat(l).concat(i))),u=s&&(null==e?void 0:e.t("".concat(l).concat(s))),p=e&&(e.t("".concat(l).concat(o))||e.t("".concat(l).concat(r))),d=this.get("custom-name");return(t.noCustom?"":d)||c||i||u||(0,t_.capitalize)(s)||p||(0,t_.capitalize)(a)},e.prototype.setName=function(t,e){void 0===e&&(e={}),this.set("custom-name",t,e)},e.prototype.getIcon=function(){var t=this.get("icon");return t?t+" ":""},e.prototype.toHTML=function(t){void 0===t&&(t={});var e=t.tag||this.get("tagName");delete t.tag;var n=this.__attrToString(t),o=this.getInnerHTML(t),r=!o&&this.get("void"),i="<".concat(e).concat(n?" ".concat(n):"").concat(r?"/":"",">").concat(o);return r||(i+="</".concat(e,">")),i},e.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},e.prototype.__innerHTML=function(t){void 0===t&&(t={});var e=this.components();return e.length?e.map(function(e){return e.toHTML(t)}).join(""):this.content},e.prototype.__attrToString=function(t){void 0===t&&(t={});var e=[],n=t.attributes,o=this.getAttrToHTML(t);if(n&&((0,tw.isFunction)(n)?o=n(this,o)||{}:(0,t_.isObject)(n)&&(o=n)),t.withProps){var r=this.toJSON();(0,tw.forEach)(r,function(t,e){"_"!==e[0]&&0>["classes","attributes","components"].indexOf(e)&&(o["data-gjs-".concat(e)]=(0,tw.isArray)(t)||(0,t_.isObject)(t)?JSON.stringify(t):(0,tw.isBoolean)(t)?"".concat(t):t)})}for(var i in o){var a=o[i];if(!(0,tw.isUndefined)(a)&&null!==a){if((0,tw.isBoolean)(a))a&&e.push(i);else{var s="";if(t.altQuoteAttr&&(0,tw.isString)(a)&&a.indexOf('"')>=0)s="'".concat((0,t_.escapeAltQuoteAttrValue)(a),"'");else{var l=(0,tw.isString)(a)?(0,t_.escapeAttrValue)(a):a;s='"'.concat(l,'"')}e.push("".concat(i,"=").concat(s))}}}return e.join(" ")},e.prototype.getAttrToHTML=function(t){var e=this.getAttributes();return nR(this.em)&&(null==t?void 0:t.keepInlineStyle)!==!0&&delete e.style,e},e.prototype.toJSON=function(e){void 0===e&&(e={});var n=t.prototype.toJSON.call(this,e,{attributes:this.getAttributes()});if(delete n.dataResolverWatchers,delete n.attributes.class,delete n.toolbar,delete n.traits,delete n.status,delete n.open,delete n._undoexc,delete n.delegate,this.collectionsStateMap&&Object.getOwnPropertyNames(this.collectionsStateMap).length>0&&(delete n[nH],delete n[nU],delete n[nF]),!e.fromUndo){var o=n[nH],r=n[nF];r&&(0,tw.isArray)(r)&&(n[nF]=r.filter(function(t){return t}).map(function(t){return t.getId?t.getId():t})),o&&!(0,tw.isString)(o)&&(n[nH]=o.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(n),n},e.prototype.getChangedProps=function(t){var e=t||tx.Model.prototype.toJSON.apply(this),n=(0,tw.result)(this,"defaults");return(0,tw.forEach)(n,function(t,n){-1===["type"].indexOf(n)&&e[n]===t&&delete e[n]}),(0,tw.isEmpty)(e.type)&&delete e.type,(0,tw.forEach)(["attributes","style"],function(t){(0,tw.isEmpty)(n[t])&&(0,tw.isEmpty)(e[t])&&delete e[t]}),(0,tw.forEach)(["classes","components"],function(t){(!e[t]||(0,tw.isEmpty)(n[t])&&!e[t].length)&&delete e[t]}),e},e.prototype.getId=function(){var t,e,n,o=this.get("attributes")||{},r=(n=(e=function(t){var e=t.collectionsStateMap;if(!e)return!1;var n=Object.keys(e);if(!n.length)return!1;var o=eD(t);return!!o&&o!==t&&Object.keys(o.collectionsStateMap).every(function(t){return n.includes(t)})}(this))?(t=eD(this))?t.getId():"":null,{shouldSync:e,itemId:n}),i=r.shouldSync,a=r.itemId;return i&&(o.id=a),o.id||this.ccid||this.cid},e.prototype.setId=function(t,e){return this.addAttributes({id:t},e),this},e.prototype.getEl=function(t){var e=this.getView(t);return e&&e.el},e.prototype.getView=function(t){var e=this.view,n=this.views,o=this.em,r=t||(null==o?void 0:o.getCurrentFrameModel());return r&&(e=n.filter(function(t){return t.frameView===r.view})[0]),e},e.prototype.getCurrentView=function(){var t=this.em.getCurrentFrame(),e=null==t?void 0:t.model;return this.getView(e)},e.prototype.__getScriptProps=function(){var t=this.props();return(this.get("script-props")||[]).reduce(function(e,n){return e[n]=t[n],e},{})},e.prototype.getScriptString=function(t){var e=this,n=t||this.get("script")||"";if(!n)return n;if(this.get("script-props"))n=n.toString().trim();else{if((0,tw.isFunction)(n)){var o=n.toString().trim();n=(o=o.slice(o.indexOf("{")+1,o.lastIndexOf("}"))).trim()}var r=this.em.getConfig(),i=nN(r.tagVarStart||"{[ "),a=nN(r.tagVarEnd||" ]}"),s=RegExp("".concat(i,"([\\w\\d-]*)").concat(a),"g");n=n.replace(s,function(t,n){e.scriptUpdated();var o=e.attributes[n]||"";return(0,tw.isArray)(o)||"object"==typeof o?JSON.stringify(o):o})}return n},e.prototype.emitUpdate=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=this.em,i=nB+(t?":".concat(t):""),a=t&&this.get(t);t&&this.updated.apply(this,nI([t,a,t&&this.previous(t)],n,!1)),this.trigger.apply(this,nI([i],n,!1)),r&&r.trigger.apply(r,nI([i,this],n,!1)),["components","classes"].indexOf(t)>=0&&this.__propSelfToParent({component:this,changed:((e={})[t]=a,e),options:n[2]||n[1]||{}})},e.prototype.emitWithEditor=function(t,e,n){[this.em,this].forEach(function(o){return null==o?void 0:o.trigger(t,e,n)})},e.prototype.onAll=function(t){return(0,tw.isFunction)(t)&&(t(this),this.components().forEach(function(e){return e.onAll(t)})),this},e.prototype.forEachChild=function(t){(0,tw.isFunction)(t)&&this.components().forEach(function(e){t(e),e.forEachChild(t)})},e.prototype.remove=function(t){var e=this;void 0===t&&(t={});var n=this.em,o=this.collection,r=function(){o&&o.remove(e,nD({action:tQ.t.remove},t)),o||(e.components("",t),e.components().removeChildren(e,void 0,t))},i=nD({},t);return[this,n].map(function(t){return t.trigger(tQ.I.removeBefore,e,r,i)}),i.abort||r(),this},e.prototype.destroy=function(e){return this.stopListening(this.components(),"add remove reset",this.syncOnComponentChange),this.dataResolverWatchers.destroy(),this.__onDestroy(),t.prototype.destroy.call(this,e)},e.prototype.move=function(t,e){if(void 0===e&&(e={}),t){var n=e.at,o=this.index(),r=t===this.parent();if(!r||!(o===n||o===n-1)){r&&n&&n>o&&(e.at=n-1);var i=tQ.t.move;this.remove({action:i,temporary:1}),t.append(this,nD({action:i},e)),this.emitUpdate()}}return this},e.prototype.isInstanceOf=function(t){var e,n,o=null===(n=null===(e=this.em)||void 0===e?void 0:e.Components.getType(t))||void 0===n?void 0:n.model;if(!o)return!1;var r=this.constructor.typeExtends;return this instanceof o||r.has(t)},e.prototype.isChildOf=function(t){for(var e=(0,tw.isString)(t),n=this.parent();n;){if(e){if(n.isInstanceOf(t))return!0}else if(n===t)return!0;n=n.parent()}return!1},e.prototype.resetId=function(t){void 0===t&&(t={});var n=this.em,o=this.getId();if(!o)return this;var r=e.createId(this);this.setId(r);var i=null==n?void 0:n.Css.getIdRule(o),a=null==i?void 0:i.get("selectors").at(0);return null==a||a.set("name",r),this},e.prototype._getStyleRule=function(t){var e=(void 0===t?{}:t).id,n=this.em,o=e||this.getId();return null==n?void 0:n.Css.getIdRule(o)},e.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return null==e?void 0:e.get("selectors").at(0)},e.prototype._moveInlineStyleToRule=function(){var t=this.get("style"),e=(0,tw.isString)(t)&&t.length>0||(0,t_.isObject)(t)&&Object.keys(t).length>0;nR(this.em)&&e&&this.addStyle((0,t_.isObject)(t)?this.dataResolverWatchers.getValueOrResolver("styles",t):t,{avoidStore:!0,noUndo:!0})},e.prototype._idUpdated=function(t,n,o){if(void 0===o&&(o={}),!o.idUpdate){var r=this.ccid,i=(this.get("attributes")||{}).id,a=(this.previous("attributes")||{}).id||r,s=e.getList(this);if(s[i]||!i&&a)return this.setId(a,{idUpdate:!0});delete s[a],s[i]=this,this.ccid=i;var l=this._getStyleSelector({id:a});l&&l.set({name:i,label:i})}},e.getDefaults=function(){return(0,tw.result)(this.prototype,"defaults")},e.isComponent=function(t,e){return{tagName:(0,t_.toLowerCase)(t.tagName)}},e.ensureInList=function(t){var n=e.getList(t),o=t.getId(),r=n[o];if(r){if(r!==t){var i=e.getIncrementId(o,n);t.setId(i),n[i]=t}}else n[o]=t;t.components().forEach(function(t){return e.ensureInList(t)})},e.createId=function(t,n){void 0===n&&(n={});var o,r=e.getList(t),i=n.idMap,a=t.get("attributes").id;return a?(o=e.getIncrementId(a,r,n),t.setId(o),a!==o&&((void 0===i?{}:i)[a]=o)):o=e.getNewId(r),r[o]=t,o},e.getNewId=function(t){for(var n=Object.keys(t).length.toString().length+2,o=(Math.random()+1.1).toString(36).slice(-n),r="i".concat(o);t[r];)r=e.getNewId(t);return r},e.getIncrementId=function(t,e,n){void 0===n&&(n={});var o=n.keepIds,r=1,i=t;if(0>(void 0===o?[]:o).indexOf(t))for(;e[i];)r++,i="".concat(t,"-").concat(r);return i},e.getList=function(t){var e,n=t.em,o=null==n?void 0:n.Components;return null!==(e=null==o?void 0:o.componentsById)&&void 0!==e?e:{}},e.checkId=function(t,n,o,r){void 0===n&&(n=[]),void 0===o&&(o={}),void 0===r&&(r={}),r.updatedIds=r.updatedIds||{};var i=(0,tw.isArray)(t)?t:[t],a=r.keepIds,s=void 0===a?[]:a,l=r.idMap,c=void 0===l?{}:l,u=r.updatedIds;return i.forEach(function(t){t.attributes;var i=t.attributes,a=void 0===i?{}:i,l=t.components,p=a.id;if(p&&o[p]&&0>s.indexOf(p)){var d=e.getIncrementId(p,o);u[p]=u[p]?nI(nI([],u[p],!0),[t],!1):[t],c[p]=d,a.id=d,(0,tw.isArray)(n)&&n.forEach(function(t){var e=t.selectors;e.forEach(function(t,n){t==="#".concat(p)&&(e[n]="#".concat(d))})})}l&&e.checkId(l,n,o,r)}),{updatedIds:r.updatedIds}},e.typeExtends=new Set,e}(no);var n$=(c$=function(t,e){return(c$=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c$(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nq=function(){return(nq=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nG="head",nK=["title","style","base","link","meta","script","noscript"],nY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n$(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return nq(nq({},t.prototype.defaults),{type:nG,tagName:nG,draggable:!1,highlightable:!1,droppable:function(t){var e=t.tagName;return!e||nK.includes((0,t_.toLowerCase)(e))}})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===nG},e}(nW),nJ=function(){function t(t,e){var n;void 0===t&&(t=50),this.dragging=!1,this.lastMaxHeight=0,this.zoom=1,this.rectIsInScrollIframe=!1,this.autoscrollLimit=t,this.lastMaxHeight=null!==(n=null==e?void 0:e.lastMaxHeight)&&void 0!==n?n:0,this.onScroll=null==e?void 0:e.onScroll,this.rectIsInScrollIframe=!!(null==e?void 0:e.rectIsInScrollIframe),(0,tw.bindAll)(this,"start","autoscroll","updateClientY","stop")}return t.prototype.start=function(t,e,n){var o=this;this.eventEl=t,this.scrollEl=e,this.lastMaxHeight=(null==n?void 0:n.lastMaxHeight)||Number.POSITIVE_INFINITY,this.zoom=(null==n?void 0:n.zoom)||1,this.ignoredElement=null==n?void 0:n.ignoredElement,setTimeout(function(){o.toggleAutoscrollFx(!0),requestAnimationFrame(o.autoscroll)},0)},t.prototype.autoscroll=function(){var t,e,n=this,o=this.scrollEl;if(this.dragging&&o){if(void 0===this.lastClientY){setTimeout(function(){requestAnimationFrame(n.autoscroll)},50);return}var r=null!==(t=this.lastClientY)&&void 0!==t?t:0,i=this.autoscrollLimit,a=this.getEventElHeight()-i,s=0;r<i&&(s+=r-i),r>a&&(s+=r-a);var l=this.getElScrollTop(o);0!==(s=Math.max(s=Math.min(s,this.lastMaxHeight-l),-l))&&(o.scrollBy({top:s,behavior:"auto"}),null===(e=this.onScroll)||void 0===e||e.call(this)),requestAnimationFrame(this.autoscroll)}},t.prototype.getEventElHeight=function(){var t=this.eventEl;return t?t.getBoundingClientRect().height:0},t.prototype.updateClientY=function(t){var e=t.target;if(!(this.ignoredElement&&this.ignoredElement.contains(e))){var n=this.scrollEl;t.preventDefault();var o=this.rectIsInScrollIframe?0:this.getElScrollTop(n);this.lastClientY=(0,t3.G2)(t).clientY*this.zoom-o}},t.prototype.getElScrollTop=function(t){return(t instanceof HTMLElement?t.scrollTop:null==t?void 0:t.scrollY)||0},t.prototype.toggleAutoscrollFx=function(t){this.dragging=t;var e=this.eventEl;if(e){var n=t?"on":"off",o={on:t3.on,off:t3.AU};o[n](e,"mousemove dragover",this.updateClientY),o[n](e,"mouseup",this.stop)}},t.prototype.stop=function(){this.toggleAutoscrollFx(!1),this.lastClientY=void 0,this.ignoredElement=void 0},t}(),nX=tm(1447),nZ=(cq=function(t,e){return(cq=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cq(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),nQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nZ(e,t),e.prototype.canMove=function(t,e){var n=this,o=this.getRealIndex(e),r=t._dragSource,i=r.model,a=r.content,s=r.dragDef,l=!i||!this.isSourceSameSymbol(i),c=((0,tw.isFunction)(a)?s:a)||t.model;return Array.isArray(c)?l&&c.every(function(t,e){return n.canMoveSingleContent(t,o+e)}):l&&this.canMoveSingleContent(c,o)},e.prototype.canMoveSingleContent=function(t,e){return this.model.em.Components.canMove(this.model,t,e).result},e.prototype.addChildAt=function(t,e){var n=t._dragSource.content,o=this.isTextNode()&&t.isTextable(),r=(0,tw.isFunction)(n)?n():n;return Array.isArray(r)?this.addMultipleChildren(r,e,o):this.addSingleChild(r,e,o)},e.prototype.addSingleChild=function(t,e,n){var o,r,i,a,s;return s=n?null===(a=null===(i=null===(r=null===(o=this.model)||void 0===o?void 0:o.getView)||void 0===r?void 0:r.call(o))||void 0===i?void 0:i.insertComponent)||void 0===a?void 0:a.call(i,t,{action:"add-component"}):this.model.components().add(t,{at:this.getRealIndex(e),action:"add-component"}),new this.constructor(s)},e.prototype.addMultipleChildren=function(t,e,n){var o,r=this;return t.forEach(function(t,i){o=r.addSingleChild(t,e+i,n)}),o},e.prototype.isSourceSameSymbol=function(t){if(eA(this.model)){var e=eR(this.model);if((eE(e)?e:eD(e))===t)return!0}return!1},Object.defineProperty(e.prototype,"content",{set:function(t){this._dragSource.content=t},enumerable:!1,configurable:!0}),e}(nX.A),n0=tm(8433),n1=function(){return(n1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},n2=function(){function t(t,e){var n=this;this.em=t,this.canvas=t.Canvas;var o=e||this.canvas.getFrames().map(function(t){return t.getComponent().getEl()}),r=Array.isArray(o)?o:[o];this.el=r[0],this.counter=0,(0,tw.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave","handleDragEnd"),r.forEach(function(t){return n.toggleEffects(t,!0)})}return t.prototype.toggleEffects=function(t,e){var n={on:t3.on,off:t3.AU},o=e?"on":"off";n[o](t,"dragenter",this.handleDragEnter),n[o](t,"dragover",this.handleDragOver),n[o](t,"drop",this.handleDrop),n[o](t,"dragleave",this.handleDragLeave)},t.prototype.__customTglEff=function(t){var e,n=t?t3.on:t3.AU,o=this.el.ownerDocument,r=null===(e=o.defaultView)||void 0===e?void 0:e.frameElement;this.getSorterOptions=t?function(t){return{legacyOnStartSort:function(){(0,t3.on)(r,"pointermove",t.onMove)},legacyOnEnd:function(){(0,t3.AU)(r,"pointermove",t.onMove)},customTarget:function(t){var e=t.event;return o.elementFromPoint(e.clientX,e.clientY)}}}:void 0,n(r,"pointerenter",this.handleDragEnter),n(r,"pointermove",this.handleDragOver),n(document,"pointerup",this.handleDrop),n(r,"pointerout",this.handleDragLeave)},t.prototype.startCustom=function(){this.__customTglEff(!0)},t.prototype.endCustom=function(t){this.over?this.endDrop(t):this.__customTglEff(!1)},t.prototype.endDrop=function(t,e){var n=this.em,o=this.dragStop;this.counter=0,o&&o(t||!this.over),this.__customTglEff(!1),n.trigger("canvas:dragend",e)},t.prototype.handleDragLeave=function(t){this.updateCounter(-1,t)},t.prototype.updateCounter=function(t,e){this.counter+=t,0===this.counter&&this.endDrop(!0,e)},t.prototype.handleDragEnter=function(t){var e,n,o,r=this,i=this.em,a=this.canvas,s=t.dataTransfer,l=i.get("dragSource");if(((null==l?void 0:l.content)||a.getConfig().allowExternalDrop)&&(this.updateCounter(1,t),!this.over)){this.over=!0;var c=i.Utils,u=(null==l?void 0:l.content)||"<br>";if(i.stopDefault(),i.inAbsoluteMode()){var p=i.Components.getWrapper(),d=p.append({})[0],f=i.Commands.run("core:component-drag",{event:t,guidesInfo:1,center:1,target:d,onEnd:function(t,e,n){var o;if(!n.cancelled&&u){o=p.append(u)[0];var i=a.getOffset(),l=d.getStyle(),c=l.top,f=l.left,h=l.position,g=(0,t3.Xy)(t.target),v=parseInt("".concat(parseFloat(f)+g.x-i.left),10),y=parseInt("".concat(parseFloat(c)+g.y-i.top),10);o.addStyle({left:v+"px",top:y+"px",position:h})}r.handleDragEnd(o,s),d.remove()}});o=function(e){return f.stop(t,{cancel:e})},this.setAbsoluteDragContent=function(t){return u=t}}else{var h=new c.ComponentSorter({em:i,treeClass:nQ,containerContext:{container:this.el,containerSel:"*",itemSel:"*",pfx:"gjs-",placeholderElement:a.getPlacerEl(),document:this.el.ownerDocument},dragBehavior:{dragDirection:n0.A.BothDirections,nested:!0},positionOptions:{windowMargin:1,canvasRelative:!0},eventHandlers:{legacyOnEndMove:this.handleDragEnd}}),g=null===(e=this.getSorterOptions)||void 0===e?void 0:e.call(this,h);g&&(h.eventHandlers.legacyOnStartSort=g.legacyOnStart,h.eventHandlers.legacyOnEnd=g.legacyOnEnd,h.containerContext.customTarget=g.customTarget);var v=i.Components.getShallowWrapper(),y=null==v?void 0:v.append(u,{temporary:!0})[0],m=[{element:null==y?void 0:y.getEl(),dragSource:n1({model:y},l)}];h.startSort(m),this.sorter=h,this.draggedNode=null===(n=h.sourceNodes)||void 0===n?void 0:n[0],o=function(t){t?h.cancelDrag():h.endDrag()}}this.dragStop=o,i.trigger("canvas:dragenter",s,u)}},t.prototype.handleDragEnd=function(t,e){var n=this.em;this.over=!1,t&&(n.set("dragResult",t),n.trigger("canvas:drop",e,t)),n.runDefault({preserveSelected:1})},t.prototype.handleDragOver=function(t){t.preventDefault(),this.em.trigger("canvas:dragover",t)},t.prototype.handleDrop=function(t){t.preventDefault();var e,n=t.dataTransfer,o=this.getContentByData(n).content||"";this.draggedNode&&(this.draggedNode.content=o),null===(e=this.setAbsoluteDragContent)||void 0===e||e.call(this,o),this.endDrop(!o,t)},t.prototype.getContentByData=function(t){var e=this.em,n=(null==t?void 0:t.types)||[],o=(null==t?void 0:t.files)||[],r=e.get("dragSource"),i=(null==t?void 0:t.getData("text"))||"";if(o.length){i=[];for(var a=0;a<o.length;a++){var s=o[a],l=s.type.split("/")[0];"image"==l&&i.push({type:l,file:s,attributes:{alt:s.name}})}}else if(null==r?void 0:r.content)i=r.content;else if((0,tw.indexOf)(n,"text/html")>=0)i=t&&t.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if((0,tw.indexOf)(n,"text/uri-list")>=0)i={type:"link",attributes:{href:i},content:i};else if((0,tw.indexOf)(n,"text/json")>=0){var c=t&&t.getData("text/json");c&&(i=JSON.parse(c))}else 1===n.length&&"text/plain"===n[0]&&(i="<div>".concat(i,"</div>"));var u={content:i,setContent:function(t){u.content=t}};return e.trigger("canvas:dragdata",t,u),u},t}(),n5=(cG=function(t,e){return(cG=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cG(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),n3=function(){return(n3=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},n4=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},n6=function(t){function e(e,n){var o=t.call(this,{model:e})||this;o.dragging=!1,o.loaded=!1,o.lastMaxHeight=0,o.tools={},(0,tw.bindAll)(o,"startAutoscroll","stopAutoscroll","_emitUpdate");var r=o.el;o.module._config=n3(n3({},o.config||{}),{frameView:o}),o.frameWrapView=n,o.showGlobalTools=(0,tw.debounce)(o.showGlobalTools.bind(o),50);var i=o.getCanvasModel();return o.listenTo(e,"change:head",o.updateHead),o.listenTo(i,"change:styles",o.renderStyles),e.view=o,(0,t_.setViewEl)(r,o),o.autoScroller=new nJ(o.config.autoscrollLimit,{rectIsInScrollIframe:!0,onScroll:function(){o.getGlobalToolsEl().style.opacity="0",o.showGlobalTools(),o.em.Canvas.spots.refreshDbn()}}),o}return n5(e,t),Object.defineProperty(e.prototype,"tagName",{get:function(){return"iframe"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){return{allowfullscreen:"allowfullscreen"}},enumerable:!1,configurable:!0}),e.prototype.getBoxRect=function(){var t=this.el,e=this.module,n=e.getCanvasView(),o=e.getCoords(),r=t.getBoundingClientRect(),i=n.getCanvasOffset(),a=n.getViewportDelta(),s=e.getZoomMultiplier();return{x:(r.x-i.left-a.x-o.x)*s,y:(r.y-i.top-a.y-o.y)*s,width:r.width*s,height:r.height*s}},e.prototype.updateHead=function(){var t=this.model,e=this.getHead(),n=[],o=[],r=t.head,i=t.previous("head"),a=function(t){return void 0===t&&(t={}),Object.keys(t).sort().map(function(e){return"[".concat(e,'="').concat(t[e],'"]')}).join("")},s=function(t,e,n){t.forEach(function(t){var o=t.tag,r=t.attributes;e.some(function(t){return t.tag===o&&a(t.attributes)===a(r)})||n.push(t)})};s(r,i,o),s(i,r,n),n.forEach(function(t){var n,o=e.querySelector("".concat(t.tag).concat(a(t.attributes)));null===(n=null==o?void 0:o.parentNode)||void 0===n||n.removeChild(o)}),(0,t3.af)(e,o)},e.prototype.getEl=function(){return this.el},e.prototype.getCanvasModel=function(){var t;return null===(t=this===null||void 0===this?void 0:this.em.Canvas)||void 0===t?void 0:t.getModel()},e.prototype.getWindow=function(){return this.getEl().contentWindow},e.prototype.getDoc=function(){return this.getEl().contentDocument},e.prototype.getHead=function(){return this.getDoc().querySelector("head")},e.prototype.getBody=function(){return this.getDoc().querySelector("body")},e.prototype.getWrapper=function(){return this.getBody().querySelector("[data-gjs-type=wrapper]")},e.prototype.getJsContainer=function(){return this.jsContainer||(this.jsContainer=(0,t3.a_)("div",{class:"".concat(this.ppfx,"js-cont")})),this.jsContainer},e.prototype.getToolsEl=function(){var t;return null===(t=this.frameWrapView)||void 0===t?void 0:t.elTools},e.prototype.getGlobalToolsEl=function(){return this.em.Canvas.getGlobalToolsEl()},e.prototype.getHighlighter=function(){return this._getTool("[data-hl]")},e.prototype.getBadgeEl=function(){return this._getTool("[data-badge]")},e.prototype.getOffsetViewerEl=function(){return this._getTool("[data-offset]")},e.prototype.getRect=function(){return this.rect||(this.rect=this.el.getBoundingClientRect()),this.rect},e.prototype.getOffsetRect=function(){var t=this.el,e=this.getBody(),n=e.scrollTop,o=e.scrollLeft,r=t.offsetHeight,i=t.offsetWidth;return{top:t.offsetTop,left:t.offsetLeft,height:r,width:i,scrollTop:n,scrollLeft:o,scrollBottom:n+r,scrollRight:o+i}},e.prototype._getTool=function(t){var e=this.tools,n=this.getToolsEl();return e[t]||(e[t]=n.querySelector(t)),e[t]},e.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._toggleEffects(!1),this.tools={},null===(t=this.wrapper)||void 0===t||t.remove(),t5.prototype.remove.apply(this,e),this},e.prototype.startAutoscroll=function(){this.autoScroller.start(this.el,this.getWindow(),{lastMaxHeight:this.getWrapper().offsetHeight-this.el.offsetHeight,zoom:this.em.getZoomDecimal(),ignoredElement:this.em.Canvas.getSpotsEl()})},e.prototype.stopAutoscroll=function(){this.autoScroller.stop()},e.prototype.showGlobalTools=function(){this.getGlobalToolsEl().style.opacity=""},e.prototype.render=function(){var t=this.$el,e=this.ppfx,n=this.em;return t.attr({class:"".concat(e,"frame")}),this.renderScripts(),n.trigger("frame:render",this),this},e.prototype.renderScripts=function(){var t=this,e=this.el,n=this.model,o=this.em,r="frame:load",i={el:e,model:n,view:this},a=this.getCanvasModel(),s=function(n){var a;if(n.length>0){var l=n.shift(),c=(0,t3.a_)("script",n3({type:"text/javascript"},(0,tw.isString)(l)?{src:l}:l));null===(a=e.contentDocument)||void 0===a||a.head.appendChild(c),c.hasAttribute("nomodule")&&"noModule"in HTMLScriptElement.prototype?s(n):c.onerror=c.onload=s.bind(null,n)}else null==o||o.trigger(tH.frameLoadHead,i),t.renderBody(),null==o||o.trigger(tH.frameLoadBody,i),null==o||o.trigger(r,i)};e.onload=function(){var e=t.config.frameContent;if(e){var n=t.getDoc();n.open(),n.write(e),n.close()}i.window=t.getWindow(),null==o||o.trigger("".concat(r,":before"),i),null==o||o.trigger(tH.frameLoad,i),t.renderHead(),s(n4([],a.get("scripts"),!0))}},e.prototype.renderStyles=function(t){void 0===t&&(t={});var e=this.getHead(),n=this.getCanvasModel(),o=function(t){return void 0===t&&(t=[]),t.map(function(t){return{tag:"link",attributes:n3({rel:"stylesheet"},(0,tw.isString)(t)?{href:t}:t)}})},r=o(t.prev||n.previous("styles")),i=o(null==n?void 0:n.get("styles")),a=[],s=[],l=function(t,e,n){t.forEach(function(t){var o=t.attributes.href;e.some(function(t){return t.attributes.href===o})||n.push(t)})};l(i,r,s),l(r,i,a),a.forEach(function(t){var n,o=e.querySelector('link[href="'.concat(t.attributes.href,'"]'));null===(n=null==o?void 0:o.parentNode)||void 0===n||n.removeChild(o)}),(0,t3.af)(e,s)},e.prototype.renderHead=function(){var t,e=this.model,n=this.em,o=e.root,r=null===(t=null==n?void 0:n.Components)||void 0===t?void 0:t.getType(nG).view;r&&(this.headView=new r({el:this.getHead(),model:o.head,config:n3(n3({},o.config),{frameView:this})}).render())},e.prototype.renderBody=function(){var t,e=this,n=this.config,o=this.em,r=this.model,i=this.ppfx,a=this.getBody(),s=this.getWindow(),l=r.hasAutoHeight(),c=o.config;s._isEditor=!0,this.renderStyles({prev:[]}),(0,t3.BC)(a,"<style>\n ".concat(c.baseCss||n.frameStyle||"","\n\n ").concat(l?"body { overflow: hidden }":"",'\n\n [data-gjs-type="wrapper"] {\n ').concat(l?"":"min-height: 100vh;","\n padding-top: 0.001em;\n }\n\n .").concat(i,"dashed *[data-gjs-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -2px;\n }\n\n .").concat(i,"selected {\n outline: 2px solid #3b97e3 !important;\n outline-offset: -2px;\n }\n\n .").concat(i,"selected-parent {\n outline: 2px solid ").concat("#ffca6f"," !important\n }\n\n .").concat(i,"no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .").concat(i,"freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .").concat(i,"no-pointer {\n pointer-events: none;\n }\n\n .").concat(i,"pointer-init {\n pointer-events: initial;\n }\n\n .").concat(i,"plh-image {\n background: #f5f5f5;\n border: none;\n height: 100px;\n width: 100px;\n display: block;\n outline: 3px solid #ffca6f;\n cursor: pointer;\n outline-offset: -2px\n }\n\n .").concat(i,"grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n .").concat(i,"is__grabbing {\n overflow-x: hidden;\n }\n\n .").concat(i,"is__grabbing,\n .").concat(i,"is__grabbing * {\n cursor: grabbing !important;\n }\n\n ").concat(c.canvasCss||"","\n ").concat(c.protectedCss||"","\n </style>"));var u=r.root,p=((null===(t=null==o?void 0:o.Components)||void 0===t?void 0:t.getType("wrapper"))||{}).view;p&&((0,tw.isFunction)(n.customRenderer)?n.customRenderer({editor:o.Editor,frame:r,window:s,frameView:this,onMount:function(t){e.wrapper=t,e._onRootMount(t)}}):(this.wrapper=new p({model:u,config:n3(n3({},u.config),{em:o,frameView:this})}).render(),this._onRootMount(this.wrapper)))},e.prototype._onRootMount=function(t){var e,n=this,o=this.config,r=this.em,i=this.model,a=this.getDoc(),s=a.body;(0,t3.BC)(s,t.el),(0,t3.BC)(s,new eo({collection:i.getStyles(),config:n3(n3({},r.Css.getConfig()),{frameView:this})}).render().el),(0,t3.BC)(s,this.getJsContainer()),(0,t3.on)(s,"click",function(t){var e;return t&&(null===(e=t.target)||void 0===e?void 0:e.tagName)=="A"&&t.preventDefault()}),(0,t3.on)(s,"submit",function(t){return t&&t.preventDefault()}),[{event:"keydown keyup keypress",class:"KeyboardEvent"},{event:"mousedown mousemove mouseup",class:"MouseEvent"},{event:"pointerdown pointermove pointerup",class:"PointerEvent"},{event:"wheel",class:"WheelEvent",opts:{passive:!o.infiniteCanvas}}].forEach(function(t){return t.event.split(" ").forEach(function(e){a.addEventListener(e,function(e){return n.el.dispatchEvent((0,t3.yL)(e,t.class))},t.opts)})}),this._toggleEffects(!0),(0,t_.hasDnd)(r)&&(this.droppable=new n2(r,null===(e=this.wrapper)||void 0===e?void 0:e.el)),this.loaded=!0,i.trigger("loaded")},e.prototype._toggleEffects=function(t){var e=t?t3.on:t3.AU,n=this.getWindow();n&&e(n,"".concat(t3.D8," resize"),this._emitUpdate)},e.prototype._emitUpdate=function(){this.model._emitUpdated()},e}(t5),n7=tm(9966),n9=(cK=function(t,e){return(cK=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cK(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),n8=function(){return(n8=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ot=function(t){function e(e,n){var o=t.call(this,{model:e})||this;return(0,tw.bindAll)(o,"onScroll","frameLoaded","updateOffset","remove","startDrag"),n8(n8({},e.config),{frameWrapView:o}),o.cv=n,o.frame=new n6(e,o),o.classAnim="".concat(o.ppfx,"frame-wrapper--anim"),o.updateOffset=(0,tw.debounce)(o.updateOffset.bind(o),0),o.updateSize=(0,tw.debounce)(o.updateSize.bind(o),0),o.listenTo(e,"loaded",o.frameLoaded),o.listenTo(e,"change:x change:y",o.updatePos),o.listenTo(e,"change:width change:height",o.updateSize),o.listenTo(e,"destroy remove",o.remove),o.updatePos(),o.setupDragger(),o}return n9(e,t),e.prototype.events=function(){return{"click [data-action-remove]":"remove","mousedown [data-action-move]":"startDrag"}},e.prototype.setupDragger=function(){var t,e,n,o=this,r=this.module,i=this.model,a=function(t){r.toggleFramesEvents(t)};this.dragger=new n7.A({onStart:function(){var r=i.attributes,s=r.x,l=r.y;n=o.em.getZoomMultiplier(),t=s,e=l,a(!1)},onEnd:function(){return a(!0)},setPosition:function(o){i.set({x:t+o.x*n,y:e+o.y*n})}})},e.prototype.startDrag=function(t){var e;t&&(null===(e=this.dragger)||void 0===e||e.start(t))},e.prototype.__clear=function(t){var e=this.frame;e&&e.remove(t),(0,t3.YZ)(this.elTools)},e.prototype.remove=function(t){var e,n=this;return null===(e=this.sizeObserver)||void 0===e||e.disconnect(),this.__clear(t),t5.prototype.remove.apply(this,t),["frame","dragger","cv","elTools"].forEach(function(t){return n[t]=0}),this},e.prototype.updateOffset=function(){var t,e=this.em,n=this.$el,o=this.frame;e&&!e.destroyed&&(e.runDefault({preserveSelected:1}),n.removeClass(this.classAnim),null===(t=null==o?void 0:o.model)||void 0===t||t._emitUpdated())},e.prototype.updatePos=function(t){var e=this.model,n=this.el,o=e.attributes,r=o.x,i=o.y,a=n.style;this.frame.rect=void 0,a.left=isNaN(r)?r:"".concat(r,"px"),a.top=isNaN(i)?i:"".concat(i,"px"),t&&this.updateOffset()},e.prototype.updateSize=function(){this.updateDim()},e.prototype.updateDim=function(){var t=this.em,e=this.el,n=this.$el,o=this.model,r=this.classAnim,i=this.frame;if(i){i.rect=void 0,n.addClass(r);var a=this.__handleSize(),s=a.noChanges,l=a.width,c=a.height;((0,tw.isNull)(l)||(0,tw.isNull)(c))&&o.set(n8(n8({},l?{}:{width:e.offsetWidth}),c?{}:{height:e.offsetHeight}),{silent:1}),t.stopDefault({preserveSelected:1}),s?this.updateOffset():setTimeout(this.updateOffset,350)}},e.prototype.onScroll=function(){var t=this.frame;this.em.trigger("frame:scroll",{frame:t,body:t.getBody(),target:t.getWindow()})},e.prototype.frameLoaded=function(){var t=this.frame;this.config,t.getWindow().onscroll=this.onScroll,this.updateDim()},e.prototype.__handleSize=function(){var t,e=this.model,n=this.el.style,o=e.attributes,r=o.width,i=o.height,a=n.width||"",s=n.height||"",l=r||"",c=i||"",u=a==l&&s==c,p=(0,tw.isNumber)(l)?"".concat(l).concat("px"):l,d=(0,tw.isNumber)(c)?"".concat(c).concat("px"):c;if(n.width=p,null===(t=this.sizeObserver)||void 0===t||t.disconnect(),e.hasAutoHeight()){var f=this.frame.el.contentDocument;if(f){var h=new ResizeObserver(function(){requestAnimationFrame(function(){var t=parseFloat(e.get("minHeight"))||0,o=Math.max(f.body.scrollHeight,t);n.height="".concat(o,"px")})});h.observe(f.body),this.sizeObserver=h}}else n.height=d,delete this.sizeObserver;return{noChanges:u,width:r,height:i,newW:l,newH:c}},e.prototype.render=function(){var t=this.frame,e=this.$el,n=this.ppfx,o=this.cv,r=this.model,i=this.el,a=r.attributes.onRender;this.__clear(),this.__handleSize(),t.render(),e.empty().attr({class:"".concat(n,"frame-wrapper")}).append('\n <div class="'.concat(n,'frame-wrapper__top gjs-two-color" data-frame-top>\n <div class="').concat(n,'frame-wrapper__name" data-action-move>\n ').concat(r.get("name")||"",'\n </div>\n <div class="').concat(n,'frame-wrapper__top-r">\n <div class="').concat(n,'frame-wrapper__icon" data-action-remove style="display: none">\n <svg viewBox="0 0 24 24"><path d="M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z"></path></svg>\n </div>\n </div>\n </div>\n <div class="').concat(n,'frame-wrapper__right" data-frame-right></div>\n <div class="').concat(n,'frame-wrapper__left" data-frame-left></div>\n <div class="').concat(n,'frame-wrapper__bottom" data-frame-bottom></div>\n ')).append(t.el);var s=(0,t3.a_)("div",{class:"".concat(n,"tools"),style:"pointer-events:none; display: none"},'\n <div class="'.concat(n,'highlighter" data-hl></div>\n <div class="').concat(n,'badge" data-badge></div>\n <div class="').concat(n,'placeholder">\n <div class="').concat(n,'placeholder-int"></div>\n </div>\n <div class="').concat(n,'ghost"></div>\n <div class="').concat(n,'toolbar" style="pointer-events:all"></div>\n <div class="').concat(n,'resizer"></div>\n <div class="').concat(n,'offset-v" data-offset>\n <div class="gjs-marginName" data-offset-m>\n <div class="gjs-margin-v-el gjs-margin-v-top" data-offset-m-t></div>\n <div class="gjs-margin-v-el gjs-margin-v-bottom" data-offset-m-b></div>\n <div class="gjs-margin-v-el gjs-margin-v-left" data-offset-m-l></div>\n <div class="gjs-margin-v-el gjs-margin-v-right" data-offset-m-r></div>\n </div>\n <div class="gjs-paddingName" data-offset-m>\n <div class="gjs-padding-v-el gjs-padding-v-top" data-offset-p-t></div>\n <div class="gjs-padding-v-el gjs-padding-v-bottom" data-offset-p-b></div>\n <div class="gjs-padding-v-el gjs-padding-v-left" data-offset-p-l></div>\n <div class="gjs-padding-v-el gjs-padding-v-right" data-offset-p-r></div>\n </div>\n </div>\n <div class="').concat(n,'offset-fixed-v"></div>\n '));this.elTools=s;var l=null==o?void 0:o.toolsWrapper;return l&&l.appendChild(s),a&&a({el:i,elTop:i.querySelector("[data-frame-top]"),elRight:i.querySelector("[data-frame-right]"),elBottom:i.querySelector("[data-frame-bottom]"),elLeft:i.querySelector("[data-frame-left]"),frame:r,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},e}(t5),oe=(cY=function(t,e){return(cY=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cY(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),on=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,!0)||this;return o.listenTo(o.collection,"reset",o.render),o.canvasView=n.canvasView,o._module=n.module,o}return oe(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach(function(t){return t.remove(e)})},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.clearItems=function(){(this.viewCollection||[]).forEach(function(t){return t.remove()}),this.viewCollection=[]},e.prototype.renderView=function(t,e){return new ot(t,this.canvasView)},e}(t6),oo=(cJ=function(t,e){return(cJ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cJ(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),or=function(){return(or=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},oi=function(t){function e(e){var n=t.call(this,{model:e})||this;n.ready=!1,(0,tw.bindAll)(n,"clearOff","onKeyPress","onWheel","onPointer");var o=n.em,r=n.pfx,i=n.ppfx,a=n.module.events;return n.className="".concat(r,"canvas ").concat(i,"no-touch-actions").concat(o.config.customUI?"":" ".concat(r,"canvas-bg")),n.clsUnscale="".concat(r,"unscale"),n._initFrames(),n.listenTo(o,a.refresh,n.clearOff),n.listenTo(o,"component:selected",n.checkSelected),n.listenTo(o,"".concat(a.coords," ").concat(a.zoom),n.updateFrames),n.listenTo(e,"change:frames",n._onFramesUpdate),n.toggleListeners(!0),n}return oo(e,t),e.prototype.template=function(){var t=this.pfx;return'\n <div class="'.concat(t,'canvas__frames" data-frames>\n <div class="').concat(t,'canvas__spots" data-spots></div>\n </div>\n <div id="').concat(t,'tools" class="').concat(t,'canvas__tools" data-tools></div>\n <style data-canvas-style></style>\n ')},e.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},e.prototype._initFrames=function(){var t=this.frames,e=this.model,n=this.config,o=this.em,r=e.frames;o.set("readyCanvas",0),r.once("loaded:all",function(){return o.set("readyCanvas",1)}),null==t||t.remove(),this.frames=new on({collection:r},or(or({},n),{canvasView:this}))},e.prototype.checkSelected=function(t,e){void 0===e&&(e={});var n,o=e.scroll,r=this.em.getCurrentFrame();o&&(null===(n=t.views)||void 0===n||n.forEach(function(t){t.frameView===r&&t.scrollIntoView(o)}))},e.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return clearTimeout(this.timerZoom),null===(t=this.frames)||void 0===t||t.remove(),this.frames=void 0,t5.prototype.remove.apply(this,e),this.toggleListeners(!1),this},e.prototype.preventDefault=function(t){var e;t&&(t.preventDefault(),null===(e=t._parentEvent)||void 0===e||e.preventDefault())},e.prototype.toggleListeners=function(t){var e=this.el,n=this.config,o=t?t3.on:t3.AU;o(document,"keypress",this.onKeyPress),o(window,"scroll resize",this.clearOff),o(e,"wheel",this.onWheel,{passive:!n.infiniteCanvas}),o(e,"pointermove",this.onPointer)},e.prototype.screenToWorld=function(t,e){var n=this.module,o=n.getCoords(),r=n.getZoomMultiplier(),i=this.getViewportDelta();return{x:(t-o.x-i.x)*r,y:(e-o.y-i.y)*r}},e.prototype.onPointer=function(t){if(this.config.infiniteCanvas){var e=this.getCanvasOffset(),n=(0,t3.Xy)(),o={x:t.clientX-e.left+n.x,y:t.clientY-e.top+n.y};if(t._parentEvent){var r=t.target.getBoundingClientRect(),i=this.module.getZoomDecimal();o.x=r.left-e.left+n.x+t.clientX*i,o.y=r.top-e.top+n.y+t.clientY*i}this.model.set({pointerScreen:o,pointer:this.screenToWorld(o.x,o.y)})}},e.prototype.onKeyPress=function(t){var e=this.em;" "!==(0,t3.Ch)(t)||1===e.getZoomDecimal()||e.Canvas.isInputFocused()||(this.preventDefault(t),e.Editor.runCommand("core:canvas-move"))},e.prototype.onWheel=function(t){var e=this.module;if(this.config.infiniteCanvas){this.preventDefault(t);var n=t.deltaX,o=t.deltaY,r=e.getZoomDecimal(),i=(0,t3.rp)(t),a=e.getCoords();if(i){var s=r-o*r*.01;e.setZoom(100*s);var l=this.model.getPointerCoords(tT.x2.Screen),c=this.getCanvasOffset(),u=l.x-c.width/2,p=l.y-c.height/2,d=s/r,f=u-(u-a.x)*d,h=p-(p-a.y)*d;e.setCoords(f,h)}else this.onPointer(t),e.setCoords(a.x-n,a.y-o)}},e.prototype.updateFrames=function(t){var e=this.em,n=this.toolsWrapper,o={preserveSelected:1};this.updateFramesArea(),this.clearOff(),n.style.display="none",e.trigger("canvas:update",t),clearTimeout(this.timerZoom),this.timerZoom=setTimeout(function(){e.stopDefault(o),e.runDefault(o),n.style.display=""},300)},e.prototype.updateFramesArea=function(){var t=this.framesArea,e=this.model,n=this.module,o=this.cvStyle,r=this.clsUnscale,i=n.getZoomMultiplier();if(t){var a=e.attributes,s=a.x,l=a.y,c=n.getZoomDecimal();t.style.transform="scale(".concat(c,") translate(").concat(s*i,"px, ").concat(l*i,"px)")}o&&(o.innerHTML="\n .".concat(r," { scale: ").concat(i," }\n "))},e.prototype.fitViewport=function(t){void 0===t&&(t={});var e,n,o,r=this.em,i=this.module,a=this.model;this.clearOff();var s=this.getCanvasOffset(),l=t.el,c=l&&(null===(e=(0,t_.getComponentView)(l))||void 0===e?void 0:e.frameView),u=c?c.model:t.frame||r.getCurrentFrameModel()||a.frames.at(0),p=u.attributes,d=p.x,f=p.y,h={x:null!=d?d:0,y:null!=f?f:0,width:u.width,height:u.height};if(l){var g=this.getElBoxRect(l);h.x=h.x+g.x,h.y=h.y+g.y,h.width=g.width,h.height=g.height}var v=t.ignoreHeight,y=null!==(n=t.gap)&&void 0!==n?n:0,m=(0,tw.isNumber)(y),b=m?y:y.x,w=m?y:y.y,_=h.width+2*b,C=h.height+2*w,x=s.width,S=s.height,O=x/_,T=100*(v?O:Math.min(O,S/C)),P=null!==(o=(0,tw.isFunction)(t.zoom)?t.zoom(T):t.zoom)&&void 0!==o?o:T;i.setZoom(P,{from:"fitViewport"});var E=-h.x+(u.width>=x?x/2-_/2:-b),k=-h.y+S/2-C/2,A=i.getZoomDecimal(),j={x:(E+b)*A,y:(k+w)*A};if(v){var M=i.getZoomMultiplier();j.y=(-h.y+w)*A-(S*M-S)/2/M}i.setCoords(j.x,j.y)},e.prototype.isElInViewport=function(t){var e=(0,t_.getElement)(t),n=(0,t3.C8)(e),o=this.getFrameOffset(e),r=n.top,i=n.left;return r>=0&&i>=0&&r<=o.height&&i<=o.width},e.prototype.offset=function(t,e){void 0===e&&(e={});var n=e.noScroll,o=(0,t3.C8)(t),r=n?{x:0,y:0}:(0,t3.Xy)(t);return{top:o.top+r.y,left:o.left+r.x,width:o.width,height:o.height}},e.prototype.getRectToScreen=function(t){var e,n,o,r,i=this.getCanvasScroll(),a=this.module.getZoomDecimal(),s=this.module.getCoords(),l=this.getViewportDelta();return{x:(null!==(e=t.x)&&void 0!==e?e:0)*a-i.scrollLeft+s.x+l.x||0,y:(null!==(n=t.y)&&void 0!==n?n:0)*a-i.scrollTop+s.y+l.y||0,width:(null!==(o=t.width)&&void 0!==o?o:0)*a,height:(null!==(r=t.height)&&void 0!==r?r:0)*a}},e.prototype.getElBoxRect=function(t,e){void 0===e&&(e={});var n,o,r,i=this.module,a=(0,t3.C8)(t),s=a.width,l=a.height,c=a.left,u=a.top,p=null===(n=(0,t_.getComponentView)(t))||void 0===n?void 0:n.frameView,d=null==p?void 0:p.getBoxRect(),f=i.getZoomMultiplier(),h=null!==(o=null==d?void 0:d.x)&&void 0!==o?o:0,g=null!==(r=null==d?void 0:d.y)&&void 0!==r?r:0,v=this.el,y=(0,t3.Xy)(),m={x:c+h+(v.scrollLeft+y.x)*f,y:u+g+(v.scrollTop+y.y)*f,width:s,height:l};return e.local&&(m.x=c,m.y=u),e.toScreen?this.getRectToScreen(m):m},e.prototype.getViewportRect=function(t){void 0===t&&(t={});var e=this.getCanvasOffset(),n=e.top,o=e.left,r=e.width,i=e.height,a=this.module;if(!t.toWorld)return{x:o,y:n,width:r,height:i};var s=a.getZoomMultiplier(),l=a.getCoords(),c=this.getViewportDelta();return{x:(-l.x-c.x||0)*s,y:(-l.y-c.y||0)*s,width:r*s,height:i*s}},e.prototype.getViewportDelta=function(t){void 0===t&&(t={});var e=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),o=n.width,r=n.height;return{x:(o*e-o)/2/e,y:(r*e-r)/2/e}},e.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},e.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,o=null==t?void 0:t.ownerDocument.defaultView,r=o?o.frameElement:n;this.frmOff=this.offset(r||n)}return this.frmOff},e.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},e.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.module.getZoomDecimal(),o=this.getFrameOffset(t),r=this.el,i=this.getCanvasOffset(),a=this.offset(t,e),s=e.avoidFrameOffset?0:o.top,l=e.avoidFrameOffset?0:o.left,c=e.avoidFrameZoom?a.top:a.top*n,u=e.avoidFrameZoom?a.left:a.left*n;return{top:e.avoidFrameOffset?c:c+s-i.top+r.scrollTop,left:e.avoidFrameOffset?u:u+l-i.left+r.scrollLeft,height:e.avoidFrameZoom?a.height:a.height*n,width:e.avoidFrameZoom?a.width:a.width*n,zoom:n,rect:a}},e.prototype.getElementOffsets=function(t){if(!t||(0,t3.ir)(t))return{};var e={},n=window.getComputedStyle(t),o=this.module.getZoomDecimal();return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"].forEach(function(t){e[t]=parseFloat(n[t])*o}),e},e.prototype.getPosition=function(t){void 0===t&&(t={});var e,n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(!n)return{top:0,left:0,width:0,height:0};var o=n.body,r=this.module.getZoomDecimal(),i=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:i.top+(s?0:o.scrollTop)*r-a.top,left:i.left+(s?0:o.scrollLeft)*r-a.left,width:a.width,height:a.height}},e.prototype.getCanvasScroll=function(){return this.config.scrollableCanvas?{scrollTop:this.el.scrollTop,scrollLeft:this.el.scrollLeft}:{scrollTop:0,scrollLeft:0}},e.prototype.updateScript=function(t){var e=t.model,n=e.getId(),o={component:e,view:t,el:t.el};if(!t.scriptContainer){t.scriptContainer=(0,t3.a_)("div",{"data-id":n});var r=this.getJsContainer();null==r||r.appendChild(t.scriptContainer)}t.el.id=n,t.scriptContainer.innerHTML="";var i=document.createElement("script"),a=e.getScriptString(),s=e.get("script-props")?a:"function(){\n".concat(a,"\n;}"),l=JSON.stringify(e.__getScriptProps());i.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n var script = (").concat(s,").bind(item);\n script(").concat(l,", { el: item });\n }, 1);"),setTimeout(function(){e.emitWithEditor(tQ.I.scriptMountBefore,o);var n=t.scriptContainer;null==n||n.appendChild(i),e.emitWithEditor(tQ.I.scriptMount,o)},0)},e.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return null==e?void 0:e.getJsContainer()},e.prototype.getFrameView=function(t){return(null==t?void 0:t.frameView)||this.em.getCurrentFrame()},e.prototype._renderFrames=function(){if(this.ready){var t=this.model,e=this.frames,n=this.em,o=this.framesArea,r=t.frames;r.listenToLoad(),e.render();var i=r.at(0),a=null==i?void 0:i.view;n.setCurrentFrame(a),null==o||o.appendChild(e.el),this.frame=a,this.updateFramesArea()}},e.prototype.renderFrames=function(){this._renderFrames()},e.prototype.render=function(){var t=this.el,e=this.$el,n=this.ppfx,o=this.config,r=this.em;e.html(this.template());var i=e.find("[data-frames]");this.framesArea=i.get(0);var a=e.find("[data-tools]");return this.toolsWrapper=a.get(0),a.append('\n <div class="'.concat(n,"tools ").concat(n,'tools-gl" style="pointer-events:none">\n <div class="').concat(n,'placeholder">\n <div class="').concat(n,'placeholder-int"></div>\n </div>\n </div>\n <div id="').concat(n,'tools" style="pointer-events:none">\n ').concat(o.extHl?'<div class="'.concat(n,'highlighter-sel"></div>'):"",'\n <div class="').concat(n,'badge"></div>\n <div class="').concat(n,'ghost"></div>\n <div class="').concat(n,'toolbar" style="pointer-events:all"></div>\n <div class="').concat(n,'resizer"></div>\n <div class="').concat(n,'offset-v"></div>\n <div class="').concat(n,'offset-fixed-v"></div>\n </div>\n ')),this.toolsEl=t.querySelector("#".concat(n,"tools")),this.hlEl=t.querySelector(".".concat(n,"highlighter")),this.badgeEl=t.querySelector(".".concat(n,"badge")),this.placerEl=t.querySelector(".".concat(n,"placeholder")),this.ghostEl=t.querySelector(".".concat(n,"ghost")),this.toolbarEl=t.querySelector(".".concat(n,"toolbar")),this.resizerEl=t.querySelector(".".concat(n,"resizer")),this.offsetEl=t.querySelector(".".concat(n,"offset-v")),this.fixedOffsetEl=t.querySelector(".".concat(n,"offset-fixed-v")),this.toolsGlobEl=t.querySelector(".".concat(n,"tools-gl")),this.spotsEl=t.querySelector("[data-spots]"),this.cvStyle=t.querySelector("[data-canvas-style]"),t.className=(0,t_.getUiClass)(r,this.className),!0===o.scrollableCanvas&&(t.style.overflow="auto"),this.ready=!0,this._renderFrames(),this},e}(t5),oa=(cX=function(t,e){return(cX=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cX(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),os=function(){return(os=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ol=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},oc=function(t){function e(e){var n=t.call(this,e,"Canvas",{stylePrefix:"cv-",scripts:[],styles:[],customBadgeLabel:void 0,autoscrollLimit:50,extHl:!1,frameContent:"<!DOCTYPE html>",frameStyle:"\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ",notTextable:["button","a","input[type=checkbox]","input[type=radio]"],allowExternalDrop:!0})||this;return n.events=pB,n.framesById={},n.canvas=new tX(n),n.spots=new t1(n),n.model=n.canvas,n.startAutoscroll=n.startAutoscroll.bind(n),n.stopAutoscroll=n.stopAutoscroll.bind(n),n.autoScroller=new nJ,n}return oa(e,t),e.prototype.getCanvasView=function(){return this.canvasView},e.prototype.postLoad=function(){this.model.init()},e.prototype.getModel=function(){return this.canvas},e.prototype.getElement=function(){return this.getCanvasView().el},e.prototype.getFrame=function(t){return this.getFrames()[t||0]},e.prototype.getFrameEl=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.el},e.prototype.getFramesEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.framesArea},e.prototype.getWindow=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.getWindow()},e.prototype.getDocument=function(){var t=this.getFrameEl();return null==t?void 0:t.contentDocument},e.prototype.getBody=function(){var t=this.getDocument();return null==t?void 0:t.body},e.prototype._getLocalEl=function(t,e,n){var o=null==e?void 0:e.frameView;return o?o[n]():t},e.prototype.getGlobalToolsEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.toolsGlobEl},e.prototype.getToolsEl=function(t){return this._getLocalEl(this.getCanvasView().toolsEl,t,"getToolsEl")},e.prototype.getHighlighter=function(t){return this._getLocalEl(this.getCanvasView().hlEl,t,"getHighlighter")},e.prototype.getBadgeEl=function(t){return this._getLocalEl(this.getCanvasView().badgeEl,t,"getBadgeEl")},e.prototype.getPlacerEl=function(){return this.getCanvasView().placerEl},e.prototype.getGhostEl=function(){return this.getCanvasView().ghostEl},e.prototype.getToolbarEl=function(){return this.getCanvasView().toolbarEl},e.prototype.getResizerEl=function(){return this.getCanvasView().resizerEl},e.prototype.getOffsetViewerEl=function(t){return this._getLocalEl(this.getCanvasView().offsetEl,t,"getOffsetViewerEl")},e.prototype.getFixedOffsetViewerEl=function(){return this.getCanvasView().fixedOffsetEl},e.prototype.getSpotsEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.spotsEl},e.prototype.render=function(){var t;return null===(t=this.canvasView)||void 0===t||t.remove(),this.canvasView=new oi(this.canvas),this.canvasView.render().el},e.prototype.getOffset=function(){var t=this.offset(this.getFrameEl()),e=this.offset(this.getElement());return{top:t.top-e.top,left:t.left-e.left}},e.prototype.offset=function(t){return this.getCanvasView().offset(t)},e.prototype.setCustomBadgeLabel=function(t){this.config.customBadgeLabel=t},e.prototype.getElementPos=function(t,e){return this.getCanvasView().getElementPos(t,e)},e.prototype.getElementOffsets=function(t){return this.getCanvasView().getElementOffsets(t)},e.prototype.getRect=function(){var t,e=null!==(t=this.getCanvasView().getPosition())&&void 0!==t?t:{},n=e.top,o=e.left;return os(os({},this.getCanvasView().getCanvasOffset()),{topScroll:void 0===n?0:n,leftScroll:void 0===o?0:o})},e.prototype.getTargetToElementDim=function(t,e,n){void 0===n&&(n={});var o=n||{},r=this.getCanvasView().getPosition();if(r){var i=o.elPos||this.getCanvasView().getElementPos(e),a=n.toRight||0,s=o.targetHeight||t.offsetHeight,l=o.targetWidth||t.offsetWidth,c=o.event||null,u=i.top-s,p=i.left;p+=a?i.width:0;var d=(p=a?p-l:p)<r.left?r.left:p,f=u<r.top?r.top:u,h={top:f=f>i.top+i.height?i.top+i.height:f,left:d,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:r.top,canvasLeft:r.left,canvasWidth:r.width,canvasHeight:r.height};return c&&this.em&&this.em.trigger(c,h),h}},e.prototype.canvasRectOffset=function(t,e,n){var o=this;void 0===n&&(n={});var r=function(t){var e=t.defaultView;return null==e?void 0:e.frameElement},i=function(t,e,i){void 0===e&&(e=1);var a=o.em.getZoomDecimal(),s=e?"top":"left",l=t.ownerDocument,c=n.offset?r(l):{},u=c.offsetTop,p=c.offsetLeft,d=l.body||{},f=d.scrollTop,h=d.scrollLeft,g=e?void 0===f?0:f:void 0===h?0:h,v=e?void 0===u?0:u:void 0===p?0:p;return i[s]-(g-v)*a};return{top:i(t,1,e),left:i(t,0,e)}},e.prototype.getTargetToElementFixed=function(t,e,n){void 0===n&&(n={});var o=n.pos||this.getElementPos(t,{noScroll:!0}),r=n.canvasOff||this.canvasRectOffset(t,o),i=e.offsetHeight||0,a=e.offsetWidth||0,s=this.getCanvasView(),l=s.getCanvasScroll(),c=l.scrollTop,u=l.scrollLeft,p=s.getPosition(),d=n.event,f=o.width-a,h=-i,g=(0,tw.isUndefined)(n.left)?f:n.left;g=Math.min(g=Math.min(g=Math.max(g,Math.max(-o.left+u,0)),o.width-a),p.width+u-a-o.left);var v=r.top<i+c,y=h;if(v){var m=o.height+i;if(m<p.height)y+=m;else{var b=-r.top+c;y=b<o.height?b:o.height}}var w={top:y,left:g,canvasOffsetTop:r.top,canvasOffsetLeft:r.left,elRect:o,canvasOffset:r,canvasRect:p,targetWidth:a,targetHeight:i};return d&&this.em.trigger(d,w),w},e.prototype.getMouseRelativePos=function(t,e){void 0===e&&(e={});var n=e.subWinOffset,o=t.target,r=o.nodeType===Node.DOCUMENT_NODE?o:o.ownerDocument,i=r.defaultView||r.parentWindow,a=i.frameElement,s=n?i.pageYOffset:0,l=n?i.pageXOffset:0,c=this.getZoomMultiplier(),u=0,p=0;if(a){var d=a.getBoundingClientRect();u=d.top||0,p=d.left||0}return{y:(t.clientY+u-s)*c,x:(t.clientX+p-l)*c}},e.prototype.getMouseRelativeCanvas=function(t,e){var n,o=this.getZoomDecimal(),r=this.getCanvasView(),i=null!==(n=r.getPosition(e))&&void 0!==n?n:{top:0,left:0},a=r.getCanvasScroll(),s={top:i.top+a.scrollTop,left:i.left+a.scrollLeft},l=s.top,c=s.left;return{y:t.clientY*o+l,x:t.clientX*o+c}},e.prototype.startDrag=function(t){this.em.set("dragSource",t)},e.prototype.endDrag=function(){this.em.set({dragResult:null,dragSource:void 0})},e.prototype.hasFocus=function(){return this.getDocument().hasFocus()},e.prototype.isInputFocused=function(){var t=this.getDocument(),e=this.getFrameEl(),n=ol(["body"],this.config.notTextable,!0),o=e&&document.activeElement===e?t&&t.activeElement:document.activeElement;return o&&!n.some(function(t){return o.matches(t)})},e.prototype.scrollTo=function(t,e){void 0===e&&(e={});var n=(0,t_.getElement)(t),o=n&&(0,t_.getViewEl)(n);o&&o.scrollIntoView(e)},e.prototype.startAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();if(e&&e.startAutoscroll(),this.config.scrollableCanvas){var n=this.getCanvasView().el;this.autoScroller.start(n,n,{zoom:this.em.getZoomDecimal(),ignoredElement:this.getSpotsEl()})}},e.prototype.stopAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.stopAutoscroll(),this.config.scrollableCanvas&&this.autoScroller.stop()},e.prototype.setZoom=function(t,e){return void 0===e&&(e={}),this.canvas.set("zoom","string"==typeof t?parseFloat(t):t,e),this},e.prototype.getZoom=function(){return parseFloat(this.canvas.get("zoom"))},e.prototype.setCoords=function(t,e,n){void 0===n&&(n={});var o,r=t||0===t,i=e||0===e,a={x:this.canvas.get("x"),y:this.canvas.get("y")};if(r&&(a.x=parseFloat("".concat(t))),i&&(a.y=parseFloat("".concat(e))),n.toWorld){var s=null===(o=this.canvasView)||void 0===o?void 0:o.getViewportDelta();s&&(r&&(a.x=a.x-s.x),i&&(a.y=a.y-s.y))}return this.canvas.set(a),this},e.prototype.getCoords=function(){var t=this.canvas.attributes;return{x:t.x,y:t.y}},e.prototype.getPointer=function(t){var e=this.canvas.attributes,n=e.pointer,o=e.pointerScreen;return t?o:n},e.prototype.getZoomDecimal=function(){return this.getZoom()/100},e.prototype.getZoomMultiplier=function(){var t=this.getZoomDecimal();return t?1/t:1},e.prototype.fitViewport=function(t){var e;null===(e=this.canvasView)||void 0===e||e.fitViewport(t)},e.prototype.toggleFramesEvents=function(t){this.getFramesEl().style.pointerEvents=t?"":"none"},e.prototype.getFrames=function(){return this.canvas.frames.map(function(t){return t})},e.prototype.addFrame=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.canvas.frames.add(new tG(this,os({},t)),e)},e.prototype.getLastDragResult=function(){return this.em.get("dragResult")},e.prototype.addSpot=function(t,e){void 0===e&&(e={});var n,o=this.getSpots(t);if(o.length){var r=o[0];return r.set(t),r}var i=t.componentView||(null===(n=t.component)||void 0===n?void 0:n.view),a=new tZ.A(this,os(os({},t),{id:t.id||"cs_".concat(t.type,"_").concat(null==i?void 0:i.cid),type:t.type||""}));return this.spots.add(a,e),a},e.prototype.getSpots=function(t){return void 0===t&&(t={}),this.spots.where(t.id?{id:t.id}:t)},e.prototype.removeSpots=function(t){void 0===t&&(t={});var e=(0,tw.isArray)(t)?t:this.getSpots(t);return this.spots.remove(e)},e.prototype.hasCustomSpot=function(t){var e=this.config.customSpots;return!0===e||!!e&&!!t&&!!e[t]},e.prototype.getWorldRectToScreen=function(t){var e;return null===(e=this.canvasView)||void 0===e?void 0:e.getRectToScreen(t)},e.prototype.refresh=function(t){void 0===t&&(t={});var e=this.em,n=this.events,o=this.canvasView;null==o||o.clearOff(),(t.spots||t.all)&&(this.refreshSpots(),e.trigger("canvas:updateTools")),e.set("canvasOffset",this.getOffset()),e.trigger(n.refresh,t)},e.prototype.refreshSpots=function(){this.spots.refresh()},e.prototype.destroy=function(){var t,e=this;this.canvas.stopListening(),null===(t=this.canvasView)||void 0===t||t.remove(),["model","droppable"].forEach(function(t){return e[t]={}})},e}(tD),ou=(cZ=function(t,e){return(cZ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cZ(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),op=function(){return(op=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},od=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.dataResolver=o.initializeDataResolver(e,n),o.listenToPropsChange(),o}return ou(e,t),e.prototype.initializeDataResolver=function(t,e){var n,o=null!==(n=t.dataResolver)&&void 0!==n?n:{type:t.type};return this.createResolverInstance(o,op(op({},e),{collectionsStateMap:this.collectionsStateMap}))},e.prototype.getDataResolver=function(){return this.get("dataResolver")},e.prototype.setDataResolver=function(t){return this.set("dataResolver",t)},e.prototype.onCollectionsStateMapUpdate=function(e){this.dataResolver.updateCollectionsStateMap(e),t.prototype.onCollectionsStateMapUpdate.call(this,e)},e.prototype.listenToPropsChange=function(){var t=this;this.on("change:dataResolver",function(){t.dataResolver.set(t.get("dataResolver"))})},e.prototype.removePropsListeners=function(){this.stopListening(this.dataResolver),this.off("change:dataResolver"),this.off("change:".concat(this.collectionsStateMap))},e.prototype.destroy=function(e){return this.removePropsListeners(),t.prototype.destroy.call(this,e)},e.prototype.toJSON=function(e){var n=t.prototype.toJSON.call(this,e),o=this.dataResolver.toJSON();return delete o.type,op(op({},n),{dataResolver:o})},e}(nW),of=(cQ=function(t,e){return(cQ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cQ(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oh=function(){return(oh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},og=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return of(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return oh(oh({},t.prototype.defaults),{type:ea,dataResolver:{},droppable:!1})},enumerable:!1,configurable:!0}),e.prototype.getPath=function(){return this.dataResolver.get("path")},e.prototype.getCollectionId=function(){return this.dataResolver.get("collectionId")},e.prototype.getVariableType=function(){return this.dataResolver.get("variableType")},e.prototype.getDefaultValue=function(){return this.dataResolver.get("defaultValue")},e.prototype.getDataValue=function(){return this.dataResolver.getDataValue()},e.prototype.resolvesFromCollection=function(){return this.dataResolver.resolvesFromCollection()},e.prototype.getInnerHTML=function(){return this.getDataValue()},e.prototype.setPath=function(t){this.dataResolver.set("path",t)},e.prototype.setDefaultValue=function(t){this.dataResolver.set("defaultValue",t)},e.prototype.resetDataSourcePath=function(t){this.set("dataResolver",{path:t,collectionId:void 0,variableType:void 0})},e.prototype.createResolverInstance=function(t,e){return new es(t,e)},e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===ea},e}(od),ov=(c0=function(t,e){return(c0=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c0(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oy=function(){return(oy=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},om=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ov(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return oy(oy({},t.prototype.defaults),{droppable:!1,type:pW.condition,dataResolver:{condition:{left:"",operator:pX.equalsIgnoreCase,right:""}},components:[{type:pW.conditionTrue},{type:pW.conditionFalse}]})},enumerable:!1,configurable:!0}),e.prototype.isTrue=function(){return this.dataResolver.isTrue()},e.prototype.getCondition=function(){return this.dataResolver.getCondition()},e.prototype.getIfTrueContent=function(){return this.components().at(0)},e.prototype.getIfFalseContent=function(){return this.components().at(1)},e.prototype.getOutputContent=function(){return this.isTrue()?this.getIfTrueContent():this.getIfFalseContent()},e.prototype.setCondition=function(t){this.dataResolver.setCondition(t)},e.prototype.setIfTrueComponents=function(t){this.setComponentsAtIndex(0,t)},e.prototype.setIfFalseComponents=function(t){this.setComponentsAtIndex(1,t)},e.prototype.getInnerHTML=function(t){var e,n;return null!==(n=null===(e=this.getOutputContent())||void 0===e?void 0:e.getInnerHTML(t))&&void 0!==n?n:""},e.prototype.createResolverInstance=function(t,e){return new eS(t,e)},e.prototype.setComponentsAtIndex=function(t,e){var n=this.components().at(t);null==n||n.components(e)},e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===eC},e}(od),ob=(c1=function(t,e){return(c1=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c1(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ow=function(){return(ow=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ob(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return ow(ow({},t.prototype.defaults),{removable:!1,draggable:!1})},enumerable:!1,configurable:!0}),e.isComponent=function(t){var e;return!!(e=(0,t_.toLowerCase)(t.tagName))&&[pW.collectionItem,pW.conditionTrue,pW.conditionFalse].includes(e)},e}(nW),oC=(c2=function(t,e){return(c2=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c2(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ox=function(){return(ox=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},oS=function(t){function e(e,n){void 0===n&&(n={});var o,r=t.call(this,e,n)||this;return r.mutable=null===(o=e.mutable)||void 0===o||o,r.on("change",r.handleChange),r}return oC(e,t),Object.defineProperty(e.prototype,"cl",{get:function(){return this.collection},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this.cl.dataSource},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.dataSource.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.cl.indexOf(this)},enumerable:!1,configurable:!0}),e.prototype.handleChange=function(t,e){var n=this,o=this.changedAttributes();(0,tw.keys)(o).forEach(function(t){return n.triggerChange(t,e)})},e.prototype.getPath=function(t,e){void 0===e&&(e={});var n=this.dataSource,o=this.id,r=this.index,i=n.id;return"".concat(i,".").concat(e.useIndex?r:o).concat(t?".".concat(t):"")},e.prototype.getPaths=function(t){return[this.getPath(t),this.getPath(t,{useIndex:!0})]},e.prototype.triggerChange=function(t,e){void 0===e&&(e={});var n=this.dataSource,o=this.em,r=this.getPaths(t),i={dataSource:n,dataRecord:this,path:r[0],options:e};o.trigger(pG.path,i),o.trigger("".concat(pG.pathSource,":").concat(n.id),i),r.forEach(function(t){return o.trigger("".concat(pG.path,":").concat(t),ox(ox({},i),{path:t}))})},e.prototype.set=function(e,n,o){var r,i,a=this;if(!this.isNew()&&!1===this.attributes.mutable)throw Error("Cannot modify immutable record");var s=null===(i=null===(r=this.dataSource)||void 0===r?void 0:r.transformers)||void 0===i?void 0:i.onRecordSetValue,l=function(e,n,o){void 0===o&&(o={});var r=(null==o?void 0:o.avoidTransformers)||!s?n:s({id:a.id,key:e,value:n});t.prototype.set.call(a,e,r,o),t.prototype.set.call(a,{__p:!!o.partial||void 0},o)};if("object"==typeof e&&null!==e)for(var c=0,u=Object.entries(e);c<u.length;c++){var p=u[c];l(p[0],p[1],n)}else l(e,n,o);return this},e}(tT.Kx),oO=(c5=function(t,e){return(c5=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c5(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oT=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.dataSource=n.dataSource,o}return oO(e,t),e}(tT.pM);oT.prototype.model=oS;var oP=(c3=function(t,e){return(c3=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c3(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oE=function(){return(oE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ok=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},oA=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},oj=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},oM=function(t){function e(e,n){var o=t.call(this,oE(oE({schema:{}},e),{records:[]}),n)||this,r=e.records,i=e.transformers;return o.transformers=i||{},r instanceof oT||o.set({records:new oT(r,{dataSource:o})}),o.listenTo(o.records,"add",o.onAdd),o.listenTo(o.records,tT.e2,o.handleChanges),o}return oP(e,t),e.prototype.defaults=function(){return{records:[],transformers:{}}},Object.defineProperty(e.prototype,"records",{get:function(){return this.attributes.records},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.attributes.schema},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.collection.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasProvider",{get:function(){return!!this.attributes.provider},enumerable:!1,configurable:!0}),e.prototype.onAdd=function(t){t.triggerChange()},e.prototype.addRecord=function(t,e){return this.records.add(t,e)},e.prototype.getRecord=function(t){return this.records.get(t)},e.prototype.getRecords=function(){var t=this;return oj([],this.records.models,!0).map(function(e){return t.getRecord(e.id)})},e.prototype.getResolvedRecords=function(){var t=this,e=Object.entries(this.schema);return this.getRecords().map(function(n){var o=oE({},n.attributes);return 0===e.length||e.forEach(function(e){var n=e[0],r=e[1];if((null==r?void 0:r.type)===pq.relation&&r.target){var i=o[n];if(i){var a=t.em.DataSources.get(r.target);if(a){var s=a.records,l=r.targetField||"id";if(r.isMany){var c=Array.isArray(i)?i:[i],u=s.filter(function(t){return c.includes(t.attributes[l])});o[n]=u.map(function(t){return oE({},t.attributes)})}else{var p=a.records.find(function(t){return t.attributes[l]===i});p&&(o[n]=oE({},p.attributes))}}}}}),o})},e.prototype.loadProvider=function(){return ok(this,void 0,void 0,function(){var t,e,n,o,r,i,a,s,l,c=this;return oA(this,function(u){switch(u.label){case 0:if(t=this,e=t.attributes,n=t.em,!(o=e.provider)||(0,tw.isString)(o))return[2];return i=(r=(0,tw.isString)(o.get)?{url:o.get}:o.get).url,a=r.method,s=r.headers,l=r.body,[4,ok(c,void 0,void 0,function(){var t,e,o,r,c;return oA(this,function(u){switch(u.label){case 0:t=this,u.label=1;case 1:return u.trys.push([1,6,,7]),n.trigger(n.DataSources.events.providerLoadBefore,{dataSource:t}),[4,fetch(i,{method:a,headers:s,body:l})];case 2:if((e=u.sent()).ok)return[3,4];return o=Error.bind,[4,e.text()];case 3:throw new(o.apply(Error,[void 0,u.sent()]));case 4:return[4,e.json()];case 5:return(null==(r=u.sent())?void 0:r.records)&&this.setRecords(r.records),(null==r?void 0:r.schema)&&this.upSchema(r.schema),n.trigger(n.DataSources.events.providerLoad,{result:r,dataSource:t}),[3,7];case 6:return c=u.sent(),n.logError(c.message),n.trigger(n.DataSources.events.providerLoadError,{dataSource:t,error:c}),[3,7];case 7:return[2]}})})];case 1:return u.sent(),[2]}})})},e.prototype.removeRecord=function(t,e){var n=this.getRecord(t);if((null==n?void 0:n.mutable)===!1&&!(null==e?void 0:e.dangerously))throw Error("Cannot remove immutable record");return this.records.remove(t,e)},e.prototype.setRecords=function(t){var e=this;this.records.reset([],{silent:!0}),t.forEach(function(t){e.records.add(t)})},e.prototype.upSchema=function(t,e){this.set("schema",oE(oE({},this.schema),t),e)},e.prototype.getSchemaField=function(t){return this.schema[t]},e.prototype.handleChanges=function(t,e,n){var o=n||e;this.em.changesUp(o,{dataRecord:t,options:o})},e}(tT.Kx),oD=(c4=function(t,e){return(c4=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c4(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oL=function(){return(oL=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},oI=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.collectionsStateMap={},o.listenToPropsChange(),o}return oD(e,t),e.prototype.onCollectionsStateMapUpdate=function(t){var e,n;this.collectionsStateMap=t,null===(n=null===(e=this.dataResolverWatchers)||void 0===e?void 0:e.onCollectionsStateMapUpdate)||void 0===n||n.call(e),this.components().forEach(function(e){var n;null===(n=e.onCollectionsStateMapUpdate)||void 0===n||n.call(e,t)})},e.prototype.syncOnComponentChange=function(e,n,o){var r=this.collectionsStateMap;this.collectionsStateMap={},t.prototype.syncOnComponentChange.call(this,e,n,o),this.collectionsStateMap=r,this.onCollectionsStateMapUpdate(r)},e.prototype.setDataResolver=function(t){return this.set("dataResolver",t)},e.prototype.getDataResolver=function(){return this.dataResolverProps},Object.defineProperty(e.prototype,"dataResolverProps",{get:function(){return this.get("dataResolver")},enumerable:!1,configurable:!0}),e.prototype.listenToDataSource=function(){var t,e=this,n=this.dataResolverPath;if(n){var o=this.em,r=this.collectionsStateMap;null===(t=this.dataSourceWatcher)||void 0===t||t.destroy(),this.dataSourceWatcher=new el({em:o,resolver:new es({type:ea,path:n},{em:o,collectionsStateMap:r}),onUpdate:function(){return e.onDataSourceChange()}})}},e.prototype.listenToPropsChange=function(){var t=this;this.on("change:dataResolver",function(){t.listenToDataSource()}),this.listenToDataSource()},Object.defineProperty(e.prototype,"dataSourceProps",{get:function(){return this.get("dataResolver")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataResolverPath",{get:function(){var t;return null===(t=this.dataSourceProps)||void 0===t?void 0:t.path},enumerable:!1,configurable:!0}),e.prototype.onDataSourceChange=function(){this.onCollectionsStateMapUpdate(this.collectionsStateMap)},e.prototype.getDataSourceItems=function(){var t=this.dataSourceProps;if(!t)return[];var e=this.listDataSourceItems(t);return e&&(0,tw.isArray)(e)?e:oL({},e)},e.prototype.listDataSourceItems=function(t){var e=t instanceof oM?t.get("id"):t.path;if(!e)return[];var n=this.em.DataSources.getValue(e,[]);return 1===e.split(".").length&&(n=Object.entries(n).map(function(t){return t[0],t[1]})),n},e.prototype.getItemKey=function(t,e){return(0,tw.isArray)(t)?e:Object.keys(t)[e]},e.prototype.removePropsListeners=function(){var t;this.off("change:dataResolver"),null===(t=this.dataSourceWatcher)||void 0===t||t.destroy(),this.dataSourceWatcher=void 0},e.prototype.destroy=function(e){return this.removePropsListeners(),t.prototype.destroy.call(this,e)},e}(nW),oN=(c6=function(t,e){return(c6=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c6(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oR=function(){return(oR=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},oV={avoidStore:!0,partial:!0},oF=function(t){function e(e,n){var o=this;if(n.forCloning)return t.call(this,e,n)||this;var r=oR(oR({},e),{droppable:!1}),i=o=t.call(this,r,n)||this;return o.rebuildChildrenFromCollection=o.rebuildChildrenFromCollection.bind(o),o.listenToPropsChange(),o.rebuildChildrenFromCollection(),i}return oN(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return oR(oR({},t.prototype.defaults),{droppable:!1,dataResolver:{},type:pW.collection,components:[{type:pW.collectionItem}]})},enumerable:!1,configurable:!0}),e.prototype.getItemsCount=function(){var t,e,n,o=(t=this.getDataSourceItems(),(0,tw.isArray)(t)?t.length:Object.keys(t).length),r=Math.max(0,null!==(e=this.getConfigStartIndex())&&void 0!==e?e:0);return Math.max(0,Math.min(o-1,null!==(n=this.getConfigEndIndex())&&void 0!==n?n:Number.MAX_VALUE)-r+1)},e.prototype.getConfigStartIndex=function(){return this.dataResolver.startIndex},e.prototype.getConfigEndIndex=function(){return this.dataResolver.endIndex},e.prototype.getDataSource=function(){var t;return null===(t=this.dataResolver)||void 0===t?void 0:t.dataSource},e.prototype.getCollectionId=function(){var t;return null===(t=this.dataResolver)||void 0===t?void 0:t.collectionId},e.prototype.getCollectionItemComponents=function(){return this.firstChild.components()},e.prototype.setCollectionId=function(t){this.updateCollectionConfig({collectionId:t})},e.prototype.setStartIndex=function(t){if(t<0){this.em.logError("Start index should be greater than or equal to 0");return}this.updateCollectionConfig({startIndex:t})},e.prototype.setEndIndex=function(t){this.updateCollectionConfig({endIndex:t})},e.prototype.setDataSource=function(t){this.set(eO,oR(oR({},this.dataResolver),{dataSource:t}))},e.prototype.setCollectionItemComponents=function(t){this.firstChild.components(t)},e.prototype.onCollectionsStateMapUpdate=function(e){var n=this;t.prototype.onCollectionsStateMapUpdate.call(this,e);var o=this.getDataSourceItems(),r=this.resolveCollectionConfig(o).startIndex;this.components().forEach(function(t,e){var i=n.getItemKey(o,r+e),a=n.getCollectionsStateMapForItem(o,i);t.onCollectionsStateMapUpdate(a)})},e.prototype.stopSyncComponentCollectionState=function(){this.stopListening(this.components(),"add remove reset",this.syncOnComponentChange),this.onCollectionsStateMapUpdate({})},e.prototype.setCollectionStateMapAndPropagate=function(t,e){t.setSymbolOverride(["locked","layerable",e7]),t.syncComponentsCollectionState(),t.onCollectionsStateMapUpdate(e)},e.prototype.onDataSourceChange=function(){this.rebuildChildrenFromCollection()},e.prototype.listenToPropsChange=function(){var t=this;this.on("change:".concat(eO),function(){t.rebuildChildrenFromCollection(),t.listenToDataSource()}),this.listenToDataSource()},Object.defineProperty(e.prototype,"dataSourceProps",{get:function(){return this.dataResolver.dataSource},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataResolver",{get:function(){return this.get(eO)||{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.components().at(0)},enumerable:!1,configurable:!0}),e.prototype.updateCollectionConfig=function(t){this.set(eO,oR(oR({},this.dataResolver),t))},e.prototype.rebuildChildrenFromCollection=function(){var t=this.getDataSourceItems();if(this.resolveCollectionConfig(t).totalItems===this.components().length){this.onCollectionsStateMapUpdate(this.collectionsStateMap);return}var e=this.getCollectionItems(t);this.components().reset(e,e6)},e.prototype.getCollectionItems=function(t){var e,n=this.ensureFirstChild(),o=n.getStyle().display,r=o&&"none"!==o?o:"";n.addStyle({display:"none"},oV);var i=[n];if(!function(t,e){for(var n=[{property:null==t?void 0:t.collectionId,propertyPath:"dataResolver.collectionId"},{property:null==t?void 0:t.dataSource,propertyPath:"dataResolver.dataSource"}],o=0;o<n.length;o++){var r=n[o].propertyPath;if(!t&&(e.logError('The "'.concat(r,'" property is required in the collection definition.')),1))return[]}var i=null==t?void 0:t.startIndex;return void 0!==i&&(i<0||!Number.isInteger(i))&&e.logError("Invalid startIndex: ".concat(i,". It must be a non-negative integer.")),!0}(this.dataResolver,this.em))return i;var a=this.collectionId,s=null!=t?t:this.getDataSourceItems(),l=this.resolveCollectionConfig(s),c=l.startIndex,u=l.endIndex;if(this.hasDuplicateCollectionId())return this.em.logError('The collection ID "'.concat(a,'" already exists in the parent collection state. Overriding it is not allowed.')),i;for(var p=c;p<=u;p++){var d=p===c,f=this.getItemKey(s,p),h=this.getCollectionsStateMapForItem(s,f);if(d){null===(e=eL(n))||void 0===e||e.forEach(function(t){return eV(t)}),this.setCollectionStateMapAndPropagate(n,h),n.addStyle({display:r},oV);continue}var g=n.clone({symbol:!0,symbolInv:!0});g.set({locked:!0,layerable:!1},oV),this.setCollectionStateMapAndPropagate(g,h),i.push(g)}return i},e.prototype.getCollectionsStateMapForItem=function(t,e){var n,o=this.resolveCollectionConfig(t),r=o.startIndex,i=o.endIndex,a=o.totalItems,s=this.collectionId,l=t[e],c=this.collectionsStateMap,u="string"==typeof e?Object.keys(t).indexOf(e):e;return oR(oR({},c),((n={})[s]={collectionId:s,currentIndex:u,currentItem:l,currentKey:e,startIndex:r,endIndex:i,totalItems:a,remainingItems:a-(1+(u-r))},n))},e.prototype.hasDuplicateCollectionId=function(){var t=this.collectionId;return!!this.collectionsStateMap[t]},e.prototype.resolveCollectionConfig=function(t){var e,n,o=Array.isArray(t),r=o?t.length:Object.keys(t).length,i=null!==(e=this.getConfigStartIndex())&&void 0!==e?e:0,a=Math.min(r-1,null!==(n=this.getConfigEndIndex())&&void 0!==n?n:Number.MAX_VALUE),s=0;return r>0&&(s=Math.max(0,a-i+1)),{startIndex:i,endIndex:a,totalItems:s,isArray:o}},e.prototype.ensureFirstChild=function(){var t=this.em.Components.getType(pW.collectionItem).model;return this.firstChild||new t({type:pW.collectionItem},this.opt)},Object.defineProperty(e.prototype,"collectionId",{get:function(){var t,e;return null!==(e=null===(t=this.dataResolverProps)||void 0===t?void 0:t.collectionId)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===pW.collection},e.prototype.toJSON=function(e){var n=t.prototype.toJSON.call(this,e);delete n.droppable,delete n[nH];var o=this.firstChild;return oR(oR({},n),{components:[o]})},e}(oI),oH=(c7=function(t,e){return(c7=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c7(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.compView=oW,e}return oH(e,t),e.prototype.initialize=function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren),this.listenTo(e,"remove",this.removeChildren)},e.prototype.removeChildren=function(t,e,n){var o=this;void 0===n&&(n={}),t.views.forEach(function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,t3.YZ)(n),t.remove.apply(t)}}),t.components().forEach(function(t){return o.removeChildren(t,e,n)})},e.prototype.addTo=function(t){this.addToCollection(t,null,this.collection.indexOf(t))},e.prototype.addToCollection=function(t,e,n){for(var o,r=this.config,i=this.opts,a=this.em,s=r.frameView,l=(null==s?void 0:s.model)&&t.getView(s.model),c=i.componentTypes||(null==a?void 0:a.Components.getTypes()),u=t.get("type")||"default",p=this.compView,d=0;d<c.length;d++)if(c[d].id==u){p=c[d].view;break}var f=l||new p({model:t,config:r,componentTypes:c});try{o=f.render().el}catch(t){o=document.createTextNode(""),a.logError(t)}if(e)e.appendChild(o);else{var h=this.parentEl,g=h.childNodes;if((0,tw.isUndefined)(n))h.appendChild(o);else{var v=g.length==n;v&&n--,v||!g.length?h.appendChild(o):h.insertBefore(o,g[n])}}return t.opt.temporary||null==a||a.trigger(tQ.I.mount,t),o},e.prototype.resetChildren=function(t,e){var n=this;if(void 0===e&&(e={}),!e.skipViewUpdate){var o=e.previousModels;e.skipDomReset||(this.parentEl.innerHTML=""),null==o||o.forEach(function(t){return n.removeChildren(t,n.collection)}),t.each(function(t){return n.addToCollection(t)})}},e.prototype.render=function(t){var e=this,n=this.el,o=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each(function(t){return e.addToCollection(t,o)}),n.innerHTML="",n.appendChild(o),this},e}(tT.Ss),oB=(c9=function(t,e){return(c9=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c9(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oz=function(){return(oz=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};let oW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rendered=!1,e}return oB(e,t),e.prototype.className=function(){return this.getClasses()},e.prototype.tagName=function(){return this.model.get("tagName")},e.prototype.preinitialize=function(t){void 0===t&&(t={}),this.opts=t},e.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{},o=n.em,r=e.opt||{},i=this.$el,a=this.el;this.opts=t,this.modelOpt=r,this.config=n,this.em=o,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.attr=e.get("attributes"),this.classe=this.attr.class||[],this.listenTo(e,"change:style",this.updateStyle),this.listenTo(e,"change:attributes",this.renderAttributes),this.listenTo(e,"change:highlightable",this.updateHighlight),this.listenTo(e,"change:status change:locked",this.updateStatus),this.listenTo(e,"change:script rerender",this.reset),this.listenTo(e,"change:content",this.updateContent),this.listenTo(e,"change",this.handleChange),this.listenTo(e,"active",this.onActive),this.listenTo(e,"disable",this.onDisable),i.data("model",e),(0,t_.setViewEl)(a,this),e.view=this,this.frameView&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:!0}),this.events=oz(oz({},this.constructor.getEvents()),{dragstart:"handleDragStart"}),this.delegateEvents(),r.temporary||this.init(this._clbObj())},Object.defineProperty(e.prototype,"__cmpStyleOpts",{get:function(){return{state:"",mediaText:""}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frameView",{get:function(){return this.opts.config.frameView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createDoc",{get:function(){var t,e,n=(null===(t=this.frameView)||void 0===t?void 0:t.getDoc())||document;return(null===(e=this.opts.config)||void 0===e?void 0:e.useFrameDoc)?n:document},enumerable:!1,configurable:!0}),e.prototype.__isDraggable=function(){var t=this.model,e=this.config,n=t.attributes.draggable;return e.draggableComponents&&n},e.prototype._clbObj=function(){var t=this.em,e=this.model,n=this.el;return{editor:null==t?void 0:t.getEditor(),model:e,el:n}},e.prototype.init=function(t){},e.prototype.removed=function(t){},e.prototype.onRender=function(t){},e.prototype.onActive=function(t){},e.prototype.onDisable=function(t){},e.prototype.remove=function(){t.prototype.remove.call(this);var e,n=this.model,o=this.$el,r=n.views,i=this.frameView||{};return n.components().forEach(function(t){var e=t.getView(i.model);null==e||e.remove()}),null===(e=this.childrenView)||void 0===e||e.remove(),r.splice(r.indexOf(this),1),this.removed(this._clbObj()),o.data({model:"",collection:"",view:""}),this},e.prototype.handleDragStart=function(t){if(!this.__isDraggable())return!1;t.stopPropagation(),t.preventDefault();var e=this.em.getSelectedAll(),n=e.includes(this.model)?e:[this.model];this.em.Commands.run("tlb-move",{target:n,event:t})},e.prototype.initClasses=function(){var t=this.model,e=t.classes,n="change:classes";e instanceof nl&&(this.stopListening(t,n,this.initClasses),this.listenTo(t,n,this.initClasses),this.listenTo(e,"add remove change reset",this.updateClasses),e.length&&this.importClasses())},e.prototype.initComponents=function(t){void 0===t&&(t={});var e=this.model,n=this.$el,o=this.childrenView,r=e.get("components"),i=[e,"change:components",this.initComponents];r instanceof nj&&(n.data("collection",r),o&&o.remove(),this.stopListening.apply(this,i),t.avoidRender||this.renderChildren(),this.listenTo.apply(this,i))},e.prototype.handleChange=function(){var t=this.model,e=(0,tw.keys)(t.changed);if(1!==e.length||"status"!==e[0])for(var n in t.emitUpdate(),t.changed)t.emitUpdate(n)},e.prototype.importClasses=function(){var t=this.em,e=this.model,n=t.Selectors;n&&e.classes.forEach(function(t){return n.add(t.getName())})},e.prototype.updateStatus=function(t){void 0===t&&(t={});var e=this.em,n=this.el,o=this.ppfx,r=this.model,i=null==e?void 0:e.Canvas,a=null==i?void 0:i.config.extHl,s=r.get("status"),l="".concat(o,"selected"),c="".concat(l,"-parent"),u="".concat(o,"freezed"),p="".concat(o,"hovered"),d="".concat(o,"no-pointer"),f="".concat(o,"pointer-init"),h=[l,c,u,p,d,f],g=a&&!t.noExtHl?"":l;this.$el.removeClass(h.join(" "));var v=[n.getAttribute("class")||""],y=!(null==i?void 0:i.hasCustomSpot(tZ.F.Select)),m=!(null==i?void 0:i.hasCustomSpot(tZ.F.Target));switch(s){case"selected":y&&v.push(g);break;case"selected-parent":m&&v.push(c);break;case"freezed":v.push(u);break;case"freezed-selected":v.push(u),y&&v.push(g);break;case"hovered":t.avoidHover||v.push(p)}(0,tw.isBoolean)(r.locked)&&v.push(r.locked?d:f);var b=v.filter(Boolean).join(" ");b&&n.setAttribute("class",b)},e.prototype.updateHighlight=function(){var t=this.model,e=t.get("textable"),n=t.get("highlightable")&&(e||!t.isChildOf("text"));this.setAttribute("data-gjs-highlightable",!!n||"")},e.prototype.updateStyle=function(t,e,n){void 0===n&&(n={});var o=this.model;if(nR(this.em)&&!n.inline){var r=this.__cmpStyleOpts,i=o.getStyle(oz({inline:!0},r));(0,tw.isEmpty)(i)||o.setStyle(i,r)}else this.setAttribute("style",o.styleToString(n))},e.prototype.updateStyles=function(){this.updateStyle()},e.prototype.updateClasses=function(){var t,e,n=(null===(e=(t=this.model.classes).pluck)||void 0===e?void 0:e.call(t,"name").join(" "))||"";this.setAttribute("class",n),this.updateStatus(),this.onAttrUpdate()},e.prototype.setAttribute=function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},e.prototype.getClasses=function(){return this.model.getClasses().join(" ")},e.prototype.updateAttributes=function(){var t=this.model,e=this.$el;this.el;var n=t.attributes,o=n.textable,r=n.type,i=oz(oz({id:t.getId(),"data-gjs-type":r||"default"},this.__isDraggable()&&{draggable:!0}),o&&{contenteditable:"false"});this.__clearAttributes(),this.updateStyle(),this.updateHighlight();var a=oz(oz({},i),t.getAttributes());(0,tw.keys)(a).forEach(function(t){return!1===a[t]&&delete a[t]}),e.attr(a)},e.prototype.__clearAttributes=function(){var t=this.el,e=this.$el,n=[];(0,tw.each)(t.attributes,function(t){return n.push(t.nodeName)}),n.forEach(function(t){return e.removeAttr(t)})},e.prototype.updateContent=function(){var t=this.model.content,e=this.model.components().length;this.getChildrenContainer().innerHTML=e?"":t},e.prototype.prevDef=function(t){t.preventDefault()},e.prototype.updateScript=function(){var t=this.model,e=this.em;t.get("script")&&(null==e||e.Canvas.getCanvasView().updateScript(this))},e.prototype.getChildrenContainer=function(){var t=this.el;return"function"==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t},e.prototype.getOffsetRect=function(){var t={top:0,left:0,bottom:0,right:0},e=this.el,n=0,o=0,r=function(i){var a=i.offsetParent;a?(n+=a.offsetTop,o+=a.offsetLeft,r(a)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+o,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)};return r(e),t},e.prototype.isInViewport=function(){var t=this.el,e=this.em,n=this.frameView,o=e.Canvas.getCanvasView().getElBoxRect(t,{local:!0}),r=n.el,i=r.clientHeight,a=r.clientWidth,s=o.y,l=o.x,c=s+o.height,u=l+o.width;return(s>=0&&s<i||c>0&&c<i)&&(u>=0&&u<a||l>0&&l<=a)},e.prototype.scrollIntoView=function(t){var e;if(void 0===t&&(t={}),!this.isInViewport()||t.force){var n=this.el;if("smooth"!==t.behavior){var o=this.getOffsetRect();null===(e=n.ownerDocument.defaultView)||void 0===e||e.scrollTo(0,o.top)}else n.scrollIntoView(oz({behavior:"smooth",block:"nearest"},t))}},e.prototype.reset=function(){var t=this.el,e=this.model;this.scriptContainer&&e.emitWithEditor(tQ.I.scriptUnmount,{component:e,view:this,el:t}),this.el="",this._ensureElement(),this._setData(),(0,t3.bG)(t,this.el),this.render()},e.prototype._setData=function(){var t=this.model,e=this.el,n=t.components();this.$el.data({model:t,collection:n,view:this}),(0,t_.setViewEl)(e,this)},e.prototype._createElement=function(t){return this.createDoc.createElement(t)},e.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new oU({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),o=0,r=n.length;o<r;o++)t.appendChild(n.shift())},e.prototype.renderAttributes=function(t,e,n){void 0===n&&(n={}),n.skipViewUpdate||(this.updateAttributes(),this.updateClasses())},e.prototype.onAttrUpdate=function(){},e.prototype.render=function(){return this.renderAttributes(),this.modelOpt.temporary||(this.renderChildren(),this.updateScript(),(0,t_.setViewEl)(this.el,this),this.postRender()),this},e.prototype.postRender=function(){if(!this.modelOpt.temporary){var t=this.model,e=this.el;this.onRender(this._clbObj()),t.emitWithEditor(tQ.I.render,{component:t,view:this,el:e}),this.rendered=!0}},e.getEvents=function(){return(0,tw.result)(this.prototype,"events")},e}(tT.Ss);var o$=(c8=function(t,e){return(c8=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c8(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o$(e,t),e}(oW),oG=(ut=function(t,e){return(ut=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ut(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oK=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oG(e,t),e.prototype.initialize=function(e){void 0===e&&(e={}),t.prototype.initialize.call(this,e),this.postRender=this.postRender.bind(this),this.listenTo(this.model.components(),"reset",this.postRender),this.dataResolverListener=new el({em:this.em,resolver:this.model.dataResolver,onUpdate:this.postRender})},e.prototype.renderDataResolver=function(){var t=this.model.getIfTrueContent(),e=this.model.getIfFalseContent(),n=null==t?void 0:t.getEl(),o=null==e?void 0:e.getEl(),r=this.model.isTrue();n&&(n.style.display=r?"":"none"),o&&(o.style.display=r?"none":"")},e.prototype.postRender=function(){this.renderDataResolver(),t.prototype.postRender.call(this)},e.prototype.remove=function(){return this.stopListening(this.model.components(),"reset",this.postRender),this.dataResolverListener.destroy(),t.prototype.remove.call(this)},e}(oW),oY=(ue=function(t,e){return(ue=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ue(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oJ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oY(e,t),e.prototype.initialize=function(e){var n=this;void 0===e&&(e={}),t.prototype.initialize.call(this,e),this.dataResolverListener=new el({em:this.em,resolver:this.model.dataResolver,onUpdate:function(){return n.postRender()}})},e.prototype.remove=function(){return this.dataResolverListener.destroy(),t.prototype.remove.call(this)},e.prototype.postRender=function(){var e=this.model;e.getDataResolver().asPlainText?this.el.textContent=e.getDataValue():this.el.innerHTML=e.getDataValue(),t.prototype.postRender.call(this)},e}(oW),oX=(un=function(t,e){return(un=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}un(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),oZ=function(){return(oZ=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},oQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oX(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return oZ(oZ({},t.prototype.defaults),{tagName:"",droppable:!1,layerable:!1,selectable:!1,editable:!0})},enumerable:!1,configurable:!0}),e.prototype.toHTML=function(){var t=this.content,e=this.parent();return(null==e?void 0:e.is("script"))?t:this.__escapeContent(t)},e.prototype.__escapeContent=function(t){return(0,t_.escapeNodeContent)(t)},e.isComponent=function(t){var e;if(3===t.nodeType)return{type:"textnode",content:null!==(e=t.textContent)&&void 0!==e?e:""}},e}(nW),o0=(uo=function(t,e){return(uo=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o1=function(){return(o1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o0(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return o1({},t.prototype.defaults)},enumerable:!1,configurable:!0}),e.prototype.toHTML=function(){return"<!--".concat(this.content,"-->")},e.isComponent=function(t){var e;if(8==t.nodeType)return{type:"comment",content:null!==(e=t.textContent)&&void 0!==e?e:""}},e}(oQ),o5=(ur=function(t,e){return(ur=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ur(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o3=function(){return(o3=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o4="iframe",o6=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o5(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return o3(o3({},t.prototype.defaults),{type:o4,tagName:o4,droppable:!1,resizable:!0,traits:["id","title","src"],attributes:{frameborder:"0"}})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===o4},e}(nW),o7=(ui=function(t,e){return(ui=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ui(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o9=function(){return(o9=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o8='xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 24 24" style="fill: rgba(0,0,0,0.15); transform: scale(0.75)"',rt=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,n)||this,r=o.get("attributes").src;return r&&(0,t_.buildBase64UrlFromSvg)((0,tw.result)(o,"defaults").src)!==r&&o.set("src",r,{silent:!0}),o}return o7(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return o9(o9({},t.prototype.defaults),{type:"image",tagName:"img",void:!0,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:["alt"],src:"<svg ".concat(o8,'>\n <path d="M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2z"></path>\n </svg>'),fallback:"<svg ".concat(o8,'>\n <path d="M2.28 3L1 4.27l2 2V19c0 1.1.9 2 2 2h12.73l2 2L21 21.72 2.28 3m2.55 0L21 19.17V5a2 2 0 0 0-2-2H4.83M8.5 13.5l2.5 3 1-1.25L14.73 18H5l3.5-4.5z"></path>\n </svg>'),file:""})},enumerable:!1,configurable:!0}),e.prototype.initToolbar=function(){t.prototype.initToolbar.call(this);var e=this.em;if(e){var n=e.Commands,o="image-editor";if(n.has(o)){for(var r=!1,i=this.get("toolbar"),a=0;a<i.length;a++)if("image-editor"===i[a].command){r=!0;break}r||(i.push({attributes:{class:"fa fa-pencil"},command:o}),this.set("toolbar",i))}}},e.prototype.getAttrToHTML=function(){var e=t.prototype.getAttrToHTML.call(this),n=this.getSrcResult();return n&&(e.src=n),e},e.prototype.getSrcResult=function(t){void 0===t&&(t={});var e=this.get(t.fallback?"fallback":"src")||"",n=e;return e&&"<svg"===e.substr(0,4)&&(n=(0,t_.buildBase64UrlFromSvg)(e)),n},e.prototype.isDefaultSrc=function(){var t=this.get("src"),e=(0,tw.result)(this,"defaults").src;return t===e||t===(0,t_.buildBase64UrlFromSvg)(e)},e.prototype.toJSON=function(e){var n=t.prototype.toJSON.call(this,e),o=n.attributes;return o&&n.src===o.src&&delete n.src,n},e.prototype.parseUri=function(t){var e={};if((0,t_.hasWin)())(e=document.createElement("a")).href=t;else if("undefined"!=typeof URL)try{e=new URL(t)}catch(t){}return{hostname:e.hostname||"",pathname:e.pathname||"",protocol:e.protocol||"",search:e.search||"",hash:e.hash||"",port:e.port||"",query:function(t){void 0===t&&(t="");for(var e={},n=t.substring(1).split("&"),o=0;o<n.length;o++){var r=n[o].split("="),i=decodeURIComponent(r[0]);i&&(e[i]=decodeURIComponent(r[1]||""))}return e}(e.search)}},e.isComponent=function(t){return"img"===(0,t_.toLowerCase)(t.tagName)},e}(nW),re=(ua=function(t,e){return(ua=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ua(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rn=function(){return(rn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ro=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,n)||this;return o.__checkInnerChilds(),o}return re(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rn(rn({},t.prototype.defaults),{type:"text",droppable:!1,editable:!0})},enumerable:!1,configurable:!0}),e.prototype.__checkInnerChilds=function(){var t=this.em.Components.config.disableTextInnerChilds;if(t){var e=function(t){t.isInstanceOf("textnode")||t.set({locked:!0,layerable:!1})};(0,tw.isFunction)(t)?this.forEachChild(function(n){t(n)&&e(n)}):this.forEachChild(e)}},e}(nW),rr=(us=function(t,e){return(us=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}us(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ri=function(){return(ri=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ra="label",rs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rr(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return ri(ri({},t.prototype.defaults),{type:ra,tagName:ra,traits:["id","title","for"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===ra},e}(ro),rl=(ul=function(t,e){return(ul=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ul(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rc=function(){return(rc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ru="link",rp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rl(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rc(rc({},t.prototype.defaults),{type:ru,tagName:"a",traits:["title","href","target"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t,e){if(void 0===e&&(e={}),"a"===(0,t_.toLowerCase)(t.tagName)){var n,o=e.textTags||[];n={type:ru,editable:!1};var r=t.childNodes;r.length||delete n.editable,(0,tw.forEach)(r,function(t){var e=t.tagName;(3==t.nodeType&&""!==t.textContent.trim()||e&&o.indexOf((0,t_.toLowerCase)(e))>=0)&&delete n.editable})}return n},e}(ro),rd=(uc=function(t,e){return(uc=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uc(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rf=function(){return(rf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rh=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,n)||this;return o.get("src")?o.parseFromSrc():o.updateSrc(),o.listenTo(o,"change:address change:zoom change:mapType",o.updateSrc),o}return rd(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){var e=t.prototype.defaults;return rf(rf({},e),{type:"map",src:"",void:!1,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:e.toolbar,traits:[{label:"Address",name:"address",placeholder:"eg. London, UK",changeProp:!0},{type:"select",label:"Map type",name:"mapType",changeProp:!0,options:[{id:"q",label:"Roadmap"},{id:"w",label:"Satellite"}]},{label:"Zoom",name:"zoom",type:"range",min:1,max:20,changeProp:!0}]})},enumerable:!1,configurable:!0}),e.prototype.updateSrc=function(){this.set("src",this.getMapUrl())},e.prototype.getMapUrl=function(){var t=this.get("address"),e=this.get("zoom"),n=this.get("mapType");return t=t?"&q="+t:"",e=e?"&z="+e:"",n=n?"&t="+n:"",this.get("mapUrl")+"?"+t+e+n+"&output=embed"},e.prototype.parseFromSrc=function(){var t=this.parseUri(this.get("src")).query;t.q&&this.set("address",t.q),t.z&&this.set("zoom",t.z),t.t&&this.set("mapType",t.t)},e.isComponent=function(t){if("iframe"==(0,t_.toLowerCase)(t.tagName)&&/maps\.google\.com/.test(t.src))return{type:"map",src:t.src}},e}(rt),rg=(uu=function(t,e){return(uu=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uu(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rv=function(){return(rv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ry="script",rm=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rg(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rv(rv({},t.prototype.defaults),{type:ry,tagName:ry,droppable:!1,draggable:!1,layerable:!1,highlightable:!1})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===ry},e}(nW),rb=(up=function(t,e){return(up=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}up(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rw=function(){return(rw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rb(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rw(rw({},t.prototype.defaults),{type:"svg",tagName:"svg",highlightable:!1,resizable:{ratioDefault:!0}})},enumerable:!1,configurable:!0}),e.prototype.getName=function(){var t=this.get("tagName"),e=this.get("custom-name");return t=t.charAt(0).toUpperCase()+t.slice(1),e||t},e.isComponent=function(t){return"svg"===(0,t_.toLowerCase)(t.tagName)},e}(nW),rC=(ud=function(t,e){return(ud=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ud(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rx=function(){return(rx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rC(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rx(rx({},t.prototype.defaults),{selectable:!1,hoverable:!1,layerable:!1})},enumerable:!1,configurable:!0}),e.isComponent=function(t,e){return void 0===e&&(e={}),!!e.inSvg},e}(r_),rO=(uf=function(t,e){return(uf=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rT=function(){return(rT=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rP="table",rE=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,n)||this,r=o.get("components");return r.length||r.add({type:"tbody"}),o}return rO(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rT(rT({},t.prototype.defaults),{type:rP,tagName:rP,droppable:["tbody","thead","tfoot"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===rP},e}(nW),rk=(uh=function(t,e){return(uh=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uh(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rA=function(){return(rA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rj="tbody",rM=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,n)||this,r=o.get("components"),i=o.get("columns"),a=o.get("rows");if(!r.length){for(var s=[];a--;){for(var l=[],c=i;c--;)l.push({type:"cell",classes:["cell"]});s.push({type:"row",classes:["row"],components:l})}r.add(s)}return o}return rk(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rA(rA({},t.prototype.defaults),{type:rj,tagName:rj,draggable:["table"],droppable:["tr"],columns:1,rows:1})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===rj},e}(nW),rD=(ug=function(t,e){return(ug=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ug(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rL=function(){return(rL=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rI=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rD(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rL(rL({},t.prototype.defaults),{type:"cell",tagName:"td",draggable:["tr"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return["td","th"].indexOf((0,t_.toLowerCase)(t.tagName))>=0},e}(nW),rN=(uv=function(t,e){return(uv=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uv(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rR=function(){return(rR=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rV="tfoot",rF=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rN(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rR(rR({},t.prototype.defaults),{type:rV,tagName:rV})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===rV},e}(rM),rH=(uy=function(t,e){return(uy=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uy(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rU=function(){return(rU=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rB="thead",rz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rH(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rU(rU({},t.prototype.defaults),{type:rB,tagName:rB})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,t_.toLowerCase)(t.tagName)===rB},e}(rM),rW=(um=function(t,e){return(um=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}um(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r$=function(){return(r$=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rW(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return r$(r$({},t.prototype.defaults),{tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return"tr"===(0,t_.toLowerCase)(t.tagName)},e}(nW),rG=(ub=function(t,e){return(ub=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ub(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),rK=function(){return(rK=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rY="video",rJ="ytnc",rX=function(t){return t&&"0"!==t},rZ=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,n)||this;return o.get("src")&&o.parseFromSrc(),o.updatePropsFromAttr(),o.updateTraits(),o.on("change:provider",o.updateTraits),o.on("change:videoId change:provider",o.updateSrc),o}return rG(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return rK(rK({},t.prototype.defaults),{type:rY,tagName:rY,videoId:"",void:!1,provider:"so",ytUrl:"https://www.youtube.com/embed/",ytncUrl:"https://www.youtube-nocookie.com/embed/",viUrl:"https://player.vimeo.com/video/",loop:!1,poster:"",muted:!1,autoplay:!1,controls:!0,color:"",list:"",src:"",rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:"allowfullscreen"}})},enumerable:!1,configurable:!0}),e.prototype.updatePropsFromAttr=function(){if("so"===this.get("provider")){var t=this.get("attributes"),e=t.controls,n=t.autoplay,o=t.loop,r=t.muted,i={};(0,t_.isDef)(e)&&(i.controls=!!e),(0,t_.isDef)(n)&&(i.autoplay=!!n),(0,t_.isDef)(o)&&(i.loop=!!o),(0,t_.isDef)(r)&&(i.muted=!!r),(0,t_.isEmptyObj)(i)||this.set(i)}},e.prototype.updateTraits=function(){var t,e=this.em,n=this.get("provider"),o="iframe";switch(n){case"yt":case rJ:t=this.getYoutubeTraits();break;case"vi":t=this.getVimeoTraits();break;default:o="video",t=this.getSourceTraits()}this.set({tagName:o},{silent:!0}),this.set({traits:t}),e.get("ready")&&e.trigger("component:toggled")},e.prototype.parseFromSrc=function(){var t=this.get("provider"),e=this.parseUri(this.get("src")),n=e.query;switch(t){case"yt":case rJ:case"vi":this.set("videoId",e.pathname.split("/").pop()),n.list&&this.set("list",n.list),rX(n.autoplay)&&this.set("autoplay",!0),rX(n.loop)&&this.set("loop",!0),0===parseInt(n.controls)&&this.set("controls",!1),rX(n.color)&&this.set("color",n.color),"0"===n.rel&&this.set("rel",0),"1"===n.modestbranding&&this.set("modestbranding",1),"1"===n.muted&&this.set("muted",!0)}},e.prototype.updateSrc=function(){var t=this.get("provider"),e="";switch(t){case"yt":e=this.getYoutubeSrc();break;case rJ:e=this.getYoutubeNoCookieSrc();break;case"vi":e=this.getVimeoSrc()}this.set({src:e})},e.prototype.getAttrToHTML=function(){var e=t.prototype.getAttrToHTML.call(this);switch(this.get("provider")){case"yt":case rJ:case"vi":break;default:e.loop=!!this.get("loop"),e.autoplay=!!this.get("autoplay"),e.controls=!!this.get("controls"),e.muted=!!this.get("muted")}return e},e.prototype.getProviderTrait=function(){return{type:"select",label:"Provider",name:"provider",changeProp:!0,options:[{value:"so",name:"HTML5 Source"},{value:"yt",name:"Youtube"},{value:rJ,name:"Youtube (no cookie)"},{value:"vi",name:"Vimeo"}]}},e.prototype.getSourceTraits=function(){return[this.getProviderTrait(),{label:"Source",name:"src",placeholder:"eg. ./media/video.mp4",changeProp:!0},{label:"Poster",name:"poster",placeholder:"eg. ./media/image.jpg"},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait(),this.getMutedTrait()]},e.prototype.getYoutubeTraits=function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. jNQXAC9IVRw",changeProp:!0},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait(),{type:"checkbox",label:"Related",name:"rel",changeProp:!0},{type:"checkbox",label:"Modest",name:"modestbranding",changeProp:!0},this.getMutedTrait()]},e.prototype.getVimeoTraits=function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. 123456789",changeProp:!0},{label:"Color",name:"color",placeholder:"eg. FF0000",changeProp:!0},this.getAutoplayTrait(),this.getLoopTrait(),this.getMutedTrait()]},e.prototype.getAutoplayTrait=function(){return{type:"checkbox",label:"Autoplay",name:"autoplay",changeProp:!0}},e.prototype.getLoopTrait=function(){return{type:"checkbox",label:"Loop",name:"loop",changeProp:!0}},e.prototype.getControlsTrait=function(){return{type:"checkbox",label:"Controls",name:"controls",changeProp:!0}},e.prototype.getMutedTrait=function(){return{type:"checkbox",label:"Muted",name:"muted",changeProp:!0}},e.prototype.getYoutubeSrc=function(){var t=this.get("videoId"),e=this.get("ytUrl"),n=this.get("list");return e+(t+(0>t.indexOf("?")?"?":"")+(n?"&list=".concat(n):"")+(this.get("autoplay")?"&autoplay=1":"")+(this.get("muted")?"&mute=1":"")+(this.get("controls")?"":"&controls=0&showinfo=0")+(this.get("loop")?"&loop=1&playlist=".concat(t):"")+(this.get("rel")?"":"&rel=0"))+(this.get("modestbranding")?"&modestbranding=1":"")},e.prototype.getYoutubeNoCookieSrc=function(){return this.getYoutubeSrc().replace(this.get("ytUrl"),this.get("ytncUrl"))},e.prototype.getVimeoSrc=function(){return this.get("viUrl")+(this.get("videoId")+"?"+(this.get("autoplay")?"&autoplay=1":"")+(this.get("muted")?"&muted=1":"")+(this.get("loop")?"&loop=1":"")+(this.get("controls")?"":"&title=0&portrait=0&badge=0"))+(this.get("color")?"&color="+this.get("color"):"")},e.isComponent=function(t){var e=t.tagName,n=t.src,o=/youtube\.com\/embed/.test(n),r=/youtube-nocookie\.com\/embed/.test(n),i=/player\.vimeo\.com\/video/.test(n),a=o||r||i;if((0,t_.toLowerCase)(e)==rY||"iframe"==(0,t_.toLowerCase)(e)&&a){var s={type:"video"};return n&&(s.src=n),a&&(o?s.provider="yt":r?s.provider=rJ:i&&(s.provider="vi")),s}},e}(rt),rQ=(uw=function(t,e){return(uw=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uw(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r0=function(){return(r0=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r1=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,n)||this;return o._resolverCurrentItem=0,o._isWatchingCollectionStateMap=!1,o.dataResolverProps&&(o.onDataSourceChange(),o.syncComponentsCollectionState()),o}return rQ(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return r0(r0({},t.prototype.defaults),{dataResolver:null,tagName:"body",removable:!1,copyable:!1,draggable:!1,components:[],traits:[],doctype:"",head:null,docEl:null,stylable:["background","background-color","background-image","background-repeat","background-attachment","background-position","background-size"]})},enumerable:!1,configurable:!0}),e.prototype.preInit=function(){var t,e,n=this.opt,o=this.attributes,r=null===(t=this.em)||void 0===t?void 0:t.Components,i=null===(e=null==r?void 0:r.getType(nG))||void 0===e?void 0:e.model,a=null==r?void 0:r.getType("default").model;if(i){var s=o.head,l=o.docEl;this.set({head:s&&s instanceof nW?s:new i(r0({},s),n),docEl:l&&l instanceof nW?l:new a(r0({tagName:"html"},l),n)},{silent:!0})}},Object.defineProperty(e.prototype,"head",{get:function(){return this.get("head")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"docEl",{get:function(){return this.get("docEl")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doctype",{get:function(){return this.attributes.doctype||""},enumerable:!1,configurable:!0}),e.prototype.clone=function(e){var n=t.prototype.clone.call(this,e);return n.set("head",this.get("head").clone(e)),n.set("docEl",this.get("docEl").clone(e)),n},e.prototype.toHTML=function(e){void 0===e&&(e={});var n=this.doctype,o=(0,tw.isUndefined)(e.asDocument)?!!n:e.asDocument,r=this.head,i=this.docEl,a=t.prototype.toHTML.call(this,e),s=o&&(null==r?void 0:r.toHTML(e))||"",l=o&&(0,t3.kk)(null==i?void 0:i.getAttrToHTML())||"";return o?"".concat(n,"<html").concat(l?" ".concat(l):"",">").concat(s).concat(a,"</html>"):a},e.prototype.onCollectionsStateMapUpdate=function(e){var n=this.head;t.prototype.onCollectionsStateMapUpdate.call(this,e),n.onCollectionsStateMapUpdate(e)},e.prototype.syncComponentsCollectionState=function(){t.prototype.syncComponentsCollectionState.call(this),this.head.syncComponentsCollectionState()},e.prototype.syncOnComponentChange=function(e,n,o){var r=this.getCollectionsStateMap();this.collectionsStateMap=r,t.prototype.syncOnComponentChange.call(this,e,n,o),this.onCollectionsStateMapUpdate(r)},Object.defineProperty(e.prototype,"resolverCurrentItem",{get:function(){return this._resolverCurrentItem},set:function(t){this._resolverCurrentItem=t,this.onCollectionsStateMapUpdate(this.getCollectionsStateMap())},enumerable:!1,configurable:!0}),e.prototype.setResolverCurrentItem=function(t){this.resolverCurrentItem=t},e.prototype.onDataSourceChange=function(){this.onCollectionsStateMapUpdate(this.getCollectionsStateMap())},e.prototype.listenToPropsChange=function(){var t=this;this.on("change:dataResolver",function(e,n){var o=!(0,tw.isUndefined)(n);o&&!t._isWatchingCollectionStateMap?(t._isWatchingCollectionStateMap=!0,t.syncComponentsCollectionState(),t.onCollectionsStateMapUpdate(t.getCollectionsStateMap()),t.listenToDataSource()):!o&&t._isWatchingCollectionStateMap&&(t._isWatchingCollectionStateMap=!1,t.stopSyncComponentCollectionState())}),this.listenToDataSource()},e.prototype.getCollectionsStateMap=function(){var t,e=this.dataResolverPath,n=this.resolverCurrentItem,o=this.em.DataSources;if(!e)return{};var r=p$.rootData,i=this.getDataSourceItems(),a=(0,tw.isNumber)(n)?i[n]:(0,tw.isString)(n)?o.getValue("".concat(e,".").concat(n)):i;return(t={})[r]={collectionId:r,currentItem:a},t},e.prototype.__postAdd=function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.UndoManager;return this.__hasUm||null==n||n.add(this),t.prototype.__postAdd.call(this)},e.prototype.__postRemove=function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.UndoManager;return null==n||n.remove(this),t.prototype.__postRemove.call(this)},e.isComponent=function(){return!1},e}(oI),r2=(u_=function(t,e){return(u_=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r5=function(){return(r5=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r3=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=t.apply(this,e)||this;o.refreshDbn=(0,tw.debounce)(function(){return o.refresh()},0);var r=o.events;return o.on(r.update,o.onUpdate),o.on(r.updateInside,o.onUpdateDeep),o}return r2(e,t),e.prototype.removeChildren=function(e,n,o){var r;void 0===o&&(o={}),t.prototype.removeChildren.call(this,e,n,o),null===(r=eL(e))||void 0===r||r.forEach(function(t){return eV(t,{skipRefs:!0})}),this.__trgEvent(this.events.symbolMainRemove,{component:e})},e.prototype.onAdd=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.prototype.onAdd.apply(this,e);var o=e[0];this.__trgEvent(this.events.symbolMainAdd,{component:o})},e.prototype.onUpdate=function(t){this.__trgEvent(this.events.symbolMainUpdate,t)},e.prototype.onUpdateDeep=function(t){this.__trgEvent(this.events.symbolMainUpdateDeep,t)},e.prototype.refresh=function(){var t=this.em,e=this.events;t.trigger(e.symbol)},e.prototype.__trgEvent=function(t,e,n){void 0===n&&(n=!1);var o=this.em,r=this.events,i=n?r.symbolInstance:r.symbolMain;o.trigger(t,e),o.trigger(i,r5(r5({},e),{event:t})),this.refreshDbn()},e}(nj),r4=(uC=function(t,e){return(uC=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uC(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r6=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r4(e,t),e.prototype._setAttributes=function(){},e.prototype.renderAttributes=function(){},e.prototype.updateStatus=function(){},e.prototype.updateClasses=function(){},e.prototype.setAttribute=function(){},e.prototype.updateAttributes=function(){},e.prototype.initClasses=function(){},e.prototype.initComponents=function(){},e.prototype.delegateEvents=function(){return this},e.prototype._createElement=function(){return document.createTextNode("")},e.prototype.render=function(){var t=this.model,e=this.el;return t.opt.temporary||(e.textContent=t.content),this},e}(oW),r7=(ux=function(t,e){return(ux=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ux(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r9=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r7(e,t),e.prototype._createElement=function(){return document.createComment(this.model.content)},e}(r6),r8=(uS=function(t,e){return(uS=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uS(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r8(e,t),e.prototype.tagName=function(){return"div"},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:attributes:src",this.updateSrc)},e.prototype.updateSrc=function(){var t=(0,t3.I6)(this.el,"iframe")[0];t&&(0,t3.X6)(t,{src:this.__getSrc()})},e.prototype.render=function(){t.prototype.render.call(this);var e=(0,t3.a_)("iframe",{class:"".concat(this.ppfx,"no-pointer"),style:"width: 100%; height: 100%; border: none",src:this.__getSrc()});return this.el.appendChild(e),this},e.prototype.__getSrc=function(){return this.model.getAttributes().src||""},e}(oW),ie=(uO=function(t,e){return(uO=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uO(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),io=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ie(e,t),e.prototype.tagName=function(){return"img"},e.prototype.events=function(){return{dblclick:"onActive",click:"initResize",error:"onError",load:"onLoad",dragstart:"noDrag"}},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:src",this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image"),this.fetchFile()},e.prototype.fetchFile=function(){if(!this.modelOpt.temporary){var t=this.model,e=this.em,n=t.get("file");if(n&&e){var o=e.Assets.FileUploader();null==o||o.uploadFile({dataTransfer:{files:[n]}},function(e){var n=e&&e.data&&e.data[0],o=n&&((0,tw.isString)(n)?n:n.src);o&&t.set({src:o})},{componentView:this,file:n}),t.set("file","")}}},e.prototype.updateSrc=function(){var t=this.model;t.addAttributes({src:t.getSrcResult()}),this.updateClasses()},e.prototype.updateClasses=function(){t.prototype.updateClasses.call(this);var e=this.el,n=this.classEmpty,o=this.model,r=o.getSrcResult()&&!o.isDefaultSrc();e.classList[r?"remove":"add"](n)},e.prototype.onActive=function(t){null==t||t.stopPropagation();var e=this.em,n=this.model,o=null==e?void 0:e.Assets;o&&n.get("editable")&&o.open({select:function(t,e){n.set({src:t.getSrc()}),e&&o.close()},target:n,types:["image"],accept:"image/*"})},e.prototype.onError=function(){var t=this.model,e=this.el,n=t.getSrcResult({fallback:!0});n&&(e.srcset&&(e.srcset=""),e.src=n)},e.prototype.onLoad=function(){this.em.Canvas.refresh({all:!0})},e.prototype.noDrag=function(t){return t.preventDefault(),!1},e.prototype.render=function(){if(this.renderAttributes(),this.modelOpt.temporary)return this;this.updateSrc();var t=this.$el,e=this.model,n=t.attr("class")||"";return e.get("src")||t.attr("class","".concat(n," ").concat(this.classEmpty).trim()),this.postRender(),this},e}(oW),ir=(uT=function(t,e){return(uT=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uT(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ii=function(){return(ii=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ia=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},is=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},il=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ir(e,t),e.prototype.events=function(){return{dblclick:"onActive",input:"onInput"}},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),(0,tw.bindAll)(this,"disableEditing","onDisable");var n=this.model,o=this.em;this.listenTo(n,"focus",this.onActive),this.listenTo(n,"change:content",this.updateContentText),this.listenTo(n,"sync:content",this.syncContent),this.rte=null==o?void 0:o.RichTextEditor},e.prototype.updateContentText=function(t,e,n){void 0===n&&(n={}),n.fromDisable||this.disableEditing()},e.prototype.canActivate=function(){var t,e=this.model,n=this.rteEnabled,o=this.em,r=null==o?void 0:o.getEditing(),i=!0,a=!1;if((n||!e.get("editable")||r===e||(a=e.isChildOf("text")))&&(i=!1,a&&!e.get("textable"))){for(var s=e.parent();s&&!s.isInstanceOf("text");)s=s.parent();s&&s.get("editable")?t=s:i=!0}return{result:i,delegate:t}},e.prototype.onActive=function(t){return ia(this,void 0,void 0,function(){var e,n,o,r,i,a,s,l,c,u,p,d;return is(this,function(f){switch(f.label){case 0:if(e=this,n=e.rte,o=e.em,i=(r=this.canActivate()).result,a=r.delegate,!i)return a&&(null===(p=null==t?void 0:t.stopPropagation)||void 0===p||p.call(t),o.setSelected(a),a.trigger("active",t)),[2];return null===(d=null==t?void 0:t.stopPropagation)||void 0===d||d.call(t),s=this,[4,this.getContent()];case 1:if(s.lastContent=f.sent(),!n)return[3,5];f.label=2;case 2:return f.trys.push([2,4,,5]),l=this,c=this,[4,n.enable(l,this.activeRte,{event:t,view:l})];case 3:return c.activeRte=f.sent(),[3,5];case 4:return u=f.sent(),o.logError(u),[3,5];case 5:return this.toggleEvents(!0),[2]}})})},e.prototype.onDisable=function(t){this.disableEditing(t)},e.prototype.disableEditing=function(){return ia(this,arguments,void 0,function(t){var e,n,o,r,i,a,s,l,c;return void 0===t&&(t={}),is(this,function(u){switch(u.label){case 0:if(e=this,n=e.model,o=e.rte,r=e.activeRte,i=e.em,a=n&&n.get("editable"),!o)return[3,7];return s={},[4,this.getContent()];case 1:l=u.sent(),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,o.disable(this,r,t)];case 3:return s=u.sent(),[3,5];case 4:return c=u.sent(),i.logError(c),[3,5];case 5:if(!(a&&(l!==this.lastContent||s.forceSync)))return[3,7];return[4,this.syncContent(ii(ii({},t),{content:l}))];case 6:u.sent(),this.lastContent="",u.label=7;case 7:return this.toggleEvents(),[2]}})})},e.prototype.getContent=function(){return ia(this,void 0,void 0,function(){var t,e,n,o;return is(this,function(r){switch(r.label){case 0:if(t=this,e=t.rte,n=t.activeRte,o="",!e)return[3,2];return[4,e.getContent(this,n)];case 1:o=r.sent(),r.label=2;case 2:return[2,o]}})})},e.prototype.syncContent=function(){return ia(this,arguments,void 0,function(t){var e,n,o,r,i,a,s,l;return void 0===t&&(t={}),is(this,function(c){switch(c.label){case 0:if(e=this,n=e.model,o=e.rte,!e.rteEnabled&&!t.force)return[2];if(!(null!==(l=t.content)&&void 0!==l))return[3,1];return i=l,[3,3];case 1:return[4,this.getContent()];case 2:i=c.sent(),c.label=3;case 3:return r=i,a=n.components(),s=ii({fromDisable:1},t),n.set("content","",s),(null==o?void 0:o.customRte)&&!o.customRte.parseContent?(a.length&&a.reset(void 0,ii(ii({},t),{keepIds:nk(a)})),n.set("content",r,s)):a.resetFromString(r,t),[2]}})})},e.prototype.insertComponent=function(t,e){void 0===e&&(e={});var n,o=this.model,r=this.el.ownerDocument.getSelection();if(null==r?void 0:r.rangeCount){var i=r.getRangeAt(0),a=i.startContainer,s=i.startOffset,l=(0,t_.getComponentModel)(a),c=[];if(l&&(null===(n=l.is)||void 0===n?void 0:n.call(l,"textnode"))){var u=l.collection;u.forEach(function(n){if(n===l){var o="textnode",r=e.useDomContent?a.textContent||"":n.content;c.push({type:o,content:r.slice(0,s)}),c.push(t),c.push({type:o,content:r.slice(s)})}else c.push(n)});var p=c.filter(Boolean),d=p.indexOf(t);return u.reset(p,e),u.at(d)}}return o.append(t,e)},e.prototype.onInput=function(){var t=this.model;[tQ.I.update,tQ.I.input].forEach(function(e){return t.emitWithEditor(e,t)})},e.prototype.disablePropagation=function(t){t.stopPropagation()},e.prototype.toggleEvents=function(t){var e=this.em,n=this.model,o=this.$el,r={on:t3.on,off:t3.AU},i=t?"on":"off";e.setEditing(!!t&&this),this.rteEnabled=!!t;var a=[this.el.ownerDocument,document];if(r.off(a,"mousedown",this.onDisable),r[i](a,"mousedown",this.onDisable),e[i]("toolbar:run:before",this.onDisable),n){var s=e.RichTextEditor.events;n[i]("removed",this.onDisable),n.trigger(t?s.enable:s.disable)}if(null==o||o.off("mousedown",this.disablePropagation),o&&o[i]("mousedown",this.disablePropagation),this.config.draggableComponents)for(var l=this.el;l;)l.draggable=!t,(l=l.parentNode)&&"BODY"==l.tagName&&(l=0)},e}(oW),ic=(uP=function(t,e){return(uP=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uP(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ic(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.el.addEventListener("click",this.prevDef,!0),this},e}(il),ip=(uE=function(t,e){return(uE=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uE(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),id=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ip(e,t),e}(iu),ih=(uk=function(t,e){return(uk=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uk(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ig=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ih(e,t),e.prototype.tagName=function(){return"div"},e.prototype.events=function(){return{}},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.classEmpty=this.ppfx+"plh-map"},e.prototype.updateSrc=function(){this.getIframe().src=this.model.get("src")},e.prototype.getIframe=function(){if(!this.iframe){var t=document.createElement("iframe");t.src=this.model.get("src"),t.frameBorder="0",t.style.height="100%",t.style.width="100%",t.className=this.ppfx+"no-pointer",this.iframe=t}return this.iframe},e.prototype.render=function(){return t.prototype.render.call(this),this.updateClasses(),this.el.appendChild(this.getIframe()),this},e}(io),iv=(uA=function(t,e){return(uA=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uA(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iv(e,t),e.prototype.tagName=function(){return"script"},e.prototype.events=function(){return{}},e}(oW),im=(uj=function(t,e){return(uj=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uj(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ib=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return im(e,t),e.prototype._createElement=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},e}(oW),iw=(uM=function(t,e){return(uM=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uM(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iw(e,t),e}(oW),iC=(uD=function(t,e){return(uD=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uD(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ix=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iC(e,t),e}(oW),iS=(uL=function(t,e){return(uL=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uL(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iS(e,t),e}(oW),iT=(uI=function(t,e){return(uI=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uI(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iP=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iT(e,t),e}(oW),iE=(uN=function(t,e){return(uN=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uN(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ik=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iE(e,t),e}(oW),iA=(uR=function(t,e){return(uR=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uR(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ij=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iA(e,t),e.prototype.events=function(){return{}},e}(oW),iM=(uV=function(t,e){return(uV=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uV(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iM(e,t),e.prototype.tagName=function(){return"div"},e.prototype.events=function(){return{}},e.prototype.initialize=function(){oW.prototype.initialize.apply(this,arguments);var t=this.model,e=["loop","autoplay","controls","color","rel","modestbranding","poster","muted"].map(function(t){return"change:".concat(t)}).join(" ");this.listenTo(t,"change:provider",this.updateProvider),this.listenTo(t,"change:src",this.updateSrc),this.listenTo(t,e,this.updateVideo)},e.prototype.updateProvider=function(){var t=this.model.get("provider");this.el.innerHTML="",this.el.appendChild(this.renderByProvider(t))},e.prototype.updateSrc=function(){var t=this.model,e=this.videoEl;if(e){var n=t.get("provider"),o=t.get("src");switch(n){case"yt":o=t.getYoutubeSrc();break;case"ytnc":o=t.getYoutubeNoCookieSrc();break;case"vi":o=t.getVimeoSrc()}e.src=o}},e.prototype.updateVideo=function(){var t=this.model,e=this.videoEl;switch(t.get("provider")){case"yt":case"ytnc":case"vi":t.trigger("change:videoId");break;default:e&&(e.loop=t.get("loop"),e.autoplay=t.get("autoplay"),e.controls=t.get("controls"),e.poster=t.get("poster"),e.muted=t.get("muted"))}},e.prototype.renderByProvider=function(t){var e;switch(t){case"yt":e=this.renderYoutube();break;case"ytnc":e=this.renderYoutubeNoCookie();break;case"vi":e=this.renderVimeo();break;default:e=this.renderSource()}return this.videoEl=e,e},e.prototype.renderSource=function(){var t=document.createElement("video");return t.src=this.model.get("src"),this.initVideoEl(t),t},e.prototype.renderYoutube=function(){var t=document.createElement("iframe");return t.src=this.model.getYoutubeSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},e.prototype.renderYoutubeNoCookie=function(){var t=document.createElement("iframe");return t.src=this.model.getYoutubeNoCookieSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},e.prototype.renderVimeo=function(){var t=document.createElement("iframe");return t.src=this.model.getVimeoSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},e.prototype.initVideoEl=function(t){t.className=this.ppfx+"no-pointer",t.style.height="100%",t.style.width="100%"},e.prototype.render=function(){oW.prototype.render.apply(this),this.updateClasses();var t=this.model.get("provider");return this.el.appendChild(this.renderByProvider(t)),this.updateVideo(),this},e}(io),iL=(uF=function(t,e){return(uF=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uF(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iI=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iL(e,t),e.prototype.tagName=function(){return"div"},e}(oW),iN=(uH=function(t,e){return(uH=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uH(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iR=function(){return(iR=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},iV=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},iF=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(uU=p0||(p0={}))[uU.InvalidSource=0]="InvalidSource",uU[uU.SourceReject=1]="SourceReject",uU[uU.TargetReject=2]="TargetReject";var iH=function(t){function e(e){var n=t.call(this,e,"DomComponents",new nj(void 0,{em:e}),tQ.I,{stylePrefix:"comp-",components:[],draggableComponents:!0,disableTextInnerChilds:!1,processor:void 0,useFrameDoc:!1,voidElements:["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]})||this;n.componentTypes=[{id:pW.collectionItem,model:o_,view:oW},{id:pW.conditionTrue,model:o_,view:oW},{id:pW.conditionFalse,model:o_,view:oW},{id:pW.collection,model:oF,view:oq},{id:pW.condition,model:om,view:oK},{id:pW.variable,model:og,view:oJ},{id:"cell",model:rI,view:ix},{id:"row",model:rq,view:ik},{id:"table",model:rE,view:ij},{id:"thead",model:rz,view:iP},{id:"tbody",model:rM,view:i_},{id:"tfoot",model:rF,view:iO},{id:"map",model:rh,view:ig},{id:"link",model:rp,view:iu},{id:"label",model:rs,view:id},{id:"video",model:rZ,view:iD},{id:"image",model:rt,view:io},{id:"script",model:rm,view:iy},{id:"svg-in",model:rS,view:ib},{id:"svg",model:r_,view:ib},{id:"iframe",model:o6,view:it},{id:"comment",model:o2,view:r9},{id:"textnode",model:oQ,view:r6},{id:nG,model:nY,view:oW},{id:"wrapper",model:r1,view:iI},{id:"text",model:ro,view:il},{id:"default",model:nW,view:oW}],n.componentsById={},n.Component=nW,n.Components=nj,n.ComponentView=oW,n.ComponentsView=oU,n.storageKey="components",n.keySymbols="symbols",n.events=tQ.I;var o=n.config;n.symbols=new r3([],{em:e,config:o,domc:n}),e&&(n.config.components=e.config.components||n.config.components);var r=n.config.pStylePrefix;if(r&&(n.config.stylePrefix=r+n.config.stylePrefix),e){e.get("Parser").compTypes=n.componentTypes,e.on("change:componentHovered",n.componentHovered,n);var i=e.get("selected");e.listenTo(i,"add",function(t,e,o){return n.selectAdd(i.getComponent(t),o)}),e.listenTo(i,"remove",function(t,e,o){return n.selectRemove(i.getComponent(t),o)})}return n}return iN(e,t),e.prototype.postLoad=function(){var t=this.em,e=this.symbols;t.UndoManager.add(e)},e.prototype.load=function(t){var e=this,n=this.loadProjectData(t,{onResult:function(t){var n=e.getWrapper();if(n||(e.em.Pages.add({},{select:!0}),n=e.getWrapper()),(0,tw.isArray)(t))t.length&&n.components(t);else{var o=t.components,r=iV(t,["components"]);n.set(r),n.components(void 0===o?[]:o)}}});return this.symbols.reset(t[this.keySymbols]||[]),n},e.prototype.store=function(){var t;return(t={})[this.keySymbols]=this.symbols,t},e.prototype.getComponent=function(){var t=this.em.Pages.getSelected(),e=null==t?void 0:t.getMainFrame();return null==e?void 0:e.getComponent()},e.prototype.getWrapper=function(){return this.getComponent()},e.prototype.getComponents=function(){var t=this.getWrapper();return null==t?void 0:t.components()},e.prototype.addComponent=function(t,e){return void 0===e&&(e={}),this.getComponents().add(t,e)},e.prototype.render=function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.render().el},e.prototype.clear=function(t){void 0===t&&(t={});var e=this.getComponents();return null==e||e.filter(Boolean).forEach(function(e){return e.remove(t)}),this},e.prototype.setComponents=function(t,e){void 0===e&&(e={}),this.clear(e).addComponent(t,e)},e.prototype.addType=function(t,e){var n=this.em,o=e.model,r=void 0===o?{}:o,i=e.view,a=void 0===i?{}:i,s=e.isComponent,l=e.extend,c=e.extendView,u=e.extendFn,p=e.extendFnView,d=e.block,f=this.getType(t),h=this.getType(l),g=this.getType(c),v=h||f||this.getType("default"),y=v.model,m=g?g.view:v.view,b=function(t,e,n){return t.reduce(function(t,o){var r=e[o],i=n.prototype[o];return r&&i&&(t[o]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.bind(this).apply(void 0,t),r.bind(this).apply(void 0,t)}),t},{})};if("object"==typeof r){var w={defaults:r.defaults};delete r.defaults;var _=new Set(y.typeExtends);_.add(y.getDefaults().type),e.model=y.extend(iR(iR({},r),b(void 0===u?[]:u,r,y)),{typeExtends:_,isComponent:!f||h||s?s||function(){return 0}:y.isComponent}),Object.defineProperty(e.model.prototype,"defaults",{get:function(){return iR(iR({},(0,tw.result)(y.prototype,"defaults")||{}),(0,tw.result)(w,"defaults")||{})}})}if("object"==typeof a&&(e.view=m.extend(iR(iR({},a),b(void 0===p?[]:p,a,m)))),f?(f.model=e.model,f.view=e.view):(e.id=t,this.componentTypes.unshift(e)),d){var C={id:t,label:t,content:{type:t}},x=!0===d?C:iR(iR({},C),d);n.Blocks.add(x.id||t,x)}var S="component:type:".concat(f?"update":"add");return null==n||n.trigger(S,f||e),this},e.prototype.getType=function(t){for(var e=this.componentTypes,n=0;n<e.length;n++)if(e[n].id==t)return e[n]},e.prototype.removeType=function(t){var e=this.componentTypes,n=this.getType(t);if(n){var o=e.indexOf(n);return e.splice(o,1),n}},e.prototype.getTypes=function(){return this.componentTypes},e.prototype.selectAdd=function(t,e){var n=this;void 0===e&&(e={}),t&&(t.set({status:"selected"}),["component:selected","component:toggled"].forEach(function(o){return n.em.trigger(o,t,e)}))},e.prototype.selectRemove=function(t,e){var n=this;void 0===e&&(e={}),t&&(this.em,t.set({status:"",state:""}),["component:deselected","component:toggled"].forEach(function(o){return n.em.trigger(o,t,e)}))},e.prototype.componentHovered=function(){var t=this.em,e=t.get("componentHovered"),n=t.previous("componentHovered"),o="hovered";n&&n.get("status")==o&&n.set({status:"",state:""}),e&&(0,tw.isEmpty)(e.get("status"))&&e.set("status",o)},e.prototype.getShallowWrapper=function(){var t=this.shallow,e=this.em;if(!t&&e){var n=e.shallow;if(!n)return;var o=n.Components;if(o.componentTypes=this.componentTypes,t=o.getWrapper()){var r=[nB,nz].join(" ");t.on(r,(0,tw.debounce)(function(){return null==t?void 0:t.components("")},100))}this.shallow=t}return t},e.prototype.isComponent=function(t){return(0,t_.isComponent)(t)},e.prototype.addSymbol=function(t){if(!(0,tw.isSymbol)(t)||ej(t)){var e=t.clone({symbol:!0});return eE(e)&&this.symbols.add(e),this.em.trigger("component:toggled"),e}},e.prototype.getSymbols=function(){return iF([],this.symbols.models,!0)},e.prototype.detachSymbol=function(t){ek(t)&&eV(t)},e.prototype.getSymbolInfo=function(t,e){void 0===e&&(e={});var n=eE(t),o=eD(t),r=!!o,i=(n?eL(t):eL(o))||[],a=o||(n?t:void 0),s=eN(t,{changed:e.withChanges}),l=n||r,c=l&&ej(t);return{isSymbol:l,isMain:n,isInstance:r,isRoot:c,main:a,instances:i,relatives:s||[]}},e.prototype.canMove=function(t,e,n){var o={result:!1,reason:p0.InvalidSource,target:t,source:null};if(!e||!t)return o;if(eA(t)&&e instanceof nW&&eA(e)){var r=eR(t),i=eE(r)?r:eD(r),a=eR(e),s=eE(a)?a:eD(a),l=r!==a;if(i===s&&l)return iR(iR({},o),{reason:p0.TargetReject})}var c=(0,t_.isComponent)(e)?e:null;if(!c){var u=this.getShallowWrapper();c=(null==u?void 0:u.append(e,{temporary:!0})[0])||null}if(o.source=c,!c)return o;var p=c.get("draggable");if((0,tw.isFunction)(p))p=!!p(c,t,n);else{var d=t.getEl();p=(0,tw.isArray)(p)?p.join(","):p,p=(0,tw.isString)(p)?null==d?void 0:d.matches(p):p}if(!p)return iR(iR({},o),{reason:p0.SourceReject});var f=t.get("droppable");if((0,tw.isFunction)(f))f=!!f(c,t,n);else if(!1===f&&t.isInstanceOf("text")&&c.get("textable"))f=!0;else{var d=c.getEl();f=(0,tw.isArray)(f)?f.join(","):f,f=(0,tw.isString)(f)?null==d?void 0:d.matches(f):f}var h=[t].concat(t.parents()).indexOf(c)>-1;return!f||h?iR(iR({},o),{reason:p0.TargetReject}):iR(iR({},o),{result:!0})},e.prototype.allById=function(){return this.componentsById},e.prototype.getById=function(t){return this.componentsById[t]||null},e.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach(function(t){return e[t]&&e[t].remove()}),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach(function(t){return{}})},e}(tL),iU=(uB=function(t,e){return(uB=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uB(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iB=Number.MAX_VALUE,iz=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?e[0]:""},iW=function(t){function e(){var e=t.call(this)||this;return(0,tw.bindAll)(e,"sortRules"),e.compCls=[],e.ids=[],e}return iU(e,t),e.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var o="",r=this.em,i=r&&r.getConfig().avoidInlineStyle,a=t.styleToString(),s=t.classes;return this.ids.push("#".concat(t.getId())),s.forEach(function(t){return n.compCls.push(t.getFullName())}),!i&&a&&(o="#".concat(t.getId(),"{").concat(a,"}")),t.components().forEach(function(t){return o+=n.buildFromModel(t,e)}),o},e.prototype.build=function(t,e){var n=this;void 0===e&&(e={});var o=e.json,r=e.em,i=e.cssc||(null==r?void 0:r.Css);this.em=r,this.compCls=[],this.ids=[],this.model=t;var a=[],s=t?this.buildFromModel(t,e):"",l=(0,tw.isUndefined)(e.clearStyles)&&r?r.getConfig().clearStyles:e.clearStyles;if(i){var c=e.rules||i.getAll(),u={},p=[];e.onlyMatched&&t&&(0,t_.hasWin)()&&(c=this.matchedRules(t,c)),c.forEach(function(t){var r=t.getAtRule();if(r){var i=u[r];i?i.push(t):u[r]=[t];return}var l=n.buildFromRule(t,p,e);o?a.push(l):s+=l}),this.sortMediaObject(u).forEach(function(t){var r="",i=t.key;t.value.forEach(function(t){var l=n.buildFromRule(t,p,e);t.get("singleAtRule")?s+="".concat(i,"{").concat(l,"}"):r+=l,o&&a.push(l)}),r&&(s+="".concat(i,"{").concat(r,"}"))}),r&&l&&c.remove&&c.remove(p)}return o?a.filter(function(t){return t}):s},e.prototype.buildFromRule=function(t,e,n){var o,r,i=this;void 0===n&&(n={});var a="",s=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get("selectorsAdd"),u=t.get("singleAtRule");if(null===(o=t.get("selectors"))||void 0===o||o.forEach(function(t){var e=t.getFullName();(i.compCls.indexOf(e)>=0||i.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(r=1)}),l&&r||c||u||!s){var p=t.getDeclaration();p&&(n.json?a=t:a+=p)}else e.push(t);return a},e.prototype.matchedRules=function(t,e){var n=this,o=t.getEl(),r=[];return e.forEach(function(t){try{t.selectorsToString().split(",").some(function(t){return null==o?void 0:o.matches(n.__cleanSelector(t))})&&r.push(t)}catch(t){}}),t.components().forEach(function(t){r=r.concat(n.matchedRules(t,e))}),r=r.filter(function(t,e){return r.indexOf(t)===e})},e.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):iB},e.prototype.sortMediaObject=function(t){var e=this;void 0===t&&(t={});var n=[];return(0,tw.each)(t,function(t,e){return n.push({key:e,value:t})}),n.sort(function(t,n){var o=[t.key,n.key].every(function(t){return -1!==t.indexOf("min-width")}),r=o?t.key:n.key,i=o?n.key:t.key;return e.getQueryLength(r)-e.getQueryLength(i)})},e.prototype.sortRules=function(t,e){var n=function(t){return t.get("mediaText")||""},o=[n(t),n(e)].every(function(t){return -1!==t.indexOf("min-width")}),r=n(o?t:e),i=n(o?e:t);return this.getQueryLength(r)-this.getQueryLength(i)},e.prototype.__cleanSelector=function(t){return t.split(" ").map(function(t){return t.split(":")[0]}).join(" ")},e}(tT.Kx),i$=(uz=function(t,e){return(uz=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uz(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iq=function(){return(iq=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},iG=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},iK=((0,t_.hasWin)()?window:{}).CSS,iY=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e,{em:n.em})||this;return o.views=[],o.config=e||{},o.opt=n,o.em=n.em,o.ensureSelectors(null,null,{}),o.setStyle(o.get("style"),{skipWatcherUpdates:!0}),o.on("change",o.__onChange),o}return i$(e,t),e.prototype.defaults=function(){return{selectors:[],selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:!1,important:!1,group:"",shallow:!1,_undo:!0}},e.prototype.__onChange=function(t,e){var n=this.em,o=this.changedAttributes();o&&!(0,t_.isEmptyObj)(o)&&(null==n||n.changesUp(e,{rule:t,changed:o,options:e}))},e.prototype.clone=function(){var e=this.get("selectors").map(function(t){return t.clone()});return t.prototype.clone.call(this,{selectors:e})},e.prototype.ensureSelectors=function(t,e,n){var o=this.em,r=null==o?void 0:o.Selectors,i=[this,"change:selectors",this.ensureSelectors],a=this.getSelectors();this.stopListening.apply(this,i),a.models&&(a=iG([],a.models,!0)),Array.isArray(a=(0,tw.isString)(a)?[a]:a)&&(a=new nl(a.filter(function(t){return t}).map(function(t){return r?r.add(t):t}))),this.set("selectors",a,n),this.listenTo.apply(this,i)},e.prototype.getAtRule=function(){return e.getAtRuleFromProps(this.attributes)},e.getAtRuleFromProps=function(t){var e=t.atRuleType,n=t.mediaText,o=e?"@".concat(e):n?"@media":"";return o+(n&&o?" ".concat(n):"")},e.prototype.selectorsToString=function(t){void 0===t&&(t={});var e=[],n=this.get("state"),o=this.get("selectorsAdd"),r=this.getSelectors().getFullString(0,{escape:function(t){return iK&&iK.escape?iK.escape(t):t}}),i=n&&!t.skipState?":".concat(n):"";return r&&e.push("".concat(r).concat(i)),o&&!t.skipAdd&&e.push(o),e.join(", ")},e.prototype.getDeclaration=function(t){void 0===t&&(t={});var e="",n=this.attributes.important,o=this.selectorsToString(t),r=this.styleToString(iq({important:n},t)),i=this.get("singleAtRule");return(o||i)&&(r||t.allowEmpty)&&(e=i?r:"".concat(o,"{").concat(r,"}")),e},e.prototype.getDevice=function(){var t=this.em,e=this.attributes,n=e.atRuleType,o=e.mediaText,r=(null==t?void 0:t.Devices.getDevices())||[],i=r.filter(function(t){return""===t.getWidthMedia()})[0];return"media"===n&&o?r.filter(function(t){return t.getWidthMedia()===iz(o)})[0]||null:i||null},e.prototype.getState=function(){var t=this.em,e=this.get("state");return((null==t?void 0:t.Selectors.getStates())||[]).filter(function(t){return t.getName()===e})[0]||null},e.prototype.getComponent=function(){var t,e=this.getSelectors(),n=1==e.length&&e.at(0),o=n&&n.isId()&&n.get("name");return o&&(null===(t=this.em)||void 0===t?void 0:t.Components.getById(o))||null},e.prototype.toCSS=function(t){void 0===t&&(t={});var e="",n=this.getAtRule(),o=this.getDeclaration(t);return(o||t.allowEmpty)&&(e=o),n&&e&&(e="".concat(n,"{").concat(e,"}")),e},e.prototype.toJSON=function(e){var n,o=t.prototype.toJSON.call(this,e);if(null===(n=this.em)||void 0===n?void 0:n.getConfig().avoidDefaults){var r=this.defaults();(0,tw.forEach)(r,function(t,e){o[e]===t&&delete o[e]}),delete o.style.__p,(0,tw.isEmpty)(o.selectors)&&delete o.selectors,(0,tw.isEmpty)(o.style)&&delete o.style}return o},e.prototype.compare=function(t,e,n,o){void 0===o&&(o={});var r,i=n||"",a=o.selectorsAdd||"",s=o.atRuleType||"",l=(0,tw.isArray)(t)||t.models?t.models||t:[t];i&&!s&&(s="media");var c=l.map(function(t){return t.getFullName()}),u=null===(r=this.get("selectors"))||void 0===r?void 0:r.map(function(t){return t.getFullName()}),p=c.slice().sort(),d=u.slice().sort();return!!(c.length===u.length&&p.every(function(t,e){return t===d[e]}))&&this.get("state")===(e||"")&&this.get("mediaText")===i&&this.get("selectorsAdd")===a&&this.get("atRuleType")===s},e}(no),iJ=(uW=function(t,e){return(uW=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uW(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iX=function(t){function e(e,n){var o=t.call(this,e)||this;return o.editor=null==n?void 0:n.em,setTimeout(function(){o.on("remove",o.onRemove),o.on("add",o.onAdd)}),o}return iJ(e,t),e.prototype.toJSON=function(t){return tT.pM.prototype.toJSON.call(this,t).filter(function(t){return t.style&&!t.shallow})},e.prototype.onAdd=function(t,e,n){t.ensureSelectors(t,e,n)},e.prototype.onRemove=function(t){var e=this.editor;e.stopListening(t),e.UndoManager.remove(t)},e.prototype.add=function(t,e){return void 0===e&&(e={}),"string"==typeof t&&(t=this.editor.get("Parser").parseCss(t)),e.em=this.editor,tT.pM.prototype.add.apply(this,[t,e])},e}(tT.pM);iX.prototype.model=iY;var iZ=(u$=function(t,e){return(u$=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u$(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),iQ=function(){return(iQ=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},i0=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},i1=function(t){function e(e){var n=t.call(this,e,"CssComposer",null,pz,{stylePrefix:"css-",rules:[]})||this;n.classes={CssRule:iY,CssRules:iX,CssRuleView:t9,CssRulesView:eo},n.events=pz,n.Selectors=nl,n.storageKey="styles",n._itemCache=new Map;var o=n.config,r=o.pStylePrefix;return r&&(o.stylePrefix=r+o.stylePrefix),o.rules=n.em.config.style||o.rules||"",n.rules=new iX([],o),n._setupCacheListeners(),n}return iZ(e,t),e.prototype._setupCacheListeners=function(){t.prototype._setupCacheListeners.call(this),this.em.listenTo(this.rules,"change:selectors change:state change:mediaText",this._onItemKeyChange.bind(this))},e.prototype._makeCacheKey=function(t){var e=t.getAtRule(),n=t.selectorsToString();return"".concat(e,"__").concat(n)},e.prototype._makeCacheKeyFromProps=function(t){var e=t.atRuleType,n=void 0===e?"":e,o=t.mediaText,r=void 0===o?"":o,i=t.state,a=void 0===i?"":i,s=t.selectorsAdd,l=void 0===s?"":s,c=t.selectors,u=(void 0===c?[]:c).map(function(t){return(0,tw.isString)(t)?t:t.toString()}).join(""),p=[];u&&p.push("".concat(u).concat(a?":".concat(a):"")),l&&p.push(l);var d=p.join(", "),f=n?"@".concat(n):r?"@media":"";return"".concat(f+(r&&f?" ".concat(r):""),"__").concat(d)},e.prototype.onLoad=function(){this.rules.add(this.config.rules,{silent:!0}),this._onItemsResetCache(this.rules)},e.prototype.postLoad=function(){this.em.UndoManager.add(this.getAll())},e.prototype.store=function(){return this.getProjectData()},e.prototype.load=function(t){return this.loadProjectData(t,{all:this.rules})},e.prototype._findRule=function(t,e,n,o){var r=t;if((0,tw.isString)(t)){var i=this.em.Selectors,a=t.split(",")[0].trim(),s=this.em.Parser.parserCss.checkNode({selectors:a})[0];r=i.get(s.selectors)}return this.rules.find(function(t){return t.compare(r,e,n,o)})||null},e.prototype.add=function(t,e,n,o,r){void 0===o&&(o={}),void 0===r&&(r={});var i=e||"",a=n||"",s=iQ({},o),l=this._makeCacheKeyFromProps(iQ(iQ({state:i,mediaText:a},s),{selectors:Array.isArray(t)?t:[t]})),c=this._itemCache.get(l);if(c&&c.config&&!c.config.singleAtRule)return c;var u=this._findRule(t,i,a,s);return u&&u.config&&!u.config.singleAtRule||(s.state=i,s.mediaText=a,s.selectors=[],a&&!s.atRuleType&&(s.atRuleType="media"),(u=new iY(s,this.config)).get("selectors").add(t,r),this.rules.add(u,r)),this._cacheItem(u),u},e.prototype.get=function(t,e,n,o){var r=this._makeCacheKeyFromProps(iQ(iQ({},o),{selectors:Array.isArray(t)?t:[t],state:e,width:n,mediaText:n})),i=this._itemCache.get(r);if(i)return i;var a=this._findRule(t,e,n,o);return a&&this._cacheItem(a),a},e.prototype.getAll=function(){return this.rules},e.prototype.addCollection=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=this.em,r=[];(0,tw.isString)(t)&&(t=o.Parser.parseCss(t));for(var i=t instanceof Array?t:[t],a=0,s=i.length;a<s;a++){var l=i[a]||{};if(l.selectors){var c=null==o?void 0:o.Selectors;c||console.warn("Selector Manager not found");for(var u=l.selectors,p=u instanceof Array?u:[u],d=[],f=0,h=p.length;f<h;f++){var g=c.add(p[f]);d.push(g)}var v=this.get(d,l.state,l.mediaText,l),y=this.add(d,l.state,l.mediaText,l,e),m=!v||!e.avoidUpdateStyle,b=l.style||{};if((0,t_.isObject)(n)&&y.set(n,e),m){var w=e.extend?iQ(iQ({},y.getStyle("",{skipResolve:!0})),b):b;y.setStyle(w,e)}r.push(y)}}return r},e.prototype.addRules=function(t){return this.addCollection(t)},e.prototype.setRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.atRuleType,r=n.atRuleParams,i=this.em.Parser.parserCss.checkNode({selectors:t,style:e})[0],a=i.state,s=i.selectorsAdd,l=this.em.Selectors.add(i.selectors),c=this.add(l,a,r,{selectorsAdd:s,atRule:o});return n.addStyles?c.addStyle(e,n):c.setStyle(e,n),c},e.prototype.getRule=function(t,e){void 0===e&&(e={});var n=this.em,o=n.Selectors,r=n.Parser.parserCss.checkNode({selectors:t})[0],i=o.get(r.selectors),a=r.state,s=r.selectorsAdd,l=e.atRuleType,c=e.atRuleParams;return i?this.get(i,a,c,{selectorsAdd:s,atRuleType:l}):void 0},e.prototype.getRules=function(t){var e=this.getAll();if(!t)return i0([],e.models,!0);var n={sort:!0},o=(0,tw.isString)(t)?t.split(",").map(function(t){return t.trim()}):t;return e.filter(function(t){return o.indexOf(t.getSelectors().getFullString(null,n))>=0})},e.prototype.setIdRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.addOpts,r=void 0===o?{}:o,i=n.mediaText,a=n.state||"",s=(0,tw.isUndefined)(i)?this.em.getCurrentMedia():i,l=this.em.Selectors.add({name:t,type:ni.TYPE_ID},r),c=this.add(l,a,s,{},r);return c.setStyle(e,iQ(iQ({},n),r)),c},e.prototype.getIdRule=function(t,e){void 0===e&&(e={});var n=e.mediaText,o=e.state||"",r=(0,tw.isUndefined)(n)?this.em.getCurrentMedia():n,i=this.em.Selectors.get(t,ni.TYPE_ID);return i&&this.get(i,o,r)},e.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.state||"",r=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:t,type:ni.TYPE_CLASS}),a=this.add(i,o,r);return a.setStyle(e,n),a},e.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||"",o=e.mediaText||this.em.getCurrentMedia(),r=this.em.Selectors.get(t,ni.TYPE_CLASS);return r&&this.get(r,n,o)},e.prototype.remove=function(t,e){var n=(0,tw.isString)(t)?this.getRules(t):t,o=Array.isArray(n)?n:[n],r=this.getAll().remove(o,e);return Array.isArray(r)?r:[r]},e.prototype.clear=function(t){return void 0===t&&(t={}),this._clearItemCache(),this.getAll().reset([],t),this},e.prototype.getComponentRules=function(t,e){void 0===e&&(e={});var n=e.state,o=e.mediaText;e.current&&(n=this.em.get("state")||"",o=this.em.getCurrentMedia());var r=t.getId();return this.getAll().filter(function(t){return!!(((0,tw.isUndefined)(n)||t.get("state")===n)&&((0,tw.isUndefined)(o)||t.get("mediaText")===o))&&t.getSelectorsString()==="#".concat(r)})},e.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new eo({collection:this.rules,config:this.config}),this.rulesView.render().el},e.prototype.checkId=function(t,e){void 0===e&&(e={});var n=e.idMap,o=void 0===n?{}:n,r=[];return Object.keys(o).length&&(Array.isArray(t)?t:[t]).forEach(function(t){var e=t.selectors;if(e&&1==e.length){var n=e[0];if((0,tw.isString)(n)){if("#"===n[0]){var i=n.substring(1),a=o[i];i&&a&&(e[0]="#".concat(a),r.push(t))}}else if(n.name&&n.type===ni.TYPE_ID){var a=o[n.name];a&&(n.name=a,r.push(t))}}}),r},e.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},e}(tL),i2=(uq=function(t,e){return(uq=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uq(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i2(e,t),e.prototype.defaults=function(){return{label:"",content:"",media:"",category:"",activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{},dragDef:{}}},Object.defineProperty(e.prototype,"category",{get:function(){var t=this.get("category");return t instanceof np?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),e.prototype.getId=function(){return this.id},e.prototype.getLabel=function(){return this.get("label")},e.prototype.getMedia=function(){return this.get("media")},e.prototype.getContent=function(){return this.get("content")},e.prototype.getDragDef=function(){return this.get("dragDef")},e.prototype.getCategoryLabel=function(){var t=this.get("category");return(0,tw.isFunction)(null==t?void 0:t.get)?t.get("label"):(null==t?void 0:t.label)?null==t?void 0:t.label:t},e}(tT.Kx),i3=(uG=function(t,e){return(uG=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uG(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i4=function(t){function e(e,n){var o=t.call(this,e)||this;return o.em=n.em,o.on("add",o.handleAdd),o}return i3(e,t),e.prototype.getCategories=function(){return this.em.Blocks.getCategories()},e.prototype.handleAdd=function(t){this.initCategory(t)},e}(ng);i4.prototype.model=i5,(uK=p1||(p1={})).add="block:add",uK.remove="block:remove",uK.removeBefore="block:remove:before",uK.update="block:update",uK.dragStart="block:drag:start",uK.drag="block:drag",uK.dragEnd="block:drag:stop",uK.categoryUpdate="block:category:update",uK.custom="block:custom",uK.all="block";var i6=(uY=function(t,e){return(uY=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uY(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i7=function(){return(i7=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},i9=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e)||this,r=o.model;return o.em=n.em,o.config=n,o.endDrag=o.endDrag.bind(o),o.ppfx=n.pStylePrefix||"",o.listenTo(r,"destroy remove",o.remove),o.listenTo(r,"change",o.render),o}return i6(e,t),e.prototype.events=function(){return{click:"handleClick",mousedown:"startDrag",dragstart:"handleDragStart",drag:"handleDrag",dragend:"handleDragEnd"}},e.prototype.__getModule=function(){return this.em.Blocks},e.prototype.handleClick=function(t){var e=this.config,n=this.model,o=this.em,r=n.get("onClick")||e.appendOnClick;if(o.trigger("block:click",n,t),r){if((0,tw.isFunction)(r))return r(n,null==o?void 0:o.getEditor(),{event:t});var i=null===(a=e.getSorter)||void 0===a?void 0:a.call(e);if(i){var a,s,l,c,u=n.get("content"),p=null===(s=this.getTempDropModel(u).view)||void 0===s?void 0:s.el,d=p?[{element:p,dragSource:{content:u}}]:[],f=o.getSelected();if(f){if(i.validTarget(f.getEl(),d,0))l=f;else{var h=f.parent();h&&i.validTarget(h.getEl(),d,0)&&(l=h,c=h.components().indexOf(f)+1)}}if(!l){var g=o.getWrapper();i.validTarget(g.getEl(),d,0)&&(l=g)}var v=l&&l.append(u,{at:c})[0];v&&o.setSelected(v,{scroll:!0})}}},e.prototype.startDrag=function(t){var e,n=this.config,o=this.em,r=this.model,i=r.get("disable");if(0===t.button&&n.getSorter&&!this.el.draggable&&!i){o.refreshCanvas();var a=n.getSorter();a.__currentBlock=r;var s=this.model.get("content"),l=null===(e=this.getTempDropModel(s).view)||void 0===e?void 0:e.el,c=l?[{element:l,dragSource:{content:s}}]:[];a.startSort(c),(0,t3.on)(document,"mouseup",this.endDrag)}},e.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},e.prototype.handleDrag=function(t){this.__getModule().__drag(t)},e.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},e.prototype.endDrag=function(){(0,t3.AU)(document,"mouseup",this.endDrag);var t,e,n=null===(e=(t=this.config).getSorter)||void 0===e?void 0:e.call(t);n&&n.endDrag()},e.prototype.getTempDropModel=function(t){var e,n=this.em.Components.getComponents(),o={avoidChildren:1,avoidStore:1,avoidUpdateStyle:1},r=n.add(t,i7(i7({},o),{temporary:!0})),i=n.remove(r,i7(i7({},o),{temporary:!0}));return null===(e=(i=i instanceof Array?i[0]:i).view)||void 0===e||e.$el.data("model",i),i},e.prototype.render=function(){var t,e=this.em,n=this.el,o=this.$el,r=this.ppfx,i=this.model,a=i.get("disable"),s=i.get("attributes")||{},l=s.class||"",c="".concat(r,"block"),u=e&&e.t("blockManager.labels.".concat(i.id))||i.get("label"),p=i.get("render"),d=i.get("media"),f=a?"".concat(c,"--disable"):"".concat(r,"four-color-h");o.attr(s),n.className="".concat(l," ").concat(c," ").concat(r,"one-bg ").concat(f).trim(),n.innerHTML="\n ".concat(d?'<div class="'.concat(c,'__media">').concat(d,"</div>"):"",'\n <div class="').concat(c,'-label">').concat(u,"</div>\n "),n.title=s.title||(null===(t=n.textContent)||void 0===t?void 0:t.trim()),n.setAttribute("draggable","".concat(!!(0,t_.hasDnd)(e)&&!a));var h=p&&p({el:n,model:i,className:c,prefix:r});return h&&(n.innerHTML=h),this},e}(tT.Ss),i8=(uJ=function(t,e){return(uJ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uJ(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),at=function(t){function e(e,n,o){var r=t.call(this,e)||this;r.config=n;var i=n.pStylePrefix||"";return r.em=n.em,r.catName=o,r.pfx=i,r.caretR="fa fa-caret-right",r.caretD="fa fa-caret-down",r.iconClass="".concat(i,"caret-icon"),r.activeClass="".concat(i,"open"),r.className="".concat(i).concat(o,"-category"),r.listenTo(r.model,"change:open",r.updateVisibility),r.model.view=r,r}return i8(e,t),e.prototype.events=function(){return{"click [data-title]":"toggle"}},e.prototype.template=function(t){var e,n,o=t.pfx,r=t.label,i=t.catName;return tC(p2||(e=['\n <div class="','title" data-title>\n <i class="','caret-icon"></i>\n ','\n </div>\n <div class="',"",'s-c"></div>\n '],n=['\n <div class="','title" data-title>\n <i class="','caret-icon"></i>\n ','\n </div>\n <div class="',"",'s-c"></div>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,p2=e),o,o,r,o,i)},e.prototype.attributes=function(){return this.model.get("attributes")||{}},e.prototype.updateVisibility=function(){this.model.get("open")?this.open():this.close()},e.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getTypeEl().style.display=""},e.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getTypeEl().style.display="none"},e.prototype.toggle=function(){var t=this.model;t.set("open",!t.get("open"))},e.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},e.prototype.getTypeEl=function(){return this.typeEl||(this.typeEl=this.el.querySelector(".".concat(this.pfx).concat(this.catName,"s-c"))),this.typeEl},e.prototype.append=function(t){this.getTypeEl().appendChild(t)},e.prototype.render=function(){var t=this.em,e=this.el,n=this.$el,o=this.model,r=this.pfx,i=this.catName,a=t.t("".concat(i,"Manager.categories.").concat(o.id))||o.get("label");return e.innerHTML=this.template({pfx:r,label:a,catName:i}),n.addClass(this.className),n.css({order:o.get("order")}),this.updateVisibility(),this},e}(tT.Ss),ae=(uX=function(t,e){return(uX=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uX(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),an=function(){return(an=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ao=function(t){function e(e,n){var o=t.call(this,e)||this;o.renderedCategories=new Map,(0,tw.bindAll)(o,"getSorter","onDrag","onDrop","onMove"),o.config=n||{},o.categories=e.categories||"";var r=o.config.pStylePrefix||"";o.ppfx=r,o.noCatClass="".concat(r,"blocks-no-cat"),o.blockContClass="".concat(r,"blocks-c"),o.catsClass="".concat(r,"block-categories");var i=o.collection;return o.listenTo(i,"add",o.addTo),o.listenTo(i,"reset",o.render),o.em=o.config.em,o.em&&(o.config.getSorter=o.getSorter),o}return ae(e,t),e.prototype.__getModule=function(){return this.em.Blocks},e.prototype.updateConfig=function(t){void 0===t&&(t={}),this.config=an(an({},this.config),t)},e.prototype.getSorter=function(){var t=this.em;if(t){if(!this.sorter){var e=t.Utils,n=t.Canvas;this.sorter=new e.ComponentSorter({em:t,treeClass:nQ,containerContext:{container:n.getBody(),containerSel:"*",itemSel:"*",pfx:this.ppfx,placeholderElement:n.getPlacerEl(),document:n.getBody().ownerDocument},dragBehavior:{dragDirection:n0.A.BothDirections,nested:!0},positionOptions:{windowMargin:1,canvasRelative:!0},eventHandlers:{legacyOnStartSort:this.onDrag,legacyOnEndMove:this.onDrop,legacyOnMoveClb:this.onMove}})}return this.sorter}},e.prototype.onDrag=function(t){this.em.stopDefault(),this.__getModule().__startDrag(this.sorter.__currentBlock,t)},e.prototype.onMove=function(t){this.__getModule().__drag(t)},e.prototype.onDrop=function(t){this.em.runDefault(),this.__getModule().__endDrag({component:t}),delete this.sorter.__currentBlock},e.prototype.addTo=function(t){this.add(t)},e.prototype.add=function(t,e){var n=this.config,o=this.renderedCategories,r=t.get("attributes"),i=new i9({model:t,attributes:r},n).render().el,a=t.parent.initCategory(t);if(a&&this.categories&&!n.ignoreCategories){var s=a.getId(),l=this.getCategoriesEl(),c=o.get(s);!c&&l&&(c=new at({model:a},n,"block").render(),o.set(s,c),l.appendChild(c.el)),null==c||c.append(i);return}e?e.appendChild(i):this.append(i)},e.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl},e.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl},e.prototype.append=function(t){var e=this.getBlocksEl();e&&e.appendChild(t)},e.prototype.render=function(){var t=this,e=this.ppfx,n=document.createDocumentFragment();delete this.catsEl,delete this.blocksEl,this.renderedCategories=new Map,this.el.innerHTML='\n <div class="'.concat(this.catsClass,'"></div>\n <div class="').concat(this.noCatClass,'">\n <div class="').concat(this.blockContClass,'"></div>\n </div>\n '),this.collection.each(function(e){return t.add(e,n)}),this.append(n);var o="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(o),this.rendered=!0,this},e}(tT.Ss),ar=(uZ=function(t,e){return(uZ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uZ(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ai=function(){return(ai=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},aa=function(t){function e(e){var n=t.call(this,e,"BlockManager",new i4([],{em:e}),p1,{appendTo:"",blocks:[],appendOnClick:!1,custom:!1})||this;return n.events=p1,n.Block=i5,n.Blocks=i4,n.Category=np,n.Categories=ny,n.storageKey="",n.blocks=n.all,n.blocksVisible=new i4(n.blocks.models,{em:e}),n.categories=new ny([],{em:e,events:{update:p1.categoryUpdate}}),n.__onAllEvent=(0,tw.debounce)(function(){return n.__trgCustom()},0),n}return ar(e,t),e.prototype.onInit=function(){var t=this.config,e=this.blocks,n=this.blocksVisible;e.on("add",function(t){return n.add(t)}),e.on("remove",function(t){return n.remove(t)}),e.on("reset",function(t){return n.reset(t.models)}),e.add(t.blocks||[])},e.prototype.__trgCustom=function(){this.em.trigger(this.events.custom,this.__customData())},e.prototype.__customData=function(){var t=this,e=this.__getBehaviour();return{bm:this,blocks:this.getAll().models,container:e.container,dragStart:function(e,n){return t.startDrag(e,n)},drag:function(e){return t.__drag(e)},dragStop:function(e){return t.endDrag(e)}}},e.prototype.__startDrag=function(t,e){var n=this.em,o=this.events,r=this.blocks,i=t.getContent?t.getContent():t;this._dragBlock=t,n.set({dragResult:null,dragSource:{content:i,dragDef:t.getDragDef()}}),[n,r].map(function(n){return n.trigger(o.dragStart,t,e)})},e.prototype.__drag=function(t){var e=this.em,n=this.events,o=this.blocks,r=this._dragBlock;[e,o].map(function(e){return e.trigger(n.drag,r,t)})},e.prototype.__endDrag=function(t){void 0===t&&(t={});var e=this.em,n=this.events,o=this.blocks,r=this._dragBlock,i=t.component||e.get("dragResult");if(delete this._dragBlock,i&&r){var a="activeOnRender",s=i.get&&i.get(a),l=r.get("activate")||s,c=r.get("select"),u=(0,tw.isArray)(i)?i[0]:i;c||l&&!1!==c?e.setSelected(u,{activate:l}):l&&u.trigger("active"),l&&s&&u.unset(a),r.get("resetId")&&u.onAll(function(t){return t.resetId()})}e.set({dragResult:null,dragSource:void 0}),r&&[e,o].map(function(t){return t.trigger(n.dragEnd,i,r)})},e.prototype.__getFrameViews=function(){return this.em.Canvas.getFrames().map(function(t){return t.view}).filter(Boolean)},e.prototype.__behaviour=function(t){return void 0===t&&(t={}),this._bhv=ai(ai({},this._bhv||{}),t)},e.prototype.__getBehaviour=function(){return this._bhv||{}},e.prototype.startDrag=function(t,e){this.__startDrag(t,e),this.__getFrameViews().forEach(function(t){var e;return null===(e=t.droppable)||void 0===e?void 0:e.startCustom()})},e.prototype.endDrag=function(t){this.__getFrameViews().forEach(function(e){var n;return null===(n=e.droppable)||void 0===n?void 0:n.endCustom(t)}),this.__endDrag()},e.prototype.postRender=function(){var t=this.categories,e=this.config,n=this.em,o=this.blocksVisible;this.blocksView=new ao({collection:o,categories:t},ai(ai({},e),{em:n})),this.__appendTo(o.models),this.__trgCustom()},e.prototype.add=function(t,e,n){void 0===n&&(n={});var o=e||{};return o.id=t,this.blocks.add(o,n)},e.prototype.get=function(t){return this.blocks.get(t)},e.prototype.getAll=function(){return this.blocks},e.prototype.getAllVisible=function(){return this.blocksVisible},e.prototype.remove=function(t,e){return void 0===e&&(e={}),this.__remove(t,e)},e.prototype.getCategories=function(){return this.categories},e.prototype.getContainer=function(){var t;return null===(t=this.blocksView)||void 0===t?void 0:t.el},e.prototype.getDragBlock=function(){return this._dragBlock},e.prototype.getBlocksByCategory=function(t){return nd(t||this.getAll().models)},e.prototype.render=function(t,e){void 0===e&&(e={});var n=this.categories,o=this.config,r=this.em,i=t||this.getAll().models;return e.external?new ao({collection:new i4(i,{em:r}),categories:n},ai(ai({em:r},o),e)).render().el:(this.blocksView&&(this.blocksView.updateConfig(e),this.blocksView.collection.reset(i),this.blocksView.rendered||(this.blocksView.render(),this.blocksView.rendered=!0)),this.getContainer())},e.prototype.destroy=function(){var t,e=[this.blocks,this.blocksVisible,this.categories];e.map(function(t){return t.stopListening()}),e.map(function(t){return t.reset()}),null===(t=this.blocksView)||void 0===t||t.remove()},e}(tL),as=(uQ=function(t,e){return(uQ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uQ(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),al=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return as(e,t),e.prototype.defaults=function(){return{name:"",label:""}},e.prototype.getName=function(){return this.get("name")},e.prototype.getLabel=function(){return this.get("label")||this.getName()},e}(tT.Kx);al.prototype.idAttribute="name",(u0=p5||(p5={})).add="selector:add",u0.remove="selector:remove",u0.removeBefore="selector:remove:before",u0.update="selector:update",u0.state="selector:state",u0.custom="selector:custom",u0.all="selector";var ac=(u1=function(t,e){return(u1=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u1(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),au="contentEditable",ap=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.config||{};return n.config=o,n.module=e.module,n.coll=e.coll||null,n.pfx=o.stylePrefix||"",n.ppfx=o.pStylePrefix||"",n.em=o.em,n.listenTo(n.model,"change:active",n.updateStatus),n}return ac(e,t),e.prototype.template=function(){var t,e,n=this.pfx,o=this.model,r=this.config,i=o.get("label")||"";return tC(p3||(t=['\n <span id="','checkbox" class="','tag-status" data-tag-status></span>\n <span id="','tag-label" data-tag-name>','</span>\n <span id="','close" class="','tag-close" data-tag-remove> $'," </span>\n "],e=['\n <span id="','checkbox" class="','tag-status" data-tag-status></span>\n <span id="','tag-label" data-tag-name>','</span>\n <span id="','close" class="','tag-close" data-tag-remove> $'," </span>\n "],Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,p3=t),n,n,n,i,n,n,r.iconTagRemove)},e.prototype.events=function(){return{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[au]="true",e.focus(),null==t||t.setEditing(!0)},e.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),o=n.textContent||"",r=null==e?void 0:e.Selectors;n[au]="false",null==e||e.setEditing(!1),r&&r.rename(t,o)!==t&&(n.innerText=t.getLabel())},e.prototype.changeStatus=function(){var t=this.model;t.set("active",!t.getActive())},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this.model,e=this.$el,n=this.config,o=n.iconTagOn,r=n.iconTagOff,i=e.find("[data-tag-status]");t.get("active")?(i.html(o),e.removeClass("opac50")):(i.html(r),e.addClass("opac50"))},e.prototype.render=function(){var t=this.pfx,e=this.ppfx,n=this.$el,o=this.model,r="".concat(t,"tag"),i=["".concat(r," ").concat(e,"three-bg")];return o.get("protected")&&i.push("".concat(r,"-protected")),n.html(this.template()),n.attr("class",i.join(" ")),this.updateStatus(),this},e}(tT.Ss),ad=(u2=function(t,e){return(u2=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u2(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),af=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},ah=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{},n.pfx=n.config.stylePrefix||"",n.ppfx=n.config.pStylePrefix||"",n.className=n.pfx+"tags",n.stateInputId=n.pfx+"states",n.stateInputC=n.pfx+"input-c",n.states=n.config.states||[];var o=n.config.em,r=n.collection;n.target=o;var i=o.Selectors;n.module=i,n.em=o,n.componentChanged=(0,tw.debounce)(n.componentChanged.bind(n),0),n.checkSync=(0,tw.debounce)(n.checkSync.bind(n),0);var a=tQ.I.update,s="".concat(a,":classes"),l="".concat(s," ").concat(a,":attributes:id change:state");return n.listenTo(o,"component:toggled ".concat(s),n.componentChanged),n.listenTo(o,"styleManager:update",n.componentChanged),n.listenTo(o,l,n.__handleStateChange),n.listenTo(o,"styleable:change change:device",n.checkSync),n.listenTo(r,"add",n.addNew),n.listenTo(r,"reset",n.renderClasses),n.listenTo(r,"remove",n.tagRemoved),n.listenTo(i.getAll(),i.events.state,(0,tw.debounce)(function(){return n.renderStates()},0)),n.delegateEvents(),n}return ad(e,t),e.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,o=t.iconSync,r=t.iconAdd,i=t.pfx,a=t.ppfx;return tC(p4||(p4=af([' <div id="','up" class="','header">\n <div id="','label" class="','header-label">','</div>\n <div id="','status-c" class="','header-status">\n <span id="','input-c" data-states-c>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select id="','states" data-states></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n </span>\n </div>\n </div>\n <div id="','tags-field" class="','field">\n <div id="','tags-c" data-selectors></div>\n <input id="','new" data-input />\n <span id="','add-tag" class="',"tags-btn ",'tags-btn__add" data-add> $',' </span>\n <span class="',"tags-btn ",'tags-btn__sync" style="display: none" data-sync-style> $',' </span>\n </div>\n <div class="','sels-info">\n <div class="','label-sel">',':</div>\n <div class="','sels" data-selected></div>\n </div>'],[' <div id="','up" class="','header">\n <div id="','label" class="','header-label">','</div>\n <div id="','status-c" class="','header-status">\n <span id="','input-c" data-states-c>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select id="','states" data-states></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n </span>\n </div>\n </div>\n <div id="','tags-field" class="','field">\n <div id="','tags-c" data-selectors></div>\n <input id="','new" data-input />\n <span id="','add-tag" class="',"tags-btn ",'tags-btn__add" data-add> $',' </span>\n <span class="',"tags-btn ",'tags-btn__sync" style="display: none" data-sync-style> $',' </span>\n </div>\n <div class="','sels-info">\n <div class="','label-sel">',':</div>\n <div class="','sels" data-selected></div>\n </div>'])),i,i,i,i,n,i,i,i,a,a,a,i,a,a,i,a,i,i,i,i,i,r,i,i,o,i,i,e,i)},e.prototype.events=function(){return{"change [data-states]":"stateChanged","click [data-add]":"startNewTag","focusout [data-input]":"endNewTag","keyup [data-input]":"onInputKeyUp","click [data-sync-style]":"syncStyle"}},e.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),o=e.Css,r=this.getCommonSelectors({opts:{noDisabled:1}}),i=e.get("state"),a=e.getCurrentMedia(),s=[],l=o.get(r,i,a)||o.add(r,i,a);this.getTargets().forEach(function(e){var n=o.getIdRule(e.getId(),{state:i,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)}),t&&l.addStyle(t),e.trigger("component:toggled"),e.trigger("component:sync-style",{component:n,selectors:r,mediaText:a,rule:l,ruleComponents:s,state:i})},e.prototype.tagRemoved=function(t){this.updateStateVis()},e.prototype.addNew=function(t){this.addToClasses(t)},e.prototype.startNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:"none"}),null===(e=this.$input)||void 0===e||e.show().focus()},e.prototype.endNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:""}),null===(e=this.$input)||void 0===e||e.hide().val("")},e.prototype.onInputKeyUp=function(t){var e;13===t.keyCode?(t.preventDefault(),this.addNewTag(null===(e=this.$input)||void 0===e?void 0:e.val())):27===t.keyCode&&this.endNewTag()},e.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},e.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},e.prototype.updateSelection=function(t){var e=t||this.getTargets();e=(0,tw.isArray)(e)?e:[e];var n=[];return e&&e.length&&(n=this.getCommonSelectors({targets:e}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(e),this.module.__trgCustom(),n},e.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,o=e.opts,r=n||this.getTargets();return this.module.__getCommonSelectors(r,void 0===o?{}:o)},e.prototype._commonSelectors=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.module).__common.apply(t,e)},e.prototype.checkSync=function(){var t,e=this.$btnSyncEl,n=this.config,o=this.collection,r=this.getTarget();if(r&&n.componentFirst&&o.length){var i=r.getStyle();t=!(0,tw.isEmpty)(i)}e&&e[t?"show":"hide"]()},e.prototype.getTarget=function(){return this.target.getSelected()},e.prototype.getTargets=function(){return this.target.getSelectedAll()},e.prototype.updateStateVis=function(t){var e=this.em,n=e&&e.getConfig().avoidInlineStyle,o=this.collection.length||n?"":"none";this.getStatesC().css("display",o),this.updateSelector(t)},e.prototype.__handleStateChange=function(){this.updateSelector(this.getTargets())},e.prototype.updateSelector=function(t){var e=this,n=this.el.querySelector("[data-selected]"),o=[],r=t||this.getTargets();(r=(0,tw.isArray)(r)?r:[r]).forEach(function(t){return o.push(e.__getName(t))}),n&&(n.innerHTML=o.join(", ")),this.checkStates()},e.prototype.__getName=function(t){var e,n=this.pfx,o=this.config,r=this.em,i=o.selectedName,a=o.componentFirst;if((0,tw.isString)(t))e=tC(p6||(p6=af(['<span class="','sel-gen">',"</span>"],['<span class="','sel-gen">',"</span>"])),n,t);else{var s=null==t?void 0:t.getSelectors();if(!s)return"";var l=s.getStyleable(),c=r.get("state"),u=t.getId?tC(p7||(p7=af(['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"],['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"])),n,t.getName(),n,t.getId()):"";e=(e=this.collection.getFullString(l))?tC(p9||(p9=af(['<span class="','sel-rule">',"</span>"],['<span class="','sel-rule">',"</span>"])),n,e):t.get("selectorsAdd")||u,e=(a&&u?u:e)+(c?tC(p8||(p8=af(['<span class="','sel-state">:',"</span>"],['<span class="','sel-state">:',"</span>"])),n,c):""),e=i?i({result:e,state:c,target:t}):e}return e&&'<span class="'.concat(n,'sel">').concat(e,"</span>")},e.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set("state",n)},e.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},e.prototype.addToClasses=function(t,e){var n=this.getClasses(),o=new ap({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return e?e.appendChild(o):n.append(o),o},e.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each(function(n){return t.addToClasses(n,e)}),n.append(e)},e.prototype.getClasses=function(){return this.$el.find("[data-selectors]")},e.prototype.getStates=function(){if(!this.$states){var t=this.$el.find("[data-states]");this.$states=t[0]&&t}return this.$states},e.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},e.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t("selectorManager.emptyState"),o=t.getStates().map(function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return'<option value="'.concat(t.id,'">').concat(n,"</option>")}).join(""),r=this.getStates();r&&r.html('<option value="">'.concat(n,"</option>").concat(o)),this.checkStates()},e.prototype.render=function(){var t=this.em,e=this.pfx,n=this.ppfx,o=this.config,r=this.$el,i=this.el,a=o.render,s={iconSync:o.iconSync,iconAdd:o.iconAdd,labelHead:t.t("selectorManager.label"),labelInfo:t.t("selectorManager.selected"),ppfx:n,pfx:e,el:i};r.html(this.template(s));var l=a&&a(s);return l&&l!==i&&r.empty().append(l),this.$input=r.find("[data-input]"),this.$addBtn=r.find("[data-add]"),this.$classes=r.find("#"+e+"tags-c"),this.$btnSyncEl=r.find("[data-sync-style]"),this.$input.hide(),this.renderStates(),this.renderClasses(),r.attr("class","".concat(this.className," ").concat(n,"one-bg ").concat(n,"two-color")),this},e}(tT.Ss),ag=(u5=function(t,e){return(u5=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u5(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),av=function(){return(av=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ay=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},am=function(t){return(0,tw.isString)(t)&&"#"==t[0]},ab=function(t){return(0,tw.isString)(t)&&"."==t[0]},aw=function(t){function e(e){var n=t.call(this,e,"SelectorManager",new nl([]),p5,{stylePrefix:"clm-",appendTo:"",selectors:[],states:[{name:"hover"},{name:"active"},{name:"nth-of-type(2n)"}],iconAdd:'<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',iconSync:'<svg viewBox="0 0 24 24"><path d="M12 18c-3.31 0-6-2.69-6-6 0-1 .25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4m0-11V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8z"></path></svg>',iconTagOn:'<svg viewBox="0 0 24 24"><path d="M19 19H5V5h10V3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-2m-11.09-.92L6.5 11.5 11 16 21 6l-1.41-1.42L11 13.17l-3.09-3.09z"></path></svg>',iconTagOff:'<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',iconTagRemove:'<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',componentFirst:!1,custom:!1},{skipListen:!0})||this;n.Selector=ni,n.Selectors=nl,n.events=p5,n.storageKey="",(0,tw.bindAll)(n,"__updateSelectedByComponents");var o=n.config,r=n.events,i=o.pStylePrefix;i&&(o.stylePrefix=i+o.stylePrefix),n.all=new nl(o.selectors),n.selected=new nl([],{em:e,config:o}),n.states=new tT.pM(o.states.map(function(t){return new al(t)}),{model:al}),n.model=new tT.Kx({cFirst:o.componentFirst,_undo:!0}),n.__update=(0,tw.debounce)(function(){return n.__trgCustom()},0),n.__initListen({collections:[n.states,n.selected],propagate:[{entity:n.states,event:r.state}]}),e.on("change:state",function(t,n){return e.trigger(r.state,n)}),n.model.on("change:cFirst",function(t,n){return e.trigger("selector:type",n)});var a="".concat(tQ.I.update,":classes");return e.on("component:toggled ".concat(a),n.__updateSelectedByComponents),n.model.listenTo(e,"component:toggled ".concat(a," change:device styleManager:update selector:state selector:type style:target"),function(){return n.__update()}),n}return ag(e,t),e.prototype.__trgCustom=function(t){this.em.trigger(this.events.custom,this.__customData(t))},e.prototype.getAll=function(t){return void 0===t&&(t={}),this.all?t.array?ay([],this.all.models,!0):this.all:[]},e.prototype.__customData=function(t){return void 0===t&&(t={}),this.__ctn=this.__ctn||t.container,{states:this.getStates(),selected:this.getSelected(),container:this.__ctn}},e.prototype.postRender=function(){this.__appendTo(),this.__trgCustom()},e.prototype.select=function(t,e){void 0===e&&(e={});var n=Array.isArray(t)?t:[t],o=this.em.Styles.select(n,e);this.selected.reset(this.__getCommonSelectors(o));var r=this.selectorTags,i=o.filter(function(t){return t}).map(function(t){return(0,t_.isComponent)(t)?t:(0,t_.isRule)(t)&&!t.get("selectorsAdd")?t:t.getSelectorsString()});return r&&r.componentChanged({targets:i}),this},e.prototype.addSelector=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=av({},e);(0,tw.isObject)(t)?o=t:o.name=t,am(o.name)?(o.name=o.name.substr(1),o.type=ni.TYPE_ID):ab(o.name)&&(o.name=o.name.substr(1)),o.label&&!o.name&&(o.name=this.escapeName(o.label));var r=this.all,i=this.em,a=this.config,s=r.get(o);if(!s){var l=o instanceof ni?o:new ni(o,av(av({},n),{config:a,em:i}));return r.add(l,n)}return s},e.prototype.getSelector=function(t,e){return void 0===e&&(e=ni.TYPE_CLASS),am(t)?(t=t.substr(1),e=ni.TYPE_ID):ab(t)&&(t=t.substr(1)),this.all.get({name:t,type:e})},e.prototype.add=function(t,e){var n=this;void 0===e&&(e={});var o=(0,tw.isString)(t)?{}:e;return(0,tw.isArray)(t)?t.map(function(t){return n.addSelector(t,e,o)}):this.addSelector(t,e,o)},e.prototype.addClass=function(t){var e=this,n=[];return(0,tw.isString)(t)&&(t=t.trim().split(" ").filter(Boolean)),t.forEach(function(t){return n.push(e.addSelector(t))}),n},e.prototype.get=function(t,e){var n=this;if(!(0,tw.isArray)(t))return this.getSelector(t,e);var o=[];return t.map(function(t){return n.getSelector(t)}).filter(Boolean).forEach(function(t){return 0>o.indexOf(t)&&o.push(t)}),o},e.prototype.remove=function(t,e){return this.__remove(t,e)},e.prototype.rename=function(t,e,n){var o=this.escapeName(e);return this.get(o)||t.set({name:o,label:e},n)},e.prototype.setState=function(t){return this.em.setState(t),this},e.prototype.getState=function(){return this.em.getState()},e.prototype.getStates=function(){return ay([],this.states.models,!0)},e.prototype.setStates=function(t,e){return this.states.reset(t.map(function(t){return new al(t)}),e)},e.prototype.getSelected=function(){return this.__getCommon()},e.prototype.getSelectedAll=function(){return ay([],this.selected.models,!0)},e.prototype.addSelected=function(t){var e=this.add(t);this.em.getSelectedAll().forEach(function(t){t.getSelectors().add(e)})},e.prototype.removeSelected=function(t){this.em.getSelectedAll().forEach(function(e){!t.get("protected")&&e&&e.getSelectors().remove(t)})},e.prototype.duplicateSelected=function(t,e){var n=this;void 0===e&&(e={});var o=this.em,r=this.getSelected();if(!(0>r.indexOf(t))){var i=this.getState(),a=o.getCurrentMedia(),s=o.Css.get(r,i,a),l=null==s?void 0:s.getStyle();o.getSelectedAll().forEach(function(o){var r=o.getSelectors();if(r.includes(t)){var i=e.suffix||" copy",a=t.getLabel(),s=n.addSelector("".concat(a).concat(i)),l=r.indexOf(t);r.remove(t),r.add(s,{at:l})}}),l&&o.Css.add(this.getSelected(),i,a).setStyle(l)}},e.prototype.getSelectedTargets=function(){return this.em.Styles.getSelectedAll()},e.prototype.setComponentFirst=function(t){this.getConfig().componentFirst=t,this.model.set({cFirst:t})},e.prototype.getComponentFirst=function(){return this.getConfig().componentFirst},e.prototype.escapeName=function(t){var e=this.getConfig().escapeName;return e?e(t):ni.escapeName(t)},e.prototype.render=function(t){var e=this.selectorTags,n=this.getConfig(),o=null==e?void 0:e.el;return this.selected.reset(t),this.selectorTags=new ah({el:o,collection:this.selected,module:this,config:n}),this.selectorTags.render().el},e.prototype.destroy=function(){var t=this.selectorTags;this.model.stopListening(),this.__update.cancel(),this.__destroy(),null==t||t.remove(),this.selectorTags=void 0},e.prototype.load=function(){},e.prototype.store=function(){},e.prototype.__getCommon=function(){return this.__getCommonSelectors(this.em.getSelectedAll())},e.prototype.__getCommonSelectors=function(t,e){void 0===e&&(e={});var n=t.map(function(t){return t.getSelectors&&t.getSelectors().getValid(e)}).filter(Boolean);return this.__common.apply(this,n)},e.prototype.__common=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.length?1===e.length?e[0]:2===e.length?e[0].filter(function(t){return e[1].indexOf(t)>=0}):e.slice(1).reduce(function(e,n){return t.__common(e,n)},e[0]):[]},e.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},e}(tL),a_=((dt={})[4]="media",dt[5]="font-face",dt[6]="page",dt[7]="keyframes",dt[11]="counter-style",dt[12]="supports",dt[13]="document",dt[14]="font-feature-values",dt[15]="viewport",dt),aC=(0,tw.keys)(a_),ax=[5,6,11,15],aS=aC.filter(function(t){return 0>ax.indexOf(Number(t))}).map(function(t){return a_[t]}).concat(["container","layer"]),aO=ax.map(function(t){return a_[t]}),aT=function(t){void 0===t&&(t="");for(var e=[],n=[],o=t.split(","),r=0,i=o.length;r<i;r++){var a=o[r].trim();if(/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(a)||/^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(a)){var s=a.split(".").filter(Boolean);n.push(s)}else e.push(a)}return{result:n,add:e}},aP=function(t){for(var e=t.style,n={},o=0,r=e.length;o<r;o++){var i=e[o],a=e.getPropertyValue(i),s=e.getPropertyPriority(i);n[i]="".concat(a).concat(s?" !".concat(s):"")}return n},aE=function(t){return(t.conditionText||t.media&&t.media.mediaText||t.name||t.selectorText||"").trim()},ak=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o={},r=t.length,i=t[r-1],a=i?i.split(/:(.+)/):[],s=a[1],l=n.atRule,c=n.selectorsAdd,u=n.mediaText;return aO.indexOf(l)>=0&&(o.singleAtRule=!0),l&&(o.atRuleType=l),c&&(o.selectorsAdd=c),u&&(o.mediaText=u),s&&(t[r-1]=a[0],o.state=s,a.splice(a.length-1,1)),o.selectors=t,o.style=e,o},aA=function(t){var e=t.cssText,n=void 0===e?"":e;return aS.find(function(t){return 0===n.indexOf("@".concat(t))})},aj=function(t){for(var e=[],n=t.cssRules||[],o=0,r=n.length;o<r;o++){var i=n[o],a=i.type,s=!1,l="",c="",u=i.selectorText||i.keyText||"",p=ax.indexOf(a)>=0;if(p)s=!0,l=a_[a],c=aE(i);else if(aC.indexOf("".concat(a))>=0||!a&&aA(i)){var d=aj(i),f=a_[a]||aA(i);c=aE(i);for(var h=0,g=d.length;h<g;h++){var v=d[h];c&&(v.mediaText=c),v.atRuleType=f}e=e.concat(d)}if(u||p){for(var y=aP(i),m=aT(u),b=m.add,w=m.result,_=void 0,C=0,x=w.length;C<x;C++){var S=ak(w[C],y,{atRule:a_[a]});e.push(S),_=S}if(b.length){var O=b.join(", ");if(_)_.selectorsAdd=O;else{var S={selectors:[],selectorsAdd:O,style:y};s&&(S.singleAtRule=s),l&&(S.atRuleType=l),c&&(S.mediaText=c),e.push(S)}}}}return e};let aM=function(t){var e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e);var n=e.sheet;return document.head.removeChild(e),n?aj(n):[]};var aD=(u3=function(t,e){return(u3=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u3(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),aL=function(){return(aL=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},aI=function(t){function e(e){var n,o=t.call(this,e,"Parser",{textTags:["br","b","i","u","a","ul","ol"],textTypes:["text","textnode","comment"],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:"text/html",allowScripts:!1,allowUnsafeAttr:!1,allowUnsafeAttrValue:!1,keepEmptyTextNodes:!1,convertDataGjsAttributesHyphens:!1}})||this;o.events=pZ;var r=o.config;return o.parserCss=(void 0===(n=r)&&(n={}),{parse:function(t,o){var r,i=this;void 0===o&&(o={});var a=[],s=n.parserCss,l=null==e?void 0:e.Editor,c=[],u=null==e?void 0:e.Parser,p={input:t};null==u||u.__emitEvent(pZ.cssBefore,p);var d=p.input;try{c=s?s(d,l):aM(d)}catch(t){if(r=t,o.throwOnError)throw t}return c.forEach(function(t){return a=a.concat(i.checkNode(t))}),null==u||u.__emitEvent(pZ.css,{input:d,output:a,nodes:c,error:r}),a},checkNode:function(t){var e=t.selectors,n=t.style,o=[t];if((0,tw.isString)(e)){var r=[],i=aT(e),a=i.result,s=i.add.join(", "),l={atRule:t.atRule,mediaText:t.params};a.length?a.forEach(function(t){r.push(ak(t,n,l))}):r.push(ak([],n,l)),s&&(r[r.length-1].selectorsAdd=s),o=r}return o}}),o.parserHtml=e1(e,r),o}return aD(e,t),e.prototype.parseHtml=function(t,e){void 0===e&&(e={});var n=this.em,o=this.parserHtml;return o.compTypes=n.Components.getTypes()||[],o.parse(t,this.parserCss,e)},e.prototype.parseCss=function(t){return this.parserCss.parse(t)},e.prototype.__emitEvent=function(t,e){var n=this.em,o=this.events;n.trigger(t,e),n.trigger(o.all,aL({event:t},e))},e.prototype.destroy=function(){},e}(tD),aN=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},aR=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},aV=function(){function t(){}return t.prototype.store=function(t){return aN(this,arguments,void 0,function(t,e){return void 0===e&&(e={}),aR(this,function(n){return this.hasLocal(e,!0)&&localStorage.setItem(e.key,JSON.stringify(t)),[2,t]})})},t.prototype.load=function(){return aN(this,arguments,void 0,function(t){var e;return void 0===t&&(t={}),aR(this,function(n){return e={},this.hasLocal(t,!0)&&(e=JSON.parse(localStorage.getItem(t.key)||"{}")),[2,e]})})},t.prototype.hasLocal=function(t,e){if(void 0===t&&(t={}),t.checkLocal&&(!(0,t_.hasWin)()||!localStorage)){if(e)throw Error("localStorage not available");return!1}return!0},t}();function aF(t){return(aF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aH(t,e){this.name="AggregateError",this.errors=t,this.message=e||""}aH.prototype=Error.prototype;var aU=setTimeout;function aB(t){return!!(t&&void 0!==t.length)}function az(){}function aW(t){if(!(this instanceof aW))throw TypeError("Promises must be constructed via new");if("function"!=typeof t)throw TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],aJ(t,this)}function a$(t,e){for(;3===t._state;)t=t._value;if(0===t._state){t._deferreds.push(e);return}t._handled=!0,aW._immediateFn(function(){var n,o=1===t._state?e.onFulfilled:e.onRejected;if(null===o){(1===t._state?aq:aG)(e.promise,t._value);return}try{n=o(t._value)}catch(t){aG(e.promise,t);return}aq(e.promise,n)})}function aq(t,e){try{if(e===t)throw TypeError("A promise cannot be resolved with itself.");if(e&&("object"===aF(e)||"function"==typeof e)){var n=e.then;if(e instanceof aW){t._state=3,t._value=e,aK(t);return}if("function"==typeof n){aJ(function(){n.apply(e,arguments)},t);return}}t._state=1,t._value=e,aK(t)}catch(e){aG(t,e)}}function aG(t,e){t._state=2,t._value=e,aK(t)}function aK(t){2===t._state&&0===t._deferreds.length&&aW._immediateFn(function(){t._handled||aW._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)a$(t,t._deferreds[e]);t._deferreds=null}function aY(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function aJ(t,e){var n=!1;try{t(function(t){n||(n=!0,aq(e,t))},function(t){n||(n=!0,aG(e,t))})}catch(t){if(n)return;n=!0,aG(e,t)}}aW.prototype.catch=function(t){return this.then(null,t)},aW.prototype.then=function(t,e){var n=new this.constructor(az);return a$(this,new aY(t,e,n)),n},aW.prototype.finally=function(t){var e=this.constructor;return this.then(function(n){return e.resolve(t()).then(function(){return n})},function(n){return e.resolve(t()).then(function(){return e.reject(n)})})},aW.all=function(t){return new aW(function(e,n){if(!aB(t))return n(TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);for(var r=o.length,i=0;i<o.length;i++)!function t(i,a){try{if(a&&("object"===aF(a)||"function"==typeof a)){var s=a.then;if("function"==typeof s){s.call(a,function(e){t(i,e)},n);return}}o[i]=a,0==--r&&e(o)}catch(t){n(t)}}(i,o[i])})},aW.any=function(t){var e=this;return new e(function(n,o){if(!(t&&void 0!==t.length))return o(TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return o();for(var i=[],a=0;a<r.length;a++)try{e.resolve(r[a]).then(n).catch(function(t){i.push(t),i.length===r.length&&o(new aH(i,"All promises were rejected"))})}catch(t){o(t)}})},aW.allSettled=function(t){return new this(function(e,n){if(!(t&&void 0!==t.length))return n(TypeError(aF(t)+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);for(var r=o.length,i=0;i<o.length;i++)!function t(n,i){if(i&&("object"===aF(i)||"function"==typeof i)){var a=i.then;if("function"==typeof a){a.call(i,function(e){t(n,e)},function(t){o[n]={status:"rejected",reason:t},0==--r&&e(o)});return}}o[n]={status:"fulfilled",value:i},0==--r&&e(o)}(i,o[i])})},aW.resolve=function(t){return t&&"object"===aF(t)&&t.constructor===aW?t:new aW(function(e){e(t)})},aW.reject=function(t){return new aW(function(e,n){n(t)})},aW.race=function(t){return new aW(function(e,n){if(!aB(t))return n(TypeError("Promise.race accepts an array"));for(var o=0,r=t.length;o<r;o++)aW.resolve(t[o]).then(e,n)})},aW._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){aU(t,0)},aW._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},(0,t_.hasWin)()&&(window.Promise=window.Promise||aW);let aX="function"==typeof fetch?fetch.bind():function(t,e){return new aW(function(n,o){var r=new XMLHttpRequest;for(var i in r.open(e.method||"get",t),r.withCredentials="include"==e.credentials,e.headers||{})r.setRequestHeader(i,e.headers[i]);r.onload=function(t){return n({status:r.status,statusText:r.statusText,text:function(){return aW.resolve(r.responseText)}})},r.onerror=o,r.upload&&e.onProgress&&(r.upload.onprogress=e.onProgress),e.body?r.send(e.body):r.send()})};var aZ=function(){return(aZ=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},aQ=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},a0=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},a1=function(){function t(){}return t.prototype.store=function(t){return aQ(this,arguments,void 0,function(t,e){return void 0===e&&(e={}),a0(this,function(n){switch(n.label){case 0:return[4,this.request(e.urlStore,this.__props(e,t),e)];case 1:return[2,n.sent()]}})})},t.prototype.load=function(){return aQ(this,arguments,void 0,function(t){return void 0===t&&(t={}),a0(this,function(e){switch(e.label){case 0:return[4,this.request(t.urlLoad,this.__props(t),t)];case 1:return[2,e.sent()]}})})},t.prototype.request=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),aX(t,e).then(function(t){var e=t.text();return(t.status/200|0)==1?e:e.then(Promise.reject)}).then(function(t){var e=t&&(0,tw.isString)(t);return n.contentTypeJson&&e?JSON.parse(t):t})},t.prototype.__props=function(t,e){void 0===t&&(t={});var n,o=t.contentTypeJson,r=t.headers||{},i=t.fetchOptions||{},a="X-Requested-With",s="Content-Type";if((0,tw.isUndefined)(r[a])&&(r[a]="XMLHttpRequest"),(0,tw.isUndefined)(r[s])&&o&&(r[s]="application/json; charset=utf-8"),e){if(o)n=JSON.stringify(e);else for(var l in n=new FormData,e)n.append(l,e[l])}var c={method:n?"POST":"GET",credentials:t.credentials,headers:r,body:n};return aZ(aZ({},c),(0,tw.isFunction)(i)?i(c):i)},t}();(u4=de||(de={})).start="storage:start",u4.startStore="storage:start:store",u4.startLoad="storage:start:load",u4.load="storage:load",u4.store="storage:store",u4.after="storage:after",u4.afterStore="storage:after:store",u4.afterLoad="storage:after:load",u4.end="storage:end",u4.endStore="storage:end:store",u4.endLoad="storage:end:load",u4.error="storage:error",u4.errorStore="storage:error:store",u4.errorLoad="storage:error:load";let a2=de;var a5=(u6=function(t,e){return(u6=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u6(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a3=function(){return(a3=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},a4=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},a6=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},a7="local",a9="remote",a8=function(t){function e(e){var n=t.call(this,e,"StorageManager",{id:"gjs-",type:"local",autosave:!0,autoload:!0,stepsBeforeSave:1,recovery:!1,onStore:function(t){return t},onLoad:function(t){return t},options:{local:{key:"gjsProject",checkLocal:!0},remote:{headers:{},urlStore:"",urlLoad:"",contentTypeJson:!0,fetchOptions:"",credentials:"include",onStore:function(t){return t},onLoad:function(t){return t}}}})||this;n.storages={},n.events=a2;var o=n.config;return o._disable&&(o.type=void 0),n.storages={},n.add(a7,new aV),n.add(a9,new a1),n.setCurrent(o.type),n}return a5(e,t),e.prototype.isAutosave=function(){return!!this.config.autosave},e.prototype.setAutosave=function(t){return this.config.autosave=!!t,this},e.prototype.getStepsBeforeSave=function(){return this.config.stepsBeforeSave},e.prototype.setStepsBeforeSave=function(t){return this.config.stepsBeforeSave=t,this},e.prototype.add=function(t,e){return this.storages[t]=e,this},e.prototype.get=function(t){return this.storages[t]},e.prototype.getStorages=function(){return this.storages},e.prototype.getCurrent=function(){return this.config.currentStorage},e.prototype.setCurrent=function(t){return this.getConfig().currentStorage=t,this},e.prototype.getCurrentStorage=function(){return this.get(this.getCurrent())},e.prototype.getStorageOptions=function(t){return this.getCurrentOptions(t)},e.prototype.store=function(t){return a4(this,arguments,void 0,function(t,e){var n,o,r,i,a;return void 0===e&&(e={}),a6(this,function(s){switch(s.label){case 0:n=this.getCurrentStorage(),o=a3(a3({},this.getCurrentOptions()),e),r=this.getRecoveryStorage(),i=this.getCurrentOptions(a7),s.label=1;case 1:return s.trys.push([1,5,,9]),[4,this.__exec(n,o,t)];case 2:if(s.sent(),!r)return[3,4];return[4,this.__exec(r,i,{})];case 3:s.sent(),s.label=4;case 4:case 8:return[3,9];case 5:if(a=s.sent(),!r)return[3,7];return[4,this.__exec(r,i,t)];case 6:return s.sent(),[3,8];case 7:throw a;case 9:return[2,t]}})})},e.prototype.load=function(){return a4(this,arguments,void 0,function(t){var e,n,o,r,i;return void 0===t&&(t={}),a6(this,function(a){switch(a.label){case 0:if(e=this.getCurrentStorage(),n=a3(a3({},this.getCurrentOptions()),t),!(o=this.getRecoveryStorage()))return[3,5];return[4,this.__exec(o,this.getCurrentOptions(a7))];case 1:if(i=a.sent(),(0,tw.isEmpty)(i))return[3,5];a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.__askRecovery()];case 3:return a.sent(),r=i,[3,5];case 4:return a.sent(),[3,5];case 5:if(r)return[3,7];return[4,this.__exec(e,n)];case 6:r=a.sent(),a.label=7;case 7:return[2,r||{}]}})})},e.prototype.__askRecovery=function(){var t=this.em,e=this.getRecovery();return new Promise(function(n,o){(0,tw.isFunction)(e)?e(n,o,null==t?void 0:t.getEditor()):confirm(null==t?void 0:t.t("storageManager.recover"))?n(null):o()})},e.prototype.getRecovery=function(){return this.config.recovery},e.prototype.getRecoveryStorage=function(){return this.getRecovery()&&this.getCurrent()===a9&&this.get(a7)},e.prototype.__exec=function(t,e,n){return a4(this,void 0,void 0,function(){var o,r,i,a,s,l,c,u,p,d,f,h,g,v;return a6(this,function(y){switch(y.label){case 0:if(o=n?"store":"load",i=(r=this.getConfig()).onStore,a=r.onLoad,!t)return[2,n||{}];this.onStart(o,n),y.label=1;case 1:if(y.trys.push([1,14,,15]),l=null===(v=this.em)||void 0===v?void 0:v.getEditor(),c=void 0,!n)return[3,7];if(!(p=i))return[3,3];return[4,i(n,l)];case 2:p=y.sent(),y.label=3;case 3:if(u=p||n,!(d=e.onStore))return[3,5];return[4,e.onStore(u,l)];case 4:d=y.sent(),y.label=5;case 5:return u=d||u,[4,t.store(u,e)];case 6:return c=y.sent(),s=n,[3,13];case 7:return[4,t.load(e)];case 8:if(c=y.sent(),s=this.__clearKeys(c),!(f=e.onLoad))return[3,10];return[4,e.onLoad(s,l)];case 9:f=y.sent(),y.label=10;case 10:if(s=f||s,!(h=a))return[3,12];return[4,a(s,l)];case 11:h=y.sent(),y.label=12;case 12:s=h||s,y.label=13;case 13:return this.onAfter(o,s,c),this.onEnd(o,s,c),[3,15];case 14:throw g=y.sent(),this.onError(o,g),g;case 15:return[2,s]}})})},e.prototype.__clearKeys=function(t){void 0===t&&(t={});var e=this.getConfig(),n=new RegExp("^".concat(e.id)),o={};for(var r in t)o[r.replace(n,"")]=t[r];return o},e.prototype.getCurrentOptions=function(t){var e=this.getConfig(),n=t||this.getCurrent();return e.options[n]||{}},e.prototype.onStart=function(t,e){var n=this.em;if(n){var o="load"===t?a2.startLoad:a2.startStore;n.trigger(a2.start,t,e),n.trigger(o,e)}},e.prototype.onAfter=function(t,e,n){var o=this.em;if(o){var r="load"===t?a2.afterLoad:a2.afterStore;o.trigger(a2.after),o.trigger(r,e,n);var i="load"===t?a2.load:a2.store;o.trigger(i,e,n)}},e.prototype.onEnd=function(t,e,n){var o=this.em;if(o){var r="load"===t?a2.endLoad:a2.endStore;o.trigger(a2.end,t,e,n),o.trigger(r,e,n)}},e.prototype.onError=function(t,e){var n=this.em;if(n){var o="load"===t?a2.errorLoad:a2.errorStore;n.trigger(a2.error,e,t),n.trigger(o,e),this.onEnd(t,e)}},e.prototype.canAutoload=function(){return!!this.getCurrentStorage()&&!!this.config.autoload},e.prototype.destroy=function(){this.storages={}},e}(tD),st=(u7=function(t,e){return(u7=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u7(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),se=function(){return(se=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},sn=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.events={},n.appendInput=!0;var o=e.config,r=void 0===o?{}:o,i=n.model,a=n.eventCapture,s=i.target,l=i.attributes.type;return n.config=r,n.em=r.em,n.pfx=r.stylePrefix||"",n.ppfx=r.pStylePrefix||"",n.target=s,n.className=n.pfx+"trait",n.clsField="".concat(n.ppfx,"field ").concat(n.ppfx,"field-").concat(l),[["change:value",n.onValueChange],["remove",n.removeView]].forEach(function(t){var e=t[0],o=t[1];i.off(e,o),n.listenTo(i,e,o)}),i.view=n,n.listenTo(i,"change:label",n.render),n.listenTo(i,"change:placeholder",n.rerender),n.events={},a.forEach(function(t){return n.events[t]="onChange"}),n.delegateEvents(),n.init(),n}return st(e,t),e.prototype.attributes=function(){return this.model.get("attributes")||{}},e.prototype.templateLabel=function(t){var e=this.ppfx,n=this.getLabel();return'<div class="'.concat(e,'label" title="').concat(n,'">').concat(n,"</div>")},e.prototype.templateInput=function(t){var e=this.clsField;return'<div class="'.concat(e,'" data-input></div>')},e.prototype.getClbOpts=function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},e.prototype.removeView=function(){this.remove(),this.removed()},e.prototype.init=function(){},e.prototype.removed=function(){},e.prototype.onRender=function(t){},e.prototype.onUpdate=function(t){},e.prototype.onEvent=function(t){},e.prototype.onChange=function(t){var e=this.getInputElem();e&&!(0,tw.isUndefined)(e.value)&&this.model.set("value",e.value),this.onEvent(se(se({},this.getClbOpts()),{event:t}))},e.prototype.getValueForTarget=function(){return this.model.get("value")},e.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.value=t)},e.prototype.onValueChange=function(t,e,n){void 0===n&&(n={});var o=this.model,r=this.getValueForTarget();n.fromTarget?(this.setInputValue(r),this.postUpdate()):o.setValue(r,n)},e.prototype.renderLabel=function(){var t=this.$el,e=this.target,n=this.getLabel(),o=this.templateLabel(e);this.createLabel&&(o=this.createLabel({label:n,component:e,trait:this})||""),t.find("[data-label]").append(o)},e.prototype.getLabel=function(){var t=this.em,e=this.model.attributes,n=e.label,o=e.name;return t.t("traitManager.traits.labels.".concat(o))||(0,t_.capitalize)(n||o).replace(/-/g," ")},e.prototype.getComponent=function(){return this.target},e.prototype.getInputEl=function(){if(!this.$input){var t=this.em,e=this.model,n=e.attributes.name,o=e.get("placeholder")||e.get("default")||"",r=e.get("type")||"text",i=e.get("min"),a=e.get("max"),s=this.getModelValue(),l=(0,tO.default)('<input type="'.concat(r,'">')),c=t.t("traitManager.traits.attributes.".concat(n))||{};l.attr(se({placeholder:o},c)),(0,tw.isUndefined)(s)||(e.set({value:s},{silent:!0}),l.prop("value",s)),i&&l.prop("min",i),a&&l.prop("max",a),this.$input=l}return this.$input.get(0)},e.prototype.getInputElem=function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},e.prototype.getModelValue=function(){return this.model.getValue()},e.prototype.getElInput=function(){return this.elInput},e.prototype.renderField=function(){var t=this.$el,e=this.appendInput,n=this.model,o=t.find("[data-input]"),r=o[o.length-1],i=n.el;i||(i=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,tw.isString)(i)?(r.innerHTML=i,this.elInput=r.firstChild):(e?r.appendChild(i):r.insertBefore(i,r.firstChild),this.elInput=i),n.el=this.elInput},e.prototype.hasLabel=function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t},e.prototype.rerender=function(){delete this.model.el,this.render()},e.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},e.prototype.render=function(){var t=this.$el,e=this.pfx,n=this.ppfx,o=this.model.attributes,r=o.type,i=o.id,a=this.hasLabel&&this.hasLabel(),s="".concat(e,"trait");delete this.$input;var l='<div class="'.concat(s," ").concat(s,"--").concat(r,'">\n ').concat(a?'<div class="'.concat(n,'label-wrp" data-label></div>'):"",'\n <div class="').concat(n,"field-wrp ").concat(n,"field-wrp--").concat(r,'" data-input>\n ').concat(this.templateInput?(0,tw.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"","\n </div>\n </div>");return t.empty().append(l),a&&this.renderLabel(),this.renderField(),this.el.className="".concat(s,"__wrp ").concat(s,"__wrp-").concat(i),this.postUpdate(),this.onRender(this.getClbOpts()),this},e}(tT.Ss);sn.prototype.eventCapture=["change"];var so=(u9=function(t,e){return(u9=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u9(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return so(e,t),e.prototype.templateInput=function(){return""},e.prototype.onChange=function(){this.handleClick()},e.prototype.handleClick=function(){this.model.runCommand()},e.prototype.renderLabel=function(){this.model.get("label")&&sn.prototype.renderLabel.apply(this)},e.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),o=n.labelButton,r=n.text,i=n.full,a="".concat(e,"btn");return'<button type="button" class="'.concat(a,"-prim").concat(i?" ".concat(a,"--full"):"",'">').concat(o||r,"</button>")},e}(sn);sr.prototype.eventCapture=["click button"];var si=(u8=function(t,e){return(u8=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u8(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.appendInput=!1,e}return si(e,t),e.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return'<label class="'.concat(e,'" data-input>\n <i class="').concat(t,'chk-icon"></i>\n </label>')},e.prototype.onChange=function(){this.model.set("value",this.getInputElem().checked)},e.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},e.prototype.getInputEl=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!this.$input,o=sn.prototype.getInputEl.apply(this,t);if(n){var r=void 0,i=void 0,a=this.model,s=this.target,l=a.attributes.valueFalse,c=a.getName();a.changeProp?i=r=s.get(c):r=!!(i=s.get("attributes")[c])||""===i,(0,tw.isUndefined)(l)||i!==l||(r=!1),o.checked=r}return o},e}(sn),ss=(pt=function(t,e){return(pt=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sl=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.ppfx||"";return n.opts=e,n.ppfx=o,n.em=e.target||{},e.onChange||n.listenTo(n.model,"change:value",n.handleModelChange),n}return ss(e,t),e.prototype.template=function(){return'<span class="'.concat(this.holderClass(),'"></span>')},e.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},e.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},e.prototype.elementUpdated=function(){this.model.trigger("el:change")},e.prototype.setValue=function(t,e){var n=this.model,o=t||n.get("defaults"),r=this.getInputEl();r&&(r.value=o)},e.prototype.handleModelChange=function(t,e,n){this.setValue(e,n)},e.prototype.handleChange=function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},e.prototype.__onInputChange=function(t){this.model.set({value:t},{fromInput:1})},e.prototype.getInputEl=function(){if(!this.inputEl){var t=this.model,e=this.opts.type||"text",n=t.get("placeholder")||t.get("defaults")||t.get("default")||"";this.inputEl=(0,tO.default)('<input type="'.concat(e,'" placeholder="').concat(n,'">'))}return this.inputEl.get(0)},e.prototype.render=function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this},e}(tT.Ss);sl.prototype.events={change:"handleChange"};var sc=(pe=function(t,e){return(pe=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),su=function(){return(su=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};tO.default&&function(t,e){if((0,t_.hasWin)()){var n,o,r,i={beforeShow:S,move:S,change:S,show:S,hide:S,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},a=[],s=!!/msie/i.exec(window.navigator.userAgent),l=function(){function t(t,e){return!!~(""+t).indexOf(e)}var e=document.createElement("div").style;return e.cssText="background-color:rgba(0,0,0,.5)",t(e.backgroundColor,"rgba")||t(e.backgroundColor,"hsla")}(),c=function(){var t="";if(s)for(var e=1;e<=6;e++)t+="<div class='sp-"+e+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",t,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}(),u="spectrum.id";t.fn.spectrum=function(n,o){if("string"==typeof n){var r=this,p=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a[t(this).data(u)];if(e){var o=e[n];if(!o)throw Error("Spectrum: no such method: '"+n+"'");"get"==n?r=e.get():"container"==n?r=e.container:"option"==n?r=e.option.apply(e,p):"destroy"==n?(e.destroy(),t(this).removeData(u)):o.apply(e,p)}}),r}return this.spectrum("destroy").each(function(){var o=function(n,o){var r,u,p,d=((p=t.extend({},i,o)).callbacks={move:T(p.move,n),change:T(p.change,n),show:T(p.show,n),hide:T(p.hide,n),beforeShow:T(p.beforeShow,n)},p),f=d.flat,h=d.showSelectionPalette,g=d.localStorageKey,v=d.theme,y=d.callbacks,m=function(){var t=this,e=arguments;r&&clearTimeout(u),(r||!u)&&(u=setTimeout(function(){u=null,tB.apply(t,e)},10))},w=!1,_=!1,C=!0,S=0,k=0,A=0,j=0,M=0,D=0,L=0,I=0,N=0,R=0,V=1,F=[],H=[],U={},B=d.selectionPalette.slice(0),z=d.maxSelectionSize,W="sp-dragging",$=null,q=n.ownerDocument,G=(q.body,t(n)),K=!1,Y=t(c,q).addClass(v),J=Y.find(".sp-picker-container"),X=Y.find(".sp-color"),Z=Y.find(".sp-dragger"),Q=Y.find(".sp-hue"),tt=Y.find(".sp-slider"),te=Y.find(".sp-alpha-inner"),tn=Y.find(".sp-alpha"),to=Y.find(".sp-alpha-handle"),tr=Y.find(".sp-input"),ti=Y.find(".sp-palette"),ta=Y.find(".sp-initial"),ts=Y.find(".sp-cancel"),tl=Y.find(".sp-clear"),tc=Y.find(".sp-choose"),tu=Y.find(".sp-palette-toggle"),tp=G.is("input"),td=tp&&"color"===G.attr("type")&&E(),tf=tp&&!f,th=tf?t("<div class='sp-replacer'><div class='sp-preview'><div class='sp-preview-inner'></div></div><div class='sp-dd'>&#9660;</div></div>").addClass(v).addClass(d.className).addClass(d.replacerClassName):t([]),tg=tf?th:G,tv=th.find(".sp-preview-inner"),ty=d.color||tp&&G.val(),tm=!1,tb=d.preferredFormat,tw=!d.showButtons||d.clickoutFiresChange,t_=!ty,tC=d.allowEmpty&&!td;function tx(){if(d.showPaletteOnly&&(d.showPalette=!0),tu.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),d.palette){F=d.palette.slice(0),H=t.isArray(F[0])?F:[F],U={};for(var e=0;e<H.length;e++)for(var n=0;n<H[e].length;n++)U[b(H[e][n]).toRgbString()]=!0}Y.toggleClass("sp-flat",f),Y.toggleClass("sp-input-disabled",!d.showInput),Y.toggleClass("sp-alpha-enabled",d.showAlpha),Y.toggleClass("sp-clear-enabled",tC),Y.toggleClass("sp-buttons-disabled",!d.showButtons),Y.toggleClass("sp-palette-buttons-disabled",!d.togglePaletteOnly),Y.toggleClass("sp-palette-disabled",!d.showPalette),Y.toggleClass("sp-palette-only",d.showPaletteOnly),Y.toggleClass("sp-initial-disabled",!d.showInitial),Y.addClass(d.className).addClass(d.containerClassName),tB()}function tS(){if(g&&window.localStorage){try{var e=window.localStorage[g].split(",#");e.length>1&&(delete window.localStorage[g],t.each(e,function(t,e){tO(e)}))}catch(t){}try{B=window.localStorage[g].split(";")}catch(t){}}}function tO(e){if(h){var n=b(e).toRgbString();if(!U[n]&&-1===t.inArray(n,B))for(B.push(n);B.length>z;)B.shift();if(g&&window.localStorage)try{window.localStorage[g]=B.join(";")}catch(t){}}}function tT(){var e=tR(),n=t.map(H,function(t,n){return x(t,e,"sp-palette-row sp-palette-row-"+n,d)});tS(),B&&n.push(x(function(){var t=[];if(d.showPalette)for(var e=0;e<B.length;e++)U[b(B[e]).toRgbString()]||t.push(B[e]);return t.reverse().slice(0,d.maxSelectionSize)}(),e,"sp-palette-row sp-palette-row-selection",d)),ti.html(n.join(""))}function tP(){if(d.showInitial){var t=tm,e=tR();ta.html(x([t,e],e,"sp-palette-row-initial",d))}}function tE(){(k<=0||S<=0||j<=0)&&tB(),_=!0,Y.addClass(W),$=null,G.trigger("dragstart.spectrum",[tR()])}function tk(){_=!1,Y.removeClass(W),G.trigger("dragstop.spectrum",[tR()])}function tA(){var t=tr.val();if((null===t||""===t)&&tC)tN(null),tU(!0);else{var e=b(t);e.isValid()?(tN(e),tU(!0)):tr.addClass("sp-validation-error")}}function tj(){w?tI():tM()}function tM(){var e=t.Event("beforeShow.spectrum");if(w){tB();return}if(G.trigger("beforeShow.spectrum",[tR()]),!(!1===y.beforeShow(tR())||e.isDefaultPrevented())){(function(){for(var t=0;t<a.length;t++)a[t]&&a[t].hide()})(),w=!0;var n=t(q);n.bind("keydown.spectrum",tD),n.bind("click.spectrum",tL),t(window).bind("resize.spectrum",m),th.addClass("sp-active"),Y.removeClass("sp-hidden"),tB(),tF(),tm=tR(),tP(),y.show(tm),G.trigger("show.spectrum",[tm])}}function tD(t){27===t.keyCode&&tI()}function tL(t){2==t.button||_||(tw?tU(!0):tN(tm,!0),tI())}function tI(){w&&!f&&(w=!1,t(q).unbind("keydown.spectrum",tD),t(q).unbind("click.spectrum",tL),t(window).unbind("resize.spectrum",m),th.removeClass("sp-active"),Y.addClass("sp-hidden"),y.hide(tR()),G.trigger("hide.spectrum",[tR()]))}function tN(t,e){var n,o;if(b.equals(t,tR())){tF();return}!t&&tC?t_=!0:(t_=!1,C=!t,I=(o=(n=b(t)).toHsv()).h%360/360,N=o.s,R=o.v,V=o.a),tF(),n&&n.isValid()&&!e&&(tb=d.preferredFormat||n.getFormat())}function tR(t){return(t=t||{},tC&&t_)?null:b.fromRatio({h:I,s:N,v:R,a:Math.round(100*V)/100},{format:t.format||tb})}function tV(){tF(),y.move(tR()),G.trigger("move.spectrum",[tR()])}function tF(){tr.removeClass("sp-validation-error"),tH();var t=b.fromRatio({h:I,s:1,v:1});X.css("background-color",t.toHexString());var e=tb;V<1&&!(0===V&&"name"===e)&&("hex"===e||"hex3"===e||"hex6"===e||"name"===e)&&(e="rgb");var n=tR({format:e}),o="";if(tv.removeClass("sp-clear-display"),tv.css("background-color","transparent"),!n&&tC)tv.addClass("sp-clear-display");else{var r=n.toHexString(),i=n.toRgbString();if(l||1===n.alpha?tv.css("background-color",i):(tv.css("background-color","transparent"),tv.css("filter",n.toFilter())),d.showAlpha){var a=n.toRgb();a.a=0;var c=b(a).toRgbString(),u="linear-gradient(left, "+c+", "+r+")";s?te.css("filter",b(c).toFilter({gradientType:1},r)):(te.css("background","-webkit-"+u),te.css("background","-moz-"+u),te.css("background","-ms-"+u),te.css("background","linear-gradient(to right, "+c+", "+r+")"))}o=n.toString(e)}d.showInput&&tr.val(o),d.showPalette&&tT(),tP()}function tH(){var t=N,e=R;if(tC&&t_)to.hide(),tt.hide(),Z.hide();else{to.show(),tt.show(),Z.show();var n=t*S,o=k-e*k;n=Math.max(-A,Math.min(S-A,n-A)),o=Math.max(-A,Math.min(k-A,o-A)),Z.css({top:o+"px",left:n+"px"});var r=V*M;to.css({left:r-D/2+"px"});var i=I*j;tt.css({top:i-L+"px"})}}function tU(t){var e=tR(),n="",o=!!C||!b.equals(e,tm);e&&(n=e.toString(tb),w||tO(e)),tp&&G.val(n),t&&o&&(y.change(e),G.trigger("change",[e]))}function tB(){w&&(S=X.width(),k=X.height(),A=Z.height(),Q.width(),j=Q.height(),L=tt.height(),M=tn.width(),D=to.width(),f||(Y.css("position","absolute"),d.offset?Y.offset(d.offset):Y.offset(function(t,e){for(var n=e[0],o=t[0],r=o.parentElement,i=n.getBoundingClientRect(),a=o.offsetWidth,s=o.offsetHeight,l={top:0,left:0,width:n.offsetWidth,height:n.offsetHeight};n&&(l.top+=n.offsetTop-n.scrollTop,l.left+=n.offsetLeft-n.scrollLeft,n!==r&&r.contains(n.offsetParent));)n=n.offsetParent;return i.right+a>window.innerWidth-window.scrollX&&i.right-a>0&&(l.left-=a-l.width),i.bottom+s<window.innerHeight-window.scrollY?l.top+=l.height:l.top-=s,l}(Y,tg))),tH(),d.showPalette&&tT(),G.trigger("reflow.spectrum"))}function tz(){tI(),K=!0,G.attr("disabled",!0),tg.addClass("sp-disabled")}!function(){if(s&&Y.find("*:not(input)").attr("unselectable","on"),tx(),tf&&G.after(th).hide(),tC||tl.hide(),f)G.after(Y).hide();else{var e="parent"===d.appendTo?G.parent():t(d.appendTo);1!==e.length&&(e=t("body")),e.append(Y)}function n(e){return e.data&&e.data.ignore?(tN(t(e.target).closest(".sp-thumb-el").data("color")),tV()):(tN(t(e.target).closest(".sp-thumb-el").data("color")),tV(),d.hideAfterPaletteSelect&&(tU(!0),tI())),!1}tS(),tg.bind("click.spectrum touchstart.spectrum",function(e){K||tj(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()}),(G.is(":disabled")||!0===d.disabled)&&tz(),Y.click(O),tr.change(tA),tr.bind("paste",function(){setTimeout(tA,1)}),tr.keydown(function(t){13==t.keyCode&&tA()}),ts.text(d.cancelText),ts.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),tN(tm,!0),tI()}),tl.attr("title",d.clearText),tl.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),t_=!0,tV(),f&&tU(!0)}),tc.text(d.chooseText),tc.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),s&&tr.is(":focus")&&tr.trigger("change"),tr.hasClass("sp-validation-error")||(tU(!0),tI())}),tu.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),tu.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),d.showPaletteOnly=!d.showPaletteOnly,d.showPaletteOnly||f||Y.css("left","-="+(J.outerWidth(!0)+5)),tx()}),P(tn,function(t,e,n){V=t/M,t_=!1,n.shiftKey&&(V=Math.round(10*V)/10),tV()},tE,tk),P(Q,function(t,e){I=parseFloat(e/j),t_=!1,d.showAlpha||(V=1),tV()},tE,tk),P(X,function(t,e,n){n.shiftKey?$||($=Math.abs(t-N*S)>Math.abs(e-(k-R*k))?"x":"y"):$=null;var o=!$||"x"===$,r=!$||"y"===$;o&&(N=parseFloat(t/S)),r&&(R=parseFloat((k-e)/k)),t_=!1,d.showAlpha||(V=1),tV()},tE,tk),ty?(tN(ty),tF(),tb=d.preferredFormat||b(ty).getFormat(),tO(ty)):tF(),f&&tM();var o=s?"mousedown.spectrum":"click.spectrum touchstart.spectrum";ti.delegate(".sp-thumb-el",o,n),ta.delegate(".sp-thumb-el:nth-child(1)",o,{ignore:!0},n)}();var tW={show:tM,hide:tI,toggle:tj,reflow:tB,option:function(n,o){return e===n?t.extend({},d):e===o?d[n]:void(d[n]=o,"preferredFormat"===n&&(tb=d.preferredFormat),tx())},enable:function(){K=!1,G.attr("disabled",!1),tg.removeClass("sp-disabled")},disable:tz,offset:function(t){d.offset=t,tB()},set:function(t){tN(t),tU()},get:tR,destroy:function(){G.show(),tg.unbind("click.spectrum touchstart.spectrum"),Y.remove(),th.remove(),a[tW.id]=null},container:Y};return tW.id=a.push(tW)-1,tW}(this,t.extend({},n,t(this).data()));t(this).data(u,o.id)})},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=P,t.fn.spectrum.defaults=i,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("<input type='color'/>")[0];e._cachedResult="color"===n.type&&""!==n.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t("input[type=color]");e.length&&!E()&&e.spectrum({preferredFormat:"hex6"})};var p=/^[\s,#]+/,d=/\s+$/,f=0,h=Math,g=h.round,v=h.min,y=h.max,m=h.random,b=function(t,e){if(e=e||{},(t=t||"")instanceof b)return t;if(!(this instanceof b))return new b(t,e);var n,o,r,i,a,s,l,c,u,m,_,x,S,O,T,P,E,k=(o={r:0,g:0,b:0},r=1,i=!1,a=!1,"string"==typeof(n=t)&&(n=function(t){t=t.replace(p,"").replace(d,"").toLowerCase();var e,n=!1;if(w[t])t=w[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=C.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=C.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=C.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=C.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=C.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=C.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=C.hex8.exec(t))?{a:Y(e[1])/255,r:Y(e[2]),g:Y(e[3]),b:Y(e[4]),format:n?"name":"hex8"}:(e=C.hex6.exec(t))?{r:Y(e[1]),g:Y(e[2]),b:Y(e[3]),format:n?"name":"hex"}:!!(e=C.hex3.exec(t))&&{r:Y(e[1]+""+e[1]),g:Y(e[2]+""+e[2]),b:Y(e[3]+""+e[3]),format:n?"name":"hex"}}(n)),"object"==typeof n&&(n.hasOwnProperty("r")&&n.hasOwnProperty("g")&&n.hasOwnProperty("b")?(s=n.r,l=n.g,c=n.b,o={r:255*G(s,255),g:255*G(l,255),b:255*G(c,255)},i=!0,a="%"===String(n.r).substr(-1)?"prgb":"rgb"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("v")?(n.s=X(n.s),n.v=X(n.v),u=n.h,m=n.s,_=n.v,u=6*G(u,360),m=G(m,100),_=G(_,100),x=h.floor(u),S=u-x,O=_*(1-m),T=_*(1-S*m),P=_*(1-(1-S)*m),o={r:255*[_,T,O,O,P,_][E=x%6],g:255*[P,_,_,T,O,O][E],b:255*[O,O,P,_,_,T][E]},i=!0,a="hsv"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("l")&&(n.s=X(n.s),n.l=X(n.l),o=function(t,e,n){var o,r,i;function a(t,e,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?t+(e-t)*6*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=G(t,360),e=G(e,100),n=G(n,100),0===e)o=r=i=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;o=a(l,s,t+1/3),r=a(l,s,t),i=a(l,s,t-1/3)}return{r:255*o,g:255*r,b:255*i}}(n.h,n.s,n.l),i=!0,a="hsl"),n.hasOwnProperty("a")&&(r=n.a)),r=q(r),{ok:i,format:n.format||a,r:v(255,y(o.r,0)),g:v(255,y(o.g,0)),b:v(255,y(o.b,0)),a:r});this._originalInput=t,this._r=k.r,this._g=k.g,this._b=k.b,this._a=k.a,this._roundA=g(100*this._a)/100,this._format=e.format||k.format,this._gradientType=e.gradientType,this._r<1&&(this._r=g(this._r)),this._g<1&&(this._g=g(this._g)),this._b<1&&(this._b=g(this._b)),this._ok=k.ok,this._tc_id=f++};b.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=q(t),this._roundA=g(100*this._a)/100,this},toHsv:function(){var t=A(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=A(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),o=g(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+o+"%)":"hsva("+e+", "+n+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=k(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=k(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),o=g(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+o+"%)":"hsla("+e+", "+n+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return j(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return M(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:g(this._r),g:g(this._g),b:g(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+g(this._r)+", "+g(this._g)+", "+g(this._b)+")":"rgba("+g(this._r)+", "+g(this._g)+", "+g(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:g(100*G(this._r,255))+"%",g:g(100*G(this._g,255))+"%",b:g(100*G(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+g(100*G(this._r,255))+"%, "+g(100*G(this._g,255))+"%, "+g(100*G(this._b,255))+"%)":"rgba("+g(100*G(this._r,255))+"%, "+g(100*G(this._g,255))+"%, "+g(100*G(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(_[j(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+M(this._r,this._g,this._b,this._a),n=e,o=this._gradientType?"GradientType = 1, ":"";return t&&(n=b(t).toHex8String()),"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0;return!e&&o&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t)?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(N,arguments)},brighten:function(){return this._applyModification(R,arguments)},darken:function(){return this._applyModification(V,arguments)},desaturate:function(){return this._applyModification(D,arguments)},saturate:function(){return this._applyModification(L,arguments)},greyscale:function(){return this._applyModification(I,arguments)},spin:function(){return this._applyModification(F,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(W,arguments)},complement:function(){return this._applyCombination(H,arguments)},monochromatic:function(){return this._applyCombination($,arguments)},splitcomplement:function(){return this._applyCombination(z,arguments)},triad:function(){return this._applyCombination(U,arguments)},tetrad:function(){return this._applyCombination(B,arguments)}},b.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var o in t)t.hasOwnProperty(o)&&("a"===o?n[o]=t[o]:n[o]=X(t[o]));t=n}return b(t,e)},b.equals=function(t,e){return!!t&&!!e&&b(t).toRgbString()==b(e).toRgbString()},b.random=function(){return b.fromRatio({r:m(),g:m(),b:m()})},b.mix=function(t,e,n){n=0===n?0:n||50;var o,r=b(t).toRgb(),i=b(e).toRgb(),a=n/100,s=2*a-1,l=i.a-r.a,c=1-(o=((o=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:i.r*o+r.r*c,g:i.g*o+r.g*c,b:i.b*o+r.b*c,a:i.a*a+r.a*(1-a)};return b(u)},b.readability=function(t,e){var n=b(t),o=b(e),r=n.toRgb(),i=o.toRgb();return{brightness:Math.abs(n.getBrightness()-o.getBrightness()),color:Math.max(r.r,i.r)-Math.min(r.r,i.r)+Math.max(r.g,i.g)-Math.min(r.g,i.g)+Math.max(r.b,i.b)-Math.min(r.b,i.b)}},b.isReadable=function(t,e){var n=b.readability(t,e);return n.brightness>125&&n.color>500},b.mostReadable=function(t,e){for(var n=null,o=0,r=!1,i=0;i<e.length;i++){var a=b.readability(t,e[i]),s=a.brightness>125&&a.color>500,l=a.brightness/125*3+a.color/500;(s&&!r||s&&r&&l>o||!s&&!r&&l>o)&&(r=s,o=l,n=b(e[i]))}return n};var w=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_=b.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(w),C=(o="[\\s|\\(]+("+(n="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",{rgb:RegExp("rgb"+o),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+o),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+o),hsva:RegExp("hsva"+r),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=b,t(function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()})}function x(e,n,o,r){for(var i=[],a=0;a<e.length;a++){var s=e[a];if(s){var c=b(s),u=c.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";u+=b.equals(n,s)?" sp-thumb-active":"";var p=c.toString(r.preferredFormat||"rgb"),d=l?"background-color:"+c.toRgbString():"filter:"+c.toFilter();i.push('<span title="'+p+'" data-color="'+c.toRgbString()+'" class="'+u+'"><span class="sp-thumb-inner" style="'+d+';"></span></span>')}else i.push(t("<div />").append(t('<span data-color="" style="background-color:transparent;" class="sp-clear-display"></span>').attr("title",r.noColorSelectedText)).html())}return"<div class='sp-cf "+o+"'>"+i.join("")+"</div>"}function S(){}function O(t){t.stopPropagation()}function T(t,e){var n=Array.prototype.slice,o=n.call(arguments,2);return function(){return t.apply(e,o.concat(n.call(arguments)))}}function P(e,n,o,r){n=n||function(){},o=o||function(){},r=r||function(){};var i=document,a=!1,l={},c=0,u=0,p="ontouchstart"in window,d={};function f(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function h(t){if(a){if(s&&i.documentMode<9&&!t.button)return g();var o=t&&t.touches&&t.touches[0],r=o&&o.pageX||t.pageX,d=o&&o.pageY||t.pageY,h=Math.max(0,Math.min(r-l.left,u)),v=Math.max(0,Math.min(d-l.top,c));p&&f(t),n.apply(e,[h,v,t])}}function g(){a&&(t(i).unbind(d),t(i.body).removeClass("sp-dragging"),setTimeout(function(){r.apply(e,arguments)},0)),a=!1}d.selectstart=f,d.dragstart=f,d["touchmove mousemove"]=h,d["touchend mouseup"]=g,t(e).bind("touchstart mousedown",function(n){(n.which?3==n.which:2==n.button)||a||!1===o.apply(e,arguments)||(a=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(i).bind(d),t(i.body).addClass("sp-dragging"),h(n),f(n))})}function E(){return t.fn.spectrum.inputTypeColorSupport()}function k(t,e,n){t=G(t,255),e=G(e,255),n=G(n,255);var o,r,i=y(t,e,n),a=v(t,e,n),s=(i+a)/2;if(i==a)o=r=0;else{var l=i-a;switch(r=s>.5?l/(2-i-a):l/(i+a),i){case t:o=(e-n)/l+(e<n?6:0);break;case e:o=(n-t)/l+2;break;case n:o=(t-e)/l+4}o/=6}return{h:o,s:r,l:s}}function A(t,e,n){t=G(t,255),e=G(e,255),n=G(n,255);var o,r,i=y(t,e,n),a=v(t,e,n),s=i-a;if(r=0===i?0:s/i,i==a)o=0;else{switch(i){case t:o=(e-n)/s+(e<n?6:0);break;case e:o=(n-t)/s+2;break;case n:o=(t-e)/s+4}o/=6}return{h:o,s:r,v:i}}function j(t,e,n,o){var r=[J(g(t).toString(16)),J(g(e).toString(16)),J(g(n).toString(16))];return o&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function M(t,e,n,o){return[J(Math.round(255*parseFloat(o)).toString(16)),J(g(t).toString(16)),J(g(e).toString(16)),J(g(n).toString(16))].join("")}function D(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.s-=e/100,n.s=K(n.s),b(n)}function L(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.s+=e/100,n.s=K(n.s),b(n)}function I(t){return b(t).desaturate(100)}function N(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.l+=e/100,n.l=K(n.l),b(n)}function R(t,e){e=0===e?0:e||10;var n=b(t).toRgb();return n.r=y(0,v(255,n.r-g(-(e/100*255)))),n.g=y(0,v(255,n.g-g(-(e/100*255)))),n.b=y(0,v(255,n.b-g(-(e/100*255)))),b(n)}function V(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.l-=e/100,n.l=K(n.l),b(n)}function F(t,e){var n=b(t).toHsl(),o=(g(n.h)+e)%360;return n.h=o<0?360+o:o,b(n)}function H(t){var e=b(t).toHsl();return e.h=(e.h+180)%360,b(e)}function U(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+120)%360,s:e.s,l:e.l}),b({h:(n+240)%360,s:e.s,l:e.l})]}function B(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+90)%360,s:e.s,l:e.l}),b({h:(n+180)%360,s:e.s,l:e.l}),b({h:(n+270)%360,s:e.s,l:e.l})]}function z(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+72)%360,s:e.s,l:e.l}),b({h:(n+216)%360,s:e.s,l:e.l})]}function W(t,e,n){e=e||6,n=n||30;var o=b(t).toHsl(),r=360/n,i=[b(t)];for(o.h=(o.h-(r*e>>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(b(o));return i}function $(t,e){e=e||6;for(var n=b(t).toHsv(),o=n.h,r=n.s,i=n.v,a=[],s=1/e;e--;)a.push(b({h:o,s:r,v:i})),i=(i+s)%1;return a}function q(t){return(isNaN(t=parseFloat(t))||t<0||t>1)&&(t=1),t}function G(t,e){"string"==typeof(n=t)&&-1!=n.indexOf(".")&&1===parseFloat(n)&&(t="100%");var n,o,r="string"==typeof(o=t)&&-1!=o.indexOf("%");return(t=v(e,y(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),1e-6>h.abs(t-e))?1:t%e/parseFloat(e)}function K(t){return v(1,y(0,t))}function Y(t){return parseInt(t,16)}function J(t){return 1==t.length?"0"+t:""+t}function X(t){return t<=1&&(t=100*t+"%"),t}}(tO.default);var sp=function(t){var e="name"===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,"")},sd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return sc(e,t),e.prototype.template=function(){var t=this.ppfx;return'\n <div class="'.concat(this.holderClass(),'"></div>\n <div class="').concat(t,'field-colorp">\n <div class="').concat(t,'field-colorp-c" data-colorp-c>\n <div class="').concat(t,'checker-bg"></div>\n </div>\n </div>\n ')},e.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},e.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},e.prototype.remove=function(){return t.prototype.remove.call(this),this.colorEl.spectrum("destroy"),this},e.prototype.handleChange=function(t){t.stopPropagation();var e=t.target.value;(0,tw.isUndefined)(e)||this.__onInputChange(e)},e.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,o=t,r=this.getColorEl();if(r){r.spectrum("set",o);var i=r.spectrum("get"),a=o&&sp(i);a&&(o=a)}n?n(o):e.set({value:o},{fromInput:1})},e.prototype.setValue=function(t,e){void 0===e&&(e={});var n=this.model,o=(0,tw.isUndefined)(e.def)?n.get("defaults"):e.def,r=(0,tw.isUndefined)(t)?(0,tw.isUndefined)(o)?"":o:t,i=this.getInputEl(),a=this.getColorEl(),s="none"!=r?r:"";i.value=r,a.get(0).style.backgroundColor=s,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(a.spectrum("set",s),this.noneColor="none"==r,this.movedColor=s)},e.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e,n=this.em,o=this.model,r=this.opts,i=this.ppfx,a=r.onChange,s=(0,tO.default)('<div class="'.concat(this.ppfx,'field-color-picker"></div>')),l=s.get(0).style,c=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor="";var u=!1;this.$el.find("[data-colorp-c]").append(s);var p=function(t,e){void 0===e&&(e=!0),a?a(t,!e):(e&&o.setValueFromInput(0,!1),o.setValueFromInput(t,e))};s.spectrum(su(su(su({color:o.getValue()||!1,containerClassName:"".concat(i,"one-bg ").concat(i,"two-color ").concat(i,"editor-sp"),maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},c),o.get("colorPicker")||{}),{move:function(e){var n=sp(e);t.movedColor=n,l.backgroundColor=n,p(n,!1)},change:function(e){u=!0;var n=sp(e);l.backgroundColor=n,p(n),t.noneColor=!1},show:function(n){u=!1,t.movedColor="",e=a?o.getValue({noDefault:!0}):sp(n)},hide:function(){!u&&(e||a)&&(t.noneColor&&(e=""),l.backgroundColor=e,s.spectrum("set",e),p(e,!1))}})),n&&n.on&&this.listenTo(n,"component:selected",function(){t.movedColor&&p(t.movedColor),u=!0,t.movedColor="",s.spectrum("hide")}),this.colorEl=s}return this.colorEl},e.prototype.render=function(){return sl.prototype.render.call(this),this.getColorEl(),this},e}(sl),sf=(pn=function(t,e){return(pn=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pn(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return sf(e,t),e.prototype.templateInput=function(){return""},e.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new sd({model:t,target:this.config.em,contClass:this.ppfx+"field-color",ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input},e}(sn),sg=(po=function(t,e){return(po=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}po(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sv=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return(0,tw.bindAll)(n,"moveIncrement","upIncrement"),n.doc=document,n.listenTo(n.model,"change:unit",n.handleModelChange),n}return sg(e,t),e.prototype.template=function(){var t=this.ppfx;return'\n <span class="'.concat(t,'input-holder"></span>\n <span class="').concat(t,'field-units"></span>\n <div class="').concat(t,'field-arrows" data-arrows>\n <div class="').concat(t,'field-arrow-u" data-arrow-up></div>\n <div class="').concat(t,'field-arrow-d" data-arrow-down></div>\n </div>\n ')},e.prototype.inputClass=function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},e.prototype.setValue=function(t,e){var n=e||{},o=this.validateInputValue(t,{deepCheck:1}),r={value:o.value,unit:""};(o.unit||o.force)&&(r.unit=o.unit),this.model.set(r,n),n.silent&&this.handleModelChange()},e.prototype.handleChange=function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},e.prototype.handleUnitChange=function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},e.prototype.handleKeyDown=function(t){"ArrowUp"===t.key&&(t.preventDefault(),this.upArrowClick()),"ArrowDown"===t.key&&(t.preventDefault(),this.downArrowClick())},e.prototype.elementUpdated=function(){this.model.trigger("el:change")},e.prototype.handleModelChange=function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},e.prototype.getUnitEl=function(){if(!this.unitEl){var t=this.model,e=t.get("units")||[];if(e.length){var n=['<option value="" disabled hidden>-</option>'];e.forEach(function(e){var o=e==t.get("unit")?"selected":"";n.push("<option ".concat(o,">").concat(e,"</option>"))});var o=document.createElement("div");o.innerHTML='<select class="'.concat(this.ppfx,'input-unit">').concat(n.join(""),"</select>"),this.unitEl=o.firstChild}}return this.unitEl},e.prototype.upArrowClick=function(){var t=this.model.get("step"),e=parseFloat(this.getInputEl().value);this.setValue(this.normalizeValue(e+t)),this.elementUpdated()},e.prototype.downArrowClick=function(){var t=this.model.get("step"),e=parseFloat(this.getInputEl().value);this.setValue(this.normalizeValue(e-t)),this.elementUpdated()},e.prototype.downIncrement=function(t){t.preventDefault(),this.moved=!1;var e=this.model.get("value")||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,t3.on)(this.doc,"mousemove",this.moveIncrement),(0,t3.on)(this.doc,"mouseup",this.upIncrement)},e.prototype.moveIncrement=function(t){this.moved=!0;var e=this.model,n=e.get("step"),o=this.current,r=this.normalizeValue(o.val+(o.y-t.pageY)*n),i=this.validateInputValue(r),a=i.value,s=i.unit;return this.prValue=a,e.set({value:a,unit:s},{avoidStore:1}),!1},e.prototype.upIncrement=function(){var t=this.model,e=t.get("step");if((0,t3.AU)(this.doc,"mouseup",this.upIncrement),(0,t3.AU)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()}},e.prototype.normalizeValue=function(t,e){void 0===e&&(e=0);var n=this.model.get("step"),o=0;if(isNaN(t))return e;if(Math.floor(t=parseFloat(t))!==t){var r=n.toString().split(".")[1];o=r?r.length:0}return o?parseFloat(t.toFixed(o)):t},e.prototype.validateInputValue=function(t,e){void 0===e&&(e={});var n=0,o=e||{},r=this.model,i=(0,tw.isUndefined)(t)?"":t,a=e.units||r.get("units")||[],s=r.get("unit")||a.length&&a[0]||"",l=(0,tw.isUndefined)(e.max)?r.get("max"):e.max,c=(0,tw.isUndefined)(e.min)?r.get("min"):e.min,u=!!r.get("limitlessMax"),p=!!r.get("limitlessMin");if(o.deepCheck){var d=r.get("fixedValues")||[];if(""===i&&(s=""),i){var f=RegExp("^"+d.join("|"),"g");if(d.length&&f.test(i))i=i.match(f)[0],s="",n=1;else{var h=i+"";i+="",i=isNaN(i=parseFloat(i.replace(",",".")))?"":i;var g=h.replace(i,"");(0,tw.indexOf)(a,g)>=0&&(s=g)}}}return isNaN(i)||""===i||(u||(0,tw.isUndefined)(l)||""===l||(i=i>l?l:i),p||(0,tw.isUndefined)(c)||""===c||(i=i<c?c:i)),{force:n,value:i,unit:s}},e.prototype.render=function(){sl.prototype.render.call(this),this.unitEl=null;var t=this.getUnitEl();return t&&this.$el.find(".".concat(this.ppfx,"field-units")).get(0).appendChild(t),this},e}(sl);sv.prototype.events={"change input":"handleChange","change select":"handleUnitChange","click [data-arrow-up]":"upArrowClick","click [data-arrow-down]":"downArrowClick","mousedown [data-arrows]":"downIncrement",keydown:"handleKeyDown"};var sy=(pr=function(t,e){return(pr=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sm=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return sy(e,t),e.prototype.getValueForTarget=function(){var t=this.model,e=t.attributes,n=e.value,o=e.unit;return(0,tw.isUndefined)(n)||""===n?t.get("default"):n+o},e.prototype.getInputEl=function(){if(!this.input){var t=this.ppfx,e=this.model,n=this.getModelValue(),o=new sv({contClass:"".concat(t,"field-int"),type:"number",model:e,ppfx:t});o.render(),this.$input=o.inputEl,this.$unit=o.unitEl,e.set("value",n,{fromTarget:!0}),this.$input.val(n),this.input=o.el}return this.input},e}(sn),sb=(pi=function(t,e){return(pi=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pi(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sw=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.listenTo(n.model,"change:options",n.rerender),n}return sb(e,t),e.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return'<div class="'.concat(e,'">\n <div data-input></div>\n <div class="').concat(t,'sel-arrow">\n <div class="').concat(t,'d-s-arrow"></div>\n </div>\n </div>')},e.prototype.getInputEl=function(){if(!this.$input){var t=this.model,e=this.em,n=t.get("name"),o=t.get("options")||[],r=[],i="<select>";o.forEach(function(t){var o,a,s,l="";(0,tw.isString)(t)?(o=t,a=t):(o=t.name||t.label||t.value,a="".concat((0,tw.isUndefined)(t.value)?t.id:t.value).replace(/"/g,"&quot;"),l+=(s=t.style?t.style.replace(/"/g,"&quot;"):"")?' style="'.concat(s,'"'):"");var c=e.t("traitManager.traits.options.".concat(n,".").concat(a))||o;i+='<option value="'.concat(a,'"').concat(l,">").concat(c,"</option>"),r.push(a)}),i+="</select>",this.$input=(0,tO.default)(i);var a=t.getTargetValue(),s=r.indexOf(a)>=0?a:t.get("default");(0,tw.isUndefined)(s)||this.$input.val(s)}return this.$input.get(0)},e}(sn),s_=tm(8242),sC=(pa=function(t,e){return(pa=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pa(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sx="data-categories",sS="data-no-categories",sO=function(t){function e(e,n){var o=t.call(this,e)||this;o.reuseView=!0,o.renderedCategories=new Map,o.itemsView=n;var r=e.config||{};o.config=r;var i=e.editor;o.em=i;var a=r.pStylePrefix||"";return o.ppfx=a,o.pfx=a+r.stylePrefix||"",o.className="".concat(o.pfx,"traits"),o.traitContClass="".concat(a,"traits-c"),o.classNoCat="".concat(a,"traits-empty-c"),o.catsClass="".concat(a,"trait-categories"),o.collection=new nS([],{em:i}),o.listenTo(i,"component:toggled",o.updatedCollection),o.updatedCollection(),o}return sC(e,t),e.prototype.updatedCollection=function(){var t=this.ppfx,e=this.em,n=e.getSelected();this.el.className="".concat(this.traitContClass,"s ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=(null==n?void 0:n.traits)||new nS([],{em:e}),this.render()},e.prototype.add=function(t,e){var n=this.config,o=this.renderedCategories,r=this.itemView,i=t.get(this.itemType);this.itemsView&&this.itemsView[i]&&(r=this.itemsView[i]);var a=new r({config:n,model:t,attributes:t.get("attributes")}).render().el,s=t.parent.initCategory(t);if(s){var l=s.getId(),c=this.getCategoriesEl(),u=o.get(l);!u&&c&&(u=new at({model:s},n,"trait").render(),o.set(l,u),c.appendChild(u.el)),null==u||u.append(a);return}e?e.appendChild(a):this.append(a)},e.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector("[".concat(sx,"]"))),this.catsEl},e.prototype.getTraitsEl=function(){return this.traitsEl||(this.traitsEl=this.el.querySelector("[".concat(sS,"]"))),this.traitsEl},e.prototype.append=function(t){var e=this.getTraitsEl();null==e||e.appendChild(t)},e.prototype.render=function(){var t=this,e=this.el,n=this.ppfx,o=this.catsClass,r=this.traitContClass,i=this.classNoCat,a=document.createDocumentFragment();delete this.catsEl,delete this.traitsEl,this.renderedCategories=new Map,e.innerHTML='\n <div class="'.concat(o,'" ').concat(sx,'></div>\n <div class="').concat(i," ").concat(r,'" ').concat(sS,"></div>\n "),this.collection.forEach(function(e){return t.add(e,a)}),this.append(a);var s="".concat(r,"s ").concat(n,"one-bg ").concat(n,"two-color");return this.$el.addClass(s),this.rendered=!0,this},e}(s_.A);sO.prototype.itemView=sn;var sT=(ps=function(t,e){return(ps=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ps(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sP=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},sE=function(t){function e(e){var n=t.call(this,e,"TraitManager",{stylePrefix:"trt-",appendTo:"",optionsTarget:[{value:!1},{value:"_blank"}],custom:!1})||this;n.TraitsView=sO,n.events=pQ,n.state=new tT.Kx({traits:[]}),n.types={text:sn,number:sm,select:sw,checkbox:sa,color:sh,button:sr};var o=n.state,r=n.config,i=n.events,a=r.pStylePrefix;a&&(r.stylePrefix="".concat(a).concat(r.stylePrefix)),(0,tw.bindAll)(n,"__onSelect");var s=(0,tw.debounce)(function(){return n.__upSel()},0),l=(0,tw.debounce)(function(){return n.__onUp()},0);return o.listenTo(e,"component:toggled",s),o.listenTo(e,i.value,l),o.on("change:traits",n.__onSelect),n.debounced=[s,l],n}return sT(e,t),e.prototype.select=function(t){var e=(null==t?void 0:t.getTraits())||[];this.state.set({component:t,traits:e}),this.__trgCustom()},e.prototype.getCategories=function(){var t,e=this.getComponent();return sP([],(null===(t=null==e?void 0:e.traits.categories)||void 0===t?void 0:t.models)||[],!0)},e.prototype.getTraits=function(){return this.getCurrent()},e.prototype.getTraitsByCategory=function(t){return nd(t||this.getTraits())},e.prototype.getComponent=function(){return this.state.attributes.component},e.prototype.addType=function(t,e){var n=this.getType("text");this.types[t]=n.extend(e)},e.prototype.getType=function(t){return this.getTypes()[t]},e.prototype.getTypes=function(){return this.types},e.prototype.getTraitsViewer=function(){return this.view},e.prototype.getCurrent=function(){return this.state.get("traits")||[]},e.prototype.render=function(){var t=this.view,e=this.em;return t=new sO({el:null==t?void 0:t.el,collection:[],editor:e,config:this.getConfig()},this.getTypes()),this.view=t,t.el},e.prototype.postRender=function(){this.__appendTo()},e.prototype.__onSelect=function(){var t=this.em,e=this.events,n=this.state.attributes,o=n.component,r=n.traits;t.trigger(e.select,{component:o,traits:r})},e.prototype.__trgCustom=function(t){void 0===t&&(t={});var e=this.em,n=this.events,o=this.__ctn;this.__ctn=o||t.container,e.trigger(n.custom,this.__customData())},e.prototype.__customData=function(){return{container:this.__ctn}},e.prototype.__upSel=function(){this.select(this.em.getSelected())},e.prototype.__onUp=function(){this.select(this.getComponent())},e}(tD);(pl=dn||(dn={})).root="layer:root",pl.component="layer:component",pl.custom="layer:custom";var sk=tm(6756),sA=(pc=function(t,e){return(pc=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pc(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sj=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._dropAreaConfig={ratio:.4,minUndroppableDimension:3,maxUndroppableDimension:20},e}return sA(e,t),Object.defineProperty(e.prototype,"view",{get:function(){return this.model.viewLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){var t;return null===(t=this.model.viewLayer)||void 0===t?void 0:t.el},enumerable:!1,configurable:!0}),e}(sk.h),sM=(pu=function(t,e){return(pu=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pu(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sD=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.items=[],n.opt=e;var o=e.config||{};n.config=o,n.module=e.module,n.parentView=e.parentView;var r=o.stylePrefix||"";o.pStylePrefix;var i=n.collection;n.listenTo(i,"add",n.addTo),n.listenTo(i,"reset resetNavigator",n.render),n.listenTo(i,"remove",n.removeChildren),n.className="".concat(r,"layers");var a=o.em;if(o.sortable&&!n.opt.sorter){var s=a.Utils,l=o.sortContainer||n.el,c=n.createPlaceholder(r);n.opt.sorter=new s.ComponentSorter({em:a,treeClass:sj,containerContext:{container:l,containerSel:".".concat(n.className),itemSel:".".concat(r,"layer"),pfx:o.pStylePrefix,document:document,placeholderElement:c},dragBehavior:{dragDirection:n0.A.Vertical,nested:!0}})}return n.$el.data("collection",i),e.parent&&n.$el.data("model",e.parent),n}return sM(e,t),e.prototype.createPlaceholder=function(t){var e=document.createElement("div"),n=document.createElement("div");return this.el.parentNode,e.className=t+"placeholder",e.style.display="none",e.style.pointerEvents="none",n.className=t+"placeholder-int",e.appendChild(n),e},e.prototype.removeChildren=function(t){var e=t.viewLayer;e&&(e.remove(),delete t.viewLayer)},e.prototype.addTo=function(t){this.addToCollection(t,null,this.collection.indexOf(t))},e.prototype.addToCollection=function(t,e,n){var o=this.parentView,r=this.opt,i=this.config,a=this.el,s=r.ItemView,l=r.opened,c=r.module,u=r.level,p=r.sorter,d=t.viewLayer||new s({ItemView:s,level:u,model:t,parentView:o,config:i,sorter:p,opened:l,module:c}),f=d.render().el;if(e)e.appendChild(f);else{var h=a.childNodes;if((0,tw.isUndefined)(n))a.appendChild(f);else{var g=h.length==n;g&&n--,g||!h.length?a.appendChild(f):a.insertBefore(f,h[n])}}return this.items.push(d),f},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return tT.Ss.prototype.remove.apply(this,t),this.items.map(function(t){return t.remove()}),this},e.prototype.render=function(){var t=this,e=this.el,n=this.module,o=document.createDocumentFragment();return e.innerHTML="",this.collection.map(function(t){return n.__getLayerFromComponent(t)}).forEach(function(e){return t.addToCollection(e,o)}),e.appendChild(o),e.className=this.className,this},e}(tT.Ss),sL=tm(9946),sI=tm(1738),sN=(pp=function(t,e){return(pp=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pp(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sR=function(){return(sR=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},sV=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},sF=[["preview","Preview","preview"],["resize","Resize","resize"],["fullscreen","Fullscreen","fullscreen"],["copy","CopyComponent"],["paste","PasteComponent"],["canvas-move","CanvasMove"],["canvas-clear","CanvasClear"],["open-code","ExportTemplate","export-template"],["open-layers","OpenLayers","open-layers"],["open-styles","OpenStyleManager","open-sm"],["open-traits","OpenTraitManager","open-tm"],["open-blocks","OpenBlocks","open-blocks"],["open-assets","OpenAssets","open-assets"],["component-select","SelectComponent","select-comp"],["component-outline","SwitchVisibility","sw-visibility"],["component-offset","ShowOffset","show-offset"],["component-move","MoveComponent","move-comp"],["component-next","ComponentNext"],["component-prev","ComponentPrev"],["component-enter","ComponentEnter"],["component-exit","ComponentExit","select-parent"],["component-delete","ComponentDelete"],["component-style-clear","ComponentStyleClear"],["component-drag","ComponentDrag"]],sH={preserveSelected:1},sU=function(t){return function(e){return t.trigger("".concat(nV,":start"),e)}},sB=function(t){return function(e){return t.trigger(nV,e)}},sz=function(t,e,n){return void 0===n&&(n={}),function(o,r,i){setTimeout(function(){e.forEach(function(t){return t.set("status",t.get("selectable")?"selected":"")}),t.setSelected(e),e[0].emitUpdate()}),t.trigger("".concat(nV,":end"),i),setTimeout(function(){return t.runDefault(sH)}),(n.altMode||i.cancelled)&&t.set("_cmpDrag",1)}},sW=function(t){function e(e){var n=t.call(this,e,"Commands",{stylePrefix:"com-",defaults:{},strict:!0,defaultOptions:{}})||this;n.CommandAbstract=sL.default,n.defaultCommands={},n.commands={},n.active={},n.events=sI.A;var o=n.config,r=o.pStylePrefix,i=n.defaultCommands;for(var a in r&&(o.stylePrefix=r+o.stylePrefix),Object.keys(o.defaults).forEach(function(t){var e=o.defaults[t];e.id&&n.add(e.id,e)}),i["tlb-delete"]={run:function(t){return t.runCommand("core:component-delete")}},i["tlb-clone"]={run:function(t){t.runCommand("core:copy"),t.runCommand("core:paste",{action:"clone-component"})}},i["tlb-move"]={run:function(t,e,n){void 0===n&&(n={});var o,r,i=t.getModel(),a=n.event,s=n.target,l=(Array.isArray(s)?s:s?[s]:sV([],t.getSelectedAll(),!0)).map(function(t){var e,n;return(null===(n=null===(e=t.delegate)||void 0===e?void 0:e.move)||void 0===n?void 0:n.call(e,t))||t}).filter(Boolean),c=l[l.length-1],u=(null==a?void 0:a.type)==="dragstart";if(!(null==c?void 0:c.get("draggable")))return i.logWarning("The element is not draggable");var p=n.mode||c.get("dmode")||i.get("dmode"),d=function(){return i.stopDefault(sH)},f=(0,tw.includes)(["absolute","translate"],p);l.forEach(function(t){return t.trigger("disable",{fromMove:!0})}),u?setTimeout(d,0):d();var h=sU(i),g=sB(i),v=sz(i,l,{altMode:f});if(f)t.runCommand("core:component-drag",{guidesInfo:1,mode:p,target:c,onStart:h,onDrag:g,onEnd:v,event:a});else{u&&(null===(o=null==a?void 0:a.dataTransfer)||void 0===o||o.setDragImage(null===(r=c.view)||void 0===r?void 0:r.el,0,0));var y=t.Commands.get("move-comp");y.onStart=h,y.onDrag=g,y.onEndMoveFromModel=v,y.initSorterFromModels(l)}l.filter(function(t){return t.get("selectable")}).forEach(function(t){return t.set("status","freezed-selected")})}},i["core:undo"]=function(t){return t.UndoManager.undo()},i["core:redo"]=function(t){return t.UndoManager.redo()},sF.forEach(function(t){var n=t[2],o=tm(585)("./".concat(t[1])).default,r="core:".concat(t[0]);i[r]=o,n&&(i[n]=o,["run","stop"].forEach(function(t){e.on("".concat(t,":").concat(n),function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.trigger.apply(e,sV(["".concat(t,":").concat(r)],n,!1))})}))}),o.model=e.Canvas,i)n.add(a,i[a]);return n}return sN(e,t),e.prototype.add=function(t,e){var n=(0,tw.isFunction)(e)?{run:e}:e;return n.stop||(n.noStop=!0),delete n.initialize,n.id=t,this.commands[t]=sL.default.extend(n),this},e.prototype.get=function(t){var e=this.commands[t];return(0,tw.isFunction)(e)?(e=new e(this.config),this.commands[t]=e):e||this.em.logWarning("'".concat(t,"' command not found")),e},e.prototype.extend=function(t,e){void 0===e&&(e={});var n=this.get(t);if(n){var o=sR(sR({},n.constructor.prototype),e);this.add(t,o);var r=sF.filter(function(e){return"core:".concat(e[0])===t&&e[2]})[0];r&&this.add(r[2],o)}return this},e.prototype.has=function(t){return!!this.commands[t]},e.prototype.getAll=function(){return this.commands},e.prototype.run=function(t,e){return void 0===e&&(e={}),this.runCommand(this.get(t),e)},e.prototype.stop=function(t,e){return void 0===e&&(e={}),this.stopCommand(this.get(t),e)},e.prototype.isActive=function(t){return this.getActive().hasOwnProperty(t)},e.prototype.getActive=function(){return this.active},e.prototype.runCommand=function(t,e){if(void 0===e&&(e={}),null==t?void 0:t.run){var n,o,r,i=this.em,a=this.config,s=t.id,l=i.Editor;if(!this.isActive(s)||e.force||!a.strict){var c=null===(o=null===(n=a.defaultOptions)||void 0===n?void 0:n[s])||void 0===o?void 0:o.run;(0,tw.isFunction)(c)&&(e=c(e)),r=l&&t.callRun(l,e)}}return r},e.prototype.stopCommand=function(t,e){if(void 0===e&&(e={}),null==t?void 0:t.run){var n,o,r,i=this.em,a=this.config,s=t.id,l=i.Editor;if(this.isActive(s)||e.force||!a.strict){var c=null===(o=null===(n=a.defaultOptions)||void 0===n?void 0:n[s])||void 0===o?void 0:o.stop;(0,tw.isFunction)(c)&&(e=c(e)),r=t.callStop(l,e)}}return r},e.prototype.create=function(t){return t.stop||(t.noStop=!0),new(sL.default.extend(t))(this.config)},e.prototype.__onRun=function(t,e){var n=this.em,o=this.events;n.on("".concat(o.runCommand).concat(t),e)},e.prototype.__onStop=function(t,e){var n=this.em,o=this.events;n.on("".concat(o.stopCommand).concat(t),e)},e.prototype.destroy=function(){this.defaultCommands={},this.commands={},this.active={}},e}(tD),s$=(pd=function(t,e){return(pd=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pd(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sq=function(){return(sq=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},sG="contentEditable",sK="data-toggle-move",sY=function(t){function e(e){var n=t.call(this,e)||this;(0,tw.bindAll)(n,"__render"),n.opt=e,n.module=e.module,n.config=e.config||{},n.sorter=e.sorter||"",n.parentView=e.parentView;var o=n.model,r=n.pfx,i=n.ppfx,a=o.get("type")||"default";return n.className="".concat(r,"layer ").concat(r,"layer__t-").concat(a," no-select ").concat(i,"two-color"),n.inputNameCls="".concat(i,"layer-name"),n.clsTitleC="".concat(r,"layer-title-c"),n.clsTitle="".concat(r,"layer-title"),n.clsCaret="".concat(r,"layer-caret"),n.clsCount="".concat(r,"layer-count"),n.clsMove="".concat(r,"layer-move"),n.clsChildren="".concat(r,"layer-children"),n.clsNoChild="".concat(r,"layer-no-chld"),n.clsEdit="".concat(n.inputNameCls,"--edit"),n.clsNoEdit="".concat(n.inputNameCls,"--no-edit"),n.initComponent(),n}return s$(e,t),e.prototype.events=function(){var t;return(t={})["mousedown [".concat(sK,"]")]="startSort",t["touchstart [".concat(sK,"]")]="startSort",t["click [data-toggle-visible]"]="toggleVisibility",t["click [data-toggle-open]"]="toggleOpening",t["click [data-toggle-select]"]="handleSelect",t["mouseover [data-toggle-select]"]="handleHover",t["mouseout [data-toggle-select]"]="handleHoverOut",t["dblclick [data-name]"]="handleEdit",t["keydown [data-name]"]="handleEditKey",t["focusout [data-name]"]="handleEditEnd",t},e.prototype.template=function(t){var e=this.pfx,n=this.ppfx,o=this.config,r=this.clsNoEdit,i=this.module,a=this.opt,s=this.em,l=o.hidable,c=i.getComponents(t).length,u=c?"":this.clsNoChild,p="".concat(this.clsTitle," ").concat(u),d="".concat(this.clsTitleC),f="".concat(this.inputNameCls," ").concat(r," ").concat(n,"no-app"),h=a.level||0,g=t.getName(),v=t.getIcon(),y="".concat(e,"layer"),m=(null==s?void 0:s.getConfig()).icons,b=m.move,w=m.eye,_=m.eyeOff,C=m.chevron;return'\n <div class="'.concat(e,"layer-item ").concat(n,'one-bg" data-toggle-select>\n <div class="').concat(e,'layer-item-left">\n ').concat(l?'<i class="'.concat(e,'layer-vis" data-toggle-visible>\n <i class="').concat(e,'layer-vis-on">').concat(w,'</i>\n <i class="').concat(e,'layer-vis-off">').concat(_,"</i>\n </i>"):"",'\n <div class="').concat(d,'">\n <div class="').concat(p,'" style="padding-left: ').concat("".concat(10*h,"px"),'">\n <div class="').concat(e,'layer-title-inn" title="').concat(g,'">\n <i class="').concat(this.clsCaret,'" data-toggle-open>').concat(C,"</i>\n ").concat(v?'<span class="'.concat(y,'__icon">').concat(v,"</span>"):"",'\n <span class="').concat(f,'" data-name>').concat(g,'</span>\n </div>\n </div>\n </div>\n </div>\n <div class="').concat(e,'layer-item-right">\n <div class="').concat(this.clsCount,'" data-count>').concat(c||"",'</div>\n <div class="').concat(this.clsMove,'" ').concat(sK,">").concat(b||"",'</div>\n </div>\n </div>\n <div class="').concat(this.clsChildren,'"></div>\n ')},Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),e.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,o=e.components();this.listenTo(o,"remove add reset",this.checkChildren),[["change:status",this.updateStatus],["change:open",this.updateOpening],["change:layerable",this.updateLayerable],["change:style:display",this.updateVisibility],["change:draggable",this.updateMove],["rerender:layer",this.render],["change:name change:custom-name",this.updateName]].forEach(function(n){return t.listenTo(e,n[0],n[1])}),this.$el.data("model",e),this.$el.data("collection",o),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},e.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},e.prototype.getVisibilityEl=function(){return this.getItemContainer().find("[data-toggle-visible]")},e.prototype.updateVisibility=function(){var t=this.pfx,e=this.model,n=this.module.isVisible(e)?"removeClass":"addClass";this.$el[n]("".concat(t,"layer-hidden")),this.getVisibilityEl()[n]("".concat(t,"layer-off"))},e.prototype.updateMove=function(){var t=this.model,e=this.config,n=this.getItemContainer().find("[".concat(sK,"]"))[0];if(n){var o=t.get("draggable")&&e.sortable;n.style.display=o?"":"none"}},e.prototype.toggleVisibility=function(t){null==t||t.stopImmediatePropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},e.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this.em,n=this.$el,o=this.clsNoEdit,r=this.clsEdit,i=this.getInputName();i[sG]="true",i.focus(),document.execCommand("selectAll",!1),e.setEditing(!0),n.find(".".concat(this.inputNameCls)).removeClass(o).addClass(r)},e.prototype.handleEditKey=function(t){t.stopPropagation(),((0,t3.v$)(t)||(0,t3.Ci)(t))&&this.handleEditEnd(t)},e.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this.em,n=this.$el,o=this.clsNoEdit,r=this.clsEdit,i=this.model,a=this.getInputName(),s=a.textContent;a.scrollLeft=0,a[sG]="false",i.setName(s),e.setEditing(!1),n.find(".".concat(this.inputNameCls)).addClass(o).removeClass(r),this.updateName()},e.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},e.prototype.updateOpening=function(){var t=this.$el,e=this.model,n=this.pfx,o="open",r="".concat(n,"layer-open"),i=this.getCaret();this.module.isOpen(e)?(t.addClass(o),i.addClass(r)):(t.removeClass(o),i.removeClass(r))},e.prototype.toggleOpening=function(t){var e=this.model,n=this.module;null==t||t.stopImmediatePropagation(),e.get("components").length&&n.setOpen(e,!n.isOpen(e))},e.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},e.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},e.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},e.prototype.startSort=function(t){t.stopPropagation();var e,n,o,r=this.em,i=this.sorter,a=this.model;if((!t.button||0===t.button)&&i){var s=(null===(n=null===(e=a.delegate)||void 0===e?void 0:e.move)||void 0===n?void 0:n.call(e,a))||a;i.eventHandlers=sq({legacyOnStartSort:sU(r),legacyOnMoveClb:sB(r),legacyOnEndMove:sz(r,[s])},i.eventHandlers);var l=(null===(o=s.viewLayer)||void 0===o?void 0:o.el)||t.target;i.startSort([{element:l}])}},e.prototype.updateStatus=function(){oW.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},e.prototype.getItemContainer=function(){return this.$el.children("[data-toggle-select]")},e.prototype.checkChildren=function(){var t=this.model,e=this.clsNoChild,n=this.module,o=n.getComponents(t).length,r=this.getItemContainer(),i=r.find(".".concat(this.clsTitle)),a=r.find("[data-count]");i[o?"removeClass":"addClass"](e),a.html("".concat(o||"")),o||n.setOpen(t,!1)},e.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.getItemContainer().find(".".concat(this.clsCaret))),this.caret},e.prototype.setRoot=function(t){var e,n=(0,tw.isString)(t)?null===(e=this.em.getWrapper())||void 0===e?void 0:e.find(t)[0]:t;n&&(this.stopListening(),this.model=n,this.initComponent(),this._rendered&&this.render())},e.prototype.updateLayerable=function(){(this.parentView||this).render()},e.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return tT.Ss.prototype.remove.apply(this,t),delete this.model.viewLayer,this.__clearItems(),this},e.prototype.render=function(){var t=this.model,e=this.config,n=this.pfx,o=this.ppfx,r=this.opt,i=this.sorter;this.__clearItems();var a=r.opened,s=r.module,l=r.ItemView,c=!s.__isLayerable(t),u=this.$el.empty(),p=r.level+1;delete this.inputName,this.items=new sD({ItemView:l,collection:t.get("components"),config:e,sorter:i,opened:a,parentView:this,parent:t,level:p,module:s});var d=this.items.render().$el;return e.showWrapper||1!==p?(u.html(this.template(t)),u.find(".".concat(this.clsChildren)).append(d)):u.append(d),s.isVisible(t)||(this.className+=" ".concat(n,"hide")),c&&(this.className+=" ".concat(o,"hidden")),u.attr("class",this.className),this.updateStatus(),this.updateOpening(),this.updateVisibility(),this.updateMove(),this.__render(),this._rendered=!0,this},e.prototype.__render=function(){var t=this.model,e=this.config,n=this.el,o=e.onRender,r={component:t,el:n};o.bind(this)(r),this.em.trigger("layer:render",r)},e}(tT.Ss),sJ=(pf=function(t,e){return(pf=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),sX=function(){return(sX=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},sZ={mediaText:""},sQ=["open","status","locked","custom-name","components","classes"].map(function(t){return"".concat(tQ.I.update,":").concat(t)}).join(" "),s0=function(t){function e(e){var n=t.call(this,e,"LayerManager",{stylePrefix:"",appendTo:"",sortable:!0,hidable:!0,hideTextnode:!0,root:"",showWrapper:!0,showHover:!0,scrollCanvas:{behavior:"smooth",block:"nearest"},scrollLayers:{behavior:"auto",block:"nearest"},highlightHover:!0,custom:!1,onInit:function(){},onRender:function(){},extend:{}})||this;return n.events=dn,(0,tw.bindAll)(n,"componentChanged","__onRootChange","__onComponent"),n.model=new tI.A(n,{opened:{}}),n.config.stylePrefix=n.config.pStylePrefix,n}return sJ(e,t),e.prototype.onLoad=function(){var t=this,e=this.em,n=this.config,o=this.model;o.listenTo(e,"component:selected",this.componentChanged),o.on("change:root",this.__onRootChange),o.listenTo(e,sQ,this.__onComponent),this.componentChanged(),o.listenToOnce(e,"load",function(){t.setRoot(n.root),t.__appendTo()})},e.prototype.setRoot=function(t){var e=this.em.getWrapper(),n=(0,t_.isComponent)(t)?t:e;t&&(0,tw.isString)(t)&&(0,t_.hasWin)()&&(n=e.find(t)[0]||e);var o=this.__getLayerFromComponent(n);return this.model.set("root",o),o},e.prototype.getRoot=function(){return this.model.get("root")},e.prototype.getComponents=function(t){var e=this;return t.components().map(function(t){return e.__getLayerFromComponent(t)}).filter(function(t){return e.__isLayerable(t)})},e.prototype.setOpen=function(t,e){t.set("open",e)},e.prototype.isOpen=function(t){return!!t.get("open")},e.prototype.setVisible=function(t,e){var n="__prev-display",o=t.getStyle(sZ),r=o.display;if(e){var i=t.get(n);delete o.display,i&&(o.display=i,t.unset(n))}else r&&t.set(n,r),o.display="none";t.setStyle(o,sZ),this.updateLayer(t),this.em.trigger("component:toggled")},e.prototype.isVisible=function(t){var e;return void 0===(e=t.getStyle(sZ))&&(e={}),0!==(e.display||"").trim().indexOf("none")},e.prototype.setLocked=function(t,e){t.set("locked",e)},e.prototype.isLocked=function(t){return!!t.get("locked")},e.prototype.setName=function(t,e){t.set("custom-name",e)},e.prototype.getName=function(t){return t.getName()},e.prototype.getLayerData=function(t){var e=t.get("status");return{name:t.getName(),open:this.isOpen(t),selected:"selected"===e,hovered:"hovered"===e,visible:this.isVisible(t),locked:this.isLocked(t),components:this.getComponents(t)}},e.prototype.setLayerData=function(t,e,n){void 0===n&&(n={});var o,r=this.em,i=this.config,a=e.open,s=e.selected,l=e.hovered,c=e.visible,u=e.locked,p=e.name,d=sX({fromLayers:!0},n);if((0,t_.isDef)(a)&&this.setOpen(t,a),(0,t_.isDef)(s)){if(s){r.setSelected(t,d);var f=i.scrollCanvas;f&&(null===(o=t.views)||void 0===o||o.forEach(function(t){return t.scrollIntoView(f)}))}else r.removeSelected(t,d)}(0,t_.isDef)(l)&&i.showHover&&(l?r.setHovered(t,d):r.setHovered(null,d)),(0,t_.isDef)(c)&&c!==this.isVisible(t)&&this.setVisible(t,c),(0,t_.isDef)(u)&&this.setLocked(t,u),(0,t_.isDef)(p)&&this.setName(t,p)},e.prototype.componentChanged=function(t,e){if(void 0===e&&(e={}),!e.fromLayers){var n,o=this.em,r=this.config.scrollLayers,i=this.model.get("opened"),a=o.getSelected(),s=null==a?void 0:a.parent();for(var l in i)i[l].set("open",!1),delete i[l];for(;s;)s.set("open",!0),i[s.cid]=s,s=s.parent();if(a&&r){var c=null===(n=a.viewLayer)||void 0===n?void 0:n.el;null==c||c.scrollIntoView(r)}}},e.prototype.getAll=function(){return this.view},e.prototype.render=function(){var t,e,n=this.config,o=this.model,r=sY.extend(n.extend);return this.view=new r({el:null===(t=this.view)||void 0===t?void 0:t.el,ItemView:r,level:0,config:n,opened:o.get("opened"),model:this.getRoot(),module:this}),null===(e=this.view)||void 0===e?void 0:e.render().el},e.prototype.destroy=function(){var t;null===(t=this.view)||void 0===t||t.remove()},e.prototype.__onRootChange=function(){var t,e=this.em,n=this.events,o=this.getRoot();null===(t=this.view)||void 0===t||t.setRoot(o),e.trigger(n.root,o),this.__trgCustom()},e.prototype.__getLayerFromComponent=function(t){var e,n;return(null===(n=null===(e=t.delegate)||void 0===e?void 0:e.layer)||void 0===n?void 0:n.call(e,t))||t},e.prototype.__onComponent=function(t){this.updateLayer(t)},e.prototype.__isLayerable=function(t){var e=t.tagName;return(!this.config.hideTextnode||!t.isInstanceOf("textnode")&&"br"!==e)&&t.get("layerable")},e.prototype.__trgCustom=function(t){var e=this.__ctn,n=this.em,o=this.events;this.__ctn=e||(null==t?void 0:t.container),n.trigger(o.custom,{container:this.__ctn,root:this.getRoot()})},e.prototype.updateLayer=function(t,e){var n=this.em,o=this.events;n.trigger(o.component,t,e)},e}(tD),s1=(ph=function(t,e){return(ph=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ph(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s1(e,t),e.getDefaults=function(){return(0,tw.result)(this.prototype,"defaults")},e.prototype.defaults=function(){return{type:"",src:""}},e.prototype.getType=function(){return this.get("type")},e.prototype.getSrc=function(){return this.get("src")||""},e.prototype.getFilename=function(){return this.getSrc().split("/").pop().split("?").shift()},e.prototype.getExtension=function(){return this.getFilename().split(".").pop()},e}(tT.Kx);s2.prototype.idAttribute="src";var s5=(pg=function(t,e){return(pg=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pg(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s3=function(){return(s3=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s4=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s5(e,t),e.prototype.defaults=function(){return s3(s3({},s2.getDefaults()),{type:"image",unitDim:"px",height:0,width:0})},e}(s2),s6=(pv=function(t,e){return(pv=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pv(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s7=function(t){function e(e){var n=t.call(this,e)||this;n.options=e,n.collection=e.collection;var o=e.config||{};n.config=o,n.pfx=o.stylePrefix||"",n.ppfx=o.pStylePrefix||"",n.em=o.em,n.className=n.pfx+"asset",n.listenTo(n.model,"destroy remove",n.remove),n.model.view=n;var r=n.init&&n.init.bind(n);return r&&r(e),n}return s6(e,t),e.prototype.__getBhv=function(){var t=this.em,e=null==t?void 0:t.Assets;return(null==e?void 0:e.__getBehaviour())||{}},e.prototype.template=function(t,e){var n=this.pfx;return'\n <div class="'.concat(n,'preview-cont">\n ').concat(this.getPreview(),'\n </div>\n <div class="').concat(n,'meta">\n ').concat(this.getInfo(),'\n </div>\n <div class="').concat(n,'close" data-toggle="asset-remove">\n &Cross;\n </div>\n ')},e.prototype.updateTarget=function(t){t&&t.set&&(t.set("attributes",(0,tw.clone)(t.get("attributes"))),t.set("src",this.model.get("src")))},e.prototype.getPreview=function(){return""},e.prototype.getInfo=function(){return""},e.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},e}(tT.Ss),s9=(py=function(t,e){return(py=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}py(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s8=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},lt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s9(e,t),e.prototype.getPreview=function(){var t=this.pfx,e=this.ppfx,n=this.model.get("src");return tC(dr||(dr=s8(['\n <div class="','preview" style="background-image: url(\'','\');"></div>\n <div class="',"preview-bg ",'checker-bg"></div>\n '],['\n <div class="','preview" style="background-image: url(\'','\');"></div>\n <div class="',"preview-bg ",'checker-bg"></div>\n '])),t,n,t,e)},e.prototype.getInfo=function(){var t=this.pfx,e=this.model,n=e.get("name"),o=e.get("width"),r=e.get("height"),i=e.get("unitDim"),a=o&&r?"".concat(o,"x").concat(r).concat(i):"";return n=n||e.getFilename(),tC(di||(di=s8(['\n <div class="','name">','</div>\n <div class="','dimensions">',"</div>\n "],['\n <div class="','name">','</div>\n <div class="','dimensions">',"</div>\n "])),t,n,t,a)},e.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},e.prototype.onClick=function(){var t=this.model,e=this.pfx,n=this.__getBhv().select,o=this.config.onClick,r=this.collection;r.trigger("deselectAll"),this.$el.addClass(e+"highlight"),(0,tw.isFunction)(n)?n(t,!1):(0,tw.isFunction)(o)?o(t):this.updateTarget(r.target)},e.prototype.onDblClick=function(){var t=this.em,e=this.model,n=this.__getBhv().select,o=this.config.onDblClick,r=this.collection,i=r.target,a=r.onSelect;(0,tw.isFunction)(n)?n(e,!0):(0,tw.isFunction)(o)?o(e):(this.updateTarget(i),null==t||t.Modal.close()),(0,tw.isFunction)(a)&&a(e)},e.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},e}(s7);lt.prototype.events={"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"};var le=function(){return(le=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};let ln={types:[],initialize:function(t,e){var n=this;void 0===e&&(e={});var o=e.em;this.em=o,this.opts=e,this.model=function(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),t&&t.type){var r,i,a,s=n.getBaseType();r=(a=n.getType(t.type))?a.model:s.model,i=a?a.view:s.view}else{var l=n.recognizeType(t);r=(a=l.type).model,i=a.view,t=l.attributes}var c=new r(t,le(le({},e),{em:o}));return c.typeView=i,n.model.prototype=r.prototype,c};var r=this.init&&this.init.bind(this);r&&r()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var o=e[n],r=o.isType(t);if(r="boolean"==typeof r&&r?{type:o.id}:r)return{type:o,attributes:r}}return{type:this.getBaseType(),attributes:t}},getBaseType:function(){var t=this.getTypes();return t[t.length-1]},getTypes:function(){return this.types},getType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var o=e[n];if(o.id===t)return o}},addType:function(t,e){var n=this.getType(t),o=this.getBaseType(),r=n?n.model:o.model,i=n?n.view:o.view,a=e.model,s=e.view,l=e.isType;a=a instanceof tT.Kx||(0,tw.isFunction)(a)?a:r.extend(a||{}),s=s instanceof tT.Ss||(0,tw.isFunction)(s)?s:i.extend(s||{}),!this.extendViewApi||e.model||e.view||(s=s.extend(e)),n?(n.model=a,n.view=s,n.isType=l||n.isType):(e.id=t,e.model=a,e.view=s,e.isType=l||function(e){if(e&&e.type==t)return!0},this.getTypes().unshift(e))}};var lo=(pm=function(t,e){return(pm=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pm(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lo(e,t),e}(tT.pM.extend(ln));lr.prototype.types=[{id:"image",model:s4,view:lt,isType:function(t){return"string"==typeof t?{type:"image",src:t}:t}}],(pb=da||(da={})).add="asset:add",pb.remove="asset:remove",pb.removeBefore="asset:remove:before",pb.update="asset:update",pb.open="asset:open",pb.close="asset:close",pb.uploadStart="asset:upload:start",pb.uploadEnd="asset:upload:end",pb.uploadError="asset:upload:error",pb.uploadResponse="asset:upload:response",pb.custom="asset:custom",pb.all="asset";let li=da;var la=(pw=function(t,e){return(pw=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pw(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ls=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.options=e,n.config=e.config,n.pfx=n.config.stylePrefix||"",n.ppfx=n.config.pStylePrefix||"",n.em=n.config.em;var o=n.collection;return n.listenTo(o,"reset",n.renderAssets),n.listenTo(o,"add",n.addToAsset),n.listenTo(o,"remove",n.removedAsset),n.listenTo(o,"deselectAll",n.deselectAll),n}return la(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,o=t.em,r="";return this.config.showUrlInput&&(r='\n <form class="'.concat(e,'add-asset">\n <div class="').concat(n,"field ").concat(e,'add-field">\n <input placeholder="').concat(null==o?void 0:o.t("assetManager.inputPlh"),'"/>\n </div>\n <button class="').concat(n,'btn-prim">').concat(null==o?void 0:o.t("assetManager.addButton"),'</button>\n <div style="clear:both"></div>\n </form>\n ')),'\n <div class="'.concat(e,'assets-cont">\n <div class="').concat(e,'assets-header">\n ').concat(r,'\n </div>\n <div class="').concat(e,'assets" data-el="assets"></div>\n <div style="clear:both"></div>\n </div>\n ')},e.prototype.handleSubmit=function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),o=this.config.handleAdd;if(n){e.value="";var r=this.getAssetsEl();r&&(r.scrollTop=0),o?o.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},e.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},e.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},e.prototype.removedAsset=function(t){this.collection.length||this.toggleNoAssets()},e.prototype.addToAsset=function(t){1==this.collection.length&&this.toggleNoAssets(!0),this.addAsset(t)},e.prototype.addAsset=function(t,e){void 0===e&&(e=null);var n=e,o=this.collection,r=this.config,i=new t.typeView({model:t,collection:o,config:r}).render().el;if(n)n.appendChild(i);else{var a=this.getAssetsEl();a&&a.insertBefore(i,a.firstChild)}return i},e.prototype.toggleNoAssets=function(t){void 0===t&&(t=!1);var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},e.prototype.deselectAll=function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},e.prototype.renderAssets=function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(!!this.collection.length),this.collection.each(function(n){return t.addAsset(n,e)}),n.append(e)},e.prototype.render=function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this},e}(tT.Ss);ls.prototype.events={submit:"handleSubmit"};var ll=(p_=function(t,e){return(p_=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lc=function(t){function e(n){void 0===n&&(n={});var o=t.call(this,n)||this;o.options=n;var r=n.config||{};o.module=n.module,o.config=r,o.em=o.config.em,o.pfx=r.stylePrefix||"",o.ppfx=r.pStylePrefix||"",o.target=o.options.globalCollection||{},o.uploadId=o.pfx+"uploadFile",o.disabled=void 0!==r.disableUpload?r.disableUpload:!r.upload&&!r.embedAsBase64,o.multiUpload=void 0===r.multiUpload||r.multiUpload;var i=r.uploadFile;return i?o.uploadFile=i.bind(o):!r.upload&&r.embedAsBase64&&(o.uploadFile=e.embedAsBase64),o.delegateEvents(),o}return ll(e,t),e.prototype.template=function(t){var e,n,o=t.pfx,r=t.title,i=t.uploadId,a=t.disabled,s=t.multiUpload;return tC(ds||(e=['\n <form>\n <div id="','title">','</div>\n <input\n data-input\n type="file"\n id="','"\n name="file"\n accept="*/*"\n ',"\n ",'\n />\n <div style="clear:both;"></div>\n </form>\n '],n=['\n <form>\n <div id="','title">','</div>\n <input\n data-input\n type="file"\n id="','"\n name="file"\n accept="*/*"\n ',"\n ",'\n />\n <div style="clear:both;"></div>\n </form>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,ds=e),o,r,i,a?"disabled":"",s?"multiple":"")},e.prototype.events=function(){return{"change [data-input]":"uploadFile"}},e.prototype.onUploadStart=function(){var t=this.module;null==t||t.__propEv(t.events.uploadStart)},e.prototype.onUploadEnd=function(t){var e=this.$el,n=this.module;null==n||n.__propEv(n.events.uploadEnd,t);var o=e.find("input");o&&o.val("")},e.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),null==e||e.__propEv(e.events.uploadError,t)},e.prototype.onUploadResponse=function(t,e){var n,o=this.module,r=this.config,i=this.target;try{n="string"==typeof t?JSON.parse(t):t}catch(e){n=t}null==o||o.__propEv(o.events.uploadResponse,n),r.autoAdd&&i&&i.add(n.data,{at:0}),this.onUploadEnd(t),null==e||e(n)},e.prototype.uploadFile=function(t,e,n){var o,r=this,i=t.dataTransfer?t.dataTransfer.files:null===(o=t.target)||void 0===o?void 0:o.files,a=this.config,s=a.beforeUpload;if(!1!==(s&&s(i))){var l=new FormData,c=a.params,u=a.customFetch,p=a.fetchOptions;for(var d in c)l.append(d,c[d]);if(this.multiUpload)for(var f=0;f<i.length;f++)l.append("".concat(a.uploadName).concat(a.multiUploadSuffix),i[f]);else i.length&&l.append(a.uploadName,i[0]);var h=a.upload,g=a.headers,v="X-Requested-With";if(void 0===g[v]&&(g[v]="XMLHttpRequest"),h){this.onUploadStart();var y={method:"post",credentials:a.credentials||"include",headers:g,body:l},m=(null==p?void 0:p(y))||y;return(u?u(h,m):aX(h,m).then(function(t){return(t.status/200|0)==1?t.text():t.text().then(function(t){return Promise.reject(t)})})).then(function(t){return r.onUploadResponse(t,e)}).catch(function(t){return r.onUploadError(t)})}}},e.prototype.initDrop=function(){var t=this;if(!this.uploadForm){this.uploadForm=this.$el.find("form").get(0);var e=this.uploadForm;"draggable"in e&&(this.uploadForm.ondragover=function(){return e.className=t.pfx+"hover",!1},this.uploadForm.ondragleave=function(){return e.className="",!1},this.uploadForm.ondrop=function(n){e.className="",n.preventDefault(),t.uploadFile(n)})}},e.prototype.initDropzone=function(t){var e=this,n=0,o=this.config,r=t.model,i=t.el,a=r.Editor,s=r.Canvas.getBody(),l=this.ppfx,c="".concat(l,"dropzone-active"),u=function(){i.className=i.className.replace(c,"").trim(),n=0},p=function(){return n||(i.className+=" ".concat(c),n=1),!1},d=function(){return u(),!1},f=function(t){if(u(),t.preventDefault(),t.stopPropagation(),e.uploadFile(t),o.openAssetsOnDrop&&a){var n=a.getSelected();a.runCommand("open-assets",{target:n,onSelect:function(){a.Modal.close(),a.AssetManager.setTarget(null)}})}return!1};t.$el.append('<div class="'.concat("".concat(l,"dropzone"),'">').concat(o.dropzoneContent,"</div>")),u(),"draggable"in i&&[i,s].forEach(function(t){t.ondragover=p,t.ondragleave=d,t.ondrop=f})},e.prototype.render=function(){var t=this.$el,e=this.pfx,n=this.em;return t.html(this.template({title:n&&n.t("assetManager.uploadTitle"),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:e})),this.initDrop(),t.attr("class",e+"file-uploader"),this},e.embedAsBase64=function(t,e){var n=this,o=t.dataTransfer?t.dataTransfer.files:t.target.files,r={data:[]};if(!FileReader){this.onUploadError(Error("Unsupported platform, FileReader is not defined"));return}for(var i=[],a=/^(.+)\/(.+)$/,s=function(t){var e=new Promise(function(e,n){var o=new FileReader;o.addEventListener("load",function(r){var i,s=t.name,l=a.exec(t.type);if("image"===(i=l?l[1]:t.type)){var c={src:o.result,name:s,type:i,height:0,width:0},u=new Image;u.addEventListener("error",function(t){n(t)}),u.addEventListener("load",function(){c.height=u.height,c.width=u.width,e(c)}),u.src=c.src}else i?e({src:o.result,name:s,type:i}):e(o.result)}),o.addEventListener("error",function(t){n(t)}),o.addEventListener("abort",function(t){n("Aborted")}),o.readAsDataURL(t)});i.push(e)},l=0;l<o.length;l++)s(o[l]);return Promise.all(i).then(function(t){r.data=t,n.onUploadResponse(r,e)},function(t){n.onUploadError(t)})},e}(tT.Ss),lu=(pC=function(t,e){return(pC=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pC(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lp=function(){return(lp=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ld=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},lf="open-assets",lh=function(t){function e(e){var n=t.call(this,e,"AssetManager",new lr([],e),li,{assets:[],noAssets:"",stylePrefix:"am-",upload:"",uploadName:"files",headers:{},params:{},credentials:"include",multiUpload:!0,multiUploadSuffix:"[]",autoAdd:!0,customFetch:void 0,uploadFile:void 0,embedAsBase64:!0,handleAdd:void 0,beforeUpload:void 0,showUrlInput:!0,custom:!1,dropzone:!1,openAssetsOnDrop:!0,dropzoneContent:""})||this;n.storageKey="assets",n.Asset=s2,n.Assets=lr,n.events=li;var o=n.all,r=n.config;n.assetsVis=new lr([]);var i=r.pStylePrefix;return i&&(r.stylePrefix="".concat(i).concat(r.stylePrefix)),o.on("add",function(t){return n.getAllVisible().add(t)}),o.on("remove",function(t){return n.getAllVisible().remove(t)}),n.__onAllEvent=(0,tw.debounce)(function(){return n.__trgCustom()},0),n}return lu(e,t),e.prototype.open=function(t){void 0===t&&(t={}),this.em.Commands.run(lf,lp({types:["image"],select:function(){}},t))},e.prototype.close=function(){this.em.Commands.stop(lf)},e.prototype.isOpen=function(){var t=this.em.Commands;return!!(null==t?void 0:t.isActive(lf))},e.prototype.add=function(t,e){return void 0===e&&(e={}),void 0===e.at&&(e.at=0),this.all.add(t,e)},e.prototype.get=function(t){return this.all.where({src:t})[0]||null},e.prototype.getAll=function(){return this.all},e.prototype.getAllVisible=function(){return this.assetsVis},e.prototype.remove=function(t,e){return this.__remove(t,e)},e.prototype.store=function(){return this.getProjectData()},e.prototype.load=function(t){return this.loadProjectData(t)},e.prototype.getContainer=function(){var t;return this.__getBehaviour().container||(null===(t=this.am)||void 0===t?void 0:t.el)},e.prototype.getAssetsEl=function(){var t;return null===(t=this.am)||void 0===t?void 0:t.el.querySelector("[data-el=assets]")},e.prototype.render=function(t){if(!this.getConfig().custom){var e=t||this.getAll().models;if(!this.am){var n=this.__viewParams();n.fu=this.FileUploader(),this.am=new ls(lp({},n)),this.am.render()}return this.assetsVis.reset(e),this.getContainer()}},e.prototype.__viewParams=function(){return{collection:this.assetsVis,globalCollection:this.all,config:this.config,module:this,fu:void 0}},e.prototype.addType=function(t,e){this.getAll().addType(t,e)},e.prototype.getType=function(t){return this.getAll().getType(t)},e.prototype.getTypes=function(){return this.getAll().getTypes()},e.prototype.AssetsView=function(){return this.am},e.prototype.FileUploader=function(){return this.fu||(this.fu=new lc(this.__viewParams())),this.fu},e.prototype.onLoad=function(){var t=this;this.getAll().reset(this.config.assets);var e=this.em,n=this.events;e.Commands.__onRun(lf,function(){return t.__propEv(n.open)}),e.Commands.__onStop(lf,function(){return t.__propEv(n.close)})},e.prototype.postRender=function(t){var e;this.config.dropzone&&(null===(e=this.fu)||void 0===e||e.initDropzone(t))},e.prototype.setTarget=function(t){this.assetsVis.target=t},e.prototype.onSelect=function(t){this.assetsVis.onSelect=t},e.prototype.onClick=function(t){this.config.onClick=t},e.prototype.onDblClick=function(t){this.config.onDblClick=t},e.prototype.__propEv=function(t){for(var e,n,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];(e=this.em).trigger.apply(e,ld([t],o,!1)),(n=this.getAll()).trigger.apply(n,ld([t],o,!1))},e.prototype.__trgCustom=function(){var t=this.__getBehaviour(),e=this.getConfig().custom;(t.container||e.open)&&this.em.trigger(this.events.custom,this.__customData())},e.prototype.__customData=function(){var t=this,e=this.__getBehaviour();return{am:this,open:this.isOpen(),assets:this.getAll().models,types:e.types||[],container:e.container,close:function(){return t.close()},remove:function(e,n){return t.remove(e,n)},select:function(n,o){var r=t.add(n);(0,tw.isFunction)(e.select)&&e.select(r,o)},options:e.options||{}}},e.prototype.__behaviour=function(t){return void 0===t&&(t={}),this._bhv=lp(lp({},this._bhv||{}),t)},e.prototype.__getBehaviour=function(t){return void 0===t&&(t={}),this._bhv||{}},e.prototype.destroy=function(){var t,e;this.all.stopListening(),this.all.reset(),this.assetsVis.stopListening(),this.assetsVis.reset(),null===(t=this.fu)||void 0===t||t.remove(),null===(e=this.am)||void 0===e||e.remove(),this._bhv={}},e}(tL),lg=(px=function(t,e){return(px=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}px(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lg(e,t),e.prototype.defaults=function(){return{name:"",width:null,height:"",widthMedia:null,priority:null}},e.prototype.initialize=function(){var t=this;null===this.get("widthMedia")&&this.set("widthMedia",this.get("width")),null===this.get("width")&&this.set("width",this.get("widthMedia")),this.get("priority")||this.set("priority",parseFloat(this.get("widthMedia"))||0),["width","height","widthMedia"].forEach(function(e){return t.checkUnit(e)})},e.prototype.checkUnit=function(t){var e=this.get(t)||"";(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))},e.prototype.getName=function(){return this.get("name")||this.get("id")},e.prototype.getWidthMedia=function(){return this.get("widthMedia")||""},e}(tT.Kx),ly=(pS=function(t,e){return(pS=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pS(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lm=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ly(e,t),e}(tT.pM);lm.prototype.model=lv;var lb=(pO=function(t,e){return(pO=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pO(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lw=function(t){function e(e){var n=t.call(this,e)||this;return n.config=e.config||{},n.em=n.config.em,n.ppfx=n.config.pStylePrefix||"",n.listenTo(n.em,"change:device",n.updateSelect),n}return lb(e,t),e.prototype.template=function(t){var e,n,o=t.ppfx,r=t.label;return tC(dl||(e=['\n <div class="','device-label">','</div>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select class="','devices"></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n <button style="display:none" class="','add-trasp" data-add-trasp>+</button>\n '],n=['\n <div class="','device-label">','</div>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select class="','devices"></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n <button style="display:none" class="','add-trasp" data-add-trasp>+</button>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,dl=e),o,r,o,o,o,o,o,o,o)},e.prototype.events=function(){return{change:"updateDevice","click [data-add-trasp]":"startAdd"}},e.prototype.startAdd=function(){},e.prototype.updateDevice=function(){var t=this.em;if(t){var e=this.devicesEl;t.set("device",e?e.val():"")}},e.prototype.updateSelect=function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel();e.val(n?n.get("id"):"")}},e.prototype.getOptions=function(){var t=this.collection,e=this.em,n="";return t.forEach(function(t){var o=t.attributes,r=o.name,i=o.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(i))||r;n+='<option value="'.concat(i||r,'">').concat(a,"</option>")}),n},e.prototype.render=function(){var t=this.em,e=this.ppfx,n=this.$el,o=this.el,r=t&&t.t&&t.t("deviceManager.device");return n.html(this.template({ppfx:e,label:r})),this.devicesEl=n.find(".".concat(e,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(t.get("device")),o.className="".concat(e,"devices-c"),this},e}(tT.Ss),l_=(pT=function(t,e){return(pT=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pT(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lC=function(){return(lC=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},lx=function(t){function e(e){var n,o=t.call(this,e,"DeviceManager",new lm,tN,{default:"",devices:[{id:"desktop",name:"Desktop",width:""},{id:"tablet",name:"Tablet",width:"770px",widthMedia:"992px"},{id:"mobileLandscape",name:"Mobile landscape",width:"568px",widthMedia:"768px"},{id:"mobilePortrait",name:"Mobile portrait",width:"320px",widthMedia:"480px"}]})||this;return o.Device=lv,o.Devices=lm,o.storageKey="",o.devices=o.all,null===(n=o.config.devices)||void 0===n||n.forEach(function(t){return o.add(t,{silent:!0})}),o.select(o.config.default||o.devices.at(0)),e.on("change:device",o._onSelect,o),o}return l_(e,t),e.prototype._onSelect=function(t,e,n){var o=this.em,r=this.events,i=t.previous("device"),a=this.get(e),s=r.select;o.trigger(s,a,this.get(i)),this.__catchAllEvent(s,a,n)},e.prototype.add=function(t,e){void 0===e&&(e={});var n,o=e;if((0,tw.isString)(t)){var r=e;o=arguments[2]||{},n=lC(lC({},o),{id:t,name:o.name||t,width:r})}else n=t;return n.id||(n.id=n.name||this._createId()),this.devices.add(n,o)},e.prototype.get=function(t){return this.getAll().filter(function(e){return e.get("name")===t})[0]||this.devices.get(t)||null},e.prototype.remove=function(t,e){return void 0===e&&(e={}),this.__remove(t,e)},e.prototype.getDevices=function(){return this.devices.models},e.prototype.select=function(t,e){void 0===e&&(e={});var n=(0,tw.isString)(t)?this.get(t):t;return n&&this.em.set("device",n.get("id"),e),this},e.prototype.getSelected=function(){return this.get(this.em.get("device"))},e.prototype.getAll=function(){return this.devices},e.prototype.render=function(){var t,e=this.em;return null===(t=this.view)||void 0===t||t.remove(),this.view=new lw({collection:this.devices,config:lC({em:e},this.config)}),this.view.render().el},e.prototype.destroy=function(){this.__destroy()},e}(tL),lS=(pP=function(t,e){return(pP=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pP(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lO=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e,n)||this,r=n.em,i={};o.em=r,e.frames||(i.component=e.component,i.styles=e.styles,["component","styles"].map(function(t){return o.unset(t)}));var a=e.frames||[i],s=new tY(r.Canvas,a);return s.page=o,o.set("frames",s),o.getId()||o.set("id",null==r?void 0:r.Pages._createId()),null==r||r.UndoManager.add(s),o}return lS(e,t),e.prototype.defaults=function(){return{name:"",frames:[],_undo:!0}},e.prototype.onRemove=function(){this.getFrames().reset()},e.prototype.getFrames=function(){return this.get("frames")},e.prototype.getId=function(){return this.id},e.prototype.getName=function(){return this.get("name")},e.prototype.setName=function(t){return this.set({name:t})},e.prototype.getAllFrames=function(){return this.getFrames().models||[]},e.prototype.getMainFrame=function(){return this.getFrames().at(0)},e.prototype.getMainComponent=function(){var t=this.getMainFrame();return null==t?void 0:t.getComponent()},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=tT.Kx.prototype.toJSON.call(this,t),n=(0,tw.result)(this,"defaults");return(0,tw.forEach)(e,function(t,n){0===n.indexOf("_")&&delete e[n]}),(0,tw.forEach)(n,function(t,n){e[n]===t&&delete e[n]}),e},e}(tT.Kx),lT=(pE=function(t,e){return(pE=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pE(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lP=function(){return(lP=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},lE=function(t){function e(e,n){var o=t.call(this,e)||this;return o.on("reset",o.onReset),o.on("remove",o.onRemove),o.model=function(t,e){return void 0===e&&(e={}),new lO(t,lP(lP({},e),{em:n}))},o}return lT(e,t),e.prototype.onReset=function(t,e){var n,o=this;null===(n=null==e?void 0:e.previousModels)||void 0===n||n.map(function(t){return o.onRemove(t,o,e)})},e.prototype.onRemove=function(t,e,n){void 0===n&&(n={}),n.fromUndo||n.temporary||null==t||t.onRemove()},e}(tT.pM),lk=(pk=function(t,e){return(pk=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pk(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lA=function(){return(lA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},lj=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},lM=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},lD="change:selected",lL="main",lI=function(t){function e(e){var n=t.call(this,e,"PageManager",new lE([],e),tR)||this;n.events=tR,n.storageKey="pages",(0,tw.bindAll)(n,"_onPageChange");var o=new tI.A(n,{_undo:!0});return n.model=o,n.pages.on("reset",n.__onReset,n),n.pages.on("all",n.__onChange,n),o.on(lD,n._onPageChange),n}return lk(e,t),Object.defineProperty(e.prototype,"pages",{get:function(){return this.all},enumerable:!1,configurable:!0}),e.prototype.getAll=function(){return lM([],this.all.models,!0)},e.prototype.__onChange=function(t,e,n,o){var r=this.em,i=this.events;r.trigger(i.all,{event:t,page:e,options:o||n})},e.prototype.__onReset=function(){var t=this.pages.at(0);t&&this.select(t)},e.prototype.onLoad=function(){var t,e=this.pages,n=this.config,o=this.em,r={silent:!0},i=(null===(t=n.pages)||void 0===t?void 0:t.map(function(t){return new lO(t,{em:o,config:n})}))||[];e.add(i,r);var a=e.length?this._initPage():this.add({type:lL},r);a&&this.select(a,r)},e.prototype._onPageChange=function(t,e,n){var o=this.em,r=this.events,i=o.Layers,a=e.getMainComponent();i&&a&&i.setRoot(a),o.trigger(r.select,e,t.previous("selected")),this.__onChange(lD,e,n)},e.prototype.postLoad=function(){var t=this.em,e=this.model,n=this.pages,o=t.UndoManager;o.add(e),o.add(n),n.on("add remove reset change",function(e,n,o){var r=o||n;t.changesUp(o||n,{page:e,options:r})})},e.prototype.add=function(t,e){var n=this;void 0===e&&(e={});var o=this.em,r=this.events;t.id=t.id||this._createId();var i=function(){var o=n.pages.add(new lO(t,{em:n.em,config:n.config}),e);return e.select&&n.select(o),o};return e.silent||o.trigger(r.addBefore,t,i,e),e.abort?void 0:i()},e.prototype.remove=function(t,e){var n=this;void 0===e&&(e={});var o=this.em,r=this.events,i=(0,tw.isString)(t)?this.get(t):t,a=function(){return i&&n.pages.remove(i,e),i};return e.silent||o.trigger(r.removeBefore,i,a,e),!e.abort&&a()},e.prototype.move=function(t,e){void 0===e&&(e={});var n=this.pages,o=(0,tw.isString)(t)?this.get(t):t,r=e.at,i=void 0===r?0:r,a=lj(e,["at"]);if(o){var s=n.indexOf(o)===i;if(!(i<0)&&!(i>=n.length)&&!s)return this.remove(o,lA(lA({},a),{temporary:!0})),n.add(o,lA(lA({},a),{at:i})),o}},e.prototype.get=function(t){return this.pages.filter(function(e){return e.get(e.idAttribute)===t})[0]},e.prototype.getMain=function(){var t=this.pages;return t.filter(function(t){return t.get("type")===lL})[0]||t.at(0)},e.prototype.getAllWrappers=function(){var t=this.getAll();return(0,tw.unique)((0,tw.flatten)(t.map(function(t){return t.getAllFrames().map(function(t){return t.getComponent()})})))},e.prototype.select=function(t,e){void 0===e&&(e={});var n=this.em,o=this.model,r=this.events,i=(0,tw.isString)(t)?this.get(t):t;return i&&(n.trigger(r.selectBefore,i,e),o.set("selected",i,e)),this},e.prototype.getSelected=function(){return this.model.get("selected")},e.prototype.destroy=function(){var t=this;this.pages.off().reset(),this.model.stopListening(),this.model.clear({silent:!0}),["selected","model"].map(function(e){return t[e]=0})},e.prototype.store=function(){return this.getProjectData()},e.prototype.load=function(t){var e=this,n=this.loadProjectData(t,{all:this.pages,reset:!0,onResult:function(t,n){t.forEach(function(t){return e.add(t,n)}),e.__onReset()}});return this.pages.forEach(function(t){return t.getFrames().initRefs()}),n},e.prototype._initPage=function(){return this.get(this.config.selected)||this.getMain()},e.prototype._createId=function(){var t,e=this.getAll().length+16,n=this.getAllMap();do t=(0,t_.createId)(e);while(n[t]);return t},e}(tL),lN={placeholder:"eg. Text here"};let lR={assetManager:{addButton:"Add image",inputPlh:"http://path/to/the/image.jpg",modalTitle:"Select Image",uploadTitle:"Drop files here or click to upload"},blockManager:{labels:{},categories:{}},domComponents:{names:{"":"Box",wrapper:"Body",text:"Text",comment:"Comment",image:"Image",video:"Video",label:"Label",link:"Link",map:"Map",tfoot:"Table foot",tbody:"Table body",thead:"Table head",table:"Table",row:"Table row",cell:"Table cell"}},deviceManager:{device:"Device",devices:{desktop:"Desktop",tablet:"Tablet",mobileLandscape:"Mobile Landscape",mobilePortrait:"Mobile Portrait"}},panels:{buttons:{titles:{preview:"Preview",fullscreen:"Fullscreen","sw-visibility":"View components","export-template":"View code","open-sm":"Open Style Manager","open-tm":"Settings","open-layers":"Open Layer Manager","open-blocks":"Open Blocks"}}},selectorManager:{label:"Classes",selected:"Selected",emptyState:"- State -",states:{hover:"Hover",active:"Click","nth-of-type(2n)":"Even/Odd"}},styleManager:{empty:"Select an element before using Style Manager",layer:"Layer",fileButton:"Images",sectors:{general:"General",layout:"Layout",typography:"Typography",decorations:"Decorations",extra:"Extra",flex:"Flex",dimension:"Dimension"},properties:{"text-shadow-h":"X","text-shadow-v":"Y","text-shadow-blur":"Blur","text-shadow-color":"Color","box-shadow-h":"X","box-shadow-v":"Y","box-shadow-blur":"Blur","box-shadow-spread":"Spread","box-shadow-color":"Color","box-shadow-type":"Type","margin-top-sub":"Top","margin-right-sub":"Right","margin-bottom-sub":"Bottom","margin-left-sub":"Left","padding-top-sub":"Top","padding-right-sub":"Right","padding-bottom-sub":"Bottom","padding-left-sub":"Left","border-width-sub":"Width","border-style-sub":"Style","border-color-sub":"Color","border-top-left-radius-sub":"Top Left","border-top-right-radius-sub":"Top Right","border-bottom-right-radius-sub":"Bottom Right","border-bottom-left-radius-sub":"Bottom Left","transform-rotate-x":"Rotate X","transform-rotate-y":"Rotate Y","transform-rotate-z":"Rotate Z","transform-scale-x":"Scale X","transform-scale-y":"Scale Y","transform-scale-z":"Scale Z","transition-property-sub":"Property","transition-duration-sub":"Duration","transition-timing-function-sub":"Timing","background-image-sub":"Image","background-repeat-sub":"Repeat","background-position-sub":"Position","background-attachment-sub":"Attachment","background-size-sub":"Size"}},traitManager:{empty:"Select an element before using Trait Manager",label:"Component settings",categories:{},traits:{labels:{},attributes:{id:lN,alt:lN,title:lN,href:{placeholder:"eg. https://google.com"}},options:{target:{false:"This window",_blank:"New window"}}}},storageManager:{recover:"Do you want to recover unsaved changes?"}};(pA=dc||(dc={})).add="i18n:add",pA.update="i18n:update",pA.locale="i18n:locale";let lV=dc;var lF=(pj=function(t,e){return(pj=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pj(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lH=function(t){function e(e){var n=t.call(this,e,"I18n",{locale:"en",localeFallback:"en",detectLocale:!0,debug:!1,messages:{en:lR},messagesAdd:void 0})||this;n.events=lV;var o=n.config.messagesAdd;return o&&n.addMessages(o),n.config.detectLocale&&(n.config.locale=n._localLang()),n}return lF(e,t),e.prototype.setLocale=function(t){var e=this.em,n=this.config,o=this.events;return e.trigger(o.locale,{value:t,valuePrev:n.locale}),n.locale=t,this},e.prototype.getLocale=function(){return this.config.locale},e.prototype.getMessages=function(t,e){void 0===e&&(e={});var n=this.config.messages;return t&&!n[t]&&this._debug("'".concat(t,"' i18n lang not found"),e),t?n[t]:n},e.prototype.setMessages=function(t){var e=this.em,n=this.config,o=this.events;return n.messages=t,e.trigger(o.update,t),this},e.prototype.addMessages=function(t){var e=this.em,n=this.events,o=this.config.messages;return e.trigger(n.add,t),this.setMessages((0,t_.deepMerge)(o,t)),this},e.prototype.t=function(t,e){void 0===e&&(e={});var n=this.config,o=e.params||{},r=e.l||this.getLocale(),i=e.lFlb||n.localeFallback,a=this._getMsg(t,r,e);return a||(a=this._getMsg(t,i,e)),a||this._debug("'".concat(t,"' i18n key not found in '").concat(r,"' lang"),e),a=a&&(0,tw.isString)(a)?this._addParams(a,o):a},e.prototype._localLang=function(){var t=(0,t_.hasWin)()&&window.navigator||{},e=t.language||t.userLanguage;return e?e.split("-")[0]:"en"},e.prototype._addParams=function(t,e){var n=RegExp("{([\\w\\d-]*)}","g");return t.replace(n,function(t,n){return e[n]||""}).trim()},e.prototype._getMsg=function(t,e,n){void 0===n&&(n={});var o=this.getMessages(e,n);if(o){var r=o[t];return!r&&t.indexOf(".")>0&&(r=t.split(".").reduce(function(t,e){if(!(0,tw.isUndefined)(t))return t[e]},o)),r}},e.prototype._debug=function(t,e){void 0===e&&(e={});var n=this.em,o=this.config;(e.debug||o.debug)&&n&&n.logWarning(t)},e.prototype.destroy=function(){},e}(tD),lU=function(){return(lU=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},lB=function(t,e){void 0===e&&(e={});var n=e.prefix||"",o=document.createElement("i");return o.className=n+"resizer-h "+n+"resizer-h-"+t,o.setAttribute("data-"+n+"handler",t),o},lz=function(t,e){var n=e||window,o=t.getBoundingClientRect();return{left:o.left+n.pageXOffset,top:o.top+n.pageYOffset,width:o.width,height:o.height}},lW=function(){function t(t){void 0===t&&(t={}),this.moved=!1,this.defOpts={ratioDefault:!1,onUpdateContainer:function(){},step:1,minDim:10,maxDim:1/0,unitHeight:"px",unitWidth:"px",keyHeight:"height",keyWidth:"width",currentUnit:!0,silentFrames:!1,avoidContainerUpdate:!1,keepAutoHeight:!1,keepAutoWidth:!1,autoHeight:!1,autoWidth:!1,tl:!0,tc:!0,tr:!0,cl:!0,cr:!0,bl:!0,bc:!0,br:!0},this.opts=lU({},this.defOpts),this.setOptions(t),(0,tw.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop")}return t.prototype.getConfig=function(){return this.opts},t.prototype.setOptions=function(t,e){void 0===t&&(t={}),this.opts=lU(lU({},e?this.defOpts:this.opts),t),this.setup()},t.prototype.setup=function(){var t=this.opts,e=t.prefix||"",n=t.appendTo||document.body,o=this.container;for(o||((o=document.createElement("div")).className="".concat(e,"resizer-c"),n.appendChild(o),this.container=o);o.firstChild;)o.removeChild(o.firstChild);var r={};for(var i in["tl","tc","tr","cl","cr","bl","bc","br"].forEach(function(e){return r[e]=t[e]?lB(e,t):null}),r){var a=r[i];a&&o.appendChild(a)}this.handlers=r,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd,this.onUpdateContainer=t.onUpdateContainer},t.prototype.toggleFrames=function(t){if(this.opts.silentFrames){var e=document.querySelectorAll("iframe");(0,tw.each)(e,function(e){return e.style.pointerEvents=t?"none":""})}},t.prototype.isHandler=function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1},t.prototype.getFocusedEl=function(){return this.el},t.prototype.getParentEl=function(){var t;return null===(t=this.el)||void 0===t?void 0:t.parentElement},t.prototype.getDocumentEl=function(){return this.opts.docs||[this.el.ownerDocument,document]},t.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.posFetcher;return n?n(t,e):lz(t)},t.prototype.focus=function(t){t&&t===this.el||(this.el=t,this.updateContainer({forceShow:!0}),(0,t3.on)(this.getDocumentEl(),"pointerdown",this.handleMouseDown))},t.prototype.blur=function(){this.container.style.display="none",this.el&&((0,t3.AU)(this.getDocumentEl(),"pointerdown",this.handleMouseDown),delete this.el)},t.prototype.start=function(t){var e,n=this.el,o=this.opts;if(this.moved=!1,0===t.button&&n){t.preventDefault(),t.stopPropagation(),null===(e=this.selectedHandler)||void 0===e||e.setPointerCapture(t.pointerId);var r=this.getParentEl(),i=void 0===o?{}:o,a=this.mousePosFetcher,s="data-"+i.prefix+"handler",l=this.getElementPos(n,{avoidFrameZoom:!0,avoidFrameOffset:!0}),c=this.getElementPos(r),u=t.target;this.handlerAttr=u.getAttribute(s),this.clickedHandler=u,this.startDim={t:l.top,l:l.left,w:l.width,h:l.height},this.rectDim={t:l.top,l:l.left,w:l.width,h:l.height},this.startPos=a?a(t):{x:t.clientX,y:t.clientY},this.parentDim={t:c.top,l:c.left,w:c.width,h:c.height};var p=this.getDocumentEl();this.docs=p,(0,t3.on)(p,"pointermove",this.move),(0,t3.on)(p,"keydown",this.handleKeyDown),(0,t3.on)(p,"pointerup",this.stop),(0,tw.isFunction)(this.onStart)&&this.onStart(t,{docs:p,config:i,el:n,resizer:this}),this.toggleFrames(!0),i.updateOnMove||this.move(t)}},t.prototype.move=function(t){this.moved=!0;var e,n,o=this.el,r=this.opts,i=this.docs||this.getDocumentEl(),a=(null===(e=this.mousePosFetcher)||void 0===e?void 0:e.call(this,t))||{x:t.clientX,y:t.clientY};this.currentPos=a,this.delta={x:a.x-this.startPos.x,y:a.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(!1,t),null===(n=this.onMove)||void 0===n||n.call(this,t,{docs:i,config:r,el:o,resizer:this})},t.prototype.stop=function(t){var e,n,o=this.el,r=this.opts,i=this.docs||this.getDocumentEl();(0,t3.AU)(i,"pointermove",this.move),(0,t3.AU)(i,"keydown",this.handleKeyDown),(0,t3.AU)(i,"pointerup",this.stop),(this.moved||!r.updateOnMove)&&this.updateRect(!0,t),t.pointerId&&(null===(e=this.selectedHandler)||void 0===e||e.releasePointerCapture(t.pointerId)),this.toggleFrames(),null===(n=this.onEnd)||void 0===n||n.call(this,t,{docs:i,config:r,el:o,resizer:this}),this.moved=!1,delete this.docs},t.prototype.updateRect=function(t,e){var n=this.el,o=this.opts,r=this.rectDim,i=this.updateTarget,a=this.getSelectedHandler(),s=o.unitHeight,l=o.unitWidth,c=o.keyWidth,u=o.keyHeight;if((0,tw.isFunction)(i))i(n,r,{store:t,selectedHandler:a,resizer:this,config:o,event:e});else{var p=n.style;p[c]=r.w+l,p[u]=r.h+s}this.updateContainer()},t.prototype.updateContainer=function(t){void 0===t&&(t={});var e,n=this.opts,o=this.container,r=this.el,i=o.style;!n.avoidContainerUpdate&&r&&t.forceShow&&(i.display="block"),null===(e=this.onUpdateContainer)||void 0===e||e.call(this,{el:o,resizer:this,opts:lU(lU({},n),t)})},t.prototype.getSelectedHandler=function(){var t=this.handlers;if(this.selectedHandler){for(var e in t)if(t[e]===this.selectedHandler)return e}},t.prototype.handleKeyDown=function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))},t.prototype.handleMouseDown=function(t){var e=t.target;this.isHandler(e)?(this.selectedHandler=e,this.start(t)):e!==this.el&&(delete this.selectedHandler,this.blur())},t.prototype.calc=function(t){var e,n=this.opts||{},o=n.step,r=this.startDim,i=n.minDim,a=n.maxDim,s=t.delta.x,l=t.delta.y,c=this.parentDim.w,u=this.parentDim.h,p=n.unitWidth,d=n.unitHeight,f=n.skipUnitAdjustments,h=this.getParentRect(),g="%"===p&&!f,v="%"===d&&!f,y=g?r.w/100*c:r.w,m=v?r.h/100*u:r.h,b={t:r.t-h.top,l:r.l-h.left,w:y,h:m};if(t){var w=t.handlerAttr;~w.indexOf("r")&&(e=Math.max(i,e=g?(0,t_.normalizeFloat)((y+s*o)/c*100,.01):(0,t_.normalizeFloat)(y+s*o,o)),a&&(e=Math.min(a,e)),b.w=e),~w.indexOf("b")&&(e=Math.max(i,e=v?(0,t_.normalizeFloat)((m+l*o)/u*100,.01):(0,t_.normalizeFloat)(m+l*o,o)),a&&(e=Math.min(a,e)),b.h=e),~w.indexOf("l")&&(e=Math.max(i,e=g?(0,t_.normalizeFloat)((y-s*o)/c*100,.01):(0,t_.normalizeFloat)(y-s*o,o)),a&&(e=Math.min(a,e)),b.w=e),~w.indexOf("t")&&(e=Math.max(i,e=v?(0,t_.normalizeFloat)((m-l*o)/u*100,.01):(0,t_.normalizeFloat)(m-l*o,o)),a&&(e=Math.min(a,e)),b.h=e);var _=n.ratioDefault?!t.keys.shift:t.keys.shift;if(0>w.indexOf("c")&&_){var C=r.w/r.h;b.w/b.h>C?b.h=Math.round(b.w/C):b.w=Math.round(b.h*C)}for(var x in~w.indexOf("l")&&(b.l+=r.w-b.w),~w.indexOf("t")&&(b.t+=r.h-b.h),b)b[x]=parseInt("".concat(b[x]),10);return b}},t.prototype.getParentRect=function(){var t={left:0,top:0,width:0,height:0},e=this.el;if(!e)return t;var n=e.offsetParent;return n&&"BODY"!==n.tagName&&(t=this.getElementPos(n)),t},t}(),l$=function(){return(l$=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function lq(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}}function lG(t,e){return t_.matches.call(t,e)}function lK(t){return t?[t].concat(lK(t.parent())):[]}var lY=function(){function t(t){this.timeout=null,this.threshold=t}return t.prototype.updateArgs=function(t){this.lastArgs=t},t.prototype.execute=function(t){var e=this;this.timeout||(this.timeout=setTimeout(function(){e.lastArgs&&t(e.lastArgs),e.timeout=null},this.threshold))},t.prototype.clearTimeout=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),delete this.lastArgs},t}(),lJ=function(){return(lJ=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},lX=function(){function t(t){this.top=t.top,this.left=t.left,this.height=t.height,this.width=t.width,this.offsets=t.offsets,this.dir=t.dir}return t.prototype.calculateDimensionDifference=function(t){return{topDifference:t.top-this.top,leftDifference:t.left-this.left}},t.prototype.adjustDimensions=function(t){return this.top+=t.topDifference,this.left+=t.leftDifference,this},t.prototype.determinePlacement=function(t,e){var n=this.left+this.width/2,o=this.top+this.height/2;return this.dir?e<o?"before":"after":t<n?"before":"after"},t.prototype.equals=function(t){return!!t&&this.top===t.top&&this.left===t.left&&this.height===t.height&&this.width===t.width&&this.dir===t.dir&&JSON.stringify(this.offsets)===JSON.stringify(t.offsets)},t.prototype.clone=function(){return new t({top:this.top,left:this.left,height:this.height,width:this.width,offsets:lJ({},this.offsets),dir:this.dir})},t.prototype.getDropArea=function(t){var e=this.clone(),n=this.adjustDropDimension(this.width,this.left,t),o=n.newSize,r=n.newPosition;e.width=o,e.left=r;var i=this.adjustDropDimension(this.height,this.top,t),a=i.newSize,s=i.newPosition;return e.height=a,e.top=s,e},t.prototype.adjustDropDimension=function(t,e,n){var o=n.ratio,r=n.minUndroppableDimension,i=n.maxUndroppableDimension,a=t*(1-o)/2;return{newSize:t-2*(a=Math.min(a=Math.max(a,r),i)),newPosition:e+a}},t.prototype.isWithinBounds=function(t,e){return t>=this.left&&t<=this.left+this.width&&e>=this.top&&e<=this.top+this.height},t}(),lZ=(pM=function(t,e){return(pM=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pM(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),lQ=function(t){function e(e){var n=t.call(this)||this;return n.sourceNodes=[],n.containerOffset={top:0,left:0},n.moveThreshold=20,n.treeClass=e.treeClass,n.em=e.em,n.containerContext=e.containerContext,n.positionOptions=e.positionOptions,n.dragDirection=e.dragDirection,n.eventHandlers=e.eventHandlers,(0,tw.bindAll)(n,"endDrag","cancelDrag","recalculateTargetOnScroll","startSort","onDragStart","onMove"),n.restLastMoveData(),n.rateLimiter=new lY(n.moveThreshold),n}return lZ(e,t),e.prototype.startSort=function(t){this.sourceNodes=t,this.bindDragEventHandlers()},e.prototype.bindDragEventHandlers=function(){(0,t3.on)(this.containerContext.container,"dragstart",this.onDragStart),(0,t3.on)(this.containerContext.container,"mousemove dragover",this.onMove),(0,t3.on)(this.containerContext.document,"mouseup dragend touchend",this.endDrag)},e.prototype.recalculateTargetOnScroll=function(){var t=this.lastMoveData.mouseEvent;t&&this.onMove(t)},e.prototype.onMove=function(t){this.rateLimiter.updateArgs(t),this.rateLimiter.execute(this.handleMove.bind(this))},e.prototype.handleMove=function(t){this.adjustForScroll();var e,n,o,r,i,a,s,l=this.lastMoveData.targetNode;null===(n=(e=this.eventHandlers).onMouseMove)||void 0===n||n.call(e,t),this.cacheContainerPosition();var c=this.getMousePositionRelativeToContainer(t.clientX,t.clientY),u=c.mouseXRelative,p=c.mouseYRelative,d=this.getMouseTargetElement(t),f=this.getFirstElementWithAModel(d),h=f?null===(o=(0,tO.default)(f))||void 0===o?void 0:o.data("model"):void 0,g=h?this.getOrCreateHoveredNode(h):void 0,v=g?this.getIndexInParent(g,g.nodeDimensions,u,p):0,y=g?this.getValidParent(g,0,u,p):void 0;if((null==y?void 0:y.equals(l))||null===(i=(r=this.eventHandlers).onTargetChange)||void 0===i||i.call(r,l,y),!y||!g){this.triggerLegacyOnMoveCallback(t,0),this.triggerMoveEvent(u,p),this.restLastMoveData();return}var m=this.getDropPosition(y,u,p),b=m.index,w=m.placement,_=m.placeholderDimensions;_.equals(this.lastMoveData.placeholderDimensions)&&w===this.lastMoveData.placement||null===(s=(a=this.eventHandlers).onPlaceholderPositionChange)||void 0===s||s.call(a,_,w),this.lastMoveData={targetNode:y,hoveredNode:g,mouseEvent:t,index:b,hoveredIndex:v,placement:w,placeholderDimensions:_},this.triggerMoveEvent(u,p),this.triggerLegacyOnMoveCallback(t,b)},e.prototype.adjustForScroll=function(){var t,e,n=this.lastMoveData.targetNode;if(null==n?void 0:n.element){var o=this.getDim(null==n?void 0:n.element),r=null===(t=n.nodeDimensions)||void 0===t?void 0:t.calculateDimensionDifference(o);r&&n.adjustDimensions(r)}var i=this.lastMoveData.hoveredNode;if(null==i?void 0:i.element){var o=this.getDim(null==i?void 0:i.element),r=null===(e=i.nodeDimensions)||void 0===e?void 0:e.calculateDimensionDifference(o);r&&i.adjustDimensions(r)}},e.prototype.restLastMoveData=function(){this.lastMoveData={targetNode:void 0,index:void 0,placement:void 0,mouseEvent:void 0}},e.prototype.triggerLegacyOnMoveCallback=function(t,e){var n,o,r,i,a=null===(n=this.sourceNodes[0])||void 0===n?void 0:n.model;null===(r=(o=this.eventHandlers).legacyOnMoveClb)||void 0===r||r.call(o,{event:t,target:a,parent:null===(i=this.lastMoveData.targetNode)||void 0===i?void 0:i.model,index:e})},e.prototype.triggerMoveEvent=function(t,e){var n,o=this.lastMoveData,r=o.targetNode,i=o.placement,a=o.index,s=a?a+("after"===i?-1:0):0;this.em.trigger("sorter:drag",{target:(null==r?void 0:r.element)||null,targetModel:null===(n=this.lastMoveData.targetNode)||void 0===n?void 0:n.model,sourceModel:this.sourceNodes[0].model,dims:(null==r?void 0:r.childrenDimensions)||[],pos:{index:s,indexEl:s,placement:i},x:t,y:e})},e.prototype.getDropPosition=function(t,e,n){var o,r=t.nodeDimensions,i=t.childrenDimensions,a=t.getChildren(),s=a&&a.length>0;r=r||this.getDim(t.element),t.nodeDimensions=r,i=i||this.getChildrenDim(t),t.childrenDimensions=i;var l=r.clone(),c=0,u="inside";return s&&(c=(o=function(t,e,n){for(var o,r={index:0,placement:"before"},i=0,a=0,s=0,l=0,c=0,u=0,p=0,d=0,f=t.length;d<f;d++){var h=(o=t[d]).top,g=o.left,v=o.height,y=o.width;if(s=g+y,p=h+v,c=g+y/2,u=h+v/2,(!a||!(g>a))&&(!l||!(u>=l))&&(!i||!(s<i))){if(r.index=d,o.dir){if(n<u){r.placement="before";break}r.placement="after"}else n<p&&(l=p),e<c?(a=c,r.placement="before"):(i=c,r.placement="after")}}return r}(i,e,n)).index,u=o.placement,l=i[c].clone(),c+="after"==u?1:0),{index:c,placement:u,placeholderDimensions:l}},e.prototype.getOrCreateHoveredNode=function(t){var e=this.lastMoveData.hoveredNode,n=new this.treeClass(t),o=n.equals(e),r=o?e:n;return r.nodeDimensions=o?e.nodeDimensions:this.getDim(n.element),r},e.prototype.getMouseTargetElement=function(t){var e=this.containerContext.customTarget,n=this.containerContext.document.elementFromPoint(t.clientX,t.clientY);return e?e({event:t}):n},e.prototype.onDragStart=function(t){this.eventHandlers.onDragStart&&this.eventHandlers.onDragStart(t)},e.prototype.endDrag=function(){this.dropDragged()},e.prototype.cancelDrag=function(){var t,e,n=this.lastMoveData.targetNode;null===(e=(t=this.eventHandlers).onTargetChange)||void 0===e||e.call(t,n,void 0),this.finalizeMove()},e.prototype.finalizeMove=function(){var t,e,n,o;this.cleanupEventListeners(),this.triggerOnDragEndEvent(),null===(e=(t=this.eventHandlers).onEnd)||void 0===e||e.call(t),null===(o=(n=this.eventHandlers).legacyOnEnd)||void 0===o||o.call(n),this.restLastMoveData(),this.rateLimiter.clearTimeout()},e.prototype.dropDragged=function(){var t,e,n=this.lastMoveData,o=n.targetNode,r=n.index;null===(e=(t=this.eventHandlers).onDrop)||void 0===e||e.call(t,o,this.sourceNodes,r),this.finalizeMove()},e.prototype.triggerOnDragEndEvent=function(){var t=this.lastMoveData.targetNode,e=this.sourceNodes[0];this.em.trigger("sorter:drag:end",{targetCollection:t?t.getChildren():null,modelToDrop:null==e?void 0:e.model,warns:[""],validResult:{result:!0,src:this.sourceNodes.map(function(t){return t.element}),srcModel:null==e?void 0:e.model,trg:null==t?void 0:t.element,trgModel:null==t?void 0:t.model,draggable:!0,droppable:!0},dst:null==t?void 0:t.element,srcEl:null==e?void 0:e.element})},e.prototype.getFirstElementWithAModel=function(t){for(;t&&this.containerContext.container.contains(t);){var e;if(e=t,void 0!==(0,tO.default)(e).data("model"))return t;t=t.parentElement}return null},e.prototype.getValidParent=function(t,e,n,o){if(t){var r,i,a=this.lastMoveData,s=a.targetNode,l=a.hoveredNode,c=a.hoveredIndex,u=a.mouseEvent,p=t.equals(l);t.nodeDimensions=p?l.nodeDimensions:this.getDim(t.element);var d=this.getIndexInParent(t,t.nodeDimensions,n,o),f=t.isWithinDropBounds(n,o);if(p&&d===c&&f===t.isWithinDropBounds(null!==(r=null==u?void 0:u.clientX)&&void 0!==r?r:0,null!==(i=null==u?void 0:u.clientY)&&void 0!==i?i:0)&&s)return s;if(!f)return this.handleParentTraversal(t,n,o);var h=this.sourceNodes.some(function(n){return t.canMove(n,e)});return(this.triggerDragValidation(h,t),h)?t:this.handleParentTraversal(t,n,o)}},e.prototype.handleParentTraversal=function(t,e,n){var o=t.getParent();if(o){var r=this.getIndexInParent(t,t.nodeDimensions,e,n);if(void 0!==r)return this.getValidParent(o,r,e,n)}},e.prototype.getIndexInParent=function(t,e,n,o){var r=t.getParent();if(r){var i=null==r?void 0:r.indexOfChild(t);return e.dir=this.getDirection(t.element,r.element),i+="after"==e.determinePlacement(n,o)?1:0}},e.prototype.triggerDragValidation=function(t,e){var n=this.sourceNodes[0];return this.em.trigger("sorter:drag:validation",{valid:t,src:null==n?void 0:n.element,srcModel:null==n?void 0:n.model,trg:e.element,trgModel:e.model}),n},e.prototype.cleanupEventListeners=function(){var t=this.containerContext.container;(0,t3.AU)(t,"dragstart",this.onDragStart),(0,t3.AU)(t,"mousemove dragover",this.onMove),(0,t3.AU)(this.containerContext.document,"mouseup dragend touchend",this.endDrag)},e.prototype.getDirection=function(t,e){return this.dragDirection===n0.A.Vertical||this.dragDirection!==n0.A.Horizontal&&function(t,e){if((0,t3.ir)(t))return!1;var n=t.style||{},o=(0,tO.default)(t),r=(0,tO.default)(e);if(n.overflow&&"visible"!==n.overflow)return!1;var i=o.css("float");return(!i||"none"===i)&&("flex"!==r.css("display")||"column"===r.css("flex-direction"))&&!!function(t){switch(t){case"static":case"relative":case"":return!0;default:return!1}}(n.position)&&(["TR","TBODY","THEAD","TFOOT"].includes(t.tagName)||["block","list-item","table","flex","grid"].includes(o.css("display")))}(t,e)},e.prototype.getChildrenDim=function(t){var e=this,n=[],o=t.element;if(!o)return[];var r=t.getChildren();return r&&0!==r.length?((0,tw.each)(r,function(t,r){var i=t.element;if(i){if(!(0,t3.ir)(i)&&!lG(i,e.containerContext.itemSel))return;var a=e.getDim(i);a.dir=e.getDirection(i,o),n.push(a)}}),n):[]},e.prototype.getMousePositionRelativeToContainer=function(t,e){var n=e-this.containerOffset.top+this.containerContext.container.scrollTop,o=t-this.containerOffset.left+this.containerContext.container.scrollLeft;if(this.positionOptions.canvasRelative){var r=this.em.Canvas.getMouseRelativeCanvas({clientX:t,clientY:e},{noScroll:1});o=r.x,n=r.y}return{mouseXRelative:o,mouseYRelative:n}},e.prototype.cacheContainerPosition=function(){var t=lq(this.containerContext.container),e=this.positionOptions.windowMargin?Math.abs(t.top):t.top,n=this.positionOptions.windowMargin?Math.abs(t.left):t.left;this.containerOffset={top:e,left:n}},e.prototype.getDim=function(t){var e,n,o,r,i=this.em,a=this.positionOptions.relative,s=this.positionOptions.windowMargin,l=null==i?void 0:i.Canvas,c=l?l.getElementOffsets(t):{};if(this.positionOptions.canvasRelative&&this.em){var u=l.getElementPos(t,{noScroll:1});e=u.top,n=u.left,o=u.height,r=u.width}else{var p=lq(t);e=a?t.offsetTop:p.top-(s?-1:1)*this.containerOffset.top,n=a?t.offsetLeft:p.left-(s?-1:1)*this.containerOffset.left,o=t.offsetHeight,r=t.offsetWidth}return new lX({top:e,left:n,height:o,width:r,offsets:c})},e}(tT.Ss),l0=(pD=function(t,e){return(pD=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pD(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l1=function(t){function e(e){var n=t.call(this)||this;return n.pfx=e.pfx||"",n.allowNesting=e.allowNesting||!1,n.container=e.container,n.setElement(e.el),n.offset={top:e.offset.top||0,left:e.offset.left||0},n.moveLimiter=new lY(100),n}return l0(e,t),e.prototype.show=function(){this.el.style.display="block"},e.prototype.hide=function(){this.moveLimiter.clearTimeout(),this.el.style.display="none"},e.prototype.move=function(t,e){var n=this;this.moveLimiter.updateArgs({elementDimension:t,placement:e}),this.moveLimiter.execute(function(t){var e=t.elementDimension,o=t.placement;n._move(e,o)})},e.prototype._move=function(t,e){var n=0,o=0,r="",i="";this.setOrientationForDimension(t);var a=t.top,s=t.left,l=t.height,c=t.width,u=t.dir,p=t.offsets;if("inside"===e){if(this.setOrientation("horizontal"),!this.allowNesting){this.hide();return}var d=(null==p?void 0:p.paddingTop)||5,f=(null==p?void 0:p.paddingLeft)||5,h=(null==p?void 0:p.borderTopWidth)||0,g=(null==p?void 0:p.borderLeftWidth)||0,v=(null==p?void 0:p.borderRightWidth)||0;n=a+d+h,o=s+f+g,r=Math.max(c-2*f-(g+v),1)+"px",i="auto"}else u?(r=c+"px",i="auto",n="before"===e?a-0:a+l-0,o=s):(r="auto",i=l-0+"px",n=a+0,o="before"===e?s-0:s+c-0,this.setOrientation("vertical"));this.updateStyles(n,o,r,i),this.adjustOffset()},e.prototype.setOrientationForDimension=function(t){this.el.classList.remove("vertical"),this.el.classList.add("horizontal"),t&&!t.dir&&this.setOrientation("vertical")},e.prototype.setOrientation=function(t){this.el.classList.remove("horizontal"),this.el.classList.remove("vertical"),this.el.classList.add(t)},e.prototype.updateStyles=function(t,e,n,o){this.el.style.top=t+"px",this.el.style.left=e+"px",n&&(this.el.style.width=n),o&&(this.el.style.height=o)},e.prototype.adjustOffset=function(){this.$el.css("top","+="+this.offset.top+"px"),this.$el.css("left","+="+this.offset.left+"px")},e}(tT.Ss),l2=function(){return(l2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},l5=function(){function t(t){var e,n=(e={containerContext:{container:"",placeholderElement:"",containerSel:"*",itemSel:"*",pfx:"",document:document},positionOptions:{borderOffset:10,relative:!1,windowMargin:0,offsetTop:0,offsetLeft:0,scale:1,canvasRelative:!1},dragBehavior:{dragDirection:n0.A.Vertical,nested:!1,selectOnEnd:!0},eventHandlers:{}},l$(l$(l$({},e),t),{containerContext:l$(l$({},e.containerContext),t.containerContext),positionOptions:l$(l$({},e.positionOptions),t.positionOptions),dragBehavior:l$(l$({},e.dragBehavior),t.dragBehavior),eventHandlers:l$(l$({},e.eventHandlers),t.eventHandlers)}));(0,tw.bindAll)(this,"startSort","cancelDrag","recalculateTargetOnScroll","rollback","updateOffset","handlePlaceholderMove","finalizeMove"),this.containerContext=n.containerContext,this.positionOptions=n.positionOptions,this.dragBehavior=n.dragBehavior,this.eventHandlers=l2(l2({},n.eventHandlers),{onPlaceholderPositionChange:this.handlePlaceholderMove,onEnd:this.finalizeMove}),this.em=t.em,this.treeClass=t.treeClass,this.updateOffset(),this.em.on(this.em.Canvas.events.refresh,this.updateOffset),this.placeholder=this.createPlaceholder(),this.dropLocationDeterminer=new lQ({em:this.em,treeClass:this.treeClass,containerContext:this.containerContext,positionOptions:this.positionOptions,dragDirection:this.dragBehavior.dragDirection,eventHandlers:this.eventHandlers})}return t.prototype.startSort=function(t){var e,n,o,r,i,a,s,l=this.getSourceNodes(t),c=l.sourceNodes,u=l.sourcesWithModel;this.sourceNodes=c,this.dropLocationDeterminer.startSort(c),this.bindDragEventHandlers(),null===(n=(e=this.eventHandlers).onStartSort)||void 0===n||n.call(e,this.sourceNodes,this.containerContext.container);var p=null===(o=this.sourceNodes[0])||void 0===o?void 0:o.model;null===(i=(r=this.eventHandlers).legacyOnStartSort)||void 0===i||i.call(r,{sorter:this,target:p,parent:p&&(null===(a=p.parent)||void 0===a?void 0:a.call(p)),index:p&&(null===(s=p.index)||void 0===s?void 0:s.call(p))}),this.em.trigger("sorter:drag:start",t[0],u[0])},t.prototype.validTarget=function(t,e,n){if(!t)return!1;var o=(0,tO.default)(t).data("model");if(!o)return!1;var r=new this.treeClass(o);return this.getSourceNodes(e).sourceNodes.some(function(t){return r.canMove(t,n)})},t.prototype.getSourceNodes=function(t){var e=this,n=t.filter(function(t){return!!t.dragSource||e.findValidSourceElement(t.element)}).map(function(t){var e,n;return{model:(null===(e=t.dragSource)||void 0===e?void 0:e.model)||(null===(n=(0,tO.default)(t.element))||void 0===n?void 0:n.data("model")),content:t.dragSource}});return{sourceNodes:n.sort(function(t,e){return function(t,e){var n=lK(t),o=lK(e),r=o.filter(function(t){return n.includes(t)})[0];if(!r)return t.model.index()-e.model.index();var i=o[o.indexOf(r)-1];return n[n.indexOf(r)-1].index()-i.index()}(t.model,e.model)}).map(function(t){return new e.treeClass(t.model,t.content)}),sourcesWithModel:n}},t.prototype.recalculateTargetOnScroll=function(){this.dropLocationDeterminer.recalculateTargetOnScroll()},t.prototype.cancelDrag=function(){this.triggerNullOnEndMove(!0),this.dropLocationDeterminer.cancelDrag()},t.prototype.endDrag=function(){this.dropLocationDeterminer.endDrag()},t.prototype.handlePlaceholderMove=function(t,e){this.ensurePlaceholderElement(),this.updatePlaceholderPosition(t,e)},t.prototype.createPlaceholder=function(){return new l1({container:this.containerContext.container,allowNesting:this.dragBehavior.nested,pfx:this.containerContext.pfx,el:this.containerContext.placeholderElement,offset:{top:this.positionOptions.offsetTop,left:this.positionOptions.offsetLeft}})},t.prototype.ensurePlaceholderElement=function(){var t=this.placeholder.el,e=this.containerContext.container;t.ownerDocument.contains(t)||e.append(this.placeholder.el)},t.prototype.updateOffset=function(){var t,e=(null===(t=this.em)||void 0===t?void 0:t.get("canvasOffset"))||{};this.positionOptions.offsetTop=e.top,this.positionOptions.offsetLeft=e.left},t.prototype.findValidSourceElement=function(t){return t&&!lG(t,"".concat(this.containerContext.itemSel,", ").concat(this.containerContext.containerSel))&&(t=function(t,e){if(t)for(var n=t.parentNode;n&&1===n.nodeType;){if(lG(n,e))return n;n=n.parentNode}}(t,this.containerContext.itemSel)),t},t.prototype.bindDragEventHandlers=function(){(0,t3.on)(this.containerContext.document,"keydown",this.rollback)},t.prototype.updatePlaceholderPosition=function(t,e){this.placeholder.move(t,e)},t.prototype.cleanupEventListeners=function(){(0,t3.AU)(this.containerContext.document,"keydown",this.rollback)},t.prototype.finalizeMove=function(){this.cleanupEventListeners(),this.placeholder.hide(),delete this.sourceNodes},t.prototype.rollback=function(t){(0,t3.AU)(this.containerContext.document,"keydown",this.rollback),"Escape"===t.key&&this.cancelDrag()},t.prototype.triggerNullOnEndMove=function(t){var e,n,o,r,i,a=null===(e=this.sourceNodes)||void 0===e?void 0:e[0].model,s={target:a,parent:a&&(null===(n=a.parent)||void 0===n?void 0:n.call(a)),index:a&&(null===(o=a.index)||void 0===o?void 0:o.call(a))};null===(i=(r=this.eventHandlers).legacyOnEndMove)||void 0===i||i.call(r,null,this,l2(l2({},s),{cancelled:t}))},t}(),l3=(pL=function(t,e){return(pL=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pL(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l4=function(){return(l4=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},l6={id:"sorter-target",type:tZ.F.Target},l7=function(t){function e(e){var n=e.em,o=e.treeClass,r=e.containerContext,i=e.dragBehavior,a=e.positionOptions,s=e.eventHandlers,l=void 0===s?{}:s,c=t.call(this,{em:n,treeClass:o,containerContext:r,positionOptions:void 0===a?{}:a,dragBehavior:i,eventHandlers:l4(l4({},l),{onStartSort:function(t,e){var n;null===(n=l.onStartSort)||void 0===n||n.call(l,t,e),c.onStartSort()},onDrop:function(t,e,n){var o;null===(o=l.onDrop)||void 0===o||o.call(l,t,e,n),c.onDrop(t,e,n)},onTargetChange:function(t,e){var n;null===(n=l.onTargetChange)||void 0===n||n.call(l,t,e),c.onTargetChange(t,e)},onMouseMove:function(t){var e;null===(e=l.onMouseMove)||void 0===e||e.call(l,t),c.onMouseMove(t)}})})||this;return c.targetIsText=!1,c.onMouseMove=function(t){var e;c.targetIsText&&(null===(e=c.sourceNodes)||void 0===e?void 0:e.some(function(t){return t.isTextable()}))&&c.updateTextViewCursorPosition(t)},c.onDrop=function(t,e,n){t&&e.length>0?0===c.handleNodeAddition(t,e,"number"==typeof n?n:-1).length&&c.triggerNullOnEndMove(!1):c.triggerNullOnEndMove(!0),null==t||t.restNodeState(),c.placeholder.hide()},c.onTargetChange=function(t,e){null==t||t.restNodeState();var n,o=c.em.Canvas;if(!e){c.placeholder.hide(),o.removeSpots(l6);return}null==e||e.setSelectedParentState(),c.targetIsText=e.isTextNode(),c.targetIsText&&(null===(n=c.sourceNodes)||void 0===n?void 0:n.some(function(t){return t.isTextable()}))?(e.setContentEditable(!0),c.placeholder.hide()):c.placeholder.show(),[tZ.F.Select,tZ.F.Hover,tZ.F.Spacing].forEach(function(t){return o.removeSpots({type:t})}),o.addSpot(l4(l4({},l6),{component:e.model}))},(0,tw.bindAll)(c,"handleScrollEvent"),c}return l3(e,t),e.prototype.onStartSort=function(){this.em.clearSelection(),this.setAutoCanvasScroll(!0)},e.prototype.bindDragEventHandlers=function(){this.em.on("frame:scroll",this.handleScrollEvent),t.prototype.bindDragEventHandlers.call(this)},e.prototype.cleanupEventListeners=function(){this.em.off("frame:scroll",this.handleScrollEvent),t.prototype.cleanupEventListeners.call(this)},e.prototype.handleScrollEvent=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.frame;this.em.Canvas.getCanvasView().frame===o&&this.recalculateTargetOnScroll()},e.prototype.handleNodeAddition=function(t,e,n){var o=this;return e.reduce(function(e,r){if(!t.canMove(r,n))return e;if(o.isPositionChanged(t,r,n)){var i=o.moveNode(t,r,n),a=i.index,s=i.addedNode;e.push(s),n=a}return n++,e},[])},e.prototype.isPositionChanged=function(t,e,n){var o=e.getParent(),r=o?o.indexOfChild(e):-1;(null==o?void 0:o.model.cid)===t.model.cid&&r<n&&n--;var i=(null==o?void 0:o.model.cid)===t.model.cid,a=r===n,s=this.targetIsText&&e.isTextable();return!(i&&a&&!s)},e.prototype.moveNode=function(t,e,n){var o=e.getParent();if(o){var r=o.indexOfChild(e);o.removeChildAt(r,{temporary:!0}),o.model.cid===t.model.cid&&r<n&&n--}var i=t.addChildAt(e,n,{action:"move-component"});return i&&this.triggerEndMoveEvent(i),{addedNode:i,index:n}},e.prototype.triggerEndMoveEvent=function(t){var e,n,o,r,i,a;null===(n=(e=this.eventHandlers).legacyOnEndMove)||void 0===n||n.call(e,t.model,this,{target:t.model,parent:t.model&&(null===(r=(o=t.model).parent)||void 0===r?void 0:r.call(o)),index:t.model&&(null===(a=(i=t.model).index)||void 0===a?void 0:a.call(i))})},e.prototype.finalizeMove=function(){var e,n;null===(e=this.em)||void 0===e||e.Canvas.removeSpots(l6),null===(n=this.sourceNodes)||void 0===n||n.forEach(function(t){return t.restNodeState()}),this.setAutoCanvasScroll(!1),t.prototype.finalizeMove.call(this)},e.prototype.updateTextViewCursorPosition=function(t){var e=this.em;if(e){var n=e.Canvas,o=n.getDocument(),r=null,i=(0,t3.G2)(t);if(o.caretPositionFromPoint){var a=o.caretPositionFromPoint(i.clientX,i.clientY);a&&(r=o.createRange()).setStart(a.offsetNode,a.offset)}else o.caretRangeFromPoint?r=o.caretRangeFromPoint(i.clientX,i.clientY):t.rangeParent&&(r=o.createRange()).setStart(t.rangeParent,t.rangeOffset);var s=n.getWindow().getSelection();n.getFrameEl().focus(),null==s||s.removeAllRanges(),r&&(null==s||s.addRange(r))}},e.prototype.setAutoCanvasScroll=function(t){var e=this.em,n=null==e?void 0:e.Canvas;n&&(t?n.startAutoscroll():n.stopAutoscroll())},e}(l5),l9=(pI=function(t,e){return(pI=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pI(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l8=function(){return(l8=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l9(e,t),e.prototype.defaults=function(){return{values:{}}},e.prototype.initialize=function(){var t=this.collection;this.prop=null==t?void 0:t.prop},e.prototype.getId=function(){return this.cid},e.prototype.getIndex=function(){var t=this.collection;return t?t.indexOf(this):-1},e.prototype.getValues=function(t){void 0===t&&(t={});var e=this.get("values");return t.camelCase?Object.keys(e).reduce(function(t,n){return t[(0,t_.camelCase)(n)]=e[n],t},{}):e},e.prototype.getLabel=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.getLayerLabel(this)},e.prototype.isSelected=function(){var t;return(null===(t=this.prop)||void 0===t?void 0:t.getSelectedLayer())===this},e.prototype.select=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.selectLayer(this)},e.prototype.remove=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.removeLayer(this)},e.prototype.move=function(t){var e;return null===(e=this.prop)||void 0===e?void 0:e.moveLayer(this,t)},e.prototype.getStylePreview=function(t){var e;return void 0===t&&(t={}),null===(e=this.prop)||void 0===e?void 0:e.getStylePreview(this,t)},e.prototype.hasPreview=function(){var t;return!!(null===(t=this.prop)||void 0===t?void 0:t.get("preview"))},e.prototype.upValues=function(t){return void 0===t&&(t={}),this.set("values",l8(l8({},this.getValues()),t))},e}(tT.Kx),ce=(pN=function(t,e){return(pN=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pN(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),cn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ce(e,t),e.prototype.initialize=function(t,e){void 0===e&&(e={}),this.prop=e.prop},e}(tT.pM);cn.prototype.model=ct;var co,cr,ci,ca,cs,cl,cc,cu,cp,cd,cf,ch,cg,cv,cy,cm,cb,cw,c_,cC,cx,cS,cO,cT,cP,cE,ck,cA,cj,cM,cD,cL,cI,cN,cR,cV,cF,cH,cU,cB,cz,cW,c$,cq,cG,cK,cY,cJ,cX,cZ,cQ,c0,c1,c2,c5,c3,c4,c6,c7,c9,c8,ut,ue,un,uo,ur,ui,ua,us,ul,uc,uu,up,ud,uf,uh,ug,uv,uy,um,ub,uw,u_,uC,ux,uS,uO,uT,uP,uE,uk,uA,uj,uM,uD,uL,uI,uN,uR,uV,uF,uH,uU,uB,uz,uW,u$,uq,uG,uK,uY,uJ,uX,uZ,uQ,u0,u1,u2,u5,u3,u4,u6,u7,u9,u8,pt,pe,pn,po,pr,pi,pa,ps,pl,pc,pu,pp,pd,pf,ph,pg,pv,py,pm,pb,pw,p_,pC,px,pS,pO,pT,pP,pE,pk,pA,pj,pM,pD,pL,pI,pN,pR,pV,pF,pH,pU,pB,pz,pW,p$,pq,pG,pK,pY,pJ,pX,pZ,pQ,p0,p1,p2,p5,p3,p4,p6,p7,p9,p8,dt,de,dn,dr,di,da,ds,dl,dc,du,dp=tm(3178),dd=(pR=function(t,e){return(pR=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pR(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),df=function(t){function e(e){return t.call(this,e)||this}return dd(e,t),e.prototype.getChildren=function(){return this.model instanceof cn?this.model.models.map(function(t){return new e(t)}):null},e.prototype.getParent=function(){var t=this.model instanceof ct?this.model.collection:null;return t?new e(t):null},e.prototype.addChildAt=function(t,n){if(this.model instanceof ct)throw Error("Cannot add a layer model to another layer model");return new e(this.model.add(t.model,{at:n}))},e.prototype.removeChildAt=function(t){if(this.model instanceof ct)throw Error("Cannot remove a layer model from another layer model");var e=this.model.at(t);e&&this.model.remove(e)},e.prototype.indexOfChild=function(t){return t.model instanceof ct&&this.model instanceof cn?this.model.indexOf(t.model):-1},e.prototype.canMove=function(t,e){return this.model instanceof cn&&!!t.model},Object.defineProperty(e.prototype,"view",{get:function(){return this.model.view},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){var t;return null===(t=this.view)||void 0===t?void 0:t.el},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this._model},enumerable:!1,configurable:!0}),e}(dp.$),dh=(pV=function(t,e){return(pV=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pV(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),dg=function(){return(dg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},dv=function(t){function e(e){var n=e.em,o=e.containerContext,r=e.dragBehavior,i=e.positionOptions,a=e.eventHandlers,s=void 0===a?{}:a,l=t.call(this,{em:n,treeClass:df,containerContext:o,positionOptions:void 0===i?{}:i,dragBehavior:r,eventHandlers:dg({onStartSort:function(t,e){var n;null===(n=s.onStartSort)||void 0===n||n.call(s,t,e),l.onLayerStartSort(t)},onDrop:function(t,e,n){var o;null===(o=s.onDrop)||void 0===o||o.call(s,t,e,n),l.onLayerDrop(t,e,n)},onEnd:function(){l.placeholder.hide()}},s)})||this;return l.onLayerStartSort=function(t){l.em.clearSelection();var e=t[0];l.em.trigger("sorter:drag:start",null==e?void 0:e.element,null==e?void 0:e.model),l.placeholder.show()},l.onLayerDrop=function(t,e,n){if(t){n="number"==typeof n?n:-1;for(var o=0;o<e.length;o++){var r=e[o];if(t.canMove(r,o)){var i=r.getParent(),a=-1;i&&(a=i.indexOfChild(r),i.removeChildAt(a)),n=a<n?n-1:n,t.addChildAt(r,n)}}l.placeholder.hide()}},l}return dh(e,t),e}(l5),dy=(pF=function(t,e){return(pF=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pF(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),dm=function(){return(dm=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},db=function(t){function e(e){var n=t.call(this,e,"Utils")||this;return n.Sorter=l7,n.Resizer=lW,n.Dragger=n7.A,n.ComponentSorter=l7,n.StyleManagerSorter=dv,n.helpers=dm({},t_),n}return dy(e,t),e.prototype.destroy=function(){},e}(tD),dw={},d_={16:!1,18:!1,17:!1,91:!1},dC="all",dx={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},dS={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},dO=function(t){return dS[t]||t.toUpperCase().charCodeAt(0)},dT=[];for(du=1;du<20;du++)dS["f"+du]=111+du;function dP(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return -1}var dE={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function dk(t){var e,n=t.keyCode,o=dP(dT,n);if(o>=0&&dT.splice(o,1),(93==n||224==n)&&(n=91),n in d_)for(e in d_[n]=!1,dx)dx[e]==n&&(dj[e]=!1)}function dA(){for(du in d_)d_[du]=!1;for(du in dx)dj[du]=!1}function dj(t,e,n){var o,r;o=dD(t),void 0===n&&(n=e,e="all");for(var i=0;i<o.length;i++)r=[],(t=o[i].split("+")).length>1&&(r=dL(t),t=[t[t.length-1]]),(t=dO(t=t[0]))in dw||(dw[t]=[]),dw[t].push({shortcut:o[i],scope:e,method:n,key:o[i],mods:r})}for(du in dx)dj[du]=!1;function dM(){return dC||"all"}function dD(t){var e;return""==(e=(t=t.replace(/\s/g,"")).split(","))[e.length-1]&&(e[e.length-2]+=","),e}function dL(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=dx[e[n]];return e}function dI(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,function(){n(window.event)})}dj.setScope=function(t){dC=t||"all"},dj.getScope=dM,dj.deleteScope=function(t){var e,n,o;for(e in dw)for(o=0,n=dw[e];o<n.length;)n[o].scope===t?n.splice(o,1):o++},dj.filter=function(t){var e=(t.target||t.srcElement).tagName;return!("INPUT"==e||"SELECT"==e||"TEXTAREA"==e)},dj.isPressed=function(t){return"string"==typeof t&&(t=dO(t)),-1!=dP(dT,t)},dj.getPressedKeyCodes=function(){return dT.slice(0)},dj.unbind=function(t,e){var n,o,r,i,a,s=[];for(i=0,n=dD(t);i<n.length;i++){if((o=n[i].split("+")).length>1&&(s=dL(o)),t=dO(t=o[o.length-1]),void 0===e&&(e=dM()),!dw[t])return;for(r=0;r<dw[t].length;r++)(a=dw[t][r]).scope===e&&function(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(a.mods,s)&&(dw[t][r]={})}},dj.handlers=dw,dj.init=function(t){dI(t.document,"keydown",function(t){!function(t){var e,n,o,r,i,a;if(-1==dP(dT,e=t.keyCode)&&dT.push(e),(93==e||224==e)&&(e=91),e in d_){for(o in d_[e]=!0,dx)dx[o]==e&&(dj[o]=!0);return}if(function(t){for(du in d_)d_[du]=t[dE[du]]}(t),dj.filter.call(this,t)&&e in dw){for(r=0,a=dM();r<dw[e].length;r++)if((n=dw[e][r]).scope==a||"all"==n.scope){for(o in i=n.mods.length>0,d_)(!d_[o]&&dP(n.mods,+o)>-1||d_[o]&&-1==dP(n.mods,+o))&&(i=!1);(0!=n.mods.length||d_[16]||d_[18]||d_[17]||d_[91])&&!i||!1!==n.method(t,n)||(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}}(t)}),dI(t.document,"keyup",dk),dI(t,"focus",dA)};let dN=dj;(o=ti||(ti={})).add="keymap:add",o.remove="keymap:remove",o.emit="keymap:emit",o.emitId="keymap:emit:";var dR=(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),dV=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(0,t_.hasWin)()&&dN.init(window);var dF=function(t){function e(e){var n=t.call(this,e,"Keymaps",{defaults:{"core:undo":{keys:"⌘+z, ctrl+z",handler:"core:undo",opts:{prevent:!0}},"core:redo":{keys:"⌘+shift+z, ctrl+shift+z",handler:"core:redo",opts:{prevent:!0}},"core:copy":{keys:"⌘+c, ctrl+c",handler:"core:copy"},"core:paste":{keys:"⌘+v, ctrl+v",handler:"core:paste"},"core:component-next":{keys:"s",handler:"core:component-next"},"core:component-prev":{keys:"w",handler:"core:component-prev"},"core:component-enter":{keys:"d",handler:"core:component-enter"},"core:component-exit":{keys:"a",handler:"core:component-exit"},"core:component-delete":{keys:"backspace, delete",handler:"core:component-delete",opts:{prevent:!0}}}})||this;return n.keymaster=dN,n.events=ti,n.keymaps={},n}return dR(e,t),e.prototype.onLoad=function(){if(!this.em.isHeadless){var t=this.config.defaults;for(var e in t){var n=t[e];this.add(e,n.keys,n.handler,n.opts||{})}}},e.prototype.add=function(t,e,n,o){void 0===o&&(o={});var r=this.em,i=this.events,a=r.Commands,s=r.getEditor(),l=r.Canvas,c={id:t,keys:e,handler:n};return this.keymaps[t]&&this.remove(t),this.keymaps[t]=c,dN(e,function(e,c){var u,p={event:e,h:c},d=(0,tw.isString)(n)?a.get(n):n;if(!r.isEditing()&&!s.Canvas.isInputFocused()||o.force){o.prevent&&(null===(u=l.getCanvasView())||void 0===u||u.preventDefault(e)),(0,tw.isFunction)(d)?d(s,0,p):a.runCommand(d,p);var f=[t,c.shortcut,e];r.trigger.apply(r,dV([i.emit],f,!1)),r.trigger.apply(r,dV(["".concat(i.emitId).concat(t)],f,!1))}},void 0),r.trigger(i.add,c),c},e.prototype.get=function(t){return this.keymaps[t]},e.prototype.getAll=function(){return this.keymaps},e.prototype.remove=function(t){var e=this.em,n=this.events,o=this.get(t);if(o)return delete this.keymaps[t],o.keys.split(", ").forEach(function(t){dN.unbind(t.trim())}),null==e||e.trigger(n.remove,o),o},e.prototype.removeAll=function(){var t=this;return Object.keys(this.keymaps).forEach(function(e){return t.remove(e)}),dN.handlers={},this},e.prototype.destroy=function(){this.removeAll(),this.keymaps={}},e}(tD),dH=(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),dU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return dH(e,t),e.prototype.defaults=function(){return{title:"",content:"",attributes:{},open:!1}},e.prototype.open=function(){this.set("open",!0)},e.prototype.close=function(){this.set("open",!1)},e}(tI.A);(a=ta||(ta={})).open="modal:open",a.close="modal:close",a.all="modal";var dB=(s=function(t,e){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),dz=function(){return(dz=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},dW=function(t){function e(e){var n=t.call(this,e)||this,o=n.model;return n.listenTo(o,"change:open",n.updateOpen),n.listenTo(o,"change:title",n.updateTitle),n.listenTo(o,"change:content",n.updateContent),n}return dB(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,o=t.content,r=t.title;return'<div class="'.concat(e,"dialog ").concat(n,"one-bg ").concat(n,'two-color">\n <div class="').concat(e,'header">\n <div class="').concat(e,'title">').concat(r,'</div>\n <div class="').concat(e,'btn-close" data-close-modal>&Cross;</div>\n </div>\n <div class="').concat(e,'content">\n <div id="').concat(e,'c">').concat(o,'</div>\n <div style="clear:both"></div>\n </div>\n </div>\n <div class="').concat(e,'collector" style="display: none"></div>')},e.prototype.events=function(){return{click:"onClick","click [data-close-modal]":"hide"}},e.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},e.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},e.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},e.prototype.getTitle=function(t){return void 0===t&&(t={}),this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),t.$?this.$title:this.$title.get(0)},e.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),o=this.model.get("content");e.length&&n.append(e),t.empty().append(o)},e.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get("title"))},e.prototype.updateOpen=function(){this.el.style.display=this.model.get("open")?"":"none"},e.prototype.hide=function(){this.model.close()},e.prototype.show=function(){this.model.open()},e.prototype.updateAttr=function(t){var e=this.pfx,n=this.$el,o=this.el,r=[].slice.call(o.attributes).map(function(t){return t.name});n.removeAttr(r.join(" ")),n.attr(dz(dz({},t||{}),{class:"".concat(e,"container ").concat(t&&t.class||"").trim()}))},e.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},e}(t5),d$=(l=function(t,e){return(l=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),dq=function(t){function e(e){var n=t.call(this,e,"Modal",{stylePrefix:"mdl-",title:"",content:"",backdrop:!0,custom:!1,extend:{}})||this;n.events=ta;var o=n.events;return n.model=new dU(n),n.model.on("change:open",function(t,n){e.trigger(n?o.open:o.close)}),n.model.on("change",(0,tw.debounce)(function(){var t=n._evData(),r=n.config.custom;(0,tw.isFunction)(r)&&r(t),e.trigger(o.all,t)},0)),n}return d$(e,t),e.prototype._evData=function(){var t=this,e=this.getTitle(),n=this.getContent(),o=this.model.attributes;return{open:o.open,attributes:o.attributes,title:(0,tw.isString)(e)?(0,t3.GZ)(e):e,content:(0,tw.isString)(n)?(0,t3.GZ)(n):n.get?n.get(0):n,close:function(){t.close()}}},e.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},e.prototype.open=function(t){void 0===t&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set("attributes",e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},e.prototype.close=function(){return this.model.close(),this},e.prototype.onceClose=function(t){var e=this.em,n=this.events;return e.once(n.close,t),this},e.prototype.onceOpen=function(t){var e=this.em,n=this.events;return e.once(n.open,t),this},e.prototype.isOpen=function(){return!!this.model.get("open")},e.prototype.setTitle=function(t){return this.model.set("title",t),this},e.prototype.getTitle=function(){return this.model.get("title")},e.prototype.setContent=function(t){return this.model.set("content"," "),this.model.set("content",t),this},e.prototype.getContent=function(){return this.model.get("content")},e.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},e.prototype.getModel=function(){return this.model},e.prototype.render=function(){if(!this.config.custom){var t,e=dW.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),null===(t=this.modal)||void 0===t?void 0:t.render().el}},e.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},e}(tD),dG="sw-visibility",dK="export-template",dY="open-sm",dJ="open-tm",dX="open-layers",dZ="open-blocks",dQ="fullscreen",d0="preview",d1=(c=function(t,e){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d2=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.get("buttons").length&&o.set("buttons",new d4(o.module,o.get("buttons"))),o}return d1(e,t),e.prototype.defaults=function(){return{id:"",label:"",tagName:"span",className:"",command:"",context:"",buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(e.prototype,"className",{get:function(){return this.get("className")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.get("command")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.get("active")},set:function(t){this.set("active",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"togglable",{get:function(){return this.get("togglable")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runDefaultCommand",{get:function(){return this.get("runDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stopDefaultCommand",{get:function(){return this.get("stopDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disable",{get:function(){return this.get("disable")},enumerable:!1,configurable:!0}),e}(tI.A),d5=(u=function(t,e){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d3=function(t){function e(e,n){return t.call(this,e,n,d2)||this}return d5(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach(function(n,o){n!==t&&(n.set("active",!1),e&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(t,e))})},e.prototype.deactivateAll=function(t,e){var n=t||"";this.forEach(function(t){t.get("context")==n&&t!==e&&t.set("active",!1,{fromCollection:!0})})},e.prototype.disableAllButtons=function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&t.set("disable",!0)})},e.prototype.disableAllButtonsExceptOne=function(t,e){this.forEach(function(n,o){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))})},e}(tF);let d4=d3;d3.prototype.model=d2;var d6=(p=function(t,e){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d7=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=o.get("buttons")||[];return o.buttons=new d4(e,r),o}return d6(e,t),e.prototype.defaults=function(){return{id:"",content:"",visible:!0,buttons:[],attributes:{}}},Object.defineProperty(e.prototype,"buttons",{get:function(){return this.get("buttons")},set:function(t){this.set("buttons",t)},enumerable:!1,configurable:!0}),e}(tI.A),d9=(d=function(t,e){return(d=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d8=function(t){function e(e,n){return t.call(this,e,n,d7)||this}return d9(e,t),e}(tF);d8.prototype.model=d7;var ft=(f=function(t,e){return(f=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fe=function(){return(fe=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},fn=function(t){function e(e){var n=t.call(this,e)||this,o=n.model,r=n.em,i=n.pfx,a=n.ppfx,s=o.className,l=o.attributes,c=l.command,u=l.listen;if(n.id=i+o.get("id"),n.activeCls="".concat(i,"active ").concat(a,"four-color"),n.disableCls="".concat(a,"disabled"),n.btnsVisCls="".concat(i,"visible"),n.className=i+"btn"+(s?" "+s:""),n.listenTo(o,"change",n.render),n.listenTo(o,"change:active updateActive",n.updateActive),n.listenTo(o,"checkActive",n.checkActive),n.listenTo(o,"change:bntsVis",n.updateBtnsVis),n.listenTo(o,"change:attributes",n.updateAttributes),n.listenTo(o,"change:className",n.updateClassName),n.listenTo(o,"change:disable",n.updateDisable),r&&(0,tw.isString)(c)&&u){var p={fromListen:!0};n.listenTo(r,"run:".concat(c),function(){return o.set("active",!0,p)}),n.listenTo(r,"stop:".concat(c),function(){return o.set("active",!1,p)})}return r&&r.get&&(n.commands=r.get("Commands")),n}return ft(e,t),e.prototype.tagName=function(){return this.model.get("tagName")},e.prototype.events=function(){return{click:"clicked"}},e.prototype.updateClassName=function(){var t=this.model,e=this.pfx,n=t.className,o=t.get("attributes").class,r="".concat(o||""," ").concat(e,"btn ").concat(n||"");this.$el.attr("class",r.trim())},e.prototype.updateAttributes=function(){var t=this.em,e=this.model,n=this.$el,o=e.get("attributes")||{},r=t&&t.t&&t.t("panels.buttons.titles.".concat(e.id));n.attr(o),r&&n.attr({title:r}),this.updateClassName()},e.prototype.updateBtnsVis=function(){this.$buttons&&(this.model.get("bntsVis")?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},e.prototype.updateActive=function(t,e,n){void 0===n&&(n={});var o,r=this.model,i=this.commands,a=this.$el,s=this.activeCls,l=n.fromCollection,c=n.fromListen,u=r.get("context"),p=r.get("options"),d=r.command,f={};d&&(i&&(0,tw.isString)(d)?f=i.get(d)||{}:(0,tw.isFunction)(d)?f=i.create({run:d}):null!==d&&(0,tw.isObject)(d)&&(f=i.create(d)),r.active?(l||null===(o=r.collection)||void 0===o||o.deactivateAll(u,r),r.set("active",!0,{silent:!0}).trigger("checkActive"),c||i.runCommand(f,fe(fe({},p),{sender:r})),f.noStop&&r.set("active",!1)):(a.removeClass(s),c||i.stopCommand(f,fe(fe({},p),{sender:r,force:1}))))},e.prototype.updateDisable=function(){var t=this.disableCls,e=this.model.disable;this.$el[e?"addClass":"removeClass"](t)},e.prototype.checkActive=function(){var t=this.model,e=this.$el,n=this.activeCls;t.active?e.addClass(n):e.removeClass(n)},e.prototype.clicked=function(){var t=this.model;t.get("bntsVis")||t.disable||!t.command||this.toggleActive()},e.prototype.toggleActive=function(){var t=this.model,e=this.em,n=t.active,o=t.togglable;(!n||o)&&(t.active=!n,n?t.runDefaultCommand&&e.runDefault():t.stopDefaultCommand&&e.stopDefault())},e.prototype.render=function(){var t=this.model,e=t.get("label"),n=this.$el;return t.get("el")||n.empty(),this.updateAttributes(),e&&n.append(e),this.checkActive(),this.updateDisable(),this},e}(t5),fo=(h=function(t,e){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fr=function(t){function e(e){var n=t.call(this,{collection:e})||this;return n.listenTo(n.collection,"add",n.addTo),n.listenTo(n.collection,"reset remove",n.render),n.className=n.pfx+"buttons",n}return fo(e,t),e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){var n=e||null,o=new fn({el:t.get("el"),model:t}).render().el;return n?n.appendChild(o):this.$el.append(o),o},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(n){return t.addToCollection(n,e)}),this.$el.append(e),this.$el.attr("class",(0,tw.result)(this,"className")),this},e}(t5),fi=(g=function(t,e){return(g=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fa=function(){return(fa=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},fs=function(t){function e(e){var n=t.call(this,{model:e,el:e.get("el")})||this;return n.className=n.pfx+"panel",n.id=n.pfx+e.get("id"),n.listenTo(e,"change:appendContent",n.appendContent),n.listenTo(e,"change:content",n.updateContent),n.listenTo(e,"change:visible",n.toggleVisible),e.view=n,n}return fi(e,t),e.prototype.appendContent=function(){this.$el.append(this.model.get("appendContent"))},e.prototype.updateContent=function(){this.$el.html(this.model.get("content"))},e.prototype.toggleVisible=function(){if(!this.model.get("visible")){this.$el.addClass("".concat(this.ppfx,"hidden"));return}this.$el.removeClass("".concat(this.ppfx,"hidden"))},e.prototype.attributes=function(){return this.model.get("attributes")},e.prototype.initResize=function(){var t=this.em,e=null==t?void 0:t.Editor,n=this.model.get("resizable");if(e&&n){var o=!0===n?[!0,!0,!0,!0]:n,r=o.length,i=void 0,a=void 0,s=void 0,l=!1;if(2==r){var c=o;i=c[0],s=c[0],a=c[1],l=c[1]}else if(4==r){var c=o;i=c[0],a=c[1],s=c[2],l=c[3]}var u=new e.Utils.Resizer(fa({tc:i,cr:a,bc:s,cl:l,tl:!1,tr:!1,bl:!1,br:!1,appendTo:this.el,silentFrames:!0,avoidContainerUpdate:!0,prefix:e.getConfig().stylePrefix,onEnd:function(){t.Canvas.refresh({all:!0})},posFetcher:function(t,e){var n=e.target,o=t.style,r=u.getConfig(),i=r.keyWidth,a=r.keyHeight,s=t.getBoundingClientRect(),l="container"==n,c=o[i],p=o[a];return{left:0,top:0,width:c&&!l?parseFloat(c):s.width,height:p&&!l?parseFloat(p):s.height}}},n&&"boolean"!=typeof n?n:{}));u.blur=function(){},u.focus(this.el)}},e.prototype.render=function(){var t=this.model.buttons,e=this.$el,n=this.ppfx,o="".concat(this.className," ").concat(this.id," ").concat(n,"one-bg ").concat(n,"two-color");if(e.addClass(o),this.toggleVisible(),t.length){var r=new fr(t);e.append(r.render().el)}return e.append(this.model.get("content")),this},e}(t5),fl=(v=function(t,e){return(v=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fc=function(t){function e(e){var n=t.call(this,{collection:e})||this;return n.listenTo(e,"add",n.addTo),n.listenTo(e,"reset",n.render),n.listenTo(e,"remove",n.onRemove),n.className=n.pfx+"panels",n}return fl(e,t),e.prototype.onRemove=function(t){var e=t.view;e&&e.remove()},e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){var n=e||null,o=t.get("el"),r=new fs(t),i=r.render().el,a=t.get("appendTo");if(o);else if(a){var s=document.querySelector(a);null==s||s.appendChild(i)}else n?n.appendChild(i):this.$el.append(i);return r.initResize(),i},e.prototype.render=function(){var t=this,e=this.$el,n=document.createDocumentFragment();return e.empty(),this.collection.each(function(e){return t.addToCollection(e,n)}),e.append(n),e.attr("class",this.className),this},e}(t5),fu=(y=function(t,e){return(y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fp=function(t){function e(e){var n=t.call(this,e,"Panels",{stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:dG,className:"fa fa-square-o",command:"core:component-outline",context:dG,attributes:{title:"View components"}},{id:d0,className:"fa fa-eye",command:d0,context:d0,attributes:{title:"Preview"}},{id:dQ,className:"fa fa-arrows-alt",command:dQ,context:dQ,attributes:{title:"Fullscreen"}},{id:dK,className:"fa fa-code",command:dK,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:dY,className:"fa fa-paint-brush",command:dY,active:!0,togglable:!1,attributes:{title:"Open Style Manager"}},{id:dJ,className:"fa fa-cog",command:dJ,togglable:!1,attributes:{title:"Settings"}},{id:dX,className:"fa fa-bars",command:dX,togglable:!1,attributes:{title:"Open Layer Manager"}},{id:dZ,className:"fa fa-th-large",command:dZ,togglable:!1,attributes:{title:"Open Blocks"}}]}]})||this;return n.panels=new d8(n,n.config.defaults),n}return fu(e,t),e.prototype.getPanels=function(){return this.panels},e.prototype.getPanelsEl=function(){var t;return null===(t=this.PanelsViewObj)||void 0===t?void 0:t.el},e.prototype.addPanel=function(t){return this.panels.add(t)},e.prototype.removePanel=function(t){return this.panels.remove(t)},e.prototype.getPanel=function(t){var e=this.panels.where({id:t});return e.length?e[0]:null},e.prototype.addButton=function(t,e){var n=this.getPanel(t);return n?n.buttons.add(e):null},e.prototype.removeButton=function(t,e){var n=this.getPanel(t);return n&&n.buttons.remove(e)},e.prototype.getButton=function(t,e){var n=this.getPanel(t);if(n){var o=n.buttons.where({id:e});return o.length?o[0]:null}return null},e.prototype.render=function(){var t;return null===(t=this.PanelsViewObj)||void 0===t||t.remove(),this.PanelsViewObj=new fc(this.panels),this.PanelsViewObj.render().el},e.prototype.active=function(){this.getPanels().each(function(t){t.buttons.each(function(t){t.get("active")&&t.trigger("updateActive")})})},e.prototype.disableButtons=function(){this.getPanels().each(function(t){t.buttons.each(function(t){t.get("disable")&&t.trigger("change:disable")})})},e.prototype.destroy=function(){this.panels.reset(),this.panels.stopListening(),this.PanelsViewObj&&this.PanelsViewObj.remove()},e}(tD),fd=(m=function(t,e){return(m=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ff=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},fh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fd(e,t),e.prototype.build=function(t,e){void 0===e&&(e={});var n=e.em,o=ff(e,["em"]);if(e.cleanId&&n){var r=n.Css.getAll().toJSON().map(function(t){var e=t.selectors,n=e&&1===e.length&&e.models[0];return n&&n.isId()&&n.get("name")}).filter(Boolean),i=o.attributes;o.attributes=function(t,e){var n=(e="function"==typeof i?i(t,e):e).id;return n&&"i"===n[0]&&!t.get("script")&&!t.get("script-export")&&!t.get("attributes").id&&0>r.indexOf(n)&&delete e.id,e}}return t.toHTML(o)},e}(tT.Kx),fg=(b=function(t,e){return(b=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fg(e,t),e.prototype.build=function(t){var e=this,n=t.toJSON();return this.beforeEach(n),(0,tw.each)(n,function(t,o){var r=n[o];r instanceof tT.Kx?n[o]=e.build(r):r instanceof tT.pM&&(n[o]=[],r.length&&r.forEach(function(t,r){n[o][r]=e.build(t)}))}),n},e.prototype.beforeEach=function(t){delete t.status},e}(tT.Kx),fy=(w=function(t,e){return(w=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fm=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fy(e,t),e.prototype.mapModel=function(t){var e,n=this,o="",r=t.get("script-export")||t.get("script"),i=t.get("type"),a=t.get("components"),s=t.getId();if(r){var l=t.get("attributes");l=(0,tw.extend)({},l,{id:s}),t.set("attributes",l,{silent:!0});var c=t.getScriptString(r),u=t.get("script-props");if(t.get("scriptUpdated")&&!u)this.mapJs[i+"-"+s]={ids:[s],code:c};else{var p=void 0,d=this.mapJs[i];if(u&&(p=t.__getScriptProps()),d)d.ids.push(s),p&&(d.props[s]=p);else{var f={ids:[s],code:c};p&&(f.props=((e={})[s]=p,e)),this.mapJs[i]=f}}}return a.forEach(function(t){o+=n.mapModel(t)}),o},e.prototype.build=function(t){this.mapJs={},this.mapModel(t);var e="";for(var n in this.mapJs){var o=this.mapJs[n];if(o.code){if(o.props){if(function(t){var e;return 0===((null===(e=t.toString().match(/\{([\s\S]*)\}/m))||void 0===e?void 0:e[1])||"").replace(/^\s*\/\/.*$/gm,"").trim().length}(o.code))continue;e+="\n var props = ".concat(JSON.stringify(o.props),";\n var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n var els = document.querySelectorAll(ids);\n for (var i = 0, len = els.length; i < len; i++) {\n var el = els[i];\n (").concat(o.code,".bind(el))(props[el.id]);\n }")}else{var r="#"+o.ids.join(", #");e+="\n var items = document.querySelectorAll('".concat(r,"');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){\n").concat(o.code,"\n}.bind(items[i]))();\n }")}}}return e},e}(tT.Kx),fb=(_=function(t,e){return(_=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fw=function(){return(fw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};(0,t_.hasWin)()&&(ts=tm(4408),tm(8253),tm(7389),tm(3640));var f_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fb(e,t),e.prototype.defaults=function(){return{input:"",label:"",codeName:"",theme:"hopscotch",readOnly:!0,lineNumbers:!0,autoFormat:!0}},e.prototype.init=function(t){return(0,tw.bindAll)(this,"onChange"),this.editor=ts.fromTextArea(t,fw({dragDrop:!1,lineWrapping:!0,mode:this.get("codeName")},this.attributes)),this.element=t,this.editor.on("change",this.onChange),this},e.prototype.onChange=function(){this.trigger("update",this)},e.prototype.getEditor=function(){return this.editor},e.prototype.getElement=function(){return this.element},e.prototype.setElement=function(t){return this.element=t,this},e.prototype.refresh=function(){return this.getEditor().refresh(),this},e.prototype.focus=function(){return this.getEditor().focus(),this},e.prototype.getContent=function(){var t=this.getEditor();return t&&t.getValue()},e.prototype.setContent=function(t,e){var n=this;void 0===e&&(e={});var o=this.editor;if(o){o.setValue(t);var r=this.get("autoFormat");o.autoFormatRange&&(!0===r||Array.isArray(r)&&r.includes(this.get("codeName")))&&(ts.commands.selectAll(o),o.autoFormatRange(o.getCursor(!0),o.getCursor(!1)),ts.commands.goDocStart(o)),e.noRefresh||setTimeout(function(){return n.refresh()})}},e}(tT.Kx);f_.prototype.CodeMirror=ts;var fC=(C=function(t,e){return(C=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fC(e,t),e.prototype.template=function(t){var e,n,o=t.pfx,r=t.codeName,i=t.label;return tC(tl||(e=['\n <div class="','editor" id="',"",'">\n <div id="','title">','</div>\n <div id="','code"></div>\n </div>\n '],n=['\n <div class="','editor" id="',"",'">\n <div id="','title">','</div>\n <div id="','code"></div>\n </div>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,tl=e),o,o,r,o,i,o)},e.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},e.prototype.render=function(){var t,e=this.model,n=this.pfx,o=this.$el,r=e.toJSON(),i=e.get("input")||(null===(t=e.getElement)||void 0===t?void 0:t.call(e));return r.pfx=n,o.html(this.template(r)),o.attr("class","".concat(n,"editor-c")),o.find("#".concat(n,"code")).append(i),this},e}(tT.Ss),fS=(x=function(t,e){return(x=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fO=function(){return(fO=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},fT=function(t){function e(e){var n=t.call(this,e,"CodeManager",{stylePrefix:"cm-",optsCodeViewer:{}})||this;n.EditorView=fx;var o=n.config,r=o.pStylePrefix;return r&&(o.stylePrefix=r+o.stylePrefix),n.generators={},n.viewers={},n.defGenerators={html:new fh,css:new iW,json:new fv,js:new fm},n.defViewers={CodeMirror:new f_},n.loadDefaultGenerators().loadDefaultViewers(),n}return fS(e,t),e.prototype.addGenerator=function(t,e){return this.generators[t]=e,this},e.prototype.getGenerator=function(t){return this.generators[t]},e.prototype.getGenerators=function(){return this.generators},e.prototype.addViewer=function(t,e){return this.viewers[t]=e,this},e.prototype.getViewer=function(t){return this.viewers[t]},e.prototype.getViewers=function(){return this.viewers},e.prototype.createViewer=function(t){void 0===t&&(t={});var e=(0,tw.isUndefined)(t.type)?"CodeMirror":t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),o=document.createElement("div"),r=document.createElement("textarea");return o.appendChild(r),n.set(fO(fO({},this.config.optsCodeViewer),t)),n.init(r),n.setElement(o),n},e.prototype.updateViewer=function(t,e){t.setContent(e)},e.prototype.getCode=function(t,e,n){void 0===n&&(n={}),n.em=this.em;var o=this.getGenerator(e);return o?o.build(t,n):""},e.prototype.loadDefaultGenerators=function(){for(var t in this.defGenerators)this.addGenerator(t,this.defGenerators[t]);return this},e.prototype.loadDefaultViewers=function(){for(var t in this.defViewers)this.addViewer(t,this.defViewers[t]);return this},e.prototype.destroy=function(){},e}(tD),fP=tm(4729),fE=tm.n(fP);(S=tc||(tc={})).update="update",S.updateBefore="updateBefore",S.undo="undo",S.redo="redo",S.load="load",S.projectLoad="project:load",S.projectLoaded="project:loaded",S.projectGet="project:get",S.log="log",S.telemetryInit="telemetry:init",S.destroy="destroy",S.destroyed="destroyed";var fk=(O=function(t,e){return(O=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fA=function(){return(fA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},fj=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},fM=function(t){return t.avoidStore||t.noUndo||t.partial},fD=function(t){return Object.keys(t.changedAttributes())},fL=new WeakMap,fI=function(t){function e(e){var n=t.call(this,e,"UndoManager",{maximumStackLength:500,trackSelection:!0})||this;return n.config._disable&&(n.config.maximumStackLength=0),n.um=new(fE())(fA({track:!0,register:[]},n.config)),n.um.changeUndoType("change",{condition:function(t){var e=t.get("_undo");if(e){var n=t.get("_undoexc");if((0,tw.isArray)(n)&&fD(t).some(function(t){return n.indexOf(t)>=0}))return!1;if((0,tw.isBoolean)(e)||(0,tw.isArray)(e)&&fD(t).some(function(t){return e.indexOf(t)>=0}))return!0}return!1},on:function(t,e,n){var o=fL.get(t);o||(o=t.previousAttributes(),fL.set(t,o));var r=n||e||{};if(r.noUndo&&setTimeout(function(){fL.delete(t)}),!fM(r)){var i=t.toJSON({fromUndo:!0}),a={object:t,before:o,after:i};if(fL.delete(t),!(0,tw.isEmpty)(i))return a}}}),n.um.changeUndoType("add",{on:function(t,e,o){if(void 0===o&&(o={}),!fM(o)&&n.isRegistered(e))return{object:e,before:void 0,after:t,options:fA(fA({},o),{fromUndo:!0})}}}),n.um.changeUndoType("remove",{on:function(t,e,o){if(void 0===o&&(o={}),!fM(o)&&n.isRegistered(e))return{object:e,before:t,after:void 0,options:fA(fA({},o),{fromUndo:!0})}}}),n.um.changeUndoType("reset",{undo:function(t,e){t.reset(e,{fromUndo:!0})},redo:function(t,e,n){t.reset(n,{fromUndo:!0})},on:function(t,e){if(void 0===e&&(e={}),!fM(e)&&n.isRegistered(t))return{object:t,before:e.previousModels,after:fj([],t.models,!0),options:fA(fA({},e),{fromUndo:!0})}}}),n.um.on("undo redo",function(){e.getSelectedAll().map(function(t){return t.trigger("rerender:layer")})}),[tc.undo,tc.redo].forEach(function(t){return n.um.on(t,function(){return e.trigger(t)})}),n}return fk(e,t),e.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get("selected"))},e.prototype.add=function(t){return this.um.register(t),this},e.prototype.remove=function(t){return this.um.unregister(t),this},e.prototype.removeAll=function(){return this.um.unregisterAll(),this},e.prototype.start=function(){return this.um.startTracking(),this},e.prototype.stop=function(){return this.um.stopTracking(),this},e.prototype.undo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return e.isEditing()||n.undo(t),this},e.prototype.undoAll=function(){return this.um.undoAll(),this},e.prototype.redo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return e.isEditing()||n.redo(t),this},e.prototype.redoAll=function(){return this.um.redoAll(),this},e.prototype.hasUndo=function(){return!!this.um.isAvailable("undo")},e.prototype.hasRedo=function(){return!!this.um.isAvailable("redo")},e.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},e.prototype.getStack=function(){return this.um.stack},e.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach(function(n){var o=n.get("magicFusionIndex");0>e.indexOf(o)&&(e.push(o),t.push(n))}),t},e.prototype.skip=function(t){var e=!!this.um.isTracking();e&&this.stop(),t(),e&&this.start()},e.prototype.getGroupedStack=function(){var t={},e=this.getStack(),n=function(t,e){var n=t.attributes,o=n.type,r=n.after,i=n.before,a=n.object,s=n.options;return{index:e,type:o,after:r,before:i,object:a,options:void 0===s?{}:s}};return e.forEach(function(e,o){var r=e.get("magicFusionIndex"),i=n(e,o);t[r]?t[r].push(i):t[r]=[i]}),Object.keys(t).map(function(e){var n=t[e];return{index:n[n.length-1].index,actions:n,labels:(0,tw.unique)(n.reduce(function(t,e){var n,o=null===(n=e.options)||void 0===n?void 0:n.action;return o&&t.push(o),t},[]))}})},e.prototype.goToGroup=function(t){var e=this;if(t){var n=this.getPointer(),o=t.index-n;(0,tw.times)(Math.abs(o),function(){e[o<0?"undo":"redo"](!1)})}},e.prototype.getPointer=function(){return this.getStack().pointer},e.prototype.clear=function(){return this.um.clear(),this},e.prototype.getInstance=function(){return this.um},e.prototype.destroy=function(){this.clear().removeAll()},e}(tD),fN=function(){return(fN=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};(T=tu||(tu={}))[T.ACTIVE=1]="ACTIVE",T[T.INACTIVE=0]="INACTIVE",T[T.DISABLED=-1]="DISABLED";var fR="_rte",fV={ACTIVE:1,INACTIVE:0,DISABLED:-1},fF=function(t,e){void 0===e&&(e="A");var n=t.selection()||{},o=n.anchorNode,r=n.focusNode,i=null==o?void 0:o.parentNode,a=null==r?void 0:r.parentNode;return(null==i?void 0:i.nodeName)==e||(null==a?void 0:a.nodeName)==e},fH="data-selectme",fU={bold:{name:"bold",icon:"<b>B</b>",attributes:{title:"Bold"},result:function(t){return t.exec("bold")}},italic:{name:"italic",icon:"<i>I</i>",attributes:{title:"Italic"},result:function(t){return t.exec("italic")}},underline:{name:"underline",icon:"<u>U</u>",attributes:{title:"Underline"},result:function(t){return t.exec("underline")}},strikethrough:{name:"strikethrough",icon:"<s>S</s>",attributes:{title:"Strike-through"},result:function(t){return t.exec("strikeThrough")}},link:{icon:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" />\n </svg>',name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},state:function(t){return t&&t.selection()&&fF(t)?fV.ACTIVE:fV.INACTIVE},result:function(t){fF(t)?t.exec("unlink"):t.insertHTML('<a href="" '.concat(fH,">").concat(t.selection(),"</a>"),{select:!0})}},wrap:{name:"wrap",icon:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z" />\n </svg>',attributes:{title:"Wrap for style"},state:function(t){return(null==t?void 0:t.selection())&&fF(t,"SPAN")?fV.DISABLED:fV.INACTIVE},result:function(t){fF(t,"SPAN")||t.insertHTML("<span ".concat(fH,">").concat(t.selection(),"</span>"),{select:!0})}}},fB=function(){function t(t,e,n){void 0===n&&(n={});var o=this;if(this.em=t,this.settings=n,e[fR])return e[fR];e[fR]=this,this.setEl(e),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var r=(n.actions||[]).map(function(t){var e=t;return(0,tw.isString)(t)?e=fN({},fU[t]):fU[t.name]&&(e=fN(fN({},fU[t.name]),t)),e}),i=r.length?r:Object.keys(fU).map(function(t){return fU[t]});n.classes=fN({actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},n.classes);var a=n.classes,s=n.actionbar;if(this.actionbar=s,this.classes=a,this.actions=i,!s){if(!this.isCustom(n.module)){var l=n.actionbarContainer;(s=document.createElement("div")).className=a.actionbar,null==l||l.appendChild(s),this.actionbar=s}i.forEach(function(t){return o.addAction(t)})}return n.styleWithCSS&&this.exec("styleWithCSS"),this}return t.prototype.isCustom=function(t){var e=t||this.em.RichTextEditor;return!!((null==e?void 0:e.config.custom)||(null==e?void 0:e.customRte))},t.prototype.destroy=function(){},t.prototype.setEl=function(t){this.el=t,this.doc=t.ownerDocument},t.prototype.updateActiveActions=function(){var t=this,e=this.getActions();e.forEach(function(e){var n=e.update,o=e.btn,r=t.classes,i=r.active,a=r.inactive,s=r.disabled,l=e.state,c=e.name,u=t.doc,p=tu.INACTIVE;if(o&&(o.className=o.className.replace(i,"").trim(),o.className=o.className.replace(a,"").trim(),o.className=o.className.replace(s,"").trim()),l){var d=l(t,u);if(p=d,o)switch(d){case fV.ACTIVE:o.className+=" ".concat(i);break;case fV.INACTIVE:o.className+=" ".concat(a);break;case fV.DISABLED:o.className+=" ".concat(s)}}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(o&&(o.className+=" ".concat(i)),p=tu.ACTIVE);e.currentState=p,null==n||n(t,e)}),e.length&&this.em.RichTextEditor.__dbdTrgCustom()},t.prototype.enable=function(t){return this.enabled?this:this.__toggleEffects(!0,t)},t.prototype.disable=function(){return this.__toggleEffects(!1)},t.prototype.__toggleEffects=function(t,e){void 0===t&&(t=!1),void 0===e&&(e={});var n=t?t3.on:t3.AU,o=this.el,r=this.doc,i=this.actionbarEl();if(i&&(i.style.display=t?"":"none"),o.contentEditable="".concat(!!t),n(o,"mouseup keyup",this.updateActiveActions),n(r,"keydown",this.__onKeydown),n(r,"paste",this.__onPaste),this.enabled=t,t){var a=e.event;if(this.syncActions(),this.updateActiveActions(),a){var s=null;if(r.caretRangeFromPoint){var l=(0,t3.G2)(a);s=r.caretRangeFromPoint(l.clientX,l.clientY)}else a.rangeParent&&(s=r.createRange()).setStart(a.rangeParent,a.rangeOffset);var c=r.getSelection();null==c||c.removeAllRanges(),s&&(null==c||c.addRange(s))}o.focus()}return this},t.prototype.__onKeydown=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onKeydown;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var o=this.doc;"Enter"!==t.key||["insertOrderedList","insertUnorderedList"].some(function(t){return o.queryCommandState(t)})||(o.execCommand("insertLineBreak"),t.preventDefault())},t.prototype.__onPaste=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onPaste;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var o=t.clipboardData,r=o.getData("text"),i=o.getData("text/html");if(r&&!i){t.preventDefault();var a=r.replace(/(?:\r\n|\r|\n)/g,"<br/>");this.doc.execCommand("insertHTML",!1,a)}},t.prototype.syncActions=function(){var t=this;this.getActions().forEach(function(e){if(t.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||"click",o=e.btn;o&&(o["on".concat(n)]=function(){e.result(t,e),t.updateActiveActions()})}})},t.prototype.addAction=function(t,e){void 0===e&&(e={});var n=e.sync,o=this.actionbarEl();if(o){var r=t.icon,i=t.attributes,a=void 0===i?{}:i,s=document.createElement("span");for(var l in s.className=this.classes.button,t.btn=s,a)s.setAttribute(l,a[l]);"string"==typeof r?s.innerHTML=r:s.appendChild(r),o.appendChild(s)}n&&(this.actions.push(t),this.syncActions())},t.prototype.getActions=function(){return this.actions},t.prototype.selection=function(){return this.doc.getSelection()},t.prototype.exec=function(t,e){this.doc.execCommand(t,!1,e)},t.prototype.actionbarEl=function(){return this.actionbar},t.prototype.insertHTML=function(t,e){var n=(void 0===e?{}:e).select,o=this.em,r=this.doc,i=this.el,a=r.getSelection();if(a&&a.rangeCount){var s=(0,t_.getComponentModel)(i)||o.getSelected(),l=r.createElement("div"),c=a.getRangeAt(0);c.deleteContents(),(0,tw.isString)(t)?l.innerHTML=t:t&&l.appendChild(t),Array.prototype.slice.call(l.childNodes).forEach(function(t){c.insertNode(t)}),a.removeAllRanges(),a.addRange(c),i.focus(),n&&s&&(s.once("rte:disable",function(){var t=s.find("[".concat(fH,"]"))[0];t&&(o.setSelected(t),t.removeAttributes(fH))}),s.trigger("disable"))}},t}();(P=tp||(tp={})).enable="rte:enable",P.disable="rte:disable",P.custom="rte:custom";var fz=(E=function(t,e){return(E=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}E(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fW=function(){return(fW=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},f$=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},fq=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},fG=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},fK="".concat(tH.refresh," frame:scroll ").concat(tQ.I.update),fY=function(t){function e(e){var n=t.call(this,e,"RichTextEditor",{stylePrefix:"rte-",adjustToolbar:!0,actions:["bold","italic","underline","strikethrough","link","wrap"],custom:!1})||this;n.events=tp;var o=n.config,r=o.pStylePrefix;r&&(o.stylePrefix=r+o.stylePrefix),n.pfx=o.stylePrefix,n.actions=o.actions||[];var i=new tT.Kx;return n.model=i,i.on("change:currentView",n.__trgCustom,n),n.__dbdTrgCustom=(0,tw.debounce)(function(){return n.__trgCustom()},0),n}return fz(e,t),e.prototype.onLoad=function(){if((0,t_.hasWin)()){var t=this.config,e=t.pStylePrefix,n=t.custom,o=(0,t3.a_)("div",{class:(0,t3.cx)("".concat(e,"rte-toolbar"),!n&&"".concat(e,"one-bg ").concat(e,"rte-toolbar-ui"))});this.toolbar=o,this.initRte((0,t3.a_)("div")),(0,t3.on)(o,"mousedown",function(t){return t.stopPropagation()})}},e.prototype.__trgCustom=function(){var t=this.model,e=this.em,n=this.events;e.trigger(n.custom,{enabled:!!t.get("currentView"),container:this.getToolbarEl(),actions:this.getAll()})},e.prototype.destroy=function(){var t,e,n;null===(t=this.globalRte)||void 0===t||t.destroy(),null===(n=null===(e=this.customRte)||void 0===e?void 0:e.destroy)||void 0===n||n.call(e),this.model.stopListening().clear({silent:!0}),this.__dbdTrgCustom.cancel(),(0,t3.YZ)(this.toolbar)},e.prototype.postRender=function(t){var e=t.model.get("Canvas");this.toolbar.style.pointerEvents="all",this.hideToolbar(),e.getToolsEl().appendChild(this.toolbar)},e.prototype.initRte=function(t){var e=this.globalRte,n=this.em,o=this.pfx,r=this.actionbar,i=this.config,a=this.actions||fG([],i.actions,!0);return e?(e.em=n,e.setEl(t)):(e=new fB(n,t,{classes:{actionbar:"".concat(o,"actionbar"),button:"".concat(o,"action"),active:"".concat(o,"active"),inactive:"".concat(o,"inactive"),disabled:"".concat(o,"disabled")},actions:a,actionbar:r,actionbarContainer:this.toolbar,module:this}),this.globalRte=e),e.actionbar&&(this.actionbar=e.actionbar),e.actions&&(this.actions=e.actions),e},e.prototype.add=function(t,e){var n;void 0===e&&(e={}),e.name=t,null===(n=this.globalRte)||void 0===n||n.addAction(e,{sync:!0})},e.prototype.get=function(t){var e,n;return null===(e=this.globalRte)||void 0===e||e.getActions().forEach(function(e){e.name==t&&(n=e)}),n},e.prototype.getAll=function(){var t;return(null===(t=this.globalRte)||void 0===t?void 0:t.getActions())||[]},e.prototype.remove=function(t){var e,n=this.getAll(),o=this.get(t);if(o){var r=o.btn,i=n.indexOf(o);null===(e=null==r?void 0:r.parentNode)||void 0===e||e.removeChild(r),n.splice(i,1)}return o},e.prototype.run=function(t){var e=this.globalRte,n=(0,tw.isString)(t)?this.get(t):t;e&&n&&(n.result(e,n),e.updateActiveActions())},e.prototype.getToolbarEl=function(){return this.toolbar},e.prototype.updatePosition=function(){var t=this.em,e=this.toolbar,n=t.Canvas,o=e.style,r=n.getTargetToElementFixed(this.lastEl,e,{event:"rteToolbarPosUpdate",left:0});["top","left","bottom","right"].forEach(function(t){var e=r[t];(0,t_.isDef)(e)&&(o[t]=(0,tw.isString)(e)?e:(e||0)+"px")})},e.prototype.enable=function(t,e,n){return f$(this,void 0,void 0,function(){var o,r,i,a,s,l;return fq(this,function(c){switch(c.label){case 0:return this.lastEl=t.el,o=this,r=o.customRte,i=o.em,a=o.events,s=t.getChildrenContainer(),this.toolbar.style.display="",[4,r?r.enable(s,e,n):this.initRte(s).enable(n)];case 1:return l=c.sent(),i&&(setTimeout(this.updatePosition.bind(this),0),i.off(fK,this.updatePosition,this),i.on(fK,this.updatePosition,this),i.trigger(a.enable,t,l)),this.model.set({currentView:t}),[2,l]}})})},e.prototype.getContent=function(t,e){return f$(this,void 0,void 0,function(){var n,o;return fq(this,function(r){switch(r.label){case 0:if(n=this.customRte,o=t.getChildrenContainer(),!(n&&e&&(0,tw.isFunction)(n.getContent)))return[3,2];return[4,n.getContent(o,e,{view:t})];case 1:return[2,r.sent()];case 2:return[2,o.innerHTML]}})})},e.prototype.hideToolbar=function(){var t=this.toolbar.style,e="-1000px";t.top=e,t.left=e,t.display="none"},e.prototype.disable=function(t,e){return f$(this,arguments,void 0,function(t,e,n){var o,r,i,a,s,l;return void 0===n&&(n={}),fq(this,function(c){switch(c.label){case 0:if(o={},r=this,i=r.em,a=r.events,!(s=this.customRte))return[3,2];return[4,s.disable(t.getChildrenContainer(),e,fW(fW({},n),{view:t}))];case 1:return(l=c.sent())&&(o=l),[3,3];case 2:e&&e.disable(),c.label=3;case 3:return this.hideToolbar(),i&&(i.off(fK,this.updatePosition,this),n.fromMove||i.trigger(a.disable,t,e)),this.model.unset("currentView"),[2,o]}})})},e}(tD),fJ=(k=function(t,e){return(k=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}k(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),fX=function(){return(fX=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},fZ=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},fQ=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},f0=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fJ(e,t),e.getDefaults=function(){return(0,tw.result)(this.prototype,"defaults")},e.prototype.defaults=function(){return{name:"",property:"",type:"",defaults:"",info:"",value:"",icon:"",functionName:"",status:"",visible:!0,fixedValues:["initial","inherit"],full:!1,important:!1,toRequire:!1,requires:void 0,requiresParent:null,parentTarget:null}},e.prototype.initialize=function(t,n){void 0===t&&(t={}),void 0===n&&(n={}),this.em=n.em;var o=this.getId()||"",r=this.get("name")||this.get("label")||"";this.get("property")||this.set("property",(r||o).replace(/ /g,"-"));var i=this.get("property");this.get("id")||this.set("id",i),r||this.set("name",(0,t_.capitalize)(i).replace(/-/g," ")),this.on("change",this.__upTargets),e.callInit(this,t,n)},e.prototype.__getParentProp=function(){var t,e;return null===(e=null===(t=this.collection)||void 0===t?void 0:t.opts)||void 0===e?void 0:e.parentProp},e.prototype.__upTargets=function(t,e){var n,o=this;void 0===e&&(e={});var r=this.em.Styles,i=this.getName(),a=e.__clear,s=a?"":this.__getFullValue(e),l=this.__getParentProp(),c=this.changedAttributes(),u=(0,tw.keys)(c).reduce(function(t,e){return t[e]=o.previous(e),t},{}),p=fQ(fQ([],(0,tw.keys)(this.__getClearProps()),!0),["__p"],!1),d=(0,tw.keys)(c),f=!e.__up&&!l&&(a||p.some(function(t){return d.indexOf(t)>=0})),h=this.get("onChange"),g={property:this,from:u,to:c,value:s,opts:e};r.__trgEv(r.events.propertyUpdate,g),h&&h(g),f&&this.__upTargetsStyle(((n={})[i]=s,n),e)},e.prototype.__upTargetsStyle=function(t,e){var n,o=null===(n=this.em)||void 0===n?void 0:n.get("StyleManager");null==o||o.addStyleTargets(fX(fX({},t),{__p:!!e.avoidStore}),e)},e.prototype._up=function(t,e){void 0===e&&(e={}),e.noTarget&&(e.__up=!0);var n=e.partial,o=fZ(e,["partial"]);return t.__p=!!(o.avoidStore||n),this.set(t,fX(fX({},o),{avoidStore:t.__p}))},e.prototype.up=function(t,e){void 0===e&&(e={}),this.set(t,fX(fX({},e),{__up:!0}))},e.prototype.init=function(){},e.prototype.getId=function(){return this.get("id")},e.prototype.getType=function(){return this.get("type")},e.prototype.getName=function(){return this.get("property")},e.prototype.getLabel=function(t){void 0===t&&(t={});var e,n=t.locale,o=this.getId(),r=this.get("name")||this.get("label");return(void 0===n||n)&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.properties.".concat(o)))||r},e.prototype.getValue=function(t){void 0===t&&(t={});var e=t.noDefault,n=this.get("value");return this.hasValue()||e?n:this.getDefaultValue()},e.prototype.hasValue=function(t){void 0===t&&(t={});var e=t.noParent&&this.getParentTarget(),n=this.get("value");return!(0,tw.isUndefined)(n)&&""!==n&&!e},e.prototype.hasValueParent=function(){return this.hasValue()&&!this.hasValue({noParent:!0})},e.prototype.getStyle=function(t){void 0===t&&(t={});var e,n=this.getName(),o=t.camelCase?(0,t_.camelCase)(n):n;return(e={})[o]=this.__getFullValue(t),e},e.prototype.getDefaultValue=function(){var t=this.get("default");return"".concat((0,tw.isUndefined)(t)?this.get("defaults"):t)},e.prototype.upValue=function(t,e){void 0===e&&(e={});var n=null===t||""===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)},e.prototype.isVisible=function(){return!!this.get("visible")},e.prototype.clear=function(t){return void 0===t&&(t={}),this._up(this.__getClearProps(),fX(fX({},t),{__clear:!0})),this},e.prototype.canClear=function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})},e.prototype.getParent=function(){return this.__getParentProp()},e.prototype.isFull=function(){return!!this.get("full")},e.prototype.__parseValue=function(t,e){return this.parseValue(t,e)},e.prototype.__getClearProps=function(){return{value:"",important:!1}},e.prototype.setValue=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var o=this.parseValue(t),r=!e;r||this.set({value:void 0},{avoidStore:r,silent:!0}),this.set(o,fX({avoidStore:r},n))},e.prototype.setValueFromInput=function(t,e,n){void 0===n&&(n={}),this.setValue(t,e,fX(fX({},n),{fromInput:1}))},e.prototype.parseValue=function(t,e){void 0===e&&(e={});var n={value:t},o="!important",r=this.get("functionName")||"";if((0,tw.isString)(t)&&-1!==t.indexOf(o)&&(n.value=t.replace(o,"").trim(),n.important=!0),!r&&!e.complete)return n;var i=[],a="".concat(n.value).trim(),s=a.indexOf("(")+1,l=r||a.substring(0,s-1);if(l&&(n.functionName=l),!r||0===a.indexOf("".concat(r,"("))){var c=a.lastIndexOf(")");i.push(s),c>=0&&i.push(c),n.value=String.prototype.substring.apply(a,i)}if(e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,""),n.value=u}return n},e.prototype.__getFullValue=function(t){var e=(void 0===t?{}:t).withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()},e.prototype.getFullValue=function(t,e){void 0===e&&(e={});var n=this.get("functionName"),o=this.getDefaultValue(),r=(0,tw.isUndefined)(t)?this.get("value"):t,i=this.hasValue();if(r&&o&&r===o)return o;if(n&&i){var a="url"===n?"'".concat(r.replace(/'|"/g,""),"'"):r;r="".concat(n,"(").concat(a,")")}return i&&this.get("important")&&!e.skipImportant&&(r="".concat(r," !important")),r||""},e.prototype.__setParentTarget=function(t){this.up({parentTarget:t})},e.prototype.getParentTarget=function(){return this.get("parentTarget")||null},e.prototype.__parseFn=function(t){void 0===t&&(t="");var e=t.indexOf("(")+1,n=t.lastIndexOf(")");return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}},e.prototype.__checkVisibility=function(t){var e=t.target,n=t.component,o=t.sector,r=t.sectors,i=n||e;if(!i)return!1;var a=this.getId(),s=this.getName(),l=this.attributes,c=l.requires,u=l.requiresParent,p=l.toRequire,d=l.isVisible,f=i.get("unstylable"),h=i.get("stylable-require"),g=i.get("stylable");if((0,tw.isFunction)(d))return!!d({property:this,sector:o,target:e,component:n});if((0,tw.isArray)(g)&&(g=g.indexOf(s)>=0),(0,tw.isArray)(f)&&(g=0>f.indexOf(s)),p&&(g=!e||h&&(h.indexOf(a)>=0||h.indexOf(s)>=0)),r&&c){var v=(0,tw.keys)(c);r.forEach(function(t){t.getProperties().forEach(function(t){if((0,tw.includes)(v,t.id)){var e=c[t.id];g=g&&(0,tw.includes)(e,t.get("value"))}})})}if(u){var y=n&&n.parent(),m=y&&y.getEl();if(m){var b=(0,t_.hasWin)()?window.getComputedStyle(m):{};(0,tw.each)(u,function(t,e){g=g&&b[e]&&(0,tw.includes)(t,b[e])})}else g=!1}return!!g},e}(tT.Kx);f0.callParentInit=function(t,e,n,o){void 0===o&&(o={}),t.prototype.initialize.apply(e,[n,fX(fX({},o),{skipInit:1})])},f0.callInit=function(t,e,n){void 0===n&&(n={}),n.skipInit||t.init(e,n)};var f1=(A=function(t,e){return(A=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}A(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f2=function(){return(f2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},f5=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},f3=function(t){return"integer"===t||"number"===t},f4=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f1(e,t),e.prototype.defaults=function(){return f2(f2({},f0.getDefaults()),{detached:!1,properties:[],separator:" ",join:null,fromStyle:null,toStyle:null,full:!0})},e.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),f0.callParentInit(f0,this,t,e);var n=this.em,o=new hG(this.get("properties")||[],{em:n,parentProp:this});this.set("properties",o,{silent:!0}),this.listenTo(o,"change",this.__upProperties),f0.callInit(this,t,e)},Object.defineProperty(e.prototype,"properties",{get:function(){return this.get("properties")||[]},enumerable:!1,configurable:!0}),e.prototype.getProperties=function(){return f5([],this.get("properties").models,!0)},e.prototype.getProperty=function(t){return this.properties.filter(function(e){return e.getId()===t||e.getName()===t})[0]},e.prototype.getPropertyAt=function(t){return this.get("properties").at(t)},e.prototype.isDetached=function(){return!!this.get("detached")},e.prototype.getValues=function(t){var e=(void 0===t?{}:t).byName;return this.getProperties().reduce(function(t,n){return t[e?n.getName():n.getId()]="".concat(n.__getFullValue()),t},{})},e.prototype.getSeparator=function(){return this.getSplitSeparator()},e.prototype.getJoin=function(){return this.__getJoin()},e.prototype.getStyleFromProps=function(t){void 0===t&&(t={});var e,n=this.getName(),o=this.__getJoin(),r=this.get("toStyle"),i=this.getValues(),a={};if(r)a=r(i,{join:o,name:n,property:this});else if(i=this.getValues({byName:!0}),this.isDetached())a=i;else{var s=this.getProperties().map(function(t){return t.__getFullValue({withDefault:1})}).filter(Boolean).join(o);(e={})[n]=s,a=e}return this.isDetached()?a[n]="":(a[n]=a[n]||"",a=f2(f2({},a),this.getProperties().reduce(function(t,e){return t[e.getName()]="",t},{}))),t.camelCase?Object.keys(a).reduce(function(t,e){return t[(0,t_.camelCase)(e)]=a[e],t},{}):a},e.prototype.getSplitSeparator=function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},e.prototype.__upProperties=function(t,e){if(void 0===e&&(e={}),!e.__up&&!e.__clearIn){var n=this.__getParentProp();if(n)return n.__upProperties(this,e);this.__upTargetsStyleProps(e,t)}},e.prototype.__upTargetsStyleProps=function(t,e){void 0===t&&(t={});var n,o=this.getStyleFromProps();if(this.isDetached()&&e){var r=e.getName();(n={})[r]=o[r],o=n}this.__upTargetsStyle(o,t)},e.prototype._up=function(t,e){return void 0===e&&(e={}),this.__setProperties(this.__getSplitValue(t.value),e),f0.prototype._up.call(this,t,e),this},e.prototype.getStyle=function(t){return this.getStyleFromProps(t)},e.prototype.__getFullValue=function(t){return(void 0===t&&(t={}),this.isDetached()||t.__clear)?"":nn(this.getStyleFromProps()[this.getName()]||"")},e.prototype.__getJoin=function(){var t=this.get("join");return(0,tw.isString)(t)?t:this.get("separator")},e.prototype.__styleHasProps=function(t){return void 0===t&&(t={}),f5([this.getName()],this.getProperties().map(function(t){return t.getName()}),!0).some(function(e){return!(0,tw.isUndefined)(t[e])&&""!==t[e]})},e.prototype.__splitValue=function(t,e){return nn(t).split(e).map(function(t){return t.trim()}).filter(Boolean)},e.prototype.__splitStyleName=function(t,e,n){var o=t[e];return this.__splitValue(o||"",n)},e.prototype.__getSplitValue=function(t,e){void 0===t&&(t="");var n=(void 0===e?{}:e).byName,o=this.getProperties(),r=4===o.length&&o.every(function(t){return f3(t.getType())}),i=this.__splitValue(t,this.getSplitSeparator()),a={};return o.forEach(function(t,e){var o=i[e],s=(0,tw.isUndefined)(o)?"":o;if(r){var l=i.length;s=i[e]||i[e%l+(1!=l&&l%2?1:0)]||s}a[n?t.getName():t.getId()]=s||""}),a},e.prototype.__getPropsFromStyle=function(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!this.__styleHasProps(t))return null;var n=e.byName,o=this.getName(),r=this.getProperties(),i=this.getSplitSeparator(),a=this.get("fromStyle"),s=a?a(t,{property:this,name:o,separator:i}):{};if(!a){var l=t[o];s=this.__getSplitValue(l||"",{byName:n}),r.forEach(function(e){var o=t[e.getName()],r=n?e.getName():e.getId();(0,tw.isUndefined)(o)||""===o||(s[r]=o)})}return s},e.prototype.__setProperties=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.getProperties().forEach(function(n){var o=t[n.getId()];n.__getFullValue()!==o&&n.upValue(o,e)});var n=(0,tw.keys)(t).map(function(e){return t[e]}).join(" ");this.set("value",n,{silent:!0})},e.prototype.clear=function(){var t=this;return this.getProperties().map(function(e){return e.clear({__clearIn:!t.isDetached()})}),f0.prototype.clear.call(this),this},e.prototype.hasValue=function(t){return this.getProperties().some(function(e){return e.hasValue(t)})},e.prototype.getFullValue=function(){return this.__getFullValue()},e.prototype.__canClearProp=function(t){return this.isDetached()&&t.hasValue({noParent:!0})},e}(f0),f6=(j=function(t,e){return(j=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f7=function(){return(f7=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},f9=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},f8=/,(?![^\(]*\))/,ht=/\s(?![^(]*\))/,he=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f6(e,t),e.prototype.defaults=function(){return f7(f7({},f4.getDefaults()),{layers:[],emptyValue:"unset",layerSeparator:", ",layerJoin:"",prepend:0,preview:!1,layerLabel:null,selectedLayer:null})},e.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),f4.callParentInit(f4,this,t,e);var n=new cn(this.get("layers"),{prop:this});n.property=this,n.properties=this.get("properties"),this.set("layers",n,{silent:!0}),this.on("change:selectedLayer",this.__upSelected),this.listenTo(n,"add remove",this.__upLayers),f4.callInit(this,t,e)},Object.defineProperty(e.prototype,"layers",{get:function(){return this.get("layers")},enumerable:!1,configurable:!0}),e.prototype.getLayers=function(){return this.layers.models},e.prototype.hasLayers=function(){return this.getLayers().length>0},e.prototype.getLayer=function(t){return void 0===t&&(t=0),this.layers.at(t)||void 0},e.prototype.getSelectedLayer=function(){var t=this.get("selectedLayer");return t&&t.getIndex()>=0?t:void 0},e.prototype.selectLayer=function(t){return this.set("selectedLayer",t,{__select:!0})},e.prototype.selectLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},e.prototype.moveLayer=function(t,e){void 0===e&&(e=0);var n=this.layers,o=t?t.getIndex():-1;o>=0&&(0,tw.isNumber)(e)&&e>=0&&e<n.length&&o!==e&&(this.removeLayer(t),n.add(t,{at:e}))},e.prototype.addLayer=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={};return this.getProperties().forEach(function(e){var o=e.getId(),r=t[o];n[o]=(0,tw.isUndefined)(r)?e.getDefaultValue():r}),this.layers.push({values:n},e)},e.prototype.removeLayer=function(t){return this.layers.remove(t)},e.prototype.removeLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e?this.removeLayer(e):null},e.prototype.getLayerLabel=function(t){var e="";if(t){var n=this.get("layerLabel"),o=t.getValues(),r=t.getIndex();if(n)e=n(t,{index:r,values:o,property:this});else{var i=[];this.getProperties().map(function(t){i.push(o[t.getId()])}),e=i.filter(Boolean).join(" ")}}return e},e.prototype.getStyleFromLayer=function(t,e){void 0===e&&(e={});var n,o,r=this.__getJoin(),i=this.__getJoinLayers(),a=this.get("toStyle"),s=this.getName(),l=t.getValues();if(a)o=a(l,{join:r,joinLayers:i,name:s,layer:t,property:this});else{var c=this.getProperties().map(function(t){var n=t.getName(),o=l[t.getId()],r=(0,tw.isUndefined)(o)?t.getDefaultValue():o;if(e.number&&f3(t.getType())){var i=t.parseValue(o,e.number);r="".concat(i.value).concat(i.unit)}return{name:n,value:r}});o=this.isDetached()?c.reduce(function(t,e){return t[e.name]=e.value,t},{}):((n={})[this.getName()]=c.map(function(t){return t.value}).join(r),n)}return e.camelCase?Object.keys(o).reduce(function(t,e){return t[(0,t_.camelCase)(e)]=o[e],t},{}):o},e.prototype.getStylePreview=function(t,e){void 0===e&&(e={});var n={};return this.get("preview")&&(n=this.getStyleFromLayer(t,e)),n},e.prototype.getLayerSeparator=function(){var t=this.get("layerSeparator");return(0,tw.isString)(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t},e.prototype.hasEmptyValue=function(){return!this.hasLayers()&&!!this.attributes.isEmptyValue},e.prototype.__upProperties=function(t,e){void 0===e&&(e={});var n,o=this.getSelectedLayer();o&&(o.upValues(((n={})[t.getId()]=t.__getFullValue(),n)),e.__up||this.__upTargetsStyleProps(e))},e.prototype.__upLayers=function(t,e,n){this.__upTargetsStyleProps(n||e)},e.prototype.__upTargets=function(t,e){if(void 0===e&&(e={}),!e.__select)return f0.prototype.__upTargets.call(this,t,e)},e.prototype.__upTargetsStyleProps=function(t){void 0===t&&(t={}),this.__upTargetsStyle(this.getStyleFromLayers(t),t)},e.prototype.__upTargetsStyle=function(t,e){return f0.prototype.__upTargetsStyle.call(this,t,e)},e.prototype.__upSelected=function(t,e){var n=(void 0===t?{}:t).noEvent;void 0===e&&(e={});var o=this.em.Styles,r=this.getSelectedLayer(),i=null==r?void 0:r.getValues();i&&this.getProperties().forEach(function(t){var n,o=null!==(n=i[t.getId()])&&void 0!==n?n:"";t.__getFullValue()!==o&&t.upValue(o,f7(f7({},e),{__up:!0}))}),n||o.__trgEv(o.events.layerSelect,{property:this})},e.prototype._up=function(t,e){void 0===e&&(e={});var n=t.__layers,o=f9(t,["__layers"]);return this.isDetached()||this.__setLayers(void 0===n?[]:n),this.__upSelected({noEvent:!0},e),f0.prototype._up.call(this,o,e),this},e.prototype.__setLayers=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var n=this.layers,o=t.map(function(t){return{values:t}});n.length===o.length?o.map(function(t,e){var o;return null===(o=n.at(e))||void 0===o?void 0:o.upValues(t.values)}):n.reset(o),this.set({isEmptyValue:!!e.isEmptyValue}),this.__upSelected({noEvent:!0})},e.prototype.__parseValue=function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split(f8).map(function(t){return t.trim()}).map(function(t){return e.__parseLayer(t)}).filter(Boolean),n},e.prototype.__parseLayer=function(t){var e=this.get("parseLayer"),n=t.split(ht),o=this.getProperties();return e?e({value:t,values:n}):o.reduce(function(t,e,o){var r=n[o];return t[e.getId()]=(0,tw.isUndefined)(r)?e.getDefaultValue():r,t},{})},e.prototype.__getLayersFromStyle=function(t){var e=this;if(void 0===t&&(t={}),!this.__styleHasProps(t))return null;if(this.isEmptyValueStyle(t))return[];var n=this.getName(),o=this.getProperties(),r=this.getLayerSeparator(),i=this.attributes.fromStyle,a=i?i(t,{property:this,name:n,separatorLayers:r}):[];if(!i){var s=this.__splitStyleName(t,n,r).map(function(t){return t.split(e.getSplitSeparator())}).map(function(t){var e={};return o.forEach(function(n,o){var r=t[o];e[n.getId()]=(0,tw.isUndefined)(r)?n.getDefaultValue():r}),e});o.forEach(function(n){var o=n.getId();e.__splitStyleName(t,n.getName(),r).map(function(t){var e;return(e={})[o]=t||n.getDefaultValue(),e}).forEach(function(t,e){s[e]=s[e]?f7(f7({},s[e]),t):t})}),a=s}return(0,tw.isArray)(a)?a:[a]},e.prototype.getStyle=function(t){return void 0===t&&(t={}),this.getStyleFromLayers(t)},e.prototype.getStyleFromLayers=function(t){var e=this;void 0===t&&(t={});var n={},o=this.getName(),r=this.getLayers(),i=this.getProperties();if(r.map(function(n){return e.getStyleFromLayer(n,t)}).forEach(function(t){(0,tw.keys)(t).map(function(e){n[e]||(n[e]=[]),n[e].push(t[e])})}),(0,tw.keys)(n).map(function(t){n[t]=n[t].join(e.__getJoinLayers())}),this.isDetached())n[o]="",r.length||i.map(function(t){n[t.getName()]=""});else{var a=i.reduce(function(t,e){return t[e.getName()]="",t},{});n[o]=n[o]||"",n=f7(f7({},n),a)}return f7(f7({},n),t.__clear?{}:this.getEmptyValueStyle())},e.prototype.isEmptyValueStyle=function(t){void 0===t&&(t={});var e=this.getEmptyValueStyle({force:!0}),n=(0,tw.keys)(e);return!!n.length&&n.every(function(n){return e[n]===t[n]})},e.prototype.getEmptyValueStyle=function(t){void 0===t&&(t={});var e=this.attributes.emptyValue;if(!e||this.hasLayers()&&!t.force)return{};var n=this.getName(),o=this.getProperties(),r=(0,tw.isString)(e)?e:e({property:this});if(!(0,tw.isString)(r))return r;var i={};return this.isDetached()?o.map(function(t){i[t.getName()]=r}):i[n]=r,i},e.prototype.__getJoinLayers=function(){var t=this.get("layerJoin"),e=this.get("layerSeparator");return t||((0,tw.isString)(e)?e:t)},e.prototype.__getFullValue=function(){return this.get("detached")?"":nn(this.getStyleFromLayers()[this.getName()])},e.prototype.hasValue=function(t){void 0===t&&(t={});var e=t.noParent&&this.getParentTarget();return(this.hasLayers()||this.hasEmptyValue())&&!e},e.prototype.clear=function(t){return void 0===t&&(t={}),this.layers.reset(),this.__upTargetsStyleProps(f7(f7({},t),{__clear:!0})),f0.prototype.clear.call(this),this},e.prototype.__canClearProp=function(){return!1},e.prototype.__getLayers=function(){return this.layers},e}(f4),hn=(M=function(t,e){return(M=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}M(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ho=function(){return(ho=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hr=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},hi=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},ha="data-clear-style",hs=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;(0,tw.bindAll)(n,"__change","__updateStyle");var o=e.config||{},r=o.em;n.config=o,n.em=r,n.pfx=o.stylePrefix||"",n.ppfx=o.pStylePrefix||"",n.__destroyFn=n.destroy?n.destroy.bind(n):function(){};var i=n.model;i.view=n,n.onValueChange=(0,tw.debounce)(n.onValueChange.bind(n),10),n.updateStatus=(0,tw.debounce)(n.updateStatus.bind(n),0),n.listenTo(i,"destroy remove",n.remove),n.listenTo(i,"change:visible",n.updateVisibility),n.listenTo(i,"change:name change:className change:full",n.render),n.listenTo(i,"change:value",n.onValueChange),n.listenTo(i,"change:parentTarget",n.updateStatus),n.listenTo(r,"change:device",n.onValueChange);var a=n.init&&n.init.bind(n);return a&&a(),n}return hn(e,t),e.prototype.events=function(){var t;return(t={change:"inputValueChanged"})["click [".concat(ha,"]")]="clear",t},e.prototype.template=function(t){var e=this.pfx,n=this.ppfx;return'\n <div class="'.concat(e,'label" data-sm-label></div>\n <div class="').concat(n,'fields" data-sm-fields></div>\n ')},e.prototype.templateLabel=function(t){var e=this.pfx,n=this.em,o=t.parent,r=t.attributes,i=r.icon,a=r.info,s=null==n?void 0:n.getConfig().icons,l=(null==s?void 0:s.close)||"";return'\n <span class="'.concat(e,"icon ").concat(void 0===i?"":i,'" title="').concat(void 0===a?"":a,'">\n ').concat(t.getLabel(),"\n </span>\n ").concat(o?"":'<div class="'.concat(e,'clear" style="display: none" ').concat(ha,">").concat(l,"</div>"),"\n ")},e.prototype.templateInput=function(t){return'\n <div class="'.concat(this.ppfx,'field">\n <input placeholder="').concat(t.getDefaultValue(),'"/>\n </div>\n ')},e.prototype.remove=function(){var t=this;return tT.Ss.prototype.remove.apply(this,arguments),["em","input","$input","view"].forEach(function(e){return t[e]=null}),this.__destroyFn(this._getClbOpts()),this},e.prototype.updateStatus=function(){var t,e=this.model,n=this.pfx,o=this.ppfx,r=this.config,i="".concat(o,"four-color"),a="".concat(o,"color-warn"),s=this.$el.children(".".concat(n,"label")),l=this.getClearEl(),c=l?l.style:{};s.removeClass("".concat(i," ").concat(a)),c.display="none",e.hasValue({noParent:!0})&&r.highlightChanged?(s.addClass(i),r.clearProperties&&(c.display="")):e.hasValue()&&r.highlightComputed&&s.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()},e.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},e.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(ha,"]"))),this.clearEl},e.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},e.prototype.onValueChange=function(t,e,n){void 0===n&&(n={}),this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},e.prototype.setValue=function(t){var e=this.model,n=(0,tw.isUndefined)(t)||""===t?e.getDefaultValue():t;if(this.update)return this.__update(n);this.__setValueInput(n)},e.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},e.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector("input")),this.input},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},e.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},e.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},e.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(ho(ho({},this._getClbOpts()),{value:t}))},e.prototype.__change=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.emit&&this.emit.bind(this);n&&n.apply(void 0,hi([this._getClbOpts()],t,!1))},e.prototype.__updateStyle=function(t,e){void 0===e&&(e={});var n=e.complete,o=e.partial;hr(e,["complete","partial"]);var r=this.model,i=!1!==n&&!0!==o;(0,t_.isObject)(t)?r.__upTargetsStyle(t,{avoidStore:!i}):r.upValue(t,{partial:!i})},e.prototype._getClbOpts=function(){var t=this.model;return{el:this.el,createdEl:this.createdEl,property:t,props:t.attributes,change:this.__change,updateStyle:this.__updateStyle}},e.prototype.render=function(){this.clearCached();var t=this.pfx,e=this.model,n=this.el,o=this.$el,r=e.getName(),i=e.getType(),a=e.get("className")||"",s="".concat(t,"property"),l="number"===i?"".concat(t).concat(i," ").concat(t,"integer"):"".concat(t).concat(i);this.createdEl&&this.__destroyFn(this._getClbOpts()),o.empty().append(this.template(e)),o.find("[data-sm-label]").append(this.templateLabel(e));var c=this.create&&this.create.bind(this);this.createdEl=c&&c(this._getClbOpts()),o.find("[data-sm-fields]").append(this.createdEl||this.templateInput(e)),n.className="".concat(s," ").concat(l," ").concat(s,"__").concat(r," ").concat(a).trim(),n.className+=e.isFull()?" ".concat(s,"--full"):"";var u=this.onRender&&this.onRender.bind(this);return u&&u(),this.setValue(e.getValue()),this},e.prototype.onRender=function(){},e}(tT.Ss),hl=(D=function(t,e){return(D=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hc=function(t){function e(e){var n=t.call(this,e)||this;n.config=e.config||{},n.pfx=n.config.stylePrefix||"",n.properties=[],n.parent=e.parent;var o=n.collection;return n.listenTo(o,"add",n.addTo),n.listenTo(o,"reset",n.render),n}return hl(e,t),e.prototype.addTo=function(t,e,n){this.add(t,null,n)},e.prototype.add=function(t,e,n){void 0===n&&(n={});var o=this.parent,r=this.config,i=e||this.el,a=new t.typeView({model:t,config:r});o&&(a.parent=o),a.render();var s=a.el;this.properties.push(a),(0,t3.Sc)(i,s,n.at)},e.prototype.remove=function(){return tT.Ss.prototype.remove.apply(this,arguments),this.clearItems(),this},e.prototype.clearItems=function(){this.properties.forEach(function(t){return t.remove()}),this.properties=[]},e.prototype.render=function(){var t=this,e=this.$el,n=this.pfx;this.clearItems();var o=document.createDocumentFragment();return this.collection.forEach(function(e){return t.add(e,o)}),e.empty(),e.append(o),e.attr("class","".concat(n,"properties")),this},e}(tT.Ss),hu=(L=function(t,e){return(L=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}L(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hp=function(){return(hp=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hu(e,t),e.prototype.templateInput=function(){var t=this.pfx;return'\n <div class="'.concat(t,"field ").concat(t,'composite">\n <span id="').concat(t,'input-holder"></span>\n </div>\n ')},e.prototype.remove=function(){var t;return null===(t=this.props)||void 0===t||t.remove(),hs.prototype.remove.apply(this,arguments),this},e.prototype.onValueChange=function(){},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.get("properties");if(n.length&&!this.props){var o=e.isDetached(),r=new hc({config:hp(hp({},this.config),{highlightComputed:o,highlightChanged:o}),collection:n,parent:this});r.render(),this.$el.find("#".concat(t,"input-holder")).append(r.el),this.props=r}},e.prototype.clearCached=function(){hs.prototype.clearCached.apply(this,arguments),delete this.props},e}(hs),hf=(I=function(t,e){return(I=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hf(e,t),e.prototype.events=function(){return{click:"select","click [data-close-layer]":"removeItem","mousedown [data-move-layer]":"initSorter","touchstart [data-move-layer]":"initSorter"}},e.prototype.template=function(){var t=this.pfx,e=this.ppfx,n=this.em,o=null==n?void 0:n.getConfig().icons,r=(null==o?void 0:o.close)||"",i=(null==o?void 0:o.move)||"";return'\n <div class="'.concat(t,'label-wrp">\n <div id="').concat(t,'move" class="').concat(e,'no-touch-actions" data-move-layer>\n ').concat(i,'\n </div>\n <div id="').concat(t,'label" data-label></div>\n <div id="').concat(t,'preview-box" class="').concat(t,'layer-preview" style="display: none" data-preview-box>\n <div id="').concat(t,'preview" class="').concat(t,'layer-preview-cnt" data-preview></div>\n </div>\n <div id="').concat(t,'close-layer" class="').concat(t,'btn-close" data-close-layer>\n ').concat(r,'\n </div>\n </div>\n <div id="').concat(t,'inputs" data-properties></div>\n ')},e.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.propertyView=t.propertyView;var o=this.propertyView.model;this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:values",this.updateLabel),this.listenTo(o,"change:selectedLayer",this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data("model",e)},e.prototype.initSorter=function(){var t;null===(t=this.sorter)||void 0===t||t.startSort([{element:this.el}])},e.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},e.prototype.select=function(){this.model.select()},e.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},e.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},e.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector("[data-label]")),this.labelEl},e.prototype.updateLabel=function(){var t=this.model,e=t.getLabel();if(this.getLabelEl().innerHTML=e,t.hasPreview()){var n=this.getPreviewEl(),o=t.getStylePreview({number:{min:-3,max:3}}),r=(0,tw.keys)(o).map(function(t){return"".concat(t,":").concat(o[t])}).join(";");n.setAttribute("style",r)}},e.prototype.updateVisibility=function(){var t,e=this.pfx,n=this.model,o=this.propertyView,r=this.getPropertiesWrapper(),i=n.isSelected();r.style.display=i?"":"none",this.$el[i?"addClass":"removeClass"]("".concat(e,"active")),i&&r.appendChild(null===(t=o.props)||void 0===t?void 0:t.el)},e.prototype.render=function(){var t=this.el,e=this.pfx,n=this.model;return t.innerHTML=this.template(),t.className="".concat(e,"layer"),n.hasPreview()&&(t.querySelector("[data-preview-box]").style.display=""),this.updateLabel(),this.updateVisibility(),this},e}(tT.Ss),hg=(N=function(t,e){return(N=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hv=function(t){function e(e){var n=t.call(this,e)||this,o=n.collection,r=e.config||{},i=r.em,a=r.stylePrefix||"",s=r.pStylePrefix||"";n.config=r,n.pfx=a,n.ppfx=s,n.propertyView=e.propertyView,n.className="".concat(a,"layers ").concat(s,"field"),n.listenTo(o,"add",n.addTo),n.listenTo(o,"reset",n.reset),n.items=[];var l=n.createPlaceholder(r.pStylePrefix);n.$el.append(l);var c=null==i?void 0:i.Utils;return n.sorter=c?new c.StyleManagerSorter({em:i,containerContext:{container:n.el,containerSel:".".concat(a,"layers"),itemSel:".".concat(a,"layer"),pfx:r.pStylePrefix,document:document,placeholderElement:l},dragBehavior:{dragDirection:n0.A.Vertical,nested:!1}}):void 0,o.view=n,n.$el.data("model",o),n.$el.data("collection",o),n}return hg(e,t),e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var o=e||null,r=this.propertyView,i=this.config,a=this.sorter,s=this.$el,l=new hh({model:t,config:i,sorter:a,propertyView:r}),c=l.render().el;if(this.items.push(l),o)o.appendChild(c);else if(void 0!==n){var u="before";s.children().length===n&&(n--,u="after"),n<0?s.append(c):s.children().eq(n)[u](c)}else s.append(c);return c},e.prototype.reset=function(t,e){this.clearItems(),this.render()},e.prototype.remove=function(){return this.clearItems(),tT.Ss.prototype.remove.apply(this,arguments),this},e.prototype.clearItems=function(){this.items.forEach(function(t){return t.remove()}),this.items=[]},e.prototype.render=function(){var t=this,e=this.$el,n=document.createDocumentFragment();return e.empty(),this.collection.forEach(function(e){return t.addToCollection(e,n)}),e.append(n),e.attr("class",this.className),this},e.prototype.createPlaceholder=function(t){var e=document.createElement("div"),n=document.createElement("div");return this.el.parentNode,e.className=t+"placeholder",e.style.display="none",e.style.pointerEvents="none",n.className=t+"placeholder-int",e.appendChild(n),e},e}(tT.Ss),hy=(R=function(t,e){return(R=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}R(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hm=function(){return(hm=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hy(e,t),e.prototype.events=function(){return hm(hm({},hd.prototype.events()),{"click [data-add-layer]":"addLayer",change:""})},e.prototype.templateInput=function(){var t=this.pfx,e=this.em,n=null==e?void 0:e.getConfig().icons,o=(null==n?void 0:n.plus)||"+";return'\n <div class="'.concat(t,"field ").concat(t,'stack">\n <button type="button" id="').concat(t,'add" data-add-layer>\n ').concat(o,"\n </button>\n <div data-layers-wrapper></div>\n </div>\n ")},e.prototype.init=function(){var t=this.model;this.listenTo(t.layers,"change reset",this.updateStatus),this.listenTo(t,"change:isEmptyValue",this.updateStatus)},e.prototype.addLayer=function(){this.model.addLayer({},{at:0})},e.prototype.setValue=function(){},e.prototype.remove=function(){var t;return null===(t=this.layersView)||void 0===t||t.remove(),hd.prototype.remove.apply(this,arguments),this},e.prototype.clearCached=function(){hd.prototype.clearCached.apply(this,arguments),delete this.layersView},e.prototype.onRender=function(){var t=this.model,e=this.el,n=this.config,o=t.get("properties");if(o.length&&!this.props){var r=new hc({config:hm(hm({},n),{highlightComputed:!1,highlightChanged:!1}),collection:o,parent:this});r.render();var i=new hv({collection:t.layers,config:n,propertyView:this});i.render(),e.querySelector("[data-layers-wrapper]").appendChild(i.el),this.props=r,this.layersView=i}},e}(hd),hw=(V=function(t,e){return(V=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}V(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h_=function(){return(h_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hw(e,t),e.prototype.events=function(){return h_(h_({},hs.prototype.events()),{"click [data-clear-asset]":"clear","click [data-open-assets]":"openAssetManager"})},e.prototype.templateInput=function(){var t,e=this.pfx,n=this.em,o=null===(t=this.em)||void 0===t?void 0:t.getConfig().icons,r=null==o?void 0:o.close;return'\n <div class="'.concat(e,"field ").concat(e,"file\">\n <div id='").concat(e,"input-holder'>\n <div class=\"").concat(e,'btn-c">\n <button class="').concat(e,'btn" id="').concat(e,'images" type="button" data-open-assets>\n ').concat(n.t("styleManager.fileButton"),'\n </button>\n </div>\n <div style="clear:both;"></div>\n </div>\n <div id="').concat(e,'preview-box" class="').concat(e,'preview-file" data-preview-box>\n <div id="').concat(e,'preview-file" class="').concat(e,'preview-file-cnt" data-preview></div>\n <div id="').concat(e,'close" class="').concat(e,'preview-file-close" data-clear-asset>').concat(r,"</div>\n </div>\n </div>\n ")},e.prototype.__setValueInput=function(t){var e=this.model,n=this.el,o=e.getDefaultValue(),r=n.querySelector("[data-preview-box]"),i=n.querySelector("[data-preview]");r.style.display=t&&t!==o?"":"none",i.style.backgroundImage=t||e.getDefaultValue()},e.prototype.openAssetManager=function(){var t,e=this,n=null===(t=this.em)||void 0===t?void 0:t.Assets;null==n||n.open({select:function(t,o){var r=(0,tw.isString)(t)?t:t.get("src");e.model.upValue(r,{partial:!o}),o&&n.close()},types:["image"],accept:"image/*"})},e}(hs),hx=(F=function(t,e){return(F=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hx(e,t),e.prototype.templateInput=function(t){return""},e.prototype.init=function(){var t=this.model;this.listenTo(t,"change:unit",this.onValueChange),this.listenTo(t,"change:units",this.render)},e.prototype.setValue=function(t){},e.prototype.onRender=function(){var t=this.ppfx,e=this.model,n=this.el;if(!this.inputInst){var o=e.input;o.ppfx=t,o.render(),n.querySelector(".".concat(t,"fields")).appendChild(o.el),this.input=o.inputEl.get(0),this.inputInst=o}},e.prototype.clearCached=function(){hs.prototype.clearCached.apply(this,arguments),this.inputInst=null},e}(hs),hO=(H=function(t,e){return(H=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}H(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hO(e,t),e.prototype.setValue=function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})},e.prototype.remove=function(){var t=this;hS.prototype.remove.apply(this,arguments);var e=this.inputInst;return e&&e.remove&&e.remove(),["inputInst","$color"].forEach(function(e){return t[e]=null}),this},e.prototype.__handleChange=function(t,e){this.model.upValue(t,{partial:e})},e.prototype.onRender=function(){var t;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var e=this.ppfx,n=this.model,o=this.em,r=this.el,i=new sd({target:o,model:n,ppfx:e,onChange:this.__handleChange}).render();r.querySelector(".".concat(e,"fields")).appendChild(i.el),this.input=null===(t=i.inputEl)||void 0===t?void 0:t.get(0),this.inputInst=i}},e}(hS),hP=(U=function(t,e){return(U=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}U(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hE=function(){return(hE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hk=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},hA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hP(e,t),e.prototype.defaults=function(){return hE(hE({},f0.getDefaults()),{options:[],full:0})},e.prototype.getOptions=function(){var t=this.attributes,e=t.options,n=t.list;return(e&&e.length?e:n)||[]},e.prototype.getOption=function(t){var e=this,n=(0,t_.isDef)(t)?t:this.getValue();return this.getOptions().filter(function(t){return e.getOptionId(t)===n})[0]||null},e.prototype.setOptions=function(t){return void 0===t&&(t=[]),this.set("options",t),this},e.prototype.addOption=function(t){if(t){var e=this.getOptions();this.setOptions(hk(hk([],e,!0),[t],!1))}return this},e.prototype.getOptionId=function(t){return(0,t_.isDef)(t.id)?t.id:t.value},e.prototype.getOptionLabel=function(t,e){void 0===e&&(e={});var n,o=e.locale,r=((0,tw.isString)(t)?this.getOption(t):t)||{},i=this.getOptionId(r),a=r.label||r.name||i,s=e.property||this.getId();return(void 0===o||o)&&(null===(n=this.em)||void 0===n?void 0:n.t("styleManager.options.".concat(s,".").concat(i)))||a},e.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];f0.prototype.initialize.apply(this,t),this.listenTo(this,"change:options",this.__onOptionChange)},e.prototype.__onOptionChange=function(){this.set("list",this.get("options"))},e}(f0),hj=(B=function(t,e){return(B=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}B(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hM=function(t){function e(e){var n=t.call(this,e)||this;return n.listenTo(n.model,"change:options",n.updateOptions),n}return hj(e,t),e.prototype.templateInput=function(){var t=this.pfx,e=this.ppfx;return'\n <div class="'.concat(e,"field ").concat(e,'select">\n <span id="').concat(t,'input-holder"></span>\n <div class="').concat(e,'sel-arrow">\n <div class="').concat(e,'d-s-arrow"></div>\n </div>\n </div>\n ')},e.prototype.updateOptions=function(){delete this.input,this.onRender()},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.getOptions();if(!this.input){var o=[];n.forEach(function(t){var n=e.getOptionId(t),r=e.getOptionLabel(n),i=t.style?t.style.replace(/"/g,"&quot;"):"",a=n.replace(/"/g,"&quot;");o.push('<option value="'.concat(a,'" ').concat(i?'style="'.concat(i,'"'):"",">").concat(r,"</option>"))});var r=this.el.querySelector("#".concat(t,"input-holder"));r.innerHTML="<select>".concat(o.join(""),"</select>"),this.input=r.firstChild}},e.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),o=e.getOptions()[0],r=o?e.getOptionId(o):"";n&&(n.value=t||r)},e}(hs),hD=(z=function(t,e){return(z=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}z(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hL=function(){return(hL=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hI=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hD(e,t),e.prototype.defaults=function(){return hL(hL({},hA.getDefaults()),{full:1})},e}(hA),hN=(W=function(t,e){return(W=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}W(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hN(e,t),e.prototype.templateInput=function(){var t=this.ppfx;return'<div class="'.concat(t,"field ").concat(t,'field-radio"></div>')},e.prototype.onRender=function(){var t=this.pfx,e=this.ppfx,n=this.model,o="".concat(e,"radio-item-label"),r=n.getName(),i=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(r),s=n.cid;if(!this.input){var l=[];i.forEach(function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(o):"",u=n.getOptionId(i),p="".concat(r,"-").concat(u,"-").concat(s),d=c?"":n.getOptionLabel(u),f=i.title?'title="'.concat(i.title,'"'):"",h=n.getValue()===u?"checked":"";l.push('\n <div class="'.concat(e,'radio-item">\n <input type="radio" class="').concat(a,'" id="').concat(p,'" name="').concat(r,"-").concat(s,'" value="').concat(u,'" ').concat(h,'/>\n <label class="').concat(c||o,'" ').concat(f,' for="').concat(p,'">').concat(d,"</label>\n </div>\n "))});var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML='<div class="'.concat(e,'radio-items">').concat(l.join(""),"</div>"),this.input=c.firstChild}},e.prototype.__setValueInput=function(t){var e,n=this.model,o=t||n.getDefaultValue(),r=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector('[value="'.concat(o,'"]'));r&&(r.checked=!0)},e}(hM),hV=($=function(t,e){return($=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hF=function(){return(hF=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hH=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hV(e,t),e.prototype.defaults=function(){return hF(hF({},f0.getDefaults()),{units:[],unit:"",min:"",max:"",step:1})},e.prototype.getUnits=function(){return this.get("units")||[]},e.prototype.getUnit=function(){return this.get("unit")},e.prototype.getMin=function(){return this.get("min")},e.prototype.getMax=function(){return this.get("max")},e.prototype.getStep=function(){return this.get("step")},e.prototype.upUnit=function(t,e){return void 0===e&&(e={}),this._up({unit:t},e)},e.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),f0.callParentInit(f0,this,t,e);var n=this.get("unit"),o=this.getUnits();this.input=(0,t_.hasWin)()?new sv({model:this}):void 0,o.length&&!n&&this.set("unit",o[0],{silent:!0}),f0.callInit(this,t,e)},e.prototype.__getClearProps=function(){return hF(hF({},f0.prototype.__getClearProps()),{unit:""})},e.prototype.parseValue=function(t,e){void 0===e&&(e={});var n=f0.prototype.parseValue.apply(this,arguments),o=this.input.validateInputValue(n.value,hF({deepCheck:1},e)),r=o.value,i=o.unit;return n.value=r,n.unit=i,n},e.prototype.getFullValue=function(){var t=this.get("value"),e=this.get("unit"),n=(0,tw.isUndefined)(t)?"":"".concat(t),o=!(0,tw.isUndefined)(e)&&n?e:"",r="".concat(n).concat(o);return f0.prototype.getFullValue.apply(this,[r])},e}(f0),hU=(q=function(t,e){return(q=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}q(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),hB=function(){return(hB=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hU(e,t),e.prototype.defaults=function(){return hB(hB({},hH.getDefaults()),{showInput:1})},e}(hH),hW=(G=function(t,e){return(G=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}G(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h$=function(){return(h$=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hW(e,t),e.prototype.events=function(){return h$(h$({},hS.prototype.events()),{"change [type=range]":"inputValueChanged","input [type=range]":"inputValueChangedSoft",change:""})},e.prototype.templateInput=function(t){var e=this.ppfx;return'\n <div class="'.concat(e,"field ").concat(e,'field-range">\n <input type="range" min="').concat(t.get("min"),'" max="').concat(t.get("max"),'" step="').concat(t.get("step"),'"/>\n </div>\n ')},e.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},e.prototype.inputValueChanged=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value)},e.prototype.inputValueChangedSoft=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},e.prototype.setValue=function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=""===t?e.getDefaultValue():parseFloat(n.value),hS.prototype.setValue.apply(this,arguments)},e.prototype.onRender=function(){hS.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},e.prototype.clearCached=function(){hS.prototype.clearCached.apply(this,arguments),delete this.slider},e}(hS);let hG=tT.pM.extend(ln).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get("StyleManager"));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:"stack",model:he,view:hb,isType:function(t){if(t&&"stack"==t.type)return t}},{id:"composite",model:f4,view:hd,isType:function(t){if(t&&"composite"==t.type)return t}},{id:"file",model:f0,view:hC,isType:function(t){if(t&&"file"==t.type)return t}},{id:"color",model:f0,view:hT,isType:function(t){if(t&&"color"==t.type)return t}},{id:"select",model:hA,view:hM,isType:function(t){if(t&&"select"==t.type)return t}},{id:"radio",model:hI,view:hR,isType:function(t){if(t&&"radio"==t.type)return t}},{id:"slider",model:hz,view:hq,isType:function(t){if(t&&"slider"==t.type)return t}},{id:"integer",model:hH,view:hS,isType:function(t){if(t&&"integer"==t.type)return t}},{id:"number",model:hH,view:hS,isType:function(t){if(t&&"number"==t.type)return t}},{id:"base",model:f0,view:hs,isType:function(t){return t.type="base",t}}]});var hK=function(){return(hK=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},hY=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},hJ=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},hX=function(t){return t.map(function(t){return{id:t}})},hZ=function(){function t(){this.props={},this.typeNumber="number",this.typeColor="color",this.typeRadio="radio",this.typeSelect="select",this.typeFile="file",this.typeSlider="slider",this.typeComposite="composite",this.typeStack="stack",this.unitsSize=["px","%","em","rem","vh","vw"],this.unitsSizeNoPerc=["px","em","rem","vh","vw"],this.unitsTime=["s","ms"],this.unitsAngle=["deg","rad","grad"],this.fixedValues=["initial","inherit","auto"];var t=", sans-serif",e=["flex-start","flex-end","center"],n=hJ(hJ([],e,!0),["baseline","stretch"],!1);this.optsBgSize=hX(["auto","cover","contain"]),this.optsBgAttach=hX(["scroll","fixed","local"]),this.optsBgRepeat=hX(["repeat","repeat-x","repeat-y","no-repeat"]),this.optsWrap=hX(["nowrap","wrap","wrap-reverse"]),this.optsOverflow=hX(["visible","hidden","scroll","auto"]),this.optsDir=hX(["row","row-reverse","column","column-reverse"]),this.opstDisplay=hX(["block","inline","inline-block","flex","none"]),this.optsTransitFn=hX(["linear","ease","ease-in","ease-out","ease-in-out"]),this.optsCursor=hX(["auto","pointer","copy","crosshair","grab","grabbing","help","move","text"]),this.optsFloat=hX(["none","left","right"]),this.optsPos=hX(["static","relative","absolute","fixed"]),this.optsTextAlign=hX(["left","center","right","justify"]),this.optsFlexAlign=hX(n),this.optsJustCont=hX(hJ(hJ([],e,!0),["space-between","space-around","space-evenly"],!1)),this.optsAlignCont=hX(hJ(hJ([],e,!0),["space-between","space-around","stretch"],!1)),this.optsAlignSelf=hX(hJ(["auto"],n,!0)),this.optsTransitProp=hX(["all","width","height","background-color","transform","box-shadow","opacity"]),this.optsBorderStyle=hX(["none","solid","dotted","dashed","double","groove","ridge","inset","outset"]),this.optsBgPos=hX(["left top","left center","left bottom","right top","right center","right bottom","center top","center center","center bottom"]),this.optsWeight=[{id:"100",label:"Thin"},{id:"200",label:"Extra-Light"},{id:"300",label:"Light"},{id:"400",label:"Normal"},{id:"500",label:"Medium"},{id:"600",label:"Semi-Bold"},{id:"700",label:"Bold"},{id:"800",label:"Extra-Bold"},{id:"900",label:"Ultra-Bold"}],this.optsShadowType=[{id:"",label:"Outside"},{id:"inset",label:"Inside"}],this.optsFonts=["Arial, Helvetica"+t,"Arial Black, Gadget"+t,"Brush Script MT"+t,"Comic Sans MS, cursive"+t,"Courier New, Courier, monospace","Georgia, serif","Helvetica"+t,"Impact, Charcoal"+t,"Lucida Sans Unicode, Lucida Grande"+t,"Tahoma, Geneva"+t,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+t,"Verdana, Geneva"+t].map(function(t){return{id:t,label:t.split(",")[0]}}),this.fixedFontSizes=["medium","xx-small","x-small","small","large","x-large","xx-large","smaller","larger","length","initial","inherit"],this.fixedLetSpace=["normal","initial","inherit"],this.requireFlex={display:["flex"]},this.init()}return t.prototype.__sub=function(t){var e=this;return function(){return t.map(function(t){if((0,tw.isString)(t))return e.get(t);var n=t.extend,o=hY(t,["extend"]);return hK(hK({},e.get(n)),o)})}},t.prototype.init=function(){var t=this,e=this.fixedValues,n=this.requireFlex,o=this.typeNumber;return this.props={},[["text-shadow-h",{type:o,default:"0",units:this.unitsSizeNoPerc}],["top",{default:"auto",units:this.unitsSize,fixedValues:e},"text-shadow-h"],["right",{},"top"],["bottom",{},"top"],["left",{},"top"],["margin-top",{default:"0"},"top"],["margin-right",{},"margin-top"],["margin-bottom",{},"margin-top"],["margin-left",{},"margin-top"],["padding-top",{min:0},"margin-top"],["padding-right",{},"padding-top"],["padding-bottom",{},"padding-top"],["padding-left",{},"padding-top"],["width",{min:0},"top"],["min-width",{},"width"],["max-width",{},"width"],["height",{},"width"],["min-height",{},"width"],["max-height",{},"width"],["flex-basis",{requiresParent:n},"width"],["font-size",{default:"medium",fixedValues:this.fixedFontSizes},"width"],["letter-spacing",{default:"normal",fixedValues:this.fixedLetSpace},"top"],["line-height",{},"letter-spacing"],["text-shadow-v",{},"text-shadow-h"],["text-shadow-blur",{min:0},"text-shadow-h"],["border-radius-c",{property:"border-radius",fixedValues:void 0},"padding-top"],["border-top-left-radius",{},"border-radius-c"],["border-top-right-radius",{},"border-radius-c"],["border-bottom-left-radius",{},"border-radius-c"],["border-bottom-right-radius",{},"border-radius-c"],["border-width",{units:this.unitsSizeNoPerc},"border-radius-c"],["box-shadow-h",{},"text-shadow-h"],["box-shadow-v",{},"text-shadow-h"],["box-shadow-blur",{default:"5px"},"text-shadow-blur"],["box-shadow-spread",{},"text-shadow-h"],["transition-duration",{default:"2s",units:this.unitsTime},"border-radius-c"],["perspective",{},"border-radius-c"],["order",{type:o,default:"0",requiresParent:n}],["flex-grow",{},"order"],["flex-shrink",{default:"1"},"order"],["float",{type:this.typeRadio,default:"none",options:this.optsFloat}],["position",{default:"static",options:this.optsPos},"float"],["text-align",{default:"left",options:this.optsTextAlign},"float"],["color",{type:this.typeColor,default:"black",full:!0}],["text-shadow-color",{},"color"],["border-color",{},"color"],["box-shadow-color",{},"color"],["background-color",{default:"none"},"color"],["background-image",{type:this.typeFile,functionName:"url",default:"none",full:!0}],["opacity",{type:this.typeSlider,default:"1",min:0,max:1,step:.01,full:!0}],["display",{type:this.typeSelect,default:"block",options:this.opstDisplay}],["flex-direction",{default:"row",options:this.optsDir,requires:n},"display"],["flex-wrap",{default:"nowrap",options:this.optsWrap},"flex-direction"],["justify-content",{default:"flex-start",options:this.optsJustCont},"flex-wrap"],["align-items",{default:"stretch",options:this.optsFlexAlign},"flex-wrap"],["align-content",{options:this.optsAlignCont},"align-items"],["align-self",{default:"auto",options:this.optsAlignSelf,requiresParent:n},"display"],["font-family",{default:"Arial, Helvetica, sans-serif",options:this.optsFonts},"display"],["font-weight",{default:"400",options:this.optsWeight},"display"],["border-style",{default:"solid",options:this.optsBorderStyle},"display"],["box-shadow-type",{default:"",options:this.optsShadowType},"display"],["background-repeat",{default:"repeat",options:this.optsBgRepeat},"display"],["background-position",{default:"left top",options:this.optsBgPos},"display"],["background-attachment",{default:"scroll",options:this.optsBgAttach},"display"],["background-size",{default:"auto",options:this.optsBgSize},"display"],["transition-property",{default:"width",options:this.optsTransitProp},"display"],["transition-timing-function",{default:"ease",options:this.optsTransitFn},"display"],["cursor",{default:"auto",options:this.optsCursor},"display"],["overflow",{default:"visible",options:this.optsOverflow},"display"],["overflow-x",{},"overflow"],["overflow-y",{},"overflow"],["margin",{type:this.typeComposite,properties:this.__sub([{extend:"margin-top",id:"margin-top-sub"},{extend:"margin-right",id:"margin-right-sub"},{extend:"margin-bottom",id:"margin-bottom-sub"},{extend:"margin-left",id:"margin-left-sub"}])}],["padding",{properties:this.__sub([{extend:"padding-top",id:"padding-top-sub"},{extend:"padding-right",id:"padding-right-sub"},{extend:"padding-bottom",id:"padding-bottom-sub"},{extend:"padding-left",id:"padding-left-sub"}])},"margin"],["border",{properties:this.__sub([{extend:"border-width",id:"border-width-sub"},{extend:"border-style",id:"border-style-sub"},{extend:"border-color",id:"border-color-sub"}])},"margin"],["border-radius",{properties:this.__sub([{extend:"border-top-left-radius",id:"border-top-left-radius-sub"},{extend:"border-top-right-radius",id:"border-top-right-radius-sub"},{extend:"border-bottom-left-radius",id:"border-bottom-left-radius-sub"},{extend:"border-bottom-right-radius",id:"border-bottom-right-radius-sub"}])},"margin"],["transition",{type:this.typeStack,properties:this.__sub([{extend:"transition-property",id:"transition-property-sub"},{extend:"transition-duration",id:"transition-duration-sub"},{extend:"transition-timing-function",id:"transition-timing-function-sub"}])}],["box-shadow",{preview:!0,layerLabel:function(t,e){var n=e.values,o=n["box-shadow-h"],r=n["box-shadow-v"],i=n["box-shadow-blur"],a=n["box-shadow-spread"];return"".concat(o," ").concat(r," ").concat(i," ").concat(a)},properties:this.__sub(["box-shadow-h","box-shadow-v","box-shadow-blur","box-shadow-spread","box-shadow-color","box-shadow-type"])},"transition"],["text-shadow",{default:"none",layerLabel:function(t,e){var n=e.values,o=n["text-shadow-h"],r=n["text-shadow-v"],i=n["text-shadow-blur"];return"".concat(o," ").concat(r," ").concat(i)},properties:this.__sub(["text-shadow-h","text-shadow-v","text-shadow-blur","text-shadow-color"])},"box-shadow"],["background",{detached:!0,layerLabel:function(t,e){var n=e.values;return[n["background-repeat-sub"]||"",n["background-position-sub"]||"",n["background-attachment-sub"]||"",n["background-size-sub"]||""].join(" ")},properties:this.__sub([{extend:"background-image",id:"background-image-sub"},{extend:"background-repeat",id:"background-repeat-sub"},{extend:"background-position",id:"background-position-sub"},{extend:"background-attachment",id:"background-attachment-sub"},{extend:"background-size",id:"background-size-sub"}])},"box-shadow"],["transform",{type:"stack",layerSeparator:" ",fromStyle:function(t,e){var n=e.property,o=t[e.name]||"",r=n.getLayerSeparator();return o?o.split(r).map(function(t){var e=n.__parseFn(t);return{"transform-type":e.name,"transform-value":e.value}}):[]},toStyle:function(t,e){var n,o=e.name;return(n={})[o]="".concat(t["transform-type"],"(").concat(t["transform-value"],")"),n},properties:[{property:"transform-type",name:"Type",type:this.typeSelect,default:"rotateZ",full:!0,options:[{id:"scaleX",propValue:{units:[""],step:.01}},{id:"scaleY",propValue:{units:[""],step:.01}},{id:"scaleZ",propValue:{units:[""],step:.01}},{id:"rotateX",propValue:{units:this.unitsAngle,step:1}},{id:"rotateY",propValue:{units:this.unitsAngle,step:1}},{id:"rotateZ",propValue:{units:this.unitsAngle,step:1}},{id:"translateX",propValue:{units:this.unitsSize,step:1}},{id:"translateY",propValue:{units:this.unitsSize,step:1}}],onChange:function(t){var e=t.property;if(t.to.value){var n=e.getOption(),o=hK({},n.propValue||{}),r=e.getParent().getProperty("transform-value"),i=r.getUnit();(!i||(null==o?void 0:o.units.indexOf(i))<0)&&(o.unit=(null==o?void 0:o.units[0])||""),r.up(o)}}},{property:"transform-value",type:this.typeNumber,default:"0",full:!0}]}]].forEach(function(e){var n=e[0],o=e[1],r=e[2];t.add(n,o||{},{from:r})}),this},t.prototype.add=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.from||"",r=this.props[o||t]||{},i=hK(hK(hK({},r),{property:t}),e);return i.properties&&(0,tw.isFunction)(i.properties)&&(i.properties=i.properties()),this.props[t]=i,i},t.prototype.get=function(t){return this.props[t]},t.prototype.build=function(t){var e=this,n=[];return((0,tw.isString)(t)?[t]:t).forEach(function(t){n.push(e.get(t)||{property:t})}),n},t}(),hQ=(K=function(t,e){return(K=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}K(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h0=function(){return(h0=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},h1=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},h2=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},h5=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e)||this,r=n.em;o.em=r;var i=e||{},a=o.buildProperties(i.buildProps),s=o.get("name")||"";o.get("id")||o.set("id",s.replace(/ /g,"_").toLowerCase());var l=new hG((a?o.extendProperties(a):o.get("properties").map(function(t){return(0,tw.isString)(t)?o.buildProperties(t)[0]:t}).filter(Boolean)).map(function(t){return o.checkExtend(t)}),{em:r});return l.sector=o,o.set("properties",l),o}return hQ(e,t),e.prototype.defaults=function(){return{id:"",name:"",open:!0,visible:!0,extendBuilded:!0,properties:[]}},Object.defineProperty(e.prototype,"properties",{get:function(){return this.get("properties")},enumerable:!1,configurable:!0}),e.prototype.getId=function(){return this.get("id")},e.prototype.getName=function(){var t,e=this.getId();return(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.sectors.".concat(e)))||this.get("name")},e.prototype.setName=function(t){return this.set("name",t)},e.prototype.isOpen=function(){return!!this.get("open")},e.prototype.setOpen=function(t){return this.set("open",t)},e.prototype.isVisible=function(){return!!this.get("visible")},e.prototype.getProperties=function(t){void 0===t&&(t={});var e=this.properties;return(e.models?h2([],e.models,!0):e).filter(function(e){var n=!0;return t.withValue&&(n=e.hasValue({noParent:!0})),t.withParentValue&&(n=!e.hasValue({noParent:!0})&&e.hasValue()),n})},e.prototype.getProperty=function(t){return this.getProperties().filter(function(e){return e.get("id")===t})[0]||void 0},e.prototype.addProperty=function(t,e){return this.properties.add(this.checkExtend(t),e)},e.prototype.extendProperties=function(t,e,n){void 0===n&&(n=!1);for(var o=t.length,r=e||this.get("properties"),i=this.get("extendBuilded"),a=[],s=0,l=r.length;s<l;s++){for(var c=r[s],u=0,p=0;p<o;p++){var d=t[p];if(c.property==d.property||c.id==d.property){var f=c.properties;f&&f.length&&(c.properties=this.extendProperties(d.properties||[],f,1)),t[p]=i?(0,tw.extend)(d,c):c,a[p]=t[p],u=1;continue}}u||(t.push(c),a.push(c))}return n?a.filter(function(t){return t}):t},e.prototype.checkExtend=function(t){var e=((0,tw.isString)(t)?{extend:t}:t)||{},n=e.extend,o=h1(e,["extend"]);return n?h0(h0({},this.buildProperties([n])[0]||{}),o):t},e.prototype.buildProperties=function(t){var e,n=t||[];if(!n.length)return[];var o=null===(e=this.em)||void 0===e?void 0:e.Styles.builtIn;return null==o?void 0:o.build(n)},e}(tT.Kx),h3=(Y=function(t,e){return(Y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Y(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h4=function(){return(h4=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},h6=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h3(e,t),e.prototype.initialize=function(t,e){void 0===e&&(e={});var n=e.module,o=e.em;this.em=o,this.module=n,this.listenTo(this,"reset",this.onReset)},e.prototype.model=function(t,e){void 0===e&&(e={});var n=e.collection.em;return new h5(t,h4(h4({},e),{em:n}))},e.prototype.onReset=function(t,e){void 0===e&&(e={}),(e.previousModels||[]).forEach(function(t){return t.get("properties").reset()})},e}(tT.pM);(J=td||(td={})).sectorAdd="style:sector:add",J.sectorRemove="style:sector:remove",J.sectorUpdate="style:sector:update",J.propertyAdd="style:property:add",J.propertyRemove="style:property:remove",J.propertyUpdate="style:property:update",J.target="style:target",J.layerSelect="style:layer:select",J.custom="style:custom",J.all="style";var h7=(X=function(t,e){return(X=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}X(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h9=function(t){function e(e){var n=t.call(this,e)||this,o=e.config||{},r=n.model,i=o.em;return n.config=o,n.em=i,n.pfx=o.stylePrefix||"",n.listenTo(r,"destroy remove",n.remove),n.listenTo(r,"change:open",n.updateOpen),n.listenTo(r,"change:visible",n.updateVisibility),n}return h7(e,t),e.prototype.template=function(t){var e,n,o,r=t.pfx,i=t.label,a=null===(o=this.em)||void 0===o?void 0:o.getConfig().icons,s=(null==a?void 0:a.caret)||"",l="".concat(r,"sector-");return tC(tf||(e=['\n <div class="','title" data-sector-title>\n <div class="','caret">$','</div>\n <div class="','label">',"</div>\n </div>\n "],n=['\n <div class="','title" data-sector-title>\n <div class="','caret">$','</div>\n <div class="','label">',"</div>\n </div>\n "],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,tf=e),l,l,s,l,i)},e.prototype.events=function(){return{"click [data-sector-title]":"toggle"}},e.prototype.updateOpen=function(){var t=this.$el,e=this.model,n=this.pfx,o=e.isOpen();t[o?"addClass":"removeClass"]("".concat(n,"open")),this.getPropertiesEl().style.display=o?"":"none"},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},e.prototype.getPropertiesEl=function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)},e.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get("open"))},e.prototype.renderProperties=function(){var t=this.model,e=this.config,n=t.get("properties");if(n){var o=new hc({collection:n,config:e});this.$el.append(o.render().el)}},e.prototype.render=function(){var t=this.pfx,e=this.model,n=this.$el,o=e.getId(),r=e.getName();return n.html(this.template({pfx:t,label:r})),this.renderProperties(),n.attr("class","".concat(t,"sector ").concat(t,"sector__").concat(o," no-select")),this.updateOpen(),this},e}(tT.Ss),h8=(Z=function(t,e){return(Z=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Z(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),gt=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.module,r=e.config,i=n.collection;return n.pfx=(null==r?void 0:r.stylePrefix)||"",n.ppfx=(null==r?void 0:r.pStylePrefix)||"",n.config=r,n.module=o,n.listenTo(i,"add",n.addTo),n.listenTo(i,"reset",n.render),n}return h8(e,t),e.prototype.remove=function(){var t=this;return tT.Ss.prototype.remove.apply(this,arguments),["config","module","em"].forEach(function(e){return t[e]={}}),this},e.prototype.addTo=function(t,e,n){void 0===n&&(n={}),this.addToCollection(t,null,n)},e.prototype.addToCollection=function(t,e,n){void 0===n&&(n={});var o=this.config,r=this.el,i=new h9({model:t,config:o}).render().el;return(0,t3.Sc)(e||r,i,n.at),i},e.prototype.render=function(){var t=this,e=this.$el,n=this.pfx,o=this.ppfx;e.empty();var r=document.createDocumentFragment();return this.collection.each(function(e){return t.addToCollection(e,r)}),e.append(r),e.addClass("".concat(n,"sectors ").concat(o,"one-bg ").concat(o,"two-color")),this},e}(tT.Ss),ge=(Q=function(t,e){return(Q=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Q(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),gn=function(){return(gn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},go=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},gr=function(t){return t||0===t},gi=function(t){function e(e){var n=t.call(this,e,"StyleManager",new h6([],{em:e}),td,{sectors:[{name:"General",open:!1,properties:["display","float","position","top","right","left","bottom"]},{name:"Flex",open:!1,properties:["flex-direction","flex-wrap","justify-content","align-items","align-content","order","flex-basis","flex-grow","flex-shrink","align-self"]},{name:"Dimension",open:!1,properties:["width","height","max-width","min-height","margin","padding"]},{name:"Typography",open:!1,properties:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-shadow"]},{name:"Decorations",open:!1,properties:["background-color","border-radius","border","box-shadow","background"]},{name:"Extra",open:!1,properties:["opacity","transition","transform"]}],appendTo:"",stylePrefix:"sm-",custom:!1,hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:!0,avoidComputed:["width","height"]})||this;n.events=td,n.Sector=h5,n.storageKey="",(0,tw.bindAll)(n,"__clearStateTarget");var o=n.events,r=n.config,i=r.pStylePrefix;i&&(r.stylePrefix=i+r.stylePrefix),n.builtIn=new hZ,n.properties=new hG([],{em:e,module:n}),n.sectors=n.all;var a=new tT.Kx({targets:[]});n.model=a;var s=tQ.I.update;n.upAll=(0,tw.debounce)(function(){return n.__upSel()},0),a.listenTo(e,"component:toggled ".concat(s,":classes change:state change:device frame:resized selector:type"),n.upAll),a.listenTo(e,"component:toggled",n.__clearStateTarget);var l=(0,tw.debounce)(function(){n.__upProps(),n.__trgCustom()},0);a.listenTo(e,"styleable:change undo redo",l);var c=(0,tw.debounce)(function(){return n.__trgCustom()},0);return a.listenTo(e,"".concat(o.layerSelect," ").concat(o.target),c),a.on("change:lastTarget",function(){return e.trigger(o.target,n.getSelected())}),n}return ge(e,t),e.prototype.__upSel=function(){this.select(this.em.getSelectedAll())},e.prototype.__trgCustom=function(t){void 0===t&&(t={}),this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},e.prototype.__trgEv=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];(e=this.em).trigger.apply(e,go([t],n,!1))},e.prototype.__clearStateTarget=function(){var t=this,e=this.em,n=this.__getStateTarget();n&&(null==e||e.skip(function(){e.Css.remove(n),t.model.set({stateTarget:null})}))},e.prototype.onLoad=function(){this.sectors.add(this.config.sectors,{silent:!0})},e.prototype.postRender=function(){this.__appendTo()},e.prototype.addSector=function(t,e,n){void 0===n&&(n={});var o=this.getSector(t);return o||(e.id=t,o=this.sectors.add(e,n)),o},e.prototype.getSector=function(t,e){void 0===e&&(e={});var n=this.sectors.where({id:t})[0];return!n&&e.warn&&this._logNoSector(t),n||null},e.prototype.getSectors=function(t){void 0===t&&(t={});var e=this.sectors,n=e&&e.models?t.array?go([],e.models,!0):e:[];return t.visible?n.filter(function(t){return t.isVisible()}):n},e.prototype.removeSector=function(t){return this.getSectors().remove(this.getSector(t,{warn:!0}))},e.prototype.addProperty=function(t,e,n){void 0===n&&(n={});var o,r=this.getSector(t,{warn:!0});return r&&(o=r.addProperty(e,n)),o},e.prototype.getProperty=function(t,e){var n,o=this.getSector(t,{warn:!0});return o&&(n=o.properties.filter(function(t){return t.get("property")===e||t.get("id")===e})[0]),n},e.prototype.getProperties=function(t){var e,n=this.getSector(t,{warn:!0});return n&&(e=n.properties),e},e.prototype.removeProperty=function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},e.prototype.select=function(t,e){var n=this;void 0===e&&(e={});var o=this.em,r=(0,tw.isArray)(t)?t:[t],i=e.stylable,a=o.Css,s=[];r.filter(Boolean).forEach(function(t){var e=t;if((0,tw.isString)(t)){var n=a.getRule(t)||a.setRule(t);(0,tw.isUndefined)(i)||n.set({stylable:i}),e=n}s.push(e)});var l=e.component||s.filter(function(t){return(0,t_.isComponent)(t)}).reverse()[0];s=s.map(function(t){return n.getModelToStyle(t)});var c=o.getState(),u=s.slice().reverse()[0],p=this.getParentRules(u,{state:c,component:l}),d=this.__getStateTarget();return o.skip(function(){var t;if(c&&(null===(t=null==u?void 0:u.getState)||void 0===t?void 0:t.call(u))){var e=u.getStyle();d?d.setStyle(e):d=a.getAll().add({selectors:"gjs-selected",style:e,shallow:!0,important:!0})}else d&&(a.remove(d),d=void 0)}),this.model.set({targets:s,lastTarget:u,lastTargetParents:p,stateTarget:d,component:l}),this.__upProps(e),s},e.prototype.getSelected=function(){return this.model.get("lastTarget")},e.prototype.getSelectedAll=function(){return this.model.get("targets")},e.prototype.getSelectedParents=function(){return this.model.get("lastTargetParents")||[]},e.prototype.__getStateTarget=function(){return this.model.get("stateTarget")},e.prototype.addStyleTargets=function(t,e){this.getSelectedAll().map(function(n){return n.addStyle(t,e)});var n=this.getSelected();n&&this.__emitCmpStyleUpdate(t);var o=this.__getStateTarget();n&&(null==o||o.setStyle(n.getStyle(),e))},e.prototype.getBuiltIn=function(t){return this.builtIn.get(t)},e.prototype.getBuiltInAll=function(){return this.builtIn.props},e.prototype.addBuiltIn=function(t,e){return this.builtIn.add(t,e)},e.prototype.getModelToStyle=function(t,e){void 0===e&&(e={});var n=this.em,o=e.skipAdd;if(n&&(null==t?void 0:t.toHTML)){var r=n.getConfig(),i=n.UndoManager,a=n.Css,s=n.Selectors,l=s?s.getConfig():{},c=r.devicePreviewMode?"":n.get("state"),u=t.get("classes").getStyleable(),p=u.length,d=!l.componentFirst||e.useClasses,f={noCount:1},h={state:c,addOpts:f};i.skip(function(){var e;if(p&&d){var i=n.getCurrentMedia();(e=a.get(u,c,i))||o||(e=a.add(u,c,i,{},f))}else if(r.avoidInlineStyle){var s=t.getId();(e=a.getIdRule(s,h))||o||(e=a.setIdRule(s,{},h)),t.is("wrapper")&&e.set("wrapper",1,f)}e&&(t=e)})}return t},e.prototype.getParentRules=function(t,e){var n=void 0===e?{}:e,o=n.state,r=n.component,i=this.em,a=[];if(i&&t){var s=i.Css,l=i.CodeManager.getGenerator("css"),c=t.toHTML?t:t.getComponent(),u={array:!0},p=[],d=[],f=[],h=[],g=function(t){return t.length?s.getRules().filter(function(e){var n=e.getSelectors().map(function(t){return t.getFullName()});return 0!==n.length&&n.every(function(e){return t.indexOf(e)>=0})}):[]},v=function(t){return t?s.getRules().filter(function(e){return e.selectorsToString()===t}):[]};c?(p=s.getRules("#".concat(c.getId())),d=v(c.get("tagName")),h=(r?g(r.getSelectors().getFullName(u)):[]).concat(d).concat(p)):(p=r?s.getRules("#".concat(r.getId())):[],d=v((null==r?void 0:r.get("tagName"))||""),f=g(((null==r?void 0:r.getSelectors().getFullName(u))||[]).filter(function(e){return -1===t.getSelectors().getFullName(u).findIndex(function(t){return t===e})}).concat(t.getSelectors().getFullName(u))),h=d.concat(p).concat(f));var y=h.filter(function(t){return(0,tw.isUndefined)(o)?1:t.get("state")===o}).sort(l.sortRules).reverse();a=y.slice(y.indexOf(t)+1)}return a},e.prototype.addType=function(t,e){this.properties.addType(t,e)},e.prototype.getType=function(t){return this.properties.getType(t)},e.prototype.getTypes=function(){return this.properties.getTypes()},e.prototype.createType=function(t,e){var n=void 0===e?{}:e,o=n.model,r=n.view,i=this.config,a=this.getType(t);if(a)return new a.view(gn({model:new a.model(void 0===o?{}:o),config:i},void 0===r?{}:r))},e.prototype.render=function(){var t=this.config,e=this.em,n=this.SectView,o=n&&n.el;return this.SectView=new gt({el:o,em:e,config:t,module:this,collection:this.sectors}),this.SectView.render().el},e.prototype._logNoSector=function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},e.prototype.__emitCmpStyleUpdate=function(t,e){void 0===e&&(e={});var n=this.em;if(!t.__p){var o=this.getSelectedAll(),r=e.components||n.getSelectedAll(),i=Array.isArray(r)?r:[r],a=gn({},t);delete a.__p,i.forEach(function(t){return!o.includes(t)&&t.__onStyleChange(a)})}},e.prototype.__upProps=function(t){var e=this;void 0===t&&(t={});var n=this.getSelected();if(n){var o=this.sectors,r=this.model.get("component"),i=this.getSelectedParents(),a=n.getStyle(),s=i.map(function(t){return{target:t,style:t.getStyle()}});o.map(function(n){n.getProperties().map(function(n){e.__upProp(n,a,s,t)})}),o.forEach(function(t){var e=t.getProperties();e.forEach(function(e){var i=e.__checkVisibility({target:n,sector:t,component:r,sectors:o.models});e.set("visible",i)});var i=e.some(function(t){return t.isVisible()});t.set("visible",i)})}},e.prototype.__upProp=function(t,e,n,o){var r=this,i=t.getName(),a=e[i],s=gr(a),l="stack"===t.getType(),c="composite"===t.getType(),u=gn(gn({},o),{__up:!0}),p=l?t.__getLayersFromStyle(e):[],d=c?t.__getPropsFromStyle(e):{},f=s?a:null,h=null;if(l&&null===p||c&&null===d){var g=l?"__getLayersFromStyle":"__getPropsFromStyle",v=n.filter(function(e){return null!==t[g](e.style)})[0];if(v){f=v.style[i],h=v.target;var y=t[g](v.style);l?p=y:d=y}}else if(!s){f=null;var v=n.filter(function(t){return gr(t.style[i])})[0];v&&(f=v.style[i],h=v.target)}if(t.__setParentTarget(h),c||l||t.__getFullValue()===f||t.upValue(f,u),l&&t.__setLayers(p||[],{isEmptyValue:t.isEmptyValueStyle(e)}),c){var m=t.getProperties();if(t.isDetached()){var b=t.__getPropsFromStyle(e,{byName:!0})||{},w=n.map(function(e){return gn(gn({},e),{style:t.__getPropsFromStyle(e.style,{byName:!0})||{}})});m.map(function(t){return r.__upProp(t,b,w,o)})}else t.__setProperties(d||{},u),t.getProperties().map(function(t){return t.__setParentTarget(h)})}},e.prototype.destroy=function(){var t;[this.properties,this.sectors].forEach(function(t){t.reset(),t.stopListening()}),null===(t=this.SectView)||void 0===t||t.remove(),this.model.stopListening(),this.upAll.cancel()},e}(tL);(tt=th||(th={})).currentIndex="currentIndex",tt.startIndex="startIndex",tt.currentItem="currentItem",tt.currentKey="currentKey",tt.endIndex="endIndex",tt.collectionId="collectionId",tt.totalItems="totalItems",tt.remainingItems="remainingItems";var ga=(te=function(t,e){return(te=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}te(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),gs=function(){return(gs=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},gl=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.em=n,o.model=function(t,e){return void 0===e&&(e={}),new oM(t,gs(gs({},e),{em:n}))},o}return ga(e,t),e}(tT.pM),gc=(tn=function(t,e){return(tn=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}tn(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),gu=function(){return(gu=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},gp=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},gd=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},gf=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},gh=function(t){function e(e){var n=t.call(this,e,"DataSources",new gl([],e),pG,{autoloadProviders:!1})||this;return n.storageKey="dataSources",n.events=pG,n.dataComponentTypes=pW,n.dataCollectionKeys=p$,n.dataCollectionStateTypes=th,n.dataOperationTypes={any:pK,boolean:pY,number:pJ,string:pX},Object.assign(n,tx.Events),n}return gc(e,t),e.prototype.destroy=function(){},e.prototype.add=function(t,e){void 0===e&&(e={});var n=this.all;return t.id=t.id||this._createId(),n.add(t,e)},e.prototype.get=function(t){return this.all.get(t)},e.prototype.getAll=function(){return gf([],this.all.models,!0)},e.prototype.getValue=function(t,e,n){return(0,t_.get)((null==n?void 0:n.context)||this.getContext(),t,e)},e.prototype.setValue=function(t,e){var n=this.fromPath(t),o=(n[0],n[1]),r=n[2];if(o&&(r||""===r)){var i=gu({},o.attributes);if((0,t_.set)(i,r||"",e))return o.set(i),!0}return!1},e.prototype.getContext=function(){return this.all.reduce(function(t,e){return t[e.id]=e.records.reduce(function(t,e,n){var o=gu({},e.attributes);return delete o.__p,t[e.id||n]=o,t},{}),t},{})},e.prototype.remove=function(t,e){return this.__remove(t,e)},e.prototype.fromPath=function(t){var e=[],n=(0,t_.stringToPath)(t||""),o=n[0],r=n[1],i=n.slice(2),a=this.get(o),s=null==a?void 0:a.records.get(r);return a&&e.push(a),s&&(e.push(s),i.length&&e.push(i.join("."))),e},e.prototype.store=function(){var t,e=[];return this.all.forEach(function(t){var n=t.attributes,o=n.skipFromStorage,r=(n.transformers,n.records),i=n.schema,a=gd(n,["skipFromStorage","transformers","records","schema"]);o||e.push(gu(gu({},a),{id:a.id,schema:(0,tw.isEmpty)(i)?void 0:i,records:a.provider?void 0:r}))}),(t={})[this.storageKey]=e,t},e.prototype.load=function(t){var e=this.config,n=this.all,o=this.events,r=this.em,i=this.loadProjectData(t);if(e.autoloadProviders){var a,s,l,c,u=n.filter(function(t){return t.hasProvider});u.length&&(a=this,s=void 0,l=void 0,c=function(){return gp(this,function(t){switch(t.label){case 0:return r.trigger(o.providerLoadAllBefore),[4,Promise.all(u.map(function(t){return t.loadProvider()}))];case 1:return t.sent(),r.trigger(o.providerLoadAll),[2]}})},new(l||(l=Promise))(function(t,e){function n(t){try{r(c.next(t))}catch(t){e(t)}}function o(t){try{r(c.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):((r=e.value)instanceof l?r:new l(function(t){t(r)})).then(n,o)}r((c=c.apply(a,s||[])).next())}))}return i},e.prototype.postLoad=function(){var t=this.em,e=this.all;t.listenTo(e,tT.e2,function(e,n,o){var r=o||n;t.changesUp(r,{dataSource:e,options:r})}),this.em.UndoManager.add(e)},e}(tL),gg=(to=function(t,e){return(to=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}to(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),gv=function(){return(gv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},gy=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},gm=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},gb=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)0>e.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},gw=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};tS().$=tO.default;var g_=[db,lH,dF,fI,a8,lx,aI,gi,aw,dq,fT,fp,fY,sE,s0,oc,sW,aa,gh],gC=[gh,lh,i1,lI,iH,aw];!function(t){var e=t.$;if(e&&e.prototype&&"jQuery"!==e.prototype.constructor.name){var n=e.fn;n.hide=function(){return this.css("display","none")},n.show=function(){return this.css("display","block")},n.focus=function(){var t=this.get(0);return t&&t.focus(),this},n.bind=function(t,e){return this.on(t,e)},n.unbind=function(t,e){if(!(0,tw.isObject)(t))return this.off(t,e);for(var n in t)t.hasOwnProperty(n)&&this.off(n,t[n]);return this},n.click=function(t){return t?this.on("click",t):this.trigger("click")},n.change=function(t){return t?this.on("change",t):this.trigger("change")},n.keydown=function(t){return t?this.on("keydown",t):this.trigger("keydown")},n.delegate=function(t,e,n,o){return o||(o=n),this.on(e,t,function(t){t.data=n,o(t)})},n.scrollLeft=function(){var t=this.get(0),e=(t=9==t.nodeType?t.defaultView:t)instanceof Window?t:null;return e?e.pageXOffset:t.scrollLeft||0},n.scrollTop=function(){var t=this.get(0),e=(t=9==t.nodeType?t.defaultView:t)instanceof Window?t:null;return e?e.pageYOffset:t.scrollTop||0};var o=e.prototype.offset;n.offset=function(t){var e,n;return t&&(e=t.top,n=t.left),void 0!==e&&this.css("top","".concat(e,"px")),void 0!==n&&this.css("left","".concat(n,"px")),o.call(this)},e.map=function(t,e){for(var n=[],o=0;o<t.length;o++)n.push(e(t[o],o));return n};var r=Array.prototype.indexOf;e.inArray=function(t,e,n){return null==e?-1:r.call(e,t,n)},e.Event=function(t,n){if(!(this instanceof e.Event))return new e.Event(t,n);this.type=t,this.isDefaultPrevented=function(){return!1}}}}({$:tO.default});var gx={debug:console.log,info:console.info,warning:console.warn,error:console.error},gS=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;n.Model=tT.Kx,n.Collection=tT.pM,n.events=tc,n.__skip=!1,n.defaultRunning=!1,n.loadTriggered=!1,n.destroyed=!1,n._isStoring=!1,n._config=e;var o=n.config;n.set("Config",e),n.set("modules",[]),n.set("toLoad",[]),n.set("storables",[]),n.set("selected",new tk),n.set("dmode",o.dragMode);var r=o.el,i=o.log,a=!0===i?(0,tw.keys)(gx):(0,tw.isArray)(i)?i:[];return(0,tw.bindAll)(n,"initBaseColorPicker"),r&&o.fromElement&&(o.components=r.innerHTML),n.attrsOrig=r?(0,tw.toArray)(r.attributes).reduce(function(t,e){return t[e.nodeName]=e.nodeValue,t},{}):"",o.components&&!o.pageManager&&(o.pageManager={pages:[{component:o.components}]}),g_.forEach(function(t){return n.loadModule(t)}),gC.forEach(function(t){return n.loadStorableModule(t)}),n.on("change:componentHovered",n.componentHovered,n),n.on("change:changesCount",n.updateChanges,n),n.on("change:readyLoad change:readyCanvas",n._checkReady,n),a.forEach(function(t){return n.listenLog(t)}),[{from:"change:selectedComponent",to:"component:toggled"}].forEach(function(t){var e=t.from,o=t.to;n.listenTo(n,e,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];n.trigger.apply(n,gw([o],t,!1)),n.logWarning("The event '".concat(e,"' is deprecated, replace it with '").concat(o,"'"))})}),n}return gg(e,t),e.prototype.defaults=function(){return{editing:0,selected:0,clipboard:null,dmode:0,componentHovered:null,previousModel:null,changesCount:0,storables:[],modules:[],toLoad:[],opened:{},device:""}},Object.defineProperty(e.prototype,"storables",{get:function(){return this.get("storables")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modules",{get:function(){return this.get("modules")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toLoad",{get:function(){return this.get("toLoad")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this.get("selected")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shallow",{get:function(){return this.get("shallow")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"I18n",{get:function(){return this.get("I18n")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Utils",{get:function(){return this.get("Utils")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Commands",{get:function(){return this.get("Commands")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Keymaps",{get:function(){return this.get("Keymaps")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Modal",{get:function(){return this.get("Modal")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Panels",{get:function(){return this.get("Panels")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CodeManager",{get:function(){return this.get("CodeManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"UndoManager",{get:function(){return this.get("UndoManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RichTextEditor",{get:function(){return this.get("RichTextEditor")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Canvas",{get:function(){return this.get("Canvas")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Editor",{get:function(){return this.get("Editor")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Components",{get:function(){return this.get("DomComponents")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Css",{get:function(){return this.get("CssComposer")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Blocks",{get:function(){return this.get("BlockManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Selectors",{get:function(){return this.get("SelectorManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Storage",{get:function(){return this.get("StorageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Traits",{get:function(){return this.get("TraitManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Parser",{get:function(){return this.get("Parser")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Layers",{get:function(){return this.get("LayerManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Assets",{get:function(){return this.get("AssetManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Devices",{get:function(){return this.get("DeviceManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Pages",{get:function(){return this.get("PageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Styles",{get:function(){return this.get("StyleManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DataSources",{get:function(){return this.get("DataSources")},enumerable:!1,configurable:!0}),e.prototype._checkReady=function(){this.get("readyLoad")&&this.get("readyCanvas")&&!this.get("ready")&&this.set("ready",!0)},e.prototype.getContainer=function(){return this.config.el},e.prototype.listenLog=function(t){var e=this;this.listenTo(this,"log:".concat(t),function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(e.config.log){var r=gx[t];null==r||r.apply(void 0,n)}})},Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){var t;return(null===(t=this.config.grapesjs)||void 0===t?void 0:t.version)||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHeadless",{get:function(){return!!this.config.headless},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isShallow",{get:function(){return!!this.get("isShallow")},enumerable:!1,configurable:!0}),e.prototype.initModules=function(){this.modules.forEach(function(t){return t.onInit()})},e.prototype.getConfig=function(t){var e=this.config;return(0,tw.isUndefined)(t)?e:e[t]},e.prototype.loadOnStart=function(){var t=this,n=this.config,o=n.projectData,r=n.headless,i={initial:!0},a=this.Storage;this.toLoad.reverse().forEach(function(t){return t.onLoad()});var s=function(){t.modules.forEach(function(e){return e.postLoad&&e.postLoad(t)}),t.set("readyLoad",1)};r?(o&&this.loadData(o,i),s()):this._storageTimeout=setTimeout(function(){return gy(t,void 0,void 0,function(){var t;return gm(this,function(e){switch(e.label){case 0:if(!o)return[3,1];return this.loadData(o,i),[3,5];case 1:if(!(null==a?void 0:a.canAutoload()))return[3,5];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.load({},i)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.logError(t),[3,5];case 5:return s(),[2]}})})});var l=new e({noticeOnUnload:!1,storageManager:!1,undoManager:!1});l.set({isShallow:!0}),l.Pages.onLoad(),l.Canvas.postLoad(),this.set("shallow",l)},e.prototype.updateChanges=function(t,e,n){var o=this,r=this.Storage,i=this.getDirtyCount();n.isClear||(this.updateItr&&clearTimeout(this.updateItr),this.updateItr=setTimeout(function(){return o.trigger(tc.update)})),this.config.noticeOnUnload&&(window.onbeforeunload=i?function(){return!0}:null),r.isAutosave()&&i>=r.getStepsBeforeSave()&&this.store().catch(function(t){return o.logError(t)})},e.prototype.loadModule=function(t){var e=new t(this);return this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),e},e.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},e.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set("Editor",t)},e.prototype.getEditor=function(){return this.get("Editor")},e.prototype.handleUpdates=function(t,e){var n=this;void 0===t&&(t={}),this.__skip||!this.loadTriggered||t.temporary||t.noCount||t.avoidStore||t.partial||(this.trigger(this.events.updateBefore,e),this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout(function(){var e=n.getDirtyCount()||0;t.unset;var o=gb(t,["unset"]);n.set("changesCount",e+1,o)},0))},e.prototype.changesUp=function(t,e){this.handleUpdates(t,e)},e.prototype.componentHovered=function(t,e,n){var o=this.previous("componentHovered");o&&this.trigger("component:unhovered",o,n),e&&this.trigger("component:hovered",e,n)},e.prototype.getSelected=function(){return this.selected.lastComponent()},e.prototype.getSelectedAll=function(){return this.selected.allComponents()},e.prototype.setSelected=function(t,e){var n=this;void 0===e&&(e={});var o=e.event,r=o&&(o.ctrlKey||o.metaKey),i=(o||{}).shiftKey,a=((0,tw.isArray)(t)?t:[t]).map(function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.delegate)||void 0===e?void 0:e.select)||void 0===n?void 0:n.call(e,t))||t}).filter(Boolean),s=this.getSelectedAll(),l=this.getConfig().multipleSelection,c=(0,tw.isArray)(t);(c||!t)&&this.removeSelected(s.filter(function(t){return!(0,tw.contains)(a,t)})),a.forEach(function(t){if(t&&(n.trigger(tQ.I.selectBefore,t,e),!t.get("selectable")||e.abort)){if(!e.useValid)return;for(var o=t.parent();o&&!o.get("selectable");)o=o.parent();t=o}if(r&&l)return n.toggleSelected(t);if(i&&l){if(n.isEditing())return;n.clearSelection(n.Canvas.getWindow());var a,u,p=t.collection,d=t.index();if(n.getSelectedAll().forEach(function(t){var e=t.collection,n=t.index();e===p&&(n<d?a=(0,tw.isUndefined)(a)?n:Math.max(a,n):n>d&&(u=(0,tw.isUndefined)(u)?n:Math.min(u,n)))}),!(0,tw.isUndefined)(a))for(;a!==d;)n.addSelected(p.at(a),e),a++;if(!(0,tw.isUndefined)(u))for(;u!==d;)n.addSelected(p.at(u),e),u--;return n.addSelected(t,e)}c||n.removeSelected(s.filter(function(e){return e!==t})),n.addSelected(t,e)})},e.prototype.addSelected=function(t,e){var n=this;void 0===e&&(e={}),((0,tw.isArray)(t)?t:[t]).forEach(function(t){var o=n.selected;if(!(!t||!t.get("selectable")||t.parents().some(function(t){return o.hasComponent(t)}))&&(e.forceChange&&n.removeSelected(t,e),o.allComponents().filter(function(e){return(0,tw.contains)(e.parents(),t)}).forEach(function(t){return n.removeSelected(t,e)}),o.addComponent(t,e),n.trigger(tQ.I.select,t,e),n.Canvas.addSpot({type:tZ.F.Select,component:t}),e.activate)){var r=t.getView();(null==r?void 0:r.rendered)?r.onActive(e.event):t.once(tQ.I.render,function(t){return t.view.onActive(e.event)})}})},e.prototype.removeSelected=function(t,e){var n=this;void 0===e&&(e={}),this.selected.removeComponent(t,e),((0,tw.isArray)(t)?t:[t]).forEach(function(t){return n.Canvas.removeSpots({type:tZ.F.Select,component:t})})},e.prototype.toggleSelected=function(t,e){var n=this;void 0===e&&(e={}),((0,tw.isArray)(t)?t:[t]).forEach(function(t){n.selected.hasComponent(t)?n.removeSelected(t,e):n.addSelected(t,e)})},e.prototype.setHovered=function(t,e){var n=this;void 0===e&&(e={});var o=function(t,e){var o=n.config,r=n.Canvas,i=n.getHovered(),a=n.getSelectedAll(),s=tZ.F.Hover,l=tZ.F.Spacing;n.set("componentHovered",t||null,e),i&&(r.removeSpots({type:s,component:i}),r.removeSpots({type:l,component:i})),t&&(r.addSpot({type:s,component:t}),(!a.includes(t)||o.showOffsetsSelected)&&r.addSpot({type:l,component:t}))};if(!t)return o();var r="component:hover";if(e.forceChange&&o(),this.trigger("".concat(r,":before"),t,e),!t.get("hoverable")){if(!e.useValid||e.abort)return;for(var i=t.parent();i&&!i.get("hoverable");)i=i.parent();t=i}e.abort||(o(t,e),this.trigger(r,t,e))},e.prototype.getHovered=function(){return this.get("componentHovered")},e.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.Components.setComponents(t,e)},e.prototype.getComponents=function(){var t=this.Components,e=this.CodeManager;if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},e.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.Css;return n.clear(e),n.getAll().add(t,e),this},e.prototype.addStyle=function(t,e){void 0===e&&(e={});var n=this.getStyle().add(t,e);return(0,tw.isArray)(n)?n:[n]},e.prototype.getStyle=function(){return this.Css.getAll()},e.prototype.setState=function(t){return this.set("state",t),this},e.prototype.getState=function(){return this.get("state")||""},e.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,o=e.jsInHtml?this.getJs(t):"",r=t.component||this.Components.getComponent();return(r?this.CodeManager.getCode(r,"html",gv(gv({},n),t)):"")+(o?"<script>".concat(o,"</script>"):"")},e.prototype.getCss=function(t){void 0===t&&(t={});var e=this.config,n=e.optsCss,o=t.avoidProtected,r=(0,tw.isUndefined)(t.keepUnusedStyles)?e.keepUnusedStyles:t.keepUnusedStyles,i=this.Css,a=t.component||this.Components.getComponent(),s=o?"":e.protectedCss||"",l=a&&this.CodeManager.getCode(a,"css",gv(gv({cssc:i,keepUnusedStyles:r},n),t));return a?t.json?l:s+l:""},e.prototype.getJs=function(t){void 0===t&&(t={});var e=t.component||this.Components.getWrapper();return e?this.CodeManager.getCode(e,"js").trim():""},e.prototype.store=function(t){return gy(this,void 0,void 0,function(){var e,n=this;return gm(this,function(o){switch(o.label){case 0:if(this._isStoring)return[2];return this._isStoring=!0,setTimeout(function(){n.clearDirtyCount()},1),e=this.storeData(),[4,this.Storage.store(e,t)];case 1:return o.sent(),setTimeout(function(){n._isStoring=!1},1),[2,e]}})})},e.prototype.load=function(t){return gy(this,arguments,void 0,function(t,e){var n;return void 0===e&&(e={}),gm(this,function(o){switch(o.label){case 0:return[4,this.Storage.load(t)];case 1:return n=o.sent(),this.loadData(n,e),[4,(0,t_.wait)()];case 2:return o.sent(),e.clear&&(this.UndoManager.clear(),this.clearDirtyCount()),[2,n]}})})},e.prototype.storeData=function(){var t={},e=this.getEditing();e&&e.trigger("sync:content",{noCount:!0}),this.storables.forEach(function(e){t=gv(gv({},t),e.store(1))});var n=JSON.parse(JSON.stringify(t));return this.trigger(tc.projectGet,{project:n}),n},e.prototype.loadData=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={project:t,options:e,initial:!!e.initial},o=!1;return(0,t_.isEmptyObj)(t)||(this.storables.forEach(function(t){return t.clear()}),this.storables.forEach(function(e){return e.load(t)}),o=!0),this.trigger(tc.projectLoad,gv(gv({},n),{loaded:o})),o&&this.trigger(tc.projectLoaded,n),t},e.prototype.getDeviceModel=function(){var t=this.get("device");return this.Devices.get(t)},e.prototype.runDefault=function(t){void 0===t&&(t={});var e=this.Commands.get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=!0)},e.prototype.stopDefault=function(t){void 0===t&&(t={});var e=this.Commands;if(e){var n=e.get(this.config.defaultCommand);n&&this.defaultRunning&&(n.stop(this,this,t),this.defaultRunning=!1)}},e.prototype.refreshCanvas=function(t){void 0===t&&(t={}),this.Canvas.refresh({spots:t.tools})},e.prototype.clearSelection=function(t){var e;null===(e=(t||window).getSelection())||void 0===e||e.removeAllRanges()},e.prototype.getCurrentMedia=function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,o=t.devicePreviewMode,r=e&&e.get("widthMedia");return e&&r&&!o?"(".concat(n,": ").concat(r,")"):""},e.prototype.getWrapper=function(){return this.Components.getWrapper()},e.prototype.setCurrentFrame=function(t){return this.set("currentFrame",t)},e.prototype.getCurrentFrame=function(){return this.get("currentFrame")},e.prototype.getCurrentFrameModel=function(){var t;return null===(t=this.getCurrentFrame()||{})||void 0===t?void 0:t.model},e.prototype.getIcon=function(t){return(this.config.icons||{})[t]||""},e.prototype.getDirtyCount=function(){return this.get("changesCount")},e.prototype.clearDirtyCount=function(){return this.set({changesCount:0},{isClear:!0})},e.prototype.getZoomDecimal=function(){return this.Canvas.getZoomDecimal()},e.prototype.getZoomMultiplier=function(){return this.Canvas.getZoomMultiplier()},e.prototype.setDragMode=function(t){return this.set("dmode",t)},e.prototype.getDragMode=function(t){return(null==t?void 0:t.getDragMode())||this.get("dmode")||""},e.prototype.t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.get("I18n");return null==n?void 0:n.t.apply(n,t)},e.prototype.inAbsoluteMode=function(t){return"absolute"===this.getDragMode(t)},e.prototype.destroyAll=function(){var t=this,e=this.config,n=this.view;this.trigger(tc.destroy);var o=this.getEditor(),r=(e.grapesjs||{}).editors,i=void 0===r?[]:r,a=this.get("shallow");this._storageTimeout&&clearTimeout(this._storageTimeout),null==a||a.destroyAll(),this.stopListening(),this.stopDefault(),(this.modules||[]).slice().reverse().forEach(function(t){return t.destroy()}),(null==n?void 0:n.remove)&&n.remove(),this.clear({silent:!0}),this.destroyed=!0,["_config","view","_previousAttributes","_events","_listeners"].forEach(function(e){return t[e]={}}),i.splice(i.indexOf(o),1),(0,t_.hasWin)()&&(0,tO.default)(e.el).empty().attr(this.attrsOrig),this.trigger(tc.destroyed)},e.prototype.getEditing=function(){var t=this.get("editing");return t&&t.model||void 0},e.prototype.setEditing=function(t){return this.set("editing",t),this},e.prototype.isEditing=function(){return!!this.get("editing")},e.prototype.log=function(t,e){void 0===e&&(e={});var n=tc.log,o=e.ns,r=e.level,i=void 0===r?"debug":r;if(this.trigger(n,t,e),i&&this.trigger("".concat(n,":").concat(i),t,e),o){var a="".concat(n,"-").concat(o);this.trigger(a,t,e),i&&this.trigger("".concat(a,":").concat(i),t,e)}},e.prototype.logInfo=function(t,e){this.log(t,gv(gv({},e),{level:"info"}))},e.prototype.logWarning=function(t,e){this.log(t,gv(gv({},e),{level:"warning"}))},e.prototype.logError=function(t,e){this.log(t,gv(gv({},e),{level:"error"}))},e.prototype.initBaseColorPicker=function(t,e){void 0===e&&(e={});var n=this.config,o=n.colorPicker,r=n.el,i=n.stylePrefix;return(0,tO.default)(t).spectrum(gv(gv({containerClassName:"".concat(i,"one-bg ").concat(i,"two-color"),appendTo:r||"body",maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:"Ok",cancelText:"⨯"},e),void 0===o?{}:o))},e.prototype.skip=function(t){this.__skip=!0;var e=this.UndoManager;e?e.skip(t):t(),this.__skip=!1},e.prototype.data=function(t,e,n){var o="_gjs-data";if(t[o]||(t[o]={}),(0,tw.isUndefined)(n))return t[o][e];t[o][e]=n},e}(tT.Kx),gO=(tr=function(t,e){return(tr=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}tr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),gT=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},gP=function(t){function e(e){var n=t.call(this,{model:e})||this,o=e.Panels,r=e.UndoManager;return e.view=n,e.once("change:ready",function(){o.active(),o.disableButtons(),e.getConfig().telemetry&&n.sendTelemetryData().catch(function(){}),setTimeout(function(){e.trigger(tc.load,e.Editor),e.loadTriggered=!0,r.clear(),e.clearDirtyCount()})}),n}return gO(e,t),e.prototype.render=function(){var t=this,e=this.$el,n=this.model,o=n.Panels,r=n.Canvas,i=n.config,a=n.modules,s=i.stylePrefix,l=["".concat(s,"editor")];i.customUI||l.push("".concat(s,"one-bg ").concat(s,"two-color"));var c=(0,tO.default)(i.el||"body ".concat(i.container));i.cssIcons&&(0,t_.appendStyles)(i.cssIcons,{unique:!0,prepand:!0}),e.empty(),i.width&&c.css("width",i.width),i.height&&c.css("height",i.height),e.append(r.render()),e.append(o.render());var u=n.shallow.Canvas.render();return u.style.display="none",e.append(u),e.attr("class",l.join(" ")),c.addClass("".concat(s,"editor-cont")).empty().append(e),a.forEach(function(e){var n;return null===(n=e.postRender)||void 0===n?void 0:n.call(e,t)}),this},e.prototype.sendTelemetryData=function(){var t,e,n,o;return t=this,e=void 0,n=void 0,o=function(){var t,e,n,o,r,i,a,s;return gT(this,function(l){switch(l.label){case 0:if("localhost"===(t=window.location.hostname)||t.includes("localhost")||(e="gjs_telemetry_sent_",n=this.model.version,o="".concat(e).concat(n),sessionStorage.getItem(o)))return[2];return r="https://app.grapesjs.com",[4,fetch("".concat(r,"/api/gjs/telemetry/collect"),{method:"POST",body:JSON.stringify({domain:t,version:n})})];case 1:if((i=l.sent()).ok)return[3,3];return a=Error.bind,s="Failed to send telemetry data ".concat,[4,i.text()];case 2:throw new(a.apply(Error,[void 0,s.apply("Failed to send telemetry data ",[l.sent()])]));case 3:return sessionStorage.setItem(o,"true"),Object.keys(sessionStorage).forEach(function(t){t.startsWith(e)&&t!==o&&sessionStorage.removeItem(t)}),this.trigger(tc.telemetryInit),[2]}})},new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},e}(tT.Ss),gE=function(){return(gE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},gk=function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((o=o.apply(t,e||[])).next())})},gA=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},gj=function(t,e,n){if(n||2==arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},gM=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.events=tc,this.html=tC;var n,o={stylePrefix:"gjs-",components:"",style:"",fromElement:!1,projectData:void 0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:"900px",width:"100%",log:["warning","error"],baseCss:"",protectedCss:"* { box-sizing: border-box; } body {margin: 0;}",canvasCss:"",defaultCommand:"select-comp",showToolbar:!0,showDevices:!0,devicePreviewMode:!1,mediaCondition:"max-width",tagVarStart:"{[ ",tagVarEnd:" ]}",jsInHtml:!0,nativeDnD:!0,multipleSelection:!0,optsHtml:{},optsCss:{},avoidInlineStyle:!0,avoidDefaults:!0,clearStyles:!1,listenToEl:[],cssIcons:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",icons:{close:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',move:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>',plus:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>',caret:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7,10L12,15L17,10H7Z" /></svg>',delete:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>',copy:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" /></svg>',arrowUp:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z" /></svg>',chevron:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z" /></svg>',eye:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" /></svg>',eyeOff:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" /></svg>'},i18n:{},undoManager:{},assetManager:{},canvas:{},layerManager:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:!1,customUI:!1,telemetry:!0};this.config=gE(gE(gE({},o),t),{pStylePrefix:null!==(n=t.stylePrefix)&&void 0!==n?n:o.stylePrefix}),this.em=new gS(this.config),this.$=e.$,this.em.init(this),this.editor=this.em}return Object.defineProperty(t.prototype,"Config",{get:function(){return this.em.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"I18n",{get:function(){return this.em.I18n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Utils",{get:function(){return this.em.Utils},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Commands",{get:function(){return this.em.Commands},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Keymaps",{get:function(){return this.em.Keymaps},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Modal",{get:function(){return this.em.Modal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Panels",{get:function(){return this.em.Panels},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Canvas",{get:function(){return this.em.Canvas},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Parser",{get:function(){return this.em.Parser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CodeManager",{get:function(){return this.em.CodeManager},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UndoManager",{get:function(){return this.em.UndoManager},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RichTextEditor",{get:function(){return this.em.RichTextEditor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Pages",{get:function(){return this.em.Pages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Components",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DomComponents",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Layers",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LayerManager",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Css",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CssComposer",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Storage",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StorageManager",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Assets",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AssetManager",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Blocks",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BlockManager",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Traits",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TraitManager",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Selectors",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SelectorManager",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Styles",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StyleManager",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Devices",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DeviceManager",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DataSources",{get:function(){return this.em.DataSources},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"EditorModel",{get:function(){return this.em},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t){return this.em.getConfig(t)},t.prototype.getHtml=function(t){return this.em.getHtml(t)},t.prototype.getCss=function(t){return this.em.getCss(t)},t.prototype.getJs=function(t){return this.em.getJs(t)},t.prototype.getComponents=function(){return this.Components.getComponents()},t.prototype.getWrapper=function(){return this.Components.getWrapper()},t.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.em.setComponents(t,e),this},t.prototype.addComponents=function(t,e){return this.getWrapper().append(t,e)},t.prototype.getStyle=function(){return this.em.Css.getAll()},t.prototype.setStyle=function(t,e){return void 0===e&&(e={}),this.em.setStyle(t,e),this},t.prototype.addStyle=function(t,e){return void 0===e&&(e={}),this.em.addStyle(t,e)},t.prototype.getSelected=function(){return this.em.getSelected()},t.prototype.getSelectedAll=function(){return this.em.getSelectedAll()},t.prototype.getSelectedToStyle=function(){var t=this.em.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},t.prototype.select=function(t,e){return this.em.setSelected(t,e),this},t.prototype.selectAdd=function(t){return this.em.addSelected(t),this},t.prototype.selectRemove=function(t){return this.em.removeSelected(t),this},t.prototype.selectToggle=function(t){return this.em.toggleSelected(t),this},t.prototype.getEditing=function(){return this.em.getEditing()},t.prototype.setDevice=function(t){return this.em.set("device",t),this},t.prototype.getDevice=function(){return this.em.get("device")},t.prototype.runCommand=function(t,e){return void 0===e&&(e={}),this.Commands.run(t,e)},t.prototype.stopCommand=function(t,e){return void 0===e&&(e={}),this.Commands.stop(t,e)},t.prototype.store=function(t){return gk(this,void 0,void 0,function(){return gA(this,function(e){switch(e.label){case 0:return[4,this.em.store(t)];case 1:return[2,e.sent()]}})})},t.prototype.load=function(t){return gk(this,arguments,void 0,function(t,e){return void 0===e&&(e={}),gA(this,function(n){switch(n.label){case 0:return[4,this.em.load(t,e)];case 1:return[2,n.sent()]}})})},t.prototype.getProjectData=function(){return this.em.storeData()},t.prototype.loadProjectData=function(t,e){return void 0===e&&(e={}),this.em.loadData(t,e)},t.prototype.storeData=function(){return this.em.storeData()},t.prototype.loadData=function(t){return this.em.loadData(t)},t.prototype.getContainer=function(){return this.config.el},t.prototype.getDirtyCount=function(){return this.em.getDirtyCount()},t.prototype.clearDirtyCount=function(){return this.em.clearDirtyCount()},t.prototype.refresh=function(t){this.em.refreshCanvas(t)},t.prototype.setCustomRte=function(t){this.RichTextEditor.customRte=t},t.prototype.setCustomParserCss=function(t){return this.Parser.getConfig().parserCss=t,this},t.prototype.setDragMode=function(t){return this.em.setDragMode(t),this},t.prototype.log=function(t,e){return void 0===e&&(e={}),this.em.log(t,e),this},t.prototype.t=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.em).t.apply(t,e)},t.prototype.on=function(t,e){return this.em.on(t,e),this},t.prototype.once=function(t,e){return this.em.once(t,e),this},t.prototype.off=function(t,e){return this.em.off(t,e),this},t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.em.trigger.apply(this.em,gj([t],e,!0)),this},t.prototype.destroy=function(){this.em&&(this.em.destroyAll(),this.editorView=void 0)},t.prototype.getEl=function(){var t;return null===(t=this.editorView)||void 0===t?void 0:t.el},t.prototype.getModel=function(){return this.em},t.prototype.render=function(){var t;return null===(t=this.editorView)||void 0===t||t.remove(),this.editorView=new gP(this.em),this.editorView.render().el},t.prototype.onReady=function(t){this.em.get("ready")?t(this):this.em.on("load",t)},t}(),gD=function(t,e){var n=e.get(t);if(!n){var o=(0,t_.getGlobal)()[t];n=(null==o?void 0:o.default)||o}return n},gL=function(t,e){return(0,tw.isString)(t)?gD(t,e):(null==t?void 0:t.default)||t},gI=function(t,e){t.getModel().logWarning("Plugin ".concat(e," not found"),{context:"plugins",plugin:e})},gN=function(){function t(){this.plugins={}}return t.prototype.add=function(t,e){return this.get(t)||(this.plugins[t]=e,e)},t.prototype.get=function(t){return this.plugins[t]},t.prototype.getAll=function(){return this.plugins},t}(),gR=function(){return(gR=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};!function(){if((0,t_.hasWin)()&&function(){for(var t,e=window.navigator.userAgent,n=[["edge",/Edge\/([0-9\._]+)/],["ie",/MSIE\s(7\.0)/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],o=0;o<n.length&&!(t=n[o][1].exec(e));o++);return!!t}()){var t=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(e){return e||(e=""),t.apply(document.implementation,[e])}}}();var gV=new gN,gF=[],gH=function(t,e){var n=gL(t,gV);return function(o){n?n(o,e||{}):gI(o,t)}},gU={$:tO.default,editors:gF,plugins:gV,usePlugin:gH,version:"0.22.14",init:function(t){void 0===t&&(t={});var e=t.headless,n=t.container;if(!n&&!e)throw Error("'container' is required");var o=gR(gR({autorender:!0,plugins:[],pluginsOpts:{}},t),{grapesjs:this,el:e?void 0:(0,tw.isElement)(n)?n:document.querySelector(n)}),r=new gM(o,{$:tO.default}),i=r.getModel();return i.initModules(),o.plugins.forEach(function(t){var e=gL(t,gV),n=o.pluginsOpts[t]||{};e?e(r,n):gI(r,t)}),i.loadOnStart(),o.autorender&&!e&&r.render(),gF.push(r),r}};let gB=gU;var gz=tb.Ay,gW=tb.I0,g$=tb.nu}}]);