{ "version": 3, "sources": ["../../../../../../owl-nest/ulule/features/project/src/public/layout/DetailLayout.tsx", "../../../../../../owl-nest/common/feature-detection/src/positionSticky.ts", "../../../../../../owl-nest/common/confetti/index.ts", "../../../../../../owl-nest/ulule/common/sticky-within/index.ts", "../../../../../../owl-nest/ulule/common/sticky-within/src/useStickyFromContext.ts", "../../../../../../owl-nest/ulule/common/sticky-within/src/stickyContext.ts", "../../../../../../owl-nest/ulule-next/common/layout/src/index.ts", "../../../../../../owl-nest/ulule-next/common/layout/src/backgrounds/index.ts", "../../../../../../owl-nest/ulule-next/common/layout/src/backgrounds/Waves.tsx", "../../../../../../owl-nest/ulule-next/common/layout/src/modals/index.ts", "../../../../../../owl-nest/ulule-next/common/layout/src/modals/FollowProject.tsx", "../../../../../../owl-nest/ulule-next/common/layout/src/modals/Nsfw.tsx", "../../../../../../owl-nest/ulule-next/common/layout/src/modals/ShareProject.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/layout/HeaderLayout.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/PreviewBar.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/LilSam.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/useLilSam.ts", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/useOnboardingStep.ts", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/Accepted.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/layout/index.ts", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/layout/Coach.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/layout/Notification.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/layout/SimpleModal.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/ComingSoon.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/Examples.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/Message.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/OffboardingFunded.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/OffboardingSuccess.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/Submit/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/Preview.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/Validated.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/LilSam/view/Welcome.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/useStep.ts", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/DonationBlock.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Heading.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/LiveEvents.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Owner.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/PartnerRibbon.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/PrimaryMedia.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Statistics.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Orders.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Diptych.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/AnimateCounter.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Supporters.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/DateInfo.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Progress.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Triptych.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/SocialActions.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/Sponsors.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/Share.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/ProjectFinanced.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/ProjectCancelled.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/ProjectFinancedOffboarding.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/ProjectFinishedDonationBased.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/ProjectNotFinanced.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/ContributionsBlock.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/Contribution.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/BackersBlock/RewardList.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/HeroHeader/hooks.ts", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/Menu.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/layout/PublicLayout.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/Modal.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/LaunchShareModal.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/PaymentDisturbanceModal.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/RewardModals.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/PostCampaignModal.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/RewardModal.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/ShareOverlay.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/Home/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/Home/Like.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/Home/SuccessMessage.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/components/SplashTitle.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/Home/Title.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/Context.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/coming-soon/components/ComingSoonHeader.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/BrowserScreenshot.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/SuggestedProjectsList.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/SuggestedProject.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/TabRouter.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/tabs/backers/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/models/fan.ts", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/components/Backer.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/utils/formatBacker.ts", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/tabs/backers/Follower.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/views/detail/tabs/backers/Sponsor.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/index.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/Welcome.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/Profile.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/components/Progress.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/components/Coaching.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/components/Actions.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/components/Tip.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/styles.ts", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/Category.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/CommunityOnboarding.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/ProjectType.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/RewardType.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/Training.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/view/Slug.tsx", "../../../../../../owl-nest/ulule/features/project/src/public/components/Onboarding/Layout.tsx", "../../../../../../owl-nest/ulule/features/project/src/actions/channel.ts"], "sourcesContent": ["import * as React from 'react'\nimport * as Redux from 'react-redux'\nimport { useLocation } from 'react-router-dom'\nimport * as jotai from 'jotai'\nimport styled, { css } from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { ConfiguredNavMenu, PM_MENU_WIDTH, Screen } from '@owl-nest/project-manager-nav'\nimport { renderConfetti } from '@owl-nest/confetti'\nimport * as cookie from '@owl-nest/cookie-helper'\nimport * as env from '@owl-nest/config'\nimport { StickyStatus, stickyContext, useStickyFromContext } from '@owl-nest/sticky-within'\nimport { Footer, getNavSectionList } from '@owl-nest/layout'\nimport * as hooks from '@owl-nest/hooks'\nimport * as messages from '@owl-nest/messages'\nimport * as models from '@owl-nest/models'\nimport * as shadow from '@owl-nest/shadow'\nimport { scroll } from '@owl-nest/utils'\nimport * as layout from '@ulule/layout'\n\nimport * as modalAction from '../../actions/modal'\nimport { useDisplayMode } from '../hooks/useDisplayMode'\nimport { useNavigation } from '../hooks/useNavigation'\nimport * as projectModel from '../models/project'\nimport { RootState } from '../../reducers'\nimport * as UFE from './../../UFE'\n\nimport { DisplayMode } from '../context'\nimport { HeaderLayout } from './HeaderLayout'\nimport { HeroHeader } from '../views/detail/components/HeroHeader'\nimport { Menu } from '../views/detail/components/Menu'\nimport { PATHS } from '../paths'\nimport { PublicLayout } from './PublicLayout'\nimport { BackersBlock, BlockStatus } from '../views/detail/components/BackersBlock'\nimport { SuggestedProjectsList } from '../views/detail/components/SuggestedProjectsList'\nimport { TabRouter } from '../TabRouter'\nimport { Onboarding } from '../components/Onboarding'\n\nimport { EDIT_MODE_TABLET_BREAKPOINT } from '../views/detail/constants'\n\nconst StickyContextBase = stickyContext(Menu, {\n sticky: (status) => {\n switch (status) {\n case StickyStatus.PreSticky: {\n return css`\n position: absolute;\n top: 0;\n `\n }\n case StickyStatus.Sticky:\n case StickyStatus.PostSticky: {\n return css`\n position: fixed;\n top: 0;\n `\n }\n }\n },\n fallbackToSticky: true,\n})\n\nconst StickyHeaderContext = stickyContext(HeaderLayout, {\n sticky: () => {\n return css``\n },\n fallbackToSticky: true,\n})\n\nexport const SCROLL_TO_ATOM = jotai.atom('')\n\nexport function DetailLayout(): React.ReactElement {\n const dispatch = Redux.useDispatch()\n\n const project = Redux.useSelector((state) => state.application.project.data)\n const userConfig = env.useUserEnv()\n\n const role = models.project.getEditingUserRole(project, UFE.CURRENT_USER.is_staff)\n\n const showOnboarding = models.project.showOnboardingSteps(project)\n const displayMode = useDisplayMode(project)\n const isEditMode = displayMode === 'edit'\n\n const contextRef = React.useRef(null)\n const stickyStatus = useStickyFromContext(contextRef, { top: -60 })\n const isSticky = stickyStatus !== StickyStatus.PreSticky\n\n const headerContextRef = React.useRef(null)\n const headerStickyStatus = useStickyFromContext(headerContextRef, { top: 10 })\n const isHeaderSticky = headerStickyStatus === StickyStatus.Sticky\n\n const setScrollTo = jotai.useSetAtom(SCROLL_TO_ATOM)\n const setIsProjectDetailLaunchShareModalOpen = hooks.useSetModal('ProjectDetailLaunchShare')\n\n const navigation = useNavigation()\n const location = useLocation()\n\n const { href, search } = window.location\n const urlParams = new URLSearchParams(search)\n const hasConfetti = urlParams.has('confettis')\n const messenger = messages.useMessage()\n\n const breakpoint = isEditMode ? EDIT_MODE_TABLET_BREAKPOINT : plume.BREAKPOINTS.TABLET\n\n const isTablet = hooks.useDramaticallyInefficientMediaQuery(breakpoint)\n\n const firstLocationChangeRef = React.useRef(true)\n\n React.useLayoutEffect(() => {\n const locationState = location?.state as any\n\n if (navigation.is(PATHS.PROJECT) && locationState?.scrollTarget !== undefined) {\n setScrollTo(locationState?.scrollTarget)\n } else {\n // When changing tabs, scroll the top of the new active tab into view.\n // To avoid interfering with in-page anchors, we check for hash existence first.\n if (\n (!firstLocationChangeRef.current && !location.hash) ||\n ['#comments/', '#faq/', '#rewards/'].includes(location.hash)\n ) {\n // HACK: `setTimeout` is necessary for Gecko (Firefox), which otherwise may skip the scrolling instruction.\n setTimeout(function () {\n scroll.animatedScrollTo(getOffsetTop(contextRef.current), 100)\n }, 5)\n } else {\n setScrollTo('')\n }\n }\n\n firstLocationChangeRef.current = false\n }, [location])\n\n React.useEffect(() => {\n const toast = new URLSearchParams(window.location.search).get('toast')\n\n if (toast) {\n messenger.confirm({\n context: 'from-url-param',\n forceClose: true,\n message: toast,\n type: 'toast',\n })\n }\n\n const rewardId = new URLSearchParams(window.location.search).get('reward')\n if (rewardId) {\n dispatch(modalAction.setRewardId(rewardId))\n dispatch(modalAction.toggleModalReward(true))\n }\n\n const launch = new URLSearchParams(window.location.search).get('launch')\n\n if (launch) {\n setIsProjectDetailLaunchShareModalOpen(true)\n }\n }, [])\n\n React.useEffect(() => {\n // check url parameters\n if (!hasConfetti) {\n return\n } else {\n urlParams.delete('confettis')\n // replace url parameters\n const newUrl = href.replace(search.substring(1), urlParams.toString())\n window.history.replaceState({}, '', newUrl)\n // confetti\n renderConfetti()\n }\n }, [])\n\n // TODO: IMPROVEMENT: This should be a global behaviour (as in the good old `features/init`)\n const { sendBrandsOnPage } = shadow.usePartnershipTracker(undefined, { current: null }, {})\n React.useEffect(() => {\n sendBrandsOnPage()\n }, [])\n\n if (models.project.isCancelled(project)) {\n return (\n \n \n \n \n \n\n {isTablet && isEditMode && (\n \n \n \n )}\n \n \n \n \n \n \n \n