@aglyn/plugins-ai 1.14.0 → 1.15.1

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 (131) hide show
  1. package/package.json +17 -17
  2. package/src/lib/components/ai-site-build-page.component.js +5 -3
  3. package/src/lib/components/ai-site-build-page.component.js.map +1 -1
  4. package/src/lib/components/ai-site-import-finish.component.d.ts +3 -1
  5. package/src/lib/components/ai-site-import-finish.component.js +3 -3
  6. package/src/lib/components/ai-site-import-finish.component.js.map +1 -1
  7. package/src/lib/components/ai-site-import-job.component.d.ts +4 -3
  8. package/src/lib/components/ai-site-import-job.component.js +141 -43
  9. package/src/lib/components/ai-site-import-job.component.js.map +1 -1
  10. package/src/lib/components/ai-site-import-plan.component.d.ts +42 -0
  11. package/src/lib/components/ai-site-import-plan.component.js +246 -0
  12. package/src/lib/components/ai-site-import-plan.component.js.map +1 -0
  13. package/src/lib/components/ai-site-import-start.component.d.ts +3 -1
  14. package/src/lib/components/ai-site-import-start.component.js +6 -3
  15. package/src/lib/components/ai-site-import-start.component.js.map +1 -1
  16. package/src/lib/components/ai-site-start-card.component.js +6 -2
  17. package/src/lib/components/ai-site-start-card.component.js.map +1 -1
  18. package/src/lib/components/ai-site-start-steps.component.d.ts +3 -2
  19. package/src/lib/components/ai-site-start-steps.component.js +12 -5
  20. package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
  21. package/src/lib/jobs/ai-job-import-step.d.ts +63 -2
  22. package/src/lib/jobs/ai-job-import-step.js +372 -22
  23. package/src/lib/jobs/ai-job-import-step.js.map +1 -1
  24. package/src/lib/jobs/ai-job-layout-language.js +4 -1
  25. package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
  26. package/src/lib/jobs/ai-job-page-language.d.ts +23 -2
  27. package/src/lib/jobs/ai-job-page-language.js +252 -5
  28. package/src/lib/jobs/ai-job-page-language.js.map +1 -1
  29. package/src/lib/jobs/ai-job-page-step.d.ts +7 -0
  30. package/src/lib/jobs/ai-job-page-step.js +75 -12
  31. package/src/lib/jobs/ai-job-page-step.js.map +1 -1
  32. package/src/lib/jobs/ai-job-plan-step.js +4 -2
  33. package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
  34. package/src/lib/jobs/ai-job-site-look.js +14 -5
  35. package/src/lib/jobs/ai-job-site-look.js.map +1 -1
  36. package/src/lib/jobs/ai-job-text-step.d.ts +11 -2
  37. package/src/lib/jobs/ai-job-text-step.js.map +1 -1
  38. package/src/lib/jobs/ai-jobs.js +2 -1
  39. package/src/lib/jobs/ai-jobs.js.map +1 -1
  40. package/src/lib/jobs/ai-site-import-compile.d.ts +43 -2
  41. package/src/lib/jobs/ai-site-import-compile.js +131 -63
  42. package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
  43. package/src/lib/jobs/ai-site-import-document.d.ts +25 -1
  44. package/src/lib/jobs/ai-site-import-document.js +26 -7
  45. package/src/lib/jobs/ai-site-import-document.js.map +1 -1
  46. package/src/lib/jobs/ai-site-import-honesty.d.ts +65 -0
  47. package/src/lib/jobs/ai-site-import-honesty.js +271 -0
  48. package/src/lib/jobs/ai-site-import-honesty.js.map +1 -0
  49. package/src/lib/jobs/ai-site-import-improve.d.ts +286 -0
  50. package/src/lib/jobs/ai-site-import-improve.js +1281 -0
  51. package/src/lib/jobs/ai-site-import-improve.js.map +1 -0
  52. package/src/lib/jobs/ai-site-import-look.d.ts +4 -0
  53. package/src/lib/jobs/ai-site-import-look.js +16 -6
  54. package/src/lib/jobs/ai-site-import-look.js.map +1 -1
  55. package/src/lib/jobs/ai-site-import-pictures.d.ts +83 -0
  56. package/src/lib/jobs/ai-site-import-pictures.js +261 -0
  57. package/src/lib/jobs/ai-site-import-pictures.js.map +1 -0
  58. package/src/lib/jobs/ai-site-import-plan.d.ts +78 -0
  59. package/src/lib/jobs/ai-site-import-plan.js +627 -0
  60. package/src/lib/jobs/ai-site-import-plan.js.map +1 -0
  61. package/src/lib/jobs/ai-site-import-wording.js +2 -5
  62. package/src/lib/jobs/ai-site-import-wording.js.map +1 -1
  63. package/src/lib/layout-language/ai-layout-compiler.d.ts +6 -0
  64. package/src/lib/layout-language/ai-layout-compiler.js +10 -6
  65. package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
  66. package/src/lib/layout-language/ai-layout-design.d.ts +9 -0
  67. package/src/lib/layout-language/ai-layout-design.js +29 -3
  68. package/src/lib/layout-language/ai-layout-design.js.map +1 -1
  69. package/src/lib/layout-language/ai-layout-frame-source.d.ts +5 -0
  70. package/src/lib/layout-language/ai-layout-frame-source.js +4 -2
  71. package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -1
  72. package/src/lib/layout-language/ai-layout-frame.d.ts +2 -0
  73. package/src/lib/layout-language/ai-layout-frame.js +20 -12
  74. package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
  75. package/src/lib/layout-language/ai-layout-language.d.ts +8 -0
  76. package/src/lib/layout-language/ai-layout-language.js +7 -3
  77. package/src/lib/layout-language/ai-layout-language.js.map +1 -1
  78. package/src/lib/model/ai-credit-estimate.d.ts +16 -0
  79. package/src/lib/model/ai-credit-estimate.js +14 -0
  80. package/src/lib/model/ai-credit-estimate.js.map +1 -1
  81. package/src/lib/model/ai-site-import-fidelity.d.ts +64 -0
  82. package/src/lib/model/ai-site-import-fidelity.js +380 -0
  83. package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
  84. package/src/lib/model/ai-site-import-ledger.d.ts +82 -0
  85. package/src/lib/model/ai-site-import-ledger.js +254 -0
  86. package/src/lib/model/ai-site-import-ledger.js.map +1 -0
  87. package/src/lib/model/ai-site-import-view.d.ts +113 -7
  88. package/src/lib/model/ai-site-import-view.js +174 -16
  89. package/src/lib/model/ai-site-import-view.js.map +1 -1
  90. package/src/lib/model/ai-site-import.d.ts +253 -3
  91. package/src/lib/model/ai-site-import.js +371 -25
  92. package/src/lib/model/ai-site-import.js.map +1 -1
  93. package/src/lib/model/ai-site-job.js +4 -0
  94. package/src/lib/model/ai-site-job.js.map +1 -1
  95. package/src/lib/model/ai-site-kinds.d.ts +2 -0
  96. package/src/lib/model/ai-site-kinds.js +7 -0
  97. package/src/lib/model/ai-site-kinds.js.map +1 -1
  98. package/src/lib/model/ai-site-look.d.ts +14 -5
  99. package/src/lib/model/ai-site-look.js +22 -16
  100. package/src/lib/model/ai-site-look.js.map +1 -1
  101. package/src/lib/model/ai-site-start.d.ts +37 -7
  102. package/src/lib/model/ai-site-start.js +54 -10
  103. package/src/lib/model/ai-site-start.js.map +1 -1
  104. package/src/lib/model/ai-site-starter-look.d.ts +69 -0
  105. package/src/lib/model/ai-site-starter-look.js +90 -0
  106. package/src/lib/model/ai-site-starter-look.js.map +1 -0
  107. package/src/lib/runtime/ai-doctrine-validators.d.ts +7 -0
  108. package/src/lib/runtime/ai-doctrine-validators.js +3 -2
  109. package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
  110. package/src/lib/runtime/ai-doctrine.d.ts +10 -0
  111. package/src/lib/runtime/ai-doctrine.js +16 -2
  112. package/src/lib/runtime/ai-doctrine.js.map +1 -1
  113. package/src/lib/server/ai-jobs-resume.js +12 -3
  114. package/src/lib/server/ai-jobs-resume.js.map +1 -1
  115. package/src/lib/server/ai-jobs-route.js +5 -1
  116. package/src/lib/server/ai-jobs-route.js.map +1 -1
  117. package/src/lib/server/ai-site-import-route.d.ts +6 -0
  118. package/src/lib/server/ai-site-import-route.js +8 -1
  119. package/src/lib/server/ai-site-import-route.js.map +1 -1
  120. package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +46 -7
  121. package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +260 -14
  122. package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
  123. package/src/lib/site-import/fixtures/site-import-improve-answers.d.ts +33 -0
  124. package/src/lib/site-import/fixtures/site-import-improve-answers.js +457 -0
  125. package/src/lib/site-import/fixtures/site-import-improve-answers.js.map +1 -0
  126. package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +29 -0
  127. package/src/lib/site-import/fixtures/site-layout-recordings.js +26 -0
  128. package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
  129. package/src/lib/site-import/site-import-flag.d.ts +17 -0
  130. package/src/lib/site-import/site-import-flag.js +15 -0
  131. package/src/lib/site-import/site-import-flag.js.map +1 -1
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import type { AiJobSummary } from './ai-jobs.types';
18
- import { type AiSiteImportChoice, type AiSiteImportFinish, type AiSiteImportLeftOutReason, type AiSiteImportState, type AiSiteImportWave } from './ai-site-import';
18
+ import { type AiSiteImportChoice, type AiSiteImportFinish, type AiSiteImportLeftOutReason, type AiSiteImportPage, type AiSiteImportState, type AiSiteImportWave } from './ai-site-import';
19
19
  /** A domain ownership claim, as the ownership door answers it. */
