import{a as e,i as t,r as n,t as r}from"./utils-n_QKOn6P.mjs";const i={path:`/upvoted/:period?/:innerSharedContent?/:dateSort?`,example:`/daily/upvoted/7`,view:0,radar:[{source:[`app.daily.dev/upvoted`]}],parameters:{innerSharedContent:{description:`Where to Fetch inner Shared Posts instead of original`,default:`false`,options:[{value:`false`,label:`False`},{value:`true`,label:`True`}]},dateSort:{description:`Sort posts by publication date instead of popularity`,default:`true`,options:[{value:`false`,label:`False`},{value:`true`,label:`True`}]},period:{description:`Period of Lookup`,default:`7`,options:[{value:`7`,label:`Last Week`},{value:`30`,label:`Last Month`},{value:`365`,label:`Last Year`}]}},name:`Most upvoted`,maintainers:[`Rjnishant530`],handler:a,url:`app.daily.dev/upvoted`};async function a(i){let a=`${r}/posts/upvoted`,o=i.req.query(`limit`)?Number.parseInt(i.req.query(`limit`),10):20,s=i.req.param(`innerSharedContent`)?JSON.parse(i.req.param(`innerSharedContent`)):!1,c=i.req.param(`dateSort`)?JSON.parse(i.req.param(`dateSort`)):!0,l=i.req.param(`period`)?Number.parseInt(i.req.param(`period`),10):7;return{title:`Most upvoted posts for developers | daily.dev`,link:a,item:t(await n({query:`
    query MostUpvotedFeed($loggedIn: Boolean! = false, $first: Int, $after: String, $period: Int, $supportedTypes: [String!] = ["article", "share", "freeform", "video:youtube", "collection"], $source: ID, $tag: String) {
        page: mostUpvotedFeed(first: $first, after: $after, period: $period, supportedTypes: $supportedTypes, source: $source, tag: $tag) {
            ...FeedPostConnection
        }
    }

    fragment FeedPostConnection on PostConnection {
        pageInfo {
            hasNextPage
            endCursor
        }
        edges {
            node {
                ...FeedPost
                contentHtml
                ...UserPost @include(if: $loggedIn)
            }
        }
    }

    fragment FeedPost on Post {
        ...FeedPostInfo
        sharedPost {
            id
            title
            image
            readTime
            permalink
            commentsPermalink
            createdAt
            type
            tags
            source {
                id
                handle
                permalink
                image
            }
            slug
            clickbaitTitleDetected
        }
        trending
        feedMeta
        collectionSources {
            handle
            image
        }
        numCollectionSources
        updatedAt
        slug
    }

    fragment FeedPostInfo on Post {
        id
        title
        image
        readTime
        permalink
        commentsPermalink
        createdAt
        commented
        bookmarked
        views
        numUpvotes
        numComments
        summary
        bookmark {
            remindAt
        }
        author {
            id
            name
            image
            username
            permalink
        }
        type
        tags
        source {
            id
            handle
            name
            permalink
            image
            type
        }
        userState {
            vote
            flags {
                feedbackDismiss
            }
        }
        slug
        clickbaitTitleDetected
    }

    fragment UserPost on Post {
        read
        upvoted
        commented
        bookmarked
        downvoted
    }
`,variables:{...e,period:l,first:o}}),s,c),description:`Find the most upvoted developer posts on daily.dev. Explore top-rated content in coding, tutorials, and tech news from the largest developer network in the world.`,logo:`${r}/favicon-32x32.png`,icon:`${r}/favicon-32x32.png`,language:`en-us`}}export{i as route};