{"version":3,"sources":["jsdelivr-header.js","/gh/lazzo-io/cdn@main/js/youtube.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,QAAW,SAAS,kBAAkB,WAAW,OAAS,GAAK,SAAS,kBAAkB,WAAW,GAAG,aAAa,YAAe,EAEpI,WAAc,SAAS,kBAAkB,WAAW,OAAS,GAAK,SAAS,kBAAkB,WAAW,GAAG,aAAa,eAAkB,EAC1I,cAAiB,SAAS,kBAAkB,WAAW,OAAS,GAAK,SAAS,kBAAkB,WAAW,GAAG,aAAa,WAAc,EAEzI,YAAc,2DAA2D,qDAAqD,yBAAyB,gBAEvJ,UAAY,CAChB,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,cAEb,CACE,GAAI,EACJ,MAAO,gBACP,YAAa,gBACb,IAAK,0BACL,UAAW,wGACX,UAAW,eAIf,IAAI,IAAM,IAAI,IAAI,CAChB,GAAI,YACJ,KAAI,KACK,CACL,SAAS,EACT,OAAQ,IAAI,aAGhB,OAAA,GACE,MAAM,aACH,MAAM,GACE,EAAK,SAEb,MAAM,GACE,EAAS,MAAM,KAAK,IACzB,IAAI,EAAa,IAAI,KAAK,EAAM,eAAe,kBAE/C,MAAO,CACL,GAAI,EAAM,GACV,MAA+B,KAAxB,EAAM,QAAQ,MAAe,GAAG,EAAM,QAAQ,MAAM,OAAO,EAAG,IAAI,SAAW,GACpF,YAA2C,KAA9B,EAAM,QAAQ,YAAqB,GAAG,EAAM,QAAQ,YAAY,OAAO,EAAG,IAAI,YAAc,GACzG,IAAK,mCAAmC,EAAM,QAAQ,WAAW,UACjE,UAAW,EAAM,QAAQ,WAAW,OAAO,IAC3C,UAAY,MAAM,EAAW,WAAkG,MAArF,GAAG,EAAW,aAAa,EAAW,WAAa,KAAK,EAAW,gBAC9G,MAGJ,MAAM,IACL,KAAK,OAAS,EACd,KAAK,SAAU,CAAK,IAErB,OAAO,GAAM,QAAQ,IAAI,eAAgB,IAC9C,EACA,OAAA,GAAW,EACX,QAAS,CAAC","file":"/gh/lazzo-io/cdn@main/js/youtube.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /gh/lazzo-io/cdn@main/js/youtube.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const API_KEY = (document.getElementsByName(\"youtube\").length > 0 && document.getElementsByName(\"youtube\")[0].getAttribute(\"api-key\")) || 0;\n\nconst channel_id = (document.getElementsByName(\"youtube\").length > 0 && document.getElementsByName(\"youtube\")[0].getAttribute(\"channel-id\")) || 0;\nconst videos_lenght = (document.getElementsByName(\"youtube\").length > 0 && document.getElementsByName(\"youtube\")[0].getAttribute(\"lenght\")) || 0;\n\nconst YOUTUBE_API = `https://www.googleapis.com/youtube/v3/playlistItems?key=${API_KEY}&part=id,snippet,contentDetails&playlistId=${channel_id}&maxResults=${videos_lenght}`;\n\nconst MY_VIDEOS = [\n  {\n    id: 1,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 2,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 3,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 4,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 5,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 6,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 7,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 8,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n  {\n    id: 9,\n    title: \"Youtube video\",\n    description: \"Youtube video\",\n    url: \"https://www.youtube.com\",\n    thumbnail: \"https://assets.website-files.com/5f287c509db7355a9352ca81/5f33ec97d57872e3f5c5f448_Team-4-p-1080.jpeg\",\n    publishAt: \"2021-01-01\",\n  },\n];\n\nlet app = new Vue({\n  el: \"#appVideo\",\n  data() {\n    return {\n      loading: false,\n      videos: [...MY_VIDEOS],\n    };\n  },\n  created() {\n    fetch(YOUTUBE_API)\n      .then((data) => {\n        return data.json();\n      })\n      .then((response) => {\n        return response.items.map((video) => {\n          let video_date = new Date(video.contentDetails.videoPublishedAt);\n\n          return {\n            id: video.id,\n            title: video.snippet.title !== \"\" ? `${video.snippet.title.substr(0, 55).trim()}` : \"\",\n            description: video.snippet.description !== \"\" ? `${video.snippet.description.substr(0, 90).trim()}...` : \"\",\n            url: `https://www.youtube.com/watch?v=${video.snippet.resourceId.videoId}`,\n            thumbnail: video.snippet.thumbnails.medium.url,\n            publishAt: !isNaN(video_date.getDate()) ? `${video_date.getDate()}/${video_date.getMonth() + 1}/${video_date.getFullYear()}` : \" - \",\n          };\n        });\n      })\n      .then((res) => {\n        this.videos = res;\n        this.loading = false;\n      })\n      .catch((e) => console.log(\"ERROR API : \", e));\n  },\n  mounted() {},\n  methods: {},\n});\n"]}