@fynd-design-engineering/fynd-one-v2 3.3.12 → 3.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/accordians/dropdown.js.map +2 -2
  2. package/dist/accordians/index.js.map +2 -2
  3. package/dist/cms-listing/index.js.map +2 -2
  4. package/dist/filters/clear-search.js.map +2 -2
  5. package/dist/filters/show-count.js.map +2 -2
  6. package/dist/form/cs-gated-redirection.js.map +2 -2
  7. package/dist/form/download-file.js.map +2 -2
  8. package/dist/form/handler.js.map +2 -2
  9. package/dist/form/phone-validator.js.map +2 -2
  10. package/dist/global/anchor-scroll.js.map +2 -2
  11. package/dist/global/loader.js.map +2 -2
  12. package/dist/global/miscellaneous.js.map +2 -2
  13. package/dist/global/number-count.js.map +2 -2
  14. package/dist/global/popup-video.js.map +2 -2
  15. package/dist/home/index.js.map +2 -2
  16. package/dist/marquee/index.js.map +2 -2
  17. package/dist/marquee/marquee-swiper.js.map +2 -2
  18. package/dist/navigation/announcement/index.js.map +2 -2
  19. package/dist/navigation/context-menu/index.js.map +2 -2
  20. package/dist/navigation/desktop/index.js.map +2 -2
  21. package/dist/navigation/initialization.js +1 -1
  22. package/dist/navigation/initialization.js.map +3 -3
  23. package/dist/navigation/main.js.map +2 -2
  24. package/dist/navigation/mobile/index.js.map +2 -2
  25. package/dist/navigation/scroll/index.js.map +2 -2
  26. package/dist/navigation/secondary-navigation/index.js.map +2 -2
  27. package/dist/navigation/temp.css +1 -1
  28. package/dist/navigation/temp.css.map +2 -2
  29. package/dist/others/geolocation.js.map +2 -2
  30. package/dist/others/hero-aniamtion.js.map +2 -2
  31. package/dist/others/hero-india-animation-2.js.map +2 -2
  32. package/dist/others/hero-india-animation.js.map +2 -2
  33. package/dist/posthog-and-ga/attributes.js.map +2 -2
  34. package/dist/posthog-and-ga/main.js.map +2 -2
  35. package/dist/progressive-scroll/index.js.map +2 -2
  36. package/dist/quick-fix/reload.js.map +2 -2
  37. package/dist/seo/schema.js.map +2 -2
  38. package/dist/test/sample.js.map +2 -2
  39. package/dist/testimonials/index.js.map +2 -2
  40. package/dist/timeline/index.js.map +2 -2
  41. package/dist/tracking/fill-form-fields.js.map +2 -2
  42. package/dist/tracking/form-tracker.js.map +2 -2
  43. package/dist/tracking/page-categories.js.map +2 -2
  44. package/dist/tracking/user-journey.js.map +2 -2
  45. package/dist/tracking/utm-links.js.map +2 -2
  46. package/dist/utils/sample.js.map +2 -2
  47. package/dist/validations/localhost.js.map +2 -2
  48. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bin/live-reload.js", "../../src/posthog-and-ga/main.ts"],
