@jirathip-dev/blocks 0.0.0 → 2.2.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 (191) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/package.json +48 -1
  4. package/web/dist/blocks.css +1 -0
  5. package/web/dist/blocks.js +10 -0
  6. package/web/dist/blocks.scoped.css +1 -0
  7. package/web/dist/core.js +9749 -0
  8. package/web/dist/import.js +2 -0
  9. package/web/dist/react.js +4073 -0
  10. package/web/dist/scan.js +22 -0
  11. package/web/dist/types/react/src/act.d.ts +71 -0
  12. package/web/dist/types/react/src/arrange.d.ts +10 -0
  13. package/web/dist/types/react/src/block.d.ts +41 -0
  14. package/web/dist/types/react/src/draw.d.ts +34 -0
  15. package/web/dist/types/react/src/fields/_input.d.ts +16 -0
  16. package/web/dist/types/react/src/fields/_view.d.ts +27 -0
  17. package/web/dist/types/react/src/fields/picker.d.ts +3 -0
  18. package/web/dist/types/react/src/fields/scan.d.ts +3 -0
  19. package/web/dist/types/react/src/fields/search.d.ts +14 -0
  20. package/web/dist/types/react/src/fields/secret.d.ts +3 -0
  21. package/web/dist/types/react/src/fields/slider.d.ts +5 -0
  22. package/web/dist/types/react/src/fields/text.d.ts +3 -0
  23. package/web/dist/types/react/src/fields/toggle.d.ts +3 -0
  24. package/web/dist/types/react/src/fields/upload.d.ts +7 -0
  25. package/web/dist/types/react/src/gen/fields.d.ts +2 -0
  26. package/web/dist/types/react/src/gen/views.d.ts +2 -0
  27. package/web/dist/types/react/src/h.d.ts +7 -0
  28. package/web/dist/types/react/src/index.d.ts +3 -0
  29. package/web/dist/types/react/src/island.d.ts +7 -0
  30. package/web/dist/types/react/src/kinds/button.d.ts +5 -0
  31. package/web/dist/types/react/src/kinds/card.d.ts +5 -0
  32. package/web/dist/types/react/src/kinds/chips.d.ts +5 -0
  33. package/web/dist/types/react/src/kinds/choice.d.ts +5 -0
  34. package/web/dist/types/react/src/kinds/composer.d.ts +5 -0
  35. package/web/dist/types/react/src/kinds/config.d.ts +5 -0
  36. package/web/dist/types/react/src/kinds/diagram.d.ts +7 -0
  37. package/web/dist/types/react/src/kinds/diff.d.ts +7 -0
  38. package/web/dist/types/react/src/kinds/editor.d.ts +5 -0
  39. package/web/dist/types/react/src/kinds/form.d.ts +22 -0
  40. package/web/dist/types/react/src/kinds/hero.d.ts +5 -0
  41. package/web/dist/types/react/src/kinds/images.d.ts +5 -0
  42. package/web/dist/types/react/src/kinds/import.d.ts +5 -0
  43. package/web/dist/types/react/src/kinds/list.d.ts +6 -0
  44. package/web/dist/types/react/src/kinds/media.d.ts +6 -0
  45. package/web/dist/types/react/src/kinds/message.d.ts +5 -0
  46. package/web/dist/types/react/src/kinds/modal.d.ts +5 -0
  47. package/web/dist/types/react/src/kinds/nav.d.ts +5 -0
  48. package/web/dist/types/react/src/kinds/pages.d.ts +5 -0
  49. package/web/dist/types/react/src/kinds/prose.d.ts +5 -0
  50. package/web/dist/types/react/src/kinds/row.d.ts +5 -0
  51. package/web/dist/types/react/src/kinds/run.d.ts +5 -0
  52. package/web/dist/types/react/src/kinds/scene.d.ts +5 -0
  53. package/web/dist/types/react/src/kinds/screen.d.ts +5 -0
  54. package/web/dist/types/react/src/kinds/secret.d.ts +5 -0
  55. package/web/dist/types/react/src/kinds/section.d.ts +5 -0
  56. package/web/dist/types/react/src/kinds/sheet.d.ts +1 -0
  57. package/web/dist/types/react/src/kinds/sidebar.d.ts +5 -0
  58. package/web/dist/types/react/src/kinds/stat.d.ts +5 -0
  59. package/web/dist/types/react/src/kinds/steps.d.ts +7 -0
  60. package/web/dist/types/react/src/kinds/table.d.ts +5 -0
  61. package/web/dist/types/react/src/kinds/text.d.ts +5 -0
  62. package/web/dist/types/react/src/kinds/timeline.d.ts +5 -0
  63. package/web/dist/types/react/src/kinds/tool.d.ts +5 -0
  64. package/web/dist/types/react/src/kinds/web.d.ts +5 -0
  65. package/web/dist/types/react/src/view.d.ts +14 -0
  66. package/web/dist/types/src/arrange.d.ts +8 -0
  67. package/web/dist/types/src/behave.d.ts +1 -0
  68. package/web/dist/types/src/core/apply.d.ts +7 -0
  69. package/web/dist/types/src/core/built.d.ts +7 -0
  70. package/web/dist/types/src/core/check.d.ts +5 -0
  71. package/web/dist/types/src/core/code.d.ts +7 -0
  72. package/web/dist/types/src/core/eval.d.ts +25 -0
  73. package/web/dist/types/src/core/field/files.d.ts +53 -0
  74. package/web/dist/types/src/core/field/match.d.ts +15 -0
  75. package/web/dist/types/src/core/field/slider.d.ts +3 -0
  76. package/web/dist/types/src/core/gate.d.ts +7 -0
  77. package/web/dist/types/src/core/gesture.d.ts +53 -0
  78. package/web/dist/types/src/core/index.d.ts +21 -0
  79. package/web/dist/types/src/core/kind/boxplot.d.ts +7 -0
  80. package/web/dist/types/src/core/kind/chart.d.ts +18 -0
  81. package/web/dist/types/src/core/kind/diagram.d.ts +44 -0
  82. package/web/dist/types/src/core/kind/import.d.ts +40 -0
  83. package/web/dist/types/src/core/kind/list.d.ts +3 -0
  84. package/web/dist/types/src/core/kind/media.d.ts +36 -0
  85. package/web/dist/types/src/core/kind/message.d.ts +4 -0
  86. package/web/dist/types/src/core/kind/modal.d.ts +23 -0
  87. package/web/dist/types/src/core/kind/plot.d.ts +22 -0
  88. package/web/dist/types/src/core/kind/prose.d.ts +5 -0
  89. package/web/dist/types/src/core/kind/sidebar.d.ts +7 -0
  90. package/web/dist/types/src/core/kind/table.d.ts +26 -0
  91. package/web/dist/types/src/core/kind/timeline.d.ts +28 -0
  92. package/web/dist/types/src/core/layout.d.ts +9 -0
  93. package/web/dist/types/src/core/look.d.ts +11 -0
  94. package/web/dist/types/src/core/nonce.d.ts +1 -0
  95. package/web/dist/types/src/core/share.d.ts +1 -0
  96. package/web/dist/types/src/core/table.d.ts +6 -0
  97. package/web/dist/types/src/core/text.d.ts +6 -0
  98. package/web/dist/types/src/core/tree.d.ts +12 -0
  99. package/web/dist/types/src/dump.d.ts +2 -0
  100. package/web/dist/types/src/edits.d.ts +18 -0
  101. package/web/dist/types/src/gen/builders.d.ts +64 -0
  102. package/web/dist/types/src/gen/fields.d.ts +2 -0
  103. package/web/dist/types/src/gen/hooks.d.ts +11 -0
  104. package/web/dist/types/src/gen/kinds.d.ts +9 -0
  105. package/web/dist/types/src/gen/layout.d.ts +19 -0
  106. package/web/dist/types/src/gen/schemes.d.ts +73 -0
  107. package/web/dist/types/src/gen/shapes.d.ts +61 -0
  108. package/web/dist/types/src/gen/types.d.ts +1517 -0
  109. package/web/dist/types/src/gen/words-import.d.ts +1 -0
  110. package/web/dist/types/src/gen/words.d.ts +1 -0
  111. package/web/dist/types/src/gesture.d.ts +54 -0
  112. package/web/dist/types/src/island.d.ts +3 -0
  113. package/web/dist/types/src/lazy/import.d.ts +13 -0
  114. package/web/dist/types/src/modal.d.ts +14 -0
  115. package/web/dist/types/src/motion.d.ts +2 -0
  116. package/web/dist/types/src/paging.d.ts +2 -0
  117. package/web/dist/types/src/patch.d.ts +17 -0
  118. package/web/dist/types/src/render/act.d.ts +9 -0
  119. package/web/dist/types/src/render/block.d.ts +5 -0
  120. package/web/dist/types/src/render/ctx.d.ts +34 -0
  121. package/web/dist/types/src/render/dom.d.ts +16 -0
  122. package/web/dist/types/src/render/field/_input.d.ts +3 -0
  123. package/web/dist/types/src/render/field/_view.d.ts +26 -0
  124. package/web/dist/types/src/render/field/picker.d.ts +3 -0
  125. package/web/dist/types/src/render/field/scan.d.ts +3 -0
  126. package/web/dist/types/src/render/field/search.d.ts +5 -0
  127. package/web/dist/types/src/render/field/secret.d.ts +3 -0
  128. package/web/dist/types/src/render/field/slider.d.ts +5 -0
  129. package/web/dist/types/src/render/field/text.d.ts +3 -0
  130. package/web/dist/types/src/render/field/toggle.d.ts +3 -0
  131. package/web/dist/types/src/render/field/upload.d.ts +5 -0
  132. package/web/dist/types/src/render/kind/boxplot.d.ts +3 -0
  133. package/web/dist/types/src/render/kind/button.d.ts +3 -0
  134. package/web/dist/types/src/render/kind/card.d.ts +3 -0
  135. package/web/dist/types/src/render/kind/chart.d.ts +4 -0
  136. package/web/dist/types/src/render/kind/chips.d.ts +3 -0
  137. package/web/dist/types/src/render/kind/choice.d.ts +3 -0
  138. package/web/dist/types/src/render/kind/composer.d.ts +3 -0
  139. package/web/dist/types/src/render/kind/config.d.ts +3 -0
  140. package/web/dist/types/src/render/kind/diagram.d.ts +3 -0
  141. package/web/dist/types/src/render/kind/diff.d.ts +3 -0
  142. package/web/dist/types/src/render/kind/editor.d.ts +3 -0
  143. package/web/dist/types/src/render/kind/form.d.ts +14 -0
  144. package/web/dist/types/src/render/kind/heat.d.ts +3 -0
  145. package/web/dist/types/src/render/kind/hero.d.ts +3 -0
  146. package/web/dist/types/src/render/kind/images.d.ts +3 -0
  147. package/web/dist/types/src/render/kind/import.d.ts +3 -0
  148. package/web/dist/types/src/render/kind/island.d.ts +3 -0
  149. package/web/dist/types/src/render/kind/lines.d.ts +5 -0
  150. package/web/dist/types/src/render/kind/list.d.ts +3 -0
  151. package/web/dist/types/src/render/kind/media.d.ts +4 -0
  152. package/web/dist/types/src/render/kind/message.d.ts +3 -0
  153. package/web/dist/types/src/render/kind/modal.d.ts +9 -0
  154. package/web/dist/types/src/render/kind/nav.d.ts +2 -0
  155. package/web/dist/types/src/render/kind/pages.d.ts +2 -0
  156. package/web/dist/types/src/render/kind/plot.d.ts +3 -0
  157. package/web/dist/types/src/render/kind/prose.d.ts +4 -0
  158. package/web/dist/types/src/render/kind/row.d.ts +3 -0
  159. package/web/dist/types/src/render/kind/run.d.ts +3 -0
  160. package/web/dist/types/src/render/kind/scene.d.ts +3 -0
  161. package/web/dist/types/src/render/kind/screen.d.ts +3 -0
  162. package/web/dist/types/src/render/kind/secret.d.ts +3 -0
  163. package/web/dist/types/src/render/kind/section.d.ts +3 -0
  164. package/web/dist/types/src/render/kind/sheet.d.ts +1 -0
  165. package/web/dist/types/src/render/kind/sidebar.d.ts +3 -0
  166. package/web/dist/types/src/render/kind/stat.d.ts +2 -0
  167. package/web/dist/types/src/render/kind/steps.d.ts +3 -0
  168. package/web/dist/types/src/render/kind/table.d.ts +3 -0
  169. package/web/dist/types/src/render/kind/text.d.ts +3 -0
  170. package/web/dist/types/src/render/kind/timeline.d.ts +3 -0
  171. package/web/dist/types/src/render/kind/toast.d.ts +4 -0
  172. package/web/dist/types/src/render/kind/tool.d.ts +3 -0
  173. package/web/dist/types/src/render/kind/web.d.ts +2 -0
  174. package/web/dist/types/src/render/more.d.ts +11 -0
  175. package/web/dist/types/src/render/text.d.ts +5 -0
  176. package/web/dist/types/src/scan/index.d.ts +26 -0
  177. package/web/dist/types/src/scan/page.d.ts +18 -0
  178. package/web/dist/types/src/shell/adopt.d.ts +8 -0
  179. package/web/dist/types/src/shell/host.d.ts +30 -0
  180. package/web/dist/types/src/shell/layout.d.ts +29 -0
  181. package/web/dist/types/src/shell/local.d.ts +10 -0
  182. package/web/dist/types/src/shell/look.d.ts +15 -0
  183. package/web/dist/types/src/shell/mount.d.ts +34 -0
  184. package/web/dist/types/src/shell/sheet.d.ts +17 -0
  185. package/web/dist/types/src/shell/source.d.ts +12 -0
  186. package/web/dist/types/src/shell/store.d.ts +2 -0
  187. package/web/dist/types/src/shell.d.ts +26 -0
  188. package/web/dist/types/src/sidebar.d.ts +2 -0
  189. package/web/dist/types/src/stream.d.ts +28 -0
  190. package/web/dist/types/src/theme.d.ts +24 -0
  191. package/web/dist/types/src/toasts.d.ts +7 -0
