-- =============================================================================
-- fix_mystateconnews_subscribe.sql — mystateCONnews, 17 Nov 2026.
--
-- The site's contact email (contact@mystateconnews.com, shown in the footer);
-- a Subscribe section on the front page and on every statewide edition,
-- where readers leave an email, a phone number or both, for the whole
-- country or chosen states; the footer links regrouped into three even
-- columns (Publication, Notices, Platform) with "Subscribe to Notices".
-- The front page headline types on paper from the vintage typewriter with
-- a "Place a Notice" box on the right; inner page headlines get a
-- "Today's Edition" box on the right. The comic (Section E) becomes "The CON
-- Application Nightmare: The Paper Chase", five new panels.
--
-- Edit-safe: every UPDATE only touches a row that still holds exactly what
-- the previous release wrote (MD5 of the stored JSON or the exact text).
-- The contact email is only filled where Aggie has none. New rows (the
-- subscribe form and its fields, the footer link) are inserted by
-- seed_mystateconnews_site.sql first.
--
-- GENERATED from the site content by a script. Idempotent.
-- =============================================================================

SET NAMES utf8mb4;
SET @site_id := (SELECT id FROM dim_web_sites WHERE public_site_key = 'YPIYmVgmODxVTxgcSNwb1yAKdCtFe1M9kGT5YnTxEkL3xxs9' LIMIT 1);

-- Contact email
UPDATE dim_web_sites SET contact_email = 'contact@mystateconnews.com'
WHERE id = @site_id AND (contact_email IS NULL OR contact_email = '');