20
20
  export interface AiSiteImportClaim {
21
21
  domain: string;
@@ -124,8 +124,16 @@ export interface AiSiteImportRowView {
124
124
  * "Copied as it is" or "Arranged by Aglyn AI", once the step has chosen;
125
125
  * "Arranged and reworded by Aglyn AI" once its wave improved its words, and
126
126
  * "Arranged by Aglyn AI · Words kept" for a policy page on such a wave (AGL-4152).
127
+ * Under a generative Improve it: "Redesigned by Aglyn AI · 2 new sections",
128
+ * or "Layout kept: the redesign did not pass".
127
129
  */
128
130
  build: string | null;
131
+ /** "New: Why us, FAQ (4)": the sections a redesign added (AGL-4152). */
132
+ added?: string | null;
133
+ /** "1 stock photo, 1 generated picture": the pictures a redesign took beside its own (AGL-4152). */
134
+ pictures?: string | null;
135
+ /** A page the site's plan proposed (AGL-4152): it has no old page to open. */
136
+ isNew?: boolean;
129
137
  }
130
138
  /**
131
139
  * "3 photos added", "2 photos added, 1 already in your media library"; with
@@ -137,6 +145,10 @@ export declare function aiSiteImportPhotosText(photos: {
137
145
  reused: number;
138
146
  skipped?: number;
139
147
  } | null | undefined): string | null;
148
+ /** "New: Why us, FAQ (4)": the sections a redesign added, as its row says (AGL-4152). */
149
+ export declare function aiSiteImportAddedText(page: Pick<AiSiteImportPage, 'added'>): string | null;
150
+ /** "1 stock photo, 1 generated picture": what a redesign's pictures came from beside the page's own (AGL-4152). */
151
+ export declare function aiSiteImportPicturesText(page: Pick<AiSiteImportPage, 'pictures'>): string | null;
140
152
  /** What the row of a page whose words were improved says in place of its word count (AGL-4152). */
141
153
  export declare const AI_SITE_IMPORT_REWORDED_WORDS = "Every fact kept";
142
154
  /** One wave's rows, the header and footer first where the wave builds them. */
@@ -204,10 +216,37 @@ export declare const AI_SITE_IMPORT_FINISH_COPY: {
204
216
  readonly current: "How your new site looks";
205
217
  readonly change: "Change";
206
218
  };
207
- /** The choice in a few words: "Keep my site", "Improve it", or "Improve it, and my wording". */
208
- export declare function aiSiteImportChoiceText(choice: AiSiteImportChoice): string;
209
- /** How a wave was built, as its heading says it: "Keep my site", "Improved", or "Improved, wording too". */
210
- export declare function aiSiteImportBuiltText(choice: AiSiteImportChoice): string;
219
+ /**
220
+ * The same choice under a generative Improve it (AGL-4152): the improve option's
221
+ * and the switch's words; everything else stands. Only drawn under the flag.
222
+ */
223
+ export declare const AI_SITE_IMPORT_FINISH_COPY_GENERATIVE: {
224
+ readonly improve: {
225
+ readonly label: "Improve it";
226
+ readonly description: `${string} AI plans your menu and footer, and redesigns each page with your pictures and forms, in a theme built around your brand. It shows you the plan before anything is built.`;
227
+ };
228
+ readonly wording: {
229
+ readonly label: "Also write new copy";
230
+ readonly description: `${string} AI writes new headings, paragraphs and sections for your main pages from what your site says. It never makes up a name, number, price, date, testimonial, client, award, credential, address or guarantee. Off, every word stays as you wrote it, and your layout and menu are still redesigned.`;
231
+ };
232
+ readonly heading: "How should your new site look?";
233
+ readonly keep: {
234
+ readonly label: "Keep my site";
235
+ readonly description: `Your pages stay laid out as they are, in your site\u2019s colors, buttons and fonts. ${string} tidies spacing, type and color so every page reads well. Every word stays as you wrote it.`;
236
+ };
237
+ readonly helper: "You can change this before each wave.";
238
+ /** The job page's line before it opens the choice: "How your new site looks: Keep my site". */
239
+ readonly current: "How your new site looks";
240
+ readonly change: "Change";
241
+ };
242
+ /** The choice in a few words: "Keep my site", "Improve it", or "Improve it, and my wording"; under a generative Improve it, "Improve it, with new copy". */
243
+ export declare function aiSiteImportChoiceText(choice: AiSiteImportChoice, options?: {
244
+ generative?: boolean;
245
+ }): string;
246
+ /** How a wave was built, as its heading says it: "Keep my site", "Improved", or "Improved, wording too"; under a generative Improve it, "Redesigned" or "Redesigned, new copy". */
247
+ export declare function aiSiteImportBuiltText(choice: AiSiteImportChoice, options?: {
248
+ generative?: boolean;
249
+ }): string;
211
250
  /**
212
251
  * A wave's heading (AGL-4152): once it has started, its name and how it was
213
252
  * built, "Main pages · Keep my site"; before, its name alone, since how it is
@@ -215,7 +254,9 @@ export declare function aiSiteImportBuiltText(choice: AiSiteImportChoice): strin
215
254
  */
216
255
  export declare function aiSiteImportWaveHeading(state: Pick<AiSiteImportState, 'finish' | 'wording'> | null | undefined, wave: AiSiteImportWave): string;
217
256
  /** What a running wave's page says it does with each page, the way the wave is built (AGL-4152). */
218
- export declare function aiSiteImportRunningLede(choice: AiSiteImportChoice): string;
257
+ export declare function aiSiteImportRunningLede(choice: AiSiteImportChoice, options?: {
258
+ generative?: boolean;
259
+ }): string;
219
260
  /**
220
261
  * What Also improve my wording adds (AGL-4152): for a wave, its pages'
221
262
  * rewrites, "Adds about 162 AI credits to this wave."; before the site is
@@ -224,7 +265,9 @@ export declare function aiSiteImportRunningLede(choice: AiSiteImportChoice): str
224
265
  export declare function aiSiteImportWordingCreditsText(scope: {
225
266
  job: Pick<AiJobSummary, 'items' | 'siteImport'>;
226
267
  wave: AiSiteImportWave;
227
- } | null): string;
268
+ } | null, options?: {
269
+ generative?: boolean;
270
+ }): string;
228
271
  /**
229
272
  * The choice as Bring my site draws it (AGL-4152): the finish, and where the
230
273
  * Also improve my wording switch sits, which counts only under Improve it, so
@@ -238,3 +281,66 @@ export interface AiSiteImportFinishField {
238
281
  export declare function aiSiteImportFinishFieldOf(state: Pick<AiSiteImportState, 'finish' | 'wording'> | null | undefined): AiSiteImportFinishField;
239
282
  /** The choice a field asks for: its wording only under Improve it. */
240
283
  export declare function aiSiteImportFieldChoice(field: AiSiteImportFinishField): AiSiteImportChoice;
284
+ /** The "Your new site" panel's words: what the site is, its menu, its main button, its footer, and what its owner may switch. */
285
+ export interface AiSiteImportPlanView {
286
+ what: string;
287
+ audience: string;
288
+ /** Each menu entry: its label and the pages under it; one page is a plain link. */
289
+ menu: Array<{
290
+ label: string;
291
+ pages: string[];
292
+ }>;
293
+ /** "Book a visit → Contact". */
294
+ cta: string | null;
295
+ footer: Array<{
296
+ label: string;
297
+ pages: string[];
298
+ }>;
299
+ /** The page it proposes, whether it was kept or switched off. */
300
+ proposed: {
301
+ title: string;
302
+ purpose: string;
303
+ address: string;
304
+ } | null;
305
+ /** Whether the owner still decides: the plan waits on them. */
306
+ editable: boolean;
307
+ }
308
+ /** The panel's fixed words, one place for its specs and its screen. */
309
+ export declare const AI_SITE_IMPORT_PLAN_COPY_TEXT: {
310
+ readonly heading: "Your new site";
311
+ readonly menu: "Menu";
312
+ readonly cta: "Main button";
313
+ readonly footer: "Footer";
314
+ readonly addPage: "Add this new page";
315
+ readonly addPageHelp: "One new page, written from what your site says. It counts toward your plan’s page limit.";
316
+ readonly pictures: "Create pictures with AI where needed";
317
+ readonly build: "Build my new site";
318
+ readonly whatsNew: "What’s new";
319
+ };
320
+ /** The panel as a plan reads, or `null` with none: every import the flag is off for, and every plan that did not pass. */
321
+ export declare function aiSiteImportPlanViewOf(state: AiSiteImportState | null | undefined): AiSiteImportPlanView | null;
322
+ /** What the plan that did not pass says, or `null`: a plan that passed, and every import with none asked. */
323
+ export declare function aiSiteImportPlanFellBackText(state: Pick<AiSiteImportState, 'plan'> | null | undefined): string | null;
324
+ /** The credits a generated picture is quoted at, on a paid plan: an import is one. */
325
+ export declare const aiSiteImportPictureCredits: () => number;
326
+ /** What the generated pictures switch says it adds: how many at most, and what each costs, before it is on. */
327
+ export declare function aiSiteImportPicturesSwitchText(state: AiSiteImportState): string;
328
+ /** Whether generated pictures are switched on now, for the panel's first draw. */
329
+ export declare function aiSiteImportPlanFieldOf(state: AiSiteImportState | null | undefined): {
330
+ addPage: boolean;
331
+ pictures: boolean;
332
+ };
333
+ /** Whether a plan's generated pictures switch means anything: only pages with new copy ask for a picture. */
334
+ export declare function aiSiteImportPlanTakesPictures(state: Pick<AiSiteImportState, 'pages'>): boolean;
335
+ /** The wave's quote as the plan's switches stand now (AGL-4152), before they are saved: with or without its new page, and its pictures. */
336
+ export declare function aiSiteImportPlanQuote(job: Pick<AiJobSummary, 'items' | 'siteImport'>, field: {
337
+ addPage: boolean;
338
+ pictures: boolean;
339
+ }): string | null;
340
+ /** One page's lines of a wave's "What's new" (AGL-4152): its new sections, and its pictures. */
341
+ export interface AiSiteImportWhatsNewLine {
342
+ page: string;
343
+ lines: string[];
344
+ }
345
+ /** A wave's "What's new" (AGL-4152): what its redesigns added, page by page. Empty on every other wave. */
346
+ export declare function aiSiteImportWhatsNew(state: AiSiteImportState, wave: AiSiteImportWave): AiSiteImportWhatsNewLine[];
@@ -1,3 +1,4 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
1
2
  /**
2
3
  * @license
3
4
  * Copyright 2026 Aglyn LLC
@@ -23,7 +24,8 @@
23
24
  * specs hold them.
24
25
  *=========================================*/ import { PLATFORM_BRAND_NAME } from "@aglyn/aglyn/app-utils/platform-brand";
25
26
  import { aiCreditRangeText } from "./ai-credit-estimate.js";
26
- import { AI_SITE_IMPORT_FRAME_SLOT, AI_SITE_IMPORT_LEFT_OUT_COPY, AI_SITE_IMPORT_LEFT_OUT_REASONS, AI_SITE_IMPORT_DEFAULT_CHOICE, AI_SITE_IMPORT_UNREAD_REASONS, aiSiteImportChoiceOf, aiSiteImportNextWave, aiSiteImportPagesText, aiSiteImportQuoteText, aiSiteImportReadStops, aiSiteImportReadVerdictMessage, aiSiteImportReadVerdictReason, aiSiteImportRemainingCreditRange, aiSiteImportReviewWave, aiSiteImportRunningWave, aiSiteImportWaveChoice, aiSiteImportWaveCreditRange, aiSiteImportWaveOwed, aiSiteImportWordingCredits, aiSiteImportWordingPages } from "./ai-site-import.js";
27
+ import { aiMediaCreditsPerPicture } from "./ai-media-credits.js";
28
+ import { AI_SITE_IMPORT_FRAME_SLOT, AI_SITE_IMPORT_GENERATED_PICTURES_PER_PAGE, AI_SITE_IMPORT_LAYOUT_KEPT, AI_SITE_IMPORT_PLAN_FELL_BACK, AI_SITE_IMPORT_LEFT_OUT_COPY, AI_SITE_IMPORT_LEFT_OUT_REASONS, AI_SITE_IMPORT_DEFAULT_CHOICE, AI_SITE_IMPORT_UNREAD_REASONS, aiSiteImportChoiceOf, aiSiteImportGeneratedPicturesOn, aiSiteImportNextWave, aiSiteImportPagesText, aiSiteImportPlanAccepted, aiSiteImportPlanAwaits, aiSiteImportQuoteText, aiSiteImportReadStops, aiSiteImportReadVerdictMessage, aiSiteImportReadVerdictReason, aiSiteImportRemainingCreditRange, aiSiteImportReviewWave, aiSiteImportRunningWave, aiSiteImportWaveChoice, aiSiteImportWaveCreditRange, aiSiteImportWaveIsGenerative, aiSiteImportWaveOwed, aiSiteImportWordingCredits, aiSiteImportWordingPages } from "./ai-site-import.js";
27
29
  /** What the card says to a plan that does not include it. */ export const AI_SITE_IMPORT_PLAN_COPY = 'Bring your current website in, every page and photo, on any paid plan. Upgrade to bring yours in.';
28
30
  /** What the card says to a member who cannot. */ export const AI_SITE_IMPORT_ROLE_COPY = 'Only the workspace owner or an admin can bring a site in.';
29
31
  /**
@@ -131,15 +133,40 @@ function rowState(row, active) {
131
133
  const BUILD_COPY = {
132
134
  copied: 'Copied as it is',
133
135
  arranged: `Arranged by ${PLATFORM_BRAND_NAME} AI`,
136
+ /** A main page redesigned from its ledger (AGL-4152). */ redesigned: `Redesigned by ${PLATFORM_BRAND_NAME} AI`,
134
137
  /** A main page whose wording was improved (AGL-4152). */ reworded: `Arranged and reworded by ${PLATFORM_BRAND_NAME} AI`,
135
138
  /** A policy page on a wave that improved the wording of the rest: it keeps every word. */ wordsKept: `Arranged by ${PLATFORM_BRAND_NAME} AI · Words kept`
136
139
  };