4
- "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// trackingIntegration.ts - PostHog tracking with user journey integration\nimport { FormDetails, UserJourney } from '../utils/types/user-journey';\n\n// TypeScript interface for GTM dataLayer events\ninterface GTMEvent {\n event: string;\n event_category: string;\n event_label: string;\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n [key: string]: any; // Allow additional properties\n}\n\n// GA tracking properties interface (form-related and AI data)\ninterface GATrackingProperties {\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n // AI data fields\n aidata_context?: string;\n aidata_platform?: string;\n aidata_type?: string;\n aidata_detection?: string;\n}\n\n// Define tracking properties interface\ninterface TrackingProperties {\n 'fynd_website.source_page': string;\n 'fynd_website.product': string;\n 'fynd_website.device_type': string;\n 'fynd_website.utm_source': string;\n 'fynd_website.utm_medium': string;\n 'fynd_website.utm_campaign': string;\n 'fynd_website.referrer': string;\n // Form details from user journey\n 'fynd_website.form_id'?: string;\n 'fynd_website.form_name'?: string;\n 'fynd_website.form_first_name'?: string;\n 'fynd_website.form_last_name'?: string;\n 'fynd_website.form_email'?: string;\n 'fynd_website.form_phone'?: string;\n // User journey details\n 'fynd_website.journey_total_pages'?: number;\n 'fynd_website.journey_session_duration'?: number;\n 'fynd_website.journey_first_page'?: string;\n 'fynd_website.journey_current_page'?: string;\n 'fynd_website.journey_device'?: string;\n 'fynd_website.journey_browser'?: string;\n 'fynd_website.journey_device_name'?: string;\n 'fynd_website.journey_origin'?: string;\n 'fynd_website.journey_touchpoints'?: any; // Array of touchpoints from userJourney field\n 'fynd_website.journey_touchpoints_count'?: number;\n 'fynd_website.journey_utm_path'?: string;\n 'fynd_website.journey_entry_time'?: string;\n 'fynd_website.journey_exit_time'?: string;\n 'fynd_website.journey_scroll_depth'?: number;\n // AI data fields\n 'fynd_website.aidata_context'?: string;\n 'fynd_website.aidata_platform'?: string;\n 'fynd_website.aidata_type'?: string;\n 'fynd_website.aidata_detection'?: string;\n // Additional event-specific properties\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any; // Allow additional properties\n}\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n getPosthogTrackingProperties: () => TrackingProperties;\n getGaTrackingProperties: () => GATrackingProperties;\n validationPassed?: boolean;\n getUserJourney: () => UserJourney | null;\n dataLayer?: GTMEvent[];\n }\n}\n\n// GA tracking properties function (form-related data only)\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey && journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n gaProperties.form_id = formDetails.formId;\n }\n if (formDetails.formName) {\n gaProperties.form_name = formDetails.formName;\n }\n if (formDetails.firstName) {\n gaProperties.form_first_name = formDetails.firstName;\n }\n if (formDetails.lastName) {\n gaProperties.form_last_name = formDetails.lastName;\n }\n if (formDetails.email) {\n gaProperties.form_email = formDetails.email;\n }\n if (formDetails.phone) {\n gaProperties.form_phone = formDetails.phone;\n }\n }\n\n // Add AI data if available\n if (journey && journey.aiData) {\n const aiData = journey.aiData;\n \n if (aiData.context) {\n gaProperties.aidata_context = aiData.context;\n }\n if (aiData.platform) {\n gaProperties.aidata_platform = aiData.platform;\n }\n if (aiData.type) {\n gaProperties.aidata_type = aiData.type;\n }\n if (aiData.detectionMethod) {\n gaProperties.aidata_detection = aiData.detectionMethod;\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for GA tracking:', error);\n }\n\n return gaProperties;\n};\n\n// Enhanced tracking properties function\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n // Base tracking properties\n const baseProperties: TrackingProperties = {\n 'fynd_website.source_page': pathname,\n 'fynd_website.product': \"fynd.com website\",\n 'fynd_website.device_type': \"Unknown\", // Will be updated from user journey\n 'fynd_website.utm_source':\n new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n 'fynd_website.utm_medium':\n new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n 'fynd_website.utm_campaign':\n new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n 'fynd_website.referrer': document.referrer,\n };\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey) {\n // Add the complete user journey object as touchpoints\n baseProperties['fynd_website.journey_touchpoints'] = journey.userJourney || journey;\n\n // Add form details if available\n if (journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n baseProperties['fynd_website.form_id'] = formDetails.formId;\n }\n if (formDetails.formName) {\n baseProperties['fynd_website.form_name'] = formDetails.formName;\n }\n if (formDetails.firstName) {\n baseProperties['fynd_website.form_first_name'] = formDetails.firstName;\n }\n if (formDetails.lastName) {\n baseProperties['fynd_website.form_last_name'] = formDetails.lastName;\n }\n if (formDetails.email) {\n baseProperties['fynd_website.form_email'] = formDetails.email;\n }\n if (formDetails.phone) {\n baseProperties['fynd_website.form_phone'] = formDetails.phone;\n }\n }\n\n // Add journey metadata\n if (journey.userJourney && journey.userJourney.length > 0) {\n baseProperties['fynd_website.journey_total_pages'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_touchpoints_count'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_first_page'] = journey.userJourney[0].page;\n baseProperties['fynd_website.journey_current_page'] = journey.userJourney[journey.userJourney.length - 1].page;\n\n // Calculate session duration\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n baseProperties['fynd_website.journey_session_duration'] = Math.floor((lastVisit.getTime() - firstVisit.getTime()) / 1000);\n \n // Add entry and exit times\n baseProperties['fynd_website.journey_entry_time'] = journey.userJourney[0].time;\n baseProperties['fynd_website.journey_exit_time'] = journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n // Add device and browser info from journey\n if (journey.deviceCategory) {\n // Device category is already capitalized from user journey\n baseProperties['fynd_website.device_type'] = journey.deviceCategory;\n }\n if (journey.browser) {\n baseProperties['fynd_website.journey_browser'] = journey.browser;\n }\n if (journey.device) {\n baseProperties['fynd_website.journey_device'] = journey.device;\n }\n if (journey.origin) {\n baseProperties['fynd_website.journey_origin'] = journey.origin;\n }\n \n // Add UTM path if available\n if (journey.utmPath) {\n baseProperties['fynd_website.journey_utm_path'] = journey.utmPath;\n }\n \n // Add scroll depth if available\n if (journey.scrollDepth) {\n baseProperties['fynd_website.journey_scroll_depth'] = journey.scrollDepth;\n }\n\n // Add AI data if available\n if (journey.aiData) {\n const aiData = journey.aiData;\n \n if (aiData.context) {\n baseProperties['fynd_website.aidata_context'] = aiData.context;\n }\n if (aiData.platform) {\n baseProperties['fynd_website.aidata_platform'] = aiData.platform;\n }\n if (aiData.type) {\n baseProperties['fynd_website.aidata_type'] = aiData.type;\n }\n if (aiData.detectionMethod) {\n baseProperties['fynd_website.aidata_detection'] = aiData.detectionMethod;\n }\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for tracking:', error);\n }\n\n // Fallback device type calculation if user journey isn't available\n if (baseProperties['fynd_website.device_type'] === \"Unknown\") {\n const userAgent = navigator.userAgent;\n \n // Check for tablets first\n if (/iPad/.test(userAgent) || \n (/Android/.test(userAgent) && !/Mobile/.test(userAgent)) ||\n /Tablet/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Tablet\";\n }\n // Check for mobile devices\n else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Mobile\";\n }\n // Default to desktop\n else {\n baseProperties['fynd_website.device_type'] = \"Desktop\";\n }\n }\n\n return baseProperties;\n};\n\n// Function to send event to GA via dataLayer\nconst sendToGA = (eventName: string, gaProperties: GATrackingProperties, additionalProperties?: any): void => {\n if ((window as any).dataLayer) {\n const eventData: GTMEvent = {\n event: eventName,\n event_category: 'form_interaction',\n event_label: eventName,\n ...gaProperties\n };\n\n // Add submitted_form from additional properties if available\n if (additionalProperties?.submitted_form) {\n eventData.submitted_form = additionalProperties.submitted_form;\n }\n\n (window as any).dataLayer.push(eventData);\n // console.log('Event sent to GA:', eventData);\n } else {\n console.warn('dataLayer not available for GA tracking');\n }\n};\n\n// Track event function\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n // Get PostHog tracking properties (all data)\n const trackingProps = getPosthogTrackingProperties();\n\n // Merge with additional properties if provided\n const finalProperties = properties ? { ...trackingProps, ...properties } : trackingProps;\n\n // Track with PostHog if available\n if ((window as any).posthog) {\n (window as any).posthog.capture(eventName, finalProperties);\n // console.log('Event sent to PostHog:', { event: eventName, properties: finalProperties });\n }\n\n // Get GA tracking properties (form-related and AI data)\n const gaProperties = getGaTrackingProperties();\n\n // Send to GA if there's form-related data, AI data, or it's a form-related event\n const hasAIData = gaProperties.aidata_context || gaProperties.aidata_platform || \n gaProperties.aidata_type || gaProperties.aidata_detection;\n const isFormRelatedEvent = eventName.includes('form') || \n Object.keys(gaProperties).length > 0 || \n properties?.submitted_form ||\n hasAIData;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProperties, properties);\n }\n\n // Optional: Console log for debugging (remove in production)\n // console.log('Tracked event:', eventName, finalProperties);\n } catch (error) {\n console.error('Error tracking event:', error);\n }\n};\n\n// Helper function to get parent form name\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (parentForm) {\n return parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null;\n }\n return null;\n};\n\n// Initialize PostHog pageview\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n\n // PostHog pageview\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", trackingProps);\n }\n});\n\n// Track page load event\nwindow.addEventListener(\"load\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n // console.log(\"Tracking Properties on Page Load:\", trackingProps);\n \n trackEvent(\"fynd_website.page.loaded\");\n\n // Check if this is the thank you page and trigger form success event\n checkThankYouPageEvent();\n});\n\n// Function to check and trigger thank you page event\nfunction checkThankYouPageEvent(): void {\n const currentPath = window.location.pathname;\n\n // Check if current page is thank you page\n if (currentPath === '/thank-you') {\n // Check if this is a page reload (not initial navigation)\n const navigationEntries = performance.getEntriesByType('navigation');\n if (navigationEntries.length > 0) {\n const navEntry = navigationEntries[0] as PerformanceNavigationTiming;\n\n // Check if it's a reload (type === 'reload') or if there's a referrer from the same origin\n const isReload = navEntry.type === 'reload' ||\n (document.referrer && new URL(document.referrer).origin === window.location.origin);\n\n if (isReload) {\n // Trigger event after 200ms delay\n setTimeout(() => {\n trackEvent(\"fynd_website.form.success\");\n }, 200);\n }\n }\n }\n}\n\n// Button click tracking for sign up, sign in, scroll to form and book a demo buttons\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]') as NodeListOf<Element>;\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]') as NodeListOf<Element>;\n const scrollToFormButtons = document.querySelectorAll(\n '[href=\"#footer-form\"]'\n ) as NodeListOf<Element>;\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]') as NodeListOf<Element>;\n const submitButtons = document.querySelectorAll('[type=\"submit\"]') as NodeListOf<Element>;\n\n submitButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n // If validation passed, track the submit event\n const additionalProps = formName ? { submitted_form: formName } : {};\n trackEvent(\"fynd_website.form.submitted\", additionalProps);\n }\n }, 10);\n });\n });\n\n signUpButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_up.clicked\");\n });\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_in.clicked\");\n });\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.scroll_to_form.clicked\");\n });\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.book_a_demo.clicked\");\n });\n });\n\n // Form field change tracking for fynd_form_started event\n const formFields = document.querySelectorAll('[ph-form-field]') as NodeListOf<HTMLElement>;\n \n // Set to track which forms have already triggered the event\n const triggeredForms = new Set<string>();\n\n formFields.forEach((field: HTMLElement) => {\n // Handle different element types\n const tagName = field.tagName.toLowerCase();\n const inputType = (field as HTMLInputElement).type?.toLowerCase();\n \n // Function to handle form started event\n const handleFormStarted = function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || 'unknown-form';\n \n // Only trigger once per form to avoid duplicate events\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n \n trackEvent(\"fynd_website.form.started\");\n }\n };\n \n // Add focus event for all interactive form fields (except buttons)\n if (!(tagName === 'button' || (tagName === 'input' && inputType === 'submit'))) {\n field.addEventListener('focus', handleFormStarted);\n }\n \n // Add specific interaction events as before\n if (tagName === 'button' || (tagName === 'input' && inputType === 'submit')) {\n field.addEventListener('click', handleFormStarted);\n } else if (tagName === 'select') {\n field.addEventListener('change', handleFormStarted);\n } else {\n field.addEventListener('input', handleFormStarted);\n }\n });\n});\n\n// Make functions globally accessible\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// Export for module usage\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\n sendToGA,\n getParentFormName,\n type TrackingProperties,\n type GATrackingProperties,\n type GTMEvent\n};"],
5
- "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;AC+EA,MAAM,0BAA0B,MAA4B;AACxD,UAAM,eA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ACrC,yBAAe,IAAI,cAAc;AAEjC,qBAAW,2BAA2B;AAAA,QAC1C;AAAA,MACJ;AAGA,UAAI,EAAE,YAAY,YAAa,YAAY,WAAW,cAAc,WAAY;AAC5E,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACrD;AAGA,UAAI,YAAY,YAAa,YAAY,WAAW,cAAc,UAAW;AACzE,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACrD,WAAW,YAAY,UAAU;AAC7B,cAAM,iBAAiB,UAAU,iBAAiB;AAAA,MACtD,OAAO;AACH,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACrD;AAAA,IACJ,CAAC;AAAA,EACL,CAAC;AAGD,SAAO,+BAA+B;AACtC,SAAO,aAAa;AACpB,SAAO,0BAA0B;",
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// trackingIntegration.ts - PostHog tracking with user journey integration\nimport { FormDetails, UserJourney } from '../utils/types/user-journey';\n\n// TypeScript interface for GTM dataLayer events\ninterface GTMEvent {\n event: string;\n event_category: string;\n event_label: string;\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n [key: string]: any; // Allow additional properties\n}\n\n// GA tracking properties interface (form-related and AI data)\ninterface GATrackingProperties {\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n // AI data fields\n aidata_context?: string;\n aidata_platform?: string;\n aidata_type?: string;\n aidata_detection?: string;\n}\n\n// Define tracking properties interface\ninterface TrackingProperties {\n 'fynd_website.source_page': string;\n 'fynd_website.product': string;\n 'fynd_website.device_type': string;\n 'fynd_website.utm_source': string;\n 'fynd_website.utm_medium': string;\n 'fynd_website.utm_campaign': string;\n 'fynd_website.referrer': string;\n // Form details from user journey\n 'fynd_website.form_id'?: string;\n 'fynd_website.form_name'?: string;\n 'fynd_website.form_first_name'?: string;\n 'fynd_website.form_last_name'?: string;\n 'fynd_website.form_email'?: string;\n 'fynd_website.form_phone'?: string;\n // User journey details\n 'fynd_website.journey_total_pages'?: number;\n 'fynd_website.journey_session_duration'?: number;\n 'fynd_website.journey_first_page'?: string;\n 'fynd_website.journey_current_page'?: string;\n 'fynd_website.journey_device'?: string;\n 'fynd_website.journey_browser'?: string;\n 'fynd_website.journey_device_name'?: string;\n 'fynd_website.journey_origin'?: string;\n 'fynd_website.journey_touchpoints'?: any; // Array of touchpoints from userJourney field\n 'fynd_website.journey_touchpoints_count'?: number;\n 'fynd_website.journey_utm_path'?: string;\n 'fynd_website.journey_entry_time'?: string;\n 'fynd_website.journey_exit_time'?: string;\n 'fynd_website.journey_scroll_depth'?: number;\n // AI data fields\n 'fynd_website.aidata_context'?: string;\n 'fynd_website.aidata_platform'?: string;\n 'fynd_website.aidata_type'?: string;\n 'fynd_website.aidata_detection'?: string;\n // Additional event-specific properties\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any; // Allow additional properties\n}\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n getPosthogTrackingProperties: () => TrackingProperties;\n getGaTrackingProperties: () => GATrackingProperties;\n validationPassed?: boolean;\n getUserJourney: () => UserJourney | null;\n dataLayer?: GTMEvent[];\n }\n}\n\n// GA tracking properties function (form-related data only)\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey && journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n gaProperties.form_id = formDetails.formId;\n }\n if (formDetails.formName) {\n gaProperties.form_name = formDetails.formName;\n }\n if (formDetails.firstName) {\n gaProperties.form_first_name = formDetails.firstName;\n }\n if (formDetails.lastName) {\n gaProperties.form_last_name = formDetails.lastName;\n }\n if (formDetails.email) {\n gaProperties.form_email = formDetails.email;\n }\n if (formDetails.phone) {\n gaProperties.form_phone = formDetails.phone;\n }\n }\n\n // Add AI data if available\n if (journey && journey.aiData) {\n const aiData = journey.aiData;\n \n if (aiData.context) {\n gaProperties.aidata_context = aiData.context;\n }\n if (aiData.platform) {\n gaProperties.aidata_platform = aiData.platform;\n }\n if (aiData.type) {\n gaProperties.aidata_type = aiData.type;\n }\n if (aiData.detectionMethod) {\n gaProperties.aidata_detection = aiData.detectionMethod;\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for GA tracking:', error);\n }\n\n return gaProperties;\n};\n\n// Enhanced tracking properties function\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n // Base tracking properties\n const baseProperties: TrackingProperties = {\n 'fynd_website.source_page': pathname,\n 'fynd_website.product': \"fynd.com website\",\n 'fynd_website.device_type': \"Unknown\", // Will be updated from user journey\n 'fynd_website.utm_source':\n new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n 'fynd_website.utm_medium':\n new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n 'fynd_website.utm_campaign':\n new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n 'fynd_website.referrer': document.referrer,\n };\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey) {\n // Add the complete user journey object as touchpoints\n baseProperties['fynd_website.journey_touchpoints'] = journey.userJourney || journey;\n\n // Add form details if available\n if (journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n baseProperties['fynd_website.form_id'] = formDetails.formId;\n }\n if (formDetails.formName) {\n baseProperties['fynd_website.form_name'] = formDetails.formName;\n }\n if (formDetails.firstName) {\n baseProperties['fynd_website.form_first_name'] = formDetails.firstName;\n }\n if (formDetails.lastName) {\n baseProperties['fynd_website.form_last_name'] = formDetails.lastName;\n }\n if (formDetails.email) {\n baseProperties['fynd_website.form_email'] = formDetails.email;\n }\n if (formDetails.phone) {\n baseProperties['fynd_website.form_phone'] = formDetails.phone;\n }\n }\n\n // Add journey metadata\n if (journey.userJourney && journey.userJourney.length > 0) {\n baseProperties['fynd_website.journey_total_pages'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_touchpoints_count'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_first_page'] = journey.userJourney[0].page;\n baseProperties['fynd_website.journey_current_page'] = journey.userJourney[journey.userJourney.length - 1].page;\n\n // Calculate session duration\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n baseProperties['fynd_website.journey_session_duration'] = Math.floor((lastVisit.getTime() - firstVisit.getTime()) / 1000);\n \n // Add entry and exit times\n baseProperties['fynd_website.journey_entry_time'] = journey.userJourney[0].time;\n baseProperties['fynd_website.journey_exit_time'] = journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n // Add device and browser info from journey\n if (journey.deviceCategory) {\n // Device category is already capitalized from user journey\n baseProperties['fynd_website.device_type'] = journey.deviceCategory;\n }\n if (journey.browser) {\n baseProperties['fynd_website.journey_browser'] = journey.browser;\n }\n if (journey.device) {\n baseProperties['fynd_website.journey_device'] = journey.device;\n }\n if (journey.origin) {\n baseProperties['fynd_website.journey_origin'] = journey.origin;\n }\n \n // Add UTM path if available\n if (journey.utmPath) {\n baseProperties['fynd_website.journey_utm_path'] = journey.utmPath;\n }\n \n // Add scroll depth if available\n if (journey.scrollDepth) {\n baseProperties['fynd_website.journey_scroll_depth'] = journey.scrollDepth;\n }\n\n // Add AI data if available\n if (journey.aiData) {\n const aiData = journey.aiData;\n \n if (aiData.context) {\n baseProperties['fynd_website.aidata_context'] = aiData.context;\n }\n if (aiData.platform) {\n baseProperties['fynd_website.aidata_platform'] = aiData.platform;\n }\n if (aiData.type) {\n baseProperties['fynd_website.aidata_type'] = aiData.type;\n }\n if (aiData.detectionMethod) {\n baseProperties['fynd_website.aidata_detection'] = aiData.detectionMethod;\n }\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for tracking:', error);\n }\n\n // Fallback device type calculation if user journey isn't available\n if (baseProperties['fynd_website.device_type'] === \"Unknown\") {\n const userAgent = navigator.userAgent;\n \n // Check for tablets first\n if (/iPad/.test(userAgent) || \n (/Android/.test(userAgent) && !/Mobile/.test(userAgent)) ||\n /Tablet/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Tablet\";\n }\n // Check for mobile devices\n else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Mobile\";\n }\n // Default to desktop\n else {\n baseProperties['fynd_website.device_type'] = \"Desktop\";\n }\n }\n\n return baseProperties;\n};\n\n// Function to send event to GA via dataLayer\nconst sendToGA = (eventName: string, gaProperties: GATrackingProperties, additionalProperties?: any): void => {\n if ((window as any).dataLayer) {\n const eventData: GTMEvent = {\n event: eventName,\n event_category: 'form_interaction',\n event_label: eventName,\n ...gaProperties\n };\n\n // Add submitted_form from additional properties if available\n if (additionalProperties?.submitted_form) {\n eventData.submitted_form = additionalProperties.submitted_form;\n }\n\n (window as any).dataLayer.push(eventData);\n // console.log('Event sent to GA:', eventData);\n } else {\n console.warn('dataLayer not available for GA tracking');\n }\n};\n\n// Track event function\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n // Get PostHog tracking properties (all data)\n const trackingProps = getPosthogTrackingProperties();\n\n // Merge with additional properties if provided\n const finalProperties = properties ? { ...trackingProps, ...properties } : trackingProps;\n\n // Track with PostHog if available\n if ((window as any).posthog) {\n (window as any).posthog.capture(eventName, finalProperties);\n // console.log('Event sent to PostHog:', { event: eventName, properties: finalProperties });\n }\n\n // Get GA tracking properties (form-related and AI data)\n const gaProperties = getGaTrackingProperties();\n\n // Send to GA if there's form-related data, AI data, or it's a form-related event\n const hasAIData = gaProperties.aidata_context || gaProperties.aidata_platform || \n gaProperties.aidata_type || gaProperties.aidata_detection;\n const isFormRelatedEvent = eventName.includes('form') || \n Object.keys(gaProperties).length > 0 || \n properties?.submitted_form ||\n hasAIData;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProperties, properties);\n }\n\n // Optional: Console log for debugging (remove in production)\n // console.log('Tracked event:', eventName, finalProperties);\n } catch (error) {\n console.error('Error tracking event:', error);\n }\n};\n\n// Helper function to get parent form name\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (parentForm) {\n return parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null;\n }\n return null;\n};\n\n// Initialize PostHog pageview\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n\n // PostHog pageview\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", trackingProps);\n }\n});\n\n// Track page load event\nwindow.addEventListener(\"load\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n // console.log(\"Tracking Properties on Page Load:\", trackingProps);\n \n trackEvent(\"fynd_website.page.loaded\");\n\n // Check if this is the thank you page and trigger form success event\n checkThankYouPageEvent();\n});\n\n// Function to check and trigger thank you page event\nfunction checkThankYouPageEvent(): void {\n const currentPath = window.location.pathname;\n\n // Check if current page is thank you page\n if (currentPath === '/thank-you') {\n // Check if this is a page reload (not initial navigation)\n const navigationEntries = performance.getEntriesByType('navigation');\n if (navigationEntries.length > 0) {\n const navEntry = navigationEntries[0] as PerformanceNavigationTiming;\n\n // Check if it's a reload (type === 'reload') or if there's a referrer from the same origin\n const isReload = navEntry.type === 'reload' ||\n (document.referrer && new URL(document.referrer).origin === window.location.origin);\n\n if (isReload) {\n // Trigger event after 200ms delay\n setTimeout(() => {\n trackEvent(\"fynd_website.form.success\");\n }, 200);\n }\n }\n }\n}\n\n// Button click tracking for sign up, sign in, scroll to form and book a demo buttons\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]') as NodeListOf<Element>;\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]') as NodeListOf<Element>;\n const scrollToFormButtons = document.querySelectorAll(\n '[href=\"#footer-form\"]'\n ) as NodeListOf<Element>;\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]') as NodeListOf<Element>;\n const submitButtons = document.querySelectorAll('[type=\"submit\"]') as NodeListOf<Element>;\n\n submitButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n // If validation passed, track the submit event\n const additionalProps = formName ? { submitted_form: formName } : {};\n trackEvent(\"fynd_website.form.submitted\", additionalProps);\n }\n }, 10);\n });\n });\n\n signUpButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_up.clicked\");\n });\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_in.clicked\");\n });\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.scroll_to_form.clicked\");\n });\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.book_a_demo.clicked\");\n });\n });\n\n // Form field change tracking for fynd_form_started event\n const formFields = document.querySelectorAll('[ph-form-field]') as NodeListOf<HTMLElement>;\n \n // Set to track which forms have already triggered the event\n const triggeredForms = new Set<string>();\n\n formFields.forEach((field: HTMLElement) => {\n // Handle different element types\n const tagName = field.tagName.toLowerCase();\n const inputType = (field as HTMLInputElement).type?.toLowerCase();\n \n // Function to handle form started event\n const handleFormStarted = function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || 'unknown-form';\n \n // Only trigger once per form to avoid duplicate events\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n \n trackEvent(\"fynd_website.form.started\");\n }\n };\n \n // Add focus event for all interactive form fields (except buttons)\n if (!(tagName === 'button' || (tagName === 'input' && inputType === 'submit'))) {\n field.addEventListener('focus', handleFormStarted);\n }\n \n // Add specific interaction events as before\n if (tagName === 'button' || (tagName === 'input' && inputType === 'submit')) {\n field.addEventListener('click', handleFormStarted);\n } else if (tagName === 'select') {\n field.addEventListener('change', handleFormStarted);\n } else {\n field.addEventListener('input', handleFormStarted);\n }\n });\n});\n\n// Make functions globally accessible\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// Export for module usage\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\n sendToGA,\n getParentFormName,\n type TrackingProperties,\n type GATrackingProperties,\n type GTMEvent\n};"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;AC+EA,MAAM,0BAA0B,MAA4B;AACxD,U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GAAG;AACrC,yBAAe,IAAI,cAAc;AAEjC,qBAAW,2BAA2B;AAAA,QAC1C;AAAA,MACJ;AAGA,UAAI,EAAE,YAAY,YAAa,YAAY,WAAW,cAAc,WAAY;AAC5E,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACrD;AAGA,UAAI,YAAY,YAAa,YAAY,WAAW,cAAc,UAAW;AACzE,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACrD,WAAW,YAAY,UAAU;AAC7B,cAAM,iBAAiB,UAAU,iBAAiB;AAAA,MACtD,OAAO;AACH,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACrD;AAAA,IACJ,CAAC;AAAA,EACL,CAAC;AAGD,SAAO,+BAA+B;AACtC,SAAO,aAAa;AACpB,SAAO,0BAA0B;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bin/live-reload.js", "../../src/progressive-scroll/index.ts"],
4
- "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// TypeScript variant of progressive scroll functionality\n// Ensure GSAP and ScrollTrigger are loaded\n\n// Type declarations for GSAP (assuming it's loaded globally)\ndeclare global {\n interface Window {\n gsap: any;\n ScrollTrigger: any;\n }\n}\n\nconst gsap = (window as any).gsap;\nconst ScrollTrigger = (window as any).ScrollTrigger;\n\ngsap.registerPlugin(ScrollTrigger);\n\nfunction moveElements(sourceSelector: string, targetSelector: string, warningMessage: string): void {\n const target: Element | null = document.querySelector(targetSelector);\n if (!target) {\n console.warn(warningMessage);\n return;\n }\n\n const sources: NodeListOf<Element> = document.querySelectorAll(sourceSelector);\n if (sources.length === 0) {\n console.warn(`Warning: No elements found with attribute ${sourceSelector}`);\n return;\n }\n\n sources.forEach((source: Element) => target.appendChild(source));\n}\n\nfunction initScrollBlocks(): void {\n moveElements(\n \"[fynd-sticky-source]\",\n \"[fynd-sticky-target]\",\n \"Warning: No element found with attribute fynd-sticky-target\"\n );\n moveElements(\n \"[fynd-scroll-source]\",\n \"[fynd-scroll-target]\",\n \"Warning: No element found with attribute fynd-scroll-target\"\n );\n}\n\nfunction initProgressiveScroll(): void {\n gsap.registerPlugin(ScrollTrigger);\n\n // Add debounce to handle rapid scrolling\n let timeout: number | undefined;\n let lastVisitedSection: string | null;\n let currentSection: string | null;\n localStorage.setItem(\"lastVisitedSection\", \"null\");\n\n function debouncedScrollTrigger(attributeValue: string): void {\n clearTimeout(timeout);\n\n const scrollSections: NodeListOf<Element> = document.querySelectorAll(\"[fynd-scroll-source]\");\n const sectionCount: number = scrollSections.length;\n const startSection: string | null = scrollSections[0].getAttribute(\"fynd-scroll-source\");\n const endSection: string | null =\n scrollSections[sectionCount - 1].getAttribute(\"fynd-scroll-source\");\n let currentSection: string | null = document\n .querySelector(`[fynd-scroll-source=\"${attributeValue}\"]`)\n ?.getAttribute(\"fynd-scroll-source\") || null;\n lastVisitedSection = localStorage.getItem(\"lastVisitedSection\");\n // console.log(attributeValue);\n\n if (\n parseInt(currentSection!) === parseInt(endSection!) &&\n parseInt(lastVisitedSection!) === parseInt(endSection!)\n ) {\n // console.log(\"End of the scroll\");\n return;\n } else if (\n parseInt(currentSection!) === parseInt(startSection!) &&\n parseInt(lastVisitedSection!) === parseInt(startSection!)\n ) {\n // console.log(\"Start of the scroll\");\n return;\n } else {\n // console.log(\"Middle of the page\");\n timeout = setTimeout(() => {\n updateStickyImage(attributeValue);\n // store attribute value as lastVisitedSection in local storage\n localStorage.setItem(\"lastVisitedSection\", attributeValue);\n }, 50); // 50ms debounce delay\n }\n }\n\n const sections: NodeListOf<Element> = document.querySelectorAll(\"[fynd-scroll-source]\");\n sections.forEach((section: Element) => {\n ScrollTrigger.create({\n trigger: section,\n start: \"top 50%\",\n end: \"bottom 50%\", // Add an end position\n // markers: true,\n onEnter: () => {\n // console.log(\"Enter:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n onEnterBack: () => {\n // console.log(\"Enter Back:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n onLeave: () => {\n // console.log(\"Leave:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n onLeaveBack: () => {\n // console.log(\"Leave Back:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n });\n });\n}\n\nfunction updateStickyImage(identifier: string): void {\n const stickyImages: NodeListOf<Element> = document.querySelectorAll(\"[fynd-sticky-source]\");\n\n // Kill any existing animations\n gsap.killTweensOf(stickyImages);\n\n gsap.set(stickyImages, { opacity: 0 });\n\n // Get the active image\n const activeImage: Element | null = document.querySelector(\n `[fynd-sticky-source=\"${identifier}\"]`\n );\n\n if (activeImage) {\n gsap.to(activeImage, {\n opacity: 1,\n duration: 0.5, // Smooth transition for the active image\n ease: \"power1.out\",\n });\n }\n}\n\nfunction getScrollContainer(): void {\n const scrollContainer: NodeListOf<Element> = document.querySelectorAll(\"[fynd-scroll-container]\");\n gsap.to(scrollContainer, {\n opacity: 1,\n duration: 0.5,\n ease: \"power2.out\",\n delay: 0.5,\n });\n}\n\nfunction dynamiColorDesktop(): void {\n document.querySelectorAll(\"[fynd-sticky-bg]\").forEach((element: Element) => {\n let bgColor: string | null = element.getAttribute(\"fynd-sticky-bg\");\n if (bgColor && /^#([0-9A-F]{3}){1,2}$/i.test(bgColor)) {\n (element as HTMLElement).style.backgroundColor = bgColor;\n } else {\n console.warn(`Invalid hex color: ${bgColor} for element`, element);\n }\n });\n}\n\nfunction dynamicColorMobile(): void {\n const bgColorElement: Element | null = document.querySelector(\"[fynd-sticky-bg]\");\n const bgColor: string | null = bgColorElement?.getAttribute(\"fynd-sticky-bg\") || null;\n // console.log(\n // \"%cprogressive-scroll/index.js:151 bgColor\",\n // \"color: #007acc;\",\n // bgColor\n // );\n document.querySelectorAll(\"[fynd-card-bg-mobile]\").forEach((element: Element) => {\n if (bgColor && /^#([0-9A-F]{3}){1,2}$/i.test(bgColor)) {\n (element as HTMLElement).style.backgroundColor = bgColor;\n } else {\n console.warn(`Invalid hex color: ${bgColor} for element`, element);\n }\n });\n}\n// fynd-card-bg-mobile\n\nfunction handleResize(): void {\n // window.location.reload();\n if (window.innerWidth > 991) {\n dynamiColorDesktop();\n initScrollBlocks(); // Scroll blocks moved\n initProgressiveScroll(); // Initiating scroll triggers\n getScrollContainer(); // Showing container after initialization to avoid glitch\n } else {\n dynamicColorMobile();\n }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", handleResize);\n\n//dynamic color\n// document.addEventListener(\"DOMContentLoaded\", function () {\n// document.querySelectorAll(\"[fynd-sticky-bg]\").forEach((element) => {\n// let bgColor = element.getAttribute(\"fynd-sticky-bg\");\n// if (/^#([0-9A-F]{3}){1,2}$/i.test(bgColor)) {\n// element.style.backgroundColor = bgColor;\n// } else {\n// console.warn(`Invalid hex color: ${bgColor} for element`, element);\n// }\n// });\n// });\n\n// Export to make this file a module\nexport {};"],
5
- "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACCA,MAAM,OAAQ,OAAe;AAC7B,MAAM,gBAAiB,OAAe;AAEtC,OAAK,eAAe,aAAa;AAEjC,WAAS,aAAa,gBAAwB,gBAAwB,gBAA8B;AAClG,UAAM,SAAyB,SAAS,cAAc,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AACL,gBAAQ,KAAK,sBAAsB,OAAO,gBAAgB,OAAO;AAAA,MACnE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,WAAS,qBAA2B;AAClC,UAAM,iBAAiC,SAAS,cAAc,kBAAkB;AAChF,UAAM,UAAyB,gBAAgB,aAAa,gBAAgB,KAAK;AAMjF,aAAS,iBAAiB,uBAAuB,EAAE,QAAQ,CAAC,YAAqB;AAC/E,UAAI,WAAW,yBAAyB,KAAK,OAAO,GAAG;AACrD,QAAC,QAAwB,MAAM,kBAAkB;AAAA,MACnD,OAAO;AACL,gBAAQ,KAAK,sBAAsB,OAAO,gBAAgB,OAAO;AAAA,MACnE;AAAA,IACF,CAAC;AAAA,EACH;AAGA,WAAS,eAAqB;AAE5B,QAAI,OAAO,aAAa,KAAK;AAC3B,yBAAmB;AACnB,uBAAiB;AACjB,4BAAsB;AACtB,yBAAmB;AAAA,IACrB,OAAO;AACL,yBAAmB;AAAA,IACrB;AAAA,EACF;AAEA,WAAS,iBAAiB,oBAAoB,YAAY;",
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// TypeScript variant of progressive scroll functionality\n// Ensure GSAP and ScrollTrigger are loaded\n\n// Type declarations for GSAP (assuming it's loaded globally)\ndeclare global {\n interface Window {\n gsap: any;\n ScrollTrigger: any;\n }\n}\n\nconst gsap = (window as any).gsap;\nconst ScrollTrigger = (window as any).ScrollTrigger;\n\ngsap.registerPlugin(ScrollTrigger);\n\nfunction moveElements(sourceSelector: string, targetSelector: string, warningMessage: string): void {\n const target: Element | null = document.querySelector(targetSelector);\n if (!target) {\n console.warn(warningMessage);\n return;\n }\n\n const sources: NodeListOf<Element> = document.querySelectorAll(sourceSelector);\n if (sources.length === 0) {\n console.warn(`Warning: No elements found with attribute ${sourceSelector}`);\n return;\n }\n\n sources.forEach((source: Element) => target.appendChild(source));\n}\n\nfunction initScrollBlocks(): void {\n moveElements(\n \"[fynd-sticky-source]\",\n \"[fynd-sticky-target]\",\n \"Warning: No element found with attribute fynd-sticky-target\"\n );\n moveElements(\n \"[fynd-scroll-source]\",\n \"[fynd-scroll-target]\",\n \"Warning: No element found with attribute fynd-scroll-target\"\n );\n}\n\nfunction initProgressiveScroll(): void {\n gsap.registerPlugin(ScrollTrigger);\n\n // Add debounce to handle rapid scrolling\n let timeout: number | undefined;\n let lastVisitedSection: string | null;\n let currentSection: string | null;\n localStorage.setItem(\"lastVisitedSection\", \"null\");\n\n function debouncedScrollTrigger(attributeValue: string): void {\n clearTimeout(timeout);\n\n const scrollSections: NodeListOf<Element> = document.querySelectorAll(\"[fynd-scroll-source]\");\n const sectionCount: number = scrollSections.length;\n const startSection: string | null = scrollSections[0].getAttribute(\"fynd-scroll-source\");\n const endSection: string | null =\n scrollSections[sectionCount - 1].getAttribute(\"fynd-scroll-source\");\n let currentSection: string | null = document\n .querySelector(`[fynd-scroll-source=\"${attributeValue}\"]`)\n ?.getAttribute(\"fynd-scroll-source\") || null;\n lastVisitedSection = localStorage.getItem(\"lastVisitedSection\");\n // console.log(attributeValue);\n\n if (\n parseInt(currentSection!) === parseInt(endSection!) &&\n parseInt(lastVisitedSection!) === parseInt(endSection!)\n ) {\n // console.log(\"End of the scroll\");\n return;\n } else if (\n parseInt(currentSection!) === parseInt(startSection!) &&\n parseInt(lastVisitedSection!) === parseInt(startSection!)\n ) {\n // console.log(\"Start of the scroll\");\n return;\n } else {\n // console.log(\"Middle of the page\");\n timeout = setTimeout(() => {\n updateStickyImage(attributeValue);\n // store attribute value as lastVisitedSection in local storage\n localStorage.setItem(\"lastVisitedSection\", attributeValue);\n }, 50); // 50ms debounce delay\n }\n }\n\n const sections: NodeListOf<Element> = document.querySelectorAll(\"[fynd-scroll-source]\");\n sections.forEach((section: Element) => {\n ScrollTrigger.create({\n trigger: section,\n start: \"top 50%\",\n end: \"bottom 50%\", // Add an end position\n // markers: true,\n onEnter: () => {\n // console.log(\"Enter:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n onEnterBack: () => {\n // console.log(\"Enter Back:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n onLeave: () => {\n // console.log(\"Leave:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n onLeaveBack: () => {\n // console.log(\"Leave Back:\", section.getAttribute(\"fynd-scroll-source\"));\n debouncedScrollTrigger(section.getAttribute(\"fynd-scroll-source\")!);\n },\n });\n });\n}\n\nfunction updateStickyImage(identifier: string): void {\n const stickyImages: NodeListOf<Element> = document.querySelectorAll(\"[fynd-sticky-source]\");\n\n // Kill any existing animations\n gsap.killTweensOf(stickyImages);\n\n gsap.set(stickyImages, { opacity: 0 });\n\n // Get the active image\n const activeImage: Element | null = document.querySelector(\n `[fynd-sticky-source=\"${identifier}\"]`\n );\n\n if (activeImage) {\n gsap.to(activeImage, {\n opacity: 1,\n duration: 0.5, // Smooth transition for the active image\n ease: \"power1.out\",\n });\n }\n}\n\nfunction getScrollContainer(): void {\n const scrollContainer: NodeListOf<Element> = document.querySelectorAll(\"[fynd-scroll-container]\");\n gsap.to(scrollContainer, {\n opacity: 1,\n duration: 0.5,\n ease: \"power2.out\",\n delay: 0.5,\n });\n}\n\nfunction dynamiColorDesktop(): void {\n document.querySelectorAll(\"[fynd-sticky-bg]\").forEach((element: Element) => {\n let bgColor: string | null = element.getAttribute(\"fynd-sticky-bg\");\n if (bgColor && /^#([0-9A-F]{3}){1,2}$/i.test(bgColor)) {\n (element as HTMLElement).style.backgroundColor = bgColor;\n } else {\n console.warn(`Invalid hex color: ${bgColor} for element`, element);\n }\n });\n}\n\nfunction dynamicColorMobile(): void {\n const bgColorElement: Element | null = document.querySelector(\"[fynd-sticky-bg]\");\n const bgColor: string | null = bgColorElement?.getAttribute(\"fynd-sticky-bg\") || null;\n // console.log(\n // \"%cprogressive-scroll/index.js:151 bgColor\",\n // \"color: #007acc;\",\n // bgColor\n // );\n document.querySelectorAll(\"[fynd-card-bg-mobile]\").forEach((element: Element) => {\n if (bgColor && /^#([0-9A-F]{3}){1,2}$/i.test(bgColor)) {\n (element as HTMLElement).style.backgroundColor = bgColor;\n } else {\n console.warn(`Invalid hex color: ${bgColor} for element`, element);\n }\n });\n}\n// fynd-card-bg-mobile\n\nfunction handleResize(): void {\n // window.location.reload();\n if (window.innerWidth > 991) {\n dynamiColorDesktop();\n initScrollBlocks(); // Scroll blocks moved\n initProgressiveScroll(); // Initiating scroll triggers\n getScrollContainer(); // Showing container after initialization to avoid glitch\n } else {\n dynamicColorMobile();\n }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", handleResize);\n\n//dynamic color\n// document.addEventListener(\"DOMContentLoaded\", function () {\n// document.querySelectorAll(\"[fynd-sticky-bg]\").forEach((element) => {\n// let bgColor = element.getAttribute(\"fynd-sticky-bg\");\n// if (/^#([0-9A-F]{3}){1,2}$/i.test(bgColor)) {\n// element.style.backgroundColor = bgColor;\n// } else {\n// console.warn(`Invalid hex color: ${bgColor} for element`, element);\n// }\n// });\n// });\n\n// Export to make this file a module\nexport {};"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACCA,MAAM,OAAQ,OAAe;AAC7B,MAAM,gBAAiB,OAAe;AAEtC,OAAK,eAAe,aAAa;AAEjC,WAAS,aAAa,gBAAwB,gBAAwB,gBAA8B;AAClG,UAAM,SAAyB,S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ACnD,OAAO;AACL,gBAAQ,KAAK,sBAAsB,OAAO,gBAAgB,OAAO;AAAA,MACnE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,WAAS,qBAA2B;AAClC,UAAM,iBAAiC,SAAS,cAAc,kBAAkB;AAChF,UAAM,UAAyB,gBAAgB,aAAa,gBAAgB,KAAK;AAMjF,aAAS,iBAAiB,uBAAuB,EAAE,QAAQ,CAAC,YAAqB;AAC/E,UAAI,WAAW,yBAAyB,KAAK,OAAO,GAAG;AACrD,QAAC,QAAwB,MAAM,kBAAkB;AAAA,MACnD,OAAO;AACL,gBAAQ,KAAK,sBAAsB,OAAO,gBAAgB,OAAO;AAAA,MACnE;AAAA,IACF,CAAC;AAAA,EACH;AAGA,WAAS,eAAqB;AAE5B,QAAI,OAAO,aAAa,KAAK;AAC3B,yBAAmB;AACnB,uBAAiB;AACjB,4BAAsB;AACtB,yBAAmB;AAAA,IACrB,OAAO;AACL,yBAAmB;AAAA,IACrB;AAAA,EACF;AAEA,WAAS,iBAAiB,oBAAoB,YAAY;",
6
6
  "names": ["currentSection"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bin/live-reload.js", "../../src/quick-fix/reload.ts"],
4
- "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "function handleOneTimeReload(): void {\n const loaded = sessionStorage.getItem('pageLoaded');\n\n if (!loaded || loaded === 'false') {\n sessionStorage.setItem('pageLoaded', 'true');\n window.location.reload();\n }\n}\ndocument.addEventListener('DOMContentLoaded', handleOneTimeReload);"],
5
- "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACVA,WAAS,sBAA4B;AACjC,UAAM,SAAS,eAAe,QAAQ,YAAY;AAElD,QAAI,CAAC,UAAU,WAAW,SAAS;AAC/B,qBAAe,QAAQ,cAAc,MAAM;AAC3C,aAAO,SAAS,OAAO;AAAA,IAC3B;AAAA,EACJ;AACA,WAAS,iBAAiB,oBAAoB,mBAAmB;",
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "function handleOneTimeReload(): void {\n const loaded = sessionStorage.getItem('pageLoaded');\n\n if (!loaded || loaded === 'false') {\n sessionStorage.setItem('pageLoaded', 'true');\n window.location.reload();\n }\n}\ndocument.addEventListener('DOMContentLoaded', handleOneTimeReload);"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACVA,WAAS,sBAA4B;AACjC,UAAM,SAAS,eAAe,QAAQ,YAAY;AAElD,QAAI,CAAC,UAAU,WAAW,SAAS;AAC/B,qBAAe,QAAQ,cAAc,MAAM;AAC3C,aAAO,SAAS,OAAO;AAAA,IAC3B;AAAA,EACJ;AACA,WAAS,iBAAiB,oBAAoB,mBAAmB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bin/live-reload.js", "../../src/seo/schema.ts"],
4
- "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// Dynamic Schema Generator for Fynd.com - Updated for Option 2\n\n// Type definitions for Schema.org entities\ninterface SchemaOrganization {\n \"@type\": \"Organization\";\n \"@id\": string;\n name: string;\n url: string;\n logo: string;\n sameAs: string[];\n description: string;\n}\n\ninterface SchemaWebsite {\n \"@type\": \"WebSite\";\n \"@id\": string;\n url: string;\n name: string;\n description: string;\n publisher: { \"@id\": string };\n potentialAction: {\n \"@type\": \"SearchAction\";\n target: {\n \"@type\": \"EntryPoint\";\n urlTemplate: string;\n };\n \"query-input\": string;\n };\n}\n\ninterface BreadcrumbItem {\n name: string;\n url: string;\n}\n\ninterface SchemaBreadcrumbList {\n \"@type\": \"BreadcrumbList\";\n itemListElement: Array<{\n \"@type\": \"ListItem\";\n position: number;\n name: string;\n item: string;\n }>;\n}\n\ninterface SchemaWebPage {\n \"@type\": \"WebPage\";\n \"@id\": string;\n url: string;\n name: string;\n description: string;\n isPartOf: { \"@id\": string };\n mainEntity?: any;\n}\n\ninterface SolutionData {\n name: string;\n url: string;\n description: string;\n features?: string[];\n audience?: string;\n category?: string;\n}\n\ninterface SchemaSoftwareApplication {\n \"@type\": \"SoftwareApplication\";\n \"@id\": string;\n name: string;\n applicationCategory: string;\n operatingSystem: string;\n featureList: string[];\n audience: {\n \"@type\": \"Audience\";\n audienceType: string;\n };\n url: string;\n description: string;\n manufacturer: { \"@id\": string };\n}\n\ninterface ProductData {\n name: string;\n url: string;\n description: string;\n ratingValue?: string;\n reviewCount?: string;\n price?: string;\n currency?: string;\n availability?: string;\n}\n\ninterface SchemaProduct {\n \"@type\": \"Product\";\n name: string;\n url: string;\n description: string;\n brand: { \"@id\": string };\n offers?: {\n \"@type\": \"Offer\";\n price: string;\n priceCurrency: string;\n availability: string;\n validFrom?: string;\n };\n aggregateRating?: {\n \"@type\": \"AggregateRating\";\n ratingValue: string;\n reviewCount: string;\n };\n}\n\ninterface FAQItem {\n question: string;\n answer: string;\n}\n\ninterface SchemaFAQPage {\n \"@type\": \"FAQPage\";\n mainEntity: Array<{\n \"@type\": \"Question\";\n name: string;\n acceptedAnswer: {\n \"@type\": \"Answer\";\n text: string;\n };\n }>;\n}\n\ninterface ArticleData {\n title: string;\n url: string;\n description: string;\n author?: string;\n publishDate: string;\n modifyDate?: string;\n image?: string;\n}\n\ninterface SchemaArticle {\n \"@type\": \"Article\";\n headline: string;\n description: string;\n image?: string;\n author: {\n \"@type\": \"Person\";\n name: string;\n };\n publisher: { \"@id\": string };\n datePublished: string;\n dateModified: string;\n mainEntityOfPage: {\n \"@type\": \"WebPage\";\n \"@id\": string;\n };\n}\n\ninterface EbookData {\n name: string;\n url: string;\n description: string;\n author?: string;\n isbn?: string;\n bookFormat?: string;\n price?: string;\n currency?: string;\n availability?: string;\n}\n\ninterface SchemaBook {\n \"@type\": \"Book\";\n \"@id\": string;\n name: string;\n description: string;\n bookFormat: string;\n author: {\n \"@type\": \"Person\";\n name: string;\n };\n publisher: { \"@id\": string };\n isbn?: string;\n offers?: {\n \"@type\": \"Offer\";\n price: string;\n priceCurrency: string;\n availability: string;\n };\n}\n\ninterface PageConfig {\n url: string;\n title: string;\n description?: string;\n pageType: string;\n breadcrumbs?: BreadcrumbItem[];\n solutionData?: SolutionData;\n asProduct?: boolean; \n articleData?: ArticleData;\n productData?: ProductData;\n ebookData?: EbookData;\n faqs?: FAQItem[] | null;\n mainEntity?: any;\n}\n\ninterface SchemaGraph {\n \"@context\": \"https://schema.org\";\n \"@graph\": any[];\n}\n\n// Extend Window interface for FyndSchema\ndeclare global {\n interface Window {\n FyndSchema: {\n generator: typeof FyndSchemaGenerator;\n configManager: typeof PageConfigManager;\n };\n }\n}\n\nclass FyndSchemaGenerator {\n private baseUrl: string;\n private organizationData: SchemaOrganization;\n\n constructor() {\n this.baseUrl = \"https://www.fynd.com\";\n this.organizationData = {\n \"@type\": \"Organization\",\n \"@id\": `${this.baseUrl}#organization`,\n name: \"Fynd\",\n url: this.baseUrl,\n logo: `https://cdn.prod.website-files.com/67a9c8e5f2c74ac8c2c9b88b/67ee6819577f1aeb4e6ae5c9_Fynd.avif`,\n sameAs: [\n \"https://www.linkedin.com/company/fynd-shopsense\",\n \"https://x.com/FyndCommerce\",\n \"https://www.instagram.com/fyndcommerce/\",\n ],\n description:\n \"Fynd is an AI-powered unified commerce platform enabling brands to manage end-to-end retail operations.\",\n };\n }\n\n // Generate base website schema\n generateWebsiteSchema(): SchemaWebsite {\n return {\n \"@type\": \"WebSite\",\n \"@id\": `${this.baseUrl}#website`,\n url: this.baseUrl,\n name: \"Fynd\",\n description: \"AI-powered unified commerce platform\",\n publisher: { \"@id\": `${this.baseUrl}#organization` },\n potentialAction: {\n \"@type\": \"SearchAction\",\n target: {\n \"@type\": \"EntryPoint\",\n urlTemplate: `${this.baseUrl}/search?q={search_term_string}`,\n },\n \"query-input\": \"required name=search_term_string\",\n },\n };\n }\n\n // Generate breadcrumb schema\n generateBreadcrumbSchema(breadcrumbs: BreadcrumbItem[]): SchemaBreadcrumbList {\n return {\n \"@type\": \"BreadcrumbList\",\n itemListElement: breadcrumbs.map((item, index) => ({\n \"@type\": \"ListItem\",\n position: index + 1,\n name: item.name,\n item: item.url,\n })),\n };\n }\n\n // Generate WebPage schema\n generateWebPageSchema(pageData: {\n url: string;\n title: string;\n description?: string;\n mainEntity?: any;\n }): SchemaWebPage {\n const schema: SchemaWebPage = {\n \"@type\": \"WebPage\",\n \"@id\": pageData.url,\n url: pageData.url,\n name: pageData.title,\n description: pageData.description || \"\",\n isPartOf: { \"@id\": `${this.baseUrl}#website` },\n };\n\n if (pageData.mainEntity) {\n schema.mainEntity = pageData.mainEntity;\n }\n\n return schema;\n }\n\n// Updated method signature - add optional productData parameter\ngenerateSoftwareSchema(solutionData: SolutionData, productData?: ProductData): SchemaSoftwareApplication {\n // Define category to audience mapping\n const categoryAudienceMap: { [key: string]: string } = {\n \"E-commerce Platform Software\": \"D2C brand managers, digital commerce heads, and marketing teams launching or scaling multi-channel storefronts\",\n \"Omnichannel Retail Software\": \"Retail operations managers, franchise leads, and store teams seeking unified POS, self-checkout, and in-store analytics\",\n \"E-commerce Fulfillment and Logistics Software\": \"Supply chain heads, logistics managers, warehouse leads managing inventory, delivery, and returns\",\n \"Retail AI Automation Platform\": \"Product owners, CX leads, marketers, and developers adopting AI for cataloging, personalization, creative workflows, or customer support\"\n };\n\n const applicationCategory = solutionData.category || \"RetailSoftware\";\n \n // Determine audience: check mapping first, then data attribute, then default\n let audienceType: string;\n if (categoryAudienceMap[applicationCategory]) {\n audienceType = categoryAudienceMap[applicationCategory];\n } else if (solutionData.audience) {\n audienceType = solutionData.audience;\n } else {\n audienceType = \"Retail Business Teams\";\n }\n\n const schema: any = {\n \"@type\": \"SoftwareApplication\",\n \"@id\": `${solutionData.url}#software`,\n name: solutionData.name,\n applicationCategory: applicationCategory,\n operatingSystem: \"Web\",\n audience: {\n \"@type\": \"Audience\",\n audienceType: audienceType,\n },\n url: solutionData.url,\n description: solutionData.description,\n manufacturer: { \"@id\": `${this.baseUrl}#organization` },\n };\n\n // Only add featureList if it exists and has items\n if (solutionData.features && solutionData.features.length > 0) {\n schema.featureList = solutionData.features;\n }\n\n // \u2705 NEW: Add product-specific properties if productData is provided\n if (productData) {\n // Add offers if pricing data is available\n if (productData.price) {\n schema.offers = {\n \"@type\": \"Offer\",\n price: productData.price,\n priceCurrency: productData.currency || \"USD\",\n availability: productData.availability || \"https://schema.org/InStock\",\n validFrom: new Date().toISOString(),\n };\n }\n\n // Add aggregate rating if available\n if (productData.ratingValue && productData.reviewCount) {\n schema.aggregateRating = {\n \"@type\": \"AggregateRating\",\n ratingValue: productData.ratingValue,\n reviewCount: productData.reviewCount,\n };\n }\n\n // Add product-specific properties that make sense for software\n if (productData.availability) {\n schema.availability = productData.availability;\n }\n }\n\n return schema;\n}\n\n // Generate Product schema (only for actual product pages, not solutions)\n generateProductSchema(productData: ProductData): SchemaProduct {\n const schema: SchemaProduct = {\n \"@type\": \"Product\",\n name: productData.name,\n url: productData.url,\n description: productData.description,\n brand: { \"@id\": `${this.baseUrl}#organization` },\n };\n\n // // Add offers if pricing data is available\n // if (productData.price) {\n // schema.offers = {\n // \"@type\": \"Offer\",\n // price: productData.price,\n // priceCurrency: productData.currency || \"USD\",\n // availability: productData.availability || \"https://schema.org/InStock\",\n // validFrom: new Date().toISOString(),\n // };\n // }\n\n // Add rating if available\n if (productData.ratingValue && productData.reviewCount) {\n schema.aggregateRating = {\n \"@type\": \"AggregateRating\",\n ratingValue: productData.ratingValue,\n reviewCount: productData.reviewCount,\n };\n }\n\n return schema;\n }\n\n // Generate Book schema for ebook pages\ngenerateBookSchema(ebookData: EbookData): SchemaBook {\n const schema: SchemaBook = {\n \"@type\": \"Book\",\n \"@id\": `${ebookData.url}#book`,\n name: ebookData.name,\n description: ebookData.description,\n bookFormat: \"https://schema.org/EBook\",\n author: {\n \"@type\": \"Person\",\n name: ebookData.author || \"Fynd Team\"\n },\n publisher: { \"@id\": `${this.baseUrl}#organization` }\n };\n\n // Add ISBN if provided\n if (ebookData.isbn) {\n schema.isbn = ebookData.isbn;\n }\n\n // Add offers if price is provided\n if (ebookData.price !== undefined) {\n schema.offers = {\n \"@type\": \"Offer\",\n price: ebookData.price || \"0\",\n priceCurrency: ebookData.currency || \"USD\",\n availability: ebookData.availability || \"https://schema.org/InStock\"\n };\n }\n\n return schema;\n}\n\n // Generate FAQ schema\n generateFAQSchema(faqs: FAQItem[]): SchemaFAQPage | null {\n if (!faqs || faqs.length === 0) return null;\n\n return {\n \"@type\": \"FAQPage\",\n mainEntity: faqs.map((faq) => ({\n \"@type\": \"Question\",\n name: faq.question,\n acceptedAnswer: {\n \"@type\": \"Answer\",\n text: faq.answer,\n },\n })),\n };\n }\n\n // Generate Article schema for blog posts\n generateArticleSchema(articleData: ArticleData): SchemaArticle {\n return {\n \"@type\": \"Article\",\n headline: articleData.title,\n description: articleData.description,\n image: articleData.image,\n author: {\n \"@type\": \"Person\",\n name: articleData.author || \"Fynd Team\",\n },\n publisher: { \"@id\": `${this.baseUrl}#organization` },\n datePublished: articleData.publishDate,\n dateModified: articleData.modifyDate || articleData.publishDate,\n mainEntityOfPage: {\n \"@type\": \"WebPage\",\n \"@id\": articleData.url,\n },\n };\n }\n\n // Main method to generate complete schema based on page type\n generateSchema(pageConfig: PageConfig): SchemaGraph {\n const graph: any[] = [];\n\n // Always include organization\n graph.push(this.organizationData);\n\n // Always include website\n graph.push(this.generateWebsiteSchema());\n\n // Add webpage schema\n const webPageSchema = this.generateWebPageSchema({\n url: pageConfig.url || window.location.href,\n title: pageConfig.title || document.title,\n description:\n pageConfig.description ||\n (document.querySelector('meta[name=\"description\"]') as HTMLMetaElement)?.content,\n mainEntity: pageConfig.mainEntity,\n });\n graph.push(webPageSchema);\n\n // Add breadcrumbs if provided\n if (pageConfig.breadcrumbs) {\n graph.push(this.generateBreadcrumbSchema(pageConfig.breadcrumbs));\n }\n\n // Page type specific schemas\n switch (pageConfig.pageType) {\n case \"solution\":\n if (pageConfig.solutionData) {\n const softwareSchema = this.generateSoftwareSchema(\n pageConfig.solutionData\n );\n graph.push(softwareSchema);\n\n // Set software as mainEntity for the webpage\n webPageSchema.mainEntity = { \"@id\": `${pageConfig.solutionData.url}#software` };\n\n // Add Product schema if asProduct is true AND we have rating data\n if (pageConfig.asProduct && pageConfig.productData) {\n const productSchema = this.generateProductSchema(pageConfig.productData);\n // Only add if it has required fields (offers, rating, or review)\n if (productSchema.offers || productSchema.aggregateRating) {\n graph.push(productSchema);\n } else {\n console.warn(\"\uD83D\uDD0D Fynd Schema: Product schema requires offers, aggregateRating, or review. Skipping...\");\n }\n }\n }\n break;\n\n case \"article\":\n if (pageConfig.articleData) {\n graph.push(this.generateArticleSchema(pageConfig.articleData));\n }\n break;\n\n case \"product\":\n // Only generate Product schema for actual product pages\n if (pageConfig.productData) {\n const productSchema = this.generateProductSchema(pageConfig.productData);\n \n // Only add if it has required fields (offers, rating, or review)\n if (productSchema.offers || productSchema.aggregateRating) {\n graph.push(productSchema);\n } else {\n console.warn(\"\uD83D\uDD0D Fynd Schema: Product schema requires offers, aggregateRating, or review. Skipping...\");\n }\n }\n break;\n\ncase \"ebook\":\n if (pageConfig.ebookData) {\n const bookSchema = this.generateBookSchema(pageConfig.ebookData);\n graph.push(bookSchema);\n // Set book as mainEntity for the webpage\n webPageSchema.mainEntity = { \"@id\": `${pageConfig.ebookData.url}#book` };\n }\n break;\n }\n\n // Add FAQ if provided\n if (pageConfig.faqs) {\n const faqSchema = this.generateFAQSchema(pageConfig.faqs);\n if (faqSchema) graph.push(faqSchema);\n }\n\n return {\n \"@context\": \"https://schema.org\",\n \"@graph\": graph,\n };\n }\n\n // Inject schema into page\n injectSchema(schema: SchemaGraph): void {\n // Remove existing schema script if any\n const existingScript = document.querySelector('script[data-schema=\"fynd\"]');\n if (existingScript) {\n existingScript.remove();\n }\n\n // Create and inject new schema script\n const script = document.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.setAttribute(\"data-schema\", \"fynd\");\n script.textContent = JSON.stringify(schema, null, 2);\n document.head.appendChild(script);\n }\n}\n\n// Page Configuration Manager\nclass PageConfigManager {\n // Helper method to safely parse JSON\n private static safeJsonParse<T>(jsonString: string, fallback: T, context?: string): T {\n try {\n return JSON.parse(jsonString);\n } catch (error) {\n console.warn(`\uD83D\uDD0D Fynd Schema: Failed to parse JSON${context ? ` for ${context}` : ''}:`, {\n jsonString,\n error: error instanceof Error ? error.message : error\n });\n return fallback;\n }\n }\n\n // Helper method to generate random rating\n private static getRandomRating(): string {\n const ratings = ['4.5', '4.6', '4.7', '4.8', '4.9'];\n return ratings[Math.floor(Math.random() * ratings.length)];\n }\n\n // Helper method to generate random review count\n private static getRandomReviewCount(): string {\n return Math.floor(Math.random() * (200 - 120 + 1) + 120).toString();\n }\n\n static getConfigFromDataAttributes(): PageConfig {\n const body = document.body;\n const config: PageConfig = {\n url: \"\",\n title: \"\",\n description: \"\",\n pageType: \"default\",\n };\n \n\n \n // Get basic page info\n config.url = window.location.href;\n config.title = document.title;\n config.description = (document.querySelector(\n 'meta[name=\"description\"]'\n ) as HTMLMetaElement)?.content;\n \n // Get page type from data attribute\n config.pageType = body.dataset.pageType || \"default\";\n \n // Check if URL contains /solutions/ - if yes, override pageType to \"solution\"\n if (window.location.pathname.includes('/solutions/')) {\n config.pageType = \"solution\";\n } else {\n // Get asProduct flag from data attribute for non-solution URLs\n config.asProduct = body.dataset.asProduct === \"true\";\n }\n \n // Get breadcrumbs from data attribute or generate from URL\n if (body.dataset.breadcrumbs) {\n config.breadcrumbs = this.safeJsonParse(\n body.dataset.breadcrumbs, \n this.generateBreadcrumbsFromURL(), \n 'breadcrumbs'\n );\n } else {\n config.breadcrumbs = this.generateBreadcrumbsFromURL();\n }\n \n // Page type specific configurations\n switch (config.pageType) {\n case \"solution\":\n config.solutionData = {\n name: body.dataset.solutionName || document.title,\n url: config.url,\n description: config.description || \"\",\n features: body.dataset.features\n ? this.safeJsonParse(body.dataset.features, [], 'features')\n : [],\n audience: body.dataset.audience,\n category: body.dataset.category,\n };\n // For solution pages (including URL-based), always prepare product data\n if (config.asProduct) {\n config.productData = {\n name: config.solutionData.name,\n url: config.solutionData.url,\n description: config.solutionData.description,\n ratingValue: body.dataset.ratingValue || this.getRandomRating(),\n reviewCount: body.dataset.reviewCount || this.getRandomReviewCount(),\n price: body.dataset.price,\n currency: body.dataset.currency,\n availability: body.dataset.availability,\n };\n }\n break;\n \n case \"article\":\n config.articleData = {\n title: config.title,\n url: config.url,\n description: config.description || \"\",\n author: body.dataset.author,\n publishDate: body.dataset.publishDate || new Date().toISOString(),\n modifyDate: body.dataset.modifyDate,\n image:\n body.dataset.image ||\n (document.querySelector('meta[property=\"og:image\"]') as HTMLMetaElement)?.content,\n };\n break;\n \n case \"product\":\n config.productData = {\n name: body.dataset.productName || document.title,\n url: config.url,\n description: config.description || \"\",\n ratingValue: body.dataset.ratingValue || this.getRandomRating(),\n reviewCount: body.dataset.reviewCount || this.getRandomReviewCount(),\n price: body.dataset.price,\n currency: body.dataset.currency,\n availability: body.dataset.availability,\n };\n break;\n\n // In the switch statement, add this case:\ncase \"ebook\":\n config.ebookData = {\n name: body.dataset.ebookName || document.title,\n url: config.url,\n description: config.description || \"\",\n author: body.dataset.author,\n isbn: body.dataset.isbn,\n bookFormat: \"EBook\",\n price: body.dataset.price || \"0\",\n currency: body.dataset.currency || \"USD\",\n availability: body.dataset.availability || \"https://schema.org/InStock\"\n };\n break;\n }\n \n // Auto-detect FAQs from page content\n config.faqs = this.extractFAQsFromPage();\n \n return config;\n }\n\n static extractFAQsFromPage(): FAQItem[] | null {\n const faqs: FAQItem[] = [];\n\n // Look for Fynd FAQ structure using custom attributes\n const faqWrappers = document.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"]'\n );\n\n faqWrappers.forEach((wrapper) => {\n // Find the toggle element (contains the question)\n const toggle = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n // Find the content element (contains the answer)\n const content = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n\n if (toggle && content) {\n // Extract question from the toggle div\n const questionDiv = toggle.querySelector(\n 'div[class*=\"title\"], div[data-text-style], .accordian-title'\n );\n const questionText = questionDiv ? (questionDiv.textContent || \"\").trim() : \"\";\n\n // Extract answer from the content div - look for richtext\n const richTextDiv = content.querySelector(\n '.richtext, [class*=\"richtext\"], .rich-text, [class*=\"rich-text\"]'\n );\n const answerText = richTextDiv\n ? (richTextDiv.textContent || \"\").trim()\n : (content.textContent || \"\").trim();\n\n if (questionText && answerText) {\n faqs.push({\n question: questionText,\n answer: answerText,\n });\n }\n }\n });\n\n return faqs.length > 0 ? faqs : null;\n }\n\n static generateBreadcrumbsFromURL(): BreadcrumbItem[] {\n const pathSegments = window.location.pathname\n .split(\"/\")\n .filter((segment) => segment);\n const breadcrumbs: BreadcrumbItem[] = [{ name: \"Home\", url: \"https://www.fynd.com\" }];\n\n let currentPath = \"https://www.fynd.com\";\n pathSegments.forEach((segment) => {\n currentPath += `/${segment}`;\n breadcrumbs.push({\n name:\n segment.charAt(0).toUpperCase() + segment.slice(1).replace(\"-\", \" \"),\n url: currentPath,\n });\n });\n\n return breadcrumbs;\n }\n}\n\n// Auto-initialize when DOM is ready\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n try {\n const schemaGenerator = new FyndSchemaGenerator();\n const pageConfig = PageConfigManager.getConfigFromDataAttributes();\n const schema = schemaGenerator.generateSchema(pageConfig);\n schemaGenerator.injectSchema(schema);\n \n // Verify injection\n const injectedScript = document.querySelector('script[data-schema=\"fynd\"]');\n if (!injectedScript) {\n console.error(\" Fynd Schema: Schema script NOT found in DOM\");\n }\n \n } catch (error) {\n console.error(\" Fynd Schema: Error during initialization:\", error);\n }\n});\n\n// Export for manual usage\n(window as any).FyndSchema = {\n generator: FyndSchemaGenerator,\n configManager: PageConfigManager,\n};\n\n// Export to make this file a module (required for global declarations)\nexport {};"],
5
- "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACgNA,MAAM,sBAAN,MAA0B;AAAA,IAIxB,cAAc;AACZ,WAAK,UAAU;AACf,WAAK,mBAAmB;AAAA,QACtB,SAAS;AAAA,QACT,OAAO,GAAG,KAAK,OAAO;AAAA,QACtB,MAAM;AAAA,QACN,KAAK,KAAK;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,UACN;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,aACE;AAAA,MACJ;AA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,KAAK,GAAG;AAAA,UACrE,KAAK;AAAA,QACP,CAAC;AAAA,MACH,CAAC;AAED,aAAO;AAAA,IACT;AAAA,EACF;AAGA,WAAS,iBAAiB,oBAAoB,WAAY;AACxD,QAAI;AACF,YAAM,kBAAkB,IAAI,oBAAoB;AAChD,YAAM,aAAa,kBAAkB,4BAA4B;AACjE,YAAM,SAAS,gBAAgB,eAAe,UAAU;AACxD,sBAAgB,aAAa,MAAM;AAGnC,YAAM,iBAAiB,SAAS,cAAc,4BAA4B;AAC1E,UAAI,CAAC,gBAAgB;AACnB,gBAAQ,MAAM,8CAA8C;AAAA,MAC9D;AAAA,IAEF,SAAS,OAAO;AACd,cAAQ,MAAM,8CAA8C,KAAK;AAAA,IACnE;AAAA,EACF,CAAC;AAGD,EAAC,OAAe,aAAa;AAAA,IAC3B,WAAW;AAAA,IACX,eAAe;AAAA,EACjB;",
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// Dynamic Schema Generator for Fynd.com - Updated for Option 2\n\n// Type definitions for Schema.org entities\ninterface SchemaOrganization {\n \"@type\": \"Organization\";\n \"@id\": string;\n name: string;\n url: string;\n logo: string;\n sameAs: string[];\n description: string;\n}\n\ninterface SchemaWebsite {\n \"@type\": \"WebSite\";\n \"@id\": string;\n url: string;\n name: string;\n description: string;\n publisher: { \"@id\": string };\n potentialAction: {\n \"@type\": \"SearchAction\";\n target: {\n \"@type\": \"EntryPoint\";\n urlTemplate: string;\n };\n \"query-input\": string;\n };\n}\n\ninterface BreadcrumbItem {\n name: string;\n url: string;\n}\n\ninterface SchemaBreadcrumbList {\n \"@type\": \"BreadcrumbList\";\n itemListElement: Array<{\n \"@type\": \"ListItem\";\n position: number;\n name: string;\n item: string;\n }>;\n}\n\ninterface SchemaWebPage {\n \"@type\": \"WebPage\";\n \"@id\": string;\n url: string;\n name: string;\n description: string;\n isPartOf: { \"@id\": string };\n mainEntity?: any;\n}\n\ninterface SolutionData {\n name: string;\n url: string;\n description: string;\n features?: string[];\n audience?: string;\n category?: string;\n}\n\ninterface SchemaSoftwareApplication {\n \"@type\": \"SoftwareApplication\";\n \"@id\": string;\n name: string;\n applicationCategory: string;\n operatingSystem: string;\n featureList: string[];\n audience: {\n \"@type\": \"Audience\";\n audienceType: string;\n };\n url: string;\n description: string;\n manufacturer: { \"@id\": string };\n}\n\ninterface ProductData {\n name: string;\n url: string;\n description: string;\n ratingValue?: string;\n reviewCount?: string;\n price?: string;\n currency?: string;\n availability?: string;\n}\n\ninterface SchemaProduct {\n \"@type\": \"Product\";\n name: string;\n url: string;\n description: string;\n brand: { \"@id\": string };\n offers?: {\n \"@type\": \"Offer\";\n price: string;\n priceCurrency: string;\n availability: string;\n validFrom?: string;\n };\n aggregateRating?: {\n \"@type\": \"AggregateRating\";\n ratingValue: string;\n reviewCount: string;\n };\n}\n\ninterface FAQItem {\n question: string;\n answer: string;\n}\n\ninterface SchemaFAQPage {\n \"@type\": \"FAQPage\";\n mainEntity: Array<{\n \"@type\": \"Question\";\n name: string;\n acceptedAnswer: {\n \"@type\": \"Answer\";\n text: string;\n };\n }>;\n}\n\ninterface ArticleData {\n title: string;\n url: string;\n description: string;\n author?: string;\n publishDate: string;\n modifyDate?: string;\n image?: string;\n}\n\ninterface SchemaArticle {\n \"@type\": \"Article\";\n headline: string;\n description: string;\n image?: string;\n author: {\n \"@type\": \"Person\";\n name: string;\n };\n publisher: { \"@id\": string };\n datePublished: string;\n dateModified: string;\n mainEntityOfPage: {\n \"@type\": \"WebPage\";\n \"@id\": string;\n };\n}\n\ninterface EbookData {\n name: string;\n url: string;\n description: string;\n author?: string;\n isbn?: string;\n bookFormat?: string;\n price?: string;\n currency?: string;\n availability?: string;\n}\n\ninterface SchemaBook {\n \"@type\": \"Book\";\n \"@id\": string;\n name: string;\n description: string;\n bookFormat: string;\n author: {\n \"@type\": \"Person\";\n name: string;\n };\n publisher: { \"@id\": string };\n isbn?: string;\n offers?: {\n \"@type\": \"Offer\";\n price: string;\n priceCurrency: string;\n availability: string;\n };\n}\n\ninterface PageConfig {\n url: string;\n title: string;\n description?: string;\n pageType: string;\n breadcrumbs?: BreadcrumbItem[];\n solutionData?: SolutionData;\n asProduct?: boolean; \n articleData?: ArticleData;\n productData?: ProductData;\n ebookData?: EbookData;\n faqs?: FAQItem[] | null;\n mainEntity?: any;\n}\n\ninterface SchemaGraph {\n \"@context\": \"https://schema.org\";\n \"@graph\": any[];\n}\n\n// Extend Window interface for FyndSchema\ndeclare global {\n interface Window {\n FyndSchema: {\n generator: typeof FyndSchemaGenerator;\n configManager: typeof PageConfigManager;\n };\n }\n}\n\nclass FyndSchemaGenerator {\n private baseUrl: string;\n private organizationData: SchemaOrganization;\n\n constructor() {\n this.baseUrl = \"https://www.fynd.com\";\n this.organizationData = {\n \"@type\": \"Organization\",\n \"@id\": `${this.baseUrl}#organization`,\n name: \"Fynd\",\n url: this.baseUrl,\n logo: `https://cdn.prod.website-files.com/67a9c8e5f2c74ac8c2c9b88b/67ee6819577f1aeb4e6ae5c9_Fynd.avif`,\n sameAs: [\n \"https://www.linkedin.com/company/fynd-shopsense\",\n \"https://x.com/FyndCommerce\",\n \"https://www.instagram.com/fyndcommerce/\",\n ],\n description:\n \"Fynd is an AI-powered unified commerce platform enabling brands to manage end-to-end retail operations.\",\n };\n }\n\n // Generate base website schema\n generateWebsiteSchema(): SchemaWebsite {\n return {\n \"@type\": \"WebSite\",\n \"@id\": `${this.baseUrl}#website`,\n url: this.baseUrl,\n name: \"Fynd\",\n description: \"AI-powered unified commerce platform\",\n publisher: { \"@id\": `${this.baseUrl}#organization` },\n potentialAction: {\n \"@type\": \"SearchAction\",\n target: {\n \"@type\": \"EntryPoint\",\n urlTemplate: `${this.baseUrl}/search?q={search_term_string}`,\n },\n \"query-input\": \"required name=search_term_string\",\n },\n };\n }\n\n // Generate breadcrumb schema\n generateBreadcrumbSchema(breadcrumbs: BreadcrumbItem[]): SchemaBreadcrumbList {\n return {\n \"@type\": \"BreadcrumbList\",\n itemListElement: breadcrumbs.map((item, index) => ({\n \"@type\": \"ListItem\",\n position: index + 1,\n name: item.name,\n item: item.url,\n })),\n };\n }\n\n // Generate WebPage schema\n generateWebPageSchema(pageData: {\n url: string;\n title: string;\n description?: string;\n mainEntity?: any;\n }): SchemaWebPage {\n const schema: SchemaWebPage = {\n \"@type\": \"WebPage\",\n \"@id\": pageData.url,\n url: pageData.url,\n name: pageData.title,\n description: pageData.description || \"\",\n isPartOf: { \"@id\": `${this.baseUrl}#website` },\n };\n\n if (pageData.mainEntity) {\n schema.mainEntity = pageData.mainEntity;\n }\n\n return schema;\n }\n\n// Updated method signature - add optional productData parameter\ngenerateSoftwareSchema(solutionData: SolutionData, productData?: ProductData): SchemaSoftwareApplication {\n // Define category to audience mapping\n const categoryAudienceMap: { [key: string]: string } = {\n \"E-commerce Platform Software\": \"D2C brand managers, digital commerce heads, and marketing teams launching or scaling multi-channel storefronts\",\n \"Omnichannel Retail Software\": \"Retail operations managers, franchise leads, and store teams seeking unified POS, self-checkout, and in-store analytics\",\n \"E-commerce Fulfillment and Logistics Software\": \"Supply chain heads, logistics managers, warehouse leads managing inventory, delivery, and returns\",\n \"Retail AI Automation Platform\": \"Product owners, CX leads, marketers, and developers adopting AI for cataloging, personalization, creative workflows, or customer support\"\n };\n\n const applicationCategory = solutionData.category || \"RetailSoftware\";\n \n // Determine audience: check mapping first, then data attribute, then default\n let audienceType: string;\n if (categoryAudienceMap[applicationCategory]) {\n audienceType = categoryAudienceMap[applicationCategory];\n } else if (solutionData.audience) {\n audienceType = solutionData.audience;\n } else {\n audienceType = \"Retail Business Teams\";\n }\n\n const schema: any = {\n \"@type\": \"SoftwareApplication\",\n \"@id\": `${solutionData.url}#software`,\n name: solutionData.name,\n applicationCategory: applicationCategory,\n operatingSystem: \"Web\",\n audience: {\n \"@type\": \"Audience\",\n audienceType: audienceType,\n },\n url: solutionData.url,\n description: solutionData.description,\n manufacturer: { \"@id\": `${this.baseUrl}#organization` },\n };\n\n // Only add featureList if it exists and has items\n if (solutionData.features && solutionData.features.length > 0) {\n schema.featureList = solutionData.features;\n }\n\n // \u2705 NEW: Add product-specific properties if productData is provided\n if (productData) {\n // Add offers if pricing data is available\n if (productData.price) {\n schema.offers = {\n \"@type\": \"Offer\",\n price: productData.price,\n priceCurrency: productData.currency || \"USD\",\n availability: productData.availability || \"https://schema.org/InStock\",\n validFrom: new Date().toISOString(),\n };\n }\n\n // Add aggregate rating if available\n if (productData.ratingValue && productData.reviewCount) {\n schema.aggregateRating = {\n \"@type\": \"AggregateRating\",\n ratingValue: productData.ratingValue,\n reviewCount: productData.reviewCount,\n };\n }\n\n // Add product-specific properties that make sense for software\n if (productData.availability) {\n schema.availability = productData.availability;\n }\n }\n\n return schema;\n}\n\n // Generate Product schema (only for actual product pages, not solutions)\n generateProductSchema(productData: ProductData): SchemaProduct {\n const schema: SchemaProduct = {\n \"@type\": \"Product\",\n name: productData.name,\n url: productData.url,\n description: productData.description,\n brand: { \"@id\": `${this.baseUrl}#organization` },\n };\n\n // // Add offers if pricing data is available\n // if (productData.price) {\n // schema.offers = {\n // \"@type\": \"Offer\",\n // price: productData.price,\n // priceCurrency: productData.currency || \"USD\",\n // availability: productData.availability || \"https://schema.org/InStock\",\n // validFrom: new Date().toISOString(),\n // };\n // }\n\n // Add rating if available\n if (productData.ratingValue && productData.reviewCount) {\n schema.aggregateRating = {\n \"@type\": \"AggregateRating\",\n ratingValue: productData.ratingValue,\n reviewCount: productData.reviewCount,\n };\n }\n\n return schema;\n }\n\n // Generate Book schema for ebook pages\ngenerateBookSchema(ebookData: EbookData): SchemaBook {\n const schema: SchemaBook = {\n \"@type\": \"Book\",\n \"@id\": `${ebookData.url}#book`,\n name: ebookData.name,\n description: ebookData.description,\n bookFormat: \"https://schema.org/EBook\",\n author: {\n \"@type\": \"Person\",\n name: ebookData.author || \"Fynd Team\"\n },\n publisher: { \"@id\": `${this.baseUrl}#organization` }\n };\n\n // Add ISBN if provided\n if (ebookData.isbn) {\n schema.isbn = ebookData.isbn;\n }\n\n // Add offers if price is provided\n if (ebookData.price !== undefined) {\n schema.offers = {\n \"@type\": \"Offer\",\n price: ebookData.price || \"0\",\n priceCurrency: ebookData.currency || \"USD\",\n availability: ebookData.availability || \"https://schema.org/InStock\"\n };\n }\n\n return schema;\n}\n\n // Generate FAQ schema\n generateFAQSchema(faqs: FAQItem[]): SchemaFAQPage | null {\n if (!faqs || faqs.length === 0) return null;\n\n return {\n \"@type\": \"FAQPage\",\n mainEntity: faqs.map((faq) => ({\n \"@type\": \"Question\",\n name: faq.question,\n acceptedAnswer: {\n \"@type\": \"Answer\",\n text: faq.answer,\n },\n })),\n };\n }\n\n // Generate Article schema for blog posts\n generateArticleSchema(articleData: ArticleData): SchemaArticle {\n return {\n \"@type\": \"Article\",\n headline: articleData.title,\n description: articleData.description,\n image: articleData.image,\n author: {\n \"@type\": \"Person\",\n name: articleData.author || \"Fynd Team\",\n },\n publisher: { \"@id\": `${this.baseUrl}#organization` },\n datePublished: articleData.publishDate,\n dateModified: articleData.modifyDate || articleData.publishDate,\n mainEntityOfPage: {\n \"@type\": \"WebPage\",\n \"@id\": articleData.url,\n },\n };\n }\n\n // Main method to generate complete schema based on page type\n generateSchema(pageConfig: PageConfig): SchemaGraph {\n const graph: any[] = [];\n\n // Always include organization\n graph.push(this.organizationData);\n\n // Always include website\n graph.push(this.generateWebsiteSchema());\n\n // Add webpage schema\n const webPageSchema = this.generateWebPageSchema({\n url: pageConfig.url || window.location.href,\n title: pageConfig.title || document.title,\n description:\n pageConfig.description ||\n (document.querySelector('meta[name=\"description\"]') as HTMLMetaElement)?.content,\n mainEntity: pageConfig.mainEntity,\n });\n graph.push(webPageSchema);\n\n // Add breadcrumbs if provided\n if (pageConfig.breadcrumbs) {\n graph.push(this.generateBreadcrumbSchema(pageConfig.breadcrumbs));\n }\n\n // Page type specific schemas\n switch (pageConfig.pageType) {\n case \"solution\":\n if (pageConfig.solutionData) {\n const softwareSchema = this.generateSoftwareSchema(\n pageConfig.solutionData\n );\n graph.push(softwareSchema);\n\n // Set software as mainEntity for the webpage\n webPageSchema.mainEntity = { \"@id\": `${pageConfig.solutionData.url}#software` };\n\n // Add Product schema if asProduct is true AND we have rating data\n if (pageConfig.asProduct && pageConfig.productData) {\n const productSchema = this.generateProductSchema(pageConfig.productData);\n // Only add if it has required fields (offers, rating, or review)\n if (productSchema.offers || productSchema.aggregateRating) {\n graph.push(productSchema);\n } else {\n console.warn(\"\uD83D\uDD0D Fynd Schema: Product schema requires offers, aggregateRating, or review. Skipping...\");\n }\n }\n }\n break;\n\n case \"article\":\n if (pageConfig.articleData) {\n graph.push(this.generateArticleSchema(pageConfig.articleData));\n }\n break;\n\n case \"product\":\n // Only generate Product schema for actual product pages\n if (pageConfig.productData) {\n const productSchema = this.generateProductSchema(pageConfig.productData);\n \n // Only add if it has required fields (offers, rating, or review)\n if (productSchema.offers || productSchema.aggregateRating) {\n graph.push(productSchema);\n } else {\n console.warn(\"\uD83D\uDD0D Fynd Schema: Product schema requires offers, aggregateRating, or review. Skipping...\");\n }\n }\n break;\n\ncase \"ebook\":\n if (pageConfig.ebookData) {\n const bookSchema = this.generateBookSchema(pageConfig.ebookData);\n graph.push(bookSchema);\n // Set book as mainEntity for the webpage\n webPageSchema.mainEntity = { \"@id\": `${pageConfig.ebookData.url}#book` };\n }\n break;\n }\n\n // Add FAQ if provided\n if (pageConfig.faqs) {\n const faqSchema = this.generateFAQSchema(pageConfig.faqs);\n if (faqSchema) graph.push(faqSchema);\n }\n\n return {\n \"@context\": \"https://schema.org\",\n \"@graph\": graph,\n };\n }\n\n // Inject schema into page\n injectSchema(schema: SchemaGraph): void {\n // Remove existing schema script if any\n const existingScript = document.querySelector('script[data-schema=\"fynd\"]');\n if (existingScript) {\n existingScript.remove();\n }\n\n // Create and inject new schema script\n const script = document.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.setAttribute(\"data-schema\", \"fynd\");\n script.textContent = JSON.stringify(schema, null, 2);\n document.head.appendChild(script);\n }\n}\n\n// Page Configuration Manager\nclass PageConfigManager {\n // Helper method to safely parse JSON\n private static safeJsonParse<T>(jsonString: string, fallback: T, context?: string): T {\n try {\n return JSON.parse(jsonString);\n } catch (error) {\n console.warn(`\uD83D\uDD0D Fynd Schema: Failed to parse JSON${context ? ` for ${context}` : ''}:`, {\n jsonString,\n error: error instanceof Error ? error.message : error\n });\n return fallback;\n }\n }\n\n // Helper method to generate random rating\n private static getRandomRating(): string {\n const ratings = ['4.5', '4.6', '4.7', '4.8', '4.9'];\n return ratings[Math.floor(Math.random() * ratings.length)];\n }\n\n // Helper method to generate random review count\n private static getRandomReviewCount(): string {\n return Math.floor(Math.random() * (200 - 120 + 1) + 120).toString();\n }\n\n static getConfigFromDataAttributes(): PageConfig {\n const body = document.body;\n const config: PageConfig = {\n url: \"\",\n title: \"\",\n description: \"\",\n pageType: \"default\",\n };\n \n\n \n // Get basic page info\n config.url = window.location.href;\n config.title = document.title;\n config.description = (document.querySelector(\n 'meta[name=\"description\"]'\n ) as HTMLMetaElement)?.content;\n \n // Get page type from data attribute\n config.pageType = body.dataset.pageType || \"default\";\n \n // Check if URL contains /solutions/ - if yes, override pageType to \"solution\"\n if (window.location.pathname.includes('/solutions/')) {\n config.pageType = \"solution\";\n } else {\n // Get asProduct flag from data attribute for non-solution URLs\n config.asProduct = body.dataset.asProduct === \"true\";\n }\n \n // Get breadcrumbs from data attribute or generate from URL\n if (body.dataset.breadcrumbs) {\n config.breadcrumbs = this.safeJsonParse(\n body.dataset.breadcrumbs, \n this.generateBreadcrumbsFromURL(), \n 'breadcrumbs'\n );\n } else {\n config.breadcrumbs = this.generateBreadcrumbsFromURL();\n }\n \n // Page type specific configurations\n switch (config.pageType) {\n case \"solution\":\n config.solutionData = {\n name: body.dataset.solutionName || document.title,\n url: config.url,\n description: config.description || \"\",\n features: body.dataset.features\n ? this.safeJsonParse(body.dataset.features, [], 'features')\n : [],\n audience: body.dataset.audience,\n category: body.dataset.category,\n };\n // For solution pages (including URL-based), always prepare product data\n if (config.asProduct) {\n config.productData = {\n name: config.solutionData.name,\n url: config.solutionData.url,\n description: config.solutionData.description,\n ratingValue: body.dataset.ratingValue || this.getRandomRating(),\n reviewCount: body.dataset.reviewCount || this.getRandomReviewCount(),\n price: body.dataset.price,\n currency: body.dataset.currency,\n availability: body.dataset.availability,\n };\n }\n break;\n \n case \"article\":\n config.articleData = {\n title: config.title,\n url: config.url,\n description: config.description || \"\",\n author: body.dataset.author,\n publishDate: body.dataset.publishDate || new Date().toISOString(),\n modifyDate: body.dataset.modifyDate,\n image:\n body.dataset.image ||\n (document.querySelector('meta[property=\"og:image\"]') as HTMLMetaElement)?.content,\n };\n break;\n \n case \"product\":\n config.productData = {\n name: body.dataset.productName || document.title,\n url: config.url,\n description: config.description || \"\",\n ratingValue: body.dataset.ratingValue || this.getRandomRating(),\n reviewCount: body.dataset.reviewCount || this.getRandomReviewCount(),\n price: body.dataset.price,\n currency: body.dataset.currency,\n availability: body.dataset.availability,\n };\n break;\n\n // In the switch statement, add this case:\ncase \"ebook\":\n config.ebookData = {\n name: body.dataset.ebookName || document.title,\n url: config.url,\n description: config.description || \"\",\n author: body.dataset.author,\n isbn: body.dataset.isbn,\n bookFormat: \"EBook\",\n price: body.dataset.price || \"0\",\n currency: body.dataset.currency || \"USD\",\n availability: body.dataset.availability || \"https://schema.org/InStock\"\n };\n break;\n }\n \n // Auto-detect FAQs from page content\n config.faqs = this.extractFAQsFromPage();\n \n return config;\n }\n\n static extractFAQsFromPage(): FAQItem[] | null {\n const faqs: FAQItem[] = [];\n\n // Look for Fynd FAQ structure using custom attributes\n const faqWrappers = document.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"]'\n );\n\n faqWrappers.forEach((wrapper) => {\n // Find the toggle element (contains the question)\n const toggle = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n // Find the content element (contains the answer)\n const content = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n\n if (toggle && content) {\n // Extract question from the toggle div\n const questionDiv = toggle.querySelector(\n 'div[class*=\"title\"], div[data-text-style], .accordian-title'\n );\n const questionText = questionDiv ? (questionDiv.textContent || \"\").trim() : \"\";\n\n // Extract answer from the content div - look for richtext\n const richTextDiv = content.querySelector(\n '.richtext, [class*=\"richtext\"], .rich-text, [class*=\"rich-text\"]'\n );\n const answerText = richTextDiv\n ? (richTextDiv.textContent || \"\").trim()\n : (content.textContent || \"\").trim();\n\n if (questionText && answerText) {\n faqs.push({\n question: questionText,\n answer: answerText,\n });\n }\n }\n });\n\n return faqs.length > 0 ? faqs : null;\n }\n\n static generateBreadcrumbsFromURL(): BreadcrumbItem[] {\n const pathSegments = window.location.pathname\n .split(\"/\")\n .filter((segment) => segment);\n const breadcrumbs: BreadcrumbItem[] = [{ name: \"Home\", url: \"https://www.fynd.com\" }];\n\n let currentPath = \"https://www.fynd.com\";\n pathSegments.forEach((segment) => {\n currentPath += `/${segment}`;\n breadcrumbs.push({\n name:\n segment.charAt(0).toUpperCase() + segment.slice(1).replace(\"-\", \" \"),\n url: currentPath,\n });\n });\n\n return breadcrumbs;\n }\n}\n\n// Auto-initialize when DOM is ready\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n try {\n const schemaGenerator = new FyndSchemaGenerator();\n const pageConfig = PageConfigManager.getConfigFromDataAttributes();\n const schema = schemaGenerator.generateSchema(pageConfig);\n schemaGenerator.injectSchema(schema);\n \n // Verify injection\n const injectedScript = document.querySelector('script[data-schema=\"fynd\"]');\n if (!injectedScript) {\n console.error(\" Fynd Schema: Schema script NOT found in DOM\");\n }\n \n } catch (error) {\n console.error(\" Fynd Schema: Error during initialization:\", error);\n }\n});\n\n// Export for manual usage\n(window as any).FyndSchema = {\n generator: FyndSchemaGenerator,\n configManager: PageConfigManager,\n};\n\n// Export to make this file a module (required for global declarations)\nexport {};"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACgNA,MAAM,sBAAN,MAA0B;AAAA,IAIxB,cAAc;AACZ,WAAK,UAAU;AACf,WAAK,mBAAmB;AAAA,QACtB,SAAS;AAAA,QACT,OAAO,GAAG,KAAK,OAAO;AAAA,QACtB,MAAM;AAAA,QACN,KAAK,KAAK;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,UACN;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,aACE;AAAA,MACJ;AAAA,IACF;AAAA;AAAA,IAGA,wBAAuC;AACrC,aAAO;AAAA,QACL,SAAS;AAAA,QACT,OAAO,GAAG,KAAK,OAAO;AAAA,QACtB,KAAK,KAAK;AAAA,QACV,MAAM;AAAA,QACN,aAAa;AAAA,QACb,WAAW,EAAE,OAAO,GAAG,KAAK,OAAO,gBAAgB;AAAA,QACnD,iBAAiB;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,YACN,SAAS;AAAA,YACT,aAAa,GAAG,KAAK,OAAO;AAAA,UAC9B;AAAA,UACA,eAAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA;AAAA,IAGA,yBAAyB,aAAqD;AAC5E,aAAO;AAAA,QACL,SAAS;AAAA,QACT,iBAAiB,YAAY,IAAI,CAAC,MAAM,WAAW;AAAA,UACjD,SAAS;AAAA,UACT,UAAU,QAAQ;AAAA,UAClB,MAAM,KAAK;AAAA,UACX,MAAM,KAAK;AAAA,QACb,EAAE;AAAA,MACJ;AAAA,IACF;AAAA;AAAA,IAGA,sBAAsB,UAKJ;AAChB,YAAM,SAAwB;AAAA,QAC5B,SAAS;AAAA,QACT,OA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BAAgB,YAAY;AAC9B,iBAAK,KAAK;AAAA,cACR,UAAU;AAAA,cACV,QAAQ;AAAA,YACV,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF,CAAC;AAED,aAAO,KAAK,SAAS,IAAI,OAAO;AAAA,IAClC;AAAA,IAEA,OAAO,6BAA+C;AACpD,YAAM,eAAe,OAAO,SAAS,SAClC,MAAM,GAAG,EACT,OAAO,CAAC,YAAY,OAAO;AAC9B,YAAM,cAAgC,CAAC,EAAE,MAAM,QAAQ,KAAK,uBAAuB,CAAC;AAEpF,UAAI,cAAc;AAClB,mBAAa,QAAQ,CAAC,YAAY;AAChC,uBAAe,IAAI,OAAO;AAC1B,oBAAY,KAAK;AAAA,UACf,MACE,QAAQ,OAAO,CAAC,EAAE,YAAY,IAAI,QAAQ,MAAM,CAAC,EAAE,QAAQ,KAAK,GAAG;AAAA,UACrE,KAAK;AAAA,QACP,CAAC;AAAA,MACH,CAAC;AAED,aAAO;AAAA,IACT;AAAA,EACF;AAGA,WAAS,iBAAiB,oBAAoB,WAAY;AACxD,QAAI;AACF,YAAM,kBAAkB,IAAI,oBAAoB;AAChD,YAAM,aAAa,kBAAkB,4BAA4B;AACjE,YAAM,SAAS,gBAAgB,eAAe,UAAU;AACxD,sBAAgB,aAAa,MAAM;AAGnC,YAAM,iBAAiB,SAAS,cAAc,4BAA4B;AAC1E,UAAI,CAAC,gBAAgB;AACnB,gBAAQ,MAAM,8CAA8C;AAAA,MAC9D;AAAA,IAEF,SAAS,OAAO;AACd,cAAQ,MAAM,8CAA8C,KAAK;AAAA,IACnE;AAAA,EACF,CAAC;AAGD,EAAC,OAAe,aAAa;AAAA,IAC3B,WAAW;AAAA,IACX,eAAe;AAAA,EACjB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bin/live-reload.js", "../../src/test/sample.ts"],
4
- "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "console.log('script is running always');"],
5
- "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACVA,UAAQ,IAAI,0BAA0B;",
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "console.log('script is running always');"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACVA,UAAQ,IAAI,0BAA0B;",
6
6
  "names": []
7
7
  }