-- Site theme (banners, masthead tagline, footer, notice-page labels, state page template)
UPDATE dim_web_sites SET theme_json = '{"siteUrl":"https://mystateconnews.com","defaultTitle":"mystateCONnews, Certificate of Need Legal Publication","bannerHtml":"","bannerBySlug":{"ops-login":"<strong>Operations:</strong> Submissions, requests and notices are managed in the Aggie workspace."},"logoUrl":"","mastheadSlugs":["home"],"mastheadTagline":"The nationwide digital newspaper of record for legal advertisement of certificate of need notices.","mastheadTaglineByState":{},"editionEpoch":"2026-11-12","mastheadIssueLabel":"No. {n}","volumeLabel":"Edition No. {n}","mastheadCenterLabel":"Certificate of Need Legal Publication","mastheadEditionLabel":"Daily Edition","mastheadEditionByState":{},"stateEditionLabel":"{name} Statewide Edition","stateMastheadTagline":"","stateTickerText":"{name} Certificate of Need notices, numbered and timestamped as they are published.","stateCssScope":"index","tickerLabel":"Latest Notices","tickerText":"Certificate of Need legal notices for every state and territory, numbered and timestamped as they are published.","navCtaLabel":"Submit a Notice","navCtaHref":"/submit","statePickerHref":"/states","statePickerAllLabel":"All states & territories","stateSearchPlaceholder":"Search states and territories…","statesCollection":"states","footerBrandText":"The nationwide digital newspaper of record for legal advertisement of certificate of need notices.","footerDisclaimerHtml":"Notices are published as submitted by the applicant after review by our team. Certificate of Need publication requirements vary by state; applicants are responsible for confirming the requirements that apply to their filing.","footerBottomLeft":"© 2026 mystateCONnews","footerBottomRight":"Certificate of Need legal notices · Every state and territory","minimalChromeSlugs":["customer-login","ops-login"],"minimalFooterBySlug":{"customer-login":"<a href=\\"/\\">mystateCONnews</a> | Customer Portal","ops-login":"<a href=\\"/\\">mystateCONnews</a> | Operations Portal"},"noticeDetail":{"breadcrumbHome":"Home","breadcrumbDirectory":"Search for CONs","sampleBanner":"SAMPLE NOTICE, PROTOTYPE ONLY, This is not a real published CON notice","publishedLabel":"Published","scheduledLabel":"Scheduled","organizationLabel":"Organization","stateLabel":"State","countyLabel":"County","zipLabel":"ZIP Code","facilityLabel":"Facility Type","projectTypeLabel":"Project Type","publicationDateLabel":"Publication Date","scheduledDateLabel":"Scheduled Publication Date","statusLabel":"Status","noticeTextHeading":"Notice Text","affidavitBadge":"SAMPLE, NOT LEGALLY VALID","affidavitHeading":"Affidavit of Publication","affidavitHtml":"A sample affidavit of publication record is available for download. This document is <strong>not legally valid</strong>, it is a demonstration of the proposed affidavit format only.","affidavitButton":"Download Sample Affidavit","affidavitAlert":"Sample affidavit download, Prototype only. No real affidavit has been issued. This is not a legally valid document.","affidavitLabel":"Affidavit","affidavitStatusDefault":"Sample Only","affidavitStatusReal":"After final run","affidavitRealHtml":"A signed affidavit of publication is issued after this notice''s final publication run.","affidavitRequestLabel":"Request the Affidavit","affidavitRequestHref":"/affidavit-request","noticeNumberLabel":"Notice No.","runDatesLabel":"Publication Runs","statusCardHeading":"Notice Status","submitCardHeading":"Submit Your Own Notice","submitCardText":"Need to publish a Certificate of Need notice? Start your submission today.","submitCardLabel":"Start Your Notice","submitCardHref":"/submit","disclaimerHeading":"About This Notice","disclaimerText":"This is a sample notice in a prototype system. No real CON notice has been published. This notice is not legally valid for any regulatory purpose. Verify all requirements with your attorney and SCDHEC before filing a Certificate of Need application.","disclaimerTextReal":"This notice is published as submitted by the applicant. Questions about the application should be directed to the applicant or the state agency reviewing it.","timestampLabel":"Published (timestamp)","editionLabel":"Edition","moreHeading":"More Notices","moreLabel":"Back to Search for CONs"},"stateTemplate":{"open":[{"id":"st-con","type":"flatList","children":[],"props":{"variant":"state-con","look":"broadsheet","tone":"alt","collectionKey":"states","stateCode":"{code}","eyebrow":"{name} Regulations","heading":"Certificate of Need in {name}","description":"What {name} requires, and what its rules say about the public notice.","labels":{"status":{"none":"Currently no certificate of need program"},"lastSearched":"Last searched","sources":"Sources"}}},{"id":"st-notices","type":"flatList","children":[],"props":{"variant":"state-notices","look":"broadsheet","ruleBefore":"thick","collectionKey":"notices","stateCode":"{code}","eyebrow":"{name} Statewide Edition","heading":"{name} Certificate of Need Notices","description":"Every notice published for {name}, newest first, with its notice number and publication timestamp.","emptyText":"No notices have been published for {name} yet. Submit the first one.","ctaLabel":"Submit a {name} Notice","ctaHref":"/submit?state={slug}","ctaIcon":"pen"}},{"id":"st-subscribe","type":"formEmbed","children":[],"props":{"variant":"subscribe","look":"broadsheet","ruleBefore":"thick","formKey":"subscribe","eyebrow":"Subscribe","submitLabel":"Subscribe","noteHtml":"We use your email or phone only to send new notices. Text alerts: message and data rates may apply; reply STOP to stop. To unsubscribe by email, write to <a href=\\"mailto:contact@mystateconnews.com\\">contact@mystateconnews.com</a>.","anchor":"subscribe","stateName":"{name}","heading":"Get {name} Notices as They Are Published","description":"Leave an email address, a phone number, or both. {name} is ticked; add more states or choose the whole country.","successText":"You are subscribed. New Certificate of Need notices will come to you as they are published.","source":"{name} Statewide Edition"}}],"soon":[{"id":"st-con","type":"flatList","children":[],"props":{"variant":"state-con","look":"broadsheet","tone":"alt","collectionKey":"states","stateCode":"{code}","eyebrow":"{name} Regulations","heading":"Certificate of Need in {name}","description":"What {name} requires, and what its rules say about the public notice.","labels":{"status":{"none":"Currently no certificate of need program"},"lastSearched":"Last searched","sources":"Sources"}}},{"id":"st-notices","type":"flatList","children":[],"props":{"variant":"state-notices","look":"broadsheet","ruleBefore":"thick","collectionKey":"notices","stateCode":"{code}","eyebrow":"{name} Statewide Edition","heading":"{name} Certificate of Need Notices","description":"Every notice published for {name}, newest first, with its notice number and publication timestamp.","emptyText":"No notices have been published for {name} yet. Submit the first one.","ctaLabel":"Submit a {name} Notice","ctaHref":"/submit?state={slug}","ctaIcon":"pen"}},{"id":"st-subscribe","type":"formEmbed","children":[],"props":{"variant":"subscribe","look":"broadsheet","ruleBefore":"thick","formKey":"subscribe","eyebrow":"Subscribe","submitLabel":"Subscribe","noteHtml":"We use your email or phone only to send new notices. Text alerts: message and data rates may apply; reply STOP to stop. To unsubscribe by email, write to <a href=\\"mailto:contact@mystateconnews.com\\">contact@mystateconnews.com</a>.","anchor":"subscribe","stateName":"{name}","heading":"Get {name} Notices as They Are Published","description":"Leave an email address, a phone number, or both. {name} is ticked; add more states or choose the whole country.","successText":"You are subscribed. New Certificate of Need notices will come to you as they are published.","source":"{name} Statewide Edition"}}]},"tickerSource":"notices","tickerLimit":10,"tickerItemTemplate":"{state} · {city} · {company} · Notice No. {number} · {date}","tickerSeparator":"     |     ","pageHeroEar":{"kicker":"Today''s Edition","text":"Every notice is numbered and timestamped as it is published."}}'
WHERE id = @site_id AND MD5(theme_json) = 'fcb357de6b4b43deed874284c2f36462';

