@aglyn/plugins-ai 1.0.0-beta.270 → 1.0.0-beta.271
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/package.json +17 -17
- package/src/lib/activity/ai-activity-actions.d.ts +1 -1
- package/src/lib/activity/ai-activity-actions.js +1 -0
- package/src/lib/activity/ai-activity-actions.js.map +1 -1
- package/src/lib/assets/site-styles/beauty.webp +0 -0
- package/src/lib/assets/site-styles/blog.webp +0 -0
- package/src/lib/assets/site-styles/business.webp +0 -0
- package/src/lib/assets/site-styles/coming-soon.webp +0 -0
- package/src/lib/assets/site-styles/education.webp +0 -0
- package/src/lib/assets/site-styles/events.webp +0 -0
- package/src/lib/assets/site-styles/fitness.webp +0 -0
- package/src/lib/assets/site-styles/landing.webp +0 -0
- package/src/lib/assets/site-styles/music.webp +0 -0
- package/src/lib/assets/site-styles/nonprofit.webp +0 -0
- package/src/lib/assets/site-styles/personal.webp +0 -0
- package/src/lib/assets/site-styles/photography.webp +0 -0
- package/src/lib/assets/site-styles/portfolio.webp +0 -0
- package/src/lib/assets/site-styles/professional.webp +0 -0
- package/src/lib/assets/site-styles/realestate.webp +0 -0
- package/src/lib/assets/site-styles/restaurant.webp +0 -0
- package/src/lib/assets/site-styles/store.webp +0 -0
- package/src/lib/assets/site-styles/studio.webp +0 -0
- package/src/lib/assets/site-styles/trades.webp +0 -0
- package/src/lib/assets/site-styles/wellness.webp +0 -0
- package/src/lib/assets/site-styles/yoga.webp +0 -0
- package/src/lib/components/ai-credits-card.component.d.ts +4 -3
- package/src/lib/components/ai-credits-card.component.js +15 -15
- package/src/lib/components/ai-credits-card.component.js.map +1 -1
- package/src/lib/components/ai-job-input-form.component.d.ts +36 -0
- package/src/lib/components/ai-job-input-form.component.js +100 -0
- package/src/lib/components/ai-job-input-form.component.js.map +1 -0
- package/src/lib/components/ai-job-requests.d.ts +4 -0
- package/src/lib/components/ai-job-requests.js +4 -0
- package/src/lib/components/ai-job-requests.js.map +1 -1
- package/src/lib/components/ai-site-start-card.component.d.ts +1 -1
- package/src/lib/components/ai-site-start-card.component.js +99 -31
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +43 -2
- package/src/lib/components/ai-site-start-steps.component.js +651 -15
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
- package/src/lib/components/ai-site-start-tracking.d.ts +10 -0
- package/src/lib/components/ai-site-start-tracking.js +14 -0
- package/src/lib/components/ai-site-start-tracking.js.map +1 -1
- package/src/lib/components/ai-site-style-previews.js +26 -22
- package/src/lib/components/ai-site-style-previews.js.map +1 -1
- package/src/lib/components/ai-upsell-dialog.component.d.ts +7 -5
- package/src/lib/components/ai-upsell-dialog.component.js +8 -6
- package/src/lib/components/ai-upsell-dialog.component.js.map +1 -1
- package/src/lib/components/assist-build-card.component.js +11 -1
- package/src/lib/components/assist-build-card.component.js.map +1 -1
- package/src/lib/components/assist-jobs-drawer.component.js +9 -1
- package/src/lib/components/assist-jobs-drawer.component.js.map +1 -1
- package/src/lib/components/assist-panel.component.js +8 -4
- package/src/lib/components/assist-panel.component.js.map +1 -1
- package/src/lib/components/staff-org-ai-card.component.js +4 -7
- package/src/lib/components/staff-org-ai-card.component.js.map +1 -1
- package/src/lib/declarations.d.ts +2 -2
- package/src/lib/declarations.js +9 -5
- package/src/lib/declarations.js.map +1 -1
- package/src/lib/jobs/ai-build-capabilities.js +3 -1
- package/src/lib/jobs/ai-build-capabilities.js.map +1 -1
- package/src/lib/jobs/ai-business-profile-prefill.d.ts +1 -1
- package/src/lib/jobs/ai-business-profile-prefill.js +14 -3
- package/src/lib/jobs/ai-business-profile-prefill.js.map +1 -1
- package/src/lib/jobs/ai-job-build-step.js +5 -3
- package/src/lib/jobs/ai-job-build-step.js.map +1 -1
- package/src/lib/jobs/ai-job-form-step.d.ts +15 -1
- package/src/lib/jobs/ai-job-form-step.js +75 -8
- package/src/lib/jobs/ai-job-form-step.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +13 -0
- package/src/lib/jobs/ai-job-page-language.js +37 -1
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.d.ts +17 -0
- package/src/lib/jobs/ai-job-page-step.js +37 -16
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +25 -2
- package/src/lib/jobs/ai-job-plan-step.js +103 -29
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-settings-step.js +4 -3
- package/src/lib/jobs/ai-job-settings-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-datasets.d.ts +27 -0
- package/src/lib/jobs/ai-job-site-datasets.js +140 -14
- package/src/lib/jobs/ai-job-site-datasets.js.map +1 -1
- package/src/lib/jobs/ai-job-site-look.js +18 -5
- package/src/lib/jobs/ai-job-site-look.js.map +1 -1
- package/src/lib/jobs/ai-job-site-step.d.ts +16 -1
- package/src/lib/jobs/ai-job-site-step.js +95 -22
- package/src/lib/jobs/ai-job-site-step.js.map +1 -1
- package/src/lib/jobs/ai-job-text-step.d.ts +8 -1
- package/src/lib/jobs/ai-job-text-step.js.map +1 -1
- package/src/lib/jobs/ai-job-tracking-step.d.ts +14 -3
- package/src/lib/jobs/ai-job-tracking-step.js +28 -5
- package/src/lib/jobs/ai-job-tracking-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs.d.ts +8 -1
- package/src/lib/jobs/ai-jobs.js +63 -8
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-layout-stock-photos.d.ts +27 -2
- package/src/lib/jobs/ai-layout-stock-photos.js +190 -19
- package/src/lib/jobs/ai-layout-stock-photos.js.map +1 -1
- package/src/lib/jobs/ai-site-inspiration-signals.d.ts +98 -0
- package/src/lib/jobs/ai-site-inspiration-signals.js +585 -0
- package/src/lib/jobs/ai-site-inspiration-signals.js.map +1 -0
- package/src/lib/jobs/ai-site-inspiration.d.ts +157 -0
- package/src/lib/jobs/ai-site-inspiration.js +346 -0
- package/src/lib/jobs/ai-site-inspiration.js.map +1 -0
- package/src/lib/jobs/ai-site-publish.d.ts +26 -1
- package/src/lib/jobs/ai-site-publish.js +162 -13
- package/src/lib/jobs/ai-site-publish.js.map +1 -1
- package/src/lib/jobs/ai-theme-brand-inputs.d.ts +16 -0
- package/src/lib/jobs/ai-theme-brand-inputs.js +18 -4
- package/src/lib/jobs/ai-theme-brand-inputs.js.map +1 -1
- package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.d.ts +97 -0
- package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.js +137 -0
- package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-site-inspiration-pages.d.ts +38 -0
- package/src/lib/jobs/fixtures/ai-site-inspiration-pages.js +103 -0
- package/src/lib/jobs/fixtures/ai-site-inspiration-pages.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.d.ts +25 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.js +174 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.d.ts +1 -1
- package/src/lib/layout-language/ai-layout-compiler.js +438 -25
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-contact.d.ts +57 -0
- package/src/lib/layout-language/ai-layout-contact.js +137 -0
- package/src/lib/layout-language/ai-layout-contact.js.map +1 -0
- package/src/lib/layout-language/ai-layout-copy.d.ts +12 -0
- package/src/lib/layout-language/ai-layout-copy.js +34 -2
- package/src/lib/layout-language/ai-layout-copy.js.map +1 -1
- package/src/lib/layout-language/ai-layout-design.d.ts +65 -8
- package/src/lib/layout-language/ai-layout-design.js +411 -97
- package/src/lib/layout-language/ai-layout-design.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame.js +23 -0
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-labels.d.ts +2 -0
- package/src/lib/layout-language/ai-layout-labels.js +12 -6
- package/src/lib/layout-language/ai-layout-labels.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +3 -2
- package/src/lib/layout-language/ai-layout-language.js +4 -3
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/layout-language/ai-layout-links.d.ts +13 -0
- package/src/lib/layout-language/ai-layout-links.js +30 -0
- package/src/lib/layout-language/ai-layout-links.js.map +1 -1
- package/src/lib/layout-language/ai-layout-pictures.d.ts +49 -6
- package/src/lib/layout-language/ai-layout-pictures.js +145 -22
- package/src/lib/layout-language/ai-layout-pictures.js.map +1 -1
- package/src/lib/model/ai-build-job.d.ts +16 -1
- package/src/lib/model/ai-build-job.js +40 -0
- package/src/lib/model/ai-build-job.js.map +1 -1
- package/src/lib/model/ai-job-input.d.ts +33 -0
- package/src/lib/model/ai-job-input.js +59 -0
- package/src/lib/model/ai-job-input.js.map +1 -0
- package/src/lib/model/ai-job-notice.d.ts +4 -0
- package/src/lib/model/ai-job-notice.js +11 -1
- package/src/lib/model/ai-job-notice.js.map +1 -1
- package/src/lib/model/ai-jobs.types.d.ts +40 -1
- package/src/lib/model/ai-jobs.types.js.map +1 -1
- package/src/lib/model/ai-site-details.d.ts +122 -0
- package/src/lib/model/ai-site-details.js +300 -0
- package/src/lib/model/ai-site-details.js.map +1 -0
- package/src/lib/model/ai-site-entity.d.ts +181 -0
- package/src/lib/model/ai-site-entity.js +390 -0
- package/src/lib/model/ai-site-entity.js.map +1 -0
- package/src/lib/model/ai-site-inspiration.d.ts +72 -0
- package/src/lib/model/ai-site-inspiration.js +109 -0
- package/src/lib/model/ai-site-inspiration.js.map +1 -0
- package/src/lib/model/ai-site-job.d.ts +13 -1
- package/src/lib/model/ai-site-job.js +15 -2
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.js +109 -21
- package/src/lib/model/ai-site-kinds.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +10 -0
- package/src/lib/model/ai-site-look.js +24 -0
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/model/ai-site-start-seo.d.ts +19 -5
- package/src/lib/model/ai-site-start-seo.js +25 -7
- package/src/lib/model/ai-site-start-seo.js.map +1 -1
- package/src/lib/model/ai-site-start-steps.d.ts +9 -3
- package/src/lib/model/ai-site-start-steps.js +67 -5
- package/src/lib/model/ai-site-start-steps.js.map +1 -1
- package/src/lib/model/ai-site-start.d.ts +68 -4
- package/src/lib/model/ai-site-start.js +166 -13
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/ai-upsell-copy.js +4 -1
- package/src/lib/model/ai-upsell-copy.js.map +1 -1
- package/src/lib/plan-entitlements.d.ts +4 -3
- package/src/lib/plan-entitlements.js +3 -8
- package/src/lib/plan-entitlements.js.map +1 -1
- package/src/lib/runtime/ai-dataset-generation.d.ts +8 -1
- package/src/lib/runtime/ai-dataset-generation.js +12 -2
- package/src/lib/runtime/ai-dataset-generation.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +26 -33
- package/src/lib/runtime/ai-doctrine-validators.js +54 -44
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.js +1 -1
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-node-tree.d.ts +7 -0
- package/src/lib/runtime/ai-node-tree.js +9 -1
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/server/ai-create-route.d.ts +1 -1
- package/src/lib/server/ai-create-route.js +3 -4
- package/src/lib/server/ai-create-route.js.map +1 -1
- package/src/lib/server/ai-jobs-resume.js +27 -3
- package/src/lib/server/ai-jobs-resume.js.map +1 -1
- package/src/lib/server/ai-jobs-route.js +7 -0
- package/src/lib/server/ai-jobs-route.js.map +1 -1
- package/src/lib/usage/assist-credits.d.ts +4 -4
- package/src/lib/usage/assist-credits.js +4 -4
- package/src/lib/usage/assist-credits.js.map +1 -1
- package/src/lib/usage/staff-org-ai-view.js +6 -3
- package/src/lib/usage/staff-org-ai-view.js.map +1 -1
- package/src/lib/usage/staff-org-ai.d.ts +4 -2
- package/src/lib/usage/staff-org-ai.js +7 -7
- package/src/lib/usage/staff-org-ai.js.map +1 -1
- package/src/lib/usage/staff-org-usage-ai.js +2 -2
- package/src/lib/usage/staff-org-usage-ai.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-job-requests.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { authorizedFetch, type MaybeTokenSource } from '@aglyn/shared-util-http/authorized-token'\nimport { AI_CREDITS_CONFIRM_CODE, type AiCreditsPrompt } from '../model/ai-credit-estimate'\nimport type { AiJobSummary } from '../model/ai-jobs.types'\nimport { assistBuildJobRequest, type AssistBuildProposal } from '../model/assist-build'\nimport { publishAiJob } from './ai-jobs-store'\n\n/**\n * The two decisions a person makes about a job — confirm its plan (or try a\n * refused step again), and cancel it — as ONE request each, whichever\n * surface they press it on (AGL-3593). The AI jobs drawer and the dialog that\n * started the job both call these, so confirming in the dialog is the same\n * door, the same body and the same answer as confirming in the drawer.\n *\n * Each hands the job it gets back to every counting surface, so the top-bar\n * indicator stops saying \"plan ready\" the moment the plan is confirmed.\n */\n\n/** A door's answer: the job as it now stands, and the refusal when there is one. */\nexport interface AiJobDecision {\n job: AiJobSummary | null\n error: string | null\n /**\n * A Free job past what is left (AGL-3722): the door's 409 asks for the\n * person's go-ahead with these figures and choices instead of starting it.\n */\n credits?: AiCreditsPrompt | null\n /**\n * The usage strip's envelope the job door answered with, when it ran a step\n * inline (AGL-3722): what the plan just spent, so the strip moves with it.\n */\n meter?: unknown\n}\n\n/**\n * What a resume asks beyond confirming (AGL-3616): a build's plan confirmed\n * with its publish box ticked, or a finished build's failed items tried again.\n */\nexport interface AiJobResumeOptions {\n publish?: boolean\n retry?: 'failed-items'\n /** \"Build what fits\" (AGL-3722): a Free job past what is left, started on the person's go-ahead. */\n creditsConfirmed?: boolean\n /** \"Build the home page first\" (AGL-3722): the plan narrowed to its home page and what it needs. */\n reduce?: 'first-page'\n}\n\n/**\n * Confirms a plan, or tries again a step whose answer broke a building rule\n * (AGL-2935). The door runs the next step inline and answers with the job.\n */\nexport async function resumeAiJobRequest(\n user: MaybeTokenSource,\n orgId: string,\n job: Pick<AiJobSummary, 'id' | 'hostId'>,\n options: AiJobResumeOptions = {},\n): Promise<AiJobDecision> {\n try {\n const response = await authorizedFetch(\n user,\n `/api/ai/jobs/${encodeURIComponent(job.id)}/resume`,\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n orgId,\n hostId: job.hostId,\n ...(options.publish ? { publish: true } : {}),\n ...(options.retry ? { retry: options.retry } : {}),\n ...(options.creditsConfirmed ? { creditsConfirmed: true } : {}),\n ...(options.reduce ? { reduce: options.reduce } : {}),\n }),\n },\n )\n const payload = await response.json().catch(() => null)\n const next = (payload?.job as AiJobSummary | undefined) ?? null\n publishAiJob(next)\n const credits =\n response.status === 409 && payload?.code === AI_CREDITS_CONFIRM_CODE\n ? ((payload?.credits as AiCreditsPrompt | undefined) ?? null)\n : null\n return {\n job: next,\n error: response.ok\n ? null\n : String(payload?.error ?? 'The job could not be resumed — try again.'),\n ...(credits ? { credits } : {}),\n }\n } catch {\n return { job: null, error: 'The job could not be resumed — try again.' }\n }\n}\n\n/**\n * Starts the build a chat turn proposed (AGL-3616): one `build` job on the\n * proposal's site, through the same door every job is created by, which\n * climbs its own gates and plans inline. What comes back stops at its plan\n * card; nothing is built until the person confirms it.\n */\nexport async function startAssistBuildRequest(\n user: MaybeTokenSource,\n orgId: string,\n proposal: AssistBuildProposal,\n): Promise<AiJobDecision> {\n const failed = 'The build could not be planned — try asking again.'\n try {\n const response = await authorizedFetch(user, '/api/ai/jobs', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(assistBuildJobRequest(orgId, proposal)),\n })\n const payload = await response.json().catch(() => null)\n const next = (payload?.job as AiJobSummary | undefined) ?? null\n if (response.ok && next) publishAiJob(next)\n return {\n job: response.ok ? next : null,\n error: response.ok && next ? null : String(payload?.error ?? failed),\n ...(payload?.meter ? { meter: payload.meter } : {}),\n }\n } catch {\n return { job: null, error: failed }\n }\n}\n\n/** Cancels a job that has not settled. */\nexport async function cancelAiJobRequest(\n user: MaybeTokenSource,\n orgId: string,\n jobId: string,\n): Promise<AiJobDecision> {\n try {\n const response = await authorizedFetch(\n user,\n `/api/ai/jobs/${encodeURIComponent(jobId)}/cancel`,\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ orgId }),\n },\n )\n const payload = await response.json().catch(() => null)\n const next = (payload?.job as AiJobSummary | undefined) ?? null\n publishAiJob(next)\n return {\n job: next,\n error: response.ok\n ? null\n : String(payload?.error ?? 'The job could not be canceled — try again.'),\n }\n } catch {\n return { job: null, error: 'The job could not be canceled — try again.' }\n }\n}\n"],"names":["authorizedFetch","AI_CREDITS_CONFIRM_CODE","assistBuildJobRequest","publishAiJob","resumeAiJobRequest","user","orgId","job","options","response","encodeURIComponent","id","method","headers","body","JSON","stringify","hostId","publish","retry","creditsConfirmed","reduce","payload","json","catch","next","credits","status","code","error","ok","String","startAssistBuildRequest","proposal","failed","meter","cancelAiJobRequest","jobId"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAASA,eAAe,QAA+B,2CAA0C;AACjG,SAASC,uBAAuB,QAA8B,iCAA6B;AAE3F,SAASC,qBAAqB,QAAkC,2BAAuB;AACvF,SAASC,YAAY,QAAQ,qBAAiB;
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-job-requests.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { authorizedFetch, type MaybeTokenSource } from '@aglyn/shared-util-http/authorized-token'\nimport { AI_CREDITS_CONFIRM_CODE, type AiCreditsPrompt } from '../model/ai-credit-estimate'\nimport type { AiJobSummary } from '../model/ai-jobs.types'\nimport { assistBuildJobRequest, type AssistBuildProposal } from '../model/assist-build'\nimport { publishAiJob } from './ai-jobs-store'\n\n/**\n * The two decisions a person makes about a job — confirm its plan (or try a\n * refused step again), and cancel it — as ONE request each, whichever\n * surface they press it on (AGL-3593). The AI jobs drawer and the dialog that\n * started the job both call these, so confirming in the dialog is the same\n * door, the same body and the same answer as confirming in the drawer.\n *\n * Each hands the job it gets back to every counting surface, so the top-bar\n * indicator stops saying \"plan ready\" the moment the plan is confirmed.\n */\n\n/** A door's answer: the job as it now stands, and the refusal when there is one. */\nexport interface AiJobDecision {\n job: AiJobSummary | null\n error: string | null\n /**\n * A Free job past what is left (AGL-3722): the door's 409 asks for the\n * person's go-ahead with these figures and choices instead of starting it.\n */\n credits?: AiCreditsPrompt | null\n /**\n * The usage strip's envelope the job door answered with, when it ran a step\n * inline (AGL-3722): what the plan just spent, so the strip moves with it.\n */\n meter?: unknown\n /** Why each answer a `needs_input` job asked for cannot be used, by field (AGL-3978). */\n fieldErrors?: Record<string, string> | null\n}\n\n/**\n * What a resume asks beyond confirming (AGL-3616): a build's plan confirmed\n * with its publish box ticked, or a finished build's failed items tried again.\n */\nexport interface AiJobResumeOptions {\n publish?: boolean\n retry?: 'failed-items'\n /** \"Build what fits\" (AGL-3722): a Free job past what is left, started on the person's go-ahead. */\n creditsConfirmed?: boolean\n /** \"Build the home page first\" (AGL-3722): the plan narrowed to its home page and what it needs. */\n reduce?: 'first-page'\n /** The answers a job waiting in `needs_input` asks for (AGL-3978), by `aiJobInputKey`. */\n input?: Record<string, string>\n}\n\n/**\n * Confirms a plan, or tries again a step whose answer broke a building rule\n * (AGL-2935). The door runs the next step inline and answers with the job.\n */\nexport async function resumeAiJobRequest(\n user: MaybeTokenSource,\n orgId: string,\n job: Pick<AiJobSummary, 'id' | 'hostId'>,\n options: AiJobResumeOptions = {},\n): Promise<AiJobDecision> {\n try {\n const response = await authorizedFetch(\n user,\n `/api/ai/jobs/${encodeURIComponent(job.id)}/resume`,\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n orgId,\n hostId: job.hostId,\n ...(options.publish ? { publish: true } : {}),\n ...(options.retry ? { retry: options.retry } : {}),\n ...(options.creditsConfirmed ? { creditsConfirmed: true } : {}),\n ...(options.reduce ? { reduce: options.reduce } : {}),\n ...(options.input ? { input: options.input } : {}),\n }),\n },\n )\n const payload = await response.json().catch(() => null)\n const next = (payload?.job as AiJobSummary | undefined) ?? null\n publishAiJob(next)\n const credits =\n response.status === 409 && payload?.code === AI_CREDITS_CONFIRM_CODE\n ? ((payload?.credits as AiCreditsPrompt | undefined) ?? null)\n : null\n return {\n job: next,\n error: response.ok\n ? null\n : String(payload?.error ?? 'The job could not be resumed — try again.'),\n ...(credits ? { credits } : {}),\n ...(payload?.fieldErrors ? { fieldErrors: payload.fieldErrors as Record<string, string> } : {}),\n }\n } catch {\n return { job: null, error: 'The job could not be resumed — try again.' }\n }\n}\n\n/**\n * Starts the build a chat turn proposed (AGL-3616): one `build` job on the\n * proposal's site, through the same door every job is created by, which\n * climbs its own gates and plans inline. What comes back stops at its plan\n * card; nothing is built until the person confirms it.\n */\nexport async function startAssistBuildRequest(\n user: MaybeTokenSource,\n orgId: string,\n proposal: AssistBuildProposal,\n): Promise<AiJobDecision> {\n const failed = 'The build could not be planned — try asking again.'\n try {\n const response = await authorizedFetch(user, '/api/ai/jobs', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(assistBuildJobRequest(orgId, proposal)),\n })\n const payload = await response.json().catch(() => null)\n const next = (payload?.job as AiJobSummary | undefined) ?? null\n if (response.ok && next) publishAiJob(next)\n return {\n job: response.ok ? next : null,\n error: response.ok && next ? null : String(payload?.error ?? failed),\n ...(payload?.meter ? { meter: payload.meter } : {}),\n }\n } catch {\n return { job: null, error: failed }\n }\n}\n\n/** Cancels a job that has not settled. */\nexport async function cancelAiJobRequest(\n user: MaybeTokenSource,\n orgId: string,\n jobId: string,\n): Promise<AiJobDecision> {\n try {\n const response = await authorizedFetch(\n user,\n `/api/ai/jobs/${encodeURIComponent(jobId)}/cancel`,\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ orgId }),\n },\n )\n const payload = await response.json().catch(() => null)\n const next = (payload?.job as AiJobSummary | undefined) ?? null\n publishAiJob(next)\n return {\n job: next,\n error: response.ok\n ? null\n : String(payload?.error ?? 'The job could not be canceled — try again.'),\n }\n } catch {\n return { job: null, error: 'The job could not be canceled — try again.' }\n }\n}\n"],"names":["authorizedFetch","AI_CREDITS_CONFIRM_CODE","assistBuildJobRequest","publishAiJob","resumeAiJobRequest","user","orgId","job","options","response","encodeURIComponent","id","method","headers","body","JSON","stringify","hostId","publish","retry","creditsConfirmed","reduce","input","payload","json","catch","next","credits","status","code","error","ok","String","fieldErrors","startAssistBuildRequest","proposal","failed","meter","cancelAiJobRequest","jobId"],"mappings":"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"}
|
|
@@ -44,5 +44,5 @@ export type AiSiteStartCardProps = ConsoleHostFirstRunZoneProps & {
|
|
|
44
44
|
* `aiSiteStartBrief` and `aiSiteStartInputs`. Each step is reported as a
|
|
45
45
|
* funnel, with where people struggle (`ai-site-start-tracking.ts`).
|
|
46
46
|
*/
|
|
47
|
-
export declare function AiSiteStartCard({ hostId, orgId, orgSlug, host, startBlank, leave, pendingSite, initialAnswers, }: AiSiteStartCardProps): import("react").JSX.Element;
|
|
47
|
+
export declare function AiSiteStartCard({ hostId, orgId, orgSlug, host, startBlank, leave, pendingSite, clientBuild, initialAnswers, }: AiSiteStartCardProps): import("react").JSX.Element;
|
|
48
48
|
export default AiSiteStartCard;
|
|
@@ -32,11 +32,12 @@ import { AI_JOB_AUTO_CONFIRM_INPUT, AI_SITE_FREE_PAGES, aiFreeCreditsNoneLeftTex
|
|
|
32
32
|
import { FREE_AI_TASTE_CREDITS_PER_MONTH } from "../plan-entitlements.js";
|
|
33
33
|
import { AI_CREDITS_CONFIRM_CODE, aiCreditRangeText } from "../model/ai-credit-estimate.js";
|
|
34
34
|
import { AiCreditsPromptNotice } from "./ai-credits-prompt.component.js";
|
|
35
|
-
import { AI_SITE_START_ANSWERS, aiSiteStartBrief, aiSiteStartInputs, aiSiteStartRefusal } from "../model/ai-site-start.js";
|
|
36
|
-
import {
|
|
35
|
+
import { AI_SITE_START_ANSWERS, aiSiteStartAnswersFromClientBuild, aiSiteStartBrief, aiSiteStartClientBrief, aiSiteStartClientInputs, aiSiteStartClientNote, aiSiteStartExtrasGiven, aiSiteStartInputs, aiSiteStartRefusal } from "../model/ai-site-start.js";
|
|
36
|
+
import { aiSiteInspirationLimit } from "../model/ai-site-inspiration.js";
|
|
37
|
+
import { aiSiteStartFieldErrors, aiSiteStartFirstInvalidStep, aiSiteStartNextStep, aiSiteStartPreviousStep, aiSiteStartStepErrors, aiSiteStartStepIndex, AI_SITE_START_STEPS, AI_SITE_START_STEP_FIELDS } from "../model/ai-site-start-steps.js";
|
|
37
38
|
import { aiSiteKindOfInputs } from "../model/ai-site-kinds.js";
|
|
38
39
|
import { aiSiteStartClickOf, useAiSiteStartTracking } from "./ai-site-start-tracking.js";
|
|
39
|
-
import { AudienceStep, DetailsStep, KindStep, ReviewStep, StartProgress, StepHelp, StyleStep } from "./ai-site-start-steps.component.js";
|
|
40
|
+
import { AudienceStep, DetailsStep, KindStep, MoreDetails, ReviewStep, StartProgress, StepHelp, StyleStep } from "./ai-site-start-steps.component.js";
|
|
40
41
|
import { AiJobFollow } from "./ai-job-follow.component.js";
|
|
41
42
|
import { AiModelSelector } from "./ai-model-selector.component.js";
|
|
42
43
|
import { useAiModelChoice } from "./use-ai-model-choice.js";
|
|
@@ -192,8 +193,8 @@ function SectionLabel({ children, help }) {
|
|
|
192
193
|
* held, and only the review turns them into the job, through the same
|
|
193
194
|
* `aiSiteStartBrief` and `aiSiteStartInputs`. Each step is reported as a
|
|
194
195
|
* funnel, with where people struggle (`ai-site-start-tracking.ts`).
|
|
195
|
-
*/ export function AiSiteStartCard({ hostId, orgId, orgSlug, host, startBlank, leave, pendingSite, initialAnswers = null }) {
|
|
196
|
-
var _ref, _ref1, _ref2, _aiFreeSitePrompt;
|
|
196
|
+
*/ export function AiSiteStartCard({ hostId, orgId, orgSlug, host, startBlank, leave, pendingSite, clientBuild, initialAnswers = null }) {
|
|
197
|
+
var _ref, _ref1, _ref2, _ref3, _aiFreeSitePrompt;
|
|
197
198
|
var _aiSiteKindOfInputs, _modelChoice_options_options_find, _modelChoice_options;
|
|
198
199
|
const { data: user } = useUser();
|
|
199
200
|
const router = useRouter();
|
|
@@ -208,11 +209,21 @@ function SectionLabel({ children, help }) {
|
|
|
208
209
|
// the site does not exist yet. It opens on the first question, where the
|
|
209
210
|
// site's name and address are asked, with every answer after it filled in.
|
|
210
211
|
const [handedOff] = useState(()=>pendingSite && !initialAnswers ? readAiSiteStartAnswers() : null);
|
|
212
|
+
// A site staff are building for a client (AGL-3958): the intake answered
|
|
213
|
+
// the questions already, so the start opens on the review with them, and
|
|
214
|
+
// stays on this screen once it has started. Read once, like a reopened start.
|
|
215
|
+
const [clientAnswers] = useState(()=>clientBuild && !initialAnswers ? aiSiteStartAnswersFromClientBuild(clientBuild.intake) : null);
|
|
216
|
+
const [clientIntake] = useState(()=>{
|
|
217
|
+
var _ref;
|
|
218
|
+
return (_ref = clientBuild == null ? void 0 : clientBuild.intake) != null ? _ref : null;
|
|
219
|
+
});
|
|
220
|
+
const clientBuildRef = useRef(clientBuild);
|
|
221
|
+
clientBuildRef.current = clientBuild;
|
|
211
222
|
// Read once: a start reopened on its answers stays one while it is open.
|
|
212
|
-
const reopened = useRef(initialAnswers !== null || handedOff !== null);
|
|
223
|
+
const reopened = useRef(initialAnswers !== null || handedOff !== null || clientAnswers !== null);
|
|
213
224
|
// A start reopened on its answers opens on the review, every answer there to change.
|
|
214
|
-
const [step, setStep] = useState(initialAnswers ? 'review' : 'choose');
|
|
215
|
-
const [answers, setAnswers] = useState((_ref1 = initialAnswers != null ? initialAnswers : handedOff) != null ? _ref1 : AI_SITE_START_ANSWERS);
|
|
225
|
+
const [step, setStep] = useState(initialAnswers || clientAnswers ? 'review' : 'choose');
|
|
226
|
+
const [answers, setAnswers] = useState((_ref1 = (_ref2 = initialAnswers != null ? initialAnswers : clientAnswers) != null ? _ref2 : handedOff) != null ? _ref1 : AI_SITE_START_ANSWERS);
|
|
216
227
|
// The steps whose reasons not to go forward are shown: the ones Next was refused on.
|
|
217
228
|
const [checked, setChecked] = useState(()=>new Set());
|
|
218
229
|
// A step opened from the review's Edit goes back to the review on Next.
|
|
@@ -232,6 +243,9 @@ function SectionLabel({ children, help }) {
|
|
|
232
243
|
/** The site job "Plan my site" started, as the create door answered with it. */ const [started, setStarted] = useState(null);
|
|
233
244
|
// The Free taste's page band (AGL-3594), read off the verdict request.
|
|
234
245
|
const [freeTaste, setFreeTaste] = useState(false);
|
|
246
|
+
// Whether the Style step asks for the sites the person likes (AGL-3975),
|
|
247
|
+
// read off the same verdict request: `release_ai_site_inspiration`.
|
|
248
|
+
const [siteInspiration, setSiteInspiration] = useState(false);
|
|
235
249
|
// What the Free workspace has left this month (AGL-3660), as the same read
|
|
236
250
|
// the create door refuses on: the less of its own band and its owner's
|
|
237
251
|
// allowance across their Free workspaces. `null` when the route said none.
|
|
@@ -258,7 +272,8 @@ function SectionLabel({ children, help }) {
|
|
|
258
272
|
const payload = response.ok ? await response.json().catch(()=>null) : null;
|
|
259
273
|
if (active) {
|
|
260
274
|
var // "Create site" shows its own dialog when this one will not draw.
|
|
261
|
-
_pendingRef_current;
|
|
275
|
+
_pendingRef_current, _clientBuildRef_current_ready, _clientBuildRef_current;
|
|
276
|
+
setSiteInspiration((payload == null ? void 0 : payload.siteInspiration) === true);
|
|
262
277
|
if ((payload == null ? void 0 : payload.freeTaste) === true) {
|
|
263
278
|
setFreeTaste(true);
|
|
264
279
|
const credits = payload == null ? void 0 : payload.freeCredits;
|
|
@@ -272,12 +287,14 @@ function SectionLabel({ children, help }) {
|
|
|
272
287
|
const shown = response.status !== 404 && response.status !== 403;
|
|
273
288
|
setVerdict(shown ? 'ready' : 'hidden');
|
|
274
289
|
(_pendingRef_current = pendingRef.current) == null ? void 0 : _pendingRef_current.ready(shown);
|
|
290
|
+
(_clientBuildRef_current = clientBuildRef.current) == null ? void 0 : (_clientBuildRef_current_ready = _clientBuildRef_current.ready) == null ? void 0 : _clientBuildRef_current_ready.call(_clientBuildRef_current, shown);
|
|
275
291
|
}
|
|
276
292
|
} catch (unused) {
|
|
277
293
|
if (active) {
|
|
278
|
-
var _pendingRef_current1;
|
|
294
|
+
var _pendingRef_current1, _clientBuildRef_current_ready1, _clientBuildRef_current1;
|
|
279
295
|
setVerdict('hidden');
|
|
280
296
|
(_pendingRef_current1 = pendingRef.current) == null ? void 0 : _pendingRef_current1.ready(false);
|
|
297
|
+
(_clientBuildRef_current1 = clientBuildRef.current) == null ? void 0 : (_clientBuildRef_current_ready1 = _clientBuildRef_current1.ready) == null ? void 0 : _clientBuildRef_current_ready1.call(_clientBuildRef_current1, false);
|
|
281
298
|
}
|
|
282
299
|
}
|
|
283
300
|
})();
|
|
@@ -301,7 +318,7 @@ function SectionLabel({ children, help }) {
|
|
|
301
318
|
answers.pages
|
|
302
319
|
]);
|
|
303
320
|
// A store's first products and a blog's first posts are part of the start (AGL-3676, AGL-3798).
|
|
304
|
-
const siteKind = (
|
|
321
|
+
const siteKind = (_ref3 = (_aiSiteKindOfInputs = aiSiteKindOfInputs(aiSiteStartInputs(answers))) == null ? void 0 : _aiSiteKindOfInputs.id) != null ? _ref3 : null;
|
|
305
322
|
const prompt = freeTaste ? (_aiFreeSitePrompt = aiFreeSitePrompt(freeCredits, answers.pages, {
|
|
306
323
|
siteKind
|
|
307
324
|
})) != null ? _aiFreeSitePrompt : serverPrompt : null;
|
|
@@ -359,10 +376,19 @@ function SectionLabel({ children, help }) {
|
|
|
359
376
|
orgId,
|
|
360
377
|
hostId: siteId,
|
|
361
378
|
kind: 'site',
|
|
362
|
-
|
|
379
|
+
// A client build's intake rides along (AGL-3958): the name and
|
|
380
|
+
// towns as the inputs the questions leave empty, and how to reach
|
|
381
|
+
// the business, its hours and the owner's words in the brief.
|
|
382
|
+
brief: [
|
|
383
|
+
aiSiteStartBrief(asked),
|
|
384
|
+
clientIntake ? aiSiteStartClientBrief(clientIntake) : ''
|
|
385
|
+
].filter(Boolean).join(' '),
|
|
363
386
|
// The guided start confirms its own plan (AGL-3594): the build
|
|
364
387
|
// follows the plan with no approval to make.
|
|
365
|
-
|
|
388
|
+
// The sites they like go only while the start asks for them (AGL-3975).
|
|
389
|
+
inputs: _extends({}, aiSiteStartInputs(siteInspiration ? asked : _extends({}, asked, {
|
|
390
|
+
inspiration: []
|
|
391
|
+
})), clientIntake ? aiSiteStartClientInputs(clientIntake) : {}, {
|
|
366
392
|
[AI_JOB_AUTO_CONFIRM_INPUT]: true
|
|
367
393
|
})
|
|
368
394
|
}, pickedModel ? {
|
|
@@ -422,9 +448,27 @@ function SectionLabel({ children, help }) {
|
|
|
422
448
|
publishAiJob(created);
|
|
423
449
|
// A removed start's answers have been used (AGL-3936).
|
|
424
450
|
clearAiSiteStartAnswers();
|
|
451
|
+
// Which optional details the site was asked for with (AGL-3979), by id only.
|
|
452
|
+
tracker.detailsGiven(aiSiteStartExtrasGiven(asked).map((field)=>{
|
|
453
|
+
var _AI_SITE_START_STEPS_find;
|
|
454
|
+
return {
|
|
455
|
+
field,
|
|
456
|
+
step: (_AI_SITE_START_STEPS_find = AI_SITE_START_STEPS.find((at)=>AI_SITE_START_STEP_FIELDS[at].includes(field))) != null ? _AI_SITE_START_STEPS_find : 'details'
|
|
457
|
+
};
|
|
458
|
+
}));
|
|
425
459
|
// The funnel's last step: the site is started, and nothing after is leaving it.
|
|
426
460
|
tracker.complete();
|
|
427
461
|
tracker.finish();
|
|
462
|
+
// A client build follows its job here, on the build's own screen, which
|
|
463
|
+
// goes on to send the owner the preview (AGL-3958).
|
|
464
|
+
if (clientIntake) {
|
|
465
|
+
var _clientBuildRef_current_onStarted, _clientBuildRef_current;
|
|
466
|
+
(_clientBuildRef_current = clientBuildRef.current) == null ? void 0 : (_clientBuildRef_current_onStarted = _clientBuildRef_current.onStarted) == null ? void 0 : _clientBuildRef_current_onStarted.call(_clientBuildRef_current, {
|
|
467
|
+
id: created.id
|
|
468
|
+
});
|
|
469
|
+
setStarted(created);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
428
472
|
// Where the next step is (AGL-3594): the site's "Building your site"
|
|
429
473
|
// page for this job. The zone closes without the starter first, so the
|
|
430
474
|
// setup page does not ask again behind it.
|
|
@@ -456,7 +500,9 @@ function SectionLabel({ children, help }) {
|
|
|
456
500
|
pickedModel,
|
|
457
501
|
pendingSite,
|
|
458
502
|
siteKind,
|
|
459
|
-
tracker
|
|
503
|
+
tracker,
|
|
504
|
+
clientIntake,
|
|
505
|
+
siteInspiration
|
|
460
506
|
]);
|
|
461
507
|
// The zone's `startBlank`. Before the site exists it creates it with the
|
|
462
508
|
// starter, and answers `false` when it could not — most often a name or
|
|
@@ -585,7 +631,7 @@ function SectionLabel({ children, help }) {
|
|
|
585
631
|
const dismissTo = creating && !started ? leave != null ? leave : runStartBlank : exit;
|
|
586
632
|
// Anything the person typed or picked, which a dismissal must not discard
|
|
587
633
|
// silently (AGL-3660). After a job starts there is nothing left to lose.
|
|
588
|
-
const drafted = !started && Boolean(answers.siteType.trim() || answers.audience.trim() || answers.kind !== null || creating && (pendingSite == null ? void 0 : pendingSite.dirty));
|
|
634
|
+
const drafted = !started && Boolean(answers.siteType.trim() || answers.audience.trim() || answers.kind !== null || aiSiteStartExtrasGiven(answers).length > 0 || creating && (pendingSite == null ? void 0 : pendingSite.dirty));
|
|
589
635
|
// Escape and the close control: a dismissal, never a choice. Escape that
|
|
590
636
|
// bubbled here through React from a portal outside this dialog's own DOM is
|
|
591
637
|
// a nested menu's, already handled there, and is not this dialog's to act on.
|
|
@@ -664,7 +710,7 @@ function SectionLabel({ children, help }) {
|
|
|
664
710
|
},
|
|
665
711
|
details: {
|
|
666
712
|
title: 'A few details',
|
|
667
|
-
lede: '
|
|
713
|
+
lede: 'How customers reach you, where messages go, how many pages, and what else to draft. All can be changed later.'
|
|
668
714
|
},
|
|
669
715
|
review: {
|
|
670
716
|
title: 'Review your site',
|
|
@@ -909,28 +955,50 @@ function SectionLabel({ children, help }) {
|
|
|
909
955
|
children: [
|
|
910
956
|
step === 'kind' && /*#__PURE__*/ _jsx(KindStep, _extends({}, stepProps)),
|
|
911
957
|
step === 'audience' && /*#__PURE__*/ _jsx(AudienceStep, _extends({}, stepProps)),
|
|
912
|
-
step === 'style' && /*#__PURE__*/ _jsx(StyleStep, _extends({}, stepProps
|
|
958
|
+
step === 'style' && /*#__PURE__*/ _jsx(StyleStep, _extends({}, stepProps, {
|
|
959
|
+
inspiration: siteInspiration ? {
|
|
960
|
+
limit: aiSiteInspirationLimit(freeTaste),
|
|
961
|
+
upgradeHref: orgSlug ? aiCreditsBillingHref(orgSlug) : null
|
|
962
|
+
} : null
|
|
963
|
+
})),
|
|
913
964
|
step === 'details' && /*#__PURE__*/ _jsx(DetailsStep, _extends({}, stepProps, {
|
|
914
965
|
freeTaste: freeTaste,
|
|
915
966
|
band: band
|
|
916
967
|
})),
|
|
917
|
-
step
|
|
968
|
+
step !== 'review' && /*#__PURE__*/ _jsx(Box, {
|
|
969
|
+
sx: {
|
|
970
|
+
mt: 3
|
|
971
|
+
},
|
|
972
|
+
children: /*#__PURE__*/ _jsx(MoreDetails, _extends({
|
|
973
|
+
step: step
|
|
974
|
+
}, stepProps), step)
|
|
975
|
+
}),
|
|
976
|
+
step === 'review' && /*#__PURE__*/ _jsxs(ReviewStep, {
|
|
918
977
|
answers: answers,
|
|
919
978
|
freeTaste: freeTaste,
|
|
920
979
|
onEdit: edit,
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
980
|
+
inspiration: siteInspiration,
|
|
981
|
+
children: [
|
|
982
|
+
clientIntake && /*#__PURE__*/ _jsx(Alert, {
|
|
983
|
+
severity: "info",
|
|
984
|
+
variant: "outlined",
|
|
985
|
+
"data-start-area": "client-intake",
|
|
986
|
+
children: aiSiteStartClientNote(clientIntake)
|
|
987
|
+
}),
|
|
988
|
+
!noneLeft && prompt && /*#__PURE__*/ _jsx(AiCreditsPromptNotice, {
|
|
989
|
+
prompt: prompt,
|
|
990
|
+
noun: "site",
|
|
991
|
+
orgSlug: orgSlug,
|
|
992
|
+
busy: busy,
|
|
993
|
+
onBuildWhatFits: ()=>void plan({
|
|
994
|
+
creditsConfirmed: true
|
|
995
|
+
}),
|
|
996
|
+
onSmaller: ()=>void plan({
|
|
997
|
+
creditsConfirmed: true,
|
|
998
|
+
pages: 1
|
|
999
|
+
})
|
|
1000
|
+
})
|
|
1001
|
+
]
|
|
934
1002
|
})
|
|
935
1003
|
]
|
|
936
1004
|
})
|