pptx-vanilla-viewer 3.8.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,142 @@ A release listed with no entries carried no Conventional Commit in this package'
7
7
  scope: scripts/release-plan.mjs re-releases a package whenever any of its files
8
8
  change, not only on conventional ones.
9
9
 
10
+ ## [3.9.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.9.0) - 2026-09-25
11
+
12
+ ### Features
13
+
14
+ - **shared:** Draw horizontal 3D bars without right-angle axes on the perspective box (by @claude) ([e0c1aad](https://github.com/ChristopherVR/pptx-viewer/commit/e0c1aad3797be9fe75e2b02cd225d19106d38eb0))
15
+ - **shared:** Draw right-angle-axes 3D line, area and surface charts obliquely (by @claude) ([e74306a](https://github.com/ChristopherVR/pptx-viewer/commit/e74306a1a2cf6a69cd3f9672c560cc80550cff16))
16
+ - **core:** Write the slide master's placeholders and theme into .ppt (by @ChristopherVR) ([95b2e26](https://github.com/ChristopherVR/pptx-viewer/commit/95b2e26e31a5f8a5da931394f19b460c38177981))
17
+ - **shared:** Ribbon group/control ids and the style gallery framework (by @ChristopherVR) ([adda887](https://github.com/ChristopherVR/pptx-viewer/commit/adda8870353bdb2f476ff63532fe8c726f9cab50))
18
+ - **locales:** Translate the ribbon gallery and contextual tab strings (by @ChristopherVR) ([dad9566](https://github.com/ChristopherVR/pptx-viewer/commit/dad95669edd0a8298f8b4f5a6c685e785312cdc1))
19
+ - **core:** Keep a text reflection's end position and direction (by @ChristopherVR) ([afb807d](https://github.com/ChristopherVR/pptx-viewer/commit/afb807d81d18c017367d1af5bd01ddf5bb9a036e))
20
+ - **shared:** Fill the ribbon style galleries (by @ChristopherVR) ([2a743b9](https://github.com/ChristopherVR/pptx-viewer/commit/2a743b97996e32f2cef891329c9ea86b070e2a0f))
21
+ - **locales:** Translate the table, chart, SmartArt and theme gallery names (by @ChristopherVR) ([a80c0a8](https://github.com/ChristopherVR/pptx-viewer/commit/a80c0a875ab180f7804fd08fa1f7e9be71ac15a4))
22
+ - **vanilla:** Ribbon style galleries, contextual tabs and group customisation (by @ChristopherVR) ([5a9a9da](https://github.com/ChristopherVR/pptx-viewer/commit/5a9a9da9859e24e083924cee7e1926835cce22af))
23
+ - **locales:** Translate the Shape Effects, WordArt and list gallery tiles (by @ChristopherVR) ([7b665fe](https://github.com/ChristopherVR/pptx-viewer/commit/7b665fed8d6bfca94ab43721aaab597509f9c9f2))
24
+ - **shared:** Picture Styles gallery with PowerPoint's 28 styles (by @ChristopherVR) ([2d56881](https://github.com/ChristopherVR/pptx-viewer/commit/2d56881a23e1a49b631e8554d42a2bdc9366f527))
25
+ - **locales:** Translate the Picture Styles gallery names (by @ChristopherVR) ([0e1eab2](https://github.com/ChristopherVR/pptx-viewer/commit/0e1eab2bd66ed087cc71f75f66506b99cbc17d79))
26
+ - **shared:** Find the gallery theme preset a deck's theme matches (by @ChristopherVR) ([15d0e41](https://github.com/ChristopherVR/pptx-viewer/commit/15d0e41ad8b560325e366dbc36aa4303af2d9e36))
27
+ - **shared:** Play entrances and exits from the deck's behaviour tree (by @ChristopherVR) ([18c512e](https://github.com/ChristopherVR/pptx-viewer/commit/18c512ecf11aeaa19140124f2c85c66f525af010))
28
+ - **shared:** Offer only the directions PowerPoint has for a preset (by @ChristopherVR) ([999208d](https://github.com/ChristopherVR/pptx-viewer/commit/999208d9906bd26b6b7d1d36ce143acaf6630957))
29
+ - **shared:** Preview entrances and exits with PowerPoint's own tree (by @ChristopherVR) ([b3cc6c6](https://github.com/ChristopherVR/pptx-viewer/commit/b3cc6c67383c236c3d9ed386a20f8c7e478bd2a5))
30
+ - **vanilla:** Offer PowerPoint's directions for each preset (by @ChristopherVR) ([617c304](https://github.com/ChristopherVR/pptx-viewer/commit/617c304018759a5b49b018b044eb8d61cca9e6a9))
31
+
32
+ ### Bug Fixes
33
+
34
+ - **shared:** Break East Asian text across runs like PowerPoint (by @ChristopherVR) ([56ea24e](https://github.com/ChristopherVR/pptx-viewer/commit/56ea24eb3afb76a32689ee917f3ccb2759d8039f))
35
+ - **shared:** Size data-label boxes from the measured text (by @ChristopherVR) ([328d0f0](https://github.com/ChristopherVR/pptx-viewer/commit/328d0f074b794a4a0e4c58815c7b4ccf3d9dce99))
36
+ - **shared:** Place bestFit pie labels where PowerPoint does (by @ChristopherVR) ([63e1dc3](https://github.com/ChristopherVR/pptx-viewer/commit/63e1dc35dbddc50fe2cf9337e55b4bdff0df1be7))
37
+ - **core:** Keep paragraph markup on a rewritten slide (by @ChristopherVR) ([ff79c00](https://github.com/ChristopherVR/pptx-viewer/commit/ff79c002df8e79eb4f9967c0261b7259fee44223))
38
+ - **core:** Recompute Words and Paragraphs in docProps/app.xml on save (by @ChristopherVR) ([85ef0d6](https://github.com/ChristopherVR/pptx-viewer/commit/85ef0d6c9879670b8fb85b3c072c8105397d3d55))
39
+ - **core:** Write .ppt group members the way PowerPoint reads them (by @ChristopherVR) ([8cf3852](https://github.com/ChristopherVR/pptx-viewer/commit/8cf3852a1cde14e089dbdbca8fcba50005c982c2))
40
+ - **core:** Write DIFAT sectors for compound files past 109 FAT sectors (by @ChristopherVR) ([9e26fe8](https://github.com/ChristopherVR/pptx-viewer/commit/9e26fe8775a14d7e3ae2b69fbc982167a76cadf3))
41
+ - **core:** Write a new p:style between spPr and txBody (by @ChristopherVR) ([c7a45b9](https://github.com/ChristopherVR/pptx-viewer/commit/c7a45b9c077c94355d62a2e1e6196d1c33598458))
42
+ - **shared:** Write Shape Styles presets with PowerPoint's zero references (by @ChristopherVR) ([fdea69d](https://github.com/ChristopherVR/pptx-viewer/commit/fdea69d93436881bf7038e1b32792d7fe8b87e89))
43
+ - **shared:** Name every Shape Effects, WordArt and list gallery tile (by @ChristopherVR) ([0e16dae](https://github.com/ChristopherVR/pptx-viewer/commit/0e16dae2cf34c1c611746b8ad1b4eaa2cd806d85))
44
+ - **vanilla:** Browse Themes and Edit Theme change the presentation theme (by @ChristopherVR) ([d17caab](https://github.com/ChristopherVR/pptx-viewer/commit/d17caabe2879f026b8896b4afcc5b60b64e25d56))
45
+ - **vanilla:** Mount gallery popups and contextual panes only while shown (by @ChristopherVR) ([4a288ab](https://github.com/ChristopherVR/pptx-viewer/commit/4a288abe49c13cd6c9c5ebd9989368fe68483a48))
46
+ - **shared:** Stop 3D SmartArt and charts rotating while dragged (by @claude) ([1f4e09e](https://github.com/ChristopherVR/pptx-viewer/commit/1f4e09e3c797acf365cb4d34aaa9b5a9e72ed157))
47
+ - **core:** Parse every behaviour of an effect with its own timing (by @ChristopherVR) ([12ea267](https://github.com/ChristopherVR/pptx-viewer/commit/12ea26750633b1315e8b05cc78386fcc5c289151))
48
+ - **core:** Rebuild an edited effect's behaviour tree on save (by @ChristopherVR) ([d6e22c7](https://github.com/ChristopherVR/pptx-viewer/commit/d6e22c70e67126d38f7880de658b3258db3c66ad))
49
+ - **shared:** Reveal wipes, splits and mask reveals the way PowerPoint does (by @ChristopherVR) ([87ff378](https://github.com/ChristopherVR/pptx-viewer/commit/87ff378d591a3caf0d78a0b6f18d6312319fe559))
50
+
51
+ ### Documentation
52
+
53
+ - Drop orbit wording from 3D view and chart flag docs (by @claude) ([a1fa63d](https://github.com/ChristopherVR/pptx-viewer/commit/a1fa63d34f0c61a16f10c1e2c3c53f178dcec947))
54
+
55
+ ### Testing
56
+
57
+ - **e2e:** Pin East Asian breaks to PowerPoint's own lines (by @ChristopherVR) ([a358b4f](https://github.com/ChristopherVR/pptx-viewer/commit/a358b4fdd5beeccdf81be9eb50166138430e292d))
58
+ - **e2e:** Pin pie bestFit labels and label boxes to PowerPoint (by @ChristopherVR) ([3480d42](https://github.com/ChristopherVR/pptx-viewer/commit/3480d429183f8b44ae8427a17f6823fb596aceb7))
59
+ - **e2e:** Pick a Picture Styles tile from Picture Format in every binding (by @ChristopherVR) ([27c37ad](https://github.com/ChristopherVR/pptx-viewer/commit/27c37adffae73f7901af3230cc0aa127c8012277))
60
+ - **e2e:** Pin behaviour-tree playback and PowerPoint's wipe edge (by @ChristopherVR) ([4cbb061](https://github.com/ChristopherVR/pptx-viewer/commit/4cbb061eaca3042229cd601b4cacffa8d97f076e))
61
+ - **vanilla:** Give full-viewer unit tests a 30s timeout like core and svelte (by @ChristopherVR) ([179ec80](https://github.com/ChristopherVR/pptx-viewer/commit/179ec8039096f8c607e35d4b29a1479b9b6e1926))
62
+
63
+ ### Styling
64
+
65
+ - **shared:** Clear the lint warnings in the ribbon gallery modules (by @ChristopherVR) ([f178627](https://github.com/ChristopherVR/pptx-viewer/commit/f1786274cfe55be4189724b10e3e2b3c8c1e75f2))
66
+
67
+ ### Chores
68
+
69
+ - **npm:** Surface every package in an npm search for pptx-viewer (by @ChristopherVR) ([ac67fda](https://github.com/ChristopherVR/pptx-viewer/commit/ac67fdafcfaf664412f59eee9a0627182340782f))
70
+
71
+ ## [3.8.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.8.0) - 2026-09-25
72
+
73
+ ### Features
74
+
75
+ - **core:** Resolve p:style references on demand for style galleries (by @ChristopherVR) ([e4303f7](https://github.com/ChristopherVR/pptx-viewer/commit/e4303f74a42c745929e9c4296f34686124c10bf9))
76
+ - **core:** Size smartart engine nodes from their own text (by @ChristopherVR) ([34c33cb](https://github.com/ChristopherVR/pptx-viewer/commit/34c33cbb48f225cda606a397f19b31ac841b82e2))
77
+ - **core:** Lay org-chart assistants out in the smartart engine (by @ChristopherVR) ([722a465](https://github.com/ChristopherVR/pptx-viewer/commit/722a465d5225e6d96bdae5cc3a4570c843e89c7b))
78
+ - **core:** Fit meet the team and process list grids in the smartart engine (by @ChristopherVR) ([6ee431c](https://github.com/ChristopherVR/pptx-viewer/commit/6ee431c4f1b3af4469c8824c02a7a5ec1be0abed))
79
+ - **core:** Keep c:grouping standard distinct from clustered (by @claude) ([c3472e2](https://github.com/ChristopherVR/pptx-viewer/commit/c3472e2cbf2bec39d8f8bbbcae2ec59084acc41f))
80
+ - **shared:** Lay out right-angle-axes 3D bar charts as PowerPoint does (by @claude) ([0985f9d](https://github.com/ChristopherVR/pptx-viewer/commit/0985f9d36253eabcc681115cfbb07c6253fcb868))
81
+ - **shared:** Draw cylinder, cone and pyramid 3D bars as PowerPoint does (by @claude) ([668aa8d](https://github.com/ChristopherVR/pptx-viewer/commit/668aa8d3446d3a6b5f72f421bf01e00affdaf00e))
82
+ - **shared:** Draw perspective 3D line and area charts as PowerPoint does (by @claude) ([0ab4a7d](https://github.com/ChristopherVR/pptx-viewer/commit/0ab4a7da69f3993a74a24b0c804685681fd707f2))
83
+ - **shared:** Draw 3D surface charts in value bands as PowerPoint does (by @claude) ([cc87ef4](https://github.com/ChristopherVR/pptx-viewer/commit/cc87ef4cba6574f6aee68dc5178b25c46082d1cf))
84
+ - **shared:** Draw 3D pie charts as PowerPoint does (by @claude) ([553a935](https://github.com/ChristopherVR/pptx-viewer/commit/553a935c2257b7ef0280dbd82abcbf22a1d790a5))
85
+ - **core:** Write SmartArt drawing-shape 3D properties back on save (by @claude) ([45ec2db](https://github.com/ChristopherVR/pptx-viewer/commit/45ec2db46147c9a022e2bdc9ba1e1e5c64f4d94f))
86
+ - **shared:** Render SmartArt bevel and scene quick styles in 3D (by @claude) ([3bdf7e9](https://github.com/ChristopherVR/pptx-viewer/commit/3bdf7e959fed36302350bcbfd2c664d07b0cad86))
87
+ - **shared:** Draw 3D columns without right-angle axes on the perspective box (by @claude) ([e65a8c9](https://github.com/ChristopherVR/pptx-viewer/commit/e65a8c9dba2bcb21ccd81fb471a7b2c019b40d51))
88
+ - **core:** Keep smartart quick-style 3d across structural edits (by @claude) ([a815448](https://github.com/ChristopherVR/pptx-viewer/commit/a815448a7ce291f1989fd3306df523670a2d3d1a))
89
+ - **shared:** Render structurally edited smartart with its quick-style 3d (by @claude) ([2c31bed](https://github.com/ChristopherVR/pptx-viewer/commit/2c31bede6f30886fe1f5f78cb55ad59492485838))
90
+ - **core:** Read SmartArt label colour from fontRef and keep fill alpha (by @claude) ([866c7ee](https://github.com/ChristopherVR/pptx-viewer/commit/866c7ee9227ecbc58f0ab8b691513dc072824c1f))
91
+ - **shared:** Light, extrude and fade SmartArt 3D scenes as PowerPoint does (by @claude) ([b6864d8](https://github.com/ChristopherVR/pptx-viewer/commit/b6864d8d9ca181e953d6cdd389629052f6712d5b))
92
+ - **shared:** Draw a turned SmartArt diagram past its element box (by @claude) ([f46c9b7](https://github.com/ChristopherVR/pptx-viewer/commit/f46c9b7af800e213ee0d7f29cca61d9b2a29c0c4))
93
+ - **core:** Rasterise fallback-less svg pictures for .ppt export in node (by @ChristopherVR) ([b2f86e8](https://github.com/ChristopherVR/pptx-viewer/commit/b2f86e8a675c899778275c163d1fd974df31f3ea))
94
+
95
+ ### Bug Fixes
96
+
97
+ - **shared:** Hang CJK punctuation and drop kinsoku like PowerPoint (by @ChristopherVR) ([770b708](https://github.com/ChristopherVR/pptx-viewer/commit/770b7081432d08acfa00a17de9bc83da22efc18b))
98
+ - **shared:** Draw data-label callouts on line, area, pie, xy and radar (by @ChristopherVR) ([a60aa17](https://github.com/ChristopherVR/pptx-viewer/commit/a60aa17d713848297264ffdd27e89ba9192321ed))
99
+ - **core:** Author the strips exit at presetID 18 (by @ChristopherVR) ([eb1daca](https://github.com/ChristopherVR/pptx-viewer/commit/eb1daca918d26168e07e52e8eb6e421d1af58bfe))
100
+ - **shared:** Play strips as a diagonal corner-to-corner sweep (by @ChristopherVR) ([1e15f73](https://github.com/ChristopherVR/pptx-viewer/commit/1e15f73c5624b0578ea4f1125ea573dfbc1bab73))
101
+ - **shared:** Play wedge as two sweeping wedges and circle exit as an iris (by @ChristopherVR) ([c7fe573](https://github.com/ChristopherVR/pptx-viewer/commit/c7fe5738e03c7b02efaead29621c743e071ecb1e))
102
+ - **shared:** Play the slide filter through a window, cover/push as a cut (by @ChristopherVR) ([a252b87](https://github.com/ChristopherVR/pptx-viewer/commit/a252b8753c2743eb9f91ca1f5b2f4ace86b5cac3))
103
+ - **shared:** Restore arc-length glyph placement for wordart envelopes (by @ChristopherVR) ([4264ab0](https://github.com/ChristopherVR/pptx-viewer/commit/4264ab0917b91f7bd6a7cf278d334135bec27883))
104
+ - **core:** Embed every picture format in the .ppt export (by @ChristopherVR) ([956f1dc](https://github.com/ChristopherVR/pptx-viewer/commit/956f1dc065eabb6977ee6581261662bd38b88162))
105
+ - **core:** Write placeholder text and master text styles in .ppt export (by @ChristopherVR) ([81681c8](https://github.com/ChristopherVR/pptx-viewer/commit/81681c8e52fec68f2d039bd3473023eb76d4a5cd))
106
+ - **core:** Keep an authored pPr lvl="0" on a rewritten slide (by @ChristopherVR) ([97a8cff](https://github.com/ChristopherVR/pptx-viewer/commit/97a8cff45834f963644067aac5bd4a5d2ae0a440))
107
+ - **core:** Stop the first run's b and err leaking onto later runs (by @ChristopherVR) ([4738cd4](https://github.com/ChristopherVR/pptx-viewer/commit/4738cd43c77aadee833d7ab41e071ab7506c3157))
108
+ - **core:** Do not invent an outline width on a rewritten slide (by @ChristopherVR) ([089362a](https://github.com/ChristopherVR/pptx-viewer/commit/089362ac0746031ea28d0bd1ac92bcce093eb4bd))
109
+ - **core:** Refresh app.xml notes and untitled titles like PowerPoint (by @ChristopherVR) ([52a8a53](https://github.com/ChristopherVR/pptx-viewer/commit/52a8a5395de8497553f8aceb9aa980b0bf25d838))
110
+ - **core:** Write each ruby run property set back as authored (by @ChristopherVR) ([94e7b76](https://github.com/ChristopherVR/pptx-viewer/commit/94e7b7656c32642a47748f6ad95c00955cb3fddb))
111
+ - **shared:** Composite pptx-three-view frames as premultiplied alpha (by @claude) ([074fd9e](https://github.com/ChristopherVR/pptx-viewer/commit/074fd9edf2df8d32e9b54327e53fb27b489c4267))
112
+ - **shared:** Size the chart title band from the title font (by @claude) ([c5f0254](https://github.com/ChristopherVR/pptx-viewer/commit/c5f0254036f578f80ab25ed68e250f0d34984523))
113
+ - **shared:** One html2canvas clone pass that snapshots 3D views (by @claude) ([56a8a81](https://github.com/ChristopherVR/pptx-viewer/commit/56a8a81a53ffb2bd9cd8863d6c2cb8d703104804))
114
+ - **react,vue,angular,svelte,vanilla:** Use the shared html2canvas clone pass (by @claude) ([ca9f608](https://github.com/ChristopherVR/pptx-viewer/commit/ca9f6089ed304dcc71abe216b984c41237cefbfb))
115
+ - **shared:** Read SmartArt label contrast from a gradient fill (by @claude) ([d43c866](https://github.com/ChristopherVR/pptx-viewer/commit/d43c866ec2eeb655d02dc586c546c02c93877558))
116
+ - **shared:** Fit the perspective 3D chart box to PowerPoint's height and centring (by @claude) ([157008a](https://github.com/ChristopherVR/pptx-viewer/commit/157008a988c95edba606c6bab5c11308967d0785))
117
+ - **shared:** Size standard-grouping 3D columns as PowerPoint does (by @claude) ([907223f](https://github.com/ChristopherVR/pptx-viewer/commit/907223f735c83b65afd42d5147848f8a28839e1c))
118
+ - **shared:** Shade exploded 3D pie cut faces as PowerPoint does (by @claude) ([5ad3905](https://github.com/ChristopherVR/pptx-viewer/commit/5ad3905503872041e5afc7da528cad0cae354a96))
119
+ - **core:** Follow ecma-376 for the trapezoid preset inset (by @claude) ([eca6c9f](https://github.com/ChristopherVR/pptx-viewer/commit/eca6c9f739a9d6a46d410801ba9bcb0a685f58da))
120
+ - **core:** Keep smartart drawing fill alpha and preset adjustments (by @claude) ([d8d2f37](https://github.com/ChristopherVR/pptx-viewer/commit/d8d2f37b85937e125021afc17b9245148edf9186))
121
+ - **shared:** Paint smartart drawing fill alpha in 2d and 3d (by @claude) ([070cda5](https://github.com/ChristopherVR/pptx-viewer/commit/070cda5a4927c68ea9352c6e7d40e6526d5080fe))
122
+ - **vanilla:** Bind smartart drawing fill-opacity (by @claude) ([7e681a0](https://github.com/ChristopherVR/pptx-viewer/commit/7e681a0d09301102810366af80812fe950722e0a))
123
+ - **core:** Drop the old preset's guides when a shape's geometry changes (by @ChristopherVR) ([118d8a0](https://github.com/ChristopherVR/pptx-viewer/commit/118d8a0651c18b4e5585286628946818f9c241c5))
124
+ - **core:** Relabel entrance/exit presets from PowerPoint COM ids (by @ChristopherVR) ([ade27dc](https://github.com/ChristopherVR/pptx-viewer/commit/ade27dce6d771ea7dee6068ae7da0a7aa067b6cf))
125
+ - **core:** Write PowerPoint's captured behaviour tree for every preset (by @ChristopherVR) ([b9fa2d6](https://github.com/ChristopherVR/pptx-viewer/commit/b9fa2d68f90c646ccd9abdc1584a78b5e3c2c39b))
126
+ - **shared:** Play steps without accel/decel linearly like PowerPoint (by @ChristopherVR) ([5c1158b](https://github.com/ChristopherVR/pptx-viewer/commit/5c1158b2240c96a234a312ea56aa07404b330fcc))
127
+ - **animation:** Ripple letters inside a by-paragraph text build (by @ChristopherVR) ([1676539](https://github.com/ChristopherVR/pptx-viewer/commit/16765398bd7e0d6966ee59c9cb97d0936bafcc80))
128
+ - **core:** Open PowerPoint's own password-protected .ppt files (by @ChristopherVR) ([ca38faa](https://github.com/ChristopherVR/pptx-viewer/commit/ca38faae35c761b0a3ae98ca79084251641026dc))
129
+ - **core:** Keep the node canvas import opaque to browser bundlers (by @ChristopherVR) ([22f61ea](https://github.com/ChristopherVR/pptx-viewer/commit/22f61ea3f6811d3c82530593eccad0afd957c0f1))
130
+
131
+ ### Documentation
132
+
133
+ - **core:** Record the eleventh smartart engine wave's measured numbers (by @ChristopherVR) ([8395cb8](https://github.com/ChristopherVR/pptx-viewer/commit/8395cb847ff5984c47908b270193622373e30fe0))
134
+
135
+ ### Testing
136
+
137
+ - **core:** Declare the new callout, CJK and org-chart assistant fixtures (by @ChristopherVR) ([1ff7f05](https://github.com/ChristopherVR/pptx-viewer/commit/1ff7f05d254f151a42005a0e4591897e7c508889))
138
+ - **core:** Lock the ECMA-376 trapezoid inset against the short side (by @claude) ([26462a0](https://github.com/ChristopherVR/pptx-viewer/commit/26462a034bb4752497244ff42e787af60f24406d))
139
+ - **core:** Declare the by-paragraph letter ripple fixture (by @ChristopherVR) ([532a448](https://github.com/ChristopherVR/pptx-viewer/commit/532a448c1b952051c5926e0ad25ef2d534a45818))
140
+ - **core:** Pin the browser canvas ahead of the node svg rasteriser (by @ChristopherVR) ([8ae3fed](https://github.com/ChristopherVR/pptx-viewer/commit/8ae3fedd58b236b77dc56533010683b9cd91a7a2))
141
+
142
+ ### Build & CI
143
+
144
+ - **react,vanilla:** Keep the optional node canvas peer external (by @ChristopherVR) ([6b0ae09](https://github.com/ChristopherVR/pptx-viewer/commit/6b0ae09448bab9ece71448ca50dfc969a7c72a02))
145
+
10
146
  ## [3.7.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.7.0) - 2026-09-25
11
147
 
12
148
  ### Features
@@ -1 +1 @@
1
- import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-LLTNOSPY.js';import'./chunk-DXLLCHZP.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};
1
+ import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-Q3ZPPYHW.js';import'./chunk-ZV4XD6NU.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};
@@ -1 +1 @@
1
- 'use strict';var chunkBAZT6KJZ_cjs=require('./chunk-BAZT6KJZ.cjs');require('./chunk-Q4GMEOAI.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkBAZT6KJZ_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkBAZT6KJZ_cjs.j(p,o.getSlides())){let b=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkBAZT6KJZ_cjs.k(p,o.getSlides());if(d){let r=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkBAZT6KJZ_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkBAZT6KJZ_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkBAZT6KJZ_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkBAZT6KJZ_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkBAZT6KJZ_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkBAZT6KJZ_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkBAZT6KJZ_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunkBAZT6KJZ_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkBAZT6KJZ_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkBAZT6KJZ_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkBAZT6KJZ_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunkBAZT6KJZ_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunkBAZT6KJZ_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-tool"),p=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkBAZT6KJZ_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkBAZT6KJZ_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkBAZT6KJZ_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkBAZT6KJZ_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkBAZT6KJZ_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkBAZT6KJZ_cjs.r(t.input);if(g){let f=chunkBAZT6KJZ_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkBAZT6KJZ_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkBAZT6KJZ_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunkBAZT6KJZ_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkBAZT6KJZ_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkBAZT6KJZ_cjs.K(o,h?"comment":"sparkles"));let m=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkBAZT6KJZ_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunkBAZT6KJZ_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkBAZT6KJZ_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkBAZT6KJZ_cjs.w(o,"li");g.textContent=chunkBAZT6KJZ_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkBAZT6KJZ_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkBAZT6KJZ_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkBAZT6KJZ_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkBAZT6KJZ_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkBAZT6KJZ_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-header"),h=chunkBAZT6KJZ_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunkBAZT6KJZ_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkBAZT6KJZ_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkBAZT6KJZ_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkBAZT6KJZ_cjs.w(t,"form","pptxv-ai-composer"),d=chunkBAZT6KJZ_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunkBAZT6KJZ_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkBAZT6KJZ_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkBAZT6KJZ_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunkBAZT6KJZ_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunkBAZT6KJZ_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunkBAZT6KJZ_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
1
+ 'use strict';var chunkQPYQDJ2Q_cjs=require('./chunk-QPYQDJ2Q.cjs');require('./chunk-YOEVEUFZ.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkQPYQDJ2Q_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkQPYQDJ2Q_cjs.j(p,o.getSlides())){let b=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkQPYQDJ2Q_cjs.k(p,o.getSlides());if(d){let r=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkQPYQDJ2Q_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkQPYQDJ2Q_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkQPYQDJ2Q_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkQPYQDJ2Q_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkQPYQDJ2Q_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkQPYQDJ2Q_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkQPYQDJ2Q_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunkQPYQDJ2Q_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkQPYQDJ2Q_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkQPYQDJ2Q_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkQPYQDJ2Q_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunkQPYQDJ2Q_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunkQPYQDJ2Q_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-tool"),p=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkQPYQDJ2Q_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkQPYQDJ2Q_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkQPYQDJ2Q_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkQPYQDJ2Q_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkQPYQDJ2Q_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkQPYQDJ2Q_cjs.r(t.input);if(g){let f=chunkQPYQDJ2Q_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkQPYQDJ2Q_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkQPYQDJ2Q_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunkQPYQDJ2Q_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkQPYQDJ2Q_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkQPYQDJ2Q_cjs.K(o,h?"comment":"sparkles"));let m=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkQPYQDJ2Q_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunkQPYQDJ2Q_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkQPYQDJ2Q_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkQPYQDJ2Q_cjs.w(o,"li");g.textContent=chunkQPYQDJ2Q_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkQPYQDJ2Q_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkQPYQDJ2Q_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkQPYQDJ2Q_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkQPYQDJ2Q_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkQPYQDJ2Q_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-header"),h=chunkQPYQDJ2Q_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunkQPYQDJ2Q_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkQPYQDJ2Q_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkQPYQDJ2Q_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkQPYQDJ2Q_cjs.w(t,"form","pptxv-ai-composer"),d=chunkQPYQDJ2Q_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunkQPYQDJ2Q_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkQPYQDJ2Q_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkQPYQDJ2Q_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunkQPYQDJ2Q_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunkQPYQDJ2Q_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunkQPYQDJ2Q_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
@@ -1,4 +1,4 @@
1
- import {Ec,bi,zm,ei,fi,$h,Hg,Gg,Ig,Et,Ed,Eg,Fg}from'./chunk-DXLLCHZP.js';var R="data-pptx-text-style-override";function z(n,i,r){Et(n,r?.textStyle);let a=Ed(i,r?.textStyle),e=n.querySelector(`:scope > style[${R}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(R,""),n.prepend(e)),e.textContent=a;}var w="pptx-vanilla-presentation-keyframes",k="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(w))return;let i=n.createElement("style");i.id=w,i.textContent=`${Ec}
2
- ${bi}
3
- ${zm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(k);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=k,(n.head??n.documentElement).appendChild(r)),r.textContent=i;}function X(n,i,r,a){n.querySelectorAll("[data-element-id]").forEach(e=>{let t=e.dataset.elementId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"",e.style.cursor=r.has(t)||a.has(t)?"pointer":"",z(e,t,o);}),n.querySelectorAll("[data-anim-id]").forEach(e=>{let t=e.dataset.animId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"";});}function M(n,i,r,a,e){let t=n.createElement("div");t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.dataset.pptxTransitionFragments=r.keyframesName,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex=String(a);for(let o of r.fragments)t.appendChild(B(n,i,r,o));return t}function B(n,i,r,a){let e=n.createElement("div");e.dataset.pptxTransitionFragment=a.id,e.style.position="absolute",e.style.inset="0",e.style.clipPath=a.clipPath,e.style.transformOrigin=a.transformOrigin,e.style.animationName=r.keyframesName,e.style.animationDuration=`${r.durationMs}ms`,e.style.animationTimingFunction=r.easing,e.style.animationDelay=`${a.delayMs}ms`,e.style.animationFillMode="forwards",e.style.willChange="transform, opacity";for(let[t,o]of Object.entries(a.vars))e.style.setProperty(t,o);return e.appendChild(i.cloneNode(true)),e}function u(n,i,r,a,e){let t=n.createElement("div");return t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.zIndex=String(r),t.style.willChange="transform, opacity, clip-path, filter",a!=="none"&&(t.style.animation=a),t.appendChild(i),t}function T(n,i){n.style.background="none",n.style.backgroundColor="transparent";let r=new Set(i),a=new Set;for(let e of n.querySelectorAll("[data-element-id]")){let t=e.dataset.elementId;if(!(t===void 0||!r.has(t))){for(let o=e;o&&o!==n;)a.add(o),o=o.parentElement;for(let o of e.querySelectorAll("[data-element-id]"))a.add(o);}}for(let e of [...n.querySelectorAll("[data-element-id]")])a.has(e)||e.remove();return n}function q(n,i,r,a){return (a?.crossfadeGroups??[]).map((e,t)=>{let o=n.createElement("div");o.dataset.pptxMorphCrossfade=e.incoming.id,o.style.cssText=Eg,o.style.zIndex=String(4+t);let m=(p,l,s,y,g)=>{let d=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?d.dataset.pptxMorphOutgoing="true":d.dataset.pptxMorphLifted="true",d.style.mixBlendMode=Fg,d};return o.append(m(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),m(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function se(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=ei(t),m=fi(t),p=$h(t.type,m,t.direction,t.spokes,t.pattern),l=i.createElement("div");l.className="pptxv-transition-overlay",l.dataset.pptxTransitionOverlay="",l.dataset.pptxTransitionOverlay="",l.style.position="absolute",l.style.inset="0",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="30";let s=t.type==="morph"?Hg(n.outgoingSlide,n.incomingSlide,m,Gg(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,d=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),x=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),S=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=S?u(i,S,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){x.dataset.pptxMorphIncoming="true",d.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[Ig(s,"data-pptx-morph-incoming","incoming"),Ig(s,"data-pptx-morph-outgoing","outgoing"),Ig(s,"data-pptx-morph-lifted","lifted")].join(`
1
+ import {Fc,di,Bm,gi,hi,bi,Jg,Ig,Kg,Zt,Gd,Gg,Hg}from'./chunk-ZV4XD6NU.js';var R="data-pptx-text-style-override";function z(n,i,r){Zt(n,r?.textStyle);let a=Gd(i,r?.textStyle),e=n.querySelector(`:scope > style[${R}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(R,""),n.prepend(e)),e.textContent=a;}var w="pptx-vanilla-presentation-keyframes",k="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(w))return;let i=n.createElement("style");i.id=w,i.textContent=`${Fc}
2
+ ${di}
3
+ ${Bm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(k);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=k,(n.head??n.documentElement).appendChild(r)),r.textContent=i;}function X(n,i,r,a){n.querySelectorAll("[data-element-id]").forEach(e=>{let t=e.dataset.elementId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"",e.style.cursor=r.has(t)||a.has(t)?"pointer":"",z(e,t,o);}),n.querySelectorAll("[data-anim-id]").forEach(e=>{let t=e.dataset.animId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"";});}function M(n,i,r,a,e){let t=n.createElement("div");t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.dataset.pptxTransitionFragments=r.keyframesName,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex=String(a);for(let o of r.fragments)t.appendChild(B(n,i,r,o));return t}function B(n,i,r,a){let e=n.createElement("div");e.dataset.pptxTransitionFragment=a.id,e.style.position="absolute",e.style.inset="0",e.style.clipPath=a.clipPath,e.style.transformOrigin=a.transformOrigin,e.style.animationName=r.keyframesName,e.style.animationDuration=`${r.durationMs}ms`,e.style.animationTimingFunction=r.easing,e.style.animationDelay=`${a.delayMs}ms`,e.style.animationFillMode="forwards",e.style.willChange="transform, opacity";for(let[t,o]of Object.entries(a.vars))e.style.setProperty(t,o);return e.appendChild(i.cloneNode(true)),e}function u(n,i,r,a,e){let t=n.createElement("div");return t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.zIndex=String(r),t.style.willChange="transform, opacity, clip-path, filter",a!=="none"&&(t.style.animation=a),t.appendChild(i),t}function T(n,i){n.style.background="none",n.style.backgroundColor="transparent";let r=new Set(i),a=new Set;for(let e of n.querySelectorAll("[data-element-id]")){let t=e.dataset.elementId;if(!(t===void 0||!r.has(t))){for(let o=e;o&&o!==n;)a.add(o),o=o.parentElement;for(let o of e.querySelectorAll("[data-element-id]"))a.add(o);}}for(let e of [...n.querySelectorAll("[data-element-id]")])a.has(e)||e.remove();return n}function q(n,i,r,a){return (a?.crossfadeGroups??[]).map((e,t)=>{let o=n.createElement("div");o.dataset.pptxMorphCrossfade=e.incoming.id,o.style.cssText=Gg,o.style.zIndex=String(4+t);let m=(p,l,s,y,g)=>{let d=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?d.dataset.pptxMorphOutgoing="true":d.dataset.pptxMorphLifted="true",d.style.mixBlendMode=Hg,d};return o.append(m(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),m(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function se(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=gi(t),m=hi(t),p=bi(t.type,m,t.direction,t.spokes,t.pattern),l=i.createElement("div");l.className="pptxv-transition-overlay",l.dataset.pptxTransitionOverlay="",l.dataset.pptxTransitionOverlay="",l.style.position="absolute",l.style.inset="0",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="30";let s=t.type==="morph"?Jg(n.outgoingSlide,n.incomingSlide,m,Ig(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,d=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),x=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),S=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=S?u(i,S,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){x.dataset.pptxMorphIncoming="true",d.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[Kg(s,"data-pptx-morph-incoming","incoming"),Kg(s,"data-pptx-morph-outgoing","outgoing"),Kg(s,"data-pptx-morph-lifted","lifted")].join(`
4
4
  `),l.appendChild(c);}l.append(d,x),f&&l.appendChild(f);for(let c of $)l.appendChild(c);r.appendChild(l);let h=false,v=()=>{h||(h=true,clearTimeout(G),l.remove(),n.onDone());},G=setTimeout(v,Math.max(0,m)+50);return v}export{K as a,W as b,X as c,se as d};
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkQ4GMEOAI_cjs=require('./chunk-Q4GMEOAI.cjs');var R="data-pptx-text-style-override";function z(n,i,r){chunkQ4GMEOAI_cjs.Et(n,r?.textStyle);let a=chunkQ4GMEOAI_cjs.Ed(i,r?.textStyle),e=n.querySelector(`:scope > style[${R}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(R,""),n.prepend(e)),e.textContent=a;}var w="pptx-vanilla-presentation-keyframes",k="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(w))return;let i=n.createElement("style");i.id=w,i.textContent=`${chunkQ4GMEOAI_cjs.Ec}
2
- ${chunkQ4GMEOAI_cjs.bi}
3
- ${chunkQ4GMEOAI_cjs.zm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(k);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=k,(n.head??n.documentElement).appendChild(r)),r.textContent=i;}function X(n,i,r,a){n.querySelectorAll("[data-element-id]").forEach(e=>{let t=e.dataset.elementId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"",e.style.cursor=r.has(t)||a.has(t)?"pointer":"",z(e,t,o);}),n.querySelectorAll("[data-anim-id]").forEach(e=>{let t=e.dataset.animId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"";});}function M(n,i,r,a,e){let t=n.createElement("div");t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.dataset.pptxTransitionFragments=r.keyframesName,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex=String(a);for(let o of r.fragments)t.appendChild(B(n,i,r,o));return t}function B(n,i,r,a){let e=n.createElement("div");e.dataset.pptxTransitionFragment=a.id,e.style.position="absolute",e.style.inset="0",e.style.clipPath=a.clipPath,e.style.transformOrigin=a.transformOrigin,e.style.animationName=r.keyframesName,e.style.animationDuration=`${r.durationMs}ms`,e.style.animationTimingFunction=r.easing,e.style.animationDelay=`${a.delayMs}ms`,e.style.animationFillMode="forwards",e.style.willChange="transform, opacity";for(let[t,o]of Object.entries(a.vars))e.style.setProperty(t,o);return e.appendChild(i.cloneNode(true)),e}function u(n,i,r,a,e){let t=n.createElement("div");return t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.zIndex=String(r),t.style.willChange="transform, opacity, clip-path, filter",a!=="none"&&(t.style.animation=a),t.appendChild(i),t}function T(n,i){n.style.background="none",n.style.backgroundColor="transparent";let r=new Set(i),a=new Set;for(let e of n.querySelectorAll("[data-element-id]")){let t=e.dataset.elementId;if(!(t===void 0||!r.has(t))){for(let o=e;o&&o!==n;)a.add(o),o=o.parentElement;for(let o of e.querySelectorAll("[data-element-id]"))a.add(o);}}for(let e of [...n.querySelectorAll("[data-element-id]")])a.has(e)||e.remove();return n}function q(n,i,r,a){return (a?.crossfadeGroups??[]).map((e,t)=>{let o=n.createElement("div");o.dataset.pptxMorphCrossfade=e.incoming.id,o.style.cssText=chunkQ4GMEOAI_cjs.Eg,o.style.zIndex=String(4+t);let m=(p,l,s,y,g)=>{let d=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?d.dataset.pptxMorphOutgoing="true":d.dataset.pptxMorphLifted="true",d.style.mixBlendMode=chunkQ4GMEOAI_cjs.Fg,d};return o.append(m(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),m(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function se(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=chunkQ4GMEOAI_cjs.ei(t),m=chunkQ4GMEOAI_cjs.fi(t),p=chunkQ4GMEOAI_cjs.$h(t.type,m,t.direction,t.spokes,t.pattern),l=i.createElement("div");l.className="pptxv-transition-overlay",l.dataset.pptxTransitionOverlay="",l.dataset.pptxTransitionOverlay="",l.style.position="absolute",l.style.inset="0",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="30";let s=t.type==="morph"?chunkQ4GMEOAI_cjs.Hg(n.outgoingSlide,n.incomingSlide,m,chunkQ4GMEOAI_cjs.Gg(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,d=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),x=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),S=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=S?u(i,S,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){x.dataset.pptxMorphIncoming="true",d.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[chunkQ4GMEOAI_cjs.Ig(s,"data-pptx-morph-incoming","incoming"),chunkQ4GMEOAI_cjs.Ig(s,"data-pptx-morph-outgoing","outgoing"),chunkQ4GMEOAI_cjs.Ig(s,"data-pptx-morph-lifted","lifted")].join(`
1
+ 'use strict';var chunkYOEVEUFZ_cjs=require('./chunk-YOEVEUFZ.cjs');var R="data-pptx-text-style-override";function z(n,i,r){chunkYOEVEUFZ_cjs.Zt(n,r?.textStyle);let a=chunkYOEVEUFZ_cjs.Gd(i,r?.textStyle),e=n.querySelector(`:scope > style[${R}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(R,""),n.prepend(e)),e.textContent=a;}var w="pptx-vanilla-presentation-keyframes",k="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(w))return;let i=n.createElement("style");i.id=w,i.textContent=`${chunkYOEVEUFZ_cjs.Fc}
2
+ ${chunkYOEVEUFZ_cjs.di}
3
+ ${chunkYOEVEUFZ_cjs.Bm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(k);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=k,(n.head??n.documentElement).appendChild(r)),r.textContent=i;}function X(n,i,r,a){n.querySelectorAll("[data-element-id]").forEach(e=>{let t=e.dataset.elementId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"",e.style.cursor=r.has(t)||a.has(t)?"pointer":"",z(e,t,o);}),n.querySelectorAll("[data-anim-id]").forEach(e=>{let t=e.dataset.animId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"";});}function M(n,i,r,a,e){let t=n.createElement("div");t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.dataset.pptxTransitionFragments=r.keyframesName,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex=String(a);for(let o of r.fragments)t.appendChild(B(n,i,r,o));return t}function B(n,i,r,a){let e=n.createElement("div");e.dataset.pptxTransitionFragment=a.id,e.style.position="absolute",e.style.inset="0",e.style.clipPath=a.clipPath,e.style.transformOrigin=a.transformOrigin,e.style.animationName=r.keyframesName,e.style.animationDuration=`${r.durationMs}ms`,e.style.animationTimingFunction=r.easing,e.style.animationDelay=`${a.delayMs}ms`,e.style.animationFillMode="forwards",e.style.willChange="transform, opacity";for(let[t,o]of Object.entries(a.vars))e.style.setProperty(t,o);return e.appendChild(i.cloneNode(true)),e}function u(n,i,r,a,e){let t=n.createElement("div");return t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.zIndex=String(r),t.style.willChange="transform, opacity, clip-path, filter",a!=="none"&&(t.style.animation=a),t.appendChild(i),t}function T(n,i){n.style.background="none",n.style.backgroundColor="transparent";let r=new Set(i),a=new Set;for(let e of n.querySelectorAll("[data-element-id]")){let t=e.dataset.elementId;if(!(t===void 0||!r.has(t))){for(let o=e;o&&o!==n;)a.add(o),o=o.parentElement;for(let o of e.querySelectorAll("[data-element-id]"))a.add(o);}}for(let e of [...n.querySelectorAll("[data-element-id]")])a.has(e)||e.remove();return n}function q(n,i,r,a){return (a?.crossfadeGroups??[]).map((e,t)=>{let o=n.createElement("div");o.dataset.pptxMorphCrossfade=e.incoming.id,o.style.cssText=chunkYOEVEUFZ_cjs.Gg,o.style.zIndex=String(4+t);let m=(p,l,s,y,g)=>{let d=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?d.dataset.pptxMorphOutgoing="true":d.dataset.pptxMorphLifted="true",d.style.mixBlendMode=chunkYOEVEUFZ_cjs.Hg,d};return o.append(m(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),m(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function se(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=chunkYOEVEUFZ_cjs.gi(t),m=chunkYOEVEUFZ_cjs.hi(t),p=chunkYOEVEUFZ_cjs.bi(t.type,m,t.direction,t.spokes,t.pattern),l=i.createElement("div");l.className="pptxv-transition-overlay",l.dataset.pptxTransitionOverlay="",l.dataset.pptxTransitionOverlay="",l.style.position="absolute",l.style.inset="0",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="30";let s=t.type==="morph"?chunkYOEVEUFZ_cjs.Jg(n.outgoingSlide,n.incomingSlide,m,chunkYOEVEUFZ_cjs.Ig(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,d=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),x=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),S=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=S?u(i,S,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){x.dataset.pptxMorphIncoming="true",d.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[chunkYOEVEUFZ_cjs.Kg(s,"data-pptx-morph-incoming","incoming"),chunkYOEVEUFZ_cjs.Kg(s,"data-pptx-morph-outgoing","outgoing"),chunkYOEVEUFZ_cjs.Kg(s,"data-pptx-morph-lifted","lifted")].join(`
4
4
  `),l.appendChild(c);}l.append(d,x),f&&l.appendChild(f);for(let c of $)l.appendChild(c);r.appendChild(l);let h=false,v=()=>{h||(h=true,clearTimeout(G),l.remove(),n.onDone());},G=setTimeout(v,Math.max(0,m)+50);return v}exports.a=K;exports.b=W;exports.c=X;exports.d=se;