-- ── Collection entries ──
UPDATE fact_web_entries SET title = 'Panel 1', data_json = '{"speech":"First step: place the required CON ad!","caption":"A healthcare entrepreneur sets out to place a CON legal advertisement.","tone":"thought","art":"entrepreneur","bubble":"right"}', status = 'published'
WHERE site_id = @site_id AND slug = 'panel-1' AND status = 'published'
  AND collection_id = (SELECT id FROM dim_web_collections WHERE site_id = @site_id AND collection_key = 'comic-panels')
  AND MD5(data_json) = '7d96890df02589215911c08cc3f90947' AND CONVERT(title USING utf8mb4) = CONVERT('Panel 1' USING utf8mb4);
UPDATE fact_web_entries SET title = 'Panel 2', data_json = '{"speech":"","caption":"But the newspaper listings are confusing. Where does a CON notice go?","tone":"","art":"classifieds","bubble":"right"}', status = 'published'
WHERE site_id = @site_id AND slug = 'panel-2' AND status = 'published'
  AND collection_id = (SELECT id FROM dim_web_collections WHERE site_id = @site_id AND collection_key = 'comic-panels')
  AND MD5(data_json) = '051d0409ff1b1ddc81bc50b6ae008cfc' AND CONVERT(title USING utf8mb4) = CONVERT('Panel 2' USING utf8mb4);
UPDATE fact_web_entries SET title = 'Panel 3', data_json = '{"speech":"","caption":"Next comes a flurry of phone calls: to the newspaper, the ad department and others, all to get it straight.","tone":"","art":"phones","bubble":"right"}', status = 'published'
WHERE site_id = @site_id AND slug = 'panel-3' AND status = 'published'
  AND collection_id = (SELECT id FROM dim_web_collections WHERE site_id = @site_id AND collection_key = 'comic-panels')
  AND MD5(data_json) = '6b7e22fb4ccccc0c47e147b550a5379f' AND CONVERT(title USING utf8mb4) = CONVERT('Panel 3' USING utf8mb4);
UPDATE fact_web_entries SET title = 'Panel 4', data_json = '{"speech":"","caption":"Soon it''s a mountain of forms, changes and deadlines. The paper chase feels endless!","tone":"","art":"deadlines","bubble":"right"}', status = 'published'
WHERE site_id = @site_id AND slug = 'panel-4' AND status = 'published'
  AND collection_id = (SELECT id FROM dim_web_collections WHERE site_id = @site_id AND collection_key = 'comic-panels')
  AND MD5(data_json) = '9fabbcd99b960f5c6c56d3d78e44192c' AND CONVERT(title USING utf8mb4) = CONVERT('Panel 4' USING utf8mb4);
UPDATE fact_web_entries SET title = 'Panel 5', data_json = '{"speech":"Finally, a clear route!","caption":"At last, he finds mystateCONnews: a single, clear place to find CON public notice information and newspaper options.","tone":"thought","art":"relief","bubble":"right"}', status = 'published'
WHERE site_id = @site_id AND slug = 'panel-5' AND status = 'published'
  AND collection_id = (SELECT id FROM dim_web_collections WHERE site_id = @site_id AND collection_key = 'comic-panels')
  AND MD5(data_json) = '4abbb573b8b70c2d0f55faf3b67d869f' AND CONVERT(title USING utf8mb4) = CONVERT('Panel 5' USING utf8mb4);

