@embedpdf/viewer-chrome 3.0.0-next.15 → 3.0.0-next.16

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 (200) hide show
  1. package/dist/{annotation-fonts-BqoLZ4Mp.js → annotation-fonts-DWjVOTP0.js} +2 -2
  2. package/dist/{annotation-fonts-BqoLZ4Mp.js.map → annotation-fonts-DWjVOTP0.js.map} +1 -1
  3. package/dist/{annotation-fonts-Dt0IQXhz.cjs → annotation-fonts-dpfVkhnq.cjs} +2 -2
  4. package/dist/{annotation-fonts-Dt0IQXhz.cjs.map → annotation-fonts-dpfVkhnq.cjs.map} +1 -1
  5. package/dist/{annotation-style-Bzvvp8-N.cjs → annotation-style-B3XKAyZ-.cjs} +3 -3
  6. package/dist/{annotation-style-Bzvvp8-N.cjs.map → annotation-style-B3XKAyZ-.cjs.map} +1 -1
  7. package/dist/{annotation-style--rPIZsuP.js → annotation-style-CXF3X47Z.js} +3 -3
  8. package/dist/{annotation-style--rPIZsuP.js.map → annotation-style-CXF3X47Z.js.map} +1 -1
  9. package/dist/{ar-DnEj5vbP.cjs → ar-B132r9bo.cjs} +93 -1
  10. package/dist/ar-B132r9bo.cjs.map +1 -0
  11. package/dist/{ar-D9XKAmDx.js → ar-BLWFJoA_.js} +93 -1
  12. package/dist/ar-BLWFJoA_.js.map +1 -0
  13. package/dist/attachments-panel-Cxln8xos.cjs +217 -0
  14. package/dist/attachments-panel-Cxln8xos.cjs.map +1 -0
  15. package/dist/attachments-panel-H1ucRbwo.js +217 -0
  16. package/dist/attachments-panel-H1ucRbwo.js.map +1 -0
  17. package/dist/chrome.cjs +21 -0
  18. package/dist/chrome.cjs.map +1 -1
  19. package/dist/chrome.js +21 -0
  20. package/dist/chrome.js.map +1 -1
  21. package/dist/{commands-BmgxhJ8B.js → commands-BkgLP3Om.js} +418 -23
  22. package/dist/commands-BkgLP3Om.js.map +1 -0
  23. package/dist/{commands-CYt4SFUX.cjs → commands-DL1gjZt7.cjs} +433 -20
  24. package/dist/commands-DL1gjZt7.cjs.map +1 -0
  25. package/dist/commands.cjs +2 -1
  26. package/dist/commands.d.cts +3 -1
  27. package/dist/commands.d.ts +3 -1
  28. package/dist/commands.js +2 -2
  29. package/dist/{comments-panel-pEcQg4Vs.cjs → comments-panel-BsnWedTh.cjs} +2 -2
  30. package/dist/{comments-panel-pEcQg4Vs.cjs.map → comments-panel-BsnWedTh.cjs.map} +1 -1
  31. package/dist/{comments-panel-MUVgLCBI.js → comments-panel-D7Eadws9.js} +2 -2
  32. package/dist/{comments-panel-MUVgLCBI.js.map → comments-panel-D7Eadws9.js.map} +1 -1
  33. package/dist/{de-Dv6zvbnd.cjs → de-7_MvFWzN.cjs} +93 -1
  34. package/dist/de-7_MvFWzN.cjs.map +1 -0
  35. package/dist/{de-Bdr4aWzm.js → de-BUhwc9-x.js} +93 -1
  36. package/dist/de-BUhwc9-x.js.map +1 -0
  37. package/dist/{dialog-B5GBisKv.js → dialog-BIb373cg.js} +3 -3
  38. package/dist/dialog-BIb373cg.js.map +1 -0
  39. package/dist/{dialog-t8F13BL_.cjs → dialog-CngKTnAM.cjs} +3 -3
  40. package/dist/dialog-CngKTnAM.cjs.map +1 -0
  41. package/dist/{es-BP09DR9w.cjs → es-DgYj-1L3.cjs} +93 -1
  42. package/dist/es-DgYj-1L3.cjs.map +1 -0
  43. package/dist/{es-BSXz5tBv.js → es-DoXTqFoO.js} +93 -1
  44. package/dist/es-DoXTqFoO.js.map +1 -0
  45. package/dist/{form-design-panel-vWWU9uB-.js → form-design-panel-CgV_5YWC.js} +3 -3
  46. package/dist/{form-design-panel-vWWU9uB-.js.map → form-design-panel-CgV_5YWC.js.map} +1 -1
  47. package/dist/{form-design-panel-B5MXTZ96.cjs → form-design-panel-D0FdmWXW.cjs} +3 -3
  48. package/dist/{form-design-panel-B5MXTZ96.cjs.map → form-design-panel-D0FdmWXW.cjs.map} +1 -1
  49. package/dist/{fr-Ckn3K9v1.js → fr-B-8NDhBA.js} +93 -1
  50. package/dist/fr-B-8NDhBA.js.map +1 -0
  51. package/dist/{fr-BBQQn7tJ.cjs → fr-C856dmQJ.cjs} +93 -1
  52. package/dist/fr-C856dmQJ.cjs.map +1 -0
  53. package/dist/{he-DRsG7bH7.cjs → he-BFTeNc4t.cjs} +93 -1
  54. package/dist/he-BFTeNc4t.cjs.map +1 -0
  55. package/dist/{he-wdGU5PkU.js → he-Dlh0fNXM.js} +93 -1
  56. package/dist/he-Dlh0fNXM.js.map +1 -0
  57. package/dist/{icons-x0Tc05bs.cjs → icons-1UfLUZ_y.cjs} +20 -1
  58. package/dist/icons-1UfLUZ_y.cjs.map +1 -0
  59. package/dist/{icons-BrK5iVL8.js → icons-7dB0Y1ct.js} +20 -1
  60. package/dist/icons-7dB0Y1ct.js.map +1 -0
  61. package/dist/index.cjs +740 -171
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/index.d.cts +16 -2
  64. package/dist/index.d.ts +16 -2
  65. package/dist/index.js +727 -170
  66. package/dist/index.js.map +1 -1
  67. package/dist/{it-BuP4o0xQ.cjs → it-Bef-2Yxq.cjs} +93 -1
  68. package/dist/it-Bef-2Yxq.cjs.map +1 -0
  69. package/dist/{it-Us-VmvIu.js → it-BkirG7ol.js} +93 -1
  70. package/dist/it-BkirG7ol.js.map +1 -0
  71. package/dist/{ja-Cizj0-5O.js → ja-CGEjCE-s.js} +93 -1
  72. package/dist/ja-CGEjCE-s.js.map +1 -0
  73. package/dist/{ja-DovEd6ts.cjs → ja-DNw2zqSD.cjs} +93 -1
  74. package/dist/ja-DNw2zqSD.cjs.map +1 -0
  75. package/dist/{ko-DlrXliE1.js → ko-CTkl5vMh.js} +93 -1
  76. package/dist/ko-CTkl5vMh.js.map +1 -0
  77. package/dist/{ko-B-qJEol2.cjs → ko-YHzeBqP6.cjs} +93 -1
  78. package/dist/ko-YHzeBqP6.cjs.map +1 -0
  79. package/dist/{link-editor-CSjqPnj1.cjs → link-editor-CAS7MZM2.cjs} +2 -2
  80. package/dist/{link-editor-CSjqPnj1.cjs.map → link-editor-CAS7MZM2.cjs.map} +1 -1
  81. package/dist/{link-editor-SxM1nnJU.js → link-editor-CkwtqRvb.js} +2 -2
  82. package/dist/{link-editor-SxM1nnJU.js.map → link-editor-CkwtqRvb.js.map} +1 -1
  83. package/dist/{measurement-Bs61XWbJ.js → measurement-CQdbnIrn.js} +2 -2
  84. package/dist/{measurement-Bs61XWbJ.js.map → measurement-CQdbnIrn.js.map} +1 -1
  85. package/dist/{measurement-CcCsHPOX.cjs → measurement-Cxv1Ahxx.cjs} +2 -2
  86. package/dist/{measurement-CcCsHPOX.cjs.map → measurement-Cxv1Ahxx.cjs.map} +1 -1
  87. package/dist/{nl-D3KZDDiJ.cjs → nl-BjkbaLq3.cjs} +93 -1
  88. package/dist/nl-BjkbaLq3.cjs.map +1 -0
  89. package/dist/{nl-0aF7M_0h.js → nl-Dya4sR8_.js} +93 -1
  90. package/dist/nl-Dya4sR8_.js.map +1 -0
  91. package/dist/outline-panel-BpGtBdj0.cjs +707 -0
  92. package/dist/outline-panel-BpGtBdj0.cjs.map +1 -0
  93. package/dist/outline-panel-DO5_REYw.js +707 -0
  94. package/dist/outline-panel-DO5_REYw.js.map +1 -0
  95. package/dist/outline-properties-BCa2cc0t.js +330 -0
  96. package/dist/outline-properties-BCa2cc0t.js.map +1 -0
  97. package/dist/outline-properties-DT3FIxCw.cjs +330 -0
  98. package/dist/outline-properties-DT3FIxCw.cjs.map +1 -0
  99. package/dist/{pl-DSFhAUqx.cjs → pl-CKKdVnpZ.cjs} +93 -1
  100. package/dist/pl-CKKdVnpZ.cjs.map +1 -0
  101. package/dist/{pl-BW--AaCI.js → pl-DA9b5NVg.js} +93 -1
  102. package/dist/pl-DA9b5NVg.js.map +1 -0
  103. package/dist/print-dialog-BqIrHCBh.cjs +276 -0
  104. package/dist/print-dialog-BqIrHCBh.cjs.map +1 -0
  105. package/dist/print-dialog-DvcI2m2_.js +276 -0
  106. package/dist/print-dialog-DvcI2m2_.js.map +1 -0
  107. package/dist/{pt-C5S-8MC5.cjs → pt-DLcszlzi.cjs} +93 -1
  108. package/dist/pt-DLcszlzi.cjs.map +1 -0
  109. package/dist/{pt-DIhpU5pT.js → pt-Nm8yyjbX.js} +93 -1
  110. package/dist/pt-Nm8yyjbX.js.map +1 -0
  111. package/dist/{redact-confirm-CX_SY2ZN.cjs → redact-confirm-C6EiK8yN.cjs} +2 -2
  112. package/dist/{redact-confirm-CX_SY2ZN.cjs.map → redact-confirm-C6EiK8yN.cjs.map} +1 -1
  113. package/dist/{redact-confirm-B6j36TPw.js → redact-confirm-CKuv9iN_.js} +2 -2
  114. package/dist/{redact-confirm-B6j36TPw.js.map → redact-confirm-CKuv9iN_.js.map} +1 -1
  115. package/dist/{redaction-panel-IJDshSJI.js → redaction-panel-CgNZ-pQk.js} +2 -2
  116. package/dist/{redaction-panel-IJDshSJI.js.map → redaction-panel-CgNZ-pQk.js.map} +1 -1
  117. package/dist/{redaction-panel-BmoIl-Ll.cjs → redaction-panel-ZhX0dlMi.cjs} +2 -2
  118. package/dist/{redaction-panel-BmoIl-Ll.cjs.map → redaction-panel-ZhX0dlMi.cjs.map} +1 -1
  119. package/dist/{search-panel-HfIhJm1M.js → search-panel-BE4xzWlm.js} +4 -4
  120. package/dist/{search-panel-HfIhJm1M.js.map → search-panel-BE4xzWlm.js.map} +1 -1
  121. package/dist/{search-panel-s9IoiOtv.cjs → search-panel-wcbTNG1z.cjs} +4 -4
  122. package/dist/{search-panel-s9IoiOtv.cjs.map → search-panel-wcbTNG1z.cjs.map} +1 -1
  123. package/dist/{sheet-BDsa_Sup.cjs → sheet-DTBFiwde.cjs} +30 -11
  124. package/dist/sheet-DTBFiwde.cjs.map +1 -0
  125. package/dist/{sheet-R6XDgyEf.js → sheet-DyjKfAq0.js} +25 -12
  126. package/dist/sheet-DyjKfAq0.js.map +1 -0
  127. package/dist/{sign-dialog-CgnR7akj.cjs → sign-dialog-D5WGx-Yn.cjs} +2 -2
  128. package/dist/{sign-dialog-CgnR7akj.cjs.map → sign-dialog-D5WGx-Yn.cjs.map} +1 -1
  129. package/dist/{sign-dialog-GDqCoQhA.js → sign-dialog-DerNe8qT.js} +2 -2
  130. package/dist/{sign-dialog-GDqCoQhA.js.map → sign-dialog-DerNe8qT.js.map} +1 -1
  131. package/dist/{signature-inspector-DyO313Qf.cjs → signature-inspector-Bz6TAfZM.cjs} +4 -10
  132. package/dist/signature-inspector-Bz6TAfZM.cjs.map +1 -0
  133. package/dist/{signature-inspector-okFz8do6.js → signature-inspector-CsGr9EBk.js} +4 -10
  134. package/dist/signature-inspector-CsGr9EBk.js.map +1 -0
  135. package/dist/{signature-maker-BoYa8vgA.cjs → signature-maker-D_YfBXLn.cjs} +3 -3
  136. package/dist/{signature-maker-BoYa8vgA.cjs.map → signature-maker-D_YfBXLn.cjs.map} +1 -1
  137. package/dist/{signature-maker-BhCmYyHD.js → signature-maker-Dnth4rV4.js} +3 -3
  138. package/dist/{signature-maker-BhCmYyHD.js.map → signature-maker-Dnth4rV4.js.map} +1 -1
  139. package/dist/{signatures-panel-B56PC6d9.cjs → signatures-panel-Ci_LaI1C.cjs} +4 -10
  140. package/dist/signatures-panel-Ci_LaI1C.cjs.map +1 -0
  141. package/dist/{signatures-panel-CgnFfhFm.js → signatures-panel-DZ9ywrjz.js} +4 -10
  142. package/dist/signatures-panel-DZ9ywrjz.js.map +1 -0
  143. package/dist/{stamps-panel-CDO0FPyK.js → stamps-panel-BrczStaz.js} +4 -10
  144. package/dist/stamps-panel-BrczStaz.js.map +1 -0
  145. package/dist/{stamps-panel-B9NYGayn.cjs → stamps-panel-Cv9nJBwx.cjs} +4 -10
  146. package/dist/stamps-panel-Cv9nJBwx.cjs.map +1 -0
  147. package/dist/theme-Be0OZokZ.js +97 -0
  148. package/dist/theme-Be0OZokZ.js.map +1 -0
  149. package/dist/theme-FR26JI3r.cjs +126 -0
  150. package/dist/theme-FR26JI3r.cjs.map +1 -0
  151. package/dist/{toolbar-z9od3tKl.js → toolbar-DF361xWY.js} +7 -6
  152. package/dist/toolbar-DF361xWY.js.map +1 -0
  153. package/dist/{toolbar-CJu2wKTU.cjs → toolbar-ddvpsvTb.cjs} +7 -6
  154. package/dist/toolbar-ddvpsvTb.cjs.map +1 -0
  155. package/dist/{zh-cn-CxkUUBct.js → zh-cn-BMPPkLpL.js} +93 -1
  156. package/dist/zh-cn-BMPPkLpL.js.map +1 -0
  157. package/dist/{zh-cn-3tmMeHqv.cjs → zh-cn-CZOO3p4H.cjs} +93 -1
  158. package/dist/zh-cn-CZOO3p4H.cjs.map +1 -0
  159. package/package.json +4 -4
  160. package/src/styles.css +8 -0
  161. package/dist/ar-D9XKAmDx.js.map +0 -1
  162. package/dist/ar-DnEj5vbP.cjs.map +0 -1
  163. package/dist/commands-BmgxhJ8B.js.map +0 -1
  164. package/dist/commands-CYt4SFUX.cjs.map +0 -1
  165. package/dist/de-Bdr4aWzm.js.map +0 -1
  166. package/dist/de-Dv6zvbnd.cjs.map +0 -1
  167. package/dist/dialog-B5GBisKv.js.map +0 -1
  168. package/dist/dialog-t8F13BL_.cjs.map +0 -1
  169. package/dist/es-BP09DR9w.cjs.map +0 -1
  170. package/dist/es-BSXz5tBv.js.map +0 -1
  171. package/dist/fr-BBQQn7tJ.cjs.map +0 -1
  172. package/dist/fr-Ckn3K9v1.js.map +0 -1
  173. package/dist/he-DRsG7bH7.cjs.map +0 -1
  174. package/dist/he-wdGU5PkU.js.map +0 -1
  175. package/dist/icons-BrK5iVL8.js.map +0 -1
  176. package/dist/icons-x0Tc05bs.cjs.map +0 -1
  177. package/dist/it-BuP4o0xQ.cjs.map +0 -1
  178. package/dist/it-Us-VmvIu.js.map +0 -1
  179. package/dist/ja-Cizj0-5O.js.map +0 -1
  180. package/dist/ja-DovEd6ts.cjs.map +0 -1
  181. package/dist/ko-B-qJEol2.cjs.map +0 -1
  182. package/dist/ko-DlrXliE1.js.map +0 -1
  183. package/dist/nl-0aF7M_0h.js.map +0 -1
  184. package/dist/nl-D3KZDDiJ.cjs.map +0 -1
  185. package/dist/pl-BW--AaCI.js.map +0 -1
  186. package/dist/pl-DSFhAUqx.cjs.map +0 -1
  187. package/dist/pt-C5S-8MC5.cjs.map +0 -1
  188. package/dist/pt-DIhpU5pT.js.map +0 -1
  189. package/dist/sheet-BDsa_Sup.cjs.map +0 -1
  190. package/dist/sheet-R6XDgyEf.js.map +0 -1
  191. package/dist/signature-inspector-DyO313Qf.cjs.map +0 -1
  192. package/dist/signature-inspector-okFz8do6.js.map +0 -1
  193. package/dist/signatures-panel-B56PC6d9.cjs.map +0 -1
  194. package/dist/signatures-panel-CgnFfhFm.js.map +0 -1
  195. package/dist/stamps-panel-B9NYGayn.cjs.map +0 -1
  196. package/dist/stamps-panel-CDO0FPyK.js.map +0 -1
  197. package/dist/toolbar-CJu2wKTU.cjs.map +0 -1
  198. package/dist/toolbar-z9od3tKl.js.map +0 -1
  199. package/dist/zh-cn-3tmMeHqv.cjs.map +0 -1
  200. package/dist/zh-cn-CxkUUBct.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar-ddvpsvTb.cjs","names":["StageToken","Icon","StageToken","useStampSettings","InteractionToken","quickStampAssetIdOf","DEFAULT_LIBRARY_ID","ensureDefaultLibrary","resolveStampsLocale","AnnotationToken","SignatureToken","FormToken","PageEditToken","RedactionToken","Icon","useLayoutEnv","useLayoutEnv","Sheet","Icon","ShellToken","useMenu","Icon","TOOLBAR_ITEM_ATTRIBUTE","ShellToken","StageToken","VIEW_MODE_COMMAND","Toolbar"],"sources":["../src/features.ts","../src/ui/bar-edge.tsx","../src/ui/measurement-scale.tsx","../src/ui/page-number.tsx","../src/ui/quick-stamps.tsx","../src/ui/view-only.tsx","../src/ui/item-context.ts","../src/ui/slotted-edges.ts","../src/ui/item-socket.tsx","../src/ui/menu-placement.ts","../src/ui/menu.tsx","../src/ui/toolbar.tsx"],"sourcesContent":["/**\n * The viewer's features, and what `disable` and `readOnly` turn off.\n *\n * A feature is a command category: `annotations`, or one of its parts, `annotations.highlight`.\n * Turning a feature off turns off everything under it (the commands plugin matches whole dotted\n * segments). `disable` lists features and single commands in one list, told apart by the colon\n * every command id has; `readOnly` adds the features that change the document. A feature that's\n * off also stops people changing by hand what it made: the annotations and fields already in the\n * document (the annotation plugin's `editable` and the form plugin's `fillable` settings).\n */\nimport type { EditableKind, EditableKinds } from '@embedpdf/react/annotation';\nimport type { FillableFields, FormFieldFamily } from '@embedpdf/react/form';\n\n/** Every built-in feature and its parts: the names `disable` takes, as All features lists them. */\nexport const FEATURE_PARTS = {\n annotations: ['highlight', 'markup', 'drawing', 'text', 'notes', 'links'],\n shapes: [],\n stamps: [],\n comments: ['writing'],\n forms: ['filling', 'building'],\n signatures: ['signing', 'checking'],\n redaction: [],\n measurement: [],\n pages: [],\n attachments: ['adding'],\n text: ['selection', 'copy'],\n search: [],\n thumbnails: [],\n outline: ['editing'],\n documents: ['open', 'download', 'print', 'tabs'],\n} as const;\n\ntype FeatureParts = typeof FEATURE_PARTS;\n\n/** A built-in feature, or a part of one: `'annotations'`, `'annotations.highlight'`. */\nexport type Feature = {\n [Name in keyof FeatureParts]: Name | `${Name}.${FeatureParts[Name][number]}`;\n}[keyof FeatureParts];\n\n/** What `readOnly` keeps on: every feature it would turn off, minus these. */\nexport interface ReadOnlyExceptions {\n readonly except: readonly (Feature | (string & {}))[];\n}\n\n/** The features that change the document: what `readOnly` turns off. */\nexport const READ_ONLY_FEATURES: readonly Feature[] = [\n 'annotations',\n 'shapes',\n 'stamps',\n 'comments.writing',\n 'forms',\n 'signatures.signing',\n 'redaction',\n 'measurement',\n 'pages',\n 'attachments.adding',\n 'outline.editing',\n];\n\nconst isInside = (feature: string, outer: string): boolean =>\n feature === outer || feature.startsWith(`${outer}.`);\n\n/**\n * Whether nothing that changes the document is left, `isOff` saying which features are off (the\n * commands plugin's `isCategoryDisabled`): what the View only label shows for.\n */\nexport const leavesNothingToChange = (isOff: (feature: string) => boolean): boolean =>\n READ_ONLY_FEATURES.every(isOff);\n\n/**\n * The annotations each feature makes, by the names the annotation plugin's `editable` setting\n * takes: a subtype, or a measurement's intent. Every subtype people can change is here; a popup\n * or an unsupported annotation is never changed by hand. A signature placed off a field is a\n * stamp; one drawn into a field is the field's value.\n */\nconst FEATURE_ANNOTATIONS: Readonly<Record<string, readonly EditableKind[]>> = {\n 'annotations.highlight': ['highlight'],\n 'annotations.markup': ['underline', 'strikeout', 'squiggly'],\n 'annotations.drawing': ['ink'],\n 'annotations.text': ['free-text', 'caret'],\n 'annotations.notes': ['text'],\n 'annotations.links': ['link'],\n shapes: ['square', 'circle', 'line', 'polygon', 'polyline'],\n stamps: ['stamp'],\n redaction: ['redact'],\n measurement: ['line-dimension', 'polyline-dimension', 'polygon-dimension'],\n 'attachments.adding': ['file-attachment'],\n // A field's boxes, moved and resized in the Form mode.\n 'forms.building': ['widget'],\n};\n\n/** The fields each feature fills in, by the families the form plugin's `fillable` setting takes. */\nconst FEATURE_FIELDS: Readonly<Record<string, readonly FormFieldFamily[]>> = {\n 'forms.filling': ['text', 'checkbox', 'radio', 'combobox', 'listbox', 'pushbutton'],\n 'signatures.signing': ['signature'],\n};\n\n/** `true` while no feature of `table` is off, `false` once every one is, else what the ones on hold. */\nfunction stillOn<Name>(\n table: Readonly<Record<string, readonly Name[]>>,\n off: readonly string[],\n): boolean | Name[] {\n const features = Object.keys(table);\n const on = features.filter((feature) => !off.some((name) => isInside(feature, name)));\n if (on.length === features.length) return true;\n if (on.length === 0) return false;\n return on.flatMap((feature) => table[feature]!);\n}\n\nconst partsOf = (feature: string): readonly string[] =>\n (FEATURE_PARTS as Readonly<Record<string, readonly string[]>>)[feature] ?? [];\n\n/**\n * The features `readOnly` turns off, minus `except`. An exception inside a feature splits it\n * into its parts, so `except: ['forms.filling']` leaves `forms.building` off.\n */\nfunction readOnlyFeaturesOf(readOnly: boolean | ReadOnlyExceptions | undefined): string[] {\n if (!readOnly) return [];\n const except = readOnly === true ? [] : readOnly.except;\n const off: string[] = [];\n const subtract = (feature: string): void => {\n if (except.some((kept) => isInside(feature, kept))) return;\n const parts = partsOf(feature);\n if (parts.length === 0 || !except.some((kept) => isInside(kept, feature))) {\n off.push(feature);\n return;\n }\n for (const part of parts) subtract(`${feature}.${part}`);\n };\n for (const feature of READ_ONLY_FEATURES) subtract(feature);\n return off;\n}\n\n/** The features `disable` and `readOnly` turn off: the names without a colon, and `readOnly`'s. */\nfunction featuresOffOf(\n disable: readonly string[] | undefined,\n readOnly: boolean | ReadOnlyExceptions | undefined,\n): string[] {\n const features = (disable ?? []).filter((name) => !name.includes(':'));\n return [...new Set([...features, ...readOnlyFeaturesOf(readOnly)])];\n}\n\n/** What the commands plugin turns off: its `disabledCategories` and `disabledCommands` settings. */\nexport interface DisabledSettings {\n readonly disabledCategories: readonly string[];\n readonly disabledCommands: readonly string[];\n}\n\n/**\n * The commands plugin's settings for a `disable` list and a `readOnly` value: the names with a\n * colon are command ids, the rest features, and `readOnly` adds its own features.\n */\nexport function disabledSettingsOf(\n disable: readonly string[] | undefined,\n readOnly: boolean | ReadOnlyExceptions | undefined,\n): DisabledSettings {\n const commands = new Set((disable ?? []).filter((name) => name.includes(':')));\n return { disabledCategories: featuresOffOf(disable, readOnly), disabledCommands: [...commands] };\n}\n\n/** What people may change by hand: the annotation plugin's `editable` and the form plugin's `fillable`. */\nexport interface ByHandSettings {\n readonly editable: EditableKinds;\n readonly fillable: FillableFields;\n}\n\n/**\n * What people may still change by hand for a `disable` list and a `readOnly` value: the\n * annotations and fields of the features left on. A single command turned off leaves them.\n */\nexport function byHandSettingsOf(\n disable: readonly string[] | undefined,\n readOnly: boolean | ReadOnlyExceptions | undefined,\n): ByHandSettings {\n const off = featuresOffOf(disable, readOnly);\n return { editable: stillOn(FEATURE_ANNOTATIONS, off), fillable: stillOn(FEATURE_FIELDS, off) };\n}\n\n/**\n * What two `editable` or `fillable` values both allow: `true` is everything, `false` nothing,\n * and a list its names, in the order of `left`. The viewer's own value and the app's setting\n * meet here, so each can only take away.\n */\nexport function bothAllow<Name extends string>(\n left: boolean | readonly Name[],\n right: boolean | readonly Name[],\n): boolean | readonly Name[] {\n if (left === true) return right;\n if (right === true) return left;\n if (left === false || right === false) return false;\n return left.filter((name) => right.includes(name));\n}\n\n/** Whether two `editable` or `fillable` values say the same. */\nexport const sameByHand = (\n left: boolean | readonly string[],\n right: boolean | readonly string[],\n): boolean =>\n typeof left === 'boolean' || typeof right === 'boolean'\n ? left === right\n : left.length === right.length && left.every((name, index) => name === right[index]);\n","/**\n * Where a bar is, for what opens from it. The shell wraps each bar it draws in\n * a `BarEdgeProvider` naming the viewer edge the bar sits on; a menu (and the\n * toolbar's own \"More\") reads it with `useBarEdge()` and opens away from that\n * edge: a bottom bar's menus open upward, a start bar's to the side, a\n * floating bar's toward the middle of the viewer.\n *\n * A floating bar names the half of the viewer it floats in (`float-top`,\n * `float-bottom`), since its menus open toward the other half; a bar over a\n * selection says `selection`, and its menus open on the side the bar sits,\n * above or below what's selected, away from it. Outside any provider the edge\n * is `'top'`, the main bar's.\n */\nimport { createContext, useContext } from 'react';\n\n/** The viewer edge a bar sits on; a floating bar names the half it floats in. */\nexport type BarEdge =\n | 'top'\n | 'bottom'\n | 'start'\n | 'end'\n | 'float-top'\n | 'float-bottom'\n | 'selection';\n\nexport const BarEdgeContext = createContext<BarEdge>('top');\n\n/** Names the edge of the bar drawn inside it. */\nexport const BarEdgeProvider = BarEdgeContext.Provider;\n\n/** The edge of the bar this component is drawn in (`'top'` outside any bar). */\nexport function useBarEdge(): BarEdge {\n return useContext(BarEdgeContext);\n}\n","/**\n * The Measure bar's scale button: the current page's drawing scale, which opens the measurement\n * panel. Apart from the panel and the calibration dialog (measurement.tsx), so the bar draws it\n * without loading them.\n */\nimport { useT } from '@embedpdf/react/i18n';\nimport { usePageScale } from '@embedpdf/react/measurement';\nimport { useSelector } from '@embedpdf/react/runtime';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { StageToken } from '@embedpdf/react/stage';\n\nimport { Icon } from './icons';\n\nconst button =\n 'border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm disabled:opacity-50';\n\nexport function MeasurementScaleButton() {\n const t = useT();\n\n const page = useSelector(StageToken, (stage) => stage.getCurrentPage());\n const scale = usePageScale(page);\n\n const surface = useSurface('measurement');\n return (\n <button\n part=\"toolbar-button\"\n className={`${button} inline-flex items-center gap-1.5 whitespace-nowrap`}\n onClick={() => surface.open()}\n title={t('measurement.title')}\n >\n <Icon name=\"updateScale\" size={20} className=\"shrink-0\" />\n <span>\n {t('measurement.scale')}:{' '}\n {scale?.measure?.subtype === 'rectilinear'\n ? (scale.measure.ratio ?? t('measurement.custom'))\n : t('measurement.unavailable')}\n </span>\n </button>\n );\n}\n","/**\n * The page number and the page count: the `{ custom: 'page-number' }` item, in the `pager` bar\n * floating over the pages by default. The number is a button; pressing it turns it into a field,\n * where Enter goes to the page typed and Escape, or leaving the field, keeps the page. Without a\n * document it draws nothing.\n */\nimport { useT } from '@embedpdf/react/i18n';\nimport { useOptionalCapability } from '@embedpdf/react/runtime';\nimport { StageToken, useStageState } from '@embedpdf/react/stage';\nimport { useLayoutEffect, useRef, useState } from 'react';\n\n/**\n * Stands in for the number while the sentence around it is translated, so it can split there:\n * a private-use character no language writes, spelled as an escape so no tool drops it.\n */\nexport const NUMBER_SLOT = '\\uE000';\n\nexport function PageNumber() {\n const t = useT();\n const stage = useOptionalCapability(StageToken);\n // The Stage cursor is a 0-based display index; people count from 1.\n const current = useStageState((state) => state.currentPageIndex + 1);\n const total = useStageState((state) => state.pageCount);\n /** What the field holds while it is open, or `null` while the number shows. */\n const [draft, setDraft] = useState<string | null>(null);\n const field = useRef<HTMLInputElement>(null);\n const button = useRef<HTMLButtonElement>(null);\n /** Whether the field closed from the keyboard, so focus goes back to the number. */\n const refocus = useRef(false);\n const editing = draft !== null;\n\n // In the commit that swaps the field and the number, so focus is never left nowhere.\n useLayoutEffect(() => {\n if (editing) {\n field.current?.focus();\n field.current?.select();\n } else if (refocus.current) {\n refocus.current = false;\n button.current?.focus();\n }\n }, [editing]);\n\n if (!total) return null;\n\n /** Closes the field from the keyboard: focus goes back to the number. */\n const close = () => {\n refocus.current = true;\n setDraft(null);\n };\n const go = () => {\n const page = Number.parseInt(draft ?? '', 10);\n if (Number.isFinite(page)) stage?.goToPage(Math.min(Math.max(page, 1), total) - 1);\n close();\n };\n const [before, after = ''] = t('demo.page', {\n params: { current: NUMBER_SLOT, total },\n }).split(NUMBER_SLOT);\n\n return (\n <span className=\"text-fg-secondary block whitespace-nowrap px-3.5 text-sm leading-7\">\n {before}\n {editing ? (\n <input\n ref={field}\n type=\"text\"\n inputMode=\"numeric\"\n aria-label={t('demo.goToPage')}\n value={draft}\n onChange={(event) => setDraft(event.target.value.replace(/[^0-9]/g, ''))}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n go();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n close();\n }\n }}\n // Leaving the field keeps the page; removing the field after Enter or Escape blurs it\n // too, and must not cancel the focus going back to the number.\n onBlur={() => setDraft(null)}\n // Room for the longest number, and one more digit's worth for the caret.\n style={{ width: `${String(total).length + 1}ch` }}\n className=\"bg-hover ring-accent text-fg rounded text-center tabular-nums outline-none ring-1\"\n />\n ) : (\n <button\n ref={button}\n type=\"button\"\n title={t('demo.goToPage')}\n onClick={() => setDraft(String(current))}\n className=\"hover:bg-hover hover:text-fg -mx-0.5 cursor-pointer rounded px-0.5 tabular-nums\"\n >\n {current}\n </button>\n )}\n {after}\n </span>\n );\n}\n","/**\n * Quick marks in the toolbar: a row of stamp thumbnails that arm on click —\n * the checkmark, the cross, whatever the embedder configured\n * (`plugins.stamp.quick`: `library:name`, `standard` for the standard stamps). The hover ghost and\n * the click placement are the annotation plugin's, exactly as from the\n * sidebar; only the picker moved. Renders nothing until the assets exist.\n * Lives in the workspace toolbar, so it reads the active document's tool.\n */\nimport { useEffect } from 'react';\nimport { InteractionToken } from '@embedpdf/react/interaction';\nimport { useI18nState, useT } from '@embedpdf/react/i18n';\nimport { useDocumentId, useOptionalSelector } from '@embedpdf/react/runtime';\nimport {\n useStamp,\n useStampAssetPreviewUrl,\n useStampAssets,\n useStampState,\n type StampAsset,\n} from '@embedpdf/react/stamp';\nimport { useStampSettings } from '../config-context';\nimport {\n DEFAULT_LIBRARY_ID,\n ensureDefaultLibrary,\n quickStampAssetIdOf,\n resolveStampsLocale,\n} from '../config/default-stamps';\nimport { restoreStampLibrariesOnce } from './stamp-store';\nimport { buttonClass, buttonPart } from './toolbar';\n\nexport function QuickStamps() {\n const t = useT();\n const stamp = useStamp();\n const { standard, quick } = useStampSettings();\n const { locale } = useI18nState();\n const assets = useStampAssets();\n const documentId = useDocumentId();\n const activeToolId = useOptionalSelector(\n InteractionToken,\n (interaction) => interaction.getActiveToolId(),\n null,\n );\n const armedId = useStampState((state) => state.armedAsset?.id ?? null);\n const ids = (quick ?? []).map(quickStampAssetIdOf);\n\n // A quick mark from the built-in library needs that library loaded — the\n // one case the toolbar pays for it at boot. The user's own libraries are\n // restored by the workspace store.\n const wantsDefault = ids.some((id) => id.startsWith(`${DEFAULT_LIBRARY_ID}:`));\n useEffect(() => {\n if (!wantsDefault) return;\n restoreStampLibrariesOnce(stamp)\n .then(() => ensureDefaultLibrary(stamp, resolveStampsLocale(locale), standard))\n .catch((error) => console.error('[embedpdf] quick stamps failed:', error));\n // `standard` is read once; only the locale re-runs this.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [stamp, locale, wantsDefault]);\n\n const shown = ids\n .map((id) => assets.find((asset) => asset.id === id))\n .filter((asset): asset is StampAsset => !!asset);\n if (shown.length === 0 || !documentId) return null;\n return (\n <div className=\"flex items-center gap-1\" role=\"group\" aria-label={t('demo.quickStampsLabel')}>\n {shown.map((asset) => (\n <QuickStampButton\n key={asset.id}\n asset={asset}\n active={activeToolId === 'stamp' && armedId === asset.id}\n onArm={() =>\n void stamp\n .armAsset(asset.id)\n .catch((error) => console.error('[embedpdf] arm failed', error))\n }\n />\n ))}\n </div>\n );\n}\n\nfunction QuickStampButton({\n asset,\n active,\n onArm,\n}: {\n asset: StampAsset;\n active: boolean;\n onArm: () => void;\n}) {\n const url = useStampAssetPreviewUrl(asset.id);\n return (\n <button\n type=\"button\"\n onClick={onArm}\n title={asset.label}\n aria-label={asset.label}\n aria-pressed={active || undefined}\n part={buttonPart(active)}\n className={buttonClass(active, true)}\n >\n {url ? (\n <img src={url} alt=\"\" className=\"h-5 w-5 object-contain\" draggable={false} />\n ) : (\n <span className=\"text-xs\">{asset.label}</span>\n )}\n </button>\n );\n}\n","/**\n * The View only label: the `{ custom: 'view-only' }` item, in the main bar by default. It says why\n * the tools are gone, while nothing that changes the document is on (`readOnly`, or `disable`\n * naming every such feature), or while the scope lets this user change nothing in the open\n * document. Otherwise it draws nothing.\n */\nimport { useOptionalCapability, useOptionalSelector } from '@embedpdf/react/runtime';\nimport { AnnotationToken, type AnnotationCapability } from '@embedpdf/react/annotation';\nimport { useCommands, useCommandsSettings } from '@embedpdf/react/commands';\nimport { FormToken, type FormCapability } from '@embedpdf/react/form';\nimport { PageEditToken } from '@embedpdf/react/page-edit';\nimport { RedactionToken } from '@embedpdf/react/redaction';\nimport { SignatureToken, type SignatureCapability } from '@embedpdf/react/signature';\nimport { useT } from '@embedpdf/react/i18n';\n\nimport { leavesNothingToChange } from '../features';\nimport { Icon } from './icons';\n\n/** Whether the scope lets this user change an annotation: make one, or change or delete one there. */\nfunction mayChangeAnnotations(annotation: AnnotationCapability): boolean {\n if (annotation.canCreate()) return true;\n return annotation\n .list()\n .some(({ ref }) => annotation.canUpdate(ref) || annotation.canDelete(ref));\n}\n\n/** Whether the scope lets this user change the form: its fields, a value, or a signature. */\nfunction mayChangeForm(form: FormCapability, signature: SignatureCapability | null): boolean {\n if (form.canDesign()) return true;\n return form\n .list()\n .some((field) =>\n field.family === 'signature'\n ? (signature?.canSign(field.ref) ?? false)\n : form.canFill(field.ref),\n );\n}\n\n/**\n * Whether the scope lets this user change nothing in the open document: no annotation to make,\n * change or delete (comments included), no field to fill in, sign or design, no page to edit and\n * no redaction to apply. Asked of the plugins' `can*` twins; `false` while no document is open.\n */\nfunction useNothingAllowed(): boolean {\n const open = useOptionalCapability(AnnotationToken) !== null;\n const signature = useOptionalCapability(SignatureToken);\n const annotates = useOptionalSelector(AnnotationToken, mayChangeAnnotations, false);\n const fills = useOptionalSelector(FormToken, (form) => mayChangeForm(form, signature), false);\n const editsPages = useOptionalSelector(PageEditToken, (pageEdit) => pageEdit.canEdit(), false);\n const redacts = useOptionalSelector(RedactionToken, (redaction) => redaction.canApply(), false);\n return open && !annotates && !fills && !editsPages && !redacts;\n}\n\n/**\n * The label; `compact` draws its icon alone (a narrow bar, or a vertical one), its words still\n * there for a screen reader. Plain text, not a live region: it says what the viewer is, and the\n * refusal notice stays the viewer's one status message. Its tooltip says why.\n */\nexport function ViewOnlyLabel({ compact = false }: { compact?: boolean }) {\n const t = useT();\n const commands = useCommands();\n // Read again whenever what's turned off changes.\n useCommandsSettings((settings) => settings.disabledCategories);\n const turnedOff = leavesNothingToChange((feature) => commands.isCategoryDisabled(feature));\n const nothingAllowed = useNothingAllowed();\n if (!turnedOff && !nothingAllowed) return null;\n return (\n <span\n title={t(turnedOff ? 'viewOnly.turnedOff' : 'viewOnly.notAllowed')}\n className=\"bg-hover text-fg-secondary flex h-7 shrink-0 select-none items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 text-xs font-medium\"\n >\n <Icon name=\"eye\" size={16} className=\"shrink-0\" />\n <span className={compact ? 'sr-only' : undefined}>{t('viewOnly.label')}</span>\n </span>\n );\n}\n","/**\n * Where your own toolbar item sits, as the viewer tells it: which way its bar\n * runs, the bar's place, the variant the toolbar picked, and the viewer's\n * size. The viewer writes it on the element you slot in, as `data-orientation`,\n * `data-edge`, `data-variant` and `data-size`, and keeps it there while the\n * bar moves and the viewer resizes; page CSS reads those, and so do the\n * framework wrappers (`useToolbarItem()`).\n */\nimport type { ViewerSize } from '@embedpdf/core-ui';\n\nimport type { BarEdge } from './bar-edge';\n\n/** The place of the bar an item sits in: an edge, floating over the pages, or over a selection. */\nexport type ToolbarItemEdge = 'top' | 'bottom' | 'start' | 'end' | 'float' | 'selection';\n\n/** Where your own toolbar item sits. */\nexport interface ToolbarItemContext {\n /** Which way the bar runs. */\n readonly orientation: 'horizontal' | 'vertical';\n /** The bar's place. */\n readonly edge: ToolbarItemEdge;\n /** Which of the item's `variants` the toolbar picked, or null for an item without its own. */\n readonly variant: string | null;\n /** The viewer's size. */\n readonly size: ViewerSize;\n}\n\n/** The attribute each field of a {@link ToolbarItemContext} is written to. */\nexport const TOOLBAR_ITEM_CONTEXT_ATTRIBUTES = {\n orientation: 'data-orientation',\n edge: 'data-edge',\n variant: 'data-variant',\n size: 'data-size',\n} as const satisfies Record<keyof ToolbarItemContext, string>;\n\n/** The public place of a bar on `edge`: a floating bar is `float`, whichever half it floats in. */\nexport const toolbarItemEdgeOf = (edge: BarEdge): ToolbarItemEdge =>\n edge === 'float-top' || edge === 'float-bottom' ? 'float' : edge;\n\n/** Write `context` on `element`, changing only the attributes that differ. */\nexport function writeToolbarItemContext(element: Element, context: ToolbarItemContext): void {\n for (const [field, attribute] of Object.entries(TOOLBAR_ITEM_CONTEXT_ATTRIBUTES)) {\n const value = context[field as keyof ToolbarItemContext];\n if (value === null) element.removeAttribute(attribute);\n else if (element.getAttribute(attribute) !== value) element.setAttribute(attribute, value);\n }\n}\n","/**\n * The edge of the bar each slotted toolbar item is in, by the element slotted\n * there, for the viewer's own components inside it: they're drawn apart from\n * the bar (`placed-components.tsx`), and a menu among them opens away from\n * the bar's edge like the bar's own. The item sockets write it\n * (`item-socket.tsx`); outside any item, a component opens its menus like the\n * main bar's.\n */\nimport { createContext, useContext } from 'react';\n\nimport type { BarEdge } from './bar-edge';\n\nexport interface SlottedEdges {\n /** Says `element` is slotted into an item of a bar on `edge`. */\n set(element: Element, edge: BarEdge): void;\n /** The edge of the item `element` is in: its own, or its nearest ancestor's; else `'top'`. */\n edgeOf(element: Element): BarEdge;\n /** Calls `listener` when an edge changes. */\n subscribe(listener: () => void): () => void;\n /** A number that changes with every edge that changes. */\n version(): number;\n}\n\n/** The element `node` is a child of: its parent, or the host of the shadow root it is in. */\nconst parentOf = (node: Element): Element | null =>\n node.parentElement ?? (node.getRootNode() as Partial<ShadowRoot>).host ?? null;\n\nexport function createSlottedEdges(): SlottedEdges {\n const edges = new WeakMap<Element, BarEdge>();\n const listeners = new Set<() => void>();\n let version = 0;\n return {\n set(element, edge) {\n if (edges.get(element) === edge) return;\n edges.set(element, edge);\n version += 1;\n for (const listener of [...listeners]) listener();\n },\n edgeOf(element) {\n for (let node: Element | null = element; node; node = parentOf(node)) {\n const edge = edges.get(node);\n if (edge) return edge;\n }\n return 'top';\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n version: () => version,\n };\n}\n\nconst SlottedEdgesContext = createContext<SlottedEdges>(createSlottedEdges());\n\n/** Gives the item sockets and the viewer's own components inside it one {@link SlottedEdges}. */\nexport const SlottedEdgesProvider = SlottedEdgesContext.Provider;\n\nexport function useSlottedEdges(): SlottedEdges {\n return useContext(SlottedEdgesContext);\n}\n","/**\n * Your own toolbar item, in its bar: a `<slot name=\"item:<id>\">` the browser\n * shows your element in, with what the item stands for when nothing is\n * slotted (its command's button). What's slotted lives in the page, so the\n * socket is measured where it renders; the toolbar's measurement layer can't\n * hold it. It tells what's slotted where it sits (`item-context.ts`), and the\n * viewer's own components inside it learn the bar's edge from it, so their\n * menus open away from the bar.\n */\nimport { useLayoutEffect, useRef, type ReactNode } from 'react';\n\nimport { useLayoutEnv } from '../config-context';\nimport { useBarEdge } from './bar-edge';\nimport { toolbarItemEdgeOf, writeToolbarItemContext } from './item-context';\nimport { useSlottedEdges } from './slotted-edges';\n\n/** The socket's box: a row of what's slotted, at its own size along the bar. */\nconst SOCKET_STYLE = { display: 'inline-flex', alignItems: 'center', flexShrink: 0 } as const;\n\nexport function ItemSocket({\n id,\n variant,\n orientation,\n measure,\n children,\n}: {\n /** The item's id: `{ custom: id }` in the layout. */\n id: string;\n /** The variant the toolbar picked, or null for an item without variants of its own. */\n variant: string | null;\n orientation: 'horizontal' | 'vertical';\n /** Reports the socket's length along the bar. */\n measure: (length: number) => void;\n /** What shows while nothing is slotted. */\n children?: ReactNode;\n}) {\n const slot = useRef<HTMLSlotElement>(null);\n const edge = useBarEdge();\n const { size } = useLayoutEnv();\n const edges = useSlottedEdges();\n const report = useRef(measure);\n report.current = measure;\n\n // A child slotted in or out resizes the socket's box, so one observer covers both.\n const resizes = useRef<ResizeObserver | null>(null);\n const hasVariants = variant !== null;\n useLayoutEffect(() => {\n const element = slot.current;\n if (!element) return;\n const side = orientation === 'vertical' ? 'height' : 'width';\n const measureNow = () => report.current(element.getBoundingClientRect()[side]);\n // Measured before the first paint, unless what's slotted is about to draw its variant.\n if (!hasVariants) measureNow();\n const observer = new ResizeObserver(measureNow);\n observer.observe(element);\n resizes.current = observer;\n return () => {\n observer.disconnect();\n resizes.current = null;\n };\n }, [orientation, hasVariants]);\n // At another variant, what's slotted draws itself again first: its length is taken once the\n // browser has laid that out (an observer's first call), and counts for the new variant.\n useLayoutEffect(() => {\n const element = slot.current;\n const observer = resizes.current;\n if (!element || !observer) return;\n observer.unobserve(element);\n observer.observe(element);\n }, [variant]);\n\n useLayoutEffect(() => {\n const element = slot.current;\n if (!element) return;\n const context = { orientation, edge: toolbarItemEdgeOf(edge), variant, size };\n const tell = () => {\n for (const slotted of element.assignedElements()) {\n writeToolbarItemContext(slotted, context);\n edges.set(slotted, edge);\n }\n };\n tell();\n element.addEventListener('slotchange', tell);\n return () => element.removeEventListener('slotchange', tell);\n }, [orientation, edge, variant, size, edges]);\n\n return (\n <slot ref={slot} name={`item:${id}`} style={SOCKET_STYLE}>\n {children}\n </slot>\n );\n}\n","/**\n * Where a menu opens, as a placement for `@embedpdf/web`'s `fitAnchoredRect`:\n * away from the edge its bar sits on, toward the pages, and a submenu beside\n * its row. Placements are physical sides, so the bar's edge and the menu's\n * alignment are read through the writing direction: a start bar is on the\n * right in a right-to-left language. When the side asked for has no room,\n * the fit opens the menu on the other.\n */\nimport type { AnchoredPlacement } from '@embedpdf/web';\n\nimport type { BarEdge } from './bar-edge';\n\n/** The writing direction the menu opens in. */\nexport type MenuDirection = 'ltr' | 'rtl';\n\n/**\n * How a menu lines up with its button along the bar: by the edges the bar\n * starts from (`'start'`), or by the edges it ends at (`'end'`, the \"More\"\n * menu at a bar's end).\n */\nexport type MenuAlign = 'start' | 'end';\n\n/**\n * Where a bar over a selection sits: above what's selected, or below it when\n * there's no room above.\n */\nexport type SelectionBarSide = 'above' | 'below';\n\n/**\n * The placement of a menu opened from a button in a bar on `edge`: below a\n * top bar's button, above a bottom bar's, beside a start or end bar's (on the\n * side of the pages), toward the middle from a floating bar, and from a bar\n * over a selection on the side the bar sits (`selectionBar`), away from\n * what's selected.\n */\nexport function menuPlacementOf(\n edge: BarEdge,\n direction: MenuDirection,\n align: MenuAlign = 'start',\n selectionBar: SelectionBarSide = 'above',\n): AnchoredPlacement {\n if (edge === 'start' || edge === 'end') {\n // A vertical bar: its start is its top in either direction.\n const onLeft = (edge === 'start') === (direction === 'ltr');\n return `${onLeft ? 'right' : 'left'}-${align}`;\n }\n const opensUp =\n edge === 'bottom' ||\n edge === 'float-bottom' ||\n (edge === 'selection' && selectionBar === 'above');\n const side = opensUp ? 'top' : 'bottom';\n // A horizontal bar starts on the left, or on the right in a right-to-left language.\n const physical = (align === 'start') === (direction === 'ltr') ? 'start' : 'end';\n return `${side}-${physical}`;\n}\n\n/** The placement of a submenu: beside its row, on the side the text runs toward, tops lined up. */\nexport function submenuPlacementOf(direction: MenuDirection): AnchoredPlacement {\n return direction === 'ltr' ? 'right-start' : 'left-start';\n}\n\n/** The key that opens a submenu from its row, and the one that closes it again. */\nexport function submenuKeysOf(direction: MenuDirection): { open: string; close: string } {\n return direction === 'ltr'\n ? { open: 'ArrowRight', close: 'ArrowLeft' }\n : { open: 'ArrowLeft', close: 'ArrowRight' };\n}\n","/**\n * The chrome's menus: a layout menu (sections of command ids) and the menus\n * the toolbar derives (the \"More\" menu, a folded group's), drawn as rows in a\n * popover that opens away from its bar's edge (`menu-placement.ts`). The\n * popover is in the browser's top layer, so no bar, panel or the viewer's own\n * box clips it, and it takes the menu keys from `@embedpdf/web`. Rows resolve\n * live through the command registry: label, icon, shortcut, whether it's the\n * current choice, enabled state; a row whose command isn't visible is gone, and a section\n * with none left goes with its line. A row whose command opens a menu opens\n * it beside it. On a phone (a compact viewer) every menu is a sheet from the\n * bottom of the viewer instead, and a submenu slides in over the menu it\n * opened from, with a row that goes back.\n */\nimport { formatShortcut, useCommand, useCommands } from '@embedpdf/react/commands';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useDocumentId, useKernelValue, useOptionalCapability } from '@embedpdf/react/runtime';\nimport { ShellToken, useShellState } from '@embedpdf/react/shell';\nimport type { OverflowMenuView } from '@embedpdf/react/toolbar';\nimport {\n anchoredViewOf,\n attachMenuKeys,\n directionOf,\n fitAnchoredRect,\n isUnavailable,\n observeClientGeometry,\n observeOutsidePress,\n type AnchoredPlacement,\n type AnchoredRect,\n} from '@embedpdf/web';\nimport {\n createContext,\n useContext,\n useId,\n useLayoutEffect,\n useReducer,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\n\nimport { useBarEdge } from './bar-edge';\nimport { Icon } from './icons';\nimport {\n menuPlacementOf,\n submenuKeysOf,\n submenuPlacementOf,\n type MenuAlign,\n type MenuDirection,\n type SelectionBarSide,\n} from './menu-placement';\nimport { Sheet } from './sheet';\nimport { useLayoutEnv, useMenu } from '../config-context';\n\n// ── the popover ──────────────────────────────────────────────────────────────\n\n/** Px between a menu and its button, and between a menu and the window's edges. */\nconst MENU_GAP_PX = 4;\n\n/** The `popover` attribute, which React's types don't list yet. */\nconst POPOVER = { popover: 'manual' } as Record<string, string>;\n\n/** The rows of a menu, the elements the menu keys move between. */\nconst MENU_ITEM_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]';\n\n/** A copy no one can use: the toolbar's hidden measurement layer draws every button twice. */\nconst HIDDEN_COPY_SELECTOR = '[inert], [aria-hidden=\"true\"]';\n\n/** Inside a menu, a menu is a submenu: it opens beside its row. */\nconst InMenuContext = createContext(false);\n\n/** The rows of `menu` itself, not those of a submenu open inside it. */\nconst itemsOf = (menu: HTMLElement): HTMLElement[] =>\n [...menu.querySelectorAll<HTMLElement>(MENU_ITEM_SELECTOR)].filter(\n (item) => item.closest('[role=\"menu\"]') === menu,\n );\n\n/** The button that opens the menu: the one beside it that says it has a popup. */\nconst triggerOf = (holder: HTMLElement, menu: HTMLElement): HTMLElement | null =>\n [...holder.querySelectorAll<HTMLElement>('[aria-haspopup]')].find(\n (candidate) => !menu.contains(candidate),\n ) ?? null;\n\n/**\n * Where the bar over a selection that `element` is in sits now: its anchored wrapper says so\n * in `data-placement` (`Anchored` in `@embedpdf/react`), `bottom…` once it went below.\n */\nconst selectionBarSideOf = (element: Element): SelectionBarSide =>\n element.closest('[data-placement]')?.getAttribute('data-placement')?.startsWith('bottom')\n ? 'below'\n : 'above';\n\nconst boxOf = (element: Element): AnchoredRect => {\n const rect = element.getBoundingClientRect();\n return { x: rect.left, y: rect.top, width: rect.width, height: rect.height };\n};\n\n/**\n * What a submenu opens beside: its row, across the whole width of the menu\n * the row is in, and raised by the submenu's own padding so its first row\n * lines up with the row that opened it.\n */\nfunction submenuBoxOf(holder: HTMLElement, submenu: HTMLElement): AnchoredRect {\n const row = boxOf(holder);\n const parent = holder.closest('[role=\"menu\"]');\n const across = parent ? boxOf(parent) : row;\n const inset = submenu.clientTop + parseFloat(getComputedStyle(submenu).paddingTop || '0');\n return { x: across.x, y: row.y - inset, width: across.width, height: row.height };\n}\n\n/**\n * Place `menu` around `box` in the window: on the side `placement` asks for,\n * or the other side when that has no room, moved to stay on screen, and never\n * taller than the window.\n */\nfunction placeMenu(\n menu: HTMLElement,\n box: AnchoredRect,\n placement: AnchoredPlacement,\n gap: number,\n): void {\n const view = anchoredViewOf(menu, 'client');\n if (!view) return;\n menu.style.maxHeight = `${Math.max(0, view.height - 2 * MENU_GAP_PX)}px`;\n const size = { width: menu.offsetWidth, height: menu.offsetHeight };\n const { left, top } = fitAnchoredRect(box, placement, gap, { size, view });\n menu.style.left = `${left}px`;\n menu.style.top = `${top}px`;\n // Without the top layer, `position: fixed` starts at the viewer's box (its `contain`):\n // move by however far from the window's origin the menu landed.\n const landed = menu.getBoundingClientRect();\n if (Math.abs(landed.left - left) > 0.5 || Math.abs(landed.top - top) > 0.5) {\n menu.style.left = `${2 * left - landed.left}px`;\n menu.style.top = `${2 * top - landed.top}px`;\n }\n}\n\n/**\n * Open `menu` from the button beside it in `holder`: show it in the top layer,\n * place it and keep it placed, close it on a press outside it and its button,\n * and drive it from the keyboard (a submenu's row also opens it with the arrow\n * toward it, and the arrow back closes it). Returns the close.\n */\nfunction openMenu(\n menu: HTMLElement,\n holder: HTMLElement,\n options: {\n readonly placement: (direction: MenuDirection) => AnchoredPlacement;\n readonly nested: boolean;\n readonly close: () => void;\n },\n): () => void {\n const { nested, close } = options;\n const trigger = triggerOf(holder, menu);\n const direction = directionOf(holder);\n const placement = options.placement(direction);\n // The menu is named after its button.\n const name =\n trigger?.getAttribute('aria-label') ||\n trigger?.getAttribute('title') ||\n trigger?.textContent?.trim();\n if (name) menu.setAttribute('aria-label', name);\n\n if (typeof menu.showPopover === 'function') menu.showPopover();\n const place = () =>\n placeMenu(\n menu,\n nested ? submenuBoxOf(holder, menu) : boxOf(holder),\n placement,\n nested ? 0 : MENU_GAP_PX,\n );\n place();\n const resizes = new ResizeObserver(place);\n resizes.observe(menu);\n resizes.observe(holder);\n const stopGeometry = observeClientGeometry(place);\n\n // A press on the button is the button's own toggle.\n const stopOutside = observeOutsidePress(menu, (event) => {\n if (!trigger || !event.composedPath().includes(trigger)) close();\n });\n const detachKeys = attachMenuKeys(menu, { trigger, close, items: () => itemsOf(menu) });\n\n const keys = submenuKeysOf(direction);\n const onKeyDown = (event: KeyboardEvent) => {\n const item = event.target as HTMLElement;\n // A key the menu keys took is theirs.\n const free = !event.defaultPrevented;\n const opensMenu = item.getAttribute('aria-haspopup') === 'menu';\n if (free && event.key === keys.open && opensMenu && itemsOf(menu).includes(item)) {\n event.preventDefault();\n // Open the row's submenu, or go into it when it's open already.\n if (item.getAttribute('aria-expanded') !== 'true') item.click();\n else {\n const submenu = item.parentElement?.querySelector<HTMLElement>('[role=\"menu\"]');\n if (submenu) itemsOf(submenu)[0]?.focus();\n }\n } else if (free && event.key === keys.close && nested) {\n event.preventDefault();\n close();\n trigger?.focus();\n }\n // A submenu's keys stay out of the menu it opened from; Tab closes them all.\n if (nested && event.key !== 'Tab') event.stopPropagation();\n };\n menu.addEventListener('keydown', onKeyDown);\n\n return () => {\n menu.removeEventListener('keydown', onKeyDown);\n detachKeys();\n stopOutside();\n stopGeometry();\n resizes.disconnect();\n if (typeof menu.hidePopover === 'function' && menu.matches(':popover-open')) {\n menu.hidePopover();\n }\n };\n}\n\ninterface MenuPopoverProps {\n children: ReactNode;\n onClose: () => void;\n /** How the menu lines up with its button along the bar. Default `'start'`. */\n align?: MenuAlign;\n}\n\n/**\n * A menu's surface, opened by the button beside it in the same parent (the\n * one with `aria-haspopup`). It opens away from its bar's edge, or beside its\n * row in another menu, and closes on Escape, Tab or a press anywhere outside\n * it and its button. In a compact viewer it opens as a sheet.\n */\nexport function MenuPopover(props: MenuPopoverProps) {\n const probe = useRef<HTMLSpanElement>(null);\n const [usable, setUsable] = useState(false);\n const compact = useLayoutEnv().size === 'compact';\n useLayoutEffect(() => {\n const holder = probe.current?.parentElement;\n if (holder && !holder.closest(HIDDEN_COPY_SELECTOR)) setUsable(true);\n }, []);\n if (!usable) return <span ref={probe} hidden />;\n return compact ? <MenuSheet {...props} /> : <OpenMenu {...props} />;\n}\n\nfunction OpenMenu({ children, onClose, align = 'start' }: MenuPopoverProps) {\n const surface = useRef<HTMLDivElement>(null);\n const edge = useBarEdge();\n const nested = useContext(InMenuContext);\n const close = useRef(onClose);\n close.current = onClose;\n useLayoutEffect(() => {\n const menu = surface.current;\n const holder = menu?.parentElement;\n if (!menu || !holder) return;\n return openMenu(menu, holder, {\n placement: (direction) =>\n nested\n ? submenuPlacementOf(direction)\n : menuPlacementOf(\n edge,\n direction,\n align,\n edge === 'selection' ? selectionBarSideOf(holder) : undefined,\n ),\n nested,\n close: () => close.current(),\n });\n // The menu opens once, from where its button is then; it closes by unmounting.\n }, []);\n return (\n <div\n ref={surface}\n {...POPOVER}\n role=\"menu\"\n part=\"menu\"\n className=\"border-border-subtle bg-elevated text-fg z-50 overflow-y-auto rounded-lg border shadow-xl\"\n style={{ position: 'fixed', right: 'auto', bottom: 'auto', margin: 0 }}\n >\n <InMenuContext.Provider value={true}>{children}</InMenuContext.Provider>\n </div>\n );\n}\n\n// ── on a phone: the menu as a sheet ──────────────────────────────────────────\n\n/** A submenu open in a menu's sheet, over the menu its row is in. */\ninterface SheetSubmenu {\n readonly menuId: string;\n readonly label: string;\n /** The row that opened it: it has focus again when the submenu goes. */\n readonly opener: HTMLElement;\n /** Runs when a row in it is picked, as in the menu it opened from. */\n readonly onRun?: () => void;\n}\n\n/** In a menu's sheet: how a row opens its submenu, over the menu. Null outside a sheet. */\nconst MenuSheetContext = createContext<((submenu: SheetSubmenu) => void) | null>(null);\n\n/** The button a menu's sheet opened from: the one beside the sheet that says it has a popup. */\nfunction sheetTriggerOf(menu: HTMLElement): HTMLElement | null {\n const layer = menu.closest<HTMLElement>('[data-epdf-layer]');\n const holder = layer?.parentElement;\n return layer && holder ? triggerOf(holder, layer) : null;\n}\n\n/**\n * A menu as a sheet: its rows in a sheet from the bottom of the viewer, which closes on a tap\n * above it, Escape or a pick. A row that opens a menu slides that menu in over this one, with a\n * row (or the arrow key back) that goes back to where it was.\n */\nfunction MenuSheet({ children, onClose }: MenuPopoverProps) {\n const [submenus, setSubmenus] = useState<readonly SheetSubmenu[]>([]);\n const current = useRef(submenus);\n current.current = submenus;\n /** The row to give focus back to once the submenu over it has gone. */\n const refocus = useRef<HTMLElement | null>(null);\n const close = useRef(onClose);\n close.current = onClose;\n\n const open = (submenu: SheetSubmenu) => setSubmenus([...current.current, submenu]);\n const back = () => {\n const shown = current.current;\n if (shown.length === 0) return;\n refocus.current = shown[shown.length - 1]!.opener;\n setSubmenus(shown.slice(0, -1));\n };\n // After the menu under it stops being inert (its own layout effect runs first).\n useLayoutEffect(() => {\n refocus.current?.focus();\n refocus.current = null;\n }, [submenus]);\n\n return (\n // The menus in it are named after their buttons; the sheet holds no focus of its own.\n <Sheet label=\"\" onClose={onClose} trapFocus={false}>\n <MenuSheetContext.Provider value={open}>\n <div className=\"grid\">\n <SheetMenu covered={submenus.length > 0} close={() => close.current()}>\n {children}\n </SheetMenu>\n {submenus.map((submenu, i) => (\n <SheetMenu\n key={i}\n covered={i < submenus.length - 1}\n close={back}\n opener={submenu.opener}\n label={submenu.label}\n onBack={back}\n >\n <MenuBody menuId={submenu.menuId} onRun={submenu.onRun} />\n </SheetMenu>\n ))}\n </div>\n </MenuSheetContext.Provider>\n </Sheet>\n );\n}\n\n/**\n * One menu in a menu's sheet: the first one, or a submenu over it with a row that goes back.\n * It takes the menu keys while it's on top; covered, it can't take focus or presses.\n */\nfunction SheetMenu({\n covered,\n close,\n opener,\n label,\n onBack,\n children,\n}: {\n covered: boolean;\n close: () => void;\n /** A submenu's row in the menu under it; the first menu's opener is the sheet's button. */\n opener?: HTMLElement;\n label?: string;\n onBack?: () => void;\n children: ReactNode;\n}) {\n const t = useT();\n const menu = useRef<HTMLDivElement>(null);\n const actions = useRef({ close, onBack });\n actions.current = { close, onBack };\n useLayoutEffect(() => {\n const element = menu.current;\n if (!element) return;\n const trigger = opener ?? sheetTriggerOf(element);\n const name = label ?? (trigger?.getAttribute('aria-label') || trigger?.getAttribute('title'));\n if (name) element.setAttribute('aria-label', name);\n const detachKeys = attachMenuKeys(element, {\n trigger,\n close: () => actions.current.close(),\n items: () => itemsOf(element),\n initialFocus: 'none',\n });\n // The first row takes focus once the sheet is showing: the sheet shows itself after this.\n queueMicrotask(() => {\n if (element.isConnected && !element.inert) {\n itemsOf(element)\n .find((item) => !isUnavailable(item))\n ?.focus();\n }\n });\n const keys = submenuKeysOf(directionOf(element));\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented) return;\n const item = event.target as HTMLElement;\n if (event.key === keys.open && item.getAttribute('aria-haspopup') === 'menu') {\n event.preventDefault();\n item.click();\n } else if (event.key === keys.close && actions.current.onBack) {\n event.preventDefault();\n actions.current.onBack();\n }\n };\n element.addEventListener('keydown', onKeyDown);\n return () => {\n element.removeEventListener('keydown', onKeyDown);\n detachKeys();\n };\n // A menu in the sheet opens once; it goes by unmounting.\n }, []);\n useLayoutEffect(() => {\n if (menu.current) menu.current.inert = covered;\n }, [covered]);\n return (\n <div\n ref={menu}\n role=\"menu\"\n part=\"menu\"\n className={`bg-elevated col-start-1 row-start-1 min-w-0 ${\n onBack\n ? 'starting:translate-x-full rtl:starting:-translate-x-full transition-[translate] duration-200 ease-out motion-reduce:transition-none'\n : ''\n }`}\n >\n {onBack && (\n <div className=\"p-1 pb-0\">\n <button\n type=\"button\"\n tabIndex={-1}\n role=\"menuitem\"\n part=\"menu-item\"\n data-epdf-menu-back=\"\"\n onClick={onBack}\n className={ROW_CLASS}\n >\n <Icon name=\"chevronLeft\" size={16} className=\"text-fg-muted rtl:-scale-x-100\" />\n <span className=\"flex-1 truncate\">{t('menu.back')}</span>\n </button>\n {label && <div className=\"text-fg px-2.5 pb-1 pt-2 text-sm font-semibold\">{label}</div>}\n </div>\n )}\n <InMenuContext.Provider value={true}>{children}</InMenuContext.Provider>\n </div>\n );\n}\n\n// ── the button a layout menu opens from ──────────────────────────────────────\n\n/**\n * Which button each open menu opened from, per viewer (its shell). The shell\n * keeps a menu open by its id, and several buttons can name one (the zoom menu\n * in the main bar and in a floating bar): it opens at the button pressed, or\n * at the first one drawn when code opened it.\n */\nconst openers = new WeakMap<object, Map<string, Element>>();\n\nfunction openersOf(shell: object): Map<string, Element> {\n let byMenu = openers.get(shell);\n if (!byMenu) {\n byMenu = new Map();\n openers.set(shell, byMenu);\n }\n return byMenu;\n}\n\n/**\n * A button that opens the layout menu `menuId`, and the menu when it's open\n * there. `children` draws the button, told whether its menu is open at it; the\n * menu lines up with this wrapper (`className`), so it can hold more than the\n * button, like the zoom field around its chevron.\n */\nexport function MenuAnchor({\n menuId,\n className = 'relative inline-flex',\n children,\n}: {\n menuId: string;\n className?: string;\n children: (open: boolean) => ReactNode;\n}) {\n const shell = useOptionalCapability(ShellToken);\n const open = useShellState((state) => state.openMenus.includes(menuId));\n const anchor = useRef<HTMLSpanElement>(null);\n const [, claim] = useReducer((count: number) => count + 1, 0);\n const opener = shell ? openersOf(shell).get(menuId) : undefined;\n const openHere = open && opener !== undefined && opener === anchor.current;\n\n useLayoutEffect(() => {\n const element = anchor.current;\n if (!shell || !element) return;\n const byMenu = openersOf(shell);\n const current = byMenu.get(menuId);\n if (!open) {\n if (current === element) byMenu.delete(menuId);\n return;\n }\n // Opened from code, or from a button that's gone: the first usable button takes it.\n if (!current?.isConnected && !element.closest(HIDDEN_COPY_SELECTOR)) {\n byMenu.set(menuId, element);\n claim();\n }\n });\n\n return (\n <span\n ref={anchor}\n className={className}\n // Before the button's own click opens the menu, so the menu opens here.\n onClickCapture={(event) => {\n const target = event.target as Element;\n const pressedButton = target.closest('[aria-haspopup]') && !target.closest('[role=\"menu\"]');\n if (shell && anchor.current && pressedButton) openersOf(shell).set(menuId, anchor.current);\n }}\n >\n {children(openHere)}\n {openHere && (\n <MenuPopover onClose={() => shell?.closeMenu(menuId)}>\n <MenuBody menuId={menuId} onRun={() => shell?.closeMenu(menuId)} />\n </MenuPopover>\n )}\n </span>\n );\n}\n\n// ── rows ─────────────────────────────────────────────────────────────────────\n\n/**\n * What the active rows of a section mean: nothing when none of its commands\n * is active, one choice of several (radio) when exactly one is, and a switch\n * per row otherwise (a lone switch, or several that are on together).\n */\ntype Choice = 'none' | 'radio' | 'checkbox';\n\nconst choiceOf = (rows: readonly ResolvedCommand[]): Choice => {\n const choosable = rows.filter((row) => !row.menu);\n const active = choosable.filter((row) => row.active).length;\n if (active === 0) return 'none';\n return active === 1 && choosable.length > 1 ? 'radio' : 'checkbox';\n};\n\nconst ROLE_OF: Readonly<Record<Choice, string>> = {\n none: 'menuitem',\n radio: 'menuitemradio',\n checkbox: 'menuitemcheckbox',\n};\n\nconst ROW_BASE =\n 'flex w-full items-center gap-3 rounded-md px-2.5 py-1.5 text-start text-sm outline-none transition-colors aria-disabled:cursor-not-allowed aria-disabled:opacity-40';\n\n/** A row, the pointer over it and the keyboard on it: the neutral hover look. */\nconst ROW_CLASS = `${ROW_BASE} text-fg-secondary hover:bg-hover focus-visible:bg-hover aria-disabled:hover:bg-transparent`;\n\n/**\n * The current choice: the accent look of an active toolbar button, so \"on\" reads the same\n * everywhere and never looks like the row the keyboard is on. The keyboard on it adds an inset\n * ring; with forced colors, where backgrounds go, an outline marks it.\n */\nconst CHOSEN_ROW_CLASS = `${ROW_BASE} bg-selected text-accent focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent forced-colors:outline-2 forced-colors:outline-solid forced-colors:-outline-offset-2`;\n\n/**\n * One row: the command's icon, label and shortcut, in the accent look when it\n * is the current choice. A row that can't run says why in its tooltip, and\n * stays where it is, greyed out.\n */\nexport function MenuItem({\n command,\n choice,\n onSelect,\n}: {\n command: ResolvedCommand;\n choice: Choice;\n onSelect: () => void;\n}) {\n const checked = choice !== 'none' && command.active;\n const [shortcut] = command.shortcuts;\n return (\n <button\n type=\"button\"\n tabIndex={-1}\n role={ROLE_OF[choice]}\n aria-checked={choice === 'none' ? undefined : command.active}\n aria-disabled={command.enabled ? undefined : true}\n title={command.enabled ? undefined : command.disabledReason}\n part={checked ? 'menu-item menu-item-active' : 'menu-item'}\n onClick={() => {\n if (command.enabled) onSelect();\n }}\n className={checked ? CHOSEN_ROW_CLASS : ROW_CLASS}\n >\n {command.icon && (\n <Icon\n name={command.icon}\n size={16}\n accent={command.iconAccent}\n className={checked ? 'text-accent' : 'text-fg-muted'}\n />\n )}\n <span className=\"flex-1 truncate\">{command.label}</span>\n {shortcut && <span className=\"text-fg-muted ms-4 text-xs\">{formatShortcut(shortcut)}</span>}\n </button>\n );\n}\n\n/**\n * A row whose command opens a menu: it opens that menu beside it, with a\n * click or the arrow key toward it. Picking a row in there runs `onRun` too,\n * so the whole menu closes.\n */\nfunction SubmenuItem({\n command,\n menuId,\n onRun,\n}: {\n command: ResolvedCommand;\n menuId: string;\n onRun?: () => void;\n}) {\n const [open, setOpen] = useState(false);\n const openInSheet = useContext(MenuSheetContext);\n return (\n <div role=\"none\" className=\"relative\">\n <button\n type=\"button\"\n tabIndex={-1}\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-disabled={command.enabled ? undefined : true}\n title={command.enabled ? undefined : command.disabledReason}\n part=\"menu-item\"\n onClick={(event) => {\n if (!command.enabled) return;\n // In a sheet, the submenu slides in over this menu.\n if (openInSheet) {\n openInSheet({ menuId, label: command.label, opener: event.currentTarget, onRun });\n } else setOpen((previous) => !previous);\n }}\n className={`${ROW_CLASS} ${open ? 'bg-hover' : ''}`}\n >\n {command.icon && (\n <Icon\n name={command.icon}\n size={16}\n accent={command.iconAccent}\n className=\"text-fg-muted\"\n />\n )}\n <span className=\"flex-1 truncate\">{command.label}</span>\n <Icon name=\"chevronRight\" size={16} className=\"text-fg-muted rtl:-scale-x-100\" />\n </button>\n {open && (\n <MenuPopover onClose={() => setOpen(false)}>\n <MenuBody menuId={menuId} onRun={onRun} />\n </MenuPopover>\n )}\n </div>\n );\n}\n\n/** A layout menu's row, by command id. */\nfunction MenuRow({\n commandId,\n choice,\n onRun,\n}: {\n commandId: string;\n choice: Choice;\n onRun?: () => void;\n}) {\n const command = useCommand(commandId);\n if (!command.visible) return null;\n if (command.menu) {\n return <SubmenuItem command={command} menuId={command.menu} onRun={onRun} />;\n }\n return (\n <MenuItem\n command={command}\n choice={choice}\n onSelect={() => {\n void command.run();\n onRun?.();\n }}\n />\n );\n}\n\n// ── sections ─────────────────────────────────────────────────────────────────\n\n/** A section: its rows as a group named by its title, after a line when it isn't the first. */\nfunction MenuGroup({\n title,\n first,\n children,\n}: {\n title?: string;\n first: boolean;\n children: ReactNode;\n}) {\n const titleId = useId();\n return (\n <>\n {!first && <div role=\"separator\" className=\"bg-border-subtle my-1 h-px\" />}\n <div role=\"group\" aria-labelledby={title ? titleId : undefined}>\n {title && (\n <div\n id={titleId}\n className=\"text-fg-muted px-2.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide\"\n >\n {title}\n </div>\n )}\n {children}\n </div>\n </>\n );\n}\n\nconst sameChoices = (left: readonly (Choice | null)[], right: readonly (Choice | null)[]) =>\n left.length === right.length && left.every((choice, i) => choice === right[i]);\n\n/** One section-separated menu, by its id in the layout. */\nexport function MenuBody({ menuId, onRun }: { menuId: string; onRun?: () => void }) {\n const t = useT();\n const menu = useMenu(menuId);\n const commands = useCommands();\n const documentId = useDocumentId() ?? undefined;\n // Per section, what its active rows mean, or null when it has no visible row: an empty\n // section doesn't leave its title and line behind.\n const choices = useKernelValue(\n () =>\n (menu ?? []).map((section) => {\n const rows = section.items\n .map((id) => commands.resolveCommand(id, documentId))\n .filter((command): command is ResolvedCommand => command?.visible === true);\n return rows.length === 0 ? null : choiceOf(rows);\n }),\n sameChoices,\n );\n if (!menu) return null;\n const shown = menu.flatMap((section, i) => {\n const choice = choices[i];\n return choice ? [{ section, choice }] : [];\n });\n if (shown.length === 0) return null;\n return (\n <div className=\"min-w-52 p-1\">\n {shown.map(({ section, choice }, i) => (\n <MenuGroup\n key={i}\n first={i === 0}\n title={section.title ?? (section.titleKey ? t(section.titleKey) : undefined)}\n >\n {section.items.map((id) => (\n <MenuRow key={id} commandId={id} choice={choice} onRun={onRun} />\n ))}\n </MenuGroup>\n ))}\n </div>\n );\n}\n\n/**\n * A menu the toolbar derives (the \"More\" menu, a folded group's): its\n * sections in bar order, the bar's groups as titled sections, and a row for\n * each command; a command that opens a menu opens it beside its row.\n */\nexport function ToolbarMenu({ view, align }: { view: OverflowMenuView; align?: MenuAlign }) {\n const t = useT();\n if (!view.isOpen) return null;\n const sections = view.sections.map((section) => {\n const rows = section.rows.flatMap((row) => {\n const command = view.resolve(row.command);\n return command ? [{ row, command }] : [];\n });\n const choice: Choice =\n section.role === 'radio' ? 'radio' : choiceOf(rows.map(({ command }) => command));\n return { section, rows, choice };\n });\n return (\n <MenuPopover onClose={view.close} align={align}>\n <div className=\"min-w-56 p-1\">\n {sections.map(({ section, rows, choice }, i) => (\n <MenuGroup\n key={i}\n first={i === 0}\n title={section.labelKey ? t(section.labelKey) : undefined}\n >\n {rows.map(({ row, command }) =>\n row.type === 'submenu' ? (\n <SubmenuItem\n key={row.command}\n command={command}\n menuId={row.menu}\n onRun={view.close}\n />\n ) : (\n <MenuItem\n key={row.command}\n command={command}\n choice={choice}\n onSelect={() => {\n view.execute(row.command);\n view.close();\n }}\n />\n ),\n )}\n </MenuGroup>\n ))}\n </div>\n </MenuPopover>\n );\n}\n","/**\n * The app's toolbar look — Tailwind render props over the headless <Toolbar>.\n * The app owns the pixels; ui-core owns the physics (measure → solve →\n * overflow). Nothing here knows about breakpoints or widths.\n */\nimport { MeasurementScaleButton } from './measurement-scale';\nimport { useEffect, useState } from 'react';\nimport { VIEW_MODE_COMMAND, groupMenuView, type CustomItem } from '@embedpdf/core-ui';\nimport { useOptionalCapability, useOptionalSelector } from '@embedpdf/react/runtime';\nimport { Toolbar } from '@embedpdf/react/toolbar';\nimport type {\n BarSchema,\n CollapsedGroupView,\n CustomSlotCtx,\n GroupDisclosureView,\n OverflowMenuView,\n} from '@embedpdf/react/toolbar';\nimport { useCommand, useCommands } from '@embedpdf/react/commands';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\nimport { TOOLBAR_ITEM_ATTRIBUTE } from '@embedpdf/web';\nimport { PageNumber } from './page-number';\nimport { QuickStamps } from './quick-stamps';\nimport { ViewOnlyLabel } from './view-only';\nimport { ShellToken } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { StageToken } from '@embedpdf/react/stage';\nimport { Icon } from './icons';\nimport { ItemSocket } from './item-socket';\nimport { MenuAnchor, ToolbarMenu } from './menu';\n\n// ── the Button recipe ─────────────────────────────────────────────────────────\nconst BTN_BASE =\n 'flex h-8 w-auto min-w-8 cursor-pointer items-center justify-center rounded-md p-[5px] transition-colors';\nconst BTN_HOVER = 'hover:bg-hover hover:ring hover:ring-accent';\nconst BTN_ACTIVE = 'border-none bg-selected text-accent shadow ring ring-accent';\nconst BTN_DISABLED = 'cursor-not-allowed opacity-50 hover:bg-transparent hover:ring-0';\n\nexport const buttonClass = (active: boolean, enabled = true): string =>\n `${BTN_BASE} ${active ? BTN_ACTIVE : BTN_HOVER} ${enabled ? '' : BTN_DISABLED}`;\n\n/**\n * The part name of a button in a bar, for page CSS through `::part()`: `toolbar-button`, and\n * `toolbar-button-active` too while it's pressed or its menu is open. Part names are public, as\n * the Theming page lists them.\n */\nexport const buttonPart = (active: boolean): string =>\n active ? 'toolbar-button toolbar-button-active' : 'toolbar-button';\n\n/** The part name of a mode tab: `mode-tab`, and `mode-tab-active` too for the open mode. */\nconst modeTabPart = (active: boolean): string => (active ? 'mode-tab mode-tab-active' : 'mode-tab');\n\n// ── the TabButton recipe (the underline) ──────────────────────────────────────\nconst TAB_BASE =\n 'flex h-8 w-auto min-w-8 cursor-pointer items-center justify-center rounded-none border-b-2 px-2 py-1 text-sm transition-colors hover:bg-transparent hover:border-b-fg-muted';\nconst TAB_ACTIVE = 'border-b-accent text-accent hover:border-b-accent';\nconst TAB_INACTIVE = 'border-b-transparent';\n\nconst tabClass = (active: boolean, enabled = true): string =>\n `${TAB_BASE} ${active ? TAB_ACTIVE : TAB_INACTIVE} ${enabled ? '' : 'cursor-not-allowed opacity-50'}`;\n\n// ── a single command button (icon / icon+label / label=tab) ──────────────────\nexport function CommandButton({\n cmd,\n variant,\n run,\n}: {\n cmd: ResolvedCommand;\n variant: string;\n run: () => void;\n}) {\n const isTab = variant === 'label';\n\n // Buttons carry no caret — a menu command is a plain icon button; the\n // `menu:` declaration still drives aria-haspopup and the anchored popover.\n // A menu command is active while its menu is open at this button: it says it's expanded.\n const draw = (active: boolean) => (\n <button\n type=\"button\"\n onClick={run}\n disabled={!cmd.enabled}\n aria-pressed={cmd.menu ? undefined : active || undefined}\n aria-haspopup={cmd.menu ? 'menu' : undefined}\n aria-expanded={cmd.menu ? active : undefined}\n aria-label={cmd.label}\n // A command the scope doesn't allow, shown under `notAllowed: 'disable'`, says why.\n title={cmd.disabledReason ?? cmd.label}\n part={isTab ? modeTabPart(active) : buttonPart(active)}\n className={isTab ? tabClass(active, cmd.enabled) : buttonClass(active, cmd.enabled)}\n >\n {isTab ? (\n <span className=\"whitespace-nowrap px-1\">{cmd.label}</span>\n ) : variant === 'icon+label' ? (\n <span className=\"flex items-center whitespace-nowrap text-sm\">\n {cmd.icon && (\n <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} className=\"me-1.5 shrink-0\" />\n )}\n <span>{cmd.label}</span>\n </span>\n ) : cmd.icon ? (\n <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} />\n ) : (\n <span className=\"text-sm\">{cmd.label}</span>\n )}\n </button>\n );\n\n if (!cmd.menu) return draw(cmd.active);\n return <MenuAnchor menuId={cmd.menu}>{draw}</MenuAnchor>;\n}\n\n// ── the inline zoom widget ───────────────────────────────────────────────────\n\n/**\n * Makes a control inside an item one more stop of the toolbar's arrow keys: the zoom field's\n * buttons are reached with the arrows, like the bar's own, and the bar stays one Tab stop.\n */\nconst ARROW_STOP = { [TOOLBAR_ITEM_ATTRIBUTE]: '', className: 'contents' } as Record<\n string,\n string\n>;\n\nfunction ZoomControls() {\n const t = useT();\n const commands = useCommands();\n const zoomIn = useCommand('zoom:in');\n const zoomOut = useCommand('zoom:out');\n const zoomMenu = useCommand('menu:zoom');\n const shell = useOptionalCapability(ShellToken);\n const stage = useOptionalCapability(StageToken);\n // Null-safe: the zoom strip is main-toolbar chrome, mounted before any\n // document exists — it reads 100% until a Stage is there to ask.\n const level = useOptionalSelector(StageToken, (stage) => stage.getZoomLevel(), 1);\n const pct = Math.round((level ?? 1) * 100);\n const [inputValue, setInputValue] = useState(String(pct));\n useEffect(() => setInputValue(String(pct)), [pct]);\n\n const submit = (event: React.FormEvent) => {\n event.preventDefault();\n const value = parseFloat(inputValue);\n if (!isNaN(value) && value > 0) stage?.zoomTo({ level: value / 100 });\n };\n\n // The zoom menu lines up with the whole field.\n return (\n <MenuAnchor menuId=\"zoom\" className=\"relative block\">\n {(zoomOpen) => (\n <div className=\"bg-hover flex items-center rounded\">\n {/* editable zoom percentage */}\n <form\n onSubmit={submit}\n className=\"flex min-w-0 flex-nowrap items-center overflow-hidden whitespace-nowrap\"\n >\n <input\n name=\"zoom\"\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"\\d*\"\n aria-label={t('commands.zoom.level')}\n className=\"h-6 w-8 min-w-0 shrink border-0 bg-transparent p-0 text-end text-sm outline-none focus:outline-none\"\n value={inputValue}\n onChange={(event) => setInputValue(event.target.value.replace(/[^0-9]/g, ''))}\n onBlur={() => {\n if (!inputValue || parseFloat(inputValue) <= 0) setInputValue(String(pct));\n }}\n />\n <span className=\"shrink-0 text-sm\">%</span>\n </form>\n {/* zoom menu chevron */}\n <span {...ARROW_STOP}>\n <button\n type=\"button\"\n aria-haspopup=\"menu\"\n aria-expanded={zoomOpen}\n title={zoomMenu.label}\n part={buttonPart(false)}\n className={buttonClass(false)}\n onClick={() => shell?.toggleMenu('zoom')}\n >\n <Icon name=\"chevronDown\" size={20} />\n </button>\n </span>\n <span {...ARROW_STOP}>\n <button\n type=\"button\"\n title={zoomOut.label}\n part={buttonPart(false)}\n className={buttonClass(false)}\n onClick={() => commands.execute('zoom:out')}\n >\n <Icon name=\"zoomOut\" size={20} />\n </button>\n </span>\n <span {...ARROW_STOP}>\n <button\n type=\"button\"\n title={zoomIn.label}\n part={buttonPart(false)}\n className={buttonClass(false)}\n onClick={() => commands.execute('zoom:in')}\n >\n <Icon name=\"zoomIn\" size={20} />\n </button>\n </span>\n </div>\n )}\n </MenuAnchor>\n );\n}\n\n/** The 'button' variant of the zoom slot — a single icon that opens the menu. */\nfunction ZoomButton() {\n const shell = useOptionalCapability(ShellToken);\n const zoomMenu = useCommand('menu:zoom');\n return (\n <MenuAnchor menuId=\"zoom\">\n {(zoomOpen) => (\n <button\n type=\"button\"\n title={zoomMenu.label}\n aria-haspopup=\"menu\"\n aria-expanded={zoomOpen}\n part={buttonPart(zoomOpen)}\n className={buttonClass(zoomOpen)}\n onClick={() => shell?.toggleMenu('zoom')}\n >\n <Icon name=\"zoomIn\" size={20} />\n </button>\n )}\n </MenuAnchor>\n );\n}\n\n// ── a shed group's in-strip disclosure (derived) ─────────────────────────────\nfunction GroupTrigger({ view }: { view: GroupDisclosureView }) {\n const [open, setOpen] = useState(false);\n // The active tab may be hiding behind the chevron — hint at it, tab-style.\n const activeHidden = view.commands.some((command) => command.active);\n return (\n <span className=\"relative inline-flex\">\n <button\n type=\"button\"\n onClick={() => setOpen((previous) => !previous)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n // The chevron the trailing mode tabs fold behind is a tab too; another group's is a button.\n part={view.id === 'modes' ? modeTabPart(activeHidden) : buttonPart(open)}\n className={tabClass(activeHidden)}\n >\n <Icon name=\"chevronDown\" size={18} />\n </button>\n <ToolbarMenu view={groupMenuView(view, open, () => setOpen(false))} />\n </span>\n );\n}\n\n// ── the collapsed modes group ────────────────────────────────────────────────\nfunction CollapsedModes({ view }: { view: CollapsedGroupView }) {\n const [open, setOpen] = useState(false);\n const active = view.commands.find((command) => command.active) ?? view.commands[0];\n // The control highlights whenever a non-default mode is active.\n const isActive = Boolean(active?.active && active.id !== VIEW_MODE_COMMAND);\n return (\n <div style={{ width: 100 }} className=\"relative\">\n <button\n type=\"button\"\n onClick={() => setOpen((previous) => !previous)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n part={buttonPart(open)}\n className=\"bg-surface hover:bg-hover flex w-full cursor-pointer appearance-none items-center rounded-md py-1.5 pe-2 ps-3 text-[13px] transition-colors\"\n >\n <span\n className={`min-w-0 flex-1 truncate text-start ${isActive ? 'text-accent' : 'text-fg'}`}\n >\n {active?.label}\n </span>\n <Icon\n name=\"chevronDown\"\n size={16}\n className={isActive ? 'text-accent' : 'text-fg-secondary'}\n />\n </button>\n <ToolbarMenu view={groupMenuView(view, open, () => setOpen(false))} />\n </div>\n );\n}\n\n// ── a group folded into one menu button (`collapse: 'menu'`) ─────────────────\nfunction CollapsedMenu({ view }: { view: CollapsedGroupView }) {\n const t = useT();\n const [open, setOpen] = useState(false);\n // The button shows the group's current choice, else its first command.\n const shown = view.commands.find((command) => command.active) ?? view.commands[0];\n const label = view.labelKey ? t(view.labelKey) : shown?.label;\n return (\n <span className=\"relative inline-flex\">\n <button\n type=\"button\"\n onClick={() => setOpen((previous) => !previous)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-label={label}\n title={label}\n part={buttonPart(open)}\n className={buttonClass(open)}\n >\n {shown?.icon ? (\n <Icon name={shown.icon} size={20} accent={shown.iconAccent} />\n ) : (\n <span className=\"whitespace-nowrap px-1 text-sm\">{label}</span>\n )}\n <Icon name=\"chevronDown\" size={14} className=\"text-fg-secondary\" />\n </button>\n <ToolbarMenu view={groupMenuView(view, open, () => setOpen(false))} />\n </span>\n );\n}\n\n// ── the derived overflow menu ────────────────────────────────────────────────\nfunction OverflowMenu({ view }: { view: OverflowMenuView }) {\n // The \"More\" button is at the bar's end: the menu lines up with it there.\n return <ToolbarMenu view={view} align=\"end\" />;\n}\n\nfunction OverflowTrigger({ isOpen, toggle }: { isOpen: boolean; toggle: () => void }) {\n const t = useT();\n return (\n <button\n type=\"button\"\n onClick={toggle}\n aria-haspopup=\"menu\"\n aria-expanded={isOpen}\n title={t('demo.more')}\n part={buttonPart(isOpen)}\n className={buttonClass(isOpen)}\n >\n <Icon name=\"dots\" size={20} />\n </button>\n );\n}\n\n// ── your own items ───────────────────────────────────────────────────────────\n\n/** The custom items in `bar`, in order. */\nfunction customItemsOf(bar: BarSchema): CustomItem[] {\n const groups = [\n ...(bar.sections.start ?? []),\n ...(bar.sections.center ?? []),\n ...(bar.sections.end ?? []),\n ];\n return groups.flatMap((group) =>\n group.items.filter(\n (child): child is CustomItem => typeof child === 'object' && 'slot' in child,\n ),\n );\n}\n\n/** What your item stands for while nothing is slotted into it: its command's button. */\nfunction StandIn({ commandId }: { commandId: string }) {\n const command = useCommand(commandId);\n if (!command.visible) return null;\n return <CommandButton cmd={command} variant=\"icon\" run={() => void command.run()} />;\n}\n\n// ── the assembled toolbar ────────────────────────────────────────────────────\nexport function AppToolbar({\n bar,\n orientation = 'horizontal',\n className,\n}: {\n bar: BarSchema;\n /** A vertical toolbar (a bar at the start or end edge) draws its commands as icons. */\n orientation?: 'horizontal' | 'vertical';\n className?: string;\n}) {\n const vertical = orientation === 'vertical';\n // The custom items the viewer draws itself.\n const builtIn: Record<string, (variant: string) => React.ReactNode> = {\n 'measurement-scale': () => <MeasurementScaleButton />,\n // The zoom field, or its button when there's no room; the field runs across a bar, so a\n // vertical one draws the button.\n zoom: (variant) => (variant === 'button' || vertical ? <ZoomButton /> : <ZoomControls />),\n 'quick-stamps': () => <QuickStamps />,\n 'page-number': () => <PageNumber />,\n 'view-only': (variant) => <ViewOnlyLabel compact={variant === 'icon' || vertical} />,\n };\n // Every other one is yours, slotted in, so the measurement layer can't hold it: its socket is\n // measured where it renders.\n const yours = Object.fromEntries(\n customItemsOf(bar)\n .filter((item) => !Object.prototype.hasOwnProperty.call(builtIn, item.slot))\n .map((item) => [\n item.slot,\n (variant: string, ctx: CustomSlotCtx) =>\n ctx.layer === 'measure' ? null : (\n <ItemSocket\n id={item.slot}\n variant={item.variants ? variant : null}\n orientation={orientation}\n measure={ctx.measure}\n >\n {item.terminal ? <StandIn commandId={item.terminal} /> : null}\n </ItemSocket>\n ),\n ]),\n );\n return (\n <Toolbar\n bar={bar}\n orientation={orientation}\n gap={8} // Tailwind's gap-2\n separatorWidth={1}\n className={className}\n renderCommand={(cmd, variant, run) => <CommandButton cmd={cmd} variant={variant} run={run} />}\n renderCustom={{ ...yours, ...builtIn }}\n renderCollapsed={(view) =>\n view.id === 'modes' ? (\n <CollapsedModes view={view} />\n ) : view.collapse === 'menu' ? (\n <CollapsedMenu view={view} />\n ) : undefined\n }\n renderGroupTrigger={(view) => <GroupTrigger view={view} />}\n renderSeparator={() => (\n <span className={`bg-border self-center ${vertical ? 'h-px w-6' : 'h-6 w-px'}`} />\n )}\n renderOverflowTrigger={(isOpen, toggle) => (\n <OverflowTrigger isOpen={isOpen} toggle={toggle} />\n )}\n renderOverflowMenu={(view) => <OverflowMenu view={view} />}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,gBAAgB;CAC3B,aAAa;EAAC;EAAa;EAAU;EAAW;EAAQ;EAAS;CAAO;CACxE,QAAQ,CAAC;CACT,QAAQ,CAAC;CACT,UAAU,CAAC,SAAS;CACpB,OAAO,CAAC,WAAW,UAAU;CAC7B,YAAY,CAAC,WAAW,UAAU;CAClC,WAAW,CAAC;CACZ,aAAa,CAAC;CACd,OAAO,CAAC;CACR,aAAa,CAAC,QAAQ;CACtB,MAAM,CAAC,aAAa,MAAM;CAC1B,QAAQ,CAAC;CACT,YAAY,CAAC;CACb,SAAS,CAAC,SAAS;CACnB,WAAW;EAAC;EAAQ;EAAY;EAAS;CAAM;AACjD;;AAeA,MAAa,qBAAyC;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,YAAY,SAAi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,IAAA,CAAC,YAAD;IACE,IAAI,KAAK;IACT,SAAS,KAAK,WAAW,UAAU;IACtB;IACb,SAAS,IAAI;IAEZ,UAAA,KAAK,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD,EAAS,WAAW,KAAK,SAAW,CAAA,IAAI;GAC/C,CAAA,CAElB,CAAC,CAUsB;GAAG,GAAG;EAAQ;EACrC,kBAAkB,SAChB,KAAK,OAAO,UACV,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD,EAAsB,KAAO,CAAA,IAC3B,KAAK,aAAa,SACpB,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD,EAAqB,KAAO,CAAA,IAC1B,KAAA;EAEN,qBAAqB,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD,EAAoB,KAAO,CAAA;EACzD,uBACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAW,yBAAyB,WAAW,aAAa,aAAe,CAAA;EAEnF,wBAAwB,QAAQ,WAC9B,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD;GAAyB;GAAgB;EAAS,CAAA;EAEpD,qBAAqB,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD,EAAoB,KAAO,CAAA;CAC1D,CAAA;AAEL"}
@@ -99,6 +99,7 @@ const zhCN = {
99
99
  note: "注释",
100
100
  link: "链接",
101
101
  gotoLink: "转到链接",
102
+ saveFile: "保存文件",
102
103
  removeLink: "删除链接",
103
104
  delete: "删除",
104
105
  group: "分组",
@@ -155,12 +156,44 @@ const zhCN = {
155
156
  "annotations-create": "不允许添加注释",
156
157
  "doc-annotate-modify": "不允许更改注释",
157
158
  "doc-annotate-read": "不允许查看注释",
159
+ "doc-attachments-modify": "不允许添加文件",
158
160
  "doc-download": "不允许下载",
159
161
  "doc-forms-modify": "不允许编辑表单字段",
162
+ "doc-outline-modify": "不允许更改书签",
163
+ "doc-pages-assemble": "不允许更改页面",
160
164
  "doc-print": "不允许打印",
161
165
  "doc-text-copy": "不允许复制",
162
166
  "doc-text-search": "不允许搜索"
163
167
  },
168
+ attachment: {
169
+ add: "添加文件",
170
+ save: "保存",
171
+ goTo: "转到页面",
172
+ delete: "删除",
173
+ more: "更多选项"
174
+ },
175
+ outline: {
176
+ add: "添加书签",
177
+ addChild: "添加子书签",
178
+ rename: "重命名",
179
+ setDestination: "将目标设为当前视图",
180
+ properties: "属性…",
181
+ delete: "删除",
182
+ expandAll: "全部展开",
183
+ collapseAll: "全部折叠",
184
+ more: "更多选项"
185
+ },
186
+ pages: {
187
+ rotateClockwise: "顺时针旋转页面",
188
+ rotateCounterclockwise: "逆时针旋转页面",
189
+ delete: "删除页面",
190
+ duplicate: "复制页面",
191
+ insertBlank: "插入空白页",
192
+ insertFile: "从文件插入…",
193
+ extract: "提取页面",
194
+ selectAll: "选择所有页面",
195
+ more: "页面选项"
196
+ },
164
197
  turnedOff: "“{label}”不可用"
165
198
  },
166
199
  passwordPrompt: {
@@ -213,6 +246,25 @@ const zhCN = {
213
246
  other: "其他"
214
247
  },
215
248
  goToPage: { go: "转到" },
249
+ print: {
250
+ title: "打印",
251
+ pages: "页面",
252
+ allPages: "全部页面",
253
+ currentPage: "当前页",
254
+ range: "自定义",
255
+ rangeLabel: "要打印的页面",
256
+ rangePlaceholder: "例如:1-3, 5",
257
+ rangeInvalid: "请输入 1 到 {total} 的页码,例如 1-3, 5",
258
+ annotations: "打印注释",
259
+ preparing: "正在准备…",
260
+ preparingPage: "正在准备第 {page} 页,共 {total} 页…",
261
+ ready: "已准备好打印。",
262
+ images: "页面将以 {dpi} DPI 的图像打印。",
263
+ lowResolution: "此文档仅允许低分辨率打印({dpi} DPI)。",
264
+ failed: "无法准备打印内容。",
265
+ cancel: "取消",
266
+ print: "打印"
267
+ },
216
268
  panels: {
217
269
  thumbnails: "缩略图",
218
270
  outline: "书签",
@@ -408,6 +460,46 @@ const zhCN = {
408
460
  noRotate: "页面旋转时保持直立",
409
461
  invisible: "旧版:隐藏未知的子类型"
410
462
  },
463
+ attachments: {
464
+ loading: "正在加载附件…",
465
+ failed: "无法读取附件。",
466
+ empty: "此文档没有附加文件",
467
+ drop: "拖放文件以附加",
468
+ dropHint: "或将文件拖放到此处",
469
+ adding: "正在添加…",
470
+ onPage: "第 {page} 页",
471
+ count: "{count} 个文件",
472
+ countPlural: "{count} 个文件"
473
+ },
474
+ outline: {
475
+ filter: "筛选书签",
476
+ loading: "正在加载书签…",
477
+ failed: "无法读取书签。",
478
+ empty: "此文档没有书签",
479
+ noMatches: "没有匹配的书签",
480
+ incomplete: "部分书签无法读取。",
481
+ untitled: "无标题",
482
+ properties: {
483
+ title: "书签属性",
484
+ name: "标题",
485
+ color: "颜色",
486
+ noColor: "无",
487
+ customColor: "自定义颜色",
488
+ bold: "粗体",
489
+ italic: "斜体",
490
+ open: "打开文档时展开",
491
+ target: "目标",
492
+ targetNone: "无",
493
+ targetView: "当前视图",
494
+ targetNamed: "页面操作",
495
+ targetKept: "保持不变",
496
+ keptNote: "此书签会运行脚本或打开其他文件,无法在此更改。",
497
+ fit: "适合方式",
498
+ fitKept: "保持原样",
499
+ save: "保存",
500
+ cancel: "取消"
501
+ }
502
+ },
411
503
  linkEditor: {
412
504
  toUrl: "链接到 URL",
413
505
  url: "URL",
@@ -563,4 +655,4 @@ const zhCN = {
563
655
  //#endregion
564
656
  export { zhCN };
565
657
 
566
- //# sourceMappingURL=zh-cn-CxkUUBct.js.map
658
+ //# sourceMappingURL=zh-cn-BMPPkLpL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-cn-BMPPkLpL.js","names":[],"sources":["../src/locales/zh-cn.ts"],"sourcesContent":["import type { Locale } from '@embedpdf/react/i18n';\n\n/**\n * Simplified Chinese pack, in the words Adobe Acrobat's Simplified Chinese edition uses.\n * Machine-translated from the English pack (`./en.ts`) and not yet reviewed by a native speaker.\n */\nexport const zhCN: Locale = {\n code: 'zh-CN',\n name: '简体中文',\n translations: {\n measurement: {\n title: '测量',\n distance: '距离',\n perimeter: '周长',\n area: '面积',\n areaUnit: '面积单位',\n resetLabel: '重置标签位置',\n calibrate: '校准比例',\n scale: '比例',\n custom: '自定义',\n unavailable: '不可用',\n instructions:\n '拖动以测量距离,然后单击以放置尺寸线。单击各个顶点以测量周长或面积,双击完成。面积边界不得交叉;不可用的预览无法完成。按 Escape 取消。拖动标签本身可移动标签。',\n sessionOnly: '此引擎仅在本次会话中保留页面校准。',\n allPages: '应用于所有页面',\n recalculate: '重新计算现有测量',\n preset: '比例预设',\n choosePreset: '选择预设',\n unit: '单位',\n precision: '精度',\n selection: '所选测量',\n report: '已更新 {updated} 项 · 已跳过 {skipped} 项 · 失败 {failed} 项',\n knownLength: '输入您刚绘制的线条所代表的实际长度。',\n length: '已知长度',\n apply: '应用比例',\n applying: '正在应用…',\n },\n commands: {\n zoom: {\n in: '放大',\n out: '缩小',\n fitPage: '适合页面',\n fitWidth: '适合宽度',\n automatic: '自动',\n menu: '缩放',\n level: '缩放级别',\n p50: '50%',\n p100: '100%',\n p150: '150%',\n p200: '200%',\n p400: '400%',\n },\n pan: '平移',\n pointer: '选择',\n comment: '注释',\n style: '样式',\n menu: '菜单',\n viewControls: '视图控件',\n open: '打开',\n download: '下载',\n print: '打印',\n fullscreen: '全屏',\n spread: {\n group: '页面布局',\n none: '单页',\n odd: '双页',\n even: '封面页',\n },\n scroll: {\n group: '滚动',\n vertical: '垂直',\n horizontal: '水平',\n },\n rotate: {\n group: '旋转',\n clockwise: '顺时针旋转',\n counterclockwise: '逆时针旋转',\n },\n mode: {\n measure: '测量',\n group: '模式',\n view: '查看',\n annotate: '注释',\n shapes: '形状',\n insert: '插入',\n form: '表单',\n redact: '涂黑',\n },\n annotate: {\n cancelCreation: '取消绘制',\n highlight: '高亮',\n strikeout: '删除线',\n underline: '下划线',\n squiggly: '波浪线',\n ink: '绘图',\n inkHighlight: '荧光笔',\n text: '文本框',\n insertText: '插入文本',\n replaceText: '替换文本',\n callout: '标注',\n note: '注释',\n link: '链接',\n gotoLink: '转到链接',\n saveFile: '保存文件',\n removeLink: '删除链接',\n delete: '删除',\n group: '分组',\n ungroup: '取消分组',\n stampFromSelection: '创建图章',\n strip: '注释操作',\n },\n selection: {\n copy: '复制',\n strip: '文本选择操作',\n },\n shapes: {\n rectangle: '矩形',\n circle: '椭圆',\n line: '直线',\n arrow: '箭头',\n polygon: '多边形',\n polyline: '折线',\n },\n insert: {\n stamp: '图章',\n attachment: '附加文件',\n signature: '签名',\n image: '图像',\n },\n form: {\n textfield: '文本字段',\n checkbox: '复选框',\n radio: '单选按钮',\n select: '下拉列表',\n listbox: '列表框',\n button: '按钮',\n signature: '签名字段',\n // The Form mode's design switch, which opens the form designer's sidebar.\n design: '表单设计',\n },\n redact: {\n mark: '标记涂黑',\n applyAll: '应用涂黑',\n clearAll: '清除标记',\n },\n undo: '撤销',\n redo: '重做',\n page: {\n next: '下一页',\n previous: '上一页',\n first: '第一页',\n last: '最后一页',\n goTo: '转到页面',\n },\n find: '查找',\n shortcuts: '键盘快捷键',\n notAllowed: {\n default: '不允许使用“{label}”',\n 'annotations-create': '不允许添加注释',\n 'doc-annotate-modify': '不允许更改注释',\n 'doc-annotate-read': '不允许查看注释',\n 'doc-attachments-modify': '不允许添加文件',\n 'doc-download': '不允许下载',\n 'doc-forms-modify': '不允许编辑表单字段',\n 'doc-outline-modify': '不允许更改书签',\n 'doc-pages-assemble': '不允许更改页面',\n 'doc-print': '不允许打印',\n 'doc-text-copy': '不允许复制',\n 'doc-text-search': '不允许搜索',\n },\n attachment: {\n add: '添加文件',\n save: '保存',\n goTo: '转到页面',\n delete: '删除',\n more: '更多选项',\n },\n outline: {\n add: '添加书签',\n addChild: '添加子书签',\n rename: '重命名',\n setDestination: '将目标设为当前视图',\n properties: '属性…',\n delete: '删除',\n expandAll: '全部展开',\n collapseAll: '全部折叠',\n more: '更多选项',\n },\n // The page commands, in the Pages mode and a page's menu.\n pages: {\n rotateClockwise: '顺时针旋转页面',\n rotateCounterclockwise: '逆时针旋转页面',\n delete: '删除页面',\n duplicate: '复制页面',\n insertBlank: '插入空白页',\n insertFile: '从文件插入…',\n extract: '提取页面',\n selectAll: '选择所有页面',\n more: '页面选项',\n },\n turnedOff: '“{label}”不可用',\n },\n passwordPrompt: {\n title: '需要密码',\n required: '此文档受密码保护。请输入密码以打开文档。',\n incorrect: '密码不正确。请重试。',\n incorrectWarning: '密码不正确',\n label: '密码',\n placeholder: '输入密码',\n cancel: '取消',\n open: '打开',\n opening: '正在打开…',\n },\n dropToOpen: {\n label: '拖放 PDF 以打开',\n },\n documentError: {\n title: '无法打开文档',\n unknown: '无法打开该文档。',\n notFound: '找不到该文件。',\n notAllowed: '您无权访问此文档。',\n damaged: '此文件不是 PDF,或已损坏。',\n unsupported: '此查看器无法打开这类文档。',\n retry: '重试',\n close: '关闭文档',\n },\n tabs: {\n close: '关闭 {name}',\n loading: '正在加载',\n untitled: '文档 {id}',\n },\n closeUnsaved: {\n title: '不保存就关闭?',\n body: '“{name}”有未下载的更改,这些更改将会丢失。',\n cancel: '取消',\n close: '不保存并关闭',\n },\n viewOnly: {\n label: '仅查看',\n turnedOff: '可更改此文档的工具已关闭',\n notAllowed: '您可以阅读此文档,但不能更改它',\n },\n panel: {\n close: '关闭',\n resize: '调整“{title}”大小',\n },\n menu: {\n back: '返回',\n },\n shortcuts: {\n document: '文档',\n viewing: '查看',\n editing: '编辑',\n other: '其他',\n },\n goToPage: {\n go: '转到',\n },\n print: {\n title: '打印',\n pages: '页面',\n allPages: '全部页面',\n currentPage: '当前页',\n range: '自定义',\n rangeLabel: '要打印的页面',\n rangePlaceholder: '例如:1-3, 5',\n rangeInvalid: '请输入 1 到 {total} 的页码,例如 1-3, 5',\n annotations: '打印注释',\n preparing: '正在准备…',\n preparingPage: '正在准备第 {page} 页,共 {total} 页…',\n ready: '已准备好打印。',\n images: '页面将以 {dpi} DPI 的图像打印。',\n lowResolution: '此文档仅允许低分辨率打印({dpi} DPI)。',\n failed: '无法准备打印内容。',\n cancel: '取消',\n print: '打印',\n },\n panels: {\n thumbnails: '缩略图',\n outline: '书签',\n attachments: '附件',\n search: '搜索',\n comments: '注释',\n style: '样式',\n stamps: '图章',\n signatures: '签名',\n redaction: '涂黑',\n measurement: '测量',\n formDesign: '表单设计',\n switch: '切换面板',\n },\n annotation: {\n comment: '注释',\n highlight: '高亮',\n underline: '下划线',\n squiggly: '波浪线',\n strikeout: '删除线',\n square: '矩形',\n circle: '椭圆',\n line: '直线',\n polygon: '多边形',\n polyline: '折线',\n ink: '墨迹',\n freeText: '文本框',\n stamp: '图章',\n caret: '插入符',\n redact: '涂黑',\n fileAttachment: '附件',\n // The style panel's labels, as the annotation kinds name them (`labelKey`), by wording:\n // one field is called different things by different kinds.\n style: {\n opacity: '不透明度',\n stroke: '描边',\n fill: '填充',\n color: '颜色',\n strokeWidth: '描边宽度',\n border: '边框',\n borderStyle: '边框样式',\n borderColor: '边框颜色',\n borderWidth: '边框宽度',\n background: '背景',\n outline: '轮廓',\n lineEndings: '线条端点',\n blendMode: '混合模式',\n font: '字体',\n fontSize: '字体大小',\n textColor: '文本颜色',\n bold: '粗体',\n italic: '斜体',\n underline: '下划线',\n align: '对齐',\n alignment: '对齐方式',\n label: '标签',\n labelFont: '标签字体',\n labelSize: '标签大小',\n labelColor: '标签颜色',\n icon: '图标',\n link: '链接',\n },\n // The annotation flags (`/F`).\n flags: {\n print: '打印',\n hidden: '隐藏',\n noView: '不显示',\n toggleNoView: '切换不显示',\n readOnly: '只读',\n locked: '锁定',\n lockedContents: '锁定内容',\n noZoom: '不缩放',\n noRotate: '不旋转',\n invisible: '不可见',\n },\n borderStyles: { solid: '实线', dashed: '虚线', cloudy: '云状' },\n lineEndings: {\n none: '无',\n square: '正方形',\n circle: '圆形',\n diamond: '菱形',\n openArrow: '开放箭头',\n closedArrow: '闭合箭头',\n butt: '平头',\n reverseOpenArrow: '反向开放箭头',\n reverseClosedArrow: '反向闭合箭头',\n slash: '斜线',\n },\n blendModes: {\n normal: '正常',\n multiply: '正片叠底',\n screen: '滤色',\n overlay: '叠加',\n darken: '变暗',\n lighten: '变亮',\n colorDodge: '颜色减淡',\n colorBurn: '颜色加深',\n hardLight: '强光',\n softLight: '柔光',\n difference: '差值',\n exclusion: '排除',\n hue: '色相',\n saturation: '饱和度',\n color: '颜色',\n luminosity: '明度',\n },\n // The standard PDF fonts, by their names: a language may keep them as they are.\n fonts: {\n courier: 'Courier',\n courierBold: 'Courier Bold',\n courierBoldOblique: 'Courier Bold Oblique',\n courierOblique: 'Courier Oblique',\n helvetica: 'Helvetica',\n helveticaBold: 'Helvetica Bold',\n helveticaBoldOblique: 'Helvetica Bold Oblique',\n helveticaOblique: 'Helvetica Oblique',\n timesRoman: 'Times Roman',\n timesBold: 'Times Bold',\n timesBoldItalic: 'Times Bold Italic',\n timesItalic: 'Times Italic',\n symbol: 'Symbol',\n zapfDingbats: 'Zapf Dingbats',\n },\n alignments: { left: '左对齐', center: '居中', right: '右对齐' },\n noteIcons: {\n comment: '注释',\n key: '键',\n note: '附注',\n help: '帮助',\n newParagraph: '新段落',\n paragraph: '段落',\n insert: '插入',\n },\n attachmentIcons: {\n pushPin: '图钉',\n paperclip: '回形针',\n graph: '图表',\n tag: '标签',\n },\n },\n // A form field's settings, as the form plugin names them (`labelKey`).\n form: {\n settings: {\n name: '名称',\n tooltip: '工具提示',\n required: '必填',\n readOnly: '只读',\n noExport: '不导出',\n defaultValue: '默认值',\n maxLength: '最大长度',\n multiline: '多行',\n password: '密码',\n comb: '每格一个字符',\n radiosInUnison: '值相同的按钮同时选中',\n keepOneOn: '始终保持一项选中',\n options: '选项',\n allowTyping: '允许输入',\n multiSelect: '多项选择',\n },\n },\n // A thumbnail's tooltip.\n thumbnails: { page: '第 {page} 页' },\n // The form designer's sidebar: the fields by page, and the selected one's buttons.\n formDesign: {\n empty: '尚无字段。选择一个字段工具以添加字段。',\n page: '第 {page} 页',\n allFields: '所有字段',\n buttons: '按钮',\n boxes: '复选框',\n box: '复选框 {number}',\n addButton: '添加按钮',\n addBox: '添加复选框',\n },\n // The style panel's own words around the properties.\n stylePanel: {\n mixed: '(混合)',\n // A color swatch that takes the color away.\n transparent: '透明',\n lineStart: '起点',\n lineEnd: '终点',\n empty: '选择一个绘图工具或选中一个注释以编辑其样式。',\n selected: '已选择 {count} 项',\n toolDefaults: '{tool} 默认值',\n defaults: '默认值',\n },\n // The flags section of the style panel: its title, and what each flag does.\n annotationFlags: {\n title: '标志 (/F)',\n print: '打印页面时包含',\n hidden: '在屏幕、单击和打印中均隐藏',\n noView: '在屏幕上隐藏,但仍可能打印',\n toggleNoView: '选中时显示设为“不显示”的注释',\n readOnly: '可见但不可单击',\n locked: '不可移动、调整大小、删除或更改样式',\n lockedContents: '文本不可更改;几何形状可以更改',\n noZoom: '屏幕上大小固定(锚定于左上角)',\n noRotate: '页面旋转时保持直立',\n invisible: '旧版:隐藏未知的子类型',\n },\n // The link editor over a selected annotation.\n attachments: {\n loading: '正在加载附件…',\n failed: '无法读取附件。',\n empty: '此文档没有附加文件',\n drop: '拖放文件以附加',\n dropHint: '或将文件拖放到此处',\n adding: '正在添加…',\n onPage: '第 {page} 页',\n count: '{count} 个文件',\n countPlural: '{count} 个文件',\n },\n outline: {\n filter: '筛选书签',\n loading: '正在加载书签…',\n failed: '无法读取书签。',\n empty: '此文档没有书签',\n noMatches: '没有匹配的书签',\n incomplete: '部分书签无法读取。',\n untitled: '无标题',\n properties: {\n title: '书签属性',\n name: '标题',\n color: '颜色',\n noColor: '无',\n customColor: '自定义颜色',\n bold: '粗体',\n italic: '斜体',\n open: '打开文档时展开',\n target: '目标',\n targetNone: '无',\n targetView: '当前视图',\n targetNamed: '页面操作',\n targetKept: '保持不变',\n keptNote: '此书签会运行脚本或打开其他文件,无法在此更改。',\n fit: '适合方式',\n fitKept: '保持原样',\n save: '保存',\n cancel: '取消',\n },\n },\n linkEditor: {\n toUrl: '链接到 URL',\n url: 'URL',\n toPage: '链接到页面',\n page: '页面',\n urlPlaceholder: 'https://…',\n pagePlaceholder: '页码',\n add: '添加链接',\n update: '更新链接',\n },\n demo: {\n starting: '正在启动查看器…',\n opening: '正在打开文档…',\n more: '更多',\n searchPlaceholder: '搜索文档…',\n searchCaseSensitive: '区分大小写',\n searchWholeWord: '全字匹配',\n searchRegex: '正则表达式',\n searchSearching: '正在搜索…',\n searchResults: '找到 {count} 个结果',\n searchNoResults: '无结果',\n searchPrevious: '上一个结果',\n searchNext: '下一个结果',\n searchPage: '第 {page} 页',\n commentsForbidden: '您无权访问此文档的注释。',\n commentsLoading: '正在加载注释…',\n commentsError: '注释加载失败。',\n commentsRetry: '重试',\n commentsEmpty: '尚无注释。使用注释工具开始讨论。',\n commentsEmptyReadOnly: '此文档没有注释。',\n commentsAnonymous: '未知',\n commentsPage: '第 {page} 页',\n commentCount: '{count} 条注释',\n commentCountPlural: '{count} 条注释',\n commentsReply: '回复',\n commentsReplyPlaceholder: '回复…',\n commentsAddPlaceholder: '添加注释…',\n commentsDelete: '删除注释',\n commentsDeleteThread: '删除讨论',\n commentsEdit: '编辑注释',\n commentsStatus: '状态',\n commentsStatusNone: '无状态',\n commentsStatusAccepted: '已接受',\n commentsStatusRejected: '已拒绝',\n commentsStatusCancelled: '已取消',\n commentsStatusCompleted: '已完成',\n empty: '此演示面板暂无内容。',\n page: '第 {current} 页,共 {total} 页',\n goToPage: '转到页面',\n cancel: '取消',\n pageBadge: '第 {page} 页',\n redactionEmpty: '没有待处理的涂黑标记。使用涂黑工具标记文本或区域。',\n redactionArea: '区域标记',\n redactionText: '文本标记',\n redactionRemove: '删除标记',\n redactConfirmTitle: '应用涂黑?',\n redactConfirmBody: '永久删除 {count} 个涂黑标记下的内容。此操作无法撤销。',\n redactConfirmCollateral: '另有 {count} 个注释也将被删除。',\n redactApply: '应用',\n redactApplying: '正在应用…',\n formatLabel: '格式',\n fieldSettingsTitle: '字段',\n fieldOptionLabel: '标签',\n fieldOptionValue: '值',\n fieldOptionAdd: '添加选项',\n fieldOptionRemove: '删除选项',\n fieldNone: '无',\n redactLabelTitle: '涂黑标签',\n redactLabelPlaceholder: '例如:已涂黑',\n redactLabelRepeat: '在区域内重复标签',\n stampsAll: '所有图章',\n stampsLoading: '正在加载图章…',\n stampsEmpty: '尚无图章。导入 PDF,将其每一页转换为一个图章。',\n stampsRemoveStamp: '删除图章',\n stampsArmedHint: '单击页面以放置图章。',\n stampsImport: '导入 PDF…',\n stampsImporting: '正在导入…',\n stampsImportHint: '将 PDF 导入为图章库——每一页成为一个图章。',\n stampsRemoveLibrary: '删除图章库',\n stampsExportLibrary: '将图章库导出为 PDF',\n stampsCustomLibrary: '我的图章',\n stampsCustomLabel: '自定义图章',\n stampsError: '无法加载内置图章。',\n stampsArmError: '无法选用该图章。',\n stampsImportError: '无法将该 PDF 导入为图章库。',\n quickStampsLabel: '快速图章',\n signaturesEmpty: '尚无签名。请创建一个签名用于签署。',\n signaturesNew: '新建签名…',\n signaturesArmedHint: '单击签名字段以签名,或单击页面上的任意位置放置签名标记。',\n signaturesTargetHint: '为所选字段选择一个签名标记。',\n signaturesInDocument: '此文档中',\n signaturesNone: '此文档没有签名字段。',\n signaturesValidate: '验证',\n signaturesValidating: '正在验证…',\n signaturesSigned: '已签名',\n signaturesUnsigned: '未签名',\n signaturesRename: '重命名',\n signaturesRemove: '删除',\n signaturesExport: '导出为 PDF',\n signaturesAddInitials: '添加姓名缩写',\n signatureLabel: '签名',\n initialsLabel: '姓名缩写',\n makerTitle: '新建签名',\n makerName: '姓名',\n makerNamePlaceholder: '您的姓名',\n makerDraw: '绘制',\n makerType: '键入',\n makerUpload: '上传',\n makerTypePlaceholder: '键入您的姓名',\n makerFont: '字体',\n makerUploadHint: '选择 PNG、JPEG 或单页 PDF',\n makerClear: '清除',\n makerOptional: '(可选)',\n makerSave: '保存',\n makerSaving: '正在保存…',\n makerError: '无法保存签名。',\n signTitle: '签署此字段',\n signReason: '原因',\n signLocation: '位置',\n signKind: '签名后允许的更改',\n signKindApproval: '批准签名——填写表单和添加更多签名后仍然有效',\n signKindCertifyAnnotate: '认证——允许注释、填写表单和签名',\n signKindCertifyFill: '认证——仅允许填写表单和签名',\n signKindCertifyLocked: '认证——不允许任何更改',\n signButton: '签名',\n signSigning: '正在签名…',\n signFill: '放置但不签名',\n signError: '无法签署该字段。',\n inspectTitle: '签名',\n inspectSigner: '签名者',\n inspectReason: '原因',\n inspectLocation: '位置',\n inspectTime: '时间',\n inspectIntegrity: '文档',\n inspectCryptography: '签名',\n inspectTrust: '签名者',\n inspectChanges: '此后的更改',\n inspectDownload: '下载已签名版本',\n verdictValid: '有效',\n verdictValidUntrusted: '有效,签名者不受信任',\n verdictInvalid: '无效——签名后已被修改',\n verdictWillInvalidate: '有效,保存后将失效',\n signaturesInvalidating: '保存文档时,此更改将使 {field} 失效。撤销此更改可保留该签名。',\n verdictIndeterminate: '无法验证',\n verdictUnchanged: '无',\n verdictRestored: '已更改,后又恢复',\n inspectLaterRevisions: '签名后的修订版本',\n verdictPermitted: '允许',\n verdictForbidden: '不允许',\n },\n },\n};\n"],"mappings":";;;;;AAMA,MAAa,OAAe;CAC1B,MAAM;CACN,MAAM;CACN,cAAc;EACZ,aAAa;GACX,OAAO;GACP,UAAU;GACV,WAAW;GACX,MAAM;GACN,UAAU;GACV,YAAY;GACZ,WAAW;GACX,OAAO;GACP,QAAQ;GACR,aAAa;GACb,cACE;GACF,aAAa;GACb,UAAU;GACV,aAAa;GACb,QAAQ;GACR,cAAc;GACd,MAAM;GACN,WAAW;GACX,WAAW;GACX,QAAQ;GACR,aAAa;GACb,QAAQ;GACR,OAAO;GACP,UAAU;EACZ;EACA,UAAU;GACR,MAAM;IACJ,IAAI;IACJ,KAAK;IACL,SAAS;IACT,UAAU;IACV,WAAW;IACX,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;GACR;GACA,KAAK;GACL,SAAS;GACT,SAAS;GACT,OAAO;GACP,MAAM;GACN,cAAc;GACd,MAAM;GAC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