/**
* SCSS template for persistence block editor and frontend styles.
*
* @remarks Consumed by `buildPersistenceArtifacts()` with
* `{{cssClassName}}` and `{{frontendCssClassName}}` scaffold placeholders.
*/
export declare const PERSISTENCE_STYLE_TEMPLATE = ".{{cssClassName}} {\n\tborder: 1px solid #dcdcde;\n\tborder-radius: 12px;\n\tpadding: 16px;\n\tbackground: #fff;\n\n\t&__meta {\n\t\tcolor: #50575e;\n\t\tfont-size: 13px;\n\t\tmargin: 8px 0 0;\n\t}\n}\n\n.{{frontendCssClassName}} {\n\tdisplay: grid;\n\tgap: 12px;\n\tborder: 1px solid #dcdcde;\n\tborder-radius: 12px;\n\tpadding: 16px;\n\tbackground: #f6f7f7;\n\n\t&__count {\n\t\tdisplay: inline-flex;\n\t\tmin-width: 3rem;\n\t\tjustify-content: center;\n\t\tfont-weight: 700;\n\t}\n\n\t&__notice,\n\t&__error {\n\t\tmargin: 0;\n\t\tfont-size: 13px;\n\t}\n\n\t&__notice {\n\t\tcolor: #50575e;\n\t}\n\n\t&__error {\n\t\tcolor: #b32d2e;\n\t}\n\n\tbutton {\n\t\twidth: fit-content;\n\t}\n}\n";
/**
* Main PHP `render.php` template for the persistence block.
*
* @remarks Consumed by `buildPersistenceArtifacts()` with scaffold
* placeholders for block identity, namespace, text domain, storage mode,
* persistence policy, and frontend CSS class names.
*/
export declare const PERSISTENCE_RENDER_TEMPLATE = "apply_defaults( is_array( $attributes ) ? $attributes : array() );\n$validation = $validator->validate( $normalized );\n// Preserve the former implicit default only for legacy blocks that omit the key.\n// Explicitly stored empty keys remain invalid.\n$resource_key = array_key_exists( 'resourceKey', $normalized ) ? (string) $normalized['resourceKey'] : 'primary';\n\nif ( empty( $validation['valid'] ) || '' === $resource_key ) {\n\treturn '';\n}\n\n$alignment = isset( $normalized['alignment'] ) ? (string) $normalized['alignment'] : 'left';\n$button_label = isset( $normalized['buttonLabel'] ) ? (string) $normalized['buttonLabel'] : 'Persist Count';\n$content = isset( $normalized['content'] ) ? (string) $normalized['content'] : '';\n$post_id = is_object( $block ) && isset( $block->context['postId'] )\n\t? (int) $block->context['postId']\n\t: (int) get_queried_object_id();\n$storage_mode = '{{dataStorageMode}}';\n$persistence_policy = '{{persistencePolicy}}';\n\n{{phpPrefix}}_record_rendered_block_instance(\n\t(int) $post_id,\n\t'{{namespace}}/{{slugKebabCase}}',\n\t$resource_key\n);\n\n$notice_message = 'authenticated' === $persistence_policy\n\t? __( 'Sign in to persist this counter.', '{{textDomain}}' )\n\t: __( 'Public writes are temporarily unavailable.', '{{textDomain}}' );\n$context = array(\n\t'bootstrapReady' => false,\n\t'buttonLabel' => $button_label,\n\t'canWrite' => false,\n\t'client' => array(\n\t\t'writeExpiry' => 0,\n\t\t'writeNonce' => '',\n\t\t'writeToken' => '',\n\t),\n\t'count' => 0,\n\t'error' => '',\n\t'isBootstrapping' => false,\n\t'isLoading' => false,\n\t'isSaving' => false,\n\t'isVisible' => ! empty( $normalized['isVisible'] ),\n\t'persistencePolicy' => $persistence_policy,\n\t'postId' => (int) $post_id,\n\t'resourceKey' => $resource_key,\n\t'storage' => $storage_mode,\n);\n\n$wrapper_attributes = get_block_wrapper_attributes(\n\tarray(\n\t\t'data-wp-context' => wp_json_encode( $context ),\n\t\t'data-wp-interactive' => '{{slugKebabCase}}',\n\t\t'data-wp-init' => 'callbacks.init',\n\t\t'data-wp-run--mounted' => 'callbacks.mounted',\n\t)\n);\n?>\n\n
>\n\t
\n\t\t
\">\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\n\t\t\t
\n\t\t\t\t0\n\t\t\t\n\t\t\n\t\t
\n\t
\n
\n";
/**
* PHP helper template for persistence alternate render targets.
*
* @remarks Consumed by `buildPersistenceArtifacts()` for email, MJML,
* plain-text, and web render entries with block identity, namespace, text
* domain, storage, policy, frontend class, and title placeholders.
*/
export declare const PERSISTENCE_RENDER_TARGETS_TEMPLATE = "apply_defaults( is_array( $attributes ) ? $attributes : array() );\n\t\t$validation = $validator->validate( $normalized );\n\t\t// Preserve the former implicit default only for legacy blocks that omit the key.\n\t\t// Explicitly stored empty keys remain invalid.\n\t\t$resource_key = array_key_exists( 'resourceKey', $normalized ) ? (string) $normalized['resourceKey'] : 'primary';\n\n\t\tif ( empty( $validation['valid'] ) || '' === $resource_key ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$alignment = isset( $normalized['alignment'] ) ? (string) $normalized['alignment'] : 'left';\n\t\t$button_label = isset( $normalized['buttonLabel'] ) ? (string) $normalized['buttonLabel'] : 'Persist Count';\n\t\t$rendered_content = isset( $normalized['content'] ) ? (string) $normalized['content'] : '';\n\t\t$post_id = is_object( $block ) && isset( $block->context['postId'] )\n\t\t\t? (int) $block->context['postId']\n\t\t\t: (int) get_queried_object_id();\n\t\t$storage_mode = '{{dataStorageMode}}';\n\t\t$persistence_policy = '{{persistencePolicy}}';\n\n\t\t{{phpPrefix}}_record_rendered_block_instance(\n\t\t\t(int) $post_id,\n\t\t\t'{{namespace}}/{{slugKebabCase}}',\n\t\t\t$resource_key\n\t\t);\n\n\t\t$notice_message = 'authenticated' === $persistence_policy\n\t\t\t? __( 'Sign in to persist this counter.', '{{textDomain}}' )\n\t\t\t: __( 'Public writes are temporarily unavailable.', '{{textDomain}}' );\n\t\t$web_context = array(\n\t\t\t'bootstrapReady' => false,\n\t\t\t'buttonLabel' => $button_label,\n\t\t\t'canWrite' => false,\n\t\t\t'client' => array(\n\t\t\t\t'writeExpiry' => 0,\n\t\t\t\t'writeNonce' => '',\n\t\t\t\t'writeToken' => '',\n\t\t\t),\n\t\t\t'count' => 0,\n\t\t\t'error' => '',\n\t\t\t'isBootstrapping' => false,\n\t\t\t'isLoading' => false,\n\t\t\t'isSaving' => false,\n\t\t\t'isVisible' => ! empty( $normalized['isVisible'] ),\n\t\t\t'persistencePolicy' => $persistence_policy,\n\t\t\t'postId' => (int) $post_id,\n\t\t\t'resourceKey' => $resource_key,\n\t\t\t'storage' => $storage_mode,\n\t\t);\n\n\t\treturn array(\n\t\t\t'alignment' => $alignment,\n\t\t\t'buttonLabel' => $button_label,\n\t\t\t'content' => $rendered_content,\n\t\t\t'frontendClassName' => '{{frontendCssClassName}}',\n\t\t\t'isVisible' => ! empty( $normalized['isVisible'] ),\n\t\t\t'normalized' => $normalized,\n\t\t\t'noticeMessage' => $notice_message,\n\t\t\t'postId' => (int) $post_id,\n\t\t\t'resourceKey' => $resource_key,\n\t\t\t'showCount' => ! empty( $normalized['showCount'] ),\n\t\t\t'title' => {{titleJson}},\n\t\t\t'webContext' => $web_context,\n\t\t);\n\t}\n}\n\nif ( ! function_exists( '{{phpPrefix}}_{{slugSnakeCase}}_render_target' ) ) {\n\tfunction {{phpPrefix}}_{{slugSnakeCase}}_render_target( string $target, $attributes, $content = '', $block = null ): string {\n\t\t$context = {{phpPrefix}}_{{slugSnakeCase}}_build_render_context( $attributes, $content, $block );\n\t\tif ( null === $context || empty( $context['isVisible'] ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$target_context = apply_filters(\n\t\t\t'{{phpPrefix}}_{{slugSnakeCase}}_render_target_context',\n\t\t\t$context,\n\t\t\t$target,\n\t\t\t$attributes,\n\t\t\t$block\n\t\t);\n\n\t\t$markup = '';\n\t\tswitch ( $target ) {\n\t\t\tcase 'email':\n\t\t\t\t$parts = array(\n\t\t\t\t\t'',\n\t\t\t\t\t'
' . esc_html( $target_context['content'] ) . '
',\n\t\t\t\t);\n\t\t\t\tif ( ! empty( $target_context['showCount'] ) ) {\n\t\t\t\t\t$parts[] = '
' . esc_html__( 'Count', '{{textDomain}}' ) . ': ' . esc_html( (string) $target_context['webContext']['count'] ) . '
';\n\t\t\t\t}\n\t\t\t\t$parts[] = '
' . esc_html( $target_context['noticeMessage'] ) . '
';\n\t\t\t\t$parts[] = '
';\n\t\t\t\t$markup = implode( '', $parts );\n\t\t\t\tbreak;\n\t\t\tcase 'mjml':\n\t\t\t\t$markup = '' . esc_html( $target_context['content'] ) . '';\n\t\t\t\tif ( ! empty( $target_context['showCount'] ) ) {\n\t\t\t\t\t$markup .= '' . esc_html__( 'Count', '{{textDomain}}' ) . ': ' . esc_html( (string) $target_context['webContext']['count'] ) . '';\n\t\t\t\t}\n\t\t\t\t$markup .= '' . esc_html( $target_context['noticeMessage'] ) . '';\n\t\t\t\tbreak;\n\t\t\tcase 'plain-text':\n\t\t\t\t$markup = implode(\n\t\t\t\t\t\"\\n\",\n\t\t\t\t\tarray_filter(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t$target_context['title'],\n\t\t\t\t\t\t\t$target_context['content'],\n\t\t\t\t\t\t\t! empty( $target_context['showCount'] )\n\t\t\t\t\t\t\t\t? sprintf( '%s: %s', __( 'Count', '{{textDomain}}' ), (string) $target_context['webContext']['count'] )\n\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\t$target_context['noticeMessage'],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tstatic fn( $value ) => is_string( $value ) && '' !== $value\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'web':\n\t\t\tdefault:\n\t\t\t\t$wrapper_attributes = get_block_wrapper_attributes(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'data-wp-context' => wp_json_encode( $target_context['webContext'] ),\n\t\t\t\t\t\t'data-wp-interactive' => '{{slugKebabCase}}',\n\t\t\t\t\t\t'data-wp-init' => 'callbacks.init',\n\t\t\t\t\t\t'data-wp-run--mounted' => 'callbacks.mounted',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tob_start();\n\t\t\t\t?>\n>\n\t
\n\t\t
\">\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\n\t\t\t
\n\t\t\t\t0\n\t\t\t\n\t\t\n\t\t
\n\t
\n
\n\t\t\t\t