-- ── Navigation ──
UPDATE dim_web_navigation_items SET is_deleted = 1, is_active = 0 WHERE site_id = @site_id AND location = 'footer' AND CONVERT(column_title USING utf8mb4) = CONVERT('Publication' USING utf8mb4) AND CONVERT(label USING utf8mb4) = CONVERT('Search for CONs' USING utf8mb4) AND href = '/directory' AND is_deleted = 0;
UPDATE dim_web_navigation_items SET is_deleted = 1, is_active = 0 WHERE site_id = @site_id AND location = 'footer' AND CONVERT(column_title USING utf8mb4) = CONVERT('Publication' USING utf8mb4) AND CONVERT(label USING utf8mb4) = CONVERT('How It Works' USING utf8mb4) AND href = '/how-it-works' AND is_deleted = 0;
UPDATE dim_web_navigation_items SET sort_order = 2, href = '/affidavit-request' WHERE site_id = @site_id AND location = 'footer' AND CONVERT(column_title USING utf8mb4) = CONVERT('Publication' USING utf8mb4) AND CONVERT(label USING utf8mb4) = CONVERT('Request an Affidavit' USING utf8mb4) AND href = '/affidavit-request' AND sort_order = 4;
UPDATE dim_web_navigation_items SET is_deleted = 1, is_active = 0 WHERE site_id = @site_id AND location = 'footer' AND CONVERT(column_title USING utf8mb4) = CONVERT('States' USING utf8mb4) AND CONVERT(label USING utf8mb4) = CONVERT('Select Your State' USING utf8mb4) AND href = '/states' AND is_deleted = 0;
UPDATE dim_web_navigation_items SET sort_order = 21, href = '/customer-login' WHERE site_id = @site_id AND location = 'footer' AND CONVERT(column_title USING utf8mb4) = CONVERT('Platform' USING utf8mb4) AND CONVERT(label USING utf8mb4) = CONVERT('Customer Login' USING utf8mb4) AND href = '/customer-login' AND sort_order = 1;
UPDATE dim_web_navigation_items SET sort_order = 22, href = '/ops-login' WHERE site_id = @site_id AND location = 'footer' AND CONVERT(column_title USING utf8mb4) = CONVERT('Platform' USING utf8mb4) AND CONVERT(label USING utf8mb4) = CONVERT('Operations Login' USING utf8mb4) AND href = '/ops-login' AND sort_order = 2;