@@ -0,0 +1,2 @@
1
+ var h=e=>e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;var x={boxplot:"Boxplot",button:"Button",card:"Card",chart:"Chart",chips:"Chips",choice:"Choice",composer:"Composer",config:"Form",diagram:"Diagram",diff:"Diff",editor:"Editor",form:"Form",glance:"Glance",heat:"Heat",hero:"Hero",images:"Images",import:"Import",island:"Island",lines:"Lines",list:"List",media:"Media",message:"Message",modal:"Modal",nav:"Nav",pages:"Pages",plot:"Plot",prose:"Prose",row:"Row",run:"Run",scene:"Scene",screen:"Screen",secret:"Secret",section:"Section",sheet:"Modal",sidebar:"Sidebar",stat:"Stat",steps:"Steps",table:"Table",text:"Text",timeline:"Timeline",toast:"Toast",tool:"Tool",web:"Web"};var ne=Object.keys(x);var w=e=>{let t=e.replace(/[\u0000-\u0020\u007f-\u009f]/g,"").split(/[/?#]/,1)[0]??"",n=t.indexOf(":");return n<0||["http","https","mailto"].includes(t.slice(0,n).toLowerCase())};var q={was:["was","\u0E40\u0E14\u0E34\u0E21"],set:["set \u2713 \xB7 type to replace","\u0E15\u0E31\u0E49\u0E07\u0E44\u0E27\u0E49\u0E41\u0E25\u0E49\u0E27 \u2713 \xB7 \u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48"],unset:["not set","\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E15\u0E31\u0E49\u0E07"],clear:["clear","\u0E25\u0E49\u0E32\u0E07"],hits:["{n} of {m}","{n} \u0E08\u0E32\u0E01 {m}"],none:["no match","\u0E44\u0E21\u0E48\u0E1E\u0E1A"],busy:["searching","\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E49\u0E19\u0E2B\u0E32"],nomatch:["No rows match \u201C{q}\u201D.","\u0E44\u0E21\u0E48\u0E21\u0E35\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A \u201C{q}\u201D"],file1:["choose file","\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C"],fileN:["add files","\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E44\u0E1F\u0E25\u0E4C"],photo1:["choose photo","\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E39\u0E1B"],photoN:["add photos","\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E23\u0E39\u0E1B"],camera:["take photo","\u0E16\u0E48\u0E32\u0E22\u0E23\u0E39\u0E1B"],replace:["replace","\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19"],remove:["remove","\u0E25\u0E1A"],retry:["retry","\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07"],dismiss:["dismiss","\u0E1B\u0E34\u0E14"],image:["images","\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E"],pdf:["PDF","PDF"],sheet:["sheets","\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E32\u0E23\u0E32\u0E07"],or:[" or "," \u0E2B\u0E23\u0E37\u0E2D "],upTo:["up to {mb} MB","\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 {mb} MB"],each:["up to {mb} MB each","\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 {mb} MB \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"],uploading:["uploading {p} %","\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14 {p} %"],failed:["upload failed","\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08"],onlyType:["refused: only {types}","\u0E44\u0E21\u0E48\u0E23\u0E31\u0E1A: \u0E23\u0E31\u0E1A\u0E40\u0E09\u0E1E\u0E32\u0E30{types}"],tooBig:["refused: {size} is over {mb} MB","\u0E44\u0E21\u0E48\u0E23\u0E31\u0E1A: {size} \u0E40\u0E01\u0E34\u0E19 {mb} MB"],off:["uploads are off here","\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48"],wait1:["waiting for {n} upload","\u0E23\u0E2D\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14 {n} \u0E44\u0E1F\u0E25\u0E4C"],waitN:["waiting for {n} uploads","\u0E23\u0E2D\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14 {n} \u0E44\u0E1F\u0E25\u0E4C"],stuck:["an upload failed: retry or remove it","\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08: \u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E25\u0E1A"],files:["{label}, {n} files","{label}, {n} \u0E44\u0E1F\u0E25\u0E4C"],scan:["scan pages","\u0E2A\u0E41\u0E01\u0E19\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23"],rescan:["scan again","\u0E2A\u0E41\u0E01\u0E19\u0E43\u0E2B\u0E21\u0E48"],scanHint:["makes one A4 PDF \xB7 up to {max} pages","\u0E44\u0E14\u0E49 PDF \u0E02\u0E19\u0E32\u0E14 A4 \u0E2B\u0E19\u0E36\u0E48\u0E07\u0E44\u0E1F\u0E25\u0E4C \xB7 \u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 {max} \u0E2B\u0E19\u0E49\u0E32"],editPages:["edit pages","\u0E41\u0E01\u0E49\u0E2B\u0E19\u0E49\u0E32"],scanned1:["1 page \xB7 A4 \xB7 {kb} KB","1 \u0E2B\u0E19\u0E49\u0E32 \xB7 A4 \xB7 {kb} KB"],scannedN:["{n} pages \xB7 A4 \xB7 {kb} KB","{n} \u0E2B\u0E19\u0E49\u0E32 \xB7 A4 \xB7 {kb} KB"],scanOff:["scanning is off here","\u0E2A\u0E41\u0E01\u0E19\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48"],cancel:["cancel","\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01"],pickImages:["pick images","\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E39\u0E1B"],pageN:["page {n}","\u0E2B\u0E19\u0E49\u0E32 {n}"],pageOf:["page {n} of {of}","\u0E2B\u0E19\u0E49\u0E32 {n} \u0E08\u0E32\u0E01 {of}"],seek:["looking for the page's edges","\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2B\u0E32\u0E02\u0E2D\u0E1A\u0E01\u0E23\u0E30\u0E14\u0E32\u0E29"],found:["page found: hold still and take it","\u0E1E\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E23\u0E30\u0E14\u0E32\u0E29: \u0E16\u0E37\u0E2D\u0E19\u0E34\u0E48\u0E07\u0E46 \u0E41\u0E25\u0E49\u0E27\u0E16\u0E48\u0E32\u0E22"],noEdge:["no page edge found: fill the frame with the page, or take it and set the corners by hand","\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E02\u0E2D\u0E1A\u0E01\u0E23\u0E30\u0E14\u0E32\u0E29: \u0E43\u0E2B\u0E49\u0E01\u0E23\u0E30\u0E14\u0E32\u0E29\u0E40\u0E15\u0E47\u0E21\u0E01\u0E23\u0E2D\u0E1A \u0E2B\u0E23\u0E37\u0E2D\u0E16\u0E48\u0E32\u0E22\u0E41\u0E25\u0E49\u0E27\u0E15\u0E31\u0E49\u0E07\u0E21\u0E38\u0E21\u0E40\u0E2D\u0E07"],take:["take page {n}","\u0E16\u0E48\u0E32\u0E22\u0E2B\u0E19\u0E49\u0E32 {n}"],done1:["done \xB7 1 page","\u0E40\u0E2A\u0E23\u0E47\u0E08 \xB7 1 \u0E2B\u0E19\u0E49\u0E32"],doneN:["done \xB7 {n} pages","\u0E40\u0E2A\u0E23\u0E47\u0E08 \xB7 {n} \u0E2B\u0E19\u0E49\u0E32"],retake:["retake","\u0E16\u0E48\u0E32\u0E22\u0E43\u0E2B\u0E21\u0E48"],usePage:["use page","\u0E43\u0E0A\u0E49\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49"],reset:["reset corners","\u0E04\u0E37\u0E19\u0E21\u0E38\u0E21\u0E40\u0E14\u0E34\u0E21"],drag:["drag a corner onto the page's edge, or press space on it and move it with the arrow keys","\u0E25\u0E32\u0E01\u0E21\u0E38\u0E21\u0E44\u0E1B\u0E17\u0E35\u0E48\u0E02\u0E2D\u0E1A\u0E01\u0E23\u0E30\u0E14\u0E32\u0E29"],tl:["top-left corner","\u0E21\u0E38\u0E21\u0E1A\u0E19\u0E0B\u0E49\u0E32\u0E22"],tr:["top-right corner","\u0E21\u0E38\u0E21\u0E1A\u0E19\u0E02\u0E27\u0E32"],br:["bottom-right corner","\u0E21\u0E38\u0E21\u0E25\u0E48\u0E32\u0E07\u0E02\u0E27\u0E32"],bl:["bottom-left corner","\u0E21\u0E38\u0E21\u0E25\u0E48\u0E32\u0E07\u0E0B\u0E49\u0E32\u0E22"],corners:["corners","\u0E21\u0E38\u0E21"],rotate:["rotate","\u0E2B\u0E21\u0E38\u0E19"],delete:["delete","\u0E25\u0E1A"],earlier:["move earlier","\u0E40\u0E25\u0E37\u0E48\u0E2D\u0E19\u0E02\u0E36\u0E49\u0E19"],later:["move later","\u0E40\u0E25\u0E37\u0E48\u0E2D\u0E19\u0E25\u0E07"],addPage:["add page","\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E2B\u0E19\u0E49\u0E32"],making:["making the PDF \xB7 page {n} of {of}","\u0E01\u0E33\u0E25\u0E31\u0E07\u0E17\u0E33 PDF \xB7 \u0E2B\u0E19\u0E49\u0E32 {n} \u0E08\u0E32\u0E01 {of}"],noCam:["no camera here","\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E25\u0E49\u0E2D\u0E07"],noCamWhy:["pick photos of the pages instead: each one gets its corners found the same way","\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E39\u0E1B\u0E02\u0E2D\u0E07\u0E41\u0E15\u0E48\u0E25\u0E30\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E17\u0E19"],limit:["{n} of {n} pages: the most one scan takes","{n} \u0E08\u0E32\u0E01 {n} \u0E2B\u0E19\u0E49\u0E32: \u0E2A\u0E41\u0E01\u0E19\u0E44\u0E14\u0E49\u0E21\u0E32\u0E01\u0E17\u0E35\u0E48\u0E2A\u0E38\u0E14\u0E40\u0E17\u0E48\u0E32\u0E19\u0E35\u0E49"],review:["review","\u0E15\u0E23\u0E27\u0E08"],strip:["pages, in order","\u0E2B\u0E19\u0E49\u0E32\u0E15\u0E32\u0E21\u0E25\u0E33\u0E14\u0E31\u0E1A"],denied:["the camera is blocked for this site","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E16\u0E39\u0E01\u0E1B\u0E34\u0E14\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E40\u0E27\u0E47\u0E1A\u0E19\u0E35\u0E49"],deniedWhy:["allow it in the browser's settings, or pick photos of the pages","\u0E40\u0E1B\u0E34\u0E14\u0E44\u0E14\u0E49\u0E43\u0E19\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C \u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E39\u0E1B\u0E02\u0E2D\u0E07\u0E41\u0E15\u0E48\u0E25\u0E30\u0E2B\u0E19\u0E49\u0E32"]};var S={imTemplate:["download template","\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E21\u0E48\u0E41\u0E1A\u0E1A"],imDrop:["Drop a spreadsheet here","\u0E27\u0E32\u0E07\u0E44\u0E1F\u0E25\u0E4C\u0E2A\u0E40\u0E1B\u0E23\u0E14\u0E0A\u0E35\u0E15\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48"],imOr:["or","\u0E2B\u0E23\u0E37\u0E2D"],imHint:["{types} \xB7 up to {mb} MB","{types} \xB7 \u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 {mb} MB"],imNeeds:["The file needs","\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35"],imMay:["and may have","\u0E41\u0E25\u0E30\u0E2D\u0E32\u0E08\u0E21\u0E35"],imReq:["required","\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35"],imAnother:["choose another file","\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E2D\u0E37\u0E48\u0E19"],imRows:["{n} rows","{n} \u0E41\u0E16\u0E27"],imSheet:["sheet","\u0E0A\u0E35\u0E15"],imCols:["Columns","\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C"],imNone:["\u2014 not in the file","\u2014 \u0E44\u0E21\u0E48\u0E21\u0E35\u0E43\u0E19\u0E44\u0E1F\u0E25\u0E4C"],imSkip:["Not imported: {list}","\u0E44\u0E21\u0E48\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32: {list}"],imEg:["e.g. {s}","\u0E40\u0E0A\u0E48\u0E19 {s}"],imPickFor:["required: pick a column","\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35: \u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C"],imPreview:["Rows","\u0E41\u0E16\u0E27"],imSum:["Columns: {n} of {m} matched","\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C: \u0E15\u0E23\u0E07\u0E01\u0E31\u0E19 {n} \u0E08\u0E32\u0E01 {m}"],imChange:["change","\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19"],imAll:["all {n}","\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14 {n}"],imErrs:["{n} with errors","\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 {n}"],imMore:["{n} more rows, all checked by the server","\u0E2D\u0E35\u0E01 {n} \u0E41\u0E16\u0E27 \u0E40\u0E0B\u0E34\u0E23\u0E4C\u0E1F\u0E40\u0E27\u0E2D\u0E23\u0E4C\u0E15\u0E23\u0E27\u0E08\u0E41\u0E25\u0E49\u0E27\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14"],imGo:["import {n} rows","\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32 {n} \u0E41\u0E16\u0E27"],imNothing:["nothing to import","\u0E44\u0E21\u0E48\u0E21\u0E35\u0E41\u0E16\u0E27\u0E43\u0E2B\u0E49\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32"],imLeft:["{n} rows with errors are left out","\u0E44\u0E21\u0E48\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32 {n} \u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14"],imFix:["pick a column for {c}","\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A {c}"],imAsk:["Import {n} rows into {t}?","\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32 {n} \u0E41\u0E16\u0E27\u0E44\u0E1B\u0E17\u0E35\u0E48 {t}?"],imSafe:["Your file is not changed.","\u0E44\u0E1F\u0E25\u0E4C\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E21\u0E48\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19"],imBack:["back","\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A"],imSending:["importing","\u0E01\u0E33\u0E25\u0E31\u0E07\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32"],imDone:["rows imported into {t}","\u0E41\u0E16\u0E27\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E44\u0E1B\u0E17\u0E35\u0E48 {t} \u0E41\u0E25\u0E49\u0E27"],imLeftOut:["{n} rows were left out","\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32 {n} \u0E41\u0E16\u0E27"],imLeftDl:["download left-out rows","\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32"],imAgain:["import another file","\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E44\u0E1F\u0E25\u0E4C\u0E2D\u0E37\u0E48\u0E19"],imRow:["row","\u0E41\u0E16\u0E27"],imOff:["import is off here","\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48"],imNoJs:["Importing a file needs JavaScript. The template above works without it. The file needs these columns:","\u0E01\u0E32\u0E23\u0E19\u0E33\u0E40\u0E02\u0E49\u0E32\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E0A\u0E49 JavaScript \u0E41\u0E21\u0E48\u0E41\u0E1A\u0E1A\u0E14\u0E49\u0E32\u0E19\u0E1A\u0E19\u0E43\u0E0A\u0E49\u0E44\u0E14\u0E49\u0E42\u0E14\u0E22\u0E44\u0E21\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E0A\u0E49 \u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E40\u0E2B\u0E25\u0E48\u0E32\u0E19\u0E35\u0E49:"],imCancel:["cancel","\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01"],imReading:["reading the file on the server","\u0E40\u0E0B\u0E34\u0E23\u0E4C\u0E1F\u0E40\u0E27\u0E2D\u0E23\u0E4C\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E48\u0E32\u0E19\u0E44\u0E1F\u0E25\u0E4C"],imChecking:["checking the rows again with these columns","\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E41\u0E16\u0E27\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07\u0E15\u0E32\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49"],imNoAnswer:["the server didn't answer","\u0E40\u0E0B\u0E34\u0E23\u0E4C\u0E1F\u0E40\u0E27\u0E2D\u0E23\u0E4C\u0E44\u0E21\u0E48\u0E15\u0E2D\u0E1A"],imWait:["waiting for the server","\u0E23\u0E2D\u0E40\u0E0B\u0E34\u0E23\u0E4C\u0E1F\u0E40\u0E27\u0E2D\u0E23\u0E4C"]};var b=e=>({phase:e.done?"done":e.sheet?"review":"idle",id:e.sheet?.file.id??"",name:e.sheet?.file.name??"",size:e.sheet?.file.size??0,part:0,why:"",map:null,sheet:null,show:"all",open:!1,seq:0}),k=(e,t,n={})=>((S[t]??q[t])?.[e==="th"?1:0]??t).replace(/\{(\w+)\}/g,(r,i)=>{let l=n[i];return typeof l=="number"?l.toLocaleString("en-US"):l??""}),O=e=>(e.accept?.length?e.accept:["xlsx","csv"]).map(t=>`.${t.replace(/^\./,"")}`),v=(e,t)=>e.mb!=null&&t>e.mb*1048576;function P(e,t,n){let r=["review","checking","ask","sending"].includes(t.phase),i=(r||t.phase==="done")&&e.sheet?.file.id===t.id?e.sheet:null,l=!n||!e.read||!e.action?"off":r&&!i?"idle":t.phase,o=t.map??i?.map??{},p=i?[...e.refused??[],...i.bad??[]]:[],a=i?.rows??[],d=t.show==="errors"&&p.length?p:a,u=new Set(Object.values(o));return{phase:l,sheet:i,map:o,bad:p,shown:d,good:Math.max(0,(i?.file.rows??0)-p.length),hidden:d===a?Math.max(0,(i?.file.rows??0)-a.length):0,missing:e.columns.find(f=>f.required&&!o[f.key]),extra:(i?.headers??[]).filter(f=>f&&!u.has(f)),got:e.columns.filter(f=>o[f.key]).length}}var E=(e,t)=>t.shown.slice(0,2).map(n=>n.cells[e.key]??"").filter(Boolean).join(", "),T=(e,t)=>({file:t.id,sheet:t.sheet??e.sheet?.file.sheet??null,map:t.map??(e.sheet?.file.id===t.id?e.sheet.map:{})});function C(e,t,n){let r=t.sheet?.file.id===e.id;e.phase==="reading"?e.phase=n?r?"review":"idle":"readfail":e.phase==="sending"?e.phase=n&&t.done?"done":"review":e.phase==="checking"&&(e.phase=r?"review":"idle"),e.phase!=="readfail"&&Object.assign(e,{map:null,sheet:null,show:"all"})}var W=e=>Array.from(new DOMParser().parseFromString("<body>"+e,"text/html").body.childNodes),g=(e,t="",n="")=>{let r=document.createElement(e);return t&&(r.className=t),n&&r.replaceChildren(...W(n)),r},s=(e,t,...n)=>{let r=g(e,t);return r.append(...n),r};var A=new Map,R=new Map,I=e=>e.type==="money"||e.type==="number",m=(e,t,n=!1,r="",i="")=>{let l=Object.assign(g("button",r),{type:"button",disabled:n});return i&&l.setAttribute("aria-label",i),l.append(s("span","",e)),l.onclick=()=>{t()},l},F=e=>{let t=m(e,()=>0,!0);return t.setAttribute("aria-busy","true"),t},L=(e,t,n)=>{let r=Object.assign(g("a","btn"),{href:w(t.src)?t.src:"",download:t.name});return r.setAttribute("aria-label",n),r.append(s("span","",e)),r};function $(e,t,n){let r=B(e.b,e.c),i=++e.st.seq;e.st.phase=n,e.draw(),e.c.act({action:t,block:e.b.id,values:T(e.b,e.st)}).then(l=>{let o=R.get(r);i!==e.st.seq||!o||(C(e.st,o.b,l),o.draw())})}function G(e,t){let{st:n,c:r}=e;n.stop?.abort();let i=new AbortController;if(Object.assign(n,{phase:"up",id:"",name:t.name,size:t.size,part:0,why:"",stop:i,seq:n.seq+1}),v(e.b,t.size)||!r.file)return Object.assign(n,{phase:"upfail",why:k(r.locale?.lang,"tooBig",{size:h(t.size),mb:e.b.mb??0})}),e.draw();e.draw();let l=o=>(n.part=Math.min(1,Math.max(0,o)),e.draw());r.file(t,{screen:r.screen,block:e.b.id??void 0,field:"file",name:t.name,mime:t.type,size:t.size,progress:l,signal:i.signal}).then(o=>!i.signal.aborted&&(n.id=o.id,$(e,e.b.read??"","reading")),()=>!i.signal.aborted&&(n.phase="upfail",e.draw()))}function M(e){let t=e.b.columns.filter(i=>i.required),n=e.b.columns.filter(i=>!i.required),r=s("p","imn",`${e.w("imNeeds")} `);return t.forEach((i,l)=>r.append(...l?[", "]:[],s("b","",i.label))),n.length&&r.append(` ${e.w("imMay")} ${n.map(i=>i.values?.length?`${i.label} (${i.values.join(", ")})`:i.label).join(", ")}`),r}function D(e){let t=e.v.phase==="off",n=Object.assign(g("input"),{type:"file",hidden:!0,accept:O(e.b).join(",")}),r=o=>o&&G(e,o);n.onchange=()=>r(n.files?.[0]);let i=t?e.w("imOff"):e.w("imHint",{types:O(e.b).join(` ${e.w("imOr")} `),mb:e.b.mb??10}),l=s("div","imd",s("span","",e.w("imDrop")),s("span","m",e.w("imOr")),m(e.w("file1"),()=>n.click(),t,"",`${e.w("file1")}: ${e.b.title}`),s("span","m",i),n);return t||(l.ondragover=o=>(o.preventDefault(),l.classList.add("over")),l.ondragleave=()=>l.classList.remove("over"),l.ondrop=o=>(o.preventDefault(),l.classList.remove("over"),r(o.dataTransfer?.files[0]))),[l,M(e)]}function j(e){let{st:t,v:n,w:r}=e,i=n.phase,l=n.sheet?.file,o=i==="upfail"||i==="readfail",p=s("span","fux",t.name.split(".").pop()??"");p.setAttribute("aria-hidden","true");let a=s("span","fum",s("span","fun",t.name)),d=t.size?`${h(t.size)} \xB7 `:"",u=()=>(t.stop?.abort(),Object.assign(t,b({...e.b,done:null,sheet:null})),e.draw()),f=s("div",o?"imf bad":"imf",p,a);if(i==="up"){let y=Math.round(t.part*100),c=s("span","pgt",g("b"));c.setAttribute("style",`--v:${y}`);for(let[N,z]of[["role","progressbar"],["aria-valuemin","0"],["aria-valuemax","100"],["aria-valuenow",String(y)],["aria-label",r("uploading",{p:y})]])c.setAttribute(N,z);a.append(c,s("span","fus",d+r("uploading",{p:y}))),f.append(m(r("imCancel"),u,!1,"",`${r("imCancel")}: ${t.name}`))}else if(i==="reading")a.append(s("span","fus spin",d+r("imReading"))),f.setAttribute("aria-busy","true"),f.append(m(r("imCancel"),u,!1,"",`${r("imCancel")}: ${t.name}`));else if(o){a.append(s("span","fus",d+(t.why||r(i==="upfail"?"failed":"imNoAnswer"))));let y=()=>i==="readfail"?$(e,e.b.read??"","reading"):u();f.append(s("span","bar",...t.why?[]:[m(r("retry"),y,!1,"",`${r("retry")}: ${t.name}`)],m(r("imAnother"),u)))}else{if(l?.sheets&&l.sheets.length>1){let y=g("select");y.setAttribute("aria-label",r("imSheet")),y.disabled=i!=="review";for(let c of l.sheets)y.append(Object.assign(g("option"),{value:c,textContent:`${r("imSheet")}: ${c}`,selected:c===(t.sheet??l.sheet)}));y.onchange=()=>(t.sheet=y.value,$(e,e.b.read??"","checking")),a.append(y)}a.append(s("span","fus",r("imRows",{n:l?.rows??0})+(l?.sheet&&!(l.sheets&&l.sheets.length>1)?` \xB7 ${r("imSheet")} ${l.sheet}`:""))),f.append(m(r("imAnother"),u,i!=="review"&&i!=="done"))}return f}function K(e){let{st:t,v:n,w:r}=e,i=n.phase==="review",l=g("ul","iml");for(let a of e.b.columns){let d=n.map[a.key]??"",u=g("select");u.setAttribute("aria-label",`${a.label}: ${r("imCols")}`),u.disabled=!i;for(let c of["",...n.sheet?.headers??[]])u.append(Object.assign(g("option"),{value:c,textContent:c||r("imNone"),selected:c===d}));u.onchange=()=>(t.map={...n.map,[a.key]:u.value},t.open=!0,$(e,e.b.read??"","checking"));let f=s("span","imk",`${a.label} `,...a.required?[s("i","",r("imReq"))]:[]),y=`imr${!d&&a.required?" no":""}${t.map&&t.map[a.key]!==n.sheet?.map[a.key]?" chg":""}`;l.append(s("li",y,f,u,s("span","ims",d?r("imEg",{s:E(a,n)}):a.required?r("imPickFor"):"")))}let o=n.extra.length?r("imSkip",{list:n.extra.join(", ")}):"",p=s("p","imc",r("imSum",{n:n.got,m:e.b.columns.length})+(o?` \xB7 ${o}`:""),m(r("imChange"),()=>(t.open=!0,e.draw()),!i));return s("div",`imm${n.missing?"":" ok"}${t.open?" open":""}`,s("h4","sh as-section-label",r("imCols")),p,l,...o?[s("span","m",o)]:[])}function U(e,t,n){let r=e.b.columns,i=s("td","imn0 p-meta",String(t.n));i.dataset.l=e.w("imRow");let l=s("tr",t.bad&&Object.keys(t.bad).length?"imo":"",i);for(let p of r){let a=e.v.map[p.key]?t.cells[p.key]??"":"",d=!!t.bad?.[p.key],u=s("td",[n(p),I(p)?"end":"",d?"bad":"",a?"":"nil"].filter(Boolean).join(" "),a||(d?"(empty)":"\u2014"));u.dataset.l=p.label,l.append(u)}let o=Object.entries(t.bad??{}).map(([p,a])=>`${r.find(d=>d.key===p)?.label??p}: ${a}`).join(" \xB7 ");return o?[l,s("tr","imx",Object.assign(s("td","",o),{colSpan:r.length+1}))]:[l]}function V(e){let{st:t,v:n,w:r}=e,i=e.b.columns,l=n.phase==="review",o=s("div","imt",s("h4","sh as-section-label",r("imPreview")));if(n.bad.length){let y=m(r("imAll",{n:n.sheet?.file.rows??0}),()=>(t.show="all",e.draw()),!l),c=m(r("imErrs",{n:n.bad.length}),()=>(t.show="errors",e.draw()),!l,"bad");y.setAttribute("aria-pressed",String(t.show!=="errors")),c.setAttribute("aria-pressed",String(t.show==="errors")),o.append(y,c)}let p=i.find((y,c)=>c>0&&(y.type??"text")==="text")??i[0],a=y=>y===p?"p-title":y.type==="money"?"p-value":y.type==="choice"?"p-tag":"p-meta",d=s("tbody","",...n.shown.flatMap(y=>U(e,y,a)));n.hidden>0&&d.append(s("tr","imq",Object.assign(s("td","",r("imMore",{n:n.hidden})),{colSpan:i.length+1})));let u=s("tr","",s("th","imn0","#"),...i.map(y=>s("th",I(y)?"end":"",y.label))),f=s("table","",s("caption","",`${e.b.title}: ${r("imPreview")}`),s("thead","",u),d);return s("div","imp",o,s("div","tbl",s("div","tbw",f)))}function X(e){let{v:t,w:n,st:r}=e,i=t.good,l=e.b.into??e.b.title,o=e.b.action??"";if(t.phase==="ask"){let a=s("p","",n("imAsk",{n:i,t:l}),s("span","m",(t.bad.length?`${n("imLeft",{n:t.bad.length})}. `:"")+n("imSafe")));return s("div","ima ask",a,m(n("imBack"),()=>(r.phase="review",e.draw())),m(n("imGo",{n:i}),()=>$(e,o,"sending")))}if(t.phase==="checking")return s("div","ima",s("span","say-busy",n("imChecking")),F(n("imWait")));let p=g("div","ima");return t.missing?p.append(s("span","say-busy bad",n("imFix",{c:t.missing.label}))):t.bad.length&&p.append(s("span","say-busy",n("imLeft",{n:t.bad.length}))),p.append(t.phase==="sending"?F(n("imSending")):m(i?n("imGo",{n:i}):n("imNothing"),()=>(r.phase="ask",e.draw()),!!t.missing||!i)),p}function _(e){let t=e.b.done,n=e.w,r=t?.left??0,i=m(n("imAgain"),()=>(Object.assign(e.st,b({...e.b,done:null,sheet:null})),e.draw())),l=r&&t?.file?[L(n("imLeftDl"),t.file,n("imLeftDl"))]:[];return s("div","imz",s("b","ok",(t?.count??0).toLocaleString("en-US")),s("span","",n("imDone",{t:e.b.into??e.b.title})),...r?[s("span","m",n("imLeftOut",{n:r}))]:[],s("div","bar",...l,i))}var B=(e,t)=>`${t.screen}
2
+ ${e.id??e.title}`;function Oe(e,t,n){let r=B(t,n),i=A.get(r)??b(t),l=n.locale?.lang;A.set(r,i);let o=()=>{let p={b:t,c:n,st:i,v:P(t,i,!!n.file),w:(y,c)=>k(l,y,c),draw:o},{phase:a}=p.v,d=a==="sending"||a==="checking";e.classList.toggle("busy",d),d?e.setAttribute("aria-busy","true"):e.removeAttribute("aria-busy");let u=s("div","imh",s("h3","sh as-section-label",t.title));t.template&&a!=="done"&&a!=="off"&&u.append(L(p.w("imTemplate"),t.template,`${p.w("imTemplate")}: ${t.title}`));let f=t.error&&a!=="up"&&a!=="reading"?[s("p","fe",t.error)]:[];a==="done"?e.replaceChildren(u,...p.v.sheet?[j(p)]:[],_(p)):a==="off"||a==="idle"?e.replaceChildren(u,...f,...D(p)):p.v.sheet?e.replaceChildren(u,...f,j(p),s("div","imb",K(p),V(p)),X(p)):e.replaceChildren(u,j(p),M(p))};R.set(r,{b:t,draw:o}),o()}export{Oe as draw};