137
- /** A page's build as its row says it, with whether its words were improved where its wave improved wording (AGL-4152). */ function buildCopy(page, choice) {
140
+ /** A page's build as its row says it, with whether its words were improved where its wave improved wording (AGL-4152). */ function buildCopy(page, choice, generative = false) {
138
141
  if (!page.build) return null;
142
+ // A redesign that did not pass (AGL-4152): today's compile drew the page.
143
+ if (page.redesign === 'layout-kept') return AI_SITE_IMPORT_LAYOUT_KEPT;
144
+ if (page.redesign === 'redesigned') {
145
+ var _ref;
146
+ var _page_added;
147
+ const added = (_ref = (_page_added = page.added) == null ? void 0 : _page_added.length) != null ? _ref : 0;
148
+ return added ? `${BUILD_COPY.redesigned} · ${added} new ${added === 1 ? 'section' : 'sections'}` : BUILD_COPY.redesigned;
149
+ }
150
+ if (generative && page.build === 'arranged' && page.wording === 'improved') return BUILD_COPY.redesigned;
139
151
  if (page.build === 'arranged' && page.wording === 'improved') return BUILD_COPY.reworded;
140
152
  if (page.build === 'arranged' && page.wording === 'kept' && choice.wording) return BUILD_COPY.wordsKept;
141
153
  return BUILD_COPY[page.build];
142
154
  }
155
+ /** "New: Why us, FAQ (4)": the sections a redesign added, as its row says (AGL-4152). */ export function aiSiteImportAddedText(page) {
156
+ var _page_added;
157
+ const added = (_page_added = page.added) != null ? _page_added : [];
158
+ return added.length ? `New: ${added.map((section)=>section.items ? `${section.heading} (${section.items})` : section.heading).join(', ')}` : null;
159
+ }
160
+ /** "1 stock photo, 1 generated picture": what a redesign's pictures came from beside the page's own (AGL-4152). */ export function aiSiteImportPicturesText(page) {
161
+ const pictures = page.pictures;
162
+ if (!pictures) return null;
163
+ const parts = [
164
+ pictures.stock ? `${pictures.stock} stock ${pictures.stock === 1 ? 'photo' : 'photos'}` : '',
165
+ pictures.generated ? `${pictures.generated} generated ${pictures.generated === 1 ? 'picture' : 'pictures'}` : '',
166
+ pictures.unplaced.length ? `${pictures.unplaced.length} of your photos not placed` : ''
167
+ ].filter(Boolean);
168
+ return parts.length ? parts.join(', ') : null;
169
+ }
143
170
  /** What the row of a page whose words were improved says in place of its word count (AGL-4152). */ export const AI_SITE_IMPORT_REWORDED_WORDS = 'Every fact kept';
144
171
  /** One wave's rows, the header and footer first where the wave builds them. */ export function aiSiteImportWaveRows(job, wave) {
145
172
  var _job_items;
@@ -157,6 +184,7 @@ const BUILD_COPY = {
157
184
  };
158
185
  const rows = [];
159
186
  const choice = aiSiteImportWaveChoice(state, wave);
187
+ const generative = aiSiteImportWaveIsGenerative(state, wave);
160
188
  if (wave.frame && state.frame) {
161
189
  var _ref, _ref1, _ref2;
162
190
  var _row_failure;
@@ -181,21 +209,28 @@ const BUILD_COPY = {
181
209
  const page = state.pages.find((entry)=>entry.slot === slot);
182
210
  if (!page) continue;
183
211
  const row = items.get(slot);
184
- rows.push({
212
+ rows.push(_extends({
185
213
  slot,
186
214
  title: page.title,
187
215
  from: page.path,
188
216
  to: page.slug === '/' ? '/' : `/${page.slug}`,
189
217
  state: rowState(row, active(row)),
190
- note: (_ref3 = (_ref4 = row == null ? void 0 : (_row_failure1 = row.failure) == null ? void 0 : _row_failure1.message) != null ? _ref4 : row == null ? void 0 : row.note) != null ? _ref3 : page.refused ? AI_SITE_IMPORT_LEFT_OUT_COPY[page.refused] : null,
218
+ note: (_ref3 = (_ref4 = row == null ? void 0 : (_row_failure1 = row.failure) == null ? void 0 : _row_failure1.message) != null ? _ref4 : row == null ? void 0 : row.note) != null ? _ref3 : page.refused ? AI_SITE_IMPORT_LEFT_OUT_COPY[page.refused] : null
219
+ }, aiSiteImportAddedText(page) ? {
220
+ added: aiSiteImportAddedText(page)
221
+ } : {}, aiSiteImportPicturesText(page) ? {
222
+ pictures: aiSiteImportPicturesText(page)
223
+ } : {}, page.origin === 'proposed' ? {
224
+ isNew: true
225
+ } : {}, {
191
226
  photos: aiSiteImportPhotosText(page.photos),
192
227
  outputId: (_ref5 = row == null ? void 0 : row.outputs[0]) != null ? _ref5 : null,
193
228
  oldPage: page.url,
194
229
  // Beside the old page's own words, its main region's as the wave read them: its menu and footer are the site's (AGL-4084).
195
230
  // A page whose words were improved keeps its facts, not its count (AGL-4152).
196
- words: page.brought ? page.wording === 'improved' ? AI_SITE_IMPORT_REWORDED_WORDS : `${page.brought.words.toLocaleString('en-US')} of ${((_ref6 = (_page_read = page.read) == null ? void 0 : _page_read.words) != null ? _ref6 : page.words).toLocaleString('en-US')} words` : null,
197
- build: buildCopy(page, choice)
198
- });
231
+ words: page.brought && page.origin !== 'proposed' ? page.wording === 'improved' ? AI_SITE_IMPORT_REWORDED_WORDS : `${page.brought.words.toLocaleString('en-US')} of ${((_ref6 = (_page_read = page.read) == null ? void 0 : _page_read.words) != null ? _ref6 : page.words).toLocaleString('en-US')} words` : null,
232
+ build: buildCopy(page, choice, generative)
233
+ }));
199
234
  }
200
235
  return rows;
201
236
  }
@@ -207,7 +242,9 @@ const BUILD_COPY = {
207
242
  var _job_items, _job_items1;
208
243
  const state = job.siteImport;
209
244
  const range = aiSiteImportWaveCreditRange(state, wave, (_job_items = job.items) != null ? _job_items : null);
210
- return aiSiteImportQuoteText(range, aiSiteImportWaveOwed(state, wave, (_job_items1 = job.items) != null ? _job_items1 : null));
245
+ return aiSiteImportQuoteText(range, aiSiteImportWaveOwed(state, wave, (_job_items1 = job.items) != null ? _job_items1 : null), aiSiteImportWaveIsGenerative(state, wave) ? {
246
+ generative: true
247
+ } : {});
211
248
  }
212
249
  /** What a wave cost, its pages' credits less what was given back. */ export function aiSiteImportWaveSpent(job, wave) {
213
250
  var _job_items;
@@ -324,12 +361,27 @@ const BUILD_COPY = {
324
361
  /** The job page's line before it opens the choice: "How your new site looks: Keep my site". */ current: 'How your new site looks',
325
362
  change: 'Change'
326
363
  };
327
- /** The choice in a few words: "Keep my site", "Improve it", or "Improve it, and my wording". */ export function aiSiteImportChoiceText(choice) {
364
+ /**
365
+ * The same choice under a generative Improve it (AGL-4152): the improve option's
366
+ * and the switch's words; everything else stands. Only drawn under the flag.
367
+ */ export const AI_SITE_IMPORT_FINISH_COPY_GENERATIVE = _extends({}, AI_SITE_IMPORT_FINISH_COPY, {
368
+ improve: {
369
+ label: 'Improve it',
370
+ description: `${PLATFORM_BRAND_NAME} AI plans your menu and footer, and redesigns each page with your pictures and forms, in a theme built around your brand. It shows you the plan before anything is built.`
371
+ },
372
+ wording: {
373
+ label: 'Also write new copy',
374
+ description: `${PLATFORM_BRAND_NAME} AI writes new headings, paragraphs and sections for your main pages from what your site says. It never makes up a name, number, price, date, testimonial, client, award, credential, address or guarantee. Off, every word stays as you wrote it, and your layout and menu are still redesigned.`
375
+ }
376
+ });
377
+ /** The choice in a few words: "Keep my site", "Improve it", or "Improve it, and my wording"; under a generative Improve it, "Improve it, with new copy". */ export function aiSiteImportChoiceText(choice, options = {}) {
328
378
  if (choice.finish === 'keep') return AI_SITE_IMPORT_FINISH_COPY.keep.label;
329
- return choice.wording ? `${AI_SITE_IMPORT_FINISH_COPY.improve.label}, and my wording` : AI_SITE_IMPORT_FINISH_COPY.improve.label;
379
+ if (!choice.wording) return AI_SITE_IMPORT_FINISH_COPY.improve.label;
380
+ return options.generative ? `${AI_SITE_IMPORT_FINISH_COPY.improve.label}, with new copy` : `${AI_SITE_IMPORT_FINISH_COPY.improve.label}, and my wording`;
330
381
  }
331
- /** How a wave was built, as its heading says it: "Keep my site", "Improved", or "Improved, wording too". */ export function aiSiteImportBuiltText(choice) {
382
+ /** How a wave was built, as its heading says it: "Keep my site", "Improved", or "Improved, wording too"; under a generative Improve it, "Redesigned" or "Redesigned, new copy". */ export function aiSiteImportBuiltText(choice, options = {}) {
332
383
  if (choice.finish === 'keep') return AI_SITE_IMPORT_FINISH_COPY.keep.label;
384
+ if (options.generative) return choice.wording ? 'Redesigned, new copy' : 'Redesigned';
333
385
  return choice.wording ? 'Improved, wording too' : 'Improved';
334
386
  }
335
387
  /**
@@ -338,26 +390,34 @@ const BUILD_COPY = {
338
390
  * built is still the owner's to change.
339
391
  */ export function aiSiteImportWaveHeading(state, wave) {
340
392
  if (!wave.startedAt) return wave.label;
341
- return `${wave.label} · ${aiSiteImportBuiltText(aiSiteImportWaveChoice(state, wave))}`;
393
+ return `${wave.label} · ${aiSiteImportBuiltText(aiSiteImportWaveChoice(state, wave), wave.generative ? {
394
+ generative: true
395
+ } : {})}`;
342
396
  }
343
- /** What a running wave's page says it does with each page, the way the wave is built (AGL-4152). */ export function aiSiteImportRunningLede(choice) {
397
+ /** What a running wave's page says it does with each page, the way the wave is built (AGL-4152). */ export function aiSiteImportRunningLede(choice, options = {}) {
344
398
  const review = 'You review the wave when it is in.';
345
399
  if (choice.finish === 'keep') return `Each page keeps its layout and every word as you wrote it, in your site’s own look. ${review}`;
400
+ if (options.generative && choice.wording) return `${PLATFORM_BRAND_NAME} AI redesigns each page and writes new copy from what your site says, making up no name, number, price or date. ${review}`;
346
401
  return choice.wording ? `${PLATFORM_BRAND_NAME} AI redesigns each page and improves its wording, keeping every name, price, number, date, address, phone number and email as you wrote it. ${review}` : `${PLATFORM_BRAND_NAME} AI redesigns each page with its own words, pictures, menus and forms. ${review}`;
347
402
  }
348
403
  /**
349
404
  * What Also improve my wording adds (AGL-4152): for a wave, its pages'
350
405
  * rewrites, "Adds about 162 AI credits to this wave."; before the site is
351
406
  * read, a main page's.
352
- */ export function aiSiteImportWordingCreditsText(scope) {
407
+ */ export function aiSiteImportWordingCreditsText(scope, options = {}) {
353
408
  var _scope_job_items;
354
- if (!(scope == null ? void 0 : scope.job.siteImport)) return `About ${aiSiteImportWordingCredits(1).likely.toLocaleString('en-US')} more AI credits for each main page.`;
409
+ // Under a generative Improve it (AGL-4152) new copy is quoted as the redesign it is, before the read and on the job's page alike.
410
+ const generative = (scope == null ? void 0 : scope.job.siteImport) ? aiSiteImportWaveIsGenerative(scope.job.siteImport, scope.wave) : options.generative === true;
411
+ const how = generative ? {
412
+ generative: true
413
+ } : {};
414
+ if (!(scope == null ? void 0 : scope.job.siteImport)) return `About ${aiSiteImportWordingCredits(1, how).likely.toLocaleString('en-US')} more AI credits for each main page.`;
355
415
  const pages = aiSiteImportWordingPages(scope.job.siteImport, scope.wave, {
356
416
  finish: 'improve',
357
417
  wording: true
358
418
  }, (_scope_job_items = scope.job.items) != null ? _scope_job_items : null);
359
419
  if (!pages) return 'This wave’s pages keep every word, so it adds no AI credits.';
360
- return `Adds about ${aiSiteImportWordingCredits(pages).likely.toLocaleString('en-US')} AI credits to this wave.`;
420
+ return `Adds about ${aiSiteImportWordingCredits(pages, how).likely.toLocaleString('en-US')} AI credits to this wave.`;
361
421
  }
362
422
  /** The field an import's page opens with: the import's choice, the switch on where it was never turned off under Improve it. */ export function aiSiteImportFinishFieldOf(state) {
363
423
  const choice = aiSiteImportChoiceOf(state);
@@ -372,5 +432,103 @@ const BUILD_COPY = {
372
432
  wording: field.finish === 'improve' && field.wording
373
433
  };
374
434
  }
435
+ /** The panel's fixed words, one place for its specs and its screen. */ export const AI_SITE_IMPORT_PLAN_COPY_TEXT = {
436
+ heading: 'Your new site',
437
+ menu: 'Menu',
438
+ cta: 'Main button',
439
+ footer: 'Footer',
440
+ addPage: 'Add this new page',
441
+ addPageHelp: 'One new page, written from what your site says. It counts toward your plan’s page limit.',
442
+ pictures: 'Create pictures with AI where needed',
443
+ build: 'Build my new site',
444
+ whatsNew: 'What’s new'
445
+ };
446
+ /** The panel as a plan reads, or `null` with none: every import the flag is off for, and every plan that did not pass. */ export function aiSiteImportPlanViewOf(state) {
447
+ var _cta_page;
448
+ const plan = state == null ? void 0 : state.plan;
449
+ if (!state || !plan) return null;
450
+ const name = (id)=>{
451
+ var _ref;
452
+ var _plan_proposed, _state_pages_find;
453
+ return ((_plan_proposed = plan.proposed) == null ? void 0 : _plan_proposed.draftId) === id ? plan.proposed.title : (_ref = (_state_pages_find = state.pages.find((page)=>page.draftId === id)) == null ? void 0 : _state_pages_find.title) != null ? _ref : '';
454
+ };
455
+ const named = (groups)=>groups.map((group)=>({
456
+ label: group.label,
457
+ pages: group.pages.map(name).filter(Boolean)
458
+ })).filter((group)=>group.pages.length);
459
+ const cta = plan.nav.primaryCta;
460
+ const where = !cta ? '' : cta.target === 'phone' ? 'your phone number' : name(cta.target === 'form' ? (_cta_page = cta.page) != null ? _cta_page : '' : cta.target);
461
+ return {
462
+ what: plan.site.what,
463
+ audience: plan.site.audience,
464
+ menu: named(plan.nav.groups),
465
+ cta: cta && where ? `${cta.label} → ${where}` : null,
466
+ footer: named(plan.nav.footer),
467
+ proposed: plan.proposed && (aiSiteImportPlanAwaits(state) || plan.proposed.on) ? {
468
+ title: plan.proposed.title,
469
+ purpose: plan.proposed.purpose,
470
+ address: `/${plan.proposed.slug}`
471
+ } : null,
472
+ editable: aiSiteImportPlanAwaits(state)
473
+ };
474
+ }
475
+ /** What the plan that did not pass says, or `null`: a plan that passed, and every import with none asked. */ export function aiSiteImportPlanFellBackText(state) {
476
+ return (state == null ? void 0 : state.plan) === null ? AI_SITE_IMPORT_PLAN_FELL_BACK : null;
477
+ }
478
+ /** The credits a generated picture is quoted at, on a paid plan: an import is one. */ export const aiSiteImportPictureCredits = ()=>aiMediaCreditsPerPicture('photo', undefined, '1K');
479
+ /** What the generated pictures switch says it adds: how many at most, and what each costs, before it is on. */ export function aiSiteImportPicturesSwitchText(state) {
480
+ const pages = state.pages.filter((page)=>page.wording === 'improved' && !page.refused).length;
481
+ const each = aiSiteImportPictureCredits();
482
+ const most = pages * AI_SITE_IMPORT_GENERATED_PICTURES_PER_PAGE;
483
+ return `Only where your own photos and the stock library have nothing that fits: a page’s opening picture or a section’s lead, up to ${AI_SITE_IMPORT_GENERATED_PICTURES_PER_PAGE} a page. About ${each.toLocaleString('en-US')} AI credits each${most ? `, so at most ${(most * each).toLocaleString('en-US')} for this wave` : ''}. A picture that is not made costs nothing.`;
484
+ }
485
+ /** Whether generated pictures are switched on now, for the panel's first draw. */ export function aiSiteImportPlanFieldOf(state) {
486
+ var _state_plan_proposed, _state_plan;
487
+ return {
488
+ addPage: (state == null ? void 0 : (_state_plan = state.plan) == null ? void 0 : (_state_plan_proposed = _state_plan.proposed) == null ? void 0 : _state_plan_proposed.on) !== false,
489
+ pictures: aiSiteImportGeneratedPicturesOn(state)
490
+ };
491
+ }
492
+ /** Whether a plan's generated pictures switch means anything: only pages with new copy ask for a picture. */ export function aiSiteImportPlanTakesPictures(state) {
493
+ return state.pages.some((page)=>page.wording === 'improved' && !page.refused);
494
+ }
495
+ /** The wave's quote as the plan's switches stand now (AGL-4152), before they are saved: with or without its new page, and its pictures. */ export function aiSiteImportPlanQuote(job, field) {
496
+ var _job_siteImport, _job_items;
497
+ const state = (_job_siteImport = job.siteImport) != null ? _job_siteImport : null;
498
+ const plan = state == null ? void 0 : state.plan;
499
+ if (!state || !plan) return null;
500
+ const asked = _extends({}, state, {
501
+ generatedPictures: field.pictures,
502
+ plan: _extends({}, plan, {
503
+ proposed: plan.proposed ? _extends({}, plan.proposed, {
504
+ on: field.addPage
505
+ }) : null
506
+ })
507
+ });
508
+ const next = aiSiteImportPlanAccepted(asked, (_job_items = job.items) != null ? _job_items : []);
509
+ const wave = aiSiteImportRunningWave(next.state);
510
+ return wave ? aiSiteImportWaveQuote({
511
+ items: next.items,
512
+ siteImport: next.state
513
+ }, wave) : null;
514
+ }
515
+ /** A wave's "What's new" (AGL-4152): what its redesigns added, page by page. Empty on every other wave. */ export function aiSiteImportWhatsNew(state, wave) {
516
+ return wave.slots.flatMap((slot)=>{
517
+ var _aiSiteImportAddedText, _aiSiteImportPicturesText;
518
+ const page = state.pages.find((entry)=>entry.slot === slot);
519
+ if (!page || page.redesign !== 'redesigned') return [];
520
+ const lines = [
521
+ page.origin === 'proposed' ? 'A new page, written from what your site says' : '',
522
+ (_aiSiteImportAddedText = aiSiteImportAddedText(page)) != null ? _aiSiteImportAddedText : '',
523
+ (_aiSiteImportPicturesText = aiSiteImportPicturesText(page)) != null ? _aiSiteImportPicturesText : ''
524
+ ].filter(Boolean);
525
+ return lines.length ? [
526
+ {
527
+ page: page.title,
528
+ lines
529
+ }
530
+ ] : [];
531
+ });
532
+ }
375
533
 
376
534
  //# sourceMappingURL=ai-site-import-view.js.map