-- ── Pages ──
-- Home (/)
UPDATE dim_web_pages SET title = 'Home', layout_json = '{"version":1,"blocks":[{"id":"home-hero","type":"hero","props":{"variant":"front","kicker":"Certificate of Need Legal Notices","heading":"Get Your Certificate of Need Notice","headingAccent":"Published Fast & Affordable.","subheading":"A daily digital edition for every state and territory. Every notice is numbered and timestamped when it is published.","ctaLabel":"Submit a Notice","ctaHref":"/submit","ctaIcon":"pen","secondaryLabel":"Search for CONs","secondaryHref":"/directory","secondaryIcon":"search","earKicker":"Place a Notice","earHeading":"Publish Your CON Notice","earText":"Submit online. We review your notice, publish it with a notice number and timestamp, and can provide a notarized affidavit.","earFacts":["Every state and territory","Numbered and timestamped","Notarized affidavit on request"],"typeSpeedMs":"70"},"children":[]},{"id":"home-front","type":"columns","props":{"columnCount":1,"wrap":"front","className":"front-intro"},"children":[{"id":"home-con-text","type":"richText","props":{"column":1,"html":"<div class=\\"col-label\\"><svg width=\\"18\\" height=\\"18\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" aria-hidden=\\"true\\"><path d=\\"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z\\"/><path d=\\"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z\\"/></svg>Understanding CON</div><h3 class=\\"front-headline\\">What Is a Certificate of Need?</h3><p class=\\"con-body-text\\">A <strong>Certificate of Need (CON)</strong> is an approval many states require before something new is built or a new service is added, from a hospital wing to a pickleball facility.</p><p class=\\"con-body-text\\">The application is announced in a public notice first, so the community can weigh in before the state decides.</p>"},"children":[]},{"id":"home-con-button","type":"button","props":{"column":1,"label":"How It Works","href":"/how-it-works","variant":"primary","icon":"arrow","marginTop":"12"},"children":[]}]},{"id":"home-boxes","type":"columns","props":{"columnCount":3,"wrap":"front","className":"front-boxes"},"children":[{"id":"home-state-picker","type":"flatList","props":{"column":1,"variant":"state-picker","collectionKey":"states","heading":"Select Your State","description":"Open your state''s daily edition","placeholder":"Select a state or territory","goLabel":"Go to State","soonGroupLabel":"Coming Soon","openSuffix":" (Open)","groupLabels":{"full":"States with CON programs","limited":"Limited CON programs","unknown":"Research in progress","none":"No CON program"},"defaultNoteHtml":"Every state and territory has its own edition, with its own rules.","openNoteTemplate":"Open the <strong>{name}</strong> edition for its rules and notices.","soonNoteTemplate":"Open the <strong>{name}</strong> edition for its rules and notices.","pickFirstMessage":"Please select a state first."},"children":[]},{"id":"home-con-card-1","type":"pillarGrid","props":{"column":2,"variant":"stack","collectionKey":"con-highlights","offset":"0","limit":"1"},"children":[]},{"id":"home-con-card-2","type":"pillarGrid","props":{"column":3,"variant":"stack","collectionKey":"con-highlights","offset":"1","limit":"1"},"children":[]}]},{"id":"home-process","type":"numberedGrid","props":{"look":"broadsheet","tone":"alt","ruleBefore":"thick","eyebrow":"Process","heading":"How CON Publication Works","description":"From submission to notarized affidavit in five steps.","collectionKey":"process-steps"},"children":[]},{"id":"home-recent-notices","type":"flatList","props":{"variant":"recent","look":"broadsheet","ruleBefore":"thick","collectionKey":"notices","eyebrow":"Published Notices","heading":"Latest Notices","description":"Numbered and timestamped as they are published.","limit":"5","filterLabel":"Filter by State:","allStatesLabel":"All States & Territories","emptyText":"No notices have been published for this state yet.","viewAllLabel":"Search for CONs","viewAllHref":"/directory","viewAllIcon":"search"},"children":[]},{"id":"home-subscribe","type":"formEmbed","children":[],"props":{"variant":"subscribe","look":"broadsheet","ruleBefore":"thick","formKey":"subscribe","eyebrow":"Subscribe","submitLabel":"Subscribe","noteHtml":"We use your email or phone only to send new notices. Text alerts: message and data rates may apply; reply STOP to stop. To unsubscribe by email, write to <a href=\\"mailto:contact@mystateconnews.com\\">contact@mystateconnews.com</a>.","anchor":"subscribe","heading":"Get New Notices as They Are Published","description":"Leave an email address, a phone number, or both. Choose the whole country or just the states you follow.","successText":"You are subscribed. New Certificate of Need notices will come to you as they are published.","source":"Front page"}},{"id":"home-comic","type":"pillarGrid","props":{"variant":"comic","collectionKey":"comic-panels","eyebrow":"The CON Chronicle Comics","heading":"CON News Funnies","description":"A lighthearted look at the Certificate of Need world. All situations are fictional and for entertainment purposes only.","stripTitle":"The CON Application Nightmare","stripSubtitle":"The Paper Chase","disclaimer":"The CON Chronicle Comics are entirely fictional. Any resemblance to actual CON proceedings is coincidental and unintentional."},"children":[]}]}', meta_title = 'mystateCONnews, Certificate of Need Legal Publication', meta_description = 'Digital publication platform for Certificate of Need public notices. Starting in South Carolina, expanding state by state. Submit your CON notice today.'
WHERE site_id = @site_id AND slug = 'home' AND MD5(layout_json) = '1d5d60f4dc86653735629cef72e933d4';

-- ── Comic panel fields (hand written): the balloon is optional, labels name
--    the new drawings. Each UPDATE only touches a field still labelled as the
--    previous release left it. The new "bubble" field is inserted by the seed.
UPDATE dim_web_collection_fields f JOIN dim_web_collections c ON c.id = f.collection_id
SET f.label = 'Speech or thought balloon (optional)', f.is_required = 0
WHERE c.site_id = @site_id AND c.collection_key = 'comic-panels' AND f.field_key = 'speech' AND f.label = 'Speech bubble';
UPDATE dim_web_collection_fields f JOIN dim_web_collections c ON c.id = f.collection_id
SET f.label = 'Caption (narration under the panel)'
WHERE c.site_id = @site_id AND c.collection_key = 'comic-panels' AND f.field_key = 'caption' AND f.label = 'Caption';
UPDATE dim_web_collection_fields f JOIN dim_web_collections c ON c.id = f.collection_id
SET f.label = 'Balloon style (blank, thought or crimson)'
WHERE c.site_id = @site_id AND c.collection_key = 'comic-panels' AND f.field_key = 'tone' AND f.label = 'Bubble colour (blank, crimson or success)';
UPDATE dim_web_collection_fields f JOIN dim_web_collections c ON c.id = f.collection_id
SET f.label = 'Illustration (entrepreneur, classifieds, phones, deadlines or relief)'
WHERE c.site_id = @site_id AND c.collection_key = 'comic-panels' AND f.field_key = 'art' AND f.label = 'Illustration (hospital, regulator, paperwork, old paper or laptop)';
