@picked/client 0.0.1-dev.1789541668638 → 0.0.1-next.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.
- package/README.md +8 -0
- package/dist/cjs/index.js +1 -4
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
- package/dist/cjs/plugins/shopify/index.js +1 -0
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +732 -1814
- package/dist/esm/plugins/create-experience/index.js +398 -490
- package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
- package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
- package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
- package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
- package/dist/esm/plugins/shopify/index.js +59 -0
- package/dist/esm/plugins/single-page-app/index.js +35 -31
- package/dist/esm/plugins/window-object/index.js +9 -9
- package/dist/esm/server/index.js +89 -141
- package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
- package/dist/experience-instance-BA0EXYg5.js +712 -0
- package/dist/id-BKIWbSTy.cjs +1 -0
- package/dist/id-BW-g3y32.js +6 -0
- package/dist/logger-BsmHUUw1.cjs +1 -0
- package/dist/logger-C9a75KZn.js +5 -0
- package/dist/object-BbFTsGh3.cjs +1 -0
- package/dist/object-JwZ58NOH.js +28 -0
- package/dist/storage-BPJwmlva.cjs +1 -0
- package/dist/storage-D87xFySf.js +85 -0
- package/dist/supports-BvrzQAVk.js +79 -0
- package/dist/supports-C0y3-V5V.cjs +1 -0
- package/dist/types/client.d.ts +23 -119
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -45
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +99 -160
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +8 -118
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +64 -96
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +7 -32
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +6 -6
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +2 -41
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +7 -30
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts +9 -0
- package/dist/types/entities/project/project.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +21 -57
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +4 -22
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +11 -13
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +184 -381
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +10 -0
- package/dist/types/ping.d.ts.map +1 -0
- package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +2 -2
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
- package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
- package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/index.d.ts +2 -0
- package/dist/types/plugins/shopify/index.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts +3 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/shopify.d.ts +28 -0
- package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
- package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/server/index.d.ts +3 -18
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +6 -4
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +38 -83
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +2 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/id.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +1 -2
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts +1 -2
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +7 -17
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +8 -19
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +7 -31
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -3
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +8 -0
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +3 -33
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +16 -0
- package/dist/types/utils/state-snaphot.d.ts.map +1 -0
- package/dist/types/utils/storage.d.ts +11 -374
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/dist/types/utils/supports.d.ts +0 -87
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/package.json +49 -182
- package/dist/.tsbuildinfo +0 -1
- package/dist/api-C7q_7vxn.js +0 -22
- package/dist/api-Ctvh1qkk.cjs +0 -1
- package/dist/cjs/form/index.js +0 -1
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
- package/dist/cjs/plugins/telemetry/index.js +0 -1
- package/dist/cjs/plugins/web-components/index.js +0 -1
- package/dist/cjs/preview/index.js +0 -1
- package/dist/docs/_root.css +0 -101
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
- package/dist/docs/explanation/content-references.md +0 -99
- package/dist/docs/explanation/feature-flag-allocation.md +0 -218
- package/dist/docs/explanation/how-picked-works.md +0 -124
- package/dist/docs/explanation/how-pickedql-works.md +0 -76
- package/dist/docs/explanation/pages-and-flows.md +0 -64
- package/dist/docs/explanation/the-content-model.md +0 -87
- package/dist/docs/explanation/the-two-apis.md +0 -68
- package/dist/docs/explanation/why-server-side-rendering.md +0 -76
- package/dist/docs/explanation/workspaces-and-versions.md +0 -71
- package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
- package/dist/docs/how-to/analytics/index.md +0 -316
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
- package/dist/docs/how-to/authenticate-the-cli.md +0 -97
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
- package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
- package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
- package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
- package/dist/docs/how-to/build-a-flow.md +0 -83
- package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
- package/dist/docs/how-to/create-a-content-entry.md +0 -48
- package/dist/docs/how-to/create-a-project.md +0 -29
- package/dist/docs/how-to/create-an-experience.md +0 -42
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
- package/dist/docs/how-to/define-a-page-layout.md +0 -46
- package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
- package/dist/docs/how-to/install-the-gtm-template.md +0 -84
- package/dist/docs/how-to/install-the-sdk.md +0 -93
- package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
- package/dist/docs/how-to/invite-and-remove-members.md +0 -35
- package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
- package/dist/docs/how-to/preview-a-workspace.md +0 -28
- package/dist/docs/how-to/publish-a-workspace.md +0 -30
- package/dist/docs/how-to/read-a-feature-flag.md +0 -113
- package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
- package/dist/docs/how-to/register-a-component.md +0 -55
- package/dist/docs/how-to/register-an-action-handler.md +0 -67
- package/dist/docs/how-to/render-a-step-form.md +0 -131
- package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
- package/dist/docs/how-to/reuse-a-section.md +0 -53
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
- package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
- package/dist/docs/how-to/run-an-ab-test.md +0 -49
- package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
- package/dist/docs/how-to/server-render-a-page.md +0 -81
- package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
- package/dist/docs/how-to/set-up-mfa.md +0 -69
- package/dist/docs/how-to/switch-workspaces.md +0 -122
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
- package/dist/docs/how-to/validate-a-field.md +0 -52
- package/dist/docs/how-to/write-a-condition.md +0 -45
- package/dist/docs/how-to/write-a-predicate.md +0 -60
- package/dist/docs/index.md +0 -59
- package/dist/docs/reference/dashboard/actions.mdx +0 -53
- package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
- package/dist/docs/reference/dashboard/conditions.mdx +0 -42
- package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
- package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
- package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
- package/dist/docs/reference/dashboard/content/models.mdx +0 -108
- package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
- package/dist/docs/reference/dashboard/experiences.mdx +0 -51
- package/dist/docs/reference/dashboard/features.mdx +0 -154
- package/dist/docs/reference/dashboard/fields.mdx +0 -106
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
- package/dist/docs/reference/dashboard/projects.mdx +0 -44
- package/dist/docs/reference/dashboard/reports.mdx +0 -43
- package/dist/docs/reference/dashboard/steps.mdx +0 -37
- package/dist/docs/reference/dashboard/team-management.md +0 -29
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
- package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
- package/dist/docs/reference/delivery-api/experience-content.md +0 -152
- package/dist/docs/reference/delivery-api/index.md +0 -45
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
- package/dist/docs/reference/delivery-api/project-config.md +0 -65
- package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
- package/dist/docs/reference/glossary.md +0 -181
- package/dist/docs/reference/management-api/authentication.md +0 -74
- package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
- package/dist/docs/reference/management-api/error-handling.md +0 -233
- package/dist/docs/reference/management-api/pagination.md +0 -192
- package/dist/docs/reference/pickedql/data-sources.md +0 -174
- package/dist/docs/reference/pickedql/dimensions.md +0 -103
- package/dist/docs/reference/pickedql/filtering.md +0 -64
- package/dist/docs/reference/pickedql/index.md +0 -18
- package/dist/docs/reference/pickedql/schema.md +0 -172
- package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
- package/dist/docs/reference/sdk/actions.md +0 -30
- package/dist/docs/reference/sdk/analytics-events.md +0 -445
- package/dist/docs/reference/sdk/conditions.md +0 -147
- package/dist/docs/reference/sdk/content-security-policy.md +0 -21
- package/dist/docs/reference/sdk/content.md +0 -213
- package/dist/docs/reference/sdk/experiences.md +0 -51
- package/dist/docs/reference/sdk/features.md +0 -256
- package/dist/docs/reference/sdk/fields.md +0 -255
- package/dist/docs/reference/sdk/index.md +0 -68
- package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
- package/dist/docs/reference/sdk/plugins/index.md +0 -29
- package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
- package/dist/docs/reference/sdk/predicates.md +0 -43
- package/dist/docs/reference/sdk/ssr/index.md +0 -33
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
- package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
- package/dist/docs/reference/sdk/steps.md +0 -86
- package/dist/docs/reference/sdk/type-generation.md +0 -196
- package/dist/docs/reference/tools/chrome-extension.md +0 -16
- package/dist/docs/reference/tools/cli.md +0 -146
- package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
- package/dist/docs/reference/tools/mcp.md +0 -90
- package/dist/docs/reference/tools/vite-plugin.md +0 -163
- package/dist/docs/tutorials/first-api-call.md +0 -228
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
- package/dist/docs/tutorials/first-experience.mdx +0 -254
- package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
- package/dist/dom-BqcToNL0.js +0 -82
- package/dist/dom-DlLH3FxV.cjs +0 -1
- package/dist/emit-D-tLiWL1.cjs +0 -1
- package/dist/emit-Ds2EG7CB.js +0 -14
- package/dist/esm/form/index.js +0 -565
- package/dist/esm/plugins/dom-observer/index.js +0 -87
- package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
- package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
- package/dist/esm/plugins/history-browser-storage/index.js +0 -26
- package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
- package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
- package/dist/esm/plugins/telemetry/index.js +0 -100
- package/dist/esm/plugins/web-components/index.js +0 -19
- package/dist/esm/preview/index.js +0 -2
- package/dist/experience-instance-B9S6Yf0N.js +0 -711
- package/dist/experience-instance-D8rOg6We.cjs +0 -1
- package/dist/id-Bo4RBeOs.js +0 -4
- package/dist/id-Js-62re-.cjs +0 -1
- package/dist/inert-script-report-B_bMPRzp.js +0 -18
- package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
- package/dist/logger-CSTvAyyB.cjs +0 -1
- package/dist/logger-DMN6TxJJ.js +0 -4
- package/dist/object-BUDGxEqy.js +0 -25
- package/dist/object-CIkt7Fkr.cjs +0 -1
- package/dist/plugin-ChafFq6S.js +0 -194
- package/dist/plugin-Dn25Gffy.cjs +0 -1
- package/dist/preview-channel-CSr96XAo.js +0 -98
- package/dist/preview-channel-Cx0e6fye.cjs +0 -1
- package/dist/protocol-Bb_vpLKE.cjs +0 -1
- package/dist/protocol-C5KkkiZc.js +0 -84
- package/dist/provider-B8wvmeC8.js +0 -98
- package/dist/provider-BBLlQOjV.cjs +0 -1
- package/dist/registry-C1t8l3t9.cjs +0 -1
- package/dist/registry-CXZv0uLg.js +0 -18
- package/dist/rules-logic-CGZIYgAI.cjs +0 -1
- package/dist/rules-logic-HesIUCu6.js +0 -13
- package/dist/storage-1MW3-_As.js +0 -103
- package/dist/storage-DUw9UJ2h.cjs +0 -1
- package/dist/supports-CO9bJGNl.js +0 -92
- package/dist/supports-DBzjGaWD.cjs +0 -1
- package/dist/types/data-source/api.d.ts +0 -60
- package/dist/types/data-source/api.d.ts.map +0 -1
- package/dist/types/data-source/provider.d.ts +0 -103
- package/dist/types/data-source/provider.d.ts.map +0 -1
- package/dist/types/data-source/registry.d.ts +0 -26
- package/dist/types/data-source/registry.d.ts.map +0 -1
- package/dist/types/data-source/request-observer.d.ts +0 -62
- package/dist/types/data-source/request-observer.d.ts.map +0 -1
- package/dist/types/data-source/virtual-data.d.ts +0 -19
- package/dist/types/data-source/virtual-data.d.ts.map +0 -1
- package/dist/types/entities/action/action.d.ts +0 -85
- package/dist/types/entities/action/action.d.ts.map +0 -1
- package/dist/types/entities/component/lazyComponent.d.ts +0 -11
- package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -29
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/content/content.d.ts +0 -53
- package/dist/types/entities/content/content.d.ts.map +0 -1
- package/dist/types/entities/content/reference.d.ts +0 -101
- package/dist/types/entities/content/reference.d.ts.map +0 -1
- package/dist/types/entities/field/policies.d.ts +0 -35
- package/dist/types/entities/field/policies.d.ts.map +0 -1
- package/dist/types/entities/response/response-validation.d.ts +0 -75
- package/dist/types/entities/response/response-validation.d.ts.map +0 -1
- package/dist/types/entities/session/session.d.ts +0 -46
- package/dist/types/entities/session/session.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -56
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/form/build-responses.d.ts +0 -18
- package/dist/types/form/build-responses.d.ts.map +0 -1
- package/dist/types/form/create-field-evaluator.d.ts +0 -28
- package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
- package/dist/types/form/create-field-validation.d.ts +0 -60
- package/dist/types/form/create-field-validation.d.ts.map +0 -1
- package/dist/types/form/create-form.d.ts +0 -153
- package/dist/types/form/create-form.d.ts.map +0 -1
- package/dist/types/form/create-submit-pipeline.d.ts +0 -116
- package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
- package/dist/types/form/get-step-fields.d.ts +0 -19
- package/dist/types/form/get-step-fields.d.ts.map +0 -1
- package/dist/types/form/index.d.ts +0 -11
- package/dist/types/form/index.d.ts.map +0 -1
- package/dist/types/lifecycle/condition-selection.d.ts +0 -146
- package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
- package/dist/types/lifecycle/lifecycle.d.ts +0 -48
- package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/types/lifecycle/rules-logic.d.ts +0 -25
- package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
- package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
- package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/index.d.ts +0 -3
- package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +0 -105
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/emit.d.ts +0 -18
- package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/index.d.ts +0 -4
- package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
- package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
- package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
- package/dist/types/plugins/web-components/index.d.ts +0 -2
- package/dist/types/plugins/web-components/index.d.ts.map +0 -1
- package/dist/types/plugins/web-components/plugin.d.ts +0 -4
- package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
- package/dist/types/preview/index.d.ts +0 -18
- package/dist/types/preview/index.d.ts.map +0 -1
- package/dist/types/preview-bridge/index.d.ts +0 -14
- package/dist/types/preview-bridge/index.d.ts.map +0 -1
- package/dist/types/preview-channel.d.ts +0 -16
- package/dist/types/preview-channel.d.ts.map +0 -1
- package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
- package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
- package/dist/types/preview-receiver/index.d.ts +0 -32
- package/dist/types/preview-receiver/index.d.ts.map +0 -1
- package/dist/types/preview-receiver/protocol.d.ts +0 -69
- package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
- package/dist/types/schema-registry.d.ts +0 -206
- package/dist/types/schema-registry.d.ts.map +0 -1
- package/dist/types/server/serialize.d.ts +0 -87
- package/dist/types/server/serialize.d.ts.map +0 -1
- package/dist/types/typed-content.d.ts +0 -17
- package/dist/types/typed-content.d.ts.map +0 -1
- package/dist/types/utils/client-telemetry.d.ts +0 -25
- package/dist/types/utils/client-telemetry.d.ts.map +0 -1
- package/dist/types/utils/content-path.d.ts +0 -37
- package/dist/types/utils/content-path.d.ts.map +0 -1
- package/dist/types/utils/html-asset-value.d.ts +0 -20
- package/dist/types/utils/html-asset-value.d.ts.map +0 -1
- package/dist/types/utils/inert-script-report.d.ts +0 -40
- package/dist/types/utils/inert-script-report.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
- package/dist/types/utils/node-tree/node-adjacency.d.ts +0 -50
- package/dist/types/utils/node-tree/node-adjacency.d.ts.map +0 -1
- package/dist/types/utils/node-tree/node-tree-index.d.ts +0 -57
- package/dist/types/utils/node-tree/node-tree-index.d.ts.map +0 -1
- package/dist/types/utils/picked-config.d.ts +0 -39
- package/dist/types/utils/picked-config.d.ts.map +0 -1
- package/dist/types/utils/preview-session.d.ts +0 -12
- package/dist/types/utils/preview-session.d.ts.map +0 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
- package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
- package/dist/types/utils/render-string.d.ts +0 -24
- package/dist/types/utils/render-string.d.ts.map +0 -1
- package/dist/types/utils/user-timing.d.ts +0 -21
- package/dist/types/utils/user-timing.d.ts.map +0 -1
- package/dist/version-CLjPfmxk.cjs +0 -1
- package/dist/version-CPKulHMH.js +0 -256
- /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
import { createDomain as ft, createEvent as b, combine as O, createApi as J, sample as S, createEffect as v, attach as A, split as pt } from "effector";
|
|
2
|
+
import { createFactory as Q, invoke as X } from "@withease/factories";
|
|
3
|
+
import { h as lt, s as Y, a as dt } from "./supports-BvrzQAVk.js";
|
|
4
|
+
import { l as P } from "./logger-C9a75KZn.js";
|
|
5
|
+
import { i as mt } from "./object-JwZ58NOH.js";
|
|
6
|
+
function gt(t) {
|
|
7
|
+
return typeof t == "number" && !isNaN(t);
|
|
8
|
+
}
|
|
9
|
+
function T(t) {
|
|
10
|
+
return typeof t == "string";
|
|
11
|
+
}
|
|
12
|
+
function w(t) {
|
|
13
|
+
return Array.isArray(t);
|
|
14
|
+
}
|
|
15
|
+
function Z(t) {
|
|
16
|
+
return t instanceof Promise;
|
|
17
|
+
}
|
|
18
|
+
function K(t) {
|
|
19
|
+
return typeof t == "object" && t !== null && !Array.isArray(t) && Object.keys(t).length === 1;
|
|
20
|
+
}
|
|
21
|
+
function d(t) {
|
|
22
|
+
if (gt(t)) return t;
|
|
23
|
+
const e = parseFloat(`${t}`);
|
|
24
|
+
return isNaN(e) ? 0 : e;
|
|
25
|
+
}
|
|
26
|
+
function B(t) {
|
|
27
|
+
return `${t}`;
|
|
28
|
+
}
|
|
29
|
+
const ht = {
|
|
30
|
+
// eslint-disable-next-line eqeqeq
|
|
31
|
+
"==": (t, e) => t == e,
|
|
32
|
+
"===": (t, e) => t === e,
|
|
33
|
+
// eslint-disable-next-line eqeqeq
|
|
34
|
+
"!=": (t, e) => t != e,
|
|
35
|
+
"!==": (t, e) => t !== e,
|
|
36
|
+
">": (t, e) => d(t) > d(e),
|
|
37
|
+
">=": (t, e) => d(t) >= d(e),
|
|
38
|
+
"<": (t, e, r) => {
|
|
39
|
+
const n = d(t), c = d(e);
|
|
40
|
+
if (r === void 0) return n < c;
|
|
41
|
+
const i = d(r);
|
|
42
|
+
return n < c && c < i;
|
|
43
|
+
},
|
|
44
|
+
"<=": (t, e, r) => {
|
|
45
|
+
const n = d(t), c = d(e);
|
|
46
|
+
if (r === void 0) return n <= c;
|
|
47
|
+
const i = d(r);
|
|
48
|
+
return n <= c && c <= i;
|
|
49
|
+
},
|
|
50
|
+
"!!": async (t) => await E(t),
|
|
51
|
+
"!": async (t) => !await E(t),
|
|
52
|
+
"%": (t, e) => d(t) % d(e),
|
|
53
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
54
|
+
log: (t) => (console.log(t), t),
|
|
55
|
+
in: (t, e) => e ? T(e) ? e.indexOf(B(t)) !== -1 : w(e) ? e.includes(t) : !1 : !1,
|
|
56
|
+
cat: (...t) => t.map(B).join(""),
|
|
57
|
+
/* eslint-disable sonarjs/deprecation */
|
|
58
|
+
substr: (t, e, r) => {
|
|
59
|
+
const n = B(t), c = d(e);
|
|
60
|
+
if (r === void 0) return n.substr(c);
|
|
61
|
+
const i = d(r);
|
|
62
|
+
if (i < 0) {
|
|
63
|
+
const o = n.substr(c);
|
|
64
|
+
return o.substr(0, o.length + i);
|
|
65
|
+
}
|
|
66
|
+
return n.substr(c, i);
|
|
67
|
+
},
|
|
68
|
+
/* eslint-enable sonarjs/deprecation */
|
|
69
|
+
"+": (...t) => t.reduce((e, r) => d(e) + d(r), 0),
|
|
70
|
+
"*": (...t) => t.reduce((e, r) => d(e) * d(r), 1),
|
|
71
|
+
"-": (t, e) => {
|
|
72
|
+
const r = d(t);
|
|
73
|
+
return e === void 0 ? -r : r - d(e);
|
|
74
|
+
},
|
|
75
|
+
"/": (t, e) => d(t) / d(e),
|
|
76
|
+
min: (...t) => Math.min(...t.map(d)),
|
|
77
|
+
max: (...t) => Math.max(...t.map(d)),
|
|
78
|
+
merge: (...t) => t.reduce((e, r) => w(r) ? e.concat(r) : e.concat([r]), []),
|
|
79
|
+
var(t, e) {
|
|
80
|
+
const r = arguments.length > 1 ? e : null;
|
|
81
|
+
if (t === "" || t === "." || t === null || t === void 0)
|
|
82
|
+
return this;
|
|
83
|
+
if (typeof t == "number" && Array.isArray(this))
|
|
84
|
+
return t >= 0 && t < this.length ? this[t] : r;
|
|
85
|
+
const n = B(t);
|
|
86
|
+
if (n === "" || n === ".")
|
|
87
|
+
return this;
|
|
88
|
+
const c = n.split(".");
|
|
89
|
+
let i = this;
|
|
90
|
+
for (const o of c) {
|
|
91
|
+
if (i == null)
|
|
92
|
+
return r;
|
|
93
|
+
if (Array.isArray(i)) {
|
|
94
|
+
const a = parseInt(o, 10);
|
|
95
|
+
isNaN(a) ? i = i[o] : i = i[a];
|
|
96
|
+
} else
|
|
97
|
+
i = i[o];
|
|
98
|
+
}
|
|
99
|
+
return i !== void 0 ? i : r;
|
|
100
|
+
},
|
|
101
|
+
async missing(...t) {
|
|
102
|
+
const e = w(t[0]) ? t[0] : t, r = [];
|
|
103
|
+
for (const n of e) {
|
|
104
|
+
const c = await l({ var: n }, this);
|
|
105
|
+
(c === null || c === "") && r.push(`${n}`);
|
|
106
|
+
}
|
|
107
|
+
return r;
|
|
108
|
+
},
|
|
109
|
+
async missing_some(t, e) {
|
|
110
|
+
const r = await l({ missing: e }, this);
|
|
111
|
+
if (!w(r) || !w(e)) return [];
|
|
112
|
+
const n = r.filter(T);
|
|
113
|
+
return e.filter(T).length - n.length >= d(t) ? [] : n;
|
|
114
|
+
},
|
|
115
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
116
|
+
invoke(t) {
|
|
117
|
+
return typeof t != "function" ? null : t();
|
|
118
|
+
},
|
|
119
|
+
regexp_matches(t, e) {
|
|
120
|
+
let r = t, n = "";
|
|
121
|
+
if (w(t)) {
|
|
122
|
+
const [i, o] = t;
|
|
123
|
+
r = i, n = o;
|
|
124
|
+
}
|
|
125
|
+
return !T(r) || !T(n) ? !1 : new RegExp(r, n).test(B(e));
|
|
126
|
+
},
|
|
127
|
+
throw(t) {
|
|
128
|
+
throw new Error(B(t));
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
async function l(t, e) {
|
|
132
|
+
if (!t) return t;
|
|
133
|
+
if (Z(t))
|
|
134
|
+
return l(await t, e);
|
|
135
|
+
if (w(t))
|
|
136
|
+
return Promise.all(t.map((o) => l(o, e)));
|
|
137
|
+
if (!K(t)) return t;
|
|
138
|
+
const r = St(t);
|
|
139
|
+
let n = r ? t[r] ?? [] : [];
|
|
140
|
+
switch (w(n) || (n = [n]), r) {
|
|
141
|
+
case "if":
|
|
142
|
+
case "?:":
|
|
143
|
+
for (let o = 0; o < n.length - 1; o += 2)
|
|
144
|
+
if (await E(await l(n[o], e)))
|
|
145
|
+
return l(n[o + 1], e);
|
|
146
|
+
return n.length % 2 === 1 ? l(n[n.length - 1], e) : null;
|
|
147
|
+
case "and": {
|
|
148
|
+
let o = null;
|
|
149
|
+
for (const a of n)
|
|
150
|
+
if (o = await l(a, e), !await E(o))
|
|
151
|
+
return o;
|
|
152
|
+
return o;
|
|
153
|
+
}
|
|
154
|
+
case "or": {
|
|
155
|
+
let o = null;
|
|
156
|
+
for (const a of n)
|
|
157
|
+
if (o = await l(a, e), await E(o)) return o;
|
|
158
|
+
return o;
|
|
159
|
+
}
|
|
160
|
+
case "map": {
|
|
161
|
+
const o = await l(n[0], e);
|
|
162
|
+
return w(o) ? await Promise.all(o.map((a) => l(n[1], a))) : [];
|
|
163
|
+
}
|
|
164
|
+
case "filter": {
|
|
165
|
+
const o = await l(n[0], e);
|
|
166
|
+
return w(o) ? (await Promise.all(
|
|
167
|
+
o.map(async (u) => {
|
|
168
|
+
const h = await E(await l(n[1], u));
|
|
169
|
+
return { item: u, shouldInclude: h };
|
|
170
|
+
})
|
|
171
|
+
)).filter(({ shouldInclude: u }) => u).map(({ item: u }) => u) : [];
|
|
172
|
+
}
|
|
173
|
+
case "reduce": {
|
|
174
|
+
const o = await l(n[0], e);
|
|
175
|
+
if (!w(o))
|
|
176
|
+
return n.length > 2 ? await l(n[2], e) : null;
|
|
177
|
+
const a = n[1];
|
|
178
|
+
let h = n.length > 2 ? await l(n[2], e) : null;
|
|
179
|
+
for (const I of o)
|
|
180
|
+
h = await l(a, { current: I, accumulator: h });
|
|
181
|
+
return h;
|
|
182
|
+
}
|
|
183
|
+
case "all": {
|
|
184
|
+
const o = await l(n[0], e);
|
|
185
|
+
if (!w(o) || o.length === 0) return !1;
|
|
186
|
+
for (const a of o)
|
|
187
|
+
if (!await E(await l(n[1], a))) return !1;
|
|
188
|
+
return !0;
|
|
189
|
+
}
|
|
190
|
+
case "some": {
|
|
191
|
+
const o = await l(n[0], e);
|
|
192
|
+
if (!w(o)) return !1;
|
|
193
|
+
for (const a of o)
|
|
194
|
+
if (await E(await l(n[1], a))) return !0;
|
|
195
|
+
return !1;
|
|
196
|
+
}
|
|
197
|
+
case "none": {
|
|
198
|
+
const o = await l(n[0], e);
|
|
199
|
+
if (!w(o)) return !0;
|
|
200
|
+
for (const a of o)
|
|
201
|
+
if (await E(await l(n[1], a))) return !1;
|
|
202
|
+
return !0;
|
|
203
|
+
}
|
|
204
|
+
case "catch":
|
|
205
|
+
try {
|
|
206
|
+
return await l(n[0], e);
|
|
207
|
+
} catch (o) {
|
|
208
|
+
return K(o) ? await l(o, e) : n[1] ? await l(n[1], o) : o instanceof Error ? o.message : o;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const c = await Promise.all(n.map((o) => l(o, e))), i = r ? ht[r] : void 0;
|
|
212
|
+
if (!i) throw new Error(`Unrecognized operation ${r}`);
|
|
213
|
+
return i.apply(e, c);
|
|
214
|
+
}
|
|
215
|
+
async function E(t) {
|
|
216
|
+
return Z(t) ? E(await t) : !(Array.isArray(t) && t.length === 0) && !!t;
|
|
217
|
+
}
|
|
218
|
+
function St(t) {
|
|
219
|
+
return Object.keys(t)[0];
|
|
220
|
+
}
|
|
221
|
+
function $t(t) {
|
|
222
|
+
return !mt(t);
|
|
223
|
+
}
|
|
224
|
+
async function yt(t, e, r) {
|
|
225
|
+
const n = t.getStateSnapshot(), c = t.predicates.listStore.getState().reduce((a, u) => ({
|
|
226
|
+
...a,
|
|
227
|
+
[u.name]: () => u.predicate(n)
|
|
228
|
+
}), {}), i = t.features.listStore.getState().reduce((a, u) => ({
|
|
229
|
+
...a,
|
|
230
|
+
[u.id]: async () => {
|
|
231
|
+
const { bucket: h } = await u.getBucket();
|
|
232
|
+
return h;
|
|
233
|
+
}
|
|
234
|
+
}), {}), o = {
|
|
235
|
+
...r,
|
|
236
|
+
responses: t.responses.getAllStore.getState(),
|
|
237
|
+
location: typeof n.location == "object" ? {
|
|
238
|
+
hash: n.location.hash,
|
|
239
|
+
host: n.location.host,
|
|
240
|
+
hostname: n.location.hostname,
|
|
241
|
+
href: n.location.href,
|
|
242
|
+
origin: n.location.origin,
|
|
243
|
+
pathname: n.location.pathname,
|
|
244
|
+
port: n.location.port,
|
|
245
|
+
protocol: n.location.protocol,
|
|
246
|
+
search: n.location.search
|
|
247
|
+
} : void 0,
|
|
248
|
+
predicates: c,
|
|
249
|
+
features: i
|
|
250
|
+
};
|
|
251
|
+
return await l(e, o);
|
|
252
|
+
}
|
|
253
|
+
function wt(t) {
|
|
254
|
+
return !dt() || !Y() ? [] : Array.from(window.document.querySelectorAll(t)).filter(
|
|
255
|
+
(e) => e instanceof HTMLElement
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
function xt(t) {
|
|
259
|
+
if (!lt())
|
|
260
|
+
throw new Error("Shadow DOM is not supported in this environment");
|
|
261
|
+
return t.attachShadow({ mode: "open" });
|
|
262
|
+
}
|
|
263
|
+
function Ht() {
|
|
264
|
+
return new Promise((t, e) => {
|
|
265
|
+
if (!Y()) {
|
|
266
|
+
e();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
document.readyState !== "loading" ? t() : document.addEventListener("readystatechange", () => t(), { once: !0 });
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function It(t, e) {
|
|
273
|
+
const r = new MutationObserver((n) => {
|
|
274
|
+
document.contains(t) || (r.disconnect(), e());
|
|
275
|
+
});
|
|
276
|
+
r.observe(document.body, { childList: !0, subtree: !0 });
|
|
277
|
+
}
|
|
278
|
+
const tt = "picked-root", U = "picked-target";
|
|
279
|
+
function jt(t, e) {
|
|
280
|
+
return t.flatMap((r) => {
|
|
281
|
+
const n = wt(r.selector).filter(
|
|
282
|
+
(c) => !kt(c, e)
|
|
283
|
+
);
|
|
284
|
+
return {
|
|
285
|
+
...r,
|
|
286
|
+
elements: n
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function Ut(t) {
|
|
291
|
+
return t.flatMap((e) => e.elements.map((r) => Nt(r, e.placement)));
|
|
292
|
+
}
|
|
293
|
+
function Vt(t, e) {
|
|
294
|
+
t.classList.add(U), t.classList.add(`${U}-${e}`);
|
|
295
|
+
}
|
|
296
|
+
function kt(t, e) {
|
|
297
|
+
return t.classList.contains(`${U}-${e}`);
|
|
298
|
+
}
|
|
299
|
+
function qt(t) {
|
|
300
|
+
return t.classList.contains(tt);
|
|
301
|
+
}
|
|
302
|
+
function Et() {
|
|
303
|
+
const t = document.createElement("div");
|
|
304
|
+
return t.style.display = "block", t.classList.add(tt), t;
|
|
305
|
+
}
|
|
306
|
+
function Nt(t, e) {
|
|
307
|
+
let r;
|
|
308
|
+
const n = Et();
|
|
309
|
+
if (t instanceof Document)
|
|
310
|
+
r = t.body.appendChild(n);
|
|
311
|
+
else {
|
|
312
|
+
switch (e) {
|
|
313
|
+
case "replace":
|
|
314
|
+
t.replaceWith(n);
|
|
315
|
+
break;
|
|
316
|
+
case "before":
|
|
317
|
+
t.before(n);
|
|
318
|
+
break;
|
|
319
|
+
case "after":
|
|
320
|
+
t.after(n);
|
|
321
|
+
break;
|
|
322
|
+
case "prepend":
|
|
323
|
+
t.prepend(n);
|
|
324
|
+
break;
|
|
325
|
+
default:
|
|
326
|
+
t.append(n);
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
r = n;
|
|
330
|
+
}
|
|
331
|
+
return r;
|
|
332
|
+
}
|
|
333
|
+
function bt(t) {
|
|
334
|
+
return t.type === "conditional";
|
|
335
|
+
}
|
|
336
|
+
function D(t) {
|
|
337
|
+
return t.type === "step";
|
|
338
|
+
}
|
|
339
|
+
function vt(t) {
|
|
340
|
+
return t.type === "experience";
|
|
341
|
+
}
|
|
342
|
+
function W(t) {
|
|
343
|
+
return t.type === "origin";
|
|
344
|
+
}
|
|
345
|
+
const et = (t, e, r, n, c = /* @__PURE__ */ new Set()) => c.has(r.id) ? [] : (c.add(r.id), D(r) && !n ? [r] : e.filter((o) => o.sourceNodeId === r.id).flatMap((o) => {
|
|
346
|
+
const a = t.find((u) => u.id === o.destinationNodeId);
|
|
347
|
+
return a ? et(t, e, a, !1, c) : [];
|
|
348
|
+
})), At = (t, e, r) => et(t, e, r, !0, /* @__PURE__ */ new Set()), nt = (t, e, r, n, c = /* @__PURE__ */ new Set()) => {
|
|
349
|
+
if (c.has(r.id)) return [-1, -1];
|
|
350
|
+
c.add(r.id);
|
|
351
|
+
const i = e.filter((u) => u.sourceNodeId === r.id);
|
|
352
|
+
if (i.length === 0) return [0, 0];
|
|
353
|
+
let o = 1 / 0, a = -1 / 0;
|
|
354
|
+
for (const u of i) {
|
|
355
|
+
const h = t.find((k) => k.id === u.destinationNodeId);
|
|
356
|
+
if (!h) continue;
|
|
357
|
+
const [I, y] = nt(
|
|
358
|
+
t,
|
|
359
|
+
e,
|
|
360
|
+
h,
|
|
361
|
+
!1,
|
|
362
|
+
new Set(c)
|
|
363
|
+
);
|
|
364
|
+
I !== -1 && (o = Math.min(o, I + 1), a = Math.max(a, y + 1));
|
|
365
|
+
}
|
|
366
|
+
return o === 1 / 0 ? [-1, -1] : [o, a];
|
|
367
|
+
}, Ft = (t, e, r) => nt(t, e, r, !0, /* @__PURE__ */ new Set()), rt = (t, e, r, n = /* @__PURE__ */ new Set()) => {
|
|
368
|
+
if (n.has(r.id)) return [-1, -1];
|
|
369
|
+
if (n.add(r.id), r.type === "origin") return [0, 0];
|
|
370
|
+
const c = e.filter((a) => a.destinationNodeId === r.id);
|
|
371
|
+
if (c.length === 0) return [-1, -1];
|
|
372
|
+
let i = 1 / 0, o = -1 / 0;
|
|
373
|
+
for (const a of c) {
|
|
374
|
+
const u = t.find((y) => y.id === a.sourceNodeId);
|
|
375
|
+
if (!u) continue;
|
|
376
|
+
const [h, I] = rt(
|
|
377
|
+
t,
|
|
378
|
+
e,
|
|
379
|
+
u,
|
|
380
|
+
new Set(n)
|
|
381
|
+
);
|
|
382
|
+
h !== -1 && (i = Math.min(i, h + 1), o = Math.max(o, I + 1));
|
|
383
|
+
}
|
|
384
|
+
return i === 1 / 0 ? [-1, -1] : [i, o];
|
|
385
|
+
}, _t = (t, e, r) => rt(t, e, r, /* @__PURE__ */ new Set()), ot = (t) => t.find((r) => r.type === "origin") || null, j = (t, e, r) => {
|
|
386
|
+
if (!t)
|
|
387
|
+
return ot(e);
|
|
388
|
+
const n = r.find((i) => i.sourceNodeId === t.id);
|
|
389
|
+
if (!n)
|
|
390
|
+
return null;
|
|
391
|
+
const c = e.find((i) => i.id === n.destinationNodeId);
|
|
392
|
+
return c || null;
|
|
393
|
+
};
|
|
394
|
+
async function Bt(t, e, r, n) {
|
|
395
|
+
const c = t ? "true" : "false", i = n.find(
|
|
396
|
+
(o) => o.sourceNodeHandle === c && o.sourceNodeId === e
|
|
397
|
+
);
|
|
398
|
+
return r.find((o) => o.id === (i == null ? void 0 : i.destinationNodeId));
|
|
399
|
+
}
|
|
400
|
+
const V = ft("experience-instance"), Mt = Q(
|
|
401
|
+
({
|
|
402
|
+
client: t,
|
|
403
|
+
experience: e,
|
|
404
|
+
target: r
|
|
405
|
+
}) => {
|
|
406
|
+
const n = b(), c = b(), i = b(), o = b(), a = e.componentStore, u = V.store("transitioning"), h = t.history.entriesStore.map((s) => s.filter((p) => p.experienceId === e.id)), I = h.map((s) => s.filter((p) => D(p.node))), y = h.map((s) => {
|
|
407
|
+
var p;
|
|
408
|
+
return ((p = s[s.length - 1]) == null ? void 0 : p.node) || null;
|
|
409
|
+
}), k = O(
|
|
410
|
+
e.treeStore,
|
|
411
|
+
y,
|
|
412
|
+
({ steps: s }, p) => s.find((m) => p && D(p) && m.id === p.stepId) || null
|
|
413
|
+
), R = O(
|
|
414
|
+
e.treeStore,
|
|
415
|
+
y,
|
|
416
|
+
({ nodes: s, edges: p }, m) => m ? At(s, p, m) : []
|
|
417
|
+
), f = O(
|
|
418
|
+
e.treeStore,
|
|
419
|
+
y,
|
|
420
|
+
({ nodes: s, edges: p }, m) => m ? _t(s, p, m) : [-1, -1]
|
|
421
|
+
), g = O(
|
|
422
|
+
e.treeStore,
|
|
423
|
+
y,
|
|
424
|
+
({ nodes: s, edges: p }, m) => m ? Ft(s, p, m) : [-1, -1]
|
|
425
|
+
), x = V.store(!0), N = J(x, {
|
|
426
|
+
open: () => !0,
|
|
427
|
+
close: () => !1,
|
|
428
|
+
toggle: (s) => !s,
|
|
429
|
+
set: (s, p) => p
|
|
430
|
+
});
|
|
431
|
+
S({
|
|
432
|
+
source: x,
|
|
433
|
+
filter: Boolean,
|
|
434
|
+
target: t.eventBus.prepend(() => ({
|
|
435
|
+
type: "experience_open",
|
|
436
|
+
experience: e
|
|
437
|
+
}))
|
|
438
|
+
}), S({
|
|
439
|
+
source: x,
|
|
440
|
+
filter: (s) => !s,
|
|
441
|
+
target: t.eventBus.prepend(() => ({
|
|
442
|
+
type: "experience_close",
|
|
443
|
+
experience: e
|
|
444
|
+
}))
|
|
445
|
+
});
|
|
446
|
+
const F = v(async () => {
|
|
447
|
+
t.history.back({ experienceId: e.id });
|
|
448
|
+
}), M = A({
|
|
449
|
+
source: e.treeStore,
|
|
450
|
+
effect: async (s, p) => {
|
|
451
|
+
const m = s.nodes.find((_) => D(_) && _.stepId === p);
|
|
452
|
+
m && t.history.push({ experienceId: e.id, node: m });
|
|
453
|
+
}
|
|
454
|
+
}), q = A({
|
|
455
|
+
source: y,
|
|
456
|
+
effect: (s) => {
|
|
457
|
+
}
|
|
458
|
+
}), C = A({
|
|
459
|
+
source: e.treeStore,
|
|
460
|
+
effect: async ({ nodes: s }) => ot(s)
|
|
461
|
+
}), $ = A({
|
|
462
|
+
source: e.treeStore,
|
|
463
|
+
effect: async ({ nodes: s, edges: p }, m) => j(m, s, p)
|
|
464
|
+
}), H = A({
|
|
465
|
+
source: e.treeStore,
|
|
466
|
+
effect: async ({ nodes: s, edges: p, conditionals: m }, _) => {
|
|
467
|
+
if (!_)
|
|
468
|
+
return;
|
|
469
|
+
const G = m.find((ut) => ut.id === _.conditionalId);
|
|
470
|
+
if (!G)
|
|
471
|
+
return;
|
|
472
|
+
const ct = _.id, at = await yt(t, G.condition);
|
|
473
|
+
return Bt(!!at, ct, s, p);
|
|
474
|
+
}
|
|
475
|
+
}), st = v((s) => {
|
|
476
|
+
if (s)
|
|
477
|
+
return t.launchExperienceById(s.experienceId);
|
|
478
|
+
}), z = A({
|
|
479
|
+
source: [y, e.treeStore],
|
|
480
|
+
effect: async ([s, { nodes: p, edges: m }]) => j(s, p, m)
|
|
481
|
+
}), L = A({
|
|
482
|
+
source: [y, e.treeStore],
|
|
483
|
+
effect: async ([s, { nodes: p, edges: m }]) => j(s, p, m)
|
|
484
|
+
}), it = v((s) => {
|
|
485
|
+
t.history.push({ experienceId: e.id, node: s });
|
|
486
|
+
});
|
|
487
|
+
return pt({
|
|
488
|
+
source: y,
|
|
489
|
+
match: (s) => s ? bt(s) ? "condition" : D(s) ? "step" : vt(s) ? "launchExperience" : W(s) ? "origin" : "other" : "none",
|
|
490
|
+
cases: {
|
|
491
|
+
none: C,
|
|
492
|
+
origin: $,
|
|
493
|
+
condition: H,
|
|
494
|
+
step: q,
|
|
495
|
+
launchExperience: st,
|
|
496
|
+
__: b()
|
|
497
|
+
}
|
|
498
|
+
}), S({
|
|
499
|
+
clock: [
|
|
500
|
+
H.doneData,
|
|
501
|
+
$.doneData,
|
|
502
|
+
C.doneData,
|
|
503
|
+
L.doneData,
|
|
504
|
+
z.doneData
|
|
505
|
+
],
|
|
506
|
+
filter: Boolean,
|
|
507
|
+
target: it
|
|
508
|
+
}), S({
|
|
509
|
+
clock: c,
|
|
510
|
+
target: L
|
|
511
|
+
}), S({
|
|
512
|
+
clock: c,
|
|
513
|
+
source: k,
|
|
514
|
+
target: t.eventBus.prepend((s) => ({
|
|
515
|
+
type: "step_submit",
|
|
516
|
+
step: s ?? void 0,
|
|
517
|
+
experience: e
|
|
518
|
+
}))
|
|
519
|
+
}), S({
|
|
520
|
+
clock: L.done,
|
|
521
|
+
source: k,
|
|
522
|
+
target: t.eventBus.prepend((s) => ({
|
|
523
|
+
type: "step_submit_success",
|
|
524
|
+
step: s ?? void 0,
|
|
525
|
+
experience: e
|
|
526
|
+
}))
|
|
527
|
+
}), S({
|
|
528
|
+
clock: L.fail,
|
|
529
|
+
source: k,
|
|
530
|
+
target: t.eventBus.prepend((s) => ({
|
|
531
|
+
type: "step_submit_error",
|
|
532
|
+
step: s ?? void 0,
|
|
533
|
+
experience: e
|
|
534
|
+
}))
|
|
535
|
+
}), S({
|
|
536
|
+
clock: i,
|
|
537
|
+
target: F
|
|
538
|
+
}), S({
|
|
539
|
+
clock: i,
|
|
540
|
+
source: k,
|
|
541
|
+
target: t.eventBus.prepend((s) => ({
|
|
542
|
+
type: "step_submit",
|
|
543
|
+
step: s ?? void 0,
|
|
544
|
+
experience: e
|
|
545
|
+
}))
|
|
546
|
+
}), S({ clock: o, target: M }), S({
|
|
547
|
+
source: O([
|
|
548
|
+
H.pending,
|
|
549
|
+
$.pending,
|
|
550
|
+
C.pending,
|
|
551
|
+
L.pending
|
|
552
|
+
]),
|
|
553
|
+
fn: (s) => s.some(Boolean) ? "transitioning" : "ready",
|
|
554
|
+
target: u
|
|
555
|
+
}), S({
|
|
556
|
+
clock: q.doneData,
|
|
557
|
+
source: k,
|
|
558
|
+
target: t.eventBus.prepend((s) => ({
|
|
559
|
+
type: "step_enter",
|
|
560
|
+
step: s ?? void 0,
|
|
561
|
+
experience: e
|
|
562
|
+
}))
|
|
563
|
+
}), S({
|
|
564
|
+
source: y,
|
|
565
|
+
clock: n,
|
|
566
|
+
filter: (s) => s ? W(s) : !0,
|
|
567
|
+
target: z
|
|
568
|
+
}), n(), {
|
|
569
|
+
// config
|
|
570
|
+
experienceId: e.id,
|
|
571
|
+
configStore: e.configStore,
|
|
572
|
+
target: r,
|
|
573
|
+
componentStore: a,
|
|
574
|
+
// state
|
|
575
|
+
stateStore: u,
|
|
576
|
+
// open close
|
|
577
|
+
isOpenStore: x,
|
|
578
|
+
open: N.open,
|
|
579
|
+
close: N.close,
|
|
580
|
+
toggleOpen: N.toggle,
|
|
581
|
+
setOpen: N.set,
|
|
582
|
+
// nodes
|
|
583
|
+
treeStore: e.treeStore,
|
|
584
|
+
currentNodeStore: y,
|
|
585
|
+
currentStepStore: k,
|
|
586
|
+
nextReachableStepNodesStore: R,
|
|
587
|
+
stepsToOriginStore: f,
|
|
588
|
+
stepsToLeafStore: g,
|
|
589
|
+
// history
|
|
590
|
+
goToNextStep: c,
|
|
591
|
+
goToPreviousStep: i,
|
|
592
|
+
goToStepById: o,
|
|
593
|
+
stepsHistoryStore: I
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
);
|
|
597
|
+
function Lt(t) {
|
|
598
|
+
return X(Mt, t);
|
|
599
|
+
}
|
|
600
|
+
const Ot = Q(({ client: t }) => {
|
|
601
|
+
const e = V.store({}), r = b(), n = b(), c = b(), i = J(e, {
|
|
602
|
+
register(f, g) {
|
|
603
|
+
const x = [
|
|
604
|
+
...f[g.experienceId] ?? []
|
|
605
|
+
];
|
|
606
|
+
return x.push(g), {
|
|
607
|
+
...f,
|
|
608
|
+
[g.experienceId]: x
|
|
609
|
+
};
|
|
610
|
+
},
|
|
611
|
+
unregister(f, g) {
|
|
612
|
+
var F;
|
|
613
|
+
const x = g.experienceId, N = (F = f[x]) == null ? void 0 : F.filter(
|
|
614
|
+
(M) => M !== g
|
|
615
|
+
);
|
|
616
|
+
return {
|
|
617
|
+
...f,
|
|
618
|
+
[x]: N ?? []
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
}), o = v(
|
|
622
|
+
({ experience: f, target: g }) => Lt({ client: t, experience: f, target: g })
|
|
623
|
+
), a = v((f) => {
|
|
624
|
+
i.register(f);
|
|
625
|
+
}), u = v(
|
|
626
|
+
(f) => {
|
|
627
|
+
f.target && It(f.target, () => {
|
|
628
|
+
c(f);
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
), h = v((f) => {
|
|
632
|
+
i.unregister(f);
|
|
633
|
+
}), I = v((f) => {
|
|
634
|
+
const g = f.componentStore.getState();
|
|
635
|
+
if (!g) {
|
|
636
|
+
P("warn", "No app component registered. Skipping init.");
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
const x = g.frameworkStore.getState();
|
|
640
|
+
if (!x) {
|
|
641
|
+
P(
|
|
642
|
+
"error",
|
|
643
|
+
`No framework registered for component '${g.name}'. Skipping rendering.`
|
|
644
|
+
);
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const N = f.target;
|
|
648
|
+
if (!N) {
|
|
649
|
+
P(
|
|
650
|
+
"error",
|
|
651
|
+
`No target element registered for experience '${f.experienceId}'. Skipping rendering.`
|
|
652
|
+
);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
const F = xt(N);
|
|
656
|
+
try {
|
|
657
|
+
x.render(F, g.component, t, f);
|
|
658
|
+
} catch (M) {
|
|
659
|
+
P("error", M);
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
S({
|
|
663
|
+
clock: r,
|
|
664
|
+
target: o
|
|
665
|
+
}), S({
|
|
666
|
+
clock: c,
|
|
667
|
+
target: h
|
|
668
|
+
}), S({
|
|
669
|
+
clock: o.doneData,
|
|
670
|
+
target: [
|
|
671
|
+
a,
|
|
672
|
+
u,
|
|
673
|
+
n
|
|
674
|
+
]
|
|
675
|
+
}), S({
|
|
676
|
+
clock: o.doneData,
|
|
677
|
+
target: t.eventBus.prepend((f) => ({
|
|
678
|
+
type: "experience_initialized",
|
|
679
|
+
experienceInstance: f
|
|
680
|
+
}))
|
|
681
|
+
}), S({
|
|
682
|
+
clock: n,
|
|
683
|
+
target: I
|
|
684
|
+
});
|
|
685
|
+
function y(f, g) {
|
|
686
|
+
r({ experience: f, target: g });
|
|
687
|
+
}
|
|
688
|
+
const k = e.map((f) => Object.values(f).flat());
|
|
689
|
+
function R(f) {
|
|
690
|
+
return e.map((g) => g[f] || [], { skipVoid: !1 });
|
|
691
|
+
}
|
|
692
|
+
return {
|
|
693
|
+
spawn: y,
|
|
694
|
+
getByExperienceId: R,
|
|
695
|
+
listStore: k
|
|
696
|
+
};
|
|
697
|
+
});
|
|
698
|
+
function zt(t) {
|
|
699
|
+
return X(Ot, t);
|
|
700
|
+
}
|
|
701
|
+
export {
|
|
702
|
+
D as a,
|
|
703
|
+
zt as b,
|
|
704
|
+
Ut as c,
|
|
705
|
+
Ht as d,
|
|
706
|
+
yt as e,
|
|
707
|
+
qt as f,
|
|
708
|
+
jt as g,
|
|
709
|
+
Lt as h,
|
|
710
|
+
$t as i,
|
|
711
|
+
Vt as t
|
|
712
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e={};let n=0;const r=t=>(e[t]||(e[t]=`${(n++).toString(36)}`),`${e[t]}:${(n++).toString(36)}`);exports.generateId=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=(r,...g)=>{};exports.logger=e;
|